@orion-js/echoes 4.0.0-alpha.3 → 4.0.0-next.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.
package/dist/index.cjs CHANGED
@@ -18380,50 +18380,64 @@ var require_common = __commonJS((exports2, module2) => {
18380
18380
  createDebug.namespaces = namespaces;
18381
18381
  createDebug.names = [];
18382
18382
  createDebug.skips = [];
18383
- let i2;
18384
- const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
18385
- const len = split.length;
18386
- for (i2 = 0;i2 < len; i2++) {
18387
- if (!split[i2]) {
18388
- continue;
18383
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
18384
+ for (const ns of split) {
18385
+ if (ns[0] === "-") {
18386
+ createDebug.skips.push(ns.slice(1));
18387
+ } else {
18388
+ createDebug.names.push(ns);
18389
18389
  }
18390
- namespaces = split[i2].replace(/\*/g, ".*?");
18391
- if (namespaces[0] === "-") {
18392
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
18390
+ }
18391
+ }
18392
+ function matchesTemplate(search, template) {
18393
+ let searchIndex = 0;
18394
+ let templateIndex = 0;
18395
+ let starIndex = -1;
18396
+ let matchIndex = 0;
18397
+ while (searchIndex < search.length) {
18398
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
18399
+ if (template[templateIndex] === "*") {
18400
+ starIndex = templateIndex;
18401
+ matchIndex = searchIndex;
18402
+ templateIndex++;
18403
+ } else {
18404
+ searchIndex++;
18405
+ templateIndex++;
18406
+ }
18407
+ } else if (starIndex !== -1) {
18408
+ templateIndex = starIndex + 1;
18409
+ matchIndex++;
18410
+ searchIndex = matchIndex;
18393
18411
  } else {
18394
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
18412
+ return false;
18395
18413
  }
18396
18414
  }
18415
+ while (templateIndex < template.length && template[templateIndex] === "*") {
18416
+ templateIndex++;
18417
+ }
18418
+ return templateIndex === template.length;
18397
18419
  }
18398
18420
  function disable() {
18399
18421
  const namespaces = [
18400
- ...createDebug.names.map(toNamespace),
18401
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
18422
+ ...createDebug.names,
18423
+ ...createDebug.skips.map((namespace) => "-" + namespace)
18402
18424
  ].join(",");
18403
18425
  createDebug.enable("");
18404
18426
  return namespaces;
18405
18427
  }
18406
18428
  function enabled(name) {
18407
- if (name[name.length - 1] === "*") {
18408
- return true;
18409
- }
18410
- let i2;
18411
- let len;
18412
- for (i2 = 0, len = createDebug.skips.length;i2 < len; i2++) {
18413
- if (createDebug.skips[i2].test(name)) {
18429
+ for (const skip of createDebug.skips) {
18430
+ if (matchesTemplate(name, skip)) {
18414
18431
  return false;
18415
18432
  }
18416
18433
  }
18417
- for (i2 = 0, len = createDebug.names.length;i2 < len; i2++) {
18418
- if (createDebug.names[i2].test(name)) {
18434
+ for (const ns of createDebug.names) {
18435
+ if (matchesTemplate(name, ns)) {
18419
18436
  return true;
18420
18437
  }
18421
18438
  }
18422
18439
  return false;
18423
18440
  }
18424
- function toNamespace(regexp) {
18425
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
18426
- }
18427
18441
  function coerce(val) {
18428
18442
  if (val instanceof Error) {
18429
18443
  return val.stack || val.message;
@@ -18540,7 +18554,8 @@ var require_browser5 = __commonJS((exports2, module2) => {
18540
18554
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
18541
18555
  return false;
18542
18556
  }
18543
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
18557
+ let m2;
18558
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
18544
18559
  }
18545
18560
  function formatArgs(args2) {
18546
18561
  args2[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args2[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
@@ -18851,7 +18866,7 @@ var require_node5 = __commonJS((exports2, module2) => {
18851
18866
  return new Date().toISOString() + " ";
18852
18867
  }
18853
18868
  function log2(...args2) {
18854
- return process.stderr.write(util.format(...args2) + `
18869
+ return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args2) + `
18855
18870
  `);
18856
18871
  }
18857
18872
  function save(namespaces) {
@@ -20904,7 +20919,7 @@ class ht {
20904
20919
  }
20905
20920
  }
20906
20921
 
20907
- // ../env/dist/index.js
20922
+ // node_modules/@orion-js/env/dist/index.js
20908
20923
  var import_node_module = require("node:module");
20909
20924
  var import_node_fs = __toESM(require("node:fs"));
20910
20925
  var __create2 = Object.create;
@@ -30220,7 +30235,7 @@ function checkSignature_default(body, signature) {
30220
30235
  }
30221
30236
  }
30222
30237
 
30223
- // ../http/dist/index.js
30238
+ // node_modules/@orion-js/http/dist/index.js
30224
30239
  var import_node_module2 = require("node:module");
30225
30240
  var import_crypto = __toESM(require("crypto"));
30226
30241
  var import_node_module3 = require("node:module");
@@ -67889,6 +67904,7 @@ function registerRoutes(routesMap) {
67889
67904
  }
67890
67905
  }
67891
67906
  var import_body_parser = __toESM3(require_body_parser(), 1);
67907
+ var import_express3 = __toESM3(require_express2(), 1);
67892
67908
  var __create4 = Object.create;
67893
67909
  var __getProtoOf4 = Object.getPrototypeOf;
67894
67910
  var __defProp4 = Object.defineProperty;
@@ -69183,6 +69199,8 @@ function getServiceRoutes(target) {
69183
69199
  }
69184
69200
  var bodyParser2 = { json: import_body_parser.json, raw: import_body_parser.raw, text: import_body_parser.text, urlencoded: import_body_parser.urlencoded };
69185
69201
  var export_express = import_express2.default;
69202
+ var export_Response = import_express3.Response;
69203
+ var export_Request = import_express3.Request;
69186
69204
 
69187
69205
  // src/requestsHandler/index.ts
69188
69206
  var requestsHandler_default = (options) => route({
@@ -69452,7 +69470,7 @@ function getURL_default(serviceName) {
69452
69470
  // src/request/makeRequest.ts
69453
69471
  var import_axios = __toESM(require_axios2());
69454
69472
 
69455
- // ../helpers/dist/index.js
69473
+ // node_modules/@orion-js/helpers/dist/index.js
69456
69474
  var import_node_module5 = require("node:module");
69457
69475
  var __create5 = Object.create;
69458
69476
  var __getProtoOf5 = Object.getPrototypeOf;
@@ -70208,7 +70226,7 @@ var makeRequest = async (options) => {
70208
70226
  };
70209
70227
  };
70210
70228
 
70211
- // ../schema/dist/index.js
70229
+ // node_modules/@orion-js/schema/dist/index.js
70212
70230
  var __create7 = Object.create;
70213
70231
  var __getProtoOf7 = Object.getPrototypeOf;
70214
70232
  var __defProp7 = Object.defineProperty;
@@ -72967,7 +72985,7 @@ async function request(options) {
72967
72985
  throw new Error(`Echoes request network error calling ${service}/${method}: ${error.message}`);
72968
72986
  }
72969
72987
  }
72970
- // ../services/dist/index.js
72988
+ // node_modules/@orion-js/services/dist/index.js
72971
72989
  var __create8 = Object.create;
72972
72990
  var __getProtoOf8 = Object.getPrototypeOf;
72973
72991
  var __defProp8 = Object.defineProperty;
package/dist/index.js CHANGED
@@ -18353,50 +18353,64 @@ var require_common = __commonJS((exports2, module2) => {
18353
18353
  createDebug.namespaces = namespaces;
18354
18354
  createDebug.names = [];
18355
18355
  createDebug.skips = [];
18356
- let i2;
18357
- const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
18358
- const len = split.length;
18359
- for (i2 = 0;i2 < len; i2++) {
18360
- if (!split[i2]) {
18361
- continue;
18356
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
18357
+ for (const ns of split) {
18358
+ if (ns[0] === "-") {
18359
+ createDebug.skips.push(ns.slice(1));
18360
+ } else {
18361
+ createDebug.names.push(ns);
18362
18362
  }
18363
- namespaces = split[i2].replace(/\*/g, ".*?");
18364
- if (namespaces[0] === "-") {
18365
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
18363
+ }
18364
+ }
18365
+ function matchesTemplate(search, template) {
18366
+ let searchIndex = 0;
18367
+ let templateIndex = 0;
18368
+ let starIndex = -1;
18369
+ let matchIndex = 0;
18370
+ while (searchIndex < search.length) {
18371
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
18372
+ if (template[templateIndex] === "*") {
18373
+ starIndex = templateIndex;
18374
+ matchIndex = searchIndex;
18375
+ templateIndex++;
18376
+ } else {
18377
+ searchIndex++;
18378
+ templateIndex++;
18379
+ }
18380
+ } else if (starIndex !== -1) {
18381
+ templateIndex = starIndex + 1;
18382
+ matchIndex++;
18383
+ searchIndex = matchIndex;
18366
18384
  } else {
18367
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
18385
+ return false;
18368
18386
  }
18369
18387
  }
18388
+ while (templateIndex < template.length && template[templateIndex] === "*") {
18389
+ templateIndex++;
18390
+ }
18391
+ return templateIndex === template.length;
18370
18392
  }
18371
18393
  function disable() {
18372
18394
  const namespaces = [
18373
- ...createDebug.names.map(toNamespace),
18374
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
18395
+ ...createDebug.names,
18396
+ ...createDebug.skips.map((namespace) => "-" + namespace)
18375
18397
  ].join(",");
18376
18398
  createDebug.enable("");
18377
18399
  return namespaces;
18378
18400
  }
18379
18401
  function enabled(name) {
18380
- if (name[name.length - 1] === "*") {
18381
- return true;
18382
- }
18383
- let i2;
18384
- let len;
18385
- for (i2 = 0, len = createDebug.skips.length;i2 < len; i2++) {
18386
- if (createDebug.skips[i2].test(name)) {
18402
+ for (const skip of createDebug.skips) {
18403
+ if (matchesTemplate(name, skip)) {
18387
18404
  return false;
18388
18405
  }
18389
18406
  }
18390
- for (i2 = 0, len = createDebug.names.length;i2 < len; i2++) {
18391
- if (createDebug.names[i2].test(name)) {
18407
+ for (const ns of createDebug.names) {
18408
+ if (matchesTemplate(name, ns)) {
18392
18409
  return true;
18393
18410
  }
18394
18411
  }
18395
18412
  return false;
18396
18413
  }
18397
- function toNamespace(regexp) {
18398
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
18399
- }
18400
18414
  function coerce(val) {
18401
18415
  if (val instanceof Error) {
18402
18416
  return val.stack || val.message;
@@ -18513,7 +18527,8 @@ var require_browser5 = __commonJS((exports2, module2) => {
18513
18527
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
18514
18528
  return false;
18515
18529
  }
18516
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
18530
+ let m2;
18531
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
18517
18532
  }
18518
18533
  function formatArgs(args2) {
18519
18534
  args2[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args2[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
@@ -18824,7 +18839,7 @@ var require_node5 = __commonJS((exports2, module2) => {
18824
18839
  return new Date().toISOString() + " ";
18825
18840
  }
18826
18841
  function log2(...args2) {
18827
- return process.stderr.write(util.format(...args2) + `
18842
+ return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args2) + `
18828
18843
  `);
18829
18844
  }
18830
18845
  function save(namespaces) {
@@ -20857,7 +20872,7 @@ class ht {
20857
20872
  }
20858
20873
  }
20859
20874
 
20860
- // ../env/dist/index.js
20875
+ // node_modules/@orion-js/env/dist/index.js
20861
20876
  import { createRequire as createRequire2 } from "node:module";
20862
20877
  import fs from "node:fs";
20863
20878
  var __create2 = Object.create;
@@ -30173,7 +30188,7 @@ function checkSignature_default(body, signature) {
30173
30188
  }
30174
30189
  }
30175
30190
 
30176
- // ../http/dist/index.js
30191
+ // node_modules/@orion-js/http/dist/index.js
30177
30192
  import { createRequire as createRequire3 } from "node:module";
30178
30193
  import crypto2 from "crypto";
30179
30194
  import { createRequire as createRequire22 } from "node:module";
@@ -67842,6 +67857,7 @@ function registerRoutes(routesMap) {
67842
67857
  }
67843
67858
  }
67844
67859
  var import_body_parser = __toESM3(require_body_parser(), 1);
67860
+ var import_express3 = __toESM3(require_express2(), 1);
67845
67861
  var __create4 = Object.create;
67846
67862
  var __getProtoOf4 = Object.getPrototypeOf;
67847
67863
  var __defProp4 = Object.defineProperty;
@@ -69136,6 +69152,8 @@ function getServiceRoutes(target) {
69136
69152
  }
69137
69153
  var bodyParser2 = { json: import_body_parser.json, raw: import_body_parser.raw, text: import_body_parser.text, urlencoded: import_body_parser.urlencoded };
69138
69154
  var export_express = import_express2.default;
69155
+ var export_Response = import_express3.Response;
69156
+ var export_Request = import_express3.Request;
69139
69157
 
69140
69158
  // src/requestsHandler/index.ts
69141
69159
  var requestsHandler_default = (options) => route({
@@ -69405,7 +69423,7 @@ function getURL_default(serviceName) {
69405
69423
  // src/request/makeRequest.ts
69406
69424
  var import_axios = __toESM(require_axios(), 1);
69407
69425
 
69408
- // ../helpers/dist/index.js
69426
+ // node_modules/@orion-js/helpers/dist/index.js
69409
69427
  import { createRequire as createRequire4 } from "node:module";
69410
69428
  var __create5 = Object.create;
69411
69429
  var __getProtoOf5 = Object.getPrototypeOf;
@@ -70161,7 +70179,7 @@ var makeRequest = async (options) => {
70161
70179
  };
70162
70180
  };
70163
70181
 
70164
- // ../schema/dist/index.js
70182
+ // node_modules/@orion-js/schema/dist/index.js
70165
70183
  var __create7 = Object.create;
70166
70184
  var __getProtoOf7 = Object.getPrototypeOf;
70167
70185
  var __defProp7 = Object.defineProperty;
@@ -72920,7 +72938,7 @@ async function request(options) {
72920
72938
  throw new Error(`Echoes request network error calling ${service}/${method}: ${error.message}`);
72921
72939
  }
72922
72940
  }
72923
- // ../services/dist/index.js
72941
+ // node_modules/@orion-js/services/dist/index.js
72924
72942
  var __create8 = Object.create;
72925
72943
  var __getProtoOf8 = Object.getPrototypeOf;
72926
72944
  var __defProp8 = Object.defineProperty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/echoes",
3
- "version": "4.0.0-alpha.3",
3
+ "version": "4.0.0-next.0",
4
4
  "main": "./dist/index.cjs",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -18,11 +18,11 @@
18
18
  "dev": "bun --watch src/index.ts"
19
19
  },
20
20
  "dependencies": {
21
- "@orion-js/env": "^4.0.0-alpha.2",
22
- "@orion-js/helpers": "^4.0.0-alpha.2",
23
- "@orion-js/http": "^4.0.0-alpha.2",
24
- "@orion-js/schema": "^4.0.0-alpha.2",
25
- "@orion-js/services": "^4.0.0-alpha.2",
21
+ "@orion-js/env": "^4.0.0-next.0",
22
+ "@orion-js/helpers": "^4.0.0-next.0",
23
+ "@orion-js/http": "^4.0.0-next.0",
24
+ "@orion-js/schema": "^4.0.0-next.0",
25
+ "@orion-js/services": "^4.0.0-next.0",
26
26
  "axios": "^0.24.0",
27
27
  "jssha": "^3.2.0",
28
28
  "kafkajs": "^2.2.4",