@gitbook/api 0.59.0 → 0.61.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
@@ -184,13 +184,12 @@ __export(src_exports, {
184
184
  Api: () => Api,
185
185
  BillingInterval: () => BillingInterval,
186
186
  BillingProduct: () => BillingProduct,
187
+ BillingTrialStatus: () => BillingTrialStatus,
187
188
  ChangeRequestReviewStatus: () => ChangeRequestReviewStatus,
188
189
  ChangeRequestStatus: () => ChangeRequestStatus,
189
190
  CloudflareHostnameStatus: () => CloudflareHostnameStatus,
190
191
  CloudflareHostnameTLSStatus: () => CloudflareHostnameTLSStatus,
191
192
  CloudflareHostnameTLSValidationMethod: () => CloudflareHostnameTLSValidationMethod,
192
- ContentAuditRelationStatus: () => ContentAuditRelationStatus,
193
- ContentAuditRelationType: () => ContentAuditRelationType,
194
193
  ContentKitIcon: () => ContentKitIcon,
195
194
  ContentReferenceStatus: () => ContentReferenceStatus,
196
195
  ContentType: () => ContentType,
@@ -229,6 +228,8 @@ __export(src_exports, {
229
228
  RevisionPageLayoutPreset: () => RevisionPageLayoutPreset,
230
229
  RevisionPageType: () => RevisionPageType,
231
230
  RevisionSemanticChangeType: () => RevisionSemanticChangeType,
231
+ SiteAdsStatus: () => SiteAdsStatus,
232
+ SiteAdsTopic: () => SiteAdsTopic,
232
233
  SiteType: () => SiteType,
233
234
  SiteVisibility: () => SiteVisibility,
234
235
  SpaceBlockReason: () => SpaceBlockReason,
@@ -239,7 +240,7 @@ module.exports = __toCommonJS(src_exports);
239
240
 
240
241
  // package.json
241
242
  var name = "@gitbook/api";
242
- var version = "0.59.0";
243
+ var version = "0.61.0";
243
244
 
244
245
  // src/client.ts
245
246
  var import_event_iterator = __toESM(require_node(), 1);
@@ -555,6 +556,7 @@ var CustomizationLocale = /* @__PURE__ */ ((CustomizationLocale2) => {
555
556
  CustomizationLocale2["Zh"] = "zh";
556
557
  CustomizationLocale2["Ja"] = "ja";
557
558
  CustomizationLocale2["De"] = "de";
559
+ CustomizationLocale2["Nl"] = "nl";
558
560
  CustomizationLocale2["PtBr"] = "pt-br";
559
561
  return CustomizationLocale2;
560
562
  })(CustomizationLocale || {});
@@ -645,20 +647,10 @@ var BillingInterval = /* @__PURE__ */ ((BillingInterval2) => {
645
647
  BillingInterval2["Yearly"] = "yearly";
646
648
  return BillingInterval2;
647
649
  })(BillingInterval || {});
648
- var ContentAuditRelationStatus = /* @__PURE__ */ ((ContentAuditRelationStatus2) => {
649
- ContentAuditRelationStatus2["Pending"] = "pending";
650
- ContentAuditRelationStatus2["Rejected"] = "rejected";
651
- return ContentAuditRelationStatus2;
652
- })(ContentAuditRelationStatus || {});
653
- var ContentAuditRelationType = /* @__PURE__ */ ((ContentAuditRelationType2) => {
654
- ContentAuditRelationType2["Contradiction"] = "contradiction";
655
- ContentAuditRelationType2["Duplicate"] = "duplicate";
656
- return ContentAuditRelationType2;
657
- })(ContentAuditRelationType || {});
658
650
  var SiteType = /* @__PURE__ */ ((SiteType2) => {
659
651
  SiteType2["Basic"] = "basic";
660
- SiteType2["Standard"] = "standard";
661
652
  SiteType2["Premium"] = "premium";
653
+ SiteType2["Audience"] = "audience";
662
654
  SiteType2["LegacyBasic"] = "legacy-basic";
663
655
  SiteType2["LegacyPremium"] = "legacy-premium";
664
656
  return SiteType2;
@@ -670,6 +662,11 @@ var SiteVisibility = /* @__PURE__ */ ((SiteVisibility2) => {
670
662
  SiteVisibility2["VisitorAuth"] = "visitor-auth";
671
663
  return SiteVisibility2;
672
664
  })(SiteVisibility || {});
665
+ var SiteAdsTopic = /* @__PURE__ */ ((SiteAdsTopic2) => {
666
+ SiteAdsTopic2["Webdev"] = "webdev";
667
+ SiteAdsTopic2["Crypto"] = "crypto";
668
+ return SiteAdsTopic2;
669
+ })(SiteAdsTopic || {});
673
670
  var CustomizationIconsStyle = /* @__PURE__ */ ((CustomizationIconsStyle2) => {
674
671
  CustomizationIconsStyle2["Regular"] = "regular";
675
672
  CustomizationIconsStyle2["Solid"] = "solid";
@@ -748,6 +745,14 @@ var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2)
748
745
  RevisionSemanticChangeType2["CustomFieldsEdited"] = "custom_fields_edited";
749
746
  return RevisionSemanticChangeType2;
750
747
  })(RevisionSemanticChangeType || {});
748
+ var BillingTrialStatus = /* @__PURE__ */ ((BillingTrialStatus2) => {
749
+ BillingTrialStatus2["Notapplicable"] = "notapplicable";
750
+ BillingTrialStatus2["None"] = "none";
751
+ BillingTrialStatus2["Active"] = "active";
752
+ BillingTrialStatus2["Ended"] = "ended";
753
+ BillingTrialStatus2["Expired"] = "expired";
754
+ return BillingTrialStatus2;
755
+ })(BillingTrialStatus || {});
751
756
  var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
752
757
  APIIntegrationScope2["IntegrationRead"] = "integration:read";
753
758
  APIIntegrationScope2["IntegrationUpdate"] = "integration:update";
@@ -755,6 +760,14 @@ var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
755
760
  APIIntegrationScope2["IntegrationInstallationUpdate"] = "integration:installation:update";
756
761
  return APIIntegrationScope2;
757
762
  })(APIIntegrationScope || {});
763
+ var SiteAdsStatus = /* @__PURE__ */ ((SiteAdsStatus2) => {
764
+ SiteAdsStatus2["Pending"] = "pending";
765
+ SiteAdsStatus2["InReview"] = "in-review";
766
+ SiteAdsStatus2["Live"] = "live";
767
+ SiteAdsStatus2["Rejected"] = "rejected";
768
+ SiteAdsStatus2["Disabled"] = "disabled";
769
+ return SiteAdsStatus2;
770
+ })(SiteAdsStatus || {});
758
771
  var ContentType = /* @__PURE__ */ ((ContentType2) => {
759
772
  ContentType2["Json"] = "application/json";
760
773
  ContentType2["FormData"] = "multipart/form-data";
@@ -1189,6 +1202,20 @@ var Api = class extends HttpClient {
1189
1202
  type: "application/json" /* Json */,
1190
1203
  ...params
1191
1204
  }),
1205
+ inviteToSpace: (spaceId, data, params = {}) => this.request({
1206
+ path: `/spaces/${spaceId}/permissions`,
1207
+ method: "POST",
1208
+ body: data,
1209
+ secure: true,
1210
+ type: "application/json" /* Json */,
1211
+ ...params
1212
+ }),
1213
+ removeTeamFromSpace: (spaceId, teamId, params = {}) => this.request({
1214
+ path: `/spaces/${spaceId}/permissions/teams/${teamId}`,
1215
+ method: "DELETE",
1216
+ secure: true,
1217
+ ...params
1218
+ }),
1192
1219
  getCurrentRevision: (spaceId, query, params = {}) => this.request({
1193
1220
  path: `/spaces/${spaceId}/content`,
1194
1221
  method: "GET",
@@ -1715,29 +1742,6 @@ var Api = class extends HttpClient {
1715
1742
  format: "json",
1716
1743
  ...params
1717
1744
  }),
1718
- getSpacePublishingAuthById: (spaceId, params = {}) => this.request({
1719
- path: `/spaces/${spaceId}/publishing/auth`,
1720
- method: "GET",
1721
- secure: true,
1722
- format: "json",
1723
- ...params
1724
- }),
1725
- updateSpacePublishingAuthById: (spaceId, data, params = {}) => this.request({
1726
- path: `/spaces/${spaceId}/publishing/auth`,
1727
- method: "POST",
1728
- body: data,
1729
- secure: true,
1730
- type: "application/json" /* Json */,
1731
- format: "json",
1732
- ...params
1733
- }),
1734
- getSpacePublishingPreviewById: (spaceId, params = {}) => this.request({
1735
- path: `/spaces/${spaceId}/publishing/preview`,
1736
- method: "GET",
1737
- secure: true,
1738
- format: "json",
1739
- ...params
1740
- }),
1741
1745
  listSpaceIntegrations: (spaceId, query, params = {}) => this.request({
1742
1746
  path: `/spaces/${spaceId}/integrations`,
1743
1747
  method: "GET",
@@ -1889,22 +1893,6 @@ var Api = class extends HttpClient {
1889
1893
  format: "json",
1890
1894
  ...params
1891
1895
  }),
1892
- getCollectionPublishingAuthById: (collectionId, params = {}) => this.request({
1893
- path: `/collections/${collectionId}/publishing/auth`,
1894
- method: "GET",
1895
- secure: true,
1896
- format: "json",
1897
- ...params
1898
- }),
1899
- updateCollectionPublishingAuthById: (collectionId, data, params = {}) => this.request({
1900
- path: `/collections/${collectionId}/publishing/auth`,
1901
- method: "POST",
1902
- body: data,
1903
- secure: true,
1904
- type: "application/json" /* Json */,
1905
- format: "json",
1906
- ...params
1907
- }),
1908
1896
  getCollectionPublishingCustomizationById: (collectionId, params = {}) => this.request({
1909
1897
  path: `/collections/${collectionId}/publishing/customization`,
1910
1898
  method: "GET",
@@ -2388,6 +2376,14 @@ var Api = class extends HttpClient {
2388
2376
  format: "json",
2389
2377
  ...params
2390
2378
  }),
2379
+ previewBillingInvoice: (organizationId, query, params = {}) => this.request({
2380
+ path: `/orgs/${organizationId}/billing/preview`,
2381
+ method: "GET",
2382
+ query,
2383
+ secure: true,
2384
+ format: "json",
2385
+ ...params
2386
+ }),
2391
2387
  requestOrganizationUpgrade: (organizationId, params = {}) => this.request({
2392
2388
  path: `/orgs/${organizationId}/request_upgrade`,
2393
2389
  method: "POST",
@@ -2530,6 +2526,45 @@ var Api = class extends HttpClient {
2530
2526
  type: "application/json" /* Json */,
2531
2527
  ...params
2532
2528
  }),
2529
+ listSamlProvidersInOrganizationById: (organizationId, query, params = {}) => this.request({
2530
+ path: `/orgs/${organizationId}/saml`,
2531
+ method: "GET",
2532
+ query,
2533
+ secure: true,
2534
+ format: "json",
2535
+ ...params
2536
+ }),
2537
+ createOrganizationSamlProvider: (organizationId, data, params = {}) => this.request({
2538
+ path: `/orgs/${organizationId}/saml`,
2539
+ method: "POST",
2540
+ body: data,
2541
+ secure: true,
2542
+ type: "application/json" /* Json */,
2543
+ format: "json",
2544
+ ...params
2545
+ }),
2546
+ getOrganizationSamlProviderById: (organizationId, samlProviderId, params = {}) => this.request({
2547
+ path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2548
+ method: "GET",
2549
+ secure: true,
2550
+ format: "json",
2551
+ ...params
2552
+ }),
2553
+ updateOrganizationSamlProvider: (organizationId, samlProviderId, data, params = {}) => this.request({
2554
+ path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2555
+ method: "PATCH",
2556
+ body: data,
2557
+ secure: true,
2558
+ type: "application/json" /* Json */,
2559
+ format: "json",
2560
+ ...params
2561
+ }),
2562
+ deleteOrganizationSamlProvider: (organizationId, samlProviderId, params = {}) => this.request({
2563
+ path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2564
+ method: "DELETE",
2565
+ secure: true,
2566
+ ...params
2567
+ }),
2533
2568
  getUsageForOrganizationById: (organizationId, params = {}) => this.request({
2534
2569
  path: `/orgs/${organizationId}/usage`,
2535
2570
  method: "GET",
@@ -2678,6 +2713,14 @@ var Api = class extends HttpClient {
2678
2713
  format: "json",
2679
2714
  ...params
2680
2715
  }),
2716
+ listSyncedBlocks: (organizationId, query, params = {}) => this.request({
2717
+ path: `/orgs/${organizationId}/synced-blocks`,
2718
+ method: "GET",
2719
+ query,
2720
+ secure: true,
2721
+ format: "json",
2722
+ ...params
2723
+ }),
2681
2724
  createSyncedBlock: (organizationId, data, params = {}) => this.request({
2682
2725
  path: `/orgs/${organizationId}/synced-blocks`,
2683
2726
  method: "POST",
@@ -2717,6 +2760,14 @@ var Api = class extends HttpClient {
2717
2760
  format: "json",
2718
2761
  ...params
2719
2762
  }),
2763
+ listSyncedBlockSpaces: (organizationId, syncedBlockId, query, params = {}) => this.request({
2764
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/usage/spaces`,
2765
+ method: "GET",
2766
+ query,
2767
+ secure: true,
2768
+ format: "json",
2769
+ ...params
2770
+ }),
2720
2771
  askInOrganization: (organizationId, data, query, params = {}) => this.request({
2721
2772
  path: `/orgs/${organizationId}/ask`,
2722
2773
  method: "POST",
@@ -2747,55 +2798,31 @@ var Api = class extends HttpClient {
2747
2798
  secure: true,
2748
2799
  ...params
2749
2800
  }),
2750
- listContentAuditRelations: (organizationId, query, params = {}) => this.request({
2751
- path: `/orgs/${organizationId}/insights/audit-relations`,
2801
+ listSites: (organizationId, query, params = {}) => this.request({
2802
+ path: `/orgs/${organizationId}/sites`,
2752
2803
  method: "GET",
2753
2804
  query,
2754
2805
  secure: true,
2755
2806
  format: "json",
2756
2807
  ...params
2757
2808
  }),
2758
- getContentAuditRelationById: (organizationId, relationId, params = {}) => this.request({
2759
- path: `/orgs/${organizationId}/insights/audit-relations/${relationId}`,
2760
- method: "GET",
2761
- secure: true,
2762
- format: "json",
2763
- ...params
2764
- }),
2765
- updateContentAuditRelationStatusById: (organizationId, relationId, data, params = {}) => this.request({
2766
- path: `/orgs/${organizationId}/insights/audit-relations/${relationId}`,
2767
- method: "PATCH",
2809
+ createSite: (organizationId, data, params = {}) => this.request({
2810
+ path: `/orgs/${organizationId}/sites`,
2811
+ method: "POST",
2768
2812
  body: data,
2769
2813
  secure: true,
2770
2814
  type: "application/json" /* Json */,
2771
2815
  format: "json",
2772
2816
  ...params
2773
2817
  }),
2774
- getContentAuditSourceContentById: (organizationId, sourceId, query, params = {}) => this.request({
2775
- path: `/orgs/${organizationId}/insights/audit-sources/${sourceId}/content`,
2776
- method: "GET",
2777
- query,
2778
- secure: true,
2779
- format: "json",
2780
- ...params
2781
- }),
2782
- listSites: (organizationId, query, params = {}) => this.request({
2783
- path: `/orgs/${organizationId}/sites`,
2818
+ previewSitePublishCheckout: (organizationId, query, params = {}) => this.request({
2819
+ path: `/orgs/${organizationId}/sites/publishing/checkout`,
2784
2820
  method: "GET",
2785
2821
  query,
2786
2822
  secure: true,
2787
2823
  format: "json",
2788
2824
  ...params
2789
2825
  }),
2790
- createSite: (organizationId, data, params = {}) => this.request({
2791
- path: `/orgs/${organizationId}/sites`,
2792
- method: "POST",
2793
- body: data,
2794
- secure: true,
2795
- type: "application/json" /* Json */,
2796
- format: "json",
2797
- ...params
2798
- }),
2799
2826
  getSiteById: (organizationId, siteId, params = {}) => this.request({
2800
2827
  path: `/orgs/${organizationId}/sites/${siteId}`,
2801
2828
  method: "GET",
@@ -2882,13 +2909,6 @@ var Api = class extends HttpClient {
2882
2909
  format: "json",
2883
2910
  ...params
2884
2911
  }),
2885
- previewSitePublish: (organizationId, siteId, params = {}) => this.request({
2886
- path: `/orgs/${organizationId}/sites/${siteId}/publishing/checkout`,
2887
- method: "GET",
2888
- secure: true,
2889
- format: "json",
2890
- ...params
2891
- }),
2892
2912
  getSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2893
2913
  path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2894
2914
  method: "GET",
@@ -3065,6 +3085,21 @@ var Api = class extends HttpClient {
3065
3085
  secure: true,
3066
3086
  type: "application/json" /* Json */,
3067
3087
  ...params
3088
+ }),
3089
+ updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
3090
+ path: `/orgs/${organizationId}/sites/${siteId}/ads`,
3091
+ method: "POST",
3092
+ body: data,
3093
+ secure: true,
3094
+ type: "application/json" /* Json */,
3095
+ ...params
3096
+ }),
3097
+ getSiteAdsStatsById: (organizationId, siteId, params = {}) => this.request({
3098
+ path: `/orgs/${organizationId}/sites/${siteId}/ads/stats`,
3099
+ method: "POST",
3100
+ secure: true,
3101
+ format: "json",
3102
+ ...params
3068
3103
  })
3069
3104
  };
3070
3105
  this.customHostnames = {
@@ -3105,6 +3140,24 @@ var Api = class extends HttpClient {
3105
3140
  ...params
3106
3141
  })
3107
3142
  };
3143
+ this.ads = {
3144
+ adsListSites: (query, params = {}) => this.request({
3145
+ path: `/ads/sites`,
3146
+ method: "GET",
3147
+ query,
3148
+ secure: true,
3149
+ format: "json",
3150
+ ...params
3151
+ }),
3152
+ adsUpdateSite: (siteId, data, params = {}) => this.request({
3153
+ path: `/ads/sites/${siteId}`,
3154
+ method: "PATCH",
3155
+ body: data,
3156
+ secure: true,
3157
+ type: "application/json" /* Json */,
3158
+ ...params
3159
+ })
3160
+ };
3108
3161
  this.internal = {
3109
3162
  generateHiveAccessToken: (data, params = {}) => this.request({
3110
3163
  path: `/internal/hive/token`,
@@ -3224,13 +3277,12 @@ var GitBookAPI = class extends Api {
3224
3277
  Api,
3225
3278
  BillingInterval,
3226
3279
  BillingProduct,
3280
+ BillingTrialStatus,
3227
3281
  ChangeRequestReviewStatus,
3228
3282
  ChangeRequestStatus,
3229
3283
  CloudflareHostnameStatus,
3230
3284
  CloudflareHostnameTLSStatus,
3231
3285
  CloudflareHostnameTLSValidationMethod,
3232
- ContentAuditRelationStatus,
3233
- ContentAuditRelationType,
3234
3286
  ContentKitIcon,
3235
3287
  ContentReferenceStatus,
3236
3288
  ContentType,
@@ -3269,6 +3321,8 @@ var GitBookAPI = class extends Api {
3269
3321
  RevisionPageLayoutPreset,
3270
3322
  RevisionPageType,
3271
3323
  RevisionSemanticChangeType,
3324
+ SiteAdsStatus,
3325
+ SiteAdsTopic,
3272
3326
  SiteType,
3273
3327
  SiteVisibility,
3274
3328
  SpaceBlockReason,