node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

37
server/node_modules/@strapi/cloud-cli/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,37 @@
Copyright (c) 2015-present Strapi Solutions SAS
Portions of the Strapi software are licensed as follows:
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined below.
Enterprise License
If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
* All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
MIT Expat License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3
server/node_modules/@strapi/cloud-cli/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Cloud CLI
This package includes the `cloud` CLI to manage Strapi projects on the cloud.

7
server/node_modules/@strapi/cloud-cli/bin/index.js generated vendored Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env node
'use strict';
const { runStrapiCloudCommand } = require('../dist/bin');
runStrapiCloudCommand(process.argv);

4
server/node_modules/@strapi/cloud-cli/dist/bin.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import { Command } from 'commander';
declare function runStrapiCloudCommand(argv?: string[], command?: Command): void;
export { runStrapiCloudCommand };
//# sourceMappingURL=bin.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC,iBAAS,qBAAqB,CAAC,IAAI,WAAe,EAAE,OAAO,UAAgB,QAG1E;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}

46
server/node_modules/@strapi/cloud-cli/dist/bin.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
'use strict';
var commander = require('commander');
require('axios');
require('fs-extra');
require('os');
require('./config/api.js');
require('path');
require('xdg-app-paths');
require('lodash');
require('jwks-rsa');
require('jsonwebtoken');
var logger = require('./services/logger.js');
var index = require('./index.js');
function loadStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
// Initial program setup
command.storeOptionsAsProperties(false).allowUnknownOption(true);
// Help command
command.helpOption('-h, --help', 'Display help for command');
command.addHelpCommand('help [command]', 'Display help for command');
const cwd = process.cwd();
const hasDebug = argv.includes('--debug');
const hasSilent = argv.includes('--silent');
const logger$1 = logger.createLogger({
debug: hasDebug,
silent: hasSilent,
timestamp: false
});
const ctx = {
cwd,
logger: logger$1
};
index.buildStrapiCloudCommands({
command,
ctx,
argv
});
}
function runStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
loadStrapiCloudCommand(argv, command);
command.parse(argv);
}
exports.runStrapiCloudCommand = runStrapiCloudCommand;
//# sourceMappingURL=bin.js.map

View File

@@ -0,0 +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,WAASC,mBAAa,CAAA;QAAEC,KAAOL,EAAAA,QAAAA;QAAUM,MAAQJ,EAAAA,SAAAA;QAAWK,SAAW,EAAA;AAAM,KAAA,CAAA;AAEnF,IAAA,MAAMC,GAAM,GAAA;AACVT,QAAAA,GAAAA;AACAI,gBAAAA;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;;;;"}

44
server/node_modules/@strapi/cloud-cli/dist/bin.mjs generated vendored Normal file
View File

@@ -0,0 +1,44 @@
import { Command } from 'commander';
import 'axios';
import 'fs-extra';
import 'os';
import './config/api.mjs';
import 'path';
import 'xdg-app-paths';
import 'lodash';
import 'jwks-rsa';
import 'jsonwebtoken';
import { createLogger } from './services/logger.mjs';
import { buildStrapiCloudCommands } from './index.mjs';
function loadStrapiCloudCommand(argv = process.argv, command = new Command()) {
// Initial program setup
command.storeOptionsAsProperties(false).allowUnknownOption(true);
// Help command
command.helpOption('-h, --help', 'Display help for command');
command.addHelpCommand('help [command]', 'Display help for command');
const cwd = process.cwd();
const hasDebug = argv.includes('--debug');
const hasSilent = argv.includes('--silent');
const logger = createLogger({
debug: hasDebug,
silent: hasSilent,
timestamp: false
});
const ctx = {
cwd,
logger
};
buildStrapiCloudCommands({
command,
ctx,
argv
});
}
function runStrapiCloudCommand(argv = process.argv, command = new Command()) {
loadStrapiCloudCommand(argv, command);
command.parse(argv);
}
export { runStrapiCloudCommand };
//# sourceMappingURL=bin.mjs.map

View File

@@ -0,0 +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;;;;"}

View File

@@ -0,0 +1,3 @@
import { Command } from 'commander';
export declare function defineCloudNamespace(command: Command, ctx: unknown): Command;
//# sourceMappingURL=command.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/cloud/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAS5E"}

View File

@@ -0,0 +1,14 @@
'use strict';
var helpers = require('../utils/helpers.js');
var action = require('../environment/list/action.js');
function defineCloudNamespace(command, ctx) {
const cloud = command.command('cloud').description('Manage Strapi Cloud projects');
// Define cloud namespace aliases:
cloud.command('environments').description('Alias for cloud environment list').action(()=>helpers.runAction('list', action)(ctx));
return cloud;
}
exports.defineCloudNamespace = defineCloudNamespace;
//# sourceMappingURL=command.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.js","sources":["../../src/cloud/command.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { runAction } from '../utils/helpers';\nimport listAction from '../environment/list/action';\n\nexport function defineCloudNamespace(command: Command, ctx: unknown): Command {\n const cloud = command.command('cloud').description('Manage Strapi Cloud projects');\n\n // Define cloud namespace aliases:\n cloud\n .command('environments')\n .description('Alias for cloud environment list')\n .action(() => runAction('list', listAction)(ctx));\n return cloud;\n}\n"],"names":["defineCloudNamespace","command","ctx","cloud","description","action","runAction","listAction"],"mappings":";;;;;AAIO,SAASA,oBAAAA,CAAqBC,OAAgB,EAAEC,GAAY,EAAA;AACjE,IAAA,MAAMC,QAAQF,OAAQA,CAAAA,OAAO,CAAC,OAAA,CAAA,CAASG,WAAW,CAAC,8BAAA,CAAA;;IAGnDD,KACGF,CAAAA,OAAO,CAAC,cAAA,CAAA,CACRG,WAAW,CAAC,kCACZC,CAAAA,CAAAA,MAAM,CAAC,IAAMC,iBAAU,CAAA,MAAA,EAAQC,MAAYL,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA;IAC9C,OAAOC,KAAAA;AACT;;;;"}

View File

@@ -0,0 +1,12 @@
import { runAction } from '../utils/helpers.mjs';
import action from '../environment/list/action.mjs';
function defineCloudNamespace(command, ctx) {
const cloud = command.command('cloud').description('Manage Strapi Cloud projects');
// Define cloud namespace aliases:
cloud.command('environments').description('Alias for cloud environment list').action(()=>runAction('list', action)(ctx));
return cloud;
}
export { defineCloudNamespace };
//# sourceMappingURL=command.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.mjs","sources":["../../src/cloud/command.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { runAction } from '../utils/helpers';\nimport listAction from '../environment/list/action';\n\nexport function defineCloudNamespace(command: Command, ctx: unknown): Command {\n const cloud = command.command('cloud').description('Manage Strapi Cloud projects');\n\n // Define cloud namespace aliases:\n cloud\n .command('environments')\n .description('Alias for cloud environment list')\n .action(() => runAction('list', listAction)(ctx));\n return cloud;\n}\n"],"names":["defineCloudNamespace","command","ctx","cloud","description","action","runAction","listAction"],"mappings":";;;AAIO,SAASA,oBAAAA,CAAqBC,OAAgB,EAAEC,GAAY,EAAA;AACjE,IAAA,MAAMC,QAAQF,OAAQA,CAAAA,OAAO,CAAC,OAAA,CAAA,CAASG,WAAW,CAAC,8BAAA,CAAA;;IAGnDD,KACGF,CAAAA,OAAO,CAAC,cAAA,CAAA,CACRG,WAAW,CAAC,kCACZC,CAAAA,CAAAA,MAAM,CAAC,IAAMC,SAAU,CAAA,MAAA,EAAQC,MAAYL,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA;IAC9C,OAAOC,KAAAA;AACT;;;;"}

View File

@@ -0,0 +1,5 @@
export declare const apiConfig: {
apiBaseUrl: string | undefined;
dashboardBaseUrl: string | undefined;
};
//# sourceMappingURL=api.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/config/api.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;CAGrB,CAAC"}

View File

@@ -0,0 +1,11 @@
'use strict';
var utils = require('@strapi/utils');
const apiConfig = {
apiBaseUrl: utils.env('STRAPI_CLI_CLOUD_API', 'https://cloud-cli-api.strapi.io'),
dashboardBaseUrl: utils.env('STRAPI_CLI_CLOUD_DASHBOARD', 'https://cloud.strapi.io')
};
exports.apiConfig = apiConfig;
//# sourceMappingURL=api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"api.js","sources":["../../src/config/api.ts"],"sourcesContent":["import { env } from '@strapi/utils';\n\nexport const apiConfig = {\n apiBaseUrl: env('STRAPI_CLI_CLOUD_API', 'https://cloud-cli-api.strapi.io'),\n dashboardBaseUrl: env('STRAPI_CLI_CLOUD_DASHBOARD', 'https://cloud.strapi.io'),\n};\n"],"names":["apiConfig","apiBaseUrl","env","dashboardBaseUrl"],"mappings":";;;;MAEaA,SAAY,GAAA;AACvBC,IAAAA,UAAAA,EAAYC,UAAI,sBAAwB,EAAA,iCAAA,CAAA;AACxCC,IAAAA,gBAAAA,EAAkBD,UAAI,4BAA8B,EAAA,yBAAA;AACtD;;;;"}

View File

@@ -0,0 +1,9 @@
import { env } from '@strapi/utils';
const apiConfig = {
apiBaseUrl: env('STRAPI_CLI_CLOUD_API', 'https://cloud-cli-api.strapi.io'),
dashboardBaseUrl: env('STRAPI_CLI_CLOUD_DASHBOARD', 'https://cloud.strapi.io')
};
export { apiConfig };
//# sourceMappingURL=api.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"api.mjs","sources":["../../src/config/api.ts"],"sourcesContent":["import { env } from '@strapi/utils';\n\nexport const apiConfig = {\n apiBaseUrl: env('STRAPI_CLI_CLOUD_API', 'https://cloud-cli-api.strapi.io'),\n dashboardBaseUrl: env('STRAPI_CLI_CLOUD_DASHBOARD', 'https://cloud.strapi.io'),\n};\n"],"names":["apiConfig","apiBaseUrl","env","dashboardBaseUrl"],"mappings":";;MAEaA,SAAY,GAAA;AACvBC,IAAAA,UAAAA,EAAYC,IAAI,sBAAwB,EAAA,iCAAA,CAAA;AACxCC,IAAAA,gBAAAA,EAAkBD,IAAI,4BAA8B,EAAA,yBAAA;AACtD;;;;"}

View File

@@ -0,0 +1,9 @@
export declare const CONFIG_FILENAME = "config.json";
export type LocalConfig = {
token?: string;
installId?: string;
};
export declare function getTmpStoragePath(): Promise<string>;
export declare function getLocalConfig(): Promise<LocalConfig>;
export declare function saveLocalConfig(data: LocalConfig): Promise<void>;
//# sourceMappingURL=local.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/config/local.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAYF,wBAAsB,iBAAiB,oBAItC;AAaD,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAS3D;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,WAAW,iBAItD"}

View File

