@mark1russell7/service 0.8.3 → 0.8.5

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.
Files changed (79) hide show
  1. package/README.md +1 -0
  2. package/build/{backoff-B-jGWVDm.d.ts → backoff-QTRGfkEK.d.ts} +1 -3
  3. package/build/backoff.d.ts +1 -1
  4. package/build/backoff.js +1 -2
  5. package/build/{builder-DQj3NNNc.d.ts → builder-zO48Vgoj.d.ts} +4 -10
  6. package/build/{call-context-gR8FhbF_.d.ts → call-context-DDhcVvn5.d.ts} +1 -3
  7. package/build/channel.d.ts +28 -2
  8. package/build/channel.js +45 -3
  9. package/build/channel.js.map +1 -1
  10. package/build/{core-Dt0HEVMq.d.ts → core-BSzt4RI2.d.ts} +5 -9
  11. package/build/{dial-CSQOl-yj.d.ts → dial-ChwIcvd4.d.ts} +2 -4
  12. package/build/grpc.d.ts +4 -14
  13. package/build/grpc.js +7 -12
  14. package/build/grpc.js.map +1 -1
  15. package/build/heartbeat.d.ts +0 -2
  16. package/build/heartbeat.js +1 -2
  17. package/build/host.d.ts +3 -23
  18. package/build/host.js +21 -33
  19. package/build/host.js.map +1 -1
  20. package/build/http-client.d.ts +4 -16
  21. package/build/http-client.js +7 -13
  22. package/build/http-client.js.map +1 -1
  23. package/build/http.d.ts +3 -9
  24. package/build/http.js +6 -10
  25. package/build/http.js.map +1 -1
  26. package/build/index.d.ts +10 -22
  27. package/build/index.js +26 -43
  28. package/build/index.js.map +1 -1
  29. package/build/{knobs-D2ClI68I.js → knobs-BJcz6m01.js} +3 -5
  30. package/build/{knobs-D2ClI68I.js.map → knobs-BJcz6m01.js.map} +1 -1
  31. package/build/{lifecycle-Br0jAjTk.d.ts → lifecycle-D0J-zwZF.d.ts} +2 -14
  32. package/build/{limiter-BTgM4aXZ.js → limiter-BwGxEWpP.js} +4 -6
  33. package/build/{limiter-BTgM4aXZ.js.map → limiter-BwGxEWpP.js.map} +1 -1
  34. package/build/{limiter-D1aluA0V.d.ts → limiter-Djw39d_S.d.ts} +3 -5
  35. package/build/limiter.d.ts +3 -3
  36. package/build/limiter.js +2 -2
  37. package/build/{logger-BN2BfPgU.d.ts → logger-B6drv9w0.d.ts} +2 -16
  38. package/build/{machine-p4lENJ86.js → machine-mIW1qgEE.js} +7 -11
  39. package/build/{machine-p4lENJ86.js.map → machine-mIW1qgEE.js.map} +1 -1
  40. package/build/mongodb.d.ts +3 -13
  41. package/build/mongodb.js +6 -11
  42. package/build/mongodb.js.map +1 -1
  43. package/build/{operation-DL5RxFds.js → operation-DF73RZOI.js} +2 -3
  44. package/build/{operation-DL5RxFds.js.map → operation-DF73RZOI.js.map} +1 -1
  45. package/build/otel.d.ts +2 -4
  46. package/build/otel.js +1 -2
  47. package/build/pg.d.ts +2 -12
  48. package/build/pg.js +6 -11
  49. package/build/pg.js.map +1 -1
  50. package/build/{policy-G-Y3Meku.js → policy-B23MY52l.js} +2 -3
  51. package/build/{policy-G-Y3Meku.js.map → policy-B23MY52l.js.map} +1 -1
  52. package/build/{policy-CwYR95Sz.d.ts → policy-CBcK2XGg.d.ts} +1 -3
  53. package/build/{ports-CSr7qWrA.d.ts → ports-DZoipkSD.d.ts} +2 -4
  54. package/build/{process-DG_im2zc.js → process-Oe0Abbsm.js} +2 -3
  55. package/build/{process-DG_im2zc.js.map → process-Oe0Abbsm.js.map} +1 -1
  56. package/build/{queue-fIkOXKVG.d.ts → queue-DXdw1vLO.d.ts} +3 -7
  57. package/build/rabbitmq.d.ts +4 -14
  58. package/build/rabbitmq.js +6 -11
  59. package/build/rabbitmq.js.map +1 -1
  60. package/build/redis.d.ts +3 -15
  61. package/build/redis.js +10 -16
  62. package/build/redis.js.map +1 -1
  63. package/build/{requests-BIq9Tr4P.js → requests-DD2ALv0_.js} +6 -9
  64. package/build/{requests-BIq9Tr4P.js.map → requests-DD2ALv0_.js.map} +1 -1
  65. package/build/{retrier-Nt6r4r6R.js → retrier-BObZq10-.js} +3 -4
  66. package/build/{retrier-Nt6r4r6R.js.map → retrier-BObZq10-.js.map} +1 -1
  67. package/build/{rules-BBRopO1e.d.ts → rules-HyFCBStQ.d.ts} +1 -5
  68. package/build/rules.d.ts +1 -1
  69. package/build/rules.js +1 -2
  70. package/build/{store-1CsNoJ8O.d.ts → store-DFwFKrsB.d.ts} +2 -4
  71. package/build/testing.d.ts +4 -14
  72. package/build/testing.js +9 -15
  73. package/build/testing.js.map +1 -1
  74. package/build/{timing-DGRi3XCI.js → timing-DZl36uXs.js} +2 -3
  75. package/build/{timing-DGRi3XCI.js.map → timing-DZl36uXs.js.map} +1 -1
  76. package/build/websocket.d.ts +3 -13
  77. package/build/websocket.js +7 -12
  78. package/build/websocket.js.map +1 -1
  79. package/package.json +6 -4
