@lingk/sync 1.0.45 → 1.0.47
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/credentialSections.js.map +1 -1
- package/build/lightning.js +54 -53
- package/build/lightning.js.map +1 -1
- package/build/lightningStyles.js +2 -2
- package/build/lightningStyles.js.map +1 -1
- package/build/lingk.js +75 -23
- package/build/lingk.js.map +1 -1
- package/build/lingkStyles.js +2 -2
- package/build/lingkStyles.js.map +1 -1
- package/build/loadData.js +23 -5
- package/build/loadData.js.map +1 -1
- package/build/main.js +264 -240
- package/build/main.js.map +1 -1
- package/build/metadataFunctions.js.map +1 -1
- package/build/reducer.js.map +1 -1
- package/build/saveData.js +18 -12
- package/build/saveData.js.map +1 -1
- package/package.json +2 -2
package/build/loadData.js
CHANGED
|
@@ -129,6 +129,7 @@ module.exports =
|
|
|
129
129
|
var rscResource = null;
|
|
130
130
|
var deNestedJoinKey = {};
|
|
131
131
|
var joinKeyResourceName = null;
|
|
132
|
+
var __joinKeyResourceName = null;
|
|
132
133
|
if (dataSourceMetadata) {
|
|
133
134
|
rscResource = dataSourceMetadata.find(function (r) {
|
|
134
135
|
return r.name === rsc.resourceLabel;
|
|
@@ -138,6 +139,7 @@ module.exports =
|
|
|
138
139
|
// joinKeyName coming from parameter from another resource
|
|
139
140
|
deNestedJoinKey = { property: rsc.joinKeyName };
|
|
140
141
|
joinKeyResourceName = rsc.joinKeyResource;
|
|
142
|
+
__joinKeyResourceName = rsc.joinKeyResource;
|
|
141
143
|
|
|
142
144
|
// joinKeyName coming from field on this resource
|
|
143
145
|
if (rsc.resourceName === rsc.joinKeyResource) {
|
|
@@ -147,6 +149,7 @@ module.exports =
|
|
|
147
149
|
if (joinKeyResource) {
|
|
148
150
|
deNestedJoinKey = deNest(rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource);
|
|
149
151
|
joinKeyResourceName = joinKeyResource.name;
|
|
152
|
+
__joinKeyResourceName = joinKeyResource.type;
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
}
|
|
@@ -160,12 +163,14 @@ module.exports =
|
|
|
160
163
|
|
|
161
164
|
var deNestedPrimaryKey = {};
|
|
162
165
|
var primaryKeyResourceName = null;
|
|
166
|
+
var __primaryKeyResourceName = null;
|
|
163
167
|
if (primaryDataSourceMetadata) {
|
|
164
168
|
if (rsc.primaryKeyName) {
|
|
165
169
|
(function () {
|
|
166
170
|
//primaryKeyName coming from parameter (another resource)
|
|
167
171
|
deNestedPrimaryKey = { property: rsc.primaryKeyName };
|
|
168
172
|
primaryKeyResourceName = rsc.primaryKeyResource;
|
|
173
|
+
__primaryKeyResourceName = rsc.primaryKeyResource;
|
|
169
174
|
|
|
170
175
|
// primaryKeyName coming from resource IN THIS BUNDLE
|
|
171
176
|
// FIND ITS BY THE LABEL, NOT THE NAME!!! THIS IS HOW IT IS SAVED.
|
|
@@ -180,6 +185,7 @@ module.exports =
|
|
|
180
185
|
if (rscPrimaryResource) {
|
|
181
186
|
deNestedPrimaryKey = deNest(rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource);
|
|
182
187
|
primaryKeyResourceName = rscPrimaryResource.name;
|
|
188
|
+
__primaryKeyResourceName = rscPrimaryResource.type;
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
191
|
})();
|
|
@@ -212,8 +218,9 @@ module.exports =
|
|
|
212
218
|
if (rscResource) {
|
|
213
219
|
resources.push(Object.assign({
|
|
214
220
|
name: rscResource.name,
|
|
221
|
+
__name: rscResource.type,
|
|
215
222
|
provider: resourceProvider
|
|
216
|
-
}, deNestedJoinKey.property && { joinKeyName: deNestedJoinKey.property }, joinKeyResourceName && { joinKeyResource: joinKeyResourceName }, deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length > 0 && { joinKeyParents: deNestedJoinKey.parentsArray }, deNestedPrimaryKey.property && { primaryKeyName: deNestedPrimaryKey.property }, primaryKeyResourceName && { primaryKeyResource: primaryKeyResourceName }, deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length > 0 && { primaryKeyParents: deNestedPrimaryKey.parentsArray }, {
|
|
223
|
+
}, deNestedJoinKey.property && { joinKeyName: deNestedJoinKey.property }, deNestedJoinKey.__property && { __joinKeyName: deNestedJoinKey.__property }, joinKeyResourceName && { joinKeyResource: joinKeyResourceName }, __joinKeyResourceName && { __joinKeyResource: __joinKeyResourceName }, deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length > 0 && { joinKeyParents: deNestedJoinKey.parentsArray }, deNestedPrimaryKey.property && { primaryKeyName: deNestedPrimaryKey.property }, deNestedPrimaryKey.__property && { __primaryKeyName: deNestedPrimaryKey.__property }, primaryKeyResourceName && { primaryKeyResource: primaryKeyResourceName }, __primaryKeyResourceName && { __primaryKeyResource: __primaryKeyResourceName }, deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length > 0 && { primaryKeyParents: deNestedPrimaryKey.parentsArray }, {
|
|
217
224
|
joinType: rsc.joinType || 'LEFT JOIN'
|
|
218
225
|
}, rscResource.parentRef && { parentRef: rscResource.parentRef }, rsc.parameterFilters && { parameterFilters: rsc.parameterFilters }, {
|
|
219
226
|
level: rsc.level || (rscIndex === 0 ? 0 : 1)
|
|
@@ -286,10 +293,14 @@ module.exports =
|
|
|
286
293
|
if (sourceResource && sourceProperty && destinationProperty) {
|
|
287
294
|
mappings.push(Object.assign({
|
|
288
295
|
resourceFromName: sourceResource.name,
|
|
289
|
-
|
|
296
|
+
__resourceFromName: sourceResource.type,
|
|
297
|
+
propertyFromName: deNestedProp.property,
|
|
298
|
+
__propertyFromName: deNestedProp.__property
|
|
290
299
|
}, deNestedProp.parentsArray && deNestedProp.parentsArray.length > 0 && { propertyFromParents: deNestedProp.parentsArray }, {
|
|
291
300
|
resourceToName: bundleResource.name,
|
|
292
|
-
|
|
301
|
+
__resourceToName: bundleResource.type,
|
|
302
|
+
propertyToName: destinationProperty.label,
|
|
303
|
+
__propertyToName: destinationProperty.name
|
|
293
304
|
}, m.isDestinationResource && { dataSourceIsDestinationEntity: true }, m.isExternalKeyMapping && { isExternalKeyMapping: true }, m.isUnique && { isUnique: true }, {
|
|
294
305
|
transformations: transformations
|
|
295
306
|
}));
|
|
@@ -297,6 +308,7 @@ module.exports =
|
|
|
297
308
|
}); // end wizard.savedMappings.forEach
|
|
298
309
|
resourceGroups.push(Object.assign({
|
|
299
310
|
name: bundleResource.name,
|
|
311
|
+
__name: bundleResource.type,
|
|
300
312
|
resources: resources, mappings: mappings,
|
|
301
313
|
customExternalKeys: bundle.customExternalKeys || false
|
|
302
314
|
}, bundle.customExternalKeys === true && { sourceKeys: sourceKeys, sourceKeysObjects: sourceKeysObjects, sourceKeysParents: sourceKeysParents, destinationKeys: destinationKeys }, bundle.customExternalKeys === false && { lingkSourceKey: sourceKeys[0], lingkSourceKeyObject: sourceKeysObjects[0],
|
|
@@ -315,6 +327,7 @@ module.exports =
|
|
|
315
327
|
|
|
316
328
|
function deNest(prop, parents, rsc) {
|
|
317
329
|
var property = '';
|
|
330
|
+
var __property = '';
|
|
318
331
|
var parentsArray = [];
|
|
319
332
|
if (rsc) {
|
|
320
333
|
if (parents && parents.length > 0) {
|
|
@@ -334,6 +347,7 @@ module.exports =
|
|
|
334
347
|
});
|
|
335
348
|
if (sourceKeyProperty) {
|
|
336
349
|
property = sourceKeyProperty.label;
|
|
350
|
+
__property = sourceKeyProperty.name;
|
|
337
351
|
}
|
|
338
352
|
})();
|
|
339
353
|
} else {
|
|
@@ -342,11 +356,15 @@ module.exports =
|
|
|
342
356
|
});
|
|
343
357
|
if (sourceKeyProperty) {
|
|
344
358
|
property = sourceKeyProperty.label;
|
|
359
|
+
__property = sourceKeyProperty.name;
|
|
345
360
|
}
|
|
346
361
|
}
|
|
347
362
|
}
|
|
348
|
-
if (prop === 'Lingk_External_Id__c')
|
|
349
|
-
|
|
363
|
+
if (prop === 'Lingk_External_Id__c') {
|
|
364
|
+
property = 'Lingk External Id';
|
|
365
|
+
__property = prop;
|
|
366
|
+
}
|
|
367
|
+
return { property: property, parentsArray: parentsArray, __property: __property };
|
|
350
368
|
}
|
|
351
369
|
|
|
352
370
|
exports.default = loadData;
|
package/build/loadData.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap 4a28b3f9e5fc5e51bca3?7251*******","webpack:///./src/lib/wizard/stepTypes/utils/loadData.js?0bc1"],"names":["loadData","savedBundles","savedMapping","sourceProvider","destinationProvider","sourceMetadata","destinationMetadata","isReverse","SM","DM","SP","DP","resourceGroups","bundles","forEach","bundle","index","bundleResource","find","rsc","name","resourceLabel","destinationKeys","bundleDestinationProperty","properties","prop","dk","push","label","sourceKeys","sourceKeysObjects","sourceKeysParents","sk","i","sourceKeyResourceObj","resources","r","resourceName","sourceKeyResourceProvider","provider","replace","toLowerCase","primaryDataSourceMetadata","sourceKeyResource","type","deNestedProp","deNest","JSON","parse","property","parentsArray","rscIndex","resourceProvider","dataSourceMetadata","rscResource","deNestedJoinKey","joinKeyResourceName","joinKeyName","joinKeyResource","joinKeyParents","primaryResourceProviderLast_Index","parentNameAndProvider","lastIndexOf","primaryResourceProvider","substr","length","primaryResourceName","deNestedPrimaryKey","primaryKeyResourceName","primaryKeyName","primaryKeyResource","primaryKeyResourceResource","rscPrimaryResource","primaryKeyParents","joinType","parentRef","parameterFilters","level","mappings","filter","map","bundleIndex","m","isDestinationResource","resourceFromBundle","br","resourceFromName","sourceResource","propertyFromName","propertyFromParents","sourceProperty","destinationProperty","propertyToName","transformations","trans","s","args","split","transConcatResourceName","nestedFields","field","pop","concatRsc","concatRscProvider","concatRscMetadata","transConcatResource","concatLabels","result","p","resourceToName","dataSourceIsDestinationEntity","isExternalKeyMapping","isUnique","customExternalKeys","lingkSourceKey","lingkSourceKeyObject","lingkSourceKeyParents","deleteEnabled","writeMode","parents","nestedRsc","tempParentsArray","pProp","ps","object","sourceKeyProperty"],"mappings":";;AAAA;AACA;;AAEA;AACA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EAAZ;AAAA,YAA1B,CAAtC;AACAF,4BAAiB9F,IAAjB,CAAsB+F,MAAM9F,KAA5B;AACA4F,uBAAYE,MAAME,MAAlB;AACD,UAJD;AAKA1E,wBAAeuE,gBAAf;AACA,aAAMI,oBAAoBL,UAAUhG,UAAV,IAAwBgG,UAAUhG,UAAV,CAC/CN,IAD+C,CAC1C;AAAA,kBAAK0F,EAAExF,IAAF,KAASK,IAAd;AAAA,UAD0C,CAAlD;AAEA,aAAGoG,iBAAH,EAAqB;AACnB5E,sBAAW4E,kBAAkBjG,KAA7B;AACD;AAb4B;AAc9B,MAdD,MAcO;AACL,WAAMiG,oBAAoB1G,IAAIK,UAAJ,IAAkBL,IAAIK,UAAJ,CACzCN,IADyC,CACpC;AAAA,gBAAK0F,EAAExF,IAAF,KAASK,IAAd;AAAA,QADoC,CAA5C;AAEA,WAAGoG,iBAAH,EAAqB;AACnB5E,oBAAW4E,kBAAkBjG,KAA7B;AACD;AACF;AACF;AACD,OAAGH,SAAO,sBAAV,EAAkCwB,WAAS,mBAAT;AAClC,UAAO,EAACA,kBAAD,EAAWC,0BAAX,EAAP;AACD;;mBAEclD,Q","file":"loadData.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4a28b3f9e5fc5e51bca3","function loadData(savedBundles, savedMapping, sourceProvider, destinationProvider, sourceMetadata, destinationMetadata, isReverse) {\n\n let SM = sourceMetadata\n let DM = destinationMetadata\n let SP = sourceProvider\n let DP = destinationProvider\n if(isReverse){\n SM = destinationMetadata\n DM = sourceMetadata\n SP = destinationProvider\n DP = sourceProvider\n }\n\n const resourceGroups = []\n savedBundles.bundles.forEach((bundle, index)=>{\n // get bundle resource\n const bundleResource = DM.find(rsc => {\n return rsc.name === bundle.resourceLabel\n })\n if(bundleResource){\n\n //get bundle destinationKeys\n const destinationKeys = []\n bundle.destinationKeys.forEach(dk=>{\n const bundleDestinationProperty = bundleResource.properties.find(prop => prop.name===dk)\n if(bundleDestinationProperty){\n destinationKeys.push(bundleDestinationProperty.label)\n } else {\n destinationKeys.push('Lingk External Id')\n }\n })\n\n const sourceKeys = []\n const sourceKeysObjects = []\n const sourceKeysParents = []\n bundle.sourceKeys.forEach((sk,i)=>{\n const sourceKeyResourceObj = bundle.resources.find(r => r.resourceName===bundle.sourceKeysObjects[i])\n if(sourceKeyResourceObj){\n const sourceKeyResourceProvider = sourceKeyResourceObj.provider\n .replace('Reader','').toLowerCase()\n const primaryDataSourceMetadata = sourceKeyResourceProvider === \n DP.toLowerCase() ? DM : sourceKeyResourceProvider === \n SP.toLowerCase() ? SM : null\n\n if(primaryDataSourceMetadata){\n const sourceKeyResource = primaryDataSourceMetadata.find(r => r.type===bundle.sourceKeysObjects[i])\n if(sourceKeyResource){\n sourceKeysObjects.push(sourceKeyResource.name) \n const deNestedProp = deNest(\n sk,\n bundle.sourceKeysParents && JSON.parse(bundle.sourceKeysParents[i]),\n sourceKeyResource\n )\n sourceKeys.push(deNestedProp.property)\n sourceKeysParents.push(deNestedProp.parentsArray)\n }\n }\n\n }\n })\n\n const resources=[]\n bundle.resources && bundle.resources.forEach((rsc,rscIndex)=>{\n\n //get resource and joinKey for bundleResource (check both metadatas)\n const resourceProvider = rsc.provider.replace('Reader','').toLowerCase()\n const dataSourceMetadata = resourceProvider === DP.toLowerCase() ? DM : \n resourceProvider === SP.toLowerCase() ? SM : null\n\n let rscResource = null\n let deNestedJoinKey = {}\n let joinKeyResourceName = null\n if(dataSourceMetadata){\n rscResource = dataSourceMetadata.find(r => {\n return r.name===rsc.resourceLabel\n })\n\n if(rsc.joinKeyName){\n // joinKeyName coming from parameter from another resource\n deNestedJoinKey = {property:rsc.joinKeyName}\n joinKeyResourceName = rsc.joinKeyResource\n \n // joinKeyName coming from field on this resource\n if(rsc.resourceName===rsc.joinKeyResource){\n const joinKeyResource = dataSourceMetadata\n .find(r => r.type===rsc.resourceName && r.name===rsc.resourceLabel)\n if(joinKeyResource){\n deNestedJoinKey = deNest(\n rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource \n )\n joinKeyResourceName = joinKeyResource.name\n }\n }\n }\n } // end if dataSourceMetadata\n \n //get resource and primaryKey for parent resource for join\n const primaryResourceProviderLast_Index = rsc.parentNameAndProvider.lastIndexOf('_')\n const primaryResourceProvider = rsc.parentNameAndProvider\n .substr(primaryResourceProviderLast_Index+1, rsc.parentNameAndProvider.length)\n const primaryResourceName = rsc.parentNameAndProvider\n .substr(0, primaryResourceProviderLast_Index)\n const primaryDataSourceMetadata = primaryResourceProvider === DP.toLowerCase() ? DM : primaryResourceProvider === SP.toLowerCase() ? SM : null\n\n let deNestedPrimaryKey = {}\n let primaryKeyResourceName = null\n if(primaryDataSourceMetadata){\n if(rsc.primaryKeyName){\n //primaryKeyName coming from parameter (another resource)\n deNestedPrimaryKey = {property: rsc.primaryKeyName}\n primaryKeyResourceName = rsc.primaryKeyResource\n\n // primaryKeyName coming from resource IN THIS BUNDLE\n // FIND ITS BY THE LABEL, NOT THE NAME!!! THIS IS HOW IT IS SAVED.\n const primaryKeyResourceResource = bundle.resources.find((r)=>{\n return primaryResourceName===r.resourceLabel\n })\n if(primaryKeyResourceResource){\n //if(primaryResourceName===rsc.primaryKeyResource){\n const rscPrimaryResource = primaryDataSourceMetadata\n .find(r => r.name===primaryKeyResourceResource.resourceLabel)\n if(rscPrimaryResource){\n deNestedPrimaryKey = deNest(\n rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource \n )\n primaryKeyResourceName = rscPrimaryResource.name\n }\n }\n }\n }\n /*const primaryResourceProvider = bundle.resources[0].provider\n .replace('Reader','').toLowerCase()\n const primaryDataSourceMetadata = primaryResourceProvider === DP.toLowerCase() ? DM : primaryResourceProvider === SP.toLowerCase() ? SM : null\n\n let deNestedPrimaryKey = {}\n let primaryKeyResourceName = null\n if(primaryDataSourceMetadata){\n if(rsc.primaryKeyName){\n //primaryKeyName coming from parameter (another resource)\n deNestedPrimaryKey = {property: rsc.primaryKeyName}\n primaryKeyResourceName = rsc.primaryKeyResource\n\n // primaryKeyName coming from field on this resource\n if(bundle.resources[0].resourceLabel===rsc.primaryKeyResource){\n const rscPrimaryResource = primaryDataSourceMetadata\n .find(r => r.type===rsc.primaryKeyResource)\n if(rscPrimaryResource){\n deNestedPrimaryKey = deNest(\n rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource \n )\n primaryKeyResourceName = rscPrimaryResource.name\n }\n }\n }\n }*/\n\n if(rscResource){\n resources.push({\n name: rscResource.name,\n provider: resourceProvider,\n ...deNestedJoinKey.property && {joinKeyName: deNestedJoinKey.property},\n ...joinKeyResourceName && {joinKeyResource: joinKeyResourceName},\n ...(deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length>0) &&\n {joinKeyParents: deNestedJoinKey.parentsArray},\n ...deNestedPrimaryKey.property && {primaryKeyName: deNestedPrimaryKey.property},\n // primaryKeyResource is necessary because you can join on parameters\n // so it might be different than the actual primary resource name\n ...primaryKeyResourceName && {primaryKeyResource: primaryKeyResourceName},\n ...(deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length>0) &&\n {primaryKeyParents: deNestedPrimaryKey.parentsArray},\n joinType: rsc.joinType || 'LEFT JOIN',\n ...rscResource.parentRef && {parentRef: rscResource.parentRef},\n ...rsc.parameterFilters && {parameterFilters: rsc.parameterFilters},\n level: rsc.level || (rscIndex===0 ? 0 : 1),\n ...primaryResourceName && primaryResourceProvider && {parentNameAndProvider: `${primaryResourceName}_${primaryResourceProvider.toLowerCase()}`},\n })\n //console.log(resources[resources.length-1])\n }\n }) // end bundle.resource.forEach\n\n const mappings=[]\n savedMapping.mappings && savedMapping.mappings.filter(map=>map.bundleIndex===index)\n .forEach(m=>{\n let dataSourceMetadata = m.isDestinationResource ? DM : SM\n if(isReverse){\n dataSourceMetadata = m.isDestinationResource ? SM : DM\n }\n\n const resourceFromBundle = bundle.resources.find(br=>\n br.resourceName===m.resourceFromName)\n const sourceResource = resourceFromBundle && dataSourceMetadata.find(rsc =>\n rsc.name===resourceFromBundle.resourceLabel)\n const deNestedProp = deNest(\n m.propertyFromName, m.propertyFromParents, sourceResource\n )\n\n let sourceProperty = null\n if(sourceResource){\n sourceProperty = sourceResource.properties.find(prop => \n prop.name===m.propertyFromName)\n }\n\n const destinationProperty = bundleResource.properties.find(prop => \n prop.name===m.propertyToName)\n\n let transformations = [{type:'none'}]\n if(m.transformations && m.transformations.length > 0){\n const trans = m.transformations[0]\n if(trans.type==='concat'){\n const s = trans.args[1].split('->')\n const transConcatResourceName = s[s.length-2]\n const nestedFields = s[s.length-1].split('.')\n const field = nestedFields[nestedFields.length-1]\n nestedFields.pop()\n const concatRsc = savedBundles.bundles[m.bundleIndex].resources\n .find(r=>r.resourceLabel===transConcatResourceName)\n const concatRscProvider = concatRsc.provider.replace('Reader','').toLowerCase()\n const concatRscMetadata = concatRscProvider === DP.toLowerCase() ? DM :concatRscProvider === SP.toLowerCase() ? SM : null\n if(concatRscMetadata){\n const transConcatResource = concatRscMetadata\n .find(r => r.type===concatRsc.resourceName)\n const concatLabels = deNest(\n field, nestedFields, transConcatResource\n )\n let result = transConcatResource.name + '->'\n concatLabels.parentsArray.forEach(p=>result+=`${p}.`)\n result += concatLabels.property\n transformations = [{type:'concat',args:[trans.args[0],result]}]\n }\n } else {\n transformations = m.transformations\n }\n \n }\n \n if(sourceResource && sourceProperty && destinationProperty){\n mappings.push({\n resourceFromName: sourceResource.name,\n propertyFromName: deNestedProp.property,\n ...(deNestedProp.parentsArray && deNestedProp.parentsArray.length>0) &&\n {propertyFromParents: deNestedProp.parentsArray},\n resourceToName: bundleResource.name,\n propertyToName: destinationProperty.label,\n ...m.isDestinationResource && {dataSourceIsDestinationEntity: true},\n ...m.isExternalKeyMapping && {isExternalKeyMapping: true},\n ...m.isUnique && {isUnique: true},\n transformations\n })\n }\n }) // end wizard.savedMappings.forEach\n resourceGroups.push({\n name: bundleResource.name,\n resources, mappings,\n customExternalKeys: bundle.customExternalKeys || false,\n ...(bundle.customExternalKeys===true) &&\n {sourceKeys, sourceKeysObjects, sourceKeysParents, destinationKeys},\n ...(bundle.customExternalKeys===false) && \n {lingkSourceKey: sourceKeys[0], lingkSourceKeyObject: sourceKeysObjects[0],\n lingkSourceKeyParents: sourceKeysParents[0]},\n provider: bundle.provider,\n //...bundle.recordTypeId && {recordTypeId: bundle.recordTypeId},\n deleteEnabled: bundle.deleteEnabled || false,\n writeMode: bundle.writeMode || (bundle.deleteEnabled ? 'delete' : 'default')\n }) // end push each bundle (contains resources AND mappings)\n } // end if bundleResource\n\n }) // end forEach over bundles\n\n return resourceGroups\n}\n\nfunction deNest(prop, parents, rsc){\n let property = ''\n let parentsArray = []\n if(rsc){\n if(parents && parents.length>0){\n let nestedRsc = rsc\n const tempParentsArray = []\n parents.forEach(ps=>{\n const pProp = nestedRsc.properties && nestedRsc.properties.find(p=>p.name===ps)\n tempParentsArray.push(pProp.label)\n nestedRsc = pProp.object\n })\n parentsArray = tempParentsArray\n const sourceKeyProperty = nestedRsc.properties && nestedRsc.properties\n .find(p => p.name===prop)\n if(sourceKeyProperty){\n property = sourceKeyProperty.label\n }\n } else {\n const sourceKeyProperty = rsc.properties && rsc.properties\n .find(p => p.name===prop)\n if(sourceKeyProperty){\n property = sourceKeyProperty.label\n }\n }\n }\n if(prop==='Lingk_External_Id__c') property='Lingk External Id'\n return {property, parentsArray}\n}\n\nexport default loadData\n\n\n// WEBPACK FOOTER //\n// ./src/lib/wizard/stepTypes/utils/loadData.js"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap efcb53af6ce4e51b2a88?11b7*******","webpack:///./src/lib/wizard/stepTypes/utils/loadData.js?0bc1"],"names":["loadData","savedBundles","savedMapping","sourceProvider","destinationProvider","sourceMetadata","destinationMetadata","isReverse","SM","DM","SP","DP","resourceGroups","bundles","forEach","bundle","index","bundleResource","find","rsc","name","resourceLabel","destinationKeys","bundleDestinationProperty","properties","prop","dk","push","label","sourceKeys","sourceKeysObjects","sourceKeysParents","sk","i","sourceKeyResourceObj","resources","r","resourceName","sourceKeyResourceProvider","provider","replace","toLowerCase","primaryDataSourceMetadata","sourceKeyResource","type","deNestedProp","deNest","JSON","parse","property","parentsArray","rscIndex","resourceProvider","dataSourceMetadata","rscResource","deNestedJoinKey","joinKeyResourceName","__joinKeyResourceName","joinKeyName","joinKeyResource","joinKeyParents","primaryResourceProviderLast_Index","parentNameAndProvider","lastIndexOf","primaryResourceProvider","substr","length","primaryResourceName","deNestedPrimaryKey","primaryKeyResourceName","__primaryKeyResourceName","primaryKeyName","primaryKeyResource","primaryKeyResourceResource","rscPrimaryResource","primaryKeyParents","__name","__property","__joinKeyName","__joinKeyResource","__primaryKeyName","__primaryKeyResource","joinType","parentRef","parameterFilters","level","mappings","filter","map","bundleIndex","m","isDestinationResource","resourceFromBundle","br","resourceFromName","sourceResource","propertyFromName","propertyFromParents","sourceProperty","destinationProperty","propertyToName","transformations","trans","s","args","split","transConcatResourceName","nestedFields","field","pop","concatRsc","concatRscProvider","concatRscMetadata","transConcatResource","concatLabels","result","p","__resourceFromName","__propertyFromName","resourceToName","__resourceToName","__propertyToName","dataSourceIsDestinationEntity","isExternalKeyMapping","isUnique","customExternalKeys","lingkSourceKey","lingkSourceKeyObject","lingkSourceKeyParents","deleteEnabled","writeMode","parents","nestedRsc","tempParentsArray","pProp","ps","object","sourceKeyProperty"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;ACtCA,UAASA,QAAT,CAAkBC,YAAlB,EAAgCC,YAAhC,EAA8CC,cAA9C,EAA8DC,mBAA9D,EAAmFC,cAAnF,EAAmGC,mBAAnG,EAAwHC,SAAxH,EAAmI;;AAEjI,OAAIC,KAAKH,cAAT;AACA,OAAII,KAAKH,mBAAT;AACA,OAAII,KAAKP,cAAT;AACA,OAAIQ,KAAKP,mBAAT;AACA,OAAGG,SAAH,EAAa;AACXC,UAAKF,mBAAL;AACAG,UAAKJ,cAAL;AACAK,UAAKN,mBAAL;AACAO,UAAKR,cAAL;AACD;;AAED,OAAMS,iBAAiB,EAAvB;AACAX,gBAAaY,OAAb,CAAqBC,OAArB,CAA6B,UAACC,MAAD,EAASC,KAAT,EAAiB;AAC5C;AACA,SAAMC,iBAAiBR,GAAGS,IAAH,CAAQ,eAAO;AACpC,cAAOC,IAAIC,IAAJ,KAAaL,OAAOM,aAA3B;AACD,MAFsB,CAAvB;AAGA,SAAGJ,cAAH,EAAkB;AAAA;;AAEhB;AACA,aAAMK,kBAAkB,EAAxB;AACAP,gBAAOO,eAAP,CAAuBR,OAAvB,CAA+B,cAAI;AACjC,eAAMS,4BAA4BN,eAAeO,UAAf,CAA0BN,IAA1B,CAA+B;AAAA,oBAAQO,KAAKL,IAAL,KAAYM,EAApB;AAAA,YAA/B,CAAlC;AACA,eAAGH,yBAAH,EAA6B;AAC3BD,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AACAiD,wBAAa4D,kBAAkBrH,IAA/B;AACD;AAd4B;AAe9B,MAfD,MAeO;AACL,WAAMqH,oBAAoBtH,IAAIK,UAAJ,IAAkBL,IAAIK,UAAJ,CACzCN,IADyC,CACpC;AAAA,gBAAKkG,EAAEhG,IAAF,KAASK,IAAd;AAAA,QADoC,CAA5C;AAEA,WAAGgH,iBAAH,EAAqB;AACnBxF,oBAAWwF,kBAAkB7G,KAA7B;AACAiD,sBAAa4D,kBAAkBrH,IAA/B;AACD;AACF;AACF;AACD,OAAGK,SAAO,sBAAV,EAAkC;AAChCwB,gBAAS,mBAAT;AACA4B,kBAAapD,IAAb;AACD;AACD,UAAO,EAACwB,kBAAD,EAAWC,0BAAX,EAAyB2B,sBAAzB,EAAP;AACD;;mBAEc7E,Q","file":"loadData.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap efcb53af6ce4e51b2a88","function loadData(savedBundles, savedMapping, sourceProvider, destinationProvider, sourceMetadata, destinationMetadata, isReverse) {\n\n let SM = sourceMetadata\n let DM = destinationMetadata\n let SP = sourceProvider\n let DP = destinationProvider\n if(isReverse){\n SM = destinationMetadata\n DM = sourceMetadata\n SP = destinationProvider\n DP = sourceProvider\n }\n\n const resourceGroups = []\n savedBundles.bundles.forEach((bundle, index)=>{\n // get bundle resource\n const bundleResource = DM.find(rsc => {\n return rsc.name === bundle.resourceLabel\n })\n if(bundleResource){\n\n //get bundle destinationKeys\n const destinationKeys = []\n bundle.destinationKeys.forEach(dk=>{\n const bundleDestinationProperty = bundleResource.properties.find(prop => prop.name===dk)\n if(bundleDestinationProperty){\n destinationKeys.push(bundleDestinationProperty.label)\n } else {\n destinationKeys.push('Lingk External Id')\n }\n })\n\n const sourceKeys = []\n const sourceKeysObjects = []\n const sourceKeysParents = []\n bundle.sourceKeys.forEach((sk,i)=>{\n const sourceKeyResourceObj = bundle.resources.find(r => r.resourceName===bundle.sourceKeysObjects[i])\n if(sourceKeyResourceObj){\n const sourceKeyResourceProvider = sourceKeyResourceObj.provider\n .replace('Reader','').toLowerCase()\n const primaryDataSourceMetadata = sourceKeyResourceProvider === \n DP.toLowerCase() ? DM : sourceKeyResourceProvider === \n SP.toLowerCase() ? SM : null\n\n if(primaryDataSourceMetadata){\n const sourceKeyResource = primaryDataSourceMetadata.find(r => r.type===bundle.sourceKeysObjects[i])\n if(sourceKeyResource){\n sourceKeysObjects.push(sourceKeyResource.name) \n const deNestedProp = deNest(\n sk,\n bundle.sourceKeysParents && JSON.parse(bundle.sourceKeysParents[i]),\n sourceKeyResource\n )\n sourceKeys.push(deNestedProp.property)\n sourceKeysParents.push(deNestedProp.parentsArray)\n }\n }\n\n }\n })\n\n const resources=[]\n bundle.resources && bundle.resources.forEach((rsc,rscIndex)=>{\n\n //get resource and joinKey for bundleResource (check both metadatas)\n const resourceProvider = rsc.provider.replace('Reader','').toLowerCase()\n const dataSourceMetadata = resourceProvider === DP.toLowerCase() ? DM : \n resourceProvider === SP.toLowerCase() ? SM : null\n\n let rscResource = null\n let deNestedJoinKey = {}\n let joinKeyResourceName = null\n let __joinKeyResourceName = null\n if(dataSourceMetadata){\n rscResource = dataSourceMetadata.find(r => {\n return r.name===rsc.resourceLabel\n })\n\n if(rsc.joinKeyName){\n // joinKeyName coming from parameter from another resource\n deNestedJoinKey = {property:rsc.joinKeyName}\n joinKeyResourceName = rsc.joinKeyResource\n __joinKeyResourceName = rsc.joinKeyResource\n \n // joinKeyName coming from field on this resource\n if(rsc.resourceName===rsc.joinKeyResource){\n const joinKeyResource = dataSourceMetadata\n .find(r => r.type===rsc.resourceName && r.name===rsc.resourceLabel)\n if(joinKeyResource){\n deNestedJoinKey = deNest(\n rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource \n )\n joinKeyResourceName = joinKeyResource.name\n __joinKeyResourceName = joinKeyResource.type\n }\n }\n }\n } // end if dataSourceMetadata\n \n //get resource and primaryKey for parent resource for join\n const primaryResourceProviderLast_Index = rsc.parentNameAndProvider.lastIndexOf('_')\n const primaryResourceProvider = rsc.parentNameAndProvider\n .substr(primaryResourceProviderLast_Index+1, rsc.parentNameAndProvider.length)\n const primaryResourceName = rsc.parentNameAndProvider\n .substr(0, primaryResourceProviderLast_Index)\n const primaryDataSourceMetadata = primaryResourceProvider === DP.toLowerCase() ? DM : primaryResourceProvider === SP.toLowerCase() ? SM : null\n\n let deNestedPrimaryKey = {}\n let primaryKeyResourceName = null\n let __primaryKeyResourceName = null\n if(primaryDataSourceMetadata){\n if(rsc.primaryKeyName){\n //primaryKeyName coming from parameter (another resource)\n deNestedPrimaryKey = {property: rsc.primaryKeyName}\n primaryKeyResourceName = rsc.primaryKeyResource\n __primaryKeyResourceName = rsc.primaryKeyResource\n\n // primaryKeyName coming from resource IN THIS BUNDLE\n // FIND ITS BY THE LABEL, NOT THE NAME!!! THIS IS HOW IT IS SAVED.\n const primaryKeyResourceResource = bundle.resources.find((r)=>{\n return primaryResourceName===r.resourceLabel\n })\n if(primaryKeyResourceResource){\n //if(primaryResourceName===rsc.primaryKeyResource){\n const rscPrimaryResource = primaryDataSourceMetadata\n .find(r => r.name===primaryKeyResourceResource.resourceLabel)\n if(rscPrimaryResource){\n deNestedPrimaryKey = deNest(\n rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource \n )\n primaryKeyResourceName = rscPrimaryResource.name\n __primaryKeyResourceName = rscPrimaryResource.type\n }\n }\n }\n }\n /*const primaryResourceProvider = bundle.resources[0].provider\n .replace('Reader','').toLowerCase()\n const primaryDataSourceMetadata = primaryResourceProvider === DP.toLowerCase() ? DM : primaryResourceProvider === SP.toLowerCase() ? SM : null\n\n let deNestedPrimaryKey = {}\n let primaryKeyResourceName = null\n if(primaryDataSourceMetadata){\n if(rsc.primaryKeyName){\n //primaryKeyName coming from parameter (another resource)\n deNestedPrimaryKey = {property: rsc.primaryKeyName}\n primaryKeyResourceName = rsc.primaryKeyResource\n\n // primaryKeyName coming from field on this resource\n if(bundle.resources[0].resourceLabel===rsc.primaryKeyResource){\n const rscPrimaryResource = primaryDataSourceMetadata\n .find(r => r.type===rsc.primaryKeyResource)\n if(rscPrimaryResource){\n deNestedPrimaryKey = deNest(\n rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource \n )\n primaryKeyResourceName = rscPrimaryResource.name\n }\n }\n }\n }*/\n\n if(rscResource){\n resources.push({\n name: rscResource.name,\n __name: rscResource.type,\n provider: resourceProvider,\n ...deNestedJoinKey.property && {joinKeyName: deNestedJoinKey.property},\n ...deNestedJoinKey.__property && {__joinKeyName: deNestedJoinKey.__property},\n ...joinKeyResourceName && {joinKeyResource: joinKeyResourceName},\n ...__joinKeyResourceName && {__joinKeyResource: __joinKeyResourceName},\n ...(deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length>0) &&\n {joinKeyParents: deNestedJoinKey.parentsArray},\n ...deNestedPrimaryKey.property && {primaryKeyName: deNestedPrimaryKey.property},\n ...deNestedPrimaryKey.__property && {__primaryKeyName: deNestedPrimaryKey.__property},\n // primaryKeyResource is necessary because you can join on parameters\n // so it might be different than the actual primary resource name\n ...primaryKeyResourceName && {primaryKeyResource: primaryKeyResourceName},\n ...__primaryKeyResourceName && {__primaryKeyResource: __primaryKeyResourceName},\n ...(deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length>0) &&\n {primaryKeyParents: deNestedPrimaryKey.parentsArray},\n joinType: rsc.joinType || 'LEFT JOIN',\n ...rscResource.parentRef && {parentRef: rscResource.parentRef},\n ...rsc.parameterFilters && {parameterFilters: rsc.parameterFilters},\n level: rsc.level || (rscIndex===0 ? 0 : 1),\n ...primaryResourceName && primaryResourceProvider && {parentNameAndProvider: `${primaryResourceName}_${primaryResourceProvider.toLowerCase()}`},\n })\n //console.log(resources[resources.length-1])\n }\n }) // end bundle.resource.forEach\n\n const mappings=[]\n savedMapping.mappings && savedMapping.mappings.filter(map=>map.bundleIndex===index)\n .forEach(m=>{\n let dataSourceMetadata = m.isDestinationResource ? DM : SM\n if(isReverse){\n dataSourceMetadata = m.isDestinationResource ? SM : DM\n }\n\n const resourceFromBundle = bundle.resources.find(br=>\n br.resourceName===m.resourceFromName)\n const sourceResource = resourceFromBundle && dataSourceMetadata.find(rsc =>\n rsc.name===resourceFromBundle.resourceLabel)\n const deNestedProp = deNest(\n m.propertyFromName, m.propertyFromParents, sourceResource\n )\n\n let sourceProperty = null\n if(sourceResource){\n sourceProperty = sourceResource.properties.find(prop => \n prop.name===m.propertyFromName)\n }\n\n const destinationProperty = bundleResource.properties.find(prop => \n prop.name===m.propertyToName)\n\n let transformations = [{type:'none'}]\n if(m.transformations && m.transformations.length > 0){\n const trans = m.transformations[0]\n if(trans.type==='concat'){\n const s = trans.args[1].split('->')\n const transConcatResourceName = s[s.length-2]\n const nestedFields = s[s.length-1].split('.')\n const field = nestedFields[nestedFields.length-1]\n nestedFields.pop()\n const concatRsc = savedBundles.bundles[m.bundleIndex].resources\n .find(r=>r.resourceLabel===transConcatResourceName)\n const concatRscProvider = concatRsc.provider.replace('Reader','').toLowerCase()\n const concatRscMetadata = concatRscProvider === DP.toLowerCase() ? DM :concatRscProvider === SP.toLowerCase() ? SM : null\n if(concatRscMetadata){\n const transConcatResource = concatRscMetadata\n .find(r => r.type===concatRsc.resourceName)\n const concatLabels = deNest(\n field, nestedFields, transConcatResource\n )\n let result = transConcatResource.name + '->'\n concatLabels.parentsArray.forEach(p=>result+=`${p}.`)\n result += concatLabels.property\n transformations = [{type:'concat',args:[trans.args[0],result]}]\n }\n } else {\n transformations = m.transformations\n }\n \n }\n \n if(sourceResource && sourceProperty && destinationProperty){\n mappings.push({\n resourceFromName: sourceResource.name,\n __resourceFromName: sourceResource.type,\n propertyFromName: deNestedProp.property,\n __propertyFromName: deNestedProp.__property,\n ...(deNestedProp.parentsArray && deNestedProp.parentsArray.length>0) &&\n {propertyFromParents: deNestedProp.parentsArray},\n resourceToName: bundleResource.name,\n __resourceToName: bundleResource.type,\n propertyToName: destinationProperty.label,\n __propertyToName: destinationProperty.name,\n ...m.isDestinationResource && {dataSourceIsDestinationEntity: true},\n ...m.isExternalKeyMapping && {isExternalKeyMapping: true},\n ...m.isUnique && {isUnique: true},\n transformations\n })\n }\n }) // end wizard.savedMappings.forEach\n resourceGroups.push({\n name: bundleResource.name,\n __name: bundleResource.type,\n resources, mappings,\n customExternalKeys: bundle.customExternalKeys || false,\n ...(bundle.customExternalKeys===true) &&\n {sourceKeys, sourceKeysObjects, sourceKeysParents, destinationKeys},\n ...(bundle.customExternalKeys===false) && \n {lingkSourceKey: sourceKeys[0], lingkSourceKeyObject: sourceKeysObjects[0],\n lingkSourceKeyParents: sourceKeysParents[0]},\n provider: bundle.provider,\n //...bundle.recordTypeId && {recordTypeId: bundle.recordTypeId},\n deleteEnabled: bundle.deleteEnabled || false,\n writeMode: bundle.writeMode || (bundle.deleteEnabled ? 'delete' : 'default')\n }) // end push each bundle (contains resources AND mappings)\n } // end if bundleResource\n\n }) // end forEach over bundles\n\n return resourceGroups\n}\n\nfunction deNest(prop, parents, rsc){\n let property = ''\n let __property = ''\n let parentsArray = []\n if(rsc){\n if(parents && parents.length>0){\n let nestedRsc = rsc\n const tempParentsArray = []\n parents.forEach(ps=>{\n const pProp = nestedRsc.properties && nestedRsc.properties.find(p=>p.name===ps)\n tempParentsArray.push(pProp.label)\n nestedRsc = pProp.object\n })\n parentsArray = tempParentsArray\n const sourceKeyProperty = nestedRsc.properties && nestedRsc.properties\n .find(p => p.name===prop)\n if(sourceKeyProperty){\n property = sourceKeyProperty.label\n __property = sourceKeyProperty.name\n }\n } else {\n const sourceKeyProperty = rsc.properties && rsc.properties\n .find(p => p.name===prop)\n if(sourceKeyProperty){\n property = sourceKeyProperty.label\n __property = sourceKeyProperty.name\n }\n }\n }\n if(prop==='Lingk_External_Id__c') {\n property='Lingk External Id'\n __property = prop\n }\n return {property, parentsArray, __property}\n}\n\nexport default loadData\n\n\n// WEBPACK FOOTER //\n// ./src/lib/wizard/stepTypes/utils/loadData.js"],"sourceRoot":""}
|