@btc-embedded/cdk-extensions 0.23.3 → 0.23.5
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/.jsii +41 -41
- package/CHANGELOG.md +14 -0
- package/assets/cli/catnip.js +154 -166
- package/lib/constructs/EventPipe.js +1 -1
- package/lib/constructs/ExportedService.js +1 -1
- package/lib/constructs/S3Bucket.js +1 -1
- package/lib/constructs/SecureRestApi.js +1 -1
- package/lib/constructs/SecureRestApiV2.js +1 -1
- package/lib/constructs/api-keys/ApiKeyClientAuthorization.js +1 -1
- package/lib/constructs/api-keys/ApiKeyManagement.js +1 -1
- package/lib/constructs/api-keys/ApiKeyPreTokenHandler.js +1 -1
- package/lib/constructs/api-keys/ApiKeyStore.js +1 -1
- package/lib/extensions/ApiGatewayExtension.js +1 -1
- package/lib/extensions/ApplicationContainer.js +1 -1
- package/lib/extensions/ApplicationLoadBalancerExtension.js +1 -1
- package/lib/extensions/ApplicationLoadBalancerExtensionV2.js +1 -1
- package/lib/extensions/CloudMapExtension.js +1 -1
- package/lib/extensions/DeactivatableServiceExtension.js +1 -1
- package/lib/extensions/DeploymentConfigExtension.js +1 -1
- package/lib/extensions/DocumentDbAccessExtension.js +1 -1
- package/lib/extensions/DomainEventMessagingExtension.js +1 -1
- package/lib/extensions/EfsMountExtension.js +1 -1
- package/lib/extensions/ExtraContainerExtension.js +1 -1
- package/lib/extensions/HTTPApiExtension.js +1 -1
- package/lib/extensions/LogExtension.js +1 -1
- package/lib/extensions/ModifyContainerDefinitionExtension.js +1 -1
- package/lib/extensions/ModifyTaskDefinitionExtension.js +1 -1
- package/lib/extensions/OpenIdExtension.js +1 -1
- package/lib/extensions/OpenTelemetryExtension.js +1 -1
- package/lib/extensions/PostgresDbAccessExtension.js +1 -1
- package/lib/extensions/SharedVolumeExtension.js +1 -1
- package/lib/extensions/TcpKeepAliveExtension.js +1 -1
- package/lib/platform/ApiGateway.js +1 -1
- package/lib/platform/ApiGatewayVpcLink.js +2 -2
- package/lib/platform/ApplicationLoadBalancer.js +1 -1
- package/lib/platform/ApplicationLoadBalancerV2.d.ts +1 -0
- package/lib/platform/ApplicationLoadBalancerV2.js +10 -3
- package/lib/platform/AuroraPostgresDB.js +5 -4
- package/lib/platform/BTCLogGroup.js +1 -1
- package/lib/platform/CognitoUserPool.js +2 -2
- package/lib/platform/DefaultUserPoolClients.js +1 -1
- package/lib/platform/DocumentDB.js +2 -2
- package/lib/platform/EcsCluster.js +1 -1
- package/lib/platform/EfsFileSystem.js +1 -1
- package/lib/platform/HostedZone.js +1 -1
- package/lib/platform/PrivateDnsNamespace.js +1 -1
- package/lib/platform/ResourceServer.js +1 -1
- package/lib/platform/Vpc.js +1 -1
- package/lib/platform/VpcV2.js +1 -1
- package/lib/stacks/ApplicationStack.js +1 -1
- package/lib/utils/BasePlatformStackResolver.js +1 -1
- package/lib/utils/StackParameter.js +1 -1
- package/node_modules/@nodable/entities/README.md +41 -0
- package/node_modules/@nodable/entities/package.json +54 -0
- package/node_modules/@nodable/entities/src/EntityDecoder.js +543 -0
- package/node_modules/@nodable/entities/src/EntityEncoder.js +194 -0
- package/node_modules/@nodable/entities/src/entities.js +1177 -0
- package/node_modules/@nodable/entities/src/entityTries.js +49 -0
- package/node_modules/@nodable/entities/src/index.d.ts +264 -0
- package/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-builder/CHANGELOG.md +40 -0
- package/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-builder/README.md +74 -0
- package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-builder/package.json +81 -0
- package/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-builder/src/fxb.js +599 -0
- package/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +359 -0
- package/node_modules/fast-xml-builder/src/util.js +16 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +165 -0
- package/node_modules/fast-xml-parser/README.md +21 -44
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +343 -31
- package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -1
- package/node_modules/fast-xml-parser/package.json +13 -8
- package/node_modules/fast-xml-parser/src/fxp.d.ts +335 -30
- package/node_modules/fast-xml-parser/src/fxp.js +1 -1
- package/node_modules/fast-xml-parser/src/util.js +18 -25
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +89 -87
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +10 -10
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +23 -23
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +29 -29
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +1 -1
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +39 -39
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +21 -21
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +22 -22
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +85 -85
- package/node_modules/fast-xml-parser/src/validator.js +34 -34
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -284
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +335 -293
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +160 -43
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +540 -308
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +26 -26
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +99 -41
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +10 -10
- package/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/path-expression-matcher/README.md +872 -0
- package/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/path-expression-matcher/lib/pem.d.cts +634 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/path-expression-matcher/package.json +78 -0
- package/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/path-expression-matcher/src/ExpressionSet.js +209 -0
- package/node_modules/path-expression-matcher/src/Matcher.js +570 -0
- package/node_modules/path-expression-matcher/src/index.d.ts +523 -0
- package/node_modules/path-expression-matcher/src/index.js +29 -0
- package/node_modules/strnum/CHANGELOG.md +12 -2
- package/node_modules/strnum/README.md +1 -0
- package/node_modules/strnum/package.json +5 -4
- package/node_modules/strnum/strnum.js +99 -65
- package/node_modules/xml-naming/README.md +189 -0
- package/node_modules/xml-naming/package.json +54 -0
- package/node_modules/xml-naming/src/index.d.ts +74 -0
- package/node_modules/xml-naming/src/index.js +270 -0
- package/package.json +3 -2
- package/renovate.json5 +1 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +0 -134
- package/node_modules/strnum/.github/SECURITY.md +0 -5
- package/node_modules/strnum/.vscode/launch.json +0 -25
- package/node_modules/strnum/algo.stflow +0 -84
- package/node_modules/strnum/strnum.test.js +0 -173
- package/node_modules/strnum/test.js +0 -9
- /package/node_modules/{fast-xml-parser/src/xmlbuilder → fast-xml-builder/src}/prettifyJs2Xml.js +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// EntityDecoder.js
|
|
2
|
+
import { trie1, trie2, trie3 } from './entityTries.js';
|
|
3
|
+
|
|
4
|
+
// Replacement strings indexed by char code — direct array access, no hashing
|
|
5
|
+
const XML_UNSAFE_REPLACEMENT = new Array(128);
|
|
6
|
+
XML_UNSAFE_REPLACEMENT[38] = '&'; // &
|
|
7
|
+
XML_UNSAFE_REPLACEMENT[60] = '<'; // <
|
|
8
|
+
XML_UNSAFE_REPLACEMENT[62] = '>'; // >
|
|
9
|
+
XML_UNSAFE_REPLACEMENT[34] = '"'; // "
|
|
10
|
+
XML_UNSAFE_REPLACEMENT[39] = '''; // '
|
|
11
|
+
|
|
12
|
+
// Typed bitmask for O(1) "is this ASCII code XML-unsafe?" check
|
|
13
|
+
const IS_XML_UNSAFE = new Uint8Array(128);
|
|
14
|
+
IS_XML_UNSAFE[38] = 1;
|
|
15
|
+
IS_XML_UNSAFE[60] = 1;
|
|
16
|
+
IS_XML_UNSAFE[62] = 1;
|
|
17
|
+
IS_XML_UNSAFE[34] = 1;
|
|
18
|
+
IS_XML_UNSAFE[39] = 1;
|
|
19
|
+
|
|
20
|
+
// Fast pre-scan: bail out immediately if nothing needs encoding
|
|
21
|
+
const NEEDS_PROCESSING = /[&<>"'\u0080-\uFFFF]/;
|
|
22
|
+
|
|
23
|
+
export default class EntityEncoder {
|
|
24
|
+
constructor(options = {}) {
|
|
25
|
+
this.encodeXmlSafe = options.encodeXmlSafe !== false;
|
|
26
|
+
this.encodeAllNamed = options.encodeAllNamed !== false;
|
|
27
|
+
this.maxReplacements = options.maxReplacements || 0;
|
|
28
|
+
this.replacementsCount = 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
encode(str) {
|
|
32
|
+
if (typeof str !== 'string' || str.length === 0) return str;
|
|
33
|
+
if (!NEEDS_PROCESSING.test(str)) return str;
|
|
34
|
+
|
|
35
|
+
const maxRep = this.maxReplacements;
|
|
36
|
+
if (maxRep > 0 && this.replacementsCount >= maxRep) return str;
|
|
37
|
+
|
|
38
|
+
// Hoist to locals — avoids `this` property lookup inside the hot loop
|
|
39
|
+
const encodeXmlSafe = this.encodeXmlSafe;
|
|
40
|
+
const encodeAllNamed = this.encodeAllNamed;
|
|
41
|
+
|
|
42
|
+
const len = str.length;
|
|
43
|
+
|
|
44
|
+
let result = '';
|
|
45
|
+
let last = 0;
|
|
46
|
+
let i = 0;
|
|
47
|
+
let limitReached = false;
|
|
48
|
+
|
|
49
|
+
// ── Main loop: runs to len-2 so trie3 never needs a bounds check ────────
|
|
50
|
+
// The last 2 characters are handled by the tail block below.
|
|
51
|
+
const mainEnd = len - 2; // i <= mainEnd guarantees i+1 and i+2 are valid
|
|
52
|
+
|
|
53
|
+
while (i <= mainEnd && !limitReached) {
|
|
54
|
+
const c0 = str.charCodeAt(i);
|
|
55
|
+
|
|
56
|
+
// ── ASCII branch ───────────────────────────────────────────────────
|
|
57
|
+
if (c0 < 128) {
|
|
58
|
+
if (encodeXmlSafe && IS_XML_UNSAFE[c0] === 1) {
|
|
59
|
+
result += str.substring(last, i) + XML_UNSAFE_REPLACEMENT[c0];
|
|
60
|
+
last = ++i;
|
|
61
|
+
if (maxRep > 0) {
|
|
62
|
+
this.replacementsCount++;
|
|
63
|
+
if (this.replacementsCount >= maxRep) {
|
|
64
|
+
limitReached = true;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
// Bulk-skip: advance to the next interesting position without
|
|
70
|
+
// touching the outer loop overhead on every safe character
|
|
71
|
+
i++;
|
|
72
|
+
while (i <= mainEnd && !limitReached) {
|
|
73
|
+
const c = str.charCodeAt(i);
|
|
74
|
+
if (c >= 128 || (encodeXmlSafe && IS_XML_UNSAFE[c] === 1)) break;
|
|
75
|
+
i++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ── Non-ASCII: integer-keyed trie lookup ───────────────────────────
|
|
82
|
+
// No bounds checks needed for c1/c2 because i <= mainEnd guarantees
|
|
83
|
+
// i+1 and i+2 are both within the string.
|
|
84
|
+
let matchedEntity = null;
|
|
85
|
+
let advance = 1;
|
|
86
|
+
|
|
87
|
+
// Try 3-char match first (longest wins)
|
|
88
|
+
const mid3 = trie3.get(c0);
|
|
89
|
+
if (mid3 !== undefined) {
|
|
90
|
+
const c1 = str.charCodeAt(i + 1);
|
|
91
|
+
const inner3 = mid3.get(c1);
|
|
92
|
+
if (inner3 !== undefined) {
|
|
93
|
+
const c2 = str.charCodeAt(i + 2);
|
|
94
|
+
const candidate = inner3.get(c2);
|
|
95
|
+
if (candidate !== undefined) { matchedEntity = candidate; advance = 3; }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Try 2-char match
|
|
100
|
+
if (matchedEntity === null) {
|
|
101
|
+
const inner2 = trie2.get(c0);
|
|
102
|
+
if (inner2 !== undefined) {
|
|
103
|
+
const c1 = str.charCodeAt(i + 1);
|
|
104
|
+
const candidate = inner2.get(c1);
|
|
105
|
+
if (candidate !== undefined) { matchedEntity = candidate; advance = 2; }
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Try 1-char match
|
|
110
|
+
if (matchedEntity === null && encodeAllNamed) {
|
|
111
|
+
const candidate = trie1.get(c0);
|
|
112
|
+
if (candidate !== undefined) { matchedEntity = candidate; }
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (matchedEntity !== null) {
|
|
116
|
+
result += str.substring(last, i) + matchedEntity;
|
|
117
|
+
i += advance;
|
|
118
|
+
last = i;
|
|
119
|
+
if (maxRep > 0) {
|
|
120
|
+
this.replacementsCount++;
|
|
121
|
+
if (this.replacementsCount >= maxRep) {
|
|
122
|
+
limitReached = true;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
i++;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ── Tail: handle the last 1-2 characters (no 3-char match possible) ────
|
|
132
|
+
while (i < len && !limitReached) {
|
|
133
|
+
const c0 = str.charCodeAt(i);
|
|
134
|
+
|
|
135
|
+
if (c0 < 128) {
|
|
136
|
+
if (encodeXmlSafe && IS_XML_UNSAFE[c0] === 1) {
|
|
137
|
+
result += str.substring(last, i) + XML_UNSAFE_REPLACEMENT[c0];
|
|
138
|
+
last = ++i;
|
|
139
|
+
if (maxRep > 0) {
|
|
140
|
+
this.replacementsCount++;
|
|
141
|
+
if (this.replacementsCount >= maxRep) {
|
|
142
|
+
limitReached = true;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
i++;
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Non-ASCII tail — only 2-char and 1-char matches are possible here
|
|
153
|
+
let matchedEntity = null;
|
|
154
|
+
let advance = 1;
|
|
155
|
+
|
|
156
|
+
if (i + 1 < len) {
|
|
157
|
+
const inner2 = trie2.get(c0);
|
|
158
|
+
if (inner2 !== undefined) {
|
|
159
|
+
const c1 = str.charCodeAt(i + 1);
|
|
160
|
+
const candidate = inner2.get(c1);
|
|
161
|
+
if (candidate !== undefined) { matchedEntity = candidate; advance = 2; }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (matchedEntity === null && encodeAllNamed) {
|
|
166
|
+
const candidate = trie1.get(c0);
|
|
167
|
+
if (candidate !== undefined) { matchedEntity = candidate; }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (matchedEntity !== null) {
|
|
171
|
+
result += str.substring(last, i) + matchedEntity;
|
|
172
|
+
i += advance;
|
|
173
|
+
last = i;
|
|
174
|
+
if (maxRep > 0) {
|
|
175
|
+
this.replacementsCount++;
|
|
176
|
+
if (this.replacementsCount >= maxRep) {
|
|
177
|
+
limitReached = true;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
i++;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// ── Flush any remaining literal suffix ────────────────────────────────
|
|
187
|
+
if (last < len) result += str.substring(last);
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
reset() {
|
|
192
|
+
this.replacementsCount = 0;
|
|
193
|
+
}
|
|
194
|
+
}
|