@salesforce/plugin-custom-metadata 1.1.0 → 2.0.0
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/CHANGELOG.md +14 -12
- package/LICENSE.txt +2 -2
- package/README.md +137 -133
- package/lib/commands/force/cmdt/create.d.ts +8 -2
- package/lib/commands/force/cmdt/create.js +15 -21
- package/lib/commands/force/cmdt/create.js.map +1 -1
- package/lib/commands/force/cmdt/field/create.d.ts +7 -2
- package/lib/commands/force/cmdt/field/create.js +15 -20
- package/lib/commands/force/cmdt/field/create.js.map +1 -1
- package/lib/commands/force/cmdt/generate.d.ts +6 -2
- package/lib/commands/force/cmdt/generate.js +79 -150
- package/lib/commands/force/cmdt/generate.js.map +1 -1
- package/lib/commands/force/cmdt/record/create.d.ts +14 -3
- package/lib/commands/force/cmdt/record/create.js +25 -33
- package/lib/commands/force/cmdt/record/create.js.map +1 -1
- package/lib/commands/force/cmdt/record/insert.d.ts +2 -2
- package/lib/commands/force/cmdt/record/insert.js +28 -40
- package/lib/commands/force/cmdt/record/insert.js.map +1 -1
- package/lib/lib/helpers/createUtil.d.ts +10 -6
- package/lib/lib/helpers/createUtil.js +48 -100
- package/lib/lib/helpers/createUtil.js.map +1 -1
- package/lib/lib/helpers/fileWriter.d.ts +11 -11
- package/lib/lib/helpers/fileWriter.js +14 -24
- package/lib/lib/helpers/fileWriter.js.map +1 -1
- package/lib/lib/helpers/metadataUtil.d.ts +25 -51
- package/lib/lib/helpers/metadataUtil.js +55 -131
- package/lib/lib/helpers/metadataUtil.js.map +1 -1
- package/lib/lib/helpers/validationUtil.d.ts +25 -26
- package/lib/lib/helpers/validationUtil.js +66 -43
- package/lib/lib/helpers/validationUtil.js.map +1 -1
- package/lib/lib/interfaces/createConfig.d.ts +3 -2
- package/lib/lib/templates/templates.d.ts +8 -99
- package/lib/lib/templates/templates.js +38 -67
- package/lib/lib/templates/templates.js.map +1 -1
- package/messages/createField.json +22 -31
- package/messages/generate.json +38 -51
- package/messages/template.json +2 -2
- package/messages/validation.json +5 -0
- package/oclif.manifest.json +1 -1
- package/package.json +53 -42
- package/lib/lib/interfaces/customField.d.ts +0 -7
- package/lib/lib/interfaces/customField.js +0 -9
- package/lib/lib/interfaces/customField.js.map +0 -1
- package/lib/lib/interfaces/errorMessage.d.ts +0 -4
- package/lib/lib/interfaces/errorMessage.js +0 -9
- package/lib/lib/interfaces/errorMessage.js.map +0 -1
- package/lib/lib/interfaces/record.d.ts +0 -3
- package/lib/lib/interfaces/record.js +0 -9
- package/lib/lib/interfaces/record.js.map +0 -1
- package/lib/lib/interfaces/saveResults.d.ts +0 -5
- package/lib/lib/interfaces/saveResults.js +0 -9
- package/lib/lib/interfaces/saveResults.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,38 +2,40 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
-
## [
|
|
6
|
-
|
|
5
|
+
## [2.0.0](https://github.com/salesforcecli/plugin-custom-metadata/compare/v1.0.12...v2.0.0) (2022-06-03)
|
|
7
6
|
|
|
8
7
|
### Features
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
- bin/dev ([99555d1](https://github.com/salesforcecli/plugin-custom-metadata/commit/99555d1009d4e4abb2959abe60bf308a7293829b))
|
|
10
|
+
- bump deps ([d33c882](https://github.com/salesforcecli/plugin-custom-metadata/commit/d33c882817d296a7e039a78641553bcb00685727))
|
|
11
|
+
- interfaces for command return types ([68dd30b](https://github.com/salesforcecli/plugin-custom-metadata/commit/68dd30bff5052ed3bd9910a329c20f230b4227d1))
|
|
11
12
|
|
|
12
|
-
###
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- error name ([84dffb3](https://github.com/salesforcecli/plugin-custom-metadata/commit/84dffb35e722ce677aadf5cc5126d8f5814f00bc))
|
|
16
|
+
- trailing slashes bug on field writers ([5166a84](https://github.com/salesforcecli/plugin-custom-metadata/commit/5166a84f104dc818c6acd571b14f7097fae2c06d))
|
|
13
17
|
|
|
18
|
+
### [1.0.12](https://github.com/salesforcecli/plugin-custom-metadata/compare/v1.0.11...v1.0.12) (2021-04-06)
|
|
14
19
|
|
|
15
20
|
### Bug Fixes
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
- leif .yml merge [skip-validate-pr] ([9177fdc](https://github.com/salesforcecli/plugin-custom-metadata/commit/9177fdc23b42f6cd1c96ee1d34cf74093994c407))
|
|
18
23
|
|
|
19
24
|
### [1.0.11](https://github.com/salesforcecli/plugin-custom-metadata/compare/v1.0.10...v1.0.11) (2020-12-10)
|
|
20
25
|
|
|
21
26
|
### [1.0.10](https://github.com/salesforcecli/plugin-custom-metadata/compare/v1.0.8...v1.0.10) (2020-08-27)
|
|
22
27
|
|
|
23
|
-
|
|
24
28
|
### Features
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
- use npm-release-management-orb ([7154761](https://github.com/salesforcecli/plugin-custom-metadata/commit/7154761d3f0cfedc223f3a38cb7c8970f616bf22))
|
|
27
31
|
|
|
28
32
|
# 1.0.0 (2020-06-02)
|
|
29
33
|
|
|
30
|
-
|
|
31
34
|
### Features
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
- initial release ([e7f004d](https://github.com/salesforcecli/plugin-custom-metadata/commit/e7f004dffa0bc7e9a29002f7d9383712a4787d17))
|
|
35
37
|
|
|
36
38
|
### Reverts
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
- Revert "add in testing for metadata call" ([cb981e7](https://github.com/salesforcecli/plugin-custom-metadata/commit/cb981e70b646d65eb2b037751f7631d0f11e2498))
|
|
41
|
+
- Revert "fix tslint" ([f180242](https://github.com/salesforcecli/plugin-custom-metadata/commit/f1802429bdf16e67dd69d94b586bc6dbf85873b7))
|
package/LICENSE.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2022, Salesforce.com, Inc.
|
|
2
2
|
All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -9,4 +9,4 @@ Redistribution and use in source and binary forms, with or without modification,
|
|
|
9
9
|
|
|
10
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
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.
|
|
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
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
Custom Metadata Plugin
|
|
2
|
-
==============
|
|
1
|
+
# Custom Metadata Plugin
|
|
3
2
|
|
|
4
3
|
Tools for working with custom metadata types and their records.
|
|
5
4
|
|
|
@@ -19,7 +18,7 @@ sfdx plugins:install custom-metadata@x.y.z
|
|
|
19
18
|
|
|
20
19
|
## Issues
|
|
21
20
|
|
|
22
|
-
Please report any issues at https://github.com/forcedotcom/cli/issues
|
|
21
|
+
Please report any issues at <https://github.com/forcedotcom/cli/issues>
|
|
23
22
|
|
|
24
23
|
## Contributing
|
|
25
24
|
|
|
@@ -38,7 +37,7 @@ Please report any issues at https://github.com/forcedotcom/cli/issues
|
|
|
38
37
|
### CLA
|
|
39
38
|
|
|
40
39
|
External contributors will be required to sign a Contributor's License
|
|
41
|
-
Agreement. You can do so by going to https://cla.salesforce.com/sign-cla
|
|
40
|
+
Agreement. You can do so by going to <https://cla.salesforce.com/sign-cla>.
|
|
42
41
|
|
|
43
42
|
### Build
|
|
44
43
|
|
|
@@ -53,11 +52,11 @@ yarn install
|
|
|
53
52
|
yarn build
|
|
54
53
|
```
|
|
55
54
|
|
|
56
|
-
To use your plugin, run using the local `./bin/
|
|
55
|
+
To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
|
|
57
56
|
|
|
58
57
|
```bash
|
|
59
58
|
# Run using local run file.
|
|
60
|
-
./bin/
|
|
59
|
+
./bin/dev force:cmdt
|
|
61
60
|
```
|
|
62
61
|
|
|
63
62
|
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.
|
|
@@ -70,12 +69,14 @@ sfdx plugins
|
|
|
70
69
|
```
|
|
71
70
|
|
|
72
71
|
# Commands
|
|
72
|
+
|
|
73
73
|
<!-- commands -->
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
|
|
75
|
+
- [`sfdx force:cmdt:create -n <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public] [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcecmdtcreate--n-string--l-string--p-string--v-packageprotectedprotectedpublic--d-directory---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
76
|
+
- [`sfdx force:cmdt:field:create -n <string> -f Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|LongTextArea|Url [-p <array>] [-s <number>] [-l <string>] [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcecmdtfieldcreate--n-string--f-checkboxdatedatetimeemailnumberpercentphonepicklisttexttextarealongtextareaurl--p-array--s-number--l-string--d-directory---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
77
|
+
- [`sfdx force:cmdt:generate -n <string> -s <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public] [-i] [-d <directory>] [-r <directory>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcecmdtgenerate--n-string--s-string--l-string--p-string--v-packageprotectedprotectedpublic--i--d-directory--r-directory--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
78
|
+
- [`sfdx force:cmdt:record:create [name=value...] -t <string> -n <string> [-l <string>] [-p <string>] [-i <directory>] [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcecmdtrecordcreate-namevalue--t-string--n-string--l-string--p-string--i-directory--d-directory---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
79
|
+
- [`sfdx force:cmdt:record:insert -f <string> -t <string> [-i <directory>] [-d <directory>] [-n <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcecmdtrecordinsert--f-string--t-string--i-directory--d-directory--n-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
79
80
|
|
|
80
81
|
## `sfdx force:cmdt:create -n <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public] [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
81
82
|
|
|
@@ -83,38 +84,37 @@ creates a new custom metadata type in the current project
|
|
|
83
84
|
|
|
84
85
|
```
|
|
85
86
|
USAGE
|
|
86
|
-
$ sfdx force:cmdt:create -n <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public] [-d
|
|
87
|
-
|
|
87
|
+
$ sfdx force:cmdt:create -n <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public] [-d
|
|
88
|
+
<directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
-d, --outputdir
|
|
90
|
+
FLAGS
|
|
91
|
+
-d, --outputdir=<value> directory to store the newly-created
|
|
91
92
|
custom metadata type files
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
-n, --typename=typename (required) unique object name for
|
|
93
|
+
-l, --label=<value> label for the custom metadata type
|
|
94
|
+
-n, --typename=<value> (required) unique object name for
|
|
96
95
|
the custom metadata type
|
|
97
|
-
|
|
98
|
-
-p, --plurallabel=plurallabel plural version of the label value;
|
|
96
|
+
-p, --plurallabel=<value> plural version of the label value;
|
|
99
97
|
if blank, uses label
|
|
100
|
-
|
|
101
98
|
-v, --visibility=(PackageProtected|Protected|Public) [default: Public] visibility of the
|
|
102
99
|
custom metadata type
|
|
103
|
-
|
|
104
100
|
--json format output as json
|
|
105
|
-
|
|
106
101
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
107
102
|
this command invocation
|
|
108
103
|
|
|
104
|
+
DESCRIPTION
|
|
105
|
+
creates a new custom metadata type in the current project
|
|
106
|
+
|
|
109
107
|
EXAMPLES
|
|
110
108
|
Create a custom metadata type with developer name 'MyCustomType'; this name will also be used as the label:
|
|
109
|
+
|
|
111
110
|
$ sfdx force:cmdt:create --typename MyCustomType
|
|
111
|
+
|
|
112
112
|
Create a protected custom metadata type with a specific label:
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
|
|
114
|
+
$ sfdx force:cmdt:create --typename MyCustomType --label "Custom Type" --plurallabel "Custom Types" --visibility Protected
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
_See code: [src/commands/force/cmdt/create.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/
|
|
117
|
+
_See code: [src/commands/force/cmdt/create.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/v2.0.0/src/commands/force/cmdt/create.ts)_
|
|
118
118
|
|
|
119
119
|
## `sfdx force:cmdt:field:create -n <string> -f Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|LongTextArea|Url [-p <array>] [-s <number>] [-l <string>] [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
120
120
|
|
|
@@ -122,29 +122,29 @@ generate a custom metadata field based on the field type provided
|
|
|
122
122
|
|
|
123
123
|
```
|
|
124
124
|
USAGE
|
|
125
|
-
$ sfdx force:cmdt:field:create -n <string> -f
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
$ sfdx force:cmdt:field:create -n <string> -f
|
|
126
|
+
Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|LongTextArea|Url [-p <array>] [-s <number>]
|
|
127
|
+
[-l <string>] [-d <directory>] [--json] [--loglevel
|
|
128
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
-d, --outputdir
|
|
130
|
+
FLAGS
|
|
131
|
+
-d, --outputdir=<value>
|
|
132
132
|
directory to store newly-created field definition files
|
|
133
133
|
|
|
134
134
|
-f, --fieldtype=(Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|LongTextArea|Url)
|
|
135
135
|
(required) type of field
|
|
136
136
|
|
|
137
|
-
-l, --label
|
|
137
|
+
-l, --label=<value>
|
|
138
138
|
label for the field
|
|
139
139
|
|
|
140
|
-
-n, --fieldname
|
|
140
|
+
-n, --fieldname=<value>
|
|
141
141
|
(required) unique name for the field
|
|
142
142
|
|
|
143
|
-
-p, --picklistvalues
|
|
143
|
+
-p, --picklistvalues=<value>
|
|
144
144
|
comma-separated list of picklist values; required for Picklist fields
|
|
145
145
|
|
|
146
|
-
-s, --decimalplaces
|
|
147
|
-
|
|
146
|
+
-s, --decimalplaces=<value>
|
|
147
|
+
number of decimal places to use for Number or Percent fields
|
|
148
148
|
|
|
149
149
|
--json
|
|
150
150
|
format output as json
|
|
@@ -152,16 +152,24 @@ OPTIONS
|
|
|
152
152
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
|
|
153
153
|
[default: warn] logging level for this command invocation
|
|
154
154
|
|
|
155
|
+
DESCRIPTION
|
|
156
|
+
generate a custom metadata field based on the field type provided
|
|
157
|
+
|
|
155
158
|
EXAMPLES
|
|
156
159
|
Create a metadata file for a custom checkbox field:
|
|
160
|
+
|
|
157
161
|
$ sfdx force:cmdt:field:create --fieldname MyField --fieldtype Checkbox
|
|
162
|
+
|
|
158
163
|
Create a metadata file for a custom picklist field:
|
|
164
|
+
|
|
159
165
|
$ sfdx force:cmdt:field:create --fieldname MyField --fieldtype Picklist --picklistvalues "A,B,C"
|
|
166
|
+
|
|
160
167
|
Create a metadata file for a custom number field:
|
|
168
|
+
|
|
161
169
|
$ sfdx force:cmdt:field:create --fieldname MyField --fieldtype Number --decimalplaces 2
|
|
162
170
|
```
|
|
163
171
|
|
|
164
|
-
_See code: [src/commands/force/cmdt/field/create.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/
|
|
172
|
+
_See code: [src/commands/force/cmdt/field/create.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/v2.0.0/src/commands/force/cmdt/field/create.ts)_
|
|
165
173
|
|
|
166
174
|
## `sfdx force:cmdt:generate -n <string> -s <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public] [-i] [-d <directory>] [-r <directory>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
167
175
|
|
|
@@ -169,72 +177,68 @@ generates a custom metadata type and all its records for the provided sObject
|
|
|
169
177
|
|
|
170
178
|
```
|
|
171
179
|
USAGE
|
|
172
|
-
$ sfdx force:cmdt:generate -n <string> -s <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public]
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
$ sfdx force:cmdt:generate -n <string> -s <string> [-l <string>] [-p <string>] [-v PackageProtected|Protected|Public]
|
|
181
|
+
[-i] [-d <directory>] [-r <directory>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
|
|
182
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
175
183
|
|
|
176
|
-
|
|
177
|
-
-d, --typeoutputdir
|
|
178
|
-
force-app/main/default/objects
|
|
184
|
+
FLAGS
|
|
185
|
+
-d, --typeoutputdir=<value> [default:
|
|
186
|
+
force-app/main/default/objects]
|
|
179
187
|
directory to store newly-created
|
|
180
188
|
custom metadata type files
|
|
181
|
-
|
|
182
189
|
-i, --ignoreunsupported ignore unsupported field types
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
-n, --devname=devname (required) name of the custom
|
|
190
|
+
-l, --label=<value> label for the custom metadata type
|
|
191
|
+
-n, --devname=<value> (required) name of the custom
|
|
187
192
|
metadata type
|
|
188
|
-
|
|
189
|
-
-p, --plurallabel=plurallabel plural version of the label value;
|
|
193
|
+
-p, --plurallabel=<value> plural version of the label value;
|
|
190
194
|
if blank, uses label
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
tomMetadata/] directory to store
|
|
195
|
+
-r, --recordsoutputdir=<value> [default: force-app/main/default/cus
|
|
196
|
+
tomMetadata] directory to store
|
|
194
197
|
newly-created custom metadata record
|
|
195
198
|
files
|
|
196
|
-
|
|
197
|
-
-s, --sobjectname=sobjectname (required) API name of the sObject
|
|
199
|
+
-s, --sobjectname=<value> (required) API name of the sObject
|
|
198
200
|
source for custom metadata
|
|
199
201
|
generation
|
|
200
|
-
|
|
201
|
-
-u, --targetusername=targetusername username or alias for the target
|
|
202
|
+
-u, --targetusername=<value> username or alias for the target
|
|
202
203
|
org; overrides default target org
|
|
203
|
-
|
|
204
204
|
-v, --visibility=(PackageProtected|Protected|Public) [default: Public] visibility of the
|
|
205
205
|
custom metadata type
|
|
206
|
-
|
|
207
|
-
--apiversion=apiversion override the api version used for
|
|
206
|
+
--apiversion=<value> override the api version used for
|
|
208
207
|
api requests made by this command
|
|
209
|
-
|
|
210
208
|
--json format output as json
|
|
211
|
-
|
|
212
209
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
213
210
|
this command invocation
|
|
214
211
|
|
|
212
|
+
DESCRIPTION
|
|
213
|
+
generates a custom metadata type and all its records for the provided sObject
|
|
214
|
+
|
|
215
215
|
EXAMPLES
|
|
216
216
|
Generate a custom metadata type from an sObject in the default target org:
|
|
217
|
+
|
|
217
218
|
$ sfdx force:cmdt:generate --devname MyCMDT --sobjectname MySourceObject__c
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
'alias or user email of the org containing the source type'
|
|
219
|
+
|
|
220
|
+
Generate a custom metadata type from an sObject in the specified target org; ignore unsupported field types instead of converting them to text:
|
|
221
|
+
|
|
222
|
+
$ sfdx force:cmdt:generate --devname MyCMDT --sobjectname MySourceObject__c --ignoreunsupported --targetusername 'alias or user email of the org containing the source type'
|
|
223
|
+
|
|
222
224
|
Generate a protected custom metadata type from an sObject in the default target org:
|
|
225
|
+
|
|
223
226
|
$ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomObject__c --visibility Protected
|
|
227
|
+
|
|
224
228
|
Generate a protected custom metadata type with a specific label from an sObject in the default target org:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
in the specified directory:
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
|
|
230
|
+
$ sfdx force:cmdt:generate --devname MyCMDT --label "My CMDT" --plurallabel "My CMDTs" --sobjectname SourceCustomSetting__c --visibility Protected
|
|
231
|
+
|
|
232
|
+
Generate a custom metadata type from an sObject in the default target org; put the resulting type metadata file in the specified directory:
|
|
233
|
+
|
|
234
|
+
$ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomSetting__c --typeoutputdir 'path/to/my/cmdt/directory'
|
|
235
|
+
|
|
236
|
+
Generate a custom metadata type from an sObject in the default target org; put the resulting record metadata file(s) in the specified directory:
|
|
237
|
+
|
|
238
|
+
$ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomSetting__c --recordsoutputdir 'path/to/my/cmdt/record/directory'
|
|
235
239
|
```
|
|
236
240
|
|
|
237
|
-
_See code: [src/commands/force/cmdt/generate.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/
|
|
241
|
+
_See code: [src/commands/force/cmdt/generate.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/v2.0.0/src/commands/force/cmdt/generate.ts)_
|
|
238
242
|
|
|
239
243
|
## `sfdx force:cmdt:record:create [name=value...] -t <string> -n <string> [-l <string>] [-p <string>] [-i <directory>] [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
240
244
|
|
|
@@ -242,46 +246,43 @@ create a new record for a given custom metadata type in the current project
|
|
|
242
246
|
|
|
243
247
|
```
|
|
244
248
|
USAGE
|
|
245
|
-
$ sfdx force:cmdt:record:create [name=value...] -t <string> -n <string> [-l <string>] [-p <string>] [-i <directory>]
|
|
246
|
-
|
|
249
|
+
$ sfdx force:cmdt:record:create [name=value...] -t <string> -n <string> [-l <string>] [-p <string>] [-i <directory>] [-d
|
|
250
|
+
<directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
247
251
|
|
|
248
|
-
|
|
249
|
-
-d, --outputdir
|
|
252
|
+
FLAGS
|
|
253
|
+
-d, --outputdir=<value> [default: force-app/main/default/cus
|
|
250
254
|
tomMetadata] directory to store
|
|
251
255
|
newly-created custom metadata record
|
|
252
256
|
files
|
|
253
|
-
|
|
254
|
-
-i, --inputdir=inputdir [default:
|
|
257
|
+
-i, --inputdir=<value> [default:
|
|
255
258
|
force-app/main/default/objects]
|
|
256
259
|
directory to pull the custom
|
|
257
260
|
metadata type definition from
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
-n, --recordname=recordname (required) name for the new record
|
|
262
|
-
|
|
263
|
-
-p, --protected=true|false [default: false] protect the record
|
|
261
|
+
-l, --label=<value> label for the new record
|
|
262
|
+
-n, --recordname=<value> (required) name for the new record
|
|
263
|
+
-p, --protected=<option> [default: false] protect the record
|
|
264
264
|
when it is in a managed package
|
|
265
|
-
|
|
266
|
-
-t, --typename
|
|
265
|
+
<options: true|false>
|
|
266
|
+
-t, --typename=<value> (required) API name of the custom
|
|
267
267
|
metadata type to create a record for
|
|
268
|
-
|
|
269
268
|
--json format output as json
|
|
270
|
-
|
|
271
269
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
272
270
|
this command invocation
|
|
273
271
|
|
|
272
|
+
DESCRIPTION
|
|
273
|
+
create a new record for a given custom metadata type in the current project
|
|
274
|
+
|
|
274
275
|
EXAMPLES
|
|
275
276
|
Create a record metadata file for custom metadata type 'MyCMT' with values specified for two custom fields:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
for two custom fields:
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
|
|
278
|
+
$ sfdx force:cmdt:record:create --typename MyCMT__mdt --recordname MyRecord My_Custom_Field_1=Foo My_Custom_Field_2=Bar
|
|
279
|
+
|
|
280
|
+
Create a protected record metadata file for custom metadata type 'MyCMT' with a specific label and values specified for two custom fields:
|
|
281
|
+
|
|
282
|
+
$ sfdx force:cmdt:record:create --typename MyCMT__mdt --recordname MyRecord --label "My Record" --protected true My_Custom_Field_1=Foo My_Custom_Field_2=Bar
|
|
282
283
|
```
|
|
283
284
|
|
|
284
|
-
_See code: [src/commands/force/cmdt/record/create.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/
|
|
285
|
+
_See code: [src/commands/force/cmdt/record/create.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/v2.0.0/src/commands/force/cmdt/record/create.ts)_
|
|
285
286
|
|
|
286
287
|
## `sfdx force:cmdt:record:insert -f <string> -t <string> [-i <directory>] [-d <directory>] [-n <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
287
288
|
|
|
@@ -289,67 +290,70 @@ create new custom metadata type records from a CSV file
|
|
|
289
290
|
|
|
290
291
|
```
|
|
291
292
|
USAGE
|
|
292
|
-
$ sfdx force:cmdt:record:insert -f <string> -t <string> [-i <directory>] [-d <directory>] [-n <string>] [--json]
|
|
293
|
-
|
|
293
|
+
$ sfdx force:cmdt:record:insert -f <string> -t <string> [-i <directory>] [-d <directory>] [-n <string>] [--json] [--loglevel
|
|
294
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
294
295
|
|
|
295
|
-
|
|
296
|
-
-d, --outputdir
|
|
296
|
+
FLAGS
|
|
297
|
+
-d, --outputdir=<value> [default: force-app/main/default/cus
|
|
297
298
|
tomMetadata] directory to store
|
|
298
299
|
newly-created custom metadata record
|
|
299
300
|
files
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
-i, --inputdir=inputdir [default:
|
|
301
|
+
-f, --filepath=<value> (required) path to the CSV file
|
|
302
|
+
-i, --inputdir=<value> [default:
|
|
304
303
|
force-app/main/default/objects]
|
|
305
304
|
directory to pull the custom
|
|
306
305
|
metadata type definition from
|
|
307
|
-
|
|
308
|
-
-n, --namecolumn=namecolumn [default: Name] column that is used
|
|
306
|
+
-n, --namecolumn=<value> [default: Name] column that is used
|
|
309
307
|
to determine the name of the record
|
|
310
|
-
|
|
311
|
-
-t, --typename=typename (required) API name of the custom
|
|
308
|
+
-t, --typename=<value> (required) API name of the custom
|
|
312
309
|
metadata type
|
|
313
|
-
|
|
314
310
|
--json format output as json
|
|
315
|
-
|
|
316
311
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
317
312
|
this command invocation
|
|
318
313
|
|
|
314
|
+
DESCRIPTION
|
|
315
|
+
create new custom metadata type records from a CSV file
|
|
316
|
+
|
|
319
317
|
EXAMPLES
|
|
320
|
-
Create record metadata files for type 'My_CMDT_Name' (from your local project) based on values in a CSV file, using
|
|
321
|
-
|
|
318
|
+
Create record metadata files for type 'My_CMDT_Name' (from your local project) based on values in a CSV file, using 'Name' as the column that specifies the record name:
|
|
319
|
+
|
|
322
320
|
$ sfdx force:cmdt:record:insert --filepath path/to/my.csv --typename My_CMDT_Name
|
|
323
|
-
|
|
324
|
-
using 'PrimaryKey' as the column that specifies the record name:
|
|
325
|
-
|
|
326
|
-
|
|
321
|
+
|
|
322
|
+
Create record metadata files for type 'My_CMDT_Name' (from the specified directory) based on values in a CSV file, using 'PrimaryKey' as the column that specifies the record name:
|
|
323
|
+
|
|
324
|
+
$ sfdx force:cmdt:record:insert --filepath path/to/my.csv --typename My_CMDT_Name --inputdir "path/to/my/cmdt/directory" --namecolumn "PrimaryKey"
|
|
327
325
|
```
|
|
328
326
|
|
|
329
|
-
_See code: [src/commands/force/cmdt/record/insert.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/
|
|
327
|
+
_See code: [src/commands/force/cmdt/record/insert.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/v2.0.0/src/commands/force/cmdt/record/insert.ts)_
|
|
328
|
+
|
|
330
329
|
<!-- commandsstop -->
|
|
331
330
|
|
|
332
331
|
<!-- debugging-your-plugin -->
|
|
332
|
+
|
|
333
333
|
# Debugging your plugin
|
|
334
|
+
|
|
334
335
|
We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the `.vscode` directory of this plugin is a `launch.json` config file, which allows you to attach a debugger to the node process when running your commands.
|
|
335
336
|
|
|
336
|
-
To debug the `hello:org` command:
|
|
337
|
+
To debug the `hello:org` command:
|
|
338
|
+
|
|
337
339
|
1. Start the inspector
|
|
338
|
-
|
|
339
|
-
If you linked your plugin to the sfdx cli, call your command with the `dev-suspend` switch:
|
|
340
|
+
|
|
341
|
+
If you linked your plugin to the sfdx cli, call your command with the `dev-suspend` switch:
|
|
342
|
+
|
|
340
343
|
```sh-session
|
|
341
|
-
|
|
344
|
+
sfdx hello:org -u myOrg@example.com --dev-suspend
|
|
342
345
|
```
|
|
343
|
-
|
|
344
|
-
Alternatively, to call your command using the `bin/
|
|
346
|
+
|
|
347
|
+
Alternatively, to call your command using the `bin/dev` script, set the `NODE_OPTIONS` environment variable to `--inspect-brk` when starting the debugger:
|
|
348
|
+
|
|
345
349
|
```sh-session
|
|
346
|
-
|
|
350
|
+
NODE_OPTIONS=--inspect-brk bin/dev hello:org -u myOrg@example.com
|
|
347
351
|
```
|
|
348
352
|
|
|
349
353
|
2. Set some breakpoints in your command code
|
|
350
354
|
3. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
|
|
351
355
|
4. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen.
|
|
352
|
-
5. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
|
|
356
|
+
5. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
|
|
353
357
|
6. Hit the green play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5).
|
|
354
|
-
<br><img src=".images/vscodeScreenshot.png" width="480" height="278"><br>
|
|
355
|
-
Congrats, you are debugging!
|
|
358
|
+
<br><img src=".images/vscodeScreenshot.png" width="480" height="278"><br>
|
|
359
|
+
Congrats, you are debugging!
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
-
|
|
2
|
+
interface CmdtCreateResponse {
|
|
3
|
+
typename: string;
|
|
4
|
+
label: string;
|
|
5
|
+
pluralLabel: string;
|
|
6
|
+
visibility: string;
|
|
7
|
+
}
|
|
3
8
|
export default class Create extends SfdxCommand {
|
|
4
9
|
static description: string;
|
|
5
10
|
static longDescription: string;
|
|
@@ -15,5 +20,6 @@ export default class Create extends SfdxCommand {
|
|
|
15
20
|
outputdir: flags.Discriminated<flags.String>;
|
|
16
21
|
};
|
|
17
22
|
protected static requiresProject: boolean;
|
|
18
|
-
run(): Promise<
|
|
23
|
+
run(): Promise<CmdtCreateResponse>;
|
|
19
24
|
}
|
|
25
|
+
export {};
|