@gitbook/api 0.96.1 → 0.98.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.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.96.1";
175
+ var version = "0.98.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -306,18 +306,6 @@ var RevisionPageLayoutOptionsCoverSize = /* @__PURE__ */ ((RevisionPageLayoutOpt
306
306
  RevisionPageLayoutOptionsCoverSize2["Full"] = "full";
307
307
  return RevisionPageLayoutOptionsCoverSize2;
308
308
  })(RevisionPageLayoutOptionsCoverSize || {});
309
- var AnalyticsSearchPeriod = /* @__PURE__ */ ((AnalyticsSearchPeriod2) => {
310
- AnalyticsSearchPeriod2["LastMonth"] = "last_month";
311
- AnalyticsSearchPeriod2["LastWeek"] = "last_week";
312
- AnalyticsSearchPeriod2["LastYear"] = "last_year";
313
- return AnalyticsSearchPeriod2;
314
- })(AnalyticsSearchPeriod || {});
315
- var AnalyticsTrafficInterval = /* @__PURE__ */ ((AnalyticsTrafficInterval2) => {
316
- AnalyticsTrafficInterval2["Daily"] = "daily";
317
- AnalyticsTrafficInterval2["Weekly"] = "weekly";
318
- AnalyticsTrafficInterval2["Monthly"] = "monthly";
319
- return AnalyticsTrafficInterval2;
320
- })(AnalyticsTrafficInterval || {});
321
309
  var ChangeRequestStatus = /* @__PURE__ */ ((ChangeRequestStatus2) => {
322
310
  ChangeRequestStatus2["Draft"] = "draft";
323
311
  ChangeRequestStatus2["Open"] = "open";
@@ -461,59 +449,6 @@ var RevisionPageLayoutPreset = /* @__PURE__ */ ((RevisionPageLayoutPreset2) => {
461
449
  RevisionPageLayoutPreset2["Landing"] = "landing";
462
450
  return RevisionPageLayoutPreset2;
463
451
  })(RevisionPageLayoutPreset || {});
464
- var CustomizationCorners = /* @__PURE__ */ ((CustomizationCorners2) => {
465
- CustomizationCorners2["Straight"] = "straight";
466
- CustomizationCorners2["Rounded"] = "rounded";
467
- return CustomizationCorners2;
468
- })(CustomizationCorners || {});
469
- var CustomizationFont = /* @__PURE__ */ ((CustomizationFont2) => {
470
- CustomizationFont2["ABCFavorit"] = "ABCFavorit";
471
- CustomizationFont2["Inter"] = "Inter";
472
- CustomizationFont2["Roboto"] = "Roboto";
473
- CustomizationFont2["RobotoSlab"] = "RobotoSlab";
474
- CustomizationFont2["OpenSans"] = "OpenSans";
475
- CustomizationFont2["SourceSansPro"] = "SourceSansPro";
476
- CustomizationFont2["Lato"] = "Lato";
477
- CustomizationFont2["Ubuntu"] = "Ubuntu";
478
- CustomizationFont2["Raleway"] = "Raleway";
479
- CustomizationFont2["Merriweather"] = "Merriweather";
480
- CustomizationFont2["Overpass"] = "Overpass";
481
- CustomizationFont2["NotoSans"] = "NotoSans";
482
- CustomizationFont2["IBMPlexSerif"] = "IBMPlexSerif";
483
- CustomizationFont2["Poppins"] = "Poppins";
484
- CustomizationFont2["FiraSans"] = "FiraSans";
485
- return CustomizationFont2;
486
- })(CustomizationFont || {});
487
- var CustomizationBackground = /* @__PURE__ */ ((CustomizationBackground2) => {
488
- CustomizationBackground2["Plain"] = "plain";
489
- CustomizationBackground2["Match"] = "match";
490
- return CustomizationBackground2;
491
- })(CustomizationBackground || {});
492
- var CustomizationLocale = /* @__PURE__ */ ((CustomizationLocale2) => {
493
- CustomizationLocale2["En"] = "en";
494
- CustomizationLocale2["Fr"] = "fr";
495
- CustomizationLocale2["Es"] = "es";
496
- CustomizationLocale2["Zh"] = "zh";
497
- CustomizationLocale2["Ja"] = "ja";
498
- CustomizationLocale2["De"] = "de";
499
- CustomizationLocale2["Nl"] = "nl";
500
- CustomizationLocale2["No"] = "no";
501
- CustomizationLocale2["PtBr"] = "pt-br";
502
- return CustomizationLocale2;
503
- })(CustomizationLocale || {});
504
- var CustomizationHeaderPreset = /* @__PURE__ */ ((CustomizationHeaderPreset2) => {
505
- CustomizationHeaderPreset2["Default"] = "default";
506
- CustomizationHeaderPreset2["Bold"] = "bold";
507
- CustomizationHeaderPreset2["Contrast"] = "contrast";
508
- CustomizationHeaderPreset2["Custom"] = "custom";
509
- CustomizationHeaderPreset2["None"] = "none";
510
- return CustomizationHeaderPreset2;
511
- })(CustomizationHeaderPreset || {});
512
- var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
513
- CustomizationThemeMode2["Light"] = "light";
514
- CustomizationThemeMode2["Dark"] = "dark";
515
- return CustomizationThemeMode2;
516
- })(CustomizationThemeMode || {});
517
452
  var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
