confluence.js 1.1.3 → 1.2.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 (151) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -0
  3. package/out/api/content.d.ts +24 -52
  4. package/out/api/content.js +14 -0
  5. package/out/api/contentAttachments.d.ts +10 -6
  6. package/out/api/contentAttachments.js +12 -0
  7. package/out/api/contentChildrenAndDescendants.d.ts +6 -24
  8. package/out/api/contentChildrenAndDescendants.js +6 -0
  9. package/out/api/contentPermissions.d.ts +6 -2
  10. package/out/api/contentPermissions.js +6 -1
  11. package/out/api/contentProperties.js +1 -0
  12. package/out/api/contentWatches.d.ts +2 -2
  13. package/out/api/experimental.d.ts +16 -0
  14. package/out/api/experimental.js +34 -0
  15. package/out/api/group.d.ts +30 -10
  16. package/out/api/group.js +31 -2
  17. package/out/api/index.d.ts +1 -0
  18. package/out/api/index.js +1 -0
  19. package/out/api/inlineTasks.d.ts +28 -0
  20. package/out/api/inlineTasks.js +21 -0
  21. package/out/api/models/getViewers.d.ts +6 -0
  22. package/out/api/models/getViewers.js +2 -0
  23. package/out/api/models/getViews.d.ts +6 -0
  24. package/out/api/models/getViews.js +2 -0
  25. package/out/api/models/groupCreate.d.ts +4 -0
  26. package/out/api/models/groupCreate.js +2 -0
  27. package/out/api/models/horizontalHeaderLookAndFeel.d.ts +11 -0
  28. package/out/api/models/horizontalHeaderLookAndFeel.js +2 -0
  29. package/out/api/models/index.d.ts +13 -4
  30. package/out/api/models/index.js +13 -4
  31. package/out/api/models/lookAndFeel.d.ts +3 -0
  32. package/out/api/models/spacePermissionCreate.d.ts +33 -0
  33. package/out/api/models/spacePermissionCreate.js +2 -0
  34. package/out/api/models/spacePermissionCustomContent.d.ts +16 -0
  35. package/out/api/models/spacePermissionCustomContent.js +2 -0
  36. package/out/api/models/spacePermissionRequest.d.ts +41 -0
  37. package/out/api/models/spacePermissionRequest.js +2 -0
  38. package/out/api/models/spacePrivateCreate.d.ts +9 -0
  39. package/out/api/models/spacePropertyCreate.d.ts +4 -0
  40. package/out/api/models/spaceUpdate.d.ts +4 -0
  41. package/out/api/models/taskStatusUpdate.d.ts +3 -0
  42. package/out/api/models/taskStatusUpdate.js +2 -0
  43. package/out/api/models/topNavigationLookAndFeel.d.ts +8 -0
  44. package/out/api/models/topNavigationLookAndFeel.js +2 -0
  45. package/out/api/parameters/addCustomContentPermissions.d.ts +5 -0
  46. package/out/api/parameters/addCustomContentPermissions.js +2 -0
  47. package/out/api/parameters/addPermissionToSpace.d.ts +5 -0
  48. package/out/api/parameters/addPermissionToSpace.js +2 -0
  49. package/out/api/parameters/addUserToGroup.d.ts +2 -1
  50. package/out/api/parameters/addUserToGroupByGroupId.d.ts +2 -1
  51. package/out/api/parameters/archivePages.d.ts +6 -0
  52. package/out/api/parameters/archivePages.js +2 -0
  53. package/out/api/parameters/checkContentPermission.d.ts +5 -0
  54. package/out/api/parameters/checkContentPermission.js +2 -0
  55. package/out/api/parameters/deleteRelationship.d.ts +38 -0
  56. package/out/api/parameters/deleteRelationship.js +2 -0
  57. package/out/api/parameters/downloadAttachment.d.ts +11 -0
  58. package/out/api/parameters/downloadAttachment.js +2 -0
  59. package/out/api/parameters/getContentProperties.d.ts +2 -0
  60. package/out/api/parameters/getDescendantsOfType.d.ts +101 -0
  61. package/out/api/parameters/getDescendantsOfType.js +89 -0
  62. package/out/api/parameters/getGroupByName.d.ts +4 -0
  63. package/out/api/parameters/getGroupByName.js +2 -0
  64. package/out/api/parameters/getGroups.d.ts +2 -0
  65. package/out/api/parameters/getTaskById.d.ts +4 -0
  66. package/out/api/parameters/getTaskById.js +2 -0
  67. package/out/api/parameters/getViewers.d.ts +6 -0
  68. package/out/api/parameters/getViewers.js +2 -0
  69. package/out/api/parameters/getViews.d.ts +6 -0
  70. package/out/api/parameters/getViews.js +2 -0
  71. package/out/api/parameters/index.d.ts +131 -116
  72. package/out/api/parameters/index.js +131 -116
  73. package/out/api/parameters/publishLegacyDraft.d.ts +3 -1
  74. package/out/api/parameters/publishSharedDraft.d.ts +3 -1
  75. package/out/api/parameters/searchByCQL.d.ts +34 -0
  76. package/out/api/parameters/searchByCQL.js +2 -0
  77. package/out/api/parameters/searchGroups.d.ts +8 -0
  78. package/out/api/parameters/searchGroups.js +2 -0
  79. package/out/api/parameters/searchUser.d.ts +20 -0
  80. package/out/api/parameters/searchUser.js +2 -0
  81. package/out/api/parameters/updateTaskById.d.ts +5 -0
  82. package/out/api/parameters/updateTaskById.js +2 -0
  83. package/out/api/relation.d.ts +12 -4
  84. package/out/api/relation.js +12 -2
  85. package/out/api/search.d.ts +12 -64
  86. package/out/api/search.js +19 -2
  87. package/out/api/settings.d.ts +2 -2
  88. package/out/api/settings.js +3 -0
  89. package/out/api/space.js +3 -0
  90. package/out/api/spacePermissions.d.ts +26 -2
  91. package/out/api/spacePermissions.js +20 -3
  92. package/out/api/spaceProperties.d.ts +4 -4
  93. package/out/api/spaceProperties.js +1 -0
  94. package/out/clients/baseClient.js +1 -1
  95. package/out/clients/confluenceClient.d.ts +2 -1
  96. package/out/clients/confluenceClient.js +1 -0
  97. package/package.json +6 -6
  98. package/src/api/content.ts +57 -52
  99. package/src/api/contentAttachments.ts +28 -6
  100. package/src/api/contentChildrenAndDescendants.ts +24 -28
  101. package/src/api/contentPermissions.ts +24 -7
  102. package/src/api/contentProperties.ts +1 -0
  103. package/src/api/contentWatches.ts +3 -3
  104. package/src/api/experimental.ts +44 -0
  105. package/src/api/group.ts +71 -19
  106. package/src/api/index.ts +1 -0
  107. package/src/api/inlineTasks.ts +52 -0
  108. package/src/api/models/getViewers.ts +6 -0
  109. package/src/api/models/getViews.ts +6 -0
  110. package/src/api/models/groupCreate.ts +4 -0
  111. package/src/api/models/horizontalHeaderLookAndFeel.ts +12 -0
  112. package/src/api/models/index.ts +13 -4
  113. package/src/api/models/lookAndFeel.ts +3 -0
  114. package/src/api/models/spacePermissionCreate.ts +34 -0
  115. package/src/api/models/spacePermissionCustomContent.ts +17 -0
  116. package/src/api/models/spacePermissionRequest.ts +42 -0
  117. package/src/api/models/spacePrivateCreate.ts +9 -0
  118. package/src/api/models/spacePropertyCreate.ts +4 -0
  119. package/src/api/models/spaceUpdate.ts +4 -0
  120. package/src/api/models/taskStatusUpdate.ts +3 -0
  121. package/src/api/models/topNavigationLookAndFeel.ts +8 -0
  122. package/src/api/parameters/addCustomContentPermissions.ts +6 -0
  123. package/src/api/parameters/addPermissionToSpace.ts +6 -0
  124. package/src/api/parameters/addUserToGroup.ts +3 -1
  125. package/src/api/parameters/addUserToGroupByGroupId.ts +3 -1
  126. package/src/api/parameters/archivePages.ts +6 -0
  127. package/src/api/parameters/checkContentPermission.ts +6 -0
  128. package/src/api/parameters/deleteRelationship.ts +38 -0
  129. package/src/api/parameters/downloadAttachment.ts +11 -0
  130. package/src/api/parameters/getContentProperties.ts +2 -0
  131. package/src/api/parameters/getDescendantsOfType.ts +102 -0
  132. package/src/api/parameters/getGroupByName.ts +4 -0
  133. package/src/api/parameters/getGroups.ts +2 -0
  134. package/src/api/parameters/getTaskById.ts +4 -0
  135. package/src/api/parameters/getViewers.ts +6 -0
  136. package/src/api/parameters/getViews.ts +6 -0
  137. package/src/api/parameters/index.ts +131 -116
  138. package/src/api/parameters/publishLegacyDraft.ts +4 -1
  139. package/src/api/parameters/publishSharedDraft.ts +4 -1
  140. package/src/api/parameters/searchByCQL.ts +34 -0
  141. package/src/api/parameters/searchGroups.ts +8 -0
  142. package/src/api/parameters/searchUser.ts +20 -0
  143. package/src/api/parameters/updateTaskById.ts +6 -0
  144. package/src/api/relation.ts +33 -8
  145. package/src/api/search.ts +53 -73
  146. package/src/api/settings.ts +6 -3
  147. package/src/api/space.ts +3 -0
  148. package/src/api/spacePermissions.ts +66 -8
  149. package/src/api/spaceProperties.ts +5 -4
  150. package/src/clients/baseClient.ts +2 -2
  151. package/src/clients/confluenceClient.ts +2 -0
