@botpress/api 0.16.4 → 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/src/gen/state.ts CHANGED
@@ -1403,6 +1403,71 @@ export const state = {
1403
1403
  },
1404
1404
  },
1405
1405
  },
1406
+ getOrSetState: {
1407
+ name: "getOrSetState",
1408
+ description:
1409
+ "Retrieves the [State](#schema_state) object for a valid identifiers. If the state does not exist, it creates a new state.",
1410
+ method: "post",
1411
+ path: "/v1/chat/states/{type}/{id}/{name}/get-or-set",
1412
+ parameters: {
1413
+ type: {
1414
+ in: "path",
1415
+ type: "string",
1416
+ description: "State type",
1417
+ enum: ["conversation", "user", "bot", "integration", "task"],
1418
+ },
1419
+ id: {
1420
+ in: "path",
1421
+ type: "string",
1422
+ description: "State id",
1423
+ },
1424
+ name: {
1425
+ in: "path",
1426
+ type: "string",
1427
+ description: "State name",
1428
+ },
1429
+ },
1430
+ requestBody: {
1431
+ description: "State content",
1432
+ schema: {
1433
+ type: "object",
1434
+ properties: {
1435
+ payload: {
1436
+ type: "object",
1437
+ additionalProperties: true,
1438
+ description:
1439
+ "Payload is the content of the state defined by your bot.",
1440
+ },
1441
+ expiry: {
1442
+ type: "number",
1443
+ minimum: 1,
1444
+ maximum: 2592000000,
1445
+ description:
1446
+ "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.",
1447
+ },
1448
+ },
1449
+ required: ["payload"],
1450
+ title: "getOrSetStateBody",
1451
+ additionalProperties: false,
1452
+ },
1453
+ },
1454
+ section: "state",
1455
+ response: {
1456
+ description:
1457
+ "Returns the [State](#schema_state) object if a valid identifiers were provided. Returns [an error](#errors) otherwise.",
1458
+ schema: {
1459
+ type: "object",
1460
+ properties: {
1461
+ state: {
1462
+ $ref: "#/components/schemas/State",
1463
+ },
1464
+ },
1465
+ required: ["state"],
1466
+ title: "getOrSetStateResponse",
1467
+ additionalProperties: false,
1468
+ },
1469
+ },
1470
+ },
1406
1471
  patchState: {
1407
1472
  name: "patchState",
1408
1473
  description:
@@ -5326,6 +5391,31 @@ export const state = {
5326
5391
  additionalProperties: false,
5327
5392
  },
5328
5393
  },
5394
+ entities: {
5395
+ type: "object",
5396
+ additionalProperties: {
5397
+ type: "object",
5398
+ properties: {
5399
+ title: {
5400
+ type: "string",
5401
+ maxLength: 64,
5402
+ description: "Title of the entity",
5403
+ },
5404
+ description: {
5405
+ type: "string",
5406
+ maxLength: 256,
5407
+ description: "Description of the entity",
5408
+ },
5409
+ schema: {
5410
+ type: "object",
5411
+ additionalProperties: true,
5412
+ },
5413
+ },
5414
+ required: ["schema"],
5415
+ description: "Entity definition",
5416
+ additionalProperties: false,
5417
+ },
5418
+ },
5329
5419
  identifier: {
5330
5420
  type: "object",
5331
5421
  properties: {
@@ -5886,6 +5976,32 @@ export const state = {
5886
5976
  },
5887
5977
  additionalProperties: false,
5888
5978
  },
5979
+ entities: {
5980
+ type: "object",
5981
+ additionalProperties: {
5982
+ type: "object",
5983
+ properties: {
5984
+ title: {
5985
+ type: "string",
5986
+ maxLength: 64,
5987
+ description: "Title of the entity",
5988
+ },
5989
+ description: {
5990
+ type: "string",
5991
+ maxLength: 256,
5992
+ description: "Description of the entity",
5993
+ },
5994
+ schema: {
5995
+ type: "object",
5996
+ additionalProperties: true,
5997
+ },
5998
+ },
5999
+ required: ["schema"],
6000
+ description: "Entity definition",
6001
+ nullable: true,
6002
+ additionalProperties: false,
6003
+ },
6004
+ },
5889
6005
  secrets: {
5890
6006
  type: "object",
5891
6007
  additionalProperties: {
@@ -6633,7 +6749,7 @@ export const state = {
6633
6749
  title: "Botpress API",
6634
6750
  description: "API for Botpress Cloud",
6635
6751
  server: "https://api.botpress.cloud",
6636
- version: "0.16.4",
6752
+ version: "0.18.0",
6637
6753
  prefix: "v1",
6638
6754
  },
6639
6755
  errors: [
@@ -6767,6 +6883,7 @@ export const state = {
6767
6883
  getOrCreateUserBody: true,
6768
6884
  updateUserBody: true,
6769
6885
  setStateBody: true,
6886
+ getOrSetStateBody: true,
6770
6887
  patchStateBody: true,
6771
6888
  callActionBody: true,
6772
6889
  configureIntegrationBody: true,
@@ -6820,6 +6937,7 @@ export const state = {
6820
6937
  deleteUserResponse: true,
6821
6938
  getStateResponse: true,
6822
6939
  setStateResponse: true,
6940
+ getOrSetStateResponse: true,
6823
6941
  patchStateResponse: true,
6824
6942
  callActionResponse: true,
6825
6943
  configureIntegrationResponse: true,
@@ -7693,6 +7811,31 @@ export const state = {
7693
7811
  description: "User object configuration",
7694
7812
  additionalProperties: false,
7695
7813
  },
7814
+ entities: {
7815
+ type: "object",
7816
+ additionalProperties: {
7817
+ type: "object",
7818
+ properties: {
7819
+ title: {
7820
+ type: "string",
7821
+ maxLength: 64,
7822
+ description: "Title of the entity",
7823
+ },
7824
+ description: {
7825
+ type: "string",
7826
+ maxLength: 256,
7827
+ description: "Description of the entity",
7828
+ },
7829
+ schema: {
7830
+ type: "object",
7831
+ additionalProperties: true,
7832
+ },
7833
+ },
7834
+ required: ["schema"],
7835
+ description: "Entity definition",
7836
+ additionalProperties: false,
7837
+ },
7838
+ },
7696
7839
  dev: {
7697
7840
  type: "boolean",
7698
7841
  description:
@@ -7743,6 +7886,7 @@ export const state = {
7743
7886
  "events",
7744
7887
  "actions",
7745
7888
  "user",
7889
+ "entities",
7746
7890
  "dev",
7747
7891
  "title",
7748
7892
  "description",
@@ -8831,7 +8975,7 @@ export const state = {
8831
8975
  description: "",
8832
8976
  title: "State",
8833
8977
  name: "state",
8834
- operations: ["getState", "setState", "patchState"],
8978
+ operations: ["getState", "setState", "getOrSetState", "patchState"],
8835
8979
  schema: "State",
8836
8980
  },
8837
8981
  {