@twilio/flex-plugin-e2e-tests 5.0.0

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.
Files changed (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/dist/core/index.d.ts +3 -0
  4. package/dist/core/index.js +16 -0
  5. package/dist/core/index.js.map +1 -0
  6. package/dist/core/parameters.d.ts +54 -0
  7. package/dist/core/parameters.js +95 -0
  8. package/dist/core/parameters.js.map +1 -0
  9. package/dist/core/runner.d.ts +8 -0
  10. package/dist/core/runner.js +313 -0
  11. package/dist/core/runner.js.map +1 -0
  12. package/dist/core/suites.d.ts +11 -0
  13. package/dist/core/suites.js +17 -0
  14. package/dist/core/suites.js.map +1 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.js +16 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/tests/step001.d.ts +3 -0
  19. package/dist/tests/step001.js +65 -0
  20. package/dist/tests/step001.js.map +1 -0
  21. package/dist/tests/step002.d.ts +3 -0
  22. package/dist/tests/step002.js +133 -0
  23. package/dist/tests/step002.js.map +1 -0
  24. package/dist/tests/step003.d.ts +3 -0
  25. package/dist/tests/step003.js +63 -0
  26. package/dist/tests/step003.js.map +1 -0
  27. package/dist/tests/step004.d.ts +3 -0
  28. package/dist/tests/step004.js +65 -0
  29. package/dist/tests/step004.js.map +1 -0
  30. package/dist/tests/step005.d.ts +3 -0
  31. package/dist/tests/step005.js +86 -0
  32. package/dist/tests/step005.js.map +1 -0
  33. package/dist/tests/step006.d.ts +3 -0
  34. package/dist/tests/step006.js +122 -0
  35. package/dist/tests/step006.js.map +1 -0
  36. package/dist/tests/step007.d.ts +3 -0
  37. package/dist/tests/step007.js +122 -0
  38. package/dist/tests/step007.js.map +1 -0
  39. package/dist/tests/step008.d.ts +3 -0
  40. package/dist/tests/step008.js +103 -0
  41. package/dist/tests/step008.js.map +1 -0
  42. package/dist/tests/step009.d.ts +3 -0
  43. package/dist/tests/step009.js +119 -0
  44. package/dist/tests/step009.js.map +1 -0
  45. package/dist/tests/step010.d.ts +3 -0
  46. package/dist/tests/step010.js +168 -0
  47. package/dist/tests/step010.js.map +1 -0
  48. package/dist/tests/step011.d.ts +3 -0
  49. package/dist/tests/step011.js +164 -0
  50. package/dist/tests/step011.js.map +1 -0
  51. package/dist/tests/step012.d.ts +3 -0
  52. package/dist/tests/step012.js +177 -0
  53. package/dist/tests/step012.js.map +1 -0
  54. package/dist/utils/assertion.d.ts +39 -0
  55. package/dist/utils/assertion.js +151 -0
  56. package/dist/utils/assertion.js.map +1 -0
  57. package/dist/utils/browser.d.ts +20 -0
  58. package/dist/utils/browser.js +142 -0
  59. package/dist/utils/browser.js.map +1 -0
  60. package/dist/utils/console-api.d.ts +43 -0
  61. package/dist/utils/console-api.js +154 -0
  62. package/dist/utils/console-api.js.map +1 -0
  63. package/dist/utils/index.d.ts +9 -0
  64. package/dist/utils/index.js +35 -0
  65. package/dist/utils/index.js.map +1 -0
  66. package/dist/utils/pages/app.d.ts +37 -0
  67. package/dist/utils/pages/app.js +133 -0
  68. package/dist/utils/pages/app.js.map +1 -0
  69. package/dist/utils/pages/index.d.ts +1 -0
  70. package/dist/utils/pages/index.js +14 -0
  71. package/dist/utils/pages/index.js.map +1 -0
  72. package/dist/utils/pages/view/admin-dashboard.d.ts +17 -0
  73. package/dist/utils/pages/view/admin-dashboard.js +91 -0
  74. package/dist/utils/pages/view/admin-dashboard.js.map +1 -0
  75. package/dist/utils/pages/view/agent-desktop.d.ts +17 -0
  76. package/dist/utils/pages/view/agent-desktop.js +91 -0
  77. package/dist/utils/pages/view/agent-desktop.js.map +1 -0
  78. package/dist/utils/pages/view/base.d.ts +29 -0
  79. package/dist/utils/pages/view/base.js +124 -0
  80. package/dist/utils/pages/view/base.js.map +1 -0
  81. package/dist/utils/pages/view/plugins.d.ts +31 -0
  82. package/dist/utils/pages/view/plugins.js +112 -0
  83. package/dist/utils/pages/view/plugins.js.map +1 -0
  84. package/dist/utils/pages/view/twilio-console.d.ts +26 -0
  85. package/dist/utils/pages/view/twilio-console.js +143 -0
  86. package/dist/utils/pages/view/twilio-console.js.map +1 -0
  87. package/dist/utils/plugin-helper.d.ts +6 -0
  88. package/dist/utils/plugin-helper.js +131 -0
  89. package/dist/utils/plugin-helper.js.map +1 -0
  90. package/dist/utils/plugins-api.d.ts +11 -0
  91. package/dist/utils/plugins-api.js +195 -0
  92. package/dist/utils/plugins-api.js.map +1 -0
  93. package/dist/utils/serverless-api.d.ts +7 -0
  94. package/dist/utils/serverless-api.js +117 -0
  95. package/dist/utils/serverless-api.js.map +1 -0
  96. package/dist/utils/spawn.d.ts +26 -0
  97. package/dist/utils/spawn.js +169 -0
  98. package/dist/utils/spawn.js.map +1 -0
  99. package/dist/utils/timers.d.ts +5 -0
  100. package/dist/utils/timers.js +48 -0
  101. package/dist/utils/timers.js.map +1 -0
  102. package/package.json +57 -0
@@ -0,0 +1,26 @@
1
+ /// <reference types="node" />
2
+ import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio } from 'child_process';
3
+ interface SpawnResult {
4
+ stdout: string;
5
+ stderr: string;
6
+ child?: ChildProcessWithoutNullStreams;
7
+ }
8
+ /**
9
+ * Promisified spawn
10
+ * @param cmd the command to spawn
11
+ * @param args the args to that command
12
+ * @param options spawn options to run
13
+ */
14
+ export declare const promisifiedSpawn: (cmd: string, args: string[], options?: SpawnOptionsWithoutStdio | undefined) => Promise<SpawnResult>;
15
+ /**
16
+ * Helper for logging the result from a spawn
17
+ * @param result the result to log
18
+ */
19
+ export declare const logResult: (result: SpawnResult) => void;
20
+ /**
21
+ * Kills child process
22
+ * @param child child process to kill
23
+ * @param os operating system
24
+ */
25
+ export declare const killChildProcess: (child: ChildProcessWithoutNullStreams | undefined, os: string) => Promise<void>;
26
+ export {};
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.killChildProcess = exports.logResult = exports.promisifiedSpawn = void 0;
51
+ var child_process_1 = require("child_process");
52
+ var flex_dev_utils_1 = require("@twilio/flex-dev-utils");
53
+ var core_1 = require("../core");
54
+ /**
55
+ * Logs the output in real time
56
+ */
57
+ var logInfo = function (data, level) {
58
+ data = data.toString().trim();
59
+ if (data) {
60
+ flex_dev_utils_1.logger[level]("[" + new Date().toUTCString() + "] -", data.toString().replace(/-/g, '\\-'));
61
+ }
62
+ };
63
+ /**
64
+ * Promisified spawn
65
+ * @param cmd the command to spawn
66
+ * @param args the args to that command
67
+ * @param options spawn options to run
68
+ */
69
+ var promisifiedSpawn = function (cmd, args, options) { return __awaiter(void 0, void 0, void 0, function () {
70
+ return __generator(this, function (_a) {
71
+ // eslint-disable-next-line consistent-return
72
+ return [2 /*return*/, new Promise(function (resolve, reject) {
73
+ var defaultOptions = {
74
+ cwd: core_1.homeDir,
75
+ env: {
76
+ PATH: core_1.testParams.environment.path + ":/" + core_1.homeDir + "/bin",
77
+ TWILIO_ACCOUNT_SID: core_1.testParams.secrets.api.accountSid,
78
+ TWILIO_AUTH_TOKEN: core_1.testParams.secrets.api.authToken,
79
+ TWILIO_REGION: core_1.testParams.config.region,
80
+ },
81
+ shell: true,
82
+ };
83
+ var spawnOptions = __assign(__assign({}, defaultOptions), options);
84
+ flex_dev_utils_1.logger.info("Running spawn command: **" + cmd + " " + args.join(' ').replace(/-/g, '\\-') + "**");
85
+ flex_dev_utils_1.logger.debug("Spawn options are **" + JSON.stringify(spawnOptions) + "**");
86
+ var child = child_process_1.spawn(cmd, args, spawnOptions);
87
+ var stdoutArr = [];
88
+ var stderrArr = [];
89
+ // errors
90
+ child.on('error', reject);
91
+ child.stdin.on('error', reject);
92
+ child.stdout.on('error', reject);
93
+ child.stderr.setEncoding('utf8');
94
+ child.stderr.on('error', reject);
95
+ child.stderr.on('data', function (data) {
96
+ logInfo(data, 'warning');
97
+ if (typeof data === 'string') {
98
+ stderrArr.push(Buffer.from(data, 'utf-8'));
99
+ }
100
+ else {
101
+ stderrArr.push(data);
102
+ }
103
+ });
104
+ // data
105
+ child.stdout.on('data', function (data) {
106
+ logInfo(data, 'info');
107
+ if (typeof data === 'string') {
108
+ stdoutArr.push(Buffer.from(data, 'utf-8'));
109
+ }
110
+ else {
111
+ stdoutArr.push(data);
112
+ }
113
+ });
114
+ child.on('close', function (code) {
115
+ var stdout = Buffer.concat(stdoutArr).toString();
116
+ var stderr = Buffer.concat(stderrArr).toString();
117
+ if (code === 0) {
118
+ return resolve({ stdout: stdout, stderr: stderr });
119
+ }
120
+ return reject(new Error("Command exited with code " + code + " and message " + stdout + ": " + stderr));
121
+ });
122
+ if (options === null || options === void 0 ? void 0 : options.detached) {
123
+ return resolve({
124
+ stdout: Buffer.concat(stdoutArr).toString(),
125
+ stderr: Buffer.concat(stderrArr).toString(),
126
+ child: child,
127
+ });
128
+ }
129
+ })];
130
+ });
131
+ }); };
132
+ exports.promisifiedSpawn = promisifiedSpawn;
133
+ /**
134
+ * Helper for logging the result from a spawn
135
+ * @param result the result to log
136
+ */
137
+ var logResult = function (result) {
138
+ flex_dev_utils_1.logger.info(result.stdout.replace(/-/g, '\\-'));
139
+ if (result.stderr) {
140
+ flex_dev_utils_1.logger.warning(result.stderr.replace(/-/g, '\\-'));
141
+ }
142
+ };
143
+ exports.logResult = logResult;
144
+ /**
145
+ * Kills child process
146
+ * @param child child process to kill
147
+ * @param os operating system
148
+ */
149
+ var killChildProcess = function (child, os) { return __awaiter(void 0, void 0, void 0, function () {
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0:
153
+ if (!child) {
154
+ throw new Error('Could not kill child process, process does not exist');
155
+ }
156
+ if (!(os === 'win32')) return [3 /*break*/, 2];
157
+ return [4 /*yield*/, exports.promisifiedSpawn('taskkill', ['/pid', "" + child.pid, '/f', '/t'])];
158
+ case 1:
159
+ _a.sent();
160
+ return [3 /*break*/, 3];
161
+ case 2:
162
+ child.kill();
163
+ _a.label = 3;
164
+ case 3: return [2 /*return*/];
165
+ }
166
+ });
167
+ }); };
168
+ exports.killChildProcess = killChildProcess;
169
+ //# sourceMappingURL=spawn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../src/utils/spawn.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgG;AAEhG,yDAAgD;AAEhD,gCAA8C;AAQ9C;;GAEG;AACH,IAAM,OAAO,GAAG,UAAC,IAAqB,EAAE,KAAyB;IAC/D,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,IAAI,EAAE;QACR,uBAAM,CAAC,KAAK,CAAC,CAAC,MAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,QAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACxF;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACI,IAAM,gBAAgB,GAAG,UAC9B,GAAW,EACX,IAAc,EACd,OAAkC;;QAElC,6CAA6C;QAC7C,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;gBACjC,IAAM,cAAc,GAAG;oBACrB,GAAG,EAAE,cAAO;oBACZ,GAAG,EAAE;wBACH,IAAI,EAAK,iBAAU,CAAC,WAAW,CAAC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AAC,SAAS,CAAC,CAAC,QAAQ,EAAE;wBAC3C,KAAK,OAAA;qBACN,CAAC,CAAC;iBACJ;YACH,CAAC,CAAC,EAAC;;KACJ,CAAC;AAxEW,QAAA,gBAAgB,oBAwE3B;AAEF;;;GAGG;AACI,IAAM,SAAS,GAAG,UAAC,MAAmB;IAC3C,uBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,uBAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACpD;AACH,CAAC,CAAC;AALW,QAAA,SAAS,aAKpB;AAEF;;;;GAIG;AACI,IAAM,gBAAgB,GAAG,UAC9B,KAAiD,EACjD,EAAU;;;;gBAEV,IAAI,CAAC,KAAK,EAAE;oBACV,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;iBACzE;qBAEG,CAAA,EAAE,KAAK,OAAO,CAAA,EAAd,wBAAc;gBAChB,qBAAM,wBAAgB,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,KAAG,KAAK,CAAC,GAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAA;;gBAAxE,SAAwE,CAAC;;;gBAEzE,KAAK,CAAC,IAAI,EAAE,CAAC;;;;;KAEhB,CAAC;AAbW,QAAA,gBAAgB,oBAa3B"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Sleeps for the given time
3
+ * @param ms time to sleep in milliseconds
4
+ */
5
+ export declare const sleep: (ms: number) => Promise<void>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.sleep = void 0;
40
+ /**
41
+ * Sleeps for the given time
42
+ * @param ms time to sleep in milliseconds
43
+ */
44
+ var sleep = function (ms) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
45
+ return [2 /*return*/, new Promise(function (resolve) { return setTimeout(resolve, ms); })];
46
+ }); }); };
47
+ exports.sleep = sleep;
48
+ //# sourceMappingURL=timers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timers.js","sourceRoot":"","sources":["../../src/utils/timers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACI,IAAM,KAAK,GAAG,UAAO,EAAU;IAAoB,sBAAA,IAAI,OAAO,CAAC,UAAC,OAAO,IAAK,OAAA,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,EAAvB,CAAuB,CAAC,EAAA;SAAA,CAAC;AAA/F,QAAA,KAAK,SAA0F"}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@twilio/flex-plugin-e2e-tests",
3
+ "version": "5.0.0",
4
+ "description": "Flex Plugin E2E Tests framework",
5
+ "keywords": [
6
+ "flex",
7
+ "plugins",
8
+ "scripts",
9
+ "twilio"
10
+ ],
11
+ "homepage": "https://github.com/twilio/flex-plugin-builder",
12
+ "bugs": {
13
+ "url": "https://github.com/twilio/flex-plugin-builder/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/twilio/flex-plugin-builder.git"
18
+ },
19
+ "license": "MIT",
20
+ "author": "Flex Runtime <flex-runtime@twilio.com>",
21
+ "main": "dist/index.js",
22
+ "types": "dist/index.d.ts",
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "prebuild": "npm run clean",
28
+ "build": "cd ../.. && tsc -p \"packages/flex-plugin-e2e-tests/tsconfig.json\"",
29
+ "clean": "rm -rf dist",
30
+ "create": "bin/e2e create $1",
31
+ "lint": "eslint --ext ts src/",
32
+ "lint:fix": "npm run lint -- --fix",
33
+ "start": "node dist",
34
+ "test": "exit 0"
35
+ },
36
+ "dependencies": {
37
+ "@twilio/flex-dev-utils": "5.0.0",
38
+ "@twilio/flex-plugins-api-client": "5.0.0",
39
+ "axios": "^0.24.0",
40
+ "lodash": "4.17.21",
41
+ "package-json": "^7.0.0",
42
+ "puppeteer": "^10.4.0",
43
+ "replace-in-file": "^6.3.2",
44
+ "semver": "^7.3.5"
45
+ },
46
+ "devDependencies": {
47
+ "@types/lodash": "4.14.177",
48
+ "@types/semver": "^7.3.9"
49
+ },
50
+ "engines": {
51
+ "node": "^12 || ^14 || ^16"
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ },
56
+ "gitHead": "7f9a9580b554b4f99aa4591e3ec9da17d2554729"
57
+ }