@gitbook/api 0.141.0 → 0.142.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
@@ -1836,9 +1836,18 @@ export declare enum BillingTrialStatus {
1836
1836
  Ended = "ended",
1837
1837
  Expired = "expired"
1838
1838
  }
1839
- export declare enum OrganizationBlockReason {
1840
- Security = "security"
1839
+ /** Source for an organization block */
1840
+ export declare enum BlockSource {
1841
+ Backoffice = "backoffice",
1842
+ External = "external",
1843
+ Internal = "internal"
1841
1844
  }
1845
+ /**
1846
+ * A short description giving context on the reason for the block.
1847
+ * @minLength 1
1848
+ * @maxLength 255
1849
+ */
1850
+ export type BlockReason = string;
1842
1851
  export interface Organization {
1843
1852
  /** Type of Object, always equals to "organization" */
1844
1853
  object: 'organization';
@@ -1895,7 +1904,10 @@ export interface Organization {
1895
1904
  customHostname?: string;
1896
1905
  /** If the organization is blocked, information about the block will appear here */
1897
1906
  blocked?: {
1898
- reason: OrganizationBlockReason;
1907
+ /** Source for an organization block */
1908
+ source?: BlockSource;
1909
+ /** A short description giving context on the reason for the block. */
1910
+ reason: BlockReason;
1899
1911
  };
1900
1912
  /**
1901
1913
  * Deprecated. Always true. All organizations are on new trials.
@@ -3926,8 +3938,15 @@ export interface SiteSectionGroup {
3926
3938
  id: string;
3927
3939
  /** Title of the site section group */
3928
3940
  title: SiteSectionGroupTitle;
3929
- /** List of site section ids that are members of the group */
3941
+ /**
3942
+ * List of site section ids that are members of the group. Use `children` instead.
3943
+ * @deprecated
3944
+ */
3930
3945
  sections: SiteSection[];
3946
+ /** ID of the parent section group this group belongs to */
3947
+ sectionGroup?: string;
3948
+ /** List of all child sections and groups nested under this group */
3949
+ children: (SiteSection | SiteSectionGroup)[];
3931
3950
  /** Name of the icon */
3932
3951
  icon?: Icon;
3933
3952
  }
@@ -6390,6 +6409,8 @@ export interface UserBackOfficeInfo {
6390
6409
  /** The context to send when blocking/unblocking */
6391
6410
  export interface BlockContext {
6392
6411
  block: boolean;
6412
+ /** A short description giving context on the reason for the block. */
6413
+ reason?: BlockReason;
6393
6414
  }
6394
6415
  /** The GitBook User impersonation info. */
6395
6416
  export interface UserImpersonationInfo {
@@ -11761,7 +11782,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11761
11782
  */
11762
11783
  visibility?: SiteVisibility;
11763
11784
  /** ID of spaces to be added to the site */
11764
- spaces?: string[] | "sample" | "empty";
11785
+ spaces?: string[];
11765
11786
  }, params?: RequestParams) => Promise<HttpResponse<Site, any>>;
11766
11787
  /**
11767
11788
  * No description
@@ -12239,6 +12260,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12239
12260
  icon?: Icon | null;
12240
12261
  /** IDs of the sections to be added to the section group */
12241
12262
  sections?: string[];
12263
+ /** ID of the parent section group to nest this group under. If not provided, the section group will be added at the root of the site. */
12264
+ parent?: string;
12242
12265
  }, params?: RequestParams) => Promise<HttpResponse<SiteSectionGroup, any>>;
12243
12266
  /**
12244
12267
  * No description
@@ -12841,6 +12864,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12841
12864
  * @max 1000
12842
12865
  */
12843
12866
  limit?: number;
12867
+ /** Search for a redirect by path */
12868
+ search?: string;
12844
12869
  }, params?: RequestParams) => Promise<HttpResponse<List & {
12845
12870
  items: SiteRedirect[];
12846
12871
  }, any>>;
