@suveren/gateway 0.20.1 → 0.21.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.
Files changed (27) hide show
  1. package/content/integrations/erp.json +1 -1
  2. package/dist/mcp-server/http.mjs +152 -11
  3. package/dist/ui/assets/index-BBjT8ue7.js +116 -0
  4. package/dist/ui/assets/{index-blnpvM2g.css → index-D5hgQ_8Z.css} +1 -1
  5. package/dist/ui/index.html +2 -2
  6. package/node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition/README.md +105 -35
  7. package/node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition/dist/index.d.ts +72 -0
  8. package/node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition/dist/index.js +388 -0
  9. package/node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition/dist/index.js.map +1 -0
  10. package/node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition/package.json +31 -19
  11. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/Readme.md +15 -9
  12. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/lib/application.js +2 -2
  13. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/lib/request.js +32 -19
  14. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/lib/response.js +27 -30
  15. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/content-type/LICENSE +22 -0
  16. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/content-type/README.md +71 -0
  17. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/content-type/dist/index.d.ts +46 -0
  18. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/content-type/dist/index.js +176 -0
  19. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/content-type/dist/index.js.map +1 -0
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/content-type/package.json +52 -0
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/express/package.json +10 -10
  22. package/node_modules/@types/node/README.md +1 -1
  23. package/node_modules/@types/node/package.json +2 -2
  24. package/node_modules/@types/node/util.d.ts +6 -3
  25. package/package.json +1 -1
  26. package/dist/ui/assets/index-1s1q-XLL.js +0 -116
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition/index.js +0 -536
@@ -1,536 +0,0 @@
1
- /*!
2
- * content-disposition
3
- * Copyright(c) 2014-2017 Douglas Christopher Wilson
4
- * MIT Licensed
5
- */
6
-
7
- 'use strict'
8
-
9
- /**
10
- * Module exports.
11
- * @public
12
- */
13
-
14
- module.exports = contentDisposition
15
- module.exports.parse = parse
16
-
17
- /**
18
- * TextDecoder instance for UTF-8 decoding when decodeURIComponent fails due to invalid byte sequences.
19
- * @type {TextDecoder}
20
- * @private
21
- */
22
- const utf8Decoder = new TextDecoder('utf-8')
23
-
24
- /**
25
- * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%")
26
- * @private
27
- */
28
-
29
- var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex
30
-
31
- /**
32
- * RegExp to match non-latin1 characters.
33
- * @private
34
- */
35
-
36
- var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g
37
-
38
- /**
39
- * RegExp to match quoted-pair in RFC 2616
40
- *
41
- * quoted-pair = "\" CHAR
42
- * CHAR = <any US-ASCII character (octets 0 - 127)>
43
- * @private
44
- */
45
-
46
- var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex
47
-
48
- /**
49
- * RegExp to match chars that must be quoted-pair in RFC 2616
50
- * @private
51
- */
52
-
53
- var QUOTE_REGEXP = /([\\"])/g
54
-
55
- /**
56
- * RegExp for various RFC 2616 grammar
57
- *
58
- * parameter = token "=" ( token | quoted-string )
59
- * token = 1*<any CHAR except CTLs or separators>
60
- * separators = "(" | ")" | "<" | ">" | "@"
61
- * | "," | ";" | ":" | "\" | <">
62
- * | "/" | "[" | "]" | "?" | "="
63
- * | "{" | "}" | SP | HT
64
- * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
65
- * qdtext = <any TEXT except <">>
66
- * quoted-pair = "\" CHAR
67
- * CHAR = <any US-ASCII character (octets 0 - 127)>
68
- * TEXT = <any OCTET except CTLs, but including LWS>
69
- * LWS = [CRLF] 1*( SP | HT )
70
- * CRLF = CR LF
71
- * CR = <US-ASCII CR, carriage return (13)>
72
- * LF = <US-ASCII LF, linefeed (10)>
73
- * SP = <US-ASCII SP, space (32)>
74
- * HT = <US-ASCII HT, horizontal-tab (9)>
75
- * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
76
- * OCTET = <any 8-bit sequence of data>
77
- * @private
78
- */
79
-
80
- var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex
81
- var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/
82
- var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/
83
-
84
- /**
85
- * RegExp for various RFC 5987 grammar
86
- *
87
- * ext-value = charset "'" [ language ] "'" value-chars
88
- * charset = "UTF-8" / "ISO-8859-1" / mime-charset
89
- * mime-charset = 1*mime-charsetc
90
- * mime-charsetc = ALPHA / DIGIT
91
- * / "!" / "#" / "$" / "%" / "&"
92
- * / "+" / "-" / "^" / "_" / "`"
93
- * / "{" / "}" / "~"
94
- * language = ( 2*3ALPHA [ extlang ] )
95
- * / 4ALPHA
96
- * / 5*8ALPHA
97
- * extlang = *3( "-" 3ALPHA )
98
- * value-chars = *( pct-encoded / attr-char )
99
- * pct-encoded = "%" HEXDIG HEXDIG
100
- * attr-char = ALPHA / DIGIT
101
- * / "!" / "#" / "$" / "&" / "+" / "-" / "."
102
- * / "^" / "_" / "`" / "|" / "~"
103
- * @private
104
- */
105
-
106
- var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/
107
-
108
- /**
109
- * RegExp for various RFC 6266 grammar
110
- *
111
- * disposition-type = "inline" | "attachment" | disp-ext-type
112
- * disp-ext-type = token
113
- * disposition-parm = filename-parm | disp-ext-parm
114
- * filename-parm = "filename" "=" value
115
- * | "filename*" "=" ext-value
116
- * disp-ext-parm = token "=" value
117
- * | ext-token "=" ext-value
118
- * ext-token = <the characters in token, followed by "*">
119
- * @private
120
- */
121
-
122
- var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex
123
-
124
- /**
125
- * Create an attachment Content-Disposition header.
126
- *
127
- * @param {string} [filename]
128
- * @param {object} [options]
129
- * @param {string} [options.type=attachment]
130
- * @param {string|boolean} [options.fallback=true]
131
- * @return {string}
132
- * @public
133
- */
134
-
135
- function contentDisposition (filename, options) {
136
- var opts = options || {}
137
-
138
- // get type
139
- var type = opts.type || 'attachment'
140
-
141
- // get parameters
142
- var params = createparams(filename, opts.fallback)
143
-
144
- // format into string
145
- return format(new ContentDisposition(type, params))
146
- }
147
-
148
- /**
149
- * Create parameters object from filename and fallback.
150
- *
151
- * @param {string} [filename]
152
- * @param {string|boolean} [fallback=true]
153
- * @return {object}
154
- * @private
155
- */
156
-
157
- function createparams (filename, fallback) {
158
- if (filename === undefined) {
159
- return
160
- }
161
-
162
- var params = {}
163
-
164
- if (typeof filename !== 'string') {
165
- throw new TypeError('filename must be a string')
166
- }
167
-
168
- // fallback defaults to true
169
- if (fallback === undefined) {
170
- fallback = true
171
- }
172
-
173
- if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {
174
- throw new TypeError('fallback must be a string or boolean')
175
- }
176
-
177
- if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {
178
- throw new TypeError('fallback must be ISO-8859-1 string')
179
- }
180
-
181
- // restrict to file base name
182
- var name = basename(filename)
183
-
184
- // determine if name is suitable for quoted string
185
- var isQuotedString = TEXT_REGEXP.test(name)
186
-
187
- // generate fallback name
188
- var fallbackName = typeof fallback !== 'string'
189
- ? fallback && getlatin1(name)
190
- : basename(fallback)
191
- var hasFallback = typeof fallbackName === 'string' && fallbackName !== name
192
-
193
- // set extended filename parameter
194
- if (hasFallback || !isQuotedString || hasHexEscape(name)) {
195
- params['filename*'] = name
196
- }
197
-
198
- // set filename parameter
199
- if (isQuotedString || hasFallback) {
200
- params.filename = hasFallback
201
- ? fallbackName
202
- : name
203
- }
204
-
205
- return params
206
- }
207
-
208
- /**
209
- * Format object to Content-Disposition header.
210
- *
211
- * @param {object} obj
212
- * @param {string} obj.type
213
- * @param {object} [obj.parameters]
214
- * @return {string}
215
- * @private
216
- */
217
-
218
- function format (obj) {
219
- var parameters = obj.parameters
220
- var type = obj.type
221
-
222
- if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {
223
- throw new TypeError('invalid type')
224
- }
225
-
226
- // start with normalized type
227
- var string = String(type).toLowerCase()
228
-
229
- // append parameters
230
- if (parameters && typeof parameters === 'object') {
231
- var param
232
- var params = Object.keys(parameters).sort()
233
-
234
- for (var i = 0; i < params.length; i++) {
235
- param = params[i]
236
-
237
- var val = param.slice(-1) === '*'
238
- ? ustring(parameters[param])
239
- : qstring(parameters[param])
240
-
241
- string += '; ' + param + '=' + val
242
- }
243
- }
244
-
245
- return string
246
- }
247
-
248
- /**
249
- * Decode a RFC 5987 field value (gracefully).
250
- *
251
- * @param {string} str
252
- * @return {string}
253
- * @private
254
- */
255
-
256
- function decodefield (str) {
257
- const match = EXT_VALUE_REGEXP.exec(str)
258
-
259
- if (!match) {
260
- throw new TypeError('invalid extended field value')
261
- }
262
-
263
- const charset = match[1].toLowerCase()
264
- const encoded = match[2]
265
-
266
- switch (charset) {
267
- case 'iso-8859-1':
268
- {
269
- const binary = decodeHexEscapes(encoded)
270
- return getlatin1(binary)
271
- }
272
- case 'utf-8':
273
- case 'utf8':
274
- {
275
- try {
276
- return decodeURIComponent(encoded)
277
- } catch {
278
- // Failed to decode with decodeURIComponent, fallback to lenient decoding which replaces invalid UTF-8 byte sequences with the Unicode replacement character
279
- // TODO: Consider removing in the next major version to be more strict about invalid percent-encodings
280
- const binary = decodeHexEscapes(encoded)
281
-
282
- const bytes = new Uint8Array(binary.length)
283
- for (let idx = 0; idx < binary.length; idx++) {
284
- bytes[idx] = binary.charCodeAt(idx)
285
- }
286
-
287
- return utf8Decoder.decode(bytes)
288
- }
289
- }
290
- }
291
- throw new TypeError('unsupported charset in extended field')
292
- }
293
-
294
- /**
295
- * Get ISO-8859-1 version of string.
296
- *
297
- * @param {string} val
298
- * @return {string}
299
- * @private
300
- */
301
-
302
- function getlatin1 (val) {
303
- // simple Unicode -> ISO-8859-1 transformation
304
- return String(val).replace(NON_LATIN1_REGEXP, '?')
305
- }
306
-
307
- /**
308
- * Parse Content-Disposition header string.
309
- *
310
- * @param {string} string
311
- * @return {object}
312
- * @public
313
- */
314
-
315
- function parse (string) {
316
- if (!string || typeof string !== 'string') {
317
- throw new TypeError('argument string is required')
318
- }
319
-
320
- var match = DISPOSITION_TYPE_REGEXP.exec(string)
321
-
322
- if (!match) {
323
- throw new TypeError('invalid type format')
324
- }
325
-
326
- // normalize type
327
- var index = match[0].length
328
- var type = match[1].toLowerCase()
329
-
330
- var key
331
- var names = []
332
- var params = {}
333
- var value
334
-
335
- // calculate index to start at
336
- index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';'
337
- ? index - 1
338
- : index
339
-
340
- // match parameters
341
- while ((match = PARAM_REGEXP.exec(string))) {
342
- if (match.index !== index) {
343
- throw new TypeError('invalid parameter format')
344
- }
345
-
346
- index += match[0].length
347
- key = match[1].toLowerCase()
348
- value = match[2]
349
-
350
- if (names.indexOf(key) !== -1) {
351
- throw new TypeError('invalid duplicate parameter')
352
- }
353
-
354
- names.push(key)
355
-
356
- if (key.indexOf('*') + 1 === key.length) {
357
- // decode extended value
358
- key = key.slice(0, -1)
359
- value = decodefield(value)
360
-
361
- // overwrite existing value
362
- params[key] = value
363
- continue
364
- }
365
-
366
- if (typeof params[key] === 'string') {
367
- continue
368
- }
369
-
370
- if (value[0] === '"') {
371
- // remove quotes and escapes
372
- value = value
373
- .slice(1, -1)
374
- .replace(QESC_REGEXP, '$1')
375
- }
376
-
377
- params[key] = value
378
- }
379
-
380
- if (index !== -1 && index !== string.length) {
381
- throw new TypeError('invalid parameter format')
382
- }
383
-
384
- return new ContentDisposition(type, params)
385
- }
386
-
387
- /**
388
- * Percent encode a single character.
389
- *
390
- * @param {string} char
391
- * @return {string}
392
- * @private
393
- */
394
-
395
- function pencode (char) {
396
- return '%' + String(char)
397
- .charCodeAt(0)
398
- .toString(16)
399
- .toUpperCase()
400
- }
401
-
402
- /**
403
- * Quote a string for HTTP.
404
- *
405
- * @param {string} val
406
- * @return {string}
407
- * @private
408
- */
409
-
410
- function qstring (val) {
411
- var str = String(val)
412
-
413
- return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
414
- }
415
-
416
- /**
417
- * Encode a Unicode string for HTTP (RFC 5987).
418
- *
419
- * @param {string} val
420
- * @return {string}
421
- * @private
422
- */
423
-
424
- function ustring (val) {
425
- var str = String(val)
426
-
427
- // percent encode as UTF-8
428
- var encoded = encodeURIComponent(str)
429
- .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)
430
-
431
- return 'UTF-8\'\'' + encoded
432
- }
433
-
434
- /**
435
- * Class for parsed Content-Disposition header for v8 optimization
436
- *
437
- * @public
438
- * @param {string} type
439
- * @param {object} parameters
440
- * @constructor
441
- */
442
-
443
- function ContentDisposition (type, parameters) {
444
- this.type = type
445
- this.parameters = parameters
446
- }
447
-
448
- /**
449
- * Return the last portion of a path
450
- *
451
- * @param {string} path
452
- * @returns {string}
453
- */
454
- function basename (path) {
455
- const normalized = path.replaceAll('\\', '/')
456
-
457
- let end = normalized.length
458
- while (end > 0 && normalized[end - 1] === '/') {
459
- end--
460
- }
461
-
462
- if (end === 0) {
463
- return ''
464
- }
465
-
466
- let start = end - 1
467
- while (start >= 0 && normalized[start] !== '/') {
468
- start--
469
- }
470
-
471
- return normalized.slice(start + 1, end)
472
- }
473
-
474
- /**
475
- * Check if a character is a hex digit [0-9A-Fa-f]
476
- *
477
- * @param {string} char
478
- * @return {boolean}
479
- * @private
480
- */
481
- function isHexDigit (char) {
482
- const code = char.charCodeAt(0)
483
- return (
484
- (code >= 48 && code <= 57) || // 0-9
485
- (code >= 65 && code <= 70) || // A-F
486
- (code >= 97 && code <= 102) // a-f
487
- )
488
- }
489
-
490
- /**
491
- * Check if a string contains percent encoding escapes.
492
- *
493
- * @param {string} str
494
- * @return {boolean}
495
- * @private
496
- */
497
- function hasHexEscape (str) {
498
- const maxIndex = str.length - 3
499
- let lastIndex = -1
500
-
501
- while ((lastIndex = str.indexOf('%', lastIndex + 1)) !== -1 && lastIndex <= maxIndex) {
502
- if (isHexDigit(str[lastIndex + 1]) && isHexDigit(str[lastIndex + 2])) {
503
- return true
504
- }
505
- }
506
-
507
- return false
508
- }
509
-
510
- /**
511
- * Decode hex escapes in a string (e.g., %20 -> space)
512
- *
513
- * @param {string} str
514
- * @return {string}
515
- * @private
516
- */
517
- function decodeHexEscapes (str) {
518
- const firstEscape = str.indexOf('%')
519
- if (firstEscape === -1) return str
520
-
521
- let result = str.slice(0, firstEscape)
522
- for (let idx = firstEscape; idx < str.length; idx++) {
523
- if (
524
- str[idx] === '%' &&
525
- idx + 2 < str.length &&
526
- isHexDigit(str[idx + 1]) &&
527
- isHexDigit(str[idx + 2])
528
- ) {
529
- result += String.fromCharCode(Number.parseInt(str[idx + 1] + str[idx + 2], 16))
530
- idx += 2
531
- } else {
532
- result += str[idx]
533
- }
534
- }
535
- return result
536
- }