@salesforce/lds-adapters-uiapi-lex 1.297.0 → 1.299.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/package.json +1 -1
- package/sfdc/ldsAdaptersUiapiLex.js +115 -58
package/package.json
CHANGED
@@ -12,9 +12,9 @@
|
|
12
12
|
* *******************************************************************************************
|
13
13
|
*/
|
14
14
|
/* proxy-compat-disable */
|
15
|
-
import { convertAuraResponseToData, TypeRegistryCachePolicyCommand, CachePolicyCommand
|
16
|
-
import { CommandWireAdapterConstructor } from 'force/
|
17
|
-
import {
|
15
|
+
import { convertAuraResponseToData, TypeRegistryCachePolicyCommand, CachePolicyCommand } from 'force/luvioRuntime4';
|
16
|
+
import { CommandWireAdapterConstructor } from 'force/luvioLwcBindings4';
|
17
|
+
import { serviceBroker } from 'force/luvioServiceBroker4';
|
18
18
|
|
19
19
|
/**
|
20
20
|
* Copyright (c) 2022, Salesforce, Inc.,
|
@@ -23,6 +23,34 @@ import { register } from 'force/luvioRegistry';
|
|
23
23
|
*/
|
24
24
|
|
25
25
|
|
26
|
+
/**
|
27
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
28
|
+
* All rights reserved.
|
29
|
+
* For full license text, see the LICENSE.txt file
|
30
|
+
*/
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Converts an arbitrary value to an Error.
|
34
|
+
*
|
35
|
+
* @param x anything
|
36
|
+
* @returns Error corresponding to x
|
37
|
+
*/
|
38
|
+
function toError(x) {
|
39
|
+
if (x instanceof Error) {
|
40
|
+
return x;
|
41
|
+
}
|
42
|
+
return new Error(`${x}`);
|
43
|
+
}
|
44
|
+
|
45
|
+
// an error to indicate that the data inside a WithErrors construct
|
46
|
+
// is missing or incomplete
|
47
|
+
class DataNotFoundError extends Error {
|
48
|
+
constructor(message) {
|
49
|
+
super(message);
|
50
|
+
this.name = 'DataNotFoundError';
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
26
54
|
/**
|
27
55
|
* Copyright (c) 2022, Salesforce, Inc.,
|
28
56
|
* All rights reserved.
|
@@ -61,6 +89,10 @@ const objectInfoType = {
|
|
61
89
|
}
|
62
90
|
store.set(key, data);
|
63
91
|
},
|
92
|
+
delete: function (key, services) {
|
93
|
+
services.store.delete(key);
|
94
|
+
services.metadataRepository.delete(key);
|
95
|
+
},
|
64
96
|
};
|
65
97
|
function dedupe(value) {
|
66
98
|
if (value === undefined) {
|
@@ -73,21 +105,21 @@ function dedupe(value) {
|
|
73
105
|
return Object.keys(result);
|
74
106
|
}
|
75
107
|
|
108
|
+
const GET_OBJECT_INFO_CONFIG_SCHEMA = {
|
109
|
+
type: 'object',
|
110
|
+
properties: {
|
111
|
+
objectApiName: {
|
112
|
+
type: 'string',
|
113
|
+
},
|
114
|
+
},
|
115
|
+
required: ['objectApiName'],
|
116
|
+
additionalProperties: false,
|
117
|
+
};
|
76
118
|
class GetObjectInfoCommand extends TypeRegistryCachePolicyCommand {
|
77
119
|
constructor() {
|
78
120
|
super(...arguments);
|
79
121
|
this.returnTypeNamespace = objectInfoType.namespace;
|
80
122
|
this.returnTypeName = objectInfoType.typeName;
|
81
|
-
this.configJsonSchema = {
|
82
|
-
type: 'object',
|
83
|
-
properties: {
|
84
|
-
objectApiName: {
|
85
|
-
type: 'string',
|
86
|
-
},
|
87
|
-
},
|
88
|
-
required: ['objectApiName'],
|
89
|
-
additionalProperties: false,
|
90
|
-
};
|
91
123
|
}
|
92
124
|
buildKeyConfigFromInstance(instance) {
|
93
125
|
return {
|
@@ -235,24 +267,23 @@ class UiApiCompositeCachingCommand extends CachePolicyCommand {
|
|
235
267
|
}
|
236
268
|
}
|
237
269
|
|
270
|
+
const GET_OBJECT_INFOS_CONFIG_SCHEMA = {
|
271
|
+
type: 'object',
|
272
|
+
properties: {
|
273
|
+
objectApiNames: {
|
274
|
+
type: 'array',
|
275
|
+
items: {
|
276
|
+
type: 'string',
|
277
|
+
},
|
278
|
+
minItems: 1,
|
279
|
+
},
|
280
|
+
},
|
281
|
+
required: ['objectApiNames'],
|
282
|
+
additionalProperties: false,
|
283
|
+
};
|
238
284
|
class GetObjectInfosCommand extends UiApiCompositeCachingCommand {
|
239
285
|
constructor(config, commandContext, services) {
|
240
|
-
|
241
|
-
super(coercedConfig, commandContext, services);
|
242
|
-
this.configJsonSchema = {
|
243
|
-
type: 'object',
|
244
|
-
properties: {
|
245
|
-
objectApiNames: {
|
246
|
-
type: 'array',
|
247
|
-
items: {
|
248
|
-
type: 'string',
|
249
|
-
},
|
250
|
-
minItems: 1,
|
251
|
-
},
|
252
|
-
},
|
253
|
-
required: ['objectApiNames'],
|
254
|
-
additionalProperties: false,
|
255
|
-
};
|
286
|
+
super({ objectApiNames: dedupe(config.objectApiNames) }, commandContext, services);
|
256
287
|
this.compositeTypeNamespace = UiApiNamespace;
|
257
288
|
this.compositeTypeName = ObjectInfoRepresentationName;
|
258
289
|
}
|
@@ -271,37 +302,63 @@ class GetObjectInfosCommandAura extends GetObjectInfosCommand {
|
|
271
302
|
}
|
272
303
|
}
|
273
304
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
keySubscription: '1.0.0',
|
281
|
-
typeRegistry: '1.0.0',
|
282
|
-
cacheInclusionPolicy: '1.0.0',
|
283
|
-
cachePolicy: '1.0.0',
|
284
|
-
auraNetwork: '1.0.0',
|
305
|
+
let getObjectInfo;
|
306
|
+
let getObjectInfos;
|
307
|
+
const serviceRequests = {
|
308
|
+
metadataRepository: {
|
309
|
+
type: 'metadataRepository',
|
310
|
+
version: '1.0',
|
285
311
|
},
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
312
|
+
store: {
|
313
|
+
type: 'store',
|
314
|
+
version: '1.0',
|
315
|
+
},
|
316
|
+
keySubscription: {
|
317
|
+
type: 'keySubscription',
|
318
|
+
version: '1.0',
|
319
|
+
},
|
320
|
+
typeRegistry: {
|
321
|
+
type: 'typeRegistry',
|
322
|
+
version: '1.0',
|
323
|
+
},
|
324
|
+
cacheInclusionPolicy: {
|
325
|
+
type: 'cacheInclusionPolicy',
|
326
|
+
version: '1.0',
|
327
|
+
},
|
328
|
+
cachePolicy: {
|
329
|
+
type: 'cachePolicy',
|
330
|
+
version: '1.0',
|
331
|
+
},
|
332
|
+
auraNetwork: {
|
333
|
+
type: 'auraNetwork',
|
334
|
+
version: '1.0',
|
335
|
+
},
|
336
|
+
requestDedupe: {
|
337
|
+
type: 'requestDedupe',
|
338
|
+
version: '1.0',
|
300
339
|
},
|
301
340
|
};
|
302
|
-
|
303
|
-
|
304
|
-
|
341
|
+
serviceBroker.subscribe((services) => {
|
342
|
+
services.typeRegistry.register(objectInfoType);
|
343
|
+
getObjectInfo = class extends CommandWireAdapterConstructor {
|
344
|
+
constructor() {
|
345
|
+
super(...arguments);
|
346
|
+
this.configSchema = GET_OBJECT_INFO_CONFIG_SCHEMA;
|
347
|
+
}
|
348
|
+
getCommand() {
|
349
|
+
return new GetObjectInfoCommandAura(this.config, {}, services);
|
350
|
+
}
|
351
|
+
};
|
352
|
+
getObjectInfos = class extends CommandWireAdapterConstructor {
|
353
|
+
constructor() {
|
354
|
+
super(...arguments);
|
355
|
+
this.configSchema = GET_OBJECT_INFOS_CONFIG_SCHEMA;
|
356
|
+
}
|
357
|
+
getCommand() {
|
358
|
+
return new GetObjectInfosCommandAura(this.config, {}, services);
|
359
|
+
}
|
360
|
+
};
|
361
|
+
}, serviceRequests);
|
305
362
|
|
306
363
|
export { getObjectInfo, getObjectInfos };
|
307
|
-
// version: 1.
|
364
|
+
// version: 1.299.0-83936bf1de
|