@gitbook/api 0.70.0 → 0.71.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
@@ -1323,6 +1323,12 @@ export interface RevisionFile {
1323
1323
  };
1324
1324
  git?: GitSyncBlob;
1325
1325
  }
1326
+ export interface RevisionReusableContent {
1327
+ id: string;
1328
+ title: string;
1329
+ document?: string;
1330
+ git?: GitSyncBlob;
1331
+ }
1326
1332
  export interface GitSyncCommit {
1327
1333
  /** SHA for the commit */
1328
1334
  oid: string;
@@ -1344,6 +1350,7 @@ export interface RevisionBase {
1344
1350
  parents: string[];
1345
1351
  pages: RevisionPage[];
1346
1352
  files: RevisionFile[];
1353
+ reusableContents: RevisionReusableContent[];
1347
1354
  /** When the revision was created. */
1348
1355
  createdAt: Timestamp;
1349
1356
  /** Metadata about a potential associated git commit. */
@@ -5818,6 +5825,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5818
5825
  */
5819
5826
  computed?: boolean;
5820
5827
  }, params?: RequestParams) => Promise<HttpResponse<RevisionPageDocument | RevisionPageGroup, Error>>;
5828
+ /**
5829
+ * No description
5830
+ *
5831
+ * @name GetReusableContentById
5832
+ * @summary Get a reusable content by its ID in the main revision of a space
5833
+ * @request GET:/spaces/{spaceId}/content/reusable-contents/{reusableContentId}
5834
+ * @secure
5835
+ */
5836
+ getReusableContentById: (spaceId: string, reusableContentId: string, query?: {
5837
+ /**
5838
+ * If `false` is passed, "git" mutable metadata will not returned. Passing `false` can optimize performances of the lookup.
5839
+ * @default true
5840
+ */
5841
+ metadata?: boolean;
5842
+ /**
5843
+ * If `false` is passed, content will not be computed
5844
+ * @default true
5845
+ */
5846
+ computed?: boolean;
5847
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionReusableContent, Error>>;
5821
5848
  /**
5822
5849
  * No description
5823
5850
  *
@@ -6457,6 +6484,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6457
6484
  */
6458
6485
  computed?: boolean;
6459
6486
  }, params?: RequestParams) => Promise<HttpResponse<RevisionPageDocument | RevisionPageGroup, Error>>;
6487
+ /**
6488
+ * No description
6489
+ *
6490
+ * @name GetReusableContentInChangeRequestById
6491
+ * @summary Get a reusable content by its ID in the content of a change request
6492
+ * @request GET:/spaces/{spaceId}/change-requests/{changeRequestId}/content/reusable-contents/{reusableContentId}
6493
+ * @secure
6494
+ */
6495
+ getReusableContentInChangeRequestById: (spaceId: string, changeRequestId: string, reusableContentId: string, query?: {
6496
+ /**
6497
+ * If `false` is passed, "git" mutable metadata will not returned. Passing `false` can optimize performances of the lookup.
6498
+ * @default true
6499
+ */
6500
+ metadata?: boolean;
6501
+ /**
6502
+ * If `false` is passed, content will not be computed
6503
+ * @default true
6504
+ */
6505
+ computed?: boolean;
6506
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionReusableContent, Error>>;
6460
6507
  /**
6461
6508
  * No description
6462
6509
  *
@@ -6672,6 +6719,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6672
6719
  */
6673
6720
  computed?: boolean;
6674
6721
  }, params?: RequestParams) => Promise<HttpResponse<RevisionPageDocument | RevisionPageGroup, Error>>;
