import { AuthorResponse } from "./Author"; import { PublishingChannelId, PublishingChannelResponse } from "./Channel"; import { PagedListResponse } from "./common"; import { ContentDefinitionId, ContentDefinitionResponse } from "./ContentDefinition"; import { SchemaTypeIds } from "./ContentDefinitionSchema"; import { ContentRepositoryId, ContentRepositoryResponse } from "./ContentRepository"; import { ContentTranslation, ContentTranslationStatus } from "./ContentTranslation"; /** * This type represent the content unique id type */ export type ContentId = number; /** * This enum represent the possible content status */ export declare enum ContentsStatus { archived = "archived", unarchived = "unarchived", all = "all" } /** * This enum represent the fields that can be used to sort a list of contents */ export declare enum ContentSortField { name = "name", publicId = "publicId", createdDate = "createdDate", lastModifiedDate = "lastModifiedDate", onlineDate = "onlineDate", offlineDate = "offlineDate", locale = "locale", definitionName = "definitionName" } /** * This enum represent the possible sort directions */ export declare enum SortDirection { asc = "asc", desc = "desc" } /** * This type represent the data that can be used to sort a list of contents */ export type ListContentsSort = { /** * The field to sort the list of contents by */ field: ContentSortField; /** * The direction to sort the list of contents in */ direction: SortDirection; }; /** * This type represent the model of facet */ export type Facet = { /** * The key of the facet */ key: string; /** * The value of the facet */ value: any; /** * The type of the facet */ type: SchemaTypeIds; }; /** * This type represent the model of an indexed content value */ export type IndexedContent = { /** * THe list of facet field in a content */ facets: Facet[]; }; /** * This interface represent the model of a linked content path item */ export interface PathItem { /** * The name of the field in the content definition */ name: string; } /** * This interface represent the model of a linked content array path item */ export interface ArrayPathItem { /** * The index of the field if it is in an array of linked contents */ index: number; } /** * This type represent the linked content item field path inside the content */ export type FieldPath = (ArrayPathItem | PathItem)[]; /** * This type represent the model of a linked content info inside a content */ export type LinkedContentInfo = { /** * The path to reach the linked content inside the content as an array of items */ path: FieldPath; /** * The full path to reach the linked content inside the content as a string */ pathString: string; /** * The linked content public id */ publicId: string; }; /** * This type represent the model of a linked contents inside the content retrieved */ export type LinkedContentsInfo = { /** * The list of linked contents inside in the content retrieved */ items: LinkedContentInfo[]; }; /** * This type represent the model of a content publishing status */ export type ContentStatus = { /** * The unique content id */ contentId: ContentId; /** * The content space id */ spaceId: string; /** * The published content version to stage */ stageVersion?: number; /** * The published content version to live */ liveVersion?: number; /** * The published content unique id to stage */ stagePublishingId?: number; /** * The published content unique id to live */ livePublishingId?: number; /** * The publishing date to stage */ stagePublishingDate?: string; /** * The publishing date to live */ livePublishingDate?: string; /** * The publishing channels where the content is published in stage */ stageChannels?: string[]; /** * The publishing channels where the content is published in live */ liveChannels?: string[]; /** * The content modified iso date */ modifiedDate?: number; /** * Locale of the content or translation */ contentLocale?: string; /** * version of the content in stage (not translation) */ stageContentVersion?: number; /** * version of the content in live */ liveContentVersion?: number; /** * Whether or not this status belongs to a translation */ isTranslation?: boolean; }; /** * This type represent the data needed to make a create content API request */ export type CreateContentRequest = { /** * The content name */ name: string; /** * The content public id */ publicId?: string; /** * The content payload (this contains all content fields and its values) */ payload: object; /** * The unique id that identify the repository where the content is created */ repositoryId: ContentRepositoryId; /** * The unique id that identify the content definition that is used to create the content */ definitionId: ContentDefinitionId; /** * The list of publishing channels where the content will be published */ channelIds: PublishingChannelId[]; /** * The list of tags related to the content */ tags: string[]; /** * The date where the content will start to be available when published */ onlineDate?: Date; /** * The date where the content will no more be available when published */ offlineDate?: Date; /** * Locale of the content */ locale?: string; /** * Controls if translations should be ignored when publishing */ contentLocalizationSettings?: LocalizationSettings; /** * will bypass content definition mnemonicId validation for every linked-content field */ bypassLinkedContentValidation?: boolean; /** * set an identifier coming from a third party application */ externalIdentifier?: string; }; /** * This type represent the data needed to make a update content API request */ export type UpdateContentRequest = { /** * The unique content id */ id: ContentId; /** * The content public id */ publicId: string; /** * The content name */ name: string; /** * The content payload (this contains all content fields and its values) */ payload: object; /** * The unique id that identify the repository where the content is created */ repositoryId: ContentRepositoryId; /** * The list of publishing channels where the content will be published */ definitionId: ContentDefinitionId; /** * The list of publishing channels where the content will be published */ channelIds: PublishingChannelId[]; /** * The list of tags related to the content */ tags: string[]; /** * The date where the content will start to be available when published */ onlineDate?: Date; /** * The date where the content will no more be available when published */ offlineDate?: Date; /** * Controls if translations should be ignored when publishing */ contentLocalizationSettings?: LocalizationSettings; /** * will bypass content definition mnemonicId validation for every linked-content field */ bypassLinkedContentValidation?: boolean; /** * set an identifier coming from a third party application */ externalIdentifier?: string; }; /** * This type represent the data that can be used to filter a list of contents */ export type ListContentsFilters = { /** * This filter is used to search contents that contain the value inserted */ name?: string; /** * This filter is used to search contents that used the content definition ids inserted */ contentDefinitionIds?: number[]; /** * This filter is used to search contents that used the content definition mnemonic ids inserted */ definitionMnemonicIds?: string[]; /** * This filter is used to search contents that are saved in the repository ids inserted */ repositoryIds?: number[]; /** * This filter is used to search contents that contains the public ids inserted */ publicIds?: string[]; /** * This filter is used to search contents that has the tags inserted */ tags?: string[]; /** * This filter is used to search contents whose author matches (case-insensitively) one of the full names or emails inserted */ authors?: string[]; /** * This filter is used to search contents whose locale, or one of their translation locales, matches (case-insensitively) one of the locales inserted */ locales?: string[]; /** * This filter is used to search contents published in channels matching (case-insensitively) one of the mnemonic ids or names inserted */ channels?: string[]; /** * This filter is used to search contents with an online date starting from the ISO 8601 date inserted */ onlineDateFrom?: string; /** * This filter is used to search contents with an online date up to the ISO 8601 date inserted */ onlineDateTo?: string; /** * This filter is used to search contents with an offline date starting from the ISO 8601 date inserted */ offlineDateFrom?: string; /** * This filter is used to search contents with an offline date up to the ISO 8601 date inserted */ offlineDateTo?: string; /** * This filter is used to search contents in the content status inserted */ contentsStatus: ContentsStatus; /** * Filter list by ContentTranslation status */ translationStatus?: ContentTranslationStatus; }; /** * This type represent the data needed to make a list content API request */ export type ListContentsRequest = { /** * The contents to skip (used to paginate the result) */ skip: number; /** * The contents to take (used to paginate the result) */ take: number; /** * The data used to filter the list of content */ filters: ListContentsFilters; /** * The data used to sort the list of content */ sort?: ListContentsSort; }; /** * This type represent the model of the single content returned from the list of content API request */ export type ListContentsItem = { /** * The unique content id */ id: ContentId; /** * The content public id */ publicId: string; /** * The content name */ name: string; /** * The content creation date */ createdDate: Date; /** * The content updated date */ lastModifiedDate: Date; /** * The date where the content will start to be available when published */ onlineDate?: Date; /** * The date where the content will no more be available when published */ offlineDate?: Date; /** * The creator of the content */ author: AuthorResponse; /** * The data of the definition related to the content */ definition: { /** * The content definition unique id */ id: ContentDefinitionId; /** * The content definition mnemonic id */ mnemonicId: string; /** * The content definition name */ name: string; }; /** * The data of the repository related to the content */ repository: { /** * The repository unique id */ id: ContentRepositoryId; /** * The repository mnemonic id */ mnemonicId: string; /** * The repository name */ name: string; /** * The repository color */ color: string; }; /** * The latest author that modified the content */ latestContributor: AuthorResponse; /** * The tags saved with the content */ tags: string[]; /** * The archive status of the content */ archived: boolean; /** * The archive date of the content */ archivedDate?: Date; /** * The publishing status of the content */ status?: ContentStatus[]; /** * The version of the content */ version: number; /** * Channels where the content is published */ channels: PublishingChannelResponse[]; /** * Locale of the content */ locale: string; /** * Translations of the content */ translations: Pick[]; }; /** * This type represent the response of the list content API request */ export type ListContentsResponse = PagedListResponse; /** * This type represent the data needed to make a duplicate content API request */ export type DuplicateContentRequest = { /** * The unique content id to duplicate */ id: ContentId; }; /** * This type represent the response of the duplicate content API request */ export type DuplicateContentResponse = { /** * The duplicated content unique id */ duplicatedId: ContentId; }; /** * This type represent the data needed to make a get content API request */ export type GetContentRequest = { /** * The unique content id to retrieve */ id: ContentId; /** * This value will encode in the response all the content that use this content as linked content */ retrieveLinkingContents?: boolean; }; /** * This type represent the model of a content */ export type ContentResponse = { /** * The unique content id */ id: ContentId; /** * The content public id */ publicId: string; /** * The content version */ version: number; /** * The content name */ name: string; /** * The content payload (this contains all content fields and its values) */ payload: object; /** * The creation date of the content */ createdDate: Date; /** * The last modified date of the content */ lastModifiedDate: Date; /** * The author of the content */ author: AuthorResponse; /** * The definition related to the content */ definition: ContentDefinitionResponse; /** * The repository related to the content */ repository: ContentRepositoryResponse; /** * The publishing channel where the content will be published */ channels: PublishingChannelResponse[]; /** * The date where the content will start to be available when published */ onlineDate?: Date; /** * The date where the content will no more be available when published */ offlineDate?: Date; /** * The tags saved with the content */ tags: string[]; /** * The list indexed fields of the content */ indexDetails: IndexedContent; /** * The latest author that modified the content */ latestContributor: AuthorResponse; /** * The linked contents used in this content */ linkedContents: LinkedContentsInfo; /** * The archived status of the content */ archived: boolean; /** * The archive date of the content */ archivedDate?: Date; /** * The publishing status of the content */ status?: ContentStatus; /** * Controls if translations should be ignored when publishing */ contentLocalizationSettings?: LocalizationSettings; /** * Content's checksum (it's different whenever at least one localized field changes) */ checksum: string; /** * Content's localized values */ translations: ContentTranslation[]; /** * Content's locale */ locale: string; /** * Content's external identifier */ externalIdentifier?: string; }; /** * This type represent the model of a linked content */ export type LinkingContents = ContentResponse; /** * This type represent the response of a get content API request */ export type GetContentResponse = { /** * The requested content */ content: ContentResponse | undefined; /** * The contents that use the requested content */ linkingContents?: LinkingContents[]; }; /** * This type represent the response of a create content API request */ export type CreateContentResponse = ContentResponse; /** * This type represent the response of an update content API request */ export type UpdateContentResponse = ContentResponse; /** * This type represent the data needed to make a list public id API request */ export type ListPublicIdsRequest = { /** * The admitted filters in the request */ filters: { /** * This filter is used to search public ids that contain the value inserted */ publicId?: string; /** * This filter is used to filter public ids in contents of a specific content definition id */ definitionId?: ContentDefinitionId; }; }; /** * This type represent the response of a list public id API request */ export type ListPublicIdsResponse = string[]; /** * This type represent the data needed to make a delete content API request */ export type DeleteContentRequest = { /** * The unique content id to delete */ id: ContentId; }; /** * This type represent the response of a delete content API request */ export type DeleteContentResponse = ContentResponse; /** * This type represent the data needed to make a toggle archive content API request */ export type ToggleArchivedContentRequest = { /** * The unique content id where to make the toggle archive request */ id: ContentId; /** * This value represent the archive status to set in the specified content */ archived: boolean; }; /** * This type represent the response of a toggle archive content API request */ export type ToggleArchivedContentResponse = ContentResponse; /** * Thin enum represent all content fields violations error codes */ export declare enum ContentFieldViolationCodes { genericContentDefinition = "generic.ContentDefinitionNotFound", payloadMissingRequiredField = "payload.MissingRequiredField", payloadUnknownField = "payload.unknownField", arrayFieldMaxLengthExceeded = "arrayField.maxLengthExceeded", arrayFieldMinLengthNotReached = "arrayField.minLengthNotReached", arrayFieldValueIsNotAnArray = "arrayField.valueIsNotAnArray", booleanFieldValueIsNotABoolean = "booleanField.valueIsNotABoolean", cloudinaryImageFieldInvalidPublicIdValue = "cloudinaryImageField.valueHaveAnInvalidPublicId", cloudinaryImageFieldInvalidTransformationJson = "cloudinaryImageField.valueHaveInvalidTransformationsJson", cloudinaryPublicIdInvalidPublicIdValue = "cloudinaryPublicIdField.valueIsAnInvalidPublicId", cloudinaryRawFieldInvalidPublicIdValue = "cloudinaryRawField.valueIsAnInvalidPublicId", cloudinaryVideoFieldInvalidPublicIdValue = "cloudinaryVideoField.valueHaveAnInvalidPublicId", cloudinaryVideoFieldInvalidTransformationJson = "cloudinaryVideoField.valueHaveInvalidTransformationsJson", dateFieldUnspecifiedTimeZone = "dateField.valueHasUnspecifiedTimeZone", dateFieldValueIsAfterLimit = "dateField.valueIsAfterLimit", dateFieldValueIsBeforeLimit = "dateField.valueIsBeforeLimit", dateFieldValueIsInvalidDate = "dateField.valueIsInvalidDate", fragmentFieldValueIsNotAFragment = "fragmentField.valueIsNotAFragment", linkContentFieldInvalidDefinitionType = "linkContentField.invalidDefinitionType", linkContentFieldNotFound = "linkContentField.notFound", linkContentFieldValueIsNotALinkedContent = "linkContentField.valueIsNotALinkedContent", longTextFieldMaxLengthExceeded = "longTextField.maxLengthExceeded", longTextFieldMinLengthNotReached = "longTextField.minLengthNotReached", longTextFieldValueIsNotAString = "longTextField.valueIsNotAString", longTextFieldValueIsNotAValidJSON = "longTextField.valueIsNotAValidJSON", longTextFieldValueIsNotAValidMarkdown = "longTextField.valueIsNotAValidMarkdown", longTextFieldValueIsNotAValidHTML = "longTextField.valueIsNotAValidHtml", longTextFieldBlankValueNotAllowed = "longTextField.blankValueNotAllowed", longTextFieldUnknownSubType = "longTextField.valueHasAnUnknownSubType", numberFieldValueBelowMin = "numberField.valueIsBelowMin", numberFieldValueIsNotANumber = "numberField.valueIsNotANumber", numberFieldValueOverMax = "numberField.valueIsOverMax", numberFieldValueOverMaxInfinite = "numberField.valueTreatedAsAMaxInfinite", numberFieldValueBelowMaxMin = "numberField.valueTreatedAsAMinInfinite", numberFieldValueMissingInListOfValue = "numberField.valueMissingInListOfValue", oneFragmentOfFieldNameNotAString = "oneFragmentOfField.fieldNameIsNotAString", oneFragmentOfValueNotAFragment = "oneFragmentOfField.fieldValueIsNotAFragment", oneFragmentOfFragmentNotAllowed = "oneFragmentOfField.fragmentNotAllowed", oneFragmentOfFragmentNotFound = "oneFragmentOfField.fragmentNotFound", oneFragmentOfValueIsNotAOneFragmentOf = "oneFragmentOfField.valueIsNotAOneFragmentOf", oneLinkedContentOfValueIsNotAOneLinkedContentOf = "oneLinkedContentOfField.valueIsNotAOneLinkedContentOf", oneLinkedContentOfContentNotFound = "oneLinkedContentOfField.contentNotFound", oneLinkedContentOfDefinitionNotAllowed = "oneLinkedContentOfField.contentDefinitionNotAllowed", textFieldMaxLengthExceeded = "textField.maxLengthExceeded", textFieldMinLengthNotReached = "textField.minLengthNotReached", textFieldPatternNotMatched = "textField.patternNotMatched", textFieldValueMissingInListOfValue = "textField.valueMissingInListOfValue", textFieldValueIsNotAString = "textField.valueIsNotAString", textFieldBlankValueNotAllowed = "textField.blankValueNotAllowed" } /** * Request type for getContentStatus */ export type GetContentStatusRequest = { /** * Id of the content required to get its status */ id: ContentId; }; /** * Response type for getContentStatus */ export type GetContentStatusResponse = ContentStatus[]; /** * Request type for changeLocale */ export type ChangeLocaleRequest = { /** * Id of the content whose locale you'd like to change */ contentId: ContentId; /** * New locale to assign to the content */ locale: string; }; export type ChangeLocaleResponse = ContentResponse; export declare enum LocalizationSettings { DEFAULT = "default", MAIN = "main" } export type ToggleContentTranslationsRequest = { contentId: ContentId; localizationSettings: LocalizationSettings; }; export type ToggleContentTranslationsResponse = ContentResponse;