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,33 +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
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.schema = void 0;
|
|
27
7
|
const lodash_1 = require("lodash");
|
|
8
|
+
const auth0_1 = require("auth0");
|
|
28
9
|
const default_1 = __importDefault(require("./default"));
|
|
29
10
|
const types_1 = require("../../../types");
|
|
30
11
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
12
|
+
const client_1 = require("../client");
|
|
31
13
|
const promptTypes = [
|
|
32
14
|
'login',
|
|
33
15
|
'login-id',
|
|
@@ -63,6 +45,7 @@ const promptTypes = [
|
|
|
63
45
|
'common',
|
|
64
46
|
'captcha',
|
|
65
47
|
'passkeys',
|
|
48
|
+
'brute-force-protection',
|
|
66
49
|
];
|
|
67
50
|
const screenTypes = [
|
|
68
51
|
'login',
|
|
@@ -126,6 +109,9 @@ const screenTypes = [
|
|
|
126
109
|
'login-passwordless-sms-otp',
|
|
127
110
|
'passkey-enrollment',
|
|
128
111
|
'passkey-enrollment-local',
|
|
112
|
+
'brute-force-protection-unblock',
|
|
113
|
+
'brute-force-protection-unblock-success',
|
|
114
|
+
'brute-force-protection-unblock-failure',
|
|
129
115
|
];
|
|
130
116
|
const customPartialsPromptTypes = [
|
|
131
117
|
'login',
|
|
@@ -169,52 +155,79 @@ exports.schema = {
|
|
|
169
155
|
},
|
|
170
156
|
customText: {
|
|
171
157
|
type: 'object',
|
|
172
|
-
properties: types_1.languages.reduce((acc, language) => (
|
|
158
|
+
properties: types_1.languages.reduce((acc, language) => ({
|
|
159
|
+
...acc,
|
|
160
|
+
[language]: {
|
|
173
161
|
type: 'object',
|
|
174
|
-
properties: promptTypes.reduce((promptAcc, promptType) => (
|
|
162
|
+
properties: promptTypes.reduce((promptAcc, promptType) => ({
|
|
163
|
+
...promptAcc,
|
|
164
|
+
[promptType]: {
|
|
175
165
|
type: 'object',
|
|
176
|
-
properties: screenTypes.reduce((screenAcc, screenType) => (
|
|
166
|
+
properties: screenTypes.reduce((screenAcc, screenType) => ({
|
|
167
|
+
...screenAcc,
|
|
168
|
+
[screenType]: {
|
|
177
169
|
type: 'object',
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
},
|
|
171
|
+
}), {}),
|
|
172
|
+
},
|
|
173
|
+
}), {}),
|
|
174
|
+
},
|
|
175
|
+
}), {}),
|
|
181
176
|
},
|
|
182
177
|
partials: {
|
|
183
178
|
type: 'object',
|
|
184
|
-
properties: customPartialsPromptTypes.reduce((acc, customPartialsPromptType) => (
|
|
179
|
+
properties: customPartialsPromptTypes.reduce((acc, customPartialsPromptType) => ({
|
|
180
|
+
...acc,
|
|
181
|
+
[customPartialsPromptType]: {
|
|
185
182
|
oneOf: [
|
|
186
183
|
{
|
|
187
184
|
type: 'object',
|
|
188
|
-
properties: customPartialsScreenTypes.reduce((screenAcc, customPartialsScreenType) => (
|
|
185
|
+
properties: customPartialsScreenTypes.reduce((screenAcc, customPartialsScreenType) => ({
|
|
186
|
+
...screenAcc,
|
|
187
|
+
[customPartialsScreenType]: {
|
|
189
188
|
oneOf: [
|
|
190
189
|
{
|
|
191
190
|
type: 'object',
|
|
192
|
-
properties: customPartialsInsertionPoints.reduce((insertionAcc, customPartialsInsertionPoint) => (
|
|
191
|
+
properties: customPartialsInsertionPoints.reduce((insertionAcc, customPartialsInsertionPoint) => ({
|
|
192
|
+
...insertionAcc,
|
|
193
|
+
[customPartialsInsertionPoint]: {
|
|
193
194
|
type: 'string',
|
|
194
|
-
}
|
|
195
|
+
},
|
|
196
|
+
}), {}),
|
|
195
197
|
},
|
|
196
198
|
{ type: 'null' },
|
|
197
199
|
],
|
|
198
|
-
}
|
|
200
|
+
},
|
|
201
|
+
}), {}),
|
|
199
202
|
},
|
|
200
203
|
{ type: 'null' },
|
|
201
204
|
],
|
|
202
|
-
}
|
|
205
|
+
},
|
|
206
|
+
}), {}),
|
|
203
207
|
},
|
|
204
208
|
screenRenderers: {
|
|
205
209
|
type: 'array',
|
|
206
|
-
properties: promptTypes.reduce((promptAcc, promptType) => (
|
|
210
|
+
properties: promptTypes.reduce((promptAcc, promptType) => ({
|
|
211
|
+
...promptAcc,
|
|
212
|
+
[promptType]: {
|
|
207
213
|
type: 'array',
|
|
208
|
-
properties: screenTypes.reduce((screenAcc, screenType) => (
|
|
214
|
+
properties: screenTypes.reduce((screenAcc, screenType) => ({
|
|
215
|
+
...screenAcc,
|
|
216
|
+
[screenType]: {
|
|
209
217
|
type: 'string',
|
|
210
|
-
}
|
|
211
|
-
|
|
218
|
+
},
|
|
219
|
+
}), {}),
|
|
220
|
+
},
|
|
221
|
+
}), {}),
|
|
212
222
|
},
|
|
213
223
|
},
|
|
214
224
|
};
|
|
215
225
|
class PromptsHandler extends default_1.default {
|
|
216
226
|
constructor(options) {
|
|
217
|
-
super(
|
|
227
|
+
super({
|
|
228
|
+
...options,
|
|
229
|
+
type: 'prompts',
|
|
230
|
+
});
|
|
218
231
|
this.IsFeatureSupported = true;
|
|
219
232
|
}
|
|
220
233
|
objString({ customText, screenRenderers }) {
|
|
@@ -227,228 +240,221 @@ class PromptsHandler extends default_1.default {
|
|
|
227
240
|
}
|
|
228
241
|
return description;
|
|
229
242
|
}
|
|
230
|
-
getType() {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
logger_1.default.warn(`Unable to fetch screen renderers: ${error}`);
|
|
243
|
-
}
|
|
244
|
-
return prompts;
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
getCustomTextSettings() {
|
|
248
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
-
const supportedLanguages = yield this.client.tenants
|
|
250
|
-
.getSettings()
|
|
251
|
-
.then(({ data: { enabled_locales } }) => {
|
|
252
|
-
if (enabled_locales === undefined)
|
|
253
|
-
return []; // In rare cases, private cloud tenants may not have `enabled_locales` defined
|
|
254
|
-
return enabled_locales;
|
|
243
|
+
async getType() {
|
|
244
|
+
const promptsSettings = await this.client.prompts.getSettings();
|
|
245
|
+
const customText = await this.getCustomTextSettings();
|
|
246
|
+
const partials = await this.getCustomPromptsPartials();
|
|
247
|
+
const prompts = {
|
|
248
|
+
...promptsSettings,
|
|
249
|
+
customText,
|
|
250
|
+
partials,
|
|
251
|
+
};
|
|
252
|
+
try {
|
|
253
|
+
const screenRenderers = await (0, client_1.paginate)(this.client.prompts.rendering.list, {
|
|
254
|
+
paginate: true,
|
|
255
255
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return null;
|
|
269
|
-
return {
|
|
270
|
-
language,
|
|
271
|
-
[promptType]: Object.assign({}, customTextData),
|
|
272
|
-
};
|
|
273
|
-
}),
|
|
274
|
-
})
|
|
275
|
-
.promise()
|
|
276
|
-
.then((customTextData) => customTextData
|
|
277
|
-
.filter((customTextData) => customTextData !== null)
|
|
278
|
-
.reduce((acc, customTextItem) => {
|
|
279
|
-
if ((customTextItem === null || customTextItem === void 0 ? void 0 : customTextItem.language) === undefined)
|
|
280
|
-
return acc;
|
|
281
|
-
const { language } = customTextItem, customTextSettings = __rest(customTextItem, ["language"]);
|
|
282
|
-
return Object.assign(Object.assign({}, acc), { [language]: acc[language]
|
|
283
|
-
? Object.assign(Object.assign({}, acc[language]), customTextSettings) : Object.assign({}, customTextSettings) });
|
|
284
|
-
}, {}));
|
|
256
|
+
prompts.screenRenderers = screenRenderers ?? [];
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
logger_1.default.warn(`Unable to fetch screen renderers: ${error}`);
|
|
260
|
+
}
|
|
261
|
+
return prompts;
|
|
262
|
+
}
|
|
263
|
+
async getCustomTextSettings() {
|
|
264
|
+
const supportedLanguages = await this.client.tenants.settings.get().then((res) => {
|
|
265
|
+
if (res.enabled_locales === undefined)
|
|
266
|
+
return []; // In rare cases, private cloud tenants may not have `enabled_locales` defined
|
|
267
|
+
return res.enabled_locales;
|
|
285
268
|
});
|
|
269
|
+
return this.client.pool
|
|
270
|
+
.addEachTask({
|
|
271
|
+
data: supportedLanguages
|
|
272
|
+
.map((language) => promptTypes.map((promptType) => ({ promptType, language })))
|
|
273
|
+
.reduce((acc, val) => acc.concat(val), []) || [],
|
|
274
|
+
generator: ({ promptType, language }) => this.client.prompts.customText.get(promptType, language).then((customTextData) => {
|
|
275
|
+
if ((0, lodash_1.isEmpty)(customTextData))
|
|
276
|
+
return null;
|
|
277
|
+
return {
|
|
278
|
+
language,
|
|
279
|
+
[promptType]: {
|
|
280
|
+
...customTextData,
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
}),
|
|
284
|
+
})
|
|
285
|
+
.promise()
|
|
286
|
+
.then((customTextResponse) => customTextResponse
|
|
287
|
+
.filter((customTextData) => customTextData !== null)
|
|
288
|
+
.reduce((acc, customTextItem) => {
|
|
289
|
+
if (customTextItem?.language === undefined)
|
|
290
|
+
return acc;
|
|
291
|
+
const { language, ...customTextSettings } = customTextItem;
|
|
292
|
+
return {
|
|
293
|
+
...acc,
|
|
294
|
+
[language]: acc[language]
|
|
295
|
+
? { ...acc[language], ...customTextSettings }
|
|
296
|
+
: { ...customTextSettings },
|
|
297
|
+
};
|
|
298
|
+
}, {}));
|
|
286
299
|
}
|
|
287
300
|
/**
|
|
288
301
|
* Error handler wrapper.
|
|
289
302
|
*/
|
|
290
|
-
withErrorHandling(callback) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
303
|
+
async withErrorHandling(callback) {
|
|
304
|
+
try {
|
|
305
|
+
return await callback();
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
// Extract error data
|
|
309
|
+
if (error && error?.statusCode === 403) {
|
|
310
|
+
logger_1.default.warn('Partial Prompts feature is not supported for the tenant');
|
|
311
|
+
this.IsFeatureSupported = false;
|
|
312
|
+
return null;
|
|
295
313
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
if (error &&
|
|
304
|
-
(error === null || error === void 0 ? void 0 : error.statusCode) === 400 &&
|
|
305
|
-
((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('feature requires at least one custom domain'))) {
|
|
306
|
-
logger_1.default.warn('Partial Prompts feature requires at least one custom domain to be configured for the tenant');
|
|
307
|
-
this.IsFeatureSupported = false;
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
310
|
-
if (error && error.statusCode === 429) {
|
|
311
|
-
logger_1.default.error(`The global rate limit has been exceeded, resulting in a ${error.statusCode} error. ${error.message}. Although this is an error, it is not blocking the pipeline.`);
|
|
312
|
-
return null;
|
|
313
|
-
}
|
|
314
|
-
throw error;
|
|
314
|
+
if (error &&
|
|
315
|
+
error?.statusCode === 400 &&
|
|
316
|
+
error.message?.includes('feature requires at least one custom domain')) {
|
|
317
|
+
logger_1.default.warn('Partial Prompts feature requires at least one custom domain to be configured for the tenant');
|
|
318
|
+
this.IsFeatureSupported = false;
|
|
319
|
+
return null;
|
|
315
320
|
}
|
|
316
|
-
|
|
321
|
+
if (error && error.statusCode === 429) {
|
|
322
|
+
logger_1.default.error(`The global rate limit has been exceeded, resulting in a ${error.statusCode} error. ${error.message}. Although this is an error, it is not blocking the pipeline.`);
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
throw error;
|
|
326
|
+
}
|
|
317
327
|
}
|
|
318
|
-
getCustomPartial(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
return this.withErrorHandling(() => __awaiter(this, void 0, void 0, function* () { return this.client.prompts.getPartials({ prompt }); }));
|
|
323
|
-
});
|
|
328
|
+
async getCustomPartial({ prompt, }) {
|
|
329
|
+
if (!this.IsFeatureSupported)
|
|
330
|
+
return {};
|
|
331
|
+
return this.withErrorHandling(async () => this.client.prompts.partials.get(prompt));
|
|
324
332
|
}
|
|
325
|
-
getCustomPromptsPartials() {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
acc[promptType] = partialsData;
|
|
344
|
-
}
|
|
345
|
-
return acc;
|
|
346
|
-
}, {});
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
processChanges(assets) {
|
|
350
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
351
|
-
const { prompts } = assets;
|
|
352
|
-
if (!prompts)
|
|
353
|
-
return;
|
|
354
|
-
const { partials, customText, screenRenderers } = prompts, promptSettings = __rest(prompts, ["partials", "customText", "screenRenderers"]);
|
|
355
|
-
if (!(0, lodash_1.isEmpty)(promptSettings)) {
|
|
356
|
-
yield this.client.prompts.update(promptSettings);
|
|
333
|
+
async getCustomPromptsPartials() {
|
|
334
|
+
const partialsDataWithNulls = await this.client.pool
|
|
335
|
+
.addEachTask({
|
|
336
|
+
data: customPartialsPromptTypes,
|
|
337
|
+
generator: (promptType) => this.getCustomPartial({
|
|
338
|
+
prompt: promptType,
|
|
339
|
+
}).then((partialsData) => {
|
|
340
|
+
if ((0, lodash_1.isEmpty)(partialsData))
|
|
341
|
+
return null;
|
|
342
|
+
return { promptType, partialsData };
|
|
343
|
+
}),
|
|
344
|
+
})
|
|
345
|
+
.promise();
|
|
346
|
+
const validPartialsData = partialsDataWithNulls.filter(Boolean);
|
|
347
|
+
return validPartialsData.reduce((acc, partialData) => {
|
|
348
|
+
if (partialData) {
|
|
349
|
+
const { promptType, partialsData } = partialData;
|
|
350
|
+
acc[promptType] = partialsData;
|
|
357
351
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
// Update screen renderers
|
|
361
|
-
yield this.updateScreenRenderers(screenRenderers);
|
|
362
|
-
this.updated += 1;
|
|
363
|
-
this.didUpdate(prompts);
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
updateCustomTextSettings(customText) {
|
|
367
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
-
/*
|
|
369
|
-
Note: deletes are not currently supported
|
|
370
|
-
*/
|
|
371
|
-
if (!customText)
|
|
372
|
-
return;
|
|
373
|
-
yield this.client.pool
|
|
374
|
-
.addEachTask({
|
|
375
|
-
data: Object.keys(customText).flatMap((language) => {
|
|
376
|
-
const languageScreenTypes = customText[language];
|
|
377
|
-
if (!languageScreenTypes)
|
|
378
|
-
return [];
|
|
379
|
-
return Object.keys(languageScreenTypes).map((prompt) => {
|
|
380
|
-
const body = languageScreenTypes[prompt] || {};
|
|
381
|
-
return {
|
|
382
|
-
body,
|
|
383
|
-
language,
|
|
384
|
-
prompt,
|
|
385
|
-
};
|
|
386
|
-
});
|
|
387
|
-
}),
|
|
388
|
-
generator: ({ prompt, language, body }) => this.client.prompts.updateCustomTextByLanguage({ prompt, language }, body),
|
|
389
|
-
})
|
|
390
|
-
.promise();
|
|
391
|
-
});
|
|
352
|
+
return acc;
|
|
353
|
+
}, {});
|
|
392
354
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
355
|
+
async processChanges(assets) {
|
|
356
|
+
const { prompts } = assets;
|
|
357
|
+
if (!prompts)
|
|
358
|
+
return;
|
|
359
|
+
const { partials, customText, screenRenderers, ...promptSettings } = prompts;
|
|
360
|
+
if (!(0, lodash_1.isEmpty)(promptSettings)) {
|
|
361
|
+
await this.client.prompts.updateSettings(promptSettings);
|
|
362
|
+
}
|
|
363
|
+
await this.updateCustomTextSettings(customText);
|
|
364
|
+
await this.updateCustomPromptsPartials(partials);
|
|
365
|
+
// Update screen renderers
|
|
366
|
+
await this.updateScreenRenderers(screenRenderers);
|
|
367
|
+
this.updated += 1;
|
|
368
|
+
this.didUpdate(prompts);
|
|
399
369
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
370
|
+
async updateCustomTextSettings(customText) {
|
|
371
|
+
/*
|
|
372
|
+
Note: deletes are not currently supported
|
|
373
|
+
*/
|
|
374
|
+
if (!customText)
|
|
375
|
+
return;
|
|
376
|
+
await this.client.pool
|
|
377
|
+
.addEachTask({
|
|
378
|
+
data: Object.keys(customText).flatMap((language) => {
|
|
379
|
+
const languageScreenTypes = customText[language];
|
|
380
|
+
if (!languageScreenTypes)
|
|
381
|
+
return [];
|
|
382
|
+
return Object.keys(languageScreenTypes).map((prompt) => {
|
|
383
|
+
const body = languageScreenTypes[prompt] || {};
|
|
411
384
|
return {
|
|
412
385
|
body,
|
|
386
|
+
language,
|
|
413
387
|
prompt,
|
|
414
388
|
};
|
|
415
|
-
})
|
|
416
|
-
|
|
417
|
-
})
|
|
418
|
-
|
|
419
|
-
|
|
389
|
+
});
|
|
390
|
+
}),
|
|
391
|
+
generator: ({ prompt, language, body }) => this.client.prompts.customText.set(prompt, language, body),
|
|
392
|
+
})
|
|
393
|
+
.promise();
|
|
420
394
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
return;
|
|
426
|
-
const updatePayload = Object.assign(Object.assign({}, updatePrams), { rendering_mode, default_head_tags_disabled: default_head_tags_disabled || undefined });
|
|
427
|
-
try {
|
|
428
|
-
yield this.client.prompts.updateRendering({
|
|
429
|
-
prompt: prompt,
|
|
430
|
-
screen: screen,
|
|
431
|
-
}, Object.assign({}, updatePayload));
|
|
432
|
-
}
|
|
433
|
-
catch (error) {
|
|
434
|
-
const errorMessage = `Problem updating ${this.type} screen renderers ${prompt}:${screen}\n${error}`;
|
|
435
|
-
logger_1.default.error(errorMessage);
|
|
436
|
-
throw new Error(errorMessage);
|
|
437
|
-
}
|
|
438
|
-
});
|
|
395
|
+
async updateCustomPartials({ prompt, body, }) {
|
|
396
|
+
if (!this.IsFeatureSupported)
|
|
397
|
+
return;
|
|
398
|
+
await this.withErrorHandling(async () => this.client.prompts.partials.set(prompt, body));
|
|
439
399
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
400
|
+
async updateCustomPromptsPartials(partials) {
|
|
401
|
+
/*
|
|
402
|
+
Note: deletes are not currently supported
|
|
403
|
+
*/
|
|
404
|
+
if (!partials)
|
|
405
|
+
return;
|
|
406
|
+
await this.client.pool
|
|
407
|
+
.addEachTask({
|
|
408
|
+
data: Object.keys(partials).map((prompt) => {
|
|
409
|
+
const body = partials[prompt] || {};
|
|
410
|
+
return {
|
|
411
|
+
body,
|
|
412
|
+
prompt,
|
|
413
|
+
};
|
|
414
|
+
}),
|
|
415
|
+
generator: ({ prompt, body }) => this.updateCustomPartials({ prompt, body }),
|
|
416
|
+
})
|
|
417
|
+
.promise();
|
|
418
|
+
}
|
|
419
|
+
async updateScreenRenderer(screenRenderer) {
|
|
420
|
+
const { prompt, screen, ...updatePrams } = screenRenderer;
|
|
421
|
+
if (!prompt || !screen)
|
|
422
|
+
return;
|
|
423
|
+
let updatePayload;
|
|
424
|
+
if (screenRenderer.rendering_mode === auth0_1.Management.AculRenderingModeEnum.Standard) {
|
|
425
|
+
updatePayload = {
|
|
426
|
+
rendering_mode: auth0_1.Management.AculRenderingModeEnum.Standard,
|
|
427
|
+
head_tags: screenRenderer.head_tags,
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
updatePayload = {
|
|
432
|
+
...updatePrams,
|
|
433
|
+
rendering_mode: auth0_1.Management.AculRenderingModeEnum.Advanced,
|
|
434
|
+
default_head_tags_disabled: screenRenderer.default_head_tags_disabled || undefined,
|
|
435
|
+
head_tags: screenRenderer.head_tags,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
try {
|
|
439
|
+
await this.client.prompts.rendering.update(prompt, screen, {
|
|
440
|
+
...updatePayload,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
const errorMessage = `Problem updating ${this.type} screen renderers ${prompt}:${screen}\n${error}`;
|
|
445
|
+
logger_1.default.error(errorMessage);
|
|
446
|
+
throw new Error(errorMessage);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
async updateScreenRenderers(screenRenderers) {
|
|
450
|
+
if ((0, lodash_1.isEmpty)(screenRenderers) || !screenRenderers)
|
|
451
|
+
return;
|
|
452
|
+
await this.client.pool
|
|
453
|
+
.addEachTask({
|
|
454
|
+
data: screenRenderers,
|
|
455
|
+
generator: (updateParams) => this.updateScreenRenderer(updateParams),
|
|
456
|
+
})
|
|
457
|
+
.promise();
|
|
451
458
|
}
|
|
452
459
|
}
|
|
453
460
|
exports.default = PromptsHandler;
|
|
454
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Management } from 'auth0';
|
|
2
2
|
import DefaultHandler from './default';
|
|
3
3
|
import { Assets, CalculatedChanges } from '../../../types';
|
|
4
4
|
export declare const excludeSchema: {
|
|
@@ -7,6 +7,7 @@ export declare const excludeSchema: {
|
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
+
export type ResourceServer = Management.ResourceServer;
|
|
10
11
|
export declare const schema: {
|
|
11
12
|
type: string;
|
|
12
13
|
items: {
|
|
@@ -93,5 +94,8 @@ export default class ResourceServersHandler extends DefaultHandler {
|
|
|
93
94
|
getType(): Promise<ResourceServer[]>;
|
|
94
95
|
calcChanges(assets: Assets): Promise<CalculatedChanges>;
|
|
95
96
|
validate(assets: Assets): Promise<void>;
|
|
96
|
-
|
|
97
|
+
processChanges(assets: Assets): Promise<void>;
|
|
98
|
+
updateResourceServer(args: {
|
|
99
|
+
id: string;
|
|
100
|
+
}, update: ResourceServer): Promise<Management.UpdateResourceServerResponseContent>;
|
|
97
101
|
}
|