@gitbook/api 0.28.0 → 0.30.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.
- package/dist/client.d.ts +271 -54
- package/dist/index.cjs +174 -19
- package/dist/index.js +172 -19
- package/package.json +1 -1
- package/spec/openapi.json +950 -239
- package/spec/openapi.yaml +590 -148
package/dist/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
ContentType: () => ContentType,
|
|
37
37
|
ContentVisibility: () => ContentVisibility,
|
|
38
38
|
CustomFieldType: () => CustomFieldType,
|
|
39
|
+
CustomizationBackground: () => CustomizationBackground,
|
|
39
40
|
CustomizationCorners: () => CustomizationCorners,
|
|
40
41
|
CustomizationFont: () => CustomizationFont,
|
|
41
42
|
CustomizationHeaderPreset: () => CustomizationHeaderPreset,
|
|
@@ -63,6 +64,7 @@ __export(src_exports, {
|
|
|
63
64
|
RevisionPageLayoutPreset: () => RevisionPageLayoutPreset,
|
|
64
65
|
RevisionPageType: () => RevisionPageType,
|
|
65
66
|
RevisionSemanticChangeType: () => RevisionSemanticChangeType,
|
|
67
|
+
SpaceBlockReason: () => SpaceBlockReason,
|
|
66
68
|
SpaceEditMode: () => SpaceEditMode,
|
|
67
69
|
TeamMemberRole: () => TeamMemberRole
|
|
68
70
|
});
|
|
@@ -70,7 +72,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
70
72
|
|
|
71
73
|
// package.json
|
|
72
74
|
var name = "@gitbook/api";
|
|
73
|
-
var version = "0.
|
|
75
|
+
var version = "0.30.0";
|
|
74
76
|
|
|
75
77
|
// src/client.ts
|
|
76
78
|
var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
|
|
@@ -304,6 +306,14 @@ var PurgeCDNCacheContextType = /* @__PURE__ */ ((PurgeCDNCacheContextType2) => {
|
|
|
304
306
|
PurgeCDNCacheContextType2["Hosts"] = "hosts";
|
|
305
307
|
return PurgeCDNCacheContextType2;
|
|
306
308
|
})(PurgeCDNCacheContextType || {});
|
|
309
|
+
var SpaceBlockReason = /* @__PURE__ */ ((SpaceBlockReason2) => {
|
|
310
|
+
SpaceBlockReason2["DMCA"] = "DMCA";
|
|
311
|
+
SpaceBlockReason2["THREAT_TYPE_UNSPECIFIED"] = "THREAT_TYPE_UNSPECIFIED";
|
|
312
|
+
SpaceBlockReason2["MALWARE"] = "MALWARE";
|
|
313
|
+
SpaceBlockReason2["SOCIAL_ENGINEERING"] = "SOCIAL_ENGINEERING";
|
|
314
|
+
SpaceBlockReason2["UNWANTED_SOFTWARE"] = "UNWANTED_SOFTWARE";
|
|
315
|
+
return SpaceBlockReason2;
|
|
316
|
+
})(SpaceBlockReason || {});
|
|
307
317
|
var ContentKitIcon = /* @__PURE__ */ ((ContentKitIcon2) => {
|
|
308
318
|
ContentKitIcon2["Close"] = "close";
|
|
309
319
|
ContentKitIcon2["Edit"] = "edit";
|
|
@@ -375,6 +385,11 @@ var CustomizationCorners = /* @__PURE__ */ ((CustomizationCorners2) => {
|
|
|
375
385
|
CustomizationCorners2["Rounded"] = "rounded";
|
|
376
386
|
return CustomizationCorners2;
|
|
377
387
|
})(CustomizationCorners || {});
|
|
388
|
+
var CustomizationBackground = /* @__PURE__ */ ((CustomizationBackground2) => {
|
|
389
|
+
CustomizationBackground2["Plain"] = "plain";
|
|
390
|
+
CustomizationBackground2["Match"] = "match";
|
|
391
|
+
return CustomizationBackground2;
|
|
392
|
+
})(CustomizationBackground || {});
|
|
378
393
|
var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
|
|
379
394
|
PageFeedbackRating2["Bad"] = "bad";
|
|
380
395
|
PageFeedbackRating2["Ok"] = "ok";
|
|
@@ -482,6 +497,73 @@ var HttpClient = class {
|
|
|
482
497
|
return data;
|
|
483
498
|
});
|
|
484
499
|
};
|
|
500
|
+
this.streamRequest = async function* ({
|
|
501
|
+
path,
|
|
502
|
+
baseUrl,
|
|
503
|
+
cancelToken,
|
|
504
|
+
secure,
|
|
505
|
+
...params
|
|
506
|
+
}) {
|
|
507
|
+
const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData, "streaming") || {};
|
|
508
|
+
const { query: requestQuery, ...requestParams } = this.mergeRequestParams(
|
|
509
|
+
params,
|
|
510
|
+
secureParams
|
|
511
|
+
);
|
|
512
|
+
const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
|
|
513
|
+
const eventSource = new EventSource(
|
|
514
|
+
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`
|
|
515
|
+
);
|
|
516
|
+
try {
|
|
517
|
+
const signal = cancelToken ? this.createAbortSignal(cancelToken) : void 0;
|
|
518
|
+
if (signal) {
|
|
519
|
+
signal.addEventListener("abort", () => {
|
|
520
|
+
eventSource.close();
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
let results = [];
|
|
524
|
+
let resolve;
|
|
525
|
+
let reject;
|
|
526
|
+
let promise = new Promise((r, rj) => {
|
|
527
|
+
resolve = r;
|
|
528
|
+
reject = rj;
|
|
529
|
+
});
|
|
530
|
+
let done = false;
|
|
531
|
+
let messages = 0;
|
|
532
|
+
eventSource.onmessage = (event) => {
|
|
533
|
+
messages += 1;
|
|
534
|
+
try {
|
|
535
|
+
const data = JSON.parse(event.data);
|
|
536
|
+
results.push(data);
|
|
537
|
+
} catch (error) {
|
|
538
|
+
return reject(error);
|
|
539
|
+
}
|
|
540
|
+
resolve();
|
|
541
|
+
promise = new Promise((r, rj) => {
|
|
542
|
+
resolve = r;
|
|
543
|
+
reject = rj;
|
|
544
|
+
});
|
|
545
|
+
};
|
|
546
|
+
eventSource.onerror = (event) => {
|
|
547
|
+
done = true;
|
|
548
|
+
if (messages > 0) {
|
|
549
|
+
resolve();
|
|
550
|
+
return;
|
|
551
|
+
} else {
|
|
552
|
+
const error = new Error("API streaming error");
|
|
553
|
+
reject(error);
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
while (!done) {
|
|
557
|
+
await promise;
|
|
558
|
+
for (const result of results) {
|
|
559
|
+
yield result;
|
|
560
|
+
}
|
|
561
|
+
results = [];
|
|
562
|
+
}
|
|
563
|
+
} finally {
|
|
564
|
+
eventSource.close();
|
|
565
|
+
}
|
|
566
|
+
};
|
|
485
567
|
Object.assign(this, apiConfig);
|
|
486
568
|
}
|
|
487
569
|
encodeQueryParam(key, value) {
|
|
@@ -674,6 +756,13 @@ var Api = class extends HttpClient {
|
|
|
674
756
|
format: "json",
|
|
675
757
|
...params
|
|
676
758
|
}),
|
|
759
|
+
streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
|
|
760
|
+
path: `/spaces/${spaceId}/search/ask/stream`,
|
|
761
|
+
method: "GET",
|
|
762
|
+
query,
|
|
763
|
+
secure: true,
|
|
764
|
+
...params
|
|
765
|
+
}),
|
|
677
766
|
getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
|
|
678
767
|
path: `/spaces/${spaceId}/search/questions`,
|
|
679
768
|
method: "GET",
|
|
@@ -798,9 +887,10 @@ var Api = class extends HttpClient {
|
|
|
798
887
|
format: "json",
|
|
799
888
|
...params
|
|
800
889
|
}),
|
|
801
|
-
getDocumentById: (spaceId, documentId, params = {}) => this.request({
|
|
890
|
+
getDocumentById: (spaceId, documentId, query, params = {}) => this.request({
|
|
802
891
|
path: `/spaces/${spaceId}/documents/${documentId}`,
|
|
803
892
|
method: "GET",
|
|
893
|
+
query,
|
|
804
894
|
secure: true,
|
|
805
895
|
format: "json",
|
|
806
896
|
...params
|
|
@@ -829,6 +919,15 @@ var Api = class extends HttpClient {
|
|
|
829
919
|
format: "json",
|
|
830
920
|
...params
|
|
831
921
|
}),
|
|
922
|
+
updateChangeRequestById: (spaceId, changeRequestId, data, params = {}) => this.request({
|
|
923
|
+
path: `/spaces/${spaceId}/change-requests/${changeRequestId}`,
|
|
924
|
+
method: "PATCH",
|
|
925
|
+
body: data,
|
|
926
|
+
secure: true,
|
|
927
|
+
type: "application/json" /* Json */,
|
|
928
|
+
format: "json",
|
|
929
|
+
...params
|
|
930
|
+
}),
|
|
832
931
|
mergeChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
|
|
833
932
|
path: `/spaces/${spaceId}/change-requests/${changeRequestId}/merge`,
|
|
834
933
|
method: "POST",
|
|
@@ -1253,6 +1352,30 @@ var Api = class extends HttpClient {
|
|
|
1253
1352
|
secure: true,
|
|
1254
1353
|
format: "json",
|
|
1255
1354
|
...params
|
|
1355
|
+
}),
|
|
1356
|
+
createSpaceShareLink: (spaceId, data, params = {}) => this.request({
|
|
1357
|
+
path: `/spaces/${spaceId}/share-links`,
|
|
1358
|
+
method: "POST",
|
|
1359
|
+
body: data,
|
|
1360
|
+
secure: true,
|
|
1361
|
+
type: "application/json" /* Json */,
|
|
1362
|
+
format: "json",
|
|
1363
|
+
...params
|
|
1364
|
+
}),
|
|
1365
|
+
updateSpaceShareLinkById: (spaceId, shareLinkId, data, params = {}) => this.request({
|
|
1366
|
+
path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
|
|
1367
|
+
method: "PATCH",
|
|
1368
|
+
body: data,
|
|
1369
|
+
secure: true,
|
|
1370
|
+
type: "application/json" /* Json */,
|
|
1371
|
+
format: "json",
|
|
1372
|
+
...params
|
|
1373
|
+
}),
|
|
1374
|
+
deleteSpaceShareLinkById: (spaceId, shareLinkId, params = {}) => this.request({
|
|
1375
|
+
path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
|
|
1376
|
+
method: "DELETE",
|
|
1377
|
+
secure: true,
|
|
1378
|
+
...params
|
|
1256
1379
|
})
|
|
1257
1380
|
};
|
|
1258
1381
|
this.collections = {
|
|
@@ -1343,6 +1466,30 @@ var Api = class extends HttpClient {
|
|
|
1343
1466
|
type: "application/json" /* Json */,
|
|
1344
1467
|
format: "json",
|
|
1345
1468
|
...params
|
|
1469
|
+
}),
|
|
1470
|
+
createCollectionShareLink: (collectionId, data, params = {}) => this.request({
|
|
1471
|
+
path: `/collections/${collectionId}/share-links`,
|
|
1472
|
+
method: "POST",
|
|
1473
|
+
body: data,
|
|
1474
|
+
secure: true,
|
|
1475
|
+
type: "application/json" /* Json */,
|
|
1476
|
+
format: "json",
|
|
1477
|
+
...params
|
|
1478
|
+
}),
|
|
1479
|
+
updateCollectionShareLinkById: (collectionId, shareLinkId, data, params = {}) => this.request({
|
|
1480
|
+
path: `/collections/${collectionId}/share-links/${shareLinkId}`,
|
|
1481
|
+
method: "PATCH",
|
|
1482
|
+
body: data,
|
|
1483
|
+
secure: true,
|
|
1484
|
+
type: "application/json" /* Json */,
|
|
1485
|
+
format: "json",
|
|
1486
|
+
...params
|
|
1487
|
+
}),
|
|
1488
|
+
deleteCollectionShareLinkById: (collectionId, shareLinkId, params = {}) => this.request({
|
|
1489
|
+
path: `/collections/${collectionId}/share-links/${shareLinkId}`,
|
|
1490
|
+
method: "DELETE",
|
|
1491
|
+
secure: true,
|
|
1492
|
+
...params
|
|
1346
1493
|
})
|
|
1347
1494
|
};
|
|
1348
1495
|
this.integrations = {
|
|
@@ -1708,6 +1855,21 @@ var Api = class extends HttpClient {
|
|
|
1708
1855
|
format: "json",
|
|
1709
1856
|
...params
|
|
1710
1857
|
}),
|
|
1858
|
+
updateOrganizationInviteById: (organizationId, inviteId, data, params = {}) => this.request({
|
|
1859
|
+
path: `/orgs/${organizationId}/invites/${inviteId}`,
|
|
1860
|
+
method: "PATCH",
|
|
1861
|
+
body: data,
|
|
1862
|
+
secure: true,
|
|
1863
|
+
type: "application/json" /* Json */,
|
|
1864
|
+
format: "json",
|
|
1865
|
+
...params
|
|
1866
|
+
}),
|
|
1867
|
+
deleteOrganizationInviteById: (organizationId, inviteId, params = {}) => this.request({
|
|
1868
|
+
path: `/orgs/${organizationId}/invites/${inviteId}`,
|
|
1869
|
+
method: "DELETE",
|
|
1870
|
+
secure: true,
|
|
1871
|
+
...params
|
|
1872
|
+
}),
|
|
1711
1873
|
upgradeOrganizationPlan: (organizationId, data, params = {}) => this.request({
|
|
1712
1874
|
path: `/orgs/${organizationId}/billing`,
|
|
1713
1875
|
method: "POST",
|
|
@@ -1944,21 +2106,6 @@ var Api = class extends HttpClient {
|
|
|
1944
2106
|
format: "json",
|
|
1945
2107
|
...params
|
|
1946
2108
|
}),
|
|
1947
|
-
deleteCapture: (organizationId, captureId, params = {}) => this.request({
|
|
1948
|
-
path: `/orgs/${organizationId}/captures/${captureId}`,
|
|
1949
|
-
method: "DELETE",
|
|
1950
|
-
secure: true,
|
|
1951
|
-
...params
|
|
1952
|
-
}),
|
|
1953
|
-
updateCapture: (organizationId, captureId, data, params = {}) => this.request({
|
|
1954
|
-
path: `/orgs/${organizationId}/captures/${captureId}`,
|
|
1955
|
-
method: "PUT",
|
|
1956
|
-
body: data,
|
|
1957
|
-
secure: true,
|
|
1958
|
-
type: "application/json" /* Json */,
|
|
1959
|
-
format: "json",
|
|
1960
|
-
...params
|
|
1961
|
-
}),
|
|
1962
2109
|
addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
|
|
1963
2110
|
path: `/orgs/${organizationId}/captures/${captureId}/events`,
|
|
1964
2111
|
method: "POST",
|
|
@@ -1994,10 +2141,9 @@ var Api = class extends HttpClient {
|
|
|
1994
2141
|
format: "json",
|
|
1995
2142
|
...params
|
|
1996
2143
|
}),
|
|
1997
|
-
getSnippet: (organizationId, snippetId,
|
|
2144
|
+
getSnippet: (organizationId, snippetId, params = {}) => this.request({
|
|
1998
2145
|
path: `/orgs/${organizationId}/snippets/${snippetId}`,
|
|
1999
2146
|
method: "GET",
|
|
2000
|
-
query,
|
|
2001
2147
|
secure: true,
|
|
2002
2148
|
format: "json",
|
|
2003
2149
|
...params
|
|
@@ -2051,6 +2197,13 @@ var Api = class extends HttpClient {
|
|
|
2051
2197
|
format: "json",
|
|
2052
2198
|
...params
|
|
2053
2199
|
}),
|
|
2200
|
+
streamAskInOrganization: (organizationId, query, params = {}) => this.streamRequest({
|
|
2201
|
+
path: `/orgs/${organizationId}/ask/stream`,
|
|
2202
|
+
method: "GET",
|
|
2203
|
+
query,
|
|
2204
|
+
secure: true,
|
|
2205
|
+
...params
|
|
2206
|
+
}),
|
|
2054
2207
|
listContentAuditRelations: (organizationId, query, params = {}) => this.request({
|
|
2055
2208
|
path: `/orgs/${organizationId}/insights/audit-relations`,
|
|
2056
2209
|
method: "GET",
|
|
@@ -2213,6 +2366,7 @@ var GitBookAPI = class extends Api {
|
|
|
2213
2366
|
ContentType,
|
|
2214
2367
|
ContentVisibility,
|
|
2215
2368
|
CustomFieldType,
|
|
2369
|
+
CustomizationBackground,
|
|
2216
2370
|
CustomizationCorners,
|
|
2217
2371
|
CustomizationFont,
|
|
2218
2372
|
CustomizationHeaderPreset,
|
|
@@ -2240,6 +2394,7 @@ var GitBookAPI = class extends Api {
|
|
|
2240
2394
|
RevisionPageLayoutPreset,
|
|
2241
2395
|
RevisionPageType,
|
|
2242
2396
|
RevisionSemanticChangeType,
|
|
2397
|
+
SpaceBlockReason,
|
|
2243
2398
|
SpaceEditMode,
|
|
2244
2399
|
TeamMemberRole
|
|
2245
2400
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@gitbook/api";
|
|
3
|
-
var version = "0.
|
|
3
|
+
var version = "0.30.0";
|
|
4
4
|
|
|
5
5
|
// src/client.ts
|
|
6
6
|
var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
|
|
@@ -234,6 +234,14 @@ var PurgeCDNCacheContextType = /* @__PURE__ */ ((PurgeCDNCacheContextType2) => {
|
|
|
234
234
|
PurgeCDNCacheContextType2["Hosts"] = "hosts";
|
|
235
235
|
return PurgeCDNCacheContextType2;
|
|
236
236
|
})(PurgeCDNCacheContextType || {});
|
|
237
|
+
var SpaceBlockReason = /* @__PURE__ */ ((SpaceBlockReason2) => {
|
|
238
|
+
SpaceBlockReason2["DMCA"] = "DMCA";
|
|
239
|
+
SpaceBlockReason2["THREAT_TYPE_UNSPECIFIED"] = "THREAT_TYPE_UNSPECIFIED";
|
|
240
|
+
SpaceBlockReason2["MALWARE"] = "MALWARE";
|
|
241
|
+
SpaceBlockReason2["SOCIAL_ENGINEERING"] = "SOCIAL_ENGINEERING";
|
|
242
|
+
SpaceBlockReason2["UNWANTED_SOFTWARE"] = "UNWANTED_SOFTWARE";
|
|
243
|
+
return SpaceBlockReason2;
|
|
244
|
+
})(SpaceBlockReason || {});
|
|
237
245
|
var ContentKitIcon = /* @__PURE__ */ ((ContentKitIcon2) => {
|
|
238
246
|
ContentKitIcon2["Close"] = "close";
|
|
239
247
|
ContentKitIcon2["Edit"] = "edit";
|
|
@@ -305,6 +313,11 @@ var CustomizationCorners = /* @__PURE__ */ ((CustomizationCorners2) => {
|
|
|
305
313
|
CustomizationCorners2["Rounded"] = "rounded";
|
|
306
314
|
return CustomizationCorners2;
|
|
307
315
|
})(CustomizationCorners || {});
|
|
316
|
+
var CustomizationBackground = /* @__PURE__ */ ((CustomizationBackground2) => {
|
|
317
|
+
CustomizationBackground2["Plain"] = "plain";
|
|
318
|
+
CustomizationBackground2["Match"] = "match";
|
|
319
|
+
return CustomizationBackground2;
|
|
320
|
+
})(CustomizationBackground || {});
|
|
308
321
|
var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
|
|
309
322
|
PageFeedbackRating2["Bad"] = "bad";
|
|
310
323
|
PageFeedbackRating2["Ok"] = "ok";
|
|
@@ -412,6 +425,73 @@ var HttpClient = class {
|
|
|
412
425
|
return data;
|
|
413
426
|
});
|
|
414
427
|
};
|
|
428
|
+
this.streamRequest = async function* ({
|
|
429
|
+
path,
|
|
430
|
+
baseUrl,
|
|
431
|
+
cancelToken,
|
|
432
|
+
secure,
|
|
433
|
+
...params
|
|
434
|
+
}) {
|
|
435
|
+
const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData, "streaming") || {};
|
|
436
|
+
const { query: requestQuery, ...requestParams } = this.mergeRequestParams(
|
|
437
|
+
params,
|
|
438
|
+
secureParams
|
|
439
|
+
);
|
|
440
|
+
const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
|
|
441
|
+
const eventSource = new EventSource(
|
|
442
|
+
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`
|
|
443
|
+
);
|
|
444
|
+
try {
|
|
445
|
+
const signal = cancelToken ? this.createAbortSignal(cancelToken) : void 0;
|
|
446
|
+
if (signal) {
|
|
447
|
+
signal.addEventListener("abort", () => {
|
|
448
|
+
eventSource.close();
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
let results = [];
|
|
452
|
+
let resolve;
|
|
453
|
+
let reject;
|
|
454
|
+
let promise = new Promise((r, rj) => {
|
|
455
|
+
resolve = r;
|
|
456
|
+
reject = rj;
|
|
457
|
+
});
|
|
458
|
+
let done = false;
|
|
459
|
+
let messages = 0;
|
|
460
|
+
eventSource.onmessage = (event) => {
|
|
461
|
+
messages += 1;
|
|
462
|
+
try {
|
|
463
|
+
const data = JSON.parse(event.data);
|
|
464
|
+
results.push(data);
|
|
465
|
+
} catch (error) {
|
|
466
|
+
return reject(error);
|
|
467
|
+
}
|
|
468
|
+
resolve();
|
|
469
|
+
promise = new Promise((r, rj) => {
|
|
470
|
+
resolve = r;
|
|
471
|
+
reject = rj;
|
|
472
|
+
});
|
|
473
|
+
};
|
|
474
|
+
eventSource.onerror = (event) => {
|
|
475
|
+
done = true;
|
|
476
|
+
if (messages > 0) {
|
|
477
|
+
resolve();
|
|
478
|
+
return;
|
|
479
|
+
} else {
|
|
480
|
+
const error = new Error("API streaming error");
|
|
481
|
+
reject(error);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
while (!done) {
|
|
485
|
+
await promise;
|
|
486
|
+
for (const result of results) {
|
|
487
|
+
yield result;
|
|
488
|
+
}
|
|
489
|
+
results = [];
|
|
490
|
+
}
|
|
491
|
+
} finally {
|
|
492
|
+
eventSource.close();
|
|
493
|
+
}
|
|
494
|
+
};
|
|
415
495
|
Object.assign(this, apiConfig);
|
|
416
496
|
}
|
|
417
497
|
encodeQueryParam(key, value) {
|
|
@@ -604,6 +684,13 @@ var Api = class extends HttpClient {
|
|
|
604
684
|
format: "json",
|
|
605
685
|
...params
|
|
606
686
|
}),
|
|
687
|
+
streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
|
|
688
|
+
path: `/spaces/${spaceId}/search/ask/stream`,
|
|
689
|
+
method: "GET",
|
|
690
|
+
query,
|
|
691
|
+
secure: true,
|
|
692
|
+
...params
|
|
693
|
+
}),
|
|
607
694
|
getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
|
|
608
695
|
path: `/spaces/${spaceId}/search/questions`,
|
|
609
696
|
method: "GET",
|
|
@@ -728,9 +815,10 @@ var Api = class extends HttpClient {
|
|
|
728
815
|
format: "json",
|
|
729
816
|
...params
|
|
730
817
|
}),
|
|
731
|
-
getDocumentById: (spaceId, documentId, params = {}) => this.request({
|
|
818
|
+
getDocumentById: (spaceId, documentId, query, params = {}) => this.request({
|
|
732
819
|
path: `/spaces/${spaceId}/documents/${documentId}`,
|
|
733
820
|
method: "GET",
|
|
821
|
+
query,
|
|
734
822
|
secure: true,
|
|
735
823
|
format: "json",
|
|
736
824
|
...params
|
|
@@ -759,6 +847,15 @@ var Api = class extends HttpClient {
|
|
|
759
847
|
format: "json",
|
|
760
848
|
...params
|
|
761
849
|
}),
|
|
850
|
+
updateChangeRequestById: (spaceId, changeRequestId, data, params = {}) => this.request({
|
|
851
|
+
path: `/spaces/${spaceId}/change-requests/${changeRequestId}`,
|
|
852
|
+
method: "PATCH",
|
|
853
|
+
body: data,
|
|
854
|
+
secure: true,
|
|
855
|
+
type: "application/json" /* Json */,
|
|
856
|
+
format: "json",
|
|
857
|
+
...params
|
|
858
|
+
}),
|
|
762
859
|
mergeChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
|
|
763
860
|
path: `/spaces/${spaceId}/change-requests/${changeRequestId}/merge`,
|
|
764
861
|
method: "POST",
|
|
@@ -1183,6 +1280,30 @@ var Api = class extends HttpClient {
|
|
|
1183
1280
|
secure: true,
|
|
1184
1281
|
format: "json",
|
|
1185
1282
|
...params
|
|
1283
|
+
}),
|
|
1284
|
+
createSpaceShareLink: (spaceId, data, params = {}) => this.request({
|
|
1285
|
+
path: `/spaces/${spaceId}/share-links`,
|
|
1286
|
+
method: "POST",
|
|
1287
|
+
body: data,
|
|
1288
|
+
secure: true,
|
|
1289
|
+
type: "application/json" /* Json */,
|
|
1290
|
+
format: "json",
|
|
1291
|
+
...params
|
|
1292
|
+
}),
|
|
1293
|
+
updateSpaceShareLinkById: (spaceId, shareLinkId, data, params = {}) => this.request({
|
|
1294
|
+
path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
|
|
1295
|
+
method: "PATCH",
|
|
1296
|
+
body: data,
|
|
1297
|
+
secure: true,
|
|
1298
|
+
type: "application/json" /* Json */,
|
|
1299
|
+
format: "json",
|
|
1300
|
+
...params
|
|
1301
|
+
}),
|
|
1302
|
+
deleteSpaceShareLinkById: (spaceId, shareLinkId, params = {}) => this.request({
|
|
1303
|
+
path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
|
|
1304
|
+
method: "DELETE",
|
|
1305
|
+
secure: true,
|
|
1306
|
+
...params
|
|
1186
1307
|
})
|
|
1187
1308
|
};
|
|
1188
1309
|
this.collections = {
|
|
@@ -1273,6 +1394,30 @@ var Api = class extends HttpClient {
|
|
|
1273
1394
|
type: "application/json" /* Json */,
|
|
1274
1395
|
format: "json",
|
|
1275
1396
|
...params
|
|
1397
|
+
}),
|
|
1398
|
+
createCollectionShareLink: (collectionId, data, params = {}) => this.request({
|
|
1399
|
+
path: `/collections/${collectionId}/share-links`,
|
|
1400
|
+
method: "POST",
|
|
1401
|
+
body: data,
|
|
1402
|
+
secure: true,
|
|
1403
|
+
type: "application/json" /* Json */,
|
|
1404
|
+
format: "json",
|
|
1405
|
+
...params
|
|
1406
|
+
}),
|
|
1407
|
+
updateCollectionShareLinkById: (collectionId, shareLinkId, data, params = {}) => this.request({
|
|
1408
|
+
path: `/collections/${collectionId}/share-links/${shareLinkId}`,
|
|
1409
|
+
method: "PATCH",
|
|
1410
|
+
body: data,
|
|
1411
|
+
secure: true,
|
|
1412
|
+
type: "application/json" /* Json */,
|
|
1413
|
+
format: "json",
|
|
1414
|
+
...params
|
|
1415
|
+
}),
|
|
1416
|
+
deleteCollectionShareLinkById: (collectionId, shareLinkId, params = {}) => this.request({
|
|
1417
|
+
path: `/collections/${collectionId}/share-links/${shareLinkId}`,
|
|
1418
|
+
method: "DELETE",
|
|
1419
|
+
secure: true,
|
|
1420
|
+
...params
|
|
1276
1421
|
})
|
|
1277
1422
|
};
|
|
1278
1423
|
this.integrations = {
|
|
@@ -1638,6 +1783,21 @@ var Api = class extends HttpClient {
|
|
|
1638
1783
|
format: "json",
|
|
1639
1784
|
...params
|
|
1640
1785
|
}),
|
|
1786
|
+
updateOrganizationInviteById: (organizationId, inviteId, data, params = {}) => this.request({
|
|
1787
|
+
path: `/orgs/${organizationId}/invites/${inviteId}`,
|
|
1788
|
+
method: "PATCH",
|
|
1789
|
+
body: data,
|
|
1790
|
+
secure: true,
|
|
1791
|
+
type: "application/json" /* Json */,
|
|
1792
|
+
format: "json",
|
|
1793
|
+
...params
|
|
1794
|
+
}),
|
|
1795
|
+
deleteOrganizationInviteById: (organizationId, inviteId, params = {}) => this.request({
|
|
1796
|
+
path: `/orgs/${organizationId}/invites/${inviteId}`,
|
|
1797
|
+
method: "DELETE",
|
|
1798
|
+
secure: true,
|
|
1799
|
+
...params
|
|
1800
|
+
}),
|
|
1641
1801
|
upgradeOrganizationPlan: (organizationId, data, params = {}) => this.request({
|
|
1642
1802
|
path: `/orgs/${organizationId}/billing`,
|
|
1643
1803
|
method: "POST",
|
|
@@ -1874,21 +2034,6 @@ var Api = class extends HttpClient {
|
|
|
1874
2034
|
format: "json",
|
|
1875
2035
|
...params
|
|
1876
2036
|
}),
|
|
1877
|
-
deleteCapture: (organizationId, captureId, params = {}) => this.request({
|
|
1878
|
-
path: `/orgs/${organizationId}/captures/${captureId}`,
|
|
1879
|
-
method: "DELETE",
|
|
1880
|
-
secure: true,
|
|
1881
|
-
...params
|
|
1882
|
-
}),
|
|
1883
|
-
updateCapture: (organizationId, captureId, data, params = {}) => this.request({
|
|
1884
|
-
path: `/orgs/${organizationId}/captures/${captureId}`,
|
|
1885
|
-
method: "PUT",
|
|
1886
|
-
body: data,
|
|
1887
|
-
secure: true,
|
|
1888
|
-
type: "application/json" /* Json */,
|
|
1889
|
-
format: "json",
|
|
1890
|
-
...params
|
|
1891
|
-
}),
|
|
1892
2037
|
addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
|
|
1893
2038
|
path: `/orgs/${organizationId}/captures/${captureId}/events`,
|
|
1894
2039
|
method: "POST",
|
|
@@ -1924,10 +2069,9 @@ var Api = class extends HttpClient {
|
|
|
1924
2069
|
format: "json",
|
|
1925
2070
|
...params
|
|
1926
2071
|
}),
|
|
1927
|
-
getSnippet: (organizationId, snippetId,
|
|
2072
|
+
getSnippet: (organizationId, snippetId, params = {}) => this.request({
|
|
1928
2073
|
path: `/orgs/${organizationId}/snippets/${snippetId}`,
|
|
1929
2074
|
method: "GET",
|
|
1930
|
-
query,
|
|
1931
2075
|
secure: true,
|
|
1932
2076
|
format: "json",
|
|
1933
2077
|
...params
|
|
@@ -1981,6 +2125,13 @@ var Api = class extends HttpClient {
|
|
|
1981
2125
|
format: "json",
|
|
1982
2126
|
...params
|
|
1983
2127
|
}),
|
|
2128
|
+
streamAskInOrganization: (organizationId, query, params = {}) => this.streamRequest({
|
|
2129
|
+
path: `/orgs/${organizationId}/ask/stream`,
|
|
2130
|
+
method: "GET",
|
|
2131
|
+
query,
|
|
2132
|
+
secure: true,
|
|
2133
|
+
...params
|
|
2134
|
+
}),
|
|
1984
2135
|
listContentAuditRelations: (organizationId, query, params = {}) => this.request({
|
|
1985
2136
|
path: `/orgs/${organizationId}/insights/audit-relations`,
|
|
1986
2137
|
method: "GET",
|
|
@@ -2142,6 +2293,7 @@ export {
|
|
|
2142
2293
|
ContentType,
|
|
2143
2294
|
ContentVisibility,
|
|
2144
2295
|
CustomFieldType,
|
|
2296
|
+
CustomizationBackground,
|
|
2145
2297
|
CustomizationCorners,
|
|
2146
2298
|
CustomizationFont,
|
|
2147
2299
|
CustomizationHeaderPreset,
|
|
@@ -2169,6 +2321,7 @@ export {
|
|
|
2169
2321
|
RevisionPageLayoutPreset,
|
|
2170
2322
|
RevisionPageType,
|
|
2171
2323
|
RevisionSemanticChangeType,
|
|
2324
|
+
SpaceBlockReason,
|
|
2172
2325
|
SpaceEditMode,
|
|
2173
2326
|
TeamMemberRole
|
|
2174
2327
|
};
|