auth0-deploy-cli 8.22.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 +31 -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 +17 -16
- package/lib/tools/auth0/handlers/clients.js +120 -106
- 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 -2
- package/lib/tools/auth0/handlers/resourceServers.js +94 -105
- 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 +13 -5
- package/lib/types.js +0 -1
- package/lib/utils.d.ts +3 -58
- package/lib/utils.js +8 -5
- package/package.json +11 -10
- 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,27 +1,15 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function parseAndDump(context) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
});
|
|
3
|
+
async function parseAndDump(context) {
|
|
4
|
+
const { themes } = context.assets;
|
|
5
|
+
if (!themes)
|
|
6
|
+
return { themes: null };
|
|
7
|
+
return {
|
|
8
|
+
themes,
|
|
9
|
+
};
|
|
21
10
|
}
|
|
22
11
|
const themesHandler = {
|
|
23
12
|
parse: parseAndDump,
|
|
24
13
|
dump: parseAndDump,
|
|
25
14
|
};
|
|
26
15
|
exports.default = themesHandler;
|
|
27
|
-
//# sourceMappingURL=themes.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
async function parse(context) {
|
|
4
|
+
const { tokenExchangeProfiles } = context.assets;
|
|
5
|
+
if (!tokenExchangeProfiles)
|
|
6
|
+
return { tokenExchangeProfiles: null };
|
|
7
|
+
return {
|
|
8
|
+
tokenExchangeProfiles,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
async function dump(context) {
|
|
12
|
+
const { tokenExchangeProfiles } = context.assets;
|
|
13
|
+
if (!tokenExchangeProfiles)
|
|
14
|
+
return { tokenExchangeProfiles: null };
|
|
15
|
+
return {
|
|
16
|
+
tokenExchangeProfiles: tokenExchangeProfiles.map((profile) => {
|
|
17
|
+
// Strip server-generated fields
|
|
18
|
+
const { id, created_at, updated_at, ...cleanProfile } = profile;
|
|
19
|
+
return cleanProfile;
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const handler = {
|
|
24
|
+
parse,
|
|
25
|
+
dump,
|
|
26
|
+
};
|
|
27
|
+
exports.default = handler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
2
|
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
-
type ParsedTriggers = ParsedAsset<'triggers', Asset
|
|
3
|
+
type ParsedTriggers = ParsedAsset<'triggers', Asset>;
|
|
4
4
|
declare const triggersHandler: YAMLHandler<ParsedTriggers>;
|
|
5
5
|
export default triggersHandler;
|
|
@@ -1,38 +1,24 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function parse(context) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
});
|
|
3
|
+
async function parse(context) {
|
|
4
|
+
// Load the script file for each action
|
|
5
|
+
if (!context.assets.triggers)
|
|
6
|
+
return { triggers: null };
|
|
7
|
+
return {
|
|
8
|
+
triggers: context.assets.triggers,
|
|
9
|
+
};
|
|
21
10
|
}
|
|
22
|
-
function dump(context) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
});
|
|
11
|
+
async function dump(context) {
|
|
12
|
+
const { triggers } = context.assets;
|
|
13
|
+
// Nothing to do
|
|
14
|
+
if (!triggers)
|
|
15
|
+
return { triggers: null };
|
|
16
|
+
return {
|
|
17
|
+
triggers: triggers,
|
|
18
|
+
};
|
|
32
19
|
}
|
|
33
20
|
const triggersHandler = {
|
|
34
21
|
parse,
|
|
35
22
|
dump,
|
|
36
23
|
};
|
|
37
24
|
exports.default = triggersHandler;
|
|
38
|
-
//# sourceMappingURL=triggers.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UserAttributeProfile } from 'auth0';
|
|
2
1
|
import { YAMLHandler } from '.';
|
|
2
|
+
import { UserAttributeProfile } from '../../../tools/auth0/handlers/userAttributeProfiles';
|
|
3
3
|
import { ParsedAsset } from '../../../types';
|
|
4
4
|
type ParsedUserAttributeProfiles = ParsedAsset<'userAttributeProfiles', Partial<UserAttributeProfile>[]>;
|
|
5
5
|
declare const selfServiceProfileHandler: YAMLHandler<ParsedUserAttributeProfiles>;
|
|
@@ -1,27 +1,15 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function parseAndDump(context) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
});
|
|
3
|
+
async function parseAndDump(context) {
|
|
4
|
+
const { userAttributeProfiles } = context.assets;
|
|
5
|
+
if (!userAttributeProfiles)
|
|
6
|
+
return { userAttributeProfiles: null };
|
|
7
|
+
return {
|
|
8
|
+
userAttributeProfiles,
|
|
9
|
+
};
|
|
21
10
|
}
|
|
22
11
|
const selfServiceProfileHandler = {
|
|
23
12
|
parse: parseAndDump,
|
|
24
13
|
dump: parseAndDump,
|
|
25
14
|
};
|
|
26
15
|
exports.default = selfServiceProfileHandler;
|
|
27
|
-
//# sourceMappingURL=userAttributeProfiles.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
|
};
|
|
@@ -59,136 +50,137 @@ class YAMLContext {
|
|
|
59
50
|
disableKeywordReplacement: this.disableKeywordReplacement,
|
|
60
51
|
});
|
|
61
52
|
}
|
|
62
|
-
loadAssetsFromLocal() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
async loadAssetsFromLocal(opts = { disableKeywordReplacement: false }) {
|
|
54
|
+
// Allow to send object/json directly
|
|
55
|
+
this.disableKeywordReplacement = opts.disableKeywordReplacement;
|
|
56
|
+
if (typeof this.configFile === 'object') {
|
|
57
|
+
this.assets = this.configFile;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
try {
|
|
61
|
+
const fPath = path_1.default.resolve(this.configFile);
|
|
62
|
+
logger_1.default.debug(`Loading YAML from ${fPath}`);
|
|
63
|
+
Object.assign(this.assets, js_yaml_1.default.load(opts.disableKeywordReplacement
|
|
64
|
+
? (0, tools_1.wrapArrayReplaceMarkersInQuotes)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)
|
|
65
|
+
: (0, tools_1.keywordReplace)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)) || {});
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
logger_1.default.debug(`Loading YAML from ${fPath}`);
|
|
73
|
-
Object.assign(this.assets, js_yaml_1.default.load(opts.disableKeywordReplacement
|
|
74
|
-
? (0, tools_1.wrapArrayReplaceMarkersInQuotes)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)
|
|
75
|
-
: (0, tools_1.keywordReplace)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)) || {});
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
logger_1.default.debug(err.stack);
|
|
79
|
-
throw new Error(`Problem loading ${this.configFile}\n${err}`);
|
|
80
|
-
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
logger_1.default.debug(err.stack);
|
|
69
|
+
throw new Error(`Problem loading ${this.configFile}\n${err}`);
|
|
81
70
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
}
|
|
72
|
+
this.assets = Object.keys(this.assets).reduce((acc, key) => {
|
|
73
|
+
const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
|
|
74
|
+
if (excludedAssetTypes.includes(key))
|
|
75
|
+
return acc;
|
|
76
|
+
return {
|
|
77
|
+
...acc,
|
|
78
|
+
[key]: this.assets[key],
|
|
90
79
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
80
|
+
}, {});
|
|
81
|
+
const initialAssets = {
|
|
82
|
+
exclude: this.assets.exclude, // Keep the exclude rules in result assets
|
|
83
|
+
};
|
|
84
|
+
this.assets = Object.keys(this.assets).reduce((acc, key) => {
|
|
85
|
+
// Get the list of asset types to include
|
|
86
|
+
const includedAssetTypes = this.config.AUTH0_INCLUDED_ONLY;
|
|
87
|
+
// If includedAssetTypes is defined and this asset type (key) is not in the list, exclude it
|
|
88
|
+
if (includedAssetTypes !== undefined && !includedAssetTypes.includes(key))
|
|
89
|
+
return acc;
|
|
90
|
+
// Otherwise, include the asset type in the result
|
|
91
|
+
return {
|
|
92
|
+
...acc,
|
|
93
|
+
[key]: this.assets[key],
|
|
94
|
+
};
|
|
95
|
+
}, initialAssets);
|
|
96
|
+
// Run initial schema check to ensure valid YAML
|
|
97
|
+
const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
|
|
98
|
+
if (!opts.disableKeywordReplacement) {
|
|
99
|
+
// The schema validation needs to be disabled during keyword-preserved export because a field may be enforced as an array but will be expressed with an array replace marker (string).
|
|
100
|
+
await auth0.validate();
|
|
101
|
+
}
|
|
102
|
+
// Allow handlers to process the assets such as loading files etc
|
|
103
|
+
await Promise.all(Object.entries(handlers_1.default).map(async ([name, handler]) => {
|
|
104
|
+
try {
|
|
105
|
+
const parsed = await handler.parse(this);
|
|
106
|
+
Object.entries(parsed).forEach(([k, v]) => {
|
|
107
|
+
this.assets[k] = v;
|
|
108
|
+
});
|
|
105
109
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
this.assets[k] = v;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
catch (err) {
|
|
115
|
-
logger_1.default.debug(err.stack);
|
|
116
|
-
throw new Error(`Problem deploying ${name}, ${err}`);
|
|
117
|
-
}
|
|
118
|
-
})));
|
|
119
|
-
});
|
|
110
|
+
catch (err) {
|
|
111
|
+
logger_1.default.debug(err.stack);
|
|
112
|
+
throw new Error(`Problem deploying ${name}, ${err}`);
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
120
115
|
}
|
|
121
|
-
dump() {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
async dump() {
|
|
117
|
+
const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
|
|
118
|
+
logger_1.default.info('Loading Auth0 Tenant Data');
|
|
119
|
+
try {
|
|
120
|
+
await auth0.loadAssetsFromAuth0();
|
|
121
|
+
const shouldPreserveKeywords =
|
|
122
|
+
//@ts-ignore because the string=>boolean conversion may not have happened if passed-in as env var
|
|
123
|
+
this.config.AUTH0_PRESERVE_KEYWORDS === 'true' ||
|
|
124
|
+
this.config.AUTH0_PRESERVE_KEYWORDS === true;
|
|
125
|
+
if (shouldPreserveKeywords) {
|
|
126
|
+
await this.loadAssetsFromLocal({ disableKeywordReplacement: true }); //Need to disable keyword replacement to retrieve the raw keyword markers (ex: ##KEYWORD##)
|
|
127
|
+
const localAssets = { ...this.assets };
|
|
128
|
+
//@ts-ignore
|
|
129
|
+
delete this['assets'];
|
|
130
|
+
this.assets = (0, keywordPreservation_1.preserveKeywords)({
|
|
131
|
+
localAssets,
|
|
132
|
+
remoteAssets: auth0.assets,
|
|
133
|
+
keywordMappings: this.config.AUTH0_KEYWORD_REPLACE_MAPPINGS || {},
|
|
134
|
+
auth0Handlers: auth0.handlers,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.assets = auth0.assets;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
const docUrl = 'https://auth0.com/docs/deploy/deploy-cli-tool/create-and-configure-the-deploy-cli-application#modify-deploy-cli-application-scopes';
|
|
143
|
+
const extraMessage = err.message.startsWith('Insufficient scope')
|
|
144
|
+
? `\nSee ${docUrl} for more information`
|
|
145
|
+
: '';
|
|
146
|
+
throw new Error(`Problem loading tenant data from Auth0 ${err}${extraMessage}`);
|
|
147
|
+
}
|
|
148
|
+
await Promise.all(Object.entries(handlers_1.default)
|
|
149
|
+
.filter(([handlerName]) => {
|
|
150
|
+
const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
|
|
151
|
+
return !excludedAssetTypes.includes(handlerName);
|
|
152
|
+
})
|
|
153
|
+
.filter((0, __1.filterOnlyIncludedResourceTypes)(this.config.AUTH0_INCLUDED_ONLY))
|
|
154
|
+
.map(async ([name, handler]) => {
|
|
125
155
|
try {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
//@ts-ignore
|
|
135
|
-
delete this['assets'];
|
|
136
|
-
this.assets = (0, keywordPreservation_1.preserveKeywords)({
|
|
137
|
-
localAssets,
|
|
138
|
-
remoteAssets: auth0.assets,
|
|
139
|
-
keywordMappings: this.config.AUTH0_KEYWORD_REPLACE_MAPPINGS || {},
|
|
140
|
-
auth0Handlers: auth0.handlers,
|
|
156
|
+
const data = await handler.dump(this);
|
|
157
|
+
if (data) {
|
|
158
|
+
if (data[name] !== null)
|
|
159
|
+
logger_1.default.info(`Exporting ${name}`);
|
|
160
|
+
Object.entries(data).forEach(([k, v]) => {
|
|
161
|
+
this.assets[k] = Array.isArray(v)
|
|
162
|
+
? v.map(utils_1.formatResults).sort(utils_1.recordsSorter)
|
|
163
|
+
: (0, utils_1.formatResults)(v);
|
|
141
164
|
});
|
|
142
165
|
}
|
|
143
|
-
else {
|
|
144
|
-
this.assets = auth0.assets;
|
|
145
|
-
}
|
|
146
166
|
}
|
|
147
167
|
catch (err) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
? `\nSee ${docUrl} for more information`
|
|
151
|
-
: '';
|
|
152
|
-
throw new Error(`Problem loading tenant data from Auth0 ${err}${extraMessage}`);
|
|
168
|
+
logger_1.default.debug(err.stack);
|
|
169
|
+
throw new Error(`Problem exporting ${name}`);
|
|
153
170
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.assets[k] = Array.isArray(v)
|
|
168
|
-
? v.map(utils_1.formatResults).sort(utils_1.recordsSorter)
|
|
169
|
-
: (0, utils_1.formatResults)(v);
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
catch (err) {
|
|
174
|
-
logger_1.default.debug(err.stack);
|
|
175
|
-
throw new Error(`Problem exporting ${name}`);
|
|
176
|
-
}
|
|
177
|
-
})));
|
|
178
|
-
// Clean known read only fields
|
|
179
|
-
let cleaned = (0, readonly_1.default)(this.assets, this.config);
|
|
180
|
-
// Delete exclude as it's not part of the auth0 tenant config
|
|
181
|
-
delete cleaned.exclude;
|
|
182
|
-
// Optionally Strip identifiers
|
|
183
|
-
if (!this.config.AUTH0_EXPORT_IDENTIFIERS) {
|
|
184
|
-
cleaned = (0, utils_1.stripIdentifiers)(auth0, cleaned);
|
|
185
|
-
}
|
|
186
|
-
// Write YAML File
|
|
187
|
-
const raw = js_yaml_1.default.dump(cleaned);
|
|
188
|
-
logger_1.default.info(`Writing ${this.configFile}`);
|
|
189
|
-
fs_extra_1.default.writeFileSync(this.configFile, raw);
|
|
190
|
-
});
|
|
171
|
+
}));
|
|
172
|
+
// Clean known read only fields
|
|
173
|
+
let cleaned = (0, readonly_1.default)(this.assets, this.config);
|
|
174
|
+
// Delete exclude as it's not part of the auth0 tenant config
|
|
175
|
+
delete cleaned.exclude;
|
|
176
|
+
// Optionally Strip identifiers
|
|
177
|
+
if (!this.config.AUTH0_EXPORT_IDENTIFIERS) {
|
|
178
|
+
cleaned = (0, utils_1.stripIdentifiers)(auth0, cleaned);
|
|
179
|
+
}
|
|
180
|
+
// Write YAML File
|
|
181
|
+
const raw = js_yaml_1.default.dump(cleaned);
|
|
182
|
+
logger_1.default.info(`Writing ${this.configFile}`);
|
|
183
|
+
fs_extra_1.default.writeFileSync(this.configFile, raw);
|
|
191
184
|
}
|
|
192
185
|
}
|
|
193
186
|
exports.default = YAMLContext;
|
|
194
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,106 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import tools from './tools';
|
|
2
3
|
import importCMD from './commands/import';
|
|
3
4
|
import exportCMD from './commands/export';
|
|
4
|
-
declare const
|
|
5
|
+
declare const cliCommands: {
|
|
5
6
|
deploy: typeof importCMD;
|
|
6
7
|
dump: typeof exportCMD;
|
|
7
8
|
import: typeof importCMD;
|
|
8
9
|
export: typeof exportCMD;
|
|
9
|
-
tools:
|
|
10
|
-
constants: {
|
|
11
|
-
CONCURRENT_CALLS: number;
|
|
12
|
-
RULES_DIRECTORY: string;
|
|
13
|
-
RULES_STAGES: string[];
|
|
14
|
-
DEFAULT_RULE_STAGE: string;
|
|
15
|
-
HOOKS_HIDDEN_SECRET_VALUE: string;
|
|
16
|
-
OBFUSCATED_SECRET_VALUE: string;
|
|
17
|
-
HOOKS_DIRECTORY: string;
|
|
18
|
-
ACTIONS_DIRECTORY: string;
|
|
19
|
-
TRIGGERS_DIRECTORY: string;
|
|
20
|
-
RULES_CONFIGS_DIRECTORY: string;
|
|
21
|
-
PAGES_DIRECTORY: string;
|
|
22
|
-
PAGE_LOGIN: string;
|
|
23
|
-
PAGE_GUARDIAN_MULTIFACTOR: string;
|
|
24
|
-
PAGE_PASSWORD_RESET: string;
|
|
25
|
-
PAGE_ERROR: string;
|
|
26
|
-
DATABASE_CONNECTIONS_DIRECTORY: string;
|
|
27
|
-
DATABASE_SCRIPTS_CHANGE_EMAIL: string;
|
|
28
|
-
DATABASE_SCRIPTS_GET_USER: string;
|
|
29
|
-
EMAIL_TEMPLATES_TYPES: import("auth0").GetEmailTemplatesByTemplateNameTemplateNameEnum[];
|
|
30
|
-
ACTIONS_TRIGGERS: string[];
|
|
31
|
-
EMAIL_TEMPLATES_DIRECTORY: string;
|
|
32
|
-
EMAIL_VERIFY: string;
|
|
33
|
-
EMAIL_VERIFY_BY_CODE: string;
|
|
34
|
-
EMAIL_RESET: string;
|
|
35
|
-
EMAIL_RESET_BY_CODE: string;
|
|
36
|
-
EMAIL_WELCOME: string;
|
|
37
|
-
EMAIL_BLOCKED: string;
|
|
38
|
-
EMAIL_STOLEN_CREDENTIALS: string;
|
|
39
|
-
EMAIL_ENROLLMENT: string;
|
|
40
|
-
EMAIL_CHANGE_PASSWORD: string;
|
|
41
|
-
EMAIL_PASSWORD_RESET: string;
|
|
42
|
-
EMAIL_MFA_OOB_CODE: string;
|
|
43
|
-
EMAIL_USER_INVITATION: string;
|
|
44
|
-
EMAIL_ASYNC_APPROVAL: string;
|
|
45
|
-
GUARDIAN_DIRECTORY: string;
|
|
46
|
-
GUARDIAN_FACTORS_DIRECTORY: string;
|
|
47
|
-
GUARDIAN_PROVIDERS_DIRECTORY: string;
|
|
48
|
-
GUARDIAN_TEMPLATES_DIRECTORY: string;
|
|
49
|
-
UNIVERSAL_LOGIN_TEMPLATE: string;
|
|
50
|
-
RESOURCE_SERVERS_DIRECTORY: string;
|
|
51
|
-
RESOURCE_SERVERS_CLIENT_NAME: string;
|
|
52
|
-
RESOURCE_SERVERS_MANAGEMENT_API_NAME: string;
|
|
53
|
-
RESOURCE_SERVERS_ID_NAME: string;
|
|
54
|
-
CLIENTS_DIRECTORY: string;
|
|
55
|
-
CLIENTS_GRANTS_DIRECTORY: string;
|
|
56
|
-
BRANDING_DIRECTORY: string;
|
|
57
|
-
PHONE_PROVIDER_DIRECTORY: string;
|
|
58
|
-
BRANDING_TEMPLATES_DIRECTORY: string;
|
|
59
|
-
BRANDING_TEMPLATES_YAML_DIRECTORY: string;
|
|
60
|
-
CLIENTS_CLIENT_NAME: string;
|
|
61
|
-
CLIENTS_CLIENT_ID_NAME: string;
|
|
62
|
-
CONNECTIONS_DIRECTORY: string;
|
|
63
|
-
CONNECTIONS_CLIENT_NAME: string;
|
|
64
|
-
CONNECTIONS_ID_NAME: string;
|
|
65
|
-
ROLES_DIRECTORY: string;
|
|
66
|
-
ATTACK_PROTECTION_DIRECTORY: string;
|
|
67
|
-
GUARDIAN_FACTORS: string[];
|
|
68
|
-
GUARDIAN_POLICIES: string[];
|
|
69
|
-
GUARDIAN_PHONE_PROVIDERS: string[];
|
|
70
|
-
GUARDIAN_PHONE_MESSAGE_TYPES: string[];
|
|
71
|
-
GUARDIAN_FACTOR_TEMPLATES: string[];
|
|
72
|
-
GUARDIAN_FACTOR_PROVIDERS: {
|
|
73
|
-
sms: string[];
|
|
74
|
-
'push-notification': string[];
|
|
75
|
-
};
|
|
76
|
-
PAGE_NAMES: string[];
|
|
77
|
-
DATABASE_SCRIPTS: string[];
|
|
78
|
-
DATABASE_SCRIPTS_NO_IMPORT: string[];
|
|
79
|
-
DATABASE_SCRIPTS_IMPORT: string[];
|
|
80
|
-
EMAIL_TEMPLATES_NAMES: string[];
|
|
81
|
-
SUPPORTED_BRANDING_TEMPLATES: string[];
|
|
82
|
-
LOG_STREAMS_DIRECTORY: string;
|
|
83
|
-
PROMPTS_DIRECTORY: string;
|
|
84
|
-
PROMPTS_SCREEN_RENDER_DIRECTORY: string;
|
|
85
|
-
PARTIALS_DIRECTORY: string;
|
|
86
|
-
CUSTOM_DOMAINS_DIRECTORY: string;
|
|
87
|
-
THEMES_DIRECTORY: string;
|
|
88
|
-
CONNECTION_APP_ID: string[];
|
|
89
|
-
FORMS_DIRECTORY: string;
|
|
90
|
-
FLOWS_DIRECTORY: string;
|
|
91
|
-
FLOWS_VAULT_DIRECTORY: string;
|
|
92
|
-
SELF_SERVICE_PROFILE_DIRECTORY: string;
|
|
93
|
-
NETWORK_ACLS_DIRECTORY: string;
|
|
94
|
-
USER_ATTRIBUTE_PROFILES_DIRECTORY: string;
|
|
95
|
-
CONNECTION_PROFILES_DIRECTORY: string;
|
|
96
|
-
};
|
|
97
|
-
deploy: typeof import("./tools").deploy;
|
|
98
|
-
keywordReplace: typeof import("./tools").keywordReplace;
|
|
99
|
-
loadFileAndReplaceKeywords: typeof import("./tools").loadFileAndReplaceKeywords;
|
|
100
|
-
wrapArrayReplaceMarkersInQuotes: typeof import("./tools").wrapArrayReplaceMarkersInQuotes;
|
|
101
|
-
Auth0: typeof import("./tools").Auth0;
|
|
102
|
-
};
|
|
10
|
+
tools: typeof tools;
|
|
103
11
|
};
|
|
104
|
-
export default
|
|
12
|
+
export default cliCommands;
|
|
105
13
|
export declare const dump: typeof exportCMD;
|
|
106
14
|
export declare const deploy: typeof importCMD;
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
5
|
};
|
|
@@ -21,30 +12,28 @@ const logger_1 = __importDefault(require("./logger"));
|
|
|
21
12
|
const tools_1 = __importDefault(require("./tools"));
|
|
22
13
|
const import_1 = __importDefault(require("./commands/import"));
|
|
23
14
|
const export_1 = __importDefault(require("./commands/export"));
|
|
24
|
-
function run(params) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
throw new Error('The --proxy_url option is only supported on Node >= 10');
|
|
33
|
-
}
|
|
34
|
-
process.env.HTTP_PROXY = proxy;
|
|
35
|
-
logger_1.default.debug(`Setting proxy to ${proxy}`);
|
|
36
|
-
// moving from `global-agent` to undici due to update on SDK 4.x.x
|
|
37
|
-
(0, undici_1.setGlobalDispatcher)(new undici_1.ProxyAgent(process.env.HTTP_PROXY));
|
|
38
|
-
}
|
|
39
|
-
logger_1.default.debug(`Start command ${command}`);
|
|
40
|
-
if (['deploy', 'import'].includes(command) && 'input_file' in params) {
|
|
41
|
-
yield (0, import_1.default)(params);
|
|
42
|
-
}
|
|
43
|
-
if (['dump', 'export'].includes(command) && 'output_folder' in params) {
|
|
44
|
-
yield (0, export_1.default)(params);
|
|
15
|
+
async function run(params) {
|
|
16
|
+
// Run command
|
|
17
|
+
const command = params._[0];
|
|
18
|
+
const proxy = params.proxy_url;
|
|
19
|
+
if (proxy) {
|
|
20
|
+
const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10);
|
|
21
|
+
if (MAJOR_NODEJS_VERSION < 10) {
|
|
22
|
+
throw new Error('The --proxy_url option is only supported on Node >= 10');
|
|
45
23
|
}
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
process.env.HTTP_PROXY = proxy;
|
|
25
|
+
logger_1.default.debug(`Setting proxy to ${proxy}`);
|
|
26
|
+
// moving from `global-agent` to undici due to update on SDK 4.x.x
|
|
27
|
+
(0, undici_1.setGlobalDispatcher)(new undici_1.ProxyAgent(process.env.HTTP_PROXY));
|
|
28
|
+
}
|
|
29
|
+
logger_1.default.debug(`Start command ${command}`);
|
|
30
|
+
if (['deploy', 'import'].includes(command) && 'input_file' in params) {
|
|
31
|
+
await (0, import_1.default)(params);
|
|
32
|
+
}
|
|
33
|
+
if (['dump', 'export'].includes(command) && 'output_folder' in params) {
|
|
34
|
+
await (0, export_1.default)(params);
|
|
35
|
+
}
|
|
36
|
+
logger_1.default.debug(`Finished command ${command}`);
|
|
48
37
|
}
|
|
49
38
|
// Only run if from command line
|
|
50
39
|
if (require.main === module) {
|
|
@@ -79,13 +68,14 @@ if (require.main === module) {
|
|
|
79
68
|
});
|
|
80
69
|
}
|
|
81
70
|
// Export commands to be used programmatically
|
|
82
|
-
|
|
71
|
+
// Explicit type to avoid non-portable type inference
|
|
72
|
+
const cliCommands = {
|
|
83
73
|
deploy: import_1.default,
|
|
84
74
|
dump: export_1.default,
|
|
85
75
|
import: import_1.default,
|
|
86
76
|
export: export_1.default,
|
|
87
77
|
tools: tools_1.default,
|
|
88
78
|
};
|
|
79
|
+
exports.default = cliCommands;
|
|
89
80
|
exports.dump = export_1.default;
|
|
90
81
|
exports.deploy = import_1.default;
|
|
91
|
-
//# sourceMappingURL=index.js.map
|