@twilio-labs/plugin-flex 4.3.0-flex-ui-2.1 → 4.3.1-dev.202201212032

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 (41) hide show
  1. package/README.md +23 -24
  2. package/dist/clients/FlexConfigurationClient.js +7 -1
  3. package/dist/clients/FlexConfigurationClient.js.map +1 -1
  4. package/dist/clients/ServerlessClient.d.ts +27 -0
  5. package/dist/clients/ServerlessClient.js +53 -2
  6. package/dist/clients/ServerlessClient.js.map +1 -1
  7. package/dist/commands/flex/plugins/archive/configuration.d.ts +1 -1
  8. package/dist/commands/flex/plugins/archive/plugin-version.d.ts +23 -1
  9. package/dist/commands/flex/plugins/archive/plugin-version.js +86 -1
  10. package/dist/commands/flex/plugins/archive/plugin-version.js.map +1 -1
  11. package/dist/commands/flex/plugins/archive/plugin.d.ts +12 -1
  12. package/dist/commands/flex/plugins/archive/plugin.js +54 -1
  13. package/dist/commands/flex/plugins/archive/plugin.js.map +1 -1
  14. package/dist/commands/flex/plugins/deploy.js +1 -2
  15. package/dist/commands/flex/plugins/deploy.js.map +1 -1
  16. package/dist/commands/flex/plugins/describe/configuration.d.ts +1 -1
  17. package/dist/commands/flex/plugins/describe/plugin-version.d.ts +1 -1
  18. package/dist/commands/flex/plugins/describe/plugin.d.ts +1 -1
  19. package/dist/commands/flex/plugins/describe/release.d.ts +1 -1
  20. package/dist/commands/flex/plugins/diff.d.ts +1 -2
  21. package/dist/commands/flex/plugins/diff.js.map +1 -1
  22. package/dist/commands/flex/plugins/list/configurations.d.ts +1 -1
  23. package/dist/commands/flex/plugins/list/plugin-versions.d.ts +1 -1
  24. package/dist/commands/flex/plugins/list/plugins.d.ts +1 -1
  25. package/dist/commands/flex/plugins/list/releases.d.ts +1 -1
  26. package/dist/commands/flex/plugins/release.d.ts +5 -2
  27. package/dist/commands/flex/plugins/upgrade-plugin.d.ts +6 -11
  28. package/dist/commands/flex/plugins/upgrade-plugin.js +11 -68
  29. package/dist/commands/flex/plugins/upgrade-plugin.js.map +1 -1
  30. package/dist/prints/index.d.ts +1 -3
  31. package/dist/prints/upgradePlugin.d.ts +1 -3
  32. package/dist/prints/upgradePlugin.js +3 -21
  33. package/dist/prints/upgradePlugin.js.map +1 -1
  34. package/dist/sub-commands/archive-resource.js +4 -1
  35. package/dist/sub-commands/archive-resource.js.map +1 -1
  36. package/dist/sub-commands/create-configuration.d.ts +1 -1
  37. package/dist/sub-commands/flex-plugin.d.ts +11 -14
  38. package/dist/sub-commands/flex-plugin.js +38 -34
  39. package/dist/sub-commands/flex-plugin.js.map +1 -1
  40. package/oclif.manifest.json +1 -1
  41. package/package.json +18 -16
package/README.md CHANGED
@@ -81,7 +81,7 @@ OPTIONS
81
81
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
82
82
  ```
83
83
 
84
- _See code: [dist/commands/flex/plugins/archive/configuration.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/archive/configuration.js)_
84
+ _See code: [dist/commands/flex/plugins/archive/configuration.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/archive/configuration.js)_
85
85
 
86
86
  ## `twilio flex:plugins:archive:plugin`
87
87
 
@@ -99,7 +99,7 @@ OPTIONS
99
99
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
100
100
  ```
101
101
 
102
- _See code: [dist/commands/flex/plugins/archive/plugin.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/archive/plugin.js)_
102
+ _See code: [dist/commands/flex/plugins/archive/plugin.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/archive/plugin.js)_
103
103
 
