@gusto/baerly-storage 0.6.0 → 0.7.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 (218) hide show
  1. package/README.md +47 -124
  2. package/dist/API.md +161 -512
  3. package/dist/CHANGELOG.md +1137 -378
  4. package/dist/RECIPES.md +398 -80
  5. package/dist/THIRD-PARTY-LICENSES.txt +5 -26
  6. package/dist/{app-config-DyiFK3_k.d.ts → app-config-C6qW7m8S.d.ts} +119 -111
  7. package/dist/app-config.d.ts +31 -1
  8. package/dist/app-config.js +1 -2
  9. package/dist/app-config.js.map +1 -1
  10. package/dist/auth.d.ts +33 -28
  11. package/dist/auth.js +549 -985
  12. package/dist/auth.js.map +1 -1
  13. package/dist/baerly.js +130 -138
  14. package/dist/baerly.js.map +1 -1
  15. package/dist/baerly.spec.json +97 -22
  16. package/dist/capacity-warning-header-BlVopyiI.js +16 -0
  17. package/dist/capacity-warning-header-BlVopyiI.js.map +1 -0
  18. package/dist/{client-ypCm3zjt.d.ts → client-CHQTXpef.d.ts} +121 -36
  19. package/dist/client-react.d.ts +67 -20
  20. package/dist/client-react.js +240 -54
  21. package/dist/client-react.js.map +1 -1
  22. package/dist/client.d.ts +5 -4
  23. package/dist/client.js +51 -16
  24. package/dist/client.js.map +1 -1
  25. package/dist/{cloudflare-wrVYf4bb.js → cloudflare-CKHYXccw.js} +61 -82
  26. package/dist/cloudflare-CKHYXccw.js.map +1 -0
  27. package/dist/cloudflare.d.ts +106 -71
  28. package/dist/cloudflare.js +334 -271
  29. package/dist/cloudflare.js.map +1 -1
  30. package/dist/code-resolution-CL_7L0wS.js +22 -0
  31. package/dist/code-resolution-CL_7L0wS.js.map +1 -0
  32. package/dist/collection-api-DbyhLAY8.d.ts +1001 -0
  33. package/dist/config-DEzInG6M.js +4035 -0
  34. package/dist/config-DEzInG6M.js.map +1 -0
  35. package/dist/constants-D3GSH3tc.js +469 -0
  36. package/dist/constants-D3GSH3tc.js.map +1 -0
  37. package/dist/{context-DRZ3tZ5l.js → context-rlpSnHFA.js} +17 -17
  38. package/dist/context-rlpSnHFA.js.map +1 -0
  39. package/dist/cost-B52llVDx.js +330 -0
  40. package/dist/cost-B52llVDx.js.map +1 -0
  41. package/dist/{current-json-C6nhPOm1.js → current-json-CC6lE4Aj.js} +115 -32
  42. package/dist/current-json-CC6lE4Aj.js.map +1 -0
  43. package/dist/db-plFUNTSF.d.ts +130 -0
  44. package/dist/db-read-seams-BSs0m1z1.js +3261 -0
  45. package/dist/db-read-seams-BSs0m1z1.js.map +1 -0
  46. package/dist/{deploy-Di_Q01qx.js → deploy-Obj4nE-Z.js} +10 -14
  47. package/dist/deploy-Obj4nE-Z.js.map +1 -0
  48. package/dist/{dev-banner-CWHIk8tH.d.ts → dev-banner-B5AUHmu1.d.ts} +1 -4
  49. package/dist/dev-landing-BI5UdmOb.d.ts +32 -0
  50. package/dist/dev-landing-CD-si4dW.js +50 -0
  51. package/dist/dev-landing-CD-si4dW.js.map +1 -0
  52. package/dist/dev-vite.d.ts +9 -14
  53. package/dist/dev-vite.js +11 -10
  54. package/dist/dev-vite.js.map +1 -1
  55. package/dist/dev.d.ts +3 -2
  56. package/dist/dev.js +2 -1
  57. package/dist/doctor-BA0i-YAN.js +270 -0
  58. package/dist/doctor-BA0i-YAN.js.map +1 -0
  59. package/dist/dump-D1vX8ozg.js +133 -0
  60. package/dist/dump-D1vX8ozg.js.map +1 -0
  61. package/dist/errors-7Rk1HGCE.js +160 -0
  62. package/dist/errors-7Rk1HGCE.js.map +1 -0
  63. package/dist/{validate-DtljsCh1.js → export-BVL2EvYE.js} +409 -19
  64. package/dist/export-BVL2EvYE.js.map +1 -0
  65. package/dist/fsck-BWkPgov4.js +145 -0
  66. package/dist/fsck-BWkPgov4.js.map +1 -0
  67. package/dist/{gcs-admin-Bx6xSNJj.d.ts → gcs-admin-Dso1HWQj.d.ts} +18 -14
  68. package/dist/gcs.d.ts +19 -7
  69. package/dist/gcs.js +1 -2
  70. package/dist/{goog4-signer-Z7KnJ1su.js → goog4-signer-CeLIABoE.js} +102 -92
  71. package/dist/goog4-signer-CeLIABoE.js.map +1 -0
  72. package/dist/{http-7zT29K3P.js → http-Z5rZyYMX.js} +898 -271
  73. package/dist/http-Z5rZyYMX.js.map +1 -0
  74. package/dist/http-transport-DNUM8kU-.js +1299 -0
  75. package/dist/http-transport-DNUM8kU-.js.map +1 -0
  76. package/dist/http.d.ts +366 -294
  77. package/dist/http.js +2 -2
  78. package/dist/index-JJrIu1pO.d.ts +135 -0
  79. package/dist/index-LEgHN0qJ.d.ts +50 -0
  80. package/dist/{index-DP3ClvcA.d.ts → index-RiEYj8t0.d.ts} +291 -78
  81. package/dist/index.d.ts +27 -6
  82. package/dist/index.js +3 -5
  83. package/dist/inspect-BTsVYZKd.js +196 -0
  84. package/dist/inspect-BTsVYZKd.js.map +1 -0
  85. package/dist/{key-Di6yyxFu.js → key-C4FPZ9Io.js} +3 -4
  86. package/dist/{key-Di6yyxFu.js.map → key-C4FPZ9Io.js.map} +1 -1
  87. package/dist/ledger-Dj_bGgo0.js +192 -0
  88. package/dist/ledger-Dj_bGgo0.js.map +1 -0
  89. package/dist/legacy-names-DgZBtgOh.js +47 -0
  90. package/dist/legacy-names-DgZBtgOh.js.map +1 -0
  91. package/dist/log-C9W15Dfo.d.ts +94 -0
  92. package/dist/log-tail-DWJbneBF.js +142 -0
  93. package/dist/log-tail-DWJbneBF.js.map +1 -0
  94. package/dist/log-walk-C-vA-WGJ.js +111 -0
  95. package/dist/log-walk-C-vA-WGJ.js.map +1 -0
  96. package/dist/maintenance-Dd-Yakqj.js +1709 -0
  97. package/dist/maintenance-Dd-Yakqj.js.map +1 -0
  98. package/dist/maintenance-DevB6z4e.js +2237 -0
  99. package/dist/maintenance-DevB6z4e.js.map +1 -0
  100. package/dist/maintenance.d.ts +100 -3
  101. package/dist/maintenance.js +1 -3
  102. package/dist/node.d.ts +119 -92
  103. package/dist/node.js +3 -3
  104. package/dist/{observability-Ch-VQJyE.js → observability-C-ISCCLE.js} +1247 -326
  105. package/dist/observability-C-ISCCLE.js.map +1 -0
  106. package/dist/observability.d.ts +27 -3
  107. package/dist/observability.js +3 -3
  108. package/dist/path-segment-DBXG26PW.js +363 -0
  109. package/dist/path-segment-DBXG26PW.js.map +1 -0
  110. package/dist/{plan-C4qgiXSg.js → plan-BvQbaNMe.js} +19 -11
  111. package/dist/plan-BvQbaNMe.js.map +1 -0
  112. package/dist/request-CRWiTrza.js +272 -0
  113. package/dist/request-CRWiTrza.js.map +1 -0
  114. package/dist/restore-U6Im8V1V.js +1467 -0
  115. package/dist/restore-U6Im8V1V.js.map +1 -0
  116. package/dist/retry-OBtLB2GC.js +126 -0
  117. package/dist/retry-OBtLB2GC.js.map +1 -0
  118. package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
  119. package/dist/{runtime-spec--LykAdl1.js → runtime-spec-B5mg3pHF.js} +189 -28
  120. package/dist/runtime-spec-B5mg3pHF.js.map +1 -0
  121. package/dist/{s3-http-DD5gDc7t.d.ts → s3-http-DBC_wiCL.d.ts} +14 -8
  122. package/dist/s3.d.ts +20 -7
  123. package/dist/s3.js +4 -5
  124. package/dist/s3.js.map +1 -1
  125. package/dist/{sha256-CqcKTjw9.js → sha256-4FfGQNPw.js} +9 -9
  126. package/dist/sha256-4FfGQNPw.js.map +1 -0
  127. package/dist/{shared-secret-DgEicd3x.js → shared-secret-Vkur-8r0.js} +27 -15
  128. package/dist/shared-secret-Vkur-8r0.js.map +1 -0
  129. package/dist/{aws4fetch.esm-CXE5ZbAa.js → sigv4-sign-5IUflUD_.js} +143 -96
  130. package/dist/sigv4-sign-5IUflUD_.js.map +1 -0
  131. package/dist/snapshot-CknzkDM0.js +148 -0
  132. package/dist/snapshot-CknzkDM0.js.map +1 -0
  133. package/dist/{src-BMFfDUI2.js → src-Actga-bO.js} +949 -363
  134. package/dist/src-Actga-bO.js.map +1 -0
  135. package/dist/src-D0MQfvOp.js +812 -0
  136. package/dist/src-D0MQfvOp.js.map +1 -0
  137. package/dist/src-Dr9uo3dc.js +501 -0
  138. package/dist/src-Dr9uo3dc.js.map +1 -0
  139. package/dist/{subcommand-BV68pqwJ.js → subcommand-BLoF66dG.js} +89 -16
  140. package/dist/subcommand-BLoF66dG.js.map +1 -0
  141. package/dist/{time-DUqvFMHq.js → time-DRxTP9iv.js} +15 -34
  142. package/dist/time-DRxTP9iv.js.map +1 -0
  143. package/dist/types-suVbsEWS.d.ts +116 -0
  144. package/dist/{usage-BMZR8o6U.js → usage-CPzVhrQr.js} +40 -45
  145. package/dist/usage-CPzVhrQr.js.map +1 -0
  146. package/dist/uuid-BuT_c404.js +333 -0
  147. package/dist/uuid-BuT_c404.js.map +1 -0
  148. package/dist/verifier-Bmlmndzo.d.ts +95 -0
  149. package/dist/{wire-izfGZDvr.js → wire-DndvKU-K.js} +2 -3
  150. package/dist/wire-DndvKU-K.js.map +1 -0
  151. package/package.json +90 -69
  152. package/dist/aws4fetch.esm-CXE5ZbAa.js.map +0 -1
  153. package/dist/bytes-BXdamO3L.js +0 -11
  154. package/dist/bytes-BXdamO3L.js.map +0 -1
  155. package/dist/cloudflare-wrVYf4bb.js.map +0 -1
  156. package/dist/config-B6nTy8e2.js +0 -3095
  157. package/dist/config-B6nTy8e2.js.map +0 -1
  158. package/dist/constants-CfeMWQWk.js +0 -222
  159. package/dist/constants-CfeMWQWk.js.map +0 -1
  160. package/dist/context-DRZ3tZ5l.js.map +0 -1
  161. package/dist/cost-_SE_SVgZ.js +0 -203
  162. package/dist/cost-_SE_SVgZ.js.map +0 -1
  163. package/dist/current-json-C6nhPOm1.js.map +0 -1
  164. package/dist/db-DjjthkTi.d.ts +0 -254
  165. package/dist/deploy-Di_Q01qx.js.map +0 -1
  166. package/dist/doctor-RWVRpvat.js +0 -102
  167. package/dist/doctor-RWVRpvat.js.map +0 -1
  168. package/dist/dump-m2vEYDNY.js +0 -94
  169. package/dist/dump-m2vEYDNY.js.map +0 -1
  170. package/dist/errors-Dfa3p78c.js +0 -78
  171. package/dist/errors-Dfa3p78c.js.map +0 -1
  172. package/dist/export-DenKwEQu.js +0 -401
  173. package/dist/export-DenKwEQu.js.map +0 -1
  174. package/dist/fsck-2Vq-7-e2.js +0 -279
  175. package/dist/fsck-2Vq-7-e2.js.map +0 -1
  176. package/dist/goog4-signer-Z7KnJ1su.js.map +0 -1
  177. package/dist/http-7zT29K3P.js.map +0 -1
  178. package/dist/http-transport-BTgVCY5r.js +0 -1250
  179. package/dist/http-transport-BTgVCY5r.js.map +0 -1
  180. package/dist/index-BHz92Acj.d.ts +0 -162
  181. package/dist/index-CEZKQsKt.d.ts +0 -1113
  182. package/dist/index-uE-w2dgj.d.ts +0 -115
  183. package/dist/indexes-Dn9hbGQG.d.ts +0 -22
  184. package/dist/inspect-BpYbH1DM.js +0 -133
  185. package/dist/inspect-BpYbH1DM.js.map +0 -1
  186. package/dist/log-tail-QWU4wlu-.js +0 -514
  187. package/dist/log-tail-QWU4wlu-.js.map +0 -1
  188. package/dist/maintenance-BGHGt2Yg.d.ts +0 -537
  189. package/dist/maintenance-DULFcpd1.js +0 -2144
  190. package/dist/maintenance-DULFcpd1.js.map +0 -1
  191. package/dist/maintenance-fEi-UZ2o.js +0 -1412
  192. package/dist/maintenance-fEi-UZ2o.js.map +0 -1
  193. package/dist/normalize-rjnZLwS4.js +0 -133
  194. package/dist/normalize-rjnZLwS4.js.map +0 -1
  195. package/dist/observability-Ch-VQJyE.js.map +0 -1
  196. package/dist/plan-C4qgiXSg.js.map +0 -1
  197. package/dist/query-C43r-6ib.js +0 -1773
  198. package/dist/query-C43r-6ib.js.map +0 -1
  199. package/dist/rebuild-index-BH1dc1p6.js +0 -81
  200. package/dist/rebuild-index-BH1dc1p6.js.map +0 -1
  201. package/dist/request-u0M51mhJ.js +0 -72
  202. package/dist/request-u0M51mhJ.js.map +0 -1
  203. package/dist/restore-D0VYWzfP.js +0 -778
  204. package/dist/restore-D0VYWzfP.js.map +0 -1
  205. package/dist/rolldown-runtime-EAsCxrDo.js +0 -14
  206. package/dist/runtime-spec--LykAdl1.js.map +0 -1
  207. package/dist/sha256-CqcKTjw9.js.map +0 -1
  208. package/dist/shared-secret-DgEicd3x.js.map +0 -1
  209. package/dist/src-BMFfDUI2.js.map +0 -1
  210. package/dist/src-DYZ4H1aF.js +0 -392
  211. package/dist/src-DYZ4H1aF.js.map +0 -1
  212. package/dist/src-DvbTEya2.js +0 -536
  213. package/dist/src-DvbTEya2.js.map +0 -1
  214. package/dist/subcommand-BV68pqwJ.js.map +0 -1
  215. package/dist/time-DUqvFMHq.js.map +0 -1
  216. package/dist/usage-BMZR8o6U.js.map +0 -1
  217. package/dist/validate-DtljsCh1.js.map +0 -1
  218. package/dist/wire-izfGZDvr.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-transport-BTgVCY5r.js","names":[],"sources":["../node_modules/.pnpm/@rgrove+parse-xml@4.2.1/node_modules/@rgrove/parse-xml/dist/browser.js","../packages/adapter-node/src/xml.ts","../packages/adapter-node/src/http-transport.ts"],"sourcesContent":["/*! @rgrove/parse-xml v4.2.1 | ISC License | Copyright Ryan Grove */\n\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n XmlCdata: () => XmlCdata,\n XmlComment: () => XmlComment,\n XmlDeclaration: () => XmlDeclaration,\n XmlDocument: () => XmlDocument,\n XmlDocumentType: () => XmlDocumentType,\n XmlElement: () => XmlElement,\n XmlError: () => XmlError,\n XmlNode: () => XmlNode,\n XmlProcessingInstruction: () => XmlProcessingInstruction,\n XmlText: () => XmlText,\n parseXml: () => parseXml\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/lib/StringScanner.ts\nvar emptyString = \"\";\nvar surrogatePair = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\nvar StringScanner = class {\n constructor(string) {\n this.k = this.u(string, true);\n this.d = 0;\n this.length = string.length;\n this.l = this.k !== this.length;\n this.h = string;\n if (this.l) {\n let charsToBytes = [];\n for (let byteIndex = 0, charIndex = 0; charIndex < this.k; ++charIndex) {\n charsToBytes[charIndex] = byteIndex;\n byteIndex += string.codePointAt(byteIndex) > 65535 ? 2 : 1;\n }\n this.A = charsToBytes;\n }\n }\n /**\n * Whether the current character index is at the end of the input string.\n */\n get B() {\n return this.d >= this.k;\n }\n // -- Protected Methods ------------------------------------------------------\n /**\n * Returns the number of characters in the given string, which may differ from\n * the byte length if the string contains multibyte characters.\n */\n u(string, multiByteSafe = this.l) {\n return multiByteSafe ? string.replace(surrogatePair, \"_\").length : string.length;\n }\n // -- Public Methods ---------------------------------------------------------\n /**\n * Advances the scanner by the given number of characters, stopping if the end\n * of the string is reached.\n */\n p(count = 1) {\n this.d = Math.min(this.k, this.d + count);\n }\n /**\n * Returns the byte index of the given character index in the string. The two\n * may differ in strings that contain multibyte characters.\n */\n f(charIndex = this.d) {\n var _a;\n return this.l ? (_a = this.A[charIndex]) != null ? _a : Infinity : charIndex;\n }\n /**\n * Consumes and returns the given number of characters if possible, advancing\n * the scanner and stopping if the end of the string is reached.\n *\n * If no characters could be consumed, an empty string will be returned.\n */\n G(charCount = 1) {\n let chars = this.m(charCount);\n this.p(charCount);\n return chars;\n }\n /**\n * Consumes and returns the given number of bytes if possible, advancing the\n * scanner and stopping if the end of the string is reached.\n *\n * It's up to the caller to ensure that the given byte count doesn't split a\n * multibyte character.\n *\n * If no bytes could be consumed, an empty string will be returned.\n */\n v(byteCount) {\n let byteIndex = this.f();\n let result = this.h.slice(byteIndex, byteIndex + byteCount);\n this.p(this.u(result));\n return result;\n }\n /**\n * Consumes and returns all characters for which the given function returns\n * `true`, stopping when `false` is returned or the end of the input is\n * reached.\n */\n w(fn) {\n let { length, l: multiByteMode, h: string } = this;\n let startByteIndex = this.f();\n let endByteIndex = startByteIndex;\n if (multiByteMode) {\n while (endByteIndex < length) {\n let char = string[endByteIndex];\n let isSurrogatePair = char >= \"\\uD800\" && char <= \"\\uDBFF\";\n if (isSurrogatePair) {\n char += string[endByteIndex + 1];\n }\n if (!fn(char)) {\n break;\n }\n endByteIndex += isSurrogatePair ? 2 : 1;\n }\n } else {\n while (endByteIndex < length && fn(string[endByteIndex])) {\n ++endByteIndex;\n }\n }\n return this.v(endByteIndex - startByteIndex);\n }\n /**\n * Consumes the given string if it exists at the current character index, and\n * advances the scanner.\n *\n * If the given string doesn't exist at the current character index, an empty\n * string will be returned and the scanner will not be advanced.\n */\n b(stringToConsume) {\n let { length } = stringToConsume;\n let byteIndex = this.f();\n if (stringToConsume === this.h.slice(byteIndex, byteIndex + length)) {\n this.p(length === 1 ? 1 : this.u(stringToConsume));\n return stringToConsume;\n }\n return emptyString;\n }\n /**\n * Consumes characters until the given global regex is matched, advancing the\n * scanner up to (but not beyond) the beginning of the match. If the regex\n * doesn't match, nothing will be consumed.\n *\n * Returns the consumed string, or an empty string if nothing was consumed.\n */\n x(regex) {\n let matchByteIndex = this.h.slice(this.f()).search(regex);\n return matchByteIndex > 0 ? this.v(matchByteIndex) : emptyString;\n }\n /**\n * Consumes characters until the given string is found, advancing the scanner\n * up to (but not beyond) that point. If the string is never found, nothing\n * will be consumed.\n *\n * Returns the consumed string, or an empty string if nothing was consumed.\n */\n s(searchString) {\n let byteIndex = this.f();\n let matchByteIndex = this.h.indexOf(searchString, byteIndex);\n return matchByteIndex > 0 ? this.v(matchByteIndex - byteIndex) : emptyString;\n }\n /**\n * Returns the given number of characters starting at the current character\n * index, without advancing the scanner and without exceeding the end of the\n * input string.\n */\n m(count = 1) {\n let { d: charIndex, h: string } = this;\n return this.l ? string.slice(this.f(charIndex), this.f(charIndex + count)) : string.slice(charIndex, charIndex + count);\n }\n /**\n * Resets the scanner position to the given character _index_, or to the start\n * of the input string if no index is given.\n *\n * If _index_ is negative, the scanner position will be moved backward by that\n * many characters, stopping if the beginning of the string is reached.\n */\n n(index = 0) {\n this.d = index >= 0 ? Math.min(this.k, index) : Math.max(0, this.d + index);\n }\n};\n\n// src/lib/syntax.ts\nvar attValueCharDoubleQuote = /[\"&<]/;\nvar attValueCharSingleQuote = /['&<]/;\nvar attValueNormalizedWhitespace = /\\r\\n|[\\n\\r\\t]/g;\nvar endCharData = /<|&|]]>/;\nvar predefinedEntities = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), {\n amp: \"&\",\n apos: \"'\",\n gt: \">\",\n lt: \"<\",\n quot: '\"'\n}));\nfunction isNameChar(char) {\n let cp = char.codePointAt(0);\n return cp >= 97 && cp <= 122 || cp >= 65 && cp <= 90 || cp >= 48 && cp <= 57 || cp === 45 || cp === 46 || cp === 183 || cp >= 768 && cp <= 879 || cp === 8255 || cp === 8256 || isNameStartChar(char, cp);\n}\nfunction isNameStartChar(char, cp = char.codePointAt(0)) {\n return cp >= 97 && cp <= 122 || cp >= 65 && cp <= 90 || cp === 58 || cp === 95 || cp >= 192 && cp <= 214 || cp >= 216 && cp <= 246 || cp >= 248 && cp <= 767 || cp >= 880 && cp <= 893 || cp >= 895 && cp <= 8191 || cp === 8204 || cp === 8205 || cp >= 8304 && cp <= 8591 || cp >= 11264 && cp <= 12271 || cp >= 12289 && cp <= 55295 || cp >= 63744 && cp <= 64975 || cp >= 65008 && cp <= 65533 || cp >= 65536 && cp <= 983039;\n}\nfunction isReferenceChar(char) {\n return char === \"#\" || isNameChar(char);\n}\nfunction isWhitespace(char) {\n let cp = char.codePointAt(0);\n return cp === 32 || cp === 9 || cp === 10 || cp === 13;\n}\nfunction isXmlCodePoint(cp) {\n return cp >= 32 && cp <= 55295 || cp === 10 || cp === 9 || cp === 13 || cp >= 57344 && cp <= 65533 || cp >= 65536 && cp <= 1114111;\n}\n\n// src/lib/XmlNode.ts\nvar _XmlNode = class _XmlNode {\n constructor() {\n /**\n * Parent node of this node, or `null` if this node has no parent.\n */\n this.parent = null;\n /**\n * Starting byte offset of this node in the original XML string, or `-1` if\n * the offset is unknown.\n */\n this.start = -1;\n /**\n * Ending byte offset of this node in the original XML string, or `-1` if the\n * offset is unknown.\n */\n this.end = -1;\n }\n /**\n * Document that contains this node, or `null` if this node is not associated\n * with a document.\n */\n get document() {\n var _a, _b;\n return (_b = (_a = this.parent) == null ? void 0 : _a.document) != null ? _b : null;\n }\n /**\n * Whether this node is the root node of the document (also known as the\n * document element).\n */\n get isRootNode() {\n return this.parent !== null && this.parent === this.document && this.type === _XmlNode.TYPE_ELEMENT;\n }\n /**\n * Whether whitespace should be preserved in the content of this element and\n * its children.\n *\n * This is influenced by the value of the special `xml:space` attribute, and\n * will be `true` for any node whose `xml:space` attribute is set to\n * \"preserve\". If a node has no such attribute, it will inherit the value of\n * the nearest ancestor that does (if any).\n *\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-white-space\n */\n get preserveWhitespace() {\n var _a;\n return !!((_a = this.parent) == null ? void 0 : _a.preserveWhitespace);\n }\n /**\n * Type of this node.\n *\n * The value of this property is a string that matches one of the static\n * `TYPE_*` properties on the `XmlNode` class (e.g. `TYPE_ELEMENT`,\n * `TYPE_TEXT`, etc.).\n *\n * The `XmlNode` class itself is a base class and doesn't have its own type\n * name.\n */\n get type() {\n return \"\";\n }\n /**\n * Returns a JSON-serializable object representing this node, minus properties\n * that could result in circular references.\n */\n toJSON() {\n let json = {\n type: this.type\n };\n if (this.isRootNode) {\n json.isRootNode = true;\n }\n if (this.preserveWhitespace) {\n json.preserveWhitespace = true;\n }\n if (this.start !== -1) {\n json.start = this.start;\n json.end = this.end;\n }\n return json;\n }\n};\n/**\n * Type value for an `XmlCdata` node.\n */\n_XmlNode.TYPE_CDATA = \"cdata\";\n/**\n * Type value for an `XmlComment` node.\n */\n_XmlNode.TYPE_COMMENT = \"comment\";\n/**\n * Type value for an `XmlDocument` node.\n */\n_XmlNode.TYPE_DOCUMENT = \"document\";\n/**\n * Type value for an `XmlDocumentType` node.\n */\n_XmlNode.TYPE_DOCUMENT_TYPE = \"doctype\";\n/**\n * Type value for an `XmlElement` node.\n */\n_XmlNode.TYPE_ELEMENT = \"element\";\n/**\n * Type value for an `XmlProcessingInstruction` node.\n */\n_XmlNode.TYPE_PROCESSING_INSTRUCTION = \"pi\";\n/**\n * Type value for an `XmlText` node.\n */\n_XmlNode.TYPE_TEXT = \"text\";\n/**\n * Type value for an `XmlDeclaration` node.\n */\n_XmlNode.TYPE_XML_DECLARATION = \"xmldecl\";\nvar XmlNode = _XmlNode;\n\n// src/lib/XmlText.ts\nvar XmlText = class extends XmlNode {\n constructor(text = \"\") {\n super();\n this.text = text;\n }\n get type() {\n return XmlNode.TYPE_TEXT;\n }\n toJSON() {\n return Object.assign(XmlNode.prototype.toJSON.call(this), {\n text: this.text\n });\n }\n};\n\n// src/lib/XmlCdata.ts\nvar XmlCdata = class extends XmlText {\n get type() {\n return XmlNode.TYPE_CDATA;\n }\n};\n\n// src/lib/XmlComment.ts\nvar XmlComment = class extends XmlNode {\n constructor(content = \"\") {\n super();\n this.content = content;\n }\n get type() {\n return XmlNode.TYPE_COMMENT;\n }\n toJSON() {\n return Object.assign(XmlNode.prototype.toJSON.call(this), {\n content: this.content\n });\n }\n};\n\n// src/lib/XmlDeclaration.ts\nvar XmlDeclaration = class extends XmlNode {\n constructor(version, encoding, standalone) {\n super();\n this.version = version;\n this.encoding = encoding != null ? encoding : null;\n this.standalone = standalone != null ? standalone : null;\n }\n get type() {\n return XmlNode.TYPE_XML_DECLARATION;\n }\n toJSON() {\n let json = XmlNode.prototype.toJSON.call(this);\n json.version = this.version;\n for (let key of [\"encoding\", \"standalone\"]) {\n if (this[key] !== null) {\n json[key] = this[key];\n }\n }\n return json;\n }\n};\n\n// src/lib/XmlElement.ts\nvar XmlElement = class _XmlElement extends XmlNode {\n constructor(name, attributes = /* @__PURE__ */ Object.create(null), children = []) {\n super();\n this.name = name;\n this.attributes = attributes;\n this.children = children;\n }\n /**\n * Whether this element is empty (meaning it has no children).\n */\n get isEmpty() {\n return this.children.length === 0;\n }\n get preserveWhitespace() {\n let node = this;\n while (node instanceof _XmlElement) {\n if (\"xml:space\" in node.attributes) {\n return node.attributes[\"xml:space\"] === \"preserve\";\n }\n node = node.parent;\n }\n return false;\n }\n /**\n * Text content of this element and all its descendants.\n */\n get text() {\n return this.children.map((child) => \"text\" in child ? child.text : \"\").join(\"\");\n }\n get type() {\n return XmlNode.TYPE_ELEMENT;\n }\n toJSON() {\n return Object.assign(XmlNode.prototype.toJSON.call(this), {\n name: this.name,\n attributes: this.attributes,\n children: this.children.map((child) => child.toJSON())\n });\n }\n};\n\n// src/lib/XmlDocument.ts\nvar XmlDocument = class extends XmlNode {\n constructor(children = []) {\n super();\n this.children = children;\n }\n get document() {\n return this;\n }\n /**\n * Root element of this document, or `null` if this document is empty.\n */\n get root() {\n for (let child of this.children) {\n if (child instanceof XmlElement) {\n return child;\n }\n }\n return null;\n }\n /**\n * Text content of this document and all its descendants.\n */\n get text() {\n return this.children.map((child) => \"text\" in child ? child.text : \"\").join(\"\");\n }\n get type() {\n return XmlNode.TYPE_DOCUMENT;\n }\n toJSON() {\n return Object.assign(XmlNode.prototype.toJSON.call(this), {\n children: this.children.map((child) => child.toJSON())\n });\n }\n};\n\n// src/lib/XmlDocumentType.ts\nvar XmlDocumentType = class extends XmlNode {\n constructor(name, publicId, systemId, internalSubset) {\n super();\n this.name = name;\n this.publicId = publicId != null ? publicId : null;\n this.systemId = systemId != null ? systemId : null;\n this.internalSubset = internalSubset != null ? internalSubset : null;\n }\n get type() {\n return XmlNode.TYPE_DOCUMENT_TYPE;\n }\n toJSON() {\n let json = XmlNode.prototype.toJSON.call(this);\n json.name = this.name;\n for (let key of [\"publicId\", \"systemId\", \"internalSubset\"]) {\n if (this[key] !== null) {\n json[key] = this[key];\n }\n }\n return json;\n }\n};\n\n// src/lib/XmlError.ts\nvar XmlError = class extends Error {\n constructor(message, charIndex, xml) {\n let column = 1;\n let excerpt = \"\";\n let line = 1;\n for (let i = 0; i < charIndex; ++i) {\n let char = xml[i];\n if (char === \"\\n\") {\n column = 1;\n excerpt = \"\";\n line += 1;\n } else {\n column += 1;\n excerpt += char;\n }\n }\n let eol = xml.indexOf(\"\\n\", charIndex);\n excerpt += eol === -1 ? xml.slice(charIndex) : xml.slice(charIndex, eol);\n let excerptStart = 0;\n if (excerpt.length > 50) {\n if (column < 40) {\n excerpt = excerpt.slice(0, 50);\n } else {\n excerptStart = column - 20;\n excerpt = excerpt.slice(excerptStart, column + 30);\n }\n }\n super(\n `${message} (line ${line}, column ${column})\n ${excerpt}\n` + \" \".repeat(column - excerptStart + 1) + \"^\\n\"\n );\n this.column = column;\n this.excerpt = excerpt;\n this.line = line;\n this.name = \"XmlError\";\n this.pos = charIndex;\n }\n};\n\n// src/lib/XmlProcessingInstruction.ts\nvar XmlProcessingInstruction = class extends XmlNode {\n constructor(name, content = \"\") {\n super();\n this.name = name;\n this.content = content;\n }\n get type() {\n return XmlNode.TYPE_PROCESSING_INSTRUCTION;\n }\n toJSON() {\n return Object.assign(XmlNode.prototype.toJSON.call(this), {\n name: this.name,\n content: this.content\n });\n }\n};\n\n// src/lib/Parser.ts\nvar emptyString2 = \"\";\nvar Parser = class {\n /**\n * @param xml XML string to parse.\n * @param options Parser options.\n */\n constructor(xml, options = {}) {\n let doc = this.document = new XmlDocument();\n this.j = doc;\n this.g = options;\n this.c = new StringScanner(xml);\n if (this.g.includeOffsets) {\n doc.start = 0;\n doc.end = xml.length;\n }\n this.parse();\n }\n /**\n * Adds the given `XmlNode` as a child of `this.currentNode`.\n */\n i(node, charIndex) {\n node.parent = this.j;\n if (this.g.includeOffsets) {\n node.start = this.c.f(charIndex);\n node.end = this.c.f();\n }\n this.j.children.push(node);\n return true;\n }\n /**\n * Adds the given _text_ to the document, either by appending it to a\n * preceding `XmlText` node (if possible) or by creating a new `XmlText` node.\n *\n * When _normalize_ is `true` (the default), line breaks in _text_ are\n * normalized per section 2.11 of the XML spec. This must be `false` for text\n * that comes from a character or entity reference, since references aren't\n * subject to line break normalization.\n */\n y(text, charIndex, normalize = true) {\n let { children } = this.j;\n let { length } = children;\n if (normalize) {\n text = normalizeLineBreaks(text);\n }\n if (length > 0) {\n let prevNode = children[length - 1];\n if ((prevNode == null ? void 0 : prevNode.type) === XmlNode.TYPE_TEXT) {\n let textNode = prevNode;\n textNode.text += text;\n if (this.g.includeOffsets) {\n textNode.end = this.c.f();\n }\n return true;\n }\n }\n return this.i(new XmlText(text), charIndex);\n }\n /**\n * Consumes element attributes.\n *\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-starttags\n */\n H() {\n let attributes = /* @__PURE__ */ Object.create(null);\n while (this.e()) {\n let attrName = this.q();\n if (!attrName) {\n break;\n }\n let attrValue = this.t() && this.I();\n if (attrValue === false) {\n throw this.a(\"Attribute value expected\");\n }\n if (attrName in attributes) {\n throw this.a(`Duplicate attribute: ${attrName}`);\n }\n if (attrName === \"xml:space\" && attrValue !== \"default\" && attrValue !== \"preserve\") {\n throw this.a('Value of the `xml:space` attribute must be \"default\" or \"preserve\"');\n }\n attributes[attrName] = attrValue;\n }\n if (this.g.sortAttributes) {\n let attrNames = Object.keys(attributes).sort();\n let sortedAttributes = /* @__PURE__ */ Object.create(null);\n for (let i = 0; i < attrNames.length; ++i) {\n let attrName = attrNames[i];\n sortedAttributes[attrName] = attributes[attrName];\n }\n attributes = sortedAttributes;\n }\n return attributes;\n }\n /**\n * Consumes an `AttValue` (attribute value) if possible.\n *\n * @returns\n * Contents of the `AttValue` minus quotes, or `false` if nothing was\n * consumed. An empty string indicates that an `AttValue` was consumed but\n * was empty.\n *\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue\n */\n I() {\n let { c: scanner } = this;\n let quote = scanner.m();\n if (quote !== '\"' && quote !== \"'\") {\n return false;\n }\n scanner.p();\n let chars;\n let isClosed = false;\n let value = emptyString2;\n let regex = quote === '\"' ? attValueCharDoubleQuote : attValueCharSingleQuote;\n matchLoop: while (!scanner.B) {\n chars = scanner.x(regex);\n if (chars) {\n this.o(chars);\n value += chars.replace(attValueNormalizedWhitespace, \" \");\n }\n switch (scanner.m()) {\n case quote:\n isClosed = true;\n break matchLoop;\n case \"&\":\n value += this.C();\n continue;\n case \"<\":\n throw this.a(\"Unescaped `<` is not allowed in an attribute value\");\n default:\n break matchLoop;\n }\n }\n if (!isClosed) {\n throw this.a(\"Unclosed attribute\");\n }\n scanner.p();\n return value;\n }\n /**\n * Consumes a CDATA section if possible.\n *\n * @returns Whether a CDATA section was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-cdata-sect\n */\n J() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n if (!scanner.b(\"<![CDATA[\")) {\n return false;\n }\n let text = scanner.s(\"]]>\");\n this.o(text);\n if (!scanner.b(\"]]>\")) {\n throw this.a(\"Unclosed CDATA section\");\n }\n return this.g.preserveCdata ? this.i(new XmlCdata(normalizeLineBreaks(text)), startIndex) : this.y(text, startIndex);\n }\n /**\n * Consumes character data if possible.\n *\n * @returns Whether character data was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#dt-chardata\n */\n K() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n let charData = scanner.x(endCharData);\n if (!charData) {\n return false;\n }\n this.o(charData);\n if (scanner.m(3) === \"]]>\") {\n throw this.a(\"Element content may not contain the CDATA section close delimiter `]]>`\");\n }\n return this.y(charData, startIndex);\n }\n /**\n * Consumes a comment if possible.\n *\n * @returns Whether a comment was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Comment\n */\n D() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n if (!scanner.b(\"<!--\")) {\n return false;\n }\n let content = scanner.s(\"--\");\n this.o(content);\n if (!scanner.b(\"-->\")) {\n if (scanner.m(2) === \"--\") {\n throw this.a(\"The string `--` isn't allowed inside a comment\");\n }\n throw this.a(\"Unclosed comment\");\n }\n return this.g.preserveComments ? this.i(new XmlComment(normalizeLineBreaks(content)), startIndex) : true;\n }\n /**\n * Consumes a reference in a content context if possible.\n *\n * This differs from `consumeReference()` in that a consumed reference will be\n * added to the document as a text node instead of returned.\n *\n * @returns Whether a reference was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#entproc\n */\n L() {\n let startIndex = this.c.d;\n let ref = this.C();\n return ref ? this.y(ref, startIndex, false) : false;\n }\n /**\n * Consumes a doctype declaration if possible.\n *\n * This is a loose implementation since doctype declarations are currently\n * discarded without further parsing.\n *\n * @returns Whether a doctype declaration was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#dtd\n */\n M() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n if (!scanner.b(\"<!DOCTYPE\")) {\n return false;\n }\n let name = this.e() && this.q();\n if (!name) {\n throw this.a(\"Expected a name\");\n }\n let publicId;\n let systemId;\n if (this.e()) {\n if (scanner.b(\"PUBLIC\")) {\n publicId = this.e() && this.N();\n if (publicId === false) {\n throw this.a(\"Expected a public identifier\");\n }\n this.e();\n }\n if (publicId !== void 0 || scanner.b(\"SYSTEM\")) {\n this.e();\n systemId = this.r();\n if (systemId === false) {\n throw this.a(\"Expected a system identifier\");\n }\n this.e();\n }\n }\n let internalSubset;\n if (scanner.b(\"[\")) {\n internalSubset = scanner.x(/\\][\\x20\\t\\r\\n]*>/);\n if (!scanner.b(\"]\")) {\n throw this.a(\"Unclosed internal subset\");\n }\n this.e();\n }\n if (!scanner.b(\">\")) {\n throw this.a(\"Unclosed doctype declaration\");\n }\n return this.g.preserveDocumentType ? this.i(new XmlDocumentType(name, publicId, systemId, internalSubset), startIndex) : true;\n }\n /**\n * Consumes an element if possible.\n *\n * @returns Whether an element was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-element\n */\n E() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n if (!scanner.b(\"<\")) {\n return false;\n }\n let name = this.q();\n if (!name) {\n scanner.n(startIndex);\n return false;\n }\n let attributes = this.H();\n let isEmpty = !!scanner.b(\"/>\");\n let element = new XmlElement(name, attributes);\n element.parent = this.j;\n if (!isEmpty) {\n if (!scanner.b(\">\")) {\n throw this.a(`Unclosed start tag for element \\`${name}\\``);\n }\n this.j = element;\n do {\n this.K();\n } while (this.E() || this.L() || this.J() || this.F() || this.D());\n let endTagMark = scanner.d;\n let endTagName;\n if (!scanner.b(\"</\") || !(endTagName = this.q()) || endTagName !== name) {\n scanner.n(endTagMark);\n throw this.a(`Missing end tag for element ${name}`);\n }\n this.e();\n if (!scanner.b(\">\")) {\n throw this.a(`Unclosed end tag for element ${name}`);\n }\n this.j = element.parent;\n }\n return this.i(element, startIndex);\n }\n /**\n * Consumes an `Eq` production if possible.\n *\n * @returns Whether an `Eq` production was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Eq\n */\n t() {\n this.e();\n if (this.c.b(\"=\")) {\n this.e();\n return true;\n }\n return false;\n }\n /**\n * Consumes `Misc` content if possible.\n *\n * @returns Whether anything was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Misc\n */\n z() {\n return this.D() || this.F() || this.e();\n }\n /**\n * Consumes one or more `Name` characters if possible.\n *\n * @returns `Name` characters, or an empty string if none were consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name\n */\n q() {\n return isNameStartChar(this.c.m()) ? this.c.w(isNameChar) : emptyString2;\n }\n /**\n * Consumes a processing instruction if possible.\n *\n * @returns Whether a processing instruction was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-pi\n */\n F() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n if (!scanner.b(\"<?\")) {\n return false;\n }\n let name = this.q();\n if (name) {\n if (name.toLowerCase() === \"xml\") {\n scanner.n(startIndex);\n throw this.a(\"XML declaration isn't allowed here\");\n }\n } else {\n throw this.a(\"Invalid processing instruction\");\n }\n if (!this.e()) {\n if (scanner.b(\"?>\")) {\n return this.i(new XmlProcessingInstruction(name), startIndex);\n }\n throw this.a(\"Whitespace is required after a processing instruction name\");\n }\n let content = scanner.s(\"?>\");\n this.o(content);\n if (!scanner.b(\"?>\")) {\n throw this.a(\"Unterminated processing instruction\");\n }\n return this.i(new XmlProcessingInstruction(name, normalizeLineBreaks(content)), startIndex);\n }\n /**\n * Consumes a prolog if possible.\n *\n * @returns Whether a prolog was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd\n */\n O() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n this.P();\n while (this.z()) {\n }\n if (this.M()) {\n while (this.z()) {\n }\n }\n return startIndex < scanner.d;\n }\n /**\n * Consumes a public identifier literal if possible.\n *\n * @returns\n * Value of the public identifier literal minus quotes, or `false` if\n * nothing was consumed. An empty string indicates that a public id literal\n * was consumed but was empty.\n *\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-PubidLiteral\n */\n N() {\n let startIndex = this.c.d;\n let value = this.r();\n if (value !== false && !/^[-\\x20\\r\\na-zA-Z0-9'()+,./:=?;!*#@$_%]*$/.test(value)) {\n this.c.n(startIndex);\n throw this.a(\"Invalid character in public identifier\");\n }\n return value;\n }\n /**\n * Consumes a reference if possible.\n *\n * This differs from `consumeContentReference()` in that a consumed reference\n * will be returned rather than added to the document.\n *\n * @returns\n * Parsed reference value, or `false` if nothing was consumed (to\n * distinguish from a reference that resolves to an empty string).\n *\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Reference\n */\n C() {\n let { c: scanner } = this;\n if (!scanner.b(\"&\")) {\n return false;\n }\n let ref = scanner.w(isReferenceChar);\n if (scanner.G() !== \";\") {\n throw this.a(\"Unterminated reference (a reference must end with `;`)\");\n }\n let parsedValue;\n if (ref[0] === \"#\") {\n let codePoint = ref[1] === \"x\" ? parseInt(ref.slice(2), 16) : parseInt(ref.slice(1), 10);\n if (isNaN(codePoint)) {\n throw this.a(\"Invalid character reference\");\n }\n if (!isXmlCodePoint(codePoint)) {\n throw this.a(\"Character reference resolves to an invalid character\");\n }\n parsedValue = String.fromCodePoint(codePoint);\n } else {\n parsedValue = predefinedEntities[ref];\n if (parsedValue === void 0) {\n let {\n ignoreUndefinedEntities,\n resolveUndefinedEntity\n } = this.g;\n let wrappedRef = `&${ref};`;\n if (resolveUndefinedEntity) {\n let resolvedValue = resolveUndefinedEntity(wrappedRef);\n if (resolvedValue !== null && resolvedValue !== void 0) {\n let type = typeof resolvedValue;\n if (type !== \"string\") {\n throw new TypeError(`\\`resolveUndefinedEntity()\\` must return a string, \\`null\\`, or \\`undefined\\`, but returned a value of type ${type}`);\n }\n return resolvedValue;\n }\n }\n if (ignoreUndefinedEntities) {\n return wrappedRef;\n }\n scanner.n(-wrappedRef.length);\n throw this.a(`Named entity isn't defined: ${wrappedRef}`);\n }\n }\n return parsedValue;\n }\n /**\n * Consumes a `SystemLiteral` if possible.\n *\n * A `SystemLiteral` is similar to an attribute value, but allows the\n * characters `<` and `&` and doesn't replace references.\n *\n * @returns\n * Value of the `SystemLiteral` minus quotes, or `false` if nothing was\n * consumed. An empty string indicates that a `SystemLiteral` was consumed\n * but was empty.\n *\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-SystemLiteral\n */\n r() {\n let { c: scanner } = this;\n let quote = scanner.b('\"') || scanner.b(\"'\");\n if (!quote) {\n return false;\n }\n let value = scanner.s(quote);\n this.o(value);\n if (!scanner.b(quote)) {\n throw this.a(\"Missing end quote\");\n }\n return value;\n }\n /**\n * Consumes one or more whitespace characters if possible.\n *\n * @returns Whether any whitespace characters were consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#white\n */\n e() {\n return !!this.c.w(isWhitespace);\n }\n /**\n * Consumes an XML declaration if possible.\n *\n * @returns Whether an XML declaration was consumed.\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-XMLDecl\n */\n P() {\n let { c: scanner } = this;\n let startIndex = scanner.d;\n if (!scanner.b(\"<?xml\")) {\n return false;\n }\n if (!this.e()) {\n throw this.a(\"Invalid XML declaration\");\n }\n let version = !!scanner.b(\"version\") && this.t() && this.r();\n if (version === false) {\n throw this.a(\"XML version is missing or invalid\");\n } else if (!/^1\\.[0-9]+$/.test(version)) {\n throw this.a(\"Invalid character in version number\");\n }\n let encoding;\n let standalone;\n if (this.e()) {\n encoding = !!scanner.b(\"encoding\") && this.t() && this.r();\n if (encoding) {\n if (!/^[A-Za-z][\\w.-]*$/.test(encoding)) {\n throw this.a(\"Invalid character in encoding name\");\n }\n this.e();\n }\n standalone = !!scanner.b(\"standalone\") && this.t() && this.r();\n if (standalone) {\n if (standalone !== \"yes\" && standalone !== \"no\") {\n throw this.a('Only \"yes\" and \"no\" are permitted as values of `standalone`');\n }\n this.e();\n }\n }\n if (!scanner.b(\"?>\")) {\n throw this.a(\"Invalid or unclosed XML declaration\");\n }\n return this.g.preserveXmlDeclaration ? this.i(new XmlDeclaration(\n version,\n encoding || void 0,\n standalone || void 0\n ), startIndex) : true;\n }\n /**\n * Returns an `XmlError` for the current scanner position.\n */\n a(message) {\n let { c: scanner } = this;\n return new XmlError(message, scanner.d, scanner.h);\n }\n /**\n * Parses the XML input.\n */\n parse() {\n this.c.b(\"\\uFEFF\");\n this.O();\n if (!this.E()) {\n throw this.a(\"Root element is missing or invalid\");\n }\n while (this.z()) {\n }\n if (!this.c.B) {\n throw this.a(\"Extra content at the end of the document\");\n }\n }\n /**\n * Throws an invalid character error if any character in the given _string_\n * isn't a valid XML character.\n */\n o(string) {\n let { length } = string;\n for (let i = 0; i < length; ++i) {\n let cp = string.codePointAt(i);\n if (!isXmlCodePoint(cp)) {\n this.c.n(-([...string].length - i));\n throw this.a(\"Invalid character\");\n }\n if (cp > 65535) {\n i += 1;\n }\n }\n }\n};\nfunction normalizeLineBreaks(text) {\n let i = 0;\n while ((i = text.indexOf(\"\\r\", i)) !== -1) {\n text = text[i + 1] === \"\\n\" ? text.slice(0, i) + text.slice(i + 1) : text.slice(0, i) + \"\\n\" + text.slice(i + 1);\n }\n return text;\n}\n\n// src/index.ts\nfunction parseXml(xml, options) {\n return new Parser(xml, options).document;\n}\n//# sourceMappingURL=browser.js.map\n","import { BaerlyError } from \"@baerly/protocol\";\nimport { parseXml, type XmlDocument, type XmlElement, type XmlText } from \"@rgrove/parse-xml\";\n\n/**\n * Subset of S3's `ListObjectsV2CommandOutput` produced by\n * {@link parseListObjectsV2CommandOutput}. Field names mirror the\n * S3 REST API exactly (PascalCase) so the parser stays a thin shape\n * over the wire format.\n */\nexport interface ParsedListObjectsV2Output {\n Contents?: Array<{ ETag?: string; Key?: string; LastModified?: Date; Generation?: string }>;\n NextContinuationToken?: string;\n}\n\n/**\n * `<Code>` / `<Message>` extracted from an S3\n * `<Error>…</Error>` response body by {@link parseS3Error}. Field\n * names mirror the S3 REST API (PascalCase), matching the convention\n * of {@link ParsedListObjectsV2Output}.\n */\nexport interface ParsedS3Error {\n Code?: string;\n Message?: string;\n}\n\n// --- parse-xml helpers ---\n\n// Strip any namespace prefix: \"s3:Contents\" -> \"Contents\", \"Contents\" -> \"Contents\".\n// The `includes(\":\")` guard makes the `split(\":\")[1]!` non-null assertion safe.\nconst localName = (name: string): string => (name.includes(\":\") ? name.split(\":\")[1]! : name);\n\n// Type predicates narrowing an XmlNode child to a concrete node class.\n// @rgrove/parse-xml types the `type` discriminant as `string` (not a string\n// literal), so `node.type === \"element\"` does NOT narrow the child union on its\n// own. These localize the one unavoidable assertion behind a checked predicate\n// instead of scattering `as XmlElement` / `as XmlText` casts at each use site.\nconst isElement = (node: XmlElement[\"children\"][number]): node is XmlElement =>\n node.type === \"element\";\nconst isText = (node: XmlElement[\"children\"][number]): node is XmlText => node.type === \"text\";\n\n// Return the first XmlElement child of a document or element whose local name\n// (after any namespace prefix) matches `name`. This makes traversal\n// namespace-agnostic: both `<Error>` and `<ns:Error>` match name \"Error\".\nconst child = (el: XmlElement, name: string): XmlElement | undefined => {\n for (const node of el.children) {\n if (isElement(node) && localName(node.name) === name) {\n return node;\n }\n }\n return undefined;\n};\n\n// Concatenate the direct text child node text values of an element.\n// @rgrove/parse-xml resolves the 5 predefined XML entities (&amp; &lt; &gt;\n// &quot; &apos;) and decimal/hex numeric character references (e.g. Minio's\n// &#34; ETags) by default. Under the default `preserveCdata: false` (which is\n// how we call parseXml), any CDATA section is merged into the element's adjacent\n// text nodes and surfaces as an XmlText (type \"text\"), so the \"text\" branch\n// captures it — there is never a standalone \"cdata\" node. Entities inside a\n// CDATA section are NOT decoded (CDATA is literal), which is the correct S3\n// behavior. We intentionally do NOT decode HTML named entities (&nbsp; etc.) —\n// S3 wire data is XML, not HTML, so this is more spec-correct.\nconst textOf = (el: XmlElement | undefined): string | undefined => {\n if (el === undefined) {\n return undefined;\n }\n let result = \"\";\n for (const node of el.children) {\n if (isText(node)) {\n result += node.text;\n }\n }\n return result === \"\" ? undefined : result;\n};\n\n// Return the first-element-child of an XmlDocument. Unlike `XmlDocument.root`\n// (which is an XmlElement | null getter), this avoids potential null handling\n// confusion by returning undefined on an empty document.\nconst docRoot = (doc: XmlDocument): XmlElement | undefined => doc.root ?? undefined;\n\n// The list request sets `encoding-type=url`, so S3 URL-encodes the **key\n// family only** (Key/Prefix/Delimiter/StartAfter) in the response,\n// including spaces as `+`. Use this to reverse both steps. Do NOT apply it\n// to ETag or NextContinuationToken — S3 leaves those verbatim, and a\n// continuation token routinely contains literal `+` that the `.replace`\n// step would mangle into a space (corrupting pagination on large buckets).\nconst xmlVal = (el: XmlElement | undefined, name: string): string | undefined => {\n const v = el !== undefined ? textOf(child(el, name)) : undefined;\n if (v === undefined || v === \"\") {\n return undefined;\n }\n // A well-formed encoding-type=url response only ever contains valid\n // percent-escapes. A bare `%` or an invalid pair (`%ZZ`) makes\n // decodeURIComponent throw a raw URIError — catch it and re-raise as a\n // typed BaerlyError so the storage layer surfaces a catchable error rather\n // than an unhandled runtime exception. See docs/spec/s3-xml-escaping-cases.md.\n try {\n return decodeURIComponent(v.replace(/\\+/g, \" \"));\n } catch {\n throw new BaerlyError(\"InvalidResponse\", `Malformed percent-escape in S3 <${name}>: ${v}`);\n }\n};\n\n// Read a field verbatim. Used for everything S3 does NOT URL-encode:\n// error-body `Code`/`Message`, list `ETag`/`LastModified`, and\n// `NextContinuationToken` — running any of these through `xmlVal`'s\n// `decodeURIComponent` / `+`→space would corrupt literal `+` and `%`.\nconst rawXmlVal = (el: XmlElement | undefined, name: string): string | undefined => {\n return el !== undefined ? textOf(child(el, name)) : undefined;\n};\n\n/**\n * Build a {@link ParsedS3Error} from the element that directly carries\n * the `<Code>` / `<Message>` children — `<Error>` for S3, the inner\n * `<Error>` for STS. Returns `undefined` when neither child is present\n * so callers can fall back to the raw status. Shared by\n * {@link parseS3Error} and {@link parseStsError}, which differ only in\n * how they locate that element.\n */\nconst codeMessageFrom = (el: XmlElement): ParsedS3Error | undefined => {\n const code = rawXmlVal(el, \"Code\");\n const message = rawXmlVal(el, \"Message\");\n if (code === undefined && message === undefined) {\n return undefined;\n }\n return {\n ...(code !== undefined && { Code: code }),\n ...(message !== undefined && { Message: message }),\n };\n};\n\n/**\n * Parse an S3 `<Error><Code>…</Code><Message>…</Message></Error>`\n * body. Returns `undefined` when the body is not a recognizable S3\n * error document (empty, HTML, a success payload, or a DTD), so\n * callers can fall back to the raw response text. This never throws:\n * it runs on a path that is already reporting an error.\n */\nexport const parseS3Error = (xml: string): ParsedS3Error | undefined => {\n // Skip non-error bodies; refuse DTDs before parsing — see the DTD-guard\n // note above parseListObjectsV2CommandOutput.\n if (!/<Error\\b/i.test(xml) || /<!DOCTYPE\\b/i.test(xml)) {\n return undefined;\n }\n let root: XmlElement | undefined;\n try {\n root = docRoot(parseXml(xml));\n } catch {\n return undefined;\n }\n // The root element must be <Error> (possibly namespace-prefixed).\n if (root === undefined) {\n return undefined;\n }\n if (localName(root.name) !== \"Error\") {\n return undefined;\n }\n return codeMessageFrom(root);\n};\n\n/**\n * Parse an STS `<ErrorResponse><Error><Code>…</Code><Message>…</Message>\n * </Error></ErrorResponse>` body (the shape STS returns on a failed\n * `AssumeRoleWithWebIdentity` — e.g. `InvalidIdentityToken`,\n * `ExpiredTokenException`, `AccessDenied`). Returns `undefined` when the body\n * is not a recognizable STS error document (empty, HTML, a success payload, or\n * a DTD), so callers can fall back to the bare status. Like {@link parseS3Error}\n * this never throws — it runs on a path that is already reporting an error.\n *\n * Note the nesting differs from S3: STS wraps `<Error>` inside `<ErrorResponse>`.\n */\nexport const parseStsError = (xml: string): ParsedS3Error | undefined => {\n if (!/<Error\\b/i.test(xml) || /<!DOCTYPE\\b/i.test(xml)) {\n return undefined;\n }\n let root: XmlElement | undefined;\n try {\n root = docRoot(parseXml(xml));\n } catch {\n return undefined;\n }\n if (root === undefined) {\n return undefined;\n }\n // STS wraps <Error> inside <ErrorResponse>; locate the inner <Error> child.\n const errorEl = child(root, \"Error\");\n if (errorEl === undefined) {\n return undefined;\n }\n return codeMessageFrom(errorEl);\n};\n\n/**\n * `<Credentials>` extracted from an STS\n * `<AssumeRoleWithWebIdentityResponse>` body by\n * {@link parseAssumeRoleWithWebIdentity}. Field names mirror the STS REST\n * API (PascalCase), matching the convention of {@link ParsedS3Error}.\n */\nexport interface ParsedWebIdentityCredentials {\n AccessKeyId?: string;\n SecretAccessKey?: string;\n SessionToken?: string;\n Expiration?: string;\n}\n\n/**\n * Parse an STS `AssumeRoleWithWebIdentity` success body, returning the\n * `<Credentials>` block. Reuses the hardened, DTD-guarded parser;\n * throws `InvalidResponse` on a DTD or unparseable XML. Missing fields come\n * back `undefined` so the caller can map them to its own `InvalidResponse`.\n *\n * Unlike {@link parseListObjectsV2CommandOutput}, the error on unparseable\n * XML must NOT echo the body: a success-shaped STS body carries the plaintext\n * `SecretAccessKey`/`SessionToken`, so folding it into a thrown-then-logged\n * error would leak live credentials.\n */\nexport const parseAssumeRoleWithWebIdentity = (xml: string): ParsedWebIdentityCredentials => {\n if (/<!DOCTYPE\\b/i.test(xml)) {\n throw new BaerlyError(\"InvalidResponse\", \"DTD not allowed in STS XML responses\");\n }\n let root: XmlElement | undefined;\n try {\n root = docRoot(parseXml(xml));\n } catch {\n // No body in the message — see the note above; it may contain live creds.\n throw new BaerlyError(\"InvalidResponse\", \"unparseable STS credentials response\");\n }\n // Traverse: <AssumeRoleWithWebIdentityResponse>\n // <AssumeRoleWithWebIdentityResult>\n // <Credentials>\n const resultEl = root !== undefined ? child(root, \"AssumeRoleWithWebIdentityResult\") : undefined;\n const credsEl = resultEl !== undefined ? child(resultEl, \"Credentials\") : undefined;\n return {\n AccessKeyId: rawXmlVal(credsEl, \"AccessKeyId\"),\n SecretAccessKey: rawXmlVal(credsEl, \"SecretAccessKey\"),\n SessionToken: rawXmlVal(credsEl, \"SessionToken\"),\n Expiration: rawXmlVal(credsEl, \"Expiration\"),\n };\n};\n\n// `new Date(badString)` yields an Invalid Date (a non-null Date whose\n// getTime() is NaN) rather than throwing — surface `undefined` for a\n// malformed `LastModified` so it never leaks into a `StorageListEntry`.\n// GC then falls back to `now()` for the tombstone `due_at` anchor.\nconst parseLastModified = (lm: string | undefined): Date | undefined => {\n if (lm === undefined) {\n return undefined;\n }\n const d = new Date(lm);\n return Number.isNaN(d.getTime()) ? undefined : d;\n};\n\n// DTD guard: reject any DOCTYPE before @rgrove/parse-xml sees the bytes. S3/R2/\n// MinIO/GCS never emit a DOCTYPE here, so one is always a bug or an attack —\n// this defangs the DOCTYPE entity vectors (XXE, billion-laughs, the\n// CVE-2026-25896 entity-shadow). @rgrove/parse-xml is safe-by-design (refuses\n// DTD entity definitions), but the regex guard is parser-independent\n// defense-in-depth and independently covers the entity-expansion CVE class.\nexport const parseListObjectsV2CommandOutput = (xml: string): ParsedListObjectsV2Output => {\n if (/<!DOCTYPE\\b/i.test(xml)) {\n throw new BaerlyError(\"InvalidResponse\", \"DTD not allowed in S3 XML responses\");\n }\n let root: XmlElement | undefined;\n try {\n root = docRoot(parseXml(xml));\n } catch {\n throw new BaerlyError(\"InvalidResponse\", `Invalid XML: ${xml}`);\n }\n if (root === undefined) {\n return {};\n }\n // The root element must be <ListBucketResult> (possibly namespace-prefixed).\n // This restores main's `result.ListBucketResult ?? {}` structural guard and\n // matches the sibling error parsers' root checks: a non-list body returns {}.\n if (localName(root.name) !== \"ListBucketResult\") {\n return {};\n }\n // Force-array for Contents: collect all direct <Contents> element children.\n // This replaces the old `isArray: (name) => name === \"Contents\"` config.\n // Namespace-agnostic (matches `child()`), so `<s3:Contents>` also collects.\n const contentEls = root.children\n .filter(isElement)\n .filter((c) => localName(c.name) === \"Contents\");\n\n return {\n Contents: contentEls.map((contentEl) => {\n return {\n ETag: rawXmlVal(contentEl, \"ETag\"),\n Key: xmlVal(contentEl, \"Key\"),\n LastModified: parseLastModified(rawXmlVal(contentEl, \"LastModified\")),\n // GCS's list XML carries a `<Generation>` element per object (its\n // opaque version token) that S3/R2 never emit — undefined there, so\n // this is inert for the S3 path. `GcsHttpStorage.list` prefers it as\n // the entry etag so a list etag equals the generation `get`/`put`\n // return, matching the universal list-etag == version-token contract.\n Generation: rawXmlVal(contentEl, \"Generation\"),\n };\n }),\n NextContinuationToken: rawXmlVal(root, \"NextContinuationToken\"),\n };\n};\n","import {\n BaerlyError,\n RETRY_AFTER_MAX_SECONDS,\n S3_REQUEST_MAX_RETRIES,\n delay,\n} from \"@baerly/protocol\";\nimport { parseS3Error } from \"./xml.ts\";\n\n/**\n * Permanent {@link BaerlyError} codes that must short-circuit `retry`.\n * These represent caller- or environment-level faults where retrying\n * cannot succeed: `AccessDenied` (403 — credentials/policy),\n * `InvalidConfig` (bad bucket / unsupported credential type),\n * `InvalidResponse` (server returned unparseable data), and\n * `Conflict` (CAS guard lost — retrying would just re-lose against\n * the same state). `NetworkError` is intentionally absent — it covers\n * transient transport faults and stays retryable.\n *\n * Transport-layer set, distinct from `RETRIABLE_CODES` in `@baerly/protocol`'s\n * `errors.ts` (the default wire `retriable` hint). `Conflict` is \"permanent\"\n * here (a blind re-PUT re-loses the CAS race) yet retryable for logical CAS\n * callers that can fresh-read + re-apply. Same code, two different questions.\n */\nconst PERMANENT_ERROR_CODES: ReadonlySet<string> = new Set([\n \"AccessDenied\",\n \"InvalidConfig\",\n \"InvalidResponse\",\n \"Conflict\",\n]);\n\n/**\n * Parse an HTTP `Retry-After` header into a non-negative seconds value,\n * clamped to {@link RETRY_AFTER_MAX_SECONDS}. Returns `undefined` if\n * the header is absent, malformed, or whitespace.\n *\n * RFC 7231 §7.1.3 admits two forms: delta-seconds (non-negative\n * integer) and HTTP-date. Both are accepted; dates in the past return\n * `0`. Fractional seconds, negatives, and arbitrary strings reject.\n *\n * The `now` injection point exists for the unit test; production\n * callers should pass nothing.\n */\nexport function parseRetryAfter(\n header: string | null,\n now: () => number = Date.now,\n): number | undefined {\n if (header === null) {\n return undefined;\n }\n const trimmed = header.trim();\n if (trimmed === \"\") {\n return undefined;\n }\n if (/^\\d+$/.test(trimmed)) {\n const n = Number.parseInt(trimmed, 10);\n return Number.isFinite(n) ? Math.min(n, RETRY_AFTER_MAX_SECONDS) : undefined;\n }\n // RFC 7231 §7.1.1.1 HTTP-date formats (IMF-fixdate, RFC 850, asctime)\n // all contain alphabetic month/day-of-week tokens. Gating on a letter\n // avoids V8's lenient `Date.parse` accepting things like \"5.5\".\n if (!/[a-z]/i.test(trimmed)) {\n return undefined;\n }\n const t = Date.parse(trimmed);\n if (Number.isNaN(t)) {\n return undefined;\n }\n const seconds = Math.max(0, Math.ceil((t - now()) / 1000));\n return Math.min(seconds, RETRY_AFTER_MAX_SECONDS);\n}\n\nexport const retryAfterCause = (res: Response): { retryAfterSeconds?: number } => {\n const hint = parseRetryAfter(res.headers.get(\"Retry-After\"));\n return hint !== undefined ? { retryAfterSeconds: hint } : {};\n};\n\n// Detail suffix for a non-status-mapped XML error response (S3 and GCS's\n// native XML API share the same `<Error><Code>…</Error>` body shape). When\n// the body is a parseable document, surface the store's own error code (and\n// message) instead of concatenating the raw XML blob into the thrown\n// message; otherwise fall back to the raw text.\nexport const xmlErrorDetail = (status: number, body: string): string => {\n const parsed = parseS3Error(body);\n if (parsed !== undefined) {\n const code = parsed.Code ?? \"UnknownError\";\n return parsed.Message !== undefined\n ? `${status} ${code}: ${parsed.Message}`\n : `${status} ${code}`;\n }\n return `${status} ${body}`;\n};\n\n/**\n * Shared status→{@link BaerlyError} mapping for the S3/GCS XML adapters, so\n * the retryable set (`429`/`≥500`) can't drift between them. Store-specific\n * statuses (GCS `412`; S3 `409`/`404`-with-`If-Match`) are handled inline\n * first; the rest route here: `403`→AccessDenied (permanent), `429`/`≥500`→\n * retryable NetworkError carrying `{status, retryAfterSeconds?}`, else\n * InvalidResponse. Callers `throw` the result; consumes `res.text()` on the\n * non-`403` paths.\n */\nexport const mapStorageError = async (\n res: Response,\n verb: string,\n key: string,\n): Promise<BaerlyError> => {\n if (res.status === 403) {\n return new BaerlyError(\"AccessDenied\", `${verb} ${key}: 403`);\n }\n if (res.status === 429 || res.status >= 500) {\n return new BaerlyError(\"NetworkError\", `${verb} ${key}: ${res.status} ${await res.text()}`, {\n status: res.status,\n ...retryAfterCause(res),\n });\n }\n return new BaerlyError(\n \"InvalidResponse\",\n `${verb} ${key}: ${xmlErrorDetail(res.status, await res.text())}`,\n );\n};\n\nexport const retry = async <T>(\n fn: () => Promise<T>,\n { retries = S3_REQUEST_MAX_RETRIES, backoffMs = 100, maxDelayMs = 10_000 } = {},\n): Promise<T> => {\n let wait = backoffMs;\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await fn();\n } catch (error) {\n if (error instanceof BaerlyError && PERMANENT_ERROR_CODES.has(error.code)) {\n throw error;\n }\n if (attempt === retries) {\n throw error;\n }\n const hintMs = retryAfterHintMs(error, maxDelayMs);\n await delay(hintMs ?? wait);\n if (hintMs === undefined) {\n wait = Math.min(wait * 1.5, maxDelayMs);\n } else {\n // A server-driven pause is new information about server state;\n // reset the exponential ladder so a subsequent non-hinted\n // transient starts fresh from `backoffMs`.\n wait = backoffMs;\n }\n }\n }\n throw new BaerlyError(\n \"Internal\",\n \"http-transport retry loop exited without returning or throwing\",\n );\n};\n\nconst retryAfterHintMs = (e: unknown, maxDelayMs: number): number | undefined => {\n if (!(e instanceof BaerlyError)) {\n return undefined;\n }\n const cause = e.cause as { retryAfterSeconds?: number } | undefined;\n if (cause?.retryAfterSeconds === undefined) {\n return undefined;\n }\n return Math.min(cause.retryAfterSeconds * 1000, maxDelayMs);\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;CAEA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;EAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAK,CAAC;CAChE;CACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;EAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS;QACjD,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;GAAW,CAAC;EAAA;EAEvH,OAAO;CACT;CACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;CAGzF,IAAI,cAAc,CAAC;CACnB,SAA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AI,IAAI,IAAI,OAAO,GAAG,MAAM,IAAI,KAAK,KAAK;EAC1F,QAAQ,IAAI;EACZ,GAAG,gBAAgB,GAAG;CACxB,CAAC;CAEH,OAAO,IAAI,YACT,mBACA,GAAG,KAAK,GAAG,IAAI,IAAI,eAAe,IAAI,QAAQ,MAAM,IAAI,KAAK,CAAC,GAChE;AACF;AAEA,MAAa,QAAQ,OACnB,IACA,EAAE,UAAA,GAAkC,YAAY,KAAK,aAAa,QAAW,CAAC,MAC/D;CACf,IAAI,OAAO;CACX,KAAK,IAAI,UAAU,GAAG,WAAW,SAAS,WACxC,IAAI;EACF,OAAO,MAAM,GAAG;CAClB,SAAS,OAAO;EACd,IAAI,iBAAiB,eAAe,sBAAsB,IAAI,MAAM,IAAI,GACtE,MAAM;EAER,IAAI,YAAY,SACd,MAAM;EAER,MAAM,SAAS,iBAAiB,OAAO,UAAU;EACjD,MAAM,MAAM,UAAU,IAAI;EAC1B,IAAI,WAAW,KAAA,GACb,OAAO,KAAK,IAAI,OAAO,KAAK,UAAU;OAKtC,OAAO;CAEX;CAEF,MAAM,IAAI,YACR,YACA,gEACF;AACF;AAEA,MAAM,oBAAoB,GAAY,eAA2C;CAC/E,IAAI,EAAE,aAAa,cACjB;CAEF,MAAM,QAAQ,EAAE;CAChB,IAAI,OAAO,sBAAsB,KAAA,GAC/B;CAEF,OAAO,KAAK,IAAI,MAAM,oBAAoB,KAAM,UAAU;AAC5D"}
@@ -1,162 +0,0 @@
1
- import { d as IndexDefinition, f as DocumentData, n as BaerlyAppConfig, r as BaerlyConfig, u as SchemaValidator, v as SNAPSHOT_SCHEMA_VERSION } from "./app-config-DyiFK3_k.js";
2
- import { n as LogEntry, p as Storage, r as Verifier } from "./index-CEZKQsKt.js";
3
- //#region packages/server/src/config.d.ts
4
- /**
5
- * Flatten `BaerlyConfig.collections` into the per-collection
6
- * `schemas` and `indexes` maps that {@link Db.create} consumes at
7
- * runtime. Used by the Cloudflare and Node adapters to pipe a
8
- * single `config` object through to the writer/planner.
9
- *
10
- * Both adapters import this helper rather than inlining the loop
11
- * so the projection rule (drop empty index arrays; omit absent
12
- * schemas) stays in one place. Future `CollectionDefinition`
13
- * fields (lifecycle hooks, replica_identity) land here too.
14
- */
15
- declare const collectionsToMaps: (collections: BaerlyConfig["collections"] | undefined) => {
16
- schemas: ReadonlyMap<string, SchemaValidator>;
17
- indexes: ReadonlyMap<string, ReadonlyArray<IndexDefinition>>;
18
- };
19
- //#endregion
20
- //#region packages/server/src/auth/internal/resolve-verifier.d.ts
21
- /**
22
- * Read env var lazily via a host-supplied accessor so the same
23
- * resolver works in CF Workers (env binding) and Node
24
- * (`process.env`). Returns `undefined` for an unset OR empty string —
25
- * both branches mean "operator forgot to set it".
26
- */
27
- type EnvAccessor = (name: string) => string | undefined;
28
- /**
29
- * Inputs to {@link resolveVerifier}. `factoryVerifier` is the
30
- * adapter-factory `verifier:` option (may be undefined). `config`
31
- * carries the typed `auth` posture + the `tenant` pin. `readEnv`
32
- * is the per-host env accessor.
33
- */
34
- interface ResolveVerifierInput {
35
- readonly factoryVerifier: Verifier | undefined;
36
- readonly config: BaerlyAppConfig;
37
- readonly readEnv: EnvAccessor;
38
- }
39
- /**
40
- * Resolve the per-request `Verifier` for an adapter factory using the
41
- * fixed order:
42
- *
43
- * 1. `factoryVerifier` set → use as-is (highest precedence; enables
44
- * env-aware construction via `cloudflareAccess(env)` etc).
45
- * 2. else `config.auth === "shared-secret"` → read `SHARED_SECRET`
46
- * via `readEnv`; throw `BaerlyError("InvalidConfig",
47
- * SHARED_SECRET_MISSING_MESSAGE)` when unset/empty; else build
48
- * `sharedSecret({ secret, tenantPrefix: config.tenant })`.
49
- * 3. else `config.auth === "none"` → `noAuthVerifier(config.tenant)`.
50
- * 4. else → throw `BaerlyError("InvalidConfig",
51
- * NO_AUTH_CONFIGURED_MESSAGE)`.
52
- *
53
- * Pure function — no I/O, no side effects beyond `sharedSecret`'s
54
- * own validation. Caller invokes once at adapter init time (or on
55
- * first fetch, depending on platform `await`-at-top-level
56
- * constraints).
57
- *
58
- * @throws BaerlyError code="InvalidConfig" — branches 2 and 4 above.
59
- *
60
- * @internal
61
- */
62
- declare const resolveVerifier: (input: ResolveVerifierInput) => Verifier;
63
- //#endregion
64
- //#region packages/server/src/snapshot.d.ts
65
- /**
66
- * Build the on-bucket key for a snapshot file. `sha256` must be the
67
- * lowercase hex digest of the canonical body
68
- * ({@link encodeSnapshotBody}); the filename embeds it so a crashed
69
- * mid-PUT body that doesn't match its own filename hash is rejected
70
- * by readers as "missing."
71
- *
72
- * @throws BaerlyError code="InvalidConfig" — `minSeq`/`maxSeq` are
73
- * out of range or `sha256` is not 64 hex chars.
74
- */
75
- declare const snapshotKey: (collectionPrefix: string, minSeq: number, maxSeq: number, sha256: string) => string;
76
- /**
77
- * On-bucket body of a snapshot file. The reader recomputes the SHA-256
78
- * over the canonical serialisation ({@link encodeSnapshotBody}) and
79
- * rejects any mismatch with the filename hash.
80
- *
81
- * `docs` is sorted by `_id` for deterministic byte output — two
82
- * compactions over the same fold produce byte-identical snapshots,
83
- * which means same filename, which means an idempotent re-run never
84
- * leaves an orphan.
85
- */
86
- interface SnapshotBody {
87
- readonly schema_version: typeof SNAPSHOT_SCHEMA_VERSION;
88
- readonly min_seq: number;
89
- readonly max_seq: number;
90
- readonly collection: string;
91
- readonly docs: ReadonlyArray<{
92
- readonly _id: string;
93
- readonly body: DocumentData;
94
- }>;
95
- }
96
- /**
97
- * Canonical byte encoding of a {@link SnapshotBody}. Only the
98
- * compactor produces snapshots, and only this function does the
99
- * serialisation — so the byte output is deterministic for a given
100
- * `SnapshotBody` (identical input ⇒ identical bytes ⇒ identical
101
- * filename hash).
102
- */
103
- declare const encodeSnapshotBody: (s: SnapshotBody) => Uint8Array;
104
- /**
105
- * Load a snapshot file as a `Map<_id, DocumentData>`. Verifies the
106
- * body hash against the filename, checks the schema version, and
107
- * cross-checks `body.collection` against the caller's expectation.
108
- *
109
- * @example
110
- * ```ts
111
- * import { loadSnapshotAsMap } from "@gusto/baerly-storage";
112
- *
113
- * const map =
114
- * srcCurrent.snapshot === null
115
- * ? new Map<string, DocumentData>()
116
- * : await loadSnapshotAsMap(src.storage, srcCurrent.snapshot, "tickets");
117
- * ```
118
- *
119
- * @throws BaerlyError code="Internal" — pointer resolves to no body,
120
- * or the body's SHA-256 doesn't match the hash embedded in the
121
- * filename. (Protocol invariant violation; a corrupted snapshot
122
- * the reader cannot continue past.)
123
- * @throws BaerlyError code="InvalidResponse" — body isn't valid JSON,
124
- * isn't an object, has an unsupported `schema_version`, or carries a
125
- * `collection` that doesn't match `expectedCollection`.
126
- */
127
- declare const loadSnapshotAsMap: (storage: Storage, key: string, expectedCollection: string, signal?: AbortSignal) => Promise<Map<string, DocumentData>>;
128
- //#endregion
129
- //#region packages/server/src/log-walk.d.ts
130
- /**
131
- * Walk `[fromSeq, toSeqExclusive)` of `${logPrefix}/log/<seq>.json`
132
- * in chunks of {@link MAX_PARALLEL_LOG_READS} concurrent GETs.
133
- * Returns the materialised entries in seq order.
134
- *
135
- * Empty range (`fromSeq >= toSeqExclusive`) returns `[]` and issues
136
- * zero GETs.
137
- *
138
- * Same error semantics as {@link readLogEntry}: a missing entry
139
- * throws `Internal`, a malformed body throws `InvalidResponse`.
140
- */
141
- declare const walkLogRange: (storage: Storage, logPrefix: string, fromSeq: number, toSeqExclusive: number, opts?: {
142
- signal?: AbortSignal;
143
- }) => Promise<LogEntry[]>;
144
- //#endregion
145
- //#region packages/server/src/log-tail.d.ts
146
- /**
147
- * Discover the true committed tail and fold entries in `[hint, tail)`.
148
- * `tail` is the first empty seq (>= hint); `entries` are the
149
- * LogEntries in `[hint, tail)` in seq order. `cap` bounds the walk;
150
- * exhausting it THROWS `Internal` (never silently truncates) — see
151
- * the cap-exhaustion comment below.
152
- */
153
- declare const probeTailFrom: (storage: Storage, logPrefix: string, hint: number, opts?: {
154
- signal?: AbortSignal;
155
- cap?: number;
156
- }) => Promise<{
157
- tail: number;
158
- entries: LogEntry[];
159
- }>;
160
- //#endregion
161
- export { loadSnapshotAsMap as a, collectionsToMaps as c, encodeSnapshotBody as i, walkLogRange as n, snapshotKey as o, SnapshotBody as r, resolveVerifier as s, probeTailFrom as t };
162
- //# sourceMappingURL=index-BHz92Acj.d.ts.map