@@ -56,6 +56,20 @@ export class Relation {
56
56
  return this.client.sendRequest(config, callback, { methodName: 'findTargetFromSource' });
57
57
  }
58
58
 
59
+ /** @deprecated Will be removed in the next major version. Use `getRelationship` instead. */
60
+ async GetRelationship<T = Models.Relation>(
61
+ parameters: Parameters.GetRelationship,
62
+ callback: Callback<T>
63
+ ): Promise<void>;
64
+ /** @deprecated Will be removed in the next major version. Use `getRelationship` instead. */
65
+ async GetRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback?: never): Promise<T>;
66
+ async GetRelationship<T = Models.Relation>(
67
+ parameters: Parameters.GetRelationship,
68
+ callback?: Callback<T>,
69
+ ): Promise<void | T> {
70
+ return this.getRelationship(parameters, callback!);
71
+ }
72
+
59
73
  /**
60
74
  * Find whether a particular type of relationship exists from a source entity to a target entity. Note, relationships
61
75
  * are one way.
@@ -67,7 +81,7 @@ export class Relation {
67
81
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view both the target entity
68
82
  * and source entity.
69
83
  */
70
- async GetRelationship<T = Models.Relation>(
84
+ async getRelationship<T = Models.Relation>(
71
85
  parameters: Parameters.GetRelationship,
72
86
  callback: Callback<T>
73
87
  ): Promise<void>;
@@ -82,8 +96,8 @@ export class Relation {
82
96
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view both the target entity
83
97
  * and source entity.
84
98
  */
85
- async GetRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback?: never): Promise<T>;
86
- async GetRelationship<T = Models.Relation>(
99
+ async getRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback?: never): Promise<T>;
100
+ async getRelationship<T = Models.Relation>(
87
101
  parameters: Parameters.GetRelationship,
88
102
  callback?: Callback<T>,
89
103
  ): Promise<void | T> {
@@ -99,7 +113,7 @@ export class Relation {
99
113
  },
100
114
  };
101
115
 
102
- return this.client.sendRequest(config, callback, { methodName: 'GetRelationship' });
116
+ return this.client.sendRequest(config, callback, { methodName: 'getRelationship' });
103
117
  }
