@squidcloud/cli 1.0.332 → 1.0.334

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 (32) hide show
  1. package/dist/cli/src/build.d.ts +1 -0
  2. package/dist/cli/src/deploy.d.ts +3 -0
  3. package/dist/cli/src/environments/environment.d.ts +2 -0
  4. package/dist/cli/src/environments/environment.type.d.ts +5 -0
  5. package/dist/cli/src/index.d.ts +1 -0
  6. package/dist/cli/src/init-env.d.ts +2 -0
  7. package/dist/cli/src/init-webpack.d.ts +1 -0
  8. package/dist/cli/src/main.d.ts +1 -0
  9. package/dist/cli/src/sample.d.ts +2 -0
  10. package/dist/cli/src/start.d.ts +1 -0
  11. package/dist/cli/src/undeploy.d.ts +3 -0
  12. package/dist/cli/src/utils/formatting.d.ts +1 -0
  13. package/dist/cli/src/utils/git-utils.d.ts +1 -0
  14. package/dist/cli/src/utils/logging.d.ts +2 -0
  15. package/dist/cli/src/utils/process-utils.d.ts +2 -0
  16. package/dist/cli/src/utils/report-utils.d.ts +2 -0
  17. package/dist/cli/src/utils/resolve.d.ts +4 -0
  18. package/dist/cli/src/utils/shell-runner.d.ts +12 -0
  19. package/dist/cli/src/utils/validate.d.ts +7 -0
  20. package/dist/index.js +62 -485
  21. package/dist/internal-common/src/public-types/communication.public-types.d.ts +14 -0
  22. package/dist/internal-common/src/public-types/regions.public-types.d.ts +4 -0
  23. package/dist/internal-common/src/types/communication.types.d.ts +20 -0
  24. package/dist/internal-common/src/types/console-app.utils.d.ts +5 -0
  25. package/dist/internal-common/src/types/stage.d.ts +9 -0
  26. package/dist/internal-common/src/utils/global.utils.d.ts +13 -0
  27. package/dist/internal-common/src/utils/http.d.ts +1 -0
  28. package/dist/internal-common/src/utils/resolve.d.ts +2 -0
  29. package/dist/internal-common/src/utils/tsoa-utils.d.ts +9 -0
  30. package/dist/local-backend/src/utils/shell-runner.d.ts +5 -0
  31. package/dist/resources/user-build.webpack.config.js +10 -1
  32. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ export default function (): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { AppId, EnvironmentId } from '../../internal-common/src/public-types/communication.public-types';
