@botpress/api 0.58.2 → 0.59.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.js CHANGED
@@ -267645,7 +267645,7 @@ __export(src_exports, {
267645
267645
  });
267646
267646
  module.exports = __toCommonJS(src_exports);
267647
267647
 
267648
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.11.1_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
267648
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.12.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
267649
267649
  var import_zod_openapi = __toESM(require_src(), 1);
267650
267650
  var import_zod_openapi2 = __toESM(require_src(), 1);
267651
267651
  var import_path = __toESM(require("path"), 1);
@@ -267691,7 +267691,7 @@ var title = (str2) => {
267691
267691
  return str2.split(/(?=[A-Z])|[\.\-\s_]/).map((s2) => s2.trim()).filter((s2) => !!s2).map((s2) => capitalize(s2.toLowerCase())).join(" ");
267692
267692
  };
267693
267693
 
267694
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.11.1_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
267694
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.12.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
267695
267695
  var import_decompress = __toESM(require_decompress(), 1);
267696
267696
  var import_fs3 = __toESM(require("fs"), 1);
267697
267697
  var import_promises = __toESM(require("fs/promises"), 1);
@@ -270927,7 +270927,7 @@ var {
270927
270927
  mergeConfig: mergeConfig2
270928
270928
  } = axios_default;
270929
270929
 
270930
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.11.1_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
270930
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.12.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
270931
270931
  var import_json_schema_to_typescript = __toESM(require_src3(), 1);
270932
270932
  var import_fs4 = __toESM(require("fs"), 1);
270933
270933
  var import_path3 = __toESM(require("path"), 1);
@@ -275263,7 +275263,7 @@ async function openapiTS(schema3, options = {}) {
275263
275263
  }
275264
275264
  var dist_default = openapiTS;
275265
275265
 
275266
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.11.1_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
275266
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.12.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
275267
275267
  var import_openapi3_ts = __toESM(require_dist3(), 1);
275268
275268
  var import_verror2 = __toESM(require_verror(), 1);
275269
275269
  var import_verror3 = __toESM(require_verror(), 1);
@@ -278904,7 +278904,7 @@ var z = /* @__PURE__ */ Object.freeze({
278904
278904
  ZodError
278905
278905
  });
278906
278906
 
278907
- // ../../node_modules/.pnpm/@bpinternal+opapi@0.11.1_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
278907
+ // ../../node_modules/.pnpm/@bpinternal+opapi@0.12.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
278908
278908
  var import_openapi_parser = __toESM(require_lib9(), 1);
278909
278909
  var import_json_schema_to_typescript2 = __toESM(require_src3(), 1);
278910
278910
  var import_zod_openapi4 = __toESM(require_src(), 1);
@@ -279999,7 +279999,8 @@ abstract class BaseApiError<Code extends ErrorCode, Type extends string, Descrip
279999
279999
  public readonly type: Type,
280000
280000
  public override readonly message: string,
280001
280001
  public readonly error?: Error,
280002
- public readonly id?: string
280002
+ public readonly id?: string,
280003
+ public readonly metadata?: Record<string, unknown>,
280003
280004
  ) {
280004
280005
  super(message)
280005
280006
 
@@ -280018,6 +280019,7 @@ abstract class BaseApiError<Code extends ErrorCode, Type extends string, Descrip
280018
280019
  code: this.code,
280019
280020
  type: this.type,
280020
280021
  message: this.message,
280022
+ metadata: this.metadata,
280021
280023
  }
280022
280024
  }
280023
280025
 
@@ -280030,7 +280032,7 @@ abstract class BaseApiError<Code extends ErrorCode, Type extends string, Descrip
280030
280032
  .map(x => x.toString(16).padStart(2, '0'))
280031
280033
  .join('')
280032
280034
  .toUpperCase()