package/build/index.js CHANGED
@@ -1,18 +1,18 @@
1
+ import { a as recoverSpan, i as heartbeatDetection, n as asWindow, r as failSpan, t as asDebounce } from "./timing-DZl36uXs.js";
2
+ import { n as operationProblems, t as mayReissue } from "./operation-DF73RZOI.js";
1
3
  import { platformClock, realClock } from "./clock.js";
2
- import { detectionTime, heartbeat } from "./heartbeat.js";
3
- import { a as recoverSpan, i as heartbeatDetection, n as asWindow, r as failSpan, t as asDebounce } from "./timing-DGRi3XCI.js";
4
- import { n as operationProblems, t as mayReissue } from "./operation-DL5RxFds.js";
5
- import { a as limitRule, c as overCapacity, i as idleSpan, l as retryAfterSeconds, n as decide, o as limiterProblems, r as freeAt, s as longestRetryAfter, t as capacityOf, u as unitsOf } from "./policy-G-Y3Meku.js";
6
- import { a as lateHolds, l as takeOutside, n as countOf, r as millisecondsOf, s as ownStream, t as boundedMillisecondsOf } from "./knobs-D2ClI68I.js";
7
- import { a as isExitCode, c as matchesMessage, i as embeddedProcess, l as nodeProcess, n as PROCESS_TRIGGERS, o as isExitSignal, r as UNCAUGHT_ORIGINS, s as isMessageShape, t as EXIT_SIGNALS, u as processPortOf } from "./process-DG_im2zc.js";
8
- import { a as runUnit, c as untilAbort, i as retryOf, l as routePatternProblems, n as boundProblems, o as settleWithin, r as flights, s as sleeper, t as tracker } from "./requests-BIq9Tr4P.js";
4
+ import { a as limitRule, c as overCapacity, i as idleSpan, l as retryAfterSeconds, n as decide, o as limiterProblems, r as freeAt, s as longestRetryAfter, t as capacityOf, u as unitsOf } from "./policy-B23MY52l.js";
5
+ import { a as lateHolds, l as takeOutside, n as countOf, r as millisecondsOf, s as ownStream, t as boundedMillisecondsOf } from "./knobs-BJcz6m01.js";
6
+ import { a as isExitCode, c as matchesMessage, i as embeddedProcess, l as nodeProcess, n as PROCESS_TRIGGERS, o as isExitSignal, r as UNCAUGHT_ORIGINS, s as isMessageShape, t as EXIT_SIGNALS, u as processPortOf } from "./process-Oe0Abbsm.js";
7
+ import { a as runUnit, c as untilAbort, i as retryOf, l as routePatternProblems, n as boundProblems, o as settleWithin, r as flights, s as sleeper, t as tracker } from "./requests-DD2ALv0_.js";
9
8
  import { backoffBand, backoffDelay, backoffProblems } from "./backoff.js";
