@botpress/api 0.43.1 → 0.43.2

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
@@ -283245,6 +283245,13 @@ var state = {
283245
283245
  "status": {
283246
283246
  "in": "query",
283247
283247
  "type": "string",
283248
+ "enum": [
283249
+ "pending",
283250
+ "ignored",
283251
+ "processed",
283252
+ "failed",
283253
+ "scheduled"
283254
+ ],
283248
283255
  "description": "Filter by status. Allowed values: pending, ignored, processed, failed."
283249
283256
  }
283250
283257
  },
@@ -283927,7 +283934,8 @@ var state = {
283927
283934
  "user",
283928
283935
  "bot",
283929
283936
  "integration",
283930
- "task"
283937
+ "task",
283938
+ "workflow"
283931
283939
  ]
283932
283940
  },
283933
283941
  "id": {
@@ -283994,7 +284002,8 @@ var state = {
283994
284002
  "user",
283995
284003
  "bot",
283996
284004
  "integration",
283997
- "task"
284005
+ "task",
284006
+ "workflow"
283998
284007
  ]
283999
284008
  },
284000
284009
  "id": {
@@ -284054,7 +284063,8 @@ var state = {
284054
284063
  "user",
284055
284064
  "bot",
284056
284065
  "integration",
284057
- "task"
284066
+ "task",
284067
+ "workflow"
284058
284068
  ]
284059
284069
  },
284060
284070
  "id": {
@@ -284127,7 +284137,8 @@ var state = {
284127
284137
  "user",
284128
284138
  "bot",
284129
284139
  "integration",
284130
- "task"
284140
+ "task",
284141
+ "workflow"
284131
284142
  ]
284132
284143
  },
284133
284144
  "id": {
@@ -284212,7 +284223,8 @@ var state = {
284212
284223
  "user",
284213
284224
  "bot",
284214
284225
  "integration",
284215
- "task"
284226
+ "task",
284227
+ "workflow"
284216
284228
  ]
284217
284229
  },
284218
284230
  "id": {
@@ -284664,6 +284676,393 @@ var state = {
284664
284676
  }
284665
284677
  }
284666
284678
  },
