confluence.js 1.5.2 → 1.5.3

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 (74) hide show
  1. package/CHANGELOG.md +7 -3
  2. package/out/api/audit.d.ts +24 -12
  3. package/out/api/audit.js.map +1 -1
  4. package/out/api/content.d.ts +18 -12
  5. package/out/api/content.js.map +1 -1
  6. package/out/api/contentAttachments.d.ts +14 -8
  7. package/out/api/contentAttachments.js.map +1 -1
  8. package/out/api/contentBody.js +2 -4
  9. package/out/api/contentBody.js.map +1 -1
  10. package/out/api/contentMacroBody.d.ts +4 -2
  11. package/out/api/contentMacroBody.js.map +1 -1
  12. package/out/api/contentRestrictions.d.ts +16 -8
  13. package/out/api/contentRestrictions.js.map +1 -1
  14. package/out/api/contentWatches.d.ts +16 -8
  15. package/out/api/contentWatches.js.map +1 -1
  16. package/out/api/parameters/convertContentBody.d.ts +16 -2
  17. package/out/api/relation.d.ts +8 -4
  18. package/out/api/relation.js.map +1 -1
  19. package/out/api/settings.d.ts +4 -2
  20. package/out/api/settings.js.map +1 -1
  21. package/out/api/space.d.ts +4 -2
  22. package/out/api/space.js.map +1 -1
  23. package/out/api/template.d.ts +16 -8
  24. package/out/api/template.js.map +1 -1
  25. package/out/clients/baseClient.js +3 -1
  26. package/out/clients/baseClient.js.map +1 -1
  27. package/out/clients/serverClient.js.map +1 -1
  28. package/out/server/audit.js +6 -6
  29. package/out/server/audit.js.map +1 -1
  30. package/out/server/content.d.ts +34 -262
  31. package/out/server/content.js +32 -32
  32. package/out/server/content.js.map +1 -1
  33. package/out/server/contentBody.d.ts +2 -12
  34. package/out/server/contentBody.js +2 -1
  35. package/out/server/contentBody.js.map +1 -1
  36. package/out/server/group.js +3 -3
  37. package/out/server/group.js.map +1 -1
  38. package/out/server/longTask.js +2 -2
  39. package/out/server/longTask.js.map +1 -1
  40. package/out/server/parameters/convertContentBody.d.ts +16 -0
  41. package/out/server/search.d.ts +2 -22
  42. package/out/server/search.js +1 -1
  43. package/out/server/search.js.map +1 -1
  44. package/out/server/space.d.ts +12 -94
  45. package/out/server/space.js +14 -14
  46. package/out/server/space.js.map +1 -1
  47. package/out/server/user.d.ts +8 -152
  48. package/out/server/user.js +10 -10
  49. package/out/server/user.js.map +1 -1
  50. package/package.json +10 -10
  51. package/src/api/audit.ts +24 -12
  52. package/src/api/content.ts +23 -17
  53. package/src/api/contentAttachments.ts +19 -13
  54. package/src/api/contentBody.ts +2 -0
  55. package/src/api/contentMacroBody.ts +4 -2
  56. package/src/api/contentRestrictions.ts +16 -8
  57. package/src/api/contentWatches.ts +16 -8
  58. package/src/api/parameters/convertContentBody.ts +39 -2
  59. package/src/api/relation.ts +8 -4
  60. package/src/api/settings.ts +4 -2
  61. package/src/api/space.ts +4 -2
  62. package/src/api/template.ts +16 -8
  63. package/src/clients/baseClient.ts +5 -10
  64. package/src/clients/client.ts +1 -5
  65. package/src/clients/serverClient.ts +1 -10
  66. package/src/server/audit.ts +6 -6
  67. package/src/server/content.ts +70 -295
  68. package/src/server/contentBody.ts +4 -13
  69. package/src/server/group.ts +3 -3
  70. package/src/server/longTask.ts +2 -2
  71. package/src/server/parameters/convertContentBody.ts +37 -0
  72. package/src/server/search.ts +3 -23
  73. package/src/server/space.ts +26 -108
  74. package/src/server/user.ts +18 -162
