flightdeck 0.2.18 → 0.2.20
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.
|
@@ -342,6 +342,9 @@ var simpleLogger = {
|
|
|
342
342
|
warn: simpleLog(`warn`)
|
|
343
343
|
};
|
|
344
344
|
var AtomIOLogger = class {
|
|
345
|
+
logLevel;
|
|
346
|
+
filter;
|
|
347
|
+
logger;
|
|
345
348
|
constructor(logLevel, filter, logger = simpleLogger) {
|
|
346
349
|
this.logLevel = logLevel;
|
|
347
350
|
this.filter = filter;
|
|
@@ -483,19 +486,30 @@ var readOrComputeValue = (target, state) => {
|
|
|
483
486
|
target.logger.info(`\u{1F4D6}`, state.type, state.key, `reading cached value`);
|
|
484
487
|
return readCachedValue(state, target);
|
|
485
488
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
+
switch (state.type) {
|
|
490
|
+
case `selector`:
|
|
491
|
+
case `readonly_selector`:
|
|
492
|
+
target.logger.info(`\u{1F9EE}`, state.type, state.key, `computing value`);
|
|
493
|
+
return state.get();
|
|
494
|
+
case `atom`:
|
|
495
|
+
case `mutable_atom`: {
|
|
496
|
+
const def = state.default;
|
|
497
|
+
let fallback;
|
|
498
|
+
if (def instanceof Function) {
|
|
499
|
+
fallback = def();
|
|
500
|
+
} else {
|
|
501
|
+
fallback = def;
|
|
502
|
+
}
|
|
503
|
+
target.logger.info(
|
|
504
|
+
`\u{1F481}`,
|
|
505
|
+
`atom`,
|
|
506
|
+
state.key,
|
|
507
|
+
`could not find cached value; using default`,
|
|
508
|
+
fallback
|
|
509
|
+
);
|
|
510
|
+
return fallback;
|
|
511
|
+
}
|
|
489
512
|
}
|
|
490
|
-
const fallback = state.default instanceof Function ? state.default() : state.default;
|
|
491
|
-
target.logger.info(
|
|
492
|
-
`\u{1F481}`,
|
|
493
|
-
`atom`,
|
|
494
|
-
state.key,
|
|
495
|
-
`could not find cached value; using default`,
|
|
496
|
-
fallback
|
|
497
|
-
);
|
|
498
|
-
return state.default instanceof Function ? state.default() : state.default;
|
|
499
513
|
};
|
|
500
514
|
|
|
501
515
|
// ../atom.io/internal/src/operation.ts
|
|
@@ -623,55 +637,8 @@ var evictDownStream = (store, atom2) => {
|
|
|
623
637
|
}
|
|
624
638
|
};
|
|
625
639
|
|
|
626
|
-
// ../atom.io/internal/src/set-state/stow-update.ts
|
|
627
|
-
function shouldUpdateBeStowed(key, update) {
|
|
628
|
-
if (isTransceiver(update.newValue)) {
|
|
629
|
-
return false;
|
|
630
|
-
}
|
|
631
|
-
if (key.includes(`\u{1F50D}`)) {
|
|
632
|
-
return false;
|
|
633
|
-
}
|
|
634
|
-
return true;
|
|
635
|
-
}
|
|
636
|
-
var stowUpdate = (store, state, update) => {
|
|
637
|
-
const { key } = state;
|
|
638
|
-
const target = newest(store);
|
|
639
|
-
if (!isChildStore(target) || target.transactionMeta.phase !== `building`) {
|
|
640
|
-
store.logger.error(
|
|
641
|
-
`\u{1F41E}`,
|
|
642
|
-
`atom`,
|
|
643
|
-
key,
|
|
644
|
-
`stowUpdate called outside of a transaction. This is probably a bug.`
|
|
645
|
-
);
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
const shouldStow = shouldUpdateBeStowed(key, update);
|
|
649
|
-
if (!shouldStow) {
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
const atomUpdate = {
|
|
653
|
-
type: `atom_update`,
|
|
654
|
-
key,
|
|
655
|
-
...update
|
|
656
|
-
};
|
|
657
|
-
if (state.family) {
|
|
658
|
-
atomUpdate.family = state.family;
|
|
659
|
-
}
|
|
660
|
-
target.transactionMeta.update.updates.push(atomUpdate);
|
|
661
|
-
store.logger.info(
|
|
662
|
-
`\u{1F4C1}`,
|
|
663
|
-
`atom`,
|
|
664
|
-
key,
|
|
665
|
-
`stowed (`,
|
|
666
|
-
update.oldValue,
|
|
667
|
-
`->`,
|
|
668
|
-
update.newValue,
|
|
669
|
-
`)`
|
|
670
|
-
);
|
|
671
|
-
};
|
|
672
|
-
|
|
673
640
|
// ../atom.io/internal/src/set-state/set-atom.ts
|
|
674
|
-
var setAtom = (atom2, next
|
|
641
|
+
var setAtom = (target, atom2, next) => {
|
|
675
642
|
const oldValue = readOrComputeValue(target, atom2);
|
|
676
643
|
let newValue = oldValue;
|
|
677
644
|
if (atom2.type === `mutable_atom` && isChildStore(target)) {
|
|
@@ -688,23 +655,45 @@ var setAtom = (atom2, next, target) => {
|
|
|
688
655
|
markDone(target, atom2.key);
|
|
689
656
|
evictDownStream(target, atom2);
|
|
690
657
|
const update = { oldValue, newValue };
|
|
691
|
-
if (
|
|
658
|
+
if (!isChildStore(target)) {
|
|
692
659
|
emitUpdate(target, atom2, update);
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
let transceiver = target.valueMap.get(mutableKey);
|
|
700
|
-
if (mutableAtom.type === `mutable_atom` && isChildStore(target)) {
|
|
701
|
-
const { parent } = target;
|
|
702
|
-
const copiedValue = copyMutableIfNeeded(target, mutableAtom, parent);
|
|
703
|
-
transceiver = copiedValue;
|
|
704
|
-
}
|
|
705
|
-
const accepted = transceiver.do(update.newValue) === null;
|
|
706
|
-
if (accepted) evictDownStream(target, mutableAtom);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (target.on.transactionApplying.state === null) {
|
|
663
|
+
const { key } = atom2;
|
|
664
|
+
if (isTransceiver(update.newValue)) {
|
|
665
|
+
return;
|
|
707
666
|
}
|
|
667
|
+
const atomUpdate = {
|
|
668
|
+
type: `atom_update`,
|
|
669
|
+
key,
|
|
670
|
+
...update
|
|
671
|
+
};
|
|
672
|
+
if (atom2.family) {
|
|
673
|
+
atomUpdate.family = atom2.family;
|
|
674
|
+
}
|
|
675
|
+
target.transactionMeta.update.updates.push(atomUpdate);
|
|
676
|
+
target.logger.info(
|
|
677
|
+
`\u{1F4C1}`,
|
|
678
|
+
`atom`,
|
|
679
|
+
key,
|
|
680
|
+
`stowed (`,
|
|
681
|
+
update.oldValue,
|
|
682
|
+
`->`,
|
|
683
|
+
update.newValue,
|
|
684
|
+
`)`
|
|
685
|
+
);
|
|
686
|
+
} else if (atom2.key.startsWith(`*`)) {
|
|
687
|
+
const mutableKey = atom2.key.slice(1);
|
|
688
|
+
const mutableAtom = target.atoms.get(mutableKey);
|
|
689
|
+
let transceiver = target.valueMap.get(mutableKey);
|
|
690
|
+
if (mutableAtom.type === `mutable_atom` && isChildStore(target)) {
|
|
691
|
+
const { parent } = target;
|
|
692
|
+
const copiedValue = copyMutableIfNeeded(target, mutableAtom, parent);
|
|
693
|
+
transceiver = copiedValue;
|
|
694
|
+
}
|
|
695
|
+
const accepted = transceiver.do(update.newValue) === null;
|
|
696
|
+
if (accepted) evictDownStream(target, mutableAtom);
|
|
708
697
|
}
|
|
709
698
|
};
|
|
710
699
|
|
|
@@ -713,7 +702,7 @@ var setAtomOrSelector = (store, state, value) => {
|
|
|
713
702
|
switch (state.type) {
|
|
714
703
|
case `atom`:
|
|
715
704
|
case `mutable_atom`:
|
|
716
|
-
setAtom(state, value
|
|
705
|
+
setAtom(store, state, value);
|
|
717
706
|
break;
|
|
718
707
|
case `selector`:
|
|
719
708
|
state.set(value);
|
|
@@ -1157,13 +1146,34 @@ function ingestTransactionUpdate(applying, transactionUpdate, store) {
|
|
|
1157
1146
|
}
|
|
1158
1147
|
}
|
|
1159
1148
|
|
|
1149
|
+
// ../atom.io/internal/src/transaction/get-epoch-number.ts
|
|
1150
|
+
function getContinuityKey(store, transactionKey) {
|
|
1151
|
+
const continuity = store.transactionMeta.actionContinuities.getRelatedKey(transactionKey);
|
|
1152
|
+
return continuity;
|
|
1153
|
+
}
|
|
1154
|
+
function getEpochNumberOfContinuity(store, continuityKey) {
|
|
1155
|
+
const epoch = store.transactionMeta.epoch.get(continuityKey);
|
|
1156
|
+
return epoch;
|
|
1157
|
+
}
|
|
1158
|
+
function getEpochNumberOfAction(store, transactionKey) {
|
|
1159
|
+
const isRoot = isRootStore(store);
|
|
1160
|
+
if (!isRoot) {
|
|
1161
|
+
return void 0;
|
|
1162
|
+
}
|
|
1163
|
+
const continuityKey = getContinuityKey(store, transactionKey);
|
|
1164
|
+
if (continuityKey === void 0) {
|
|
1165
|
+
return void 0;
|
|
1166
|
+
}
|
|
1167
|
+
return getEpochNumberOfContinuity(store, continuityKey);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1160
1170
|
// ../atom.io/internal/src/transaction/set-epoch-number.ts
|
|
1161
1171
|
function setEpochNumberOfAction(store, transactionKey, newEpoch) {
|
|
1162
1172
|
const isRoot = isRootStore(store);
|
|
1163
1173
|
if (!isRoot) {
|
|
1164
1174
|
return;
|
|
1165
1175
|
}
|
|
1166
|
-
const continuityKey = store
|
|
1176
|
+
const continuityKey = getContinuityKey(store, transactionKey);
|
|
1167
1177
|
if (continuityKey !== void 0) {
|
|
1168
1178
|
store.transactionMeta.epoch.set(continuityKey, newEpoch);
|
|
1169
1179
|
}
|
|
@@ -1584,11 +1594,12 @@ var Junction = class {
|
|
|
1584
1594
|
|
|
1585
1595
|
// ../atom.io/internal/src/lazy-map.ts
|
|
1586
1596
|
var LazyMap = class extends Map {
|
|
1597
|
+
deleted = /* @__PURE__ */ new Set();
|
|
1598
|
+
source;
|
|
1587
1599
|
constructor(source) {
|
|
1588
1600
|
super();
|
|
1589
1601
|
this.source = source;
|
|
1590
1602
|
}
|
|
1591
|
-
deleted = /* @__PURE__ */ new Set();
|
|
1592
1603
|
get(key) {
|
|
1593
1604
|
const has = super.has(key);
|
|
1594
1605
|
if (has) {
|
|
@@ -1725,14 +1736,6 @@ function createTransaction(store, options) {
|
|
|
1725
1736
|
return token;
|
|
1726
1737
|
}
|
|
1727
1738
|
|
|
1728
|
-
// ../atom.io/internal/src/transaction/get-epoch-number.ts
|
|
1729
|
-
function getEpochNumberOfAction(store, transactionKey) {
|
|
1730
|
-
const isRoot = isRootStore(store);
|
|
1731
|
-
const continuity = isRoot ? store.transactionMeta.actionContinuities.getRelatedKey(transactionKey) : void 0;
|
|
1732
|
-
const epoch = isRoot && continuity !== void 0 ? store.transactionMeta.epoch.get(continuity) : void 0;
|
|
1733
|
-
return epoch;
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
1739
|
// ../atom.io/src/transaction.ts
|
|
1737
1740
|
function transaction(options) {
|
|
1738
1741
|
return createTransaction(IMPLICIT.STORE, options);
|
|
@@ -1827,7 +1830,7 @@ var Store = class {
|
|
|
1827
1830
|
lifespan: `ephemeral`
|
|
1828
1831
|
};
|
|
1829
1832
|
loggers = [
|
|
1830
|
-
new AtomIOLogger(`warn`, (_, __, key) => !key
|
|
1833
|
+
new AtomIOLogger(`warn`, (_, __, key) => !isReservedIntrospectionKey(key))
|
|
1831
1834
|
];
|
|
1832
1835
|
logger = {
|
|
1833
1836
|
error: (...messages) => {
|
|
@@ -2895,18 +2898,18 @@ function isTransceiver(value) {
|
|
|
2895
2898
|
function copyMutableIfNeeded(target, atom2, origin) {
|
|
2896
2899
|
const originValue = origin.valueMap.get(atom2.key);
|
|
2897
2900
|
const targetValue = target.valueMap.get(atom2.key);
|
|
2898
|
-
if (originValue
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
return
|
|
2901
|
+
if (originValue !== targetValue) {
|
|
2902
|
+
return targetValue;
|
|
2903
|
+
}
|
|
2904
|
+
if (originValue === void 0) {
|
|
2905
|
+
return atom2.default();
|
|
2906
|
+
}
|
|
2907
|
+
origin.logger.info(`\u{1F4C3}`, `atom`, atom2.key, `copying`);
|
|
2908
|
+
const jsonValue = atom2.toJson(originValue);
|
|
2909
|
+
const copiedValue = atom2.fromJson(jsonValue);
|
|
2910
|
+
target.valueMap.set(atom2.key, copiedValue);
|
|
2911
|
+
new Tracker(atom2, origin);
|
|
2912
|
+
return copiedValue;
|
|
2910
2913
|
}
|
|
2911
2914
|
|
|
2912
2915
|
// ../atom.io/internal/src/caching.ts
|
|
@@ -3727,6 +3730,11 @@ function getInternalRelationsFromStore(token, store) {
|
|
|
3727
3730
|
return family;
|
|
3728
3731
|
}
|
|
3729
3732
|
|
|
3733
|
+
// ../atom.io/internal/src/reserved-keys.ts
|
|
3734
|
+
function isReservedIntrospectionKey(value) {
|
|
3735
|
+
return value.startsWith(`\u{1F50D} `);
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3730
3738
|
// ../atom.io/introspection/src/refinery.ts
|
|
3731
3739
|
var Refinery = class {
|
|
3732
3740
|
supported;
|
|
@@ -3971,11 +3979,6 @@ selectorFamily({
|
|
|
3971
3979
|
|
|
3972
3980
|
// ../atom.io/realtime-server/src/ipc-sockets/custom-socket.ts
|
|
3973
3981
|
var CustomSocket = class {
|
|
3974
|
-
constructor(emit) {
|
|
3975
|
-
this.emit = emit;
|
|
3976
|
-
this.listeners = /* @__PURE__ */ new Map();
|
|
3977
|
-
this.globalListeners = /* @__PURE__ */ new Set();
|
|
3978
|
-
}
|
|
3979
3982
|
listeners;
|
|
3980
3983
|
globalListeners;
|
|
3981
3984
|
handleEvent(event, ...args) {
|
|
@@ -3990,6 +3993,12 @@ var CustomSocket = class {
|
|
|
3990
3993
|
}
|
|
3991
3994
|
}
|
|
3992
3995
|
id = `no_id_retrieved`;
|
|
3996
|
+
emit;
|
|
3997
|
+
constructor(emit) {
|
|
3998
|
+
this.emit = emit;
|
|
3999
|
+
this.listeners = /* @__PURE__ */ new Map();
|
|
4000
|
+
this.globalListeners = /* @__PURE__ */ new Set();
|
|
4001
|
+
}
|
|
3993
4002
|
on(event, listener) {
|
|
3994
4003
|
const listeners = this.listeners.get(event);
|
|
3995
4004
|
if (listeners) {
|
|
@@ -4268,6 +4277,25 @@ function isVersionNumber(version) {
|
|
|
4268
4277
|
return /^\d+\.\d+\.\d+$/.test(version) || !Number.isNaN(Number.parseFloat(version));
|
|
4269
4278
|
}
|
|
4270
4279
|
var FlightDeck = class {
|
|
4280
|
+
options;
|
|
4281
|
+
safety = 0;
|
|
4282
|
+
storage;
|
|
4283
|
+
webhookServer;
|
|
4284
|
+
services;
|
|
4285
|
+
serviceIdx;
|
|
4286
|
+
defaultServicesReadyToUpdate;
|
|
4287
|
+
servicesReadyToUpdate;
|
|
4288
|
+
autoRespawnDeadServices;
|
|
4289
|
+
logger;
|
|
4290
|
+
serviceLoggers;
|
|
4291
|
+
updateAvailabilityChecker = null;
|
|
4292
|
+
servicesLive;
|
|
4293
|
+
servicesDead;
|
|
4294
|
+
live = new Future(() => {
|
|
4295
|
+
});
|
|
4296
|
+
dead = new Future(() => {
|
|
4297
|
+
});
|
|
4298
|
+
restartTimes = [];
|
|
4271
4299
|
constructor(options) {
|
|
4272
4300
|
this.options = options;
|
|
4273
4301
|
const { FLIGHTDECK_SECRET } = env;
|
|
@@ -4385,24 +4413,6 @@ var FlightDeck = class {
|
|
|
4385
4413
|
}
|
|
4386
4414
|
});
|
|
4387
4415
|
}
|
|
4388
|
-
safety = 0;
|
|
4389
|
-
storage;
|
|
4390
|
-
webhookServer;
|
|
4391
|
-
services;
|
|
4392
|
-
serviceIdx;
|
|
4393
|
-
defaultServicesReadyToUpdate;
|
|
4394
|
-
servicesReadyToUpdate;
|
|
4395
|
-
autoRespawnDeadServices;
|
|
4396
|
-
logger;
|
|
4397
|
-
serviceLoggers;
|
|
4398
|
-
updateAvailabilityChecker = null;
|
|
4399
|
-
servicesLive;
|
|
4400
|
-
servicesDead;
|
|
4401
|
-
live = new Future(() => {
|
|
4402
|
-
});
|
|
4403
|
-
dead = new Future(() => {
|
|
4404
|
-
});
|
|
4405
|
-
restartTimes = [];
|
|
4406
4416
|
seekUpdate(version) {
|
|
4407
4417
|
this.logger.info(`Checking for updates...`);
|
|
4408
4418
|
const { checkAvailability } = this.options.scripts;
|
|
@@ -4768,5 +4778,5 @@ var FlightDeckLogger = class {
|
|
|
4768
4778
|
};
|
|
4769
4779
|
|
|
4770
4780
|
export { FLIGHTDECK_ERROR, FLIGHTDECK_INFO, FLIGHTDECK_LNAV_FORMAT, FLIGHTDECK_SETUP_PHASES, FLIGHTDECK_UPDATE_PHASES, FLIGHTDECK_WARN, FlightDeck, FlightDeckLogger, flightDeckLogSchema, isVersionNumber };
|
|
4771
|
-
//# sourceMappingURL=chunk-
|
|
4772
|
-
//# sourceMappingURL=chunk-
|
|
4781
|
+
//# sourceMappingURL=chunk-JHE6N7DO.js.map
|
|
4782
|
+
//# sourceMappingURL=chunk-JHE6N7DO.js.map
|