auth0-deploy-cli 8.21.0 → 8.23.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/.circleci/config.yml +57 -5
- package/CHANGELOG.md +46 -2
- package/README.md +1 -1
- package/eslint.config.js +131 -0
- package/lib/args.js +0 -1
- package/lib/commands/export.js +41 -49
- package/lib/commands/import.js +36 -43
- package/lib/commands/index.js +0 -1
- package/lib/configFactory.js +0 -1
- package/lib/context/defaults.d.ts +1 -0
- package/lib/context/defaults.js +57 -10
- package/lib/context/directory/handlers/actions.js +40 -39
- package/lib/context/directory/handlers/attackProtection.js +22 -34
- package/lib/context/directory/handlers/branding.js +12 -21
- package/lib/context/directory/handlers/clientGrants.js +52 -62
- package/lib/context/directory/handlers/clients.js +44 -57
- package/lib/context/directory/handlers/connectionProfiles.d.ts +1 -1
- package/lib/context/directory/handlers/connectionProfiles.js +20 -30
- package/lib/context/directory/handlers/connections.js +32 -41
- package/lib/context/directory/handlers/customDomains.js +9 -21
- package/lib/context/directory/handlers/databases.js +37 -35
- package/lib/context/directory/handlers/emailProvider.js +22 -36
- package/lib/context/directory/handlers/emailTemplates.js +20 -29
- package/lib/context/directory/handlers/flowVaultConnections.js +40 -49
- package/lib/context/directory/handlers/flows.js +38 -48
- package/lib/context/directory/handlers/forms.js +38 -48
- package/lib/context/directory/handlers/guardianFactorProviders.js +9 -21
- package/lib/context/directory/handlers/guardianFactorTemplates.js +9 -21
- package/lib/context/directory/handlers/guardianFactors.js +9 -21
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +8 -20
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +8 -20
- package/lib/context/directory/handlers/guardianPolicies.js +8 -20
- package/lib/context/directory/handlers/hooks.js +24 -34
- package/lib/context/directory/handlers/index.js +4 -1
- package/lib/context/directory/handlers/logStreams.js +12 -24
- package/lib/context/directory/handlers/networkACLs.js +22 -34
- package/lib/context/directory/handlers/organizations.js +39 -44
- package/lib/context/directory/handlers/pages.js +31 -37
- package/lib/context/directory/handlers/phoneProvider.js +12 -24
- package/lib/context/directory/handlers/phoneTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/phoneTemplates.js +39 -0
- package/lib/context/directory/handlers/prompts.js +58 -76
- package/lib/context/directory/handlers/resourceServers.d.ts +1 -1
- package/lib/context/directory/handlers/resourceServers.js +18 -30
- package/lib/context/directory/handlers/roles.js +21 -31
- package/lib/context/directory/handlers/rules.js +22 -32
- package/lib/context/directory/handlers/rulesConfigs.js +3 -15
- package/lib/context/directory/handlers/selfServiceProfiles.js +28 -40
- package/lib/context/directory/handlers/tenant.js +14 -34
- package/lib/context/directory/handlers/themes.js +9 -21
- package/lib/context/directory/handlers/tokenExchangeProfiles.d.ts +5 -0
- package/lib/context/directory/handlers/tokenExchangeProfiles.js +41 -0
- package/lib/context/directory/handlers/triggers.d.ts +1 -1
- package/lib/context/directory/handlers/triggers.js +16 -26
- package/lib/context/directory/handlers/userAttributeProfiles.d.ts +1 -1
- package/lib/context/directory/handlers/userAttributeProfiles.js +16 -26
- package/lib/context/directory/index.js +66 -80
- package/lib/context/index.js +7 -18
- package/lib/context/yaml/handlers/actions.js +39 -41
- package/lib/context/yaml/handlers/attackProtection.js +27 -41
- package/lib/context/yaml/handlers/branding.js +47 -69
- package/lib/context/yaml/handlers/clientGrants.js +26 -40
- package/lib/context/yaml/handlers/clients.js +69 -84
- package/lib/context/yaml/handlers/connectionProfiles.d.ts +1 -1
- package/lib/context/yaml/handlers/connectionProfiles.js +20 -34
- package/lib/context/yaml/handlers/connections.js +63 -67
- package/lib/context/yaml/handlers/customDomains.js +7 -19
- package/lib/context/yaml/handlers/databases.js +63 -65
- package/lib/context/yaml/handlers/emailProvider.js +22 -37
- package/lib/context/yaml/handlers/emailTemplates.js +28 -39
- package/lib/context/yaml/handlers/flowVaultConnections.js +37 -50
- package/lib/context/yaml/handlers/flows.js +55 -66
- package/lib/context/yaml/handlers/forms.js +55 -66
- package/lib/context/yaml/handlers/guardianFactorProviders.js +7 -19
- package/lib/context/yaml/handlers/guardianFactorTemplates.js +7 -19
- package/lib/context/yaml/handlers/guardianFactors.js +7 -19
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +7 -19
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +7 -19
- package/lib/context/yaml/handlers/guardianPolicies.js +7 -19
- package/lib/context/yaml/handlers/hooks.js +34 -48
- package/lib/context/yaml/handlers/index.js +4 -1
- package/lib/context/yaml/handlers/logStreams.js +16 -30
- package/lib/context/yaml/handlers/networkACLs.js +25 -39
- package/lib/context/yaml/handlers/organizations.js +37 -46
- package/lib/context/yaml/handlers/pages.js +31 -39
- package/lib/context/yaml/handlers/phoneProvider.js +17 -31
- package/lib/context/yaml/handlers/phoneTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/phoneTemplates.js +25 -0
- package/lib/context/yaml/handlers/prompts.js +22 -47
- package/lib/context/yaml/handlers/resourceServers.d.ts +1 -1
- package/lib/context/yaml/handlers/resourceServers.js +21 -33
- package/lib/context/yaml/handlers/roles.js +19 -33
- package/lib/context/yaml/handlers/rules.js +28 -39
- package/lib/context/yaml/handlers/rulesConfigs.js +14 -28
- package/lib/context/yaml/handlers/selfServiceProfiles.js +29 -43
- package/lib/context/yaml/handlers/tenant.js +19 -41
- package/lib/context/yaml/handlers/themes.js +7 -19
- package/lib/context/yaml/handlers/tokenExchangeProfiles.d.ts +5 -0
- package/lib/context/yaml/handlers/tokenExchangeProfiles.js +27 -0
- package/lib/context/yaml/handlers/triggers.d.ts +1 -1
- package/lib/context/yaml/handlers/triggers.js +15 -29
- package/lib/context/yaml/handlers/userAttributeProfiles.d.ts +1 -1
- package/lib/context/yaml/handlers/userAttributeProfiles.js +7 -19
- package/lib/context/yaml/index.js +120 -128
- package/lib/index.d.ts +4 -96
- package/lib/index.js +24 -34
- package/lib/keywordPreservation.d.ts +1 -1
- package/lib/keywordPreservation.js +11 -6
- package/lib/logger.js +0 -1
- package/lib/readonly.js +3 -4
- package/lib/sessionDurationsToMinutes.js +0 -1
- package/lib/tools/auth0/client.js +108 -127
- package/lib/tools/auth0/handlers/actions.d.ts +8 -26
- package/lib/tools/auth0/handlers/actions.js +138 -149
- package/lib/tools/auth0/handlers/attackProtection.js +80 -92
- package/lib/tools/auth0/handlers/branding.js +75 -99
- package/lib/tools/auth0/handlers/clientGrants.d.ts +2 -9
- package/lib/tools/auth0/handlers/clientGrants.js +68 -73
- package/lib/tools/auth0/handlers/clients.d.ts +25 -13
- package/lib/tools/auth0/handlers/clients.js +134 -86
- package/lib/tools/auth0/handlers/connectionProfiles.d.ts +3 -1
- package/lib/tools/auth0/handlers/connectionProfiles.js +36 -32
- package/lib/tools/auth0/handlers/connections.d.ts +3 -1
- package/lib/tools/auth0/handlers/connections.js +130 -135
- package/lib/tools/auth0/handlers/customDomains.d.ts +4 -1
- package/lib/tools/auth0/handlers/customDomains.js +43 -53
- package/lib/tools/auth0/handlers/databases.js +94 -114
- package/lib/tools/auth0/handlers/default.d.ts +2 -2
- package/lib/tools/auth0/handlers/default.js +210 -171
- package/lib/tools/auth0/handlers/emailProvider.js +41 -52
- package/lib/tools/auth0/handlers/emailTemplates.d.ts +1 -0
- package/lib/tools/auth0/handlers/emailTemplates.js +54 -70
- package/lib/tools/auth0/handlers/flowVaultConnections.d.ts +5 -12
- package/lib/tools/auth0/handlers/flowVaultConnections.js +108 -143
- package/lib/tools/auth0/handlers/flows.d.ts +2 -3
- package/lib/tools/auth0/handlers/flows.js +92 -129
- package/lib/tools/auth0/handlers/forms.d.ts +3 -3
- package/lib/tools/auth0/handlers/forms.js +98 -112
- package/lib/tools/auth0/handlers/guardianFactorProviders.js +61 -84
- package/lib/tools/auth0/handlers/guardianFactorTemplates.js +46 -68
- package/lib/tools/auth0/handlers/guardianFactors.js +35 -45
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +29 -45
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +29 -45
- package/lib/tools/auth0/handlers/guardianPolicies.js +20 -35
- package/lib/tools/auth0/handlers/hooks.js +123 -153
- package/lib/tools/auth0/handlers/index.js +4 -1
- package/lib/tools/auth0/handlers/logStreams.js +42 -47
- package/lib/tools/auth0/handlers/networkACLs.d.ts +5 -4
- package/lib/tools/auth0/handlers/networkACLs.js +115 -133
- package/lib/tools/auth0/handlers/organizations.d.ts +10 -9
- package/lib/tools/auth0/handlers/organizations.js +360 -429
- package/lib/tools/auth0/handlers/pages.js +74 -83
- package/lib/tools/auth0/handlers/phoneProvider.d.ts +2 -2
- package/lib/tools/auth0/handlers/phoneProvider.js +69 -82
- package/lib/tools/auth0/handlers/phoneTemplates.d.ts +63 -0
- package/lib/tools/auth0/handlers/phoneTemplates.js +229 -0
- package/lib/tools/auth0/handlers/prompts.d.ts +7 -7
- package/lib/tools/auth0/handlers/prompts.js +246 -240
- package/lib/tools/auth0/handlers/resourceServers.d.ts +6 -1
- package/lib/tools/auth0/handlers/resourceServers.js +97 -60
- package/lib/tools/auth0/handlers/roles.js +162 -178
- package/lib/tools/auth0/handlers/rules.js +144 -162
- package/lib/tools/auth0/handlers/rulesConfigs.js +30 -39
- package/lib/tools/auth0/handlers/scimHandler.d.ts +4 -3
- package/lib/tools/auth0/handlers/scimHandler.js +110 -132
- package/lib/tools/auth0/handlers/selfServiceProfiles.d.ts +12 -3
- package/lib/tools/auth0/handlers/selfServiceProfiles.js +173 -203
- package/lib/tools/auth0/handlers/tenant.d.ts +5 -3
- package/lib/tools/auth0/handlers/tenant.js +46 -52
- package/lib/tools/auth0/handlers/themes.d.ts +12 -12
- package/lib/tools/auth0/handlers/themes.js +86 -102
- package/lib/tools/auth0/handlers/tokenExchangeProfiles.d.ts +60 -0
- package/lib/tools/auth0/handlers/tokenExchangeProfiles.js +271 -0
- package/lib/tools/auth0/handlers/triggers.js +59 -75
- package/lib/tools/auth0/handlers/userAttributeProfiles.d.ts +3 -2
- package/lib/tools/auth0/handlers/userAttributeProfiles.js +41 -43
- package/lib/tools/auth0/index.js +35 -48
- package/lib/tools/auth0/schema.js +6 -4
- package/lib/tools/calculateChanges.js +24 -15
- package/lib/tools/constants.d.ts +4 -2
- package/lib/tools/constants.js +3 -1
- package/lib/tools/deploy.js +17 -29
- package/lib/tools/index.d.ts +3 -89
- package/lib/tools/index.js +3 -2
- package/lib/tools/utils.d.ts +1 -1
- package/lib/tools/utils.js +12 -22
- package/lib/tools/validationError.js +0 -1
- package/lib/types.d.ts +15 -5
- package/lib/types.js +0 -1
- package/lib/utils.d.ts +3 -58
- package/lib/utils.js +8 -5
- package/package.json +13 -12
- package/tsconfig.json +4 -3
- package/.eslintignore +0 -5
- package/.eslintrc +0 -69
- package/lib/args.js.map +0 -1
- package/lib/commands/export.js.map +0 -1
- package/lib/commands/import.js.map +0 -1
- package/lib/commands/index.js.map +0 -1
- package/lib/configFactory.js.map +0 -1
- package/lib/context/defaults.js.map +0 -1
- package/lib/context/directory/handlers/actions.js.map +0 -1
- package/lib/context/directory/handlers/attackProtection.js.map +0 -1
- package/lib/context/directory/handlers/branding.js.map +0 -1
- package/lib/context/directory/handlers/clientGrants.js.map +0 -1
- package/lib/context/directory/handlers/clients.js.map +0 -1
- package/lib/context/directory/handlers/connectionProfiles.js.map +0 -1
- package/lib/context/directory/handlers/connections.js.map +0 -1
- package/lib/context/directory/handlers/customDomains.js.map +0 -1
- package/lib/context/directory/handlers/databases.js.map +0 -1
- package/lib/context/directory/handlers/emailProvider.js.map +0 -1
- package/lib/context/directory/handlers/emailTemplates.js.map +0 -1
- package/lib/context/directory/handlers/flowVaultConnections.js.map +0 -1
- package/lib/context/directory/handlers/flows.js.map +0 -1
- package/lib/context/directory/handlers/forms.js.map +0 -1
- package/lib/context/directory/handlers/guardianFactorProviders.js.map +0 -1
- package/lib/context/directory/handlers/guardianFactorTemplates.js.map +0 -1
- package/lib/context/directory/handlers/guardianFactors.js.map +0 -1
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
- package/lib/context/directory/handlers/guardianPolicies.js.map +0 -1
- package/lib/context/directory/handlers/hooks.js.map +0 -1
- package/lib/context/directory/handlers/index.js.map +0 -1
- package/lib/context/directory/handlers/logStreams.js.map +0 -1
- package/lib/context/directory/handlers/networkACLs.js.map +0 -1
- package/lib/context/directory/handlers/organizations.js.map +0 -1
- package/lib/context/directory/handlers/pages.js.map +0 -1
- package/lib/context/directory/handlers/phoneProvider.js.map +0 -1
- package/lib/context/directory/handlers/prompts.js.map +0 -1
- package/lib/context/directory/handlers/resourceServers.js.map +0 -1
- package/lib/context/directory/handlers/roles.js.map +0 -1
- package/lib/context/directory/handlers/rules.js.map +0 -1
- package/lib/context/directory/handlers/rulesConfigs.js.map +0 -1
- package/lib/context/directory/handlers/selfServiceProfiles.js.map +0 -1
- package/lib/context/directory/handlers/tenant.js.map +0 -1
- package/lib/context/directory/handlers/themes.js.map +0 -1
- package/lib/context/directory/handlers/triggers.js.map +0 -1
- package/lib/context/directory/handlers/userAttributeProfiles.js.map +0 -1
- package/lib/context/directory/index.js.map +0 -1
- package/lib/context/index.js.map +0 -1
- package/lib/context/yaml/handlers/actions.js.map +0 -1
- package/lib/context/yaml/handlers/attackProtection.js.map +0 -1
- package/lib/context/yaml/handlers/branding.js.map +0 -1
- package/lib/context/yaml/handlers/clientGrants.js.map +0 -1
- package/lib/context/yaml/handlers/clients.js.map +0 -1
- package/lib/context/yaml/handlers/connectionProfiles.js.map +0 -1
- package/lib/context/yaml/handlers/connections.js.map +0 -1
- package/lib/context/yaml/handlers/customDomains.js.map +0 -1
- package/lib/context/yaml/handlers/databases.js.map +0 -1
- package/lib/context/yaml/handlers/emailProvider.js.map +0 -1
- package/lib/context/yaml/handlers/emailTemplates.js.map +0 -1
- package/lib/context/yaml/handlers/flowVaultConnections.js.map +0 -1
- package/lib/context/yaml/handlers/flows.js.map +0 -1
- package/lib/context/yaml/handlers/forms.js.map +0 -1
- package/lib/context/yaml/handlers/guardianFactorProviders.js.map +0 -1
- package/lib/context/yaml/handlers/guardianFactorTemplates.js.map +0 -1
- package/lib/context/yaml/handlers/guardianFactors.js.map +0 -1
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
- package/lib/context/yaml/handlers/guardianPolicies.js.map +0 -1
- package/lib/context/yaml/handlers/hooks.js.map +0 -1
- package/lib/context/yaml/handlers/index.js.map +0 -1
- package/lib/context/yaml/handlers/logStreams.js.map +0 -1
- package/lib/context/yaml/handlers/networkACLs.js.map +0 -1
- package/lib/context/yaml/handlers/organizations.js.map +0 -1
- package/lib/context/yaml/handlers/pages.js.map +0 -1
- package/lib/context/yaml/handlers/phoneProvider.js.map +0 -1
- package/lib/context/yaml/handlers/prompts.js.map +0 -1
- package/lib/context/yaml/handlers/resourceServers.js.map +0 -1
- package/lib/context/yaml/handlers/roles.js.map +0 -1
- package/lib/context/yaml/handlers/rules.js.map +0 -1
- package/lib/context/yaml/handlers/rulesConfigs.js.map +0 -1
- package/lib/context/yaml/handlers/selfServiceProfiles.js.map +0 -1
- package/lib/context/yaml/handlers/tenant.js.map +0 -1
- package/lib/context/yaml/handlers/themes.js.map +0 -1
- package/lib/context/yaml/handlers/triggers.js.map +0 -1
- package/lib/context/yaml/handlers/userAttributeProfiles.js.map +0 -1
- package/lib/context/yaml/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/keywordPreservation.js.map +0 -1
- package/lib/logger.js.map +0 -1
- package/lib/readonly.js.map +0 -1
- package/lib/sessionDurationsToMinutes.js.map +0 -1
- package/lib/tools/auth0/client.js.map +0 -1
- package/lib/tools/auth0/handlers/actions.js.map +0 -1
- package/lib/tools/auth0/handlers/attackProtection.js.map +0 -1
- package/lib/tools/auth0/handlers/branding.js.map +0 -1
- package/lib/tools/auth0/handlers/clientGrants.js.map +0 -1
- package/lib/tools/auth0/handlers/clients.js.map +0 -1
- package/lib/tools/auth0/handlers/connectionProfiles.js.map +0 -1
- package/lib/tools/auth0/handlers/connections.js.map +0 -1
- package/lib/tools/auth0/handlers/customDomains.js.map +0 -1
- package/lib/tools/auth0/handlers/databases.js.map +0 -1
- package/lib/tools/auth0/handlers/default.js.map +0 -1
- package/lib/tools/auth0/handlers/emailProvider.js.map +0 -1
- package/lib/tools/auth0/handlers/emailTemplates.js.map +0 -1
- package/lib/tools/auth0/handlers/flowVaultConnections.js.map +0 -1
- package/lib/tools/auth0/handlers/flows.js.map +0 -1
- package/lib/tools/auth0/handlers/forms.js.map +0 -1
- package/lib/tools/auth0/handlers/guardianFactorProviders.js.map +0 -1
- package/lib/tools/auth0/handlers/guardianFactorTemplates.js.map +0 -1
- package/lib/tools/auth0/handlers/guardianFactors.js.map +0 -1
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
- package/lib/tools/auth0/handlers/guardianPolicies.js.map +0 -1
- package/lib/tools/auth0/handlers/hooks.js.map +0 -1
- package/lib/tools/auth0/handlers/index.js.map +0 -1
- package/lib/tools/auth0/handlers/logStreams.js.map +0 -1
- package/lib/tools/auth0/handlers/networkACLs.js.map +0 -1
- package/lib/tools/auth0/handlers/organizations.js.map +0 -1
- package/lib/tools/auth0/handlers/pages.js.map +0 -1
- package/lib/tools/auth0/handlers/phoneProvider.js.map +0 -1
- package/lib/tools/auth0/handlers/prompts.js.map +0 -1
- package/lib/tools/auth0/handlers/resourceServers.js.map +0 -1
- package/lib/tools/auth0/handlers/roles.js.map +0 -1
- package/lib/tools/auth0/handlers/rules.js.map +0 -1
- package/lib/tools/auth0/handlers/rulesConfigs.js.map +0 -1
- package/lib/tools/auth0/handlers/scimHandler.js.map +0 -1
- package/lib/tools/auth0/handlers/selfServiceProfiles.js.map +0 -1
- package/lib/tools/auth0/handlers/tenant.js.map +0 -1
- package/lib/tools/auth0/handlers/themes.js.map +0 -1
- package/lib/tools/auth0/handlers/triggers.js.map +0 -1
- package/lib/tools/auth0/handlers/userAttributeProfiles.js.map +0 -1
- package/lib/tools/auth0/index.js.map +0 -1
- package/lib/tools/auth0/schema.js.map +0 -1
- package/lib/tools/calculateChanges.js.map +0 -1
- package/lib/tools/constants.js.map +0 -1
- package/lib/tools/deploy.js.map +0 -1
- package/lib/tools/index.js.map +0 -1
- package/lib/tools/utils.js.map +0 -1
- package/lib/tools/validationError.js.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.js.map +0 -1
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -48,40 +39,41 @@ function parse(context) {
|
|
|
48
39
|
connections,
|
|
49
40
|
};
|
|
50
41
|
}
|
|
51
|
-
function dump(context) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
async function dump(context) {
|
|
43
|
+
const { connections, clientsOrig } = context.assets;
|
|
44
|
+
if (!connections)
|
|
45
|
+
return; // Skip, nothing to dump
|
|
46
|
+
const connectionsFolder = path_1.default.join(context.filePath, tools_1.constants.CONNECTIONS_DIRECTORY);
|
|
47
|
+
fs_extra_1.default.ensureDirSync(connectionsFolder);
|
|
48
|
+
// Convert enabled_clients from id to name
|
|
49
|
+
connections.forEach((connection) => {
|
|
50
|
+
let dumpedConnection = {
|
|
51
|
+
...connection,
|
|
52
|
+
...(connection.enabled_clients && {
|
|
61
53
|
enabled_clients: (0, utils_1.mapClientID2NameSorted)(connection.enabled_clients, clientsOrig || []),
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
}),
|
|
55
|
+
};
|
|
56
|
+
const connectionName = (0, utils_1.sanitize)(dumpedConnection.name);
|
|
57
|
+
// Mask secrets
|
|
58
|
+
dumpedConnection = (0, defaults_1.connectionDefaults)(dumpedConnection);
|
|
59
|
+
if (dumpedConnection.strategy === 'email') {
|
|
60
|
+
(0, utils_1.ensureProp)(dumpedConnection, 'options.email.body');
|
|
61
|
+
const html = dumpedConnection.options.email.body;
|
|
62
|
+
const emailConnectionHtml = path_1.default.join(connectionsFolder, `${connectionName}.html`);
|
|
63
|
+
logger_1.default.info(`Writing ${emailConnectionHtml}`);
|
|
64
|
+
fs_extra_1.default.writeFileSync(emailConnectionHtml, html);
|
|
65
|
+
dumpedConnection.options.email.body = `./${connectionName}.html`;
|
|
66
|
+
}
|
|
67
|
+
if (dumpedConnection.strategy === 'samlp' && dumpedConnection.options) {
|
|
68
|
+
if ('cert' in dumpedConnection.options) {
|
|
69
|
+
dumpedConnection.options.cert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.cert);
|
|
73
70
|
}
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
dumpedConnection.options.cert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.cert);
|
|
77
|
-
}
|
|
78
|
-
if ('signingCert' in dumpedConnection.options) {
|
|
79
|
-
dumpedConnection.options.signingCert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.signingCert);
|
|
80
|
-
}
|
|
71
|
+
if ('signingCert' in dumpedConnection.options) {
|
|
72
|
+
dumpedConnection.options.signingCert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.signingCert);
|
|
81
73
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
74
|
+
}
|
|
75
|
+
const connectionFile = path_1.default.join(connectionsFolder, `${connectionName}.json`);
|
|
76
|
+
(0, utils_1.dumpJSON)(connectionFile, dumpedConnection);
|
|
85
77
|
});
|
|
86
78
|
}
|
|
87
79
|
const connectionsHandler = {
|
|
@@ -89,4 +81,3 @@ const connectionsHandler = {
|
|
|
89
81
|
dump,
|
|
90
82
|
};
|
|
91
83
|
exports.default = connectionsHandler;
|
|
92
|
-
//# sourceMappingURL=connections.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -30,21 +21,18 @@ function parse(context) {
|
|
|
30
21
|
}),
|
|
31
22
|
};
|
|
32
23
|
}
|
|
33
|
-
function dump(context) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
(0, utils_1.dumpJSON)(customDomainsFile, customDomains);
|
|
43
|
-
});
|
|
24
|
+
async function dump(context) {
|
|
25
|
+
const { customDomains } = context.assets;
|
|
26
|
+
if (!customDomains)
|
|
27
|
+
return; // Skip, nothing to dump
|
|
28
|
+
// Create Rules folder
|
|
29
|
+
const customDomainsDirectory = getCustomDomainsDirectory(context.filePath);
|
|
30
|
+
fs_extra_1.default.ensureDirSync(customDomainsDirectory);
|
|
31
|
+
const customDomainsFile = getCustomDomainsFile(context.filePath);
|
|
32
|
+
(0, utils_1.dumpJSON)(customDomainsFile, customDomains);
|
|
44
33
|
}
|
|
45
34
|
const customDomainsHandler = {
|
|
46
35
|
parse,
|
|
47
36
|
dump,
|
|
48
37
|
};
|
|
49
38
|
exports.default = customDomainsHandler;
|
|
50
|
-
//# sourceMappingURL=customDomains.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -18,7 +9,6 @@ const tools_1 = require("../../../tools");
|
|
|
18
9
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
19
10
|
const utils_1 = require("../../../utils");
|
|
20
11
|
function getDatabase(folder, mappingOpts) {
|
|
21
|
-
var _a;
|
|
22
12
|
const metaFile = path_1.default.join(folder, 'database.json');
|
|
23
13
|
const metaData = (() => {
|
|
24
14
|
try {
|
|
@@ -33,9 +23,17 @@ function getDatabase(folder, mappingOpts) {
|
|
|
33
23
|
logger_1.default.warn(`Skipping database folder ${folder} as ${metaFile} is empty`);
|
|
34
24
|
return {};
|
|
35
25
|
}
|
|
36
|
-
const database =
|
|
26
|
+
const database = {
|
|
27
|
+
...metaData,
|
|
28
|
+
options: {
|
|
29
|
+
// @ts-ignore because this code exists currently, but still needs to be understood if it is correct or not
|
|
30
|
+
...(metaData.options || {}),
|
|
31
|
+
// @ts-ignore because this code exists currently, but still needs to be understood if it is correct or not
|
|
32
|
+
...(metaData?.customScripts && { customScripts: metaData?.customScripts }),
|
|
33
|
+
},
|
|
34
|
+
};
|
|
37
35
|
// If any customScripts configured then load content of files
|
|
38
|
-
if (
|
|
36
|
+
if (database.options?.customScripts) {
|
|
39
37
|
Object.entries(database.options.customScripts).forEach(([name, script]) => {
|
|
40
38
|
if (!tools_1.constants.DATABASE_SCRIPTS.includes(name)) {
|
|
41
39
|
// skip invalid keys in customScripts object
|
|
@@ -66,25 +64,29 @@ function parse(context) {
|
|
|
66
64
|
databases,
|
|
67
65
|
};
|
|
68
66
|
}
|
|
69
|
-
function dump(context) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
async function dump(context) {
|
|
68
|
+
const { databases } = context.assets;
|
|
69
|
+
if (!databases)
|
|
70
|
+
return; // Skip, nothing to dump
|
|
71
|
+
const databasesFolder = path_1.default.join(context.filePath, tools_1.constants.DATABASE_CONNECTIONS_DIRECTORY);
|
|
72
|
+
fs_extra_1.default.ensureDirSync(databasesFolder);
|
|
73
|
+
databases.forEach((database) => {
|
|
74
|
+
const dbFolder = path_1.default.join(databasesFolder, (0, utils_1.sanitize)(database.name));
|
|
75
|
+
fs_extra_1.default.ensureDirSync(dbFolder);
|
|
76
|
+
const sortCustomScripts = (name1, name2) => {
|
|
77
|
+
if (name1 === name2)
|
|
78
|
+
return 0;
|
|
79
|
+
return name1 > name2 ? 1 : -1;
|
|
80
|
+
};
|
|
81
|
+
const formatted = {
|
|
82
|
+
...database,
|
|
83
|
+
...(database.enabled_clients && {
|
|
86
84
|
enabled_clients: (0, utils_1.mapClientID2NameSorted)(database.enabled_clients, context.assets.clientsOrig || []),
|
|
87
|
-
})
|
|
85
|
+
}),
|
|
86
|
+
options: {
|
|
87
|
+
...(database.options || {}),
|
|
88
|
+
// customScripts option only written if there are scripts
|
|
89
|
+
...(database.options?.customScripts && {
|
|
88
90
|
customScripts: Object.entries(database.options.customScripts)
|
|
89
91
|
// @ts-ignore because we'll fix this in subsequent PR
|
|
90
92
|
.sort(sortCustomScripts)
|
|
@@ -98,10 +100,11 @@ function dump(context) {
|
|
|
98
100
|
scripts[name] = `./${scriptName}`;
|
|
99
101
|
return scripts;
|
|
100
102
|
}, {}),
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
}),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
const databaseFile = path_1.default.join(dbFolder, 'database.json');
|
|
107
|
+
(0, utils_1.dumpJSON)(databaseFile, formatted);
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
110
|
const databasesHandler = {
|
|
@@ -109,4 +112,3 @@ const databasesHandler = {
|
|
|
109
112
|
dump,
|
|
110
113
|
};
|
|
111
114
|
exports.default = databasesHandler;
|
|
112
|
-
//# sourceMappingURL=databases.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -33,37 +24,32 @@ function parse(context) {
|
|
|
33
24
|
}
|
|
34
25
|
return { emailProvider: null };
|
|
35
26
|
}
|
|
36
|
-
function dump(context) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!excludedDefaults.includes('emailProvider')) {
|
|
45
|
-
// Add placeholder for credentials as they cannot be exported
|
|
46
|
-
return (0, defaults_1.emailProviderDefaults)(context.assets.emailProvider);
|
|
47
|
-
}
|
|
48
|
-
return context.assets.emailProvider;
|
|
49
|
-
})();
|
|
50
|
-
// Apply EXCLUDED_PROPS after emailProviderDefaults to remove any re-added fields
|
|
51
|
-
const excludedFields = ((_a = context.config.EXCLUDED_PROPS) === null || _a === void 0 ? void 0 : _a.emailProvider) || [];
|
|
52
|
-
if (excludedFields.length > 0) {
|
|
53
|
-
emailProvider = Object.assign({}, emailProvider);
|
|
54
|
-
excludedFields.forEach((field) => {
|
|
55
|
-
dot_prop_1.default.delete(emailProvider, field);
|
|
56
|
-
});
|
|
27
|
+
async function dump(context) {
|
|
28
|
+
if (!context.assets.emailProvider)
|
|
29
|
+
return; // Skip, nothing to dump
|
|
30
|
+
let emailProvider = (() => {
|
|
31
|
+
const excludedDefaults = context.assets.exclude?.defaults || [];
|
|
32
|
+
if (!excludedDefaults.includes('emailProvider')) {
|
|
33
|
+
// Add placeholder for credentials as they cannot be exported
|
|
34
|
+
return (0, defaults_1.emailProviderDefaults)(context.assets.emailProvider);
|
|
57
35
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
36
|
+
return context.assets.emailProvider;
|
|
37
|
+
})();
|
|
38
|
+
// Apply EXCLUDED_PROPS after emailProviderDefaults to remove any re-added fields
|
|
39
|
+
const excludedFields = context.config.EXCLUDED_PROPS?.emailProvider || [];
|
|
40
|
+
if (excludedFields.length > 0) {
|
|
41
|
+
emailProvider = { ...emailProvider };
|
|
42
|
+
excludedFields.forEach((field) => {
|
|
43
|
+
dot_prop_1.default.delete(emailProvider, field);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const emailsFolder = path_1.default.join(context.filePath, tools_1.constants.EMAIL_TEMPLATES_DIRECTORY);
|
|
47
|
+
fs_extra_1.default.ensureDirSync(emailsFolder);
|
|
48
|
+
const emailProviderFile = path_1.default.join(emailsFolder, 'provider.json');
|
|
49
|
+
(0, utils_1.dumpJSON)(emailProviderFile, emailProvider);
|
|
63
50
|
}
|
|
64
51
|
const emailProviderHandler = {
|
|
65
52
|
parse,
|
|
66
53
|
dump,
|
|
67
54
|
};
|
|
68
55
|
exports.default = emailProviderHandler;
|
|
69
|
-
//# sourceMappingURL=emailProvider.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -43,32 +34,33 @@ function parse(context) {
|
|
|
43
34
|
logger_1.default.warn(`Skipping email template file ${meta.body} as missing the corresponding '.json' file`);
|
|
44
35
|
return [];
|
|
45
36
|
}
|
|
46
|
-
return
|
|
37
|
+
return {
|
|
38
|
+
...meta,
|
|
39
|
+
body: (0, tools_1.loadFileAndReplaceKeywords)(templateFilePath, {
|
|
47
40
|
mappings: context.mappings,
|
|
48
41
|
disableKeywordReplacement: context.disableKeywordReplacement,
|
|
49
|
-
})
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
50
44
|
});
|
|
51
45
|
return {
|
|
52
46
|
emailTemplates,
|
|
53
47
|
};
|
|
54
48
|
}
|
|
55
|
-
function dump(context) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
(0, utils_1.dumpJSON)(templateFile, Object.assign(Object.assign({}, template), { body: `./${template.template}.html` }));
|
|
71
|
-
});
|
|
49
|
+
async function dump(context) {
|
|
50
|
+
const { emailTemplates } = context.assets;
|
|
51
|
+
if (!emailTemplates)
|
|
52
|
+
return; // Skip, nothing to dump
|
|
53
|
+
// Create Templates folder
|
|
54
|
+
const templatesFolder = path_1.default.join(context.filePath, tools_1.constants.EMAIL_TEMPLATES_DIRECTORY);
|
|
55
|
+
fs_extra_1.default.ensureDirSync(templatesFolder);
|
|
56
|
+
emailTemplates.forEach((template) => {
|
|
57
|
+
// Dump template html to file
|
|
58
|
+
const templateHtml = path_1.default.join(templatesFolder, `${template.template}.html`);
|
|
59
|
+
logger_1.default.info(`Writing ${templateHtml}`);
|
|
60
|
+
fs_extra_1.default.writeFileSync(templateHtml, template.body);
|
|
61
|
+
// Dump template metadata
|
|
62
|
+
const templateFile = path_1.default.join(templatesFolder, `${template.template}.json`);
|
|
63
|
+
(0, utils_1.dumpJSON)(templateFile, { ...template, body: `./${template.template}.html` });
|
|
72
64
|
});
|
|
73
65
|
}
|
|
74
66
|
const emailTemplatesHandler = {
|
|
@@ -76,4 +68,3 @@ const emailTemplatesHandler = {
|
|
|
76
68
|
dump,
|
|
77
69
|
};
|
|
78
70
|
exports.default = emailTemplatesHandler;
|
|
79
|
-
//# sourceMappingURL=emailTemplates.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -24,58 +15,58 @@ function parse(context) {
|
|
|
24
15
|
return { flowVaultConnections: null }; // Skip
|
|
25
16
|
const files = (0, utils_1.getFiles)(flowVaultsFolder, ['.json']);
|
|
26
17
|
const flowVaultConnections = files.map((f) => {
|
|
27
|
-
const connection =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
const connection = {
|
|
19
|
+
...(0, utils_1.loadJSON)(f, {
|
|
20
|
+
mappings: context.mappings,
|
|
21
|
+
disableKeywordReplacement: context.disableKeywordReplacement,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
31
24
|
return connection;
|
|
32
25
|
});
|
|
33
26
|
return {
|
|
34
27
|
flowVaultConnections,
|
|
35
28
|
};
|
|
36
29
|
}
|
|
37
|
-
function dump(context) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
duplicateVaultConnectionsNames.add(form.name);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
vaultConnectionsNamesSet.add(form.name);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
if (duplicateVaultConnectionsNames.size > 0) {
|
|
54
|
-
const duplicatesArray = Array.from(duplicateVaultConnectionsNames);
|
|
55
|
-
logger_1.default.error(`Duplicate flow vault connections names found: [${duplicatesArray}] , make sure to rename them to avoid conflicts`);
|
|
56
|
-
throw new Error(`Duplicate flow vault connections names found: ${duplicatesArray}`);
|
|
30
|
+
async function dump(context) {
|
|
31
|
+
const { flowVaultConnections } = context.assets;
|
|
32
|
+
if (!flowVaultConnections || (0, lodash_1.isEmpty)(flowVaultConnections))
|
|
33
|
+
return; // Skip, nothing to dump
|
|
34
|
+
// Check if there is any duplicate form name
|
|
35
|
+
const vaultConnectionsNamesSet = new Set();
|
|
36
|
+
const duplicateVaultConnectionsNames = new Set();
|
|
37
|
+
flowVaultConnections.forEach((form) => {
|
|
38
|
+
if (vaultConnectionsNamesSet.has(form.name)) {
|
|
39
|
+
duplicateVaultConnectionsNames.add(form.name);
|
|
57
40
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
else {
|
|
42
|
+
vaultConnectionsNamesSet.add(form.name);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
if (duplicateVaultConnectionsNames.size > 0) {
|
|
46
|
+
const duplicatesArray = Array.from(duplicateVaultConnectionsNames);
|
|
47
|
+
logger_1.default.error(`Duplicate flow vault connections names found: [${duplicatesArray}] , make sure to rename them to avoid conflicts`);
|
|
48
|
+
throw new Error(`Duplicate flow vault connections names found: ${duplicatesArray}`);
|
|
49
|
+
}
|
|
50
|
+
const flowVaultsFolder = path_1.default.join(context.filePath, tools_1.constants.FLOWS_VAULT_DIRECTORY);
|
|
51
|
+
fs_extra_1.default.ensureDirSync(flowVaultsFolder);
|
|
52
|
+
const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'refreshed_at', 'fingerprint'];
|
|
53
|
+
flowVaultConnections.forEach((connection) => {
|
|
54
|
+
removeKeysFromOutput.forEach((key) => {
|
|
55
|
+
if (key in connection) {
|
|
56
|
+
delete connection[key];
|
|
57
|
+
}
|
|
73
58
|
});
|
|
74
59
|
});
|
|
60
|
+
// eslint-disable-next-line no-console
|
|
61
|
+
console.warn('WARNING! Flow vault connections `setup` key does not support keyword preservation, `export` or `dump` commmand will not preserve `setup` key in local configuration file.');
|
|
62
|
+
flowVaultConnections.forEach((connection) => {
|
|
63
|
+
const connectionFile = path_1.default.join(flowVaultsFolder, (0, utils_1.sanitize)(`${connection.name}.json`));
|
|
64
|
+
logger_1.default.info(`Writing ${connectionFile}`);
|
|
65
|
+
(0, utils_1.dumpJSON)(connectionFile, connection);
|
|
66
|
+
});
|
|
75
67
|
}
|
|
76
68
|
const flowVaultsHandler = {
|
|
77
69
|
parse,
|
|
78
70
|
dump,
|
|
79
71
|
};
|
|
80
72
|
exports.default = flowVaultsHandler;
|
|
81
|
-
//# sourceMappingURL=flowVaultConnections.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -23,53 +14,53 @@ function parse(context) {
|
|
|
23
14
|
return { flows: null }; // Skip
|
|
24
15
|
const files = (0, utils_1.getFiles)(flowsFolder, ['.json']);
|
|
25
16
|
const flows = files.map((f) => {
|
|
26
|
-
const flow =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const flow = {
|
|
18
|
+
...(0, utils_1.loadJSON)(f, {
|
|
19
|
+
mappings: context.mappings,
|
|
20
|
+
disableKeywordReplacement: context.disableKeywordReplacement,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
30
23
|
return flow;
|
|
31
24
|
});
|
|
32
25
|
return {
|
|
33
26
|
flows,
|
|
34
27
|
};
|
|
35
28
|
}
|
|
36
|
-
function dump(context) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
29
|
+
async function dump(context) {
|
|
30
|
+
const { flows } = context.assets;
|
|
31
|
+
if (!flows)
|
|
32
|
+
return; // Skip, nothing to dump
|
|
33
|
+
const flowsFolder = path_1.default.join(context.filePath, tools_1.constants.FLOWS_DIRECTORY);
|
|
34
|
+
fs_extra_1.default.ensureDirSync(flowsFolder);
|
|
35
|
+
// Check if there is any duplicate flow name
|
|
36
|
+
const flowNameSet = new Set();
|
|
37
|
+
const duplicateFlowNames = new Set();
|
|
38
|
+
flows.forEach((flow) => {
|
|
39
|
+
if (flowNameSet.has(flow.name)) {
|
|
40
|
+
duplicateFlowNames.add(flow.name);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
flowNameSet.add(flow.name);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
if (duplicateFlowNames.size > 0) {
|
|
47
|
+
const duplicateNamesArray = Array.from(duplicateFlowNames).join(', ');
|
|
48
|
+
logger_1.default.error(`Duplicate flow names found: [${duplicateNamesArray}] , make sure to rename them to avoid conflicts`);
|
|
49
|
+
throw new Error(`Duplicate flow names found: ${duplicateNamesArray}`);
|
|
50
|
+
}
|
|
51
|
+
flows.forEach((flow) => {
|
|
52
|
+
if (flow.name === undefined) {
|
|
53
|
+
return;
|
|
58
54
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
const flowFile = path_1.default.join(flowsFolder, (0, utils_1.sanitize)(`${flow.name}.json`));
|
|
56
|
+
logger_1.default.info(`Writing ${flowFile}`);
|
|
57
|
+
const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'submitted_at', 'embedded_at'];
|
|
58
|
+
removeKeysFromOutput.forEach((key) => {
|
|
59
|
+
if (key in flow) {
|
|
60
|
+
delete flow[key];
|
|
62
61
|
}
|
|
63
|
-
const flowFile = path_1.default.join(flowsFolder, (0, utils_1.sanitize)(`${flow.name}.json`));
|
|
64
|
-
logger_1.default.info(`Writing ${flowFile}`);
|
|
65
|
-
const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'submitted_at', 'embedded_at'];
|
|
66
|
-
removeKeysFromOutput.forEach((key) => {
|
|
67
|
-
if (key in flow) {
|
|
68
|
-
delete flow[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
(0, utils_1.dumpJSON)(flowFile, flow);
|
|
72
62
|
});
|
|
63
|
+
(0, utils_1.dumpJSON)(flowFile, flow);
|
|
73
64
|
});
|
|
74
65
|
}
|
|
75
66
|
const flowsHandler = {
|
|
@@ -77,4 +68,3 @@ const flowsHandler = {
|
|
|
77
68
|
dump,
|
|
78
69
|
};
|
|
79
70
|
exports.default = flowsHandler;
|
|
80
|
-
//# sourceMappingURL=flows.js.map
|