@squidcloud/cli 1.0.396 → 1.0.397

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.
Files changed (2) hide show
  1. package/dist/index.js +121 -57
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3314,6 +3314,62 @@ module.exports = isFullwidthCodePoint;
3314
3314
  module.exports["default"] = isFullwidthCodePoint;
3315
3315
 
3316
3316
 
3317
+ /***/ }),
3318
+
3319
+ /***/ 1665:
3320
+ /***/ ((__unused_webpack_module, exports) => {
3321
+
3322
+ "use strict";
3323
+
3324
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3325
+ exports.parseSquidRegion = parseSquidRegion;
3326
+ function parseSquidRegion(input) {
3327
+ if (input === 'local') {
3328
+ return {
3329
+ cloudId: 'local',
3330
+ region: 'local',
3331
+ shard: undefined,
3332
+ stage: 'prod',
3333
+ };
3334
+ }
3335
+ const parts = input.split('.');
3336
+ // possible forms:
3337
+ // [region, cloudId] (prod, no shard)
3338
+ // [region, cloudId, stage] (non-prod, no shard)
3339
+ // [shard, region, cloudId] (prod, with shard)
3340
+ // [shard, region, cloudId, stage] (non-prod, with shard)
3341
+ if (parts.length < 2) {
3342
+ throw new Error(`Invalid SquidRegion format: ${input}`);
3343
+ }
3344
+ let shard;
3345
+ let region;
3346
+ let cloudId;
3347
+ let stage = 'prod';
3348
+ if (parts.length === 2) {
3349
+ // region.cloudId
3350
+ [region, cloudId] = parts;
3351
+ }
3352
+ else if (parts.length === 3) {
3353
+ if (parts[2] === 'prod') {
3354
+ // region.cloudId.prod (explicit prod stage, rare case)
3355
+ [region, cloudId, stage] = parts;
3356
+ }
3357
+ else {
3358
+ // shard.region.cloudId (prod with shard)
3359
+ [shard, region, cloudId] = parts;
3360
+ }
3361
+ }
3362
+ else if (parts.length === 4) {
3363
+ // shard.region.cloudId.stage
3364
+ [shard, region, cloudId, stage] = parts;
3365
+ }
3366
+ else {
3367
+ throw new Error(`Invalid SquidRegion format: ${input}`);
3368
+ }
3369
+ return { cloudId: cloudId, region, shard, stage: stage };
3370
+ }
3371
+
3372
+
3317
3373
  /***/ }),
3318
3374
 
3319
3375
  /***/ 1674:
@@ -4359,13 +4415,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
4359
4415
  exports["default"] = default_1;
4360
4416
  const fs = __importStar(__webpack_require__(1943));
4361
4417
  const path_1 = __importDefault(__webpack_require__(6928));
4362
- async function default_1(pathStr = './', appId, apiKey, environmentId, squidDeveloperId, region) {
4363
- const fileContent = `SQUID_APP_ID=${appId}
4418
+ async function default_1(consoleRegion, pathStr = './', appId, apiKey, environmentId, squidDeveloperId, region) {
4419
+ let fileContent = `SQUID_APP_ID=${appId}
4364
4420
  SQUID_REGION=${region}
4365
4421
  SQUID_API_KEY=${apiKey}
4366
4422
  SQUID_ENVIRONMENT_ID=${environmentId}
4367
4423
  SQUID_DEVELOPER_ID=${squidDeveloperId}
4368
- `;
4424
+ `.trim();
4425
+ if (consoleRegion) {
4426
+ fileContent += `\nSQUID_CONSOLE_REGION=${consoleRegion}`;
4427
+ }
4369
4428
  await fs.writeFile(path_1.default.resolve(pathStr, '.env'), fileContent);
4370
4429
  console.log('Created .env file');
4371
4430
  }
