auth0-deploy-cli 8.20.2 → 8.20.4-beta.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 +46 -5
- package/CHANGELOG.md +17 -1
- package/eslint.config.js +130 -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.js +38 -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 +17 -29
- 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 +39 -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 +0 -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/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/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 +41 -55
- 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 +36 -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 +0 -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/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/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 -95
- package/lib/index.js +24 -34
- package/lib/keywordPreservation.d.ts +1 -1
- package/lib/keywordPreservation.js +10 -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 +111 -120
- 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 -8
- package/lib/tools/auth0/handlers/clientGrants.js +65 -70
- package/lib/tools/auth0/handlers/clients.d.ts +3 -9
- package/lib/tools/auth0/handlers/clients.js +59 -63
- 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.js +49 -71
- 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 +0 -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/prompts.d.ts +5 -5
- package/lib/tools/auth0/handlers/prompts.js +242 -249
- package/lib/tools/auth0/handlers/resourceServers.d.ts +3 -1
- package/lib/tools/auth0/handlers/resourceServers.js +59 -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 +11 -3
- package/lib/tools/auth0/handlers/selfServiceProfiles.js +170 -208
- package/lib/tools/auth0/handlers/tenant.d.ts +5 -3
- package/lib/tools/auth0/handlers/tenant.js +45 -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/triggers.js +59 -75
- package/lib/tools/auth0/handlers/userAttributeProfiles.d.ts +3 -2
- package/lib/tools/auth0/handlers/userAttributeProfiles.js +54 -56
- 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 +2 -2
- package/lib/tools/constants.js +0 -1
- package/lib/tools/deploy.js +17 -29
- package/lib/tools/index.d.ts +3 -88
- 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 +8 -4
- package/lib/types.js +0 -1
- package/lib/utils.d.ts +3 -57
- package/lib/utils.js +8 -5
- package/package.json +12 -11
- 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/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/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/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
|
@@ -38,15 +38,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
})();
|
|
41
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
41
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
43
|
};
|
|
@@ -58,6 +49,7 @@ const default_1 = __importStar(require("./default"));
|
|
|
58
49
|
const client_1 = require("../client");
|
|
59
50
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
60
51
|
const utils_1 = require("../../../utils");
|
|
52
|
+
const flowVaultConnections_1 = require("./flowVaultConnections");
|
|
61
53
|
exports.schema = {
|
|
62
54
|
type: 'array',
|
|
63
55
|
items: {
|
|
@@ -72,143 +64,114 @@ exports.schema = {
|
|
|
72
64
|
};
|
|
73
65
|
class FlowHandler extends default_1.default {
|
|
74
66
|
constructor(options) {
|
|
75
|
-
super(
|
|
67
|
+
super({
|
|
68
|
+
...options,
|
|
69
|
+
type: 'flows',
|
|
70
|
+
id: 'id',
|
|
71
|
+
stripCreateFields: ['created_at', 'updated_at', 'executed_at'],
|
|
72
|
+
stripUpdateFields: ['created_at', 'updated_at', 'executed_at'],
|
|
73
|
+
functions: {
|
|
74
|
+
update: async ({ id }, bodyParams) => this.client.flows.update(id, bodyParams),
|
|
75
|
+
},
|
|
76
|
+
});
|
|
76
77
|
}
|
|
77
78
|
objString(item) {
|
|
78
79
|
return super.objString({ id: item.id, name: item.name });
|
|
79
80
|
}
|
|
80
|
-
getFlows(flows) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return allFlows.filter((flow) => flow !== null);
|
|
93
|
-
});
|
|
81
|
+
async getFlows(flows) {
|
|
82
|
+
const allFlows = await this.client.pool
|
|
83
|
+
.addEachTask({
|
|
84
|
+
data: flows,
|
|
85
|
+
generator: ({ id }) => this.client.flows.get(id).then((response) => {
|
|
86
|
+
if ((0, lodash_1.isEmpty)(response))
|
|
87
|
+
return null;
|
|
88
|
+
return response;
|
|
89
|
+
}),
|
|
90
|
+
})
|
|
91
|
+
.promise();
|
|
92
|
+
return allFlows.filter((flow) => flow !== null);
|
|
94
93
|
}
|
|
95
|
-
getType() {
|
|
96
|
-
|
|
97
|
-
if (this.existing) {
|
|
98
|
-
return this.existing;
|
|
99
|
-
}
|
|
100
|
-
const [flows, allFlowConnections] = yield Promise.all([
|
|
101
|
-
(0, client_1.paginate)(this.client.flows.getAll, {
|
|
102
|
-
paginate: true,
|
|
103
|
-
include_totals: true,
|
|
104
|
-
}),
|
|
105
|
-
this.getAllFlowConnections(),
|
|
106
|
-
]);
|
|
107
|
-
// get more details for each flows
|
|
108
|
-
const allFlows = yield this.getFlows(flows);
|
|
109
|
-
// create a map for id to name from allFlowConnections
|
|
110
|
-
const connectionIdMap = {};
|
|
111
|
-
allFlowConnections.forEach((c) => {
|
|
112
|
-
connectionIdMap[c.id] = c.name;
|
|
113
|
-
});
|
|
114
|
-
this.existing = yield this.formateFlowConnectionId(allFlows, connectionIdMap);
|
|
94
|
+
async getType() {
|
|
95
|
+
if (this.existing) {
|
|
115
96
|
return this.existing;
|
|
97
|
+
}
|
|
98
|
+
const [flows, allFlowConnections] = await Promise.all([
|
|
99
|
+
(0, client_1.paginate)(this.client.flows.list, {
|
|
100
|
+
paginate: true,
|
|
101
|
+
}),
|
|
102
|
+
(0, flowVaultConnections_1.getAllFlowConnections)(this.client),
|
|
103
|
+
]);
|
|
104
|
+
// get more details for each flows
|
|
105
|
+
const allFlows = await this.getFlows(flows);
|
|
106
|
+
// create a map for id to name from allFlowConnections
|
|
107
|
+
const connectionIdMap = {};
|
|
108
|
+
allFlowConnections.forEach((c) => {
|
|
109
|
+
connectionIdMap[c.id] = c.name;
|
|
116
110
|
});
|
|
111
|
+
this.existing = await this.formateFlowConnectionId(allFlows, connectionIdMap);
|
|
112
|
+
return this.existing;
|
|
117
113
|
}
|
|
118
|
-
processChanges(assets) {
|
|
119
|
-
const
|
|
120
|
-
|
|
114
|
+
async processChanges(assets) {
|
|
115
|
+
const { flows } = assets;
|
|
116
|
+
// Do nothing if not set
|
|
117
|
+
if (!flows)
|
|
118
|
+
return;
|
|
119
|
+
const allFlowConnections = await (0, flowVaultConnections_1.getAllFlowConnections)(this.client);
|
|
120
|
+
// create a map for name to id from allFlowConnections
|
|
121
|
+
const connectionNameMap = {};
|
|
122
|
+
allFlowConnections.forEach((c) => {
|
|
123
|
+
connectionNameMap[c.name] = c.id;
|
|
121
124
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
133
|
-
assets.flows = yield this.pargeFlowConnectionName(flows, connectionNameMap);
|
|
134
|
-
const { del, update, create, conflicts } = yield this.calcChanges(assets);
|
|
135
|
-
const changes = {
|
|
136
|
-
del: del,
|
|
137
|
-
update: update,
|
|
138
|
-
create: create,
|
|
139
|
-
conflicts: conflicts,
|
|
140
|
-
};
|
|
141
|
-
yield _super.processChanges.call(this, assets, Object.assign({}, changes));
|
|
125
|
+
assets.flows = await this.pargeFlowConnectionName(flows, connectionNameMap);
|
|
126
|
+
const { del, update, create, conflicts } = await this.calcChanges(assets);
|
|
127
|
+
const changes = {
|
|
128
|
+
del: del,
|
|
129
|
+
update: update,
|
|
130
|
+
create: create,
|
|
131
|
+
conflicts: conflicts,
|
|
132
|
+
};
|
|
133
|
+
await super.processChanges(assets, {
|
|
134
|
+
...changes,
|
|
142
135
|
});
|
|
143
136
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
per_page: 100,
|
|
154
|
-
include_totals: true,
|
|
155
|
-
});
|
|
156
|
-
// if we get an unexpected response, break the loop to avoid infinite loop
|
|
157
|
-
if (!(0, lodash_1.isArray)(allFlowConnections) || typeof total !== 'number') {
|
|
158
|
-
break;
|
|
137
|
+
async formateFlowConnectionId(flows, connectionIdMap) {
|
|
138
|
+
// replace connection_id with flow connection names
|
|
139
|
+
await Promise.all(flows.map(async (flow) => {
|
|
140
|
+
const flowConnetions = (0, utils_1.findKeyPathWithValue)(flow, 'connection_id');
|
|
141
|
+
await Promise.all(flowConnetions.map(async (f) => {
|
|
142
|
+
const connectionId = (dot_prop_1.default.get(flow, f.path) || '');
|
|
143
|
+
const flowConnectionName = connectionIdMap[connectionId];
|
|
144
|
+
if (!flowConnectionName) {
|
|
145
|
+
logger_1.default.warn(`Flow connection: ${connectionId} not found for flow:${flow.name}, please verify the flow connection id.`);
|
|
159
146
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (allFlowConnections.length === total) {
|
|
163
|
-
break;
|
|
147
|
+
else {
|
|
148
|
+
dot_prop_1.default.set(flow, f.path, flowConnectionName);
|
|
164
149
|
}
|
|
165
|
-
}
|
|
166
|
-
return
|
|
167
|
-
});
|
|
150
|
+
}));
|
|
151
|
+
return flow;
|
|
152
|
+
}));
|
|
153
|
+
return flows;
|
|
168
154
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return flows;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
pargeFlowConnectionName(flows, connectionNameMap) {
|
|
190
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
// replace connection_id with flow connection names
|
|
192
|
-
const parsedFlows = yield Promise.all(flows.map((flow) => __awaiter(this, void 0, void 0, function* () {
|
|
193
|
-
const flowConnetions = (0, utils_1.findKeyPathWithValue)(flow, 'connection_id');
|
|
194
|
-
yield Promise.all(flowConnetions.map((f) => __awaiter(this, void 0, void 0, function* () {
|
|
195
|
-
const connectionName = (dot_prop_1.default.get(flow, f.path) || '');
|
|
196
|
-
const flowConnectionId = connectionNameMap[connectionName];
|
|
197
|
-
if (!flowConnectionId) {
|
|
198
|
-
logger_1.default.error(`Flow connection: ${flowConnectionId} not found for flow:${flow.name}, please verify the flow connection name.`);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
dot_prop_1.default.set(flow, f.path, flowConnectionId);
|
|
202
|
-
}
|
|
203
|
-
})));
|
|
204
|
-
return flow;
|
|
205
|
-
})));
|
|
206
|
-
return parsedFlows;
|
|
207
|
-
});
|
|
155
|
+
async pargeFlowConnectionName(flows, connectionNameMap) {
|
|
156
|
+
// replace connection_id with flow connection names
|
|
157
|
+
const parsedFlows = await Promise.all(flows.map(async (flow) => {
|
|
158
|
+
const flowConnetions = (0, utils_1.findKeyPathWithValue)(flow, 'connection_id');
|
|
159
|
+
await Promise.all(flowConnetions.map(async (f) => {
|
|
160
|
+
const connectionName = (dot_prop_1.default.get(flow, f.path) || '');
|
|
161
|
+
const flowConnectionId = connectionNameMap[connectionName];
|
|
162
|
+
if (!flowConnectionId) {
|
|
163
|
+
logger_1.default.error(`Flow connection: ${flowConnectionId} not found for flow:${flow.name}, please verify the flow connection name.`);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
dot_prop_1.default.set(flow, f.path, flowConnectionId);
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
169
|
+
return flow;
|
|
170
|
+
}));
|
|
171
|
+
return parsedFlows;
|
|
208
172
|
}
|
|
209
173
|
}
|
|
210
174
|
exports.default = FlowHandler;
|
|
211
175
|
__decorate([
|
|
212
176
|
(0, default_1.order)('80')
|
|
213
177
|
], FlowHandler.prototype, "processChanges", null);
|
|
214
|
-
//# sourceMappingURL=flows.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Management } from 'auth0';
|
|
2
2
|
import DefaultHandler from './default';
|
|
3
3
|
import { Asset, Assets } from '../../../types';
|
|
4
4
|
export type Form = {
|
|
5
5
|
name: string;
|
|
6
6
|
body: string;
|
|
7
7
|
};
|
|
8
|
-
export type FormResponse =
|
|
8
|
+
export type FormResponse = Management.GetFormResponseContent;
|
|
9
9
|
export declare const schema: {
|
|
10
10
|
type: string;
|
|
11
11
|
items: {
|
|
@@ -26,7 +26,7 @@ export default class FormsHandler extends DefaultHandler {
|
|
|
26
26
|
existing: Asset;
|
|
27
27
|
constructor(options: DefaultHandler);
|
|
28
28
|
objString(item: any): string;
|
|
29
|
-
getForms(forms: Array<
|
|
29
|
+
getForms(forms: Array<Management.FormSummary>): Promise<Management.GetFormResponseContent[]>;
|
|
30
30
|
getType(): Promise<Asset>;
|
|
31
31
|
formateFormFlowId(forms: any, flowIdMap: any): Promise<Asset>;
|
|
32
32
|
pargeFormFlowName(forms: any, flowNameMap: any): Promise<Form[]>;
|
|
@@ -38,15 +38,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
})();
|
|
41
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
41
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
43
|
};
|
|
@@ -72,119 +63,115 @@ exports.schema = {
|
|
|
72
63
|
};
|
|
73
64
|
class FormsHandler extends default_1.default {
|
|
74
65
|
constructor(options) {
|
|
75
|
-
super(
|
|
66
|
+
super({
|
|
67
|
+
...options,
|
|
68
|
+
type: 'forms',
|
|
69
|
+
id: 'id',
|
|
70
|
+
stripCreateFields: ['created_at', 'updated_at', 'submitted_at', 'embedded_at'],
|
|
71
|
+
stripUpdateFields: ['created_at', 'updated_at', 'submitted_at', 'embedded_at'],
|
|
72
|
+
functions: {
|
|
73
|
+
update: async ({ id }, bodyParams) => this.client.forms.update(id, bodyParams),
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
77
|
objString(item) {
|
|
78
78
|
return super.objString({ id: item.id, name: item.name });
|
|
79
79
|
}
|
|
80
|
-
getForms(forms) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return allForms.filter((form) => form !== null);
|
|
93
|
-
});
|
|
80
|
+
async getForms(forms) {
|
|
81
|
+
const allForms = await this.client.pool
|
|
82
|
+
.addEachTask({
|
|
83
|
+
data: forms,
|
|
84
|
+
generator: ({ id }) => this.client.forms.get(id).then((response) => {
|
|
85
|
+
if ((0, lodash_1.isEmpty)(response))
|
|
86
|
+
return null;
|
|
87
|
+
return response;
|
|
88
|
+
}),
|
|
89
|
+
})
|
|
90
|
+
.promise();
|
|
91
|
+
return allForms.filter((form) => form !== null);
|
|
94
92
|
}
|
|
95
|
-
getType() {
|
|
96
|
-
|
|
97
|
-
if (this.existing) {
|
|
98
|
-
return this.existing;
|
|
99
|
-
}
|
|
100
|
-
const [forms, flows] = yield Promise.all([
|
|
101
|
-
(0, client_1.paginate)(this.client.forms.getAll, {
|
|
102
|
-
paginate: true,
|
|
103
|
-
include_totals: true,
|
|
104
|
-
}),
|
|
105
|
-
(0, client_1.paginate)(this.client.flows.getAll, {
|
|
106
|
-
paginate: true,
|
|
107
|
-
include_totals: true,
|
|
108
|
-
}),
|
|
109
|
-
]);
|
|
110
|
-
// get more details for each form
|
|
111
|
-
const allForms = yield this.getForms(forms);
|
|
112
|
-
// create a map for id to name from allFlows
|
|
113
|
-
const flowIdMap = {};
|
|
114
|
-
flows.forEach((f) => {
|
|
115
|
-
flowIdMap[f.id] = f.name;
|
|
116
|
-
});
|
|
117
|
-
this.existing = yield this.formateFormFlowId(allForms, flowIdMap);
|
|
93
|
+
async getType() {
|
|
94
|
+
if (this.existing) {
|
|
118
95
|
return this.existing;
|
|
96
|
+
}
|
|
97
|
+
const [forms, flows] = await Promise.all([
|
|
98
|
+
(0, client_1.paginate)(this.client.forms.list, {
|
|
99
|
+
paginate: true,
|
|
100
|
+
}),
|
|
101
|
+
(0, client_1.paginate)(this.client.flows.list, {
|
|
102
|
+
paginate: true,
|
|
103
|
+
}),
|
|
104
|
+
]);
|
|
105
|
+
// get more details for each form
|
|
106
|
+
const allForms = await this.getForms(forms);
|
|
107
|
+
// create a map for id to name from allFlows
|
|
108
|
+
const flowIdMap = {};
|
|
109
|
+
flows.forEach((f) => {
|
|
110
|
+
flowIdMap[f.id] = f.name;
|
|
119
111
|
});
|
|
112
|
+
this.existing = await this.formateFormFlowId(allForms, flowIdMap);
|
|
113
|
+
return this.existing;
|
|
120
114
|
}
|
|
121
|
-
formateFormFlowId(forms, flowIdMap) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return forms;
|
|
139
|
-
});
|
|
115
|
+
async formateFormFlowId(forms, flowIdMap) {
|
|
116
|
+
// replace flow_id with flow names
|
|
117
|
+
await Promise.all(forms.map(async (form) => {
|
|
118
|
+
const flows = (0, utils_1.findKeyPathWithValue)(form, 'flow_id');
|
|
119
|
+
await Promise.all(flows.map(async (f) => {
|
|
120
|
+
const flowId = (dot_prop_1.default.get(form, f.path) || '');
|
|
121
|
+
const flowName = flowIdMap[flowId];
|
|
122
|
+
if (!flowName) {
|
|
123
|
+
logger_1.default.warn(`Flow: ${flowId} not found for form:${form.name}, please verify the flow id.`);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
dot_prop_1.default.set(form, f.path, flowName);
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
return form;
|
|
130
|
+
}));
|
|
131
|
+
return forms;
|
|
140
132
|
}
|
|
141
|
-
pargeFormFlowName(forms, flowNameMap) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return forms;
|
|
159
|
-
});
|
|
133
|
+
async pargeFormFlowName(forms, flowNameMap) {
|
|
134
|
+
// replace flow names with flow_id
|
|
135
|
+
await Promise.all(forms.map(async (form) => {
|
|
136
|
+
const flows = (0, utils_1.findKeyPathWithValue)(form, 'flow_id');
|
|
137
|
+
await Promise.all(flows.map(async (f) => {
|
|
138
|
+
const flowName = (dot_prop_1.default.get(form, f.path) || '');
|
|
139
|
+
const flowId = flowNameMap[flowName];
|
|
140
|
+
if (!flowId) {
|
|
141
|
+
logger_1.default.error(`Flow: ${flowName} not found for form:${form.name}, please verify the flow name.`);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
dot_prop_1.default.set(form, f.path, flowNameMap[flowName]);
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
return form;
|
|
148
|
+
}));
|
|
149
|
+
return forms;
|
|
160
150
|
}
|
|
161
|
-
processChanges(assets) {
|
|
162
|
-
const
|
|
163
|
-
|
|
151
|
+
async processChanges(assets) {
|
|
152
|
+
const { forms } = assets;
|
|
153
|
+
// Do nothing if not set
|
|
154
|
+
if (!forms)
|
|
155
|
+
return;
|
|
156
|
+
const flows = await (0, client_1.paginate)(this.client.flows.list, {
|
|
157
|
+
paginate: true,
|
|
158
|
+
include_totals: true,
|
|
164
159
|
});
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const { del, update, create, conflicts } = yield this.calcChanges(assets);
|
|
181
|
-
const changes = {
|
|
182
|
-
del: del,
|
|
183
|
-
update: update,
|
|
184
|
-
create: create,
|
|
185
|
-
conflicts: conflicts,
|
|
186
|
-
};
|
|
187
|
-
yield _super.processChanges.call(this, assets, Object.assign({}, changes));
|
|
160
|
+
// create a map for id to name from flows
|
|
161
|
+
const flowNamMap = {};
|
|
162
|
+
flows.forEach((f) => {
|
|
163
|
+
flowNamMap[f.name] = f.id;
|
|
164
|
+
});
|
|
165
|
+
assets.forms = await this.pargeFormFlowName(forms, flowNamMap);
|
|
166
|
+
const { del, update, create, conflicts } = await this.calcChanges(assets);
|
|
167
|
+
const changes = {
|
|
168
|
+
del: del,
|
|
169
|
+
update: update,
|
|
170
|
+
create: create,
|
|
171
|
+
conflicts: conflicts,
|
|
172
|
+
};
|
|
173
|
+
await super.processChanges(assets, {
|
|
174
|
+
...changes,
|
|
188
175
|
});
|
|
189
176
|
}
|
|
190
177
|
}
|
|
@@ -192,4 +179,3 @@ exports.default = FormsHandler;
|
|
|
192
179
|
__decorate([
|
|
193
180
|
(0, default_1.order)('90')
|
|
194
181
|
], FormsHandler.prototype, "processChanges", null);
|
|
195
|
-
//# sourceMappingURL=forms.js.map
|