@sharinpix/sharinpix-sf-cli 1.3.0 → 1.4.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 CHANGED
@@ -98,6 +98,8 @@ sf plugins
98
98
  <!-- commands -->
99
99
  * [`sf sharinpix form pull`](#sf-sharinpix-form-pull)
100
100
  * [`sf sharinpix form push`](#sf-sharinpix-form-push)
101
+ * [`sf sharinpix permission pull`](#sf-sharinpix-permission-pull)
102
+ * [`sf sharinpix permission push`](#sf-sharinpix-permission-push)
101
103
 
102
104
  ## `sf sharinpix form pull`
103
105
 
@@ -172,4 +174,78 @@ FLAG DESCRIPTIONS
172
174
 
173
175
  The target Salesforce org where the SharinPix form templates will be uploaded and stored.
174
176
  ```
177
+
178
+ ## `sf sharinpix permission pull`
179
+
180
+ Pull SharinPix permissions from Salesforce org.
181
+
182
+ ```
183
+ USAGE
184
+ $ sf sharinpix permission pull -o <value> [--json] [--flags-dir <value>]
185
+
186
+ FLAGS
187
+ -o, --org=<value> (required) The Salesforce org to pull SharinPix permissions from.
188
+
189
+ GLOBAL FLAGS
190
+ --flags-dir=<value> Import flag values from a directory.
191
+ --json Format output as json.
192
+
193
+ DESCRIPTION
194
+ Pull SharinPix permissions from Salesforce org.
195
+
196
+ Retrieves all SharinPix permissions from the connected Salesforce org and saves them as JSON files in the local
197
+ sharinpix/permission directory. This command fetches the permission metadata and the JSON configuration data stored in
198
+ the sharinpix**Json**c field.
199
+
200
+ EXAMPLES
201
+ Pull all SharinPix permissions from the default org:
202
+
203
+ $ sf sharinpix permission pull
204
+
205
+ Pull SharinPix permissions from a specific org:
206
+
207
+ $ sf sharinpix permission pull --target-org myorg@example.com
208
+
209
+ FLAG DESCRIPTIONS
210
+ -o, --org=<value> The Salesforce org to pull SharinPix permissions from.
211
+
212
+ The target Salesforce org containing the SharinPix permissions to be pulled.
213
+ ```
214
+
215
+ ## `sf sharinpix permission push`
216
+
217
+ Push SharinPix permissions to Salesforce org.
218
+
219
+ ```
220
+ USAGE
221
+ $ sf sharinpix permission push -o <value> [--json] [--flags-dir <value>]
222
+
223
+ FLAGS
224
+ -o, --org=<value> (required) The Salesforce org to push SharinPix permissions to.
225
+
226
+ GLOBAL FLAGS
227
+ --flags-dir=<value> Import flag values from a directory.
228
+ --json Format output as json.
229
+
230
+ DESCRIPTION
231
+ Push SharinPix permissions to Salesforce org.
232
+
233
+ Uploads SharinPix permissions from local JSON files to the connected Salesforce org. This command reads permission
234
+ configurations from the local directory and creates or updates corresponding records in Salesforce. The
235
+ sharinpix**Json**c field will be updated with the JSON configuration data.
236
+
237
+ EXAMPLES
238
+ Push all SharinPix permissions to the default org:
239
+
240
+ $ sf sharinpix permission push
241
+
242
+ Push SharinPix permissions to a specific org:
243
+
244
+ $ sf sharinpix permission push --target-org myorg@example.com
245
+
246
+ FLAG DESCRIPTIONS
247
+ -o, --org=<value> The Salesforce org to push SharinPix permissions to.
248
+
249
+ The target Salesforce org where the SharinPix permissions will be uploaded and stored.
250
+ ```
175
251
  <!-- commandsstop -->
@@ -0,0 +1,15 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type PullResult = {
3
+ name: string;
4
+ permissionsDownloaded?: number;
5
+ permissionsFailed?: number;
6
+ };
7
+ export default class Pull extends SfCommand<PullResult> {
8
+ static readonly summary: string;
9
+ static readonly description: string;
10
+ static readonly examples: string[];
11
+ static readonly flags: {
12
+ org: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<PullResult>;
15
+ }
@@ -0,0 +1,47 @@
1
+ /* eslint-disable no-console */
2
+ /* eslint-disable no-await-in-loop */
3
+ import fs from 'node:fs';
4
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
5
+ import { Messages } from '@salesforce/core';
6
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
7
+ const messages = Messages.loadMessages('@sharinpix/sharinpix-sf-cli', 'sharinpix.permission.pull');
8
+ export default class Pull extends SfCommand {
9
+ static summary = messages.getMessage('summary');
10
+ static description = messages.getMessage('description');
11
+ static examples = messages.getMessages('examples');
12
+ static flags = {
13
+ org: Flags.requiredOrg({
14
+ char: 'o',
15
+ summary: messages.getMessage('flags.org.summary'),
16
+ description: messages.getMessage('flags.org.description'),
17
+ }),
18
+ };
19
+ async run() {
20
+ const { flags } = await this.parse(Pull);
21
+ const connection = flags.org.getConnection('63.0');
22
+ fs.mkdirSync('sharinpix/permission', { recursive: true });
23
+ const records = (await connection.query('SELECT Id, Name, sharinpix__Description__c, sharinpix__ID__c, sharinpix__Json__c FROM sharinpix__SharinPixPermission__c order by LastModifiedDate desc')).records;
24
+ let permissionsDownloaded = 0;
25
+ let permissionsFailed = 0;
26
+ for (const record of records) {
27
+ try {
28
+ const permissionData = JSON.parse(record.sharinpix__Json__c);
29
+ fs.writeFileSync(`sharinpix/permission/${record.Name}.json`, JSON.stringify(permissionData, null, 2));
30
+ this.log(messages.getMessage('info.hello', [record.Name, record.sharinpix__Description__c || 'No description']));
31
+ permissionsDownloaded++;
32
+ }
33
+ catch (error) {
34
+ // Skip permissions that can't be fetched (e.g., network errors, invalid data)
35
+ this.warn(`Failed to fetch SharinPix permission ${record.Name}: ${error instanceof Error ? error.message : 'Unknown error'}`);
36
+ permissionsFailed++;
37
+ }
38
+ }
39
+ this.log(`Successfully downloaded ${permissionsDownloaded} SharinPix permission(s). ${permissionsFailed} failed.`);
40
+ return {
41
+ name: 'OK',
42
+ permissionsDownloaded,
43
+ permissionsFailed,
44
+ };
45
+ }
46
+ }
47
+ //# sourceMappingURL=pull.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../../src/commands/sharinpix/permission/pull.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,qCAAqC;AACrC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE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OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,cAAc,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;gBAEtE,EAAE,CAAC,aAAa,CAAC,wBAAwB,MAAM,CAAC,IAAI,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBACtG,IAAI,CAAC,GAAG,CACN,QAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,yBAAyB,IAAI,gBAAgB,CAAC,CAAC,CACvG,CAAC;gBACF,qBAAqB,EAAE,CAAC;YAC1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,8EAA8E;gBAC9E,IAAI,CAAC,IAAI,CACP,wCAAwC,MAAM,CAAC,IAAI,KACjD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAC3C,EAAE,CACH,CAAC;gBACF,iBAAiB,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,2BAA2B,qBAAqB,6BAA6B,iBAAiB,UAAU,CAAC,CAAC;QAEnH,OAAO;YACL,IAAI,EAAE,IAAI;YACV,qBAAqB;YACrB,iBAAiB;SAClB,CAAC;IACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type PushResult = {
3
+ name: string;
4
+ uploaded?: number;
5
+ failed?: number;
6
+ skipped?: number;
7
+ };
8
+ export default class Push extends SfCommand<PushResult> {
9
+ static readonly summary: string;
10
+ static readonly description: string;
11
+ static readonly examples: string[];
12
+ static readonly flags: {
13
+ org: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<PushResult>;
16
+ }
@@ -0,0 +1,104 @@
1
+ /* eslint-disable no-console */
2
+ /* eslint-disable no-await-in-loop */
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
6
+ import { Messages } from '@salesforce/core';
7
+ import { isJsonEqual } from '../../../helpers/json-utils.js';
8
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
9
+ const messages = Messages.loadMessages('@sharinpix/sharinpix-sf-cli', 'sharinpix.permission.push');
10
+ export default class Push extends SfCommand {
11
+ static summary = messages.getMessage('summary');
12
+ static description = messages.getMessage('description');
13
+ static examples = messages.getMessages('examples');
14
+ static flags = {
15
+ org: Flags.requiredOrg({
16
+ char: 'o',
17
+ summary: messages.getMessage('flags.org.summary'),
18
+ description: messages.getMessage('flags.org.description'),
19
+ }),
20
+ };
21
+ async run() {
22
+ const { flags } = await this.parse(Push);
23
+ const connection = flags.org.getConnection('63.0');
24
+ const files = fs
25
+ .readdirSync('sharinpix/permission')
26
+ .filter((file) => file.endsWith('.json'))
27
+ .map((file) => path.join('sharinpix/permission', file));
28
+ if (files.length === 0) {
29
+ this.log('No SharinPix permission files found in the specified directory.');
30
+ return {
31
+ name: 'OK',
32
+ uploaded: 0,
33
+ failed: 0,
34
+ skipped: 0,
35
+ };
36
+ }
37
+ const existingRecords = (await connection.query('SELECT Id, Name, sharinpix__Description__c, sharinpix__ID__c, sharinpix__Json__c FROM sharinpix__SharinPixPermission__c')).records;
38
+ const existingMap = new Map(existingRecords.map((record) => [record.Name, record]));
39
+ let uploaded = 0;
40
+ let failed = 0;
41
+ let skipped = 0;
42
+ for (const file of files) {
43
+ try {
44
+ const fileName = path.basename(file, '.json');
45
+ const fileContent = fs.readFileSync(file, 'utf8');
46
+ const json = JSON.parse(fileContent);
47
+ const existingRecord = existingMap.get(fileName);
48
+ const existingId = existingRecord?.Id ?? null;
49
+ if (existingRecord) {
50
+ // Check if permission has changed by comparing with stored JSON
51
+ try {
52
+ const existingJson = JSON.parse(existingRecord.sharinpix__Json__c);
53
+ if (isJsonEqual(json, existingJson)) {
54
+ this.log(messages.getMessage('info.skipped', [fileName]));
55
+ skipped++;
56
+ continue;
57
+ }
58
+ }
59
+ catch (parseError) {
60
+ this.warn(`Failed to parse stored JSON for ${fileName}, proceeding with update`);
61
+ }
62
+ }
63
+ // Update or create the permission record
64
+ const permissionData = {
65
+ Name: fileName,
66
+ // eslint-disable-next-line camelcase
67
+ sharinpix__Json__c: JSON.stringify(json),
68
+ ...(existingRecord?.sharinpix__Description__c && {
69
+ // eslint-disable-next-line camelcase
70
+ sharinpix__Description__c: existingRecord.sharinpix__Description__c,
71
+ }),
72
+ };
73
+ if (existingId) {
74
+ // Update existing record
75
+ await connection.sobject('sharinpix__SharinPixPermission__c').update({
76
+ ...permissionData,
77
+ Id: existingId,
78
+ });
79
+ this.log(messages.getMessage('info.updated', [fileName]));
80
+ }
81
+ else {
82
+ // Create new record
83
+ await connection.sobject('sharinpix__SharinPixPermission__c').create(permissionData);
84
+ this.log(messages.getMessage('info.created', [fileName]));
85
+ }
86
+ uploaded++;
87
+ }
88
+ catch (error) {
89
+ const fileName = path.basename(file, '.json');
90
+ this.warn(`Failed to push SharinPix permission ${fileName}: ${error instanceof Error ? error.message : 'Unknown error'}`);
91
+ failed++;
92
+ continue;
93
+ }
94
+ }
95
+ this.log(messages.getMessage('info.summary', [uploaded, failed, skipped]));
96
+ return {
97
+ name: 'OK',
98
+ uploaded,
99
+ failed,
100
+ skipped,
101
+ };
102
+ }
103
+ }
104
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../../src/commands/sharinpix/permission/push.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,qCAAqC;AACrC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,O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CAAC;gBAC9C,IAAI,CAAC,IAAI,CACP,uCAAuC,QAAQ,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC/G,CAAC;gBACF,MAAM,EAAE,CAAC;gBACT,SAAS;YACX,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QAE3E,OAAO;YACL,IAAI,EAAE,IAAI;YACV,QAAQ;YACR,MAAM;YACN,OAAO;SACR,CAAC;IACJ,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export { default as pull } from './commands/sharinpix/form/pull.js';
2
- export { default as push } from './commands/sharinpix/form/push.js';
1
+ export { default as formPull } from './commands/sharinpix/form/pull.js';
2
+ export { default as formPush } from './commands/sharinpix/form/push.js';
3
+ export { default as permissionPull } from './commands/sharinpix/permission/pull.js';
4
+ export { default as permissionPush } from './commands/sharinpix/permission/push.js';
package/lib/index.js CHANGED
@@ -1,3 +1,5 @@
1
- export { default as pull } from './commands/sharinpix/form/pull.js';
2
- export { default as push } from './commands/sharinpix/form/push.js';
1
+ export { default as formPull } from './commands/sharinpix/form/pull.js';
2
+ export { default as formPush } from './commands/sharinpix/form/push.js';
3
+ export { default as permissionPull } from './commands/sharinpix/permission/pull.js';
4
+ export { default as permissionPush } from './commands/sharinpix/permission/push.js';
3
5
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1,29 @@
1
+ # summary
2
+
3
+ Pull SharinPix permissions from Salesforce org.
4
+
5
+ # description
6
+
7
+ Retrieves all SharinPix permissions from the connected Salesforce org and saves them as JSON files in the local sharinpix/permission directory. This command fetches the permission metadata and the JSON configuration data stored in the sharinpix**Json**c field.
8
+
9
+ # flags.org.summary
10
+
11
+ The Salesforce org to pull SharinPix permissions from.
12
+
13
+ # flags.org.description
14
+
15
+ The target Salesforce org containing the SharinPix permissions to be pulled.
16
+
17
+ # examples
18
+
19
+ - Pull all SharinPix permissions from the default org:
20
+
21
+ <%= config.bin %> <%= command.id %>
22
+
23
+ - Pull SharinPix permissions from a specific org:
24
+
25
+ <%= config.bin %> <%= command.id %> --target-org myorg@example.com
26
+
27
+ # info.hello
28
+
29
+ Pulled SharinPix permission %s (%s)
@@ -0,0 +1,41 @@
1
+ # summary
2
+
3
+ Push SharinPix permissions to Salesforce org.
4
+
5
+ # description
6
+
7
+ Uploads SharinPix permissions from local JSON files to the connected Salesforce org. This command reads permission configurations from the local directory and creates or updates corresponding records in Salesforce. The sharinpix**Json**c field will be updated with the JSON configuration data.
8
+
9
+ # flags.org.summary
10
+
11
+ The Salesforce org to push SharinPix permissions to.
12
+
13
+ # flags.org.description
14
+
15
+ The target Salesforce org where the SharinPix permissions will be uploaded and stored.
16
+
17
+ # examples
18
+
19
+ - Push all SharinPix permissions to the default org:
20
+
21
+ <%= config.bin %> <%= command.id %>
22
+
23
+ - Push SharinPix permissions to a specific org:
24
+
25
+ <%= config.bin %> <%= command.id %> --target-org myorg@example.com
26
+
27
+ # info.created
28
+
29
+ Created SharinPix permission %s
30
+
31
+ # info.updated
32
+
33
+ Updated SharinPix permission %s
34
+
35
+ # info.skipped
36
+
37
+ Skipped SharinPix permission %s (no changes detected)
38
+
39
+ # info.summary
40
+
41
+ Push completed: %d permissions uploaded, %d permissions failed, %d permissions skipped
package/oclif.lock CHANGED
@@ -1043,6 +1043,20 @@
1043
1043
  wrap-ansi "^6.2.0"
1044
1044
  yoctocolors-cjs "^2.1.2"
1045
1045
 
1046
+ "@inquirer/core@^10.2.0":
1047
+ version "10.2.0"
1048
+ resolved "https://registry.npmjs.org/@inquirer/core/-/core-10.2.0.tgz"
1049
+ integrity sha512-NyDSjPqhSvpZEMZrLCYUquWNl+XC/moEcVFqS55IEYIYsY0a1cUCevSqk7ctOlnm/RaSBU5psFryNlxcmGrjaA==
1050
+ dependencies:
1051
+ "@inquirer/figures" "^1.0.13"
1052
+ "@inquirer/type" "^3.0.8"
1053
+ ansi-escapes "^4.3.2"
1054
+ cli-width "^4.1.0"
1055
+ mute-stream "^2.0.0"
1056
+ signal-exit "^4.1.0"
1057
+ wrap-ansi "^6.2.0"
1058
+ yoctocolors-cjs "^2.1.2"
1059
+
1046
1060
  "@inquirer/core@^9.1.0":
1047
1061
  version "9.2.1"
1048
1062
  resolved "https://registry.npmjs.org/@inquirer/core/-/core-9.2.1.tgz"
@@ -1062,13 +1076,13 @@
1062
1076
  yoctocolors-cjs "^2.1.2"
1063
1077
 
1064
1078
  "@inquirer/editor@^4.2.15":
1065
- version "4.2.15"
1066
- resolved "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.15.tgz"
1067
- integrity sha512-wst31XT8DnGOSS4nNJDIklGKnf+8shuauVrWzgKegWUe28zfCftcWZ2vktGdzJgcylWSS2SrDnYUb6alZcwnCQ==
1079
+ version "4.2.18"
1080
+ resolved "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.18.tgz"
1081
+ integrity sha512-yeQN3AXjCm7+Hmq5L6Dm2wEDeBRdAZuyZ4I7tWSSanbxDzqM0KqzoDbKM7p4ebllAYdoQuPJS6N71/3L281i6w==
1068
1082
  dependencies:
1069
- "@inquirer/core" "^10.1.15"
1083
+ "@inquirer/core" "^10.2.0"
1084
+ "@inquirer/external-editor" "^1.0.1"
1070
1085
  "@inquirer/type" "^3.0.8"
1071
- external-editor "^3.1.0"
1072
1086
 
1073
1087
  "@inquirer/expand@^4.0.17":
1074
1088
  version "4.0.17"
@@ -1079,6 +1093,14 @@
1079
1093
  "@inquirer/type" "^3.0.8"
1080
1094
  yoctocolors-cjs "^2.1.2"
1081
1095
 
1096
+ "@inquirer/external-editor@^1.0.1":
1097
+ version "1.0.1"
1098
+ resolved "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.1.tgz"
1099
+ integrity sha512-Oau4yL24d2B5IL4ma4UpbQigkVhzPDXLoqy1ggK4gnHg/stmkffJE4oOXHXF3uz0UEpywG68KcyXsyYpA1Re/Q==
1100
+ dependencies:
1101
+ chardet "^2.1.0"
1102
+ iconv-lite "^0.6.3"
1103
+
1082
1104
  "@inquirer/figures@^1.0.13", "@inquirer/figures@^1.0.5", "@inquirer/figures@^1.0.6":
1083
1105
  version "1.0.13"
1084
1106
  resolved "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.13.tgz"
@@ -3564,10 +3586,10 @@ character-entities-legacy@^3.0.0:
3564
3586
  resolved "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz"
3565
3587
  integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==
3566
3588
 
3567
- chardet@^0.7.0:
3568
- version "0.7.0"
3569
- resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz"
3570
- integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
3589
+ chardet@^2.1.0:
3590
+ version "2.1.0"
3591
+ resolved "https://registry.npmjs.org/chardet/-/chardet-2.1.0.tgz"
3592
+ integrity sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==
3571
3593
 
3572
3594
  check-error@^1.0.3:
3573
3595
  version "1.0.3"
@@ -4804,15 +4826,6 @@ extend@^3.0.2:
4804
4826
  resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
4805
4827
  integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
4806
4828
 
4807
- external-editor@^3.1.0:
4808
- version "3.1.0"
4809
- resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz"
4810
- integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==
4811
- dependencies:
4812
- chardet "^0.7.0"
4813
- iconv-lite "^0.4.24"
4814
- tmp "^0.0.33"
4815
-
4816
4829
  fast-content-type-parse@^3.0.0:
4817
4830
  version "3.0.0"
4818
4831
  resolved "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz"
@@ -5767,14 +5780,14 @@ hyperdyperid@^1.2.0:
5767
5780
  resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz"
5768
5781
  integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==
5769
5782
 
5770
- iconv-lite@^0.4.24:
5771
- version "0.4.24"
5772
- resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz"
5773
- integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
5783
+ iconv-lite@^0.6.2:
5784
+ version "0.6.3"
5785
+ resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
5786
+ integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
5774
5787
  dependencies:
5775
- safer-buffer ">= 2.1.2 < 3"
5788
+ safer-buffer ">= 2.1.2 < 3.0.0"
5776
5789
 
5777
- iconv-lite@^0.6.2:
5790
+ iconv-lite@^0.6.3:
5778
5791
  version "0.6.3"
5779
5792
  resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
5780
5793
  integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
@@ -5939,8 +5952,6 @@ into-stream@^7.0.0:
5939
5952
 
5940
5953
  ip-address@^9.0.5:
5941
5954
  version "9.0.5"
5942
- resolved "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz"
5943
- integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==
5944
5955
  dependencies:
5945
5956
  jsbn "1.1.0"
5946
5957
  sprintf-js "^1.1.3"
@@ -6423,8 +6434,6 @@ js2xmlparser@^4.0.1:
6423
6434
 
6424
6435
  jsbn@1.1.0:
6425
6436
  version "1.1.0"
6426
- resolved "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz"
6427
- integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==
6428
6437
 
6429
6438
  jsdoc-type-pratt-parser@~4.0.0:
6430
6439
  version "4.0.0"
@@ -7925,11 +7934,6 @@ optionator@^0.9.3:
7925
7934
  type-check "^0.4.0"
7926
7935
  word-wrap "^1.2.5"
7927
7936
 
7928
- os-tmpdir@~1.0.2:
7929
- version "1.0.2"
7930
- resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz"
7931
- integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==
7932
-
7933
7937
  own-keys@^1.0.1:
7934
7938
  version "1.0.1"
7935
7939
  resolved "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz"
@@ -8909,11 +8913,6 @@ safe-stable-stringify@^2.3.1, safe-stable-stringify@^2.4.3:
8909
8913
  resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz"
8910
8914
  integrity sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==
8911
8915
 
8912
- "safer-buffer@>= 2.1.2 < 3":
8913
- version "2.1.2"
8914
- resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"
8915
- integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
8916
-
8917
8916
  "safer-buffer@>= 2.1.2 < 3.0.0":
8918
8917
  version "2.1.2"
8919
8918
  resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"
@@ -9394,8 +9393,6 @@ split2@~1.0.0:
9394
9393
 
9395
9394
  sprintf-js@^1.1.3:
9396
9395
  version "1.1.3"
9397
- resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz"
9398
- integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==
9399
9396
 
9400
9397
  sprintf-js@~1.0.2:
9401
9398
  version "1.0.3"
@@ -9831,13 +9828,6 @@ tldts@^6.1.32:
9831
9828
  dependencies:
9832
9829
  tldts-core "^6.1.86"
9833
9830
 
9834
- tmp@^0.0.33:
9835
- version "0.0.33"
9836
- resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz"
9837
- integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
9838
- dependencies:
9839
- os-tmpdir "~1.0.2"
9840
-
9841
9831
  to-regex-range@^5.0.1:
9842
9832
  version "5.0.1"
9843
9833
  resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz"
@@ -125,7 +125,133 @@
125
125
  "push:sharinpix:form",
126
126
  "push:form:sharinpix"
127
127
  ]
128
+ },
129
+ "sharinpix:permission:pull": {
130
+ "aliases": [],
131
+ "args": {},
132
+ "description": "Retrieves all SharinPix permissions from the connected Salesforce org and saves them as JSON files in the local sharinpix/permission directory. This command fetches the permission metadata and the JSON configuration data stored in the sharinpix**Json**c field.",
133
+ "examples": [
134
+ "Pull all SharinPix permissions from the default org:\n<%= config.bin %> <%= command.id %>",
135
+ "Pull SharinPix permissions from a specific org:\n<%= config.bin %> <%= command.id %> --target-org myorg@example.com"
136
+ ],
137
+ "flags": {
138
+ "json": {
139
+ "description": "Format output as json.",
140
+ "helpGroup": "GLOBAL",
141
+ "name": "json",
142
+ "allowNo": false,
143
+ "type": "boolean"
144
+ },
145
+ "flags-dir": {
146
+ "helpGroup": "GLOBAL",
147
+ "name": "flags-dir",
148
+ "summary": "Import flag values from a directory.",
149
+ "hasDynamicHelp": false,
150
+ "multiple": false,
151
+ "type": "option"
152
+ },
153
+ "org": {
154
+ "char": "o",
155
+ "description": "The target Salesforce org containing the SharinPix permissions to be pulled.",
156
+ "name": "org",
157
+ "noCacheDefault": true,
158
+ "required": true,
159
+ "summary": "The Salesforce org to pull SharinPix permissions from.",
160
+ "hasDynamicHelp": true,
161
+ "multiple": false,
162
+ "type": "option"
163
+ }
164
+ },
165
+ "hasDynamicHelp": true,
166
+ "hiddenAliases": [],
167
+ "id": "sharinpix:permission:pull",
168
+ "pluginAlias": "@sharinpix/sharinpix-sf-cli",
169
+ "pluginName": "@sharinpix/sharinpix-sf-cli",
170
+ "pluginType": "core",
171
+ "strict": true,
172
+ "summary": "Pull SharinPix permissions from Salesforce org.",
173
+ "enableJsonFlag": true,
174
+ "isESM": true,
175
+ "relativePath": [
176
+ "lib",
177
+ "commands",
178
+ "sharinpix",
179
+ "permission",
180
+ "pull.js"
181
+ ],
182
+ "aliasPermutations": [],
183
+ "permutations": [
184
+ "sharinpix:permission:pull",
185
+ "permission:sharinpix:pull",
186
+ "permission:pull:sharinpix",
187
+ "sharinpix:pull:permission",
188
+ "pull:sharinpix:permission",
189
+ "pull:permission:sharinpix"
190
+ ]
191
+ },
192
+ "sharinpix:permission:push": {
193
+ "aliases": [],
194
+ "args": {},
195
+ "description": "Uploads SharinPix permissions from local JSON files to the connected Salesforce org. This command reads permission configurations from the local directory and creates or updates corresponding records in Salesforce. The sharinpix**Json**c field will be updated with the JSON configuration data.",
196
+ "examples": [
197
+ "Push all SharinPix permissions to the default org:\n<%= config.bin %> <%= command.id %>",
198
+ "Push SharinPix permissions to a specific org:\n<%= config.bin %> <%= command.id %> --target-org myorg@example.com"
199
+ ],
200
+ "flags": {
201
+ "json": {
202
+ "description": "Format output as json.",
203
+ "helpGroup": "GLOBAL",
204
+ "name": "json",
205
+ "allowNo": false,
206
+ "type": "boolean"
207
+ },
208
+ "flags-dir": {
209
+ "helpGroup": "GLOBAL",
210
+ "name": "flags-dir",
211
+ "summary": "Import flag values from a directory.",
212
+ "hasDynamicHelp": false,
213
+ "multiple": false,
214
+ "type": "option"
215
+ },
216
+ "org": {
217
+ "char": "o",
218
+ "description": "The target Salesforce org where the SharinPix permissions will be uploaded and stored.",
219
+ "name": "org",
220
+ "noCacheDefault": true,
221
+ "required": true,
222
+ "summary": "The Salesforce org to push SharinPix permissions to.",
223
+ "hasDynamicHelp": true,
224
+ "multiple": false,
225
+ "type": "option"
226
+ }
227
+ },
228
+ "hasDynamicHelp": true,
229
+ "hiddenAliases": [],
230
+ "id": "sharinpix:permission:push",
231
+ "pluginAlias": "@sharinpix/sharinpix-sf-cli",
232
+ "pluginName": "@sharinpix/sharinpix-sf-cli",
233
+ "pluginType": "core",
234
+ "strict": true,
235
+ "summary": "Push SharinPix permissions to Salesforce org.",
236
+ "enableJsonFlag": true,
237
+ "isESM": true,
238
+ "relativePath": [
239
+ "lib",
240
+ "commands",
241
+ "sharinpix",
242
+ "permission",
243
+ "push.js"
244
+ ],
245
+ "aliasPermutations": [],
246
+ "permutations": [
247
+ "sharinpix:permission:push",
248
+ "permission:sharinpix:push",
249
+ "permission:push:sharinpix",
250
+ "sharinpix:push:permission",
251
+ "push:sharinpix:permission",
252
+ "push:permission:sharinpix"
253
+ ]
128
254
  }
129
255
  },
130
- "version": "1.3.0"
256
+ "version": "1.4.1"
131
257
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sharinpix/sharinpix-sf-cli",
3
3
  "description": "SharinPix salesforce cli plugin",
4
- "version": "1.3.0",
4
+ "version": "1.4.1",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^4",
7
7
  "@salesforce/core": "^8",