@sharinpix/sharinpix-sf-cli 1.8.0 → 1.9.1
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/README.md +74 -2
- package/lib/commands/sharinpix/form/csv2json.d.ts +12 -0
- package/lib/commands/sharinpix/form/csv2json.js +159 -0
- package/lib/commands/sharinpix/form/csv2json.js.map +1 -0
- package/lib/commands/sharinpix/form/json2csv.d.ts +12 -0
- package/lib/commands/sharinpix/form/json2csv.js +97 -0
- package/lib/commands/sharinpix/form/json2csv.js.map +1 -0
- package/lib/commands/sharinpix/form/pull.d.ts +1 -0
- package/lib/commands/sharinpix/form/pull.js +9 -1
- package/lib/commands/sharinpix/form/pull.js.map +1 -1
- package/lib/commands/sharinpix/form/push.d.ts +1 -0
- package/lib/commands/sharinpix/form/push.js +47 -60
- package/lib/commands/sharinpix/form/push.js.map +1 -1
- package/lib/commands/sharinpix/permission/push.js +29 -40
- package/lib/commands/sharinpix/permission/push.js.map +1 -1
- package/lib/helpers/form/elementKeyOrder.d.ts +1 -0
- package/lib/helpers/form/elementKeyOrder.js +53 -0
- package/lib/helpers/form/elementKeyOrder.js.map +1 -0
- package/lib/helpers/utils.d.ts +9 -0
- package/lib/helpers/utils.js +57 -0
- package/lib/helpers/utils.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/messages/sharinpix.form.csv2json.md +49 -0
- package/messages/sharinpix.form.json2csv.md +37 -0
- package/messages/sharinpix.form.pull.md +12 -0
- package/messages/sharinpix.form.push.md +12 -0
- package/oclif.lock +55 -11
- package/oclif.manifest.json +123 -3
- package/package.json +7 -3
package/oclif.manifest.json
CHANGED
|
@@ -1,12 +1,115 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
+
"sharinpix:form:csv2json": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Scans the local `sharinpix/forms` directory for SharinPix form CSV definition files and generates corresponding JSON files. Each CSV file is expected to have a header row of element keys and one row per element, as produced by the json2csv command.",
|
|
7
|
+
"examples": [
|
|
8
|
+
"Generate JSON files for all local SharinPix form CSV definitions:\n<%= config.bin %> <%= command.id %>"
|
|
9
|
+
],
|
|
10
|
+
"flags": {
|
|
11
|
+
"json": {
|
|
12
|
+
"description": "Format output as json.",
|
|
13
|
+
"helpGroup": "GLOBAL",
|
|
14
|
+
"name": "json",
|
|
15
|
+
"allowNo": false,
|
|
16
|
+
"type": "boolean"
|
|
17
|
+
},
|
|
18
|
+
"flags-dir": {
|
|
19
|
+
"helpGroup": "GLOBAL",
|
|
20
|
+
"name": "flags-dir",
|
|
21
|
+
"summary": "Import flag values from a directory.",
|
|
22
|
+
"hasDynamicHelp": false,
|
|
23
|
+
"multiple": false,
|
|
24
|
+
"type": "option"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"hasDynamicHelp": false,
|
|
28
|
+
"hiddenAliases": [],
|
|
29
|
+
"id": "sharinpix:form:csv2json",
|
|
30
|
+
"pluginAlias": "@sharinpix/sharinpix-sf-cli",
|
|
31
|
+
"pluginName": "@sharinpix/sharinpix-sf-cli",
|
|
32
|
+
"pluginType": "core",
|
|
33
|
+
"strict": true,
|
|
34
|
+
"summary": "Generate JSON files from SharinPix form CSV definitions.",
|
|
35
|
+
"enableJsonFlag": true,
|
|
36
|
+
"isESM": true,
|
|
37
|
+
"relativePath": [
|
|
38
|
+
"lib",
|
|
39
|
+
"commands",
|
|
40
|
+
"sharinpix",
|
|
41
|
+
"form",
|
|
42
|
+
"csv2json.js"
|
|
43
|
+
],
|
|
44
|
+
"aliasPermutations": [],
|
|
45
|
+
"permutations": [
|
|
46
|
+
"sharinpix:form:csv2json",
|
|
47
|
+
"form:sharinpix:csv2json",
|
|
48
|
+
"form:csv2json:sharinpix",
|
|
49
|
+
"sharinpix:csv2json:form",
|
|
50
|
+
"csv2json:sharinpix:form",
|
|
51
|
+
"csv2json:form:sharinpix"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"sharinpix:form:json2csv": {
|
|
55
|
+
"aliases": [],
|
|
56
|
+
"args": {},
|
|
57
|
+
"description": "Scans the local `sharinpix/forms` directory for SharinPix form JSON definition files and generates corresponding CSV files. The CSV files contain a header row built from all element keys and one row per element. Nested values are stringified.",
|
|
58
|
+
"examples": [
|
|
59
|
+
"Generate CSV files for all local SharinPix form JSON definitions:\n<%= config.bin %> <%= command.id %>"
|
|
60
|
+
],
|
|
61
|
+
"flags": {
|
|
62
|
+
"json": {
|
|
63
|
+
"description": "Format output as json.",
|
|
64
|
+
"helpGroup": "GLOBAL",
|
|
65
|
+
"name": "json",
|
|
66
|
+
"allowNo": false,
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
},
|
|
69
|
+
"flags-dir": {
|
|
70
|
+
"helpGroup": "GLOBAL",
|
|
71
|
+
"name": "flags-dir",
|
|
72
|
+
"summary": "Import flag values from a directory.",
|
|
73
|
+
"hasDynamicHelp": false,
|
|
74
|
+
"multiple": false,
|
|
75
|
+
"type": "option"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"hasDynamicHelp": false,
|
|
79
|
+
"hiddenAliases": [],
|
|
80
|
+
"id": "sharinpix:form:json2csv",
|
|
81
|
+
"pluginAlias": "@sharinpix/sharinpix-sf-cli",
|
|
82
|
+
"pluginName": "@sharinpix/sharinpix-sf-cli",
|
|
83
|
+
"pluginType": "core",
|
|
84
|
+
"strict": true,
|
|
85
|
+
"summary": "Generate CSV files from SharinPix form JSON definitions.",
|
|
86
|
+
"enableJsonFlag": true,
|
|
87
|
+
"isESM": true,
|
|
88
|
+
"relativePath": [
|
|
89
|
+
"lib",
|
|
90
|
+
"commands",
|
|
91
|
+
"sharinpix",
|
|
92
|
+
"form",
|
|
93
|
+
"json2csv.js"
|
|
94
|
+
],
|
|
95
|
+
"aliasPermutations": [],
|
|
96
|
+
"permutations": [
|
|
97
|
+
"sharinpix:form:json2csv",
|
|
98
|
+
"form:sharinpix:json2csv",
|
|
99
|
+
"form:json2csv:sharinpix",
|
|
100
|
+
"sharinpix:json2csv:form",
|
|
101
|
+
"json2csv:sharinpix:form",
|
|
102
|
+
"json2csv:form:sharinpix"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
3
105
|
"sharinpix:form:pull": {
|
|
4
106
|
"aliases": [],
|
|
5
107
|
"args": {},
|
|
6
108
|
"description": "Retrieves all SharinPix form templates from the connected Salesforce org and saves them as JSON files in the local sharinpix/forms directory. This command fetches the form template metadata and downloads the actual form definition files.",
|
|
7
109
|
"examples": [
|
|
8
110
|
"Pull all form templates from the default org:\n<%= config.bin %> <%= command.id %>",
|
|
9
|
-
"Pull form templates from a specific org:\n<%= config.bin %> <%= command.id %> --target-org myorg@example.com"
|
|
111
|
+
"Pull form templates from a specific org:\n<%= config.bin %> <%= command.id %> --target-org myorg@example.com",
|
|
112
|
+
"Pull form templates and also generate CSV files:\n<%= config.bin %> <%= command.id %> --csv"
|
|
10
113
|
],
|
|
11
114
|
"flags": {
|
|
12
115
|
"json": {
|
|
@@ -34,6 +137,14 @@
|
|
|
34
137
|
"hasDynamicHelp": true,
|
|
35
138
|
"multiple": false,
|
|
36
139
|
"type": "option"
|
|
140
|
+
},
|
|
141
|
+
"csv": {
|
|
142
|
+
"char": "c",
|
|
143
|
+
"description": "When enabled, after downloading all form templates as JSON into `sharinpix/forms`, the command runs the JSON-to-CSV conversion (same as `sharinpix:form:json2csv`).",
|
|
144
|
+
"name": "csv",
|
|
145
|
+
"summary": "Also generate CSV files from the downloaded JSON form definitions.",
|
|
146
|
+
"allowNo": false,
|
|
147
|
+
"type": "boolean"
|
|
37
148
|
}
|
|
38
149
|
},
|
|
39
150
|
"hasDynamicHelp": true,
|
|
@@ -70,7 +181,8 @@
|
|
|
70
181
|
"examples": [
|
|
71
182
|
"Push all form templates to the default org:\n<%= config.bin %> <%= command.id %>",
|
|
72
183
|
"Push form templates to a specific org:\n<%= config.bin %> <%= command.id %> --target-org myorg@example.com",
|
|
73
|
-
"Push form templates and delete orphaned records:\n<%= config.bin %> <%= command.id %> --delete"
|
|
184
|
+
"Push form templates and delete orphaned records:\n<%= config.bin %> <%= command.id %> --delete",
|
|
185
|
+
"Convert CSV to JSON, then push:\n<%= config.bin %> <%= command.id %> --csv"
|
|
74
186
|
],
|
|
75
187
|
"flags": {
|
|
76
188
|
"json": {
|
|
@@ -106,6 +218,14 @@
|
|
|
106
218
|
"summary": "Delete form templates from org that no longer have corresponding local files.",
|
|
107
219
|
"allowNo": false,
|
|
108
220
|
"type": "boolean"
|
|
221
|
+
},
|
|
222
|
+
"csv": {
|
|
223
|
+
"char": "c",
|
|
224
|
+
"description": "When enabled, the command first runs the CSV-to-JSON conversion (same as `sharinpix:form:csv2json`) on files in `sharinpix/forms`, then proceeds to push the resulting JSON files.",
|
|
225
|
+
"name": "csv",
|
|
226
|
+
"summary": "Convert local CSV files to JSON before pushing.",
|
|
227
|
+
"allowNo": false,
|
|
228
|
+
"type": "boolean"
|
|
109
229
|
}
|
|
110
230
|
},
|
|
111
231
|
"hasDynamicHelp": true,
|
|
@@ -271,5 +391,5 @@
|
|
|
271
391
|
]
|
|
272
392
|
}
|
|
273
393
|
},
|
|
274
|
-
"version": "1.
|
|
394
|
+
"version": "1.9.1"
|
|
275
395
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharinpix/sharinpix-sf-cli",
|
|
3
3
|
"description": "SharinPix salesforce cli plugin",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.1",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^4",
|
|
7
7
|
"@salesforce/core": "^8",
|
|
8
|
-
"@salesforce/sf-plugins-core": "^12"
|
|
8
|
+
"@salesforce/sf-plugins-core": "^12",
|
|
9
|
+
"csv": "^6.4.1"
|
|
9
10
|
},
|
|
10
11
|
"engines": {
|
|
11
12
|
"node": ">=18.0.0"
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"postpack": "sf-clean --ignore-signing-artifacts",
|
|
49
50
|
"prepack": "sf-prepack",
|
|
50
51
|
"test": "wireit",
|
|
51
|
-
"test:nuts": "TS_NODE_PROJECT=./test/tsconfig.json nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
52
|
+
"test:nuts": "cross-env TS_NODE_PROJECT=./test/tsconfig.json nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
52
53
|
"test:only": "wireit",
|
|
53
54
|
"version": "oclif readme",
|
|
54
55
|
"prepare": "husky",
|
|
@@ -183,8 +184,11 @@
|
|
|
183
184
|
"@salesforce/cli-plugins-testkit": "^5.3.10",
|
|
184
185
|
"@salesforce/dev-scripts": "^10",
|
|
185
186
|
"@types/mocha": "^10.0.7",
|
|
187
|
+
"@types/mock-fs": "^4.13.4",
|
|
188
|
+
"cross-env": "^7.0.3",
|
|
186
189
|
"eslint-plugin-sf-plugin": "^1.18.6",
|
|
187
190
|
"husky": "^9.1.7",
|
|
191
|
+
"mock-fs": "^5.5.0",
|
|
188
192
|
"oclif": "^4.14.0",
|
|
189
193
|
"semantic-release": "^24.2.7",
|
|
190
194
|
"ts-node": "^10.9.2",
|