2
+ import { Stage } from '../../internal-common/src/types/stage';
3
+ export default function (stage: Stage, appId: AppId, bundlePath: string, apiKey: string | undefined, verbose: boolean, direct: boolean, isUserSpecifiedPath: boolean, skipBuild: boolean, internalApiKey: string | undefined, environmentId: EnvironmentId): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Environment } from './environment.type';
2
+ export declare const environment: Environment;
@@ -0,0 +1,5 @@
1
+ import { SquidRegion } from '../../../internal-common/src/public-types/regions.public-types';
2
+ export interface Environment {
3
+ consoleAppId: string;
4
+ region: SquidRegion;
5
+ }
@@ -0,0 +1 @@
1
+ import './main';
@@ -0,0 +1,2 @@
1
+ import { AppId, EnvironmentId, SquidDeveloperId } from '../../internal-common/src/public-types/communication.public-types';
2
+ export default function (pathStr: string | undefined, appId: AppId, apiKey: string, environmentId: EnvironmentId, squidDeveloperId: SquidDeveloperId, region: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export default function (): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AppId } from '../../internal-common/src/public-types/communication.public-types';
2
+ export default function initSample(dirPath: string, appId: AppId, apiKey: string, environmentId: string, squidDeveloperId: string, region: string, templateName: string, verbose?: boolean): Promise<void>;
@@ -0,0 +1 @@
1
+ export default function (): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { AppId, EnvironmentId } from '../../internal-common/src/public-types/communication.public-types';
2
+ import { Stage } from '../../internal-common/src/types/stage';
3
+ export default function (stage: Stage, appId: AppId, apiKey: string | undefined, environmentId: EnvironmentId): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function normalizeToKebabOrSnakeCase(str: string): string;
@@ -0,0 +1 @@
1
+ export declare function downloadRepo(username: string, repo: string, dest: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare const primary: import("chalk").ChalkInstance;
2
+ export declare const link: (url: string, text?: string) => string;
@@ -0,0 +1,2 @@
1
+ /** Prints error message into console.error() and calls process.exit(1). */
2
+ export declare function exitWithError(...messages: unknown[]): never;
@@ -0,0 +1,2 @@
1
+ import { AppId } from '../../../internal-common/src/public-types/communication.public-types';
2
+ export declare function reportLocalBackendInitialized(appId: AppId, apiKey: string, appRegion: string, verbose: boolean): Promise<void>;
@@ -0,0 +1,4 @@
1
+ export declare function findModulePath(moduleName: string, startDir?: string): Promise<string | null>;
2
+ export declare const requirePath: (file: string) => any;
3
+ export declare const USER_WEBPACK_CONFIG_PATH: string;
4
+ export declare const BUILT_IN_WEBPACK_CONFIG_PATH: string;
@@ -0,0 +1,12 @@
1
+ export interface ErrorLine {
2
+ level: 'error' | 'info';
3
+ message: string;
4
+ }
5
+ export interface ProcessError {
6
+ errorMessage: string;
7
+ combinedOutput: Array<ErrorLine>;
8
+ }
9
+ export declare function runInShell(command: string, printMessages?: boolean, cwd?: string): Promise<{
10
+ combinedOutput: Array<ErrorLine>;
11
+ }>;
12
+ export declare function printCombinedOutput(combinedOutput: Array<ErrorLine>): void;
@@ -0,0 +1,7 @@
1
+ export declare const INVALID_PROJECT_ERROR = "Please make sure you are running this command in your Squid project directory";
2
+ type PackageType = {
3
+ scripts?: Record<string, string>;
4
+ [key: string]: unknown;
5
+ };
6
+ export declare function validateSquidProject(): Promise<PackageType>;
7
+ export {};
package/dist/index.js CHANGED
@@ -449,29 +449,35 @@ exports.requirePath = void 0;
449
449
  exports.findModulePath = findModulePath;
450
450
  const path_1 = __importDefault(__webpack_require__(6928));
451
451
  const enhanced_resolve_1 = __importDefault(__webpack_require__(4506));
452
- async function findModulePath(moduleName, startDir = __dirname) {
453
- let currentDir = startDir;
454
- const result = await new Promise((r, rej) => {
455
- const resolveModule = () => {
456
- (0, enhanced_resolve_1.default)(currentDir, moduleName, (err, filepath) => {
457
- if (err) {
458
- // If the module is not found in the current directory, move up to the parent directory
459
- const parentDir = path_1.default.resolve(currentDir, '..');
460
- if (parentDir === currentDir) {
461
- // If we've reached the root directory, reject the promise
462
- return rej(new Error(`Module "${moduleName}" not found`));
452
+ async function findModulePath(moduleName, startDir = process.cwd()) {
453
+ const directoriesToSearch = new Set([startDir, process.cwd(), __dirname]);
454
+ // Try each directory in order
455
+ for (const baseDir of directoriesToSearch) {
456
+ const foundPath = await new Promise(resolveFound => {
457
+ let currentDir = baseDir;
458
+ const tryResolve = () => {
459
+ (0, enhanced_resolve_1.default)(currentDir, moduleName, (err, filepath) => {
460
+ if (err || !filepath) {
461
+ const parentDir = path_1.default.resolve(currentDir, '..');
462
+ if (parentDir === currentDir) {
463
+ // We've reached the root directory for this branch
464
+ return resolveFound(null);
465
+ }
466
+ currentDir = parentDir;
467
+ tryResolve();
463
468
  }
464
- currentDir = parentDir;
465
- resolveModule();
466
- }
467
- else {
468
- r(filepath);
469
- }
470
- });
471
- };
472
- resolveModule();
473
- });
474
- return result || null;
469
+ else {
470
+ resolveFound(filepath);
471
+ }
472
+ });
473
+ };
474
+ tryResolve();
475
+ });
476
+ if (foundPath) {
477
+ return foundPath;
478
+ }
479
+ }
480
+ return null;
475
481
  }
476
482
  const requirePath = (file) => {
477
483
  return false ? 0 : require(file);
@@ -2360,7 +2366,7 @@ const resolve_1 = __webpack_require__(412);
2360
2366
  const shell_runner_1 = __webpack_require__(3344);
2361
2367
  class TsoaUtils {
2362
2368
  constructor() { }
2363
- static async generateAllSpecs(verbose = false) {
2369
+ static async generateAllSpecs(verbose = false, supportsDefault = true) {
2364
2370
  const specsMap = {};
2365
2371
  // Read files in the current directory.
2366
2372
  let files = await fsPromises.readdir(process.cwd());
@@ -2387,6 +2393,9 @@ class TsoaUtils {
2387
2393
  for (const file of files) {
2388
2394
  const baseName = path.basename(file);
2389
2395
  const specName = TsoaUtils.extractTsoaName(baseName);
2396
+ if (!supportsDefault && specName === 'default') {
2397
+ continue;
2398
+ }
2390
2399
  // Use native join to create the folder.
2391
2400
  const outputDir = path.join('dist', specName);
2392
2401
  if (!fs.existsSync(outputDir)) {
@@ -4340,92 +4349,6 @@ module.exports = () => input => {
4340
4349
  };
4341
4350
 
4342
4351
 
4343
- /***/ }),
4344
-
4345
- /***/ 1932:
4346
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4347
-
4348
- "use strict";
4349
-
4350
- Object.defineProperty(exports, "__esModule", ({ value: true }));
4351
- exports.normalizeJsonAsString = normalizeJsonAsString;
4352
- exports.serializeObj = serializeObj;
4353
- exports.deserializeObj = deserializeObj;
4354
- exports.encodeValueForMapping = encodeValueForMapping;
4355
- exports.decodeValueForMapping = decodeValueForMapping;
4356
- const object_1 = __webpack_require__(8049);
4357
- function sortKeys(json) {
4358
- if (Array.isArray(json)) {
4359
- return json.map(o => sortKeys(o));
4360
- }
4361
- if (typeof json !== 'object' || json === null || json instanceof Date) {
4362
- return json;
4363
- }
4364
- const keys = Object.keys(json);
4365
- const result = {};
4366
- // TODO - if the keys is an array of numbers the sort does not work as expected
4367
- keys.sort().forEach(key => {
4368
- result[key] = sortKeys(json[key]);
4369
- });
4370
- return result;
4371
- }
4372
- function normalizeJsonAsString(json) {
4373
- return serializeObj(sortKeys(json));
4374
- }
4375
- function serializeObj(obj) {
4376
- if (obj === undefined)
4377
- return null; // TODO: change method signature.
4378
- const objWithReplacedDates = (0, object_1.cloneDeep)(obj, value => (0, object_1.isDateObject)(value) ? { $date: value.toISOString() } : undefined);
4379
- return JSON.stringify(objWithReplacedDates);
4380
- }
4381
- function deserializeObj(str) {
4382
- const deserializedObj = JSON.parse(str);
4383
- return (0, object_1.cloneDeep)(deserializedObj, value => {
4384
- if (value === null || typeof value !== 'object') {
4385
- return undefined;
4386
- }
4387
- const record = value;
4388
- const date = record['$date'];
4389
- return date && Object.keys(record).length === 1 ? new Date(date) : undefined;
4390
- });
4391
- }
4392
- function encodeValueForMapping(value) {
4393
- if (value === undefined)
4394
- throw new Error('INVALID_ENCODE_VALUE');
4395
- const serializedValue = serializeObj(value);
4396
- if (typeof Buffer !== 'undefined') {
4397
- // Node.js
4398
- return Buffer.from(serializedValue, 'utf8').toString('base64');
4399
- }
4400
- else {
4401
- // Browser
4402
- const bytes = new TextEncoder().encode(serializedValue);
4403
- let binary = '';
4404
- for (let i = 0; i < bytes.length; i++) {
4405
- binary += String.fromCharCode(bytes[i]);
4406
- }
4407
- return btoa(binary);
4408
- }
4409
- }
4410
- function decodeValueForMapping(encodedString) {
4411
- let decodedValue;
4412
- if (typeof Buffer !== 'undefined') {
4413
- // Node.js
4414
- decodedValue = Buffer.from(encodedString, 'base64').toString('utf8');
4415
- }
4416
- else {
4417
- // Browser
4418
- const binary = atob(encodedString);
4419
- const bytes = new Uint8Array(binary.length);
4420
- for (let i = 0; i < bytes.length; i++) {
4421
- bytes[i] = binary.charCodeAt(i);
4422
- }
4423
- decodedValue = new TextDecoder().decode(bytes);
4424
- }
4425
- return deserializeObj(decodedValue);
4426
- }
4427
-
4428
-
4429
4352
  /***/ }),
4430
4353
 
4431
4354
  /***/ 1943:
@@ -13325,9 +13248,7 @@ function checkArraysHasEqualElementsByComparator(array1, array2, comparator) {
13325
13248
  return true;
13326
13249
  }
13327
13250
  const EMAIL_REGEX_REGULAR = /^[-!#$%&'*+/\d=?A-Z^_a-z{|}~](\.?[-!#$%&'*+/\d=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z\d])*\.[a-zA-Z](-?[a-zA-Z\d])+$/;
13328
- const EMAIL_REGEX_INTERNATIONAL =
13329
- // eslint-disable-next-line no-misleading-character-class
13330
- /^(?!\.)((?!.*\.{2})[a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF.!#$%&'*+-/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF\-.\d]+)((\.([a-zA-Z\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF]){2,63})+)$/i;
13251
+ const EMAIL_REGEX_INTERNATIONAL = /^(?!\.)((?!.*\.{2})[a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF.!#$%&'*+-/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF\-.\d]+)((\.([a-zA-Z\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF]){2,63})+)$/i;
13331
13252
  /** Returns true if *email* is a valid email address. */
13332
13253
  function isEmail(email, constraints = { allowInternationalDomains: false }) {
13333
13254
  if (!isString(email) || email.length === 0 || email.length > 254) {
@@ -17570,6 +17491,7 @@ function getLogPrefixString() {
17570
17491
  "use strict";
17571
17492
 
17572
17493
  Object.defineProperty(exports, "__esModule", ({ value: true }));
17494
+ exports.setDefaultAssertionErrorFactory = setDefaultAssertionErrorFactory;
17573
17495
  exports.assertTruthy = assertTruthy;
17574
17496
  exports.truthy = truthy;
17575
17497
  exports.fail = fail;
@@ -17581,26 +17503,40 @@ exports.assertRecord = assertRecord;
17581
17503
  exports.callValueAssertion = callValueAssertion;
17582
17504
  const ChecksLib_1 = __webpack_require__(4665);
17583
17505
  const Formatter_1 = __webpack_require__(6663);
17584
- /** Asserts that the *param* value is truthy using '!' operator or throws an Error. */
17585
- function assertTruthy(value, error) {
17506
+ const defaultAssertionErrorFactory = (message) => new Error(message);
17507
+ let assertionErrorFactory = defaultAssertionErrorFactory;
17508
+ /** Overrides the default error factory for assertions. */
17509
+ function setDefaultAssertionErrorFactory(factory) {
17510
+ assertionErrorFactory = factory || defaultAssertionErrorFactory;
17511
+ }
17512
+ /**
17513
+ * Asserts that the *param* value is truthy using '!' operator or throws an Error.
17514
+ * Now supports optional vararg parameters after the AssertionErrorProvider.
17515
+ */
17516
+ function assertTruthy(value, error, ...additionalData) {
17586
17517
  if (!value) {
17587
- fail(error);
17518
+ fail(error, ...additionalData);
17588
17519
  }
17589
17520
  }
17590
17521
  /**
17591
17522
  * Casts the 'value' to a non-nullable type or throws an error.
17592
17523
  * Uses 'assertTruthy' to make the check.
17524
+ * Now supports optional vararg parameters after the AssertionErrorProvider.
17593
17525
  */
17594
- function truthy(value, error) {
17595
- assertTruthy(value, error);
17526
+ function truthy(value, error, ...additionalData) {
17527
+ assertTruthy(value, error, ...additionalData);
17596
17528
  return value;
17597
17529
  }
17598
- function fail(error) {
17530
+ /**
17531
+ * Fails the assertion by throwing an error.
17532
+ * Now supports optional vararg parameters after the AssertionErrorProvider.
17533
+ */
17534
+ function fail(error, ...additionalData) {
17599
17535
  const errorMessage = getAssertionErrorFromProvider(error);
17600
17536
  if (typeof errorMessage === 'object') {
17601
17537
  throw errorMessage;
17602
17538
  }
17603
- throw new Error(errorMessage || 'Assertion error');
17539
+ throw assertionErrorFactory(errorMessage || 'Assertion error', ...additionalData);
17604
17540
  }
17605
17541
  /** Returns validation context as a string. Calls errorProvider() if needed. */
17606
17542
  function getAssertionErrorFromProvider(errorProvider) {
@@ -17706,7 +17642,7 @@ function assertRecord(value, valueAssertion, constraints = {}, errorContextProvi
17706
17642
  assertChildValue(v, valueAssertion, keyCtx);
17707
17643
  const { keyField } = constraints;
17708
17644
  if (keyField) {
17709
- assertTruthy(typeof v == 'object' && v !== null, () => `${keyCtx()} is not an object: ${(0, Formatter_1.formatValue)(v)}`);
17645
+ assertTruthy(typeof v === 'object' && v !== null, () => `${keyCtx()} is not an object: ${(0, Formatter_1.formatValue)(v)}`);
17710
17646
  const kv = v[keyField];
17711
17647
  assertTruthy(kv === k, () => `${keyCtx()} key value does not match object field '${keyField}' value: ${(0, Formatter_1.formatValue)(kv)}`);
17712
17648
  }
@@ -22514,366 +22450,6 @@ module.exports = function forEachBail(array, iterator, callback) {
22514
22450
  };
22515
22451
 
22516
22452
 
22517
- /***/ }),
22518
-
22519
- /***/ 8049:
22520
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
22521
-
22522
- "use strict";
22523
-
22524
- Object.defineProperty(exports, "__esModule", ({ value: true }));
22525
- exports.getInPath = getInPath;
22526
- exports.isDateObject = isDateObject;
22527
- exports.setInPath = setInPath;
22528
- exports.deleteInPath = deleteInPath;
22529
- exports.replaceKeyInMap = replaceKeyInMap;
22530
- exports.replaceKeyInRecord = replaceKeyInRecord;
22531
- exports.isNil = isNil;
22532
- exports.isEqual = isEqual;
22533
- exports.isEmpty = isEmpty;
22534
- exports.omit = omit;
22535
- exports.cloneDeep = cloneDeep;
22536
- exports.cloneShallow = cloneShallow;
22537
- exports.deepMerge = deepMerge;
22538
- exports.compareValues = compareValues;
22539
- exports.mapValues = mapValues;
22540
- exports.groupBy = groupBy;
22541
- exports.pick = pick;
22542
- exports.invert = invert;
22543
- exports.range = range;
22544
- const assertic_1 = __webpack_require__(5036);
22545
- const SPLIT_REGEX_FOR_GET_IN_PATH = /[.\[\]]/;
22546
- /** Returns a value by the `path`. Works with array indexes, like a.b[0]. */
22547
- function getInPath(obj, path) {
22548
- if (!obj) {
22549
- return undefined;
22550
- }
22551
- const splitPath = path.split(SPLIT_REGEX_FOR_GET_IN_PATH);
22552
- let value = undefined;
22553
- let currentObj = obj;
22554
- while (currentObj && splitPath.length) {
22555
- const key = splitPath.shift();
22556
- if (!key) {
22557
- continue;
22558
- }
22559
- if (typeof currentObj !== 'object' || !(key in currentObj)) {
22560
- return undefined;
22561
- }
22562
- value = currentObj[key];
22563
- currentObj = value;
22564
- }
22565
- return value;
22566
- }
22567
- function isJsObject(obj) {
22568
- return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
22569
- }
22570
- function isDateObject(value) {
22571
- return Object.prototype.toString.call(value) === '[object Date]';
22572
- }
22573
- /** Sets a value by path . Does not support array indexes. */
22574
- function setInPath(obj, path, value, delimiter = '.') {
22575
- const splitPath = path.split(delimiter);
22576
- let currentObj = obj;
22577
- while (splitPath.length) {
22578
- const key = (0, assertic_1.truthy)(splitPath.shift());
22579
- if (splitPath.length) {
22580
- const fieldValue = currentObj[key];
22581
- const newCurrentObj = isJsObject(fieldValue) ? (cloneShallow(fieldValue) ?? {}) : {};
22582
- currentObj[key] = newCurrentObj;
22583
- currentObj = newCurrentObj;
22584
- }
22585
- else {
22586
- currentObj[key] = value;
22587
- }
22588
- }
22589
- }
22590
- function deleteInPath(obj, path, delimiter = '.') {
22591
- const splitPath = path.split(delimiter);
22592
- let currentObj = obj;
22593
- while (splitPath.length) {
22594
- const key = (0, assertic_1.truthy)(splitPath.shift());
22595
- if (splitPath.length) {
22596
- const newCurrentObj = isJsObject(currentObj[key]) ? (cloneShallow(currentObj[key]) ?? {}) : {};
22597
- currentObj[key] = newCurrentObj;
22598
- currentObj = newCurrentObj;
22599
- }
22600
- else {
22601
- delete currentObj[key];
22602
- }
22603
- }
22604
- }
22605
- function replaceKeyInMap(map, a, b) {
22606
- if (map.has(a)) {
22607
- const value = map.get(a);
22608
- map.delete(a);
22609
- map.set(b, value);
22610
- }
22611
- }
22612
- function replaceKeyInRecord(record, a, b) {
22613
- const value = record[a];
22614
- if (typeof value !== 'undefined') {
22615
- record[b] = value;
22616
- delete record[a];
22617
- }
22618
- }
22619
- function isNil(obj) {
22620
- return obj === undefined || obj === null;
22621
- }
22622
- function isEqual(a, b) {
22623
- if (a === b)
22624
- return true;
22625
- if (a === null || b === null)
22626
- return false;
22627
- const typeOfA = typeof a;
22628
- if (typeOfA !== typeof b)
22629
- return false;
22630
- if (typeOfA !== 'object')
22631
- return a === b;
22632
- if (a instanceof Date && b instanceof Date) {
22633
- return a.getTime() === b.getTime();
22634
- }
22635
- const keysA = Object.keys(a);
22636
- const keysB = Object.keys(b);
22637
- if (keysA.length !== keysB.length)
22638
- return false;
22639
- for (const key of keysA) {
22640
- if (!keysB.includes(key) || !isEqual(a[key], b[key]))
22641
- return false;
22642
- }
22643
- return true;
22644
- }
22645
- function isEmpty(a) {
22646
- if (a === null || a === undefined) {
22647
- return true;
22648
- }
22649
- if (typeof a === 'function') {
22650
- return Object.keys(a).length === 0;
22651
- }
22652
- if (ArrayBuffer.isView(a) && !(a instanceof DataView)) {
22653
- return a.byteLength === 0;
22654
- }
22655
- if (typeof a !== 'object' && !Array.isArray(a) && typeof a !== 'string') {
22656
- return true;
22657
- }
22658
- if (Array.isArray(a) || typeof a === 'string' || (typeof a === 'object' && 'length' in a)) {
22659
- return a.length === 0;
22660
- }
22661
- if (a instanceof Map || a instanceof Set) {
22662
- return a.size === 0;
22663
- }
22664
- if (typeof a === 'object') {
22665
- return Object.keys(a).length === 0;
22666
- }
22667
- return false;
22668
- }
22669
- function omit(object, ...fieldsToRemove) {
22670
- if (object === null || object === undefined) {
22671
- return {};
22672
- }
22673
- if (fieldsToRemove.length === 0) {
22674
- return object;
22675
- }
22676
- const result = { ...object };
22677
- for (const fieldToRemove of fieldsToRemove) {
22678
- if (result.hasOwnProperty(fieldToRemove)) {
22679
- delete result[fieldToRemove];
22680
- }
22681
- }
22682
- return result;
22683
- }
22684
- function cloneDeepArray(array, customizer) {
22685
- const resultArray = new Array(array.length);
22686
- for (let i = 0; i < array.length; i++) {
22687
- resultArray[i] = cloneDeep(array[i], customizer);
22688
- }
22689
- return resultArray;
22690
- }
22691
- function copyBuffer(bufferLike) {
22692
- if (bufferLike instanceof Buffer) {
22693
- return Buffer.from(bufferLike);
22694
- }
22695
- return new bufferLike.constructor(bufferLike.buffer.slice(), bufferLike.byteOffset, bufferLike.length);
22696
- }
22697
- /**
22698
- * Creates a deep copy of the specified object, including all nested objects and specifically handling Date, Map, and
22699
- * Set fields.
22700
- *
22701
- * The customizer function can modify the cloning process for the object and its fields. If the customizer
22702
- * returns 'undefined' for any input, the function falls back to the standard cloning logic.
22703
- *
22704
- * The cloning process is recursive, ensuring deep cloning of all objects.
22705
- *
22706
- * Note: This function does not support cloning objects with circular dependencies and will throw a system stack
22707
- * overflow error if encountered.
22708
- */
22709
- function cloneDeep(value, customizer) {
22710
- // Can't use 'structuredClone' function here because it does not process prototype chains:
22711
- // array fields of the object cloned with the 'structuredClone' have prototype different from Array.prototype,
22712
- // and it cases some tests to fail.
22713
- const customized = customizer ? customizer(value) : undefined;
22714
- if (customized !== undefined)
22715
- return customized;
22716
- if (typeof value !== 'object' || value === null)
22717
- return value;
22718
- if (value instanceof Date)
22719
- return new Date(value);
22720
- if (Array.isArray(value))
22721
- return cloneDeepArray(value, customizer);
22722
- if (value instanceof Map)
22723
- return new Map(cloneDeepArray(Array.from(value), customizer));
22724
- if (value instanceof Set)
22725
- return new Set(cloneDeepArray(Array.from(value), customizer));
22726
- if (ArrayBuffer.isView(value))
22727
- return copyBuffer(value);
22728
- const result = {};
22729
- for (const k in value) {
22730
- if (!Object.hasOwnProperty.call(value, k))
22731
- continue;
22732
- result[k] = cloneDeep(value[k], customizer);
22733
- }
22734
- return result;
22735
- }
22736
- /** Creates a shallow clone of the object. */
22737
- function cloneShallow(value) {
22738
- if (typeof value !== 'object' || value === null)
22739
- return value;
22740
- if (value instanceof Date)
22741
- return new Date(value);
22742
- if (Array.isArray(value))
22743
- return [...value];
22744
- if (value instanceof Map)
22745
- return new Map(Array.from(value));
22746
- if (value instanceof Set)
22747
- return new Set(Array.from(value));
22748
- return { ...value };
22749
- }
22750
- function deepMerge(target, source) {
22751
- const output = { ...target };
22752
- for (const key in source) {
22753
- if (source.hasOwnProperty(key)) {
22754
- const sourceValue = source[key];
22755
- const targetValue = output[key];
22756
- if (isObject(sourceValue) && isObject(targetValue)) {
22757
- output[key] = deepMerge(targetValue, sourceValue);
22758
- }
22759
- else {
22760
- output[key] = sourceValue;
22761
- }
22762
- }
22763
- }
22764
- return output;
22765
- }
22766
- function isObject(item) {
22767
- return item && typeof item === 'object' && !Array.isArray(item);
22768
- }
22769
- /** Compares 2 values. 'null' and 'undefined' values are considered equal and are less than any other values. */
22770
- function compareValues(v1, v2) {
22771
- if (v1 === v2 || (isNil(v1) && isNil(v2))) {
22772
- return 0;
22773
- }
22774
- else if (isNil(v1)) {
22775
- return -1;
22776
- }
22777
- else if (isNil(v2)) {
22778
- return 1;
22779
- }
22780
- const v1Type = typeof v1;
22781
- const v2Type = typeof v2;
22782
- if (v1Type !== v2Type) {
22783
- return v1Type < v2Type ? -1 : 1;
22784
- }
22785
- if (typeof v1 === 'number') {
22786
- (0, assertic_1.assertTruthy)(typeof v2 === 'number');
22787
- if (isNaN(v1) && isNaN(v2))
22788
- return 0; // Consider NaNs as equal.
22789
- if (isNaN(v1))
22790
- return -1; // NaN is considered less than any number.
22791
- if (isNaN(v2))
22792
- return 1; // Any number is considered greater than NaN.
22793
- return v1 < v2 ? -1 : 1;
22794
- }
22795
- if (typeof v1 === 'boolean') {
22796
- (0, assertic_1.assertTruthy)(typeof v2 === 'boolean');
22797
- return v1 < v2 ? -1 : 1;
22798
- }
22799
- if (typeof v1 === 'bigint') {
22800
- (0, assertic_1.assertTruthy)(typeof v2 === 'bigint');
22801
- return v1 < v2 ? -1 : 1;
22802
- }
22803
- if (typeof v1 === 'string') {
22804
- (0, assertic_1.assertTruthy)(typeof v2 === 'string');
22805
- return v1 < v2 ? -1 : 1;
22806
- }
22807
- if (v1 instanceof Date && v2 instanceof Date) {
22808
- return Math.sign(v1.getTime() - v2.getTime());
22809
- }
22810
- return 0; // Fallback if types are not comparable.
22811
- }
22812
- /** Returns a new object with all top-level object fields re-mapped using `valueMapperFn`. */
22813
- function mapValues(obj, valueMapperFn) {
22814
- const result = {};
22815
- const keys = Object.keys(obj);
22816
- for (const key of keys) {
22817
- const value = obj[key];
22818
- result[key] = valueMapperFn(value, key, obj);
22819
- }
22820
- return result;
22821
- }
22822
- /** Groups elements of the array by key. See _.groupBy for details. */
22823
- function groupBy(array, getKey) {
22824
- return array.reduce((result, item) => {
22825
- const key = getKey(item);
22826
- if (!result[key]) {
22827
- result[key] = [item];
22828
- }
22829
- else {
22830
- result[key].push(item);
22831
- }
22832
- return result;
22833
- }, {});
22834
- }
22835
- /**
22836
- * Picks selected fields from the object and returns a new object with the fields selected.
22837
- * The selected fields are assigned by reference (there is no cloning).
22838
- */
22839
- function pick(obj, keys) {
22840
- const result = {};
22841
- for (const key of keys) {
22842
- if (key in obj) {
22843
- result[key] = obj[key];
22844
- }
22845
- }
22846
- return result;
22847
- }
22848
- /** Inverts the record: swaps keys and values. */
22849
- function invert(record) {
22850
- const inverted = {};
22851
- for (const [key, value] of Object.entries(record)) {
22852
- inverted[value] = key;
22853
- }
22854
- return inverted;
22855
- }
22856
- /**
22857
- * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
22858
- * If end is less than start a zero-length range is created unless a negative step is specified.
22859
- *
22860
- * Same as lodash range but with an additional parameter: `maximumNumberOfItems`.
22861
- */
22862
- function range(start, end, step, maximumNumberOfItems = Infinity) {
22863
- const result = [];
22864
- if (step === 0) {
22865
- throw new Error('Step cannot be zero');
22866
- }
22867
- if ((step > 0 && start >= end) || (step < 0 && start <= end)) {
22868
- return result;
22869
- }
22870
- for (let i = start; (step > 0 ? i < end : i > end) && result.length < maximumNumberOfItems; i += step) {
22871
- result.push(i);
22872
- }
22873
- return result;
22874
- }
22875
-
22876
-
22877
22453
  /***/ }),
22878
22454
 
22879
22455
  /***/ 8058:
@@ -23136,7 +22712,7 @@ function exitWithError(...messages) {
23136
22712
  /***/ ((module) => {
23137
22713
 
23138
22714
  "use strict";
23139
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.332","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.332","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.96.0","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/decompress":"^4.2.7","@types/node":"^20.16.10","terminal-link":"^3.0.0"}}');
22715
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.334","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.334","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.96.0","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/decompress":"^4.2.7","@types/node":"^20.16.10","terminal-link":"^3.0.0"}}');
23140
22716
 
23141
22717
  /***/ }),
23142
22718
 
@@ -23266,6 +22842,7 @@ const fsSync = __importStar(__webpack_require__(9896));
23266
22842
  const fs_1 = __webpack_require__(9896);
23267
22843
  const resolve_1 = __webpack_require__(412);
23268
22844
  const resolve_2 = __webpack_require__(3878);
22845
+ const tsoa_utils_1 = __webpack_require__(1431);
23269
22846
  function isEnvVarFalsy(variableName) {
23270
22847
  const value = process.env[variableName];
23271
22848
  return !value || value.toLowerCase() === 'false' || value === '0';
@@ -23277,6 +22854,10 @@ async function default_1() {
23277
22854
  if (fsSync.existsSync(distPath)) {
23278
22855
  await fs_1.promises.rm(distPath, { recursive: true, force: true });
23279
22856
  }
22857
+ await fs_1.promises.mkdir(distPath);
22858
+ const isSquidConnector = process.env['SQUID_CONNECTOR'] === 'true';
22859
+ const openApiSpecAndControllers = await tsoa_utils_1.TsoaUtils.generateAllSpecs(false, !isSquidConnector);
22860
+ await fs_1.promises.writeFile(path_1.default.join(distPath, '', 'openapi-spec-and-controllers.json'), JSON.stringify(openApiSpecAndControllers));
23280
22861
  const isUserConfigMode = fsSync.existsSync(resolve_2.USER_WEBPACK_CONFIG_PATH);
23281
22862
  const webpackConfigPath = isUserConfigMode ? resolve_2.USER_WEBPACK_CONFIG_PATH : resolve_2.BUILT_IN_WEBPACK_CONFIG_PATH;
23282
22863
  const localConfig = (0, resolve_1.requirePath)(webpackConfigPath);
@@ -23991,8 +23572,6 @@ const http_1 = __webpack_require__(866);
23991
23572
  const communication_types_1 = __webpack_require__(3443);
23992
23573
  const console_app_utils_1 = __webpack_require__(7580);
23993
23574
  const assertic_1 = __webpack_require__(5036);
23994
- const serialization_1 = __webpack_require__(1932);
23995
- const tsoa_utils_1 = __webpack_require__(1431);
23996
23575
  async function default_1(stage, appId, bundlePath, apiKey, verbose, direct, isUserSpecifiedPath, skipBuild, internalApiKey, environmentId) {
23997
23576
  if (!direct && !isUserSpecifiedPath && !skipBuild) {
23998
23577
  console.log('Building code bundle...');
@@ -24020,8 +23599,6 @@ async function default_1(stage, appId, bundlePath, apiKey, verbose, direct, isUs
24020
23599
  if (internalApiKey) {
24021
23600
  headers.append('x-squid-secret', internalApiKey);
24022
23601
  }
24023
- const openApiSpecAndControllers = await tsoa_utils_1.TsoaUtils.generateAllSpecs(verbose);
24024
- form.append('openApiSpecAndControllers', (0, serialization_1.serializeObj)(openApiSpecAndControllers));
24025
23602
  const requestOptions = { method: 'POST', body: form, headers: headers };
24026
23603
  const response = await fetch(updateCodeUrl, requestOptions);
24027
23604
  if (!response.ok) {
@@ -0,0 +1,14 @@
1
+ /** A type alias for an application id. */
2
+ export type AppId = string;
3
+ export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
4
+ export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
5
+ export type SquidDeveloperId = string;
6
+ /** A type alias for an integration id. */
7
+ export type IntegrationId = string;
8
+ export type ClientId = string;
9
+ export type SquidDocId = string;
10
+ export type ClientRequestId = string;
11
+ /** ID of AI agent. Also known as AI profile id. */
12
+ export type AiAgentId = string;
13
+ export declare const BUILT_IN_AGENT_ID = "built_in_agent";
14
+ export type AiContextId = string;
@@ -0,0 +1,4 @@
1
+ /** The list of regions in Squid. */
2
+ export declare const SQUID_REGIONS: readonly ["us-east-1.aws", "ap-south-1.aws", "us-central1.gcp"];
3
+ /** Region type used by Squid. */
4
+ export type SquidRegion = (typeof SQUID_REGIONS)[number];
@@ -0,0 +1,20 @@
1
+ import { AppId, EnvironmentId, SquidDeveloperId } from '../public-types/communication.public-types';
2
+ export type ChatId = string;
3
+ /** @internal */
4
+ export interface ParsedAppId {
5
+ appId: AppId;
6
+ environmentId: EnvironmentId;
7
+ squidDeveloperId?: SquidDeveloperId;
8
+ }
9
+ /** @internal */
10
+ export declare function parseAppId(appId: AppId): ParsedAppId;
11
+ /** @internal */
12
+ export declare function appIdWithEnvironmentId(appId: AppId, environmentId: EnvironmentId | undefined): AppId;
13
+ /** @internal */
14
+ export declare function appIdWithEnvironmentIdAndDevId(appId: AppId, environmentId: EnvironmentId | undefined, developerId: SquidDeveloperId | undefined): AppId;
15
+ /** @internal */
16
+ export declare function validateEnvironment(appId: AppId): ParsedAppId;
17
+ /** @internal */
18
+ export declare function verifyWithSquidDevId(appId: AppId): void;
19
+ /** @internal */
20
+ export declare function omitSquidDevId(appId: AppId): AppId;
@@ -0,0 +1,5 @@
1
+ /*** Console application details needed by packages other than console. */
2
+ import { Stage } from './stage';
3
+ /**
4
+ * Returns Console application Squid region for the given stage. */
5
+ export declare function getConsoleAppRegionByStage(stage: Stage): string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Stage of the Squid deployment:
3
+ * - 'local' - Squid is run locally.
4
+ * - 'dev' - Old development environment (https://dev-console.squid.cloud). Deprecated.
5
+ * - 'prod' - Production environment (https://console.getsquid.ai).
6
+ * - 'sandbox' - One of the sandbox environments (https://console.sandbox.squid.cloud).
7
+ */
8
+ export declare const STAGES: readonly ["local", "dev", "prod", "sandbox"];
9
+ export type Stage = (typeof STAGES)[number];
@@ -0,0 +1,13 @@
1
+ /** @internal */
2
+ export declare function getGlobal(): any;
3
+ /** @internal */
4
+ export declare function isDebugEnabled(): boolean;
5
+ /** @internal */
6
+ export declare function enableDebugLogs(mode?: boolean): void;
7
+ /** @internal */
8
+ export declare function disableTimestampsInLog(): void;
9
+ export declare function isTimestampEnabled(): boolean;
10
+ /** @internal */
11
+ export declare class DebugLogger {
12
+ static debug(...args: any[]): void;
13
+ }
@@ -0,0 +1 @@
1
+ export declare function getApplicationUrl(regionPrefix: string, appId: string, path: string): string;
@@ -0,0 +1,2 @@
1
+ export declare function findModulePath(moduleName: string, startDir?: string): Promise<string | null>;
2
+ export declare const requirePath: (file: string) => any;
@@ -0,0 +1,9 @@
1
+ export interface OpenApiSpecAndControllers {
2
+ openApiControllersMap: Record<string, string>;
3
+ openApiSpecsMap: Record<string, string>;
4
+ }
5
+ export declare class TsoaUtils {
6
+ constructor();
7
+ static generateAllSpecs(verbose?: boolean, supportsDefault?: boolean): Promise<OpenApiSpecAndControllers>;
8
+ private static extractTsoaName;
9
+ }
@@ -0,0 +1,5 @@
1
+ /** @internal. */
2
+ export declare function runInShell(command: string, cwd?: string): Promise<{
3
+ stdout: string;
4
+ stderr: string;
5
+ }>;
@@ -38,12 +38,21 @@ module.exports = function () {
38
38
  new CopyPlugin({
39
39
  patterns: [
40
40
  { from: 'src/public', to: 'public', noErrorOnMissing: true },
41
+ {
42
+ from: 'dist/openapi-spec-and-controllers.json',
43
+ to: '',
44
+ noErrorOnMissing: true,
45
+ },
41
46
  ],
42
47
  }),
43
48
  new ZipPlugin({
44
49
  path: path.resolve(process.cwd(), 'dist'),
45
50
  filename: 'bundle.zip',
46
- include: [/([0-9]*\.)?index.js(.map)?/, /^public\/.*$/],
51
+ include: [
52
+ /([0-9]*\.)?index.js(.map)?/,
53
+ /^public\/.*$/,
54
+ /openapi-spec-and-controllers\.json/,
55
+ ],
47
56
  }),
48
57
  ],
49
58
  module: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/cli",
3
- "version": "1.0.332",
3
+ "version": "1.0.334",
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.332",
32
+ "@squidcloud/local-backend": "^1.0.334",
33
33
  "copy-webpack-plugin": "^12.0.2",
34
34
  "decompress": "^4.2.1",
35
35
  "nodemon": "^3.1.3",