@lingk/sync 1.0.45 → 1.0.46

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/main.js CHANGED
@@ -1580,13 +1580,16 @@ module.exports =
1580
1580
 
1581
1581
  if (sourceResource && nestedSourceProp.property && destinationResource && destinationProperty) {
1582
1582
  mappings = mappings.concat(Object.assign({ // add to mappings obj
1583
- resourceFromLabel: singleMapping.dataSourceIsDestinationEntity ? sourceResource.type + '_' + targetProvider.toLowerCase() : sourceResource.type + '_' + sourceProvider.toLowerCase(),
1584
1583
  resourceFromNameAndProvider: singleMapping.dataSourceIsDestinationEntity ? sourceResource.type + '_' + targetProvider.toLowerCase() : sourceResource.type + '_' + sourceProvider.toLowerCase(),
1585
1584
  resourceFromName: sourceResource.type,
1586
- propertyFromName: nestedSourceProp.property
1585
+ resourceFromLabel: sourceResource.name,
1586
+ propertyFromName: nestedSourceProp.property,
1587
+ propertyFromLabel: nestedSourceProp.__property
1587
1588
  }, nestedSourceProp.parentsArray && nestedSourceProp.parentsArray.length > 0 && { propertyFromParents: nestedSourceProp.parentsArray }, {
1588
1589
  resourceToName: destinationResource.type,
1590
+ resourceToLabel: destinationResource.name,
1589
1591
  propertyToName: destinationProperty.name,
1592
+ propertyToLabel: destinationProperty.label,
1590
1593
  bundleIndex: index
1591
1594
  }, singleMapping.isExternalKeyMapping && { isExternalKeyMapping: true }, singleMapping.dataSourceIsDestinationEntity && { isDestinationResource: true }, singleMapping.isUnique && { isUnique: true }, singleMapping.transformations && singleMapping.transformations.length > 0 && !singleMapping.transformations.every(function (t) {
1592
1595
  return t.type === 'none';
@@ -1594,9 +1597,9 @@ module.exports =
1594
1597
  }
1595
1598
  });
1596
1599
  delete group.mappings; // remove the mapping obj from a resourceGroup
1597
- //if (group.lingkSourceKey) delete group.lingkSourceKey
1598
- //if (group.lingkSourceKeyObject) delete group.lingkSourceKeyObject
1599
- //if (group.lingkSourceKeyParents) delete group.lingkSourceKeyParents
1600
+ if (group.lingkSourceKey) delete group.lingkSourceKey;
1601
+ if (group.lingkSourceKeyObject) delete group.lingkSourceKeyObject;
1602
+ if (group.lingkSourceKeyParents) delete group.lingkSourceKeyParents;
1600
1603
  }
1601
1604
 
1602
1605
  // BUNDLES
@@ -1680,6 +1683,7 @@ module.exports =
1680
1683
 
1681
1684
  function findNestedProp(prop, parents, rsc) {
1682
1685
  var property = '';
1686
+ var __property = '';
1683
1687
  var parentsArray = [];
1684
1688
  if (parents && parents.length > 0) {
1685
1689
  (function () {
@@ -1700,19 +1704,21 @@ module.exports =
1700
1704
  if (nestedRsc.properties && nestedRsc.properties.find(function (p) {
1701
1705
  return p.label === prop;
1702
1706
  })) {
1703
- property = nestedRsc.properties.find(function (p) {
1707
+ var theProp = nestedRsc.properties.find(function (p) {
1704
1708
  return p.label === prop;
1705
- }).name;
1709
+ });
1710
+ property = theProp.name;
1711
+ __property = theProp.label;
1706
1712
  }
1707
1713
  })();
1708
1714
  } else {
1709
- property = prop && rsc && rsc.properties && rsc.properties.find(function (p) {
1710
- return p.label === prop;
1711
- }) && rsc.properties.find(function (p) {
1715
+ var theProp = prop && rsc && rsc.properties && rsc.properties.find(function (p) {
1712
1716
  return p.label === prop;
1713
- }).name;
1717
+ });
1718
+ property = theProp.name;
1719
+ __property = theProp.label;
1714
1720
  }
1715
- return { property: property, parentsArray: parentsArray };
1721
+ return { property: property, parentsArray: parentsArray, __property: __property };
1716
1722
  }
1717
1723
 
1718
1724
  exports.default = saveData;
@@ -3316,6 +3322,7 @@ module.exports =
3316
3322
  var rscResource = null;
3317
3323
  var deNestedJoinKey = {};
3318
3324
  var joinKeyResourceName = null;
3325
+ var __joinKeyResourceName = null;
3319
3326
  if (dataSourceMetadata) {
3320
3327
  rscResource = dataSourceMetadata.find(function (r) {
3321
3328
  return r.name === rsc.resourceLabel;
@@ -3325,6 +3332,7 @@ module.exports =
3325
3332
  // joinKeyName coming from parameter from another resource
3326
3333
  deNestedJoinKey = { property: rsc.joinKeyName };
3327
3334
  joinKeyResourceName = rsc.joinKeyResource;
3335
+ __joinKeyResourceName = rsc.joinKeyResource;
3328
3336
 
3329
3337
  // joinKeyName coming from field on this resource
3330
3338
  if (rsc.resourceName === rsc.joinKeyResource) {
@@ -3334,6 +3342,7 @@ module.exports =
3334
3342
  if (joinKeyResource) {
3335
3343
  deNestedJoinKey = deNest(rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource);
3336
3344
  joinKeyResourceName = joinKeyResource.name;
3345
+ __joinKeyResourceName = joinKeyResource.type;
3337
3346
  }
3338
3347
  }
3339
3348
  }
@@ -3347,12 +3356,14 @@ module.exports =
3347
3356
 
3348
3357
  var deNestedPrimaryKey = {};
3349
3358
  var primaryKeyResourceName = null;
3359
+ var __primaryKeyResourceName = null;
3350
3360
  if (primaryDataSourceMetadata) {
3351
3361
  if (rsc.primaryKeyName) {
3352
3362
  (function () {
3353
3363
  //primaryKeyName coming from parameter (another resource)
3354
3364
  deNestedPrimaryKey = { property: rsc.primaryKeyName };
3355
3365
  primaryKeyResourceName = rsc.primaryKeyResource;
3366
+ __primaryKeyResourceName = rsc.primaryKeyResource;
3356
3367
 
3357
3368
  // primaryKeyName coming from resource IN THIS BUNDLE
3358
3369
  // FIND ITS BY THE LABEL, NOT THE NAME!!! THIS IS HOW IT IS SAVED.
@@ -3367,6 +3378,7 @@ module.exports =
3367
3378
  if (rscPrimaryResource) {
3368
3379
  deNestedPrimaryKey = deNest(rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource);
3369
3380
  primaryKeyResourceName = rscPrimaryResource.name;
3381
+ __primaryKeyResourceName = rscPrimaryResource.type;
3370
3382
  }
3371
3383
  }
3372
3384
  })();
@@ -3399,8 +3411,9 @@ module.exports =
3399
3411
  if (rscResource) {
3400
3412
  resources.push(Object.assign({
3401
3413
  name: rscResource.name,
3414
+ __name: rscResource.type,
3402
3415
  provider: resourceProvider
3403
- }, 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 }, {
3416
+ }, 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 }, {
3404
3417
  joinType: rsc.joinType || 'LEFT JOIN'
3405
3418
  }, rscResource.parentRef && { parentRef: rscResource.parentRef }, rsc.parameterFilters && { parameterFilters: rsc.parameterFilters }, {
3406
3419
  level: rsc.level || (rscIndex === 0 ? 0 : 1)
@@ -3473,10 +3486,14 @@ module.exports =
3473
3486
  if (sourceResource && sourceProperty && destinationProperty) {
3474
3487
  mappings.push(Object.assign({
3475
3488
  resourceFromName: sourceResource.name,
3476
- propertyFromName: deNestedProp.property
3489
+ __resourceFromName: sourceResource.type,
3490
+ propertyFromName: deNestedProp.property,
3491
+ __propertyFromName: deNestedProp.__property
3477
3492
  }, deNestedProp.parentsArray && deNestedProp.parentsArray.length > 0 && { propertyFromParents: deNestedProp.parentsArray }, {
3478
3493
  resourceToName: bundleResource.name,
3479
- propertyToName: destinationProperty.label
3494
+ __resourceToName: bundleResource.type,
3495
+ propertyToName: destinationProperty.label,
3496
+ __propertyToName: destinationProperty.name
3480
3497
  }, m.isDestinationResource && { dataSourceIsDestinationEntity: true }, m.isExternalKeyMapping && { isExternalKeyMapping: true }, m.isUnique && { isUnique: true }, {
3481
3498
  transformations: transformations
3482
3499
  }));
@@ -3484,6 +3501,7 @@ module.exports =
3484
3501
  }); // end wizard.savedMappings.forEach
3485
3502
  resourceGroups.push(Object.assign({
3486
3503
  name: bundleResource.name,
3504
+ __name: bundleResource.type,
3487
3505
  resources: resources, mappings: mappings,
3488
3506
  customExternalKeys: bundle.customExternalKeys || false
3489
3507
  }, bundle.customExternalKeys === true && { sourceKeys: sourceKeys, sourceKeysObjects: sourceKeysObjects, sourceKeysParents: sourceKeysParents, destinationKeys: destinationKeys }, bundle.customExternalKeys === false && { lingkSourceKey: sourceKeys[0], lingkSourceKeyObject: sourceKeysObjects[0],
@@ -3502,6 +3520,7 @@ module.exports =
3502
3520
 
3503
3521
  function deNest(prop, parents, rsc) {
3504
3522
  var property = '';
3523
+ var __property = '';
3505
3524
  var parentsArray = [];
3506
3525
  if (rsc) {
3507
3526
  if (parents && parents.length > 0) {
@@ -3521,6 +3540,7 @@ module.exports =
3521
3540
  });
3522
3541
  if (sourceKeyProperty) {
3523
3542
  property = sourceKeyProperty.label;
3543
+ __property = sourceKeyProperty.name;
3524
3544
  }
3525
3545
  })();
3526
3546
  } else {
@@ -3529,11 +3549,15 @@ module.exports =
3529
3549
  });
3530
3550
  if (sourceKeyProperty) {
3531
3551
  property = sourceKeyProperty.label;
3552
+ __property = sourceKeyProperty.name;
3532
3553
  }
3533
3554
  }
3534
3555
  }
3535
- if (prop === 'Lingk_External_Id__c') property = 'Lingk External Id';
3536
- return { property: property, parentsArray: parentsArray };
3556
+ if (prop === 'Lingk_External_Id__c') {
3557
+ property = 'Lingk External Id';
3558
+ __property = prop;
3559
+ }
3560
+ return { property: property, parentsArray: parentsArray, __property: __property };
3537
3561
  }
3538
3562
 
3539
3563
  exports.default = loadData;
@@ -14516,7 +14540,8 @@ module.exports =
14516
14540
  step = _props3.step,
14517
14541
  sourceSchema = _props3.sourceSchema,
14518
14542
  direction = _props3.direction,
14519
- showApiNames = _props3.showApiNames;
14543
+ showApiNames = _props3.showApiNames,
14544
+ toggleShowApiNames = _props3.toggleShowApiNames;
14520
14545
  var _state = this.state,
14521
14546
  resourceGroupIndex = _state.resourceGroupIndex,
14522
14547
  paneToggle = _state.paneToggle,
@@ -14621,6 +14646,21 @@ module.exports =
14621
14646
  'Top One'
14622
14647
  )
14623
14648
  ) : null,
14649
+ resourceGroups && resourceGroups.length > 0 && _react2.default.createElement(
14650
+ 'div',
14651
+ {
14652
+ style: { position: 'absolute', right: style.width - 717, top: 0, zIndex: 999, width: 100 } },
14653
+ _react2.default.createElement(
14654
+ 'div',
14655
+ { className: 'labelz' },
14656
+ 'Labels:'
14657
+ ),
14658
+ _react2.default.createElement(
14659
+ 'div',
14660
+ { className: 'show-label-or-api-names', onClick: toggleShowApiNames },
14661
+ showApiNames ? 'System Names' : 'Friendly Names'
14662
+ )
14663
+ ),
14624
14664
  resourceGroups && resourceGroups.length > 0 && _react2.default.createElement(
14625
14665
  'div',
14626
14666
  null,
@@ -20883,7 +20923,7 @@ module.exports =
20883
20923
 
20884
20924
  Modal that opens when a transformation icon is clicked in the Field Mapping table
20885
20925
  transformations are an array on the mapping object
20886
- each transformation also has an array of args
20926
+ each transformation also has an array of arguments (args)
20887
20927
 
20888
20928
  **************************/
20889
20929
 
@@ -23496,16 +23536,6 @@ module.exports =
23496
23536
  { style: { fontSize: 20, display: 'inline-block' } },
23497
23537
  isReverse ? 'Map ' + destLabel + ' Fields to ' + srcLabel : 'Map ' + srcLabel + ' Fields to ' + destLabel
23498
23538
  ),