284679
+ "createWorkflow": {
284680
+ "name": "createWorkflow",
284681
+ "description": "Creates a new [Workflow](#schema_workflow).",
284682
+ "method": "post",
284683
+ "path": "/v1/chat/workflows",
284684
+ "requestBody": {
284685
+ "description": "Workflow data",
284686
+ "schema": {
284687
+ "type": "object",
284688
+ "properties": {
284689
+ "name": {
284690
+ "type": "string",
284691
+ "description": "Name of the workflow"
284692
+ },
284693
+ "input": {
284694
+ "type": "object",
284695
+ "additionalProperties": true,
284696
+ "description": "Content related to the workflow"
284697
+ },
284698
+ "parentWorkflowId": {
284699
+ "type": "string",
284700
+ "description": "Parent workflow id is the parent workflow that created this workflow"
284701
+ },
284702
+ "conversationId": {
284703
+ "type": "string",
284704
+ "description": "Conversation id related to this workflow"
284705
+ },
284706
+ "userId": {
284707
+ "type": "string",
284708
+ "description": "Specific user related to this workflow"
284709
+ },
284710
+ "timeoutAt": {
284711
+ "type": "string",
284712
+ "format": "date-time",
284713
+ "description": "The timeout date where the workflow should be failed in the ISO 8601 format"
284714
+ },
284715
+ "tags": {
284716
+ "type": "object",
284717
+ "additionalProperties": {
284718
+ "type": "string",
284719
+ "maxLength": 500
284720
+ },
284721
+ "description": "Tags for the [Workflow](#schema_workflow)"
284722
+ },
284723
+ "status": {
284724
+ "type": "string",
284725
+ "enum": [
284726
+ "pending",
284727
+ "in_progress"
284728
+ ]
284729
+ },
284730
+ "eventId": {
284731
+ "type": "string",
284732
+ "description": "Event id must be specified if the workflow is created with the status in_progress"
284733
+ }
284734
+ },
284735
+ "required": [
284736
+ "name",
284737
+ "status"
284738
+ ],
284739
+ "title": "createWorkflowBody",
284740
+ "additionalProperties": false
284741
+ }
284742
+ },
284743
+ "section": "workflow",
284744
+ "response": {
284745
+ "description": "Returns a [Workflow](#schema_workflow) object if creation succeeds. Returns an [Error](#errors) otherwise",
284746
+ "status": 201,
284747
+ "schema": {
284748
+ "type": "object",
284749
+ "properties": {
284750
+ "workflow": {
284751
+ "$ref": "#/components/schemas/Workflow"
284752
+ }
284753
+ },
284754
+ "required": [
284755
+ "workflow"
284756
+ ],
284757
+ "title": "createWorkflowResponse",
284758
+ "additionalProperties": false
284759
+ }
284760
+ },
284761
+ "parameters": {}
284762
+ },
284763
+ "getWorkflow": {
284764
+ "name": "getWorkflow",
284765
+ "description": "Retrieves the [Workflow](#schema_workflow) object for a valid identifier.",
284766
+ "method": "get",
284767
+ "path": "/v1/chat/workflows/{id}",
284768
+ "parameters": {
284769
+ "id": {
284770
+ "in": "path",
284771
+ "type": "string",
284772
+ "description": "Workflow id"
284773
+ }
284774
+ },
284775
+ "section": "workflow",
284776
+ "response": {
284777
+ "description": "Returns a [Workflow](#schema_workflow) object if a valid identifier was provided. Returns an [Error](#errors) otherwise",
284778
+ "schema": {
284779
+ "type": "object",
284780
+ "properties": {
284781
+ "workflow": {
284782
+ "$ref": "#/components/schemas/Workflow"
284783
+ }
284784
+ },
284785
+ "required": [
284786
+ "workflow"
284787
+ ],
284788
+ "title": "getWorkflowResponse",
284789
+ "additionalProperties": false
284790
+ }
284791
+ }
284792
+ },
284793
+ "updateWorkflow": {
284794
+ "name": "updateWorkflow",
284795
+ "description": "Update a [Workflow](#schema_workflow) object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.",
284796
+ "method": "put",
284797
+ "path": "/v1/chat/workflows/{id}",
284798
+ "parameters": {
284799
+ "id": {
284800
+ "in": "path",
284801
+ "type": "string",
284802
+ "description": "Workflow id"
284803
+ }
284804
+ },
284805
+ "requestBody": {
284806
+ "description": "Workflow data",
284807
+ "schema": {
284808
+ "type": "object",
284809
+ "properties": {
284810
+ "output": {
284811
+ "type": "object",
284812
+ "additionalProperties": true,
284813
+ "description": "Content related to the workflow"
284814
+ },
284815
+ "timeoutAt": {
284816
+ "type": "string",
284817
+ "format": "date-time",
284818
+ "description": "The timeout date where the workflow should be failed in the ISO 8601 format"
284819
+ },
284820
+ "status": {
284821
+ "type": "string",
284822
+ "enum": [
284823
+ "completed",
284824
+ "cancelled",
284825
+ "listening",
284826
+ "paused",
284827
+ "failed"
284828
+ ],
284829
+ "description": "Status of the workflow"
284830
+ },
284831
+ "failureReason": {
284832
+ "type": "string",
284833
+ "description": "Reason why the workflow failed"
284834
+ },
284835
+ "tags": {
284836
+ "type": "object",
284837
+ "additionalProperties": {
284838
+ "type": "string",
284839
+ "maxLength": 500
284840
+ },
284841
+ "description": "Tags for the [Workflow](#schema_workflow)"
284842
+ },
284843
+ "userId": {
284844
+ "type": "string",
284845
+ "description": "Specific user related to this workflow"
284846
+ }
284847
+ },
284848
+ "title": "updateWorkflowBody",
284849
+ "additionalProperties": false
284850
+ }
284851
+ },
284852
+ "section": "workflow",
284853
+ "response": {
284854
+ "description": "Returns an updated [Workflow](#schema_workflow) object if a valid identifier was provided. Returns an [Error](#errors) otherwise",
284855
+ "schema": {
284856
+ "type": "object",
284857
+ "properties": {
284858
+ "workflow": {
284859
+ "$ref": "#/components/schemas/Workflow"
284860
+ }
284861
+ },
284862
+ "required": [
284863
+ "workflow"
284864
+ ],
284865
+ "title": "updateWorkflowResponse",
284866
+ "additionalProperties": false
284867
+ }
284868
+ }
284869
+ },
284870
+ "deleteWorkflow": {
284871
+ "name": "deleteWorkflow",
284872
+ "description": "Permanently deletes a [Workflow](#schema_workflow). It cannot be undone.",
284873
+ "method": "delete",
284874
+ "path": "/v1/chat/workflows/{id}",
284875
+ "parameters": {
284876
+ "id": {
284877
+ "in": "path",
284878
+ "type": "string",
284879
+ "description": "Workflow id"
284880
+ }
284881
+ },
284882
+ "section": "workflow",
284883
+ "response": {
284884
+ "description": "Returns the [Workflow](#schema_workflow) object that was deleted",
284885
+ "schema": {
284886
+ "type": "object",
284887
+ "title": "deleteWorkflowResponse",
284888
+ "additionalProperties": false
284889
+ }
284890
+ }
284891
+ },
284892
+ "listWorkflows": {
284893
+ "name": "listWorkflows",
284894
+ "description": "Retrieves a list of [Workflow](#schema_workflow) you've previously created. The workflows are returned in sorted order, with the most recent appearing first. The list can be filtered using [Tags](/docs/developers/concepts/tags).",
284895
+ "method": "get",
284896
+ "path": "/v1/chat/workflows",
284897
+ "parameters": {
284898
+ "nextToken": {
284899
+ "in": "query",
284900
+ "description": "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
284901
+ "type": "string"
284902
+ },
284903
+ "tags": {
284904
+ "in": "query",
284905
+ "type": "object",
284906
+ "schema": {
284907
+ "type": "object",
284908
+ "additionalProperties": {
284909
+ "type": "string"
284910
+ }
284911
+ },
284912
+ "description": "Filter by tags"
284913
+ },
284914
+ "conversationId": {
284915
+ "in": "query",
284916
+ "type": "string",
284917
+ "description": "Conversation id"
284918
+ },
284919
+ "userId": {
284920
+ "in": "query",
284921
+ "type": "string",
284922
+ "description": "User id"
284923
+ },
284924
+ "parentWorkflowId": {
284925
+ "in": "query",
284926
+ "type": "string",
284927
+ "description": "Parent workflow id"
284928
+ },
284929
+ "statuses": {
284930
+ "in": "query",
284931
+ "type": "string[]",
284932
+ "description": "Status",
284933
+ "enum": [
284934
+ "pending",
284935
+ "in_progress",
284936
+ "failed",
284937
+ "completed",
284938
+ "listening",
284939
+ "paused",
284940
+ "timedout",
284941
+ "cancelled"
284942
+ ]
284943
+ },
284944
+ "name": {
284945
+ "in": "query",
284946
+ "description": "Workflow name",
284947
+ "type": "string"
284948
+ }
284949
+ },
284950
+ "section": "workflow",
284951
+ "response": {
284952
+ "description": "Returns a list of [Workflow](#schema_workflow) objects",
284953
+ "schema": {
284954
+ "type": "object",
284955
+ "properties": {
284956
+ "workflows": {
284957
+ "type": "array",
284958
+ "items": {
284959
+ "$ref": "#/components/schemas/Workflow"
284960
+ }
284961
+ },
284962
+ "meta": {
284963
+ "type": "object",
284964
+ "properties": {
284965
+ "nextToken": {
284966
+ "type": "string",
284967
+ "description": "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."
284968
+ }
284969
+ },
284970
+ "additionalProperties": false
284971
+ }
284972
+ },
284973
+ "required": [
284974
+ "workflows",
284975
+ "meta"
284976
+ ],
284977
+ "title": "listWorkflowsResponse",
284978
+ "additionalProperties": false
284979
+ }
284980
+ }
284981
+ },
284982
+ "getOrCreateWorkflow": {
284983
+ "name": "getOrCreateWorkflow",
284984
+ "description": "Get a workflow by tags or creates a new [Workflow](#schema_workflow) if it doesn't exists.",
284985
+ "method": "post",
284986
+ "path": "/v1/chat/workflows/get-or-create",
284987
+ "requestBody": {
284988
+ "description": "Workflow data",
284989
+ "schema": {
284990
+ "type": "object",
284991
+ "properties": {
284992
+ "name": {
284993
+ "type": "string",
284994
+ "description": "Name of the workflow"
284995
+ },
284996
+ "input": {
284997
+ "type": "object",
284998
+ "additionalProperties": true,
284999
+ "description": "Content related to the workflow"
285000
+ },
285001
+ "parentWorkflowId": {
285002
+ "type": "string",
285003
+ "description": "Parent workflow id is the parent workflow that created this workflow"
285004
+ },
285005
+ "conversationId": {
285006
+ "type": "string",
285007
+ "description": "Conversation id related to this workflow"
285008
+ },
285009
+ "userId": {
285010
+ "type": "string",
285011
+ "description": "Specific user related to this workflow"
285012
+ },
285013
+ "timeoutAt": {
285014
+ "type": "string",
285015
+ "format": "date-time",
285016
+ "description": "The timeout date where the workflow should be failed in the ISO 8601 format"
285017
+ },
285018
+ "tags": {
285019
+ "type": "object",
285020
+ "additionalProperties": {
285021
+ "type": "string",
285022
+ "maxLength": 500
285023
+ },
285024
+ "description": "Tags for the [Workflow](#schema_workflow)"
285025
+ },
285026
+ "status": {
285027
+ "type": "string",
285028
+ "enum": [
285029
+ "pending",
285030
+ "in_progress"
285031
+ ]
285032
+ },
285033
+ "eventId": {
285034
+ "type": "string",
285035
+ "description": "Event id must be specified if the workflow is created with the status in_progress"
285036
+ }
285037
+ },
285038
+ "required": [
285039
+ "name",
285040
+ "status"
285041
+ ],
285042
+ "title": "getOrCreateWorkflowBody",
285043
+ "additionalProperties": false
285044
+ }
285045
+ },
285046
+ "section": "workflow",
285047
+ "response": {
285048
+ "description": "Returns a [Workflow](#schema_workflow) object if creation succeeds. Returns an [Error](#errors) otherwise",
285049
+ "status": 200,
285050
+ "schema": {
285051
+ "type": "object",
285052
+ "properties": {
285053
+ "workflow": {
285054
+ "$ref": "#/components/schemas/Workflow"
285055
+ }
285056
+ },
285057
+ "required": [
285058
+ "workflow"
285059
+ ],
285060
+ "title": "getOrCreateWorkflowResponse",
285061
+ "additionalProperties": false
285062
+ }
285063
+ },
285064
+ "parameters": {}
285065
+ },
284667
285066
  "trackAnalytics": {
284668
285067
  "name": "trackAnalytics",
284669
285068
  "description": "Add an event to the analytics",
@@ -294232,7 +294631,7 @@ var state = {
294232
294631
  "title": "Botpress API",
294233
294632
  "description": "API for Botpress Cloud",
294234
294633
  "server": "https://api.botpress.cloud",
294235
- "version": "0.43.1",
294634
+ "version": "0.43.2",
294236
294635
  "prefix": "v1"
294237
294636
  },
294238
294637
  "errors": [
@@ -294379,6 +294778,9 @@ var state = {
294379
294778
  "configureIntegrationBody": true,
294380
294779
  "createTaskBody": true,
294381
294780
  "updateTaskBody": true,
294781
+ "createWorkflowBody": true,
294782
+ "updateWorkflowBody": true,
294783
+ "getOrCreateWorkflowBody": true,
294382
294784
  "trackAnalyticsBody": true,
294383
294785
  "runVrlBody": true,
294384
294786
  "updateAccountBody": true,
@@ -294455,6 +294857,12 @@ var state = {
294455
294857
  "updateTaskResponse": true,
294456
294858
  "deleteTaskResponse": true,
294457
294859
  "listTasksResponse": true,
294860
+ "createWorkflowResponse": true,
294861
+ "getWorkflowResponse": true,
294862
+ "updateWorkflowResponse": true,
294863
+ "deleteWorkflowResponse": true,
294864
+ "listWorkflowsResponse": true,
294865
+ "getOrCreateWorkflowResponse": true,
294458
294866
  "trackAnalyticsResponse": true,
294459
294867
  "runVrlResponse": true,
294460
294868
  "getAccountResponse": true,
@@ -294570,6 +294978,7 @@ var state = {
294570
294978
  "Message": true,
294571
294979
  "State": true,
294572
294980
  "Task": true,
294981
+ "Workflow": true,
294573
294982
  "Table": true,
294574
294983
  "Column": true,
294575
294984
  "Row": true,
@@ -296352,6 +296761,12 @@ var state = {
296352
296761
  "maxLength": 36,
296353
296762
  "description": "Id of the current [Task](#schema_task)"
296354
296763
  },
296764
+ "currentWorkflowId": {
296765
+ "type": "string",
296766
+ "minLength": 28,
296767
+ "maxLength": 36,
296768
+ "description": "Id of the current [Workflow](#schema_workflow)"
296769
+ },
296355
296770
  "createdAt": {
296356
296771
  "type": "string",
296357
296772
  "format": "date-time",
@@ -296386,7 +296801,7 @@ var state = {
296386
296801
  "integration",
296387
296802
  "tags"
296388
296803
  ],
296389
- "description": "The conversation object represents an exchange of messages between one or more users. A [Conversation](#schema_conversation) is always linked to an integration's channels. For example, a Slack channel represents a conversation.",
296804
+ "description": "The [Conversation](#schema_conversation) object represents an exchange of messages between one or more users. A [Conversation](#schema_conversation) is always linked to an integration's channels. For example, a Slack channel represents a conversation.",
296390
296805
  "additionalProperties": false
296391
296806
  }
296392
296807
  },
@@ -296582,9 +296997,10 @@ var state = {
296582
296997
  "user",
296583
296998
  "bot",
296584
296999
  "task",
296585
- "integration"
297000
+ "integration",
297001
+ "workflow"
296586
297002
  ],
296587
- "description": "Type of the [State](#schema_state) represents the resource type (`conversation`, `user`, `bot`, `task` or `integration`) that the state is related to"
297003
+ "description": "Type of the [State](#schema_state) represents the resource type (`conversation`, `user`, `bot`, `task`, `integration` or `workflow`) that the state is related to"
296588
297004
  },
296589
297005
  "payload": {
296590
297006
  "type": "object",
@@ -296711,6 +297127,112 @@ var state = {
296711
297127
  "additionalProperties": false
296712
297128
  }
296713
297129
  },
297130
+ "Workflow": {
297131
+ "section": "workflow",
297132
+ "schema": {
297133
+ "type": "object",
297134
+ "properties": {
297135
+ "id": {
297136
+ "type": "string",
297137
+ "minLength": 28,
297138
+ "maxLength": 36,
297139
+ "description": "Id of the [Workflow](#schema_workflow)"
297140
+ },
297141
+ "name": {
297142
+ "type": "string",
297143
+ "maxLength": 200,
297144
+ "description": "Name of the workflow"
297145
+ },
297146
+ "status": {
297147
+ "type": "string",
297148
+ "enum": [
297149
+ "pending",
297150
+ "in_progress",
297151
+ "failed",
297152
+ "completed",
297153
+ "listening",
297154
+ "paused",
297155
+ "timedout",
297156
+ "cancelled"
297157
+ ],
297158
+ "description": "Status of the [Workflow](#schema_workflow)"
297159
+ },
297160
+ "input": {
297161
+ "type": "object",
297162
+ "additionalProperties": true,
297163
+ "description": "Input provided to the [Workflow](#schema_workflow)"
297164
+ },
297165
+ "output": {
297166
+ "type": "object",
297167
+ "additionalProperties": true,
297168
+ "description": "Data returned by the [Workflow](#schema_workflow) output"
297169
+ },
297170
+ "parentWorkflowId": {
297171
+ "type": "string",
297172
+ "minLength": 28,
297173
+ "maxLength": 36,
297174
+ "description": "Parent [Workflow](#schema_workflow) id is the parent [Workflow](#schema_workflow) that created this [Workflow](#schema_workflow)"
297175
+ },
297176
+ "conversationId": {
297177
+ "type": "string",
297178
+ "minLength": 28,
297179
+ "maxLength": 36,
297180
+ "description": "Conversation id related to this [Workflow](#schema_workflow)"
297181
+ },
297182
+ "userId": {
297183
+ "type": "string",
297184
+ "minLength": 28,
297185
+ "maxLength": 36,
297186
+ "description": "User id related to this [Workflow](#schema_workflow)"
297187
+ },
297188
+ "createdAt": {
297189
+ "type": "string",
297190
+ "format": "date-time",
297191
+ "description": "Creation date of the [Workflow](#schema_workflow) in ISO 8601 format"
297192
+ },
297193
+ "updatedAt": {
297194
+ "type": "string",
297195
+ "format": "date-time",
297196
+ "description": "Updating date of the [Workflow](#schema_workflow) in ISO 8601 format"
297197
+ },
297198
+ "completedAt": {
297199
+ "type": "string",
297200
+ "format": "date-time",
297201
+ "description": "The date when the [Workflow](#schema_workflow) completed in ISO 8601 format"
297202
+ },
297203
+ "failureReason": {
297204
+ "type": "string",
297205
+ "maxLength": 2e3,
297206
+ "description": "If the [Workflow](#schema_workflow) fails this is the reason behind it"
297207
+ },
297208
+ "timeoutAt": {
297209
+ "type": "string",
297210
+ "format": "date-time",
297211
+ "description": "The timeout date when the [Workflow](#schema_workflow) will fail in the ISO 8601 format"
297212
+ },
297213
+ "tags": {
297214
+ "type": "object",
297215
+ "additionalProperties": {
297216
+ "type": "string"
297217
+ },
297218
+ "description": "Set of [Tags](/docs/developers/concepts/tags) that you can attach to a [Workflow](#schema_workflow). Individual keys can be unset by posting an empty value to them."
297219
+ }
297220
+ },
297221
+ "required": [
297222
+ "id",
297223
+ "name",
297224
+ "status",
297225
+ "input",
297226
+ "output",
297227
+ "createdAt",
297228
+ "updatedAt",
297229
+ "timeoutAt",
297230
+ "tags"
297231
+ ],
297232
+ "description": "Workflow definition",
297233
+ "additionalProperties": false
297234
+ }
297235
+ },
296714
297236
  "Table": {
296715
297237
  "section": "tables",
296716
297238
  "schema": {
@@ -297336,6 +297858,20 @@ var state = {
297336
297858
  ],
297337
297859
  "schema": "Task"
297338
297860
  },
297861
+ {
297862
+ "description": "",
297863
+ "title": "Workflow",
297864
+ "name": "workflow",
297865
+ "operations": [
297866
+ "createWorkflow",
297867
+ "getWorkflow",
297868
+ "updateWorkflow",
297869
+ "deleteWorkflow",
297870
+ "listWorkflows",
297871
+ "getOrCreateWorkflow"
297872
+ ],
297873
+ "schema": "Workflow"
297874
+ },
297339
297875
  {
297340
297876
  "title": "Bot",
297341
297877
  "description": "",