@rockcarver/frodo-lib 2.0.0-82 → 2.0.0-83
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/build.zip +0 -0
- package/cjs/ops/ConnectorOps.js +9 -3
- package/cjs/ops/ConnectorOps.js.map +1 -1
- package/cjs/ops/MappingOps.js +5 -0
- package/cjs/ops/MappingOps.js.map +1 -1
- package/docs/classes/FrodoError.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/Reference.AdminFederationExportInterface.html +2 -2
- package/docs/interfaces/Reference.AgentExportInterface.html +2 -2
- package/docs/interfaces/Reference.ApplicationExportInterface.html +9 -9
- package/docs/interfaces/Reference.AuthenticationSettingsExportInterface.html +2 -2
- package/docs/interfaces/Reference.CirclesOfTrustExportInterface.html +2 -2
- package/docs/interfaces/Reference.ConfigEntityExportInterface.html +2 -2
- package/docs/interfaces/Reference.ConfigEntityImportOptions.html +3 -3
- package/docs/interfaces/Reference.ConnectionProfileInterface.html +2 -2
- package/docs/interfaces/Reference.ConnectionsFileInterface.html +1 -1
- package/docs/interfaces/Reference.ConnectorExportInterface.html +2 -2
- package/docs/interfaces/Reference.ConnectorExportOptions.html +4 -4
- package/docs/interfaces/Reference.ConnectorImportOptions.html +3 -3
- package/docs/interfaces/Reference.ConnectorServerStatusInterface.html +2 -2
- package/docs/interfaces/Reference.EmailTemplateExportInterface.html +2 -2
- package/docs/interfaces/Reference.EnvInfoInterface.html +2 -2
- package/docs/interfaces/Reference.ExportMetaData.html +2 -2
- package/docs/interfaces/Reference.FeatureInterface.html +2 -2
- package/docs/interfaces/Reference.FullExportInterface.html +2 -2
- package/docs/interfaces/Reference.FullExportOptions.html +6 -6
- package/docs/interfaces/Reference.FullImportOptions.html +8 -8
- package/docs/interfaces/Reference.FullService.html +2 -2
- package/docs/interfaces/Reference.IdObjectSkeletonInterface.html +2 -2
- package/docs/interfaces/Reference.InnerNodeRefSkeletonInterface.html +2 -2
- package/docs/interfaces/Reference.JwkInterface.html +2 -2
- package/docs/interfaces/Reference.JwksInterface.html +2 -2
- package/docs/interfaces/Reference.ManagedObjectPatchOperationInterface.html +3 -3
- package/docs/interfaces/Reference.MappingExportInterface.html +2 -2
- package/docs/interfaces/Reference.MappingImportOptions.html +3 -3
- package/docs/interfaces/Reference.MultiTreeExportInterface.html +2 -2
- package/docs/interfaces/Reference.NoIdObjectSkeletonInterface.html +2 -2
- package/docs/interfaces/Reference.NodeRefSkeletonInterface.html +2 -2
- package/docs/interfaces/Reference.OAuth2ClientExportInterface.html +2 -2
- package/docs/interfaces/Reference.OAuth2ClientExportOptions.html +4 -4
- package/docs/interfaces/Reference.OAuth2ClientImportOptions.html +3 -3
- package/docs/interfaces/Reference.OAuth2TrustedJwtIssuerExportInterface.html +2 -2
- package/docs/interfaces/Reference.OAuth2TrustedJwtIssuerExportOptions.html +4 -4
- package/docs/interfaces/Reference.OAuth2TrustedJwtIssuerImportOptions.html +3 -3
- package/docs/interfaces/Reference.PlatformInfoInterface.html +2 -2
- package/docs/interfaces/Reference.PolicyExportInterface.html +2 -2
- package/docs/interfaces/Reference.PolicyExportOptions.html +5 -5
- package/docs/interfaces/Reference.PolicyImportOptions.html +5 -5
- package/docs/interfaces/Reference.PolicySetExportInterface.html +2 -2
- package/docs/interfaces/Reference.PolicySetExportOptions.html +5 -5
- package/docs/interfaces/Reference.PolicySetImportOptions.html +4 -4
- package/docs/interfaces/Reference.ResourceTypeExportInterface.html +2 -2
- package/docs/interfaces/Reference.Saml2EntitiesExportOptions.html +2 -2
- package/docs/interfaces/Reference.Saml2EntitiesImportOptions.html +2 -2
- package/docs/interfaces/Reference.Saml2ExportInterface.html +2 -2
- package/docs/interfaces/Reference.ScriptExportInterface.html +2 -2
- package/docs/interfaces/Reference.ScriptImportOptions.html +4 -4
- package/docs/interfaces/Reference.SecretsExportInterface.html +2 -2
- package/docs/interfaces/Reference.SecureConnectionProfileInterface.html +2 -2
- package/docs/interfaces/Reference.ServiceExportInterface.html +2 -2
- package/docs/interfaces/Reference.ServiceImportOptions.html +5 -5
- package/docs/interfaces/Reference.ServiceListItem.html +4 -4
- package/docs/interfaces/Reference.ServiceNextDescendent.html +1 -1
- package/docs/interfaces/Reference.SingleTreeExportInterface.html +2 -2
- package/docs/interfaces/Reference.SocialIdentityProviderExportOptions.html +4 -4
- package/docs/interfaces/Reference.SocialIdentityProviderImportOptions.html +3 -3
- package/docs/interfaces/Reference.SocialProviderExportInterface.html +2 -2
- package/docs/interfaces/Reference.StateInterface.html +2 -2
- package/docs/interfaces/Reference.SystemObjectPatchOperationInterface.html +2 -2
- package/docs/interfaces/Reference.SystemStatusInterface.html +2 -2
- package/docs/interfaces/Reference.ThemeExportInterface.html +2 -2
- package/docs/interfaces/Reference.TokenCacheInterface.html +1 -1
- package/docs/interfaces/Reference.TreeDependencyMapInterface.html +1 -1
- package/docs/interfaces/Reference.TreeExportOptions.html +5 -5
- package/docs/interfaces/Reference.TreeExportResolverInterface.html +1 -1
- package/docs/interfaces/Reference.TreeImportOptions.html +4 -4
- package/docs/interfaces/Reference.UiConfigInterface.html +2 -2
- package/docs/interfaces/Reference.Updates.html +4 -4
- package/docs/interfaces/Reference.VariablesExportInterface.html +2 -2
- package/docs/modules/Reference.html +2 -2
- package/docs/modules.html +2 -2
- package/docs/types/Reference.AccessTokenMetaType.html +1 -1
- package/docs/types/Reference.AccessTokenResponseType.html +1 -1
- package/docs/types/Reference.Admin.html +13 -13
- package/docs/types/Reference.AdminFederation.html +15 -15
- package/docs/types/Reference.AdminFederationConfigSkeleton.html +1 -1
- package/docs/types/Reference.Agent.html +53 -53
- package/docs/types/Reference.AgentSkeleton.html +1 -1
- package/docs/types/Reference.AgentType.html +1 -1
- package/docs/types/Reference.AmServiceSkeleton.html +1 -1
- package/docs/types/Reference.AmServiceType.html +1 -1
- package/docs/types/Reference.Application.html +19 -19
- package/docs/types/Reference.ApplicationExportOptions.html +2 -2
- package/docs/types/Reference.ApplicationImportOptions.html +2 -2
- package/docs/types/Reference.ApplicationSkeleton.html +1 -1
- package/docs/types/Reference.Authenticate.html +3 -3
- package/docs/types/Reference.AuthenticationSettings.html +5 -5
- package/docs/types/Reference.AuthenticationSettingsSkeleton.html +1 -1
- package/docs/types/Reference.Base64.html +1 -1
- package/docs/types/Reference.Callback.html +1 -1
- package/docs/types/Reference.CallbackHandler.html +1 -1
- package/docs/types/Reference.CallbackKeyValuePair.html +1 -1
- package/docs/types/Reference.CallbackType.html +1 -1
- package/docs/types/Reference.CircleOfTrustSkeleton.html +1 -1
- package/docs/types/Reference.CirclesOfTrust.html +15 -15
- package/docs/types/Reference.Config.html +3 -3
- package/docs/types/Reference.ConnectionProfile.html +9 -9
- package/docs/types/Reference.Connector.html +13 -13
- package/docs/types/Reference.ConnectorSkeleton.html +1 -1
- package/docs/types/Reference.Constants.html +1 -1
- package/docs/types/Reference.DeleteJourneyStatus.html +1 -1
- package/docs/types/Reference.DeleteJourneysStatus.html +1 -1
- package/docs/types/Reference.EmailTemplate.html +13 -13
- package/docs/types/Reference.EmailTemplateSkeleton.html +1 -1
- package/docs/types/Reference.ExportImport.html +7 -7
- package/docs/types/Reference.FRUtils.html +1 -1
- package/docs/types/Reference.Feature.html +3 -3
- package/docs/types/Reference.Frodo.html +4 -4
- package/docs/types/Reference.GatewayAgentType.html +1 -1
- package/docs/types/Reference.IdmConfig.html +19 -19
- package/docs/types/Reference.IdmConfigStub.html +1 -1
- package/docs/types/Reference.IdmSystem.html +14 -14
- package/docs/types/Reference.Idp.html +21 -21
- package/docs/types/Reference.Info.html +2 -2
- package/docs/types/Reference.JavaAgentType.html +1 -1
- package/docs/types/Reference.Jose.html +1 -1
- package/docs/types/Reference.Journey.html +28 -28
- package/docs/types/Reference.JourneyClassificationType.html +1 -1
- package/docs/types/Reference.Json.html +7 -7
- package/docs/types/Reference.JwkRsa.html +1 -1
- package/docs/types/Reference.JwkRsaPublic.html +1 -1
- package/docs/types/Reference.Log.html +13 -13
- package/docs/types/Reference.LogApiKey.html +1 -1
- package/docs/types/Reference.LogEventPayloadSkeleton.html +1 -1
- package/docs/types/Reference.LogEventSkeleton.html +1 -1
- package/docs/types/Reference.ManagedObject.html +13 -13
- package/docs/types/Reference.Mapping.html +15 -15
- package/docs/types/Reference.MappingPolicy.html +1 -1
- package/docs/types/Reference.MappingProperty.html +1 -1
- package/docs/types/Reference.MappingSkeleton.html +1 -1
- package/docs/types/Reference.Node.html +16 -16
- package/docs/types/Reference.NodeClassificationType.html +1 -1
- package/docs/types/Reference.NodeSkeleton.html +1 -1
- package/docs/types/Reference.OAuth2Client.html +16 -16
- package/docs/types/Reference.OAuth2ClientSkeleton.html +1 -1
- package/docs/types/Reference.OAuth2Oidc.html +1 -1
- package/docs/types/Reference.OAuth2Provider.html +6 -6
- package/docs/types/Reference.OAuth2ProviderSkeleton.html +1 -1
- package/docs/types/Reference.OAuth2TrustedJwtIssuer.html +16 -16
- package/docs/types/Reference.OAuth2TrustedJwtIssuerSkeleton.html +1 -1
- package/docs/types/Reference.ObjectPropertyFlag.html +1 -1
- package/docs/types/Reference.ObjectPropertyNativeType.html +1 -1
- package/docs/types/Reference.ObjectPropertySkeleton.html +1 -1
- package/docs/types/Reference.ObjectPropertyType.html +1 -1
- package/docs/types/Reference.ObjectTypeSkeleton.html +1 -1
- package/docs/types/Reference.Organization.html +4 -4
- package/docs/types/Reference.PagedResult.html +1 -1
- package/docs/types/Reference.PlatformInfo.html +1 -1
- package/docs/types/Reference.Policy.html +18 -18
- package/docs/types/Reference.PolicyCondition.html +1 -1
- package/docs/types/Reference.PolicyConditionType.html +1 -1
- package/docs/types/Reference.PolicySet.html +11 -11
- package/docs/types/Reference.PolicySetSkeleton.html +1 -1
- package/docs/types/Reference.PolicySkeleton.html +1 -1
- package/docs/types/Reference.ProgressIndicatorStatusType.html +1 -1
- package/docs/types/Reference.ProgressIndicatorType.html +1 -1
- package/docs/types/Reference.Readable.html +1 -1
- package/docs/types/Reference.Realm.html +13 -13
- package/docs/types/Reference.RealmSkeleton.html +1 -1
- package/docs/types/Reference.Recon.html +6 -6
- package/docs/types/Reference.ReconStatusType.html +1 -1
- package/docs/types/Reference.ReconType.html +1 -1
- package/docs/types/Reference.ResourceType.html +18 -18
- package/docs/types/Reference.ResourceTypeSkeleton.html +1 -1
- package/docs/types/Reference.Saml2.html +19 -19
- package/docs/types/Reference.Saml2ProiderLocation.html +1 -1
- package/docs/types/Reference.Saml2ProviderSkeleton.html +1 -1
- package/docs/types/Reference.Saml2ProviderStub.html +1 -1
- package/docs/types/Reference.Script.html +18 -18
- package/docs/types/Reference.ScriptContext.html +1 -1
- package/docs/types/Reference.ScriptLanguage.html +1 -1
- package/docs/types/Reference.ScriptSkeleton.html +1 -1
- package/docs/types/Reference.ScriptValidation.html +1 -1
- package/docs/types/Reference.Secret.html +22 -22
- package/docs/types/Reference.SecretEncodingType.html +2 -2
- package/docs/types/Reference.SecretSkeleton.html +2 -2
- package/docs/types/Reference.Service.html +9 -9
- package/docs/types/Reference.ServiceAccount.html +4 -4
- package/docs/types/Reference.ServiceAccountType.html +1 -1
- package/docs/types/Reference.Session.html +2 -2
- package/docs/types/Reference.SessionInfoType.html +1 -1
- package/docs/types/Reference.SocialIdpSkeleton.html +1 -1
- package/docs/types/Reference.Startup.html +3 -3
- package/docs/types/Reference.State.html +7 -7
- package/docs/types/Reference.Theme.html +20 -20
- package/docs/types/Reference.ThemeSkeleton.html +1 -1
- package/docs/types/Reference.TokenCache.html +16 -16
- package/docs/types/Reference.TokenInfoResponseType.html +1 -1
- package/docs/types/Reference.Tokens.html +1 -1
- package/docs/types/Reference.TreeSkeleton.html +1 -1
- package/docs/types/Reference.UserSessionMetaType.html +1 -1
- package/docs/types/Reference.Variable.html +13 -13
- package/docs/types/Reference.VariableExpressionType.html +2 -2
- package/docs/types/Reference.VariableSkeleton.html +2 -2
- package/docs/types/Reference.Version.html +1 -1
- package/docs/types/Reference.VersionOfSecretSkeleton.html +2 -2
- package/docs/types/Reference.VersionOfSecretStatus.html +1 -1
- package/docs/types/Reference.WebAgentType.html +1 -1
- package/docs/types/Reference.Writable.html +1 -1
- package/docs/types/Reference.tokenType.html +1 -1
- package/docs/variables/frodo.html +2 -2
- package/docs/variables/state.html +2 -2
- package/esm/ops/ConnectorOps.js +10 -4
- package/esm/ops/ConnectorOps.js.map +1 -1
- package/esm/ops/MappingOps.js +5 -0
- package/esm/ops/MappingOps.js.map +1 -1
- package/package.json +1 -1
- package/types/ops/ConnectorOps.d.ts.map +1 -1
- package/types/ops/MappingOps.d.ts.map +1 -1
package/build.zip
CHANGED
|
Binary file
|
package/cjs/ops/ConnectorOps.js
CHANGED
|
@@ -502,14 +502,20 @@ function _importConnector() {
|
|
|
502
502
|
for (var key of Object.keys(importData.connector)) {
|
|
503
503
|
if (key === connectorId) {
|
|
504
504
|
try {
|
|
505
|
-
if (options.deps) {
|
|
506
|
-
//
|
|
507
|
-
}
|
|
508
505
|
response = yield updateConnector({
|
|
509
506
|
connectorId,
|
|
510
507
|
connectorData: importData.connector[connectorId],
|
|
511
508
|
state
|
|
512
509
|
});
|
|
510
|
+
if (options.deps) {
|
|
511
|
+
for (var connKey of Object.keys(importData.mapping)) {
|
|
512
|
+
response = yield (0, _MappingOps.updateMapping)({
|
|
513
|
+
mappingId: importData.mapping[connKey]._id,
|
|
514
|
+
mappingData: importData.mapping[connKey],
|
|
515
|
+
state
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
513
519
|
imported.push(key);
|
|
514
520
|
} catch (error) {
|
|
515
521
|
errors.push(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorOps.js","names":["_IdmConfigApi","require","_Console","_ExportImportUtils","_FrodoError","_IdmConfigOps","_MappingOps","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_default","state","CONNECTOR_TYPE","createConnectorExportTemplate","readConnectors","readConnector","connectorId","createConnector","connectorData","updateConnector","deleteConnectors","deleteConnector","exportConnector","_arguments","options","length","deps","useStringArrays","exportConnectors","importConnector","importData","importFirstConnector","importConnectors","exports","default","_ref","meta","getMetadata","connector","mapping","_x","_readConnectors","_ref2","connectors","readConfigEntitiesByType","type","FrodoError","_x2","_readConnector","_ref3","debugMessage","message","concat","entityId","getConfigEntity","_x3","_createConnector","_ref4","result","putConfigEntity","entityData","Error","_x4","_updateConnector","_ref5","_x5","_deleteConnectors","_ref6","errors","push","deleteConfigEntity","_x6","_deleteConnector","_ref7","_x7","_exportConnector","_ref8","exportData","mappings","readMappings","name","_x8","_exportConnectors","_ref9","allConnectorsData","indicatorId","createProgressIndicator","total","_id","split","updateProgressIndicator","id","stopProgressIndicator","_x9","_importConnector","_ref10","response","imported","Object","keys","_x10","_importFirstConnector","_ref11","_x11","_importConnectors","_ref12"],"sources":["../../src/ops/ConnectorOps.ts"],"sourcesContent":["import { IdObjectSkeletonInterface } from '../api/ApiTypes';\nimport {\n deleteConfigEntity,\n getConfigEntity,\n putConfigEntity,\n} from '../api/IdmConfigApi';\nimport { State } from '../shared/State';\nimport {\n createProgressIndicator,\n debugMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport { getMetadata } from '../utils/ExportImportUtils';\nimport { FrodoError } from './FrodoError';\nimport { readConfigEntitiesByType } from './IdmConfigOps';\nimport { MappingSkeleton, readMappings } from './MappingOps';\nimport { ExportMetaData } from './OpsTypes';\n\nexport type Connector = {\n /**\n * Connector type key used to build the IDM id: '<type>/<id>'\n */\n CONNECTOR_TYPE: string;\n /**\n * Create an empty connector export template\n * @returns {ConnectorExportInterface} an empty connector export template\n */\n createConnectorExportTemplate(): ConnectorExportInterface;\n /**\n * Get all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\n readConnectors(): Promise<ConnectorSkeleton[]>;\n /**\n * Get connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\n readConnector(connectorId: string): Promise<ConnectorSkeleton>;\n /**\n * Create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\n createConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton>;\n /**\n * Update or create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\n updateConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton>;\n /**\n * Delete all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\n deleteConnectors(): Promise<ConnectorSkeleton[]>;\n /**\n * Delete connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\n deleteConnector(connectorId: string): Promise<ConnectorSkeleton>;\n /**\n * Export connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorExportOptions} options export options\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\n exportConnector(\n connectorId: string,\n options?: ConnectorExportOptions\n ): Promise<ConnectorExportInterface>;\n /**\n * Export all connectors\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\n exportConnectors(): Promise<ConnectorExportInterface>;\n /**\n * Import connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\n importConnector(\n connectorId: string,\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton>;\n /**\n * Import first connector\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\n importFirstConnector(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton>;\n /**\n * Import all connectors\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton[]>} a promise resolving to an array of ConnectorSkeleton objects\n */\n importConnectors(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton[]>;\n};\n\nexport default (state: State): Connector => {\n return {\n CONNECTOR_TYPE,\n createConnectorExportTemplate(): ConnectorExportInterface {\n return createConnectorExportTemplate({ state });\n },\n async readConnectors(): Promise<ConnectorSkeleton[]> {\n return readConnectors({ state });\n },\n async readConnector(connectorId: string): Promise<ConnectorSkeleton> {\n return readConnector({ connectorId, state });\n },\n async createConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton> {\n return createConnector({\n connectorId,\n connectorData,\n state,\n });\n },\n async updateConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton> {\n return updateConnector({\n connectorId,\n connectorData,\n state,\n });\n },\n async deleteConnectors(): Promise<ConnectorSkeleton[]> {\n return deleteConnectors({ state });\n },\n async deleteConnector(connectorId: string): Promise<ConnectorSkeleton> {\n return deleteConnector({ connectorId, state });\n },\n async exportConnector(\n connectorId: string,\n options: ConnectorExportOptions = { deps: true, useStringArrays: true }\n ): Promise<ConnectorExportInterface> {\n return exportConnector({ connectorId, options, state });\n },\n async exportConnectors(): Promise<ConnectorExportInterface> {\n return exportConnectors({ state });\n },\n async importConnector(\n connectorId: string,\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton> {\n return importConnector({ connectorId, importData, options, state });\n },\n async importFirstConnector(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton> {\n return importFirstConnector({ importData, options, state });\n },\n async importConnectors(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton[]> {\n return importConnectors({ importData, options, state });\n },\n };\n};\n\n/**\n * Connector type key used to build the IDM id: '\\<type>/\\<id>'\n */\nexport const CONNECTOR_TYPE = 'provisioner.openicf';\n\nexport type ObjectPropertyFlag =\n | 'NOT_CREATABLE'\n | 'NOT_READABLE'\n | 'NOT_RETURNED_BY_DEFAULT'\n | 'NOT_UPDATEABLE';\n\nexport type ObjectPropertyType = 'array' | 'boolean' | 'string';\n\nexport type ObjectPropertyNativeType =\n | 'array'\n | 'boolean'\n | 'string'\n | 'JAVA_TYPE_BIGDECIMAL'\n | 'JAVA_TYPE_BIGINTEGER'\n | 'JAVA_TYPE_BYTE'\n | 'JAVA_TYPE_BYTE_ARRAY'\n | 'JAVA_TYPE_CHAR'\n | 'JAVA_TYPE_CHARACTER'\n | 'JAVA_TYPE_DATE'\n | 'JAVA_TYPE_DOUBLE'\n | 'JAVA_TYPE_FILE'\n | 'JAVA_TYPE_FLOAT'\n | 'JAVA_TYPE_GUARDEDBYTEARRAY'\n | 'JAVA_TYPE_GUARDEDSTRING'\n | 'JAVA_TYPE_INT'\n | 'JAVA_TYPE_INTEGER'\n | 'JAVA_TYPE_LONG'\n | 'JAVA_TYPE_OBJECT'\n | 'JAVA_TYPE_PRIMITIVE_BOOLEAN'\n | 'JAVA_TYPE_PRIMITIVE_BYTE'\n | 'JAVA_TYPE_PRIMITIVE_DOUBLE'\n | 'JAVA_TYPE_PRIMITIVE_FLOAT'\n | 'JAVA_TYPE_PRIMITIVE_LONG'\n | 'JAVA_TYPE_STRING';\n\nexport type ObjectPropertySkeleton = {\n flags?: ObjectPropertyFlag[];\n nativeName: string;\n nativeType: ObjectPropertyNativeType;\n type: ObjectPropertyType;\n runAsUser?: boolean;\n required?: boolean;\n items?: {\n nativeType: ObjectPropertyNativeType;\n type: ObjectPropertyType;\n };\n};\n\nexport type ObjectTypeSkeleton = {\n $schema: string;\n id: string;\n nativeType: string;\n properties: Record<string, ObjectPropertySkeleton>;\n type: 'object';\n};\n\nexport type ConnectorSkeleton = IdObjectSkeletonInterface & {\n configurationProperties: any;\n connectorRef: {\n bundleName: string;\n bundleVersion: string;\n connectorHostRef: string;\n connectorName: string;\n displayName: string;\n systemType: 'provisioner.openicf';\n };\n enabled: boolean;\n objectTypes: Record<string, ObjectTypeSkeleton>;\n};\n\n/**\n * Connector export options\n */\nexport interface ConnectorExportOptions {\n /**\n * Use string arrays to store multi-line text in scripts.\n */\n useStringArrays: boolean;\n /**\n * Include any dependencies (mappings).\n */\n deps: boolean;\n}\n\n/**\n * Connector import options\n */\nexport interface ConnectorImportOptions {\n /**\n * Include any dependencies (mappings).\n */\n deps: boolean;\n}\n\nexport interface ConnectorExportInterface {\n meta?: ExportMetaData;\n connector: Record<string, ConnectorSkeleton>;\n mapping?: Record<string, MappingSkeleton>;\n}\n\nexport function createConnectorExportTemplate({\n state,\n}: {\n state: State;\n}): ConnectorExportInterface {\n return {\n meta: getMetadata({ state }),\n connector: {},\n mapping: {},\n } as ConnectorExportInterface;\n}\n\n/**\n * Get all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\nexport async function readConnectors({\n state,\n}: {\n state: State;\n}): Promise<ConnectorSkeleton[]> {\n try {\n const connectors = await readConfigEntitiesByType({\n type: CONNECTOR_TYPE,\n state,\n });\n return connectors as ConnectorSkeleton[];\n } catch (error) {\n throw new FrodoError(`Error reading connectors`, error);\n }\n}\n\n/**\n * Get connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\nexport async function readConnector({\n connectorId,\n state,\n}: {\n connectorId: string;\n state: State;\n}): Promise<ConnectorSkeleton> {\n try {\n debugMessage({\n message: `ConnectorOps.readConnector: start [connector=${connectorId}]`,\n state,\n });\n const entityId = `${CONNECTOR_TYPE}/${connectorId}`;\n debugMessage({\n message: `ConnectorOps.readConnector: use entity id: ${entityId}`,\n state,\n });\n const connectorData = await getConfigEntity({\n entityId,\n state,\n });\n debugMessage({\n message: `ConnectorOps.readConnector: end [connector=${connectorId}]`,\n state,\n });\n return connectorData;\n } catch (error) {\n throw new FrodoError(`Error reading connector ${connectorId}`, error);\n }\n}\n\n/**\n * Create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\nexport async function createConnector({\n connectorId,\n connectorData,\n state,\n}: {\n connectorId: string;\n connectorData: ConnectorSkeleton;\n state: State;\n}): Promise<ConnectorSkeleton> {\n debugMessage({\n message: `ConnectorOps.createConnector: start`,\n state,\n });\n try {\n await readConnector({\n connectorId: connectorId,\n state,\n });\n } catch (error) {\n try {\n const result = await putConfigEntity({\n entityId: `${CONNECTOR_TYPE}/${connectorId}`,\n entityData: connectorData,\n state,\n });\n debugMessage({\n message: `ConnectorOps.createConnector: end`,\n state,\n });\n return result as ConnectorSkeleton;\n } catch (error) {\n throw new FrodoError(`Error creating connector ${connectorId}`, error);\n }\n }\n throw new Error(`Connector ${connectorId} already exists!`);\n}\n\n/**\n * Update or create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\nexport async function updateConnector({\n connectorId,\n connectorData,\n state,\n}: {\n connectorId: string;\n connectorData: ConnectorSkeleton;\n state: State;\n}): Promise<ConnectorSkeleton> {\n try {\n return putConfigEntity({\n entityId: `${CONNECTOR_TYPE}/${connectorId}`,\n entityData: connectorData,\n state,\n });\n } catch (error) {\n throw new FrodoError(`Error updating connector ${connectorId}`, error);\n }\n}\n\n/**\n * Delete all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\nexport async function deleteConnectors({\n state,\n}: {\n state: State;\n}): Promise<ConnectorSkeleton[]> {\n const errors: Error[] = [];\n try {\n debugMessage({\n message: `ConnectorOps.deleteConnectors: start`,\n state,\n });\n const result: ConnectorSkeleton[] = [];\n const connectors = await readConnectors({ state });\n for (const connector of connectors) {\n try {\n debugMessage({\n message: `ConnectorOps.deleteConnectors: '${connector['_id']}'`,\n state,\n });\n result.push(\n await deleteConfigEntity({\n entityId: connector['_id'],\n state,\n })\n );\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error deleting connectors`, errors);\n }\n debugMessage({\n message: `ConnectorOps.deleteConnectors: end`,\n state,\n });\n return result;\n } catch (error) {\n // re-throw previously caught errors\n if (errors.length > 0) {\n throw error;\n }\n throw new FrodoError(`Error deleting connectors`, error);\n }\n}\n\n/**\n * Delete connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\nexport async function deleteConnector({\n connectorId,\n state,\n}: {\n connectorId: string;\n state: State;\n}): Promise<ConnectorSkeleton> {\n try {\n return deleteConfigEntity({\n entityId: `${CONNECTOR_TYPE}/${connectorId}`,\n state,\n });\n } catch (error) {\n throw new FrodoError(`Error deleting connector ${connectorId}`, error);\n }\n}\n\n/**\n * Export connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\nexport async function exportConnector({\n connectorId,\n options = { deps: true, useStringArrays: true },\n state,\n}: {\n connectorId: string;\n options?: ConnectorExportOptions;\n state: State;\n}): Promise<ConnectorExportInterface> {\n try {\n debugMessage({\n message: `ConnectorOps.exportConnector: start [connector=${connectorId}]`,\n state,\n });\n const connectorData = await readConnector({ connectorId, state });\n const exportData = createConnectorExportTemplate({ state });\n exportData.connector[connectorId] = connectorData;\n if (options.deps) {\n const mappings = await readMappings({ connectorId, state });\n for (const mapping of mappings) {\n exportData.mapping[mapping.name] = mapping;\n }\n }\n debugMessage({ message: `ConnectorOps.exportConnector: end`, state });\n return exportData;\n } catch (error) {\n throw new FrodoError(`Error exporting connector ${connectorId}`, error);\n }\n}\n\n/**\n * Export all connectors\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\nexport async function exportConnectors({\n state,\n}: {\n state: State;\n}): Promise<ConnectorExportInterface> {\n try {\n const exportData = createConnectorExportTemplate({ state });\n const allConnectorsData = await readConnectors({ state });\n const indicatorId = createProgressIndicator({\n total: allConnectorsData.length,\n message: 'Exporting connectors',\n state,\n });\n for (const connectorData of allConnectorsData) {\n const connectorId = connectorData._id.split('/')[1];\n updateProgressIndicator({\n id: indicatorId,\n message: `Exporting connector ${connectorId}`,\n state,\n });\n exportData.connector[connectorId] = connectorData;\n }\n stopProgressIndicator({\n id: indicatorId,\n message: `${allConnectorsData.length} connectors exported.`,\n state,\n });\n return exportData;\n } catch (error) {\n throw new FrodoError(`Error exporting connectors`, error);\n }\n}\n\n/**\n * Import connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\nexport async function importConnector({\n connectorId,\n importData,\n options = { deps: true },\n state,\n}: {\n connectorId: string;\n importData: ConnectorExportInterface;\n options?: ConnectorImportOptions;\n state: State;\n}): Promise<ConnectorSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.connector)) {\n if (key === connectorId) {\n try {\n if (options.deps) {\n //\n }\n response = await updateConnector({\n connectorId,\n connectorData: importData.connector[connectorId],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing connector ${connectorId}`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`Connector ${connectorId} not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import first connector\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\nexport async function importFirstConnector({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: ConnectorExportInterface;\n options?: ConnectorImportOptions;\n state: State;\n}): Promise<ConnectorSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.connector)) {\n try {\n if (options.deps) {\n //\n }\n response = await updateConnector({\n connectorId: key,\n connectorData: importData.connector[key],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing first connector`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`No connectors not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import all connectors\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton[]>} a promise resolving to an array of ConnectorSkeleton objects\n */\nexport async function importConnectors({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: ConnectorExportInterface;\n options?: ConnectorImportOptions;\n state: State;\n}): Promise<ConnectorSkeleton[]> {\n const response = [];\n const errors = [];\n for (const key of Object.keys(importData.connector)) {\n try {\n if (options.deps) {\n //\n }\n response.push(\n await updateConnector({\n connectorId: key,\n connectorData: importData.connector[key],\n state,\n })\n );\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing connectors`, errors);\n }\n return response;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA6D,SAAAM,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,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,CAAC;UACxCiB;QACF,CAAC,CACH,CAAC;MACH,CAAC,CAAC,OAAOb,KAAK,EAAE;QACdsE,MAAM,CAACC,IAAI,CAACvE,KAAK,CAAC;MACpB;IACF;IACA,IAAIsE,MAAM,CAAC3C,MAAM,GAAG,CAAC,EAAE;MACrB,MAAM,IAAIqB,sBAAU,+BAA+BsB,MAAM,CAAC;IAC5D;IACA,OAAO4B,QAAQ;EACjB,CAAC;EAAA,OAAAQ,iBAAA,CAAAjG,KAAA,OAAAD,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"ConnectorOps.js","names":["_IdmConfigApi","require","_Console","_ExportImportUtils","_FrodoError","_IdmConfigOps","_MappingOps","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_default","state","CONNECTOR_TYPE","createConnectorExportTemplate","readConnectors","readConnector","connectorId","createConnector","connectorData","updateConnector","deleteConnectors","deleteConnector","exportConnector","_arguments","options","length","deps","useStringArrays","exportConnectors","importConnector","importData","importFirstConnector","importConnectors","exports","default","_ref","meta","getMetadata","connector","mapping","_x","_readConnectors","_ref2","connectors","readConfigEntitiesByType","type","FrodoError","_x2","_readConnector","_ref3","debugMessage","message","concat","entityId","getConfigEntity","_x3","_createConnector","_ref4","result","putConfigEntity","entityData","Error","_x4","_updateConnector","_ref5","_x5","_deleteConnectors","_ref6","errors","push","deleteConfigEntity","_x6","_deleteConnector","_ref7","_x7","_exportConnector","_ref8","exportData","mappings","readMappings","name","_x8","_exportConnectors","_ref9","allConnectorsData","indicatorId","createProgressIndicator","total","_id","split","updateProgressIndicator","id","stopProgressIndicator","_x9","_importConnector","_ref10","response","imported","Object","keys","connKey","updateMapping","mappingId","mappingData","_x10","_importFirstConnector","_ref11","_x11","_importConnectors","_ref12"],"sources":["../../src/ops/ConnectorOps.ts"],"sourcesContent":["import { IdObjectSkeletonInterface } from '../api/ApiTypes';\nimport {\n deleteConfigEntity,\n getConfigEntity,\n putConfigEntity,\n} from '../api/IdmConfigApi';\nimport { State } from '../shared/State';\nimport {\n createProgressIndicator,\n debugMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport { getMetadata } from '../utils/ExportImportUtils';\nimport { FrodoError } from './FrodoError';\nimport { readConfigEntitiesByType } from './IdmConfigOps';\nimport { MappingSkeleton, readMappings, updateMapping } from './MappingOps';\nimport { ExportMetaData } from './OpsTypes';\n\nexport type Connector = {\n /**\n * Connector type key used to build the IDM id: '<type>/<id>'\n */\n CONNECTOR_TYPE: string;\n /**\n * Create an empty connector export template\n * @returns {ConnectorExportInterface} an empty connector export template\n */\n createConnectorExportTemplate(): ConnectorExportInterface;\n /**\n * Get all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\n readConnectors(): Promise<ConnectorSkeleton[]>;\n /**\n * Get connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\n readConnector(connectorId: string): Promise<ConnectorSkeleton>;\n /**\n * Create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\n createConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton>;\n /**\n * Update or create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\n updateConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton>;\n /**\n * Delete all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\n deleteConnectors(): Promise<ConnectorSkeleton[]>;\n /**\n * Delete connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\n deleteConnector(connectorId: string): Promise<ConnectorSkeleton>;\n /**\n * Export connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorExportOptions} options export options\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\n exportConnector(\n connectorId: string,\n options?: ConnectorExportOptions\n ): Promise<ConnectorExportInterface>;\n /**\n * Export all connectors\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\n exportConnectors(): Promise<ConnectorExportInterface>;\n /**\n * Import connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\n importConnector(\n connectorId: string,\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton>;\n /**\n * Import first connector\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\n importFirstConnector(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton>;\n /**\n * Import all connectors\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton[]>} a promise resolving to an array of ConnectorSkeleton objects\n */\n importConnectors(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton[]>;\n};\n\nexport default (state: State): Connector => {\n return {\n CONNECTOR_TYPE,\n createConnectorExportTemplate(): ConnectorExportInterface {\n return createConnectorExportTemplate({ state });\n },\n async readConnectors(): Promise<ConnectorSkeleton[]> {\n return readConnectors({ state });\n },\n async readConnector(connectorId: string): Promise<ConnectorSkeleton> {\n return readConnector({ connectorId, state });\n },\n async createConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton> {\n return createConnector({\n connectorId,\n connectorData,\n state,\n });\n },\n async updateConnector(\n connectorId: string,\n connectorData: ConnectorSkeleton\n ): Promise<ConnectorSkeleton> {\n return updateConnector({\n connectorId,\n connectorData,\n state,\n });\n },\n async deleteConnectors(): Promise<ConnectorSkeleton[]> {\n return deleteConnectors({ state });\n },\n async deleteConnector(connectorId: string): Promise<ConnectorSkeleton> {\n return deleteConnector({ connectorId, state });\n },\n async exportConnector(\n connectorId: string,\n options: ConnectorExportOptions = { deps: true, useStringArrays: true }\n ): Promise<ConnectorExportInterface> {\n return exportConnector({ connectorId, options, state });\n },\n async exportConnectors(): Promise<ConnectorExportInterface> {\n return exportConnectors({ state });\n },\n async importConnector(\n connectorId: string,\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton> {\n return importConnector({ connectorId, importData, options, state });\n },\n async importFirstConnector(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton> {\n return importFirstConnector({ importData, options, state });\n },\n async importConnectors(\n importData: ConnectorExportInterface,\n options?: ConnectorImportOptions\n ): Promise<ConnectorSkeleton[]> {\n return importConnectors({ importData, options, state });\n },\n };\n};\n\n/**\n * Connector type key used to build the IDM id: '\\<type>/\\<id>'\n */\nexport const CONNECTOR_TYPE = 'provisioner.openicf';\n\nexport type ObjectPropertyFlag =\n | 'NOT_CREATABLE'\n | 'NOT_READABLE'\n | 'NOT_RETURNED_BY_DEFAULT'\n | 'NOT_UPDATEABLE';\n\nexport type ObjectPropertyType = 'array' | 'boolean' | 'string';\n\nexport type ObjectPropertyNativeType =\n | 'array'\n | 'boolean'\n | 'string'\n | 'JAVA_TYPE_BIGDECIMAL'\n | 'JAVA_TYPE_BIGINTEGER'\n | 'JAVA_TYPE_BYTE'\n | 'JAVA_TYPE_BYTE_ARRAY'\n | 'JAVA_TYPE_CHAR'\n | 'JAVA_TYPE_CHARACTER'\n | 'JAVA_TYPE_DATE'\n | 'JAVA_TYPE_DOUBLE'\n | 'JAVA_TYPE_FILE'\n | 'JAVA_TYPE_FLOAT'\n | 'JAVA_TYPE_GUARDEDBYTEARRAY'\n | 'JAVA_TYPE_GUARDEDSTRING'\n | 'JAVA_TYPE_INT'\n | 'JAVA_TYPE_INTEGER'\n | 'JAVA_TYPE_LONG'\n | 'JAVA_TYPE_OBJECT'\n | 'JAVA_TYPE_PRIMITIVE_BOOLEAN'\n | 'JAVA_TYPE_PRIMITIVE_BYTE'\n | 'JAVA_TYPE_PRIMITIVE_DOUBLE'\n | 'JAVA_TYPE_PRIMITIVE_FLOAT'\n | 'JAVA_TYPE_PRIMITIVE_LONG'\n | 'JAVA_TYPE_STRING';\n\nexport type ObjectPropertySkeleton = {\n flags?: ObjectPropertyFlag[];\n nativeName: string;\n nativeType: ObjectPropertyNativeType;\n type: ObjectPropertyType;\n runAsUser?: boolean;\n required?: boolean;\n items?: {\n nativeType: ObjectPropertyNativeType;\n type: ObjectPropertyType;\n };\n};\n\nexport type ObjectTypeSkeleton = {\n $schema: string;\n id: string;\n nativeType: string;\n properties: Record<string, ObjectPropertySkeleton>;\n type: 'object';\n};\n\nexport type ConnectorSkeleton = IdObjectSkeletonInterface & {\n configurationProperties: any;\n connectorRef: {\n bundleName: string;\n bundleVersion: string;\n connectorHostRef: string;\n connectorName: string;\n displayName: string;\n systemType: 'provisioner.openicf';\n };\n enabled: boolean;\n objectTypes: Record<string, ObjectTypeSkeleton>;\n};\n\n/**\n * Connector export options\n */\nexport interface ConnectorExportOptions {\n /**\n * Use string arrays to store multi-line text in scripts.\n */\n useStringArrays: boolean;\n /**\n * Include any dependencies (mappings).\n */\n deps: boolean;\n}\n\n/**\n * Connector import options\n */\nexport interface ConnectorImportOptions {\n /**\n * Include any dependencies (mappings).\n */\n deps: boolean;\n}\n\nexport interface ConnectorExportInterface {\n meta?: ExportMetaData;\n connector: Record<string, ConnectorSkeleton>;\n mapping?: Record<string, MappingSkeleton>;\n}\n\nexport function createConnectorExportTemplate({\n state,\n}: {\n state: State;\n}): ConnectorExportInterface {\n return {\n meta: getMetadata({ state }),\n connector: {},\n mapping: {},\n } as ConnectorExportInterface;\n}\n\n/**\n * Get all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\nexport async function readConnectors({\n state,\n}: {\n state: State;\n}): Promise<ConnectorSkeleton[]> {\n try {\n const connectors = await readConfigEntitiesByType({\n type: CONNECTOR_TYPE,\n state,\n });\n return connectors as ConnectorSkeleton[];\n } catch (error) {\n throw new FrodoError(`Error reading connectors`, error);\n }\n}\n\n/**\n * Get connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\nexport async function readConnector({\n connectorId,\n state,\n}: {\n connectorId: string;\n state: State;\n}): Promise<ConnectorSkeleton> {\n try {\n debugMessage({\n message: `ConnectorOps.readConnector: start [connector=${connectorId}]`,\n state,\n });\n const entityId = `${CONNECTOR_TYPE}/${connectorId}`;\n debugMessage({\n message: `ConnectorOps.readConnector: use entity id: ${entityId}`,\n state,\n });\n const connectorData = await getConfigEntity({\n entityId,\n state,\n });\n debugMessage({\n message: `ConnectorOps.readConnector: end [connector=${connectorId}]`,\n state,\n });\n return connectorData;\n } catch (error) {\n throw new FrodoError(`Error reading connector ${connectorId}`, error);\n }\n}\n\n/**\n * Create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\nexport async function createConnector({\n connectorId,\n connectorData,\n state,\n}: {\n connectorId: string;\n connectorData: ConnectorSkeleton;\n state: State;\n}): Promise<ConnectorSkeleton> {\n debugMessage({\n message: `ConnectorOps.createConnector: start`,\n state,\n });\n try {\n await readConnector({\n connectorId: connectorId,\n state,\n });\n } catch (error) {\n try {\n const result = await putConfigEntity({\n entityId: `${CONNECTOR_TYPE}/${connectorId}`,\n entityData: connectorData,\n state,\n });\n debugMessage({\n message: `ConnectorOps.createConnector: end`,\n state,\n });\n return result as ConnectorSkeleton;\n } catch (error) {\n throw new FrodoError(`Error creating connector ${connectorId}`, error);\n }\n }\n throw new Error(`Connector ${connectorId} already exists!`);\n}\n\n/**\n * Update or create connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorSkeleton} connectorData connector object\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves to an connector object\n */\nexport async function updateConnector({\n connectorId,\n connectorData,\n state,\n}: {\n connectorId: string;\n connectorData: ConnectorSkeleton;\n state: State;\n}): Promise<ConnectorSkeleton> {\n try {\n return putConfigEntity({\n entityId: `${CONNECTOR_TYPE}/${connectorId}`,\n entityData: connectorData,\n state,\n });\n } catch (error) {\n throw new FrodoError(`Error updating connector ${connectorId}`, error);\n }\n}\n\n/**\n * Delete all connectors\n * @returns {Promise<ConnectorSkeleton[]>} a promise that resolves to an array of connector objects\n */\nexport async function deleteConnectors({\n state,\n}: {\n state: State;\n}): Promise<ConnectorSkeleton[]> {\n const errors: Error[] = [];\n try {\n debugMessage({\n message: `ConnectorOps.deleteConnectors: start`,\n state,\n });\n const result: ConnectorSkeleton[] = [];\n const connectors = await readConnectors({ state });\n for (const connector of connectors) {\n try {\n debugMessage({\n message: `ConnectorOps.deleteConnectors: '${connector['_id']}'`,\n state,\n });\n result.push(\n await deleteConfigEntity({\n entityId: connector['_id'],\n state,\n })\n );\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error deleting connectors`, errors);\n }\n debugMessage({\n message: `ConnectorOps.deleteConnectors: end`,\n state,\n });\n return result;\n } catch (error) {\n // re-throw previously caught errors\n if (errors.length > 0) {\n throw error;\n }\n throw new FrodoError(`Error deleting connectors`, error);\n }\n}\n\n/**\n * Delete connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorSkeleton>} a promise that resolves an connector object\n */\nexport async function deleteConnector({\n connectorId,\n state,\n}: {\n connectorId: string;\n state: State;\n}): Promise<ConnectorSkeleton> {\n try {\n return deleteConfigEntity({\n entityId: `${CONNECTOR_TYPE}/${connectorId}`,\n state,\n });\n } catch (error) {\n throw new FrodoError(`Error deleting connector ${connectorId}`, error);\n }\n}\n\n/**\n * Export connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\nexport async function exportConnector({\n connectorId,\n options = { deps: true, useStringArrays: true },\n state,\n}: {\n connectorId: string;\n options?: ConnectorExportOptions;\n state: State;\n}): Promise<ConnectorExportInterface> {\n try {\n debugMessage({\n message: `ConnectorOps.exportConnector: start [connector=${connectorId}]`,\n state,\n });\n const connectorData = await readConnector({ connectorId, state });\n const exportData = createConnectorExportTemplate({ state });\n exportData.connector[connectorId] = connectorData;\n if (options.deps) {\n const mappings = await readMappings({ connectorId, state });\n for (const mapping of mappings) {\n exportData.mapping[mapping.name] = mapping;\n }\n }\n debugMessage({ message: `ConnectorOps.exportConnector: end`, state });\n return exportData;\n } catch (error) {\n throw new FrodoError(`Error exporting connector ${connectorId}`, error);\n }\n}\n\n/**\n * Export all connectors\n * @returns {Promise<ConnectorExportInterface>} a promise that resolves to a ConnectorExportInterface object\n */\nexport async function exportConnectors({\n state,\n}: {\n state: State;\n}): Promise<ConnectorExportInterface> {\n try {\n const exportData = createConnectorExportTemplate({ state });\n const allConnectorsData = await readConnectors({ state });\n const indicatorId = createProgressIndicator({\n total: allConnectorsData.length,\n message: 'Exporting connectors',\n state,\n });\n for (const connectorData of allConnectorsData) {\n const connectorId = connectorData._id.split('/')[1];\n updateProgressIndicator({\n id: indicatorId,\n message: `Exporting connector ${connectorId}`,\n state,\n });\n exportData.connector[connectorId] = connectorData;\n }\n stopProgressIndicator({\n id: indicatorId,\n message: `${allConnectorsData.length} connectors exported.`,\n state,\n });\n return exportData;\n } catch (error) {\n throw new FrodoError(`Error exporting connectors`, error);\n }\n}\n\n/**\n * Import connector\n * @param {string} connectorId id/name of the connector without the type prefix\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\nexport async function importConnector({\n connectorId,\n importData,\n options = { deps: true },\n state,\n}: {\n connectorId: string;\n importData: ConnectorExportInterface;\n options?: ConnectorImportOptions;\n state: State;\n}): Promise<ConnectorSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.connector)) {\n if (key === connectorId) {\n try {\n response = await updateConnector({\n connectorId,\n connectorData: importData.connector[connectorId],\n state,\n });\n if (options.deps) {\n for (const connKey of Object.keys(importData.mapping)) {\n response = await updateMapping({\n mappingId: importData.mapping[connKey]._id,\n mappingData: importData.mapping[connKey],\n state,\n });\n }\n }\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing connector ${connectorId}`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`Connector ${connectorId} not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import first connector\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton>} a promise resolving to a ConnectorSkeleton object\n */\nexport async function importFirstConnector({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: ConnectorExportInterface;\n options?: ConnectorImportOptions;\n state: State;\n}): Promise<ConnectorSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.connector)) {\n try {\n if (options.deps) {\n //\n }\n response = await updateConnector({\n connectorId: key,\n connectorData: importData.connector[key],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing first connector`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`No connectors not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import all connectors\n * @param {ConnectorExportInterface} importData import data\n * @param {ConnectorImportOptions} options import options\n * @returns {Promise<ConnectorSkeleton[]>} a promise resolving to an array of ConnectorSkeleton objects\n */\nexport async function importConnectors({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: ConnectorExportInterface;\n options?: ConnectorImportOptions;\n state: State;\n}): Promise<ConnectorSkeleton[]> {\n const response = [];\n const errors = [];\n for (const key of Object.keys(importData.connector)) {\n try {\n if (options.deps) {\n //\n }\n response.push(\n await updateConnector({\n connectorId: key,\n connectorData: importData.connector[key],\n state,\n })\n );\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing connectors`, errors);\n }\n return response;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA4E,SAAAM,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,MAAA;AAAA,SAAAS,kBAAAC,EAAA,6BAAAC,IAAA,SAAAC,IAAA,GAAAC,SAAA,aAAAN,OAAA,WAAAV,OAAA,EAAAC,MAAA,QAAAF,GAAA,GAAAc,EAAA,CAAAI,KAAA,CAAAH,IAAA,EAAAC,IAAA,YAAAb,MAAAK,KAAA,IAAAT,kBAAA,CAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAA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AM,CAAC;IAC5D;IACA,OAAO4B,QAAQ;EACjB,CAAC;EAAA,OAAAY,iBAAA,CAAArG,KAAA,OAAAD,SAAA;AAAA"}
|
package/cjs/ops/MappingOps.js
CHANGED
|
@@ -354,10 +354,15 @@ function _updateMapping() {
|
|
|
354
354
|
});
|
|
355
355
|
_mappings4 = _mappings4.map(mapping => {
|
|
356
356
|
if (mappingId == mapping._id) {
|
|
357
|
+
// update existing mapping with incoming
|
|
357
358
|
return mappingData;
|
|
358
359
|
}
|
|
359
360
|
return mapping;
|
|
360
361
|
});
|
|
362
|
+
if (_mappings4.findIndex(mapping => mapping._id == mappingId) == -1) {
|
|
363
|
+
// incoming mapping does not exist, add it as new in the array
|
|
364
|
+
_mappings4.push(mappingData);
|
|
365
|
+
}
|
|
361
366
|
var sync = yield (0, _IdmConfigApi.putConfigEntity)({
|
|
362
367
|
entityId: 'sync',
|
|
363
368
|
entityData: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MappingOps.js","names":["_IdmConfigApi","require","_Console","_ExportImportUtils","_FrodoError","_IdmConfigOps","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_default","state","createMappingExportTemplate","readSyncMappings","readMappings","_arguments","connectorId","length","moType","readMapping","mappingId","createMapping","mappingData","updateMapping","updateSyncMappings","mappings","updateLegacyMappings","deleteMappings","_arguments2","deleteMapping","exportMapping","exportMappings","importMapping","importData","options","importFirstMapping","importMappings","exports","default","_ref","meta","getMetadata","mapping","_x","_readSyncMappings","_ref2","debugMessage","message","sync","readConfigEntity","entityId","map","it","_id","concat","name","FrodoError","_x2","_readMappings","_ref3","readConfigEntitiesByType","type","legacyMappings","filter","source","startsWith","target","_x3","_readMapping","_ref4","_x4","_createMapping","_ref5","result","_x5","_updateMapping","_ref6","putConfigEntity","entityData","_x6","_updateLegacyMappings","_ref7","_x7","_deleteMappings","_ref8","deletedMappings","push","mappingsToDelete","legacyMappingIdsToDelete","join","updatedLegacyMappings","includes","finalMappings","undeletedMappings","_x8","_deleteMapping","_ref9","updatedMappings","deleteConfigEntity","_x9","_exportMapping","_ref10","exportData","_x10","_exportMappings","_ref11","indicatorId","allMappingsData","createProgressIndicator","total","updateProgressIndicator","id","stopProgressIndicator","status","_x11","_importMapping","_ref12","deps","response","errors","imported","Object","keys","_x12","_importFirstMapping","_ref13","_x13","_importMappings","_ref14"],"sources":["../../src/ops/MappingOps.ts"],"sourcesContent":["import { IdObjectSkeletonInterface } from '../api/ApiTypes';\nimport { putConfigEntity } from '../api/IdmConfigApi';\nimport { State } from '../shared/State';\nimport {\n createProgressIndicator,\n debugMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport { getMetadata } from '../utils/ExportImportUtils';\nimport { FrodoError } from './FrodoError';\nimport {\n deleteConfigEntity,\n readConfigEntitiesByType,\n readConfigEntity,\n} from './IdmConfigOps';\nimport { ExportMetaData } from './OpsTypes';\n\nexport type Mapping = {\n /**\n * Create an empty mapping export template\n * @returns {MappingExportInterface} an empty mapping export template\n */\n createMappingExportTemplate(): MappingExportInterface;\n /**\n * Read mappings from sync.json (legacy)\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\n readSyncMappings(): Promise<MappingSkeleton[]>;\n /**\n * Read mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\n readMappings(\n connectorId?: string,\n moType?: string\n ): Promise<MappingSkeleton[]>;\n /**\n * Read mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\n readMapping(mappingId: string): Promise<MappingSkeleton>;\n /**\n * Create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\n createMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<MappingSkeleton>;\n /**\n * Update or create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\n updateMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<MappingSkeleton>;\n /**\n * Update or create mappings in sync.json (legacy)\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\n updateSyncMappings(mappings: MappingSkeleton[]): Promise<MappingSkeleton[]>;\n /**\n * Delete all mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\n deleteMappings(\n connectorId?: string,\n moType?: string\n ): Promise<MappingSkeleton[]>;\n /**\n * Delete mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\n deleteMapping(mappingId: string): Promise<MappingSkeleton>;\n /**\n * Export mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\n exportMapping(mappingId: string): Promise<MappingExportInterface>;\n /**\n * Export all mappings\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\n exportMappings(): Promise<MappingExportInterface>;\n /**\n * Import mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\n importMapping(\n mappingId: string,\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton>;\n /**\n * Import first mapping\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\n importFirstMapping(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton>;\n /**\n * Import all mappings\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton[]>} a promise resolving to an array of MappingSkeleton objects\n */\n importMappings(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton[]>;\n};\n\nexport default (state: State): Mapping => {\n return {\n createMappingExportTemplate(): MappingExportInterface {\n return createMappingExportTemplate({ state });\n },\n async readSyncMappings(): Promise<MappingSkeleton[]> {\n return readSyncMappings({ state });\n },\n async readMappings(\n connectorId: string = undefined,\n moType: string = undefined\n ): Promise<any> {\n return readMappings({ connectorId, moType, state });\n },\n async readMapping(mappingId: string): Promise<any> {\n return readMapping({ mappingId, state });\n },\n async createMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<any> {\n return createMapping({\n mappingId,\n mappingData,\n state,\n });\n },\n async updateMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<MappingSkeleton> {\n return updateMapping({\n mappingId,\n mappingData,\n state,\n });\n },\n async updateSyncMappings(\n mappings: MappingSkeleton[]\n ): Promise<MappingSkeleton[]> {\n return updateLegacyMappings({\n mappings,\n state,\n });\n },\n async deleteMappings(\n connectorId: string = undefined,\n moType: string = undefined\n ): Promise<MappingSkeleton[]> {\n return deleteMappings({ connectorId, moType, state });\n },\n async deleteMapping(mappingId: string): Promise<MappingSkeleton> {\n return deleteMapping({ mappingId, state });\n },\n async exportMapping(mappingId: string): Promise<MappingExportInterface> {\n return exportMapping({ mappingId, state });\n },\n async exportMappings(): Promise<MappingExportInterface> {\n return exportMappings({ state });\n },\n async importMapping(\n mappingId: string,\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton> {\n return importMapping({ mappingId, importData, options, state });\n },\n async importFirstMapping(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton> {\n return importFirstMapping({ importData, options, state });\n },\n async importMappings(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton[]> {\n return importMappings({ importData, options, state });\n },\n };\n};\n\nexport type MappingPolicy = {\n action: 'CREATE' | 'DELETE' | 'EXCEPTION' | 'IGNORE' | 'UPDATE';\n situation:\n | 'ABSENT'\n | 'ALL_GONE'\n | 'AMBIGUOUS'\n | 'CONFIRMED'\n | 'FOUND'\n | 'FOUND_ALREADY_LINKED'\n | 'LINK_ONLY'\n | 'MISSING'\n | 'SOURCE_IGNORED'\n | 'SOURCE_MISSING'\n | 'TARGET_IGNORED'\n | 'UNASSIGNED'\n | 'UNQUALIFIED';\n};\n\nexport type MappingProperty = {\n source?: string;\n target: string;\n transform?: {\n globals: any;\n source: string;\n type: string;\n };\n};\n\nexport type MappingSkeleton = IdObjectSkeletonInterface & {\n name: string;\n displayName?: string;\n linkQualifiers?: string[];\n consentRequired?: boolean;\n policies?: MappingPolicy[];\n properties?: MappingProperty[];\n source?: string;\n target?: string;\n};\n\nexport interface MappingExportInterface {\n meta?: ExportMetaData;\n mapping: Record<string, MappingSkeleton>;\n}\n\n/**\n * Mapping export options\n */\nexport interface MappingExportOptions {\n /**\n * Use string arrays to store multi-line text in scripts.\n */\n useStringArrays: boolean;\n /**\n * Include any dependencies.\n */\n deps: boolean;\n}\n\n/**\n * Mapping import options\n */\nexport interface MappingImportOptions {\n /**\n * Include any dependencies.\n */\n deps: boolean;\n}\n\nexport function createMappingExportTemplate({\n state,\n}: {\n state: State;\n}): MappingExportInterface {\n return {\n meta: getMetadata({ state }),\n mapping: {},\n } as MappingExportInterface;\n}\n\n/**\n * Read mappings from sync.json (legacy)\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function readSyncMappings({\n state,\n}: {\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n debugMessage({\n message: `MappingOps.readLegacyMappings: start`,\n state,\n });\n const sync = await readConfigEntity({\n entityId: 'sync',\n state,\n });\n const mappings = (sync.mappings as MappingSkeleton[]).map((it) => {\n it._id = `sync/${it.name}`;\n return it;\n });\n debugMessage({\n message: `MappingOps.readLegacyMappings: end`,\n state,\n });\n return mappings;\n } catch (error) {\n throw new FrodoError(`Error reading sync mappings`, error);\n }\n}\n\n/**\n * Read mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function readMappings({\n connectorId,\n moType,\n state,\n}: {\n connectorId?: string;\n moType?: string;\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n debugMessage({\n message: `MappingOps.readMappings: start [connectorId=${\n connectorId ? connectorId : 'all'\n }, moType=${moType ? moType : 'all'}]`,\n state,\n });\n let mappings = (await readConfigEntitiesByType({\n type: 'mapping',\n state,\n })) as MappingSkeleton[];\n const legacyMappings = await readSyncMappings({ state });\n mappings = mappings.concat(legacyMappings);\n if (connectorId)\n mappings = mappings.filter(\n (mapping) =>\n mapping.source.startsWith(`system/${connectorId}/`) ||\n mapping.target.startsWith(`system/${connectorId}/`)\n );\n if (moType)\n mappings = mappings.filter(\n (mapping) =>\n mapping.source === `managed/${moType}` ||\n mapping.target === `managed/${moType}`\n );\n debugMessage({\n message: `MappingOps.readMappings: end`,\n state,\n });\n return mappings;\n } catch (error) {\n throw new FrodoError(`Error reading mappings`, error);\n }\n}\n\n/**\n * Read mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\nexport async function readMapping({\n mappingId,\n state,\n}: {\n mappingId: string;\n state: State;\n}): Promise<MappingSkeleton> {\n if (mappingId.startsWith('sync/')) {\n const mappings = await readSyncMappings({ state });\n for (const mapping of mappings) {\n if (mapping._id === mappingId) return mapping;\n }\n throw new FrodoError(`Mapping '${mappingId}' not found!`);\n } else if (mappingId.startsWith('mapping/')) {\n const mapping = await readConfigEntity({\n entityId: mappingId,\n state,\n });\n return mapping as MappingSkeleton;\n } else {\n throw new FrodoError(\n `Invalid mapping id ${mappingId}. Must start with 'sync/' or 'mapping/'`\n );\n }\n}\n\n/**\n * Create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\nexport async function createMapping({\n mappingId,\n mappingData,\n state,\n}: {\n mappingId: string;\n mappingData: MappingSkeleton;\n state: State;\n}): Promise<MappingSkeleton> {\n debugMessage({\n message: `MappingOps.createMapping: start`,\n state,\n });\n try {\n await readMapping({\n mappingId,\n state,\n });\n } catch (error) {\n try {\n const result = await updateMapping({\n mappingId,\n mappingData,\n state,\n });\n debugMessage({\n message: `MappingOps.createMapping: end`,\n state,\n });\n return result as MappingSkeleton;\n } catch (error) {\n throw new FrodoError(`Error creating mapping ${mappingId}`, error);\n }\n }\n throw new FrodoError(`Mapping ${mappingId} already exists!`);\n}\n\n/**\n * Update or create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\nexport async function updateMapping({\n mappingId,\n mappingData,\n state,\n}: {\n mappingId: string;\n mappingData: MappingSkeleton;\n state: State;\n}): Promise<MappingSkeleton> {\n if (mappingId.startsWith('sync/')) {\n try {\n let mappings = await readMappings({ state });\n mappings = mappings.map((mapping) => {\n if (mappingId == mapping._id) {\n return mappingData;\n }\n return mapping;\n });\n const sync = await putConfigEntity({\n entityId: 'sync',\n entityData: { mappings },\n state,\n });\n for (const mapping of sync.mappings.map((it: MappingSkeleton) => {\n it._id = `sync/${it.name}`;\n return it;\n })) {\n if (mapping._id === mappingId) return mapping;\n }\n } catch (error) {\n throw new FrodoError(`Error updating sync mapping ${mappingId}`, error);\n }\n throw new FrodoError(\n `Mapping ${mappingId} not found after successful update!`\n );\n } else if (mappingId.startsWith('mapping/')) {\n try {\n const mapping = await putConfigEntity({\n entityId: mappingId,\n entityData: mappingData,\n state,\n });\n return mapping;\n } catch (error) {\n throw new FrodoError(`Error updating mapping ${mappingId}`, error);\n }\n } else {\n throw new FrodoError(\n `Invalid mapping id ${mappingId}. Must start with 'sync/' or 'mapping/'`\n );\n }\n}\n\n/**\n * Update or create multiple mappings\n * @param {MappingSkeleton[]} mappings array of mapping objects\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function updateLegacyMappings({\n mappings,\n state,\n}: {\n mappings: MappingSkeleton[];\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n const sync = await putConfigEntity({\n entityId: 'sync',\n entityData: { mappings },\n state,\n });\n return sync.mappings;\n } catch (error) {\n throw new FrodoError(`Error updating legacy mappings`, error);\n }\n}\n\n/**\n * Delete mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function deleteMappings({\n connectorId,\n moType,\n state,\n}: {\n connectorId?: string;\n moType?: string;\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n debugMessage({ message: `MappingOps.deleteMappings: start`, state });\n const mappings = await readMappings({ state });\n const deletedMappings: MappingSkeleton[] = [];\n // delete all mappings\n if (!connectorId && !moType) {\n // delete all mappings in sync.json\n await updateLegacyMappings({\n mappings: [],\n state,\n });\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('sync/')\n )) {\n deletedMappings.push(mapping);\n }\n // delete all the new mappings\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('mapping/')\n )) {\n deletedMappings.push(\n await deleteMapping({ mappingId: mapping._id, state })\n );\n }\n return deletedMappings;\n }\n // delete filtered mappings\n else {\n let mappingsToDelete: MappingSkeleton[] = [];\n if (connectorId) {\n debugMessage({\n message: `MappingOps.deleteMappings: select mappings for connector ${connectorId}`,\n state,\n });\n mappingsToDelete = mappings.filter(\n (mapping) =>\n mapping.source.startsWith(`system/${connectorId}/`) ||\n mapping.target.startsWith(`system/${connectorId}/`)\n );\n }\n if (moType) {\n debugMessage({\n message: `MappingOps.deleteMappings: select mappings for managed object type ${moType}`,\n state,\n });\n mappingsToDelete = mappingsToDelete.filter(\n (mapping) =>\n mapping.source === `managed/${moType}` ||\n mapping.target === `managed/${moType}`\n );\n }\n // filter only sync mappings\n const legacyMappingIdsToDelete = mappingsToDelete\n .filter((it) => it._id.startsWith('sync/'))\n .map((it) => it._id);\n debugMessage({\n message: `MappingOps.deleteMappings: selected ${\n mappingsToDelete.length\n } mappings: ${legacyMappingIdsToDelete.join(', ')}`,\n state,\n });\n const updatedLegacyMappings = mappings.filter(\n (mapping) => !legacyMappingIdsToDelete.includes(mapping._id)\n );\n debugMessage({\n message: `MappingOps.deleteMappings: ${\n updatedLegacyMappings.length\n } remaining mappings: ${updatedLegacyMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // update the mappings\n const finalMappings = await updateLegacyMappings({\n mappings: updatedLegacyMappings,\n state,\n });\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('sync/')\n )) {\n deletedMappings.push(mapping);\n }\n debugMessage({\n message: `MappingOps.deleteMappings: ${\n finalMappings.length\n } mappings after update: ${finalMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // are there any mappings that were not deleted?\n const undeletedMappings = finalMappings.filter((mapping) =>\n legacyMappingIdsToDelete.includes(mapping._id)\n );\n // delete all the new mappings\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('mapping/')\n )) {\n deletedMappings.push(\n await deleteMapping({ mappingId: mapping._id, state })\n );\n }\n // if there were undeleted mappings, throw exception\n if (undeletedMappings.length > 0) {\n const message = `${\n undeletedMappings.length\n } mappings were not deleted from sync.json: ${undeletedMappings\n .map((mapping) => mapping._id)\n .join(', ')}`;\n debugMessage({\n message,\n state,\n });\n throw new FrodoError(message);\n }\n debugMessage({\n message: `MappingOps.deleteMappings: deleted ${\n mappingsToDelete.length\n } mappings: ${legacyMappingIdsToDelete.join(', ')}`,\n state,\n });\n debugMessage({ message: `MappingOps.deleteMappings: end`, state });\n // otherwise return deleted mappings\n return deletedMappings;\n }\n } catch (error) {\n throw new FrodoError(`Error deleting mappings`, error);\n }\n}\n\n/**\n * Delete mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\nexport async function deleteMapping({\n mappingId,\n state,\n}: {\n mappingId: string;\n state: State;\n}): Promise<MappingSkeleton> {\n try {\n debugMessage({ message: `MappingOps.deleteMapping: start`, state });\n if (mappingId.startsWith('sync/')) {\n const mappings = await readMappings({ state });\n const mappingsToDelete = mappings.filter(\n (mapping) => mapping._id === mappingId\n );\n if (mappingsToDelete.length !== 1) {\n const message = `Mapping ${mappingId} not found in sync.json or multiple mappings found!`;\n debugMessage({\n message: `MappingOps.deleteMapping: ${message}`,\n state,\n });\n throw new FrodoError(message);\n }\n const updatedMappings = mappings.filter(\n (mapping) => mapping._id !== mappingId\n );\n debugMessage({\n message: `MappingOps.deleteMapping: ${\n updatedMappings.length\n } remaining mappings in sync.json: ${updatedMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // update the mappings\n const finalMappings = await updateLegacyMappings({\n mappings: updatedMappings,\n state,\n });\n debugMessage({\n message: `MappingOps.deleteMapping: ${\n finalMappings.length\n } mappings in sync.json after update: ${finalMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // are there any mappings that were not deleted?\n const undeletedMappings = finalMappings.filter(\n (mapping) => mappingId == mapping._id\n );\n // if so, throw exception\n if (undeletedMappings.length > 0) {\n const message = `Mapping ${undeletedMappings[0]} was not deleted from sync.json after successful update.`;\n debugMessage({\n message,\n state,\n });\n throw new FrodoError(message);\n }\n debugMessage({\n message: `MappingOps.deleteMapping: deleted legacy mapping ${mappingId} from sync.json.`,\n state,\n });\n debugMessage({ message: `MappingOps.deleteMapping: end`, state });\n // otherwise return deleted mapping\n return mappingsToDelete[0];\n } else if (mappingId.startsWith('mapping/')) {\n const mapping = await deleteConfigEntity({\n entityId: mappingId,\n state,\n });\n debugMessage({ message: `MappingOps.deleteMapping: end`, state });\n return mapping as MappingSkeleton;\n } else {\n throw new FrodoError(\n `Invalid mapping id ${mappingId}. Must start with 'sync/' or 'mapping/'`\n );\n }\n } catch (error) {\n throw new FrodoError(`Error deleting mapping ${mappingId}`, error);\n }\n}\n\n/**\n * Export mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\nexport async function exportMapping({\n mappingId,\n state,\n}: {\n mappingId: string;\n state: State;\n}): Promise<MappingExportInterface> {\n try {\n debugMessage({ message: `MappingOps.exportMapping: start`, state });\n const mappingData = await readMapping({ mappingId, state });\n const exportData = createMappingExportTemplate({ state });\n exportData.mapping[mappingData._id] = mappingData;\n debugMessage({ message: `MappingOps.exportMapping: end`, state });\n return exportData;\n } catch (error) {\n throw new FrodoError(`Error exporting mappings`, error);\n }\n}\n\n/**\n * Export all mappings\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\nexport async function exportMappings({\n state,\n}: {\n state: State;\n}): Promise<MappingExportInterface> {\n let indicatorId: string;\n try {\n const exportData = createMappingExportTemplate({ state });\n const allMappingsData = await readMappings({ state });\n indicatorId = createProgressIndicator({\n total: allMappingsData.length,\n message: 'Exporting mappings',\n state,\n });\n for (const mappingData of allMappingsData) {\n updateProgressIndicator({\n id: indicatorId,\n message: `Exporting mapping ${mappingData._id}`,\n state,\n });\n exportData.mapping[mappingData._id] = mappingData;\n }\n stopProgressIndicator({\n id: indicatorId,\n message: `${allMappingsData.length} mappings exported.`,\n state,\n });\n return exportData;\n } catch (error) {\n stopProgressIndicator({\n id: indicatorId,\n message: `Error exporting mappings`,\n status: 'fail',\n state,\n });\n throw new FrodoError(`Error exporting mappings`, error);\n }\n}\n\n/**\n * Import mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\nexport async function importMapping({\n mappingId,\n importData,\n options = { deps: true },\n state,\n}: {\n mappingId: string;\n importData: MappingExportInterface;\n options?: MappingImportOptions;\n state: State;\n}): Promise<MappingSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.mapping)) {\n if (key === mappingId) {\n try {\n if (options.deps) {\n //\n }\n response = await updateMapping({\n mappingId,\n mappingData: importData.mapping[mappingId],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing mapping ${mappingId}`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`Mapping ${mappingId} not found in import data`);\n }\n return response;\n}\n\n/**\n * Import first mapping\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\nexport async function importFirstMapping({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: MappingExportInterface;\n options?: MappingImportOptions;\n state: State;\n}): Promise<MappingSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.mapping)) {\n try {\n if (options.deps) {\n //\n }\n response = await updateMapping({\n mappingId: key,\n mappingData: importData.mapping[key],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing first mapping`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`No mappings found in import data!`);\n }\n return response;\n}\n\n/**\n * Import all mappings\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton[]>} a promise resolving to an array of MappingSkeleton objects\n */\nexport async function importMappings({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: MappingExportInterface;\n options?: MappingImportOptions;\n state: State;\n}): Promise<MappingSkeleton[]> {\n const response = [];\n const errors = [];\n for (const key of Object.keys(importData.mapping)) {\n try {\n if (options.deps) {\n //\n }\n response.push(\n await updateMapping({\n mappingId: key,\n mappingData: importData.mapping[key],\n state,\n })\n );\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing mappings`, errors);\n }\n return response;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAIwB,SAAAK,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,MAAA;AAAA,SAAAS,kBAAAC,EAAA,6BAAAC,IAAA,SAAAC,IAAA,GAAAC,SAAA,aAAAN,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mBAAA,CAAArH,KAAA,OAAAD,SAAA;AAAA;AAAA,SAQqB8B,cAAcA,CAAA0F,IAAA;EAAA,OAAAC,eAAA,CAAAxH,KAAA,OAAAD,SAAA;AAAA;AAAA,SAAAyH,gBAAA;EAAAA,eAAA,GAAA7H,iBAAA,CAA7B,WAAA8H,MAAA,EAQwB;IAAA,IARM;MACnC/F,UAAU;MACVC,OAAO,GAAG;QAAEmF,IAAI,EAAE;MAAK,CAAC;MACxB1G;IAKF,CAAC,GAAAqH,MAAA;IACC,IAAMV,QAAQ,GAAG,EAAE;IACnB,IAAMC,MAAM,GAAG,EAAE;IACjB,KAAK,IAAM7H,GAAG,IAAI+H,MAAM,CAACC,IAAI,CAACzF,UAAU,CAACS,OAAO,CAAC,EAAE;MACjD,IAAI;QACF,IAAIR,OAAO,CAACmF,IAAI,EAAE;UAChB;QAAA;QAEFC,QAAQ,CAAChC,IAAI,OACL/D,aAAa,CAAC;UAClBH,SAAS,EAAE1B,GAAG;UACd4B,WAAW,EAAEW,UAAU,CAACS,OAAO,CAAChD,GAAG,CAAC;UACpCiB;QACF,CAAC,CACH,CAAC;MACH,CAAC,CAAC,OAAOb,KAAK,EAAE;QACdyH,MAAM,CAACjC,IAAI,CAACxF,KAAK,CAAC;MACpB;IACF;IACA,IAAIyH,MAAM,CAACtG,MAAM,GAAG,CAAC,EAAE;MACrB,MAAM,IAAIuC,sBAAU,6BAA6B+D,MAAM,CAAC;IAC1D;IACA,OAAOD,QAAQ;EACjB,CAAC;EAAA,OAAAS,eAAA,CAAAxH,KAAA,OAAAD,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"MappingOps.js","names":["_IdmConfigApi","require","_Console","_ExportImportUtils","_FrodoError","_IdmConfigOps","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_default","state","createMappingExportTemplate","readSyncMappings","readMappings","_arguments","connectorId","length","moType","readMapping","mappingId","createMapping","mappingData","updateMapping","updateSyncMappings","mappings","updateLegacyMappings","deleteMappings","_arguments2","deleteMapping","exportMapping","exportMappings","importMapping","importData","options","importFirstMapping","importMappings","exports","default","_ref","meta","getMetadata","mapping","_x","_readSyncMappings","_ref2","debugMessage","message","sync","readConfigEntity","entityId","map","it","_id","concat","name","FrodoError","_x2","_readMappings","_ref3","readConfigEntitiesByType","type","legacyMappings","filter","source","startsWith","target","_x3","_readMapping","_ref4","_x4","_createMapping","_ref5","result","_x5","_updateMapping","_ref6","findIndex","push","putConfigEntity","entityData","_x6","_updateLegacyMappings","_ref7","_x7","_deleteMappings","_ref8","deletedMappings","mappingsToDelete","legacyMappingIdsToDelete","join","updatedLegacyMappings","includes","finalMappings","undeletedMappings","_x8","_deleteMapping","_ref9","updatedMappings","deleteConfigEntity","_x9","_exportMapping","_ref10","exportData","_x10","_exportMappings","_ref11","indicatorId","allMappingsData","createProgressIndicator","total","updateProgressIndicator","id","stopProgressIndicator","status","_x11","_importMapping","_ref12","deps","response","errors","imported","Object","keys","_x12","_importFirstMapping","_ref13","_x13","_importMappings","_ref14"],"sources":["../../src/ops/MappingOps.ts"],"sourcesContent":["import { IdObjectSkeletonInterface } from '../api/ApiTypes';\nimport { putConfigEntity } from '../api/IdmConfigApi';\nimport { State } from '../shared/State';\nimport {\n createProgressIndicator,\n debugMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport { getMetadata } from '../utils/ExportImportUtils';\nimport { FrodoError } from './FrodoError';\nimport {\n deleteConfigEntity,\n readConfigEntitiesByType,\n readConfigEntity,\n} from './IdmConfigOps';\nimport { ExportMetaData } from './OpsTypes';\n\nexport type Mapping = {\n /**\n * Create an empty mapping export template\n * @returns {MappingExportInterface} an empty mapping export template\n */\n createMappingExportTemplate(): MappingExportInterface;\n /**\n * Read mappings from sync.json (legacy)\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\n readSyncMappings(): Promise<MappingSkeleton[]>;\n /**\n * Read mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\n readMappings(\n connectorId?: string,\n moType?: string\n ): Promise<MappingSkeleton[]>;\n /**\n * Read mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\n readMapping(mappingId: string): Promise<MappingSkeleton>;\n /**\n * Create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\n createMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<MappingSkeleton>;\n /**\n * Update or create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\n updateMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<MappingSkeleton>;\n /**\n * Update or create mappings in sync.json (legacy)\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\n updateSyncMappings(mappings: MappingSkeleton[]): Promise<MappingSkeleton[]>;\n /**\n * Delete all mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\n deleteMappings(\n connectorId?: string,\n moType?: string\n ): Promise<MappingSkeleton[]>;\n /**\n * Delete mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\n deleteMapping(mappingId: string): Promise<MappingSkeleton>;\n /**\n * Export mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\n exportMapping(mappingId: string): Promise<MappingExportInterface>;\n /**\n * Export all mappings\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\n exportMappings(): Promise<MappingExportInterface>;\n /**\n * Import mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\n importMapping(\n mappingId: string,\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton>;\n /**\n * Import first mapping\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\n importFirstMapping(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton>;\n /**\n * Import all mappings\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton[]>} a promise resolving to an array of MappingSkeleton objects\n */\n importMappings(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton[]>;\n};\n\nexport default (state: State): Mapping => {\n return {\n createMappingExportTemplate(): MappingExportInterface {\n return createMappingExportTemplate({ state });\n },\n async readSyncMappings(): Promise<MappingSkeleton[]> {\n return readSyncMappings({ state });\n },\n async readMappings(\n connectorId: string = undefined,\n moType: string = undefined\n ): Promise<any> {\n return readMappings({ connectorId, moType, state });\n },\n async readMapping(mappingId: string): Promise<any> {\n return readMapping({ mappingId, state });\n },\n async createMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<any> {\n return createMapping({\n mappingId,\n mappingData,\n state,\n });\n },\n async updateMapping(\n mappingId: string,\n mappingData: MappingSkeleton\n ): Promise<MappingSkeleton> {\n return updateMapping({\n mappingId,\n mappingData,\n state,\n });\n },\n async updateSyncMappings(\n mappings: MappingSkeleton[]\n ): Promise<MappingSkeleton[]> {\n return updateLegacyMappings({\n mappings,\n state,\n });\n },\n async deleteMappings(\n connectorId: string = undefined,\n moType: string = undefined\n ): Promise<MappingSkeleton[]> {\n return deleteMappings({ connectorId, moType, state });\n },\n async deleteMapping(mappingId: string): Promise<MappingSkeleton> {\n return deleteMapping({ mappingId, state });\n },\n async exportMapping(mappingId: string): Promise<MappingExportInterface> {\n return exportMapping({ mappingId, state });\n },\n async exportMappings(): Promise<MappingExportInterface> {\n return exportMappings({ state });\n },\n async importMapping(\n mappingId: string,\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton> {\n return importMapping({ mappingId, importData, options, state });\n },\n async importFirstMapping(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton> {\n return importFirstMapping({ importData, options, state });\n },\n async importMappings(\n importData: MappingExportInterface,\n options?: MappingImportOptions\n ): Promise<MappingSkeleton[]> {\n return importMappings({ importData, options, state });\n },\n };\n};\n\nexport type MappingPolicy = {\n action: 'CREATE' | 'DELETE' | 'EXCEPTION' | 'IGNORE' | 'UPDATE';\n situation:\n | 'ABSENT'\n | 'ALL_GONE'\n | 'AMBIGUOUS'\n | 'CONFIRMED'\n | 'FOUND'\n | 'FOUND_ALREADY_LINKED'\n | 'LINK_ONLY'\n | 'MISSING'\n | 'SOURCE_IGNORED'\n | 'SOURCE_MISSING'\n | 'TARGET_IGNORED'\n | 'UNASSIGNED'\n | 'UNQUALIFIED';\n};\n\nexport type MappingProperty = {\n source?: string;\n target: string;\n transform?: {\n globals: any;\n source: string;\n type: string;\n };\n};\n\nexport type MappingSkeleton = IdObjectSkeletonInterface & {\n name: string;\n displayName?: string;\n linkQualifiers?: string[];\n consentRequired?: boolean;\n policies?: MappingPolicy[];\n properties?: MappingProperty[];\n source?: string;\n target?: string;\n};\n\nexport interface MappingExportInterface {\n meta?: ExportMetaData;\n mapping: Record<string, MappingSkeleton>;\n}\n\n/**\n * Mapping export options\n */\nexport interface MappingExportOptions {\n /**\n * Use string arrays to store multi-line text in scripts.\n */\n useStringArrays: boolean;\n /**\n * Include any dependencies.\n */\n deps: boolean;\n}\n\n/**\n * Mapping import options\n */\nexport interface MappingImportOptions {\n /**\n * Include any dependencies.\n */\n deps: boolean;\n}\n\nexport function createMappingExportTemplate({\n state,\n}: {\n state: State;\n}): MappingExportInterface {\n return {\n meta: getMetadata({ state }),\n mapping: {},\n } as MappingExportInterface;\n}\n\n/**\n * Read mappings from sync.json (legacy)\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function readSyncMappings({\n state,\n}: {\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n debugMessage({\n message: `MappingOps.readLegacyMappings: start`,\n state,\n });\n const sync = await readConfigEntity({\n entityId: 'sync',\n state,\n });\n const mappings = (sync.mappings as MappingSkeleton[]).map((it) => {\n it._id = `sync/${it.name}`;\n return it;\n });\n debugMessage({\n message: `MappingOps.readLegacyMappings: end`,\n state,\n });\n return mappings;\n } catch (error) {\n throw new FrodoError(`Error reading sync mappings`, error);\n }\n}\n\n/**\n * Read mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function readMappings({\n connectorId,\n moType,\n state,\n}: {\n connectorId?: string;\n moType?: string;\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n debugMessage({\n message: `MappingOps.readMappings: start [connectorId=${\n connectorId ? connectorId : 'all'\n }, moType=${moType ? moType : 'all'}]`,\n state,\n });\n let mappings = (await readConfigEntitiesByType({\n type: 'mapping',\n state,\n })) as MappingSkeleton[];\n const legacyMappings = await readSyncMappings({ state });\n mappings = mappings.concat(legacyMappings);\n if (connectorId)\n mappings = mappings.filter(\n (mapping) =>\n mapping.source.startsWith(`system/${connectorId}/`) ||\n mapping.target.startsWith(`system/${connectorId}/`)\n );\n if (moType)\n mappings = mappings.filter(\n (mapping) =>\n mapping.source === `managed/${moType}` ||\n mapping.target === `managed/${moType}`\n );\n debugMessage({\n message: `MappingOps.readMappings: end`,\n state,\n });\n return mappings;\n } catch (error) {\n throw new FrodoError(`Error reading mappings`, error);\n }\n}\n\n/**\n * Read mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\nexport async function readMapping({\n mappingId,\n state,\n}: {\n mappingId: string;\n state: State;\n}): Promise<MappingSkeleton> {\n if (mappingId.startsWith('sync/')) {\n const mappings = await readSyncMappings({ state });\n for (const mapping of mappings) {\n if (mapping._id === mappingId) return mapping;\n }\n throw new FrodoError(`Mapping '${mappingId}' not found!`);\n } else if (mappingId.startsWith('mapping/')) {\n const mapping = await readConfigEntity({\n entityId: mappingId,\n state,\n });\n return mapping as MappingSkeleton;\n } else {\n throw new FrodoError(\n `Invalid mapping id ${mappingId}. Must start with 'sync/' or 'mapping/'`\n );\n }\n}\n\n/**\n * Create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\nexport async function createMapping({\n mappingId,\n mappingData,\n state,\n}: {\n mappingId: string;\n mappingData: MappingSkeleton;\n state: State;\n}): Promise<MappingSkeleton> {\n debugMessage({\n message: `MappingOps.createMapping: start`,\n state,\n });\n try {\n await readMapping({\n mappingId,\n state,\n });\n } catch (error) {\n try {\n const result = await updateMapping({\n mappingId,\n mappingData,\n state,\n });\n debugMessage({\n message: `MappingOps.createMapping: end`,\n state,\n });\n return result as MappingSkeleton;\n } catch (error) {\n throw new FrodoError(`Error creating mapping ${mappingId}`, error);\n }\n }\n throw new FrodoError(`Mapping ${mappingId} already exists!`);\n}\n\n/**\n * Update or create mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingSkeleton} mappingData mapping object\n * @returns {Promise<MappingSkeleton>} a promise that resolves to an mapping object\n */\nexport async function updateMapping({\n mappingId,\n mappingData,\n state,\n}: {\n mappingId: string;\n mappingData: MappingSkeleton;\n state: State;\n}): Promise<MappingSkeleton> {\n if (mappingId.startsWith('sync/')) {\n try {\n let mappings = await readMappings({ state });\n mappings = mappings.map((mapping) => {\n if (mappingId == mapping._id) {\n // update existing mapping with incoming\n return mappingData;\n }\n return mapping;\n });\n if (mappings.findIndex((mapping) => mapping._id == mappingId) == -1) {\n // incoming mapping does not exist, add it as new in the array\n mappings.push(mappingData);\n }\n const sync = await putConfigEntity({\n entityId: 'sync',\n entityData: { mappings },\n state,\n });\n for (const mapping of sync.mappings.map((it: MappingSkeleton) => {\n it._id = `sync/${it.name}`;\n return it;\n })) {\n if (mapping._id === mappingId) return mapping;\n }\n } catch (error) {\n throw new FrodoError(`Error updating sync mapping ${mappingId}`, error);\n }\n throw new FrodoError(\n `Mapping ${mappingId} not found after successful update!`\n );\n } else if (mappingId.startsWith('mapping/')) {\n try {\n const mapping = await putConfigEntity({\n entityId: mappingId,\n entityData: mappingData,\n state,\n });\n return mapping;\n } catch (error) {\n throw new FrodoError(`Error updating mapping ${mappingId}`, error);\n }\n } else {\n throw new FrodoError(\n `Invalid mapping id ${mappingId}. Must start with 'sync/' or 'mapping/'`\n );\n }\n}\n\n/**\n * Update or create multiple mappings\n * @param {MappingSkeleton[]} mappings array of mapping objects\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function updateLegacyMappings({\n mappings,\n state,\n}: {\n mappings: MappingSkeleton[];\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n const sync = await putConfigEntity({\n entityId: 'sync',\n entityData: { mappings },\n state,\n });\n return sync.mappings;\n } catch (error) {\n throw new FrodoError(`Error updating legacy mappings`, error);\n }\n}\n\n/**\n * Delete mappings\n * @param {string} connectorId limit mappings to connector\n * @param {string} moType limit mappings to managed object type\n * @returns {Promise<MappingSkeleton[]>} a promise that resolves to an array of mapping objects\n */\nexport async function deleteMappings({\n connectorId,\n moType,\n state,\n}: {\n connectorId?: string;\n moType?: string;\n state: State;\n}): Promise<MappingSkeleton[]> {\n try {\n debugMessage({ message: `MappingOps.deleteMappings: start`, state });\n const mappings = await readMappings({ state });\n const deletedMappings: MappingSkeleton[] = [];\n // delete all mappings\n if (!connectorId && !moType) {\n // delete all mappings in sync.json\n await updateLegacyMappings({\n mappings: [],\n state,\n });\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('sync/')\n )) {\n deletedMappings.push(mapping);\n }\n // delete all the new mappings\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('mapping/')\n )) {\n deletedMappings.push(\n await deleteMapping({ mappingId: mapping._id, state })\n );\n }\n return deletedMappings;\n }\n // delete filtered mappings\n else {\n let mappingsToDelete: MappingSkeleton[] = [];\n if (connectorId) {\n debugMessage({\n message: `MappingOps.deleteMappings: select mappings for connector ${connectorId}`,\n state,\n });\n mappingsToDelete = mappings.filter(\n (mapping) =>\n mapping.source.startsWith(`system/${connectorId}/`) ||\n mapping.target.startsWith(`system/${connectorId}/`)\n );\n }\n if (moType) {\n debugMessage({\n message: `MappingOps.deleteMappings: select mappings for managed object type ${moType}`,\n state,\n });\n mappingsToDelete = mappingsToDelete.filter(\n (mapping) =>\n mapping.source === `managed/${moType}` ||\n mapping.target === `managed/${moType}`\n );\n }\n // filter only sync mappings\n const legacyMappingIdsToDelete = mappingsToDelete\n .filter((it) => it._id.startsWith('sync/'))\n .map((it) => it._id);\n debugMessage({\n message: `MappingOps.deleteMappings: selected ${\n mappingsToDelete.length\n } mappings: ${legacyMappingIdsToDelete.join(', ')}`,\n state,\n });\n const updatedLegacyMappings = mappings.filter(\n (mapping) => !legacyMappingIdsToDelete.includes(mapping._id)\n );\n debugMessage({\n message: `MappingOps.deleteMappings: ${\n updatedLegacyMappings.length\n } remaining mappings: ${updatedLegacyMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // update the mappings\n const finalMappings = await updateLegacyMappings({\n mappings: updatedLegacyMappings,\n state,\n });\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('sync/')\n )) {\n deletedMappings.push(mapping);\n }\n debugMessage({\n message: `MappingOps.deleteMappings: ${\n finalMappings.length\n } mappings after update: ${finalMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // are there any mappings that were not deleted?\n const undeletedMappings = finalMappings.filter((mapping) =>\n legacyMappingIdsToDelete.includes(mapping._id)\n );\n // delete all the new mappings\n for (const mapping of mappings.filter((it) =>\n it._id.startsWith('mapping/')\n )) {\n deletedMappings.push(\n await deleteMapping({ mappingId: mapping._id, state })\n );\n }\n // if there were undeleted mappings, throw exception\n if (undeletedMappings.length > 0) {\n const message = `${\n undeletedMappings.length\n } mappings were not deleted from sync.json: ${undeletedMappings\n .map((mapping) => mapping._id)\n .join(', ')}`;\n debugMessage({\n message,\n state,\n });\n throw new FrodoError(message);\n }\n debugMessage({\n message: `MappingOps.deleteMappings: deleted ${\n mappingsToDelete.length\n } mappings: ${legacyMappingIdsToDelete.join(', ')}`,\n state,\n });\n debugMessage({ message: `MappingOps.deleteMappings: end`, state });\n // otherwise return deleted mappings\n return deletedMappings;\n }\n } catch (error) {\n throw new FrodoError(`Error deleting mappings`, error);\n }\n}\n\n/**\n * Delete mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingSkeleton>} a promise that resolves an mapping object\n */\nexport async function deleteMapping({\n mappingId,\n state,\n}: {\n mappingId: string;\n state: State;\n}): Promise<MappingSkeleton> {\n try {\n debugMessage({ message: `MappingOps.deleteMapping: start`, state });\n if (mappingId.startsWith('sync/')) {\n const mappings = await readMappings({ state });\n const mappingsToDelete = mappings.filter(\n (mapping) => mapping._id === mappingId\n );\n if (mappingsToDelete.length !== 1) {\n const message = `Mapping ${mappingId} not found in sync.json or multiple mappings found!`;\n debugMessage({\n message: `MappingOps.deleteMapping: ${message}`,\n state,\n });\n throw new FrodoError(message);\n }\n const updatedMappings = mappings.filter(\n (mapping) => mapping._id !== mappingId\n );\n debugMessage({\n message: `MappingOps.deleteMapping: ${\n updatedMappings.length\n } remaining mappings in sync.json: ${updatedMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // update the mappings\n const finalMappings = await updateLegacyMappings({\n mappings: updatedMappings,\n state,\n });\n debugMessage({\n message: `MappingOps.deleteMapping: ${\n finalMappings.length\n } mappings in sync.json after update: ${finalMappings\n .map((mapping) => mapping._id)\n .join(', ')}`,\n state,\n });\n // are there any mappings that were not deleted?\n const undeletedMappings = finalMappings.filter(\n (mapping) => mappingId == mapping._id\n );\n // if so, throw exception\n if (undeletedMappings.length > 0) {\n const message = `Mapping ${undeletedMappings[0]} was not deleted from sync.json after successful update.`;\n debugMessage({\n message,\n state,\n });\n throw new FrodoError(message);\n }\n debugMessage({\n message: `MappingOps.deleteMapping: deleted legacy mapping ${mappingId} from sync.json.`,\n state,\n });\n debugMessage({ message: `MappingOps.deleteMapping: end`, state });\n // otherwise return deleted mapping\n return mappingsToDelete[0];\n } else if (mappingId.startsWith('mapping/')) {\n const mapping = await deleteConfigEntity({\n entityId: mappingId,\n state,\n });\n debugMessage({ message: `MappingOps.deleteMapping: end`, state });\n return mapping as MappingSkeleton;\n } else {\n throw new FrodoError(\n `Invalid mapping id ${mappingId}. Must start with 'sync/' or 'mapping/'`\n );\n }\n } catch (error) {\n throw new FrodoError(`Error deleting mapping ${mappingId}`, error);\n }\n}\n\n/**\n * Export mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\nexport async function exportMapping({\n mappingId,\n state,\n}: {\n mappingId: string;\n state: State;\n}): Promise<MappingExportInterface> {\n try {\n debugMessage({ message: `MappingOps.exportMapping: start`, state });\n const mappingData = await readMapping({ mappingId, state });\n const exportData = createMappingExportTemplate({ state });\n exportData.mapping[mappingData._id] = mappingData;\n debugMessage({ message: `MappingOps.exportMapping: end`, state });\n return exportData;\n } catch (error) {\n throw new FrodoError(`Error exporting mappings`, error);\n }\n}\n\n/**\n * Export all mappings\n * @returns {Promise<MappingExportInterface>} a promise that resolves to a MappingExportInterface object\n */\nexport async function exportMappings({\n state,\n}: {\n state: State;\n}): Promise<MappingExportInterface> {\n let indicatorId: string;\n try {\n const exportData = createMappingExportTemplate({ state });\n const allMappingsData = await readMappings({ state });\n indicatorId = createProgressIndicator({\n total: allMappingsData.length,\n message: 'Exporting mappings',\n state,\n });\n for (const mappingData of allMappingsData) {\n updateProgressIndicator({\n id: indicatorId,\n message: `Exporting mapping ${mappingData._id}`,\n state,\n });\n exportData.mapping[mappingData._id] = mappingData;\n }\n stopProgressIndicator({\n id: indicatorId,\n message: `${allMappingsData.length} mappings exported.`,\n state,\n });\n return exportData;\n } catch (error) {\n stopProgressIndicator({\n id: indicatorId,\n message: `Error exporting mappings`,\n status: 'fail',\n state,\n });\n throw new FrodoError(`Error exporting mappings`, error);\n }\n}\n\n/**\n * Import mapping\n * @param {string} mappingId id of the mapping (new: 'mapping/\\<name>', legacy: 'sync/\\<name>')\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\nexport async function importMapping({\n mappingId,\n importData,\n options = { deps: true },\n state,\n}: {\n mappingId: string;\n importData: MappingExportInterface;\n options?: MappingImportOptions;\n state: State;\n}): Promise<MappingSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.mapping)) {\n if (key === mappingId) {\n try {\n if (options.deps) {\n //\n }\n response = await updateMapping({\n mappingId,\n mappingData: importData.mapping[mappingId],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing mapping ${mappingId}`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`Mapping ${mappingId} not found in import data`);\n }\n return response;\n}\n\n/**\n * Import first mapping\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton>} a promise resolving to a MappingSkeleton object\n */\nexport async function importFirstMapping({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: MappingExportInterface;\n options?: MappingImportOptions;\n state: State;\n}): Promise<MappingSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const key of Object.keys(importData.mapping)) {\n try {\n if (options.deps) {\n //\n }\n response = await updateMapping({\n mappingId: key,\n mappingData: importData.mapping[key],\n state,\n });\n imported.push(key);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing first mapping`, errors);\n }\n if (0 === imported.length) {\n throw new FrodoError(`No mappings found in import data!`);\n }\n return response;\n}\n\n/**\n * Import all mappings\n * @param {MappingExportInterface} importData import data\n * @param {MappingImportOptions} options import options\n * @returns {Promise<MappingSkeleton[]>} a promise resolving to an array of MappingSkeleton objects\n */\nexport async function importMappings({\n importData,\n options = { deps: true },\n state,\n}: {\n importData: MappingExportInterface;\n options?: MappingImportOptions;\n state: State;\n}): Promise<MappingSkeleton[]> {\n const response = [];\n const errors = [];\n for (const key of Object.keys(importData.mapping)) {\n try {\n if (options.deps) {\n //\n }\n response.push(\n await updateMapping({\n mappingId: key,\n mappingData: importData.mapping[key],\n state,\n })\n );\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n throw new FrodoError(`Error importing mappings`, errors);\n }\n return response;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,WA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