@botpress/client 0.23.2 → 0.24.1

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.
Files changed (145) hide show
  1. package/.turbo/turbo-build.log +12 -6
  2. package/.turbo/turbo-generate.log +1 -1
  3. package/dist/bundle.cjs.map +1 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.ts +10936 -4
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/dist/client.d.ts +0 -10
  9. package/dist/config.d.ts +0 -2
  10. package/dist/errors.d.ts +0 -41
  11. package/dist/gen/errors.d.ts +0 -211
  12. package/dist/gen/index.d.ts +0 -401
  13. package/dist/gen/models.d.ts +0 -1269
  14. package/dist/gen/operations/addParticipant.d.ts +0 -56
  15. package/dist/gen/operations/breakDownWorkspaceUsageByBot.d.ts +0 -27
  16. package/dist/gen/operations/callAction.d.ts +0 -36
  17. package/dist/gen/operations/changeAISpendQuota.d.ts +0 -21
  18. package/dist/gen/operations/chargeWorkspaceUnpaidInvoices.d.ts +0 -40
  19. package/dist/gen/operations/checkHandleAvailability.d.ts +0 -24
  20. package/dist/gen/operations/configureIntegration.d.ts +0 -24
  21. package/dist/gen/operations/createBot.d.ts +0 -487
  22. package/dist/gen/operations/createBotVersion.d.ts +0 -28
  23. package/dist/gen/operations/createConversation.d.ts +0 -70
  24. package/dist/gen/operations/createEvent.d.ts +0 -95
  25. package/dist/gen/operations/createIntegration.d.ts +0 -573
  26. package/dist/gen/operations/createIntegrationApiKey.d.ts +0 -29
  27. package/dist/gen/operations/createInterface.d.ts +0 -172
  28. package/dist/gen/operations/createMessage.d.ts +0 -98
  29. package/dist/gen/operations/createPersonalAccessToken.d.ts +0 -33
  30. package/dist/gen/operations/createTable.d.ts +0 -151
  31. package/dist/gen/operations/createTableRows.d.ts +0 -71
  32. package/dist/gen/operations/createTask.d.ts +0 -125
  33. package/dist/gen/operations/createUser.d.ts +0 -70
  34. package/dist/gen/operations/createWorkspace.d.ts +0 -38
  35. package/dist/gen/operations/createWorkspaceMember.d.ts +0 -29
  36. package/dist/gen/operations/deleteBot.d.ts +0 -21
  37. package/dist/gen/operations/deleteBotIssue.d.ts +0 -22
  38. package/dist/gen/operations/deleteConversation.d.ts +0 -21
  39. package/dist/gen/operations/deleteFile.d.ts +0 -21
  40. package/dist/gen/operations/deleteIntegration.d.ts +0 -21
  41. package/dist/gen/operations/deleteIntegrationApiKey.d.ts +0 -21
  42. package/dist/gen/operations/deleteInterface.d.ts +0 -21
  43. package/dist/gen/operations/deleteMessage.d.ts +0 -21
  44. package/dist/gen/operations/deletePersonalAccessToken.d.ts +0 -21
  45. package/dist/gen/operations/deleteTable.d.ts +0 -21
  46. package/dist/gen/operations/deleteTableRows.d.ts +0 -36
  47. package/dist/gen/operations/deleteTask.d.ts +0 -21
  48. package/dist/gen/operations/deleteUser.d.ts +0 -21
  49. package/dist/gen/operations/deleteWorkspace.d.ts +0 -21
  50. package/dist/gen/operations/deleteWorkspaceMember.d.ts +0 -21
  51. package/dist/gen/operations/deployBotVersion.d.ts +0 -22
  52. package/dist/gen/operations/duplicateTable.d.ts +0 -137
  53. package/dist/gen/operations/findTableRows.d.ts +0 -94
  54. package/dist/gen/operations/getAccount.d.ts +0 -31
  55. package/dist/gen/operations/getAccountPreference.d.ts +0 -22
  56. package/dist/gen/operations/getAllWorkspaceQuotaCompletion.d.ts +0 -24
  57. package/dist/gen/operations/getAuditRecords.d.ts +0 -38
  58. package/dist/gen/operations/getBot.d.ts +0 -308
  59. package/dist/gen/operations/getBotAnalytics.d.ts +0 -49
  60. package/dist/gen/operations/getBotIssue.d.ts +0 -39
  61. package/dist/gen/operations/getBotLogs.d.ts +0 -30
  62. package/dist/gen/operations/getBotVersion.d.ts +0 -23
  63. package/dist/gen/operations/getBotWebchat.d.ts +0 -23
  64. package/dist/gen/operations/getConversation.d.ts +0 -56
  65. package/dist/gen/operations/getEvent.d.ts +0 -61
  66. package/dist/gen/operations/getFile.d.ts +0 -85
  67. package/dist/gen/operations/getIntegration.d.ts +0 -315
  68. package/dist/gen/operations/getIntegrationByName.d.ts +0 -316
  69. package/dist/gen/operations/getIntegrationLogs.d.ts +0 -30
  70. package/dist/gen/operations/getInterface.d.ts +0 -104
  71. package/dist/gen/operations/getInterfaceByName.d.ts +0 -105
  72. package/dist/gen/operations/getMessage.d.ts +0 -62
  73. package/dist/gen/operations/getMultipleUsages.d.ts +0 -45
  74. package/dist/gen/operations/getOrCreateConversation.d.ts +0 -70
  75. package/dist/gen/operations/getOrCreateMessage.d.ts +0 -98
  76. package/dist/gen/operations/getOrCreateTable.d.ts +0 -164
  77. package/dist/gen/operations/getOrCreateUser.d.ts +0 -70
  78. package/dist/gen/operations/getOrSetState.d.ts +0 -76
  79. package/dist/gen/operations/getParticipant.d.ts +0 -53
  80. package/dist/gen/operations/getPublicIntegration.d.ts +0 -321
  81. package/dist/gen/operations/getPublicIntegrationById.d.ts +0 -320
  82. package/dist/gen/operations/getPublicWorkspace.d.ts +0 -31
  83. package/dist/gen/operations/getState.d.ts +0 -66
  84. package/dist/gen/operations/getTable.d.ts +0 -136
  85. package/dist/gen/operations/getTableRow.d.ts +0 -53
  86. package/dist/gen/operations/getTask.d.ts +0 -86
  87. package/dist/gen/operations/getUpcomingInvoice.d.ts +0 -29
  88. package/dist/gen/operations/getUsage.d.ts +0 -45
  89. package/dist/gen/operations/getUser.d.ts +0 -52
  90. package/dist/gen/operations/getWorkspace.d.ts +0 -38
  91. package/dist/gen/operations/getWorkspaceMember.d.ts +0 -27
  92. package/dist/gen/operations/getWorkspaceQuota.d.ts +0 -37
  93. package/dist/gen/operations/introspect.d.ts +0 -24
  94. package/dist/gen/operations/listActivities.d.ts +0 -42
  95. package/dist/gen/operations/listBotIssueEvents.d.ts +0 -32
  96. package/dist/gen/operations/listBotIssues.d.ts +0 -45
  97. package/dist/gen/operations/listBotVersions.d.ts +0 -26
  98. package/dist/gen/operations/listBots.d.ts +0 -46
  99. package/dist/gen/operations/listConversations.d.ts +0 -64
  100. package/dist/gen/operations/listEvents.d.ts +0 -69
  101. package/dist/gen/operations/listFiles.d.ts +0 -94
  102. package/dist/gen/operations/listIntegrationApiKeys.d.ts +0 -26
  103. package/dist/gen/operations/listIntegrations.d.ts +0 -68
  104. package/dist/gen/operations/listInterfaces.d.ts +0 -49
  105. package/dist/gen/operations/listMessages.d.ts +0 -69
  106. package/dist/gen/operations/listParticipants.d.ts +0 -56
  107. package/dist/gen/operations/listPersonalAccessTokens.d.ts +0 -25
  108. package/dist/gen/operations/listPublicIntegrations.d.ts +0 -72
  109. package/dist/gen/operations/listPublicWorkspaces.d.ts +0 -42
  110. package/dist/gen/operations/listTables.d.ts +0 -126
  111. package/dist/gen/operations/listTasks.d.ts +0 -97
  112. package/dist/gen/operations/listUsageHistory.d.ts +0 -44
  113. package/dist/gen/operations/listUsers.d.ts +0 -59
  114. package/dist/gen/operations/listWorkspaceInvoices.d.ts +0 -57
  115. package/dist/gen/operations/listWorkspaceMembers.d.ts +0 -36
  116. package/dist/gen/operations/listWorkspaceQuotas.d.ts +0 -36
  117. package/dist/gen/operations/listWorkspaceUsages.d.ts +0 -45
  118. package/dist/gen/operations/listWorkspaces.d.ts +0 -47
  119. package/dist/gen/operations/patchState.d.ts +0 -72
  120. package/dist/gen/operations/removeParticipant.d.ts +0 -22
  121. package/dist/gen/operations/renameTableColumn.d.ts +0 -132
  122. package/dist/gen/operations/runVrl.d.ts +0 -28
  123. package/dist/gen/operations/searchFiles.d.ts +0 -56
  124. package/dist/gen/operations/setAccountPreference.d.ts +0 -22
  125. package/dist/gen/operations/setState.d.ts +0 -76
  126. package/dist/gen/operations/setWorkspacePaymentMethod.d.ts +0 -37
  127. package/dist/gen/operations/trackAnalytics.d.ts +0 -22
  128. package/dist/gen/operations/transferBot.d.ts +0 -25
  129. package/dist/gen/operations/updateAccount.d.ts +0 -34
  130. package/dist/gen/operations/updateBot.d.ts +0 -486
  131. package/dist/gen/operations/updateConversation.d.ts +0 -63
  132. package/dist/gen/operations/updateFileMetadata.d.ts +0 -95
  133. package/dist/gen/operations/updateIntegration.d.ts +0 -562
  134. package/dist/gen/operations/updateInterface.d.ts +0 -165
  135. package/dist/gen/operations/updateMessage.d.ts +0 -68
  136. package/dist/gen/operations/updateTable.d.ts +0 -152
  137. package/dist/gen/operations/updateTableRows.d.ts +0 -74
  138. package/dist/gen/operations/updateTask.d.ts +0 -114
  139. package/dist/gen/operations/updateUser.d.ts +0 -66
  140. package/dist/gen/operations/updateWorkspace.d.ts +0 -50
  141. package/dist/gen/operations/updateWorkspaceMember.d.ts +0 -29
  142. package/dist/gen/operations/upsertFile.d.ts +0 -114
  143. package/dist/gen/operations/upsertTableRows.d.ts +0 -107
  144. package/dist/gen/to-axios.d.ts +0 -16
  145. package/dist/types.d.ts +0 -49