104
118
 
105
119
  /**
@@ -148,6 +162,14 @@ export class Relation {
148
162
  return this.client.sendRequest(config, callback, { methodName: 'createRelationship' });
149
163
  }
150
164
 
165
+ /** @deprecated Will be removed in the next major version. Use `deleteRelationship` instead. */
166
+ async delete<T = void>(parameters: Parameters.Delete, callback: Callback<T>): Promise<void>;
167
+ /** @deprecated Will be removed in the next major version. Use `deleteRelationship` instead. */
168
+ async delete<T = void>(parameters: Parameters.Delete, callback?: never): Promise<T>;
169
+ async delete<T = void>(parameters: Parameters.Delete, callback?: Callback<T>): Promise<void | T> {
170
+ return this.deleteRelationship(parameters, callback!);
171
+ }
172
+
151
173
  /**
152
174
  * Deletes a relationship between two entities (user, space, content).
153
175
  *
@@ -155,7 +177,7 @@ export class Relation {
155
177
  * ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite
156
178
  * relationships. A space administrator can delete favourite relationships for any user.
157
179
  */
158
- async delete<T = void>(parameters: Parameters.Delete, callback: Callback<T>): Promise<void>;
180
+ async deleteRelationship<T = void>(parameters: Parameters.DeleteRelationship, callback: Callback<T>): Promise<void>;
159
181
  /**
160
182
  * Deletes a relationship between two entities (user, space, content).
161
183
  *
@@ -163,8 +185,11 @@ export class Relation {
163
185
  * ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite
164
186
  * relationships. A space administrator can delete favourite relationships for any user.
165
187
  */
