confluence.js 1.1.3 → 1.3.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 (188) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +1 -57
  3. package/out/api/content.d.ts +24 -52
  4. package/out/api/content.js +15 -0
  5. package/out/api/contentAttachments.d.ts +10 -6
  6. package/out/api/contentAttachments.js +13 -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 +2 -0
  12. package/out/api/contentWatches.d.ts +2 -2
  13. package/out/api/experimental.d.ts +52 -0
  14. package/out/api/experimental.js +70 -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/addLabelsToSpace.d.ts +4 -0
  48. package/out/api/parameters/addLabelsToSpace.js +2 -0
  49. package/out/api/parameters/addPermissionToSpace.d.ts +5 -0
  50. package/out/api/parameters/addPermissionToSpace.js +2 -0
  51. package/out/api/parameters/addUserToGroup.d.ts +2 -1
  52. package/out/api/parameters/addUserToGroupByGroupId.d.ts +2 -1
  53. package/out/api/parameters/archivePages.d.ts +6 -0
  54. package/out/api/parameters/archivePages.js +2 -0
  55. package/out/api/parameters/checkContentPermission.d.ts +5 -0
  56. package/out/api/parameters/checkContentPermission.js +2 -0
  57. package/out/api/parameters/deleteLabelFromSpace.d.ts +8 -0
  58. package/out/api/parameters/deleteLabelFromSpace.js +2 -0
  59. package/out/api/parameters/deleteRelationship.d.ts +38 -0
  60. package/out/api/parameters/deleteRelationship.js +2 -0
  61. package/out/api/parameters/downloadAttachment.d.ts +11 -0
  62. package/out/api/parameters/downloadAttachment.js +2 -0
  63. package/out/api/parameters/getBulkUserLookup.d.ts +0 -6
  64. package/out/api/parameters/getContentById.d.ts +85 -1
  65. package/out/api/parameters/getContentById.js +87 -0
  66. package/out/api/parameters/getContentChildren.d.ts +1 -0
  67. package/out/api/parameters/getContentProperties.d.ts +2 -0
  68. package/out/api/parameters/getContentProperty.d.ts +12 -0
  69. package/out/api/parameters/getContentVersions.d.ts +1 -1
  70. package/out/api/parameters/getCurrentUser.d.ts +1 -6
  71. package/out/api/parameters/getDescendantsOfType.d.ts +101 -0
  72. package/out/api/parameters/getDescendantsOfType.js +89 -0
  73. package/out/api/parameters/getGroupByName.d.ts +4 -0
  74. package/out/api/parameters/getGroupByName.js +2 -0
  75. package/out/api/parameters/getGroups.d.ts +2 -0
  76. package/out/api/parameters/getHistoryForContent.d.ts +1 -1
  77. package/out/api/parameters/getLabelsForSpace.d.ts +18 -0
  78. package/out/api/parameters/getLabelsForSpace.js +2 -0
  79. package/out/api/parameters/getTaskById.d.ts +4 -0
  80. package/out/api/parameters/getTaskById.js +2 -0
  81. package/out/api/parameters/getViewers.d.ts +6 -0
  82. package/out/api/parameters/getViewers.js +2 -0
  83. package/out/api/parameters/getViews.d.ts +6 -0
  84. package/out/api/parameters/getViews.js +2 -0
  85. package/out/api/parameters/index.d.ts +134 -116
  86. package/out/api/parameters/index.js +134 -116
  87. package/out/api/parameters/publishLegacyDraft.d.ts +3 -1
  88. package/out/api/parameters/publishSharedDraft.d.ts +3 -1
  89. package/out/api/parameters/restoreContentVersion.d.ts +1 -1
  90. package/out/api/parameters/searchByCQL.d.ts +34 -0
  91. package/out/api/parameters/searchByCQL.js +2 -0
  92. package/out/api/parameters/searchGroups.d.ts +8 -0
  93. package/out/api/parameters/searchGroups.js +2 -0
  94. package/out/api/parameters/searchUser.d.ts +27 -0
  95. package/out/api/parameters/searchUser.js +2 -0
  96. package/out/api/parameters/updateTaskById.d.ts +5 -0
  97. package/out/api/parameters/updateTaskById.js +2 -0
  98. package/out/api/relation.d.ts +12 -4
  99. package/out/api/relation.js +12 -2
  100. package/out/api/search.d.ts +12 -64
  101. package/out/api/search.js +19 -2
  102. package/out/api/settings.d.ts +2 -2
  103. package/out/api/settings.js +3 -0
  104. package/out/api/space.js +5 -1
  105. package/out/api/spacePermissions.d.ts +26 -2
  106. package/out/api/spacePermissions.js +20 -3
  107. package/out/api/spaceProperties.d.ts +4 -4
  108. package/out/api/spaceProperties.js +1 -0
  109. package/out/api/template.d.ts +24 -16
  110. package/out/clients/baseClient.d.ts +2 -5
  111. package/out/clients/baseClient.js +4 -30
  112. package/out/clients/client.d.ts +2 -3
  113. package/out/clients/confluenceClient.d.ts +2 -1
  114. package/out/clients/confluenceClient.js +1 -0
  115. package/out/config.d.ts +3 -2
  116. package/out/index.d.ts +1 -0
  117. package/out/index.js +2 -1
  118. package/package.json +24 -24
  119. package/src/api/content.ts +58 -52
  120. package/src/api/contentAttachments.ts +29 -6
  121. package/src/api/contentChildrenAndDescendants.ts +24 -28
  122. package/src/api/contentPermissions.ts +24 -7
  123. package/src/api/contentProperties.ts +2 -0
  124. package/src/api/contentWatches.ts +3 -3
  125. package/src/api/experimental.ts +137 -0
  126. package/src/api/group.ts +71 -19
  127. package/src/api/index.ts +1 -0
  128. package/src/api/inlineTasks.ts +52 -0
  129. package/src/api/models/getViewers.ts +6 -0
  130. package/src/api/models/getViews.ts +6 -0
  131. package/src/api/models/groupCreate.ts +4 -0
  132. package/src/api/models/horizontalHeaderLookAndFeel.ts +12 -0
  133. package/src/api/models/index.ts +13 -4
  134. package/src/api/models/lookAndFeel.ts +3 -0
  135. package/src/api/models/spacePermissionCreate.ts +34 -0
  136. package/src/api/models/spacePermissionCustomContent.ts +17 -0
  137. package/src/api/models/spacePermissionRequest.ts +42 -0
  138. package/src/api/models/spacePrivateCreate.ts +9 -0
  139. package/src/api/models/spacePropertyCreate.ts +4 -0
  140. package/src/api/models/spaceUpdate.ts +4 -0
  141. package/src/api/models/taskStatusUpdate.ts +3 -0
  142. package/src/api/models/topNavigationLookAndFeel.ts +8 -0
  143. package/src/api/parameters/addCustomContentPermissions.ts +6 -0
  144. package/src/api/parameters/addLabelsToSpace.ts +4 -0
  145. package/src/api/parameters/addPermissionToSpace.ts +6 -0
  146. package/src/api/parameters/addUserToGroup.ts +3 -1
  147. package/src/api/parameters/addUserToGroupByGroupId.ts +3 -1
  148. package/src/api/parameters/archivePages.ts +6 -0
  149. package/src/api/parameters/checkContentPermission.ts +6 -0
  150. package/src/api/parameters/deleteLabelFromSpace.ts +8 -0
  151. package/src/api/parameters/deleteRelationship.ts +38 -0
  152. package/src/api/parameters/downloadAttachment.ts +11 -0
  153. package/src/api/parameters/getBulkUserLookup.ts +0 -6
  154. package/src/api/parameters/getContentById.ts +86 -1
  155. package/src/api/parameters/getContentChildren.ts +1 -0
  156. package/src/api/parameters/getContentProperties.ts +2 -0
  157. package/src/api/parameters/getContentProperty.ts +12 -0
  158. package/src/api/parameters/getContentVersions.ts +1 -1
  159. package/src/api/parameters/getCurrentUser.ts +1 -6
  160. package/src/api/parameters/getDescendantsOfType.ts +102 -0
  161. package/src/api/parameters/getGroupByName.ts +4 -0
  162. package/src/api/parameters/getGroups.ts +2 -0
  163. package/src/api/parameters/getHistoryForContent.ts +1 -1
  164. package/src/api/parameters/getLabelsForSpace.ts +18 -0
  165. package/src/api/parameters/getTaskById.ts +4 -0
  166. package/src/api/parameters/getViewers.ts +6 -0
  167. package/src/api/parameters/getViews.ts +6 -0
  168. package/src/api/parameters/index.ts +134 -116
  169. package/src/api/parameters/publishLegacyDraft.ts +4 -1
  170. package/src/api/parameters/publishSharedDraft.ts +4 -1
  171. package/src/api/parameters/restoreContentVersion.ts +1 -1
  172. package/src/api/parameters/searchByCQL.ts +34 -0
  173. package/src/api/parameters/searchGroups.ts +8 -0
  174. package/src/api/parameters/searchUser.ts +27 -0
  175. package/src/api/parameters/updateTaskById.ts +6 -0
  176. package/src/api/relation.ts +33 -8
  177. package/src/api/search.ts +53 -73
  178. package/src/api/settings.ts +6 -3
  179. package/src/api/space.ts +4 -1
  180. package/src/api/spacePermissions.ts +66 -8
  181. package/src/api/spaceProperties.ts +5 -4
  182. package/src/api/template.ts +24 -16
  183. package/src/clients/baseClient.ts +4 -60
  184. package/src/clients/client.ts +2 -3
  185. package/src/clients/confluenceClient.ts +2 -0
  186. package/src/config.ts +3 -2
  187. package/src/index.ts +1 -0
  188. package/tsconfig.json +2 -1
