qumra-cli 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +144 -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');
|
|
@@ -359863,11 +359864,15 @@ let ThemeWatcherService = class ThemeWatcherService {
|
|
|
359863
359864
|
await this.handleAssetFile(appThemeId, filePath, 'upsert');
|
|
359864
359865
|
break;
|
|
359865
359866
|
case 'layouts':
|
|
359866
|
-
case 'templates':
|
|
359867
359867
|
case 'ui':
|
|
359868
359868
|
case 'locales':
|
|
359869
359869
|
await this.uploadFileToServer(appThemeId, filePath, 'upsert');
|
|
359870
359870
|
break;
|
|
359871
|
+
case 'templates':
|
|
359872
|
+
if (ext === '.json') {
|
|
359873
|
+
await this.syncThemeTemplate(appThemeId, filePath, 'upsert');
|
|
359874
|
+
}
|
|
359875
|
+
break;
|
|
359871
359876
|
case 'pages':
|
|
359872
359877
|
if (ext === '.json') {
|
|
359873
359878
|
await this.syncThemePage(appThemeId, filePath, 'upsert');
|
|
@@ -359957,11 +359962,15 @@ let ThemeWatcherService = class ThemeWatcherService {
|
|
|
359957
359962
|
await this.handleAssetFile(appThemeId, filePath, event);
|
|
359958
359963
|
break;
|
|
359959
359964
|
case 'layouts':
|
|
359960
|
-
case 'templates':
|
|
359961
359965
|
case 'ui':
|
|
359962
359966
|
case 'locales':
|
|
359963
359967
|
await this.uploadFileToServer(appThemeId, filePath, event);
|
|
359964
359968
|
break;
|
|
359969
|
+
case 'templates':
|
|
359970
|
+
if (ext === '.json') {
|
|
359971
|
+
await this.syncThemeTemplate(appThemeId, filePath, event);
|
|
359972
|
+
}
|
|
359973
|
+
break;
|
|
359965
359974
|
case 'pages':
|
|
359966
359975
|
if (ext === '.json') {
|
|
359967
359976
|
await this.syncThemePage(appThemeId, filePath, event);
|
|
@@ -360182,6 +360191,41 @@ let ThemeWatcherService = class ThemeWatcherService {
|
|
|
360182
360191
|
}
|
|
360183
360192
|
await this.graphql.request(mutation, variables);
|
|
360184
360193
|
}
|
|
360194
|
+
// Templates (.json) → GraphQL SyncThemeTemplate
|
|
360195
|
+
async syncThemeTemplate(appThemeId, filePath, event) {
|
|
360196
|
+
const qumraConfig = await this.config.load();
|
|
360197
|
+
if (!(qumraConfig === null || qumraConfig === void 0 ? void 0 : qumraConfig.themeId) || !(qumraConfig === null || qumraConfig === void 0 ? void 0 : qumraConfig.version)) {
|
|
360198
|
+
throw new Error('themeId or version missing in config');
|
|
360199
|
+
}
|
|
360200
|
+
const mutation = `
|
|
360201
|
+
mutation SyncThemeTemplate($input: SyncThemeTemplateInput!) {
|
|
360202
|
+
syncThemeTemplate(input: $input) {
|
|
360203
|
+
success
|
|
360204
|
+
message
|
|
360205
|
+
}
|
|
360206
|
+
}
|
|
360207
|
+
`;
|
|
360208
|
+
const templateKey = path__namespace.basename(filePath, '.json');
|
|
360209
|
+
const variables = {
|
|
360210
|
+
input: {
|
|
360211
|
+
themeId: qumraConfig.themeId,
|
|
360212
|
+
version: qumraConfig.version,
|
|
360213
|
+
appThemeId,
|
|
360214
|
+
key: templateKey,
|
|
360215
|
+
type: event,
|
|
360216
|
+
},
|
|
360217
|
+
};
|
|
360218
|
+
if (event !== 'delete') {
|
|
360219
|
+
const rawContent = fs__namespace.readFileSync(filePath, 'utf-8');
|
|
360220
|
+
const parsedContent = JSON.parse(rawContent);
|
|
360221
|
+
variables.input.title = parsedContent.title || '';
|
|
360222
|
+
variables.input.allowAdd = parsedContent.allowAdd;
|
|
360223
|
+
variables.input.allowRemove = parsedContent.allowRemove;
|
|
360224
|
+
variables.input.allowReorder = parsedContent.allowReorder;
|
|
360225
|
+
variables.input.widgets = parsedContent.widgets || [];
|
|
360226
|
+
}
|
|
360227
|
+
await this.graphql.request(mutation, { input: variables.input });
|
|
360228
|
+
}
|
|
360185
360229
|
getFolderFromPath(filePath) {
|
|
360186
360230
|
const rootDir = process.cwd();
|
|
360187
360231
|
const relativePath = path__namespace.relative(rootDir, filePath);
|
|
@@ -531686,6 +531730,45 @@ ThemeMajorCommand = __decorate$5([
|
|
|
531686
531730
|
src$6.SubCommand({ name: 'major', description: 'Increment major version' }),
|
|
531687
531731
|
__metadata$2("design:paramtypes", [ThemeService])
|
|
531688
531732
|
], ThemeMajorCommand);
|
|
531733
|
+
let ThemeUnpatchCommand = class ThemeUnpatchCommand extends src$6.CommandRunner {
|
|
531734
|
+
constructor(themeService) {
|
|
531735
|
+
super();
|
|
531736
|
+
this.themeService = themeService;
|
|
531737
|
+
}
|
|
531738
|
+
async run() {
|
|
531739
|
+
this.themeService.changeVersion('patch', false);
|
|
531740
|
+
}
|
|
531741
|
+
};
|
|
531742
|
+
ThemeUnpatchCommand = __decorate$5([
|
|
531743
|
+
src$6.SubCommand({ name: 'unpatch', description: 'Decrement patch version' }),
|
|
531744
|
+
__metadata$2("design:paramtypes", [ThemeService])
|
|
531745
|
+
], ThemeUnpatchCommand);
|
|
531746
|
+
let ThemeUnminorCommand = class ThemeUnminorCommand extends src$6.CommandRunner {
|
|
531747
|
+
constructor(themeService) {
|
|
531748
|
+
super();
|
|
531749
|
+
this.themeService = themeService;
|
|
531750
|
+
}
|
|
531751
|
+
async run() {
|
|
531752
|
+
this.themeService.changeVersion('minor', false);
|
|
531753
|
+
}
|
|
531754
|
+
};
|
|
531755
|
+
ThemeUnminorCommand = __decorate$5([
|
|
531756
|
+
src$6.SubCommand({ name: 'unminor', description: 'Decrement minor version' }),
|
|
531757
|
+
__metadata$2("design:paramtypes", [ThemeService])
|
|
531758
|
+
], ThemeUnminorCommand);
|
|
531759
|
+
let ThemeUnmajorCommand = class ThemeUnmajorCommand extends src$6.CommandRunner {
|
|
531760
|
+
constructor(themeService) {
|
|
531761
|
+
super();
|
|
531762
|
+
this.themeService = themeService;
|
|
531763
|
+
}
|
|
531764
|
+
async run() {
|
|
531765
|
+
this.themeService.changeVersion('major', false);
|
|
531766
|
+
}
|
|
531767
|
+
};
|
|
531768
|
+
ThemeUnmajorCommand = __decorate$5([
|
|
531769
|
+
src$6.SubCommand({ name: 'unmajor', description: 'Decrement major version' }),
|
|
531770
|
+
__metadata$2("design:paramtypes", [ThemeService])
|
|
531771
|
+
], ThemeUnmajorCommand);
|
|
531689
531772
|
|
|
531690
531773
|
let ThemeCommand = class ThemeCommand extends src$6.CommandRunner {
|
|
531691
531774
|
async run() {
|
|
@@ -531704,6 +531787,9 @@ ThemeCommand = __decorate$5([
|
|
|
531704
531787
|
ThemePatchCommand,
|
|
531705
531788
|
ThemeMinorCommand,
|
|
531706
531789
|
ThemeMajorCommand,
|
|
531790
|
+
ThemeUnpatchCommand,
|
|
531791
|
+
ThemeUnminorCommand,
|
|
531792
|
+
ThemeUnmajorCommand,
|
|
531707
531793
|
],
|
|
531708
531794
|
})
|
|
531709
531795
|
], ThemeCommand);
|
|
@@ -531876,6 +531962,9 @@ ThemeModule = __decorate$5([
|
|
|
531876
531962
|
ThemePatchCommand,
|
|
531877
531963
|
ThemeMinorCommand,
|
|
531878
531964
|
ThemeMajorCommand,
|
|
531965
|
+
ThemeUnpatchCommand,
|
|
531966
|
+
ThemeUnminorCommand,
|
|
531967
|
+
ThemeUnmajorCommand,
|
|
531879
531968
|
// Services
|
|
531880
531969
|
ThemeService,
|
|
531881
531970
|
ThemeApiService,
|
|
@@ -532686,6 +532775,58 @@ GenerateModule = __decorate$5([
|
|
|
532686
532775
|
})
|
|
532687
532776
|
], GenerateModule);
|
|
532688
532777
|
|
|
532778
|
+
let StatusCommand = class StatusCommand extends src$6.CommandRunner {
|
|
532779
|
+
constructor(auth) {
|
|
532780
|
+
super();
|
|
532781
|
+
this.auth = auth;
|
|
532782
|
+
}
|
|
532783
|
+
async run() {
|
|
532784
|
+
// Display Qumra Cloud logo
|
|
532785
|
+
const logo = figlet.textSync('Qumra Cloud', {
|
|
532786
|
+
font: 'Standard',
|
|
532787
|
+
horizontalLayout: 'default',
|
|
532788
|
+
});
|
|
532789
|
+
console.log(chalk.cyan(logo));
|
|
532790
|
+
console.log();
|
|
532791
|
+
// Display version
|
|
532792
|
+
console.log(chalk.bold(' CLI Version:'), chalk.green(`v${CLI_VERSION}`));
|
|
532793
|
+
console.log();
|
|
532794
|
+
// Display user info
|
|
532795
|
+
const user = await this.auth.getUser();
|
|
532796
|
+
if (user) {
|
|
532797
|
+
console.log(chalk.bold(' Status:'), chalk.green('Logged in'));
|
|
532798
|
+
if (user.name) {
|
|
532799
|
+
console.log(chalk.bold(' User:'), chalk.white(user.name));
|
|
532800
|
+
}
|
|
532801
|
+
if (user.email) {
|
|
532802
|
+
console.log(chalk.bold(' Email:'), chalk.white(user.email));
|
|
532803
|
+
}
|
|
532804
|
+
}
|
|
532805
|
+
else {
|
|
532806
|
+
console.log(chalk.bold(' Status:'), chalk.yellow('Not logged in'));
|
|
532807
|
+
console.log(chalk.dim(' Run `qumra login` to authenticate'));
|
|
532808
|
+
}
|
|
532809
|
+
console.log();
|
|
532810
|
+
console.log(chalk.dim(' https://qumra.cloud'));
|
|
532811
|
+
console.log();
|
|
532812
|
+
}
|
|
532813
|
+
};
|
|
532814
|
+
StatusCommand = __decorate$5([
|
|
532815
|
+
src$6.Command({
|
|
532816
|
+
name: 'status',
|
|
532817
|
+
description: 'Show Qumra CLI status and information',
|
|
532818
|
+
}),
|
|
532819
|
+
__metadata$2("design:paramtypes", [AuthService])
|
|
532820
|
+
], StatusCommand);
|
|
532821
|
+
|
|
532822
|
+
let StatusModule = class StatusModule {
|
|
532823
|
+
};
|
|
532824
|
+
StatusModule = __decorate$5([
|
|
532825
|
+
commonExports.Module({
|
|
532826
|
+
providers: [StatusCommand],
|
|
532827
|
+
})
|
|
532828
|
+
], StatusModule);
|
|
532829
|
+
|
|
532689
532830
|
let AppModule = class AppModule {
|
|
532690
532831
|
};
|
|
532691
532832
|
AppModule = __decorate$5([
|
|
@@ -532696,6 +532837,7 @@ AppModule = __decorate$5([
|
|
|
532696
532837
|
ThemeModule,
|
|
532697
532838
|
AppModule$1,
|
|
532698
532839
|
GenerateModule,
|
|
532840
|
+
StatusModule,
|
|
532699
532841
|
],
|
|
532700
532842
|
})
|
|
532701
532843
|
], AppModule);
|