@strapi/cloud-cli 0.0.0-next.f0a0bc26f5ef0693aaea2a616bc6b816cfee54b6 → 0.0.0-next.f271284c756b9467b92aa7769978ff03d09fabbe
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 -172
- package/dist/bin.js.map +1 -1
- package/dist/bin.mjs +57 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/chunks/index-BZ0dpHa6.js +1896 -0
- package/dist/chunks/index-BZ0dpHa6.js.map +1 -0
- package/dist/chunks/index-DGQHGTQ5.mjs +1869 -0
- package/dist/chunks/index-DGQHGTQ5.mjs.map +1 -0
- package/dist/index.js +33 -1925
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -1867
- package/dist/index.mjs.map +1 -1
- package/dist/src/services/token.d.ts.map +1 -1
- package/dist/src/utils/helpers.d.ts.map +1 -1
- package/dist/src/utils/pkg.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/bin.js
CHANGED
|
@@ -1,178 +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
|
-
get: () => e[k]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
n.default = e;
|
|
35
|
-
return Object.freeze(n);
|
|
36
|
-
}
|
|
37
|
-
const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
|
|
38
|
-
const stringify__default = /* @__PURE__ */ _interopDefault(stringify);
|
|
39
|
-
const ora__default = /* @__PURE__ */ _interopDefault(ora);
|
|
40
|
-
const cliProgress__namespace = /* @__PURE__ */ _interopNamespace(cliProgress);
|
|
41
|
-
({
|
|
42
|
-
apiBaseUrl: utils.env("STRAPI_CLI_CLOUD_API", "https://cloud-cli-api.strapi.io"),
|
|
43
|
-
dashboardBaseUrl: utils.env("STRAPI_CLI_CLOUD_DASHBOARD", "https://cloud.strapi.io")
|
|
44
|
-
});
|
|
45
|
-
const stringifyArg = (arg) => {
|
|
46
|
-
return typeof arg === "object" ? stringify__default.default(arg) : arg;
|
|
47
|
-
};
|
|
48
|
-
const createLogger = (options = {}) => {
|
|
49
|
-
const { silent = false, debug = false, timestamp = true } = options;
|
|
50
|
-
const state = { errors: 0, warning: 0 };
|
|
51
|
-
return {
|
|
52
|
-
get warnings() {
|
|
53
|
-
return state.warning;
|
|
54
|
-
},
|
|
55
|
-
get errors() {
|
|
56
|
-
return state.errors;
|
|
57
|
-
},
|
|
58
|
-
async debug(...args) {
|
|
59
|
-
if (silent || !debug) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
console.log(
|
|
63
|
-
chalk__default.default.cyan(`[DEBUG]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
64
|
-
...args.map(stringifyArg)
|
|
65
|
-
);
|
|
66
|
-
},
|
|
67
|
-
info(...args) {
|
|
68
|
-
if (silent) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
console.info(
|
|
72
|
-
chalk__default.default.blue(`[INFO]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
73
|
-
...args.map(stringifyArg)
|
|
74
|
-
);
|
|
75
|
-
},
|
|
76
|
-
log(...args) {
|
|
77
|
-
if (silent) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
console.info(
|
|
81
|
-
chalk__default.default.blue(`${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
82
|
-
...args.map(stringifyArg)
|
|
83
|
-
);
|
|
84
|
-
},
|
|
85
|
-
success(...args) {
|
|
86
|
-
if (silent) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
console.info(
|
|
90
|
-
chalk__default.default.green(`[SUCCESS]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
91
|
-
...args.map(stringifyArg)
|
|
92
|
-
);
|
|
93
|
-
},
|
|
94
|
-
warn(...args) {
|
|
95
|
-
state.warning += 1;
|
|
96
|
-
if (silent) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
console.warn(
|
|
100
|
-
chalk__default.default.yellow(`[WARN]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
101
|
-
...args.map(stringifyArg)
|
|
102
|
-
);
|
|
103
|
-
},
|
|
104
|
-
error(...args) {
|
|
105
|
-
state.errors += 1;
|
|
106
|
-
if (silent) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
console.error(
|
|
110
|
-
chalk__default.default.red(`[ERROR]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
111
|
-
...args.map(stringifyArg)
|
|
112
|
-
);
|
|
113
|
-
},
|
|
114
|
-
// @ts-expect-error – returning a subpart of ora is fine because the types tell us what is what.
|
|
115
|
-
spinner(text) {
|
|
116
|
-
if (silent) {
|
|
117
|
-
return {
|
|
118
|
-
succeed() {
|
|
119
|
-
return this;
|
|
120
|
-
},
|
|
121
|
-
fail() {
|
|
122
|
-
return this;
|
|
123
|
-
},
|
|
124
|
-
start() {
|
|
125
|
-
return this;
|
|
126
|
-
},
|
|
127
|
-
text: "",
|
|
128
|
-
isSpinning: false
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
return ora__default.default(text);
|
|
132
|
-
},
|
|
133
|
-
progressBar(totalSize, text) {
|
|
134
|
-
if (silent) {
|
|
135
|
-
return {
|
|
136
|
-
start() {
|
|
137
|
-
return this;
|
|
138
|
-
},
|
|
139
|
-
stop() {
|
|
140
|
-
return this;
|
|
141
|
-
},
|
|
142
|
-
update() {
|
|
143
|
-
return this;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
const progressBar = new cliProgress__namespace.SingleBar({
|
|
148
|
-
format: `${text ? `${text} |` : ""}${chalk__default.default.green("{bar}")}| {percentage}%`,
|
|
149
|
-
barCompleteChar: "█",
|
|
150
|
-
barIncompleteChar: "░",
|
|
151
|
-
hideCursor: true,
|
|
152
|
-
forceRedraw: true
|
|
153
|
-
});
|
|
154
|
-
progressBar.start(totalSize, 0);
|
|
155
|
-
return progressBar;
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
};
|
|
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-BZ0dpHa6.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
|
+
|
|
159
29
|
function loadStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
+
});
|
|
172
52
|
}
|
|
173
53
|
function runStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
|
|
174
|
-
|
|
175
|
-
|
|
54
|
+
loadStrapiCloudCommand(argv, command);
|
|
55
|
+
command.parse(argv);
|
|
176
56
|
}
|
|
57
|
+
|
|
177
58
|
exports.runStrapiCloudCommand = runStrapiCloudCommand;
|
|
178
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-DGQHGTQ5.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;;;;"}
|