@gitbook/api 0.53.0 → 0.55.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
@@ -1074,6 +1074,8 @@ export declare type RevisionPageDocument = RevisionPageBase & Document & {
1074
1074
  git?: GitSyncBlob;
1075
1075
  layout: RevisionPageLayoutOptions;
1076
1076
  cover?: RevisionPageDocumentCover;
1077
+ /** If true, the page is not displayed in the navigation, while still being accessible. */
1078
+ hidden?: boolean;
1077
1079
  };
1078
1080
  export declare type RevisionPageLink = RevisionPageBase & {
1079
1081
  /** @deprecated */
@@ -3488,6 +3490,8 @@ export declare type BillingUpgrade = {
3488
3490
  result: 'upgraded';
3489
3491
  } | {
3490
3492
  result: 'downgraded';
3493
+ } | {
3494
+ result: 'interval_changed';
3491
3495
  };
3492
3496
  export interface CreateSpace {
3493
3497
  /** @maxLength 50 */
@@ -3792,7 +3796,7 @@ export declare enum SiteType {
3792
3796
  /**
3793
3797
  * Title of the site
3794
3798
  * @minLength 2
3795
- * @maxLength 50
3799
+ * @maxLength 128
3796
3800
  */
3797
3801
  export declare type SiteTitle = string;
3798
3802
  /**
@@ -5430,7 +5434,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5430
5434
  * @tags spaces
5431
5435
  * @name ListSpacePageBacklinks
5432
5436
  * @summary Get backlink locations for a page existing in a space.
5433
- * @request GET:/spaces/{spaceId}/content/files/{pageId}/backlinks
5437
+ * @request GET:/spaces/{spaceId}/content/pages/{pageId}/backlinks
5434
5438
  * @secure
5435
5439
  */
5436
5440
  listSpacePageBacklinks: (spaceId: string, pageId: string, query?: {
@@ -7453,6 +7457,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7453
7457
  * @max 1000
7454
7458
  */
7455
7459
  limit?: number;
7460
+ /**
7461
+ * An order for the items in the list
7462
+ * @default "desc"
7463
+ */
7464
+ order?: 'asc' | 'desc';
7456
7465
  /** The Role to filter the member list by */
7457
7466
  role?: MemberRole | 'guest';
7458
7467
  /** A query to filter the member list (displayName and email) */
@@ -8747,7 +8756,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8747
8756
  */
8748
8757
  visibility?: SiteVisibility;
8749
8758
  /** ID of spaces to be added to the site */
8750
- spaces?: string[];
8759
+ spaces?: string[] | 'sample' | 'empty';
8751
8760
  }, params?: RequestParams) => Promise<HttpResponse<Site, Error>>;
8752
8761
  /**
8753
8762
  * No description
@@ -8890,9 +8899,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8890
8899
  updateSitePlan: (organizationId: string, siteId: string, data: {
8891
8900
  /** The type of the site */
8892
8901
  plan: SiteType;
8902
+ /** Desired interval for new subscriptions. Defaults to the existing billing interval. */
8903
+ interval?: BillingInterval;
8893
8904
  }, query?: {
8894
- /** The app screen URL to bring the user back to after checkout. */
8895
- checkoutReturnURL?: string;
8905
+ /** The app screen URL to bring the user back to after a succesfull checkout. */
8906
+ successReturnURL?: string;
8907
+ /** The app screen URL to bring the user back to after a canceled checkout. */
8908
+ cancelReturnURL?: string;
8896
8909
  }, params?: RequestParams) => Promise<HttpResponse<{
8897
8910
  type: 'legacy-checkout';
8898
8911
  /** Stripe payment session ID */
@@ -9162,6 +9175,29 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9162
9175
  }, params?: RequestParams) => Promise<HttpResponse<List & {
9163
9176
  items: SiteSpace[];
9164
9177
  }, Error>>;
