@corellium/corellium-cli 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. package/.gitlab-ci.yml +46 -1
  2. package/ci/gitlab-build.sh +1 -1
  3. package/coverage/cobertura-coverage.xml +9 -0
  4. package/coverage/lcov-report/base.css +224 -0
  5. package/coverage/lcov-report/block-navigation.js +87 -0
  6. package/coverage/lcov-report/favicon.png +0 -0
  7. package/coverage/lcov-report/index.html +101 -0
  8. package/coverage/lcov-report/prettify.css +1 -0
  9. package/coverage/lcov-report/prettify.js +2 -0
  10. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  11. package/coverage/lcov-report/sorter.js +196 -0
  12. package/coverage/lcov.info +0 -0
  13. package/index.js +2 -0
  14. package/node_modules/@babel/cli/node_modules/commander/package.json +22 -57
  15. package/node_modules/@babel/cli/node_modules/make-dir/package.json +57 -92
  16. package/node_modules/@babel/cli/node_modules/pify/package.json +49 -84
  17. package/node_modules/@babel/cli/node_modules/semver/package.json +15 -50
  18. package/node_modules/@babel/cli/node_modules/slash/package.json +32 -67
  19. package/node_modules/@babel/cli/package.json +33 -69
  20. package/node_modules/@corellium/client-api/package.json +10 -39
  21. package/node_modules/@jridgewell/resolve-uri/package.json +35 -74
  22. package/node_modules/@jridgewell/sourcemap-codec/package.json +38 -73
  23. package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +91 -57
  24. package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -1
  25. package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +90 -56
  26. package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -1
  27. package/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +5 -5
  28. package/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +12 -5
  29. package/node_modules/@jridgewell/trace-mapping/package.json +34 -71
  30. package/node_modules/@nicolo-ribaudo/chokidar-2/package.json +17 -54
  31. package/node_modules/ansi-regex/package.json +53 -88
  32. package/node_modules/ansi-styles/package.json +54 -94
  33. package/node_modules/anymatch/package.json +23 -55
  34. package/node_modules/asynckit/package.json +40 -73
  35. package/node_modules/axios/package.json +41 -71
  36. package/node_modules/balanced-match/package.json +17 -48
  37. package/node_modules/binary-extensions/package.json +36 -72
  38. package/node_modules/brace-expansion/package.json +18 -49
  39. package/node_modules/braces/package.json +25 -75
  40. package/node_modules/call-bind/package.json +78 -124
  41. package/node_modules/chokidar/package.json +35 -73
  42. package/node_modules/cliui/package.json +48 -86
  43. package/node_modules/color-convert/package.json +20 -58
  44. package/node_modules/color-name/package.json +28 -60
  45. package/node_modules/combined-stream/package.json +14 -51
  46. package/node_modules/component-emitter/package.json +12 -44
  47. package/node_modules/concat-map/package.json +40 -88
  48. package/node_modules/convert-source-map/package.json +23 -54
  49. package/node_modules/cookiejar/package.json +11 -43
  50. package/node_modules/debug/package.json +32 -86
  51. package/node_modules/delayed-stream/package.json +14 -52
  52. package/node_modules/dotenv/package.json +32 -63
  53. package/node_modules/emoji-regex/package.json +27 -57
  54. package/node_modules/escalade/package.json +23 -58
  55. package/node_modules/fast-safe-stringify/package.json +28 -72
  56. package/node_modules/fill-range/package.json +23 -71
  57. package/node_modules/follow-redirects/package.json +37 -76
  58. package/node_modules/form-data/package.json +37 -73
  59. package/node_modules/formidable/package.json +17 -51
  60. package/node_modules/fs-readdir-recursive/package.json +15 -49
  61. package/node_modules/fs.realpath/package.json +16 -52
  62. package/node_modules/function-bind/package.json +23 -60
  63. package/node_modules/get-caller-file/package.json +22 -52
  64. package/node_modules/get-intrinsic/package.json +86 -123
  65. package/node_modules/glob/package.json +29 -67
  66. package/node_modules/glob-parent/package.json +22 -69
  67. package/node_modules/has/package.json +21 -54
  68. package/node_modules/has-symbols/package.json +99 -132
  69. package/node_modules/inflight/package.json +15 -47
  70. package/node_modules/inherits/package.json +12 -53
  71. package/node_modules/is-binary-path/package.json +38 -74
  72. package/node_modules/is-extglob/package.json +17 -51
  73. package/node_modules/is-fullwidth-code-point/package.json +40 -78
  74. package/node_modules/is-glob/package.json +21 -67
  75. package/node_modules/is-number/package.json +21 -64
  76. package/node_modules/lru-cache/package.json +22 -60
  77. package/node_modules/methods/package.json +17 -63
  78. package/node_modules/mime/package.json +15 -47
  79. package/node_modules/mime-db/package.json +20 -66
  80. package/node_modules/mime-types/package.json +15 -63
  81. package/node_modules/minimatch/package.json +20 -60
  82. package/node_modules/ms/package.json +19 -57
  83. package/node_modules/multi-progress/package.json +15 -45
  84. package/node_modules/normalize-path/package.json +20 -62
  85. package/node_modules/object-inspect/package.json +48 -80
  86. package/node_modules/once/package.json +14 -55
  87. package/node_modules/path-is-absolute/package.json +11 -46
  88. package/node_modules/picomatch/package.json +23 -59
  89. package/node_modules/progress/package.json +16 -64
  90. package/node_modules/qs/package.json +73 -104
  91. package/node_modules/readdirp/package.json +42 -82
  92. package/node_modules/require-directory/package.json +24 -56
  93. package/node_modules/safe-buffer/package.json +5 -37
  94. package/node_modules/semver/package.json +31 -69
  95. package/node_modules/side-channel/package.json +65 -97
  96. package/node_modules/string-width/package.json +54 -96
  97. package/node_modules/string_decoder/package.json +13 -46
  98. package/node_modules/strip-ansi/package.json +52 -93
  99. package/node_modules/superagent/node_modules/form-data/package.json +37 -73
  100. package/node_modules/superagent/node_modules/readable-stream/package.json +27 -59
  101. package/node_modules/superagent/package.json +8 -58
  102. package/node_modules/to-regex-range/package.json +20 -60
  103. package/node_modules/util-deprecate/package.json +14 -48
  104. package/node_modules/uuid/package.json +69 -101
  105. package/node_modules/wrap-ansi/package.json +60 -96
  106. package/node_modules/wrappy/package.json +16 -49
  107. package/node_modules/y18n/package.json +38 -72
  108. package/node_modules/yallist/package.json +15 -54
  109. package/node_modules/yargs/package.json +67 -98
  110. package/node_modules/yargs-parser/package.json +47 -82
  111. package/package.json +62 -64
  112. package/src/clients/Instance.js +4 -0
  113. package/src/commands/extensions/delete.js +2 -1
  114. package/src/commands/extensions/list.js +3 -2
  115. package/src/commands/firmware/list.js +3 -2
  116. package/src/commands/images/create.js +2 -2
  117. package/src/commands/images/delete.js +1 -0
  118. package/src/commands/images/list.js +3 -2
  119. package/src/commands/index.js +0 -2
  120. package/src/commands/{agent → instances}/apps/index.js +3 -3
  121. package/src/commands/instances/create.js +9 -3
  122. package/src/commands/{agent → instances}/file.js +2 -2
  123. package/src/commands/instances/index.js +6 -1
  124. package/src/commands/instances/input.js +52 -0
  125. package/src/commands/instances/list.js +3 -2
  126. package/src/commands/instances/upgrade.js +2 -2
  127. package/src/commands/projects/create.js +2 -2
  128. package/src/commands/projects/delete.js +2 -1
  129. package/src/commands/projects/list.js +3 -2
  130. package/src/commands/webplayer/create.js +2 -2
  131. package/src/commands/webplayer/list.js +2 -2
  132. package/src/error.js +12 -6
  133. package/src/table.js +1 -1
  134. package/src/utils.js +19 -40
  135. package/node_modules/@jridgewell/trace-mapping/src/any-map.ts +0 -166
  136. package/node_modules/@jridgewell/trace-mapping/src/binary-search.ts +0 -115
  137. package/node_modules/@jridgewell/trace-mapping/src/by-source.ts +0 -64
  138. package/node_modules/@jridgewell/trace-mapping/src/resolve.ts +0 -10
  139. package/node_modules/@jridgewell/trace-mapping/src/sort.ts +0 -45
  140. package/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts +0 -23
  141. package/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts +0 -8
  142. package/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts +0 -405
  143. package/node_modules/@jridgewell/trace-mapping/src/types.ts +0 -90
  144. package/node_modules/generate-password/.eslintrc.yml +0 -18
  145. package/node_modules/generate-password/.github/workflows/nodejs.yml +0 -33
  146. package/node_modules/generate-password/CHANGELOG.md +0 -79
  147. package/node_modules/generate-password/LICENSE +0 -21
  148. package/node_modules/generate-password/README.md +0 -61
  149. package/node_modules/generate-password/example.js +0 -28
  150. package/node_modules/generate-password/main.js +0 -1
  151. package/node_modules/generate-password/package.json +0 -68
  152. package/node_modules/generate-password/src/generate.d.ts +0 -51
  153. package/node_modules/generate-password/src/generate.js +0 -152
  154. package/node_modules/generate-password/test/coverage.sh +0 -17
  155. package/node_modules/generate-password/test/esm.mjs +0 -13
  156. package/node_modules/generate-password/test/generator.js +0 -164
  157. package/src/clients/TrialAccount.js +0 -76
  158. package/src/commands/agent/index.js +0 -27
  159. package/src/commands/signup.js +0 -104
  160. package/test.sh +0 -2
  161. /package/src/commands/{agent → instances}/apps/install.js +0 -0
  162. /package/src/commands/{agent → instances}/ready.js +0 -0
@@ -1,76 +0,0 @@
1
- const Client = require('./Client')
2
- const util = require('../utils')
3
- const { handler: login } = require('../commands/login')
4
-
5
- class TrialAccount extends Client {
6
- constructor (argv) {
7
- super(argv)
8
- this.userEmail = argv['user-email']
9
- this.adminName = argv['admin-user-name']
10
- this.userPassword = argv['user-password']
11
- this.adminPassword = argv['admin-password']
12
- this.endpoint = argv.endpoint
13
- this.name = argv['customer-name']
14
- this.plan = util.planOptions(argv.plan)
15
- this.duration = argv['trial-duration']
16
- this.individual = !!this.plan.licenseType.includes('individual')
17
- this.enterpriseDomainName = argv['enterprise-domain']
18
- }
19
-
20
- async getCouponCode () {
21
- const parameters = {
22
- email: this.userEmail,
23
- name: this.name,
24
- aggregate: !!this.individual,
25
- domain: this.individual ? null : `${this.endpoint.replace('https://app', `${this.enterpriseDomainName}`)}`,
26
- plan: this.plan,
27
- coupon: null,
28
- trial: { duration: this.duration },
29
- skipEmail: true
30
- }
31
- /* eslint-disable camelcase */
32
- const response = await this._fetch('POST', 'v1/billing/invites', parameters)
33
- const { coupon_code } = response
34
- return coupon_code
35
- }
36
-
37
- async subscribeTrial (coupon_code) {
38
- const subscribeParams = {
39
- termsOfService: true,
40
- subscriberInviteCode: coupon_code,
41
- skipEmail: true,
42
- password: this.userPassword
43
- }
44
- const response = await this._fetch('POST', 'v1/billing/trials/subscribe', subscribeParams)
45
- const { domainId } = response
46
- return {
47
- domainId,
48
- password: this.userPassword
49
- }
50
- }
51
-
52
- async setupTrialUser () {
53
- await login({
54
- username: this.adminName,
55
- password: this.adminPassword,
56
- endpoint: this.endpoint
57
- })
58
- const coupon_code = await this.getCouponCode(this.userEmail, this.endpoint)
59
- const {
60
- domainId,
61
- password
62
- } = await this.subscribeTrial(coupon_code)
63
- await login({
64
- username: this.userEmail,
65
- password,
66
- endpoint: this.endpoint
67
- })
68
- return {
69
- user: this.userEmail,
70
- password,
71
- domainId
72
- }
73
- }
74
- }
75
-
76
- module.exports = TrialAccount
@@ -1,27 +0,0 @@
1
- const subcommands = [
2
- require('./ready'),
3
- require('./file'),
4
- require('./apps')
5
- ]
6
-
7
- /**
8
- * @typedef {object} YARGS
9
- * @property {function} YARGS.showHelp
10
- * @property {function} YARGS.command
11
- * @property {function} YARGS.scriptName
12
- */
13
-
14
- /**
15
- * @typedef {function} command
16
- * @param {any} subcommands
17
- * @returns {YARGS}
18
- */
19
-
20
- let _yargs /** @type {YARGS} */
21
-
22
- module.exports = {
23
- builder: yargs => (_yargs = yargs) && yargs.command(subcommands).scriptName(''),
24
- handler: argv => !argv[1] && _yargs.showHelp(),
25
- command: 'agent',
26
- describe: 'Agent related commands'
27
- }
@@ -1,104 +0,0 @@
1
- const TrialAccount = require('../clients/TrialAccount')
2
- const { makePassword, validateNonEmpty } = require('../utils')
3
- const { handleError } = require('../error')
4
-
5
- async function builder (yargs) {
6
- yargs.options({
7
- endpoint: {
8
- type: 'input',
9
- describe: 'Server endpoint e.g. https://app.corellium.co',
10
- demandOption: true,
11
- string: true,
12
- validateNonEmpty
13
- },
14
- 'admin-user-name': {
15
- type: 'input',
16
- describe: 'Admin user',
17
- demandOption: true,
18
- string: true,
19
- validateNonEmpty
20
- },
21
- 'admin-password': {
22
- type: 'password',
23
- describe: 'Admin password',
24
- demandOption: true,
25
- string: true,
26
- prompt: 'if-no-arg',
27
- validateNonEmpty
28
- },
29
- 'user-email': {
30
- type: 'input',
31
- describe: 'User email',
32
- demandOption: true,
33
- string: true,
34
- validateNonEmpty
35
- },
36
- 'user-password': {
37
- type: 'password',
38
- describe: 'User password',
39
- demandOption: true,
40
- string: true,
41
- prompt: 'if-no-arg',
42
- mask: true,
43
- default: makePassword()
44
- },
45
- 'customer-name': {
46
- type: 'input',
47
- describe: 'Customer name. Use company name, unless customer is an individual.',
48
- demandOption: true,
49
- string: true
50
- },
51
- plan: {
52
- type: 'list',
53
- default: 'individual-cloud-3-device',
54
- describe: 'Plan',
55
- demandOption: true,
56
- string: true,
57
- prompt: 'if-no-arg',
58
- choices: [
59
- 'individual-cloud-1-device',
60
- 'individual-cloud-3-device',
61
- 'individual-cloud-6-device',
62
- 'enterprise-cloud-6-core',
63
- 'enterprise-cloud-12-core',
64
- 'enterprise-cloud-24-core',
65
- 'individual-cloud-usage-based',
66
- 'enterprise-cloud-usage-based']
67
- },
68
- 'enterprise-domain': {
69
- type: 'input',
70
- describe: 'Enterprise Domain name ',
71
- demandOption: false,
72
- string: true,
73
- default: '',
74
- prompt: 'if-no-arg',
75
- when: (args) => args.plan && args.plan.licenseType.includes('enterprise'),
76
- validateNonEmpty
77
- },
78
- 'trial-duration': {
79
- type: 'number',
80
- demandOption: true,
81
- number: true,
82
- describe: 'Trial duration. Default 7 days ',
83
- default: 7,
84
- prompt: 'if-no-arg'
85
- }
86
- })
87
- }
88
-
89
- async function handler (argv) {
90
- try {
91
- const trialAccount = new TrialAccount(argv)
92
- const credentials = await trialAccount.setupTrialUser()
93
- console.log(credentials)
94
- } catch (err) {
95
- handleError(err, 'Failed to create subscriber invite account', argv.verbose)
96
- }
97
- }
98
-
99
- module.exports = {
100
- builder,
101
- handler,
102
- command: 'signup',
103
- describe: 'Create subscriber invite account'
104
- }
package/test.sh DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env ls -l
2
- wth
File without changes