@deslop/deploy 0.1.1343 → 0.1.1345

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/server.js CHANGED
@@ -11472,6 +11472,8 @@ const provideService$3 = function() {
11472
11472
  };
11473
11473
  const provideServiceImpl = (self, service, implementation) => updateContext$1(self, add$2(service, implementation));
11474
11474
  /** @internal */
11475
+ const provideServiceEffect$1 = /*#__PURE__*/ dual(3, (self, service, acquire) => flatMap$5(acquire, (implementation) => provideService$3(self, service, implementation)));
11476
+ /** @internal */
11475
11477
  const zipWith$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[1]), (self, that, f, options) => options?.concurrent ? map$9(all$2([self, that], { concurrency: 2 }), ([a, a2]) => f(a, a2)) : flatMap$5(self, (a) => map$9(that, (a2) => f(a, a2))));
11476
11478
  /** @internal */
11477
11479
  const filterOrFail$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail$10(orFailWith(a)) : () => fail$10(new NoSuchElementError())));
@@ -21620,6 +21622,63 @@ const updateService = updateService$1;
21620
21622
  */
21621
21623
  const provideService$2 = provideService$3;
21622
21624
  /**
21625
+ * Provides one service to an effect using an effectful acquisition.
21626
+ *
21627
+ * **When to use**
21628
+ *
21629
+ * Use when the service implementation must be created by an effect and its
21630
+ * acquisition failure should remain in the returned effect.
21631
+ *
21632
+ * **Details**
21633
+ *
21634
+ * `provideServiceEffect` runs the acquisition effect to produce the service
21635
+ * implementation, removes that service from the wrapped effect's requirements,
21636
+ * and leaves any other requirements to be provided later. Acquisition failures
21637
+ * are included in the returned effect's error channel.
21638
+ *
21639
+ * **Example** (Providing a service with an effect)
21640
+ *
21641
+ * ```ts import.meta.vitest
21642
+ * import { Context, Effect } from "effect"
21643
+ * const output: Array<unknown> = []
21644
+ *
21645
+ * // Define a database connection service
21646
+ * interface DatabaseConnection {
21647
+ * readonly query: (sql: string) => Effect.Effect<string>
21648
+ * }
21649
+ * const Database = Context.Service<DatabaseConnection>("Database")
21650
+ *
21651
+ * // Effect that creates a database connection
21652
+ * const createConnection = Effect.gen(function*() {
21653
+ * yield* Effect.sync(() => { output.push("Establishing database connection...") })
21654
+ * yield* Effect.sync(() => { output.push("Database connected!") })
21655
+ * return {
21656
+ * query: (sql: string) => Effect.succeed(`Result for: ${sql}`)
21657
+ * }
21658
+ * })
21659
+ *
21660
+ * const program = Effect.gen(function*() {
21661
+ * const db = yield* Effect.service(Database)
21662
+ * return yield* db.query("SELECT * FROM users")
21663
+ * })
21664
+ *
21665
+ * // Provide the service through an effect
21666
+ * const withDatabase = Effect.provideServiceEffect(
21667
+ * program,
21668
+ * Database,
21669
+ * createConnection
21670
+ * )
21671
+ *
21672
+ * void output.push(await Effect.runPromise(withDatabase))
21673
+ * output // => ["Establishing database connection...", "Database connected!", "Result for: SELECT * FROM users"]
21674
+ * ```
21675
+ *
21676
+ * @stability stable
21677
+ * @category providing services
21678
+ * @since 2.0.0
21679
+ */
21680
+ const provideServiceEffect = provideServiceEffect$1;
21681
+ /**
21623
21682
  * Returns the current scope for resource management.
21624
21683
  *
21625
21684
  * **Example** (Accessing the current scope)
@@ -84441,7 +84500,7 @@ const fromDuplex = (open, options) => withFiber((fiber) => {
84441
84500
  writer
84442
84501
  }));
84443
84502
  });
84444
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/constants.js
84503
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/constants.js
84445
84504
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84446
84505
  const BINARY_TYPES = [
84447
84506
  "nodebuffer",
@@ -84463,7 +84522,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84463
84522
  NOOP: () => {}
84464
84523
  };
84465
84524
  }));
84466
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/buffer-util.js
84525
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/buffer-util.js
84467
84526
  var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84468
84527
  const { websocketMask, websocketUnmask } = __require("http");
84469
84528
  const { EMPTY_BUFFER } = require_constants();
@@ -84571,7 +84630,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84571
84630
  };
84572
84631
  } catch (e) {}
84573
84632
  }));
84574
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/limiter.js
84633
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/limiter.js
84575
84634
  var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84576
84635
  const kDone = Symbol("kDone");
84577
84636
  const kRun = Symbol("kRun");
@@ -84621,7 +84680,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84621
84680
  };
84622
84681
  module.exports = Limiter;
84623
84682
  }));
84624
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/permessage-deflate.js
84683
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/permessage-deflate.js
84625
84684
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84626
84685
  const zlib = __require("zlib");
84627
84686
  const bufferUtil = require_buffer_util();
@@ -84956,7 +85015,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
84956
85015
  this[kCallback](err);
84957
85016
  }
84958
85017
  }));
84959
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/validation.js
85018
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/validation.js
84960
85019
  var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84961
85020
  const { isUtf8 } = __require("buffer");
84962
85021
  const { hasBlob } = require_constants();
@@ -85151,7 +85210,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85151
85210
  };
85152
85211
  } catch (e) {}
85153
85212
  }));
85154
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/receiver.js
85213
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/receiver.js
85155
85214
  var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85156
85215
  const { Writable } = __require("stream");
85157
85216
  const PerMessageDeflate = require_permessage_deflate();
@@ -85614,7 +85673,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85614
85673
  };
85615
85674
  module.exports = Receiver;
85616
85675
  }));
85617
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/sender.js
85676
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/sender.js
85618
85677
  var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85619
85678
  const { Duplex } = __require("stream");
85620
85679
  const { randomFillSync } = __require("crypto");
@@ -86112,7 +86171,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86112
86171
  sender.onerror(err);
86113
86172
  }
86114
86173
  }));
86115
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/event-target.js
86174
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/event-target.js
86116
86175
  var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86117
86176
  const { kForOnEventAttribute, kListener } = require_constants();
86118
86177
  const kCode = Symbol("kCode");
@@ -86342,7 +86401,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86342
86401
  else listener.call(thisArg, event);
86343
86402
  }
86344
86403
  }));
86345
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/extension.js
86404
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/extension.js
86346
86405
  var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86347
86406
  const { tokenChars } = require_validation();
86348
86407
  /**
@@ -86487,7 +86546,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86487
86546
  parse
86488
86547
  };
86489
86548
  }));
86490
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket.js
86549
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket.js
86491
86550
  var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86492
86551
  const EventEmitter = __require("events");
86493
86552
  const https = __require("https");
@@ -86560,12 +86619,15 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86560
86619
  else protocols = [options.protocols];
86561
86620
  } else protocols = [protocols];
86562
86621
  }
86563
- initAsClient(this, address, protocols, options);
86564
- } else {
86565
- this._autoPong = options.autoPong;
86566
- this._closeTimeout = options.closeTimeout;
86567
- this._isServer = true;
86622
+ options = initAsClient(this, address, protocols, options);
86623
+ } else this._isServer = true;
86624
+ if (options.autoPong) {
86625
+ this._autoPong = true;
86626
+ this._autoPongComplete = () => autoPongComplete(this);
86627
+ this._pendingAutoPongs = 0;
86628
+ this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
86568
86629
  }
86630
+ this._closeTimeout = options.closeTimeout;
86569
86631
  }
86570
86632
  /**
86571
86633
  * For historical reasons, the custom "nodebuffer" type is used by the default
@@ -87006,6 +87068,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87006
87068
  * fragments
87007
87069
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
87008
87070
  * size
87071
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
87072
+ * pending automatic pongs
87009
87073
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
87010
87074
  * allowed
87011
87075
  * @param {String} [options.origin] Value of the `Origin` or
@@ -87016,6 +87080,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87016
87080
  * `Sec-WebSocket-Version` header
87017
87081
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
87018
87082
  * not to skip UTF-8 validation for text and close messages
87083
+ * @return {Object} The resolved options object used for initialization
87019
87084
  * @private
87020
87085
  */
87021
87086
  function initAsClient(websocket, address, protocols, options) {
@@ -87027,6 +87092,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87027
87092
  maxBufferedChunks: 262144,
87028
87093
  maxFragments: 16384,
87029
87094
  maxPayload: 104857600,
87095
+ maxPendingAutoPongs: 60,
87030
87096
  skipUTF8Validation: false,
87031
87097
  perMessageDeflate: true,
87032
87098
  followRedirects: false,
@@ -87042,8 +87108,6 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87042
87108
  path: void 0,
87043
87109
  port: void 0
87044
87110
  };
87045
- websocket._autoPong = opts.autoPong;
87046
- websocket._closeTimeout = opts.closeTimeout;
87047
87111
  if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
87048
87112
  let parsedUrl;
87049
87113
  if (address instanceof URL) parsedUrl = address;
@@ -87233,6 +87297,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87233
87297
  });
87234
87298
  if (opts.finishRequest) opts.finishRequest(req, websocket);
87235
87299
  else req.end();
87300
+ return opts;
87236
87301
  }
87237
87302
  /**
87238
87303
  * Emit the `'error'` and `'close'` events.
@@ -87389,10 +87454,25 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87389
87454
  */
87390
87455
  function receiverOnPing(data) {
87391
87456
  const websocket = this[kWebSocket];
87392
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
87457
+ if (websocket._autoPong && websocket.readyState === WebSocket.OPEN) {
87458
+ if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) websocket.terminate();
87459
+ else {
87460
+ websocket._pendingAutoPongs++;
87461
+ websocket.pong(data, !this._isServer, websocket._autoPongComplete);
87462
+ }
87463
+ }
87393
87464
  websocket.emit("ping", data);
87394
87465
  }
87395
87466
  /**
87467
+ * The callback for automatic pong responses.
87468
+ *
87469
+ * @param {WebSocket} websocket The WebSocket instance
87470
+ * @private
87471
+ */
87472
+ function autoPongComplete(websocket) {
87473
+ websocket._pendingAutoPongs--;
87474
+ }
87475
+ /**
87396
87476
  * The listener of the `Receiver` `'pong'` event.
87397
87477
  *
87398
87478
  * @param {Buffer} data The data included in the pong frame
@@ -87497,7 +87577,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87497
87577
  }
87498
87578
  }
87499
87579
  }));
87500
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/stream.js
87580
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/stream.js
87501
87581
  var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87502
87582
  require_websocket();
87503
87583
  const { Duplex } = __require("stream");
@@ -87612,7 +87692,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87612
87692
  }
87613
87693
  module.exports = createWebSocketStream;
87614
87694
  }));
87615
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/subprotocol.js
87695
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/subprotocol.js
87616
87696
  var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87617
87697
  const { tokenChars } = require_validation();
87618
87698
  /**
@@ -87650,7 +87730,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87650
87730
  }
87651
87731
  module.exports = { parse };
87652
87732
  }));
87653
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket-server.js
87733
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket-server.js
87654
87734
  var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87655
87735
  const EventEmitter = __require("events");
87656
87736
  const http = __require("http");
@@ -87695,6 +87775,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
87695
87775
  * fragments
87696
87776
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
87697
87777
  * size
87778
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
87779
+ * pending automatic pongs
87698
87780
  * @param {Boolean} [options.noServer=false] Enable no server mode
87699
87781
  * @param {String} [options.path] Accept only connections matching this path
87700
87782
  * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
@@ -87717,6 +87799,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
87717
87799
  maxBufferedChunks: 262144,
87718
87800
  maxFragments: 16384,
87719
87801
  maxPayload: 104857600,
87802
+ maxPendingAutoPongs: 60,
87720
87803
  skipUTF8Validation: false,
87721
87804
  perMessageDeflate: false,
87722
87805
  handleProtocols: null,
@@ -112147,7 +112230,7 @@ function runApp(app) {
112147
112230
  return pipe(String$1(setting.flag), withSchema(setting.schema), withFallbackConfig(schema$1(setting.schema, env)), withDescription(`${setting.description} [${env}]`), optional);
112148
112231
  }));
112149
112232
  const given = map$7(root, (input) => getSomes$1(input));
112150
- return yield* pipe(root, withHandler((input) => flatMap$3(configProvider(getSomes$1(input), metadata.config.port), (values) => provideService$2(server(app), ConfigProvider, values))), withSubcommands([withSubcommands(make$12("service"), [
112233
+ return yield* pipe(root, withHandler((input) => provideServiceEffect(server(app), ConfigProvider, configProvider(getSomes$1(input), metadata.config.port))), withSubcommands([withSubcommands(make$12("service"), [
112151
112234
  make$12("install", {}, fnUntraced(function* () {
112152
112235
  const fs = yield* FileSystem;
112153
112236
  const path = yield* Path$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deslop/deploy",
3
- "version": "0.1.1343",
3
+ "version": "0.1.1345",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/MP281X/deslop.git",
@@ -40,5 +40,5 @@
40
40
  "engines": {
41
41
  "node": ">=26"
42
42
  },
43
- "fingerprint": "9e3bbb5e1786f0f395abc98e3bb531f39177cc7bc1aed3b58e9a06fac9adadcf"
43
+ "fingerprint": "13022e84ff58d5ea35905765e678cd7086cbe9b5f23eaed8ec015fd49c74f0ac"
44
44
  }