9178
+ /**
9179
+ * No description
9180
+ *
9181
+ * @name SearchSiteContent
9182
+ * @summary Search content in a site
9183
+ * @request POST:/orgs/{organizationId}/sites/{siteId}/search
9184
+ * @secure
9185
+ */
9186
+ searchSiteContent: (organizationId: string, siteId: string, data: {
9187
+ query: string;
9188
+ siteSpaceIds?: string[];
9189
+ }, query?: {
9190
+ /** Identifier of the page results to fetch. */
9191
+ page?: string;
9192
+ /**
9193
+ * The number of results per page
9194
+ * @min 0
9195
+ * @max 1000
9196
+ */
9197
+ limit?: number;
9198
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
9199
+ items: SearchSpaceResult[];
9200
+ }, Error>>;
9165
9201
  /**
9166
9202
  * No description
9167
9203
  *
package/dist/index.cjs CHANGED
@@ -238,7 +238,7 @@ module.exports = __toCommonJS(src_exports);
238
238
 
239
239
  // package.json
240
240
  var name = "@gitbook/api";
241
- var version = "0.53.0";
241
+ var version = "0.55.0";
242
242
 
243
243
  // src/client.ts
244
244
  var import_event_iterator = __toESM(require_node(), 1);
@@ -1238,7 +1238,7 @@ var Api = class extends HttpClient {
1238
1238
  ...params
1239
1239
  }),
1240
1240
  listSpacePageBacklinks: (spaceId, pageId, query, params = {}) => this.request({
1241
- path: `/spaces/${spaceId}/content/files/${pageId}/backlinks`,
1241
+ path: `/spaces/${spaceId}/content/pages/${pageId}/backlinks`,
1242
1242
  method: "GET",
1243
1243
  query,
1244
1244
  secure: true,
@@ -3019,6 +3019,16 @@ var Api = class extends HttpClient {
3019
3019
  format: "json",
3020
3020
  ...params
3021
3021
  }),
3022
+ searchSiteContent: (organizationId, siteId, data, query, params = {}) => this.request({
3023
+ path: `/orgs/${organizationId}/sites/${siteId}/search`,
3024
+ method: "POST",
3025
+ query,
3026
+ body: data,
3027
+ secure: true,
3028
+ type: "application/json" /* Json */,
3029
+ format: "json",
3030
+ ...params
3031
+ }),
3022
3032
  updateSiteSpaceById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
3023
3033
  path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
3024
3034
  method: "PATCH",
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.53.0";
175
+ var version = "0.55.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -1172,7 +1172,7 @@ var Api = class extends HttpClient {
1172
1172
  ...params
1173
1173
  }),
1174
1174
  listSpacePageBacklinks: (spaceId, pageId, query, params = {}) => this.request({
1175
- path: `/spaces/${spaceId}/content/files/${pageId}/backlinks`,
1175
+ path: `/spaces/${spaceId}/content/pages/${pageId}/backlinks`,
1176
1176
  method: "GET",
1177
1177
  query,
1178
1178
  secure: true,
@@ -2953,6 +2953,16 @@ var Api = class extends HttpClient {
2953
2953
  format: "json",
2954
2954
  ...params
2955
2955
  }),
2956
+ searchSiteContent: (organizationId, siteId, data, query, params = {}) => this.request({
2957
+ path: `/orgs/${organizationId}/sites/${siteId}/search`,
2958
+ method: "POST",
2959
+ query,
2960
+ body: data,
2961
+ secure: true,
2962
+ type: "application/json" /* Json */,
2963
+ format: "json",
2964
+ ...params
2965
+ }),
2956
2966
  updateSiteSpaceById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
2957
2967
  path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
2958
2968
  method: "PATCH",
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.53.0",
7
+ "version": "0.55.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -1662,7 +1662,7 @@
1662
1662
  }
1663
1663
  }
1664
1664
  },