280033
-
280035
+
280034
280036
  return \`\${prefix}_\${timestamp}x\${randomHexSuffix}\`
280035
280037
  }
280036
280038
 
@@ -280076,7 +280078,7 @@ function getApiErrorFromObject(err: any) {
280076
280078
  return new UnknownError(\`An unclassified API error occurred: \${err.message} (Type: \${err.type}, Code: \${err.code})\`)
280077
280079
  }
280078
280080
 
280079
- return new ErrorClass(err.message, undefined, <string>err.id || 'UNKNOWN') // If error ID was not received do not pass undefined to generate a new one, flag it as UNKNOWN so we can fix the issue.
280081
+ return new ErrorClass(err.message, undefined, <string>err.id || 'UNKNOWN', err.metadata) // If error ID was not received do not pass undefined to generate a new one, flag it as UNKNOWN so we can fix the issue.
280080
280082
  }
280081
280083
 
280082
280084
  return new UnknownError('An invalid error occurred: ' + JSON.stringify(err))
@@ -280091,8 +280093,8 @@ function generateError2(error2) {
280091
280093
  * ${description}
280092
280094
  */
280093
280095
  export class ${error2.type}Error extends BaseApiError<${error2.status}, ${error2.type}Type, '${description}'> {
280094
- constructor(message: string, error?: Error, id?: string) {
280095
- super(${error2.status}, '${description}', '${error2.type}', message, error, id)
280096
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>) {
280097
+ super(${error2.status}, '${description}', '${error2.type}', message, error, id, metadata)
280096
280098
  }
280097
280099
  }
280098
280100
  `;
@@ -280108,7 +280110,7 @@ ${types2.map((type2) => ` | ${type2}Error`).join("\n")}
280108
280110
  `;
280109
280111
  }
280110
280112
  function generateErrorTypeMap(types2) {
280111
- return `const errorTypes: { [type: string]: new (message: string, error?: Error, id?: string) => ApiError } = {
280113
+ return `const errorTypes: { [type: string]: new (message: string, error?: Error, id?: string, metadata?: Record<string, unknown>) => ApiError } = {
280112
280114
  ${types2.map((type2) => ` ${type2}: ${type2}Error,`).join("\n")}
280113
280115
  }
280114
280116
  `;
@@ -294954,7 +294956,7 @@ var state = {
294954
294956
  "title": "Botpress API",
294955
294957
  "description": "API for Botpress Cloud",
294956
294958
  "server": "https://api.botpress.cloud",
294957
- "version": "0.58.2",
294959
+ "version": "0.59.0",
294958
294960
  "prefix": "v1"
294959
294961
  },
294960
294962
  "errors": [
@@ -295077,11 +295079,6 @@ var state = {
295077
295079
  "status": 400,
295078
295080
  "type": "BreakingChanges",
295079
295081
  "description": "Request payload contains breaking changes which is not allowed for this resource without a version increment."
295080
- },
295081
- {
295082
- "status": 424,
295083
- "type": "UpstreamProvider",
295084
- "description": "The upstream provider returned an error or is currently unavailable."
295085
295082
  }
295086
295083
  ],
295087
295084
  "refs": {
@@ -11883,10 +11883,6 @@ export declare const state: {
11883
11883
  status: 402;
11884
11884
  type: string;
11885
11885
  description: string;
11886
- } | {
11887
- status: 424;
11888
- type: string;
11889
- description: string;
11890
11886
  })[];
11891
11887
  refs: {
11892
11888
  parameters: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/api",
3
- "version": "0.58.2",
3
+ "version": "0.59.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -23,6 +23,6 @@
23
23
  "zod": "^3.22.4"
24
24
  },
25
25
  "dependencies": {
26
- "@bpinternal/opapi": "0.11.1"
26
+ "@bpinternal/opapi": "0.12.0"
27
27
  }
28
28
  }
