flightdeck 0.2.17 → 0.2.19

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.
@@ -1,4 +1,4 @@
1
- import { execSync, spawn } from 'node:child_process';
1
+ import { spawn, execSync } from 'node:child_process';
2
2
  import { createServer } from 'node:http';
3
3
  import { homedir } from 'node:os';
4
4
  import { resolve } from 'node:path';
@@ -58,7 +58,7 @@ var Future = class extends Promise {
58
58
  );
59
59
  } else {
60
60
  this.resolve(value);
61
- this.fate = undefined;
61
+ this.fate = void 0;
62
62
  }
63
63
  }
64
64
  };
@@ -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;
@@ -575,7 +578,9 @@ var emitUpdate = (store, state, update) => {
575
578
  state.subject.subscribers
576
579
  );
577
580
  break;
578
- default:
581
+ case `atom`:
582
+ case `selector`:
583
+ case `readonly_selector`:
579
584
  store.logger.info(
580
585
  `\u{1F4E2}`,
581
586
  state.type,
@@ -1162,7 +1167,7 @@ function setEpochNumberOfAction(store, transactionKey, newEpoch) {
1162
1167
  return;
1163
1168
  }
1164
1169
  const continuityKey = store.transactionMeta.actionContinuities.getRelatedKey(transactionKey);
1165
- if (continuityKey !== undefined) {
1170
+ if (continuityKey !== void 0) {
1166
1171
  store.transactionMeta.epoch.set(continuityKey, newEpoch);
1167
1172
  }
1168
1173
  }
@@ -1323,8 +1328,8 @@ var Junction = class {
1323
1328
  }
1324
1329
  replaceRelationsSafely(x, ys) {
1325
1330
  const xRelationsPrev = this.relations.get(x);
1326
- let a = this.isAType?.(x) ? x : undefined;
1327
- let b = a === undefined ? x : undefined;
1331
+ let a = this.isAType?.(x) ? x : void 0;
1332
+ let b = a === void 0 ? x : void 0;
1328
1333
  if (xRelationsPrev) {
1329
1334
  for (const y of xRelationsPrev) {
1330
1335
  a ??= y;
@@ -1406,8 +1411,8 @@ var Junction = class {
1406
1411
  };
1407
1412
  }
1408
1413
  for (const [x, ys] of data.relations ?? []) {
1409
- let a = this.isAType?.(x) ? x : undefined;
1410
- let b = a === undefined ? x : undefined;
1414
+ let a = this.isAType?.(x) ? x : void 0;
1415
+ let b = a === void 0 ? x : void 0;
1411
1416
  for (const y of ys) {
1412
1417
  a ??= y;
1413
1418
  b ??= y;
@@ -1441,7 +1446,7 @@ var Junction = class {
1441
1446
  const relation = params[0];
1442
1447
  a = relation[this.a];
1443
1448
  b = relation[this.b];
1444
- content = undefined;
1449
+ content = void 0;
1445
1450
  break;
1446
1451
  }
1447
1452
  case 2: {
@@ -1468,10 +1473,12 @@ var Junction = class {
1468
1473
  const bPrev = this.getRelatedKey(a);
1469
1474
  if (bPrev && bPrev !== b) this.delete(a, bPrev);
1470
1475
  }
1471
- case `1:n`: {
1472
- const aPrev = this.getRelatedKey(b);
1473
- if (aPrev && aPrev !== a) this.delete(aPrev, b);
1474
- }
1476
+ case `1:n`:
1477
+ {
1478
+ const aPrev = this.getRelatedKey(b);
1479
+ if (aPrev && aPrev !== a) this.delete(aPrev, b);
1480
+ }
1481
+ break;
1475
1482
  }
1476
1483
  if (content) {
1477
1484
  const contentKey = this.makeContentKey(a, b);
@@ -1486,7 +1493,7 @@ var Junction = class {
1486
1493
  // @ts-expect-error we deduce that this.a may index x
1487
1494
  typeof x === `string` ? x : x[this.a]
1488
1495
  );
1489
- if (a === undefined && typeof b === `string`) {
1496
+ if (a === void 0 && typeof b === `string`) {
1490
1497
  const bRelations = this.getRelatedKeys(b);
1491
1498
  if (bRelations) {
1492
1499
  for (const bRelation of bRelations) {
@@ -1494,7 +1501,7 @@ var Junction = class {
1494
1501
  }
1495
1502
  }
1496
1503
  }
1497
- if (typeof a === `string` && b === undefined) {
1504
+ if (typeof a === `string` && b === void 0) {
1498
1505
  const aRelations = this.getRelatedKeys(a);
1499
1506
  if (aRelations) {
1500
1507
  for (const aRelation of aRelations) {
@@ -1551,7 +1558,7 @@ var Junction = class {
1551
1558
  getRelationEntries(input) {
1552
1559
  const a = input[this.a];
1553
1560
  const b = input[this.b];
1554
- if (a !== undefined && b === undefined) {
1561
+ if (a !== void 0 && b === void 0) {
1555
1562
  const aRelations = this.getRelatedKeys(a);
1556
1563
  if (aRelations) {
1557
1564
  return [...aRelations].map((aRelation) => {
@@ -1559,7 +1566,7 @@ var Junction = class {
1559
1566
  });
1560
1567
  }
1561
1568
  }
1562
- if (a === undefined && b !== undefined) {
1569
+ if (a === void 0 && b !== void 0) {
1563
1570
  const bRelations = this.getRelatedKeys(b);
1564
1571
  if (bRelations) {
1565
1572
  return [...bRelations].map((bRelation) => {
@@ -1580,11 +1587,12 @@ var Junction = class {
1580
1587
 
1581
1588
  // ../atom.io/internal/src/lazy-map.ts
1582
1589
  var LazyMap = class extends Map {
1590
+ deleted = /* @__PURE__ */ new Set();
1591
+ source;
1583
1592
  constructor(source) {
1584
1593
  super();
1585
1594
  this.source = source;
1586
1595
  }
1587
- deleted = /* @__PURE__ */ new Set();
1588
1596
  get(key) {
1589
1597
  const has = super.has(key);
1590
1598
  if (has) {
@@ -1594,7 +1602,7 @@ var LazyMap = class extends Map {
1594
1602
  const value = this.source.get(key);
1595
1603
  return value;
1596
1604
  }
1597
- return undefined;
1605
+ return void 0;
1598
1606
  }
1599
1607
  set(key, value) {
1600
1608
  this.deleted.delete(key);
@@ -1659,10 +1667,10 @@ var buildTransaction = (store, key, params, id) => {
1659
1667
  type: `transaction_update`,
1660
1668
  key,
1661
1669
  id,
1662
- epoch: epoch === undefined ? Number.NaN : epoch + 1,
1670
+ epoch: epoch === void 0 ? Number.NaN : epoch + 1,
1663
1671
  updates: [],
1664
1672
  params,
1665
- output: undefined
1673
+ output: void 0
1666
1674
  },
1667
1675
  toolkit: {
1668
1676
  get: (...ps) => getFromStore(child, ...ps),
@@ -1724,8 +1732,8 @@ function createTransaction(store, options) {
1724
1732
  // ../atom.io/internal/src/transaction/get-epoch-number.ts
1725
1733
  function getEpochNumberOfAction(store, transactionKey) {
1726
1734
  const isRoot = isRootStore(store);
1727
- const continuity = isRoot ? store.transactionMeta.actionContinuities.getRelatedKey(transactionKey) : undefined;
1728
- const epoch = isRoot && continuity !== undefined ? store.transactionMeta.epoch.get(continuity) : undefined;
1735
+ const continuity = isRoot ? store.transactionMeta.actionContinuities.getRelatedKey(transactionKey) : void 0;
1736
+ const epoch = isRoot && continuity !== void 0 ? store.transactionMeta.epoch.get(continuity) : void 0;
1729
1737
  return epoch;
1730
1738
  }
1731
1739
 
@@ -1941,7 +1949,7 @@ function withdraw(store, token) {
1941
1949
  // ../atom.io/internal/src/families/init-family-member.ts
1942
1950
  function initFamilyMemberInStore(store, token, key) {
1943
1951
  const family = store.families.get(token.key);
1944
- if (family === undefined) {
1952
+ if (family === void 0) {
1945
1953
  throw new NotFoundError(token, store);
1946
1954
  }
1947
1955
  const state = family(key);
@@ -2281,11 +2289,11 @@ var createWritableSelector = (store, options, family) => {
2281
2289
  function createStandaloneSelector(store, options) {
2282
2290
  const isWritable = `set` in options;
2283
2291
  if (isWritable) {
2284
- const state2 = createWritableSelector(store, options, undefined);
2292
+ const state2 = createWritableSelector(store, options, void 0);
2285
2293
  store.on.selectorCreation.next(state2);
2286
2294
  return state2;
2287
2295
  }
2288
- const state = createReadonlySelector(store, options, undefined);
2296
+ const state = createReadonlySelector(store, options, void 0);
2289
2297
  store.on.selectorCreation.next(state);
2290
2298
  return state;
2291
2299
  }
@@ -2446,7 +2454,7 @@ var subscribeToRootAtoms = (store, selector) => {
2446
2454
  const dependencySubscriptions = traceAllSelectorAtoms(selector, store).map(
2447
2455
  (atomKey) => {
2448
2456
  const atom2 = target.atoms.get(atomKey);
2449
- if (atom2 === undefined) {
2457
+ if (atom2 === void 0) {
2450
2458
  throw new Error(
2451
2459
  `Atom "${atomKey}", a dependency of selector "${selector.key}", not found in store "${store.config.name}".`
2452
2460
  );
@@ -2558,7 +2566,7 @@ var Tracker = class {
2558
2566
  const familyMetaData = mutableState.family ? {
2559
2567
  key: `*${mutableState.family.key}`,
2560
2568
  subKey: mutableState.family.subKey
2561
- } : undefined;
2569
+ } : void 0;
2562
2570
  const latestUpdateState = createRegularAtom(
2563
2571
  store,
2564
2572
  {
@@ -2892,7 +2900,7 @@ function copyMutableIfNeeded(target, atom2, origin) {
2892
2900
  const originValue = origin.valueMap.get(atom2.key);
2893
2901
  const targetValue = target.valueMap.get(atom2.key);
2894
2902
  if (originValue === targetValue) {
2895
- if (originValue === undefined) {
2903
+ if (originValue === void 0) {
2896
2904
  return typeof atom2.default === `function` ? atom2.default() : atom2.default;
2897
2905
  }
2898
2906
  origin.logger.info(`\u{1F4C3}`, `atom`, atom2.key, `copying`);
@@ -3040,11 +3048,11 @@ function createRegularAtom(store, options, family) {
3040
3048
  function createStandaloneAtom(store, options) {
3041
3049
  const isMutable = `mutable` in options;
3042
3050
  if (isMutable) {
3043
- const state2 = createMutableAtom(store, options, undefined);
3051
+ const state2 = createMutableAtom(store, options, void 0);
3044
3052
  store.on.atomCreation.next(state2);
3045
3053
  return state2;
3046
3054
  }
3047
- const state = createRegularAtom(store, options, undefined);
3055
+ const state = createRegularAtom(store, options, void 0);
3048
3056
  store.on.atomCreation.next(state);
3049
3057
  return state;
3050
3058
  }
@@ -3565,8 +3573,8 @@ var Join = class {
3565
3573
  get: (x) => ({ get }) => {
3566
3574
  const relatedKeys = get(relatedKeysAtoms, x);
3567
3575
  for (const y of relatedKeys) {
3568
- let a = relations.isAType?.(x) ? x : undefined;
3569
- let b = a === undefined ? x : undefined;
3576
+ let a = relations.isAType?.(x) ? x : void 0;
3577
+ let b = a === void 0 ? x : void 0;
3570
3578
  a ??= y;
3571
3579
  b ??= y;
3572
3580
  const contentKey = relations.makeContentKey(a, b);
@@ -3586,8 +3594,8 @@ var Join = class {
3586
3594
  const jsonFamily = getJsonFamily(relatedKeysAtoms, store);
3587
3595
  const json = get(jsonFamily, x);
3588
3596
  return json.members.map((y) => {
3589
- let a = relations.isAType?.(x) ? x : undefined;
3590
- let b = a === undefined ? x : undefined;
3597
+ let a = relations.isAType?.(x) ? x : void 0;
3598
+ let b = a === void 0 ? x : void 0;
3591
3599
  a ??= y;
3592
3600
  b ??= y;
3593
3601
  const contentKey = relations.makeContentKey(a, b);
@@ -3653,7 +3661,7 @@ var Join = class {
3653
3661
  this.states = states;
3654
3662
  break;
3655
3663
  }
3656
- default: {
3664
+ case `n:n`: {
3657
3665
  const multipleRelatedKeysSelectors = getMultipleKeySelectorFamily();
3658
3666
  const stateKeyA = `${aSide}KeysOf${capitalize(bSide)}`;
3659
3667
  const stateKeyB = `${bSide}KeysOf${capitalize(aSide)}`;
@@ -3688,10 +3696,10 @@ var Join = class {
3688
3696
  // ../atom.io/internal/src/join/get-join.ts
3689
3697
  function getJoin(token, store) {
3690
3698
  let myJoin = store.joins.get(token.key);
3691
- if (myJoin === undefined) {
3699
+ if (myJoin === void 0) {
3692
3700
  const rootJoinMap = IMPLICIT.STORE.joins;
3693
3701
  const rootJoin = rootJoinMap.get(token.key);
3694
- if (rootJoin === undefined) {
3702
+ if (rootJoin === void 0) {
3695
3703
  throw new Error(
3696
3704
  `Join "${token.key}" not found in store "${store.config.name}"`
3697
3705
  );
@@ -3772,7 +3780,7 @@ var jsonRefinery = new Refinery({
3772
3780
  ...jsonTreeRefinery.supported
3773
3781
  });
3774
3782
  var discoverType = (input) => {
3775
- if (input === undefined) {
3783
+ if (input === void 0) {
3776
3784
  return `undefined`;
3777
3785
  }
3778
3786
  const refined = jsonRefinery.refine(input);
@@ -3833,7 +3841,7 @@ function diffObject(a, b, recurse) {
3833
3841
  let key;
3834
3842
  for (key of path) {
3835
3843
  const nodeB = b[key];
3836
- if (nodeB === undefined) {
3844
+ if (nodeB === void 0) {
3837
3845
  removed.push([key, JSON.stringify(nodeA)]);
3838
3846
  } else {
3839
3847
  const delta = recurse(nodeA, nodeB);
@@ -3847,7 +3855,7 @@ function diffObject(a, b, recurse) {
3847
3855
  let key;
3848
3856
  for (key of path) {
3849
3857
  const nodeA = a[key];
3850
- if (nodeA === undefined) {
3858
+ if (nodeA === void 0) {
3851
3859
  added.push([key, JSON.stringify(nodeB)]);
3852
3860
  }
3853
3861
  }
@@ -3967,11 +3975,6 @@ selectorFamily({
3967
3975
 
3968
3976
  // ../atom.io/realtime-server/src/ipc-sockets/custom-socket.ts
3969
3977
  var CustomSocket = class {
3970
- constructor(emit) {
3971
- this.emit = emit;
3972
- this.listeners = /* @__PURE__ */ new Map();
3973
- this.globalListeners = /* @__PURE__ */ new Set();
3974
- }
3975
3978
  listeners;
3976
3979
  globalListeners;
3977
3980
  handleEvent(event, ...args) {
@@ -3986,6 +3989,12 @@ var CustomSocket = class {
3986
3989
  }
3987
3990
  }
3988
3991
  id = `no_id_retrieved`;
3992
+ emit;
3993
+ constructor(emit) {
3994
+ this.emit = emit;
3995
+ this.listeners = /* @__PURE__ */ new Map();
3996
+ this.globalListeners = /* @__PURE__ */ new Set();
3997
+ }
3989
3998
  on(event, listener) {
3990
3999
  const listeners = this.listeners.get(event);
3991
4000
  if (listeners) {
@@ -4039,6 +4048,8 @@ var ChildSocket = class extends CustomSocket {
4039
4048
  case `e`:
4040
4049
  this.logger.error(...rest);
4041
4050
  break;
4051
+ default:
4052
+ return;
4042
4053
  }
4043
4054
  }
4044
4055
  }
@@ -4262,6 +4273,25 @@ function isVersionNumber(version) {
4262
4273
  return /^\d+\.\d+\.\d+$/.test(version) || !Number.isNaN(Number.parseFloat(version));
4263
4274
  }
4264
4275
  var FlightDeck = class {
4276
+ options;
4277
+ safety = 0;
4278
+ storage;
4279
+ webhookServer;
4280
+ services;
4281
+ serviceIdx;
4282
+ defaultServicesReadyToUpdate;
4283
+ servicesReadyToUpdate;
4284
+ autoRespawnDeadServices;
4285
+ logger;
4286
+ serviceLoggers;
4287
+ updateAvailabilityChecker = null;
4288
+ servicesLive;
4289
+ servicesDead;
4290
+ live = new Future(() => {
4291
+ });
4292
+ dead = new Future(() => {
4293
+ });
4294
+ restartTimes = [];
4265
4295
  constructor(options) {
4266
4296
  this.options = options;
4267
4297
  const { FLIGHTDECK_SECRET } = env;
@@ -4286,7 +4316,7 @@ var FlightDeck = class {
4286
4316
  this.logger = new FlightDeckLogger(
4287
4317
  this.options.packageName,
4288
4318
  process.pid,
4289
- undefined,
4319
+ void 0,
4290
4320
  { jsonLogging: this.options.jsonLogging ?? false }
4291
4321
  );
4292
4322
  this.serviceLoggers = fromEntries(
@@ -4309,7 +4339,7 @@ var FlightDeck = class {
4309
4339
  this.storage = new FilesystemStorage({
4310
4340
  path: resolve(flightdeckRootDir, `storage`, options.packageName)
4311
4341
  });
4312
- if (FLIGHTDECK_SECRET === undefined) {
4342
+ if (FLIGHTDECK_SECRET === void 0) {
4313
4343
  this.logger.warn(
4314
4344
  `No FLIGHTDECK_SECRET environment variable found. FlightDeck will not run an update server.`
4315
4345
  );
@@ -4379,24 +4409,6 @@ var FlightDeck = class {
4379
4409
  }
4380
4410
  });
4381
4411
  }
4382
- safety = 0;
4383
- storage;
4384
- webhookServer;
4385
- services;
4386
- serviceIdx;
4387
- defaultServicesReadyToUpdate;
4388
- servicesReadyToUpdate;
4389
- autoRespawnDeadServices;
4390
- logger;
4391
- serviceLoggers;
4392
- updateAvailabilityChecker = null;
4393
- servicesLive;
4394
- servicesDead;
4395
- live = new Future(() => {
4396
- });
4397
- dead = new Future(() => {
4398
- });
4399
- restartTimes = [];
4400
4412
  seekUpdate(version) {
4401
4413
  this.logger.info(`Checking for updates...`);
4402
4414
  const { checkAvailability } = this.options.scripts;
@@ -4762,5 +4774,5 @@ var FlightDeckLogger = class {
4762
4774
  };
4763
4775
 
4764
4776
  export { FLIGHTDECK_ERROR, FLIGHTDECK_INFO, FLIGHTDECK_LNAV_FORMAT, FLIGHTDECK_SETUP_PHASES, FLIGHTDECK_UPDATE_PHASES, FLIGHTDECK_WARN, FlightDeck, FlightDeckLogger, flightDeckLogSchema, isVersionNumber };
4765
- //# sourceMappingURL=chunk-7KMVUPT3.js.map
4766
- //# sourceMappingURL=chunk-7KMVUPT3.js.map
4777
+ //# sourceMappingURL=chunk-D4EVARJP.js.map
4778
+ //# sourceMappingURL=chunk-D4EVARJP.js.map