confluence.js 1.5.3 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -0
  3. package/out/api/contentBody.d.ts +52 -0
  4. package/out/api/contentBody.js +26 -0
  5. package/out/api/contentBody.js.map +1 -1
  6. package/out/api/contentChildrenAndDescendants.js +2 -1
  7. package/out/api/contentChildrenAndDescendants.js.map +1 -1
  8. package/out/api/contentContentState.d.ts +30 -28
  9. package/out/api/contentContentState.js +2 -0
  10. package/out/api/contentContentState.js.map +1 -1
  11. package/out/api/contentMacroBody.d.ts +68 -0
  12. package/out/api/contentMacroBody.js +29 -0
  13. package/out/api/contentMacroBody.js.map +1 -1
  14. package/out/api/contentStates.d.ts +120 -0
  15. package/out/api/contentStates.js +88 -0
  16. package/out/api/contentStates.js.map +1 -0
  17. package/out/api/dynamicModules.js +1 -0
  18. package/out/api/dynamicModules.js.map +1 -1
  19. package/out/api/experimental.d.ts +2 -2
  20. package/out/api/index.d.ts +1 -0
  21. package/out/api/index.js +1 -0
  22. package/out/api/index.js.map +1 -1
  23. package/out/api/models/asyncContentBody.d.ts +30 -0
  24. package/out/api/models/asyncContentBody.js +3 -0
  25. package/out/api/models/asyncContentBody.js.map +1 -0
  26. package/out/api/models/asyncId.d.ts +3 -0
  27. package/out/api/models/asyncId.js +3 -0
  28. package/out/api/models/asyncId.js.map +1 -0
  29. package/out/api/models/contentBodyCreate.d.ts +1 -0
  30. package/out/api/models/contentStateResponse.d.ts +7 -0
  31. package/out/api/models/contentStateResponse.js +3 -0
  32. package/out/api/models/contentStateResponse.js.map +1 -0
  33. package/out/api/models/contentStateRestInput.d.ts +11 -0
  34. package/out/api/models/contentStateRestInput.js +3 -0
  35. package/out/api/models/contentStateRestInput.js.map +1 -0
  36. package/out/api/models/index.d.ts +16 -12
  37. package/out/api/models/index.js +16 -12
  38. package/out/api/models/index.js.map +1 -1
  39. package/out/api/parameters/asyncConvertContentBodyRequest.d.ts +38 -0
  40. package/out/api/parameters/asyncConvertContentBodyRequest.js +3 -0
  41. package/out/api/parameters/asyncConvertContentBodyRequest.js.map +1 -0
  42. package/out/api/parameters/asyncConvertContentBodyResponse.d.ts +4 -0
  43. package/out/api/parameters/asyncConvertContentBodyResponse.js +3 -0
  44. package/out/api/parameters/asyncConvertContentBodyResponse.js.map +1 -0
  45. package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.d.ts +46 -0
  46. package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.js +3 -0
  47. package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.js.map +1 -0
  48. package/out/api/parameters/getAndConvertMacroBodyByMacroId.d.ts +34 -0
  49. package/out/api/parameters/getAndConvertMacroBodyByMacroId.js +3 -0
  50. package/out/api/parameters/getAndConvertMacroBodyByMacroId.js.map +1 -0
  51. package/out/api/parameters/getAvailableContentStates.d.ts +4 -2
  52. package/out/api/parameters/getContentState.d.ts +8 -4
  53. package/out/api/parameters/getSpaceContentStates.d.ts +4 -0
  54. package/out/api/parameters/getSpaceContentStates.js +3 -0
  55. package/out/api/parameters/getSpaceContentStates.js.map +1 -0
  56. package/out/api/parameters/getUser.d.ts +6 -4
  57. package/out/api/parameters/index.d.ts +5 -0
  58. package/out/api/parameters/index.js +5 -0
  59. package/out/api/parameters/index.js.map +1 -1
  60. package/out/api/parameters/movePage.d.ts +9 -5
  61. package/out/api/parameters/removeContentState.d.ts +5 -1
  62. package/out/api/parameters/setContentState.d.ts +11 -5
  63. package/out/api/settings.d.ts +2 -2
  64. package/out/api/space.d.ts +2 -2
  65. package/out/api/spaceProperties.d.ts +4 -4
  66. package/out/clients/confluenceClient.d.ts +2 -1
  67. package/out/clients/confluenceClient.js +1 -0
  68. package/out/clients/confluenceClient.js.map +1 -1
  69. package/package.json +2 -2
  70. package/src/api/contentBody.ts +100 -0
  71. package/src/api/contentChildrenAndDescendants.ts +3 -1
  72. package/src/api/contentContentState.ts +30 -28
  73. package/src/api/contentMacroBody.ts +115 -0
  74. package/src/api/contentStates.ts +252 -0
  75. package/src/api/dynamicModules.ts +1 -0
  76. package/src/api/experimental.ts +2 -2
  77. package/src/api/index.ts +1 -0
  78. package/src/api/models/asyncContentBody.ts +31 -0
  79. package/src/api/models/asyncId.ts +3 -0
  80. package/src/api/models/contentBodyCreate.ts +1 -0
  81. package/src/api/models/contentStateResponse.ts +8 -0
  82. package/src/api/models/contentStateRestInput.ts +11 -0
  83. package/src/api/models/index.ts +16 -12
  84. package/src/api/parameters/asyncConvertContentBodyRequest.ts +81 -0
  85. package/src/api/parameters/asyncConvertContentBodyResponse.ts +4 -0
  86. package/src/api/parameters/getAndAsyncConvertMacroBodyByMacroId.ts +88 -0
  87. package/src/api/parameters/getAndConvertMacroBodyByMacroId.ts +104 -0
  88. package/src/api/parameters/getAvailableContentStates.ts +5 -2
  89. package/src/api/parameters/getContentState.ts +9 -4
  90. package/src/api/parameters/getSpaceContentStates.ts +4 -0
  91. package/src/api/parameters/getUser.ts +14 -4
  92. package/src/api/parameters/index.ts +5 -0
  93. package/src/api/parameters/movePage.ts +9 -5
  94. package/src/api/parameters/removeContentState.ts +6 -1
  95. package/src/api/parameters/setContentState.ts +13 -5
  96. package/src/api/settings.ts +2 -2
  97. package/src/api/space.ts +3 -3
  98. package/src/api/spaceProperties.ts +4 -4
  99. package/src/clients/confluenceClient.ts +2 -0