package/dist/index.cjs CHANGED
@@ -190,6 +190,7 @@ __export(src_exports, {
190
190
  BillingProduct: () => BillingProduct,
191
191
  BillingSwitchAction: () => BillingSwitchAction,
192
192
  BillingTrialStatus: () => BillingTrialStatus,
193
+ BlockSource: () => BlockSource,
193
194
  CardsImageObjectFit: () => CardsImageObjectFit,
194
195
  ChangeRequestReviewStatus: () => ChangeRequestReviewStatus,
195
196
  ChangeRequestStatus: () => ChangeRequestStatus,
@@ -240,7 +241,6 @@ __export(src_exports, {
240
241
  OpenAPISpecProcessingErrorCode: () => OpenAPISpecProcessingErrorCode,
241
242
  OpenAPISpecProcessingState: () => OpenAPISpecProcessingState,
242
243
  OpenAPISpecVisibility: () => OpenAPISpecVisibility,
243
- OrganizationBlockReason: () => OrganizationBlockReason,
244
244
  OrganizationCommunityType: () => OrganizationCommunityType,
245
245
  OrganizationType: () => OrganizationType,
246
246
  OrganizationUseCase: () => OrganizationUseCase,
@@ -282,7 +282,7 @@ module.exports = __toCommonJS(src_exports);
282
282
 
283
283
  // package.json
284
284
  var name = "@gitbook/api";
285
- var version = "0.141.0";
285
+ var version = "0.142.0";
286
286
 
287
287
  // src/client.ts
288
288
  var import_event_iterator = __toESM(require_node(), 1);
@@ -547,10 +547,12 @@ var BillingTrialStatus = /* @__PURE__ */ ((BillingTrialStatus2) => {
547
547
  BillingTrialStatus2["Expired"] = "expired";
548
548
  return BillingTrialStatus2;
549
549
  })(BillingTrialStatus || {});
550
- var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
551
- OrganizationBlockReason2["Security"] = "security";
552
- return OrganizationBlockReason2;
553
- })(OrganizationBlockReason || {});
550
+ var BlockSource = /* @__PURE__ */ ((BlockSource2) => {
551
+ BlockSource2["Backoffice"] = "backoffice";
552
+ BlockSource2["External"] = "external";
553
+ BlockSource2["Internal"] = "internal";
554
+ return BlockSource2;
555
+ })(BlockSource || {});
554
556
  var OpenAPISpecProcessingState = /* @__PURE__ */ ((OpenAPISpecProcessingState2) => {
555
557
  OpenAPISpecProcessingState2["Pending"] = "pending";
556
558
  OpenAPISpecProcessingState2["Progress"] = "progress";
@@ -3856,6 +3858,7 @@ var GitBookAPI = class extends Api {
3856
3858
  BillingProduct,
3857
3859
  BillingSwitchAction,
3858
3860
  BillingTrialStatus,
3861
+ BlockSource,
3859
3862
  CardsImageObjectFit,
3860
3863
  ChangeRequestReviewStatus,
3861
3864
  ChangeRequestStatus,
@@ -3906,7 +3909,6 @@ var GitBookAPI = class extends Api {
3906
3909
  OpenAPISpecProcessingErrorCode,
3907
3910
  OpenAPISpecProcessingState,
3908
3911
  OpenAPISpecVisibility,
3909
- OrganizationBlockReason,
3910
3912
  OrganizationCommunityType,
3911
3913
  OrganizationType,
3912
3914
  OrganizationUseCase,
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.141.0";
175
+ var version = "0.142.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -437,10 +437,12 @@ var BillingTrialStatus = /* @__PURE__ */ ((BillingTrialStatus2) => {
437
437
  BillingTrialStatus2["Expired"] = "expired";
438
438
  return BillingTrialStatus2;
439
439
  })(BillingTrialStatus || {});
440
- var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
441
- OrganizationBlockReason2["Security"] = "security";
442
- return OrganizationBlockReason2;
443
- })(OrganizationBlockReason || {});
440
+ var BlockSource = /* @__PURE__ */ ((BlockSource2) => {
441
+ BlockSource2["Backoffice"] = "backoffice";
442
+ BlockSource2["External"] = "external";
443
+ BlockSource2["Internal"] = "internal";
444
+ return BlockSource2;
445
+ })(BlockSource || {});
444
446
  var OpenAPISpecProcessingState = /* @__PURE__ */ ((OpenAPISpecProcessingState2) => {
445
447
  OpenAPISpecProcessingState2["Pending"] = "pending";
446
448
  OpenAPISpecProcessingState2["Progress"] = "progress";
@@ -3745,6 +3747,7 @@ export {
3745
3747
  BillingProduct,
3746
3748
  BillingSwitchAction,
3747
3749
  BillingTrialStatus,
3750
+ BlockSource,
3748
3751
  CardsImageObjectFit,
3749
3752
  ChangeRequestReviewStatus,
3750
3753
  ChangeRequestStatus,
@@ -3795,7 +3798,6 @@ export {
3795
3798
  OpenAPISpecProcessingErrorCode,
3796
3799
  OpenAPISpecProcessingState,
3797
3800
  OpenAPISpecVisibility,
3798
- OrganizationBlockReason,
3799
3801
  OrganizationCommunityType,
3800
3802
  OrganizationType,
3801
3803
  OrganizationUseCase,
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.141.0",
7
+ "version": "0.142.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -11983,23 +11983,11 @@
11983
11983
  "$ref": "#/components/schemas/SiteVisibility"
11984
11984
  },
11985
11985
  "spaces": {
11986
- "oneOf": [
11987
- {
11988
- "type": "array",
11989
- "description": "ID of spaces to be added to the site",
11990
- "items": {
11991
- "type": "string"
11992
- }
11993
- },
11994
- {
11995
- "type": "string",
11996
- "description": "Create a new space associated to the site",
11997
- "enum": [
11998
- "sample",
11999
- "empty"
12000
- ]
12001
- }
12002
- ]
11986
+ "type": "array",
11987
+ "description": "ID of spaces to be added to the site",
11988
+ "items": {
11989
+ "type": "string"
11990
+ }
12003
11991
  }
12004
11992
  }
12005
11993
  }
@@ -13364,6 +13352,10 @@
13364
13352
  "type": "string"
13365
13353
  },
13366
13354
  "description": "IDs of the sections to be added to the section group"
13355
+ },
13356
+ "parent": {
13357
+ "type": "string",
13358
+ "description": "ID of the parent section group to nest this group under. If not provided, the section group will be added at the root of the site."
13367
13359
  }
13368
13360
  },
