@gitbook/api 0.137.0 → 0.138.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
@@ -4965,7 +4965,10 @@ export declare enum CustomizationSearchStyle {
4965
4965
  Prominent = "prominent",
4966
4966
  Subtle = "subtle"
4967
4967
  }
4968
- /** Language for the UI element */
4968
+ /**
4969
+ * Language for the UI element
4970
+ * @deprecated
4971
+ */
4969
4972
  export declare enum CustomizationLocale {
4970
4973
  En = "en",
4971
4974
  Fr = "fr",
@@ -5102,6 +5105,7 @@ export interface SiteCustomizationSettings {
5102
5105
  */
5103
5106
  search: CustomizationSearchStyle;
5104
5107
  };
5108
+ /** @deprecated */
5105
5109
  internationalization: {
5106
5110
  /** Language for the UI element */
5107
5111
  locale: CustomizationLocale;
@@ -5617,10 +5621,20 @@ export interface SiteInsightsEventSession {
5617
5621
  */
5618
5622
  visitorAuthClaims?: PlainObject;
5619
5623
  }
5624
+ /** Context in which the event was recorded. */
5625
+ export declare enum SiteInsightsDisplayContext {
5626
+ Site = "site",
5627
+ Embed = "embed"
5628
+ }
5620
5629
  /** Location of the event. */
5621
5630
  export interface SiteInsightsEventLocation {
5622
5631
  /** URL of the location. */
5623
5632
  url: URL;
5633
+ /**
5634
+ * Whether the event was tracked on the site or an embed widget.
5635
+ * @default "site"
5636
+ */
5637
+ displayContext?: SiteInsightsDisplayContext;
5624
5638
  /** ID of the concerned site section. */
5625
5639
  siteSection: string | null;
5626
5640
  /** ID of the concerned site space. */
@@ -5691,6 +5705,10 @@ export type SiteInsightsEventAskQuestion = SiteInsightsEventBase & {
5691
5705
  /** Question being asked. */
5692
5706
  query: string;
5693
5707
  };
5708
+ /** Event when a user views the ask UI. */
5709
+ export type SiteInsightsEventAskView = SiteInsightsEventBase & {
5710
+ type: 'ask_view';
5711
+ };
5694
5712
  export type SiteInsightsEventAskRateResponse = SiteInsightsEventBase & {
5695
5713
  type: 'ask_rate_response';
5696
5714
  /** Question asked. */
@@ -5750,7 +5768,7 @@ export type SiteInsightsEventAdDisplay = SiteInsightsEventBase & {
5750
5768
  type: 'ad_display';
5751
5769
  ad: SiteInsightsAd;
5752
5770
  };
5753
- export type SiteInsightsEvent = SiteInsightsEventPageView | SiteInsightsEventSearchOpen | SiteInsightsEventSearchTypeQuery | SiteInsightsEventSearchOpenResult | SiteInsightsEventPagePostFeedback | SiteInsightsEventPagePostFeedbackComment | SiteInsightsEventAskQuestion | SiteInsightsEventAskRateResponse | SiteInsightsEventLinkClick | SiteInsightsEventAPIClientOpen | SiteInsightsEventAPIClientRequest | SiteInsightsEventTrademarkClick | SiteInsightsEventAdClick | SiteInsightsEventAdDisplay;
5771
+ export type SiteInsightsEvent = SiteInsightsEventPageView | SiteInsightsEventSearchOpen | SiteInsightsEventSearchTypeQuery | SiteInsightsEventSearchOpenResult | SiteInsightsEventPagePostFeedback | SiteInsightsEventPagePostFeedbackComment | SiteInsightsEventAskQuestion | SiteInsightsEventAskView | SiteInsightsEventAskRateResponse | SiteInsightsEventLinkClick | SiteInsightsEventAPIClientOpen | SiteInsightsEventAPIClientRequest | SiteInsightsEventTrademarkClick | SiteInsightsEventAdClick | SiteInsightsEventAdDisplay;
5754
5772
  export interface SiteInsightsQueryDateTimeColumn {
5755
5773
  column: 'datetime';
5756
5774
  interval?: 'hour' | 'day' | 'week' | 'month';
@@ -5771,6 +5789,8 @@ export type SiteInsightsQueryEventsColumn = SiteInsightsQueryDateTimeColumn | {
5771
5789
  column: 'siteSpace';
5772
5790
  } | {
5773
5791
  column: 'siteShareKey';
5792
+ } | {
5793
+ column: 'displayContext';
5774
5794
  } | {
5775
5795
  column: 'page';
5776
5796
  } | {
@@ -5850,6 +5870,7 @@ export declare enum SiteInsightsEventType {
5850
5870
  PagePostFeedback = "page_post_feedback",
5851
5871
  PagePostFeedbackComment = "page_post_feedback_comment",
5852
5872
  AskQuestion = "ask_question",
5873
+ AskView = "ask_view",
5853
5874
  AskRateResponse = "ask_rate_response",
5854
5875
  LinkClick = "link_click",
5855
5876
  ApiClientOpen = "api_client_open",
@@ -5946,6 +5967,9 @@ export type SiteInsightsQueryEventsValues = {
5946
5967
  } | {
5947
5968
  column: 'siteShareKey';
5948
5969
  values: (string | null)[];
5970
+ } | {
5971
+ column: 'displayContext';
5972
+ values: SiteInsightsDisplayContext[];
5949
5973
  } | {
5950
5974
  column: 'page';
5951
5975
  values: (null | {
@@ -12372,6 +12396,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12372
12396
  /** The style of background to use. Set to null to reset the override. */
12373
12397
  background?: CustomizationBackground | null;
12374
12398
  };
12399
+ /** @deprecated */
12375
12400
  internationalization?: {
12376
12401
  /** The locale to use for the non-custom elements of the UI. Set to null to reset the override. */
12377
12402
  locale: CustomizationLocale | null;
package/dist/index.cjs CHANGED
@@ -257,6 +257,7 @@ __export(src_exports, {
257
257
  SiteExternalLinksTarget: () => SiteExternalLinksTarget,
258
258
  SiteFeatureKey: () => SiteFeatureKey,
259
259
  SiteInsightsAdPlacement: () => SiteInsightsAdPlacement,
260
+ SiteInsightsDisplayContext: () => SiteInsightsDisplayContext,
260
261
  SiteInsightsEventType: () => SiteInsightsEventType,
261
262
  SiteInsightsLinkPosition: () => SiteInsightsLinkPosition,
262
263
  SiteInsightsQueryOperator: () => SiteInsightsQueryOperator,
@@ -280,7 +281,7 @@ module.exports = __toCommonJS(src_exports);
280
281
 
281
282
  // package.json
282
283
  var name = "@gitbook/api";
283
- var version = "0.137.0";
284
+ var version = "0.138.0";
284
285
 
285
286
  // src/client.ts
286
287
  var import_event_iterator = __toESM(require_node(), 1);
@@ -908,6 +909,11 @@ var AIModel = /* @__PURE__ */ ((AIModel2) => {
908
909
  AIModel2["ReasoningHigh"] = "reasoning-high";
909
910
  return AIModel2;
910
911
  })(AIModel || {});
912
+ var SiteInsightsDisplayContext = /* @__PURE__ */ ((SiteInsightsDisplayContext2) => {
913
+ SiteInsightsDisplayContext2["Site"] = "site";
914
+ SiteInsightsDisplayContext2["Embed"] = "embed";
915
+ return SiteInsightsDisplayContext2;
916
+ })(SiteInsightsDisplayContext || {});
911
917
  var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
912
918
  PageFeedbackRating2["Bad"] = "bad";
913
919
  PageFeedbackRating2["Ok"] = "ok";
@@ -941,6 +947,7 @@ var SiteInsightsEventType = /* @__PURE__ */ ((SiteInsightsEventType2) => {
941
947
  SiteInsightsEventType2["PagePostFeedback"] = "page_post_feedback";
942
948
  SiteInsightsEventType2["PagePostFeedbackComment"] = "page_post_feedback_comment";
943
949
  SiteInsightsEventType2["AskQuestion"] = "ask_question";
950
+ SiteInsightsEventType2["AskView"] = "ask_view";
944
951
  SiteInsightsEventType2["AskRateResponse"] = "ask_rate_response";
945
952
  SiteInsightsEventType2["LinkClick"] = "link_click";
946
953
  SiteInsightsEventType2["ApiClientOpen"] = "api_client_open";
@@ -3897,6 +3904,7 @@ var GitBookAPI = class extends Api {
3897
3904
  SiteExternalLinksTarget,
3898
3905
  SiteFeatureKey,
3899
3906
  SiteInsightsAdPlacement,
3907
+ SiteInsightsDisplayContext,
3900
3908
  SiteInsightsEventType,
3901
3909
  SiteInsightsLinkPosition,
3902
3910
  SiteInsightsQueryOperator,
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.137.0";
175
+ var version = "0.138.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -800,6 +800,11 @@ var AIModel = /* @__PURE__ */ ((AIModel2) => {
800
800
  AIModel2["ReasoningHigh"] = "reasoning-high";
801
801
  return AIModel2;
802
802
  })(AIModel || {});
803
+ var SiteInsightsDisplayContext = /* @__PURE__ */ ((SiteInsightsDisplayContext2) => {
804
+ SiteInsightsDisplayContext2["Site"] = "site";
805
+ SiteInsightsDisplayContext2["Embed"] = "embed";
806
+ return SiteInsightsDisplayContext2;
807
+ })(SiteInsightsDisplayContext || {});
803
808
  var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
804
809
  PageFeedbackRating2["Bad"] = "bad";
805
810
  PageFeedbackRating2["Ok"] = "ok";
@@ -833,6 +838,7 @@ var SiteInsightsEventType = /* @__PURE__ */ ((SiteInsightsEventType2) => {
833
838
  SiteInsightsEventType2["PagePostFeedback"] = "page_post_feedback";
834
839
  SiteInsightsEventType2["PagePostFeedbackComment"] = "page_post_feedback_comment";
835
840
  SiteInsightsEventType2["AskQuestion"] = "ask_question";
841
+ SiteInsightsEventType2["AskView"] = "ask_view";
836
842
  SiteInsightsEventType2["AskRateResponse"] = "ask_rate_response";
837
843
  SiteInsightsEventType2["LinkClick"] = "link_click";
838
844
  SiteInsightsEventType2["ApiClientOpen"] = "api_client_open";
@@ -3788,6 +3794,7 @@ export {
3788
3794
  SiteExternalLinksTarget,
3789
3795
  SiteFeatureKey,
3790
3796
  SiteInsightsAdPlacement,
3797
+ SiteInsightsDisplayContext,
3791
3798
  SiteInsightsEventType,
3792
3799
  SiteInsightsLinkPosition,
3793
3800
  SiteInsightsQueryOperator,
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.137.0",
7
+ "version": "0.138.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -14409,6 +14409,7 @@
14409
14409
  },
14410
14410
  "internationalization": {
14411
14411
  "type": "object",
14412
+ "deprecated": true,
14412
14413
  "properties": {
14413
14414
  "locale": {
14414
14415
  "description": "The locale to use for the non-custom elements of the UI. Set to null to reset the override.",
@@ -32969,6 +32970,7 @@
32969
32970
  "CustomizationLocale": {
32970
32971
  "type": "string",
32971
32972
  "description": "Language for the UI element",
32973
+ "deprecated": true,
32972
32974
  "enum": [
32973
32975
  "en",
32974
32976
  "fr",
@@ -33229,6 +33231,7 @@
33229
33231
  },
33230
33232
  "internationalization": {
33231
33233
  "type": "object",
33234
+ "deprecated": true,
33232
33235
  "properties": {
33233
33236
  "locale": {
33234
33237
  "$ref": "#/components/schemas/CustomizationLocale"
@@ -34119,8 +34122,7 @@
34119
34122
  },
34120
34123
  "required": [
34121
34124
  "name",
34122
- "description",
34123
- "confirmation"
34125
+ "description"
34124
34126
  ]
34125
34127
  },
34126
34128
  "AIToolCallOtherSummary": {
@@ -34879,6 +34881,14 @@
34879
34881
  "referrer"
34880
34882
  ]
34881
34883
  },
34884
+ "SiteInsightsDisplayContext": {
34885
+ "type": "string",
34886
+ "description": "Context in which the event was recorded.",
34887
+ "enum": [
34888
+ "site",
34889
+ "embed"
34890
+ ]
34891
+ },
34882
34892
  "SiteInsightsEventLocation": {
34883
34893
  "type": "object",
34884
34894
  "description": "Location of the event.",
@@ -34887,6 +34897,11 @@
34887
34897
  "description": "URL of the location.",
34888
34898
  "$ref": "#/components/schemas/URL"
34889
34899
  },
34900
+ "displayContext": {
34901
+ "description": "Whether the event was tracked on the site or an embed widget.",
34902
+ "$ref": "#/components/schemas/SiteInsightsDisplayContext",
34903
+ "default": "site"
34904
+ },
34890
34905
  "siteSection": {
34891
34906
  "type": "string",
34892
34907
  "description": "ID of the concerned site section.",
@@ -35165,6 +35180,28 @@
35165
35180
  }
35166
35181
  ]
35167
35182
  },
35183
+ "SiteInsightsEventAskView": {
35184
+ "description": "Event when a user views the ask UI.",
35185
+ "allOf": [
35186
+ {
35187
+ "$ref": "#/components/schemas/SiteInsightsEventBase"
35188
+ },
35189
+ {
35190
+ "type": "object",
35191
+ "properties": {
35192
+ "type": {
35193
+ "type": "string",
35194
+ "enum": [
35195
+ "ask_view"
35196
+ ]
35197
+ }
35198
+ },
35199
+ "required": [
35200
+ "type"
35201
+ ]
35202
+ }
35203
+ ]
35204
+ },
35168
35205
  "SiteInsightsEventAskRateResponse": {
35169
35206
  "allOf": [
35170
35207
  {
@@ -35433,6 +35470,9 @@
35433
35470
  {
35434
35471
  "$ref": "#/components/schemas/SiteInsightsEventAskQuestion"
35435
35472
  },
35473
+ {
35474
+ "$ref": "#/components/schemas/SiteInsightsEventAskView"
35475
+ },
35436
35476
  {
35437
35477
  "$ref": "#/components/schemas/SiteInsightsEventAskRateResponse"
35438
35478
  },
@@ -35596,6 +35636,20 @@
35596
35636
  }
35597
35637
  }
35598
35638
  },
35639
+ {
35640
+ "type": "object",
35641
+ "required": [
35642
+ "column"
35643
+ ],
35644
+ "properties": {
35645
+ "column": {
35646
+ "type": "string",
35647
+ "enum": [
35648
+ "displayContext"
35649
+ ]
35650
+ }
35651
+ }
35652
+ },
35599
35653
  {
35600
35654
  "type": "object",
35601
35655
  "required": [
@@ -36065,6 +36119,7 @@
36065
36119
  "page_post_feedback",
36066
36120
  "page_post_feedback_comment",
36067
36121
  "ask_question",
36122
+ "ask_view",
36068
36123
  "ask_rate_response",
36069
36124
  "link_click",
36070
36125
  "api_client_open",
@@ -36527,6 +36582,27 @@
36527
36582
  }
36528
36583
  }
36529
36584
  },
36585
+ {
36586
+ "type": "object",
36587
+ "required": [
36588
+ "column",
36589
+ "values"
36590
+ ],
36591
+ "properties": {
36592
+ "column": {
36593
+ "type": "string",
36594
+ "enum": [
36595
+ "displayContext"
36596
+ ]
36597
+ },
36598
+ "values": {
36599
+ "type": "array",
36600
+ "items": {
36601
+ "$ref": "#/components/schemas/SiteInsightsDisplayContext"
36602
+ }
36603
+ }
36604
+ }
36605
+ },
36530
36606
  {
36531
36607
  "type": "object",
36532
36608
  "required": [
package/spec/openapi.yaml CHANGED
@@ -8138,6 +8138,7 @@ paths:
8138
8138
  - null
8139
8139
  internationalization:
8140
8140
  type: object
8141
+ deprecated: true
8141
8142
  properties:
8142
8143
  locale:
8143
8144
  description: The locale to use for the non-custom elements of the UI. Set to null to reset the override.
@@ -20322,6 +20323,7 @@ components:
20322
20323
  CustomizationLocale:
20323
20324
  type: string
20324
20325
  description: Language for the UI element
20326
+ deprecated: true
20325
20327
  enum:
20326
20328
  - en
20327
20329
  - fr
@@ -20514,6 +20516,7 @@ components:
20514
20516
  - search
20515
20517
  internationalization:
20516
20518
  type: object
20519
+ deprecated: true
20517
20520
  properties:
20518
20521
  locale:
20519
20522
  $ref: "#/components/schemas/CustomizationLocale"
@@ -21112,7 +21115,6 @@ components:
21112
21115
  required:
21113
21116
  - name
21114
21117
  - description
21115
- - confirmation
21116
21118
  AIToolCallOtherSummary:
21117
21119
  type: object
21118
21120
  description: Summary of a generic tool call.
@@ -21659,6 +21661,12 @@ components:
21659
21661
  - userAgent
21660
21662
  - language
21661
21663
  - referrer
21664
+ SiteInsightsDisplayContext:
21665
+ type: string
21666
+ description: Context in which the event was recorded.
21667
+ enum:
21668
+ - site
21669
+ - embed
21662
21670
  SiteInsightsEventLocation:
21663
21671
  type: object
21664
21672
  description: Location of the event.
@@ -21666,6 +21674,10 @@ components:
21666
21674
  url:
21667
21675
  description: URL of the location.
21668
21676
  $ref: "#/components/schemas/URL"
21677
+ displayContext:
21678
+ description: Whether the event was tracked on the site or an embed widget.
21679
+ $ref: "#/components/schemas/SiteInsightsDisplayContext"
21680
+ default: site
21669
21681
  siteSection:
21670
21682
  type: string
21671
21683
  description: ID of the concerned site section.
@@ -21840,6 +21852,18 @@ components:
21840
21852
  required:
21841
21853
  - type
21842
21854
  - query
21855
+ SiteInsightsEventAskView:
21856
+ description: Event when a user views the ask UI.
21857
+ allOf:
21858
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
21859
+ - type: object
21860
+ properties:
21861
+ type:
21862
+ type: string
21863
+ enum:
21864
+ - ask_view
21865
+ required:
21866
+ - type
21843
21867
  SiteInsightsEventAskRateResponse:
21844
21868
  allOf:
21845
21869
  - $ref: "#/components/schemas/SiteInsightsEventBase"
@@ -21998,6 +22022,7 @@ components:
21998
22022
  - $ref: "#/components/schemas/SiteInsightsEventPagePostFeedback"
21999
22023
  - $ref: "#/components/schemas/SiteInsightsEventPagePostFeedbackComment"
22000
22024
  - $ref: "#/components/schemas/SiteInsightsEventAskQuestion"
22025
+ - $ref: "#/components/schemas/SiteInsightsEventAskView"
22001
22026
  - $ref: "#/components/schemas/SiteInsightsEventAskRateResponse"
22002
22027
  - $ref: "#/components/schemas/SiteInsightsEventLinkClick"
22003
22028
  - $ref: "#/components/schemas/SiteInsightsEventAPIClientOpen"
@@ -22088,6 +22113,14 @@ components:
22088
22113
  type: string
22089
22114
  enum:
22090
22115
  - siteShareKey
22116
+ - type: object
22117
+ required:
22118
+ - column
22119
+ properties:
22120
+ column:
22121
+ type: string
22122
+ enum:
22123
+ - displayContext
22091
22124
  - type: object
22092
22125
  required:
22093
22126
  - column
@@ -22361,6 +22394,7 @@ components:
22361
22394
  - page_post_feedback
22362
22395
  - page_post_feedback_comment
22363
22396
  - ask_question
22397
+ - ask_view
22364
22398
  - ask_rate_response
22365
22399
  - link_click
22366
22400
  - api_client_open
@@ -22661,6 +22695,19 @@ components:
22661
22695
  items:
22662
22696
  type: string
22663
22697
  nullable: true
22698
+ - type: object
22699
+ required:
22700
+ - column
22701
+ - values
22702
+ properties:
22703
+ column:
22704
+ type: string
22705
+ enum:
22706
+ - displayContext
22707
+ values:
22708
+ type: array
22709
+ items:
22710
+ $ref: "#/components/schemas/SiteInsightsDisplayContext"
22664
22711
  - type: object
22665
22712
  required:
22666
22713
  - column