@rockcarver/frodo-lib 0.19.2 → 1.0.1-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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.0.1-0] - 2023-06-22
11
+
12
+ ### Added
13
+
14
+ - rockcarver/frodo-cli#251: Support for Identity Cloud admin federation configuration through new module `AdminFederation`.
15
+
16
+ ## [1.0.0] - 2023-06-05
17
+
18
+ ### Changed
19
+
20
+ - Promote Frodo Library 0.19.2 to 1.0.0.
21
+
10
22
  ## [0.19.2] - 2023-05-25
11
23
 
12
24
  ### Changed
@@ -1149,7 +1161,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1149
1161
  - Fixed problem with adding connection profiles
1150
1162
  - Miscellaneous bug fixes
1151
1163
 
1152
- [Unreleased]: https://github.com/rockcarver/frodo-lib/compare/v0.19.2...HEAD
1164
+ [Unreleased]: https://github.com/rockcarver/frodo-lib/compare/v1.0.1-0...HEAD
1165
+
1166
+ [1.0.1-0]: https://github.com/rockcarver/frodo-lib/compare/v1.0.0...v1.0.1-0
1167
+
1168
+ [1.0.0]: https://github.com/rockcarver/frodo-lib/compare/v0.19.2...v1.0.0
1153
1169
 
1154
1170
  [0.19.2]: https://github.com/rockcarver/frodo-lib/compare/v0.19.1...v0.19.2
1155
1171
 
