@botpress/client 0.30.1 → 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/index.d.ts CHANGED
@@ -1333,6 +1333,68 @@ type DeleteUserInput = DeleteUserRequestBody & DeleteUserRequestHeaders & Delete
1333
1333
  interface DeleteUserResponse {
1334
1334
  }
1335
1335
 
1336
+ interface SetStateExpiryRequestHeaders {
1337
+ }
1338
+ interface SetStateExpiryRequestQuery {
1339
+ }
1340
+ interface SetStateExpiryRequestParams {
1341
+ type: "conversation" | "user" | "bot" | "integration" | "task";
1342
+ id: string;
1343
+ name: string;
1344
+ }
1345
+ interface SetStateExpiryRequestBody {
1346
+ /**
1347
+ * Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.
1348
+ */
1349
+ expiry: number | null;
1350
+ }
1351
+ type SetStateExpiryInput = SetStateExpiryRequestBody & SetStateExpiryRequestHeaders & SetStateExpiryRequestQuery & SetStateExpiryRequestParams;
1352
+ interface SetStateExpiryResponse {
1353
+ /**
1354
+ * The state object represents the current payload. A state is always linked to either a bot, a conversation or a user.
1355
+ */
1356
+ state: {
1357
+ /**
1358
+ * Id of the [State](#schema_state)
1359
+ */
1360
+ id: string;
1361
+ /**
1362
+ * Creation date of the [State](#schema_state) in ISO 8601 format
1363
+ */
1364
+ createdAt: string;
1365
+ /**
1366
+ * Updating date of the [State](#schema_state) in ISO 8601 format
1367
+ */
1368
+ updatedAt: string;
1369
+ /**
1370
+ * Id of the [Bot](#schema_bot)
1371
+ */
1372
+ botId: string;
1373
+ /**
1374
+ * Id of the [Conversation](#schema_conversation)
1375
+ */
1376
+ conversationId?: string;
1377
+ /**
1378
+ * Id of the [User](#schema_user)
1379
+ */
1380
+ userId?: string;
1381
+ /**
1382
+ * Name of the [State](#schema_state) which is declared inside the bot definition
1383
+ */
1384
+ name: string;
1385
+ /**
1386
+ * Type of the [State](#schema_state) represents the resource type (`conversation`, `user`, `bot`, `task` or `integration`) that the state is related to
1387
+ */
1388
+ type: "conversation" | "user" | "bot" | "task" | "integration";
1389
+ /**
1390
+ * Payload is the content of the state defined by your bot.
1391
+ */
1392
+ payload: {
1393
+ [k: string]: any;
1394
+ };
1395
+ };
1396
+ }
1397
+
1336
1398
  interface GetStateRequestHeaders {
1337
1399
  }