@@ -0,0 +1,104 @@
1
+ export interface GetAndConvertMacroBodyByMacroId {
2
+ /** The ID for the content that contains the macro. */
3
+ id: string;
4
+ /**
5
+ * The version of the content that contains the macro. Specifying `0` as the `version` will return the macro body for
6
+ * the latest content version.
7
+ */
8
+ version: number;
9
+ /**
10
+ * The ID of the macro. This is usually passed by the app that the macro is in. Otherwise, find the macro ID by
11
+ * querying the desired content and version, then expanding the body in storage format. For example,
12
+ * '/content/196611/version/7?expand=content.body.storage'.
13
+ */
14
+ macroId: string;
15
+ /** The content representation to return the macro in. */
16
+ to: string;
17
+ /**
18
+ * The space key used for resolving embedded content (page includes, files, and links) in the content body. For
19
+ * example, if the source content contains the link `<ac:link><ri:page ri:content-title="Example page" /><ac:link>`
20
+ * and the `spaceKeyContext=TEST` parameter is provided, then the link will be converted to a link to the "Example
21
+ * page" page in the "TEST" space.
22
+ */
23
+ spaceKeyContext?: string;
24
+ /**
25
+ * Mode used for rendering embedded content, like attachments.
26
+ *
27
+ * - `current` renders the embedded content using the latest version.
28
+ * - `version-at-save` renders the embedded content using the version at
29
+ * the time of save.
30
+ */
31
+ embeddedContentRender?: 'current' | 'version-at-save' | string;
32
+ /** A multi-value parameter indicating which properties of the content to expand. */
33
+ expand?:
34
+ | 'childTypes.all'
35
+ | 'childTypes.attachment'
36
+ | 'childTypes.comment'
37
+ | 'childTypes.page'
38
+ | 'container'
39
+ | 'metadata.currentuser'
40
+ | 'metadata.properties'
41
+ | 'metadata.labels'
42
+ | 'metadata.frontend'
43
+ | 'operations'
44
+ | 'children.page'
45
+ | 'children.attachment'
46
+ | 'children.comment'
47
+ | 'restrictions.read.restrictions.user'
48
+ | 'restrictions.read.restrictions.group'
49
+ | 'restrictions.update.restrictions.user'
50
+ | 'restrictions.update.restrictions.group'
51
+ | 'history'
52
+ | 'history.lastUpdated'
53
+ | 'history.previousVersion'
54
+ | 'history.contributors'
55
+ | 'history.nextVersion'
56
+ | 'ancestors'
57
+ | 'body'
58
+ | 'body.storage'
59
+ | 'body.view'
60
+ | 'version'
61
+ | 'descendants.page'
62
+ | 'descendants.attachment'
63
+ | 'descendants.comment'
64
+ | 'space'
65
+ | 'extensions.inlineProperties'
66
+ | 'extensions.resolution'
67
+ | (
68
+ | 'childTypes.all'
69
+ | 'childTypes.attachment'
70
+ | 'childTypes.comment'
71
+ | 'childTypes.page'
72
+ | 'container'
73
+ | 'metadata.currentuser'
74
+ | 'metadata.properties'
75
+ | 'metadata.labels'
76
+ | 'metadata.frontend'
77
+ | 'operations'
78
+ | 'children.page'
79
+ | 'children.attachment'
80
+ | 'children.comment'
81
+ | 'restrictions.read.restrictions.user'
82
+ | 'restrictions.read.restrictions.group'
83
+ | 'restrictions.update.restrictions.user'
84
+ | 'restrictions.update.restrictions.group'
85
+ | 'history'
86
+ | 'history.lastUpdated'
87
+ | 'history.previousVersion'
88
+ | 'history.contributors'
89
+ | 'history.nextVersion'
90
+ | 'ancestors'
91
+ | 'body'
92
+ | 'body.storage'
93
+ | 'body.view'
94
+ | 'version'
95
+ | 'descendants.page'
96
+ | 'descendants.attachment'
97
+ | 'descendants.comment'
98
+ | 'space'
99
+ | 'extensions.inlineProperties'
100
+ | 'extensions.resolution'
101
+ )[]
102
+ | string
103
+ | string[];
104
+ }
@@ -1,4 +1,7 @@
1
1
  export interface GetAvailableContentStates {
2
- /** Id of content to get available states for */
3
- contentId: string;
2
+ /**id of content to get available states for*/
3
+ id?: string;
4
+
5
+ /** @deprecated Id of content to get available states for */
6
+ contentId?: string;
4
7
  }