@@ -11,16 +11,11 @@ export class ContentBody {
11
11
  * Converts between content body representations. Not all representations can be converted to/from other formats.
12
12
  * Supported conversions:
13
13
  *
14
- * - Storageview,export_view,styled_view,editor
14
+ * - Storageview, export_view, styled_view, editor
15
15
  * - Editorstorage
16
16
  * - ViewNone
17
17
  * - Export_viewNone
18
18
  * - Styled_viewNone
19
- *
20
- * @example
21
- * Example request URI(s):
22
- *
23
- * - http://example.com/rest/api/contentbody/convert/view
24
19
  */
25
20
  async convertContentBody<T = Models.ContentBody>(
26
21
  parameters: Parameters.ConvertContentBody,
@@ -30,16 +25,11 @@ export class ContentBody {
30
25
  * Converts between content body representations. Not all representations can be converted to/from other formats.
31
26
  * Supported conversions:
32
27
  *
33
- * - Storageview,export_view,styled_view,editor
28
+ * - Storageview, export_view, styled_view, editor
34
29
  * - Editorstorage
35
30
  * - ViewNone
36
31
  * - Export_viewNone
37
32
  * - Styled_viewNone
38
- *
39
- * @example
40
- * Example request URI(s):
41
- *
42
- * - http://example.com/rest/api/contentbody/convert/view
43
33
  */
44
34
  async convertContentBody<T = Models.ContentBody>(
45
35
  parameters: Parameters.ConvertContentBody,
@@ -58,6 +48,7 @@ export class ContentBody {
58
48
  view: parameters.view,
59
49
  export_view: parameters.exportView,
60
50
  styled_view: parameters.styledView,
51
+ expand: parameters.expand,
61
52
  },
62
53
  data: {
63
54
  ...parameters,
@@ -70,6 +61,6 @@ export class ContentBody {
70
61
  },
71
62
  };
72
63
 
73
- return this.client.sendRequest(config, callback, { methodName: 'server.convertContentBody' });
64
+ return this.client.sendRequest(config, callback);
74
65
  }
75
66
  }
@@ -29,7 +29,7 @@ export class Group {
29
29
  },
30
30
  };
31
31
 
32
- return this.client.sendRequest(config, callback, { methodName: 'server.getGroups' });
32
+ return this.client.sendRequest(config, callback);
33
33
  }
34
34
 
35
35
  /** Get the user group with the group name */
@@ -45,7 +45,7 @@ export class Group {
45
45
  },
46
46
  };
47
47
 
48
- return this.client.sendRequest(config, callback, { methodName: 'server.getGroup' });
48
+ return this.client.sendRequest(config, callback);
49
49
  }
50
50
 
51
51
  /** Get a paginated collection of users in the given group */
@@ -69,6 +69,6 @@ export class Group {
69
69
  },
70
70
  };
71
71
 
72
- return this.client.sendRequest(config, callback, { methodName: 'server.getMembers' });
72
+ return this.client.sendRequest(config, callback);
73
73
  }
74
74
  }
@@ -29,7 +29,7 @@ export class LongTask {
29
29
  },
30
30
  };
31
31
 
32
- return this.client.sendRequest(config, callback, { methodName: 'server.getTasks' });
32
+ return this.client.sendRequest(config, callback);
33
33
  }
34
34
 
35
35
  /** Returns information about a long-running task. */
@@ -45,6 +45,6 @@ export class LongTask {
45
45
  },
46
46
  };
47
47
 
48
- return this.client.sendRequest(config, callback, { methodName: 'server.getTask' });
48
+ return this.client.sendRequest(config, callback);
49
49
  }
50
50
  }
