@gitbook/api 0.80.0 → 0.81.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
@@ -974,7 +974,7 @@ export type Embed = {
974
974
  export interface SearchAIAnswerStream {
975
975
  type: 'answer';
976
976
  /** Answer from AI for a question asked on a content. */
977
- answer?: SearchAIAnswer;
977
+ answer: SearchAIAnswer;
978
978
  }
979
979
  export interface SearchAIRecommendedQuestionStream {
980
980
  question: string;
@@ -1504,6 +1504,9 @@ export declare enum BillingProduct {
1504
1504
  TeamDec2021 = "team_dec_2021",
1505
1505
  BusinessDec2021 = "business_dec_2021"
1506
1506
  }
1507
+ export declare enum OrganizationBlockReason {
1508
+ Security = "security"
1509
+ }
1507
1510
  export interface Organization {
1508
1511
  /** Type of Object, always equals to "organization" */
1509
1512
  object: 'organization';
@@ -1545,6 +1548,18 @@ export interface Organization {
1545
1548
  /** URL of the logo of this organization, if defined. */
1546
1549
  logo?: URL;
1547
1550
  };
1551
+ /** The decision taken by the user at the end of the trial */
1552
+ trialDecision?: 'downgrade';
1553
+ /** Custom hostname linked to this organization */
1554
+ customHostname?: string;
1555
+ /** If the organization is blocked, information about the block will appear here */
1556
+ blocked?: {
1557
+ reason: OrganizationBlockReason;
1558
+ };
1559
+ /** If true, the organization is still using the deprecated snippets feature. */
1560
+ internal_isUsingSnippets?: boolean;
1561
+ /** If true, the organization is on the new trial which includes sites and the Pro plan. */
1562
+ internal_isOnNewTrial?: boolean;
1548
1563
  /** The set of permissions for the organization */
1549
1564
  permissions: {
1550
1565
  /** Can the user manage the title, members, etc. */
@@ -3416,6 +3431,10 @@ export declare enum SiteVisibility {
3416
3431
  ShareLink = "share-link",
3417
3432
  VisitorAuth = "visitor-auth"
3418
3433
  }
3434
+ export interface SiteAdaptiveContent {
3435
+ /** Whether adaptive content should be enabled on the site. */
3436
+ enabled: boolean;
3437
+ }
3419
3438
  /** Topic of the content */
3420
3439
  export declare enum SiteAdsTopic {
3421
3440
  Webdev = "webdev",
@@ -3463,6 +3482,7 @@ export interface Site {
3463
3482
  siteSpaces: number;
3464
3483
  /** @format date-time */
3465
3484
  createdAt: string;
3485
+ adaptiveContent?: SiteAdaptiveContent;
3466
3486
  ads?: SiteAds;
3467
3487
  /** URLs associated with the object */
3468
3488
  urls: {
@@ -5305,7 +5325,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
5305
5325
  protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
5306
5326
  abortRequest: (cancelToken: CancelToken) => void;
5307
5327
  request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
5308
- streamRequest: <T, E = any>({ path, baseUrl, cancelToken, secure, ...params }: FullRequestParams) => EventIterator<T>;
5328
+ streamRequest: <T, E = any>({ body, path, type, baseUrl, cancelToken, secure, ...params }: FullRequestParams) => EventIterator<T>;
5309
5329
  }
5310
5330
  /**
5311
5331
  * @title GitBook API
@@ -8685,7 +8705,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8685
8705
  /**
8686
8706
  * No description
8687
8707
  *
8688
- * @tags integrations
8708
+ * @tags integrations, critical
8689
8709
  * @name ListOrganizationIntegrationsStatus
8690
8710
  * @summary List the statuses of all integrations installed in an organization
8691
8711
  * @request GET:/orgs/{organizationId}/integrations/installations-status
@@ -9277,6 +9297,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9277
9297
  visibility?: SiteVisibility;
9278
9298
  /** Basename for the site. For e.g. api */
9279
9299
  basename?: SiteBasename;
9300
+ adaptiveContent?: SiteAdaptiveContent;
9280
9301
  /** ID of the site-space to be used as the default at the root level. If site has sections, this will mark the default site space in the site's default section. */
9281
9302
  defaultSiteSpace?: string;
9282
9303
  /** ID of the site-section to be used as the default. */
@@ -9794,6 +9815,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9794
9815
  streamAskInSite: (organizationId: string, siteId: string, data: {
9795
9816
  /** @maxLength 512 */
9796
9817
  question: string;
9818
+ /** You may optionally provide additional information about the context of the question. This doesn't affect the scope of the search, but GitBook may use this information to provide a better answer. Generally speaking, you should provide as much context as possible. */
9819
+ context?: {
9820
+ siteSpaceId?: string;
9821
+ };
9797
9822
  scope: SiteSearchScope;
9798
9823
  }, query?: {
9799
9824
  /** Output format for the content. */
package/dist/index.cjs CHANGED
@@ -225,6 +225,7 @@ __export(src_exports, {
225
225
  IntegrationTarget: () => IntegrationTarget,
226
226
  IntegrationVisibility: () => IntegrationVisibility,
227
227
  MemberRole: () => MemberRole,
228
+ OrganizationBlockReason: () => OrganizationBlockReason,
228
229
  OrganizationCommunityType: () => OrganizationCommunityType,
229
230
  OrganizationType: () => OrganizationType,
230
231
  OrganizationUseCase: () => OrganizationUseCase,
@@ -246,7 +247,7 @@ module.exports = __toCommonJS(src_exports);
246
247
 
247
248
  // package.json
248
249
  var name = "@gitbook/api";
249
- var version = "0.80.0";
250
+ var version = "0.81.0";
250
251
 
251
252
  // src/client.ts
252
253
  var import_event_iterator = __toESM(require_node(), 1);
@@ -483,6 +484,10 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
483
484
  BillingProduct2["BusinessDec2021"] = "business_dec_2021";
484
485
  return BillingProduct2;
485
486
  })(BillingProduct || {});
487
+ var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
488
+ OrganizationBlockReason2["Security"] = "security";
489
+ return OrganizationBlockReason2;
490
+ })(OrganizationBlockReason || {});
486
491
  var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
487
492
  IntegrationTarget2["All"] = "all";
488
493
  IntegrationTarget2["Site"] = "site";
@@ -953,7 +958,9 @@ var HttpClient = class {
953
958
  });
954
959
  };
955
960
  streamRequest = ({
961
+ body,
956
962
  path,
963
+ type,
957
964
  baseUrl,
958
965
  cancelToken,
959
966
  secure,
@@ -965,11 +972,17 @@ var HttpClient = class {
965
972
  const requestQuery = params.query;
966
973
  const requestParams = this.mergeRequestParams(params, secureParams);
967
974
  const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
975
+ const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
968
976
  const response = await this.customFetch(
969
977
  `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
970
978
  {
971
979
  ...requestParams,
972
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal
980
+ headers: {
981
+ ...requestParams.headers || {},
982
+ ...type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}
983
+ },
984
+ signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
985
+ body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
973
986
  }
974
987
  );
975
988
  if (!response.ok) {
@@ -3430,6 +3443,7 @@ var GitBookAPI = class extends Api {
3430
3443
  IntegrationTarget,
3431
3444
  IntegrationVisibility,
3432
3445
  MemberRole,
3446
+ OrganizationBlockReason,
3433
3447
  OrganizationCommunityType,
3434
3448
  OrganizationType,
3435
3449
  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.80.0";
175
+ var version = "0.81.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -409,6 +409,10 @@ var BillingProduct = /* @__PURE__ */ ((BillingProduct2) => {
409
409
  BillingProduct2["BusinessDec2021"] = "business_dec_2021";
410
410
  return BillingProduct2;
411
411
  })(BillingProduct || {});
412
+ var OrganizationBlockReason = /* @__PURE__ */ ((OrganizationBlockReason2) => {
413
+ OrganizationBlockReason2["Security"] = "security";
414
+ return OrganizationBlockReason2;
415
+ })(OrganizationBlockReason || {});
412
416
  var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
413
417
  IntegrationTarget2["All"] = "all";
414
418
  IntegrationTarget2["Site"] = "site";
@@ -879,7 +883,9 @@ var HttpClient = class {
879
883
  });
880
884
  };
881
885
  streamRequest = ({
886
+ body,
882
887
  path,
888
+ type,
883
889
  baseUrl,
884
890
  cancelToken,
885
891
  secure,
@@ -891,11 +897,17 @@ var HttpClient = class {
891
897
  const requestQuery = params.query;
892
898
  const requestParams = this.mergeRequestParams(params, secureParams);
893
899
  const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
900
+ const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
894
901
  const response = await this.customFetch(
895
902
  `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
896
903
  {
897
904
  ...requestParams,
898
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal
905
+ headers: {
906
+ ...requestParams.headers || {},
907
+ ...type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}
908
+ },
909
+ signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
910
+ body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
899
911
  }
900
912
  );
901
913
  if (!response.ok) {
@@ -3355,6 +3367,7 @@ export {
3355
3367
  IntegrationTarget,
3356
3368
  IntegrationVisibility,
3357
3369
  MemberRole,
3370
+ OrganizationBlockReason,
3358
3371
  OrganizationCommunityType,
3359
3372
  OrganizationType,
3360
3373
  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.80.0",
7
+ "version": "0.81.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -7357,11 +7357,6 @@
7357
7357
  "organizations",
7358
7358
  "critical"
7359
7359
  ],
7360
- "security": [
7361
- {
7362
- "user": []
7363
- }
7364
- ],
7365
7360
  "parameters": [
7366
7361
  {
7367
7362
  "$ref": "#/components/parameters/organizationId"
@@ -9753,7 +9748,8 @@
9753
9748
  "operationId": "listOrganizationIntegrationsStatus",
9754
9749
  "summary": "List the statuses of all integrations installed in an organization",
9755
9750
  "tags": [
9756
- "integrations"
9751
+ "integrations",
9752
+ "critical"
9757
9753
  ],
9758
9754
  "parameters": [
9759
9755
  {
@@ -11680,6 +11676,9 @@
11680
11676
  "basename": {
11681
11677
  "$ref": "#/components/schemas/SiteBasename"
11682
11678
  },
11679
+ "adaptiveContent": {
11680
+ "$ref": "#/components/schemas/SiteAdaptiveContent"
11681
+ },
11683
11682
  "defaultSiteSpace": {
11684
11683
  "type": "string",
11685
11684
  "description": "ID of the site-space to be used as the default at the root level. If site has sections, this will mark the default site space in the site's default section."
@@ -13304,6 +13303,15 @@
13304
13303
  "type": "string",
13305
13304
  "maxLength": 512
13306
13305
  },
13306
+ "context": {
13307
+ "type": "object",
13308
+ "description": "You may optionally provide additional information about the context of the question. This doesn't affect the scope of the search, but GitBook may use this information to provide a better answer. Generally speaking, you should provide as much context as possible.\n",
13309
+ "properties": {
13310
+ "siteSpaceId": {
13311
+ "type": "string"
13312
+ }
13313
+ }
13314
+ },
13307
13315
  "scope": {
13308
13316
  "$ref": "#/components/schemas/SiteSearchScope"
13309
13317
  }
@@ -20013,7 +20021,8 @@
20013
20021
  }
20014
20022
  },
20015
20023
  "required": [
20016
- "type"
20024
+ "type",
20025
+ "answer"
20017
20026
  ]
20018
20027
  },
20019
20028
  "SearchAIRecommendedQuestionStream": {
@@ -21386,6 +21395,12 @@
21386
21395
  "business_dec_2021"
21387
21396
  ]
21388
21397
  },
21398
+ "OrganizationBlockReason": {
21399
+ "type": "string",
21400
+ "enum": [
21401
+ "security"
21402
+ ]
21403
+ },
21389
21404
  "Organization": {
21390
21405
  "type": "object",
21391
21406
  "properties": {
@@ -21466,6 +21481,37 @@
21466
21481
  "location"
21467
21482
  ]
21468
21483
  },
21484
+ "trialDecision": {
21485
+ "type": "string",
21486
+ "description": "The decision taken by the user at the end of the trial",
21487
+ "enum": [
21488
+ "downgrade"
21489
+ ]
21490
+ },
21491
+ "customHostname": {
21492
+ "description": "Custom hostname linked to this organization",
21493
+ "type": "string"
21494
+ },
21495
+ "blocked": {
21496
+ "type": "object",
21497
+ "description": "If the organization is blocked, information about the block will appear here",
21498
+ "properties": {
21499
+ "reason": {
21500
+ "$ref": "#/components/schemas/OrganizationBlockReason"
21501
+ }
21502
+ },
21503
+ "required": [
21504
+ "reason"
21505
+ ]
21506
+ },
21507
+ "internal_isUsingSnippets": {
21508
+ "type": "boolean",
21509
+ "description": "If true, the organization is still using the deprecated snippets feature."
21510
+ },
21511
+ "internal_isOnNewTrial": {
21512
+ "type": "boolean",
21513
+ "description": "If true, the organization is on the new trial which includes sites and the Pro plan."
21514
+ },
21469
21515
  "permissions": {
21470
21516
  "type": "object",
21471
21517
  "description": "The set of permissions for the organization",
@@ -27288,6 +27334,18 @@
27288
27334
  "visitor-auth"
27289
27335
  ]
27290
27336
  },
27337
+ "SiteAdaptiveContent": {
27338
+ "type": "object",
27339
+ "properties": {
27340
+ "enabled": {
27341
+ "type": "boolean",
27342
+ "description": "Whether adaptive content should be enabled on the site."
27343
+ }
27344
+ },
27345
+ "required": [
27346
+ "enabled"
27347
+ ]
27348
+ },
27291
27349
  "SiteAdsTopic": {
27292
27350
  "type": "string",
27293
27351
  "description": "Topic of the content",
@@ -27415,6 +27473,9 @@
27415
27473
  "type": "string",
27416
27474
  "format": "date-time"
27417
27475
  },
27476
+ "adaptiveContent": {
27477
+ "$ref": "#/components/schemas/SiteAdaptiveContent"
27478
+ },
27418
27479
  "ads": {
27419
27480
  "$ref": "#/components/schemas/SiteAds"
27420
27481
  },
package/spec/openapi.yaml CHANGED
@@ -4056,8 +4056,6 @@ paths:
4056
4056
  tags:
4057
4057
  - organizations
4058
4058
  - critical
4059
- security:
4060
- - user: []
4061
4059
  parameters:
4062
4060
  - $ref: "#/components/parameters/organizationId"
4063
4061
  responses:
@@ -5412,6 +5410,7 @@ paths:
5412
5410
  summary: List the statuses of all integrations installed in an organization
5413
5411
  tags:
5414
5412
  - integrations
5413
+ - critical
5415
5414
  parameters:
5416
5415
  - $ref: "#/components/parameters/organizationId"
5417
5416
  - $ref: "#/components/parameters/listPage"
@@ -6511,6 +6510,8 @@ paths:
6511
6510
  $ref: "#/components/schemas/SiteVisibility"
6512
6511
  basename:
6513
6512
  $ref: "#/components/schemas/SiteBasename"
6513
+ adaptiveContent:
6514
+ $ref: "#/components/schemas/SiteAdaptiveContent"
6514
6515
  defaultSiteSpace:
6515
6516
  type: string
6516
6517
  description: ID of the site-space to be used as the default at the root level. If site has sections, this will mark the default site space in the site's default section.
@@ -7419,6 +7420,13 @@ paths:
7419
7420
  question:
7420
7421
  type: string
7421
7422
  maxLength: 512
7423
+ context:
7424
+ type: object
7425
+ description: |
7426
+ You may optionally provide additional information about the context of the question. This doesn't affect the scope of the search, but GitBook may use this information to provide a better answer. Generally speaking, you should provide as much context as possible.
7427
+ properties:
7428
+ siteSpaceId:
7429
+ type: string
7422
7430
  scope:
7423
7431
  $ref: "#/components/schemas/SiteSearchScope"
7424
7432
  responses:
@@ -11635,6 +11643,7 @@ components:
11635
11643
  $ref: "#/components/schemas/SearchAIAnswer"
11636
11644
  required:
11637
11645
  - type
11646
+ - answer
11638
11647
  SearchAIRecommendedQuestionStream:
11639
11648
  type: object
11640
11649
  properties:
@@ -12588,6 +12597,10 @@ components:
12588
12597
  - team_oct_2019_free
12589
12598
  - team_dec_2021
12590
12599
  - business_dec_2021
12600
+ OrganizationBlockReason:
12601
+ type: string
12602
+ enum:
12603
+ - security
12591
12604
  Organization:
12592
12605
  type: object
12593
12606
  properties:
@@ -12646,6 +12659,28 @@ components:
12646
12659
  required:
12647
12660
  - app
12648
12661
  - location
12662
+ trialDecision:
12663
+ type: string
12664
+ description: The decision taken by the user at the end of the trial
12665
+ enum:
12666
+ - downgrade
12667
+ customHostname:
12668
+ description: Custom hostname linked to this organization
12669
+ type: string
12670
+ blocked:
12671
+ type: object
12672
+ description: If the organization is blocked, information about the block will appear here
12673
+ properties:
12674
+ reason:
12675
+ $ref: "#/components/schemas/OrganizationBlockReason"
12676
+ required:
12677
+ - reason
12678
+ internal_isUsingSnippets:
12679
+ type: boolean
12680
+ description: If true, the organization is still using the deprecated snippets feature.
12681
+ internal_isOnNewTrial:
12682
+ type: boolean
12683
+ description: If true, the organization is on the new trial which includes sites and the Pro plan.
12649
12684
  permissions:
12650
12685
  type: object
12651
12686
  description: The set of permissions for the organization
@@ -16476,6 +16511,14 @@ components:
16476
16511
  - unlisted
16477
16512
  - share-link
16478
16513
  - visitor-auth
16514
+ SiteAdaptiveContent:
16515
+ type: object
16516
+ properties:
16517
+ enabled:
16518
+ type: boolean
16519
+ description: Whether adaptive content should be enabled on the site.
16520
+ required:
16521
+ - enabled
16479
16522
  SiteAdsTopic:
16480
16523
  type: string
16481
16524
  description: Topic of the content
@@ -16560,6 +16603,8 @@ components:
16560
16603
  createdAt:
16561
16604
  type: string
16562
16605
  format: date-time
16606
+ adaptiveContent:
16607
+ $ref: "#/components/schemas/SiteAdaptiveContent"
16563
16608
  ads:
16564
16609
  $ref: "#/components/schemas/SiteAds"
16565
16610
  urls: