@salesforce/plugin-sobject 0.0.8

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 (48) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/LICENSE.txt +12 -0
  3. package/README.md +282 -0
  4. package/lib/commands/generate/metadata/field.d.ts +25 -0
  5. package/lib/commands/generate/metadata/field.js +242 -0
  6. package/lib/commands/generate/metadata/field.js.map +1 -0
  7. package/lib/commands/generate/metadata/platformevent.d.ts +18 -0
  8. package/lib/commands/generate/metadata/platformevent.js +66 -0
  9. package/lib/commands/generate/metadata/platformevent.js.map +1 -0
  10. package/lib/commands/generate/metadata/sobject.d.ts +19 -0
  11. package/lib/commands/generate/metadata/sobject.js +105 -0
  12. package/lib/commands/generate/metadata/sobject.js.map +1 -0
  13. package/lib/commands/generate/metadata/tab.d.ts +19 -0
  14. package/lib/commands/generate/metadata/tab.js +177 -0
  15. package/lib/commands/generate/metadata/tab.js.map +1 -0
  16. package/lib/index.d.ts +2 -0
  17. package/lib/index.js +9 -0
  18. package/lib/index.js.map +1 -0
  19. package/lib/shared/convert.d.ts +11 -0
  20. package/lib/shared/convert.js +38 -0
  21. package/lib/shared/convert.js.map +1 -0
  22. package/lib/shared/flags.d.ts +15 -0
  23. package/lib/shared/flags.js +58 -0
  24. package/lib/shared/flags.js.map +1 -0
  25. package/lib/shared/fs.d.ts +22 -0
  26. package/lib/shared/fs.js +59 -0
  27. package/lib/shared/fs.js.map +1 -0
  28. package/lib/shared/prompts/prompts.d.ts +28 -0
  29. package/lib/shared/prompts/prompts.js +141 -0
  30. package/lib/shared/prompts/prompts.js.map +1 -0
  31. package/lib/shared/prompts/relationshipField.d.ts +9 -0
  32. package/lib/shared/prompts/relationshipField.js +86 -0
  33. package/lib/shared/prompts/relationshipField.js.map +1 -0
  34. package/lib/shared/types.d.ts +25 -0
  35. package/lib/shared/types.js +9 -0
  36. package/lib/shared/types.js.map +1 -0
  37. package/messages/flags.md +11 -0
  38. package/messages/generate.event.md +21 -0
  39. package/messages/generate.field.md +81 -0
  40. package/messages/generate.object.md +58 -0
  41. package/messages/generate.tab.md +39 -0
  42. package/messages/prompts.relationship.md +27 -0
  43. package/messages/prompts.shared.md +51 -0
  44. package/oclif.manifest.json +1 -0
  45. package/package.json +131 -0
  46. package/schemas/generate-metadata-field.json +59 -0
  47. package/schemas/generate-metadata-sobject.json +85 -0
  48. package/schemas/generate-metadata-tab.json +28 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [0.0.8](https://github.com/salesforcecli/plugin-sobject/compare/v0.0.7...v0.0.8) (2022-08-19)
6
+
7
+ ### Features
8
+
9
+ - commands to beta state ([419c97a](https://github.com/salesforcecli/plugin-sobject/commit/419c97ad4bbcd1314a39371f377a51bd135b565e))
10
+ - label validation ([9227d9b](https://github.com/salesforcecli/plugin-sobject/commit/9227d9b3247d5ca5a080b23ebce7d033d05984b5))
11
+ - pr feedback (bugs, flag validations) ([629fb8d](https://github.com/salesforcecli/plugin-sobject/commit/629fb8d58f24a52b80420a6faaae36b1d5c63c58))
12
+
13
+ ### Bug Fixes
14
+
15
+ - array.at is not allowed while have node14 ([d976c6f](https://github.com/salesforcecli/plugin-sobject/commit/d976c6fa82704f102e86cf8218b9ee81336f0d25))
16
+ - version bump ([011e77b](https://github.com/salesforcecli/plugin-sobject/commit/011e77b2906fa08df55b0cbae187dbe5ca64cbe4))
17
+
18
+ ### [0.0.7](https://github.com/salesforcecli/plugin-schema-sf/compare/v0.0.6...v0.0.7) (2022-08-04)
19
+
20
+ ### [0.0.6](https://github.com/salesforcecli/plugin-schema-sf/compare/v0.0.5...v0.0.6) (2022-08-04)
21
+
22
+ ### [0.0.5](https://github.com/salesforcecli/plugin-schema-sf/compare/v0.0.4...v0.0.5) (2022-08-04)
23
+
24
+ ### [0.0.4](https://github.com/salesforcecli/plugin-schema-sf/compare/v0.0.3...v0.0.4) (2022-08-03)
25
+
26
+ ### [0.0.3](https://github.com/salesforcecli/plugin-schema-sf/compare/v0.0.2...v0.0.3) (2022-07-29)
27
+
28
+ ### Bug Fixes
29
+
30
+ - add long --icon flag description to generate tab ([004c418](https://github.com/salesforcecli/plugin-schema-sf/commit/004c4182e971469c8ad295382c87de08d6d50546))
31
+ - add tab description ([6fa1b44](https://github.com/salesforcecli/plugin-schema-sf/commit/6fa1b440047f49bdc95b8d05f517fa11eb638247))
32
+ - autonumber choices bug ([a7ddf61](https://github.com/salesforcecli/plugin-schema-sf/commit/a7ddf618f269dd1762f09e7c27fc9002a0dd2b84))
33
+ - edit platformevent messages ([7b3eb7f](https://github.com/salesforcecli/plugin-schema-sf/commit/7b3eb7ffe7d23a466f1b31e5a3d4ae6f0bd40422))
34
+ - edit/review messages for generate field ([1941e33](https://github.com/salesforcecli/plugin-schema-sf/commit/1941e33674506476f5877ae30b380d7d9c83e654))
35
+ - list for securityClassification ([009617e](https://github.com/salesforcecli/plugin-schema-sf/commit/009617ef753cd5ce8dd869656381f57002d5c5a2))
36
+ - messages for generate sobject ([635a091](https://github.com/salesforcecli/plugin-schema-sf/commit/635a091419b182f9bd9e395365ce0b060ee2039a))
37
+ - messages for generate tab ([ae9d0ef](https://github.com/salesforcecli/plugin-schema-sf/commit/ae9d0efc9c7499b2097ac7f90ef70c4a5cac3a3a))
38
+ - messages for lookup field prompts ([abe96f4](https://github.com/salesforcecli/plugin-schema-sf/commit/abe96f4be1a832692a077eac4e6b4ab6ea33997e))
39
+ - messages for other shared prompts ([1cc511f](https://github.com/salesforcecli/plugin-schema-sf/commit/1cc511f3c550664a45b869339872fbb1b8ed8785))
40
+ - output formatting ([67cf3f5](https://github.com/salesforcecli/plugin-schema-sf/commit/67cf3f548e2dfdd246c3faf900a425a9df55bd67))
41
+
42
+ ### 0.0.2 (2022-07-29)
43
+
44
+ ### Features
45
+
46
+ - boolean defaults ([185106b](https://github.com/salesforcecli/plugin-schema-sf/commit/185106bb8afd55f95cc96ee168c0d60b6eec1744))
47
+ - create objects and platform events (no tests) ([895fb76](https://github.com/salesforcecli/plugin-schema-sf/commit/895fb761661429dc86bcf4bb161959527e275460))
48
+ - fields except relationships and bigobject index ([6ff12b5](https://github.com/salesforcecli/plugin-schema-sf/commit/6ff12b5d0ceb70036d5ee7d2de905087231b32fe))
49
+ - generate a tab ([4470ec6](https://github.com/salesforcecli/plugin-schema-sf/commit/4470ec64c6ecaca8a8ce283d297261b6bc49fa08))
50
+
51
+ ### Bug Fixes
52
+
53
+ - globs don't like windows paths ([15ce2d2](https://github.com/salesforcecli/plugin-schema-sf/commit/15ce2d2442fda92aaeaab910aeb37e480451acaa))
54
+ - normalize windows path output ([f4acadf](https://github.com/salesforcecli/plugin-schema-sf/commit/f4acadffa5943c8503a8f2713f63e9d50353b974))
55
+ - wrong picklist prompt ([116baac](https://github.com/salesforcecli/plugin-schema-sf/commit/116baac59e6bc12fc86044dac4ec818b750f5a73))
package/LICENSE.txt ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2022, Salesforce.com, Inc.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+
8
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+
10
+ * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,282 @@
1
+ **NOTE: This template for sf plugins is not yet offical. Please consult with the Platform CLI team before using this template.**
2
+
3
+ # plugin-template-sf
4
+
5
+ [![NPM](https://img.shields.io/npm/v/@salesforce/plugin-template-sf.svg?label=@salesforce/plugin-template-sf)](https://www.npmjs.com/package/@salesforce/plugin-template-sf) [![CircleCI](https://circleci.com/gh/salesforcecli/plugin-template-sf/tree/main.svg?style=shield)](https://circleci.com/gh/salesforcecli/plugin-template-sf/tree/main) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-template-sf.svg)](https://npmjs.org/package/@salesforce/plugin-template-sf) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-template-sf/main/LICENSE.txt)
6
+
7
+ ## Using the template
8
+
9
+ This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin:
10
+
11
+ 1. Please get in touch with the Platform CLI team. We want to help you develop your plugin.
12
+ 2. Generate your plugin:
13
+
14
+ ```
15
+ sf plugins install dev
16
+ sf dev generate plugin
17
+
18
+ git init -b main
19
+ git add . && git commit -m "chore: initial commit"
20
+ ```
21
+
22
+ 3. Create your plugin's repo in the salesforcecli github org
23
+ 4. When you're ready, replace the contents of this README with the information you want.
24
+
25
+ ## Learn about `sf` plugins
26
+
27
+ Salesforce CLI plugins are based on the [oclif plugin framework](<(https://oclif.io/docs/introduction.html)>). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development.
28
+
29
+ This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce. There is also a default circleci config using the [release management orb](https://github.com/forcedotcom/npm-release-management-orb) standards.
30
+
31
+ Additionally, there are some additional tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled.
32
+
33
+ ### Tooling
34
+
35
+ - [@salesforce/core](https://github.com/forcedotcom/sfdx-core)
36
+ - [@salesforce/kit](https://github.com/forcedotcom/kit)
37
+ - [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
38
+ - [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
39
+ - [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
40
+ - [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
41
+ - [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
42
+
43
+ ### Hooks
44
+
45
+ For cross clouds commands, e.g. `sf env list`, we utilize [oclif hooks](https://oclif.io/docs/hooks) to get the relevant information from installed plugins.
46
+
47
+ This plugin includes sample hooks in the [src/hooks directory](src/hooks). You'll just need to add the appropriate logic. You can also delete any of the hooks if they aren't required for your plugin.
48
+
49
+ # Everything past here is only a suggestion as to what should be in your specific plugin's description
50
+
51
+ This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
52
+
53
+ We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ sf plugins install @salesforce/plugin-template-sf@x.y.z
59
+ ```
60
+
61
+ ## Issues
62
+
63
+ Please report any issues at https://github.com/forcedotcom/cli/issues
64
+
65
+ ## Contributing
66
+
67
+ 1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
68
+ 2. Create a new issue before starting your project so that we can keep track of
69
+ what you are trying to add/fix. That way, we can also offer suggestions or
70
+ let you know if there is already an effort in progress.
71
+ 3. Fork this repository.
72
+ 4. [Build the plugin locally](#build)
73
+ 5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
74
+ 6. Edit the code in your fork.
75
+ 7. Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
76
+ 8. Sign CLA (see [CLA](#cla) below).
77
+ 9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
78
+
79
+ ### CLA
80
+
81
+ External contributors will be required to sign a Contributor's License
82
+ Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
83
+
84
+ ### Build
85
+
86
+ To build the plugin locally, make sure to have yarn installed and run the following commands:
87
+
88
+ ```bash
89
+ # Clone the repository
90
+ git clone git@github.com:salesforcecli/plugin-template-sf
91
+
92
+ # Install the dependencies and compile
93
+ yarn && yarn build
94
+ ```
95
+
96
+ To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
97
+
98
+ ```bash
99
+ # Run using local run file.
100
+ ./bin/dev hello world
101
+ ```
102
+
103
+ There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
104
+
105
+ ```bash
106
+ # Link your plugin to the sf cli
107
+ sf plugins link .
108
+ # To verify
109
+ sf plugins
110
+ ```
111
+
112
+ ## Commands
113
+
114
+ <!-- commands -->
115
+
116
+ - [`sf generate metadata field`](#sf-generate-metadata-field)
117
+ - [`sf generate metadata platformevent`](#sf-generate-metadata-platformevent)
118
+ - [`sf generate metadata sobject`](#sf-generate-metadata-sobject)
119
+ - [`sf generate metadata tab`](#sf-generate-metadata-tab)
120
+
121
+ ## `sf generate metadata field`
122
+
123
+ Generate metadata source files for a new custom field on a specified object.
124
+
125
+ ```
126
+ USAGE
127
+ $ sf generate metadata field -l <value> [-o <value>]
128
+
129
+ FLAGS
130
+ -l, --label=<value> (required) The field's label.
131
+ -o, --object=<value> The directory that contains the object's source files.
132
+
133
+ DESCRIPTION
134
+ Generate metadata source files for a new custom field on a specified object.
135
+
136
+ This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the
137
+ field's label with the "--label" flag. The command uses this label to provide intelligent suggestions for other field
138
+ properties, such as its API name.
139
+
140
+ You can generate a custom field on either a standard object, such as Account, or a custom object. In both cases, the
141
+ source files for the object must already exist in your local project before you run this command. If you create a
142
+ relationship field, the source files for the parent object must also exist in your local directory. Use the command
143
+ "sf metadata retrieve -m CustomObject:<object>" to retrieve source files for both standard and custom objects from
144
+ your org. To create a custom object, run the "sf generate metadata sobject" command or use the Object Manager UI in
145
+ your Salesforce org.
146
+
147
+ EXAMPLES
148
+ Create a field with the specified label; the command prompts you for the object:
149
+
150
+ $ sf generate metadata field --label "My Field"
151
+
152
+ Specify the local path to the object's folder:
153
+
154
+ $ sf generate metadata field --label "My Field" --object force-app/main/default/objects/MyObject__c
155
+
156
+ FLAG DESCRIPTIONS
157
+ -o, --object=<value> The directory that contains the object's source files.
158
+
159
+ The object source files in your local project are grouped in a directoy with the same name as the object. Custom
160
+ object names always end in "__c". An example of the object directory for the Account standard object is
161
+ "force-app/main/default/objects/Account" An example custom object directory is
162
+ "force-app/main/default/objects/MyObject__c"
163
+
164
+ If you don't specify this flag, the command prompts you to choose from your local objects.
165
+ ```
166
+
167
+ ## `sf generate metadata platformevent`
168
+
169
+ Generate metadata source files for a new platform event.
170
+
171
+ ```
172
+ USAGE
173
+ $ sf generate metadata platformevent -l <value>
174
+
175
+ FLAGS
176
+ -l, --label=<value> (required) The platform event's label.
177
+
178
+ DESCRIPTION
179
+ Generate metadata source files for a new platform event.
180
+
181
+ This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the
182
+ event's label with the "--label" flag. The command uses this label to provide intelligent suggestions for other event
183
+ properties, such as its API name.
184
+
185
+ EXAMPLES
186
+ Create a platform event with the specified label:
187
+
188
+ $ sf generate metadata platformevent --label "My Platform Event"
189
+ ```
190
+
191
+ ## `sf generate metadata sobject`
192
+
193
+ Generate metadata source files for a new custom object.
194
+
195
+ ```
196
+ USAGE
197
+ $ sf generate metadata sobject -l <value> [-f]
198
+
199
+ FLAGS
200
+ -f, --use-default-features Enable all optional features without prompting.
201
+ -l, --label=<value> (required) The custom object's label.
202
+
203
+ DESCRIPTION
204
+ Generate metadata source files for a new custom object.
205
+
206
+ This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the
207
+ object's label with the "--label" flag. The command uses this label to provide intelligent suggestions for other
208
+ object properties, such as its API name and plural label.
209
+
210
+ All Salesforce objects are required to have a Name field, so this command also prompts you for the label and type of
211
+ the Name field. Run the "sf metadata generate field" command to create additional fields for the object.
212
+
213
+ To reduce the number of prompts, use the "--use-default-features" flag to automatically enable some features, such as
214
+ reporting and search on the object.
215
+
216
+ EXAMPLES
217
+ Create a custom object with the specified label and be prompted for additional information:
218
+
219
+ $ sf generate metadata sobject --label "My Object"
220
+
221
+ Create a custom object and enable optional features without prompting:
222
+
223
+ $ sf generate metadata sobject --label "My Object" --use-default-features
224
+
225
+ FLAG DESCRIPTIONS
226
+ -f, --use-default-features Enable all optional features without prompting.
227
+
228
+ Enables these features:
229
+
230
+ * Search: Allows users to find the custom object's records when they search, including SOSL.
231
+ * Feeds: Enables feed tracking.
232
+ * Reports: Allows reporting of the data in the custom object records.
233
+ * History: Enables object history tracking.
234
+ * Activities: Allows users to associate tasks and scheduled calendar events related to the custom object records.
235
+ * Bulk API: With Sharing and Streaming API, classifies the custom object as an Enterprise Application object.
236
+ * Sharing: With Bulk API and Streaming API, classifies the custom object as an Enterprise Application object.
237
+ * Streaming API: With Bulk API and Sharing, classifies the custom object as an Enterprise Application object.
238
+ ```
239
+
240
+ ## `sf generate metadata tab`
241
+
242
+ Generate the metadata source files for a new custom tab on a custom object.
243
+
244
+ ```
245
+ USAGE
246
+ $ sf generate metadata tab -o <value> -d <value> -i <value> [--json]
247
+
248
+ FLAGS
249
+ -d, --directory=<value> (required) Path to a "tabs" directory that will contain the source files for your new tab.
250
+ -i, --icon=<value> (required) [default: 1] Number from 1 to 100 that specifies the color scheme and icon for the
251
+ custom tab.
252
+ -o, --object=<value> (required) API name of the custom object you're generating a tab for.
253
+
254
+ GLOBAL FLAGS
255
+ --json Format output as json.
256
+
257
+ DESCRIPTION
258
+ Generate the metadata source files for a new custom tab on a custom object.
259
+
260
+ Custom tabs let you display custom object data or other web content in Salesforce. Custom tabs appear in Salesforce as
261
+ an item in the app’s navigation bar and in the App Launcher.
262
+
263
+ This command must be run in a Salesforce DX project directory. You must pass all required information to it with the
264
+ required flags. The source files for the custom object for which you're generating a tab don't need to exist in your
265
+ local project.
266
+
267
+ EXAMPLES
268
+ Create a tab on the MyObject__c custom object:
269
+
270
+ $ sf generate metadata tab --object MyObject__c --icon 54 --directory force-app/main/default/tabs
271
+
272
+ FLAG DESCRIPTIONS
273
+ -i, --icon=<value> Number from 1 to 100 that specifies the color scheme and icon for the custom tab.
274
+
275
+ See https://lightningdesignsystem.com/icons/\#custom for the available icons.
276
+
277
+ -o, --object=<value> API name of the custom object you're generating a tab for.
278
+
279
+ The API name for a custom object always ends in "__c", such as "MyObject__c".
280
+ ```
281
+
282
+ <!-- commandsstop -->
@@ -0,0 +1,25 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { CustomField } from 'jsforce/api/metadata';
3
+ declare const supportedFieldTypesCustomObject: readonly ["AutoNumber", "Checkbox", "Currency", "DateTime", "Date", "Email", "Html", "Location", "LongTextArea", "Lookup", "MasterDetail", "Number", "Phone", "Picklist", "Text", "Time", "Url"];
4
+ declare type SaveableCustomField = Pick<CustomField, 'label' | 'description' | 'trackHistory' | 'inlineHelpText' | 'required' | 'fullName' | 'type' | 'scale' | 'precision' | 'visibleLines' | 'length'> & {
5
+ displayLocationInDecimal?: boolean;
6
+ type: typeof supportedFieldTypesCustomObject[number];
7
+ };
8
+ export declare type FieldGenerateResult = {
9
+ field: SaveableCustomField;
10
+ path: string;
11
+ };
12
+ export default class FieldGenerate extends SfCommand<FieldGenerateResult> {
13
+ static readonly summary: string;
14
+ static readonly description: string;
15
+ static readonly examples: string[];
16
+ static readonly requiresProject = true;
17
+ static enableJsonFlag: boolean;
18
+ static state: string;
19
+ static flags: {
20
+ label: import("@oclif/core/lib/interfaces").OptionFlag<string>;
21
+ object: import("@oclif/core/lib/interfaces").OptionFlag<string>;
22
+ };
23
+ run(): Promise<FieldGenerateResult>;
24
+ }
25
+ export {};
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*
5
+ * Copyright (c) 2021, 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 fs = require("fs");
11
+ const path = require("path");
12
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
13
+ const core_1 = require("@salesforce/core");
14
+ const convert_1 = require("../../../shared/convert");
15
+ const prompts_1 = require("../../../shared/prompts/prompts");
16
+ const relationshipField_1 = require("../../../shared/prompts/relationshipField");
17
+ const flags_1 = require("../../../shared/flags");
18
+ core_1.Messages.importMessagesDirectory(__dirname);
19
+ const messages = core_1.Messages.load('@salesforce/plugin-sobject', 'generate.field', [
20
+ 'examples',
21
+ 'summary',
22
+ 'description',
23
+ 'flags.label.summary',
24
+ 'flags.object.summary',
25
+ 'flags.object.description',
26
+ 'prompts.type',
27
+ 'prompts.startingNumber',
28
+ 'prompts.defaultValue',
29
+ 'prompts.scale',
30
+ 'prompts.precision',
31
+ 'prompts.inlineHelpText',
32
+ 'prompts.required',
33
+ 'prompts.externalId',
34
+ 'prompts.securityClassification',
35
+ 'error.bigObjects',
36
+ 'error.cmdt',
37
+ 'success',
38
+ ]);
39
+ const MAX_LONG_TEXT_LENGTH = 131072;
40
+ const MAX_TEXT_LENGTH = 255;
41
+ const supportedFieldTypesCustomObject = [
42
+ 'AutoNumber',
43
+ 'Checkbox',
44
+ 'Currency',
45
+ 'DateTime',
46
+ 'Date',
47
+ 'Email',
48
+ 'Html',
49
+ 'Location',
50
+ 'LongTextArea',
51
+ 'Lookup',
52
+ 'MasterDetail',
53
+ 'Number',
54
+ 'Phone',
55
+ 'Picklist',
56
+ 'Text',
57
+ 'Time',
58
+ 'Url',
59
+ ];
60
+ const supportedFieldTypesPlatformEvent = ['Text', 'Number', 'DateTime', 'Date', 'LongTextArea', 'Checkbox'];
61
+ class FieldGenerate extends sf_plugins_core_1.SfCommand {
62
+ async run() {
63
+ const { flags } = await this.parse(FieldGenerate);
64
+ const responses = await this.prompt([
65
+ await (0, prompts_1.objectPrompt)(this.project.getPackageDirectories()),
66
+ (0, prompts_1.apiNamePrompt)(flags.label, 'CustomField'),
67
+ {
68
+ type: 'list',
69
+ message: messages.getMessage('prompts.type'),
70
+ name: 'type',
71
+ choices: (answers) => getSupportedFieldTypes(answers.object),
72
+ },
73
+ // AutoNumber
74
+ {
75
+ type: 'number',
76
+ message: messages.getMessage('prompts.startingNumber'),
77
+ validate: (n) => (0, prompts_1.integerValidation)(n, 0, Number.MAX_SAFE_INTEGER),
78
+ name: 'startingNumber',
79
+ when: (answers) => answers.type === 'AutoNumber',
80
+ default: 0,
81
+ },
82
+ // checkbox type requires a default value
83
+ {
84
+ type: 'list',
85
+ message: messages.getMessage('prompts.defaultValue'),
86
+ choices: [
87
+ { value: false, name: 'false' },
88
+ { value: true, name: 'true' },
89
+ ],
90
+ name: 'defaultValue',
91
+ when: (answers) => answers.type === 'Checkbox',
92
+ default: false,
93
+ },
94
+ // text types
95
+ {
96
+ type: 'number',
97
+ message: `Length (max ${MAX_LONG_TEXT_LENGTH})`,
98
+ validate: (n) => (0, prompts_1.integerValidation)(n, 1, MAX_LONG_TEXT_LENGTH),
99
+ name: 'length',
100
+ when: (answers) => ['Html', 'LongTextArea'].includes(answers.type),
101
+ default: MAX_LONG_TEXT_LENGTH,
102
+ },
103
+ {
104
+ type: 'number',
105
+ message: `Length (max ${MAX_TEXT_LENGTH})`,
106
+ validate: (n) => (0, prompts_1.integerValidation)(n, 1, MAX_TEXT_LENGTH),
107
+ name: 'length',
108
+ when: (answers) => answers.type === 'Text',
109
+ default: MAX_TEXT_LENGTH,
110
+ },
111
+ {
112
+ type: 'number',
113
+ message: 'Visible Lines',
114
+ validate: (n) => (0, prompts_1.integerValidation)(n, 1, 1000),
115
+ name: 'visibleLines',
116
+ when: (answers) => ['Html', 'LongTextArea'].includes(answers.type),
117
+ default: 5,
118
+ },
119
+ // number types
120
+ {
121
+ type: 'number',
122
+ message: messages.getMessage('prompts.scale'),
123
+ validate: (n) => (0, prompts_1.integerValidation)(n, 0, 18),
124
+ name: 'scale',
125
+ when: (answers) => ['Number', 'Currency', 'Location'].includes(answers.type),
126
+ default: 0,
127
+ },
128
+ {
129
+ type: 'number',
130
+ message: messages.getMessage('prompts.precision'),
131
+ validate: (n, answers) => (0, prompts_1.integerValidation)(n, 1, 18 - answers.scale),
132
+ name: 'precision',
133
+ when: (answers) => ['Number', 'Currency'].includes(answers.type),
134
+ default: (answers) => 18 - answers.scale,
135
+ },
136
+ // non-fieldtype-specific questions
137
+ prompts_1.descriptionPrompt,
138
+ {
139
+ type: 'input',
140
+ message: messages.getMessage('prompts.inlineHelpText'),
141
+ name: 'inlineHelpText',
142
+ when: (answers) => !answers.object.includes('__e'),
143
+ },
144
+ {
145
+ type: 'confirm',
146
+ message: messages.getMessage('prompts.required'),
147
+ name: 'required',
148
+ when: (answers) => !['Checkbox', 'MasterDetail', 'Lookup', 'LongTextArea'].includes(answers.type),
149
+ default: false,
150
+ },
151
+ {
152
+ type: 'confirm',
153
+ message: 'Unique',
154
+ name: 'unique',
155
+ when: (answers) => ['Number', 'Text'].includes(answers.type),
156
+ default: false,
157
+ },
158
+ {
159
+ type: 'confirm',
160
+ message: messages.getMessage('prompts.externalId'),
161
+ name: 'externalId',
162
+ when: (answers) => ['Number', 'Text'].includes(answers.type) && answers.object?.endsWith('__e'),
163
+ default: false,
164
+ },
165
+ {
166
+ type: 'list',
167
+ message: messages.getMessage('prompts.securityClassification'),
168
+ name: 'securityClassification',
169
+ choices: ['Public', 'Internal', 'Confidential', 'Restricted', 'Mission Critical'],
170
+ default: 'Internal',
171
+ },
172
+ ],
173
+ // pre-populate the object if they gave us one
174
+ flags.object ? { object: flags.object } : {});
175
+ const { object, ...customField } = responses;
176
+ const result = {
177
+ field: {
178
+ ...customField,
179
+ label: flags.label,
180
+ // always use decimal version of location unless someone asks us not to in a feature request
181
+ ...(customField.type === 'Location' ? { displayLocationInDecimal: true } : {}),
182
+ // building picklists is an independent inquirer series of questions
183
+ ...(customField.type === 'Picklist' ? { valueSet: await (0, prompts_1.picklistPrompts)() } : {}),
184
+ // relationship fields have their own series of questions
185
+ ...(responses.type === 'MasterDetail' || responses.type === 'Lookup'
186
+ ? await (0, relationshipField_1.relationshipFieldPrompts)({
187
+ type: responses.type,
188
+ packageDirs: this.project.getPackageDirectories(),
189
+ childObjectFolderPath: responses.object,
190
+ })
191
+ : {}),
192
+ },
193
+ path: path.join(object, 'fields', `${responses.fullName}.field-meta.xml`),
194
+ };
195
+ this.styledJSON(result);
196
+ await fs.promises.mkdir(path.join(object, 'fields'), { recursive: true });
197
+ await fs.promises.writeFile(result.path, (0, convert_1.convertJsonToXml)({ json: result.field, type: 'CustomField' }));
198
+ this.logSuccess(messages.getMessage('success', [path.join(object, 'fields', `${responses.fullName}.field-meta.xml`)]));
199
+ return result;
200
+ }
201
+ }
202
+ exports.default = FieldGenerate;
203
+ _a = FieldGenerate;
204
+ FieldGenerate.summary = messages.getMessage('summary');
205
+ FieldGenerate.description = messages.getMessage('description');
206
+ FieldGenerate.examples = messages.getMessages('examples');
207
+ FieldGenerate.requiresProject = true;
208
+ FieldGenerate.enableJsonFlag = false;
209
+ FieldGenerate.state = 'beta';
210
+ FieldGenerate.flags = {
211
+ label: sf_plugins_core_1.Flags.string({
212
+ char: 'l',
213
+ summary: messages.getMessage('flags.label.summary'),
214
+ required: true,
215
+ parse: async (label) => (0, flags_1.labelValidation)(label),
216
+ }),
217
+ // this a dir and not an API name to support 1 object being in multiple package directories
218
+ object: sf_plugins_core_1.Flags.directory({
219
+ char: 'o',
220
+ exists: true,
221
+ summary: messages.getMessage('flags.object.summary'),
222
+ description: messages.getMessage('flags.object.description'),
223
+ parse: async (input) => (0, flags_1.isObjectsFolder)(input),
224
+ }),
225
+ };
226
+ /**
227
+ *
228
+ * @param objFolder examples `force-app/main/default/objects/Foo__c` or `force-app/main/default/objects/Foo__e`
229
+ */
230
+ const getSupportedFieldTypes = (objFolder) => {
231
+ if (objFolder.endsWith('__b')) {
232
+ throw new Error(messages.getMessage('error.bigObjects'));
233
+ }
234
+ if (objFolder.endsWith('__mdt')) {
235
+ throw new Error(messages.getMessage('error.cmdt'));
236
+ }
237
+ if (objFolder.includes('__e')) {
238
+ return supportedFieldTypesPlatformEvent;
239
+ }
240
+ return supportedFieldTypesCustomObject;
241
+ };
242
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["../../../../src/commands/generate/metadata/field.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,6BAA6B;AAC7B,iEAA+D;AAC/D,2CAA4C;AAG5C,qDAA2D;AAC3D,6DAMyC;AACzC,iFAAqF;AACrF,iDAAyE;AAEzE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,4BAA4B,EAAE,gBAA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AE,EAAE,CAAC,IAAA,uBAAe,EAAC,KAAK,CAAC;KAC/C,CAAC;IACF,2FAA2F;IAC3F,MAAM,EAAE,uBAAK,CAAC,SAAS,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QAC5D,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,IAAA,uBAAe,EAAC,KAAK,CAAC;KAC/C,CAAC;CACF,CAAA;AAuJJ;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAC7B,SAAiB,EACiE,EAAE;IACpF,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;KAC1D;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;KACpD;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC7B,OAAO,gCAAgC,CAAC;KACzC;IACD,OAAO,+BAA+B,CAAC;AACzC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { SaveablePlatformEvent } from '../../../shared/types';
3
+ export declare type PlatformEventGenerateResult = {
4
+ object: SaveablePlatformEvent;
5
+ path: string;
6
+ };
7
+ export default class ObjectGenerate extends SfCommand<PlatformEventGenerateResult> {
8
+ static readonly summary: string;
9
+ static readonly description: string;
10
+ static readonly examples: string[];
11
+ static readonly requiresProject = true;
12
+ static enableJsonFlag: boolean;
13
+ static state: string;
14
+ static flags: {
15
+ label: import("@oclif/core/lib/interfaces").OptionFlag<string>;
16
+ };
17
+ run(): Promise<PlatformEventGenerateResult>;
18
+ }