@@ -1 +1 @@
1
- {"version":3,"file":"ApiTypes.js","names":["PolicyConditionType","exports","ScriptLanguage","ScriptContext","Saml2ProiderLocation"],"sources":["api/ApiTypes.ts"],"sourcesContent":["export interface NoIdObjectSkeletonInterface {\n _rev?: number;\n [k: string]:\n | string\n | number\n | boolean\n | string[]\n | IdObjectSkeletonInterface\n | object\n | null;\n}\n\nexport interface IdObjectSkeletonInterface extends NoIdObjectSkeletonInterface {\n _id: string;\n}\n\nexport interface PagedResults {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: any[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: string;\n totalPagedResults: number;\n remainingPagedResults: number;\n}\n\nexport interface UiConfigInterface {\n categories: string;\n}\n\nexport interface NodeRefSkeletonInterface {\n connections: Record<string, string>;\n displayName: string;\n nodeType: string;\n x: number;\n y: number;\n}\n\nexport interface InnerNodeRefSkeletonInterface {\n _id: string;\n displayName: string;\n nodeType: string;\n}\n\nexport type TreeSkeleton = IdObjectSkeletonInterface & {\n entryNodeId: string;\n nodes: Record<string, NodeRefSkeletonInterface>;\n identityResource?: string;\n uiConfig?: UiConfigInterface;\n enabled?: boolean;\n};\n\nexport type AmServiceType = IdObjectSkeletonInterface & {\n name: string;\n};\n\nexport type NodeSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n nodes?: InnerNodeRefSkeletonInterface[];\n tree?: string;\n identityResource?: string;\n};\n\nexport type SocialIdpSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n enabled: boolean;\n};\n\nexport type PolicySetSkeleton = NoIdObjectSkeletonInterface & {\n name: string;\n resourceTypeUuids: string[];\n};\n\nexport type ResourceTypeSkeleton = NoIdObjectSkeletonInterface & {\n uuid: string;\n name: string;\n};\n\nexport enum PolicyConditionType {\n Script = 'Script',\n AMIdentityMembership = 'AMIdentityMembership',\n IPv6 = 'IPv6',\n IPv4 = 'IPv4',\n SimpleTime = 'SimpleTime',\n LEAuthLevel = 'LEAuthLevel',\n LDAPFilter = 'LDAPFilter',\n AuthScheme = 'AuthScheme',\n Session = 'Session',\n AND = 'AND',\n AuthenticateToRealm = 'AuthenticateToRealm',\n ResourceEnvIP = 'ResourceEnvIP',\n Policy = 'Policy',\n OAuth2Scope = 'OAuth2Scope',\n SessionProperty = 'SessionProperty',\n OR = 'OR',\n Transaction = 'Transaction',\n NOT = 'NOT',\n AuthLevel = 'AuthLevel',\n AuthenticateToService = 'AuthenticateToService',\n}\n\nexport type PolicyCondition = NoIdObjectSkeletonInterface & {\n type: keyof typeof PolicyConditionType;\n condition?: PolicyCondition;\n conditions?: PolicyCondition[];\n};\n\nexport type PolicySkeleton = IdObjectSkeletonInterface & {\n name: string;\n applicationName: string;\n condition?: PolicyCondition;\n resourceTypeUuid: string;\n};\n\nexport type OAuth2ClientSkeleton = IdObjectSkeletonInterface & {\n overrideOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n advancedOAuth2ClientConfig?: {\n descriptions: {\n inherited: boolean;\n value: string[];\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n signEncOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOpenIDClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOAuth2ClientConfig?: {\n userpassword?: null;\n clientName?: {\n inherited: boolean;\n value: string[];\n };\n accessTokenLifetime?: {\n inherited: boolean;\n value: number;\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreUmaClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n _type: AmServiceType;\n};\n\nexport type AmServiceSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n};\n\nexport type AgentSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n};\n\nexport type EmailTemplateSkeleton = IdObjectSkeletonInterface & {\n defaultLocale?: string;\n displayName?: string;\n enabled?: boolean;\n from: string;\n subject: Record<string, string>;\n message?: Record<string, string>;\n html?: Record<string, string>;\n};\n\nexport type ThemeSkeleton = IdObjectSkeletonInterface & {\n name: string;\n isDefault: boolean;\n linkedTrees: string[];\n};\n\nexport type UiThemeRealmObject = IdObjectSkeletonInterface & {\n name: string;\n realm: Map<string, ThemeSkeleton[]>;\n};\n\nexport enum ScriptLanguage {\n GROOVY,\n JAVASCRIPT,\n}\n\nexport enum ScriptContext {\n OAUTH2_ACCESS_TOKEN_MODIFICATION,\n AUTHENTICATION_CLIENT_SIDE,\n AUTHENTICATION_TREE_DECISION_NODE,\n AUTHENTICATION_SERVER_SIDE,\n SOCIAL_IDP_PROFILE_TRANSFORMATION,\n OAUTH2_VALIDATE_SCOPE,\n CONFIG_PROVIDER_NODE,\n OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER,\n OAUTH2_EVALUATE_SCOPE,\n POLICY_CONDITION,\n OIDC_CLAIMS,\n SAML2_IDP_ADAPTER,\n SAML2_IDP_ATTRIBUTE_MAPPER,\n OAUTH2_MAY_ACT,\n}\n\nexport type ScriptSkeleton = IdObjectSkeletonInterface & {\n name: string;\n description: string;\n default: boolean;\n script: string | string[];\n language: keyof typeof ScriptLanguage;\n context: keyof typeof ScriptContext;\n createdBy: string;\n creationDate: number;\n lastModifiedBy: string;\n lastModifiedDate: number;\n};\n\nexport enum Saml2ProiderLocation {\n HOSTED = 'hosted',\n REMOTE = 'remote',\n}\n\nexport type Saml2ProviderStub = IdObjectSkeletonInterface & {\n entityId: string;\n location: Saml2ProiderLocation;\n roles: string[];\n};\n\nexport type Saml2ProviderSkeleton = IdObjectSkeletonInterface & {\n entityId: string;\n entityLocation: Saml2ProiderLocation;\n serviceProvider: unknown;\n identityProvider: unknown;\n attributeQueryProvider: unknown;\n xacmlPolicyEnforcementPoint: unknown;\n};\n\nexport type CircleOfTrustSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n status: string;\n trustedProviders: string[];\n};\n\nexport type PagedResult<Result> = {\n result: Result[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: 'EXACT';\n totalPagedResults: number;\n remainingPagedResults: number;\n};\n\nexport type LogApiKey = {\n name: string;\n api_key_id: string;\n created_at: string;\n};\n\nexport type LogEventPayloadSkeleton = NoIdObjectSkeletonInterface & {\n context: string;\n level: string;\n logger: string;\n mdc: {\n transactionId: string;\n };\n message: string;\n thread: string;\n timestamp: string;\n transactionId: string;\n};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B;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAAH,OAAA,CAAAG,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"file":"ApiTypes.js","names":["PolicyConditionType","exports","ScriptLanguage","ScriptContext","Saml2ProiderLocation"],"sources":["api/ApiTypes.ts"],"sourcesContent":["export interface NoIdObjectSkeletonInterface {\n _rev?: number;\n [k: string]:\n | string\n | number\n | boolean\n | string[]\n | IdObjectSkeletonInterface\n | object\n | null;\n}\n\nexport interface IdObjectSkeletonInterface extends NoIdObjectSkeletonInterface {\n _id: string;\n}\n\nexport interface PagedResults {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: any[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: string;\n totalPagedResults: number;\n remainingPagedResults: number;\n}\n\nexport interface UiConfigInterface {\n categories: string;\n}\n\nexport type AdminFederationConfigSkeleton = IdObjectSkeletonInterface & {\n groups: {\n claim: string;\n mappings: {\n 'super-admins': string[];\n 'tenant-admins': string[];\n };\n };\n};\n\nexport interface NodeRefSkeletonInterface {\n connections: Record<string, string>;\n displayName: string;\n nodeType: string;\n x: number;\n y: number;\n}\n\nexport interface InnerNodeRefSkeletonInterface {\n _id: string;\n displayName: string;\n nodeType: string;\n}\n\nexport type TreeSkeleton = IdObjectSkeletonInterface & {\n entryNodeId: string;\n nodes: Record<string, NodeRefSkeletonInterface>;\n identityResource?: string;\n uiConfig?: UiConfigInterface;\n enabled?: boolean;\n};\n\nexport type AmServiceType = IdObjectSkeletonInterface & {\n name: string;\n};\n\nexport type NodeSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n nodes?: InnerNodeRefSkeletonInterface[];\n tree?: string;\n identityResource?: string;\n};\n\nexport type SocialIdpSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n enabled: boolean;\n};\n\nexport type PolicySetSkeleton = NoIdObjectSkeletonInterface & {\n name: string;\n resourceTypeUuids: string[];\n};\n\nexport type ResourceTypeSkeleton = NoIdObjectSkeletonInterface & {\n uuid: string;\n name: string;\n};\n\nexport enum PolicyConditionType {\n Script = 'Script',\n AMIdentityMembership = 'AMIdentityMembership',\n IPv6 = 'IPv6',\n IPv4 = 'IPv4',\n SimpleTime = 'SimpleTime',\n LEAuthLevel = 'LEAuthLevel',\n LDAPFilter = 'LDAPFilter',\n AuthScheme = 'AuthScheme',\n Session = 'Session',\n AND = 'AND',\n AuthenticateToRealm = 'AuthenticateToRealm',\n ResourceEnvIP = 'ResourceEnvIP',\n Policy = 'Policy',\n OAuth2Scope = 'OAuth2Scope',\n SessionProperty = 'SessionProperty',\n OR = 'OR',\n Transaction = 'Transaction',\n NOT = 'NOT',\n AuthLevel = 'AuthLevel',\n AuthenticateToService = 'AuthenticateToService',\n}\n\nexport type PolicyCondition = NoIdObjectSkeletonInterface & {\n type: keyof typeof PolicyConditionType;\n condition?: PolicyCondition;\n conditions?: PolicyCondition[];\n};\n\nexport type PolicySkeleton = IdObjectSkeletonInterface & {\n name: string;\n applicationName: string;\n condition?: PolicyCondition;\n resourceTypeUuid: string;\n};\n\nexport type OAuth2ClientSkeleton = IdObjectSkeletonInterface & {\n overrideOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n advancedOAuth2ClientConfig?: {\n descriptions: {\n inherited: boolean;\n value: string[];\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n signEncOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOpenIDClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOAuth2ClientConfig?: {\n userpassword?: null;\n clientName?: {\n inherited: boolean;\n value: string[];\n };\n accessTokenLifetime?: {\n inherited: boolean;\n value: number;\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreUmaClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n _type: AmServiceType;\n};\n\nexport type AmServiceSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n};\n\nexport type AgentSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n};\n\nexport type EmailTemplateSkeleton = IdObjectSkeletonInterface & {\n defaultLocale?: string;\n displayName?: string;\n enabled?: boolean;\n from: string;\n subject: Record<string, string>;\n message?: Record<string, string>;\n html?: Record<string, string>;\n};\n\nexport type ThemeSkeleton = IdObjectSkeletonInterface & {\n name: string;\n isDefault: boolean;\n linkedTrees: string[];\n};\n\nexport type UiThemeRealmObject = IdObjectSkeletonInterface & {\n name: string;\n realm: Map<string, ThemeSkeleton[]>;\n};\n\nexport enum ScriptLanguage {\n GROOVY,\n JAVASCRIPT,\n}\n\nexport enum ScriptContext {\n OAUTH2_ACCESS_TOKEN_MODIFICATION,\n AUTHENTICATION_CLIENT_SIDE,\n AUTHENTICATION_TREE_DECISION_NODE,\n AUTHENTICATION_SERVER_SIDE,\n SOCIAL_IDP_PROFILE_TRANSFORMATION,\n OAUTH2_VALIDATE_SCOPE,\n CONFIG_PROVIDER_NODE,\n OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER,\n OAUTH2_EVALUATE_SCOPE,\n POLICY_CONDITION,\n OIDC_CLAIMS,\n SAML2_IDP_ADAPTER,\n SAML2_IDP_ATTRIBUTE_MAPPER,\n OAUTH2_MAY_ACT,\n}\n\nexport type ScriptSkeleton = IdObjectSkeletonInterface & {\n name: string;\n description: string;\n default: boolean;\n script: string | string[];\n language: keyof typeof ScriptLanguage;\n context: keyof typeof ScriptContext;\n createdBy: string;\n creationDate: number;\n lastModifiedBy: string;\n lastModifiedDate: number;\n};\n\nexport enum Saml2ProiderLocation {\n HOSTED = 'hosted',\n REMOTE = 'remote',\n}\n\nexport type Saml2ProviderStub = IdObjectSkeletonInterface & {\n entityId: string;\n location: Saml2ProiderLocation;\n roles: string[];\n};\n\nexport type Saml2ProviderSkeleton = IdObjectSkeletonInterface & {\n entityId: string;\n entityLocation: Saml2ProiderLocation;\n serviceProvider: unknown;\n identityProvider: unknown;\n attributeQueryProvider: unknown;\n xacmlPolicyEnforcementPoint: unknown;\n};\n\nexport type CircleOfTrustSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n status: string;\n trustedProviders: string[];\n};\n\nexport type PagedResult<Result> = {\n result: Result[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: 'EXACT';\n totalPagedResults: number;\n remainingPagedResults: number;\n};\n\nexport type LogApiKey = {\n name: string;\n api_key_id: string;\n created_at: string;\n};\n\nexport type LogEventPayloadSkeleton = NoIdObjectSkeletonInterface & {\n context: string;\n level: string;\n logger: string;\n mdc: {\n transactionId: string;\n };\n message: string;\n thread: string;\n timestamp: string;\n transactionId: string;\n};\n\nexport type LogEventSkeleton = NoIdObjectSkeletonInterface & {\n payload: string | LogEventPayloadSkeleton;\n timestamp: string;\n type: string;\n source: string;\n};\n"],"mappings":";;;;;;IAwFYA,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAAC,OAAA,CAAAD,mBAAA,GAAAA,mBAAA;AAAA,IAsGnBE,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAAD,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAAA,IAKdC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAAF,OAAA,CAAAE,aAAA,GAAAA,aAAA;AAAA,IA8BbC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAAH,OAAA,CAAAG,oBAAA,GAAAA,oBAAA"}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.deleteProviderByTypeAndId = deleteProviderByTypeAndId;
7
+ exports.getAdminFederationProviderTypes = getAdminFederationProviderTypes;
8
+ exports.getAdminFederationProviders = getAdminFederationProviders;
9
+ exports.getAdminFederationProvidersByType = getAdminFederationProvidersByType;
10
+ exports.getProviderByTypeAndId = getProviderByTypeAndId;
11
+ exports.putProviderByTypeAndId = putProviderByTypeAndId;
12
+ var _util = _interopRequireDefault(require("util"));
13
+ var _BaseApi = require("../BaseApi");
14
+ var _ApiUtils = require("../utils/ApiUtils");
15
+ var state = _interopRequireWildcard(require("../../shared/State"));
16
+ 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); }
17
+ 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; }
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ 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); } }
20
+ 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); }); }; }
21
+ var getAllProviderTypesURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders?_action=getAllTypes';
22
+ var providerByTypeAndIdURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders/%s/%s';
23
+ var getAllProvidersURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders?_action=nextdescendents';
24
+ var getProvidersByTypeURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders/%s?_queryFilter=true';
25
+ var apiVersion = 'protocol=2.1,resource=1.0';
26
+ var getApiConfig = () => {
27
+ var configPath = (0, _ApiUtils.getRealmPath)('/');
28
+ return {
29
+ path: "".concat(configPath, "/realm-config/services/SocialIdentityProviders"),
30
+ apiVersion
31
+ };
32
+ };
33
+
34
+ /**
35
+ * Get admin federation provider types
36
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation provider types
37
+ */
38
+ function getAdminFederationProviderTypes() {
39
+ return _getAdminFederationProviderTypes.apply(this, arguments);
40
+ }
41
+ /**
42
+ * Get admin federation providers by type
43
+ * @param {String} type admin federation provider type
44
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers of the requested type
45
+ */
46
+ function _getAdminFederationProviderTypes() {
47
+ _getAdminFederationProviderTypes = _asyncToGenerator(function* () {
48
+ var urlString = _util.default.format(getAllProviderTypesURLTemplate, state.getHost(), (0, _ApiUtils.getRealmPath)('/'));
49
+ var {
50
+ data
51
+ } = yield (0, _BaseApi.generateAmApi)(getApiConfig()).get(urlString, {
52
+ withCredentials: true
53
+ });
54
+ return data;
55
+ });
56
+ return _getAdminFederationProviderTypes.apply(this, arguments);
57
+ }
58
+ function getAdminFederationProvidersByType(_x) {
59
+ return _getAdminFederationProvidersByType.apply(this, arguments);
60
+ }
61
+ /**
62
+ * Get all admin federation providers
63
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers
64
+ */
65
+ function _getAdminFederationProvidersByType() {
66
+ _getAdminFederationProvidersByType = _asyncToGenerator(function* (type) {
67
+ var urlString = _util.default.format(getProvidersByTypeURLTemplate, state.getHost(), (0, _ApiUtils.getRealmPath)('/'), type);
68
+ var {
69
+ data
70
+ } = yield (0, _BaseApi.generateAmApi)(getApiConfig()).get(urlString, {
71
+ withCredentials: true
72
+ });
73
+ return data;
74
+ });
75
+ return _getAdminFederationProvidersByType.apply(this, arguments);
76
+ }
77
+ function getAdminFederationProviders() {
78
+ return _getAdminFederationProviders.apply(this, arguments);
79
+ }
80
+ /**
81
+ * Get admin federation provider by type and id
82
+ * @param {*} type admin federation provider type
83
+ * @param {*} id admin federation provider id/name
84
+ * @returns {Promise} a promise that resolves to an object containing a admin federation provider
85
+ */
86
+ function _getAdminFederationProviders() {
87
+ _getAdminFederationProviders = _asyncToGenerator(function* () {
88
+ var urlString = _util.default.format(getAllProvidersURLTemplate, state.getHost(), (0, _ApiUtils.getRealmPath)('/'));
89
+ var {
90
+ data
91
+ } = yield (0, _BaseApi.generateAmApi)(getApiConfig()).post(urlString, {}, {
92
+ withCredentials: true
93
+ });
94
+ return data;
95
+ });
96
+ return _getAdminFederationProviders.apply(this, arguments);
97
+ }
98
+ function getProviderByTypeAndId(_x2, _x3) {
99
+ return _getProviderByTypeAndId.apply(this, arguments);
100
+ }
101
+ /**
102
+ * Get admin federation provider by type and id
103
+ * @param {String} type admin federation provider type
104
+ * @param {String} id admin federation provider id/name
105
+ * @param {Object} providerData a admin federation provider object
106
+ * @returns {Promise} a promise that resolves to an object containing a admin federation provider
107
+ */
108
+ function _getProviderByTypeAndId() {
109
+ _getProviderByTypeAndId = _asyncToGenerator(function* (type, id) {
110
+ var urlString = _util.default.format(providerByTypeAndIdURLTemplate, state.getHost(), (0, _ApiUtils.getRealmPath)('/'), type, id);
111
+ var {
112
+ data
113
+ } = yield (0, _BaseApi.generateAmApi)(getApiConfig()).get(urlString, {
114
+ withCredentials: true
115
+ });
116
+ return data;
117
+ });
118
+ return _getProviderByTypeAndId.apply(this, arguments);
119
+ }
120
+ function putProviderByTypeAndId(_x4, _x5, _x6) {
121
+ return _putProviderByTypeAndId.apply(this, arguments);
122
+ }
123
+ /**
124
+ * Delete admin federation provider by type and id
125
+ * @param {string} providerId provider type
126
+ * @param {string} providerId provider id
127
+ * @returns {Promise<unknown>} a promise that resolves to a admin federation provider
128
+ */
129
+ function _putProviderByTypeAndId() {
130
+ _putProviderByTypeAndId = _asyncToGenerator(function* (type, id, providerData) {
131
+ // until we figure out a way to use transport keys in Frodo,
132
+ // we'll have to drop those encrypted attributes.
133
+ var cleanData = (0, _ApiUtils.deleteDeepByKey)(providerData, '-encrypted');
134
+ var urlString = _util.default.format(providerByTypeAndIdURLTemplate, state.getHost(), (0, _ApiUtils.getRealmPath)('/'), type, id);
135
+ var {
136
+ data
137
+ } = yield (0, _BaseApi.generateAmApi)(getApiConfig()).put(urlString, cleanData, {
138
+ withCredentials: true
139
+ });
140
+ return data;
141
+ });
142
+ return _putProviderByTypeAndId.apply(this, arguments);
143
+ }
144
+ function deleteProviderByTypeAndId(_x7, _x8) {
145
+ return _deleteProviderByTypeAndId.apply(this, arguments);
146
+ }
147
+ function _deleteProviderByTypeAndId() {
148
+ _deleteProviderByTypeAndId = _asyncToGenerator(function* (type, providerId) {
149
+ var urlString = _util.default.format(providerByTypeAndIdURLTemplate, state.getHost(), (0, _ApiUtils.getRealmPath)('/'), type, providerId);
150
+ var {
151
+ data
152
+ } = yield (0, _BaseApi.generateAmApi)(getApiConfig()).delete(urlString, {
153
+ withCredentials: true
154
+ });
155
+ return data;
156
+ });
157
+ return _deleteProviderByTypeAndId.apply(this, arguments);
158
+ }
159
+ //# sourceMappingURL=AdminFederationProvidersApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdminFederationProvidersApi.js","names":["_util","_interopRequireDefault","require","_BaseApi","_ApiUtils","state","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","getAllProviderTypesURLTemplate","providerByTypeAndIdURLTemplate","getAllProvidersURLTemplate","getProvidersByTypeURLTemplate","apiVersion","getApiConfig","configPath","getRealmPath","path","concat","getAdminFederationProviderTypes","_getAdminFederationProviderTypes","urlString","util","format","getHost","data","generateAmApi","withCredentials","getAdminFederationProvidersByType","_x","_getAdminFederationProvidersByType","type","getAdminFederationProviders","_getAdminFederationProviders","post","getProviderByTypeAndId","_x2","_x3","_getProviderByTypeAndId","id","putProviderByTypeAndId","_x4","_x5","_x6","_putProviderByTypeAndId","providerData","cleanData","deleteDeepByKey","put","deleteProviderByTypeAndId","_x7","_x8","_deleteProviderByTypeAndId","providerId","delete"],"sources":["api/cloud/AdminFederationProvidersApi.ts"],"sourcesContent":["import util from 'util';\nimport { generateAmApi } from '../BaseApi';\nimport { deleteDeepByKey, getRealmPath } from '../utils/ApiUtils';\nimport * as state from '../../shared/State';\n\nconst getAllProviderTypesURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders?_action=getAllTypes';\nconst providerByTypeAndIdURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders/%s/%s';\nconst getAllProvidersURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders?_action=nextdescendents';\nconst getProvidersByTypeURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders/%s?_queryFilter=true';\nconst apiVersion = 'protocol=2.1,resource=1.0';\nconst getApiConfig = () => {\n const configPath = getRealmPath('/');\n return {\n path: `${configPath}/realm-config/services/SocialIdentityProviders`,\n apiVersion,\n };\n};\n\n/**\n * Get admin federation provider types\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation provider types\n */\nexport async function getAdminFederationProviderTypes() {\n const urlString = util.format(\n getAllProviderTypesURLTemplate,\n state.getHost(),\n getRealmPath('/')\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get admin federation providers by type\n * @param {String} type admin federation provider type\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers of the requested type\n */\nexport async function getAdminFederationProvidersByType(type) {\n const urlString = util.format(\n getProvidersByTypeURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get all admin federation providers\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers\n */\nexport async function getAdminFederationProviders() {\n const urlString = util.format(\n getAllProvidersURLTemplate,\n state.getHost(),\n getRealmPath('/')\n );\n const { data } = await generateAmApi(getApiConfig()).post(\n urlString,\n {},\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get admin federation provider by type and id\n * @param {*} type admin federation provider type\n * @param {*} id admin federation provider id/name\n * @returns {Promise} a promise that resolves to an object containing a admin federation provider\n */\nexport async function getProviderByTypeAndId(type, id) {\n const urlString = util.format(\n providerByTypeAndIdURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type,\n id\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get admin federation provider by type and id\n * @param {String} type admin federation provider type\n * @param {String} id admin federation provider id/name\n * @param {Object} providerData a admin federation provider object\n * @returns {Promise} a promise that resolves to an object containing a admin federation provider\n */\nexport async function putProviderByTypeAndId(type, id, providerData) {\n // until we figure out a way to use transport keys in Frodo,\n // we'll have to drop those encrypted attributes.\n const cleanData = deleteDeepByKey(providerData, '-encrypted');\n const urlString = util.format(\n providerByTypeAndIdURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type,\n id\n );\n const { data } = await generateAmApi(getApiConfig()).put(\n urlString,\n cleanData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete admin federation provider by type and id\n * @param {string} providerId provider type\n * @param {string} providerId provider id\n * @returns {Promise<unknown>} a promise that resolves to a admin federation provider\n */\nexport async function deleteProviderByTypeAndId(\n type: string,\n providerId: string\n) {\n const urlString = util.format(\n providerByTypeAndIdURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type,\n providerId\n );\n const { data } = await generateAmApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAA4C,SAAAK,yBAAAC,WAA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perty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.state = exports.constants = exports.VariablesRaw = exports.Variables = exports.ValidationUtils = exports.Utils = exports.TypesRaw = exports.Types = exports.TreeRaw = exports.Theme = exports.StartupRaw = exports.Startup = exports.SocialIdentityProvidersRaw = exports.ServiceAccount = exports.Service = exports.SecretsRaw = exports.Secrets = exports.Script = exports.Saml2 = exports.ResourceType = exports.Realm = exports.PolicySet = exports.Policy = exports.Organization = exports.OAuth2Provider = exports.OAuth2OIDCApi = exports.OAuth2Client = exports.NodeRaw = exports.Node = exports.ManagedObject = exports.Log = exports.LibVersion = exports.Journey = exports.Jose = exports.Info = exports.Idp = exports.IdmConfigRaw = exports.Idm = exports.ExportImportUtils = exports.EmailTemplate = exports.ConnectionProfile = exports.CirclesOfTrust = exports.Base64 = exports.AuthenticateRaw = exports.Authenticate = exports.AgentRaw = exports.Agent = exports.Admin = void 0;
6
+ exports.state = exports.constants = exports.VariablesRaw = exports.Variables = exports.ValidationUtils = exports.Utils = exports.TypesRaw = exports.Types = exports.TreeRaw = exports.Theme = exports.StartupRaw = exports.Startup = exports.SocialIdentityProvidersRaw = exports.ServiceAccount = exports.Service = exports.SecretsRaw = exports.Secrets = exports.Script = exports.Saml2 = exports.ResourceType = exports.Realm = exports.PolicySet = exports.Policy = exports.Organization = exports.OAuth2Provider = exports.OAuth2OIDCApi = exports.OAuth2Client = exports.NodeRaw = exports.Node = exports.ManagedObject = exports.Log = exports.LibVersion = exports.Journey = exports.Jose = exports.Info = exports.Idp = exports.IdmConfigRaw = exports.Idm = exports.ExportImportUtils = exports.EmailTemplate = exports.ConnectionProfile = exports.CirclesOfTrust = exports.Base64 = exports.AuthenticateRaw = exports.Authenticate = exports.AgentRaw = exports.Agent = exports.AdminFederation = exports.Admin = void 0;
7
7
  var _colors = _interopRequireDefault(require("colors"));
