@dvina/sdk 4.0.217 → 4.0.220
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/adapters/angular/index.cjs +4 -4
- package/dist/adapters/angular/index.d.cts +2 -2
- package/dist/adapters/angular/index.d.ts +2 -2
- package/dist/adapters/angular/index.js +2 -2
- package/dist/billing/index.cjs +5 -5
- package/dist/billing/index.js +1 -1
- package/dist/{chunk-IM7TFRLL.js → chunk-6PAEAOGQ.js} +94 -30
- package/dist/chunk-6PAEAOGQ.js.map +1 -0
- package/dist/{chunk-SQ3TK5MI.cjs → chunk-CGJTK2BE.cjs} +117 -53
- package/dist/chunk-CGJTK2BE.cjs.map +1 -0
- package/dist/{chunk-5JLVHE5X.cjs → chunk-VDPZQ5F3.cjs} +41 -4
- package/dist/{chunk-5JLVHE5X.cjs.map → chunk-VDPZQ5F3.cjs.map} +1 -1
- package/dist/{chunk-GJXK5EID.js → chunk-ZGGY4WK7.js} +41 -4
- package/dist/chunk-ZGGY4WK7.js.map +1 -0
- package/dist/{client-B4c82App.d.ts → client-C0CA6PHq.d.ts} +1 -1
- package/dist/{client-CluqWlY-.d.cts → client-XvsWJ1Z1.d.cts} +1 -1
- package/dist/{index-DCrLPp9U.d.ts → index-Bld5-Yr1.d.ts} +1 -1
- package/dist/{index-D2HJtzDx.d.cts → index-DF59UYzN.d.cts} +1 -1
- package/dist/index.cjs +387 -387
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/pagination/index.d.cts +2 -2
- package/dist/pagination/index.d.ts +2 -2
- package/dist/{sync-engine-CBYlsAfA.d.ts → sync-engine-CZ0U9XBy.d.ts} +13 -7
- package/dist/{sync-engine-CvB6DrbK.d.cts → sync-engine-DXESBFX0.d.cts} +13 -7
- package/package.json +1 -1
- package/dist/chunk-GJXK5EID.js.map +0 -1
- package/dist/chunk-IM7TFRLL.js.map +0 -1
- package/dist/chunk-SQ3TK5MI.cjs.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk342BFYZZ_cjs = require('./chunk-342BFYZZ.cjs');
|
|
4
4
|
var chunkUELAE75E_cjs = require('./chunk-UELAE75E.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkVDPZQ5F3_cjs = require('./chunk-VDPZQ5F3.cjs');
|
|
6
6
|
var chunkKV5SP7RP_cjs = require('./chunk-KV5SP7RP.cjs');
|
|
7
7
|
var chunk32A6N4YK_cjs = require('./chunk-32A6N4YK.cjs');
|
|
8
8
|
var chunkDZUJEN5N_cjs = require('./chunk-DZUJEN5N.cjs');
|
|
@@ -7374,7 +7374,7 @@ function createWsTransport(options) {
|
|
|
7374
7374
|
let nextToken;
|
|
7375
7375
|
let currentToken;
|
|
7376
7376
|
async function refreshToken() {
|
|
7377
|
-
const token = await
|
|
7377
|
+
const token = await chunkVDPZQ5F3_cjs.refreshTokenSingleFlight(options.getToken, currentToken);
|
|
7378
7378
|
if (!token) {
|
|
7379
7379
|
throw new chunkKV5SP7RP_cjs.DvinaAuthenticationError("Token refresh did not produce a new token", currentToken);
|
|
7380
7380
|
}
|
|
@@ -7426,7 +7426,7 @@ function createWsTransport(options) {
|
|
|
7426
7426
|
}
|
|
7427
7427
|
});
|
|
7428
7428
|
function subscribe(document2, variables) {
|
|
7429
|
-
const query =
|
|
7429
|
+
const query = chunkVDPZQ5F3_cjs.print(document2);
|
|
7430
7430
|
const subscribeOnce = () => ({
|
|
7431
7431
|
[Symbol.asyncIterator]() {
|
|
7432
7432
|
const queue = [];
|
|
@@ -8371,7 +8371,7 @@ function createSseTransport(options) {
|
|
|
8371
8371
|
if (response.status !== 401 && response.status !== 403) {
|
|
8372
8372
|
return;
|
|
8373
8373
|
}
|
|
8374
|
-
resolvedToken = await
|
|
8374
|
+
resolvedToken = await chunkVDPZQ5F3_cjs.refreshTokenSingleFlight(options.getToken, resolvedToken);
|
|
8375
8375
|
}
|
|
8376
8376
|
}
|
|
8377
8377
|
return {
|
|
@@ -9009,9 +9009,12 @@ var CacheManager = class {
|
|
|
9009
9009
|
*/
|
|
9010
9010
|
async invalidateQuery(operationName, variables) {
|
|
9011
9011
|
const key = buildQueryKey(operationName, variables);
|
|
9012
|
+
await this.invalidateQueryKey(key);
|
|
9013
|
+
}
|
|
9014
|
+
async invalidateQueryKey(queryKey) {
|
|
9012
9015
|
await this._db.transaction("rw", [this._db._queryResults, this._db._sync], async () => {
|
|
9013
|
-
await this._db._queryResults.delete(
|
|
9014
|
-
await this._db._sync.delete(getQueryFreshnessKey(
|
|
9016
|
+
await this._db._queryResults.delete(queryKey);
|
|
9017
|
+
await this._db._sync.delete(getQueryFreshnessKey(queryKey));
|
|
9015
9018
|
});
|
|
9016
9019
|
}
|
|
9017
9020
|
/**
|
|
@@ -9706,6 +9709,7 @@ async function resolveRelationByReference(db, params) {
|
|
|
9706
9709
|
}
|
|
9707
9710
|
|
|
9708
9711
|
// src/store/sync-engine.ts
|
|
9712
|
+
var REVALIDATION_RETRY_DELAY_MS = 1e3;
|
|
9709
9713
|
var SyncEngine = class {
|
|
9710
9714
|
_db;
|
|
9711
9715
|
_sse;
|
|
@@ -9722,6 +9726,8 @@ var SyncEngine = class {
|
|
|
9722
9726
|
_subscriptionToQuery = /* @__PURE__ */ new Map();
|
|
9723
9727
|
/** Last per-query revalidation timestamp to avoid refetch storms. */
|
|
9724
9728
|
_lastRevalidatedAt = /* @__PURE__ */ new Map();
|
|
9729
|
+
/** Retry timers for recovery refetches that failed and need another attempt. */
|
|
9730
|
+
_revalidationRetryTimers = /* @__PURE__ */ new Map();
|
|
9725
9731
|
/**
|
|
9726
9732
|
* Last mutation/sync touch timestamp by entity type.
|
|
9727
9733
|
* Used to detect stale cached query results on watch re-entry.
|
|
@@ -9759,27 +9765,24 @@ var SyncEngine = class {
|
|
|
9759
9765
|
/**
|
|
9760
9766
|
* Handle a full-resync signal from the server.
|
|
9761
9767
|
*
|
|
9762
|
-
* Clears all cached entities and query results,
|
|
9763
|
-
*
|
|
9764
|
-
*
|
|
9765
|
-
* after the reconnect callback re-registers them with the server.
|
|
9766
|
-
* Without SSE, revalidation happens immediately.
|
|
9768
|
+
* Clears all cached entities and query results, restarts delta sync, and
|
|
9769
|
+
* refetches active subscription-backed queries once so filtered connections
|
|
9770
|
+
* are rebuilt from source of truth instead of waiting for future delta events.
|
|
9767
9771
|
*/
|
|
9768
9772
|
async handleFullResync() {
|
|
9769
9773
|
this.stopSync();
|
|
9770
9774
|
await this.clearAll();
|
|
9771
9775
|
if (this._sse) {
|
|
9772
9776
|
void this.startSync();
|
|
9773
|
-
return;
|
|
9774
9777
|
}
|
|
9775
9778
|
await this._revalidateAllActiveSubscriptions();
|
|
9776
9779
|
}
|
|
9777
9780
|
/**
|
|
9778
|
-
*
|
|
9779
|
-
*
|
|
9781
|
+
* Ordinary transport reconnects should recover from the sync cursor and
|
|
9782
|
+
* server-side subscription state without eagerly refetching every active query.
|
|
9780
9783
|
*/
|
|
9781
9784
|
async handleTransportReconnect() {
|
|
9782
|
-
|
|
9785
|
+
return;
|
|
9783
9786
|
}
|
|
9784
9787
|
/**
|
|
9785
9788
|
* Process an incoming SSE sync event.
|
|
@@ -9842,8 +9845,15 @@ var SyncEngine = class {
|
|
|
9842
9845
|
void this._revalidateSubscriptionIfStale(subscriptionDescriptor.id);
|
|
9843
9846
|
const originalDispose = ref.dispose.bind(ref);
|
|
9844
9847
|
ref.dispose = () => {
|
|
9848
|
+
const hasOtherActiveSubscription = this._hasOtherActiveSubscriptionForQueryKey(
|
|
9849
|
+
queryKey,
|
|
9850
|
+
subscriptionDescriptor.id
|
|
9851
|
+
);
|
|
9845
9852
|
this._subscriptionToQueryKey.delete(subscriptionDescriptor.id);
|
|
9846
9853
|
this._subscriptionToQuery.delete(subscriptionDescriptor.id);
|
|
9854
|
+
if (!hasOtherActiveSubscription) {
|
|
9855
|
+
this._clearRevalidationRetry(queryKey);
|
|
9856
|
+
}
|
|
9847
9857
|
if (this._sse) {
|
|
9848
9858
|
this._sse.unsubscribe(subscriptionDescriptor.id);
|
|
9849
9859
|
}
|
|
@@ -10015,7 +10025,7 @@ var SyncEngine = class {
|
|
|
10015
10025
|
if (!cached) return;
|
|
10016
10026
|
const fetchedAt = await this._cache.getQueryFetchedAt(sub.queryKey, cached);
|
|
10017
10027
|
if ((fetchedAt ?? cached.fetchedAt) >= touchedAt) return;
|
|
10018
|
-
await this.
|
|
10028
|
+
await this._revalidateSubscriptionQuery(sub, { force: true });
|
|
10019
10029
|
}
|
|
10020
10030
|
async _revalidateAllActiveSubscriptions() {
|
|
10021
10031
|
await this._revalidateSubscriptions(Array.from(this._subscriptionToQuery.values()), { force: true });
|
|
@@ -10029,15 +10039,60 @@ var SyncEngine = class {
|
|
|
10029
10039
|
pendingByQueryKey.set(sub.queryKey, sub);
|
|
10030
10040
|
}
|
|
10031
10041
|
if (pendingByQueryKey.size === 0) return;
|
|
10032
|
-
for (const sub of pendingByQueryKey.values()) {
|
|
10033
|
-
this._lastRevalidatedAt.set(sub.queryKey, now);
|
|
10034
|
-
}
|
|
10035
10042
|
await Promise.all(
|
|
10036
|
-
Array.from(pendingByQueryKey.values()).map(
|
|
10037
|
-
(sub) => this.query(sub.document, sub.variables, sub.operationName).catch(() => void 0)
|
|
10038
|
-
)
|
|
10043
|
+
Array.from(pendingByQueryKey.values()).map((sub) => this._revalidateSubscriptionQuery(sub, options))
|
|
10039
10044
|
);
|
|
10040
10045
|
}
|
|
10046
|
+
async _revalidateSubscriptionQuery(subscription, options) {
|
|
10047
|
+
const startedAt = Date.now();
|
|
10048
|
+
this._lastRevalidatedAt.set(subscription.queryKey, startedAt);
|
|
10049
|
+
try {
|
|
10050
|
+
await this.query(subscription.document, subscription.variables, subscription.operationName);
|
|
10051
|
+
this._clearRevalidationRetry(subscription.queryKey);
|
|
10052
|
+
} catch {
|
|
10053
|
+
this._lastRevalidatedAt.delete(subscription.queryKey);
|
|
10054
|
+
await this._cache.invalidateQueryKey(subscription.queryKey).catch(() => void 0);
|
|
10055
|
+
if (options?.force || this._hasActiveSubscriptionForQueryKey(subscription.queryKey)) {
|
|
10056
|
+
this._scheduleRevalidationRetry(subscription.queryKey);
|
|
10057
|
+
}
|
|
10058
|
+
}
|
|
10059
|
+
}
|
|
10060
|
+
_scheduleRevalidationRetry(queryKey) {
|
|
10061
|
+
if (this._revalidationRetryTimers.has(queryKey)) {
|
|
10062
|
+
return;
|
|
10063
|
+
}
|
|
10064
|
+
const timer = setTimeout(() => {
|
|
10065
|
+
this._revalidationRetryTimers.delete(queryKey);
|
|
10066
|
+
const subscription = this._getActiveSubscriptionByQueryKey(queryKey);
|
|
10067
|
+
if (!subscription) {
|
|
10068
|
+
return;
|
|
10069
|
+
}
|
|
10070
|
+
void this._revalidateSubscriptionQuery(subscription, { force: true });
|
|
10071
|
+
}, REVALIDATION_RETRY_DELAY_MS);
|
|
10072
|
+
this._revalidationRetryTimers.set(queryKey, timer);
|
|
10073
|
+
}
|
|
10074
|
+
_clearRevalidationRetry(queryKey) {
|
|
10075
|
+
const timer = this._revalidationRetryTimers.get(queryKey);
|
|
10076
|
+
if (!timer) {
|
|
10077
|
+
return;
|
|
10078
|
+
}
|
|
10079
|
+
clearTimeout(timer);
|
|
10080
|
+
this._revalidationRetryTimers.delete(queryKey);
|
|
10081
|
+
}
|
|
10082
|
+
_getActiveSubscriptionByQueryKey(queryKey) {
|
|
10083
|
+
return Array.from(this._subscriptionToQuery.values()).find((sub) => sub.queryKey === queryKey);
|
|
10084
|
+
}
|
|
10085
|
+
_hasActiveSubscriptionForQueryKey(queryKey) {
|
|
10086
|
+
return this._getActiveSubscriptionByQueryKey(queryKey) !== void 0;
|
|
10087
|
+
}
|
|
10088
|
+
_hasOtherActiveSubscriptionForQueryKey(queryKey, subscriptionId) {
|
|
10089
|
+
for (const [activeSubscriptionId, subscription] of this._subscriptionToQuery.entries()) {
|
|
10090
|
+
if (activeSubscriptionId !== subscriptionId && subscription.queryKey === queryKey) {
|
|
10091
|
+
return true;
|
|
10092
|
+
}
|
|
10093
|
+
}
|
|
10094
|
+
return false;
|
|
10095
|
+
}
|
|
10041
10096
|
_getActiveSubscriptionsForEntityType(entityType) {
|
|
10042
10097
|
return Array.from(this._subscriptionToQuery.values()).filter((sub) => sub.entityType === entityType);
|
|
10043
10098
|
}
|
|
@@ -10315,10 +10370,6 @@ function createLazySyncEngine(httpTransport, sseUrl, syncPolicyUrl, getToken, ge
|
|
|
10315
10370
|
onFullResync: () => {
|
|
10316
10371
|
realEngine?.handleFullResync().catch(() => {
|
|
10317
10372
|
});
|
|
10318
|
-
},
|
|
10319
|
-
onReconnect: () => {
|
|
10320
|
-
realEngine?.handleTransportReconnect().catch(() => {
|
|
10321
|
-
});
|
|
10322
10373
|
}
|
|
10323
10374
|
});
|
|
10324
10375
|
sseTransport = transport;
|
|
@@ -10575,6 +10626,9 @@ var DEFAULT_BASE_URL = "api.dvina.ai";
|
|
|
10575
10626
|
var DB_INIT_TOKEN_POLL_INTERVAL_MS = 100;
|
|
10576
10627
|
var DB_INIT_TOKEN_TIMEOUT_MS = 15e3;
|
|
10577
10628
|
var LIFECYCLE_HINT_DEBOUNCE_MS = 250;
|
|
10629
|
+
function shouldRecoverConnections(hints) {
|
|
10630
|
+
return hints.has("network-restored") || hints.has("app-resumed");
|
|
10631
|
+
}
|
|
10578
10632
|
function resolveGetToken(options) {
|
|
10579
10633
|
if ("getToken" in options && options.getToken) {
|
|
10580
10634
|
return options.getToken;
|
|
@@ -10624,7 +10678,7 @@ function createDvinaClient(options) {
|
|
|
10624
10678
|
const getToken = resolveGetToken(options);
|
|
10625
10679
|
const getLanguage = resolveLanguage(options.language);
|
|
10626
10680
|
const getUserTimezone = resolveUserTimezone();
|
|
10627
|
-
const httpTransport =
|
|
10681
|
+
const httpTransport = chunkVDPZQ5F3_cjs.createHttpTransport({
|
|
10628
10682
|
url: httpUrl,
|
|
10629
10683
|
getToken,
|
|
10630
10684
|
getLanguage,
|
|
@@ -10683,19 +10737,29 @@ function createDvinaClient(options) {
|
|
|
10683
10737
|
const billingBase = hasProtocol ? billingOverride.replace(/\/+$/, "") : `${httpProtocol}://${billingOverride ?? baseUrl.replace(/^api\./, "billing.")}`;
|
|
10684
10738
|
const billingHttpUrl = `${billingBase}/graphql`;
|
|
10685
10739
|
const billingSseUrl = `${billingBase}/subscriptions/stream`;
|
|
10686
|
-
const billing = new
|
|
10740
|
+
const billing = new chunkVDPZQ5F3_cjs.BillingClient({ billingHttpUrl, billingSseUrl, getToken, onError: options.onError });
|
|
10687
10741
|
let lifecycleHintTimer;
|
|
10742
|
+
const pendingLifecycleHints = /* @__PURE__ */ new Set();
|
|
10743
|
+
const recoverConnections = () => {
|
|
10744
|
+
recoverableSyncEngine.reconnectActiveSync();
|
|
10745
|
+
chatStream.reconnectAll();
|
|
10746
|
+
wsTransport?.terminate();
|
|
10747
|
+
billing.reconnectAll();
|
|
10748
|
+
};
|
|
10688
10749
|
const lifecycle = {
|
|
10689
|
-
hint(
|
|
10750
|
+
hint(reason) {
|
|
10751
|
+
pendingLifecycleHints.add(reason);
|
|
10690
10752
|
if (lifecycleHintTimer) {
|
|
10691
10753
|
return;
|
|
10692
10754
|
}
|
|
10693
10755
|
lifecycleHintTimer = setTimeout(() => {
|
|
10694
10756
|
lifecycleHintTimer = void 0;
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10757
|
+
const hints = new Set(pendingLifecycleHints);
|
|
10758
|
+
pendingLifecycleHints.clear();
|
|
10759
|
+
if (!shouldRecoverConnections(hints)) {
|
|
10760
|
+
return;
|
|
10761
|
+
}
|
|
10762
|
+
recoverConnections();
|
|
10699
10763
|
}, LIFECYCLE_HINT_DEBOUNCE_MS);
|
|
10700
10764
|
}
|
|
10701
10765
|
};
|
|
@@ -11016,7 +11080,7 @@ function buildSmartQuery(baseDocument, rootFieldName, includes, baseVariables, i
|
|
|
11016
11080
|
}
|
|
11017
11081
|
const doc = cloneDocument(baseDocument);
|
|
11018
11082
|
const mergedVariables = { ...baseVariables };
|
|
11019
|
-
const opDef = doc.definitions.find((d) => d.kind ===
|
|
11083
|
+
const opDef = doc.definitions.find((d) => d.kind === chunkVDPZQ5F3_cjs.Kind.OPERATION_DEFINITION);
|
|
11020
11084
|
if (!opDef) {
|
|
11021
11085
|
return { document: baseDocument, variables: baseVariables };
|
|
11022
11086
|
}
|
|
@@ -11026,7 +11090,7 @@ function buildSmartQuery(baseDocument, rootFieldName, includes, baseVariables, i
|
|
|
11026
11090
|
}
|
|
11027
11091
|
const existingFragments = /* @__PURE__ */ new Set();
|
|
11028
11092
|
for (const def of doc.definitions) {
|
|
11029
|
-
if (def.kind ===
|
|
11093
|
+
if (def.kind === chunkVDPZQ5F3_cjs.Kind.FRAGMENT_DEFINITION) {
|
|
11030
11094
|
existingFragments.add(def.name.value);
|
|
11031
11095
|
}
|
|
11032
11096
|
}
|
|
@@ -11050,10 +11114,10 @@ function buildSmartQuery(baseDocument, rootFieldName, includes, baseVariables, i
|
|
|
11050
11114
|
}
|
|
11051
11115
|
if (isConnection && connectionIncludeFields.length > 0) {
|
|
11052
11116
|
const nodesWrapper = {
|
|
11053
|
-
kind:
|
|
11054
|
-
name: { kind:
|
|
11117
|
+
kind: chunkVDPZQ5F3_cjs.Kind.FIELD,
|
|
11118
|
+
name: { kind: chunkVDPZQ5F3_cjs.Kind.NAME, value: "nodes" },
|
|
11055
11119
|
selectionSet: {
|
|
11056
|
-
kind:
|
|
11120
|
+
kind: chunkVDPZQ5F3_cjs.Kind.SELECTION_SET,
|
|
11057
11121
|
selections: connectionIncludeFields
|
|
11058
11122
|
}
|
|
11059
11123
|
};
|
|
@@ -11067,14 +11131,14 @@ function buildSmartQuery(baseDocument, rootFieldName, includes, baseVariables, i
|
|
|
11067
11131
|
function processIncludeDirective(include, prefix, opDef, mergedVariables, existingFragments, newDefinitions) {
|
|
11068
11132
|
const fieldArgs = buildPrefixedArguments(include.fieldArguments ?? [], prefix);
|
|
11069
11133
|
const fragmentDefs = include.fragmentDoc.definitions.filter(
|
|
11070
|
-
(d) => d.kind ===
|
|
11134
|
+
(d) => d.kind === chunkVDPZQ5F3_cjs.Kind.FRAGMENT_DEFINITION
|
|
11071
11135
|
);
|
|
11072
11136
|
const mainFragment = fragmentDefs[0];
|
|
11073
11137
|
if (!mainFragment) return void 0;
|
|
11074
11138
|
const selections = [
|
|
11075
11139
|
{
|
|
11076
|
-
kind:
|
|
11077
|
-
name: { kind:
|
|
11140
|
+
kind: chunkVDPZQ5F3_cjs.Kind.FRAGMENT_SPREAD,
|
|
11141
|
+
name: { kind: chunkVDPZQ5F3_cjs.Kind.NAME, value: mainFragment.name.value }
|
|
11078
11142
|
}
|
|
11079
11143
|
];
|
|
11080
11144
|
if (include.children && include.children.length > 0) {
|
|
@@ -11096,10 +11160,10 @@ function processIncludeDirective(include, prefix, opDef, mergedVariables, existi
|
|
|
11096
11160
|
if (childFields.length > 0) {
|
|
11097
11161
|
if (include.isConnection) {
|
|
11098
11162
|
const nodesWrapper = {
|
|
11099
|
-
kind:
|
|
11100
|
-
name: { kind:
|
|
11163
|
+
kind: chunkVDPZQ5F3_cjs.Kind.FIELD,
|
|
11164
|
+
name: { kind: chunkVDPZQ5F3_cjs.Kind.NAME, value: "nodes" },
|
|
11101
11165
|
selectionSet: {
|
|
11102
|
-
kind:
|
|
11166
|
+
kind: chunkVDPZQ5F3_cjs.Kind.SELECTION_SET,
|
|
11103
11167
|
selections: childFields
|
|
11104
11168
|
}
|
|
11105
11169
|
};
|
|
@@ -11110,11 +11174,11 @@ function processIncludeDirective(include, prefix, opDef, mergedVariables, existi
|
|
|
11110
11174
|
}
|
|
11111
11175
|
}
|
|
11112
11176
|
const includeField = {
|
|
11113
|
-
kind:
|
|
11114
|
-
name: { kind:
|
|
11177
|
+
kind: chunkVDPZQ5F3_cjs.Kind.FIELD,
|
|
11178
|
+
name: { kind: chunkVDPZQ5F3_cjs.Kind.NAME, value: include.fieldName },
|
|
11115
11179
|
arguments: fieldArgs.length > 0 ? fieldArgs : void 0,
|
|
11116
11180
|
selectionSet: {
|
|
11117
|
-
kind:
|
|
11181
|
+
kind: chunkVDPZQ5F3_cjs.Kind.SELECTION_SET,
|
|
11118
11182
|
selections
|
|
11119
11183
|
}
|
|
11120
11184
|
};
|
|
@@ -11141,7 +11205,7 @@ function processIncludeDirective(include, prefix, opDef, mergedVariables, existi
|
|
|
11141
11205
|
}
|
|
11142
11206
|
function findFieldInSelectionSet(selectionSet, fieldName) {
|
|
11143
11207
|
for (const selection of selectionSet.selections) {
|
|
11144
|
-
if (selection.kind ===
|
|
11208
|
+
if (selection.kind === chunkVDPZQ5F3_cjs.Kind.FIELD && selection.name.value === fieldName) {
|
|
11145
11209
|
return selection;
|
|
11146
11210
|
}
|
|
11147
11211
|
}
|
|
@@ -11155,7 +11219,7 @@ function buildPrefixedArguments(args, prefix) {
|
|
|
11155
11219
|
});
|
|
11156
11220
|
}
|
|
11157
11221
|
function prefixVariableReferences(node, prefix) {
|
|
11158
|
-
if (node["kind"] ===
|
|
11222
|
+
if (node["kind"] === chunkVDPZQ5F3_cjs.Kind.VARIABLE && typeof node["name"]?.["value"] === "string") {
|
|
11159
11223
|
node["name"]["value"] = `${prefix}${node["name"]["value"]}`;
|
|
11160
11224
|
return;
|
|
11161
11225
|
}
|
|
@@ -11180,7 +11244,7 @@ function buildPrefixedVariableDefinitions(varDefs, prefix) {
|
|
|
11180
11244
|
}
|
|
11181
11245
|
function extractIncludeInfo(nestedDocument, nestedFieldName, parentVarNames) {
|
|
11182
11246
|
const opDef = nestedDocument.definitions.find(
|
|
11183
|
-
(d) => d.kind ===
|
|
11247
|
+
(d) => d.kind === chunkVDPZQ5F3_cjs.Kind.OPERATION_DEFINITION
|
|
11184
11248
|
);
|
|
11185
11249
|
if (!opDef) {
|
|
11186
11250
|
return { variableDefinitions: [], fieldArguments: [] };
|
|
@@ -11192,7 +11256,7 @@ function extractIncludeInfo(nestedDocument, nestedFieldName, parentVarNames) {
|
|
|
11192
11256
|
let fieldArguments = [];
|
|
11193
11257
|
function findNestedField(selectionSet) {
|
|
11194
11258
|
for (const sel of selectionSet.selections) {
|
|
11195
|
-
if (sel.kind ===
|
|
11259
|
+
if (sel.kind === chunkVDPZQ5F3_cjs.Kind.FIELD) {
|
|
11196
11260
|
if (sel.name.value === nestedFieldName && sel.arguments) {
|
|
11197
11261
|
fieldArguments = sel.arguments;
|
|
11198
11262
|
return;
|
|
@@ -23257,5 +23321,5 @@ exports.getOrCreateDatabase = getOrCreateDatabase;
|
|
|
23257
23321
|
exports.reconstructConnectionNodes = reconstructConnectionNodes;
|
|
23258
23322
|
exports.reconstructEntity = reconstructEntity;
|
|
23259
23323
|
exports.uploadFile = uploadFile;
|
|
23260
|
-
//# sourceMappingURL=chunk-
|
|
23261
|
-
//# sourceMappingURL=chunk-
|
|
23324
|
+
//# sourceMappingURL=chunk-CGJTK2BE.cjs.map
|
|
23325
|
+
//# sourceMappingURL=chunk-CGJTK2BE.cjs.map
|