@gitbook/api 0.22.0 → 0.23.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
@@ -1868,7 +1868,9 @@ export interface SearchAIQuery {
1868
1868
  }
1869
1869
  /** Answer from AI for a question asked on a content. */
1870
1870
  export interface SearchAIAnswer {
1871
+ /** @deprecated */
1871
1872
  text: string;
1873
+ answer: Document;
1872
1874
  followupQuestions: string[];
1873
1875
  /** The sources used to generate the answer. */
1874
1876
  sources: SearchAIAnswerSource[];
@@ -3728,6 +3730,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3728
3730
  */
3729
3731
  askQueryWithGet: (query: {
3730
3732
  query: string;
3733
+ /** Output format for the content. */
3734
+ format?: 'document' | 'markdown';
3731
3735
  }, params?: RequestParams) => Promise<HttpResponse<{
3732
3736
  /** Answer from AI for a question asked on a content. */
3733
3737
  answer?: SearchAIAnswer;
@@ -3740,7 +3744,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3740
3744
  * @request POST:/search/ask
3741
3745
  * @secure
3742
3746
  */
3743
- askQuery: (data: SearchAIQuery, params?: RequestParams) => Promise<HttpResponse<{
3747
+ askQuery: (data: SearchAIQuery, query?: {
3748
+ /** Output format for the content. */
3749
+ format?: 'document' | 'markdown';
3750
+ }, params?: RequestParams) => Promise<HttpResponse<{
3744
3751
  /** Answer from AI for a question asked on a content. */
3745
3752
  answer?: SearchAIAnswer;
3746
3753
  }, Error>>;
@@ -3885,6 +3892,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3885
3892
  */
3886
3893
  askQueryInSpaceWithGet: (spaceId: string, query: {
3887
3894
  query: string;
3895
+ /** Output format for the content. */
3896
+ format?: 'document' | 'markdown';
3888
3897
  }, params?: RequestParams) => Promise<HttpResponse<{
3889
3898
  /** Answer from AI for a question asked on a content. */
3890
3899
  answer?: SearchAIAnswer;
@@ -3897,7 +3906,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3897
3906
  * @request POST:/spaces/{spaceId}/search/ask
3898
3907
  * @secure
3899
3908
  */
3900
- askQueryInSpace: (spaceId: string, data: SearchAIQuery, params?: RequestParams) => Promise<HttpResponse<{
3909
+ askQueryInSpace: (spaceId: string, data: SearchAIQuery, query?: {
3910
+ /** Output format for the content. */
3911
+ format?: 'document' | 'markdown';
3912
+ }, params?: RequestParams) => Promise<HttpResponse<{
3901
3913
  /** Answer from AI for a question asked on a content. */
3902
3914
  answer?: SearchAIAnswer;
3903
3915
  }, Error>>;
@@ -6349,7 +6361,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6349
6361
  * @request POST:/orgs/{organizationId}/ask
6350
6362
  * @secure
6351
6363
  */
6352
- askInOrganization: (organizationId: string, data: SearchAIQuery, params?: RequestParams) => Promise<HttpResponse<{
6364
+ askInOrganization: (organizationId: string, data: SearchAIQuery, query?: {
6365
+ /** Output format for the content. */
6366
+ format?: 'document' | 'markdown';
6367
+ }, params?: RequestParams) => Promise<HttpResponse<{
6353
6368
  /** Answer from AI for a question asked on a content. */
6354
6369
  answer?: SearchAIAnswer;
6355
6370
  }, Error>>;
package/dist/index.cjs CHANGED
@@ -537,9 +537,10 @@ var Api = class extends HttpClient {
537
537
  format: "json",
538
538
  ...params
539
539
  }),
540
- askQuery: (data, params = {}) => this.request({
540
+ askQuery: (data, query, params = {}) => this.request({
541
541
  path: `/search/ask`,
542
542
  method: "POST",
543
+ query,
543
544
  body: data,
544
545
  secure: true,
545
546
  type: "application/json" /* Json */,
@@ -634,9 +635,10 @@ var Api = class extends HttpClient {
634
635
  format: "json",
635
636
  ...params
636
637
  }),
637
- askQueryInSpace: (spaceId, data, params = {}) => this.request({
638
+ askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
638
639
  path: `/spaces/${spaceId}/search/ask`,
639
640
  method: "POST",
641
+ query,
640
642
  body: data,
641
643
  secure: true,
642
644
  type: "application/json" /* Json */,
@@ -1968,9 +1970,10 @@ var Api = class extends HttpClient {
1968
1970
  format: "json",
1969
1971
  ...params
1970
1972
  }),
1971
- askInOrganization: (organizationId, data, params = {}) => this.request({
1973
+ askInOrganization: (organizationId, data, query, params = {}) => this.request({
1972
1974
  path: `/orgs/${organizationId}/ask`,
1973
1975
  method: "POST",
1976
+ query,
1974
1977
  body: data,
1975
1978
  secure: true,
1976
1979
  type: "application/json" /* Json */,
package/dist/index.js CHANGED
@@ -468,9 +468,10 @@ var Api = class extends HttpClient {
468
468
  format: "json",
469
469
  ...params
470
470
  }),
471
- askQuery: (data, params = {}) => this.request({
471
+ askQuery: (data, query, params = {}) => this.request({
472
472
  path: `/search/ask`,
473
473
  method: "POST",
474
+ query,
474
475
  body: data,
475
476
  secure: true,
476
477
  type: "application/json" /* Json */,
@@ -565,9 +566,10 @@ var Api = class extends HttpClient {
565
566
  format: "json",
566
567
  ...params
567
568
  }),
568
- askQueryInSpace: (spaceId, data, params = {}) => this.request({
569
+ askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
569
570
  path: `/spaces/${spaceId}/search/ask`,
570
571
  method: "POST",
572
+ query,
571
573
  body: data,
572
574
  secure: true,
573
575
  type: "application/json" /* Json */,
@@ -1899,9 +1901,10 @@ var Api = class extends HttpClient {
1899
1901
  format: "json",
1900
1902
  ...params
1901
1903
  }),
1902
- askInOrganization: (organizationId, data, params = {}) => this.request({
1904
+ askInOrganization: (organizationId, data, query, params = {}) => this.request({
1903
1905
  path: `/orgs/${organizationId}/ask`,
1904
1906
  method: "POST",
1907
+ query,
1905
1908
  body: data,
1906
1909
  secure: true,
1907
1910
  type: "application/json" /* Json */,
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.22.0",
7
+ "version": "0.23.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -6821,8 +6821,12 @@
6821
6821
  "description": "Answer from AI for a question asked on a content.",
6822
6822
  "properties": {
6823
6823
  "text": {
6824
+ "deprecated": true,
6824
6825
  "type": "string"
6825
6826
  },
6827
+ "answer": {
6828
+ "$ref": "#/components/schemas/Document"
6829
+ },
6826
6830
  "followupQuestions": {
6827
6831
  "type": "array",
6828
6832
  "items": {
@@ -6870,6 +6874,7 @@
6870
6874
  },
6871
6875
  "required": [
6872
6876
  "text",
6877
+ "answer",
6873
6878
  "pages",
6874
6879
  "sources",
6875
6880
  "followupQuestions"
@@ -12841,6 +12846,9 @@
12841
12846
  "schema": {
12842
12847
  "type": "string"
12843
12848
  }
12849
+ },
12850
+ {
12851
+ "$ref": "#/components/parameters/pageFormat"
12844
12852
  }
12845
12853
  ],
12846
12854
  "responses": {
@@ -12872,6 +12880,11 @@
12872
12880
  "user": []
12873
12881
  }
12874
12882
  ],
12883
+ "parameters": [
12884
+ {
12885
+ "$ref": "#/components/parameters/pageFormat"
12886
+ }
12887
+ ],
12875
12888
  "requestBody": {
12876
12889
  "required": true,
12877
12890
  "content": {
@@ -13311,6 +13324,9 @@
13311
13324
  },
13312
13325
  {
13313
13326
  "$ref": "#/components/parameters/spaceId"
13327
+ },
13328
+ {
13329
+ "$ref": "#/components/parameters/pageFormat"
13314
13330
  }
13315
13331
  ],
13316
13332
  "responses": {
@@ -13340,6 +13356,9 @@
13340
13356
  "parameters": [
13341
13357
  {
13342
13358
  "$ref": "#/components/parameters/spaceId"
13359
+ },
13360
+ {
13361
+ "$ref": "#/components/parameters/pageFormat"
13343
13362
  }
13344
13363
  ],
13345
13364
  "requestBody": {
@@ -21631,6 +21650,9 @@
21631
21650
  "parameters": [
21632
21651
  {
21633
21652
  "$ref": "#/components/parameters/organizationId"
21653
+ },
21654
+ {
21655
+ "$ref": "#/components/parameters/pageFormat"
21634
21656
  }
21635
21657
  ],
21636
21658
  "requestBody": {
package/spec/openapi.yaml CHANGED
@@ -4503,7 +4503,10 @@ components:
4503
4503
  description: Answer from AI for a question asked on a content.
4504
4504
  properties:
4505
4505
  text:
4506
+ deprecated: true
4506
4507
  type: string
4508
+ answer:
4509
+ $ref: "#/components/schemas/Document"
4507
4510
  followupQuestions:
4508
4511
  type: array
4509
4512
  items:
@@ -4537,6 +4540,7 @@ components:
4537
4540
  - sections
4538
4541
  required:
4539
4542
  - text
4543
+ - answer
4540
4544
  - pages
4541
4545
  - sources
4542
4546
  - followupQuestions
@@ -8437,6 +8441,7 @@ paths:
8437
8441
  required: true
8438
8442
  schema:
8439
8443
  type: string
8444
+ - $ref: "#/components/parameters/pageFormat"
8440
8445
  responses:
8441
8446
  "200":
8442
8447
  description: OK
@@ -8454,6 +8459,8 @@ paths:
8454
8459
  summary: Ask a question to an AI across spaces that is accessible by the currently authenticated target.
8455
8460
  security:
8456
8461
  - user: []
8462
+ parameters:
8463
+ - $ref: "#/components/parameters/pageFormat"
8457
8464
  requestBody:
8458
8465
  required: true
8459
8466
  content:
@@ -8710,6 +8717,7 @@ paths:
8710
8717
  schema:
8711
8718
  type: string
8712
8719
  - $ref: "#/components/parameters/spaceId"
8720
+ - $ref: "#/components/parameters/pageFormat"
8713
8721
  responses:
8714
8722
  "200":
8715
8723
  description: OK
@@ -8727,6 +8735,7 @@ paths:
8727
8735
  summary: Ask a question to an AI within the context of the space.
8728
8736
  parameters:
8729
8737
  - $ref: "#/components/parameters/spaceId"
8738
+ - $ref: "#/components/parameters/pageFormat"
8730
8739
  requestBody:
8731
8740
  required: true
8732
8741
  content:
@@ -13331,6 +13340,7 @@ paths:
13331
13340
  - user: []
13332
13341
  parameters:
13333
13342
  - $ref: "#/components/parameters/organizationId"
13343
+ - $ref: "#/components/parameters/pageFormat"
13334
13344
  requestBody:
13335
13345
  required: true
13336
13346
  content: