auth0-deploy-cli 8.22.0 → 8.23.1
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 +41 -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 +102 -145
- 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 +350 -431
- 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 +221 -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 +149 -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 +263 -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,24 +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
|
-
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
|
};
|
|
@@ -46,76 +26,73 @@ exports.schema = {
|
|
|
46
26
|
};
|
|
47
27
|
class GuardianFactorProvidersHandler extends default_1.default {
|
|
48
28
|
constructor(options) {
|
|
49
|
-
super(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (this.existing)
|
|
54
|
-
return this.existing;
|
|
55
|
-
try {
|
|
56
|
-
const data = yield Promise.all(mappings.map((m) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
let provider;
|
|
58
|
-
// TODO: This is quite a change, needs to be validated for sure.
|
|
59
|
-
if (m.name === 'phone' && m.provider === 'twilio') {
|
|
60
|
-
provider = yield this.client.guardian.getPhoneFactorProviderTwilio();
|
|
61
|
-
}
|
|
62
|
-
else if (m.name === 'sms' && m.provider === 'twilio') {
|
|
63
|
-
provider = yield this.client.guardian.getSmsFactorProviderTwilio();
|
|
64
|
-
}
|
|
65
|
-
else if (m.name === 'push-notification' && m.provider === 'apns') {
|
|
66
|
-
provider = yield this.client.guardian.getPushNotificationProviderAPNS();
|
|
67
|
-
}
|
|
68
|
-
else if (m.name === 'push-notification' && m.provider === 'sns') {
|
|
69
|
-
provider = yield this.client.guardian.getPushNotificationProviderSNS();
|
|
70
|
-
}
|
|
71
|
-
return Object.assign(Object.assign({}, m), provider.data);
|
|
72
|
-
})));
|
|
73
|
-
// Filter out empty, should have more then 2 keys (name, provider)
|
|
74
|
-
return data.filter((d) => Object.keys(d).length > 2);
|
|
75
|
-
}
|
|
76
|
-
catch (err) {
|
|
77
|
-
if (err.statusCode === 404 || err.statusCode === 501) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
throw err;
|
|
84
|
-
}
|
|
29
|
+
super({
|
|
30
|
+
...options,
|
|
31
|
+
type: 'guardianFactorProviders',
|
|
32
|
+
id: 'name',
|
|
85
33
|
});
|
|
86
34
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
yield Promise.all(guardianFactorProviders.map((factorProvider) => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
const { name, provider } = factorProvider, data = __rest(factorProvider, ["name", "provider"]);
|
|
97
|
-
const params = { name: factorProvider.name, provider: factorProvider.provider };
|
|
98
|
-
// TODO: This is quite a change, needs to be validated for sure.
|
|
99
|
-
if (name === 'phone' && provider === 'twilio') {
|
|
100
|
-
yield this.client.guardian.updatePhoneFactorProviderTwilio(data);
|
|
35
|
+
async getType() {
|
|
36
|
+
if (this.existing)
|
|
37
|
+
return this.existing;
|
|
38
|
+
try {
|
|
39
|
+
const data = await Promise.all(mappings.map(async (m) => {
|
|
40
|
+
let provider;
|
|
41
|
+
if (m.name === 'phone' && m.provider === 'twilio') {
|
|
42
|
+
provider = await this.client.guardian.factors.phone.getTwilioProvider();
|
|
101
43
|
}
|
|
102
|
-
else if (name === 'sms' && provider === 'twilio') {
|
|
103
|
-
|
|
44
|
+
else if (m.name === 'sms' && m.provider === 'twilio') {
|
|
45
|
+
provider = await this.client.guardian.factors.sms.getTwilioProvider();
|
|
104
46
|
}
|
|
105
|
-
else if (name === 'push-notification' && provider === 'apns') {
|
|
106
|
-
|
|
47
|
+
else if (m.name === 'push-notification' && m.provider === 'apns') {
|
|
48
|
+
provider = await this.client.guardian.factors.pushNotification.getApnsProvider();
|
|
107
49
|
}
|
|
108
|
-
else if (name === 'push-notification' && provider === '
|
|
109
|
-
|
|
50
|
+
else if (m.name === 'push-notification' && m.provider === 'sns') {
|
|
51
|
+
provider = await this.client.guardian.factors.pushNotification.getSnsProvider();
|
|
110
52
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
53
|
+
return { ...m, ...provider.data };
|
|
54
|
+
}));
|
|
55
|
+
// Filter out empty, should have more then 2 keys (name, provider)
|
|
56
|
+
return data.filter((d) => Object.keys(d).length > 2);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
if (err.statusCode === 404 || err.statusCode === 501) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
throw err;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async processChanges(assets) {
|
|
69
|
+
// No API to delete or create guardianFactorProviders, we can only update.
|
|
70
|
+
const { guardianFactorProviders } = assets;
|
|
71
|
+
// Do nothing if not set
|
|
72
|
+
if (!guardianFactorProviders || !guardianFactorProviders.length)
|
|
73
|
+
return;
|
|
74
|
+
// Process each factor
|
|
75
|
+
await Promise.all(guardianFactorProviders.map(async (factorProvider) => {
|
|
76
|
+
const { name, provider, ...data } = factorProvider;
|
|
77
|
+
const params = { name: factorProvider.name, provider: factorProvider.provider };
|
|
78
|
+
if (name === 'phone' && provider === 'twilio') {
|
|
79
|
+
await this.client.guardian.factors.phone.setTwilioProvider(data);
|
|
80
|
+
}
|
|
81
|
+
else if (name === 'sms' && provider === 'twilio') {
|
|
82
|
+
await this.client.guardian.factors.sms.setTwilioProvider(data);
|
|
83
|
+
}
|
|
84
|
+
else if (name === 'push-notification' && provider === 'apns') {
|
|
85
|
+
await this.client.guardian.factors.pushNotification.setApnsProvider(data);
|
|
86
|
+
}
|
|
87
|
+
else if (name === 'push-notification' && provider === 'fcm') {
|
|
88
|
+
await this.client.guardian.factors.pushNotification.setFcmProvider(data);
|
|
89
|
+
}
|
|
90
|
+
else if (name === 'push-notification' && provider === 'sns') {
|
|
91
|
+
await this.client.guardian.factors.pushNotification.setSnsProvider(data);
|
|
92
|
+
}
|
|
93
|
+
this.didUpdate(params);
|
|
94
|
+
this.updated += 1;
|
|
95
|
+
}));
|
|
118
96
|
}
|
|
119
97
|
}
|
|
120
98
|
exports.default = GuardianFactorProvidersHandler;
|
|
121
|
-
//# sourceMappingURL=guardianFactorProviders.js.map
|
|
@@ -1,24 +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
|
-
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
|
};
|
|
@@ -39,58 +19,56 @@ exports.schema = {
|
|
|
39
19
|
};
|
|
40
20
|
class GuardianFactorTemplatesHandler extends default_1.default {
|
|
41
21
|
constructor(options) {
|
|
42
|
-
super(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (this.existing)
|
|
47
|
-
return this.existing;
|
|
48
|
-
try {
|
|
49
|
-
const data = yield Promise.all(constants_1.default.GUARDIAN_FACTOR_TEMPLATES.map((name) => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
if (name === 'sms') {
|
|
51
|
-
const { data: templates } = yield this.client.guardian.getSmsFactorTemplates();
|
|
52
|
-
return Object.assign({ name }, templates);
|
|
53
|
-
}
|
|
54
|
-
const { data: templates } = yield this.client.guardian.getPhoneFactorTemplates();
|
|
55
|
-
return Object.assign({ name }, templates);
|
|
56
|
-
})));
|
|
57
|
-
// Filter out empty, should have more then 1 keys (name)
|
|
58
|
-
return data.filter((d) => Object.keys(d).length > 1);
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
if (err.statusCode === 404 || err.statusCode === 501) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
throw err;
|
|
68
|
-
}
|
|
22
|
+
super({
|
|
23
|
+
...options,
|
|
24
|
+
type: 'guardianFactorTemplates',
|
|
25
|
+
id: 'name',
|
|
69
26
|
});
|
|
70
27
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (!guardianFactorTemplates || !guardianFactorTemplates.length)
|
|
77
|
-
return;
|
|
78
|
-
// Process each factor templates
|
|
79
|
-
yield Promise.all(guardianFactorTemplates.map((fatorTemplates) => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
const { name } = fatorTemplates, data = __rest(fatorTemplates, ["name"]);
|
|
81
|
-
const params = { name: fatorTemplates.name };
|
|
82
|
-
// TODO: This is quite a change, needs to be validated for sure.
|
|
28
|
+
async getType() {
|
|
29
|
+
if (this.existing)
|
|
30
|
+
return this.existing;
|
|
31
|
+
try {
|
|
32
|
+
const data = await Promise.all(constants_1.default.GUARDIAN_FACTOR_TEMPLATES.map(async (name) => {
|
|
83
33
|
if (name === 'sms') {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
else if (name === 'phone') {
|
|
87
|
-
yield this.client.guardian.setPhoneFactorTemplates(data);
|
|
34
|
+
const templates = await this.client.guardian.factors.sms.getTemplates();
|
|
35
|
+
return { name, ...templates };
|
|
88
36
|
}
|
|
89
|
-
this.
|
|
90
|
-
|
|
91
|
-
}))
|
|
92
|
-
|
|
37
|
+
const templates = await this.client.guardian.factors.phone.getTemplates();
|
|
38
|
+
return { name, ...templates };
|
|
39
|
+
}));
|
|
40
|
+
// Filter out empty, should have more then 1 keys (name)
|
|
41
|
+
return data.filter((d) => Object.keys(d).length > 1);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (err.statusCode === 404 || err.statusCode === 501) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async processChanges(assets) {
|
|
54
|
+
// No API to delete or create guardianFactorTemplates, we can only update.
|
|
55
|
+
const { guardianFactorTemplates } = assets;
|
|
56
|
+
// Do nothing if not set
|
|
57
|
+
if (!guardianFactorTemplates || !guardianFactorTemplates.length)
|
|
58
|
+
return;
|
|
59
|
+
// Process each factor templates
|
|
60
|
+
await Promise.all(guardianFactorTemplates.map(async (fatorTemplates) => {
|
|
61
|
+
const { name, ...data } = fatorTemplates;
|
|
62
|
+
const params = { name: fatorTemplates.name };
|
|
63
|
+
if (name === 'sms') {
|
|
64
|
+
await this.client.guardian.factors.sms.setTemplates(data);
|
|
65
|
+
}
|
|
66
|
+
else if (name === 'phone') {
|
|
67
|
+
await this.client.guardian.factors.phone.setTemplates(data);
|
|
68
|
+
}
|
|
69
|
+
this.didUpdate(params);
|
|
70
|
+
this.updated += 1;
|
|
71
|
+
}));
|
|
93
72
|
}
|
|
94
73
|
}
|
|
95
74
|
exports.default = GuardianFactorTemplatesHandler;
|
|
96
|
-
//# sourceMappingURL=guardianFactorTemplates.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -28,46 +19,45 @@ exports.schema = {
|
|
|
28
19
|
};
|
|
29
20
|
class GuardianFactorsHandler extends default_1.default {
|
|
30
21
|
constructor(options) {
|
|
31
|
-
super(
|
|
22
|
+
super({
|
|
23
|
+
...options,
|
|
24
|
+
type: 'guardianFactors',
|
|
25
|
+
id: 'name',
|
|
26
|
+
});
|
|
32
27
|
}
|
|
33
|
-
getType() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
async getType() {
|
|
29
|
+
if (this.existing)
|
|
30
|
+
return this.existing;
|
|
31
|
+
try {
|
|
32
|
+
const factors = await this.client.guardian.factors.list();
|
|
33
|
+
this.existing = factors;
|
|
34
|
+
return this.existing;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
if (err.statusCode === 404 || err.statusCode === 501) {
|
|
38
|
+
return null;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
throw err;
|
|
40
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
41
|
+
return null;
|
|
50
42
|
}
|
|
51
|
-
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
52
45
|
}
|
|
53
|
-
processChanges(assets) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})));
|
|
69
|
-
});
|
|
46
|
+
async processChanges(assets) {
|
|
47
|
+
// No API to delete or create guardianFactors, we can only update.
|
|
48
|
+
const { guardianFactors } = assets;
|
|
49
|
+
// Do nothing if not set
|
|
50
|
+
if (!guardianFactors || !guardianFactors.length)
|
|
51
|
+
return;
|
|
52
|
+
// Process each factor
|
|
53
|
+
await Promise.all(guardianFactors.map(async (factor) => {
|
|
54
|
+
const data = { ...factor };
|
|
55
|
+
const params = { name: factor.name };
|
|
56
|
+
delete data.name;
|
|
57
|
+
await this.client.guardian.factors.set(params.name, data);
|
|
58
|
+
this.didUpdate(params);
|
|
59
|
+
this.updated += 1;
|
|
60
|
+
}));
|
|
70
61
|
}
|
|
71
62
|
}
|
|
72
63
|
exports.default = GuardianFactorsHandler;
|
|
73
|
-
//# sourceMappingURL=guardianFactors.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -46,47 +37,40 @@ const isFeatureUnavailableError = (err) => {
|
|
|
46
37
|
};
|
|
47
38
|
class GuardianPhoneMessageTypesHandler extends default_1.default {
|
|
48
39
|
constructor(options) {
|
|
49
|
-
super(
|
|
40
|
+
super({
|
|
41
|
+
...options,
|
|
42
|
+
type: 'guardianPhoneFactorMessageTypes',
|
|
43
|
+
});
|
|
50
44
|
}
|
|
51
|
-
getType() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
async getType() {
|
|
46
|
+
if (this.existing)
|
|
47
|
+
return this.existing;
|
|
48
|
+
try {
|
|
49
|
+
const data = await this.client.guardian.factors.phone.getMessageTypes();
|
|
50
|
+
this.existing = data;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
if (isFeatureUnavailableError(err)) {
|
|
54
|
+
// Gracefully skip processing this configuration value.
|
|
56
55
|
return null;
|
|
57
56
|
}
|
|
58
|
-
if (this.
|
|
59
|
-
return
|
|
60
|
-
try {
|
|
61
|
-
const { data } = yield this.client.guardian.getPhoneFactorMessageTypes();
|
|
62
|
-
this.existing = data;
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
if (isFeatureUnavailableError(err)) {
|
|
66
|
-
// Gracefully skip processing this configuration value.
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
throw err;
|
|
57
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
58
|
+
return null;
|
|
73
59
|
}
|
|
74
|
-
|
|
75
|
-
}
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
return this.existing;
|
|
76
63
|
}
|
|
77
|
-
processChanges(assets) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.didUpdate(guardianPhoneFactorMessageTypes);
|
|
88
|
-
});
|
|
64
|
+
async processChanges(assets) {
|
|
65
|
+
// No API to delete or create guardianPhoneFactorMessageTypes, we can only update.
|
|
66
|
+
const { guardianPhoneFactorMessageTypes } = assets;
|
|
67
|
+
// Do nothing if not set
|
|
68
|
+
if (!guardianPhoneFactorMessageTypes || !guardianPhoneFactorMessageTypes.message_types)
|
|
69
|
+
return;
|
|
70
|
+
const data = guardianPhoneFactorMessageTypes;
|
|
71
|
+
await this.client.guardian.factors.phone.setMessageTypes(data);
|
|
72
|
+
this.updated += 1;
|
|
73
|
+
this.didUpdate(guardianPhoneFactorMessageTypes);
|
|
89
74
|
}
|
|
90
75
|
}
|
|
91
76
|
exports.default = GuardianPhoneMessageTypesHandler;
|
|
92
|
-
//# sourceMappingURL=guardianPhoneFactorMessageTypes.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -43,47 +34,40 @@ const isFeatureUnavailableError = (err) => {
|
|
|
43
34
|
};
|
|
44
35
|
class GuardianPhoneSelectedProviderHandler extends default_1.default {
|
|
45
36
|
constructor(options) {
|
|
46
|
-
super(
|
|
37
|
+
super({
|
|
38
|
+
...options,
|
|
39
|
+
type: 'guardianPhoneFactorSelectedProvider',
|
|
40
|
+
});
|
|
47
41
|
}
|
|
48
|
-
getType() {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
async getType() {
|
|
43
|
+
if (this.existing)
|
|
44
|
+
return this.existing;
|
|
45
|
+
try {
|
|
46
|
+
const data = await this.client.guardian.factors.phone.getSelectedProvider();
|
|
47
|
+
this.existing = data;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if (isFeatureUnavailableError(err)) {
|
|
51
|
+
// Gracefully skip processing this configuration value.
|
|
53
52
|
return null;
|
|
54
53
|
}
|
|
55
|
-
if (this.
|
|
56
|
-
return
|
|
57
|
-
try {
|
|
58
|
-
const { data } = yield this.client.guardian.getPhoneFactorSelectedProvider();
|
|
59
|
-
this.existing = data;
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
if (isFeatureUnavailableError(err)) {
|
|
63
|
-
// Gracefully skip processing this configuration value.
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
throw err;
|
|
54
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
55
|
+
return null;
|
|
70
56
|
}
|
|
71
|
-
|
|
72
|
-
}
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
return this.existing;
|
|
73
60
|
}
|
|
74
|
-
processChanges(assets) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.didUpdate(guardianPhoneFactorSelectedProvider);
|
|
85
|
-
});
|
|
61
|
+
async processChanges(assets) {
|
|
62
|
+
// No API to delete or create guardianPhoneFactorSelectedProvider, we can only update.
|
|
63
|
+
const { guardianPhoneFactorSelectedProvider } = assets;
|
|
64
|
+
// Do nothing if not set
|
|
65
|
+
if (!guardianPhoneFactorSelectedProvider || !guardianPhoneFactorSelectedProvider.provider)
|
|
66
|
+
return;
|
|
67
|
+
const data = guardianPhoneFactorSelectedProvider;
|
|
68
|
+
await this.client.guardian.factors.phone.setProvider(data);
|
|
69
|
+
this.updated += 1;
|
|
70
|
+
this.didUpdate(guardianPhoneFactorSelectedProvider);
|
|
86
71
|
}
|
|
87
72
|
}
|
|
88
73
|
exports.default = GuardianPhoneSelectedProviderHandler;
|
|
89
|
-
//# sourceMappingURL=guardianPhoneFactorSelectedProvider.js.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -30,35 +21,29 @@ exports.schema = {
|
|
|
30
21
|
};
|
|
31
22
|
class GuardianPoliciesHandler extends default_1.default {
|
|
32
23
|
constructor(options) {
|
|
33
|
-
super(
|
|
24
|
+
super({
|
|
25
|
+
...options,
|
|
26
|
+
type: 'guardianPolicies',
|
|
27
|
+
});
|
|
34
28
|
}
|
|
35
|
-
//TODO: standardize empty object literal with more intentional empty indicator
|
|
36
|
-
getType() {
|
|
37
|
-
|
|
38
|
-
// in case client version does not support the operation
|
|
39
|
-
if (!this.client.guardian || typeof this.client.guardian.getPolicies !== 'function') {
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
if (this.existing)
|
|
43
|
-
return this.existing;
|
|
44
|
-
const { data: policies } = yield this.client.guardian.getPolicies();
|
|
45
|
-
this.existing = { policies };
|
|
29
|
+
// TODO: standardize empty object literal with more intentional empty indicator
|
|
30
|
+
async getType() {
|
|
31
|
+
if (this.existing)
|
|
46
32
|
return this.existing;
|
|
47
|
-
|
|
33
|
+
const policies = await this.client.guardian.policies.list();
|
|
34
|
+
this.existing = { policies };
|
|
35
|
+
return this.existing;
|
|
48
36
|
}
|
|
49
|
-
processChanges(assets) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.didUpdate(guardianPolicies);
|
|
60
|
-
});
|
|
37
|
+
async processChanges(assets) {
|
|
38
|
+
// No API to delete or create guardianPolicies, we can only update.
|
|
39
|
+
const { guardianPolicies } = assets;
|
|
40
|
+
// Do nothing if not set
|
|
41
|
+
if (!guardianPolicies || !guardianPolicies.policies)
|
|
42
|
+
return;
|
|
43
|
+
const data = guardianPolicies.policies;
|
|
44
|
+
await this.client.guardian.policies.set(data);
|
|
45
|
+
this.updated += 1;
|
|
46
|
+
this.didUpdate(guardianPolicies);
|
|
61
47
|
}
|
|
62
48
|
}
|
|
63
49
|
exports.default = GuardianPoliciesHandler;
|
|
64
|
-
//# sourceMappingURL=guardianPolicies.js.map
|