@gitbook/api 0.84.0 → 0.85.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
@@ -592,16 +592,19 @@ export interface DocumentBlockTabs {
592
592
  isVoid?: false;
593
593
  data?: object;
594
594
  }
595
- export interface DocumentBlockSwagger {
595
+ /** Pointer to an operation in the OpenAPI spec. */
596
+ export interface OpenAPIOperationPointer {
597
+ /** Path of the operation in the OpenAPI spec. */
598
+ path: string;
599
+ /** HTTP method of the operation in the OpenAPI spec. */
600
+ method: string;
601
+ }
602
+ export interface DocumentBlockOpenAPI {
596
603
  object: 'block';
597
604
  type: 'swagger';
598
605
  key?: string;
599
- data: {
606
+ data: OpenAPIOperationPointer & {
600
607
  ref: ContentRefFile;
601
- /** Path of the operation in the OpenAPI spec. */
602
- path?: string;
603
- /** HTTP method of the operation in the OpenAPI spec. */
604
- method?: string;
605
608
  /** If true, the block is opened by default. */
606
609
  expanded?: boolean;
607
610
  fullWidth?: boolean;
@@ -639,7 +642,7 @@ export interface DocumentBlockStepper {
639
642
  isVoid?: false;
640
643
  data?: object;
641
644
  }
642
- export type DocumentBlocksTopLevels = DocumentBlocksEssentials | DocumentBlockQuote | DocumentBlockHint | DocumentBlockImages | DocumentBlockFile | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockCode | DocumentBlockMath | DocumentBlockExpandable | DocumentBlockTabs | DocumentBlockTable | DocumentBlockSwagger | DocumentBlockContentRef | DocumentBlockIntegration | DocumentBlockReusableContent | DocumentBlockStepper;
645
+ export type DocumentBlocksTopLevels = DocumentBlocksEssentials | DocumentBlockQuote | DocumentBlockHint | DocumentBlockImages | DocumentBlockFile | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockCode | DocumentBlockMath | DocumentBlockExpandable | DocumentBlockTabs | DocumentBlockTable | DocumentBlockOpenAPI | DocumentBlockContentRef | DocumentBlockIntegration | DocumentBlockReusableContent | DocumentBlockStepper;
643
646
  export interface JSONDocument {
644
647
  object: 'document';
645
648
  data: {
@@ -4526,8 +4529,13 @@ export interface SiteInsightsEventSession {
4526
4529
  * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
4527
4530
  */
4528
4531
  language: string | null;
4529
- /** Referrer of the sesion */
4530
- referrer: null | URL;
4532
+ /** Referrer of the session */
4533
+ referrer: '' | null | URL;
4534
+ /**
4535
+ * Authentication token of the visitor.
4536
+ * This is used to identify the visitor with adaptive content.
4537
+ */
4538
+ visitorAuthToken?: string | null;
4531
4539
  }
4532
4540
  /** Location of the event. */
4533
4541
  export interface SiteInsightsEventLocation {
@@ -4587,7 +4595,25 @@ export type SiteInsightsEventAskQuestion = SiteInsightsEventBase & {
4587
4595
  /** Question being asked. */
4588
4596
  query: string;
4589
4597
  };
4590
- export type SiteInsightsEvent = SiteInsightsEventPageView | SiteInsightsEventSearchOpen | SiteInsightsEventSearchTypeQuery | SiteInsightsEventSearchOpenResult | SiteInsightsEventPagePostFeedback | SiteInsightsEventAskQuestion;
4598
+ export type SiteInsightsEventLinkClick = SiteInsightsEventBase & {
4599
+ type: 'link_click';
4600
+ link: {
4601
+ /** A relative reference to content in GitBook. */
4602
+ target: ContentRef;
4603
+ position: 'header' | 'footer' | 'sidebar' | 'content';
4604
+ };
4605
+ };
4606
+ export type SiteInsightsEventAPIClientOpen = SiteInsightsEventBase & {
4607
+ type: 'api_client_open';
4608
+ /** Pointer to an operation in the OpenAPI spec. */
4609
+ operation: OpenAPIOperationPointer;
4610
+ };
4611
+ export type SiteInsightsEventAPIClientRequest = SiteInsightsEventBase & {
4612
+ type: 'api_client_request';
4613
+ /** Pointer to an operation in the OpenAPI spec. */
4614
+ operation: OpenAPIOperationPointer;
4615
+ };
4616
+ export type SiteInsightsEvent = SiteInsightsEventPageView | SiteInsightsEventSearchOpen | SiteInsightsEventSearchTypeQuery | SiteInsightsEventSearchOpenResult | SiteInsightsEventPagePostFeedback | SiteInsightsEventAskQuestion | SiteInsightsEventLinkClick | SiteInsightsEventAPIClientOpen | SiteInsightsEventAPIClientRequest;
4591
4617
  /**
4592
4618
  * The interval for grouping the results
4593
4619
  * @default "week"
@@ -4935,7 +4961,7 @@ export interface ContentPublishingAuth {
4935
4961
  */
4936
4962
  fallbackURL?: string;
4937
4963
  }
4938
- export type DocumentBlock = DocumentBlockParagraph | DocumentBlockHeading | DocumentBlockListOrdered | DocumentBlockListUnordered | DocumentBlockListTasks | DocumentBlockListItem | DocumentBlockDivider | DocumentBlockQuote | DocumentBlockHint | DocumentBlockImages | DocumentBlockImage | DocumentBlockFile | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockCode | DocumentBlockCodeLine | DocumentBlockMath | DocumentBlockExpandable | DocumentBlockTabs | DocumentBlockTabsItem | DocumentBlockTable | DocumentBlockSwagger | DocumentBlockContentRef | DocumentBlockIntegration | DocumentBlockReusableContent | DocumentBlockStepper | DocumentBlockStepperStep;
4964
+ export type DocumentBlock = DocumentBlockParagraph | DocumentBlockHeading | DocumentBlockListOrdered | DocumentBlockListUnordered | DocumentBlockListTasks | DocumentBlockListItem | DocumentBlockDivider | DocumentBlockQuote | DocumentBlockHint | DocumentBlockImages | DocumentBlockImage | DocumentBlockFile | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockCode | DocumentBlockCodeLine | DocumentBlockMath | DocumentBlockExpandable | DocumentBlockTabs | DocumentBlockTabsItem | DocumentBlockTable | DocumentBlockOpenAPI | DocumentBlockContentRef | DocumentBlockIntegration | DocumentBlockReusableContent | DocumentBlockStepper | DocumentBlockStepperStep;
4939
4965
  export type InputPageBase = {
4940
4966
  /**
4941
4967
  * Optional unique identifier for the page.
package/dist/index.cjs CHANGED
@@ -253,7 +253,7 @@ module.exports = __toCommonJS(src_exports);
253
253
 
254
254
  // package.json
255
255
  var name = "@gitbook/api";
256
- var version = "0.84.0";
256
+ var version = "0.85.0";
257
257
 
258
258
  // src/client.ts
259
259
  var import_event_iterator = __toESM(require_node(), 1);
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.84.0";
175
+ var version = "0.85.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
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.84.0",
7
+ "version": "0.85.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -19124,7 +19124,25 @@
19124
19124
  "nodes"
19125
19125
  ]
19126
19126
  },
19127
- "DocumentBlockSwagger": {
19127
+ "OpenAPIOperationPointer": {
19128
+ "type": "object",
19129
+ "description": "Pointer to an operation in the OpenAPI spec.",
19130
+ "properties": {
19131
+ "path": {
19132
+ "type": "string",
19133
+ "description": "Path of the operation in the OpenAPI spec."
19134
+ },
19135
+ "method": {
19136
+ "type": "string",
19137
+ "description": "HTTP method of the operation in the OpenAPI spec."
19138
+ }
19139
+ },
19140
+ "required": [
19141
+ "path",
19142
+ "method"
19143
+ ]
19144
+ },
19145
+ "DocumentBlockOpenAPI": {
19128
19146
  "type": "object",
19129
19147
  "properties": {
19130
19148
  "object": {
@@ -19143,33 +19161,32 @@
19143
19161
  "type": "string"
19144
19162
  },
19145
19163
  "data": {
19146
- "type": "object",
19147
- "properties": {
19148
- "ref": {
19149
- "oneOf": [
19150
- {
19151
- "$ref": "#/components/schemas/ContentRefFile"
19164
+ "allOf": [
19165
+ {
19166
+ "$ref": "#/components/schemas/OpenAPIOperationPointer"
19167
+ },
19168
+ {
19169
+ "type": "object",
19170
+ "properties": {
19171
+ "ref": {
19172
+ "oneOf": [
19173
+ {
19174
+ "$ref": "#/components/schemas/ContentRefFile"
19175
+ }
19176
+ ]
19177
+ },
19178
+ "expanded": {
19179
+ "type": "boolean",
19180
+ "description": "If true, the block is opened by default."
19181
+ },
19182
+ "fullWidth": {
19183
+ "type": "boolean"
19152
19184
  }
19185
+ },
19186
+ "required": [
19187
+ "ref"
19153
19188
  ]
19154
- },
19155
- "path": {
19156
- "type": "string",
19157
- "description": "Path of the operation in the OpenAPI spec."
19158
- },
19159
- "method": {
19160
- "type": "string",
19161
- "description": "HTTP method of the operation in the OpenAPI spec."
19162
- },
19163
- "expanded": {
19164
- "type": "boolean",
19165
- "description": "If true, the block is opened by default."
19166
- },
19167
- "fullWidth": {
19168
- "type": "boolean"
19169
19189
  }
19170
- },
19171
- "required": [
19172
- "ref"
19173
19190
  ]
19174
19191
  },
19175
19192
  "isVoid": {
@@ -19402,7 +19419,7 @@
19402
19419
  "$ref": "#/components/schemas/DocumentBlockTable"
19403
19420
  },
19404
19421
  {
19405
- "$ref": "#/components/schemas/DocumentBlockSwagger"
19422
+ "$ref": "#/components/schemas/DocumentBlockOpenAPI"
19406
19423
  },
19407
19424
  {
19408
19425
  "$ref": "#/components/schemas/DocumentBlockContentRef"
@@ -30758,19 +30775,25 @@
30758
30775
  "description": "Language of the visitor.\nhttps://developer.mozilla.org/en-US/docs/Web/API/Navigator/language\n"
30759
30776
  },
30760
30777
  "referrer": {
30761
- "description": "Referrer of the sesion",
30778
+ "description": "Referrer of the session",
30762
30779
  "oneOf": [
30763
30780
  {
30764
30781
  "type": "string",
30765
30782
  "nullable": true,
30766
30783
  "enum": [
30767
- null
30784
+ null,
30785
+ ""
30768
30786
  ]
30769
30787
  },
30770
30788
  {
30771
30789
  "$ref": "#/components/schemas/URL"
30772
30790
  }
30773
30791
  ]
30792
+ },
30793
+ "visitorAuthToken": {
30794
+ "type": "string",
30795
+ "nullable": true,
30796
+ "description": "Authentication token of the visitor.\nThis is used to identify the visitor with adaptive content.\n"
30774
30797
  }
30775
30798
  },
30776
30799
  "required": [
@@ -31021,6 +31044,99 @@
31021
31044
  }
31022
31045
  ]
31023
31046
  },
31047
+ "SiteInsightsEventLinkClick": {
31048
+ "allOf": [
31049
+ {
31050
+ "$ref": "#/components/schemas/SiteInsightsEventBase"
31051
+ },
31052
+ {
31053
+ "type": "object",
31054
+ "properties": {
31055
+ "type": {
31056
+ "type": "string",
31057
+ "enum": [
31058
+ "link_click"
31059
+ ]
31060
+ },
31061
+ "link": {
31062
+ "type": "object",
31063
+ "properties": {
31064
+ "target": {
31065
+ "$ref": "#/components/schemas/ContentRef"
31066
+ },
31067
+ "position": {
31068
+ "type": "string",
31069
+ "enum": [
31070
+ "header",
31071
+ "footer",
31072
+ "sidebar",
31073
+ "content"
31074
+ ]
31075
+ }
31076
+ },
31077
+ "required": [
31078
+ "target",
31079
+ "position"
31080
+ ]
31081
+ }
31082
+ },
31083
+ "required": [
31084
+ "type",
31085
+ "link"
31086
+ ]
31087
+ }
31088
+ ]
31089
+ },
31090
+ "SiteInsightsEventAPIClientOpen": {
31091
+ "allOf": [
31092
+ {
31093
+ "$ref": "#/components/schemas/SiteInsightsEventBase"
31094
+ },
31095
+ {
31096
+ "type": "object",
31097
+ "properties": {
31098
+ "type": {
31099
+ "type": "string",
31100
+ "enum": [
31101
+ "api_client_open"
31102
+ ]
31103
+ },
31104
+ "operation": {
31105
+ "$ref": "#/components/schemas/OpenAPIOperationPointer"
31106
+ }
31107
+ },
31108
+ "required": [
31109
+ "type",
31110
+ "operation"
31111
+ ]
31112
+ }
31113
+ ]
31114
+ },
31115
+ "SiteInsightsEventAPIClientRequest": {
31116
+ "allOf": [
31117
+ {
31118
+ "$ref": "#/components/schemas/SiteInsightsEventBase"
31119
+ },
31120
+ {
31121
+ "type": "object",
31122
+ "properties": {
31123
+ "type": {
31124
+ "type": "string",
31125
+ "enum": [
31126
+ "api_client_request"
31127
+ ]
31128
+ },
31129
+ "operation": {
31130
+ "$ref": "#/components/schemas/OpenAPIOperationPointer"
31131
+ }
31132
+ },
31133
+ "required": [
31134
+ "type",
31135
+ "operation"
31136
+ ]
31137
+ }
31138
+ ]
31139
+ },
31024
31140
  "SiteInsightsEvent": {
31025
31141
  "oneOf": [
31026
31142
  {
@@ -31040,6 +31156,15 @@
31040
31156
  },
31041
31157
  {
31042
31158
  "$ref": "#/components/schemas/SiteInsightsEventAskQuestion"
31159
+ },
31160
+ {
31161
+ "$ref": "#/components/schemas/SiteInsightsEventLinkClick"
31162
+ },
31163
+ {
31164
+ "$ref": "#/components/schemas/SiteInsightsEventAPIClientOpen"
31165
+ },
31166
+ {
31167
+ "$ref": "#/components/schemas/SiteInsightsEventAPIClientRequest"
31043
31168
  }
31044
31169
  ]
31045
31170
  },
@@ -32066,7 +32191,7 @@
32066
32191
  "$ref": "#/components/schemas/DocumentBlockTable"
32067
32192
  },
32068
32193
  {
32069
- "$ref": "#/components/schemas/DocumentBlockSwagger"
32194
+ "$ref": "#/components/schemas/DocumentBlockOpenAPI"
32070
32195
  },
32071
32196
  {
32072
32197
  "$ref": "#/components/schemas/DocumentBlockContentRef"
package/spec/openapi.yaml CHANGED
@@ -11022,7 +11022,20 @@ components:
11022
11022
  - object
11023
11023
  - type
11024
11024
  - nodes
11025
- DocumentBlockSwagger:
11025
+ OpenAPIOperationPointer:
11026
+ type: object
11027
+ description: Pointer to an operation in the OpenAPI spec.
11028
+ properties:
11029
+ path:
11030
+ type: string
11031
+ description: Path of the operation in the OpenAPI spec.
11032
+ method:
11033
+ type: string
11034
+ description: HTTP method of the operation in the OpenAPI spec.
11035
+ required:
11036
+ - path
11037
+ - method
11038
+ DocumentBlockOpenAPI:
11026
11039
  type: object
11027
11040
  properties:
11028
11041
  object:
@@ -11036,24 +11049,20 @@ components:
11036
11049
  key:
11037
11050
  type: string
11038
11051
  data:
11039
- type: object
11040
- properties:
11041
- ref:
11042
- oneOf:
11043
- - $ref: "#/components/schemas/ContentRefFile"
11044
- path:
11045
- type: string
11046
- description: Path of the operation in the OpenAPI spec.
11047
- method:
11048
- type: string
11049
- description: HTTP method of the operation in the OpenAPI spec.
11050
- expanded:
11051
- type: boolean
11052
- description: If true, the block is opened by default.
11053
- fullWidth:
11054
- type: boolean
11055
- required:
11056
- - ref
11052
+ allOf:
11053
+ - $ref: "#/components/schemas/OpenAPIOperationPointer"
11054
+ - type: object
11055
+ properties:
11056
+ ref:
11057
+ oneOf:
11058
+ - $ref: "#/components/schemas/ContentRefFile"
11059
+ expanded:
11060
+ type: boolean
11061
+ description: If true, the block is opened by default.
11062
+ fullWidth:
11063
+ type: boolean
11064
+ required:
11065
+ - ref
11057
11066
  isVoid:
11058
11067
  type: boolean
11059
11068
  enum:
@@ -11185,7 +11194,7 @@ components:
11185
11194
  - $ref: "#/components/schemas/DocumentBlockExpandable"
11186
11195
  - $ref: "#/components/schemas/DocumentBlockTabs"
11187
11196
  - $ref: "#/components/schemas/DocumentBlockTable"
11188
- - $ref: "#/components/schemas/DocumentBlockSwagger"
11197
+ - $ref: "#/components/schemas/DocumentBlockOpenAPI"
11189
11198
  - $ref: "#/components/schemas/DocumentBlockContentRef"
11190
11199
  - $ref: "#/components/schemas/DocumentBlockIntegration"
11191
11200
  - $ref: "#/components/schemas/DocumentBlockReusableContent"
@@ -18804,13 +18813,20 @@ components:
18804
18813
  Language of the visitor.
18805
18814
  https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
18806
18815
  referrer:
18807
- description: Referrer of the sesion
18816
+ description: Referrer of the session
18808
18817
  oneOf:
18809
18818
  - type: string
18810
18819
  nullable: true
18811
18820
  enum:
18812
18821
  - null
18822
+ - ""
18813
18823
  - $ref: "#/components/schemas/URL"
18824
+ visitorAuthToken:
18825
+ type: string
18826
+ nullable: true
18827
+ description: |
18828
+ Authentication token of the visitor.
18829
+ This is used to identify the visitor with adaptive content.
18814
18830
  required:
18815
18831
  - visitorId
18816
18832
  - sessionId
@@ -18969,6 +18985,61 @@ components:
18969
18985
  required:
18970
18986
  - type
18971
18987
  - query
18988
+ SiteInsightsEventLinkClick:
18989
+ allOf:
18990
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18991
+ - type: object
18992
+ properties:
18993
+ type:
18994
+ type: string
18995
+ enum:
18996
+ - link_click
18997
+ link:
18998
+ type: object
18999
+ properties:
19000
+ target:
19001
+ $ref: "#/components/schemas/ContentRef"
19002
+ position:
19003
+ type: string
19004
+ enum:
19005
+ - header
19006
+ - footer
19007
+ - sidebar
19008
+ - content
19009
+ required:
19010
+ - target
19011
+ - position
19012
+ required:
19013
+ - type
19014
+ - link
19015
+ SiteInsightsEventAPIClientOpen:
19016
+ allOf:
19017
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
19018
+ - type: object
19019
+ properties:
19020
+ type:
19021
+ type: string
19022
+ enum:
19023
+ - api_client_open
19024
+ operation:
19025
+ $ref: "#/components/schemas/OpenAPIOperationPointer"
19026
+ required:
19027
+ - type
19028
+ - operation
19029
+ SiteInsightsEventAPIClientRequest:
19030
+ allOf:
19031
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
19032
+ - type: object
19033
+ properties:
19034
+ type:
19035
+ type: string
19036
+ enum:
19037
+ - api_client_request
19038
+ operation:
19039
+ $ref: "#/components/schemas/OpenAPIOperationPointer"
19040
+ required:
19041
+ - type
19042
+ - operation
18972
19043
  SiteInsightsEvent:
18973
19044
  oneOf:
18974
19045
  - $ref: "#/components/schemas/SiteInsightsEventPageView"
@@ -18977,6 +19048,9 @@ components:
18977
19048
  - $ref: "#/components/schemas/SiteInsightsEventSearchOpenResult"
18978
19049
  - $ref: "#/components/schemas/SiteInsightsEventPagePostFeedback"
18979
19050
  - $ref: "#/components/schemas/SiteInsightsEventAskQuestion"
19051
+ - $ref: "#/components/schemas/SiteInsightsEventLinkClick"
19052
+ - $ref: "#/components/schemas/SiteInsightsEventAPIClientOpen"
19053
+ - $ref: "#/components/schemas/SiteInsightsEventAPIClientRequest"
18980
19054
  InsightsInterval:
18981
19055
  type: string
18982
19056
  description: The interval for grouping the results
@@ -19663,7 +19737,7 @@ components:
19663
19737
  - $ref: "#/components/schemas/DocumentBlockTabs"
19664
19738
  - $ref: "#/components/schemas/DocumentBlockTabsItem"
19665
19739
  - $ref: "#/components/schemas/DocumentBlockTable"
19666
- - $ref: "#/components/schemas/DocumentBlockSwagger"
19740
+ - $ref: "#/components/schemas/DocumentBlockOpenAPI"
19667
19741
  - $ref: "#/components/schemas/DocumentBlockContentRef"
19668
19742
  - $ref: "#/components/schemas/DocumentBlockIntegration"
19669
19743
  - $ref: "#/components/schemas/DocumentBlockReusableContent"