166
- async delete<T = void>(parameters: Parameters.Delete, callback?: never): Promise<T>;
167
- async delete<T = void>(parameters: Parameters.Delete, callback?: Callback<T>): Promise<void | T> {
188
+ async deleteRelationship<T = void>(parameters: Parameters.DeleteRelationship, callback?: never): Promise<T>;
189
+ async deleteRelationship<T = void>(
190
+ parameters: Parameters.DeleteRelationship,
191
+ callback?: Callback<T>,
192
+ ): Promise<void | T> {
168
193
  const config: RequestConfig = {
169
194
  url: `/api/relation/${parameters.relationName}/from/${parameters.sourceType}/${parameters.sourceKey}/to/${parameters.targetType}/${parameters.targetKey}`,
170
195
  method: 'DELETE',
@@ -176,7 +201,7 @@ export class Relation {
176
201
  },
177
202
  };
178
203
 
179
- return this.client.sendRequest(config, callback, { methodName: 'delete' });
204
+ return this.client.sendRequest(config, callback, { methodName: 'deleteRelationship' });
180
205
  }
181
206
 
182
207
  /**
package/src/api/search.ts CHANGED
@@ -7,95 +7,52 @@ import { RequestConfig } from '../requestConfig';
7
7
  export class Search {
8
8
  constructor(private client: Client) {}
9
9
 
10
+ /** @deprecated Will be removed in the next major version. Use `searchByCQL` instead. */
11
+ async search<T = Models.SearchPageResponseSearchResult>(
12
+ parameters: Parameters.Search,
13
+ callback: Callback<T>
14
+ ): Promise<void>;
15
+ /** @deprecated Will be removed in the next major version. Use `searchByCQL` instead. */
16
+ async search<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.Search, callback?: never): Promise<T>;
17
+ async search<T = Models.SearchPageResponseSearchResult>(
18
+ parameters: Parameters.Search,
19
+ callback?: Callback<T>,
20
+ ): Promise<void | T> {
21
+ return this.searchByCQL(parameters, callback!);
22
+ }
23
+
10
24
  /**
11
25
  * Searches for content using the [Confluence Query Language
12
26
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/)
13
27
  *
14
- * Example initial call:
15
- *
16
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25
17
- *
18
- * Example response:
19
- *
20
- * {
21
- * "results": [
22
- * { ... },
23
- * { ... },
24
- * ...
25
- * { ... }
26
- * ],
27
- * "limit": 25,
28
- * "size": 25,
29
- * ...
30
- * "_links": {
31
- * "base": "<url>",
32
- * "context": "<url>",
33
- * "next": "/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
34
- * "self": "<url>"
35
- * }
36
- * }
37
- *
38
28
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
39
29
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
40
30
  * results returned in each call.
41
31
  *
42
- * Example subsequent call (taken from example response):
43
- *
44
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
45
- *
46
- * The response to this will have a `prev` URL similar to the `next` in the example response.
47
- *
48
32
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the entities. Note, only
49
33
  * entities that the user has permission to view will be returned.
50
34
  */