@@ -0,0 +1,60 @@
'use strict';
var path = require('path');
var os = require('os');
var fse = require('fs-extra');
var XDGAppPaths = require('xdg-app-paths');
const APP_FOLDER_NAME = 'com.strapi.cli';
const CONFIG_FILENAME = 'config.json';
async function checkDirectoryExists(directoryPath) {
try {
const fsStat = await fse.lstat(directoryPath);
return fsStat.isDirectory();
} catch (e) {
return false;
}
}
// Determine storage path based on the operating system
async function getTmpStoragePath() {
const storagePath = path.join(os.tmpdir(), APP_FOLDER_NAME);
await fse.ensureDir(storagePath);
return storagePath;
}
async function getConfigPath() {
const configDirs = XDGAppPaths(APP_FOLDER_NAME).configDirs();
const configPath = configDirs.find(checkDirectoryExists);
if (!configPath) {
await fse.ensureDir(configDirs[0]);
return configDirs[0];
}
return configPath;
}
async function getLocalConfig() {
const configPath = await getConfigPath();
const configFilePath = path.join(configPath, CONFIG_FILENAME);
await fse.ensureFile(configFilePath);
try {
return await fse.readJSON(configFilePath, {
encoding: 'utf8',
throws: true
});
} catch (e) {
return {};
}
}
async function saveLocalConfig(data) {
const configPath = await getConfigPath();
const configFilePath = path.join(configPath, CONFIG_FILENAME);
await fse.writeJson(configFilePath, data, {
encoding: 'utf8',
spaces: 2,
mode: 0o600
});
}
exports.CONFIG_FILENAME = CONFIG_FILENAME;
exports.getLocalConfig = getLocalConfig;
exports.getTmpStoragePath = getTmpStoragePath;
exports.saveLocalConfig = saveLocalConfig;
//# sourceMappingURL=local.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"local.js","sources":["../../src/config/local.ts"],"sourcesContent":["import path from 'path';\nimport os from 'os';\nimport fse from 'fs-extra';\nimport XDGAppPaths from 'xdg-app-paths';\n\nconst APP_FOLDER_NAME = 'com.strapi.cli';\n\nexport const CONFIG_FILENAME = 'config.json';\n\nexport type LocalConfig = {\n token?: string;\n installId?: string;\n};\n\nasync function checkDirectoryExists(directoryPath: string) {\n try {\n const fsStat = await fse.lstat(directoryPath);\n return fsStat.isDirectory();\n } catch (e) {\n return false;\n }\n}\n\n// Determine storage path based on the operating system\nexport async function getTmpStoragePath() {\n const storagePath = path.join(os.tmpdir(), APP_FOLDER_NAME);\n await fse.ensureDir(storagePath);\n return storagePath;\n}\n\nasync function getConfigPath() {\n const configDirs = XDGAppPaths(APP_FOLDER_NAME).configDirs();\n const configPath = configDirs.find(checkDirectoryExists);\n\n if (!configPath) {\n await fse.ensureDir(configDirs[0]);\n return configDirs[0];\n }\n return configPath;\n}\n\nexport async function getLocalConfig(): Promise<LocalConfig> {\n const configPath = await getConfigPath();\n const configFilePath = path.join(configPath, CONFIG_FILENAME);\n await fse.ensureFile(configFilePath);\n try {\n return await fse.readJSON(configFilePath, { encoding: 'utf8', throws: true });\n } catch (e) {\n return {};\n }\n}\n\nexport async function saveLocalConfig(data: LocalConfig) {\n const configPath = await getConfigPath();\n const configFilePath = path.join(configPath, CONFIG_FILENAME);\n await fse.writeJson(configFilePath, data, { encoding: 'utf8', spaces: 2, mode: 0o600 });\n}\n"],"names":["APP_FOLDER_NAME","CONFIG_FILENAME","checkDirectoryExists","directoryPath","fsStat","fse","lstat","isDirectory","e","getTmpStoragePath","storagePath","path","join","os","tmpdir","ensureDir","getConfigPath","configDirs","XDGAppPaths","configPath","find","getLocalConfig","configFilePath","ensureFile","readJSON","encoding","throws","saveLocalConfig","data","writeJson","spaces","mode"],"mappings":";;;;;;;AAKA,MAAMA,eAAkB,GAAA,gBAAA;AAEjB,MAAMC,kBAAkB;AAO/B,eAAeC,qBAAqBC,aAAqB,EAAA;IACvD,IAAI;AACF,QAAA,MAAMC,MAAS,GAAA,MAAMC,GAAIC,CAAAA,KAAK,CAACH,aAAAA,CAAAA;AAC/B,QAAA,OAAOC,OAAOG,WAAW,EAAA;AAC3B,KAAA,CAAE,OAAOC,CAAG,EAAA;QACV,OAAO,KAAA;AACT;AACF;AAEA;AACO,eAAeC,iBAAAA,GAAAA;AACpB,IAAA,MAAMC,cAAcC,IAAKC,CAAAA,IAAI,CAACC,EAAAA,CAAGC,MAAM,EAAId,EAAAA,eAAAA,CAAAA;IAC3C,MAAMK,GAAAA,CAAIU,SAAS,CAACL,WAAAA,CAAAA;IACpB,OAAOA,WAAAA;AACT;AAEA,eAAeM,aAAAA,GAAAA;IACb,MAAMC,UAAAA,GAAaC,WAAYlB,CAAAA,eAAAA,CAAAA,CAAiBiB,UAAU,EAAA;IAC1D,MAAME,UAAAA,GAAaF,UAAWG,CAAAA,IAAI,CAAClB,oBAAAA,CAAAA;AAEnC,IAAA,IAAI,CAACiB,UAAY,EAAA;AACf,QAAA,MAAMd,GAAIU,CAAAA,SAAS,CAACE,UAAU,CAAC,CAAE,CAAA,CAAA;QACjC,OAAOA,UAAU,CAAC,CAAE,CAAA;AACtB;IACA,OAAOE,UAAAA;AACT;AAEO,eAAeE,cAAAA,GAAAA;AACpB,IAAA,MAAMF,aAAa,MAAMH,aAAAA,EAAAA;AACzB,IAAA,MAAMM,cAAiBX,GAAAA,IAAAA,CAAKC,IAAI,CAACO,UAAYlB,EAAAA,eAAAA,CAAAA;IAC7C,MAAMI,GAAAA,CAAIkB,UAAU,CAACD,cAAAA,CAAAA;IACrB,IAAI;AACF,QAAA,OAAO,MAAMjB,GAAAA,CAAImB,QAAQ,CAACF,cAAgB,EAAA;YAAEG,QAAU,EAAA,MAAA;YAAQC,MAAQ,EAAA;AAAK,SAAA,CAAA;AAC7E,KAAA,CAAE,OAAOlB,CAAG,EAAA;AACV,QAAA,OAAO,EAAC;AACV;AACF;AAEO,eAAemB,gBAAgBC,IAAiB,EAAA;AACrD,IAAA,MAAMT,aAAa,MAAMH,aAAAA,EAAAA;AACzB,IAAA,MAAMM,cAAiBX,GAAAA,IAAAA,CAAKC,IAAI,CAACO,UAAYlB,EAAAA,eAAAA,CAAAA;AAC7C,IAAA,MAAMI,GAAIwB,CAAAA,SAAS,CAACP,cAAAA,EAAgBM,IAAM,EAAA;QAAEH,QAAU,EAAA,MAAA;QAAQK,MAAQ,EAAA,CAAA;QAAGC,IAAM,EAAA;AAAM,KAAA,CAAA;AACvF;;;;;;;"}

View File

@@ -0,0 +1,55 @@
import path__default from 'path';
import os from 'os';
import fse__default from 'fs-extra';
import XDGAppPaths from 'xdg-app-paths';
const APP_FOLDER_NAME = 'com.strapi.cli';
const CONFIG_FILENAME = 'config.json';
async function checkDirectoryExists(directoryPath) {
try {
const fsStat = await fse__default.lstat(directoryPath);
return fsStat.isDirectory();
} catch (e) {
return false;
}
}
// Determine storage path based on the operating system
async function getTmpStoragePath() {
const storagePath = path__default.join(os.tmpdir(), APP_FOLDER_NAME);
await fse__default.ensureDir(storagePath);
return storagePath;
}
async function getConfigPath() {
const configDirs = XDGAppPaths(APP_FOLDER_NAME).configDirs();
const configPath = configDirs.find(checkDirectoryExists);
if (!configPath) {
await fse__default.ensureDir(configDirs[0]);
return configDirs[0];
}
return configPath;
}
async function getLocalConfig() {
const configPath = await getConfigPath();
const configFilePath = path__default.join(configPath, CONFIG_FILENAME);
await fse__default.ensureFile(configFilePath);
try {
return await fse__default.readJSON(configFilePath, {
encoding: 'utf8',
throws: true
});
} catch (e) {
return {};
}
}
async function saveLocalConfig(data) {
const configPath = await getConfigPath();
const configFilePath = path__default.join(configPath, CONFIG_FILENAME);
await fse__default.writeJson(configFilePath, data, {
encoding: 'utf8',
spaces: 2,
mode: 0o600
});
}
export { CONFIG_FILENAME, getLocalConfig, getTmpStoragePath, saveLocalConfig };
//# sourceMappingURL=local.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"local.mjs","sources":["../../src/config/local.ts"],"sourcesContent":["import path from 'path';\nimport os from 'os';\nimport fse from 'fs-extra';\nimport XDGAppPaths from 'xdg-app-paths';\n\nconst APP_FOLDER_NAME = 'com.strapi.cli';\n\nexport const CONFIG_FILENAME = 'config.json';\n\nexport type LocalConfig = {\n token?: string;\n installId?: string;\n};\n\nasync function checkDirectoryExists(directoryPath: string) {\n try {\n const fsStat = await fse.lstat(directoryPath);\n return fsStat.isDirectory();\n } catch (e) {\n return false;\n }\n}\n\n// Determine storage path based on the operating system\nexport async function getTmpStoragePath() {\n const storagePath = path.join(os.tmpdir(), APP_FOLDER_NAME);\n await fse.ensureDir(storagePath);\n return storagePath;\n}\n\nasync function getConfigPath() {\n const configDirs = XDGAppPaths(APP_FOLDER_NAME).configDirs();\n const configPath = configDirs.find(checkDirectoryExists);\n\n if (!configPath) {\n await fse.ensureDir(configDirs[0]);\n return configDirs[0];\n }\n return configPath;\n}\n\nexport async function getLocalConfig(): Promise<LocalConfig> {\n const configPath = await getConfigPath();\n const configFilePath = path.join(configPath, CONFIG_FILENAME);\n await fse.ensureFile(configFilePath);\n try {\n return await fse.readJSON(configFilePath, { encoding: 'utf8', throws: true });\n } catch (e) {\n return {};\n }\n}\n\nexport async function saveLocalConfig(data: LocalConfig) {\n const configPath = await getConfigPath();\n const configFilePath = path.join(configPath, CONFIG_FILENAME);\n await fse.writeJson(configFilePath, data, { encoding: 'utf8', spaces: 2, mode: 0o600 });\n}\n"],"names":["APP_FOLDER_NAME","CONFIG_FILENAME","checkDirectoryExists","directoryPath","fsStat","fse","lstat","isDirectory","e","getTmpStoragePath","storagePath","path","join","os","tmpdir","ensureDir","getConfigPath","configDirs","XDGAppPaths","configPath","find","getLocalConfig","configFilePath","ensureFile","readJSON","encoding","throws","saveLocalConfig","data","writeJson","spaces","mode"],"mappings":";;;;;AAKA,MAAMA,eAAkB,GAAA,gBAAA;AAEjB,MAAMC,kBAAkB;AAO/B,eAAeC,qBAAqBC,aAAqB,EAAA;IACvD,IAAI;AACF,QAAA,MAAMC,MAAS,GAAA,MAAMC,YAAIC,CAAAA,KAAK,CAACH,aAAAA,CAAAA;AAC/B,QAAA,OAAOC,OAAOG,WAAW,EAAA;AAC3B,KAAA,CAAE,OAAOC,CAAG,EAAA;QACV,OAAO,KAAA;AACT;AACF;AAEA;AACO,eAAeC,iBAAAA,GAAAA;AACpB,IAAA,MAAMC,cAAcC,aAAKC,CAAAA,IAAI,CAACC,EAAAA,CAAGC,MAAM,EAAId,EAAAA,eAAAA,CAAAA;IAC3C,MAAMK,YAAAA,CAAIU,SAAS,CAACL,WAAAA,CAAAA;IACpB,OAAOA,WAAAA;AACT;AAEA,eAAeM,aAAAA,GAAAA;IACb,MAAMC,UAAAA,GAAaC,WAAYlB,CAAAA,eAAAA,CAAAA,CAAiBiB,UAAU,EAAA;IAC1D,MAAME,UAAAA,GAAaF,UAAWG,CAAAA,IAAI,CAAClB,oBAAAA,CAAAA;AAEnC,IAAA,IAAI,CAACiB,UAAY,EAAA;AACf,QAAA,MAAMd,YAAIU,CAAAA,SAAS,CAACE,UAAU,CAAC,CAAE,CAAA,CAAA;QACjC,OAAOA,UAAU,CAAC,CAAE,CAAA;AACtB;IACA,OAAOE,UAAAA;AACT;AAEO,eAAeE,cAAAA,GAAAA;AACpB,IAAA,MAAMF,aAAa,MAAMH,aAAAA,EAAAA;AACzB,IAAA,MAAMM,cAAiBX,GAAAA,aAAAA,CAAKC,IAAI,CAACO,UAAYlB,EAAAA,eAAAA,CAAAA;IAC7C,MAAMI,YAAAA,CAAIkB,UAAU,CAACD,cAAAA,CAAAA;IACrB,IAAI;AACF,QAAA,OAAO,MAAMjB,YAAAA,CAAImB,QAAQ,CAACF,cAAgB,EAAA;YAAEG,QAAU,EAAA,MAAA;YAAQC,MAAQ,EAAA;AAAK,SAAA,CAAA;AAC7E,KAAA,CAAE,OAAOlB,CAAG,EAAA;AACV,QAAA,OAAO,EAAC;AACV;AACF;AAEO,eAAemB,gBAAgBC,IAAiB,EAAA;AACrD,IAAA,MAAMT,aAAa,MAAMH,aAAAA,EAAAA;AACzB,IAAA,MAAMM,cAAiBX,GAAAA,aAAAA,CAAKC,IAAI,CAACO,UAAYlB,EAAAA,eAAAA,CAAAA;AAC7C,IAAA,MAAMI,YAAIwB,CAAAA,SAAS,CAACP,cAAAA,EAAgBM,IAAM,EAAA;QAAEH,QAAU,EAAA,MAAA;QAAQK,MAAQ,EAAA,CAAA;QAAGC,IAAM,EAAA;AAAM,KAAA,CAAA;AACvF;;;;"}

