@strapi/cloud-cli 5.8.1 → 5.10.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.
- package/dist/bin.js +53 -171
- package/dist/bin.js.map +1 -1
- package/dist/bin.mjs +57 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/chunks/index-BV95A7jG.js +1896 -0
- package/dist/chunks/index-BV95A7jG.js.map +1 -0
- package/dist/chunks/index-xAvJT3VT.mjs +1869 -0
- package/dist/chunks/index-xAvJT3VT.mjs.map +1 -0
- package/dist/index.js +33 -1920
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -1863
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
package/dist/bin.js
CHANGED
|
@@ -1,177 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require(
|
|
5
|
-
require(
|
|
6
|
-
require(
|
|
7
|
-
|
|
8
|
-
require(
|
|
9
|
-
require(
|
|
10
|
-
require(
|
|
11
|
-
require(
|
|
12
|
-
require(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
n.default = e;
|
|
34
|
-
return Object.freeze(n);
|
|
35
|
-
}
|
|
36
|
-
const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
|
|
37
|
-
const stringify__default = /* @__PURE__ */ _interopDefault(stringify);
|
|
38
|
-
const ora__default = /* @__PURE__ */ _interopDefault(ora);
|
|
39
|
-
const cliProgress__namespace = /* @__PURE__ */ _interopNamespace(cliProgress);
|
|
40
|
-
({
|
|
41
|
-
apiBaseUrl: utils.env("STRAPI_CLI_CLOUD_API", "https://cloud-cli-api.strapi.io"),
|
|
42
|
-
dashboardBaseUrl: utils.env("STRAPI_CLI_CLOUD_DASHBOARD", "https://cloud.strapi.io")
|
|
43
|
-
});
|
|
44
|
-
const stringifyArg = (arg) => {
|
|
45
|
-
return typeof arg === "object" ? stringify__default.default(arg) : arg;
|
|
46
|
-
};
|
|
47
|
-
const createLogger = (options = {}) => {
|
|
48
|
-
const { silent = false, debug = false, timestamp = true } = options;
|
|
49
|
-
const state = { errors: 0, warning: 0 };
|
|
50
|
-
return {
|
|
51
|
-
get warnings() {
|
|
52
|
-
return state.warning;
|
|
53
|
-
},
|
|
54
|
-
get errors() {
|
|
55
|
-
return state.errors;
|
|
56
|
-
},
|
|
57
|
-
async debug(...args) {
|
|
58
|
-
if (silent || !debug) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
console.log(
|
|
62
|
-
chalk__default.default.cyan(`[DEBUG]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
63
|
-
...args.map(stringifyArg)
|
|
64
|
-
);
|
|
65
|
-
},
|
|
66
|
-
info(...args) {
|
|
67
|
-
if (silent) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
console.info(
|
|
71
|
-
chalk__default.default.blue(`[INFO]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
72
|
-
...args.map(stringifyArg)
|
|
73
|
-
);
|
|
74
|
-
},
|
|
75
|
-
log(...args) {
|
|
76
|
-
if (silent) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
console.info(
|
|
80
|
-
chalk__default.default.blue(`${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
81
|
-
...args.map(stringifyArg)
|
|
82
|
-
);
|
|
83
|
-
},
|
|
84
|
-
success(...args) {
|
|
85
|
-
if (silent) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
console.info(
|
|
89
|
-
chalk__default.default.green(`[SUCCESS]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
90
|
-
...args.map(stringifyArg)
|
|
91
|
-
);
|
|
92
|
-
},
|
|
93
|
-
warn(...args) {
|
|
94
|
-
state.warning += 1;
|
|
95
|
-
if (silent) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
console.warn(
|
|
99
|
-
chalk__default.default.yellow(`[WARN]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
100
|
-
...args.map(stringifyArg)
|
|
101
|
-
);
|
|
102
|
-
},
|
|
103
|
-
error(...args) {
|
|
104
|
-
state.errors += 1;
|
|
105
|
-
if (silent) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
console.error(
|
|
109
|
-
chalk__default.default.red(`[ERROR]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
110
|
-
...args.map(stringifyArg)
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
// @ts-expect-error – returning a subpart of ora is fine because the types tell us what is what.
|
|
114
|
-
spinner(text) {
|
|
115
|
-
if (silent) {
|
|
116
|
-
return {
|
|
117
|
-
succeed() {
|
|
118
|
-
return this;
|
|
119
|
-
},
|
|
120
|
-
fail() {
|
|
121
|
-
return this;
|
|
122
|
-
},
|
|
123
|
-
start() {
|
|
124
|
-
return this;
|
|
125
|
-
},
|
|
126
|
-
text: "",
|
|
127
|
-
isSpinning: false
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
return ora__default.default(text);
|
|
131
|
-
},
|
|
132
|
-
progressBar(totalSize, text) {
|
|
133
|
-
if (silent) {
|
|
134
|
-
return {
|
|
135
|
-
start() {
|
|
136
|
-
return this;
|
|
137
|
-
},
|
|
138
|
-
stop() {
|
|
139
|
-
return this;
|
|
140
|
-
},
|
|
141
|
-
update() {
|
|
142
|
-
return this;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
const progressBar = new cliProgress__namespace.SingleBar({
|
|
147
|
-
format: `${text ? `${text} |` : ""}${chalk__default.default.green("{bar}")}| {percentage}%`,
|
|
148
|
-
barCompleteChar: "█",
|
|
149
|
-
barIncompleteChar: "░",
|
|
150
|
-
hideCursor: true,
|
|
151
|
-
forceRedraw: true
|
|
152
|
-
});
|
|
153
|
-
progressBar.start(totalSize, 0);
|
|
154
|
-
return progressBar;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commander = require('commander');
|
|
4
|
+
require('axios');
|
|
5
|
+
require('fs-extra');
|
|
6
|
+
require('os');
|
|
7
|
+
var index = require('./chunks/index-BV95A7jG.js');
|
|
8
|
+
require('path');
|
|
9
|
+
require('xdg-app-paths');
|
|
10
|
+
require('lodash');
|
|
11
|
+
require('jwks-rsa');
|
|
12
|
+
require('jsonwebtoken');
|
|
13
|
+
require('crypto');
|
|
14
|
+
require('inquirer');
|
|
15
|
+
require('boxen');
|
|
16
|
+
require('chalk');
|
|
17
|
+
require('node:crypto');
|
|
18
|
+
require('@strapi/utils');
|
|
19
|
+
require('tar');
|
|
20
|
+
require('minimatch');
|
|
21
|
+
require('lodash/fp');
|
|
22
|
+
require('fast-safe-stringify');
|
|
23
|
+
require('ora');
|
|
24
|
+
require('cli-progress');
|
|
25
|
+
require('pkg-up');
|
|
26
|
+
require('yup');
|
|
27
|
+
require('eventsource');
|
|
28
|
+
|
|
158
29
|
function loadStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
30
|
+
// Initial program setup
|
|
31
|
+
command.storeOptionsAsProperties(false).allowUnknownOption(true);
|
|
32
|
+
// Help command
|
|
33
|
+
command.helpOption('-h, --help', 'Display help for command');
|
|
34
|
+
command.addHelpCommand('help [command]', 'Display help for command');
|
|
35
|
+
const cwd = process.cwd();
|
|
36
|
+
const hasDebug = argv.includes('--debug');
|
|
37
|
+
const hasSilent = argv.includes('--silent');
|
|
38
|
+
const logger = index.createLogger({
|
|
39
|
+
debug: hasDebug,
|
|
40
|
+
silent: hasSilent,
|
|
41
|
+
timestamp: false
|
|
42
|
+
});
|
|
43
|
+
const ctx = {
|
|
44
|
+
cwd,
|
|
45
|
+
logger
|
|
46
|
+
};
|
|
47
|
+
index.buildStrapiCloudCommands({
|
|
48
|
+
command,
|
|
49
|
+
ctx,
|
|
50
|
+
argv
|
|
51
|
+
});
|
|
171
52
|
}
|
|
172
53
|
function runStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
|
|
173
|
-
|
|
174
|
-
|
|
54
|
+
loadStrapiCloudCommand(argv, command);
|
|
55
|
+
command.parse(argv);
|
|
175
56
|
}
|
|
57
|
+
|
|
176
58
|
exports.runStrapiCloudCommand = runStrapiCloudCommand;
|
|
177
59
|
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"bin.js","sources":["../src/bin.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { createLogger } from './services';\nimport { CLIContext } from './types';\nimport { buildStrapiCloudCommands } from './index';\n\nfunction loadStrapiCloudCommand(argv = process.argv, command = new Command()) {\n // Initial program setup\n command.storeOptionsAsProperties(false).allowUnknownOption(true);\n\n // Help command\n command.helpOption('-h, --help', 'Display help for command');\n command.addHelpCommand('help [command]', 'Display help for command');\n\n const cwd = process.cwd();\n\n const hasDebug = argv.includes('--debug');\n const hasSilent = argv.includes('--silent');\n\n const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });\n\n const ctx = {\n cwd,\n logger,\n } satisfies CLIContext;\n\n buildStrapiCloudCommands({ command, ctx, argv });\n}\n\nfunction runStrapiCloudCommand(argv = process.argv, command = new Command()) {\n loadStrapiCloudCommand(argv, command);\n command.parse(argv);\n}\n\nexport { runStrapiCloudCommand };\n"],"names":["loadStrapiCloudCommand","argv","process","command","Command","storeOptionsAsProperties","allowUnknownOption","helpOption","addHelpCommand","cwd","hasDebug","includes","hasSilent","logger","createLogger","debug","silent","timestamp","ctx","buildStrapiCloudCommands","runStrapiCloudCommand","parse"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASA,uBAAuBC,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,iBAAS,EAAA,EAAA;;AAE1ED,IAAAA,OAAAA,CAAQE,wBAAwB,CAAC,KAAOC,CAAAA,CAAAA,kBAAkB,CAAC,IAAA,CAAA;;IAG3DH,OAAQI,CAAAA,UAAU,CAAC,YAAc,EAAA,0BAAA,CAAA;IACjCJ,OAAQK,CAAAA,cAAc,CAAC,gBAAkB,EAAA,0BAAA,CAAA;IAEzC,MAAMC,GAAAA,GAAMP,QAAQO,GAAG,EAAA;IAEvB,MAAMC,QAAAA,GAAWT,IAAKU,CAAAA,QAAQ,CAAC,SAAA,CAAA;IAC/B,MAAMC,SAAAA,GAAYX,IAAKU,CAAAA,QAAQ,CAAC,UAAA,CAAA;AAEhC,IAAA,MAAME,SAASC,kBAAa,CAAA;QAAEC,KAAOL,EAAAA,QAAAA;QAAUM,MAAQJ,EAAAA,SAAAA;QAAWK,SAAW,EAAA;AAAM,KAAA,CAAA;AAEnF,IAAA,MAAMC,GAAM,GAAA;AACVT,QAAAA,GAAAA;AACAI,QAAAA;AACF,KAAA;IAEAM,8BAAyB,CAAA;AAAEhB,QAAAA,OAAAA;AAASe,QAAAA,GAAAA;AAAKjB,QAAAA;AAAK,KAAA,CAAA;AAChD;AAEA,SAASmB,sBAAsBnB,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,iBAAS,EAAA,EAAA;AACzEJ,IAAAA,sBAAAA,CAAuBC,IAAME,EAAAA,OAAAA,CAAAA;AAC7BA,IAAAA,OAAAA,CAAQkB,KAAK,CAACpB,IAAAA,CAAAA;AAChB;;;;"}
|
package/dist/bin.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import 'axios';
|
|
3
|
+
import 'fs-extra';
|
|
4
|
+
import 'os';
|
|
5
|
+
import { b as buildStrapiCloudCommands, c as createLogger } from './chunks/index-xAvJT3VT.mjs';
|
|
6
|
+
import 'path';
|
|
7
|
+
import 'xdg-app-paths';
|
|
8
|
+
import 'lodash';
|
|
9
|
+
import 'jwks-rsa';
|
|
10
|
+
import 'jsonwebtoken';
|
|
11
|
+
import 'crypto';
|
|
12
|
+
import 'inquirer';
|
|
13
|
+
import 'boxen';
|
|
14
|
+
import 'chalk';
|
|
15
|
+
import 'node:crypto';
|
|
16
|
+
import '@strapi/utils';
|
|
17
|
+
import 'tar';
|
|
18
|
+
import 'minimatch';
|
|
19
|
+
import 'lodash/fp';
|
|
20
|
+
import 'fast-safe-stringify';
|
|
21
|
+
import 'ora';
|
|
22
|
+
import 'cli-progress';
|
|
23
|
+
import 'pkg-up';
|
|
24
|
+
import 'yup';
|
|
25
|
+
import 'eventsource';
|
|
26
|
+
|
|
27
|
+
function loadStrapiCloudCommand(argv = process.argv, command = new Command()) {
|
|
28
|
+
// Initial program setup
|
|
29
|
+
command.storeOptionsAsProperties(false).allowUnknownOption(true);
|
|
30
|
+
// Help command
|
|
31
|
+
command.helpOption('-h, --help', 'Display help for command');
|
|
32
|
+
command.addHelpCommand('help [command]', 'Display help for command');
|
|
33
|
+
const cwd = process.cwd();
|
|
34
|
+
const hasDebug = argv.includes('--debug');
|
|
35
|
+
const hasSilent = argv.includes('--silent');
|
|
36
|
+
const logger = createLogger({
|
|
37
|
+
debug: hasDebug,
|
|
38
|
+
silent: hasSilent,
|
|
39
|
+
timestamp: false
|
|
40
|
+
});
|
|
41
|
+
const ctx = {
|
|
42
|
+
cwd,
|
|
43
|
+
logger
|
|
44
|
+
};
|
|
45
|
+
buildStrapiCloudCommands({
|
|
46
|
+
command,
|
|
47
|
+
ctx,
|
|
48
|
+
argv
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function runStrapiCloudCommand(argv = process.argv, command = new Command()) {
|
|
52
|
+
loadStrapiCloudCommand(argv, command);
|
|
53
|
+
command.parse(argv);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { runStrapiCloudCommand };
|
|
57
|
+
//# sourceMappingURL=bin.mjs.map
|
package/dist/bin.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.mjs","sources":["../src/bin.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { createLogger } from './services';\nimport { CLIContext } from './types';\nimport { buildStrapiCloudCommands } from './index';\n\nfunction loadStrapiCloudCommand(argv = process.argv, command = new Command()) {\n // Initial program setup\n command.storeOptionsAsProperties(false).allowUnknownOption(true);\n\n // Help command\n command.helpOption('-h, --help', 'Display help for command');\n command.addHelpCommand('help [command]', 'Display help for command');\n\n const cwd = process.cwd();\n\n const hasDebug = argv.includes('--debug');\n const hasSilent = argv.includes('--silent');\n\n const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });\n\n const ctx = {\n cwd,\n logger,\n } satisfies CLIContext;\n\n buildStrapiCloudCommands({ command, ctx, argv });\n}\n\nfunction runStrapiCloudCommand(argv = process.argv, command = new Command()) {\n loadStrapiCloudCommand(argv, command);\n command.parse(argv);\n}\n\nexport { runStrapiCloudCommand };\n"],"names":["loadStrapiCloudCommand","argv","process","command","Command","storeOptionsAsProperties","allowUnknownOption","helpOption","addHelpCommand","cwd","hasDebug","includes","hasSilent","logger","createLogger","debug","silent","timestamp","ctx","buildStrapiCloudCommands","runStrapiCloudCommand","parse"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASA,uBAAuBC,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,OAAS,EAAA,EAAA;;AAE1ED,IAAAA,OAAAA,CAAQE,wBAAwB,CAAC,KAAOC,CAAAA,CAAAA,kBAAkB,CAAC,IAAA,CAAA;;IAG3DH,OAAQI,CAAAA,UAAU,CAAC,YAAc,EAAA,0BAAA,CAAA;IACjCJ,OAAQK,CAAAA,cAAc,CAAC,gBAAkB,EAAA,0BAAA,CAAA;IAEzC,MAAMC,GAAAA,GAAMP,QAAQO,GAAG,EAAA;IAEvB,MAAMC,QAAAA,GAAWT,IAAKU,CAAAA,QAAQ,CAAC,SAAA,CAAA;IAC/B,MAAMC,SAAAA,GAAYX,IAAKU,CAAAA,QAAQ,CAAC,UAAA,CAAA;AAEhC,IAAA,MAAME,SAASC,YAAa,CAAA;QAAEC,KAAOL,EAAAA,QAAAA;QAAUM,MAAQJ,EAAAA,SAAAA;QAAWK,SAAW,EAAA;AAAM,KAAA,CAAA;AAEnF,IAAA,MAAMC,GAAM,GAAA;AACVT,QAAAA,GAAAA;AACAI,QAAAA;AACF,KAAA;IAEAM,wBAAyB,CAAA;AAAEhB,QAAAA,OAAAA;AAASe,QAAAA,GAAAA;AAAKjB,QAAAA;AAAK,KAAA,CAAA;AAChD;AAEA,SAASmB,sBAAsBnB,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,OAAS,EAAA,EAAA;AACzEJ,IAAAA,sBAAAA,CAAuBC,IAAME,EAAAA,OAAAA,CAAAA;AAC7BA,IAAAA,OAAAA,CAAQkB,KAAK,CAACpB,IAAAA,CAAAA;AAChB;;;;"}
|