@botpress/client 0.34.0 → 0.35.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
@@ -9046,6 +9046,55 @@ interface UpsertFileRequestBody {
9046
9046
  * Set to a value of 'true' to index the file in vector storage. Only certain file formats are currently supported for indexing. Note that if a file is indexed, it will count towards both the Vector DB Storage quota and the File Storage quota of the workspace.
9047
9047
  */
9048
9048
  index?: boolean;
9049
+ indexing?: {
9050
+ /**
9051
+ * Configuration to use for indexing the file, will be stored in the file's metadata for reference.
9052
+ */
9053
+ configuration: {
9054
+ parsing?: {
9055
+ /**
9056
+ * The minimum length a standalone paragraph should have. If a paragraph is shorter than this, it will be merged with the next immediate paragraph.
9057
+ */
9058
+ minimumParagraphLength?: number;
9059
+ };
9060
+ chunking?: {
9061
+ /**
9062
+ * The maximum length of a chunk in characters.
9063
+ */
9064
+ maximumChunkLength?: number;
9065
+ /**
9066
+ * The number of surrounding context levels to include in the vector embedding of the chunk.
9067
+ */
9068
+ embeddedContextLevels?: number;
9069
+ /**
9070
+ * Include the breadcrumb of the chunk in the vector embedding.
9071
+ */
9072
+ embedBreadcrumb?: boolean;
9073
+ };
9074
+ summarization?: {
9075
+ /**
9076
+ * Create summaries for this file and index them as standalone vectors. Enabling this option will incur in AI Spend cost (charged to the workspace of the bot) to generate the summaries based on the amount of content in the file and the summarization model used. Please note that this feature is only available in Team/Enterprise plans.
9077
+ */
9078
+ enable?: boolean;
9079
+ /**
9080
+ * The model type to use for summarization.
9081
+ */
9082
+ modelType?: "inexpensive" | "balanced" | "accurate";
9083
+ /**
9084
+ * The minimum length a section of the file should have to create a summary of it.
9085
+ */
9086
+ minimumInputLength?: number;
9087
+ /**
9088
+ * The maximum length of a summary (in tokens).
9089
+ */
9090
+ outputTokenLimit?: number;
9091
+ /**
9092
+ * Generate a summary of the entire file and index it as a standalone vector.
9093
+ */
9094
+ generateMasterSummary?: boolean;
9095
+ };
9096
+ };
9097
+ };
9049
9098
  /**
9050
9099
  * File access policies. Add "public_content" to allow public access to the file content. Add "integrations" to allow read, search and list operations for any integration installed in the bot.
9051
9100
  */
@@ -9064,6 +9113,12 @@ interface UpsertFileRequestBody {
9064
9113
  * If set to `true`, the `x-amz-tagging` HTTP header with a value of `public=true` will need to be sent in the HTTP PUT request to the `uploadUrl` in order for the upload request to work.
9065
9114
  */
9066
9115
  publicContentImmediatelyAccessible?: boolean;
9116
+ /**
9117
+ * Custom metadata for the file expressed as an object of key-value pairs. The values can be of any type.
9118
+ */
9119
+ metadata?: {
9120
+ [k: string]: any;
9121
+ };
9067
9122
  }
9068
9123
  type UpsertFileInput = UpsertFileRequestBody & UpsertFileRequestHeaders & UpsertFileRequestQuery & UpsertFileRequestParams;
9069
9124
  interface UpsertFileResponse {
@@ -9100,6 +9155,12 @@ interface UpsertFileResponse {
9100
9155
  tags: {
9101
9156
  [k: string]: string;
9102
9157
  };
9158
+ /**
9159
+ * Metadata of the file as an object of key/value pairs. The values can be of any type.
9160
+ */
9161
+ metadata: {
9162
+ [k: string]: any;
9163
+ };
9103
9164
  /**
9104
9165
  * File creation timestamp in ISO 8601 format
9105
9166
  */
@@ -9203,6 +9264,12 @@ interface ListFilesResponse {
9203
9264
  tags: {
9204
9265
  [k: string]: string;
9205
9266
  };
9267
+ /**
9268
+ * Metadata of the file as an object of key/value pairs. The values can be of any type.
9269
+ */
9270
+ metadata: {
9271
+ [k: string]: any | null;
9272
+ };
9206
9273
  /**
9207
9274
  * File creation timestamp in ISO 8601 format
9208
9275
  */
@@ -9290,6 +9357,12 @@ interface GetFileResponse {
9290
9357
  tags: {
9291
9358
  [k: string]: string;
9292
9359
  };
9360
+ /**
9361
+ * Metadata of the file as an object of key/value pairs. The values can be of any type.
9362
+ */
9363
+ metadata: {
9364
+ [k: string]: any;
9365
+ };
9293
9366
  /**
9294
9367
  * File creation timestamp in ISO 8601 format
9295
9368
  */
@@ -9335,6 +9408,12 @@ interface UpdateFileMetadataRequestParams {
9335
9408
  id: string;
9336
9409
  }
9337
9410
  interface UpdateFileMetadataRequestBody {
9411
+ /**
9412
+ * Custom metadata for the file expressed as an object of key-value pairs. Omit to keep existing metadata intact. Any existing metadata keys not included will be preserved. New keys will be added. To delete a metadata key, set its value to `null`.
9413
+ */
9414
+ metadata?: {
9415
+ [k: string]: any;
9416
+ };
9338
9417
  /**
9339
9418
  * The file tags to update as an object of key-value pairs with `string` (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to `null`.
9340
9419
  */
@@ -9385,6 +9464,12 @@ interface UpdateFileMetadataResponse {
9385
9464
  tags: {
9386
9465
  [k: string]: string;
9387
9466
  };
9467
+ /**
9468
+ * Metadata of the file as an object of key/value pairs. The values can be of any type.
9469
+ */
9470
+ metadata: {
9471
+ [k: string]: any;
9472
+ };
9388
9473
  /**
9389
9474
  * File creation timestamp in ISO 8601 format
9390
9475
  */
@@ -9506,7 +9591,7 @@ interface ListFilePassagesRequestQuery {
9506
9591
  limit?: number;
9507
9592
  }
9508
9593
  interface ListFilePassagesRequestParams {
9509
- fileId: string;
9594
+ id: string;
9510
9595
  }
9511
9596
  interface ListFilePassagesRequestBody {
9512
9597
  }
@@ -12447,6 +12532,12 @@ interface File {
12447
12532
  tags: {
12448
12533
  [k: string]: string;
12449
12534
  };
12535
+ /**
12536
+ * Metadata of the file as an object of key/value pairs. The values can be of any type.
12537
+ */
12538
+ metadata: {
12539
+ [k: string]: any;
12540
+ };
12450
12541
  /**
12451
12542
  * File creation timestamp in ISO 8601 format
12452
12543
  */
@@ -12891,45 +12982,9 @@ type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenErro
12891
12982
  declare const errorFrom: (err: unknown) => ApiError;
12892
12983
 
12893
12984
  declare class UploadFileError extends Error {
12894
- readonly innerError?: AxiosError<unknown, any> | undefined;
12895
- readonly file?: {
12896
- id: string;
12897
- botId: string;
12898
- key: string;
12899
- url: string;
12900
- size: number | null;
12901
- contentType: string;
12902
- tags: {
12903
- [k: string]: string;
12904
- };
12905
- createdAt: string;
12906
- updatedAt: string;
12907
- accessPolicies: ("integrations" | "public_content")[];
12908
- index: boolean;
12909
- status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
12910
- failedStatusReason?: string | undefined;
12911
- expiresAt?: string | undefined;
12912
- uploadUrl: string;
12913
- } | undefined;
12914
- constructor(message: string, innerError?: AxiosError<unknown, any> | undefined, file?: {
12915
- id: string;
12916
- botId: string;
12917
- key: string;
12918
- url: string;
12919
- size: number | null;
12920
- contentType: string;
12921
- tags: {
12922
- [k: string]: string;
12923
- };
12924
- createdAt: string;
12925
- updatedAt: string;
12926
- accessPolicies: ("integrations" | "public_content")[];
12927
- index: boolean;
12928
- status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
12929
- failedStatusReason?: string | undefined;
12930
- expiresAt?: string | undefined;
12931
- uploadUrl: string;
12932
- } | undefined);
12985
+ readonly innerError?: AxiosError | undefined;
12986
+ readonly file?: UpsertFileResponse["file"] | undefined;
12987
+ constructor(message: string, innerError?: AxiosError | undefined, file?: UpsertFileResponse["file"] | undefined);
12933
12988
  }
12934
12989
 
12935
12990
  type ListOperation = keyof {
@@ -12959,10 +13014,10 @@ declare class AsyncCollection<T> {
12959
13014
  declare class Lister {
12960
13015
  private _client;
12961
13016
  constructor(_client: Client$1);
12962
- readonly conversations: (props: ListInputs['listConversations']) => AsyncCollection<{
13017
+ readonly conversations: (props: ListInputs["listConversations"]) => AsyncCollection<{
12963
13018
  id: string;
12964
- currentTaskId?: string | undefined;
12965
- currentWorkflowId?: string | undefined;
13019
+ currentTaskId?: string;
13020
+ currentWorkflowId?: string;
12966
13021
  createdAt: string;
12967
13022
  updatedAt: string;
12968
13023
  channel: string;
@@ -12971,30 +13026,30 @@ declare class Lister {
12971
13026
  [k: string]: string;
12972
13027
  };
12973
13028
  }>;
12974
- readonly participants: (props: ListInputs['listParticipants']) => AsyncCollection<{
13029
+ readonly participants: (props: ListInputs["listParticipants"]) => AsyncCollection<{
12975
13030
  id: string;
12976
13031
  createdAt: string;
12977
13032
  updatedAt: string;
12978
13033
  tags: {
12979
13034
  [k: string]: string;
12980
13035
  };
12981
- name?: string | undefined;
12982
- pictureUrl?: string | undefined;
13036
+ name?: string;
13037
+ pictureUrl?: string;
12983
13038
  }>;
12984
- readonly events: (props: ListInputs['listEvents']) => AsyncCollection<{
13039
+ readonly events: (props: ListInputs["listEvents"]) => AsyncCollection<{
12985
13040
  id: string;
12986
13041
  createdAt: string;
12987
13042
  type: string;
12988
13043
  payload: {
12989
13044
  [k: string]: any;
12990
13045
  };
12991
- conversationId?: string | undefined;
12992
- userId?: string | undefined;
12993
- messageId?: string | undefined;
13046
+ conversationId?: string;
13047
+ userId?: string;
13048
+ messageId?: string;
12994
13049
  status: "pending" | "processed" | "ignored" | "failed" | "scheduled";
12995
13050
  failureReason: string | null;
12996
13051
  }>;
12997
- readonly messages: (props: ListInputs['listMessages']) => AsyncCollection<{
13052
+ readonly messages: (props: ListInputs["listMessages"]) => AsyncCollection<{
12998
13053
  id: string;
12999
13054
  createdAt: string;
13000
13055
  type: string;
@@ -13008,17 +13063,17 @@ declare class Lister {
13008
13063
  [k: string]: string;
13009
13064
  };
13010
13065
  }>;
13011
- readonly users: (props: ListInputs['listUsers']) => AsyncCollection<{
13066
+ readonly users: (props: ListInputs["listUsers"]) => AsyncCollection<{
13012
13067
  id: string;
13013
13068
  createdAt: string;
13014
13069
  updatedAt: string;
13015
13070
  tags: {
13016
13071
  [k: string]: string;
13017
13072
  };
13018
- name?: string | undefined;
13019
- pictureUrl?: string | undefined;
13073
+ name?: string;
13074
+ pictureUrl?: string;
13020
13075
  }>;
13021
- readonly tasks: (props: ListInputs['listTasks']) => AsyncCollection<{
13076
+ readonly tasks: (props: ListInputs["listTasks"]) => AsyncCollection<{
13022
13077
  id: string;
13023
13078
  title: string;
13024
13079
  description: string;
@@ -13026,19 +13081,19 @@ declare class Lister {
13026
13081
  data: {
13027
13082
  [k: string]: any;
13028
13083
  };
13029
- status: "pending" | "failed" | "in_progress" | "completed" | "blocked" | "paused" | "timeout" | "cancelled";
13030
- parentTaskId?: string | undefined;
13031
- conversationId?: string | undefined;
13032
- userId?: string | undefined;
13084
+ status: "pending" | "in_progress" | "failed" | "completed" | "blocked" | "paused" | "timeout" | "cancelled";
13085
+ parentTaskId?: string;
13086
+ conversationId?: string;
13087
+ userId?: string;
13033
13088
  timeoutAt: string;
13034
13089
  createdAt: string;
13035
13090
  updatedAt: string;
13036
- failureReason?: string | undefined;
13091
+ failureReason?: string;
13037
13092
  tags: {
13038
13093
  [k: string]: string;
13039
13094
  };
13040
13095
  }>;
13041
- readonly publicIntegrations: (props: ListInputs['listPublicIntegrations']) => AsyncCollection<{
13096
+ readonly publicIntegrations: (props: ListInputs["listPublicIntegrations"]) => AsyncCollection<{
13042
13097
  id: string;
13043
13098
  name: string;
13044
13099
  version: string;
@@ -13048,7 +13103,7 @@ declare class Lister {
13048
13103
  description: string;
13049
13104
  iconUrl: string;
13050
13105
  public: boolean;
13051
- verificationStatus: "pending" | "unapproved" | "approved" | "rejected";
13106
+ verificationStatus: "unapproved" | "pending" | "approved" | "rejected";
13052
13107
  ownerWorkspace: {
13053
13108
  id: string;
13054
13109
  handle: string | null;
@@ -13059,14 +13114,14 @@ declare class Lister {
13059
13114
  views: number;
13060
13115
  };
13061
13116
  }>;
13062
- readonly bots: (props: ListInputs['listBots']) => AsyncCollection<{
13117
+ readonly bots: (props: ListInputs["listBots"]) => AsyncCollection<{
13063
13118
  id: string;
13064
13119
  createdAt: string;
13065
13120
  updatedAt: string;
13066
13121
  name: string;
13067
- deployedAt?: string | undefined;
13122
+ deployedAt?: string;
13068
13123
  }>;
13069
- readonly botIssues: (props: ListInputs['listBotIssues']) => AsyncCollection<{
13124
+ readonly botIssues: (props: ListInputs["listBotIssues"]) => AsyncCollection<{
13070
13125
  id: string;
13071
13126
  code: string;
13072
13127
  createdAt: string;
@@ -13076,25 +13131,25 @@ declare class Lister {
13076
13131
  groupedData: {
13077
13132
  [k: string]: {
13078
13133
  raw: string;
13079
- pretty?: string | undefined;
13134
+ pretty?: string;
13080
13135
  };
13081
13136
  };
13082
13137
  eventsCount: number;
13083
- category: "configuration" | "user_code" | "limits" | "other";
13138
+ category: "user_code" | "limits" | "configuration" | "other";
13084
13139
  resolutionLink: string | null;
13085
13140
  }>;
13086
- readonly workspaces: (props: ListInputs['listWorkspaces']) => AsyncCollection<UpdateWorkspaceResponse>;
13087
- readonly publicWorkspaces: (props: ListInputs['listPublicWorkspaces']) => AsyncCollection<GetPublicWorkspaceResponse>;
13088
- readonly workspaceMembers: (props: ListInputs['listWorkspaceMembers']) => AsyncCollection<{
13141
+ readonly workspaces: (props: ListInputs["listWorkspaces"]) => AsyncCollection<UpdateWorkspaceResponse>;
13142
+ readonly publicWorkspaces: (props: ListInputs["listPublicWorkspaces"]) => AsyncCollection<GetPublicWorkspaceResponse>;
13143
+ readonly workspaceMembers: (props: ListInputs["listWorkspaceMembers"]) => AsyncCollection<{
13089
13144
  id: string;
13090
- userId?: string | undefined;
13145
+ userId?: string;
13091
13146
  email: string;
13092
13147
  createdAt: string;
13093
13148
  role: "viewer" | "billing" | "developer" | "manager" | "administrator" | "owner";
13094
- profilePicture?: string | undefined;
13095
- displayName?: string | undefined;
13149
+ profilePicture?: string;
13150
+ displayName?: string;
13096
13151
  }>;
13097
- readonly integrations: (props: ListInputs['listIntegrations']) => AsyncCollection<{
13152
+ readonly integrations: (props: ListInputs["listIntegrations"]) => AsyncCollection<{
13098
13153
  id: string;
13099
13154
  name: string;
13100
13155
  version: string;
@@ -13104,16 +13159,16 @@ declare class Lister {
13104
13159
  description: string;
13105
13160
  iconUrl: string;
13106
13161
  public: boolean;
13107
- verificationStatus: "pending" | "unapproved" | "approved" | "rejected";
13162
+ verificationStatus: "unapproved" | "pending" | "approved" | "rejected";
13108
13163
  }>;
13109
- readonly interfaces: (props: ListInputs['listInterfaces']) => AsyncCollection<{
13164
+ readonly interfaces: (props: ListInputs["listInterfaces"]) => AsyncCollection<{
13110
13165
  id: string;
13111
13166
  createdAt: string;
13112
13167
  updatedAt: string;
13113
13168
  name: string;
13114
13169
  version: string;
13115
13170
  }>;
13116
- readonly activities: (props: ListInputs['listActivities']) => AsyncCollection<{
13171
+ readonly activities: (props: ListInputs["listActivities"]) => AsyncCollection<{
13117
13172
  id: string;
13118
13173
  description: string;
13119
13174
  taskId: string;
@@ -13123,7 +13178,7 @@ declare class Lister {
13123
13178
  };
13124
13179
  createdAt: string;
13125
13180
  }>;
13126
- readonly files: (props: ListInputs['listFiles']) => AsyncCollection<{
13181
+ readonly files: (props: ListInputs["listFiles"]) => AsyncCollection<{
13127
13182
  id: string;
13128
13183
  botId: string;
13129
13184
  key: string;
@@ -13133,22 +13188,25 @@ declare class Lister {
13133
13188
  tags: {
13134
13189
  [k: string]: string;
13135
13190
  };
13191
+ metadata: {
13192
+ [k: string]: any | null;
13193
+ };
13136
13194
  createdAt: string;
13137
13195
  updatedAt: string;
13138
13196
  accessPolicies: ("integrations" | "public_content")[];
13139
13197
  index: boolean;
13140
13198
  status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
13141
- failedStatusReason?: string | undefined;
13142
- expiresAt?: string | undefined;
13199
+ failedStatusReason?: string;
13200
+ expiresAt?: string;
13143
13201
  }>;
13144
- readonly filePassages: (props: ListInputs['listFilePassages']) => AsyncCollection<{
13202
+ readonly filePassages: (props: ListInputs["listFilePassages"]) => AsyncCollection<{
13145
13203
  id: string;
13146
13204
  content: string;
13147
13205
  meta: {
13148
- type?: "chunk" | "summary" | "consolidated" | undefined;
13149
- subtype?: "code" | "title" | "subtitle" | "paragraph" | "list" | "blockquote" | "table" | undefined;
13150
- pageNumber?: number | undefined;
13151
- position?: number | undefined;
13206
+ type?: "chunk" | "summary" | "consolidated";
13207
+ subtype?: "title" | "subtitle" | "paragraph" | "list" | "blockquote" | "table" | "code";
13208
+ pageNumber?: number;
13209
+ position?: number;
13152
13210
  };
13153
13211
  }>;
13154
13212
  }
@@ -13160,7 +13218,7 @@ declare class Client extends Client$1 implements IClient {
13160
13218
  /**
13161
13219
  * Create/update and upload a file in a single step. Returns an object containing the file metadata and the URL to retrieve the file.
13162
13220
  */
13163
- readonly uploadFile: ({ key, index, tags, contentType, accessPolicies, content, url, expiresAt, publicContentImmediatelyAccessible, }: ClientInputs['uploadFile']) => Promise<ClientOutputs['uploadFile']>;
13221
+ readonly uploadFile: ({ key, index, tags, contentType, accessPolicies, content, url, expiresAt, publicContentImmediatelyAccessible, }: ClientInputs["uploadFile"]) => Promise<ClientOutputs["uploadFile"]>;
13164
13222
  }
13165
13223
 
13166
13224
  export { type Account, AlreadyExistsError, type ApiError, type Bot, BreakingChangesError, Client, type ClientConfig, type ClientInputs, type ClientOutputs, type ClientParams, type ClientProps, type ClientReturn, type Column, type Conversation, type ErrorType, type Event, type File, ForbiddenError, type IClient, type Integration, type Interface, InternalError, InvalidDataFormatError, InvalidIdentifierError, InvalidJsonSchemaError, InvalidPayloadError, InvalidQueryError, type Issue, type IssueEvent, LimitExceededError, type Message, MethodNotFoundError, type Operation, PayloadTooLargeError, PaymentRequiredError, QuotaExceededError, RateLimitedError, ReferenceConstraintError, ReferenceNotFoundError, RelationConflictError, ResourceLockedConflictError, ResourceNotFoundError, type RetryConfig, type Row, RuntimeError, type State, type Table, UnauthorizedError, UnknownError, UnsupportedMediaTypeError, UploadFileError, type Usage, type User, type Workflow, type Workspace, type WorkspaceMember, errorFrom, isApiError };