10
9
  import { DRAIN_RULES, O04, O09, O10, O16 } from "./rules.js";
11
- import { i as retryAfterDelay, r as retry, t as retrier } from "./retrier-Nt6r4r6R.js";
12
- import { a as keyedLimiter, i as limiterStateOf, n as TOKEN_BUCKET_MACHINE, o as memoryStore, r as limiterMachine, t as SLIDING_WINDOW_MACHINE } from "./limiter-BTgM4aXZ.js";
10
+ import { detectionTime, heartbeat } from "./heartbeat.js";
11
+ import { i as retryAfterDelay, r as retry, t as retrier } from "./retrier-BObZq10-.js";
12
+ import { a as keyedLimiter, i as limiterStateOf, n as TOKEN_BUCKET_MACHINE, o as memoryStore, r as limiterMachine, t as SLIDING_WINDOW_MACHINE } from "./limiter-BwGxEWpP.js";
13
13
  import { convertExact, convertible, rationals, valueIn } from "@mark1russell7/quantity";
14
14
  import { replay } from "@mark1russell7/algebra/replay";
15
- //#region src/description.ts
15
+ // src/description.ts
16
16
  /**
17
17
  * This is the format of a service as data: what `describe()` exports, and nothing starts. The
18
18
  * timer algebra and the ordering law read it. Each timer has a unit. Each knob comes from the
@@ -20,8 +20,7 @@ import { replay } from "@mark1russell7/algebra/replay";
20
20
  * zero.
21
21
  */
22
22
  const FORMAT = "mark1russell7.service/1";
23
- //#endregion
24
- //#region src/latch.ts
23
+ // src/latch.ts
25
24
  const ms = (amount) => valueIn(amount, "ms");
26
25
  /**
27
26
  * This function makes a latch. `tripped` is its state at the start: a readiness latch starts
@@ -139,8 +138,7 @@ const latch = (timing, clock, tripped, changed, trace) => {
139
138
  }
140
139
  };
141
140
  };
142
- //#endregion
143
- //#region src/metrics.ts
141
+ // src/metrics.ts
144
142
  /** These fractions of the timeout of a poll are the bounds of its histogram. */
145
143
  const DURATION_FRACTIONS = [
146
144
  .05,
@@ -247,8 +245,7 @@ const meter = () => {
247
245
  metrics
248
246
  };
249
247
  };
250
- //#endregion
251
- //#region src/poller.ts
248
+ // src/poller.ts
252
249
  const message$1 = (error) => error instanceof Error ? error.message : String(error);
253
250
  /**
254
251
  * This function makes a poller. The loop is on a fixed delay from the start of each poll. Thus the
@@ -396,8 +393,7 @@ const poller = (options) => {
396
393
  }
397
394
  };
398
395
  };
399
- //#endregion
400
- //#region src/health.ts
396
+ // src/health.ts
401
397
  /**
402
398
  * This function makes the runtime of a declaration. The service has no defaults of its own: each
403
399
  * timing, poll and coupling comes from the description.
@@ -612,8 +608,7 @@ const healthRuntime = (description, runs, options = {}) => {
612
608
  }
613
609
  };
614
610
  };
615
- //#endregion
616
- //#region src/logger.ts
611
+ // src/logger.ts
617
612
  /** These are the levels of a log entry, from the least to the most severe. */
618
613
  const LOG_LEVELS = [
619
614
  "debug",
@@ -792,8 +787,7 @@ const logEvents = (logger, description) => {
792
787
  write("debug", `${machine} ${instance}: ${from} -> ${to} on ${on}`, base);
793
788
  };
794
789
  };
795
- //#endregion
796
- //#region src/lifecycle.ts
790
+ // src/lifecycle.ts
797
791
  /**
798
792
  * These are the stages of the shutdown, in their sequence. A declared phase with one of these
799
793
  * names gets the work of the runtime for its stage. A phase with another name gets only the work of
@@ -1196,8 +1190,7 @@ const lifecycle = (description, runtime, components, options = {}, bind = () =>
1196
1190
  });
1197
1191
  return life;
1198
1192
  };
1199
- //#endregion
1200
- //#region src/watchdog.ts
1193
+ // src/watchdog.ts
1201
1194
  /** This function starts a watchdog on a clock. */
1202
1195
  const watchdog = (clock, spec, trace) => {
1203
1196
  const tick = valueIn(spec.tick, "ms");
@@ -1246,8 +1239,7 @@ const watchdog = (clock, spec, trace) => {
1246
1239
  }
1247
1240
  };
1248
1241
  };
1249
- //#endregion
1250
- //#region src/builder.ts
1242
+ // src/builder.ts
1251
1243
  const isTime$1 = (amount) => convertible(amount.unit, "s");
1252
1244
  const above = (amount) => amount.value === "infinite" || isTime$1(amount) && valueIn(amount, "s") > 0;
1253
1245
  const whole = (count) => Number.isInteger(count) && count >= 1;
@@ -1732,8 +1724,7 @@ const service = (name) => {
1732
1724
  };
1733
1725
  return builder;
1734
1726
  };
1735
- //#endregion
1736
- //#region src/law.ts
1727
+ // src/law.ts
1737
1728
  const value = (bound) => bound === "inf" || bound === "off" ? Infinity : Number(bound);
1738
1729
  const keyOf = (term) => term.at !== void 0 ? `${term.knob}@${term.at}` : term.knob;
1739
1730
  /** This function gives the bound of a symbol, or undefined when the symbol has no bound. */
@@ -1879,8 +1870,7 @@ const compression = (rules, bind, k, marks) => {
1879
1870
  unmarked: compressed.unmarked.filter((symbol) => read.has(symbol))
1880
1871
  };
1881
1872
  };
1882
- //#endregion
1883
- //#region src/lint.ts
1873
+ // src/lint.ts
1884
1874
  /** The law binds this statistic of a distribution. */
1885
1875
  const LAW_STATISTIC = "p99";
1886
1876
  /** These are the identifiers of the rules that each declaration gets. */
@@ -2448,8 +2438,7 @@ const lint = (svc, scenario, rules) => {
2448
2438
  ...BOUND_RULES.flatMap((rule) => findingsOf(svc, scenario, service, rule))
2449
2439
  ];
2450
2440
  };
2451
- //#endregion
2452
- //#region src/stops.ts
2441
+ // src/stops.ts
2453
2442
  /**
2454
2443
  * These are the identifiers of the rules of the drain, from the data of the entry `./rules`. Each
2455
2444
  * way that a pod stops applies only its own rules of this set.
@@ -2530,8 +2519,7 @@ const lintStop = (svc, scenario, rules, way) => {
2530
2519
  unbound: ["exit_detection@pod"]
2531
2520
  }];
2532
2521
  };
2533
- //#endregion
2534
- //#region src/identity.ts
2522
+ // src/identity.ts
2535
2523
  /**
2536
2524
  * The exported type names that hold or reach a value that service knows by identity. A package
2537
2525
  * whose public API takes or gives a value of one of these types has service as a peer dependency.
@@ -2572,8 +2560,7 @@ const IDENTITY_TYPES = [
2572
2560
  "WorkerLoopOptions",
2573
2561
  "WsClient"
2574
2562
  ];
2575
- //#endregion
2576
- //#region src/profiles.ts
2563
+ // src/profiles.ts
2577
2564
  const s = (value) => ({
2578
2565
  value,
2579
2566
  unit: "s"
@@ -2689,8 +2676,7 @@ const kubernetes = (pod) => {
2689
2676
  onRepeatSignal: "ignore"
2690
2677
  };
2691
2678
  };
2692
- //#endregion
2693
- //#region src/worker.ts
2679
+ // src/worker.ts
2694
2680
  const OWNER$1 = "workerLoop";
2695
2681
  /**
2696
2682
  * This function makes a worker loop as a transport (S6 A10). It has a setup, an iteration and a
@@ -2836,8 +2822,7 @@ const workerLoop = (knobs, options) => {
2836
2822
  }
2837
2823
  };
2838
2824
  };
2839
- //#endregion
2840
- //#region src/queue.ts
2825
+ // src/queue.ts
2841
2826
  /**
2842
2827
  * This function gives the redelivery policy of S6 A11. A poison message gets `ack`. Each other job
2843
2828
  * goes back on the queue after its first failure, one time. After a later failure, `then` gives the
@@ -3109,8 +3094,7 @@ const queueDrain = (knobs, options) => {
3109
3094
  }
3110
3095
  };
3111
3096
  };
3112
- //#endregion
3113
- //#region src/machines.ts
3097
+ // src/machines.ts
3114
3098
  /**
3115
3099
  * The machines of the runtime as `mark1russell7.machine/1` documents. The documents are the
3116
3100
  * specification, and TypeScript implements them. A test records the transitions of the runtime
@@ -3558,7 +3542,6 @@ const MACHINES = {
3558
3542
  exit: EXIT_MACHINE,
3559
3543
  watchdog: WATCHDOG_MACHINE
3560
3544
  };
3561
- //#endregion
3562
3545
  export { BOUND_RULES, CLOSE_BOUND_RULE, DECLARATION_RULE, DRAIN_RULES, DRAIN_RULE_IDS, DURATION_FRACTIONS, EPISODES_KEPT, EXIT_MACHINE, EXIT_SIGNALS, FORMAT, GATE_MACHINE, IDENTITY_TYPES, LATCH_MACHINE, LAW_STATISTIC, LIMITER_RULES, LOG_LEVELS, MACHINES, NAME_RULE, O04, O09, O10, O16, PLATFORM_MARKS, POLLER_MACHINE, PROCESS_TRIGGERS, PROGRESS_RULE, SERVICE_RULES, SLIDING_WINDOW_MACHINE, STAGES, STOPS, STOP_RULE, TOKEN_BUCKET_MACHINE, UNCAUGHT_ORIGINS, UNIT_BOUND_RULE, WATCHDOG_MACHINE, WINDOW_MACHINE, asDebounce, asWindow, atLeast, backoffBand, backoffDelay, backoffProblems, capKnob, capacityOf, compress, compression, compressionOf, consoleLogger, cooperativeAbortAt, daemon, decide, detectionTime, drainMachine, embeddedProcess, ephemeral, evaluate, failSpan, freeAt, heartbeat, heartbeatDetection, idleSpan, inequalities, isExitCode, isExitSignal, isMessageShape, keyedLimiter, kubernetes, limitRule, limiterMachine, limiterProblems, limiterStateOf, lint, lintStop, localDev, logEvents, longestRetryAfter, matchesMessage, mayReissue, memoryStore, nodeProcess, overCapacity, platformClock, processPortOf, queueDrain, realClock, recoverSpan, redact, redeliverOnce, replay, retrier, retry, retryAfterDelay, retryAfterSeconds, service, serviceBindings, stageRank, symbolsOf, unitsOf, verdictOf, watchdog, workerLoop };
3563
3546
 
3564
3547
  //# sourceMappingURL=index.js.map