@salesforce/lds-adapters-uiapi 1.313.0 → 1.314.0
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/dist/es/es2018/types/src/configuration.d.ts +75 -17
- package/dist/es/es2018/types/src/main.d.ts +45 -12
- package/dist/es/es2018/types/src/wire/graphql/configurationTypes.d.ts +4 -0
- package/dist/es/es2018/types/src/wire/graphqlBatch/configurationTypes.d.ts +5 -0
- package/dist/es/es2018/types/src/wire/performQuickAction/configurationTypes.d.ts +4 -0
- package/dist/es/es2018/types/src/wire/performUpdateRecordQuickAction/configurationTypes.d.ts +4 -0
- package/dist/es/es2018/uiapi-records-service.js +93 -74
- package/package.json +7 -7
- package/sfdc/graphqlAdapters.js +94 -75
- package/sfdc/index.js +109 -89
- package/sfdc/uiapi-static-functions.js +197 -0
|
@@ -151,6 +151,203 @@ function getFieldApiName(value, onlyQualifiedFieldNames = false) {
|
|
|
151
151
|
return undefined;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Defines configuration for the module with a default value which can be overridden by the runtime environment.
|
|
156
|
+
*/
|
|
157
|
+
// A holder for a configurable adapter override
|
|
158
|
+
class Configurable {
|
|
159
|
+
constructor() {
|
|
160
|
+
this.getAdapter = () => {
|
|
161
|
+
return this.adapter;
|
|
162
|
+
};
|
|
163
|
+
this.setAdapter = (value) => {
|
|
164
|
+
this.adapter = value;
|
|
165
|
+
};
|
|
166
|
+
this.adapter = undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Configurable adapters that can have environmental overrides
|
|
170
|
+
let configurableCreateRecordAdapter = new Configurable();
|
|
171
|
+
let configurableUpdateRecordAdapter = new Configurable();
|
|
172
|
+
let configurableDeleteRecordAdapter = new Configurable();
|
|
173
|
+
let configurablePerformQuickActionAdapter = new Configurable();
|
|
174
|
+
let configurablePerformUpdateRecordQuickActionAdapter = new Configurable();
|
|
175
|
+
let configurableCreateContentDocumentAndVersion = new Configurable();
|
|
176
|
+
let configurableCreateContentVersion = new Configurable();
|
|
177
|
+
/**
|
|
178
|
+
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
179
|
+
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
180
|
+
* be reached by following 1 relationship from the root record, etc.
|
|
181
|
+
* @defaultValue '5', replicates the current behavior
|
|
182
|
+
*/
|
|
183
|
+
let trackedFieldDepthOnCacheMiss = 5;
|
|
184
|
+
/**
|
|
185
|
+
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
186
|
+
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
187
|
+
* be reached by following 1 relationship from the root record, etc.
|
|
188
|
+
* @defaultValue '5', replicates the current behavior
|
|
189
|
+
*/
|
|
190
|
+
let trackedFieldDepthOnCacheMergeConflict = 5;
|
|
191
|
+
/**
|
|
192
|
+
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
193
|
+
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
194
|
+
* be reached by following 1 relationship from the root record, etc.
|
|
195
|
+
* @defaultValue '5', replicates the current behavior
|
|
196
|
+
*/
|
|
197
|
+
let trackedFieldDepthOnNotifyChange = 5;
|
|
198
|
+
/**
|
|
199
|
+
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
200
|
+
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
201
|
+
*/
|
|
202
|
+
let trackedFieldLeafNodeIdAndNameOnly = false;
|
|
203
|
+
/**
|
|
204
|
+
* One store enabled Get Object Info adapter
|
|
205
|
+
*/
|
|
206
|
+
let oneStoreGetObjectInfoAdapter = undefined;
|
|
207
|
+
/**
|
|
208
|
+
* One store enabled Get Object Infos adapter
|
|
209
|
+
*/
|
|
210
|
+
let oneStoreGetObjectInfosAdapter = undefined;
|
|
211
|
+
/**
|
|
212
|
+
* Determines when to include PDL strategies for Related Lists
|
|
213
|
+
*/
|
|
214
|
+
let relatedListsPredictionsEnabled = false;
|
|
215
|
+
/**
|
|
216
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
217
|
+
* Configuration for one store enabled REST adapters only.
|
|
218
|
+
*/
|
|
219
|
+
const configurationForOneStoreEnabledAdapters = {
|
|
220
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
221
|
+
oneStoreGetObjectInfoAdapter = adapter;
|
|
222
|
+
},
|
|
223
|
+
getGetObjectInfoAdapter: function () {
|
|
224
|
+
return oneStoreGetObjectInfoAdapter;
|
|
225
|
+
},
|
|
226
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
227
|
+
oneStoreGetObjectInfosAdapter = adapter;
|
|
228
|
+
},
|
|
229
|
+
getGetObjectInfosAdapter: function () {
|
|
230
|
+
return oneStoreGetObjectInfosAdapter;
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
const getKeywordSearchResultsFactory = new Configurable();
|
|
234
|
+
const getListRecordsByNameFactory = new Configurable();
|
|
235
|
+
const getListUiFactory = new Configurable();
|
|
236
|
+
const getLookupRecordsFactory = new Configurable();
|
|
237
|
+
const getQuickActionDefaultsFactory = new Configurable();
|
|
238
|
+
const getRecordCreateDefaultsFactory = new Configurable();
|
|
239
|
+
const getRecordTemplateCloneFactory = new Configurable();
|
|
240
|
+
const getRecordTemplateCreateFactory = new Configurable();
|
|
241
|
+
const getRecordUiFactory = new Configurable();
|
|
242
|
+
const getRecordFactory = new Configurable();
|
|
243
|
+
const getRecordsFactory = new Configurable();
|
|
244
|
+
const getRelatedListRecordsFactory = new Configurable();
|
|
245
|
+
const getRelatedListRecordsBatchFactory = new Configurable();
|
|
246
|
+
const getSearchResultsFactory = new Configurable();
|
|
247
|
+
// The following set of adapters all touch RecordRepresentation directly or indirectly,
|
|
248
|
+
// so they need to support having a custom factory provided by the mobile environment.
|
|
249
|
+
const configurationForEnvironmentFactoryOverrides = {
|
|
250
|
+
getKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory.getAdapter,
|
|
251
|
+
setGetKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory.setAdapter,
|
|
252
|
+
getListRecordsByNameAdapterFactory: getListRecordsByNameFactory.getAdapter,
|
|
253
|
+
setGetListRecordsByNameAdapterFactory: getListRecordsByNameFactory.setAdapter,
|
|
254
|
+
getListUiAdapterFactory: getListUiFactory.getAdapter,
|
|
255
|
+
setGetListUiAdapterFactory: getListUiFactory.setAdapter,
|
|
256
|
+
getLookupRecordsAdapterFactory: getLookupRecordsFactory.getAdapter,
|
|
257
|
+
setGetLookupRecordsAdapterFactory: getLookupRecordsFactory.setAdapter,
|
|
258
|
+
getQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory.getAdapter,
|
|
259
|
+
setGetQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory.setAdapter,
|
|
260
|
+
getRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory.getAdapter,
|
|
261
|
+
setGetRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory.setAdapter,
|
|
262
|
+
getRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory.getAdapter,
|
|
263
|
+
setGetRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory.setAdapter,
|
|
264
|
+
getRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory.getAdapter,
|
|
265
|
+
setGetRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory.setAdapter,
|
|
266
|
+
getRecordUiAdapterFactory: getRecordUiFactory.getAdapter,
|
|
267
|
+
setGetRecordUiAdapterFactory: getRecordUiFactory.setAdapter,
|
|
268
|
+
getRecordAdapterFactory: getRecordFactory.getAdapter,
|
|
269
|
+
setGetRecordAdapterFactory: getRecordFactory.setAdapter,
|
|
270
|
+
getRecordsAdapterFactory: getRecordsFactory.getAdapter,
|
|
271
|
+
setGetRecordsAdapterFactory: getRecordsFactory.setAdapter,
|
|
272
|
+
getRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory.getAdapter,
|
|
273
|
+
setGetRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory.setAdapter,
|
|
274
|
+
getRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory.getAdapter,
|
|
275
|
+
setGetRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory.setAdapter,
|
|
276
|
+
getSearchResultsAdapterFactory: getSearchResultsFactory.getAdapter,
|
|
277
|
+
setGetSearchResultsAdapterFactory: getSearchResultsFactory.setAdapter,
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
281
|
+
* Configuration for REST adapters only.
|
|
282
|
+
*/
|
|
283
|
+
({
|
|
284
|
+
setTrackedFieldDepthOnCacheMiss: function (trackedFieldDepthOnCacheMissParam) {
|
|
285
|
+
trackedFieldDepthOnCacheMiss = trackedFieldDepthOnCacheMissParam;
|
|
286
|
+
},
|
|
287
|
+
getTrackedFieldDepthOnCacheMiss: function () {
|
|
288
|
+
return trackedFieldDepthOnCacheMiss;
|
|
289
|
+
},
|
|
290
|
+
setTrackedFieldDepthOnCacheMergeConflict: function (trackedFieldDepthOnCacheMergeConflictParam) {
|
|
291
|
+
trackedFieldDepthOnCacheMergeConflict = trackedFieldDepthOnCacheMergeConflictParam;
|
|
292
|
+
},
|
|
293
|
+
getTrackedFieldDepthOnCacheMergeConflict: function () {
|
|
294
|
+
return trackedFieldDepthOnCacheMergeConflict;
|
|
295
|
+
},
|
|
296
|
+
setTrackedFieldDepthOnNotifyChange: function (trackedFieldDepthOnNotifyChangeParam) {
|
|
297
|
+
trackedFieldDepthOnNotifyChange = trackedFieldDepthOnNotifyChangeParam;
|
|
298
|
+
},
|
|
299
|
+
getTrackedFieldDepthOnNotifyChange: function () {
|
|
300
|
+
return trackedFieldDepthOnNotifyChange;
|
|
301
|
+
},
|
|
302
|
+
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
303
|
+
trackedFieldLeafNodeIdAndNameOnly = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
304
|
+
},
|
|
305
|
+
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
306
|
+
return trackedFieldLeafNodeIdAndNameOnly;
|
|
307
|
+
},
|
|
308
|
+
setRelatedListsPredictionsEnabled: function (f) {
|
|
309
|
+
relatedListsPredictionsEnabled = f;
|
|
310
|
+
},
|
|
311
|
+
areRelatedListsPredictionsEnabled: function () {
|
|
312
|
+
return relatedListsPredictionsEnabled === true;
|
|
313
|
+
},
|
|
314
|
+
// createRecord
|
|
315
|
+
getDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter.getAdapter,
|
|
316
|
+
setDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter.setAdapter,
|
|
317
|
+
// updateRecord
|
|
318
|
+
getDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter.getAdapter,
|
|
319
|
+
setDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter.setAdapter,
|
|
320
|
+
// deleteRecord
|
|
321
|
+
getDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter.getAdapter,
|
|
322
|
+
setDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter.setAdapter,
|
|
323
|
+
// performQuickAction
|
|
324
|
+
getDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter.getAdapter,
|
|
325
|
+
setDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter.setAdapter,
|
|
326
|
+
// performRecordUpdateQuickAction
|
|
327
|
+
getDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter.getAdapter,
|
|
328
|
+
setDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter.setAdapter,
|
|
329
|
+
// createContentDocumentAndVersion
|
|
330
|
+
getDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion.getAdapter,
|
|
331
|
+
setDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion.setAdapter,
|
|
332
|
+
// createContentVersion
|
|
333
|
+
getDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion.getAdapter,
|
|
334
|
+
setDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion.setAdapter,
|
|
335
|
+
...configurationForOneStoreEnabledAdapters,
|
|
336
|
+
...configurationForEnvironmentFactoryOverrides,
|
|
337
|
+
});
|
|
338
|
+
let configurableGraphQLAdapter = new Configurable();
|
|
339
|
+
let configurableGraphQLBatchAdapter = new Configurable();
|
|
340
|
+
/**
|
|
341
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
342
|
+
* Configuration for GraphQL adapters only.
|
|
343
|
+
*/
|
|
344
|
+
({
|
|
345
|
+
getDraftAwareGraphQLAdapter: configurableGraphQLAdapter.getAdapter,
|
|
346
|
+
setDraftAwareGraphQLAdapter: configurableGraphQLAdapter.setAdapter,
|
|
347
|
+
getEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter.getAdapter,
|
|
348
|
+
setEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter.setAdapter,
|
|
349
|
+
});
|
|
350
|
+
|
|
154
351
|
ObjectCreate(null);
|
|
155
352
|
|
|
156
353
|
ObjectCreate(null);
|