@gitbook/api 0.29.0 → 0.31.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
@@ -465,6 +465,8 @@ export interface ContentPosition {
465
465
  before?: SpacePointer | CollectionPointer;
466
466
  after?: SpacePointer | CollectionPointer;
467
467
  }
468
+ /** Default level for a piece of content */
469
+ export declare type DefaultLevel = MemberRoleOrGuest | 'inherit';
468
470
  export declare type Document = MarkdownDocument | {
469
471
  document: JSONDocument;
470
472
  } | object;
@@ -1070,6 +1072,8 @@ export interface Space {
1070
1072
  };
1071
1073
  /** ID of the active revision in the space. */
1072
1074
  revision: string;
1075
+ /** Default level for a piece of content */
1076
+ defaultLevel: DefaultLevel;
1073
1077
  }
1074
1078
  /**
1075
1079
  * Determines how a Space can be edited.
@@ -1448,8 +1452,8 @@ export interface Organization {
1448
1452
  defaultContent?: OrganizationDefaultContent;
1449
1453
  /** Whether SSO is enforced organization wide */
1450
1454
  sso?: boolean;
1451
- /** If true, the organization is configured to use our AI-powered natural language search */
1452
- aiSearch?: boolean;
1455
+ /** If true, the organization is configured to use all our AI features. */
1456
+ ai?: boolean;
1453
1457
  /** If true, the organization is configured to run content audits on any space update */
1454
1458
  aiInsights?: boolean;
1455
1459
  /** URLs associated with the object */
@@ -2004,6 +2008,11 @@ export interface SearchAIAnswer {
2004
2008
  sections: string[];
2005
2009
  }[];
2006
2010
  }
