@cdk8s/awscdk-resolver 0.0.543 → 0.0.545

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 (110) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/package.json +14 -14
  4. package/node_modules/@aws-sdk/core/package.json +5 -5
  5. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  12. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  13. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +5 -5
  14. package/node_modules/@aws-sdk/middleware-user-agent/package.json +4 -4
  15. package/node_modules/@aws-sdk/nested-clients/package.json +14 -14
  16. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  17. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  18. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  19. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +0 -2
  20. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +0 -2
  21. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  22. package/node_modules/@nodable/entities/README.md +41 -0
  23. package/node_modules/@nodable/entities/package.json +54 -0
  24. package/node_modules/@nodable/entities/src/EntityDecoder.js +543 -0
  25. package/node_modules/@nodable/entities/src/EntityEncoder.js +194 -0
  26. package/node_modules/@nodable/entities/src/entities.js +1177 -0
  27. package/node_modules/@nodable/entities/src/entityTries.js +49 -0
  28. package/node_modules/@nodable/entities/src/index.d.ts +264 -0
  29. package/node_modules/@nodable/entities/src/index.js +29 -0
  30. package/node_modules/@smithy/core/package.json +2 -2
  31. package/node_modules/@smithy/middleware-endpoint/package.json +3 -3
  32. package/node_modules/@smithy/middleware-retry/package.json +4 -4
  33. package/node_modules/@smithy/middleware-serde/package.json +2 -2
  34. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +27 -16
  35. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +5 -0
  36. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +22 -16
  37. package/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +4 -0
  38. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +2 -4
  39. package/node_modules/@smithy/node-http-handler/package.json +1 -1
  40. package/node_modules/@smithy/smithy-client/package.json +4 -4
  41. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  42. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  43. package/node_modules/@smithy/util-retry/dist-cjs/index.js +20 -10
  44. package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +20 -10
  45. package/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +12 -4
  46. package/node_modules/@smithy/util-retry/package.json +1 -1
  47. package/node_modules/@smithy/util-stream/package.json +2 -2
  48. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/CHANGELOG.md +53 -0
  49. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/README.md +8 -28
  50. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  51. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  52. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  53. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxp.d.cts +172 -6
  54. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  55. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  56. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  57. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  58. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/package.json +5 -4
  59. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/fxp.d.ts +162 -3
  60. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/DocTypeReader.js +2 -5
  61. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/OptionsBuilder.js +15 -11
  62. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/OrderedObjParser.js +168 -244
  63. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/XMLParser.js +1 -1
  64. package/package.json +6 -6
  65. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js +0 -2
  66. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +0 -1
  67. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
  68. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
  69. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
  70. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
  71. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
  72. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/pem.d.cts +0 -148
  73. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/pem.d.ts +0 -135
  74. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/LICENSE +0 -0
  75. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxvalidator.min.js +0 -0
  76. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxvalidator.min.js.map +0 -0
  77. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/cli.js +0 -0
  78. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/man.js +0 -0
  79. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/read.js +0 -0
  80. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/fxp.js +0 -0
  81. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/ignoreAttributes.js +0 -0
  82. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/util.js +0 -0
  83. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/CharsSymbol.js +0 -0
  84. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/EntitiesParser.js +0 -0
  85. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OptionsBuilder.js +0 -0
  86. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -0
  87. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsArrBuilder.js +0 -0
  88. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -0
  89. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsObjBuilder.js +0 -0
  90. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -0
  91. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/Report.js +0 -0
  92. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/TagPath.js +0 -0
  93. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/TagPathMatcher.js +0 -0
  94. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XMLParser.js +0 -0
  95. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/Xml2JsParser.js +0 -0
  96. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XmlPartReader.js +0 -0
  97. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XmlSpecialTagsReader.js +0 -0
  98. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/inputSource/BufferSource.js +0 -0
  99. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/inputSource/StringSource.js +0 -0
  100. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/EntitiesParser.js +0 -0
  101. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/booleanParser.js +0 -0
  102. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/booleanParserExt.js +0 -0
  103. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/currency.js +0 -0
  104. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/join.js +0 -0
  105. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/number.js +0 -0
  106. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/trim.js +0 -0
  107. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/validator.js +0 -0
  108. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlbuilder/json2xml.js +0 -0
  109. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/node2json.js +0 -0
  110. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/xmlNode.js +0 -0
