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
|
@@ -38,22 +38,13 @@ 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
|
};
|
|
53
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
45
|
exports.processConnectionEnabledClients = exports.updateConnectionEnabledClients = exports.getConnectionEnabledClients = exports.addExcludedConnectionPropertiesToChanges = exports.schema = void 0;
|
|
55
46
|
const dot_prop_1 = __importDefault(require("dot-prop"));
|
|
56
|
-
const lodash_1 =
|
|
47
|
+
const lodash_1 = require("lodash");
|
|
57
48
|
const auth0_1 = require("auth0");
|
|
58
49
|
const default_1 = __importStar(require("./default"));
|
|
59
50
|
const utils_1 = require("../../utils");
|
|
@@ -111,14 +102,13 @@ exports.schema = {
|
|
|
111
102
|
// This use case is common because organizations may not want to expose sensitive connection details, but want to preserve them in the tenant.
|
|
112
103
|
// exported only for unit testing purposes
|
|
113
104
|
const addExcludedConnectionPropertiesToChanges = ({ proposedChanges, existingConnections, config, }) => {
|
|
114
|
-
var _a, _b;
|
|
115
105
|
if (proposedChanges.update.length === 0)
|
|
116
106
|
return proposedChanges;
|
|
117
|
-
|
|
118
|
-
const excludedFields =
|
|
107
|
+
// @ts-ignore because this expects a parameter to be passed
|
|
108
|
+
const excludedFields = config()?.EXCLUDED_PROPS?.connections || [];
|
|
119
109
|
if (excludedFields.length === 0)
|
|
120
110
|
return proposedChanges;
|
|
121
|
-
const existingConnectionsMap = lodash_1.
|
|
111
|
+
const existingConnectionsMap = (0, lodash_1.keyBy)(existingConnections, 'id');
|
|
122
112
|
const excludedOptions = excludedFields.filter(
|
|
123
113
|
// Only include fields that pertain to options
|
|
124
114
|
(excludedField) => excludedField.startsWith('options'));
|
|
@@ -133,9 +123,18 @@ const addExcludedConnectionPropertiesToChanges = ({ proposedChanges, existingCon
|
|
|
133
123
|
}, {
|
|
134
124
|
options: {},
|
|
135
125
|
});
|
|
136
|
-
return
|
|
126
|
+
return {
|
|
127
|
+
...proposedConnection,
|
|
128
|
+
options: {
|
|
129
|
+
...proposedConnection.options,
|
|
130
|
+
...currentExcludedPropertyValues.options,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
137
133
|
});
|
|
138
|
-
return
|
|
134
|
+
return {
|
|
135
|
+
...proposedChanges,
|
|
136
|
+
update: newProposedUpdates,
|
|
137
|
+
};
|
|
139
138
|
};
|
|
140
139
|
exports.addExcludedConnectionPropertiesToChanges = addExcludedConnectionPropertiesToChanges;
|
|
141
140
|
/**
|
|
@@ -144,32 +143,28 @@ exports.addExcludedConnectionPropertiesToChanges = addExcludedConnectionProperti
|
|
|
144
143
|
* @param connectionId - The unique identifier of the connection to fetch enabled clients for
|
|
145
144
|
* @returns A promise that resolves to an array of client IDs, or null if connectionId is empty or an error occurs
|
|
146
145
|
*/
|
|
147
|
-
const getConnectionEnabledClients = (auth0Client, connectionId) =>
|
|
146
|
+
const getConnectionEnabledClients = async (auth0Client, connectionId) => {
|
|
148
147
|
if (!connectionId)
|
|
149
148
|
return null;
|
|
150
149
|
try {
|
|
151
150
|
const enabledClientsFormatted = [];
|
|
152
|
-
let
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (enabledClients === null || enabledClients === void 0 ? void 0 : enabledClients.length) {
|
|
158
|
-
enabledClients.forEach((client) => {
|
|
159
|
-
if (client === null || client === void 0 ? void 0 : client.client_id) {
|
|
151
|
+
let enabledClients = await auth0Client.connections.clients.get(connectionId);
|
|
152
|
+
do {
|
|
153
|
+
if (enabledClients && enabledClients.data?.length > 0) {
|
|
154
|
+
enabledClients.data.forEach((client) => {
|
|
155
|
+
if (client?.client_id) {
|
|
160
156
|
enabledClientsFormatted.push(client.client_id);
|
|
161
157
|
}
|
|
162
158
|
});
|
|
163
159
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
160
|
+
enabledClients = await enabledClients.getNextPage();
|
|
161
|
+
} while (enabledClients.hasNextPage());
|
|
167
162
|
return enabledClientsFormatted;
|
|
168
163
|
}
|
|
169
164
|
catch (error) {
|
|
170
165
|
return null;
|
|
171
166
|
}
|
|
172
|
-
}
|
|
167
|
+
};
|
|
173
168
|
exports.getConnectionEnabledClients = getConnectionEnabledClients;
|
|
174
169
|
/**
|
|
175
170
|
* Updates the enabled clients for a specific Auth0 connection.
|
|
@@ -181,18 +176,16 @@ exports.getConnectionEnabledClients = getConnectionEnabledClients;
|
|
|
181
176
|
* @returns Promise that resolves to true if the update was successful, false otherwise
|
|
182
177
|
*
|
|
183
178
|
*/
|
|
184
|
-
const updateConnectionEnabledClients = (auth0Client, typeName, connectionId, enabledClientIds) =>
|
|
179
|
+
const updateConnectionEnabledClients = async (auth0Client, typeName, connectionId, enabledClientIds) => {
|
|
185
180
|
if (!connectionId || !Array.isArray(enabledClientIds) || !enabledClientIds.length)
|
|
186
181
|
return false;
|
|
187
182
|
const enabledClientUpdatePayloads = enabledClientIds.map((clientId) => ({
|
|
188
183
|
client_id: clientId,
|
|
189
184
|
status: true,
|
|
190
185
|
}));
|
|
191
|
-
const payloadChunks = lodash_1.
|
|
186
|
+
const payloadChunks = (0, lodash_1.chunk)(enabledClientUpdatePayloads, 50);
|
|
192
187
|
try {
|
|
193
|
-
|
|
194
|
-
id: connectionId,
|
|
195
|
-
}, payload)));
|
|
188
|
+
await Promise.all(payloadChunks.map((payload) => auth0Client.connections.clients.update(connectionId, payload)));
|
|
196
189
|
logger_1.default.debug(`Updated enabled clients for ${typeName}: ${connectionId}`);
|
|
197
190
|
return true;
|
|
198
191
|
}
|
|
@@ -200,7 +193,7 @@ const updateConnectionEnabledClients = (auth0Client, typeName, connectionId, ena
|
|
|
200
193
|
logger_1.default.error(`Unable to update enabled clients for ${typeName}: ${connectionId}:`, error);
|
|
201
194
|
return false;
|
|
202
195
|
}
|
|
203
|
-
}
|
|
196
|
+
};
|
|
204
197
|
exports.updateConnectionEnabledClients = updateConnectionEnabledClients;
|
|
205
198
|
/**
|
|
206
199
|
* This function processes enabled clients for create, update, and conflict operations.
|
|
@@ -213,60 +206,64 @@ exports.updateConnectionEnabledClients = updateConnectionEnabledClients;
|
|
|
213
206
|
*
|
|
214
207
|
* @returns A Promise that resolves when all enabled client updates are complete
|
|
215
208
|
*/
|
|
216
|
-
const processConnectionEnabledClients =
|
|
217
|
-
) {
|
|
209
|
+
const processConnectionEnabledClients = async (auth0Client, typeName, changes, delayMs = 2500 // Default delay is 2.5 seconds
|
|
210
|
+
) => {
|
|
218
211
|
const { create, update, conflicts } = changes;
|
|
219
212
|
let createWithId = [];
|
|
220
213
|
if (create.length) {
|
|
221
|
-
|
|
222
|
-
createWithId =
|
|
223
|
-
var _a;
|
|
214
|
+
await (0, utils_1.sleep)(delayMs); // Wait for the configured duration before fetching new connections
|
|
215
|
+
createWithId = await Promise.all(create.map(async (conn) => {
|
|
224
216
|
let newConnections;
|
|
225
217
|
if (typeName === 'database') {
|
|
226
|
-
const { data:
|
|
218
|
+
const { data: connections } = await auth0Client.connections.list({
|
|
227
219
|
name: conn.name,
|
|
228
220
|
take: 1,
|
|
229
|
-
strategy: [auth0_1.
|
|
230
|
-
|
|
221
|
+
strategy: [auth0_1.Management.ConnectionStrategyEnum.Auth0],
|
|
222
|
+
include_fields: true,
|
|
231
223
|
});
|
|
232
224
|
newConnections = connections;
|
|
233
225
|
}
|
|
234
226
|
else {
|
|
235
|
-
const { data:
|
|
227
|
+
const { data: connections } = await auth0Client.connections.list({
|
|
236
228
|
name: conn.name,
|
|
237
229
|
take: 1,
|
|
238
|
-
|
|
230
|
+
include_fields: true,
|
|
239
231
|
});
|
|
240
232
|
newConnections = connections;
|
|
241
233
|
}
|
|
242
234
|
if (newConnections && newConnections.length) {
|
|
243
|
-
conn.id =
|
|
235
|
+
conn.id = newConnections[0]?.id;
|
|
244
236
|
}
|
|
245
237
|
else {
|
|
246
238
|
logger_1.default.warn(`Unable to find ID for newly created ${typeName} '${conn.name}' when updating enabled clients`);
|
|
247
239
|
}
|
|
248
240
|
return conn;
|
|
249
|
-
}))
|
|
241
|
+
}));
|
|
250
242
|
}
|
|
251
243
|
// Process enabled clients for each change type
|
|
252
244
|
// Delete is handled by the `processChanges` method, removed connection completely
|
|
253
|
-
|
|
245
|
+
await Promise.all([
|
|
254
246
|
...createWithId.map((conn) => (0, exports.updateConnectionEnabledClients)(auth0Client, typeName, conn.id, conn.enabled_clients)),
|
|
255
247
|
...update.map((conn) => (0, exports.updateConnectionEnabledClients)(auth0Client, typeName, conn.id, conn.enabled_clients)),
|
|
256
248
|
...conflicts.map((conn) => (0, exports.updateConnectionEnabledClients)(auth0Client, typeName, conn.id, conn.enabled_clients)),
|
|
257
249
|
]);
|
|
258
|
-
}
|
|
250
|
+
};
|
|
259
251
|
exports.processConnectionEnabledClients = processConnectionEnabledClients;
|
|
260
252
|
class ConnectionsHandler extends default_1.default {
|
|
261
253
|
constructor(config) {
|
|
262
|
-
super(
|
|
254
|
+
super({
|
|
255
|
+
...config,
|
|
256
|
+
type: 'connections',
|
|
257
|
+
stripUpdateFields: ['strategy', 'name'],
|
|
258
|
+
functions: {
|
|
263
259
|
// When `connections` is updated, it can result in `update`,`create` or `delete` action on SCIM.
|
|
264
260
|
// Because, `scim_configuration` is inside `connections`.
|
|
265
|
-
update: (requestParams, bodyParams) =>
|
|
261
|
+
update: async (requestParams, bodyParams) => this.scimHandler.updateOverride(requestParams, bodyParams),
|
|
266
262
|
// When a new `connection` is created. We can perform only `create` option on SCIM.
|
|
267
263
|
// When a connection is `deleted`. `scim_configuration` is also deleted along with it; no action on SCIM is required.
|
|
268
|
-
create: (bodyParams) =>
|
|
269
|
-
}
|
|
264
|
+
create: async (bodyParams) => this.scimHandler.createOverride(bodyParams),
|
|
265
|
+
},
|
|
266
|
+
});
|
|
270
267
|
// @ts-ignore
|
|
271
268
|
this.scimHandler = new scimHandler_1.default(this.config, this.client.connections, this.client.pool);
|
|
272
269
|
}
|
|
@@ -276,104 +273,102 @@ class ConnectionsHandler extends default_1.default {
|
|
|
276
273
|
getFormattedOptions(connection, clients) {
|
|
277
274
|
try {
|
|
278
275
|
return {
|
|
279
|
-
options:
|
|
276
|
+
options: {
|
|
277
|
+
...connection.options,
|
|
278
|
+
idpinitiated: {
|
|
279
|
+
...connection.options.idpinitiated,
|
|
280
|
+
client_id: (0, utils_1.convertClientNameToId)(connection.options.idpinitiated.client_id, clients),
|
|
281
|
+
},
|
|
282
|
+
},
|
|
280
283
|
};
|
|
281
284
|
}
|
|
282
285
|
catch (e) {
|
|
283
286
|
return {};
|
|
284
287
|
}
|
|
285
288
|
}
|
|
286
|
-
getType() {
|
|
287
|
-
|
|
288
|
-
if (this.existing)
|
|
289
|
-
return this.existing;
|
|
290
|
-
const connections = yield (0, client_1.paginate)(this.client.connections.getAll, {
|
|
291
|
-
checkpoint: true,
|
|
292
|
-
include_totals: true,
|
|
293
|
-
});
|
|
294
|
-
// Filter out database connections as we have separate handler for it
|
|
295
|
-
const filteredConnections = connections.filter((c) => c.strategy !== 'auth0');
|
|
296
|
-
// If options option is empty for all connection, log the missing options scope.
|
|
297
|
-
const isOptionExists = filteredConnections.every((c) => c.options && Object.keys(c.options).length > 0);
|
|
298
|
-
if (!isOptionExists) {
|
|
299
|
-
logger_1.default.warn(`Insufficient scope the read:connections_options scope is required to get ${this.type} options.`);
|
|
300
|
-
}
|
|
301
|
-
this.existing = filteredConnections;
|
|
302
|
-
if (this.existing === null)
|
|
303
|
-
return [];
|
|
304
|
-
const connectionsWithEnabledClients = yield Promise.all(filteredConnections.map((con) => __awaiter(this, void 0, void 0, function* () {
|
|
305
|
-
const enabledClients = yield (0, exports.getConnectionEnabledClients)(this.client, con.id);
|
|
306
|
-
if (enabledClients && (enabledClients === null || enabledClients === void 0 ? void 0 : enabledClients.length)) {
|
|
307
|
-
return Object.assign(Object.assign({}, con), { enabled_clients: enabledClients });
|
|
308
|
-
}
|
|
309
|
-
return con;
|
|
310
|
-
})));
|
|
311
|
-
this.existing = connectionsWithEnabledClients;
|
|
312
|
-
// Apply `scim_configuration` to all the relevant `SCIM` connections. This method mutates `this.existing`.
|
|
313
|
-
yield this.scimHandler.applyScimConfiguration(this.existing);
|
|
289
|
+
async getType() {
|
|
290
|
+
if (this.existing)
|
|
314
291
|
return this.existing;
|
|
292
|
+
const connections = await (0, client_1.paginate)(this.client.connections.list, {
|
|
293
|
+
checkpoint: true,
|
|
315
294
|
});
|
|
295
|
+
// Filter out database connections as we have separate handler for it
|
|
296
|
+
const filteredConnections = connections.filter((c) => c.strategy !== 'auth0');
|
|
297
|
+
// If options option is empty for all connection, log the missing options scope.
|
|
298
|
+
const isOptionExists = filteredConnections.every((c) => c.options && Object.keys(c.options).length > 0);
|
|
299
|
+
if (!isOptionExists) {
|
|
300
|
+
logger_1.default.warn(`Insufficient scope the read:connections_options scope is required to get ${this.type} options.`);
|
|
301
|
+
}
|
|
302
|
+
this.existing = filteredConnections;
|
|
303
|
+
if (this.existing === null)
|
|
304
|
+
return [];
|
|
305
|
+
const connectionsWithEnabledClients = await Promise.all(filteredConnections.map(async (con) => {
|
|
306
|
+
if (!con?.id)
|
|
307
|
+
return con;
|
|
308
|
+
const enabledClients = await (0, exports.getConnectionEnabledClients)(this.client, con.id);
|
|
309
|
+
if (enabledClients && enabledClients?.length) {
|
|
310
|
+
return { ...con, enabled_clients: enabledClients };
|
|
311
|
+
}
|
|
312
|
+
return con;
|
|
313
|
+
}));
|
|
314
|
+
this.existing = connectionsWithEnabledClients;
|
|
315
|
+
// Apply `scim_configuration` to all the relevant `SCIM` connections. This method mutates `this.existing`.
|
|
316
|
+
await this.scimHandler.applyScimConfiguration(this.existing);
|
|
317
|
+
return this.existing;
|
|
316
318
|
}
|
|
317
|
-
calcChanges(assets) {
|
|
318
|
-
const
|
|
319
|
-
|
|
319
|
+
async calcChanges(assets) {
|
|
320
|
+
const { connections } = assets;
|
|
321
|
+
// Do nothing if not set
|
|
322
|
+
if (!connections)
|
|
323
|
+
return {
|
|
324
|
+
del: [],
|
|
325
|
+
create: [],
|
|
326
|
+
update: [],
|
|
327
|
+
conflicts: [],
|
|
328
|
+
};
|
|
329
|
+
// Convert enabled_clients by name to the id
|
|
330
|
+
const clients = await (0, client_1.paginate)(this.client.clients.list, {
|
|
331
|
+
paginate: true,
|
|
332
|
+
include_totals: true,
|
|
320
333
|
});
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
if (!connections)
|
|
325
|
-
return {
|
|
326
|
-
del: [],
|
|
327
|
-
create: [],
|
|
328
|
-
update: [],
|
|
329
|
-
conflicts: [],
|
|
330
|
-
};
|
|
331
|
-
// Convert enabled_clients by name to the id
|
|
332
|
-
const clients = yield (0, client_1.paginate)(this.client.clients.getAll, {
|
|
333
|
-
paginate: true,
|
|
334
|
-
include_totals: true,
|
|
335
|
-
});
|
|
336
|
-
const existingConnections = yield (0, client_1.paginate)(this.client.connections.getAll, {
|
|
337
|
-
checkpoint: true,
|
|
338
|
-
include_totals: true,
|
|
339
|
-
});
|
|
340
|
-
// Prepare an id map. We'll use this map later to get the `strategy` and SCIM enable status of the connections.
|
|
341
|
-
yield this.scimHandler.createIdMap(existingConnections);
|
|
342
|
-
const formatted = connections.map((connection) => (Object.assign(Object.assign(Object.assign({}, connection), this.getFormattedOptions(connection, clients)), { enabled_clients: (0, utils_1.getEnabledClients)(assets, connection, existingConnections, clients) })));
|
|
343
|
-
const proposedChanges = yield _super.calcChanges.call(this, Object.assign(Object.assign({}, assets), { connections: formatted }));
|
|
344
|
-
const proposedChangesWithExcludedProperties = (0, exports.addExcludedConnectionPropertiesToChanges)({
|
|
345
|
-
proposedChanges,
|
|
346
|
-
existingConnections,
|
|
347
|
-
config: this.config,
|
|
348
|
-
});
|
|
349
|
-
return proposedChangesWithExcludedProperties;
|
|
334
|
+
const existingConnections = await (0, client_1.paginate)(this.client.connections.list, {
|
|
335
|
+
checkpoint: true,
|
|
336
|
+
include_totals: true,
|
|
350
337
|
});
|
|
338
|
+
// Prepare an id map. We'll use this map later to get the `strategy` and SCIM enable status of the connections.
|
|
339
|
+
await this.scimHandler.createIdMap(existingConnections);
|
|
340
|
+
const formatted = connections.map((connection) => ({
|
|
341
|
+
...connection,
|
|
342
|
+
...this.getFormattedOptions(connection, clients),
|
|
343
|
+
enabled_clients: (0, utils_1.getEnabledClients)(assets, connection, existingConnections, clients),
|
|
344
|
+
}));
|
|
345
|
+
const proposedChanges = await super.calcChanges({ ...assets, connections: formatted });
|
|
346
|
+
const proposedChangesWithExcludedProperties = (0, exports.addExcludedConnectionPropertiesToChanges)({
|
|
347
|
+
proposedChanges,
|
|
348
|
+
existingConnections,
|
|
349
|
+
config: this.config,
|
|
350
|
+
});
|
|
351
|
+
return proposedChangesWithExcludedProperties;
|
|
351
352
|
}
|
|
352
353
|
// Run after clients are updated so we can convert all the enabled_clients names to id's
|
|
353
|
-
processChanges(assets) {
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const changes = yield this.calcChanges(assets);
|
|
369
|
-
yield _super.processChanges.call(this, assets, (0, utils_1.filterExcluded)(changes, excludedConnections));
|
|
370
|
-
// process enabled clients
|
|
371
|
-
yield (0, exports.processConnectionEnabledClients)(this.client, this.type, (0, utils_1.filterExcluded)(changes, excludedConnections));
|
|
372
|
-
});
|
|
354
|
+
async processChanges(assets) {
|
|
355
|
+
const { connections } = assets;
|
|
356
|
+
// Do nothing if not set
|
|
357
|
+
if (!connections)
|
|
358
|
+
return;
|
|
359
|
+
// If options option is empty for all connection, log the missing options scope.
|
|
360
|
+
const isOptionExists = connections.every((c) => c.options && Object.keys(c.options).length > 0);
|
|
361
|
+
if (!isOptionExists) {
|
|
362
|
+
logger_1.default.warn(`Insufficient scope the update:connections_options scope is required to update ${this.type} options.`);
|
|
363
|
+
}
|
|
364
|
+
const excludedConnections = (assets.exclude && assets.exclude.connections) || [];
|
|
365
|
+
const changes = await this.calcChanges(assets);
|
|
366
|
+
await super.processChanges(assets, (0, utils_1.filterExcluded)(changes, excludedConnections));
|
|
367
|
+
// process enabled clients
|
|
368
|
+
await (0, exports.processConnectionEnabledClients)(this.client, this.type, (0, utils_1.filterExcluded)(changes, excludedConnections));
|
|
373
369
|
}
|
|
374
370
|
}
|
|
375
371
|
exports.default = ConnectionsHandler;
|
|
376
372
|
__decorate([
|
|
377
373
|
(0, default_1.order)('60')
|
|
378
374
|
], ConnectionsHandler.prototype, "processChanges", null);
|
|
379
|
-
//# sourceMappingURL=connections.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Management } from 'auth0';
|
|
1
2
|
import DefaultAPIHandler from './default';
|
|
2
3
|
import { Asset, Assets } from '../../../types';
|
|
3
4
|
export declare const schema: {
|
|
@@ -50,10 +51,12 @@ export declare const schema: {
|
|
|
50
51
|
required: string[];
|
|
51
52
|
};
|
|
52
53
|
};
|
|
54
|
+
type CustomDomain = Management.CustomDomain;
|
|
53
55
|
export default class CustomDomainsHadnler extends DefaultAPIHandler {
|
|
54
|
-
existing:
|
|
56
|
+
existing: CustomDomain[] | null;
|
|
55
57
|
constructor(config: DefaultAPIHandler);
|
|
56
58
|
objString(item: Asset): string;
|
|
57
59
|
getType(): Promise<Asset | null>;
|
|
58
60
|
processChanges(assets: Assets): Promise<void>;
|
|
59
61
|
}
|
|
62
|
+
export {};
|
|
@@ -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
|
};
|
|
@@ -93,14 +84,20 @@ exports.schema = {
|
|
|
93
84
|
};
|
|
94
85
|
class CustomDomainsHadnler extends default_1.default {
|
|
95
86
|
constructor(config) {
|
|
96
|
-
super(
|
|
87
|
+
super({
|
|
88
|
+
...config,
|
|
89
|
+
type: 'customDomains',
|
|
90
|
+
id: 'custom_domain_id',
|
|
91
|
+
identifiers: ['custom_domain_id', 'domain'],
|
|
92
|
+
stripCreateFields: [
|
|
97
93
|
'status',
|
|
98
94
|
'primary',
|
|
99
95
|
'verification',
|
|
100
96
|
'certificate',
|
|
101
97
|
'created_at',
|
|
102
98
|
'updated_at',
|
|
103
|
-
],
|
|
99
|
+
],
|
|
100
|
+
stripUpdateFields: [
|
|
104
101
|
'status',
|
|
105
102
|
'primary',
|
|
106
103
|
'verification',
|
|
@@ -110,58 +107,51 @@ class CustomDomainsHadnler extends default_1.default {
|
|
|
110
107
|
'certificate',
|
|
111
108
|
'created_at',
|
|
112
109
|
'updated_at',
|
|
113
|
-
],
|
|
114
|
-
|
|
115
|
-
update: (args, data) => this.client.customDomains.update(
|
|
116
|
-
}
|
|
110
|
+
],
|
|
111
|
+
functions: {
|
|
112
|
+
update: (args, data) => this.client.customDomains.update(args.custom_domain_id, data),
|
|
113
|
+
},
|
|
114
|
+
});
|
|
117
115
|
}
|
|
118
116
|
objString(item) {
|
|
119
117
|
return super.objString(item.domain);
|
|
120
118
|
}
|
|
121
|
-
getType() {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return this.existing;
|
|
126
|
-
}
|
|
127
|
-
const customDomains = yield (0, client_1.paginate)(this.client.customDomains.getAll, {
|
|
128
|
-
checkpoint: true,
|
|
129
|
-
});
|
|
130
|
-
this.existing = customDomains;
|
|
131
|
-
return customDomains;
|
|
119
|
+
async getType() {
|
|
120
|
+
try {
|
|
121
|
+
if (this.existing) {
|
|
122
|
+
return this.existing;
|
|
132
123
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
124
|
+
const customDomains = await (0, client_1.paginate)(this.client.customDomains.list, {
|
|
125
|
+
checkpoint: true,
|
|
126
|
+
});
|
|
127
|
+
this.existing = customDomains;
|
|
128
|
+
return customDomains;
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
if (err.statusCode === 403 &&
|
|
132
|
+
err.message ===
|
|
133
|
+
'The account is not allowed to perform this operation, please contact our support team') {
|
|
134
|
+
return null;
|
|
140
135
|
}
|
|
141
|
-
|
|
136
|
+
throw err;
|
|
137
|
+
}
|
|
142
138
|
}
|
|
143
|
-
processChanges(assets) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
logger_1.default.warn('The "verification_method" field is deprecated and may be removed in future versions for "customDomains"');
|
|
157
|
-
}
|
|
158
|
-
const changes = yield this.calcChanges(assets);
|
|
159
|
-
yield _super.processChanges.call(this, assets, changes);
|
|
160
|
-
});
|
|
139
|
+
async processChanges(assets) {
|
|
140
|
+
const { customDomains } = assets;
|
|
141
|
+
if (!customDomains)
|
|
142
|
+
return;
|
|
143
|
+
// Deprecation warnings for custom domains
|
|
144
|
+
if (customDomains.some((customDomain) => customDomain.primary != null)) {
|
|
145
|
+
logger_1.default.warn('The "primary" field is deprecated and may be removed in future versions for "customDomains"');
|
|
146
|
+
}
|
|
147
|
+
if (customDomains.some((customDomain) => 'verification_method' in customDomain)) {
|
|
148
|
+
logger_1.default.warn('The "verification_method" field is deprecated and may be removed in future versions for "customDomains"');
|
|
149
|
+
}
|
|
150
|
+
const changes = await this.calcChanges(assets);
|
|
151
|
+
await super.processChanges(assets, changes);
|
|
161
152
|
}
|
|
162
153
|
}
|
|
163
154
|
exports.default = CustomDomainsHadnler;
|
|
164
155
|
__decorate([
|
|
165
156
|
(0, default_1.order)('50')
|
|
166
157
|
], CustomDomainsHadnler.prototype, "processChanges", null);
|
|
167
|
-
//# sourceMappingURL=customDomains.js.map
|