@gitbook/api 0.91.0 → 0.93.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/index.cjs CHANGED
@@ -232,6 +232,7 @@ __export(src_exports, {
232
232
  IntegrationTarget: () => IntegrationTarget,
233
233
  IntegrationVisibility: () => IntegrationVisibility,
234
234
  MemberRole: () => MemberRole,
235
+ OpenAPISpecProcessingState: () => OpenAPISpecProcessingState,
235
236
  OrganizationBlockReason: () => OrganizationBlockReason,
236
237
  OrganizationCommunityType: () => OrganizationCommunityType,
237
238
  OrganizationType: () => OrganizationType,
@@ -265,7 +266,7 @@ module.exports = __toCommonJS(src_exports);
265
266
 
266
267
  // package.json
267
268
  var name = "@gitbook/api";
268
- var version = "0.91.0";
269
+ var version = "0.93.0";
269
270
 
270
271
  // src/client.ts
271
272
  var import_event_iterator = __toESM(require_node(), 1);
@@ -480,49 +481,6 @@ var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
480
481
  OrganizationBlockReason2["Security"] = "security";
481
482
  return OrganizationBlockReason2;
482
483
  })(OrganizationBlockReason || {});
483
- var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
484
- IntegrationTarget2["All"] = "all";
485
- IntegrationTarget2["Site"] = "site";
486
- IntegrationTarget2["Space"] = "space";
487
- IntegrationTarget2["Organization"] = "organization";
488
- return IntegrationTarget2;
489
- })(IntegrationTarget || {});
490
- var IntegrationVisibility = /* @__PURE__ */ ((IntegrationVisibility2) => {
491
- IntegrationVisibility2["Public"] = "public";
492
- IntegrationVisibility2["Private"] = "private";
493
- IntegrationVisibility2["Unlisted"] = "unlisted";
494
- return IntegrationVisibility2;
495
- })(IntegrationVisibility || {});
496
- var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
497
- IntegrationScope2["SnippetsRead"] = "snippets:read";
498
- IntegrationScope2["CaptureWrite"] = "capture:write";
499
- IntegrationScope2["SpaceViewsRead"] = "space:views:read";
500
- IntegrationScope2["SpaceContentRead"] = "space:content:read";
501
- IntegrationScope2["SpaceContentWrite"] = "space:content:write";
502
- IntegrationScope2["SpaceMetadataRead"] = "space:metadata:read";
503
- IntegrationScope2["SpaceMetadataWrite"] = "space:metadata:write";
504
- IntegrationScope2["SpaceScriptInject"] = "space:script:inject";
505
- IntegrationScope2["SpaceScriptCookies"] = "space:script:cookies";
506
- IntegrationScope2["SpaceGitSync"] = "space:git:sync";
507
- IntegrationScope2["SpaceVisitorAuth"] = "space:visitor:auth";
508
- IntegrationScope2["SiteMetadataRead"] = "site:metadata:read";
509
- IntegrationScope2["SiteViewsRead"] = "site:views:read";
510
- IntegrationScope2["SiteScriptInject"] = "site:script:inject";
511
- IntegrationScope2["SiteScriptCookies"] = "site:script:cookies";
512
- IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
513
- return IntegrationScope2;
514
- })(IntegrationScope || {});
515
- var IntegrationCategory = /* @__PURE__ */ ((IntegrationCategory2) => {
516
- IntegrationCategory2["Analytics"] = "analytics";
517
- IntegrationCategory2["Captures"] = "captures";
518
- IntegrationCategory2["Collaboration"] = "collaboration";
519
- IntegrationCategory2["Content"] = "content";
520
- IntegrationCategory2["Gitsync"] = "gitsync";
521
- IntegrationCategory2["Marketing"] = "marketing";
522
- IntegrationCategory2["VisitorAuth"] = "visitor-auth";
523
- IntegrationCategory2["Other"] = "other";
524
- return IntegrationCategory2;
525
- })(IntegrationCategory || {});
526
484
  var ContentReferenceStatus = /* @__PURE__ */ ((ContentReferenceStatus2) => {
527
485
  ContentReferenceStatus2["Ok"] = "ok";
528
486
  ContentReferenceStatus2["Broken"] = "broken";
@@ -630,6 +588,46 @@ var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
630
588
  CustomizationThemeMode2["Dark"] = "dark";
631
589
  return CustomizationThemeMode2;
632
590
  })(CustomizationThemeMode || {});
591
+ var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
592
+ IntegrationTarget2["All"] = "all";
593
+ IntegrationTarget2["Site"] = "site";
594
+ IntegrationTarget2["Space"] = "space";
595
+ IntegrationTarget2["Organization"] = "organization";
596
+ return IntegrationTarget2;
597
+ })(IntegrationTarget || {});
598
+ var IntegrationVisibility = /* @__PURE__ */ ((IntegrationVisibility2) => {
599
+ IntegrationVisibility2["Public"] = "public";
600
+ IntegrationVisibility2["Private"] = "private";
601
+ IntegrationVisibility2["Unlisted"] = "unlisted";
602
+ return IntegrationVisibility2;
603
+ })(IntegrationVisibility || {});
604
+ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
605
+ IntegrationScope2["SpaceViewsRead"] = "space:views:read";
606
+ IntegrationScope2["SpaceContentRead"] = "space:content:read";
607
+ IntegrationScope2["SpaceContentWrite"] = "space:content:write";
608
+ IntegrationScope2["SpaceMetadataRead"] = "space:metadata:read";
609
+ IntegrationScope2["SpaceMetadataWrite"] = "space:metadata:write";
610
+ IntegrationScope2["SpaceScriptInject"] = "space:script:inject";
611
+ IntegrationScope2["SpaceScriptCookies"] = "space:script:cookies";
612
+ IntegrationScope2["SpaceGitSync"] = "space:git:sync";
613
+ IntegrationScope2["SpaceVisitorAuth"] = "space:visitor:auth";
614
+ IntegrationScope2["SiteMetadataRead"] = "site:metadata:read";
615
+ IntegrationScope2["SiteViewsRead"] = "site:views:read";
616
+ IntegrationScope2["SiteScriptInject"] = "site:script:inject";
617
+ IntegrationScope2["SiteScriptCookies"] = "site:script:cookies";
618
+ IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
619
+ return IntegrationScope2;
620
+ })(IntegrationScope || {});
621
+ var IntegrationCategory = /* @__PURE__ */ ((IntegrationCategory2) => {
622
+ IntegrationCategory2["Analytics"] = "analytics";
623
+ IntegrationCategory2["Collaboration"] = "collaboration";
624
+ IntegrationCategory2["Content"] = "content";
625
+ IntegrationCategory2["Gitsync"] = "gitsync";
626
+ IntegrationCategory2["Marketing"] = "marketing";
627
+ IntegrationCategory2["VisitorAuth"] = "visitor-auth";
628
+ IntegrationCategory2["Other"] = "other";
629
+ return IntegrationCategory2;
630
+ })(IntegrationCategory || {});
633
631
  var CustomFieldType = /* @__PURE__ */ ((CustomFieldType2) => {
634
632
  CustomFieldType2["Text"] = "text";
635
633
  CustomFieldType2["Number"] = "number";
@@ -909,6 +907,12 @@ var SpaceBlockReason = /* @__PURE__ */ ((SpaceBlockReason2) => {
909
907
  SpaceBlockReason2["UNWANTED_SOFTWARE"] = "UNWANTED_SOFTWARE";
910
908
  return SpaceBlockReason2;
911
909
  })(SpaceBlockReason || {});
910
+ var OpenAPISpecProcessingState = /* @__PURE__ */ ((OpenAPISpecProcessingState2) => {
911
+ OpenAPISpecProcessingState2["Pending"] = "pending";
912
+ OpenAPISpecProcessingState2["Progress"] = "progress";
913
+ OpenAPISpecProcessingState2["Complete"] = "complete";
914
+ return OpenAPISpecProcessingState2;
915
+ })(OpenAPISpecProcessingState || {});
912
916
  var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2) => {
913
917
  RevisionSemanticChangeType2["PageCreated"] = "page_created";
914
918
  RevisionSemanticChangeType2["PageEdited"] = "page_edited";
@@ -1550,19 +1554,22 @@ var Api = class extends HttpClient {
1550
1554
  format: "json",
1551
1555
  ...params
1552
1556
  }),
1553
- getComputedDocument: (spaceId, query, params = {}) => this.request({
1557
+ getComputedDocument: (spaceId, data, query, params = {}) => this.request({
1554
1558
  path: `/spaces/${spaceId}/content/computed/document`,
1555
- method: "GET",
1559
+ method: "POST",
1556
1560
  query,
1561
+ body: data,
1557
1562
  secure: true,
1563
+ type: "application/json" /* Json */,
1558
1564
  format: "json",
1559
1565
  ...params
1560
1566
  }),
1561
- getComputedPage: (spaceId, query, params = {}) => this.request({
1562
- path: `/spaces/${spaceId}/content/computed/page`,
1563
- method: "GET",
1564
- query,
1567
+ getComputedRevision: (spaceId, data, params = {}) => this.request({
1568
+ path: `/spaces/${spaceId}/content/computed/revision`,
1569
+ method: "POST",
1570
+ body: data,
1565
1571
  secure: true,
1572
+ type: "application/json" /* Json */,
1566
1573
  format: "json",
1567
1574
  ...params
1568
1575
  }),
@@ -2695,11 +2702,12 @@ var Api = class extends HttpClient {
2695
2702
  type: "application/json" /* Json */,
2696
2703
  ...params
2697
2704
  }),
2698
- previewMigrateOrganizationPlan: (organizationId, query, params = {}) => this.request({
2699
- path: `/orgs/${organizationId}/billing/migrate`,
2700
- method: "GET",
2701
- query,
2705
+ previewMigrateOrganizationPlan: (organizationId, data, params = {}) => this.request({
2706
+ path: `/orgs/${organizationId}/billing/migrate/preview`,
2707
+ method: "POST",
2708
+ body: data,
2702
2709
  secure: true,
2710
+ type: "application/json" /* Json */,
2703
2711
  format: "json",
2704
2712
  ...params
2705
2713
  }),
@@ -2940,105 +2948,6 @@ var Api = class extends HttpClient {
2940
2948
  format: "json",
2941
2949
  ...params
2942
2950
  }),
2943
- listCaptures: (organizationId, query, params = {}) => this.request({
2944
- path: `/orgs/${organizationId}/captures`,
2945
- method: "GET",
2946
- query,
2947
- secure: true,
2948
- format: "json",
2949
- ...params
2950
- }),
2951
- startCapture: (organizationId, data, params = {}) => this.request({
2952
- path: `/orgs/${organizationId}/captures`,
2953
- method: "POST",
2954
- body: data,
2955
- secure: true,
2956
- type: "application/json" /* Json */,
2957
- format: "json",
2958
- ...params
2959
- }),
2960
- getCapture: (organizationId, captureId, query, params = {}) => this.request({
2961
- path: `/orgs/${organizationId}/captures/${captureId}`,
2962
- method: "GET",
2963
- query,
2964
- secure: true,
2965
- format: "json",
2966
- ...params
2967
- }),
2968
- addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
2969
- path: `/orgs/${organizationId}/captures/${captureId}/events`,
2970
- method: "POST",
2971
- body: data,
2972
- secure: true,
2973
- type: "application/json" /* Json */,
2974
- ...params
2975
- }),
2976
- stopCapture: (organizationId, captureId, data, query, params = {}) => this.request({
2977
- path: `/orgs/${organizationId}/captures/${captureId}/stop`,
2978
- method: "POST",
2979
- query,
2980
- body: data,
2981
- secure: true,
2982
- type: "application/json" /* Json */,
2983
- format: "json",
2984
- ...params
2985
- }),
2986
- listSnippets: (organizationId, query, params = {}) => this.request({
2987
- path: `/orgs/${organizationId}/snippets`,
2988
- method: "GET",
2989
- query,
2990
- secure: true,
2991
- format: "json",
2992
- ...params
2993
- }),
2994
- createSnippet: (organizationId, data, params = {}) => this.request({
2995
- path: `/orgs/${organizationId}/snippets`,
2996
- method: "POST",
2997
- body: data,
2998
- secure: true,
2999
- type: "application/json" /* Json */,
3000
- format: "json",
3001
- ...params
3002
- }),
3003
- getSnippet: (organizationId, snippetId, params = {}) => this.request({
3004
- path: `/orgs/${organizationId}/snippets/${snippetId}`,
3005
- method: "GET",
3006
- secure: true,
3007
- format: "json",
3008
- ...params
3009
- }),
3010
- deleteSnippet: (organizationId, snippetId, params = {}) => this.request({
3011
- path: `/orgs/${organizationId}/snippets/${snippetId}`,
3012
- method: "DELETE",
3013
- secure: true,
3014
- ...params
3015
- }),
3016
- updateSnippet: (organizationId, snippetId, data, params = {}) => this.request({
3017
- path: `/orgs/${organizationId}/snippets/${snippetId}`,
3018
- method: "PUT",
3019
- body: data,
3020
- secure: true,
3021
- type: "application/json" /* Json */,
3022
- format: "json",
3023
- ...params
3024
- }),
3025
- moveSnippet: (organizationId, snippetId, data, params = {}) => this.request({
3026
- path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
3027
- method: "POST",
3028
- body: data,
3029
- secure: true,
3030
- type: "application/json" /* Json */,
3031
- format: "json",
3032
- ...params
3033
- }),
3034
- getSnippetSuggestedLocations: (organizationId, snippetId, query, params = {}) => this.request({
3035
- path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
3036
- method: "GET",
3037
- query,
3038
- secure: true,
3039
- format: "json",
3040
- ...params
3041
- }),
3042
2951
  askInOrganization: (organizationId, data, query, params = {}) => this.request({
3043
2952
  path: `/orgs/${organizationId}/ask`,
3044
2953
  method: "POST",
@@ -3283,6 +3192,14 @@ var Api = class extends HttpClient {
3283
3192
  format: "json",
3284
3193
  ...params
3285
3194
  }),
3195
+ listSiteSectionGroups: (organizationId, siteId, query, params = {}) => this.request({
3196
+ path: `/orgs/${organizationId}/sites/${siteId}/section-groups`,
3197
+ method: "GET",
3198
+ query,
3199
+ secure: true,
3200
+ format: "json",
3201
+ ...params
3202
+ }),
3286
3203
  addSectionGroupToSite: (organizationId, siteId, data, params = {}) => this.request({
3287
3204
  path: `/orgs/${organizationId}/sites/${siteId}/section-groups`,
3288
3205
  method: "POST",
@@ -3307,6 +3224,21 @@ var Api = class extends HttpClient {
3307
3224
  secure: true,
3308
3225
  ...params
3309
3226
  }),
3227
+ addSectionToGroup: (organizationId, siteId, siteSectionGroupId, data, params = {}) => this.request({
3228
+ path: `/orgs/${organizationId}/sites/${siteId}/section-groups/${siteSectionGroupId}/sections`,
3229
+ method: "POST",
3230
+ body: data,
3231
+ secure: true,
3232
+ type: "application/json" /* Json */,
3233
+ format: "json",
3234
+ ...params
3235
+ }),
3236
+ removeSectionFromGroup: (organizationId, siteId, siteSectionGroupId, siteSectionId, params = {}) => this.request({
3237
+ path: `/orgs/${organizationId}/sites/${siteId}/section-groups/${siteSectionGroupId}/sections/${siteSectionId}`,
3238
+ method: "DELETE",
3239
+ secure: true,
3240
+ ...params
3241
+ }),
3310
3242
  addSectionToSite: (organizationId, siteId, data, params = {}) => this.request({
3311
3243
  path: `/orgs/${organizationId}/sites/${siteId}/sections`,
3312
3244
  method: "POST",
@@ -3426,6 +3358,15 @@ var Api = class extends HttpClient {
3426
3358
  format: "json",
3427
3359
  ...params
3428
3360
  }),
3361
+ moveSiteSectionGroup: (organizationId, siteId, siteSectionGroupId, data, params = {}) => this.request({
3362
+ path: `/orgs/${organizationId}/sites/${siteId}/section-groups/${siteSectionGroupId}/move`,
3363
+ method: "POST",
3364
+ body: data,
3365
+ secure: true,
3366
+ type: "application/json" /* Json */,
3367
+ format: "json",
3368
+ ...params
3369
+ }),
3429
3370
  moveSiteSection: (organizationId, siteId, siteSectionId, data, params = {}) => this.request({
3430
3371
  path: `/orgs/${organizationId}/sites/${siteId}/sections/${siteSectionId}/move`,
3431
3372
  method: "POST",
@@ -3547,6 +3488,72 @@ var Api = class extends HttpClient {
3547
3488
  secure: true,
3548
3489
  format: "json",
3549
3490
  ...params
3491
+ }),
3492
+ listOpenApiSpecs: (organizationId, query, params = {}) => this.request({
3493
+ path: `/orgs/${organizationId}/openapi`,
3494
+ method: "GET",
3495
+ query,
3496
+ secure: true,
3497
+ format: "json",
3498
+ ...params
3499
+ }),
3500
+ getOpenApiSpecBySlug: (organizationId, specSlug, params = {}) => this.request({
3501
+ path: `/orgs/${organizationId}/openapi/${specSlug}`,
3502
+ method: "GET",
3503
+ secure: true,
3504
+ format: "json",
3505
+ ...params
3506
+ }),
3507
+ createOrUpdateOpenApiSpecBySlug: (organizationId, specSlug, data, params = {}) => this.request({
3508
+ path: `/orgs/${organizationId}/openapi/${specSlug}`,
3509
+ method: "PUT",
3510
+ body: data,
3511
+ secure: true,
3512
+ type: "application/json" /* Json */,
3513
+ format: "json",
3514
+ ...params
3515
+ }),
3516
+ deleteOpenApiSpecBySlug: (organizationId, specSlug, params = {}) => this.request({
3517
+ path: `/orgs/${organizationId}/openapi/${specSlug}`,
3518
+ method: "DELETE",
3519
+ secure: true,
3520
+ ...params
3521
+ }),
3522
+ listOpenApiSpecVersions: (organizationId, specSlug, query, params = {}) => this.request({
3523
+ path: `/orgs/${organizationId}/openapi/${specSlug}/versions`,
3524
+ method: "GET",
3525
+ query,
3526
+ secure: true,
3527
+ format: "json",
3528
+ ...params
3529
+ }),
3530
+ getLatestOpenApiSpecVersion: (organizationId, specSlug, params = {}) => this.request({
3531
+ path: `/orgs/${organizationId}/openapi/${specSlug}/versions/latest`,
3532
+ method: "GET",
3533
+ secure: true,
3534
+ format: "json",
3535
+ ...params
3536
+ }),
3537
+ getLatestOpenApiSpecVersionContent: (organizationId, specSlug, params = {}) => this.request({
3538
+ path: `/orgs/${organizationId}/openapi/${specSlug}/versions/latest/content`,
3539
+ method: "GET",
3540
+ secure: true,
3541
+ format: "json",
3542
+ ...params
3543
+ }),
3544
+ getOpenApiSpecVersionById: (organizationId, specSlug, versionId, params = {}) => this.request({
3545
+ path: `/orgs/${organizationId}/openapi/${specSlug}/versions/${versionId}`,
3546
+ method: "GET",
3547
+ secure: true,
3548
+ format: "json",
3549
+ ...params
3550
+ }),
3551
+ getOpenApiSpecVersionContentById: (organizationId, specSlug, versionId, params = {}) => this.request({
3552
+ path: `/orgs/${organizationId}/openapi/${specSlug}/versions/${versionId}/content`,
3553
+ method: "GET",
3554
+ secure: true,
3555
+ format: "json",
3556
+ ...params
3550
3557
  })
3551
3558
  };
3552
3559
  customHostnames = {
@@ -3776,6 +3783,7 @@ var GitBookAPI = class extends Api {
3776
3783
  IntegrationTarget,
3777
3784
  IntegrationVisibility,
3778
3785
  MemberRole,
3786
+ OpenAPISpecProcessingState,
3779
3787
  OrganizationBlockReason,
3780
3788
  OrganizationCommunityType,
3781
3789
  OrganizationType,