@rockcarver/frodo-lib 0.17.2-0 → 0.17.3
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/CHANGELOG.md +9 -1
- package/cjs/api/AgentApi.js +1 -1
- package/cjs/api/AgentApi.js.map +1 -1
- package/cjs/api/AgentApi.test.js.map +1 -1
- package/cjs/api/ApiTypes.js +16 -16
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/AuthenticateApi.js +17 -12
- package/cjs/api/AuthenticateApi.js.map +1 -1
- package/cjs/api/AuthenticateApi.test.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +28 -7
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/NodeApi.test.js.map +1 -1
- package/cjs/api/SecretsApi.test.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +22 -0
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/api/TreeApi.test.js.map +1 -1
- package/cjs/api/VariablesApi.test.js.map +1 -1
- package/cjs/api/utils/ApiUtils.js +13 -4
- package/cjs/api/utils/ApiUtils.js.map +1 -1
- package/cjs/api/utils/ApiUtils.test.js.map +1 -1
- package/cjs/index.js +3 -1
- package/cjs/index.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +0 -7
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
- package/cjs/ops/IdmOps.test.js.map +1 -1
- package/cjs/ops/IdpOps.js +182 -275
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/IdpOps.test.js.map +1 -1
- package/cjs/ops/SecretsOps.js +3 -3
- package/cjs/ops/SecretsOps.js.map +1 -1
- package/cjs/ops/VariablesOps.js +3 -3
- package/cjs/ops/VariablesOps.js.map +1 -1
- package/cjs/shared/State.js +1 -1
- package/cjs/shared/State.js.map +1 -1
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent1.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/{ig_chico.json → FrodoOpsTestGatewayAgent2.json} +0 -2
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent3.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/{ig_mytestrun_com.json → FrodoOpsTestGatewayAgent4.json} +0 -2
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/api_client.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent5.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/{api_client.json → FrodoOpsTestGatewayAgent6.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent7.json +20 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent8.json +20 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent9.json +30 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoTestGatewayAgent1.json +30 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoTestGatewayAgent2.json +20 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoTestGatewayAgent3.json +20 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/{javaAgent.json → FrodoOpsTestJavaAgent1.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/{tomcatagent.json → FrodoOpsTestJavaAgent2.json} +0 -2
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/tomcatagent.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent3.json} +0 -2
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/javaAgent.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent4.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent5.json +621 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent6.json +628 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent7.json +628 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent8.json +628 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent9.json +628 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoTestJavaAgent1.json +621 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoTestJavaAgent2.json +628 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoTestJavaAgent3.json +628 -0
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/apacheagent.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent1.json} +0 -2
- package/{esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/webserver.json → cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent2.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/{webserver.json → FrodoOpsTestWebAgent3.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/{apacheagent.json → FrodoOpsTestWebAgent4.json} +0 -2
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent5.json +454 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent6.json +453 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent7.json +453 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent8.json +453 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent9.json +453 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoTestWebAgent1.json +454 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoTestWebAgent2.json +453 -0
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoTestWebAgent3.json +453 -0
- package/cjs/test/mocks/ForgeRockApiMockEngine.js +1 -108
- package/cjs/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
- package/esm/api/AgentApi.mjs +1 -1
- package/esm/api/AgentApi.test.mjs +323 -246
- package/esm/api/ApiTypes.mjs +16 -16
- package/esm/api/AuthenticateApi.mjs +16 -12
- package/esm/api/AuthenticateApi.test.mjs +77 -35
- package/esm/api/IdmConfigApi.mjs +19 -4
- package/esm/api/NodeApi.test.mjs +248 -914
- package/esm/api/SecretsApi.test.mjs +252 -245
- package/esm/api/SocialIdentityProvidersApi.mjs +16 -0
- package/esm/api/TreeApi.test.mjs +190 -105
- package/esm/api/VariablesApi.test.mjs +108 -12
- package/esm/api/utils/ApiUtils.mjs +12 -4
- package/esm/api/utils/ApiUtils.test.mjs +80 -79
- package/esm/index.mjs +1 -0
- package/esm/ops/AgentOps.test.mjs +780 -1210
- package/esm/ops/AuthenticateOps.mjs +0 -7
- package/esm/ops/ConnectionProfileOps.test.mjs +94 -54
- package/esm/ops/EmailTemplateOps.test.mjs +140 -28
- package/esm/ops/IdmOps.test.mjs +159 -62
- package/esm/ops/IdpOps.mjs +139 -210
- package/esm/ops/IdpOps.test.mjs +651 -52
- package/esm/ops/SecretsOps.mjs +3 -3
- package/esm/ops/VariablesOps.mjs +3 -3
- package/esm/shared/State.mjs +1 -1
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent1.json +30 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent2.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent3.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent4.json +30 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent5.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent6.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent7.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent8.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoOpsTestGatewayAgent9.json +30 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoTestGatewayAgent1.json +30 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoTestGatewayAgent2.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/FrodoTestGatewayAgent3.json +20 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent1.json +621 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent2.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent3.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent4.json +621 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent5.json +621 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent6.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent7.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent8.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoOpsTestJavaAgent9.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoTestJavaAgent1.json +621 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoTestJavaAgent2.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/FrodoTestJavaAgent3.json +628 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent1.json +454 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent2.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent3.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent4.json +454 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent5.json +454 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent6.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent7.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent8.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoOpsTestWebAgent9.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoTestWebAgent1.json +454 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoTestWebAgent2.json +453 -0
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/FrodoTestWebAgent3.json +453 -0
- package/esm/test/mocks/ForgeRockApiMockEngine.mjs +1 -98
- package/package.json +1 -1
- package/types/api/AgentApi.d.ts.map +1 -1
- package/types/api/ApiTypes.d.ts +21 -21
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/AuthenticateApi.d.ts +11 -2
- package/types/api/AuthenticateApi.d.ts.map +1 -1
- package/types/api/IdmConfigApi.d.ts +11 -5
- package/types/api/IdmConfigApi.d.ts.map +1 -1
- package/types/api/SocialIdentityProvidersApi.d.ts +7 -0
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
- package/types/api/utils/ApiUtils.d.ts +7 -1
- package/types/api/utils/ApiUtils.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts +31 -24
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/ops/SecretsOps.d.ts.map +1 -1
- package/types/ops/VariablesOps.d.ts.map +1 -1
- package/types/shared/State.d.ts.map +1 -1
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts +1 -11
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts.map +1 -1
- package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +0 -22
- package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +0 -22
package/cjs/ops/IdpOps.js
CHANGED
|
@@ -3,358 +3,265 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
6
|
+
exports.deleteSocialProvider = deleteSocialProvider;
|
|
7
|
+
exports.exportSocialProvider = exportSocialProvider;
|
|
8
|
+
exports.exportSocialProviders = exportSocialProviders;
|
|
9
|
+
exports.getSocialIdentityProviders = getSocialIdentityProviders;
|
|
9
10
|
exports.getSocialProvider = getSocialProvider;
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.listSocialProviders = listSocialProviders;
|
|
15
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
11
|
+
exports.importFirstSocialProvider = importFirstSocialProvider;
|
|
12
|
+
exports.importSocialProvider = importSocialProvider;
|
|
13
|
+
exports.importSocialProviders = importSocialProviders;
|
|
14
|
+
exports.putProviderByTypeAndId = putProviderByTypeAndId;
|
|
16
15
|
var _SocialIdentityProvidersApi = require("../api/SocialIdentityProvidersApi");
|
|
17
16
|
var _ScriptApi = require("../api/ScriptApi");
|
|
18
17
|
var _ScriptOps = require("./ScriptOps");
|
|
19
18
|
var _ExportImportUtils = require("./utils/ExportImportUtils");
|
|
20
19
|
var _Console = require("./utils/Console");
|
|
21
|
-
|
|
20
|
+
var state = _interopRequireWildcard(require("../shared/State"));
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
26
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
23
27
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Create an empty idp export template
|
|
30
|
+
* @returns {SocialProviderExportInterface} an empty idp export template
|
|
31
|
+
*/
|
|
32
|
+
function createIdpExportTemplate() {
|
|
26
33
|
return {
|
|
27
|
-
meta:
|
|
34
|
+
meta: (0, _ExportImportUtils.getMetadata)(),
|
|
28
35
|
script: {},
|
|
29
36
|
idp: {}
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
/**
|
|
34
|
-
*
|
|
41
|
+
* Get all social identity providers
|
|
42
|
+
* @returns {Promise} a promise that resolves to an object containing an array of social identity providers
|
|
35
43
|
*/
|
|
36
|
-
function
|
|
37
|
-
return
|
|
44
|
+
function getSocialIdentityProviders() {
|
|
45
|
+
return _getSocialIdentityProviders2.apply(this, arguments);
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
40
48
|
* Get social identity provider by id
|
|
41
49
|
* @param {String} providerId social identity provider id/name
|
|
42
50
|
* @returns {Promise} a promise that resolves a social identity provider object
|
|
43
51
|
*/
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(0, _Console.printMessage)("".concat(socialIdentityProvider._id), 'data');
|
|
51
|
-
});
|
|
52
|
-
} catch (err) {
|
|
53
|
-
(0, _Console.printMessage)("listSocialProviders ERROR: ".concat(err.message), 'error');
|
|
54
|
-
(0, _Console.printMessage)(err, 'error');
|
|
55
|
-
}
|
|
52
|
+
function _getSocialIdentityProviders2() {
|
|
53
|
+
_getSocialIdentityProviders2 = _asyncToGenerator(function* () {
|
|
54
|
+
var {
|
|
55
|
+
result
|
|
56
|
+
} = yield (0, _SocialIdentityProvidersApi.getSocialIdentityProviders)();
|
|
57
|
+
return result;
|
|
56
58
|
});
|
|
57
|
-
return
|
|
59
|
+
return _getSocialIdentityProviders2.apply(this, arguments);
|
|
58
60
|
}
|
|
59
61
|
function getSocialProvider(_x) {
|
|
60
62
|
return _getSocialProvider.apply(this, arguments);
|
|
61
63
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Export provider by id
|
|
64
|
-
* @param {String} providerId provider id/name
|
|
65
|
-
* @param {String} file optional export file name
|
|
66
|
-
*/
|
|
67
64
|
function _getSocialProvider() {
|
|
68
65
|
_getSocialProvider = _asyncToGenerator(function* (providerId) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
66
|
+
var response = yield getSocialIdentityProviders();
|
|
67
|
+
var foundProviders = response.filter(provider => provider._id === providerId);
|
|
68
|
+
switch (foundProviders.length) {
|
|
69
|
+
case 1:
|
|
70
|
+
return foundProviders[0];
|
|
71
|
+
case 0:
|
|
72
|
+
throw new Error("Provider '".concat(providerId, "' not found"));
|
|
73
|
+
default:
|
|
74
|
+
throw new Error("".concat(foundProviders.length, " providers '").concat(providerId, "' found"));
|
|
75
|
+
}
|
|
80
76
|
});
|
|
81
77
|
return _getSocialProvider.apply(this, arguments);
|
|
82
78
|
}
|
|
83
|
-
function
|
|
84
|
-
return
|
|
79
|
+
function putProviderByTypeAndId(_x2, _x3, _x4) {
|
|
80
|
+
return _putProviderByTypeAndId2.apply(this, arguments);
|
|
85
81
|
}
|
|
86
82
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @param {String}
|
|
83
|
+
* Delete social identity provider by id
|
|
84
|
+
* @param {String} providerId social identity provider id/name
|
|
85
|
+
* @returns {Promise} a promise that resolves a social identity provider object
|
|
89
86
|
*/
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var fileName = file;
|
|
94
|
-
if (!fileName) {
|
|
95
|
-
fileName = (0, _ExportImportUtils.getTypedFilename)(providerId, 'idp');
|
|
96
|
-
}
|
|
97
|
-
(0, _Console.createProgressIndicator)(1, "Exporting ".concat(providerId));
|
|
87
|
+
function _putProviderByTypeAndId2() {
|
|
88
|
+
_putProviderByTypeAndId2 = _asyncToGenerator(function* (providerType, providerId, providerData) {
|
|
89
|
+
(0, _Console.debugMessage)("IdpOps.putProviderByTypeAndId: start");
|
|
98
90
|
try {
|
|
99
|
-
var
|
|
100
|
-
(0, _Console.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
91
|
+
var response = yield (0, _SocialIdentityProvidersApi.putProviderByTypeAndId)(providerType, providerId, providerData);
|
|
92
|
+
(0, _Console.debugMessage)("IdpOps.putProviderByTypeAndId: end");
|
|
93
|
+
return response;
|
|
94
|
+
} catch (importError) {
|
|
95
|
+
var _importError$response, _importError$response2, _importError$response3;
|
|
96
|
+
if (((_importError$response = importError.response) === null || _importError$response === void 0 ? void 0 : _importError$response.status) === 400 && ((_importError$response2 = importError.response) === null || _importError$response2 === void 0 ? void 0 : (_importError$response3 = _importError$response2.data) === null || _importError$response3 === void 0 ? void 0 : _importError$response3.message) === 'Invalid attribute specified.') {
|
|
97
|
+
var {
|
|
98
|
+
validAttributes
|
|
99
|
+
} = importError.response.data.detail;
|
|
100
|
+
validAttributes.push('_id', '_type');
|
|
101
|
+
for (var attribute of Object.keys(providerData)) {
|
|
102
|
+
if (!validAttributes.includes(attribute)) {
|
|
103
|
+
if (state.getVerbose()) (0, _Console.printMessage)("\nRemoving invalid attribute: ".concat(attribute), 'warn', false);
|
|
104
|
+
delete providerData[attribute];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (state.getVerbose()) (0, _Console.printMessage)('\n', 'warn', false);
|
|
108
|
+
var _response = yield (0, _SocialIdentityProvidersApi.putProviderByTypeAndId)(providerType, providerId, providerData);
|
|
109
|
+
(0, _Console.debugMessage)("IdpOps.putProviderByTypeAndId: end (after retry)");
|
|
110
|
+
return _response;
|
|
111
|
+
} else {
|
|
112
|
+
// re-throw unhandleable error
|
|
113
|
+
throw importError;
|
|
107
114
|
}
|
|
108
|
-
(0, _ExportImportUtils.saveJsonToFile)(fileData, fileName);
|
|
109
|
-
(0, _Console.stopProgressIndicator)("Exported ".concat(providerId['brightCyan'], " to ").concat(fileName['brightCyan'], "."));
|
|
110
|
-
} catch (err) {
|
|
111
|
-
(0, _Console.stopProgressIndicator)("".concat(err));
|
|
112
|
-
(0, _Console.printMessage)("".concat(err), 'error');
|
|
113
115
|
}
|
|
114
116
|
});
|
|
115
|
-
return
|
|
117
|
+
return _putProviderByTypeAndId2.apply(this, arguments);
|
|
116
118
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
119
|
+
function deleteSocialProvider(_x5) {
|
|
120
|
+
return _deleteSocialProvider.apply(this, arguments);
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
121
|
-
* Export
|
|
123
|
+
* Export social provider by id
|
|
124
|
+
* @param {string} providerId provider id/name
|
|
125
|
+
* @returns {Promise<SocialProviderExportInterface>} a promise that resolves to a SocialProviderExportInterface object
|
|
122
126
|
*/
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
function _deleteSocialProvider() {
|
|
128
|
+
_deleteSocialProvider = _asyncToGenerator(function* (providerId) {
|
|
129
|
+
var response = yield getSocialIdentityProviders();
|
|
130
|
+
var foundProviders = response.filter(provider => provider._id === providerId);
|
|
131
|
+
switch (foundProviders.length) {
|
|
132
|
+
case 1:
|
|
133
|
+
return yield (0, _SocialIdentityProvidersApi.deleteProviderByTypeAndId)(foundProviders[0]._type._id, foundProviders[0]._id);
|
|
134
|
+
case 0:
|
|
135
|
+
throw new Error("Provider '".concat(providerId, "' not found"));
|
|
136
|
+
default:
|
|
137
|
+
throw new Error("".concat(foundProviders.length, " providers '").concat(providerId, "' found"));
|
|
128
138
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
});
|
|
140
|
+
return _deleteSocialProvider.apply(this, arguments);
|
|
141
|
+
}
|
|
142
|
+
function exportSocialProvider(_x6) {
|
|
143
|
+
return _exportSocialProvider.apply(this, arguments);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Export all providers
|
|
147
|
+
* @returns {Promise<SocialProviderExportInterface>} a promise that resolves to a SocialProviderExportInterface object
|
|
148
|
+
*/
|
|
149
|
+
function _exportSocialProvider() {
|
|
150
|
+
_exportSocialProvider = _asyncToGenerator(function* (providerId) {
|
|
151
|
+
(0, _Console.debugMessage)("IdpOps.exportSocialProvider: start");
|
|
152
|
+
var idpData = yield getSocialProvider(providerId);
|
|
153
|
+
var exportData = createIdpExportTemplate();
|
|
154
|
+
exportData.idp[idpData._id] = idpData;
|
|
155
|
+
if (idpData.transform) {
|
|
156
|
+
var scriptData = yield (0, _ScriptApi.getScript)(idpData.transform);
|
|
157
|
+
scriptData.script = (0, _ExportImportUtils.convertBase64TextToArray)(scriptData.script);
|
|
158
|
+
exportData.script[idpData.transform] = scriptData;
|
|
141
159
|
}
|
|
142
|
-
(0,
|
|
143
|
-
|
|
160
|
+
(0, _Console.debugMessage)("IdpOps.exportSocialProvider: end");
|
|
161
|
+
return exportData;
|
|
144
162
|
});
|
|
145
|
-
return
|
|
163
|
+
return _exportSocialProvider.apply(this, arguments);
|
|
146
164
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
165
|
+
function exportSocialProviders() {
|
|
166
|
+
return _exportSocialProviders.apply(this, arguments);
|
|
149
167
|
}
|
|
150
168
|
/**
|
|
151
169
|
* Import provider by id/name
|
|
152
|
-
* @param {
|
|
153
|
-
* @param {
|
|
170
|
+
* @param {string} providerId provider id/name
|
|
171
|
+
* @param {SocialProviderExportInterface} importData import data
|
|
154
172
|
*/
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
var
|
|
158
|
-
|
|
173
|
+
function _exportSocialProviders() {
|
|
174
|
+
_exportSocialProviders = _asyncToGenerator(function* () {
|
|
175
|
+
var exportData = createIdpExportTemplate();
|
|
176
|
+
var allIdpsData = yield getSocialIdentityProviders();
|
|
159
177
|
(0, _Console.createProgressIndicator)(allIdpsData.length, 'Exporting providers');
|
|
160
178
|
for (var idpData of allIdpsData) {
|
|
161
|
-
(0, _Console.updateProgressIndicator)("
|
|
162
|
-
|
|
163
|
-
var fileData = getFileDataTemplate();
|
|
164
|
-
fileData.idp[idpData._id] = idpData;
|
|
179
|
+
(0, _Console.updateProgressIndicator)("Exporting provider ".concat(idpData._id));
|
|
180
|
+
exportData.idp[idpData._id] = idpData;
|
|
165
181
|
if (idpData.transform) {
|
|
166
182
|
// eslint-disable-next-line no-await-in-loop
|
|
167
183
|
var scriptData = yield (0, _ScriptApi.getScript)(idpData.transform);
|
|
168
184
|
scriptData.script = (0, _ExportImportUtils.convertBase64TextToArray)(scriptData.script);
|
|
169
|
-
|
|
185
|
+
exportData.script[idpData.transform] = scriptData;
|
|
170
186
|
}
|
|
171
|
-
(0, _ExportImportUtils.saveJsonToFile)(fileData, fileName);
|
|
172
187
|
}
|
|
173
188
|
(0, _Console.stopProgressIndicator)("".concat(allIdpsData.length, " providers exported."));
|
|
189
|
+
return exportData;
|
|
174
190
|
});
|
|
175
|
-
return
|
|
191
|
+
return _exportSocialProviders.apply(this, arguments);
|
|
176
192
|
}
|
|
177
|
-
function
|
|
178
|
-
return
|
|
193
|
+
function importSocialProvider(_x7, _x8) {
|
|
194
|
+
return _importSocialProvider.apply(this, arguments);
|
|
179
195
|
}
|
|
180
196
|
/**
|
|
181
|
-
* Import first provider
|
|
182
|
-
* @param {
|
|
197
|
+
* Import first provider
|
|
198
|
+
* @param {SocialProviderExportInterface} importData import data
|
|
183
199
|
*/
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
(0,
|
|
192
|
-
|
|
193
|
-
var _loop = function* _loop(idpId) {
|
|
194
|
-
if ({}.hasOwnProperty.call(fileData.idp, idpId)) {
|
|
195
|
-
if (idpId === providerId) {
|
|
196
|
-
found = true;
|
|
197
|
-
(0, _Console.updateProgressIndicator)("Importing ".concat(fileData.idp[idpId]._id));
|
|
198
|
-
var scriptId = fileData.idp[idpId].transform;
|
|
199
|
-
var scriptData = fileData.script[scriptId];
|
|
200
|
-
if (scriptId && scriptData) {
|
|
201
|
-
scriptData.script = (0, _ExportImportUtils.convertTextArrayToBase64)(scriptData.script);
|
|
202
|
-
// eslint-disable-next-line no-await-in-loop
|
|
203
|
-
yield (0, _ScriptOps.createOrUpdateScript)(fileData.idp[idpId].transform, fileData.script[fileData.idp[idpId].transform]);
|
|
204
|
-
}
|
|
205
|
-
(0, _SocialIdentityProvidersApi.putProviderByTypeAndId)(fileData.idp[idpId]._type._id, idpId, fileData.idp[idpId]).then(() => {
|
|
206
|
-
(0, _Console.stopProgressIndicator)("Successfully imported provider ".concat(providerId, "."));
|
|
207
|
-
}).catch(importProviderErr => {
|
|
208
|
-
(0, _Console.stopProgressIndicator)("Error importing provider ".concat(fileData.idp[idpId]._id));
|
|
209
|
-
(0, _Console.printMessage)("\nError importing provider ".concat(providerId), 'error');
|
|
210
|
-
(0, _Console.printMessage)(importProviderErr.response.data, 'error');
|
|
211
|
-
});
|
|
212
|
-
return "break";
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
for (var idpId in fileData.idp) {
|
|
217
|
-
var _ret = yield* _loop(idpId);
|
|
218
|
-
if (_ret === "break") break;
|
|
219
|
-
}
|
|
220
|
-
if (!found) {
|
|
221
|
-
(0, _Console.stopProgressIndicator)("Provider ".concat(providerId.brightCyan, " not found in ").concat(file.brightCyan, "!"));
|
|
222
|
-
}
|
|
223
|
-
} else {
|
|
224
|
-
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
200
|
+
function _importSocialProvider() {
|
|
201
|
+
_importSocialProvider = _asyncToGenerator(function* (providerId, importData) {
|
|
202
|
+
for (var idpId of Object.keys(importData.idp)) {
|
|
203
|
+
if (idpId === providerId) {
|
|
204
|
+
var scriptId = importData.idp[idpId].transform;
|
|
205
|
+
var scriptData = importData.script[scriptId];
|
|
206
|
+
if (scriptId && scriptData) {
|
|
207
|
+
scriptData.script = (0, _ExportImportUtils.convertTextArrayToBase64)(scriptData.script);
|
|
208
|
+
yield (0, _ScriptOps.createOrUpdateScript)(scriptId, scriptData);
|
|
225
209
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
});
|
|
232
|
-
return _importSocialProviderFromFile.apply(this, arguments);
|
|
233
|
-
}
|
|
234
|
-
function importFirstSocialProviderFromFile(_x6) {
|
|
235
|
-
return _importFirstSocialProviderFromFile.apply(this, arguments);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Import all providers from file
|
|
239
|
-
* @param {String} file import file name
|
|
240
|
-
*/
|
|
241
|
-
function _importFirstSocialProviderFromFile() {
|
|
242
|
-
_importFirstSocialProviderFromFile = _asyncToGenerator(function* (file) {
|
|
243
|
-
_fs.default.readFile(file, 'utf8', /*#__PURE__*/function () {
|
|
244
|
-
var _ref2 = _asyncToGenerator(function* (err, data) {
|
|
245
|
-
if (err) throw err;
|
|
246
|
-
var fileData = JSON.parse(data);
|
|
247
|
-
if ((0, _ExportImportUtils.validateImport)(fileData.meta)) {
|
|
248
|
-
(0, _Console.createProgressIndicator)(1, 'Importing provider...');
|
|
249
|
-
var _loop2 = function* _loop2(idpId) {
|
|
250
|
-
if ({}.hasOwnProperty.call(fileData.idp, idpId)) {
|
|
251
|
-
(0, _Console.updateProgressIndicator)("Importing ".concat(fileData.idp[idpId]._id));
|
|
252
|
-
var scriptId = fileData.idp[idpId].transform;
|
|
253
|
-
var scriptData = fileData.script[scriptId];
|
|
254
|
-
if (scriptId && scriptData) {
|
|
255
|
-
scriptData.script = (0, _ExportImportUtils.convertTextArrayToBase64)(scriptData.script);
|
|
256
|
-
// eslint-disable-next-line no-await-in-loop
|
|
257
|
-
yield (0, _ScriptOps.createOrUpdateScript)(fileData.idp[idpId].transform, fileData.script[fileData.idp[idpId].transform]);
|
|
258
|
-
}
|
|
259
|
-
(0, _SocialIdentityProvidersApi.putProviderByTypeAndId)(fileData.idp[idpId]._type._id, idpId, fileData.idp[idpId]).then(result => {
|
|
260
|
-
if (result == null) {
|
|
261
|
-
(0, _Console.stopProgressIndicator)("Error importing provider ".concat(fileData.idp[idpId]._id));
|
|
262
|
-
(0, _Console.printMessage)("Error importing provider ".concat(fileData.idp[idpId]._id), 'error');
|
|
263
|
-
} else {
|
|
264
|
-
(0, _Console.stopProgressIndicator)("Successfully imported provider ".concat(fileData.idp[idpId]._id, "."));
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
return "break";
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
for (var idpId in fileData.idp) {
|
|
271
|
-
var _ret2 = yield* _loop2(idpId);
|
|
272
|
-
if (_ret2 === "break") break;
|
|
273
|
-
}
|
|
274
|
-
} else {
|
|
275
|
-
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
return function (_x10, _x11) {
|
|
279
|
-
return _ref2.apply(this, arguments);
|
|
280
|
-
};
|
|
281
|
-
}());
|
|
210
|
+
yield putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return false;
|
|
282
215
|
});
|
|
283
|
-
return
|
|
216
|
+
return _importSocialProvider.apply(this, arguments);
|
|
284
217
|
}
|
|
285
|
-
function
|
|
286
|
-
return
|
|
218
|
+
function importFirstSocialProvider(_x9) {
|
|
219
|
+
return _importFirstSocialProvider.apply(this, arguments);
|
|
287
220
|
}
|
|
288
221
|
/**
|
|
289
|
-
* Import providers
|
|
222
|
+
* Import all providers
|
|
223
|
+
* @param {SocialProviderExportInterface} importData import data
|
|
290
224
|
*/
|
|
291
|
-
function
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
var
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
scriptData.script = (0, _ExportImportUtils.convertTextArrayToBase64)(scriptData.script);
|
|
305
|
-
// eslint-disable-next-line no-await-in-loop
|
|
306
|
-
yield (0, _ScriptOps.createOrUpdateScript)(fileData.idp[idpId].transform, fileData.script[fileData.idp[idpId].transform]);
|
|
307
|
-
}
|
|
308
|
-
// eslint-disable-next-line no-await-in-loop
|
|
309
|
-
var result = yield (0, _SocialIdentityProvidersApi.putProviderByTypeAndId)(fileData.idp[idpId]._type._id, idpId, fileData.idp[idpId]);
|
|
310
|
-
if (!result) {
|
|
311
|
-
(0, _Console.updateProgressIndicator)("Successfully imported ".concat(fileData.idp[idpId].name));
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
(0, _Console.stopProgressIndicator)("Providers imported.");
|
|
316
|
-
} else {
|
|
317
|
-
(0, _Console.printMessage)('Import validation failed...', 'error');
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
return function (_x12, _x13) {
|
|
321
|
-
return _ref3.apply(this, arguments);
|
|
322
|
-
};
|
|
323
|
-
}());
|
|
225
|
+
function _importFirstSocialProvider() {
|
|
226
|
+
_importFirstSocialProvider = _asyncToGenerator(function* (importData) {
|
|
227
|
+
for (var idpId of Object.keys(importData.idp)) {
|
|
228
|
+
var scriptId = importData.idp[idpId].transform;
|
|
229
|
+
var scriptData = importData.script[scriptId];
|
|
230
|
+
if (scriptId && scriptData) {
|
|
231
|
+
scriptData.script = (0, _ExportImportUtils.convertTextArrayToBase64)(scriptData.script);
|
|
232
|
+
yield (0, _ScriptOps.createOrUpdateScript)(scriptId, scriptData);
|
|
233
|
+
}
|
|
234
|
+
yield putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
return false;
|
|
324
238
|
});
|
|
325
|
-
return
|
|
239
|
+
return _importFirstSocialProvider.apply(this, arguments);
|
|
326
240
|
}
|
|
327
|
-
function
|
|
328
|
-
return
|
|
241
|
+
function importSocialProviders(_x10) {
|
|
242
|
+
return _importSocialProviders.apply(this, arguments);
|
|
329
243
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
var
|
|
333
|
-
var
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
var count = Object.keys(fileData.idp).length;
|
|
341
|
-
total += count;
|
|
342
|
-
for (var idpId in fileData.idp) {
|
|
343
|
-
if ({}.hasOwnProperty.call(fileData.idp, idpId)) {
|
|
344
|
-
// eslint-disable-next-line no-await-in-loop
|
|
345
|
-
var result = yield (0, _SocialIdentityProvidersApi.putProviderByTypeAndId)(fileData.idp[idpId]._type._id, idpId, fileData.idp[idpId]);
|
|
346
|
-
if (result == null) {
|
|
347
|
-
(0, _Console.printMessage)("Error importing ".concat(count, " providers from ").concat(file), 'error');
|
|
348
|
-
}
|
|
349
|
-
}
|
|
244
|
+
function _importSocialProviders() {
|
|
245
|
+
_importSocialProviders = _asyncToGenerator(function* (importData) {
|
|
246
|
+
var outcome = true;
|
|
247
|
+
for (var idpId of Object.keys(importData.idp)) {
|
|
248
|
+
try {
|
|
249
|
+
var scriptId = importData.idp[idpId].transform;
|
|
250
|
+
var scriptData = _objectSpread({}, importData.script[scriptId]);
|
|
251
|
+
if (scriptId && scriptData) {
|
|
252
|
+
scriptData.script = (0, _ExportImportUtils.convertTextArrayToBase64)(scriptData.script);
|
|
253
|
+
yield (0, _ScriptOps.createOrUpdateScript)(scriptId, scriptData);
|
|
350
254
|
}
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
255
|
+
yield putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
|
|
256
|
+
} catch (error) {
|
|
257
|
+
var _error$response;
|
|
258
|
+
(0, _Console.printMessage)(((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || error, 'error');
|
|
259
|
+
(0, _Console.printMessage)("\nError importing provider ".concat(idpId), 'error');
|
|
260
|
+
outcome = false;
|
|
354
261
|
}
|
|
355
262
|
}
|
|
356
|
-
|
|
263
|
+
return outcome;
|
|
357
264
|
});
|
|
358
|
-
return
|
|
265
|
+
return _importSocialProviders.apply(this, arguments);
|
|
359
266
|
}
|
|
360
267
|
//# sourceMappingURL=IdpOps.js.map
|