@@ -0,0 +1,49 @@
1
+ // entityTries.js
2
+ // Builds integer-keyed tries so the decoder never allocates a string object
3
+ // during lookup — every key is a plain charCode number.
4
+ //
5
+ // trie1: Map<code0, entity>
6
+ // trie2: Map<code0, Map<code1, entity>>
7
+ // trie3: Map<code0, Map<code1, Map<code2, entity>>>
8
+
9
+ import { ALL_ENTITIES } from './entities.js';
10
+
11
+ // Reverse map: character sequence → "&name;"
12
+ const CHAR_TO_ENTITY = new Map();
13
+ for (const [name, chars] of Object.entries(ALL_ENTITIES)) {
14
+ CHAR_TO_ENTITY.set(chars, `&${name};`);
15
+ }
16
+
17
+ export const trie1 = new Map(); // code0 → entity string
18
+ export const trie2 = new Map(); // code0 → Map → entity string
19
+ export const trie3 = new Map(); // code0 → Map → Map → entity string
20
+
21
+ for (const [chars, entity] of CHAR_TO_ENTITY) {
22
+ const len = chars.length;
23
+
24
+ if (len === 1) {
25
+ const c0 = chars.charCodeAt(0);
26
+ // Keep shortest match only if no longer match already claimed this code
27
+ // (longer matches are inserted in the same pass so we just overwrite —
28
+ // trie1 is only consulted after trie2/trie3 both miss, so no conflict)
29
+ trie1.set(c0, entity);
30
+
31
+ } else if (len === 2) {
32
+ const c0 = chars.charCodeAt(0);
33
+ const c1 = chars.charCodeAt(1);
34
+ let inner = trie2.get(c0);
35
+ if (inner === undefined) { inner = new Map(); trie2.set(c0, inner); }
36
+ inner.set(c1, entity);
37
+
38
+ } else if (len === 3) {
39
+ const c0 = chars.charCodeAt(0);
40
+ const c1 = chars.charCodeAt(1);
41
+ const c2 = chars.charCodeAt(2);
42
+ let mid = trie3.get(c0);
43
+ if (mid === undefined) { mid = new Map(); trie3.set(c0, mid); }
44
+ let inner = mid.get(c1);
45
+ if (inner === undefined) { inner = new Map(); mid.set(c1, inner); }
46
+ inner.set(c2, entity);
47
+ }
48
+ // HTML5 has no named entity whose character sequence is longer than 3 chars
49
+ }
@@ -0,0 +1,264 @@
1
+ // ---------------------------------------------------------------------------
2
+ // @nodable/entities — TypeScript declarations
3
+ // ---------------------------------------------------------------------------
4
+
5
+ /** A function-based entity replacement value (used for numeric refs). */
6
+ export type EntityValFn = (match: string, captured: string, ...rest: unknown[]) => string;
7
+
8
+ // ---------------------------------------------------------------------------
9
+ // Encoder options
10
+ // ---------------------------------------------------------------------------
11
+
12
+ export interface EntityEncoderOptions {
13
+ /**
14
+ * Whether to encode XML unsafe characters: `&`, `<`, `>`, `"`, `'`.
15
+ * @default true
16
+ */
17
+ encodeXmlSafe?: boolean;
18
+
19
+ /**
20
+ * Whether to encode non‑ASCII characters (e.g. `é` → `&eacute;`) using the
21
+ * built‑in named entity trie.
22
+ * @default true
23
+ */
24
+ encodeAllNamed?: boolean;
25
+
26
+ /**
27
+ * Maximum number of replacements performed **cumulatively** across all
28
+ * `encode()` calls. `0` means unlimited.
29
+ *
30
+ * Use `reset()` to reset the internal counter.
31
+ * @default 0
32
+ */
33
+ maxReplacements?: number;
34
+ }
35
+
36
+ // ---------------------------------------------------------------------------
37
+ // EntityEncoder class
38
+ // ---------------------------------------------------------------------------
39
+
40
+ /**
41
+ * High‑performance encoder that replaces characters with XML/HTML entities.
42
+ *
43
+ * - Escapes XML unsafe characters (`&`, `<`, `>`, `"`, `'`) when `encodeXmlSafe` is true.
44
+ * - Replaces non‑ASCII characters (e.g. `é`, `©`) with named entities using
45
+ * a compact trie‑based lookup when `encodeAllNamed` is true.
46
+ * - Supports a cumulative replacement limit (`maxReplacements`) that persists
47
+ * across multiple `encode()` calls until `reset()` is called.
48
+ *
49
+ * @example
50
+ * const encoder = new EntityEncoder({ encodeXmlSafe: true, encodeAllNamed: true });
51
+ * encoder.encode('<foo>'); // "&lt;foo&gt;"
52
+ * encoder.encode('© 2025'); // "&copy; 2025"
53
+ *
54
+ * // With limit
55
+ * const limited = new EntityEncoder({ maxReplacements: 2 });
56
+ * limited.encode('<>&'); // "&lt;&gt;&" (third replacement omitted)
57
+ * limited.reset(); // reset counter
58
+ */
59
+ export class EntityEncoder {
60
+ constructor(options?: EntityEncoderOptions);
61
+
62
+ /**
63
+ * Encode a string by replacing XML‑unsafe characters and (optionally)
64
+ * non‑ASCII characters with named entities.
65
+ *
66
+ * If `maxReplacements` is set and the cumulative limit has been reached,
67
+ * the input string is returned unchanged.
68
+ *
69
+ * @returns Encoded string (may be identical to input if no replacements needed
70
+ * or the limit has been exhausted).
71
+ */
72
+ encode(str: string): string;
73
+
74
+ /**
75
+ * Reset the internal replacement counter.
76
+ * Does **not** change `encodeXmlSafe`, `encodeAllNamed`, or `maxReplacements`.
77
+ */
78
+ reset(): void;
79
+ }
80
+
81
+ // ---------------------------------------------------------------------------
82
+ // Constructor options for EntityDecoder (existing)
83
+ // ---------------------------------------------------------------------------
84
+
85
+ /**
86
+ * Controls which entity categories count toward the expansion limits.
87
+ *
88
+ * - `'external'` — only untrusted / injected entities (default)
89
+ * - `'base'` — only built‑in XML entities + user‑supplied `namedEntities`
90
+ * - `'all'` — all entities regardless of tier
91
+ * - `string[]` — explicit combination, e.g. `['external', 'base']`
92
+ */
93
+ export type ApplyLimitsTo = 'external' | 'base' | 'all' | Array<'external' | 'base'>;
94
+
95
+ export interface EntityDecoderLimitOptions {
96
+ /**
97
+ * Maximum number of entity references expanded **per document**.
98
+ * `0` means unlimited.
99
+ * @default 0
100
+ */
101
+ maxTotalExpansions?: number;
102
+
103
+ /**
104
+ * Maximum number of characters **added** by entity expansion per document.
105
+ * `0` means unlimited.
106
+ * @default 0
107
+ */
108
+ maxExpandedLength?: number;
109
+
110
+ /**
111
+ * Which entity tiers count toward the expansion limits.
112
+ *
113
+ * - `'external'` (default) – only input/runtime + persistent external entities
114
+ * - `'base'` – only built‑in XML + `namedEntities`
115
+ * - `'all'` – every entity regardless of tier
116
+ * - `string[]` – explicit combination, e.g. `['external', 'base']`
117
+ *
118
+ * @default 'external'
119
+ */
120
+ applyLimitsTo?: ApplyLimitsTo;
121
+ }
122
+
123
+ export interface EntityDecoderNCROptions {
124
+ /**
125
+ * XML version used for NCR classification.
126
+ * @default 1.0
127
+ */
128
+ xmlVersion?: 1.0 | 1.1;
129
+
130
+ /**
131
+ * Base action for all numeric references.
132
+ * @default 'allow'
133
+ */
134
+ onNCR?: 'allow' | 'leave' | 'remove' | 'throw';
135
+
136
+ /**
137
+ * Action for null NCR (U+0000).
138
+ * @default 'remove'
139
+ */
140
+ nullNCR?: 'remove' | 'throw';
141
+ }
142
+
143
+ export interface EntityDecoderOptions {
144
+ /**
145
+ * Extra named entities merged into the **base map** (trusted, counts as `'base'` tier).
146
+ * These are combined with the built‑in XML entities (`lt`, `gt`, `quot`, `apos`).
147
+ * Values containing `&` are silently skipped to prevent recursive expansion.
148
+ *
149
+ * @default null
150
+ */
151
+ namedEntities?: Record<string, string | { regex: RegExp; val: string | EntityValFn }> | null;
152
+
153
+
154
+ /**
155
+ * Hook called once on the fully decoded string (after all replacements).
156
+ *
157
+ * - Receives `(resolved, original)` and **must return a string**.
158
+ * - To reject expansion, return `original`.
159
+ * - To sanitize, return a cleaned version of `resolved`.
160
+ *
161
+ * @example
162
+ * postCheck: (resolved, original) =>
163
+ * /<[a-z]/i.test(resolved) ? original : resolved
164
+ */
165
+ postCheck?: ((resolved: string, original: string) => string) | null;
166
+
167
+ /**
168
+ * Whether numeric character references (`&#NNN;`, `&#xHH;`) are allowed.
169
+ * @default true
170
+ */
171
+ numericAllowed?: boolean;
172
+
173
+ /**
174
+ * Array of entity names or numeric references to leave unexpanded.
175
+ * @default []
176
+ */
177
+ leave?: string[];
178
+
179
+ /**
180
+ * Array of entity names or numeric references to remove.
181
+ * @default []
182
+ */
183
+ remove?: string[];
184
+
185
+ /**
186
+ * Security limits for entity expansion.
187
+ */
188
+ limit?: EntityDecoderLimitOptions;
189
+
190
+ /**
191
+ * Numeric Character Reference (NCR) policy.
192
+ */
193
+ ncr?: EntityDecoderNCROptions;
194
+ }
195
+
196
+ // ---------------------------------------------------------------------------
197
+ // EntityDecoder class (default export)
198
+ // ---------------------------------------------------------------------------
199
+
200
+ /**
201
+ * Single‑pass, zero‑regex entity decoder for XML/HTML content.
202
+ *
203
+ * ## Entity lookup priority (highest → lowest)
204
+ * 1. **input / runtime** – injected via `addInputEntities()` (DOCTYPE per document)
205
+ * 2. **persistent external** – set via `setExternalEntities()` / `addExternalEntity()`
206
+ * 3. **base map** – built‑in XML entities + user‑supplied `namedEntities`
207
+ *
208
+ * Numeric references (`&#NNN;`, `&#xHH;`) are resolved directly and count as the `'base'` tier.
209
+ *
210
+ * @example
211
+ * const decoder = new EntityDecoder({
212
+ * namedEntities: COMMON_HTML,
213
+ * maxTotalExpansions: 100
214
+ * });
215
+ * decoder.setExternalEntities({ brand: 'Acme' });
216
+ *
217
+ * decoder.addInputEntities({ version: '1.0' });
218
+ * decoder.decode('&brand; v&version; &lt;'); // 'Acme v1.0 <'
219
+ *
220
+ * decoder.reset(); // clears input entities + counters, keeps external entities
221
+ */
222
+ export default class EntityDecoder {
223
+ constructor(options?: EntityDecoderOptions);
224
+
225
+ setExternalEntities(
226
+ map: Record<string, string | { regex: RegExp; val: string | EntityValFn }>
227
+ ): void;
228
+
229
+ addExternalEntity(key: string, value: string): void;
230
+
231
+ addInputEntities(
232
+ map: Record<
233
+ string,
234
+ | string
235
+ | { regx: RegExp; val: string | EntityValFn }
236
+ | { regex: RegExp; val: string | EntityValFn }
237
+ >
238
+ ): void;
239
+
240
+ reset(): this;
241
+
242
+ decode(str: string): string;
243
+ }
244
+
245
+ // ---------------------------------------------------------------------------
246
+ // Named entity group exports (for use with `namedEntities` option)
247
+ // ---------------------------------------------------------------------------
248
+
249
+ export const COMMON_HTML: Record<string, string>;
250
+ export const ALL_ENTITIES: Record<string, string>;
251
+ export const XML: Record<string, string>;
252
+ export const BASIC_LATIN: Record<string, string>;
253
+ export const LATIN_ACCENTS: Record<string, string>;
254
+ export const LATIN_EXTENDED: Record<string, string>;
255
+ export const GREEK: Record<string, string>;
256
+ export const CYRILLIC: Record<string, string>;
257
+ export const MATH: Record<string, string>;
258
+ export const MATH_ADVANCED: Record<string, string>;
259
+ export const ARROWS: Record<string, string>;
260
+ export const SHAPES: Record<string, string>;
261
+ export const PUNCTUATION: Record<string, string>;
262
+ export const CURRENCY: Record<string, string>;
263
+ export const FRACTIONS: Record<string, string>;
264
+ export const MISC_SYMBOLS: Record<string, string>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @nodable/entities
3
+ *
4
+ * Standalone, zero-dependency XML/HTML entity replacement.
5
+ *
6
+
7
+ */
8
+
9
+ export { default as EntityDecoder } from './EntityDecoder.js';
10
+ export {
11
+ COMMON_HTML,
12
+ XML,
13
+ ALL_ENTITIES,
14
+ ARROWS,
15
+ BASIC_LATIN,
16
+ CURRENCY,
17
+ MATH,
18
+ MATH_ADVANCED,
19
+ CYRILLIC,
20
+ FRACTIONS,
21
+ GREEK,
22
+ LATIN_ACCENTS,
23
+ LATIN_EXTENDED,
24
+ MISC_SYMBOLS,
25
+ PUNCTUATION,
26
+ SHAPES,
27
+ } from './entities.js';
28
+
29
+ export { default as EntityEncoder } from './EntityEncoder.js';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.23.16",
3
+ "version": "3.23.17",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline core",
@@ -91,7 +91,7 @@
91
91
  "@smithy/util-base64": "^4.3.2",
92
92
  "@smithy/util-body-length-browser": "^4.2.2",
93
93
  "@smithy/util-middleware": "^4.2.14",
94
- "@smithy/util-stream": "^4.5.24",
94
+ "@smithy/util-stream": "^4.5.25",
95
95
  "@smithy/util-utf8": "^4.2.2",
96
96
  "@smithy/uuid": "^1.1.2",
97
97
  "tslib": "^2.6.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-endpoint",
3
- "version": "4.4.31",
3
+ "version": "4.4.32",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-endpoint",
@@ -24,8 +24,8 @@
24
24
  "license": "Apache-2.0",
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
- "@smithy/core": "^3.23.16",
28
- "@smithy/middleware-serde": "^4.2.19",
27
+ "@smithy/core": "^3.23.17",
28
+ "@smithy/middleware-serde": "^4.2.20",
29
29
  "@smithy/node-config-provider": "^4.3.14",
30
30
  "@smithy/shared-ini-file-loader": "^4.4.9",
31
31
  "@smithy/types": "^4.14.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-retry",
3
- "version": "4.5.4",
3
+ "version": "4.5.5",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-retry",
@@ -33,14 +33,14 @@
33
33
  "license": "Apache-2.0",
34
34
  "sideEffects": false,
35
35
  "dependencies": {
36
- "@smithy/core": "^3.23.16",
36
+ "@smithy/core": "^3.23.17",
37
37
  "@smithy/node-config-provider": "^4.3.14",
38
38
  "@smithy/protocol-http": "^5.3.14",
39
39
  "@smithy/service-error-classification": "^4.3.0",
40
- "@smithy/smithy-client": "^4.12.12",
40
+ "@smithy/smithy-client": "^4.12.13",
41
41
  "@smithy/types": "^4.14.1",
42
42
  "@smithy/util-middleware": "^4.2.14",
43
- "@smithy/util-retry": "^4.3.3",
43
+ "@smithy/util-retry": "^4.3.4",
44
44
  "@smithy/uuid": "^1.1.2",
45
45
  "tslib": "^2.6.2"
46
46
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-serde",
3
- "version": "4.2.19",
3
+ "version": "4.2.20",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-serde",
@@ -25,7 +25,7 @@
25
25
  "license": "Apache-2.0",
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@smithy/core": "^3.23.16",
28
+ "@smithy/core": "^3.23.17",
29
29
  "@smithy/protocol-http": "^5.3.14",
30
30
  "@smithy/types": "^4.14.1",
31
31
  "tslib": "^2.6.2"
@@ -460,6 +460,11 @@ class ClientHttp2SessionRef {
460
460
  deref() {
461
461
  return this.session;
462
462
  }
463
+ close() {
464
+ if (!this.session.closed) {
465
+ this.session.close();
466
+ }
467
+ }
463
468
  destroy() {
464
469
  this.refs = 0;
465
470
  if (!this.session.destroyed) {
@@ -548,16 +553,18 @@ class NodeHttp2ConnectionManager {
548
553
  }
549
554
  });
550
555
  }
551
- const destroySessionCb = () => {
552
- session.destroy();
553
- this.removeFromPool(url, ref);
556
+ const graceful = () => {
557
+ this.removeFromPoolAndClose(url, ref);
558
+ };
559
+ const ensureDestroyed = () => {
560
+ this.removeFromPoolAndCheckedDestroy(url, ref);
554
561
  };
555
- session.on("goaway", destroySessionCb);
556
- session.on("error", destroySessionCb);
557
- session.on("frameError", destroySessionCb);
558
- session.on("close", () => this.removeFromPool(url, ref));
562
+ session.on("goaway", graceful);
563
+ session.on("error", ensureDestroyed);
564
+ session.on("frameError", ensureDestroyed);
565
+ session.on("close", ensureDestroyed);
559
566
  if (connectionConfiguration.requestTimeout) {
560
- session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb);
567
+ session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);
561
568
  }
