@salesforce/lds-runtime-mobile 1.318.0 → 1.320.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/main.js +6823 -7054
- package/dist/types/NimbusDraftQueue.d.ts +1 -1
- package/dist/types/{draftsAdapters → drafts}/AbstractResourceRequestActionHandler.d.ts +21 -22
- package/dist/types/drafts/UiApiDraftRecordService.d.ts +43 -0
- package/{sfdc/types/draftsAdapters/ContentDocumentCompositeRepresentation → dist/types/drafts/contentDocument}/ContentDocumentCompositeRepresentationActionHandler.d.ts +13 -13
- package/{sfdc/types/draftsAdapters/ContentDocumentCompositeRepresentation → dist/types/drafts/contentDocument}/draftAwareAdapters/createContentDocumentAndVersion/index.d.ts +2 -2
- package/dist/types/drafts/index.d.ts +14 -0
- package/dist/types/{draftsAdapters/QuickActionExecutionRepresentation → drafts/quickActions}/QuickActionExecutionRepresentationHandler.d.ts +8 -13
- package/dist/types/drafts/quickActions/UpdateRecordQuickActionExecutionRepresentationHandler.d.ts +29 -0
- package/dist/types/{draftsAdapters/QuickActionExecutionRepresentation → drafts/quickActions}/draftAwareAdapters/performQuickAction.d.ts +1 -1
- package/{sfdc/types/draftsAdapters/QuickActionExecutionRepresentation → dist/types/drafts/quickActions}/draftAwareAdapters/updateRecordPerformQuickAction.d.ts +1 -1
- package/dist/types/drafts/records/actionHandlers/RecordEffectingHandler.d.ts +6 -0
- package/dist/types/drafts/records/actionHandlers/UiApiRecordActionHandler.d.ts +63 -0
- package/{sfdc/types/draftsAdapters/RecordRepresentation → dist/types/drafts/records}/draftAwareAdapters/createRecord.d.ts +2 -2
- package/{sfdc/types/draftsAdapters/RecordRepresentation → dist/types/drafts/records}/draftAwareAdapters/updateRecord.d.ts +2 -2
- package/dist/types/{draftsAdapters/RecordRepresentation → drafts/records}/environment/getRecordDraftEnvironment.d.ts +2 -2
- package/dist/types/{draftsAdapters/RecordRepresentation → drafts/records}/environment/getRecordsDraftEnvironment.d.ts +2 -2
- package/{sfdc/types/draftsAdapters/RecordRepresentation → dist/types/drafts/records}/environment/makeEnvironmentUiApiRecordDraftAware.d.ts +4 -4
- package/{sfdc/types/draftsAdapters/RecordRepresentation → dist/types/drafts/records}/records.d.ts +1 -1
- package/dist/types/drafts/sideEffects/SideEffectHandler.d.ts +14 -0
- package/dist/types/{sideEffects → drafts/sideEffects}/SideEffectService.d.ts +6 -6
- package/dist/types/drafts/utils/durableStore.d.ts +3 -0
- package/dist/types/durableStore/DurableRecordStore.d.ts +17 -0
- package/dist/types/durableStore/NimbusSqliteStore/tables/index.d.ts +0 -1
- package/dist/types/graphql/adapter/draftAwareGraphQLAdapterFactory.d.ts +6 -0
- package/dist/types/graphql/adapter/environmentAwareGraphQLBatchAdapterFactory.d.ts +4 -0
- package/dist/types/graphql/adapter/graphqlEvalAdapterFactory.d.ts +5 -0
- package/dist/types/graphql/adapter/utils.d.ts +2 -0
- package/dist/types/graphql/adapterFactory.d.ts +3 -0
- package/dist/types/graphql/array.d.ts +2 -0
- package/dist/types/graphql/base64.d.ts +4 -0
- package/dist/types/graphql/constants.d.ts +3 -0
- package/dist/types/graphql/context.d.ts +19 -0
- package/dist/types/graphql/dataloader.d.ts +26 -0
- package/dist/types/graphql/dateLiteral.d.ts +28 -0
- package/dist/types/graphql/dateTimePredication.d.ts +33 -0
- package/dist/types/graphql/evaluate.d.ts +12 -0
- package/dist/types/graphql/events.d.ts +37 -0
- package/dist/types/graphql/filterParser.d.ts +6 -0
- package/dist/types/graphql/index.d.ts +9 -0
- package/dist/types/graphql/instrumentLimits.d.ts +8 -0
- package/dist/types/graphql/language.d.ts +33 -0
- package/dist/types/graphql/lib.d.ts +52 -0
- package/dist/types/graphql/limit.d.ts +9 -0
- package/dist/types/graphql/orderByParser.d.ts +10 -0
- package/dist/types/graphql/pagination.d.ts +10 -0
- package/dist/types/graphql/query.d.ts +56 -0
- package/dist/types/graphql/recordLoader.d.ts +4 -0
- package/dist/types/graphql/resolvers/basic.d.ts +1 -0
- package/dist/types/graphql/resolvers/connection.d.ts +31 -0
- package/dist/types/graphql/resolvers/index.d.ts +8 -0
- package/dist/types/graphql/resolvers/pagination.d.ts +29 -0
- package/dist/types/graphql/schema.d.ts +51 -0
- package/dist/types/graphql/scopeParser.d.ts +4 -0
- package/dist/types/graphql/snapshot.d.ts +26 -0
- package/dist/types/graphql/staleRecords/batchingStaleRecordsAdapter.d.ts +10 -0
- package/dist/types/graphql/syntheticFields.d.ts +10 -0
- package/dist/types/graphql/typeguards.d.ts +19 -0
- package/dist/types/instrumentation/instrumentPrimingSession.d.ts +1 -1
- package/dist/types/instrumentation/metrics.d.ts +1 -1
- package/dist/types/main.d.ts +1 -0
- package/dist/types/priming/ConflictPool.d.ts +31 -0
- package/dist/types/priming/Emitter.d.ts +16 -0
- package/dist/types/priming/LdsPrimingRecordRefresher.d.ts +1 -1
- package/dist/types/priming/LdsRecordRefresher.d.ts +17 -0
- package/dist/types/priming/NimbusPrimingNetworkAdapter.d.ts +4 -4
- package/dist/types/priming/ObjectInfoLoader.d.ts +10 -0
- package/dist/types/priming/PrimingNetworkAdapter.d.ts +5 -0
- package/dist/types/priming/PrimingNetworkError.d.ts +5 -0
- package/dist/types/priming/PrimingSession.d.ts +67 -0
- package/dist/types/priming/PrimingStore.d.ts +27 -0
- package/dist/types/priming/RecordIngestor.d.ts +14 -0
- package/dist/types/priming/SqlitePrimingStore.d.ts +1 -1
- package/dist/types/priming/index.d.ts +10 -0
- package/dist/types/priming/metadata/MetadataHandler.d.ts +49 -0
- package/dist/types/priming/primingSessionFactory.d.ts +1 -1
- package/dist/types/priming/recordLoaders/NetworkRecordLoader.d.ts +16 -0
- package/dist/types/priming/recordLoaders/RecordLoader.d.ts +19 -0
- package/dist/types/priming/recordLoaders/RecordLoaderGraphQL.d.ts +37 -0
- package/dist/types/priming/recordLoaders/RecordLoaderGraphQLBatch.d.ts +11 -0
- package/dist/types/priming/recordLoaders/RecordLoaderSOQLComposite.d.ts +14 -0
- package/dist/types/priming/recordLoaders/SoqlRecordConverter.d.ts +32 -0
- package/dist/types/priming/recordLoaders/api.d.ts +2 -0
- package/dist/types/priming/recordLoaders/index.d.ts +4 -0
- package/dist/types/priming/typedBatch.d.ts +3 -0
- package/dist/types/priming/utils/merge.d.ts +31 -0
- package/dist/types/runtime.d.ts +1 -1
- package/package.json +14 -16
- package/sfdc/main.js +6823 -7054
- package/sfdc/types/NimbusDraftQueue.d.ts +1 -1
- package/sfdc/types/{draftsAdapters → drafts}/AbstractResourceRequestActionHandler.d.ts +21 -22
- package/sfdc/types/drafts/UiApiDraftRecordService.d.ts +43 -0
- package/{dist/types/draftsAdapters/ContentDocumentCompositeRepresentation → sfdc/types/drafts/contentDocument}/ContentDocumentCompositeRepresentationActionHandler.d.ts +13 -13
- package/{dist/types/draftsAdapters/ContentDocumentCompositeRepresentation → sfdc/types/drafts/contentDocument}/draftAwareAdapters/createContentDocumentAndVersion/index.d.ts +2 -2
- package/sfdc/types/drafts/index.d.ts +14 -0
- package/sfdc/types/{draftsAdapters/QuickActionExecutionRepresentation → drafts/quickActions}/QuickActionExecutionRepresentationHandler.d.ts +8 -13
- package/sfdc/types/drafts/quickActions/UpdateRecordQuickActionExecutionRepresentationHandler.d.ts +29 -0
- package/sfdc/types/{draftsAdapters/QuickActionExecutionRepresentation → drafts/quickActions}/draftAwareAdapters/performQuickAction.d.ts +1 -1
- package/{dist/types/draftsAdapters/QuickActionExecutionRepresentation → sfdc/types/drafts/quickActions}/draftAwareAdapters/updateRecordPerformQuickAction.d.ts +1 -1
- package/sfdc/types/drafts/records/actionHandlers/RecordEffectingHandler.d.ts +6 -0
- package/sfdc/types/drafts/records/actionHandlers/UiApiRecordActionHandler.d.ts +63 -0
- package/{dist/types/draftsAdapters/RecordRepresentation → sfdc/types/drafts/records}/draftAwareAdapters/createRecord.d.ts +2 -2
- package/{dist/types/draftsAdapters/RecordRepresentation → sfdc/types/drafts/records}/draftAwareAdapters/updateRecord.d.ts +2 -2
- package/sfdc/types/{draftsAdapters/RecordRepresentation → drafts/records}/environment/getRecordDraftEnvironment.d.ts +2 -2
- package/sfdc/types/{draftsAdapters/RecordRepresentation → drafts/records}/environment/getRecordsDraftEnvironment.d.ts +2 -2
- package/{dist/types/draftsAdapters/RecordRepresentation → sfdc/types/drafts/records}/environment/makeEnvironmentUiApiRecordDraftAware.d.ts +4 -4
- package/{dist/types/draftsAdapters/RecordRepresentation → sfdc/types/drafts/records}/records.d.ts +1 -1
- package/sfdc/types/drafts/sideEffects/SideEffectHandler.d.ts +14 -0
- package/sfdc/types/{sideEffects → drafts/sideEffects}/SideEffectService.d.ts +6 -6
- package/sfdc/types/drafts/utils/durableStore.d.ts +3 -0
- package/sfdc/types/durableStore/DurableRecordStore.d.ts +17 -0
- package/sfdc/types/durableStore/NimbusSqliteStore/tables/index.d.ts +0 -1
- package/sfdc/types/graphql/adapter/draftAwareGraphQLAdapterFactory.d.ts +6 -0
- package/sfdc/types/graphql/adapter/environmentAwareGraphQLBatchAdapterFactory.d.ts +4 -0
- package/sfdc/types/graphql/adapter/graphqlEvalAdapterFactory.d.ts +5 -0
- package/sfdc/types/graphql/adapter/utils.d.ts +2 -0
- package/sfdc/types/graphql/adapterFactory.d.ts +3 -0
- package/sfdc/types/graphql/array.d.ts +2 -0
- package/sfdc/types/graphql/base64.d.ts +4 -0
- package/sfdc/types/graphql/constants.d.ts +3 -0
- package/sfdc/types/graphql/context.d.ts +19 -0
- package/sfdc/types/graphql/dataloader.d.ts +26 -0
- package/sfdc/types/graphql/dateLiteral.d.ts +28 -0
- package/sfdc/types/graphql/dateTimePredication.d.ts +33 -0
- package/sfdc/types/graphql/evaluate.d.ts +12 -0
- package/sfdc/types/graphql/events.d.ts +37 -0
- package/sfdc/types/graphql/filterParser.d.ts +6 -0
- package/sfdc/types/graphql/index.d.ts +9 -0
- package/sfdc/types/graphql/instrumentLimits.d.ts +8 -0
- package/sfdc/types/graphql/language.d.ts +33 -0
- package/sfdc/types/graphql/lib.d.ts +52 -0
- package/sfdc/types/graphql/limit.d.ts +9 -0
- package/sfdc/types/graphql/orderByParser.d.ts +10 -0
- package/sfdc/types/graphql/pagination.d.ts +10 -0
- package/sfdc/types/graphql/query.d.ts +56 -0
- package/sfdc/types/graphql/recordLoader.d.ts +4 -0
- package/sfdc/types/graphql/resolvers/basic.d.ts +1 -0
- package/sfdc/types/graphql/resolvers/connection.d.ts +31 -0
- package/sfdc/types/graphql/resolvers/index.d.ts +8 -0
- package/sfdc/types/graphql/resolvers/pagination.d.ts +29 -0
- package/sfdc/types/graphql/schema.d.ts +51 -0
- package/sfdc/types/graphql/scopeParser.d.ts +4 -0
- package/sfdc/types/graphql/snapshot.d.ts +26 -0
- package/sfdc/types/graphql/staleRecords/batchingStaleRecordsAdapter.d.ts +10 -0
- package/sfdc/types/graphql/syntheticFields.d.ts +10 -0
- package/sfdc/types/graphql/typeguards.d.ts +19 -0
- package/sfdc/types/instrumentation/instrumentPrimingSession.d.ts +1 -1
- package/sfdc/types/instrumentation/metrics.d.ts +1 -1
- package/sfdc/types/main.d.ts +1 -0
- package/sfdc/types/priming/ConflictPool.d.ts +31 -0
- package/sfdc/types/priming/Emitter.d.ts +16 -0
- package/sfdc/types/priming/LdsPrimingRecordRefresher.d.ts +1 -1
- package/sfdc/types/priming/LdsRecordRefresher.d.ts +17 -0
- package/sfdc/types/priming/NimbusPrimingNetworkAdapter.d.ts +4 -4
- package/sfdc/types/priming/ObjectInfoLoader.d.ts +10 -0
- package/sfdc/types/priming/PrimingNetworkAdapter.d.ts +5 -0
- package/sfdc/types/priming/PrimingNetworkError.d.ts +5 -0
- package/sfdc/types/priming/PrimingSession.d.ts +67 -0
- package/sfdc/types/priming/PrimingStore.d.ts +27 -0
- package/sfdc/types/priming/RecordIngestor.d.ts +14 -0
- package/sfdc/types/priming/SqlitePrimingStore.d.ts +1 -1
- package/sfdc/types/priming/index.d.ts +10 -0
- package/sfdc/types/priming/metadata/MetadataHandler.d.ts +49 -0
- package/sfdc/types/priming/primingSessionFactory.d.ts +1 -1
- package/sfdc/types/priming/recordLoaders/NetworkRecordLoader.d.ts +16 -0
- package/sfdc/types/priming/recordLoaders/RecordLoader.d.ts +19 -0
- package/sfdc/types/priming/recordLoaders/RecordLoaderGraphQL.d.ts +37 -0
- package/sfdc/types/priming/recordLoaders/RecordLoaderGraphQLBatch.d.ts +11 -0
- package/sfdc/types/priming/recordLoaders/RecordLoaderSOQLComposite.d.ts +14 -0
- package/sfdc/types/priming/recordLoaders/SoqlRecordConverter.d.ts +32 -0
- package/sfdc/types/priming/recordLoaders/api.d.ts +2 -0
- package/sfdc/types/priming/recordLoaders/index.d.ts +4 -0
- package/sfdc/types/priming/typedBatch.d.ts +3 -0
- package/sfdc/types/priming/utils/merge.d.ts +31 -0
- package/sfdc/types/runtime.d.ts +1 -1
- package/dist/types/draftsAdapters/QuickActionExecutionRepresentation/UpdateRecordQuickActionExecutionRepresentationHandler.d.ts +0 -38
- package/dist/types/draftsAdapters/RecordRepresentation/actionHandlers/RecordEffectingHandler.d.ts +0 -6
- package/dist/types/draftsAdapters/RecordRepresentation/actionHandlers/UiApiRecordActionHandler.d.ts +0 -84
- package/dist/types/draftsAdapters/RecordRepresentation/replayDraftsOnRecord.d.ts +0 -40
- package/dist/types/draftsAdapters/UiApiDraftRecordService.d.ts +0 -57
- package/dist/types/draftsAdapters/index.d.ts +0 -14
- package/dist/types/draftsAdapters/utils/durableStore.d.ts +0 -12
- package/dist/types/durableStore/NimbusSqliteStore/tables/LdsDraftIdMapDataTable.d.ts +0 -5
- package/sfdc/types/draftsAdapters/QuickActionExecutionRepresentation/UpdateRecordQuickActionExecutionRepresentationHandler.d.ts +0 -38
- package/sfdc/types/draftsAdapters/RecordRepresentation/actionHandlers/RecordEffectingHandler.d.ts +0 -6
- package/sfdc/types/draftsAdapters/RecordRepresentation/actionHandlers/UiApiRecordActionHandler.d.ts +0 -84
- package/sfdc/types/draftsAdapters/RecordRepresentation/replayDraftsOnRecord.d.ts +0 -40
- package/sfdc/types/draftsAdapters/UiApiDraftRecordService.d.ts +0 -57
- package/sfdc/types/draftsAdapters/index.d.ts +0 -14
- package/sfdc/types/draftsAdapters/utils/durableStore.d.ts +0 -12
- package/sfdc/types/durableStore/NimbusSqliteStore/tables/LdsDraftIdMapDataTable.d.ts +0 -5
- /package/dist/types/{draftsAdapters → drafts}/IdempotentWrite.d.ts +0 -0
- /package/dist/types/{draftsAdapters/ContentDocumentCompositeRepresentation → drafts/contentDocument}/draftAwareAdapters/createContentDocumentAndVersion/events.d.ts +0 -0
- /package/dist/types/{draftsAdapters/ContentDocumentCompositeRepresentation → drafts/contentDocument}/shared.d.ts +0 -0
- /package/dist/types/{draftsAdapters/RecordRepresentation → drafts/records}/DraftRecordRepresentation.d.ts +0 -0
- /package/dist/types/{draftsAdapters/RecordRepresentation → drafts/records}/draftAwareAdapters/deleteRecord.d.ts +0 -0
- /package/dist/types/{sideEffects → drafts/sideEffects}/SideEffectStore.d.ts +0 -0
- /package/dist/types/{sideEffects → drafts/sideEffects}/index.d.ts +0 -0
- /package/dist/types/{sideEffects → drafts/sideEffects}/sideEffectEnvironment.d.ts +0 -0
- /package/dist/types/{sideEffects → drafts/sideEffects}/sideEffects.d.ts +0 -0
- /package/dist/types/{draftsAdapters → drafts}/utils/adapter.d.ts +0 -0
- /package/dist/types/{draftsAdapters → drafts}/utils/clone.d.ts +0 -0
- /package/dist/types/{draftsAdapters → drafts}/utils/error.d.ts +0 -0
- /package/dist/types/{draftsAdapters → drafts}/utils/language.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters → drafts}/IdempotentWrite.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters/ContentDocumentCompositeRepresentation → drafts/contentDocument}/draftAwareAdapters/createContentDocumentAndVersion/events.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters/ContentDocumentCompositeRepresentation → drafts/contentDocument}/shared.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters/RecordRepresentation → drafts/records}/DraftRecordRepresentation.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters/RecordRepresentation → drafts/records}/draftAwareAdapters/deleteRecord.d.ts +0 -0
- /package/sfdc/types/{sideEffects → drafts/sideEffects}/SideEffectStore.d.ts +0 -0
- /package/sfdc/types/{sideEffects → drafts/sideEffects}/index.d.ts +0 -0
- /package/sfdc/types/{sideEffects → drafts/sideEffects}/sideEffectEnvironment.d.ts +0 -0
- /package/sfdc/types/{sideEffects → drafts/sideEffects}/sideEffects.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters → drafts}/utils/adapter.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters → drafts}/utils/clone.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters → drafts}/utils/error.d.ts +0 -0
- /package/sfdc/types/{draftsAdapters → drafts}/utils/language.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type BatchLoadFn<Key> = (keys: Key[]) => Promise<any>;
|
|
2
|
+
type Batch<Key, Value> = {
|
|
3
|
+
hasDispatched: boolean;
|
|
4
|
+
keys: Array<Key>;
|
|
5
|
+
callbacks: Array<{
|
|
6
|
+
resolve: (value: Value) => void;
|
|
7
|
+
reject: (error: Error) => void;
|
|
8
|
+
}>;
|
|
9
|
+
cacheHits?: Array<() => void>;
|
|
10
|
+
};
|
|
11
|
+
export declare class DataLoader<Key, Value> {
|
|
12
|
+
private _batch;
|
|
13
|
+
private _batchLoadFn;
|
|
14
|
+
private _batchScheduleFn;
|
|
15
|
+
private _cacheMap;
|
|
16
|
+
private _maxBatchSize;
|
|
17
|
+
constructor(batchLoadFn: BatchLoadFn<Key>, options?: {
|
|
18
|
+
maxBatchSize?: number;
|
|
19
|
+
});
|
|
20
|
+
load(key: Key): Promise<Value>;
|
|
21
|
+
getCurrentBatch(): Batch<Key, Value>;
|
|
22
|
+
dispatchBatch(batch: Batch<Key, Value>): void;
|
|
23
|
+
failedDispatch(batch: Batch<Key, Value>, error: Error): void;
|
|
24
|
+
clear(key: Key): void;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Operator, SinglePredicate } from './query';
|
|
2
|
+
import type { FieldRepresentation } from './types';
|
|
3
|
+
export declare enum DateLiteral {
|
|
4
|
+
NEXT_YEAR = "NEXT_YEAR",
|
|
5
|
+
LAST_WEEK = "LAST_WEEK",
|
|
6
|
+
THIS_MONTH = "THIS_MONTH",
|
|
7
|
+
THIS_QUARTER = "THIS_QUARTER",
|
|
8
|
+
LAST_MONTH = "LAST_MONTH",
|
|
9
|
+
LAST_90_DAYS = "LAST_90_DAYS",
|
|
10
|
+
LAST_QUARTER = "LAST_QUARTER",
|
|
11
|
+
THIS_YEAR = "THIS_YEAR",
|
|
12
|
+
NEXT_QUARTER = "NEXT_QUARTER",
|
|
13
|
+
NEXT_MONTH = "NEXT_MONTH",
|
|
14
|
+
TOMORROW = "TOMORROW",
|
|
15
|
+
TODAY = "TODAY",
|
|
16
|
+
LAST_YEAR = "LAST_YEAR",
|
|
17
|
+
NEXT_90_DAYS = "NEXT_90_DAYS",
|
|
18
|
+
THIS_WEEK = "THIS_WEEK",
|
|
19
|
+
YESTERDAY = "YESTERDAY",
|
|
20
|
+
NEXT_WEEK = "NEXT_WEEK"
|
|
21
|
+
}
|
|
22
|
+
export interface DateRange {
|
|
23
|
+
lowerBound: string;
|
|
24
|
+
upperBound: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function quarterStart(date: Date): string;
|
|
27
|
+
export declare function dateLiteralRange(literal: DateLiteral): DateRange;
|
|
28
|
+
export declare function dateLiteral(literal: DateLiteral, op: Operator, field: FieldRepresentation, alias: string): SinglePredicate;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Operator, SinglePredicate } from './query';
|
|
2
|
+
import type { FieldRepresentation } from './types';
|
|
3
|
+
import { DateLiteral } from './dateLiteral';
|
|
4
|
+
export declare enum DateRange {
|
|
5
|
+
last_n_days = "last_n_days",
|
|
6
|
+
next_n_days = "next_n_days",
|
|
7
|
+
n_days_ago = "n_days_ago",
|
|
8
|
+
last_n_weeks = "last_n_weeks",
|
|
9
|
+
next_n_weeks = "next_n_weeks",
|
|
10
|
+
n_weeks_ago = "n_weeks_ago",
|
|
11
|
+
last_n_months = "last_n_months",
|
|
12
|
+
next_n_months = "next_n_months",
|
|
13
|
+
n_months_ago = "n_months_ago",
|
|
14
|
+
last_n_quarters = "last_n_quarters",
|
|
15
|
+
next_n_quarters = "next_n_quarters",
|
|
16
|
+
n_quarters_ago = "n_quarters_ago",
|
|
17
|
+
last_n_fiscal_quarters = "last_n_fiscal_quarters",
|
|
18
|
+
next_n_fiscal_quarters = "next_n_fiscal_quarters",
|
|
19
|
+
last_n_years = "last_n_years",
|
|
20
|
+
next_n_years = "next_n_years",
|
|
21
|
+
n_years_ago = "n_years_ago",
|
|
22
|
+
last_n_fiscal_years = "last_n_fiscal_years",
|
|
23
|
+
next_n_fiscal_years = "next_n_fiscal_years"
|
|
24
|
+
}
|
|
25
|
+
type DateTime = string;
|
|
26
|
+
export type DateTimeInput = {
|
|
27
|
+
value: DateTime | null;
|
|
28
|
+
literal: DateLiteral;
|
|
29
|
+
range: DateRangeInput;
|
|
30
|
+
};
|
|
31
|
+
type DateRangeInput = Record<string, number>;
|
|
32
|
+
export declare function dateTimePredicate(input: Partial<DateTimeInput>, operator: Operator, field: FieldRepresentation, alias: string): SinglePredicate;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CachedGraphQLSchema } from './schema';
|
|
2
|
+
import type { AvailableSnapshot, LuvioAdapterEventObserver } from '@luvio/engine';
|
|
3
|
+
import type { GraphQLConfig, GraphQLRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
import type { SqliteStore } from '@salesforce/lds-store-sql';
|
|
5
|
+
import type { DraftFunctions, LocalEvaluationRuntimeSettings, ObjectInfoMap } from './types';
|
|
6
|
+
type LocalEvaluationResult = {
|
|
7
|
+
result: GraphQLRepresentation;
|
|
8
|
+
seenRecordIds: string[];
|
|
9
|
+
possibleStaleRecordMap: Map<string, string[]>;
|
|
10
|
+
};
|
|
11
|
+
export declare function evaluate(config: GraphQLConfig, observers: LuvioAdapterEventObserver[], settings: LocalEvaluationRuntimeSettings, objectInfos: ObjectInfoMap, store: SqliteStore, snapshot: AvailableSnapshot<GraphQLRepresentation>, cache: CachedGraphQLSchema, draftFunctions?: DraftFunctions, mappedCursors?: Map<string, string>): Promise<LocalEvaluationResult>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CustomAdapterEvent } from '@luvio/engine';
|
|
2
|
+
import type { SqliteType } from '@salesforce/lds-store-sql';
|
|
3
|
+
import type { QueryInstrumentation } from './instrumentLimits';
|
|
4
|
+
export declare const GRAPHQL_EVAL_NAMESPACE = "graphql-eval";
|
|
5
|
+
interface GraphQLEvalStartCustomEventData {
|
|
6
|
+
type: 'graphql-eval-start';
|
|
7
|
+
}
|
|
8
|
+
interface GraphQLEvalPreconditionsMetCustomEventData {
|
|
9
|
+
type: 'graphql-eval-preconditions-met';
|
|
10
|
+
}
|
|
11
|
+
interface GraphQLEvalEndCustomEventData {
|
|
12
|
+
type: 'graphql-eval-end';
|
|
13
|
+
}
|
|
14
|
+
interface GraphQLDbReadCustomEventData {
|
|
15
|
+
type: 'graphql-db-read';
|
|
16
|
+
sql: string;
|
|
17
|
+
bindings: SqliteType[];
|
|
18
|
+
duration: number;
|
|
19
|
+
}
|
|
20
|
+
interface GraphQLEvalPreconditionErrorCustomEventData {
|
|
21
|
+
type: 'graphql-eval-precondition-error';
|
|
22
|
+
error: unknown;
|
|
23
|
+
}
|
|
24
|
+
interface GraphQLCreateSnapshotErrorCustomEventData {
|
|
25
|
+
type: 'graphql-create-snapshot-error';
|
|
26
|
+
error: unknown;
|
|
27
|
+
}
|
|
28
|
+
interface GraphQLQueryInstrumentationCustomEventData {
|
|
29
|
+
type: 'graphql-query-instrumentation';
|
|
30
|
+
data: QueryInstrumentation;
|
|
31
|
+
}
|
|
32
|
+
interface GraphQLSnapshotRefreshUndefined {
|
|
33
|
+
type: 'graphql-luvio-refresh-undefined';
|
|
34
|
+
}
|
|
35
|
+
export type GraphQLEvalCustomAdapterEventData = GraphQLEvalStartCustomEventData | GraphQLEvalPreconditionsMetCustomEventData | GraphQLEvalEndCustomEventData | GraphQLCreateSnapshotErrorCustomEventData | GraphQLEvalPreconditionErrorCustomEventData | GraphQLDbReadCustomEventData | GraphQLQueryInstrumentationCustomEventData | GraphQLSnapshotRefreshUndefined;
|
|
36
|
+
export declare function isGraphQLEvalEvent(customEvent: CustomAdapterEvent<unknown>): customEvent is CustomAdapterEvent<GraphQLEvalCustomAdapterEventData>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DraftFunctions, ObjectInfoMap } from './types';
|
|
2
|
+
import { type Join } from './query';
|
|
3
|
+
import type { PredicateValue, SqlAndBindings } from './query';
|
|
4
|
+
export declare function filterToPredicates(where: any, recordType: string, alias: string, objectInfoMap: ObjectInfoMap, joins: Join[], draftFunctions?: DraftFunctions): PredicateValue[];
|
|
5
|
+
export declare function predicateToSQL(predicate: PredicateValue, defaultAlias: string, isChildNotPredicate?: boolean): SqlAndBindings;
|
|
6
|
+
export declare function predicatesToSqls(predicates: PredicateValue[], defaultAlias: string, isChildNotPredicate?: boolean): SqlAndBindings[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { evaluate } from './evaluate';
|
|
2
|
+
export { injectSyntheticFields, removeSyntheticFields } from './syntheticFields';
|
|
3
|
+
export { DateLiteral } from './dateLiteral';
|
|
4
|
+
export { DateRange } from './dateTimePredication';
|
|
5
|
+
export { createSchemaWithCache, extendSchemaWithObjectInfos, CachedGraphQLSchema } from './schema';
|
|
6
|
+
export type { ObjectInfoService, IDMapper, DraftFunctions } from './types';
|
|
7
|
+
export { draftAwareGraphQLAdapterFactory, environmentAwareGraphQLBatchAdapterFactory, graphqlEvalAdapterFactory, } from './adapterFactory';
|
|
8
|
+
export { isLocalEvalSnapshot } from './snapshot';
|
|
9
|
+
export { isGraphQLEvalEvent } from './events';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DocumentNode } from '@luvio/graphql-parser';
|
|
2
|
+
export type QueryInstrumentation = {
|
|
3
|
+
rootQueryCount: number;
|
|
4
|
+
totalQueryCount: number;
|
|
5
|
+
maxChildRelationships: number;
|
|
6
|
+
requestedRecordCount: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function instrumentLimits(ast: DocumentNode, variables: Record<string, any>): QueryInstrumentation;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const create: {
|
|
2
|
+
(o: object | null): any;
|
|
3
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
4
|
+
}, keys: {
|
|
5
|
+
(o: object): string[];
|
|
6
|
+
(o: {}): string[];
|
|
7
|
+
}, values: {
|
|
8
|
+
<T>(o: {
|
|
9
|
+
[s: string]: T;
|
|
10
|
+
} | ArrayLike<T>): T[];
|
|
11
|
+
(o: {}): any[];
|
|
12
|
+
}, entries: {
|
|
13
|
+
<T>(o: {
|
|
14
|
+
[s: string]: T;
|
|
15
|
+
} | ArrayLike<T>): [string, T][];
|
|
16
|
+
(o: {}): [string, any][];
|
|
17
|
+
}, assign: {
|
|
18
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
19
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
20
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
21
|
+
(target: object, ...sources: any[]): any;
|
|
22
|
+
};
|
|
23
|
+
declare const stringify: {
|
|
24
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
25
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
26
|
+
}, parse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
27
|
+
declare const isArray: (arg: any) => arg is any[], from: {
|
|
28
|
+
<T>(arrayLike: ArrayLike<T>): T[];
|
|
29
|
+
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
30
|
+
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
31
|
+
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
32
|
+
};
|
|
33
|
+
export { create as ObjectCreate, keys as ObjectKeys, values as ObjectValues, entries as ObjectEntries, assign as ObjectAssign, stringify as JSONStringify, parse as JSONParse, isArray as ArrayIsArray, from as ArrayFrom, };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FieldNode, InlineFragmentNode, SelectionNode, ArgumentNode, OperationDefinitionNode, ASTNode } from '@luvio/graphql-parser';
|
|
2
|
+
import type { FieldRepresentation, ObjectInfoRepresentation, RelationshipType } from './types';
|
|
3
|
+
import type { QueryFunction } from './context';
|
|
4
|
+
export declare const POLYMORPHIC_PARENT_RELATIONSHIP = "polymorphicParentRelationship";
|
|
5
|
+
export declare const PARENT_RELATIONSHIP = "parentRelationship";
|
|
6
|
+
export declare const CHILD_RELATIONSHIP = "childRelationship";
|
|
7
|
+
declare const RECORD_QUERY = "recordQuery";
|
|
8
|
+
type CategoryType = typeof POLYMORPHIC_PARENT_RELATIONSHIP | typeof PARENT_RELATIONSHIP | typeof CHILD_RELATIONSHIP | typeof RECORD_QUERY;
|
|
9
|
+
export declare function requestsDraftsField(recordFieldNode: FieldNode): boolean;
|
|
10
|
+
type RecordQueryPathInfo = {
|
|
11
|
+
node: FieldNode | InlineFragmentNode | undefined;
|
|
12
|
+
parentIndex: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function fieldHasCategory(field: FieldNode, categories: ReadonlyArray<CategoryType>): boolean;
|
|
15
|
+
export declare function isRecordQuery(field: FieldNode | undefined): boolean;
|
|
16
|
+
export declare function isChildRelationshipQuery(field: FieldNode): boolean;
|
|
17
|
+
export declare function isParentRelationshipQuery(field: FieldNode): boolean;
|
|
18
|
+
export declare function findNearestConnection(ancestors: ReadonlyArray<any>): FieldNode | undefined;
|
|
19
|
+
export declare function findNearestConnectionWithPath(ancestors: ReadonlyArray<any>): {
|
|
20
|
+
connection: FieldNode | undefined;
|
|
21
|
+
path: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export declare function findNearestAncesterPath(ancestors: ReadonlyArray<any>, connectionOnly: boolean): RecordQueryPathInfo;
|
|
24
|
+
export declare function findAncesterPath(ancesters: ReadonlyArray<any>): string;
|
|
25
|
+
/**
|
|
26
|
+
* checks if the 'SelectionNode' has the potential to have relationship(parent or child) with its ancestor.
|
|
27
|
+
* @param node
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
export declare function isCapableRelationship(node: SelectionNode): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* checks if the 'ArgumentNode' is a specific scope type
|
|
33
|
+
* @param node
|
|
34
|
+
* @param scopeType
|
|
35
|
+
* @param variables
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export declare function isScopeArgumentNodeWithType(node: ArgumentNode, scopeType: string, variables?: Record<string, any>): boolean;
|
|
39
|
+
export declare function getRelation(node: FieldNode | InlineFragmentNode): RelationshipType;
|
|
40
|
+
export declare function isFieldSpanning(node: SelectionNode, parentNode?: FieldNode | InlineFragmentNode): boolean;
|
|
41
|
+
export declare function isInlineFragmentFieldSpanning(node: SelectionNode): boolean;
|
|
42
|
+
export declare function isRelationship(node: FieldNode | InlineFragmentNode, relationship: RelationshipType): boolean;
|
|
43
|
+
export declare function isFieldAvailable(field: string, objectInfo: ObjectInfoRepresentation): boolean;
|
|
44
|
+
export declare function mergeFieldNode(node1: FieldNode, node2: FieldNode): FieldNode;
|
|
45
|
+
export declare function mergeInLineFragmentNode(node1: InlineFragmentNode, node2: InlineFragmentNode): InlineFragmentNode;
|
|
46
|
+
export declare function depth(json: any, currentLevel?: number): number;
|
|
47
|
+
export declare function flatten<T>(previous: T[], current: T[]): T[];
|
|
48
|
+
export declare function findFieldInfo(objectInfo: ObjectInfoRepresentation, fieldName: string): FieldRepresentation | undefined;
|
|
49
|
+
export declare function readIngestionTimestampForKey(key: string, query: QueryFunction): Promise<number>;
|
|
50
|
+
export declare function isObjectDefinitionNode(node: ASTNode): node is OperationDefinitionNode;
|
|
51
|
+
export declare function operationNodeAncestor(ancestors: ReadonlyArray<any>): OperationDefinitionNode | undefined;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DocumentNode } from 'graphql';
|
|
2
|
+
import type { ObjectInfoMap } from './types';
|
|
3
|
+
type EnforcedLimits = {
|
|
4
|
+
maxFieldCount: number;
|
|
5
|
+
maxRecordLimit: number;
|
|
6
|
+
singleRecordField: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function enforceFieldLimitOnAST(ast: DocumentNode, variables: Record<string, any>, objectInfos: ObjectInfoMap, enforcedLimits?: EnforcedLimits): DocumentNode;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ObjectInfoMap } from './types';
|
|
2
|
+
import type { Join } from './query';
|
|
3
|
+
export type OrderByPredicate = {
|
|
4
|
+
alias: string;
|
|
5
|
+
path: string;
|
|
6
|
+
order?: 'ASC' | 'DESC';
|
|
7
|
+
nulls?: 'FIRST' | 'LAST';
|
|
8
|
+
joins?: Join[];
|
|
9
|
+
};
|
|
10
|
+
export declare function orderByToPredicate(orderBy: any, recordType: string, alias: string, objectInfoMap: ObjectInfoMap, joins?: Join[]): OrderByPredicate[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { QueryFunction } from './context';
|
|
2
|
+
import type { DocumentNode } from '@luvio/graphql-parser';
|
|
3
|
+
import type { SqliteStore } from '@salesforce/lds-store-sql';
|
|
4
|
+
export type PaginationMetadata = Record<string, number | undefined>;
|
|
5
|
+
export declare function mapCursorValue(originalValue: string | null | undefined, paginationMetadata: PaginationMetadata): string | null;
|
|
6
|
+
export declare function mapPaginationCursors(originalAST: DocumentNode, variables: Record<string, any>, store: SqliteStore): Promise<{
|
|
7
|
+
ast: DocumentNode;
|
|
8
|
+
mappedCursors: Map<string, string>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function readPaginationMetadataForKeys(keys: string[], query: QueryFunction): Promise<Map<string, PaginationMetadata>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { OrderByPredicate } from './orderByParser';
|
|
2
|
+
import type { SQLStatement } from './types';
|
|
3
|
+
export type PredicatePath = {
|
|
4
|
+
leftPath: string;
|
|
5
|
+
rightPath: string;
|
|
6
|
+
};
|
|
7
|
+
export type DataType = 'Boolean' | 'String' | 'Double' | 'Date' | 'DateTime' | 'Int' | 'WeakEtag' | 'Reference' | 'Picklist' | 'Currency' | 'MultiPicklist' | 'Time' | 'Phone' | 'Url' | 'TextArea' | 'Email' | 'Percent';
|
|
8
|
+
export type PredicateValue = CompoundPredicate | SinglePredicate | NotPredicate;
|
|
9
|
+
export type NotPredicate = {
|
|
10
|
+
type: PredicateType.not;
|
|
11
|
+
operator: NotOperator;
|
|
12
|
+
children: (CompoundPredicate | SinglePredicate)[];
|
|
13
|
+
};
|
|
14
|
+
export type CompoundPredicate = {
|
|
15
|
+
type: PredicateType.compound;
|
|
16
|
+
operator: CompoundOperator;
|
|
17
|
+
children: PredicateValue[];
|
|
18
|
+
};
|
|
19
|
+
export type SinglePredicate = {
|
|
20
|
+
type: PredicateType.single;
|
|
21
|
+
alias?: string;
|
|
22
|
+
leftPath: string;
|
|
23
|
+
operator: Operator;
|
|
24
|
+
value: unknown;
|
|
25
|
+
bindings?: unknown[];
|
|
26
|
+
dataType?: DataType;
|
|
27
|
+
isCaseSensitive?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type CompoundOperator = 'and' | 'or';
|
|
30
|
+
export type NotOperator = 'not';
|
|
31
|
+
export type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'BETWEEN' | 'NOT BETWEEN' | 'IS' | 'IS NOT';
|
|
32
|
+
export declare enum PredicateType {
|
|
33
|
+
compound = "compound",
|
|
34
|
+
single = "single",
|
|
35
|
+
not = "not"
|
|
36
|
+
}
|
|
37
|
+
export type SqlAndBindings = {
|
|
38
|
+
sql: string;
|
|
39
|
+
binding: any[];
|
|
40
|
+
};
|
|
41
|
+
export type Join = {
|
|
42
|
+
type: 'INNER' | 'LEFT';
|
|
43
|
+
alias: string;
|
|
44
|
+
to: string;
|
|
45
|
+
apiName?: string;
|
|
46
|
+
conditions: (PredicatePath | PredicateValue)[];
|
|
47
|
+
};
|
|
48
|
+
export type QueryBuilderConfig = {
|
|
49
|
+
alias: string;
|
|
50
|
+
joins?: Join[];
|
|
51
|
+
predicates?: PredicateValue[];
|
|
52
|
+
limit?: number;
|
|
53
|
+
offset?: number;
|
|
54
|
+
orderBy?: OrderByPredicate[];
|
|
55
|
+
};
|
|
56
|
+
export declare function buildQuery(config: QueryBuilderConfig): SQLStatement;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataLoader } from './dataloader';
|
|
2
|
+
import type { SqliteResult, SqliteType } from '@salesforce/lds-store-sql';
|
|
3
|
+
import type { RecordRepresentation } from './types';
|
|
4
|
+
export declare function recordLoaderFactory(query: (sql: string, params: SqliteType[]) => Promise<SqliteResult>): DataLoader<string, RecordRepresentation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function passThroughResolver(source: any): any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RecordQueryArgs, RecordRepresentation } from '../types';
|
|
2
|
+
import type { ArgumentNode, GraphQLResolveInfo, OperationDefinitionNode } from 'graphql';
|
|
3
|
+
import type { ResolverContext } from '../context';
|
|
4
|
+
export type RecordInformation = {
|
|
5
|
+
recordRepresentation: RecordRepresentation;
|
|
6
|
+
ingestionTimestamp: number;
|
|
7
|
+
};
|
|
8
|
+
export type IndexedRecordInformation = RecordInformation & {
|
|
9
|
+
index: number;
|
|
10
|
+
earlyEnd?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type RecordConnectionInformation = {
|
|
13
|
+
records: IndexedRecordInformation[];
|
|
14
|
+
hasNextPage: boolean;
|
|
15
|
+
earlyEnd: boolean;
|
|
16
|
+
offset: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function connectionResolver(obj: Partial<RecordInformation>, args: RecordQueryArgs, context: ResolverContext, info: GraphQLResolveInfo): Promise<RecordConnectionInformation>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns just the records array of a connection result, used for edges field
|
|
21
|
+
*/
|
|
22
|
+
export declare function edgesResolver(obj: RecordConnectionInformation): IndexedRecordInformation[];
|
|
23
|
+
/**
|
|
24
|
+
* Builds the top level record query key based on AST data
|
|
25
|
+
* @param operation
|
|
26
|
+
* @param variables
|
|
27
|
+
* @param argumentNodes
|
|
28
|
+
* @param currentFieldName
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildKeyStringForRecordQuery(operation: OperationDefinitionNode, variables: Record<string, any>, argumentNodes: Readonly<ArgumentNode[]>, currentFieldName: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GraphQLSchema } from '@luvio/graphql-parser';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param schema GraphQL Schema generated from ObjectInfos
|
|
5
|
+
* @param polyFields The record types which support polymorphic fields. For example, 'Owner' has the 'Record' interface which is a polymorphic fields. The 'User' and 'Group' are the concrete types which support 'Owner' interface.
|
|
6
|
+
* @returns Updated schema
|
|
7
|
+
*/
|
|
8
|
+
export declare function addResolversToSchema(schema: GraphQLSchema, polyFields: string[]): GraphQLSchema;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IndexedRecordInformation, RecordConnectionInformation } from './connection';
|
|
2
|
+
import type { FragmentDefinitionNode, SelectionNode } from 'graphql';
|
|
3
|
+
export declare function cursorResolver(source: IndexedRecordInformation): string;
|
|
4
|
+
export declare function pageInfoResolver(source: RecordConnectionInformation): {
|
|
5
|
+
startCursor: null;
|
|
6
|
+
endCursor: string;
|
|
7
|
+
hasNextPage: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
startCursor: null;
|
|
10
|
+
endCursor: null;
|
|
11
|
+
hasNextPage: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
startCursor: string;
|
|
14
|
+
endCursor: string;
|
|
15
|
+
hasNextPage: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function pageResultCountResolver(source: RecordConnectionInformation): number;
|
|
18
|
+
export interface LocalCursor {
|
|
19
|
+
i: number;
|
|
20
|
+
e?: unknown;
|
|
21
|
+
}
|
|
22
|
+
export declare function encodeV1Cursor(cursor: LocalCursor): string;
|
|
23
|
+
export declare function decodeV1Cursor(base64cursor: string): LocalCursor;
|
|
24
|
+
/**
|
|
25
|
+
* Check the selections for any selection matching `pageInfo { hasNextPage }`
|
|
26
|
+
*/
|
|
27
|
+
export declare function selectionIncludesHasNextPage(selections: ReadonlyArray<SelectionNode>, fragments: {
|
|
28
|
+
[key: string]: FragmentDefinitionNode;
|
|
29
|
+
}): boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type GraphQLSchema } from '@luvio/graphql-parser';
|
|
2
|
+
import type { ObjectInfoMap } from './types';
|
|
3
|
+
export declare class CachedGraphQLSchema {
|
|
4
|
+
private _schema;
|
|
5
|
+
private _polymorphicFieldTypeNames;
|
|
6
|
+
constructor();
|
|
7
|
+
getSchema(): GraphQLSchema;
|
|
8
|
+
setSchema(value: GraphQLSchema): void;
|
|
9
|
+
getPolymorphicFieldTypeNames(): string[];
|
|
10
|
+
setPolymorphicFieldTypeNames(value: string[]): void;
|
|
11
|
+
set(schema: GraphQLSchema, polymorphicFieldTypeNames: string[]): void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Looks at the injected object info map and checks to see if the existing objects
|
|
15
|
+
* are within the current schema. It will extend the cached schema if it is not included.
|
|
16
|
+
* @param objectInfos
|
|
17
|
+
* @param cache
|
|
18
|
+
* @returns GraphQLSchema
|
|
19
|
+
*/
|
|
20
|
+
export declare function createSchemaWithCache(objectInfos: ObjectInfoMap, cache: CachedGraphQLSchema): GraphQLSchema;
|
|
21
|
+
/**
|
|
22
|
+
* Extends the current GraphQL Schema with new types based on the given object info map
|
|
23
|
+
*
|
|
24
|
+
* @param cache the existing cached schema object
|
|
25
|
+
* @param objectInfoMap map of object info and apiname for key
|
|
26
|
+
* @returns CachedGraphQLSchema
|
|
27
|
+
*/
|
|
28
|
+
export declare function extendSchemaWithObjectInfos(cache: CachedGraphQLSchema, objectInfoMap: ObjectInfoMap): CachedGraphQLSchema;
|
|
29
|
+
/**
|
|
30
|
+
* Builds the base schema from uiapi graphql adapter with resolvers attached
|
|
31
|
+
* @returns GraphQLSchema
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildBaseSchema(): GraphQLSchema;
|
|
34
|
+
/**
|
|
35
|
+
* Given the existing schema and the object infos it will create a new type for the schema
|
|
36
|
+
* or extend an existing type to add new fields to it.
|
|
37
|
+
*
|
|
38
|
+
* Extends RecordQuery to add new top level queries
|
|
39
|
+
* extend type RecordQuery {
|
|
40
|
+
* Account(predicates): AccountConnection
|
|
41
|
+
* }
|
|
42
|
+
* @param schema
|
|
43
|
+
* @param objectInfoMap
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
export declare function generateRecordQueries(schema: GraphQLSchema, objectInfoMap: ObjectInfoMap): {
|
|
47
|
+
recordQueries: string;
|
|
48
|
+
recordConnections: string;
|
|
49
|
+
recordExtensions: string;
|
|
50
|
+
polyFieldTypeNameArr: string[];
|
|
51
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Join, PredicateValue } from './query';
|
|
2
|
+
import type { LocalEvaluationRuntimeSettings } from './types';
|
|
3
|
+
export declare function scopeToJoins(scope: string | undefined, settings: LocalEvaluationRuntimeSettings): Join[];
|
|
4
|
+
export declare function scopeToPredicates(scope: string | undefined, settings: LocalEvaluationRuntimeSettings): PredicateValue[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Snapshot, ErrorSnapshot, AvailableSnapshot, NormalizedKeyMetadata, SnapshotRefresh } from '@luvio/engine';
|
|
2
|
+
import { StoreKeySet } from '@luvio/engine';
|
|
3
|
+
import type { GraphQLRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
export type StaleRefreshLocalEvalSnapshot = LocalEvalSnapshot & {
|
|
5
|
+
refreshStaleRecords: (keys: Set<string>) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export type LocalEvalSnapshot = AvailableSnapshot<GraphQLRepresentation> & {
|
|
8
|
+
rebuildWithLocalEval: (originalSnapshot: AvailableSnapshot<GraphQLRepresentation>) => Promise<LocalEvalSnapshot>;
|
|
9
|
+
};
|
|
10
|
+
export declare function isLocalEvalSnapshot(snapshot: Snapshot<unknown>): snapshot is LocalEvalSnapshot;
|
|
11
|
+
export declare function createSeenRecords(ids: string[], currentSnapshot: AvailableSnapshot<unknown>): StoreKeySet<string | NormalizedKeyMetadata>;
|
|
12
|
+
export declare function createErrorSnapshot(result: Partial<{
|
|
13
|
+
errors: any[];
|
|
14
|
+
}>, snapshot: Snapshot<unknown>): ErrorSnapshot;
|
|
15
|
+
export declare function createLocalEvalSnapshot<D>(data: GraphQLRepresentation, seenRecords: StoreKeySet<string | NormalizedKeyMetadata>, recordId: string, rebuildWithLocalEval: LocalEvalSnapshot['rebuildWithLocalEval'], refresh?: SnapshotRefresh<any>): LocalEvalSnapshot;
|
|
16
|
+
/**
|
|
17
|
+
* If we can't reach the server or if we get back a 504 (which means only-if-cached
|
|
18
|
+
* cache policy was used but this query hasn't been cached) then we still want to
|
|
19
|
+
* attempt an eval. All other errors should be returned to caller.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isErrorSnapshotThatShouldGetReturnedToCaller(snapshot: Snapshot<GraphQLRepresentation>): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Checks a GraphQL-shaped network response for errors, returning true if it does
|
|
24
|
+
* and false otherwise
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasGraphQlErrors(response: GraphQLRepresentation | undefined): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Adapter, type Luvio } from '@luvio/engine';
|
|
2
|
+
import type { BatchRepresentation, GetRecordsConfig } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
+
/**
|
|
4
|
+
* Adapter for limiting the number of record ids to a maximum of 100 and sending them
|
|
5
|
+
* out in batches to the getRecords adapter
|
|
6
|
+
*
|
|
7
|
+
* @param luvio
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function batchingGetRecordsAdapterFactory(luvio: Luvio): Adapter<GetRecordsConfig, BatchRepresentation>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DocumentNode } from '@luvio/graphql-parser';
|
|
2
|
+
import type { DraftFunctions } from './types';
|
|
3
|
+
import type { GraphQLRepresentationData } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
import type { ObjectInfoService, ObjectInfoMap } from './types';
|
|
5
|
+
export declare function injectSyntheticFields(originalAST: DocumentNode, objectInfoService: ObjectInfoService, draftFunctions: DraftFunctions, variables?: Record<string, any>): Promise<{
|
|
6
|
+
modifiedAST: DocumentNode;
|
|
7
|
+
objectInfos: ObjectInfoMap;
|
|
8
|
+
unmappedDraftIDs: Set<string>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function removeSyntheticFields(result: GraphQLRepresentationData, query: DocumentNode): GraphQLRepresentationData;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FieldNode, ObjectFieldNode, OperationDefinitionNode, SelectionNode, ASTNode, DefinitionNode, ObjectValueNode, InlineFragmentNode, StringValueNode, VariableNode, IntValueNode } from '@luvio/graphql-parser';
|
|
2
|
+
import type { DateTimeInput } from './dateTimePredication';
|
|
3
|
+
import type { CompoundPredicate, PredicateValue, SinglePredicate, NotPredicate } from './query';
|
|
4
|
+
export declare function isObjectValueNode(node: ASTNode): node is ObjectValueNode;
|
|
5
|
+
export declare function isStringValueNode(node: ASTNode): node is StringValueNode;
|
|
6
|
+
export declare function isIntValueNode(node: ASTNode): node is IntValueNode;
|
|
7
|
+
export declare function isVariableNode(node: ASTNode): node is VariableNode;
|
|
8
|
+
export declare function isObjectFieldNode(node: ASTNode): node is ObjectFieldNode;
|
|
9
|
+
export declare function isFieldNode(node: ASTNode): node is FieldNode;
|
|
10
|
+
export declare function isFieldOrInlineFragmentNode(node: ASTNode): node is FieldNode | InlineFragmentNode;
|
|
11
|
+
export declare function isInlineFragmentNode(node: ASTNode): node is InlineFragmentNode;
|
|
12
|
+
export declare function isCompoundPredicate(predicate: PredicateValue): predicate is CompoundPredicate;
|
|
13
|
+
export declare function isSinglePredicate(predicate: PredicateValue): predicate is SinglePredicate;
|
|
14
|
+
export declare function isNotPredicate(predicate: PredicateValue): predicate is NotPredicate;
|
|
15
|
+
export declare function isDateTimeInput(object: any): object is DateTimeInput;
|
|
16
|
+
export declare function nodeIsNamed(name: string): (node: FieldNode) => boolean;
|
|
17
|
+
export declare function extractFieldSelections(accu: SelectionNode[], item: FieldNode): SelectionNode[];
|
|
18
|
+
export declare function extractSelections(accu: SelectionNode[], item: FieldNode | InlineFragmentNode): SelectionNode[];
|
|
19
|
+
export declare function isOperationDefinitionNode(node: DefinitionNode): node is OperationDefinitionNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PrimingSession } from '
|
|
1
|
+
import type { PrimingSession } from '../priming';
|
|
2
2
|
export declare function instrumentPrimingSession(session: PrimingSession): PrimingSession;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryInstrumentation } from '
|
|
1
|
+
import type { QueryInstrumentation } from '../graphql/instrumentLimits';
|
|
2
2
|
export declare const O11Y_NAMESPACE_LDS_MOBILE = "lds-mobile";
|
|
3
3
|
export declare const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = "draft-queue-total-mergeActions-calls";
|
|
4
4
|
export declare const ldsMobileInstrumentation: import("o11y/dist/modules/o11y/client/interfaces").Instrumentation;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export type { ObjectInfoService } from './utils/ObjectInfoService';
|
|
|
5
5
|
export type { ObservabilityContext } from '@salesforce/nimbus-plugin-lds';
|
|
6
6
|
export { registerReportObserver } from './instrumentation/instrumentMobileAdapter';
|
|
7
7
|
export { reportGraphqlQueryParseError } from './instrumentation/metrics';
|
|
8
|
+
export type { PrimingSession } from './priming';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LdsAbortController } from '@salesforce/lds-utils-adapters';
|
|
2
|
+
import type { DurableRecordRepresentation } from '@salesforce/lds-durable-records';
|
|
3
|
+
import type { PrimingStore } from './PrimingStore';
|
|
4
|
+
import type { PrimingWork } from './types';
|
|
5
|
+
import type { ObjectInfoLoader } from './ObjectInfoLoader';
|
|
6
|
+
type ConflictResolutionError = 'object-info-missing';
|
|
7
|
+
interface ConflictResolutionResult {
|
|
8
|
+
additionalWork: PrimingWork;
|
|
9
|
+
recordsToWrite: DurableRecordRepresentation[];
|
|
10
|
+
resolvedRecords: string[];
|
|
11
|
+
recordsNeedingRefetch: Map<string, {
|
|
12
|
+
ids: string[];
|
|
13
|
+
fields: string[];
|
|
14
|
+
}>;
|
|
15
|
+
errors: {
|
|
16
|
+
id: string;
|
|
17
|
+
reason: ConflictResolutionError;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A pool of workers that resolve conflicts between incoming records and records in the store.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ConflictPool {
|
|
24
|
+
private readonly store;
|
|
25
|
+
private readonly objectInfoLoader;
|
|
26
|
+
private pool;
|
|
27
|
+
constructor(store: PrimingStore, objectInfoLoader: ObjectInfoLoader);
|
|
28
|
+
enqueueConflictedRecords(records: DurableRecordRepresentation[], abortController: LdsAbortController): Promise<ConflictResolutionResult>;
|
|
29
|
+
private resolveConflicts;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type EventPayloadMap = {
|
|
2
|
+
[eventName: string]: any;
|
|
3
|
+
};
|
|
4
|
+
type EventCallback<T extends keyof EventPayloadMap> = (payload: EventPayloadMap[T]) => void;
|
|
5
|
+
export declare abstract class EventEmitter<T extends EventPayloadMap> {
|
|
6
|
+
private listeners;
|
|
7
|
+
private addListener;
|
|
8
|
+
private removeListener;
|
|
9
|
+
on<K extends Extract<keyof T, string>>(eventName: K, callback: (payload: T[K]) => void): this;
|
|
10
|
+
once<K extends Extract<keyof T, string>>(eventName: K, callback: (payload: T[K]) => void): this;
|
|
11
|
+
off<K extends Extract<keyof T, string>>(eventName: K, callback: (payload: T[K]) => void): this;
|
|
12
|
+
protected emit<K extends Extract<keyof T, string>>(eventName: K, payload: T[K]): boolean;
|
|
13
|
+
protected listenerCount<K extends Extract<keyof T, string>>(eventName: K): number;
|
|
14
|
+
protected rawListeners<K extends Extract<keyof T, string>>(eventName: K): { [K_1 in keyof T]: EventCallback<K_1>[]; }[K];
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Adapter } from '@luvio/engine';
|
|
2
2
|
import type { BatchRepresentation, GetRecordsConfig } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
-
import type { LdsRecordRefresher } from '
|
|
3
|
+
import type { LdsRecordRefresher } from '../priming';
|
|
4
4
|
export declare class LdsPrimingRecordRefresher implements LdsRecordRefresher {
|
|
5
5
|
private getRecordsAdapter;
|
|
6
6
|
constructor(getRecordsAdapter: Adapter<GetRecordsConfig, BatchRepresentation>);
|