@@ -1,4 +1,5 @@
1
1
  export interface ConvertContentBody {
2
+ /** The name of the target format for the content body. */
2
3
  to: string;
3
4
 
4
5
  storage?: any;
@@ -7,5 +8,41 @@ export interface ConvertContentBody {
7
8
  exportView?: any;
8
9
  styledView?: any;
9
10
 
11
+ /**
12
+ * A multi-value parameter indicating which properties of the content to expand. Expands are dependent on the to
13
+ * conversion format and may be irrelevant for certain conversions (e.g. macroRenderedOutput is redundant when
14
+ * converting to view format).
15
+ *
16
+ * - `webresource` returns JS and CSS resources necessary for displaying nested content in `view` format
17
+ * - `webresource.superbatch.uris.js` returns all common JS dependencies
18
+ * - `webresource.superbatch.uris.css` returns all common CSS dependencies
19
+ * - `webresource.uris.js` returns JS dependencies specific to conversion
20
+ * - `webresource.uris.css` returns CSS dependencies specific to conversion
21
+ * - `embeddedContent` returns metadata for nested content (e.g. page included using page include macro)
22
+ * - `mediaToken` returns JWT token for retrieving attachment data from Media API
23
+ * - `macroRenderedOutput` additionally converts body to view format
24
+ */
25
+ expand?:
26
+ | 'webresource'
27
+ | 'webresource.superbatch.uris.js'
28
+ | 'webresource.superbatch.uris.css'
29
+ | 'webresource.uris.js'
30
+ | 'webresource.uris.css'
31
+ | 'embeddedContent'
32
+ | 'mediaToken'
33
+ | 'macroRenderedOutput'
34
+ | (
35
+ | 'webresource'
36
+ | 'webresource.superbatch.uris.js'
37
+ | 'webresource.superbatch.uris.css'
38
+ | 'webresource.uris.js'
39
+ | 'webresource.uris.css'
40
+ | 'embeddedContent'
41
+ | 'mediaToken'
42
+ | 'macroRenderedOutput'
43
+ )[]
44
+ | string
45
+ | string[];
46
+
10
47
  [key: string]: any;
11
48
  }
@@ -8,32 +8,12 @@ import { RequestConfig } from '../requestConfig';
8
8
  export class Search {
9
9
  constructor(private client: Client) {}
10
10
 
11
- /**
12
- * Search for entities in Confluence using the Confluence Query Language (CQL)
13
- *
14
- * @example
15
- * For example :
16
- *
17
- * Example request URI(s):
18
- *
19
- * - http://localhost:8080/confluence/rest/api/search?cql=creator=currentUser()&type%20in%20(space,page,user)&cqlcontext={%22spaceKey%22:%22TST%22,%22contentId%22:%2255%22}
20
- * - http://localhost:8080/confluence/rest/api/search?cql=siteSearch~'example'%20AND%20label=docs&expand=content.space,space.homepage&limit=10
21
- */
11
+ /** Search for entities in Confluence using the Confluence Query Language (CQL) */
22
12
  async search<T = Pagination<Models.SearchResult>>(
23
13
  parameters: Parameters.SearchContent | undefined,
24
14
  callback: Callback<T>
25
15
  ): Promise<void>;
26
- /**
27
- * Search for entities in Confluence using the Confluence Query Language (CQL)
28
- *
29
- * @example
30
- * For example :
31
- *
32
- * Example request URI(s):
33
- *
34
- * - http://localhost:8080/confluence/rest/api/search?cql=creator=currentUser()&type%20in%20(space,page,user)&cqlcontext={%22spaceKey%22:%22TST%22,%22contentId%22:%2255%22}
35
- * - http://localhost:8080/confluence/rest/api/search?cql=siteSearch~'example'%20AND%20label=docs&expand=content.space,space.homepage&limit=10
36
- */
16
+ /** Search for entities in Confluence using the Confluence Query Language (CQL) */
37
17
  async search<T = Pagination<Models.SearchResult>>(
38
18
  parameters?: Parameters.SearchContent,
39
19
  callback?: never
@@ -56,6 +36,6 @@ export class Search {
56
36
  },
57
37
  };
58
38
 
59
- return this.client.sendRequest(config, callback, { methodName: 'server.search' });
39
+ return this.client.sendRequest(config, callback);
60
40
  }
61
41
  }
@@ -8,24 +8,12 @@ import { RequestConfig } from '../requestConfig';
8
8
  export class Space {
9
9
  constructor(private client: Client) {}
10
10
 
11
- /**
12
- * Returns information about a number of spaces.
13
- *
14
- * Example request URI(s):
15
- *
16
- * - http://example.com/rest/api/space?spaceKey=TST&spaceKey=ds
17
- */
11
+ /** Returns information about a number of spaces. */
18
12
  async getSpaces<T = Pagination<Models.Space>>(
19
13
  parameters: Parameters.GetSpaces | undefined,
20
14
  callback: Callback<T>
21
15
  ): Promise<void>;
22
- /**
23
- * Returns information about a number of spaces.
24
- *
25
- * Example request URI(s):
26
- *
27
- * - http://example.com/rest/api/space?spaceKey=TST&spaceKey=ds
28
- */
16
+ /** Returns information about a number of spaces. */
29
17
  async getSpaces<T = Pagination<Models.Space>>(parameters?: Parameters.GetSpaces, callback?: never): Promise<T>;
30
18
  async getSpaces<T = Pagination<Models.Space>>(
31
19
  parameters?: Parameters.GetSpaces,
@@ -46,7 +34,7 @@ export class Space {
46
34
  },
47
35
  };
48
36
 
49
- return this.client.sendRequest(config, callback, { methodName: 'server.getSpaces' });
37
+ return this.client.sendRequest(config, callback);
50
38
  }