1338
1400
  interface GetStateRequestQuery {
@@ -1413,7 +1475,7 @@ interface SetStateRequestBody {
1413
1475
  /**
1414
1476
  * Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.
1415
1477
  */
1416
- expiry?: number;
1478
+ expiry?: number | null;
1417
1479
  }
1418
1480
  type SetStateInput = SetStateRequestBody & SetStateRequestHeaders & SetStateRequestQuery & SetStateRequestParams;
1419
1481
  interface SetStateResponse {
@@ -1481,7 +1543,7 @@ interface GetOrSetStateRequestBody {
1481
1543
  /**
1482
1544
  * Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.
1483
1545
  */
1484
- expiry?: number;
1546
+ expiry?: number | null;
1485
1547
  }
1486
1548
  type GetOrSetStateInput = GetOrSetStateRequestBody & GetOrSetStateRequestHeaders & GetOrSetStateRequestQuery & GetOrSetStateRequestParams;
1487
1549
  interface GetOrSetStateResponse {
@@ -5106,7 +5168,7 @@ interface GetAuditRecordsResponse {
5106
5168
  resourceId: string | null;
5107
5169
  resourceName?: string | null;
5108
5170
  value?: string | null;
5109
- action: "UNKNOWN" | "ADD_WORKSPACE_MEMBER" | "REMOVE_WORKSPACE_MEMBER" | "UPDATE_WORKSPACE_MEMBER" | "CLOSE_WORKSPACE" | "CREATE_BOT" | "CREATE_WORKSPACE" | "DELETE_BOT" | "DEPLOY_BOT" | "TRANSFER_BOT" | "DOWNLOAD_BOT_ARCHIVE" | "UPDATE_BOT" | "UPDATE_BOT_CHANNEL" | "UPDATE_BOT_CONFIG" | "UPDATE_PAYMENT_METHOD" | "UPDATE_WORKSPACE" | "SET_SPENDING_LIMIT" | "SET_AI_SPENDING_LIMIT";
5171
+ action: "UNKNOWN" | "ADD_WORKSPACE_MEMBER" | "REMOVE_WORKSPACE_MEMBER" | "UPDATE_WORKSPACE_MEMBER" | "CLOSE_WORKSPACE" | "CREATE_BOT" | "CREATE_WORKSPACE" | "DELETE_BOT" | "DEPLOY_BOT" | "TRANSFER_BOT" | "DOWNLOAD_BOT_ARCHIVE" | "UPDATE_BOT" | "UPDATE_BOT_CHANNEL" | "UPDATE_BOT_CONFIG" | "UPDATE_PAYMENT_METHOD" | "UPDATE_WORKSPACE" | "SET_SPENDING_LIMIT" | "SET_AI_SPENDING_LIMIT" | "UPDATE_WORKSPACE_BILLING_READONLY";
5110
5172
  }[];
5111
5173
  meta: {
5112
5174
  /**
@@ -8537,6 +8599,7 @@ interface SearchFilesRequestQuery {
8537
8599
  query: string;
8538
8600
  contextDepth?: number;
8539
8601
  limit?: number;
8602
+ consolidate?: boolean;
8540
8603
  includeBreadcrumb?: boolean;
8541
8604
  }
8542
8605
  interface SearchFilesRequestParams {
@@ -8561,7 +8624,7 @@ interface SearchFilesResponse {
8561
8624
  /**
8562
8625
  * The type of passage
8563
8626
  */
8564
- type?: "chunk";
8627
+ type?: "chunk" | "summary" | "consolidated";
8565
8628
  /**
8566
8629
  * The subtype of passage, if available.
8567
8630
  */
@@ -8635,7 +8698,7 @@ interface ListFilePassagesResponse {
8635
8698
  /**
8636
8699
  * The type of passage
8637
8700
  */
8638
- type?: "chunk";
8701
+ type?: "chunk" | "summary" | "consolidated";
8639
8702
  /**
8640
8703
  * The subtype of passage, if available.
8641
8704
  */
@@ -8695,10 +8758,31 @@ interface ListTablesResponse {
8695
8758
  */
8696
8759
  properties: {
8697
8760
  [k: string]: {
8698
- type: "string" | "number" | "boolean" | "object" | "null";
8761
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8699
8762
  format?: "date-time";
8700
8763
  description?: string;
8764
+ /**
8765
+ * String properties must match this pattern
8766
+ */
8767
+ pattern?: string;
8768
+ /**
8769
+ * String properties must be one of these values
8770
+ */
8771
+ enum?: string[];
8772
+ /**
8773
+ * Defines the shape of items in an array
8774
+ */
8775
+ items?: {
8776
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8777
+ [k: string]: any;
8778
+ };
8701
8779
  nullable?: boolean;
8780
+ properties?: {
8781
+ [k: string]: {
8782
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8783
+ [k: string]: any;
8784
+ };
8785
+ };
8702
8786
  "x-zui": {
8703
8787
  index: number;
8704
8788
  /**
@@ -8815,10 +8899,31 @@ interface GetTableResponse {
8815
8899
  */
8816
8900
  properties: {
8817
8901
  [k: string]: {
8818
- type: "string" | "number" | "boolean" | "object" | "null";
8902
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8819
8903
  format?: "date-time";
8820
8904
  description?: string;
8905
+ /**
8906
+ * String properties must match this pattern
8907
+ */
8908
+ pattern?: string;
8909
+ /**
8910
+ * String properties must be one of these values
8911
+ */
8912
+ enum?: string[];
8913
+ /**
8914
+ * Defines the shape of items in an array
8915
+ */
8916
+ items?: {
8917
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8918
+ [k: string]: any;
8919
+ };
8821
8920
  nullable?: boolean;
8921
+ properties?: {
8922
+ [k: string]: {
8923
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8924
+ [k: string]: any;
8925
+ };
8926
+ };
8822
8927
  "x-zui": {
8823
8928
  index: number;
8824
8929
  /**
@@ -8971,10 +9076,31 @@ interface GetOrCreateTableResponse {
8971
9076
  */
8972
9077
  properties: {
8973
9078
  [k: string]: {
8974
- type: "string" | "number" | "boolean" | "object" | "null";
9079
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
8975
9080
  format?: "date-time";
8976
9081
  description?: string;
9082
+ /**
9083
+ * String properties must match this pattern
9084
+ */
9085
+ pattern?: string;
9086
+ /**
9087
+ * String properties must be one of these values
9088
+ */
9089
+ enum?: string[];
9090
+ /**
9091
+ * Defines the shape of items in an array
9092
+ */
9093
+ items?: {
9094
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9095
+ [k: string]: any;
9096
+ };
8977
9097
  nullable?: boolean;
9098
+ properties?: {
9099
+ [k: string]: {
9100
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9101
+ [k: string]: any;
9102
+ };
9103
+ };
8978
9104
  "x-zui": {
8979
9105
  index: number;
8980
9106
  /**
@@ -9134,10 +9260,31 @@ interface CreateTableResponse {
9134
9260
  */
9135
9261
  properties: {
9136
9262
  [k: string]: {
9137
- type: "string" | "number" | "boolean" | "object" | "null";
9263
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9138
9264
  format?: "date-time";
9139
9265
  description?: string;
9266
+ /**
9267
+ * String properties must match this pattern
9268
+ */
9269
+ pattern?: string;
9270
+ /**
9271
+ * String properties must be one of these values
9272
+ */
9273
+ enum?: string[];
9274
+ /**
9275
+ * Defines the shape of items in an array
9276
+ */
9277
+ items?: {
9278
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9279
+ [k: string]: any;
9280
+ };
9140
9281
  nullable?: boolean;
9282
+ properties?: {
9283
+ [k: string]: {
9284
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9285
+ [k: string]: any;
9286
+ };
9287
+ };
9141
9288
  "x-zui": {
9142
9289
  index: number;
9143
9290
  /**
@@ -9263,10 +9410,31 @@ interface DuplicateTableResponse {
9263
9410
  */
9264
9411
  properties: {
9265
9412
  [k: string]: {
9266
- type: "string" | "number" | "boolean" | "object" | "null";
9413
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9267
9414
  format?: "date-time";
9268
9415
  description?: string;
9416
+ /**
9417
+ * String properties must match this pattern
9418
+ */
9419
+ pattern?: string;
9420
+ /**
9421
+ * String properties must be one of these values
9422
+ */
9423
+ enum?: string[];
9424
+ /**
9425
+ * Defines the shape of items in an array
9426
+ */
9427
+ items?: {
9428
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9429
+ [k: string]: any;
9430
+ };
9269
9431
  nullable?: boolean;
9432
+ properties?: {
9433
+ [k: string]: {
9434
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9435
+ [k: string]: any;
9436
+ };
9437
+ };
9270
9438
  "x-zui": {
9271
9439
  index: number;
9272
9440
  /**
@@ -9411,10 +9579,31 @@ interface UpdateTableResponse {
9411
9579
  */
9412
9580
  properties: {
9413
9581
  [k: string]: {
9414
- type: "string" | "number" | "boolean" | "object" | "null";
9582
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9415
9583
  format?: "date-time";
9416
9584
  description?: string;
9585
+ /**
9586
+ * String properties must match this pattern
9587
+ */
9588
+ pattern?: string;
9589
+ /**
9590
+ * String properties must be one of these values
9591
+ */
9592
+ enum?: string[];
9593
+ /**
9594
+ * Defines the shape of items in an array
9595
+ */
9596
+ items?: {
9597
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9598
+ [k: string]: any;
9599
+ };
9417
9600
  nullable?: boolean;
9601
+ properties?: {
9602
+ [k: string]: {
9603
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9604
+ [k: string]: any;
9605
+ };
9606
+ };
9418
9607
  "x-zui": {
9419
9608
  index: number;
9420
9609
  /**
@@ -9543,10 +9732,31 @@ interface RenameTableColumnResponse {
9543
9732
  */
9544
9733
  properties: {
9545
9734
  [k: string]: {
9546
- type: "string" | "number" | "boolean" | "object" | "null";
9735
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9547
9736
  format?: "date-time";
9548
9737
  description?: string;
9738
+ /**
9739
+ * String properties must match this pattern
9740
+ */
9741
+ pattern?: string;
9742
+ /**
9743
+ * String properties must be one of these values
9744
+ */
9745
+ enum?: string[];
9746
+ /**
9747
+ * Defines the shape of items in an array
9748
+ */
9749
+ items?: {
9750
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9751
+ [k: string]: any;
9752
+ };
9549
9753
  nullable?: boolean;
9754
+ properties?: {
9755
+ [k: string]: {
9756
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
9757
+ [k: string]: any;
9758
+ };
9759
+ };
9550
9760
  "x-zui": {
9551
9761
  index: number;
9552
9762
  /**
@@ -11049,10 +11259,31 @@ interface Table {
11049
11259
  */
11050
11260
  properties: {
11051
11261
  [k: string]: {
11052
- type: "string" | "number" | "boolean" | "object" | "null";
11262
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
11053
11263
  format?: "date-time";
11054
11264
  description?: string;
11265
+ /**
11266
+ * String properties must match this pattern
11267
+ */
11268
+ pattern?: string;
11269
+ /**
11270
+ * String properties must be one of these values
11271
+ */
11272
+ enum?: string[];
11273
+ /**
11274
+ * Defines the shape of items in an array
11275
+ */
11276
+ items?: {
11277
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
11278
+ [k: string]: any;
11279
+ };
11055
11280
  nullable?: boolean;
11281
+ properties?: {
11282
+ [k: string]: {
11283
+ type: "string" | "number" | "boolean" | "object" | "array" | "null";
11284
+ [k: string]: any;
11285
+ };
11286
+ };
11056
11287
  "x-zui": {
11057
11288
  index: number;
11058
11289
  /**
@@ -11314,6 +11545,7 @@ declare class Client$1 {
11314
11545
  readonly getOrCreateUser: (input: GetOrCreateUserInput) => Promise<GetOrCreateUserResponse>;
11315
11546
  readonly updateUser: (input: UpdateUserInput) => Promise<UpdateUserResponse>;
11316
11547
  readonly deleteUser: (input: DeleteUserInput) => Promise<DeleteUserResponse>;
11548
+ readonly setStateExpiry: (input: SetStateExpiryInput) => Promise<SetStateExpiryResponse>;
11317
11549
  readonly getState: (input: GetStateInput) => Promise<GetStateResponse>;
11318
11550
  readonly setState: (input: SetStateInput) => Promise<SetStateResponse>;
11319
11551
  readonly getOrSetState: (input: GetOrSetStateInput) => Promise<GetOrSetStateResponse>;
@@ -11749,8 +11981,8 @@ declare class AsyncCollection<T> {
11749
11981
  }): Promise<T[]>;
11750
11982
  }
11751
11983
  declare class Lister {
11752
- private client;
11753
- constructor(client: Client$1);
11984
+ private _client;
11985
+ constructor(_client: Client$1);
11754
11986
  readonly conversations: (props: ListInputs['listConversations']) => AsyncCollection<{
11755
11987
  id: string;
11756
11988
  currentTaskId?: string | undefined;
@@ -11932,7 +12164,7 @@ declare class Lister {
11932
12164
  id: string;
11933
12165
  content: string;
11934
12166
  meta: {
11935
- type?: "chunk" | undefined;
12167
+ type?: "chunk" | "summary" | "consolidated" | undefined;
11936
12168
  subtype?: "code" | "title" | "subtitle" | "paragraph" | "list" | "blockquote" | "table" | undefined;
11937
12169
  pageNumber?: number | undefined;
11938
12170
  position?: number | undefined;