@salesforce/plugin-templates 55.5.19 → 56.0.2
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/bin/dev.cmd +1 -1
- package/bin/dev.js +8 -0
- package/bin/run.js +9 -0
- package/lib/commands/analytics/generate/template.d.ts +4 -4
- package/lib/commands/analytics/generate/template.js +31 -32
- package/lib/commands/analytics/generate/template.js.map +1 -1
- package/lib/commands/apex/generate/class.d.ts +5 -5
- package/lib/commands/apex/generate/class.js +41 -42
- package/lib/commands/apex/generate/class.js.map +1 -1
- package/lib/commands/apex/generate/trigger.d.ts +7 -7
- package/lib/commands/apex/generate/trigger.js +62 -63
- package/lib/commands/apex/generate/trigger.js.map +1 -1
- package/lib/commands/lightning/generate/app.d.ts +6 -6
- package/lib/commands/lightning/generate/app.js +42 -43
- package/lib/commands/lightning/generate/app.js.map +1 -1
- package/lib/commands/lightning/generate/component.d.ts +7 -7
- package/lib/commands/lightning/generate/component.js +48 -49
- package/lib/commands/lightning/generate/component.js.map +1 -1
- package/lib/commands/lightning/generate/event.d.ts +6 -6
- package/lib/commands/lightning/generate/event.js +42 -43
- package/lib/commands/lightning/generate/event.js.map +1 -1
- package/lib/commands/lightning/generate/interface.d.ts +6 -6
- package/lib/commands/lightning/generate/interface.js +42 -43
- package/lib/commands/lightning/generate/interface.js.map +1 -1
- package/lib/commands/lightning/generate/test.d.ts +6 -6
- package/lib/commands/lightning/generate/test.js +42 -43
- package/lib/commands/lightning/generate/test.js.map +1 -1
- package/lib/commands/project/generate.d.ts +9 -9
- package/lib/commands/project/generate.js +68 -69
- package/lib/commands/project/generate.js.map +1 -1
- package/lib/commands/static-resource/generate.d.ts +5 -5
- package/lib/commands/static-resource/generate.js +39 -40
- package/lib/commands/static-resource/generate.js.map +1 -1
- package/lib/commands/visualforce/generate/component.d.ts +6 -6
- package/lib/commands/visualforce/generate/component.js +46 -47
- package/lib/commands/visualforce/generate/component.js.map +1 -1
- package/lib/commands/visualforce/generate/page.d.ts +6 -6
- package/lib/commands/visualforce/generate/page.js +48 -49
- package/lib/commands/visualforce/generate/page.js.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/utils/flags.d.ts +3 -3
- package/lib/utils/flags.js +10 -11
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/templateCommand.d.ts +25 -25
- package/lib/utils/templateCommand.js +18 -24
- package/lib/utils/templateCommand.js.map +1 -1
- package/oclif.lock +8217 -0
- package/oclif.manifest.json +1108 -581
- package/package.json +33 -33
- package/bin/dev +0 -21
- package/bin/run +0 -5
- package/lib/tsconfig.tsbuildinfo +0 -1
package/bin/dev.cmd
CHANGED
package/bin/dev.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
|
|
2
|
+
// eslint-disable-next-line node/shebang
|
|
3
|
+
async function main() {
|
|
4
|
+
const {execute} = await import('@oclif/core')
|
|
5
|
+
await execute({development: true, dir: import.meta.url})
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
await main()
|
package/bin/run.js
ADDED
|
@@ -7,10 +7,10 @@ export default class AnalyticsTemplate extends SfCommand<CreateOutput> {
|
|
|
7
7
|
static readonly aliases: string[];
|
|
8
8
|
static readonly deprecateAliases = true;
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
-
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
'output-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
14
|
};
|
|
15
15
|
run(): Promise<CreateOutput>;
|
|
16
16
|
}
|
|
@@ -1,19 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/*
|
|
4
2
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
5
3
|
* All rights reserved.
|
|
6
4
|
* Licensed under the BSD 3-Clause license.
|
|
7
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { Messages } from '@salesforce/core';
|
|
11
|
+
import AnalyticsTemplateGenerator from '@salesforce/templates/lib/generators/analyticsTemplateGenerator.js';
|
|
12
|
+
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
|
|
13
|
+
import { outputDirFlag } from '../../../utils/flags.js';
|
|
14
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
15
|
+
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'analyticsTemplate');
|
|
16
|
+
export default class AnalyticsTemplate extends SfCommand {
|
|
17
|
+
static examples = messages.getMessages('examples');
|
|
18
|
+
static summary = messages.getMessage('summary');
|
|
19
|
+
static description = messages.getMessage('description');
|
|
20
|
+
static aliases = ['force:analytics:template:create'];
|
|
21
|
+
static deprecateAliases = true;
|
|
22
|
+
static flags = {
|
|
23
|
+
'output-dir': outputDirFlag,
|
|
24
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
|
25
|
+
name: Flags.string({
|
|
26
|
+
char: 'n',
|
|
27
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
28
|
+
required: true,
|
|
29
|
+
aliases: ['templatename'],
|
|
30
|
+
deprecateAliases: true,
|
|
31
|
+
}),
|
|
32
|
+
loglevel,
|
|
33
|
+
};
|
|
17
34
|
async run() {
|
|
18
35
|
const { flags } = await this.parse(AnalyticsTemplate);
|
|
19
36
|
const flagsAsOptions = {
|
|
@@ -21,30 +38,12 @@ class AnalyticsTemplate extends sf_plugins_core_1.SfCommand {
|
|
|
21
38
|
templatename: flags.name,
|
|
22
39
|
outputdir: flags['output-dir'],
|
|
23
40
|
};
|
|
24
|
-
return
|
|
25
|
-
generator:
|
|
41
|
+
return runGenerator({
|
|
42
|
+
generator: AnalyticsTemplateGenerator,
|
|
26
43
|
opts: flagsAsOptions,
|
|
27
|
-
ux: new
|
|
28
|
-
templates:
|
|
44
|
+
ux: new Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
45
|
+
templates: getCustomTemplates(this.configAggregator),
|
|
29
46
|
});
|
|
30
47
|
}
|
|
31
48
|
}
|
|
32
|
-
AnalyticsTemplate.examples = messages.getMessages('examples');
|
|
33
|
-
AnalyticsTemplate.summary = messages.getMessage('summary');
|
|
34
|
-
AnalyticsTemplate.description = messages.getMessage('description');
|
|
35
|
-
AnalyticsTemplate.aliases = ['force:analytics:template:create'];
|
|
36
|
-
AnalyticsTemplate.deprecateAliases = true;
|
|
37
|
-
AnalyticsTemplate.flags = {
|
|
38
|
-
'output-dir': flags_1.outputDirFlag,
|
|
39
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
40
|
-
name: sf_plugins_core_1.Flags.string({
|
|
41
|
-
char: 'n',
|
|
42
|
-
summary: messages.getMessage('flags.name.summary'),
|
|
43
|
-
required: true,
|
|
44
|
-
aliases: ['templatename'],
|
|
45
|
-
deprecateAliases: true,
|
|
46
|
-
}),
|
|
47
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
48
|
-
};
|
|
49
|
-
exports.default = AnalyticsTemplate;
|
|
50
49
|
//# sourceMappingURL=template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/analytics/generate/template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/analytics/generate/template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iCAAiC,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAChH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,0BAA0B,MAAM,oEAAoE,CAAC;AAE5G,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,mBAAmB,CAAC,CAAC;AAC5F,MAAM,CAAC,OAAO,OAAO,iBAAkB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fCommand<CreateOutput> {
|
|
|
7
7
|
static readonly aliases: string[];
|
|
8
8
|
static readonly deprecateAliases = true;
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
-
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
-
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
template: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
'output-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
15
|
};
|
|
16
16
|
run(): Promise<CreateOutput>;
|
|
17
17
|
}
|
|
@@ -1,22 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/*
|
|
4
2
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
5
3
|
* All rights reserved.
|
|
6
4
|
* Licensed under the BSD 3-Clause license.
|
|
7
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import ApexClassGenerator from '@salesforce/templates/lib/generators/apexClassGenerator.js';
|
|
11
|
+
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
|
|
12
|
+
import { Messages } from '@salesforce/core';
|
|
13
|
+
import { runGenerator, getCustomTemplates } from '../../../utils/templateCommand.js';
|
|
14
|
+
import { outputDirFlag } from '../../../utils/flags.js';
|
|
15
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
16
|
+
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'apexClass');
|
|
17
|
+
const commonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'messages');
|
|
18
18
|
const apexClassFileSuffix = /.cls$/;
|
|
19
|
-
class ApexClass extends
|
|
19
|
+
export default class ApexClass extends SfCommand {
|
|
20
|
+
static summary = messages.getMessage('summary');
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static examples = messages.getMessages('examples');
|
|
23
|
+
static aliases = ['force:apex:class:create'];
|
|
24
|
+
static deprecateAliases = true;
|
|
25
|
+
static flags = {
|
|
26
|
+
name: Flags.string({
|
|
27
|
+
char: 'n',
|
|
28
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
29
|
+
description: messages.getMessage('flags.name.description'),
|
|
30
|
+
required: true,
|
|
31
|
+
aliases: ['classname'],
|
|
32
|
+
deprecateAliases: true,
|
|
33
|
+
}),
|
|
34
|
+
template: Flags.string({
|
|
35
|
+
char: 't',
|
|
36
|
+
summary: commonMessages.getMessage('flags.template.summary'),
|
|
37
|
+
description: commonMessages.getMessage('flags.template.description'),
|
|
38
|
+
default: 'DefaultApexClass',
|
|
39
|
+
options: CreateUtil.getCommandTemplatesForFiletype(apexClassFileSuffix, 'apexclass'),
|
|
40
|
+
}),
|
|
41
|
+
'output-dir': outputDirFlag,
|
|
42
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
|
43
|
+
loglevel,
|
|
44
|
+
};
|
|
20
45
|
async run() {
|
|
21
46
|
const { flags } = await this.parse(ApexClass);
|
|
22
47
|
const flagsAsOptions = {
|
|
@@ -25,38 +50,12 @@ class ApexClass extends sf_plugins_core_1.SfCommand {
|
|
|
25
50
|
template: flags.template,
|
|
26
51
|
outputdir: flags['output-dir'],
|
|
27
52
|
};
|
|
28
|
-
return
|
|
29
|
-
generator:
|
|
53
|
+
return runGenerator({
|
|
54
|
+
generator: ApexClassGenerator,
|
|
30
55
|
opts: flagsAsOptions,
|
|
31
|
-
ux: new
|
|
32
|
-
templates:
|
|
56
|
+
ux: new Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
57
|
+
templates: getCustomTemplates(this.configAggregator),
|
|
33
58
|
});
|
|
34
59
|
}
|
|
35
60
|
}
|
|
36
|
-
ApexClass.summary = messages.getMessage('summary');
|
|
37
|
-
ApexClass.description = messages.getMessage('description');
|
|
38
|
-
ApexClass.examples = messages.getMessages('examples');
|
|
39
|
-
ApexClass.aliases = ['force:apex:class:create'];
|
|
40
|
-
ApexClass.deprecateAliases = true;
|
|
41
|
-
ApexClass.flags = {
|
|
42
|
-
name: sf_plugins_core_1.Flags.string({
|
|
43
|
-
char: 'n',
|
|
44
|
-
summary: messages.getMessage('flags.name.summary'),
|
|
45
|
-
description: messages.getMessage('flags.name.description'),
|
|
46
|
-
required: true,
|
|
47
|
-
aliases: ['classname'],
|
|
48
|
-
deprecateAliases: true,
|
|
49
|
-
}),
|
|
50
|
-
template: sf_plugins_core_1.Flags.string({
|
|
51
|
-
char: 't',
|
|
52
|
-
summary: commonMessages.getMessage('flags.template.summary'),
|
|
53
|
-
description: commonMessages.getMessage('flags.template.description'),
|
|
54
|
-
default: 'DefaultApexClass',
|
|
55
|
-
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(apexClassFileSuffix, 'apexclass'),
|
|
56
|
-
}),
|
|
57
|
-
'output-dir': flags_1.outputDirFlag,
|
|
58
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
59
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
60
|
-
};
|
|
61
|
-
exports.default = ApexClass;
|
|
62
61
|
//# sourceMappingURL=class.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../src/commands/apex/generate/class.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../src/commands/apex/generate/class.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iCAAiC,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAEhH,OAAO,kBAAkB,MAAM,4DAA4D,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAA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IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAqB;YACvC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;YAChC,SAAS,EAAE,KAAK,CAAC,IAAI;YACrB,QAAQ,EAAE,KAAK,CAAC,QAAwC;YACxD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;SAC/B,CAAC;QACF,OAAO,YAAY,CAAC;YAClB,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,cAAc;YACpB,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/C,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC;SACrD,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -7,13 +7,13 @@ export default class ApexTrigger extends SfCommand<CreateOutput> {
|
|
|
7
7
|
static readonly aliases: string[];
|
|
8
8
|
static readonly deprecateAliases = true;
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
-
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
-
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
-
sobject: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
-
event: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
template: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
'output-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
sobject: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
event: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
17
|
};
|
|
18
18
|
run(): Promise<CreateOutput>;
|
|
19
19
|
}
|
|
@@ -1,26 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/*
|
|
4
2
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
5
3
|
* All rights reserved.
|
|
6
4
|
* Licensed under the BSD 3-Clause license.
|
|
7
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { arrayWithDeprecation, Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux, } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import ApexTriggerGenerator from '@salesforce/templates/lib/generators/apexTriggerGenerator.js';
|
|
11
|
+
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
|
|
12
|
+
import { Messages } from '@salesforce/core';
|
|
13
|
+
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
|
|
14
|
+
import { outputDirFlag } from '../../../utils/flags.js';
|
|
15
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
16
16
|
const apexTriggerFileSuffix = /.trigger$/;
|
|
17
|
-
const commonMessages =
|
|
18
|
-
const messages =
|
|
19
|
-
class ApexTrigger extends
|
|
17
|
+
const commonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'messages');
|
|
18
|
+
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'apexTrigger');
|
|
19
|
+
export default class ApexTrigger extends SfCommand {
|
|
20
|
+
static summary = messages.getMessage('summary');
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static examples = messages.getMessages('examples');
|
|
23
|
+
static aliases = ['force:apex:trigger:create'];
|
|
24
|
+
static deprecateAliases = true;
|
|
25
|
+
static flags = {
|
|
26
|
+
name: Flags.string({
|
|
27
|
+
char: 'n',
|
|
28
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
29
|
+
description: messages.getMessage('flags.name.description'),
|
|
30
|
+
required: true,
|
|
31
|
+
aliases: ['triggername'],
|
|
32
|
+
deprecateAliases: true,
|
|
33
|
+
}),
|
|
34
|
+
template: Flags.string({
|
|
35
|
+
char: 't',
|
|
36
|
+
summary: commonMessages.getMessage('flags.template.summary'),
|
|
37
|
+
description: commonMessages.getMessage('flags.template.description'),
|
|
38
|
+
default: 'ApexTrigger',
|
|
39
|
+
options: CreateUtil.getCommandTemplatesForFiletype(apexTriggerFileSuffix, 'apextrigger'),
|
|
40
|
+
}),
|
|
41
|
+
'output-dir': outputDirFlag,
|
|
42
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
|
43
|
+
sobject: Flags.string({
|
|
44
|
+
char: 's',
|
|
45
|
+
summary: messages.getMessage('flags.sobject.summary'),
|
|
46
|
+
default: 'SOBJECT',
|
|
47
|
+
}),
|
|
48
|
+
event: arrayWithDeprecation({
|
|
49
|
+
char: 'e',
|
|
50
|
+
aliases: ['triggerevents'],
|
|
51
|
+
deprecateAliases: true,
|
|
52
|
+
summary: messages.getMessage('flags.event.summary'),
|
|
53
|
+
default: ['before insert'],
|
|
54
|
+
options: [
|
|
55
|
+
'before insert',
|
|
56
|
+
'before update',
|
|
57
|
+
'before delete',
|
|
58
|
+
'after insert',
|
|
59
|
+
'after update',
|
|
60
|
+
'after delete',
|
|
61
|
+
'after undelete',
|
|
62
|
+
],
|
|
63
|
+
}),
|
|
64
|
+
loglevel,
|
|
65
|
+
};
|
|
20
66
|
async run() {
|
|
21
67
|
const { flags } = await this.parse(ApexTrigger);
|
|
22
|
-
return
|
|
23
|
-
generator:
|
|
68
|
+
return runGenerator({
|
|
69
|
+
generator: ApexTriggerGenerator,
|
|
24
70
|
opts: {
|
|
25
71
|
triggername: flags.name,
|
|
26
72
|
outputdir: flags['output-dir'],
|
|
@@ -28,56 +74,9 @@ class ApexTrigger extends sf_plugins_core_1.SfCommand {
|
|
|
28
74
|
sobject: flags.sobject,
|
|
29
75
|
triggerevents: flags.event,
|
|
30
76
|
},
|
|
31
|
-
ux: new
|
|
32
|
-
templates:
|
|
77
|
+
ux: new Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
78
|
+
templates: getCustomTemplates(this.configAggregator),
|
|
33
79
|
});
|
|
34
80
|
}
|
|
35
81
|
}
|
|
36
|
-
ApexTrigger.summary = messages.getMessage('summary');
|
|
37
|
-
ApexTrigger.description = messages.getMessage('description');
|
|
38
|
-
ApexTrigger.examples = messages.getMessages('examples');
|
|
39
|
-
ApexTrigger.aliases = ['force:apex:trigger:create'];
|
|
40
|
-
ApexTrigger.deprecateAliases = true;
|
|
41
|
-
ApexTrigger.flags = {
|
|
42
|
-
name: sf_plugins_core_1.Flags.string({
|
|
43
|
-
char: 'n',
|
|
44
|
-
summary: messages.getMessage('flags.name.summary'),
|
|
45
|
-
description: messages.getMessage('flags.name.description'),
|
|
46
|
-
required: true,
|
|
47
|
-
aliases: ['triggername'],
|
|
48
|
-
deprecateAliases: true,
|
|
49
|
-
}),
|
|
50
|
-
template: sf_plugins_core_1.Flags.string({
|
|
51
|
-
char: 't',
|
|
52
|
-
summary: commonMessages.getMessage('flags.template.summary'),
|
|
53
|
-
description: commonMessages.getMessage('flags.template.description'),
|
|
54
|
-
default: 'ApexTrigger',
|
|
55
|
-
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(apexTriggerFileSuffix, 'apextrigger'),
|
|
56
|
-
}),
|
|
57
|
-
'output-dir': flags_1.outputDirFlag,
|
|
58
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
59
|
-
sobject: sf_plugins_core_1.Flags.string({
|
|
60
|
-
char: 's',
|
|
61
|
-
summary: messages.getMessage('flags.sobject.summary'),
|
|
62
|
-
default: 'SOBJECT',
|
|
63
|
-
}),
|
|
64
|
-
event: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
65
|
-
char: 'e',
|
|
66
|
-
aliases: ['triggerevents'],
|
|
67
|
-
deprecateAliases: true,
|
|
68
|
-
summary: messages.getMessage('flags.event.summary'),
|
|
69
|
-
default: ['before insert'],
|
|
70
|
-
options: [
|
|
71
|
-
'before insert',
|
|
72
|
-
'before update',
|
|
73
|
-
'before delete',
|
|
74
|
-
'after insert',
|
|
75
|
-
'after update',
|
|
76
|
-
'after delete',
|
|
77
|
-
'after undelete',
|
|
78
|
-
],
|
|
79
|
-
}),
|
|
80
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
81
|
-
};
|
|
82
|
-
exports.default = ApexTrigger;
|
|
83
82
|
//# sourceMappingURL=trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/commands/apex/generate/trigger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/commands/apex/generate/trigger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,KAAK,EACL,QAAQ,EACR,iCAAiC,EACjC,SAAS,EACT,EAAE,GACH,MAAM,6BAA6B,CAAC;AAErC,OAAO,oBAAoB,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAC1C,MAAM,cAAc,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;AACzF,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,aAAa,CAAC,CAAC;AACtF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAuB;IACvD,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC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;gBACd,cAAc;gBACd,gBAAgB;aACsB;SACzC,CAAC;QACF,QAAQ;KACT,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,YAAY,CAAC;YAClB,SAAS,EAAE,oBAAoB;YAC/B,IAAI,EAAE;gBACJ,WAAW,EAAE,KAAK,CAAC,IAAI;gBACvB,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;gBAC9B,QAAQ,EAAE,aAAa;gBACvB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,aAAa,EAAE,KAAK,CAAC,KAA4C;aAClE;YACD,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/C,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC;SACrD,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -7,12 +7,12 @@ export default class LightningApp extends SfCommand<CreateOutput> {
|
|
|
7
7
|
static readonly aliases: string[];
|
|
8
8
|
static readonly deprecateAliases = true;
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
-
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
-
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
-
internal: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
template: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
'output-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
internal: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
16
|
};
|
|
17
17
|
run(): Promise<CreateOutput>;
|
|
18
18
|
}
|
|
@@ -1,23 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/*
|
|
4
2
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
5
3
|
* All rights reserved.
|
|
6
4
|
* Licensed under the BSD 3-Clause license.
|
|
7
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import LightningAppGenerator from '@salesforce/templates/lib/generators/lightningAppGenerator.js';
|
|
11
|
+
import { CreateUtil } from '@salesforce/templates/lib/utils/index.js';
|
|
12
|
+
import { Messages } from '@salesforce/core';
|
|
13
|
+
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
|
|
14
|
+
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
|
|
15
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
16
|
+
const lightningCommonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
|
|
17
|
+
const lightningAppMessages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningApp');
|
|
18
18
|
const lightningAppFileSuffix = /.app$/;
|
|
19
19
|
const BUNDLE_TYPE = 'App';
|
|
20
|
-
class LightningApp extends
|
|
20
|
+
export default class LightningApp extends SfCommand {
|
|
21
|
+
static summary = lightningCommonMessages.getMessage('summary', [BUNDLE_TYPE]);
|
|
22
|
+
static description = lightningCommonMessages.getMessage('description', [BUNDLE_TYPE]);
|
|
23
|
+
static examples = lightningAppMessages.getMessages('examples');
|
|
24
|
+
static aliases = ['force:lightning:app:create'];
|
|
25
|
+
static deprecateAliases = true;
|
|
26
|
+
static flags = {
|
|
27
|
+
name: Flags.string({
|
|
28
|
+
char: 'n',
|
|
29
|
+
summary: lightningCommonMessages.getMessage('flags.name.summary', [BUNDLE_TYPE]),
|
|
30
|
+
description: lightningCommonMessages.getMessage('flags.name.description'),
|
|
31
|
+
required: true,
|
|
32
|
+
aliases: ['appname'],
|
|
33
|
+
deprecateAliases: true,
|
|
34
|
+
}),
|
|
35
|
+
template: Flags.string({
|
|
36
|
+
char: 't',
|
|
37
|
+
summary: lightningCommonMessages.getMessage('flags.template.summary'),
|
|
38
|
+
description: lightningCommonMessages.getMessage('flags.template.description'),
|
|
39
|
+
default: 'DefaultLightningApp',
|
|
40
|
+
options: CreateUtil.getCommandTemplatesForFiletype(lightningAppFileSuffix, 'lightningapp'),
|
|
41
|
+
}),
|
|
42
|
+
'output-dir': outputDirFlagLightning,
|
|
43
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
|
44
|
+
internal: internalFlag,
|
|
45
|
+
loglevel,
|
|
46
|
+
};
|
|
21
47
|
async run() {
|
|
22
48
|
const { flags } = await this.parse(LightningApp);
|
|
23
49
|
const flagsAsOptions = {
|
|
@@ -27,39 +53,12 @@ class LightningApp extends sf_plugins_core_1.SfCommand {
|
|
|
27
53
|
template: 'DefaultLightningApp',
|
|
28
54
|
internal: flags.internal,
|
|
29
55
|
};
|
|
30
|
-
return
|
|
31
|
-
generator:
|
|
56
|
+
return runGenerator({
|
|
57
|
+
generator: LightningAppGenerator,
|
|
32
58
|
opts: flagsAsOptions,
|
|
33
|
-
ux: new
|
|
34
|
-
templates:
|
|
59
|
+
ux: new Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
60
|
+
templates: getCustomTemplates(this.configAggregator),
|
|
35
61
|
});
|
|
36
62
|
}
|
|
37
63
|
}
|
|
38
|
-
LightningApp.summary = lightningCommonMessages.getMessage('summary', [BUNDLE_TYPE]);
|
|
39
|
-
LightningApp.description = lightningCommonMessages.getMessage('description', [BUNDLE_TYPE]);
|
|
40
|
-
LightningApp.examples = lightningAppMessages.getMessages('examples');
|
|
41
|
-
LightningApp.aliases = ['force:lightning:app:create'];
|
|
42
|
-
LightningApp.deprecateAliases = true;
|
|
43
|
-
LightningApp.flags = {
|
|
44
|
-
name: sf_plugins_core_1.Flags.string({
|
|
45
|
-
char: 'n',
|
|
46
|
-
summary: lightningCommonMessages.getMessage('flags.name.summary', [BUNDLE_TYPE]),
|
|
47
|
-
description: lightningCommonMessages.getMessage('flags.name.description'),
|
|
48
|
-
required: true,
|
|
49
|
-
aliases: ['appname'],
|
|
50
|
-
deprecateAliases: true,
|
|
51
|
-
}),
|
|
52
|
-
template: sf_plugins_core_1.Flags.string({
|
|
53
|
-
char: 't',
|
|
54
|
-
summary: lightningCommonMessages.getMessage('flags.template.summary'),
|
|
55
|
-
description: lightningCommonMessages.getMessage('flags.template.description'),
|
|
56
|
-
default: 'DefaultLightningApp',
|
|
57
|
-
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(lightningAppFileSuffix, 'lightningapp'),
|
|
58
|
-
}),
|
|
59
|
-
'output-dir': flags_1.outputDirFlagLightning,
|
|
60
|
-
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
61
|
-
internal: flags_1.internalFlag,
|
|
62
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
63
|
-
};
|
|
64
|
-
exports.default = LightningApp;
|
|
65
64
|
//# sourceMappingURL=app.js.map
|