562
569
  pool.offerLast(ref);
563
570
  ref.retain();
@@ -571,15 +578,14 @@ class NodeHttp2ConnectionManager {
571
578
  const ref = new ClientHttp2SessionRef(http2.connect(url));
572
579
  const session = ref.deref();
573
580
  session.settings({ maxConcurrentStreams: 1 });
574
- const destroySession = () => {
575
- session.destroy();
581
+ const ensureDestroyed = () => {
582
+ ref.destroy();
576
583
  };
577
- session.on("goaway", destroySession);
578
- session.on("error", destroySession);
579
- session.on("frameError", destroySession);
580
- session.on("close", destroySession);
584
+ session.on("error", ensureDestroyed);
585
+ session.on("frameError", ensureDestroyed);
586
+ session.on("close", ensureDestroyed);
581
587
  if (connectionConfiguration.requestTimeout) {
582
- session.setTimeout(connectionConfiguration.requestTimeout, destroySession);
588
+ session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);
583
589
  }
584
590
  ref.retain();
585
591
  return ref;
@@ -620,8 +626,13 @@ class NodeHttp2ConnectionManager {
620
626
  }
621
627
  return pools;
622
628
  }
623
- removeFromPool(authority, ref) {
629
+ removeFromPoolAndClose(authority, ref) {
624
630
  this.connectionPools.get(authority)?.remove(ref);
631
+ ref.close();
632
+ }
633
+ removeFromPoolAndCheckedDestroy(authority, ref) {
634
+ this.connectionPools.get(authority)?.remove(ref);
635
+ ref.destroy();
625
636
  }
626
637
  getPool(url) {
627
638
  if (!this.connectionPools.has(url)) {
@@ -33,6 +33,11 @@ export class ClientHttp2SessionRef {
33
33
  deref() {
34
34
  return this.session;
35
35
  }
36
+ close() {
37
+ if (!this.session.closed) {
38
+ this.session.close();
39
+ }
40
+ }
36
41
  destroy() {
37
42
  this.refs = 0;
38
43
  if (!this.session.destroyed) {
@@ -32,16 +32,18 @@ export class NodeHttp2ConnectionManager {
32
32
  }
33
33
  });
34
34
  }
35
- const destroySessionCb = () => {
36
- session.destroy();
37
- this.removeFromPool(url, ref);
35
+ const graceful = () => {
36
+ this.removeFromPoolAndClose(url, ref);
38
37
  };
39
- session.on("goaway", destroySessionCb);
40
- session.on("error", destroySessionCb);
41
- session.on("frameError", destroySessionCb);
42
- session.on("close", () => this.removeFromPool(url, ref));
38
+ const ensureDestroyed = () => {
39
+ this.removeFromPoolAndCheckedDestroy(url, ref);
40
+ };
41
+ session.on("goaway", graceful);
42
+ session.on("error", ensureDestroyed);
43
+ session.on("frameError", ensureDestroyed);
44
+ session.on("close", ensureDestroyed);
43
45
  if (connectionConfiguration.requestTimeout) {
44
- session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb);
46
+ session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);
45
47
  }
46
48
  pool.offerLast(ref);
47
49
  ref.retain();
@@ -55,15 +57,14 @@ export class NodeHttp2ConnectionManager {
55
57
  const ref = new ClientHttp2SessionRef(http2.connect(url));
56
58
  const session = ref.deref();
57
59
  session.settings({ maxConcurrentStreams: 1 });
58
- const destroySession = () => {
59
- session.destroy();
60
+ const ensureDestroyed = () => {
61
+ ref.destroy();
60
62
  };
61
- session.on("goaway", destroySession);
62
- session.on("error", destroySession);
63
- session.on("frameError", destroySession);
64
- session.on("close", destroySession);
63
+ session.on("error", ensureDestroyed);
64
+ session.on("frameError", ensureDestroyed);
65
+ session.on("close", ensureDestroyed);
65
66
  if (connectionConfiguration.requestTimeout) {
66
- session.setTimeout(connectionConfiguration.requestTimeout, destroySession);
67
+ session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);
67
68
  }
68
69
  ref.retain();
69
70
  return ref;
@@ -104,8 +105,13 @@ export class NodeHttp2ConnectionManager {
104
105
  }
105
106
  return pools;
106
107
  }
107
- removeFromPool(authority, ref) {
108
+ removeFromPoolAndClose(authority, ref) {
109
+ this.connectionPools.get(authority)?.remove(ref);
110
+ ref.close();
111
+ }
112
+ removeFromPoolAndCheckedDestroy(authority, ref) {
108
113
  this.connectionPools.get(authority)?.remove(ref);
114
+ ref.destroy();
109
115
  }
110
116
  getPool(url) {
111
117
  if (!this.connectionPools.has(url)) {
@@ -34,6 +34,10 @@ export declare class ClientHttp2SessionRef {
34
34
  * Access the session (don't call ref/unref on it).
35
35
  */
36
36
  deref(): ClientHttp2Session;
37
+ /**
38
+ * Allow open refs to free on their own.
39
+ */
40
+ close(): void;
37
41
  destroy(): void;
38
42
  /**
39
43
  * @returns the current number of active references (in-flight requests).
@@ -35,10 +35,8 @@ export declare class NodeHttp2ConnectionManager implements ConnectionManager<Cli
35
35
  * @returns a snapshot of the state of all connection pools and their sessions.
36
36
  */
37
37
  debug(): Record<string, any>;
38
- /**
39
- * Remove a session from the pools. Does not destroy it.
40
- */
41
- private removeFromPool;
38
+ private removeFromPoolAndClose;
39
+ private removeFromPoolAndCheckedDestroy;
42
40
  private getPool;
43
41
  private getUrlString;
44
42
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.6.0",
3
+ "version": "4.6.1",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/smithy-client",
3
- "version": "4.12.12",
3
+ "version": "4.12.13",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline smithy-client",
@@ -26,12 +26,12 @@
26
26
  "license": "Apache-2.0",
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@smithy/core": "^3.23.16",
30
- "@smithy/middleware-endpoint": "^4.4.31",
29
+ "@smithy/core": "^3.23.17",
30
+ "@smithy/middleware-endpoint": "^4.4.32",
31
31
  "@smithy/middleware-stack": "^4.2.14",
32
32
  "@smithy/protocol-http": "^5.3.14",
33
33
  "@smithy/types": "^4.14.1",
34
- "@smithy/util-stream": "^4.5.24",
34
+ "@smithy/util-stream": "^4.5.25",
35
35
  "tslib": "^2.6.2"
36
36
  },
37
37
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-browser",
3
- "version": "4.3.48",
3
+ "version": "4.3.49",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline util-defaults-mode-browser",
@@ -24,7 +24,7 @@
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
26
  "@smithy/property-provider": "^4.2.14",
27
- "@smithy/smithy-client": "^4.12.12",
27
+ "@smithy/smithy-client": "^4.12.13",
28
28
  "@smithy/types": "^4.14.1",
29
29
  "tslib": "^2.6.2"
30
30
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-node",
3
- "version": "4.2.53",
3
+ "version": "4.2.54",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline util-defaults-mode-node",
@@ -27,7 +27,7 @@
27
27
  "@smithy/credential-provider-imds": "^4.2.14",
28
28
  "@smithy/node-config-provider": "^4.3.14",
29
29
  "@smithy/property-provider": "^4.2.14",
30
- "@smithy/smithy-client": "^4.12.12",
30
+ "@smithy/smithy-client": "^4.12.13",
31
31
  "@smithy/types": "^4.14.1",
32
32
  "tslib": "^2.6.2"
33
33
  },