@@ -1,6 +1,11 @@
1
1
  export interface GetContentState {
2
- /** The Id of the page whose content state is of interest. */
3
- contentId: string;
4
- /** Set designation=DRAFT or designation=PUBLISHED. */
5
- designation?: string;
2
+ /** The id of the content whose content state is of interest. */
3
+ id?: string;
4
+ /** Set status to one of [current,draft,archived]. */
5
+ status?: 'current' | 'draft' | 'archived' | string;
6
+
7
+ /** @deprecated The Id of the page whose content state is of interest. */
8
+ contentId?: string;
9
+ /** @deprecated Set designation=DRAFT or designation=PUBLISHED. */
10
+ designation?: 'DRAFT' | 'PUBLISHED' | string;
6
11
  }
@@ -0,0 +1,4 @@
1
+ export interface GetSpaceContentStates {
2
+ /** The key of the space to be queried for its content state settings. */
3
+ spaceKey: string;
4
+ }
@@ -20,12 +20,22 @@ export interface GetUser {
20
20
  * - `operations` returns the operations that the user is allowed to do.
21
21
  * - `details.personal` returns the 'Personal' details in the user's profile, like the 'Email' and 'Phone'. Note that
22
22
  * these fields have been deprecated due to privacy changes. See the [migration
23
- * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details.
23
+ * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for
24
+ * details.
24
25
  * - `details.business` returns the 'Company' details in the user's profile, like the 'Position' and 'Department'. Note
25
26
  * that these fields have been deprecated due to privacy changes. See the [migration
26
- * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details.
27
- * - PersonalSpace returns the user's personal space, if it exists.
27
+ * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for
28
+ * details.
29
+ * - `personalSpace` returns the user's personal space, if it exists.
28
30
  * - `isExternalCollaborator` returns whether the user is an external collaborator user
29
31
  */
30
- expand?: string[];
32
+ expand?:
33
+ | 'operations'
34
+ | 'details.personal'
35
+ | 'details.business'
36
+ | 'personalSpace'
37
+ | 'isExternalCollaborator'
38
+ | ('operations' | 'details.personal' | 'details.business' | 'personalSpace' | 'isExternalCollaborator')[]
39
+ | string
40
+ | string[];
31
41
  }
@@ -13,6 +13,8 @@ export * from './addUserToContentRestriction';
13
13
  export * from './addUserToGroup';
14
14
  export * from './addUserToGroupByGroupId';
15
15
  export * from './archivePages';
16
+ export * from './asyncConvertContentBodyRequest';
17
+ export * from './asyncConvertContentBodyResponse';
16
18
  export * from './checkContentPermission';
17
19
  export * from './convertContentBody';
18
20
  export * from './copyPage';
@@ -48,6 +50,8 @@ export * from './exportAuditRecords';
48
50
  export * from './findSourcesForTarget';
49
51
  export * from './findTargetFromSource';
50
52
  export * from './getAllLabelContent';
53
+ export * from './getAndAsyncConvertMacroBodyByMacroId';
54
+ export * from './getAndConvertMacroBodyByMacroId';
51
55
  export * from './getAnonymousUser';
52
56
  export * from './getAttachments';
53
57
  export * from './getAuditRecords';
@@ -101,6 +105,7 @@ export * from './getRestrictions';
101
105
  export * from './getRestrictionsByOperation';
102
106
  export * from './getRestrictionsForOperation';
103
107
  export * from './getSpace';
108
+ export * from './getSpaceContentStates';
104
109
  export * from './getSpaceProperties';
105
110
  export * from './getSpaceProperty';
106
111
  export * from './getSpaces';
@@ -1,12 +1,16 @@
1
1
  export interface MovePage {
2
2
  /** The ID of the page to be moved */
3
- id: string;
3
+ pageId?: string;
4
+ /** @deprecated The ID of the page to be moved */
5
+ id?: string;
4
6
  /**
5
- * The position to move the page to relative to the target page: `before` - move the page under the same parent as the
6
- * target, before the target in the list of children `after` - move the page under the same parent as the target,
7
- * after the target in the list of children `append` - move the page to be a child of the target
7
+ * The position to move the page to relative to the target page:
8
+ *
9
+ * - `before` - move the page under the same parent as the target, before the target in the list of children
10
+ * - `after` - move the page under the same parent as the target, after the target in the list of children
11
+ * - `append` - move the page to be a child of the target
8
12
  */
9
- position: string;
13
+ position: 'before' | 'after' | 'append' | string;
10
14
  /** The ID of the target page for this operation */
11
15
  targetId: string;
12
16
  }
@@ -1,4 +1,9 @@
1
1
  export interface RemoveContentState {
2
2
  /** The Id of the content whose content state is to be set. */
3
- contentId: string;
3
+ id?: string;
4
+ /** Status of content state from which to delete state. Can be draft or archived */
5
+ status?: string;
6
+
7
+ /** @deprecated The Id of the content whose content state is to be set. */
8
+ contentId?: string;
4
9
  }
@@ -1,8 +1,16 @@
1
- export interface SetContentState {
1
+ import { ContentStateRestInput } from '../models';
2
+
3
+ export interface SetContentState extends ContentStateRestInput {
2
4
  /** The Id of the content whose content state is to be set. */
3
- contentId: string;
4
- /** The Id of the content */
5
+ id?: string;
6
+ /**
7
+ * Status of content onto which state will be placed. If draft, then draft state will change. If current, state will
8
+ * be placed onto a new version of the content with same body as previous version.
9
+ */
10
+ status?: 'current' | 'draft' | string;
11
+
12
+ /** @deprecated The Id of the content whose content state is to be set. */
13
+ contentId?: string;
14
+ /** @deprecated The Id of the content */
5
15
  contentStateId?: number;
6
- name?: string;
7
- color?: string;
8
16
  }
@@ -233,12 +233,12 @@ export class Settings {
233
233
  return this.client.sendRequest(config, callback);
234
234
  }
235
235
 
236
- /** Gets Content State settings for a space */
236
+ /** @deprecated Gets Content State settings for a space */
237
237
  async getContentStateSettings<T = Models.ContentStateSettings>(
238
238
  parameters: Parameters.GetContentStateSettings,
239
239
  callback: Callback<T>
240
240
  ): Promise<void>;
241
- /** Gets Content State settings for a space */
241
+ /** @deprecated Gets Content State settings for a space */
242
242
  async getContentStateSettings<T = Models.ContentStateSettings>(
243
243
  parameters: Parameters.GetContentStateSettings,
244
244
  callback?: never
package/src/api/space.ts CHANGED
@@ -181,7 +181,7 @@ export class Space {
181
181
  *
182
182
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
183
183
  */
184
- async deleteSpace<T = Models.DeletedSpace>(parameters: Parameters.DeleteSpace, callback: Callback<T>): Promise<void>;
184
+ async deleteSpace<T = Models.LongTask>(parameters: Parameters.DeleteSpace, callback: Callback<T>): Promise<void>;
185
185
  /**
186
186
  * Deletes a space. Note, the space will be deleted in a long running task. Therefore, the space may not be deleted
187
187
  * yet when this method has returned. Clients should poll the status link that is returned in the response until the
@@ -189,8 +189,8 @@ export class Space {
189
189
  *
190
190
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
191
191
  */
192
- async deleteSpace<T = Models.DeletedSpace>(parameters: Parameters.DeleteSpace, callback?: never): Promise<T>;
193
- async deleteSpace<T = Models.DeletedSpace>(
192
+ async deleteSpace<T = Models.LongTask>(parameters: Parameters.DeleteSpace, callback?: never): Promise<T>;
193
+ async deleteSpace<T = Models.LongTask>(
194
194
  parameters: Parameters.DeleteSpace,
195
195
  callback?: Callback<T>,
196
196
  ): Promise<void | T> {
@@ -111,8 +111,8 @@ export class SpaceProperties {
111
111
  }
112
112
 
113
113
  /**
114
- * Creates a new space property. This is the same as `POST /wiki/rest/api/space/{spaceKey}/property` but the key for
115
- * the property is passed as a path parameter, rather than in the request body.
114
+ * Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
115
+ * property is passed as a path parameter, rather than in the request body.
116
116
  *
117
117
  * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
118
118
  */
@@ -121,8 +121,8 @@ export class SpaceProperties {
121
121
  callback: Callback<T>
122
122
  ): Promise<void>;
123
123
  /**
124
- * Creates a new space property. This is the same as `POST /wiki/rest/api/space/{spaceKey}/property` but the key for
125
- * the property is passed as a path parameter, rather than in the request body.
124
+ * Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
125
+ * property is passed as a path parameter, rather than in the request body.
126
126
  *
127
127
  * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
128
128
  */
@@ -13,6 +13,7 @@ import {
13
13
  ContentPermissions,
14
14
  ContentProperties,
15
15
  ContentRestrictions,
16
+ ContentStates,
16
17
  ContentVersions,
17
18
  ContentWatches,
18
19
  DynamicModules,
@@ -47,6 +48,7 @@ export class ConfluenceClient extends BaseClient {
47
48
  contentPermissions = new ContentPermissions(this);
48
49
  contentProperties = new ContentProperties(this);
49
50
  contentRestrictions = new ContentRestrictions(this);
51
+ contentStates = new ContentStates(this);
50
52
  contentVersions = new ContentVersions(this);
51
53
  contentWatches = new ContentWatches(this);
52
54
  dynamicModules = new DynamicModules(this);