UNPKG

2.95 kBJavaScriptView Raw
1/**
2 * Copyright (c) 2018, salesforce.com, inc.
3 * All rights reserved.
4 * Licensed under the BSD 3-Clause license.
5 * For full license text, see LICENSE.txt file in the repo root or
6 * https://opensource.org/licenses/BSD-3-Clause
7 */
8
9const actions = [
10 {
11 'name': 'newPost',
12 'parameters': [
13 {
14 'name': 'text',
15 'type': 'STRING'
16 },
17 {
18 'name': 'group',
19 'type': 'STRING'
20 },
21 {
22 'name': 'isComment',
23 'type': 'BOOLEAN'
24 },
25 {
26 'name': 'mentions',
27 'type': 'ARRAY'
28 },
29 {
30 'name': 'templateName',
31 'type': 'STRING'
32 }
33 ]
34 },
35 {
36 'name': 'sendEmail',
37 'parameters': [
38 {
39 'name': 'sender',
40 'type': 'STRING'
41 },
42 {
43 'name': 'subject',
44 'type': 'STRING'
45 },
46 {
47 'name': 'message',
48 'type': 'STRING'
49 },
50 {
51 'name': 'to',
52 'type': 'ARRAY'
53 },
54 {
55 'name': 'cc',
56 'type': 'ARRAY'
57 },
58 {
59 'name': 'bcc',
60 'type': 'ARRAY'
61 },
62 {
63 'name': 'templateName',
64 'type': 'STRING'
65 }
66 ]
67 }
68];
69
70const data = [
71 {
72 'name': 'commsBotTemplates',
73 'type': 'STRING'
74 },
75 {
76 'name': 'commsBotData',
77 'type': 'STRING'
78 },
79 {
80 'name': 'commsBotTimers',
81 'type': 'STRING'
82 },
83 {
84 'name': 'commsBotEmailHistory',
85 'type': 'STRING'
86 },
87 {
88 'name': 'commsBotChatterHistory',
89 'type': 'STRING'
90 }
91];
92
93const settings = [
94 {
95 'key': 'commsBotTemplates',
96 'type': 'ARRAY',
97 'helpText': 'This is an array of templates.'
98 },
99 {
100 'key': 'commsBotData',
101 'type': 'OBJECT',
102 'helpText': 'These are all of the variables to be used for the template.'
103 },
104 {
105 'key': 'commsBotTimers',
106 'type': 'ARRAY',
107 'helpText': 'This is an array of timer objects. '
108 }
109];
110
111const bot = {
112 name: 'IlikeBurrito',
113 url: 'https://buritto-stand.com',
114 helpUrl: 'https://better-buritto-stand.com',
115 ownerUrl: 'https://buritto-stand-owner.com',
116 active: true,
117 version: '2.0.0',
118 displayName: 'Insert Cool Nickname Here!',
119 ui: 'tests/bot.zip',
120 actions,
121 data,
122 settings
123};
124
125const botWithUI = {
126 name: 'ICanDisplayTacos',
127 url: 'https://taco-stand-with-ui.com',
128 active: true,
129 ui: 'tests/bot.zip',
130 version: '3.0.0',
131 actions,
132 data,
133 settings
134};
135
136const botActionsArray = [
137 {
138 isPending: true,
139 name: 'testActionName'
140 },
141 {
142 isPending: false,
143 name: 'testActionName'
144 }
145];
146
147const easyJSON = {
148 name: 'Test Name',
149 age: '16',
150 phoneNumber: '123456789',
151};
152
153const complicatedJSON = {
154 blah: `blah !@£$%^& "hi" ${'var name'} {}[]::;;||\\><//?><*();`,
155 includesTabs: ' \n 12345 aaa AAA ||',
156 complex: `"""""""""""""" {} ||\\'''''%%%${'var'}"""+=0---00`
157};
158
159module.exports = {
160 actions,
161 data,
162 settings,
163 bot,
164 botActionsArray,
165 botWithUI,
166 easyJSON,
167 complicatedJSON
168};