@lingk/sync 0.0.22 → 0.0.24

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
@@ -45,7 +45,7 @@ module.exports =
45
45
  /* 0 */
46
46
  /***/ function(module, exports, __webpack_require__) {
47
47
 
48
- module.exports = __webpack_require__(50);
48
+ module.exports = __webpack_require__(51);
49
49
 
50
50
 
51
51
  /***/ },
@@ -220,6 +220,7 @@ module.exports =
220
220
  exports.callGenerateIntegration = callGenerateIntegration;
221
221
  exports.callGetTransformersAfterGeneration = callGetTransformersAfterGeneration;
222
222
  exports.submitWizardData = submitWizardData;
223
+ exports.callExecuteTransformer = callExecuteTransformer;
223
224
  exports.callGetWizardDataEntities = callGetWizardDataEntities;
224
225
  exports.callGetWizardResourceMeta = callGetWizardResourceMeta;
225
226
  exports.clearWizardResourceMeta = clearWizardResourceMeta;
@@ -230,7 +231,7 @@ module.exports =
230
231
 
231
232
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
232
233
 
233
- var axios = __webpack_require__(54);
234
+ var axios = __webpack_require__(55);
234
235
  function callGetWizardSourceData(url) {
235
236
  return function (dispatch) {
236
237
  dispatch({
@@ -359,7 +360,7 @@ module.exports =
359
360
  };
360
361
  }
361
362
 
362
- function callGenerateIntegration(tenantId, appId, piGuid) {
363
+ function callGenerateIntegration(tenantId, appId, piGuid, mappingGuidDeleteThis) {
363
364
  return function (dispatch, getState, api) {
364
365
  var _getState5 = getState(),
365
366
  config = _getState5.config;
@@ -367,7 +368,28 @@ module.exports =
367
368
  var TRANS_API_URL = config.TRANS_API_URL;
368
369
 
369
370
  return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
370
- endpoint: TRANS_API_URL
371
+ endpoint: TRANS_API_URL,
372
+ data: {
373
+ "IntegrationTypeId": 2,
374
+ "name": "Lingk to Salesforce",
375
+ "integrationTypeGuid": "9090b61412a74d97ad9ed02c5fx7e705",
376
+ "schemaMappingGuid": mappingGuidDeleteThis,
377
+ "configuration": {
378
+ "apiEndpoint_student": 'https://www.lingkapis.com/v1/@self/ps/students',
379
+ "apiEndpoint_course": "https://www.lingkapis.com/v1/@self/ps/courses?filter=institutionGuid%20eq%202b3e5636f2a94450a404f1a3b7c55059",
380
+ "apiEndpoint_institution": "https://www.lingkapis.com/v1/@self/ps/institutions?filter=shortName%20eq%20orci",
381
+ "apiKey": "5664bb4478fae2000100004aae5d222c6c2742717cebc5abf69f0f9e",
382
+ "apiSecret": "YThjODc4MjQ2MzEwNDgzMjYwY2RiYmY5Yzg4NzBhMmI=",
383
+ "clientId": "3MVG9szVa2RxsqBbm3SjG5D.osKk4_dg2A1KP.v2_SvhrqBuS19C.ktOCziR8tQuIOyRk2.iery_dRTSXX_iO",
384
+ "clientSecret": "3321758897975330201",
385
+ "environment": "dev",
386
+ "pageSize": "100",
387
+ "password": "Welcome@1",
388
+ "securityToken": "YKy6pDY3AYfbwgxvRplRY3bOU",
389
+ "username": "lingkhedadev@lingk.io",
390
+ "version": "v37.0"
391
+ }
392
+ }
371
393
  }).then(function (res) {
372
394
  return res;
373
395
  });
@@ -392,9 +414,10 @@ module.exports =
392
414
  return Promise.all([dispatch(callPostSchema(tenantId, appId, sourceSchema)), dispatch(callPostSchema(tenantId, appId, destinationSchema))]).then(function (guids) {
393
415
  return dispatch(callPostMapping(tenantId, appId, guids[0], guids[1], mapping)).then(function (res) {
394
416
  dispatch(callPostProductizedIntegration(tenantId, appId, res.schemaMappingGuid, configuration, title, typeGuid)).then(function (pi) {
395
- dispatch(callGenerateIntegration(tenantId, appId, pi.productizedIntegrationGuid)).then(function (generatedPI) {
396
- onFinish(generatedPI);
397
- dispatch(callGetTransformersAfterGeneration(appId));
417
+ dispatch(callGenerateIntegration(tenantId, appId, pi.productizedIntegrationGuid, res.schemaMappingGuid)).then(function (generatedRecipe) {
418
+ dispatch(callExecuteTransformer(generatedRecipe.BaseId)).then(function () {
419
+ onFinish(generatedRecipe);
420
+ });
398
421
  });
399
422
  });
400
423
  });
@@ -402,11 +425,39 @@ module.exports =
402
425
  };
403
426
  }
404
427
 
405
- function callGetWizardDataEntities(hubId) {
428
+ function callExecuteTransformer(transBaseId) {
406
429
  return function (dispatch, getState, api) {
407
430
  var _getState7 = getState(),
408
431
  config = _getState7.config;
409
432
 
433
+ var TRANS_API_URL = config.TRANS_API_URL;
434
+
435
+
436
+ var query = '';
437
+ var d = new Date();
438
+ var seconds = d.getTime() / 1000;
439
+ var externalExecutionId = Math.round(seconds);
440
+ query += 'action=create\\&';
441
+ query += 'path=/\\&';
442
+ query += 'at=' + d.toISOString() + '\\&';
443
+ query += 'type=file\\&';
444
+ query += 'externalExecutionId=' + externalExecutionId;
445
+
446
+ console.log('executing generated recipe', transBaseId);
447
+
448
+ return api.get('execute/' + transBaseId + '?' + query, {
449
+ endpoint: TRANS_API_URL
450
+ }).then(function (data) {
451
+ return data;
452
+ });
453
+ };
454
+ }
455
+
456
+ function callGetWizardDataEntities(hubId) {
457
+ return function (dispatch, getState, api) {
458
+ var _getState8 = getState(),
459
+ config = _getState8.config;
460
+
410
461
  var API_URL = config.API_URL;
411
462
 
412
463
  return api.get('apihubs/' + hubId, {
@@ -422,8 +473,8 @@ module.exports =
422
473
 
423
474
  function callGetWizardResourceMeta(resourceId) {
424
475
  return function (dispatch, getState, api) {
425
- var _getState8 = getState(),
426
- config = _getState8.config;
476
+ var _getState9 = getState(),
477
+ config = _getState9.config;
427
478
 
428
479
  var API_URL = config.API_URL;
429
480
 
@@ -888,10 +939,9 @@ module.exports =
888
939
  },
889
940
  'Contact': {
890
941
  'Account ID': true,
891
- 'Allow Customer Portal Self-Registration': true,
892
942
  'Alternate Email': true,
893
- "Assistant's Name": true,
894
- "Assistant's Phone": true,
943
+ "Assistant Name": true,
944
+ "Assistant Phone": true,
895
945
  'Birthdate': true,
896
946
  'Business Fax': true,
897
947
  'Business Phone': true,
@@ -1056,7 +1106,7 @@ module.exports =
1056
1106
  'Course Enrollment': {
1057
1107
  'Affiliation': true,
1058
1108
  'Contact': true,
1059
- "Contact's Academic Program": true,
1109
+ "Contact Academic Program": true,
1060
1110
  'Course Connection ID': true,
1061
1111
  'Course Offering ID': true,
1062
1112
  'Created By ID': true,
@@ -1733,6 +1783,52 @@ module.exports =
1733
1783
 
1734
1784
  /***/ },
1735
1785
  /* 37 */
1786
+ /***/ function(module, exports) {
1787
+
1788
+ 'use strict';
1789
+
1790
+ Object.defineProperty(exports, "__esModule", {
1791
+ value: true
1792
+ });
1793
+ var Heda = exports.Heda = {
1794
+ 'Contact': {
1795
+ 'Alternate Email': true,
1796
+ 'Citizenship': true,
1797
+ 'Country of Origin': true,
1798
+ 'Current Address': true,
1799
+ 'Deceased': true,
1800
+ 'Do Not Automatically Update': true,
1801
+ 'Do Not Contact': true,
1802
+ 'Ethnicity': true,
1803
+ 'Exclude from Household Formal Greeting': true,
1804
+ 'Exclude from Household Informal Greeting': true,
1805
+ 'Exclude from Household Name': true,
1806
+ 'FERPA': true,
1807
+ 'Financial Aid Applicant': true,
1808
+ 'Gender': true,
1809
+ 'HIPAA': true,
1810
+ 'HIPAA Detail': true,
1811
+ 'Home Phone': true,
1812
+ 'Military Background': true,
1813
+ 'Military Service': true,
1814
+ 'Naming Exclusions': true,
1815
+ 'Preferred Email': true,
1816
+ 'Preferred Phone': true,
1817
+ 'Primary Address Type': true,
1818
+ 'Primary Business Organization': true,
1819
+ 'Primary Household': true,
1820
+ 'Religion': true,
1821
+ 'Secondary Address Type': true,
1822
+ 'Social Security Number': true,
1823
+ 'University Email': true,
1824
+ 'Work Address': true,
1825
+ 'Work Email': true,
1826
+ 'Work Phone': true
1827
+ }
1828
+ };
1829
+
1830
+ /***/ },
1831
+ /* 38 */
1736
1832
  /***/ function(module, exports, __webpack_require__) {
1737
1833
 
1738
1834
  'use strict';
@@ -1814,7 +1910,7 @@ module.exports =
1814
1910
  })(AccountStep);
1815
1911
 
1816
1912
  /***/ },
1817
- /* 38 */
1913
+ /* 39 */
1818
1914
  /***/ function(module, exports, __webpack_require__) {
1819
1915
 
1820
1916
  'use strict';
@@ -2017,7 +2113,7 @@ module.exports =
2017
2113
  })(AdapterStep);
2018
2114
 
2019
2115
  /***/ },
2020
- /* 39 */
2116
+ /* 40 */
2021
2117
  /***/ function(module, exports, __webpack_require__) {
2022
2118
 
2023
2119
  'use strict';
@@ -2154,7 +2250,7 @@ module.exports =
2154
2250
  })(DeployStep);
2155
2251
 
2156
2252
  /***/ },
2157
- /* 40 */
2253
+ /* 41 */
2158
2254
  /***/ function(module, exports, __webpack_require__) {
2159
2255
 
2160
2256
  'use strict';
@@ -2369,7 +2465,7 @@ module.exports =
2369
2465
  })(EnvironmentStep);
2370
2466
 
2371
2467
  /***/ },
2372
- /* 41 */
2468
+ /* 42 */
2373
2469
  /***/ function(module, exports, __webpack_require__) {
2374
2470
 
2375
2471
  'use strict';
@@ -2470,7 +2566,7 @@ module.exports =
2470
2566
  })(FilterStep);
2471
2567
 
2472
2568
  /***/ },
2473
- /* 42 */
2569
+ /* 43 */
2474
2570
  /***/ function(module, exports, __webpack_require__) {
2475
2571
 
2476
2572
  'use strict';
@@ -2495,7 +2591,7 @@ module.exports =
2495
2591
 
2496
2592
  var _navButtons2 = _interopRequireDefault(_navButtons);
2497
2593
 
2498
- var _mapAccordion = __webpack_require__(47);
2594
+ var _mapAccordion = __webpack_require__(48);
2499
2595
 
2500
2596
  var _mapAccordion2 = _interopRequireDefault(_mapAccordion);
2501
2597
 
@@ -2783,7 +2879,7 @@ module.exports =
2783
2879
  })(MapStep);
2784
2880
 
2785
2881
  /***/ },
2786
- /* 43 */
2882
+ /* 44 */
2787
2883
  /***/ function(module, exports, __webpack_require__) {
2788
2884
 
2789
2885
  'use strict';
@@ -2899,7 +2995,7 @@ module.exports =
2899
2995
  })(NameStep);
2900
2996
 
2901
2997
  /***/ },
2902
- /* 44 */
2998
+ /* 45 */
2903
2999
  /***/ function(module, exports, __webpack_require__) {
2904
3000
 
2905
3001
  'use strict';
@@ -2997,7 +3093,7 @@ module.exports =
2997
3093
  })(PhaseStep);
2998
3094
 
2999
3095
  /***/ },
3000
- /* 45 */
3096
+ /* 46 */
3001
3097
  /***/ function(module, exports, __webpack_require__) {
3002
3098
 
3003
3099
  'use strict';
@@ -3132,7 +3228,7 @@ module.exports =
3132
3228
  })(PreviewStep);
3133
3229
 
3134
3230
  /***/ },
3135
- /* 46 */
3231
+ /* 47 */
3136
3232
  /***/ function(module, exports, __webpack_require__) {
3137
3233
 
3138
3234
  'use strict';
@@ -3157,7 +3253,7 @@ module.exports =
3157
3253
 
3158
3254
  var _navButtons2 = _interopRequireDefault(_navButtons);
3159
3255
 
3160
- var _schemaAccordion = __webpack_require__(48);
3256
+ var _schemaAccordion = __webpack_require__(49);
3161
3257
 
3162
3258
  var _schemaAccordion2 = _interopRequireDefault(_schemaAccordion);
3163
3259
 
@@ -3421,7 +3517,7 @@ module.exports =
3421
3517
  })(SchemaStep);