23499
- _react2.default.createElement(
23500
- 'div',
23501
- { style: { float: 'right', padding: '5px 5px', userSelect: 'none' } },
23502
- 'Showing: ',
23503
- _react2.default.createElement(
23504
- 'span',
23505
- { className: 'show-label-or-api-names', onClick: toggleShowApiNames },
23506
- showApiNames ? 'Api Names' : 'Labels'
23507
- )
23508
- ),
23509
23539
  _react2.default.createElement('br', null),
23510
23540
  _react2.default.createElement('br', null),
23511
23541
  _react2.default.createElement(
@@ -23530,7 +23560,7 @@ module.exports =
23530
23560
  _groupNav2.default,
23531
23561
  { resourceGroups: resourceGroups, isBundleStep: false, inputs: inputs,
23532
23562
  style: { position: 'relative', width: 640, height: 69, zIndex: 9000 }, step: step,
23533
- showApiNames: showApiNames },
23563
+ showApiNames: showApiNames, toggleShowApiNames: toggleShowApiNames },
23534
23564
  _react2.default.createElement(_mapAccordion2.default, { sourceSchema: sourceSchema, destinationSchema: destinationSchema,
23535
23565
  formValues: formValues, change: change, update: this.update, step: step,
23536
23566
  actions: actions, isReverse: isReverse, showApiNames: showApiNames }),
