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":"themes.mjs","sources":["../../../../src/api/themes.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type {
|
|
1
|
+
{"version":3,"file":"themes.mjs","sources":["../../../../src/api/themes.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 Themes {\n constructor(private client: Client) {}\n\n /**\n * Returns all themes, not including the default theme.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None\n */\n async getThemes<T = Models.ThemeArray>(\n parameters: Parameters.GetThemes | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all themes, not including the default theme.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None\n */\n async getThemes<T = Models.ThemeArray>(parameters?: Parameters.GetThemes, callback?: never): Promise<T>;\n async getThemes<T = Models.ThemeArray>(parameters?: Parameters.GetThemes, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/settings/theme',\n method: 'GET',\n params: {\n start: parameters?.start,\n limit: parameters?.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the globally assigned theme.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None\n */\n async getGlobalTheme<T = Models.Theme>(callback: Callback<T>): Promise<void>;\n /**\n * Returns the globally assigned theme.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None\n */\n async getGlobalTheme<T = Models.Theme>(callback?: never): Promise<T>;\n async getGlobalTheme<T = Models.Theme>(callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/settings/theme/selected',\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns a theme. This includes information about the theme name, description, and icon.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None\n */\n async getTheme<T = Models.Theme>(parameters: Parameters.GetTheme, callback: Callback<T>): Promise<void>;\n /**\n * Returns a theme. This includes information about the theme name, description, and icon.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None\n */\n async getTheme<T = Models.Theme>(parameters: Parameters.GetTheme, callback?: never): Promise<T>;\n async getTheme<T = Models.Theme>(parameters: Parameters.GetTheme, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/settings/theme/${parameters.themeKey}`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the theme selected for a space, if one is set. If no space theme is set, this means that the space is\n * inheriting the global look and feel settings.\n *\n * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘View’ permission for the space.\n */\n async getSpaceTheme<T = Models.Theme>(parameters: Parameters.GetSpaceTheme, callback: Callback<T>): Promise<void>;\n /**\n * Returns the theme selected for a space, if one is set. If no space theme is set, this means that the space is\n * inheriting the global look and feel settings.\n *\n * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘View’ permission for the space.\n */\n async getSpaceTheme<T = Models.Theme>(parameters: Parameters.GetSpaceTheme, callback?: never): Promise<T>;\n async getSpaceTheme<T = Models.Theme>(\n parameters: Parameters.GetSpaceTheme,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/space/${parameters.spaceKey}/theme`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Sets the theme for a space. Note, if you want to reset the space theme to the default Confluence theme, use the\n * 'Reset space theme' method instead of this method.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.\n */\n async setSpaceTheme<T = Models.Theme>(parameters: Parameters.SetSpaceTheme, callback: Callback<T>): Promise<void>;\n /**\n * Sets the theme for a space. Note, if you want to reset the space theme to the default Confluence theme, use the\n * 'Reset space theme' method instead of this method.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.\n */\n async setSpaceTheme<T = Models.Theme>(parameters: Parameters.SetSpaceTheme, callback?: never): Promise<T>;\n async setSpaceTheme<T = Models.Theme>(\n parameters: Parameters.SetSpaceTheme,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/space/${parameters.spaceKey}/theme`,\n method: 'PUT',\n data: {\n themeKey: parameters.themeKey,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Resets the space theme. This means that the space will inherit the global look and feel settings\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.\n */\n async resetSpaceTheme<T = void>(parameters: Parameters.ResetSpaceTheme, callback: Callback<T>): Promise<void>;\n /**\n * Resets the space theme. This means that the space will inherit the global look and feel settings\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.\n */\n async resetSpaceTheme<T = void>(parameters: Parameters.ResetSpaceTheme, callback?: never): Promise<T>;\n async resetSpaceTheme<T = void>(parameters: Parameters.ResetSpaceTheme, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/space/${parameters.spaceKey}/theme`,\n method: 'DELETE',\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":"MAMa,MAAM,CAAA;AACG,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AAiBrC,IAAA,MAAM,SAAS,CAAwB,UAAiC,EAAE,QAAsB,EAAA;AAC9F,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,qBAAqB;AAC1B,YAAA,MAA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AAE,UAAU,CAAC,QAAQ;AAC9B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAcA,IAAA,MAAM,eAAe,CAAW,UAAsC,EAAE,QAAsB,EAAA;AAC5F,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,WAAA,EAAc,UAAU,CAAC,QAAQ,CAAA,MAAA,CAAQ;AAC9C,YAAA,MAAM,EAAE,QAAQ;SACjB;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
class UserProperties {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async getUserProperties(parameters, callback) {
|
|
7
|
+
const config = {
|
|
8
|
+
url: `/api/user/${parameters.userId}/property`,
|
|
9
|
+
method: 'GET',
|
|
10
|
+
params: {
|
|
11
|
+
start: parameters.start,
|
|
12
|
+
limit: parameters.limit,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return this.client.sendRequest(config, callback);
|
|
16
|
+
}
|
|
17
|
+
async getUserProperty(parameters, callback) {
|
|
18
|
+
const config = {
|
|
19
|
+
url: `/api/user/${parameters.userId}/property/${parameters.key}`,
|
|
20
|
+
method: 'GET',
|
|
21
|
+
};
|
|
22
|
+
return this.client.sendRequest(config, callback);
|
|
23
|
+
}
|
|
24
|
+
async createUserProperty(parameters, callback) {
|
|
25
|
+
const config = {
|
|
26
|
+
url: `/api/user/${parameters.userId}/property/${parameters.key}`,
|
|
27
|
+
method: 'POST',
|
|
28
|
+
data: {
|
|
29
|
+
value: parameters.value,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return this.client.sendRequest(config, callback);
|
|
33
|
+
}
|
|
34
|
+
async updateUserProperty(parameters, callback) {
|
|
35
|
+
const config = {
|
|
36
|
+
url: `/api/user/${parameters.userId}/property/${parameters.key}`,
|
|
37
|
+
method: 'PUT',
|
|
38
|
+
data: {
|
|
39
|
+
value: parameters.value,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
return this.client.sendRequest(config, callback);
|
|
43
|
+
}
|
|
44
|
+
async deleteUserProperty(parameters, callback) {
|
|
45
|
+
const config = {
|
|
46
|
+
url: `/api/user/${parameters.userId}/property/${parameters.key}`,
|
|
47
|
+
method: 'DELETE',
|
|
48
|
+
};
|
|
49
|
+
return this.client.sendRequest(config, callback);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { UserProperties };
|
|
54
|
+
//# sourceMappingURL=userProperties.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userProperties.mjs","sources":["../../../../src/api/userProperties.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 UserProperties {\n constructor(private client: Client) {}\n\n /**\n * Returns the properties for a user as list of property keys. For more information about user properties, see\n * [Confluence entity properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/).\n * `Note`, these properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUserProperties<T = Models.UserPropertyKeyArray>(\n parameters: Parameters.GetUserProperties,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the properties for a user as list of property keys. For more information about user properties, see\n * [Confluence entity properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/).\n * `Note`, these properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUserProperties<T = Models.UserPropertyKeyArray>(\n parameters: Parameters.GetUserProperties,\n callback?: never,\n ): Promise<T>;\n async getUserProperties<T = Models.UserPropertyKeyArray>(\n parameters: Parameters.GetUserProperties,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/user/${parameters.userId}/property`,\n method: 'GET',\n params: {\n start: parameters.start,\n limit: parameters.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the property corresponding to `key` for a user. For more information about user properties, see [Confluence\n * entity properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these\n * properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUserProperty<T = Models.UserProperty>(\n parameters: Parameters.GetUserProperty,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns the property corresponding to `key` for a user. For more information about user properties, see [Confluence\n * entity properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these\n * properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async getUserProperty<T = Models.UserProperty>(parameters: Parameters.GetUserProperty, callback?: never): Promise<T>;\n async getUserProperty<T = Models.UserProperty>(\n parameters: Parameters.GetUserProperty,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/user/${parameters.userId}/property/${parameters.key}`,\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Creates a property for a user. For more information about user properties, see [Confluence entity properties]\n * (https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these properties stored\n * against a user are on a Confluence site level and not space/content level.\n *\n * `Note:` the number of properties which could be created per app in a tenant for each user might be restricted by\n * fixed system limits. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access\n * the Confluence site ('Can use' global permission).\n */\n async createUserProperty<T = unknown>(\n parameters: Parameters.CreateUserProperty,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Creates a property for a user. For more information about user properties, see [Confluence entity properties]\n * (https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these properties stored\n * against a user are on a Confluence site level and not space/content level.\n *\n * `Note:` the number of properties which could be created per app in a tenant for each user might be restricted by\n * fixed system limits. **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access\n * the Confluence site ('Can use' global permission).\n */\n async createUserProperty<T = unknown>(parameters: Parameters.CreateUserProperty, callback?: never): Promise<T>;\n async createUserProperty<T = unknown>(\n parameters: Parameters.CreateUserProperty,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/user/${parameters.userId}/property/${parameters.key}`,\n method: 'POST',\n data: {\n value: parameters.value,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Updates a property for the given user. Note, you cannot update the key of a user property, only the value. For more\n * information about user properties, see [Confluence entity\n * properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these\n * properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async updateUserProperty<T = void>(parameters: Parameters.UpdateUserProperty, callback: Callback<T>): Promise<void>;\n /**\n * Updates a property for the given user. Note, you cannot update the key of a user property, only the value. For more\n * information about user properties, see [Confluence entity\n * properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these\n * properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async updateUserProperty<T = void>(parameters: Parameters.UpdateUserProperty, callback?: never): Promise<T>;\n async updateUserProperty<T = void>(\n parameters: Parameters.UpdateUserProperty,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/user/${parameters.userId}/property/${parameters.key}`,\n method: 'PUT',\n data: {\n value: parameters.value,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Deletes a property for the given user. For more information about user properties, see [Confluence entity\n * properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these\n * properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async deleteUserProperty<T = void>(parameters: Parameters.DeleteUserProperty, callback: Callback<T>): Promise<void>;\n /**\n * Deletes a property for the given user. For more information about user properties, see [Confluence entity\n * properties](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/). `Note`, these\n * properties stored against a user are on a Confluence site level and not space/content level.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site\n * ('Can use' global permission).\n */\n async deleteUserProperty<T = void>(parameters: Parameters.DeleteUserProperty, callback?: never): Promise<T>;\n async deleteUserProperty<T = void>(\n parameters: Parameters.DeleteUserProperty,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/user/${parameters.userId}/property/${parameters.key}`,\n method: 'DELETE',\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":"MAMa,cAAc,CAAA;AACL,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AA0BrC,IAAA,MAAM,iBAAiB,CACrB,UAAwC,EACxC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,UAAA,EAAa,UAAU,CAAC,MAAM,CAAA,SAAA,CAAW;AAC9C,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,KAAK,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MAAM,GAAkB;YAC5B,GAAG,EAAE,aAAa,UAAU,CAAC,MAAM,CAAA,UAAA,EAAa,UAAU,CAAC,GAAG,CAAA,CAAE;AAChE,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":"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,MAA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W,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAyBlD,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;;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,EAA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C,MAAM,EAAE,QAAQ,CAAC;IAClD;AA4BA,IAAA,MAAM,yBAAyB,CAC7B,UAAgD,EAChD,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,iBAAiB;AACtB,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;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,10 +1,12 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { getAuthenticationToken } from '../services/authenticationService/authenticationService.mjs';
|
|
3
3
|
import { ConfigSchema } from '../config.mjs';
|
|
4
|
-
import { ZodError } from 'zod';
|
|
4
|
+
import { z, ZodError } from 'zod';
|
|
5
5
|
|
|
6
6
|
const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token';
|
|
7
7
|
const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check';
|
|
8
|
+
const NON_EMAIL_BASIC_AUTH_WARNING = '[confluence.js] authentication.basic.email is not a valid email address; treating it as login workaround.';
|
|
9
|
+
const EMAIL_SCHEMA = z.email();
|
|
8
10
|
class BaseClient {
|
|
9
11
|
config;
|
|
10
12
|
#instance;
|
|
@@ -13,14 +15,27 @@ class BaseClient {
|
|
|
13
15
|
this.config.apiPrefix = this.config.apiPrefix || '/wiki/rest/';
|
|
14
16
|
try {
|
|
15
17
|
this.config = ConfigSchema.parse(this.config);
|
|
18
|
+
this.warnIfNonEmailBasicAuthLogin();
|
|
16
19
|
}
|
|
17
20
|
catch (e) {
|
|
18
|
-
if (e instanceof ZodError && e.
|
|
19
|
-
throw new Error(e.
|
|
21
|
+
if (e instanceof ZodError && e.issues[0]?.message) {
|
|
22
|
+
throw new Error(e.issues[0].message, e);
|
|
20
23
|
}
|
|
21
24
|
throw e;
|
|
22
25
|
}
|
|
23
26
|
}
|
|
27
|
+
warnIfNonEmailBasicAuthLogin() {
|
|
28
|
+
if (this.config.suppressWarnings) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const authentication = this.config.authentication;
|
|
32
|
+
if (!authentication || !('basic' in authentication)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!EMAIL_SCHEMA.safeParse(authentication.basic.email).success) {
|
|
36
|
+
console.warn(NON_EMAIL_BASIC_AUTH_WARNING);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
24
39
|
paramSerializer(parameters) {
|
|
25
40
|
const parts = [];
|
|
26
41
|
Object.entries(parameters).forEach(([key, value]) => {
|
|
@@ -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, z } from 'zod';\n\nconst ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token';\nconst ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check';\nconst NON_EMAIL_BASIC_AUTH_WARNING =\n '[confluence.js] authentication.basic.email is not a valid email address; treating it as login workaround.';\nconst EMAIL_SCHEMA = z.email();\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 this.warnIfNonEmailBasicAuthLogin();\n } catch (e) {\n if (e instanceof ZodError && e.issues[0]?.message) {\n throw new Error(e.issues[0].message, e);\n }\n\n throw e;\n }\n }\n\n private warnIfNonEmailBasicAuthLogin() {\n if (this.config.suppressWarnings) {\n return;\n }\n\n const authentication = this.config.authentication;\n\n if (!authentication || !('basic' in authentication)) {\n return;\n }\n\n if (!EMAIL_SCHEMA.safeParse(authentication.basic.email).success) {\n console.warn(NON_EMAIL_BASIC_AUTH_WARNING);\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;AACtD,MAAM,4BAA4B,GAChC,2GAA2G;AAC7G,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,EAAE;MAEjB,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,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,aAAa;AAE9D,QAAA,IAAI;YACF,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;YAC7C,IAAI,CAAC,4BAA4B,EAAE;QACrC;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,IAAI,CAAC,YAAY,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE;AACjD,gBAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzC;AAEA,YAAA,MAAM,CAAC;QACT;IACF;IAEQ,4BAA4B,GAAA;AAClC,QAAA,IAAI,IAAI,CAAC,MA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AAC,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,IAAI,CAAC;;AAEvE,IAAA,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC;AAC3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AC;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
|
@@ -8,7 +8,7 @@ import { z } from 'zod';
|
|
|
8
8
|
const BasicSchema = z.strictObject({
|
|
9
9
|
basic: z.strictObject({
|
|
10
10
|
/** User's email associated with Atlassian account */
|
|
11
|
-
email: z.string()
|
|
11
|
+
email: z.string(),
|
|
12
12
|
/**
|
|
13
13
|
* API token generated from Atlassian account settings
|
|
14
14
|
*
|
|
@@ -42,17 +42,20 @@ const RequestConfigSchema = z.any();
|
|
|
42
42
|
/** Middleware configuration schema */
|
|
43
43
|
const MiddlewaresSchema = z.object({
|
|
44
44
|
/** Error handler middleware */
|
|
45
|
-
onError: z.optional(z.
|
|
45
|
+
onError: z.optional(z.custom((value) => typeof value === 'function')),
|
|
46
46
|
/** Response handler middleware */
|
|
47
|
-
onResponse: z.optional(z.
|
|
47
|
+
onResponse: z.optional(z.custom((value) => typeof value === 'function')),
|
|
48
48
|
});
|
|
49
49
|
const ConfigSchema = z.object({
|
|
50
|
-
host: z.
|
|
50
|
+
host: z.url({
|
|
51
|
+
error: '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),
|
|
54
56
|
/** Adds `'X-Atlassian-Token': 'no-check'` to each request header */
|
|
55
57
|
noCheckAtlassianToken: z.optional(z.boolean()),
|
|
58
|
+
suppressWarnings: z.boolean().optional().default(false),
|
|
56
59
|
/** Prefix for all API routes. */
|
|
57
60
|
apiPrefix: z.optional(z.string()),
|
|
58
61
|
});
|
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()
|
|
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(),\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.custom<(input: unknown) => void>((value) => typeof value === 'function')),\n /** Response handler middleware */\n onResponse: z.optional(z.custom<(input: unknown) => void>((value) => typeof value === 'function')),\n});\n\nexport const ConfigSchema = z.object({\n host: z.url({\n error:\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 suppressWarnings: z.boolean().optional().default(false),\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;AACjB;;;;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,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAC1C,CAAC;AACH,CAAA;AAED;AACO,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;AACzC,I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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,EAAE;AAC9B,gBAAA,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;AAE9C,gBAAA,OAAO,IAAI,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AAI,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.
|