@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,491 @@
1
+ <!--
2
+ -- This file is auto-generated from README_js.md. Changes should be made there.
3
+ -->
4
+
5
+ # uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions/workflows/browser.yml)
6
+
7
+ For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formerly [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs
8
+
9
+ - **Complete** - Support for all RFC9562 UUID versions
10
+ - **Cross-platform** - Support for...
11
+ - [Typescript](#support)
12
+ - [Chrome, Safari, Firefox, and Edge](#support)
13
+ - [NodeJS](#support)
14
+ - [React Native / Expo](#react-native--expo)
15
+ - **Secure** - Uses modern `crypto` API for random values
16
+ - **Compact** - Zero-dependency, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
17
+ - **CLI** - [`uuid` command line](#command-line) utility
18
+
19
+ <!-- prettier-ignore -->
20
+ > [!NOTE]
21
+ >
22
+ > Starting with `uuid@12` CommonJS is no longer supported. See [implications](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) and [motivation](https://github.com/uuidjs/uuid/issues/881) for details.
23
+
24
+ ## Quickstart
25
+
26
+ **1. Install**
27
+
28
+ ```shell
29
+ npm install uuid
30
+ ```
31
+
32
+ **2. Create a UUID**
33
+
34
+ ```javascript
35
+ import { v4 as uuidv4 } from 'uuid';
36
+
37
+ uuidv4(); // ⇨ 'b18794e8-5d0d-417c-b361-ba38e78411b4'
38
+ ```
39
+
40
+ For timestamp UUIDs, namespace UUIDs, and other options read on ...
41
+
42
+ ## API Summary
43
+
44
+ | | |
45
+ | --- | --- |
46
+ | [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) |
47
+ | [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) |
48
+ | [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes |
49
+ | [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string |
50
+ | [`uuid.v1()`](#uuidv1options-buffer-offset) | Generate a version 1 (timestamp) UUID |
51
+ | [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Convert a version 1 UUID to version 6 |
52
+ | [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Generate a version 3 (namespace w/ MD5) UUID |
53
+ | [`uuid.v4()`](#uuidv4options-buffer-offset) | Generate a version 4 (random) UUID |
54
+ | [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Generate a version 5 (namespace w/ SHA-1) UUID |
55
+ | [`uuid.v6()`](#uuidv6options-buffer-offset) | Generate a version 6 (timestamp, reordered) UUID |
56
+ | [`uuid.v6ToV1()`](#uuidv6tov1uuid) | Convert a version 6 UUID to version 1 |
57
+ | [`uuid.v7()`](#uuidv7options-buffer-offset) | Generate a version 7 (Unix Epoch time-based) UUID |
58
+ | ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" |
59
+ | [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID |
60
+ | [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID |
61
+
62
+ ## API
63
+
64
+ ### uuid.NIL
65
+
66
+ The nil UUID string (all zeros).
67
+
68
+ Example:
69
+
70
+ ```javascript
71
+ import { NIL as NIL_UUID } from 'uuid';
72
+
73
+ NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000'
74
+ ```
75
+
76
+ ### uuid.MAX
77
+
78
+ The max UUID string (all ones).
79
+
80
+ Example:
81
+
82
+ ```javascript
83
+ import { MAX as MAX_UUID } from 'uuid';
84
+
85
+ MAX_UUID; // ⇨ 'ffffffff-ffff-ffff-ffff-ffffffffffff'
86
+ ```
87
+
88
+ ### uuid.parse(str)
89
+
90
+ Convert UUID string to array of bytes
91
+
92
+ | | |
93
+ | --------- | ---------------------------------------- |
94
+ | `str` | A valid UUID `String` |
95
+ | _returns_ | `Uint8Array[16]` |
96
+ | _throws_ | `TypeError` if `str` is not a valid UUID |
97
+
98
+ <!-- prettier-ignore -->
99
+ > [!NOTE]
100
+ > Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left &Rarr; right order of hex-pairs in UUID strings. As shown in the example below.
101
+
102
+ Example:
103
+
104
+ ```javascript
105
+ import { parse as uuidParse } from 'uuid';
106
+
107
+ // Parse a UUID
108
+ uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨
109
+ // Uint8Array(16) [
110
+ // 110, 192, 189, 127, 17,
111
+ // 192, 67, 218, 151, 94,
112
+ // 42, 138, 217, 235, 174,
113
+ // 11
114
+ // ]
115
+ ```
116
+
117
+ ### uuid.stringify(arr[, offset])
118
+
119
+ Convert array of bytes to UUID string
120
+
121
+ | | |
122
+ | -------------- | ---------------------------------------------------------------------------- |
123
+ | `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. |
124
+ | [`offset` = 0] | `Number` Starting index in the Array |
125
+ | _returns_ | `String` |
126
+ | _throws_ | `TypeError` if a valid UUID string cannot be generated |
127
+
128
+ <!-- prettier-ignore -->
129
+ > [!NOTE]
130
+ > Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left &Rarr; right order of hex-pairs in UUID strings. As shown in the example below.
131
+
132
+ Example:
133
+
134
+ ```javascript
135
+ import { stringify as uuidStringify } from 'uuid';
136
+
137
+ const uuidBytes = Uint8Array.of(
138
+ 0x6e,
139
+ 0xc0,
140
+ 0xbd,
141
+ 0x7f,
142
+ 0x11,
143
+ 0xc0,
144
+ 0x43,
145
+ 0xda,
146
+ 0x97,
147
+ 0x5e,
148
+ 0x2a,
149
+ 0x8a,
150
+ 0xd9,
151
+ 0xeb,
152
+ 0xae,
153
+ 0x0b
154
+ );
155
+
156
+ uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
157
+ ```
158
+
159
+ ### uuid.v1([options[, buffer[, offset]]])
160
+
161
+ Create an RFC version 1 (timestamp) UUID
162
+
163
+ | | |
164
+ | --- | --- |
165
+ | [`options`] | `Object` with one or more of the following properties: |
166
+ | [`options.node = (random)` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
167
+ | [`options.clockseq = (random)`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
168
+ | [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
169
+ | [`options.nsecs = 0`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) |
170
+ | [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
171
+ | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
172
+ | [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` |
173
+ | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
174
+ | _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
175
+ | _throws_ | `Error` if more than 10M UUIDs/sec are requested |
176
+
177
+ Example:
178
+
179
+ ```javascript
180
+ import { v1 as uuidv1 } from 'uuid';
181
+
182
+ uuidv1(); // ⇨ '57fd0000-c7d3-11ef-841d-514d2167fc5b'
183
+ ```
184
+
185
+ Example using `options`:
186
+
187
+ ```javascript
188
+ import { v1 as uuidv1 } from 'uuid';
189
+
190
+ const options = {
191
+ node: Uint8Array.of(0x01, 0x23, 0x45, 0x67, 0x89, 0xab),
192
+ clockseq: 0x1234,
193
+ msecs: new Date('2011-11-01').getTime(),
194
+ nsecs: 5678,
195
+ };
196
+ uuidv1(options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
197
+ ```
198
+
199
+ ### uuid.v1ToV6(uuid)
200
+
201
+ Convert a UUID from version 1 to version 6
202
+
203
+ ```javascript
204
+ import { v1ToV6 } from 'uuid';
205
+
206
+ v1ToV6('92f62d9e-22c4-11ef-97e9-325096b39f47'); // ⇨ '1ef22c49-2f62-6d9e-97e9-325096b39f47'
207
+ ```
208
+
209
+ ### uuid.v3(name, namespace[, buffer[, offset]])
210
+
211
+ Create an RFC version 3 (namespace w/ MD5) UUID
212
+
213
+ API is identical to `v5()`, but uses "v3" instead.
214
+
215
+ <!-- prettier-ignore -->
216
+ > [!IMPORTANT]
217
+ > Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
218
+
219
+ ### uuid.v4([options[, buffer[, offset]]])
220
+
221
+ Create an RFC version 4 (random) UUID
222
+
223
+ | | |
224
+ | --- | --- |
225
+ | [`options`] | `Object` with one or more of the following properties: |
226
+ | [`options.random`] | `Array` of 16 random bytes (0-255) |
227
+ | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
228
+ | [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` |
229
+ | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
230
+ | _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
231
+
232
+ Example:
233
+
234
+ ```javascript
235
+ import { v4 as uuidv4 } from 'uuid';
236
+
237
+ uuidv4(); // ⇨ 'b18794e8-5d0d-417c-b361-ba38e78411b4'
238
+ ```
239
+
240
+ Example using predefined `random` values:
241
+
242
+ ```javascript
243
+ import { v4 as uuidv4 } from 'uuid';
244
+
245
+ const v4options = {
246
+ random: Uint8Array.of(
247
+ 0x10,
248
+ 0x91,
249
+ 0x56,
250
+ 0xbe,
251
+ 0xc4,
252
+ 0xfb,
253
+ 0xc1,
254
+ 0xea,
255
+ 0x71,
256
+ 0xb4,
257
+ 0xef,
258
+ 0xe1,
259
+ 0x67,
260
+ 0x1c,
261
+ 0x58,
262
+ 0x36
263
+ ),
264
+ };
265
+ uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836'
266
+ ```
267
+
268
+ ### uuid.v5(name, namespace[, buffer[, offset]])
269
+
270
+ Create an RFC version 5 (namespace w/ SHA-1) UUID
271
+
272
+ | | |
273
+ | --- | --- |
274
+ | `name` | `String \| Array` |
275
+ | `namespace` | `String \| Array[16]` Namespace UUID |
276
+ | [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` |
277
+ | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
278
+ | _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
279
+
280
+ <!-- prettier-ignore -->
281
+ > [!NOTE]
282
+ > The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
283
+
284
+ Example with custom namespace:
285
+
286
+ ```javascript
287
+ import { v5 as uuidv5 } from 'uuid';
288
+
289
+ // Define a custom namespace. Readers, create your own using something like
290
+ // https://www.uuidgenerator.net/
291
+ const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
292
+
293
+ uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
294
+ ```
295
+
296
+ Example with RFC `URL` namespace:
297
+
298
+ ```javascript
299
+ import { v5 as uuidv5 } from 'uuid';
300
+
301
+ uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1'
302
+ ```
303
+
304
+ ### uuid.v6([options[, buffer[, offset]]])
305
+
306
+ Create an RFC version 6 (timestamp, reordered) UUID
307
+
308
+ This method takes the same arguments as uuid.v1().
309
+
310
+ ```javascript
311
+ import { v6 as uuidv6 } from 'uuid';
312
+
313
+ uuidv6(); // ⇨ '1efc7d35-7fd0-6000-841d-504d2167fc5b'
314
+ ```
315
+
316
+ Example using `options`:
317
+
318
+ ```javascript
319
+ import { v6 as uuidv6 } from 'uuid';
320
+
321
+ const options = {
322
+ node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
323
+ clockseq: 0x1234,
324
+ msecs: new Date('2011-11-01').getTime(),
325
+ nsecs: 5678,
326
+ };
327
+ uuidv6(options); // ⇨ '1e1041c7-10b9-662e-9234-0123456789ab'
328
+ ```
329
+
330
+ ### uuid.v6ToV1(uuid)
331
+
332
+ Convert a UUID from version 6 to version 1
333
+
334
+ ```javascript
335
+ import { v6ToV1 } from 'uuid';
336
+
337
+ v6ToV1('1ef22c49-2f62-6d9e-97e9-325096b39f47'); // ⇨ '92f62d9e-22c4-11ef-97e9-325096b39f47'
338
+ ```
339
+
340
+ ### uuid.v7([options[, buffer[, offset]]])
341
+
342
+ Create an RFC version 7 (random) UUID
343
+
344
+ | | |
345
+ | --- | --- |
346
+ | [`options`] | `Object` with one or more of the following properties: |
347
+ | [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
348
+ | [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
349
+ | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
350
+ | [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
351
+ | [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` |
352
+ | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
353
+ | _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
354
+
355
+ Example:
356
+
357
+ ```javascript
358
+ import { v7 as uuidv7 } from 'uuid';
359
+
360
+ uuidv7(); // ⇨ '01941f29-7c00-73e4-a310-744d2167fc5b'
361
+ ```
362
+
363
+ ### ~~uuid.v8()~~
364
+
365
+ **_"Intentionally left blank"_**
366
+
367
+ <!-- prettier-ignore -->
368
+ > [!NOTE]
369
+ > Version 8 (experimental) UUIDs are "[for experimental or vendor-specific use cases](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-8)". The RFC does not define a creation algorithm for them, which is why this package does not offer a `v8()` method. The `validate()` and `version()` methods do work with such UUIDs, however.
370
+
371
+ ### uuid.validate(str)
372
+
373
+ Test a string to see if it is a valid UUID
374
+
375
+ | | |
376
+ | --------- | --------------------------------------------------- |
377
+ | `str` | `String` to validate |
378
+ | _returns_ | `true` if string is a valid UUID, `false` otherwise |
379
+
380
+ Example:
381
+
382
+ ```javascript
383
+ import { validate as uuidValidate } from 'uuid';
384
+
385
+ uuidValidate('not a UUID'); // ⇨ false
386
+ uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true
387
+ ```
388
+
389
+ Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds.
390
+
391
+ ```javascript
392
+ import { version as uuidVersion } from 'uuid';
393
+ import { validate as uuidValidate } from 'uuid';
394
+
395
+ function uuidValidateV4(uuid) {
396
+ return uuidValidate(uuid) && uuidVersion(uuid) === 4;
397
+ }
398
+
399
+ const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210';
400
+ const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836';
401
+
402
+ uuidValidateV4(v4Uuid); // ⇨ true
403
+ uuidValidateV4(v1Uuid); // ⇨ false
404
+ ```
405
+
406
+ ### uuid.version(str)
407
+
408
+ Detect RFC version of a UUID
409
+
410
+ | | |
411
+ | --------- | ---------------------------------------- |
412
+ | `str` | A valid UUID `String` |
413
+ | _returns_ | `Number` The RFC version of the UUID |
414
+ | _throws_ | `TypeError` if `str` is not a valid UUID |
415
+
416
+ Example:
417
+
418
+ ```javascript
419
+ import { version as uuidVersion } from 'uuid';
420
+
421
+ uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1
422
+ uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4
423
+ ```
424
+
425
+ <!-- prettier-ignore -->
426
+ > [!NOTE]
427
+ > This method returns `0` for the `NIL` UUID, and `15` for the `MAX` UUID.
428
+
429
+ ## Command Line
430
+
431
+ UUIDs can be generated from the command line using `uuid`.
432
+
433
+ ```shell
434
+ $ npx uuid
435
+ ddeb27fb-d9a0-4624-be4d-4615062daed4
436
+ ```
437
+
438
+ The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details:
439
+
440
+ ```shell
441
+ $ npx uuid --help
442
+
443
+ Usage:
444
+ uuid
445
+ uuid v1
446
+ uuid v3 <name> <namespace uuid>
447
+ uuid v4
448
+ uuid v5 <name> <namespace uuid>
449
+ uuid v7
450
+ uuid --help
451
+
452
+ Note: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs
453
+ defined by RFC9562
454
+ ```
455
+
456
+ ## `options` Handling for Timestamp UUIDs
457
+
458
+ Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
459
+
460
+ - Without `options`: Internal state is utilized to improve UUID uniqueness.
461
+ - With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
462
+
463
+ ## Support
464
+
465
+ **Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested.
466
+
467
+ **Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L31) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. At the time of this writing `node@20` is the "maintenance" release and `node@24` is the "current" release, so `uuid` supports `node@20`-`node@24`.
468
+
469
+ **Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715)
470
+
471
+ ## Known issues
472
+
473
+ <!-- This header is referenced as an anchor in src/rng.ts -->
474
+
475
+ ### "getRandomValues() not supported"
476
+
477
+ This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
478
+
479
+ #### React Native / Expo
480
+
481
+ 1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
482
+ 1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:
483
+
484
+ ```javascript
485
+ import 'react-native-get-random-values';
486
+ import { v4 as uuidv4 } from 'uuid';
487
+ ```
488
+
489
+ ---
490
+
491
+ Generated from [README_js.md](README_js.md) by [`runmd`](https://github.com/broofa/runmd)
@@ -0,0 +1,15 @@
1
+ export { default as MAX } from './max.js';
2
+ export { default as NIL } from './nil.js';
3
+ export { default as parse } from './parse.js';
4
+ export { default as stringify } from './stringify.js';
5
+ export type * from './types.js';
6
+ export { default as v1 } from './v1.js';
7
+ export { default as v1ToV6 } from './v1ToV6.js';
8
+ export { default as v3 } from './v3.js';
9
+ export { default as v4 } from './v4.js';
10
+ export { default as v5 } from './v5.js';
11
+ export { default as v6 } from './v6.js';
12
+ export { default as v6ToV1 } from './v6ToV1.js';
13
+ export { default as v7 } from './v7.js';
14
+ export { default as validate } from './validate.js';
15
+ export { default as version } from './version.js';
@@ -0,0 +1,14 @@
1
+ export { default as MAX } from './max.js';
2
+ export { default as NIL } from './nil.js';
3
+ export { default as parse } from './parse.js';
4
+ export { default as stringify } from './stringify.js';
5
+ export { default as v1 } from './v1.js';
6
+ export { default as v1ToV6 } from './v1ToV6.js';
7
+ export { default as v3 } from './v3.js';
8
+ export { default as v4 } from './v4.js';
9
+ export { default as v5 } from './v5.js';
10
+ export { default as v6 } from './v6.js';
11
+ export { default as v6ToV1 } from './v6ToV1.js';
12
+ export { default as v7 } from './v7.js';
13
+ export { default as validate } from './validate.js';
14
+ export { default as version } from './version.js';
@@ -0,0 +1,2 @@
1
+ declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff";
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default 'ffffffff-ffff-ffff-ffff-ffffffffffff';
@@ -0,0 +1,2 @@
1
+ declare function md5(bytes: Uint8Array): Uint8Array;
2
+ export default md5;
@@ -0,0 +1,135 @@
1
+ function md5(bytes) {
2
+ const words = uint8ToUint32(bytes);
3
+ const md5Bytes = wordsToMd5(words, bytes.length * 8);
4
+ return uint32ToUint8(md5Bytes);
5
+ }
6
+ function uint32ToUint8(input) {
7
+ const bytes = new Uint8Array(input.length * 4);
8
+ for (let i = 0; i < input.length * 4; i++) {
9
+ bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff;
10
+ }
11
+ return bytes;
12
+ }
13
+ function getOutputLength(inputLength8) {
14
+ return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1;
15
+ }
16
+ function wordsToMd5(x, len) {
17
+ const xpad = new Uint32Array(getOutputLength(len)).fill(0);
18
+ xpad.set(x);
19
+ xpad[len >> 5] |= 0x80 << (len % 32);
20
+ xpad[xpad.length - 1] = len;
21
+ x = xpad;
22
+ let a = 1732584193;
23
+ let b = -271733879;
24
+ let c = -1732584194;
25
+ let d = 271733878;
26
+ for (let i = 0; i < x.length; i += 16) {
27
+ const olda = a;
28
+ const oldb = b;
29
+ const oldc = c;
30
+ const oldd = d;
31
+ a = md5ff(a, b, c, d, x[i], 7, -680876936);
32
+ d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
33
+ c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
34
+ b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
35
+ a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
36
+ d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
37
+ c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
38
+ b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
39
+ a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
40
+ d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
41
+ c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
42
+ b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
43
+ a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
44
+ d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
45
+ c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
46
+ b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
47
+ a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
48
+ d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
49
+ c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
50
+ b = md5gg(b, c, d, a, x[i], 20, -373897302);
51
+ a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
52
+ d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
53
+ c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
54
+ b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
55
+ a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
56
+ d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
57
+ c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
58
+ b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
59
+ a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
60
+ d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
61
+ c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
62
+ b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
63
+ a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
64
+ d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
65
+ c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
66
+ b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
67
+ a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
68
+ d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
69
+ c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
70
+ b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
71
+ a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
72
+ d = md5hh(d, a, b, c, x[i], 11, -358537222);
73
+ c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
74
+ b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
75
+ a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
76
+ d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
77
+ c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
78
+ b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
79
+ a = md5ii(a, b, c, d, x[i], 6, -198630844);
80
+ d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
81
+ c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
82
+ b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
83
+ a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
84
+ d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
85
+ c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
86
+ b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
87
+ a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
88
+ d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
89
+ c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
90
+ b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
91
+ a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
92
+ d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
93
+ c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
94
+ b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
95
+ a = safeAdd(a, olda);
96
+ b = safeAdd(b, oldb);
97
+ c = safeAdd(c, oldc);
98
+ d = safeAdd(d, oldd);
99
+ }
100
+ return Uint32Array.of(a, b, c, d);
101
+ }
102
+ function uint8ToUint32(input) {
103
+ if (input.length === 0) {
104
+ return new Uint32Array();
105
+ }
106
+ const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0);
107
+ for (let i = 0; i < input.length; i++) {
108
+ output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8);
109
+ }
110
+ return output;
111
+ }
112
+ function safeAdd(x, y) {
113
+ const lsw = (x & 0xffff) + (y & 0xffff);
114
+ const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
115
+ return (msw << 16) | (lsw & 0xffff);
116
+ }
117
+ function bitRotateLeft(num, cnt) {
118
+ return (num << cnt) | (num >>> (32 - cnt));
119
+ }
120
+ function md5cmn(q, a, b, x, s, t) {
121
+ return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
122
+ }
123
+ function md5ff(a, b, c, d, x, s, t) {
124
+ return md5cmn((b & c) | (~b & d), a, b, x, s, t);
125
+ }
126
+ function md5gg(a, b, c, d, x, s, t) {
127
+ return md5cmn((b & d) | (c & ~d), a, b, x, s, t);
128
+ }
129
+ function md5hh(a, b, c, d, x, s, t) {
130
+ return md5cmn(b ^ c ^ d, a, b, x, s, t);
131
+ }
132
+ function md5ii(a, b, c, d, x, s, t) {
133
+ return md5cmn(c ^ (b | ~d), a, b, x, s, t);
134
+ }
135
+ export default md5;
@@ -0,0 +1,2 @@
1
+ declare const _default: "00000000-0000-0000-0000-000000000000";
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default '00000000-0000-0000-0000-000000000000';
@@ -0,0 +1,3 @@
1
+ import type { NonSharedArrayBuffer } from './types.js';
2
+ declare function parse(uuid: string): NonSharedArrayBuffer;
3
+ export default parse;
@@ -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;