UNPKG

liferay-headless-rest-client

Version:
1,007 lines (1,006 loc) 26 kB
/** * The Client Extension for the theme spritemap of a page */ export type ClientExtension = { clientExtensionConfig?: { [key: string]: string; }; /** * The client extension's external reference code. */ externalReferenceCode?: string; /** * The client extension's name. */ readonly name?: string; readonly 'x-class-name'?: string; }; export type ContentAssociation = { /** * The subtype of the content. i.e. the Structure name if it's a Structured Content. */ contentSubtype?: string; /** * The type of the content, i.e. Structure Content, BlogsPosting, etc. */ contentType?: string; readonly 'x-class-name'?: string; }; /** * The structured content's creator. */ export type Creator = { /** * The author's additional name (e.g., middle name). */ readonly additionalName?: string; /** * The type of the content. */ readonly contentType?: string; /** * The external reference code of the author. */ readonly externalReferenceCode?: string; /** * The author's surname. */ readonly familyName?: string; /** * The author's first name. */ readonly givenName?: string; /** * The author's ID. */ readonly id?: number; /** * A relative URL to the author's profile image. */ readonly image?: string; /** * The author's full name. */ readonly name?: string; /** * A relative URL to the author's user profile. Optional field, can be embedded with nestedFields. */ readonly profileURL?: string; /** * A list of userGroups information. */ userGroupBriefs?: Array<UserGroupBrief>; readonly 'x-class-name'?: string; }; /** * A list of the custom fields associated with the structured content. */ export type CustomField = { readonly 'x-class-name'?: string; customValue?: CustomValue; /** * The field type (e.g., image, text, etc.). */ readonly dataType?: string; /** * The field's internal name. This is valid for comparisons and unique in the structured content. */ name?: string; }; /** * The field's value. */ export type CustomValue = { readonly 'x-class-name'?: string; /** * The field's content value for simple types. */ data?: { [key: string]: unknown; }; /** * The localized field's content values for simple types. */ data_i18n?: { [key: string]: string; }; geo?: Geo; }; /** * Represents a Display Page Template that has fields and is tied to a content type */ export type DisplayPageTemplate = { readonly actions?: { [key: string]: { [key: string]: string; }; }; /** * The list of languages the Display Page Template has a translation for. */ readonly availableLanguages?: Array<string>; creator?: Creator; /** * The custom fields associated to the page that renders the Display Page Template. */ customFields?: Array<CustomField>; /** * The Display Page Template's creation date. */ readonly dateCreated?: string; /** * The last time any field of the Display Page Template was changed. */ readonly dateModified?: string; /** * The Display Page Template's external key. */ displayPageTemplateKey?: string; displayPageTemplateSettings?: DisplayPageTemplateSettings; /** * Specifies if the Display Page Template is the default one for the content type. */ markedAsDefault?: boolean; pageDefinition?: PageDefinition; /** * The ID of the site to which this Page Template is scoped. */ readonly siteId?: number; /** * The title of the Display Page Template */ title: string; /** * A valid external identifier to reference this Display Page Template. */ readonly uuid?: string; readonly 'x-class-name'?: string; }; /** * The Display Page Template's external key. */ export type DisplayPageTemplateSettings = { contentAssociation?: ContentAssociation; openGraphSettingsMapping?: OpenGraphSettingsMapping; seoSettingsMapping?: SeoSettingsMapping; readonly 'x-class-name'?: string; }; /** * A point determined by latitude and longitude. */ export type Geo = { readonly 'x-class-name'?: string; /** * The latitude of a point in space. */ latitude?: number; /** * The longitude of a point in space. */ longitude?: number; }; /** * The page's master page. */ export type MasterPage = { /** * The master page's key. */ key?: string; /** * The master page's name. */ name?: string; readonly 'x-class-name'?: string; }; export type OpenGraphSettingsMapping = { /** * Field of the content type that will be used as the description */ descriptionMappingFieldKey?: string; /** * Field of the content type that will be used as the alt property of the image */ imageAltMappingFieldKey?: string; /** * Field of the content type that will be used as the image */ imageMappingFieldKey?: string; /** * Field of the content type that will be used as the title */ titleMappingFieldKey?: string; readonly 'x-class-name'?: string; }; export type Options = { /** * The page rule condition's value. */ value?: string; readonly 'x-class-name'?: string; /** * The page rule condition option's type. */ type?: 'Equal' | 'NotEqual'; }; export type PageDefinition = { pageElement?: PageElement; /** * A list of the page rules this page has. */ pageRules?: Array<PageRule>; settings?: Settings; /** * The version of the JSON generated by page definition. */ version?: number; readonly 'x-class-name'?: string; }; /** * The page's page element. */ export type PageElement = { /** * The page element's definition. */ definition?: { [key: string]: unknown; }; /** * The page element's ID. */ id?: string; /** * A list of the page elements this page element has. */ pageElements?: Array<PageElement>; readonly 'x-class-name'?: string; /** * The page element's type (collection, collection item, column, drop zone, form, fragment, fragment drop zone, root, row, section or widget). */ type?: 'Collection' | 'CollectionItem' | 'Column' | 'DropZone' | 'Form' | 'FormStep' | 'FormStepContainer' | 'Fragment' | 'FragmentDropZone' | 'Root' | 'Row' | 'Section' | 'Widget'; }; /** * A list of the page rules this page has. */ export type PageRule = { /** * The page rule ID. */ id?: string; /** * The custom name of a Page rule. */ name?: string; /** * A list of actions of a Page rule. */ pageRuleActions?: Array<PageRuleAction>; /** * A list of conditions of a Page rule. */ pageRuleConditions?: Array<PageRuleCondition>; readonly 'x-class-name'?: string; /** * The custom name of a Page rule. */ conditionType?: 'All' | 'Any'; }; /** * A list of actions of a Page rule. */ export type PageRuleAction = { /** * The page rule action's ID. */ id?: string; /** * The page rule condition's item ID. */ itemId?: string; /** * The page rule action's type. */ type?: string; readonly 'x-class-name'?: string; }; /** * A list of conditions of a Page rule. */ export type PageRuleCondition = { /** * The page rule condition's field. */ field?: string; /** * The page rule condition's ID. */ id?: string; options?: Options; /** * The page rule condition's type. */ type?: string; readonly 'x-class-name'?: string; }; export type SeoSettingsMapping = { /** * Field of the content type that will be used as the description */ descriptionMappingFieldKey?: string; /** * Field of the content type that will be used as the HTML title */ htmlTitleMappingFieldKey?: string; /** * Robots of the page that renders the Display Page Template */ robots?: string; /** * Internationalized field of the robots of the page that renders the Display Page Template */ robots_i18n?: { [key: string]: string; }; readonly 'x-class-name'?: string; }; /** * The page's settings. */ export type Settings = { /** * The page's color scheme name. */ colorSchemeName?: string; /** * The page's CSS. */ css?: string; /** * The FavIcon of the page */ favIcon?: { [key: string]: unknown; }; /** * The client extensions for global css associated to the page. */ globalCSSClientExtensions?: Array<ClientExtension>; /** * The client extensions for global js associated to the page. */ globalJSClientExtensions?: Array<ClientExtension>; /** * The page's JavaScript. */ javascript?: string; masterPage?: MasterPage; styleBook?: StyleBook; themeCSSClientExtension?: ClientExtension; /** * The page's theme name. */ themeName?: string; /** * The page's theme settings. */ themeSettings?: { [key: string]: unknown; }; themeSpritemapClientExtension?: ClientExtension; readonly 'x-class-name'?: string; }; /** * The StyleBook that is applied to the page. */ export type StyleBook = { /** * The stylebook's key. */ key?: string; /** * The stylebook's name. */ name?: string; readonly 'x-class-name'?: string; }; /** * A list of userGroups information. */ export type UserGroupBrief = { /** * The ID of the user group. */ readonly id?: number; /** * The name of the user group. */ readonly name?: string; readonly 'x-class-name'?: string; }; export type Facet = { facetCriteria?: string; facetValues?: Array<FacetValue>; }; export type FacetValue = { numberOfOccurrences?: number; term?: string; }; export type PageDisplayPageTemplate = { items?: Array<DisplayPageTemplate>; lastPage?: number; totalCount?: number; actions?: { [key: string]: { [key: string]: string; }; }; page?: number; facets?: Array<Facet>; pageSize?: number; }; /** * The structured content's average rating. */ export type AggregateRating = { /** * The highest possible rating (by default normalized to 1.0). */ readonly bestRating?: number; /** * The average rating. */ readonly ratingAverage?: number; /** * The number of ratings. */ readonly ratingCount?: number; /** * The rating value. */ readonly ratingValue?: number; /** * The lowest possible rating (by default normalized to 0.0). */ readonly worstRating?: number; readonly 'x-class-name'?: string; }; /** * A content document element that stores an image file. */ export type ContentDocument = { /** * Block of actions allowed by the user making the request. */ readonly actions?: { [key: string]: { [key: string]: string; }; }; /** * The type of content. */ readonly contentType?: string; /** * The document's relative URL. */ readonly contentUrl?: string; /** * optional field with the content of the document in Base64, can be embedded with nestedFields */ readonly contentValue?: string; /** * The document's description. */ description?: string; /** * The document's content type (e.g., `application/pdf`, etc.). */ readonly encodingFormat?: string; /** * The document's file extension. */ readonly fileExtension?: string; /** * The document's ID. */ id?: number; /** * The document's file size in bytes. */ readonly sizeInBytes?: number; /** * The document's title. */ title?: string; readonly 'x-class-name'?: string; }; /** * The list of fields that store the structured content's information. */ export type ContentField = { contentFieldValue?: ContentFieldValue; /** * The localized field's values. */ contentFieldValue_i18n?: { [key: string]: ContentFieldValue; }; /** * The field type (e.g., image, text, etc.). */ readonly dataType?: string; /** * The field's control type (e.g., text, text area, etc.). */ readonly inputControl?: string; /** * The field's label. */ readonly label?: string; /** * The localized field's labels. */ readonly label_i18n?: { [key: string]: string; }; /** * The field's internal name. This is valid for comparisons and unique in the structured content. */ name?: string; /** * A list of child content fields that depend on this resource. */ nestedContentFields?: Array<ContentField>; /** * A flag that indicates whether this field can be rendered multiple times. */ readonly repeatable?: boolean; readonly 'x-class-name'?: string; }; /** * The localized field's values. */ export type ContentFieldValue = { /** * The field's content for simple types. */ data?: string; document?: ContentDocument; geo?: Geo; image?: ContentDocument; /** * A link to a page on the server. */ link?: string; structuredContentLink?: StructuredContentLink; /** * The field's visible value */ value?: string; readonly 'x-class-name'?: string; }; export type PageStructuredContent = { items?: Array<StructuredContent>; lastPage?: number; totalCount?: number; actions?: { [key: string]: { [key: string]: string; }; }; page?: number; facets?: Array<Facet>; pageSize?: number; }; export type Permission = { actionIds?: Array<string>; roleExternalReferenceCode?: string; roleName?: string; roleType?: string; }; /** * A list of related contents to this structured content. */ export type RelatedContent = { /** * The type of the content. */ contentType?: string; /** * The identifier of the resource. */ id?: number; /** * The title of the content. */ readonly title?: string; readonly 'x-class-name'?: string; }; /** * A list of rendered content, which results from using a template to process the content and return HTML. */ export type RenderedContent = { /** * The ID of the template or display page used to render the content. */ readonly contentTemplateId?: string; /** * The name of the template or display page used to render the content. */ contentTemplateName?: string; /** * The localized names of the template or display page used to render the content. */ contentTemplateName_i18n?: { [key: string]: string; }; /** * Specifies if the template or display page are marked as default to display the content. */ markedAsDefault?: boolean; /** * An absolute URL to the rendered content. */ renderedContentURL?: string; /** * Optional field with the rendered content, can be embedded with nestedFields. */ renderedContentValue?: string; readonly 'x-class-name'?: string; }; /** * Represents content that has fields and is rendered by a template backed by a `ContentStructure`. This is modeled internally as a `JournalArticle`. */ export type StructuredContent = { /** * Block of actions allowed by the user making the request. */ readonly actions?: { [key: string]: { [key: string]: string; }; }; aggregateRating?: AggregateRating; /** * The key of the asset library to which the structure content is scoped. */ readonly assetLibraryKey?: string; /** * The list of languages the structured content has a translation for. */ readonly availableLanguages?: Array<string>; /** * The list of fields that store the structured content's information. */ contentFields?: Array<ContentField>; /** * The ID of the `ContentStructure`. */ contentStructureId: number; creator?: Creator; /** * A list of the custom fields associated with the structured content. */ customFields?: Array<CustomField>; /** * The structured content's creation date. */ readonly dateCreated?: string; /** * The expiration date of the structured content. */ dateExpired?: string; /** * The last time any field of the structured content was changed. */ readonly dateModified?: string; /** * The structured content's most recent publication date. */ datePublished?: string; /** * The structured content's description. */ description?: string; /** * The localized structured content's descriptions. */ description_i18n?: { [key: string]: string; }; /** * The structured content's external reference code. */ externalReferenceCode?: string; /** * A relative URL to the structured content's rendered content. */ friendlyUrlPath?: string; /** * The localized relative URLs to the structured content's rendered content. */ friendlyUrlPath_i18n?: { [key: string]: string; }; /** * The structured content's ID. */ readonly id?: number; /** * An identifier, independent of the database, that can be used to reference the structured content. */ readonly key?: string; /** * A list of keywords describing the structured content. */ keywords?: Array<string>; /** * Whether the web content article is not set to auto expire */ neverExpire?: boolean; /** * The number of comments the structured content has received. */ readonly numberOfComments?: number; permissions?: Array<Permission>; /** * The structured content's priority. */ priority?: number; /** * A list of related contents to this structured content. */ relatedContents?: Array<RelatedContent>; /** * A list of rendered content, which results from using a template to process the content and return HTML. */ readonly renderedContents?: Array<RenderedContent>; /** * The ID of the site to which this structured content is scoped. */ readonly siteId?: number; /** * The ID of the folder where structured content is stored. */ structuredContentFolderId?: number; /** * A flag that indicates whether the user making the requests is subscribed to this structured content. */ readonly subscribed?: boolean; /** * The categories associated with this structured content. */ readonly taxonomyCategoryBriefs?: Array<TaxonomyCategoryBrief>; taxonomyCategoryIds?: Array<number>; /** * The structured content's main title. */ title: string; /** * The localized structured content's main titles. */ title_i18n?: { [key: string]: string; }; /** * A valid external identifier to reference this structured content. */ readonly uuid?: string; viewableBy?: 'Anyone' | 'Members' | 'Owner'; readonly 'x-class-name'?: string; }; /** * A link to structured content on the server. */ export type StructuredContentLink = { /** * The type of content. */ readonly contentType?: string; embeddedStructuredContent?: StructuredContent; /** * The resource's ID. */ id?: number; /** * The resource's title. */ title?: string; readonly 'x-class-name'?: string; }; /** * The categories associated with this structured content. */ export type TaxonomyCategoryBrief = { /** * Optional field with the embedded taxonomy category, can be embedded with nestedFields */ readonly embeddedTaxonomyCategory?: { [key: string]: unknown; }; /** * The category's ID. This can be used to retrieve more information in the `TaxonomyCategory` API. */ readonly taxonomyCategoryId?: number; /** * The category's name. */ readonly taxonomyCategoryName?: string; /** * The localized category's names. */ readonly taxonomyCategoryName_i18n?: { [key: string]: string; }; taxonomyCategoryReference?: TaxonomyCategoryReference; readonly 'x-class-name'?: string; }; /** * A unique reference to a taxonomy category. */ export type TaxonomyCategoryReference = { /** * The taxonomy category's external reference code. */ externalReferenceCode: string; /** * The key of the site or asset library where the taxonomy category is located. It can be left out if the taxonomy category is in the same site as the page. */ siteKey?: string; readonly 'x-class-name'?: string; }; export type GetSiteDisplayPageTemplateData = { body?: never; path: { siteId: string; displayPageTemplateKey: string; }; query?: { fields?: string; nestedFields?: string; restrictFields?: string; }; url: '/o/headless-admin-content/v1.0/sites/{siteId}/display-page-templates/{displayPageTemplateKey}'; }; export type GetSiteDisplayPageTemplateResponses = { /** * default response */ default: DisplayPageTemplate; }; export type GetSiteDisplayPageTemplateResponse = GetSiteDisplayPageTemplateResponses[keyof GetSiteDisplayPageTemplateResponses]; export type GetSiteDisplayPageTemplatesPageData = { body?: never; path: { siteId: string; }; query?: { fields?: string; nestedFields?: string; page?: string; pageSize?: string; restrictFields?: string; sort?: string; }; url: '/o/headless-admin-content/v1.0/sites/{siteId}/display-page-templates'; }; export type GetSiteDisplayPageTemplatesPageResponses = { /** * default response */ default: PageDisplayPageTemplate; }; export type GetSiteDisplayPageTemplatesPageResponse = GetSiteDisplayPageTemplatesPageResponses[keyof GetSiteDisplayPageTemplatesPageResponses]; export type PostSitePageDefinitionPreviewData = { body?: PageDefinition; path: { siteId: string; }; query?: never; url: '/o/headless-admin-content/v1.0/sites/{siteId}/page-definitions/preview'; }; export type PostSitePageDefinitionPreviewResponses = { /** * default response */ default: unknown; }; export type DeleteStructuredContentByVersionData = { body?: never; path: { structuredContentId: string; version: string; }; query?: never; url: '/o/headless-admin-content/v1.0/structured-contents/{structuredContentId}/by-version/{version}'; }; export type DeleteStructuredContentByVersionResponses = { /** * default response */ default: unknown; }; export type GetStructuredContentByVersionData = { body?: never; path: { structuredContentId: string; version: string; }; query?: { fields?: string; nestedFields?: string; restrictFields?: string; }; url: '/o/headless-admin-content/v1.0/structured-contents/{structuredContentId}/by-version/{version}'; }; export type GetStructuredContentByVersionResponses = { /** * default response */ default: StructuredContent; }; export type GetStructuredContentByVersionResponse = GetStructuredContentByVersionResponses[keyof GetStructuredContentByVersionResponses]; export type GetSiteStructuredContentsPageData = { body?: never; path: { siteId: string; }; query?: { aggregationTerms?: string; fields?: string; filter?: string; flatten?: string; nestedFields?: string; page?: string; pageSize?: string; restrictFields?: string; search?: string; sort?: string; }; url: '/o/headless-admin-content/v1.0/sites/{siteId}/structured-contents'; }; export type GetSiteStructuredContentsPageResponses = { /** * default response */ default: PageStructuredContent; }; export type GetSiteStructuredContentsPageResponse = GetSiteStructuredContentsPageResponses[keyof GetSiteStructuredContentsPageResponses]; export type GetStructuredContentsVersionsPageData = { body?: never; path: { structuredContentId: string; }; query?: { fields?: string; nestedFields?: string; restrictFields?: string; }; url: '/o/headless-admin-content/v1.0/structured-contents/{structuredContentId}/versions'; }; export type GetStructuredContentsVersionsPageResponses = { /** * default response */ default: PageStructuredContent; }; export type GetStructuredContentsVersionsPageResponse = GetStructuredContentsVersionsPageResponses[keyof GetStructuredContentsVersionsPageResponses]; export type PostSiteStructuredContentDraftData = { body?: StructuredContent; path: { siteId: string; }; query?: never; url: '/o/headless-admin-content/v1.0/sites/{siteId}/structured-contents/draft'; }; export type PostSiteStructuredContentDraftResponses = { /** * default response */ default: StructuredContent; }; export type PostSiteStructuredContentDraftResponse = PostSiteStructuredContentDraftResponses[keyof PostSiteStructuredContentDraftResponses]; export type ClientOptions = { baseUrl: 'http://localhost:8080' | (string & {}); };