3422
3518
 
3423
3519
  /***/ },
3424
- /* 47 */
3520
+ /* 48 */
3425
3521
  /***/ function(module, exports, __webpack_require__) {
3426
3522
 
3427
3523
  'use strict';
@@ -3563,7 +3659,7 @@ module.exports =
3563
3659
  exports.default = MapAccordion;
3564
3660
 
3565
3661
  /***/ },
3566
- /* 48 */
3662
+ /* 49 */
3567
3663
  /***/ function(module, exports, __webpack_require__) {
3568
3664
 
3569
3665
  'use strict';
@@ -3580,7 +3676,7 @@ module.exports =
3580
3676
 
3581
3677
  var _reduxForm = __webpack_require__(2);
3582
3678
 
3583
- var _reactAddonsCssTransitionGroup = __webpack_require__(55);
3679
+ var _reactAddonsCssTransitionGroup = __webpack_require__(56);
3584
3680
 
3585
3681
  var _reactAddonsCssTransitionGroup2 = _interopRequireDefault(_reactAddonsCssTransitionGroup);
3586
3682
 
@@ -3827,7 +3923,7 @@ module.exports =
3827
3923
  exports.default = SchemaAccordion;
3828
3924
 
3829
3925
  /***/ },
3830
- /* 49 */
3926
+ /* 50 */
3831
3927
  /***/ function(module, exports, __webpack_require__) {
3832
3928
 
3833
3929
  'use strict';
@@ -3848,46 +3944,52 @@ module.exports =
3848
3944
 
3849
3945
  var _reactRedux = __webpack_require__(9);
3850
3946
 
3851
- var _accountStep = __webpack_require__(37);
3947
+ var _accountStep = __webpack_require__(38);
3852
3948
 
3853
3949
  var _accountStep2 = _interopRequireDefault(_accountStep);
3854
3950
 
3855
- var _phaseStep = __webpack_require__(44);
3951
+ var _phaseStep = __webpack_require__(45);
3856
3952
 
3857
3953
  var _phaseStep2 = _interopRequireDefault(_phaseStep);
3858
3954
 
3859
- var _environmentStep = __webpack_require__(40);
3955
+ var _environmentStep = __webpack_require__(41);
3860
3956
 
3861
3957
  var _environmentStep2 = _interopRequireDefault(_environmentStep);
3862
3958
 
3863
- var _schemaStep = __webpack_require__(46);
3959
+ var _schemaStep = __webpack_require__(47);
3864
3960
 
3865
3961
  var _schemaStep2 = _interopRequireDefault(_schemaStep);
3866
3962
 
3867
- var _filterStep = __webpack_require__(41);
3963
+ var _filterStep = __webpack_require__(42);
3868
3964
 
3869
3965
  var _filterStep2 = _interopRequireDefault(_filterStep);
3870
3966
 
3871
- var _mapStep = __webpack_require__(42);
3967
+ var _mapStep = __webpack_require__(43);
3872
3968
 
3873
3969
  var _mapStep2 = _interopRequireDefault(_mapStep);
3874
3970
 
3875
- var _previewStep = __webpack_require__(45);
3971
+ var _previewStep = __webpack_require__(46);
3876
3972
 
3877
3973
  var _previewStep2 = _interopRequireDefault(_previewStep);
3878
3974
 
3879
- var _deployStep = __webpack_require__(39);
3975
+ var _deployStep = __webpack_require__(40);
3880
3976
 
3881
3977
  var _deployStep2 = _interopRequireDefault(_deployStep);
3882
3978
 
3883
- var _nameStep = __webpack_require__(43);
3979
+ var _nameStep = __webpack_require__(44);
3884
3980
 
3885
3981
  var _nameStep2 = _interopRequireDefault(_nameStep);
3886
3982
 
3887
- var _adapterStep = __webpack_require__(38);
3983
+ var _adapterStep = __webpack_require__(39);
3888
3984
 
3889
3985
  var _adapterStep2 = _interopRequireDefault(_adapterStep);
3890
3986
 
3987
+ var _salesforceHedaResources = __webpack_require__(37);
3988
+
3989
+ var example = _interopRequireWildcard(_salesforceHedaResources);
3990
+
3991
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
3992
+
3891
3993
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3892
3994
 
3893
3995
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -3942,21 +4044,24 @@ module.exports =
3942
4044
  modes.forEach(function (mode) {
3943
4045
  var schema = values[mode + 'Schema'];
3944
4046
  var resources = schema && Object.keys(schema).map(function (key) {
3945
- var props = Object.keys(schema[key]).map(function (prop) {
4047
+ var props = Object.keys(schema[key]).filter(function (p) {
4048
+ return schema[key][p];
4049
+ }).map(function (prop) {
3946
4050
  return {
3947
- name: prop,
4051
+ name: example.Heda[key] && example.Heda[key][prop] ? 'hed__' + prop.replace(/ /g, '') + '__c' : prop.replace(/ /g, ''),
3948
4052
  type: _typeof(schema[key][prop]) // we need actual types on schemas
3949
4053
  };
3950
4054
  });
3951
4055
  return {
3952
4056
  name: key,
4057
+ type: key,
3953
4058
  properties: props
3954
4059
  };
3955
4060
  });
3956
4061
  var custom = values[mode + 'SchemaType'] === 'custom';
3957
4062
  var name = custom ? values[mode + 'NewSchemaName'] : values[mode + 'ExistingSchemaName'];
3958
4063
  schemas['' + mode] = {
3959
- name: name,
4064
+ name: name || mode + 'Schema',
3960
4065
  providerType: _this2.props.providers[mode],
3961
4066
  resources: resources
3962
4067
  };
@@ -3964,12 +4069,14 @@ module.exports =
3964
4069
  //----------------------------------
3965
4070
  // Create mapping
3966
4071
  //----------------------------------
3967
- var mapping = values.mappings && Object.keys(values.mappings).map(function (key) {
4072
+ var mapping = values.mappings && Object.keys(values.mappings).map(function (src) {
4073
+ var destResource = values.mappings[src].split('.')[0];
4074
+ var destProperty = values.mappings[src].split('.')[1];
3968
4075
  return {
3969
- resourceFromName: key.split('.')[0],
3970
- resourceToName: values.mappings[key].split('.')[0],
3971
- propertyFromName: key.split('.')[1],
3972
- propertyToName: values.mappings[key].split('.')[1]
4076
+ resourceFromName: src.split('.')[0],
4077
+ resourceToName: destResource,
4078
+ propertyFromName: src.split('.')[1],
4079
+ propertyToName: example.Heda[destResource] && example.Heda[destResource][destProperty] ? 'hed__' + destProperty.replace(/ /g, '') + '__c' : destProperty.replace(/ /g, '')
3973
4080
  };
3974
4081
  });
3975
4082
  //----------------------------------
@@ -3985,12 +4092,14 @@ module.exports =
3985
4092
  var _props = this.props,
3986
4093
  actions = _props.actions,
3987
4094
  onFinish = _props.onFinish,
4095
+ onSubmit = _props.onSubmit,
3988
4096
  typeGuid = _props.typeGuid,
3989
4097
  accountId = _props.accountId,
3990
4098
  tenantId = _props.tenantId;
3991
4099
 
3992
4100
  if (true) {
3993
4101
  actions.submitWizardData(tenantId, accountId, schemas.source, schemas.destination, mapping, configuration, config.title || '', typeGuid, onFinish);
4102
+ onSubmit();
3994
4103
  }
3995
4104
  }
3996
4105
  }, {
@@ -4099,7 +4208,7 @@ module.exports =
4099
4208
  exports.default = WizardForm;
4100
4209
 
4101
4210
  /***/ },
4102
- /* 50 */
4211
+ /* 51 */
4103
4212
  /***/ function(module, exports, __webpack_require__) {
4104
4213
 
4105
4214
  'use strict';
@@ -4114,7 +4223,7 @@ module.exports =
4114
4223
 
4115
4224
  var _react2 = _interopRequireDefault(_react);
4116
4225
 
4117
- var _redux = __webpack_require__(56);
4226
+ var _redux = __webpack_require__(57);
4118
4227
 
4119
4228
  var _reactRedux = __webpack_require__(9);
4120
4229
 
@@ -4122,9 +4231,9 @@ module.exports =
4122
4231
 
4123
4232
  var wizardActions = _interopRequireWildcard(_wizard);
4124
4233
 
4125
- __webpack_require__(51);
4234
+ __webpack_require__(52);
4126
4235
 
4127
- var _wizardForm = __webpack_require__(49);
4236
+ var _wizardForm = __webpack_require__(50);
4128
4237
 
4129
4238
  var _wizardForm2 = _interopRequireDefault(_wizardForm);
4130
4239
 
@@ -4308,8 +4417,8 @@ module.exports =
4308
4417
  }
4309
4418
  }
4310
4419
  var providers = {
4311
- source: wizard.sourceProvider,
4312
- destination: wizard.destinationProvider
4420
+ source: wizard.source.type,
4421
+ destination: wizard.destination.type
4313
4422
  };
4314
4423
  this.setState({
4315
4424
  steps: stepList,
@@ -4357,27 +4466,27 @@ module.exports =
4357
4466
  exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(LingkSync);
4358
4467
 
4359
4468
  /***/ },
4360
- /* 51 */
4469
+ /* 52 */
4361
4470
  /***/ function(module, exports) {
4362
4471
 
4363
4472
  // removed by extract-text-webpack-plugin
4364
4473
 
4365
4474
  /***/ },
4366
- /* 52 */,
4367
4475
  /* 53 */,
4368
- /* 54 */
4476
+ /* 54 */,
4477
+ /* 55 */
4369
4478
  /***/ function(module, exports) {
4370
4479
 
4371
4480
  module.exports = require("axios");
4372
4481
 
4373
4482
  /***/ },
4374
- /* 55 */
4483
+ /* 56 */
4375
4484
  /***/ function(module, exports) {
4376
4485
 
4377
4486
  module.exports = require("react-addons-css-transition-group");
4378
4487
 
4379
4488
  /***/ },
4380
- /* 56 */
4489
+ /* 57 */
4381
4490
  /***/ function(module, exports) {
4382
4491
 
4383
4492
  module.exports = require("redux");