@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/client.d.ts +446 -333
- package/dist/index.cjs +147 -93
- package/dist/index.js +144 -91
- package/package.json +1 -1
- package/spec/openapi.json +1567 -1137
- package/spec/openapi.yaml +930 -668
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.61.0";
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
178
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -488,6 +488,7 @@ var CustomizationLocale = /* @__PURE__ */ ((CustomizationLocale2) => {
|
|
|
488
488
|
CustomizationLocale2["Zh"] = "zh";
|
|
489
489
|
CustomizationLocale2["Ja"] = "ja";
|
|
490
490
|
CustomizationLocale2["De"] = "de";
|
|
491
|
+
CustomizationLocale2["Nl"] = "nl";
|
|
491
492
|
CustomizationLocale2["PtBr"] = "pt-br";
|
|
492
493
|
return CustomizationLocale2;
|
|
493
494
|
})(CustomizationLocale || {});
|
|
@@ -578,20 +579,10 @@ var BillingInterval = /* @__PURE__ */ ((BillingInterval2) => {
|
|
|
578
579
|
BillingInterval2["Yearly"] = "yearly";
|
|
579
580
|
return BillingInterval2;
|
|
580
581
|
})(BillingInterval || {});
|
|
581
|
-
var ContentAuditRelationStatus = /* @__PURE__ */ ((ContentAuditRelationStatus2) => {
|
|
582
|
-
ContentAuditRelationStatus2["Pending"] = "pending";
|
|
583
|
-
ContentAuditRelationStatus2["Rejected"] = "rejected";
|
|
584
|
-
return ContentAuditRelationStatus2;
|
|
585
|
-
})(ContentAuditRelationStatus || {});
|
|
586
|
-
var ContentAuditRelationType = /* @__PURE__ */ ((ContentAuditRelationType2) => {
|
|
587
|
-
ContentAuditRelationType2["Contradiction"] = "contradiction";
|
|
588
|
-
ContentAuditRelationType2["Duplicate"] = "duplicate";
|
|
589
|
-
return ContentAuditRelationType2;
|
|
590
|
-
})(ContentAuditRelationType || {});
|
|
591
582
|
var SiteType = /* @__PURE__ */ ((SiteType2) => {
|
|
592
583
|
SiteType2["Basic"] = "basic";
|
|
593
|
-
SiteType2["Standard"] = "standard";
|
|
594
584
|
SiteType2["Premium"] = "premium";
|
|
585
|
+
SiteType2["Audience"] = "audience";
|
|
595
586
|
SiteType2["LegacyBasic"] = "legacy-basic";
|
|
596
587
|
SiteType2["LegacyPremium"] = "legacy-premium";
|
|
597
588
|
return SiteType2;
|
|
@@ -603,6 +594,11 @@ var SiteVisibility = /* @__PURE__ */ ((SiteVisibility2) => {
|
|
|
603
594
|
SiteVisibility2["VisitorAuth"] = "visitor-auth";
|
|
604
595
|
return SiteVisibility2;
|
|
605
596
|
})(SiteVisibility || {});
|
|
597
|
+
var SiteAdsTopic = /* @__PURE__ */ ((SiteAdsTopic2) => {
|
|
598
|
+
SiteAdsTopic2["Webdev"] = "webdev";
|
|
599
|
+
SiteAdsTopic2["Crypto"] = "crypto";
|
|
600
|
+
return SiteAdsTopic2;
|
|
601
|
+
})(SiteAdsTopic || {});
|
|
606
602
|
var CustomizationIconsStyle = /* @__PURE__ */ ((CustomizationIconsStyle2) => {
|
|
607
603
|
CustomizationIconsStyle2["Regular"] = "regular";
|
|
608
604
|
CustomizationIconsStyle2["Solid"] = "solid";
|
|
@@ -681,6 +677,14 @@ var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2)
|
|
|
681
677
|
RevisionSemanticChangeType2["CustomFieldsEdited"] = "custom_fields_edited";
|
|
682
678
|
return RevisionSemanticChangeType2;
|
|
683
679
|
})(RevisionSemanticChangeType || {});
|
|
680
|
+
var BillingTrialStatus = /* @__PURE__ */ ((BillingTrialStatus2) => {
|
|
681
|
+
BillingTrialStatus2["Notapplicable"] = "notapplicable";
|
|
682
|
+
BillingTrialStatus2["None"] = "none";
|
|
683
|
+
BillingTrialStatus2["Active"] = "active";
|
|
684
|
+
BillingTrialStatus2["Ended"] = "ended";
|
|
685
|
+
BillingTrialStatus2["Expired"] = "expired";
|
|
686
|
+
return BillingTrialStatus2;
|
|
687
|
+
})(BillingTrialStatus || {});
|
|
684
688
|
var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
|
|
685
689
|
APIIntegrationScope2["IntegrationRead"] = "integration:read";
|
|
686
690
|
APIIntegrationScope2["IntegrationUpdate"] = "integration:update";
|
|
@@ -688,6 +692,14 @@ var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
|
|
|
688
692
|
APIIntegrationScope2["IntegrationInstallationUpdate"] = "integration:installation:update";
|
|
689
693
|
return APIIntegrationScope2;
|
|
690
694
|
})(APIIntegrationScope || {});
|
|
695
|
+
var SiteAdsStatus = /* @__PURE__ */ ((SiteAdsStatus2) => {
|
|
696
|
+
SiteAdsStatus2["Pending"] = "pending";
|
|
697
|
+
SiteAdsStatus2["InReview"] = "in-review";
|
|
698
|
+
SiteAdsStatus2["Live"] = "live";
|
|
699
|
+
SiteAdsStatus2["Rejected"] = "rejected";
|
|
700
|
+
SiteAdsStatus2["Disabled"] = "disabled";
|
|
701
|
+
return SiteAdsStatus2;
|
|
702
|
+
})(SiteAdsStatus || {});
|
|
691
703
|
var ContentType = /* @__PURE__ */ ((ContentType2) => {
|
|
692
704
|
ContentType2["Json"] = "application/json";
|
|
693
705
|
ContentType2["FormData"] = "multipart/form-data";
|
|
@@ -1122,6 +1134,20 @@ var Api = class extends HttpClient {
|
|
|
1122
1134
|
type: "application/json" /* Json */,
|
|
1123
1135
|
...params
|
|
1124
1136
|
}),
|
|
1137
|
+
inviteToSpace: (spaceId, data, params = {}) => this.request({
|
|
1138
|
+
path: `/spaces/${spaceId}/permissions`,
|
|
1139
|
+
method: "POST",
|
|
1140
|
+
body: data,
|
|
1141
|
+
secure: true,
|
|
1142
|
+
type: "application/json" /* Json */,
|
|
1143
|
+
...params
|
|
1144
|
+
}),
|
|
1145
|
+
removeTeamFromSpace: (spaceId, teamId, params = {}) => this.request({
|
|
1146
|
+
path: `/spaces/${spaceId}/permissions/teams/${teamId}`,
|
|
1147
|
+
method: "DELETE",
|
|
1148
|
+
secure: true,
|
|
1149
|
+
...params
|
|
1150
|
+
}),
|
|
1125
1151
|
getCurrentRevision: (spaceId, query, params = {}) => this.request({
|
|
1126
1152
|
path: `/spaces/${spaceId}/content`,
|
|
1127
1153
|
method: "GET",
|
|
@@ -1648,29 +1674,6 @@ var Api = class extends HttpClient {
|
|
|
1648
1674
|
format: "json",
|
|
1649
1675
|
...params
|
|
1650
1676
|
}),
|
|
1651
|
-
getSpacePublishingAuthById: (spaceId, params = {}) => this.request({
|
|
1652
|
-
path: `/spaces/${spaceId}/publishing/auth`,
|
|
1653
|
-
method: "GET",
|
|
1654
|
-
secure: true,
|
|
1655
|
-
format: "json",
|
|
1656
|
-
...params
|
|
1657
|
-
}),
|
|
1658
|
-
updateSpacePublishingAuthById: (spaceId, data, params = {}) => this.request({
|
|
1659
|
-
path: `/spaces/${spaceId}/publishing/auth`,
|
|
1660
|
-
method: "POST",
|
|
1661
|
-
body: data,
|
|
1662
|
-
secure: true,
|
|
1663
|
-
type: "application/json" /* Json */,
|
|
1664
|
-
format: "json",
|
|
1665
|
-
...params
|
|
1666
|
-
}),
|
|
1667
|
-
getSpacePublishingPreviewById: (spaceId, params = {}) => this.request({
|
|
1668
|
-
path: `/spaces/${spaceId}/publishing/preview`,
|
|
1669
|
-
method: "GET",
|
|
1670
|
-
secure: true,
|
|
1671
|
-
format: "json",
|
|
1672
|
-
...params
|
|
1673
|
-
}),
|
|
1674
1677
|
listSpaceIntegrations: (spaceId, query, params = {}) => this.request({
|
|
1675
1678
|
path: `/spaces/${spaceId}/integrations`,
|
|
1676
1679
|
method: "GET",
|
|
@@ -1822,22 +1825,6 @@ var Api = class extends HttpClient {
|
|
|
1822
1825
|
format: "json",
|
|
1823
1826
|
...params
|
|
1824
1827
|
}),
|
|
1825
|
-
getCollectionPublishingAuthById: (collectionId, params = {}) => this.request({
|
|
1826
|
-
path: `/collections/${collectionId}/publishing/auth`,
|
|
1827
|
-
method: "GET",
|
|
1828
|
-
secure: true,
|
|
1829
|
-
format: "json",
|
|
1830
|
-
...params
|
|
1831
|
-
}),
|
|
1832
|
-
updateCollectionPublishingAuthById: (collectionId, data, params = {}) => this.request({
|
|
1833
|
-
path: `/collections/${collectionId}/publishing/auth`,
|
|
1834
|
-
method: "POST",
|
|
1835
|
-
body: data,
|
|
1836
|
-
secure: true,
|
|
1837
|
-
type: "application/json" /* Json */,
|
|
1838
|
-
format: "json",
|
|
1839
|
-
...params
|
|
1840
|
-
}),
|
|
1841
1828
|
getCollectionPublishingCustomizationById: (collectionId, params = {}) => this.request({
|
|
1842
1829
|
path: `/collections/${collectionId}/publishing/customization`,
|
|
1843
1830
|
method: "GET",
|
|
@@ -2321,6 +2308,14 @@ var Api = class extends HttpClient {
|
|
|
2321
2308
|
format: "json",
|
|
2322
2309
|
...params
|
|
2323
2310
|
}),
|
|
2311
|
+
previewBillingInvoice: (organizationId, query, params = {}) => this.request({
|
|
2312
|
+
path: `/orgs/${organizationId}/billing/preview`,
|
|
2313
|
+
method: "GET",
|
|
2314
|
+
query,
|
|
2315
|
+
secure: true,
|
|
2316
|
+
format: "json",
|
|
2317
|
+
...params
|
|
2318
|
+
}),
|
|
2324
2319
|
requestOrganizationUpgrade: (organizationId, params = {}) => this.request({
|
|
2325
2320
|
path: `/orgs/${organizationId}/request_upgrade`,
|
|
2326
2321
|
method: "POST",
|
|
@@ -2463,6 +2458,45 @@ var Api = class extends HttpClient {
|
|
|
2463
2458
|
type: "application/json" /* Json */,
|
|
2464
2459
|
...params
|
|
2465
2460
|
}),
|
|
2461
|
+
listSamlProvidersInOrganizationById: (organizationId, query, params = {}) => this.request({
|
|
2462
|
+
path: `/orgs/${organizationId}/saml`,
|
|
2463
|
+
method: "GET",
|
|
2464
|
+
query,
|
|
2465
|
+
secure: true,
|
|
2466
|
+
format: "json",
|
|
2467
|
+
...params
|
|
2468
|
+
}),
|
|
2469
|
+
createOrganizationSamlProvider: (organizationId, data, params = {}) => this.request({
|
|
2470
|
+
path: `/orgs/${organizationId}/saml`,
|
|
2471
|
+
method: "POST",
|
|
2472
|
+
body: data,
|
|
2473
|
+
secure: true,
|
|
2474
|
+
type: "application/json" /* Json */,
|
|
2475
|
+
format: "json",
|
|
2476
|
+
...params
|
|
2477
|
+
}),
|
|
2478
|
+
getOrganizationSamlProviderById: (organizationId, samlProviderId, params = {}) => this.request({
|
|
2479
|
+
path: `/orgs/${organizationId}/saml/${samlProviderId}`,
|
|
2480
|
+
method: "GET",
|
|
2481
|
+
secure: true,
|
|
2482
|
+
format: "json",
|
|
2483
|
+
...params
|
|
2484
|
+
}),
|
|
2485
|
+
updateOrganizationSamlProvider: (organizationId, samlProviderId, data, params = {}) => this.request({
|
|
2486
|
+
path: `/orgs/${organizationId}/saml/${samlProviderId}`,
|
|
2487
|
+
method: "PATCH",
|
|
2488
|
+
body: data,
|
|
2489
|
+
secure: true,
|
|
2490
|
+
type: "application/json" /* Json */,
|
|
2491
|
+
format: "json",
|
|
2492
|
+
...params
|
|
2493
|
+
}),
|
|
2494
|
+
deleteOrganizationSamlProvider: (organizationId, samlProviderId, params = {}) => this.request({
|
|
2495
|
+
path: `/orgs/${organizationId}/saml/${samlProviderId}`,
|
|
2496
|
+
method: "DELETE",
|
|
2497
|
+
secure: true,
|
|
2498
|
+
...params
|
|
2499
|
+
}),
|
|
2466
2500
|
getUsageForOrganizationById: (organizationId, params = {}) => this.request({
|
|
2467
2501
|
path: `/orgs/${organizationId}/usage`,
|
|
2468
2502
|
method: "GET",
|
|
@@ -2611,6 +2645,14 @@ var Api = class extends HttpClient {
|
|
|
2611
2645
|
format: "json",
|
|
2612
2646
|
...params
|
|
2613
2647
|
}),
|
|
2648
|
+
listSyncedBlocks: (organizationId, query, params = {}) => this.request({
|
|
2649
|
+
path: `/orgs/${organizationId}/synced-blocks`,
|
|
2650
|
+
method: "GET",
|
|
2651
|
+
query,
|
|
2652
|
+
secure: true,
|
|
2653
|
+
format: "json",
|
|
2654
|
+
...params
|
|
2655
|
+
}),
|
|
2614
2656
|
createSyncedBlock: (organizationId, data, params = {}) => this.request({
|
|
2615
2657
|
path: `/orgs/${organizationId}/synced-blocks`,
|
|
2616
2658
|
method: "POST",
|
|
@@ -2650,6 +2692,14 @@ var Api = class extends HttpClient {
|
|
|
2650
2692
|
format: "json",
|
|
2651
2693
|
...params
|
|
2652
2694
|
}),
|
|
2695
|
+
listSyncedBlockSpaces: (organizationId, syncedBlockId, query, params = {}) => this.request({
|
|
2696
|
+
path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/usage/spaces`,
|
|
2697
|
+
method: "GET",
|
|
2698
|
+
query,
|
|
2699
|
+
secure: true,
|
|
2700
|
+
format: "json",
|
|
2701
|
+
...params
|
|
2702
|
+
}),
|
|
2653
2703
|
askInOrganization: (organizationId, data, query, params = {}) => this.request({
|
|
2654
2704
|
path: `/orgs/${organizationId}/ask`,
|
|
2655
2705
|
method: "POST",
|
|
@@ -2680,55 +2730,31 @@ var Api = class extends HttpClient {
|
|
|
2680
2730
|
secure: true,
|
|
2681
2731
|
...params
|
|
2682
2732
|
}),
|
|
2683
|
-
|
|
2684
|
-
path: `/orgs/${organizationId}/
|
|
2733
|
+
listSites: (organizationId, query, params = {}) => this.request({
|
|
2734
|
+
path: `/orgs/${organizationId}/sites`,
|
|
2685
2735
|
method: "GET",
|
|
2686
2736
|
query,
|
|
2687
2737
|
secure: true,
|
|
2688
2738
|
format: "json",
|
|
2689
2739
|
...params
|
|
2690
2740
|
}),
|
|
2691
|
-
|
|
2692
|
-
path: `/orgs/${organizationId}/
|
|
2693
|
-
method: "
|
|
2694
|
-
secure: true,
|
|
2695
|
-
format: "json",
|
|
2696
|
-
...params
|
|
2697
|
-
}),
|
|
2698
|
-
updateContentAuditRelationStatusById: (organizationId, relationId, data, params = {}) => this.request({
|
|
2699
|
-
path: `/orgs/${organizationId}/insights/audit-relations/${relationId}`,
|
|
2700
|
-
method: "PATCH",
|
|
2741
|
+
createSite: (organizationId, data, params = {}) => this.request({
|
|
2742
|
+
path: `/orgs/${organizationId}/sites`,
|
|
2743
|
+
method: "POST",
|
|
2701
2744
|
body: data,
|
|
2702
2745
|
secure: true,
|
|
2703
2746
|
type: "application/json" /* Json */,
|
|
2704
2747
|
format: "json",
|
|
2705
2748
|
...params
|
|
2706
2749
|
}),
|
|
2707
|
-
|
|
2708
|
-
path: `/orgs/${organizationId}/
|
|
2709
|
-
method: "GET",
|
|
2710
|
-
query,
|
|
2711
|
-
secure: true,
|
|
2712
|
-
format: "json",
|
|
2713
|
-
...params
|
|
2714
|
-
}),
|
|
2715
|
-
listSites: (organizationId, query, params = {}) => this.request({
|
|
2716
|
-
path: `/orgs/${organizationId}/sites`,
|
|
2750
|
+
previewSitePublishCheckout: (organizationId, query, params = {}) => this.request({
|
|
2751
|
+
path: `/orgs/${organizationId}/sites/publishing/checkout`,
|
|
2717
2752
|
method: "GET",
|
|
2718
2753
|
query,
|
|
2719
2754
|
secure: true,
|
|
2720
2755
|
format: "json",
|
|
2721
2756
|
...params
|
|
2722
2757
|
}),
|
|
2723
|
-
createSite: (organizationId, data, params = {}) => this.request({
|
|
2724
|
-
path: `/orgs/${organizationId}/sites`,
|
|
2725
|
-
method: "POST",
|
|
2726
|
-
body: data,
|
|
2727
|
-
secure: true,
|
|
2728
|
-
type: "application/json" /* Json */,
|
|
2729
|
-
format: "json",
|
|
2730
|
-
...params
|
|
2731
|
-
}),
|
|
2732
2758
|
getSiteById: (organizationId, siteId, params = {}) => this.request({
|
|
2733
2759
|
path: `/orgs/${organizationId}/sites/${siteId}`,
|
|
2734
2760
|
method: "GET",
|
|
@@ -2815,13 +2841,6 @@ var Api = class extends HttpClient {
|
|
|
2815
2841
|
format: "json",
|
|
2816
2842
|
...params
|
|
2817
2843
|
}),
|
|
2818
|
-
previewSitePublish: (organizationId, siteId, params = {}) => this.request({
|
|
2819
|
-
path: `/orgs/${organizationId}/sites/${siteId}/publishing/checkout`,
|
|
2820
|
-
method: "GET",
|
|
2821
|
-
secure: true,
|
|
2822
|
-
format: "json",
|
|
2823
|
-
...params
|
|
2824
|
-
}),
|
|
2825
2844
|
getSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
|
|
2826
2845
|
path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
|
|
2827
2846
|
method: "GET",
|
|
@@ -2998,6 +3017,21 @@ var Api = class extends HttpClient {
|
|
|
2998
3017
|
secure: true,
|
|
2999
3018
|
type: "application/json" /* Json */,
|
|
3000
3019
|
...params
|
|
3020
|
+
}),
|
|
3021
|
+
updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
|
|
3022
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ads`,
|
|
3023
|
+
method: "POST",
|
|
3024
|
+
body: data,
|
|
3025
|
+
secure: true,
|
|
3026
|
+
type: "application/json" /* Json */,
|
|
3027
|
+
...params
|
|
3028
|
+
}),
|
|
3029
|
+
getSiteAdsStatsById: (organizationId, siteId, params = {}) => this.request({
|
|
3030
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ads/stats`,
|
|
3031
|
+
method: "POST",
|
|
3032
|
+
secure: true,
|
|
3033
|
+
format: "json",
|
|
3034
|
+
...params
|
|
3001
3035
|
})
|
|
3002
3036
|
};
|
|
3003
3037
|
this.customHostnames = {
|
|
@@ -3038,6 +3072,24 @@ var Api = class extends HttpClient {
|
|
|
3038
3072
|
...params
|
|
3039
3073
|
})
|
|
3040
3074
|
};
|
|
3075
|
+
this.ads = {
|
|
3076
|
+
adsListSites: (query, params = {}) => this.request({
|
|
3077
|
+
path: `/ads/sites`,
|
|
3078
|
+
method: "GET",
|
|
3079
|
+
query,
|
|
3080
|
+
secure: true,
|
|
3081
|
+
format: "json",
|
|
3082
|
+
...params
|
|
3083
|
+
}),
|
|
3084
|
+
adsUpdateSite: (siteId, data, params = {}) => this.request({
|
|
3085
|
+
path: `/ads/sites/${siteId}`,
|
|
3086
|
+
method: "PATCH",
|
|
3087
|
+
body: data,
|
|
3088
|
+
secure: true,
|
|
3089
|
+
type: "application/json" /* Json */,
|
|
3090
|
+
...params
|
|
3091
|
+
})
|
|
3092
|
+
};
|
|
3041
3093
|
this.internal = {
|
|
3042
3094
|
generateHiveAccessToken: (data, params = {}) => this.request({
|
|
3043
3095
|
path: `/internal/hive/token`,
|
|
@@ -3156,13 +3208,12 @@ export {
|
|
|
3156
3208
|
Api,
|
|
3157
3209
|
BillingInterval,
|
|
3158
3210
|
BillingProduct,
|
|
3211
|
+
BillingTrialStatus,
|
|
3159
3212
|
ChangeRequestReviewStatus,
|
|
3160
3213
|
ChangeRequestStatus,
|
|
3161
3214
|
CloudflareHostnameStatus,
|
|
3162
3215
|
CloudflareHostnameTLSStatus,
|
|
3163
3216
|
CloudflareHostnameTLSValidationMethod,
|
|
3164
|
-
ContentAuditRelationStatus,
|
|
3165
|
-
ContentAuditRelationType,
|
|
3166
3217
|
ContentKitIcon,
|
|
3167
3218
|
ContentReferenceStatus,
|
|
3168
3219
|
ContentType,
|
|
@@ -3201,6 +3252,8 @@ export {
|
|
|
3201
3252
|
RevisionPageLayoutPreset,
|
|
3202
3253
|
RevisionPageType,
|
|
3203
3254
|
RevisionSemanticChangeType,
|
|
3255
|
+
SiteAdsStatus,
|
|
3256
|
+
SiteAdsTopic,
|
|
3204
3257
|
SiteType,
|
|
3205
3258
|
SiteVisibility,
|
|
3206
3259
|
SpaceBlockReason,
|