@@ -3,7 +3,7 @@ export interface RestoreContentVersion extends VersionRestore {
3
3
  /** The ID of the content for which the history will be restored. */
4
4
  id: string;
5
5
  /**
6
- * A multi-value parameter indicating which properties of the returned content to expand.
6
+ * A multi-value parameter indicating which properties of the content to expand. By default, the `content` object is expanded.
7
7
  *
8
8
  * - `collaborators` returns the users that collaborated on the version.
9
9
  * - `content` returns the content for the version.
@@ -0,0 +1,34 @@
1
+ export interface SearchByCQL {
2
+ /**
3
+ * The CQL query to be used for the search. See [Advanced Searching using
4
+ * CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/) for instructions on how to
5
+ * build a CQL query.
6
+ */
7
+ cql: string;
8
+ /**
9
+ * The space, content, and content status to execute the search against.
10
+ *
11
+ * - `spaceKey` Key of the space to search against. Optional.
12
+ * - `contentId` ID of the content to search against. Optional. Must be in the space specified by `spaceKey`.
13
+ * - `contentStatuses` Content statuses to search against. Optional.
14
+ *
15
+ * Specify these values in an object. For example, `cqlcontext={%22spaceKey%22:%22TEST%22, %22contentId%22:%22123%22}`
16
+ */
17
+ cqlcontext?: string;
18
+ /** Pointer to a set of search results, returned as part of the `next` or `prev` URL from the previous search call. */
19
+ cursor?: string;
20
+ next?: boolean;
21
+ prev?: boolean;
22
+ /** The maximum number of content objects to return per page. Note, this may be restricted by fixed system limits. */
23
+ limit?: number;
24
+ /** The start point of the collection to return */
25
+ start?: number;
26
+ /** Whether to include content from archived spaces in the results. */
27
+ includeArchivedSpaces?: boolean;
28
+ /** Whether to exclude current spaces and only show archived spaces. */
29
+ excludeCurrentSpaces?: boolean;
30
+ /** The excerpt strategy to apply to the result */
31
+ excerpt?: string;
32
+ sitePermissionTypeFilter?: string;
33
+ expand?: string[];
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface SearchGroups {
2
+ /** The search term used to query results. */
3
+ query: string;
4
+ /** The starting index of the returned groups. */
5
+ start?: number;
6
+ /** The maximum number of groups to return per page. Note, this is restricted to a maximum limit of 200 groups. */
7
+ limit?: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ export interface SearchUser {
2
+ /**
3
+ * The CQL query to be used for the search. See [Advanced Searching using
4
+ * CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/) for instructions on how to
5
+ * build a CQL query.
6
+ *
7
+ * Example queries:
8
+ * - cql=type=user will return all users
9
+ * - cql=user=“1234” will return user with accountId “1234”
10
+ * - You can also use IN, NOT IN, != operators
11
+ * - cql=user IN (“12”, “34") will return users with accountids “12” and “34”
12
+ * - cql=user.fullname~jo will return users with nickname/full name starting with “jo”
13
+ * - cql=user.accountid=“123” will return user with accountId “123”
14
+ */
15
+ cql: string;
16
+ /** The starting index of the returned users. */
17
+ start?: number;
18
+ /** The maximum number of user objects to return per page. Note, this may be restricted by fixed system limits. */
19
+ limit?: number;
20
+ /**
21
+ * A multi-value parameter indicating which properties of the user to expand.
22
+ *
23
+ * - `operations` returns the operations for the user, which are used when setting permissions.
24
+ * - `personalSpace` returns the personal space of the user.
25
+ */
26
+ expand?: string[];
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { TaskStatusUpdate } from '../models';
2
+ export interface UpdateTaskById extends TaskStatusUpdate {
3
+ /** Global ID of the inline task to update */
4
+ inlineTaskId: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -27,6 +27,10 @@ export declare class Relation {
27
27
  * and source entity.
28
28
  */
29
29
  findTargetFromSource<T = Models.RelationArray>(parameters: Parameters.FindTargetFromSource, callback?: never): Promise<T>;
30
+ /** @deprecated Will be removed in the next major version. Use `getRelationship` instead. */
31
+ GetRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback: Callback<T>): Promise<void>;
32
+ /** @deprecated Will be removed in the next major version. Use `getRelationship` instead. */
33
+ GetRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback?: never): Promise<T>;
30
34
  /**
31
35
  * Find whether a particular type of relationship exists from a source entity to a target entity. Note, relationships
32
36
  * are one way.
@@ -38,7 +42,7 @@ export declare class Relation {
38
42
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view both the target entity
39
43
  * and source entity.
40
44
  */
41
- GetRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback: Callback<T>): Promise<void>;
45
+ getRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback: Callback<T>): Promise<void>;
42
46
  /**
43
47
  * Find whether a particular type of relationship exists from a source entity to a target entity. Note, relationships
44
48
  * are one way.
@@ -50,7 +54,7 @@ export declare class Relation {
50
54
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view both the target entity
51
55
  * and source entity.
52
56
  */
53
- GetRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback?: never): Promise<T>;
57
+ getRelationship<T = Models.Relation>(parameters: Parameters.GetRelationship, callback?: never): Promise<T>;
54
58
  /**
55
59
  * Creates a relationship between two entities (user, space, content). The 'favourite' relationship is supported by
56
60
  * default, but you can use this method to create any type of relationship between two entities.
@@ -73,6 +77,10 @@ export declare class Relation {
73
77
  * ('Can use' global permission).
74
78
  */
