@qodalis/cli-qr 2.0.0-beta.2 → 2.0.0-beta.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qodalis/cli-qr",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.21",
4
4
  "description": "@qodalis/cli extension for generating and displaying QR codes.",
5
5
  "author": "Nicolae Lupei, Qodalis Solutions",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "umd": "./umd/index.global.js",
22
22
  "unpkg": "./umd/index.global.js",
23
23
  "dependencies": {
24
- "@qodalis/cli-core": "2.0.0-beta.2",
24
+ "@qodalis/cli-core": "2.0.0-beta.21",
25
25
  "qr-code-styling": "^1.9.1"
26
26
  },
27
27
  "cliDependencies": [
package/public-api.d.mts CHANGED
@@ -1,19 +1,19 @@
1
- import * as _qodalis_cli_core from '@qodalis/cli-core';
2
- import { ICliCommandProcessor, CliProcessorMetadata, CliProcessCommand, ICliExecutionContext, ICliModule } from '@qodalis/cli-core';
1
+ import { ICliCommandProcessor, CliProcessorMetadata, ICliConfigurationOption, CliProcessCommand, ICliExecutionContext, ICliModule } from '@qodalis/cli-core';
3
2
 
4
3
  declare class CliQrCommandProcessor implements ICliCommandProcessor {
5
4
  command: string;
6
5
  description: string;
7
- author: _qodalis_cli_core.ICliCommandAuthor;
6
+ author: any;
8
7
  version: string;
9
8
  processors?: ICliCommandProcessor[] | undefined;
10
9
  metadata?: CliProcessorMetadata | undefined;
10
+ configurationOptions?: ICliConfigurationOption[];
11
11
  constructor();
12
12
  processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
13
13
  writeDescription(context: ICliExecutionContext): void;
14
14
  }
15
15
 
16
- declare const LIBRARY_VERSION = "2.0.0-beta.2";
16
+ declare const LIBRARY_VERSION = "2.0.0-beta.21";
17
17
  declare const API_VERSION = 2;
18
18
 
19
19
  declare const qrModule: ICliModule;
package/public-api.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- import * as _qodalis_cli_core from '@qodalis/cli-core';
2
- import { ICliCommandProcessor, CliProcessorMetadata, CliProcessCommand, ICliExecutionContext, ICliModule } from '@qodalis/cli-core';
1
+ import { ICliCommandProcessor, CliProcessorMetadata, ICliConfigurationOption, CliProcessCommand, ICliExecutionContext, ICliModule } from '@qodalis/cli-core';
3
2
 
4
3
  declare class CliQrCommandProcessor implements ICliCommandProcessor {
5
4
  command: string;
6
5
  description: string;
7
- author: _qodalis_cli_core.ICliCommandAuthor;
6
+ author: any;
8
7
  version: string;
9
8
  processors?: ICliCommandProcessor[] | undefined;
10
9
  metadata?: CliProcessorMetadata | undefined;
10
+ configurationOptions?: ICliConfigurationOption[];
11
11
  constructor();
12
12
  processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
13
13
  writeDescription(context: ICliExecutionContext): void;
14
14
  }
15
15
 
16
- declare const LIBRARY_VERSION = "2.0.0-beta.2";
16
+ declare const LIBRARY_VERSION = "2.0.0-beta.21";
17
17
  declare const API_VERSION = 2;
18
18
 
19
19
  declare const qrModule: ICliModule;
package/public-api.js CHANGED
@@ -10,7 +10,7 @@ var QRCodeStyling__default = /*#__PURE__*/_interopDefault(QRCodeStyling);
10
10
  // src/lib/processors/cli-qr-command-processor.ts
11
11
 
12
12
  // src/lib/version.ts
13
- var LIBRARY_VERSION = "2.0.0-beta.2";
13
+ var LIBRARY_VERSION = "2.0.0-beta.21";
14
14
  var API_VERSION = 2;
15
15
 
16
16
  // src/lib/processors/cli-qr-command-processor.ts
@@ -25,6 +25,30 @@ var CliQrCommandProcessor = class {
25
25
  requiredCoreVersion: ">=2.0.0 <3.0.0",
26
26
  requiredCliVersion: ">=2.0.0 <3.0.0"
27
27
  };
28
+ this.configurationOptions = [
29
+ {
30
+ key: "defaultWidth",
31
+ label: "Default Width",
32
+ description: "Default QR code width in pixels",
33
+ type: "number",
34
+ defaultValue: 300,
35
+ validator: (v) => ({
36
+ valid: typeof v === "number" && v >= 50 && v <= 2e3,
37
+ message: "Must be between 50 and 2000"
38
+ })
39
+ },
40
+ {
41
+ key: "defaultHeight",
42
+ label: "Default Height",
43
+ description: "Default QR code height in pixels",
44
+ type: "number",
45
+ defaultValue: 300,
46
+ validator: (v) => ({
47
+ valid: typeof v === "number" && v >= 50 && v <= 2e3,
48
+ message: "Must be between 50 and 2000"
49
+ })
50
+ }
51
+ ];
28
52
  this.processors = [
29
53
  {
30
54
  command: "generate",
@@ -52,10 +76,13 @@ var CliQrCommandProcessor = class {
52
76
  return;
53
77
  }
54
78
  const fileName = command.args["fileName"] || "qr-code";
79
+ const width = command.args["width"] ?? cliCore.getPluginConfigValue(context, "qr", "defaultWidth", 300);
80
+ const height = command.args["height"] ?? cliCore.getPluginConfigValue(context, "qr", "defaultHeight", 300);
55
81
  try {
82
+ context.notifier.info("Generating QR code");
56
83
  const qrCode = new QRCodeStyling__default.default({
57
- width: 300,
58
- height: 300,
84
+ width,
85
+ height,
59
86
  data: text,
60
87
  type: "svg"
61
88
  });
package/public-api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../packages/plugins/qr/src/lib/version.ts","../../packages/plugins/qr/src/lib/processors/cli-qr-command-processor.ts","../../packages/plugins/qr/src/public-api.ts"],"names":["DefaultLibraryAuthor","QRCodeStyling","CliForegroundColor"],"mappings":";;;;;;;;;;;;AAEO,IAAM,eAAA,GAAkB;AACxB,IAAM,WAAA,GAAc;;;ACQpB,IAAM,wBAAN,MAA4D;AAAA,EAiB/D,WAAA,GAAc;AAhBd,IAAA,IAAA,CAAA,OAAA,GAAU,IAAA;AAEV,IAAA,IAAA,CAAA,WAAA,GACI,oHAAA;AAEJ,IAAA,IAAA,CAAA,MAAA,GAASA,4BAAA;AAET,IAAA,IAAA,CAAA,OAAA,GAAU,eAAA;AAEV,IAAA,IAAA,CAAA,UAAA,GAAkD,EAAC;AAEnD,IAAA,IAAA,CAAA,QAA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AAA,CAAO,OAAA;AAAA,MACH,6DAA6D,MAAA,CAAO,WAAA,CAAY,mBAAA,EAAqBA,0BAAA,CAAmB,KAAK,CAAC,CAAA;AAAA,KAClI;AAAA,EACJ;AACJ;;;AC5GO,IAAM,QAAA,GAAuB;AAAA,EAChC,UAAA,EAAY,WAAA;AAAA,EACZ,IAAA,EAAM,iBAAA;AAAA,EACN,UAAA,EAAY,CAAC,IAAI,qBAAA,EAAuB,CAAA;AAAA,EACxC,YAAA,EAAc;AAAA,IACV,EAAA,EAAI,EAAE,oBAAA,EAAsB,uBAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,4BAAA,EAAuB;AAAA,IACnD,EAAA,EAAI,EAAE,oBAAA,EAAsB,qBAAA,EAAsB;AAAA,IAClD,EAAA,EAAI,EAAE,oBAAA,EAAsB,qBAAA,EAAmB;AAAA,IAC/C,EAAA,EAAI,EAAE,oBAAA,EAAsB,oBAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,wCAAA,EAAW;AAAA,IACvC,EAAA,EAAI,EAAE,oBAAA,EAAsB,8BAAA,EAAW;AAAA,IACvC,EAAA,EAAI,EAAE,oBAAA,EAAsB,gCAAA,EAAQ;AAAA,IACpC,EAAA,EAAI,EAAE,oBAAA,EAAsB,0FAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,oBAAA;AAAqB;AAEzD","file":"public-api.js","sourcesContent":["\n// Automatically generated during build\nexport const LIBRARY_VERSION = '2.0.0-beta.2';\nexport const API_VERSION = 2;\n ","import {\n CliForegroundColor,\n CliProcessCommand,\n CliProcessorMetadata,\n DefaultLibraryAuthor,\n ICliCommandProcessor,\n ICliExecutionContext,\n} from '@qodalis/cli-core';\nimport QRCodeStyling from 'qr-code-styling';\nimport { LIBRARY_VERSION } from '../version';\n\nexport class CliQrCommandProcessor implements ICliCommandProcessor {\n command = 'qr';\n\n description =\n 'Provide utility functions to generate QR codes. Usage: qr generate --text \"https://example.com\" --fileName \"my-qr\"';\n\n author = DefaultLibraryAuthor;\n\n version = LIBRARY_VERSION;\n\n processors?: ICliCommandProcessor[] | undefined = [];\n\n metadata?: CliProcessorMetadata | undefined = {\n requiredCoreVersion: '>=2.0.0 <3.0.0',\n requiredCliVersion: '>=2.0.0 <3.0.0',\n };\n\n constructor() {\n this.processors = [\n {\n command: 'generate',\n description:\n 'Generate a QR code and download it as PNG. Usage: qr generate --text \"https://example.com\"',\n parameters: [\n {\n name: 'text',\n description: 'Text or URL to encode as a QR code',\n type: 'string',\n required: true,\n },\n {\n name: 'fileName',\n description: 'the file name',\n type: 'string',\n required: false,\n },\n ],\n processCommand: async (command, context) => {\n const text = command.args['text'];\n\n if (!text) {\n context.writer.writeError(\n 'Missing required parameter: --text',\n );\n return;\n }\n\n const fileName = command.args['fileName'] || 'qr-code';\n\n try {\n const qrCode = new QRCodeStyling({\n width: 300,\n height: 300,\n data: text,\n type: 'svg',\n });\n\n await qrCode.download({\n name: fileName,\n extension: 'png',\n });\n\n context.writer.writeSuccess(\n `QR Code for \"${text}\" downloaded as ${fileName}.png`,\n );\n } catch (err) {\n context.writer.writeError(\n `Failed to generate QR code: ${err}`,\n );\n }\n },\n },\n ];\n }\n\n async processCommand(\n command: CliProcessCommand,\n context: ICliExecutionContext,\n ): Promise<void> {\n context.executor.showHelp(command, context);\n }\n\n writeDescription(context: ICliExecutionContext): void {\n const { writer } = context;\n writer.writeln(\n 'Generate QR codes from text or URLs and download as PNG',\n );\n writer.writeln();\n writer.writeln('📋 Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('qr generate --text=\"<content>\"', CliForegroundColor.Cyan)}`,\n );\n writer.writeln();\n writer.writeln('⚙️ Options:');\n writer.writeln(\n ` ${writer.wrapInColor('--text', CliForegroundColor.Yellow)} Text or URL to encode (required)`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('--fileName', CliForegroundColor.Yellow)} Output filename (default: qr-code)`,\n );\n writer.writeln();\n writer.writeln('📝 Examples:');\n writer.writeln(\n ` qr generate --text=\"https://example.com\" ${writer.wrapInColor('# URL QR code', CliForegroundColor.Green)}`,\n );\n writer.writeln(\n ` qr generate --text=\"Hello!\" --fileName=\"my-qr\" ${writer.wrapInColor('# Custom filename', CliForegroundColor.Green)}`,\n );\n }\n}\n","/*\n * Public API Surface of qr\n */\n\nexport * from './lib/processors/cli-qr-command-processor';\n\nexport * from './lib/version';\n\nimport { ICliModule } from '@qodalis/cli-core';\nimport { CliQrCommandProcessor } from './lib/processors/cli-qr-command-processor';\nimport { API_VERSION } from './lib/version';\n\nexport const qrModule: ICliModule = {\n apiVersion: API_VERSION,\n name: '@qodalis/cli-qr',\n processors: [new CliQrCommandProcessor()],\n translations: {\n es: { 'cli.qr.description': 'Generar códigos QR' },\n fr: { 'cli.qr.description': 'Générer des codes QR' },\n de: { 'cli.qr.description': 'QR-Codes generieren' },\n pt: { 'cli.qr.description': 'Gerar códigos QR' },\n it: { 'cli.qr.description': 'Generare codici QR' },\n ja: { 'cli.qr.description': 'QRコードを生成' },\n ko: { 'cli.qr.description': 'QR 코드 생성' },\n zh: { 'cli.qr.description': '生成二维码' },\n ru: { 'cli.qr.description': 'Генерация QR-кодов' },\n ro: { 'cli.qr.description': 'Generare coduri QR' },\n },\n};\n"]}
1
+ {"version":3,"sources":["../../packages/plugins/qr/src/lib/version.ts","../../packages/plugins/qr/src/lib/processors/cli-qr-command-processor.ts","../../packages/plugins/qr/src/public-api.ts"],"names":["DefaultLibraryAuthor","getPluginConfigValue","QRCodeStyling","CliForegroundColor"],"mappings":";;;;;;;;;;;;AAEO,IAAM,eAAA,GAAkB;AACxB,IAAM,WAAA,GAAc;;;ACUpB,IAAM,wBAAN,MAA4D;AAAA,EA0C/D,WAAA,GAAc;AAzCd,IAAA,IAAA,CAAA,OAAA,GAAU,IAAA;AAEV,IAAA,IAAA,CAAA,WAAA,GACI,oHAAA;AAEJ,IAAA,IAAA,CAAA,MAAA,GAASA,4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;AAAA,EACJ;AACJ;;;AC1IO,IAAM,QAAA,GAAuB;AAAA,EAChC,UAAA,EAAY,WAAA;AAAA,EACZ,IAAA,EAAM,iBAAA;AAAA,EACN,UAAA,EAAY,CAAC,IAAI,qBAAA,EAAuB,CAAA;AAAA,EACxC,YAAA,EAAc;AAAA,IACV,EAAA,EAAI,EAAE,oBAAA,EAAsB,uBAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,4BAAA,EAAuB;AAAA,IACnD,EAAA,EAAI,EAAE,oBAAA,EAAsB,qBAAA,EAAsB;AAAA,IAClD,EAAA,EAAI,EAAE,oBAAA,EAAsB,qBAAA,EAAmB;AAAA,IAC/C,EAAA,EAAI,EAAE,oBAAA,EAAsB,oBAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,wCAAA,EAAW;AAAA,IACvC,EAAA,EAAI,EAAE,oBAAA,EAAsB,8BAAA,EAAW;AAAA,IACvC,EAAA,EAAI,EAAE,oBAAA,EAAsB,gCAAA,EAAQ;AAAA,IACpC,EAAA,EAAI,EAAE,oBAAA,EAAsB,0FAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,oBAAA;AAAqB;AAEzD","file":"public-api.js","sourcesContent":["\n// Automatically generated during build\nexport const LIBRARY_VERSION = '2.0.0-beta.21';\nexport const API_VERSION = 2;\n ","import {\n CliForegroundColor,\n CliProcessCommand,\n CliProcessorMetadata,\n DefaultLibraryAuthor,\n ICliCommandProcessor,\n ICliConfigurationOption,\n ICliExecutionContext,\n getPluginConfigValue,\n} from '@qodalis/cli-core';\nimport QRCodeStyling from 'qr-code-styling';\nimport { LIBRARY_VERSION } from '../version';\n\nexport class CliQrCommandProcessor implements ICliCommandProcessor {\n command = 'qr';\n\n description =\n 'Provide utility functions to generate QR codes. Usage: qr generate --text \"https://example.com\" --fileName \"my-qr\"';\n\n author = DefaultLibraryAuthor;\n\n version = LIBRARY_VERSION;\n\n processors?: ICliCommandProcessor[] | undefined = [];\n\n metadata?: CliProcessorMetadata | undefined = {\n requiredCoreVersion: '>=2.0.0 <3.0.0',\n requiredCliVersion: '>=2.0.0 <3.0.0',\n };\n\n configurationOptions?: ICliConfigurationOption[] = [\n {\n key: 'defaultWidth',\n label: 'Default Width',\n description: 'Default QR code width in pixels',\n type: 'number',\n defaultValue: 300,\n validator: (v) => ({\n valid: typeof v === 'number' && v >= 50 && v <= 2000,\n message: 'Must be between 50 and 2000',\n }),\n },\n {\n key: 'defaultHeight',\n label: 'Default Height',\n description: 'Default QR code height in pixels',\n type: 'number',\n defaultValue: 300,\n validator: (v) => ({\n valid: typeof v === 'number' && v >= 50 && v <= 2000,\n message: 'Must be between 50 and 2000',\n }),\n },\n ];\n\n constructor() {\n this.processors = [\n {\n command: 'generate',\n description:\n 'Generate a QR code and download it as PNG. Usage: qr generate --text \"https://example.com\"',\n parameters: [\n {\n name: 'text',\n description: 'Text or URL to encode as a QR code',\n type: 'string',\n required: true,\n },\n {\n name: 'fileName',\n description: 'the file name',\n type: 'string',\n required: false,\n },\n ],\n processCommand: async (command, context) => {\n const text = command.args['text'];\n\n if (!text) {\n context.writer.writeError(\n 'Missing required parameter: --text',\n );\n return;\n }\n\n const fileName = command.args['fileName'] || 'qr-code';\n const width = command.args['width'] ?? getPluginConfigValue(context, 'qr', 'defaultWidth', 300);\n const height = command.args['height'] ?? getPluginConfigValue(context, 'qr', 'defaultHeight', 300);\n\n try {\n context.notifier.info('Generating QR code');\n const qrCode = new QRCodeStyling({\n width,\n height,\n data: text,\n type: 'svg',\n });\n\n await qrCode.download({\n name: fileName,\n extension: 'png',\n });\n\n context.writer.writeSuccess(\n `QR Code for \"${text}\" downloaded as ${fileName}.png`,\n );\n } catch (err) {\n context.writer.writeError(\n `Failed to generate QR code: ${err}`,\n );\n }\n },\n },\n ];\n }\n\n async processCommand(\n command: CliProcessCommand,\n context: ICliExecutionContext,\n ): Promise<void> {\n context.executor.showHelp(command, context);\n }\n\n writeDescription(context: ICliExecutionContext): void {\n const { writer } = context;\n writer.writeln(\n 'Generate QR codes from text or URLs and download as PNG',\n );\n writer.writeln();\n writer.writeln('📋 Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('qr generate --text=\"<content>\"', CliForegroundColor.Cyan)}`,\n );\n writer.writeln();\n writer.writeln('⚙️ Options:');\n writer.writeln(\n ` ${writer.wrapInColor('--text', CliForegroundColor.Yellow)} Text or URL to encode (required)`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('--fileName', CliForegroundColor.Yellow)} Output filename (default: qr-code)`,\n );\n writer.writeln();\n writer.writeln('📝 Examples:');\n writer.writeln(\n ` qr generate --text=\"https://example.com\" ${writer.wrapInColor('# URL QR code', CliForegroundColor.Green)}`,\n );\n writer.writeln(\n ` qr generate --text=\"Hello!\" --fileName=\"my-qr\" ${writer.wrapInColor('# Custom filename', CliForegroundColor.Green)}`,\n );\n }\n}\n","/*\n * Public API Surface of qr\n */\n\nexport * from './lib/processors/cli-qr-command-processor';\n\nexport * from './lib/version';\n\nimport { ICliModule } from '@qodalis/cli-core';\nimport { CliQrCommandProcessor } from './lib/processors/cli-qr-command-processor';\nimport { API_VERSION } from './lib/version';\n\nexport const qrModule: ICliModule = {\n apiVersion: API_VERSION,\n name: '@qodalis/cli-qr',\n processors: [new CliQrCommandProcessor()],\n translations: {\n es: { 'cli.qr.description': 'Generar códigos QR' },\n fr: { 'cli.qr.description': 'Générer des codes QR' },\n de: { 'cli.qr.description': 'QR-Codes generieren' },\n pt: { 'cli.qr.description': 'Gerar códigos QR' },\n it: { 'cli.qr.description': 'Generare codici QR' },\n ja: { 'cli.qr.description': 'QRコードを生成' },\n ko: { 'cli.qr.description': 'QR 코드 생성' },\n zh: { 'cli.qr.description': '生成二维码' },\n ru: { 'cli.qr.description': 'Генерация QR-кодов' },\n ro: { 'cli.qr.description': 'Generare coduri QR' },\n },\n};\n"]}
package/public-api.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { DefaultLibraryAuthor, CliForegroundColor } from '@qodalis/cli-core';
1
+ import { DefaultLibraryAuthor, getPluginConfigValue, CliForegroundColor } from '@qodalis/cli-core';
2
2
  import QRCodeStyling from 'qr-code-styling';
3
3
 
4
4
  // src/lib/processors/cli-qr-command-processor.ts
5
5
 
6
6
  // src/lib/version.ts
7
- var LIBRARY_VERSION = "2.0.0-beta.2";
7
+ var LIBRARY_VERSION = "2.0.0-beta.21";
8
8
  var API_VERSION = 2;
9
9
 
10
10
  // src/lib/processors/cli-qr-command-processor.ts
@@ -19,6 +19,30 @@ var CliQrCommandProcessor = class {
19
19
  requiredCoreVersion: ">=2.0.0 <3.0.0",
20
20
  requiredCliVersion: ">=2.0.0 <3.0.0"
21
21
  };
22
+ this.configurationOptions = [
23
+ {
24
+ key: "defaultWidth",
25
+ label: "Default Width",
26
+ description: "Default QR code width in pixels",
27
+ type: "number",
28
+ defaultValue: 300,
29
+ validator: (v) => ({
30
+ valid: typeof v === "number" && v >= 50 && v <= 2e3,
31
+ message: "Must be between 50 and 2000"
32
+ })
33
+ },
34
+ {
35
+ key: "defaultHeight",
36
+ label: "Default Height",
37
+ description: "Default QR code height in pixels",
38
+ type: "number",
39
+ defaultValue: 300,
40
+ validator: (v) => ({
41
+ valid: typeof v === "number" && v >= 50 && v <= 2e3,
42
+ message: "Must be between 50 and 2000"
43
+ })
44
+ }
45
+ ];
22
46
  this.processors = [
23
47
  {
24
48
  command: "generate",
@@ -46,10 +70,13 @@ var CliQrCommandProcessor = class {
46
70
  return;
47
71
  }
48
72
  const fileName = command.args["fileName"] || "qr-code";
73
+ const width = command.args["width"] ?? getPluginConfigValue(context, "qr", "defaultWidth", 300);
74
+ const height = command.args["height"] ?? getPluginConfigValue(context, "qr", "defaultHeight", 300);
49
75
  try {
76
+ context.notifier.info("Generating QR code");
50
77
  const qrCode = new QRCodeStyling({
51
- width: 300,
52
- height: 300,
78
+ width,
79
+ height,
53
80
  data: text,
54
81
  type: "svg"
55
82
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../packages/plugins/qr/src/lib/version.ts","../../packages/plugins/qr/src/lib/processors/cli-qr-command-processor.ts","../../packages/plugins/qr/src/public-api.ts"],"names":[],"mappings":";;;;;;AAEO,IAAM,eAAA,GAAkB;AACxB,IAAM,WAAA,GAAc;;;ACQpB,IAAM,wBAAN,MAA4D;AAAA,EAiB/D,WAAA,GAAc;AAhBd,IAAA,IAAA,CAAA,OAAA,GAAU,IAAA;AAEV,IAAA,IAAA,CAAA,WAAA,GACI,oHAAA;AAEJ,IAAA,IAAA,CAAA,MAAA,GAAS,oBAAA;AAET,IAAA,IAAA,CAAA,OAAA,GAAU,eAAA;AAEV,IAAA,IAAA,CAAA,UAAA,GAAkD,EAAC;AAEnD,IAAA,IAAA,CAAA,QAAA,GAA8C;AAAA,MAC1C,mBAAA,EAAqB,gBAAA;AAAA,MACrB,kBAAA,EAAoB;AAAA,KACxB;AAGI,IAAA,IAAA,CAAK,UAAA,GAAa;AAAA,MACd;AAAA,QACI,OAAA,EAAS,UAAA;AAAA,QACT,WAAA,EACI,4FAAA;AAAA,QACJ,UAAA,EAAY;AAAA,UACR;AAAA,YACI,IAAA,EAAM,MAAA;AAAA,YACN,WAAA,EAAa,oCAAA;AAAA,YACb,IAAA,EAAM,QAAA;AAAA,YACN,QAAA,EAAU;AAAA,WACd;AAAA,UACA;AAAA,YACI,IAAA,EAAM,UAAA;AAAA,YACN,WAAA,EAAa,eAAA;AAAA,YACb,IAAA,EAAM,QAAA;AAAA,YACN,QAAA,EAAU;AAAA;AACd,SACJ;AAAA,QACA,cAAA,EAAgB,OAAO,OAAA,EAAS,OAAA,KAAY;AACxC,UAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAA;AAEhC,UAAA,IAAI,CAAC,IAAA,EAAM;AACP,YAAA,OAAA,CAAQ,MAAA,CAAO,UAAA;AAAA,cACX;AAAA,aACJ;AACA,YAAA;AAAA,UACJ;AAEA,UAAA,MAA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AA,EAAsB,gCAAA,EAAQ;AAAA,IACpC,EAAA,EAAI,EAAE,oBAAA,EAAsB,0FAAA,EAAqB;AAAA,IACjD,EAAA,EAAI,EAAE,oBAAA,EAAsB,oBAAA;AAAqB;AAEzD","file":"public-api.mjs","sourcesContent":["\n// Automatically generated during build\nexport const LIBRARY_VERSION = '2.0.0-beta.2';\nexport const API_VERSION = 2;\n ","import {\n CliForegroundColor,\n CliProcessCommand,\n CliProcessorMetadata,\n DefaultLibraryAuthor,\n ICliCommandProcessor,\n ICliExecutionContext,\n} from '@qodalis/cli-core';\nimport QRCodeStyling from 'qr-code-styling';\nimport { LIBRARY_VERSION } from '../version';\n\nexport class CliQrCommandProcessor implements ICliCommandProcessor {\n command = 'qr';\n\n description =\n 'Provide utility functions to generate QR codes. Usage: qr generate --text \"https://example.com\" --fileName \"my-qr\"';\n\n author = DefaultLibraryAuthor;\n\n version = LIBRARY_VERSION;\n\n processors?: ICliCommandProcessor[] | undefined = [];\n\n metadata?: CliProcessorMetadata | undefined = {\n requiredCoreVersion: '>=2.0.0 <3.0.0',\n requiredCliVersion: '>=2.0.0 <3.0.0',\n };\n\n constructor() {\n this.processors = [\n {\n command: 'generate',\n description:\n 'Generate a QR code and download it as PNG. Usage: qr generate --text \"https://example.com\"',\n parameters: [\n {\n name: 'text',\n description: 'Text or URL to encode as a QR code',\n type: 'string',\n required: true,\n },\n {\n name: 'fileName',\n description: 'the file name',\n type: 'string',\n required: false,\n },\n ],\n processCommand: async (command, context) => {\n const text = command.args['text'];\n\n if (!text) {\n context.writer.writeError(\n 'Missing required parameter: --text',\n );\n return;\n }\n\n const fileName = command.args['fileName'] || 'qr-code';\n\n try {\n const qrCode = new QRCodeStyling({\n width: 300,\n height: 300,\n data: text,\n type: 'svg',\n });\n\n await qrCode.download({\n name: fileName,\n extension: 'png',\n });\n\n context.writer.writeSuccess(\n `QR Code for \"${text}\" downloaded as ${fileName}.png`,\n );\n } catch (err) {\n context.writer.writeError(\n `Failed to generate QR code: ${err}`,\n );\n }\n },\n },\n ];\n }\n\n async processCommand(\n command: CliProcessCommand,\n context: ICliExecutionContext,\n ): Promise<void> {\n context.executor.showHelp(command, context);\n }\n\n writeDescription(context: ICliExecutionContext): void {\n const { writer } = context;\n writer.writeln(\n 'Generate QR codes from text or URLs and download as PNG',\n );\n writer.writeln();\n writer.writeln('📋 Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('qr generate --text=\"<content>\"', CliForegroundColor.Cyan)}`,\n );\n writer.writeln();\n writer.writeln('⚙️ Options:');\n writer.writeln(\n ` ${writer.wrapInColor('--text', CliForegroundColor.Yellow)} Text or URL to encode (required)`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('--fileName', CliForegroundColor.Yellow)} Output filename (default: qr-code)`,\n );\n writer.writeln();\n writer.writeln('📝 Examples:');\n writer.writeln(\n ` qr generate --text=\"https://example.com\" ${writer.wrapInColor('# URL QR code', CliForegroundColor.Green)}`,\n );\n writer.writeln(\n ` qr generate --text=\"Hello!\" --fileName=\"my-qr\" ${writer.wrapInColor('# Custom filename', CliForegroundColor.Green)}`,\n );\n }\n}\n","/*\n * Public API Surface of qr\n */\n\nexport * from './lib/processors/cli-qr-command-processor';\n\nexport * from './lib/version';\n\nimport { ICliModule } from '@qodalis/cli-core';\nimport { CliQrCommandProcessor } from './lib/processors/cli-qr-command-processor';\nimport { API_VERSION } from './lib/version';\n\nexport const qrModule: ICliModule = {\n apiVersion: API_VERSION,\n name: '@qodalis/cli-qr',\n processors: [new CliQrCommandProcessor()],\n translations: {\n es: { 'cli.qr.description': 'Generar códigos QR' },\n fr: { 'cli.qr.description': 'Générer des codes QR' },\n de: { 'cli.qr.description': 'QR-Codes generieren' },\n pt: { 'cli.qr.description': 'Gerar códigos QR' },\n it: { 'cli.qr.description': 'Generare codici QR' },\n ja: { 'cli.qr.description': 'QRコードを生成' },\n ko: { 'cli.qr.description': 'QR 코드 생성' },\n zh: { 'cli.qr.description': '生成二维码' },\n ru: { 'cli.qr.description': 'Генерация QR-кодов' },\n ro: { 'cli.qr.description': 'Generare coduri QR' },\n },\n};\n"]}
1
+ {"version":3,"sources":["../../packages/plugins/qr/src/lib/version.ts","../../packages/plugins/qr/src/lib/processors/cli-qr-command-processor.ts","../../packages/plugins/qr/src/public-api.ts"],"names":[],"mappings":";;;;;;AAEO,IAAM,eAAA,GAAkB;AACxB,IAAM,WAAA,GAAc;;;ACUpB,IAAM,wBAAN,MAA4D;AAAA,EA0C/D,WAAA,GAAc;AAzCd,IAAA,IAAA,CAAA,OAAA,GAAU,IAAA;AAEV,IAAA,IAAA,CAAA,WAAA,GACI,oHAAA;AAEJ,IAAA,IAAA,CAAA,MAAA,GAAS,oBAAA;AAET,IAAA,IAAA,CAAA,OAAA,GAAU,eAAA;AAEV,IAAA,IAAA,CAAA,UAAA,GAAkD,EAAC;AAEnD,IAAA,IAAA,CAAA,QAAA,GAA8C;AAAA,MAC1C,mBAAA,EAAqB,gBAAA;AAAA,MACrB,kBAAA,EAAoB;AAAA,KACxB;AAEA,IAAA,IAAA,CAAA,oBAAA,GAAmD;AAAA,MAC/C;AAAA,QACI,GAAA,EAAK,cAAA;AAAA,QACL,KAAA,EAAO,eAAA;AAAA,QACP,WAAA,EAAa,iCAAA;AAAA,QACb,IAAA,EAAM,QAAA;AAAA,QACN,YAAA,EAAc,GAAA;AAAA,QACd,SAAA,EAAW,CAAC,CAAA,MAAO;AAAA,UACf,OAAO,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,IAAK,MAAM,CAAA,IAAK,GAAA;AAAA,UAChD,OAAA,EAAS;AAAA,SACb;AAAA,OACJ;AAAA,MACA;AAAA,QACI,GAAA,EAAK,eAAA;AAAA,QACL,KAAA,EAAO,gBAAA;AAAA,QACP,WAAA,EAAa,kCAAA;AAAA,QACb,IAAA,EAAM,QAAA;AAAA,QACN,YAAA,EAAc,GAAA;AAAA,QACd,SAAA,EAAW,CAAC,CAAA,MAAO;AAAA,UACf,OAAO,OAAO,CAAA,KAAM,QA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during build\nexport const LIBRARY_VERSION = '2.0.0-beta.21';\nexport const API_VERSION = 2;\n ","import {\n CliForegroundColor,\n CliProcessCommand,\n CliProcessorMetadata,\n DefaultLibraryAuthor,\n ICliCommandProcessor,\n ICliConfigurationOption,\n ICliExecutionContext,\n getPluginConfigValue,\n} from '@qodalis/cli-core';\nimport QRCodeStyling from 'qr-code-styling';\nimport { LIBRARY_VERSION } from '../version';\n\nexport class CliQrCommandProcessor implements ICliCommandProcessor {\n command = 'qr';\n\n description =\n 'Provide utility functions to generate QR codes. Usage: qr generate --text \"https://example.com\" --fileName \"my-qr\"';\n\n author = DefaultLibraryAuthor;\n\n version = LIBRARY_VERSION;\n\n processors?: ICliCommandProcessor[] | undefined = [];\n\n metadata?: CliProcessorMetadata | undefined = {\n requiredCoreVersion: '>=2.0.0 <3.0.0',\n requiredCliVersion: '>=2.0.0 <3.0.0',\n };\n\n configurationOptions?: ICliConfigurationOption[] = [\n {\n key: 'defaultWidth',\n label: 'Default Width',\n description: 'Default QR code width in pixels',\n type: 'number',\n defaultValue: 300,\n validator: (v) => ({\n valid: typeof v === 'number' && v >= 50 && v <= 2000,\n message: 'Must be between 50 and 2000',\n }),\n },\n {\n key: 'defaultHeight',\n label: 'Default Height',\n description: 'Default QR code height in pixels',\n type: 'number',\n defaultValue: 300,\n validator: (v) => ({\n valid: typeof v === 'number' && v >= 50 && v <= 2000,\n message: 'Must be between 50 and 2000',\n }),\n },\n ];\n\n constructor() {\n this.processors = [\n {\n command: 'generate',\n description:\n 'Generate a QR code and download it as PNG. Usage: qr generate --text \"https://example.com\"',\n parameters: [\n {\n name: 'text',\n description: 'Text or URL to encode as a QR code',\n type: 'string',\n required: true,\n },\n {\n name: 'fileName',\n description: 'the file name',\n type: 'string',\n required: false,\n },\n ],\n processCommand: async (command, context) => {\n const text = command.args['text'];\n\n if (!text) {\n context.writer.writeError(\n 'Missing required parameter: --text',\n );\n return;\n }\n\n const fileName = command.args['fileName'] || 'qr-code';\n const width = command.args['width'] ?? getPluginConfigValue(context, 'qr', 'defaultWidth', 300);\n const height = command.args['height'] ?? getPluginConfigValue(context, 'qr', 'defaultHeight', 300);\n\n try {\n context.notifier.info('Generating QR code');\n const qrCode = new QRCodeStyling({\n width,\n height,\n data: text,\n type: 'svg',\n });\n\n await qrCode.download({\n name: fileName,\n extension: 'png',\n });\n\n context.writer.writeSuccess(\n `QR Code for \"${text}\" downloaded as ${fileName}.png`,\n );\n } catch (err) {\n context.writer.writeError(\n `Failed to generate QR code: ${err}`,\n );\n }\n },\n },\n ];\n }\n\n async processCommand(\n command: CliProcessCommand,\n context: ICliExecutionContext,\n ): Promise<void> {\n context.executor.showHelp(command, context);\n }\n\n writeDescription(context: ICliExecutionContext): void {\n const { writer } = context;\n writer.writeln(\n 'Generate QR codes from text or URLs and download as PNG',\n );\n writer.writeln();\n writer.writeln('📋 Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('qr generate --text=\"<content>\"', CliForegroundColor.Cyan)}`,\n );\n writer.writeln();\n writer.writeln('⚙️ Options:');\n writer.writeln(\n ` ${writer.wrapInColor('--text', CliForegroundColor.Yellow)} Text or URL to encode (required)`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('--fileName', CliForegroundColor.Yellow)} Output filename (default: qr-code)`,\n );\n writer.writeln();\n writer.writeln('📝 Examples:');\n writer.writeln(\n ` qr generate --text=\"https://example.com\" ${writer.wrapInColor('# URL QR code', CliForegroundColor.Green)}`,\n );\n writer.writeln(\n ` qr generate --text=\"Hello!\" --fileName=\"my-qr\" ${writer.wrapInColor('# Custom filename', CliForegroundColor.Green)}`,\n );\n }\n}\n","/*\n * Public API Surface of qr\n */\n\nexport * from './lib/processors/cli-qr-command-processor';\n\nexport * from './lib/version';\n\nimport { ICliModule } from '@qodalis/cli-core';\nimport { CliQrCommandProcessor } from './lib/processors/cli-qr-command-processor';\nimport { API_VERSION } from './lib/version';\n\nexport const qrModule: ICliModule = {\n apiVersion: API_VERSION,\n name: '@qodalis/cli-qr',\n processors: [new CliQrCommandProcessor()],\n translations: {\n es: { 'cli.qr.description': 'Generar códigos QR' },\n fr: { 'cli.qr.description': 'Générer des codes QR' },\n de: { 'cli.qr.description': 'QR-Codes generieren' },\n pt: { 'cli.qr.description': 'Gerar códigos QR' },\n it: { 'cli.qr.description': 'Generare codici QR' },\n ja: { 'cli.qr.description': 'QRコードを生成' },\n ko: { 'cli.qr.description': 'QR 코드 생성' },\n zh: { 'cli.qr.description': '生成二维码' },\n ru: { 'cli.qr.description': 'Генерация QR-кодов' },\n ro: { 'cli.qr.description': 'Generare coduri QR' },\n },\n};\n"]}
@@ -7,7 +7,11 @@ var qr = (() => {
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ try {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ } catch (e) {
13
+ throw mod = 0, e;
14
+ }
11
15
  };
12
16
  var __copyProps = (to, from, except, desc) => {
13
17
  if (from && typeof from === "object" || typeof from === "function") {
@@ -1153,7 +1157,11 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1153
1157
  var __getProtoOf2 = Object.getPrototypeOf;
1154
1158
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1155
1159
  var __commonJS2 = (cb, mod) => function __require() {
1156
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1160
+ try {
1161
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1162
+ } catch (e) {
1163
+ throw mod = 0, e;
1164
+ }
1157
1165
  };
1158
1166
  var __copyProps2 = (to, from, except, desc) => {
1159
1167
  if (from && typeof from === "object" || typeof from === "function") {
@@ -1172,7 +1180,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1172
1180
  mod
1173
1181
  ));
1174
1182
  var require_constants = __commonJS2({
1175
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js"(exports$1, module2) {
1183
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module2) {
1176
1184
  var SEMVER_SPEC_VERSION = "2.0.0";
1177
1185
  var MAX_LENGTH = 256;
1178
1186
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
@@ -1201,26 +1209,26 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1201
1209
  }
1202
1210
  });
1203
1211
  var require_debug = __commonJS2({
1204
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js"(exports$1, module2) {
1212
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module2) {
1205
1213
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
1206
1214
  };
1207
1215
  module2.exports = debug;
1208
1216
  }
1209
1217
  });
1210
1218
  var require_re = __commonJS2({
1211
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js"(exports$1, module2) {
1219
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module2) {
1212
1220
  var {
1213
1221
  MAX_SAFE_COMPONENT_LENGTH,
1214
1222
  MAX_SAFE_BUILD_LENGTH,
1215
1223
  MAX_LENGTH
1216
1224
  } = require_constants();
1217
1225
  var debug = require_debug();
1218
- exports$1 = module2.exports = {};
1219
- var re = exports$1.re = [];
1220
- var safeRe = exports$1.safeRe = [];
1221
- var src = exports$1.src = [];
1222
- var safeSrc = exports$1.safeSrc = [];
1223
- var t = exports$1.t = {};
1226
+ exports = module2.exports = {};
1227
+ var re = exports.re = [];
1228
+ var safeRe = exports.safeRe = [];
1229
+ var src = exports.src = [];
1230
+ var safeSrc = exports.safeSrc = [];
1231
+ var t = exports.t = {};
1224
1232
  var R = 0;
1225
1233
  var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
1226
1234
  var safeRegexReplacements = [
@@ -1273,18 +1281,18 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1273
1281
  createToken("COERCERTLFULL", src[t.COERCEFULL], true);
1274
1282
  createToken("LONETILDE", "(?:~>?)");
1275
1283
  createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
1276
- exports$1.tildeTrimReplace = "$1~";
1284
+ exports.tildeTrimReplace = "$1~";
1277
1285
  createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
1278
1286
  createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
1279
1287
  createToken("LONECARET", "(?:\\^)");
1280
1288
  createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
1281
- exports$1.caretTrimReplace = "$1^";
1289
+ exports.caretTrimReplace = "$1^";
1282
1290
  createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
1283
1291
  createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
1284
1292
  createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
1285
1293
  createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
1286
1294
  createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
1287
- exports$1.comparatorTrimReplace = "$1$2$3";
1295
+ exports.comparatorTrimReplace = "$1$2$3";
1288
1296
  createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
1289
1297
  createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
1290
1298
  createToken("STAR", "(<|>)?=?\\s*\\*");
@@ -1293,7 +1301,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1293
1301
  }
1294
1302
  });
1295
1303
  var require_parse_options = __commonJS2({
1296
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js"(exports$1, module2) {
1304
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module2) {
1297
1305
  var looseOption = Object.freeze({ loose: true });
1298
1306
  var emptyOpts = Object.freeze({});
1299
1307
  var parseOptions = (options) => {
@@ -1309,7 +1317,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1309
1317
  }
1310
1318
  });
1311
1319
  var require_identifiers = __commonJS2({
1312
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports$1, module2) {
1320
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module2) {
1313
1321
  var numeric = /^[0-9]+$/;
1314
1322
  var compareIdentifiers = (a, b) => {
1315
1323
  if (typeof a === "number" && typeof b === "number") {
@@ -1331,12 +1339,24 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1331
1339
  }
1332
1340
  });
1333
1341
  var require_semver = __commonJS2({
1334
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js"(exports$1, module2) {
1342
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module2) {
1335
1343
  var debug = require_debug();
1336
1344
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
1337
1345
  var { safeRe: re, t } = require_re();
1338
1346
  var parseOptions = require_parse_options();
1339
1347
  var { compareIdentifiers } = require_identifiers();
1348
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
1349
+ const identifiers = identifier.split(".");
1350
+ if (identifiers.length > prerelease.length) {
1351
+ return false;
1352
+ }
1353
+ for (let i = 0; i < identifiers.length; i++) {
1354
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
1355
+ return false;
1356
+ }
1357
+ }
1358
+ return true;
1359
+ };
1340
1360
  var SemVer = class _SemVer {
1341
1361
  constructor(version, options) {
1342
1362
  options = parseOptions(options);
@@ -1583,8 +1603,9 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1583
1603
  if (identifierBase === false) {
1584
1604
  prerelease = [identifier];
1585
1605
  }
1586
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
1587
- if (isNaN(this.prerelease[1])) {
1606
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
1607
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
1608
+ if (isNaN(prereleaseBase)) {
1588
1609
  this.prerelease = prerelease;
1589
1610
  }
1590
1611
  } else {
@@ -1607,7 +1628,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1607
1628
  }
1608
1629
  });
1609
1630
  var require_parse = __commonJS2({
1610
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(exports$1, module2) {
1631
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module2) {
1611
1632
  var SemVer = require_semver();
1612
1633
  var parse = (version, options, throwErrors = false) => {
1613
1634
  if (version instanceof SemVer) {
@@ -1626,7 +1647,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1626
1647
  }
1627
1648
  });
1628
1649
  var require_valid = __commonJS2({
1629
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(exports$1, module2) {
1650
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module2) {
1630
1651
  var parse = require_parse();
1631
1652
  var valid2 = (version, options) => {
1632
1653
  const v = parse(version, options);
@@ -1636,7 +1657,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1636
1657
  }
1637
1658
  });
1638
1659
  var require_clean = __commonJS2({
1639
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(exports$1, module2) {
1660
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module2) {
1640
1661
  var parse = require_parse();
1641
1662
  var clean = (version, options) => {
1642
1663
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
@@ -1646,7 +1667,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1646
1667
  }
1647
1668
  });
1648
1669
  var require_inc = __commonJS2({
1649
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js"(exports$1, module2) {
1670
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module2) {
1650
1671
  var SemVer = require_semver();
1651
1672
  var inc = (version, release, options, identifier, identifierBase) => {
1652
1673
  if (typeof options === "string") {
@@ -1667,7 +1688,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1667
1688
  }
1668
1689
  });
1669
1690
  var require_diff = __commonJS2({
1670
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(exports$1, module2) {
1691
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module2) {
1671
1692
  var parse = require_parse();
1672
1693
  var diff = (version1, version2) => {
1673
1694
  const v1 = parse(version1, null, true);
@@ -1708,28 +1729,28 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1708
1729
  }
1709
1730
  });
1710
1731
  var require_major = __commonJS2({
1711
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(exports$1, module2) {
1732
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module2) {
1712
1733
  var SemVer = require_semver();
1713
1734
  var major = (a, loose) => new SemVer(a, loose).major;
1714
1735
  module2.exports = major;
1715
1736
  }
1716
1737
  });
1717
1738
  var require_minor = __commonJS2({
1718
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(exports$1, module2) {
1739
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module2) {
1719
1740
  var SemVer = require_semver();
1720
1741
  var minor = (a, loose) => new SemVer(a, loose).minor;
1721
1742
  module2.exports = minor;
1722
1743
  }
1723
1744
  });
1724
1745
  var require_patch = __commonJS2({
1725
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(exports$1, module2) {
1746
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module2) {
1726
1747
  var SemVer = require_semver();
1727
1748
  var patch = (a, loose) => new SemVer(a, loose).patch;
1728
1749
  module2.exports = patch;
1729
1750
  }
1730
1751
  });
1731
1752
  var require_prerelease = __commonJS2({
1732
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(exports$1, module2) {
1753
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module2) {
1733
1754
  var parse = require_parse();
1734
1755
  var prerelease = (version, options) => {
1735
1756
  const parsed = parse(version, options);
@@ -1739,28 +1760,28 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1739
1760
  }
1740
1761
  });
1741
1762
  var require_compare = __commonJS2({
1742
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(exports$1, module2) {
1763
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module2) {
1743
1764
  var SemVer = require_semver();
1744
1765
  var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
1745
1766
  module2.exports = compare2;
1746
1767
  }
1747
1768
  });
1748
1769
  var require_rcompare = __commonJS2({
1749
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports$1, module2) {
1770
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module2) {
1750
1771
  var compare2 = require_compare();
1751
1772
  var rcompare = (a, b, loose) => compare2(b, a, loose);
1752
1773
  module2.exports = rcompare;
1753
1774
  }
1754
1775
  });
1755
1776
  var require_compare_loose = __commonJS2({
1756
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports$1, module2) {
1777
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module2) {
1757
1778
  var compare2 = require_compare();
1758
1779
  var compareLoose = (a, b) => compare2(a, b, true);
1759
1780
  module2.exports = compareLoose;
1760
1781
  }
1761
1782
  });
1762
1783
  var require_compare_build = __commonJS2({
1763
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports$1, module2) {
1784
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module2) {
1764
1785
  var SemVer = require_semver();
1765
1786
  var compareBuild = (a, b, loose) => {
1766
1787
  const versionA = new SemVer(a, loose);
@@ -1771,63 +1792,63 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1771
1792
  }
1772
1793
  });
1773
1794
  var require_sort = __commonJS2({
1774
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(exports$1, module2) {
1795
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module2) {
1775
1796
  var compareBuild = require_compare_build();
1776
- var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
1797
+ var sort = (list2, loose) => list2.sort((a, b) => compareBuild(a, b, loose));
1777
1798
  module2.exports = sort;
1778
1799
  }
1779
1800
  });
1780
1801
  var require_rsort = __commonJS2({
1781
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports$1, module2) {
1802
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module2) {
1782
1803
  var compareBuild = require_compare_build();
1783
- var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
1804
+ var rsort = (list2, loose) => list2.sort((a, b) => compareBuild(b, a, loose));
1784
1805
  module2.exports = rsort;
1785
1806
  }
1786
1807
  });
1787
1808
  var require_gt = __commonJS2({
1788
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(exports$1, module2) {
1809
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module2) {
1789
1810
  var compare2 = require_compare();
1790
1811
  var gt = (a, b, loose) => compare2(a, b, loose) > 0;
1791
1812
  module2.exports = gt;
1792
1813
  }
1793
1814
  });
1794
1815
  var require_lt = __commonJS2({
1795
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(exports$1, module2) {
1816
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module2) {
1796
1817
  var compare2 = require_compare();
1797
1818
  var lt = (a, b, loose) => compare2(a, b, loose) < 0;
1798
1819
  module2.exports = lt;
1799
1820
  }
1800
1821
  });
1801
1822
  var require_eq = __commonJS2({
1802
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(exports$1, module2) {
1823
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module2) {
1803
1824
  var compare2 = require_compare();
1804
1825
  var eq = (a, b, loose) => compare2(a, b, loose) === 0;
1805
1826
  module2.exports = eq;
1806
1827
  }
1807
1828
  });
1808
1829
  var require_neq = __commonJS2({
1809
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(exports$1, module2) {
1830
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module2) {
1810
1831
  var compare2 = require_compare();
1811
1832
  var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
1812
1833
  module2.exports = neq;
1813
1834
  }
1814
1835
  });
1815
1836
  var require_gte = __commonJS2({
1816
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports$1, module2) {
1837
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module2) {
1817
1838
  var compare2 = require_compare();
1818
1839
  var gte2 = (a, b, loose) => compare2(a, b, loose) >= 0;
1819
1840
  module2.exports = gte2;
1820
1841
  }
1821
1842
  });
1822
1843
  var require_lte = __commonJS2({
1823
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports$1, module2) {
1844
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module2) {
1824
1845
  var compare2 = require_compare();
1825
1846
  var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
1826
1847
  module2.exports = lte;
1827
1848
  }
1828
1849
  });
1829
1850
  var require_cmp = __commonJS2({
1830
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js"(exports$1, module2) {
1851
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module2) {
1831
1852
  var eq = require_eq();
1832
1853
  var neq = require_neq();
1833
1854
  var gt = require_gt();
@@ -1874,7 +1895,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1874
1895
  }
1875
1896
  });
1876
1897
  var require_coerce = __commonJS2({
1877
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports$1, module2) {
1898
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module2) {
1878
1899
  var SemVer = require_semver();
1879
1900
  var parse = require_parse();
1880
1901
  var { safeRe: re, t } = require_re();
@@ -1916,8 +1937,46 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1916
1937
  module2.exports = coerce2;
1917
1938
  }
1918
1939
  });
1940
+ var require_truncate = __commonJS2({
1941
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module2) {
1942
+ var parse = require_parse();
1943
+ var constants2 = require_constants();
1944
+ var SemVer = require_semver();
1945
+ var truncate = (version, truncation, options) => {
1946
+ if (!constants2.RELEASE_TYPES.includes(truncation)) {
1947
+ return null;
1948
+ }
1949
+ const clonedVersion = cloneInputVersion(version, options);
1950
+ return clonedVersion && doTruncation(clonedVersion, truncation);
1951
+ };
1952
+ var cloneInputVersion = (version, options) => {
1953
+ const versionStringToParse = version instanceof SemVer ? version.version : version;
1954
+ return parse(versionStringToParse, options);
1955
+ };
1956
+ var doTruncation = (version, truncation) => {
1957
+ if (isPrerelease(truncation)) {
1958
+ return version.version;
1959
+ }
1960
+ version.prerelease = [];
1961
+ switch (truncation) {
1962
+ case "major":
1963
+ version.minor = 0;
1964
+ version.patch = 0;
1965
+ break;
1966
+ case "minor":
1967
+ version.patch = 0;
1968
+ break;
1969
+ }
1970
+ return version.format();
1971
+ };
1972
+ var isPrerelease = (type) => {
1973
+ return type.startsWith("pre");
1974
+ };
1975
+ module2.exports = truncate;
1976
+ }
1977
+ });
1919
1978
  var require_lrucache = __commonJS2({
1920
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js"(exports$1, module2) {
1979
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module2) {
1921
1980
  var LRUCache = class {
1922
1981
  constructor() {
1923
1982
  this.max = 1e3;
@@ -1952,7 +2011,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
1952
2011
  }
1953
2012
  });
1954
2013
  var require_range = __commonJS2({
1955
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js"(exports$1, module2) {
2014
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module2) {
1956
2015
  var SPACE_CHARACTERS = /\s+/g;
1957
2016
  var Range = class _Range {
1958
2017
  constructor(range, options) {
@@ -2019,6 +2078,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2019
2078
  return this.range;
2020
2079
  }
2021
2080
  parseRange(range) {
2081
+ range = range.replace(BUILDSTRIPRE, "");
2022
2082
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
2023
2083
  const memoKey = memoOpts + ":" + range;
2024
2084
  const cached = cache.get(memoKey);
@@ -2101,12 +2161,14 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2101
2161
  var SemVer = require_semver();
2102
2162
  var {
2103
2163
  safeRe: re,
2164
+ src,
2104
2165
  t,
2105
2166
  comparatorTrimReplace,
2106
2167
  tildeTrimReplace,
2107
2168
  caretTrimReplace
2108
2169
  } = require_re();
2109
2170
  var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
2171
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
2110
2172
  var isNullSet = (c) => c.value === "<0.0.0-0";
2111
2173
  var isAny = (c) => c.value === "";
2112
2174
  var isSatisfiable = (comparators, options) => {
@@ -2135,20 +2197,22 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2135
2197
  return comp;
2136
2198
  };
2137
2199
  var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
2200
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
2138
2201
  var replaceTildes = (comp, options) => {
2139
2202
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
2140
2203
  };
2141
2204
  var replaceTilde = (comp, options) => {
2142
2205
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
2206
+ const z = options.includePrerelease ? "-0" : "";
2143
2207
  return comp.replace(r, (_, M, m, p, pr) => {
2144
2208
  debug("tilde", comp, _, M, m, p, pr);
2145
2209
  let ret;
2146
2210
  if (isX(M)) {
2147
2211
  ret = "";
2148
2212
  } else if (isX(m)) {
2149
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
2213
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
2150
2214
  } else if (isX(p)) {
2151
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
2215
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
2152
2216
  } else if (pr) {
2153
2217
  debug("replaceTilde pr", pr);
2154
2218
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
@@ -2194,9 +2258,9 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2194
2258
  debug("no pr");
2195
2259
  if (M === "0") {
2196
2260
  if (m === "0") {
2197
- ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
2261
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
2198
2262
  } else {
2199
- ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
2263
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
2200
2264
  }
2201
2265
  } else {
2202
2266
  ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
@@ -2215,6 +2279,9 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2215
2279
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2216
2280
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2217
2281
  debug("xRange", comp, ret, gtlt, M, m, p, pr);
2282
+ if (invalidXRangeOrder(M, m, p)) {
2283
+ return comp;
2284
+ }
2218
2285
  const xM = isX(M);
2219
2286
  const xm = xM || isX(m);
2220
2287
  const xp = xm || isX(p);
@@ -2326,7 +2393,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2326
2393
  }
2327
2394
  });
2328
2395
  var require_comparator = __commonJS2({
2329
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js"(exports$1, module2) {
2396
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module2) {
2330
2397
  var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
2331
2398
  var Comparator = class _Comparator {
2332
2399
  static get ANY() {
@@ -2436,7 +2503,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2436
2503
  }
2437
2504
  });
2438
2505
  var require_satisfies = __commonJS2({
2439
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(exports$1, module2) {
2506
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module2) {
2440
2507
  var Range = require_range();
2441
2508
  var satisfies2 = (version, range, options) => {
2442
2509
  try {
@@ -2450,14 +2517,14 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2450
2517
  }
2451
2518
  });
2452
2519
  var require_to_comparators = __commonJS2({
2453
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(exports$1, module2) {
2520
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module2) {
2454
2521
  var Range = require_range();
2455
2522
  var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
2456
2523
  module2.exports = toComparators;
2457
2524
  }
2458
2525
  });
2459
2526
  var require_max_satisfying = __commonJS2({
2460
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js"(exports$1, module2) {
2527
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module2) {
2461
2528
  var SemVer = require_semver();
2462
2529
  var Range = require_range();
2463
2530
  var maxSatisfying = (versions, range, options) => {
@@ -2483,7 +2550,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2483
2550
  }
2484
2551
  });
2485
2552
  var require_min_satisfying = __commonJS2({
2486
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js"(exports$1, module2) {
2553
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module2) {
2487
2554
  var SemVer = require_semver();
2488
2555
  var Range = require_range();
2489
2556
  var minSatisfying = (versions, range, options) => {
@@ -2509,7 +2576,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2509
2576
  }
2510
2577
  });
2511
2578
  var require_min_version = __commonJS2({
2512
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js"(exports$1, module2) {
2579
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module2) {
2513
2580
  var SemVer = require_semver();
2514
2581
  var Range = require_range();
2515
2582
  var gt = require_gt();
@@ -2565,7 +2632,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2565
2632
  }
2566
2633
  });
2567
2634
  var require_valid2 = __commonJS2({
2568
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js"(exports$1, module2) {
2635
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module2) {
2569
2636
  var Range = require_range();
2570
2637
  var validRange = (range, options) => {
2571
2638
  try {
@@ -2578,7 +2645,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2578
2645
  }
2579
2646
  });
2580
2647
  var require_outside = __commonJS2({
2581
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js"(exports$1, module2) {
2648
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module2) {
2582
2649
  var SemVer = require_semver();
2583
2650
  var Comparator = require_comparator();
2584
2651
  var { ANY } = Comparator;
@@ -2644,21 +2711,21 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2644
2711
  }
2645
2712
  });
2646
2713
  var require_gtr = __commonJS2({
2647
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js"(exports$1, module2) {
2714
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module2) {
2648
2715
  var outside = require_outside();
2649
2716
  var gtr = (version, range, options) => outside(version, range, ">", options);
2650
2717
  module2.exports = gtr;
2651
2718
  }
2652
2719
  });
2653
2720
  var require_ltr = __commonJS2({
2654
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js"(exports$1, module2) {
2721
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module2) {
2655
2722
  var outside = require_outside();
2656
2723
  var ltr = (version, range, options) => outside(version, range, "<", options);
2657
2724
  module2.exports = ltr;
2658
2725
  }
2659
2726
  });
2660
2727
  var require_intersects = __commonJS2({
2661
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js"(exports$1, module2) {
2728
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module2) {
2662
2729
  var Range = require_range();
2663
2730
  var intersects = (r1, r2, options) => {
2664
2731
  r1 = new Range(r1, options);
@@ -2669,7 +2736,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2669
2736
  }
2670
2737
  });
2671
2738
  var require_simplify = __commonJS2({
2672
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js"(exports$1, module2) {
2739
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module2) {
2673
2740
  var satisfies2 = require_satisfies();
2674
2741
  var compare2 = require_compare();
2675
2742
  module2.exports = (versions, range, options) => {
@@ -2716,7 +2783,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2716
2783
  }
2717
2784
  });
2718
2785
  var require_subset = __commonJS2({
2719
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js"(exports$1, module2) {
2786
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module2) {
2720
2787
  var Range = require_range();
2721
2788
  var Comparator = require_comparator();
2722
2789
  var { ANY } = Comparator;
@@ -2823,7 +2890,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2823
2890
  if (higher === c && higher !== gt) {
2824
2891
  return false;
2825
2892
  }
2826
- } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) {
2893
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) {
2827
2894
  return false;
2828
2895
  }
2829
2896
  }
@@ -2838,7 +2905,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2838
2905
  if (lower === c && lower !== lt) {
2839
2906
  return false;
2840
2907
  }
2841
- } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) {
2908
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) {
2842
2909
  return false;
2843
2910
  }
2844
2911
  }
@@ -2875,7 +2942,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2875
2942
  }
2876
2943
  });
2877
2944
  var require_semver2 = __commonJS2({
2878
- "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(exports$1, module2) {
2945
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module2) {
2879
2946
  var internalRe = require_re();
2880
2947
  var constants2 = require_constants();
2881
2948
  var SemVer = require_semver();
@@ -2903,6 +2970,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2903
2970
  var lte = require_lte();
2904
2971
  var cmp = require_cmp();
2905
2972
  var coerce2 = require_coerce();
2973
+ var truncate = require_truncate();
2906
2974
  var Comparator = require_comparator();
2907
2975
  var Range = require_range();
2908
2976
  var satisfies2 = require_satisfies();
@@ -2941,6 +3009,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2941
3009
  lte,
2942
3010
  cmp,
2943
3011
  coerce: coerce2,
3012
+ truncate,
2944
3013
  Comparator,
2945
3014
  Range,
2946
3015
  satisfies: satisfies2,
@@ -2978,14 +3047,70 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
2978
3047
  CliForegroundColor2["Reset"] = "\x1B[0m";
2979
3048
  return CliForegroundColor2;
2980
3049
  })(CliForegroundColor || {});
3050
+ function createCliToken(name) {
3051
+ return name;
3052
+ }
3053
+ var ICliUserSessionService_TOKEN = createCliToken("cli-user-session-service");
3054
+ var ICliUsersStoreService_TOKEN = createCliToken("cli-users-store-service");
3055
+ var ICliGroupsStoreService_TOKEN = createCliToken("cli-groups-store-service");
3056
+ var ICliAuthService_TOKEN = createCliToken("cli-auth-service");
3057
+ var ICliCompletionProvider_TOKEN = createCliToken("cli-completion-provider");
3058
+ var ICliDragDropService_TOKEN = createCliToken("cli-drag-drop-service");
3059
+ var ICliFileTransferService_TOKEN = createCliToken("cli-file-transfer-service");
3060
+ var ICliTranslationService_TOKEN = createCliToken("cli-translation-service");
3061
+ var ICliPermissionService_TOKEN = createCliToken("cli-permission-service");
3062
+ var ICliFilePickerProvider_TOKEN = createCliToken("cli-file-picker-provider");
3063
+ var ICliHttpClient_TOKEN = createCliToken("cli-http-client");
3064
+ var ICliUserEventService_TOKEN = createCliToken("cli-user-event-service");
3065
+ var ICliAuditService_TOKEN = createCliToken("cli-audit-service");
3066
+ var ICliAuthorizationService_TOKEN = createCliToken("cli-authorization-service");
3067
+ var ICliPermissionRegistry_TOKEN = createCliToken("cli-permission-registry");
3068
+ var ICliSessionsService_TOKEN = createCliToken("cli-sessions-service");
3069
+ var ICliKeyValueStore_TOKEN = createCliToken("cli-key-value-store");
3070
+ var ICliServerAuthTokenProvider_TOKEN = createCliToken("cli-server-auth-token-provider");
3071
+ var ICliServerAuthService_TOKEN = createCliToken("cli-server-auth-service");
3072
+ var ICliServerManager_TOKEN = createCliToken("cli-server-manager");
3073
+ function resolveHeaders(provider) {
3074
+ if (!provider) return {};
3075
+ return typeof provider === "function" ? provider() : provider;
3076
+ }
3077
+ var ICliCommandGuard_TOKEN = createCliToken("cli-command-guard");
3078
+ var ICliEventBus_TOKEN = createCliToken("cli-event-bus");
2981
3079
  var DefaultLibraryAuthor = {
2982
3080
  name: "Nicolae Lupei",
2983
3081
  email: "nicolae.lupei@qodalis.com"
2984
3082
  };
3083
+ var CLI_CONFIGURE_STORE_NAME = "configure";
3084
+ function getConfigValue(state, category, key, defaultValue) {
3085
+ try {
3086
+ const s = state.getState();
3087
+ const bucket = category === "system" ? s?.["system"] : s?.["plugins"]?.[category];
3088
+ if (bucket && key in bucket) {
3089
+ return bucket[key];
3090
+ }
3091
+ } catch {
3092
+ }
3093
+ return defaultValue;
3094
+ }
3095
+ function getPluginConfigValue(context, category, key, defaultValue) {
3096
+ try {
3097
+ const storeManager = context.services.getRequired(
3098
+ "cli-state-store-manager"
3099
+ );
3100
+ if (!storeManager) return defaultValue;
3101
+ const store = storeManager.getStateStore(CLI_CONFIGURE_STORE_NAME);
3102
+ if (!store) return defaultValue;
3103
+ return getConfigValue(store, category, key, defaultValue);
3104
+ } catch {
3105
+ return defaultValue;
3106
+ }
3107
+ }
2985
3108
  var semver = __toESM2(require_semver2());
3109
+ var API_VERSION = 2;
3110
+ var VERSIONS_ENDPOINT = "/api/qcli/versions";
2986
3111
  var ServerVersionNegotiator = class {
2987
3112
  static {
2988
- this.CLIENT_SUPPORTED_VERSIONS = [2];
3113
+ this.CLIENT_SUPPORTED_VERSIONS = [API_VERSION];
2989
3114
  }
2990
3115
  /**
2991
3116
  * Given a server's version info, pick the highest mutually compatible version.
@@ -3002,16 +3127,25 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
3002
3127
  * Returns the negotiated API version and the base path for all subsequent calls,
3003
3128
  * or null if the server is unreachable or incompatible.
3004
3129
  */
3005
- static async discover(baseUrl) {
3130
+ static async discover(baseUrl, headers, options) {
3131
+ let response;
3132
+ try {
3133
+ const resolved = resolveHeaders(headers);
3134
+ response = await fetch(`${baseUrl}${VERSIONS_ENDPOINT}`, {
3135
+ headers: Object.keys(resolved).length > 0 ? resolved : void 0
3136
+ });
3137
+ } catch (e) {
3138
+ if (options?.rethrowNetworkErrors) throw e;
3139
+ return null;
3140
+ }
3006
3141
  try {
3007
- const response = await fetch(`${baseUrl}/api/cli/versions`);
3008
3142
  if (!response.ok) return null;
3009
3143
  const info = await response.json();
3010
3144
  const version = this.negotiate(info);
3011
3145
  if (version === null) return null;
3012
3146
  return {
3013
3147
  apiVersion: version,
3014
- basePath: `${baseUrl}/api/v${version}/cli`
3148
+ basePath: `${baseUrl}/api/v${version}/qcli`
3015
3149
  };
3016
3150
  } catch {
3017
3151
  return null;
@@ -3839,8 +3973,8 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
3839
3973
  var import_qr_code_styling = __toESM(require_qr_code_styling());
3840
3974
 
3841
3975
  // src/lib/version.ts
3842
- var LIBRARY_VERSION = "2.0.0-beta.2";
3843
- var API_VERSION = 2;
3976
+ var LIBRARY_VERSION = "2.0.0-beta.21";
3977
+ var API_VERSION2 = 2;
3844
3978
 
3845
3979
  // src/lib/processors/cli-qr-command-processor.ts
3846
3980
  var CliQrCommandProcessor = class {
@@ -3854,6 +3988,30 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
3854
3988
  requiredCoreVersion: ">=2.0.0 <3.0.0",
3855
3989
  requiredCliVersion: ">=2.0.0 <3.0.0"
3856
3990
  };
3991
+ this.configurationOptions = [
3992
+ {
3993
+ key: "defaultWidth",
3994
+ label: "Default Width",
3995
+ description: "Default QR code width in pixels",
3996
+ type: "number",
3997
+ defaultValue: 300,
3998
+ validator: (v) => ({
3999
+ valid: typeof v === "number" && v >= 50 && v <= 2e3,
4000
+ message: "Must be between 50 and 2000"
4001
+ })
4002
+ },
4003
+ {
4004
+ key: "defaultHeight",
4005
+ label: "Default Height",
4006
+ description: "Default QR code height in pixels",
4007
+ type: "number",
4008
+ defaultValue: 300,
4009
+ validator: (v) => ({
4010
+ valid: typeof v === "number" && v >= 50 && v <= 2e3,
4011
+ message: "Must be between 50 and 2000"
4012
+ })
4013
+ }
4014
+ ];
3857
4015
  this.processors = [
3858
4016
  {
3859
4017
  command: "generate",
@@ -3881,10 +4039,13 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
3881
4039
  return;
3882
4040
  }
3883
4041
  const fileName = command.args["fileName"] || "qr-code";
4042
+ const width = command.args["width"] ?? getPluginConfigValue(context, "qr", "defaultWidth", 300);
4043
+ const height = command.args["height"] ?? getPluginConfigValue(context, "qr", "defaultHeight", 300);
3884
4044
  try {
4045
+ context.notifier.info("Generating QR code");
3885
4046
  const qrCode = new import_qr_code_styling.default({
3886
- width: 300,
3887
- height: 300,
4047
+ width,
4048
+ height,
3888
4049
  data: text,
3889
4050
  type: "svg"
3890
4051
  });
@@ -3938,7 +4099,7 @@ ${new this._window.XMLSerializer().serializeToString(e3)}`;
3938
4099
 
3939
4100
  // src/cli-entrypoint.ts
3940
4101
  var module = {
3941
- apiVersion: API_VERSION,
4102
+ apiVersion: API_VERSION2,
3942
4103
  name: "@qodalis/cli-qr",
3943
4104
  processors: [new CliQrCommandProcessor()]
3944
4105
  };