@@ -24788,16 +24818,6 @@ module.exports =
24788
24818
  { style: { fontSize: 20, display: 'inline-block' } },
24789
24819
  isReverse ? 'Map ' + destLabel + ' Objects to ' + srcLabel : 'Map ' + srcLabel + ' Objects to ' + destLabel
24790
24820
  ),
24791
- _react2.default.createElement(
24792
- 'div',
24793
- { style: { float: 'right', padding: '5px 5px', userSelect: 'none' } },
24794
- 'Showing: ',
24795
- _react2.default.createElement(
24796
- 'span',
24797
- { className: 'show-label-or-api-names', onClick: toggleShowApiNames },
24798
- showApiNames ? 'Api Names' : 'Labels'
24799
- )
24800
- ),
24801
24821
  _react2.default.createElement('br', null),
24802
24822
  _react2.default.createElement('br', null),
24803
24823
  _react2.default.createElement(
@@ -24825,7 +24845,8 @@ module.exports =
24825
24845
  inputs: inputs, addDefaultEntity: this.addDefaultEntity,
24826
24846
  didRemoveEntity: this.removeEntity,
24827
24847
  sourceSchema: sourceSchema, showApiNames: showApiNames,
24828
- direction: formValues.direction },
24848
+ direction: formValues.direction,
24849
+ toggleShowApiNames: toggleShowApiNames },
24829
24850
  _react2.default.createElement(_schemaAccordion2.default, {
24830
24851
  sourceSchema: sourceSchema, destinationSchema: destinationSchema,
24831
24852
  changeEntityOrder: this.changeEntityOrder,