@astrogate/sdk 0.0.0-stage → 0.1.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 (440) hide show
  1. package/README.md +6 -2
  2. package/THIRD_PARTY_NOTICES.md +17 -0
  3. package/dist/browser.d.ts +85 -0
  4. package/dist/browser.js +16 -0
  5. package/dist/database-binding.d.ts +7 -0
  6. package/dist/database-binding.js +11 -0
  7. package/dist/hosted-session.d.ts +1 -0
  8. package/dist/hosted-session.js +11 -0
  9. package/dist/http.d.ts +24 -0
  10. package/dist/http.js +92 -0
  11. package/dist/inventory.d.ts +7 -0
  12. package/dist/inventory.js +18 -0
  13. package/dist/management-read.d.ts +17 -0
  14. package/dist/management-read.js +104 -0
  15. package/dist/management.d.ts +347 -0
  16. package/dist/management.js +137 -0
  17. package/dist/operator.d.ts +136 -0
  18. package/dist/operator.js +53 -0
  19. package/dist/react.d.ts +16 -0
  20. package/dist/react.js +10 -0
  21. package/dist/server.d.ts +27 -0
  22. package/dist/server.js +30 -0
  23. package/dist/services.d.ts +7 -0
  24. package/dist/services.js +53 -0
  25. package/dist/storage.d.ts +68 -0
  26. package/dist/storage.js +30 -0
  27. package/dist/tasks.d.ts +42 -0
  28. package/dist/tasks.js +24 -0
  29. package/dist/wire.gen.d.ts +7107 -0
  30. package/dist/wire.gen.js +5 -0
  31. package/native-provenance.json +15 -0
  32. package/node_modules/@instantdb/admin/LICENSE +202 -0
  33. package/node_modules/@instantdb/admin/dist/esm/index.d.ts +607 -0
  34. package/node_modules/@instantdb/admin/dist/esm/index.js +1036 -0
  35. package/node_modules/@instantdb/admin/dist/esm/polyfill.d.ts +16 -0
  36. package/node_modules/@instantdb/admin/dist/esm/polyfill.js +21 -0
  37. package/node_modules/@instantdb/admin/dist/esm/subscribe.d.ts +38 -0
  38. package/node_modules/@instantdb/admin/dist/esm/subscribe.js +301 -0
  39. package/node_modules/@instantdb/admin/dist/esm/version.d.ts +2 -0
  40. package/node_modules/@instantdb/admin/dist/esm/version.js +2 -0
  41. package/node_modules/@instantdb/admin/package.json +23 -0
  42. package/node_modules/@instantdb/core/LICENSE +202 -0
  43. package/node_modules/@instantdb/core/dist/esm/Connection.d.ts +92 -0
  44. package/node_modules/@instantdb/core/dist/esm/Connection.js +188 -0
  45. package/node_modules/@instantdb/core/dist/esm/InMemoryStorage.d.ts +10 -0
  46. package/node_modules/@instantdb/core/dist/esm/InMemoryStorage.js +25 -0
  47. package/node_modules/@instantdb/core/dist/esm/IndexedDBStorage.d.ts +17 -0
  48. package/node_modules/@instantdb/core/dist/esm/IndexedDBStorage.js +309 -0
  49. package/node_modules/@instantdb/core/dist/esm/InstantError.d.ts +6 -0
  50. package/node_modules/@instantdb/core/dist/esm/InstantError.js +23 -0
  51. package/node_modules/@instantdb/core/dist/esm/Reactor.d.ts +430 -0
  52. package/node_modules/@instantdb/core/dist/esm/Reactor.js +2369 -0
  53. package/node_modules/@instantdb/core/dist/esm/StorageAPI.d.ts +39 -0
  54. package/node_modules/@instantdb/core/dist/esm/StorageAPI.js +65 -0
  55. package/node_modules/@instantdb/core/dist/esm/Stream.d.ts +120 -0
  56. package/node_modules/@instantdb/core/dist/esm/Stream.js +811 -0
  57. package/node_modules/@instantdb/core/dist/esm/SyncTable.d.ts +144 -0
  58. package/node_modules/@instantdb/core/dist/esm/SyncTable.js +523 -0
  59. package/node_modules/@instantdb/core/dist/esm/WindowNetworkListener.d.ts +4 -0
  60. package/node_modules/@instantdb/core/dist/esm/WindowNetworkListener.js +19 -0
  61. package/node_modules/@instantdb/core/dist/esm/attrTypes.d.ts +25 -0
  62. package/node_modules/@instantdb/core/dist/esm/attrTypes.js +1 -0
  63. package/node_modules/@instantdb/core/dist/esm/authAPI.d.ts +64 -0
  64. package/node_modules/@instantdb/core/dist/esm/authAPI.js +103 -0
  65. package/node_modules/@instantdb/core/dist/esm/clientTypes.d.ts +40 -0
  66. package/node_modules/@instantdb/core/dist/esm/clientTypes.js +1 -0
  67. package/node_modules/@instantdb/core/dist/esm/coreTypes.d.ts +33 -0
  68. package/node_modules/@instantdb/core/dist/esm/coreTypes.js +1 -0
  69. package/node_modules/@instantdb/core/dist/esm/createRouteHandler.d.ts +7 -0
  70. package/node_modules/@instantdb/core/dist/esm/createRouteHandler.js +51 -0
  71. package/node_modules/@instantdb/core/dist/esm/datalog.d.ts +7 -0
  72. package/node_modules/@instantdb/core/dist/esm/datalog.js +99 -0
  73. package/node_modules/@instantdb/core/dist/esm/devtool.d.ts +3 -0
  74. package/node_modules/@instantdb/core/dist/esm/devtool.js +144 -0
  75. package/node_modules/@instantdb/core/dist/esm/framework.d.ts +80 -0
  76. package/node_modules/@instantdb/core/dist/esm/framework.js +243 -0
  77. package/node_modules/@instantdb/core/dist/esm/helperTypes.d.ts +75 -0
  78. package/node_modules/@instantdb/core/dist/esm/helperTypes.js +1 -0
  79. package/node_modules/@instantdb/core/dist/esm/index.d.ts +597 -0
  80. package/node_modules/@instantdb/core/dist/esm/index.js +649 -0
  81. package/node_modules/@instantdb/core/dist/esm/infiniteQuery.d.ts +25 -0
  82. package/node_modules/@instantdb/core/dist/esm/infiniteQuery.js +430 -0
  83. package/node_modules/@instantdb/core/dist/esm/instaml.d.ts +17 -0
  84. package/node_modules/@instantdb/core/dist/esm/instaml.js +576 -0
  85. package/node_modules/@instantdb/core/dist/esm/instaql.d.ts +12 -0
  86. package/node_modules/@instantdb/core/dist/esm/instaql.js +632 -0
  87. package/node_modules/@instantdb/core/dist/esm/instatx.d.ts +127 -0
  88. package/node_modules/@instantdb/core/dist/esm/instatx.js +93 -0
  89. package/node_modules/@instantdb/core/dist/esm/model/instaqlResult.d.ts +7 -0
  90. package/node_modules/@instantdb/core/dist/esm/model/instaqlResult.js +24 -0
  91. package/node_modules/@instantdb/core/dist/esm/parseSchemaFromJSON.d.ts +2 -0
  92. package/node_modules/@instantdb/core/dist/esm/parseSchemaFromJSON.js +142 -0
  93. package/node_modules/@instantdb/core/dist/esm/presence.d.ts +50 -0
  94. package/node_modules/@instantdb/core/dist/esm/presence.js +50 -0
  95. package/node_modules/@instantdb/core/dist/esm/presenceTypes.d.ts +9 -0
  96. package/node_modules/@instantdb/core/dist/esm/presenceTypes.js +3 -0
  97. package/node_modules/@instantdb/core/dist/esm/queryTypes.d.ts +271 -0
  98. package/node_modules/@instantdb/core/dist/esm/queryTypes.js +3 -0
  99. package/node_modules/@instantdb/core/dist/esm/queryValidation.d.ts +5 -0
  100. package/node_modules/@instantdb/core/dist/esm/queryValidation.js +287 -0
  101. package/node_modules/@instantdb/core/dist/esm/reactorTypes.d.ts +29 -0
  102. package/node_modules/@instantdb/core/dist/esm/reactorTypes.js +1 -0
  103. package/node_modules/@instantdb/core/dist/esm/routeHandlerProtocol.d.ts +19 -0
  104. package/node_modules/@instantdb/core/dist/esm/routeHandlerProtocol.js +1 -0
  105. package/node_modules/@instantdb/core/dist/esm/rulesTypes.d.ts +85 -0
  106. package/node_modules/@instantdb/core/dist/esm/rulesTypes.js +1 -0
  107. package/node_modules/@instantdb/core/dist/esm/sanityCheckQueries.d.ts +18 -0
  108. package/node_modules/@instantdb/core/dist/esm/sanityCheckQueries.js +152 -0
  109. package/node_modules/@instantdb/core/dist/esm/schema.d.ts +72 -0
  110. package/node_modules/@instantdb/core/dist/esm/schema.js +128 -0
  111. package/node_modules/@instantdb/core/dist/esm/schemaTypes.d.ts +244 -0
  112. package/node_modules/@instantdb/core/dist/esm/schemaTypes.js +106 -0
  113. package/node_modules/@instantdb/core/dist/esm/store.d.ts +89 -0
  114. package/node_modules/@instantdb/core/dist/esm/store.js +722 -0
  115. package/node_modules/@instantdb/core/dist/esm/transactionValidation.d.ts +7 -0
  116. package/node_modules/@instantdb/core/dist/esm/transactionValidation.js +130 -0
  117. package/node_modules/@instantdb/core/dist/esm/utils/Deferred.d.ts +8 -0
  118. package/node_modules/@instantdb/core/dist/esm/utils/Deferred.js +17 -0
  119. package/node_modules/@instantdb/core/dist/esm/utils/PersistedObject.d.ts +80 -0
  120. package/node_modules/@instantdb/core/dist/esm/utils/PersistedObject.js +448 -0
  121. package/node_modules/@instantdb/core/dist/esm/utils/dates.d.ts +1 -0
  122. package/node_modules/@instantdb/core/dist/esm/utils/dates.js +211 -0
  123. package/node_modules/@instantdb/core/dist/esm/utils/error.d.ts +2 -0
  124. package/node_modules/@instantdb/core/dist/esm/utils/error.js +8 -0
  125. package/node_modules/@instantdb/core/dist/esm/utils/fetch.d.ts +125 -0
  126. package/node_modules/@instantdb/core/dist/esm/utils/fetch.js +31 -0
  127. package/node_modules/@instantdb/core/dist/esm/utils/flags.d.ts +4 -0
  128. package/node_modules/@instantdb/core/dist/esm/utils/flags.js +10 -0
  129. package/node_modules/@instantdb/core/dist/esm/utils/id.d.ts +3 -0
  130. package/node_modules/@instantdb/core/dist/esm/utils/id.js +25 -0
  131. package/node_modules/@instantdb/core/dist/esm/utils/linkIndex.d.ts +7 -0
  132. package/node_modules/@instantdb/core/dist/esm/utils/linkIndex.js +17 -0
  133. package/node_modules/@instantdb/core/dist/esm/utils/log.d.ts +6 -0
  134. package/node_modules/@instantdb/core/dist/esm/utils/log.js +13 -0
  135. package/node_modules/@instantdb/core/dist/esm/utils/object.d.ts +16 -0
  136. package/node_modules/@instantdb/core/dist/esm/utils/object.js +143 -0
  137. package/node_modules/@instantdb/core/dist/esm/utils/pgtime.d.ts +197 -0
  138. package/node_modules/@instantdb/core/dist/esm/utils/pgtime.js +197 -0
  139. package/node_modules/@instantdb/core/dist/esm/utils/pick.d.ts +1 -0
  140. package/node_modules/@instantdb/core/dist/esm/utils/pick.js +9 -0
  141. package/node_modules/@instantdb/core/dist/esm/utils/strings.d.ts +1 -0
  142. package/node_modules/@instantdb/core/dist/esm/utils/strings.js +15 -0
  143. package/node_modules/@instantdb/core/dist/esm/utils/weakHash.d.ts +15 -0
  144. package/node_modules/@instantdb/core/dist/esm/utils/weakHash.js +71 -0
  145. package/node_modules/@instantdb/core/dist/esm/utils/weakHashLegacy.d.ts +7 -0
  146. package/node_modules/@instantdb/core/dist/esm/utils/weakHashLegacy.js +72 -0
  147. package/node_modules/@instantdb/core/dist/esm/version.d.ts +2 -0
  148. package/node_modules/@instantdb/core/dist/esm/version.js +2 -0
  149. package/node_modules/@instantdb/core/dist/esm/warningToggle.d.ts +2 -0
  150. package/node_modules/@instantdb/core/dist/esm/warningToggle.js +4 -0
  151. package/node_modules/@instantdb/core/package.json +20 -0
  152. package/node_modules/@instantdb/eventsource/LICENSE +22 -0
  153. package/node_modules/@instantdb/eventsource/README.md +226 -0
  154. package/node_modules/@instantdb/eventsource/dist/index.cjs +279 -0
  155. package/node_modules/@instantdb/eventsource/dist/index.cjs.map +1 -0
  156. package/node_modules/@instantdb/eventsource/dist/index.d.cts +346 -0
  157. package/node_modules/@instantdb/eventsource/dist/index.d.ts +346 -0
  158. package/node_modules/@instantdb/eventsource/dist/index.js +279 -0
  159. package/node_modules/@instantdb/eventsource/dist/index.js.map +1 -0
  160. package/node_modules/@instantdb/eventsource/package.json +128 -0
  161. package/node_modules/@instantdb/eventsource/src/EventSource.ts +614 -0
  162. package/node_modules/@instantdb/eventsource/src/errors.ts +141 -0
  163. package/node_modules/@instantdb/eventsource/src/index.ts +3 -0
  164. package/node_modules/@instantdb/eventsource/src/types.ts +164 -0
  165. package/node_modules/@instantdb/react/LICENSE +202 -0
  166. package/node_modules/@instantdb/react/dist/esm/Cursors.d.ts +18 -0
  167. package/node_modules/@instantdb/react/dist/esm/Cursors.js +103 -0
  168. package/node_modules/@instantdb/react/dist/esm/InstantReactWebDatabase.d.ts +5 -0
  169. package/node_modules/@instantdb/react/dist/esm/InstantReactWebDatabase.js +5 -0
  170. package/node_modules/@instantdb/react/dist/esm/index.d.ts +6 -0
  171. package/node_modules/@instantdb/react/dist/esm/index.js +22 -0
  172. package/node_modules/@instantdb/react/dist/esm/init.d.ts +40 -0
  173. package/node_modules/@instantdb/react/dist/esm/init.js +49 -0
  174. package/node_modules/@instantdb/react/dist/esm/next-ssr/HydrationStreamProvider.d.ts +65 -0
  175. package/node_modules/@instantdb/react/dist/esm/next-ssr/HydrationStreamProvider.js +96 -0
  176. package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantNextDatabase.d.ts +11 -0
  177. package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantNextDatabase.js +31 -0
  178. package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantSuspenseProvider.d.ts +24 -0
  179. package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantSuspenseProvider.js +162 -0
  180. package/node_modules/@instantdb/react/dist/esm/next-ssr/getUserFromInstantCookie.d.ts +9 -0
  181. package/node_modules/@instantdb/react/dist/esm/next-ssr/getUserFromInstantCookie.js +16 -0
  182. package/node_modules/@instantdb/react/dist/esm/next-ssr/htmlescape.d.ts +2 -0
  183. package/node_modules/@instantdb/react/dist/esm/next-ssr/htmlescape.js +20 -0
  184. package/node_modules/@instantdb/react/dist/esm/next-ssr/index.d.ts +29 -0
  185. package/node_modules/@instantdb/react/dist/esm/next-ssr/index.js +34 -0
  186. package/node_modules/@instantdb/react/dist/esm/version.d.ts +2 -0
  187. package/node_modules/@instantdb/react/dist/esm/version.js +2 -0
  188. package/node_modules/@instantdb/react/package.json +24 -0
  189. package/node_modules/@instantdb/react-common/LICENSE +202 -0
  190. package/node_modules/@instantdb/react-common/dist/esm/InstantReactAbstractDatabase.d.ts +282 -0
  191. package/node_modules/@instantdb/react-common/dist/esm/InstantReactAbstractDatabase.js +386 -0
  192. package/node_modules/@instantdb/react-common/dist/esm/InstantReactRoom.d.ts +182 -0
  193. package/node_modules/@instantdb/react-common/dist/esm/InstantReactRoom.js +280 -0
  194. package/node_modules/@instantdb/react-common/dist/esm/index.d.ts +4 -0
  195. package/node_modules/@instantdb/react-common/dist/esm/index.js +3 -0
  196. package/node_modules/@instantdb/react-common/dist/esm/useInfiniteQuerySubscription.d.ts +27 -0
  197. package/node_modules/@instantdb/react-common/dist/esm/useInfiniteQuerySubscription.js +53 -0
  198. package/node_modules/@instantdb/react-common/dist/esm/useQuery.d.ts +6 -0
  199. package/node_modules/@instantdb/react-common/dist/esm/useQuery.js +75 -0
  200. package/node_modules/@instantdb/react-common/dist/esm/useTimeout.d.ts +4 -0
  201. package/node_modules/@instantdb/react-common/dist/esm/useTimeout.js +17 -0
  202. package/node_modules/@instantdb/react-common/dist/esm/version.d.ts +2 -0
  203. package/node_modules/@instantdb/react-common/dist/esm/version.js +2 -0
  204. package/node_modules/@instantdb/react-common/package.json +22 -0
  205. package/node_modules/@instantdb/version/LICENSE +202 -0
  206. package/node_modules/@instantdb/version/dist/esm/index.d.ts +2 -0
  207. package/node_modules/@instantdb/version/dist/esm/index.js +2 -0
  208. package/node_modules/@instantdb/version/dist/esm/version.d.ts +2 -0
  209. package/node_modules/@instantdb/version/dist/esm/version.js +5 -0
  210. package/node_modules/@instantdb/version/package.json +16 -0
  211. package/node_modules/@instantdb/webhooks/LICENSE +202 -0
  212. package/node_modules/@instantdb/webhooks/dist/esm/index.d.ts +587 -0
  213. package/node_modules/@instantdb/webhooks/dist/esm/index.js +748 -0
  214. package/node_modules/@instantdb/webhooks/package.json +18 -0
  215. package/node_modules/cookie/LICENSE +24 -0
  216. package/node_modules/cookie/README.md +295 -0
  217. package/node_modules/cookie/dist/index.d.ts +143 -0
  218. package/node_modules/cookie/dist/index.js +355 -0
  219. package/node_modules/cookie/dist/index.js.map +1 -0
  220. package/node_modules/cookie/package.json +57 -0
  221. package/node_modules/eventsource/LICENSE +22 -0
  222. package/node_modules/eventsource/README.md +252 -0
  223. package/node_modules/eventsource/dist/EventSource.d.ts +128 -0
  224. package/node_modules/eventsource/dist/EventSource.d.ts.map +1 -0
  225. package/node_modules/eventsource/dist/EventSource.js +556 -0
  226. package/node_modules/eventsource/dist/EventSource.js.map +1 -0
  227. package/node_modules/eventsource/dist/errors.d.ts +53 -0
  228. package/node_modules/eventsource/dist/errors.d.ts.map +1 -0
  229. package/node_modules/eventsource/dist/errors.js +120 -0
  230. package/node_modules/eventsource/dist/errors.js.map +1 -0
  231. package/node_modules/eventsource/dist/index.d.ts +4 -0
  232. package/node_modules/eventsource/dist/index.d.ts.map +1 -0
  233. package/node_modules/eventsource/dist/index.js +3 -0
  234. package/node_modules/eventsource/dist/index.js.map +1 -0
  235. package/node_modules/eventsource/dist/types.d.ts +156 -0
  236. package/node_modules/eventsource/dist/types.d.ts.map +1 -0
  237. package/node_modules/eventsource/dist/types.js +2 -0
  238. package/node_modules/eventsource/dist/types.js.map +1 -0
  239. package/node_modules/eventsource/node_modules/eventsource-parser/LICENSE +21 -0
  240. package/node_modules/eventsource/node_modules/eventsource-parser/README.md +177 -0
  241. package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.d.ts +35 -0
  242. package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.d.ts.map +1 -0
  243. package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.js +16 -0
  244. package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.js.map +1 -0
  245. package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.d.ts +4 -0
  246. package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.d.ts.map +1 -0
  247. package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.js +3 -0
  248. package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.js.map +1 -0
  249. package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.d.ts +12 -0
  250. package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.d.ts.map +1 -0
  251. package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.js +509 -0
  252. package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.js.map +1 -0
  253. package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.d.ts +76 -0
  254. package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.d.ts.map +1 -0
  255. package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.js +59 -0
  256. package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.js.map +1 -0
  257. package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.d.ts +130 -0
  258. package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.d.ts.map +1 -0
  259. package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.js +1 -0
  260. package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.js.map +1 -0
  261. package/node_modules/eventsource/node_modules/eventsource-parser/package.json +96 -0
  262. package/node_modules/eventsource/node_modules/eventsource-parser/src/errors.ts +44 -0
  263. package/node_modules/eventsource/node_modules/eventsource-parser/src/index.ts +3 -0
  264. package/node_modules/eventsource/node_modules/eventsource-parser/src/parse.ts +576 -0
  265. package/node_modules/eventsource/node_modules/eventsource-parser/src/stream.ts +118 -0
  266. package/node_modules/eventsource/node_modules/eventsource-parser/src/types.ts +138 -0
  267. package/node_modules/eventsource/package.json +103 -0
  268. package/node_modules/eventsource/src/EventSource.ts +844 -0
  269. package/node_modules/eventsource/src/errors.ts +141 -0
  270. package/node_modules/eventsource/src/index.ts +3 -0
  271. package/node_modules/eventsource/src/types.ts +166 -0
  272. package/node_modules/eventsource-parser/LICENSE +21 -0
  273. package/node_modules/eventsource-parser/README.md +157 -0
  274. package/node_modules/eventsource-parser/dist/index.cjs +177 -0
  275. package/node_modules/eventsource-parser/dist/index.cjs.map +1 -0
  276. package/node_modules/eventsource-parser/dist/index.d.cts +169 -0
  277. package/node_modules/eventsource-parser/dist/index.d.ts +169 -0
  278. package/node_modules/eventsource-parser/dist/index.js +177 -0
  279. package/node_modules/eventsource-parser/dist/index.js.map +1 -0
  280. package/node_modules/eventsource-parser/dist/stream.cjs +29 -0
  281. package/node_modules/eventsource-parser/dist/stream.cjs.map +1 -0
  282. package/node_modules/eventsource-parser/dist/stream.d.cts +134 -0
  283. package/node_modules/eventsource-parser/dist/stream.d.ts +134 -0
  284. package/node_modules/eventsource-parser/dist/stream.js +30 -0
  285. package/node_modules/eventsource-parser/dist/stream.js.map +1 -0
  286. package/node_modules/eventsource-parser/package.json +92 -0
  287. package/node_modules/eventsource-parser/src/errors.ts +44 -0
  288. package/node_modules/eventsource-parser/src/index.ts +8 -0
  289. package/node_modules/eventsource-parser/src/parse.ts +439 -0
  290. package/node_modules/eventsource-parser/src/stream.ts +107 -0
  291. package/node_modules/eventsource-parser/src/types.ts +122 -0
  292. package/node_modules/eventsource-parser/stream.js +2 -0
  293. package/node_modules/mutative/LICENSE +21 -0
  294. package/node_modules/mutative/README.md +870 -0
  295. package/node_modules/mutative/dist/apply.d.ts +31 -0
  296. package/node_modules/mutative/dist/array.d.ts +45 -0
  297. package/node_modules/mutative/dist/constant.d.ts +8 -0
  298. package/node_modules/mutative/dist/create.d.ts +46 -0
  299. package/node_modules/mutative/dist/current.d.ts +23 -0
  300. package/node_modules/mutative/dist/draft.d.ts +3 -0
  301. package/node_modules/mutative/dist/draftify.d.ts +2 -0
  302. package/node_modules/mutative/dist/error.d.ts +54 -0
  303. package/node_modules/mutative/dist/index.d.mts +1 -0
  304. package/node_modules/mutative/dist/index.d.ts +12 -0
  305. package/node_modules/mutative/dist/index.js +8 -0
  306. package/node_modules/mutative/dist/index.mjs +3 -0
  307. package/node_modules/mutative/dist/interface.d.ts +200 -0
  308. package/node_modules/mutative/dist/internal.d.ts +4 -0
  309. package/node_modules/mutative/dist/makeCreator.d.ts +54 -0
  310. package/node_modules/mutative/dist/map.d.ts +15 -0
  311. package/node_modules/mutative/dist/mutative.cjs.development.js +2126 -0
  312. package/node_modules/mutative/dist/mutative.cjs.development.js.map +1 -0
  313. package/node_modules/mutative/dist/mutative.cjs.production.min.js +2 -0
  314. package/node_modules/mutative/dist/mutative.cjs.production.min.js.map +1 -0
  315. package/node_modules/mutative/dist/mutative.esm.js +2123 -0
  316. package/node_modules/mutative/dist/mutative.esm.js.map +1 -0
  317. package/node_modules/mutative/dist/mutative.esm.mjs +2123 -0
  318. package/node_modules/mutative/dist/mutative.esm.mjs.map +1 -0
  319. package/node_modules/mutative/dist/mutative.esm.production.min.mjs +2 -0
  320. package/node_modules/mutative/dist/mutative.esm.production.min.mjs.map +1 -0
  321. package/node_modules/mutative/dist/mutative.umd.development.js +2132 -0
  322. package/node_modules/mutative/dist/mutative.umd.development.js.map +1 -0
  323. package/node_modules/mutative/dist/mutative.umd.production.min.js +2 -0
  324. package/node_modules/mutative/dist/mutative.umd.production.min.js.map +1 -0
  325. package/node_modules/mutative/dist/original.d.ts +19 -0
  326. package/node_modules/mutative/dist/patch.d.ts +2 -0
  327. package/node_modules/mutative/dist/rawReturn.d.ts +19 -0
  328. package/node_modules/mutative/dist/set.d.ts +14 -0
  329. package/node_modules/mutative/dist/unsafe.d.ts +34 -0
  330. package/node_modules/mutative/dist/utils/cast.d.ts +13 -0
  331. package/node_modules/mutative/dist/utils/copy.d.ts +5 -0
  332. package/node_modules/mutative/dist/utils/deepFreeze.d.ts +1 -0
  333. package/node_modules/mutative/dist/utils/draft.d.ts +27 -0
  334. package/node_modules/mutative/dist/utils/finalize.d.ts +13 -0
  335. package/node_modules/mutative/dist/utils/forEach.d.ts +1 -0
  336. package/node_modules/mutative/dist/utils/index.d.ts +7 -0
  337. package/node_modules/mutative/dist/utils/mark.d.ts +2 -0
  338. package/node_modules/mutative/dist/utils/marker.d.ts +5 -0
  339. package/node_modules/mutative/dist/utils/proto.d.ts +10 -0
  340. package/node_modules/mutative/package.json +142 -0
  341. package/node_modules/mutative/src/apply.ts +239 -0
  342. package/node_modules/mutative/src/array.ts +679 -0
  343. package/node_modules/mutative/src/constant.ts +17 -0
  344. package/node_modules/mutative/src/create.ts +27 -0
  345. package/node_modules/mutative/src/current.ts +206 -0
  346. package/node_modules/mutative/src/draft.ts +489 -0
  347. package/node_modules/mutative/src/draftify.ts +57 -0
  348. package/node_modules/mutative/src/error.ts +129 -0
  349. package/node_modules/mutative/src/index.ts +21 -0
  350. package/node_modules/mutative/src/interface.ts +321 -0
  351. package/node_modules/mutative/src/internal.ts +5 -0
  352. package/node_modules/mutative/src/makeCreator.ts +382 -0
  353. package/node_modules/mutative/src/map.ts +160 -0
  354. package/node_modules/mutative/src/original.ts +28 -0
  355. package/node_modules/mutative/src/patch.ts +386 -0
  356. package/node_modules/mutative/src/rawReturn.ts +41 -0
  357. package/node_modules/mutative/src/set.ts +201 -0
  358. package/node_modules/mutative/src/unsafe.ts +66 -0
  359. package/node_modules/mutative/src/utils/cast.ts +22 -0
  360. package/node_modules/mutative/src/utils/copy.ts +224 -0
  361. package/node_modules/mutative/src/utils/deepFreeze.ts +103 -0
  362. package/node_modules/mutative/src/utils/draft.ts +189 -0
  363. package/node_modules/mutative/src/utils/finalize.ts +232 -0
  364. package/node_modules/mutative/src/utils/forEach.ts +24 -0
  365. package/node_modules/mutative/src/utils/index.ts +7 -0
  366. package/node_modules/mutative/src/utils/mark.ts +11 -0
  367. package/node_modules/mutative/src/utils/marker.ts +34 -0
  368. package/node_modules/mutative/src/utils/proto.ts +38 -0
  369. package/node_modules/uuid/LICENSE.md +9 -0
  370. package/node_modules/uuid/README.md +491 -0
  371. package/node_modules/uuid/dist/index.d.ts +15 -0
  372. package/node_modules/uuid/dist/index.js +14 -0
  373. package/node_modules/uuid/dist/max.d.ts +2 -0
  374. package/node_modules/uuid/dist/max.js +1 -0
  375. package/node_modules/uuid/dist/md5.d.ts +2 -0
  376. package/node_modules/uuid/dist/md5.js +135 -0
  377. package/node_modules/uuid/dist/nil.d.ts +2 -0
  378. package/node_modules/uuid/dist/nil.js +1 -0
  379. package/node_modules/uuid/dist/parse.d.ts +3 -0
  380. package/node_modules/uuid/dist/parse.js +9 -0
  381. package/node_modules/uuid/dist/regex.d.ts +2 -0
  382. package/node_modules/uuid/dist/regex.js +1 -0
  383. package/node_modules/uuid/dist/rng.d.ts +1 -0
  384. package/node_modules/uuid/dist/rng.js +4 -0
  385. package/node_modules/uuid/dist/sha1.d.ts +2 -0
  386. package/node_modules/uuid/dist/sha1.js +70 -0
  387. package/node_modules/uuid/dist/stringify.d.ts +3 -0
  388. package/node_modules/uuid/dist/stringify.js +35 -0
  389. package/node_modules/uuid/dist/types.d.ts +22 -0
  390. package/node_modules/uuid/dist/types.js +1 -0
  391. package/node_modules/uuid/dist/uuid-bin.d.ts +1 -0
  392. package/node_modules/uuid/dist/uuid-bin.js +70 -0
  393. package/node_modules/uuid/dist/v1.d.ts +11 -0
  394. package/node_modules/uuid/dist/v1.js +87 -0
  395. package/node_modules/uuid/dist/v1ToV6.d.ts +3 -0
  396. package/node_modules/uuid/dist/v1ToV6.js +10 -0
  397. package/node_modules/uuid/dist/v3.d.ts +9 -0
  398. package/node_modules/uuid/dist/v3.js +9 -0
  399. package/node_modules/uuid/dist/v35.d.ts +7 -0
  400. package/node_modules/uuid/dist/v35.js +39 -0
  401. package/node_modules/uuid/dist/v4.d.ts +4 -0
  402. package/node_modules/uuid/dist/v4.js +29 -0
  403. package/node_modules/uuid/dist/v5.d.ts +9 -0
  404. package/node_modules/uuid/dist/v5.js +9 -0
  405. package/node_modules/uuid/dist/v6.d.ts +4 -0
  406. package/node_modules/uuid/dist/v6.js +20 -0
  407. package/node_modules/uuid/dist/v6ToV1.d.ts +2 -0
  408. package/node_modules/uuid/dist/v6ToV1.js +10 -0
  409. package/node_modules/uuid/dist/v7.d.ts +9 -0
  410. package/node_modules/uuid/dist/v7.js +68 -0
  411. package/node_modules/uuid/dist/validate.d.ts +2 -0
  412. package/node_modules/uuid/dist/validate.js +5 -0
  413. package/node_modules/uuid/dist/version.d.ts +2 -0
  414. package/node_modules/uuid/dist/version.js +8 -0
  415. package/node_modules/uuid/dist-node/bin/uuid +2 -0
  416. package/node_modules/uuid/dist-node/index.js +14 -0
  417. package/node_modules/uuid/dist-node/max.js +1 -0
  418. package/node_modules/uuid/dist-node/md5.js +11 -0
  419. package/node_modules/uuid/dist-node/nil.js +1 -0
  420. package/node_modules/uuid/dist-node/parse.js +9 -0
  421. package/node_modules/uuid/dist-node/regex.js +1 -0
  422. package/node_modules/uuid/dist-node/rng.js +4 -0
  423. package/node_modules/uuid/dist-node/sha1.js +11 -0
  424. package/node_modules/uuid/dist-node/stringify.js +35 -0
  425. package/node_modules/uuid/dist-node/types.js +1 -0
  426. package/node_modules/uuid/dist-node/uuid-bin.js +70 -0
  427. package/node_modules/uuid/dist-node/v1.js +87 -0
  428. package/node_modules/uuid/dist-node/v1ToV6.js +10 -0
  429. package/node_modules/uuid/dist-node/v3.js +9 -0
  430. package/node_modules/uuid/dist-node/v35.js +39 -0
  431. package/node_modules/uuid/dist-node/v4.js +29 -0
  432. package/node_modules/uuid/dist-node/v5.js +9 -0
  433. package/node_modules/uuid/dist-node/v6.js +20 -0
  434. package/node_modules/uuid/dist-node/v6ToV1.js +10 -0
  435. package/node_modules/uuid/dist-node/v7.js +68 -0
  436. package/node_modules/uuid/dist-node/validate.js +5 -0
  437. package/node_modules/uuid/dist-node/version.js +8 -0
  438. package/node_modules/uuid/package.json +115 -0
  439. package/package.json +80 -4
  440. package/release.json +78 -0