75
79
  createRelationship<T = Models.Relation>(parameters: Parameters.CreateRelationship, callback?: never): Promise<T>;
80
+ /** @deprecated Will be removed in the next major version. Use `deleteRelationship` instead. */
81
+ delete<T = void>(parameters: Parameters.Delete, callback: Callback<T>): Promise<void>;
82
+ /** @deprecated Will be removed in the next major version. Use `deleteRelationship` instead. */
83
+ delete<T = void>(parameters: Parameters.Delete, callback?: never): Promise<T>;
76
84
  /**
77
85
  * Deletes a relationship between two entities (user, space, content).
78
86
  *
@@ -80,7 +88,7 @@ export declare class Relation {
80
88
  * ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite
81
89
  * relationships. A space administrator can delete favourite relationships for any user.
82
90
  */
83
- delete<T = void>(parameters: Parameters.Delete, callback: Callback<T>): Promise<void>;
91
+ deleteRelationship<T = void>(parameters: Parameters.DeleteRelationship, callback: Callback<T>): Promise<void>;
84
92
  /**
85
93
  * Deletes a relationship between two entities (user, space, content).
86
94
  *
@@ -88,7 +96,7 @@ export declare class Relation {
88
96
  * ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite
89
97
  * relationships. A space administrator can delete favourite relationships for any user.
90
98
  */