51
- async search<T = Models.SearchPageResponseSearchResult>(
52
- parameters: Parameters.Search,
35
+ async searchByCQL<T = Models.SearchPageResponseSearchResult>(
36
+ parameters: Parameters.SearchByCQL,
53
37
  callback: Callback<T>
54
38
  ): Promise<void>;
55
39
  /**
56
40
  * Searches for content using the [Confluence Query Language
57
41
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/)
58
42
  *
59
- * Example initial call:
60
- *
61
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25
62
- *
63
- * Example response:
64
- *
65
- * {
66
- * "results": [
67
- * { ... },
68
- * { ... },
69
- * ...
70
- * { ... }
71
- * ],
72
- * "limit": 25,
73
- * "size": 25,
74
- * ...
75
- * "_links": {
76
- * "base": "<url>",
77
- * "context": "<url>",
78
- * "next": "/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
79
- * "self": "<url>"
80
- * }
81
- * }
82
- *
83
43
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
84
44
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
85
45
  * results returned in each call.
86
46
  *
87
- * Example subsequent call (taken from example response):
88
- *
89
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
90
- *
91
- * The response to this will have a `prev` URL similar to the `next` in the example response.
92
- *
93
47
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the entities. Note, only
94
48
  * entities that the user has permission to view will be returned.
95
49
  */
96
- async search<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.Search, callback?: never): Promise<T>;
97
- async search<T = Models.SearchPageResponseSearchResult>(
98
- parameters: Parameters.Search,
50
+ async searchByCQL<T = Models.SearchPageResponseSearchResult>(
51
+ parameters: Parameters.SearchByCQL,
52
+ callback?: never
53
+ ): Promise<T>;
54
+ async searchByCQL<T = Models.SearchPageResponseSearchResult>(
55
+ parameters: Parameters.SearchByCQL,
99
56
  callback?: Callback<T>,
100
57
  ): Promise<void | T> {
101
58
  const config: RequestConfig = {
@@ -105,14 +62,37 @@ export class Search {
105
62
  cql: parameters.cql,
106
63
  cqlcontext: parameters.cqlcontext,
107
64
  cursor: parameters.cursor,
65
+ next: parameters.next,
66
+ prev: parameters.prev,
108
67
  limit: parameters.limit,
68
+ start: parameters.start,
109
69
  includeArchivedSpaces: parameters.includeArchivedSpaces,
70
+ excludeCurrentSpaces: parameters.excludeCurrentSpaces,
71
+ excerpt: parameters.excerpt,
72
+ sitePermissionTypeFilter: parameters.sitePermissionTypeFilter,
73
+ expand: parameters.expand,
110
74
  },
111
75
  };
112
76
 
113
- return this.client.sendRequest(config, callback, { methodName: 'search' });
77
+ return this.client.sendRequest(config, callback, { methodName: 'searchByCQL' });
114
78
  }
115
79
 
80
+ /** @deprecated Will be removed in the next major version. Use `searchUser` instead. */
81
+ async userSearch<T = Models.SearchPageResponseSearchResult>(
82
+ parameters: Parameters.UserSearch,
83
+ callback: Callback<T>
84
+ ): Promise<void>;
85
+ /** @deprecated Will be removed in the next major version. Use `searchUser` instead. */
86
+ async userSearch<T = Models.SearchPageResponseSearchResult>(
87
+ parameters: Parameters.UserSearch,
88
+ callback?: never
89
+ ): Promise<T>;
90
+ async userSearch<T = Models.SearchPageResponseSearchResult>(
91
+ parameters: Parameters.UserSearch,
92
+ callback?: Callback<T>,
93
+ ): Promise<void | T> {
94
+ return this.searchUser(parameters, callback!);
95
+ }
116
96
  /**
117
97
  * Searches for users using user-specific queries from the [Confluence Query Language
118
98
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
@@ -120,8 +100,8 @@ export class Search {
120
100
  * Note that some user fields may be set to null depending on the user's privacy settings. These are: email,
121
101
  * profilePicture, and displayName.
122
102
  */
123
- async userSearch<T = Models.SearchPageResponseSearchResult>(
124
- parameters: Parameters.UserSearch,
103
+ async searchUser<T = Models.SearchPageResponseSearchResult>(
104
+ parameters: Parameters.SearchUser,
125
105
  callback: Callback<T>
126
106
  ): Promise<void>;
127
107
  /**
@@ -131,12 +111,12 @@ export class Search {
131
111
  * Note that some user fields may be set to null depending on the user's privacy settings. These are: email,
132
112
  * profilePicture, and displayName.
133
113
  */
134
- async userSearch<T = Models.SearchPageResponseSearchResult>(
135
- parameters: Parameters.UserSearch,
114
+ async searchUser<T = Models.SearchPageResponseSearchResult>(
115
+ parameters: Parameters.SearchUser,
136
116
  callback?: never
137
117
  ): Promise<T>;
138
- async userSearch<T = Models.SearchPageResponseSearchResult>(
139
- parameters: Parameters.UserSearch,
118
+ async searchUser<T = Models.SearchPageResponseSearchResult>(
119
+ parameters: Parameters.SearchUser,
140
120
  callback?: Callback<T>,
141
121
  ): Promise<void | T> {
142
122
  const config: RequestConfig = {
@@ -149,6 +129,6 @@ export class Search {
149
129
  },
150
130
  };
151
131
 
152
- return this.client.sendRequest(config, callback, { methodName: 'search' });
132
+ return this.client.sendRequest(config, callback, { methodName: 'searchUser' });
153
133
  }
154
134
  }
@@ -93,7 +93,7 @@ export class Settings {
93
93
  *
94
94
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
95
95
  */
96
- async updateLookAndFeelSettings<T = Models.LookAndFeelUpdated>(
96
+ async updateLookAndFeelSettings<T = Models.LookAndFeel>(
97
97
  parameters: Parameters.UpdateLookAndFeelSettings | undefined,
98
98
  callback: Callback<T>
99
99
  ): Promise<void>;
@@ -106,11 +106,11 @@ export class Settings {
106
106
  *
107
107
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
108
108
  */
109
- async updateLookAndFeelSettings<T = Models.LookAndFeelUpdated>(
109
+ async updateLookAndFeelSettings<T = Models.LookAndFeel>(
110
110
  parameters?: Parameters.UpdateLookAndFeelSettings,
111
111
  callback?: never
112
112
  ): Promise<T>;
113
- async updateLookAndFeelSettings<T = Models.LookAndFeelUpdated>(
113
+ async updateLookAndFeelSettings<T = Models.LookAndFeel>(
114
114
  parameters?: Parameters.UpdateLookAndFeelSettings,
115
115
  callback?: Callback<T>,
116
116
  ): Promise<void | T> {
@@ -125,8 +125,11 @@ export class Settings {
125
125
  links: parameters?.links,
126
126
  menus: parameters?.menus,
127
127
  header: parameters?.header,
128
+ horizontalHeader: parameters?.horizontalHeader,
128
129
  content: parameters?.content,
129
130
  bordersAndDividers: parameters?.bordersAndDividers,
131
+ spaceReference: parameters?.spaceReference,
132
+ _links: parameters?.links,
130
133
  },
131
134
  };
132
135
 
package/src/api/space.ts CHANGED
@@ -106,6 +106,7 @@ export class Space {
106
106
  key: parameters?.key,
107
107
  name: parameters?.name,
108
108
  description: parameters?.description,
109
+ permissions: parameters?.permissions,
109
110
  },
110
111
  };
111
112
 
@@ -159,6 +160,8 @@ export class Space {
159
160
  name: parameters.name,
160
161
  description: parameters.description,
161
162
  homepage: parameters.homepage,
163
+ type: parameters.type,
164
+ status: parameters.status,
162
165
  },
163
166
  };
164
167
 
@@ -7,6 +7,20 @@ import { RequestConfig } from '../requestConfig';
7
7
  export class SpacePermissions {
8
8
  constructor(private client: Client) {}
9
9
 
10
+ /** @deprecated Will be removed in the next major version. Use `addPermissionToSpace` instead. */
11
+ async addPermission<T = Models.SpacePermissionV2>(
12
+ parameters: Parameters.AddPermission,
13
+ callback: Callback<T>
14
+ ): Promise<void>;
15
+ /** @deprecated Will be removed in the next major version. Use `addPermissionToSpace` instead. */
16
+ async addPermission<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermission, callback?: never): Promise<T>;
17
+ async addPermission<T = Models.SpacePermissionV2>(
18
+ parameters: Parameters.AddPermission,
19
+ callback?: Callback<T>,
20
+ ): Promise<void | T> {
21
+ return this.addPermissionToSpace(parameters, callback!);
22
+ }
23
+
10
24
  /**
11
25
  * Adds new permission to space.
12
26
  *
@@ -16,8 +30,8 @@ export class SpacePermissions {
16
30
  *
17
31
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
18
32
  */
19
- async addPermission<T = Models.SpacePermissionV2>(
20
- parameters: Parameters.AddPermission,
33
+ async addPermissionToSpace<T = Models.SpacePermissionV2>(
34
+ parameters: Parameters.AddPermissionToSpace,
21
35
  callback: Callback<T>
22
36
  ): Promise<void>;
23
37
  /**
@@ -29,23 +43,67 @@ export class SpacePermissions {
29
43
  *
30
44
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
31
45
  */
32
- async addPermission<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermission, callback?: never): Promise<T>;
33
- async addPermission<T = Models.SpacePermissionV2>(
34
- parameters: Parameters.AddPermission,
46
+ async addPermissionToSpace<T = Models.SpacePermissionV2>(
47
+ parameters: Parameters.AddPermissionToSpace,
48
+ callback?: never
49
+ ): Promise<T>;
50
+ async addPermissionToSpace<T = Models.SpacePermissionV2>(
51
+ parameters: Parameters.AddPermissionToSpace,
35
52
  callback?: Callback<T>,
36
53
  ): Promise<void | T> {
37
54
  const config: RequestConfig = {
38
55
  url: `/api/space/${parameters.spaceKey}/permission`,
39
56
  method: 'POST',
40
57
  data: {
41
- id: parameters.id,
42
58
  subject: parameters.subject,
43
59
  operation: parameters.operation,
44
- _links: parameters._links,
60
+ _links: parameters.links,
61
+ },
62
+ };
63
+
64
+ return this.client.sendRequest(config, callback, { methodName: 'addPermissionToSpace' });
65
+ }
66
+
67
+ /**
68
+ * Adds new custom content permission to space.
69
+ *
70
+ * If the permission to be added is a group permission, the group can be identified by its group name or group id.
71
+ *
72
+ * Note: Only apps can access this REST resource and only make changes to the respective app permissions.
73
+ *
74
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
75
+ */
76
+ async addCustomContentPermissions<T = unknown>(
77
+ parameters: Parameters.AddCustomContentPermissions,
78
+ callback: Callback<T>
79
+ ): Promise<void>;
80
+ /**
81
+ * Adds new custom content permission to space.
82
+ *
83
+ * If the permission to be added is a group permission, the group can be identified by its group name or group id.
84
+ *
85
+ * Note: Only apps can access this REST resource and only make changes to the respective app permissions.
86
+ *
87
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
88
+ */
89
+ async addCustomContentPermissions<T = unknown>(
90
+ parameters: Parameters.AddCustomContentPermissions,
91
+ callback?: never
92
+ ): Promise<T>;
93
+ async addCustomContentPermissions<T = unknown>(
94
+ parameters: Parameters.AddCustomContentPermissions,
95
+ callback?: Callback<T>,
96
+ ): Promise<void | T> {
97
+ const config: RequestConfig = {
98
+ url: `/api/space/${parameters.spaceKey}/permission/custom-content`,
99
+ method: 'POST',
100
+ data: {
101
+ subject: parameters.subject,
102
+ operations: parameters.operations,
45
103
  },
46
104
  };
47
105
 
48
- return this.client.sendRequest(config, callback, { methodName: 'addPermission' });
106
+ return this.client.sendRequest(config, callback, { methodName: 'addCustomContentPermissions' });
49
107
  }
50
108
 
51
109
  /**
@@ -70,6 +70,7 @@ export class SpaceProperties {
70
70
  data: {
71
71
  key: parameters.key,
72
72
  value: parameters.value,
73
+ space: parameters.space,
73
74
  },
74
75
  };
75
76
 
@@ -110,8 +111,8 @@ export class SpaceProperties {
110
111
  }
111
112
 
112
113
  /**
113
- * Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
114
- * 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 /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.
115
116
  *
116
117
  * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
117
118
  */
@@ -120,8 +121,8 @@ export class SpaceProperties {
120
121
  callback: Callback<T>
121
122
  ): Promise<void>;
122
123
  /**
123
- * Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
124
- * 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 /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.
125
126
  *
126
127
  * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
127
128
  */
@@ -101,8 +101,8 @@ export class BaseClient implements Client {
101
101
  bodyExists: !!requestConfig.data,
102
102
  callbackUsed: !!callback,
103
103
  headersExists: !!requestConfig.headers,
104
- libVersion: '1.1.3',
105
- libVersionHash: '6d8c23a768aec9eefc52917e68aa3926',
104
+ libVersion: '1.2.0',
105
+ libVersionHash: '0ba4439ee9a46d9d9f14c60f88f45f87',
106
106
  methodName: telemetryData?.methodName || 'sendRequest',
107
107
  onErrorMiddlewareUsed: !!this.config.middlewares?.onError,
108
108
  onResponseMiddlewareUsed: !!this.config.middlewares?.onResponse,
@@ -14,6 +14,7 @@ import {
14
14
  ContentVersions,
15
15
  ContentWatches,
16
16
  DynamicModules,
17
+ Experimental,
17
18
  Group,
18
19
  InlineTasks,
19
20
  LabelInfo,
@@ -45,6 +46,7 @@ export class ConfluenceClient extends BaseClient {
45
46
  contentVersions = new ContentVersions(this);
46
47
  contentWatches = new ContentWatches(this);
47
48
  dynamicModules = new DynamicModules(this);
49
+ experimental = new Experimental(this);
48
50
  group = new Group(this);
49
51
  inlineTasks = new InlineTasks(this);
50
52
  labelInfo = new LabelInfo(this);