@@ -0,0 +1 @@
1
+ export default '00000000-0000-0000-0000-000000000000';
@@ -0,0 +1,9 @@
1
+ import validate from './validate.js';
2
+ function parse(uuid) {
3
+ if (!validate(uuid)) {
4
+ throw TypeError('Invalid UUID');
5
+ }
6
+ let v;
7
+ return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff);
8
+ }
9
+ export default parse;
@@ -0,0 +1 @@
1
+ export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
@@ -0,0 +1,4 @@
1
+ const rnds8 = new Uint8Array(16);
2
+ export default function rng() {
3
+ return crypto.getRandomValues(rnds8);
4
+ }
@@ -0,0 +1,11 @@
1
+ import { createHash } from 'node:crypto';
2
+ function sha1(bytes) {
3
+ if (Array.isArray(bytes)) {
4
+ bytes = Buffer.from(bytes);
5
+ }
6
+ else if (typeof bytes === 'string') {
7
+ bytes = Buffer.from(bytes, 'utf8');
8
+ }
9
+ return createHash('sha1').update(bytes).digest();
10
+ }
11
+ export default sha1;
@@ -0,0 +1,35 @@
1
+ import validate from './validate.js';
2
+ const byteToHex = [];
3
+ for (let i = 0; i < 256; ++i) {
4
+ byteToHex.push((i + 0x100).toString(16).slice(1));
5
+ }
6
+ export function unsafeStringify(arr, offset = 0) {
7
+ return (byteToHex[arr[offset + 0]] +
8
+ byteToHex[arr[offset + 1]] +
9
+ byteToHex[arr[offset + 2]] +
10
+ byteToHex[arr[offset + 3]] +
11
+ '-' +
12
+ byteToHex[arr[offset + 4]] +
13
+ byteToHex[arr[offset + 5]] +
14
+ '-' +
15
+ byteToHex[arr[offset + 6]] +
16
+ byteToHex[arr[offset + 7]] +
17
+ '-' +
18
+ byteToHex[arr[offset + 8]] +
19
+ byteToHex[arr[offset + 9]] +
20
+ '-' +
21
+ byteToHex[arr[offset + 10]] +
22
+ byteToHex[arr[offset + 11]] +
23
+ byteToHex[arr[offset + 12]] +
24
+ byteToHex[arr[offset + 13]] +
25
+ byteToHex[arr[offset + 14]] +
26
+ byteToHex[arr[offset + 15]]).toLowerCase();
27
+ }
28
+ function stringify(arr, offset = 0) {
29
+ const uuid = unsafeStringify(arr, offset);
30
+ if (!validate(uuid)) {
31
+ throw TypeError('Stringified UUID is invalid');
32
+ }
33
+ return uuid;
34
+ }
35
+ export default stringify;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ import * as assert from 'node:assert/strict';
2
+ import v1 from './v1.js';
3
+ import v3 from './v3.js';
4
+ import v4 from './v4.js';
5
+ import v5 from './v5.js';
6
+ import v6 from './v6.js';
7
+ import v7 from './v7.js';
8
+ function usage() {
9
+ console.log('Usage:');
10
+ console.log(' uuid');
11
+ console.log(' uuid v1');
12
+ console.log(' uuid v3 <name> <namespace uuid>');
13
+ console.log(' uuid v4');
14
+ console.log(' uuid v5 <name> <namespace uuid>');
15
+ console.log(' uuid v6');
16
+ console.log(' uuid v7');
17
+ console.log(' uuid --help');
18
+ console.log('\nNote: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562');
19
+ }
20
+ const args = process.argv.slice(2);
21
+ if (args.indexOf('--help') >= 0) {
22
+ usage();
23
+ process.exit(0);
24
+ }
25
+ const version = args.shift() || 'v4';
26
+ switch (version) {
27
+ case 'v1':
28
+ console.log(v1());
29
+ break;
30
+ case 'v3': {
31
+ const name = args.shift();
32
+ let namespace = args.shift();
33
+ assert.ok(name != null, 'v3 name not specified');
34
+ assert.ok(namespace != null, 'v3 namespace not specified');
35
+ if (namespace === 'URL') {
36
+ namespace = v3.URL;
37
+ }
38
+ if (namespace === 'DNS') {
39
+ namespace = v3.DNS;
40
+ }
41
+ console.log(v3(name, namespace));
42
+ break;
43
+ }
44
+ case 'v4':
45
+ console.log(v4());
46
+ break;
47
+ case 'v5': {
48
+ const name = args.shift();
49
+ let namespace = args.shift();
50
+ assert.ok(name != null, 'v5 name not specified');
51
+ assert.ok(namespace != null, 'v5 namespace not specified');
52
+ if (namespace === 'URL') {
53
+ namespace = v5.URL;
54
+ }
55
+ if (namespace === 'DNS') {
56
+ namespace = v5.DNS;
57
+ }
58
+ console.log(v5(name, namespace));
59
+ break;
60
+ }
61
+ case 'v6':
62
+ console.log(v6());
63
+ break;
64
+ case 'v7':
65
+ console.log(v7());
66
+ break;
67
+ default:
68
+ usage();
69
+ process.exit(1);
70
+ }
@@ -0,0 +1,87 @@
1
+ import rng from './rng.js';
2
+ import { unsafeStringify } from './stringify.js';
3
+ const _state = {};
4
+ function v1(options, buf, offset) {
5
+ let bytes;
6
+ const isV6 = options?._v6 ?? false;
7
+ if (options) {
8
+ const optionsKeys = Object.keys(options);
9
+ if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') {
10
+ options = undefined;
11
+ }
12
+ }
13
+ if (options) {
14
+ bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset);
15
+ }
16
+ else {
17
+ const now = Date.now();
18
+ const rnds = rng();
19
+ updateV1State(_state, now, rnds);
20
+ bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset);
21
+ }
22
+ return buf ?? unsafeStringify(bytes);
23
+ }
24
+ export function updateV1State(state, now, rnds) {
25
+ state.msecs ??= -Infinity;
26
+ state.nsecs ??= 0;
27
+ if (now === state.msecs) {
28
+ state.nsecs++;
29
+ if (state.nsecs >= 10000) {
30
+ state.node = undefined;
31
+ state.nsecs = 0;
32
+ }
33
+ }
34
+ else if (now > state.msecs) {
35
+ state.nsecs = 0;
36
+ }
37
+ else if (now < state.msecs) {
38
+ state.node = undefined;
39
+ }
40
+ if (!state.node) {
41
+ state.node = rnds.slice(10, 16);
42
+ state.node[0] |= 0x01;
43
+ state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff;
44
+ }
45
+ state.msecs = now;
46
+ return state;
47
+ }
48
+ function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {
49
+ if (rnds.length < 16) {
50
+ throw new Error('Random bytes length must be >= 16');
51
+ }
52
+ if (!buf) {
53
+ buf = new Uint8Array(16);
54
+ offset = 0;
55
+ }
56
+ else {
57
+ if (offset < 0 || offset + 16 > buf.length) {
58
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
59
+ }
60
+ }
61
+ msecs ??= Date.now();
62
+ nsecs ??= 0;
63
+ clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff;
64
+ if (node == null) {
65
+ node = rnds.slice(10, 16);
66
+ node[0] |= 0x01;
67
+ }
68
+ msecs += 12219292800000;
69
+ const t = (msecs & 0xfffffff) * 10000 + nsecs;
70
+ const tl = t >>> 0;
71
+ buf[offset++] = (tl >>> 24) & 0xff;
72
+ buf[offset++] = (tl >>> 16) & 0xff;
73
+ buf[offset++] = (tl >>> 8) & 0xff;
74
+ buf[offset++] = tl & 0xff;
75
+ const tmh = (((msecs / 0x10000000) | 0) * 625 + ((t / 0x100000000) | 0)) & 0xfffffff;
76
+ buf[offset++] = (tmh >>> 8) & 0xff;
77
+ buf[offset++] = tmh & 0xff;
78
+ buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10;
79
+ buf[offset++] = (tmh >>> 16) & 0xff;
80
+ buf[offset++] = (clockseq >>> 8) | 0x80;
81
+ buf[offset++] = clockseq & 0xff;
82
+ for (let n = 0; n < 6; ++n) {
83
+ buf[offset++] = node[n];
84
+ }
85
+ return buf;
86
+ }
87
+ export default v1;
@@ -0,0 +1,10 @@
1
+ import parse from './parse.js';
2
+ import { unsafeStringify } from './stringify.js';
3
+ export default function v1ToV6(uuid) {
4
+ const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid;
5
+ const v6Bytes = _v1ToV6(v1Bytes);
6
+ return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes;
7
+ }
8
+ function _v1ToV6(v1Bytes) {
9
+ return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]);
10
+ }
@@ -0,0 +1,9 @@
1
+ import md5 from './md5.js';
2
+ import v35, { DNS, URL } from './v35.js';
3
+ export { DNS, URL } from './v35.js';
4
+ function v3(value, namespace, buf, offset) {
5
+ return v35(0x30, md5, value, namespace, buf, offset);
6
+ }
7
+ v3.DNS = DNS;
8
+ v3.URL = URL;
9
+ export default v3;
@@ -0,0 +1,39 @@
1
+ import parse from './parse.js';
2
+ import { unsafeStringify } from './stringify.js';
3
+ export function stringToBytes(str) {
4
+ str = unescape(encodeURIComponent(str));
5
+ const bytes = new Uint8Array(str.length);
6
+ for (let i = 0; i < str.length; ++i) {
7
+ bytes[i] = str.charCodeAt(i);
8
+ }
9
+ return bytes;
10
+ }
11
+ export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
12
+ export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
13
+ export default function v35(version, hash, value, namespace, buf, offset) {
14
+ const valueBytes = typeof value === 'string' ? stringToBytes(value) : value;
15
+ const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace;
16
+ if (typeof namespace === 'string') {
17
+ namespace = parse(namespace);
18
+ }
19
+ if (namespace?.length !== 16) {
20
+ throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
21
+ }
22
+ let bytes = new Uint8Array(16 + valueBytes.length);
23
+ bytes.set(namespaceBytes);
24
+ bytes.set(valueBytes, namespaceBytes.length);
25
+ bytes = hash(bytes);
26
+ bytes[6] = (bytes[6] & 0x0f) | version;
27
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
28
+ if (buf) {
29
+ offset ??= 0;
30
+ if (offset < 0 || offset + 16 > buf.length) {
31
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
32
+ }
33
+ for (let i = 0; i < 16; ++i) {
34
+ buf[offset + i] = bytes[i];
35
+ }
36
+ return buf;
37
+ }
38
+ return unsafeStringify(bytes);
39
+ }
@@ -0,0 +1,29 @@
1
+ import rng from './rng.js';
2
+ import { unsafeStringify } from './stringify.js';
3
+ function v4(options, buf, offset) {
4
+ if (!buf && !options && crypto.randomUUID) {
5
+ return crypto.randomUUID();
6
+ }
7
+ return _v4(options, buf, offset);
8
+ }
9
+ function _v4(options, buf, offset) {
10
+ options = options || {};
11
+ const rnds = options.random ?? options.rng?.() ?? rng();
12
+ if (rnds.length < 16) {
13
+ throw new Error('Random bytes length must be >= 16');
14
+ }
15
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
16
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
17
+ if (buf) {
18
+ offset = offset || 0;
19
+ if (offset < 0 || offset + 16 > buf.length) {
20
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
21
+ }
22
+ for (let i = 0; i < 16; ++i) {
23
+ buf[offset + i] = rnds[i];
24
+ }
25
+ return buf;
26
+ }
27
+ return unsafeStringify(rnds);
28
+ }
29
+ export default v4;
@@ -0,0 +1,9 @@
1
+ import sha1 from './sha1.js';
2
+ import v35, { DNS, URL } from './v35.js';
3
+ export { DNS, URL } from './v35.js';
4
+ function v5(value, namespace, buf, offset) {
5
+ return v35(0x50, sha1, value, namespace, buf, offset);
6
+ }
7
+ v5.DNS = DNS;
8
+ v5.URL = URL;
9
+ export default v5;
@@ -0,0 +1,20 @@
1
+ import { unsafeStringify } from './stringify.js';
2
+ import v1 from './v1.js';
3
+ import v1ToV6 from './v1ToV6.js';
4
+ function v6(options, buf, offset) {
5
+ options ??= {};
6
+ offset ??= 0;
7
+ let bytes = v1({ ...options, _v6: true }, new Uint8Array(16));
8
+ bytes = v1ToV6(bytes);
9
+ if (buf) {
10
+ if (offset < 0 || offset + 16 > buf.length) {
11
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
12
+ }
13
+ for (let i = 0; i < 16; i++) {
14
+ buf[offset + i] = bytes[i];
15
+ }
16
+ return buf;
17
+ }
18
+ return unsafeStringify(bytes);
19
+ }
20
+ export default v6;
@@ -0,0 +1,10 @@
1
+ import parse from './parse.js';
2
+ import { unsafeStringify } from './stringify.js';
3
+ export default function v6ToV1(uuid) {
4
+ const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid;
5
+ const v1Bytes = _v6ToV1(v6Bytes);
6
+ return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes;
7
+ }
8
+ function _v6ToV1(v6Bytes) {
9
+ return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]);
10
+ }
@@ -0,0 +1,68 @@
1
+ import rng from './rng.js';
2
+ import { unsafeStringify } from './stringify.js';
3
+ const _state = {};
4
+ function v7(options, buf, offset) {
5
+ let bytes;
6
+ if (options) {
7
+ bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset);
8
+ }
9
+ else {
10
+ const now = Date.now();
11
+ const rnds = rng();
12
+ updateV7State(_state, now, rnds);
13
+ bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset);
14
+ }
15
+ return buf ?? unsafeStringify(bytes);
16
+ }
17
+ export function updateV7State(state, now, rnds) {
18
+ state.msecs ??= -Infinity;
19
+ state.seq ??= 0;
20
+ if (now > state.msecs) {
21
+ state.seq = v7Sequence(rnds);
22
+ state.msecs = now;
23
+ }
24
+ else {
25
+ state.seq = (state.seq + 1) | 0;
26
+ if (state.seq === 0) {
27
+ state.msecs++;
28
+ }
29
+ }
30
+ return state;
31
+ }
32
+ function v7Bytes(rnds, msecs, seq, buf, offset = 0) {
33
+ if (rnds.length < 16) {
34
+ throw new Error('Random bytes length must be >= 16');
35
+ }
36
+ if (!buf) {
37
+ buf = new Uint8Array(16);
38
+ offset = 0;
39
+ }
40
+ else {
41
+ if (offset < 0 || offset + 16 > buf.length) {
42
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
43
+ }
44
+ }
45
+ msecs ??= Date.now();
46
+ seq ??= v7Sequence(rnds);
47
+ buf[offset++] = (msecs / 0x10000000000) & 0xff;
48
+ buf[offset++] = (msecs / 0x100000000) & 0xff;
49
+ buf[offset++] = (msecs / 0x1000000) & 0xff;
50
+ buf[offset++] = (msecs / 0x10000) & 0xff;
51
+ buf[offset++] = (msecs / 0x100) & 0xff;
52
+ buf[offset++] = msecs & 0xff;
53
+ buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f);
54
+ buf[offset++] = (seq >>> 20) & 0xff;
55
+ buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f);
56
+ buf[offset++] = (seq >>> 6) & 0xff;
57
+ buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03);
58
+ buf[offset++] = rnds[11];
59
+ buf[offset++] = rnds[12];
60
+ buf[offset++] = rnds[13];
61
+ buf[offset++] = rnds[14];
62
+ buf[offset++] = rnds[15];
63
+ return buf;
64
+ }
65
+ function v7Sequence(rnds) {
66
+ return ((rnds[6] & 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];
67
+ }
68
+ export default v7;
@@ -0,0 +1,5 @@
1
+ import REGEX from './regex.js';
2
+ function validate(uuid) {
3
+ return typeof uuid === 'string' && REGEX.test(uuid);
4
+ }
5
+ export default validate;
@@ -0,0 +1,8 @@
1
+ import validate from './validate.js';
2
+ function version(uuid) {
3
+ if (!validate(uuid)) {
4
+ throw TypeError('Invalid UUID');
5
+ }
6
+ return parseInt(uuid.slice(14, 15), 16);
7
+ }
8
+ export default version;
@@ -0,0 +1,115 @@
1
+ {
2
+ "name": "uuid",
3
+ "version": "14.0.3",
4
+ "description": "RFC9562 UUIDs",
5
+ "type": "module",
6
+ "funding": [
7
+ "https://github.com/sponsors/broofa",
8
+ "https://github.com/sponsors/ctavan"
9
+ ],
10
+ "commitlint": {
11
+ "extends": [
12
+ "@commitlint/config-conventional"
13
+ ]
14
+ },
15
+ "keywords": [
16
+ "uuid",
17
+ "guid",
18
+ "rfc4122",
19
+ "rfc9562"
20
+ ],
21
+ "license": "MIT",
22
+ "bin": {
23
+ "uuid": "./dist-node/bin/uuid"
24
+ },
25
+ "sideEffects": false,
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "node": {
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist-node/index.js"
32
+ },
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "dist-node",
40
+ "!**/test"
41
+ ],
42
+ "devDependencies": {
43
+ "@biomejs/biome": "2.5.13",
44
+ "@commitlint/cli": "21.2.2",
45
+ "@commitlint/config-conventional": "21.2.2",
46
+ "bundlewatch": "0.4.2",
47
+ "commander": "15.0.0",
48
+ "globals": "17.12.0",
49
+ "jest": "30.5.1",
50
+ "lefthook": "2.1.12",
51
+ "lint-staged": "17.5.1",
52
+ "neostandard": "0.13.0",
53
+ "npm-run-all2": "9.0.3",
54
+ "prettier": "3.9.6",
55
+ "publint": "0.3.24",
56
+ "release-please": "17.11.2",
57
+ "runmd": "2.1.1",
58
+ "standard-version": "9.5.0",
59
+ "typescript": "5.4.3"
60
+ },
61
+ "optionalDevDependencies": {
62
+ "@wdio/browserstack-service": "9.27.0",
63
+ "@wdio/cli": "9.27.0",
64
+ "@wdio/jasmine-framework": "9.27.0",
65
+ "@wdio/local-runner": "9.27.0",
66
+ "@wdio/spec-reporter": "9.27.0",
67
+ "@wdio/static-server-service": "9.27.0"
68
+ },
69
+ "scripts": {
70
+ "build": "./scripts/build.sh",
71
+ "build:watch": "tsc --watch -p tsconfig.json",
72
+ "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json",
73
+ "docs:diff": "npm run docs && git diff README.md",
74
+ "docs": "npm run build && npx runmd --output=README.md README_js.md",
75
+ "biome:check": "biome check .",
76
+ "biome:fix": "biome check --write .",
77
+ "examples:browser:rollup:build": "cd examples/browser-rollup && npm run build",
78
+ "examples:browser:webpack:build": "cd examples/browser-webpack && npm run build",
79
+ "examples:node:esmodules:test": "cd examples/node-esmodules && npm test",
80
+ "examples:node:jest:test": "cd examples/node-jest && npm test",
81
+ "examples:node:typescript:test": "cd examples/typescript && npm test",
82
+ "format": "biome format --write .",
83
+ "format:check": "biome format --check .",
84
+ "lint": "npm run biome:check",
85
+ "md": "runmd --watch --output=README.md README_js.md",
86
+ "prepack": "npm run build -- --no-pack",
87
+ "prepare": "if [ -d .git ]; then npx lefthook install; fi",
88
+ "prepublishOnly": "npm run build",
89
+ "pretest:benchmark": "npm run build",
90
+ "pretest:browser": "./scripts/iodd && npm run build && npm-run-all --parallel examples:browser:**",
91
+ "pretest:node": "npm run build",
92
+ "pretest": "if [ -d .git ]; then npm run build; fi",
93
+ "release": "standard-version --no-verify",
94
+ "test:benchmark": "cd examples/benchmark && npm test",
95
+ "test:browser": "wdio run ./wdio.conf.js",
96
+ "test:node": "npm-run-all --parallel examples:node:**",
97
+ "test:watch": "node --test --enable-source-maps --watch dist-node/test/*.js",
98
+ "test": "node --test --enable-source-maps dist-node/test/*.js"
99
+ },
100
+ "repository": {
101
+ "type": "git",
102
+ "url": "https://github.com/uuidjs/uuid.git"
103
+ },
104
+ "lint-staged": {
105
+ "*": [
106
+ "biome check --write --no-errors-on-unmatched"
107
+ ]
108
+ },
109
+ "standard-version": {
110
+ "scripts": {
111
+ "postchangelog": "biome format --write CHANGELOG.md"
112
+ }
113
+ },
114
+ "packageManager": "npm@12.0.2"
115
+ }
package/package.json CHANGED
@@ -1,6 +1,82 @@
1
1
  {
2
2
  "name": "@astrogate/sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Scoped Astrogate application and infrastructure clients",
5
+ "type": "module",
6
+ "license": "UNLICENSED",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Thimows/eu-infra.git",
10
+ "directory": "sdk"
11
+ },
12
+ "homepage": "https://docs.astrogate.dev/docs/guides/sdk",
13
+ "exports": {
14
+ "./management": {
15
+ "types": "./dist/management.d.ts",
16
+ "node": "./dist/management.js"
17
+ },
18
+ ".": {
19
+ "browser": {
20
+ "types": "./dist/browser.d.ts",
21
+ "default": "./dist/browser.js"
22
+ },
23
+ "node": {
24
+ "types": "./dist/server.d.ts",
25
+ "default": "./dist/server.js"
26
+ },
27
+ "types": "./dist/browser.d.ts"
28
+ },
29
+ "./browser": {
30
+ "types": "./dist/browser.d.ts",
31
+ "default": "./dist/browser.js"
32
+ },
33
+ "./server": {
34
+ "types": "./dist/server.d.ts",
35
+ "node": "./dist/server.js"
36
+ },
37
+ "./react": {
38
+ "types": "./dist/react.d.ts",
39
+ "default": "./dist/react.js"
40
+ },
41
+ "./operator": {
42
+ "types": "./dist/operator.d.ts",
43
+ "node": "./dist/operator.js"
44
+ }
45
+ },
46
+ "dependencies": {
47
+ "@instantdb/admin": "0.0.0",
48
+ "@instantdb/core": "0.0.0",
49
+ "@instantdb/react": "0.0.0",
50
+ "@instantdb/react-common": "0.0.0",
51
+ "@instantdb/version": "0.0.0",
52
+ "@instantdb/webhooks": "0.0.0",
53
+ "better-auth": "1.7.14"
54
+ },
55
+ "bundledDependencies": [
56
+ "@instantdb/admin",
57
+ "@instantdb/core",
58
+ "@instantdb/react",
59
+ "@instantdb/react-common",
60
+ "@instantdb/version",
61
+ "@instantdb/webhooks"
62
+ ],
63
+ "peerDependencies": {
64
+ "react": ">=19.3.1"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "react": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "files": [
72
+ "dist",
73
+ "release.json",
74
+ "THIRD_PARTY_NOTICES.md",
75
+ "native-provenance.json"
76
+ ],
77
+ "publishConfig": {
78
+ "registry": "https://registry.npmjs.org/",
79
+ "access": "public",
80
+ "provenance": false
81
+ }
82
+ }