confluence.js 2.0.0 → 2.2.0-dev20260318121920
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -2
- package/README.md +168 -181
- package/dist/cjs/api/analytics.cjs.map +1 -1
- package/dist/cjs/api/audit.cjs.map +1 -1
- package/dist/cjs/api/content.cjs +0 -5
- package/dist/cjs/api/content.cjs.map +1 -1
- package/dist/cjs/api/contentAttachments.cjs +1 -0
- package/dist/cjs/api/contentAttachments.cjs.map +1 -1
- package/dist/cjs/api/contentBody.cjs +18 -0
- package/dist/cjs/api/contentBody.cjs.map +1 -1
- package/dist/cjs/api/contentChildrenAndDescendants.cjs +2 -0
- package/dist/cjs/api/contentChildrenAndDescendants.cjs.map +1 -1
- package/dist/cjs/api/contentComments.cjs +1 -0
- package/dist/cjs/api/contentComments.cjs.map +1 -1
- package/dist/cjs/api/contentLabels.cjs.map +1 -1
- package/dist/cjs/api/contentMacroBody.cjs.map +1 -1
- package/dist/cjs/api/contentPermissions.cjs.map +1 -1
- package/dist/cjs/api/contentProperties.cjs +1 -0
- package/dist/cjs/api/contentProperties.cjs.map +1 -1
- package/dist/cjs/api/contentRestrictions.cjs.map +1 -1
- package/dist/cjs/api/contentStates.cjs +13 -0
- package/dist/cjs/api/contentStates.cjs.map +1 -1
- package/dist/cjs/api/contentVersions.cjs.map +1 -1
- package/dist/cjs/api/contentWatches.cjs.map +1 -1
- package/dist/cjs/api/dynamicModules.cjs.map +1 -1
- package/dist/cjs/api/experimental.cjs.map +1 -1
- package/dist/cjs/api/group.cjs +18 -17
- package/dist/cjs/api/group.cjs.map +1 -1
- package/dist/cjs/api/index.cjs +2 -0
- package/dist/cjs/api/index.cjs.map +1 -1
- package/dist/cjs/api/inlineTasks.cjs +1 -0
- package/dist/cjs/api/inlineTasks.cjs.map +1 -1
- package/dist/cjs/api/labelInfo.cjs.map +1 -1
- package/dist/cjs/api/longRunningTask.cjs +1 -0
- package/dist/cjs/api/longRunningTask.cjs.map +1 -1
- package/dist/cjs/api/models/labeledContentType.cjs.map +1 -1
- package/dist/cjs/api/relation.cjs.map +1 -1
- package/dist/cjs/api/search.cjs +1 -0
- package/dist/cjs/api/search.cjs.map +1 -1
- package/dist/cjs/api/settings.cjs.map +1 -1
- package/dist/cjs/api/space.cjs +4 -2
- package/dist/cjs/api/space.cjs.map +1 -1
- package/dist/cjs/api/spacePermissions.cjs.map +1 -1
- package/dist/cjs/api/spaceProperties.cjs +1 -0
- package/dist/cjs/api/spaceProperties.cjs.map +1 -1
- package/dist/cjs/api/spaceSettings.cjs.map +1 -1
- package/dist/cjs/api/template.cjs.map +1 -1
- package/dist/cjs/api/themes.cjs.map +1 -1
- package/dist/cjs/api/userProperties.cjs +56 -0
- package/dist/cjs/api/userProperties.cjs.map +1 -0
- package/dist/cjs/api/users.cjs.map +1 -1
- package/dist/cjs/clients/baseClient.cjs +17 -2
- package/dist/cjs/clients/baseClient.cjs.map +1 -1
- package/dist/cjs/clients/confluenceClient.cjs +6 -0
- package/dist/cjs/clients/confluenceClient.cjs.map +1 -1
- package/dist/cjs/config.cjs +7 -4
- package/dist/cjs/config.cjs.map +1 -1
- package/dist/cjs/paramSerializer.cjs.map +1 -1
- package/dist/cjs/services/authenticationService/authenticationService.cjs.map +1 -1
- package/dist/cjs/services/authenticationService/authentications/createBasicAuthenticationToken.cjs.map +1 -1
- package/dist/cjs/services/authenticationService/authentications/createJWTAuthentication.cjs +1 -1
- package/dist/cjs/services/authenticationService/authentications/createJWTAuthentication.cjs.map +1 -1
- package/dist/cjs/services/authenticationService/base64Encoder.cjs.map +1 -1
- package/dist/esm/api/analytics.mjs.map +1 -1
- package/dist/esm/api/audit.mjs.map +1 -1
- package/dist/esm/api/content.mjs +0 -5
- package/dist/esm/api/content.mjs.map +1 -1
- package/dist/esm/api/contentAttachments.mjs +1 -0
- package/dist/esm/api/contentAttachments.mjs.map +1 -1
- package/dist/esm/api/contentBody.mjs +18 -0
- package/dist/esm/api/contentBody.mjs.map +1 -1
- package/dist/esm/api/contentChildrenAndDescendants.mjs +2 -0
- package/dist/esm/api/contentChildrenAndDescendants.mjs.map +1 -1
- package/dist/esm/api/contentComments.mjs +1 -0
- package/dist/esm/api/contentComments.mjs.map +1 -1
- package/dist/esm/api/contentLabels.mjs.map +1 -1
- package/dist/esm/api/contentMacroBody.mjs.map +1 -1
- package/dist/esm/api/contentPermissions.mjs.map +1 -1
- package/dist/esm/api/contentProperties.mjs +1 -0
- package/dist/esm/api/contentProperties.mjs.map +1 -1
- package/dist/esm/api/contentRestrictions.mjs.map +1 -1
- package/dist/esm/api/contentStates.mjs +13 -0
- package/dist/esm/api/contentStates.mjs.map +1 -1
- package/dist/esm/api/contentVersions.mjs.map +1 -1
- package/dist/esm/api/contentWatches.mjs.map +1 -1
- package/dist/esm/api/dynamicModules.mjs.map +1 -1
- package/dist/esm/api/experimental.mjs.map +1 -1
- package/dist/esm/api/group.mjs +18 -17
- package/dist/esm/api/group.mjs.map +1 -1
- package/dist/esm/api/index.mjs +1 -0
- package/dist/esm/api/index.mjs.map +1 -1
- package/dist/esm/api/inlineTasks.mjs +1 -0
- package/dist/esm/api/inlineTasks.mjs.map +1 -1
- package/dist/esm/api/labelInfo.mjs.map +1 -1
- package/dist/esm/api/longRunningTask.mjs +1 -0
- package/dist/esm/api/longRunningTask.mjs.map +1 -1
- package/dist/esm/api/models/labeledContentType.mjs.map +1 -1
- package/dist/esm/api/relation.mjs.map +1 -1
- package/dist/esm/api/search.mjs +1 -0
- package/dist/esm/api/search.mjs.map +1 -1
- package/dist/esm/api/settings.mjs.map +1 -1
- package/dist/esm/api/space.mjs +4 -2
- package/dist/esm/api/space.mjs.map +1 -1
- package/dist/esm/api/spacePermissions.mjs.map +1 -1
- package/dist/esm/api/spaceProperties.mjs +1 -0
- package/dist/esm/api/spaceProperties.mjs.map +1 -1
- package/dist/esm/api/spaceSettings.mjs.map +1 -1
- package/dist/esm/api/template.mjs.map +1 -1
- package/dist/esm/api/themes.mjs.map +1 -1
- package/dist/esm/api/userProperties.mjs +54 -0
- package/dist/esm/api/userProperties.mjs.map +1 -0
- package/dist/esm/api/users.mjs.map +1 -1
- package/dist/esm/clients/baseClient.mjs +18 -3
- package/dist/esm/clients/baseClient.mjs.map +1 -1
- package/dist/esm/clients/confluenceClient.mjs +6 -0
- package/dist/esm/clients/confluenceClient.mjs.map +1 -1
- package/dist/esm/config.mjs +7 -4
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/paramSerializer.mjs.map +1 -1
- package/dist/esm/services/authenticationService/authenticationService.mjs.map +1 -1
- package/dist/esm/services/authenticationService/authentications/createBasicAuthenticationToken.mjs.map +1 -1
- package/dist/esm/services/authenticationService/authentications/createJWTAuthentication.mjs +1 -1
- package/dist/esm/services/authenticationService/authentications/createJWTAuthentication.mjs.map +1 -1
- package/dist/esm/services/authenticationService/base64Encoder.mjs.map +1 -1
- package/dist/esm/types/api/analytics.d.ts +1 -1
- package/dist/esm/types/api/audit.d.ts +3 -3
- package/dist/esm/types/api/content.d.ts +33 -7
- package/dist/esm/types/api/contentAttachments.d.ts +5 -1
- package/dist/esm/types/api/contentBody.d.ts +73 -7
- package/dist/esm/types/api/contentChildrenAndDescendants.d.ts +37 -5
- package/dist/esm/types/api/contentComments.d.ts +5 -0
- package/dist/esm/types/api/contentLabels.d.ts +17 -9
- package/dist/esm/types/api/contentMacroBody.d.ts +79 -1
- package/dist/esm/types/api/contentPermissions.d.ts +1 -1
- package/dist/esm/types/api/contentProperties.d.ts +25 -0
- package/dist/esm/types/api/contentRestrictions.d.ts +19 -7
- package/dist/esm/types/api/contentStates.d.ts +23 -5
- package/dist/esm/types/api/contentVersions.d.ts +9 -1
- package/dist/esm/types/api/contentWatches.d.ts +1 -1
- package/dist/esm/types/api/dynamicModules.d.ts +1 -1
- package/dist/esm/types/api/experimental.d.ts +21 -1
- package/dist/esm/types/api/group.d.ts +47 -27
- package/dist/esm/types/api/index.d.ts +1 -0
- package/dist/esm/types/api/inlineTasks.d.ts +13 -0
- package/dist/esm/types/api/labelInfo.d.ts +1 -1
- package/dist/esm/types/api/longRunningTask.d.ts +1 -1
- package/dist/esm/types/api/models/spaceCreate.d.ts +11 -2
- package/dist/esm/types/api/models/spacePrivateCreate.d.ts +11 -2
- package/dist/esm/types/api/parameters/bulkAsyncConvertContentBodyRequest.d.ts +58 -0
- package/dist/esm/types/api/parameters/bulkAsyncConvertContentBodyResponse.d.ts +4 -0
- package/dist/esm/types/api/parameters/deleteGroupById.d.ts +4 -0
- package/dist/esm/types/api/parameters/downloadAttachment.d.ts +6 -0
- package/dist/esm/types/api/parameters/getContentChildren.d.ts +6 -1
- package/dist/esm/types/api/parameters/getContentsWithState.d.ts +17 -0
- package/dist/esm/types/api/parameters/getGroupMembersByGroupId.d.ts +7 -0
- package/dist/esm/types/api/parameters/getGroupMembershipsForUser.d.ts +4 -0
- package/dist/esm/types/api/parameters/getTasks.d.ts +2 -0
- package/dist/esm/types/api/parameters/getUser.d.ts +4 -0
- package/dist/esm/types/api/parameters/index.d.ts +4 -0
- package/dist/esm/types/api/parameters/searchUser.d.ts +7 -0
- package/dist/esm/types/api/relation.d.ts +13 -15
- package/dist/esm/types/api/search.d.ts +7 -1
- package/dist/esm/types/api/settings.d.ts +5 -1
- package/dist/esm/types/api/space.d.ts +23 -7
- package/dist/esm/types/api/spacePermissions.d.ts +1 -1
- package/dist/esm/types/api/spaceProperties.d.ts +25 -0
- package/dist/esm/types/api/spaceSettings.d.ts +1 -1
- package/dist/esm/types/api/template.d.ts +1 -1
- package/dist/esm/types/api/themes.d.ts +1 -1
- package/dist/esm/types/api/userProperties.d.ts +102 -0
- package/dist/esm/types/api/users.d.ts +21 -9
- package/dist/esm/types/clients/baseClient.d.ts +1 -0
- package/dist/esm/types/clients/confluenceClient.d.ts +6 -1
- package/dist/esm/types/config.d.ts +29 -240
- package/eslint.config.ts +11 -16
- package/package.json +34 -33
- package/rollup.config.ts +8 -8
- package/src/api/analytics.ts +1 -1
- package/src/api/audit.ts +3 -3
- package/src/api/content.ts +33 -12
- package/src/api/contentAttachments.ts +6 -1
- package/src/api/contentBody.ts +113 -7
- package/src/api/contentChildrenAndDescendants.ts +39 -5
- package/src/api/contentComments.ts +5 -0
- package/src/api/contentLabels.ts +17 -9
- package/src/api/contentMacroBody.ts +79 -1
- package/src/api/contentPermissions.ts +1 -1
- package/src/api/contentProperties.ts +25 -0
- package/src/api/contentRestrictions.ts +19 -7
- package/src/api/contentStates.ts +47 -5
- package/src/api/contentVersions.ts +9 -1
- package/src/api/contentWatches.ts +1 -1
- package/src/api/dynamicModules.ts +1 -1
- package/src/api/experimental.ts +21 -1
- package/src/api/group.ts +96 -75
- package/src/api/index.ts +1 -0
- package/src/api/inlineTasks.ts +13 -0
- package/src/api/labelInfo.ts +1 -1
- package/src/api/longRunningTask.ts +2 -1
- package/src/api/models/spaceCreate.ts +11 -2
- package/src/api/models/spacePrivateCreate.ts +11 -2
- package/src/api/parameters/bulkAsyncConvertContentBodyRequest.ts +88 -0
- package/src/api/parameters/bulkAsyncConvertContentBodyResponse.ts +4 -0
- package/src/api/parameters/deleteGroupById.ts +4 -0
- package/src/api/parameters/downloadAttachment.ts +6 -0
- package/src/api/parameters/getContentChildren.ts +7 -1
- package/src/api/parameters/getContentsWithState.ts +17 -0
- package/src/api/parameters/getGroupMembersByGroupId.ts +7 -0
- package/src/api/parameters/getGroupMembershipsForUser.ts +4 -0
- package/src/api/parameters/getTasks.ts +2 -0
- package/src/api/parameters/getUser.ts +4 -0
- package/src/api/parameters/index.ts +4 -0
- package/src/api/parameters/searchUser.ts +7 -0
- package/src/api/relation.ts +13 -15
- package/src/api/search.ts +8 -1
- package/src/api/settings.ts +5 -1
- package/src/api/space.ts +27 -9
- package/src/api/spacePermissions.ts +1 -1
- package/src/api/spaceProperties.ts +25 -0
- package/src/api/spaceSettings.ts +1 -1
- package/src/api/template.ts +1 -1
- package/src/api/themes.ts +1 -1
- package/src/api/userProperties.ts +185 -0
- package/src/api/users.ts +21 -9
- package/src/clients/baseClient.ts +24 -8
- package/src/clients/confluenceClient.ts +6 -0
- package/src/config.ts +8 -4
- package/src/services/authenticationService/authentications/createJWTAuthentication.ts +1 -1
- package/favicon.svg +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.cjs","sources":["../../../../src/api/content.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class Content {\n constructor(private client: Client) {}\n\n /**\n * Returns all content in a Confluence instance.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n */\n async getContent<T = Models.ContentArray>(\n parameters: Parameters.GetContent | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all content in a Confluence instance.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n */\n async getContent<T = Models.ContentArray>(parameters?: Parameters.GetContent, callback?: never): Promise<T>;\n async getContent<T = Models.ContentArray>(\n parameters?: Parameters.GetContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content',\n method: 'GET',\n params: {\n type: parameters?.type,\n spaceKey: parameters?.spaceKey,\n title: parameters?.title,\n status: parameters?.status,\n postingDay: parameters?.postingDay,\n trigger: parameters?.trigger,\n orderby: parameters?.orderby,\n start: parameters?.start,\n limit: parameters?.limit,\n expand: parameters?.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Creates a new piece of content or publishes an existing draft.\n *\n * To publish a draft, add the `id` and `status` properties to the body of the request. Set the `id` to the ID of the\n * draft and set the `status` to 'current'. When the request is sent, a new piece of content will be created and the\n * metadata from the draft will be transferred into it.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be created in, and permission to view the draft if publishing a draft.\n */\n async createContent<T = Models.Content>(\n parameters: Parameters.CreateContent | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Creates a new piece of content or publishes an existing draft.\n *\n * To publish a draft, add the `id` and `status` properties to the body of the request. Set the `id` to the ID of the\n * draft and set the `status` to 'current'. When the request is sent, a new piece of content will be created and the\n * metadata from the draft will be transferred into it.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be created in, and permission to view the draft if publishing a draft.\n */\n async createContent<T = Models.Content>(parameters?: Parameters.CreateContent, callback?: never): Promise<T>;\n async createContent<T = Models.Content>(\n parameters?: Parameters.CreateContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content',\n method: 'POST',\n params: {\n status: parameters?.status,\n expand: parameters?.expand,\n },\n data: {\n ...parameters,\n status: undefined,\n expand: undefined,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the\n * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>\n * REST API to get the copy task status.\n *\n * Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need\n * not belong to the same space.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages\n * in the corresponding space it belongs to.\n */\n async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback: Callback<T>): Promise<void>;\n /**\n * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the\n * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>\n * REST API to get the copy task status.\n *\n * Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need\n * not belong to the same space.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages\n * in the corresponding space it belongs to.\n */\n async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback?: never): Promise<T>;\n async archivePages<T = Models.LongTask>(\n parameters: Parameters.ArchivePages,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content/archive',\n method: 'POST',\n data: {\n pages: parameters.pages,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of\n * shared drafts. For now, this method works the same as [Publish shared\n * draft](#api-content-blueprint-instance-draftId-put).\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishLegacyDraft<T = Models.Content>(\n parameters: Parameters.PublishLegacyDraft,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of\n * shared drafts. For now, this method works the same as [Publish shared\n * draft](#api-content-blueprint-instance-draftId-put).\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishLegacyDraft<T = Models.Content>(parameters: Parameters.PublishLegacyDraft, callback?: never): Promise<T>;\n async publishLegacyDraft<T = Models.Content>(\n parameters: Parameters.PublishLegacyDraft,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/blueprint/instance/${parameters.draftId}`,\n method: 'POST',\n params: {\n status: parameters.status,\n },\n data: {\n ...parameters,\n version: parameters.version,\n title: parameters.title,\n type: parameters.type,\n status: parameters.bodyStatus,\n space: parameters.space,\n ancestors: parameters.ancestors,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Publishes a shared draft of a page created from a blueprint.\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishSharedDraft<T = Models.Content>(\n parameters: Parameters.PublishSharedDraft,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Publishes a shared draft of a page created from a blueprint.\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishSharedDraft<T = Models.Content>(parameters: Parameters.PublishSharedDraft, callback?: never): Promise<T>;\n async publishSharedDraft<T = Models.Content>(\n parameters: Parameters.PublishSharedDraft,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/blueprint/instance/${parameters.draftId}`,\n method: 'PUT',\n params: {\n status: parameters.status,\n },\n data: {\n ...parameters,\n version: parameters.version,\n title: parameters.title,\n type: parameters.type,\n status: parameters.bodyStatus,\n space: parameters.space,\n ancestors: parameters.ancestors,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:\n * [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).\n *\n * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The\n * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of\n * results returned in each call. Example subsequent call (taken from example response):\n *\n * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg\n *\n * The response to this will have a `prev` URL similar to the `next` in the example response.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n */\n async searchContentByCQL<T = Models.ContentArray>(\n parameters: Parameters.SearchContentByCQL,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:\n * [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).\n *\n * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The\n * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of\n * results returned in each call. Example subsequent call (taken from example response):\n *\n * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg\n *\n * The response to this will have a `prev` URL similar to the `next` in the example response.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n */\n async searchContentByCQL<T = Models.ContentArray>(\n parameters: Parameters.SearchContentByCQL,\n callback?: never,\n ): Promise<T>;\n async searchContentByCQL<T = Models.ContentArray>(\n parameters: Parameters.SearchContentByCQL,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content/search',\n method: 'GET',\n params: {\n cql: parameters.cql,\n cqlcontext: parameters.cqlcontext,\n cursor: parameters.cursor,\n limit: parameters.limit,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a single piece of content, like a page or a blog post.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n */\n async getContentById<T = Models.Content>(parameters: Parameters.GetContentById, callback: Callback<T>): Promise<void>;\n /**\n * Returns a single piece of content, like a page or a blog post.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n */\n async getContentById<T = Models.Content>(parameters: Parameters.GetContentById, callback?: never): Promise<T>;\n async getContentById<T = Models.Content>(\n parameters: Parameters.GetContentById,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}`,\n method: 'GET',\n params: {\n status: parameters.status,\n version: parameters.version,\n embeddedContentRender: parameters.embeddedContentRender,\n trigger: parameters.trigger,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates a piece of content. Use this method to update the title or body of a piece of content, change the status,\n * change the parent page, and more.\n *\n * Note, updating draft content is currently not supported.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateContent<T = Models.Content>(parameters: Parameters.UpdateContent, callback: Callback<T>): Promise<void>;\n /**\n * Updates a piece of content. Use this method to update the title or body of a piece of content, change the status,\n * change the parent page, and more.\n *\n * Note, updating draft content is currently not supported.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateContent<T = Models.Content>(parameters: Parameters.UpdateContent, callback?: never): Promise<T>;\n async updateContent<T = Models.Content>(\n parameters: Parameters.UpdateContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}`,\n method: 'PUT',\n params: {\n status: parameters.status,\n conflictPolicy: parameters.conflictPolicy,\n },\n data: {\n version: parameters.version,\n title: parameters.title,\n type: parameters.type,\n status: parameters.statusBody,\n ancestors: parameters.ancestors,\n body: parameters.body,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and\n * status:\n *\n * - If the content's type is `page` or `blogpost` and its status is `current`, it will be trashed.\n * - If the content's type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the\n * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your\n * request.\n * - If the content's type is `comment` or `attachment`, it will be deleted permanently without being trashed.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the\n * content is in.\n */\n async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback: Callback<T>): Promise<void>;\n /**\n * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and\n * status:\n *\n * - If the content's type is `page` or `blogpost` and its status is `current`, it will be trashed.\n * - If the content's type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the\n * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your\n * request.\n * - If the content's type is `comment` or `attachment`, it will be deleted permanently without being trashed.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the\n * content is in.\n */\n async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback?: never): Promise<T>;\n async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}`,\n method: 'DELETE',\n params: {\n status: parameters.status,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the most recent update for a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content.\n */\n async getHistoryForContent<T = Models.ContentHistory>(\n parameters: Parameters.GetHistoryForContent,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the most recent update for a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content.\n */\n async getHistoryForContent<T = Models.ContentHistory>(\n parameters: Parameters.GetHistoryForContent,\n callback?: never,\n ): Promise<T>;\n async getHistoryForContent<T = Models.ContentHistory>(\n parameters: Parameters.GetHistoryForContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history`,\n method: 'GET',\n params: {\n expand: parameters.expand,\n },\n };\n\n return this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AgB,UAAU,CAAC,EAAE,CAAU,QAAA,CAAA;AAC5C,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAEnD;;;;"}
|
|
1
|
+
{"version":3,"file":"content.cjs","sources":["../../../../src/api/content.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class Content {\n constructor(private client: Client) {}\n\n /**\n * Returns all content in a Confluence instance.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContent<T = Models.ContentArray>(\n parameters: Parameters.GetContent | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all content in a Confluence instance.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContent<T = Models.ContentArray>(parameters?: Parameters.GetContent, callback?: never): Promise<T>;\n async getContent<T = Models.ContentArray>(\n parameters?: Parameters.GetContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content',\n method: 'GET',\n params: {\n type: parameters?.type,\n spaceKey: parameters?.spaceKey,\n title: parameters?.title,\n status: parameters?.status,\n postingDay: parameters?.postingDay,\n trigger: parameters?.trigger,\n orderby: parameters?.orderby,\n start: parameters?.start,\n limit: parameters?.limit,\n expand: parameters?.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Creates a new piece of content or publishes an existing draft.\n *\n * To publish a draft, add the `id` and `status` properties to the body of the request. Set the `id` to the ID of the\n * draft and set the `status` to 'current'. When the request is sent, a new piece of content will be created and the\n * metadata from the draft will be transferred into it.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be created in, and permission to view the draft if publishing a draft.\n *\n * @deprecated Will be removed in next major version.\n */\n async createContent<T = Models.Content>(\n parameters: Parameters.CreateContent | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Creates a new piece of content or publishes an existing draft.\n *\n * To publish a draft, add the `id` and `status` properties to the body of the request. Set the `id` to the ID of the\n * draft and set the `status` to 'current'. When the request is sent, a new piece of content will be created and the\n * metadata from the draft will be transferred into it.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be created in, and permission to view the draft if publishing a draft.\n *\n * @deprecated Will be removed in next major version.\n */\n async createContent<T = Models.Content>(parameters?: Parameters.CreateContent, callback?: never): Promise<T>;\n async createContent<T = Models.Content>(\n parameters?: Parameters.CreateContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content',\n method: 'POST',\n params: {\n status: parameters?.status,\n expand: parameters?.expand,\n },\n data: {\n ...parameters,\n status: undefined,\n expand: undefined,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the\n * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>\n * REST API to get the copy task status.\n *\n * Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need\n * not belong to the same space.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages\n * in the corresponding space it belongs to.\n */\n async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback: Callback<T>): Promise<void>;\n /**\n * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the\n * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>\n * REST API to get the copy task status.\n *\n * Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need\n * not belong to the same space.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages\n * in the corresponding space it belongs to.\n */\n async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback?: never): Promise<T>;\n async archivePages<T = Models.LongTask>(\n parameters: Parameters.ArchivePages,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content/archive',\n method: 'POST',\n data: {\n pages: parameters.pages,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of\n * shared drafts. For now, this method works the same as [Publish shared\n * draft](#api-content-blueprint-instance-draftId-put).\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishLegacyDraft<T = Models.Content>(\n parameters: Parameters.PublishLegacyDraft,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of\n * shared drafts. For now, this method works the same as [Publish shared\n * draft](#api-content-blueprint-instance-draftId-put).\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishLegacyDraft<T = Models.Content>(parameters: Parameters.PublishLegacyDraft, callback?: never): Promise<T>;\n async publishLegacyDraft<T = Models.Content>(\n parameters: Parameters.PublishLegacyDraft,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/blueprint/instance/${parameters.draftId}`,\n method: 'POST',\n params: {\n status: parameters.status,\n },\n data: {\n ...parameters,\n version: parameters.version,\n title: parameters.title,\n type: parameters.type,\n status: parameters.bodyStatus,\n space: parameters.space,\n ancestors: parameters.ancestors,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Publishes a shared draft of a page created from a blueprint.\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishSharedDraft<T = Models.Content>(\n parameters: Parameters.PublishSharedDraft,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Publishes a shared draft of a page created from a blueprint.\n *\n * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the draft and 'Add'\n * permission for the space that the content will be created in.\n */\n async publishSharedDraft<T = Models.Content>(parameters: Parameters.PublishSharedDraft, callback?: never): Promise<T>;\n async publishSharedDraft<T = Models.Content>(\n parameters: Parameters.PublishSharedDraft,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/blueprint/instance/${parameters.draftId}`,\n method: 'PUT',\n params: {\n status: parameters.status,\n },\n data: {\n ...parameters,\n status: parameters.bodyStatus,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:\n * [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).\n *\n * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The\n * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of\n * results returned in each call.\n *\n * The response to this will have a `prev` URL similar to the `next` in the example response.\n *\n * If the expand query parameter is used with the `body.export_view` and/or `body.styled_view` properties, then the\n * query limit parameter will be restricted to a maximum value of 25.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n */\n async searchContentByCQL<T = Models.ContentArray>(\n parameters: Parameters.SearchContentByCQL,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:\n * [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).\n *\n * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The\n * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of\n * results returned in each call.\n *\n * The response to this will have a `prev` URL similar to the `next` in the example response.\n *\n * If the expand query parameter is used with the `body.export_view` and/or `body.styled_view` properties, then the\n * query limit parameter will be restricted to a maximum value of 25.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission). Only content that the user has permission to view will be returned.\n */\n async searchContentByCQL<T = Models.ContentArray>(\n parameters: Parameters.SearchContentByCQL,\n callback?: never,\n ): Promise<T>;\n async searchContentByCQL<T = Models.ContentArray>(\n parameters: Parameters.SearchContentByCQL,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/content/search',\n method: 'GET',\n params: {\n cql: parameters.cql,\n cqlcontext: parameters.cqlcontext,\n cursor: parameters.cursor,\n limit: parameters.limit,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a single piece of content, like a page or a blog post.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentById<T = Models.Content>(parameters: Parameters.GetContentById, callback: Callback<T>): Promise<void>;\n /**\n * Returns a single piece of content, like a page or a blog post.\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentById<T = Models.Content>(parameters: Parameters.GetContentById, callback?: never): Promise<T>;\n async getContentById<T = Models.Content>(\n parameters: Parameters.GetContentById,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}`,\n method: 'GET',\n params: {\n status: parameters.status,\n version: parameters.version,\n embeddedContentRender: parameters.embeddedContentRender,\n trigger: parameters.trigger,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates a piece of content. Use this method to update the title or body of a piece of content, change the status,\n * change the parent page, and more.\n *\n * Note, updating draft content is currently not supported.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n *\n * @deprecated Will be removed in next major version.\n */\n async updateContent<T = Models.Content>(parameters: Parameters.UpdateContent, callback: Callback<T>): Promise<void>;\n /**\n * Updates a piece of content. Use this method to update the title or body of a piece of content, change the status,\n * change the parent page, and more.\n *\n * Note, updating draft content is currently not supported.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n *\n * @deprecated Will be removed in next major version.\n */\n async updateContent<T = Models.Content>(parameters: Parameters.UpdateContent, callback?: never): Promise<T>;\n async updateContent<T = Models.Content>(\n parameters: Parameters.UpdateContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}`,\n method: 'PUT',\n params: {\n status: parameters.status,\n conflictPolicy: parameters.conflictPolicy,\n },\n data: {\n version: parameters.version,\n title: parameters.title,\n type: parameters.type,\n status: parameters.statusBody,\n ancestors: parameters.ancestors,\n body: parameters.body,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and\n * status:\n *\n * - If the content's type is `page` or `blogpost` and its status is `current`, it will be trashed.\n * - If the content's type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the\n * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your\n * request.\n * - If the content's type is `comment` or `attachment`, it will be deleted permanently without being trashed.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the\n * content is in.\n *\n * @deprecated Will be removed in next major version.\n */\n async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback: Callback<T>): Promise<void>;\n /**\n * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and\n * status:\n *\n * - If the content's type is `page` or `blogpost` and its status is `current`, it will be trashed.\n * - If the content's type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the\n * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your\n * request.\n * - If the content's type is `comment` or `attachment`, it will be deleted permanently without being trashed.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the\n * content is in.\n *\n * @deprecated Will be removed in next major version.\n */\n async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback?: never): Promise<T>;\n async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}`,\n method: 'DELETE',\n params: {\n status: parameters.status,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the most recent update for a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content.\n *\n * @deprecated Will be removed in next major version.\n */\n async getHistoryForContent<T = Models.ContentHistory>(\n parameters: Parameters.GetHistoryForContent,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the most recent update for a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content.\n *\n * @deprecated Will be removed in next major version.\n */\n async getHistoryForContent<T = Models.ContentHistory>(\n parameters: Parameters.GetHistoryForContent,\n callback?: never,\n ): Promise<T>;\n async getHistoryForContent<T = Models.ContentHistory>(\n parameters: Parameters.GetHistoryForContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history`,\n method: 'GET',\n params: {\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,OAAO,CAAA;AACE,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AA2BrC,IAAA,MAAM,UAAU,CACd,UAAkC,EAClC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,cAAc;AACnB,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,IAAI,EAAE,UAAU,EAAE,IAAI;gBACtB,QAAQ,EAAE,UAAU,EAAE,QAAQ;gBAC9B,KAAK,EAAE,UAAU,EAAE,KAAK;gBACxB,MAAM,EAAE,UAAU,EAAE,MAAM;gBAC1B,UAAU,EAAE,UAAU,EAAE,UAAU;gBAClC,OAAO,EAAE,UAAU,EAAE,OAAO;gBAC5B,OAAO,EAAE,UAAU,EAAE,OAAO;gBAC5B,KAAK,EAAE,UAAU,EAAE,KAAK;gBACxB,KAAK,EAAE,UAAU,EAAE,KAAK;gBACxB,MAAM,EAAE,UAAU,EAAE,MAAM;AAC3B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAmCA,IAAA,MAAM,aAAa,CACjB,UAAqC,EACrC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,cAAc;AACnB,YAAA,MAAM,EAAE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AwBA,IAAA,MAAM,oBAAoB,CACxB,UAA2C,EAC3C,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,QAAA,CAAU;AAC5C,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentAttachments.cjs","sources":["../../../../src/api/contentAttachments.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport FormData from 'form-data';\nimport type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentAttachments {\n constructor(private client: Client) {}\n\n /**\n * Returns the attachments for a piece of content.\n *\n * By default, the following objects are expanded: `metadata`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n */\n async getAttachments<T = Models.ContentArray<Models.Attachment>>(\n parameters: Parameters.GetAttachments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the attachments for a piece of content.\n *\n * By default, the following objects are expanded: `metadata`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n */\n async getAttachments<T = Models.ContentArray<Models.Attachment>>(\n parameters: Parameters.GetAttachments,\n callback?: never,\n ): Promise<T>;\n async getAttachments<T = Models.ContentArray<Models.Attachment>>(\n parameters: Parameters.GetAttachments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment`,\n method: 'GET',\n params: {\n start: parameters.start,\n limit: parameters.limit,\n filename: parameters.filename,\n mediaType: parameters.mediaType,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing\n * attachment, use [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateAttachments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing\n * attachment, use [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateAttachments,\n callback?: never,\n ): Promise<T>;\n async createAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateAttachments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const formData = new FormData();\n const attachments = Array.isArray(parameters.attachments) ? parameters.attachments : [parameters.attachments];\n\n attachments.forEach(attachment => {\n formData.append('minorEdit', attachment.minorEdit.toString(), 'minorEdit');\n formData.append('file', attachment.file, {\n filename: attachment.filename,\n contentType: attachment.contentType,\n });\n\n if (attachment.comment) {\n formData.append('comment', attachment.comment, 'comment');\n }\n });\n\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment`,\n method: 'POST',\n headers: {\n 'X-Atlassian-Token': 'no-check',\n 'Content-Type': 'multipart/form-data',\n ...formData.getHeaders?.(),\n },\n params: {\n status: parameters.status,\n },\n data: formData,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Adds an attachment to a piece of content. If the attachment already exists for the content, then the attachment is\n * updated (i.e. a new version of the attachment is created).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createOrUpdateAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateOrUpdateAttachments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Adds an attachment to a piece of content. If the attachment already exists for the content, then the attachment is\n * updated (i.e. a new version of the attachment is created).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createOrUpdateAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateOrUpdateAttachments,\n callback?: never,\n ): Promise<T>;\n async createOrUpdateAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateOrUpdateAttachments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const formData = new FormData();\n const attachments = Array.isArray(parameters.attachments) ? parameters.attachments : [parameters.attachments];\n\n attachments.forEach(attachment => {\n formData.append('minorEdit', attachment.minorEdit.toString(), 'minorEdit');\n formData.append('file', attachment.file, {\n filename: attachment.filename,\n contentType: attachment.contentType,\n });\n\n if (attachment.comment) {\n formData.append('comment', attachment.comment, 'comment');\n }\n });\n\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment`,\n method: 'PUT',\n headers: {\n 'X-Atlassian-Token': 'no-check',\n 'Content-Type': 'multipart/form-data',\n ...formData.getHeaders?.(),\n },\n params: {\n status: parameters.status,\n },\n data: formData,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates the attachment properties, i.e. the non-binary data of an attachment like the filename, media-type,\n * comment, and parent container.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentProperties<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentProperties,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Updates the attachment properties, i.e. the non-binary data of an attachment like the filename, media-type,\n * comment, and parent container.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentProperties<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentProperties,\n callback?: never,\n ): Promise<T>;\n async updateAttachmentProperties<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentProperties,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}`,\n method: 'PUT',\n data: parameters.update,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit\n * field.\n *\n * This method is essentially the same as [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put),\n * except that it matches the attachment ID rather than the name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentData<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentData,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit\n * field.\n *\n * This method is essentially the same as [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put),\n * except that it matches the attachment ID rather than the name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentData<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentData,\n callback?: never,\n ): Promise<T>;\n async updateAttachmentData<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentData,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const { attachment } = parameters;\n\n const formData = new FormData();\n\n formData.append('minorEdit', attachment.minorEdit.toString(), 'minorEdit');\n formData.append('file', attachment.file, {\n filename: attachment.filename,\n contentType: attachment.contentType,\n });\n\n if (attachment.comment) {\n formData.append('comment', attachment.comment, 'comment');\n }\n\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}/data`,\n method: 'POST',\n headers: {\n 'X-Atlassian-Token': 'no-check',\n 'Content-Type': 'multipart/form-data',\n ...formData.getHeaders?.(),\n },\n data: formData,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /** Redirects the client to a URL that serves an attachment's binary data. */\n async downloadAttachment<T = Buffer>(parameters: Parameters.DownloadAttachment, callback: Callback<T>): Promise<void>;\n /** Redirects the client to a URL that serves an attachment's binary data. */\n async downloadAttachment<T = Buffer>(parameters: Parameters.DownloadAttachment, callback?: never): Promise<T>;\n async downloadAttachment<T = Buffer>(\n parameters: Parameters.DownloadAttachment,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}/download`,\n method: 'GET',\n responseType: 'arraybuffer',\n params: {\n version: parameters.version,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;;;AAAA;MAQa,kBAAkB,CAAA;AACT,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;AA0B1B,IAAA,MAAM,cAAc,CAClB,UAAqC,EACrC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAmB,iBAAA,CAAA;AACrD,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC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ACD,YAAA,IAAI,EAAE,QAAQ;SACf;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAOlD,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;YAC5B,GAAG,EAAE,gBAAgB,UAAU,CAAC,EAAE,CAAqB,kBAAA,EAAA,UAAU,CAAC,YAAY,CAAW,SAAA,CAAA;AACzF,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,YAAY,EAAE,aAAa;AAC3B,YAAA,MAAM,EAAE;gBACN,OAAO,EAAE,UAAU,CAAC,OAAO;AAC5B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAEnD;;;;"}
|
|
1
|
+
{"version":3,"file":"contentAttachments.cjs","sources":["../../../../src/api/contentAttachments.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport FormData from 'form-data';\nimport type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentAttachments {\n constructor(private client: Client) {}\n\n /**\n * Returns the attachments for a piece of content.\n *\n * By default, the following objects are expanded: `metadata`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n *\n * @deprecated Will be removed in next major version.\n */\n async getAttachments<T = Models.ContentArray<Models.Attachment>>(\n parameters: Parameters.GetAttachments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the attachments for a piece of content.\n *\n * By default, the following objects are expanded: `metadata`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the\n * content is a blog post, 'View' permission for the space is required.\n *\n * @deprecated Will be removed in next major version.\n */\n async getAttachments<T = Models.ContentArray<Models.Attachment>>(\n parameters: Parameters.GetAttachments,\n callback?: never,\n ): Promise<T>;\n async getAttachments<T = Models.ContentArray<Models.Attachment>>(\n parameters: Parameters.GetAttachments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment`,\n method: 'GET',\n params: {\n start: parameters.start,\n limit: parameters.limit,\n filename: parameters.filename,\n mediaType: parameters.mediaType,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing\n * attachment, use [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateAttachments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing\n * attachment, use [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateAttachments,\n callback?: never,\n ): Promise<T>;\n async createAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateAttachments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const formData = new FormData();\n const attachments = Array.isArray(parameters.attachments) ? parameters.attachments : [parameters.attachments];\n\n attachments.forEach(attachment => {\n formData.append('minorEdit', attachment.minorEdit.toString(), 'minorEdit');\n formData.append('file', attachment.file, {\n filename: attachment.filename,\n contentType: attachment.contentType,\n });\n\n if (attachment.comment) {\n formData.append('comment', attachment.comment, 'comment');\n }\n });\n\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment`,\n method: 'POST',\n headers: {\n 'X-Atlassian-Token': 'no-check',\n 'Content-Type': 'multipart/form-data',\n ...formData.getHeaders?.(),\n },\n params: {\n status: parameters.status,\n },\n data: formData,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Adds an attachment to a piece of content. If the attachment already exists for the content, then the attachment is\n * updated (i.e. a new version of the attachment is created).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createOrUpdateAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateOrUpdateAttachments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Adds an attachment to a piece of content. If the attachment already exists for the content, then the attachment is\n * updated (i.e. a new version of the attachment is created).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async createOrUpdateAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateOrUpdateAttachments,\n callback?: never,\n ): Promise<T>;\n async createOrUpdateAttachments<T = Models.ContentArray<Models.CreatedAttachment>>(\n parameters: Parameters.CreateOrUpdateAttachments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const formData = new FormData();\n const attachments = Array.isArray(parameters.attachments) ? parameters.attachments : [parameters.attachments];\n\n attachments.forEach(attachment => {\n formData.append('minorEdit', attachment.minorEdit.toString(), 'minorEdit');\n formData.append('file', attachment.file, {\n filename: attachment.filename,\n contentType: attachment.contentType,\n });\n\n if (attachment.comment) {\n formData.append('comment', attachment.comment, 'comment');\n }\n });\n\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment`,\n method: 'PUT',\n headers: {\n 'X-Atlassian-Token': 'no-check',\n 'Content-Type': 'multipart/form-data',\n ...formData.getHeaders?.(),\n },\n params: {\n status: parameters.status,\n },\n data: formData,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates the attachment properties, i.e. the non-binary data of an attachment like the filename, media-type,\n * comment, and parent container.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentProperties<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentProperties,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Updates the attachment properties, i.e. the non-binary data of an attachment like the filename, media-type,\n * comment, and parent container.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentProperties<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentProperties,\n callback?: never,\n ): Promise<T>;\n async updateAttachmentProperties<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentProperties,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}`,\n method: 'PUT',\n data: parameters.update,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit\n * field.\n *\n * This method is essentially the same as [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put),\n * except that it matches the attachment ID rather than the name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentData<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentData,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit\n * field.\n *\n * This method is essentially the same as [Create or update\n * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put),\n * except that it matches the attachment ID rather than the name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async updateAttachmentData<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentData,\n callback?: never,\n ): Promise<T>;\n async updateAttachmentData<T = Models.CreatedAttachment>(\n parameters: Parameters.UpdateAttachmentData,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const { attachment } = parameters;\n\n const formData = new FormData();\n\n formData.append('minorEdit', attachment.minorEdit.toString(), 'minorEdit');\n formData.append('file', attachment.file, {\n filename: attachment.filename,\n contentType: attachment.contentType,\n });\n\n if (attachment.comment) {\n formData.append('comment', attachment.comment, 'comment');\n }\n\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}/data`,\n method: 'POST',\n headers: {\n 'X-Atlassian-Token': 'no-check',\n 'Content-Type': 'multipart/form-data',\n ...formData.getHeaders?.(),\n },\n data: formData,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /** Redirects the client to a URL that serves an attachment's binary data. */\n async downloadAttachment<T = Buffer>(parameters: Parameters.DownloadAttachment, callback: Callback<T>): Promise<void>;\n /** Redirects the client to a URL that serves an attachment's binary data. */\n async downloadAttachment<T = Buffer>(parameters: Parameters.DownloadAttachment, callback?: never): Promise<T>;\n async downloadAttachment<T = Buffer>(\n parameters: Parameters.DownloadAttachment,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}/download`,\n method: 'GET',\n responseType: 'arraybuffer',\n params: {\n version: parameters.version,\n status: parameters.status,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;;;AAAA;MAQa,kBAAkB,CAAA;AACT,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AA8BrC,IAAA,MAAM,cAAc,CAClB,UAAqC,EACrC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,iBAAA,CAAmB;AACrD,Y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AAE,CAAA,kBAAA,EAAqB,UAAU,CAAC,YAAY,CAAA,KAAA,CAAO;AACrF,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,OAAO,EAAE;AACP,gBAAA,mBAAmB,EAAE,UAAU;AAC/B,gBAAA,cAAc,EAAE,qBAAqB;AACrC,gBAAA,GAAG,QAAQ,CAAC,UAAU,IAAI;AAC3B,aAAA;AACD,YAAA,IAAI,EAAE,QAAQ;SACf;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAMA,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;YAC5B,GAAG,EAAE,gBAAgB,UAAU,CAAC,EAAE,CAAA,kBAAA,EAAqB,UAAU,CAAC,YAAY,CAAA,SAAA,CAAW;AACzF,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,YAAY,EAAE,aAAa;AAC3B,YAAA,MAAM,EAAE;gBACN,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -49,6 +49,24 @@ class ContentBody {
|
|
|
49
49
|
};
|
|
50
50
|
return this.client.sendRequest(config, callback);
|
|
51
51
|
}
|
|
52
|
+
async bulkAsyncConvertContentBodyResponse(parameters, callback) {
|
|
53
|
+
const config = {
|
|
54
|
+
url: '/api/contentbody/convert/async/bulk/tasks',
|
|
55
|
+
method: 'GET',
|
|
56
|
+
params: {
|
|
57
|
+
ids: parameters.ids,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
return this.client.sendRequest(config, callback);
|
|
61
|
+
}
|
|
62
|
+
async bulkAsyncConvertContentBodyRequest(parameters, callback) {
|
|
63
|
+
const config = {
|
|
64
|
+
url: '/api/contentbody/convert/async/bulk/tasks',
|
|
65
|
+
method: 'POST',
|
|
66
|
+
data: parameters,
|
|
67
|
+
};
|
|
68
|
+
return this.client.sendRequest(config, callback);
|
|
69
|
+
}
|
|
52
70
|
}
|
|
53
71
|
|
|
54
72
|
exports.ContentBody = ContentBody;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentBody.cjs","sources":["../../../../src/api/contentBody.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentBody {\n constructor(private client: Client) {}\n\n /**\n * Converts a content body from one format to another format.\n *\n * Supported conversions:\n *\n * - Storage: view, export_view, styled_view, editor\n * - Editor: storage\n * - View: none\n * - Export_view: none\n * - Styled_view: none\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async convertContentBody<T = Models.ContentBody>(\n parameters: Parameters.ConvertContentBody,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Converts a content body from one format to another format.\n *\n * Supported conversions:\n *\n * - Storage: view, export_view, styled_view, editor\n * - Editor: storage\n * - View: none\n * - Export_view: none\n * - Styled_view: none\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async convertContentBody<T = Models.ContentBody>(\n parameters: Parameters.ConvertContentBody,\n callback?: never,\n ): Promise<T>;\n async convertContentBody<T = Models.ContentBody>(\n parameters: Parameters.ConvertContentBody,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/contentbody/convert/${parameters.to}`,\n method: 'POST',\n params: {\n spaceKeyContext: parameters.spaceKeyContext,\n contentIdContext: parameters.contentIdContext,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n data: {\n value: parameters.value,\n representation: parameters.representation,\n ...parameters.additionalProperties,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous\n * task.\n *\n * Supported conversions:\n *\n * - Storage: export_view\n *\n * No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5\n * minutes at the result endpoint.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyRequest<T = Models.AsyncId>(\n parameters: Parameters.AsyncConvertContentBodyRequest,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous\n * task.\n *\n * Supported conversions:\n *\n * - Storage: export_view\n *\n * No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5\n * minutes at the result endpoint.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyRequest<T = Models.AsyncId>(\n parameters: Parameters.AsyncConvertContentBodyRequest,\n callback?: never,\n ): Promise<T>;\n async asyncConvertContentBodyRequest<T = Models.AsyncId>(\n parameters: Parameters.AsyncConvertContentBodyRequest,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/contentbody/convert/async/${parameters.to}`,\n method: 'POST',\n params: {\n spaceKeyContext: parameters.spaceKeyContext,\n contentIdContext: parameters.contentIdContext,\n allowCache: parameters.allowCache,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n data: {\n value: parameters.value,\n representation: parameters.representation,\n ...parameters.additionalProperties,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the Asynchronous Content Body for the corresponding asyncId if the task is complete or returns the status\n * of the task.\n *\n * After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is\n * made again, with allowCache query param set to false.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(\n parameters: Parameters.AsyncConvertContentBodyResponse,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the Asynchronous Content Body for the corresponding asyncId if the task is complete or returns the status\n * of the task.\n *\n * After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is\n * made again, with allowCache query param set to false.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(\n parameters: Parameters.AsyncConvertContentBodyResponse,\n callback?: never,\n ): Promise<T>;\n async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(\n parameters: Parameters.AsyncConvertContentBodyResponse,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/contentbody/convert/async/${parameters.id}`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,WAAW,CAAA;AACF,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;AAsC1B,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,yBAAA,EAA4B,UAAU,CAAC,EAAE,CAAE,CAAA;AAChD,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,MAAM,EAAE;gBACN,eAAe,EAAE,UAAU,CAAC,eAAe;gBAC3C,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;gBAC7C,qBAAqB,EAAE,UAAU,CAAC,qBAAqB;gBACvD,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;AACD,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["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentBody {\n constructor(private client: Client) {}\n\n /**\n * Converts a content body from one format to another format.\n *\n * Supported conversions:\n *\n * - Storage: view, export_view, styled_view, editor\n * - Editor: storage\n * - View: none\n * - Export_view: none\n * - Styled_view: none\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n *\n * @deprecated Will be removed in next major version.\n */\n async convertContentBody<T = Models.ContentBody>(\n parameters: Parameters.ConvertContentBody,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Converts a content body from one format to another format.\n *\n * Supported conversions:\n *\n * - Storage: view, export_view, styled_view, editor\n * - Editor: storage\n * - View: none\n * - Export_view: none\n * - Styled_view: none\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n *\n * @deprecated Will be removed in next major version.\n */\n async convertContentBody<T = Models.ContentBody>(\n parameters: Parameters.ConvertContentBody,\n callback?: never,\n ): Promise<T>;\n async convertContentBody<T = Models.ContentBody>(\n parameters: Parameters.ConvertContentBody,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/contentbody/convert/${parameters.to}`,\n method: 'POST',\n params: {\n spaceKeyContext: parameters.spaceKeyContext,\n contentIdContext: parameters.contentIdContext,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n data: {\n value: parameters.value,\n representation: parameters.representation,\n ...parameters.additionalProperties,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous\n * task.\n *\n * Supported conversions:\n *\n * - Atlas_doc_format: editor, export_view, storage, styled_view, view\n * - Storage: atlas_doc_format, editor, export_view, styled_view, view\n * - Editor: storage\n *\n * No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5\n * minutes at the result endpoint.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyRequest<T = Models.AsyncId>(\n parameters: Parameters.AsyncConvertContentBodyRequest,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous\n * task.\n *\n * Supported conversions:\n *\n * - Atlas_doc_format: editor, export_view, storage, styled_view, view\n * - Storage: atlas_doc_format, editor, export_view, styled_view, view\n * - Editor: storage\n *\n * No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5\n * minutes at the result endpoint.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyRequest<T = Models.AsyncId>(\n parameters: Parameters.AsyncConvertContentBodyRequest,\n callback?: never,\n ): Promise<T>;\n async asyncConvertContentBodyRequest<T = Models.AsyncId>(\n parameters: Parameters.AsyncConvertContentBodyRequest,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/contentbody/convert/async/${parameters.to}`,\n method: 'POST',\n params: {\n spaceKeyContext: parameters.spaceKeyContext,\n contentIdContext: parameters.contentIdContext,\n allowCache: parameters.allowCache,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n data: {\n value: parameters.value,\n representation: parameters.representation,\n ...parameters.additionalProperties,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the asynchronous content body for the corresponding id if the task is complete or returns the status of the\n * task.\n *\n * After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is\n * made again, with allowCache query param set to false.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(\n parameters: Parameters.AsyncConvertContentBodyResponse,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the asynchronous content body for the corresponding id if the task is complete or returns the status of the\n * task.\n *\n * After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is\n * made again, with allowCache query param set to false.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',\n * 'View' permission for the space, and permission to view the content.\n */\n async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(\n parameters: Parameters.AsyncConvertContentBodyResponse,\n callback?: never,\n ): Promise<T>;\n async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(\n parameters: Parameters.AsyncConvertContentBodyResponse,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/contentbody/convert/async/${parameters.id}`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the content body for the corresponding `asyncId` of a completed conversion task. If the task is not\n * completed, the task status is returned instead.\n *\n * Once a conversion task is completed, the result can be obtained for up to 5 minutes, or until an identical\n * conversion request is made again with the `allowCache` parameter set to false.\n *\n * Note that there is a maximum limit of 50 task results per request to this endpoint.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async bulkAsyncConvertContentBodyResponse<T = Models.AsyncContentBody[]>(\n parameters: Parameters.BulkAsyncConvertContentBodyResponse,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the content body for the corresponding `asyncId` of a completed conversion task. If the task is not\n * completed, the task status is returned instead.\n *\n * Once a conversion task is completed, the result can be obtained for up to 5 minutes, or until an identical\n * conversion request is made again with the `allowCache` parameter set to false.\n *\n * Note that there is a maximum limit of 50 task results per request to this endpoint.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async bulkAsyncConvertContentBodyResponse<T = Models.AsyncContentBody[]>(\n parameters: Parameters.BulkAsyncConvertContentBodyResponse,\n callback?: never,\n ): Promise<T>;\n async bulkAsyncConvertContentBodyResponse<T = Models.AsyncContentBody[]>(\n parameters: Parameters.BulkAsyncConvertContentBodyResponse,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/contentbody/convert/async/bulk/tasks',\n method: 'GET',\n params: {\n ids: parameters.ids,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Asynchronously converts content bodies from one format to another format in bulk. Use the Content body REST API to\n * get the status of conversion tasks. Note that there is a maximum limit of 10 conversions per request to this\n * endpoint.\n *\n * Supported conversions:\n *\n * - Storage: editor, export_view, styled_view, view\n * - Editor: storage\n *\n * Once a conversion task is completed, it is available for polling for up to 5 minutes.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if the `spaceKeyContext` or `contentIdContext` are present.\n */\n async bulkAsyncConvertContentBodyRequest<T = Models.AsyncId[]>(\n parameters: Parameters.BulkAsyncConvertContentBodyRequest,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Asynchronously converts content bodies from one format to another format in bulk. Use the Content body REST API to\n * get the status of conversion tasks. Note that there is a maximum limit of 10 conversions per request to this\n * endpoint.\n *\n * Supported conversions:\n *\n * - Storage: editor, export_view, styled_view, view\n * - Editor: storage\n *\n * Once a conversion task is completed, it is available for polling for up to 5 minutes.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if the `spaceKeyContext` or `contentIdContext` are present.\n */\n async bulkAsyncConvertContentBodyRequest<T = Models.AsyncId[]>(\n parameters: Parameters.BulkAsyncConvertContentBodyRequest,\n callback?: never,\n ): Promise<T>;\n async bulkAsyncConvertContentBodyRequest<T = Models.AsyncId[]>(\n parameters: Parameters.BulkAsyncConvertContentBodyRequest,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/contentbody/convert/async/bulk/tasks',\n method: 'POST',\n data: parameters,\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,WAAW,CAAA;AACF,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AA0CrC,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,yBAAA,EAA4B,UAAU,CAAC,EAAE,CAAA,CAAE;AAChD,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,MAAM,EAAE;gBACN,eAAe,EAAE,UAAU,CAAC,eAAe;gBAC3C,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;gBAC7C,qBAAqB,EAAE,UAAU,CAAC,qBAAqB;gBACvD,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;AACD,YAAA,IAAI,EAAE;gBACJ,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,cAAc,EAAE,UAAU,CAAC,cAAc;gBACzC,GAAG,UAAU,CAAC,oBAAoB;AACnC,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AA0CA,IAAA,MAAM,8BAA8B,CAClC,UAAqD,EACrD,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,+BAAA,EAAkC,UAAU,CAAC,EAAE,CAAA,CAAE;AACtD,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,MAAM,EAAE;gBACN,eAAe,EAAE,UAAU,CAAC,eAAe;gBAC3C,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;gBAC7C,UAAU,EAAE,UAAU,CAAC,UAAU;gBACjC,qBAAqB,EAAE,UAAU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","sources":["../../../../src/api/contentChildrenAndDescendants.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentChildrenAndDescendants {\n constructor(private client: Client) {}\n\n /**\n * Returns a map of the direct children of a piece of content. A piece of content has different types of child\n * content, depending on its type. These are the default parent-child content type relationships:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Apps can override these default relationships. Apps can also introduce new content types that create new\n * parent-child content relationships.\n *\n * Note, the map will always include all child content types that are valid for the content. However, if the content\n * has no instances of a child content type, the map will contain an empty array for that child content type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentChildren<T = Models.ContentChildren>(\n parameters: Parameters.GetContentChildren,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a map of the direct children of a piece of content. A piece of content has different types of child\n * content, depending on its type. These are the default parent-child content type relationships:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Apps can override these default relationships. Apps can also introduce new content types that create new\n * parent-child content relationships.\n *\n * Note, the map will always include all child content types that are valid for the content. However, if the content\n * has no instances of a child content type, the map will contain an empty array for that child content type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentChildren<T = Models.ContentChildren>(\n parameters: Parameters.GetContentChildren,\n callback?: never,\n ): Promise<T>;\n async getContentChildren<T = Models.ContentChildren>(\n parameters: Parameters.GetContentChildren,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child`,\n method: 'GET',\n params: {\n expand: parameters.expand,\n parentVersion: parameters.parentVersion,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Move a page to a new location relative to a target page:\n *\n * - `before` - move the page under the same parent as the target, before the target in the list of children\n * - `after` - move the page under the same parent as the target, after the target in the list of children\n * - `append` - move the page to be a child of the target\n *\n * Caution: This API can move pages to the top level of a space. Top-level pages are difficult to find in the UI\n * because they do not show up in the page tree display. To avoid this, never use `before` or `after` positions when\n * the `targetId` is a top-level page.\n */\n async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback: Callback<T>): Promise<void>;\n /**\n * Move a page to a new location relative to a target page:\n *\n * - `before` - move the page under the same parent as the target, before the target in the list of children\n * - `after` - move the page under the same parent as the target, after the target in the list of children\n * - `append` - move the page to be a child of the target\n *\n * Caution: This API can move pages to the top level of a space. Top-level pages are difficult to find in the UI\n * because they do not show up in the page tree display. To avoid this, never use `before` or `after` positions when\n * the `targetId` is a top-level page.\n */\n async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: never): Promise<T>;\n async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.pageId}/move/${parameters.position}/${parameters.targetId}`,\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns all children of a given type, for a piece of content. A piece of content has different types of child\n * content, depending on its type:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * Note, this method only returns direct children. To return children at all levels, use [Get descendants by\n * type](#api-content-id-descendant-type-get).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentChildrenByType<T = Models.ContentArray>(\n parameters: Parameters.GetContentChildrenByType,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all children of a given type, for a piece of content. A piece of content has different types of child\n * content, depending on its type:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * Note, this method only returns direct children. To return children at all levels, use [Get descendants by\n * type](#api-content-id-descendant-type-get).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentChildrenByType<T = Models.ContentArray>(\n parameters: Parameters.GetContentChildrenByType,\n callback?: never,\n ): Promise<T>;\n async getContentChildrenByType<T = Models.ContentArray>(\n parameters: Parameters.GetContentChildrenByType,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/${parameters.type}`,\n method: 'GET',\n params: {\n parentVersion: parameters.parentVersion,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a map of the descendants of a piece of content. This is similar to [Get content\n * children](#api-content-id-child-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * The map will always include all descendant types that are valid for the content. However, if the content has no\n * instances of a descendant type, the map will contain an empty array for that descendant type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentDescendants<T = Models.ContentChildren>(\n parameters: Parameters.GetContentDescendants,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a map of the descendants of a piece of content. This is similar to [Get content\n * children](#api-content-id-child-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * The map will always include all descendant types that are valid for the content. However, if the content has no\n * instances of a descendant type, the map will contain an empty array for that descendant type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentDescendants<T = Models.ContentChildren>(\n parameters: Parameters.GetContentDescendants,\n callback?: never,\n ): Promise<T>;\n async getContentDescendants<T = Models.ContentChildren>(\n parameters: Parameters.GetContentDescendants,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/descendant`,\n method: 'GET',\n params: {\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by\n * type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getDescendantsOfType<T = Models.ContentArray>(\n parameters: Parameters.GetDescendantsOfType,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by\n * type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getDescendantsOfType<T = Models.ContentArray>(\n parameters: Parameters.GetDescendantsOfType,\n callback?: never,\n ): Promise<T>;\n async getDescendantsOfType<T = Models.ContentArray>(\n parameters: Parameters.GetDescendantsOfType,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/descendant/${parameters.type}`,\n method: 'GET',\n params: {\n depth: parameters.depth,\n start: parameters.start,\n limit: parameters.limit,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions\n * and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this\n * copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules\n * of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the\n * copied page titles.\n */\n async copyPageHierarchy<T = Models.LongTask>(\n parameters: Parameters.CopyPageHierarchy,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions\n * and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this\n * copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules\n * of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the\n * copied page titles.\n */\n async copyPageHierarchy<T = Models.LongTask>(parameters: Parameters.CopyPageHierarchy, callback?: never): Promise<T>;\n async copyPageHierarchy<T = Models.LongTask>(\n parameters: Parameters.CopyPageHierarchy,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/pagehierarchy/copy`,\n method: 'POST',\n data: {\n copyAttachments: parameters.copyAttachments,\n copyPermissions: parameters.copyPermissions,\n copyProperties: parameters.copyProperties,\n copyLabels: parameters.copyLabels,\n copyCustomContents: parameters.copyCustomContents,\n copyDescendants: parameters.copyDescendants,\n destinationPageId: parameters.destinationPageId,\n titleOptions: parameters.titleOptions,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Copies a single page and its associated properties, permissions, attachments, and custom contents. The `id` path\n * parameter refers to the content ID of the page to copy. The target of the page to be copied is defined using the\n * `destination` in the request body and can be one of the following types.\n *\n * - `space`: page will be copied to the specified space as a root page on the space\n * - `parent_page`: page will be copied as a child of the specified parent page\n * - `existing_page`: page will be copied and replace the specified page\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be copied in and permission to update the content if copying to an `existing_page`.\n */\n async copyPage<T = unknown>(parameters: Parameters.CopyPage, callback: Callback<T>): Promise<void>;\n /**\n * Copies a single page and its associated properties, permissions, attachments, and custom contents. The `id` path\n * parameter refers to the content ID of the page to copy. The target of the page to be copied is defined using the\n * `destination` in the request body and can be one of the following types.\n *\n * - `space`: page will be copied to the specified space as a root page on the space\n * - `parent_page`: page will be copied as a child of the specified parent page\n * - `existing_page`: page will be copied and replace the specified page\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be copied in and permission to update the content if copying to an `existing_page`.\n */\n async copyPage<T = unknown>(parameters: Parameters.CopyPage, callback?: never): Promise<T>;\n async copyPage<T = unknown>(parameters: Parameters.CopyPage, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/copy`,\n method: 'POST',\n params: {\n expand: parameters.expand,\n },\n data: parameters.bodyParameters,\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,6BAA6B,CAAA;AACpB,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;A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CAAC,UAAU;gBACjC,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;gBACjD,eAAe,EAAE,UAAU,CAAC,eAAe;gBAC3C,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;gBAC/C,YAAY,EAAE,UAAU,CAAC,YAAY;AACtC,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAiClD,IAAA,MAAM,QAAQ,CAAc,UAA+B,EAAE,QAAsB,EAAA;AACjF,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAO,KAAA,CAAA;AACzC,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;YACD,IAAI,EAAE,UAAU,CAAC,cAAc;SAChC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAEnD;;;;"}
|
|
1
|
+
{"version":3,"file":"contentChildrenAndDescendants.cjs","sources":["../../../../src/api/contentChildrenAndDescendants.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentChildrenAndDescendants {\n constructor(private client: Client) {}\n\n /**\n * Returns a map of the direct children of a piece of content. A piece of content has different types of child\n * content, depending on its type. These are the default parent-child content type relationships:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Apps can override these default relationships. Apps can also introduce new content types that create new\n * parent-child content relationships.\n *\n * Note, the map will always include all child content types that are valid for the content. However, if the content\n * has no instances of a child content type, the map will contain an empty array for that child content type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentChildren<T = Models.ContentChildren>(\n parameters: Parameters.GetContentChildren,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a map of the direct children of a piece of content. A piece of content has different types of child\n * content, depending on its type. These are the default parent-child content type relationships:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Apps can override these default relationships. Apps can also introduce new content types that create new\n * parent-child content relationships.\n *\n * Note, the map will always include all child content types that are valid for the content. However, if the content\n * has no instances of a child content type, the map will contain an empty array for that child content type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentChildren<T = Models.ContentChildren>(\n parameters: Parameters.GetContentChildren,\n callback?: never,\n ): Promise<T>;\n async getContentChildren<T = Models.ContentChildren>(\n parameters: Parameters.GetContentChildren,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child`,\n method: 'GET',\n params: {\n expand: parameters.expand,\n parentVersion: parameters.parentVersion,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Move a page to a new location relative to a target page:\n *\n * - `before` - move the page under the same parent as the target, before the target in the list of children\n * - `after` - move the page under the same parent as the target, after the target in the list of children\n * - `append` - move the page to be a child of the target\n *\n * Caution: This API can move pages to the top level of a space. Top-level pages are difficult to find in the UI\n * because they do not show up in the page tree display. To avoid this, never use `before` or `after` positions when\n * the `targetId` is a top-level page.\n */\n async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback: Callback<T>): Promise<void>;\n /**\n * Move a page to a new location relative to a target page:\n *\n * - `before` - move the page under the same parent as the target, before the target in the list of children\n * - `after` - move the page under the same parent as the target, after the target in the list of children\n * - `append` - move the page to be a child of the target\n *\n * Caution: This API can move pages to the top level of a space. Top-level pages are difficult to find in the UI\n * because they do not show up in the page tree display. To avoid this, never use `before` or `after` positions when\n * the `targetId` is a top-level page.\n */\n async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: never): Promise<T>;\n async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.pageId}/move/${parameters.position}/${parameters.targetId}`,\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns all children of a given type, for a piece of content. A piece of content has different types of child\n * content, depending on its type:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * Note, this method only returns direct children. To return children at all levels, use [Get descendants by\n * type](#api-content-id-descendant-type-get).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentChildrenByType<T = Models.ContentArray>(\n parameters: Parameters.GetContentChildrenByType,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all children of a given type, for a piece of content. A piece of content has different types of child\n * content, depending on its type:\n *\n * - `page`: child content is `page`, `comment`, `attachment`\n * - `blogpost`: child content is `comment`, `attachment`\n * - `attachment`: child content is `comment`\n * - `comment`: child content is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * Note, this method only returns direct children. To return children at all levels, use [Get descendants by\n * type](#api-content-id-descendant-type-get).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentChildrenByType<T = Models.ContentArray>(\n parameters: Parameters.GetContentChildrenByType,\n callback?: never,\n ): Promise<T>;\n async getContentChildrenByType<T = Models.ContentArray>(\n parameters: Parameters.GetContentChildrenByType,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/${parameters.type}`,\n method: 'GET',\n params: {\n parentVersion: parameters.parentVersion,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a map of the descendants of a piece of content. This is similar to [Get content\n * children](#api-content-id-child-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * The map will always include all descendant types that are valid for the content. However, if the content has no\n * instances of a descendant type, the map will contain an empty array for that descendant type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentDescendants<T = Models.ContentChildren>(\n parameters: Parameters.GetContentDescendants,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a map of the descendants of a piece of content. This is similar to [Get content\n * children](#api-content-id-child-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * The map will always include all descendant types that are valid for the content. However, if the content has no\n * instances of a descendant type, the map will contain an empty array for that descendant type.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentDescendants<T = Models.ContentChildren>(\n parameters: Parameters.GetContentDescendants,\n callback?: never,\n ): Promise<T>;\n async getContentDescendants<T = Models.ContentChildren>(\n parameters: Parameters.GetContentDescendants,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/descendant`,\n method: 'GET',\n params: {\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by\n * type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * If the expand query parameter is used with the `body.export_view` and/or `body.styled_view` properties, then the\n * query limit parameter will be restricted to a maximum value of 25.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getDescendantsOfType<T = Models.ContentArray>(\n parameters: Parameters.GetDescendantsOfType,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by\n * type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just\n * the direct child pages.\n *\n * A piece of content has different types of descendants, depending on its type:\n *\n * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`, `comment`, `attachment`\n * - `blogpost`: descendant is `comment`, `attachment`\n * - `attachment`: descendant is `comment`\n * - `comment`: descendant is `attachment`\n *\n * Custom content types that are provided by apps can also be returned.\n *\n * If the expand query parameter is used with the `body.export_view` and/or `body.styled_view` properties, then the\n * query limit parameter will be restricted to a maximum value of 25.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getDescendantsOfType<T = Models.ContentArray>(\n parameters: Parameters.GetDescendantsOfType,\n callback?: never,\n ): Promise<T>;\n async getDescendantsOfType<T = Models.ContentArray>(\n parameters: Parameters.GetDescendantsOfType,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/descendant/${parameters.type}`,\n method: 'GET',\n params: {\n depth: parameters.depth,\n start: parameters.start,\n limit: parameters.limit,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions\n * and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this\n * copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules\n * of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the\n * copied page titles.\n */\n async copyPageHierarchy<T = Models.LongTask>(\n parameters: Parameters.CopyPageHierarchy,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions\n * and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this\n * copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules\n * of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the\n * copied page titles.\n */\n async copyPageHierarchy<T = Models.LongTask>(parameters: Parameters.CopyPageHierarchy, callback?: never): Promise<T>;\n async copyPageHierarchy<T = Models.LongTask>(\n parameters: Parameters.CopyPageHierarchy,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/pagehierarchy/copy`,\n method: 'POST',\n data: {\n copyAttachments: parameters.copyAttachments,\n copyPermissions: parameters.copyPermissions,\n copyProperties: parameters.copyProperties,\n copyLabels: parameters.copyLabels,\n copyCustomContents: parameters.copyCustomContents,\n copyDescendants: parameters.copyDescendants,\n destinationPageId: parameters.destinationPageId,\n titleOptions: parameters.titleOptions,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Copies a single page and its associated properties, permissions, attachments, and custom contents. The `id` path\n * parameter refers to the content ID of the page to copy. The target of the page to be copied is defined using the\n * `destination` in the request body and can be one of the following types.\n *\n * - `space`: page will be copied to the specified space as a root page on the space\n * - `parent_page`: page will be copied as a child of the specified parent page\n * - `parent_content`: page will be copied as a child of the specified parent content\n * - `existing_page`: page will be copied and replace the specified page\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be copied in and permission to update the content if copying to an `existing_page`.\n */\n async copyPage<T = unknown>(parameters: Parameters.CopyPage, callback: Callback<T>): Promise<void>;\n /**\n * Copies a single page and its associated properties, permissions, attachments, and custom contents. The `id` path\n * parameter refers to the content ID of the page to copy. The target of the page to be copied is defined using the\n * `destination` in the request body and can be one of the following types.\n *\n * - `space`: page will be copied to the specified space as a root page on the space\n * - `parent_page`: page will be copied as a child of the specified parent page\n * - `parent_content`: page will be copied as a child of the specified parent content\n * - `existing_page`: page will be copied and replace the specified page\n *\n * By default, the following objects are expanded: `space`, `history`, `version`.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the\n * content will be copied in and permission to update the content if copying to an `existing_page`.\n */\n async copyPage<T = unknown>(parameters: Parameters.CopyPage, callback?: never): Promise<T>;\n async copyPage<T = unknown>(parameters: Parameters.CopyPage, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/copy`,\n method: 'POST',\n params: {\n expand: parameters.expand,\n },\n data: parameters.bodyParameters,\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,6BAA6B,CAAA;AACpB,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AAkDrC,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,MAAA,CAAQ;AAC1C,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,aAAa,EAAE,UAAU,CAAC,aAAa;gBACvC,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB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Q,CAAC;IAClD;AAkCA,IAAA,MAAM,QAAQ,CAAc,UAA+B,EAAE,QAAsB,EAAA;AACjF,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,KAAA,CAAO;AACzC,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;YACD,IAAI,EAAE,UAAU,CAAC,cAAc;SAChC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentComments.cjs","sources":["../../../../src/api/contentComments.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentComments {\n constructor(private client: Client) {}\n\n /**\n * Returns the comments on a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentComments<T = Models.ContentArray>(\n parameters: Parameters.GetContentComments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the comments on a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n */\n async getContentComments<T = Models.ContentArray>(\n parameters: Parameters.GetContentComments,\n callback?: never,\n ): Promise<T>;\n async getContentComments<T = Models.ContentArray>(\n parameters: Parameters.GetContentComments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/comment`,\n method: 'GET',\n params: {\n parentVersion: parameters.parentVersion,\n start: parameters.start,\n limit: parameters.limit,\n location: parameters.location,\n depth: parameters.depth,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"contentComments.cjs","sources":["../../../../src/api/contentComments.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\n/** @deprecated Will be removed in next major version. */\nexport class ContentComments {\n constructor(private client: Client) {}\n\n /**\n * Returns the comments on a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentComments<T = Models.ContentArray>(\n parameters: Parameters.GetContentComments,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the comments on a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getContentComments<T = Models.ContentArray>(\n parameters: Parameters.GetContentComments,\n callback?: never,\n ): Promise<T>;\n async getContentComments<T = Models.ContentArray>(\n parameters: Parameters.GetContentComments,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/child/comment`,\n method: 'GET',\n params: {\n parentVersion: parameters.parentVersion,\n start: parameters.start,\n limit: parameters.limit,\n location: parameters.location,\n depth: parameters.depth,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;AAMA;MACa,eAAe,CAAA;AACN,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AA0BrC,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,cAAA,CAAgB;AAClD,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,aAAa,EAAE,UAAU,CAAC,aAAa;gBACvC,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentLabels.cjs","sources":["../../../../src/api/contentLabels.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type {
|
|
1
|
+
{"version":3,"file":"contentLabels.cjs","sources":["../../../../src/api/contentLabels.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentLabels {\n constructor(private client: Client) {}\n\n /**\n * Returns the labels on a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getLabelsForContent<T = Models.LabelArray>(\n parameters: Parameters.GetLabelsForContent,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the labels on a piece of content.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space and\n * permission to view the content if it is a page.\n *\n * @deprecated Will be removed in next major version.\n */\n async getLabelsForContent<T = Models.LabelArray>(\n parameters: Parameters.GetLabelsForContent,\n callback?: never,\n ): Promise<T>;\n async getLabelsForContent<T = Models.LabelArray>(\n parameters: Parameters.GetLabelsForContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/label`,\n method: 'GET',\n params: {\n prefix: parameters.prefix,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Adds labels to a piece of content. Does not modify the existing labels.\n *\n * Notes:\n *\n * - Labels can also be added when creating content ([Create content](#api-content-post)).\n * - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing\n * labels and replace them with the labels in the request.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async addLabelsToContent<T = Models.LabelArray>(\n parameters: Parameters.AddLabelsToContent,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Adds labels to a piece of content. Does not modify the existing labels.\n *\n * Notes:\n *\n * - Labels can also be added when creating content ([Create content](#api-content-post)).\n * - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing\n * labels and replace them with the labels in the request.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async addLabelsToContent<T = Models.LabelArray>(\n parameters: Parameters.AddLabelsToContent,\n callback?: never,\n ): Promise<T>;\n async addLabelsToContent<T = Models.LabelArray>(\n parameters: Parameters.AddLabelsToContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/label`,\n method: 'POST',\n params: {\n 'use-400-error-response': parameters['use-400-error-response'],\n },\n data: parameters.body,\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to [Remove\n * label from content](#api-content-id-label-label-delete) except that the label name is specified via a query\n * parameter.\n *\n * Use this method if the label name has \"/\" characters, as [Remove label from content using query\n * parameter](#api-content-id-label-delete) does not accept \"/\" characters for the label name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async removeLabelFromContentUsingQueryParameter<T = void>(\n parameters: Parameters.RemoveLabelFromContentUsingQueryParameter,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to [Remove\n * label from content](#api-content-id-label-label-delete) except that the label name is specified via a query\n * parameter.\n *\n * Use this method if the label name has \"/\" characters, as [Remove label from content using query\n * parameter](#api-content-id-label-delete) does not accept \"/\" characters for the label name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async removeLabelFromContentUsingQueryParameter<T = void>(\n parameters: Parameters.RemoveLabelFromContentUsingQueryParameter,\n callback?: never,\n ): Promise<T>;\n async removeLabelFromContentUsingQueryParameter<T = void>(\n parameters: Parameters.RemoveLabelFromContentUsingQueryParameter,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/label`,\n method: 'DELETE',\n params: {\n name: parameters.name,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to [Remove\n * label from content using query parameter](#api-content-id-label-delete) except that the label name is specified via\n * a path parameter.\n *\n * Use this method if the label name does not have \"/\" characters, as the path parameter does not accept \"/\"\n * characters for security reasons. Otherwise, use [Remove label from content using query\n * parameter](#api-content-id-label-delete).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async removeLabelFromContent<T = void>(\n parameters: Parameters.RemoveLabelFromContent,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to [Remove\n * label from content using query parameter](#api-content-id-label-delete) except that the label name is specified via\n * a path parameter.\n *\n * Use this method if the label name does not have \"/\" characters, as the path parameter does not accept \"/\"\n * characters for security reasons. Otherwise, use [Remove label from content using query\n * parameter](#api-content-id-label-delete).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.\n */\n async removeLabelFromContent<T = void>(parameters: Parameters.RemoveLabelFromContent, callback?: never): Promise<T>;\n async removeLabelFromContent<T = void>(\n parameters: Parameters.RemoveLabelFromContent,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/label/${parameters.label}`,\n method: 'DELETE',\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,aAAa,CAAA;AACJ,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AA0BrC,IAAA,MAAM,mBAAmB,CACvB,UAA0C,EAC1C,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,MAAA,CAAQ;AAC1C,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,KAAK,EAAE,UAAU,CAAC,KAAK;AACxB,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAgCA,IAAA,MAAM,kBAAkB,CACtB,UAAyC,EACzC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,MAAA,CAAQ;AAC1C,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,MAAM,EAAE;AACN,gBAAA,wBAAwB,EAAE,UAAU,CAAC,wBAAwB,CAAC;AAC/D,aAAA;YACD,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AA8BA,IAAA,MAAM,yCAAyC,CAC7C,UAAgE,EAChE,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,MAAA,CAAQ;AAC1C,YAAA,MAAM,EAAE,QAAQ;AAChB,YAAA,MAAM,EAAE;gBACN,IAAI,EAAE,UAAU,CAAC,IAAI;AACtB,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AA6BA,IAAA,MAAM,sBAAsB,CAC1B,UAA6C,EAC7C,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;YAC5B,GAAG,EAAE,gBAAgB,UAAU,CAAC,EAAE,CAAA,OAAA,EAAU,UAAU,CAAC,KAAK,CAAA,CAAE;AAC9D,YAAA,MAAM,EAAE,QAAQ;SACjB;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentMacroBody.cjs","sources":["../../../../src/api/contentMacroBody.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentMacroBody {\n constructor(private client: Client) {}\n\n /**\n * Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of\n * the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getMacroBodyByMacroId<T = Models.MacroInstance>(\n parameters: Parameters.GetMacroBodyByMacroId,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of\n * the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getMacroBodyByMacroId<T = Models.MacroInstance>(\n parameters: Parameters.GetMacroBodyByMacroId,\n callback?: never,\n ): Promise<T>;\n async getMacroBodyByMacroId<T = Models.MacroInstance>(\n parameters: Parameters.GetMacroBodyByMacroId,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the body of a macro in format specified in path, for the given macro ID. This includes information like the\n * name of the macro, the body of the macro, and any macro parameters.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(\n parameters: Parameters.GetAndConvertMacroBodyByMacroId,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the body of a macro in format specified in path, for the given macro ID. This includes information like the\n * name of the macro, the body of the macro, and any macro parameters.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(\n parameters: Parameters.GetAndConvertMacroBodyByMacroId,\n callback?: never,\n ): Promise<T>;\n async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(\n parameters: Parameters.GetAndConvertMacroBodyByMacroId,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}/convert/${parameters.to}`,\n method: 'GET',\n params: {\n spaceKeyContext: parameters.spaceKeyContext,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns Async Id of the conversion task which will convert the macro into a content body of the desired format. The\n * result will be available for 5 minutes after completion of the conversion.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only\n * modified by Confluence if there are conflicting IDs.\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(\n parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns Async Id of the conversion task which will convert the macro into a content body of the desired format. The\n * result will be available for 5 minutes after completion of the conversion.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only\n * modified by Confluence if there are conflicting IDs.\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(\n parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,\n callback?: never,\n ): Promise<T>;\n async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(\n parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}/convert/async/${parameters.to}`,\n method: 'GET',\n params: {\n allowCache: parameters.allowCache,\n spaceKeyContext: parameters.spaceKeyContext,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,gBAAgB,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AAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,UAAU,EAAE,UAAU,CAAC,UAAU;gBACjC,eAAe,EAAE,UAAU,CAAC,eAAe;gBAC3C,qBAAqB,EAAE,UAAU,CAAC,qBAAqB;gBACvD,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAEnD;;;;"}
|
|
1
|
+
{"version":3,"file":"contentMacroBody.cjs","sources":["../../../../src/api/contentMacroBody.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentMacroBody {\n constructor(private client: Client) {}\n\n /**\n * Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of\n * the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * For Forge macros, the value for macro ID is the \"local ID\" of that particular ADF node. This value can be retrieved\n * either client-side by calling view.getContext() and accessing \"localId\" on the resulting object, or server-side by\n * examining the \"local-id\" parameter node inside the \"parameters\" node.\n *\n * Note that there are other attributes named \"local-id\", but only this particular one is used to store the macro ID.\n *\n * Example: <ac:adf-node type=\"extension\"> <ac:adf-attribute\n * key=\"extension-type\">com.atlassian.ecosystem</ac:adf-attribute> <ac:adf-attribute key=\"parameters\">\n * <ac:adf-parameter key=\"local-id\">e9c4aa10-73fa-417c-888d-48c719ae4165</ac:adf-parameter> </ac:adf-parameter>\n * </ac:adf-node>\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * This backwards compatibility logic does not apply to Forge macros; those can only be retrieved by their ID.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getMacroBodyByMacroId<T = Models.MacroInstance>(\n parameters: Parameters.GetMacroBodyByMacroId,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the body of a macro in storage format, for the given macro ID. This includes information like the name of\n * the macro, the body of the macro, and any macro parameters. This method is mainly used by Cloud apps.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * For Forge macros, the value for macro ID is the \"local ID\" of that particular ADF node. This value can be retrieved\n * either client-side by calling view.getContext() and accessing \"localId\" on the resulting object, or server-side by\n * examining the \"local-id\" parameter node inside the \"parameters\" node.\n *\n * Note that there are other attributes named \"local-id\", but only this particular one is used to store the macro ID.\n *\n * Example: <ac:adf-node type=\"extension\"> <ac:adf-attribute\n * key=\"extension-type\">com.atlassian.ecosystem</ac:adf-attribute> <ac:adf-attribute key=\"parameters\">\n * <ac:adf-parameter key=\"local-id\">e9c4aa10-73fa-417c-888d-48c719ae4165</ac:adf-parameter> </ac:adf-parameter>\n * </ac:adf-node>\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * This backwards compatibility logic does not apply to Forge macros; those can only be retrieved by their ID.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getMacroBodyByMacroId<T = Models.MacroInstance>(\n parameters: Parameters.GetMacroBodyByMacroId,\n callback?: never,\n ): Promise<T>;\n async getMacroBodyByMacroId<T = Models.MacroInstance>(\n parameters: Parameters.GetMacroBodyByMacroId,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the body of a macro in format specified in path, for the given macro ID. This includes information like the\n * name of the macro, the body of the macro, and any macro parameters.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * For Forge macros, the value for macro ID is the \"local ID\" of that particular ADF node. This value can be retrieved\n * either client-side by calling view.getContext() and accessing \"localId\" on the resulting object, or server-side by\n * examining the \"local-id\" parameter node inside the \"parameters\" node.\n *\n * Note that there are other attributes named \"local-id\", but only this particular one is used to store the macro ID.\n *\n * Example: <ac:adf-node type=\"extension\"> <ac:adf-attribute\n * key=\"extension-type\">com.atlassian.ecosystem</ac:adf-attribute> <ac:adf-attribute key=\"parameters\">\n * <ac:adf-parameter key=\"local-id\">e9c4aa10-73fa-417c-888d-48c719ae4165</ac:adf-parameter> </ac:adf-parameter>\n * </ac:adf-node>\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * This backwards compatibility logic does not apply to Forge macros; those can only be retrieved by their ID.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(\n parameters: Parameters.GetAndConvertMacroBodyByMacroId,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the body of a macro in format specified in path, for the given macro ID. This includes information like the\n * name of the macro, the body of the macro, and any macro parameters.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is\n * only modified by Confluence if there are conflicting IDs.\n *\n * For Forge macros, the value for macro ID is the \"local ID\" of that particular ADF node. This value can be retrieved\n * either client-side by calling view.getContext() and accessing \"localId\" on the resulting object, or server-side by\n * examining the \"local-id\" parameter node inside the \"parameters\" node.\n *\n * Note that there are other attributes named \"local-id\", but only this particular one is used to store the macro ID.\n *\n * Example: <ac:adf-node type=\"extension\"> <ac:adf-attribute\n * key=\"extension-type\">com.atlassian.ecosystem</ac:adf-attribute> <ac:adf-attribute key=\"parameters\">\n * <ac:adf-parameter key=\"local-id\">e9c4aa10-73fa-417c-888d-48c719ae4165</ac:adf-parameter> </ac:adf-parameter>\n * </ac:adf-node>\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * This backwards compatibility logic does not apply to Forge macros; those can only be retrieved by their ID.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(\n parameters: Parameters.GetAndConvertMacroBodyByMacroId,\n callback?: never,\n ): Promise<T>;\n async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(\n parameters: Parameters.GetAndConvertMacroBodyByMacroId,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}/convert/${parameters.to}`,\n method: 'GET',\n params: {\n spaceKeyContext: parameters.spaceKeyContext,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns Async Id of the conversion task which will convert the macro into a content body of the desired format. The\n * result will be available for 5 minutes after completion of the conversion.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only\n * modified by Confluence if there are conflicting IDs.\n *\n * For Forge macros, the value for macro ID is the \"local ID\" of that particular ADF node. This value can be retrieved\n * either client-side by calling view.getContext() and accessing \"localId\" on the resulting object, or server-side by\n * examining the \"local-id\" parameter node inside the \"parameters\" node.\n *\n * Note that there are other attributes named \"local-id\", but only this particular one is used to store the macro ID.\n *\n * Example: <ac:adf-node type=\"extension\"> <ac:adf-attribute\n * key=\"extension-type\">com.atlassian.ecosystem</ac:adf-attribute> <ac:adf-attribute key=\"parameters\">\n * <ac:adf-parameter key=\"local-id\">e9c4aa10-73fa-417c-888d-48c719ae4165</ac:adf-parameter> </ac:adf-parameter>\n * </ac:adf-node>\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * This backwards compatibility logic does not apply to Forge macros; those can only be retrieved by their ID.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(\n parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns Async Id of the conversion task which will convert the macro into a content body of the desired format. The\n * result will be available for 5 minutes after completion of the conversion.\n *\n * About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for\n * it, unless an ID is specified (by an app). The macro ID will look similar to this:\n * '884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only\n * modified by Confluence if there are conflicting IDs.\n *\n * For Forge macros, the value for macro ID is the \"local ID\" of that particular ADF node. This value can be retrieved\n * either client-side by calling view.getContext() and accessing \"localId\" on the resulting object, or server-side by\n * examining the \"local-id\" parameter node inside the \"parameters\" node.\n *\n * Note that there are other attributes named \"local-id\", but only this particular one is used to store the macro ID.\n *\n * Example: <ac:adf-node type=\"extension\"> <ac:adf-attribute\n * key=\"extension-type\">com.atlassian.ecosystem</ac:adf-attribute> <ac:adf-attribute key=\"parameters\">\n * <ac:adf-parameter key=\"local-id\">e9c4aa10-73fa-417c-888d-48c719ae4165</ac:adf-parameter> </ac:adf-parameter>\n * </ac:adf-node>\n *\n * Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a\n * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and\n * transparently propagate out to all instances.\n *\n * This backwards compatibility logic does not apply to Forge macros; those can only be retrieved by their ID.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the\n * macro is in.\n */\n async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(\n parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,\n callback?: never,\n ): Promise<T>;\n async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(\n parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}/convert/async/${parameters.to}`,\n method: 'GET',\n params: {\n allowCache: parameters.allowCache,\n spaceKeyContext: parameters.spaceKeyContext,\n embeddedContentRender: parameters.embeddedContentRender,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,gBAAgB,CAAA;AACP,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AAoErC,IAAA,MAAM,qBAAqB,CACzB,UAA4C,EAC5C,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,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A;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentPermissions.cjs","sources":["../../../../src/api/contentPermissions.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type {
|
|
1
|
+
{"version":3,"file":"contentPermissions.cjs","sources":["../../../../src/api/contentPermissions.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class ContentPermissions {\n constructor(private client: Client) {}\n\n /**\n * Check if a user or a group can perform an operation to the specified content. The `operation` to check must be\n * provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions\n * against a specified user or group. The following permission checks are done to make sure that the user or group has\n * the proper access:\n *\n * - Site permissions\n * - Space permissions\n * - Content restrictions\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global\n * permission is required.\n */\n async checkContentPermission<T = Models.PermissionCheckResponse>(\n parameters: Parameters.CheckContentPermission,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Check if a user or a group can perform an operation to the specified content. The `operation` to check must be\n * provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions\n * against a specified user or group. The following permission checks are done to make sure that the user or group has\n * the proper access:\n *\n * - Site permissions\n * - Space permissions\n * - Content restrictions\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global\n * permission is required.\n */\n async checkContentPermission<T = Models.PermissionCheckResponse>(\n parameters: Parameters.CheckContentPermission,\n callback?: never,\n ): Promise<T>;\n async checkContentPermission<T = Models.PermissionCheckResponse>(\n parameters: Parameters.CheckContentPermission,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/content/${parameters.id}/permission/check`,\n method: 'POST',\n data: {\n subject: parameters.subject,\n operation: parameters.operation,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,kBAAkB,CAAA;AACT,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AAsCrC,IAAA,MAAM,sBAAsB,CAC1B,UAA6C,EAC7C,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,aAAA,EAAgB,UAAU,CAAC,EAAE,CAAA,iBAAA,CAAmB;AACrD,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,IAAI,EAAE;gBACJ,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,SAAS,EAAE,UAAU,CAAC,SAAS;AAChC,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|