-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated schema context params and postman requests.
- Loading branch information
1 parent
f1f22a9
commit 20c4aa6
Showing
22 changed files
with
179 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
...service/04 - Schema construction/ALERT v1/01 - Create and update schema/Create schema.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
meta { | ||
name: Create schema | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{BASE_URL}}/engine/schema | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
Content-Type: application/json | ||
x-api-key: {{API_KEY}} | ||
Authorization: Bearer {{MODERATOR_USER_JWT}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"TenantId": "{{TENANT_ID}}", | ||
"Name": "Alert V1", | ||
"Description": "This chema represents a workflow for ALERT emergency response management.", | ||
"Type": "ChatBot", | ||
"ContextParams": { | ||
"Name": "Schema instance context", | ||
"Params": [ | ||
{ | ||
"Name": "Phone", | ||
"Type": "Phonenumber", | ||
"Description": "This is phone number of CFR responding to emergency", | ||
"Value": "+91-9970155165" | ||
}, | ||
{ | ||
"Name": "Location", | ||
"Description": "This is the location where the emergency has occurred.", | ||
"Value": { | ||
"Longitude": 23.434343, | ||
"Lattitude": 43.454353 | ||
} | ||
}, | ||
{ | ||
"Name": "Timestamp", | ||
"Description": "This is the timestamp the emergency has been reported.", | ||
"Value": "2024-11-26T10:07:56.255Z" | ||
} | ||
] | ||
}, | ||
"RootNode": { | ||
"Type": "ExecutionNode", | ||
"Name": "Root Node", | ||
"Description": "Send first message upon triggering of the workflow", | ||
"Action": { | ||
"ActionType": "SendMessage", | ||
"Name": "Send First message", | ||
"Input": { | ||
"Params": [ | ||
{ | ||
"ActionType": "SendMessage", | ||
"Type": "Phonenumber", | ||
"Value": null, | ||
"Source": "Almanac", | ||
"Key": "ContextParams:Phone" | ||
}, | ||
{ | ||
"ActionType": "Send Message", | ||
"Type": "Text", | ||
"Value": "Hope you are safe." | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
tests { | ||
try { | ||
var jsonRes = res.getBody(); | ||
bru.setEnvVar("SCHEMA_ID", jsonRes.Data.id); | ||
bru.setEnvVar("SCHEMA_ROOT_NODE_ID", jsonRes.Data.RootNode.id); | ||
bru.setEnvVar("NODE_01_ID", jsonRes.Data.RootNode.id); | ||
} | ||
catch (error) { | ||
console.log(error.message); | ||
} | ||
|
||
test("Request is successfull", function () { | ||
expect(res.getStatus()).to.equal(201); | ||
var jsonRes = res.getBody(); | ||
expect(jsonRes.Status).to.eql('success'); | ||
}); | ||
|
||
test("Schema is created", function () { | ||
var jsonRes = res.getBody(); | ||
expect(jsonRes.Data).to.have.property('id'); | ||
expect(jsonRes.Data).to.have.property('Client'); | ||
expect(jsonRes.Data.Client).to.have.property('id'); | ||
expect(jsonRes.Data).to.have.property('Name'); | ||
expect(jsonRes.Data).to.have.property('Description'); | ||
expect(jsonRes.Data).to.have.property('ValidFrom'); | ||
expect(jsonRes.Data).to.have.property('RootNode'); | ||
}); | ||
|
||
} | ||
|
||
docs { | ||
User login with username/phone/email and password. | ||
|
||
'LoginRoleId' is the role id through which user wants to log into the system provided the user has the role. | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...rcise badges/Schema-15-Day exercise badge/01 - Get root Node - Extract nutrition data.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: 01 - Get root Node - Extract nutrition data | ||
type: http | ||
seq: 2 | ||
seq: 1 | ||
} | ||
|
||
get { | ||
|
2 changes: 1 addition & 1 deletion
2
...cise badges/Schema-15-Day exercise badge/02 - Create next node - Calculate Continuity.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: 02 - Create next node - Calculate Continuity | ||
type: http | ||
seq: 3 | ||
seq: 2 | ||
} | ||
|
||
post { | ||
|
2 changes: 1 addition & 1 deletion
2
...e badges/Schema-15-Day exercise badge/03 - Create next node - Extract existing badges.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: 03 - Create next node - Extract existing badges | ||
type: http | ||
seq: 5 | ||
seq: 4 | ||
} | ||
|
||
post { | ||
|
2 changes: 1 addition & 1 deletion
2
...n/exercise badges/Schema-15-Day exercise badge/04 - Create next node - Compare badges.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: 04 - Create next node - Compare badges | ||
type: http | ||
seq: 7 | ||
seq: 6 | ||
} | ||
|
||
post { | ||
|
2 changes: 1 addition & 1 deletion
2
...cise badges/Schema-15-Day exercise badge/05 - Create next node - Store updated badges.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: 05 - Create next node - Store updated badges | ||
type: http | ||
seq: 9 | ||
seq: 8 | ||
} | ||
|
||
post { | ||
|
89 changes: 0 additions & 89 deletions
89
...e/04 - Schema construction/exercise badges/Schema-15-Day exercise badge/Create schema.bru
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...4 - Schema construction/exercise badges/Schema-15-Day exercise badge/Get schema by Id.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: Get schema by Id | ||
type: http | ||
seq: 11 | ||
seq: 10 | ||
} | ||
|
||
get { | ||
|
2 changes: 1 addition & 1 deletion
2
...onstruction/exercise badges/Schema-15-Day exercise badge/Update next node for node 01.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: Update next node for node 01 | ||
type: http | ||
seq: 4 | ||
seq: 3 | ||
} | ||
|
||
put { | ||
|
2 changes: 1 addition & 1 deletion
2
...onstruction/exercise badges/Schema-15-Day exercise badge/Update next node for node 02.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: Update next node for node 02 | ||
type: http | ||
seq: 6 | ||
seq: 5 | ||
} | ||
|
||
put { | ||
|
2 changes: 1 addition & 1 deletion
2
...onstruction/exercise badges/Schema-15-Day exercise badge/Update next node for node 03.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: Update next node for node 03 | ||
type: http | ||
seq: 8 | ||
seq: 7 | ||
} | ||
|
||
put { | ||
|
2 changes: 1 addition & 1 deletion
2
...onstruction/exercise badges/Schema-15-Day exercise badge/Update next node for node 04.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
meta { | ||
name: Update next node for node 04 | ||
type: http | ||
seq: 10 | ||
seq: 9 | ||
} | ||
|
||
put { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.