View File

@@ -0,0 +1,4 @@
import type { CLIContext } from '../types';
declare const _default: (ctx: CLIContext) => Promise<any>;
export default _default;
//# sourceMappingURL=action.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/create-project/action.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAgC,MAAM,UAAU,CAAC;8BAyD9C,UAAU;AAArC,wBAyCE"}

View File

@@ -0,0 +1,95 @@
'use strict';
var inquirer = require('inquirer');
var axios = require('axios');
var fp = require('lodash/fp');
var cliApi = require('../services/cli-api.js');
var strapiInfoSave = require('../services/strapi-info-save.js');
var token = require('../services/token.js');
require('chalk');
require('fast-safe-stringify');
require('ora');
require('cli-progress');
var getProjectNameFromPkg = require('./utils/get-project-name-from-pkg.js');
var action$1 = require('../login/action.js');
var projectQuestions_utils = require('./utils/project-questions.utils.js');
async function handleError(ctx, error) {
const { logger } = ctx;
logger.debug(error);
if (error instanceof axios.AxiosError) {
const errorMessage = typeof error.response?.data === 'string' ? error.response.data : null;
switch(error.response?.status){
case 403:
logger.error(errorMessage || 'You do not have permission to create a project. Please contact support for assistance.');
return;
case 400:
logger.error(errorMessage || 'Invalid input. Please check your inputs and try again.');
return;
case 503:
logger.error('Strapi Cloud project creation is currently unavailable. Please try again later.');
return;
default:
if (errorMessage) {
logger.error(errorMessage);
return;
}
break;
}
}
logger.error('We encountered an issue while creating your project. Please try again in a moment. If the problem persists, contact support for assistance.');
}
async function createProject(ctx, cloudApi, projectInput) {
const { logger } = ctx;
const spinner = logger.spinner('Setting up your project...').start();
try {
const { data } = await cloudApi.createProject(projectInput);
await strapiInfoSave.save({
project: data
});
spinner.succeed('Project created successfully!');
return data;
} catch (e) {
spinner.fail('An error occurred while creating the project on Strapi Cloud.');
throw e;
}
}
var action = (async (ctx)=>{
const { logger } = ctx;
const { getValidToken, eraseToken } = await token.tokenServiceFactory(ctx);
const token$1 = await getValidToken(ctx, action$1.promptLogin);
if (!token$1) {
return;
}
const cloudApi = await cliApi.cloudApiFactory(ctx, token$1);
const { data: config } = await cloudApi.config();
const projectName = await getProjectNameFromPkg.getProjectNameFromPackageJson(ctx);
const defaultAnswersMapper = projectQuestions_utils.questionDefaultValuesMapper({
name: projectName,
nodeVersion: projectQuestions_utils.getProjectNodeVersionDefault
});
const questions = defaultAnswersMapper(config.projectCreation.questions);
const defaultValues = {
...config.projectCreation.defaults,
...projectQuestions_utils.getDefaultsFromQuestions(questions)
};
const projectAnswersDefaulted = fp.defaults(defaultValues);
const projectAnswers = await inquirer.prompt(questions);
const projectInput = projectAnswersDefaulted(projectAnswers);
try {
return await createProject(ctx, cloudApi, projectInput);
} catch (e) {
if (e instanceof axios.AxiosError && e.response?.status === 401) {
logger.warn('Oops! Your session has expired. Please log in again to retry.');
await eraseToken();
if (await action$1.promptLogin(ctx)) {
return await createProject(ctx, cloudApi, projectInput);
}
} else {
await handleError(ctx, e);
}
}
});
module.exports = action;
//# sourceMappingURL=action.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,93 @@
import inquirer from 'inquirer';
import { AxiosError } from 'axios';
import { defaults } from 'lodash/fp';
import { cloudApiFactory } from '../services/cli-api.mjs';
import { save } from '../services/strapi-info-save.mjs';
import { tokenServiceFactory } from '../services/token.mjs';
import 'chalk';
import 'fast-safe-stringify';
import 'ora';
import 'cli-progress';
import { getProjectNameFromPackageJson } from './utils/get-project-name-from-pkg.mjs';
import { promptLogin } from '../login/action.mjs';
import { getDefaultsFromQuestions, questionDefaultValuesMapper, getProjectNodeVersionDefault } from './utils/project-questions.utils.mjs';
async function handleError(ctx, error) {
const { logger } = ctx;
logger.debug(error);
if (error instanceof AxiosError) {
const errorMessage = typeof error.response?.data === 'string' ? error.response.data : null;
switch(error.response?.status){
case 403:
logger.error(errorMessage || 'You do not have permission to create a project. Please contact support for assistance.');
return;
case 400:
logger.error(errorMessage || 'Invalid input. Please check your inputs and try again.');
return;
case 503:
logger.error('Strapi Cloud project creation is currently unavailable. Please try again later.');
return;
default:
if (errorMessage) {
logger.error(errorMessage);
return;
}
break;
}
}
logger.error('We encountered an issue while creating your project. Please try again in a moment. If the problem persists, contact support for assistance.');
}
async function createProject(ctx, cloudApi, projectInput) {
const { logger } = ctx;
const spinner = logger.spinner('Setting up your project...').start();
try {
const { data } = await cloudApi.createProject(projectInput);
await save({
project: data
});
spinner.succeed('Project created successfully!');
return data;
} catch (e) {
spinner.fail('An error occurred while creating the project on Strapi Cloud.');
throw e;
}
}
var action = (async (ctx)=>{
const { logger } = ctx;
const { getValidToken, eraseToken } = await tokenServiceFactory(ctx);
const token = await getValidToken(ctx, promptLogin);
if (!token) {
return;
}
const cloudApi = await cloudApiFactory(ctx, token);
const { data: config } = await cloudApi.config();
const projectName = await getProjectNameFromPackageJson(ctx);
const defaultAnswersMapper = questionDefaultValuesMapper({
name: projectName,
nodeVersion: getProjectNodeVersionDefault
});
const questions = defaultAnswersMapper(config.projectCreation.questions);
const defaultValues = {
...config.projectCreation.defaults,
...getDefaultsFromQuestions(questions)
};
const projectAnswersDefaulted = defaults(defaultValues);
const projectAnswers = await inquirer.prompt(questions);
const projectInput = projectAnswersDefaulted(projectAnswers);
try {
return await createProject(ctx, cloudApi, projectInput);
} catch (e) {
if (e instanceof AxiosError && e.response?.status === 401) {
logger.warn('Oops! Your session has expired. Please log in again to retry.');
await eraseToken();
if (await promptLogin(ctx)) {
return await createProject(ctx, cloudApi, projectInput);
}
} else {
await handleError(ctx, e);
}
}
});
export { action as default };
//# sourceMappingURL=action.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
import { type StrapiCloudCommand } from '../types';
/**
* `$ create project in Strapi cloud`
*/
declare const command: StrapiCloudCommand;
export default command;
//# sourceMappingURL=command.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/create-project/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD;;GAEG;AACH,QAAA,MAAM,OAAO,EAAE,kBAMd,CAAC;AAEF,eAAe,OAAO,CAAC"}

View File

@@ -0,0 +1,14 @@
'use strict';
var commander = require('commander');
var helpers = require('../utils/helpers.js');
var action = require('./action.js');
/**
* `$ create project in Strapi cloud`
*/ const command = ({ ctx })=>{
return commander.createCommand('cloud:create-project').description('Create a Strapi Cloud project').option('-d, --debug', 'Enable debugging mode with verbose logs').option('-s, --silent', "Don't log anything").action(()=>helpers.runAction('cloud:create-project', action)(ctx));
};
module.exports = command;
//# sourceMappingURL=command.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.js","sources":["../../src/create-project/command.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { type StrapiCloudCommand } from '../types';\nimport { runAction } from '../utils/helpers';\nimport action from './action';\n\n/**\n * `$ create project in Strapi cloud`\n */\nconst command: StrapiCloudCommand = ({ ctx }) => {\n return createCommand('cloud:create-project')\n .description('Create a Strapi Cloud project')\n .option('-d, --debug', 'Enable debugging mode with verbose logs')\n .option('-s, --silent', \"Don't log anything\")\n .action(() => runAction('cloud:create-project', action)(ctx));\n};\n\nexport default command;\n"],"names":["command","ctx","createCommand","description","option","action","runAction"],"mappings":";;;;;;AAKA;;AAEC,IACKA,MAAAA,OAAAA,GAA8B,CAAC,EAAEC,GAAG,EAAE,GAAA;AAC1C,IAAA,OAAOC,wBAAc,sBAClBC,CAAAA,CAAAA,WAAW,CAAC,+BACZC,CAAAA,CAAAA,MAAM,CAAC,aAAe,EAAA,yCAAA,CAAA,CACtBA,MAAM,CAAC,gBAAgB,oBACvBC,CAAAA,CAAAA,MAAM,CAAC,IAAMC,iBAAAA,CAAU,wBAAwBD,MAAQJ,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA;AAC5D;;;;"}

View File

@@ -0,0 +1,12 @@
import { createCommand } from 'commander';
import { runAction } from '../utils/helpers.mjs';
import action from './action.mjs';
/**
* `$ create project in Strapi cloud`
*/ const command = ({ ctx })=>{
return createCommand('cloud:create-project').description('Create a Strapi Cloud project').option('-d, --debug', 'Enable debugging mode with verbose logs').option('-s, --silent', "Don't log anything").action(()=>runAction('cloud:create-project', action)(ctx));
};
export { command as default };
//# sourceMappingURL=command.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.mjs","sources":["../../src/create-project/command.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { type StrapiCloudCommand } from '../types';\nimport { runAction } from '../utils/helpers';\nimport action from './action';\n\n/**\n * `$ create project in Strapi cloud`\n */\nconst command: StrapiCloudCommand = ({ ctx }) => {\n return createCommand('cloud:create-project')\n .description('Create a Strapi Cloud project')\n .option('-d, --debug', 'Enable debugging mode with verbose logs')\n .option('-s, --silent', \"Don't log anything\")\n .action(() => runAction('cloud:create-project', action)(ctx));\n};\n\nexport default command;\n"],"names":["command","ctx","createCommand","description","option","action","runAction"],"mappings":";;;;AAKA;;AAEC,IACKA,MAAAA,OAAAA,GAA8B,CAAC,EAAEC,GAAG,EAAE,GAAA;AAC1C,IAAA,OAAOC,cAAc,sBAClBC,CAAAA,CAAAA,WAAW,CAAC,+BACZC,CAAAA,CAAAA,MAAM,CAAC,aAAe,EAAA,yCAAA,CAAA,CACtBA,MAAM,CAAC,gBAAgB,oBACvBC,CAAAA,CAAAA,MAAM,CAAC,IAAMC,SAAAA,CAAU,wBAAwBD,MAAQJ,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA;AAC5D;;;;"}

View File

@@ -0,0 +1,7 @@
import action from './action';
import command from './command';
import type { StrapiCloudCommandInfo } from '../types';
export { action, command };
declare const _default: StrapiCloudCommandInfo;
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/create-project/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;AAE3B,wBAK4B"}

View File

@@ -0,0 +1,18 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var action = require('./action.js');
var command = require('./command.js');
var createProject = {
name: 'create-project',
description: 'Create a new project',
action,
command
};
exports.action = action;
exports.command = command;
exports.default = createProject;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../src/create-project/index.ts"],"sourcesContent":["import action from './action';\nimport command from './command';\nimport type { StrapiCloudCommandInfo } from '../types';\n\nexport { action, command };\n\nexport default {\n name: 'create-project',\n description: 'Create a new project',\n action,\n command,\n} as StrapiCloudCommandInfo;\n"],"names":["name","description","action","command"],"mappings":";;;;;;;AAMA,oBAAe;IACbA,IAAM,EAAA,gBAAA;IACNC,WAAa,EAAA,sBAAA;AACbC,IAAAA,MAAAA;AACAC,IAAAA;AACF,CAA4B;;;;;;"}

View File

