@strapi/cloud-cli 4.26.1 → 4.26.2

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/index.mjs CHANGED
@@ -77,8 +77,7 @@ const getFiles = async (dirPath, ignorePatterns = [], subfolder = "") => {
77
77
  const readGitignore = async (folderPath) => {
78
78
  const gitignorePath = path.resolve(folderPath, ".gitignore");
79
79
  const pathExist = await fse.pathExists(gitignorePath);
80
- if (!pathExist)
81
- return [];
80
+ if (!pathExist) return [];
82
81
  const gitignoreContent = await fse.readFile(gitignorePath, "utf8");
83
82
  return gitignoreContent.split(/\r?\n/).filter((line) => Boolean(line.trim()) && !line.startsWith("#"));
84
83
  };
@@ -132,105 +131,9 @@ async function saveLocalConfig(data) {
132
131
  const configFilePath = path__default.join(configPath, CONFIG_FILENAME);
133
132
  await fse__default.writeJson(configFilePath, data, { encoding: "utf8", spaces: 2, mode: 384 });
134
133
  }
135
- const name = "@strapi/cloud-cli";
136
- const version = "4.26.0";
137
- const description = "Commands to interact with the Strapi Cloud";
138
- const keywords = [
139
- "strapi",
140
- "cloud",
141
- "cli"
142
- ];
143
- const homepage = "https://strapi.io";
144
- const bugs = {
145
- url: "https://github.com/strapi/strapi/issues"
146
- };
147
- const repository = {
148
- type: "git",
149
- url: "git://github.com/strapi/strapi.git"
150
- };
151
- const license = "SEE LICENSE IN LICENSE";
152
- const author = {
153
- name: "Strapi Solutions SAS",
154
- email: "hi@strapi.io",
155
- url: "https://strapi.io"
156
- };
157
- const maintainers = [
158
- {
159
- name: "Strapi Solutions SAS",
160
- email: "hi@strapi.io",
161
- url: "https://strapi.io"
162
- }
163
- ];
164
- const main = "./dist/index.js";
165
- const module = "./dist/index.mjs";
166
- const source = "./src/index.ts";
167
- const types = "./dist/src/index.d.ts";
168
- const bin = "./bin/index.js";
169
- const files = [
170
- "./dist",
171
- "./bin"
172
- ];
173
- const scripts = {
174
- build: "pack-up build",
175
- clean: "run -T rimraf ./dist",
176
- lint: "run -T eslint .",
177
- "test:unit": "run -T jest",
178
- watch: "pack-up watch"
179
- };
180
- const dependencies = {
181
- "@strapi/utils": "4.26.0",
182
- axios: "1.8.2",
183
- chalk: "4.1.2",
184
- "cli-progress": "3.12.0",
185
- commander: "8.3.0",
186
- eventsource: "2.0.2",
187
- "fast-safe-stringify": "2.1.1",
188
- "fs-extra": "10.0.0",
189
- inquirer: "8.2.5",
190
- jsonwebtoken: "9.0.0",
191
- "jwks-rsa": "3.1.0",
192
- lodash: "4.17.21",
193
- minimatch: "9.0.3",
194
- open: "8.4.0",
195
- ora: "5.4.1",
196
- "pkg-up": "3.1.0",
197
- tar: "6.2.1",
198
- "xdg-app-paths": "8.3.0",
199
- yup: "0.32.9"
200
- };
201
- const devDependencies = {
202
- "@strapi/pack-up": "4.23.0",
203
- "@types/cli-progress": "3.11.5",
204
- "@types/eventsource": "1.1.15",
205
- "@types/lodash": "^4.14.191",
206
- "eslint-config-custom": "4.26.0",
207
- tsconfig: "4.26.0"
208
- };
209
- const engines = {
210
- node: ">=18.0.0 <=20.x.x",
211
- npm: ">=6.0.0"
212
- };
134
+ const version = "4.26.1";
213
135
  const packageJson = {
214
- name,
215
- version,
216
- description,
217
- keywords,
218
- homepage,
219
- bugs,
220
- repository,
221
- license,
222
- author,
223
- maintainers,
224
- main,
225
- module,
226
- source,
227
- types,
228
- bin,
229
- files,
230
- scripts,
231
- dependencies,
232
- devDependencies,
233
- engines
136
+ version
234
137
  };
235
138
  const VERSION = "v1";
236
139
  async function cloudApiFactory({ logger }, token) {
@@ -266,9 +169,9 @@ async function cloudApiFactory({ logger }, token) {
266
169
  }
267
170
  );
268
171
  },
269
- async createProject({ name: name2, nodeVersion, region, plan }) {
172
+ async createProject({ name, nodeVersion, region, plan }) {
270
173
  const response = await axiosCloudAPI.post("/project", {
271
- projectName: name2,
174
+ projectName: name,
272
175
  region,
273
176
  nodeVersion,
274
177
  plan
@@ -328,9 +231,9 @@ async function cloudApiFactory({ logger }, token) {
328
231
  throw error;
329
232
  }
330
233
  },
331
- async getProject({ name: name2 }) {
234
+ async getProject({ name }) {
332
235
  try {
333
- const response = await axiosCloudAPI.get(`/projects/${name2}`);
236
+ const response = await axiosCloudAPI.get(`/projects/${name}`);
334
237
  if (response.status !== 200) {
335
238
  throw new Error("Error fetching project's details.");
336
239
  }
@@ -475,8 +378,7 @@ async function tokenServiceFactory({ logger }) {
475
378
  logger.log(
476
379
  token ? "Oops! Your token seems expired or invalid. Please login again." : "We couldn't find a valid token. You need to be logged in to use this feature."
477
380
  );
478
- if (!await loginAction2(ctx))
479
- return null;
381
+ if (!await loginAction2(ctx)) return null;
480
382
  token = await retrieveToken();
481
383
  }
482
384
  return token;
@@ -1223,11 +1125,11 @@ const action$3 = async (ctx) => {
1223
1125
  }
1224
1126
  }
1225
1127
  };
1226
- const assertCwdContainsStrapiProject = (name2) => {
1128
+ const assertCwdContainsStrapiProject = (name) => {
1227
1129
  const logErrorAndExit = () => {
1228
1130
  console.log(
1229
1131
  `You need to run ${chalk.yellow(
1230
- `strapi ${name2}`
1132
+ `strapi ${name}`
1231
1133
  )} in a Strapi project. Make sure you are in the right directory.`
1232
1134
  );
1233
1135
  process.exit(1);
@@ -1241,8 +1143,8 @@ const assertCwdContainsStrapiProject = (name2) => {
1241
1143
  logErrorAndExit();
1242
1144
  }
1243
1145
  };
1244
- const runAction = (name2, action2) => (...args) => {
1245
- assertCwdContainsStrapiProject(name2);
1146
+ const runAction = (name, action2) => (...args) => {
1147
+ assertCwdContainsStrapiProject(name);
1246
1148
  Promise.resolve().then(() => {
1247
1149
  return action2(...args);
1248
1150
  }).catch((error) => {