@@ -8180,15 +8239,12 @@ module.exports = function bitIterator(nextBuffer) {
8180
8239
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8181
8240
  exports.reportLocalBackendInitialized = reportLocalBackendInitialized;
8182
8241
  const assertic_1 = __webpack_require__(3205);
8183
- const console_app_utils_1 = __webpack_require__(7580);
8184
8242
  const http_1 = __webpack_require__(866);
8185
8243
  const environment_1 = __webpack_require__(722);
8186
- async function reportLocalBackendInitialized(appId, apiKey, appRegion, verbose) {
8187
- const stage = appRegion === 'local' ? 'local' : appRegion.endsWith('.sandbox') ? 'sandbox' : 'prod';
8188
- const consoleRegion = (0, console_app_utils_1.getConsoleAppRegionByStage)(stage);
8244
+ async function reportLocalBackendInitialized(consoleRegion, appId, apiKey, verbose) {
8189
8245
  const url = `${(0, http_1.getApplicationUrl)(consoleRegion, environment_1.environment.consoleAppId, 'webhooks/reportLocalBackendInitialized')}`;
8190
8246
  if (verbose) {
8191
- console.log('Reporting backend initialization to Squid Console...', url, appRegion, stage);
8247
+ console.log('Reporting backend initialization to Squid Console...', url);
8192
8248
  }
8193
8249
  try {
8194
8250
  const headers = new Headers();
@@ -11615,7 +11671,8 @@ const dotenv = __importStar(__webpack_require__(9650));
11615
11671
  const fsSync = __importStar(__webpack_require__(9896));
11616
11672
  const path_1 = __importDefault(__webpack_require__(6928));
11617
11673
  const yargs_1 = __importDefault(__webpack_require__(1771));
11618
- const stage_1 = __webpack_require__(8058);
11674
+ const console_app_utils_1 = __webpack_require__(7580);
11675
+ const region_utils_1 = __webpack_require__(1665);
11619
11676
  const packageJson = __importStar(__webpack_require__(8330));
11620
11677
  const build_1 = __importDefault(__webpack_require__(8584));
11621
11678
  const deploy_1 = __importDefault(__webpack_require__(8705));
@@ -11659,10 +11716,11 @@ function setupDeployCommand(yargs) {
11659
11716
  yargs.command(['deploy [path]', 'upload [path]'], 'Builds and deploys your backend code to the Squid server', yargs => {
11660
11717
  yargs.positional('path', { type: 'string', description: 'The path to the bundle file (e.g. dist/bundle.zip)' });
11661
11718
  yargs.count('direct').alias('d', 'direct');
11662
- attachStageOption(yargs);
11719
+ attachConsoleRegionOption(yargs);
11663
11720
  attachAppIdOption(yargs, false);
11664
11721
  attachApiKeyOption(yargs, false);
11665
11722
  attachEnvironmentIdOption(yargs, false);
11723
+ attachRegionOption(yargs, false);
11666
11724
  attachInternalApiKeyOption(yargs);
11667
11725
  yargs.option('skipBuild', {
11668
11726
  type: 'boolean',
@@ -11681,27 +11739,30 @@ function setupDeployCommand(yargs) {
11681
11739
  const internalApiKey = argv.direct ? getInternalApiKeyFromCommandOrEnv(argv.internalApiKey) : undefined;
11682
11740
  if (!argv.direct && !apiKey)
11683
11741
  (0, process_utils_1.exitWithError)('Must provide an API key');
11684
- const stage = argv.stage;
11685
- (0, deploy_1.default)(stage, appId, bundlePath, apiKey, !!argv.verbose, argv.direct, isUserSpecifiedPath, !!argv.skipBuild, internalApiKey, environmentId).then();
11742
+ const appRegion = geAppRegionFromCommandOrEnv(argv.region);
11743
+ const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(appRegion);
11744
+ (0, deploy_1.default)(consoleRegion, appId, bundlePath, apiKey, !!argv.verbose, argv.direct, isUserSpecifiedPath, !!argv.skipBuild, internalApiKey, environmentId).then();
11686
11745
  });
11687
11746
  }
11688
11747
  function setupUndeployCommand(yargs) {
11689
11748
  yargs.command(['undeploy'], 'Undeploys your backend code from Squid Cloud', yargs => {
11690
- attachStageOption(yargs);
11691
11749
  attachAppIdOption(yargs, false);
11692
11750
  attachApiKeyOption(yargs, false);
11693
11751
  attachEnvironmentIdOption(yargs, false);
11752
+ attachConsoleRegionOption(yargs);
11753
+ attachRegionOption(yargs, false);
11694
11754
  }, async (argv) => {
11695
11755
  await (0, validate_1.validateSquidProject)();
11696
11756
  const baseDir = getEnvFolderPath();
11697
11757
  setupDotEnv(baseDir);
11698
11758
  const appId = getAppIdFromCommandOrEnv(argv.appId);
11699
11759
  const apiKey = getApiKeyFromCommandOrEnv(argv.apiKey);
11700
- const environmentId = getEnvironmentIdFromCommandOrEnv(argv.environmentId);
11701
11760
  if (!apiKey)
11702
11761
  (0, process_utils_1.exitWithError)('Must provide an API key');
11703
- const stage = argv.stage;
11704
- (0, undeploy_1.default)(stage, appId, apiKey, environmentId).then();
11762
+ const environmentId = getEnvironmentIdFromCommandOrEnv(argv.environmentId);
11763
+ const region = geAppRegionFromCommandOrEnv(undefined);
11764
+ const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(region);
11765
+ (0, undeploy_1.default)(consoleRegion, appId, apiKey, environmentId).then();
11705
11766
  });
11706
11767
  }
11707
11768
  function setupInitEnvCommand(yargs) {
@@ -11712,9 +11773,10 @@ function setupInitEnvCommand(yargs) {
11712
11773
  attachEnvironmentIdOption(yargs, true);
11713
11774
  attachSquidDeveloperIdOption(yargs, true);
11714
11775
  attachRegionOption(yargs, true);
11776
+ attachConsoleRegionOption(yargs);
11715
11777
  }, async (argv) => {
11716
11778
  await (0, validate_1.validateSquidProject)();
11717
- await (0, init_env_1.default)(argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region);
11779
+ await (0, init_env_1.default)(argv.consoleRegion, argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region);
11718
11780
  });
11719
11781
  }
11720
11782
  function setupInitWebpackCommand(yargs) {
@@ -11731,8 +11793,12 @@ function setupInitCommand(yargs) {
11731
11793
  attachEnvironmentIdOption(yargs, false);
11732
11794
  attachSquidDeveloperIdOption(yargs, false);
11733
11795
  attachRegionOption(yargs, false);
11796
+ attachConsoleRegionOption(yargs);
11734
11797
  }, async (argv) => {
11735
- await (0, sample_1.default)(argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region, 'backend', !!argv.verbose);
11798
+ const appRegion = geAppRegionFromCommandOrEnv(argv.region);
11799
+ const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(appRegion);
11800
+ await (0, sample_1.default)(consoleRegion, !!argv.consoleRegion, // If the console region is specified, we assume it's an on-prem console
11801
+ argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region, 'backend', !!argv.verbose);
11736
11802
  });
11737
11803
  }
11738
11804
  function setupInitSampleCommand(yargs) {
@@ -11744,8 +11810,12 @@ function setupInitSampleCommand(yargs) {
11744
11810
  attachSquidDeveloperIdOption(yargs, false);
11745
11811
  attachRegionOption(yargs, false);
11746
11812
  attachTemplateOption(yargs, true);
11813
+ attachConsoleRegionOption(yargs);
11747
11814
  }, async (argv) => {
11748
- await (0, sample_1.default)(argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region, argv.template, !!argv.verbose);
11815
+ const appRegion = geAppRegionFromCommandOrEnv(argv.region);
11816
+ const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(appRegion);
11817
+ await (0, sample_1.default)(consoleRegion, !!argv.consoleRegion, // If the console region is specified, we assume it's an on-prem console
11818
+ argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region, argv.template, !!argv.verbose);
11749
11819
  });
11750
11820
  }
11751
11821
  function setupBuildCommand(yargs) {
@@ -11837,6 +11907,16 @@ function getEnvironmentIdFromCommandOrEnv(environmentId) {
11837
11907
  return environmentId;
11838
11908
  return getEnvVarOrFail('SQUID_ENVIRONMENT_ID', '--environmentId');
11839
11909
  }
11910
+ function geAppRegionFromCommandOrEnv(appRegion) {
11911
+ if (appRegion)
11912
+ return appRegion;
11913
+ return getEnvVarOrFail('SQUID_REGION', '--region');
11914
+ }
11915
+ function geConsoleRegionFromCommandOrEnv(consoleRegion) {
11916
+ if (consoleRegion)
11917
+ return consoleRegion;
11918
+ return process.env['SQUID_CONSOLE_REGION'];
11919
+ }
11840
11920
  function getInternalApiKeyFromCommandOrEnv(internalApiKey) {
11841
11921
  if (internalApiKey)
11842
11922
  return internalApiKey;
@@ -11845,12 +11925,12 @@ function getInternalApiKeyFromCommandOrEnv(internalApiKey) {
11845
11925
  return envInternalApiKey;
11846
11926
  (0, process_utils_1.exitWithError)('Squid internal API key was not provided when using -d');
11847
11927
  }
11848
- function attachStageOption(yargs) {
11849
- yargs.option('stage', {
11928
+ function attachConsoleRegionOption(yargs) {
11929
+ yargs.option('consoleRegion', {
11850
11930
  type: 'string',
11851
11931
  hidden: true,
11852
- default: 'prod',
11853
- choices: stage_1.STAGES,
11932
+ default: '',
11933
+ demandOption: false,
11854
11934
  });
11855
11935
  }
11856
11936
  function getEnvFolderPath(bundlePath) {
@@ -11866,6 +11946,10 @@ function getEnvFolderPath(bundlePath) {
11866
11946
  // 3. Return current path
11867
11947
  return process.cwd();
11868
11948
  }
11949
+ function getConsoleRegionFromAppRegion(appRegion) {
11950
+ const regionParts = (0, region_utils_1.parseSquidRegion)(appRegion);
11951
+ return (0, console_app_utils_1.getConsoleAppRegionByStage)(regionParts.stage);
11952
+ }
11869
11953
 
11870
11954
 
11871
11955
  /***/ }),
@@ -11962,13 +12046,14 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
11962
12046
  exports["default"] = initSample;
11963
12047
  const promises_1 = __importDefault(__webpack_require__(1943));
11964
12048
  const path_1 = __importDefault(__webpack_require__(6928));
12049
+ const communication_types_1 = __webpack_require__(3443);
11965
12050
  const shell_runner_1 = __webpack_require__(3089);
11966
12051
  const git_utils_1 = __webpack_require__(954);
11967
12052
  const logging_1 = __webpack_require__(443);
11968
12053
  const process_utils_1 = __webpack_require__(8251);
11969
12054
  const report_utils_1 = __webpack_require__(3066);
11970
12055
  const ORG = 'squid-cloud-samples';
11971
- async function initSample(dirPath, appId, apiKey, environmentId, squidDeveloperId, region, templateName, verbose = false) {
12056
+ async function initSample(consoleRegion, isOnPremConsole, dirPath, appId, apiKey, environmentId, squidDeveloperId, region, templateName, verbose = false) {
11972
12057
  try {
11973
12058
  await promises_1.default.stat(path_1.default.resolve(dirPath));
11974
12059
  (0, process_utils_1.exitWithError)(`Project already exists: ${dirPath}`);
@@ -11983,7 +12068,6 @@ async function initSample(dirPath, appId, apiKey, environmentId, squidDeveloperI
11983
12068
  console.log(`Downloading ${templateRepoPath}...`);
11984
12069
  try {
11985
12070
  await (0, git_utils_1.downloadRepo)(ORG, templateName, dirPath);
11986
- // Delete the `.github` directory if it exists.
11987
12071
  await promises_1.default.rm(`${dirPath}/.github`, { recursive: true, force: true });
11988
12072
  }
11989
12073
  catch {
@@ -12008,12 +12092,15 @@ async function initSample(dirPath, appId, apiKey, environmentId, squidDeveloperI
12008
12092
  }
12009
12093
  catch { }
12010
12094
  const hasEnvars = appId && region && apiKey && environmentId && squidDeveloperId;
12011
- const backendEnvFileContent = `SQUID_APP_ID=${appId || ''}
12095
+ let backendEnvFileContent = `SQUID_APP_ID=${appId || ''}
12012
12096
  SQUID_REGION=${region || ''}
12013
12097
  SQUID_API_KEY=${apiKey || ''}
12014
12098
  SQUID_ENVIRONMENT_ID=${environmentId || ''}
12015
12099
  SQUID_DEVELOPER_ID=${squidDeveloperId || ''}
12016
- `;
12100
+ `.trim();
12101
+ if (isOnPremConsole) {
12102
+ backendEnvFileContent += `\nSQUID_CONSOLE_REGION=${consoleRegion}`;
12103
+ }
12017
12104
  await promises_1.default.writeFile(path_1.default.resolve(dirPath, monorepo ? 'backend' : '', '.env'), backendEnvFileContent);
12018
12105
  if (hasEnvars)
12019
12106
  console.log(`${monorepo ? 'Backend ' : ''}.env file created successfully`);
@@ -12032,7 +12119,7 @@ ${(0, logging_1.primary)('Done. Now run:')}
12032
12119
  cd ${dirPath}
12033
12120
  npm run start
12034
12121
  `);
12035
- await (0, report_utils_1.reportLocalBackendInitialized)(`${appId}-${environmentId}-${squidDeveloperId}`, apiKey, region, verbose);
12122
+ await (0, report_utils_1.reportLocalBackendInitialized)(consoleRegion, (0, communication_types_1.appIdWithEnvironmentIdAndDevId)(appId, environmentId, squidDeveloperId), apiKey, verbose);
12036
12123
  }
12037
12124
  else {
12038
12125
  console.log((0, logging_1.link)('https://console.getsquid.ai'));
@@ -22288,25 +22375,6 @@ module.exports = function forEachBail(array, iterator, callback) {
22288
22375
  };
22289
22376
 
22290
22377
 
22291
- /***/ }),
22292
-
22293
- /***/ 8058:
22294
- /***/ ((__unused_webpack_module, exports) => {
22295
-
22296
- "use strict";
22297
-
22298
- Object.defineProperty(exports, "__esModule", ({ value: true }));
22299
- exports.STAGES = void 0;
22300
- /**
22301
- * Stage of the Squid deployment:
22302
- * - 'local' - Squid is run locally.
22303
- * - 'prod' - Production environment (https://console.getsquid.ai).
22304
- * - 'sandbox' - One of the sandbox environments (https://console.sandbox.squid.cloud).
22305
- * - 'staging' - One of the staging environments (https://console.staging.squid.cloud).
22306
- */
22307
- exports.STAGES = ['local', 'prod', 'sandbox', 'staging'];
22308
-
22309
-
22310
22378
  /***/ }),
22311
22379
 
22312
22380
  /***/ 8165:
@@ -22550,7 +22618,7 @@ function exitWithError(...messages) {
22550
22618
  /***/ ((module) => {
22551
22619
 
22552
22620
  "use strict";
22553
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.396","description":"The Squid CLI","main":"dist/index.js","scripts":{"start":"node dist/index.js","start-ts":"ts-node -r tsconfig-paths/register src/index.ts","prebuild":"rimraf dist","build":"webpack --mode=production","build:dev":"webpack --mode=development","build:prod":"webpack --mode=production","lint":"eslint","link":"npm run build && chmod 755 dist/index.js && npm link","watch":"webpack --watch","deploy":"npm run build && npm pack --silent | xargs -I {} mv {} package.tgz && npm install -g package.tgz && rm -rf package.tgz","publish:public":"npm run build && npm publish --access public"},"files":["dist/**/*"],"bin":{"squid":"dist/index.js"},"keywords":[],"author":"","license":"ISC","engines":{"node":">=18.0.0"},"dependencies":{"@squidcloud/local-backend":"^1.0.396","copy-webpack-plugin":"^12.0.2","decompress":"^4.2.1","nodemon":"^3.1.3","terser-webpack-plugin":"^5.3.10","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.1.0","webpack":"^5.101.3","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/decompress":"^4.2.7","@types/node":"^20.19.9","terminal-link":"^3.0.0"}}');
22621
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.397","description":"The Squid CLI","main":"dist/index.js","scripts":{"start":"node dist/index.js","start-ts":"ts-node -r tsconfig-paths/register src/index.ts","prebuild":"rimraf dist","build":"webpack --mode=production","build:dev":"webpack --mode=development","build:prod":"webpack --mode=production","lint":"eslint","link":"npm run build && chmod 755 dist/index.js && npm link","watch":"webpack --watch","deploy":"npm run build && npm pack --silent | xargs -I {} mv {} package.tgz && npm install -g package.tgz && rm -rf package.tgz","publish:public":"npm run build && npm publish --access public"},"files":["dist/**/*"],"bin":{"squid":"dist/index.js"},"keywords":[],"author":"","license":"ISC","engines":{"node":">=18.0.0"},"dependencies":{"@squidcloud/local-backend":"^1.0.397","copy-webpack-plugin":"^12.0.2","decompress":"^4.2.1","nodemon":"^3.1.3","terser-webpack-plugin":"^5.3.10","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.1.0","webpack":"^5.101.3","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/decompress":"^4.2.7","@types/node":"^20.19.9","terminal-link":"^3.0.0"}}');
22554
22622
 
22555
22623
  /***/ }),
22556
22624
 
@@ -23281,12 +23349,11 @@ exports["default"] = default_1;
23281
23349
  const assertic_1 = __webpack_require__(3205);
23282
23350
  const fs = __importStar(__webpack_require__(1943));
23283
23351
  const communication_types_1 = __webpack_require__(3443);
23284
- const console_app_utils_1 = __webpack_require__(7580);
23285
23352
  const http_1 = __webpack_require__(866);
23286
23353
  const shell_runner_1 = __webpack_require__(3089);
23287
23354
  const environment_1 = __webpack_require__(722);
23288
23355
  const process_utils_1 = __webpack_require__(8251);
23289
- async function default_1(stage, appId, bundlePath, apiKey, verbose, direct, isUserSpecifiedPath, skipBuild, internalApiKey, environmentId) {
23356
+ async function default_1(consoleRegion, appId, bundlePath, apiKey, verbose, direct, isUserSpecifiedPath, skipBuild, internalApiKey, environmentId) {
23290
23357
  if (!direct && !isUserSpecifiedPath && !skipBuild) {
23291
23358
  console.log('Building code bundle...');
23292
23359
  await (0, shell_runner_1.runInShell)('npm run build');
@@ -23297,10 +23364,9 @@ async function default_1(stage, appId, bundlePath, apiKey, verbose, direct, isUs
23297
23364
  const fileData = await fs.readFile(bundlePath);
23298
23365
  const bundleDataAsBlob = new Blob([new Uint8Array(fileData)], { type: 'application/octet-stream' });
23299
23366
  form.append('file', bundleDataAsBlob);
23300
- const regionPrefix = (0, console_app_utils_1.getConsoleAppRegionByStage)(stage);
23301
23367
  const updateCodeUrl = direct
23302
- ? (0, http_1.getApplicationUrl)(regionPrefix, appIdWithEnvId, 'application/updateApplicationCode')
23303
- : (0, http_1.getApplicationUrl)(regionPrefix, environment_1.environment.consoleAppId, 'webhooks/updateApplicationCode');
23368
+ ? (0, http_1.getApplicationUrl)(consoleRegion, appIdWithEnvId, 'application/updateApplicationCode')
23369
+ : (0, http_1.getApplicationUrl)(consoleRegion, environment_1.environment.consoleAppId, 'webhooks/updateApplicationCode');
23304
23370
  console.log(`Deploying code bundle for appId '${appId}' to the '${environmentId}' environment...`);
23305
23371
  if (verbose) {
23306
23372
  console.log('Deploying bundle to:', updateCodeUrl);
@@ -24808,14 +24874,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
24808
24874
  exports["default"] = default_1;
24809
24875
  const assertic_1 = __webpack_require__(3205);
24810
24876
  const communication_types_1 = __webpack_require__(3443);
24811
- const console_app_utils_1 = __webpack_require__(7580);
24812
24877
  const http_1 = __webpack_require__(866);
24813
24878
  const environment_1 = __webpack_require__(722);
24814
24879
  const process_utils_1 = __webpack_require__(8251);
24815
- async function default_1(stage, appId, apiKey, environmentId) {
24880
+ async function default_1(consoleRegion, appId, apiKey, environmentId) {
24816
24881
  const appIdWithEnvId = (0, communication_types_1.appIdWithEnvironmentId)(appId, environmentId);
24817
- const regionPrefix = (0, console_app_utils_1.getConsoleAppRegionByStage)(stage);
24818
- const deleteApplicationCodeUrl = (0, http_1.getApplicationUrl)(regionPrefix, environment_1.environment.consoleAppId, 'webhooks/deleteApplicationCode');
24882
+ const deleteApplicationCodeUrl = (0, http_1.getApplicationUrl)(consoleRegion, environment_1.environment.consoleAppId, 'webhooks/deleteApplicationCode');
24819
24883
  console.log(`Undeploying code bundle for appId '${appId}' from the '${environmentId}' environment...`);
24820
24884
  try {
24821
24885
  const headers = new Headers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/cli",
3
- "version": "1.0.396",
3
+ "version": "1.0.397",
4
4
  "description": "The Squid CLI",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "node": ">=18.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@squidcloud/local-backend": "^1.0.396",
32
+ "@squidcloud/local-backend": "^1.0.397",
33
33
  "copy-webpack-plugin": "^12.0.2",
34
34
  "decompress": "^4.2.1",
35
35
  "nodemon": "^3.1.3",