@gusto/baerly-storage 0.1.2 → 0.3.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 (123) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +29 -0
  3. package/README.md +108 -44
  4. package/dist/API.md +192 -121
  5. package/dist/CHANGELOG.md +144 -0
  6. package/dist/THIRD-PARTY-LICENSES.txt +312 -0
  7. package/dist/{app-config-C0Bbw_Z6.d.ts → app-config-BIzyAKzy.d.ts} +14 -2
  8. package/dist/app-config.d.ts +1 -1
  9. package/dist/auth.d.ts +1 -1
  10. package/dist/auth.js +288 -288
  11. package/dist/auth.js.map +1 -1
  12. package/dist/baerly.js +10 -10
  13. package/dist/baerly.js.map +1 -1
  14. package/dist/bytes-BXdamO3L.js.map +1 -1
  15. package/dist/{client-DYZfoZb9.d.ts → client-BJXF3XJA.d.ts} +10 -10
  16. package/dist/client-react.d.ts +76 -85
  17. package/dist/client-react.js +95 -53
  18. package/dist/client-react.js.map +1 -1
  19. package/dist/client.d.ts +3 -3
  20. package/dist/client.js.map +1 -1
  21. package/dist/{cloudflare-CINJPKCW.js → cloudflare-Cn2ibODt.js} +178 -2
  22. package/dist/cloudflare-Cn2ibODt.js.map +1 -0
  23. package/dist/cloudflare.d.ts +4 -4
  24. package/dist/cloudflare.js +10 -11
  25. package/dist/cloudflare.js.map +1 -1
  26. package/dist/{subcommand-DZcHcsYp.js → config-CGyBopy3.js} +643 -439
  27. package/dist/config-CGyBopy3.js.map +1 -0
  28. package/dist/context-DRZ3tZ5l.js.map +1 -1
  29. package/dist/{cost-CQt1YRkA.js → cost-BZ_MDBmn.js} +6 -4
  30. package/dist/cost-BZ_MDBmn.js.map +1 -0
  31. package/dist/{current-json-C-EyJqs0.js → current-json-DsN7FNY1.js} +47 -13
  32. package/dist/current-json-DsN7FNY1.js.map +1 -0
  33. package/dist/{db-BM3y2JQw.d.ts → db-CCT6tDfY.d.ts} +26 -108
  34. package/dist/{deploy-CrAbfgCq.js → deploy-BKKyGlSJ.js} +11 -4
  35. package/dist/deploy-BKKyGlSJ.js.map +1 -0
  36. package/dist/dev-vite.d.ts +5 -5
  37. package/dist/dev-vite.js +5 -5
  38. package/dist/dev-vite.js.map +1 -1
  39. package/dist/dev.d.ts +1 -1
  40. package/dist/dev.js +1 -1
  41. package/dist/{doctor-Db-hzPmE.js → doctor-BVU4GNXN.js} +13 -132
  42. package/dist/doctor-BVU4GNXN.js.map +1 -0
  43. package/dist/{dump-BYA55NLP.js → dump-DPEAKub6.js} +5 -3
  44. package/dist/dump-DPEAKub6.js.map +1 -0
  45. package/dist/errors-DOdL95kK.js.map +1 -1
  46. package/dist/{export-Bhbz90-z.js → export-BcuCLFFe.js} +6 -4
  47. package/dist/{export-Bhbz90-z.js.map → export-BcuCLFFe.js.map} +1 -1
  48. package/dist/{fsck-CPPZWt9p.js → fsck-RXgLOaJG.js} +23 -11
  49. package/dist/fsck-RXgLOaJG.js.map +1 -0
  50. package/dist/{http-Cw8p6y5b.js → http-Bd4byR4n.js} +45 -61
  51. package/dist/http-Bd4byR4n.js.map +1 -0
  52. package/dist/http.d.ts +15 -15
  53. package/dist/http.js +1 -1
  54. package/dist/{index-cUY-36AN.d.ts → index-BDceQQi-.d.ts} +20 -4
  55. package/dist/{index-C3JAH1Yo.d.ts → index-Cmsxx-ZN.d.ts} +9 -9
  56. package/dist/{index-DSvwEUeF.d.ts → index-DW7GT6M2.d.ts} +50 -42
  57. package/dist/{index-DwDTWPSU.d.ts → index-DnBGSeuU.d.ts} +10 -7
  58. package/dist/index.d.ts +6 -6
  59. package/dist/index.js +4 -4
  60. package/dist/{indexes-DAu2AkTW.d.ts → indexes-Cx7uMXm0.d.ts} +2 -2
  61. package/dist/{inspect-Bdbzvi-_.js → inspect-DhI49PSi.js} +16 -8
  62. package/dist/inspect-DhI49PSi.js.map +1 -0
  63. package/dist/{snapshot-SS8USDUF.js → log-tail-DXeDkWEp.js} +154 -83
  64. package/dist/log-tail-DXeDkWEp.js.map +1 -0
  65. package/dist/{maintenance-BRrThz8V.d.ts → maintenance-BkhUr72A.d.ts} +91 -26
  66. package/dist/{maintenance-ClzBC1Vv.js → maintenance-CWBQpZ2y.js} +368 -161
  67. package/dist/maintenance-CWBQpZ2y.js.map +1 -0
  68. package/dist/{maintenance-BvOv6BMM.js → maintenance-C_KSkVjd.js} +204 -82
  69. package/dist/maintenance-C_KSkVjd.js.map +1 -0
  70. package/dist/maintenance.d.ts +3 -2
  71. package/dist/maintenance.js +3 -2
  72. package/dist/node.d.ts +13 -8
  73. package/dist/node.js +1 -1
  74. package/dist/normalize-XWY25_sG.js.map +1 -1
  75. package/dist/{observability-CpOiEN0k.js → observability-BYd-RzEx.js} +63 -55
  76. package/dist/observability-BYd-RzEx.js.map +1 -0
  77. package/dist/observability.d.ts +3 -3
  78. package/dist/observability.js +1 -1
  79. package/dist/{plan-DOTl21vq.js → plan-DIu_B6fy.js} +7 -4
  80. package/dist/plan-DIu_B6fy.js.map +1 -0
  81. package/dist/{query-BmiQy328.js → query-sQNO5vU_.js} +1071 -1099
  82. package/dist/query-sQNO5vU_.js.map +1 -0
  83. package/dist/{rebuild-index-DC_nR6wP.js → rebuild-index-DP4CqSSs.js} +5 -4
  84. package/dist/rebuild-index-DP4CqSSs.js.map +1 -0
  85. package/dist/{restore-C6IcmLeA.js → restore-DpQYef6r.js} +362 -328
  86. package/dist/restore-DpQYef6r.js.map +1 -0
  87. package/dist/shared-secret-BJdSwpgw.js.map +1 -1
  88. package/dist/{src-QQ7jDeL2.js → src-CWpkSbvJ.js} +40 -20
  89. package/dist/src-CWpkSbvJ.js.map +1 -0
  90. package/dist/{src-DU1sCMlr.js → src-D24wDpzR.js} +269 -258
  91. package/dist/src-D24wDpzR.js.map +1 -0
  92. package/dist/{src-zhEAmmF7.js → src-Db4-qVtM.js} +36 -96
  93. package/dist/src-Db4-qVtM.js.map +1 -0
  94. package/dist/subcommand-CP9NY2J4.js +159 -0
  95. package/dist/subcommand-CP9NY2J4.js.map +1 -0
  96. package/dist/{usage-CLjirdD-.js → usage-CTfDq9HR.js} +3 -3
  97. package/dist/{usage-CLjirdD-.js.map → usage-CTfDq9HR.js.map} +1 -1
  98. package/dist/{validate-DCq_0DIn.js → validate-DtljsCh1.js} +51 -51
  99. package/dist/{validate-DCq_0DIn.js.map → validate-DtljsCh1.js.map} +1 -1
  100. package/package.json +42 -31
  101. package/dist/cloudflare-CINJPKCW.js.map +0 -1
  102. package/dist/config-DVfDGyw1.js +0 -278
  103. package/dist/config-DVfDGyw1.js.map +0 -1
  104. package/dist/cost-CQt1YRkA.js.map +0 -1
  105. package/dist/current-json-C-EyJqs0.js.map +0 -1
  106. package/dist/deploy-CrAbfgCq.js.map +0 -1
  107. package/dist/doctor-Db-hzPmE.js.map +0 -1
  108. package/dist/dump-BYA55NLP.js.map +0 -1
  109. package/dist/fsck-CPPZWt9p.js.map +0 -1
  110. package/dist/http-Cw8p6y5b.js.map +0 -1
  111. package/dist/inspect-Bdbzvi-_.js.map +0 -1
  112. package/dist/maintenance-BvOv6BMM.js.map +0 -1
  113. package/dist/maintenance-ClzBC1Vv.js.map +0 -1
  114. package/dist/observability-CpOiEN0k.js.map +0 -1
  115. package/dist/plan-DOTl21vq.js.map +0 -1
  116. package/dist/query-BmiQy328.js.map +0 -1
  117. package/dist/rebuild-index-DC_nR6wP.js.map +0 -1
  118. package/dist/restore-C6IcmLeA.js.map +0 -1
  119. package/dist/snapshot-SS8USDUF.js.map +0 -1
  120. package/dist/src-DU1sCMlr.js.map +0 -1
  121. package/dist/src-QQ7jDeL2.js.map +0 -1
  122. package/dist/src-zhEAmmF7.js.map +0 -1
  123. package/dist/subcommand-DZcHcsYp.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import { g as RATE_LIMIT_BACKOFF_MILLIS } from "./current-json-C-EyJqs0.js";
1
+ import { p as MAINTENANCE_PROFILE_NODE, v as RATE_LIMIT_BACKOFF_MILLIS } from "./current-json-DsN7FNY1.js";
2
2
  import { t as BaerlyError } from "./errors-DOdL95kK.js";
3
- import { l as delay } from "./query-BmiQy328.js";
4
- import { n as resolveVerifier, t as Db } from "./src-zhEAmmF7.js";
3
+ import { c as delay } from "./query-sQNO5vU_.js";
4
+ import { n as resolveVerifier, t as Db } from "./src-Db4-qVtM.js";
5
+ import { n as createRouter, o as Hono, r as mapError, t as MAX_BODY_BYTES } from "./http-Bd4byR4n.js";
5
6
  import { r as runWithContext, t as createObservabilityContext } from "./context-DRZ3tZ5l.js";
6
- import { n as createRouter, o as Hono, r as mapError, t as MAX_BODY_BYTES } from "./http-Cw8p6y5b.js";
7
- import { c as configureObservability, n as flushCanonicalLine, o as deriveOutcome, r as flushUnauthorizedAndRespond, t as observableStorage } from "./observability-CpOiEN0k.js";
8
- import { a as require_picocolors_browser, r as renderDevLanding } from "./src-QQ7jDeL2.js";
7
+ import { c as configureObservability, n as flushCanonicalLine, o as deriveOutcome, r as flushUnauthorizedAndRespond, t as observableStorage } from "./observability-BYd-RzEx.js";
8
+ import { a as require_picocolors_browser, r as renderDevLanding } from "./src-CWpkSbvJ.js";
9
9
  import { readFile, stat } from "node:fs/promises";
10
10
  import { extname, relative, resolve, sep } from "node:path";
11
11
  import { STATUS_CODES, createServer } from "node:http";
@@ -52,244 +52,6 @@ const criticalProperties = [
52
52
  "prototype"
53
53
  ];
54
54
  //#endregion
55
- //#region node_modules/.pnpm/fast-xml-parser@5.8.0/node_modules/fast-xml-parser/src/validator.js
56
- const defaultOptions$1 = {
57
- allowBooleanAttributes: false,
58
- unpairedTags: []
59
- };
60
- function validate(xmlData, options) {
61
- options = Object.assign({}, defaultOptions$1, options);
62
- const tags = [];
63
- let tagFound = false;
64
- let reachedRoot = false;
65
- if (xmlData[0] === "") xmlData = xmlData.substr(1);
66
- for (let i = 0; i < xmlData.length; i++) if (xmlData[i] === "<" && xmlData[i + 1] === "?") {
67
- i += 2;
68
- i = readPI(xmlData, i);
69
- if (i.err) return i;
70
- } else if (xmlData[i] === "<") {
71
- let tagStartPos = i;
72
- i++;
73
- if (xmlData[i] === "!") {
74
- i = readCommentAndCDATA(xmlData, i);
75
- continue;
76
- } else {
77
- let closingTag = false;
78
- if (xmlData[i] === "/") {
79
- closingTag = true;
80
- i++;
81
- }
82
- let tagName = "";
83
- for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) tagName += xmlData[i];
84
- tagName = tagName.trim();
85
- if (tagName[tagName.length - 1] === "/") {
86
- tagName = tagName.substring(0, tagName.length - 1);
87
- i--;
88
- }
89
- if (!validateTagName(tagName)) {
90
- let msg;
91
- if (tagName.trim().length === 0) msg = "Invalid space after '<'.";
92
- else msg = "Tag '" + tagName + "' is an invalid name.";
93
- return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i));
94
- }
95
- const result = readAttributeStr(xmlData, i);
96
- if (result === false) return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i));
97
- let attrStr = result.value;
98
- i = result.index;
99
- if (attrStr[attrStr.length - 1] === "/") {
100
- const attrStrStart = i - attrStr.length;
101
- attrStr = attrStr.substring(0, attrStr.length - 1);
102
- const isValid = validateAttributeString(attrStr, options);
103
- if (isValid === true) tagFound = true;
104
- else return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));
105
- } else if (closingTag) if (!result.tagClosed) return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
106
- else if (attrStr.trim().length > 0) return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
107
- else if (tags.length === 0) return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos));
108
- else {
109
- const otg = tags.pop();
110
- if (tagName !== otg.tagName) {
111
- let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
112
- return getErrorObject("InvalidTag", "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", getLineNumberForPosition(xmlData, tagStartPos));
113
- }
114
- if (tags.length == 0) reachedRoot = true;
115
- }
116
- else {
117
- const isValid = validateAttributeString(attrStr, options);
118
- if (isValid !== true) return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));
119
- if (reachedRoot === true) return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
120
- else if (options.unpairedTags.indexOf(tagName) !== -1) {} else tags.push({
121
- tagName,
122
- tagStartPos
123
- });
124
- tagFound = true;
125
- }
126
- for (i++; i < xmlData.length; i++) if (xmlData[i] === "<") if (xmlData[i + 1] === "!") {
127
- i++;
128
- i = readCommentAndCDATA(xmlData, i);
129
- continue;
130
- } else if (xmlData[i + 1] === "?") {
131
- i = readPI(xmlData, ++i);
132
- if (i.err) return i;
133
- } else break;
134
- else if (xmlData[i] === "&") {
135
- const afterAmp = validateAmpersand(xmlData, i);
136
- if (afterAmp == -1) return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i));
137
- i = afterAmp;
138
- } else if (reachedRoot === true && !isWhiteSpace(xmlData[i])) return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i));
139
- if (xmlData[i] === "<") i--;
140
- }
141
- } else {
142
- if (isWhiteSpace(xmlData[i])) continue;
143
- return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i));
144
- }
145
- if (!tagFound) return getErrorObject("InvalidXml", "Start tag expected.", 1);
146
- else if (tags.length == 1) return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
147
- else if (tags.length > 0) return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
148
- line: 1,
149
- col: 1
150
- });
151
- return true;
152
- }
153
- function isWhiteSpace(char) {
154
- return char === " " || char === " " || char === "\n" || char === "\r";
155
- }
156
- /**
157
- * Read Processing insstructions and skip
158
- * @param {*} xmlData
159
- * @param {*} i
160
- */
161
- function readPI(xmlData, i) {
162
- const start = i;
163
- for (; i < xmlData.length; i++) if (xmlData[i] == "?" || xmlData[i] == " ") {
164
- const tagname = xmlData.substr(start, i - start);
165
- if (i > 5 && tagname === "xml") return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i));
166
- else if (xmlData[i] == "?" && xmlData[i + 1] == ">") {
167
- i++;
168
- break;
169
- } else continue;
170
- }
171
- return i;
172
- }
173
- function readCommentAndCDATA(xmlData, i) {
174
- if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") {
175
- for (i += 3; i < xmlData.length; i++) if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") {
176
- i += 2;
177
- break;
178
- }
179
- } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") {
180
- let angleBracketsCount = 1;
181
- for (i += 8; i < xmlData.length; i++) if (xmlData[i] === "<") angleBracketsCount++;
182
- else if (xmlData[i] === ">") {
183
- angleBracketsCount--;
184
- if (angleBracketsCount === 0) break;
185
- }
186
- } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") {
187
- for (i += 8; i < xmlData.length; i++) if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") {
188
- i += 2;
189
- break;
190
- }
191
- }
192
- return i;
193
- }
194
- const doubleQuote = "\"";
195
- const singleQuote = "'";
196
- /**
197
- * Keep reading xmlData until '<' is found outside the attribute value.
198
- * @param {string} xmlData
199
- * @param {number} i
200
- */
201
- function readAttributeStr(xmlData, i) {
202
- let attrStr = "";
203
- let startChar = "";
204
- let tagClosed = false;
205
- for (; i < xmlData.length; i++) {
206
- if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) if (startChar === "") startChar = xmlData[i];
207
- else if (startChar !== xmlData[i]) {} else startChar = "";
208
- else if (xmlData[i] === ">") {
209
- if (startChar === "") {
210
- tagClosed = true;
211
- break;
212
- }
213
- }
214
- attrStr += xmlData[i];
215
- }
216
- if (startChar !== "") return false;
217
- return {
218
- value: attrStr,
219
- index: i,
220
- tagClosed
221
- };
222
- }
223
- /**
224
- * Select all the attributes whether valid or invalid.
225
- */
226
- const validAttrStrRegxp = /* @__PURE__ */ new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
227
- function validateAttributeString(attrStr, options) {
228
- const matches = getAllMatches(attrStr, validAttrStrRegxp);
229
- const attrNames = {};
230
- for (let i = 0; i < matches.length; i++) {
231
- if (matches[i][1].length === 0) return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i]));
232
- else if (matches[i][3] !== void 0 && matches[i][4] === void 0) return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i]));
233
- else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i]));
234
- const attrName = matches[i][2];
235
- if (!validateAttrName(attrName)) return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i]));
236
- if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) attrNames[attrName] = 1;
237
- else return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i]));
238
- }
239
- return true;
240
- }
241
- function validateNumberAmpersand(xmlData, i) {
242
- let re = /\d/;
243
- if (xmlData[i] === "x") {
244
- i++;
245
- re = /[\da-fA-F]/;
246
- }
247
- for (; i < xmlData.length; i++) {
248
- if (xmlData[i] === ";") return i;
249
- if (!xmlData[i].match(re)) break;
250
- }
251
- return -1;
252
- }
253
- function validateAmpersand(xmlData, i) {
254
- i++;
255
- if (xmlData[i] === ";") return -1;
256
- if (xmlData[i] === "#") {
257
- i++;
258
- return validateNumberAmpersand(xmlData, i);
259
- }
260
- let count = 0;
261
- for (; i < xmlData.length; i++, count++) {
262
- if (xmlData[i].match(/\w/) && count < 20) continue;
263
- if (xmlData[i] === ";") break;
264
- return -1;
265
- }
266
- return i;
267
- }
268
- function getErrorObject(code, message, lineNumber) {
269
- return { err: {
270
- code,
271
- msg: message,
272
- line: lineNumber.line || lineNumber,
273
- col: lineNumber.col
274
- } };
275
- }
276
- function validateAttrName(attrName) {
277
- return isName(attrName);
278
- }
279
- function validateTagName(tagname) {
280
- return isName(tagname);
281
- }
282
- function getLineNumberForPosition(xmlData, index) {
283
- const lines = xmlData.substring(0, index).split(/\r?\n/);
284
- return {
285
- line: lines.length,
286
- col: lines[lines.length - 1].length + 1
287
- };
288
- }
289
- function getPositionFromMatch(match) {
290
- return match.startIndex + match[1].length;
291
- }
292
- //#endregion
293
55
  //#region node_modules/.pnpm/@nodable+entities@2.1.0/node_modules/@nodable/entities/src/entities.js
294
56
  /**
295
57
  * Basic Latin & Special Characters
@@ -1839,7 +1601,7 @@ const defaultOnDangerousProperty = (name) => {
1839
1601
  if (DANGEROUS_PROPERTY_NAMES.includes(name)) return "__" + name;
1840
1602
  return name;
1841
1603
  };
1842
- const defaultOptions = {
1604
+ const defaultOptions$1 = {
1843
1605
  preserveOrder: false,
1844
1606
  attributeNamePrefix: "@_",
1845
1607
  attributesGroupName: false,
@@ -1926,7 +1688,7 @@ function normalizeProcessEntities(value, htmlEntities) {
1926
1688
  return normalizeProcessEntities(true);
1927
1689
  }
1928
1690
  const buildOptions = function(options) {
1929
- const built = Object.assign({}, defaultOptions, options);
1691
+ const built = Object.assign({}, defaultOptions$1, options);
1930
1692
  const propertyNameOptions = [
1931
1693
  {
1932
1694
  value: built.attributeNamePrefix,
@@ -3737,6 +3499,244 @@ function isLeafTag(obj, options) {
3737
3499
  return false;
3738
3500
  }
3739
3501
  //#endregion
3502
+ //#region node_modules/.pnpm/fast-xml-parser@5.8.0/node_modules/fast-xml-parser/src/validator.js
3503
+ const defaultOptions = {
3504
+ allowBooleanAttributes: false,
3505
+ unpairedTags: []
3506
+ };
3507
+ function validate(xmlData, options) {
3508
+ options = Object.assign({}, defaultOptions, options);
3509
+ const tags = [];
3510
+ let tagFound = false;
3511
+ let reachedRoot = false;
3512
+ if (xmlData[0] === "") xmlData = xmlData.substr(1);
3513
+ for (let i = 0; i < xmlData.length; i++) if (xmlData[i] === "<" && xmlData[i + 1] === "?") {
3514
+ i += 2;
3515
+ i = readPI(xmlData, i);
3516
+ if (i.err) return i;
3517
+ } else if (xmlData[i] === "<") {
3518
+ let tagStartPos = i;
3519
+ i++;
3520
+ if (xmlData[i] === "!") {
3521
+ i = readCommentAndCDATA(xmlData, i);
3522
+ continue;
3523
+ } else {
3524
+ let closingTag = false;
3525
+ if (xmlData[i] === "/") {
3526
+ closingTag = true;
3527
+ i++;
3528
+ }
3529
+ let tagName = "";
3530
+ for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) tagName += xmlData[i];
3531
+ tagName = tagName.trim();
3532
+ if (tagName[tagName.length - 1] === "/") {
3533
+ tagName = tagName.substring(0, tagName.length - 1);
3534
+ i--;
3535
+ }
3536
+ if (!validateTagName(tagName)) {
3537
+ let msg;
3538
+ if (tagName.trim().length === 0) msg = "Invalid space after '<'.";
3539
+ else msg = "Tag '" + tagName + "' is an invalid name.";
3540
+ return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i));
3541
+ }
3542
+ const result = readAttributeStr(xmlData, i);
3543
+ if (result === false) return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i));
3544
+ let attrStr = result.value;
3545
+ i = result.index;
3546
+ if (attrStr[attrStr.length - 1] === "/") {
3547
+ const attrStrStart = i - attrStr.length;
3548
+ attrStr = attrStr.substring(0, attrStr.length - 1);
3549
+ const isValid = validateAttributeString(attrStr, options);
3550
+ if (isValid === true) tagFound = true;
3551
+ else return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));
3552
+ } else if (closingTag) if (!result.tagClosed) return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
3553
+ else if (attrStr.trim().length > 0) return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
3554
+ else if (tags.length === 0) return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos));
3555
+ else {
3556
+ const otg = tags.pop();
3557
+ if (tagName !== otg.tagName) {
3558
+ let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
3559
+ return getErrorObject("InvalidTag", "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", getLineNumberForPosition(xmlData, tagStartPos));
3560
+ }
3561
+ if (tags.length == 0) reachedRoot = true;
3562
+ }
3563
+ else {
3564
+ const isValid = validateAttributeString(attrStr, options);
3565
+ if (isValid !== true) return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));
3566
+ if (reachedRoot === true) return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
3567
+ else if (options.unpairedTags.indexOf(tagName) !== -1) {} else tags.push({
3568
+ tagName,
3569
+ tagStartPos
3570
+ });
3571
+ tagFound = true;
3572
+ }
3573
+ for (i++; i < xmlData.length; i++) if (xmlData[i] === "<") if (xmlData[i + 1] === "!") {
3574
+ i++;
3575
+ i = readCommentAndCDATA(xmlData, i);
3576
+ continue;
3577
+ } else if (xmlData[i + 1] === "?") {
3578
+ i = readPI(xmlData, ++i);
3579
+ if (i.err) return i;
3580
+ } else break;
3581
+ else if (xmlData[i] === "&") {
3582
+ const afterAmp = validateAmpersand(xmlData, i);
3583
+ if (afterAmp == -1) return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i));
3584
+ i = afterAmp;
3585
+ } else if (reachedRoot === true && !isWhiteSpace(xmlData[i])) return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i));
3586
+ if (xmlData[i] === "<") i--;
3587
+ }
3588
+ } else {
3589
+ if (isWhiteSpace(xmlData[i])) continue;
3590
+ return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i));
3591
+ }
3592
+ if (!tagFound) return getErrorObject("InvalidXml", "Start tag expected.", 1);
3593
+ else if (tags.length == 1) return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
3594
+ else if (tags.length > 0) return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
3595
+ line: 1,
3596
+ col: 1
3597
+ });
3598
+ return true;
3599
+ }
3600
+ function isWhiteSpace(char) {
3601
+ return char === " " || char === " " || char === "\n" || char === "\r";
3602
+ }
3603
+ /**
3604
+ * Read Processing insstructions and skip
3605
+ * @param {*} xmlData
3606
+ * @param {*} i
3607
+ */
3608
+ function readPI(xmlData, i) {
3609
+ const start = i;
3610
+ for (; i < xmlData.length; i++) if (xmlData[i] == "?" || xmlData[i] == " ") {
3611
+ const tagname = xmlData.substr(start, i - start);
3612
+ if (i > 5 && tagname === "xml") return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i));
3613
+ else if (xmlData[i] == "?" && xmlData[i + 1] == ">") {
3614
+ i++;
3615
+ break;
3616
+ } else continue;
3617
+ }
3618
+ return i;
3619
+ }
3620
+ function readCommentAndCDATA(xmlData, i) {
3621
+ if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") {
3622
+ for (i += 3; i < xmlData.length; i++) if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") {
3623
+ i += 2;
3624
+ break;
3625
+ }
3626
+ } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") {
3627
+ let angleBracketsCount = 1;
3628
+ for (i += 8; i < xmlData.length; i++) if (xmlData[i] === "<") angleBracketsCount++;
3629
+ else if (xmlData[i] === ">") {
3630
+ angleBracketsCount--;
3631
+ if (angleBracketsCount === 0) break;
3632
+ }
3633
+ } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") {
3634
+ for (i += 8; i < xmlData.length; i++) if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") {
3635
+ i += 2;
3636
+ break;
3637
+ }
3638
+ }
3639
+ return i;
3640
+ }
3641
+ const doubleQuote = "\"";
3642
+ const singleQuote = "'";
3643
+ /**
3644
+ * Keep reading xmlData until '<' is found outside the attribute value.
3645
+ * @param {string} xmlData
3646
+ * @param {number} i
3647
+ */
3648
+ function readAttributeStr(xmlData, i) {
3649
+ let attrStr = "";
3650
+ let startChar = "";
3651
+ let tagClosed = false;
3652
+ for (; i < xmlData.length; i++) {
3653
+ if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) if (startChar === "") startChar = xmlData[i];
3654
+ else if (startChar !== xmlData[i]) {} else startChar = "";
3655
+ else if (xmlData[i] === ">") {
3656
+ if (startChar === "") {
3657
+ tagClosed = true;
3658
+ break;
3659
+ }
3660
+ }
3661
+ attrStr += xmlData[i];
3662
+ }
3663
+ if (startChar !== "") return false;
3664
+ return {
3665
+ value: attrStr,
3666
+ index: i,
3667
+ tagClosed
3668
+ };
3669
+ }
3670
+ /**
3671
+ * Select all the attributes whether valid or invalid.
3672
+ */
3673
+ const validAttrStrRegxp = /* @__PURE__ */ new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
3674
+ function validateAttributeString(attrStr, options) {
3675
+ const matches = getAllMatches(attrStr, validAttrStrRegxp);
3676
+ const attrNames = {};
3677
+ for (let i = 0; i < matches.length; i++) {
3678
+ if (matches[i][1].length === 0) return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i]));
3679
+ else if (matches[i][3] !== void 0 && matches[i][4] === void 0) return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i]));
3680
+ else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i]));
3681
+ const attrName = matches[i][2];
3682
+ if (!validateAttrName(attrName)) return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i]));
3683
+ if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) attrNames[attrName] = 1;
3684
+ else return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i]));
3685
+ }
3686
+ return true;
3687
+ }
3688
+ function validateNumberAmpersand(xmlData, i) {
3689
+ let re = /\d/;
3690
+ if (xmlData[i] === "x") {
3691
+ i++;
3692
+ re = /[\da-fA-F]/;
3693
+ }
3694
+ for (; i < xmlData.length; i++) {
3695
+ if (xmlData[i] === ";") return i;
3696
+ if (!xmlData[i].match(re)) break;
3697
+ }
3698
+ return -1;
3699
+ }
3700
+ function validateAmpersand(xmlData, i) {
3701
+ i++;
3702
+ if (xmlData[i] === ";") return -1;
3703
+ if (xmlData[i] === "#") {
3704
+ i++;
3705
+ return validateNumberAmpersand(xmlData, i);
3706
+ }
3707
+ let count = 0;
3708
+ for (; i < xmlData.length; i++, count++) {
3709
+ if (xmlData[i].match(/\w/) && count < 20) continue;
3710
+ if (xmlData[i] === ";") break;
3711
+ return -1;
3712
+ }
3713
+ return i;
3714
+ }
3715
+ function getErrorObject(code, message, lineNumber) {
3716
+ return { err: {
3717
+ code,
3718
+ msg: message,
3719
+ line: lineNumber.line || lineNumber,
3720
+ col: lineNumber.col
3721
+ } };
3722
+ }
3723
+ function validateAttrName(attrName) {
3724
+ return isName(attrName);
3725
+ }
3726
+ function validateTagName(tagname) {
3727
+ return isName(tagname);
3728
+ }
3729
+ function getLineNumberForPosition(xmlData, index) {
3730
+ const lines = xmlData.substring(0, index).split(/\r?\n/);
3731
+ return {
3732
+ line: lines.length,
3733
+ col: lines[lines.length - 1].length + 1
3734
+ };
3735
+ }
3736
+ function getPositionFromMatch(match) {
3737
+ return match.startIndex + match[1].length;
3738
+ }
3739
+ //#endregion
3740
3740
  //#region node_modules/.pnpm/fast-xml-parser@5.8.0/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
