import { ContentId, LocalizationSettings } from "./Content"; import { AuthorResponse } from "./Author"; import { ContentRepositoryId } from "./ContentRepository"; import { ContentTranslationStatus } from "./ContentTranslation"; import { PagedListResponse } from "./common"; /** * The published content unique id */ export type PublishedContentId = number; /** * The release unique id */ export type ReleaseId = number; /** * The release item unique id */ export type ReleaseItemId = number; /** * This type represent the model of a release item */ export type ReleaseItem = { /** * The release item unique id */ id: ReleaseItemId; /** * The release item related space id */ spaceId: string; /** * The release item related content name */ contentName: string; /** * The release item related content id */ contentId: ContentId; /** * The release item related content tags */ contentTags: string[]; /** * The release item related content definition mnemonic id */ contentDefinitionMnemonicId: string; /** * The release item related content repository unique id */ contentRepositoryId: ContentRepositoryId; /** * The release item related content published id */ publishedContentId: PublishedContentId; /** * The release item related content public id */ publicId: string; /** * The release item related content online date */ onlineDate?: Date; /** * The release item related content offline date */ offlineDate?: Date; /** * Mark if the release item have to be publish */ toPublish: boolean; /** * Content`s locale */ contentLocale: string; /** * Status of the ContentTranslation (defined if content is derived from a translation) */ translationStatus?: ContentTranslationStatus; }; /** * This type represent the model of a release */ export type Release = { /** * The Release unique id */ id: ReleaseId; /** * The release related space id */ spaceId: string; /** * The list of content item in the release */ releaseItems: ReleaseItem[]; /** * Mark if the release is archived */ archived: boolean; }; /** * This type represent the data needed to make a get published content API request */ export type GetPublishedContentRequest = { /** * This published content public id */ publicId: string; /** * The date where to find the published content */ targetDate?: Date; /** * This publishing channel of the content */ publishingChannel: string; }; /** * This type represent the model of a published content */ export type PublishedContentResponse = { /** * The published content unique id */ id: PublishedContentId; /** * The related content unique id */ contentId: ContentId; /** * The published content current version */ contentVersion: number; /** * The publishing channels where the content is published */ contentChannels: string[]; /** * The published content tags */ contentTags: string[]; /** * The published content related content definition mnemonic id */ contentDefinitionMnemonicId: string; /** * The published content related content repository id */ contentRepositoryId: ContentRepositoryId; /** * The published content public id */ publicId: string; /** * The published content payload */ payload: object; /** * The published content online date */ onlineDate?: Date; /** * The published content offline date */ offlineDate?: Date; /** * The creation date of the related content */ createdDate: Date; /** * The update date of the related content */ lastModifiedDate: Date; /** * The creator of the content */ author: AuthorResponse; }; /** * This type represent the data needed to make a set stage content to live API request */ export type SetStageContentsToLiveRequest = { /** * The release id to publish to live */ releaseId: ReleaseId; /** * Skip validating linked contents resolution */ skipLinkedContentValidation?: boolean; }; /** * This type represent the response of a set stage content to live API request */ export type SetStageContentsToLiveResponse = {}; /** * This type represent the data needed to make a create release API request */ export type CreateReleaseRequest = {}; /** * This type represent the response of a create release API request */ export type CreateReleaseResponse = Release; /** * This type represent the data needed to make an update release API request */ export type UpdateReleaseRequest = { /** * The release unique id to update */ releaseId: ReleaseId; /** * The release item to publish */ itemsToPromote: ReleaseItemId[]; /** * Mark if all the puslished content in stage have to be publish to live */ includeAll?: boolean; }; /** * This type represent the response of an update release API request */ export type UpdateReleaseResponse = Release; /** * This type represent the filters that can be applied to release items in the release V2 API requests */ export type ReleaseItemFilters = { /** * Case insensitive search applied to the release item content name and public id */ search?: string; /** * The release item related content locales. Matches items whose content locale is any of the given values */ locale?: string[]; /** * The release item related content definition mnemonic ids */ contentDefinitionMnemonicIds?: string[]; /** * Match only the release items that are (or are not) currently selected to be published */ toPublish?: boolean; }; /** * This type represent the data needed to make a create release V2 API request */ export type CreateReleaseV2Request = {}; /** * This type represent the response of a create release V2 API request. * Unlike [[CreateReleaseResponse]] it does not return the release items, only their count */ export type CreateReleaseV2Response = Omit & { /** * The number of items in the drafted release */ itemsCount: number; }; /** * This type represent the data needed to make an update release V2 API request. * The selection of items to publish is replaced atomically: exactly one of * [[includeAll]], [[filters]] or [[releaseItemIds]] must be provided */ export type UpdateReleaseV2Request = { /** * The release unique id to update */ releaseId: ReleaseId; /** * When true, select all the release items to be published */ includeAll?: boolean; /** * Select the release items matching the given filters. Empty filters select all the release items. * A toPublish filter is evaluated against the selection before the update */ filters?: ReleaseItemFilters; /** * Select the release items with the given ids. An empty list deselects all the release items */ releaseItemIds?: ReleaseItemId[]; }; /** * This type represent the response of an update release V2 API request */ export type UpdateReleaseV2Response = { /** * The updated release unique id */ releaseId: ReleaseId; /** * The number of release items selected to be published */ selectedCount: number; /** * The total number of items in the release */ totalCount: number; }; /** * This type represent the data needed to make a list release items V2 API request */ export type ListReleaseItemsV2Request = { /** * The release unique id */ releaseId: ReleaseId; /** * The number of release items to skip */ skip: number; /** * The number of release items to return (between 1 and 100) */ take: number; /** * The filters to apply to the returned page of release items */ filters?: ReleaseItemFilters; }; /** * This type represent a single locale variant of a content inside a release item group */ export type ReleaseItemVariant = { /** * The release item unique id */ id: ReleaseItemId; /** * The variant content locale */ contentLocale: string | null; /** * Mark if the release item is selected to be published */ toPublish: boolean; /** * Status of the ContentTranslation (defined if content is derived from a translation) */ translationStatus: ContentTranslationStatus | null; /** * The localization settings of the related content */ contentLocalizationSettings: LocalizationSettings; /** * The localized content unique id (defined if content is derived from a translation) */ localizedContentId: string | null; /** * The release item related content tags */ contentTags: string[]; /** * The release item related content online date, as an ISO 8601 string */ onlineDate: string | null; /** * The release item related content offline date, as an ISO 8601 string */ offlineDate: string | null; }; /** * This type represent a release content along with its locale variants matching the request filters */ export type ReleaseItemGroup = { /** * The related content unique id */ contentId: ContentId; /** * The related content public id */ publicId: string; /** * The related content name */ contentName: string; /** * The related content definition mnemonic id */ contentDefinitionMnemonicId: string; /** * The related content repository mnemonic id */ contentRepositoryMnemonicId: string; /** * The locale variants of the content matching the request filters */ variants: ReleaseItemVariant[]; }; /** * This type represent the response of a list release items V2 API request. * The release items are grouped by content: one [[ReleaseItemGroup]] per content id with all of its * filter-matching locale variants, so pagination (over groups) never splits a content across pages * and [[PagedListResponse.total]] counts the matching groups. * The facets ([[locales]], [[contentDefinitionMnemonicIds]]) and [[selectedCount]] are computed * over the whole release, ignoring the request filters */ export type ListReleaseItemsV2Response = PagedListResponse & { /** * The total number of release items matching the request filters */ totalItems: number; /** * The number of release items selected to be published in the whole release */ selectedCount: number; /** * The distinct content locales present in the whole release */ locales: string[]; /** * The distinct content definition mnemonic ids present in the whole release */ contentDefinitionMnemonicIds: string[]; }; /** * This type represent the response of a get published content API request */ export type GetPublishedContentResponse = PublishedContentResponse | undefined;