npm install trigger-pullerTrigger puller architecture
Password: lx123
npm start will run the test harness, which accepts POST requests with a body of the form
```
{
"lxMessage": {...},
"parameters": {...}
}
Where lxMessage is the triggering event, and parameters is the extensions install.
The following example will trigger an email reaction.
``
{
"lxMessage": {
"subject": "recordChangePostCommit",
"message": {
"contents": {
"record": {
"id": 12732137,
"apiName": "beer"
},
"priorState": {
"name": "Coopers Stout",
"unit_count": 21,
"gluten_free": { "tag": "true", "value": {} },
"foo": "bar"
},
"changeSet": {
"unit_count": 18
}
}
}
},
"parameters": {
"args": {
"field-unit_count": {
"fieldApiName": "unit_count",
"resolver": "recordField"
},
"email": {
"html": "Didja get that thing I sent you?",
"from": "Christie",
"text": "Didja get that thing I sent you?",
"subject": "That thing I sent you",
"recipients": "xie.williams@lanetix.com"
}
},
"condition": {
"qualifier": "bogan",
"expression": {
"expressions": [
{
"operands": [
{
"::argId": "field-unit_count"
},
20
],
"operator": "<="
}
],
"operator": "&"
}
},
"subject": "recordChangePostCommit",
"context": {
"record": {
"apiName": "beer"
}
},
"name": "Unit Count Low",
"description": "Sends an email when unit count drops below threshold.",
"reactions": [
{
"handler": "email",
"argId": "email"
}
],
"id": "triggerpullerb0625452cadc4ce0aa75cef02427f606"
}
}
We're not flow typed yet, but for documentation's sake.
`
type LxMessage = {
subject: string,
message: Object
}
type Condition = {
qualifier: 'bogan' | 'alwaysTrue',
expression?: Object
}
type Reaction = {
handler: 'dump' | 'email',
argId?: string
}
type Trigger = {
id: string,
args: Object,
name: string,
subject: 'recordChangePostCommit',
condition: Condition,
reactions: Array
}
`
After merging your branch on Github, it doesn't automatically "deploy" once circle finishes building master. You also need to publish to extensions.
1. On your local, switch back to master branch of trigger-puller and run git pullnpm i -g @lanetix/lxt
2. Run . This is the extensions cli found herenpm version minor
3. Run (This can be major, minor, patch)lxt publish
4. Run . It will ask for your Lanetix login credentials. Input them.git push
5. Finally, to update the version in github.@latest`. Here is the link to the dynamoDB extensions table
6. Validate your code changes 1) by testing in production and 2) looking up the extensions table in dynamoDB to see the new version is indeed published, and it is at the