@gitbook/api 0.39.0 → 0.40.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 +24 -12
- package/dist/index.cjs +1 -8
- package/dist/index.js +1 -8
- package/package.json +1 -1
- package/spec/openapi.json +83 -30
- package/spec/openapi.yaml +55 -18
package/dist/client.d.ts
CHANGED
|
@@ -503,6 +503,28 @@ export declare type PublishedContentLookup = {
|
|
|
503
503
|
/** Short-lived API token to fetch content related to the space in the context of the URL. */
|
|
504
504
|
apiToken: string;
|
|
505
505
|
};
|
|
506
|
+
export declare type PublishedSiteContentLookup = {
|
|
507
|
+
/** Type of target for the redirect */
|
|
508
|
+
target: 'application' | 'content' | 'external';
|
|
509
|
+
redirect: URL;
|
|
510
|
+
} | {
|
|
511
|
+
/** ID of the site matching. */
|
|
512
|
+
site: string;
|
|
513
|
+
/** ID of the site-space matching. */
|
|
514
|
+
siteSpace: string;
|
|
515
|
+
/** ID of the space matching. */
|
|
516
|
+
space: string;
|
|
517
|
+
/** Identifier of the change request being previewed in this URL. */
|
|
518
|
+
changeRequest?: string;
|
|
519
|
+
/** Identifier of the revision being previewed in this URL. */
|
|
520
|
+
revision?: string;
|
|
521
|
+
/** Path of the content relative to the space */
|
|
522
|
+
pathname: string;
|
|
523
|
+
/** Prefix of the path in the URL dedicated to the space */
|
|
524
|
+
basePath: string;
|
|
525
|
+
/** Short-lived API token to fetch content related to the space in the context of the URL. */
|
|
526
|
+
apiToken: string;
|
|
527
|
+
};
|
|
506
528
|
export interface SpacePointer {
|
|
507
529
|
type: 'space';
|
|
508
530
|
/** Unique identifier for the space */
|
|
@@ -1726,7 +1748,7 @@ export interface OrganizationTeamMember {
|
|
|
1726
1748
|
team: TeamMember;
|
|
1727
1749
|
}
|
|
1728
1750
|
/** The default content for the organization */
|
|
1729
|
-
export declare type OrganizationDefaultContent = SpacePointer | CollectionPointer;
|
|
1751
|
+
export declare type OrganizationDefaultContent = SpacePointer | CollectionPointer | SitePointer;
|
|
1730
1752
|
export declare type OrganizationInvite = {
|
|
1731
1753
|
/** Type of Object, always equals to "invite" */
|
|
1732
1754
|
object: 'invite';
|
|
@@ -4811,16 +4833,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
4811
4833
|
* @secure
|
|
4812
4834
|
*/
|
|
4813
4835
|
deleteSpaceById: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
|
|
4814
|
-
/**
|
|
4815
|
-
* No description
|
|
4816
|
-
*
|
|
4817
|
-
* @tags hive
|
|
4818
|
-
* @name GenerateSpaceHiveReadAccessToken
|
|
4819
|
-
* @summary Returns a token to authenticate with Hive to read content from a given space.
|
|
4820
|
-
* @request POST:/spaces/{spaceId}/hive/token
|
|
4821
|
-
* @secure
|
|
4822
|
-
*/
|
|
4823
|
-
generateSpaceHiveReadAccessToken: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<HiveAccessToken, Error>>;
|
|
4824
4836
|
/**
|
|
4825
4837
|
* No description
|
|
4826
4838
|
*
|
|
@@ -9005,7 +9017,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
9005
9017
|
url: URL;
|
|
9006
9018
|
/** JWT token generated for a visitor auth session */
|
|
9007
9019
|
visitorAuthToken?: string;
|
|
9008
|
-
}, params?: RequestParams) => Promise<HttpResponse<PublishedContentLookup, Error | {
|
|
9020
|
+
}, params?: RequestParams) => Promise<HttpResponse<PublishedContentLookup | PublishedSiteContentLookup, Error | {
|
|
9009
9021
|
error: {
|
|
9010
9022
|
/** @format int32 */
|
|
9011
9023
|
code: 404;
|
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.
|
|
242
|
+
var version = "0.40.0";
|
|
243
243
|
|
|
244
244
|
// src/client.ts
|
|
245
245
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -1027,13 +1027,6 @@ var Api = class extends HttpClient {
|
|
|
1027
1027
|
secure: true,
|
|
1028
1028
|
...params
|
|
1029
1029
|
}),
|
|
1030
|
-
generateSpaceHiveReadAccessToken: (spaceId, params = {}) => this.request({
|
|
1031
|
-
path: `/spaces/${spaceId}/hive/token`,
|
|
1032
|
-
method: "POST",
|
|
1033
|
-
secure: true,
|
|
1034
|
-
format: "json",
|
|
1035
|
-
...params
|
|
1036
|
-
}),
|
|
1037
1030
|
duplicateSpace: (spaceId, params = {}) => this.request({
|
|
1038
1031
|
path: `/spaces/${spaceId}/duplicate`,
|
|
1039
1032
|
method: "POST",
|
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.40.0";
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
178
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -960,13 +960,6 @@ var Api = class extends HttpClient {
|
|
|
960
960
|
secure: true,
|
|
961
961
|
...params
|
|
962
962
|
}),
|
|
963
|
-
generateSpaceHiveReadAccessToken: (spaceId, params = {}) => this.request({
|
|
964
|
-
path: `/spaces/${spaceId}/hive/token`,
|
|
965
|
-
method: "POST",
|
|
966
|
-
secure: true,
|
|
967
|
-
format: "json",
|
|
968
|
-
...params
|
|
969
|
-
}),
|
|
970
963
|
duplicateSpace: (spaceId, params = {}) => this.request({
|
|
971
964
|
path: `/spaces/${spaceId}/duplicate`,
|
|
972
965
|
method: "POST",
|
package/package.json
CHANGED
package/spec/openapi.json
CHANGED
|
@@ -1705,6 +1705,78 @@
|
|
|
1705
1705
|
}
|
|
1706
1706
|
]
|
|
1707
1707
|
},
|
|
1708
|
+
"PublishedSiteContentLookup": {
|
|
1709
|
+
"oneOf": [
|
|
1710
|
+
{
|
|
1711
|
+
"type": "object",
|
|
1712
|
+
"title": "Redirect",
|
|
1713
|
+
"properties": {
|
|
1714
|
+
"target": {
|
|
1715
|
+
"type": "string",
|
|
1716
|
+
"description": "Type of target for the redirect",
|
|
1717
|
+
"enum": [
|
|
1718
|
+
"application",
|
|
1719
|
+
"content",
|
|
1720
|
+
"external"
|
|
1721
|
+
]
|
|
1722
|
+
},
|
|
1723
|
+
"redirect": {
|
|
1724
|
+
"$ref": "#/components/schemas/URL"
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
"required": [
|
|
1728
|
+
"target",
|
|
1729
|
+
"redirect"
|
|
1730
|
+
]
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
"type": "object",
|
|
1734
|
+
"title": "Content",
|
|
1735
|
+
"properties": {
|
|
1736
|
+
"site": {
|
|
1737
|
+
"type": "string",
|
|
1738
|
+
"description": "ID of the site matching."
|
|
1739
|
+
},
|
|
1740
|
+
"siteSpace": {
|
|
1741
|
+
"type": "string",
|
|
1742
|
+
"description": "ID of the site-space matching."
|
|
1743
|
+
},
|
|
1744
|
+
"space": {
|
|
1745
|
+
"type": "string",
|
|
1746
|
+
"description": "ID of the space matching."
|
|
1747
|
+
},
|
|
1748
|
+
"changeRequest": {
|
|
1749
|
+
"type": "string",
|
|
1750
|
+
"description": "Identifier of the change request being previewed in this URL."
|
|
1751
|
+
},
|
|
1752
|
+
"revision": {
|
|
1753
|
+
"type": "string",
|
|
1754
|
+
"description": "Identifier of the revision being previewed in this URL."
|
|
1755
|
+
},
|
|
1756
|
+
"pathname": {
|
|
1757
|
+
"type": "string",
|
|
1758
|
+
"description": "Path of the content relative to the space"
|
|
1759
|
+
},
|
|
1760
|
+
"basePath": {
|
|
1761
|
+
"type": "string",
|
|
1762
|
+
"description": "Prefix of the path in the URL dedicated to the space"
|
|
1763
|
+
},
|
|
1764
|
+
"apiToken": {
|
|
1765
|
+
"type": "string",
|
|
1766
|
+
"description": "Short-lived API token to fetch content related to the space in the context of the URL."
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
"required": [
|
|
1770
|
+
"site",
|
|
1771
|
+
"siteSpace",
|
|
1772
|
+
"space",
|
|
1773
|
+
"pathname",
|
|
1774
|
+
"basePath",
|
|
1775
|
+
"apiToken"
|
|
1776
|
+
]
|
|
1777
|
+
}
|
|
1778
|
+
]
|
|
1779
|
+
},
|
|
1708
1780
|
"SpacePointer": {
|
|
1709
1781
|
"type": "object",
|
|
1710
1782
|
"properties": {
|
|
@@ -6576,6 +6648,9 @@
|
|
|
6576
6648
|
},
|
|
6577
6649
|
{
|
|
6578
6650
|
"$ref": "#/components/schemas/CollectionPointer"
|
|
6651
|
+
},
|
|
6652
|
+
{
|
|
6653
|
+
"$ref": "#/components/schemas/SitePointer"
|
|
6579
6654
|
}
|
|
6580
6655
|
]
|
|
6581
6656
|
},
|
|
@@ -16306,35 +16381,6 @@
|
|
|
16306
16381
|
}
|
|
16307
16382
|
}
|
|
16308
16383
|
},
|
|
16309
|
-
"/spaces/{spaceId}/hive/token": {
|
|
16310
|
-
"post": {
|
|
16311
|
-
"operationId": "generateSpaceHiveReadAccessToken",
|
|
16312
|
-
"summary": "Returns a token to authenticate with Hive to read content from a given space.",
|
|
16313
|
-
"tags": [
|
|
16314
|
-
"hive"
|
|
16315
|
-
],
|
|
16316
|
-
"parameters": [
|
|
16317
|
-
{
|
|
16318
|
-
"$ref": "#/components/parameters/spaceId"
|
|
16319
|
-
}
|
|
16320
|
-
],
|
|
16321
|
-
"responses": {
|
|
16322
|
-
"200": {
|
|
16323
|
-
"description": "The JWT to access the space content in Hive.",
|
|
16324
|
-
"content": {
|
|
16325
|
-
"application/json": {
|
|
16326
|
-
"schema": {
|
|
16327
|
-
"$ref": "#/components/schemas/HiveAccessToken"
|
|
16328
|
-
}
|
|
16329
|
-
}
|
|
16330
|
-
}
|
|
16331
|
-
},
|
|
16332
|
-
"default": {
|
|
16333
|
-
"$ref": "#/components/responses/UnexpectedError"
|
|
16334
|
-
}
|
|
16335
|
-
}
|
|
16336
|
-
}
|
|
16337
|
-
},
|
|
16338
16384
|
"/spaces/{spaceId}/duplicate": {
|
|
16339
16385
|
"post": {
|
|
16340
16386
|
"operationId": "duplicateSpace",
|
|
@@ -29194,7 +29240,14 @@
|
|
|
29194
29240
|
"content": {
|
|
29195
29241
|
"application/json": {
|
|
29196
29242
|
"schema": {
|
|
29197
|
-
"
|
|
29243
|
+
"oneOf": [
|
|
29244
|
+
{
|
|
29245
|
+
"$ref": "#/components/schemas/PublishedContentLookup"
|
|
29246
|
+
},
|
|
29247
|
+
{
|
|
29248
|
+
"$ref": "#/components/schemas/PublishedSiteContentLookup"
|
|
29249
|
+
}
|
|
29250
|
+
]
|
|
29198
29251
|
}
|
|
29199
29252
|
}
|
|
29200
29253
|
}
|
package/spec/openapi.yaml
CHANGED
|
@@ -1221,6 +1221,57 @@ components:
|
|
|
1221
1221
|
- pathname
|
|
1222
1222
|
- basePath
|
|
1223
1223
|
- apiToken
|
|
1224
|
+
PublishedSiteContentLookup:
|
|
1225
|
+
oneOf:
|
|
1226
|
+
- type: object
|
|
1227
|
+
title: Redirect
|
|
1228
|
+
properties:
|
|
1229
|
+
target:
|
|
1230
|
+
type: string
|
|
1231
|
+
description: Type of target for the redirect
|
|
1232
|
+
enum:
|
|
1233
|
+
- application
|
|
1234
|
+
- content
|
|
1235
|
+
- external
|
|
1236
|
+
redirect:
|
|
1237
|
+
$ref: "#/components/schemas/URL"
|
|
1238
|
+
required:
|
|
1239
|
+
- target
|
|
1240
|
+
- redirect
|
|
1241
|
+
- type: object
|
|
1242
|
+
title: Content
|
|
1243
|
+
properties:
|
|
1244
|
+
site:
|
|
1245
|
+
type: string
|
|
1246
|
+
description: ID of the site matching.
|
|
1247
|
+
siteSpace:
|
|
1248
|
+
type: string
|
|
1249
|
+
description: ID of the site-space matching.
|
|
1250
|
+
space:
|
|
1251
|
+
type: string
|
|
1252
|
+
description: ID of the space matching.
|
|
1253
|
+
changeRequest:
|
|
1254
|
+
type: string
|
|
1255
|
+
description: Identifier of the change request being previewed in this URL.
|
|
1256
|
+
revision:
|
|
1257
|
+
type: string
|
|
1258
|
+
description: Identifier of the revision being previewed in this URL.
|
|
1259
|
+
pathname:
|
|
1260
|
+
type: string
|
|
1261
|
+
description: Path of the content relative to the space
|
|
1262
|
+
basePath:
|
|
1263
|
+
type: string
|
|
1264
|
+
description: Prefix of the path in the URL dedicated to the space
|
|
1265
|
+
apiToken:
|
|
1266
|
+
type: string
|
|
1267
|
+
description: Short-lived API token to fetch content related to the space in the context of the URL.
|
|
1268
|
+
required:
|
|
1269
|
+
- site
|
|
1270
|
+
- siteSpace
|
|
1271
|
+
- space
|
|
1272
|
+
- pathname
|
|
1273
|
+
- basePath
|
|
1274
|
+
- apiToken
|
|
1224
1275
|
SpacePointer:
|
|
1225
1276
|
type: object
|
|
1226
1277
|
properties:
|
|
@@ -4344,6 +4395,7 @@ components:
|
|
|
4344
4395
|
oneOf:
|
|
4345
4396
|
- $ref: "#/components/schemas/SpacePointer"
|
|
4346
4397
|
- $ref: "#/components/schemas/CollectionPointer"
|
|
4398
|
+
- $ref: "#/components/schemas/SitePointer"
|
|
4347
4399
|
OrganizationInvite:
|
|
4348
4400
|
allOf:
|
|
4349
4401
|
- type: object
|
|
@@ -10718,23 +10770,6 @@ paths:
|
|
|
10718
10770
|
description: Space has been deleted
|
|
10719
10771
|
default:
|
|
10720
10772
|
$ref: "#/components/responses/UnexpectedError"
|
|
10721
|
-
"/spaces/{spaceId}/hive/token":
|
|
10722
|
-
post:
|
|
10723
|
-
operationId: generateSpaceHiveReadAccessToken
|
|
10724
|
-
summary: Returns a token to authenticate with Hive to read content from a given space.
|
|
10725
|
-
tags:
|
|
10726
|
-
- hive
|
|
10727
|
-
parameters:
|
|
10728
|
-
- $ref: "#/components/parameters/spaceId"
|
|
10729
|
-
responses:
|
|
10730
|
-
"200":
|
|
10731
|
-
description: The JWT to access the space content in Hive.
|
|
10732
|
-
content:
|
|
10733
|
-
application/json:
|
|
10734
|
-
schema:
|
|
10735
|
-
$ref: "#/components/schemas/HiveAccessToken"
|
|
10736
|
-
default:
|
|
10737
|
-
$ref: "#/components/responses/UnexpectedError"
|
|
10738
10773
|
"/spaces/{spaceId}/duplicate":
|
|
10739
10774
|
post:
|
|
10740
10775
|
operationId: duplicateSpace
|
|
@@ -17922,7 +17957,9 @@ paths:
|
|
|
17922
17957
|
content:
|
|
17923
17958
|
application/json:
|
|
17924
17959
|
schema:
|
|
17925
|
-
|
|
17960
|
+
oneOf:
|
|
17961
|
+
- $ref: "#/components/schemas/PublishedContentLookup"
|
|
17962
|
+
- $ref: "#/components/schemas/PublishedSiteContentLookup"
|
|
17926
17963
|
"404":
|
|
17927
17964
|
description: No content found for the URL.
|
|
17928
17965
|
$ref: "#/components/responses/NotFoundError"
|