6722
+ /**
6723
+ * No description
6724
+ *
6725
+ * @name GetReusableContentInRevisionById
6726
+ * @summary Get reusbale content in a revision by its ID
6727
+ * @request GET:/spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}
6728
+ * @secure
6729
+ */
6730
+ getReusableContentInRevisionById: (spaceId: string, revisionId: string, reusableContentId: string, query?: {
6731
+ /**
6732
+ * If `false` is passed, "git" mutable metadata will not returned. Passing `false` can optimize performances of the lookup.
6733
+ * @default true
6734
+ */
6735
+ metadata?: boolean;
6736
+ /**
6737
+ * If `false` is passed, content will not be computed
6738
+ * @default true
6739
+ */
6740
+ computed?: boolean;
6741
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionReusableContent, Error>>;
6675
6742
  /**
6676
6743
  * No description
6677
6744
  *
package/dist/index.cjs CHANGED
@@ -242,7 +242,7 @@ module.exports = __toCommonJS(src_exports);
242
242
 
243
243
  // package.json
244
244
  var name = "@gitbook/api";
245
- var version = "0.70.0";
245
+ var version = "0.71.0";
246
246
 
247
247
  // src/client.ts
248
248
  var import_event_iterator = __toESM(require_node(), 1);
@@ -1315,6 +1315,14 @@ var Api = class extends HttpClient {
1315
1315
  format: "json",
1316
1316
  ...params
1317
1317
  }),
1318
+ getReusableContentById: (spaceId, reusableContentId, query, params = {}) => this.request({
1319
+ path: `/spaces/${spaceId}/content/reusable-contents/${reusableContentId}`,
1320
+ method: "GET",
1321
+ query,
1322
+ secure: true,
1323
+ format: "json",
1324
+ ...params
1325
+ }),
1318
1326
  getComputedDocument: (spaceId, query, params = {}) => this.request({
1319
1327
  path: `/spaces/${spaceId}/content/computed/document`,
1320
1328
  method: "GET",
@@ -1606,6 +1614,14 @@ var Api = class extends HttpClient {
1606
1614
  format: "json",
1607
1615
  ...params
1608
1616
  }),
1617
+ getReusableContentInChangeRequestById: (spaceId, changeRequestId, reusableContentId, query, params = {}) => this.request({
1618
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/reusable-contents/${reusableContentId}`,
1619
+ method: "GET",
1620
+ query,
1621
+ secure: true,
1622
+ format: "json",
1623
+ ...params
1624
+ }),
1609
1625
  touchContentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1610
1626
  path: `/spaces/${spaceId}/change-requests/${changeRequestId}/touched-content`,
1611
1627
  method: "POST",
@@ -1686,6 +1702,14 @@ var Api = class extends HttpClient {
1686
1702
  format: "json",
1687
1703
  ...params
1688
1704
  }),
1705
+ getReusableContentInRevisionById: (spaceId, revisionId, reusableContentId, query, params = {}) => this.request({
1706
+ path: `/spaces/${spaceId}/revisions/${revisionId}/reusable-contents/${reusableContentId}`,
1707
+ method: "GET",
1708
+ query,
1709
+ secure: true,
1710
+ format: "json",
1711
+ ...params
1712
+ }),
1689
1713
  listCommentsInSpace: (spaceId, query, params = {}) => this.request({
1690
1714
  path: `/spaces/${spaceId}/comments`,
1691
1715
  method: "GET",
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.70.0";
175
+ var version = "0.71.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -1245,6 +1245,14 @@ var Api = class extends HttpClient {
1245
1245
  format: "json",
1246
1246
  ...params
1247
1247
  }),
1248
+ getReusableContentById: (spaceId, reusableContentId, query, params = {}) => this.request({
1249
+ path: `/spaces/${spaceId}/content/reusable-contents/${reusableContentId}`,
1250
+ method: "GET",
1251
+ query,
1252
+ secure: true,
1253
+ format: "json",
1254
+ ...params
1255
+ }),
1248
1256
  getComputedDocument: (spaceId, query, params = {}) => this.request({
1249
1257
  path: `/spaces/${spaceId}/content/computed/document`,
1250
1258
  method: "GET",
@@ -1536,6 +1544,14 @@ var Api = class extends HttpClient {
1536
1544
  format: "json",
1537
1545
  ...params
1538
1546
  }),
1547
+ getReusableContentInChangeRequestById: (spaceId, changeRequestId, reusableContentId, query, params = {}) => this.request({
1548
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/reusable-contents/${reusableContentId}`,
1549
+ method: "GET",
1550
+ query,
1551
+ secure: true,
1552
+ format: "json",
1553
+ ...params
1554
+ }),
1539
1555
  touchContentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1540
1556
  path: `/spaces/${spaceId}/change-requests/${changeRequestId}/touched-content`,
1541
1557
  method: "POST",
@@ -1616,6 +1632,14 @@ var Api = class extends HttpClient {
1616
1632
  format: "json",
1617
1633
  ...params
1618
1634
  }),
1635
+ getReusableContentInRevisionById: (spaceId, revisionId, reusableContentId, query, params = {}) => this.request({
1636
+ path: `/spaces/${spaceId}/revisions/${revisionId}/reusable-contents/${reusableContentId}`,
1637
+ method: "GET",
1638
+ query,
1639
+ secure: true,
1640
+ format: "json",
1641
+ ...params
1642
+ }),
1619
1643
  listCommentsInSpace: (spaceId, query, params = {}) => this.request({
1620
1644
  path: `/spaces/${spaceId}/comments`,
1621
1645
  method: "GET",
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.70.0",
7
+ "version": "0.71.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -1988,6 +1988,46 @@
1988
1988
  }
1989
1989
  }
1990
1990
  },
1991
+ "/spaces/{spaceId}/content/reusable-contents/{reusableContentId}": {
1992
+ "get": {
1993
+ "summary": "Get a reusable content by its ID in the main revision of a space",
1994
+ "operationId": "getReusableContentById",
1995
+ "security": [
1996
+ {
1997
+ "user": []
1998
+ }
1999
+ ],
2000
+ "parameters": [
2001
+ {
2002
+ "$ref": "#/components/parameters/spaceId"
2003
+ },
2004
+ {
2005
+ "$ref": "#/components/parameters/reusableContentId"
2006
+ },
2007
+ {
2008
+ "$ref": "#/components/parameters/revisionMetadata"
2009
+ },
2010
+ {
2011
+ "$ref": "#/components/parameters/revisionComputed"
2012
+ }
2013
+ ],
2014
+ "responses": {
2015
+ "200": {
2016
+ "description": "OK",
2017
+ "content": {
2018
+ "application/json": {
2019
+ "schema": {
2020
+ "$ref": "#/components/schemas/RevisionReusableContent"
2021
+ }
2022
+ }
2023
+ }
2024
+ },
2025
+ "default": {
2026
+ "$ref": "#/components/responses/UnexpectedError"
2027
+ }
2028
+ }
2029
+ }
2030
+ },
1991
2031
  "/spaces/{spaceId}/content/computed/document": {
1992
2032
  "get": {
1993
2033
  "operationId": "getComputedDocument",
@@ -3963,6 +4003,49 @@
3963
4003
  }
3964
4004
  }
3965
4005
  },
4006
+ "/spaces/{spaceId}/change-requests/{changeRequestId}/content/reusable-contents/{reusableContentId}": {
4007
+ "get": {
4008
+ "summary": "Get a reusable content by its ID in the content of a change request",
4009
+ "operationId": "getReusableContentInChangeRequestById",
4010
+ "security": [
4011
+ {
4012
+ "user": []
4013
+ }
4014
+ ],
4015
+ "parameters": [
4016
+ {
4017
+ "$ref": "#/components/parameters/spaceId"
4018
+ },
4019
+ {
4020
+ "$ref": "#/components/parameters/changeRequestId"
4021
+ },
4022
+ {
4023
+ "$ref": "#/components/parameters/reusableContentId"
4024
+ },
4025
+ {
4026
+ "$ref": "#/components/parameters/revisionMetadata"
4027
+ },
4028
+ {
4029
+ "$ref": "#/components/parameters/revisionComputed"
4030
+ }
4031
+ ],
4032
+ "responses": {
4033
+ "200": {
4034
+ "description": "OK",
4035
+ "content": {
4036
+ "application/json": {
4037
+ "schema": {
4038
+ "$ref": "#/components/schemas/RevisionReusableContent"
4039
+ }
4040
+ }
4041
+ }
4042
+ },
4043
+ "default": {
4044
+ "$ref": "#/components/responses/UnexpectedError"
4045
+ }
4046
+ }
4047
+ }
4048
+ },
3966
4049
  "/spaces/{spaceId}/change-requests/{changeRequestId}/touched-content": {
3967
4050
  "post": {
3968
4051
  "operationId": "touchContentInChangeRequest",
@@ -4499,6 +4582,49 @@
4499
4582
  }
4500
4583
  }
4501
4584
  },
4585
+ "/spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}": {
4586
+ "get": {
4587
+ "summary": "Get reusbale content in a revision by its ID",
4588
+ "operationId": "getReusableContentInRevisionById",
4589
+ "security": [
4590
+ {
4591
+ "user": []
4592
+ }
4593
+ ],
4594
+ "parameters": [
4595
+ {
4596
+ "$ref": "#/components/parameters/spaceId"
4597
+ },
4598
+ {
4599
+ "$ref": "#/components/parameters/revisionId"
4600
+ },
4601
+ {
4602
+ "$ref": "#/components/parameters/reusableContentId"
4603
+ },
4604
+ {
4605
+ "$ref": "#/components/parameters/revisionMetadata"
4606
+ },
4607
+ {
4608
+ "$ref": "#/components/parameters/revisionComputed"
4609
+ }
4610
+ ],
4611
+ "responses": {
4612
+ "200": {
4613
+ "description": "OK",
4614
+ "content": {
4615
+ "application/json": {
4616
+ "schema": {
4617
+ "$ref": "#/components/schemas/RevisionReusableContent"
4618
+ }
4619
+ }
4620
+ }
4621
+ },
4622
+ "default": {
4623
+ "$ref": "#/components/responses/UnexpectedError"
4624
+ }
4625
+ }
4626
+ }
4627
+ },
4502
4628
  "/spaces/{spaceId}/comments": {
4503
4629
  "get": {
4504
4630
  "operationId": "listCommentsInSpace",
@@ -15712,6 +15838,15 @@
15712
15838
  "type": "string"
15713
15839
  }
15714
15840
  },
15841
+ "reusableContentId": {
15842
+ "name": "reusableContentId",
15843
+ "in": "path",
15844
+ "required": true,
15845
+ "description": "The unique id of the reusable content",
15846
+ "schema": {
15847
+ "type": "string"
15848
+ }
15849
+ },
15715
15850
  "documentSchema": {
15716
15851
  "name": "schema",
15717
15852
  "in": "query",
@@ -21081,6 +21216,27 @@
21081
21216
  "size"
21082
21217
  ]
21083
21218
  },
21219
+ "RevisionReusableContent": {
21220
+ "type": "object",
21221
+ "properties": {
21222
+ "id": {
21223
+ "type": "string"
21224
+ },
21225
+ "title": {
21226
+ "type": "string"
21227
+ },
21228
+ "document": {
21229
+ "type": "string"
21230
+ },
21231
+ "git": {
21232
+ "$ref": "#/components/schemas/GitSyncBlob"
21233
+ }
21234
+ },
21235
+ "required": [
21236
+ "id",
21237
+ "title"
21238
+ ]
21239
+ },
21084
21240
  "GitSyncCommit": {
21085
21241
  "type": "object",
21086
21242
  "properties": {
@@ -21144,6 +21300,12 @@
21144
21300
  "$ref": "#/components/schemas/RevisionFile"
21145
21301
  }
21146
21302
  },
21303
+ "reusableContents": {
21304
+ "type": "array",
21305
+ "items": {
21306
+ "$ref": "#/components/schemas/RevisionReusableContent"
21307
+ }
21308
+ },
21147
21309
  "createdAt": {
21148
21310
  "description": "When the revision was created.",
21149
21311
  "$ref": "#/components/schemas/Timestamp"
@@ -21182,6 +21344,7 @@
21182
21344
  "parents",
21183
21345
  "pages",
21184
21346
  "files",
21347
+ "reusableContents",
21185
21348
  "urls",
21186
21349
  "createdAt"
21187
21350
  ]
package/spec/openapi.yaml CHANGED
@@ -1117,6 +1117,26 @@ paths:
1117
1117
  - $ref: "#/components/schemas/RevisionPageGroup"
1118
1118
  default:
1119
1119
  $ref: "#/components/responses/UnexpectedError"
1120
+ "/spaces/{spaceId}/content/reusable-contents/{reusableContentId}":
1121
+ get:
1122
+ summary: Get a reusable content by its ID in the main revision of a space
1123
+ operationId: getReusableContentById
1124
+ security:
1125
+ - user: []
1126
+ parameters:
1127
+ - $ref: "#/components/parameters/spaceId"
1128
+ - $ref: "#/components/parameters/reusableContentId"
1129
+ - $ref: "#/components/parameters/revisionMetadata"
1130
+ - $ref: "#/components/parameters/revisionComputed"
1131
+ responses:
1132
+ "200":
1133
+ description: OK
1134
+ content:
1135
+ application/json:
1136
+ schema:
1137
+ $ref: "#/components/schemas/RevisionReusableContent"
1138
+ default:
1139
+ $ref: "#/components/responses/UnexpectedError"
1120
1140
  "/spaces/{spaceId}/content/computed/document":
1121
1141
  get:
1122
1142
  operationId: getComputedDocument
@@ -2172,6 +2192,27 @@ paths:
2172
2192
  - $ref: "#/components/schemas/RevisionPageGroup"
2173
2193
  default:
2174
2194
  $ref: "#/components/responses/UnexpectedError"
2195
+ "/spaces/{spaceId}/change-requests/{changeRequestId}/content/reusable-contents/{reusableContentId}":
2196
+ get:
2197
+ summary: Get a reusable content by its ID in the content of a change request
2198
+ operationId: getReusableContentInChangeRequestById
2199
+ security:
2200
+ - user: []
2201
+ parameters:
2202
+ - $ref: "#/components/parameters/spaceId"
2203
+ - $ref: "#/components/parameters/changeRequestId"
2204
+ - $ref: "#/components/parameters/reusableContentId"
2205
+ - $ref: "#/components/parameters/revisionMetadata"
2206
+ - $ref: "#/components/parameters/revisionComputed"
2207
+ responses:
2208
+ "200":
2209
+ description: OK
2210
+ content:
2211
+ application/json:
2212
+ schema:
2213
+ $ref: "#/components/schemas/RevisionReusableContent"
2214
+ default:
2215
+ $ref: "#/components/responses/UnexpectedError"
2175
2216
  "/spaces/{spaceId}/change-requests/{changeRequestId}/touched-content":
2176
2217
  post:
2177
2218
  operationId: touchContentInChangeRequest
@@ -2455,6 +2496,27 @@ paths:
2455
2496
  - $ref: "#/components/schemas/RevisionPageGroup"
2456
2497
  default:
2457
2498
  $ref: "#/components/responses/UnexpectedError"
2499
+ "/spaces/{spaceId}/revisions/{revisionId}/reusable-contents/{reusableContentId}":
2500
+ get:
2501
+ summary: Get reusbale content in a revision by its ID
2502
+ operationId: getReusableContentInRevisionById
2503
+ security:
2504
+ - user: []
2505
+ parameters:
2506
+ - $ref: "#/components/parameters/spaceId"
2507
+ - $ref: "#/components/parameters/revisionId"
2508
+ - $ref: "#/components/parameters/reusableContentId"
2509
+ - $ref: "#/components/parameters/revisionMetadata"
2510
+ - $ref: "#/components/parameters/revisionComputed"
2511
+ responses:
2512
+ "200":
2513
+ description: OK
2514
+ content:
2515
+ application/json:
2516
+ schema:
2517
+ $ref: "#/components/schemas/RevisionReusableContent"
2518
+ default:
2519
+ $ref: "#/components/responses/UnexpectedError"
2458
2520
  "/spaces/{spaceId}/comments":
2459
2521
  get:
2460
2522
  operationId: listCommentsInSpace
@@ -8799,6 +8861,13 @@ components:
8799
8861
  description: The path of the page in the revision.
8800
8862
  schema:
8801
8863
  type: string
8864
+ reusableContentId:
8865
+ name: reusableContentId
8866
+ in: path
8867
+ required: true
8868
+ description: The unique id of the reusable content
8869
+ schema:
8870
+ type: string
8802
8871
  documentSchema:
8803
8872
  name: schema
8804
8873
  in: query
@@ -12331,6 +12400,20 @@ components:
12331
12400
  - contentType
12332
12401
  - downloadURL
12333
12402
  - size
12403
+ RevisionReusableContent:
12404
+ type: object
12405
+ properties:
12406
+ id:
12407
+ type: string
12408
+ title:
12409
+ type: string
12410
+ document:
12411
+ type: string
12412
+ git:
12413
+ $ref: "#/components/schemas/GitSyncBlob"
12414
+ required:
12415
+ - id
12416
+ - title
12334
12417
  GitSyncCommit:
12335
12418
  type: object
12336
12419
  properties:
@@ -12377,6 +12460,10 @@ components:
12377
12460
  type: array
12378
12461
  items:
12379
12462
  $ref: "#/components/schemas/RevisionFile"
12463
+ reusableContents:
12464
+ type: array
12465
+ items:
12466
+ $ref: "#/components/schemas/RevisionReusableContent"
12380
12467
  createdAt:
12381
12468
  description: When the revision was created.
12382
12469
  $ref: "#/components/schemas/Timestamp"
@@ -12406,6 +12493,7 @@ components:
12406
12493
  - parents
12407
12494
  - pages
12408
12495
  - files
12496
+ - reusableContents
12409
12497
  - urls
12410
12498
  - createdAt
12411
12499
  RevisionTypeEdits: