@contello/store 3.1.0 → 4.1.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/index.cjs +108 -87
- package/dist/index.d.cts +1 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -28
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _contello_client = require("@contello/client");
|
|
3
|
-
let
|
|
3
|
+
let _entwico_dash_async = require("@entwico/dash/async");
|
|
4
|
+
let _entwico_projected = require("@entwico/projected");
|
|
4
5
|
let _contello_opentelemetry = require("@contello/opentelemetry");
|
|
6
|
+
let _entwico_dash = require("@entwico/dash");
|
|
5
7
|
let lru_cache = require("lru-cache");
|
|
6
8
|
//#region src/generated/graphql.ts
|
|
7
9
|
const MediaAssetFragmentSchema = `fragment MediaAsset on ContelloAsset {
|
|
@@ -141,9 +143,7 @@ const schema = {
|
|
|
141
143
|
},
|
|
142
144
|
sources: {
|
|
143
145
|
storeAsset: {
|
|
144
|
-
document: `${MediaFileFragmentSchema}
|
|
145
|
-
${MediaAssetFragmentSchema}
|
|
146
|
-
${StoreAssetFragmentSchema}`,
|
|
146
|
+
document: `${MediaFileFragmentSchema}\n${MediaAssetFragmentSchema}\n${StoreAssetFragmentSchema}`,
|
|
147
147
|
fragment: "StoreAsset",
|
|
148
148
|
subscription: "contelloAssetsBatch",
|
|
149
149
|
__model: "storeAsset",
|
|
@@ -210,7 +210,7 @@ function createRefresher(fn, onRefreshed, onStart) {
|
|
|
210
210
|
refreshing = true;
|
|
211
211
|
inFlightKind = kind;
|
|
212
212
|
onStart?.();
|
|
213
|
-
(0,
|
|
213
|
+
(0, _entwico_dash_async.retryWithBackoff)(fn).then(() => {
|
|
214
214
|
const finished = inFlightKind;
|
|
215
215
|
refreshing = false;
|
|
216
216
|
inFlightKind = void 0;
|
|
@@ -225,7 +225,7 @@ function createRefresher(fn, onRefreshed, onStart) {
|
|
|
225
225
|
return scheduleRefresh;
|
|
226
226
|
}
|
|
227
227
|
function createRefreshChannel(onRefresh) {
|
|
228
|
-
const stream$ = (0,
|
|
228
|
+
const stream$ = (0, _entwico_dash_async.createAsyncIterableSubject)();
|
|
229
229
|
return {
|
|
230
230
|
stream$,
|
|
231
231
|
emit(event) {
|
|
@@ -310,10 +310,10 @@ function createAssetsCollection(options, client, updates$, refreshByTtl) {
|
|
|
310
310
|
});
|
|
311
311
|
let loaded = false;
|
|
312
312
|
const assetsSourceDoc = (0, _contello_client.createSourceSubscription)(schema.sources.storeAsset);
|
|
313
|
-
const projected
|
|
313
|
+
const projected = new _entwico_projected.ProjectedMap({
|
|
314
314
|
key: (asset) => asset.id,
|
|
315
315
|
values: (ids) => wrap("assets", async () => {
|
|
316
|
-
const items = (await (0,
|
|
316
|
+
const items = (await (0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe(assetsSourceDoc, { ids }), (data) => data.source))).map((item) => mapAsset$1(item));
|
|
317
317
|
if (ids === void 0 && !loaded) {
|
|
318
318
|
loaded = true;
|
|
319
319
|
ttl.mark();
|
|
@@ -329,8 +329,8 @@ function createAssetsCollection(options, client, updates$, refreshByTtl) {
|
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
function runFullRefresh(kind) {
|
|
332
|
-
refreshByTtl.enqueue(() => (0,
|
|
333
|
-
emit((await projected
|
|
332
|
+
refreshByTtl.enqueue(() => (0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
333
|
+
emit((await projected.refresh()).keys().toArray(), kind);
|
|
334
334
|
ttl.mark();
|
|
335
335
|
}));
|
|
336
336
|
}
|
|
@@ -340,8 +340,8 @@ function createAssetsCollection(options, client, updates$, refreshByTtl) {
|
|
|
340
340
|
emit(changedIds, "upstream-update");
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
(0,
|
|
344
|
-
await projected
|
|
343
|
+
(0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
344
|
+
await projected.refresh(refreshIds);
|
|
345
345
|
emit(changedIds, "upstream-update");
|
|
346
346
|
});
|
|
347
347
|
}
|
|
@@ -352,20 +352,20 @@ function createAssetsCollection(options, client, updates$, refreshByTtl) {
|
|
|
352
352
|
for (const event of batch.asset) if (event.mutation === "delete") deleted.push(event.id);
|
|
353
353
|
else upserted.add(event.id);
|
|
354
354
|
if (cache.eviction === "clear") {
|
|
355
|
-
projected
|
|
355
|
+
projected.clear();
|
|
356
356
|
return;
|
|
357
357
|
}
|
|
358
|
-
if (deleted.length > 0) projected
|
|
358
|
+
if (deleted.length > 0) projected.delete(deleted);
|
|
359
359
|
runPartialRefresh([...upserted], deleted);
|
|
360
360
|
});
|
|
361
361
|
return {
|
|
362
362
|
instance: {
|
|
363
363
|
refresh$: channel.stream$,
|
|
364
364
|
async load() {
|
|
365
|
-
if (!loaded) await projected
|
|
365
|
+
if (!loaded) await projected.getAllAsMap();
|
|
366
366
|
},
|
|
367
367
|
get(idOrIds) {
|
|
368
|
-
return projected
|
|
368
|
+
return projected.get(idOrIds);
|
|
369
369
|
},
|
|
370
370
|
upload(data, meta, options) {
|
|
371
371
|
return client.upload(data, meta, options);
|
|
@@ -555,7 +555,7 @@ var DependencyCollector = class {
|
|
|
555
555
|
//#endregion
|
|
556
556
|
//#region src/collection.ts
|
|
557
557
|
function fetchCollection(source, client, ids) {
|
|
558
|
-
return (0,
|
|
558
|
+
return (0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe((0, _contello_client.createSourceSubscription)(source), { ids }), (r) => r.source));
|
|
559
559
|
}
|
|
560
560
|
function createCollection(source, options, client, updates$, resolver, refreshByTtl) {
|
|
561
561
|
const opts = options ?? {};
|
|
@@ -575,10 +575,10 @@ function createCollection(source, options, client, updates$, resolver, refreshBy
|
|
|
575
575
|
run: () => runFullRefresh("ttl")
|
|
576
576
|
});
|
|
577
577
|
let loaded = false;
|
|
578
|
-
const projected
|
|
578
|
+
const projected = new _entwico_projected.ProjectedMap({
|
|
579
579
|
key: (item) => item.id,
|
|
580
|
-
values: (ids) => wrap(`collection:${_def.name}`, () => (0,
|
|
581
|
-
const items = await Promise.all(rawItems.map((item) => Promise.resolve(dependencyCollector.createContext((ref, register) => (0,
|
|
580
|
+
values: (ids) => wrap(`collection:${_def.name}`, () => (0, _entwico_dash.maybeThen)(fetchCollection(source, client, ids), async (rawItems) => {
|
|
581
|
+
const items = await Promise.all(rawItems.map((item) => Promise.resolve(dependencyCollector.createContext((ref, register) => (0, _entwico_dash.maybeThen)(mapFn(item, ref), (mapped) => {
|
|
582
582
|
register(mapped.id);
|
|
583
583
|
return mapped;
|
|
584
584
|
})))));
|
|
@@ -604,8 +604,8 @@ function createCollection(source, options, client, updates$, resolver, refreshBy
|
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
function runFullRefresh(kind) {
|
|
607
|
-
refreshByTtl.enqueue(() => (0,
|
|
608
|
-
emit((await projected
|
|
607
|
+
refreshByTtl.enqueue(() => (0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
608
|
+
emit((await projected.refresh()).keys().toArray(), kind);
|
|
609
609
|
ttl.mark();
|
|
610
610
|
}));
|
|
611
611
|
}
|
|
@@ -615,8 +615,8 @@ function createCollection(source, options, client, updates$, resolver, refreshBy
|
|
|
615
615
|
emit(changedIds, "upstream-update");
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
|
-
(0,
|
|
619
|
-
await projected
|
|
618
|
+
(0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
619
|
+
await projected.refresh(refreshIds);
|
|
620
620
|
emit(changedIds, "upstream-update");
|
|
621
621
|
});
|
|
622
622
|
}
|
|
@@ -632,11 +632,11 @@ function createCollection(source, options, client, updates$, resolver, refreshBy
|
|
|
632
632
|
if (deleted.length === 0 && upserted.size === 0 && depAffected.size === 0) return;
|
|
633
633
|
if (_def.cache.eviction === "clear") {
|
|
634
634
|
dependencyCollector.clear();
|
|
635
|
-
projected
|
|
635
|
+
projected.clear();
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
638
638
|
for (const id of deleted) dependencyCollector.removeItem(id);
|
|
639
|
-
if (deleted.length > 0) projected
|
|
639
|
+
if (deleted.length > 0) projected.delete(deleted);
|
|
640
640
|
const refreshIds = upserted.union(depAffected);
|
|
641
641
|
for (const id of deleted) refreshIds.delete(id);
|
|
642
642
|
runPartialRefresh([...refreshIds], deleted);
|
|
@@ -646,16 +646,16 @@ function createCollection(source, options, client, updates$, resolver, refreshBy
|
|
|
646
646
|
name: _def.name,
|
|
647
647
|
refresh$: channel.stream$,
|
|
648
648
|
get(idOrIds) {
|
|
649
|
-
return projected
|
|
649
|
+
return projected.get(idOrIds);
|
|
650
650
|
},
|
|
651
651
|
getAll() {
|
|
652
|
-
return projected
|
|
652
|
+
return projected.getAll();
|
|
653
653
|
},
|
|
654
654
|
refresh() {
|
|
655
655
|
runFullRefresh("on-demand");
|
|
656
656
|
},
|
|
657
657
|
async load() {
|
|
658
|
-
if (!loaded) await projected
|
|
658
|
+
if (!loaded) await projected.getAllAsMap();
|
|
659
659
|
}
|
|
660
660
|
},
|
|
661
661
|
destroy() {
|
|
@@ -714,10 +714,10 @@ function createI18nMessagesCollection(def, client, updates$, refreshByTtl) {
|
|
|
714
714
|
});
|
|
715
715
|
let loaded = false;
|
|
716
716
|
const i18nSourceDoc = (0, _contello_client.createSourceSubscription)(schema.sources.storeI18nMessage);
|
|
717
|
-
const projected
|
|
717
|
+
const projected = new _entwico_projected.ProjectedMap({
|
|
718
718
|
key: (msg) => msg.id,
|
|
719
719
|
values: (ids) => wrap(`i18n:${def.collection}`, async () => {
|
|
720
|
-
const items = (await (0,
|
|
720
|
+
const items = (await (0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe(i18nSourceDoc, {
|
|
721
721
|
collection: def.collection,
|
|
722
722
|
ids
|
|
723
723
|
}), (data) => data.source))).map((msg) => ({
|
|
@@ -739,18 +739,18 @@ function createI18nMessagesCollection(def, client, updates$, refreshByTtl) {
|
|
|
739
739
|
});
|
|
740
740
|
}
|
|
741
741
|
function emitWithCurrentIds(kind) {
|
|
742
|
-
(0,
|
|
742
|
+
(0, _entwico_dash.maybeThen)(projected.getAll(), (msgs) => {
|
|
743
743
|
emit(msgs.map((m) => m.id), kind);
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
746
|
function runTtlRefresh() {
|
|
747
747
|
refreshByTtl.enqueue(async () => {
|
|
748
|
-
await (0,
|
|
748
|
+
await (0, _entwico_dash_async.retryWithBackoff)(() => projected.refresh());
|
|
749
749
|
emitWithCurrentIds("ttl");
|
|
750
750
|
ttl.mark();
|
|
751
751
|
});
|
|
752
752
|
}
|
|
753
|
-
const scheduleRefresh = createRefresher(() => projected
|
|
753
|
+
const scheduleRefresh = createRefresher(() => projected.refresh(), (kind) => {
|
|
754
754
|
emitWithCurrentIds(kind);
|
|
755
755
|
ttl.mark();
|
|
756
756
|
}, () => {});
|
|
@@ -761,8 +761,8 @@ function createI18nMessagesCollection(def, client, updates$, refreshByTtl) {
|
|
|
761
761
|
emit(changedIds, "upstream-update");
|
|
762
762
|
return;
|
|
763
763
|
}
|
|
764
|
-
(0,
|
|
765
|
-
await projected
|
|
764
|
+
(0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
765
|
+
await projected.refresh(upsertedIds);
|
|
766
766
|
emit(changedIds, "upstream-update");
|
|
767
767
|
});
|
|
768
768
|
}
|
|
@@ -773,16 +773,16 @@ function createI18nMessagesCollection(def, client, updates$, refreshByTtl) {
|
|
|
773
773
|
const upserted = /* @__PURE__ */ new Set();
|
|
774
774
|
for (const event of batch.i18nMessage) if (event.mutation === "delete") deleted.push(event.id);
|
|
775
775
|
else upserted.add(event.id);
|
|
776
|
-
if (deleted.length > 0) projected
|
|
776
|
+
if (deleted.length > 0) projected.delete(deleted);
|
|
777
777
|
runPartialRefresh([...upserted], deleted);
|
|
778
778
|
});
|
|
779
779
|
return {
|
|
780
780
|
refresh$: channel.stream$,
|
|
781
781
|
get(idOrIds) {
|
|
782
|
-
return projected
|
|
782
|
+
return projected.get(idOrIds);
|
|
783
783
|
},
|
|
784
784
|
getAll() {
|
|
785
|
-
return projected
|
|
785
|
+
return projected.getAll();
|
|
786
786
|
},
|
|
787
787
|
register(messages) {
|
|
788
788
|
return wrap(`i18n-register:${def.collection}`, async () => {
|
|
@@ -860,10 +860,10 @@ function createLazyAssetsCollection(def, client, updates$) {
|
|
|
860
860
|
onEvict: void 0
|
|
861
861
|
});
|
|
862
862
|
const assetsSourceDoc = (0, _contello_client.createSourceSubscription)(schema.sources.storeAsset);
|
|
863
|
-
const projected
|
|
863
|
+
const projected = new _entwico_projected.ProjectedLazyMap({
|
|
864
864
|
key: (asset) => asset.id,
|
|
865
865
|
values: (ids) => wrap("assets", async () => {
|
|
866
|
-
return (await (0,
|
|
866
|
+
return (await (0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe(assetsSourceDoc, { ids }), (data) => data.source))).map((item) => mapAsset(item));
|
|
867
867
|
}),
|
|
868
868
|
cache
|
|
869
869
|
});
|
|
@@ -878,20 +878,20 @@ function createLazyAssetsCollection(def, client, updates$) {
|
|
|
878
878
|
const scheduleRefresh = createRefresher(async () => {
|
|
879
879
|
lastRefreshKeys = cache.keys();
|
|
880
880
|
if (lastRefreshKeys.length === 0) return;
|
|
881
|
-
await projected
|
|
881
|
+
await projected.refresh(lastRefreshKeys);
|
|
882
882
|
}, (kind) => {
|
|
883
883
|
if (lastRefreshKeys.length > 0) emit(lastRefreshKeys, kind);
|
|
884
884
|
}, () => {});
|
|
885
885
|
const unsubUpdates = updates$.subscribe((batch) => {
|
|
886
886
|
if (batch.asset.length === 0) return;
|
|
887
|
-
for (const event of batch.asset) projected
|
|
887
|
+
for (const event of batch.asset) projected.delete(event.id);
|
|
888
888
|
emit(batch.asset.map((e) => e.id), "upstream-update");
|
|
889
889
|
});
|
|
890
890
|
return {
|
|
891
891
|
instance: {
|
|
892
892
|
refresh$: channel.stream$,
|
|
893
893
|
get(idOrIds) {
|
|
894
|
-
return projected
|
|
894
|
+
return projected.get(idOrIds);
|
|
895
895
|
},
|
|
896
896
|
upload(data, meta, options) {
|
|
897
897
|
return client.upload(data, meta, options);
|
|
@@ -906,7 +906,7 @@ function createLazyAssetsCollection(def, client, updates$) {
|
|
|
906
906
|
scheduleRefresh("on-demand");
|
|
907
907
|
},
|
|
908
908
|
clear() {
|
|
909
|
-
projected
|
|
909
|
+
projected.clear();
|
|
910
910
|
}
|
|
911
911
|
},
|
|
912
912
|
destroy() {
|
|
@@ -934,15 +934,15 @@ function createLazyCollection(source, options, client, updates$, resolver) {
|
|
|
934
934
|
ttl: _def.cache.ttl,
|
|
935
935
|
onEvict: (_value, key) => dependencyCollector.removeItem(key)
|
|
936
936
|
});
|
|
937
|
-
const projected
|
|
937
|
+
const projected = new _entwico_projected.ProjectedLazyMap({
|
|
938
938
|
key: (item) => item.id,
|
|
939
|
-
values: (keys) => wrap(`lazy-collection:${_def.name}`, () => (0,
|
|
939
|
+
values: (keys) => wrap(`lazy-collection:${_def.name}`, () => (0, _entwico_dash.maybeThen)((0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe((0, _contello_client.createSourceSubscription)(source), { ids: keys }), (r) => r.source)), (rawItems) => Promise.all(rawItems.map((item) => Promise.resolve(dependencyCollector.createContext((ref, register) => (0, _entwico_dash.maybeThen)(mapFn(item, ref), (mapped) => {
|
|
940
940
|
register(mapped.id);
|
|
941
941
|
return mapped;
|
|
942
942
|
}))))))),
|
|
943
943
|
cache
|
|
944
944
|
});
|
|
945
|
-
const refresh$ = (0,
|
|
945
|
+
const refresh$ = (0, _entwico_dash_async.createAsyncIterableSubject)();
|
|
946
946
|
function emit(ids, kind) {
|
|
947
947
|
const event = {
|
|
948
948
|
ids,
|
|
@@ -955,7 +955,7 @@ function createLazyCollection(source, options, client, updates$, resolver) {
|
|
|
955
955
|
const scheduleRefresh = createRefresher(async () => {
|
|
956
956
|
lastRefreshKeys = cache.keys();
|
|
957
957
|
if (lastRefreshKeys.length === 0) return;
|
|
958
|
-
await projected
|
|
958
|
+
await projected.refresh(lastRefreshKeys);
|
|
959
959
|
}, (kind) => {
|
|
960
960
|
if (lastRefreshKeys.length > 0) emit(lastRefreshKeys, kind);
|
|
961
961
|
}, () => {});
|
|
@@ -967,7 +967,7 @@ function createLazyCollection(source, options, client, updates$, resolver) {
|
|
|
967
967
|
if (evicted.size > 0) {
|
|
968
968
|
for (const key of evicted) {
|
|
969
969
|
dependencyCollector.removeItem(key);
|
|
970
|
-
projected
|
|
970
|
+
projected.delete(key);
|
|
971
971
|
}
|
|
972
972
|
emit([...evicted], "upstream-update");
|
|
973
973
|
}
|
|
@@ -977,14 +977,14 @@ function createLazyCollection(source, options, client, updates$, resolver) {
|
|
|
977
977
|
name: _def.name,
|
|
978
978
|
refresh$,
|
|
979
979
|
get(idOrIds) {
|
|
980
|
-
return projected
|
|
980
|
+
return projected.get(idOrIds);
|
|
981
981
|
},
|
|
982
982
|
refresh() {
|
|
983
983
|
scheduleRefresh("on-demand");
|
|
984
984
|
},
|
|
985
985
|
clear() {
|
|
986
986
|
dependencyCollector.clear();
|
|
987
|
-
projected
|
|
987
|
+
projected.clear();
|
|
988
988
|
}
|
|
989
989
|
},
|
|
990
990
|
destroy() {
|
|
@@ -1113,11 +1113,16 @@ function createLazyRoutesCollection(def, client, updates$, resolver) {
|
|
|
1113
1113
|
ttl: resolveTtl(def?.cache?.ttl)
|
|
1114
1114
|
} };
|
|
1115
1115
|
const cache = createRoutesCache(_def.cache.max, _def.cache.ttl);
|
|
1116
|
+
const negatives = createLruCache({
|
|
1117
|
+
max: _def.cache.max,
|
|
1118
|
+
ttl: _def.cache.ttl,
|
|
1119
|
+
onEvict: void 0
|
|
1120
|
+
});
|
|
1116
1121
|
const routesSourceDoc = (0, _contello_client.createSourceSubscription)(schema.sources.storeRoute);
|
|
1117
1122
|
function fetchRoutes(vars) {
|
|
1118
|
-
return (0,
|
|
1123
|
+
return (0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe(routesSourceDoc, vars), (data) => data.source));
|
|
1119
1124
|
}
|
|
1120
|
-
const projected
|
|
1125
|
+
const projected = new _entwico_projected.ProjectedLazyMap({
|
|
1121
1126
|
key: (route) => route[CACHE_KEY] ?? ID_PREFIX + route.id,
|
|
1122
1127
|
values: (prefixedKeys) => wrap("routes", async () => {
|
|
1123
1128
|
const ids = [];
|
|
@@ -1130,7 +1135,10 @@ function createLazyRoutesCollection(def, client, updates$, resolver) {
|
|
|
1130
1135
|
const [rawByIds, rawByPaths] = await Promise.all([ids.length > 0 ? fetchRoutes({ ids }) : Promise.resolve([]), paths.length > 0 ? fetchRoutes({ paths }) : Promise.resolve([])]);
|
|
1131
1136
|
const byIds = collectRoutes(rawByIds, (r) => ID_PREFIX + r.id, resolver);
|
|
1132
1137
|
const byPaths = collectRoutes(rawByPaths, (r) => PATH_PREFIX + r.path, resolver);
|
|
1133
|
-
|
|
1138
|
+
const found = [...byIds, ...byPaths];
|
|
1139
|
+
const foundKeys = new Set(found.map((route) => route[CACHE_KEY]));
|
|
1140
|
+
for (const key of prefixedKeys) if (!foundKeys.has(key)) negatives.set(key, true);
|
|
1141
|
+
return found;
|
|
1134
1142
|
}),
|
|
1135
1143
|
cache
|
|
1136
1144
|
});
|
|
@@ -1145,7 +1153,7 @@ function createLazyRoutesCollection(def, client, updates$, resolver) {
|
|
|
1145
1153
|
const scheduleRefresh = createRefresher(async () => {
|
|
1146
1154
|
lastRefreshKeys = cache.keys();
|
|
1147
1155
|
if (lastRefreshKeys.length === 0) return;
|
|
1148
|
-
await projected
|
|
1156
|
+
await projected.refresh(lastRefreshKeys);
|
|
1149
1157
|
}, (kind) => {
|
|
1150
1158
|
if (lastRefreshKeys.length > 0) emit(lastRefreshKeys.map((key) => key.slice(2)), kind);
|
|
1151
1159
|
}, () => {});
|
|
@@ -1157,28 +1165,41 @@ function createLazyRoutesCollection(def, client, updates$, resolver) {
|
|
|
1157
1165
|
cache.delete(idKey);
|
|
1158
1166
|
evicted.push(event.id);
|
|
1159
1167
|
} else {
|
|
1168
|
+
negatives.delete(idKey);
|
|
1169
|
+
negatives.delete(PATH_PREFIX + event.after.path);
|
|
1160
1170
|
if (cache.has(idKey)) cache.set(idKey, event.after);
|
|
1161
1171
|
evicted.push(event.after.path);
|
|
1162
1172
|
}
|
|
1163
1173
|
}
|
|
1164
1174
|
if (evicted.length > 0) emit(evicted, "upstream-update");
|
|
1165
1175
|
});
|
|
1176
|
+
function lookupOne(key) {
|
|
1177
|
+
if (negatives.has(key)) return;
|
|
1178
|
+
return projected.get(key);
|
|
1179
|
+
}
|
|
1180
|
+
function lookupMany(keys) {
|
|
1181
|
+
const known = keys.filter((key) => !negatives.has(key));
|
|
1182
|
+
if (known.length === 0) return [];
|
|
1183
|
+
return projected.get(known);
|
|
1184
|
+
}
|
|
1166
1185
|
return {
|
|
1167
1186
|
instance: {
|
|
1168
1187
|
refresh$: channel.stream$,
|
|
1169
1188
|
get(idOrIds) {
|
|
1170
|
-
if (Array.isArray(idOrIds)) return
|
|
1171
|
-
return
|
|
1189
|
+
if (Array.isArray(idOrIds)) return lookupMany(idOrIds.map((id) => ID_PREFIX + id));
|
|
1190
|
+
return lookupOne(ID_PREFIX + idOrIds);
|
|
1172
1191
|
},
|
|
1173
1192
|
getByPath(pathOrPaths) {
|
|
1174
|
-
if (Array.isArray(pathOrPaths)) return
|
|
1175
|
-
return
|
|
1193
|
+
if (Array.isArray(pathOrPaths)) return lookupMany(pathOrPaths.map((p) => PATH_PREFIX + p));
|
|
1194
|
+
return lookupOne(PATH_PREFIX + pathOrPaths);
|
|
1176
1195
|
},
|
|
1177
1196
|
refresh() {
|
|
1197
|
+
negatives.clear();
|
|
1178
1198
|
scheduleRefresh("on-demand");
|
|
1179
1199
|
},
|
|
1180
1200
|
clear() {
|
|
1181
|
-
|
|
1201
|
+
negatives.clear();
|
|
1202
|
+
projected.clear();
|
|
1182
1203
|
}
|
|
1183
1204
|
},
|
|
1184
1205
|
destroy() {
|
|
@@ -1242,10 +1263,10 @@ function createRoutesCollection(options, client, updates$, resolver, refreshByTt
|
|
|
1242
1263
|
const idByPath = /* @__PURE__ */ new Map();
|
|
1243
1264
|
let loaded = false;
|
|
1244
1265
|
const routesSourceDoc = (0, _contello_client.createSourceSubscription)(schema.sources.storeRoute);
|
|
1245
|
-
const projected
|
|
1266
|
+
const projected = new _entwico_projected.ProjectedMap({
|
|
1246
1267
|
key: (route) => route.id,
|
|
1247
1268
|
values: (ids) => wrap("routes", async () => {
|
|
1248
|
-
const items = (await (0,
|
|
1269
|
+
const items = (await (0, _entwico_dash_async.concatAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe(routesSourceDoc, { ids }), (data) => data.source))).reduce((acc, raw) => {
|
|
1249
1270
|
const mapped = mapRoute(raw, resolver);
|
|
1250
1271
|
if (mapped) acc.push(mapped);
|
|
1251
1272
|
return acc;
|
|
@@ -1289,8 +1310,8 @@ function createRoutesCollection(options, client, updates$, resolver, refreshByTt
|
|
|
1289
1310
|
});
|
|
1290
1311
|
}
|
|
1291
1312
|
function runFullRefresh(kind) {
|
|
1292
|
-
refreshByTtl.enqueue(() => (0,
|
|
1293
|
-
emit((await projected
|
|
1313
|
+
refreshByTtl.enqueue(() => (0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
1314
|
+
emit((await projected.refresh()).keys().toArray(), kind);
|
|
1294
1315
|
ttl.mark();
|
|
1295
1316
|
}));
|
|
1296
1317
|
}
|
|
@@ -1300,8 +1321,8 @@ function createRoutesCollection(options, client, updates$, resolver, refreshByTt
|
|
|
1300
1321
|
emit(changedIds, "upstream-update");
|
|
1301
1322
|
return;
|
|
1302
1323
|
}
|
|
1303
|
-
(0,
|
|
1304
|
-
await projected
|
|
1324
|
+
(0, _entwico_dash_async.retryWithBackoff)(async () => {
|
|
1325
|
+
await projected.refresh(refreshIds);
|
|
1305
1326
|
emit(changedIds, "upstream-update");
|
|
1306
1327
|
});
|
|
1307
1328
|
}
|
|
@@ -1314,7 +1335,7 @@ function createRoutesCollection(options, client, updates$, resolver, refreshByTt
|
|
|
1314
1335
|
if (cache.eviction === "clear") {
|
|
1315
1336
|
pathById.clear();
|
|
1316
1337
|
idByPath.clear();
|
|
1317
|
-
projected
|
|
1338
|
+
projected.clear();
|
|
1318
1339
|
return;
|
|
1319
1340
|
}
|
|
1320
1341
|
for (const id of deleted) {
|
|
@@ -1324,40 +1345,40 @@ function createRoutesCollection(options, client, updates$, resolver, refreshByTt
|
|
|
1324
1345
|
pathById.delete(id);
|
|
1325
1346
|
}
|
|
1326
1347
|
}
|
|
1327
|
-
if (deleted.length > 0) projected
|
|
1348
|
+
if (deleted.length > 0) projected.delete(deleted);
|
|
1328
1349
|
runPartialRefresh([...upserted], deleted);
|
|
1329
1350
|
});
|
|
1330
1351
|
function getByIdSingle(id) {
|
|
1331
|
-
return projected
|
|
1352
|
+
return projected.get(id);
|
|
1332
1353
|
}
|
|
1333
1354
|
function getByIds(ids) {
|
|
1334
|
-
return projected
|
|
1355
|
+
return projected.get(ids);
|
|
1335
1356
|
}
|
|
1336
1357
|
function lookupByPathSingle(path) {
|
|
1337
|
-
return (0,
|
|
1358
|
+
return (0, _entwico_dash.maybeThen)(ensureLoaded(), () => {
|
|
1338
1359
|
const id = idByPath.get(path);
|
|
1339
|
-
return id === void 0 ? void 0 : projected
|
|
1360
|
+
return id === void 0 ? void 0 : projected.get(id);
|
|
1340
1361
|
});
|
|
1341
1362
|
}
|
|
1342
1363
|
function lookupByPaths(paths) {
|
|
1343
|
-
return (0,
|
|
1364
|
+
return (0, _entwico_dash.maybeThen)(ensureLoaded(), () => {
|
|
1344
1365
|
const ids = [];
|
|
1345
1366
|
for (const p of paths) {
|
|
1346
1367
|
const id = idByPath.get(p);
|
|
1347
1368
|
if (id !== void 0) ids.push(id);
|
|
1348
1369
|
}
|
|
1349
|
-
return projected
|
|
1370
|
+
return projected.get(ids);
|
|
1350
1371
|
});
|
|
1351
1372
|
}
|
|
1352
1373
|
function ensureLoaded() {
|
|
1353
1374
|
if (loaded) return;
|
|
1354
|
-
return (0,
|
|
1375
|
+
return (0, _entwico_dash.maybeThen)(projected.getAllAsMap(), () => {});
|
|
1355
1376
|
}
|
|
1356
1377
|
return {
|
|
1357
1378
|
instance: {
|
|
1358
1379
|
refresh$: channel.stream$,
|
|
1359
1380
|
async load() {
|
|
1360
|
-
if (!loaded) await projected
|
|
1381
|
+
if (!loaded) await projected.getAllAsMap();
|
|
1361
1382
|
},
|
|
1362
1383
|
get(idOrIds) {
|
|
1363
1384
|
return typeof idOrIds === "string" ? getByIdSingle(idOrIds) : getByIds(idOrIds);
|
|
@@ -1416,7 +1437,7 @@ function createSingleton(source, options, client, updates$, resolver, refreshByT
|
|
|
1416
1437
|
run: () => runTtlRefresh()
|
|
1417
1438
|
});
|
|
1418
1439
|
let loaded = false;
|
|
1419
|
-
const projected
|
|
1440
|
+
const projected = new _entwico_projected.ProjectedValue({ value: () => wrap(`singleton:${_def.name}`, () => (0, _entwico_dash.maybeThen)((0, _entwico_dash_async.firstAsync)((0, _entwico_dash_async.mapAsync)(client.subscribe((0, _contello_client.createSourceSubscription)(source)), (r) => r.source)), (raw) => dependencyCollector.createContext((ref, register) => (0, _entwico_dash.maybeThen)(mapFn(raw, ref), (mapped) => {
|
|
1420
1441
|
register(itemKey);
|
|
1421
1442
|
if (!loaded) {
|
|
1422
1443
|
loaded = true;
|
|
@@ -1430,12 +1451,12 @@ function createSingleton(source, options, client, updates$, resolver, refreshByT
|
|
|
1430
1451
|
}
|
|
1431
1452
|
function runTtlRefresh() {
|
|
1432
1453
|
refreshByTtl.enqueue(async () => {
|
|
1433
|
-
await (0,
|
|
1454
|
+
await (0, _entwico_dash_async.retryWithBackoff)(() => projected.refresh());
|
|
1434
1455
|
emit("ttl");
|
|
1435
1456
|
ttl.mark();
|
|
1436
1457
|
});
|
|
1437
1458
|
}
|
|
1438
|
-
const scheduleRefresh = createRefresher(() => projected
|
|
1459
|
+
const scheduleRefresh = createRefresher(() => projected.refresh(), (kind) => {
|
|
1439
1460
|
emit(kind);
|
|
1440
1461
|
ttl.mark();
|
|
1441
1462
|
}, () => {});
|
|
@@ -1446,7 +1467,7 @@ function createSingleton(source, options, client, updates$, resolver, refreshByT
|
|
|
1446
1467
|
if (!hasOwnModel && !hasAffectedRefs) return;
|
|
1447
1468
|
if (_def.cache.eviction === "clear") {
|
|
1448
1469
|
dependencyCollector.clear();
|
|
1449
|
-
projected
|
|
1470
|
+
projected.clear();
|
|
1450
1471
|
return;
|
|
1451
1472
|
}
|
|
1452
1473
|
scheduleRefresh("upstream-update");
|
|
@@ -1456,13 +1477,13 @@ function createSingleton(source, options, client, updates$, resolver, refreshByT
|
|
|
1456
1477
|
name: _def.name,
|
|
1457
1478
|
refresh$: channel.stream$,
|
|
1458
1479
|
get() {
|
|
1459
|
-
return projected
|
|
1480
|
+
return projected.get();
|
|
1460
1481
|
},
|
|
1461
1482
|
refresh() {
|
|
1462
1483
|
scheduleRefresh("on-demand");
|
|
1463
1484
|
},
|
|
1464
1485
|
async load() {
|
|
1465
|
-
if (!loaded) await projected
|
|
1486
|
+
if (!loaded) await projected.get();
|
|
1466
1487
|
}
|
|
1467
1488
|
},
|
|
1468
1489
|
destroy() {
|
|
@@ -1603,7 +1624,7 @@ function safeMapEvent(raw, resolver) {
|
|
|
1603
1624
|
}
|
|
1604
1625
|
}
|
|
1605
1626
|
function createInternalWatcher(client, resolver) {
|
|
1606
|
-
const updates$ = (0,
|
|
1627
|
+
const updates$ = (0, _entwico_dash_async.createAsyncIterableSubject)();
|
|
1607
1628
|
let controller;
|
|
1608
1629
|
return {
|
|
1609
1630
|
updates$,
|
|
@@ -1613,7 +1634,7 @@ function createInternalWatcher(client, resolver) {
|
|
|
1613
1634
|
const signal = controller.signal;
|
|
1614
1635
|
wrap("watcher:start", () => {
|
|
1615
1636
|
(async () => {
|
|
1616
|
-
const events = (0,
|
|
1637
|
+
const events = (0, _entwico_dash_async.mapAsync)((0, _entwico_dash_async.keepalive)(() => client.subscribe(storeWatchUpdatesDocument), { signal }), (data) => (data.contelloUpdatesBatch?.events ?? []).map((e) => safeMapEvent(e, resolver)).filter((e) => e !== void 0));
|
|
1617
1638
|
for await (const list of events) {
|
|
1618
1639
|
if (signal.aborted) return;
|
|
1619
1640
|
if (list.length === 0) continue;
|
|
@@ -1756,12 +1777,12 @@ exports.createStore = createStore;
|
|
|
1756
1777
|
Object.defineProperty(exports, "maybeCatch", {
|
|
1757
1778
|
enumerable: true,
|
|
1758
1779
|
get: function() {
|
|
1759
|
-
return
|
|
1780
|
+
return _entwico_dash.maybeCatch;
|
|
1760
1781
|
}
|
|
1761
1782
|
});
|
|
1762
1783
|
Object.defineProperty(exports, "maybeThen", {
|
|
1763
1784
|
enumerable: true,
|
|
1764
1785
|
get: function() {
|
|
1765
|
-
return
|
|
1786
|
+
return _entwico_dash.maybeThen;
|
|
1766
1787
|
}
|
|
1767
1788
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ConnectionEvents, ContelloClient, DownloadResult, ProxyResult, Schema, SourceCardinality, SourceDef, UploadData, UploadMetadata, UploadOptions } from "@contello/client";
|
|
2
|
-
import { MaybePromise, MaybePromise as MaybePromise$1, ReadonlyDeep, ReadonlyDeep as ReadonlyDeep$1, maybeCatch, maybeThen } from "
|
|
3
|
-
|
|
2
|
+
import { MaybePromise, MaybePromise as MaybePromise$1, ReadonlyDeep, ReadonlyDeep as ReadonlyDeep$1, maybeCatch, maybeThen } from "@entwico/dash";
|
|
4
3
|
//#region src/routes-mapping.d.ts
|
|
5
4
|
type StoreRouteCustomHeader = {
|
|
6
5
|
name: string;
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/routes-mapping.ts","../src/watcher.ts","../src/dependency-collector.ts","../src/types.ts","../src/lazy-assets.ts","../src/assets.ts","../src/i18n.ts","../src/lazy-routes.ts","../src/routes.ts","../src/store.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/routes-mapping.ts","../src/watcher.ts","../src/dependency-collector.ts","../src/types.ts","../src/lazy-assets.ts","../src/assets.ts","../src/i18n.ts","../src/lazy-routes.ts","../src/routes.ts","../src/store.ts"],"mappings":";;;KAGY,sBAAA;EACV,IAAA;EACA,KAAK;AAAA;AAAA,KAGK,UAAA;EACV,EAAA;EACA,IAAA;EACA,aAAA,EAAe,sBAAsB;AAAA;EAEjC,IAAA;EAAkB,QAAA;EAAkB,MAAA;AAAA;EACpC,IAAA;EAAc,OAAA;EAAiB,QAAA;AAAA;EAC/B,IAAA;EAAe,OAAA;EAAiB,MAAA;EAAgB,kBAAA;EAA6C,QAAA;AAAA;EAC7F,IAAA;EAAgB,KAAA;EAAe,UAAA;EAAoB,QAAA;AAAA;;;KCH7C,WAAA;EACN,EAAA;EAAY,QAAA;EAAoB,MAAA;EAAiB,KAAA,EAAO,UAAA;AAAA;EACxD,EAAA;EAAY,QAAA;EAAoB,MAAA;EAAiB,KAAA,EAAO,UAAA;EAAY,MAAA,EAAQ,UAAA;AAAA;EAC5E,EAAA;EAAY,QAAA;EAAoB,MAAA;AAAA;EAChC,EAAA;EAAY,QAAA;EAA0C,MAAA;AAAA;EACtD,EAAA;EAAY,QAAA;EAA0C,MAAA;EAAuB,KAAA;AAAA;EAC7E,EAAA;EAAY,QAAA;EAA0C,MAAA;EAAkB,KAAA,EAAO,WAAA;AAAA;AAAA,KAEzE,kBAAA,GAAqB,WAAW;AAAA,KAEhC,cAAA,WAAyB,WAAA,cAAyB,OAAA,CAAQ,WAAA;EAAe,MAAA,EAAQ,C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AA,GAAU,aAAA,eAA4B,MAAA;EAanD,gBAAA,CAAiB,OAAA,GAAU,iBAAA,eAAgC,UAAA;EAa3D,gBAAA,CAAiB,OAAA,GAAU,iBAAA,eAAgC,UAAA;EAU3D,YAAA,CAAa,OAAA,GAAU,aAAA,eAA4B,MAAA;EAcnD,gBAAA,CAAiB,OAAA,GAAU,iBAAA,eAAgC,UAAA;EAc3D,gBAAA,CAAiB,OAAA,GAAU,iBAAA,eAAgC,UAAA;EAa3D,kBAAA,CAAmB,GAAA,EAAK,cAAA,GAAiB,YAAA;AAAA;AAAA,iBASlC,WAAA,iBAA4B,MAAA,0BAC1C,OAAA,EAAS,kBAAA,CAAmB,OAAA,IAC3B,KAAA,CAAM,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectionEvents, ContelloClient, DownloadResult, ProxyResult, Schema, SourceCardinality, SourceDef, UploadData, UploadMetadata, UploadOptions } from "@contello/client";
|
|
2
|
-
import { MaybePromise, MaybePromise as MaybePromise$1, ReadonlyDeep, ReadonlyDeep as ReadonlyDeep$1, maybeCatch, maybeThen } from "
|
|
2
|
+
import { MaybePromise, MaybePromise as MaybePromise$1, ReadonlyDeep, ReadonlyDeep as ReadonlyDeep$1, maybeCatch, maybeThen } from "@entwico/dash";
|
|
3
3
|
|
|
4
4
|
//#region src/routes-mapping.d.ts
|
|
5
5
|
type StoreRouteCustomHeader = {
|