Skip to content

Instantly share code, notes, and snippets.

@justinvdm
Forked from hodgestar/campaign-api.js
Last active August 29, 2015 14:06
Show Gist options
  • Save justinvdm/efe3ebb19fad59adfca8 to your computer and use it in GitHub Desktop.
Save justinvdm/efe3ebb19fad59adfca8 to your computer and use it in GitHub Desktop.
var api = {};
api.routing = {
routing_table: {
version: 'fsm-0.1',
campaign_id: 'campaign1',
components: {
'channel1': {
type: 'channel',
uuid: 'channel1',
tag: ['apposit_sms', '*121#'],
name: '*121#',
description: 'Apposit Sms: *121#',
endpoints: [{
uuid: 'endpoint1',
name: 'default'
}]
},
'channel2': {
type: 'channel',
uuid: 'channel2',
tag: ['sigh_sms', '*131#'],
name: '*131#',
description: 'Sigh Sms: *131#',
endpoints: [{
uuid: 'endpoint2',
name: 'default'
}]
},
'channel3': {
type: 'channel',
uuid: 'channel3',
tag: ['larp_sms', '*141#'],
name: '*141#',
description: 'Larp Sms: *141#',
endpoints: [{
uuid: 'endpoint3',
name: 'default'
}]
},
'router1': {
type: 'router',
router_type: 'keyword',
uuid: 'router1',
name: 'keyword-router',
description: 'Keyword',
channel_endpoints: [{
uuid: 'endpoint4',
name: 'default'
}],
conversation_endpoints: [{
uuid: 'endpoint5',
name: 'default'
}]
},
'router2': {
type: 'router',
router_type: 'keyword',
uuid: 'router2',
name: 'keyword-router',
description: 'Keyword',
channel_endpoints: [{
uuid: 'endpoint6',
name: 'default'
}],
conversation_endpoints: [{
uuid: 'endpoint7',
name: 'default'
}]
},
'conversation1': {
type: 'conversation',
conversation_type: 'bulk-message',
uuid: 'conversation1',
name: 'bulk-message1',
description: 'Some Bulk Message App',
endpoints: [{
uuid: 'endpoint8',
name: 'default'
}]
},
'conversation2': {
type: 'conversation',
conversation_type: 'bulk-message',
uuid: 'conversation2',
name: 'bulk-message2',
description: 'Some Other Bulk Message App',
endpoints: [{
uuid: 'endpoint9',
name: 'default'
}]
},
'conversation3': {
type: 'conversation',
conversation_type: 'js-app',
uuid: 'conversation3',
name: 'js-app1',
description: 'Some JS App',
endpoints: [{
uuid: 'endpoint10',
name: 'default'
}, {
uuid: 'endpoint11',
name: 'sms'
}]
}
},
routing: {
'endpoint1:endpoint4': {
source: 'endpoint1',
target: 'endpoint4'
},
'endpoint4:endpoint1': {
source: 'endpoint4',
target: 'endpoint1'
}
},
},
layout: {
version: 'fsm-ui-0.1',
components: {
'channel1': {
// ...
},
'conversation1': {
x: 5,
y: 6,
color: 'red'
},
'router1': {
x: 7,
y: 8,
color: 'blue'
}
},
routing: {
'endpoint1:endpoint4': 'connection1',
'endpoint4:endpoint1': 'connection1'
},
connections: {
'connection1': {
endpoints: {
'endpoint1': 'channel1',
'endpoint4': 'router1'
},
path: [{
x: 6,
y: 7
}, {
x: 8,
y: 9
}],
color: 'blue'
}
}
}
};
@hodgestar
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment