@supernovaio/cli 2.0.27 → 2.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/template-upload.d.ts.map +1 -1
- package/dist/commands/template-upload.js +4 -4
- package/dist/commands/template-upload.js.map +1 -1
- package/dist/services/user.service.d.ts +1 -1
- package/dist/services/user.service.d.ts.map +1 -1
- package/dist/utils/sdk.d.ts.map +1 -1
- package/dist/utils/sdk.js +6 -4
- package/dist/utils/sdk.js.map +1 -1
- package/oclif.manifest.json +3 -3
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-upload.d.ts","sourceRoot":"","sources":["../../src/commands/template-upload.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAGhC,OAAO,EAAe,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAQ9D,QAAA,MAAM,oBAAoB,gDAAe,CAAA;AAEzC,KAAK,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"template-upload.d.ts","sourceRoot":"","sources":["../../src/commands/template-upload.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAGhC,OAAO,EAAe,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAQ9D,QAAA,MAAM,oBAAoB,gDAAe,CAAA;AAEzC,KAAK,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAsBhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAAa,CAAC,oBAAoB,CAAC;IAC7E,OAAgB,IAAI,KAAK;IACzB,OAAgB,WAAW,SAAqD;IAChF,OAAgB,QAAQ,WAA0D;IAClF,OAAgB,MAAM,EAAE,OAAO,CAAQ;IACvC,OAAgB,KAAK;;;;;MAmBpB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAEhD;IAGY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAsDnB,oBAAoB;IAMlC,OAAO,CAAC,cAAc;YAIR,cAAc;YAId,kBAAkB;YAclB,gBAAgB;YAyBhB,eAAe;YAkBf,mBAAmB;CAyBlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c9729bc9-3c4b-5c58-92b2-ffe5959f9549")}catch(e){}}();
|
|
3
3
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
4
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
5
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -46,9 +46,9 @@ RUN node docker-scripts/extract-private-packages.js
|
|
|
46
46
|
`;
|
|
47
47
|
export default class TemplateUpload extends SentryCommand {
|
|
48
48
|
static args = {};
|
|
49
|
-
static description = "Upload
|
|
49
|
+
static description = "Upload component container template to Supernova";
|
|
50
50
|
static examples = ["<%= config.bin %> <%= command.id %> TemplateUpload "];
|
|
51
|
-
static hidden =
|
|
51
|
+
static hidden = false;
|
|
52
52
|
static flags = {
|
|
53
53
|
...commonFlags,
|
|
54
54
|
workspaceId: Flags.string({ char: "w", description: "Workspace ID to upload the template to", required: true }),
|
|
@@ -225,4 +225,4 @@ function imageUrl(build) {
|
|
|
225
225
|
return `${build.dockerRegistryDomain}${build.build.dockerImagePath}`;
|
|
226
226
|
}
|
|
227
227
|
//# sourceMappingURL=template-upload.js.map
|
|
228
|
-
//# debugId=
|
|
228
|
+
//# debugId=c9729bc9-3c4b-5c58-92b2-ffe5959f9549
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-upload.js","sources":["../../src/commands/template-upload.ts"],"sourceRoot":"","sourcesContent":["import fetch from \"node-fetch\"\nimport { Flags } from \"@oclif/core\"\nimport { action } from \"@oclif/core/ux\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { exec as execCallback } from \"node:child_process\"\nimport * as fs from \"node:fs/promises\"\nimport path from \"node:path\"\nimport { promisify } from \"node:util\"\nimport { z, ZodType } from \"zod\"\nimport fsx from \"fs-extra\"\n\nimport { commonFlags, SentryCommand } from \"../types/index.js\"\n\nimport { DTOSandboxTemplateBuildCreateResponse, SupernovaApiClient } from \"@supernova-studio/client\"\nimport { sleep } from \"../utils/common.js\"\nimport { tmpdir } from \"node:os\"\n\nconst exec = promisify(execCallback)\n\nconst TemplateUploadConfig = z.object({})\n\ntype TemplateUploadConfig = z.infer<typeof TemplateUploadConfig>\n\nasync function fileExists(p: string) {\n try {\n await fs.access(p)\n return true\n } catch {\n return false\n }\n}\n\nconst dockerfileTemplate = `\nFROM node:22-slim\n\nRUN apt-get update && apt-get install -y curl && apt-get clean && rm -rf /var/lib/apt/lists/*\n\nWORKDIR /home/user\n\nCOPY . .\nRUN {{ npmTokenSecretMount }} npm i && rm -f .npmrc\nRUN node docker-scripts/extract-private-packages.js\n`\n\nexport default class TemplateUpload extends SentryCommand<TemplateUploadConfig> {\n static override args = {}\n static override description = \"Upload custom prototype app sandbox template\"\n static override examples = [\"<%= config.bin %> <%= command.id %> TemplateUpload \"]\n static override hidden: boolean = true\n static override flags = {\n ...commonFlags,\n workspaceId: Flags.string({ char: \"w\", description: \"Workspace ID to upload the template to\", required: true }),\n designSystemId: Flags.string({\n char: \"d\",\n description: \"Design system ID to upload the template to\",\n required: true,\n }),\n force: Flags.boolean({\n char: \"f\",\n description:\n \"Allows overwriting already published version of this template if it exists. This flag has no effect on new versions.\",\n required: false,\n }),\n npmToken: Flags.string({\n description:\n \"Allows passing NPM token as a Docker secret. The token will be available as a NPM_TOKEN env variable\",\n required: false,\n }),\n }\n\n get commandId(): string {\n return TemplateUpload.id\n }\n\n get configSchema(): ZodType<TemplateUploadConfig> {\n return TemplateUploadConfig\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const apiClient = await this.apiClient()\n const { flags } = await this.parse()\n\n // Read package json\n let pkg\n try {\n pkg = await readPackageJson()\n } catch (error) {\n if (error instanceof Error) this.error(`Failed to read or parse package.json: ${error.message}`)\n else throw error\n }\n\n if (pkg.supernova?.privateDependencies) {\n this.log(`Following packages will be linked as private dependencies: ${pkg.supernova.privateDependencies}`)\n\n if (!(await fileExists(path.join(process.cwd(), \".npmrc\")))) {\n this.error(\n `CLI needs private NPM registry access to be able to bundle private dependencies.\\n` +\n `Please provide .npmrc file in the root directory and include neccessary access tokens.`,\n )\n }\n } else {\n this.warn(`package.json doesn't contain 'supernova.privateDependencies' declaration.`)\n this.warn(`Dependencies coming from private registries will fail`)\n }\n\n // Request build\n const buildData = await apiClient.sandboxes.builds.start({\n workspaceId: flags.workspaceId,\n designSystemId: flags.designSystemId,\n name: pkg.name,\n version: pkg.version,\n isExistingVersionUpdateAllowed: flags.force ?? false,\n })\n\n // Build image\n const url = imageUrl(buildData)\n\n await this.validateDockerDaemon()\n const buildDir = await this.createBuildDir()\n\n try {\n await this.prepareBuildFolder(buildDir)\n await this.buildDockerImage(buildDir, url, flags.npmToken)\n await this.pushDockerImage(buildDir, buildData.dockerRegistryDomain, url)\n await this.remoteTemplateBuild(apiClient, buildData.build.id)\n\n this.log(`✅ Template has been successfully uploaded`)\n } finally {\n await this.deleteBuildDir(buildDir)\n }\n }\n\n private async validateDockerDaemon() {\n await exec(\"docker info\").catch(() => {\n this.error(`Docker is not available, please start docker daemon and try again`)\n })\n }\n\n private createBuildDir(): Promise<string> {\n return fs.mkdtemp(path.join(tmpdir(), \"supernova-template-bundle-\"))\n }\n\n private async deleteBuildDir(buildDir: string) {\n await fs.rm(buildDir, { recursive: true, force: true })\n }\n\n private async prepareBuildFolder(buildDir: string) {\n // Move working directory to temp folder from where it will be built\n await fsx.copy(process.cwd(), buildDir, {\n filter(src) {\n return !src.includes(\"node_modules/\") && !src.includes(\".git/\") && !src.includes(\".out/\")\n },\n })\n\n // Inject Supernova scripts\n const cliSrcPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), \"..\")\n\n await fsx.copy(path.join(cliSrcPath, \"docker-scripts\"), path.join(buildDir, \"docker-scripts\"))\n }\n\n private async buildDockerImage(buildDir: string, imageUrl: string, npmToken: string | undefined) {\n action.start(\"🔨 Building docker image\")\n\n let cmd = `docker build --progress=plain -t ${imageUrl} --pull --platform linux/amd64`\n if (npmToken) cmd += ` --secret id=NPM_TOKEN`\n cmd += \" -f - .\"\n\n const dockerfile = dockerfileTemplate.replace(\n \"{{ npmTokenSecretMount }}\",\n npmToken ? `--mount=type=secret,id=NPM_TOKEN NPM_TOKEN=\"$(cat /run/secrets/NPM_TOKEN)\"` : \"\",\n )\n\n const subprocess = exec(cmd, {\n env: npmToken ? { ...process.env, NPM_TOKEN: npmToken } : process.env,\n cwd: buildDir,\n })\n\n subprocess.child.stdin!.write(dockerfile)\n subprocess.child.stdin!.end()\n\n await subprocess\n\n action.stop(\"done\")\n }\n\n private async pushDockerImage(buildDir: string, dockerHost: string, imageUrl: string) {\n const response = await fetch(`https://${dockerHost}/v2/`)\n if (response.status === 401) {\n // Requires auth\n const { accessToken } = (await this.apiClient()).config\n const loginProcess = exec(`docker login ${dockerHost} -u cli --password-stdin`)\n loginProcess.child.stdin!.write(accessToken)\n loginProcess.child.stdin!.end()\n await loginProcess\n }\n\n action.start(\"⬆️ Uploading docker image to Supernova\")\n await exec(`docker push ${imageUrl}`, {\n cwd: buildDir,\n })\n action.stop(\"done\")\n }\n\n private async remoteTemplateBuild(client: SupernovaApiClient, buildId: string) {\n action.start(\"📦 Creating template with the image\")\n\n // Trigger remote build phase\n await client.sandboxes.builds.finalize(buildId)\n\n // Poll every 2 seconds for roughly 5 minutes\n const pollIntervalMs = 2000\n const timeoutMs = 5 * 60 * 1000\n\n const startTime = Date.now()\n\n let build\n do {\n await sleep(pollIntervalMs)\n build = (await client.sandboxes.builds.get(buildId)).build\n } while (build.state === \"Building\" && Date.now() - startTime < timeoutMs)\n\n // Verify build state\n if (build.state !== \"Success\") {\n this.error(`Template creation failed`)\n }\n\n action.stop(\"done\")\n }\n}\n\ntype PackageJson = {\n name: string\n version: string\n dependencies: Record<string, string>\n supernova:\n | {\n privateDependencies: string[] | undefined\n }\n | undefined\n}\n\nasync function readPackageJson(): Promise<PackageJson> {\n const pkgPath = path.join(process.cwd(), \"package.json\")\n\n if (!(await fileExists(pkgPath))) throw new Error(`package.json file was not found in the current directory`)\n\n const raw = await fs.readFile(pkgPath, \"utf8\")\n const pkg = JSON.parse(raw)\n\n if (typeof pkg !== \"object\" || pkg === null) throw new Error(`Error parsing package.json: not a json`)\n\n if (typeof pkg.name !== \"string\") throw new Error(`Error parsing package.json: 'name' must be defined`)\n if (typeof pkg.version !== \"string\") throw new Error(`Error parsing package.json: 'version' must be defined`)\n if (typeof pkg.dependencies !== \"object\" || pkg.dependencies === null)\n throw new Error(`Error parsing package.json: 'dependencies' must be defined`)\n\n if (pkg.supernova?.privateDependencies) {\n const privateDependencies = pkg.supernova?.privateDependencies\n if (!Array.isArray(privateDependencies)) throw new TypeError(`supernova.privateDependencies must be an array`)\n\n for (const [i, d] of privateDependencies.entries()) {\n if (typeof d !== \"string\") {\n throw new TypeError(`supernova.privateDependencies[${i}] must be a string`)\n }\n\n if (!pkg.dependencies[d]) {\n throw new Error(`Private dependency ${d} is not listed in 'dependencies'`)\n }\n }\n }\n\n return pkg\n}\n\nfunction imageUrl(build: DTOSandboxTemplateBuildCreateResponse) {\n return `${build.dockerRegistryDomain}${build.build.dockerImagePath}`\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAChC,OAAO,GAAG,MAAM,UAAU,CAAA;AAE1B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;AAEpC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAIzC,KAAK,UAAU,UAAU,CAAC,CAAS;IACjC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG;;;;;;;;;;CAU1B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAAmC;IAC7E,MAAM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A;QAE9G,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC;YACnD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,oBAAoB,CAAC,CAAA;YAC7E,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,kCAAkC,CAAC,CAAA;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAS,QAAQ,CAAC,KAA4C;IAC5D,OAAO,GAAG,KAAK,CAAC,oBAAoB,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,EAAE,CAAA;AACtE,CAAC","debug_id":"f847cf3b-8c21-5dff-b0e5-47770ca3820c"}
|
|
1
|
+
{"version":3,"file":"template-upload.js","sources":["../../src/commands/template-upload.ts"],"sourceRoot":"","sourcesContent":["import fetch from \"node-fetch\"\nimport { Flags } from \"@oclif/core\"\nimport { action } from \"@oclif/core/ux\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { exec as execCallback } from \"node:child_process\"\nimport * as fs from \"node:fs/promises\"\nimport path from \"node:path\"\nimport { promisify } from \"node:util\"\nimport { z, ZodType } from \"zod\"\nimport fsx from \"fs-extra\"\n\nimport { commonFlags, SentryCommand } from \"../types/index.js\"\n\nimport { DTOSandboxTemplateBuildCreateResponse, SupernovaApiClient } from \"@supernova-studio/client\"\nimport { sleep } from \"../utils/common.js\"\nimport { tmpdir } from \"node:os\"\n\nconst exec = promisify(execCallback)\n\nconst TemplateUploadConfig = z.object({})\n\ntype TemplateUploadConfig = z.infer<typeof TemplateUploadConfig>\n\nasync function fileExists(p: string) {\n try {\n await fs.access(p)\n return true\n } catch {\n return false\n }\n}\n\nconst dockerfileTemplate = `\nFROM node:22-slim\n\nRUN apt-get update && apt-get install -y curl && apt-get clean && rm -rf /var/lib/apt/lists/*\n\nWORKDIR /home/user\n\nCOPY . .\nRUN {{ npmTokenSecretMount }} npm i && rm -f .npmrc\nRUN node docker-scripts/extract-private-packages.js\n`\nexport default class TemplateUpload extends SentryCommand<TemplateUploadConfig> {\n static override args = {}\n static override description = \"Upload component container template to Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %> TemplateUpload \"]\n static override hidden: boolean = false\n static override flags = {\n ...commonFlags,\n workspaceId: Flags.string({ char: \"w\", description: \"Workspace ID to upload the template to\", required: true }),\n designSystemId: Flags.string({\n char: \"d\",\n description: \"Design system ID to upload the template to\",\n required: true,\n }),\n force: Flags.boolean({\n char: \"f\",\n description:\n \"Allows overwriting already published version of this template if it exists. This flag has no effect on new versions.\",\n required: false,\n }),\n npmToken: Flags.string({\n description:\n \"Allows passing NPM token as a Docker secret. The token will be available as a NPM_TOKEN env variable\",\n required: false,\n }),\n }\n\n get commandId(): string {\n return TemplateUpload.id\n }\n\n get configSchema(): ZodType<TemplateUploadConfig> {\n return TemplateUploadConfig\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const apiClient = await this.apiClient()\n const { flags } = await this.parse()\n\n // Read package json\n let pkg\n try {\n pkg = await readPackageJson()\n } catch (error) {\n if (error instanceof Error) this.error(`Failed to read or parse package.json: ${error.message}`)\n else throw error\n }\n\n if (pkg.supernova?.privateDependencies) {\n this.log(`Following packages will be linked as private dependencies: ${pkg.supernova.privateDependencies}`)\n\n if (!(await fileExists(path.join(process.cwd(), \".npmrc\")))) {\n this.error(\n `CLI needs private NPM registry access to be able to bundle private dependencies.\\n` +\n `Please provide .npmrc file in the root directory and include neccessary access tokens.`,\n )\n }\n } else {\n this.warn(`package.json doesn't contain 'supernova.privateDependencies' declaration.`)\n this.warn(`Dependencies coming from private registries will fail`)\n }\n\n // Request build\n const buildData = await apiClient.sandboxes.builds.start({\n workspaceId: flags.workspaceId,\n designSystemId: flags.designSystemId,\n name: pkg.name,\n version: pkg.version,\n isExistingVersionUpdateAllowed: flags.force ?? false,\n })\n\n // Build image\n const url = imageUrl(buildData)\n\n await this.validateDockerDaemon()\n const buildDir = await this.createBuildDir()\n\n try {\n await this.prepareBuildFolder(buildDir)\n await this.buildDockerImage(buildDir, url, flags.npmToken)\n await this.pushDockerImage(buildDir, buildData.dockerRegistryDomain, url)\n await this.remoteTemplateBuild(apiClient, buildData.build.id)\n\n this.log(`✅ Template has been successfully uploaded`)\n } finally {\n await this.deleteBuildDir(buildDir)\n }\n }\n\n private async validateDockerDaemon() {\n await exec(\"docker info\").catch(() => {\n this.error(`Docker is not available, please start docker daemon and try again`)\n })\n }\n\n private createBuildDir(): Promise<string> {\n return fs.mkdtemp(path.join(tmpdir(), \"supernova-template-bundle-\"))\n }\n\n private async deleteBuildDir(buildDir: string) {\n await fs.rm(buildDir, { recursive: true, force: true })\n }\n\n private async prepareBuildFolder(buildDir: string) {\n // Move working directory to temp folder from where it will be built\n await fsx.copy(process.cwd(), buildDir, {\n filter(src) {\n return !src.includes(\"node_modules/\") && !src.includes(\".git/\") && !src.includes(\".out/\")\n },\n })\n\n // Inject Supernova scripts\n const cliSrcPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), \"..\")\n\n await fsx.copy(path.join(cliSrcPath, \"docker-scripts\"), path.join(buildDir, \"docker-scripts\"))\n }\n\n private async buildDockerImage(buildDir: string, imageUrl: string, npmToken: string | undefined) {\n action.start(\"🔨 Building docker image\")\n\n let cmd = `docker build --progress=plain -t ${imageUrl} --pull --platform linux/amd64`\n if (npmToken) cmd += ` --secret id=NPM_TOKEN`\n cmd += \" -f - .\"\n\n const dockerfile = dockerfileTemplate.replace(\n \"{{ npmTokenSecretMount }}\",\n npmToken ? `--mount=type=secret,id=NPM_TOKEN NPM_TOKEN=\"$(cat /run/secrets/NPM_TOKEN)\"` : \"\",\n )\n\n const subprocess = exec(cmd, {\n env: npmToken ? { ...process.env, NPM_TOKEN: npmToken } : process.env,\n cwd: buildDir,\n })\n\n subprocess.child.stdin!.write(dockerfile)\n subprocess.child.stdin!.end()\n\n await subprocess\n\n action.stop(\"done\")\n }\n\n private async pushDockerImage(buildDir: string, dockerHost: string, imageUrl: string) {\n const response = await fetch(`https://${dockerHost}/v2/`)\n if (response.status === 401) {\n // Requires auth\n const { accessToken } = (await this.apiClient()).config\n const loginProcess = exec(`docker login ${dockerHost} -u cli --password-stdin`)\n loginProcess.child.stdin!.write(accessToken)\n loginProcess.child.stdin!.end()\n await loginProcess\n }\n\n action.start(\"⬆️ Uploading docker image to Supernova\")\n await exec(`docker push ${imageUrl}`, {\n cwd: buildDir,\n })\n action.stop(\"done\")\n }\n\n private async remoteTemplateBuild(client: SupernovaApiClient, buildId: string) {\n action.start(\"📦 Creating template with the image\")\n\n // Trigger remote build phase\n await client.sandboxes.builds.finalize(buildId)\n\n // Poll every 2 seconds for roughly 5 minutes\n const pollIntervalMs = 2000\n const timeoutMs = 5 * 60 * 1000\n\n const startTime = Date.now()\n\n let build\n do {\n await sleep(pollIntervalMs)\n build = (await client.sandboxes.builds.get(buildId)).build\n } while (build.state === \"Building\" && Date.now() - startTime < timeoutMs)\n\n // Verify build state\n if (build.state !== \"Success\") {\n this.error(`Template creation failed`)\n }\n\n action.stop(\"done\")\n }\n}\n\ntype PackageJson = {\n name: string\n version: string\n dependencies: Record<string, string>\n supernova:\n | {\n privateDependencies: string[] | undefined\n }\n | undefined\n}\n\nasync function readPackageJson(): Promise<PackageJson> {\n const pkgPath = path.join(process.cwd(), \"package.json\")\n\n if (!(await fileExists(pkgPath))) throw new Error(`package.json file was not found in the current directory`)\n\n const raw = await fs.readFile(pkgPath, \"utf8\")\n const pkg = JSON.parse(raw)\n\n if (typeof pkg !== \"object\" || pkg === null) throw new Error(`Error parsing package.json: not a json`)\n\n if (typeof pkg.name !== \"string\") throw new Error(`Error parsing package.json: 'name' must be defined`)\n if (typeof pkg.version !== \"string\") throw new Error(`Error parsing package.json: 'version' must be defined`)\n if (typeof pkg.dependencies !== \"object\" || pkg.dependencies === null)\n throw new Error(`Error parsing package.json: 'dependencies' must be defined`)\n\n if (pkg.supernova?.privateDependencies) {\n const privateDependencies = pkg.supernova?.privateDependencies\n if (!Array.isArray(privateDependencies)) throw new TypeError(`supernova.privateDependencies must be an array`)\n\n for (const [i, d] of privateDependencies.entries()) {\n if (typeof d !== \"string\") {\n throw new TypeError(`supernova.privateDependencies[${i}] must be a string`)\n }\n\n if (!pkg.dependencies[d]) {\n throw new Error(`Private dependency ${d} is not listed in 'dependencies'`)\n }\n }\n }\n\n return pkg\n}\n\nfunction imageUrl(build: DTOSandboxTemplateBuildCreateResponse) {\n return `${build.dockerRegistryDomain}${build.build.dockerImagePath}`\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAChC,OAAO,GAAG,MAAM,UAAU,CAAA;AAE1B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;AAEpC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE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AAK,QAAQ,IAAI,GAAG,CAAC,YAAY,KAAK,IAAI;QACnE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;IAE/E,IAAI,GAAG,CAAC,SAAS,EAAE,mBAAmB,EAAE,CAAC;QACvC,MAAM,mBAAmB,GAAG,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAA;QAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAA;QAE9G,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC;YACnD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,oBAAoB,CAAC,CAAA;YAC7E,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,kCAAkC,CAAC,CAAA;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAS,QAAQ,CAAC,KAA4C;IAC5D,OAAO,GAAG,KAAK,CAAC,oBAAoB,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,EAAE,CAAA;AACtE,CAAC","debug_id":"c9729bc9-3c4b-5c58-92b2-ffe5959f9549"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../src/services/user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,kBAAkB;IAEvD,KAAK;;;;;;;
|
|
1
|
+
{"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../src/services/user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,kBAAkB;IAEvD,KAAK;;;;;;;wBAImx0ne,CAAC;sBAA4C,CAAC;0BAAgD,CAAC;+BAAmC,CAAC;uCAA6D,CAAC;8CAAoE,CAAC;8BAAoD,CAAC;4BAAoG,CAAC;yBAA+C,CAAC;4BAAkD,CAAC;oCAA+G,CAAC;sCAA4D,CAAC;iDAAuE,CAAC;4BAAmD,CAAC;iDAAuE,CAAC;;qBAA2E,CAAC;mCAAuC,CAAC;+BAAqD,CAAC;4BAAkD,CAAC;sCAA4D,CAAC;4CAAmE,CAAC;qCAA2D,CAAC;iCAAuD,CAAC;0BAAiD,CAAC;;2BAA8M,CAAC;mCAAuC,CAAC;+BAAqD,CAAC;4BAAkD,CAAC;sCAA4D,CAAC;4CAAmE,CAAC;qCAA2D,CAAC;iCAAuD,CAAC;0BAAiD,CAAC;;;;;;uBAAiU,CAAC;kBAAsC,CAAC;;;CADjo5ne"}
|
package/dist/utils/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/utils/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/utils/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAO5C,OAAO,QAAQ,CAAA;AAKf,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACjF,KAAK,EAAE,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAA;IAC5B,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAA;IACnC,EAAE,EAAE,QAAQ,CAAC,gCAAgC,CAAA;IAC7C,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAA;IAC5B,KAAK,EAAE,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAA;IACjC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAA;CACtC,CAAC,CAuDD"}
|
package/dist/utils/sdk.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="de98c81d-6cc8-5916-9893-faba2cec1873")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
|
+
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
4
5
|
import { apiUrlForEnvironment, getTargetEnv } from "../types/environment.js";
|
|
5
6
|
import "colors";
|
|
6
7
|
const require = createRequire(import.meta.url);
|
|
@@ -15,8 +16,9 @@ export async function getWritableVersion(flags) {
|
|
|
15
16
|
const apiUrl = flags.apiUrl && flags.apiUrl.length > 0 ? flags.apiUrl : apiUrlForEnvironment(getTargetEnv());
|
|
16
17
|
const instance = new sdkProvider.Supernova(flags.apiKey, {
|
|
17
18
|
apiUrl,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
customProxyLib: flags.proxyUrl
|
|
20
|
+
? new HttpsProxyAgent(flags.proxyUrl)
|
|
21
|
+
: null,
|
|
20
22
|
});
|
|
21
23
|
const designSystem = await instance.designSystems.designSystem(flags.designSystemId);
|
|
22
24
|
if (!designSystem) {
|
|
@@ -50,4 +52,4 @@ export async function getWritableVersion(flags) {
|
|
|
50
52
|
return { brand, designSystem, id, instance, theme, version };
|
|
51
53
|
}
|
|
52
54
|
//# sourceMappingURL=sdk.js.map
|
|
53
|
-
//# debugId=
|
|
55
|
+
//# debugId=de98c81d-6cc8-5916-9893-faba2cec1873
|
package/dist/utils/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../src/utils/sdk.ts"],"sourceRoot":"","sourcesContent":["import * as sdkTypes from \"@supernovaio/sdk\"\nimport { createRequire } from \"node:module\"\n\nimport { apiUrlForEnvironment, getTargetEnv } from \"../types/environment.js\"\n\n// eslint-disable-next-line no-restricted-imports\nimport \"colors\"\n\nconst require = createRequire(import.meta.url)\nconst sdkProvider = require(\"@supernovaio/sdk\") as typeof sdkTypes\n\nexport interface DefaultDesignSystemFlags {\n apiKey: string\n apiUrl?: string\n brandId?: string\n designSystemId: string\n proxyUrl?: string\n themeId?: string\n}\n\nexport async function getWritableVersion(flags: DefaultDesignSystemFlags): Promise<{\n brand: null | sdkTypes.Brand\n designSystem: sdkTypes.DesignSystem\n id: sdkTypes.RemoteWorkspaceVersionIdentifier\n instance: sdkTypes.Supernova\n theme: null | sdkTypes.TokenTheme\n version: sdkTypes.DesignSystemVersion\n}> {\n if (!flags.apiKey || flags.apiKey.length === 0) {\n throw new Error(`API key must not be empty`)\n }\n\n if (!flags.designSystemId || flags.designSystemId.length === 0) {\n throw new Error(`Design System ID must not be empty`)\n }\n\n // Create instance for prod / dev\n const apiUrl = flags.apiUrl && flags.apiUrl.length > 0 ? flags.apiUrl : apiUrlForEnvironment(getTargetEnv())\n const instance = new sdkProvider.Supernova(flags.apiKey, {\n apiUrl,\n
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../src/utils/sdk.ts"],"sourceRoot":"","sourcesContent":["import * as sdkTypes from \"@supernovaio/sdk\"\nimport { createRequire } from \"node:module\"\nimport { HttpsProxyAgent } from 'https-proxy-agent'\n\nimport { apiUrlForEnvironment, getTargetEnv } from \"../types/environment.js\"\n\n// eslint-disable-next-line no-restricted-imports\nimport \"colors\"\n\nconst require = createRequire(import.meta.url)\nconst sdkProvider = require(\"@supernovaio/sdk\") as typeof sdkTypes\n\nexport interface DefaultDesignSystemFlags {\n apiKey: string\n apiUrl?: string\n brandId?: string\n designSystemId: string\n proxyUrl?: string\n themeId?: string\n}\n\nexport async function getWritableVersion(flags: DefaultDesignSystemFlags): Promise<{\n brand: null | sdkTypes.Brand\n designSystem: sdkTypes.DesignSystem\n id: sdkTypes.RemoteWorkspaceVersionIdentifier\n instance: sdkTypes.Supernova\n theme: null | sdkTypes.TokenTheme\n version: sdkTypes.DesignSystemVersion\n}> {\n if (!flags.apiKey || flags.apiKey.length === 0) {\n throw new Error(`API key must not be empty`)\n }\n\n if (!flags.designSystemId || flags.designSystemId.length === 0) {\n throw new Error(`Design System ID must not be empty`)\n }\n\n // Create instance for prod / dev\n const apiUrl = flags.apiUrl && flags.apiUrl.length > 0 ? flags.apiUrl : apiUrlForEnvironment(getTargetEnv())\n const instance = new sdkProvider.Supernova(flags.apiKey, {\n apiUrl,\n customProxyLib: flags.proxyUrl\n ? new HttpsProxyAgent(flags.proxyUrl)\n : null,\n })\n\n const designSystem = await instance.designSystems.designSystem(flags.designSystemId)\n if (!designSystem) {\n throw new Error(`Design system ${flags.designSystemId} not found or not available under provided API key`)\n }\n\n const version = await instance.versions.getActiveVersion(flags.designSystemId)\n if (!version) {\n throw new Error(\n `Design system ${flags.designSystemId} writable version not found or not available under provided API key`,\n )\n }\n\n const id: sdkTypes.RemoteWorkspaceVersionIdentifier = {\n designSystemId: flags.designSystemId,\n versionId: version.id,\n workspaceId: designSystem.workspaceId,\n }\n\n let brand: null | sdkTypes.Brand = null\n if (flags.brandId) {\n const brands = await instance.brands.getBrands(id)\n brand = brands.find(brand => brand.id === flags.brandId || brand.idInVersion === flags.brandId) ?? null\n if (!brand) {\n throw new Error(`Brand ${flags.brandId} not found in specified design system`)\n }\n }\n\n let theme: null | sdkTypes.TokenTheme = null\n if (flags.themeId) {\n const themes = await instance.tokens.getTokenThemes(id)\n theme = themes.find(theme => theme.id === flags.themeId || theme.idInVersion === flags.themeId) ?? null\n if (!theme) {\n throw new Error(`Theme ${flags.themeId} not found in specified brand`)\n }\n }\n\n return { brand, designSystem, id, instance, theme, version }\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAG5E,OAAO,QAAQ,CAAA;AAEf,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAoB,CAAA;AAWlE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAA+B;IAQtE,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC9C,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;IACvD,CAAC;IAGD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,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AAO,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAA;QACvG,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,SAAS,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAA;QAChF,CAAC;IACH,CAAC;IAED,IAAI,KAAK,GAA+B,IAAI,CAAA;IAC5C,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;QACvD,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAA;QACvG,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,SAAS,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;QACxE,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;AAC9D,CAAC","debug_id":"de98c81d-6cc8-5916-9893-faba2cec1873"}
|
package/oclif.manifest.json
CHANGED
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
"template-upload": {
|
|
505
505
|
"aliases": [],
|
|
506
506
|
"args": {},
|
|
507
|
-
"description": "Upload
|
|
507
|
+
"description": "Upload component container template to Supernova",
|
|
508
508
|
"examples": [
|
|
509
509
|
"<%= config.bin %> <%= command.id %> TemplateUpload "
|
|
510
510
|
],
|
|
@@ -545,7 +545,7 @@
|
|
|
545
545
|
}
|
|
546
546
|
},
|
|
547
547
|
"hasDynamicHelp": false,
|
|
548
|
-
"hidden":
|
|
548
|
+
"hidden": false,
|
|
549
549
|
"hiddenAliases": [],
|
|
550
550
|
"id": "template-upload",
|
|
551
551
|
"pluginAlias": "@supernovaio/cli",
|
|
@@ -582,5 +582,5 @@
|
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
},
|
|
585
|
-
"version": "2.0.
|
|
585
|
+
"version": "2.0.28"
|
|
586
586
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supernovaio/cli",
|
|
3
3
|
"description": "Supernova.io Command Line Interface",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.28",
|
|
5
5
|
"author": "Supernova.io",
|
|
6
6
|
"bin": {
|
|
7
7
|
"supernova": "./bin/run"
|
|
@@ -16,18 +16,19 @@
|
|
|
16
16
|
"@sentry/node": "^9.9.0",
|
|
17
17
|
"@sentry/profiling-node": "^9.9.0",
|
|
18
18
|
"@sindresorhus/slugify": "^2.2.1",
|
|
19
|
-
"@supernova-studio/client": "1.
|
|
20
|
-
"@supernova-studio/pulsar-core": "2.
|
|
21
|
-
"@supernova-studio/pulsar-language": "
|
|
19
|
+
"@supernova-studio/client": "1.66.0",
|
|
20
|
+
"@supernova-studio/pulsar-core": "2.7.10",
|
|
21
|
+
"@supernova-studio/pulsar-language": "2.7.10",
|
|
22
22
|
"@supernovaio/code-analyzer": "^1.0.1-alpha.2",
|
|
23
|
-
"@supernovaio/sdk": "2.
|
|
23
|
+
"@supernovaio/sdk": "2.2.54",
|
|
24
24
|
"@types/fs-extra": "^11.0.4",
|
|
25
25
|
"adm-zip": "^0.5.16",
|
|
26
|
-
"axios": "^1.
|
|
26
|
+
"axios": "^1.13.4",
|
|
27
27
|
"cli-progress": "^3.12.0",
|
|
28
28
|
"colors": "^1.4.0",
|
|
29
29
|
"dotenv": "^16.4.7",
|
|
30
30
|
"fs-extra": "^11.3.2",
|
|
31
|
+
"https-proxy-agent": "^7.0.6",
|
|
31
32
|
"inquirer": "^12.5.2",
|
|
32
33
|
"ip-cidr": "^4.0.2",
|
|
33
34
|
"jwt-decode": "^4.0.0",
|