@lingk/sync 1.1.40 → 1.1.41
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 +422 -559
- package/build/credentialSections.js.map +1 -1
- package/build/css/credentialSections.css +10 -3
- package/build/css/lightningStyles.css +4 -2
- package/build/css/lingkStyles.css +4 -2
- package/build/css/main.css +93 -43
- package/build/lightning.js +788 -1820
- package/build/lightning.js.map +1 -1
- package/build/lightningStyles.js +2 -2
- package/build/lightningStyles.js.map +1 -1
- package/build/lingk.js +56 -55
- package/build/lingk.js.map +1 -1
- package/build/lingkStyles.js +2 -2
- package/build/lingkStyles.js.map +1 -1
- package/build/loadData.js +232 -224
- package/build/loadData.js.map +1 -1
- package/build/main.js +4790 -8419
- package/build/main.js.map +1 -1
- package/build/metadataDropdown.js +55 -51
- package/build/metadataDropdown.js.map +1 -1
- package/build/metadataFunctions.js +365 -307
- package/build/metadataFunctions.js.map +1 -1
- package/build/reducer.js +371 -313
- package/build/reducer.js.map +1 -1
- package/build/saveData.js +70 -61
- package/build/saveData.js.map +1 -1
- package/package.json +1 -1
package/build/loadData.js
CHANGED
|
@@ -46,12 +46,12 @@ module.exports =
|
|
|
46
46
|
/***/ 0:
|
|
47
47
|
/***/ function(module, exports, __webpack_require__) {
|
|
48
48
|
|
|
49
|
-
module.exports = __webpack_require__(
|
|
49
|
+
module.exports = __webpack_require__(58);
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
/***/ },
|
|
53
53
|
|
|
54
|
-
/***/
|
|
54
|
+
/***/ 58:
|
|
55
55
|
/***/ function(module, exports) {
|
|
56
56
|
|
|
57
57
|
'use strict';
|
|
@@ -79,240 +79,246 @@ module.exports =
|
|
|
79
79
|
return rsc.name === bundle.resourceLabel;
|
|
80
80
|
});
|
|
81
81
|
if (bundleResource) {
|
|
82
|
+
(function () {
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
//get bundle destinationKeys
|
|
85
|
+
var destinationKeys = [];
|
|
86
|
+
var __destinationKeys = [];
|
|
87
|
+
var destinationKeysParents = [];
|
|
88
|
+
bundle.destinationKeys.forEach(function (dk, i) {
|
|
89
|
+
if (bundle.customExternalKeys) {
|
|
90
|
+
var deNestedProp = deNest(dk, bundle.destinationKeysParents && JSON.parse(bundle.destinationKeysParents[i]), bundleResource);
|
|
91
|
+
if (deNestedProp.property) {
|
|
92
|
+
destinationKeys.push(deNestedProp.property);
|
|
93
|
+
__destinationKeys.push(deNestedProp.__property);
|
|
94
|
+
destinationKeysParents.push(deNestedProp.parentsArray);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
destinationKeys.push('Lingk External Id');
|
|
98
|
+
__destinationKeys.push('Lingk_External_Id__c');
|
|
94
99
|
}
|
|
95
|
-
} else {
|
|
96
|
-
destinationKeys.push('Lingk External Id');
|
|
97
|
-
__destinationKeys.push('Lingk_External_Id__c');
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
//get bundle sourceKeys
|
|
102
|
-
var sourceKeys = [];
|
|
103
|
-
var __sourceKeys = [];
|
|
104
|
-
var sourceKeysObjects = [];
|
|
105
|
-
var __sourceKeysObjects = [];
|
|
106
|
-
var sourceKeysParents = [];
|
|
107
|
-
bundle.sourceKeys.forEach(function (sk, i) {
|
|
108
|
-
var sourceKeyResourceObj = bundle.resources.find(function (r) {
|
|
109
|
-
return r.resourceName === bundle.sourceKeysObjects[i];
|
|
110
100
|
});
|
|
111
|
-
if (sourceKeyResourceObj) {
|
|
112
|
-
var sourceKeyResourceProvider = sourceKeyResourceObj.provider.replace('Reader', '').toLowerCase();
|
|
113
|
-
var primaryDataSourceMetadata = sourceKeyResourceProvider === DP.toLowerCase() ? DM : sourceKeyResourceProvider === SP.toLowerCase() ? SM : null;
|
|
114
101
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
//get bundle sourceKeys
|
|
103
|
+
var sourceKeys = [];
|
|
104
|
+
var __sourceKeys = [];
|
|
105
|
+
var sourceKeysObjects = [];
|
|
106
|
+
var __sourceKeysObjects = [];
|
|
107
|
+
var sourceKeysParents = [];
|
|
108
|
+
bundle.sourceKeys.forEach(function (sk, i) {
|
|
109
|
+
var sourceKeyResourceObj = bundle.resources.find(function (r) {
|
|
110
|
+
return r.resourceName === bundle.sourceKeysObjects[i];
|
|
111
|
+
});
|
|
112
|
+
if (sourceKeyResourceObj) {
|
|
113
|
+
var sourceKeyResourceProvider = sourceKeyResourceObj.provider.replace('Reader', '').toLowerCase();
|
|
114
|
+
var primaryDataSourceMetadata = sourceKeyResourceProvider === DP.toLowerCase() ? DM : sourceKeyResourceProvider === SP.toLowerCase() ? SM : null;
|
|
115
|
+
|
|
116
|
+
if (primaryDataSourceMetadata) {
|
|
117
|
+
var sourceKeyResource = primaryDataSourceMetadata.find(function (r) {
|
|
118
|
+
return r.name === sourceKeyResourceObj.resourceLabel && r.type === sourceKeyResourceObj.resourceName;
|
|
119
|
+
});
|
|
120
|
+
if (sourceKeyResource) {
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
var deNestedProp = deNest(sk, bundle.sourceKeysParents && JSON.parse(bundle.sourceKeysParents[i]), sourceKeyResource);
|
|
123
|
+
if (deNestedProp.property) {
|
|
124
|
+
sourceKeys.push(deNestedProp.property);
|
|
125
|
+
__sourceKeys.push(deNestedProp.__property);
|
|
126
|
+
sourceKeysObjects.push(sourceKeyResource.name);
|
|
127
|
+
__sourceKeysObjects.push(sourceKeyResource.type);
|
|
128
|
+
sourceKeysParents.push(deNestedProp.parentsArray);
|
|
129
|
+
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
+
});
|
|
133
134
|
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
var resources = [];
|
|
136
|
+
bundle.resources && bundle.resources.forEach(function (rsc, rscIndex) {
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
//get resource and joinKey for bundleResource (check both metadatas)
|
|
139
|
+
var resourceProvider = rsc.provider.replace('Reader', '').toLowerCase();
|
|
140
|
+
var dataSourceMetadata = resourceProvider === DP.toLowerCase() ? DM : resourceProvider === SP.toLowerCase() ? SM : null;
|
|
140
141
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
var rscResource = null;
|
|
143
|
+
var deNestedJoinKey = {};
|
|
144
|
+
var joinKeyResourceName = null;
|
|
145
|
+
var __joinKeyResourceName = null;
|
|
146
|
+
if (dataSourceMetadata) {
|
|
147
|
+
rscResource = dataSourceMetadata.find(function (r) {
|
|
148
|
+
return r.name === rsc.resourceLabel;
|
|
149
|
+
});
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
if (rsc.joinKeyName) {
|
|
151
152
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
153
|
+
if (rsc.joinKeyIsParameter) {
|
|
154
|
+
// joinKeyName coming from parameter from another resource
|
|
155
|
+
deNestedJoinKey = { property: rsc.joinKeyName };
|
|
156
|
+
joinKeyResourceName = rsc.joinKeyResource;
|
|
157
|
+
__joinKeyResourceName = rsc.joinKeyResource;
|
|
158
|
+
} else {
|
|
159
|
+
// joinKeyName coming from field on this resource
|
|
160
|
+
//if(rsc.resourceName===rsc.joinKeyResource){
|
|
161
|
+
var joinKeyResource = dataSourceMetadata.find(function (r) {
|
|
162
|
+
return r.type === rsc.resourceName && r.name === rsc.resourceLabel;
|
|
163
|
+
});
|
|
164
|
+
if (joinKeyResource) {
|
|
165
|
+
deNestedJoinKey = deNest(rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource);
|
|
166
|
+
joinKeyResourceName = joinKeyResource.name;
|
|
167
|
+
__joinKeyResourceName = joinKeyResource.type;
|
|
168
|
+
}
|
|
169
|
+
//}
|
|
167
170
|
}
|
|
168
|
-
//}
|
|
169
171
|
}
|
|
170
|
-
}
|
|
171
|
-
} // end if dataSourceMetadata
|
|
172
|
+
} // end if dataSourceMetadata
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
//get resource and primaryKey for parent resource for join
|
|
175
|
+
var primaryResourceProviderLast_Index = rsc.parentNameAndProvider.lastIndexOf('_');
|
|
176
|
+
var primaryResourceProvider = rsc.parentNameAndProvider.substr(primaryResourceProviderLast_Index + 1, rsc.parentNameAndProvider.length);
|
|
177
|
+
var primaryDataSourceMetadata = primaryResourceProvider.toLowerCase() === DP.toLowerCase() ? DM : primaryResourceProvider.toLowerCase() === SP.toLowerCase() ? SM : null;
|
|
177
178
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
var deNestedPrimaryKey = {};
|
|
180
|
+
var primaryKeyResourceName = null;
|
|
181
|
+
var __primaryKeyResourceName = null;
|
|
182
|
+
if (primaryDataSourceMetadata) {
|
|
183
|
+
if (rsc.primaryKeyName) {
|
|
183
184
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
185
|
+
if (rsc.primaryKeyIsParameter) {
|
|
186
|
+
//primaryKeyName coming from parameter (another resource)
|
|
187
|
+
deNestedPrimaryKey = { property: rsc.primaryKeyName };
|
|
188
|
+
primaryKeyResourceName = rsc.primaryKeyResource;
|
|
189
|
+
__primaryKeyResourceName = rsc.primaryKeyResource;
|
|
190
|
+
} else {
|
|
191
|
+
(function () {
|
|
192
|
+
// primaryKeyName coming from resource IN THIS BUNDLE
|
|
193
|
+
var primaryKeyResourceResource = bundle.resources.find(function (r) {
|
|
194
|
+
return rsc.primaryKeyResource === r.resourceName;
|
|
195
|
+
});
|
|
196
|
+
if (primaryKeyResourceResource) {
|
|
197
|
+
//if(primaryResourceName===rsc.primaryKeyResource){
|
|
198
|
+
var rscPrimaryResource = primaryDataSourceMetadata.find(function (r) {
|
|
199
|
+
return r.name === primaryKeyResourceResource.resourceLabel;
|
|
200
|
+
});
|
|
201
|
+
if (rscPrimaryResource) {
|
|
202
|
+
deNestedPrimaryKey = deNest(rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource);
|
|
203
|
+
primaryKeyResourceName = rscPrimaryResource.name;
|
|
204
|
+
__primaryKeyResourceName = rscPrimaryResource.type;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
})();
|
|
204
208
|
}
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
|
-
}
|
|
208
211
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
212
|
+
if (rscResource) {
|
|
213
|
+
resources.push(Object.assign({
|
|
214
|
+
name: rscResource.name,
|
|
215
|
+
__name: rscResource.type,
|
|
216
|
+
provider: resourceProvider
|
|
217
|
+
}, 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 }, {
|
|
218
|
+
joinType: rsc.joinType || 'LEFT JOIN'
|
|
219
|
+
}, rscResource.parentRef && { parentRef: rscResource.parentRef }, rsc.parameterFilters && { parameterFilters: rsc.parameterFilters }, {
|
|
220
|
+
level: rsc.level || (rscIndex === 0 ? 0 : 1),
|
|
221
|
+
parentNameAndProvider: rsc.parentNameAndProvider
|
|
222
|
+
}));
|
|
223
|
+
//console.log(resources[resources.length-1])
|
|
224
|
+
}
|
|
225
|
+
}); // end bundle.resource.forEach
|
|
223
226
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
var mappings = [];
|
|
228
|
+
savedMapping.mappings && savedMapping.mappings.filter(function (map) {
|
|
229
|
+
return map.bundleIndex === index;
|
|
230
|
+
}).forEach(function (m) {
|
|
231
|
+
var dataSourceMetadata = m.isDestinationResource ? DM : SM;
|
|
232
|
+
if (isReverse) {
|
|
233
|
+
dataSourceMetadata = m.isDestinationResource ? SM : DM;
|
|
234
|
+
}
|
|
232
235
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
236
|
+
// source key / parents
|
|
237
|
+
var resourceFromBundle = bundle.resources.find(function (br) {
|
|
238
|
+
return br.resourceName === m.resourceFromName;
|
|
239
|
+
});
|
|
240
|
+
var sourceResource = resourceFromBundle && dataSourceMetadata.find(function (rsc) {
|
|
241
|
+
return rsc.name === resourceFromBundle.resourceLabel;
|
|
242
|
+
});
|
|
243
|
+
var deNestedSourceProp = deNest(m.propertyFromName, m.propertyFromParents, sourceResource);
|
|
241
244
|
|
|
242
|
-
|
|
243
|
-
|
|
245
|
+
// destintation key / parents
|
|
246
|
+
var deNestedDestProp = deNest(m.propertyToName, m.propertyToParents, bundleResource);
|
|
244
247
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (concatRsc) {
|
|
258
|
-
var concatRscProvider = concatRsc.provider.replace('Reader', '').toLowerCase();
|
|
259
|
-
var concatRscMetadata = concatRscProvider === DP.toLowerCase() ? DM : concatRscProvider === SP.toLowerCase() ? SM : null;
|
|
260
|
-
if (concatRscMetadata) {
|
|
261
|
-
var transConcatResource = concatRscMetadata.find(function (r) {
|
|
262
|
-
return r.type === concatRsc.resourceName;
|
|
263
|
-
});
|
|
264
|
-
var concatLabels = deNest(field, nestedFields, transConcatResource);
|
|
265
|
-
var result = transConcatResource.name + '->';
|
|
266
|
-
concatLabels.parentsArray.forEach(function (p) {
|
|
267
|
-
return result += p + '.';
|
|
248
|
+
var transformations = [{ type: 'none' }];
|
|
249
|
+
if (m.transformations && m.transformations.length > 0) {
|
|
250
|
+
var trans = m.transformations[0];
|
|
251
|
+
if (trans.type === 'concat') {
|
|
252
|
+
(function () {
|
|
253
|
+
var s = trans.args[1].split('->');
|
|
254
|
+
var transConcatResourceName = s[s.length - 2];
|
|
255
|
+
var nestedFields = s[s.length - 1].split('.');
|
|
256
|
+
var field = nestedFields[nestedFields.length - 1];
|
|
257
|
+
nestedFields.pop();
|
|
258
|
+
var concatRsc = savedBundles.bundles[m.bundleIndex].resources.find(function (r) {
|
|
259
|
+
return r.resourceLabel === transConcatResourceName;
|
|
268
260
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
261
|
+
if (concatRsc) {
|
|
262
|
+
var concatRscProvider = concatRsc.provider.replace('Reader', '').toLowerCase();
|
|
263
|
+
var concatRscMetadata = concatRscProvider === DP.toLowerCase() ? DM : concatRscProvider === SP.toLowerCase() ? SM : null;
|
|
264
|
+
if (concatRscMetadata) {
|
|
265
|
+
var transConcatResource = concatRscMetadata.find(function (r) {
|
|
266
|
+
return r.type === concatRsc.resourceName;
|
|
267
|
+
});
|
|
268
|
+
var concatLabels = deNest(field, nestedFields, transConcatResource);
|
|
269
|
+
var result = transConcatResource.name + '->';
|
|
270
|
+
concatLabels.parentsArray.forEach(function (p) {
|
|
271
|
+
return result += p + '.';
|
|
272
|
+
});
|
|
273
|
+
result += concatLabels.property;
|
|
274
|
+
transformations = [{ type: 'concat', args: [trans.args[0], result] }];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
})();
|
|
278
|
+
} else {
|
|
279
|
+
transformations = m.transformations;
|
|
272
280
|
}
|
|
273
|
-
} else {
|
|
274
|
-
transformations = m.transformations;
|
|
275
281
|
}
|
|
276
|
-
}
|
|
277
282
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
283
|
+
if (sourceResource && deNestedSourceProp.property && deNestedDestProp.property) {
|
|
284
|
+
mappings.push(Object.assign({
|
|
285
|
+
resourceFromName: sourceResource.name,
|
|
286
|
+
__resourceFromName: sourceResource.type,
|
|
287
|
+
propertyFromName: deNestedSourceProp.property,
|
|
288
|
+
__propertyFromName: deNestedSourceProp.__property
|
|
289
|
+
}, deNestedSourceProp.parentsArray && deNestedSourceProp.parentsArray.length > 0 && { propertyFromParents: deNestedSourceProp.parentsArray }, {
|
|
290
|
+
resourceToName: bundleResource.name,
|
|
291
|
+
__resourceToName: bundleResource.type,
|
|
292
|
+
propertyToName: deNestedDestProp.property,
|
|
293
|
+
__propertyToName: deNestedDestProp.__property
|
|
294
|
+
}, deNestedDestProp.parentsArray && deNestedDestProp.parentsArray.length > 0 && { propertyToParents: deNestedDestProp.parentsArray }, m.isDestinationResource && { dataSourceIsDestinationEntity: true }, m.isExternalKeyMapping && { isExternalKeyMapping: true }, m.isUnique && { isUnique: true }, {
|
|
295
|
+
transformations: transformations
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
}); // end wizard.savedMappings.forEach
|
|
299
|
+
resourceGroups.push(Object.assign({
|
|
300
|
+
name: bundleResource.name,
|
|
301
|
+
__name: bundleResource.type,
|
|
302
|
+
resources: resources, mappings: mappings,
|
|
303
|
+
customExternalKeys: bundle.customExternalKeys || false
|
|
304
|
+
}, bundle.customExternalKeys === true && {
|
|
305
|
+
sourceKeys: sourceKeys, __sourceKeys: __sourceKeys,
|
|
306
|
+
sourceKeysObjects: sourceKeysObjects, __sourceKeysObjects: __sourceKeysObjects,
|
|
307
|
+
sourceKeysParents: sourceKeysParents,
|
|
308
|
+
destinationKeys: destinationKeys, __destinationKeys: __destinationKeys,
|
|
309
|
+
destinationKeysParents: destinationKeysParents
|
|
310
|
+
}, bundle.customExternalKeys === false && {
|
|
311
|
+
lingkSourceKey: sourceKeys[0], __lingkSourceKey: __sourceKeys[0],
|
|
312
|
+
lingkSourceKeyObject: sourceKeysObjects[0],
|
|
313
|
+
__lingkSourceKeyObject: __sourceKeysObjects[0],
|
|
314
|
+
lingkSourceKeyParents: sourceKeysParents[0]
|
|
315
|
+
}, {
|
|
316
|
+
provider: bundle.provider,
|
|
317
|
+
//...bundle.recordTypeId && {recordTypeId: bundle.recordTypeId},
|
|
318
|
+
deleteEnabled: bundle.deleteEnabled || false,
|
|
319
|
+
writeMode: bundle.writeMode || (bundle.deleteEnabled ? 'delete' : 'default')
|
|
320
|
+
})); // end push each bundle (contains resources AND mappings)
|
|
321
|
+
})();
|
|
316
322
|
} // end if bundleResource
|
|
317
323
|
}); // end forEach over bundles
|
|
318
324
|
|
|
@@ -325,31 +331,33 @@ module.exports =
|
|
|
325
331
|
var parentsArray = [];
|
|
326
332
|
if (rsc) {
|
|
327
333
|
if (parents && parents.length > 0) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
334
|
+
(function () {
|
|
335
|
+
var nestedRsc = rsc;
|
|
336
|
+
var tempParentsArray = [];
|
|
337
|
+
parents.forEach(function (ps) {
|
|
338
|
+
var pProp = nestedRsc.properties && nestedRsc.properties.find(function (p) {
|
|
339
|
+
return p.name === ps;
|
|
340
|
+
});
|
|
341
|
+
tempParentsArray.push(pProp.label);
|
|
342
|
+
nestedRsc = pProp.object;
|
|
333
343
|
});
|
|
334
|
-
tempParentsArray
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
344
|
+
parentsArray = tempParentsArray;
|
|
345
|
+
var sourceKeyProperty = nestedRsc.properties && nestedRsc.properties.find(function (p) {
|
|
346
|
+
return p.name === prop;
|
|
347
|
+
});
|
|
348
|
+
if (sourceKeyProperty) {
|
|
349
|
+
property = sourceKeyProperty.label;
|
|
350
|
+
__property = sourceKeyProperty.name;
|
|
351
|
+
}
|
|
352
|
+
})();
|
|
353
|
+
} else {
|
|
354
|
+
var sourceKeyProperty = rsc.properties && rsc.properties.find(function (p) {
|
|
339
355
|
return p.name === prop;
|
|
340
356
|
});
|
|
341
357
|
if (sourceKeyProperty) {
|
|
342
358
|
property = sourceKeyProperty.label;
|
|
343
359
|
__property = sourceKeyProperty.name;
|
|
344
360
|
}
|
|
345
|
-
} else {
|
|
346
|
-
var _sourceKeyProperty = rsc.properties && rsc.properties.find(function (p) {
|
|
347
|
-
return p.name === prop;
|
|
348
|
-
});
|
|
349
|
-
if (_sourceKeyProperty) {
|
|
350
|
-
property = _sourceKeyProperty.label;
|
|
351
|
-
__property = _sourceKeyProperty.name;
|
|
352
|
-
}
|
|
353
361
|
}
|
|
354
362
|
}
|
|
355
363
|
if (prop === 'Lingk_External_Id__c') {
|