UNPKG

the-moby-effect

Version:
98 lines (96 loc) 4.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeWebHttpClientLayer = exports.makeUndiciHttpClientLayer = exports.makeNodeHttpClientLayer = exports.makeFetchHttpClientLayer = exports.makeDenoHttpClientLayer = exports.makeBunHttpClientLayer = exports.makeAgnosticHttpClientLayer = void 0; var Layer = _interopRequireWildcard(require("effect/Layer")); var internalAgnostic = _interopRequireWildcard(require("./internal/platforms/agnostic.js")); var internalBun = _interopRequireWildcard(require("./internal/platforms/bun.js")); var internalDeno = _interopRequireWildcard(require("./internal/platforms/deno.js")); var internalFetch = _interopRequireWildcard(require("./internal/platforms/fetch.js")); var internalNode = _interopRequireWildcard(require("./internal/platforms/node.js")); var internalUndici = _interopRequireWildcard(require("./internal/platforms/undici.js")); var internalWeb = _interopRequireWildcard(require("./internal/platforms/web.js")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** * Http client layers for all platforms. * * @since 1.0.0 */ /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. * * @since 1.0.0 * @category Connection */ const makeAgnosticHttpClientLayer = connectionOptions => Layer.merge(Layer.context(), internalAgnostic.makeAgnosticHttpClientLayer(connectionOptions)); /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. This is no * different than the Node implementation currently. * * This function will dynamically import the `@effect/platform-node` package. * * @since 1.0.0 * @category Connection */ exports.makeAgnosticHttpClientLayer = makeAgnosticHttpClientLayer; const makeBunHttpClientLayer = exports.makeBunHttpClientLayer = internalBun.makeBunHttpClientLayer; /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. This is no * different than the Node implementation currently. * * This function will dynamically import the `@effect/platform-node` package. * * FIXME: https://github.com/denoland/deno/issues/21436? * * @since 1.0.0 * @category Deno */ const makeDenoHttpClientLayer = exports.makeDenoHttpClientLayer = internalDeno.makeDenoHttpClientLayer; /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. By only * supporting http and https connection options, this function does not rely on * any specific platform package and uses the `@effect/platform/FetchHttpClient` * as its base http layer. * * @since 1.0.0 * @category Fetch */ const makeFetchHttpClientLayer = exports.makeFetchHttpClientLayer = internalFetch.makeFetchHttpClientLayer; /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. * * This function will dynamically import the `@effect/platform-node` package. * * @since 1.0.0 * @category NodeJS */ const makeNodeHttpClientLayer = exports.makeNodeHttpClientLayer = internalNode.makeNodeHttpClientLayer; /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. * * This function will dynamically import the `@effect/platform-node` and * `undici` packages. * * @since 1.0.0 * @category Undici */ const makeUndiciHttpClientLayer = exports.makeUndiciHttpClientLayer = internalUndici.makeUndiciHttpClientLayer; /** * Given the moby connection options, it will construct a layer that provides a * http client that you could use to connect to your moby instance. * * This function will dynamically import the `@effect/platform-browser` package. * * @since 1.0.0 * @category Browser */ const makeWebHttpClientLayer = exports.makeWebHttpClientLayer = internalWeb.makeWebHttpClientLayer; //# sourceMappingURL=MobyPlatforms.js.map