/** * The Confluence Cloud REST API * This document describes the REST API and resources provided by Confluence. The REST APIs are for developers who want to integrate Confluence into their application and for administrators who want to script interactions with the Confluence server.Confluence\'s REST APIs provide access to resources (data entities) via URI paths. To use a REST API, your application will make an HTTP request and parse the response. The response format is JSON. Your methods will be the standard HTTP methods like GET, PUT, POST and DELETE. Because the REST API is based on open standards, you can use any web development language to access the API. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { Content, ContentArray, ContentCreate, ContentHistory, ContentUpdate, MacroInstance } from '../models'; export interface CreateContentRequest { ContentCreate: ContentCreate; status?: string; expand?: Array; } export interface DeleteContentRequest { id: string; status?: string; } export interface GetContentRequest { type?: GetContentTypeEnum; spaceKey?: string; title?: string; status?: GetContentStatusEnum; postingDay?: string; expand?: Array; trigger?: GetContentTriggerEnum; orderby?: string; start?: number; limit?: number; } export interface GetContentByIdRequest { id: string; status?: GetContentByIdStatusEnum; version?: number; embeddedContentRender?: string; expand?: Array; trigger?: GetContentByIdTriggerEnum; } export interface GetHistoryForContentRequest { id: string; expand?: Array; } export interface GetMacroBodyByMacroIdRequest { id: string; version: number; macroId: string; } export interface SearchContentByCQLRequest { cql?: string; cqlcontext?: string; expand?: Array; start?: number; limit?: number; } export interface UpdateContentRequest { id: string; ContentUpdate: ContentUpdate; status?: UpdateContentStatusEnum; conflictPolicy?: UpdateContentConflictPolicyEnum; } /** * no description */ export declare class ContentApi extends runtime.BaseAPI { /** * Creates a new piece of content or publishes an existing draft. To publish a draft, add the `id` and `status` properties to the body of the request. Set the `id` to the ID of the draft and set the `status` to \'current\'. When the request is sent, a new piece of content will be created and the metadata from the draft will be transferred into it. By default, the following objects are expanded: `space`, `history`, `version`. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: \'Add\' permission for the space that the content will be created in, and permission to view the draft if publishing a draft. * Create content */ createContentRaw(requestParameters: CreateContentRequest): Promise>; /** * Creates a new piece of content or publishes an existing draft. To publish a draft, add the `id` and `status` properties to the body of the request. Set the `id` to the ID of the draft and set the `status` to \'current\'. When the request is sent, a new piece of content will be created and the metadata from the draft will be transferred into it. By default, the following objects are expanded: `space`, `history`, `version`. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: \'Add\' permission for the space that the content will be created in, and permission to view the draft if publishing a draft. * Create content */ createContent(requestParameters: CreateContentRequest): Promise; /** * Moves a piece of content to the space\'s trash or purges it from the trash, depending on the content\'s type and status: - If the content\'s type is `page` or `blogpost` and its status is `current`, it will be trashed. - If the content\'s type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your request. - If the content\'s type is `comment` or `attachment`, it will be deleted permanently without being trashed. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: \'Delete\' permission for the space that the content is in, and permission to edit the content. * Delete content */ deleteContentRaw(requestParameters: DeleteContentRequest): Promise>; /** * Moves a piece of content to the space\'s trash or purges it from the trash, depending on the content\'s type and status: - If the content\'s type is `page` or `blogpost` and its status is `current`, it will be trashed. - If the content\'s type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your request. - If the content\'s type is `comment` or `attachment`, it will be deleted permanently without being trashed. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: \'Delete\' permission for the space that the content is in, and permission to edit the content. * Delete content */ deleteContent(requestParameters: DeleteContentRequest): Promise; /** * Returns all content in a Confluence instance. By default, the following objects are expanded: `space`, `history`, `version`. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site (\'Can use\' global permission). Only content that the user has permission to view will be returned. * Get content */ getContentRaw(requestParameters: GetContentRequest): Promise>; /** * Returns all content in a Confluence instance. By default, the following objects are expanded: `space`, `history`, `version`. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site (\'Can use\' global permission). Only content that the user has permission to view will be returned. * Get content */ getContent(requestParameters: GetContentRequest): Promise; /** * Returns a single piece of content, like a page or a blog post. By default, the following objects are expanded: `space`, `history`, `version`. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the content is a blog post, \'View\' permission for the space is required. * Get content by ID */ getContentByIdRaw(requestParameters: GetContentByIdRequest): Promise>; /** * Returns a single piece of content, like a page or a blog post. By default, the following objects are expanded: `space`, `history`, `version`. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the content is a blog post, \'View\' permission for the space is required. * Get content by ID */ getContentById(requestParameters: GetContentByIdRequest): Promise; /** * Returns the most recent update for a piece of content. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. * Get history for content */ getHistoryForContentRaw(requestParameters: GetHistoryForContentRequest): Promise>; /** * Returns the most recent update for a piece of content. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. * Get history for content */ getHistoryForContent(requestParameters: GetHistoryForContentRequest): Promise; /** * Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps. About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for it, unless an ID is specified (by an app). The macro ID will look similar to this: \'50884bd9-0cb8-41d5-98be-f80943c14f96\'. The ID is then persisted as new versions of content are created, and is only modified by Confluence if there are conflicting IDs. Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and transparently propagate out to all instances. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the macro is in. * Get macro body by macro ID */ getMacroBodyByMacroIdRaw(requestParameters: GetMacroBodyByMacroIdRequest): Promise>; /** * Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps. About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for it, unless an ID is specified (by an app). The macro ID will look similar to this: \'50884bd9-0cb8-41d5-98be-f80943c14f96\'. The ID is then persisted as new versions of content are created, and is only modified by Confluence if there are conflicting IDs. Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and transparently propagate out to all instances. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the macro is in. * Get macro body by macro ID */ getMacroBodyByMacroId(requestParameters: GetMacroBodyByMacroIdRequest): Promise; /** * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see: [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/). **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site (\'Can use\' global permission). Only content that the user has permission to view will be returned. * Search content by CQL */ searchContentByCQLRaw(requestParameters: SearchContentByCQLRequest): Promise>; /** * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see: [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/). **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site (\'Can use\' global permission). Only content that the user has permission to view will be returned. * Search content by CQL */ searchContentByCQL(requestParameters: SearchContentByCQLRequest): Promise; /** * Updates a piece of content. Use this method to update the title or body of a piece of content, change the status, change the parent page, and more. Note, updating draft content is currently not supported. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content. * Update content */ updateContentRaw(requestParameters: UpdateContentRequest): Promise>; /** * Updates a piece of content. Use this method to update the title or body of a piece of content, change the status, change the parent page, and more. Note, updating draft content is currently not supported. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content. * Update content */ updateContent(requestParameters: UpdateContentRequest): Promise; } /** * @export * @enum {string} */ export declare enum CreateContentExpandEnum { ChildTypesAll = "childTypes.all", ChildTypesAttachment = "childTypes.attachment", ChildTypesComment = "childTypes.comment", ChildTypesPage = "childTypes.page", Container = "container", MetadataCurrentuser = "metadata.currentuser", MetadataProperties = "metadata.properties", MetadataLabels = "metadata.labels", MetadataFrontend = "metadata.frontend", Operations = "operations", ChildrenPage = "children.page", ChildrenAttachment = "children.attachment", ChildrenComment = "children.comment", RestrictionsReadRestrictionsUser = "restrictions.read.restrictions.user", RestrictionsReadRestrictionsGroup = "restrictions.read.restrictions.group", RestrictionsUpdateRestrictionsUser = "restrictions.update.restrictions.user", RestrictionsUpdateRestrictionsGroup = "restrictions.update.restrictions.group", History = "history", HistoryLastUpdated = "history.lastUpdated", HistoryPreviousVersion = "history.previousVersion", HistoryContributors = "history.contributors", HistoryNextVersion = "history.nextVersion", Ancestors = "ancestors", Body = "body", Version = "version", DescendantsPage = "descendants.page", DescendantsAttachment = "descendants.attachment", DescendantsComment = "descendants.comment", Space = "space" } /** * @export * @enum {string} */ export declare enum GetContentTypeEnum { Page = "page", Blogpost = "blogpost" } /** * @export * @enum {string} */ export declare enum GetContentStatusEnum { } /** * @export * @enum {string} */ export declare enum GetContentExpandEnum { ChildTypesAll = "childTypes.all", ChildTypesAttachment = "childTypes.attachment", ChildTypesComment = "childTypes.comment", ChildTypesPage = "childTypes.page", Container = "container", MetadataCurrentuser = "metadata.currentuser", MetadataProperties = "metadata.properties", MetadataLabels = "metadata.labels", MetadataFrontend = "metadata.frontend", Operations = "operations", ChildrenPage = "children.page", ChildrenAttachment = "children.attachment", ChildrenComment = "children.comment", RestrictionsReadRestrictionsUser = "restrictions.read.restrictions.user", RestrictionsReadRestrictionsGroup = "restrictions.read.restrictions.group", RestrictionsUpdateRestrictionsUser = "restrictions.update.restrictions.user", RestrictionsUpdateRestrictionsGroup = "restrictions.update.restrictions.group", History = "history", HistoryLastUpdated = "history.lastUpdated", HistoryPreviousVersion = "history.previousVersion", HistoryContributors = "history.contributors", HistoryNextVersion = "history.nextVersion", Ancestors = "ancestors", Body = "body", Version = "version", DescendantsPage = "descendants.page", DescendantsAttachment = "descendants.attachment", DescendantsComment = "descendants.comment", Space = "space" } /** * @export * @enum {string} */ export declare enum GetContentTriggerEnum { Viewed = "viewed" } /** * @export * @enum {string} */ export declare enum GetContentByIdStatusEnum { } /** * @export * @enum {string} */ export declare enum GetContentByIdExpandEnum { ChildTypesAll = "childTypes.all", ChildTypesAttachment = "childTypes.attachment", ChildTypesComment = "childTypes.comment", ChildTypesPage = "childTypes.page", Container = "container", MetadataCurrentuser = "metadata.currentuser", MetadataProperties = "metadata.properties", MetadataLabels = "metadata.labels", MetadataFrontend = "metadata.frontend", Operations = "operations", ChildrenPage = "children.page", ChildrenAttachment = "children.attachment", ChildrenComment = "children.comment", RestrictionsReadRestrictionsUser = "restrictions.read.restrictions.user", RestrictionsReadRestrictionsGroup = "restrictions.read.restrictions.group", RestrictionsUpdateRestrictionsUser = "restrictions.update.restrictions.user", RestrictionsUpdateRestrictionsGroup = "restrictions.update.restrictions.group", History = "history", HistoryLastUpdated = "history.lastUpdated", HistoryPreviousVersion = "history.previousVersion", HistoryContributors = "history.contributors", HistoryNextVersion = "history.nextVersion", Ancestors = "ancestors", Body = "body", Version = "version", DescendantsPage = "descendants.page", DescendantsAttachment = "descendants.attachment", DescendantsComment = "descendants.comment", Space = "space" } /** * @export * @enum {string} */ export declare enum GetContentByIdTriggerEnum { Viewed = "viewed" } /** * @export * @enum {string} */ export declare enum GetHistoryForContentExpandEnum { LastUpdated = "lastUpdated", PreviousVersion = "previousVersion", Contributors = "contributors", NextVersion = "nextVersion" } /** * @export * @enum {string} */ export declare enum SearchContentByCQLExpandEnum { ChildTypesAll = "childTypes.all", ChildTypesAttachment = "childTypes.attachment", ChildTypesComment = "childTypes.comment", ChildTypesPage = "childTypes.page", Container = "container", MetadataCurrentuser = "metadata.currentuser", MetadataProperties = "metadata.properties", MetadataLabels = "metadata.labels", MetadataFrontend = "metadata.frontend", Operations = "operations", ChildrenPage = "children.page", ChildrenAttachment = "children.attachment", ChildrenComment = "children.comment", RestrictionsReadRestrictionsUser = "restrictions.read.restrictions.user", RestrictionsReadRestrictionsGroup = "restrictions.read.restrictions.group", RestrictionsUpdateRestrictionsUser = "restrictions.update.restrictions.user", RestrictionsUpdateRestrictionsGroup = "restrictions.update.restrictions.group", History = "history", HistoryLastUpdated = "history.lastUpdated", HistoryPreviousVersion = "history.previousVersion", HistoryContributors = "history.contributors", HistoryNextVersion = "history.nextVersion", Ancestors = "ancestors", Body = "body", Version = "version", DescendantsPage = "descendants.page", DescendantsAttachment = "descendants.attachment", DescendantsComment = "descendants.comment", Space = "space" } /** * @export * @enum {string} */ export declare enum UpdateContentStatusEnum { Current = "current", Trashed = "trashed", Historical = "historical", Draft = "draft" } /** * @export * @enum {string} */ export declare enum UpdateContentConflictPolicyEnum { Abort = "abort" }