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
|
@@ -16,7 +16,7 @@ const logger_1 = __importDefault(require("../logger"));
|
|
|
16
16
|
* @returns T
|
|
17
17
|
*/
|
|
18
18
|
function processChangedObjectFields({ handler, desiredAssetState, currentAssetState, allowDelete, }) {
|
|
19
|
-
const desiredAssetStateWithChanges =
|
|
19
|
+
const desiredAssetStateWithChanges = { ...desiredAssetState };
|
|
20
20
|
// eslint-disable-next-line no-restricted-syntax
|
|
21
21
|
for (const fieldName of handler.objectFields) {
|
|
22
22
|
const areDesiredStateAndCurrentStateEmpty = Object.keys(desiredAssetState[fieldName] || {}).length === 0 &&
|
|
@@ -98,18 +98,25 @@ function calculateChanges({ handler, assets, existing, identifiers = ['id', 'nam
|
|
|
98
98
|
// Delete from create as it's an update
|
|
99
99
|
create = create.filter((e) => e !== asset);
|
|
100
100
|
// Append identifiers to asset
|
|
101
|
-
update.push(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
update.push({
|
|
102
|
+
...identifiers.reduce((obj, i) => {
|
|
103
|
+
if (found[i])
|
|
104
|
+
obj[i] = found[i];
|
|
105
|
+
return obj;
|
|
106
|
+
}, {}),
|
|
107
|
+
// If we have any object fields, we need to make sure that they get
|
|
108
|
+
// special treatment. When different metadata objects are passed to APIv2
|
|
109
|
+
// properties must explicitly be marked for deletion by indicating a `null`
|
|
110
|
+
// value.
|
|
111
|
+
...(handler.objectFields.length
|
|
112
|
+
? processChangedObjectFields({
|
|
113
|
+
handler,
|
|
114
|
+
desiredAssetState: asset,
|
|
115
|
+
currentAssetState: found,
|
|
116
|
+
allowDelete,
|
|
117
|
+
})
|
|
118
|
+
: asset),
|
|
119
|
+
});
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
122
|
});
|
|
@@ -134,7 +141,10 @@ function calculateChanges({ handler, assets, existing, identifiers = ['id', 'nam
|
|
|
134
141
|
const conflict = (existing || []).filter((e) => e.name === a.name && e[uniqueID] !== a[uniqueID])[0];
|
|
135
142
|
if (conflict) {
|
|
136
143
|
const temp = Math.random().toString(36).substr(2, 5);
|
|
137
|
-
conflicts.push(
|
|
144
|
+
conflicts.push({
|
|
145
|
+
...conflict,
|
|
146
|
+
name: `${conflict.name}-${temp}`,
|
|
147
|
+
});
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
150
|
});
|
|
@@ -146,4 +156,3 @@ function calculateChanges({ handler, assets, existing, identifiers = ['id', 'nam
|
|
|
146
156
|
create,
|
|
147
157
|
};
|
|
148
158
|
}
|
|
149
|
-
//# sourceMappingURL=calculateChanges.js.map
|
package/lib/tools/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Management } from 'auth0';
|
|
2
2
|
declare const constants: {
|
|
3
3
|
CONCURRENT_CALLS: number;
|
|
4
4
|
RULES_DIRECTORY: string;
|
|
@@ -18,7 +18,7 @@ declare const constants: {
|
|
|
18
18
|
DATABASE_CONNECTIONS_DIRECTORY: string;
|
|
19
19
|
DATABASE_SCRIPTS_CHANGE_EMAIL: string;
|
|
20
20
|
DATABASE_SCRIPTS_GET_USER: string;
|
|
21
|
-
EMAIL_TEMPLATES_TYPES:
|
|
21
|
+
EMAIL_TEMPLATES_TYPES: Management.EmailTemplateNameEnum[];
|
|
22
22
|
ACTIONS_TRIGGERS: string[];
|
|
23
23
|
EMAIL_TEMPLATES_DIRECTORY: string;
|
|
24
24
|
EMAIL_VERIFY: string;
|
package/lib/tools/constants.js
CHANGED
package/lib/tools/deploy.js
CHANGED
|
@@ -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
|
};
|
|
@@ -15,24 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
6
|
exports.default = deploy;
|
|
16
7
|
const auth0_1 = __importDefault(require("./auth0"));
|
|
17
8
|
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
function deploy(assets, client, config) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, {});
|
|
36
|
-
});
|
|
9
|
+
async function deploy(assets, client, config) {
|
|
10
|
+
// Setup log level
|
|
11
|
+
logger_1.default.level = process.env.AUTH0_DEBUG === 'true' ? 'debug' : 'info';
|
|
12
|
+
logger_1.default.info(`Getting access token for ${config('AUTH0_CLIENT_ID') !== undefined ? `${config('AUTH0_CLIENT_ID')}/` : ''}${config('AUTH0_DOMAIN')}`);
|
|
13
|
+
const auth0 = new auth0_1.default(client, assets, config);
|
|
14
|
+
// Validate Assets
|
|
15
|
+
await auth0.validate();
|
|
16
|
+
// Process changes
|
|
17
|
+
await auth0.processChanges();
|
|
18
|
+
return auth0.handlers.reduce((accum, h) => {
|
|
19
|
+
accum[h.type] = {
|
|
20
|
+
deleted: h.deleted,
|
|
21
|
+
created: h.created,
|
|
22
|
+
updated: h.updated,
|
|
23
|
+
};
|
|
24
|
+
return accum;
|
|
25
|
+
}, {});
|
|
37
26
|
}
|
|
38
|
-
//# sourceMappingURL=deploy.js.map
|
package/lib/tools/index.d.ts
CHANGED
|
@@ -2,98 +2,13 @@ import constants from './constants';
|
|
|
2
2
|
import deploy from './deploy';
|
|
3
3
|
import Auth0 from './auth0';
|
|
4
4
|
import { keywordReplace, loadFileAndReplaceKeywords, wrapArrayReplaceMarkersInQuotes } from './utils';
|
|
5
|
-
declare const
|
|
6
|
-
constants:
|
|
7
|
-
CONCURRENT_CALLS: number;
|
|
8
|
-
RULES_DIRECTORY: string;
|
|
9
|
-
RULES_STAGES: string[];
|
|
10
|
-
DEFAULT_RULE_STAGE: string;
|
|
11
|
-
HOOKS_HIDDEN_SECRET_VALUE: string;
|
|
12
|
-
OBFUSCATED_SECRET_VALUE: string;
|
|
13
|
-
HOOKS_DIRECTORY: string;
|
|
14
|
-
ACTIONS_DIRECTORY: string;
|
|
15
|
-
TRIGGERS_DIRECTORY: string;
|
|
16
|
-
RULES_CONFIGS_DIRECTORY: string;
|
|
17
|
-
PAGES_DIRECTORY: string;
|
|
18
|
-
PAGE_LOGIN: string;
|
|
19
|
-
PAGE_GUARDIAN_MULTIFACTOR: string;
|
|
20
|
-
PAGE_PASSWORD_RESET: string;
|
|
21
|
-
PAGE_ERROR: string;
|
|
22
|
-
DATABASE_CONNECTIONS_DIRECTORY: string;
|
|
23
|
-
DATABASE_SCRIPTS_CHANGE_EMAIL: string;
|
|
24
|
-
DATABASE_SCRIPTS_GET_USER: string;
|
|
25
|
-
EMAIL_TEMPLATES_TYPES: import("auth0").GetEmailTemplatesByTemplateNameTemplateNameEnum[];
|
|
26
|
-
ACTIONS_TRIGGERS: string[];
|
|
27
|
-
EMAIL_TEMPLATES_DIRECTORY: string;
|
|
28
|
-
EMAIL_VERIFY: string;
|
|
29
|
-
EMAIL_VERIFY_BY_CODE: string;
|
|
30
|
-
EMAIL_RESET: string;
|
|
31
|
-
EMAIL_RESET_BY_CODE: string;
|
|
32
|
-
EMAIL_WELCOME: string;
|
|
33
|
-
EMAIL_BLOCKED: string;
|
|
34
|
-
EMAIL_STOLEN_CREDENTIALS: string;
|
|
35
|
-
EMAIL_ENROLLMENT: string;
|
|
36
|
-
EMAIL_CHANGE_PASSWORD: string;
|
|
37
|
-
EMAIL_PASSWORD_RESET: string;
|
|
38
|
-
EMAIL_MFA_OOB_CODE: string;
|
|
39
|
-
EMAIL_USER_INVITATION: string;
|
|
40
|
-
EMAIL_ASYNC_APPROVAL: string;
|
|
41
|
-
GUARDIAN_DIRECTORY: string;
|
|
42
|
-
GUARDIAN_FACTORS_DIRECTORY: string;
|
|
43
|
-
GUARDIAN_PROVIDERS_DIRECTORY: string;
|
|
44
|
-
GUARDIAN_TEMPLATES_DIRECTORY: string;
|
|
45
|
-
UNIVERSAL_LOGIN_TEMPLATE: string;
|
|
46
|
-
RESOURCE_SERVERS_DIRECTORY: string;
|
|
47
|
-
RESOURCE_SERVERS_CLIENT_NAME: string;
|
|
48
|
-
RESOURCE_SERVERS_MANAGEMENT_API_NAME: string;
|
|
49
|
-
RESOURCE_SERVERS_ID_NAME: string;
|
|
50
|
-
CLIENTS_DIRECTORY: string;
|
|
51
|
-
CLIENTS_GRANTS_DIRECTORY: string;
|
|
52
|
-
BRANDING_DIRECTORY: string;
|
|
53
|
-
PHONE_PROVIDER_DIRECTORY: string;
|
|
54
|
-
BRANDING_TEMPLATES_DIRECTORY: string;
|
|
55
|
-
BRANDING_TEMPLATES_YAML_DIRECTORY: string;
|
|
56
|
-
CLIENTS_CLIENT_NAME: string;
|
|
57
|
-
CLIENTS_CLIENT_ID_NAME: string;
|
|
58
|
-
CONNECTIONS_DIRECTORY: string;
|
|
59
|
-
CONNECTIONS_CLIENT_NAME: string;
|
|
60
|
-
CONNECTIONS_ID_NAME: string;
|
|
61
|
-
ROLES_DIRECTORY: string;
|
|
62
|
-
ATTACK_PROTECTION_DIRECTORY: string;
|
|
63
|
-
GUARDIAN_FACTORS: string[];
|
|
64
|
-
GUARDIAN_POLICIES: string[];
|
|
65
|
-
GUARDIAN_PHONE_PROVIDERS: string[];
|
|
66
|
-
GUARDIAN_PHONE_MESSAGE_TYPES: string[];
|
|
67
|
-
GUARDIAN_FACTOR_TEMPLATES: string[];
|
|
68
|
-
GUARDIAN_FACTOR_PROVIDERS: {
|
|
69
|
-
sms: string[];
|
|
70
|
-
'push-notification': string[];
|
|
71
|
-
};
|
|
72
|
-
PAGE_NAMES: string[];
|
|
73
|
-
DATABASE_SCRIPTS: string[];
|
|
74
|
-
DATABASE_SCRIPTS_NO_IMPORT: string[];
|
|
75
|
-
DATABASE_SCRIPTS_IMPORT: string[];
|
|
76
|
-
EMAIL_TEMPLATES_NAMES: string[];
|
|
77
|
-
SUPPORTED_BRANDING_TEMPLATES: string[];
|
|
78
|
-
LOG_STREAMS_DIRECTORY: string;
|
|
79
|
-
PROMPTS_DIRECTORY: string;
|
|
80
|
-
PROMPTS_SCREEN_RENDER_DIRECTORY: string;
|
|
81
|
-
PARTIALS_DIRECTORY: string;
|
|
82
|
-
CUSTOM_DOMAINS_DIRECTORY: string;
|
|
83
|
-
THEMES_DIRECTORY: string;
|
|
84
|
-
CONNECTION_APP_ID: string[];
|
|
85
|
-
FORMS_DIRECTORY: string;
|
|
86
|
-
FLOWS_DIRECTORY: string;
|
|
87
|
-
FLOWS_VAULT_DIRECTORY: string;
|
|
88
|
-
SELF_SERVICE_PROFILE_DIRECTORY: string;
|
|
89
|
-
NETWORK_ACLS_DIRECTORY: string;
|
|
90
|
-
USER_ATTRIBUTE_PROFILES_DIRECTORY: string;
|
|
91
|
-
};
|
|
5
|
+
declare const tools: {
|
|
6
|
+
constants: typeof constants;
|
|
92
7
|
deploy: typeof deploy;
|
|
93
8
|
keywordReplace: typeof keywordReplace;
|
|
94
9
|
loadFileAndReplaceKeywords: typeof loadFileAndReplaceKeywords;
|
|
95
10
|
wrapArrayReplaceMarkersInQuotes: typeof wrapArrayReplaceMarkersInQuotes;
|
|
96
11
|
Auth0: typeof Auth0;
|
|
97
12
|
};
|
|
98
|
-
export default
|
|
13
|
+
export default tools;
|
|
99
14
|
export { constants, deploy, keywordReplace, loadFileAndReplaceKeywords, wrapArrayReplaceMarkersInQuotes, Auth0, };
|
package/lib/tools/index.js
CHANGED
|
@@ -14,7 +14,8 @@ const utils_1 = require("./utils");
|
|
|
14
14
|
Object.defineProperty(exports, "keywordReplace", { enumerable: true, get: function () { return utils_1.keywordReplace; } });
|
|
15
15
|
Object.defineProperty(exports, "loadFileAndReplaceKeywords", { enumerable: true, get: function () { return utils_1.loadFileAndReplaceKeywords; } });
|
|
16
16
|
Object.defineProperty(exports, "wrapArrayReplaceMarkersInQuotes", { enumerable: true, get: function () { return utils_1.wrapArrayReplaceMarkersInQuotes; } });
|
|
17
|
-
|
|
17
|
+
// Explicit type to avoid non-portable type inference
|
|
18
|
+
const tools = {
|
|
18
19
|
constants: constants_1.default,
|
|
19
20
|
deploy: deploy_1.default,
|
|
20
21
|
keywordReplace: utils_1.keywordReplace,
|
|
@@ -22,4 +23,4 @@ exports.default = {
|
|
|
22
23
|
wrapArrayReplaceMarkersInQuotes: utils_1.wrapArrayReplaceMarkersInQuotes,
|
|
23
24
|
Auth0: auth0_1.default,
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
exports.default = tools;
|
package/lib/tools/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const keywordReplaceArrayRegExp: (key: any) => RegExp;
|
|
|
3
3
|
export declare const keywordReplaceStringRegExp: (key: any) => RegExp;
|
|
4
4
|
export declare function keywordArrayReplace(input: string, mappings: KeywordMappings): string;
|
|
5
5
|
export declare function keywordStringReplace(input: string, mappings: KeywordMappings): string;
|
|
6
|
-
export declare function keywordReplace(input: string, mappings: KeywordMappings): string;
|
|
6
|
+
export declare function keywordReplace(input: string | undefined, mappings: KeywordMappings): string;
|
|
7
7
|
export declare function wrapArrayReplaceMarkersInQuotes(body: string, mappings: KeywordMappings): string;
|
|
8
8
|
export declare function convertClientNameToId(name: string, clients: Asset[]): string;
|
|
9
9
|
export declare function convertClientNamesToIds(names: string[], clients: Asset[]): string[];
|
package/lib/tools/utils.js
CHANGED
|
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
37
|
};
|
|
@@ -100,6 +91,9 @@ function keywordStringReplace(input, mappings) {
|
|
|
100
91
|
}
|
|
101
92
|
function keywordReplace(input, mappings) {
|
|
102
93
|
// Replace keywords with mappings within input.
|
|
94
|
+
if (input === undefined) {
|
|
95
|
+
return 'undefined';
|
|
96
|
+
}
|
|
103
97
|
if (mappings && Object.keys(mappings).length > 0) {
|
|
104
98
|
input = keywordArrayReplace(input, mappings);
|
|
105
99
|
input = keywordStringReplace(input, mappings);
|
|
@@ -158,7 +152,7 @@ function convertJsonToString(obj, spacing = 0) {
|
|
|
158
152
|
function stripFields(obj, fields) {
|
|
159
153
|
// Strip object fields supporting dot notation (ie: a.deep.field)
|
|
160
154
|
const stripped = [];
|
|
161
|
-
const newObj =
|
|
155
|
+
const newObj = { ...obj };
|
|
162
156
|
fields.forEach((f) => {
|
|
163
157
|
if (dot_prop_1.default.get(newObj, f) !== undefined) {
|
|
164
158
|
dot_prop_1.default.delete(newObj, f);
|
|
@@ -228,7 +222,7 @@ const obfuscateSensitiveValues = (data, sensitiveFieldsToObfuscate) => {
|
|
|
228
222
|
if (Array.isArray(data)) {
|
|
229
223
|
return data.map((asset) => (0, exports.obfuscateSensitiveValues)(asset, sensitiveFieldsToObfuscate));
|
|
230
224
|
}
|
|
231
|
-
const newAsset =
|
|
225
|
+
const newAsset = { ...data };
|
|
232
226
|
sensitiveFieldsToObfuscate.forEach((sensitiveField) => {
|
|
233
227
|
if (dot_prop_1.default.get(newAsset, sensitiveField) !== undefined) {
|
|
234
228
|
dot_prop_1.default.set(newAsset, sensitiveField, constants_1.default.OBFUSCATED_SECRET_VALUE);
|
|
@@ -244,7 +238,7 @@ const stripObfuscatedFieldsFromPayload = (data, obfuscatedFields) => {
|
|
|
244
238
|
if (Array.isArray(data)) {
|
|
245
239
|
return data.map((asset) => (0, exports.stripObfuscatedFieldsFromPayload)(asset, obfuscatedFields));
|
|
246
240
|
}
|
|
247
|
-
const newAsset =
|
|
241
|
+
const newAsset = { ...data };
|
|
248
242
|
obfuscatedFields.forEach((sensitiveField) => {
|
|
249
243
|
const obfuscatedFieldValue = dot_prop_1.default.get(newAsset, sensitiveField);
|
|
250
244
|
if (obfuscatedFieldValue === constants_1.default.OBFUSCATED_SECRET_VALUE) {
|
|
@@ -254,10 +248,9 @@ const stripObfuscatedFieldsFromPayload = (data, obfuscatedFields) => {
|
|
|
254
248
|
return newAsset;
|
|
255
249
|
};
|
|
256
250
|
exports.stripObfuscatedFieldsFromPayload = stripObfuscatedFieldsFromPayload;
|
|
257
|
-
const detectInsufficientScopeError = (fn) =>
|
|
258
|
-
var _a, _b;
|
|
251
|
+
const detectInsufficientScopeError = async (fn) => {
|
|
259
252
|
try {
|
|
260
|
-
const data =
|
|
253
|
+
const data = await fn();
|
|
261
254
|
return {
|
|
262
255
|
hadSufficientScopes: true,
|
|
263
256
|
data,
|
|
@@ -266,7 +259,7 @@ const detectInsufficientScopeError = (fn) => __awaiter(void 0, void 0, void 0, f
|
|
|
266
259
|
}
|
|
267
260
|
catch (err) {
|
|
268
261
|
if (err.statusCode === 403 && err.message.includes('Insufficient scope')) {
|
|
269
|
-
const requiredScopes =
|
|
262
|
+
const requiredScopes = err.message?.split('Insufficient scope, expected any of: ')?.slice(1);
|
|
270
263
|
return {
|
|
271
264
|
hadSufficientScopes: false,
|
|
272
265
|
requiredScopes,
|
|
@@ -275,22 +268,20 @@ const detectInsufficientScopeError = (fn) => __awaiter(void 0, void 0, void 0, f
|
|
|
275
268
|
}
|
|
276
269
|
throw err;
|
|
277
270
|
}
|
|
278
|
-
}
|
|
271
|
+
};
|
|
279
272
|
exports.detectInsufficientScopeError = detectInsufficientScopeError;
|
|
280
273
|
function sleep(ms) {
|
|
281
274
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
282
275
|
}
|
|
283
276
|
const isDeprecatedError = (err) => {
|
|
284
|
-
var _a;
|
|
285
277
|
if (!err)
|
|
286
278
|
return false;
|
|
287
|
-
return !!(err.statusCode === 403 ||
|
|
279
|
+
return !!(err.statusCode === 403 || err.message?.includes('deprecated feature'));
|
|
288
280
|
};
|
|
289
281
|
exports.isDeprecatedError = isDeprecatedError;
|
|
290
282
|
const isForbiddenFeatureError = (err, type) => {
|
|
291
|
-
var _a;
|
|
292
283
|
if (err.statusCode === 403) {
|
|
293
|
-
logger_1.default.warn(`${err.message};${
|
|
284
|
+
logger_1.default.warn(`${err.message};${err.errorCode ?? ''} - Skipping ${type}`);
|
|
294
285
|
return true;
|
|
295
286
|
}
|
|
296
287
|
return false;
|
|
@@ -306,4 +297,3 @@ function maskSecretAtPath({ resourceTypeName, maskedKeyName, maskOnObj, keyJsonP
|
|
|
306
297
|
}
|
|
307
298
|
return maskOnObj;
|
|
308
299
|
}
|
|
309
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Management, ManagementClient } from 'auth0';
|
|
2
2
|
import { PromisePoolExecutor } from 'promise-pool-executor';
|
|
3
3
|
import { Action } from './tools/auth0/handlers/actions';
|
|
4
4
|
import { Prompts } from './tools/auth0/handlers/prompts';
|
|
@@ -14,6 +14,7 @@ import { FlowVaultConnection } from './tools/auth0/handlers/flowVaultConnections
|
|
|
14
14
|
import { SsProfileWithCustomText } from './tools/auth0/handlers/selfServiceProfiles';
|
|
15
15
|
import { PhoneProvider } from './tools/auth0/handlers/phoneProvider';
|
|
16
16
|
import { NetworkACL } from './tools/auth0/handlers/networkACLs';
|
|
17
|
+
import { UserAttributeProfile } from './tools/auth0/handlers/userAttributeProfiles';
|
|
17
18
|
import { AttackProtection } from './tools/auth0/handlers/attackProtection';
|
|
18
19
|
type SharedPaginationParams = {
|
|
19
20
|
checkpoint?: boolean;
|
|
@@ -21,7 +22,7 @@ type SharedPaginationParams = {
|
|
|
21
22
|
is_global?: boolean;
|
|
22
23
|
include_totals?: boolean;
|
|
23
24
|
id?: string;
|
|
24
|
-
strategy?:
|
|
25
|
+
strategy?: Management.ConnectionStrategyEnum[];
|
|
25
26
|
};
|
|
26
27
|
export type CheckpointPaginationParams = SharedPaginationParams & {
|
|
27
28
|
from?: string;
|
|
@@ -58,6 +59,9 @@ export type Config = {
|
|
|
58
59
|
AUTH0_BASE_PATH?: string;
|
|
59
60
|
AUTH0_AUDIENCE?: string;
|
|
60
61
|
AUTH0_API_MAX_RETRIES?: number;
|
|
62
|
+
AUTH0_MAX_RETRIES?: number;
|
|
63
|
+
AUTH0_RETRY_INITIAL_DELAY_MS?: number;
|
|
64
|
+
AUTH0_RETRY_MAX_DELAY_MS?: number;
|
|
61
65
|
AUTH0_KEYWORD_REPLACE_MAPPINGS?: KeywordMappings;
|
|
62
66
|
AUTH0_EXPORT_IDENTIFIERS?: boolean;
|
|
63
67
|
AUTH0_CONNECTIONS_DIRECTORY?: string;
|
|
@@ -92,7 +96,7 @@ export type Assets = Partial<{
|
|
|
92
96
|
clients: Client[] | null;
|
|
93
97
|
clientGrants: ClientGrant[] | null;
|
|
94
98
|
connections: Asset[] | null;
|
|
95
|
-
customDomains: CustomDomain[] | null;
|
|
99
|
+
customDomains: Management.CustomDomain[] | null;
|
|
96
100
|
databases: Asset[] | null;
|
|
97
101
|
emailProvider: Asset | null;
|
|
98
102
|
emailTemplates: Asset[] | null;
|
|
@@ -111,7 +115,7 @@ export type Assets = Partial<{
|
|
|
111
115
|
organizations: Asset[] | null;
|
|
112
116
|
pages: Page[] | null;
|
|
113
117
|
prompts: Prompts | null;
|
|
114
|
-
resourceServers: ResourceServer[] | null;
|
|
118
|
+
resourceServers: Management.ResourceServer[] | null;
|
|
115
119
|
roles: Asset[] | null;
|
|
116
120
|
rules: Asset[] | null;
|
|
117
121
|
rulesConfigs: Asset[] | null;
|
package/lib/types.js
CHANGED
package/lib/utils.d.ts
CHANGED
|
@@ -12,62 +12,8 @@ export declare function dumpJSON(file: string, mappings: {
|
|
|
12
12
|
}): void;
|
|
13
13
|
export declare function existsMustBeDir(folder: string): boolean;
|
|
14
14
|
export declare function toConfigFn(data: Config): (arg0: keyof Config) => any;
|
|
15
|
-
export declare function stripIdentifiers(auth0: Auth0, assets: Assets):
|
|
16
|
-
|
|
17
|
-
attackProtection?: import("./tools/auth0/handlers/attackProtection").AttackProtection | null | undefined;
|
|
18
|
-
branding?: (Asset & {
|
|
19
|
-
templates?: {
|
|
20
|
-
template: string;
|
|
21
|
-
body: string;
|
|
22
|
-
}[] | null;
|
|
23
|
-
}) | null | undefined;
|
|
24
|
-
phoneProviders?: import("auth0").GetBrandingPhoneProviders200ResponseProvidersInner[] | null | undefined;
|
|
25
|
-
clients?: import("./tools/auth0/handlers/clients").Client[] | null | undefined;
|
|
26
|
-
clientGrants?: import("./tools/auth0/handlers/clientGrants").ClientGrant[] | null | undefined;
|
|
27
|
-
connections?: Asset[] | null | undefined;
|
|
28
|
-
customDomains?: import("auth0").CustomDomain[] | null | undefined;
|
|
29
|
-
databases?: Asset[] | null | undefined;
|
|
30
|
-
emailProvider?: Asset | null | undefined;
|
|
31
|
-
emailTemplates?: Asset[] | null | undefined;
|
|
32
|
-
guardianFactorProviders?: Asset[] | null | undefined;
|
|
33
|
-
guardianFactors?: Asset[] | null | undefined;
|
|
34
|
-
guardianFactorTemplates?: Asset[] | null | undefined;
|
|
35
|
-
guardianPhoneFactorMessageTypes?: {
|
|
36
|
-
message_types: Asset[];
|
|
37
|
-
} | null | undefined;
|
|
38
|
-
guardianPhoneFactorSelectedProvider?: Asset | null | undefined;
|
|
39
|
-
guardianPolicies?: {
|
|
40
|
-
policies: string[];
|
|
41
|
-
} | null | undefined;
|
|
42
|
-
hooks?: Asset[] | null | undefined;
|
|
43
|
-
logStreams?: import("./tools/auth0/handlers/logStreams").LogStream[] | null | undefined;
|
|
44
|
-
organizations?: Asset[] | null | undefined;
|
|
45
|
-
pages?: import("./tools/auth0/handlers/pages").Page[] | null | undefined;
|
|
46
|
-
prompts?: Partial<import("./tools/auth0/handlers/prompts").PromptSettings & {
|
|
47
|
-
customText: import("./tools/auth0/handlers/prompts").AllPromptsByLanguage;
|
|
48
|
-
partials: import("./tools/auth0/handlers/prompts").CustomPromptPartials;
|
|
49
|
-
screenRenderers?: import("./tools/auth0/handlers/prompts").ScreenRenderer[];
|
|
50
|
-
}> | null | undefined;
|
|
51
|
-
resourceServers?: import("auth0").ResourceServer[] | null | undefined;
|
|
52
|
-
roles?: Asset[] | null | undefined;
|
|
53
|
-
rules?: Asset[] | null | undefined;
|
|
54
|
-
rulesConfigs?: Asset[] | null | undefined;
|
|
55
|
-
tenant?: import("auth0").TenantSettings | null | undefined;
|
|
56
|
-
triggers?: Asset[] | null | undefined;
|
|
57
|
-
exclude?: {
|
|
58
|
-
[key: string]: string[];
|
|
59
|
-
} | undefined;
|
|
60
|
-
clientsOrig?: Asset[] | null | undefined;
|
|
61
|
-
themes?: import("auth0").PostBrandingTheme200Response[] | null | undefined;
|
|
62
|
-
forms?: import("./tools/auth0/handlers/forms").Form[] | null | undefined;
|
|
63
|
-
flows?: import("./tools/auth0/handlers/flows").Flow[] | null | undefined;
|
|
64
|
-
flowVaultConnections?: import("./tools/auth0/handlers/flowVaultConnections").FlowVaultConnection[] | null | undefined;
|
|
65
|
-
selfServiceProfiles?: import("./tools/auth0/handlers/selfServiceProfiles").SsProfileWithCustomText[] | null | undefined;
|
|
66
|
-
networkACLs?: import("auth0").GetNetworkAclsById200Response[] | null | undefined;
|
|
67
|
-
userAttributeProfiles?: import("auth0").UserAttributeProfile[] | null | undefined;
|
|
68
|
-
userAttributeProfilesWithId?: import("auth0").UserAttributeProfile[] | null | undefined;
|
|
69
|
-
};
|
|
70
|
-
export declare function sanitize(str: string): string;
|
|
15
|
+
export declare function stripIdentifiers(auth0: Auth0, assets: Assets): Assets;
|
|
16
|
+
export declare function sanitize(str: string | undefined): string;
|
|
71
17
|
type ImportantFields = {
|
|
72
18
|
name: string | null;
|
|
73
19
|
client_id: string | null;
|
|
@@ -84,7 +30,7 @@ export declare function recordsSorter(a: Partial<ImportantFields>, b: Partial<Im
|
|
|
84
30
|
export declare function clearTenantFlags(tenant: Asset): void;
|
|
85
31
|
export declare function ensureProp(obj: Asset, props: string): void;
|
|
86
32
|
export declare function clearClientArrays(client: Asset): Asset;
|
|
87
|
-
export declare function convertClientIdToName(clientId: string, knownClients?: Asset[]): string;
|
|
33
|
+
export declare function convertClientIdToName(clientId: string | undefined, knownClients?: Asset[]): string;
|
|
88
34
|
export declare function hasKeywordMarkers(value: any): boolean;
|
|
89
35
|
export declare function mapClientID2NameSorted(enabledClients: string[] | string, knownClients: Asset[]): string[] | string;
|
|
90
36
|
export declare function nomalizedYAMLPath(filePath: string): string[];
|
package/lib/utils.js
CHANGED
|
@@ -92,7 +92,7 @@ function toConfigFn(data) {
|
|
|
92
92
|
return (key) => data[key];
|
|
93
93
|
}
|
|
94
94
|
function stripIdentifiers(auth0, assets) {
|
|
95
|
-
const updated =
|
|
95
|
+
const updated = { ...assets };
|
|
96
96
|
// Some of the object identifiers are required to perform updates.
|
|
97
97
|
// Don't strip these object id's
|
|
98
98
|
const ignore = [
|
|
@@ -111,7 +111,7 @@ function stripIdentifiers(auth0, assets) {
|
|
|
111
111
|
// All objects with the identifier field is an array. This could change in future.
|
|
112
112
|
if (Array.isArray(exist)) {
|
|
113
113
|
updated[h.type] = exist.map((o) => {
|
|
114
|
-
const newObj =
|
|
114
|
+
const newObj = { ...o };
|
|
115
115
|
delete newObj[h.id];
|
|
116
116
|
return newObj;
|
|
117
117
|
});
|
|
@@ -120,6 +120,8 @@ function stripIdentifiers(auth0, assets) {
|
|
|
120
120
|
return updated;
|
|
121
121
|
}
|
|
122
122
|
function sanitize(str) {
|
|
123
|
+
if (!str)
|
|
124
|
+
return 'undefined';
|
|
123
125
|
return (0, sanitize_filename_1.default)(str, { replacement: '-' });
|
|
124
126
|
}
|
|
125
127
|
function formatResults(item) {
|
|
@@ -137,7 +139,7 @@ function formatResults(item) {
|
|
|
137
139
|
stage: null,
|
|
138
140
|
id: null,
|
|
139
141
|
};
|
|
140
|
-
const result =
|
|
142
|
+
const result = { ...importantFields };
|
|
141
143
|
Object.entries(item)
|
|
142
144
|
.sort()
|
|
143
145
|
.forEach(([key, value]) => {
|
|
@@ -182,6 +184,8 @@ function clearClientArrays(client) {
|
|
|
182
184
|
return client;
|
|
183
185
|
}
|
|
184
186
|
function convertClientIdToName(clientId, knownClients = []) {
|
|
187
|
+
if (!clientId)
|
|
188
|
+
return 'undefined_clientId';
|
|
185
189
|
try {
|
|
186
190
|
const found = knownClients.find((c) => c.client_id === clientId);
|
|
187
191
|
return (found && found.name) || clientId;
|
|
@@ -262,10 +266,9 @@ exports.findKeyPathWithValue = findKeyPathWithValue;
|
|
|
262
266
|
* @returns The Base64 encoded certificate string if the input starts with '-----BEGIN CERTIFICATE-----', otherwise returns the original string.
|
|
263
267
|
*/
|
|
264
268
|
const encodeCertStringToBase64 = (cert) => {
|
|
265
|
-
if (cert
|
|
269
|
+
if (cert?.startsWith('-----BEGIN CERTIFICATE-----')) {
|
|
266
270
|
return Buffer.from(cert).toString('base64');
|
|
267
271
|
}
|
|
268
272
|
return cert;
|
|
269
273
|
};
|
|
270
274
|
exports.encodeCertStringToBase64 = encodeCertStringToBase64;
|
|
271
|
-
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth0-deploy-cli",
|
|
3
|
-
"version": "8.20.
|
|
3
|
+
"version": "8.20.4-beta.0",
|
|
4
4
|
"description": "A command line tool for deploying updates to your Auth0 tenant",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"a0deploy": "lib/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"lint:fix": "eslint --fix
|
|
11
|
-
"lint": "eslint
|
|
10
|
+
"lint:fix": "eslint --fix . && kacl lint",
|
|
11
|
+
"lint": "eslint . && kacl lint",
|
|
12
12
|
"format": "npx prettier --write .",
|
|
13
13
|
"test": "ts-mocha -p tsconfig.json --recursive 'test/**/*.test*' --exclude 'test/e2e/*' --timeout 20000",
|
|
14
14
|
"test:e2e:node-module": "ts-mocha -p tsconfig.json --recursive 'test/e2e/*.test*' --timeout 120000",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"homepage": "https://github.com/auth0/auth0-deploy-cli#readme",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ajv": "^6.12.6",
|
|
36
|
-
"auth0": "^
|
|
36
|
+
"auth0": "^5.1.0",
|
|
37
37
|
"dot-prop": "^5.3.0",
|
|
38
38
|
"fs-extra": "^10.1.0",
|
|
39
|
-
"js-yaml": "^4.1.
|
|
39
|
+
"js-yaml": "^4.1.1",
|
|
40
40
|
"lodash": "^4.17.21",
|
|
41
41
|
"mkdirp": "^1.0.4",
|
|
42
42
|
"nconf": "^0.13.0",
|
|
@@ -51,13 +51,15 @@
|
|
|
51
51
|
"@types/lodash": "^4.17.20",
|
|
52
52
|
"@types/mocha": "^10.0.10",
|
|
53
53
|
"@types/nconf": "^0.10.7",
|
|
54
|
-
"@
|
|
54
|
+
"@eslint/js": "^9.39.1",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
|
56
|
+
"@typescript-eslint/parser": "^8.47.0",
|
|
55
57
|
"chai": "^4.5.0",
|
|
56
58
|
"chai-as-promised": "^7.1.2",
|
|
57
|
-
"eslint": "^
|
|
58
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
59
|
+
"eslint": "^9.39.1",
|
|
59
60
|
"eslint-config-prettier": "^10.1.8",
|
|
60
61
|
"eslint-plugin-import": "^2.32.0",
|
|
62
|
+
"globals": "^15.12.0",
|
|
61
63
|
"husky": "^9.1.7",
|
|
62
64
|
"kacl": "^1.1.1",
|
|
63
65
|
"mocha": "^10.8.2",
|
|
@@ -71,11 +73,10 @@
|
|
|
71
73
|
"sinon": "^13.0.2",
|
|
72
74
|
"sinon-chai": "^3.7.0",
|
|
73
75
|
"ts-mocha": "^10.1.0",
|
|
74
|
-
"typescript": "^5.9.
|
|
75
|
-
"zlib": "^1.0.5"
|
|
76
|
+
"typescript": "^5.9.3"
|
|
76
77
|
},
|
|
77
78
|
"engines": {
|
|
78
|
-
"node": ">=20.
|
|
79
|
+
"node": ">=20.19.0"
|
|
79
80
|
},
|
|
80
81
|
"keywords": [
|
|
81
82
|
"auth0",
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "es2020",
|
|
4
4
|
"experimentalDecorators": true,
|
|
5
|
-
"module": "
|
|
5
|
+
"module": "nodenext",
|
|
6
|
+
"moduleResolution": "nodenext",
|
|
6
7
|
"rootDir": "./src",
|
|
7
8
|
"allowJs": true,
|
|
8
9
|
"outDir": "./lib",
|
|
9
|
-
"sourceMap":
|
|
10
|
+
"sourceMap": false,
|
|
10
11
|
"esModuleInterop": true,
|
|
11
12
|
"forceConsistentCasingInFileNames": true,
|
|
12
13
|
"strict": false,
|