1665
- "/spaces/{spaceId}/content/files/{pageId}/backlinks": {
1665
+ "/spaces/{spaceId}/content/pages/{pageId}/backlinks": {
1666
1666
  "get": {
1667
1667
  "operationId": "listSpacePageBacklinks",
1668
1668
  "summary": "Get backlink locations for a page existing in a space.",
@@ -7605,6 +7605,9 @@
7605
7605
  {
7606
7606
  "$ref": "#/components/parameters/listLimit"
7607
7607
  },
7608
+ {
7609
+ "$ref": "#/components/parameters/listOrder"
7610
+ },
7608
7611
  {
7609
7612
  "name": "role",
7610
7613
  "description": "The Role to filter the member list by",
@@ -11879,11 +11882,23 @@
11879
11882
  "$ref": "#/components/schemas/SiteVisibility"
11880
11883
  },
11881
11884
  "spaces": {
11882
- "type": "array",
11883
- "description": "ID of spaces to be added to the site",
11884
- "items": {
11885
- "type": "string"
11886
- }
11885
+ "oneOf": [
11886
+ {
11887
+ "type": "array",
11888
+ "description": "ID of spaces to be added to the site",
11889
+ "items": {
11890
+ "type": "string"
11891
+ }
11892
+ },
11893
+ {
11894
+ "type": "string",
11895
+ "description": "Create a new space associated to the site",
11896
+ "enum": [
11897
+ "sample",
11898
+ "empty"
11899
+ ]
11900
+ }
11901
+ ]
11887
11902
  }
11888
11903
  }
11889
11904
  }
@@ -12351,8 +12366,16 @@
12351
12366
  },
12352
12367
  {
12353
12368
  "in": "query",
12354
- "name": "checkoutReturnURL",
12355
- "description": "The app screen URL to bring the user back to after checkout.",
12369
+ "name": "successReturnURL",
12370
+ "description": "The app screen URL to bring the user back to after a succesfull checkout.",
12371
+ "schema": {
12372
+ "type": "string"
12373
+ }
12374
+ },
12375
+ {
12376
+ "in": "query",
12377
+ "name": "cancelReturnURL",
12378
+ "description": "The app screen URL to bring the user back to after a canceled checkout.",
12356
12379
  "schema": {
12357
12380
  "type": "string"
12358
12381
  }
@@ -12367,6 +12390,10 @@
12367
12390
  "properties": {
12368
12391
  "plan": {
12369
12392
  "$ref": "#/components/schemas/SiteType"
12393
+ },
12394
+ "interval": {
12395
+ "description": "Desired interval for new subscriptions. Defaults to the existing billing interval.",
12396
+ "$ref": "#/components/schemas/BillingInterval"
12370
12397
  }
12371
12398
  },
12372
12399
  "required": [
@@ -13212,6 +13239,88 @@
13212
13239
  }
13213
13240
  }
13214
13241
  },
13242
+ "/orgs/{organizationId}/sites/{siteId}/search": {
13243
+ "post": {
13244
+ "operationId": "searchSiteContent",
13245
+ "summary": "Search content in a site",
13246
+ "security": [
13247
+ {
13248
+ "user": []
13249
+ }
13250
+ ],
13251
+ "parameters": [
13252
+ {
13253
+ "$ref": "#/components/parameters/organizationId"
13254
+ },
13255
+ {
13256
+ "$ref": "#/components/parameters/siteId"
13257
+ },
13258
+ {
13259
+ "$ref": "#/components/parameters/listPage"
13260
+ },
13261
+ {
13262
+ "$ref": "#/components/parameters/listLimit"
13263
+ }
13264
+ ],
13265
+ "requestBody": {
13266
+ "required": true,
13267
+ "content": {
13268
+ "application/json": {
13269
+ "schema": {
13270
+ "type": "object",
13271
+ "properties": {
13272
+ "query": {
13273
+ "type": "string"
13274
+ },
13275
+ "siteSpaceIds": {
13276
+ "type": "array",
13277
+ "items": {
13278
+ "type": "string"
13279
+ }
13280
+ }
13281
+ },
13282
+ "required": [
13283
+ "query"
13284
+ ]
13285
+ }
13286
+ }
13287
+ }
13288
+ },
13289
+ "responses": {
13290
+ "200": {
13291
+ "description": "OK",
13292
+ "content": {
13293
+ "application/json": {
13294
+ "schema": {
13295
+ "allOf": [
13296
+ {
13297
+ "$ref": "#/components/schemas/List"
13298
+ },
13299
+ {
13300
+ "type": "object",
13301
+ "required": [
13302
+ "items"
13303
+ ],
13304
+ "properties": {
13305
+ "items": {
13306
+ "type": "array",
13307
+ "items": {
13308
+ "$ref": "#/components/schemas/SearchSpaceResult"
13309
+ }
13310
+ }
13311
+ }
13312
+ }
13313
+ ]
13314
+ }
13315
+ }
13316
+ }
13317
+ },
13318
+ "default": {
13319
+ "$ref": "#/components/responses/UnexpectedError"
13320
+ }
13321
+ }
13322
+ }
13323
+ },
13215
13324
  "/orgs/{organizationId}/sites/{siteId}/site-spaces/{siteSpaceId}": {
13216
13325
  "patch": {
13217
13326
  "operationId": "updateSiteSpaceById",
@@ -18771,6 +18880,10 @@
18771
18880
  },
18772
18881
  "cover": {
18773
18882
  "$ref": "#/components/schemas/RevisionPageDocumentCover"
18883
+ },
18884
+ "hidden": {
18885
+ "type": "boolean",
18886
+ "description": "If true, the page is not displayed in the navigation, while still being accessible."
18774
18887
  }
18775
18888
  },
