@gitbook/api 0.122.0 → 0.123.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 +33 -0
- package/dist/index.cjs +14 -1
- package/dist/index.js +13 -1
- package/package.json +1 -1
- package/spec/openapi.json +92 -0
- package/spec/openapi.yaml +60 -0
package/dist/client.d.ts
CHANGED
|
@@ -2360,6 +2360,8 @@ export interface RevisionSemanticChangeReusableContentEdited {
|
|
|
2360
2360
|
}
|
|
2361
2361
|
export type RevisionSemanticChange = RevisionSemanticChangePageCreated | RevisionSemanticChangePageEdited | RevisionSemanticChangePageDeleted | RevisionSemanticChangePageMoved | RevisionSemanticChangeFileCreated | RevisionSemanticChangeFileEdited | RevisionSemanticChangeFileDeleted | RevisionSemanticChangeVariablesEdited | RevisionSemanticChangeReusableContentCreated | RevisionSemanticChangeReusableContentDeleted | RevisionSemanticChangeReusableContentEdited;
|
|
2362
2362
|
export interface RevisionSemanticChanges {
|
|
2363
|
+
/** The change request object that initiated the changes in the case of a merge revision. */
|
|
2364
|
+
mergedFrom?: ChangeRequest;
|
|
2363
2365
|
changes: RevisionSemanticChange[];
|
|
2364
2366
|
/** How many changes were omitted because above the result limit */
|
|
2365
2367
|
more?: number;
|
|
@@ -4829,6 +4831,15 @@ export declare enum CustomizationThemeMode {
|
|
|
4829
4831
|
Light = "light",
|
|
4830
4832
|
Dark = "dark"
|
|
4831
4833
|
}
|
|
4834
|
+
/**
|
|
4835
|
+
* How external links should open when clicked.
|
|
4836
|
+
* - `self`: External links open in the current tab.
|
|
4837
|
+
* - `blank`: External links open in a new browser tab.
|
|
4838
|
+
*/
|
|
4839
|
+
export declare enum SiteExternalLinksTarget {
|
|
4840
|
+
Self = "self",
|
|
4841
|
+
Blank = "blank"
|
|
4842
|
+
}
|
|
4832
4843
|
export interface SiteCustomizationSettings {
|
|
4833
4844
|
/** Title to use for the published site. If not defined, it'll fallback to the default content title. */
|
|
4834
4845
|
title?: SiteTitle;
|
|
@@ -4947,6 +4958,14 @@ export interface SiteCustomizationSettings {
|
|
|
4947
4958
|
/** Whether the published site should show a link to edit the content on the git provider set up in the Git Sync */
|
|
4948
4959
|
showEditLink: boolean;
|
|
4949
4960
|
};
|
|
4961
|
+
externalLinks: {
|
|
4962
|
+
/**
|
|
4963
|
+
* How external links should open when clicked.
|
|
4964
|
+
* - `self`: External links open in the current tab.
|
|
4965
|
+
* - `blank`: External links open in a new browser tab.
|
|
4966
|
+
*/
|
|
4967
|
+
target: SiteExternalLinksTarget;
|
|
4968
|
+
};
|
|
4950
4969
|
pagination: {
|
|
4951
4970
|
/** Whether the pagination navigation should be displayed on pages. */
|
|
4952
4971
|
enabled: boolean;
|
|
@@ -12005,6 +12024,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12005
12024
|
/** Whether the published site should show a link to edit the content on the git provider set up in the Git Sync. Set to null to reset the override. */
|
|
12006
12025
|
showEditLink: boolean | null;
|
|
12007
12026
|
};
|
|
12027
|
+
externalLinks?: {
|
|
12028
|
+
/** How external links should open. Set to null to reset the override. */
|
|
12029
|
+
target: SiteExternalLinksTarget | null;
|
|
12030
|
+
};
|
|
12008
12031
|
pagination?: {
|
|
12009
12032
|
/** Whether the pagination navigation should be displayed on pages. Set to null to reset the override. */
|
|
12010
12033
|
enabled: boolean | null;
|
|
@@ -12163,6 +12186,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12163
12186
|
/** Tools provided to the AI */
|
|
12164
12187
|
tools?: AIToolCapabilities;
|
|
12165
12188
|
}, params?: RequestParams) => EventIterator<AIStreamResponse>;
|
|
12189
|
+
/**
|
|
12190
|
+
* @description Experimental operation to get an existing AI response in a site.
|
|
12191
|
+
*
|
|
12192
|
+
* @tags sites
|
|
12193
|
+
* @name StreamExistingAiResponseInSite
|
|
12194
|
+
* @summary Get an existing AI response in a site
|
|
12195
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/ai/response/{responseId}
|
|
12196
|
+
* @secure
|
|
12197
|
+
*/
|
|
12198
|
+
streamExistingAiResponseInSite: (organizationId: string, siteId: string, responseId: string, params?: RequestParams) => EventIterator<AIStreamResponse>;
|
|
12166
12199
|
/**
|
|
12167
12200
|
* No description
|
|
12168
12201
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -249,6 +249,7 @@ __export(src_exports, {
|
|
|
249
249
|
SiteAdsTopic: () => SiteAdsTopic,
|
|
250
250
|
SiteAgentsContext: () => SiteAgentsContext,
|
|
251
251
|
SiteCustomizationFeature: () => SiteCustomizationFeature,
|
|
252
|
+
SiteExternalLinksTarget: () => SiteExternalLinksTarget,
|
|
252
253
|
SiteFeatureKey: () => SiteFeatureKey,
|
|
253
254
|
SiteInsightsAdPlacement: () => SiteInsightsAdPlacement,
|
|
254
255
|
SiteInsightsEventType: () => SiteInsightsEventType,
|
|
@@ -272,7 +273,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
272
273
|
|
|
273
274
|
// package.json
|
|
274
275
|
var name = "@gitbook/api";
|
|
275
|
-
var version = "0.
|
|
276
|
+
var version = "0.123.0";
|
|
276
277
|
|
|
277
278
|
// src/client.ts
|
|
278
279
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -846,6 +847,11 @@ var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
|
|
|
846
847
|
CustomizationThemeMode2["Dark"] = "dark";
|
|
847
848
|
return CustomizationThemeMode2;
|
|
848
849
|
})(CustomizationThemeMode || {});
|
|
850
|
+
var SiteExternalLinksTarget = /* @__PURE__ */ ((SiteExternalLinksTarget2) => {
|
|
851
|
+
SiteExternalLinksTarget2["Self"] = "self";
|
|
852
|
+
SiteExternalLinksTarget2["Blank"] = "blank";
|
|
853
|
+
return SiteExternalLinksTarget2;
|
|
854
|
+
})(SiteExternalLinksTarget || {});
|
|
849
855
|
var AIMessageRole = /* @__PURE__ */ ((AIMessageRole2) => {
|
|
850
856
|
AIMessageRole2["User"] = "user";
|
|
851
857
|
AIMessageRole2["Assistant"] = "assistant";
|
|
@@ -3428,6 +3434,12 @@ var Api = class extends HttpClient {
|
|
|
3428
3434
|
type: "application/json" /* Json */,
|
|
3429
3435
|
...params
|
|
3430
3436
|
}),
|
|
3437
|
+
streamExistingAiResponseInSite: (organizationId, siteId, responseId, params = {}) => this.streamRequest({
|
|
3438
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ai/response/${responseId}`,
|
|
3439
|
+
method: "GET",
|
|
3440
|
+
secure: true,
|
|
3441
|
+
...params
|
|
3442
|
+
}),
|
|
3431
3443
|
trackEventsInSiteById: (organizationId, siteId, data, params = {}) => this.request({
|
|
3432
3444
|
path: `/orgs/${organizationId}/sites/${siteId}/insights/events`,
|
|
3433
3445
|
method: "POST",
|
|
@@ -3749,6 +3761,7 @@ var GitBookAPI = class extends Api {
|
|
|
3749
3761
|
SiteAdsTopic,
|
|
3750
3762
|
SiteAgentsContext,
|
|
3751
3763
|
SiteCustomizationFeature,
|
|
3764
|
+
SiteExternalLinksTarget,
|
|
3752
3765
|
SiteFeatureKey,
|
|
3753
3766
|
SiteInsightsAdPlacement,
|
|
3754
3767
|
SiteInsightsEventType,
|
package/dist/index.js
CHANGED
|
@@ -172,7 +172,7 @@ var require_node = __commonJS({
|
|
|
172
172
|
|
|
173
173
|
// package.json
|
|
174
174
|
var name = "@gitbook/api";
|
|
175
|
-
var version = "0.
|
|
175
|
+
var version = "0.123.0";
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
178
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -746,6 +746,11 @@ var CustomizationThemeMode = /* @__PURE__ */ ((CustomizationThemeMode2) => {
|
|
|
746
746
|
CustomizationThemeMode2["Dark"] = "dark";
|
|
747
747
|
return CustomizationThemeMode2;
|
|
748
748
|
})(CustomizationThemeMode || {});
|
|
749
|
+
var SiteExternalLinksTarget = /* @__PURE__ */ ((SiteExternalLinksTarget2) => {
|
|
750
|
+
SiteExternalLinksTarget2["Self"] = "self";
|
|
751
|
+
SiteExternalLinksTarget2["Blank"] = "blank";
|
|
752
|
+
return SiteExternalLinksTarget2;
|
|
753
|
+
})(SiteExternalLinksTarget || {});
|
|
749
754
|
var AIMessageRole = /* @__PURE__ */ ((AIMessageRole2) => {
|
|
750
755
|
AIMessageRole2["User"] = "user";
|
|
751
756
|
AIMessageRole2["Assistant"] = "assistant";
|
|
@@ -3328,6 +3333,12 @@ var Api = class extends HttpClient {
|
|
|
3328
3333
|
type: "application/json" /* Json */,
|
|
3329
3334
|
...params
|
|
3330
3335
|
}),
|
|
3336
|
+
streamExistingAiResponseInSite: (organizationId, siteId, responseId, params = {}) => this.streamRequest({
|
|
3337
|
+
path: `/orgs/${organizationId}/sites/${siteId}/ai/response/${responseId}`,
|
|
3338
|
+
method: "GET",
|
|
3339
|
+
secure: true,
|
|
3340
|
+
...params
|
|
3341
|
+
}),
|
|
3331
3342
|
trackEventsInSiteById: (organizationId, siteId, data, params = {}) => this.request({
|
|
3332
3343
|
path: `/orgs/${organizationId}/sites/${siteId}/insights/events`,
|
|
3333
3344
|
method: "POST",
|
|
@@ -3648,6 +3659,7 @@ export {
|
|
|
3648
3659
|
SiteAdsTopic,
|
|
3649
3660
|
SiteAgentsContext,
|
|
3650
3661
|
SiteCustomizationFeature,
|
|
3662
|
+
SiteExternalLinksTarget,
|
|
3651
3663
|
SiteFeatureKey,
|
|
3652
3664
|
SiteInsightsAdPlacement,
|
|
3653
3665
|
SiteInsightsEventType,
|
package/package.json
CHANGED
package/spec/openapi.json
CHANGED
|
@@ -14373,6 +14373,29 @@
|
|
|
14373
14373
|
"showEditLink"
|
|
14374
14374
|
]
|
|
14375
14375
|
},
|
|
14376
|
+
"externalLinks": {
|
|
14377
|
+
"type": "object",
|
|
14378
|
+
"properties": {
|
|
14379
|
+
"target": {
|
|
14380
|
+
"description": "How external links should open. Set to null to reset the override.",
|
|
14381
|
+
"oneOf": [
|
|
14382
|
+
{
|
|
14383
|
+
"$ref": "#/components/schemas/SiteExternalLinksTarget"
|
|
14384
|
+
},
|
|
14385
|
+
{
|
|
14386
|
+
"type": "string",
|
|
14387
|
+
"nullable": true,
|
|
14388
|
+
"enum": [
|
|
14389
|
+
null
|
|
14390
|
+
]
|
|
14391
|
+
}
|
|
14392
|
+
]
|
|
14393
|
+
}
|
|
14394
|
+
},
|
|
14395
|
+
"required": [
|
|
14396
|
+
"target"
|
|
14397
|
+
]
|
|
14398
|
+
},
|
|
14376
14399
|
"pagination": {
|
|
14377
14400
|
"type": "object",
|
|
14378
14401
|
"properties": {
|
|
@@ -14808,6 +14831,51 @@
|
|
|
14808
14831
|
}
|
|
14809
14832
|
}
|
|
14810
14833
|
},
|
|
14834
|
+
"/orgs/{organizationId}/sites/{siteId}/ai/response/{responseId}": {
|
|
14835
|
+
"get": {
|
|
14836
|
+
"operationId": "streamExistingAIResponseInSite",
|
|
14837
|
+
"summary": "Get an existing AI response in a site",
|
|
14838
|
+
"description": "Experimental operation to get an existing AI response in a site.\n",
|
|
14839
|
+
"tags": [
|
|
14840
|
+
"sites"
|
|
14841
|
+
],
|
|
14842
|
+
"x-internal": true,
|
|
14843
|
+
"security": [
|
|
14844
|
+
{
|
|
14845
|
+
"user": []
|
|
14846
|
+
}
|
|
14847
|
+
],
|
|
14848
|
+
"parameters": [
|
|
14849
|
+
{
|
|
14850
|
+
"$ref": "#/components/parameters/organizationId"
|
|
14851
|
+
},
|
|
14852
|
+
{
|
|
14853
|
+
"$ref": "#/components/parameters/siteId"
|
|
14854
|
+
},
|
|
14855
|
+
{
|
|
14856
|
+
"name": "responseId",
|
|
14857
|
+
"in": "path",
|
|
14858
|
+
"required": true,
|
|
14859
|
+
"description": "The unique id of the AI response",
|
|
14860
|
+
"schema": {
|
|
14861
|
+
"type": "string"
|
|
14862
|
+
}
|
|
14863
|
+
}
|
|
14864
|
+
],
|
|
14865
|
+
"responses": {
|
|
14866
|
+
"200": {
|
|
14867
|
+
"description": "OK",
|
|
14868
|
+
"content": {
|
|
14869
|
+
"text/event-stream": {
|
|
14870
|
+
"schema": {
|
|
14871
|
+
"$ref": "#/components/schemas/AIStreamResponse"
|
|
14872
|
+
}
|
|
14873
|
+
}
|
|
14874
|
+
}
|
|
14875
|
+
}
|
|
14876
|
+
}
|
|
14877
|
+
}
|
|
14878
|
+
},
|
|
14811
14879
|
"/orgs/{organizationId}/sites/{siteId}/insights/events": {
|
|
14812
14880
|
"post": {
|
|
14813
14881
|
"operationId": "trackEventsInSiteById",
|
|
@@ -24903,6 +24971,10 @@
|
|
|
24903
24971
|
"RevisionSemanticChanges": {
|
|
24904
24972
|
"type": "object",
|
|
24905
24973
|
"properties": {
|
|
24974
|
+
"mergedFrom": {
|
|
24975
|
+
"description": "The change request object that initiated the changes in the case of a merge revision.",
|
|
24976
|
+
"$ref": "#/components/schemas/ChangeRequest"
|
|
24977
|
+
},
|
|
24906
24978
|
"changes": {
|
|
24907
24979
|
"type": "array",
|
|
24908
24980
|
"items": {
|
|
@@ -31914,6 +31986,14 @@
|
|
|
31914
31986
|
"dark"
|
|
31915
31987
|
]
|
|
31916
31988
|
},
|
|
31989
|
+
"SiteExternalLinksTarget": {
|
|
31990
|
+
"type": "string",
|
|
31991
|
+
"description": "How external links should open when clicked.\n- `self`: External links open in the current tab.\n- `blank`: External links open in a new browser tab.\n",
|
|
31992
|
+
"enum": [
|
|
31993
|
+
"self",
|
|
31994
|
+
"blank"
|
|
31995
|
+
]
|
|
31996
|
+
},
|
|
31917
31997
|
"SiteCustomizationSettings": {
|
|
31918
31998
|
"type": "object",
|
|
31919
31999
|
"properties": {
|
|
@@ -32166,6 +32246,17 @@
|
|
|
32166
32246
|
"showEditLink"
|
|
32167
32247
|
]
|
|
32168
32248
|
},
|
|
32249
|
+
"externalLinks": {
|
|
32250
|
+
"type": "object",
|
|
32251
|
+
"properties": {
|
|
32252
|
+
"target": {
|
|
32253
|
+
"$ref": "#/components/schemas/SiteExternalLinksTarget"
|
|
32254
|
+
}
|
|
32255
|
+
},
|
|
32256
|
+
"required": [
|
|
32257
|
+
"target"
|
|
32258
|
+
]
|
|
32259
|
+
},
|
|
32169
32260
|
"pagination": {
|
|
32170
32261
|
"type": "object",
|
|
32171
32262
|
"properties": {
|
|
@@ -32232,6 +32323,7 @@
|
|
|
32232
32323
|
"aiSearch",
|
|
32233
32324
|
"advancedCustomization",
|
|
32234
32325
|
"trademark",
|
|
32326
|
+
"externalLinks",
|
|
32235
32327
|
"pagination",
|
|
32236
32328
|
"git",
|
|
32237
32329
|
"privacyPolicy",
|
package/spec/openapi.yaml
CHANGED
|
@@ -8108,6 +8108,19 @@ paths:
|
|
|
8108
8108
|
nullable: true
|
|
8109
8109
|
required:
|
|
8110
8110
|
- showEditLink
|
|
8111
|
+
externalLinks:
|
|
8112
|
+
type: object
|
|
8113
|
+
properties:
|
|
8114
|
+
target:
|
|
8115
|
+
description: How external links should open. Set to null to reset the override.
|
|
8116
|
+
oneOf:
|
|
8117
|
+
- $ref: "#/components/schemas/SiteExternalLinksTarget"
|
|
8118
|
+
- type: string
|
|
8119
|
+
nullable: true
|
|
8120
|
+
enum:
|
|
8121
|
+
- null
|
|
8122
|
+
required:
|
|
8123
|
+
- target
|
|
8111
8124
|
pagination:
|
|
8112
8125
|
type: object
|
|
8113
8126
|
properties:
|
|
@@ -8354,6 +8367,33 @@ paths:
|
|
|
8354
8367
|
text/event-stream:
|
|
8355
8368
|
schema:
|
|
8356
8369
|
$ref: "#/components/schemas/AIStreamResponse"
|
|
8370
|
+
"/orgs/{organizationId}/sites/{siteId}/ai/response/{responseId}":
|
|
8371
|
+
get:
|
|
8372
|
+
operationId: streamExistingAIResponseInSite
|
|
8373
|
+
summary: Get an existing AI response in a site
|
|
8374
|
+
description: |
|
|
8375
|
+
Experimental operation to get an existing AI response in a site.
|
|
8376
|
+
tags:
|
|
8377
|
+
- sites
|
|
8378
|
+
x-internal: true
|
|
8379
|
+
security:
|
|
8380
|
+
- user: []
|
|
8381
|
+
parameters:
|
|
8382
|
+
- $ref: "#/components/parameters/organizationId"
|
|
8383
|
+
- $ref: "#/components/parameters/siteId"
|
|
8384
|
+
- name: responseId
|
|
8385
|
+
in: path
|
|
8386
|
+
required: true
|
|
8387
|
+
description: The unique id of the AI response
|
|
8388
|
+
schema:
|
|
8389
|
+
type: string
|
|
8390
|
+
responses:
|
|
8391
|
+
"200":
|
|
8392
|
+
description: OK
|
|
8393
|
+
content:
|
|
8394
|
+
text/event-stream:
|
|
8395
|
+
schema:
|
|
8396
|
+
$ref: "#/components/schemas/AIStreamResponse"
|
|
8357
8397
|
"/orgs/{organizationId}/sites/{siteId}/insights/events":
|
|
8358
8398
|
post:
|
|
8359
8399
|
operationId: trackEventsInSiteById
|
|
@@ -14909,6 +14949,9 @@ components:
|
|
|
14909
14949
|
RevisionSemanticChanges:
|
|
14910
14950
|
type: object
|
|
14911
14951
|
properties:
|
|
14952
|
+
mergedFrom:
|
|
14953
|
+
description: The change request object that initiated the changes in the case of a merge revision.
|
|
14954
|
+
$ref: "#/components/schemas/ChangeRequest"
|
|
14912
14955
|
changes:
|
|
14913
14956
|
type: array
|
|
14914
14957
|
items:
|
|
@@ -19658,6 +19701,15 @@ components:
|
|
|
19658
19701
|
enum:
|
|
19659
19702
|
- light
|
|
19660
19703
|
- dark
|
|
19704
|
+
SiteExternalLinksTarget:
|
|
19705
|
+
type: string
|
|
19706
|
+
description: |
|
|
19707
|
+
How external links should open when clicked.
|
|
19708
|
+
- `self`: External links open in the current tab.
|
|
19709
|
+
- `blank`: External links open in a new browser tab.
|
|
19710
|
+
enum:
|
|
19711
|
+
- self
|
|
19712
|
+
- blank
|
|
19661
19713
|
SiteCustomizationSettings:
|
|
19662
19714
|
type: object
|
|
19663
19715
|
properties:
|
|
@@ -19834,6 +19886,13 @@ components:
|
|
|
19834
19886
|
description: Whether the published site should show a link to edit the content on the git provider set up in the Git Sync
|
|
19835
19887
|
required:
|
|
19836
19888
|
- showEditLink
|
|
19889
|
+
externalLinks:
|
|
19890
|
+
type: object
|
|
19891
|
+
properties:
|
|
19892
|
+
target:
|
|
19893
|
+
$ref: "#/components/schemas/SiteExternalLinksTarget"
|
|
19894
|
+
required:
|
|
19895
|
+
- target
|
|
19837
19896
|
pagination:
|
|
19838
19897
|
type: object
|
|
19839
19898
|
properties:
|
|
@@ -19881,6 +19940,7 @@ components:
|
|
|
19881
19940
|
- aiSearch
|
|
19882
19941
|
- advancedCustomization
|
|
19883
19942
|
- trademark
|
|
19943
|
+
- externalLinks
|
|
19884
19944
|
- pagination
|
|
19885
19945
|
- git
|
|
19886
19946
|
- privacyPolicy
|