518
453
  IntegrationTarget2["All"] = "all";
519
454
  IntegrationTarget2["Site"] = "site";
@@ -565,12 +500,6 @@ var CustomFieldType = /* @__PURE__ */ ((CustomFieldType2) => {
565
500
  CustomFieldType2["SelectSingle"] = "select:single";
566
501
  return CustomFieldType2;
567
502
  })(CustomFieldType || {});
568
- var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
569
- PageFeedbackRating2["Bad"] = "bad";
570
- PageFeedbackRating2["Ok"] = "ok";
571
- PageFeedbackRating2["Good"] = "good";
572
- return PageFeedbackRating2;
573
- })(PageFeedbackRating || {});
574
503
  var IntegrationInstallationStatus = /* @__PURE__ */ ((IntegrationInstallationStatus2) => {
575
504
  IntegrationInstallationStatus2["Active"] = "active";
576
505
  IntegrationInstallationStatus2["Pending"] = "pending";
@@ -626,6 +555,17 @@ var SiteAdsTopic = /* @__PURE__ */ ((SiteAdsTopic2) => {
626
555
  SiteAdsTopic2["Crypto"] = "crypto";
627
556
  return SiteAdsTopic2;
628
557
  })(SiteAdsTopic || {});
558
+ var SiteCustomizationFeature = /* @__PURE__ */ ((SiteCustomizationFeature2) => {
559
+ SiteCustomizationFeature2["HeaderLogo"] = "header-logo";
560
+ SiteCustomizationFeature2["ThemePreset"] = "theme-preset";
561
+ SiteCustomizationFeature2["CustomFonts"] = "custom-fonts";
562
+ SiteCustomizationFeature2["CustomIcons"] = "custom-icons";
563
+ SiteCustomizationFeature2["FooterLogo"] = "footer-logo";
564
+ SiteCustomizationFeature2["FooterLinks"] = "footer-links";
565
+ SiteCustomizationFeature2["FooterCopyright"] = "footer-copyright";
566
+ SiteCustomizationFeature2["SemanticColors"] = "semantic-colors";
567
+ return SiteCustomizationFeature2;
568
+ })(SiteCustomizationFeature || {});
629
569
  var TeamMemberRole = /* @__PURE__ */ ((TeamMemberRole2) => {
630
570
  TeamMemberRole2["Owner"] = "owner";
631
571
  TeamMemberRole2["Member"] = "member";
@@ -636,25 +576,6 @@ var BillingInterval = /* @__PURE__ */ ((BillingInterval2) => {
636
576
  BillingInterval2["Yearly"] = "yearly";
637
577
  return BillingInterval2;
638
578
  })(BillingInterval || {});
639
- var SiteToMigrateFeature = /* @__PURE__ */ ((SiteToMigrateFeature2) => {
640
- SiteToMigrateFeature2["Sections"] = "sections";
641
- SiteToMigrateFeature2["VisitorAuth"] = "visitor-auth";
642
- SiteToMigrateFeature2["Redirects"] = "redirects";
643
- SiteToMigrateFeature2["CustomHostname"] = "custom-hostname";
644
- SiteToMigrateFeature2["AISearch"] = "AI-search";
645
- SiteToMigrateFeature2["PDFExport"] = "PDF-export";
646
- SiteToMigrateFeature2["PageRatings"] = "page-ratings";
647
- SiteToMigrateFeature2["CustomLogo"] = "custom-logo";
648
- SiteToMigrateFeature2["CustomThemePreset"] = "custom-theme-preset";
649
- SiteToMigrateFeature2["CustomFonts"] = "custom-fonts";
650
- SiteToMigrateFeature2["CustomIcons"] = "custom-icons";
651
- SiteToMigrateFeature2["CustomFooterLogo"] = "custom-footer-logo";
652
- SiteToMigrateFeature2["CustomFooterCopyright"] = "custom-footer-copyright";
653
- SiteToMigrateFeature2["CustomFooterLinks"] = "custom-footer-links";
654
- SiteToMigrateFeature2["Unlisted"] = "unlisted";
655
- SiteToMigrateFeature2["ShareLinks"] = "share-links";
656
- return SiteToMigrateFeature2;
657
- })(SiteToMigrateFeature || {});
658
579
  var CustomizationTheme = /* @__PURE__ */ ((CustomizationTheme2) => {
659
580
  CustomizationTheme2["Clean"] = "clean";
660
581
  CustomizationTheme2["Muted"] = "muted";
@@ -662,11 +583,39 @@ var CustomizationTheme = /* @__PURE__ */ ((CustomizationTheme2) => {
662
583
  CustomizationTheme2["Gradient"] = "gradient";
663
584
  return CustomizationTheme2;
664
585
  })(CustomizationTheme || {});
586
+ var CustomizationCorners = /* @__PURE__ */ ((CustomizationCorners2) => {
587
+ CustomizationCorners2["Straight"] = "straight";
588
+ CustomizationCorners2["Rounded"] = "rounded";
589
+ return CustomizationCorners2;
590
+ })(CustomizationCorners || {});
665
591
  var CustomizationLinksStyle = /* @__PURE__ */ ((CustomizationLinksStyle2) => {
666
592
  CustomizationLinksStyle2["Default"] = "default";
667
593
  CustomizationLinksStyle2["Accent"] = "accent";
668
594
  return CustomizationLinksStyle2;
669
595
  })(CustomizationLinksStyle || {});
596
+ var CustomizationDefaultFont = /* @__PURE__ */ ((CustomizationDefaultFont2) => {
597
+ CustomizationDefaultFont2["ABCFavorit"] = "ABCFavorit";
598
+ CustomizationDefaultFont2["Inter"] = "Inter";
599
+ CustomizationDefaultFont2["Roboto"] = "Roboto";
600
+ CustomizationDefaultFont2["RobotoSlab"] = "RobotoSlab";
601
+ CustomizationDefaultFont2["OpenSans"] = "OpenSans";
602
+ CustomizationDefaultFont2["SourceSansPro"] = "SourceSansPro";
603
+ CustomizationDefaultFont2["Lato"] = "Lato";
604
+ CustomizationDefaultFont2["Ubuntu"] = "Ubuntu";
605
+ CustomizationDefaultFont2["Raleway"] = "Raleway";
606
+ CustomizationDefaultFont2["Merriweather"] = "Merriweather";
607
+ CustomizationDefaultFont2["Overpass"] = "Overpass";
608
+ CustomizationDefaultFont2["NotoSans"] = "NotoSans";
609
+ CustomizationDefaultFont2["IBMPlexSerif"] = "IBMPlexSerif";
610
+ CustomizationDefaultFont2["Poppins"] = "Poppins";
611
+ CustomizationDefaultFont2["FiraSans"] = "FiraSans";
612
+ return CustomizationDefaultFont2;
613
+ })(CustomizationDefaultFont || {});
614
+ var CustomizationBackground = /* @__PURE__ */ ((CustomizationBackground2) => {
615
+ CustomizationBackground2["Plain"] = "plain";
616
+ CustomizationBackground2["Match"] = "match";
617
+ return CustomizationBackground2;
618
+ })(CustomizationBackground || {});
670
619
  var CustomizationIconsStyle = /* @__PURE__ */ ((CustomizationIconsStyle2) => {
671
620
  CustomizationIconsStyle2["Regular"] = "regular";
672
621
  CustomizationIconsStyle2["Solid"] = "solid";
@@ -686,6 +635,42 @@ var CustomizationSidebarListStyle = /* @__PURE__ */ ((CustomizationSidebarListSt
686
635
  CustomizationSidebarListStyle2["Line"] = "line";
687
636
  return CustomizationSidebarListStyle2;
688
637
  })(CustomizationSidebarListStyle || {});
638
+ var CustomizationSearchStyle = /* @__PURE__ */ ((CustomizationSearchStyle2) => {
639
+ CustomizationSearchStyle2["Prominent"] = "prominent";
640
+ CustomizationSearchStyle2["Subtle"] = "subtle";
641
+ return CustomizationSearchStyle2;
642
+ })(CustomizationSearchStyle || {});
643
+ var CustomizationLocale = /* @__PURE__ */ ((CustomizationLocale2) => {
644
+ CustomizationLocale2["En"] = "en";
645
+ CustomizationLocale2["Fr"] = "fr";
646
+ CustomizationLocale2["Es"] = "es";
647
+ CustomizationLocale2["Zh"] = "zh";
648
+ CustomizationLocale2["Ja"] = "ja";
649
+ CustomizationLocale2["De"] = "de";
650
+ CustomizationLocale2["Nl"] = "nl";
651
+ CustomizationLocale2["No"] = "no";
652
+ CustomizationLocale2["PtBr"] = "pt-br";
653
+ return CustomizationLocale2;
654
+ })(CustomizationLocale || {});
655
+ var CustomizationHeaderPreset = /* @__PURE__ */ ((CustomizationHeaderPreset2) => {
656
+ CustomizationHeaderPreset2["Default"] = "default";
657
+ CustomizationHeaderPreset2["Bold"] = "bold";
658
+ CustomizationHeaderPreset2["Contrast"] = "contrast";
659
+ CustomizationHeaderPreset2["Custom"] = "custom";
660
+ CustomizationHeaderPreset2["None"] = "none";
661
+ return CustomizationHeaderPreset2;
662
+ })(CustomizationHeaderPreset || {});
663
+ var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
664
+ CustomizationThemeMode2["Light"] = "light";
665
+ CustomizationThemeMode2["Dark"] = "dark";
666
+ return CustomizationThemeMode2;
667
+ })(CustomizationThemeMode || {});
668
+ var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
669
+ PageFeedbackRating2["Bad"] = "bad";
670
+ PageFeedbackRating2["Ok"] = "ok";
671
+ PageFeedbackRating2["Good"] = "good";
672
+ return PageFeedbackRating2;
673
+ })(PageFeedbackRating || {});
689
674
  var SiteInsightsLinkPosition = /* @__PURE__ */ ((SiteInsightsLinkPosition2) => {
690
675
  SiteInsightsLinkPosition2["Header"] = "header";
691
676
  SiteInsightsLinkPosition2["Footer"] = "footer";
@@ -774,13 +759,6 @@ var SiteInsightsQueryRange = /* @__PURE__ */ ((SiteInsightsQueryRange2) => {
774
759
  SiteInsightsQueryRange2["Last24Hours"] = "last24Hours";
775
760
  return SiteInsightsQueryRange2;
776
761
  })(SiteInsightsQueryRange || {});
777
- var InsightsInterval = /* @__PURE__ */ ((InsightsInterval2) => {
778
- InsightsInterval2["Day"] = "day";
779
- InsightsInterval2["Week"] = "week";
780
- InsightsInterval2["Month"] = "month";
781
- InsightsInterval2["Year"] = "year";
782
- return InsightsInterval2;
783
- })(InsightsInterval || {});
784
762
  var StorageUploadKind = /* @__PURE__ */ ((StorageUploadKind2) => {
785
763
  StorageUploadKind2["CustomizationFont"] = "customization_font";
786
764
  return StorageUploadKind2;
@@ -806,11 +784,6 @@ var CustomHostnameErrorStatus = /* @__PURE__ */ ((CustomHostnameErrorStatus2) =>
806
784
  CustomHostnameErrorStatus2["InternalError"] = "internal_error";
807
785
  return CustomHostnameErrorStatus2;
808
786
  })(CustomHostnameErrorStatus || {});
809
- var PurgeCDNCacheContextType = /* @__PURE__ */ ((PurgeCDNCacheContextType2) => {
810
- PurgeCDNCacheContextType2["Tags"] = "tags";
811
- PurgeCDNCacheContextType2["Hosts"] = "hosts";
812
- return PurgeCDNCacheContextType2;
813
- })(PurgeCDNCacheContextType || {});
814
787
  var CloudflareHostnameStatus = /* @__PURE__ */ ((CloudflareHostnameStatus2) => {
815
788
  CloudflareHostnameStatus2["Pending"] = "pending";
816
789
  CloudflareHostnameStatus2["Active"] = "active";
@@ -1100,43 +1073,6 @@ var Api = class extends HttpClient {
1100
1073
  format: "json",
1101
1074
  ...params
1102
1075
  });
1103
- search = {
1104
- searchContent: (query, params = {}) => this.request({
1105
- path: `/search`,
1106
- method: "GET",
1107
- query,
1108
- secure: true,
1109
- format: "json",
1110
- ...params
1111
- }),
1112
- askQueryWithGet: (query, params = {}) => this.request({
1113
- path: `/search/ask`,
1114
- method: "GET",
1115
- query,
1116
- secure: true,
1117
- format: "json",
1118
- ...params
1119
- }),
1120
- askQuery: (data, query, params = {}) => this.request({
1121
- path: `/search/ask`,
1122
- method: "POST",
1123
- query,
1124
- body: data,
1125
- secure: true,
1126
- type: "application/json" /* Json */,
1127
- format: "json",
1128
- ...params
1129
- }),
1130
- getRecommendedQuestions: (data, params = {}) => this.request({
1131
- path: `/search/questions`,
1132
- method: "POST",
1133
- body: data,
1134
- secure: true,
1135
- type: "application/json" /* Json */,
1136
- format: "json",
1137
- ...params
1138
- })
1139
- };
1140
1076
  user = {
1141
1077
  getAuthenticatedUser: (params = {}) => this.request({
1142
1078
  path: `/user`,
@@ -1227,44 +1163,6 @@ var Api = class extends HttpClient {
1227
1163
  format: "json",
1228
1164
  ...params
1229
1165
  }),
1230
- askQueryInSpaceWithGet: (spaceId, query, params = {}) => this.request({
1231
- path: `/spaces/${spaceId}/search/ask`,
1232
- method: "GET",
1233
- query,
1234
- secure: true,
1235
- format: "json",
1236
- ...params
1237
- }),
1238
- askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
1239
- path: `/spaces/${spaceId}/search/ask`,
1240
- method: "POST",
1241
- query,
1242
- body: data,
1243
- secure: true,
1244
- type: "application/json" /* Json */,
1245
- format: "json",
1246
- ...params
1247
- }),
1248
- streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
1249
- path: `/spaces/${spaceId}/search/ask/stream`,
1250
- method: "GET",
1251
- query,
1252
- secure: true,
1253
- ...params
1254
- }),
1255
- getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
1256
- path: `/spaces/${spaceId}/search/questions`,
1257
- method: "GET",
1258
- secure: true,
1259
- format: "json",
1260
- ...params
1261
- }),
1262
- streamRecommendedQuestionsInSpace: (spaceId, params = {}) => this.streamRequest({
1263
- path: `/spaces/${spaceId}/search/questions/stream`,
1264
- method: "GET",
1265
- secure: true,
1266
- ...params
1267
- }),
1268
1166
  importGitRepository: (spaceId, data, params = {}) => this.request({
1269
1167
  path: `/spaces/${spaceId}/git/import`,
1270
1168
  method: "POST",
@@ -1288,37 +1186,6 @@ var Api = class extends HttpClient {
1288
1186
  format: "json",
1289
1187
  ...params
1290
1188
  }),
1291
- getContentAnalyticsForSpaceById: (spaceId, params = {}) => this.request({
1292
- path: `/spaces/${spaceId}/insights/content`,
1293
- method: "GET",
1294
- secure: true,
1295
- format: "json",
1296
- ...params
1297
- }),
1298
- getSearchAnalyticsForSpaceById: (spaceId, query, params = {}) => this.request({
1299
- path: `/spaces/${spaceId}/insights/search`,
1300
- method: "GET",
1301
- query,
1302
- secure: true,
1303
- format: "json",
1304
- ...params
1305
- }),
1306
- getTrafficAnalyticsForSpaceById: (spaceId, query, params = {}) => this.request({
1307
- path: `/spaces/${spaceId}/insights/traffic`,
1308
- method: "GET",
1309
- query,
1310
- secure: true,
1311
- format: "json",
1312
- ...params
1313
- }),
1314
- trackViewInSpaceById: (spaceId, data, params = {}) => this.request({
1315
- path: `/spaces/${spaceId}/insights/track_view`,
1316
- method: "POST",
1317
- body: data,
1318
- secure: true,
1319
- type: "application/json" /* Json */,
1320
- ...params
1321
- }),
1322
1189
  inviteToSpace: (spaceId, data, params = {}) => this.request({
1323
1190
  path: `/spaces/${spaceId}/permissions`,
1324
1191
  method: "POST",
@@ -1947,22 +1814,6 @@ var Api = class extends HttpClient {
1947
1814
  format: "json",
1948
1815
  ...params
1949
1816
  }),
1950
- getSpacePublishingCustomizationById: (spaceId, params = {}) => this.request({
1951
- path: `/spaces/${spaceId}/publishing/customization`,
1952
- method: "GET",
1953
- secure: true,
1954
- format: "json",
1955
- ...params
1956
- }),
1957
- updateSpacePublishingCustomizationById: (spaceId, data, params = {}) => this.request({
1958
- path: `/spaces/${spaceId}/publishing/customization`,
1959
- method: "PUT",
1960
- body: data,
1961
- secure: true,
1962
- type: "application/json" /* Json */,
1963
- format: "json",
1964
- ...params
1965
- }),
1966
1817
  listSpaceIntegrations: (spaceId, query, params = {}) => this.request({
1967
1818
  path: `/spaces/${spaceId}/integrations`,
1968
1819
  method: "GET",
@@ -2000,22 +1851,6 @@ var Api = class extends HttpClient {
2000
1851
  type: "application/json" /* Json */,
2001
1852
  ...params
2002
1853
  }),
2003
- getPageFeedback: (spaceId, pageId, visitorId, params = {}) => this.request({
2004
- path: `/spaces/${spaceId}/pages/${pageId}/feedbacks/${visitorId}`,
2005
- method: "GET",
2006
- secure: true,
2007
- format: "json",
2008
- ...params
2009
- }),
2010
- createPageFeedback: (spaceId, pageId, visitorId, data, params = {}) => this.request({
2011
- path: `/spaces/${spaceId}/pages/${pageId}/feedbacks/${visitorId}`,
2012
- method: "PUT",
2013
- body: data,
2014
- secure: true,
2015
- type: "application/json" /* Json */,
2016
- format: "json",
2017
- ...params
2018
- }),
2019
1854
  getSpacePdf: (spaceId, query, params = {}) => this.request({
2020
1855
  path: `/spaces/${spaceId}/pdf`,
2021
1856
  method: "GET",
@@ -3080,23 +2915,6 @@ var Api = class extends HttpClient {
3080
2915
  secure: true,
3081
2916
  ...params
3082
2917
  }),
3083
- getContentAnalyticsForSiteSpaceById: (organizationId, siteId, siteSpaceId, query, params = {}) => this.request({
3084
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/insights/content`,
3085
- method: "GET",
3086
- query,
3087
- secure: true,
3088
- format: "json",
3089
- ...params
3090
- }),
3091
- createSitesPageFeedback: (organizationId, siteId, siteSpaceId, pageId, visitorId, data, params = {}) => this.request({
3092
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/insights/pages/${pageId}/feedbacks/${visitorId}`,
3093
- method: "PUT",
3094
- body: data,
3095
- secure: true,
3096
- type: "application/json" /* Json */,
3097
- format: "json",
3098
- ...params
3099
- }),
3100
2918
  moveSiteSectionGroup: (organizationId, siteId, siteSectionGroupId, data, params = {}) => this.request({
3101
2919
  path: `/orgs/${organizationId}/sites/${siteId}/section-groups/${siteSectionGroupId}/move`,
3102
2920
  method: "POST",
@@ -3132,14 +2950,6 @@ var Api = class extends HttpClient {
3132
2950
  format: "json",
3133
2951
  ...params
3134
2952
  }),
3135
- trackViewInSiteById: (organizationId, siteId, data, params = {}) => this.request({
3136
- path: `/orgs/${organizationId}/sites/${siteId}/insights/track_view`,
3137
- method: "POST",
3138
- body: data,
3139
- secure: true,
3140
- type: "application/json" /* Json */,
3141
- ...params
3142
- }),
3143
2953
  trackEventsInSiteById: (organizationId, siteId, data, params = {}) => this.request({
3144
2954
  path: `/orgs/${organizationId}/sites/${siteId}/insights/events`,
3145
2955
  method: "POST",
@@ -3164,14 +2974,6 @@ var Api = class extends HttpClient {
3164
2974
  format: "json",
3165
2975
  ...params
3166
2976
  }),
3167
- getSearchAnalyticsForSiteById: (organizationId, siteId, query, params = {}) => this.request({
3168
- path: `/orgs/${organizationId}/sites/${siteId}/insights/search`,
3169
- method: "GET",
3170
- query,
3171
- secure: true,
3172
- format: "json",
3173
- ...params
3174
- }),
3175
2977
  updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
3176
2978
  path: `/orgs/${organizationId}/sites/${siteId}/ads`,
3177
2979
  method: "POST",
@@ -3384,14 +3186,17 @@ var GitBookAPI = class extends Api {
3384
3186
  endpoint;
3385
3187
  authToken;
3386
3188
  userAgent;
3189
+ serviceBinding;
3387
3190
  constructor(options = {}) {
3388
3191
  const {
3389
3192
  endpoint = GITBOOK_DEFAULT_ENDPOINT,
3390
3193
  authToken,
3391
- userAgent = `${name}/${version}`
3194
+ userAgent = `${name}/${version}`,
3195
+ serviceBinding
3392
3196
  } = options;
3197
+ const normalizedEndpoint = endpoint.endsWith("/") ? endpoint.slice(0, -1) : endpoint;
3393
3198
  super({
3394
- baseUrl: `${endpoint}/v1`,
3199
+ baseUrl: `${normalizedEndpoint}/v1`,
3395
3200
  securityWorker: (securityData) => {
3396
3201
  if (securityData && securityData.authToken) {
3397
3202
  return {
@@ -3410,7 +3215,7 @@ var GitBookAPI = class extends Api {
3410
3215
  if (init && "referrerPolicy" in init) {
3411
3216
  delete init.referrerPolicy;
3412
3217
  }
3413
- const response = await fetch(input, init);
3218
+ const response = await (this.serviceBinding ? this.serviceBinding.fetch(input, init) : fetch(input, init));
3414
3219
  if (!response.ok) {
3415
3220
  let error = response.statusText;
3416
3221
  try {
@@ -3423,9 +3228,10 @@ var GitBookAPI = class extends Api {
3423
3228
  return response;
3424
3229
  }
3425
3230
  });
3426
- this.endpoint = endpoint;
3231
+ this.endpoint = normalizedEndpoint;
3427
3232
  this.userAgent = userAgent;
3428
3233
  this.authToken = authToken;
3234
+ this.serviceBinding = serviceBinding;
3429
3235
  this.setSecurityData({ authToken });
3430
3236
  }
3431
3237
  async createInstallationClient(integrationName, installationId) {
@@ -3436,14 +3242,13 @@ var GitBookAPI = class extends Api {
3436
3242
  return new GitBookAPI({
3437
3243
  endpoint: this.endpoint,
3438
3244
  userAgent: this.userAgent,
3439
- authToken: installationToken.token
3245
+ authToken: installationToken.token,
3246
+ serviceBinding: this.serviceBinding
3440
3247
  });
3441
3248
  }
3442
3249
  };
3443
3250
  export {
3444
3251
  APIIntegrationScope,
3445
- AnalyticsSearchPeriod,
3446
- AnalyticsTrafficInterval,
3447
3252
  Api,
3448
3253
  BillingInterval,
3449
3254
  BillingProduct,
@@ -3468,11 +3273,12 @@ export {
3468
3273
  CustomHostnameSslStatus,
3469
3274
  CustomizationBackground,
3470
3275
  CustomizationCorners,
3471
- CustomizationFont,
3276
+ CustomizationDefaultFont,
3472
3277
  CustomizationHeaderPreset,
3473
3278
  CustomizationIconsStyle,
3474
3279
  CustomizationLinksStyle,
3475
3280
  CustomizationLocale,
3281
+ CustomizationSearchStyle,
3476
3282
  CustomizationSidebarBackgroundStyle,
3477
3283
  CustomizationSidebarListStyle,
3478
3284
  CustomizationTheme,
@@ -3486,7 +3292,6 @@ export {
3486
3292
  GitSyncProvider,
3487
3293
  HttpClient,
3488
3294
  ImportContentSource,
3489
- InsightsInterval,
3490
3295
  IntegrationCategory,
3491
3296
  IntegrationInstallationSiteSelection,
3492
3297
  IntegrationInstallationSpaceSelection,
@@ -3502,13 +3307,13 @@ export {
3502
3307
  OrganizationType,
3503
3308
  OrganizationUseCase,
3504
3309
  PageFeedbackRating,
3505
- PurgeCDNCacheContextType,
3506
3310
  RevisionPageLayoutOptionsCoverSize,
3507
3311
  RevisionPageLayoutPreset,
3508
3312
  RevisionPageType,
3509
3313
  RevisionSemanticChangeType,
3510
3314
  SiteAdsStatus,
3511
3315
  SiteAdsTopic,
3316
+ SiteCustomizationFeature,
3512
3317
  SiteInsightsAdPlacement,
3513
3318
  SiteInsightsEventType,
3514
3319
  SiteInsightsLinkPosition,
@@ -3519,7 +3324,6 @@ export {
3519
3324
  SiteInsightsVisitorBrowser,
3520
3325
  SiteInsightsVisitorDevice,
3521
3326
  SiteInsightsVisitorOS,
3522
- SiteToMigrateFeature,
3523
3327
  SiteType,
3524
3328
  SiteVisibility,
3525
3329
  SpaceEditMode,
package/package.json CHANGED
@@ -4,13 +4,22 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.96.1",
7
+ "version": "0.98.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
11
11
  "spec/**",
12
12
  "dist/**"
13
13
  ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/GitbookIO/integrations.git",
17
+ "directory": "packages/api"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/GitbookIO/integrations/issues"
21
+ },
22
+ "homepage": "https://github.com/GitbookIO/integrations",
14
23
  "dependencies": {
15
24
  "event-iterator": "^2.0.0",
16
25
  "eventsource-parser": "^3.0.0"