104
104
  ## `twilio flex:plugins:archive:plugin-version`
105
105
 
@@ -118,7 +118,7 @@ OPTIONS
118
118
  --version=version (required) The Flex Plugin Version to archive.
119
119
  ```
120
120
 
121
- _See code: [dist/commands/flex/plugins/archive/plugin-version.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/archive/plugin-version.js)_
121
+ _See code: [dist/commands/flex/plugins/archive/plugin-version.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/archive/plugin-version.js)_
122
122
 
123
123
  ## `twilio flex:plugins:build`
124
124
 
@@ -135,7 +135,7 @@ OPTIONS
135
135
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
136
136
  ```
137
137
 
138
- _See code: [dist/commands/flex/plugins/build.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/build.js)_
138
+ _See code: [dist/commands/flex/plugins/build.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/build.js)_
139
139
 
140
140
  ## `twilio flex:plugins:create NAME`
141
141
 
@@ -162,11 +162,11 @@ OPTIONS
162
162
  -y, --yarn Use yarn as your dependency manager
163
163
 
164
164
  DESCRIPTION
165
- Arguments:
165
+ Arguments:
166
166
  name Name of your plugin. This command needs to be invoked inside a plugin directory.
167
167
  ```
168
168
 
169
- _See code: [dist/commands/flex/plugins/create.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/create.js)_
169
+ _See code: [dist/commands/flex/plugins/create.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/create.js)_
170
170
 
171
171
  ## `twilio flex:plugins:create-configuration`
172
172
 
@@ -191,7 +191,7 @@ OPTIONS
191
191
  as a shortcut for enabling the latest version of the plugin. Use additional
192
192
  --enable-plugin to provide other plugins to enable.
193
193
 
194
- --name=name (required) [default: Autogenerated Release 1636406880972] The friendly name of the
194
+ --name=name (required) [default: Autogenerated Release 1642797364738] The friendly name of the
195
195
  Flex Plugin Configuration.
196
196
 
197
197
  --new Creates a new Flex Plugin Configuration, otherwise will append to existing active
@@ -202,7 +202,7 @@ OPTIONS
202
202
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
203
203
  ```
204
204
 
205
- _See code: [dist/commands/flex/plugins/create-configuration.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/create-configuration.js)_
205
+ _See code: [dist/commands/flex/plugins/create-configuration.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/create-configuration.js)_
206
206
 
207
207
  ## `twilio flex:plugins:deploy`
208
208
 
@@ -226,7 +226,7 @@ OPTIONS
226
226
  --version=version Publishes the version (SemVer).
227
227
  ```
228
228
 
229
- _See code: [dist/commands/flex/plugins/deploy.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/deploy.js)_
229
+ _See code: [dist/commands/flex/plugins/deploy.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/deploy.js)_
230
230
 
231
231
  ## `twilio flex:plugins:describe:configuration`
232
232
 
@@ -245,7 +245,7 @@ OPTIONS
245
245
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
246
246
  ```
247
247
 
248
- _See code: [dist/commands/flex/plugins/describe/configuration.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/describe/configuration.js)_
248
+ _See code: [dist/commands/flex/plugins/describe/configuration.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/describe/configuration.js)_
249
249
 
250
250
  ## `twilio flex:plugins:describe:plugin`
251
251
 
@@ -264,7 +264,7 @@ OPTIONS
264
264
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
265
265
  ```
266
266
 
267
- _See code: [dist/commands/flex/plugins/describe/plugin.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/describe/plugin.js)_
267
+ _See code: [dist/commands/flex/plugins/describe/plugin.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/describe/plugin.js)_
268
268
 
269
269
  ## `twilio flex:plugins:describe:plugin-version`
270
270
 
@@ -284,7 +284,7 @@ OPTIONS
284
284
  --version=version (required) The Flex Plugin Version to describe.
285
285
  ```
286
286
 
