confluence.js 2.0.0-dev20250512202536 → 2.1.0
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 +52 -2
- package/README.md +145 -183
- 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.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 +3 -1
- 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.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 +3 -1
- 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/confluenceClient.d.ts +6 -1
- package/eslint.config.ts +11 -16
- package/package.json +29 -28
- 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 +1 -5
- package/src/clients/confluenceClient.ts +6 -0
- package/src/config.ts +4 -1
- package/src/services/authenticationService/authentications/createJWTAuthentication.ts +1 -1
- package/favicon.svg +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.mjs","sources":["../../../../src/api/users.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 Users {\n constructor(private client: Client) {}\n\n /**\n * Returns a user. This includes information about the user, such as the display name, account ID, profile picture,\n * and more. The information returned may be restricted by the user's profile visibility settings.\n *\n * **Note:** to add, edit, or delete users in your organization, see the [user management REST\n * API](/cloud/admin/user-management/about/).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUser<T = Models.User>(parameters: Parameters.GetUser, callback: Callback<T>): Promise<void>;\n /**\n * Returns a user. This includes information about the user, such as the display name, account ID, profile picture,\n * and more. The information returned may be restricted by the user's profile visibility settings.\n *\n * **Note:** to add, edit, or delete users in your organization, see the [user management REST\n * API](/cloud/admin/user-management/about/).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUser<T = Models.User>(parameters: Parameters.GetUser, callback?: never): Promise<T>;\n async getUser<T = Models.User>(parameters: Parameters.GetUser, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user',\n method: 'GET',\n params: {\n key: parameters.key,\n username: parameters.username,\n accountId: parameters.accountId,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns information about how anonymous users are represented, like the profile picture and display name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getAnonymousUser<T = Models.UserAnonymous>(\n parameters: Parameters.GetAnonymousUser | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns information about how anonymous users are represented, like the profile picture and display name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getAnonymousUser<T = Models.UserAnonymous>(\n parameters?: Parameters.GetAnonymousUser,\n callback?: never,\n ): Promise<T>;\n async getAnonymousUser<T = Models.UserAnonymous>(\n parameters?: Parameters.GetAnonymousUser,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/anonymous',\n method: 'GET',\n params: {\n expand: parameters?.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the currently logged-in user. This includes information about the user, like the display name, userKey,\n * account ID, profile picture, and more.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getCurrentUser<T = Models.User>(\n parameters: Parameters.GetCurrentUser | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the currently logged-in user. This includes information about the user, like the display name, userKey,\n * account ID, profile picture, and more.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getCurrentUser<T = Models.User>(parameters?: Parameters.GetCurrentUser, callback?: never): Promise<T>;\n async getCurrentUser<T = Models.User>(\n parameters?: Parameters.GetCurrentUser,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/current',\n method: 'GET',\n params: {\n expand: parameters?.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the groups that a user is a member of.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getGroupMembershipsForUser<T = Models.GroupArrayWithLinks>(\n parameters: Parameters.GetGroupMembershipsForUser,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the groups that a user is a member of.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getGroupMembershipsForUser<T = Models.GroupArrayWithLinks>(\n parameters: Parameters.GetGroupMembershipsForUser,\n callback?: never,\n ): Promise<T>;\n async getGroupMembershipsForUser<T = Models.GroupArrayWithLinks>(\n parameters: Parameters.GetGroupMembershipsForUser,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/memberof',\n method: 'GET',\n params: {\n key: parameters.key,\n username: parameters.username,\n accountId: parameters.accountId,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns user details for the ids provided in request.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getBulkUserLookup<T = Models.BulkUserLookupArray>(\n parameters: Parameters.GetBulkUserLookup,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns user details for the ids provided in request.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getBulkUserLookup<T = Models.BulkUserLookupArray>(\n parameters: Parameters.GetBulkUserLookup,\n callback?: never,\n ): Promise<T>;\n async getBulkUserLookup<T = Models.BulkUserLookupArray>(\n parameters: Parameters.GetBulkUserLookup,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/bulk',\n method: 'GET',\n params: {\n accountId: parameters.accountId,\n expand: parameters.expand,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmail<T = Models.AccountIdEmailRecord>(\n parameters: Parameters.GetPrivacyUnsafeUserEmail,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmail<T = Models.AccountIdEmailRecord>(\n parameters: Parameters.GetPrivacyUnsafeUserEmail,\n callback?: never,\n ): Promise<T>;\n async getPrivacyUnsafeUserEmail<T = Models.AccountIdEmailRecord>(\n parameters: Parameters.GetPrivacyUnsafeUserEmail,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/email',\n method: 'GET',\n params: {\n accountId: parameters.accountId,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns user email addresses for a set of accountIds. This API is only available to apps approved by Atlassian,\n * according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n *\n * Any accounts which are not available will not be included in the result.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmailBulk<T = Models.AccountIdEmailRecordArray>(\n parameters: Parameters.GetPrivacyUnsafeUserEmailBulk,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns user email addresses for a set of accountIds. This API is only available to apps approved by Atlassian,\n * according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n *\n * Any accounts which are not available will not be included in the result.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmailBulk<T = Models.AccountIdEmailRecordArray>(\n parameters: Parameters.GetPrivacyUnsafeUserEmailBulk,\n callback?: never,\n ): Promise<T>;\n async getPrivacyUnsafeUserEmailBulk<T = Models.AccountIdEmailRecordArray>(\n parameters: Parameters.GetPrivacyUnsafeUserEmailBulk,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/email/bulk',\n method: 'GET',\n params: {\n accountId: parameters.accountId,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the accountIds for the users specified in the key or username parameters. Note that multiple key and\n * username parameters can be specified.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission\n * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).\n */\n async getBulkUserMigration<T = Models.MigratedUserArray>(\n parameters: Parameters.GetBulkUserMigration,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the accountIds for the users specified in the key or username parameters. Note that multiple key and\n * username parameters can be specified.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission\n * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).\n */\n async getBulkUserMigration<T = Models.MigratedUserArray>(\n parameters: Parameters.GetBulkUserMigration,\n callback?: never,\n ): Promise<T>;\n async getBulkUserMigration<T = Models.MigratedUserArray>(\n parameters: Parameters.GetBulkUserMigration,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/bulk/migration',\n method: 'GET',\n params: {\n key: parameters.key,\n username: parameters.username,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":"MAMa,KAAK,CAAA;AACI,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;AAwB1B,IAAA,MAAM,OAAO,CAAkB,UAA8B,EAAE,QAAsB,EAAA;AACnF,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,WAAW;AAChB,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,GAAG,EAAE,UAAU,CAAC,GAAG;gBACnB,QAAQ,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EAAE,UAAU,CAAC,GAAG;gBACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,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;;AAEnD;;;;"}
|
|
1
|
+
{"version":3,"file":"users.mjs","sources":["../../../../src/api/users.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 Users {\n constructor(private client: Client) {}\n\n /**\n * Returns a user. This includes information about the user, such as the display name, account ID, profile picture,\n * and more. The information returned may be restricted by the user's profile visibility settings.\n *\n * **Note:** to add, edit, or delete users in your organization, see the [user management REST\n * API](/cloud/admin/user-management/about/).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUser<T = Models.User>(parameters: Parameters.GetUser, callback: Callback<T>): Promise<void>;\n /**\n * Returns a user. This includes information about the user, such as the display name, account ID, profile picture,\n * and more. The information returned may be restricted by the user's profile visibility settings.\n *\n * **Note:** to add, edit, or delete users in your organization, see the [user management REST\n * API](/cloud/admin/user-management/about/).\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUser<T = Models.User>(parameters: Parameters.GetUser, callback?: never): Promise<T>;\n async getUser<T = Models.User>(parameters: Parameters.GetUser, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user',\n method: 'GET',\n params: {\n key: parameters.key,\n username: parameters.username,\n accountId: parameters.accountId,\n expand: parameters.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns information about how anonymous users are represented, like the profile picture and display name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getAnonymousUser<T = Models.UserAnonymous>(\n parameters: Parameters.GetAnonymousUser | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns information about how anonymous users are represented, like the profile picture and display name.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getAnonymousUser<T = Models.UserAnonymous>(\n parameters?: Parameters.GetAnonymousUser,\n callback?: never,\n ): Promise<T>;\n async getAnonymousUser<T = Models.UserAnonymous>(\n parameters?: Parameters.GetAnonymousUser,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/anonymous',\n method: 'GET',\n params: {\n expand: parameters?.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the currently logged-in user. This includes information about the user, like the display name, userKey,\n * account ID, profile picture, and more.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getCurrentUser<T = Models.User>(\n parameters: Parameters.GetCurrentUser | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the currently logged-in user. This includes information about the user, like the display name, userKey,\n * account ID, profile picture, and more.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getCurrentUser<T = Models.User>(parameters?: Parameters.GetCurrentUser, callback?: never): Promise<T>;\n async getCurrentUser<T = Models.User>(\n parameters?: Parameters.GetCurrentUser,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/current',\n method: 'GET',\n params: {\n expand: parameters?.expand,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the groups that a user is a member of.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getGroupMembershipsForUser<T = Models.GroupArrayWithLinks>(\n parameters: Parameters.GetGroupMembershipsForUser,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the groups that a user is a member of.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getGroupMembershipsForUser<T = Models.GroupArrayWithLinks>(\n parameters: Parameters.GetGroupMembershipsForUser,\n callback?: never,\n ): Promise<T>;\n async getGroupMembershipsForUser<T = Models.GroupArrayWithLinks>(\n parameters: Parameters.GetGroupMembershipsForUser,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/memberof',\n method: 'GET',\n params: {\n key: parameters.key,\n username: parameters.username,\n accountId: parameters.accountId,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns user details for the ids provided in the request. Currently this API returns a maximum of 100 results. If\n * more than 100 account ids are passed in, then the first 100 will be returned.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getBulkUserLookup<T = Models.BulkUserLookupArray>(\n parameters: Parameters.GetBulkUserLookup,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns user details for the ids provided in the request. Currently this API returns a maximum of 100 results. If\n * more than 100 account ids are passed in, then the first 100 will be returned.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getBulkUserLookup<T = Models.BulkUserLookupArray>(\n parameters: Parameters.GetBulkUserLookup,\n callback?: never,\n ): Promise<T>;\n async getBulkUserLookup<T = Models.BulkUserLookupArray>(\n parameters: Parameters.GetBulkUserLookup,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/bulk',\n method: 'GET',\n params: {\n accountId: parameters.accountId,\n expand: parameters.expand,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is\n * only available to apps approved by Atlassian, according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n * For Forge apps, this API only supports access via asApp() requests.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmail<T = Models.AccountIdEmailRecord>(\n parameters: Parameters.GetPrivacyUnsafeUserEmail,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is\n * only available to apps approved by Atlassian, according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n * For Forge apps, this API only supports access via asApp() requests.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmail<T = Models.AccountIdEmailRecord>(\n parameters: Parameters.GetPrivacyUnsafeUserEmail,\n callback?: never,\n ): Promise<T>;\n async getPrivacyUnsafeUserEmail<T = Models.AccountIdEmailRecord>(\n parameters: Parameters.GetPrivacyUnsafeUserEmail,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/email',\n method: 'GET',\n params: {\n accountId: parameters.accountId,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is\n * only available to apps approved by Atlassian, according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n * For Forge apps, this API only supports access via asApp() requests.\n *\n * Any accounts which are not available will not be included in the result.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmailBulk<T = Models.AccountIdEmailRecordArray>(\n parameters: Parameters.GetPrivacyUnsafeUserEmailBulk,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is\n * only available to apps approved by Atlassian, according to these\n * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).\n * For Forge apps, this API only supports access via asApp() requests.\n *\n * Any accounts which are not available will not be included in the result.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getPrivacyUnsafeUserEmailBulk<T = Models.AccountIdEmailRecordArray>(\n parameters: Parameters.GetPrivacyUnsafeUserEmailBulk,\n callback?: never,\n ): Promise<T>;\n async getPrivacyUnsafeUserEmailBulk<T = Models.AccountIdEmailRecordArray>(\n parameters: Parameters.GetPrivacyUnsafeUserEmailBulk,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/email/bulk',\n method: 'GET',\n params: {\n accountId: parameters.accountId,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the accountIds for the users specified in the key or username parameters. Note that multiple key and\n * username parameters can be specified.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission\n * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).\n *\n * @deprecated Will be removed in next major version.\n */\n async getBulkUserMigration<T = Models.MigratedUserArray>(\n parameters: Parameters.GetBulkUserMigration,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the accountIds for the users specified in the key or username parameters. Note that multiple key and\n * username parameters can be specified.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission\n * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).\n *\n * @deprecated Will be removed in next major version.\n */\n async getBulkUserMigration<T = Models.MigratedUserArray>(\n parameters: Parameters.GetBulkUserMigration,\n callback?: never,\n ): Promise<T>;\n async getBulkUserMigration<T = Models.MigratedUserArray>(\n parameters: Parameters.GetBulkUserMigration,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/user/bulk/migration',\n method: 'GET',\n params: {\n key: parameters.key,\n username: parameters.username,\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":"MAMa,KAAK,CAAA;AACI,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AAwBrC,IAAA,MAAM,OAAO,CAAkB,UAA8B,EAAE,QAAsB,EAAA;AACnF,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,WAAW;AAChB,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,GAAG,EAAE,UAAU,CAAC,GAAG;gBACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC/B,MAAM,EAAE,UAAU,CAAC,MAAM;AAC1B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAsBA,IAAA,MAAM,gBAAgB,CACpB,UAAwC,EACxC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,qBAAqB;AAC1B,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,MAAM,EAAE,UAAU,EAAE,MAAM;AAC3B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAqBA,IAAA,MAAM,cAAc,CAClB,UAAsC,EACtC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,mBAAmB;A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E,UAAU,CAAC,SAAS;AAChC,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAgCA,IAAA,MAAM,6BAA6B,CACjC,UAAoD,EACpD,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,sBAAsB;AAC3B,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,SAAS,EAAE,UAAU,CAAC,SAAS;AAChC,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AA4BA,IAAA,MAAM,oBAAoB,CACxB,UAA2C,EAC3C,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,0BAA0B;AAC/B,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,GAAG,EAAE,UAAU,CAAC,GAAG;gBACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,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;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseClient.mjs","sources":["../../../../src/clients/baseClient.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unnecessary-condition */\nimport type { AxiosInstance } from 'axios';\nimport axios from 'axios';\nimport { getAuthenticationToken } from '~/services';\nimport type { Callback } from '~/callback';\nimport type { Client } from './client';\nimport {
|
|
1
|
+
{"version":3,"file":"baseClient.mjs","sources":["../../../../src/clients/baseClient.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unnecessary-condition */\nimport type { AxiosInstance } from 'axios';\nimport axios from 'axios';\nimport { getAuthenticationToken } from '~/services';\nimport type { Callback } from '~/callback';\nimport type { Client } from './client';\nimport { ConfigSchema, type Config, type Error as ConfluenceError } from '~/config';\nimport type { RequestConfig } from '~/requestConfig';\nimport { ZodError } from 'zod';\n\nconst ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token';\nconst ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check';\n\nexport class BaseClient implements Client {\n #instance: AxiosInstance | undefined;\n\n constructor(protected readonly config: Config) {\n this.config.apiPrefix = this.config.apiPrefix || '/wiki/rest/';\n\n try {\n this.config = ConfigSchema.parse(this.config);\n } catch (e) {\n if (e instanceof ZodError && e.errors[0].code === 'invalid_string') {\n throw new Error(e.errors[0].message);\n }\n\n throw e;\n }\n }\n\n protected paramSerializer(parameters: Record<string, any>): string {\n const parts: string[] = [];\n\n Object.entries(parameters).forEach(([key, value]) => {\n if (value === null || typeof value === 'undefined') {\n return;\n }\n\n if (Array.isArray(value)) {\n value = value.join(',');\n }\n\n if (value instanceof Date) {\n value = value.toISOString();\n } else if (value !== null && typeof value === 'object') {\n value = JSON.stringify(value);\n } else if (value instanceof Function) {\n const part = value();\n\n return part && parts.push(part);\n }\n\n parts.push(`${this.encode(key)}=${this.encode(value)}`);\n });\n\n return parts.join('&');\n }\n\n protected encode(value: string) {\n return encodeURIComponent(value)\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%20/g, '+')\n .replace(/%5B/gi, '[')\n .replace(/%5D/gi, ']');\n }\n\n protected removeUndefinedProperties(obj: Record<string, any>): Record<string, any> {\n return Object.entries(obj)\n .filter(([, value]) => typeof value !== 'undefined')\n .reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {});\n }\n\n private get instance() {\n if (this.#instance) {\n return this.#instance;\n }\n\n this.#instance = axios.create({\n paramsSerializer: this.paramSerializer.bind(this),\n ...this.config.baseRequestConfig,\n baseURL: `${this.config.host}${this.config.apiPrefix}`,\n headers: this.removeUndefinedProperties({\n [ATLASSIAN_TOKEN_CHECK_FLAG]: this.config.noCheckAtlassianToken\n ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE\n : undefined,\n ...this.config.baseRequestConfig?.headers,\n }),\n });\n\n return this.#instance;\n }\n\n async sendRequest<T>(requestConfig: RequestConfig, callback: never): Promise<T>;\n async sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T>): Promise<void>;\n async sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T> | never): Promise<void | T> {\n try {\n const modifiedRequestConfig = {\n ...requestConfig,\n headers: this.removeUndefinedProperties({\n Authorization: await getAuthenticationToken(this.config.authentication, {\n baseURL: this.config.host,\n url: this.instance.getUri(requestConfig),\n method: requestConfig.method!,\n }),\n ...requestConfig.headers,\n }),\n };\n\n const response = await this.instance.request<T>(modifiedRequestConfig);\n\n const callbackResponseHandler = callback && ((data: T): void => callback(null, data));\n const defaultResponseHandler = (data: T): T => data;\n\n const responseHandler = callbackResponseHandler ?? defaultResponseHandler;\n\n this.config.middlewares?.onResponse?.(response.data);\n\n return responseHandler(response.data);\n } catch (e: any) {\n const err = e.isAxiosError ? e.response.data : e;\n\n const callbackErrorHandler = callback && ((error: ConfluenceError) => callback(error));\n const defaultErrorHandler = (error: Error) => {\n throw error;\n };\n\n const errorHandler = callbackErrorHandler ?? defaultErrorHandler;\n\n this.config.middlewares?.onError?.(err);\n\n return errorHandler(err);\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAUA,MAAM,0BAA0B,GAAG,mBAAmB;AACtD,MAAM,mCAAmC,GAAG,UAAU;MAEzC,UAAU,CAAA;AAGU,IAAA,MAAA;AAF/B,IAAA,SAAS;AAET,IAAA,WAAA,CAA+B,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;AACnC,QAAA,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG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,OAAO,CAAM,EAAE;AACf,YAAA,MAAM,GAAG,GAAG,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC;AAEhD,YAAA,MAAM,oBAAoB,GAAG,QAAQ,KAAK,CAAC,KAAsB,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtF,YAAA,MAAM,mBAAmB,GAAG,CAAC,KAAY,KAAI;AAC3C,gBAAA,MAAM,KAAK;AACb,YAAA,CAAC;AAED,YAAA,MAAM,YAAY,GAAG,oBAAoB,IAAI,mBAAmB;YAEhE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,GAAG,GAAG,CAAC;AAEvC,YAAA,OAAO,YAAY,CAAC,GAAG,CAAC;QAC1B;IACF;AACD;;;;"}
|
|
@@ -30,6 +30,7 @@ import { SpaceSettings } from '../api/spaceSettings.mjs';
|
|
|
30
30
|
import { Template } from '../api/template.mjs';
|
|
31
31
|
import { Themes } from '../api/themes.mjs';
|
|
32
32
|
import { Users } from '../api/users.mjs';
|
|
33
|
+
import { UserProperties } from '../api/userProperties.mjs';
|
|
33
34
|
|
|
34
35
|
class ConfluenceClient extends BaseClient {
|
|
35
36
|
constructor(config) {
|
|
@@ -44,10 +45,12 @@ class ConfluenceClient extends BaseClient {
|
|
|
44
45
|
contentAttachments = new ContentAttachments(this);
|
|
45
46
|
contentBody = new ContentBody(this);
|
|
46
47
|
contentChildrenAndDescendants = new ContentChildrenAndDescendants(this);
|
|
48
|
+
/** @deprecated Will be removed in next major version. */
|
|
47
49
|
contentComments = new ContentComments(this);
|
|
48
50
|
contentLabels = new ContentLabels(this);
|
|
49
51
|
contentMacroBody = new ContentMacroBody(this);
|
|
50
52
|
contentPermissions = new ContentPermissions(this);
|
|
53
|
+
/** @deprecated Will be removed in next major version. */
|
|
51
54
|
contentProperties = new ContentProperties(this);
|
|
52
55
|
contentRestrictions = new ContentRestrictions(this);
|
|
53
56
|
contentStates = new ContentStates(this);
|
|
@@ -56,6 +59,7 @@ class ConfluenceClient extends BaseClient {
|
|
|
56
59
|
dynamicModules = new DynamicModules(this);
|
|
57
60
|
experimental = new Experimental(this);
|
|
58
61
|
group = new Group(this);
|
|
62
|
+
/** @deprecated Will be removed in next major version. */
|
|
59
63
|
inlineTasks = new InlineTasks(this);
|
|
60
64
|
labelInfo = new LabelInfo(this);
|
|
61
65
|
longRunningTask = new LongRunningTask(this);
|
|
@@ -64,11 +68,13 @@ class ConfluenceClient extends BaseClient {
|
|
|
64
68
|
settings = new Settings(this);
|
|
65
69
|
space = new Space(this);
|
|
66
70
|
spacePermissions = new SpacePermissions(this);
|
|
71
|
+
/** @deprecated Will be removed in next major version. */
|
|
67
72
|
spaceProperties = new SpaceProperties(this);
|
|
68
73
|
spaceSettings = new SpaceSettings(this);
|
|
69
74
|
template = new Template(this);
|
|
70
75
|
themes = new Themes(this);
|
|
71
76
|
users = new Users(this);
|
|
77
|
+
userProperties = new UserProperties(this);
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
export { ConfluenceClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confluenceClient.mjs","sources":["../../../../src/clients/confluenceClient.ts"],"sourcesContent":["import { BaseClient } from './baseClient';\nimport type { Config } from '../config';\nimport {\n Analytics,\n Audit,\n Content,\n ContentAttachments,\n ContentBody,\n ContentChildrenAndDescendants,\n ContentComments,\n ContentLabels,\n ContentMacroBody,\n ContentPermissions,\n ContentProperties,\n ContentRestrictions,\n ContentStates,\n ContentVersions,\n ContentWatches,\n DynamicModules,\n Experimental,\n Group,\n InlineTasks,\n LabelInfo,\n LongRunningTask,\n Relation,\n Search,\n Settings,\n Space,\n SpacePermissions,\n SpaceProperties,\n SpaceSettings,\n Template,\n Themes,\n Users,\n} from '../api';\n\nexport class ConfluenceClient extends BaseClient {\n constructor(config: Config) {\n super({\n ...config,\n apiPrefix: config.apiPrefix ?? '/wiki/rest',\n });\n }\n\n analytics = new Analytics(this);\n audit = new Audit(this);\n content = new Content(this);\n contentAttachments = new ContentAttachments(this);\n contentBody = new ContentBody(this);\n contentChildrenAndDescendants = new ContentChildrenAndDescendants(this);\n contentComments = new ContentComments(this);\n contentLabels = new ContentLabels(this);\n contentMacroBody = new ContentMacroBody(this);\n contentPermissions = new ContentPermissions(this);\n contentProperties = new ContentProperties(this);\n contentRestrictions = new ContentRestrictions(this);\n contentStates = new ContentStates(this);\n contentVersions = new ContentVersions(this);\n contentWatches = new ContentWatches(this);\n dynamicModules = new DynamicModules(this);\n experimental = new Experimental(this);\n group = new Group(this);\n inlineTasks = new InlineTasks(this);\n labelInfo = new LabelInfo(this);\n longRunningTask = new LongRunningTask(this);\n relation = new Relation(this);\n search = new Search(this);\n settings = new Settings(this);\n space = new Space(this);\n spacePermissions = new SpacePermissions(this);\n spaceProperties = new SpaceProperties(this);\n spaceSettings = new SpaceSettings(this);\n template = new Template(this);\n themes = new Themes(this);\n users = new Users(this);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confluenceClient.mjs","sources":["../../../../src/clients/confluenceClient.ts"],"sourcesContent":["import { BaseClient } from './baseClient';\nimport type { Config } from '../config';\nimport {\n Analytics,\n Audit,\n Content,\n ContentAttachments,\n ContentBody,\n ContentChildrenAndDescendants,\n ContentComments,\n ContentLabels,\n ContentMacroBody,\n ContentPermissions,\n ContentProperties,\n ContentRestrictions,\n ContentStates,\n ContentVersions,\n ContentWatches,\n DynamicModules,\n Experimental,\n Group,\n InlineTasks,\n LabelInfo,\n LongRunningTask,\n Relation,\n Search,\n Settings,\n Space,\n SpacePermissions,\n SpaceProperties,\n SpaceSettings,\n Template,\n Themes,\n Users,\n UserProperties,\n} from '../api';\n\nexport class ConfluenceClient extends BaseClient {\n constructor(config: Config) {\n super({\n ...config,\n apiPrefix: config.apiPrefix ?? '/wiki/rest',\n });\n }\n\n analytics = new Analytics(this);\n audit = new Audit(this);\n content = new Content(this);\n contentAttachments = new ContentAttachments(this);\n contentBody = new ContentBody(this);\n contentChildrenAndDescendants = new ContentChildrenAndDescendants(this);\n /** @deprecated Will be removed in next major version. */\n contentComments = new ContentComments(this);\n contentLabels = new ContentLabels(this);\n contentMacroBody = new ContentMacroBody(this);\n contentPermissions = new ContentPermissions(this);\n /** @deprecated Will be removed in next major version. */\n contentProperties = new ContentProperties(this);\n contentRestrictions = new ContentRestrictions(this);\n contentStates = new ContentStates(this);\n contentVersions = new ContentVersions(this);\n contentWatches = new ContentWatches(this);\n dynamicModules = new DynamicModules(this);\n experimental = new Experimental(this);\n group = new Group(this);\n /** @deprecated Will be removed in next major version. */\n inlineTasks = new InlineTasks(this);\n labelInfo = new LabelInfo(this);\n longRunningTask = new LongRunningTask(this);\n relation = new Relation(this);\n search = new Search(this);\n settings = new Settings(this);\n space = new Space(this);\n spacePermissions = new SpacePermissions(this);\n /** @deprecated Will be removed in next major version. */\n spaceProperties = new SpaceProperties(this);\n spaceSettings = new SpaceSettings(this);\n template = new Template(this);\n themes = new Themes(this);\n users = new Users(this);\n userProperties = new UserProperties(this);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCM,MAAO,gBAAiB,SAAQ,UAAU,CAAA;AAC9C,IAAA,WAAA,CAAY,MAAc,EAAA;AACxB,QAAA,KAAK,CAAC;AACJ,YAAA,GAAG,MAAM;AACT,YAAA,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,YAAY;AAC5C,SAAA,CAAC;IACJ;AAEA,IAAA,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC;AAC/B,IAAA,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AACvB,IAAA,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;AAC3B,IAAA,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC;AACjD,IAAA,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC;AACnC,IAAA,6BAA6B,GAAG,IAAI,6BAA6B,CAAC,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a,CAAC,IAAI,CAAC;AACvC,IAAA,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC;AAC7B,IAAA,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC;AACzB,IAAA,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AACvB,IAAA,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC;AAC1C;;;;"}
|
package/dist/esm/config.mjs
CHANGED
|
@@ -47,7 +47,9 @@ const MiddlewaresSchema = z.object({
|
|
|
47
47
|
onResponse: z.optional(z.function().args(z.any()).returns(z.void())),
|
|
48
48
|
});
|
|
49
49
|
const ConfigSchema = z.object({
|
|
50
|
-
host: z.string().url({
|
|
50
|
+
host: z.string().url({
|
|
51
|
+
message: 'Couldn\'t parse the host URL. Perhaps you forgot to add \'http://\' or \'https://\' at the beginning of the URL?',
|
|
52
|
+
}),
|
|
51
53
|
baseRequestConfig: z.optional(RequestConfigSchema),
|
|
52
54
|
authentication: z.optional(AuthenticationSchema),
|
|
53
55
|
middlewares: z.optional(MiddlewaresSchema),
|
package/dist/esm/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","sources":["../../../src/config.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { AxiosError } from 'axios';\n\n/**\n * Basic authentication configuration using email and API token\n *\n * @see {@link https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/} for how to create API tokens\n */\nexport const BasicSchema = z.strictObject({\n basic: z.strictObject({\n /** User's email associated with Atlassian account */\n email: z.string().email(),\n /**\n * API token generated from Atlassian account settings\n *\n * @see {@link https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/} for how to create API tokens\n */\n apiToken: z.string().min(1, 'API token is required'),\n }),\n});\n\n/** JWT authentication configuration */\nexport const JWTSchema = z.strictObject({\n jwt: z.strictObject({\n /** The key from the app descriptor */\n issuer: z.string(),\n /** The shared secret key from app installation */\n secret: z.string(),\n /** Token expiry time (default: 180) */\n expiryTimeSeconds: z.optional(z.number()),\n }),\n});\n\n/** OAuth2 authentication configuration */\nexport const OAuth2Schema = z.strictObject({\n oauth2: z.strictObject({\n /** OAuth2 access token */\n accessToken: z.string(),\n }),\n});\n\n/** Authentication configuration schema */\nexport const AuthenticationSchema = z.union([BasicSchema, JWTSchema, OAuth2Schema]);\n\n/** Base request configuration */\nexport const RequestConfigSchema = z.any();\n\n/** Middleware configuration schema */\nexport const MiddlewaresSchema = z.object({\n /** Error handler middleware */\n onError: z.optional(z.function().args(z.any()).returns(z.void())),\n /** Response handler middleware */\n onResponse: z.optional(z.function().args(z.any()).returns(z.void())),\n});\n\nexport const ConfigSchema = z.object({\n host: z.string().url({
|
|
1
|
+
{"version":3,"file":"config.mjs","sources":["../../../src/config.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { AxiosError } from 'axios';\n\n/**\n * Basic authentication configuration using email and API token\n *\n * @see {@link https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/} for how to create API tokens\n */\nexport const BasicSchema = z.strictObject({\n basic: z.strictObject({\n /** User's email associated with Atlassian account */\n email: z.string().email(),\n /**\n * API token generated from Atlassian account settings\n *\n * @see {@link https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/} for how to create API tokens\n */\n apiToken: z.string().min(1, 'API token is required'),\n }),\n});\n\n/** JWT authentication configuration */\nexport const JWTSchema = z.strictObject({\n jwt: z.strictObject({\n /** The key from the app descriptor */\n issuer: z.string(),\n /** The shared secret key from app installation */\n secret: z.string(),\n /** Token expiry time (default: 180) */\n expiryTimeSeconds: z.optional(z.number()),\n }),\n});\n\n/** OAuth2 authentication configuration */\nexport const OAuth2Schema = z.strictObject({\n oauth2: z.strictObject({\n /** OAuth2 access token */\n accessToken: z.string(),\n }),\n});\n\n/** Authentication configuration schema */\nexport const AuthenticationSchema = z.union([BasicSchema, JWTSchema, OAuth2Schema]);\n\n/** Base request configuration */\nexport const RequestConfigSchema = z.any();\n\n/** Middleware configuration schema */\nexport const MiddlewaresSchema = z.object({\n /** Error handler middleware */\n onError: z.optional(z.function().args(z.any()).returns(z.void())),\n /** Response handler middleware */\n onResponse: z.optional(z.function().args(z.any()).returns(z.void())),\n});\n\nexport const ConfigSchema = z.object({\n host: z.string().url({\n message:\n 'Couldn\\'t parse the host URL. Perhaps you forgot to add \\'http://\\' or \\'https://\\' at the beginning of the URL?',\n }),\n baseRequestConfig: z.optional(RequestConfigSchema),\n authentication: z.optional(AuthenticationSchema),\n middlewares: z.optional(MiddlewaresSchema),\n /** Adds `'X-Atlassian-Token': 'no-check'` to each request header */\n noCheckAtlassianToken: z.optional(z.boolean()),\n /** Prefix for all API routes. */\n apiPrefix: z.optional(z.string()),\n});\n\nexport type Config = z.infer<typeof ConfigSchema>;\nexport type Authentication = z.infer<typeof AuthenticationSchema>;\nexport type Basic = z.infer<typeof BasicSchema>;\nexport type JWT = z.infer<typeof JWTSchema>;\nexport type OAuth2 = z.infer<typeof OAuth2Schema>;\nexport type Error = AxiosError;\n"],"names":[],"mappings":";;AAGA;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,CAAC,YAAY,CAAC;AACxC,IAAA,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC;;AAEpB,QAAA,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;AACzB;;;;AAIG;QACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uBAAuB,CAAC;KACrD,CAAC;AACH,CAAA;AAED;AACO,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;AACtC,IAAA,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC;;AAElB,QAAA,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;;AAElB,QAAA,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;;QAElB,iBAAiB,EAAE,CAAC,CAAC,QAAQ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E,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAClC,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paramSerializer.mjs","sources":["../../../src/paramSerializer.ts"],"sourcesContent":["export function paramSerializer(key: string, values?: string | string[]) {\n if (typeof values === 'string') {\n return () => `${key}=${values}`;\n }\n\n if (!values) {\n return undefined;\n }\n\n if (!values.length) {\n return '';\n }\n\n return () => values.map(value => `${key}=${value}`).join('&');\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paramSerializer.mjs","sources":["../../../src/paramSerializer.ts"],"sourcesContent":["export function paramSerializer(key: string, values?: string | string[]) {\n if (typeof values === 'string') {\n return () => `${key}=${values}`;\n }\n\n if (!values) {\n return undefined;\n }\n\n if (!values.length) {\n return '';\n }\n\n return () => values.map(value => `${key}=${value}`).join('&');\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAAC,GAAW,EAAE,MAA0B,EAAA;AACrE,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,OAAO,MAAM,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI,MAAM,EAAE;IACjC;IAEA,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;AAClB,QAAA,OAAO,EAAE;IACX;IAEA,OAAO,MAAM,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,GAAG,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAC/D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationService.mjs","sources":["../../../../../src/services/authenticationService/authenticationService.ts"],"sourcesContent":["import type { Authentication } from '~/config';\nimport {\n createBasicAuthenticationToken,\n createJWTAuthentication,\n createOAuth2AuthenticationToken,\n} from './authentications';\n\nexport async function getAuthenticationToken(\n authentication: Authentication | undefined,\n requestData?: {\n baseURL: string;\n url: string;\n method: string;\n },\n): Promise<string | undefined> {\n if (!authentication) {\n return undefined;\n }\n\n if ('basic' in authentication) {\n return createBasicAuthenticationToken(authentication);\n }\n\n if ('oauth2' in authentication) {\n return createOAuth2AuthenticationToken(authentication);\n }\n\n if ('jwt' in authentication) {\n return createJWTAuthentication(authentication, requestData!);\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;;;AAOO,eAAe,sBAAsB,CAC1C,cAA0C,EAC1C,WAIC,EAAA;IAED,IAAI,CAAC,cAAc,EAAE;AACnB,QAAA,OAAO,SAAS
|
|
1
|
+
{"version":3,"file":"authenticationService.mjs","sources":["../../../../../src/services/authenticationService/authenticationService.ts"],"sourcesContent":["import type { Authentication } from '~/config';\nimport {\n createBasicAuthenticationToken,\n createJWTAuthentication,\n createOAuth2AuthenticationToken,\n} from './authentications';\n\nexport async function getAuthenticationToken(\n authentication: Authentication | undefined,\n requestData?: {\n baseURL: string;\n url: string;\n method: string;\n },\n): Promise<string | undefined> {\n if (!authentication) {\n return undefined;\n }\n\n if ('basic' in authentication) {\n return createBasicAuthenticationToken(authentication);\n }\n\n if ('oauth2' in authentication) {\n return createOAuth2AuthenticationToken(authentication);\n }\n\n if ('jwt' in authentication) {\n return createJWTAuthentication(authentication, requestData!);\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;;;AAOO,eAAe,sBAAsB,CAC1C,cAA0C,EAC1C,WAIC,EAAA;IAED,IAAI,CAAC,cAAc,EAAE;AACnB,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,IAAI,OAAO,IAAI,cAAc,EAAE;AAC7B,QAAA,OAAO,8BAA8B,CAAC,cAAc,CAAC;IACvD;AAEA,IAAA,IAAI,QAAQ,IAAI,cAAc,EAAE;AAC9B,QAAA,OAAO,+BAA+B,CAAC,cAAc,CAAC;IACxD;AAEA,IAAA,IAAI,KAAK,IAAI,cAAc,EAAE;AAC3B,QAAA,OAAO,uBAAuB,CAAC,cAAc,EAAE,WAAY,CAAC;IAC9D;AAEA,IAAA,OAAO,SAAS;AAClB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBasicAuthenticationToken.mjs","sources":["../../../../../../src/services/authenticationService/authentications/createBasicAuthenticationToken.ts"],"sourcesContent":["import { Base64Encoder } from '../base64Encoder';\nimport type { Basic } from '~';\n\nexport function createBasicAuthenticationToken({ basic: { email, apiToken } }: Basic) {\n const token = Base64Encoder.encode(`${email}:${apiToken}`);\n\n return `Basic ${token}`;\n}\n"],"names":[],"mappings":";;AAGM,SAAU,8BAA8B,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAS,EAAA;AAClF,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"createBasicAuthenticationToken.mjs","sources":["../../../../../../src/services/authenticationService/authentications/createBasicAuthenticationToken.ts"],"sourcesContent":["import { Base64Encoder } from '../base64Encoder';\nimport type { Basic } from '~';\n\nexport function createBasicAuthenticationToken({ basic: { email, apiToken } }: Basic) {\n const token = Base64Encoder.encode(`${email}:${apiToken}`);\n\n return `Basic ${token}`;\n}\n"],"names":[],"mappings":";;AAGM,SAAU,8BAA8B,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAS,EAAA;AAClF,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA,EAAG,KAAK,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAE,CAAC;IAE1D,OAAO,CAAA,MAAA,EAAS,KAAK,CAAA,CAAE;AACzB;;;;"}
|
package/dist/esm/services/authenticationService/authentications/createJWTAuthentication.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createJWTAuthentication.mjs","sources":["../../../../../../src/services/authenticationService/authentications/createJWTAuthentication.ts"],"sourcesContent":["import * as jwt from 'atlassian-jwt';\nimport type { JWT } from '~';\n\nexport function createJWTAuthentication(\n { jwt: { issuer, secret, expiryTimeSeconds } }: JWT,\n requestData: {\n method: string;\n url: string;\n },\n) {\n const { method, url } = requestData;\n\n const now = Math.floor(Date.now() / 1000);\n const expire = now + (expiryTimeSeconds ?? 180);\n\n const request = jwt.fromMethodAndUrl(method, url);\n const tokenData = {\n iss: issuer,\n qsh: jwt.createQueryStringHash(request),\n iat: now,\n exp: expire,\n };\n\n const token = jwt.encodeSymmetric(tokenData, secret);\n\n return `JWT ${token}`;\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"createJWTAuthentication.mjs","sources":["../../../../../../src/services/authenticationService/authentications/createJWTAuthentication.ts"],"sourcesContent":["import * as jwt from '@atlassian/atlassian-jwt';\nimport type { JWT } from '~';\n\nexport function createJWTAuthentication(\n { jwt: { issuer, secret, expiryTimeSeconds } }: JWT,\n requestData: {\n method: string;\n url: string;\n },\n) {\n const { method, url } = requestData;\n\n const now = Math.floor(Date.now() / 1000);\n const expire = now + (expiryTimeSeconds ?? 180);\n\n const request = jwt.fromMethodAndUrl(method, url);\n const tokenData = {\n iss: issuer,\n qsh: jwt.createQueryStringHash(request),\n iat: now,\n exp: expire,\n };\n\n const token = jwt.encodeSymmetric(tokenData, secret);\n\n return `JWT ${token}`;\n}\n"],"names":[],"mappings":";;AAGM,SAAU,uBAAuB,CACrC,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAO,EACnD,WAGC,EAAA;AAED,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,WAAW;AAEnC,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;IACzC,MAAM,MAAM,GAAG,GAAG,IAAI,iBAAiB,IAAI,GAAG,CAAC;IAE/C,MAAM,OAAO,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC;AACjD,IAAA,MAAM,SAAS,GAAG;AAChB,QAAA,GAAG,EAAE,MAAM;AACX,QAAA,GAAG,EAAE,GAAG,CAAC,qBAAqB,CAAC,OAAO,CAAC;AACvC,QAAA,GAAG,EAAE,GAAG;AACR,QAAA,GAAG,EAAE,MAAM;KACZ;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC;IAEpD,OAAO,CAAA,IAAA,EAAO,KAAK,CAAA,CAAE;AACvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64Encoder.mjs","sources":["../../../../../src/services/authenticationService/base64Encoder.ts"],"sourcesContent":["/* eslint-disable */\n/** @copyright The code was taken from the portal http://www.webtoolkit.info/javascript-base64.html */\n\nexport namespace Base64Encoder {\n const base64Sequence = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n const utf8Encode = (value: string) => {\n value = value.replace(/\\r\\n/g, '\\n');\n\n let utftext = '';\n\n for (let n = 0; n < value.length; n++) {\n const c = value.charCodeAt(n);\n\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if (c > 127 && c < 2048) {\n utftext += String.fromCharCode((c >> 6) | 192);\n\n utftext += String.fromCharCode((c & 63) | 128);\n } else {\n utftext += String.fromCharCode((c >> 12) | 224);\n\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\n utftext += String.fromCharCode((c & 63) | 128);\n }\n }\n\n return utftext;\n };\n\n export const encode = (input: string) => {\n let output = '';\n let chr1;\n let chr2;\n let chr3;\n let enc1;\n let enc2;\n let enc3;\n let enc4;\n let i = 0;\n\n input = utf8Encode(input);\n\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output += `${base64Sequence.charAt(enc1)}${base64Sequence.charAt(enc2)}${base64Sequence.charAt(\n enc3,\n )}${base64Sequence.charAt(enc4)}`;\n }\n\n return output;\n };\n}\n"],"names":[],"mappings":"AAAA;AACA;AAEM,IAAW;AAAjB,CAAA,UAAiB,aAAa,EAAA;IAC5B,MAAM,cAAc,GAAG,mEAAmE;AAE1F,IAAA,MAAM,UAAU,GAAG,CAAC,KAAa,KAAI;QACnC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;QAEpC,IAAI,OAAO,GAAG,EAAE;AAEhB,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAE7B,YAAA,IAAI,CAAC,GAAG,GAAG,EAAE;AACX,gBAAA,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"base64Encoder.mjs","sources":["../../../../../src/services/authenticationService/base64Encoder.ts"],"sourcesContent":["/* eslint-disable */\n/** @copyright The code was taken from the portal http://www.webtoolkit.info/javascript-base64.html */\n\nexport namespace Base64Encoder {\n const base64Sequence = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n const utf8Encode = (value: string) => {\n value = value.replace(/\\r\\n/g, '\\n');\n\n let utftext = '';\n\n for (let n = 0; n < value.length; n++) {\n const c = value.charCodeAt(n);\n\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if (c > 127 && c < 2048) {\n utftext += String.fromCharCode((c >> 6) | 192);\n\n utftext += String.fromCharCode((c & 63) | 128);\n } else {\n utftext += String.fromCharCode((c >> 12) | 224);\n\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\n utftext += String.fromCharCode((c & 63) | 128);\n }\n }\n\n return utftext;\n };\n\n export const encode = (input: string) => {\n let output = '';\n let chr1;\n let chr2;\n let chr3;\n let enc1;\n let enc2;\n let enc3;\n let enc4;\n let i = 0;\n\n input = utf8Encode(input);\n\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output += `${base64Sequence.charAt(enc1)}${base64Sequence.charAt(enc2)}${base64Sequence.charAt(\n enc3,\n )}${base64Sequence.charAt(enc4)}`;\n }\n\n return output;\n };\n}\n"],"names":[],"mappings":"AAAA;AACA;AAEM,IAAW;AAAjB,CAAA,UAAiB,aAAa,EAAA;IAC5B,MAAM,cAAc,GAAG,mEAAmE;AAE1F,IAAA,MAAM,UAAU,GAAG,CAAC,KAAa,KAAI;QACnC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;QAEpC,IAAI,OAAO,GAAG,EAAE;AAEhB,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAE7B,YAAA,IAAI,CAAC,GAAG,GAAG,EAAE;AACX,gBAAA,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;YACnC;iBAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,EA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,CAAC,CAAC;AACtC,YAAA,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;AACvC,YAAA,IAAI,GAAG,IAAI,GAAG,EAAE;AAEhB,YAAA,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;AACf,gBAAA,IAAI,GAAG,IAAI,GAAG,EAAE;YAClB;AAAO,iBAAA,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;gBACtB,IAAI,GAAG,EAAE;YACX;AAEA,YAAA,MAAM,IAAI,CAAA,EAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,EAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,EAAG,cAAc,CAAC,MAAM,CAC5F,IAAI,CACL,CAAA,EAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACnC;AAEA,QAAA,OAAO,MAAM;AACf,IAAA,CAAC;AACH,CAAC,EAjEgB,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as Models from "./models/index.js";
|
|
2
2
|
import type * as Parameters from "./parameters/index.js";
|
|
3
|
-
import type { Callback } from "../callback.js";
|
|
4
3
|
import type { Client } from "../clients/index.js";
|
|
4
|
+
import type { Callback } from "../callback.js";
|
|
5
5
|
export declare class Analytics {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as Models from "./models/index.js";
|
|
2
2
|
import type * as Parameters from "./parameters/index.js";
|
|
3
|
-
import type { Callback } from "../callback.js";
|
|
4
3
|
import type { Client } from "../clients/index.js";
|
|
4
|
+
import type { Callback } from "../callback.js";
|
|
5
5
|
export declare class Audit {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -68,14 +68,14 @@ export declare class Audit {
|
|
|
68
68
|
*/
|
|
69
69
|
getRetentionPeriod<T = Models.RetentionPeriod>(callback?: never): Promise<T>;
|
|
70
70
|
/**
|
|
71
|
-
* Sets the retention period for records in the audit log. The retention period can be set to a maximum of
|
|
71
|
+
* Sets the retention period for records in the audit log. The retention period can be set to a maximum of 1 year.
|
|
72
72
|
*
|
|
73
73
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
|
|
74
74
|
* permission.
|
|
75
75
|
*/
|
|
76
76
|
setRetentionPeriod<T = Models.RetentionPeriod>(parameters: Parameters.SetRetentionPeriod | undefined, callback: Callback<T>): Promise<void>;
|
|
77
77
|
/**
|
|
78
|
-
* Sets the retention period for records in the audit log. The retention period can be set to a maximum of
|
|
78
|
+
* Sets the retention period for records in the audit log. The retention period can be set to a maximum of 1 year.
|
|
79
79
|
*
|
|
80
80
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
|
|
81
81
|
* permission.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as Models from "./models/index.js";
|
|
2
2
|
import type * as Parameters from "./parameters/index.js";
|
|
3
|
-
import type { Callback } from "../callback.js";
|
|
4
3
|
import type { Client } from "../clients/index.js";
|
|
4
|
+
import type { Callback } from "../callback.js";
|
|
5
5
|
export declare class Content {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -12,6 +12,8 @@ export declare class Content {
|
|
|
12
12
|
*
|
|
13
13
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
|
|
14
14
|
* ('Can use' global permission). Only content that the user has permission to view will be returned.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Will be removed in next major version.
|
|
15
17
|
*/
|
|
16
18
|
getContent<T = Models.ContentArray>(parameters: Parameters.GetContent | undefined, callback: Callback<T>): Promise<void>;
|
|
17
19
|
/**
|
|
@@ -21,6 +23,8 @@ export declare class Content {
|
|
|
21
23
|
*
|
|
22
24
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
|
|
23
25
|
* ('Can use' global permission). Only content that the user has permission to view will be returned.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Will be removed in next major version.
|
|
24
28
|
*/
|
|
25
29
|
getContent<T = Models.ContentArray>(parameters?: Parameters.GetContent, callback?: never): Promise<T>;
|
|
26
30
|
/**
|
|
@@ -34,6 +38,8 @@ export declare class Content {
|
|
|
34
38
|
*
|
|
35
39
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the
|
|
36
40
|
* content will be created in, and permission to view the draft if publishing a draft.
|
|
41
|
+
*
|
|
42
|
+
* @deprecated Will be removed in next major version.
|
|
37
43
|
*/
|
|
38
44
|
createContent<T = Models.Content>(parameters: Parameters.CreateContent | undefined, callback: Callback<T>): Promise<void>;
|
|
39
45
|
/**
|
|
@@ -47,6 +53,8 @@ export declare class Content {
|
|
|
47
53
|
*
|
|
48
54
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add' permission for the space that the
|
|
49
55
|
* content will be created in, and permission to view the draft if publishing a draft.
|
|
56
|
+
*
|
|
57
|
+
* @deprecated Will be removed in next major version.
|
|
50
58
|
*/
|
|
51
59
|
createContent<T = Models.Content>(parameters?: Parameters.CreateContent, callback?: never): Promise<T>;
|
|
52
60
|
/**
|
|
@@ -119,12 +127,13 @@ export declare class Content {
|
|
|
119
127
|
*
|
|
120
128
|
* When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
|
|
121
129
|
* URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
|
|
122
|
-
* results returned in each call.
|
|
123
|
-
*
|
|
124
|
-
* https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
|
|
130
|
+
* results returned in each call.
|
|
125
131
|
*
|
|
126
132
|
* The response to this will have a `prev` URL similar to the `next` in the example response.
|
|
127
133
|
*
|
|
134
|
+
* If the expand query parameter is used with the `body.export_view` and/or `body.styled_view` properties, then the
|
|
135
|
+
* query limit parameter will be restricted to a maximum value of 25.
|
|
136
|
+
*
|
|
128
137
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
|
|
129
138
|
* ('Can use' global permission). Only content that the user has permission to view will be returned.
|
|
130
139
|
*/
|
|
@@ -135,12 +144,13 @@ export declare class Content {
|
|
|
135
144
|
*
|
|
136
145
|
* When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
|
|
137
146
|
* URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
|
|
138
|
-
* results returned in each call.
|
|
139
|
-
*
|
|
140
|
-
* https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
|
|
147
|
+
* results returned in each call.
|
|
141
148
|
*
|
|
142
149
|
* The response to this will have a `prev` URL similar to the `next` in the example response.
|
|
143
150
|
*
|
|
151
|
+
* If the expand query parameter is used with the `body.export_view` and/or `body.styled_view` properties, then the
|
|
152
|
+
* query limit parameter will be restricted to a maximum value of 25.
|
|
153
|
+
*
|
|
144
154
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
|
|
145
155
|
* ('Can use' global permission). Only content that the user has permission to view will be returned.
|
|
146
156
|
*/
|
|
@@ -152,6 +162,8 @@ export declare class Content {
|
|
|
152
162
|
*
|
|
153
163
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the
|
|
154
164
|
* content is a blog post, 'View' permission for the space is required.
|
|
165
|
+
*
|
|
166
|
+
* @deprecated Will be removed in next major version.
|
|
155
167
|
*/
|
|
156
168
|
getContentById<T = Models.Content>(parameters: Parameters.GetContentById, callback: Callback<T>): Promise<void>;
|
|
157
169
|
/**
|
|
@@ -161,6 +173,8 @@ export declare class Content {
|
|
|
161
173
|
*
|
|
162
174
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the
|
|
163
175
|
* content is a blog post, 'View' permission for the space is required.
|
|
176
|
+
*
|
|
177
|
+
* @deprecated Will be removed in next major version.
|
|
164
178
|
*/
|
|
165
179
|
getContentById<T = Models.Content>(parameters: Parameters.GetContentById, callback?: never): Promise<T>;
|
|
166
180
|
/**
|
|
@@ -170,6 +184,8 @@ export declare class Content {
|
|
|
170
184
|
* Note, updating draft content is currently not supported.
|
|
171
185
|
*
|
|
172
186
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
187
|
+
*
|
|
188
|
+
* @deprecated Will be removed in next major version.
|
|
173
189
|
*/
|
|
174
190
|
updateContent<T = Models.Content>(parameters: Parameters.UpdateContent, callback: Callback<T>): Promise<void>;
|
|
175
191
|
/**
|
|
@@ -179,6 +195,8 @@ export declare class Content {
|
|
|
179
195
|
* Note, updating draft content is currently not supported.
|
|
180
196
|
*
|
|
181
197
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
198
|
+
*
|
|
199
|
+
* @deprecated Will be removed in next major version.
|
|
182
200
|
*/
|
|
183
201
|
updateContent<T = Models.Content>(parameters: Parameters.UpdateContent, callback?: never): Promise<T>;
|
|
184
202
|
/**
|
|
@@ -193,6 +211,8 @@ export declare class Content {
|
|
|
193
211
|
*
|
|
194
212
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the
|
|
195
213
|
* content is in.
|
|
214
|
+
*
|
|
215
|
+
* @deprecated Will be removed in next major version.
|
|
196
216
|
*/
|
|
197
217
|
deleteContent<T = void>(parameters: Parameters.DeleteContent, callback: Callback<T>): Promise<void>;
|
|
198
218
|
/**
|
|
@@ -207,18 +227,24 @@ export declare class Content {
|
|
|
207
227
|
*
|
|
208
228
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the
|
|
209
229
|
* content is in.
|
|
230
|
+
*
|
|
231
|
+
* @deprecated Will be removed in next major version.
|
|
210
232
|
*/
|
|
211
233
|
deleteContent<T = void>(parameters: Parameters.DeleteContent, callback?: never): Promise<T>;
|
|
212
234
|
/**
|
|
213
235
|
* Returns the most recent update for a piece of content.
|
|
214
236
|
*
|
|
215
237
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content.
|
|
238
|
+
*
|
|
239
|
+
* @deprecated Will be removed in next major version.
|
|
216
240
|
*/
|
|
217
241
|
getHistoryForContent<T = Models.ContentHistory>(parameters: Parameters.GetHistoryForContent, callback: Callback<T>): Promise<void>;
|
|
218
242
|
/**
|
|
219
243
|
* Returns the most recent update for a piece of content.
|
|
220
244
|
*
|
|
221
245
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content.
|
|
246
|
+
*
|
|
247
|
+
* @deprecated Will be removed in next major version.
|
|
222
248
|
*/
|
|
223
249
|
getHistoryForContent<T = Models.ContentHistory>(parameters: Parameters.GetHistoryForContent, callback?: never): Promise<T>;
|
|
224
250
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as Models from "./models/index.js";
|
|
2
2
|
import type * as Parameters from "./parameters/index.js";
|
|
3
|
-
import type { Callback } from "../callback.js";
|
|
4
3
|
import type { Client } from "../clients/index.js";
|
|
4
|
+
import type { Callback } from "../callback.js";
|
|
5
5
|
export declare class ContentAttachments {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -12,6 +12,8 @@ export declare class ContentAttachments {
|
|
|
12
12
|
*
|
|
13
13
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the
|
|
14
14
|
* content is a blog post, 'View' permission for the space is required.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Will be removed in next major version.
|
|
15
17
|
*/
|
|
16
18
|
getAttachments<T = Models.ContentArray<Models.Attachment>>(parameters: Parameters.GetAttachments, callback: Callback<T>): Promise<void>;
|
|
17
19
|
/**
|
|
@@ -21,6 +23,8 @@ export declare class ContentAttachments {
|
|
|
21
23
|
*
|
|
22
24
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the
|
|
23
25
|
* content is a blog post, 'View' permission for the space is required.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Will be removed in next major version.
|
|
24
28
|
*/
|
|
25
29
|
getAttachments<T = Models.ContentArray<Models.Attachment>>(parameters: Parameters.GetAttachments, callback?: never): Promise<T>;
|
|
26
30
|
/**
|