@@ -0,0 +1,12 @@
import action from './action.mjs';
import command from './command.mjs';
var createProject = {
name: 'create-project',
description: 'Create a new project',
action,
command
};
export { action, command, createProject as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../src/create-project/index.ts"],"sourcesContent":["import action from './action';\nimport command from './command';\nimport type { StrapiCloudCommandInfo } from '../types';\n\nexport { action, command };\n\nexport default {\n name: 'create-project',\n description: 'Create a new project',\n action,\n command,\n} as StrapiCloudCommandInfo;\n"],"names":["name","description","action","command"],"mappings":";;;AAMA,oBAAe;IACbA,IAAM,EAAA,gBAAA;IACNC,WAAa,EAAA,sBAAA;AACbC,IAAAA,MAAAA;AACAC,IAAAA;AACF,CAA4B;;;;"}

View File

@@ -0,0 +1,3 @@
import { CLIContext } from '../../types';
export declare function getProjectNameFromPackageJson(ctx: CLIContext): Promise<string>;
//# sourceMappingURL=get-project-name-from-pkg.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-project-name-from-pkg.d.ts","sourceRoot":"","sources":["../../../src/create-project/utils/get-project-name-from-pkg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,wBAAsB,6BAA6B,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAOpF"}

View File

@@ -0,0 +1,15 @@
'use strict';
var pkg = require('../../utils/pkg.js');
async function getProjectNameFromPackageJson(ctx) {
try {
const packageJson = await pkg.loadPkg(ctx);
return packageJson.name || 'my-strapi-project';
} catch (e) {
return 'my-strapi-project';
}
}
exports.getProjectNameFromPackageJson = getProjectNameFromPackageJson;
//# sourceMappingURL=get-project-name-from-pkg.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-project-name-from-pkg.js","sources":["../../../src/create-project/utils/get-project-name-from-pkg.ts"],"sourcesContent":["import { CLIContext } from '../../types';\nimport { PackageJson, loadPkg } from '../../utils/pkg';\n\nexport async function getProjectNameFromPackageJson(ctx: CLIContext): Promise<string> {\n try {\n const packageJson = (await loadPkg(ctx)) as PackageJson;\n return packageJson.name || 'my-strapi-project';\n } catch (e) {\n return 'my-strapi-project';\n }\n}\n"],"names":["getProjectNameFromPackageJson","ctx","packageJson","loadPkg","name","e"],"mappings":";;;;AAGO,eAAeA,8BAA8BC,GAAe,EAAA;IACjE,IAAI;QACF,MAAMC,WAAAA,GAAe,MAAMC,WAAQF,CAAAA,GAAAA,CAAAA;QACnC,OAAOC,WAAAA,CAAYE,IAAI,IAAI,mBAAA;AAC7B,KAAA,CAAE,OAAOC,CAAG,EAAA;QACV,OAAO,mBAAA;AACT;AACF;;;;"}

View File

@@ -0,0 +1,13 @@
import { loadPkg } from '../../utils/pkg.mjs';
async function getProjectNameFromPackageJson(ctx) {
try {
const packageJson = await loadPkg(ctx);
return packageJson.name || 'my-strapi-project';
} catch (e) {
return 'my-strapi-project';
}
}
export { getProjectNameFromPackageJson };
//# sourceMappingURL=get-project-name-from-pkg.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-project-name-from-pkg.mjs","sources":["../../../src/create-project/utils/get-project-name-from-pkg.ts"],"sourcesContent":["import { CLIContext } from '../../types';\nimport { PackageJson, loadPkg } from '../../utils/pkg';\n\nexport async function getProjectNameFromPackageJson(ctx: CLIContext): Promise<string> {\n try {\n const packageJson = (await loadPkg(ctx)) as PackageJson;\n return packageJson.name || 'my-strapi-project';\n } catch (e) {\n return 'my-strapi-project';\n }\n}\n"],"names":["getProjectNameFromPackageJson","ctx","packageJson","loadPkg","name","e"],"mappings":";;AAGO,eAAeA,8BAA8BC,GAAe,EAAA;IACjE,IAAI;QACF,MAAMC,WAAAA,GAAe,MAAMC,OAAQF,CAAAA,GAAAA,CAAAA;QACnC,OAAOC,WAAAA,CAAYE,IAAI,IAAI,mBAAA;AAC7B,KAAA,CAAE,OAAOC,CAAG,EAAA;QACV,OAAO,mBAAA;AACT;AACF;;;;"}

View File

@@ -0,0 +1,20 @@
import { DistinctQuestion } from 'inquirer';
import type { ProjectAnswers } from '../../types';
/**
* Apply default values to questions based on the provided mapper
* @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value
*/
export declare function questionDefaultValuesMapper(questionsMap: Partial<{
[K in keyof ProjectAnswers]: ((question: DistinctQuestion<ProjectAnswers>) => ProjectAnswers[K]) | ProjectAnswers[K];
}>): (questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>) => ReadonlyArray<DistinctQuestion<ProjectAnswers>>;
/**
* Get default values from questions
* @param questions - An array of questions for project creation
*/
export declare function getDefaultsFromQuestions(questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>): Partial<ProjectAnswers>;
/**
* Get the default node version based on the current node version if it is in the list of choices
* @param question - The question for the node version in project creation
*/
export declare function getProjectNodeVersionDefault(question: DistinctQuestion<ProjectAnswers>): string;
//# sourceMappingURL=project-questions.utils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"project-questions.utils.d.ts","sourceRoot":"","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,OAAO,CAAC;KACnB,CAAC,IAAI,MAAM,cAAc,GACtB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,GACnE,cAAc,CAAC,CAAC,CAAC;CACtB,CAAC,eAGW,cAAc,iBAAiB,cAAc,CAAC,CAAC,KACzD,cAAc,iBAAiB,cAAc,CAAC,CAAC,CAyBnD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,GACzD,OAAO,CAAC,cAAc,CAAC,CAOzB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAAG,MAAM,CAW/F"}

View File

@@ -0,0 +1,63 @@
'use strict';
/**
* Apply default values to questions based on the provided mapper
* @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value
*/ function questionDefaultValuesMapper(questionsMap) {
return (questions)=>{
return questions.map((question)=>{
const questionName = question.name;
// If the question is part of the mapper, apply the default value
if (questionName in questionsMap) {
const questionDefault = questionsMap[questionName];
// If the default value is a function, call it with the question and get the default value
if (typeof questionDefault === 'function') {
return {
...question,
default: questionDefault(question)
};
}
// else we consider it as a static value
return {
...question,
default: questionDefault
};
}
// If the question is not part of the mapper, return the question as is
return question;
});
};
}
/**
* Get default values from questions
* @param questions - An array of questions for project creation
*/ function getDefaultsFromQuestions(questions) {
return questions.reduce((acc, question)=>{
if (question.default && question.name) {
return {
...acc,
[question.name]: question.default
};
}
return acc;
}, {});
}
/**
* Get the default node version based on the current node version if it is in the list of choices
* @param question - The question for the node version in project creation
*/ function getProjectNodeVersionDefault(question) {
const currentNodeVersion = process.versions.node.split('.')[0];
// Node Version question is set up as a list, but the type of inquirer is dynamic and the question can change in the future (it comes from API)
if (question.type === 'list' && Array.isArray(question.choices)) {
const choice = question.choices.find((choice)=>choice.value === currentNodeVersion);
if (choice) {
return choice.value;
}
}
return question.default;
}
exports.getDefaultsFromQuestions = getDefaultsFromQuestions;
exports.getProjectNodeVersionDefault = getProjectNodeVersionDefault;
exports.questionDefaultValuesMapper = questionDefaultValuesMapper;
//# sourceMappingURL=project-questions.utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"project-questions.utils.js","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import { DistinctQuestion } from 'inquirer';\nimport type { ProjectAnswers } from '../../types';\n\n/**\n * Apply default values to questions based on the provided mapper\n * @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value\n */\nexport function questionDefaultValuesMapper(\n questionsMap: Partial<{\n [K in keyof ProjectAnswers]:\n | ((question: DistinctQuestion<ProjectAnswers>) => ProjectAnswers[K])\n | ProjectAnswers[K];\n }>\n) {\n return (\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n ): ReadonlyArray<DistinctQuestion<ProjectAnswers>> => {\n return questions.map((question) => {\n const questionName = question.name as keyof ProjectAnswers;\n\n // If the question is part of the mapper, apply the default value\n if (questionName in questionsMap) {\n const questionDefault = questionsMap[questionName];\n\n // If the default value is a function, call it with the question and get the default value\n if (typeof questionDefault === 'function') {\n return {\n ...question,\n default: questionDefault(question),\n };\n }\n // else we consider it as a static value\n return {\n ...question,\n default: questionDefault,\n };\n }\n // If the question is not part of the mapper, return the question as is\n return question;\n });\n };\n}\n\n/**\n * Get default values from questions\n * @param questions - An array of questions for project creation\n */\nexport function getDefaultsFromQuestions(\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n): Partial<ProjectAnswers> {\n return questions.reduce((acc, question) => {\n if (question.default && question.name) {\n return { ...acc, [question.name]: question.default };\n }\n return acc;\n }, {});\n}\n\n/**\n * Get the default node version based on the current node version if it is in the list of choices\n * @param question - The question for the node version in project creation\n */\nexport function getProjectNodeVersionDefault(question: DistinctQuestion<ProjectAnswers>): string {\n const currentNodeVersion = process.versions.node.split('.')[0];\n\n // Node Version question is set up as a list, but the type of inquirer is dynamic and the question can change in the future (it comes from API)\n if (question.type === 'list' && Array.isArray(question.choices)) {\n const choice = question.choices.find((choice) => choice.value === currentNodeVersion);\n if (choice) {\n return choice.value;\n }\n }\n return question.default;\n}\n"],"names":["questionDefaultValuesMapper","questionsMap","questions","map","question","questionName","name","questionDefault","default","getDefaultsFromQuestions","reduce","acc","getProjectNodeVersionDefault","currentNodeVersion","process","versions","node","split","type","Array","isArray","choices","choice","find","value"],"mappings":";;AAGA;;;IAIO,SAASA,2BAAAA,CACdC,YAIE,EAAA;AAEF,IAAA,OAAO,CACLC,SAAAA,GAAAA;QAEA,OAAOA,SAAAA,CAAUC,GAAG,CAAC,CAACC,QAAAA,GAAAA;YACpB,MAAMC,YAAAA,GAAeD,SAASE,IAAI;;AAGlC,YAAA,IAAID,gBAAgBJ,YAAc,EAAA;gBAChC,MAAMM,eAAAA,GAAkBN,YAAY,CAACI,YAAa,CAAA;;gBAGlD,IAAI,OAAOE,oBAAoB,UAAY,EAAA;oBACzC,OAAO;AACL,wBAAA,GAAGH,QAAQ;AACXI,wBAAAA,OAAAA,EAASD,eAAgBH,CAAAA,QAAAA;AAC3B,qBAAA;AACF;;gBAEA,OAAO;AACL,oBAAA,GAAGA,QAAQ;oBACXI,OAASD,EAAAA;AACX,iBAAA;AACF;;YAEA,OAAOH,QAAAA;AACT,SAAA,CAAA;AACF,KAAA;AACF;AAEA;;;IAIO,SAASK,wBAAAA,CACdP,SAA0D,EAAA;AAE1D,IAAA,OAAOA,SAAUQ,CAAAA,MAAM,CAAC,CAACC,GAAKP,EAAAA,QAAAA,GAAAA;AAC5B,QAAA,IAAIA,QAASI,CAAAA,OAAO,IAAIJ,QAAAA,CAASE,IAAI,EAAE;YACrC,OAAO;AAAE,gBAAA,GAAGK,GAAG;AAAE,gBAAA,CAACP,QAASE,CAAAA,IAAI,GAAGF,SAASI;AAAQ,aAAA;AACrD;QACA,OAAOG,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;AAEA;;;IAIO,SAASC,4BAAAA,CAA6BR,QAA0C,EAAA;IACrF,MAAMS,kBAAAA,GAAqBC,OAAQC,CAAAA,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,GAAI,CAAA,CAAC,CAAE,CAAA;;IAG9D,IAAIb,QAAAA,CAASc,IAAI,KAAK,MAAA,IAAUC,MAAMC,OAAO,CAAChB,QAASiB,CAAAA,OAAO,CAAG,EAAA;QAC/D,MAAMC,MAAAA,GAASlB,QAASiB,CAAAA,OAAO,CAACE,IAAI,CAAC,CAACD,MAAAA,GAAWA,MAAOE,CAAAA,KAAK,KAAKX,kBAAAA,CAAAA;AAClE,QAAA,IAAIS,MAAQ,EAAA;AACV,YAAA,OAAOA,OAAOE,KAAK;AACrB;AACF;AACA,IAAA,OAAOpB,SAASI,OAAO;AACzB;;;;;;"}

View File

@@ -0,0 +1,59 @@
/**
* Apply default values to questions based on the provided mapper
* @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value
*/ function questionDefaultValuesMapper(questionsMap) {
return (questions)=>{
return questions.map((question)=>{
const questionName = question.name;
// If the question is part of the mapper, apply the default value
if (questionName in questionsMap) {
const questionDefault = questionsMap[questionName];
// If the default value is a function, call it with the question and get the default value
if (typeof questionDefault === 'function') {
return {
...question,
default: questionDefault(question)
};
}
// else we consider it as a static value
return {
...question,
default: questionDefault
};
}
// If the question is not part of the mapper, return the question as is
return question;
});
};
}
/**
* Get default values from questions
* @param questions - An array of questions for project creation
*/ function getDefaultsFromQuestions(questions) {
return questions.reduce((acc, question)=>{
if (question.default && question.name) {
return {
...acc,
[question.name]: question.default
};
}
return acc;
}, {});
}
/**
* Get the default node version based on the current node version if it is in the list of choices
* @param question - The question for the node version in project creation
*/ function getProjectNodeVersionDefault(question) {
const currentNodeVersion = process.versions.node.split('.')[0];
// Node Version question is set up as a list, but the type of inquirer is dynamic and the question can change in the future (it comes from API)
if (question.type === 'list' && Array.isArray(question.choices)) {
const choice = question.choices.find((choice)=>choice.value === currentNodeVersion);
if (choice) {
return choice.value;
}
}
return question.default;
}
export { getDefaultsFromQuestions, getProjectNodeVersionDefault, questionDefaultValuesMapper };
//# sourceMappingURL=project-questions.utils.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"project-questions.utils.mjs","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import { DistinctQuestion } from 'inquirer';\nimport type { ProjectAnswers } from '../../types';\n\n/**\n * Apply default values to questions based on the provided mapper\n * @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value\n */\nexport function questionDefaultValuesMapper(\n questionsMap: Partial<{\n [K in keyof ProjectAnswers]:\n | ((question: DistinctQuestion<ProjectAnswers>) => ProjectAnswers[K])\n | ProjectAnswers[K];\n }>\n) {\n return (\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n ): ReadonlyArray<DistinctQuestion<ProjectAnswers>> => {\n return questions.map((question) => {\n const questionName = question.name as keyof ProjectAnswers;\n\n // If the question is part of the mapper, apply the default value\n if (questionName in questionsMap) {\n const questionDefault = questionsMap[questionName];\n\n // If the default value is a function, call it with the question and get the default value\n if (typeof questionDefault === 'function') {\n return {\n ...question,\n default: questionDefault(question),\n };\n }\n // else we consider it as a static value\n return {\n ...question,\n default: questionDefault,\n };\n }\n // If the question is not part of the mapper, return the question as is\n return question;\n });\n };\n}\n\n/**\n * Get default values from questions\n * @param questions - An array of questions for project creation\n */\nexport function getDefaultsFromQuestions(\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n): Partial<ProjectAnswers> {\n return questions.reduce((acc, question) => {\n if (question.default && question.name) {\n return { ...acc, [question.name]: question.default };\n }\n return acc;\n }, {});\n}\n\n/**\n * Get the default node version based on the current node version if it is in the list of choices\n * @param question - The question for the node version in project creation\n */\nexport function getProjectNodeVersionDefault(question: DistinctQuestion<ProjectAnswers>): string {\n const currentNodeVersion = process.versions.node.split('.')[0];\n\n // Node Version question is set up as a list, but the type of inquirer is dynamic and the question can change in the future (it comes from API)\n if (question.type === 'list' && Array.isArray(question.choices)) {\n const choice = question.choices.find((choice) => choice.value === currentNodeVersion);\n if (choice) {\n return choice.value;\n }\n }\n return question.default;\n}\n"],"names":["questionDefaultValuesMapper","questionsMap","questions","map","question","questionName","name","questionDefault","default","getDefaultsFromQuestions","reduce","acc","getProjectNodeVersionDefault","currentNodeVersion","process","versions","node","split","type","Array","isArray","choices","choice","find","value"],"mappings":"AAGA;;;IAIO,SAASA,2BAAAA,CACdC,YAIE,EAAA;AAEF,IAAA,OAAO,CACLC,SAAAA,GAAAA;QAEA,OAAOA,SAAAA,CAAUC,GAAG,CAAC,CAACC,QAAAA,GAAAA;YACpB,MAAMC,YAAAA,GAAeD,SAASE,IAAI;;AAGlC,YAAA,IAAID,gBAAgBJ,YAAc,EAAA;gBAChC,MAAMM,eAAAA,GAAkBN,YAAY,CAACI,YAAa,CAAA;;gBAGlD,IAAI,OAAOE,oBAAoB,UAAY,EAAA;oBACzC,OAAO;AACL,wBAAA,GAAGH,QAAQ;AACXI,wBAAAA,OAAAA,EAASD,eAAgBH,CAAAA,QAAAA;AAC3B,qBAAA;AACF;;gBAEA,OAAO;AACL,oBAAA,GAAGA,QAAQ;oBACXI,OAASD,EAAAA;AACX,iBAAA;AACF;;YAEA,OAAOH,QAAAA;AACT,SAAA,CAAA;AACF,KAAA;AACF;AAEA;;;IAIO,SAASK,wBAAAA,CACdP,SAA0D,EAAA;AAE1D,IAAA,OAAOA,SAAUQ,CAAAA,MAAM,CAAC,CAACC,GAAKP,EAAAA,QAAAA,GAAAA;AAC5B,QAAA,IAAIA,QAASI,CAAAA,OAAO,IAAIJ,QAAAA,CAASE,IAAI,EAAE;YACrC,OAAO;AAAE,gBAAA,GAAGK,GAAG;AAAE,gBAAA,CAACP,QAASE,CAAAA,IAAI,GAAGF,SAASI;AAAQ,aAAA;AACrD;QACA,OAAOG,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;AAEA;;;IAIO,SAASC,4BAAAA,CAA6BR,QAA0C,EAAA;IACrF,MAAMS,kBAAAA,GAAqBC,OAAQC,CAAAA,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,GAAI,CAAA,CAAC,CAAE,CAAA;;IAG9D,IAAIb,QAAAA,CAASc,IAAI,KAAK,MAAA,IAAUC,MAAMC,OAAO,CAAChB,QAASiB,CAAAA,OAAO,CAAG,EAAA;QAC/D,MAAMC,MAAAA,GAASlB,QAASiB,CAAAA,OAAO,CAACE,IAAI,CAAC,CAACD,MAAAA,GAAWA,MAAOE,CAAAA,KAAK,KAAKX,kBAAAA,CAAAA;AAClE,QAAA,IAAIS,MAAQ,EAAA;AACV,YAAA,OAAOA,OAAOE,KAAK;AACrB;AACF;AACA,IAAA,OAAOpB,SAASI,OAAO;AACzB;;;;"}

View File

@@ -0,0 +1,8 @@
import type { CLIContext } from '../types';
interface CmdOptions {
env?: string;
force?: boolean;
}
declare const _default: (ctx: CLIContext, opts: CmdOptions) => Promise<void>;
export default _default;
//# sourceMappingURL=action.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/deploy-project/action.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,UAAU,EAKX,MAAM,UAAU,CAAC;AAgBlB,UAAU,UAAU;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;8BA6L0B,UAAU,QAAQ,UAAU;AAAvD,wBA6HE"}

View File

@@ -0,0 +1,287 @@
'use strict';
var fse = require('fs-extra');
var inquirer = require('inquirer');
var boxen = require('boxen');
var path = require('path');
var chalk = require('chalk');
var axios = require('axios');
var crypto = require('node:crypto');
var api = require('../config/api.js');
var compressFiles = require('../utils/compress-files.js');
var action$2 = require('../create-project/action.js');
var local = require('../config/local.js');
var cliApi = require('../services/cli-api.js');
var strapiInfoSave = require('../services/strapi-info-save.js');
var token = require('../services/token.js');
require('fast-safe-stringify');
require('ora');
require('cli-progress');
var notification = require('../services/notification.js');
var pkg = require('../utils/pkg.js');
var buildLogs = require('../services/build-logs.js');
var action$1 = require('../login/action.js');
var analytics = require('../utils/analytics.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var crypto__namespace = /*#__PURE__*/_interopNamespaceDefault(crypto);
const boxenOptions = {
padding: 1,
margin: 1,
align: 'center',
borderColor: 'yellow',
borderStyle: 'round'
};
const QUIT_OPTION = 'Quit';
async function promptForEnvironment(environments) {
const choices = environments.map((env)=>({
name: env,
value: env
}));
const { selectedEnvironment } = await inquirer.prompt([
{
type: 'list',
name: 'selectedEnvironment',
message: 'Select the environment to deploy:',
choices: [
...choices,
{
name: chalk.grey(`(${QUIT_OPTION})`),
value: null
}
]
}
]);
if (selectedEnvironment === null) {
process.exit(1);
}
return selectedEnvironment;
}
async function upload(ctx, project, token, maxProjectFileSize) {
const cloudApi = await cliApi.cloudApiFactory(ctx, token);
try {
const storagePath = await local.getTmpStoragePath();
const projectFolder = path.resolve(process.cwd());
const packageJson = await pkg.loadPkg(ctx);
if (!packageJson) {
ctx.logger.error('Unable to deploy the project. Please make sure the package.json file is correctly formatted.');
return;
}
ctx.logger.log('📦 Compressing project...');
// hash packageJson.name to avoid conflicts
const hashname = crypto__namespace.createHash('sha512').update(packageJson.name).digest('hex');
const compressedFilename = `${hashname}.tar.gz`;
try {
ctx.logger.debug('Compression parameters\n', `Storage path: ${storagePath}\n`, `Project folder: ${projectFolder}\n`, `Compressed filename: ${compressedFilename}`);
await compressFiles.compressFilesToTar(storagePath, projectFolder, compressedFilename);
ctx.logger.log('📦 Project compressed successfully!');
} catch (e) {
ctx.logger.error('⚠️ Project compression failed. Try again later or check for large/incompatible files.');
ctx.logger.debug(e);
process.exit(1);
}
const tarFilePath = path.resolve(storagePath, compressedFilename);
const fileStats = await fse.stat(tarFilePath);
if (fileStats.size > maxProjectFileSize) {
ctx.logger.log('Unable to proceed: Your project is too big to be transferred, please use a git repo instead.');
try {
await fse.remove(tarFilePath);
} catch (e) {
ctx.logger.log('Unable to remove file: ', tarFilePath);
ctx.logger.debug(e);
}
return;
}
ctx.logger.info('🚀 Uploading project...');
const progressBar = ctx.logger.progressBar(100, 'Upload Progress');
try {
const { data } = await cloudApi.deploy({
filePath: tarFilePath,
project
}, {
onUploadProgress (progressEvent) {
const total = progressEvent.total || fileStats.size;
const percentage = Math.round(progressEvent.loaded * 100 / total);
progressBar.update(percentage);
}
});
progressBar.update(100);
progressBar.stop();
ctx.logger.success('✨ Upload finished!');
return data.build_id;
} catch (e) {
progressBar.stop();
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
ctx.logger.debug(e);
} finally{
await fse.remove(tarFilePath);
}
process.exit(0);
} catch (e) {
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
ctx.logger.debug(e);
process.exit(1);
}
}
async function getProject(ctx) {
const { project } = await strapiInfoSave.retrieve();
if (!project) {
try {
return await action$2(ctx);
} catch (e) {
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
ctx.logger.debug(e);
process.exit(1);
}
}
return project;
}
async function getConfig({ ctx, cloudApiService }) {
try {
const { data: cliConfig } = await cloudApiService.config();
return cliConfig;
} catch (e) {
ctx.logger.debug('Failed to get cli config', e);
return null;
}
}
function validateEnvironment(ctx, environment, environments) {
if (!environments.includes(environment)) {
ctx.logger.error(`Environment ${environment} does not exist.`);
process.exit(1);
}
}
async function getTargetEnvironment(ctx, opts, project, environments) {
if (opts.env) {
validateEnvironment(ctx, opts.env, environments);
return opts.env;
}
if (project.targetEnvironment) {
return project.targetEnvironment;
}
if (environments.length > 1) {
return promptForEnvironment(environments);
}
return environments[0];
}
function hasPendingOrLiveDeployment(environments, targetEnvironment) {
const environment = environments.find((env)=>env.name === targetEnvironment);
if (!environment) {
throw new Error(`Environment details ${targetEnvironment} not found.`);
}
return environment.hasPendingDeployment || environment.hasLiveDeployment || false;
}
var action = (async (ctx, opts)=>{
const { getValidToken } = await token.tokenServiceFactory(ctx);
const token$1 = await getValidToken(ctx, action$1.promptLogin);
if (!token$1) {
return;
}
const project = await getProject(ctx);
if (!project) {
return;
}
const cloudApiService = await cliApi.cloudApiFactory(ctx, token$1);
let projectData;
let environments;
let environmentsDetails;
try {
const { data: { data, metadata } } = await cloudApiService.getProject({
name: project.name
});
projectData = data;
environments = projectData.environments;
environmentsDetails = projectData.environmentsDetails;
const isProjectSuspended = projectData.suspendedAt;
if (isProjectSuspended) {
ctx.logger.log('\n Oops! This project has been suspended. \n\n Please reactivate it from the dashboard to continue deploying: ');
ctx.logger.log(chalk.underline(`${metadata.dashboardUrls.project}`));
return;
}
} catch (e) {
if (e instanceof axios.AxiosError && e.response?.data) {
if (e.response.status === 404) {
ctx.logger.warn(`The project associated with this folder does not exist in Strapi Cloud. \nPlease link your local project to an existing Strapi Cloud project using the ${chalk.cyan('link')} command before deploying.`);
} else {
ctx.logger.error(e.response.data);
}
} else {
ctx.logger.error("An error occurred while retrieving the project's information. Please try again later.");
}
ctx.logger.debug(e);
return;
}
await analytics.trackEvent(ctx, cloudApiService, 'willDeployWithCLI', {
projectInternalName: project.name
});
const notificationService = notification.notificationServiceFactory(ctx);
const buildLogsService = buildLogs.buildLogsServiceFactory(ctx);
const cliConfig = await getConfig({
ctx,
cloudApiService
});
if (!cliConfig) {
ctx.logger.error('An error occurred while retrieving data from Strapi Cloud. Please check your network or try again later.');
return;
}
let maxSize = parseInt(cliConfig.maxProjectFileSize, 10);
if (Number.isNaN(maxSize)) {
ctx.logger.debug('An error occurred while parsing the maxProjectFileSize. Using default value.');
maxSize = 100000000;
}
project.targetEnvironment = await getTargetEnvironment(ctx, opts, project, environments);
if (!opts.force) {
const shouldDisplayWarning = hasPendingOrLiveDeployment(environmentsDetails, project.targetEnvironment);
if (shouldDisplayWarning) {
ctx.logger.log(boxen(cliConfig.projectDeployment.confirmationText, boxenOptions));
const { confirm } = await inquirer.prompt([
{
type: 'confirm',
name: 'confirm',
message: `Do you want to proceed with deployment to ${chalk.cyan(projectData.displayName)} on ${chalk.cyan(project.targetEnvironment)} environment?`
}
]);
if (!confirm) {
process.exit(1);
}
}
}
const buildId = await upload(ctx, project, token$1, maxSize);
if (!buildId) {
return;
}
try {
ctx.logger.log(`🚀 Deploying project to ${chalk.cyan(project.targetEnvironment ?? `production`)} environment...`);
notificationService(`${api.apiConfig.apiBaseUrl}/notifications`, token$1, cliConfig);
await buildLogsService(`${api.apiConfig.apiBaseUrl}/v1/logs/${buildId}`, token$1, cliConfig);
ctx.logger.log('Visit the following URL for deployment logs. Your deployment will be available here shortly.');
ctx.logger.log(chalk.underline(`${api.apiConfig.dashboardBaseUrl}/projects/${project.name}/deployments`));
} catch (e) {
ctx.logger.debug(e);
if (e instanceof Error) {
ctx.logger.error(e.message);
} else {
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
}
}
});
module.exports = action;
//# sourceMappingURL=action.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,266 @@
import fse__default from 'fs-extra';
import inquirer from 'inquirer';
import boxen from 'boxen';
import path__default from 'path';
import chalk from 'chalk';
import { AxiosError } from 'axios';
import * as crypto from 'node:crypto';
import { apiConfig } from '../config/api.mjs';
import { compressFilesToTar } from '../utils/compress-files.mjs';
import action$1 from '../create-project/action.mjs';
import { getTmpStoragePath } from '../config/local.mjs';
import { cloudApiFactory } from '../services/cli-api.mjs';
import { retrieve } from '../services/strapi-info-save.mjs';
import { tokenServiceFactory } from '../services/token.mjs';
import 'fast-safe-stringify';
import 'ora';
import 'cli-progress';
import { notificationServiceFactory } from '../services/notification.mjs';
import { loadPkg } from '../utils/pkg.mjs';
import { buildLogsServiceFactory } from '../services/build-logs.mjs';
import { promptLogin } from '../login/action.mjs';
import { trackEvent } from '../utils/analytics.mjs';
const boxenOptions = {
padding: 1,
margin: 1,
align: 'center',
borderColor: 'yellow',
borderStyle: 'round'
};
const QUIT_OPTION = 'Quit';
async function promptForEnvironment(environments) {
const choices = environments.map((env)=>({
name: env,
value: env
}));
const { selectedEnvironment } = await inquirer.prompt([
{
type: 'list',
name: 'selectedEnvironment',
message: 'Select the environment to deploy:',
choices: [
...choices,
{
name: chalk.grey(`(${QUIT_OPTION})`),
value: null
}
]
}
]);
if (selectedEnvironment === null) {
process.exit(1);
}
return selectedEnvironment;
}
async function upload(ctx, project, token, maxProjectFileSize) {
const cloudApi = await cloudApiFactory(ctx, token);
try {
const storagePath = await getTmpStoragePath();
const projectFolder = path__default.resolve(process.cwd());
const packageJson = await loadPkg(ctx);
if (!packageJson) {
ctx.logger.error('Unable to deploy the project. Please make sure the package.json file is correctly formatted.');
return;
}
ctx.logger.log('📦 Compressing project...');
// hash packageJson.name to avoid conflicts
const hashname = crypto.createHash('sha512').update(packageJson.name).digest('hex');
const compressedFilename = `${hashname}.tar.gz`;
try {
ctx.logger.debug('Compression parameters\n', `Storage path: ${storagePath}\n`, `Project folder: ${projectFolder}\n`, `Compressed filename: ${compressedFilename}`);
await compressFilesToTar(storagePath, projectFolder, compressedFilename);
ctx.logger.log('📦 Project compressed successfully!');
} catch (e) {
ctx.logger.error('⚠️ Project compression failed. Try again later or check for large/incompatible files.');
ctx.logger.debug(e);
process.exit(1);
}
const tarFilePath = path__default.resolve(storagePath, compressedFilename);
const fileStats = await fse__default.stat(tarFilePath);
if (fileStats.size > maxProjectFileSize) {
ctx.logger.log('Unable to proceed: Your project is too big to be transferred, please use a git repo instead.');
try {
await fse__default.remove(tarFilePath);
} catch (e) {
ctx.logger.log('Unable to remove file: ', tarFilePath);
ctx.logger.debug(e);
}
return;
}
ctx.logger.info('🚀 Uploading project...');
const progressBar = ctx.logger.progressBar(100, 'Upload Progress');
try {
const { data } = await cloudApi.deploy({
filePath: tarFilePath,
project
}, {
onUploadProgress (progressEvent) {
const total = progressEvent.total || fileStats.size;
const percentage = Math.round(progressEvent.loaded * 100 / total);
progressBar.update(percentage);
}
});
progressBar.update(100);
progressBar.stop();
ctx.logger.success('✨ Upload finished!');
return data.build_id;
} catch (e) {
progressBar.stop();
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
ctx.logger.debug(e);
} finally{
await fse__default.remove(tarFilePath);
}
process.exit(0);
} catch (e) {
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
ctx.logger.debug(e);
process.exit(1);
}
}
async function getProject(ctx) {
const { project } = await retrieve();
if (!project) {
try {
return await action$1(ctx);
} catch (e) {
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
ctx.logger.debug(e);
process.exit(1);
}
}
return project;
}
async function getConfig({ ctx, cloudApiService }) {
try {
const { data: cliConfig } = await cloudApiService.config();
return cliConfig;
} catch (e) {
ctx.logger.debug('Failed to get cli config', e);
return null;
}
}
function validateEnvironment(ctx, environment, environments) {
if (!environments.includes(environment)) {
ctx.logger.error(`Environment ${environment} does not exist.`);
process.exit(1);
}
}
async function getTargetEnvironment(ctx, opts, project, environments) {
if (opts.env) {
validateEnvironment(ctx, opts.env, environments);
return opts.env;
}
if (project.targetEnvironment) {
return project.targetEnvironment;
}
if (environments.length > 1) {
return promptForEnvironment(environments);
}
return environments[0];
}
function hasPendingOrLiveDeployment(environments, targetEnvironment) {
const environment = environments.find((env)=>env.name === targetEnvironment);
if (!environment) {
throw new Error(`Environment details ${targetEnvironment} not found.`);
}
return environment.hasPendingDeployment || environment.hasLiveDeployment || false;
}
var action = (async (ctx, opts)=>{
const { getValidToken } = await tokenServiceFactory(ctx);
const token = await getValidToken(ctx, promptLogin);
if (!token) {
return;
}
const project = await getProject(ctx);
if (!project) {
return;
}
const cloudApiService = await cloudApiFactory(ctx, token);
let projectData;
let environments;
let environmentsDetails;
try {
const { data: { data, metadata } } = await cloudApiService.getProject({
name: project.name
});
projectData = data;
environments = projectData.environments;
environmentsDetails = projectData.environmentsDetails;
const isProjectSuspended = projectData.suspendedAt;
if (isProjectSuspended) {
ctx.logger.log('\n Oops! This project has been suspended. \n\n Please reactivate it from the dashboard to continue deploying: ');
ctx.logger.log(chalk.underline(`${metadata.dashboardUrls.project}`));
return;
}
} catch (e) {
if (e instanceof AxiosError && e.response?.data) {
if (e.response.status === 404) {
ctx.logger.warn(`The project associated with this folder does not exist in Strapi Cloud. \nPlease link your local project to an existing Strapi Cloud project using the ${chalk.cyan('link')} command before deploying.`);
} else {
ctx.logger.error(e.response.data);
}
} else {
ctx.logger.error("An error occurred while retrieving the project's information. Please try again later.");
}
ctx.logger.debug(e);
return;
}
await trackEvent(ctx, cloudApiService, 'willDeployWithCLI', {
projectInternalName: project.name
});
const notificationService = notificationServiceFactory(ctx);
const buildLogsService = buildLogsServiceFactory(ctx);
const cliConfig = await getConfig({
ctx,
cloudApiService
});
if (!cliConfig) {
ctx.logger.error('An error occurred while retrieving data from Strapi Cloud. Please check your network or try again later.');
return;
}
let maxSize = parseInt(cliConfig.maxProjectFileSize, 10);
if (Number.isNaN(maxSize)) {
ctx.logger.debug('An error occurred while parsing the maxProjectFileSize. Using default value.');
maxSize = 100000000;
}
project.targetEnvironment = await getTargetEnvironment(ctx, opts, project, environments);
if (!opts.force) {
const shouldDisplayWarning = hasPendingOrLiveDeployment(environmentsDetails, project.targetEnvironment);
if (shouldDisplayWarning) {
ctx.logger.log(boxen(cliConfig.projectDeployment.confirmationText, boxenOptions));
const { confirm } = await inquirer.prompt([
{
type: 'confirm',
name: 'confirm',
message: `Do you want to proceed with deployment to ${chalk.cyan(projectData.displayName)} on ${chalk.cyan(project.targetEnvironment)} environment?`
}
]);
if (!confirm) {
process.exit(1);
}
}
}
const buildId = await upload(ctx, project, token, maxSize);
if (!buildId) {
return;
}
try {
ctx.logger.log(`🚀 Deploying project to ${chalk.cyan(project.targetEnvironment ?? `production`)} environment...`);
notificationService(`${apiConfig.apiBaseUrl}/notifications`, token, cliConfig);
await buildLogsService(`${apiConfig.apiBaseUrl}/v1/logs/${buildId}`, token, cliConfig);
ctx.logger.log('Visit the following URL for deployment logs. Your deployment will be available here shortly.');
ctx.logger.log(chalk.underline(`${apiConfig.dashboardBaseUrl}/projects/${project.name}/deployments`));
} catch (e) {
ctx.logger.debug(e);
if (e instanceof Error) {
ctx.logger.error(e.message);
} else {
ctx.logger.error('An error occurred while deploying the project. Please try again later.');
}
}
});
export { action as default };
//# sourceMappingURL=action.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
import { type StrapiCloudCommand } from '../types';
/**
* `$ deploy project to the cloud`
*/
declare const command: StrapiCloudCommand;
export default command;
//# sourceMappingURL=command.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/deploy-project/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD;;GAEG;AACH,QAAA,MAAM,OAAO,EAAE,kBASd,CAAC;AAEF,eAAe,OAAO,CAAC"}

View File

@@ -0,0 +1,14 @@
'use strict';
var commander = require('commander');
var helpers = require('../utils/helpers.js');
var action = require('./action.js');
/**
* `$ deploy project to the cloud`
*/ const command = ({ ctx })=>{
return commander.createCommand('cloud:deploy').alias('deploy').description('Deploy a Strapi Cloud project').option('-d, --debug', 'Enable debugging mode with verbose logs').option('-s, --silent', "Don't log anything").option('-f, --force', 'Skip confirmation to deploy').option('-e, --env <name>', 'Specify the environment to deploy').action((opts)=>helpers.runAction('deploy', action)(ctx, opts));
};
module.exports = command;
//# sourceMappingURL=command.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.js","sources":["../../src/deploy-project/command.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { type StrapiCloudCommand } from '../types';\nimport { runAction } from '../utils/helpers';\nimport action from './action';\n\n/**\n * `$ deploy project to the cloud`\n */\nconst command: StrapiCloudCommand = ({ ctx }) => {\n return createCommand('cloud:deploy')\n .alias('deploy')\n .description('Deploy a Strapi Cloud project')\n .option('-d, --debug', 'Enable debugging mode with verbose logs')\n .option('-s, --silent', \"Don't log anything\")\n .option('-f, --force', 'Skip confirmation to deploy')\n .option('-e, --env <name>', 'Specify the environment to deploy')\n .action((opts) => runAction('deploy', action)(ctx, opts));\n};\n\nexport default command;\n"],"names":["command","ctx","createCommand","alias","description","option","action","opts","runAction"],"mappings":";;;;;;AAKA;;AAEC,IACKA,MAAAA,OAAAA,GAA8B,CAAC,EAAEC,GAAG,EAAE,GAAA;AAC1C,IAAA,OAAOC,uBAAc,CAAA,cAAA,CAAA,CAClBC,KAAK,CAAC,QACNC,CAAAA,CAAAA,WAAW,CAAC,+BAAA,CAAA,CACZC,MAAM,CAAC,aAAe,EAAA,yCAAA,CAAA,CACtBA,MAAM,CAAC,cAAA,EAAgB,oBACvBA,CAAAA,CAAAA,MAAM,CAAC,aAAA,EAAe,6BACtBA,CAAAA,CAAAA,MAAM,CAAC,kBAAoB,EAAA,mCAAA,CAAA,CAC3BC,MAAM,CAAC,CAACC,IAAAA,GAASC,iBAAU,CAAA,QAAA,EAAUF,QAAQL,GAAKM,EAAAA,IAAAA,CAAAA,CAAAA;AACvD;;;;"}

View File

@@ -0,0 +1,12 @@
import { createCommand } from 'commander';
import { runAction } from '../utils/helpers.mjs';
import action from './action.mjs';
/**
* `$ deploy project to the cloud`
*/ const command = ({ ctx })=>{
return createCommand('cloud:deploy').alias('deploy').description('Deploy a Strapi Cloud project').option('-d, --debug', 'Enable debugging mode with verbose logs').option('-s, --silent', "Don't log anything").option('-f, --force', 'Skip confirmation to deploy').option('-e, --env <name>', 'Specify the environment to deploy').action((opts)=>runAction('deploy', action)(ctx, opts));
};
export { command as default };
//# sourceMappingURL=command.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.mjs","sources":["../../src/deploy-project/command.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { type StrapiCloudCommand } from '../types';\nimport { runAction } from '../utils/helpers';\nimport action from './action';\n\n/**\n * `$ deploy project to the cloud`\n */\nconst command: StrapiCloudCommand = ({ ctx }) => {\n return createCommand('cloud:deploy')\n .alias('deploy')\n .description('Deploy a Strapi Cloud project')\n .option('-d, --debug', 'Enable debugging mode with verbose logs')\n .option('-s, --silent', \"Don't log anything\")\n .option('-f, --force', 'Skip confirmation to deploy')\n .option('-e, --env <name>', 'Specify the environment to deploy')\n .action((opts) => runAction('deploy', action)(ctx, opts));\n};\n\nexport default command;\n"],"names":["command","ctx","createCommand","alias","description","option","action","opts","runAction"],"mappings":";;;;AAKA;;AAEC,IACKA,MAAAA,OAAAA,GAA8B,CAAC,EAAEC,GAAG,EAAE,GAAA;AAC1C,IAAA,OAAOC,aAAc,CAAA,cAAA,CAAA,CAClBC,KAAK,CAAC,QACNC,CAAAA,CAAAA,WAAW,CAAC,+BAAA,CAAA,CACZC,MAAM,CAAC,aAAe,EAAA,yCAAA,CAAA,CACtBA,MAAM,CAAC,cAAA,EAAgB,oBACvBA,CAAAA,CAAAA,MAAM,CAAC,aAAA,EAAe,6BACtBA,CAAAA,CAAAA,MAAM,CAAC,kBAAoB,EAAA,mCAAA,CAAA,CAC3BC,MAAM,CAAC,CAACC,IAAAA,GAASC,SAAU,CAAA,QAAA,EAAUF,QAAQL,GAAKM,EAAAA,IAAAA,CAAAA,CAAAA;AACvD;;;;"}

View File

@@ -0,0 +1,7 @@
import action from './action';
import command from './command';
import type { StrapiCloudCommandInfo } from '../types';
export { action, command };
declare const _default: StrapiCloudCommandInfo;
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deploy-project/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;AAE3B,wBAK4B"}

View File

@@ -0,0 +1,18 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var action = require('./action.js');
var command = require('./command.js');
var deployProject = {
name: 'deploy-project',
description: 'Deploy a Strapi Cloud project',
action,
command
};
exports.action = action;
exports.command = command;
exports.default = deployProject;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../src/deploy-project/index.ts"],"sourcesContent":["import action from './action';\nimport command from './command';\nimport type { StrapiCloudCommandInfo } from '../types';\n\nexport { action, command };\n\nexport default {\n name: 'deploy-project',\n description: 'Deploy a Strapi Cloud project',\n action,\n command,\n} as StrapiCloudCommandInfo;\n"],"names":["name","description","action","command"],"mappings":";;;;;;;AAMA,oBAAe;IACbA,IAAM,EAAA,gBAAA;IACNC,WAAa,EAAA,+BAAA;AACbC,IAAAA,MAAAA;AACAC,IAAAA;AACF,CAA4B;;;;;;"}

View File

@@ -0,0 +1,12 @@
import action from './action.mjs';
import command from './command.mjs';
var deployProject = {
name: 'deploy-project',
description: 'Deploy a Strapi Cloud project',
action,
command
};
export { action, command, deployProject as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../src/deploy-project/index.ts"],"sourcesContent":["import action from './action';\nimport command from './command';\nimport type { StrapiCloudCommandInfo } from '../types';\n\nexport { action, command };\n\nexport default {\n name: 'deploy-project',\n description: 'Deploy a Strapi Cloud project',\n action,\n command,\n} as StrapiCloudCommandInfo;\n"],"names":["name","description","action","command"],"mappings":";;;AAMA,oBAAe;IACbA,IAAM,EAAA,gBAAA;IACNC,WAAa,EAAA,+BAAA;AACbC,IAAAA,MAAAA;AACAC,IAAAA;AACF,CAA4B;;;;"}

View File

@@ -0,0 +1,3 @@
import { Command } from 'commander';
export declare const initializeEnvironmentCommand: (command: Command, ctx: unknown) => Command;
//# sourceMappingURL=command.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/environment/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,4BAA4B,YAAa,OAAO,OAAO,OAAO,KAAG,OAM7E,CAAC"}

View File

@@ -0,0 +1,15 @@
'use strict';
var command = require('../cloud/command.js');
let environmentCmd = null;
const initializeEnvironmentCommand = (command$1, ctx)=>{
if (!environmentCmd) {
const cloud = command.defineCloudNamespace(command$1, ctx);
environmentCmd = cloud.command('environment').description('Manage environments');
}
return environmentCmd;
};
exports.initializeEnvironmentCommand = initializeEnvironmentCommand;
//# sourceMappingURL=command.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.js","sources":["../../src/environment/command.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { defineCloudNamespace } from '../cloud/command';\n\nlet environmentCmd: Command | null = null;\n\nexport const initializeEnvironmentCommand = (command: Command, ctx: unknown): Command => {\n if (!environmentCmd) {\n const cloud = defineCloudNamespace(command, ctx);\n environmentCmd = cloud.command('environment').description('Manage environments');\n }\n return environmentCmd;\n};\n"],"names":["environmentCmd","initializeEnvironmentCommand","command","ctx","cloud","defineCloudNamespace","description"],"mappings":";;;;AAGA,IAAIA,cAAiC,GAAA,IAAA;AAE9B,MAAMC,4BAA+B,GAAA,CAACC,SAAkBC,EAAAA,GAAAA,GAAAA;AAC7D,IAAA,IAAI,CAACH,cAAgB,EAAA;QACnB,MAAMI,KAAAA,GAAQC,6BAAqBH,SAASC,EAAAA,GAAAA,CAAAA;AAC5CH,QAAAA,cAAAA,GAAiBI,KAAMF,CAAAA,OAAO,CAAC,aAAA,CAAA,CAAeI,WAAW,CAAC,qBAAA,CAAA;AAC5D;IACA,OAAON,cAAAA;AACT;;;;"}

View File

@@ -0,0 +1,13 @@
import { defineCloudNamespace } from '../cloud/command.mjs';
let environmentCmd = null;
const initializeEnvironmentCommand = (command, ctx)=>{
if (!environmentCmd) {
const cloud = defineCloudNamespace(command, ctx);
environmentCmd = cloud.command('environment').description('Manage environments');
}
return environmentCmd;
};
export { initializeEnvironmentCommand };
//# sourceMappingURL=command.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.mjs","sources":["../../src/environment/command.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { defineCloudNamespace } from '../cloud/command';\n\nlet environmentCmd: Command | null = null;\n\nexport const initializeEnvironmentCommand = (command: Command, ctx: unknown): Command => {\n if (!environmentCmd) {\n const cloud = defineCloudNamespace(command, ctx);\n environmentCmd = cloud.command('environment').description('Manage environments');\n }\n return environmentCmd;\n};\n"],"names":["environmentCmd","initializeEnvironmentCommand","command","ctx","cloud","defineCloudNamespace","description"],"mappings":";;AAGA,IAAIA,cAAiC,GAAA,IAAA;AAE9B,MAAMC,4BAA+B,GAAA,CAACC,OAAkBC,EAAAA,GAAAA,GAAAA;AAC7D,IAAA,IAAI,CAACH,cAAgB,EAAA;QACnB,MAAMI,KAAAA,GAAQC,qBAAqBH,OAASC,EAAAA,GAAAA,CAAAA;AAC5CH,QAAAA,cAAAA,GAAiBI,KAAMF,CAAAA,OAAO,CAAC,aAAA,CAAA,CAAeI,WAAW,CAAC,qBAAA,CAAA;AAC5D;IACA,OAAON,cAAAA;AACT;;;;"}

View File

@@ -0,0 +1,4 @@
import type { CLIContext } from '../../types';
declare const _default: (ctx: CLIContext) => Promise<void>;
export default _default;
//# sourceMappingURL=action.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/environment/link/action.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;8BAkBpC,UAAU;AAArC,wBA+DE"}

View File

@@ -0,0 +1,117 @@
'use strict';
var chalk = require('chalk');
var inquirer = require('inquirer');
var cliApi = require('../../services/cli-api.js');
var strapiInfoSave = require('../../services/strapi-info-save.js');
var token = require('../../services/token.js');
require('fast-safe-stringify');
require('ora');
require('cli-progress');
var action$1 = require('../../login/action.js');
var analytics = require('../../utils/analytics.js');
var getLocalConfig = require('../../utils/get-local-config.js');
const QUIT_OPTION = 'Quit';
var action = (async (ctx)=>{
const { getValidToken } = await token.tokenServiceFactory(ctx);
const token$1 = await getValidToken(ctx, action$1.promptLogin);
const { logger } = ctx;
if (!token$1) {
return;
}
const project = await getLocalConfig.getLocalProject(ctx);
if (!project) {
logger.debug(`No valid local project configuration was found.`);
return;
}
const cloudApiService = await cliApi.cloudApiFactory(ctx, token$1);
const environments = await getEnvironmentsList(ctx, cloudApiService, project);
if (!environments) {
logger.debug(`Fetching environments failed.`);
return;
}
if (environments.length === 0) {
logger.log(`The only available environment is already linked. You can add a new one from your project settings on the Strapi Cloud dashboard.`);
return;
}
const answer = await promptUserForEnvironment(ctx, environments);
if (!answer) {
return;
}
await analytics.trackEvent(ctx, cloudApiService, 'willLinkEnvironment', {
projectName: project.name,
environmentName: answer.targetEnvironment
});
try {
await strapiInfoSave.patch({
project: {
targetEnvironment: answer.targetEnvironment
}
});
} catch (e) {
await analytics.trackEvent(ctx, cloudApiService, 'didNotLinkEnvironment', {
projectName: project.name,
environmentName: answer.targetEnvironment
});
logger.debug('Failed to link environment', e);
logger.error('Failed to link the environment. If this issue persists, try re-linking your project or contact support.');
process.exit(1);
}
logger.log(` You have successfully linked your project to ${chalk.cyan(answer.targetEnvironment)}, on ${chalk.cyan(project.displayName)}. You are now able to deploy your project.`);
await analytics.trackEvent(ctx, cloudApiService, 'didLinkEnvironment', {
projectName: project.name,
environmentName: answer.targetEnvironment
});
});
async function promptUserForEnvironment(ctx, environments) {
const { logger } = ctx;
try {
const answer = await inquirer.prompt([
{
type: 'list',
name: 'targetEnvironment',
message: 'Which environment do you want to link?',
choices: [
...environments,
{
name: chalk.grey(`(${QUIT_OPTION})`),
value: null
}
]
}
]);
if (!answer.targetEnvironment) {
return null;
}
return answer;
} catch (e) {
logger.debug('Failed to get user input', e);
logger.error('An error occurred while trying to get your environment selection.');
return null;
}
}
async function getEnvironmentsList(ctx, cloudApiService, project) {
const spinner = ctx.logger.spinner('Fetching environments...\n').start();
try {
const { data: { data: environmentsList } } = await cloudApiService.listLinkEnvironments({
name: project.name
});
if (!Array.isArray(environmentsList) || environmentsList.length === 0) {
throw new Error('Environments not found in server response');
}
spinner.succeed();
return environmentsList.filter((environment)=>environment.name !== project.targetEnvironment);
} catch (e) {
if (e.response && e.response.status === 404) {
spinner.succeed();
ctx.logger.warn(`\nThe project associated with this folder does not exist in Strapi Cloud. \nPlease link your local project to an existing Strapi Cloud project using the ${chalk.cyan('link')} command.`);
} else {
spinner.fail('An error occurred while fetching environments data from Strapi Cloud.');
ctx.logger.debug('Failed to list environments', e);
}
}
}
module.exports = action;
//# sourceMappingURL=action.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,115 @@
import chalk from 'chalk';
import inquirer from 'inquirer';
import { cloudApiFactory } from '../../services/cli-api.mjs';
import { patch } from '../../services/strapi-info-save.mjs';
import { tokenServiceFactory } from '../../services/token.mjs';
import 'fast-safe-stringify';
import 'ora';
import 'cli-progress';
import { promptLogin } from '../../login/action.mjs';
import { trackEvent } from '../../utils/analytics.mjs';
import { getLocalProject } from '../../utils/get-local-config.mjs';
const QUIT_OPTION = 'Quit';
var action = (async (ctx)=>{
const { getValidToken } = await tokenServiceFactory(ctx);
const token = await getValidToken(ctx, promptLogin);
const { logger } = ctx;
if (!token) {
return;
}
const project = await getLocalProject(ctx);
if (!project) {
logger.debug(`No valid local project configuration was found.`);
return;
}
const cloudApiService = await cloudApiFactory(ctx, token);
const environments = await getEnvironmentsList(ctx, cloudApiService, project);
if (!environments) {
logger.debug(`Fetching environments failed.`);
return;
}
if (environments.length === 0) {
logger.log(`The only available environment is already linked. You can add a new one from your project settings on the Strapi Cloud dashboard.`);
return;
}
const answer = await promptUserForEnvironment(ctx, environments);
if (!answer) {
return;
}
await trackEvent(ctx, cloudApiService, 'willLinkEnvironment', {
projectName: project.name,
environmentName: answer.targetEnvironment
});
try {
await patch({
project: {
targetEnvironment: answer.targetEnvironment
}
});
} catch (e) {
await trackEvent(ctx, cloudApiService, 'didNotLinkEnvironment', {
projectName: project.name,
environmentName: answer.targetEnvironment
});
logger.debug('Failed to link environment', e);
logger.error('Failed to link the environment. If this issue persists, try re-linking your project or contact support.');
process.exit(1);
}
logger.log(` You have successfully linked your project to ${chalk.cyan(answer.targetEnvironment)}, on ${chalk.cyan(project.displayName)}. You are now able to deploy your project.`);
await trackEvent(ctx, cloudApiService, 'didLinkEnvironment', {
projectName: project.name,
environmentName: answer.targetEnvironment
});
});
async function promptUserForEnvironment(ctx, environments) {
const { logger } = ctx;
try {
const answer = await inquirer.prompt([
{
type: 'list',
name: 'targetEnvironment',
message: 'Which environment do you want to link?',
choices: [
...environments,
{
name: chalk.grey(`(${QUIT_OPTION})`),
value: null
}
]
}
]);
if (!answer.targetEnvironment) {
return null;
}
return answer;
} catch (e) {
logger.debug('Failed to get user input', e);
logger.error('An error occurred while trying to get your environment selection.');
return null;
}
}
async function getEnvironmentsList(ctx, cloudApiService, project) {
const spinner = ctx.logger.spinner('Fetching environments...\n').start();
try {
const { data: { data: environmentsList } } = await cloudApiService.listLinkEnvironments({
name: project.name
});
if (!Array.isArray(environmentsList) || environmentsList.length === 0) {
throw new Error('Environments not found in server response');
}
spinner.succeed();
return environmentsList.filter((environment)=>environment.name !== project.targetEnvironment);
} catch (e) {
if (e.response && e.response.status === 404) {
spinner.succeed();
ctx.logger.warn(`\nThe project associated with this folder does not exist in Strapi Cloud. \nPlease link your local project to an existing Strapi Cloud project using the ${chalk.cyan('link')} command.`);
} else {
spinner.fail('An error occurred while fetching environments data from Strapi Cloud.');
ctx.logger.debug('Failed to list environments', e);
}
}
}
export { action as default };
//# sourceMappingURL=action.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import { type StrapiCloudCommand } from '../../types';
declare const command: StrapiCloudCommand;
export default command;
//# sourceMappingURL=command.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/environment/link/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKtD,QAAA,MAAM,OAAO,EAAE,kBASd,CAAC;AAEF,eAAe,OAAO,CAAC"}

View File

@@ -0,0 +1,13 @@
'use strict';
var helpers = require('../../utils/helpers.js');
var action = require('./action.js');
var command$1 = require('../command.js');
const command = ({ command, ctx })=>{
const environmentCmd = command$1.initializeEnvironmentCommand(command, ctx);
environmentCmd.command('link').description('Link project to a specific Strapi Cloud project environment').option('-d, --debug', 'Enable debugging mode with verbose logs').option('-s, --silent', "Don't log anything").action(()=>helpers.runAction('link', action)(ctx));
};
module.exports = command;
//# sourceMappingURL=command.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.js","sources":["../../../src/environment/link/command.ts"],"sourcesContent":["import { type StrapiCloudCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\nimport action from './action';\nimport { initializeEnvironmentCommand } from '../command';\n\nconst command: StrapiCloudCommand = ({ command, ctx }) => {\n const environmentCmd = initializeEnvironmentCommand(command, ctx);\n\n environmentCmd\n .command('link')\n .description('Link project to a specific Strapi Cloud project environment')\n .option('-d, --debug', 'Enable debugging mode with verbose logs')\n .option('-s, --silent', \"Don't log anything\")\n .action(() => runAction('link', action)(ctx));\n};\n\nexport default command;\n"],"names":["command","ctx","environmentCmd","initializeEnvironmentCommand","description","option","action","runAction"],"mappings":";;;;;;AAKA,MAAMA,UAA8B,CAAC,EAAEA,OAAO,EAAEC,GAAG,EAAE,GAAA;IACnD,MAAMC,cAAAA,GAAiBC,uCAA6BH,OAASC,EAAAA,GAAAA,CAAAA;AAE7DC,IAAAA,cAAAA,CACGF,OAAO,CAAC,MAAA,CAAA,CACRI,WAAW,CAAC,6DAAA,CAAA,CACZC,MAAM,CAAC,aAAA,EAAe,2CACtBA,MAAM,CAAC,gBAAgB,oBACvBC,CAAAA,CAAAA,MAAM,CAAC,IAAMC,iBAAAA,CAAU,QAAQD,MAAQL,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA;AAC5C;;;;"}

View File

@@ -0,0 +1,11 @@
import { runAction } from '../../utils/helpers.mjs';
import action from './action.mjs';
import { initializeEnvironmentCommand } from '../command.mjs';
const command = ({ command, ctx })=>{
const environmentCmd = initializeEnvironmentCommand(command, ctx);
environmentCmd.command('link').description('Link project to a specific Strapi Cloud project environment').option('-d, --debug', 'Enable debugging mode with verbose logs').option('-s, --silent', "Don't log anything").action(()=>runAction('link', action)(ctx));
};
export { command as default };
//# sourceMappingURL=command.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"command.mjs","sources":["../../../src/environment/link/command.ts"],"sourcesContent":["import { type StrapiCloudCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\nimport action from './action';\nimport { initializeEnvironmentCommand } from '../command';\n\nconst command: StrapiCloudCommand = ({ command, ctx }) => {\n const environmentCmd = initializeEnvironmentCommand(command, ctx);\n\n environmentCmd\n .command('link')\n .description('Link project to a specific Strapi Cloud project environment')\n .option('-d, --debug', 'Enable debugging mode with verbose logs')\n .option('-s, --silent', \"Don't log anything\")\n .action(() => runAction('link', action)(ctx));\n};\n\nexport default command;\n"],"names":["command","ctx","environmentCmd","initializeEnvironmentCommand","description","option","action","runAction"],"mappings":";;;;AAKA,MAAMA,UAA8B,CAAC,EAAEA,OAAO,EAAEC,GAAG,EAAE,GAAA;IACnD,MAAMC,cAAAA,GAAiBC,6BAA6BH,OAASC,EAAAA,GAAAA,CAAAA;AAE7DC,IAAAA,cAAAA,CACGF,OAAO,CAAC,MAAA,CAAA,CACRI,WAAW,CAAC,6DAAA,CAAA,CACZC,MAAM,CAAC,aAAA,EAAe,2CACtBA,MAAM,CAAC,gBAAgB,oBACvBC,CAAAA,CAAAA,MAAM,CAAC,IAAMC,SAAAA,CAAU,QAAQD,MAAQL,CAAAA,CAAAA,GAAAA,CAAAA,CAAAA;AAC5C;;;;"}

View File

@@ -0,0 +1,7 @@
import action from './action';
import command from './command';
import type { StrapiCloudCommandInfo } from '../../types';
export { action, command };
declare const _default: StrapiCloudCommandInfo;
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/environment/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;AAE3B,wBAK4B"}

View File

@@ -0,0 +1,18 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var action = require('./action.js');
var command = require('./command.js');
var linkEnvironment = {
name: 'link-environment',
description: 'Link Strapi Cloud environment to a local project',
action,
command
};
exports.action = action;
exports.command = command;
exports.default = linkEnvironment;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../src/environment/link/index.ts"],"sourcesContent":["import action from './action';\nimport command from './command';\nimport type { StrapiCloudCommandInfo } from '../../types';\n\nexport { action, command };\n\nexport default {\n name: 'link-environment',\n description: 'Link Strapi Cloud environment to a local project',\n action,\n command,\n} as StrapiCloudCommandInfo;\n"],"names":["name","description","action","command"],"mappings":";;;;;;;AAMA,sBAAe;IACbA,IAAM,EAAA,kBAAA;IACNC,WAAa,EAAA,kDAAA;AACbC,IAAAA,MAAAA;AACAC,IAAAA;AACF,CAA4B;;;;;;"}

View File

@@ -0,0 +1,12 @@
import action from './action.mjs';
import command from './command.mjs';
var linkEnvironment = {
name: 'link-environment',
description: 'Link Strapi Cloud environment to a local project',
action,
command
};
export { action, command, linkEnvironment as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../src/environment/link/index.ts"],"sourcesContent":["import action from './action';\nimport command from './command';\nimport type { StrapiCloudCommandInfo } from '../../types';\n\nexport { action, command };\n\nexport default {\n name: 'link-environment',\n description: 'Link Strapi Cloud environment to a local project',\n action,\n command,\n} as StrapiCloudCommandInfo;\n"],"names":["name","description","action","command"],"mappings":";;;AAMA,sBAAe;IACbA,IAAM,EAAA,kBAAA;IACNC,WAAa,EAAA,kDAAA;AACbC,IAAAA,MAAAA;AACAC,IAAAA;AACF,CAA4B;;;;"}

View File

@@ -0,0 +1,4 @@
import type { CLIContext } from '../../types';
declare const _default: (ctx: CLIContext) => Promise<void>;
export default _default;
//# sourceMappingURL=action.d.ts.map

Some files were not shown because too many files have changed in this diff Show More