287
- _See code: [dist/commands/flex/plugins/describe/plugin-version.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/describe/plugin-version.js)_
287
+ _See code: [dist/commands/flex/plugins/describe/plugin-version.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/describe/plugin-version.js)_
288
288
 
289
289
  ## `twilio flex:plugins:describe:release`
290
290
 
@@ -304,7 +304,7 @@ OPTIONS
304
304
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
305
305
  ```
306
306
 
307
- _See code: [dist/commands/flex/plugins/describe/release.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/describe/release.js)_
307
+ _See code: [dist/commands/flex/plugins/describe/release.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/describe/release.js)_
308
308
 
309
309
  ## `twilio flex:plugins:diff ID1 [ID2]`
310
310
 
@@ -325,7 +325,7 @@ OPTIONS
325
325
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
326
326
  ```
327
327
 
328
- _See code: [dist/commands/flex/plugins/diff.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/diff.js)_
328
+ _See code: [dist/commands/flex/plugins/diff.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/diff.js)_
329
329
 
330
330
  ## `twilio flex:plugins:list:configurations`
331
331
 
@@ -343,7 +343,7 @@ OPTIONS
343
343
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
344
344
  ```
345
345
 
346
- _See code: [dist/commands/flex/plugins/list/configurations.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/list/configurations.js)_
346
+ _See code: [dist/commands/flex/plugins/list/configurations.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/list/configurations.js)_
347
347
 
348
348
  ## `twilio flex:plugins:list:plugin-versions`
349
349
 
@@ -362,7 +362,7 @@ OPTIONS
362
362
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
363
363
  ```
364
364
 
365
- _See code: [dist/commands/flex/plugins/list/plugin-versions.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/list/plugin-versions.js)_
365
+ _See code: [dist/commands/flex/plugins/list/plugin-versions.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/list/plugin-versions.js)_
366
366
 
367
367
  ## `twilio flex:plugins:list:plugins`
368
368
 
@@ -380,7 +380,7 @@ OPTIONS
380
380
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
381
381
  ```
382
382
 
383
- _See code: [dist/commands/flex/plugins/list/plugins.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/list/plugins.js)_
383
+ _See code: [dist/commands/flex/plugins/list/plugins.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/list/plugins.js)_
384
384
 
385
385
  ## `twilio flex:plugins:list:releases`
386
386
 
@@ -398,7 +398,7 @@ OPTIONS
398
398
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
399
399
  ```
400
400
 
401
- _See code: [dist/commands/flex/plugins/list/releases.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/list/releases.js)_
401
+ _See code: [dist/commands/flex/plugins/list/releases.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/list/releases.js)_
402
402
 
403
403
  ## `twilio flex:plugins:release`
404
404
 
@@ -426,7 +426,7 @@ OPTIONS
426
426
  pluginName@latest as a shortcut for enabling the latest version of the plugin.
427
427
  Use additional --enable-plugin to provide other plugins to enable.
428
428
 
429
- --name=name [default: Autogenerated Release 1636406880972] The friendly name of the Flex
429
+ --name=name [default: Autogenerated Release 1642797364738] The friendly name of the Flex
430
430
  Plugin Configuration.
431
431
 
432
432
  --new Creates a new Flex Plugin Configuration, otherwise will append to existing
@@ -437,7 +437,7 @@ OPTIONS
437
437
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
438
438
  ```
439
439
 
440
- _See code: [dist/commands/flex/plugins/release.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/release.js)_
440
+ _See code: [dist/commands/flex/plugins/release.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/release.js)_
441
441
 
442
442
  ## `twilio flex:plugins:start`
443
443
 
@@ -462,7 +462,7 @@ OPTIONS
462
462
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
463
463
  ```
464
464
 
465
- _See code: [dist/commands/flex/plugins/start.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/start.js)_
465
+ _See code: [dist/commands/flex/plugins/start.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/start.js)_
466
466
 
467
467
  ## `twilio flex:plugins:test`
468
468
 
@@ -479,7 +479,7 @@ OPTIONS
479
479
  --silent Suppress output and logs. This is a shorthand for "-l none -o none".
