UNPKG

@aws-amplify/amplify-category-auth

Version:

amplify-cli authentication plugin

31 lines 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.legacyAuthConfigHasTriggers = void 0; const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core"); const legacyAuthConfigHasTriggers = (authResourceName) => { const authParams = amplify_cli_core_1.stateManager.getResourceParametersJson(undefined, amplify_cli_core_1.AmplifyCategories.AUTH, authResourceName, { throwIfNotExist: false, }); if (authParams === null || authParams === undefined || typeof authParams !== 'object' || !('triggers' in authParams) || typeof authParams.triggers !== 'string') { return false; } try { const triggerConfig = JSON.parse(authParams.triggers); if (triggerConfig === null || typeof triggerConfig !== 'object') { return false; } if (Object.keys(triggerConfig).length > 0) { return true; } return false; } catch (_a) { return false; } }; exports.legacyAuthConfigHasTriggers = legacyAuthConfigHasTriggers; //# sourceMappingURL=legacyAuthConfigHasTriggers.js.map