qumra-cli 2.4.2 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +150 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -66,6 +66,7 @@ var require$$1$e = require('node:console');
66
66
  var require$$2$d = require('node:timers');
67
67
  var require$$1$f = require('node:dns');
68
68
  var require$$2$e = require('timers');
69
+ var figlet = require('figlet');
69
70
  var require$$6$4 = require('inspector');
70
71
  var v8 = require('v8');
71
72
  var require$$2$f = require('node:https');
@@ -304365,8 +304366,13 @@ class SectionBuilder {
304365
304366
  }
304366
304367
  }
304367
304368
 
304369
+ var version$2 = "2.4.4";
304370
+ var pkg = {
304371
+ version: version$2};
304372
+
304373
+ // @ts-ignore - imported via rollup json plugin
304368
304374
  const APP_NAME = 'qumra';
304369
- const APP_VERSION = '2.1.1';
304375
+ const APP_VERSION = pkg.version;
304370
304376
  const CLI_VERSION = APP_VERSION;
304371
304377
  const API_ENDPOINT = 'https://api.qumra.cloud/graphql';
304372
304378
  const REALTIME_ENDPOINT = 'wss://realtime.qumra.cloud';
@@ -359863,11 +359869,15 @@ let ThemeWatcherService = class ThemeWatcherService {
359863
359869
  await this.handleAssetFile(appThemeId, filePath, 'upsert');
359864
359870
  break;
359865
359871
  case 'layouts':
359866
- case 'templates':
359867
359872
  case 'ui':
359868
359873
  case 'locales':
359869
359874
  await this.uploadFileToServer(appThemeId, filePath, 'upsert');
359870
359875
  break;
359876
+ case 'templates':
359877
+ if (ext === '.json') {
359878
+ await this.syncThemeTemplate(appThemeId, filePath, 'upsert');
359879
+ }
359880
+ break;
359871
359881
  case 'pages':
359872
359882
  if (ext === '.json') {
359873
359883
  await this.syncThemePage(appThemeId, filePath, 'upsert');
@@ -359957,11 +359967,15 @@ let ThemeWatcherService = class ThemeWatcherService {
359957
359967
  await this.handleAssetFile(appThemeId, filePath, event);
359958
359968
  break;
359959
359969
  case 'layouts':
359960
- case 'templates':
359961
359970
  case 'ui':
359962
359971
  case 'locales':
359963
359972
  await this.uploadFileToServer(appThemeId, filePath, event);
359964
359973
  break;
359974
+ case 'templates':
359975
+ if (ext === '.json') {
359976
+ await this.syncThemeTemplate(appThemeId, filePath, event);
359977
+ }
359978
+ break;
359965
359979
  case 'pages':
359966
359980
  if (ext === '.json') {
359967
359981
  await this.syncThemePage(appThemeId, filePath, event);
@@ -360182,6 +360196,41 @@ let ThemeWatcherService = class ThemeWatcherService {
360182
360196
  }
360183
360197
  await this.graphql.request(mutation, variables);
360184
360198
  }
360199
+ // Templates (.json) → GraphQL SyncThemeTemplate
360200
+ async syncThemeTemplate(appThemeId, filePath, event) {
360201
+ const qumraConfig = await this.config.load();
360202
+ if (!(qumraConfig === null || qumraConfig === void 0 ? void 0 : qumraConfig.themeId) || !(qumraConfig === null || qumraConfig === void 0 ? void 0 : qumraConfig.version)) {
360203
+ throw new Error('themeId or version missing in config');
360204
+ }
360205
+ const mutation = `
360206
+ mutation SyncThemeTemplate($input: SyncThemeTemplateInput!) {
360207
+ syncThemeTemplate(input: $input) {
360208
+ success
360209
+ message
360210
+ }
360211
+ }
360212
+ `;
360213
+ const templateKey = path__namespace.basename(filePath, '.json');
360214
+ const variables = {
360215
+ input: {
360216
+ themeId: qumraConfig.themeId,
360217
+ version: qumraConfig.version,
360218
+ appThemeId,
360219
+ key: templateKey,
360220
+ type: event,
360221
+ },
360222
+ };
360223
+ if (event !== 'delete') {
360224
+ const rawContent = fs__namespace.readFileSync(filePath, 'utf-8');
360225
+ const parsedContent = JSON.parse(rawContent);
360226
+ variables.input.title = parsedContent.title || '';
360227
+ variables.input.allowAdd = parsedContent.allowAdd;
360228
+ variables.input.allowRemove = parsedContent.allowRemove;
360229
+ variables.input.allowReorder = parsedContent.allowReorder;
360230
+ variables.input.widgets = parsedContent.widgets || [];
360231
+ }
360232
+ await this.graphql.request(mutation, { input: variables.input });
360233
+ }
360185
360234
  getFolderFromPath(filePath) {
360186
360235
  const rootDir = process.cwd();
360187
360236
  const relativePath = path__namespace.relative(rootDir, filePath);
@@ -531686,6 +531735,45 @@ ThemeMajorCommand = __decorate$5([
531686
531735
  src$6.SubCommand({ name: 'major', description: 'Increment major version' }),
531687
531736
  __metadata$2("design:paramtypes", [ThemeService])
531688
531737
  ], ThemeMajorCommand);
531738
+ let ThemeUnpatchCommand = class ThemeUnpatchCommand extends src$6.CommandRunner {
531739
+ constructor(themeService) {
531740
+ super();
531741
+ this.themeService = themeService;
531742
+ }
531743
+ async run() {
531744
+ this.themeService.changeVersion('patch', false);
531745
+ }
531746
+ };
531747
+ ThemeUnpatchCommand = __decorate$5([
531748
+ src$6.SubCommand({ name: 'unpatch', description: 'Decrement patch version' }),
531749
+ __metadata$2("design:paramtypes", [ThemeService])
531750
+ ], ThemeUnpatchCommand);
531751
+ let ThemeUnminorCommand = class ThemeUnminorCommand extends src$6.CommandRunner {
531752
+ constructor(themeService) {
531753
+ super();
531754
+ this.themeService = themeService;
531755
+ }
531756
+ async run() {
531757
+ this.themeService.changeVersion('minor', false);
531758
+ }
531759
+ };
531760
+ ThemeUnminorCommand = __decorate$5([
531761
+ src$6.SubCommand({ name: 'unminor', description: 'Decrement minor version' }),
531762
+ __metadata$2("design:paramtypes", [ThemeService])
531763
+ ], ThemeUnminorCommand);
531764
+ let ThemeUnmajorCommand = class ThemeUnmajorCommand extends src$6.CommandRunner {
531765
+ constructor(themeService) {
531766
+ super();
531767
+ this.themeService = themeService;
531768
+ }
531769
+ async run() {
531770
+ this.themeService.changeVersion('major', false);
531771
+ }
531772
+ };
531773
+ ThemeUnmajorCommand = __decorate$5([
531774
+ src$6.SubCommand({ name: 'unmajor', description: 'Decrement major version' }),
531775
+ __metadata$2("design:paramtypes", [ThemeService])
531776
+ ], ThemeUnmajorCommand);
531689
531777
 
531690
531778
  let ThemeCommand = class ThemeCommand extends src$6.CommandRunner {
531691
531779
  async run() {
@@ -531704,6 +531792,9 @@ ThemeCommand = __decorate$5([
531704
531792
  ThemePatchCommand,
531705
531793
  ThemeMinorCommand,
531706
531794
  ThemeMajorCommand,
531795
+ ThemeUnpatchCommand,
531796
+ ThemeUnminorCommand,
531797
+ ThemeUnmajorCommand,
531707
531798
  ],
531708
531799
  })
531709
531800
  ], ThemeCommand);
@@ -531876,6 +531967,9 @@ ThemeModule = __decorate$5([
531876
531967
  ThemePatchCommand,
531877
531968
  ThemeMinorCommand,
531878
531969
  ThemeMajorCommand,
531970
+ ThemeUnpatchCommand,
531971
+ ThemeUnminorCommand,
531972
+ ThemeUnmajorCommand,
531879
531973
  // Services
531880
531974
  ThemeService,
531881
531975
  ThemeApiService,
@@ -532686,6 +532780,58 @@ GenerateModule = __decorate$5([
532686
532780
  })
532687
532781
  ], GenerateModule);
532688
532782
 
532783
+ let StatusCommand = class StatusCommand extends src$6.CommandRunner {
532784
+ constructor(auth) {
532785
+ super();
532786
+ this.auth = auth;
532787
+ }
532788
+ async run() {
532789
+ // Display Qumra Cloud logo
532790
+ const logo = figlet.textSync('Qumra Cloud', {
532791
+ font: 'Standard',
532792
+ horizontalLayout: 'default',
532793
+ });
532794
+ console.log(chalk.cyan(logo));
532795
+ console.log();
532796
+ // Display version
532797
+ console.log(chalk.bold(' CLI Version:'), chalk.green(`v${CLI_VERSION}`));
532798
+ console.log();
532799
+ // Display user info
532800
+ const user = await this.auth.getUser();
532801
+ if (user) {
532802
+ console.log(chalk.bold(' Status:'), chalk.green('Logged in'));
532803
+ if (user.name) {
532804
+ console.log(chalk.bold(' User:'), chalk.white(user.name));
532805
+ }
532806
+ if (user.email) {
532807
+ console.log(chalk.bold(' Email:'), chalk.white(user.email));
532808
+ }
532809
+ }
532810
+ else {
532811
+ console.log(chalk.bold(' Status:'), chalk.yellow('Not logged in'));
532812
+ console.log(chalk.dim(' Run `qumra login` to authenticate'));
532813
+ }
532814
+ console.log();
532815
+ console.log(chalk.dim(' https://qumra.cloud'));
532816
+ console.log();
532817
+ }
532818
+ };
532819
+ StatusCommand = __decorate$5([
532820
+ src$6.Command({
532821
+ name: 'status',
532822
+ description: 'Show Qumra CLI status and information',
532823
+ }),
532824
+ __metadata$2("design:paramtypes", [AuthService])
532825
+ ], StatusCommand);
532826
+
532827
+ let StatusModule = class StatusModule {
532828
+ };
532829
+ StatusModule = __decorate$5([
532830
+ commonExports.Module({
532831
+ providers: [StatusCommand],
532832
+ })
532833
+ ], StatusModule);
532834
+
532689
532835
  let AppModule = class AppModule {
532690
532836
  };
532691
532837
  AppModule = __decorate$5([
@@ -532696,6 +532842,7 @@ AppModule = __decorate$5([
532696
532842
  ThemeModule,
532697
532843
  AppModule$1,
532698
532844
  GenerateModule,
532845
+ StatusModule,
532699
532846
  ],
532700
532847
  })
532701
532848
  ], AppModule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-cli",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "Professional CLI tool for Qumra Cloud - Shopify competitor",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {