@salesforce/lds-adapters-platform-sharing 1.343.0 → 1.345.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/platform-sharing.js +374 -59
- package/dist/es/es2018/types/src/generated/adapters/addRemoveUserToGroups.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getGroupsForUser.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -1
- package/dist/es/es2018/types/src/generated/resources/getSharingGroupsForUserByGroupTypeAndUserId.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/resources/postSharingAddRemoveUserToGroups.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/PublicGroupRepresentation.d.ts +10 -1
- package/dist/es/es2018/types/src/generated/types/UserGroupMembershipDetailsInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/UserGroupMembershipDetailsRepresentation.d.ts +38 -0
- package/package.json +3 -3
- package/sfdc/index.js +347 -20
- package/src/raml/api.raml +71 -0
- package/src/raml/luvio.raml +13 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6, typeCheckConfig as typeCheckConfig$6, StoreKeyMap, createResourceParams as createResourceParams$6 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -91,12 +91,27 @@ function createLink(ref) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const VERSION$
|
|
95
|
-
function validate$
|
|
94
|
+
const VERSION$i = "0769937b310d74bd11d5782eebfc254a";
|
|
95
|
+
function validate$i(obj, path = 'PublicGroupRepresentation') {
|
|
96
96
|
const v_error = (() => {
|
|
97
97
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
98
98
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
99
99
|
}
|
|
100
|
+
const obj_createdById = obj.createdById;
|
|
101
|
+
const path_createdById = path + '.createdById';
|
|
102
|
+
if (typeof obj_createdById !== 'string') {
|
|
103
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
104
|
+
}
|
|
105
|
+
const obj_createdByName = obj.createdByName;
|
|
106
|
+
const path_createdByName = path + '.createdByName';
|
|
107
|
+
if (typeof obj_createdByName !== 'string') {
|
|
108
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdByName + '" (at "' + path_createdByName + '")');
|
|
109
|
+
}
|
|
110
|
+
const obj_createdDate = obj.createdDate;
|
|
111
|
+
const path_createdDate = path + '.createdDate';
|
|
112
|
+
if (typeof obj_createdDate !== 'string') {
|
|
113
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
114
|
+
}
|
|
100
115
|
const obj_developerName = obj.developerName;
|
|
101
116
|
const path_developerName = path + '.developerName';
|
|
102
117
|
if (typeof obj_developerName !== 'string') {
|
|
@@ -120,12 +135,24 @@ function validate$h(obj, path = 'PublicGroupRepresentation') {
|
|
|
120
135
|
})();
|
|
121
136
|
return v_error === undefined ? null : v_error;
|
|
122
137
|
}
|
|
123
|
-
const select$
|
|
138
|
+
const select$o = function PublicGroupRepresentationSelect() {
|
|
124
139
|
return {
|
|
125
140
|
kind: 'Fragment',
|
|
126
|
-
version: VERSION$
|
|
141
|
+
version: VERSION$i,
|
|
127
142
|
private: [],
|
|
128
143
|
selections: [
|
|
144
|
+
{
|
|
145
|
+
name: 'createdById',
|
|
146
|
+
kind: 'Scalar'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'createdByName',
|
|
150
|
+
kind: 'Scalar'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'createdDate',
|
|
154
|
+
kind: 'Scalar'
|
|
155
|
+
},
|
|
129
156
|
{
|
|
130
157
|
name: 'developerName',
|
|
131
158
|
kind: 'Scalar'
|
|
@@ -145,12 +172,27 @@ const select$m = function PublicGroupRepresentationSelect() {
|
|
|
145
172
|
]
|
|
146
173
|
};
|
|
147
174
|
};
|
|
148
|
-
function equals$
|
|
175
|
+
function equals$i(existing, incoming) {
|
|
149
176
|
const existing_includeBosses = existing.includeBosses;
|
|
150
177
|
const incoming_includeBosses = incoming.includeBosses;
|
|
151
178
|
if (!(existing_includeBosses === incoming_includeBosses)) {
|
|
152
179
|
return false;
|
|
153
180
|
}
|
|
181
|
+
const existing_createdById = existing.createdById;
|
|
182
|
+
const incoming_createdById = incoming.createdById;
|
|
183
|
+
if (!(existing_createdById === incoming_createdById)) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
const existing_createdByName = existing.createdByName;
|
|
187
|
+
const incoming_createdByName = incoming.createdByName;
|
|
188
|
+
if (!(existing_createdByName === incoming_createdByName)) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
const existing_createdDate = existing.createdDate;
|
|
192
|
+
const incoming_createdDate = incoming.createdDate;
|
|
193
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
154
196
|
const existing_developerName = existing.developerName;
|
|
155
197
|
const incoming_developerName = incoming.developerName;
|
|
156
198
|
if (!(existing_developerName === incoming_developerName)) {
|
|
@@ -169,8 +211,8 @@ function equals$h(existing, incoming) {
|
|
|
169
211
|
return true;
|
|
170
212
|
}
|
|
171
213
|
|
|
172
|
-
const VERSION$
|
|
173
|
-
function validate$
|
|
214
|
+
const VERSION$h = "89ae3fce0ad09282e80bd77a9c483003";
|
|
215
|
+
function validate$h(obj, path = 'QueueRepresentation') {
|
|
174
216
|
const v_error = (() => {
|
|
175
217
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
176
218
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -193,10 +235,10 @@ function validate$g(obj, path = 'QueueRepresentation') {
|
|
|
193
235
|
})();
|
|
194
236
|
return v_error === undefined ? null : v_error;
|
|
195
237
|
}
|
|
196
|
-
const select$
|
|
238
|
+
const select$n = function QueueRepresentationSelect() {
|
|
197
239
|
return {
|
|
198
240
|
kind: 'Fragment',
|
|
199
|
-
version: VERSION$
|
|
241
|
+
version: VERSION$h,
|
|
200
242
|
private: [],
|
|
201
243
|
selections: [
|
|
202
244
|
{
|
|
@@ -214,7 +256,7 @@ const select$l = function QueueRepresentationSelect() {
|
|
|
214
256
|
]
|
|
215
257
|
};
|
|
216
258
|
};
|
|
217
|
-
function equals$
|
|
259
|
+
function equals$h(existing, incoming) {
|
|
218
260
|
const existing_developerName = existing.developerName;
|
|
219
261
|
const incoming_developerName = incoming.developerName;
|
|
220
262
|
if (!(existing_developerName === incoming_developerName)) {
|
|
@@ -233,9 +275,9 @@ function equals$g(existing, incoming) {
|
|
|
233
275
|
return true;
|
|
234
276
|
}
|
|
235
277
|
|
|
236
|
-
const TTL$
|
|
237
|
-
const VERSION$
|
|
238
|
-
function validate$
|
|
278
|
+
const TTL$5 = 300;
|
|
279
|
+
const VERSION$g = "3659c4a4f46957a3a2b5cb2d2383180d";
|
|
280
|
+
function validate$g(obj, path = 'GroupCollectionRepresentation') {
|
|
239
281
|
const v_error = (() => {
|
|
240
282
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
241
283
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -248,7 +290,7 @@ function validate$f(obj, path = 'GroupCollectionRepresentation') {
|
|
|
248
290
|
for (let i = 0; i < obj_publicGroupRepresentations.length; i++) {
|
|
249
291
|
const obj_publicGroupRepresentations_item = obj_publicGroupRepresentations[i];
|
|
250
292
|
const path_publicGroupRepresentations_item = path_publicGroupRepresentations + '[' + i + ']';
|
|
251
|
-
const referencepath_publicGroupRepresentations_itemValidationError = validate$
|
|
293
|
+
const referencepath_publicGroupRepresentations_itemValidationError = validate$i(obj_publicGroupRepresentations_item, path_publicGroupRepresentations_item);
|
|
252
294
|
if (referencepath_publicGroupRepresentations_itemValidationError !== null) {
|
|
253
295
|
let message = 'Object doesn\'t match PublicGroupRepresentation (at "' + path_publicGroupRepresentations_item + '")\n';
|
|
254
296
|
message += referencepath_publicGroupRepresentations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -263,7 +305,7 @@ function validate$f(obj, path = 'GroupCollectionRepresentation') {
|
|
|
263
305
|
for (let i = 0; i < obj_queueRepresentations.length; i++) {
|
|
264
306
|
const obj_queueRepresentations_item = obj_queueRepresentations[i];
|
|
265
307
|
const path_queueRepresentations_item = path_queueRepresentations + '[' + i + ']';
|
|
266
|
-
const referencepath_queueRepresentations_itemValidationError = validate$
|
|
308
|
+
const referencepath_queueRepresentations_itemValidationError = validate$h(obj_queueRepresentations_item, path_queueRepresentations_item);
|
|
267
309
|
if (referencepath_queueRepresentations_itemValidationError !== null) {
|
|
268
310
|
let message = 'Object doesn\'t match QueueRepresentation (at "' + path_queueRepresentations_item + '")\n';
|
|
269
311
|
message += referencepath_queueRepresentations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -273,16 +315,16 @@ function validate$f(obj, path = 'GroupCollectionRepresentation') {
|
|
|
273
315
|
})();
|
|
274
316
|
return v_error === undefined ? null : v_error;
|
|
275
317
|
}
|
|
276
|
-
const RepresentationType$
|
|
277
|
-
function normalize$
|
|
318
|
+
const RepresentationType$5 = 'GroupCollectionRepresentation';
|
|
319
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
278
320
|
return input;
|
|
279
321
|
}
|
|
280
|
-
const select$
|
|
281
|
-
const { selections: PublicGroupRepresentation__selections, opaque: PublicGroupRepresentation__opaque, } = select$
|
|
282
|
-
const { selections: QueueRepresentation__selections, opaque: QueueRepresentation__opaque, } = select$
|
|
322
|
+
const select$m = function GroupCollectionRepresentationSelect() {
|
|
323
|
+
const { selections: PublicGroupRepresentation__selections, opaque: PublicGroupRepresentation__opaque, } = select$o();
|
|
324
|
+
const { selections: QueueRepresentation__selections, opaque: QueueRepresentation__opaque, } = select$n();
|
|
283
325
|
return {
|
|
284
326
|
kind: 'Fragment',
|
|
285
|
-
version: VERSION$
|
|
327
|
+
version: VERSION$g,
|
|
286
328
|
private: [],
|
|
287
329
|
selections: [
|
|
288
330
|
{
|
|
@@ -300,11 +342,11 @@ const select$k = function GroupCollectionRepresentationSelect() {
|
|
|
300
342
|
]
|
|
301
343
|
};
|
|
302
344
|
};
|
|
303
|
-
function equals$
|
|
345
|
+
function equals$g(existing, incoming) {
|
|
304
346
|
const existing_publicGroupRepresentations = existing.publicGroupRepresentations;
|
|
305
347
|
const incoming_publicGroupRepresentations = incoming.publicGroupRepresentations;
|
|
306
348
|
const equals_publicGroupRepresentations_items = equalsArray(existing_publicGroupRepresentations, incoming_publicGroupRepresentations, (existing_publicGroupRepresentations_item, incoming_publicGroupRepresentations_item) => {
|
|
307
|
-
if (!(equals$
|
|
349
|
+
if (!(equals$i(existing_publicGroupRepresentations_item, incoming_publicGroupRepresentations_item))) {
|
|
308
350
|
return false;
|
|
309
351
|
}
|
|
310
352
|
});
|
|
@@ -314,7 +356,7 @@ function equals$f(existing, incoming) {
|
|
|
314
356
|
const existing_queueRepresentations = existing.queueRepresentations;
|
|
315
357
|
const incoming_queueRepresentations = incoming.queueRepresentations;
|
|
316
358
|
const equals_queueRepresentations_items = equalsArray(existing_queueRepresentations, incoming_queueRepresentations, (existing_queueRepresentations_item, incoming_queueRepresentations_item) => {
|
|
317
|
-
if (!(equals$
|
|
359
|
+
if (!(equals$h(existing_queueRepresentations_item, incoming_queueRepresentations_item))) {
|
|
318
360
|
return false;
|
|
319
361
|
}
|
|
320
362
|
});
|
|
@@ -323,7 +365,282 @@ function equals$f(existing, incoming) {
|
|
|
323
365
|
}
|
|
324
366
|
return true;
|
|
325
367
|
}
|
|
326
|
-
const ingest$
|
|
368
|
+
const ingest$5 = function GroupCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
369
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
370
|
+
const validateError = validate$g(input);
|
|
371
|
+
if (validateError !== null) {
|
|
372
|
+
throw validateError;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const key = path.fullPath;
|
|
376
|
+
const ttlToUse = TTL$5;
|
|
377
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "sharing", VERSION$g, RepresentationType$5, equals$g);
|
|
378
|
+
return createLink(key);
|
|
379
|
+
};
|
|
380
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
381
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
382
|
+
const rootKey = fullPathFactory();
|
|
383
|
+
rootKeySet.set(rootKey, {
|
|
384
|
+
namespace: keyPrefix,
|
|
385
|
+
representationName: RepresentationType$5,
|
|
386
|
+
mergeable: false
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function select$l(luvio, params) {
|
|
391
|
+
return select$m();
|
|
392
|
+
}
|
|
393
|
+
function keyBuilder$b(luvio, params) {
|
|
394
|
+
return keyPrefix + '::GroupCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'sortBy:' + params.queryParams.sortBy + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'groupMembership:' + params.queryParams.groupMembership + ',' + 'searchTerm:' + params.queryParams.searchTerm + ',' + 'groupType:' + params.urlParams.groupType + ',' + 'userId:' + params.urlParams.userId + ')';
|
|
395
|
+
}
|
|
396
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
397
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
|
|
398
|
+
}
|
|
399
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
400
|
+
const { body } = response;
|
|
401
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
402
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
403
|
+
const snapshot = luvio.storeLookup({
|
|
404
|
+
recordId: key,
|
|
405
|
+
node: select$l(),
|
|
406
|
+
variables: {},
|
|
407
|
+
}, snapshotRefresh);
|
|
408
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
409
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
410
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
deepFreeze(snapshot.data);
|
|
414
|
+
return snapshot;
|
|
415
|
+
}
|
|
416
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
417
|
+
const key = keyBuilder$b(luvio, params);
|
|
418
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
419
|
+
const storeMetadataParams = {
|
|
420
|
+
ttl: TTL$5,
|
|
421
|
+
namespace: keyPrefix,
|
|
422
|
+
version: VERSION$g,
|
|
423
|
+
representationName: RepresentationType$5
|
|
424
|
+
};
|
|
425
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
426
|
+
return errorSnapshot;
|
|
427
|
+
}
|
|
428
|
+
function createResourceRequest$5(config) {
|
|
429
|
+
const headers = {};
|
|
430
|
+
return {
|
|
431
|
+
baseUri: '/services/data/v64.0',
|
|
432
|
+
basePath: '/sharing/groups-for-user/' + config.urlParams.userId + '/' + config.urlParams.groupType + '',
|
|
433
|
+
method: 'get',
|
|
434
|
+
body: null,
|
|
435
|
+
urlParams: config.urlParams,
|
|
436
|
+
queryParams: config.queryParams,
|
|
437
|
+
headers,
|
|
438
|
+
priority: 'normal',
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const adapterName$5 = 'getGroupsForUser';
|
|
443
|
+
const getGroupsForUser_ConfigPropertyMetadata = [
|
|
444
|
+
generateParamConfigMetadata('groupType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
445
|
+
generateParamConfigMetadata('userId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
446
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
447
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
448
|
+
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
449
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
450
|
+
generateParamConfigMetadata('groupMembership', false, 1 /* QueryParameter */, 0 /* String */),
|
|
451
|
+
generateParamConfigMetadata('searchTerm', false, 1 /* QueryParameter */, 0 /* String */),
|
|
452
|
+
];
|
|
453
|
+
const getGroupsForUser_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getGroupsForUser_ConfigPropertyMetadata);
|
|
454
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$6(getGroupsForUser_ConfigPropertyMetadata);
|
|
455
|
+
function keyBuilder$a(luvio, config) {
|
|
456
|
+
const resourceParams = createResourceParams$5(config);
|
|
457
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
458
|
+
}
|
|
459
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
460
|
+
const config = {};
|
|
461
|
+
typeCheckConfig$6(untrustedConfig, config, getGroupsForUser_ConfigPropertyMetadata);
|
|
462
|
+
return config;
|
|
463
|
+
}
|
|
464
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
465
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
469
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
470
|
+
}
|
|
471
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
472
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
475
|
+
return config;
|
|
476
|
+
}
|
|
477
|
+
function adapterFragment$5(luvio, config) {
|
|
478
|
+
createResourceParams$5(config);
|
|
479
|
+
return select$l();
|
|
480
|
+
}
|
|
481
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
482
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
483
|
+
config,
|
|
484
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
485
|
+
});
|
|
486
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
487
|
+
}
|
|
488
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
489
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
490
|
+
config,
|
|
491
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
492
|
+
});
|
|
493
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
494
|
+
}
|
|
495
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
496
|
+
const resourceParams = createResourceParams$5(config);
|
|
497
|
+
const request = createResourceRequest$5(resourceParams);
|
|
498
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
499
|
+
.then((response) => {
|
|
500
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
501
|
+
const cache = new StoreKeyMap();
|
|
502
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
503
|
+
return cache;
|
|
504
|
+
});
|
|
505
|
+
}, (response) => {
|
|
506
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
510
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
511
|
+
}
|
|
512
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
513
|
+
const { luvio, config } = context;
|
|
514
|
+
const selector = {
|
|
515
|
+
recordId: keyBuilder$a(luvio, config),
|
|
516
|
+
node: adapterFragment$5(luvio, config),
|
|
517
|
+
variables: {},
|
|
518
|
+
};
|
|
519
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
520
|
+
config,
|
|
521
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
522
|
+
});
|
|
523
|
+
return cacheSnapshot;
|
|
524
|
+
}
|
|
525
|
+
const getGroupsForUserAdapterFactory = (luvio) => function sharing__getGroupsForUser(untrustedConfig, requestContext) {
|
|
526
|
+
const config = validateAdapterConfig$5(untrustedConfig, getGroupsForUser_ConfigPropertyNames);
|
|
527
|
+
// Invalid or incomplete config
|
|
528
|
+
if (config === null) {
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
531
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
532
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
const TTL$4 = 300;
|
|
536
|
+
const VERSION$f = "9934cf4cb3fdd0b955c08c2d695a9a53";
|
|
537
|
+
function validate$f(obj, path = 'UserGroupMembershipDetailsRepresentation') {
|
|
538
|
+
const v_error = (() => {
|
|
539
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
540
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
541
|
+
}
|
|
542
|
+
const obj_errors = obj.errors;
|
|
543
|
+
const path_errors = path + '.errors';
|
|
544
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
545
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
546
|
+
}
|
|
547
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
548
|
+
const obj_errors_item = obj_errors[i];
|
|
549
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
550
|
+
if (typeof obj_errors_item !== 'string') {
|
|
551
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errors_item + '" (at "' + path_errors_item + '")');
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
const obj_infos = obj.infos;
|
|
555
|
+
const path_infos = path + '.infos';
|
|
556
|
+
if (!ArrayIsArray(obj_infos)) {
|
|
557
|
+
return new TypeError('Expected "array" but received "' + typeof obj_infos + '" (at "' + path_infos + '")');
|
|
558
|
+
}
|
|
559
|
+
for (let i = 0; i < obj_infos.length; i++) {
|
|
560
|
+
const obj_infos_item = obj_infos[i];
|
|
561
|
+
const path_infos_item = path_infos + '[' + i + ']';
|
|
562
|
+
if (typeof obj_infos_item !== 'string') {
|
|
563
|
+
return new TypeError('Expected "string" but received "' + typeof obj_infos_item + '" (at "' + path_infos_item + '")');
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
const obj_isSuccess = obj.isSuccess;
|
|
567
|
+
const path_isSuccess = path + '.isSuccess';
|
|
568
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
569
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
570
|
+
}
|
|
571
|
+
const obj_operation = obj.operation;
|
|
572
|
+
const path_operation = path + '.operation';
|
|
573
|
+
if (typeof obj_operation !== 'string') {
|
|
574
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operation + '" (at "' + path_operation + '")');
|
|
575
|
+
}
|
|
576
|
+
})();
|
|
577
|
+
return v_error === undefined ? null : v_error;
|
|
578
|
+
}
|
|
579
|
+
const RepresentationType$4 = 'UserGroupMembershipDetailsRepresentation';
|
|
580
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
581
|
+
return input;
|
|
582
|
+
}
|
|
583
|
+
const select$k = function UserGroupMembershipDetailsRepresentationSelect() {
|
|
584
|
+
return {
|
|
585
|
+
kind: 'Fragment',
|
|
586
|
+
version: VERSION$f,
|
|
587
|
+
private: [],
|
|
588
|
+
selections: [
|
|
589
|
+
{
|
|
590
|
+
name: 'errors',
|
|
591
|
+
kind: 'Scalar',
|
|
592
|
+
plural: true
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: 'infos',
|
|
596
|
+
kind: 'Scalar',
|
|
597
|
+
plural: true
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: 'isSuccess',
|
|
601
|
+
kind: 'Scalar'
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: 'operation',
|
|
605
|
+
kind: 'Scalar'
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
};
|
|
609
|
+
};
|
|
610
|
+
function equals$f(existing, incoming) {
|
|
611
|
+
const existing_isSuccess = existing.isSuccess;
|
|
612
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
613
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
614
|
+
return false;
|
|
615
|
+
}
|
|
616
|
+
const existing_operation = existing.operation;
|
|
617
|
+
const incoming_operation = incoming.operation;
|
|
618
|
+
if (!(existing_operation === incoming_operation)) {
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
const existing_errors = existing.errors;
|
|
622
|
+
const incoming_errors = incoming.errors;
|
|
623
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
624
|
+
if (!(existing_errors_item === incoming_errors_item)) {
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
if (equals_errors_items === false) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
const existing_infos = existing.infos;
|
|
632
|
+
const incoming_infos = incoming.infos;
|
|
633
|
+
const equals_infos_items = equalsArray(existing_infos, incoming_infos, (existing_infos_item, incoming_infos_item) => {
|
|
634
|
+
if (!(existing_infos_item === incoming_infos_item)) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
if (equals_infos_items === false) {
|
|
639
|
+
return false;
|
|
640
|
+
}
|
|
641
|
+
return true;
|
|
642
|
+
}
|
|
643
|
+
const ingest$4 = function UserGroupMembershipDetailsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
327
644
|
if (process.env.NODE_ENV !== 'production') {
|
|
328
645
|
const validateError = validate$f(input);
|
|
329
646
|
if (validateError !== null) {
|
|
@@ -349,7 +666,7 @@ function select$j(luvio, params) {
|
|
|
349
666
|
return select$k();
|
|
350
667
|
}
|
|
351
668
|
function keyBuilder$9(luvio, params) {
|
|
352
|
-
return keyPrefix + '::
|
|
669
|
+
return keyPrefix + '::UserGroupMembershipDetailsRepresentation:(' + 'userId:' + params.body.userId + '::' + 'memberType:' + params.body.memberType + '::' + 'operation:' + params.body.operation + '::' + 'selectedGroups:' + params.body.selectedGroups + ')';
|
|
353
670
|
}
|
|
354
671
|
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
355
672
|
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
@@ -387,34 +704,32 @@ function createResourceRequest$4(config) {
|
|
|
387
704
|
const headers = {};
|
|
388
705
|
return {
|
|
389
706
|
baseUri: '/services/data/v64.0',
|
|
390
|
-
basePath: '/sharing/
|
|
391
|
-
method: '
|
|
392
|
-
body:
|
|
393
|
-
urlParams:
|
|
394
|
-
queryParams:
|
|
707
|
+
basePath: '/sharing/addRemoveUserToGroups',
|
|
708
|
+
method: 'post',
|
|
709
|
+
body: config.body,
|
|
710
|
+
urlParams: {},
|
|
711
|
+
queryParams: {},
|
|
395
712
|
headers,
|
|
396
713
|
priority: 'normal',
|
|
397
714
|
};
|
|
398
715
|
}
|
|
399
716
|
|
|
400
|
-
const adapterName$4 = '
|
|
401
|
-
const
|
|
402
|
-
generateParamConfigMetadata('
|
|
403
|
-
generateParamConfigMetadata('
|
|
404
|
-
generateParamConfigMetadata('
|
|
405
|
-
generateParamConfigMetadata('
|
|
406
|
-
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
407
|
-
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
717
|
+
const adapterName$4 = 'addRemoveUserToGroups';
|
|
718
|
+
const addRemoveUserToGroups_ConfigPropertyMetadata = [
|
|
719
|
+
generateParamConfigMetadata('userId', true, 2 /* Body */, 0 /* String */),
|
|
720
|
+
generateParamConfigMetadata('memberType', true, 2 /* Body */, 0 /* String */),
|
|
721
|
+
generateParamConfigMetadata('operation', true, 2 /* Body */, 0 /* String */),
|
|
722
|
+
generateParamConfigMetadata('selectedGroups', true, 2 /* Body */, 0 /* String */, true),
|
|
408
723
|
];
|
|
409
|
-
const
|
|
410
|
-
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$
|
|
724
|
+
const addRemoveUserToGroups_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, addRemoveUserToGroups_ConfigPropertyMetadata);
|
|
725
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$6(addRemoveUserToGroups_ConfigPropertyMetadata);
|
|
411
726
|
function keyBuilder$8(luvio, config) {
|
|
412
727
|
const resourceParams = createResourceParams$4(config);
|
|
413
728
|
return keyBuilder$9(luvio, resourceParams);
|
|
414
729
|
}
|
|
415
730
|
function typeCheckConfig$4(untrustedConfig) {
|
|
416
731
|
const config = {};
|
|
417
|
-
typeCheckConfig$
|
|
732
|
+
typeCheckConfig$6(untrustedConfig, config, addRemoveUserToGroups_ConfigPropertyMetadata);
|
|
418
733
|
return config;
|
|
419
734
|
}
|
|
420
735
|
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
@@ -463,7 +778,7 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
463
778
|
});
|
|
464
779
|
}
|
|
465
780
|
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
466
|
-
return buildNetworkSnapshotCachePolicy$
|
|
781
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, 'get', false);
|
|
467
782
|
}
|
|
468
783
|
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
469
784
|
const { luvio, config } = context;
|
|
@@ -478,8 +793,8 @@ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
|
478
793
|
});
|
|
479
794
|
return cacheSnapshot;
|
|
480
795
|
}
|
|
481
|
-
const
|
|
482
|
-
const config = validateAdapterConfig$4(untrustedConfig,
|
|
796
|
+
const addRemoveUserToGroupsAdapterFactory = (luvio) => function sharing__addRemoveUserToGroups(untrustedConfig, requestContext) {
|
|
797
|
+
const config = validateAdapterConfig$4(untrustedConfig, addRemoveUserToGroups_ConfigPropertyNames);
|
|
483
798
|
// Invalid or incomplete config
|
|
484
799
|
if (config === null) {
|
|
485
800
|
return null;
|
|
@@ -1208,14 +1523,14 @@ const getPublicGroupMembershipDetails_ConfigPropertyMetadata = [
|
|
|
1208
1523
|
generateParamConfigMetadata('selectedMembers', true, 2 /* Body */, 0 /* String */, true),
|
|
1209
1524
|
];
|
|
1210
1525
|
const getPublicGroupMembershipDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getPublicGroupMembershipDetails_ConfigPropertyMetadata);
|
|
1211
|
-
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$
|
|
1526
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$6(getPublicGroupMembershipDetails_ConfigPropertyMetadata);
|
|
1212
1527
|
function keyBuilder$6(luvio, config) {
|
|
1213
1528
|
const resourceParams = createResourceParams$3(config);
|
|
1214
1529
|
return keyBuilder$7(luvio, resourceParams);
|
|
1215
1530
|
}
|
|
1216
1531
|
function typeCheckConfig$3(untrustedConfig) {
|
|
1217
1532
|
const config = {};
|
|
1218
|
-
typeCheckConfig$
|
|
1533
|
+
typeCheckConfig$6(untrustedConfig, config, getPublicGroupMembershipDetails_ConfigPropertyMetadata);
|
|
1219
1534
|
const untrustedConfig_filterCriteria = untrustedConfig.filterCriteria;
|
|
1220
1535
|
config.filterCriteria = untrustedConfig_filterCriteria;
|
|
1221
1536
|
return config;
|
|
@@ -1266,7 +1581,7 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
1266
1581
|
});
|
|
1267
1582
|
}
|
|
1268
1583
|
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1269
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1584
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, 'get', false);
|
|
1270
1585
|
}
|
|
1271
1586
|
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1272
1587
|
const { luvio, config } = context;
|
|
@@ -2160,14 +2475,14 @@ const getPublicGroupShareData_ConfigPropertyMetadata = [
|
|
|
2160
2475
|
generateParamConfigMetadata('orderType', true, 2 /* Body */, 0 /* String */),
|
|
2161
2476
|
];
|
|
2162
2477
|
const getPublicGroupShareData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getPublicGroupShareData_ConfigPropertyMetadata);
|
|
2163
|
-
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$
|
|
2478
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$6(getPublicGroupShareData_ConfigPropertyMetadata);
|
|
2164
2479
|
function keyBuilder$4(luvio, config) {
|
|
2165
2480
|
const resourceParams = createResourceParams$2(config);
|
|
2166
2481
|
return keyBuilder$5(luvio, resourceParams);
|
|
2167
2482
|
}
|
|
2168
2483
|
function typeCheckConfig$2(untrustedConfig) {
|
|
2169
2484
|
const config = {};
|
|
2170
|
-
typeCheckConfig$
|
|
2485
|
+
typeCheckConfig$6(untrustedConfig, config, getPublicGroupShareData_ConfigPropertyMetadata);
|
|
2171
2486
|
return config;
|
|
2172
2487
|
}
|
|
2173
2488
|
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
@@ -2216,7 +2531,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
2216
2531
|
});
|
|
2217
2532
|
}
|
|
2218
2533
|
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2219
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2534
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, 'get', false);
|
|
2220
2535
|
}
|
|
2221
2536
|
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2222
2537
|
const { luvio, config } = context;
|
|
@@ -2472,14 +2787,14 @@ const getAllSobjects_ConfigPropertyMetadata = [
|
|
|
2472
2787
|
generateParamConfigMetadata('searchText', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2473
2788
|
];
|
|
2474
2789
|
const getAllSobjects_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getAllSobjects_ConfigPropertyMetadata);
|
|
2475
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$
|
|
2790
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$6(getAllSobjects_ConfigPropertyMetadata);
|
|
2476
2791
|
function keyBuilder$2(luvio, config) {
|
|
2477
2792
|
const resourceParams = createResourceParams$1(config);
|
|
2478
2793
|
return keyBuilder$3(luvio, resourceParams);
|
|
2479
2794
|
}
|
|
2480
2795
|
function typeCheckConfig$1(untrustedConfig) {
|
|
2481
2796
|
const config = {};
|
|
2482
|
-
typeCheckConfig$
|
|
2797
|
+
typeCheckConfig$6(untrustedConfig, config, getAllSobjects_ConfigPropertyMetadata);
|
|
2483
2798
|
return config;
|
|
2484
2799
|
}
|
|
2485
2800
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -2528,7 +2843,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
2528
2843
|
});
|
|
2529
2844
|
}
|
|
2530
2845
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2531
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2846
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
2532
2847
|
}
|
|
2533
2848
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2534
2849
|
const { luvio, config } = context;
|
|
@@ -2866,14 +3181,14 @@ const getUserPermissions_ConfigPropertyMetadata = [
|
|
|
2866
3181
|
generateParamConfigMetadata('recordId', true, 1 /* QueryParameter */, 0 /* String */),
|
|
2867
3182
|
];
|
|
2868
3183
|
const getUserPermissions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getUserPermissions_ConfigPropertyMetadata);
|
|
2869
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
3184
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$6(getUserPermissions_ConfigPropertyMetadata);
|
|
2870
3185
|
function keyBuilder(luvio, config) {
|
|
2871
3186
|
const resourceParams = createResourceParams(config);
|
|
2872
3187
|
return keyBuilder$1(luvio, resourceParams);
|
|
2873
3188
|
}
|
|
2874
3189
|
function typeCheckConfig(untrustedConfig) {
|
|
2875
3190
|
const config = {};
|
|
2876
|
-
typeCheckConfig$
|
|
3191
|
+
typeCheckConfig$6(untrustedConfig, config, getUserPermissions_ConfigPropertyMetadata);
|
|
2877
3192
|
return config;
|
|
2878
3193
|
}
|
|
2879
3194
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -2922,7 +3237,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
2922
3237
|
});
|
|
2923
3238
|
}
|
|
2924
3239
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2925
|
-
return buildNetworkSnapshotCachePolicy$
|
|
3240
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
2926
3241
|
}
|
|
2927
3242
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2928
3243
|
const { luvio, config } = context;
|
|
@@ -2947,4 +3262,4 @@ const getUserPermissionsAdapterFactory = (luvio) => function sharing__getUserPer
|
|
|
2947
3262
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2948
3263
|
};
|
|
2949
3264
|
|
|
2950
|
-
export { getAllSobjectsAdapterFactory, getGroupsForUserAdapterFactory, getPublicGroupMembershipDetailsAdapterFactory, getPublicGroupShareDataAdapterFactory, getUserPermissionsAdapterFactory };
|
|
3265
|
+
export { addRemoveUserToGroupsAdapterFactory, getAllSobjectsAdapterFactory, getGroupsForUserAdapterFactory, getPublicGroupMembershipDetailsAdapterFactory, getPublicGroupShareDataAdapterFactory, getUserPermissionsAdapterFactory };
|