@gitbook/api 0.79.0 → 0.80.1
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 +214 -92
- package/dist/index.cjs +54 -16
- package/dist/index.js +51 -16
- package/package.json +1 -1
- package/spec/openapi.json +609 -236
- package/spec/openapi.yaml +414 -161
package/dist/index.cjs
CHANGED
|
@@ -210,8 +210,10 @@ __export(src_exports, {
|
|
|
210
210
|
GITBOOK_DEFAULT_ENDPOINT: () => GITBOOK_DEFAULT_ENDPOINT,
|
|
211
211
|
GitBookAPI: () => GitBookAPI,
|
|
212
212
|
GitBookAPIError: () => GitBookAPIError,
|
|
213
|
+
GitSyncOperationDirection: () => GitSyncOperationDirection,
|
|
213
214
|
GitSyncOperationStage: () => GitSyncOperationStage,
|
|
214
215
|
GitSyncOperationState: () => GitSyncOperationState,
|
|
216
|
+
GitSyncProvider: () => GitSyncProvider,
|
|
215
217
|
HttpClient: () => HttpClient,
|
|
216
218
|
ImportContentSource: () => ImportContentSource,
|
|
217
219
|
InsightsInterval: () => InsightsInterval,
|
|
@@ -223,6 +225,7 @@ __export(src_exports, {
|
|
|
223
225
|
IntegrationTarget: () => IntegrationTarget,
|
|
224
226
|
IntegrationVisibility: () => IntegrationVisibility,
|
|
225
227
|
MemberRole: () => MemberRole,
|
|
228
|
+
OrganizationBlockReason: () => OrganizationBlockReason,
|
|
226
229
|
OrganizationCommunityType: () => OrganizationCommunityType,
|
|
227
230
|
OrganizationType: () => OrganizationType,
|
|
228
231
|
OrganizationUseCase: () => OrganizationUseCase,
|
|
@@ -244,7 +247,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
244
247
|
|
|
245
248
|
// package.json
|
|
246
249
|
var name = "@gitbook/api";
|
|
247
|
-
var version = "0.
|
|
250
|
+
var version = "0.80.1";
|
|
248
251
|
|
|
249
252
|
// src/client.ts
|
|
250
253
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -384,12 +387,12 @@ var SpaceEditMode = /* @__PURE__ */ ((SpaceEditMode2) => {
|
|
|
384
387
|
SpaceEditMode2["Locked"] = "locked";
|
|
385
388
|
return SpaceEditMode2;
|
|
386
389
|
})(SpaceEditMode || {});
|
|
387
|
-
var
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return
|
|
392
|
-
})(
|
|
390
|
+
var GitSyncProvider = /* @__PURE__ */ ((GitSyncProvider2) => {
|
|
391
|
+
GitSyncProvider2["Github"] = "github";
|
|
392
|
+
GitSyncProvider2["Gitlab"] = "gitlab";
|
|
393
|
+
GitSyncProvider2["GithubLegacy"] = "github-legacy";
|
|
394
|
+
return GitSyncProvider2;
|
|
395
|
+
})(GitSyncProvider || {});
|
|
393
396
|
var MemberRole = /* @__PURE__ */ ((MemberRole2) => {
|
|
394
397
|
MemberRole2["Admin"] = "admin";
|
|
395
398
|
MemberRole2["Create"] = "create";
|
|
@@ -466,6 +469,7 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
|
|
|
466
469
|
BillingProduct2["Plus2024"] = "plus_2024";
|
|
467
470
|
BillingProduct2["Pro2024"] = "pro_2024";
|
|
468
471
|
BillingProduct2["Enterprise2024"] = "enterprise_2024";
|
|
472
|
+
BillingProduct2["Community2024"] = "community_2024";
|
|
469
473
|
BillingProduct2["Free"] = "free";
|
|
470
474
|
BillingProduct2["Plus"] = "plus";
|
|
471
475
|
BillingProduct2["Pro"] = "pro";
|
|
@@ -480,6 +484,10 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
|
|
|
480
484
|
BillingProduct2["BusinessDec2021"] = "business_dec_2021";
|
|
481
485
|
return BillingProduct2;
|
|
482
486
|
})(BillingProduct || {});
|
|
487
|
+
var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
|
|
488
|
+
OrganizationBlockReason2["Security"] = "security";
|
|
489
|
+
return OrganizationBlockReason2;
|
|
490
|
+
})(OrganizationBlockReason || {});
|
|
483
491
|
var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
|
|
484
492
|
IntegrationTarget2["All"] = "all";
|
|
485
493
|
IntegrationTarget2["Site"] = "site";
|
|
@@ -770,6 +778,17 @@ var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2)
|
|
|
770
778
|
RevisionSemanticChangeType2["CustomFieldsEdited"] = "custom_fields_edited";
|
|
771
779
|
return RevisionSemanticChangeType2;
|
|
772
780
|
})(RevisionSemanticChangeType || {});
|
|
781
|
+
var GitSyncOperationState = /* @__PURE__ */ ((GitSyncOperationState2) => {
|
|
782
|
+
GitSyncOperationState2["Running"] = "running";
|
|
783
|
+
GitSyncOperationState2["Failure"] = "failure";
|
|
784
|
+
GitSyncOperationState2["Success"] = "success";
|
|
785
|
+
return GitSyncOperationState2;
|
|
786
|
+
})(GitSyncOperationState || {});
|
|
787
|
+
var GitSyncOperationDirection = /* @__PURE__ */ ((GitSyncOperationDirection2) => {
|
|
788
|
+
GitSyncOperationDirection2["Export"] = "export";
|
|
789
|
+
GitSyncOperationDirection2["Import"] = "import";
|
|
790
|
+
return GitSyncOperationDirection2;
|
|
791
|
+
})(GitSyncOperationDirection || {});
|
|
773
792
|
var GitSyncOperationStage = /* @__PURE__ */ ((GitSyncOperationStage2) => {
|
|
774
793
|
GitSyncOperationStage2["RepoFetch"] = "repo_fetch";
|
|
775
794
|
GitSyncOperationStage2["ConfigCheck"] = "config_check";
|
|
@@ -939,7 +958,9 @@ var HttpClient = class {
|
|
|
939
958
|
});
|
|
940
959
|
};
|
|
941
960
|
streamRequest = ({
|
|
961
|
+
body,
|
|
942
962
|
path,
|
|
963
|
+
type,
|
|
943
964
|
baseUrl,
|
|
944
965
|
cancelToken,
|
|
945
966
|
secure,
|
|
@@ -951,11 +972,17 @@ var HttpClient = class {
|
|
|
951
972
|
const requestQuery = params.query;
|
|
952
973
|
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
953
974
|
const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
|
|
975
|
+
const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
|
|
954
976
|
const response = await this.customFetch(
|
|
955
977
|
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
|
|
956
978
|
{
|
|
957
979
|
...requestParams,
|
|
958
|
-
|
|
980
|
+
headers: {
|
|
981
|
+
...requestParams.headers || {},
|
|
982
|
+
...type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}
|
|
983
|
+
},
|
|
984
|
+
signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
|
|
985
|
+
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
|
|
959
986
|
}
|
|
960
987
|
);
|
|
961
988
|
if (!response.ok) {
|
|
@@ -2450,14 +2477,6 @@ var Api = class extends HttpClient {
|
|
|
2450
2477
|
format: "json",
|
|
2451
2478
|
...params
|
|
2452
2479
|
}),
|
|
2453
|
-
listSpacesWithGitSyncInOrganizationById: (organizationId, query, params = {}) => this.request({
|
|
2454
|
-
path: `/orgs/${organizationId}/spaces/gitsync`,
|
|
2455
|
-
method: "GET",
|
|
2456
|
-
query,
|
|
2457
|
-
secure: true,
|
|
2458
|
-
format: "json",
|
|
2459
|
-
...params
|
|
2460
|
-
}),
|
|
2461
2480
|
listCollectionsInOrganizationById: (organizationId, query, params = {}) => this.request({
|
|
2462
2481
|
path: `/orgs/${organizationId}/collections`,
|
|
2463
2482
|
method: "GET",
|
|
@@ -2599,6 +2618,13 @@ var Api = class extends HttpClient {
|
|
|
2599
2618
|
secure: true,
|
|
2600
2619
|
...params
|
|
2601
2620
|
}),
|
|
2621
|
+
listSsoProviderLoginsInOrganization: (organizationId, params = {}) => this.request({
|
|
2622
|
+
path: `/orgs/${organizationId}/sso`,
|
|
2623
|
+
method: "GET",
|
|
2624
|
+
secure: true,
|
|
2625
|
+
format: "json",
|
|
2626
|
+
...params
|
|
2627
|
+
}),
|
|
2602
2628
|
getUsageForOrganizationById: (organizationId, params = {}) => this.request({
|
|
2603
2629
|
path: `/orgs/${organizationId}/usage`,
|
|
2604
2630
|
method: "GET",
|
|
@@ -3033,6 +3059,15 @@ var Api = class extends HttpClient {
|
|
|
3033
3059
|
format: "json",
|
|
3034
3060
|
...params
|
|
3035
3061
|
}),
|
|
3062
|
+
streamAskInSite: (organizationId, siteId, data, query, params = {}) => this.streamRequest({
|
|
3063
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ask`,
|
|
3064
|
+
method: "POST",
|
|
3065
|
+
query,
|
|
3066
|
+
body: data,
|
|
3067
|
+
secure: true,
|
|
3068
|
+
type: "application/json" /* Json */,
|
|
3069
|
+
...params
|
|
3070
|
+
}),
|
|
3036
3071
|
updateSiteSpaceById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
|
|
3037
3072
|
path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
|
|
3038
3073
|
method: "PATCH",
|
|
@@ -3393,8 +3428,10 @@ var GitBookAPI = class extends Api {
|
|
|
3393
3428
|
GITBOOK_DEFAULT_ENDPOINT,
|
|
3394
3429
|
GitBookAPI,
|
|
3395
3430
|
GitBookAPIError,
|
|
3431
|
+
GitSyncOperationDirection,
|
|
3396
3432
|
GitSyncOperationStage,
|
|
3397
3433
|
GitSyncOperationState,
|
|
3434
|
+
GitSyncProvider,
|
|
3398
3435
|
HttpClient,
|
|
3399
3436
|
ImportContentSource,
|
|
3400
3437
|
InsightsInterval,
|
|
@@ -3406,6 +3443,7 @@ var GitBookAPI = class extends Api {
|
|
|
3406
3443
|
IntegrationTarget,
|
|
3407
3444
|
IntegrationVisibility,
|
|
3408
3445
|
MemberRole,
|
|
3446
|
+
OrganizationBlockReason,
|
|
3409
3447
|
OrganizationCommunityType,
|
|
3410
3448
|
OrganizationType,
|
|
3411
3449
|
OrganizationUseCase,
|
package/dist/index.js
CHANGED
|
@@ -172,7 +172,7 @@ var require_node = __commonJS({
|
|
|
172
172
|
|
|
173
173
|
// package.json
|
|
174
174
|
var name = "@gitbook/api";
|
|
175
|
-
var version = "0.
|
|
175
|
+
var version = "0.80.1";
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
178
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -312,12 +312,12 @@ var SpaceEditMode = /* @__PURE__ */ ((SpaceEditMode2) => {
|
|
|
312
312
|
SpaceEditMode2["Locked"] = "locked";
|
|
313
313
|
return SpaceEditMode2;
|
|
314
314
|
})(SpaceEditMode || {});
|
|
315
|
-
var
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
return
|
|
320
|
-
})(
|
|
315
|
+
var GitSyncProvider = /* @__PURE__ */ ((GitSyncProvider2) => {
|
|
316
|
+
GitSyncProvider2["Github"] = "github";
|
|
317
|
+
GitSyncProvider2["Gitlab"] = "gitlab";
|
|
318
|
+
GitSyncProvider2["GithubLegacy"] = "github-legacy";
|
|
319
|
+
return GitSyncProvider2;
|
|
320
|
+
})(GitSyncProvider || {});
|
|
321
321
|
var MemberRole = /* @__PURE__ */ ((MemberRole2) => {
|
|
322
322
|
MemberRole2["Admin"] = "admin";
|
|
323
323
|
MemberRole2["Create"] = "create";
|
|
@@ -394,6 +394,7 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
|
|
|
394
394
|
BillingProduct2["Plus2024"] = "plus_2024";
|
|
395
395
|
BillingProduct2["Pro2024"] = "pro_2024";
|
|
396
396
|
BillingProduct2["Enterprise2024"] = "enterprise_2024";
|
|
397
|
+
BillingProduct2["Community2024"] = "community_2024";
|
|
397
398
|
BillingProduct2["Free"] = "free";
|
|
398
399
|
BillingProduct2["Plus"] = "plus";
|
|
399
400
|
BillingProduct2["Pro"] = "pro";
|
|
@@ -408,6 +409,10 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
|
|
|
408
409
|
BillingProduct2["BusinessDec2021"] = "business_dec_2021";
|
|
409
410
|
return BillingProduct2;
|
|
410
411
|
})(BillingProduct || {});
|
|
412
|
+
var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
|
|
413
|
+
OrganizationBlockReason2["Security"] = "security";
|
|
414
|
+
return OrganizationBlockReason2;
|
|
415
|
+
})(OrganizationBlockReason || {});
|
|
411
416
|
var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
|
|
412
417
|
IntegrationTarget2["All"] = "all";
|
|
413
418
|
IntegrationTarget2["Site"] = "site";
|
|
@@ -698,6 +703,17 @@ var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2)
|
|
|
698
703
|
RevisionSemanticChangeType2["CustomFieldsEdited"] = "custom_fields_edited";
|
|
699
704
|
return RevisionSemanticChangeType2;
|
|
700
705
|
})(RevisionSemanticChangeType || {});
|
|
706
|
+
var GitSyncOperationState = /* @__PURE__ */ ((GitSyncOperationState2) => {
|
|
707
|
+
GitSyncOperationState2["Running"] = "running";
|
|
708
|
+
GitSyncOperationState2["Failure"] = "failure";
|
|
709
|
+
GitSyncOperationState2["Success"] = "success";
|
|
710
|
+
return GitSyncOperationState2;
|
|
711
|
+
})(GitSyncOperationState || {});
|
|
712
|
+
var GitSyncOperationDirection = /* @__PURE__ */ ((GitSyncOperationDirection2) => {
|
|
713
|
+
GitSyncOperationDirection2["Export"] = "export";
|
|
714
|
+
GitSyncOperationDirection2["Import"] = "import";
|
|
715
|
+
return GitSyncOperationDirection2;
|
|
716
|
+
})(GitSyncOperationDirection || {});
|
|
701
717
|
var GitSyncOperationStage = /* @__PURE__ */ ((GitSyncOperationStage2) => {
|
|
702
718
|
GitSyncOperationStage2["RepoFetch"] = "repo_fetch";
|
|
703
719
|
GitSyncOperationStage2["ConfigCheck"] = "config_check";
|
|
@@ -867,7 +883,9 @@ var HttpClient = class {
|
|
|
867
883
|
});
|
|
868
884
|
};
|
|
869
885
|
streamRequest = ({
|
|
886
|
+
body,
|
|
870
887
|
path,
|
|
888
|
+
type,
|
|
871
889
|
baseUrl,
|
|
872
890
|
cancelToken,
|
|
873
891
|
secure,
|
|
@@ -879,11 +897,17 @@ var HttpClient = class {
|
|
|
879
897
|
const requestQuery = params.query;
|
|
880
898
|
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
881
899
|
const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
|
|
900
|
+
const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
|
|
882
901
|
const response = await this.customFetch(
|
|
883
902
|
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
|
|
884
903
|
{
|
|
885
904
|
...requestParams,
|
|
886
|
-
|
|
905
|
+
headers: {
|
|
906
|
+
...requestParams.headers || {},
|
|
907
|
+
...type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}
|
|
908
|
+
},
|
|
909
|
+
signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
|
|
910
|
+
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
|
|
887
911
|
}
|
|
888
912
|
);
|
|
889
913
|
if (!response.ok) {
|
|
@@ -2378,14 +2402,6 @@ var Api = class extends HttpClient {
|
|
|
2378
2402
|
format: "json",
|
|
2379
2403
|
...params
|
|
2380
2404
|
}),
|
|
2381
|
-
listSpacesWithGitSyncInOrganizationById: (organizationId, query, params = {}) => this.request({
|
|
2382
|
-
path: `/orgs/${organizationId}/spaces/gitsync`,
|
|
2383
|
-
method: "GET",
|
|
2384
|
-
query,
|
|
2385
|
-
secure: true,
|
|
2386
|
-
format: "json",
|
|
2387
|
-
...params
|
|
2388
|
-
}),
|
|
2389
2405
|
listCollectionsInOrganizationById: (organizationId, query, params = {}) => this.request({
|
|
2390
2406
|
path: `/orgs/${organizationId}/collections`,
|
|
2391
2407
|
method: "GET",
|
|
@@ -2527,6 +2543,13 @@ var Api = class extends HttpClient {
|
|
|
2527
2543
|
secure: true,
|
|
2528
2544
|
...params
|
|
2529
2545
|
}),
|
|
2546
|
+
listSsoProviderLoginsInOrganization: (organizationId, params = {}) => this.request({
|
|
2547
|
+
path: `/orgs/${organizationId}/sso`,
|
|
2548
|
+
method: "GET",
|
|
2549
|
+
secure: true,
|
|
2550
|
+
format: "json",
|
|
2551
|
+
...params
|
|
2552
|
+
}),
|
|
2530
2553
|
getUsageForOrganizationById: (organizationId, params = {}) => this.request({
|
|
2531
2554
|
path: `/orgs/${organizationId}/usage`,
|
|
2532
2555
|
method: "GET",
|
|
@@ -2961,6 +2984,15 @@ var Api = class extends HttpClient {
|
|
|
2961
2984
|
format: "json",
|
|
2962
2985
|
...params
|
|
2963
2986
|
}),
|
|
2987
|
+
streamAskInSite: (organizationId, siteId, data, query, params = {}) => this.streamRequest({
|
|
2988
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ask`,
|
|
2989
|
+
method: "POST",
|
|
2990
|
+
query,
|
|
2991
|
+
body: data,
|
|
2992
|
+
secure: true,
|
|
2993
|
+
type: "application/json" /* Json */,
|
|
2994
|
+
...params
|
|
2995
|
+
}),
|
|
2964
2996
|
updateSiteSpaceById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
|
|
2965
2997
|
path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
|
|
2966
2998
|
method: "PATCH",
|
|
@@ -3320,8 +3352,10 @@ export {
|
|
|
3320
3352
|
GITBOOK_DEFAULT_ENDPOINT,
|
|
3321
3353
|
GitBookAPI,
|
|
3322
3354
|
GitBookAPIError,
|
|
3355
|
+
GitSyncOperationDirection,
|
|
3323
3356
|
GitSyncOperationStage,
|
|
3324
3357
|
GitSyncOperationState,
|
|
3358
|
+
GitSyncProvider,
|
|
3325
3359
|
HttpClient,
|
|
3326
3360
|
ImportContentSource,
|
|
3327
3361
|
InsightsInterval,
|
|
@@ -3333,6 +3367,7 @@ export {
|
|
|
3333
3367
|
IntegrationTarget,
|
|
3334
3368
|
IntegrationVisibility,
|
|
3335
3369
|
MemberRole,
|
|
3370
|
+
OrganizationBlockReason,
|
|
3336
3371
|
OrganizationCommunityType,
|
|
3337
3372
|
OrganizationType,
|
|
3338
3373
|
OrganizationUseCase,
|