@commercetools-frontend/deployment-cli 0.2.0 → 0.2.1
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.
|
@@ -14,6 +14,7 @@ var merge = require('lodash/merge');
|
|
|
14
14
|
var prompts = require('prompts');
|
|
15
15
|
var pRetry = require('p-retry');
|
|
16
16
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
17
|
+
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
17
18
|
var _URLSearchParams = require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
18
19
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
19
20
|
var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
@@ -31,6 +32,7 @@ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsW
|
|
|
31
32
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
32
33
|
var prompts__default = /*#__PURE__*/_interopDefault(prompts);
|
|
33
34
|
var pRetry__default = /*#__PURE__*/_interopDefault(pRetry);
|
|
35
|
+
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
34
36
|
var _URLSearchParams__default = /*#__PURE__*/_interopDefault(_URLSearchParams);
|
|
35
37
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
36
38
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
@@ -39,7 +41,7 @@ var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
|
39
41
|
|
|
40
42
|
var pkgJson = {
|
|
41
43
|
name: "@commercetools-frontend/deployment-cli",
|
|
42
|
-
version: "0.2.
|
|
44
|
+
version: "0.2.1",
|
|
43
45
|
description: "CLI to manage Custom Applications deployments in Google Storage.",
|
|
44
46
|
keywords: [
|
|
45
47
|
"commercetools",
|
|
@@ -65,20 +67,20 @@ var pkgJson = {
|
|
|
65
67
|
"@babel/runtime": "^7.21.0",
|
|
66
68
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
67
69
|
cac: "^6.7.14",
|
|
68
|
-
cosmiconfig: "8.
|
|
70
|
+
cosmiconfig: "8.2.0",
|
|
69
71
|
lodash: "4.17.21",
|
|
70
|
-
"node-fetch": "2.6.
|
|
72
|
+
"node-fetch": "2.6.11",
|
|
71
73
|
"p-retry": "4.6.2",
|
|
72
74
|
prompts: "2.4.2"
|
|
73
75
|
},
|
|
74
76
|
devDependencies: {
|
|
75
77
|
"@tsconfig/node18": "1.0.3",
|
|
76
78
|
"@types/lodash": "^4.14.191",
|
|
77
|
-
"@types/node": "
|
|
78
|
-
"@types/node-fetch": "2.6.
|
|
79
|
+
"@types/node": "20.4.0",
|
|
80
|
+
"@types/node-fetch": "2.6.2",
|
|
79
81
|
"@types/prompts": "2.4.4",
|
|
80
|
-
msw: "1.2.
|
|
81
|
-
typescript: "
|
|
82
|
+
msw: "1.2.2",
|
|
83
|
+
typescript: "4.9.5"
|
|
82
84
|
},
|
|
83
85
|
engines: {
|
|
84
86
|
node: ">=14",
|
|
@@ -424,7 +426,7 @@ async function approve(cliFlags, config, circleCiApis) {
|
|
|
424
426
|
|
|
425
427
|
async function processCircleCiResponse(response) {
|
|
426
428
|
if (!response.ok) {
|
|
427
|
-
var _context, _context2;
|
|
429
|
+
var _response$headers$get, _context, _context2;
|
|
428
430
|
/**
|
|
429
431
|
* NOTE:
|
|
430
432
|
* Trying to handle known but undocumented responses of the CircleCI API.
|
|
@@ -432,17 +434,20 @@ async function processCircleCiResponse(response) {
|
|
|
432
434
|
* 1. Message: Already approved job
|
|
433
435
|
* Deployment was already triggered manually or by train the day before.
|
|
434
436
|
*/
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
437
|
+
|
|
438
|
+
// Response data is a stream so text OR json can only be read once, so
|
|
439
|
+
// we read it as text first and then try to parse it as json to handle
|
|
440
|
+
// known error responses.
|
|
441
|
+
const error = await response.text();
|
|
442
|
+
if ((_response$headers$get = response.headers.get('content-type')) !== null && _response$headers$get !== void 0 && _includesInstanceProperty__default["default"](_response$headers$get).call(_response$headers$get, 'application/json')) {
|
|
443
|
+
const _JSON$parse = JSON.parse(error),
|
|
444
|
+
message = _JSON$parse.message;
|
|
445
|
+
if (message.match(/job already approved/i)) {
|
|
438
446
|
console.log('ℹ️ Deployment job is already approved.');
|
|
439
447
|
process.exit(0);
|
|
440
448
|
}
|
|
441
|
-
} catch (e) {
|
|
442
|
-
// ignore
|
|
443
449
|
}
|
|
444
|
-
|
|
445
|
-
throw new Error(_concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = "".concat(response.status, ": Network response was not ok.\n\n Status text is ")).call(_context2, response.statusText, " and text is ")).call(_context, errorText, "."));
|
|
450
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = "".concat(response.status, ": Network response was not ok.\n\n Status text is ")).call(_context2, response.statusText, " and text is ")).call(_context, error, "."));
|
|
446
451
|
}
|
|
447
452
|
return response.json();
|
|
448
453
|
}
|
|
@@ -14,6 +14,7 @@ var merge = require('lodash/merge');
|
|
|
14
14
|
var prompts = require('prompts');
|
|
15
15
|
var pRetry = require('p-retry');
|
|
16
16
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
17
|
+
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
17
18
|
var _URLSearchParams = require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
18
19
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
19
20
|
var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
@@ -31,6 +32,7 @@ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsW
|
|
|
31
32
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
32
33
|
var prompts__default = /*#__PURE__*/_interopDefault(prompts);
|
|
33
34
|
var pRetry__default = /*#__PURE__*/_interopDefault(pRetry);
|
|
35
|
+
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
34
36
|
var _URLSearchParams__default = /*#__PURE__*/_interopDefault(_URLSearchParams);
|
|
35
37
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
36
38
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
@@ -39,7 +41,7 @@ var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
|
39
41
|
|
|
40
42
|
var pkgJson = {
|
|
41
43
|
name: "@commercetools-frontend/deployment-cli",
|
|
42
|
-
version: "0.2.
|
|
44
|
+
version: "0.2.1",
|
|
43
45
|
description: "CLI to manage Custom Applications deployments in Google Storage.",
|
|
44
46
|
keywords: [
|
|
45
47
|
"commercetools",
|
|
@@ -65,20 +67,20 @@ var pkgJson = {
|
|
|
65
67
|
"@babel/runtime": "^7.21.0",
|
|
66
68
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
67
69
|
cac: "^6.7.14",
|
|
68
|
-
cosmiconfig: "8.
|
|
70
|
+
cosmiconfig: "8.2.0",
|
|
69
71
|
lodash: "4.17.21",
|
|
70
|
-
"node-fetch": "2.6.
|
|
72
|
+
"node-fetch": "2.6.11",
|
|
71
73
|
"p-retry": "4.6.2",
|
|
72
74
|
prompts: "2.4.2"
|
|
73
75
|
},
|
|
74
76
|
devDependencies: {
|
|
75
77
|
"@tsconfig/node18": "1.0.3",
|
|
76
78
|
"@types/lodash": "^4.14.191",
|
|
77
|
-
"@types/node": "
|
|
78
|
-
"@types/node-fetch": "2.6.
|
|
79
|
+
"@types/node": "20.4.0",
|
|
80
|
+
"@types/node-fetch": "2.6.2",
|
|
79
81
|
"@types/prompts": "2.4.4",
|
|
80
|
-
msw: "1.2.
|
|
81
|
-
typescript: "
|
|
82
|
+
msw: "1.2.2",
|
|
83
|
+
typescript: "4.9.5"
|
|
82
84
|
},
|
|
83
85
|
engines: {
|
|
84
86
|
node: ">=14",
|
|
@@ -424,7 +426,7 @@ async function approve(cliFlags, config, circleCiApis) {
|
|
|
424
426
|
|
|
425
427
|
async function processCircleCiResponse(response) {
|
|
426
428
|
if (!response.ok) {
|
|
427
|
-
var _context, _context2;
|
|
429
|
+
var _response$headers$get, _context, _context2;
|
|
428
430
|
/**
|
|
429
431
|
* NOTE:
|
|
430
432
|
* Trying to handle known but undocumented responses of the CircleCI API.
|
|
@@ -432,17 +434,20 @@ async function processCircleCiResponse(response) {
|
|
|
432
434
|
* 1. Message: Already approved job
|
|
433
435
|
* Deployment was already triggered manually or by train the day before.
|
|
434
436
|
*/
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
437
|
+
|
|
438
|
+
// Response data is a stream so text OR json can only be read once, so
|
|
439
|
+
// we read it as text first and then try to parse it as json to handle
|
|
440
|
+
// known error responses.
|
|
441
|
+
const error = await response.text();
|
|
442
|
+
if ((_response$headers$get = response.headers.get('content-type')) !== null && _response$headers$get !== void 0 && _includesInstanceProperty__default["default"](_response$headers$get).call(_response$headers$get, 'application/json')) {
|
|
443
|
+
const _JSON$parse = JSON.parse(error),
|
|
444
|
+
message = _JSON$parse.message;
|
|
445
|
+
if (message.match(/job already approved/i)) {
|
|
438
446
|
console.log('ℹ️ Deployment job is already approved.');
|
|
439
447
|
process.exit(0);
|
|
440
448
|
}
|
|
441
|
-
} catch (e) {
|
|
442
|
-
// ignore
|
|
443
449
|
}
|
|
444
|
-
|
|
445
|
-
throw new Error(_concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = "".concat(response.status, ": Network response was not ok.\n\n Status text is ")).call(_context2, response.statusText, " and text is ")).call(_context, errorText, "."));
|
|
450
|
+
throw new Error(_concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = "".concat(response.status, ": Network response was not ok.\n\n Status text is ")).call(_context2, response.statusText, " and text is ")).call(_context, error, "."));
|
|
446
451
|
}
|
|
447
452
|
return response.json();
|
|
448
453
|
}
|
|
@@ -10,6 +10,7 @@ import merge from 'lodash/merge';
|
|
|
10
10
|
import prompts from 'prompts';
|
|
11
11
|
import pRetry from 'p-retry';
|
|
12
12
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
13
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
13
14
|
import _URLSearchParams from '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
14
15
|
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
15
16
|
import _Promise from '@babel/runtime-corejs3/core-js-stable/promise';
|
|
@@ -18,7 +19,7 @@ import fetch from 'node-fetch';
|
|
|
18
19
|
|
|
19
20
|
var pkgJson = {
|
|
20
21
|
name: "@commercetools-frontend/deployment-cli",
|
|
21
|
-
version: "0.2.
|
|
22
|
+
version: "0.2.1",
|
|
22
23
|
description: "CLI to manage Custom Applications deployments in Google Storage.",
|
|
23
24
|
keywords: [
|
|
24
25
|
"commercetools",
|
|
@@ -44,20 +45,20 @@ var pkgJson = {
|
|
|
44
45
|
"@babel/runtime": "^7.21.0",
|
|
45
46
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
46
47
|
cac: "^6.7.14",
|
|
47
|
-
cosmiconfig: "8.
|
|
48
|
+
cosmiconfig: "8.2.0",
|
|
48
49
|
lodash: "4.17.21",
|
|
49
|
-
"node-fetch": "2.6.
|
|
50
|
+
"node-fetch": "2.6.11",
|
|
50
51
|
"p-retry": "4.6.2",
|
|
51
52
|
prompts: "2.4.2"
|
|
52
53
|
},
|
|
53
54
|
devDependencies: {
|
|
54
55
|
"@tsconfig/node18": "1.0.3",
|
|
55
56
|
"@types/lodash": "^4.14.191",
|
|
56
|
-
"@types/node": "
|
|
57
|
-
"@types/node-fetch": "2.6.
|
|
57
|
+
"@types/node": "20.4.0",
|
|
58
|
+
"@types/node-fetch": "2.6.2",
|
|
58
59
|
"@types/prompts": "2.4.4",
|
|
59
|
-
msw: "1.2.
|
|
60
|
-
typescript: "
|
|
60
|
+
msw: "1.2.2",
|
|
61
|
+
typescript: "4.9.5"
|
|
61
62
|
},
|
|
62
63
|
engines: {
|
|
63
64
|
node: ">=14",
|
|
@@ -403,7 +404,7 @@ async function approve(cliFlags, config, circleCiApis) {
|
|
|
403
404
|
|
|
404
405
|
async function processCircleCiResponse(response) {
|
|
405
406
|
if (!response.ok) {
|
|
406
|
-
var _context, _context2;
|
|
407
|
+
var _response$headers$get, _context, _context2;
|
|
407
408
|
/**
|
|
408
409
|
* NOTE:
|
|
409
410
|
* Trying to handle known but undocumented responses of the CircleCI API.
|
|
@@ -411,17 +412,20 @@ async function processCircleCiResponse(response) {
|
|
|
411
412
|
* 1. Message: Already approved job
|
|
412
413
|
* Deployment was already triggered manually or by train the day before.
|
|
413
414
|
*/
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
|
|
416
|
+
// Response data is a stream so text OR json can only be read once, so
|
|
417
|
+
// we read it as text first and then try to parse it as json to handle
|
|
418
|
+
// known error responses.
|
|
419
|
+
const error = await response.text();
|
|
420
|
+
if ((_response$headers$get = response.headers.get('content-type')) !== null && _response$headers$get !== void 0 && _includesInstanceProperty(_response$headers$get).call(_response$headers$get, 'application/json')) {
|
|
421
|
+
const _JSON$parse = JSON.parse(error),
|
|
422
|
+
message = _JSON$parse.message;
|
|
423
|
+
if (message.match(/job already approved/i)) {
|
|
417
424
|
console.log('ℹ️ Deployment job is already approved.');
|
|
418
425
|
process.exit(0);
|
|
419
426
|
}
|
|
420
|
-
} catch (e) {
|
|
421
|
-
// ignore
|
|
422
427
|
}
|
|
423
|
-
|
|
424
|
-
throw new Error(_concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "".concat(response.status, ": Network response was not ok.\n\n Status text is ")).call(_context2, response.statusText, " and text is ")).call(_context, errorText, "."));
|
|
428
|
+
throw new Error(_concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "".concat(response.status, ": Network response was not ok.\n\n Status text is ")).call(_context2, response.statusText, " and text is ")).call(_context, error, "."));
|
|
425
429
|
}
|
|
426
430
|
return response.json();
|
|
427
431
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/deployment-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "CLI to manage Custom Applications deployments in Google Storage.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"@babel/runtime": "^7.21.0",
|
|
24
24
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
25
|
"cac": "^6.7.14",
|
|
26
|
-
"cosmiconfig": "8.
|
|
26
|
+
"cosmiconfig": "8.2.0",
|
|
27
27
|
"lodash": "4.17.21",
|
|
28
|
-
"node-fetch": "2.6.
|
|
28
|
+
"node-fetch": "2.6.11",
|
|
29
29
|
"p-retry": "4.6.2",
|
|
30
30
|
"prompts": "2.4.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@tsconfig/node18": "1.0.3",
|
|
34
34
|
"@types/lodash": "^4.14.191",
|
|
35
|
-
"@types/node": "
|
|
36
|
-
"@types/node-fetch": "2.6.
|
|
35
|
+
"@types/node": "20.4.0",
|
|
36
|
+
"@types/node-fetch": "2.6.2",
|
|
37
37
|
"@types/prompts": "2.4.4",
|
|
38
|
-
"msw": "1.2.
|
|
39
|
-
"typescript": "
|
|
38
|
+
"msw": "1.2.2",
|
|
39
|
+
"typescript": "4.9.5"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=14",
|