18776
18889
  "required": [
@@ -26084,6 +26197,20 @@
26084
26197
  "required": [
26085
26198
  "result"
26086
26199
  ]
26200
+ },
26201
+ {
26202
+ "type": "object",
26203
+ "properties": {
26204
+ "result": {
26205
+ "type": "string",
26206
+ "enum": [
26207
+ "interval_changed"
26208
+ ]
26209
+ }
26210
+ },
26211
+ "required": [
26212
+ "result"
26213
+ ]
26087
26214
  }
26088
26215
  ]
26089
26216
  },
@@ -26954,7 +27081,7 @@
26954
27081
  "type": "string",
26955
27082
  "description": "Title of the site",
26956
27083
  "minLength": 2,
26957
- "maxLength": 50
27084
+ "maxLength": 128
26958
27085
  },
26959
27086
  "SiteHostname": {
26960
27087
  "type": "string",
package/spec/openapi.yaml CHANGED
@@ -948,7 +948,7 @@ paths:
948
948
  $ref: "#/components/schemas/RevisionPage"
949
949
  default:
950
950
  $ref: "#/components/responses/UnexpectedError"
951
- "/spaces/{spaceId}/content/files/{pageId}/backlinks":
951
+ "/spaces/{spaceId}/content/pages/{pageId}/backlinks":
952
952
  get:
953
953
  operationId: listSpacePageBacklinks
954
954
  summary: Get backlink locations for a page existing in a space.
@@ -4215,6 +4215,7 @@ paths:
4215
4215
  - $ref: "#/components/parameters/organizationId"
4216
4216
  - $ref: "#/components/parameters/listPage"
4217
4217
  - $ref: "#/components/parameters/listLimit"
4218
+ - $ref: "#/components/parameters/listOrder"
4218
4219
  - name: role
4219
4220
  description: The Role to filter the member list by
4220
4221
  in: query
@@ -6621,10 +6622,16 @@ paths:
6621
6622
  visibility:
6622
6623
  $ref: "#/components/schemas/SiteVisibility"
6623
6624
  spaces:
6624
- type: array
6625
- description: ID of spaces to be added to the site
6626
- items:
6627
- type: string
6625
+ oneOf:
6626
+ - type: array
6627
+ description: ID of spaces to be added to the site
6628
+ items:
6629
+ type: string
6630
+ - type: string
6631
+ description: Create a new space associated to the site
6632
+ enum:
6633
+ - sample
6634
+ - empty
6628
6635
  responses:
6629
6636
  "201":
6630
6637
  description: Site created
@@ -6879,8 +6886,13 @@ paths:
6879
6886
  - $ref: "#/components/parameters/organizationId"
6880
6887
  - $ref: "#/components/parameters/siteId"
6881
6888
  - in: query
6882
- name: checkoutReturnURL
6883
- description: The app screen URL to bring the user back to after checkout.
6889
+ name: successReturnURL
6890
+ description: The app screen URL to bring the user back to after a succesfull checkout.
6891
+ schema:
6892
+ type: string
6893
+ - in: query
6894
+ name: cancelReturnURL
6895
+ description: The app screen URL to bring the user back to after a canceled checkout.
6884
6896
  schema:
6885
6897
  type: string
6886
6898
  requestBody:
@@ -6892,6 +6904,9 @@ paths:
6892
6904
  properties:
6893
6905
  plan:
6894
6906
  $ref: "#/components/schemas/SiteType"
6907
+ interval:
6908
+ description: Desired interval for new subscriptions. Defaults to the existing billing interval.
6909
+ $ref: "#/components/schemas/BillingInterval"
6895
6910
  required:
6896
6911
  - plan
6897
6912
  responses:
@@ -7368,6 +7383,50 @@ paths:
7368
7383
  $ref: "#/components/schemas/SiteSpace"
7369
7384
  default:
7370
7385
  $ref: "#/components/responses/UnexpectedError"
7386
+ "/orgs/{organizationId}/sites/{siteId}/search":
7387
+ post:
7388
+ operationId: searchSiteContent
7389
+ summary: Search content in a site
7390
+ security:
7391
+ - user: []
7392
+ parameters:
7393
+ - $ref: "#/components/parameters/organizationId"
7394
+ - $ref: "#/components/parameters/siteId"
7395
+ - $ref: "#/components/parameters/listPage"
7396
+ - $ref: "#/components/parameters/listLimit"
7397
+ requestBody:
7398
+ required: true
7399
+ content:
7400
+ application/json:
7401
+ schema:
7402
+ type: object
7403
+ properties:
7404
+ query:
7405
+ type: string
7406
+ siteSpaceIds:
7407
+ type: array
7408
+ items:
7409
+ type: string
7410
+ required:
7411
+ - query
7412
+ responses:
7413
+ "200":
7414
+ description: OK
7415
+ content:
7416
+ application/json:
7417
+ schema:
7418
+ allOf:
7419
+ - $ref: "#/components/schemas/List"
7420
+ - type: object
7421
+ required:
7422
+ - items
7423
+ properties:
7424
+ items:
7425
+ type: array
7426
+ items:
7427
+ $ref: "#/components/schemas/SearchSpaceResult"
7428
+ default:
7429
+ $ref: "#/components/responses/UnexpectedError"
7371
7430
  "/orgs/{organizationId}/sites/{siteId}/site-spaces/{siteSpaceId}":
7372
7431
  patch:
7373
7432
  operationId: updateSiteSpaceById
@@ -10955,6 +11014,9 @@ components:
10955
11014
  $ref: "#/components/schemas/RevisionPageLayoutOptions"
10956
11015
  cover:
10957
11016
  $ref: "#/components/schemas/RevisionPageDocumentCover"
11017
+ hidden:
11018
+ type: boolean
11019
+ description: If true, the page is not displayed in the navigation, while still being accessible.
10958
11020
  required:
10959
11021
  - kind
10960
11022
  - type
@@ -15812,6 +15874,14 @@ components:
15812
15874
  - downgraded
15813
15875
  required:
15814
15876
  - result
15877
+ - type: object
15878
+ properties:
15879
+ result:
15880
+ type: string
15881
+ enum:
15882
+ - interval_changed
15883
+ required:
15884
+ - result
15815
15885
  CreateSpace:
15816
15886
  type: object
15817
15887
  properties:
@@ -16387,7 +16457,7 @@ components:
16387
16457
  type: string
16388
16458
  description: Title of the site
16389
16459
  minLength: 2
16390
- maxLength: 50
16460
+ maxLength: 128
16391
16461
  SiteHostname:
16392
16462
  type: string
16393
16463
  description: Custom hostname for the site, for e.g. docs.mycompany.com