51
39
 
52
40
  /**
@@ -73,7 +61,7 @@ export class Space {
73
61
  },
74
62
  };
75
63
 
76
- return this.client.sendRequest(config, callback, { methodName: 'server.createSpace' });
64
+ return this.client.sendRequest(config, callback);
77
65
  }
78
66
 
79
67
  /**
@@ -105,26 +93,12 @@ export class Space {
105
93
  },
106
94
  };
107
95
 
108
- return this.client.sendRequest(config, callback, { methodName: 'server.createPrivateSpace' });
96
+ return this.client.sendRequest(config, callback);
109
97
  }
110
98
 
111
- /**
112
- * Returns information about a space.
113
- *
114
- * @example
115
- * Example request URI(s):
116
- *
117
- * - http://example.com/rest/api/space/TST?expand=description
118
- */
99
+ /** Returns information about a space. */
119
100
  async getSpace<T = Models.Space>(parameters: Parameters.GetSpace, callback: Callback<T>): Promise<void>;
120
- /**
121
- * Returns information about a space.
122
- *
123
- * @example
124
- * Example request URI(s):
125
- *
126
- * - http://example.com/rest/api/space/TST?expand=description
127
- */
101
+ /** Returns information about a space. */
128
102
  async getSpace<T = Models.Space>(parameters: Parameters.GetSpace, callback?: never): Promise<T>;
129
103
  async getSpace<T = Models.Space>(parameters: Parameters.GetSpace, callback?: Callback<T>): Promise<void | T> {
130
104
  const config: RequestConfig = {
@@ -135,7 +109,7 @@ export class Space {
135
109
  },
136
110
  };
137
111
 
138
- return this.client.sendRequest(config, callback, { methodName: 'server.getSpace' });
112
+ return this.client.sendRequest(config, callback);
139
113
  }
140
114
 
141
115
  /** Updates a Space. Currently only the Space name, description and homepage can be updated. */
@@ -153,7 +127,7 @@ export class Space {
153
127
  },
154
128
  };
155
129
 
156
- return this.client.sendRequest(config, callback, { methodName: 'server.updateSpace' });
130
+ return this.client.sendRequest(config, callback);
157
131
  }
158
132
 
159
133
  /**
@@ -179,29 +153,15 @@ export class Space {
179
153
  method: 'DELETE',
180
154
  };
181
155
 
182
- return this.client.sendRequest(config, callback, { methodName: 'server.deleteSpace' });
156
+ return this.client.sendRequest(config, callback);
183
157
  }
184
158
 
185
- /**
186
- * Returns the content in this given space
187
- *
188
- * @example
189
- * Example request URI(s):
190
- *
191
- * - http://example.com/rest/api/space/TEST/content?expand=history
192
- */
159
+ /** Returns the content in this given space */
193
160
  async getContentForSpace<T = Pagination<Models.Content>>(
194
161
  parameters: Parameters.GetContentForSpace,
195
162
  callback: Callback<T>
196
163
  ): Promise<void>;
197
- /**
198
- * Returns the content in this given space
199
- *
200
- * @example
201
- * Example request URI(s):
202
- *
203
- * - http://example.com/rest/api/space/TEST/content?expand=history
204
- */
164
+ /** Returns the content in this given space */
205
165
  async getContentForSpace<T = Pagination<Models.Content>>(
206
166
  parameters: Parameters.GetContentForSpace,
207
167
  callback?: never
@@ -221,29 +181,15 @@ export class Space {
221
181
  },
222
182
  };
223
183
 
224
- return this.client.sendRequest(config, callback, { methodName: 'server.getContentForSpace' });
184
+ return this.client.sendRequest(config, callback);
225
185
  }
226
186
 
227
- /**
228
- * Returns the content in this given space with the given type
229
- *
230
- * @example
231
- * Example request URI(s):
232
- *
233
- * - http://example.com/rest/api/space/TEST/content/page?expand=history
234
- */
187
+ /** Returns the content in this given space with the given type */
235
188
  async getContentByType<T = Pagination<Models.Content>>(
236
189
  parameters: Parameters.GetContentByType,
237
190
  callback: Callback<T>
238
191
  ): Promise<void>;
