@salesforce/plugin-templates 55.3.1 → 55.4.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/LICENSE.txt +1 -1
- package/lib/commands/analytics/generate/template.d.ts +16 -0
- package/lib/commands/analytics/generate/template.js +53 -0
- package/lib/commands/analytics/generate/template.js.map +1 -0
- package/lib/commands/apex/generate/class.d.ts +17 -0
- package/lib/commands/apex/generate/class.js +65 -0
- package/lib/commands/apex/generate/class.js.map +1 -0
- package/lib/commands/apex/generate/trigger.d.ts +19 -0
- package/lib/commands/apex/generate/trigger.js +86 -0
- package/lib/commands/apex/generate/trigger.js.map +1 -0
- package/lib/commands/lightning/generate/app.d.ts +18 -0
- package/lib/commands/lightning/generate/app.js +68 -0
- package/lib/commands/lightning/generate/app.js.map +1 -0
- package/lib/commands/lightning/generate/component.d.ts +19 -0
- package/lib/commands/lightning/generate/component.js +75 -0
- package/lib/commands/lightning/generate/component.js.map +1 -0
- package/lib/commands/lightning/generate/event.d.ts +18 -0
- package/lib/commands/lightning/generate/event.js +68 -0
- package/lib/commands/lightning/generate/event.js.map +1 -0
- package/lib/commands/lightning/generate/interface.d.ts +18 -0
- package/lib/commands/lightning/generate/interface.js +68 -0
- package/lib/commands/lightning/generate/interface.js.map +1 -0
- package/lib/commands/lightning/generate/test.d.ts +18 -0
- package/lib/commands/lightning/generate/test.js +68 -0
- package/lib/commands/lightning/generate/test.js.map +1 -0
- package/lib/commands/project/generate.d.ts +20 -0
- package/lib/commands/project/generate.js +93 -0
- package/lib/commands/project/generate.js.map +1 -0
- package/lib/commands/static-resource/generate.d.ts +17 -0
- package/lib/commands/static-resource/generate.js +64 -0
- package/lib/commands/static-resource/generate.js.map +1 -0
- package/lib/commands/visualforce/generate/component.d.ts +18 -0
- package/lib/commands/visualforce/generate/component.js +73 -0
- package/lib/commands/visualforce/generate/component.js.map +1 -0
- package/lib/commands/visualforce/generate/page.d.ts +18 -0
- package/lib/commands/visualforce/generate/page.js +75 -0
- package/lib/commands/visualforce/generate/page.js.map +1 -0
- package/lib/utils/flags.d.ts +3 -0
- package/lib/utils/flags.js +36 -0
- package/lib/utils/flags.js.map +1 -0
- package/lib/utils/templateCommand.d.ts +58 -14
- package/lib/utils/templateCommand.js +42 -82
- package/lib/utils/templateCommand.js.map +1 -1
- package/messages/analyticsTemplate.md +17 -0
- package/messages/apexClass.md +25 -0
- package/messages/apexTrigger.md +40 -0
- package/messages/lightning.md +27 -0
- package/messages/lightningApp.md +9 -0
- package/messages/lightningCmp.md +31 -0
- package/messages/lightningEvent.md +9 -0
- package/messages/lightningInterface.md +9 -0
- package/messages/lightningTest.md +21 -0
- package/messages/messages.md +43 -0
- package/messages/project.md +87 -0
- package/messages/staticResource.md +37 -0
- package/messages/vf.md +39 -0
- package/oclif.manifest.json +1190 -1
- package/package.json +174 -96
- package/lib/commands/force/analytics/template/create.d.ts +0 -15
- package/lib/commands/force/analytics/template/create.js +0 -42
- package/lib/commands/force/analytics/template/create.js.map +0 -1
- package/lib/commands/force/apex/class/create.d.ts +0 -16
- package/lib/commands/force/apex/class/create.js +0 -52
- package/lib/commands/force/apex/class/create.js.map +0 -1
- package/lib/commands/force/apex/trigger/create.d.ts +0 -18
- package/lib/commands/force/apex/trigger/create.js +0 -74
- package/lib/commands/force/apex/trigger/create.js.map +0 -1
- package/lib/commands/force/lightning/app/create.d.ts +0 -17
- package/lib/commands/force/lightning/app/create.js +0 -58
- package/lib/commands/force/lightning/app/create.js.map +0 -1
- package/lib/commands/force/lightning/component/create.d.ts +0 -18
- package/lib/commands/force/lightning/component/create.js +0 -67
- package/lib/commands/force/lightning/component/create.js.map +0 -1
- package/lib/commands/force/lightning/event/create.d.ts +0 -17
- package/lib/commands/force/lightning/event/create.js +0 -58
- package/lib/commands/force/lightning/event/create.js.map +0 -1
- package/lib/commands/force/lightning/interface/create.d.ts +0 -17
- package/lib/commands/force/lightning/interface/create.js +0 -58
- package/lib/commands/force/lightning/interface/create.js.map +0 -1
- package/lib/commands/force/lightning/test/create.d.ts +0 -16
- package/lib/commands/force/lightning/test/create.js +0 -56
- package/lib/commands/force/lightning/test/create.js.map +0 -1
- package/lib/commands/force/project/create.d.ts +0 -19
- package/lib/commands/force/project/create.js +0 -78
- package/lib/commands/force/project/create.js.map +0 -1
- package/lib/commands/force/staticresource/create.d.ts +0 -16
- package/lib/commands/force/staticresource/create.js +0 -49
- package/lib/commands/force/staticresource/create.js.map +0 -1
- package/lib/commands/force/visualforce/component/create.d.ts +0 -17
- package/lib/commands/force/visualforce/component/create.js +0 -59
- package/lib/commands/force/visualforce/component/create.js.map +0 -1
- package/lib/commands/force/visualforce/page/create.d.ts +0 -17
- package/lib/commands/force/visualforce/page/create.js +0 -59
- package/lib/commands/force/visualforce/page/create.js.map +0 -1
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -14
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/messageUtil.d.ts +0 -33
- package/lib/utils/messageUtil.js +0 -59
- package/lib/utils/messageUtil.js.map +0 -1
- package/messages/messages.json +0 -87
- package/yarn.lock +0 -9362
package/LICENSE.txt
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class AnalyticsTemplate extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly examples: string[];
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<CreateOutput>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2019, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
const core_1 = require("@salesforce/core");
|
|
12
|
+
const analyticsTemplateGenerator_1 = require("@salesforce/templates/lib/generators/analyticsTemplateGenerator");
|
|
13
|
+
const templateCommand_1 = require("../../../utils/templateCommand");
|
|
14
|
+
const flags_1 = require("../../../utils/flags");
|
|
15
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'analyticsTemplate');
|
|
17
|
+
class AnalyticsTemplate extends sf_plugins_core_1.SfCommand {
|
|
18
|
+
run() {
|
|
19
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const { flags } = yield this.parse(AnalyticsTemplate);
|
|
21
|
+
const flagsAsOptions = {
|
|
22
|
+
apiversion: flags['api-version'],
|
|
23
|
+
templatename: flags.name,
|
|
24
|
+
outputdir: flags['output-dir'],
|
|
25
|
+
};
|
|
26
|
+
return (0, templateCommand_1.runGenerator)({
|
|
27
|
+
generator: analyticsTemplateGenerator_1.default,
|
|
28
|
+
opts: flagsAsOptions,
|
|
29
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
30
|
+
templates: (0, templateCommand_1.getCustomTemplates)(this.configAggregator),
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = AnalyticsTemplate;
|
|
36
|
+
AnalyticsTemplate.examples = messages.getMessages('examples');
|
|
37
|
+
AnalyticsTemplate.summary = messages.getMessage('summary');
|
|
38
|
+
AnalyticsTemplate.description = messages.getMessage('description');
|
|
39
|
+
AnalyticsTemplate.aliases = ['force:analytics:template:create'];
|
|
40
|
+
AnalyticsTemplate.deprecateAliases = true;
|
|
41
|
+
AnalyticsTemplate.flags = {
|
|
42
|
+
'output-dir': flags_1.outputDirFlag,
|
|
43
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
44
|
+
name: sf_plugins_core_1.Flags.string({
|
|
45
|
+
char: 'n',
|
|
46
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
47
|
+
required: true,
|
|
48
|
+
aliases: ['templatename'],
|
|
49
|
+
deprecateAliases: true,
|
|
50
|
+
}),
|
|
51
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/analytics/generate/template.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iEAAgH;AAChH,2CAA4C;AAC5C,gHAAyG;AAEzG,oEAAkF;AAClF,gDAAqD;AAErD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,mBAAmB,CAAC,CAAC;AAC5F,MAAqB,iBAAkB,SAAQ,2BAAuB;IAmBvD,GAAG;;YACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACtD,MAAM,cAAc,GAA6B;gBAC/C,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;gBAChC,YAAY,EAAE,KAAK,CAAC,IAAI;gBACxB,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;aAC/B,CAAC;YAEF,OAAO,IAAA,8BAAY,EAAC;gBAClB,SAAS,EAAE,oCAA0B;gBACrC,IAAI,EAAE,cAAc;gBACpB,EAAE,EAAE,IAAI,oBAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC/C,SAAS,EAAE,IAAA,oCAAkB,EAAC,IAAI,CAAC,gBAAgB,CAAC;aACrD,CAAC,CAAC;QACL,CAAC;KAAA;;AAjCH,oCAkCC;AAjCwB,0BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,yBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,6BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,yBAAO,GAAG,CAAC,iCAAiC,CAAC,CAAC;AAC9C,kCAAgB,GAAG,IAAI,CAAC;AACxB,uBAAK,GAAG;IAC7B,YAAY,EAAE,qBAAa;IAC3B,aAAa,EAAE,mDAAiC;IAChD,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,cAAc,CAAC;QACzB,gBAAgB,EAAE,IAAI;KACvB,CAAC;IACF,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class ApexClass extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<CreateOutput>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2019, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
const apexClassGenerator_1 = require("@salesforce/templates/lib/generators/apexClassGenerator");
|
|
12
|
+
const utils_1 = require("@salesforce/templates/lib/utils");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const templateCommand_1 = require("../../../utils/templateCommand");
|
|
15
|
+
const flags_1 = require("../../../utils/flags");
|
|
16
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'apexClass');
|
|
18
|
+
const commonMessages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'messages');
|
|
19
|
+
const apexClassFileSuffix = /.cls$/;
|
|
20
|
+
class ApexClass extends sf_plugins_core_1.SfCommand {
|
|
21
|
+
run() {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { flags } = yield this.parse(ApexClass);
|
|
24
|
+
const flagsAsOptions = {
|
|
25
|
+
apiversion: flags['api-version'],
|
|
26
|
+
classname: flags.name,
|
|
27
|
+
template: flags.template,
|
|
28
|
+
outputdir: flags['output-dir'],
|
|
29
|
+
};
|
|
30
|
+
return (0, templateCommand_1.runGenerator)({
|
|
31
|
+
generator: apexClassGenerator_1.default,
|
|
32
|
+
opts: flagsAsOptions,
|
|
33
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
34
|
+
templates: (0, templateCommand_1.getCustomTemplates)(this.configAggregator),
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = ApexClass;
|
|
40
|
+
ApexClass.summary = messages.getMessage('summary');
|
|
41
|
+
ApexClass.description = messages.getMessage('description');
|
|
42
|
+
ApexClass.examples = messages.getMessages('examples');
|
|
43
|
+
ApexClass.aliases = ['force:apex:class:create'];
|
|
44
|
+
ApexClass.deprecateAliases = true;
|
|
45
|
+
ApexClass.flags = {
|
|
46
|
+
name: sf_plugins_core_1.Flags.string({
|
|
47
|
+
char: 'n',
|
|
48
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
49
|
+
description: messages.getMessage('flags.name.description'),
|
|
50
|
+
required: true,
|
|
51
|
+
aliases: ['classname'],
|
|
52
|
+
deprecateAliases: true,
|
|
53
|
+
}),
|
|
54
|
+
template: sf_plugins_core_1.Flags.string({
|
|
55
|
+
char: 't',
|
|
56
|
+
summary: commonMessages.getMessage('flags.template'),
|
|
57
|
+
description: commonMessages.getMessage('flags.template.description'),
|
|
58
|
+
default: 'DefaultApexClass',
|
|
59
|
+
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(apexClassFileSuffix, 'apexclass'),
|
|
60
|
+
}),
|
|
61
|
+
'output-dir': flags_1.outputDirFlag,
|
|
62
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
63
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../src/commands/apex/generate/class.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iEAAgH;AAEhH,gGAAyF;AACzF,2DAA6D;AAC7D,2CAA4C;AAC5C,oEAAkF;AAClF,gDAAqD;AAErD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;AACpF,MAAM,cAAc,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;AACzF,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,MAAqB,SAAU,SAAQ,2BAAuB;IA2B/C,GAAG;;YACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAC9C,MAAM,cAAc,GAAqB;gBACvC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;gBAChC,SAAS,EAAE,KAAK,CAAC,IAAI;gBACrB,QAAQ,EAAE,KAAK,CAAC,QAAwC;gBACxD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;aAC/B,CAAC;YACF,OAAO,IAAA,8BAAY,EAAC;gBAClB,SAAS,EAA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
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class ApexTrigger extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<CreateOutput>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2019, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
const apexTriggerGenerator_1 = require("@salesforce/templates/lib/generators/apexTriggerGenerator");
|
|
12
|
+
const utils_1 = require("@salesforce/templates/lib/utils");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const templateCommand_1 = require("../../../utils/templateCommand");
|
|
15
|
+
const flags_1 = require("../../../utils/flags");
|
|
16
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
|
+
const apexTriggerFileSuffix = /.trigger$/;
|
|
18
|
+
const commonMessages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'messages');
|
|
19
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'apexTrigger');
|
|
20
|
+
class ApexTrigger extends sf_plugins_core_1.SfCommand {
|
|
21
|
+
run() {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { flags } = yield this.parse(ApexTrigger);
|
|
24
|
+
return (0, templateCommand_1.runGenerator)({
|
|
25
|
+
generator: apexTriggerGenerator_1.default,
|
|
26
|
+
opts: {
|
|
27
|
+
triggername: flags.name,
|
|
28
|
+
outputdir: flags['output-dir'],
|
|
29
|
+
template: 'ApexTrigger',
|
|
30
|
+
sobject: flags.sobject,
|
|
31
|
+
triggerevents: flags.event,
|
|
32
|
+
},
|
|
33
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
34
|
+
templates: (0, templateCommand_1.getCustomTemplates)(this.configAggregator),
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = ApexTrigger;
|
|
40
|
+
ApexTrigger.summary = messages.getMessage('summary');
|
|
41
|
+
ApexTrigger.description = messages.getMessage('description');
|
|
42
|
+
ApexTrigger.examples = messages.getMessages('examples');
|
|
43
|
+
ApexTrigger.aliases = ['force:apex:trigger:create'];
|
|
44
|
+
ApexTrigger.deprecateAliases = true;
|
|
45
|
+
ApexTrigger.flags = {
|
|
46
|
+
name: sf_plugins_core_1.Flags.string({
|
|
47
|
+
char: 'n',
|
|
48
|
+
summary: messages.getMessage('flags.name'),
|
|
49
|
+
description: messages.getMessage('flags.name.description'),
|
|
50
|
+
required: true,
|
|
51
|
+
aliases: ['triggername'],
|
|
52
|
+
deprecateAliases: true,
|
|
53
|
+
}),
|
|
54
|
+
template: sf_plugins_core_1.Flags.string({
|
|
55
|
+
char: 't',
|
|
56
|
+
summary: commonMessages.getMessage('flags.template'),
|
|
57
|
+
description: commonMessages.getMessage('flags.template.description'),
|
|
58
|
+
default: 'ApexTrigger',
|
|
59
|
+
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(apexTriggerFileSuffix, 'apextrigger'),
|
|
60
|
+
}),
|
|
61
|
+
'output-dir': flags_1.outputDirFlag,
|
|
62
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
63
|
+
sobject: sf_plugins_core_1.Flags.string({
|
|
64
|
+
char: 's',
|
|
65
|
+
summary: messages.getMessage('flags.sobject'),
|
|
66
|
+
default: 'SOBJECT',
|
|
67
|
+
}),
|
|
68
|
+
event: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
69
|
+
char: 'e',
|
|
70
|
+
aliases: ['triggerevents'],
|
|
71
|
+
deprecateAliases: true,
|
|
72
|
+
summary: messages.getMessage('flags.event'),
|
|
73
|
+
default: ['before insert'],
|
|
74
|
+
options: [
|
|
75
|
+
'before insert',
|
|
76
|
+
'before update',
|
|
77
|
+
'before delete',
|
|
78
|
+
'after insert',
|
|
79
|
+
'after update',
|
|
80
|
+
'after delete',
|
|
81
|
+
'after undelete',
|
|
82
|
+
],
|
|
83
|
+
}),
|
|
84
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trig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BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class LightningApp extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<CreateOutput>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2019, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
const lightningAppGenerator_1 = require("@salesforce/templates/lib/generators/lightningAppGenerator");
|
|
12
|
+
const utils_1 = require("@salesforce/templates/lib/utils");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const templateCommand_1 = require("../../../utils/templateCommand");
|
|
15
|
+
const flags_1 = require("../../../utils/flags");
|
|
16
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
|
+
const lightningCommonMessages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
|
|
18
|
+
const lightningAppMessages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'lightningApp');
|
|
19
|
+
const lightningAppFileSuffix = /.app$/;
|
|
20
|
+
const BUNDLE_TYPE = 'App';
|
|
21
|
+
class LightningApp extends sf_plugins_core_1.SfCommand {
|
|
22
|
+
run() {
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const { flags } = yield this.parse(LightningApp);
|
|
25
|
+
const flagsAsOptions = {
|
|
26
|
+
appname: flags.name,
|
|
27
|
+
apiversion: flags['api-version'],
|
|
28
|
+
outputdir: flags['output-dir'],
|
|
29
|
+
template: 'DefaultLightningApp',
|
|
30
|
+
internal: flags.internal,
|
|
31
|
+
};
|
|
32
|
+
return (0, templateCommand_1.runGenerator)({
|
|
33
|
+
generator: lightningAppGenerator_1.default,
|
|
34
|
+
opts: flagsAsOptions,
|
|
35
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
36
|
+
templates: (0, templateCommand_1.getCustomTemplates)(this.configAggregator),
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = LightningApp;
|
|
42
|
+
LightningApp.summary = lightningCommonMessages.getMessage('summary', [BUNDLE_TYPE]);
|
|
43
|
+
LightningApp.description = lightningCommonMessages.getMessage('description', [BUNDLE_TYPE]);
|
|
44
|
+
LightningApp.examples = lightningAppMessages.getMessages('examples');
|
|
45
|
+
LightningApp.aliases = ['force:lightning:app:create'];
|
|
46
|
+
LightningApp.deprecateAliases = true;
|
|
47
|
+
LightningApp.flags = {
|
|
48
|
+
name: sf_plugins_core_1.Flags.string({
|
|
49
|
+
char: 'n',
|
|
50
|
+
summary: lightningCommonMessages.getMessage('flags.name', [BUNDLE_TYPE]),
|
|
51
|
+
description: lightningCommonMessages.getMessage('flags.name.description'),
|
|
52
|
+
required: true,
|
|
53
|
+
aliases: ['appname'],
|
|
54
|
+
deprecateAliases: true,
|
|
55
|
+
}),
|
|
56
|
+
template: sf_plugins_core_1.Flags.string({
|
|
57
|
+
char: 't',
|
|
58
|
+
summary: lightningCommonMessages.getMessage('flags.template'),
|
|
59
|
+
description: lightningCommonMessages.getMessage('flags.template.description'),
|
|
60
|
+
default: 'DefaultLightningApp',
|
|
61
|
+
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(lightningAppFileSuffix, 'lightningapp'),
|
|
62
|
+
}),
|
|
63
|
+
'output-dir': flags_1.outputDirFlagLightning,
|
|
64
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
65
|
+
internal: flags_1.internalFlag,
|
|
66
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/commands/lightning/generate/app.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iEAAgH;AAEhH,sGAA+F;AAC/F,2DAA6D;AAC7D,2CAA4C;AAC5C,oEAAkF;AAClF,gDAA4E;AAE5E,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,uBAAuB,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;AACnG,MAAM,oBAAoB,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,cAAc,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,CAAC;QACxE,WAAW,EAAE,uBAAuB,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACzE,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,SAAS,CAAC;QACpB,gBAAgB,EAAE,IAAI;KACvB,CAAC;IACF,QAAQ,EAAE,uBAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,uBAAuB,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAC7D,WAAW,EAAE,uBAAuB,CAAC,UAAU,CAAC,4BAA4B,CAAC;QAC7E,OAAO,EAAE,qBAAqB;QAC9B,OAAO,EAAE,kBAAU,CAAC,8BAA8B,CAAC,sBAAsB,EAAE,cAAc,CAAC;KAC3F,CAAC;IACF,YAAY,EAAE,8BAAsB;IACpC,aAAa,EAAE,mDAAiC;IAChD,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class LightningComponent extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
internal: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<CreateOutput>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2019, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
// tslint:disable:no-unused-expression
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const lightningComponentGenerator_1 = require("@salesforce/templates/lib/generators/lightningComponentGenerator");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const templateCommand_1 = require("../../../utils/templateCommand");
|
|
15
|
+
const flags_1 = require("../../../utils/flags");
|
|
16
|
+
const BUNDLE_TYPE = 'Component';
|
|
17
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'lightningCmp');
|
|
19
|
+
const lightningCommon = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
|
|
20
|
+
class LightningComponent extends sf_plugins_core_1.SfCommand {
|
|
21
|
+
run() {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { flags } = yield this.parse(LightningComponent);
|
|
24
|
+
const flagsAsOptions = {
|
|
25
|
+
componentname: flags.name,
|
|
26
|
+
template: flags.template,
|
|
27
|
+
outputdir: flags['output-dir'],
|
|
28
|
+
apiversion: flags['api-version'],
|
|
29
|
+
internal: flags.internal,
|
|
30
|
+
type: flags.type,
|
|
31
|
+
};
|
|
32
|
+
return (0, templateCommand_1.runGenerator)({
|
|
33
|
+
generator: lightningComponentGenerator_1.default,
|
|
34
|
+
opts: flagsAsOptions,
|
|
35
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
36
|
+
templates: (0, templateCommand_1.getCustomTemplates)(this.configAggregator),
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = LightningComponent;
|
|
42
|
+
LightningComponent.summary = messages.getMessage('summary');
|
|
43
|
+
LightningComponent.description = messages.getMessage('description');
|
|
44
|
+
LightningComponent.examples = messages.getMessages('examples');
|
|
45
|
+
LightningComponent.aliases = ['force:lightning:component:create'];
|
|
46
|
+
LightningComponent.deprecateAliases = true;
|
|
47
|
+
LightningComponent.flags = {
|
|
48
|
+
name: sf_plugins_core_1.Flags.string({
|
|
49
|
+
char: 'n',
|
|
50
|
+
summary: lightningCommon.getMessage('flags.name', [BUNDLE_TYPE]),
|
|
51
|
+
description: lightningCommon.getMessage('flags.name.description'),
|
|
52
|
+
required: true,
|
|
53
|
+
aliases: ['componentname'],
|
|
54
|
+
deprecateAliases: true,
|
|
55
|
+
}),
|
|
56
|
+
template: sf_plugins_core_1.Flags.string({
|
|
57
|
+
char: 't',
|
|
58
|
+
summary: lightningCommon.getMessage('flags.template'),
|
|
59
|
+
description: lightningCommon.getMessage('flags.template.description'),
|
|
60
|
+
default: 'default',
|
|
61
|
+
// Note: keep this list here and LightningComponentOptions#template in-sync with the
|
|
62
|
+
// templates/lightningcomponents/[aura|lwc]/* folders
|
|
63
|
+
options: ['default', 'analyticsDashboard', 'analyticsDashboardWithStep'],
|
|
64
|
+
}),
|
|
65
|
+
'output-dir': flags_1.outputDirFlagLightning,
|
|
66
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
67
|
+
type: sf_plugins_core_1.Flags.string({
|
|
68
|
+
summary: messages.getMessage('flags.type'),
|
|
69
|
+
options: ['aura', 'lwc'],
|
|
70
|
+
default: 'aura',
|
|
71
|
+
}),
|
|
72
|
+
internal: flags_1.internalFlag,
|
|
73
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/commands/lightning/generate/component.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,sCAAsC;AAEtC,iEAAgH;AAEhH,kHAA2G;AAC3G,2CAA4C;AAC5C,oEAAkF;AAClF,gDAA4E;AAE5E,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,cAAc,CAAC,CAAC;AACvF,MAAM,eAAe,GAAG,eAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;AAC3F,MAAqB,kBAAmB,SAAQ,2BAAuB;IAmCxD,GAAG;;YACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACvD,MAAM,cAAc,GAA8B;gBAChD,aAAa,EAAE,KAAK,CAAC,IAAI;gBACzB,QAAQ,EAAE,KAAK,CAAC,QAA2E;gBAC3F,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;gBAC9B,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;gBAChC,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,IAAI,EAAE,KAAK,CAAC,IAAsB;aACnC,CAAC;YACF,OAAO,IAAA,8BAA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,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;QAC1C,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;QACxB,OAAO,EAAE,MAAM;KAChB,CAAC;IACF,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class LightningEvent extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<CreateOutput>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2019, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
+
const lightningEventGenerator_1 = require("@salesforce/templates/lib/generators/lightningEventGenerator");
|
|
12
|
+
const utils_1 = require("@salesforce/templates/lib/utils");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const templateCommand_1 = require("../../../utils/templateCommand");
|
|
15
|
+
const flags_1 = require("../../../utils/flags");
|
|
16
|
+
const lightningEventFileSuffix = /.evt$/;
|
|
17
|
+
const BUNDLE_TYPE = 'Event';
|
|
18
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
19
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'lightningEvent');
|
|
20
|
+
const lightningCommon = core_1.Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
|
|
21
|
+
class LightningEvent extends sf_plugins_core_1.SfCommand {
|
|
22
|
+
run() {
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const { flags } = yield this.parse(LightningEvent);
|
|
25
|
+
const flagsAsOptions = {
|
|
26
|
+
apiversion: flags['api-version'],
|
|
27
|
+
outputdir: flags['output-dir'],
|
|
28
|
+
eventname: flags.name,
|
|
29
|
+
template: 'DefaultLightningEvt',
|
|
30
|
+
internal: flags.internal,
|
|
31
|
+
};
|
|
32
|
+
return (0, templateCommand_1.runGenerator)({
|
|
33
|
+
generator: lightningEventGenerator_1.default,
|
|
34
|
+
opts: flagsAsOptions,
|
|
35
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
36
|
+
templates: (0, templateCommand_1.getCustomTemplates)(this.configAggregator),
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = LightningEvent;
|
|
42
|
+
LightningEvent.summary = lightningCommon.getMessage('summary', [BUNDLE_TYPE]);
|
|
43
|
+
LightningEvent.description = lightningCommon.getMessage('description', [BUNDLE_TYPE]);
|
|
44
|
+
LightningEvent.examples = messages.getMessages('examples');
|
|
45
|
+
LightningEvent.aliases = ['force:lightning:event:create'];
|
|
46
|
+
LightningEvent.deprecateAliases = true;
|
|
47
|
+
LightningEvent.flags = {
|
|
48
|
+
name: sf_plugins_core_1.Flags.string({
|
|
49
|
+
char: 'n',
|
|
50
|
+
summary: lightningCommon.getMessage('flags.name', [BUNDLE_TYPE]),
|
|
51
|
+
description: lightningCommon.getMessage('flags.name.description'),
|
|
52
|
+
required: true,
|
|
53
|
+
aliases: ['eventname'],
|
|
54
|
+
deprecateAliases: true,
|
|
55
|
+
}),
|
|
56
|
+
template: sf_plugins_core_1.Flags.string({
|
|
57
|
+
char: 't',
|
|
58
|
+
summary: lightningCommon.getMessage('flags.template'),
|
|
59
|
+
description: lightningCommon.getMessage('flags.template.description'),
|
|
60
|
+
default: 'DefaultLightningEvt',
|
|
61
|
+
options: utils_1.CreateUtil.getCommandTemplatesForFiletype(lightningEventFileSuffix, 'lightningevent'),
|
|
62
|
+
}),
|
|
63
|
+
'output-dir': flags_1.outputDirFlagLightning,
|
|
64
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
65
|
+
internal: flags_1.internalFlag,
|
|
66
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../src/commands/lightning/generate/event.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iEAAgH;AAEhH,0GAAmG;AACnG,2DAA6D;AAC7D,2CAA4C;AAC5C,oEAAkF;AAClF,gDAA4E;AAE5E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,CAAC;AAC3C,+BAAgB,GAAG,IAAI,CAAC;AACxB,oBAAK,GAAG;IAC7B,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC;QAChE,WAAW,EAAE,eAAe,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACjE,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,WAAW,CAAC;QACtB,gBAAgB,EAAE,IAAI;KACvB,CAAC;IACF,QAAQ,EAAE,uBAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC;QACrD,WAAW,EAAE,eAAe,CAAC,UAAU,CAAC,4BAA4B,CAAC;QACrE,OAAO,EAAE,qBAAqB;QAC9B,OAAO,EAAE,kBAAU,CAAC,8BAA8B,CAAC,wBAAwB,EAAE,gBAAgB,CAAC;KAC/F,CAAC;IACF,YAAY,EAAE,8BAAsB;IACpC,aAAa,EAAE,mDAAiC;IAChD,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { CreateOutput } from '@salesforce/templates';
|
|
3
|
+
export default class LightningInterface extends SfCommand<CreateOutput> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly deprecateAliases = true;
|
|
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>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<CreateOutput>;
|
|
18
|
+
}
|