3741
3741
  var XMLParser = class {
3742
3742
  constructor(options) {
@@ -3959,7 +3959,12 @@ var S3HttpStorage = class {
3959
3959
  }
3960
3960
  async #dispatch(req) {
3961
3961
  const signed = this.#sign ? await this.#sign(req) : req;
3962
- return this.#fetch(signed);
3962
+ try {
3963
+ return await this.#fetch(signed);
3964
+ } catch (error) {
3965
+ if (error instanceof BaerlyError) throw error;
3966
+ throw new BaerlyError("NetworkError", error instanceof Error ? error.message : String(error), error);
3967
+ }
3963
3968
  }
3964
3969
  #retry(fn) {
3965
3970
  return retry(fn, {
@@ -4020,6 +4025,10 @@ var S3HttpStorage = class {
4020
4025
  signal: opts?.signal ?? null
4021
4026
  }));
4022
4027
  if (res.status === 412) throw new BaerlyError("Conflict", `PUT ${key}: precondition failed`);
4028
+ if (res.status === 409 && opts?.ifNoneMatch === "*") throw new BaerlyError("NetworkError", `PUT ${key}: 409 ConditionalRequestConflict (contended conditional create; retryable)`, {
4029
+ status: res.status,
4030
+ ...retryAfterCause(res)
4031
+ });
4023
4032
  if (res.status === 404 && opts?.ifMatch !== void 0) throw new BaerlyError("Conflict", `PUT ${key}: precondition failed (ifMatch=${opts.ifMatch} but key does not exist)`);
4024
4033
  if (res.status === 403) throw new BaerlyError("AccessDenied", `PUT ${key}: 403`);
4025
4034
  if (res.status === 429 || res.status >= 500) throw new BaerlyError("NetworkError", `PUT ${key}: ${res.status} ${await res.text()}`, {
@@ -4551,9 +4560,14 @@ function minioStorage(opts) {
4551
4560
  * goes into `credentials.accessKeyId` and the HMAC secret goes into
4552
4561
  * `credentials.secretAccessKey`. Region is pinned to `"auto"`.
4553
4562
  *
4554
- * GCS's S3-compat surface supports the four `Storage` methods
4555
- * (`get`/`put`/`delete`/`list`) but not all of S3's optional
4556
- * features — stick to the kernel surface and you're fine.
4563
+ * GCS's S3-compat surface covers the four `Storage` methods
4564
+ * (`get`/`put`/`delete`/`list`), but Google documents the
4565
+ * `If-Match`/`If-None-Match` headers this kernel coordinates on as
4566
+ * read-only (native conditional writes use `x-goog-if-generation-match`).
4567
+ * Whether GCS's interop layer enforces S3-style conditional *writes* is
4568
+ * unverified — run `baerly doctor --bucket=<your-gcs-bucket>` before
4569
+ * relying on it; a backend that fails the CAS probe is not a safe baerly
4570
+ * store. See ADR-004.
4557
4571
  *
4558
4572
  * @example
4559
4573
  * ```ts
@@ -4631,7 +4645,7 @@ function fromEksPodIdentity(opts = {}) {
4631
4645
  };
4632
4646
  }
4633
4647
  //#endregion
4634
- //#region node_modules/.pnpm/@hono+node-server@2.0.4_hono@4.12.23/node_modules/@hono/node-server/dist/index.mjs
4648
+ //#region node_modules/.pnpm/@hono+node-server@2.0.4_hono@4.12.25/node_modules/@hono/node-server/dist/index.mjs
4635
4649
  var RequestError = class extends Error {
4636
4650
  constructor(message, options) {
4637
4651
  super(message, options);
@@ -5916,7 +5930,7 @@ const prettyConsoleSink = () => {
5916
5930
  * Assemble the per-request {@link MaintenanceDispatch} for a Node host.
5917
5931
  *
5918
5932
  * baerly maintains IN-BAND: the writer reads
5919
- * `getCurrentContext()?.maintenance` at its post-CAS dispatch point and
5933
+ * `getCurrentContext()?.maintenance` at its post-commit dispatch point and
5920
5934
  * runs one bounded compact + GC slice on the (rare) write that crosses a
5921
5935
  * maintenance trigger. Reads stay pure — they never tick. There is no
5922
5936
  * `setInterval`, no cron, no operator-installed scheduler: the kernel
@@ -5956,10 +5970,7 @@ const nodeMaintenanceDispatch = (readEnv = (k) => process.env[k]) => {
5956
5970
  ...maxFoldBytes !== void 0 && { maxFoldBytes },
5957
5971
  options: {
5958
5972
  phasesPerTick: "both",
5959
- maxFoldEntriesPerPass: 200,
5960
- gcMaxMarks: 200,
5961
- gcMaxSweeps: 100,
5962
- gcInterval: 2
5973
+ profile: MAINTENANCE_PROFILE_NODE
5963
5974
  }
5964
5975
  };
5965
5976
  };
@@ -6114,7 +6125,7 @@ function createApp(opts) {
6114
6125
  * INLINE on the (rare) write that crosses a maintenance trigger —
6115
6126
  * `createFetchHandler` threads a Node-tier `MaintenanceDispatch`
6116
6127
  * onto the per-request observability context, which the writer reads at
6117
- * its post-CAS dispatch point. Reads never tick. Tune via the
6128
+ * its post-commit dispatch point. Reads never tick. Tune via the
6118
6129
  * `BAERLY_MAINTENANCE_MAX_FOLD_BYTES` / `BAERLY_MAINTENANCE_DISABLE`
6119
6130
  * env vars; for an explicit out-of-band sweep, call
6120
6131
  * `runScheduledMaintenance` from `@gusto/baerly-storage` directly.
@@ -6233,4 +6244,4 @@ function baerlyNode(opts) {
6233
6244
  //#endregion
6234
6245
  export { minioStorage as a, S3HttpStorage as c, gcsStorage as i, getRequestListener as n, r2Storage as o, fromEksPodIdentity as r, s3Storage as s, baerlyNode as t };
6235
6246
 
6236
- //# sourceMappingURL=src-DU1sCMlr.js.map
6247
+ //# sourceMappingURL=src-D24wDpzR.js.map