239
- /**
240
- * Returns the content in this given space with the given type
241
- *
242
- * @example
243
- * Example request URI(s):
244
- *
245
- * - http://example.com/rest/api/space/TEST/content/page?expand=history
246
- */
192
+ /** Returns the content in this given space with the given type */
247
193
  async getContentByType<T = Pagination<Models.Content>>(
248
194
  parameters: Parameters.GetContentByType,
249
195
  callback?: never
@@ -263,29 +209,15 @@ export class Space {
263
209
  },
264
210
  };
265
211
 
266
- return this.client.sendRequest(config, callback, { methodName: 'server.getContentByType' });
212
+ return this.client.sendRequest(config, callback);
267
213
  }
268
214
 
269
- /**
270
- * Returns a paginated list of space properties.
271
- *
272
- * @example
273
- * Example request URI:
274
- *
275
- * - http://example.com/rest/experimental/space/TST/property?expand=space,version
276
- */
215
+ /** Returns a paginated list of space properties. */
277
216
  async getSpaceProperties<T = Pagination<Models.SpaceProperty>>(
278
217
  parameters: Parameters.GetSpaceProperties,
279
218
  callback: Callback<T>
280
219
  ): Promise<void>;
281
- /**
282
- * Returns a paginated list of space properties.
283
- *
284
- * @example
285
- * Example request URI:
286
- *
287
- * - http://example.com/rest/experimental/space/TST/property?expand=space,version
288
- */
220
+ /** Returns a paginated list of space properties. */
289
221
  async getSpaceProperties<T = Pagination<Models.SpaceProperty>>(
290
222
  parameters: Parameters.GetSpaceProperties,
291
223
  callback?: never
@@ -304,7 +236,7 @@ export class Space {
304
236
  },
305
237
  };
306
238
 
307
- return this.client.sendRequest(config, callback, { methodName: 'server.getSpaceProperties' });
239
+ return this.client.sendRequest(config, callback);
308
240
  }
309
241
 
310
242
  /** Creates a new space property. */
@@ -330,29 +262,15 @@ export class Space {
330
262
  },
331
263
  };
332
264
 
333
- return this.client.sendRequest(config, callback, { methodName: 'server.createSpaceProperty' });
265
+ return this.client.sendRequest(config, callback);
334
266
  }
335
267
 
336
- /**
337
- * Returns a paginated list of space properties.
338
- *
339
- * @example
340
- * Example request URI:
341
- *
342
- * - http://example.com/rest/experimental/space/TST/property?expand=space,version
343
- */
268
+ /** Returns a paginated list of space properties. */
344
269
  async getSpaceProperty<T = Models.SpaceProperty>(
345
270
  parameters: Parameters.GetSpaceProperty,
346
271
  callback: Callback<T>
347
272
  ): Promise<void>;
348
- /**
349
- * Returns a paginated list of space properties.
350
- *
351
- * @example
352
- * Example request URI:
353
- *
354
- * - http://example.com/rest/experimental/space/TST/property?expand=space,version
355
- */
273
+ /** Returns a paginated list of space properties. */
356
274
  async getSpaceProperty<T = Models.SpaceProperty>(
357
275
  parameters: Parameters.GetSpaceProperty,
358
276
  callback?: never
@@ -369,7 +287,7 @@ export class Space {
369
287
  },
370
288
  };
371
289
 
372
- return this.client.sendRequest(config, callback, { methodName: 'server.getSpaceProperty' });
290
+ return this.client.sendRequest(config, callback);
373
291
  }
374
292
 
375
293
  /** Creates a new space property. */
@@ -394,7 +312,7 @@ export class Space {
394
312
  },
395
313
  };
396
314
 
397
- return this.client.sendRequest(config, callback, { methodName: 'server.createSpacePropertyForKey' });
315
+ return this.client.sendRequest(config, callback);
398
316
  }
399
317
 
400
318
  /**
@@ -424,7 +342,7 @@ export class Space {
424
342
  method: 'PUT',
425
343
  };
426
344
 
427
- return this.client.sendRequest(config, callback, { methodName: 'server.updateSpaceProperty' });
345
+ return this.client.sendRequest(config, callback);
428
346
  }
429
347
 
430
348
  /** Deletes a space property. */
@@ -440,6 +358,6 @@ export class Space {
440
358
  method: 'DELETE',
441
359
  };
442
360
 
443
- return this.client.sendRequest(config, callback, { methodName: 'server.deleteSpaceProperty' });
361
+ return this.client.sendRequest(config, callback);
444
362
  }
445
363
  }