480
480
  ```
481
481
 
482
- _See code: [dist/commands/flex/plugins/test.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/test.js)_
482
+ _See code: [dist/commands/flex/plugins/test.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/test.js)_
483
483
 
484
484
  ## `twilio flex:plugins:upgrade-plugin`
485
485
 
@@ -495,7 +495,6 @@ OPTIONS
495
495
  --beta If set, will upgrade to the latest beta version.
496
496
  --clear-terminal Clears the terminal before running the command.
497
497
  --dev If set, will upgrade to the latest dev version.
498
- --flex-ui-2.0 Update your plugin dependencies to be compatible with Flex UI 2.0.
499
498
  --install If set, will install the dependencies.
500
499
  --nightly If set, will upgrade to the latest nightly version.
501
500
 
@@ -509,5 +508,5 @@ OPTIONS
509
508
  --yes If set, will answer yes to all prompts.
510
509
  ```
511
510
 
512
- _See code: [dist/commands/flex/plugins/upgrade-plugin.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.0-flex-ui-2.1/dist/commands/flex/plugins/upgrade-plugin.js)_
511
+ _See code: [dist/commands/flex/plugins/upgrade-plugin.js](https://github.com/twilio/flex-plugin-builder/blob/v4.3.1-dev.202201212032/dist/commands/flex/plugins/upgrade-plugin.js)_
513
512
  <!-- commandsstop -->
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const phin_1 = __importDefault(require("phin"));
7
6
  const flex_dev_utils_1 = require("flex-dev-utils");
7
+ const https_proxy_agent_1 = require("https-proxy-agent");
8
+ const phin_1 = __importDefault(require("phin"));
8
9
  /**
9
10
  * Wrapper Twilio Flex Configuration Public API
10
11
  */
@@ -69,6 +70,8 @@ class FlexConfigurationClient {
69
70
  const url = this.options.region
70
71
  ? `https://flex-api.${this.options.region}.twilio.com/v1/Configuration`
71
72
  : 'https://flex-api.twilio.com/v1/Configuration';
73
+ // use proxy
74
+ const agent = process.env.HTTP_PROXY ? new https_proxy_agent_1.HttpsProxyAgent(process.env.HTTP_PROXY) : undefined;
72
75
  const response = await phin_1.default({
73
76
  url,
74
77
  method: 'POST',
@@ -78,6 +81,9 @@ class FlexConfigurationClient {
78
81
  },
79
82
  parse: 'json',
80
83
  data,
84
+ core: {
85
+ agent,
86
+ },
81
87
  });
82
88
  if (response.statusCode !== 200) {
83
89
  throw new flex_dev_utils_1.TwilioCliError(response.body);
@@ -1 +1 @@
1
- {"version":3,"file":"FlexConfigurationClient.js","sourceRoot":"","sources":["../../src/clients/FlexConfigurationClient.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,mDAAgD;AAShD;;GAEG;AACH,MAAqB,uBAAuB;IAK1C,YAAY,MAA4B,EAAE,OAAuC;QAC/E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACjC,MAAM,CAAC,qBAAqB,GAAG,EAAE,CAAC;SACnC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,gBAAgB;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAElC,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB,CAAC,UAAkB;QACnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACrD,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,C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AE,kBAAkB;gBAClC,aAAa,EAAE,SAAS,IAAI,EAAE;aAC/B;YACD,KAAK,EAAE,MAAM;YACb,IAAI;SACL,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE;YAC/B,MAAM,IAAI,+BAAc,CAAC,QAAQ,CAAC,IAAc,CAAC,CAAC;SACnD;IACH,CAAC;CACF;AA3FD,0CA2FC"}
1
+ {"version":3,"file":"FlexConfigurationClient.js","sourceRoot":"","sources":["../../src/clients/FlexConfigurationClient.ts"],"names":[],"mappings":";;;;;AACA,mDAAgD;AAChD,yDAAoD;AACpD,gDAAwB;AASxB;;GAEG;AACH,MAAqB,uBAAuB;IAK1C,YAAY,MAA4B,EAAE,OAAuC;QAC/E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACjC,MAAM,CAAC,qBAAqB,GAAG,EAAE,CAAC;SACnC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,gBAAgB;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAElC,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB,CAAC,UAAkB;QACnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACrD,OAAO,MAAM,CAAC;SACf;QAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAA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G,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAE/F,MAAM,QAAQ,GAAG,MAAM,cAAI,CAAC;YAC1B,GAAG;YACH,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,SAAS,IAAI,EAAE;aAC/B;YACD,KAAK,EAAE,MAAM;YACb,IAAI;YACJ,IAAI,EAAE;gBACJ,KAAK;aACN;SACF,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE;YAC/B,MAAM,IAAI,+BAAc,CAAC,QAAQ,CAAC,IAAc,CAAC,CAAC;SACnD;IACH,CAAC;CACF;AAjGD,0CAiGC"}
@@ -1,5 +1,7 @@
1
1
  import { ServiceInstance, ServiceListInstance, ServiceListInstanceCreateOptions } from 'twilio/lib/rest/serverless/v1/service';
2
+ import { BuildInstance, BuildListInstanceCreateOptions } from 'twilio/lib/rest/serverless/v1/service/build';
2
3
  import { Logger } from 'flex-dev-utils';
4
+ import { EnvironmentInstance } from 'twilio/lib/rest/serverless/v1/service/environment';
3
5
  /**
4
6
  * Wrapper Twilio Serverless Public API
5
7
  */
@@ -40,6 +42,31 @@ export default class ServerlessClient {
40
42
  * @param pluginName the plugin name
41
43
  */
42
44
  removeLegacy(serviceSid: string, pluginName: string): Promise<void>;
45
+ /**
46
+ * Creates a {@link BuildInstance} and deploys/activates it
47
+ * @param serviceSid the serviceSid the {@link BuildInstance} belongs to
48
+ * @param pluginName the plugin name that the build belongs to
49
+ * @param request the {@link BuildListInstanceCreateOptions} option
50
+ */
51
+ createBuildAndDeploy(serviceSid: string, pluginName: string, request: BuildListInstanceCreateOptions): Promise<void>;
52
+ /**
53
+ * Returns the {@link BuildInstance} belonging to the plugin name
54
+ * @param serviceSid the service sid
55
+ * @param pluginName the plugin name
56
+ */
57
+ getBuild(serviceSid: string, pluginName: string): Promise<BuildInstance | undefined>;
58
+ /**
59
+ * Deletes the {@link EnvironmentInstance}
60
+ * @param serviceSid the service sid
61
+ * @param environment the environment sid
62
+ */
63
+ deleteEnvironment(serviceSid: string, environmentSid: string): Promise<boolean>;
64
+ /**
65
+ * Returns the {@link EnvironmentInstance}
66
+ * @param serviceSid the service sid
67
+ * @param pluginName the plugin name
68
+ */
69
+ getEnvironment(serviceSid: string, pluginName: string): Promise<EnvironmentInstance | null>;
43
70
  /**
44
71
  * Fetches the {@link BuildInstance}
45
72
  * @param serviceSid the service sid
@@ -72,15 +72,66 @@ class ServerlessClient {
72
72
  .filter((asset) => !asset.path.includes(`/plugins/${pluginName}/0.0.0/bundle.js`))
73
73
  .map((asset) => asset.sid);
74
74
  const functions = build.functionVersions.map((func) => func).map((func) => func.sid);
75
- const data = {
75
+ const request = {
76
76
  assetVersions: assets,
77
77
  functionVersions: functions,
78
78
  // @ts-ignore this is a type definition error in Twilio; dependencies should be object[] not a string
79
79
  dependencies: build.dependencies,
80
80
  };
81
- const newBuild = await this.createBuild(serviceSid, data);
81
+ await this.createBuildAndDeploy(serviceSid, pluginName, request);
82
+ }
83
+ /**
84
+ * Creates a {@link BuildInstance} and deploys/activates it
85
+ * @param serviceSid the serviceSid the {@link BuildInstance} belongs to
86
+ * @param pluginName the plugin name that the build belongs to
87
+ * @param request the {@link BuildListInstanceCreateOptions} option
88
+ */
89
+ async createBuildAndDeploy(serviceSid, pluginName, request) {
90
+ const { environment } = await this.getBuildAndEnvironment(serviceSid, pluginName);
91
+ if (!environment) {
92
+ return;
93
+ }
94
+ const newBuild = await this.createBuild(serviceSid, request);
82
95
  await environment.deployments().create({ buildSid: newBuild.sid });
83
96
  }
97
+ /**
98
+ * Returns the {@link BuildInstance} belonging to the plugin name
99
+ * @param serviceSid the service sid
100
+ * @param pluginName the plugin name
101
+ */
102
+ async getBuild(serviceSid, pluginName) {
103
+ const { build } = await this.getBuildAndEnvironment(serviceSid, pluginName);
104
+ return build;
105
+ }
106
+ /**
107
+ * Deletes the {@link EnvironmentInstance}
108
+ * @param serviceSid the service sid
109
+ * @param environment the environment sid
110
+ */
111
+ async deleteEnvironment(serviceSid, environmentSid) {
112
+ const service = await this.getService(serviceSid);
113
+ if (!service) {
114
+ return false;
115
+ }
116
+ return service.environments().get(environmentSid).remove();
117
+ }
118
+ /**
119
+ * Returns the {@link EnvironmentInstance}
120
+ * @param serviceSid the service sid
121
+ * @param pluginName the plugin name
122
+ */
123
+ async getEnvironment(serviceSid, pluginName) {
124
+ const service = await this.getService(serviceSid);
125
+ if (!service) {
126
+ return null;
127
+ }
128
+ const list = await service.environments().list();
129
+ const environment = list.find((e) => e.uniqueName === pluginName);
130
+ if (!environment || !environment.sid) {
131
+ return null;
132
+ }
133
+ return environment;
134
+ }
84
135
  /**
85
136
  * Fetches the {@link BuildInstance}
86
137
  * @param serviceSid the service sid
@@ -1 +1 @@
1
- {"version":3,"file":"ServerlessClient.js","sourceRoot":"","sources":["../../src/clients/ServerlessClient.ts"],"names":[],"mappings":";;AAMA,mDAAwD;AAaxD;;GAEG;AACH,MAAqB,gBAAgB;IAcnC,YAAY,MAA2B,EAAE,MAAc;QACrD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,CAAC,UAAkB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,yBAAyB;QAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,gBAAgB,C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AY,EAAE,sDAAsD;CACrE,CAAC;AAEK,4BAAW,GAAG,KAAK,CAAC;AAEpB,oCAAmB,GAAG,GAAG,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Configuration } from 'flex-plugins-api-toolkit';
1
+ import { Configuration } from 'flex-plugins-api-client';
2
2
  import { OutputFlags } from '@oclif/parser/lib/parse';
3
3
  import * as flags from '../../../../utils/flags';
4
4
  import ArchiveResource from '../../../../sub-commands/archive-resource';
@@ -1,4 +1,4 @@
1
- import { PluginVersion } from 'flex-plugins-api-toolkit';
1
+ import { PluginVersion } from 'flex-plugins-api-client';
2
2
  import { OutputFlags } from '@oclif/parser/lib/parse';
3
3
  import * as flags from '../../../../utils/flags';
4
4
  import ArchiveResource from '../../../../sub-commands/archive-resource';
@@ -24,6 +24,28 @@ export default class FlexPluginsArchivePluginVersion extends ArchiveResource<Plu
24
24
  * @override
25
25
  */
26
26
  getResourceType(): string;
27
+ /**
28
+ * Archives the resource on flex-plugins-api service
29
+ * @private
30
+ */
31
+ private archiveOnPluginsAPI;
32
+ /**
33
+ * Removes the serverless files
34
+ * @param build the active {@link BuildInstance} to remove the files from
35
+ * @private
36
+ */
37
+ private removeServerlessFiles;
38
+ /**
39
+ * Filters the asset by path
40
+ * @param asset the asset to filter
41
+ * @private
42
+ */
43
+ private filterAssetExists;
44
+ /**
45
+ * Returns the {@link BuildInstance} if found. It will also return undefined if the pluginVersion is not part of this build
46
+ * @private
47
+ */
48
+ private getBuildIfActive;
27
49
  /**
28
50
  * @override
29
51
  */
@@ -22,15 +22,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
+ const flex_dev_utils_1 = require("flex-dev-utils");
25
26
  const flags = __importStar(require("../../../../utils/flags"));
26
27
  const archive_resource_1 = __importDefault(require("../../../../sub-commands/archive-resource"));
27
28
  const general_1 = require("../../../../utils/general");
28
29
  class FlexPluginsArchivePluginVersion extends archive_resource_1.default {
30
+ constructor() {
31
+ super(...arguments);
32
+ /**
33
+ * Filters the asset by path
34
+ * @param asset the asset to filter
35
+ * @private
36
+ */
37
+ // The type definition for this from the twilio-node library is broken
38
+ // eslint-disable-next-line @typescript-eslint/ban-types
39
+ this.filterAssetExists = (asset) => {
40
+ const path = `/plugins/${this._flags.name}/${this._flags.version}/`;
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ return asset.path.includes(path);
43
+ };
44
+ }
29
45
  /**
30
46
  * @override
31
47
  */
32
48
  async doArchive() {
33
- return this.pluginsApiToolkit.archivePluginVersion({ name: this._flags.name, version: this._flags.version });
49
+ const pluginVersion = await flex_dev_utils_1.progress('Archiving Flex Plugin Version', async () => this.archiveOnPluginsAPI());
50
+ await flex_dev_utils_1.progress('Cleaning up Twilio Assets', async () => {
51
+ const build = await this.getBuildIfActive();
52
+ if (!build) {
53
+ throw new flex_dev_utils_1.TwilioApiError(20400, 'Plugin version is already archived', 400);
54
+ }
55
+ await this.removeServerlessFiles(build);
56
+ });
57
+ return pluginVersion;
34
58
  }
35
59
  /**
36
60
  * @override
@@ -45,6 +69,67 @@ class FlexPluginsArchivePluginVersion extends archive_resource_1.default {
45
69
  getResourceType() {
46
70
  return 'Flex Plugin Version';
47
71
  }
72
+ /**
73
+ * Archives the resource on flex-plugins-api service
74
+ * @private
75
+ */
76
+ async archiveOnPluginsAPI() {
77
+ try {
78
+ return await this.pluginsApiToolkit.archivePluginVersion({
79
+ name: this._flags.name,
80
+ version: this._flags.version,
81
+ });
82
+ }
83
+ catch (e) {
84
+ if (general_1.instanceOf(e, flex_dev_utils_1.TwilioApiError) && e.status === 400) {
85
+ return this.pluginsApiToolkit.describePluginVersion({
86
+ name: this._flags.name,
87
+ version: this._flags.version,
88
+ });
89
+ }
90
+ throw e;
91
+ }
92
+ }
93
+ /**
94
+ * Removes the serverless files
95
+ * @param build the active {@link BuildInstance} to remove the files from
96
+ * @private
97
+ */
98
+ async removeServerlessFiles(build) {
99
+ var _a, _b, _c, _d;
100
+ const request = {
101
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
+ functionVersions: (_a = build.functionVersions) === null || _a === void 0 ? void 0 : _a.map((f) => f.sid),
103
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
104
+ assetVersions: (_b = build.assetVersions) === null || _b === void 0 ? void 0 : _b.filter((a) => !this.filterAssetExists(a)).map((a) => a.sid),
105
+ // @ts-ignore this is a type definition error in Twilio; dependencies should be object[] not a string
106
+ dependencies: build.dependencies,
107
+ runtime: 'node12',
108
+ };
109
+ if (((_c = request.assetVersions) === null || _c === void 0 ? void 0 : _c.length) === 0 && ((_d = request.functionVersions) === null || _d === void 0 ? void 0 : _d.length) === 0) {
110
+ const environment = await this.serverlessClient.getEnvironment(build.serviceSid, this._flags.name);
111
+ if (environment) {
112
+ await this.serverlessClient.deleteEnvironment(build.serviceSid, environment.sid);
113
+ }
114
+ return;
115
+ }
116
+ await this.serverlessClient.createBuildAndDeploy(build.serviceSid, this._flags.name, request);
117
+ }
118
+ /**
119
+ * Returns the {@link BuildInstance} if found. It will also return undefined if the pluginVersion is not part of this build
120
+ * @private
121
+ */
122
+ async getBuildIfActive() {
123
+ const serviceSid = await this.flexConfigurationClient.getServerlessSid();
124
+ if (!serviceSid) {
125
+ return undefined;
126
+ }
127
+ const build = await this.serverlessClient.getBuild(serviceSid, this._flags.name);
128
+ if (!(build === null || build === void 0 ? void 0 : build.assetVersions.find(this.filterAssetExists))) {
129
+ return undefined;
130
+ }
131
+ return build;
132
+ }
48
133
  /**
49
134
  * @override
50
135
  */
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-version.js","sourceRoot":"","sources":["../../../../../src/commands/flex/plugins/archive/plugin-version.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA,+DAAiD;AACjD,iGAAwE;AACxE,uDAA8D;AAE9D,MAAqB,+BAAgC,SAAQ,0BAA8B;IAiBzF;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/G,CAAC;IAED;;OAEG;IACH,OAAO;QACL,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QACtC,OAAO,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,0BAA0B;IAC1B,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,KAAK,CAAC;IAC3D,CAAC;;AA7CH,kDA8CC;AA7CQ,yCAAS,GAAG,qCAAqC,CAAC;AAElD,2CAAW,GAAG,2BAAiB,CAAC,+BAA+B,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAE1F,qCAAK,mCACP,0BAAe,CAAC,KAAK,KACxB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,+BAA+B,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;QAC7D,QAAQ,EAAE,IAAI;KACf,CAAC,EACF,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,+BAA+B,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO;QAChE,QAAQ,EAAE,IAAI;KACf,CAAC,IACF"}
1
+ {"version":3,"file":"plugin-version.js","sourceRoot":"","sources":["../../../../../src/commands/flex/plugins/archive/plugin-version.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAA0D;AAI1D,+DAAiD;AACjD,iGAAwE;AACxE,uDAA0E;AAE1E,MAAqB,+BAAgC,SAAQ,0B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AAC;QACpB,WAAW,EAAE,+BAA+B,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO;QAChE,QAAQ,EAAE,IAAI;KACf,CAAC,IACF"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from 'flex-plugins-api-toolkit';
1
+ import { Plugin } from 'flex-plugins-api-client';
2
2
  import { OutputFlags } from '@oclif/parser/lib/parse';
3
3
  import * as flags from '../../../../utils/flags';
4
4
  import ArchiveResource from '../../../../sub-commands/archive-resource';
@@ -23,6 +23,17 @@ export default class FlexPluginsArchivePlugin extends ArchiveResource<Plugin> {
23
23
  * @override
24
24
  */
25
25
  getResourceType(): string;
26
+ /**
27
+ * Archives the resource on flex-plugins-api service
28
+ * @private
29
+ */
30
+ private archiveOnPluginsAPI;
31
+ /**
32
+ * Removes the {@link EnvironmentInstance}
33
+ * @param alreadyArchived whether the resource on plugins-api is already archived or not
34
+ * @private
35
+ */
36
+ private removeServerlessEnvironment;
26
37
  /**
27
38
  * @override
28
39
  */