91
- delete<T = void>(parameters: Parameters.Delete, callback?: never): Promise<T>;
99
+ deleteRelationship<T = void>(parameters: Parameters.DeleteRelationship, callback?: never): Promise<T>;
92
100
  /**
93
101
  * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
94
102
  *
@@ -25,6 +25,11 @@ class Relation {
25
25
  });
26
26
  }
27
27
  GetRelationship(parameters, callback) {
28
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
29
+ return this.getRelationship(parameters, callback);
30
+ });
31
+ }
32
+ getRelationship(parameters, callback) {
28
33
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
29
34
  const config = {
30
35
  url: `/api/relation/${parameters.relationName}/from/${parameters.sourceType}/${parameters.sourceKey}/to/${parameters.targetType}/${parameters.targetKey}`,
@@ -37,7 +42,7 @@ class Relation {
37
42
  expand: parameters.expand,
38
43
  },
39
44
  };
40
- return this.client.sendRequest(config, callback, { methodName: 'GetRelationship' });
45
+ return this.client.sendRequest(config, callback, { methodName: 'getRelationship' });
41
46
  });
42
47
  }
43
48
  createRelationship(parameters, callback) {
@@ -56,6 +61,11 @@ class Relation {
56
61
  });
57
62
  }
58
63
  delete(parameters, callback) {
64
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
65
+ return this.deleteRelationship(parameters, callback);
66
+ });
67
+ }
68
+ deleteRelationship(parameters, callback) {
59
69
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
60
70
  const config = {
61
71
  url: `/api/relation/${parameters.relationName}/from/${parameters.sourceType}/${parameters.sourceKey}/to/${parameters.targetType}/${parameters.targetKey}`,
@@ -67,7 +77,7 @@ class Relation {
67
77
  targetVersion: parameters.targetVersion,
68
78
  },
69
79
  };
70
- return this.client.sendRequest(config, callback, { methodName: 'delete' });
80
+ return this.client.sendRequest(config, callback, { methodName: 'deleteRelationship' });
71
81
  });
72
82
  }
73
83
  findSourcesForTarget(parameters, callback) {
@@ -5,90 +5,38 @@ import { Callback } from '../callback';
5
5
  export declare class Search {
6
6
  private client;
7
7
  constructor(client: Client);
8
+ /** @deprecated Will be removed in the next major version. Use `searchByCQL` instead. */
9
+ search<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.Search, callback: Callback<T>): Promise<void>;
10
+ /** @deprecated Will be removed in the next major version. Use `searchByCQL` instead. */
11
+ search<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.Search, callback?: never): Promise<T>;
8
12
  /**
9
13
  * Searches for content using the [Confluence Query Language
10
14
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/)
11
15
  *
12
- * Example initial call:
13
- *
14
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25
15
- *
16
- * Example response:
17
- *
18
- * {
19
- * "results": [
20
- * { ... },
21
- * { ... },
22
- * ...
23
- * { ... }
24
- * ],
25
- * "limit": 25,
26
- * "size": 25,
27
- * ...
28
- * "_links": {
29
- * "base": "<url>",
30
- * "context": "<url>",
31
- * "next": "/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
32
- * "self": "<url>"
33
- * }
34
- * }
35
- *
36
16
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
37
17
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
38
18
  * results returned in each call.
39
19
  *
40
- * Example subsequent call (taken from example response):
41
- *
42
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
43
- *
44
- * The response to this will have a `prev` URL similar to the `next` in the example response.
45
- *
46
20
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the entities. Note, only
47
21
  * entities that the user has permission to view will be returned.
48
22
  */
