@interopio/gateway-server 0.14.1 → 0.15.0

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,72 +1,2 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name3 in all)
10
- __defProp(target, name3, { get: all[name3], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/gateway/metrics/rest.ts
31
- var rest_exports = {};
32
- __export(rest_exports, {
33
- create: () => create2,
34
- fetchWithCookies: () => fetchWithCookies,
35
- name: () => name2
36
- });
37
- module.exports = __toCommonJS(rest_exports);
38
- var rest = __toESM(require("@interopio/gateway/metrics/publisher/rest"), 1);
39
- var import_v6 = require("http-cookie-agent/undici/v6");
40
- var import_undici = require("http-cookie-agent/undici");
41
- var import_undici2 = require("undici");
42
- var import_tough_cookie = require("tough-cookie");
43
- function cookieAgent(jar) {
44
- const version = process.version;
45
- const major = Number(version.substring(1, version.indexOf(".")));
46
- const useUndiciV6 = major >= 18 && major < 24;
47
- if (useUndiciV6) {
48
- return new import_v6.CookieAgent({ cookies: { jar } });
49
- } else {
50
- return new import_undici.CookieAgent({ cookies: { jar } }).compose(import_undici2.interceptors.redirect());
51
- }
52
- }
53
- var fetchWithCookies = (existing) => {
54
- const fetchFn = existing ?? globalThis.fetch;
55
- const jar = new import_tough_cookie.CookieJar();
56
- const dispatcher = cookieAgent(jar);
57
- return async (input, request) => {
58
- const requestWithDispatcher = { ...request, dispatcher };
59
- return await fetchFn(input, requestWithDispatcher);
60
- };
61
- };
62
- var name2 = rest.name;
63
- function create2(cfg, logger) {
64
- return rest.create({ ...cfg, fetch: fetchWithCookies(cfg.fetch) }, logger);
65
- }
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- create,
69
- fetchWithCookies,
70
- name
71
- });
1
+ "use strict";var k=Object.create;var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var w=(e,o)=>{for(var t in o)n(e,t,{get:o[t],enumerable:!0})},c=(e,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of d(o))!l.call(e,r)&&r!==t&&n(e,r,{get:()=>o[r],enumerable:!(i=C(o,r))||i.enumerable});return e};var A=(e,o,t)=>(t=e!=null?k(y(e)):{},c(o||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e)),U=e=>c(n({},"__esModule",{value:!0}),e);var q={};w(q,{create:()=>R,fetchWithCookies:()=>g,name:()=>x});module.exports=U(q);var s=A(require("@interopio/gateway/metrics/publisher/rest"),1),a=require("http-cookie-agent/undici/v6"),f=require("http-cookie-agent/undici"),p=require("undici"),m=require("tough-cookie");function b(e){let o=process.version,t=Number(o.substring(1,o.indexOf(".")));return t>=18&&t<24?new a.CookieAgent({cookies:{jar:e}}):new f.CookieAgent({cookies:{jar:e}}).compose(p.interceptors.redirect())}var g=e=>{let o=e??globalThis.fetch,t=new m.CookieJar,i=b(t);return async(r,u)=>{let h={...u,dispatcher:i};return await o(r,h)}},x=s.name;async function R(e,o){return s.create({...e,fetch:g(e.fetch)},o)}0&&(module.exports={create,fetchWithCookies,name});
72
2
  //# sourceMappingURL=rest.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/gateway/metrics/rest.ts"],
4
- "sourcesContent": ["import * as rest from '@interopio/gateway/metrics/publisher/rest';\nimport type { Logger } from '@interopio/gateway/logging/api';\nimport { CookieAgent as CookieAgentUndiciV6 } from 'http-cookie-agent/undici/v6';\nimport { CookieAgent as CookieAgentUndici } from 'http-cookie-agent/undici';\nimport { interceptors } from 'undici';\nimport { CookieJar } from 'tough-cookie';\n\nfunction cookieAgent(jar: CookieJar) {\n const version = process.version;\n const major = Number(version.substring(1 /*skip v prefix*/, version.indexOf('.')));\n const useUndiciV6 = major >= 18 && major < 24; // undici v6 is used for Node.js 18.x to 23.x\n\n if (useUndiciV6) {\n return new CookieAgentUndiciV6({cookies: {jar}});\n }\n else {\n return new CookieAgentUndici({cookies: {jar}}).compose(interceptors.redirect());\n }\n\n}\nexport const fetchWithCookies = (existing?: typeof fetch): typeof fetch => {\n const fetchFn = existing ?? globalThis.fetch;\n const jar = new CookieJar();\n const dispatcher = cookieAgent(jar);\n return async (input: RequestInfo | URL, request?: RequestInit) => {\n const requestWithDispatcher = {...request, dispatcher};\n return await fetchFn(input, requestWithDispatcher);\n }\n}\nexport const name = rest.name;\n\nexport function create(cfg: rest.RestPublisherConfig, logger: Logger) {\n return rest.create({...cfg, fetch: fetchWithCookies(cfg.fetch)}, logger);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA,cAAAC;AAAA;AAAA;AAAA,WAAsB;AAEtB,gBAAmD;AACnD,oBAAiD;AACjD,IAAAC,iBAA6B;AAC7B,0BAA0B;AAE1B,SAAS,YAAY,KAAgB;AACjC,QAAM,UAAU,QAAQ;AACxB,QAAM,QAAQ,OAAO,QAAQ,UAAU,GAAqB,QAAQ,QAAQ,GAAG,CAAC,CAAC;AACjF,QAAM,cAAc,SAAS,MAAM,QAAQ;AAE3C,MAAI,aAAa;AACb,WAAO,IAAI,UAAAC,YAAoB,EAAC,SAAS,EAAC,IAAG,EAAC,CAAC;AAAA,EACnD,OACK;AACD,WAAO,IAAI,cAAAC,YAAkB,EAAC,SAAS,EAAC,IAAG,EAAC,CAAC,EAAE,QAAQ,4BAAa,SAAS,CAAC;AAAA,EAClF;AAEJ;AACO,IAAM,mBAAmB,CAAC,aAA0C;AACvE,QAAM,UAAU,YAAY,WAAW;AACvC,QAAM,MAAM,IAAI,8BAAU;AAC1B,QAAM,aAAa,YAAY,GAAG;AAClC,SAAO,OAAO,OAA0B,YAA0B;AAC9D,UAAM,wBAAwB,EAAC,GAAG,SAAS,WAAU;AACrD,WAAO,MAAM,QAAQ,OAAO,qBAAqB;AAAA,EACrD;AACJ;AACO,IAAMH,QAAY;AAElB,SAASD,QAAO,KAA+B,QAAgB;AAClE,SAAY,YAAO,EAAC,GAAG,KAAK,OAAO,iBAAiB,IAAI,KAAK,EAAC,GAAG,MAAM;AAC3E;",
6
- "names": ["create", "name", "import_undici", "CookieAgentUndiciV6", "CookieAgentUndici"]
4
+ "sourcesContent": ["import * as rest from '@interopio/gateway/metrics/publisher/rest';\nimport type { Logger } from '@interopio/gateway/logging/api';\nimport { CookieAgent as CookieAgentUndiciV6 } from 'http-cookie-agent/undici/v6';\nimport { CookieAgent as CookieAgentUndici } from 'http-cookie-agent/undici';\nimport { interceptors } from 'undici';\nimport { CookieJar } from 'tough-cookie';\n\nfunction cookieAgent(jar: CookieJar) {\n const version = process.version;\n const major = Number(version.substring(1 /*skip v prefix*/, version.indexOf('.')));\n const useUndiciV6 = major >= 18 && major < 24; // undici v6 is used for Node.js 18.x to 23.x\n\n if (useUndiciV6) {\n return new CookieAgentUndiciV6({cookies: {jar}});\n }\n else {\n return new CookieAgentUndici({cookies: {jar}}).compose(interceptors.redirect());\n }\n\n}\nexport const fetchWithCookies = (existing?: typeof fetch): typeof fetch => {\n const fetchFn = existing ?? globalThis.fetch;\n const jar = new CookieJar();\n const dispatcher = cookieAgent(jar);\n return async (input: RequestInfo | URL, request?: RequestInit) => {\n const requestWithDispatcher = {...request, dispatcher};\n return await fetchFn(input, requestWithDispatcher);\n }\n}\nexport const name = rest.name;\n\nexport async function create(cfg: rest.RestPublisherConfig, logger: Logger) {\n return rest.create({...cfg, fetch: fetchWithCookies(cfg.fetch)}, logger);\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,qBAAAC,EAAA,SAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAAsB,0DAEtBC,EAAmD,uCACnDC,EAAiD,oCACjDA,EAA6B,kBAC7BC,EAA0B,wBAE1B,SAASC,EAAYC,EAAgB,CACjC,IAAMC,EAAU,QAAQ,QAClBC,EAAQ,OAAOD,EAAQ,UAAU,EAAqBA,EAAQ,QAAQ,GAAG,CAAC,CAAC,EAGjF,OAFoBC,GAAS,IAAMA,EAAQ,GAGhC,IAAI,EAAAC,YAAoB,CAAC,QAAS,CAAC,IAAAH,CAAG,CAAC,CAAC,EAGxC,IAAI,EAAAI,YAAkB,CAAC,QAAS,CAAC,IAAAJ,CAAG,CAAC,CAAC,EAAE,QAAQ,eAAa,SAAS,CAAC,CAGtF,CACO,IAAMR,EAAoBa,GAA0C,CACvE,IAAMC,EAAUD,GAAY,WAAW,MACjCL,EAAM,IAAI,YACVO,EAAaR,EAAYC,CAAG,EAClC,MAAO,OAAOQ,EAA0BC,IAA0B,CAC9D,IAAMC,EAAwB,CAAC,GAAGD,EAAS,WAAAF,CAAU,EACrD,OAAO,MAAMD,EAAQE,EAAOE,CAAqB,CACrD,CACJ,EACajB,EAAY,OAEzB,eAAsBF,EAAOoB,EAA+BC,EAAgB,CACxE,OAAY,SAAO,CAAC,GAAGD,EAAK,MAAOnB,EAAiBmB,EAAI,KAAK,CAAC,EAAGC,CAAM,CAC3E",
6
+ "names": ["rest_exports", "__export", "create", "fetchWithCookies", "name", "__toCommonJS", "rest", "import_v6", "import_undici", "import_tough_cookie", "cookieAgent", "jar", "version", "major", "CookieAgentUndiciV6", "CookieAgentUndici", "existing", "fetchFn", "dispatcher", "input", "request", "requestWithDispatcher", "cfg", "logger"]
7
7
  }
@@ -1,35 +1,2 @@
1
- // src/gateway/metrics/rest.ts
2
- import * as rest from "@interopio/gateway/metrics/publisher/rest";
3
- import { CookieAgent as CookieAgentUndiciV6 } from "http-cookie-agent/undici/v6";
4
- import { CookieAgent as CookieAgentUndici } from "http-cookie-agent/undici";
5
- import { interceptors } from "undici";
6
- import { CookieJar } from "tough-cookie";
7
- function cookieAgent(jar) {
8
- const version = process.version;
9
- const major = Number(version.substring(1, version.indexOf(".")));
10
- const useUndiciV6 = major >= 18 && major < 24;
11
- if (useUndiciV6) {
12
- return new CookieAgentUndiciV6({ cookies: { jar } });
13
- } else {
14
- return new CookieAgentUndici({ cookies: { jar } }).compose(interceptors.redirect());
15
- }
16
- }
17
- var fetchWithCookies = (existing) => {
18
- const fetchFn = existing ?? globalThis.fetch;
19
- const jar = new CookieJar();
20
- const dispatcher = cookieAgent(jar);
21
- return async (input, request) => {
22
- const requestWithDispatcher = { ...request, dispatcher };
23
- return await fetchFn(input, requestWithDispatcher);
24
- };
25
- };
26
- var name2 = rest.name;
27
- function create2(cfg, logger) {
28
- return rest.create({ ...cfg, fetch: fetchWithCookies(cfg.fetch) }, logger);
29
- }
30
- export {
31
- create2 as create,
32
- fetchWithCookies,
33
- name2 as name
34
- };
1
+ import*as r from"@interopio/gateway/metrics/publisher/rest";import{CookieAgent as a}from"http-cookie-agent/undici/v6";import{CookieAgent as f}from"http-cookie-agent/undici";import{interceptors as p}from"undici";import{CookieJar as m}from"tough-cookie";function g(e){let o=process.version,t=Number(o.substring(1,o.indexOf(".")));return t>=18&&t<24?new a({cookies:{jar:e}}):new f({cookies:{jar:e}}).compose(p.redirect())}var u=e=>{let o=e??globalThis.fetch,t=new m,i=g(t);return async(n,s)=>{let c={...s,dispatcher:i};return await o(n,c)}},y=r.name;async function l(e,o){return r.create({...e,fetch:u(e.fetch)},o)}export{l as create,u as fetchWithCookies,y as name};
35
2
  //# sourceMappingURL=rest.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/gateway/metrics/rest.ts"],
4
- "sourcesContent": ["import * as rest from '@interopio/gateway/metrics/publisher/rest';\nimport type { Logger } from '@interopio/gateway/logging/api';\nimport { CookieAgent as CookieAgentUndiciV6 } from 'http-cookie-agent/undici/v6';\nimport { CookieAgent as CookieAgentUndici } from 'http-cookie-agent/undici';\nimport { interceptors } from 'undici';\nimport { CookieJar } from 'tough-cookie';\n\nfunction cookieAgent(jar: CookieJar) {\n const version = process.version;\n const major = Number(version.substring(1 /*skip v prefix*/, version.indexOf('.')));\n const useUndiciV6 = major >= 18 && major < 24; // undici v6 is used for Node.js 18.x to 23.x\n\n if (useUndiciV6) {\n return new CookieAgentUndiciV6({cookies: {jar}});\n }\n else {\n return new CookieAgentUndici({cookies: {jar}}).compose(interceptors.redirect());\n }\n\n}\nexport const fetchWithCookies = (existing?: typeof fetch): typeof fetch => {\n const fetchFn = existing ?? globalThis.fetch;\n const jar = new CookieJar();\n const dispatcher = cookieAgent(jar);\n return async (input: RequestInfo | URL, request?: RequestInit) => {\n const requestWithDispatcher = {...request, dispatcher};\n return await fetchFn(input, requestWithDispatcher);\n }\n}\nexport const name = rest.name;\n\nexport function create(cfg: rest.RestPublisherConfig, logger: Logger) {\n return rest.create({...cfg, fetch: fetchWithCookies(cfg.fetch)}, logger);\n}\n"],
5
- "mappings": ";AAAA,YAAY,UAAU;AAEtB,SAAS,eAAe,2BAA2B;AACnD,SAAS,eAAe,yBAAyB;AACjD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAE1B,SAAS,YAAY,KAAgB;AACjC,QAAM,UAAU,QAAQ;AACxB,QAAM,QAAQ,OAAO,QAAQ,UAAU,GAAqB,QAAQ,QAAQ,GAAG,CAAC,CAAC;AACjF,QAAM,cAAc,SAAS,MAAM,QAAQ;AAE3C,MAAI,aAAa;AACb,WAAO,IAAI,oBAAoB,EAAC,SAAS,EAAC,IAAG,EAAC,CAAC;AAAA,EACnD,OACK;AACD,WAAO,IAAI,kBAAkB,EAAC,SAAS,EAAC,IAAG,EAAC,CAAC,EAAE,QAAQ,aAAa,SAAS,CAAC;AAAA,EAClF;AAEJ;AACO,IAAM,mBAAmB,CAAC,aAA0C;AACvE,QAAM,UAAU,YAAY,WAAW;AACvC,QAAM,MAAM,IAAI,UAAU;AAC1B,QAAM,aAAa,YAAY,GAAG;AAClC,SAAO,OAAO,OAA0B,YAA0B;AAC9D,UAAM,wBAAwB,EAAC,GAAG,SAAS,WAAU;AACrD,WAAO,MAAM,QAAQ,OAAO,qBAAqB;AAAA,EACrD;AACJ;AACO,IAAMA,QAAY;AAElB,SAASC,QAAO,KAA+B,QAAgB;AAClE,SAAY,YAAO,EAAC,GAAG,KAAK,OAAO,iBAAiB,IAAI,KAAK,EAAC,GAAG,MAAM;AAC3E;",
6
- "names": ["name", "create"]
4
+ "sourcesContent": ["import * as rest from '@interopio/gateway/metrics/publisher/rest';\nimport type { Logger } from '@interopio/gateway/logging/api';\nimport { CookieAgent as CookieAgentUndiciV6 } from 'http-cookie-agent/undici/v6';\nimport { CookieAgent as CookieAgentUndici } from 'http-cookie-agent/undici';\nimport { interceptors } from 'undici';\nimport { CookieJar } from 'tough-cookie';\n\nfunction cookieAgent(jar: CookieJar) {\n const version = process.version;\n const major = Number(version.substring(1 /*skip v prefix*/, version.indexOf('.')));\n const useUndiciV6 = major >= 18 && major < 24; // undici v6 is used for Node.js 18.x to 23.x\n\n if (useUndiciV6) {\n return new CookieAgentUndiciV6({cookies: {jar}});\n }\n else {\n return new CookieAgentUndici({cookies: {jar}}).compose(interceptors.redirect());\n }\n\n}\nexport const fetchWithCookies = (existing?: typeof fetch): typeof fetch => {\n const fetchFn = existing ?? globalThis.fetch;\n const jar = new CookieJar();\n const dispatcher = cookieAgent(jar);\n return async (input: RequestInfo | URL, request?: RequestInit) => {\n const requestWithDispatcher = {...request, dispatcher};\n return await fetchFn(input, requestWithDispatcher);\n }\n}\nexport const name = rest.name;\n\nexport async function create(cfg: rest.RestPublisherConfig, logger: Logger) {\n return rest.create({...cfg, fetch: fetchWithCookies(cfg.fetch)}, logger);\n}\n"],
5
+ "mappings": "AAAA,UAAYA,MAAU,4CAEtB,OAAS,eAAeC,MAA2B,8BACnD,OAAS,eAAeC,MAAyB,2BACjD,OAAS,gBAAAC,MAAoB,SAC7B,OAAS,aAAAC,MAAiB,eAE1B,SAASC,EAAYC,EAAgB,CACjC,IAAMC,EAAU,QAAQ,QAClBC,EAAQ,OAAOD,EAAQ,UAAU,EAAqBA,EAAQ,QAAQ,GAAG,CAAC,CAAC,EAGjF,OAFoBC,GAAS,IAAMA,EAAQ,GAGhC,IAAIP,EAAoB,CAAC,QAAS,CAAC,IAAAK,CAAG,CAAC,CAAC,EAGxC,IAAIJ,EAAkB,CAAC,QAAS,CAAC,IAAAI,CAAG,CAAC,CAAC,EAAE,QAAQH,EAAa,SAAS,CAAC,CAGtF,CACO,IAAMM,EAAoBC,GAA0C,CACvE,IAAMC,EAAUD,GAAY,WAAW,MACjCJ,EAAM,IAAIF,EACVQ,EAAaP,EAAYC,CAAG,EAClC,MAAO,OAAOO,EAA0BC,IAA0B,CAC9D,IAAMC,EAAwB,CAAC,GAAGD,EAAS,WAAAF,CAAU,EACrD,OAAO,MAAMD,EAAQE,EAAOE,CAAqB,CACrD,CACJ,EACaC,EAAY,OAEzB,eAAsBC,EAAOC,EAA+BC,EAAgB,CACxE,OAAY,SAAO,CAAC,GAAGD,EAAK,MAAOT,EAAiBS,EAAI,KAAK,CAAC,EAAGC,CAAM,CAC3E",
6
+ "names": ["rest", "CookieAgentUndiciV6", "CookieAgentUndici", "interceptors", "CookieJar", "cookieAgent", "jar", "version", "major", "fetchWithCookies", "existing", "fetchFn", "dispatcher", "input", "request", "requestWithDispatcher", "name", "create", "cfg", "logger"]
7
7
  }