@@ -1 +1 @@
1
- {"sections":[{"description":"","title":"User","name":"user","operations":["createUser","getUser","listUsers","getOrCreateUser","updateUser","deleteUser"],"schema":"User"},{"description":"","title":"Conversation","name":"conversation","operations":["createConversation","getConversation","listConversations","getOrCreateConversation","updateConversation","deleteConversation","listParticipants","addParticipant","getParticipant","removeParticipant"],"schema":"Conversation"},{"description":"","title":"Event","name":"event","operations":["createEvent","getEvent","listEvents"],"schema":"Event"},{"description":"","title":"Message","name":"message","operations":["createMessage","getOrCreateMessage","getMessage","updateMessage","listMessages","deleteMessage"],"schema":"Message"},{"description":"","title":"State","name":"state","operations":["setStateExpiry","getState","setState","getOrSetState","patchState"],"schema":"State"},{"title":"Hub","description":"","name":"hub","operations":["listPublicIntegrations","getPublicIntegrationById","getPublicIntegration"]},{"description":"","title":"Action","name":"action","operations":["callAction"]},{"description":"","title":"Task","name":"task","operations":["getTask","createTask","updateTask","deleteTask","listTasks"],"schema":"Task"},{"description":"","title":"Workflow","name":"workflow","operations":["createWorkflow","getWorkflow","updateWorkflow","deleteWorkflow","listWorkflows","getOrCreateWorkflow"],"schema":"Workflow"},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","getBotIssue","listBotIssues","deleteBotIssue","listBotIssueEvents","listBotVersions","getBotVersion","createBotVersion","deployBotVersion"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["listIntegrationApiKeys","createIntegrationApiKey","deleteIntegrationApiKey","createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration","requestIntegrationVerification"],"schema":"Integration"},{"title":"Interface","description":"","name":"interface","operations":["createInterface","getInterface","getInterfaceByName","updateInterface","deleteInterface","listInterfaces"],"schema":"Interface"},{"title":"Plugin","description":"","name":"plugin","operations":["createPlugin","getPlugin","getPluginByName","updatePlugin","deletePlugin","listPlugins"],"schema":"Plugin"},{"title":"Workspace","description":"","name":"workspace","operations":["listWorkspaceInvoices","getUpcomingInvoice","chargeWorkspaceUnpaidInvoices","createWorkspace","getPublicWorkspace","getWorkspace","listWorkspaceUsages","breakDownWorkspaceUsageByBot","getAllWorkspaceQuotaCompletion","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","checkHandleAvailability","listWorkspaces","listPublicWorkspaces","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","getWorkspaceMember","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","updateAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken","setAccountPreference","getAccountPreference"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage","getMultipleUsages"],"schema":"Usage"},{"title":"Quotas","description":"","name":"quotas","operations":["changeAISpendQuota"]},{"title":"Helper","description":"","name":"helper","operations":["runVrl"]},{"title":"Activity","description":"","name":"activity","operations":["listActivities"],"schema":"Activity"},{"title":"Tables","description":"Manage and interact with table structures, including creation, updates, and querying of tables and their rows.","name":"tables","operations":["listTables","getTable","getOrCreateTable","createTable","duplicateTable","exportTable","getTableJobs","importTable","updateTable","renameTableColumn","deleteTable","getTableRow","findTableRows","createTableRows","deleteTableRows","updateTableRows","upsertTableRows"],"schema":"Table"},{"title":"Files","description":"The Files API allows you to create, manage, and index files that can be used by your bots and integrations. Files can be in any text or binary format, and documents (such as PDF, Microsoft Word, HTML, Markdown, etc.) can be indexed to be used for semantic search in RAG (Retrieval Augmented Generation) implementations. Files are private by default but can be made publicly accessible through a permanent URL that's unique for each file.","name":"files","operations":["upsertFile","deleteFile","listFiles","getFile","updateFileMetadata","searchFiles","listFilePassages"],"schema":"File"}],"errors":[{"status":500,"type":"Unknown","description":"An unknown error occurred"},{"status":500,"type":"Internal","description":"An internal error occurred"},{"status":401,"type":"Unauthorized","description":"The request requires to be authenticated."},{"status":403,"type":"Forbidden","description":"The requested action can't be peform by this resource."},{"status":413,"type":"PayloadTooLarge","description":"The request payload is too large."},{"status":400,"type":"InvalidPayload","description":"The request payload is invalid."},{"status":415,"type":"UnsupportedMediaType","description":"The request is invalid because the content-type is not supported."},{"status":405,"type":"MethodNotFound","description":"The requested method does not exist."},{"status":404,"type":"ResourceNotFound","description":"The requested resource does not exist."},{"status":400,"type":"InvalidJsonSchema","description":"The provided JSON schema is invalid."},{"status":400,"type":"InvalidDataFormat","description":"The provided data doesn't respect the provided JSON schema."},{"status":400,"type":"InvalidIdentifier","description":"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters."},{"status":409,"type":"RelationConflict","description":"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together."},{"status":409,"type":"ReferenceConstraint","description":"The resource cannot be deleted because it's referenced by another resource"},{"status":409,"type":"ResourceLockedConflict","description":"The resource is current locked and cannot be operated on until the lock is released."},{"status":400,"type":"ReferenceNotFound","description":"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request."},{"status":400,"type":"InvalidQuery","description":"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource."},{"status":400,"type":"Runtime","description":"An error happened during the execution of a runtime (bot or integration)."},{"status":409,"type":"AlreadyExists","description":"The record attempted to be created already exists."},{"status":429,"type":"RateLimited","description":"The request has been rate limited."},{"status":402,"type":"PaymentRequired","description":"A payment is required to perform this request."},{"status":403,"type":"QuotaExceeded","description":"The request exceeds the allowed quota. Quotas are a soft limit that can be increased."},{"status":413,"type":"LimitExceeded","description":"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased."},{"status":400,"type":"BreakingChanges","description":"Request payload contains breaking changes which is not allowed for this resource without a version increment."},{"status":424,"type":"UpstreamProvider","description":"The upstream provider returned an error or is currently unavailable."}]}
1
+ {"sections":[{"description":"","title":"User","name":"user","operations":["createUser","getUser","listUsers","getOrCreateUser","updateUser","deleteUser"],"schema":"User"},{"description":"","title":"Conversation","name":"conversation","operations":["createConversation","getConversation","listConversations","getOrCreateConversation","updateConversation","deleteConversation","listParticipants","addParticipant","getParticipant","removeParticipant"],"schema":"Conversation"},{"description":"","title":"Event","name":"event","operations":["createEvent","getEvent","listEvents"],"schema":"Event"},{"description":"","title":"Message","name":"message","operations":["createMessage","getOrCreateMessage","getMessage","updateMessage","listMessages","deleteMessage"],"schema":"Message"},{"description":"","title":"State","name":"state","operations":["setStateExpiry","getState","setState","getOrSetState","patchState"],"schema":"State"},{"title":"Hub","description":"","name":"hub","operations":["listPublicIntegrations","getPublicIntegrationById","getPublicIntegration"]},{"description":"","title":"Action","name":"action","operations":["callAction"]},{"description":"","title":"Task","name":"task","operations":["getTask","createTask","updateTask","deleteTask","listTasks"],"schema":"Task"},{"description":"","title":"Workflow","name":"workflow","operations":["createWorkflow","getWorkflow","updateWorkflow","deleteWorkflow","listWorkflows","getOrCreateWorkflow"],"schema":"Workflow"},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","getBotIssue","listBotIssues","deleteBotIssue","listBotIssueEvents","listBotVersions","getBotVersion","createBotVersion","deployBotVersion"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["listIntegrationApiKeys","createIntegrationApiKey","deleteIntegrationApiKey","createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration","requestIntegrationVerification"],"schema":"Integration"},{"title":"Interface","description":"","name":"interface","operations":["createInterface","getInterface","getInterfaceByName","updateInterface","deleteInterface","listInterfaces"],"schema":"Interface"},{"title":"Plugin","description":"","name":"plugin","operations":["createPlugin","getPlugin","getPluginByName","updatePlugin","deletePlugin","listPlugins"],"schema":"Plugin"},{"title":"Workspace","description":"","name":"workspace","operations":["listWorkspaceInvoices","getUpcomingInvoice","chargeWorkspaceUnpaidInvoices","createWorkspace","getPublicWorkspace","getWorkspace","listWorkspaceUsages","breakDownWorkspaceUsageByBot","getAllWorkspaceQuotaCompletion","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","checkHandleAvailability","listWorkspaces","listPublicWorkspaces","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","getWorkspaceMember","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","updateAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken","setAccountPreference","getAccountPreference"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage","getMultipleUsages"],"schema":"Usage"},{"title":"Quotas","description":"","name":"quotas","operations":["changeAISpendQuota"]},{"title":"Helper","description":"","name":"helper","operations":["runVrl"]},{"title":"Activity","description":"","name":"activity","operations":["listActivities"],"schema":"Activity"},{"title":"Tables","description":"Manage and interact with table structures, including creation, updates, and querying of tables and their rows.","name":"tables","operations":["listTables","getTable","getOrCreateTable","createTable","duplicateTable","exportTable","getTableJobs","importTable","updateTable","renameTableColumn","deleteTable","getTableRow","findTableRows","createTableRows","deleteTableRows","updateTableRows","upsertTableRows"],"schema":"Table"},{"title":"Files","description":"The Files API allows you to create, manage, and index files that can be used by your bots and integrations. Files can be in any text or binary format, and documents (such as PDF, Microsoft Word, HTML, Markdown, etc.) can be indexed to be used for semantic search in RAG (Retrieval Augmented Generation) implementations. Files are private by default but can be made publicly accessible through a permanent URL that's unique for each file.","name":"files","operations":["upsertFile","deleteFile","listFiles","getFile","updateFileMetadata","searchFiles","listFilePassages"],"schema":"File"}],"errors":[{"status":500,"type":"Unknown","description":"An unknown error occurred"},{"status":500,"type":"Internal","description":"An internal error occurred"},{"status":401,"type":"Unauthorized","description":"The request requires to be authenticated."},{"status":403,"type":"Forbidden","description":"The requested action can't be peform by this resource."},{"status":413,"type":"PayloadTooLarge","description":"The request payload is too large."},{"status":400,"type":"InvalidPayload","description":"The request payload is invalid."},{"status":415,"type":"UnsupportedMediaType","description":"The request is invalid because the content-type is not supported."},{"status":405,"type":"MethodNotFound","description":"The requested method does not exist."},{"status":404,"type":"ResourceNotFound","description":"The requested resource does not exist."},{"status":400,"type":"InvalidJsonSchema","description":"The provided JSON schema is invalid."},{"status":400,"type":"InvalidDataFormat","description":"The provided data doesn't respect the provided JSON schema."},{"status":400,"type":"InvalidIdentifier","description":"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters."},{"status":409,"type":"RelationConflict","description":"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together."},{"status":409,"type":"ReferenceConstraint","description":"The resource cannot be deleted because it's referenced by another resource"},{"status":409,"type":"ResourceLockedConflict","description":"The resource is current locked and cannot be operated on until the lock is released."},{"status":400,"type":"ReferenceNotFound","description":"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request."},{"status":400,"type":"InvalidQuery","description":"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource."},{"status":400,"type":"Runtime","description":"An error happened during the execution of a runtime (bot or integration)."},{"status":409,"type":"AlreadyExists","description":"The record attempted to be created already exists."},{"status":429,"type":"RateLimited","description":"The request has been rate limited."},{"status":402,"type":"PaymentRequired","description":"A payment is required to perform this request."},{"status":403,"type":"QuotaExceeded","description":"The request exceeds the allowed quota. Quotas are a soft limit that can be increased."},{"status":413,"type":"LimitExceeded","description":"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased."},{"status":400,"type":"BreakingChanges","description":"Request payload contains breaking changes which is not allowed for this resource without a version increment."}]}