8
8
  var _AgentRaw = _interopRequireWildcard(require("./api/AgentApi"));
9
9
  exports.AgentRaw = _AgentRaw;
@@ -29,6 +29,8 @@ var _IdmConfigRaw = _interopRequireWildcard(require("./api/IdmConfigApi"));
29
29
  exports.IdmConfigRaw = _IdmConfigRaw;
30
30
  var _Admin = _interopRequireWildcard(require("./ops/AdminOps"));
31
31
  exports.Admin = _Admin;
32
+ var _AdminFederation = _interopRequireWildcard(require("./ops/cloud/AdminFederationOps"));
33
+ exports.AdminFederation = _AdminFederation;
32
34
  var _Agent = _interopRequireWildcard(require("./ops/AgentOps"));
33
35
  exports.Agent = _Agent;
34
36
  var _Authenticate = _interopRequireWildcard(require("./ops/AuthenticateOps"));
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_colors","_interopRequireDefault","require","_AgentRaw","_interopRequireWildcard","exports","AgentRaw","_AuthenticateRaw","AuthenticateRaw","_NodeRaw","NodeRaw","_OAuth2OIDCApi","OAuth2OIDCApi","_SecretsRaw","SecretsRaw","_SocialIdentityProvidersRaw","SocialIdentityProvidersRaw","_StartupRaw","StartupRaw","_TreeRaw","TreeRaw","_TypesRaw","TypesRaw","_VariablesRaw","VariablesRaw","_IdmConfigRaw","IdmConfigRaw","_Admin","Admin","_Agent","Agent","_Authenticate","Authenticate","_CirclesOfTrust","CirclesOfTrust","_ConnectionProfile","ConnectionProfile","_EmailTemplate","EmailTemplate","_Idp","Idp","_Idm","Idm","_Info","Info","_Journey","Journey","_Jose","Jose","_Log","Log","_ManagedObject","ManagedObject","_Node","Node","_OAuth2Client","OAuth2Client","_OAuth2Provider","OAuth2Provider","_Organization","Organization","_Policy","Policy","_PolicySet","PolicySet","_Realm","Realm","_ResourceType","ResourceType","_Saml","Saml2","_Script","Script","_Service","Service","_Secrets","Secrets","_ServiceAccount","ServiceAccount","_Startup","Startup","_Theme","Theme","_Types","Types","_Variables","Variables","_Utils","Utils","_Base","Base64","_ValidationUtils","ValidationUtils","_LibVersion","LibVersion","_ExportImportUtils","ExportImportUtils","_state","state","_constants","constants","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Color","enable"],"sources":["index.ts"],"sourcesContent":["import Color from 'colors';\n\nColor.enable();\n\n// Api Layer\nexport * as AgentRaw from './api/AgentApi';\nexport * as AuthenticateRaw from './api/AuthenticateApi';\nexport * as NodeRaw from './api/NodeApi';\n// TODO: need to figure out if this is the right approach or if we should even\n// use a public oauth2/oidc library. might be ok for now since there is only\n// one place where the cli needs to execute an oauth flow.\nexport * as OAuth2OIDCApi from './api/OAuth2OIDCApi';\nexport * as SecretsRaw from './api/cloud/SecretsApi';\nexport * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';\nexport * as StartupRaw from './api/cloud/StartupApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as TypesRaw from './api/ApiTypes';\nexport * as VariablesRaw from './api/cloud/VariablesApi';\nexport * as IdmConfigRaw from './api/IdmConfigApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\nexport * as Agent from './ops/AgentOps';\nexport * as Authenticate from './ops/AuthenticateOps';\nexport * as CirclesOfTrust from './ops/CirclesOfTrustOps';\nexport * as ConnectionProfile from './ops/ConnectionProfileOps';\nexport * as EmailTemplate from './ops/EmailTemplateOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Idm from './ops/IdmOps';\nexport * as Info from './ops/InfoOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Jose from './ops/JoseOps';\nexport * as Log from './ops/cloud/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as Node from './ops/NodeOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as OAuth2Provider from './ops/OAuth2ProviderOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Policy from './ops/PolicyOps';\nexport * as PolicySet from './ops/PolicySetOps';\nexport * as Realm from './ops/RealmOps';\nexport * as ResourceType from './ops/ResourceTypeOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Service from './ops/ServiceOps';\nexport * as Secrets from './ops/cloud/SecretsOps';\nexport * as ServiceAccount from './ops/cloud/ServiceAccountOps';\nexport * as Startup from './ops/cloud/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Types from './ops/OpsTypes';\nexport * as Variables from './ops/cloud/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\nexport * as Base64 from './api/utils/Base64';\nexport * as ValidationUtils from './ops/utils/ValidationUtils';\nexport * as LibVersion from './ops/utils/Version';\nexport * as ExportImportUtils from './ops/utils/ExportImportUtils';\n// TODO: reconsider the aproach to pass in state from client\n// lib should be stateless, an aplication should own its state\nexport * as state from './shared/State';\nexport * as constants from './storage/StaticStorage';\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2B,IAAAC,SAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAC,QAAA,GAAAH,SAAA;AAAA,IAAAI,gBAAA,GAAAH,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAG,eAAA,GAAAD,gBAAA;AAAA,IAAAE,QAAA,GAAAL,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAK,OAAA,GAAAD,QAAA;AAAA,IAAAE,cAAA,GAAAP,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAO,aAAA,GAAAD,cAAA;AAAA,IAAAE,WAAA,GAAAT,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAS,UAAA,GAAAD,WAAA;AAAA,IAAAE,2BAAA,GAAAX,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAW,0BAAA,GAAAD,2BAAA;AAAA,IAAAE,WAAA,GAAAb,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAa,UAAA,GAAAD,WAAA;AAAA,IAAAE,QAAA,GAAAf,uBAAA,CAAAF,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":["_colors","_interopRequireDefault","require","_AgentRaw","_interopRequireWildcard","exports","AgentRaw","_AuthenticateRaw","AuthenticateRaw","_NodeRaw","NodeRaw","_OAuth2OIDCApi","OAuth2OIDCApi","_SecretsRaw","SecretsRaw","_SocialIdentityProvidersRaw","SocialIdentityProvidersRaw","_StartupRaw","StartupRaw","_TreeRaw","TreeRaw","_TypesRaw","TypesRaw","_VariablesRaw","VariablesRaw","_IdmConfigRaw","IdmConfigRaw","_Admin","Admin","_AdminFederation","AdminFederation","_Agent","Agent","_Authenticate","Authenticate","_CirclesOfTrust","CirclesOfTrust","_ConnectionProfile","ConnectionProfile","_EmailTemplate","EmailTemplate","_Idp","Idp","_Idm","Idm","_Info","Info","_Journey","Journey","_Jose","Jose","_Log","Log","_ManagedObject","ManagedObject","_Node","Node","_OAuth2Client","OAuth2Client","_OAuth2Provider","OAuth2Provider","_Organization","Organization","_Policy","Policy","_PolicySet","PolicySet","_Realm","Realm","_ResourceType","ResourceType","_Saml","Saml2","_Script","Script","_Service","Service","_Secrets","Secrets","_ServiceAccount","ServiceAccount","_Startup","Startup","_Theme","Theme","_Types","Types","_Variables","Variables","_Utils","Utils","_Base","Base64","_ValidationUtils","ValidationUtils","_LibVersion","LibVersion","_ExportImportUtils","ExportImportUtils","_state","state","_constants","constants","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Color","enable"],"sources":["index.ts"],"sourcesContent":["import Color from 'colors';\n\nColor.enable();\n\n// Api Layer\nexport * as AgentRaw from './api/AgentApi';\nexport * as AuthenticateRaw from './api/AuthenticateApi';\nexport * as NodeRaw from './api/NodeApi';\n// TODO: need to figure out if this is the right approach or if we should even\n// use a public oauth2/oidc library. might be ok for now since there is only\n// one place where the cli needs to execute an oauth flow.\nexport * as OAuth2OIDCApi from './api/OAuth2OIDCApi';\nexport * as SecretsRaw from './api/cloud/SecretsApi';\nexport * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';\nexport * as StartupRaw from './api/cloud/StartupApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as TypesRaw from './api/ApiTypes';\nexport * as VariablesRaw from './api/cloud/VariablesApi';\nexport * as IdmConfigRaw from './api/IdmConfigApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\nexport * as AdminFederation from './ops/cloud/AdminFederationOps';\nexport * as Agent from './ops/AgentOps';\nexport * as Authenticate from './ops/AuthenticateOps';\nexport * as CirclesOfTrust from './ops/CirclesOfTrustOps';\nexport * as ConnectionProfile from './ops/ConnectionProfileOps';\nexport * as EmailTemplate from './ops/EmailTemplateOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Idm from './ops/IdmOps';\nexport * as Info from './ops/InfoOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Jose from './ops/JoseOps';\nexport * as Log from './ops/cloud/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as Node from './ops/NodeOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as OAuth2Provider from './ops/OAuth2ProviderOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Policy from './ops/PolicyOps';\nexport * as PolicySet from './ops/PolicySetOps';\nexport * as Realm from './ops/RealmOps';\nexport * as ResourceType from './ops/ResourceTypeOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Service from './ops/ServiceOps';\nexport * as Secrets from './ops/cloud/SecretsOps';\nexport * as ServiceAccount from './ops/cloud/ServiceAccountOps';\nexport * as Startup from './ops/cloud/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Types from './ops/OpsTypes';\nexport * as Variables from './ops/cloud/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\nexport * as Base64 from './api/utils/Base64';\nexport * as ValidationUtils from './ops/utils/ValidationUtils';\nexport * as LibVersion from './ops/utils/Version';\nexport * as ExportImportUtils from './ops/utils/ExportImportUtils';\n// TODO: reconsider the aproach to pass in state from client\n// lib should be stateless, an aplication should own its state\nexport * as state from './shared/State';\nexport * as constants from './storage/StaticStorage';\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2B,IAAAC,SAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAC,QAAA,GAAAH,SAAA;AAAA,IAAAI,gBAAA,GAAAH,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAG,eAAA,GAAAD,gBAAA;AAAA,IAAAE,QAAA,GAAAL,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAK,OAAA,GAAAD,QAAA;AAAA,IAAAE,cAAA,GAAAP,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAO,aAAA,GAAAD,cAAA;AAAA,IAAAE,WAAA,GAAAT,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAS,UAAA,GAAAD,WAAA;AAAA,IAAAE,2BAAA,GAAAX,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAW,0BAAA,GAAAD,2BAAA;AAAA,IAAAE,WAAA,GAAAb,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAa,UAAA,GAAAD,WAAA;AAAA,IAAAE,QAAA,GAAAf,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAe,OAAA,GAAAD,QAAA;AAAA,IAAAE,SAAA,GAAAjB,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAiB,QAAA,GAAAD,SAAA;AAAA,IAAAE,aAAA,GAAAnB,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAmB,YAAA,GAAAD,aAAA;AAAA,IAAAE,aAAA,GAAArB,uBAAA,CAAAF,OAAA;AAAAG,OAAA,CAAAqB,YAAA,GAAAD,aAAA;AAAA,IAAAE,MAAA,GAAAvB,uBAAA,CAAA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AE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAAjH,uBAAA2G,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3BiB,eAAK,CAACC,MAAM,CAAC,CAAC;;AAEd;;AAIA;AACA;AACA;AAUA;AAgCA;AAMA;AACA"}
@@ -0,0 +1,304 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.deleteAdminFederationProvider = deleteAdminFederationProvider;
7
+ exports.exportAdminFederationProvider = exportAdminFederationProvider;
8
+ exports.exportAdminFederationProviders = exportAdminFederationProviders;
9
+ exports.getAdminFederationProvider = getAdminFederationProvider;
10
+ exports.getAdminFederationProviders = getAdminFederationProviders;
11
+ exports.importAdminFederationProvider = importAdminFederationProvider;
12
+ exports.importAdminFederationProviders = importAdminFederationProviders;
13
+ exports.importFirstAdminFederationProvider = importFirstAdminFederationProvider;
14
+ exports.putProviderByTypeAndId = putProviderByTypeAndId;
15
+ var _AdminFederationProvidersApi = require("../../api/cloud/AdminFederationProvidersApi");
16
+ var _ExportImportUtils = require("../utils/ExportImportUtils");
17
+ var _Console = require("../utils/Console");
18
+ var _IdmConfigApi = require("../../api/IdmConfigApi");
19
+ 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); } }
20
+ 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); }); }; }
21
+ var ADMIN_FED_CONFIG_ID_PREFIX = 'fidc/federation-';
22
+
23
+ /**
24
+ * Create an empty idp export template
25
+ * @returns {AdminFederationExportInterface} an empty idp export template
26
+ */
27
+ function createAdminFederationExportTemplate() {
28
+ return {
29
+ meta: (0, _ExportImportUtils.getMetadata)(),
30
+ config: {},
31
+ idp: {}
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Get all admin federation providers
37
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers
38
+ */
39
+ function getAdminFederationProviders() {
40
+ return _getAdminFederationProviders2.apply(this, arguments);
41
+ }
42
+ /**
43
+ * Get admin federation provider by id
44
+ * @param {String} providerId social identity provider id/name
45
+ * @returns {Promise} a promise that resolves a social admin federation object
46
+ */
47
+ function _getAdminFederationProviders2() {
48
+ _getAdminFederationProviders2 = _asyncToGenerator(function* () {
49
+ var {
50
+ result
51
+ } = yield (0, _AdminFederationProvidersApi.getAdminFederationProviders)();
52
+ return result;
53
+ });
54
+ return _getAdminFederationProviders2.apply(this, arguments);
55
+ }
56
+ function getAdminFederationProvider(_x) {
57
+ return _getAdminFederationProvider.apply(this, arguments);
58
+ }
59
+ function _getAdminFederationProvider() {
60
+ _getAdminFederationProvider = _asyncToGenerator(function* (providerId) {
61
+ var response = yield getAdminFederationProviders();
62
+ var foundProviders = response.filter(provider => provider._id === providerId);
63
+ switch (foundProviders.length) {
64
+ case 1:
65
+ return foundProviders[0];
66
+ case 0:
67
+ throw new Error("Provider '".concat(providerId, "' not found"));
68
+ default:
69
+ throw new Error("".concat(foundProviders.length, " providers '").concat(providerId, "' found"));
70
+ }
71
+ });
72
+ return _getAdminFederationProvider.apply(this, arguments);
73
+ }
74
+ function putProviderByTypeAndId(_x2, _x3, _x4) {
75
+ return _putProviderByTypeAndId2.apply(this, arguments);
76
+ }
77
+ /**
78
+ * Delete admin federation provider by id
79
+ * @param {String} providerId admin federation provider id/name
80
+ * @returns {Promise} a promise that resolves to an admin federation provider object
81
+ */
82
+ function _putProviderByTypeAndId2() {
83
+ _putProviderByTypeAndId2 = _asyncToGenerator(function* (providerType, providerId, providerData) {
84
+ (0, _Console.debugMessage)("AdminFederationOps.putProviderByTypeAndId: start");
85
+ try {
86
+ var response = yield (0, _AdminFederationProvidersApi.putProviderByTypeAndId)(providerType, providerId, providerData);
87
+ (0, _Console.debugMessage)("AdminFederationOps.putProviderByTypeAndId: end");
88
+ return response;
89
+ } catch (importError) {
90
+ var _importError$response, _importError$response2, _importError$response3;
91
+ 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.') {
92
+ var {
93
+ validAttributes
94
+ } = importError.response.data.detail;
95
+ validAttributes.push('_id', '_type');
96
+ for (var attribute of Object.keys(providerData)) {
97
+ if (!validAttributes.includes(attribute)) {
98
+ (0, _Console.debugMessage)("Removing invalid attribute: ".concat(attribute));
99
+ delete providerData[attribute];
100
+ }
101
+ }
102
+ var _response = yield (0, _AdminFederationProvidersApi.putProviderByTypeAndId)(providerType, providerId, providerData);
103
+ (0, _Console.debugMessage)("AdminFederationOps.putProviderByTypeAndId: end (after retry)");
104
+ return _response;
105
+ } else {
106
+ // re-throw unhandleable error
107
+ throw importError;
108
+ }
109
+ }
110
+ });
111
+ return _putProviderByTypeAndId2.apply(this, arguments);
112
+ }
113
+ function deleteAdminFederationProvider(_x5) {
114
+ return _deleteAdminFederationProvider.apply(this, arguments);
115
+ }
116
+ /**
117
+ * Export admin federation provider by id
118
+ * @param {string} providerId provider id/name
119
+ * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object
120
+ */
121
+ function _deleteAdminFederationProvider() {
122
+ _deleteAdminFederationProvider = _asyncToGenerator(function* (providerId) {
123
+ var response = yield getAdminFederationProviders();
124
+ var foundProviders = response.filter(provider => provider._id === providerId);
125
+ switch (foundProviders.length) {
126
+ case 1:
127
+ return yield (0, _AdminFederationProvidersApi.deleteProviderByTypeAndId)(foundProviders[0]._type._id, foundProviders[0]._id);
128
+ case 0:
129
+ throw new Error("Provider '".concat(providerId, "' not found"));
130
+ default:
131
+ throw new Error("".concat(foundProviders.length, " providers '").concat(providerId, "' found"));
132
+ }
133
+ });
134
+ return _deleteAdminFederationProvider.apply(this, arguments);
135
+ }
136
+ function exportAdminFederationProvider(_x6) {
137
+ return _exportAdminFederationProvider.apply(this, arguments);
138
+ }
139
+ /**
140
+ * Export all providers
141
+ * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object
142
+ */
143
+ function _exportAdminFederationProvider() {
144
+ _exportAdminFederationProvider = _asyncToGenerator(function* (providerId) {
145
+ (0, _Console.debugMessage)("AdminFederationOps.exportAdminFederationProvider: start");
146
+ var exportData = createAdminFederationExportTemplate();
147
+ var errors = [];
148
+ try {
149
+ var idpData = yield getAdminFederationProvider(providerId);
150
+ exportData.idp[idpData._id] = idpData;
151
+ var idpConfig = yield (0, _IdmConfigApi.getConfigEntity)("".concat(ADMIN_FED_CONFIG_ID_PREFIX).concat(providerId));
152
+ exportData.config[idpConfig._id] = idpConfig;
153
+ } catch (error) {
154
+ errors.push(error);
155
+ }
156
+ if (errors.length) {
157
+ var errorMessages = errors.map(error => error.message).join('\n');
158
+ throw new Error("Export error:\n".concat(errorMessages));
159
+ }
160
+ (0, _Console.debugMessage)("AdminFederationOps.exportAdminFederationProvider: end");
161
+ return exportData;
162
+ });
163
+ return _exportAdminFederationProvider.apply(this, arguments);
164
+ }
165
+ function exportAdminFederationProviders() {
166
+ return _exportAdminFederationProviders.apply(this, arguments);
167
+ }
168
+ /**
169
+ * Import admin federation provider by id/name
170
+ * @param {string} providerId provider id/name
171
+ * @param {AdminFederationExportInterface} importData import data
172
+ */
173
+ function _exportAdminFederationProviders() {
174
+ _exportAdminFederationProviders = _asyncToGenerator(function* () {
175
+ (0, _Console.debugMessage)("AdminFederationOps.exportAdminFederationProviders: start");
176
+ var exportData = createAdminFederationExportTemplate();
177
+ var errors = [];
178
+ try {
179
+ var allIdpsData = yield getAdminFederationProviders();
180
+ for (var idpData of allIdpsData) {
181
+ try {
182
+ exportData.idp[idpData._id] = idpData;
183
+ var idpConfig = yield (0, _IdmConfigApi.getConfigEntity)("".concat(ADMIN_FED_CONFIG_ID_PREFIX).concat(idpData._id));
184
+ exportData.config[idpConfig._id] = idpConfig;
185
+ } catch (error) {
186
+ errors.push(error);
187
+ }
188
+ }
189
+ } catch (error) {
190
+ errors.push(error);
191
+ }
192
+ if (errors.length) {
193
+ var errorMessages = errors.map(error => error.message).join('\n');
194
+ throw new Error("Export error:\n".concat(errorMessages));
195
+ }
196
+ (0, _Console.debugMessage)("AdminFederationOps.exportAdminFederationProviders: end");
197
+ return exportData;
198
+ });
199
+ return _exportAdminFederationProviders.apply(this, arguments);
200
+ }
201
+ function importAdminFederationProvider(_x7, _x8) {
202
+ return _importAdminFederationProvider.apply(this, arguments);
203
+ }
204
+ /**
205
+ * Import first provider
206
+ * @param {AdminFederationExportInterface} importData import data
207
+ */
208
+ function _importAdminFederationProvider() {
209
+ _importAdminFederationProvider = _asyncToGenerator(function* (providerId, importData) {
210
+ var response = null;
211
+ var errors = [];
212
+ var imported = [];
213
+ for (var idpId of Object.keys(importData.idp)) {
214
+ if (idpId === providerId) {
215
+ try {
216
+ response = yield putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
217
+ var configId = "".concat(ADMIN_FED_CONFIG_ID_PREFIX).concat(idpId);
218
+ if (importData.config[configId]) {
219
+ yield (0, _IdmConfigApi.putConfigEntity)(configId, importData.config[configId]);
220
+ }
221
+ imported.push(idpId);
222
+ } catch (error) {
223
+ errors.push(error);
224
+ }
225
+ }
226
+ }
227
+ if (errors.length) {
228
+ var errorMessages = errors.map(error => error.message).join('\n');
229
+ throw new Error("Import error:\n".concat(errorMessages));
230
+ }
231
+ if (0 === imported.length) {
232
+ throw new Error("Import error:\n".concat(providerId, " not found in import data!"));
233
+ }
234
+ return response;
235
+ });
236
+ return _importAdminFederationProvider.apply(this, arguments);
237
+ }
238
+ function importFirstAdminFederationProvider(_x9) {
239
+ return _importFirstAdminFederationProvider.apply(this, arguments);
240
+ }
241
+ /**
242
+ * Import all providers
243
+ * @param {AdminFederationExportInterface} importData import data
244
+ */
245
+ function _importFirstAdminFederationProvider() {
246
+ _importFirstAdminFederationProvider = _asyncToGenerator(function* (importData) {
247
+ var response = null;
248
+ var errors = [];
249
+ var imported = [];
250
+ for (var idpId of Object.keys(importData.idp)) {
251
+ try {
252
+ response = yield putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
253
+ var configId = "".concat(ADMIN_FED_CONFIG_ID_PREFIX).concat(idpId);
254
+ if (importData.config[configId]) {
255
+ yield (0, _IdmConfigApi.putConfigEntity)(configId, importData.config[configId]);
256
+ }
257
+ imported.push(idpId);
258
+ } catch (error) {
259
+ errors.push(error);
260
+ }
261
+ }
262
+ if (errors.length) {
263
+ var errorMessages = errors.map(error => error.message).join('\n');
264
+ throw new Error("Import error:\n".concat(errorMessages));
265
+ }
266
+ if (0 === imported.length) {
267
+ throw new Error("Import error:\nNo providers found in import data!");
268
+ }
269
+ return response;
270
+ });
271
+ return _importFirstAdminFederationProvider.apply(this, arguments);
272
+ }
273
+ function importAdminFederationProviders(_x10) {
274
+ return _importAdminFederationProviders.apply(this, arguments);
275
+ }
276
+ function _importAdminFederationProviders() {
277
+ _importAdminFederationProviders = _asyncToGenerator(function* (importData) {
278
+ var response = [];
279
+ var errors = [];
280
+ var imported = [];
281
+ for (var idpId of Object.keys(importData.idp)) {
282
+ try {
283
+ response.push(yield putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]));
284
+ var configId = "".concat(ADMIN_FED_CONFIG_ID_PREFIX).concat(idpId);
285
+ if (importData.config[configId]) {
286
+ yield (0, _IdmConfigApi.putConfigEntity)(configId, importData.config[configId]);
287
+ }
288
+ imported.push(idpId);
289
+ } catch (error) {
290
+ errors.push(error);
291
+ }
292
+ }
293
+ if (errors.length) {
294
+ var errorMessages = errors.map(error => error.message).join('\n');
295
+ throw new Error("Import error:\n".concat(errorMessages));
296
+ }
297
+ if (0 === imported.length) {
298
+ throw new Error("Import error:\nNo providers found in import data!");
299
+ }
300
+ return response;
301
+ });
302
+ return _importAdminFederationProviders.apply(this, arguments);
303
+ }
304
+ //# sourceMappingURL=AdminFederationOps.js.map