@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 +65 -2
- package/dist/src/gen/state.d.ts +63 -0
- package/package.json +1 -1
- package/src/gen/metadata.json +1 -1
- package/src/gen/openapi.json +1 -1
- package/src/gen/state.ts +69 -2
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:
|
|
@@ -6684,7 +6749,7 @@ export const state = {
|
|
|
6684
6749
|
title: "Botpress API",
|
|
6685
6750
|
description: "API for Botpress Cloud",
|
|
6686
6751
|
server: "https://api.botpress.cloud",
|
|
6687
|
-
version: "0.
|
|
6752
|
+
version: "0.18.0",
|
|
6688
6753
|
prefix: "v1",
|
|
6689
6754
|
},
|
|
6690
6755
|
errors: [
|
|
@@ -6818,6 +6883,7 @@ export const state = {
|
|
|
6818
6883
|
getOrCreateUserBody: true,
|
|
6819
6884
|
updateUserBody: true,
|
|
6820
6885
|
setStateBody: true,
|
|
6886
|
+
getOrSetStateBody: true,
|
|
6821
6887
|
patchStateBody: true,
|
|
6822
6888
|
callActionBody: true,
|
|
6823
6889
|
configureIntegrationBody: true,
|
|
@@ -6871,6 +6937,7 @@ export const state = {
|
|
|
6871
6937
|
deleteUserResponse: true,
|
|
6872
6938
|
getStateResponse: true,
|
|
6873
6939
|
setStateResponse: true,
|
|
6940
|
+
getOrSetStateResponse: true,
|
|
6874
6941
|
patchStateResponse: true,
|
|
6875
6942
|
callActionResponse: true,
|
|
6876
6943
|
configureIntegrationResponse: true,
|
|
@@ -8908,7 +8975,7 @@ export const state = {
|
|
|
8908
8975
|
description: "",
|
|
8909
8976
|
title: "State",
|
|
8910
8977
|
name: "state",
|
|
8911
|
-
operations: ["getState", "setState", "patchState"],
|
|
8978
|
+
operations: ["getState", "setState", "getOrSetState", "patchState"],
|
|
8912
8979
|
schema: "State",
|
|
8913
8980
|
},
|
|
8914
8981
|
{
|