@salesforce/lds-worker-api 1.292.0 → 1.293.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/sfdc/es/ldsWorkerApi.js +1 -1
- package/dist/standalone/es/lds-worker-api.js +227 -170
- package/dist/standalone/umd/lds-worker-api.js +227 -170
- package/package.json +10 -10
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
SnapshotState["Stale"] = "Stale";
|
|
27
27
|
})(SnapshotState$3 || (SnapshotState$3 = {}));
|
|
28
28
|
|
|
29
|
-
const { create: create$b, entries: entries$
|
|
29
|
+
const { create: create$b, entries: entries$6, freeze: freeze$6, keys: keys$c, values: values$5, assign: assign$a } = Object;
|
|
30
30
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
31
31
|
const { isArray: isArray$9 } = Array;
|
|
32
32
|
const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
|
|
@@ -904,6 +904,9 @@
|
|
|
904
904
|
delete this.records[canonicalKey];
|
|
905
905
|
this.markVisited(canonicalKey);
|
|
906
906
|
}
|
|
907
|
+
cleanup() {
|
|
908
|
+
this.scheduleTrim();
|
|
909
|
+
}
|
|
907
910
|
/**
|
|
908
911
|
* Deallocates data at the canonical key location for in-memory (L1) cache
|
|
909
912
|
* @param key key to deallocate
|
|
@@ -1606,6 +1609,11 @@
|
|
|
1606
1609
|
this.recordsMap.delete(canonicalKey);
|
|
1607
1610
|
this.markVisited(canonicalKey);
|
|
1608
1611
|
}
|
|
1612
|
+
cleanup() {
|
|
1613
|
+
if (this.fallbackStringKeyInMemoryStore.pendingTrimKeys.size > 0) {
|
|
1614
|
+
this.fallbackStringKeyInMemoryStore.cleanup();
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1609
1617
|
/**
|
|
1610
1618
|
* Deallocates data at the canonical key location for in-memory (L1) cache
|
|
1611
1619
|
* @param key key to deallocate
|
|
@@ -3411,6 +3419,9 @@
|
|
|
3411
3419
|
storeLookup(sel, createSnapshot, refresh, ttlStrategy) {
|
|
3412
3420
|
return this.store.lookup(sel, createSnapshot, refresh, ttlStrategy);
|
|
3413
3421
|
}
|
|
3422
|
+
storeCleanup() {
|
|
3423
|
+
this.store.cleanup();
|
|
3424
|
+
}
|
|
3414
3425
|
storeEvict(key) {
|
|
3415
3426
|
this.store.evict(key);
|
|
3416
3427
|
}
|
|
@@ -3680,6 +3691,9 @@
|
|
|
3680
3691
|
storeEvict(key) {
|
|
3681
3692
|
this.environment.storeEvict(key);
|
|
3682
3693
|
}
|
|
3694
|
+
storeCleanup() {
|
|
3695
|
+
this.environment.storeCleanup();
|
|
3696
|
+
}
|
|
3683
3697
|
createSnapshot(selector, refresh) {
|
|
3684
3698
|
return this.environment.createSnapshot(selector, refresh);
|
|
3685
3699
|
}
|
|
@@ -4068,7 +4082,7 @@
|
|
|
4068
4082
|
}
|
|
4069
4083
|
return resourceParams;
|
|
4070
4084
|
}
|
|
4071
|
-
// engine version: 0.154.
|
|
4085
|
+
// engine version: 0.154.19-8ff414af
|
|
4072
4086
|
|
|
4073
4087
|
/**
|
|
4074
4088
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -4196,7 +4210,7 @@
|
|
|
4196
4210
|
}
|
|
4197
4211
|
callbacks.push(callback);
|
|
4198
4212
|
}
|
|
4199
|
-
// version: 1.
|
|
4213
|
+
// version: 1.293.0-5fab18553
|
|
4200
4214
|
|
|
4201
4215
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4202
4216
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15704,7 +15718,7 @@
|
|
|
15704
15718
|
}
|
|
15705
15719
|
return superResult;
|
|
15706
15720
|
}
|
|
15707
|
-
// version: 1.
|
|
15721
|
+
// version: 1.293.0-5fab18553
|
|
15708
15722
|
|
|
15709
15723
|
function unwrap(data) {
|
|
15710
15724
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16362,12 +16376,16 @@
|
|
|
16362
16376
|
callback(snapshotToTuple$1(snapshotOrPromise));
|
|
16363
16377
|
return;
|
|
16364
16378
|
}
|
|
16365
|
-
snapshotOrPromise
|
|
16379
|
+
snapshotOrPromise
|
|
16380
|
+
.then((snapshot) => {
|
|
16366
16381
|
if (snapshot === null) {
|
|
16367
16382
|
callback(createInvalidConfigError$1());
|
|
16368
16383
|
return;
|
|
16369
16384
|
}
|
|
16370
16385
|
callback(snapshotToTuple$1(snapshot));
|
|
16386
|
+
})
|
|
16387
|
+
.finally(() => {
|
|
16388
|
+
luvio.storeCleanup();
|
|
16371
16389
|
});
|
|
16372
16390
|
};
|
|
16373
16391
|
defineProperty(imperativeAdapterInvoke, 'name', {
|
|
@@ -16629,7 +16647,7 @@
|
|
|
16629
16647
|
const { apiFamily, name } = metadata;
|
|
16630
16648
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16631
16649
|
}
|
|
16632
|
-
// version: 1.
|
|
16650
|
+
// version: 1.293.0-5fab18553
|
|
16633
16651
|
|
|
16634
16652
|
/**
|
|
16635
16653
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16728,7 +16746,7 @@
|
|
|
16728
16746
|
TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
|
|
16729
16747
|
TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
|
|
16730
16748
|
})(TypeCheckShapes || (TypeCheckShapes = {}));
|
|
16731
|
-
// engine version: 0.154.
|
|
16749
|
+
// engine version: 0.154.19-8ff414af
|
|
16732
16750
|
|
|
16733
16751
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16734
16752
|
|
|
@@ -44226,7 +44244,7 @@
|
|
|
44226
44244
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44227
44245
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44228
44246
|
});
|
|
44229
|
-
// version: 1.
|
|
44247
|
+
// version: 1.293.0-c036bce5d
|
|
44230
44248
|
|
|
44231
44249
|
var ldsIdempotencyWriteDisabled = {
|
|
44232
44250
|
isOpen: function (e) {
|
|
@@ -44411,7 +44429,7 @@
|
|
|
44411
44429
|
const { parse: parse$6, stringify: stringify$6 } = JSON;
|
|
44412
44430
|
const { join: join$2, push: push$2, unshift } = Array.prototype;
|
|
44413
44431
|
const { isArray: isArray$5 } = Array;
|
|
44414
|
-
const { entries: entries$
|
|
44432
|
+
const { entries: entries$5, keys: keys$8 } = Object;
|
|
44415
44433
|
|
|
44416
44434
|
const UI_API_BASE_URI = '/services/data/v62.0/ui-api';
|
|
44417
44435
|
|
|
@@ -44718,7 +44736,7 @@
|
|
|
44718
44736
|
if (fulfill === undefined) {
|
|
44719
44737
|
return null;
|
|
44720
44738
|
}
|
|
44721
|
-
const handlersMap = entries$
|
|
44739
|
+
const handlersMap = entries$5(inflightRequests);
|
|
44722
44740
|
for (let i = 0, len = handlersMap.length; i < len; i += 1) {
|
|
44723
44741
|
const [transactionKey, handlers] = handlersMap[i];
|
|
44724
44742
|
// check fulfillment against only the first handler ([0]) because it's equal or
|
|
@@ -51509,7 +51527,7 @@
|
|
|
51509
51527
|
(x.length === 0 || (x.length > 0 && Object.prototype.hasOwnProperty.call(x, x.length - 1))));
|
|
51510
51528
|
}
|
|
51511
51529
|
|
|
51512
|
-
const { create: create$4, keys: keys$4, values: values$2, entries: entries$
|
|
51530
|
+
const { create: create$4, keys: keys$4, values: values$2, entries: entries$4, assign: assign$4 } = Object;
|
|
51513
51531
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
51514
51532
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
51515
51533
|
|
|
@@ -52257,7 +52275,7 @@
|
|
|
52257
52275
|
}
|
|
52258
52276
|
else {
|
|
52259
52277
|
//`field` match the filedInfo's apiName
|
|
52260
|
-
for (const [op, value] of entries$
|
|
52278
|
+
for (const [op, value] of entries$4(where[field])) {
|
|
52261
52279
|
const operator = operatorToSql(op);
|
|
52262
52280
|
/**
|
|
52263
52281
|
Two types ID processing might be needed. Draft ID swapping is optional, which depends on DraftFunctions existence.
|
|
@@ -53617,9 +53635,134 @@
|
|
|
53617
53635
|
];
|
|
53618
53636
|
}
|
|
53619
53637
|
|
|
53620
|
-
|
|
53621
|
-
|
|
53638
|
+
/*
|
|
53639
|
+
resolves connections...
|
|
53640
|
+
*/
|
|
53641
|
+
async function connectionResolver(obj, args, context, info) {
|
|
53642
|
+
let { recordRepresentation: parentRecord, ingestionTimestamp } = obj;
|
|
53643
|
+
if (!ingestionTimestamp)
|
|
53644
|
+
ingestionTimestamp = 0;
|
|
53645
|
+
if (!parentRecord && excludeStaleRecordsGate.isOpen({ fallback: false })) {
|
|
53646
|
+
// at our record query we fetch each ingestion time stamp and pass it down to each lower resolver to query against
|
|
53647
|
+
ingestionTimestamp = await fetchIngestionTimeStampFromDatabase(info.fieldName, info, args, context.query);
|
|
53648
|
+
}
|
|
53649
|
+
const { query, objectInfos, draftFunctions } = context;
|
|
53650
|
+
let joins = [];
|
|
53651
|
+
let alias = info.fieldName;
|
|
53652
|
+
let childRelationshipFieldName = undefined;
|
|
53653
|
+
if (parentRecord) {
|
|
53654
|
+
context.seenRecordIds.add(parentRecord.id);
|
|
53655
|
+
const parentApiName = parentRecord.apiName;
|
|
53656
|
+
const parentObjectInfo = objectInfos[parentApiName];
|
|
53657
|
+
const childRelationship = parentObjectInfo &&
|
|
53658
|
+
parentObjectInfo.childRelationships.find((rel) => rel.relationshipName === info.fieldName);
|
|
53659
|
+
// or emit/throw if we want to report it
|
|
53660
|
+
if (!childRelationship)
|
|
53661
|
+
return [];
|
|
53662
|
+
alias = childRelationship.childObjectApiName;
|
|
53663
|
+
childRelationshipFieldName = childRelationship.fieldName;
|
|
53664
|
+
}
|
|
53665
|
+
// Alias starts as entity's ApiName
|
|
53666
|
+
const predicates = [
|
|
53667
|
+
...filterToPredicates(args.where, alias, alias, context.objectInfos, joins, draftFunctions),
|
|
53668
|
+
...scopeToPredicates(args.scope, context.settings),
|
|
53669
|
+
...childRelationshipToPredicates(childRelationshipFieldName, parentRecord ? parentRecord.id : undefined),
|
|
53670
|
+
];
|
|
53671
|
+
const scopeJoins = scopeToJoins(args.scope, context.settings);
|
|
53672
|
+
joins.push(...scopeJoins);
|
|
53673
|
+
// Alias starts as entity's ApiName
|
|
53674
|
+
const queryConfig = {
|
|
53675
|
+
alias,
|
|
53676
|
+
joins,
|
|
53677
|
+
predicates,
|
|
53678
|
+
orderBy: orderByToPredicate(args.orderBy, alias, alias, context.objectInfos),
|
|
53679
|
+
limit: args.first,
|
|
53680
|
+
ingestionTimestamp,
|
|
53681
|
+
};
|
|
53682
|
+
const { sql, bindings } = buildQuery(queryConfig);
|
|
53683
|
+
const results = await query(sql, bindings);
|
|
53684
|
+
//map each sql result with the ingestion timestamp to pass it down a level
|
|
53685
|
+
return results.rows
|
|
53686
|
+
.map((row) => row[0])
|
|
53687
|
+
.map((record, index) => {
|
|
53688
|
+
return {
|
|
53689
|
+
record,
|
|
53690
|
+
ingestionTimestamp,
|
|
53691
|
+
index,
|
|
53692
|
+
};
|
|
53693
|
+
});
|
|
53622
53694
|
}
|
|
53695
|
+
/**
|
|
53696
|
+
* Converts a childRelationship into a predicate
|
|
53697
|
+
* @param childRelationshipFieldName Reference ID field name to its parent record. A defined `childRelationshipFieldName` string indicates that a child relationship exists
|
|
53698
|
+
* and a relationship predicate needs to be put into place. For example, `ServiceAppointment` has a child relationship `ServiceResources`, whose entity name is `AssignedResource`.
|
|
53699
|
+
* Once the parent `ServiceAppointment` record comes back, its child connection starts to resolve. Child `AssignedResource` record needs to reference to parent Id using field `ServiceAppointmentId`.
|
|
53700
|
+
* @param parentId prarent record Id
|
|
53701
|
+
* @returns predicate array consists at most 1 predicate
|
|
53702
|
+
*/
|
|
53703
|
+
function childRelationshipToPredicates(childRelationshipFieldName, parentId) {
|
|
53704
|
+
const predicates = [];
|
|
53705
|
+
if (childRelationshipFieldName !== undefined && parentId !== undefined) {
|
|
53706
|
+
predicates.push({
|
|
53707
|
+
type: PredicateType.single,
|
|
53708
|
+
leftPath: `$.fields.${childRelationshipFieldName}.value`,
|
|
53709
|
+
operator: '=',
|
|
53710
|
+
value: parentId,
|
|
53711
|
+
});
|
|
53712
|
+
}
|
|
53713
|
+
return predicates;
|
|
53714
|
+
}
|
|
53715
|
+
/**
|
|
53716
|
+
* fetches a query level ingestion time stamp from the L2 cache
|
|
53717
|
+
* if no query has been seen then the timestamp is 0
|
|
53718
|
+
* @param apiName
|
|
53719
|
+
* @param info
|
|
53720
|
+
* @param args
|
|
53721
|
+
* @param query
|
|
53722
|
+
* @returns
|
|
53723
|
+
*/
|
|
53724
|
+
async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
|
|
53725
|
+
const { operation, variableValues } = info;
|
|
53726
|
+
// if we cannot find the query key in the database then default to 0 as we assume we have not seen the query
|
|
53727
|
+
// and all the data is not stale
|
|
53728
|
+
let ingestionTimestamp = 0;
|
|
53729
|
+
if (info.fieldNodes.length > 0 && info.fieldNodes[0].arguments !== undefined) {
|
|
53730
|
+
const key = buildKeyStringForRecordQuery(operation,
|
|
53731
|
+
// join varables passed from query to the argument variables given from the AST
|
|
53732
|
+
{ ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
|
|
53733
|
+
return readIngestionTimestampForKey(key, query);
|
|
53734
|
+
}
|
|
53735
|
+
return ingestionTimestamp;
|
|
53736
|
+
}
|
|
53737
|
+
/**
|
|
53738
|
+
* Builds the top level record query key based on AST data
|
|
53739
|
+
* @param operation
|
|
53740
|
+
* @param variables
|
|
53741
|
+
* @param argumentNodes
|
|
53742
|
+
* @param currentFieldName
|
|
53743
|
+
* @returns
|
|
53744
|
+
*/
|
|
53745
|
+
function buildKeyStringForRecordQuery(operation, variables, argumentNodes, currentFieldName) {
|
|
53746
|
+
const queryKey = buildQueryTypeStringKey$1({
|
|
53747
|
+
luvio: {},
|
|
53748
|
+
keyPrefix: 'UiApi',
|
|
53749
|
+
schemaName: 'uiapi',
|
|
53750
|
+
queryTypeName: 'Query',
|
|
53751
|
+
operationNode: operation,
|
|
53752
|
+
variables,
|
|
53753
|
+
fragmentMap: {},
|
|
53754
|
+
});
|
|
53755
|
+
const filteredArgumentNodes = assign$4([], argumentNodes).filter((node) => node.name.value !== 'first' && node.name.value !== 'after');
|
|
53756
|
+
const argumentString = filteredArgumentNodes.length > 0
|
|
53757
|
+
? '__' + serializeFieldArguments$1(filteredArgumentNodes, variables)
|
|
53758
|
+
: '';
|
|
53759
|
+
return `${queryKey}__uiapi__query__${currentFieldName}${argumentString}`;
|
|
53760
|
+
}
|
|
53761
|
+
|
|
53762
|
+
function passThroughResolver(source) {
|
|
53763
|
+
return source;
|
|
53764
|
+
}
|
|
53765
|
+
|
|
53623
53766
|
/**
|
|
53624
53767
|
*
|
|
53625
53768
|
* @param schema GraphQL Schema generated from ObjectInfos
|
|
@@ -53652,13 +53795,13 @@
|
|
|
53652
53795
|
}
|
|
53653
53796
|
if (type.name === 'Query') {
|
|
53654
53797
|
for (const field of fields) {
|
|
53655
|
-
field.resolve =
|
|
53798
|
+
field.resolve = passThroughResolver;
|
|
53656
53799
|
}
|
|
53657
53800
|
}
|
|
53658
53801
|
if (type.name === 'UIAPI') {
|
|
53659
53802
|
for (const field of fields) {
|
|
53660
53803
|
if (field.name === 'query') {
|
|
53661
|
-
field.resolve =
|
|
53804
|
+
field.resolve = passThroughResolver;
|
|
53662
53805
|
}
|
|
53663
53806
|
else {
|
|
53664
53807
|
const fieldName = field.name;
|
|
@@ -53685,23 +53828,7 @@
|
|
|
53685
53828
|
// Fields of the `RecordQuery` type are the record queries for the entity types
|
|
53686
53829
|
// supported for the org
|
|
53687
53830
|
for (const recordQuery of fields) {
|
|
53688
|
-
recordQuery.resolve =
|
|
53689
|
-
const { name: currentFieldName } = recordQuery;
|
|
53690
|
-
let ingestionTimestamp = 0;
|
|
53691
|
-
if (excludeStaleRecordsGate.isOpen({ fallback: false })) {
|
|
53692
|
-
// at our record query we fetch each ingestion time stamp and pass it down to each lower resolver to query against
|
|
53693
|
-
ingestionTimestamp = await fetchIngestionTimeStampFromDatabase(currentFieldName, info, args, query);
|
|
53694
|
-
}
|
|
53695
|
-
// In the SF schema, the relevant arguments are passed into RecordQuery fields, but actually used
|
|
53696
|
-
// down in the edge resolvers. For this resolver, we can just return what was passed in
|
|
53697
|
-
// to make it available to the next execution step
|
|
53698
|
-
return {
|
|
53699
|
-
parentArgs: args,
|
|
53700
|
-
parentRecord: record,
|
|
53701
|
-
currentFieldName,
|
|
53702
|
-
ingestionTimestamp,
|
|
53703
|
-
};
|
|
53704
|
-
};
|
|
53831
|
+
recordQuery.resolve = connectionResolver;
|
|
53705
53832
|
}
|
|
53706
53833
|
}
|
|
53707
53834
|
if (type.name.endsWith('Connection')) {
|
|
@@ -53722,7 +53849,13 @@
|
|
|
53722
53849
|
for (const field of fields) {
|
|
53723
53850
|
switch (field.name) {
|
|
53724
53851
|
case 'edges':
|
|
53725
|
-
field.resolve =
|
|
53852
|
+
field.resolve = passThroughResolver;
|
|
53853
|
+
break;
|
|
53854
|
+
case 'pageInfo':
|
|
53855
|
+
field.resolve = function (_value, _args, _context, _info) {
|
|
53856
|
+
// TODO [W-12390939]: implement resolver for PageInfo
|
|
53857
|
+
return {};
|
|
53858
|
+
};
|
|
53726
53859
|
break;
|
|
53727
53860
|
default:
|
|
53728
53861
|
field.resolve = defaultFieldResolver;
|
|
@@ -53870,16 +54003,7 @@
|
|
|
53870
54003
|
else if (isObjectType$1(recordFieldType) &&
|
|
53871
54004
|
field.type.name.endsWith('Connection')) {
|
|
53872
54005
|
// spanning field to a connection
|
|
53873
|
-
field.resolve =
|
|
53874
|
-
seenRecordIds.add(recordRepresentation.id);
|
|
53875
|
-
const { name: currentFieldName } = field;
|
|
53876
|
-
return {
|
|
53877
|
-
parentArgs: args,
|
|
53878
|
-
parentRecord: recordRepresentation,
|
|
53879
|
-
currentFieldName,
|
|
53880
|
-
ingestionTimestamp,
|
|
53881
|
-
};
|
|
53882
|
-
};
|
|
54006
|
+
field.resolve = connectionResolver;
|
|
53883
54007
|
}
|
|
53884
54008
|
else {
|
|
53885
54009
|
field.resolve = function recordFieldResolver({ recordRepresentation: record, }) {
|
|
@@ -53934,123 +54058,10 @@
|
|
|
53934
54058
|
}
|
|
53935
54059
|
return null;
|
|
53936
54060
|
}
|
|
53937
|
-
async function connectionEdgeResolver(obj, _args, context) {
|
|
53938
|
-
const { parentArgs = {}, parentRecord, currentFieldName, ingestionTimestamp } = obj;
|
|
53939
|
-
const { query, objectInfos, draftFunctions } = context;
|
|
53940
|
-
let joins = [];
|
|
53941
|
-
let alias = currentFieldName;
|
|
53942
|
-
let childRelationshipFieldName = undefined;
|
|
53943
|
-
if (parentRecord.id) {
|
|
53944
|
-
const parentApiName = parentRecord.apiName;
|
|
53945
|
-
const parentObjectInfo = objectInfos[parentApiName];
|
|
53946
|
-
const childRelationship = parentObjectInfo &&
|
|
53947
|
-
parentObjectInfo.childRelationships.find((rel) => rel.relationshipName === currentFieldName);
|
|
53948
|
-
// or emit/throw if we want to report it
|
|
53949
|
-
if (!childRelationship)
|
|
53950
|
-
return [];
|
|
53951
|
-
alias = childRelationship.childObjectApiName;
|
|
53952
|
-
childRelationshipFieldName = childRelationship.fieldName;
|
|
53953
|
-
}
|
|
53954
|
-
// Alias starts as entity's ApiName
|
|
53955
|
-
const predicates = [
|
|
53956
|
-
...filterToPredicates(parentArgs.where, alias, alias, context.objectInfos, joins, draftFunctions),
|
|
53957
|
-
...scopeToPredicates(parentArgs.scope, context.settings),
|
|
53958
|
-
...childRelationshipToPredicates(childRelationshipFieldName, parentRecord.id),
|
|
53959
|
-
];
|
|
53960
|
-
const scopeJoins = scopeToJoins(parentArgs.scope, context.settings);
|
|
53961
|
-
joins.push(...scopeJoins);
|
|
53962
|
-
// Alias starts as entity's ApiName
|
|
53963
|
-
const queryConfig = {
|
|
53964
|
-
alias,
|
|
53965
|
-
joins,
|
|
53966
|
-
predicates,
|
|
53967
|
-
orderBy: orderByToPredicate(parentArgs.orderBy, alias, alias, context.objectInfos),
|
|
53968
|
-
limit: parentArgs.first,
|
|
53969
|
-
ingestionTimestamp,
|
|
53970
|
-
};
|
|
53971
|
-
const { sql, bindings } = buildQuery(queryConfig);
|
|
53972
|
-
const results = await query(sql, bindings);
|
|
53973
|
-
//map each sql result with the ingestion timestamp to pass it down a level
|
|
53974
|
-
return results.rows
|
|
53975
|
-
.map((row) => row[0])
|
|
53976
|
-
.map((record, index) => {
|
|
53977
|
-
return {
|
|
53978
|
-
record,
|
|
53979
|
-
ingestionTimestamp,
|
|
53980
|
-
index,
|
|
53981
|
-
};
|
|
53982
|
-
});
|
|
53983
|
-
}
|
|
53984
|
-
/**
|
|
53985
|
-
* Converts a childRelationship into a predicate
|
|
53986
|
-
* @param childRelationshipFieldName Reference ID field name to its parent record. A defined `childRelationshipFieldName` string indicates that a child relationship exists
|
|
53987
|
-
* and a relationship predicate needs to be put into place. For example, `ServiceAppointment` has a child relationship `ServiceResources`, whose entity name is `AssignedResource`.
|
|
53988
|
-
* Once the parent `ServiceAppointment` record comes back, its child connection starts to resolve. Child `AssignedResource` record needs to reference to parent Id using field `ServiceAppointmentId`.
|
|
53989
|
-
* @param parentId prarent record Id
|
|
53990
|
-
* @returns predicate array consists at most 1 predicate
|
|
53991
|
-
*/
|
|
53992
|
-
function childRelationshipToPredicates(childRelationshipFieldName, parentId) {
|
|
53993
|
-
const predicates = [];
|
|
53994
|
-
if (childRelationshipFieldName !== undefined && parentId !== undefined) {
|
|
53995
|
-
predicates.push({
|
|
53996
|
-
type: PredicateType.single,
|
|
53997
|
-
leftPath: `$.fields.${childRelationshipFieldName}.value`,
|
|
53998
|
-
operator: '=',
|
|
53999
|
-
value: parentId,
|
|
54000
|
-
});
|
|
54001
|
-
}
|
|
54002
|
-
return predicates;
|
|
54003
|
-
}
|
|
54004
54061
|
function isRecordType(type) {
|
|
54005
54062
|
const interfaces = type.getInterfaces();
|
|
54006
54063
|
return Boolean(interfaces.find((iface) => iface.name === 'Record'));
|
|
54007
54064
|
}
|
|
54008
|
-
/**
|
|
54009
|
-
* Builds the top level record query key based on AST data
|
|
54010
|
-
* @param operation
|
|
54011
|
-
* @param variables
|
|
54012
|
-
* @param argumentNodes
|
|
54013
|
-
* @param currentFieldName
|
|
54014
|
-
* @returns
|
|
54015
|
-
*/
|
|
54016
|
-
function buildKeyStringForRecordQuery(operation, variables, argumentNodes, currentFieldName) {
|
|
54017
|
-
const queryKey = buildQueryTypeStringKey$1({
|
|
54018
|
-
luvio: {},
|
|
54019
|
-
keyPrefix: 'UiApi',
|
|
54020
|
-
schemaName: 'uiapi',
|
|
54021
|
-
queryTypeName: 'Query',
|
|
54022
|
-
operationNode: operation,
|
|
54023
|
-
variables,
|
|
54024
|
-
fragmentMap: {},
|
|
54025
|
-
});
|
|
54026
|
-
const filteredArgumentNodes = assign$4([], argumentNodes).filter((node) => node.name.value !== 'first' && node.name.value !== 'after');
|
|
54027
|
-
const argumentString = filteredArgumentNodes.length > 0
|
|
54028
|
-
? '__' + serializeFieldArguments$1(filteredArgumentNodes, variables)
|
|
54029
|
-
: '';
|
|
54030
|
-
return `${queryKey}__uiapi__query__${currentFieldName}${argumentString}`;
|
|
54031
|
-
}
|
|
54032
|
-
/**
|
|
54033
|
-
* fetches a query level ingestion time stamp from the L2 cache
|
|
54034
|
-
* if no query has been seen then the timestamp is 0
|
|
54035
|
-
* @param apiName
|
|
54036
|
-
* @param info
|
|
54037
|
-
* @param args
|
|
54038
|
-
* @param query
|
|
54039
|
-
* @returns
|
|
54040
|
-
*/
|
|
54041
|
-
async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
|
|
54042
|
-
const { operation, variableValues } = info;
|
|
54043
|
-
// if we cannot find the query key in the database then default to 0 as we assume we have not seen the query
|
|
54044
|
-
// and all the data is not stale
|
|
54045
|
-
let ingestionTimestamp = 0;
|
|
54046
|
-
if (info.fieldNodes.length > 0 && info.fieldNodes[0].arguments !== undefined) {
|
|
54047
|
-
const key = buildKeyStringForRecordQuery(operation,
|
|
54048
|
-
// join varables passed from query to the argument variables given from the AST
|
|
54049
|
-
{ ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
|
|
54050
|
-
return readIngestionTimestampForKey(key, query);
|
|
54051
|
-
}
|
|
54052
|
-
return ingestionTimestamp;
|
|
54053
|
-
}
|
|
54054
54065
|
|
|
54055
54066
|
var uiapiSchemaString = "scalar String\nscalar DateTime\nscalar Currency\nscalar ID\nscalar Boolean\nscalar Longitude\nscalar Float\nscalar MultiPicklist\nscalar Base64\nscalar Url\nscalar PhoneNumber\nscalar Email\nscalar TextArea\nscalar Latitude\nscalar Picklist\nscalar RichTextArea\nscalar EncryptedString\nscalar Double\nscalar Long\nscalar JSON\nscalar Time\nscalar Int\nscalar Percent\nscalar LongTextArea\nscalar IdOrRef\nscalar Date\ntype PercentAggregate implements FieldValue {\n value: Percent\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: PercentValue\n min: PercentValue\n sum: PercentValue\n}\n\ntype StringAggregate implements FieldValue {\n value: String\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n label: String\n max: StringValue\n min: StringValue\n}\n\ntype Query {\n uiapi: UIAPI!\n setup: Setup__Setup!\n}\n\ninput EmailOperators {\n eq: Email\n ne: Email\n like: Email\n lt: Email\n gt: Email\n lte: Email\n gte: Email\n in: [Email]\n nin: [Email]\n}\n\ninput PolymorphicParentRelationshipRecordOrderBy @generic {\n RecordOrderBy: RecordOrderBy @fieldCategory\n}\n\ninput DoubleOperators {\n eq: Double\n ne: Double\n lt: Double\n gt: Double\n lte: Double\n gte: Double\n in: [Double]\n nin: [Double]\n}\n\ntype DateOnlyAggregation {\n value: Date\n format: String\n}\n\ntype RecordCreatePayload @generic {\n Record: RecordRepresentation\n}\n\ntype DateAggregate implements FieldValue {\n value: Date\n displayValue: String\n calendarMonth: DateFunctionAggregation\n calendarQuarter: DateFunctionAggregation\n calendarYear: DateFunctionAggregation\n count: LongValue\n countDistinct: LongValue\n dayInMonth: DateFunctionAggregation\n dayInWeek: DateFunctionAggregation\n dayInYear: DateFunctionAggregation\n fiscalMonth: DateFunctionAggregation\n fiscalQuarter: DateFunctionAggregation\n fiscalYear: DateFunctionAggregation\n format: String\n grouping: IntValue\n max: DateValue\n min: DateValue\n weekInMonth: DateFunctionAggregation\n weekInYear: DateFunctionAggregation\n}\n\ninput PolymorphicParentRelationshipGroupBy @generic {\n RecordGroupBy: RecordGroupBy @fieldCategory\n}\n\nenum GroupByFunction {\n DAY_IN_WEEK\n DAY_IN_MONTH\n DAY_IN_YEAR\n WEEK_IN_MONTH\n WEEK_IN_YEAR\n CALENDAR_MONTH\n CALENDAR_QUARTER\n CALENDAR_YEAR\n FISCAL_MONTH\n FISCAL_QUARTER\n FISCAL_YEAR\n DAY_ONLY\n HOUR_IN_DAY\n}\n\ntype RecordTypeInfo {\n available: Boolean!\n defaultRecordTypeMapping: Boolean!\n master: Boolean!\n name: String\n recordTypeId: ID\n}\n\ninput UIAPIMutationsInput {\n allOrNone: Boolean = true\n}\n\ntype BooleanValue implements FieldValue {\n value: Boolean\n displayValue: String\n}\n\ntype ReferenceToInfo {\n ApiName: String!\n nameFields: [String]!\n objectInfo: ObjectInfo\n}\n\ninterface FieldValue {\n displayValue: String\n}\n\ntype LongitudeValue implements FieldValue {\n value: Longitude\n displayValue: String\n}\n\ntype StringValue implements FieldValue {\n value: String\n displayValue: String\n label: String\n}\n\ntype IntValue implements FieldValue {\n value: Int\n displayValue: String\n format: String\n}\n\ntype UrlValue implements FieldValue {\n value: Url\n displayValue: String\n}\n\ninput IdOperators {\n eq: ID\n ne: ID\n lt: ID\n gt: ID\n lte: ID\n gte: ID\n in: [ID]\n nin: [ID]\n inq: JoinInput\n ninq: JoinInput\n}\n\ninput Setup__SetupOrderBy @generic {\n orderableField: OrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: Setup__SetupOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: Setup__SetupPolymorphicParentRelationshipRecordOrderBy @fieldCategory\n}\n\ntype LongAggregate implements FieldValue {\n value: Long\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n grouping: IntValue\n max: LongValue\n min: LongValue\n sum: LongValue\n}\n\ntype PhoneNumberAggregate implements FieldValue {\n value: PhoneNumber\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: PhoneNumberValue\n min: PhoneNumberValue\n}\n\ninput TimeOperators {\n eq: Time\n ne: Time\n lt: Time\n gt: Time\n lte: Time\n gte: Time\n in: [Time]\n nin: [Time]\n}\n\ntype PicklistValue implements FieldValue {\n value: Picklist\n displayValue: String\n label: String\n}\n\ntype CurrencyAggregate implements FieldValue {\n value: Currency\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: CurrencyValue\n min: CurrencyValue\n sum: CurrencyValue\n}\n\ntype RelatedListInfo {\n childApiName: String!\n relatedListName: String!\n label: String!\n displayColumns: [ListColumn!]!\n orderedByInfo: [ListOrder!]!\n parentApiName: String!\n fieldApiName: String!\n}\n\ninput StringOperators {\n eq: String\n ne: String\n like: String\n lt: String\n gt: String\n lte: String\n gte: String\n in: [String]\n nin: [String]\n}\n\ntype UIAPI {\n query: RecordQuery!\n aggregate: RecordQueryAggregate!\n objectInfos(apiNames: [String], locale: String): [ObjectInfo]\n relatedListByName(parentApiName: String!, relatedListName: String!): RelatedListInfo\n}\n\ninput MultiPicklistOperators {\n eq: MultiPicklist\n ne: MultiPicklist\n includes: [MultiPicklist]\n excludes: [MultiPicklist]\n}\n\ntype DateTimeAggregate implements FieldValue {\n value: DateTime\n displayValue: String\n calendarMonth: DateFunctionAggregation\n calendarQuarter: DateFunctionAggregation\n calendarYear: DateFunctionAggregation\n count: LongValue\n countDistinct: LongValue\n dayInMonth: DateFunctionAggregation\n dayInWeek: DateFunctionAggregation\n dayInYear: DateFunctionAggregation\n dayOnly: DateOnlyAggregation\n fiscalMonth: DateFunctionAggregation\n fiscalQuarter: DateFunctionAggregation\n fiscalYear: DateFunctionAggregation\n format: String\n hourInDay: DateFunctionAggregation\n max: DateTimeValue\n min: DateTimeValue\n weekInMonth: DateFunctionAggregation\n weekInYear: DateFunctionAggregation\n}\n\ninput BooleanOperators {\n eq: Boolean\n ne: Boolean\n}\n\ntype EmailAggregate implements FieldValue {\n value: Email\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: EmailValue\n min: EmailValue\n}\n\n#enum OrderByType {\n#}\n\ninput GroupByDateFunction {\n function: GroupByFunction\n}\n\ntype RichTextAreaValue implements FieldValue {\n value: RichTextArea\n displayValue: String\n}\n\ntype MultiPicklistValue implements FieldValue {\n value: MultiPicklist\n displayValue: String\n label: String\n}\n\ntype Setup__SetupEdge @generic {\n node: Setup__EntityRepresentation\n cursor: String!\n}\n\ninput DatePrimitiveOperators {\n eq: Date\n ne: Date\n lt: Date\n gt: Date\n lte: Date\n gte: Date\n in: [Date]\n nin: [Date]\n}\n\ntype TimeAggregate implements FieldValue {\n value: Time\n displayValue: String\n format: String\n hourInDay: DateFunctionAggregation\n}\n\ntype __Type {\n kind: __TypeKind!\n name: String\n description: String\n fields(includeDeprecated: Boolean = false): [__Field!]\n interfaces: [__Type!]\n possibleTypes: [__Type!]\n enumValues(includeDeprecated: Boolean = false): [__EnumValue!]\n inputFields: [__InputValue!]\n ofType: __Type\n}\n\ntype ListColumn {\n fieldApiName: String!\n label: String!\n lookupId: String\n sortable: Boolean\n}\n\ntype Setup__SetupQuery {\n recordQuery(first: Int, after: String, where: Setup__SetupFilter, orderBy: Setup__SetupOrderBy, scope: String, upperBound: Int): Setup__SetupConnection @fieldCategory\n}\n\ntype Setup__EntityRepresentation @generic {\n Id: ID!\n ApiName: String!\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n parentRelationship: Setup__EntityRepresentation @fieldCategory\n polymorphicParentRelationship: Setup__SetupPolymorphicParentRelationship @fieldCategory\n childRelationship(first: Int, after: String, where: Setup__SetupFilter, orderBy: Setup__SetupOrderBy, upperBound: Int): Setup__SetupConnection @fieldCategory\n CompoundField: CompoundField @fieldCategory\n}\n\ntype LatitudeAggregate implements FieldValue {\n value: Latitude\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n max: LatitudeValue\n min: LatitudeValue\n sum: DoubleValue\n}\n\ninput CurrencyOperators {\n eq: Currency\n ne: Currency\n lt: Currency\n gt: Currency\n lte: Currency\n gte: Currency\n in: [Currency]\n nin: [Currency]\n}\n\ninput DistanceInput {\n latitude: Latitude!\n longitude: Longitude!\n}\n\nunion PolymorphicParentRelationship @generic = RecordRepresentation\n\nenum AggregateOrderByNumberFunction {\n AVG\n COUNT\n COUNT_DISTINCT\n MAX\n MIN\n SUM\n}\n\ntype LongTextAreaValue implements FieldValue {\n value: LongTextArea\n displayValue: String\n}\n\ntype LatitudeValue implements FieldValue {\n value: Latitude\n displayValue: String\n}\n\ninput OrderByClause {\n order: ResultOrder\n nulls: NullOrder\n}\n\ninput AggregateOrderBy @generic {\n orderableNumberField: AggregateOrderByNumberClause @fieldCategory\n orderableStringField: AggregateOrderByStringClause @fieldCategory\n orderableField: NoFunctionAggregateOrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: AggregateOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: PolymorphicParentRelationshipOrderBy @fieldCategory\n type: String = ORDER_BY\n}\n\ninput GroupByClause {\n group: Boolean\n}\n\ntype RecordAggregateConnection @generic {\n edges: [RecordAggregateEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n}\n\ntype LongitudeAggregate implements FieldValue {\n value: Longitude\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n max: LongitudeValue\n min: LongitudeValue\n sum: DoubleValue\n}\n\ntype RecordEdge @generic {\n node: RecordRepresentation\n cursor: String!\n}\n\nunion Setup__SetupPolymorphicParentRelationship @generic = Setup__EntityRepresentation\n\ntype DateValue implements FieldValue {\n value: Date\n displayValue: String\n format: String\n}\n\ninput URLOperators {\n eq: Url\n ne: Url\n like: Url\n lt: Url\n gt: Url\n lte: Url\n gte: Url\n in: [Url]\n nin: [Url]\n}\n\ninput LongOperators {\n eq: Long\n ne: Long\n lt: Long\n gt: Long\n lte: Long\n gte: Long\n in: [Long]\n nin: [Long]\n}\n\nenum DataType {\n STRING\n TEXTAREA\n PHONE\n EMAIL\n URL\n ENCRYPTEDSTRING\n BOOLEAN\n CURRENCY\n INT\n LONG\n DOUBLE\n PERCENT\n DATETIME\n TIME\n DATE\n REFERENCE\n PICKLIST\n MULTIPICKLIST\n ADDRESS\n LOCATION\n BASE64\n COMPLEXVALUE\n COMBOBOX\n JSON\n JUNCTIONIDLIST\n ANYTYPE\n}\n\nenum NullOrder {\n FIRST\n LAST\n}\n\ntype PhoneNumberValue implements FieldValue {\n value: PhoneNumber\n displayValue: String\n}\n\n# Cannot have empty enum\n# enum RecordScope @generic {\n# }\n\ninput Setup__SetupFilter @generic {\n and: [Setup__SetupFilter]\n or: [Setup__SetupFilter]\n not: Setup__SetupFilter\n parentRelationshipRecordFilter: Setup__SetupFilter @fieldCategory\n polymorphicParentRelationshipRecordFilter: Setup__SetupPolymorphicParentRelationshipRecordFilter @fieldCategory\n IntegerOperator: IntegerOperators @fieldCategory\n LongOperator: LongOperators @fieldCategory\n StringOperator: StringOperators @fieldCategory\n DoubleOperator: DoubleOperators @fieldCategory\n PercentOperator: PercentOperators @fieldCategory\n LongitudeOperator: LongitudeOperators @fieldCategory\n LatitudeOperator: LatitudeOperators @fieldCategory\n EmailOperator: EmailOperators @fieldCategory\n TextAreaOperator: TextAreaOperators @fieldCategory\n LongTextAreaOperator: LongTextAreaOperators @fieldCategory\n URLOperator: URLOperators @fieldCategory\n PhoneNumberOperator: PhoneNumberOperators @fieldCategory\n BooleanOperator: BooleanOperators @fieldCategory\n Setup__IdOperator: Setup__IdOperators @fieldCategory\n CurrencyOperator: CurrencyOperators @fieldCategory\n TimeOperator: TimeOperators @fieldCategory\n DateOperator: DateOperators @fieldCategory\n DateTimeOperator: DateTimeOperators @fieldCategory\n PicklistOperator: PicklistOperators @fieldCategory\n MultiPicklistOperator: MultiPicklistOperators @fieldCategory\n GeolocationOperator: GeolocationOperators @fieldCategory\n}\n\ntype DoubleAggregate implements FieldValue {\n value: Double\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: DoubleValue\n min: DoubleValue\n sum: DoubleValue\n}\n\ntype __Field {\n name: String!\n description: String\n args: [__InputValue!]!\n type: __Type!\n isDeprecated: Boolean!\n deprecationReason: String\n}\n\ninput DateOperators {\n eq: DateInput\n ne: DateInput\n lt: DateInput\n gt: DateInput\n lte: DateInput\n gte: DateInput\n in: [DateInput]\n nin: [DateInput]\n DAY_IN_WEEK: DateFunctionInput\n DAY_IN_MONTH: DateFunctionInput\n DAY_IN_YEAR: DateFunctionInput\n WEEK_IN_MONTH: DateFunctionInput\n WEEK_IN_YEAR: DateFunctionInput\n CALENDAR_MONTH: DateFunctionInput\n CALENDAR_QUARTER: DateFunctionInput\n CALENDAR_YEAR: DateFunctionInput\n FISCAL_MONTH: DateFunctionInput\n FISCAL_QUARTER: DateFunctionInput\n FISCAL_YEAR: DateFunctionInput\n}\n\ninput GeolocationInput {\n latitude: Latitude!\n longitude: Longitude!\n radius: Float!\n unit: Unit!\n}\n\ninput JoinInput {\n Record: RecordFilter @fieldCategory\n ApiName: String\n}\n\ninput TextAreaOperators {\n eq: TextArea\n ne: TextArea\n like: TextArea\n lt: TextArea\n gt: TextArea\n lte: TextArea\n gte: TextArea\n in: [TextArea]\n nin: [TextArea]\n}\n\ntype TextAreaValue implements FieldValue {\n value: TextArea\n displayValue: String\n}\n\ntype RecordUpdatePayload @generic {\n success: Boolean\n}\n\ninput PercentOperators {\n eq: Percent\n ne: Percent\n lt: Percent\n gt: Percent\n lte: Percent\n gte: Percent\n in: [Percent]\n nin: [Percent]\n}\n\ninput Setup__SetupPolymorphicParentRelationshipRecordOrderBy @generic {\n Setup__SetupOrderBy: Setup__SetupOrderBy @fieldCategory\n}\n\ntype DoubleValue implements FieldValue {\n value: Double\n displayValue: String\n format: String\n}\n\ntype IDAggregate implements FieldValue {\n value: ID\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: IDValue\n min: IDValue\n}\n\ntype __InputValue {\n name: String!\n description: String\n type: __Type!\n defaultValue: String\n}\n\ntype RecordAggregateEdge @generic {\n node: RecordResult\n cursor: String!\n}\n\ntype __Directive {\n name: String\n description: String\n locations: [__DirectiveLocation!]\n args: [__InputValue!]!\n}\n\ninput RecordCreateInput @generic {\n record: RecordCreateRepresentation! @fieldCategory\n}\n\ntype ThemeInfo {\n color: String\n iconUrl: String\n}\n\ninput AggregateOrderByStringClause {\n function: AggregateOrderByStringFunction\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype RecordDeletePayload {\n Id: ID\n}\n\ntype UrlAggregate implements FieldValue {\n value: Url\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: UrlValue\n min: UrlValue\n}\n\nenum DateLiteral {\n LAST_YEAR\n LAST_WEEK\n THIS_QUARTER\n NEXT_FISCAL_YEAR\n LAST_QUARTER\n TOMORROW\n NEXT_FISCAL_QUARTER\n YESTERDAY\n NEXT_QUARTER\n THIS_FISCAL_QUARTER\n THIS_WEEK\n LAST_MONTH\n LAST_90_DAYS\n NEXT_90_DAYS\n THIS_FISCAL_YEAR\n NEXT_WEEK\n TODAY\n NEXT_YEAR\n NEXT_MONTH\n LAST_FISCAL_QUARTER\n THIS_MONTH\n LAST_FISCAL_YEAR\n THIS_YEAR\n}\n\ntype __EnumValue {\n name: String!\n description: String\n isDeprecated: Boolean!\n deprecationReason: String\n}\n\ntype RecordRepresentation implements Record @generic {\n Id: ID!\n ApiName: String!\n WeakEtag: Long!\n DisplayValue: String\n LastModifiedById: IDValue\n LastModifiedDate: DateTimeValue\n SystemModstamp: DateTimeValue\n RecordTypeId(fallback: Boolean): IDValue\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n parentRelationship: RecordRepresentation @fieldCategory\n polymorphicParentRelationship: PolymorphicParentRelationship @fieldCategory\n childRelationship(first: Int, after: String, where: RecordFilter, orderBy: RecordOrderBy, upperBound: Int): RecordConnection @fieldCategory\n CompoundField: CompoundField @fieldCategory\n}\n\ntype IDValue implements FieldValue {\n value: ID\n displayValue: String\n}\n\nenum Unit {\n MI\n KM\n}\n\ninput PolymorphicParentRelationshipOrderBy @generic {\n AggregateOrderBy: AggregateOrderBy @fieldCategory\n}\n\ninput OrderByGeolocationClause {\n distance: DistanceInput\n order: ResultOrder\n nulls: NullOrder\n}\n\ninput Setup__IdOperators {\n eq: ID\n ne: ID\n lt: ID\n gt: ID\n lte: ID\n gte: ID\n in: [ID]\n nin: [ID]\n inq: Setup__JoinInput\n ninq: Setup__JoinInput\n}\n\nenum NullsOrder {\n FIRST\n LAST\n}\n\ntype TextAreaAggregate implements FieldValue {\n value: TextArea\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: TextAreaValue\n min: TextAreaValue\n}\n\nenum GroupByType {\n GROUP_BY\n ROLLUP\n CUBE\n}\n\nenum ResultOrder {\n ASC\n DESC\n}\n\ninput RecordOrderBy @generic {\n orderableField: OrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: RecordOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: PolymorphicParentRelationshipRecordOrderBy @fieldCategory\n}\n\ninput Setup__JoinInput {\n Record: Setup__SetupFilter @fieldCategory\n ApiName: String\n}\n\ninput PicklistOperators {\n eq: Picklist\n ne: Picklist\n in: [Picklist]\n nin: [Picklist]\n like: Picklist\n lt: Picklist\n gt: Picklist\n lte: Picklist\n gte: Picklist\n}\n\nenum ResultsOrder {\n ASC\n DESC\n}\n\ninput RecordFilter @generic {\n and: [RecordFilter]\n or: [RecordFilter]\n not: RecordFilter\n parentRelationshipRecordFilter: RecordFilter @fieldCategory\n polymorphicParentRelationshipRecordFilter: PolymorphicParentRelationshipRecordFilter @fieldCategory\n IntegerOperator: IntegerOperators @fieldCategory\n LongOperator: LongOperators @fieldCategory\n StringOperator: StringOperators @fieldCategory\n DoubleOperator: DoubleOperators @fieldCategory\n PercentOperator: PercentOperators @fieldCategory\n LongitudeOperator: LongitudeOperators @fieldCategory\n LatitudeOperator: LatitudeOperators @fieldCategory\n EmailOperator: EmailOperators @fieldCategory\n TextAreaOperator: TextAreaOperators @fieldCategory\n LongTextAreaOperator: LongTextAreaOperators @fieldCategory\n URLOperator: URLOperators @fieldCategory\n PhoneNumberOperator: PhoneNumberOperators @fieldCategory\n BooleanOperator: BooleanOperators @fieldCategory\n IdOperator: IdOperators @fieldCategory\n CurrencyOperator: CurrencyOperators @fieldCategory\n TimeOperator: TimeOperators @fieldCategory\n DateOperator: DateOperators @fieldCategory\n DateTimeOperator: DateTimeOperators @fieldCategory\n PicklistOperator: PicklistOperators @fieldCategory\n MultiPicklistOperator: MultiPicklistOperators @fieldCategory\n GeolocationOperator: GeolocationOperators @fieldCategory\n}\n\ntype TimeValue implements FieldValue {\n value: Time\n displayValue: String\n format: String\n}\n\ninput GeolocationOperators {\n lt: GeolocationInput\n gt: GeolocationInput\n}\n\ntype PicklistAggregate implements FieldValue {\n value: Picklist\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n label: String\n max: PicklistValue\n min: PicklistValue\n}\n\ninput LatitudeOperators {\n eq: Latitude\n ne: Latitude\n lt: Latitude\n gt: Latitude\n lte: Latitude\n gte: Latitude\n in: [Latitude]\n nin: [Latitude]\n}\n\ninput RecordUpdateRepresentation @generic {\n Int: Int @fieldCategory\n String: String @fieldCategory\n Boolean: Boolean @fieldCategory\n ID: IdOrRef @fieldCategory\n DateTime: DateTime @fieldCategory\n Time: Time @fieldCategory\n Date: Date @fieldCategory\n TextArea: TextArea @fieldCategory\n LongTextArea: LongTextArea @fieldCategory\n RichTextArea: RichTextArea @fieldCategory\n PhoneNumber: PhoneNumber @fieldCategory\n Email: Email @fieldCategory\n Url: Url @fieldCategory\n EncryptedString: EncryptedString @fieldCategory\n Currency: Currency @fieldCategory\n Longitude: Longitude @fieldCategory\n Latitude: Latitude @fieldCategory\n Picklist: Picklist @fieldCategory\n MultiPicklist: MultiPicklist @fieldCategory\n Long: Long @fieldCategory\n Double: Double @fieldCategory\n Percent: Percent @fieldCategory\n Base64: Base64 @fieldCategory\n JSON: JSON @fieldCategory\n}\n\ntype DateTimeValue implements FieldValue {\n value: DateTime\n displayValue: String\n format: String\n}\n\ninput RecordDeleteInput {\n Id: IdOrRef!\n}\n\nenum __DirectiveLocation {\n QUERY\n MUTATION\n FIELD\n FRAGMENT_DEFINITION\n FRAGMENT_SPREAD\n INLINE_FRAGMENT\n SCHEMA\n SCALAR\n OBJECT\n FIELD_DEFINITION\n ARGUMENT_DEFINITION\n INTERFACE\n UNION\n ENUM\n ENUM_VALUE\n INPUT_OBJECT\n INPUT_FIELD_DEFINITION\n}\n\ntype IntAggregate implements FieldValue {\n value: Int\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n grouping: IntValue\n max: IntValue\n min: IntValue\n sum: LongValue\n}\n\ntype ListOrder {\n fieldApiName: String!\n sortDirection: ResultOrder\n}\n\ntype RecordAggregate @generic {\n ApiName: String!\n BooleanAggregate: BooleanAggregate @fieldCategory\n CurrencyAggregate: CurrencyAggregate @fieldCategory\n DateAggregate: DateAggregate @fieldCategory\n DoubleAggregate: DoubleAggregate @fieldCategory\n EmailAggregate: EmailAggregate @fieldCategory\n IDAggregate: IDAggregate @fieldCategory\n IntAggregate: IntAggregate @fieldCategory\n LatitudeAggregate: LatitudeAggregate @fieldCategory\n LongitudeAggregate: LongitudeAggregate @fieldCategory\n LongAggregate: LongAggregate @fieldCategory\n PercentAggregate: PercentAggregate @fieldCategory\n PhoneNumberAggregate: PhoneNumberAggregate @fieldCategory\n PicklistAggregate: PicklistAggregate @fieldCategory\n StringAggregate: StringAggregate @fieldCategory\n TextAreaAggregate: TextAreaAggregate @fieldCategory\n TimeAggregate: TimeAggregate @fieldCategory\n UrlAggregate: UrlAggregate @fieldCategory\n}\n\ntype JSONValue implements FieldValue {\n value: JSON\n displayValue: String\n}\n\ntype EmailValue implements FieldValue {\n value: Email\n displayValue: String\n}\n\ntype Setup__Setup {\n query: Setup__SetupQuery!\n}\n\nenum AggregateOrderByStringFunction {\n COUNT\n COUNT_DISTINCT\n MAX\n MIN\n}\n\ntype LongValue implements FieldValue {\n value: Long\n displayValue: String\n format: String\n}\n\ninput DateFunctionInput {\n value: LongOperators\n convertTimezoneValue: LongOperators\n}\n\n# Mutations aren't supported yet.\n#type Mutation {\n# uiapi(input: UIAPIMutationsInput): UIAPIMutations!\n#}\n\ntype DependentField {\n controllingField: String!\n dependentFields: [String]!\n}\n\ninput LongTextAreaOperators {\n eq: LongTextArea\n ne: LongTextArea\n like: LongTextArea\n lt: LongTextArea\n gt: LongTextArea\n lte: LongTextArea\n gte: LongTextArea\n in: [LongTextArea]\n nin: [LongTextArea]\n}\n\nenum __TypeKind {\n SCALAR\n OBJECT\n INTERFACE\n UNION\n ENUM\n INPUT_OBJECT\n LIST\n NON_NULL\n}\n\ntype Setup__SetupConnection @generic {\n edges: [Setup__SetupEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n pageResultCount: Int!\n}\n\ntype PercentValue implements FieldValue {\n value: Percent\n displayValue: String\n format: String\n}\n\ninput DateTimeOperators {\n eq: DateTimeInput\n ne: DateTimeInput\n lt: DateTimeInput\n gt: DateTimeInput\n lte: DateTimeInput\n gte: DateTimeInput\n in: [DateTimeInput]\n nin: [DateTimeInput]\n DAY_IN_WEEK: DateFunctionInput\n DAY_IN_MONTH: DateFunctionInput\n DAY_IN_YEAR: DateFunctionInput\n WEEK_IN_MONTH: DateFunctionInput\n WEEK_IN_YEAR: DateFunctionInput\n CALENDAR_MONTH: DateFunctionInput\n CALENDAR_QUARTER: DateFunctionInput\n CALENDAR_YEAR: DateFunctionInput\n FISCAL_MONTH: DateFunctionInput\n FISCAL_QUARTER: DateFunctionInput\n FISCAL_YEAR: DateFunctionInput\n DAY_ONLY: DateTimeFunctionInput\n HOUR_IN_DAY: DateFunctionInput\n}\n\ninput NoFunctionAggregateOrderByClause {\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype BooleanAggregate implements FieldValue {\n value: Boolean\n displayValue: String\n grouping: IntValue\n}\n\ntype RecordQueryAggregate {\n # RecordScope is replaced with String\n recordQueryAggregate(first: Int, after: String, where: RecordFilter, orderBy: AggregateOrderBy, scope: String, groupBy: RecordGroupBy, upperBound: Int): RecordAggregateConnection @fieldCategory\n}\n\ntype RecordConnection @generic {\n edges: [RecordEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n pageResultCount: Int!\n}\n\ntype FilteredLookupInfo {\n controllingFields: [String]!\n dependent: Boolean!\n optionalFilter: Boolean!\n}\n\ninput PhoneNumberOperators {\n eq: PhoneNumber\n ne: PhoneNumber\n like: PhoneNumber\n lt: PhoneNumber\n gt: PhoneNumber\n lte: PhoneNumber\n gte: PhoneNumber\n in: [PhoneNumber]\n nin: [PhoneNumber]\n}\n\ntype ObjectInfo {\n ApiName: String!\n childRelationships: [ChildRelationship]!\n createable: Boolean!\n custom: Boolean!\n defaultRecordTypeId: ID\n deletable: Boolean!\n dependentFields: [DependentField]!\n feedEnabled: Boolean!\n fields: [Field]!\n keyPrefix: String\n label: String\n labelPlural: String\n layoutable: Boolean!\n mruEnabled: Boolean!\n nameFields: [String]!\n queryable: Boolean!\n recordTypeInfos: [RecordTypeInfo]!\n searchable: Boolean!\n themeInfo: ThemeInfo\n updateable: Boolean!\n locale: String\n}\n\ninput LongitudeOperators {\n eq: Longitude\n ne: Longitude\n lt: Longitude\n gt: Longitude\n lte: Longitude\n gte: Longitude\n in: [Longitude]\n nin: [Longitude]\n}\n\ninput RecordCreateRepresentation @generic {\n Int: Int @fieldCategory\n String: String @fieldCategory\n Boolean: Boolean @fieldCategory\n ID: IdOrRef @fieldCategory\n DateTime: DateTime @fieldCategory\n Time: Time @fieldCategory\n Date: Date @fieldCategory\n TextArea: TextArea @fieldCategory\n LongTextArea: LongTextArea @fieldCategory\n RichTextArea: RichTextArea @fieldCategory\n PhoneNumber: PhoneNumber @fieldCategory\n Email: Email @fieldCategory\n Url: Url @fieldCategory\n EncryptedString: EncryptedString @fieldCategory\n Currency: Currency @fieldCategory\n Longitude: Longitude @fieldCategory\n Latitude: Latitude @fieldCategory\n Picklist: Picklist @fieldCategory\n MultiPicklist: MultiPicklist @fieldCategory\n Long: Long @fieldCategory\n Double: Double @fieldCategory\n Percent: Percent @fieldCategory\n Base64: Base64 @fieldCategory\n JSON: JSON @fieldCategory\n}\n\ntype Field {\n ApiName: String!\n calculated: Boolean!\n compound: Boolean!\n compoundComponentName: String\n compoundFieldName: String\n controllerName: String\n controllingFields: [String]!\n createable: Boolean!\n custom: Boolean!\n dataType: DataType\n extraTypeInfo: FieldExtraTypeInfo\n filterable: Boolean!\n filteredLookupInfo: FilteredLookupInfo\n highScaleNumber: Boolean!\n htmlFormatted: Boolean!\n inlineHelpText: String\n label: String\n nameField: Boolean!\n polymorphicForeignKey: Boolean!\n precision: Int\n reference: Boolean!\n referenceTargetField: String\n referenceToInfos: [ReferenceToInfo]!\n relationshipName: String\n required: Boolean!\n scale: Int\n searchPrefilterable: Boolean\n sortable: Boolean!\n updateable: Boolean!\n}\n\nenum FieldExtraTypeInfo {\n IMAGE_URL\n EXTERNAL_LOOKUP\n INDIRECT_LOOKUP\n PERSONNAME\n SWITCHABLE_PERSONNAME\n PLAINTEXTAREA\n RICHTEXTAREA\n}\n\ntype RateLimit {\n cost: Long\n limit: Long\n remaining: Long\n resetAt: DateTime\n}\n\ninput DateRange {\n last_n_days: Int\n next_n_days: Int\n last_n_weeks: Int\n next_n_weeks: Int\n last_n_months: Int\n next_n_months: Int\n last_n_quarters: Int\n next_n_quarters: Int\n last_n_fiscal_quarters: Int\n next_n_fiscal_quarters: Int\n last_n_years: Int\n next_n_years: Int\n last_n_fiscal_years: Int\n next_n_fiscal_years: Int\n n_days_ago: Int\n n_weeks_ago: Int\n n_months_ago: Int\n n_quarters_ago: Int\n n_years_ago: Int\n n_fiscal_quarters_ago: Int\n n_fiscal_years_ago: Int\n}\n\ntype UIAPIMutations {\n recordCreate(input: RecordCreateInput!): RecordCreatePayload @fieldCategory\n recordDelete(input: RecordDeleteInput!): RecordDeletePayload @fieldCategory\n recordUpdate(input: RecordUpdateInput!): RecordUpdatePayload @fieldCategory\n}\n\ninput DateTimeFunctionInput {\n value: DatePrimitiveOperators\n convertTimezoneValue: DatePrimitiveOperators\n}\n\ntype Base64Value implements FieldValue {\n value: Base64\n displayValue: String\n}\n\ninput IntegerOperators {\n eq: Int\n ne: Int\n lt: Int\n gt: Int\n lte: Int\n gte: Int\n in: [Int]\n nin: [Int]\n}\n\ntype EncryptedStringValue implements FieldValue {\n value: EncryptedString\n displayValue: String\n}\n\ninterface Record {\n Id: ID!\n ApiName: String!\n WeakEtag: Long!\n DisplayValue: String\n LastModifiedById: IDValue\n LastModifiedDate: DateTimeValue\n SystemModstamp: DateTimeValue\n RecordTypeId(fallback: Boolean): IDValue\n}\n\ninput PolymorphicParentRelationshipRecordFilter @generic {\n RecordFilter: RecordFilter @fieldCategory\n}\n\ninput AggregateOrderByNumberClause {\n function: AggregateOrderByNumberFunction\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype __Schema {\n types: [__Type!]!\n queryType: __Type!\n mutationType: __Type\n directives: [__Directive!]!\n subscriptionType: __Type\n}\n\ninput Setup__SetupPolymorphicParentRelationshipRecordFilter @generic {\n Setup__SetupFilter: Setup__SetupFilter @fieldCategory\n}\n\ntype CompoundField @generic {\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n}\n\ninput RecordUpdateInput @generic {\n Id: IdOrRef!\n record: RecordUpdateRepresentation! @fieldCategory\n}\n\ninput DateTimeInput {\n value: DateTime\n literal: DateLiteral\n range: DateRange\n}\n\ntype ChildRelationship {\n childObjectApiName: String!\n fieldName: String\n junctionIdListNames: [String]!\n junctionReferenceTo: [String]!\n relationshipName: String\n objectInfo: ObjectInfo\n}\n\ntype RecordResult @generic {\n aggregate: RecordAggregate\n}\n\ntype PageInfo {\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n startCursor: String\n endCursor: String\n}\n\ntype CurrencyValue implements FieldValue {\n value: Currency\n displayValue: String\n format: String\n}\n\ninput DateInput {\n value: Date\n literal: DateLiteral\n range: DateRange\n}\n\ninput RecordGroupBy @generic {\n groupableField: GroupByClause @fieldCategory\n groupableDateField: GroupByDateFunction @fieldCategory\n groupableParentRelationship: RecordGroupBy @fieldCategory\n groupablePolymorphicParentRelationship: PolymorphicParentRelationshipGroupBy @fieldCategory\n type: GroupByType = GROUP_BY\n}\n\ntype DateFunctionAggregation {\n value: Long\n format: String\n}\n\ntype RecordQuery {\n # scope should be type RecordScope but that's empty enum.\n recordQuery(first: Int, after: String, where: RecordFilter, orderBy: RecordOrderBy, scope: String, upperBound: Int): RecordConnection @fieldCategory\n}\n\ndirective @generic on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT\ndirective @fieldCategory on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE\ndirective @category(name: String!) on FIELD";
|
|
54056
54067
|
|
|
@@ -56152,7 +56163,7 @@
|
|
|
56152
56163
|
*/
|
|
56153
56164
|
|
|
56154
56165
|
|
|
56155
|
-
const { keys: keys$3$1, values: values$1, create: create$3$1, assign: assign$3, freeze: freeze$3 } = Object;
|
|
56166
|
+
const { keys: keys$3$1, values: values$1, create: create$3$1, assign: assign$3, freeze: freeze$3, entries: entries$3 } = Object;
|
|
56156
56167
|
const { stringify: stringify$3, parse: parse$3 } = JSON;
|
|
56157
56168
|
const { shift } = Array.prototype;
|
|
56158
56169
|
const { isArray: isArray$1$1, from: from$1 } = Array;
|
|
@@ -57559,7 +57570,7 @@
|
|
|
57559
57570
|
}
|
|
57560
57571
|
return keyBuilder$26(luvio, { recordId });
|
|
57561
57572
|
}
|
|
57562
|
-
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore) {
|
|
57573
|
+
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
|
|
57563
57574
|
const getEntries = function (entries, segment) {
|
|
57564
57575
|
// this HOF only inspects records in the default segment
|
|
57565
57576
|
if (segment !== DefaultDurableSegment) {
|
|
@@ -57621,7 +57632,10 @@
|
|
|
57621
57632
|
});
|
|
57622
57633
|
};
|
|
57623
57634
|
const denormalizeEntries = function (entries) {
|
|
57635
|
+
let hasEntries = false;
|
|
57636
|
+
let hasMetadata = false;
|
|
57624
57637
|
const putEntries = create$3$1(null);
|
|
57638
|
+
const putMetadata = create$3$1(null);
|
|
57625
57639
|
const keys$1 = keys$3$1(entries);
|
|
57626
57640
|
const putRecords = {};
|
|
57627
57641
|
const putRecordViews = {};
|
|
@@ -57664,6 +57678,7 @@
|
|
|
57664
57678
|
putRecords[recordId] = true;
|
|
57665
57679
|
}
|
|
57666
57680
|
if (isStoreRecordError(record)) {
|
|
57681
|
+
hasEntries = true;
|
|
57667
57682
|
putEntries[recordKey] = value;
|
|
57668
57683
|
continue;
|
|
57669
57684
|
}
|
|
@@ -57676,24 +57691,43 @@
|
|
|
57676
57691
|
}
|
|
57677
57692
|
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
57678
57693
|
if (denormalizedRecord !== undefined) {
|
|
57694
|
+
hasEntries = true;
|
|
57679
57695
|
putEntries[recordKey] = {
|
|
57680
57696
|
data: denormalizedRecord,
|
|
57681
57697
|
metadata,
|
|
57682
57698
|
};
|
|
57699
|
+
// if undefined then it is pending
|
|
57700
|
+
// we should still update metadata on pending records
|
|
57701
|
+
}
|
|
57702
|
+
else {
|
|
57703
|
+
hasMetadata = true;
|
|
57704
|
+
metadata.expirationTimestamp = metadata.ingestionTimestamp;
|
|
57705
|
+
putMetadata[recordKey] = {
|
|
57706
|
+
metadata,
|
|
57707
|
+
};
|
|
57683
57708
|
}
|
|
57684
57709
|
}
|
|
57685
57710
|
else {
|
|
57711
|
+
hasEntries = true;
|
|
57686
57712
|
putEntries[key] = value;
|
|
57687
57713
|
}
|
|
57688
57714
|
}
|
|
57689
|
-
return putEntries;
|
|
57715
|
+
return { putEntries, putMetadata, hasEntries, hasMetadata };
|
|
57690
57716
|
};
|
|
57691
57717
|
const setEntries = function (entries, segment) {
|
|
57692
57718
|
if (segment !== DefaultDurableSegment) {
|
|
57693
57719
|
return durableStore.setEntries(entries, segment);
|
|
57694
57720
|
}
|
|
57695
|
-
const putEntries = denormalizeEntries(entries);
|
|
57696
|
-
|
|
57721
|
+
const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
|
|
57722
|
+
const promises = [
|
|
57723
|
+
hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
|
|
57724
|
+
];
|
|
57725
|
+
if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
|
|
57726
|
+
promises.push(hasMetadata && sqlStore !== undefined
|
|
57727
|
+
? durableStore.setMetadata(putMetadata, segment)
|
|
57728
|
+
: undefined);
|
|
57729
|
+
}
|
|
57730
|
+
return Promise.all(promises).then(() => { });
|
|
57697
57731
|
};
|
|
57698
57732
|
const batchOperations = function (operations) {
|
|
57699
57733
|
const operationsWithDenormedRecords = [];
|
|
@@ -57710,10 +57744,20 @@
|
|
|
57710
57744
|
// this is determined by the plugin supporting update batch calls before it gets to this HOF.
|
|
57711
57745
|
// so we only need to check one entry to confirm this for performance
|
|
57712
57746
|
if (firstEntry.data !== undefined) {
|
|
57747
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
57713
57748
|
operationsWithDenormedRecords.push({
|
|
57714
57749
|
...operation,
|
|
57715
|
-
entries:
|
|
57750
|
+
entries: putEntries,
|
|
57716
57751
|
});
|
|
57752
|
+
if (hasMetadata &&
|
|
57753
|
+
sqlStore !== undefined &&
|
|
57754
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
57755
|
+
operationsWithDenormedRecords.push({
|
|
57756
|
+
...operation,
|
|
57757
|
+
entries: putMetadata,
|
|
57758
|
+
type: 'setMetadata',
|
|
57759
|
+
});
|
|
57760
|
+
}
|
|
57717
57761
|
}
|
|
57718
57762
|
else {
|
|
57719
57763
|
operationsWithDenormedRecords.push(operation);
|
|
@@ -57725,10 +57769,20 @@
|
|
|
57725
57769
|
operationsWithDenormedRecords.push(operation);
|
|
57726
57770
|
continue;
|
|
57727
57771
|
}
|
|
57772
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
57728
57773
|
operationsWithDenormedRecords.push({
|
|
57729
57774
|
...operation,
|
|
57730
|
-
entries:
|
|
57775
|
+
entries: putEntries,
|
|
57731
57776
|
});
|
|
57777
|
+
if (hasMetadata &&
|
|
57778
|
+
sqlStore !== undefined &&
|
|
57779
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
57780
|
+
operationsWithDenormedRecords.push({
|
|
57781
|
+
...operation,
|
|
57782
|
+
entries: putMetadata,
|
|
57783
|
+
type: 'setMetadata',
|
|
57784
|
+
});
|
|
57785
|
+
}
|
|
57732
57786
|
}
|
|
57733
57787
|
return durableStore.batchOperations(operationsWithDenormedRecords);
|
|
57734
57788
|
};
|
|
@@ -60710,6 +60764,9 @@
|
|
|
60710
60764
|
isEvalSupported() {
|
|
60711
60765
|
return true;
|
|
60712
60766
|
}
|
|
60767
|
+
isBatchUpdateSupported() {
|
|
60768
|
+
return this.supportsBatchUpdates;
|
|
60769
|
+
}
|
|
60713
60770
|
query(sql, params) {
|
|
60714
60771
|
return new Promise((resolve, reject) => {
|
|
60715
60772
|
this.plugin.query(sql, params, (result) => {
|
|
@@ -62395,7 +62452,7 @@
|
|
|
62395
62452
|
let getIngestRecords;
|
|
62396
62453
|
let getIngestMetadata;
|
|
62397
62454
|
let getIngestStore;
|
|
62398
|
-
const recordDenormingStore = makeRecordDenormalizingDurableStore(lazyLuvio, lazyBaseDurableStore, () => (getIngestRecords !== undefined ? getIngestRecords() : {}), () => (getIngestMetadata !== undefined ? getIngestMetadata() : {}), () => (getIngestStore !== undefined ? getIngestStore() : undefined));
|
|
62455
|
+
const recordDenormingStore = makeRecordDenormalizingDurableStore(lazyLuvio, lazyBaseDurableStore, () => (getIngestRecords !== undefined ? getIngestRecords() : {}), () => (getIngestMetadata !== undefined ? getIngestMetadata() : {}), () => (getIngestStore !== undefined ? getIngestStore() : undefined), lazyBaseDurableStore);
|
|
62399
62456
|
const baseEnv = new Environment(store, lazyNetworkAdapter);
|
|
62400
62457
|
const gqlEnv = makeEnvironmentGraphqlAware(baseEnv);
|
|
62401
62458
|
const durableEnv = makeDurable(gqlEnv, {
|
|
@@ -62505,7 +62562,7 @@
|
|
|
62505
62562
|
id: '@salesforce/lds-network-adapter',
|
|
62506
62563
|
instrument: instrument$2,
|
|
62507
62564
|
});
|
|
62508
|
-
// version: 1.
|
|
62565
|
+
// version: 1.293.0-5fab18553
|
|
62509
62566
|
|
|
62510
62567
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62511
62568
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -82569,7 +82626,7 @@
|
|
|
82569
82626
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82570
82627
|
instrument: instrument$1,
|
|
82571
82628
|
});
|
|
82572
|
-
// version: 1.
|
|
82629
|
+
// version: 1.293.0-c036bce5d
|
|
82573
82630
|
|
|
82574
82631
|
// On core the unstable adapters are re-exported with different names,
|
|
82575
82632
|
// we want to match them here.
|
|
@@ -84825,7 +84882,7 @@
|
|
|
84825
84882
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84826
84883
|
graphQLImperative = ldsAdapter;
|
|
84827
84884
|
});
|
|
84828
|
-
// version: 1.
|
|
84885
|
+
// version: 1.293.0-c036bce5d
|
|
84829
84886
|
|
|
84830
84887
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84831
84888
|
__proto__: null,
|
|
@@ -85563,7 +85620,7 @@
|
|
|
85563
85620
|
function register(r) {
|
|
85564
85621
|
callbacks$1.forEach((callback) => callback(r));
|
|
85565
85622
|
}
|
|
85566
|
-
// version: 1.
|
|
85623
|
+
// version: 1.293.0-5fab18553
|
|
85567
85624
|
|
|
85568
85625
|
/**
|
|
85569
85626
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -90544,4 +90601,4 @@
|
|
|
90544
90601
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
90545
90602
|
|
|
90546
90603
|
}));
|
|
90547
|
-
// version: 1.
|
|
90604
|
+
// version: 1.293.0-5fab18553
|