@btc-embedded/cdk-extensions 0.23.4 → 0.23.6

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 (135) hide show
  1. package/.jsii +5 -5
  2. package/CHANGELOG.md +21 -0
  3. package/assets/cli/catnip.js +154 -166
  4. package/lib/constructs/EventPipe.js +1 -1
  5. package/lib/constructs/ExportedService.js +1 -1
  6. package/lib/constructs/S3Bucket.js +1 -1
  7. package/lib/constructs/SecureRestApi.js +1 -1
  8. package/lib/constructs/SecureRestApiV2.js +1 -1
  9. package/lib/constructs/api-keys/ApiKeyClientAuthorization.js +1 -1
  10. package/lib/constructs/api-keys/ApiKeyManagement.js +1 -1
  11. package/lib/constructs/api-keys/ApiKeyPreTokenHandler.js +1 -1
  12. package/lib/constructs/api-keys/ApiKeyStore.js +1 -1
  13. package/lib/extensions/ApiGatewayExtension.js +1 -1
  14. package/lib/extensions/ApplicationContainer.js +1 -1
  15. package/lib/extensions/ApplicationLoadBalancerExtension.js +1 -1
  16. package/lib/extensions/ApplicationLoadBalancerExtensionV2.js +1 -1
  17. package/lib/extensions/CloudMapExtension.js +1 -1
  18. package/lib/extensions/DeactivatableServiceExtension.js +1 -1
  19. package/lib/extensions/DeploymentConfigExtension.js +1 -1
  20. package/lib/extensions/DocumentDbAccessExtension.js +1 -1
  21. package/lib/extensions/DomainEventMessagingExtension.js +1 -1
  22. package/lib/extensions/EfsMountExtension.js +1 -1
  23. package/lib/extensions/ExtraContainerExtension.js +1 -1
  24. package/lib/extensions/HTTPApiExtension.js +1 -1
  25. package/lib/extensions/LogExtension.js +1 -1
  26. package/lib/extensions/ModifyContainerDefinitionExtension.js +1 -1
  27. package/lib/extensions/ModifyTaskDefinitionExtension.js +1 -1
  28. package/lib/extensions/OpenIdExtension.js +1 -1
  29. package/lib/extensions/OpenTelemetryExtension.js +1 -1
  30. package/lib/extensions/PostgresDbAccessExtension.js +1 -1
  31. package/lib/extensions/SharedVolumeExtension.js +1 -1
  32. package/lib/extensions/TcpKeepAliveExtension.js +1 -1
  33. package/lib/platform/ApiGateway.js +1 -1
  34. package/lib/platform/ApiGatewayVpcLink.js +2 -2
  35. package/lib/platform/ApplicationLoadBalancer.js +1 -1
  36. package/lib/platform/ApplicationLoadBalancerV2.d.ts +2 -0
  37. package/lib/platform/ApplicationLoadBalancerV2.js +17 -3
  38. package/lib/platform/AuroraPostgresDB.js +2 -2
  39. package/lib/platform/BTCLogGroup.js +1 -1
  40. package/lib/platform/CognitoUserPool.js +2 -2
  41. package/lib/platform/DefaultUserPoolClients.js +1 -1
  42. package/lib/platform/DocumentDB.js +2 -2
  43. package/lib/platform/EcsCluster.js +1 -1
  44. package/lib/platform/EfsFileSystem.js +1 -1
  45. package/lib/platform/HostedZone.js +1 -1
  46. package/lib/platform/PrivateDnsNamespace.js +1 -1
  47. package/lib/platform/ResourceServer.js +1 -1
  48. package/lib/platform/Vpc.js +1 -1
  49. package/lib/platform/VpcV2.js +1 -1
  50. package/lib/stacks/ApplicationStack.js +1 -1
  51. package/lib/utils/BasePlatformStackResolver.js +1 -1
  52. package/lib/utils/StackParameter.js +1 -1
  53. package/node_modules/@nodable/entities/README.md +41 -0
  54. package/node_modules/@nodable/entities/package.json +54 -0
  55. package/node_modules/@nodable/entities/src/EntityDecoder.js +543 -0
  56. package/node_modules/@nodable/entities/src/EntityEncoder.js +194 -0
  57. package/node_modules/@nodable/entities/src/entities.js +1177 -0
  58. package/node_modules/@nodable/entities/src/entityTries.js +49 -0
  59. package/node_modules/@nodable/entities/src/index.d.ts +264 -0
  60. package/node_modules/@nodable/entities/src/index.js +29 -0
  61. package/node_modules/fast-xml-builder/CHANGELOG.md +40 -0
  62. package/node_modules/fast-xml-builder/LICENSE +21 -0
  63. package/node_modules/fast-xml-builder/README.md +74 -0
  64. package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  65. package/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
  66. package/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  67. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
  68. package/node_modules/fast-xml-builder/package.json +81 -0
  69. package/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
  70. package/node_modules/fast-xml-builder/src/fxb.js +599 -0
  71. package/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  72. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +359 -0
  73. package/node_modules/fast-xml-builder/src/util.js +16 -0
  74. package/node_modules/fast-xml-parser/CHANGELOG.md +165 -0
  75. package/node_modules/fast-xml-parser/README.md +21 -44
  76. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
  77. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
  78. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  79. package/node_modules/fast-xml-parser/lib/fxp.d.cts +343 -31
  80. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  81. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  82. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  83. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  84. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +1 -1
  85. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -1
  86. package/node_modules/fast-xml-parser/package.json +13 -8
  87. package/node_modules/fast-xml-parser/src/fxp.d.ts +335 -30
  88. package/node_modules/fast-xml-parser/src/fxp.js +1 -1
  89. package/node_modules/fast-xml-parser/src/util.js +18 -25
  90. package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +89 -87
  91. package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +10 -10
  92. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +23 -23
  93. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +29 -29
  94. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +1 -1
  95. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +39 -39
  96. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +21 -21
  97. package/node_modules/fast-xml-parser/src/v6/XMLParser.js +22 -22
  98. package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +85 -85
  99. package/node_modules/fast-xml-parser/src/validator.js +34 -34
  100. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -284
  101. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +335 -293
  102. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +160 -43
  103. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +540 -308
  104. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +26 -26
  105. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +99 -41
  106. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +10 -10
  107. package/node_modules/path-expression-matcher/LICENSE +21 -0
  108. package/node_modules/path-expression-matcher/README.md +872 -0
  109. package/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  110. package/node_modules/path-expression-matcher/lib/pem.d.cts +634 -0
  111. package/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  112. package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
  113. package/node_modules/path-expression-matcher/package.json +78 -0
  114. package/node_modules/path-expression-matcher/src/Expression.js +232 -0
  115. package/node_modules/path-expression-matcher/src/ExpressionSet.js +209 -0
  116. package/node_modules/path-expression-matcher/src/Matcher.js +570 -0
  117. package/node_modules/path-expression-matcher/src/index.d.ts +523 -0
  118. package/node_modules/path-expression-matcher/src/index.js +29 -0
  119. package/node_modules/strnum/CHANGELOG.md +12 -2
  120. package/node_modules/strnum/README.md +1 -0
  121. package/node_modules/strnum/package.json +5 -4
  122. package/node_modules/strnum/strnum.js +99 -65
  123. package/node_modules/xml-naming/README.md +189 -0
  124. package/node_modules/xml-naming/package.json +54 -0
  125. package/node_modules/xml-naming/src/index.d.ts +74 -0
  126. package/node_modules/xml-naming/src/index.js +270 -0
  127. package/package.json +3 -2
  128. package/renovate.json5 +1 -0
  129. package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +0 -134
  130. package/node_modules/strnum/.github/SECURITY.md +0 -5
  131. package/node_modules/strnum/.vscode/launch.json +0 -25
  132. package/node_modules/strnum/algo.stflow +0 -84
  133. package/node_modules/strnum/strnum.test.js +0 -173
  134. package/node_modules/strnum/test.js +0 -9
  135. /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] = '&lt;'; // <
8
+ XML_UNSAFE_REPLACEMENT[62] = '&gt;'; // >
9
+ XML_UNSAFE_REPLACEMENT[34] = '&quot;'; // "
10
+ XML_UNSAFE_REPLACEMENT[39] = '&apos;'; // '
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
+ }