@sharinpix/sharinpix-sf-cli 1.10.0 → 1.12.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/README.md +128 -9
- package/lib/commands/sharinpix/config/pull.d.ts +18 -0
- package/lib/commands/sharinpix/config/pull.js +60 -0
- package/lib/commands/sharinpix/config/pull.js.map +1 -0
- package/lib/commands/sharinpix/config/push.d.ts +18 -0
- package/lib/commands/sharinpix/config/push.js +59 -0
- package/lib/commands/sharinpix/config/push.js.map +1 -0
- package/lib/commands/sharinpix/form/csv2json.js +54 -61
- package/lib/commands/sharinpix/form/csv2json.js.map +1 -1
- package/lib/commands/sharinpix/form/json2csv.js +10 -13
- package/lib/commands/sharinpix/form/json2csv.js.map +1 -1
- package/lib/commands/sharinpix/form/pull.js +6 -2
- package/lib/commands/sharinpix/form/pull.js.map +1 -1
- package/lib/commands/sharinpix/pull.d.ts +1 -0
- package/lib/commands/sharinpix/pull.js +7 -1
- package/lib/commands/sharinpix/pull.js.map +1 -1
- package/lib/commands/sharinpix/push.d.ts +1 -0
- package/lib/commands/sharinpix/push.js +7 -1
- package/lib/commands/sharinpix/push.js.map +1 -1
- package/lib/commands/sharinpix/settings.d.ts +10 -0
- package/lib/commands/sharinpix/settings.js +24 -0
- package/lib/commands/sharinpix/settings.js.map +1 -0
- package/lib/helpers/form/elementKeys.d.ts +3 -0
- package/lib/helpers/form/elementKeys.js +74 -0
- package/lib/helpers/form/elementKeys.js.map +1 -0
- package/lib/helpers/form/transformers.d.ts +9 -0
- package/lib/helpers/form/transformers.js +84 -0
- package/lib/helpers/form/transformers.js.map +1 -0
- package/lib/helpers/utils.js +4 -17
- package/lib/helpers/utils.js.map +1 -1
- package/messages/sharinpix.config.pull.md +37 -0
- package/messages/sharinpix.config.push.md +37 -0
- package/messages/sharinpix.form.pull.md +2 -2
- package/messages/sharinpix.settings.md +22 -0
- package/oclif.lock +1412 -2051
- package/oclif.manifest.json +186 -3
- package/package.json +17 -11
- package/lib/helpers/form/elementKeyOrder.d.ts +0 -1
- package/lib/helpers/form/elementKeyOrder.js +0 -53
- package/lib/helpers/form/elementKeyOrder.js.map +0 -1
|
@@ -30,7 +30,7 @@ export default class Pull extends SfCommand {
|
|
|
30
30
|
async runWithFlags(flags) {
|
|
31
31
|
const connection = flags.org.getConnection('63.0');
|
|
32
32
|
fs.mkdirSync('sharinpix/forms', { recursive: true });
|
|
33
|
-
const result = await connection.query(
|
|
33
|
+
const result = await connection.query("SELECT Id, sharinpix__FormUrl__c, Name, sharinpix__Description__c, sharinpix__FormTemplateMain__c FROM sharinpix__FormTemplate__c WHERE sharinpix__RecordType__c = 'version' AND sharinpix__Active__c = true order by LastModifiedDate desc");
|
|
34
34
|
const records = result.records;
|
|
35
35
|
let formsDownloaded = 0;
|
|
36
36
|
let formsFailed = 0;
|
|
@@ -45,8 +45,12 @@ export default class Pull extends SfCommand {
|
|
|
45
45
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
46
46
|
}
|
|
47
47
|
const form = await response.json();
|
|
48
|
+
const mainId = record.sharinpix__FormTemplateMain__c ?? record.Id;
|
|
49
|
+
const formWithMainId = { ...form, mainId };
|
|
48
50
|
const safeFilename = createSafeFilename(record.Name);
|
|
49
|
-
fs.writeFileSync(`sharinpix/forms/${safeFilename}.json`, JSON.stringify(
|
|
51
|
+
fs.writeFileSync(`sharinpix/forms/${safeFilename}.json`, JSON.stringify(formWithMainId, function (key, value) {
|
|
52
|
+
return key === 'uuid' && this === formWithMainId ? undefined : value;
|
|
53
|
+
}, 2));
|
|
50
54
|
this.log(messages.getMessage('info.hello', [record.Name, record.sharinpix__FormUrl__c]));
|
|
51
55
|
formsDownloaded++;
|
|
52
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../../src/commands/sharinpix/form/pull.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,qCAAqC;AACrC,OAAO,E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;QAED,OAAO;YACL,IAAI,EAAE,IAAI;YACV,eAAe;YACf,WAAW;SACZ,CAAC;IACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
3
3
|
import { Messages } from '@salesforce/core';
|
|
4
|
+
import ConfigPull from './config/pull.js';
|
|
4
5
|
import FormPull from './form/pull.js';
|
|
5
6
|
import PermissionPull from './permission/pull.js';
|
|
6
7
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
@@ -18,13 +19,18 @@ export default class Pull extends SfCommand {
|
|
|
18
19
|
};
|
|
19
20
|
async run() {
|
|
20
21
|
const { flags } = await this.parse(Pull);
|
|
21
|
-
this.log('Pulling
|
|
22
|
+
this.log('Pulling configs...');
|
|
23
|
+
const configPull = new ConfigPull(this.argv, this.config);
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
25
|
+
const configsResult = await configPull.runWithFlags(flags);
|
|
26
|
+
this.log('\nPulling forms...');
|
|
22
27
|
const formPull = new FormPull(this.argv, this.config);
|
|
23
28
|
const formsResult = await formPull.runWithFlags(flags);
|
|
24
29
|
this.log('\nPulling permissions...');
|
|
25
30
|
const permissionPull = new PermissionPull(this.argv, this.config);
|
|
26
31
|
const permissionsResult = await permissionPull.runWithFlags(flags);
|
|
27
32
|
return {
|
|
33
|
+
configs: configsResult,
|
|
28
34
|
forms: formsResult,
|
|
29
35
|
permissions: permissionsResult,
|
|
30
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/commands/sharinpix/pull.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,QAAQ,M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EK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEzC,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC/B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,mEAAmE;QACnE,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAE3D,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACrC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAClE,MAAM,iBAAiB,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEnE,OAAO;YACL,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,iBAAiB;SAC/B,CAAC;IACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
3
3
|
import { Messages } from '@salesforce/core';
|
|
4
|
+
import ConfigPush from './config/push.js';
|
|
4
5
|
import FormPush from './form/push.js';
|
|
5
6
|
import PermissionPush from './permission/push.js';
|
|
6
7
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
@@ -24,7 +25,11 @@ export default class Push extends SfCommand {
|
|
|
24
25
|
};
|
|
25
26
|
async run() {
|
|
26
27
|
const { flags } = await this.parse(Push);
|
|
27
|
-
this.log('Pushing
|
|
28
|
+
this.log('Pushing configs...');
|
|
29
|
+
const configPush = new ConfigPush(this.argv, this.config);
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
31
|
+
const configsResult = await configPush.runWithFlags(flags);
|
|
32
|
+
this.log('\nPushing forms...');
|
|
28
33
|
const formPush = new FormPush(this.argv, this.config);
|
|
29
34
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
30
35
|
const formsResult = await formPush.runWithFlags(flags);
|
|
@@ -33,6 +38,7 @@ export default class Push extends SfCommand {
|
|
|
33
38
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
34
39
|
const permissionsResult = await permissionPush.runWithFlags(flags);
|
|
35
40
|
return {
|
|
41
|
+
configs: configsResult,
|
|
36
42
|
forms: formsResult,
|
|
37
43
|
permissions: permissionsResult,
|
|
38
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/sharinpix/push.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/sharinpix/push.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAA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I,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC/B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,sGAAsG;QACtG,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAE3D,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,mEAAmE;QACnE,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACrC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAClE,mEAAmE;QACnE,MAAM,iBAAiB,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEnE,OAAO;YACL,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,iBAAiB;SAC/B,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class Settings extends SfCommand<void> {
|
|
3
|
+
static readonly summary: string;
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
org: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Messages } from '@salesforce/core';
|
|
3
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
4
|
+
const messages = Messages.loadMessages('@sharinpix/sharinpix-sf-cli', 'sharinpix.settings');
|
|
5
|
+
const SHARINPIX_SETTINGS_PATH = '/lightning/n/sharinpix__SharinPix_setting';
|
|
6
|
+
export default class Settings extends SfCommand {
|
|
7
|
+
static summary = messages.getMessage('summary');
|
|
8
|
+
static description = messages.getMessage('description');
|
|
9
|
+
static examples = messages.getMessages('examples');
|
|
10
|
+
static flags = {
|
|
11
|
+
org: Flags.requiredOrg({
|
|
12
|
+
char: 'o',
|
|
13
|
+
summary: messages.getMessage('flags.org.summary'),
|
|
14
|
+
description: messages.getMessage('flags.org.description'),
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { flags } = await this.parse(Settings);
|
|
19
|
+
const targetOrg = flags.org.getUsername();
|
|
20
|
+
if (targetOrg)
|
|
21
|
+
await this.config.runCommand('org:open', ['--target-org', targetOrg, '--path', SHARINPIX_SETTINGS_PATH]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/commands/sharinpix/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,6BAA6B,EAAE,oBAAoB,CAAC,CAAC;AAE5F,MAAM,uBAAuB,GAAG,2CAA2C,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAe;IAC5C,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC;YACrB,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC;YACjD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;SAC1D,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,SAAS;YACX,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAC7G,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { arrayTransformer, booleanTransformer, jsonTransformer, numberTransformer, stringTransformer, } from './transformers.js';
|
|
2
|
+
const elementKeys = [
|
|
3
|
+
{ key: 'id', transformer: stringTransformer },
|
|
4
|
+
{ key: 'note', transformer: jsonTransformer },
|
|
5
|
+
{ key: 'index', transformer: numberTransformer },
|
|
6
|
+
{ key: 'label', transformer: stringTransformer },
|
|
7
|
+
{ key: 'height', transformer: numberTransformer },
|
|
8
|
+
{ key: 'style', transformer: stringTransformer },
|
|
9
|
+
{ key: 'apiName', transformer: stringTransformer },
|
|
10
|
+
{ key: 'options', transformer: arrayTransformer },
|
|
11
|
+
{ key: 'formula', transformer: stringTransformer },
|
|
12
|
+
{ key: 'elemType', transformer: stringTransformer },
|
|
13
|
+
{ key: 'required', transformer: booleanTransformer },
|
|
14
|
+
{ key: 'defaultValueFormula', transformer: stringTransformer },
|
|
15
|
+
{ key: 'parentId', transformer: stringTransformer },
|
|
16
|
+
{ key: 'setToNow', transformer: booleanTransformer },
|
|
17
|
+
{ key: 'inputType', transformer: stringTransformer },
|
|
18
|
+
{ key: 'magicFill', transformer: jsonTransformer },
|
|
19
|
+
{ key: 'backgroundImage', transformer: stringTransformer },
|
|
20
|
+
{ key: 'mobileApp', transformer: jsonTransformer },
|
|
21
|
+
{ key: 'sectionId', transformer: stringTransformer },
|
|
22
|
+
{ key: 'addOptions', transformer: arrayTransformer },
|
|
23
|
+
{ key: 'visibility', transformer: stringTransformer },
|
|
24
|
+
{ key: 'defaultValue', transformer: jsonTransformer },
|
|
25
|
+
{ key: 'richDescription', transformer: stringTransformer },
|
|
26
|
+
{ key: 'validations', transformer: arrayTransformer },
|
|
27
|
+
{ key: 'annotation_config', transformer: stringTransformer },
|
|
28
|
+
{ key: 'labelFormula', transformer: stringTransformer },
|
|
29
|
+
{ key: 'sfMapping', transformer: arrayTransformer },
|
|
30
|
+
{ key: 'calendarFormat', transformer: stringTransformer },
|
|
31
|
+
{ key: 'setToNowButton', transformer: booleanTransformer },
|
|
32
|
+
{ key: 'sfFieldUpdate', transformer: arrayTransformer },
|
|
33
|
+
{ key: 'type', transformer: stringTransformer },
|
|
34
|
+
{ key: 'codeScan', transformer: jsonTransformer },
|
|
35
|
+
{ key: 'floatingLabel', transformer: booleanTransformer },
|
|
36
|
+
{ key: 'sfRecordMapping', transformer: arrayTransformer },
|
|
37
|
+
{ key: 'sfPullRecordMapping', transformer: arrayTransformer },
|
|
38
|
+
{ key: 'autocomplete', transformer: stringTransformer },
|
|
39
|
+
{ key: 'placeholder', transformer: stringTransformer },
|
|
40
|
+
{ key: 'disabledFormula', transformer: stringTransformer },
|
|
41
|
+
{ key: 'allowBlankUpdate', transformer: booleanTransformer },
|
|
42
|
+
{ key: 'preserveRelaunchValueFormula', transformer: stringTransformer },
|
|
43
|
+
{ key: 'max', transformer: numberTransformer },
|
|
44
|
+
{ key: 'min', transformer: numberTransformer },
|
|
45
|
+
{ key: 'decimal', transformer: booleanTransformer },
|
|
46
|
+
{ key: 'disabled', transformer: booleanTransformer },
|
|
47
|
+
{ key: 'description', transformer: stringTransformer },
|
|
48
|
+
{ key: 'info', transformer: stringTransformer },
|
|
49
|
+
{ key: 'columnLabels', transformer: arrayTransformer },
|
|
50
|
+
{ key: 'sortable', transformer: booleanTransformer },
|
|
51
|
+
{ key: 'addFormula', transformer: stringTransformer },
|
|
52
|
+
{ key: 'deleteFormula', transformer: stringTransformer },
|
|
53
|
+
{ key: 'size', transformer: stringTransformer },
|
|
54
|
+
{ key: 'readonly', transformer: booleanTransformer },
|
|
55
|
+
{ key: 'step', transformer: numberTransformer },
|
|
56
|
+
];
|
|
57
|
+
export const elementKeyOrder = elementKeys.map((d) => d.key);
|
|
58
|
+
function getTransformer(header) {
|
|
59
|
+
const keyDef = elementKeys.find((d) => d.key === header);
|
|
60
|
+
if (!keyDef)
|
|
61
|
+
throw new Error(`Unknown key "${header}"`);
|
|
62
|
+
return keyDef.transformer;
|
|
63
|
+
}
|
|
64
|
+
export function parseCell(header, rawValue) {
|
|
65
|
+
return getTransformer(header).parse(rawValue);
|
|
66
|
+
}
|
|
67
|
+
export function serializeCell(header, value) {
|
|
68
|
+
if (value === undefined)
|
|
69
|
+
return undefined;
|
|
70
|
+
if (value === '')
|
|
71
|
+
return '""';
|
|
72
|
+
return getTransformer(header).serialize(value);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=elementKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementKeys.js","sourceRoot":"","sources":["../../../src/helpers/form/elementKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,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MAAM,CAAC,CAAC;IACzD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,MAAM,GAAG,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,WAAW,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,QAAgB;IACxD,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,KAAc;IAC1D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC9B,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Transformer = Readonly<{
|
|
2
|
+
parse: (rawValue: string) => unknown;
|
|
3
|
+
serialize: (value: unknown) => string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const stringTransformer: Transformer;
|
|
6
|
+
export declare const jsonTransformer: Transformer;
|
|
7
|
+
export declare const arrayTransformer: Transformer;
|
|
8
|
+
export declare const booleanTransformer: Transformer;
|
|
9
|
+
export declare const numberTransformer: Transformer;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const stringTransformer = {
|
|
2
|
+
parse: (rawValue) => rawValue,
|
|
3
|
+
serialize: (value) => {
|
|
4
|
+
if (typeof value !== 'string')
|
|
5
|
+
throw new Error(`Cannot serialize string: got value of type "${typeof value}" with value "${String(value)}"`);
|
|
6
|
+
return value;
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
export const jsonTransformer = {
|
|
10
|
+
parse: (rawValue) => {
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse(rawValue);
|
|
13
|
+
return parsed;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw new Error(`Cannot parse JSON value: ${error instanceof Error ? error.message : String(error)}`, {
|
|
17
|
+
cause: error,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
serialize: (value) => {
|
|
22
|
+
if (value === undefined)
|
|
23
|
+
throw new Error('Cannot serialize undefined JSON value');
|
|
24
|
+
try {
|
|
25
|
+
return JSON.stringify(value);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new Error(`Cannot serialize JSON value: ${error instanceof Error ? error.message : String(error)}`, {
|
|
29
|
+
cause: error,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const arrayTransformer = {
|
|
35
|
+
parse: (rawValue) => {
|
|
36
|
+
const genericError = 'Cannot parse array value';
|
|
37
|
+
try {
|
|
38
|
+
if (!rawValue.startsWith('['))
|
|
39
|
+
throw new Error(genericError);
|
|
40
|
+
const parsed = JSON.parse(rawValue);
|
|
41
|
+
if (!Array.isArray(parsed))
|
|
42
|
+
throw new Error(genericError);
|
|
43
|
+
return parsed;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
throw new Error(genericError);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
serialize: (value) => {
|
|
50
|
+
if (!Array.isArray(value))
|
|
51
|
+
throw new Error(`Cannot serialize array: got value of type "${typeof value}" with value "${String(value)}"`);
|
|
52
|
+
return JSON.stringify(value);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export const booleanTransformer = {
|
|
56
|
+
parse: (rawValue) => {
|
|
57
|
+
if (rawValue === 'true')
|
|
58
|
+
return true;
|
|
59
|
+
if (rawValue === 'false')
|
|
60
|
+
return false;
|
|
61
|
+
throw new Error(`Cannot parse boolean value: expected "true" or "false", got "${rawValue}"`);
|
|
62
|
+
},
|
|
63
|
+
serialize: (value) => {
|
|
64
|
+
if (typeof value !== 'boolean')
|
|
65
|
+
throw new Error(`Cannot serialize boolean: got value of type "${typeof value}" with value "${String(value)}"`);
|
|
66
|
+
return value ? 'true' : 'false';
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const numberTransformer = {
|
|
70
|
+
parse: (rawValue) => {
|
|
71
|
+
const numberPattern = /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/;
|
|
72
|
+
const numValue = Number(rawValue);
|
|
73
|
+
if (!Number.isNaN(numValue) && Number.isFinite(numValue) && numberPattern.test(rawValue))
|
|
74
|
+
return numValue;
|
|
75
|
+
throw new Error(`Cannot parse number value: got "${rawValue}"`);
|
|
76
|
+
},
|
|
77
|
+
serialize: (value) => {
|
|
78
|
+
if (typeof value !== 'number') {
|
|
79
|
+
throw new Error(`Cannot serialize number: got value of type "${typeof value}" with value "${String(value)}"`);
|
|
80
|
+
}
|
|
81
|
+
return value.toString();
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=transformers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformers.js","sourceRoot":"","sources":["../../../src/helpers/form/transformers.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,KAAK,EAAE,CAAC,QAAgB,EAAW,EAAE,CAAC,QAAQ;IAC9C,SAAS,EAAE,CAAC,KAAc,EAAU,EAAE;QACpC,IAAI,OAAO,KAAK,KAAK,QAAQ;YAC3B,MAAM,IAAI,KAAK,CAAC,+CAA+C,OAAO,KAAK,iBAAiB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChH,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,KAAK,EAAE,CAAC,QAAgB,EAAW,EAAE;QACnC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAY,CAAC;YAC/C,OAAO,MAAM,CAAC;QAChB,C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AG,CAAC,CAAC;IAClE,CAAC;IACD,SAAS,EAAE,CAAC,KAAc,EAAU,EAAE;QACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,+CAA+C,OAAO,KAAK,iBAAiB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChH,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;CACF,CAAC"}
|
package/lib/helpers/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as crypto from 'node:crypto';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { elementKeyOrder } from './form/elementKeys.js';
|
|
4
4
|
export function isJsonEqual(obj1, obj2) {
|
|
5
5
|
return JSON.stringify(obj1) === JSON.stringify(obj2);
|
|
6
6
|
}
|
|
@@ -46,21 +46,8 @@ export function getCsvFiles(dirPath) {
|
|
|
46
46
|
.map((file) => `${dirPath}/${file}`);
|
|
47
47
|
}
|
|
48
48
|
export function orderElementKeys(keys) {
|
|
49
|
-
const
|
|
50
|
-
const ordered =
|
|
51
|
-
|
|
52
|
-
for (const key of ELEMENT_KEY_ORDER) {
|
|
53
|
-
if (keySet.has(key)) {
|
|
54
|
-
ordered.push(key);
|
|
55
|
-
keySet.delete(key);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
for (const key of keys) {
|
|
59
|
-
if (keySet.has(key)) {
|
|
60
|
-
unknownKeys.push(key);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
unknownKeys.sort();
|
|
64
|
-
return [...ordered, ...unknownKeys];
|
|
49
|
+
const knownKeys = new Set(elementKeyOrder);
|
|
50
|
+
const ordered = elementKeyOrder.filter((key) => keys.includes(key));
|
|
51
|
+
return ordered.filter((key) => knownKeys.has(key));
|
|
65
52
|
}
|
|
66
53
|
//# sourceMappingURL=utils.js.map
|
package/lib/helpers/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,IAAa;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAA4B,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAa;IAC3D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5D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AC,IAAI,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAc;IAC7C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Pull organization config from SharinPix API.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Downloads the organization configuration from the SharinPix API and saves it to a local JSON file. This command connects to your Salesforce org to obtain an authentication token, then fetches the config from the SharinPix API endpoint.
|
|
8
|
+
|
|
9
|
+
# flags.org.summary
|
|
10
|
+
|
|
11
|
+
The Salesforce org to authenticate with.
|
|
12
|
+
|
|
13
|
+
# flags.org.description
|
|
14
|
+
|
|
15
|
+
The Salesforce org used to obtain the authentication token for accessing the SharinPix API.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- Pull organization config using the default org:
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %>
|
|
22
|
+
|
|
23
|
+
- Pull organization config from a specific org:
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --target-org myorg@example.com
|
|
26
|
+
|
|
27
|
+
# info.success
|
|
28
|
+
|
|
29
|
+
Successfully pulled organization config to sharinpix/config.json
|
|
30
|
+
|
|
31
|
+
# error.failed
|
|
32
|
+
|
|
33
|
+
Failed to pull organization config: %s
|
|
34
|
+
|
|
35
|
+
# error.notFound
|
|
36
|
+
|
|
37
|
+
Config file not found at sharinpix/config.json
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Push organization config to SharinPix API.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Uploads the organization configuration from a local JSON file to the SharinPix API. This command connects to your Salesforce org to obtain an authentication token, then pushes the config to the SharinPix API endpoint.
|
|
8
|
+
|
|
9
|
+
# flags.org.summary
|
|
10
|
+
|
|
11
|
+
The Salesforce org to authenticate with.
|
|
12
|
+
|
|
13
|
+
# flags.org.description
|
|
14
|
+
|
|
15
|
+
The Salesforce org used to obtain the authentication token for accessing the SharinPix API.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- Push organization config using the default org:
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %>
|
|
22
|
+
|
|
23
|
+
- Push organization config to a specific org:
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --target-org myorg@example.com
|
|
26
|
+
|
|
27
|
+
# info.success
|
|
28
|
+
|
|
29
|
+
Successfully pushed organization config to SharinPix API
|
|
30
|
+
|
|
31
|
+
# error.failed
|
|
32
|
+
|
|
33
|
+
Failed to push organization config: %s
|
|
34
|
+
|
|
35
|
+
# error.notFound
|
|
36
|
+
|
|
37
|
+
Config file not found at sharinpix/config.json. Run 'sharinpix:config:pull' first or create the file manually.
|
|
@@ -4,7 +4,7 @@ Pull SharinPix form templates from Salesforce org.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Retrieves
|
|
7
|
+
Retrieves active, version-record 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.
|
|
8
8
|
|
|
9
9
|
# flags.org.summary
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ When enabled, after downloading all form templates as JSON into `sharinpix/forms
|
|
|
24
24
|
|
|
25
25
|
# examples
|
|
26
26
|
|
|
27
|
-
- Pull
|
|
27
|
+
- Pull active form templates from the default org:
|
|
28
28
|
|
|
29
29
|
<%= config.bin %> <%= command.id %>
|
|
30
30
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Open the SharinPix settings page in a Salesforce org.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Opens the SharinPix settings Lightning page in your default browser for the specified Salesforce org. This command is a convenience wrapper around `sf org open` with the path set to `/lightning/n/sharinpix__SharinPix_setting`.
|
|
8
|
+
|
|
9
|
+
# flags.org.summary
|
|
10
|
+
|
|
11
|
+
The Salesforce org to open.
|
|
12
|
+
|
|
13
|
+
# flags.org.description
|
|
14
|
+
|
|
15
|
+
The target Salesforce org (username or alias) where the SharinPix settings page should be opened.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- Open the SharinPix settings page for a specific org:
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %> --target-org myorg@example.com
|
|
22
|
+
|