1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | Object.defineProperty(exports, "__esModule", { value: true });
|
9 | exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = void 0;
|
10 | const path_1 = require("path");
|
11 | const ts_types_1 = require("@salesforce/ts-types");
|
12 | const messages_1 = require("../messages");
|
13 | const sfdcUrl_1 = require("../util/sfdcUrl");
|
14 | const sfdc_1 = require("../util/sfdc");
|
15 | messages_1.Messages.importMessagesDirectory((0, path_1.join)(__dirname));
|
16 | const messages = messages_1.Messages.load('@salesforce/core', 'config', [
|
17 | 'invalidApiVersion',
|
18 | 'invalidBooleanConfigValue',
|
19 | 'invalidInstanceUrl',
|
20 | 'invalidIsvDebuggerSid',
|
21 | 'invalidIsvDebuggerUrl',
|
22 | 'invalidNumberConfigValue',
|
23 | 'org-api-version',
|
24 | 'org-instance-url',
|
25 | 'org-isv-debugger-sid',
|
26 | 'org-isv-debugger-url',
|
27 | 'org-max-query-limit',
|
28 | 'target-dev-hub',
|
29 | 'target-org',
|
30 | 'org-custom-metadata-templates',
|
31 | ]);
|
32 | var OrgConfigProperties;
|
33 | (function (OrgConfigProperties) {
|
34 | |
35 |
|
36 |
|
37 | OrgConfigProperties["TARGET_ORG"] = "target-org";
|
38 | |
39 |
|
40 |
|
41 | OrgConfigProperties["TARGET_DEV_HUB"] = "target-dev-hub";
|
42 | |
43 |
|
44 |
|
45 | OrgConfigProperties["ORG_API_VERSION"] = "org-api-version";
|
46 | |
47 |
|
48 |
|
49 | OrgConfigProperties["ORG_CUSTOM_METADATA_TEMPLATES"] = "org-custom-metadata-templates";
|
50 | |
51 |
|
52 |
|
53 | OrgConfigProperties["ORG_MAX_QUERY_LIMIT"] = "org-max-query-limit";
|
54 | |
55 |
|
56 |
|
57 | OrgConfigProperties["ORG_INSTANCE_URL"] = "org-instance-url";
|
58 | |
59 |
|
60 |
|
61 | OrgConfigProperties["ORG_ISV_DEBUGGER_SID"] = "org-isv-debugger-sid";
|
62 | |
63 |
|
64 |
|
65 | OrgConfigProperties["ORG_ISV_DEBUGGER_URL"] = "org-isv-debugger-url";
|
66 | })(OrgConfigProperties = exports.OrgConfigProperties || (exports.OrgConfigProperties = {}));
|
67 | exports.ORG_CONFIG_ALLOWED_PROPERTIES = [
|
68 | {
|
69 | key: OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES,
|
70 | description: messages.getMessage(OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES),
|
71 | },
|
72 | {
|
73 | key: OrgConfigProperties.TARGET_ORG,
|
74 | description: messages.getMessage(OrgConfigProperties.TARGET_ORG),
|
75 | },
|
76 | {
|
77 | key: OrgConfigProperties.TARGET_DEV_HUB,
|
78 | description: messages.getMessage(OrgConfigProperties.TARGET_DEV_HUB),
|
79 | },
|
80 | {
|
81 | key: OrgConfigProperties.ORG_INSTANCE_URL,
|
82 | description: messages.getMessage(OrgConfigProperties.ORG_INSTANCE_URL),
|
83 | input: {
|
84 |
|
85 | validator: (value) => {
|
86 | if (value == null)
|
87 | return true;
|
88 |
|
89 |
|
90 | return ((0, ts_types_1.isString)(value) &&
|
91 | sfdcUrl_1.SfdcUrl.isValidUrl(value) &&
|
92 | (new sfdcUrl_1.SfdcUrl(value).isSalesforceDomain() || new sfdcUrl_1.SfdcUrl(value).isInternalUrl()));
|
93 | },
|
94 | failedMessage: messages.getMessage('invalidInstanceUrl'),
|
95 | },
|
96 | },
|
97 | {
|
98 | key: OrgConfigProperties.ORG_API_VERSION,
|
99 | description: messages.getMessage(OrgConfigProperties.ORG_API_VERSION),
|
100 | hidden: true,
|
101 | input: {
|
102 |
|
103 | validator: (value) => value == null || ((0, ts_types_1.isString)(value) && (0, sfdc_1.validateApiVersion)(value)),
|
104 | failedMessage: messages.getMessage('invalidApiVersion'),
|
105 | },
|
106 | },
|
107 | {
|
108 | key: OrgConfigProperties.ORG_ISV_DEBUGGER_SID,
|
109 | description: messages.getMessage(OrgConfigProperties.ORG_ISV_DEBUGGER_SID),
|
110 | encrypted: true,
|
111 | input: {
|
112 |
|
113 | validator: (value) => value == null || (0, ts_types_1.isString)(value),
|
114 | failedMessage: messages.getMessage('invalidIsvDebuggerSid'),
|
115 | },
|
116 | },
|
117 | {
|
118 | key: OrgConfigProperties.ORG_ISV_DEBUGGER_URL,
|
119 | description: messages.getMessage(OrgConfigProperties.ORG_ISV_DEBUGGER_URL),
|
120 | input: {
|
121 |
|
122 | validator: (value) => value == null || (0, ts_types_1.isString)(value),
|
123 | failedMessage: messages.getMessage('invalidIsvDebuggerUrl'),
|
124 | },
|
125 | },
|
126 | {
|
127 | key: OrgConfigProperties.ORG_MAX_QUERY_LIMIT,
|
128 | description: messages.getMessage(OrgConfigProperties.ORG_MAX_QUERY_LIMIT),
|
129 | input: {
|
130 |
|
131 |
|
132 | validator: (value) => value >>> 0 === parseFloat(value) && value > 0,
|
133 | failedMessage: messages.getMessage('invalidNumberConfigValue'),
|
134 | },
|
135 | },
|
136 | ];
|
137 |
|
\ | No newline at end of file |