13369
13361
  "required": [
@@ -15558,6 +15550,14 @@
15558
15550
  },
15559
15551
  {
15560
15552
  "$ref": "#/components/parameters/listLimit"
15553
+ },
15554
+ {
15555
+ "name": "search",
15556
+ "in": "query",
15557
+ "description": "Search for a redirect by path",
15558
+ "schema": {
15559
+ "type": "string"
15560
+ }
15561
15561
  }
15562
15562
  ],
15563
15563
  "responses": {
@@ -24177,12 +24177,21 @@
24177
24177
  "expired"
24178
24178
  ]
24179
24179
  },
24180
- "OrganizationBlockReason": {
24180
+ "BlockSource": {
24181
24181
  "type": "string",
24182
+ "description": "Source for an organization block",
24182
24183
  "enum": [
24183
- "security"
24184
+ "backoffice",
24185
+ "external",
24186
+ "internal"
24184
24187
  ]
24185
24188
  },
24189
+ "BlockReason": {
24190
+ "type": "string",
24191
+ "description": "A short description giving context on the reason for the block.",
24192
+ "minLength": 1,
24193
+ "maxLength": 255
24194
+ },
24186
24195
  "Organization": {
24187
24196
  "type": "object",
24188
24197
  "properties": {
@@ -24300,8 +24309,11 @@
24300
24309
  "type": "object",
24301
24310
  "description": "If the organization is blocked, information about the block will appear here",
24302
24311
  "properties": {
24312
+ "source": {
24313
+ "$ref": "#/components/schemas/BlockSource"
24314
+ },
24303
24315
  "reason": {
24304
- "$ref": "#/components/schemas/OrganizationBlockReason"
24316
+ "$ref": "#/components/schemas/BlockReason"
24305
24317
  }
24306
24318
  },
24307
24319
  "required": [
@@ -30310,11 +30322,30 @@
30310
30322
  },
30311
30323
  "sections": {
30312
30324
  "type": "array",
30313
- "description": "List of site section ids that are members of the group",
30325
+ "deprecated": true,
30326
+ "description": "List of site section ids that are members of the group. Use `children` instead.",
30314
30327
  "items": {
30315
30328
  "$ref": "#/components/schemas/SiteSection"
30316
30329
  }
30317
30330
  },
30331
+ "sectionGroup": {
30332
+ "type": "string",
30333
+ "description": "ID of the parent section group this group belongs to"
30334
+ },
30335
+ "children": {
30336
+ "type": "array",
30337
+ "description": "List of all child sections and groups nested under this group",
30338
+ "items": {
30339
+ "oneOf": [
30340
+ {
30341
+ "$ref": "#/components/schemas/SiteSection"
30342
+ },
30343
+ {
30344
+ "$ref": "#/components/schemas/SiteSectionGroup"
30345
+ }
30346
+ ]
30347
+ }
30348
+ },
30318
30349
  "icon": {
30319
30350
  "$ref": "#/components/schemas/Icon"
30320
30351
  }
@@ -30323,7 +30354,8 @@
30323
30354
  "object",
30324
30355
  "id",
30325
30356
  "title",
30326
- "sections"
30357
+ "sections",
30358
+ "children"
30327
30359
  ]
30328
30360
  },
30329
30361
  "SiteStructure": {
@@ -38399,6 +38431,9 @@
38399
38431
  "properties": {
38400
38432
  "block": {
38401
38433
  "type": "boolean"
38434
+ },
38435
+ "reason": {
38436
+ "$ref": "#/components/schemas/BlockReason"
38402
38437
  }
38403
38438
  },
38404
38439
  "required": [
package/spec/openapi.yaml CHANGED
@@ -6815,16 +6815,10 @@ paths:
6815
6815
  visibility:
6816
6816
  $ref: "#/components/schemas/SiteVisibility"
6817
6817
  spaces:
6818
- oneOf:
6819
- - type: array
6820
- description: ID of spaces to be added to the site
6821
- items:
6822
- type: string
6823
- - type: string
6824
- description: Create a new space associated to the site
6825
- enum:
6826
- - sample
6827
- - empty
6818
+ type: array
6819
+ description: ID of spaces to be added to the site
6820
+ items:
6821
+ type: string
6828
6822
  responses:
6829
6823
  "201":
6830
6824
  description: Site created
@@ -7581,6 +7575,9 @@ paths:
7581
7575
  items:
7582
7576
  type: string
7583
7577
  description: IDs of the sections to be added to the section group
7578
+ parent:
7579
+ type: string
7580
+ description: ID of the parent section group to nest this group under. If not provided, the section group will be added at the root of the site.
7584
7581
  required:
7585
7582
  - title
7586
7583
  responses:
@@ -8804,6 +8801,11 @@ paths:
8804
8801
  - $ref: "#/components/parameters/siteId"
8805
8802
  - $ref: "#/components/parameters/listPage"
8806
8803
  - $ref: "#/components/parameters/listLimit"
8804
+ - name: search
8805
+ in: query
8806
+ description: Search for a redirect by path
8807
+ schema:
8808
+ type: string
8807
8809
  responses:
8808
8810
  "200":
8809
8811
  description: The list of redirects for the site.
@@ -14342,10 +14344,18 @@ components:
14342
14344
  - active
14343
14345
  - ended
14344
14346
  - expired
14345
- OrganizationBlockReason:
14347
+ BlockSource:
14346
14348
  type: string
14349
+ description: Source for an organization block
14347
14350
  enum:
14348
- - security
14351
+ - backoffice
14352
+ - external
14353
+ - internal
14354
+ BlockReason:
14355
+ type: string
14356
+ description: A short description giving context on the reason for the block.
14357
+ minLength: 1
14358
+ maxLength: 255
14349
14359
  Organization:
14350
14360
  type: object
14351
14361
  properties:
@@ -14431,8 +14441,10 @@ components:
14431
14441
  type: object
14432
14442
  description: If the organization is blocked, information about the block will appear here
14433
14443
  properties:
14444
+ source:
14445
+ $ref: "#/components/schemas/BlockSource"
14434
14446
  reason:
14435
- $ref: "#/components/schemas/OrganizationBlockReason"
14447
+ $ref: "#/components/schemas/BlockReason"
14436
14448
  required:
14437
14449
  - reason
14438
14450
  internal_isOnNewTrial:
@@ -18425,9 +18437,20 @@ components:
18425
18437
  $ref: "#/components/schemas/SiteSectionGroupTitle"
18426
18438
  sections:
18427
18439
  type: array
18428
- description: List of site section ids that are members of the group
18440
+ deprecated: true
18441
+ description: List of site section ids that are members of the group. Use `children` instead.
18429
18442
  items:
18430
18443
  $ref: "#/components/schemas/SiteSection"
18444
+ sectionGroup:
18445
+ type: string
18446
+ description: ID of the parent section group this group belongs to
18447
+ children:
18448
+ type: array
18449
+ description: List of all child sections and groups nested under this group
18450
+ items:
18451
+ oneOf:
18452
+ - $ref: "#/components/schemas/SiteSection"
18453
+ - $ref: "#/components/schemas/SiteSectionGroup"
18431
18454
  icon:
18432
18455
  $ref: "#/components/schemas/Icon"
18433
18456
  required:
@@ -18435,6 +18458,7 @@ components:
18435
18458
  - id
18436
18459
  - title
18437
18460
  - sections
18461
+ - children
18438
18462
  SiteStructure:
18439
18463
  oneOf:
18440
18464
  - type: object
@@ -23885,6 +23909,8 @@ components:
23885
23909
  properties:
23886
23910
  block:
23887
23911
  type: boolean
23912
+ reason:
23913
+ $ref: "#/components/schemas/BlockReason"
23888
23914
  required:
23889
23915
  - block
23890
23916
  UserImpersonationInfo: