@graphql-hive/gateway 2.15.2 → 2.15.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @graphql-hive/gateway
2
2
 
3
+ ## 2.15.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [[`9b859cd`](https://github.com/graphql-hive/gateway/commit/9b859cd1104c1a64b641f6bd05c66459fbacbba6), [`9b859cd`](https://github.com/graphql-hive/gateway/commit/9b859cd1104c1a64b641f6bd05c66459fbacbba6)]:
7
+ - @graphql-hive/gateway-runtime@2.12.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3
8
+ - @graphql-hive/plugin-opentelemetry@1.5.5-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3
9
+ - @graphql-mesh/plugin-prometheus@2.2.5-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3
10
+
3
11
  ## 2.15.2
4
12
  ### Patch Changes
5
13
 
package/dist/bin.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var module$1 = require('node:module');
4
4
  var logger = require('@graphql-hive/logger');
5
- var cli = require('./cli-CTufJWlH.cjs');
5
+ var cli = require('./cli-BKMdn2g_.cjs');
6
6
  require('node:cluster');
7
7
  require('node:os');
8
8
  require('node:path');
@@ -32,7 +32,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
32
32
 
33
33
  var module__default = /*#__PURE__*/_interopDefault(module$1);
34
34
 
35
- globalThis.__VERSION__ = '2.15.2';
35
+ globalThis.__VERSION__ = '2.15.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3';
36
36
  module__default.default.register("@graphql-hive/importer/hooks", {
37
37
  parentURL: (
38
38
  // @ts-ignore bob will complain when bundling for cjs
package/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import module$1 from 'node:module';
3
3
  import { Logger } from '@graphql-hive/logger';
4
- import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-BXK_jkgF.js';
4
+ import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, r as run } from './cli-D0Q7lz6l.js';
5
5
  import 'node:cluster';
6
6
  import 'node:os';
7
7
  import 'node:path';
@@ -26,7 +26,7 @@ import '@graphql-tools/code-file-loader';
26
26
  import '@graphql-tools/graphql-file-loader';
27
27
  import '@graphql-tools/load';
28
28
 
29
- globalThis.__VERSION__ = '2.15.2';
29
+ globalThis.__VERSION__ = '2.15.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3';
30
30
  module$1.register("@graphql-hive/importer/hooks", {
31
31
  parentURL: (
32
32
  // @ts-ignore bob will complain when bundling for cjs
@@ -80,10 +80,25 @@ unit.group = ',';
80
80
  unit.decimal = '.';
81
81
  unit.placeholder = ' _';
82
82
 
83
- const durationRE = /((?:\d{1,16}(?:\.\d{1,16})?|\.\d{1,16})(?:[eE][-+]?\d{1,4})?)\s?([\p{L}]{0,14})/gu;
83
+ const durationRE = /((?:\d+(?:\.\d+)?|\.\d+)(?:[eE][-+]?\d+)?)\s*([\p{L}]{0,14})/gu;
84
84
 
85
85
  parse.unit = unit;
86
86
 
87
+ // group/placeholder cleanup regex — rebuilt only when the locale strings change
88
+ let groupRE, placeholder = null, group;
89
+
90
+ /**
91
+ * look up a unit name, ignoring case and a trailing plural `s`
92
+ *
93
+ * @param {object} unit
94
+ * @param {string} name
95
+ * @return {number|undefined}
96
+ */
97
+ const lookupUnit = (unit, name) => {
98
+ name = String(name).toLowerCase();
99
+ return unit[name] ?? (name.endsWith('s') ? unit[name.slice(0, -1)] : undefined)
100
+ };
101
+
87
102
  /**
88
103
  * convert `str` to ms
89
104
  *
@@ -92,28 +107,33 @@ parse.unit = unit;
92
107
  * @return {number|null}
93
108
  */
94
109
  function parse(str = '', format = 'ms') {
95
- let result = null, prevUnits;
110
+ let result = null, prevUnits, unit = parse.unit;
111
+
112
+ if (unit.placeholder !== placeholder || unit.group !== group)
113
+ groupRE = new RegExp(`(\\d)[${(placeholder = unit.placeholder) ?? ''}${(group = unit.group) ?? ''}](\\d)`, 'g');
114
+
115
+ str = String(str);
116
+ let s = str.replace(groupRE, '$1$2'); // clean up group separators / placeholders
117
+ if (unit.decimal !== '.') s = s.replaceAll(unit.decimal, '.'); // normalize decimal separator
96
118
 
97
- String(str)
98
- .replace(new RegExp(`(\\d)[${parse.unit.placeholder}${parse.unit.group}](\\d)`, 'g'), '$1$2') // clean up group separators / placeholders
99
- .replace(parse.unit.decimal, '.') // normalize decimal separator
100
- .replace(durationRE, (_, n, units) => {
119
+ durationRE.lastIndex = 0;
120
+ for (let m; (m = durationRE.exec(s));) {
121
+ let units = m[2];
101
122
  // if no units, find next smallest units or fall back to format value
102
123
  // eg. 1h30 -> 1h30m
103
124
  if (!units) {
104
125
  if (prevUnits) {
105
- for (const u in parse.unit) if (parse.unit[u] < prevUnits) { units = u; break }
126
+ for (const u in unit) if (unit[u] < prevUnits) { units = u; break }
106
127
  }
107
128
  else units = format;
108
129
  }
109
- else units = units.toLowerCase();
110
130
 
111
- prevUnits = units = parse.unit[units] || parse.unit[units.replace(/s$/, '')];
131
+ prevUnits = units = lookupUnit(unit, units);
112
132
 
113
- if (units) result = (result || 0) + n * units;
114
- });
133
+ if (typeof units == 'number') result = (result || 0) + m[1] * units;
134
+ }
115
135
 
116
- return result && ((result / (parse.unit[format] || 1)) * (str[0] === '-' ? -1 : 1))
136
+ return result && ((result / (lookupUnit(unit, format) || 1)) * (str.trimStart()[0] === '-' ? -1 : 1))
117
137
  }
118
138
 
119
139
  class RateLimitingStore extends rateLimiter.Store {
@@ -73,10 +73,25 @@ unit.group = ',';
73
73
  unit.decimal = '.';
74
74
  unit.placeholder = ' _';
75
75
 
76
- const durationRE = /((?:\d{1,16}(?:\.\d{1,16})?|\.\d{1,16})(?:[eE][-+]?\d{1,4})?)\s?([\p{L}]{0,14})/gu;
76
+ const durationRE = /((?:\d+(?:\.\d+)?|\.\d+)(?:[eE][-+]?\d+)?)\s*([\p{L}]{0,14})/gu;
77
77
 
78
78
  parse.unit = unit;
79
79
 
80
+ // group/placeholder cleanup regex — rebuilt only when the locale strings change
81
+ let groupRE, placeholder = null, group;
82
+
83
+ /**
84
+ * look up a unit name, ignoring case and a trailing plural `s`
85
+ *
86
+ * @param {object} unit
87
+ * @param {string} name
88
+ * @return {number|undefined}
89
+ */
90
+ const lookupUnit = (unit, name) => {
91
+ name = String(name).toLowerCase();
92
+ return unit[name] ?? (name.endsWith('s') ? unit[name.slice(0, -1)] : undefined)
93
+ };
94
+
80
95
  /**
81
96
  * convert `str` to ms
82
97
  *
@@ -85,28 +100,33 @@ parse.unit = unit;
85
100
  * @return {number|null}
86
101
  */
87
102
  function parse(str = '', format = 'ms') {
88
- let result = null, prevUnits;
103
+ let result = null, prevUnits, unit = parse.unit;
104
+
105
+ if (unit.placeholder !== placeholder || unit.group !== group)
106
+ groupRE = new RegExp(`(\\d)[${(placeholder = unit.placeholder) ?? ''}${(group = unit.group) ?? ''}](\\d)`, 'g');
107
+
108
+ str = String(str);
109
+ let s = str.replace(groupRE, '$1$2'); // clean up group separators / placeholders
110
+ if (unit.decimal !== '.') s = s.replaceAll(unit.decimal, '.'); // normalize decimal separator
89
111
 
90
- String(str)
91
- .replace(new RegExp(`(\\d)[${parse.unit.placeholder}${parse.unit.group}](\\d)`, 'g'), '$1$2') // clean up group separators / placeholders
92
- .replace(parse.unit.decimal, '.') // normalize decimal separator
93
- .replace(durationRE, (_, n, units) => {
112
+ durationRE.lastIndex = 0;
113
+ for (let m; (m = durationRE.exec(s));) {
114
+ let units = m[2];
94
115
  // if no units, find next smallest units or fall back to format value
95
116
  // eg. 1h30 -> 1h30m
96
117
  if (!units) {
97
118
  if (prevUnits) {
98
- for (const u in parse.unit) if (parse.unit[u] < prevUnits) { units = u; break }
119
+ for (const u in unit) if (unit[u] < prevUnits) { units = u; break }
99
120
  }
100
121
  else units = format;
101
122
  }
102
- else units = units.toLowerCase();
103
123
 
104
- prevUnits = units = parse.unit[units] || parse.unit[units.replace(/s$/, '')];
124
+ prevUnits = units = lookupUnit(unit, units);
105
125
 
106
- if (units) result = (result || 0) + n * units;
107
- });
126
+ if (typeof units == 'number') result = (result || 0) + m[1] * units;
127
+ }
108
128
 
109
- return result && ((result / (parse.unit[format] || 1)) * (str[0] === '-' ? -1 : 1))
129
+ return result && ((result / (lookupUnit(unit, format) || 1)) * (str.trimStart()[0] === '-' ? -1 : 1))
110
130
  }
111
131
 
112
132
  class RateLimitingStore extends Store {
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var cli = require('./cli-CTufJWlH.cjs');
3
+ var cli = require('./cli-BKMdn2g_.cjs');
4
4
  var logger = require('@graphql-hive/logger');
5
5
  var gatewayRuntime = require('@graphql-hive/gateway-runtime');
6
6
  var pubsub = require('@graphql-hive/pubsub');
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { d as defaultOptions, a as defineConfig, e as enableModuleCachingIfPossible, g as getBuiltinPluginsFromConfig, b as getCacheInstanceFromConfig, h as handleNodeWarnings, r as run, u as useRateLimiting } from './cli-BXK_jkgF.js';
1
+ export { d as defaultOptions, a as defineConfig, e as enableModuleCachingIfPossible, g as getBuiltinPluginsFromConfig, b as getCacheInstanceFromConfig, h as handleNodeWarnings, r as run, u as useRateLimiting } from './cli-D0Q7lz6l.js';
2
2
  export * from '@graphql-hive/logger';
3
3
  export * from '@graphql-hive/gateway-runtime';
4
4
  export * from '@graphql-hive/pubsub';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-hive/gateway",
3
- "version": "2.15.2",
3
+ "version": "2.15.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -95,11 +95,11 @@
95
95
  "@escape.tech/graphql-armor-block-field-suggestions": "^3.0.0",
96
96
  "@escape.tech/graphql-armor-max-depth": "^2.4.2",
97
97
  "@escape.tech/graphql-armor-max-tokens": "^2.5.0",
98
- "@graphql-hive/gateway-runtime": "^2.12.2",
98
+ "@graphql-hive/gateway-runtime": "2.12.3-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3",
99
99
  "@graphql-hive/importer": "^2.0.0",
100
100
  "@graphql-hive/logger": "^1.1.1",
101
101
  "@graphql-hive/plugin-aws-sigv4": "^2.0.69",
102
- "@graphql-hive/plugin-opentelemetry": "^1.5.4",
102
+ "@graphql-hive/plugin-opentelemetry": "1.5.5-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3",
103
103
  "@graphql-hive/pubsub": "^2.2.1",
104
104
  "@graphql-hive/render-laboratory": "^0.1.16",
105
105
  "@graphql-hive/signal": "^2.0.0",
@@ -112,7 +112,7 @@
112
112
  "@graphql-mesh/plugin-http-cache": "^0.108.1",
113
113
  "@graphql-mesh/plugin-jit": "^0.5.1",
114
114
  "@graphql-mesh/plugin-jwt-auth": "^2.0.14",
115
- "@graphql-mesh/plugin-prometheus": "^2.2.4",
115
+ "@graphql-mesh/plugin-prometheus": "2.2.5-alpha-e7813462292f3341dad18042e66ab5cae2e6fef3",
116
116
  "@graphql-mesh/plugin-snapshot": "^0.107.1",
117
117
  "@graphql-mesh/string-interpolation": "^0.5.18",
118
118
  "@graphql-mesh/transport-http": "^1.2.1",
@@ -163,7 +163,7 @@
163
163
  "bun": "^1.3.2",
164
164
  "graphql": "^16.12.0",
165
165
  "parse-duration": "^2.0.0",
166
- "pkgroll": "2.27.1",
166
+ "pkgroll": "2.28.1",
167
167
  "postject": "^1.0.0-alpha.6",
168
168
  "rimraf": "^6.1.0",
169
169
  "rollup": "4.60.3",