2011
+ export interface SearchAIAnswerStream {
2012
+ type: 'answer';
2013
+ /** Answer from AI for a question asked on a content. */
2014
+ answer?: SearchAIAnswer;
2015
+ }
2007
2016
  export declare type SearchAIAnswerSource = {
2008
2017
  type: 'page' | 'entity' | 'capture';
2009
2018
  } & ({
@@ -2127,6 +2136,8 @@ export interface Collection {
2127
2136
  * @deprecated
2128
2137
  */
2129
2138
  collection?: string;
2139
+ /** Default level for a piece of content */
2140
+ defaultLevel: DefaultLevel;
2130
2141
  /** URLs associated with the object */
2131
2142
  urls: {
2132
2143
  /**
@@ -3105,6 +3116,7 @@ export interface ContentKitButton {
3105
3116
  /** Text input to prompt the user. */
3106
3117
  export interface ContentKitTextInput {
3107
3118
  type: 'textinput';
3119
+ disabled?: boolean;
3108
3120
  /** State binding. The value of the input will be stored as a property in the state named after this ID. */
3109
3121
  state: string;
3110
3122
  /** Text value to initialize the input with. */
@@ -3293,6 +3305,7 @@ export interface ContentKitSelectOption {
3293
3305
  /** Creates a drop down menu with a list of options for a user to choose. */
3294
3306
  export interface ContentKitSelect {
3295
3307
  type: 'select';
3308
+ disabled?: boolean;
3296
3309
  /** State binding. The value of the input will be stored as a property in the state named after this ID. */
3297
3310
  state: string;
3298
3311
  /** Value to initialize the select with. */
@@ -3314,6 +3327,7 @@ export interface ContentKitSelect {
3314
3327
  /** Renders a boolean input. */
3315
3328
  export interface ContentKitSwitch {
3316
3329
  type: 'switch';
3330
+ disabled?: boolean;
3317
3331
  /** State binding. The value of the input will be stored as a property in the state named after this ID. */
3318
3332
  state: string;
3319
3333
  /** Value to initialize the switch with. */
@@ -3334,6 +3348,7 @@ export interface ContentKitCheckbox {
3334
3348
  }
3335
3349
  export interface ContentKitRadio {
3336
3350
  type: 'radio';
3351
+ disabled?: boolean;
3337
3352
  /** State binding. The value of the input will be stored as a property in the state named after this ID. */
3338
3353
  state: string;
3339
3354
  /** Value to store in th state when the checkbox is selected. */
@@ -3856,6 +3871,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
3856
3871
  protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
3857
3872
  abortRequest: (cancelToken: CancelToken) => void;
3858
3873
  request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
3874
+ streamRequest: <T, E>({ path, baseUrl, cancelToken, secure, ...params }: FullRequestParams) => AsyncGenerator<T, void, unknown>;
3859
3875
  }
3860
3876
  /**
3861
3877
  * @title GitBook API
@@ -4010,6 +4026,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4010
4026
  visibility?: ContentVisibility;
4011
4027
  /** The integration property, if set, is ignored. */
4012
4028
  visitorAuth?: any;
4029
+ /** Default level for a piece of content */
4030
+ defaultLevel?: DefaultLevel;
4013
4031
  } & ({
4014
4032
  /** Unicode codepoint or character of the emoji */
4015
4033
  emoji: Emoji;
@@ -4166,6 +4184,19 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4166
4184
  /** Answer from AI for a question asked on a content. */
4167
4185
  answer?: SearchAIAnswer;
4168
4186
  }, Error>>;
4187
+ /**
4188
+ * No description
4189
+ *
4190
+ * @name StreamAskInSpace
4191
+ * @summary Ask a question to an AI within the context of the space and stream the answer as a Server-Sent Events URL.
4192
+ * @request GET:/spaces/{spaceId}/search/ask/stream
4193
+ * @secure
4194
+ */
4195
+ streamAskInSpace: (spaceId: string, query: {
4196
+ query: string;
4197
+ /** Output format for the content. */
4198
+ format?: 'document' | 'markdown';
4199
+ }, params?: RequestParams) => AsyncGenerator<SearchAIAnswerStream, void, unknown>;
4169
4200
  /**
4170
4201
  * No description
4171
4202
  *
@@ -4349,7 +4380,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4349
4380
  * @request GET:/spaces/{spaceId}/documents/{documentId}
4350
4381
  * @secure
4351
4382
  */
4352
- getDocumentById: (spaceId: string, documentId: string, params?: RequestParams) => Promise<HttpResponse<JSONDocument, Error>>;
4383
+ getDocumentById: (spaceId: string, documentId: string, query?: {
4384
+ /** Version of the schema used for the document. */
4385
+ schema?: 'current' | 'next';
4386
+ }, params?: RequestParams) => Promise<HttpResponse<JSONDocument, Error>>;
4353
4387
  /**
4354
4388
  * No description
4355
4389
  *
@@ -5235,6 +5269,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5235
5269
  title?: CollectionTitle;
5236
5270
  /** Description of the collection */
5237
5271
  description?: CollectionDescription;
5272
+ /** Default level for a piece of content */
5273
+ defaultLevel?: DefaultLevel;
5238
5274
  }, params?: RequestParams) => Promise<HttpResponse<Collection, Error>>;
5239
5275
  /**
5240
5276
  * No description
@@ -5893,7 +5929,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5893
5929
  defaultContent?: OrganizationDefaultContent | null;
5894
5930
  logo?: URL | null;
5895
5931
  sso?: boolean;
5896
- aiSearch?: boolean;
5932
+ ai?: boolean;
5897
5933
  aiInsights?: boolean;
5898
5934
  }, params?: RequestParams) => Promise<HttpResponse<Organization, Error | {
5899
5935
  error: {
@@ -6823,6 +6859,19 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6823
6859
  * @secure
6824
6860
  */
6825
6861
  getRecommendedQuestionsInOrganization: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<SearchAIRecommendedQuestions, Error>>;
6862
+ /**
6863
+ * No description
6864
+ *
6865
+ * @name StreamAskInOrganization
6866
+ * @summary Ask a question to an AI across spaces that is accessible by the currently authenticated target and stream the answer as a Server-Sent Events URL.
6867
+ * @request GET:/orgs/{organizationId}/ask/stream
6868
+ * @secure
6869
+ */
6870
+ streamAskInOrganization: (organizationId: string, query: {
6871
+ query: string;
6872
+ /** Output format for the content. */
6873
+ format?: 'document' | 'markdown';
6874
+ }, params?: RequestParams) => AsyncGenerator<SearchAIAnswerStream, void, unknown>;
6826
6875
  /**
6827
6876
  * No description
6828
6877
  *
package/dist/index.cjs CHANGED
@@ -72,7 +72,7 @@ module.exports = __toCommonJS(src_exports);
72
72
 
73
73
  // package.json
74
74
  var name = "@gitbook/api";
75
- var version = "0.29.0";
75
+ var version = "0.31.0";
76
76
 
77
77
  // src/client.ts
78
78
  var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
@@ -497,6 +497,69 @@ var HttpClient = class {
497
497
  return data;
498
498
  });
499
499
  };
500
+ this.streamRequest = async function* ({
501
+ path,
502
+ baseUrl,
503
+ cancelToken,
504
+ secure,
505
+ ...params
506
+ }) {
507
+ const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData, "streaming") || {};
508
+ const { query: requestQuery, ...requestParams } = this.mergeRequestParams(
509
+ params,
510
+ secureParams
511
+ );
512
+ const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
513
+ const eventSource = new EventSource(
514
+ `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`
515
+ );
516
+ try {
517
+ const signal = cancelToken ? this.createAbortSignal(cancelToken) : void 0;
518
+ if (signal) {
519
+ signal.addEventListener("abort", () => {
520
+ eventSource.close();
521
+ });
522
+ }
523
+ let results = [];
524
+ let resolve;
525
+ let reject;
526
+ let promise = new Promise((r, rj) => {
527
+ resolve = r;
528
+ reject = rj;
529
+ });
530
+ let done = false;
531
+ eventSource.onmessage = (event) => {
532
+ if (event.data === "done") {
533
+ done = true;
534
+ resolve();
535
+ } else {
536
+ try {
537
+ const data = JSON.parse(event.data);
538
+ results.push(data);
539
+ } catch (error) {
540
+ return reject(error);
541
+ }
542
+ resolve();
543
+ promise = new Promise((r, rj) => {
544
+ resolve = r;
545
+ reject = rj;
546
+ });
547
+ }
548
+ };
549
+ eventSource.onerror = (error) => {
550
+ reject(error);
551
+ };
552
+ while (!done) {
553
+ await promise;
554
+ for (const result of results) {
555
+ yield result;
556
+ }
557
+ results = [];
558
+ }
559
+ } finally {
560
+ eventSource.close();
561
+ }
562
+ };
500
563
  Object.assign(this, apiConfig);
501
564
  }
502
565
  encodeQueryParam(key, value) {
@@ -689,6 +752,13 @@ var Api = class extends HttpClient {
689
752
  format: "json",
690
753
  ...params
691
754
  }),
755
+ streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
756
+ path: `/spaces/${spaceId}/search/ask/stream`,
757
+ method: "GET",
758
+ query,
759
+ secure: true,
760
+ ...params
761
+ }),
692
762
  getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
693
763
  path: `/spaces/${spaceId}/search/questions`,
694
764
  method: "GET",
@@ -813,9 +883,10 @@ var Api = class extends HttpClient {
813
883
  format: "json",
814
884
  ...params
815
885
  }),
816
- getDocumentById: (spaceId, documentId, params = {}) => this.request({
886
+ getDocumentById: (spaceId, documentId, query, params = {}) => this.request({
817
887
  path: `/spaces/${spaceId}/documents/${documentId}`,
818
888
  method: "GET",
889
+ query,
819
890
  secure: true,
820
891
  format: "json",
821
892
  ...params
@@ -2122,6 +2193,13 @@ var Api = class extends HttpClient {
2122
2193
  format: "json",
2123
2194
  ...params
2124
2195
  }),
2196
+ streamAskInOrganization: (organizationId, query, params = {}) => this.streamRequest({
2197
+ path: `/orgs/${organizationId}/ask/stream`,
2198
+ method: "GET",
2199
+ query,
2200
+ secure: true,
2201
+ ...params
2202
+ }),
2125
2203
  listContentAuditRelations: (organizationId, query, params = {}) => this.request({
2126
2204
  path: `/orgs/${organizationId}/insights/audit-relations`,
2127
2205
  method: "GET",
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@gitbook/api";
3
- var version = "0.29.0";
3
+ var version = "0.31.0";
4
4
 
5
5
  // src/client.ts
6
6
  var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
@@ -425,6 +425,69 @@ var HttpClient = class {
425
425
  return data;
426
426
  });
427
427
  };
428
+ this.streamRequest = async function* ({
429
+ path,
430
+ baseUrl,
431
+ cancelToken,
432
+ secure,
433
+ ...params
434
+ }) {
435
+ const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData, "streaming") || {};
436
+ const { query: requestQuery, ...requestParams } = this.mergeRequestParams(
437
+ params,
438
+ secureParams
439
+ );
440
+ const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
441
+ const eventSource = new EventSource(
442
+ `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`
443
+ );
444
+ try {
445
+ const signal = cancelToken ? this.createAbortSignal(cancelToken) : void 0;
446
+ if (signal) {
447
+ signal.addEventListener("abort", () => {
448
+ eventSource.close();
449
+ });
450
+ }
451
+ let results = [];
452
+ let resolve;
453
+ let reject;
454
+ let promise = new Promise((r, rj) => {
455
+ resolve = r;
456
+ reject = rj;
457
+ });
458
+ let done = false;
459
+ eventSource.onmessage = (event) => {
460
+ if (event.data === "done") {
461
+ done = true;
462
+ resolve();
463
+ } else {
464
+ try {
465
+ const data = JSON.parse(event.data);
466
+ results.push(data);
467
+ } catch (error) {
468
+ return reject(error);
469
+ }
470
+ resolve();
471
+ promise = new Promise((r, rj) => {
472
+ resolve = r;
473
+ reject = rj;
474
+ });
475
+ }
476
+ };
477
+ eventSource.onerror = (error) => {
478
+ reject(error);
479
+ };
480
+ while (!done) {
481
+ await promise;
482
+ for (const result of results) {
483
+ yield result;
484
+ }
485
+ results = [];
486
+ }
487
+ } finally {
488
+ eventSource.close();
489
+ }
490
+ };
428
491
  Object.assign(this, apiConfig);
429
492
  }
430
493
  encodeQueryParam(key, value) {
@@ -617,6 +680,13 @@ var Api = class extends HttpClient {
617
680
  format: "json",
618
681
  ...params
619
682
  }),
683
+ streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
684
+ path: `/spaces/${spaceId}/search/ask/stream`,
685
+ method: "GET",
686
+ query,
687
+ secure: true,
688
+ ...params
689
+ }),
620
690
  getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
621
691
  path: `/spaces/${spaceId}/search/questions`,
622
692
  method: "GET",
@@ -741,9 +811,10 @@ var Api = class extends HttpClient {
741
811
  format: "json",
742
812
  ...params
743
813
  }),
744
- getDocumentById: (spaceId, documentId, params = {}) => this.request({
814
+ getDocumentById: (spaceId, documentId, query, params = {}) => this.request({
745
815
  path: `/spaces/${spaceId}/documents/${documentId}`,
746
816
  method: "GET",
817
+ query,
747
818
  secure: true,
748
819
  format: "json",
749
820
  ...params
@@ -2050,6 +2121,13 @@ var Api = class extends HttpClient {
2050
2121
  format: "json",
2051
2122
  ...params
2052
2123
  }),
2124
+ streamAskInOrganization: (organizationId, query, params = {}) => this.streamRequest({
2125
+ path: `/orgs/${organizationId}/ask/stream`,
2126
+ method: "GET",
2127
+ query,
2128
+ secure: true,
2129
+ ...params
2130
+ }),
2053
2131
  listContentAuditRelations: (organizationId, query, params = {}) => this.request({
2054
2132
  path: `/orgs/${organizationId}/insights/audit-relations`,
2055
2133
  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.29.0",
7
+ "version": "0.31.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -103,6 +103,18 @@
103
103
  ]
104
104
  }
105
105
  },
106
+ "documentSchema": {
107
+ "name": "schema",
108
+ "in": "query",
109
+ "description": "Version of the schema used for the document.",
110
+ "schema": {
111
+ "type": "string",
112
+ "enum": [
113
+ "current",
114
+ "next"
115
+ ]
116
+ }
117
+ },
106
118
  "commentStatus": {
107
119
  "name": "status",
108
120
  "in": "query",
@@ -1578,6 +1590,20 @@
1578
1590
  }
1579
1591
  }
1580
1592
  },
1593
+ "DefaultLevel": {
1594
+ "description": "Default level for a piece of content",
1595
+ "oneOf": [
1596
+ {
1597
+ "$ref": "#/components/schemas/MemberRoleOrGuest"
1598
+ },
1599
+ {
1600
+ "type": "string",
1601
+ "enum": [
1602
+ "inherit"
1603
+ ]
1604
+ }
1605
+ ]
1606
+ },
1581
1607
  "Document": {
1582
1608
  "oneOf": [
1583
1609
  {
@@ -4535,6 +4561,9 @@
4535
4561
  "revision": {
4536
4562
  "type": "string",
4537
4563
  "description": "ID of the active revision in the space."
4564
+ },
4565
+ "defaultLevel": {
4566
+ "$ref": "#/components/schemas/DefaultLevel"
4538
4567
  }
4539
4568
  },
4540
4569
  "required": [
@@ -4548,7 +4577,8 @@
4548
4577
  "revision",
4549
4578
  "createdAt",
4550
4579
  "updatedAt",
4551
- "urls"
4580
+ "urls",
4581
+ "defaultLevel"
4552
4582
  ]
4553
4583
  },
4554
4584
  "SpaceEditMode": {
@@ -5716,8 +5746,8 @@
5716
5746
  "description": "Whether SSO is enforced organization wide",
5717
5747
  "type": "boolean"
5718
5748
  },
5719
- "aiSearch": {
5720
- "description": "If true, the organization is configured to use our AI-powered natural language search",
5749
+ "ai": {
5750
+ "description": "If true, the organization is configured to use all our AI features.",
5721
5751
  "type": "boolean"
5722
5752
  },
5723
5753
  "aiInsights": {
@@ -7215,6 +7245,23 @@
7215
7245
  "followupQuestions"
7216
7246
  ]
7217
7247
  },
7248
+ "SearchAIAnswerStream": {
7249
+ "type": "object",
7250
+ "properties": {
7251
+ "type": {
7252
+ "type": "string",
7253
+ "enum": [
7254
+ "answer"
7255
+ ]
7256
+ },
7257
+ "answer": {
7258
+ "$ref": "#/components/schemas/SearchAIAnswer"
7259
+ }
7260
+ },
7261
+ "required": [
7262
+ "type"
7263
+ ]
7264
+ },
7218
7265
  "SearchAIAnswerSource": {
7219
7266
  "allOf": [
7220
7267
  {
@@ -7564,6 +7611,9 @@
7564
7611
  "deprecated": true,
7565
7612
  "description": "ID of the parent collection, if any"
7566
7613
  },
7614
+ "defaultLevel": {
7615
+ "$ref": "#/components/schemas/DefaultLevel"
7616
+ },
7567
7617
  "urls": {
7568
7618
  "type": "object",
7569
7619
  "description": "URLs associated with the object",
@@ -7591,7 +7641,8 @@
7591
7641
  "title",
7592
7642
  "organization",
7593
7643
  "visibility",
7594
- "urls"
7644
+ "urls",
7645
+ "defaultLevel"
7595
7646
  ]
7596
7647
  },
7597
7648
  "CollectionTitle": {
@@ -10437,6 +10488,9 @@
10437
10488
  "textinput"
10438
10489
  ]
10439
10490
  },
10491
+ "disabled": {
10492
+ "type": "boolean"
10493
+ },
10440
10494
  "state": {
10441
10495
  "description": "State binding. The value of the input will be stored as a property in the state named after this ID.",
10442
10496
  "type": "string"
@@ -11231,6 +11285,9 @@
11231
11285
  "select"
11232
11286
  ]
11233
11287
  },
11288
+ "disabled": {
11289
+ "type": "boolean"
11290
+ },
11234
11291
  "state": {
11235
11292
  "description": "State binding. The value of the input will be stored as a property in the state named after this ID.",
11236
11293
  "type": "string"
@@ -11312,6 +11369,9 @@
11312
11369
  "switch"
11313
11370
  ]
11314
11371
  },
11372
+ "disabled": {
11373
+ "type": "boolean"
11374
+ },
11315
11375
  "state": {
11316
11376
  "description": "State binding. The value of the input will be stored as a property in the state named after this ID.",
11317
11377
  "type": "string"
@@ -11375,6 +11435,9 @@
11375
11435
  "radio"
11376
11436
  ]
11377
11437
  },
11438
+ "disabled": {
11439
+ "type": "boolean"
11440
+ },
11378
11441
  "state": {
11379
11442
  "description": "State binding. The value of the input will be stored as a property in the state named after this ID.",
11380
11443
  "type": "string"
@@ -13641,6 +13704,9 @@
13641
13704
  "visitorAuth": {
13642
13705
  "$ref": "#/components/schemas/Space/properties/visitorAuth",
13643
13706
  "description": "The integration property, if set, is ignored."
13707
+ },
13708
+ "defaultLevel": {
13709
+ "$ref": "#/components/schemas/DefaultLevel"
13644
13710
  }
13645
13711
  }
13646
13712
  },
@@ -14121,6 +14187,43 @@
14121
14187
  }
14122
14188
  }
14123
14189
  },
14190
+ "/spaces/{spaceId}/search/ask/stream": {
14191
+ "get": {
14192
+ "operationId": "streamAskInSpace",
14193
+ "summary": "Ask a question to an AI within the context of the space and stream the answer as a Server-Sent Events URL.",
14194
+ "parameters": [
14195
+ {
14196
+ "$ref": "#/components/parameters/spaceId"
14197
+ },
14198
+ {
14199
+ "name": "query",
14200
+ "in": "query",
14201
+ "required": true,
14202
+ "schema": {
14203
+ "type": "string"
14204
+ }
14205
+ },
14206
+ {
14207
+ "$ref": "#/components/parameters/pageFormat"
14208
+ }
14209
+ ],
14210
+ "responses": {
14211
+ "200": {
14212
+ "description": "OK",
14213
+ "content": {
14214
+ "text/event-stream": {
14215
+ "schema": {
14216
+ "$ref": "#/components/schemas/SearchAIAnswerStream"
14217
+ }
14218
+ }
14219
+ }
14220
+ },
14221
+ "default": {
14222
+ "$ref": "#/components/responses/UnexpectedError"
14223
+ }
14224
+ }
14225
+ }
14226
+ },
14124
14227
  "/spaces/{spaceId}/search/questions": {
14125
14228
  "get": {
14126
14229
  "operationId": "getRecommendedQuestionsInSpace",
@@ -14779,6 +14882,9 @@
14779
14882
  "schema": {
14780
14883
  "type": "string"
14781
14884
  }
14885
+ },
14886
+ {
14887
+ "$ref": "#/components/parameters/documentSchema"
14782
14888
  }
14783
14889
  ],
14784
14890
  "responses": {
@@ -17821,6 +17927,9 @@
17821
17927
  },
17822
17928
  "description": {
17823
17929
  "$ref": "#/components/schemas/CollectionDescription"
17930
+ },
17931
+ "defaultLevel": {
17932
+ "$ref": "#/components/schemas/DefaultLevel"
17824
17933
  }
17825
17934
  }
17826
17935
  }
@@ -19711,7 +19820,7 @@
19711
19820
  "sso": {
19712
19821
  "type": "boolean"
19713
19822
  },
19714
- "aiSearch": {
19823
+ "ai": {
19715
19824
  "type": "boolean"
19716
19825
  },
19717
19826
  "aiInsights": {
@@ -23040,6 +23149,48 @@
23040
23149
  }
23041
23150
  }
23042
23151
  },
23152
+ "/orgs/{organizationId}/ask/stream": {
23153
+ "get": {
23154
+ "operationId": "streamAskInOrganization",
23155
+ "summary": "Ask a question to an AI across spaces that is accessible by the currently authenticated target and stream the answer as a Server-Sent Events URL.",
23156
+ "security": [
23157
+ {
23158
+ "user": []
23159
+ }
23160
+ ],
23161
+ "parameters": [
23162
+ {
23163
+ "$ref": "#/components/parameters/organizationId"
23164
+ },
23165
+ {
23166
+ "name": "query",
23167
+ "in": "query",
23168
+ "required": true,
23169
+ "schema": {
23170
+ "type": "string"
23171
+ }
23172
+ },
23173
+ {
23174
+ "$ref": "#/components/parameters/pageFormat"
23175
+ }
23176
+ ],
23177
+ "responses": {
23178
+ "200": {
23179
+ "description": "OK",
23180
+ "content": {
23181
+ "text/event-stream": {
23182
+ "schema": {
23183
+ "$ref": "#/components/schemas/SearchAIAnswerStream"
23184
+ }
23185
+ }
23186
+ }
23187
+ },
23188
+ "default": {
23189
+ "$ref": "#/components/responses/UnexpectedError"
23190
+ }
23191
+ }
23192
+ }
23193
+ },
23043
23194
  "/orgs/{organizationId}/insights/audit-relations": {
23044
23195
  "get": {
23045
23196
  "operationId": "listContentAuditRelations",
package/spec/openapi.yaml CHANGED
@@ -68,6 +68,15 @@ components:
68
68
  enum:
69
69
  - document
70
70
  - markdown
71
+ documentSchema:
72
+ name: schema
73
+ in: query
74
+ description: Version of the schema used for the document.
75
+ schema:
76
+ type: string
77
+ enum:
78
+ - current
79
+ - next
71
80
  commentStatus:
72
81
  name: status
73
82
  in: query
@@ -1121,6 +1130,13 @@ components:
1121
1130
  oneOf:
1122
1131
  - $ref: "#/components/schemas/SpacePointer"
1123
1132
  - $ref: "#/components/schemas/CollectionPointer"
1133
+ DefaultLevel:
1134
+ description: Default level for a piece of content
1135
+ oneOf:
1136
+ - $ref: "#/components/schemas/MemberRoleOrGuest"
1137
+ - type: string
1138
+ enum:
1139
+ - inherit
1124
1140
  Document:
1125
1141
  oneOf:
1126
1142
  - $ref: "#/components/schemas/MarkdownDocument"
@@ -2973,6 +2989,8 @@ components:
2973
2989
  revision:
2974
2990
  type: string
2975
2991
  description: ID of the active revision in the space.
2992
+ defaultLevel:
2993
+ $ref: "#/components/schemas/DefaultLevel"
2976
2994
  required:
2977
2995
  - object
2978
2996
  - id
@@ -2985,6 +3003,7 @@ components:
2985
3003
  - createdAt
2986
3004
  - updatedAt
2987
3005
  - urls
3006
+ - defaultLevel
2988
3007
  SpaceEditMode:
2989
3008
  type: string
2990
3009
  description: |
@@ -3751,8 +3770,8 @@ components:
3751
3770
  sso:
3752
3771
  description: Whether SSO is enforced organization wide
3753
3772
  type: boolean
3754
- aiSearch:
3755
- description: If true, the organization is configured to use our AI-powered natural language search
3773
+ ai:
3774
+ description: If true, the organization is configured to use all our AI features.
3756
3775
  type: boolean
3757
3776
  aiInsights:
3758
3777
  description: If true, the organization is configured to run content audits on any space update
@@ -4786,6 +4805,17 @@ components:
4786
4805
  - pages
4787
4806
  - sources
4788
4807
  - followupQuestions
4808
+ SearchAIAnswerStream:
4809
+ type: object
4810
+ properties:
4811
+ type:
4812
+ type: string
4813
+ enum:
4814
+ - answer
4815
+ answer:
4816
+ $ref: "#/components/schemas/SearchAIAnswer"
4817
+ required:
4818
+ - type
4789
4819
  SearchAIAnswerSource:
4790
4820
  allOf:
4791
4821
  - type: object
@@ -5030,6 +5060,8 @@ components:
5030
5060
  type: string
5031
5061
  deprecated: true
5032
5062
  description: ID of the parent collection, if any
5063
+ defaultLevel:
5064
+ $ref: "#/components/schemas/DefaultLevel"
5033
5065
  urls:
5034
5066
  type: object
5035
5067
  description: URLs associated with the object
@@ -5052,6 +5084,7 @@ components:
5052
5084
  - organization
5053
5085
  - visibility
5054
5086
  - urls
5087
+ - defaultLevel
5055
5088
  CollectionTitle:
5056
5089
  type: string
5057
5090
  description: Title of the collection
@@ -6947,6 +6980,8 @@ components:
6947
6980
  type: string
6948
6981
  enum:
6949
6982
  - textinput
6983
+ disabled:
6984
+ type: boolean
6950
6985
  state:
6951
6986
  description: State binding. The value of the input will be stored as a property in the state named after this ID.
6952
6987
  type: string
@@ -7450,6 +7485,8 @@ components:
7450
7485
  type: string
7451
7486
  enum:
7452
7487
  - select
7488
+ disabled:
7489
+ type: boolean
7453
7490
  state:
7454
7491
  description: State binding. The value of the input will be stored as a property in the state named after this ID.
7455
7492
  type: string
@@ -7499,6 +7536,8 @@ components:
7499
7536
  type: string
7500
7537
  enum:
7501
7538
  - switch
7539
+ disabled:
7540
+ type: boolean
7502
7541
  state:
7503
7542
  description: State binding. The value of the input will be stored as a property in the state named after this ID.
7504
7543
  type: string
@@ -7540,6 +7579,8 @@ components:
7540
7579
  type: string
7541
7580
  enum:
7542
7581
  - radio
7582
+ disabled:
7583
+ type: boolean
7543
7584
  state:
7544
7585
  description: State binding. The value of the input will be stored as a property in the state named after this ID.
7545
7586
  type: string
@@ -8976,6 +9017,8 @@ paths:
8976
9017
  visitorAuth:
8977
9018
  $ref: "#/components/schemas/Space/properties/visitorAuth"
8978
9019
  description: The integration property, if set, is ignored.
9020
+ defaultLevel:
9021
+ $ref: "#/components/schemas/DefaultLevel"
8979
9022
  - oneOf:
8980
9023
  - type: object
8981
9024
  title: Emoji
@@ -9249,6 +9292,27 @@ paths:
9249
9292
  $ref: "#/components/schemas/SearchAIAnswer"
9250
9293
  default:
9251
9294
  $ref: "#/components/responses/UnexpectedError"
9295
+ "/spaces/{spaceId}/search/ask/stream":
9296
+ get:
9297
+ operationId: streamAskInSpace
9298
+ summary: Ask a question to an AI within the context of the space and stream the answer as a Server-Sent Events URL.
9299
+ parameters:
9300
+ - $ref: "#/components/parameters/spaceId"
9301
+ - name: query
9302
+ in: query
9303
+ required: true
9304
+ schema:
9305
+ type: string
9306
+ - $ref: "#/components/parameters/pageFormat"
9307
+ responses:
9308
+ "200":
9309
+ description: OK
9310
+ content:
9311
+ text/event-stream:
9312
+ schema:
9313
+ $ref: "#/components/schemas/SearchAIAnswerStream"
9314
+ default:
9315
+ $ref: "#/components/responses/UnexpectedError"
9252
9316
  "/spaces/{spaceId}/search/questions":
9253
9317
  get:
9254
9318
  operationId: getRecommendedQuestionsInSpace
@@ -9617,6 +9681,7 @@ paths:
9617
9681
  description: ID of the document in the space
9618
9682
  schema:
9619
9683
  type: string
9684
+ - $ref: "#/components/parameters/documentSchema"
9620
9685
  responses:
9621
9686
  "200":
9622
9687
  description: Document
@@ -11267,6 +11332,8 @@ paths:
11267
11332
  $ref: "#/components/schemas/CollectionTitle"
11268
11333
  description:
11269
11334
  $ref: "#/components/schemas/CollectionDescription"
11335
+ defaultLevel:
11336
+ $ref: "#/components/schemas/DefaultLevel"
11270
11337
  responses:
11271
11338
  "200":
11272
11339
  description: The collection has been updated
@@ -12340,7 +12407,7 @@ paths:
12340
12407
  - null
12341
12408
  sso:
12342
12409
  type: boolean
12343
- aiSearch:
12410
+ ai:
12344
12411
  type: boolean
12345
12412
  aiInsights:
12346
12413
  type: boolean
@@ -14215,6 +14282,29 @@ paths:
14215
14282
  $ref: "#/components/schemas/SearchAIRecommendedQuestions"
14216
14283
  default:
14217
14284
  $ref: "#/components/responses/UnexpectedError"
14285
+ "/orgs/{organizationId}/ask/stream":
14286
+ get:
14287
+ operationId: streamAskInOrganization
14288
+ summary: Ask a question to an AI across spaces that is accessible by the currently authenticated target and stream the answer as a Server-Sent Events URL.
14289
+ security:
14290
+ - user: []
14291
+ parameters:
14292
+ - $ref: "#/components/parameters/organizationId"
14293
+ - name: query
14294
+ in: query
14295
+ required: true
14296
+ schema:
14297
+ type: string
14298
+ - $ref: "#/components/parameters/pageFormat"
14299
+ responses:
14300
+ "200":
14301
+ description: OK
14302
+ content:
14303
+ text/event-stream:
14304
+ schema:
14305
+ $ref: "#/components/schemas/SearchAIAnswerStream"
14306
+ default:
14307
+ $ref: "#/components/responses/UnexpectedError"
14218
14308
  "/orgs/{organizationId}/insights/audit-relations":
14219
14309
  get:
14220
14310
  operationId: listContentAuditRelations