49
- search<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.Search, callback: Callback<T>): Promise<void>;
23
+ searchByCQL<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.SearchByCQL, callback: Callback<T>): Promise<void>;
50
24
  /**
51
25
  * Searches for content using the [Confluence Query Language
52
26
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/)
53
27
  *
54
- * Example initial call:
55
- *
56
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25
57
- *
58
- * Example response:
59
- *
60
- * {
61
- * "results": [
62
- * { ... },
63
- * { ... },
64
- * ...
65
- * { ... }
66
- * ],
67
- * "limit": 25,
68
- * "size": 25,
69
- * ...
70
- * "_links": {
71
- * "base": "<url>",
72
- * "context": "<url>",
73
- * "next": "/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
74
- * "self": "<url>"
75
- * }
76
- * }
77
- *
78
28
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
79
29
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
80
30
  * results returned in each call.
81
31
  *
82
- * Example subsequent call (taken from example response):
83
- *
84
- * https://your-domain.atlassian.net/wiki/rest/api/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
85
- *
86
- * The response to this will have a `prev` URL similar to the `next` in the example response.
87
- *
88
32
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the entities. Note, only
89
33
  * entities that the user has permission to view will be returned.
90
34
  */
91
- search<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.Search, callback?: never): Promise<T>;
35
+ searchByCQL<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.SearchByCQL, callback?: never): Promise<T>;
36
+ /** @deprecated Will be removed in the next major version. Use `searchUser` instead. */
37
+ userSearch<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.UserSearch, callback: Callback<T>): Promise<void>;
38
+ /** @deprecated Will be removed in the next major version. Use `searchUser` instead. */
39
+ userSearch<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.UserSearch, callback?: never): Promise<T>;
92
40
  /**
93
41
  * Searches for users using user-specific queries from the [Confluence Query Language
94
42
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
@@ -96,7 +44,7 @@ export declare class Search {
96
44
  * Note that some user fields may be set to null depending on the user's privacy settings. These are: email,
97
45
  * profilePicture, and displayName.
98
46
  */
99
- userSearch<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.UserSearch, callback: Callback<T>): Promise<void>;
47
+ searchUser<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.SearchUser, callback: Callback<T>): Promise<void>;
100
48
  /**
101
49
  * Searches for users using user-specific queries from the [Confluence Query Language
102
50
  * (CQL)](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
@@ -104,5 +52,5 @@ export declare class Search {
104
52
  * Note that some user fields may be set to null depending on the user's privacy settings. These are: email,
105
53
  * profilePicture, and displayName.
106
54
  */
107
- userSearch<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.UserSearch, callback?: never): Promise<T>;
55
+ searchUser<T = Models.SearchPageResponseSearchResult>(parameters: Parameters.SearchUser, callback?: never): Promise<T>;
108
56
  }
package/out/api/search.js CHANGED
@@ -7,6 +7,11 @@ class Search {
7
7
  this.client = client;
8
8
  }
9
9
  search(parameters, callback) {
10
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
+ return this.searchByCQL(parameters, callback);
12
+ });
13
+ }
14
+ searchByCQL(parameters, callback) {
10
15
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
16
  const config = {
12
17
  url: '/api/search',
@@ -15,14 +20,26 @@ class Search {
15
20
  cql: parameters.cql,
16
21
  cqlcontext: parameters.cqlcontext,
17
22
  cursor: parameters.cursor,
23
+ next: parameters.next,
24
+ prev: parameters.prev,
18
25
  limit: parameters.limit,
26
+ start: parameters.start,
19
27
  includeArchivedSpaces: parameters.includeArchivedSpaces,
28
+ excludeCurrentSpaces: parameters.excludeCurrentSpaces,
29
+ excerpt: parameters.excerpt,
30
+ sitePermissionTypeFilter: parameters.sitePermissionTypeFilter,
31
+ expand: parameters.expand,
20
32
  },
21
33
  };
22
- return this.client.sendRequest(config, callback, { methodName: 'search' });
34
+ return this.client.sendRequest(config, callback, { methodName: 'searchByCQL' });
23
35
  });
24
36
  }
25
37
  userSearch(parameters, callback) {
38
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
39
+ return this.searchUser(parameters, callback);
40
+ });
41
+ }
42
+ searchUser(parameters, callback) {
26
43
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
27
44
  const config = {
28
45
  url: '/api/search/user',
@@ -33,7 +50,7 @@ class Search {
33
50
  limit: parameters.limit,
34
51
  },
35
52
  };
36
- return this.client.sendRequest(config, callback, { methodName: 'search' });
53
+ return this.client.sendRequest(config, callback, { methodName: 'searchUser' });
37
54
  });
38
55
  }
39
56
  }
@@ -48,7 +48,7 @@ export declare class Settings {
48
48
  *
49
49
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
50
50
  */
51
- updateLookAndFeelSettings<T = Models.LookAndFeelUpdated>(parameters: Parameters.UpdateLookAndFeelSettings | undefined, callback: Callback<T>): Promise<void>;
51
+ updateLookAndFeelSettings<T = Models.LookAndFeel>(parameters: Parameters.UpdateLookAndFeelSettings | undefined, callback: Callback<T>): Promise<void>;
52
52
  /**
53
53
  * Updates the look and feel settings for the site or for a single space. If custom settings exist, they are updated.
54
54
  * If no custom settings exist, then a set of custom settings is created.
@@ -58,7 +58,7 @@ export declare class Settings {
58
58
  *
59
59
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
60
60
  */
61
- updateLookAndFeelSettings<T = Models.LookAndFeelUpdated>(parameters?: Parameters.UpdateLookAndFeelSettings, callback?: never): Promise<T>;
61
+ updateLookAndFeelSettings<T = Models.LookAndFeel>(parameters?: Parameters.UpdateLookAndFeelSettings, callback?: never): Promise<T>;
62
62
  /**
63
63
  * Resets the custom look and feel settings for the site or a single space. This changes the values of the custom
64
64
  * settings to be the same as the default settings. It does not change which settings (default or custom) are
@@ -44,8 +44,11 @@ class Settings {
44
44
  links: parameters === null || parameters === void 0 ? void 0 : parameters.links,
45
45
  menus: parameters === null || parameters === void 0 ? void 0 : parameters.menus,
46
46
  header: parameters === null || parameters === void 0 ? void 0 : parameters.header,
47
+ horizontalHeader: parameters === null || parameters === void 0 ? void 0 : parameters.horizontalHeader,
47
48
  content: parameters === null || parameters === void 0 ? void 0 : parameters.content,
48
49
  bordersAndDividers: parameters === null || parameters === void 0 ? void 0 : parameters.bordersAndDividers,
50
+ spaceReference: parameters === null || parameters === void 0 ? void 0 : parameters.spaceReference,
51
+ _links: parameters === null || parameters === void 0 ? void 0 : parameters.links,
49
52
  },
50
53
  };
51
54
  return this.client.sendRequest(config, callback, { methodName: 'updateLookAndFeelSettings' });
package/out/api/space.js CHANGED
@@ -7,12 +7,13 @@ class Space {
7
7
  this.client = client;
8
8
  }
9
9
  getSpaces(parameters, callback) {
10
+ var _a;
10
11
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
12
  const config = {
12
13
  url: '/api/space',
13
14
  method: 'GET',
14
15
  params: {
15
- spaceKey: parameters === null || parameters === void 0 ? void 0 : parameters.spaceKey,
16
+ spaceKey: (_a = parameters === null || parameters === void 0 ? void 0 : parameters.spaceKey) === null || _a === void 0 ? void 0 : _a.map((key, index) => index ? `&spaceKey=${key}` : key),
16
17
  spaceId: parameters === null || parameters === void 0 ? void 0 : parameters.spaceId,
17
18
  type: parameters === null || parameters === void 0 ? void 0 : parameters.type,
18
19
  status: parameters === null || parameters === void 0 ? void 0 : parameters.status,
@@ -50,6 +51,7 @@ class Space {
50
51
  key: parameters === null || parameters === void 0 ? void 0 : parameters.key,
51
52
  name: parameters === null || parameters === void 0 ? void 0 : parameters.name,
52
53
  description: parameters === null || parameters === void 0 ? void 0 : parameters.description,
54
+ permissions: parameters === null || parameters === void 0 ? void 0 : parameters.permissions,
53
55
  },
54
56
  };
55
57
  return this.client.sendRequest(config, callback, { methodName: 'createPrivateSpace' });
@@ -73,6 +75,8 @@ class Space {
73
75
  name: parameters.name,
74
76
  description: parameters.description,
75
77
  homepage: parameters.homepage,
78
+ type: parameters.type,
79
+ status: parameters.status,
76
80
  },
77
81
  };
78
82
  return this.client.sendRequest(config, callback, { methodName: 'updateSpace' });
@@ -5,6 +5,10 @@ import { Callback } from '../callback';
5
5
  export declare class SpacePermissions {
6
6
  private client;
7
7
  constructor(client: Client);
8
+ /** @deprecated Will be removed in the next major version. Use `addPermissionToSpace` instead. */
9
+ addPermission<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermission, callback: Callback<T>): Promise<void>;
10
+ /** @deprecated Will be removed in the next major version. Use `addPermissionToSpace` instead. */
11
+ addPermission<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermission, callback?: never): Promise<T>;
8
12
  /**
9
13
  * Adds new permission to space.
10
14
  *
@@ -14,7 +18,7 @@ export declare class SpacePermissions {
14
18
  *
15
19
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
16
20
  */
17
- addPermission<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermission, callback: Callback<T>): Promise<void>;
21
+ addPermissionToSpace<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermissionToSpace, callback: Callback<T>): Promise<void>;
18
22
  /**
19
23
  * Adds new permission to space.
20
24
  *
@@ -24,7 +28,27 @@ export declare class SpacePermissions {
24
28
  *
25
29
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
26
30
  */
27
- addPermission<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermission, callback?: never): Promise<T>;
31
+ addPermissionToSpace<T = Models.SpacePermissionV2>(parameters: Parameters.AddPermissionToSpace, callback?: never): Promise<T>;
32
+ /**
33
+ * Adds new custom content permission to space.
34
+ *
35
+ * If the permission to be added is a group permission, the group can be identified by its group name or group id.
36
+ *
37
+ * Note: Only apps can access this REST resource and only make changes to the respective app permissions.
38
+ *
39
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
40
+ */
41
+ addCustomContentPermissions<T = unknown>(parameters: Parameters.AddCustomContentPermissions, callback: Callback<T>): Promise<void>;
42
+ /**
43
+ * Adds new custom content permission to space.
44
+ *
45
+ * If the permission to be added is a group permission, the group can be identified by its group name or group id.
46
+ *
47
+ * Note: Only apps can access this REST resource and only make changes to the respective app permissions.
48
+ *
49
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
50
+ */
51
+ addCustomContentPermissions<T = unknown>(parameters: Parameters.AddCustomContentPermissions, callback?: never): Promise<T>;
28
52
  /**
29
53
  * Removes a space permission. Note that removing Read Space permission for a user or group will remove all the space
30
54
  * permissions for that user or group.
@@ -7,18 +7,35 @@ class SpacePermissions {
7
7
  this.client = client;
8
8
  }
9
9
  addPermission(parameters, callback) {
10
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
+ return this.addPermissionToSpace(parameters, callback);
12
+ });
13
+ }
14
+ addPermissionToSpace(parameters, callback) {
10
15
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
16
  const config = {
12
17
  url: `/api/space/${parameters.spaceKey}/permission`,
13
18
  method: 'POST',
14
19
  data: {
15
- id: parameters.id,
16
20
  subject: parameters.subject,
17
21
  operation: parameters.operation,
18
- _links: parameters._links,
22
+ _links: parameters.links,
23
+ },
24
+ };
25
+ return this.client.sendRequest(config, callback, { methodName: 'addPermissionToSpace' });
26
+ });
27
+ }
28
+ addCustomContentPermissions(parameters, callback) {
29
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
30
+ const config = {
31
+ url: `/api/space/${parameters.spaceKey}/permission/custom-content`,
32
+ method: 'POST',
33
+ data: {
34
+ subject: parameters.subject,
35
+ operations: parameters.operations,
19
36
  },
20
37
  };
21
- return this.client.sendRequest(config, callback, { methodName: 'addPermission' });
38
+ return this.client.sendRequest(config, callback, { methodName: 'addCustomContentPermissions' });
22
39
  });
23
40
  }
24
41
  removePermission(parameters, callback) {
@@ -42,15 +42,15 @@ export declare class SpaceProperties {
42
42
  */
43
43
  getSpaceProperty<T = Models.SpaceProperty>(parameters: Parameters.GetSpaceProperty, callback?: never): Promise<T>;
44
44
  /**
45
- * Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
46
- * property is passed as a path parameter, rather than in the request body.
45
+ * Creates a new space property. This is the same as `POST /wiki/rest/api/space/{spaceKey}/property` but the key for
46
+ * the property is passed as a path parameter, rather than in the request body.
47
47
  *
48
48
  * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
49
49
  */
50
50
  createSpacePropertyForKey<T = Models.SpaceProperty>(parameters: Parameters.CreateSpacePropertyForKey, callback: Callback<T>): Promise<void>;
51
51
  /**
52
- * Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
53
- * property is passed as a path parameter, rather than in the request body.
52
+ * Creates a new space property. This is the same as `POST /wiki/rest/api/space/{spaceKey}/property` but the key for
53
+ * the property is passed as a path parameter, rather than in the request body.
54
54
  *
55
55
  * **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
56
56
  */
@@ -28,6 +28,7 @@ class SpaceProperties {
28
28
  data: {
29
29
  key: parameters.key,
30
30
  value: parameters.value,
31
+ space: parameters.space,
31
32
  },
32
33
  };
33
34
  return this.client.sendRequest(config, callback, { methodName: 'createSpaceProperty' });