@@ -1,29 +0,0 @@
1
- export interface UpdateWorkspaceMemberRequestHeaders {
2
- }
3
- export interface UpdateWorkspaceMemberRequestQuery {
4
- }
5
- export interface UpdateWorkspaceMemberRequestParams {
6
- id: string;
7
- }
8
- export interface UpdateWorkspaceMemberRequestBody {
9
- role?: "viewer" | "billing" | "developer" | "manager" | "administrator" | "owner";
10
- }
11
- export type UpdateWorkspaceMemberInput = UpdateWorkspaceMemberRequestBody & UpdateWorkspaceMemberRequestHeaders & UpdateWorkspaceMemberRequestQuery & UpdateWorkspaceMemberRequestParams;
12
- export type UpdateWorkspaceMemberRequest = {
13
- headers: UpdateWorkspaceMemberRequestHeaders;
14
- query: UpdateWorkspaceMemberRequestQuery;
15
- params: UpdateWorkspaceMemberRequestParams;
16
- body: UpdateWorkspaceMemberRequestBody;
17
- };
18
- export declare const parseReq: (input: UpdateWorkspaceMemberInput) => UpdateWorkspaceMemberRequest & {
19
- path: string;
20
- };
21
- export interface UpdateWorkspaceMemberResponse {
22
- id: string;
23
- userId?: string;
24
- email: string;
25
- createdAt: string;
26
- role: "viewer" | "billing" | "developer" | "manager" | "administrator" | "owner";
27
- profilePicture?: string;
28
- displayName?: string;
29
- }
@@ -1,114 +0,0 @@
1
- export interface UpsertFileRequestHeaders {
2
- }
3
- export interface UpsertFileRequestQuery {
4
- }
5
- export interface UpsertFileRequestParams {
6
- }
7
- export interface UpsertFileRequestBody {
8
- /**
9
- * Unique key for the file. Must be unique across the bot (and the integration, when applicable).
10
- */
11
- key: string;
12
- /**
13
- * File tags as an object of key-value pairs. Tag values should be of `string` (text) type.
14
- */
15
- tags?: {
16
- [k: string]: string;
17
- };
18
- /**
19
- * File size in bytes. This will count against your File Storage quota. If the `index` parameter is set to `true`, this will also count against your Vector DB Storage quota.
20
- */
21
- size: number;
22
- /**
23
- * Set to a value of 'true' to index the file in vector storage. Only PDFs, Office documents, and text-based files are currently supported. 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.
24
- */
25
- index?: boolean;
26
- /**
27
- * 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.
28
- */
29
- accessPolicies?: ("public_content" | "integrations")[];
30
- /**
31
- * File content type. If omitted, the content type will be inferred from the file extension (if any) specified in `key`. If a content type cannot be inferred, the default is "application/octet-stream".
32
- */
33
- contentType?: string;
34
- }
35
- export type UpsertFileInput = UpsertFileRequestBody & UpsertFileRequestHeaders & UpsertFileRequestQuery & UpsertFileRequestParams;
36
- export type UpsertFileRequest = {
37
- headers: UpsertFileRequestHeaders;
38
- query: UpsertFileRequestQuery;
39
- params: UpsertFileRequestParams;
40
- body: UpsertFileRequestBody;
41
- };
42
- export declare const parseReq: (input: UpsertFileInput) => UpsertFileRequest & {
43
- path: string;
44
- };
45
- export interface UpsertFileResponse {
46
- file: {
47
- /**
48
- * File ID
49
- */
50
- id: string;
51
- /**
52
- * The ID of the bot the file belongs to
53
- */
54
- botId: string;
55
- /**
56
- * Unique key for the file. Must be unique across the bot (and the integration, when applicable).
57
- */
58
- key: string;
59
- /**
60
- * URL to retrieve the file content. This URL will be ready to use once the file is uploaded.
61
- *
62
- * If the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe.
63
- */
64
- url: string;
65
- /**
66
- * File size in bytes. Non-null if file upload status is "COMPLETE".
67
- */
68
- size: number | null;
69
- /**
70
- * MIME type of the file's content
71
- */
72
- contentType: string;
73
- /**
74
- * The tags of the file as an object of key/value pairs
75
- */
76
- tags: {
77
- [k: string]: string;
78
- };
79
- /**
80
- * File creation timestamp in ISO 8601 format
81
- */
82
- createdAt: string;
83
- /**
84
- * File last update timestamp in ISO 8601 format
85
- */
86
- updatedAt: string;
87
- /**
88
- * Access policies configured for the file.
89
- */
90
- accessPolicies: ("integrations" | "public_content")[];
91
- /**
92
- * Whether the file was requested to be indexed for search or not.
93
- */
94
- index: boolean;
95
- /**
96
- * Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.
97
- *
98
- * If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.
99
- *
100
- * However, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).
101
- *
102
- * Once the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field.
103
- */
104
- status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
105
- /**
106
- * If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure.
107
- */
108
- failedStatusReason?: string;
109
- /**
110
- * URL to upload the file content. File content needs to be sent to this URL via a PUT request.
111
- */
112
- uploadUrl: string;
113
- };
114
- }
@@ -1,107 +0,0 @@
1
- export interface UpsertTableRowsRequestHeaders {
2
- }
3
- export interface UpsertTableRowsRequestQuery {
4
- }
5
- export interface UpsertTableRowsRequestParams {
6
- table: string;
7
- }
8
- export interface UpsertTableRowsRequestBody {
9
- /**
10
- * @minItems 1
11
- * @maxItems 1000
12
- */
13
- rows: {
14
- id?: number;
15
- [k: string]: any;
16
- }[];
17
- /**
18
- * Determines if a row is inserted or updated. Defaults to "id".
19
- */
20
- keyColumn?: string;
21
- /**
22
- * Ensure computed columns are fully processed before returning the result. This is applicable only when the number of rows involved is fewer than 1.
23
- */
24
- waitComputed?: boolean;
25
- }
26
- export type UpsertTableRowsInput = UpsertTableRowsRequestBody & UpsertTableRowsRequestHeaders & UpsertTableRowsRequestQuery & UpsertTableRowsRequestParams;
27
- export type UpsertTableRowsRequest = {
28
- headers: UpsertTableRowsRequestHeaders;
29
- query: UpsertTableRowsRequestQuery;
30
- params: UpsertTableRowsRequestParams;
31
- body: UpsertTableRowsRequestBody;
32
- };
33
- export declare const parseReq: (input: UpsertTableRowsInput) => UpsertTableRowsRequest & {
34
- path: string;
35
- };
36
- export interface UpsertTableRowsResponse {
37
- inserted: {
38
- /**
39
- * Unique identifier for the row.
40
- */
41
- id: number;
42
- /**
43
- * Timestamp of row creation.
44
- */
45
- createdAt?: string;
46
- /**
47
- * Timestamp of the last row update.
48
- */
49
- updatedAt?: string;
50
- computed: {
51
- [k: string]: {
52
- status: string;
53
- error?: string;
54
- updatedBy?: string;
55
- updatedAt?: string;
56
- };
57
- };
58
- /**
59
- * [Read-only] List of stale values that are waiting to be recomputed.
60
- */
61
- stale?: string[];
62
- /**
63
- * Optional numeric value indicating similarity, when using findTableRows.
64
- */
65
- similarity?: number;
66
- [k: string]: any;
67
- }[];
68
- updated: {
69
- /**
70
- * Unique identifier for the row.
71
- */
72
- id: number;
73
- /**
74
- * Timestamp of row creation.
75
- */
76
- createdAt?: string;
77
- /**
78
- * Timestamp of the last row update.
79
- */
80
- updatedAt?: string;
81
- computed: {
82
- [k: string]: {
83
- status: string;
84
- error?: string;
85
- updatedBy?: string;
86
- updatedAt?: string;
87
- };
88
- };
89
- /**
90
- * [Read-only] List of stale values that are waiting to be recomputed.
91
- */
92
- stale?: string[];
93
- /**
94
- * Optional numeric value indicating similarity, when using findTableRows.
95
- */
96
- similarity?: number;
97
- [k: string]: any;
98
- }[];
99
- /**
100
- * Alerts for minor issues that don't block the operation but suggest possible improvements.
101
- */
102
- warnings?: string[];
103
- /**
104
- * Critical issues in specific elements that prevent their successful processing, allowing partial operation success.
105
- */
106
- errors?: string[];
107
- }
@@ -1,16 +0,0 @@
1
- import { AxiosRequestConfig } from "axios";
2
- export type Primitive = string | number | boolean;
3
- export type Value<P extends Primitive> = P | P[] | Record<string, P>;
4
- export type QueryValue = Value<string> | Value<boolean> | Value<number> | undefined;
5
- export type AnyQueryParams = Record<string, QueryValue>;
6
- export type HeaderValue = string | undefined;
7
- export type AnyHeaderParams = Record<string, HeaderValue>;
8
- export type AnyBodyParams = Record<string, any>;
9
- export type ParsedRequest = {
10
- method: string;
11
- path: string;
12
- query: AnyQueryParams;
13
- headers: AnyHeaderParams;
14
- body: AnyBodyParams;
15
- };
16
- export declare const toAxiosRequest: (req: ParsedRequest) => AxiosRequestConfig;
package/dist/types.d.ts DELETED
@@ -1,49 +0,0 @@
1
- /// <reference types="node" />
2
- import { Client as AutoGeneratedClient } from './gen';
3
- import { UpsertFileInput, UpsertFileResponse } from './gen/operations/upsertFile';
4
- export type { Message, Conversation, User, State, Event, File, Bot, Integration, Interface, Issue, IssueEvent, Account, Workspace, Usage, } from './gen/models';
5
- type UploadFileInput = Omit<UpsertFileInput, 'size'> & {
6
- content?: Buffer | string;
7
- url?: string;
8
- };
9
- type UploadFileOutput = UpsertFileResponse;
10
- type Simplify<T> = T extends (...args: infer A) => infer R ? (...args: Simplify<A>) => Simplify<R> : T extends Promise<infer R> ? Promise<Simplify<R>> : T extends Buffer ? Buffer : T extends object ? T extends infer O ? {
11
- [K in keyof O]: Simplify<O[K]>;
12
- } : never : T;
13
- type AsyncFunc = (...args: any[]) => Promise<any>;
14
- export type IClient = Simplify<AutoGeneratedClient & {
15
- uploadFile: (input: UploadFileInput) => Promise<UploadFileOutput>;
16
- }>;
17
- export type Operation = Simplify<keyof {
18
- [K in keyof IClient as IClient[K] extends AsyncFunc ? K : never]: IClient[K];
19
- }>;
20
- /**
21
- * @deprecated Use ClientInputs instead
22
- */
23
- export type ClientParams<T extends Operation> = Simplify<Parameters<IClient[T]>[0]>;
24
- /**
25
- * @deprecated Use ClientOutputs instead
26
- */
27
- export type ClientReturn<T extends Operation> = Simplify<Awaited<ReturnType<IClient[T]>>>;
28
- export type ClientInputs = Simplify<{
29
- [T in Operation]: Parameters<IClient[T]>[0];
30
- }>;
31
- export type ClientOutputs = Simplify<{
32
- [T in Operation]: Awaited<ReturnType<IClient[T]>>;
33
- }>;
34
- type Headers = Record<string, string | string[]>;
35
- export type ClientProps = {
36
- integrationId?: string;
37
- workspaceId?: string;
38
- botId?: string;
39
- token?: string;
40
- apiUrl?: string;
41
- timeout?: number;
42
- headers?: Headers;
43
- };
44
- export type ClientConfig = {
45
- apiUrl: string;
46
- headers: Headers;
47
- withCredentials: boolean;
48
- timeout: number;
49
- };