@botpress/api 0.17.0 → 0.18.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
@@ -428169,6 +428169,67 @@ var state = {
428169
428169
  }
428170
428170
  }
428171
428171
  },
428172
+ getOrSetState: {
428173
+ name: "getOrSetState",
428174
+ description: "Retrieves the [State](#schema_state) object for a valid identifiers. If the state does not exist, it creates a new state.",
428175
+ method: "post",
428176
+ path: "/v1/chat/states/{type}/{id}/{name}/get-or-set",
428177
+ parameters: {
428178
+ type: {
428179
+ in: "path",
428180
+ type: "string",
428181
+ description: "State type",
428182
+ enum: ["conversation", "user", "bot", "integration", "task"]
428183
+ },
428184
+ id: {
428185
+ in: "path",
428186
+ type: "string",
428187
+ description: "State id"
428188
+ },
428189
+ name: {
428190
+ in: "path",
428191
+ type: "string",
428192
+ description: "State name"
428193
+ }
428194
+ },
428195
+ requestBody: {
428196
+ description: "State content",
428197
+ schema: {
428198
+ type: "object",
428199
+ properties: {
428200
+ payload: {
428201
+ type: "object",
428202
+ additionalProperties: true,
428203
+ description: "Payload is the content of the state defined by your bot."
428204
+ },
428205
+ expiry: {
428206
+ type: "number",
428207
+ minimum: 1,
428208
+ maximum: 2592e6,
428209
+ description: "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."
428210
+ }
428211
+ },
428212
+ required: ["payload"],
428213
+ title: "getOrSetStateBody",
428214
+ additionalProperties: false
428215
+ }
428216
+ },
428217
+ section: "state",
428218
+ response: {
428219
+ description: "Returns the [State](#schema_state) object if a valid identifiers were provided. Returns [an error](#errors) otherwise.",
428220
+ schema: {
428221
+ type: "object",
428222
+ properties: {
428223
+ state: {
428224
+ $ref: "#/components/schemas/State"
428225
+ }
428226
+ },
428227
+ required: ["state"],
428228
+ title: "getOrSetStateResponse",
428229
+ additionalProperties: false
428230
+ }
428231
+ }
428232
+ },
428172
428233
  patchState: {
428173
428234
  name: "patchState",
428174
428235
  description: "Updates the [State](#schema_state) object by setting the values of the parameters passed.",
@@ -433309,7 +433370,7 @@ var state = {
433309
433370
  title: "Botpress API",
433310
433371
  description: "API for Botpress Cloud",
433311
433372
  server: "https://api.botpress.cloud",
433312
- version: "0.17.0",
433373
+ version: "0.18.0",
433313
433374
  prefix: "v1"
433314
433375
  },
433315
433376
  errors: [
@@ -433434,6 +433495,7 @@ var state = {
433434
433495
  getOrCreateUserBody: true,
433435
433496
  updateUserBody: true,
433436
433497
  setStateBody: true,
433498
+ getOrSetStateBody: true,
433437
433499
  patchStateBody: true,
433438
433500
  callActionBody: true,
433439
433501
  configureIntegrationBody: true,
@@ -433487,6 +433549,7 @@ var state = {
433487
433549
  deleteUserResponse: true,
433488
433550
  getStateResponse: true,
433489
433551
  setStateResponse: true,
433552
+ getOrSetStateResponse: true,
433490
433553
  patchStateResponse: true,
433491
433554
  callActionResponse: true,
433492
433555
  configureIntegrationResponse: true,
@@ -435441,7 +435504,7 @@ var state = {
435441
435504
  description: "",
435442
435505
  title: "State",
435443
435506
  name: "state",
435444
- operations: ["getState", "setState", "patchState"],
435507
+ operations: ["getState", "setState", "getOrSetState", "patchState"],
435445
435508
  schema: "State"
435446
435509
  },
435447
435510
  {
@@ -1275,6 +1275,67 @@ export declare const state: {
1275
1275
  };
1276
1276
  };
1277
1277
  };
1278
+ getOrSetState: {
1279
+ name: string;
1280
+ description: string;
1281
+ method: "post";
1282
+ path: string;
1283
+ parameters: {
1284
+ type: {
1285
+ in: "path";
1286
+ type: "string";
1287
+ description: string;
1288
+ enum: string[];
1289
+ };
1290
+ id: {
1291
+ in: "path";
1292
+ type: "string";
1293
+ description: string;
1294
+ };
1295
+ name: {
1296
+ in: "path";
1297
+ type: "string";
1298
+ description: string;
1299
+ };
1300
+ };
1301
+ requestBody: {
1302
+ description: string;
1303
+ schema: {
1304
+ type: "object";
1305
+ properties: {
1306
+ payload: {
1307
+ type: "object";
1308
+ additionalProperties: true;
1309
+ description: string;
1310
+ };
1311
+ expiry: {
1312
+ type: "number";
1313
+ minimum: number;
1314
+ maximum: number;
1315
+ description: string;
1316
+ };
1317
+ };
1318
+ required: string[];
1319
+ title: string;
1320
+ additionalProperties: false;
1321
+ };
1322
+ };
1323
+ section: "state";
1324
+ response: {
1325
+ description: string;
1326
+ schema: {
1327
+ type: "object";
1328
+ properties: {
1329
+ state: {
1330
+ $ref: string;
1331
+ };
1332
+ };
1333
+ required: string[];
1334
+ title: string;
1335
+ additionalProperties: false;
1336
+ };
1337
+ };
1338
+ };
1278
1339
  patchState: {
1279
1340
  name: string;
1280
1341
  description: string;
@@ -6164,6 +6225,7 @@ export declare const state: {
6164
6225
  getOrCreateUserBody: true;
6165
6226
  updateUserBody: true;
6166
6227
  setStateBody: true;
6228
+ getOrSetStateBody: true;
6167
6229
  patchStateBody: true;
6168
6230
  callActionBody: true;
6169
6231
  configureIntegrationBody: true;
@@ -6217,6 +6279,7 @@ export declare const state: {
6217
6279
  deleteUserResponse: true;
6218
6280
  getStateResponse: true;
6219
6281
  setStateResponse: true;
6282
+ getOrSetStateResponse: true;
6220
6283
  patchStateResponse: true;
6221
6284
  callActionResponse: true;
6222
6285
  configureIntegrationResponse: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/api",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -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":"File","name":"file","operations":["createFile","getFile","downloadFile","deleteFile","listFiles"],"schema":"File"},{"description":"","title":"State","name":"state","operations":["getState","setState","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"},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","listBotIssues","deleteBotIssue","listBotIssueEvents"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"title":"Workspace","description":"","name":"workspace","operations":["getWorkspaceBillingDetails","setWorkspacePaymentMethod","listWorkspaceInvoices","chargeWorkspaceUnpaidInvoices","createWorkspace","getWorkspace","listWorkspaceUsages","breakDownWorkspaceUsageByBot","getAllWorkspaceQuotaCompletion","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","checkHandleAvailability","listWorkspaces","changeWorkspacePlan","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken","setAccountPreference","getAccountPreference"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage"],"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":"Operations related to table management.","name":"tables","operations":[],"schema":"Table"}],"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 not related with another resource. This is usually caused when providing two resources that aren't linked together."},{"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."}]}
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":"File","name":"file","operations":["createFile","getFile","downloadFile","deleteFile","listFiles"],"schema":"File"},{"description":"","title":"State","name":"state","operations":["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"},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","listBotIssues","deleteBotIssue","listBotIssueEvents"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"title":"Workspace","description":"","name":"workspace","operations":["getWorkspaceBillingDetails","setWorkspacePaymentMethod","listWorkspaceInvoices","chargeWorkspaceUnpaidInvoices","createWorkspace","getWorkspace","listWorkspaceUsages","breakDownWorkspaceUsageByBot","getAllWorkspaceQuotaCompletion","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","checkHandleAvailability","listWorkspaces","changeWorkspacePlan","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken","setAccountPreference","getAccountPreference"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage"],"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":"Operations related to table management.","name":"tables","operations":[],"schema":"Table"}],"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 not related with another resource. This is usually caused when providing two resources that aren't linked together."},{"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."}]}