@gitbook/api 0.42.0 → 0.44.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 CHANGED
@@ -68,6 +68,38 @@ export interface RequestSpaceTrackPageView {
68
68
  /** The URL of referrer that linked to the page. */
69
69
  referrer: string;
70
70
  }
71
+ export interface RequestSiteTrackPageView {
72
+ /** Unique identifier of the page. */
73
+ pageId?: string;
74
+ /** Unique identifier of the space. */
75
+ spaceId: string;
76
+ /** Analytics info on the GitBook's content visitor. */
77
+ visitor: {
78
+ /** GitBook's unique identifier of the visitor. */
79
+ anonymousId: string;
80
+ /** The visitors cookies. */
81
+ cookies: Record<string, string>;
82
+ /**
83
+ * IP address of the visitor.
84
+ * If undefined, it'll default to the IP executing the request.
85
+ */
86
+ ip?: string;
87
+ /**
88
+ * User-agent of the visitor.
89
+ * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
90
+ */
91
+ userAgent: string;
92
+ /**
93
+ * Language of the visitor.
94
+ * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
95
+ */
96
+ language?: string;
97
+ };
98
+ /** The GitBook content's URL visited (including URL params). */
99
+ url: string;
100
+ /** The URL of referrer that linked to the page. */
101
+ referrer: string;
102
+ }
71
103
  export interface RequestPublishIntegration {
72
104
  /**
73
105
  * Base64 content of the icon
@@ -405,6 +437,9 @@ export declare type Embed = {
405
437
  } | {
406
438
  type: 'rich';
407
439
  html: string;
440
+ } | {
441
+ type: 'integration';
442
+ block: IntegrationBlock;
408
443
  });
409
444
  export declare type Comment = {
410
445
  /** Type of Object, always equals to "comment" */
@@ -2569,7 +2604,9 @@ export declare enum IntegrationScope {
2569
2604
  SpaceScriptCookies = "space:script:cookies",
2570
2605
  SpaceGitSync = "space:git:sync",
2571
2606
  SpaceVisitorAuth = "space:visitor:auth",
2607
+ SiteViewsRead = "site:views:read",
2572
2608
  SiteScriptInject = "site:script:inject",
2609
+ SiteScriptCookies = "site:script:cookies",
2573
2610
  SiteVisitorAuth = "site:visitor:auth"
2574
2611
  }
2575
2612
  /** A search string to filter integrations by name */
@@ -2703,6 +2740,8 @@ export interface IntegrationInstallation {
2703
2740
  status: IntegrationInstallationStatus;
2704
2741
  /** Describe whether all spaces have been selected or there's a selection involved */
2705
2742
  space_selection: IntegrationInstallationSpaceSelection;
2743
+ /** Describe whether all sites have been selected or there's a selection involved */
2744
+ site_selection: IntegrationInstallationSiteSelection;
2706
2745
  /** Count of spaces, the installation is managing */
2707
2746
  spaces: number;
2708
2747
  /** Configuration of the integration at the account level */
@@ -2895,6 +2934,14 @@ export interface SpaceIntegrationScript {
2895
2934
  /** If true, the script will potentially load use cookies and visitors should be aware. */
2896
2935
  cookies: boolean;
2897
2936
  }
2937
+ export interface SiteIntegrationScript {
2938
+ /** Script URL to load. */
2939
+ script: URL;
2940
+ /** Content Security Policy to secure the loading of this script. */
2941
+ contentSecurityPolicy?: string;
2942
+ /** If true, the script will potentially load use cookies and visitors should be aware. */
2943
+ cookies: boolean;
2944
+ }
2898
2945
  /** Entity to create or update in an integration's installation. */
2899
2946
  export interface UpsertEntity {
2900
2947
  /** Unique ID of the entity in the context of the integration's entity type */
@@ -3004,23 +3051,7 @@ export declare type EntityPropertySchema = {
3004
3051
  };
3005
3052
  });
3006
3053
  /** Any event that can be received from GitBook. */
3007
- export declare type Event = InstallationSetupEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | (SiteEvent & {
3008
- type: 'site_installation_setup';
3009
- status: IntegrationInstallationStatus;
3010
- /** The state of the site installation before it was updated. */
3011
- previous?: {
3012
- status: IntegrationInstallationStatus;
3013
- /** The previous configuration of the site installation. */
3014
- configuration?: object;
3015
- };
3016
- }) | (SiteEvent & {
3017
- type: 'site_installation_deleted';
3018
- /** The state of the site installation before it was deleted. */
3019
- previous: {
3020
- /** The previous configuration of the site installation. */
3021
- configuration?: object;
3022
- };
3023
- }) | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent;
3054
+ export declare type Event = InstallationSetupEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SpaceViewEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent;
3024
3055
  /** Common properties for all events. */
3025
3056
  export interface BaseEvent {
3026
3057
  /** Unique identifier for the event. */
@@ -3074,9 +3105,28 @@ export declare type SpaceInstallationDeletedEvent = SpaceEvent & {
3074
3105
  configuration?: object;
3075
3106
  };
3076
3107
  };
3077
- export declare type SpaceViewEvent = SiteViewEvent;
3108
+ /** Event received when integration has been installed or updated on a site. */
3109
+ export declare type SiteInstallationSetupEvent = SiteEvent & {
3110
+ type: 'site_installation_setup';
3111
+ status: IntegrationInstallationStatus;
3112
+ /** The state of the site installation before it was updated. */
3113
+ previous?: {
3114
+ status: IntegrationInstallationStatus;
3115
+ /** The previous configuration of the site installation. */
3116
+ configuration?: object;
3117
+ };
3118
+ };
3119
+ /** Event received when integration has been uninstalled from a site. */
3120
+ export declare type SiteInstallationDeletedEvent = SiteEvent & {
3121
+ type: 'site_installation_deleted';
3122
+ /** The state of the site installation before it was deleted. */
3123
+ previous: {
3124
+ /** The previous configuration of the site installation. */
3125
+ configuration?: object;
3126
+ };
3127
+ };
3078
3128
  /** Event received when a page has been visited. */
3079
- export declare type SiteViewEvent = SpaceEvent & {
3129
+ export declare type SpaceViewEvent = SpaceEvent & {
3080
3130
  type: 'space_view';
3081
3131
  /** Unique identifier of the visited page. */
3082
3132
  pageId?: string;
@@ -3098,6 +3148,31 @@ export declare type SiteViewEvent = SpaceEvent & {
3098
3148
  /** The URL of referrer that linked to the page. */
3099
3149
  referrer: string;
3100
3150
  };
3151
+ /** Event received when a page has been visited on a site. */
3152
+ export declare type SiteViewEvent = SiteEvent & {
3153
+ type: 'site_view';
3154
+ /** Unique identifier of the visited space in the site. */
3155
+ spaceId: string;
3156
+ /** Unique identifier of the visited page. */
3157
+ pageId?: string;
3158
+ /** Analytics info on the GitBook's content visitor. */
3159
+ visitor: {
3160
+ /** GitBook's unique identifier of the visitor. */
3161
+ anonymousId: string;
3162
+ /** The visitors cookies. */
3163
+ cookies: Record<string, string>;
3164
+ /** User-agent of the visitor. */
3165
+ userAgent: string;
3166
+ /** IP address of the visitor. */
3167
+ ip: string;
3168
+ /** Language of the visitor. */
3169
+ language?: string;
3170
+ };
3171
+ /** The GitBook content's URL visited (including URL params). */
3172
+ url: string;
3173
+ /** The URL of referrer that linked to the page. */
3174
+ referrer: string;
3175
+ };
3101
3176
  /** Event when the primary content of a space has been updated. */
3102
3177
  export declare type SpaceContentUpdatedEvent = SpaceEvent & {
3103
3178
  type: 'space_content_updated';
@@ -3204,15 +3279,14 @@ export declare enum BillingProduct {
3204
3279
  Free2024 = "free_2024",
3205
3280
  Plus2024 = "plus_2024",
3206
3281
  Pro2024 = "pro_2024",
3207
- Enterprise2024 = "enterprise_2024",
3282
+ Enterprise = "enterprise",
3208
3283
  Free = "free",
3209
3284
  Plus = "plus",
3210
3285
  Pro = "pro",
3211
3286
  Team = "team",
3212
3287
  Business = "business",
3213
3288
  Legacy = "legacy",
3214
- Startup = "startup",
3215
- Enterprise = "enterprise"
3289
+ Startup = "startup"
3216
3290
  }
3217
3291
  export declare type BillingUpgrade = {
3218
3292
  result: 'checkout';
@@ -3431,7 +3505,7 @@ export interface ContentKitContextBase {
3431
3505
  theme: 'dark' | 'light';
3432
3506
  }
3433
3507
  /** Object representing the context in which a ContentKit component is rendered. */
3434
- export declare type ContentKitContext = ContentKitContextConfigurationAccount | ContentKitContextConfigurationSpace | ContentKitContextDocument;
3508
+ export declare type ContentKitContext = ContentKitContextConfigurationAccount | ContentKitContextConfigurationSpace | ContentKitContextConfigurationSite | ContentKitContextDocument;
3435
3509
  /** Context while rendering in an account installation's configuration. */
3436
3510
  export declare type ContentKitContextConfigurationAccount = ContentKitContextBase & {
3437
3511
  type: 'configuration_account';
@@ -3444,6 +3518,12 @@ export declare type ContentKitContextConfigurationSpace = ContentKitContextBase
3444
3518
  /** ID of the space the space-installation configuration is in. */
3445
3519
  spaceId: string;
3446
3520
  };
3521
+ /** Context while rendering in a site-installation's configuration. */
3522
+ export declare type ContentKitContextConfigurationSite = ContentKitContextBase & {
3523
+ type: 'configuration_site';
3524
+ /** ID of the site the site-installation configuration is in. */
3525
+ siteId: string;
3526
+ };
3447
3527
  /** Context while rendering in a document. */
3448
3528
  export declare type ContentKitContextDocument = ContentKitContextBase & {
3449
3529
  type: 'document';
@@ -3801,7 +3881,7 @@ export declare type SubscriptionChannel = SpaceInfoChannel | SpaceGitInfoChannel
3801
3881
  space: string;
3802
3882
  changeRequest?: string;
3803
3883
  comment: string;
3804
- } | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | SiteChannel | SiteCustomizationChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteSpacesChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | CustomHostnameChannel;
3884
+ } | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | SiteChannel | SiteCustomizationChannel | SiteIntegrationsChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteSpacesChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | CustomHostnameChannel;
3805
3885
  export interface SpaceInfoChannel {
3806
3886
  channel: 'space';
3807
3887
  space: string;
@@ -3987,6 +4067,10 @@ export interface SiteCustomizationChannel {
3987
4067
  channel: 'site-customization';
3988
4068
  site: string;
3989
4069
  }
4070
+ export interface SiteIntegrationsChannel {
4071
+ channel: 'site-integrations';
4072
+ site: string;
4073
+ }
3990
4074
  export interface SitePublishingAuthChannel {
3991
4075
  channel: 'site-publishing-auth';
3992
4076
  site: string;
@@ -4249,6 +4333,14 @@ export interface ShareLink {
4249
4333
  /** Name of the share link */
4250
4334
  name?: ShareLinkName;
4251
4335
  active?: boolean;
4336
+ /** URLs associated with the object */
4337
+ urls: {
4338
+ /**
4339
+ * URL of the published version of the share-link.
4340
+ * @format uri
4341
+ */
4342
+ published?: string;
4343
+ };
4252
4344
  }
4253
4345
  /**
4254
4346
  * Name of the share link
@@ -4546,7 +4638,8 @@ export declare enum SiteSubscriptionStatus {
4546
4638
  }
4547
4639
  export declare enum SiteSubscriptionType {
4548
4640
  Basic = "basic",
4549
- Premium = "premium"
4641
+ Premium = "premium",
4642
+ PremiumVa = "premium_va"
4550
4643
  }
4551
4644
  export interface SiteSubscription {
4552
4645
  type: SiteSubscriptionType;
@@ -4920,6 +5013,19 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4920
5013
  message: string;
4921
5014
  };
4922
5015
  }>>;
5016
+ /**
5017
+ * No description
5018
+ *
5019
+ * @tags spaces
5020
+ * @name GetEmbedByUrlInSpace
5021
+ * @summary Resolve a URL to an embed in a given space
5022
+ * @request GET:/spaces/{spaceId}/embed
5023
+ * @secure
5024
+ */
5025
+ getEmbedByUrlInSpace: (spaceId: string, query: {
5026
+ /** URL to resolve */
5027
+ url: string;
5028
+ }, params?: RequestParams) => Promise<HttpResponse<Embed, Error>>;
4923
5029
  /**
4924
5030
  * No description
4925
5031
  *
@@ -8593,12 +8699,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8593
8699
  * No description
8594
8700
  *
8595
8701
  * @tags sites
8596
- * @name GetSitePublishingAuthSettings
8702
+ * @name GetSitePublishingAuthById
8597
8703
  * @summary Get the publishing authentication settings for a site.
8598
8704
  * @request GET:/orgs/{organizationId}/sites/{siteId}/publishing/auth
8599
8705
  * @secure
8600
8706
  */
8601
- getSitePublishingAuthSettings: (organizationId: string, siteId: string, params?: RequestParams) => Promise<HttpResponse<SitePublishingAuth, Error | {
8707
+ getSitePublishingAuthById: (organizationId: string, siteId: string, params?: RequestParams) => Promise<HttpResponse<SitePublishingAuth, Error | {
8602
8708
  error: {
8603
8709
  /** @format int32 */
8604
8710
  code: 400;
@@ -8609,12 +8715,33 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8609
8715
  * No description
8610
8716
  *
8611
8717
  * @tags sites
8612
- * @name UpdateSitePublishingAuthSettings
8718
+ * @name UpdateSitePublishingAuthById
8613
8719
  * @summary Update the publishing authentication settings for a site.
8614
8720
  * @request PATCH:/orgs/{organizationId}/sites/{siteId}/publishing/auth
8615
8721
  * @secure
8616
8722
  */
8617
- updateSitePublishingAuthSettings: (organizationId: string, siteId: string, data: SitePublishingAuthUpdate, params?: RequestParams) => Promise<HttpResponse<SitePublishingAuth, Error | {
8723
+ updateSitePublishingAuthById: (organizationId: string, siteId: string, data: SitePublishingAuthUpdate, params?: RequestParams) => Promise<HttpResponse<SitePublishingAuth, Error | {
8724
+ error: {
8725
+ /** @format int32 */
8726
+ code: 400;
8727
+ message: string;
8728
+ };
8729
+ }>>;
8730
+ /**
8731
+ * No description
8732
+ *
8733
+ * @tags sites
8734
+ * @name GetSitePublishingPreviewById
8735
+ * @summary Get a URL to preview the published content of a site. The URL will be valid for 1 hour.
8736
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/publishing/preview
8737
+ * @secure
8738
+ */
8739
+ getSitePublishingPreviewById: (organizationId: string, siteId: string, query?: {
8740
+ /** ID of the site-space to preview. If not provided, the default site-space will be used. */
8741
+ siteSpace?: string;
8742
+ }, params?: RequestParams) => Promise<HttpResponse<{
8743
+ url: URL;
8744
+ }, Error | {
8618
8745
  error: {
8619
8746
  /** @format int32 */
8620
8747
  code: 400;
@@ -8653,6 +8780,37 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8653
8780
  message: string;
8654
8781
  };
8655
8782
  }>>;
8783
+ /**
8784
+ * No description
8785
+ *
8786
+ * @tags integrations, sites
8787
+ * @name ListSiteIntegrationScripts
8788
+ * @summary List the scripts to embed in published content for a site.
8789
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/integration-scripts
8790
+ * @secure
8791
+ */
8792
+ listSiteIntegrationScripts: (organizationId: string, siteId: string, params?: RequestParams) => Promise<HttpResponse<SiteIntegrationScript[], Error | {
8793
+ error: {
8794
+ /** @format int32 */
8795
+ code: 400;
8796
+ message: string;
8797
+ };
8798
+ }>>;
8799
+ /**
8800
+ * No description
8801
+ *
8802
+ * @tags integrations, sites
8803
+ * @name ListSiteIntegrations
8804
+ * @summary List integrations enabled in a site.
8805
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/integrations
8806
+ * @secure
8807
+ */
8808
+ listSiteIntegrations: (organizationId: string, siteId: string, query?: {
8809
+ /** A search string to filter integrations by name */
8810
+ search?: any;
8811
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
8812
+ items: Integration[];
8813
+ }, Error>>;
8656
8814
  /**
8657
8815
  * No description
8658
8816
  *
@@ -8804,6 +8962,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8804
8962
  origin: SpacePointer;
8805
8963
  }[];
8806
8964
  }, Error>>;
8965
+ /**
8966
+ * @description Track a page view in a site.
8967
+ *
8968
+ * @tags analytics, sites
8969
+ * @name TrackViewInSiteById
8970
+ * @request POST:/orgs/{organizationId}/sites/{siteId}/insights/track_view
8971
+ * @secure
8972
+ */
8973
+ trackViewInSiteById: (organizationId: string, siteId: string, data: RequestSiteTrackPageView, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
8807
8974
  };
8808
8975
  customHostnames: {
8809
8976
  /**
package/dist/index.cjs CHANGED
@@ -239,7 +239,7 @@ module.exports = __toCommonJS(src_exports);
239
239
 
240
240
  // package.json
241
241
  var name = "@gitbook/api";
242
- var version = "0.42.0";
242
+ var version = "0.44.0";
243
243
 
244
244
  // src/client.ts
245
245
  var import_event_iterator = __toESM(require_node(), 1);
@@ -515,7 +515,9 @@ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
515
515
  IntegrationScope2["SpaceScriptCookies"] = "space:script:cookies";
516
516
  IntegrationScope2["SpaceGitSync"] = "space:git:sync";
517
517
  IntegrationScope2["SpaceVisitorAuth"] = "space:visitor:auth";
518
+ IntegrationScope2["SiteViewsRead"] = "site:views:read";
518
519
  IntegrationScope2["SiteScriptInject"] = "site:script:inject";
520
+ IntegrationScope2["SiteScriptCookies"] = "site:script:cookies";
519
521
  IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
520
522
  return IntegrationScope2;
521
523
  })(IntegrationScope || {});
@@ -565,7 +567,7 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
565
567
  BillingProduct2["Free2024"] = "free_2024";
566
568
  BillingProduct2["Plus2024"] = "plus_2024";
567
569
  BillingProduct2["Pro2024"] = "pro_2024";
568
- BillingProduct2["Enterprise2024"] = "enterprise_2024";
570
+ BillingProduct2["Enterprise"] = "enterprise";
569
571
  BillingProduct2["Free"] = "free";
570
572
  BillingProduct2["Plus"] = "plus";
571
573
  BillingProduct2["Pro"] = "pro";
@@ -573,7 +575,6 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
573
575
  BillingProduct2["Business"] = "business";
574
576
  BillingProduct2["Legacy"] = "legacy";
575
577
  BillingProduct2["Startup"] = "startup";
576
- BillingProduct2["Enterprise"] = "enterprise";
577
578
  return BillingProduct2;
578
579
  })(BillingProduct || {});
579
580
  var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
@@ -719,6 +720,7 @@ var SiteSubscriptionStatus = /* @__PURE__ */ ((SiteSubscriptionStatus2) => {
719
720
  var SiteSubscriptionType = /* @__PURE__ */ ((SiteSubscriptionType2) => {
720
721
  SiteSubscriptionType2["Basic"] = "basic";
721
722
  SiteSubscriptionType2["Premium"] = "premium";
723
+ SiteSubscriptionType2["PremiumVa"] = "premium_va";
722
724
  return SiteSubscriptionType2;
723
725
  })(SiteSubscriptionType || {});
724
726
  var CustomHostnameDnsStatus = /* @__PURE__ */ ((CustomHostnameDnsStatus2) => {
@@ -1059,6 +1061,14 @@ var Api = class extends HttpClient {
1059
1061
  format: "json",
1060
1062
  ...params
1061
1063
  }),
1064
+ getEmbedByUrlInSpace: (spaceId, query, params = {}) => this.request({
1065
+ path: `/spaces/${spaceId}/embed`,
1066
+ method: "GET",
1067
+ query,
1068
+ secure: true,
1069
+ format: "json",
1070
+ ...params
1071
+ }),
1062
1072
  searchSpaceContent: (spaceId, query, params = {}) => this.request({
1063
1073
  path: `/spaces/${spaceId}/search`,
1064
1074
  method: "GET",
@@ -2856,14 +2866,14 @@ var Api = class extends HttpClient {
2856
2866
  secure: true,
2857
2867
  ...params
2858
2868
  }),
2859
- getSitePublishingAuthSettings: (organizationId, siteId, params = {}) => this.request({
2869
+ getSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2860
2870
  path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2861
2871
  method: "GET",
2862
2872
  secure: true,
2863
2873
  format: "json",
2864
2874
  ...params
2865
2875
  }),
2866
- updateSitePublishingAuthSettings: (organizationId, siteId, data, params = {}) => this.request({
2876
+ updateSitePublishingAuthById: (organizationId, siteId, data, params = {}) => this.request({
2867
2877
  path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2868
2878
  method: "PATCH",
2869
2879
  body: data,
@@ -2872,6 +2882,14 @@ var Api = class extends HttpClient {
2872
2882
  format: "json",
2873
2883
  ...params
2874
2884
  }),
2885
+ getSitePublishingPreviewById: (organizationId, siteId, query, params = {}) => this.request({
2886
+ path: `/orgs/${organizationId}/sites/${siteId}/publishing/preview`,
2887
+ method: "GET",
2888
+ query,
2889
+ secure: true,
2890
+ format: "json",
2891
+ ...params
2892
+ }),
2875
2893
  getSiteCustomizationById: (organizationId, siteId, params = {}) => this.request({
2876
2894
  path: `/orgs/${organizationId}/sites/${siteId}/customization`,
2877
2895
  method: "GET",
@@ -2888,6 +2906,21 @@ var Api = class extends HttpClient {
2888
2906
  format: "json",
2889
2907
  ...params
2890
2908
  }),
2909
+ listSiteIntegrationScripts: (organizationId, siteId, params = {}) => this.request({
2910
+ path: `/orgs/${organizationId}/sites/${siteId}/integration-scripts`,
2911
+ method: "GET",
2912
+ secure: true,
2913
+ format: "json",
2914
+ ...params
2915
+ }),
2916
+ listSiteIntegrations: (organizationId, siteId, query, params = {}) => this.request({
2917
+ path: `/orgs/${organizationId}/sites/${siteId}/integrations`,
2918
+ method: "GET",
2919
+ query,
2920
+ secure: true,
2921
+ format: "json",
2922
+ ...params
2923
+ }),
2891
2924
  addSpaceToSite: (organizationId, siteId, data, params = {}) => this.request({
2892
2925
  path: `/orgs/${organizationId}/sites/${siteId}/spaces`,
2893
2926
  method: "POST",
@@ -2952,6 +2985,14 @@ var Api = class extends HttpClient {
2952
2985
  secure: true,
2953
2986
  format: "json",
2954
2987
  ...params
2988
+ }),
2989
+ trackViewInSiteById: (organizationId, siteId, data, params = {}) => this.request({
2990
+ path: `/orgs/${organizationId}/sites/${siteId}/insights/track_view`,
2991
+ method: "POST",
2992
+ body: data,
2993
+ secure: true,
2994
+ type: "application/json" /* Json */,
2995
+ ...params
2955
2996
  })
2956
2997
  };
2957
2998
  this.customHostnames = {
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.42.0";
175
+ var version = "0.44.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -448,7 +448,9 @@ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
448
448
  IntegrationScope2["SpaceScriptCookies"] = "space:script:cookies";
449
449
  IntegrationScope2["SpaceGitSync"] = "space:git:sync";
450
450
  IntegrationScope2["SpaceVisitorAuth"] = "space:visitor:auth";
451
+ IntegrationScope2["SiteViewsRead"] = "site:views:read";
451
452
  IntegrationScope2["SiteScriptInject"] = "site:script:inject";
453
+ IntegrationScope2["SiteScriptCookies"] = "site:script:cookies";
452
454
  IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
453
455
  return IntegrationScope2;
454
456
  })(IntegrationScope || {});
@@ -498,7 +500,7 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
498
500
  BillingProduct2["Free2024"] = "free_2024";
499
501
  BillingProduct2["Plus2024"] = "plus_2024";
500
502
  BillingProduct2["Pro2024"] = "pro_2024";
501
- BillingProduct2["Enterprise2024"] = "enterprise_2024";
503
+ BillingProduct2["Enterprise"] = "enterprise";
502
504
  BillingProduct2["Free"] = "free";
503
505
  BillingProduct2["Plus"] = "plus";
504
506
  BillingProduct2["Pro"] = "pro";
@@ -506,7 +508,6 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
506
508
  BillingProduct2["Business"] = "business";
507
509
  BillingProduct2["Legacy"] = "legacy";
508
510
  BillingProduct2["Startup"] = "startup";
509
- BillingProduct2["Enterprise"] = "enterprise";
510
511
  return BillingProduct2;
511
512
  })(BillingProduct || {});
512
513
  var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
@@ -652,6 +653,7 @@ var SiteSubscriptionStatus = /* @__PURE__ */ ((SiteSubscriptionStatus2) => {
652
653
  var SiteSubscriptionType = /* @__PURE__ */ ((SiteSubscriptionType2) => {
653
654
  SiteSubscriptionType2["Basic"] = "basic";
654
655
  SiteSubscriptionType2["Premium"] = "premium";
656
+ SiteSubscriptionType2["PremiumVa"] = "premium_va";
655
657
  return SiteSubscriptionType2;
656
658
  })(SiteSubscriptionType || {});
657
659
  var CustomHostnameDnsStatus = /* @__PURE__ */ ((CustomHostnameDnsStatus2) => {
@@ -992,6 +994,14 @@ var Api = class extends HttpClient {
992
994
  format: "json",
993
995
  ...params
994
996
  }),
997
+ getEmbedByUrlInSpace: (spaceId, query, params = {}) => this.request({
998
+ path: `/spaces/${spaceId}/embed`,
999
+ method: "GET",
1000
+ query,
1001
+ secure: true,
1002
+ format: "json",
1003
+ ...params
1004
+ }),
995
1005
  searchSpaceContent: (spaceId, query, params = {}) => this.request({
996
1006
  path: `/spaces/${spaceId}/search`,
997
1007
  method: "GET",
@@ -2789,14 +2799,14 @@ var Api = class extends HttpClient {
2789
2799
  secure: true,
2790
2800
  ...params
2791
2801
  }),
2792
- getSitePublishingAuthSettings: (organizationId, siteId, params = {}) => this.request({
2802
+ getSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2793
2803
  path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2794
2804
  method: "GET",
2795
2805
  secure: true,
2796
2806
  format: "json",
2797
2807
  ...params
2798
2808
  }),
2799
- updateSitePublishingAuthSettings: (organizationId, siteId, data, params = {}) => this.request({
2809
+ updateSitePublishingAuthById: (organizationId, siteId, data, params = {}) => this.request({
2800
2810
  path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2801
2811
  method: "PATCH",
2802
2812
  body: data,
@@ -2805,6 +2815,14 @@ var Api = class extends HttpClient {
2805
2815
  format: "json",
2806
2816
  ...params
2807
2817
  }),
2818
+ getSitePublishingPreviewById: (organizationId, siteId, query, params = {}) => this.request({
2819
+ path: `/orgs/${organizationId}/sites/${siteId}/publishing/preview`,
2820
+ method: "GET",
2821
+ query,
2822
+ secure: true,
2823
+ format: "json",
2824
+ ...params
2825
+ }),
2808
2826
  getSiteCustomizationById: (organizationId, siteId, params = {}) => this.request({
2809
2827
  path: `/orgs/${organizationId}/sites/${siteId}/customization`,
2810
2828
  method: "GET",
@@ -2821,6 +2839,21 @@ var Api = class extends HttpClient {
2821
2839
  format: "json",
2822
2840
  ...params
2823
2841
  }),
2842
+ listSiteIntegrationScripts: (organizationId, siteId, params = {}) => this.request({
2843
+ path: `/orgs/${organizationId}/sites/${siteId}/integration-scripts`,
2844
+ method: "GET",
2845
+ secure: true,
2846
+ format: "json",
2847
+ ...params
2848
+ }),
2849
+ listSiteIntegrations: (organizationId, siteId, query, params = {}) => this.request({
2850
+ path: `/orgs/${organizationId}/sites/${siteId}/integrations`,
2851
+ method: "GET",
2852
+ query,
2853
+ secure: true,
2854
+ format: "json",
2855
+ ...params
2856
+ }),
2824
2857
  addSpaceToSite: (organizationId, siteId, data, params = {}) => this.request({
2825
2858
  path: `/orgs/${organizationId}/sites/${siteId}/spaces`,
2826
2859
  method: "POST",
@@ -2885,6 +2918,14 @@ var Api = class extends HttpClient {
2885
2918
  secure: true,
2886
2919
  format: "json",
2887
2920
  ...params
2921
+ }),
2922
+ trackViewInSiteById: (organizationId, siteId, data, params = {}) => this.request({
2923
+ path: `/orgs/${organizationId}/sites/${siteId}/insights/track_view`,
2924
+ method: "POST",
2925
+ body: data,
2926
+ secure: true,
2927
+ type: "application/json" /* Json */,
2928
+ ...params
2888
2929
  })
2889
2930
  };
2890
2931
  this.customHostnames = {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.42.0",
7
+ "version": "0.44.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",