@noy-db/hub 0.2.0-pre.23 → 0.2.0-pre.25
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.
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +3 -3
- package/dist/aggregate/index.d.ts +3 -3
- package/dist/aggregate/index.js +5 -5
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +4 -4
- package/dist/attestation/index.d.ts +4 -4
- package/dist/attestation/index.js +6 -6
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +6 -6
- package/dist/blobs/index.d.ts +6 -6
- package/dist/blobs/index.js +6 -6
- package/dist/bundle/index.cjs +421 -1209
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +15 -6
- package/dist/bundle/index.d.ts +15 -6
- package/dist/bundle/index.js +42 -193
- package/dist/bundle/index.js.map +1 -1
- package/dist/{chunk-SQOK5UM6.js → chunk-2KA3PDUR.js} +2 -2
- package/dist/{chunk-HYJMAV53.js → chunk-2RHBFCWQ.js} +93 -93
- package/dist/chunk-2RHBFCWQ.js.map +1 -0
- package/dist/{chunk-U2XSUCDF.js → chunk-3BANVNDH.js} +2 -2
- package/dist/{chunk-P65YMN5V.js → chunk-56ENKU46.js} +397 -165
- package/dist/chunk-56ENKU46.js.map +1 -0
- package/dist/{chunk-37VGJM3T.js → chunk-7JSP3E67.js} +2 -2
- package/dist/{chunk-F5ILTHMU.js → chunk-ANLOD6IS.js} +5 -5
- package/dist/{chunk-JYNH4FIM.js → chunk-C7UIT5XY.js} +4 -4
- package/dist/{chunk-OTWT6BAJ.js → chunk-DDOYOMAD.js} +2 -2
- package/dist/chunk-DDOYOMAD.js.map +1 -0
- package/dist/{chunk-TGIJTNM3.js → chunk-E5TJAQS7.js} +2 -2
- package/dist/{chunk-IY24WS2P.js → chunk-EJJTUDNI.js} +4 -4
- package/dist/{chunk-IY24WS2P.js.map → chunk-EJJTUDNI.js.map} +1 -1
- package/dist/{chunk-GJTKMME7.js → chunk-EW3H5Y7N.js} +2 -2
- package/dist/{chunk-JDCPRJVS.js → chunk-EYZJULEN.js} +4 -4
- package/dist/{chunk-I3IYTUUI.js → chunk-FCIZXX56.js} +3 -3
- package/dist/{chunk-C2RJVZZL.js → chunk-FJ3C3ELF.js} +2 -2
- package/dist/{chunk-ZONKSLF2.js → chunk-FO5WEDKF.js} +2 -2
- package/dist/{chunk-SQKAECUL.js → chunk-FUDVHE2U.js} +2 -2
- package/dist/{chunk-IVZWHIEK.js → chunk-GHXOVGTX.js} +5 -5
- package/dist/{chunk-UU6M64HI.js → chunk-GPZHHTJU.js} +4 -4
- package/dist/{chunk-3HNKR65T.js → chunk-H4XFA2LM.js} +3 -3
- package/dist/{chunk-JOK73NDT.js → chunk-HUXDQIVU.js} +3 -3
- package/dist/{chunk-F5GWNSE2.js → chunk-J73KU4AE.js} +3 -3
- package/dist/{chunk-F5GWNSE2.js.map → chunk-J73KU4AE.js.map} +1 -1
- package/dist/{chunk-O5XKZCUD.js → chunk-JJKXJAH2.js} +5 -5
- package/dist/{chunk-TNH5SLCD.js → chunk-KD253AI5.js} +2 -2
- package/dist/{chunk-WWVJXBOT.js → chunk-KJ37E3R5.js} +5 -5
- package/dist/{chunk-S45MDEEF.js → chunk-KNJ7MK4B.js} +2 -2
- package/dist/{chunk-TA6HPKWQ.js → chunk-LR7CODVN.js} +1 -1
- package/dist/chunk-LR7CODVN.js.map +1 -0
- package/dist/{chunk-J6RGRZOY.js → chunk-LX4CPLU6.js} +2 -2
- package/dist/{chunk-WE2BUQD2.js → chunk-N4EXCKWP.js} +3 -3
- package/dist/{chunk-EYK72OTL.js → chunk-OCRDV3NU.js} +5 -5
- package/dist/chunk-OCRDV3NU.js.map +1 -0
- package/dist/{chunk-JBBWALNI.js → chunk-OMBPGXCL.js} +2 -2
- package/dist/{chunk-NV4IHBZS.js → chunk-PS6PSEZL.js} +5 -5
- package/dist/{chunk-6QE4DUYC.js → chunk-Q7P4WHTL.js} +2 -2
- package/dist/{chunk-TAMRU7A2.js → chunk-QYQRAOEF.js} +4 -4
- package/dist/{chunk-6QAZ5O6X.js → chunk-RHVYFAVQ.js} +2 -2
- package/dist/chunk-RZOGD7IF.js +232 -0
- package/dist/chunk-RZOGD7IF.js.map +1 -0
- package/dist/{chunk-YPIOFSN3.js → chunk-SKYBEGHB.js} +2 -2
- package/dist/{chunk-7MRT7EPB.js → chunk-TESFHBOW.js} +3 -3
- package/dist/{chunk-CQYEDODS.js → chunk-TSUICI5N.js} +3 -3
- package/dist/{chunk-FRRJIUSI.js → chunk-UNBX2HMA.js} +17 -9
- package/dist/chunk-UNBX2HMA.js.map +1 -0
- package/dist/{chunk-TYMDCIQM.js → chunk-VGAN5RLD.js} +4 -4
- package/dist/{chunk-5YTXYPES.js → chunk-VJNV2GRF.js} +5 -5
- package/dist/{chunk-NSXNXLYM.js → chunk-VUUQYWF5.js} +2 -2
- package/dist/{chunk-IW4L4X65.js → chunk-WVYL6HM7.js} +2 -2
- package/dist/{chunk-BZW5IL43.js → chunk-Y5CTT6K5.js} +4 -4
- package/dist/{chunk-C6W5KVDV.js → chunk-YP2AYE5W.js} +35 -35
- package/dist/chunk-YP2AYE5W.js.map +1 -0
- package/dist/{chunk-KOAJ3TZM.js → chunk-YRQPI67X.js} +2 -2
- package/dist/{chunk-MBXKRHSS.js → chunk-YYTM4U4J.js} +2 -2
- package/dist/{chunk-2XA2ZML4.js → chunk-ZCBJIDT4.js} +3 -3
- package/dist/{chunk-AI4USDRI.js → chunk-ZW2YSN6G.js} +4 -4
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-456N7UVX.js → crypto-YBKBNPVM.js} +3 -3
- package/dist/{ulid-Dwt3JEcy.d.ts → decrypt-partition-C71vhnND.d.cts} +19 -64
- package/dist/{ulid-Bg-IBJyA.d.cts → decrypt-partition-CyyJUWLR.d.ts} +19 -64
- package/dist/{delegation-DP4COTXB.js → delegation-4JSMM6BB.js} +5 -5
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +6 -6
- package/dist/derivations/index.d.ts +6 -6
- package/dist/derivations/index.js +4 -4
- package/dist/{dev-unlock-Bw7iBD1D.d.cts → dev-unlock-BdrE0kbS.d.cts} +1 -1
- package/dist/{dev-unlock-DzDzLTdZ.d.ts → dev-unlock-ByBkl99-.d.ts} +1 -1
- package/dist/{errors-Dkc_fi-S.d.cts → errors-Dwk2k1xY.d.cts} +14 -5
- package/dist/{errors-Dkc_fi-S.d.ts → errors-Dwk2k1xY.d.ts} +14 -5
- package/dist/executor-3SVNESQ3.js +8 -0
- package/dist/executor-BIW4FT5R.js +12 -0
- package/dist/executor-VEZUBJNQ.js +8 -0
- package/dist/{fanout-sidecar-YXNAEZ33.js → fanout-sidecar-ZQT4Y7PF.js} +2 -2
- package/dist/forget/index.js +4 -4
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +6 -6
- package/dist/guards/index.d.ts +6 -6
- package/dist/guards/index.js +6 -6
- package/dist/{hash-C52X_-m5.d.cts → hash-BUkDp_8Q.d.cts} +1 -1
- package/dist/{hash-DepR-xVc.d.ts → hash-CZxVv8RH.d.ts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +6 -6
- package/dist/history/index.d.ts +6 -6
- package/dist/history/index.js +5 -5
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +5 -5
- package/dist/i18n/index.d.ts +5 -5
- package/dist/i18n/index.js +6 -6
- package/dist/index-CBUhOmrM.d.cts +70 -0
- package/dist/index-DFhKV-6A.d.ts +70 -0
- package/dist/{index-tZqVB9g5.d.cts → index-DoxKSsMj.d.cts} +2 -2
- package/dist/{index-Bm9hIY7t.d.ts → index-LaexBi3v.d.ts} +2 -2
- package/dist/index.cjs +25660 -25495
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +135 -80
- package/dist/index.d.ts +135 -80
- package/dist/index.js +70 -51
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.js +4 -4
- package/dist/issue-LEBPVF3Y.js +12 -0
- package/dist/kernel/index.cjs +657 -0
- package/dist/kernel/index.cjs.map +1 -0
- package/dist/kernel/index.d.cts +11 -0
- package/dist/kernel/index.d.ts +11 -0
- package/dist/kernel/index.js +40 -0
- package/dist/{ledger-I7JUYP4L.js → ledger-FLRTSOYH.js} +5 -5
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +6 -6
- package/dist/materialized-views/index.d.ts +6 -6
- package/dist/materialized-views/index.js +8 -8
- package/dist/{mime-magic-Cxf9B_Dm.d.cts → mime-magic-BAhLjkHw.d.cts} +1 -1
- package/dist/{mime-magic-Dejetix_.d.ts → mime-magic-C1UbcBxP.d.ts} +1 -1
- package/dist/noydb-6FA46A4M.js +38 -0
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +6 -6
- package/dist/overlay-views/index.d.ts +6 -6
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +5 -5
- package/dist/periods/index.d.ts +5 -5
- package/dist/periods/index.js +5 -5
- package/dist/{public-envelope-5XRTUNKF.js → public-envelope-DBKJEBBF.js} +4 -4
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +7 -7
- package/dist/registry-CMEVTOCN.js +8 -0
- package/dist/{registry-NWHOLD5M.js → registry-OUZ3VBZA.js} +3 -3
- package/dist/registry-XUBRO5JJ.js +8 -0
- package/dist/{revoke-5IEK22KT.js → revoke-P5D3UTRX.js} +6 -6
- package/dist/sealed-record/index.cjs.map +1 -1
- package/dist/sealed-record/index.d.cts +1 -1
- package/dist/sealed-record/index.d.ts +1 -1
- package/dist/sealed-record/index.js +2 -2
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +6 -6
- package/dist/session/index.d.ts +6 -6
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +5 -5
- package/dist/shadow/index.d.ts +5 -5
- package/dist/shadow/index.js +2 -2
- package/dist/{signer-I6YARZQA.js → signer-NEQPCHMW.js} +5 -5
- package/dist/snapshots/index.cjs.map +1 -1
- package/dist/snapshots/index.d.cts +5 -5
- package/dist/snapshots/index.d.ts +5 -5
- package/dist/snapshots/index.js +4 -4
- package/dist/{stale-CPESGAPL.js → stale-KKCHF2VB.js} +2 -2
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +5 -5
- package/dist/store/index.d.ts +5 -5
- package/dist/store/index.js +2 -2
- package/dist/{strategy-WtB-jXYv.d.cts → strategy-D1zjEV3n.d.cts} +1 -1
- package/dist/{strategy-54eIwox5.d.ts → strategy-YQ1qJWyq.d.ts} +1 -1
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +4 -4
- package/dist/sync/index.d.ts +4 -4
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +10 -3
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +5 -5
- package/dist/team/index.d.ts +5 -5
- package/dist/team/index.js +8 -8
- package/dist/{transition-guard-Ctxapq1b.d.ts → transition-guard-BSLdikC_.d.ts} +1 -1
- package/dist/{transition-guard-BcLyTGYq.d.cts → transition-guard-DPs6al8h.d.cts} +1 -1
- package/dist/tx/index.cjs +1 -1
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +5 -5
- package/dist/tx/index.d.ts +5 -5
- package/dist/tx/index.js +3 -3
- package/dist/{types-Bhs2i_Ll.d.cts → types-BCYvhKzr.d.cts} +282 -578
- package/dist/{types-DONgts0n.d.ts → types-CCq0WHh9.d.ts} +282 -578
- package/dist/ulid-DRH25k3y.d.cts +66 -0
- package/dist/ulid-DRH25k3y.d.ts +66 -0
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/{with-materialized-view-BYb3p9wT.d.cts → with-materialized-view-CTHe6uh9.d.cts} +1 -1
- package/dist/{with-materialized-view-CyVLOr09.d.ts → with-materialized-view-DiD41wQp.d.ts} +1 -1
- package/dist/{with-overlayed-view-BhLRxqwI.d.ts → with-overlayed-view-DlbsJMhF.d.ts} +1 -1
- package/dist/{with-overlayed-view-LGrQ984e.d.cts → with-overlayed-view-Dlz5hcM8.d.cts} +1 -1
- package/dist/{with-rollup-Bj8c7ttB.d.cts → with-rollup-BBWdrCvu.d.cts} +1 -1
- package/dist/{with-rollup-CO8ibRcK.d.ts → with-rollup-mT4_CWaU.d.ts} +1 -1
- package/package.json +13 -3
- package/dist/chunk-C6W5KVDV.js.map +0 -1
- package/dist/chunk-EYK72OTL.js.map +0 -1
- package/dist/chunk-FRRJIUSI.js.map +0 -1
- package/dist/chunk-HYJMAV53.js.map +0 -1
- package/dist/chunk-JTI57WRT.js +0 -164
- package/dist/chunk-JTI57WRT.js.map +0 -1
- package/dist/chunk-OTWT6BAJ.js.map +0 -1
- package/dist/chunk-P65YMN5V.js.map +0 -1
- package/dist/chunk-TA6HPKWQ.js.map +0 -1
- package/dist/chunk-ZC7J6ZYV.js +0 -7
- package/dist/chunk-ZC7J6ZYV.js.map +0 -1
- package/dist/executor-4IEW4KG5.js +0 -8
- package/dist/executor-KYJCJCIN.js +0 -12
- package/dist/executor-W7VIBOBZ.js +0 -8
- package/dist/issue-JXC6T2QR.js +0 -12
- package/dist/noydb-VGR2HLDB.js +0 -39
- package/dist/registry-ATRHOG5B.js +0 -8
- package/dist/registry-LEHB26TY.js +0 -8
- package/dist/state-vault-JR3CFGNP.js +0 -14
- package/dist/vault-group-BB246VIM.js +0 -804
- package/dist/vault-group-BB246VIM.js.map +0 -1
- /package/dist/{chunk-SQOK5UM6.js.map → chunk-2KA3PDUR.js.map} +0 -0
- /package/dist/{chunk-U2XSUCDF.js.map → chunk-3BANVNDH.js.map} +0 -0
- /package/dist/{chunk-37VGJM3T.js.map → chunk-7JSP3E67.js.map} +0 -0
- /package/dist/{chunk-F5ILTHMU.js.map → chunk-ANLOD6IS.js.map} +0 -0
- /package/dist/{chunk-JYNH4FIM.js.map → chunk-C7UIT5XY.js.map} +0 -0
- /package/dist/{chunk-TGIJTNM3.js.map → chunk-E5TJAQS7.js.map} +0 -0
- /package/dist/{chunk-GJTKMME7.js.map → chunk-EW3H5Y7N.js.map} +0 -0
- /package/dist/{chunk-JDCPRJVS.js.map → chunk-EYZJULEN.js.map} +0 -0
- /package/dist/{chunk-I3IYTUUI.js.map → chunk-FCIZXX56.js.map} +0 -0
- /package/dist/{chunk-C2RJVZZL.js.map → chunk-FJ3C3ELF.js.map} +0 -0
- /package/dist/{chunk-ZONKSLF2.js.map → chunk-FO5WEDKF.js.map} +0 -0
- /package/dist/{chunk-SQKAECUL.js.map → chunk-FUDVHE2U.js.map} +0 -0
- /package/dist/{chunk-IVZWHIEK.js.map → chunk-GHXOVGTX.js.map} +0 -0
- /package/dist/{chunk-UU6M64HI.js.map → chunk-GPZHHTJU.js.map} +0 -0
- /package/dist/{chunk-3HNKR65T.js.map → chunk-H4XFA2LM.js.map} +0 -0
- /package/dist/{chunk-JOK73NDT.js.map → chunk-HUXDQIVU.js.map} +0 -0
- /package/dist/{chunk-O5XKZCUD.js.map → chunk-JJKXJAH2.js.map} +0 -0
- /package/dist/{chunk-TNH5SLCD.js.map → chunk-KD253AI5.js.map} +0 -0
- /package/dist/{chunk-WWVJXBOT.js.map → chunk-KJ37E3R5.js.map} +0 -0
- /package/dist/{chunk-S45MDEEF.js.map → chunk-KNJ7MK4B.js.map} +0 -0
- /package/dist/{chunk-J6RGRZOY.js.map → chunk-LX4CPLU6.js.map} +0 -0
- /package/dist/{chunk-WE2BUQD2.js.map → chunk-N4EXCKWP.js.map} +0 -0
- /package/dist/{chunk-JBBWALNI.js.map → chunk-OMBPGXCL.js.map} +0 -0
- /package/dist/{chunk-NV4IHBZS.js.map → chunk-PS6PSEZL.js.map} +0 -0
- /package/dist/{chunk-6QE4DUYC.js.map → chunk-Q7P4WHTL.js.map} +0 -0
- /package/dist/{chunk-TAMRU7A2.js.map → chunk-QYQRAOEF.js.map} +0 -0
- /package/dist/{chunk-6QAZ5O6X.js.map → chunk-RHVYFAVQ.js.map} +0 -0
- /package/dist/{chunk-YPIOFSN3.js.map → chunk-SKYBEGHB.js.map} +0 -0
- /package/dist/{chunk-7MRT7EPB.js.map → chunk-TESFHBOW.js.map} +0 -0
- /package/dist/{chunk-CQYEDODS.js.map → chunk-TSUICI5N.js.map} +0 -0
- /package/dist/{chunk-TYMDCIQM.js.map → chunk-VGAN5RLD.js.map} +0 -0
- /package/dist/{chunk-5YTXYPES.js.map → chunk-VJNV2GRF.js.map} +0 -0
- /package/dist/{chunk-NSXNXLYM.js.map → chunk-VUUQYWF5.js.map} +0 -0
- /package/dist/{chunk-IW4L4X65.js.map → chunk-WVYL6HM7.js.map} +0 -0
- /package/dist/{chunk-BZW5IL43.js.map → chunk-Y5CTT6K5.js.map} +0 -0
- /package/dist/{chunk-KOAJ3TZM.js.map → chunk-YRQPI67X.js.map} +0 -0
- /package/dist/{chunk-MBXKRHSS.js.map → chunk-YYTM4U4J.js.map} +0 -0
- /package/dist/{chunk-2XA2ZML4.js.map → chunk-ZCBJIDT4.js.map} +0 -0
- /package/dist/{chunk-AI4USDRI.js.map → chunk-ZW2YSN6G.js.map} +0 -0
- /package/dist/{crypto-456N7UVX.js.map → crypto-YBKBNPVM.js.map} +0 -0
- /package/dist/{delegation-DP4COTXB.js.map → delegation-4JSMM6BB.js.map} +0 -0
- /package/dist/{executor-4IEW4KG5.js.map → executor-3SVNESQ3.js.map} +0 -0
- /package/dist/{executor-KYJCJCIN.js.map → executor-BIW4FT5R.js.map} +0 -0
- /package/dist/{executor-W7VIBOBZ.js.map → executor-VEZUBJNQ.js.map} +0 -0
- /package/dist/{fanout-sidecar-YXNAEZ33.js.map → fanout-sidecar-ZQT4Y7PF.js.map} +0 -0
- /package/dist/{issue-JXC6T2QR.js.map → issue-LEBPVF3Y.js.map} +0 -0
- /package/dist/{ledger-I7JUYP4L.js.map → kernel/index.js.map} +0 -0
- /package/dist/{noydb-VGR2HLDB.js.map → ledger-FLRTSOYH.js.map} +0 -0
- /package/dist/{public-envelope-5XRTUNKF.js.map → noydb-6FA46A4M.js.map} +0 -0
- /package/dist/{registry-ATRHOG5B.js.map → public-envelope-DBKJEBBF.js.map} +0 -0
- /package/dist/{registry-LEHB26TY.js.map → registry-CMEVTOCN.js.map} +0 -0
- /package/dist/{registry-NWHOLD5M.js.map → registry-OUZ3VBZA.js.map} +0 -0
- /package/dist/{revoke-5IEK22KT.js.map → registry-XUBRO5JJ.js.map} +0 -0
- /package/dist/{signer-I6YARZQA.js.map → revoke-P5D3UTRX.js.map} +0 -0
- /package/dist/{stale-CPESGAPL.js.map → signer-NEQPCHMW.js.map} +0 -0
- /package/dist/{state-vault-JR3CFGNP.js.map → stale-KKCHF2VB.js.map} +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal ULID generator — zero dependencies, Web Crypto API only.
|
|
3
|
+
*
|
|
4
|
+
*. Used by the bundle writer to generate stable opaque
|
|
5
|
+
* handles for `.noydb` containers.
|
|
6
|
+
*
|
|
7
|
+
* **What's a ULID?** A 128-bit identifier encoded as 26 Crockford
|
|
8
|
+
* base32 characters. Layout:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* 01HYABCDEFGHJKMNPQRSTVWXYZ
|
|
12
|
+
* |--------||---------------|
|
|
13
|
+
* 48-bit 80-bit
|
|
14
|
+
* timestamp randomness
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The first 10 chars encode a millisecond Unix timestamp (so ULIDs
|
|
18
|
+
* sort lexicographically by creation time), and the remaining 16
|
|
19
|
+
* chars are random. Crockford base32 omits I/L/O/U to avoid
|
|
20
|
+
* ambiguity in handwriting and URLs.
|
|
21
|
+
*
|
|
22
|
+
* **Why hand-roll instead of pulling in `ulid`?** The package adds
|
|
23
|
+
* a dep, the implementation is ~30 lines, and the bundle module
|
|
24
|
+
* is the only consumer. Adding `ulid` would also drag in its own
|
|
25
|
+
* crypto polyfill that we don't need on Node 18+ or modern
|
|
26
|
+
* browsers.
|
|
27
|
+
*
|
|
28
|
+
* **Privacy consideration:** the timestamp prefix is observable in
|
|
29
|
+
* the bundle header. This is a deliberate trade-off:
|
|
30
|
+
* - Pro: lexicographic sortability lets bundle adapters list
|
|
31
|
+
* newest-first without an extra index.
|
|
32
|
+
* - Con: a casual observer can read the bundle's creation time
|
|
33
|
+
* from the handle. They cannot read it from any OTHER field
|
|
34
|
+
* (the header explicitly forbids `_exported_at`), and a
|
|
35
|
+
* creation timestamp is the same kind of metadata that
|
|
36
|
+
* filesystem mtime would already expose for a downloaded
|
|
37
|
+
* bundle. The leak is therefore equivalent to what's already
|
|
38
|
+
* visible from the file's mtime — not a new exposure.
|
|
39
|
+
*
|
|
40
|
+
* If a future use case needs timestamp-free handles, a v2 of the
|
|
41
|
+
* format could specify "use the random portion only" without a
|
|
42
|
+
* format break — `validateBundleHeader` only checks the regex
|
|
43
|
+
* shape, not the encoded timestamp.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Generate a fresh ULID. Uses `crypto.getRandomValues` for the
|
|
47
|
+
* randomness portion — same Web Crypto API the rest of the
|
|
48
|
+
* codebase uses for IVs and salt.
|
|
49
|
+
*
|
|
50
|
+
* Returns a 26-character string. Calling twice in the same
|
|
51
|
+
* millisecond produces two distinct ULIDs (the random portion
|
|
52
|
+
* differs); ULIDs from the same millisecond are NOT guaranteed
|
|
53
|
+
* to be monotonically ordered relative to each other, only
|
|
54
|
+
* relative to ULIDs from a different millisecond. The bundle
|
|
55
|
+
* format never relies on intra-millisecond ordering.
|
|
56
|
+
*/
|
|
57
|
+
declare function generateULID(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Validate that a string is a syntactically well-formed ULID. Used
|
|
60
|
+
* by the bundle header validator. Does NOT verify that the
|
|
61
|
+
* timestamp portion decodes to a sensible date — the format only
|
|
62
|
+
* cares about the encoding shape.
|
|
63
|
+
*/
|
|
64
|
+
declare function isULID(value: string): boolean;
|
|
65
|
+
|
|
66
|
+
export { generateULID as g, isULID as i };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal ULID generator — zero dependencies, Web Crypto API only.
|
|
3
|
+
*
|
|
4
|
+
*. Used by the bundle writer to generate stable opaque
|
|
5
|
+
* handles for `.noydb` containers.
|
|
6
|
+
*
|
|
7
|
+
* **What's a ULID?** A 128-bit identifier encoded as 26 Crockford
|
|
8
|
+
* base32 characters. Layout:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* 01HYABCDEFGHJKMNPQRSTVWXYZ
|
|
12
|
+
* |--------||---------------|
|
|
13
|
+
* 48-bit 80-bit
|
|
14
|
+
* timestamp randomness
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The first 10 chars encode a millisecond Unix timestamp (so ULIDs
|
|
18
|
+
* sort lexicographically by creation time), and the remaining 16
|
|
19
|
+
* chars are random. Crockford base32 omits I/L/O/U to avoid
|
|
20
|
+
* ambiguity in handwriting and URLs.
|
|
21
|
+
*
|
|
22
|
+
* **Why hand-roll instead of pulling in `ulid`?** The package adds
|
|
23
|
+
* a dep, the implementation is ~30 lines, and the bundle module
|
|
24
|
+
* is the only consumer. Adding `ulid` would also drag in its own
|
|
25
|
+
* crypto polyfill that we don't need on Node 18+ or modern
|
|
26
|
+
* browsers.
|
|
27
|
+
*
|
|
28
|
+
* **Privacy consideration:** the timestamp prefix is observable in
|
|
29
|
+
* the bundle header. This is a deliberate trade-off:
|
|
30
|
+
* - Pro: lexicographic sortability lets bundle adapters list
|
|
31
|
+
* newest-first without an extra index.
|
|
32
|
+
* - Con: a casual observer can read the bundle's creation time
|
|
33
|
+
* from the handle. They cannot read it from any OTHER field
|
|
34
|
+
* (the header explicitly forbids `_exported_at`), and a
|
|
35
|
+
* creation timestamp is the same kind of metadata that
|
|
36
|
+
* filesystem mtime would already expose for a downloaded
|
|
37
|
+
* bundle. The leak is therefore equivalent to what's already
|
|
38
|
+
* visible from the file's mtime — not a new exposure.
|
|
39
|
+
*
|
|
40
|
+
* If a future use case needs timestamp-free handles, a v2 of the
|
|
41
|
+
* format could specify "use the random portion only" without a
|
|
42
|
+
* format break — `validateBundleHeader` only checks the regex
|
|
43
|
+
* shape, not the encoded timestamp.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Generate a fresh ULID. Uses `crypto.getRandomValues` for the
|
|
47
|
+
* randomness portion — same Web Crypto API the rest of the
|
|
48
|
+
* codebase uses for IVs and salt.
|
|
49
|
+
*
|
|
50
|
+
* Returns a 26-character string. Calling twice in the same
|
|
51
|
+
* millisecond produces two distinct ULIDs (the random portion
|
|
52
|
+
* differs); ULIDs from the same millisecond are NOT guaranteed
|
|
53
|
+
* to be monotonically ordered relative to each other, only
|
|
54
|
+
* relative to ULIDs from a different millisecond. The bundle
|
|
55
|
+
* format never relies on intra-millisecond ordering.
|
|
56
|
+
*/
|
|
57
|
+
declare function generateULID(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Validate that a string is a syntactically well-formed ULID. Used
|
|
60
|
+
* by the bundle header validator. Does NOT verify that the
|
|
61
|
+
* timestamp portion decodes to a sensible date — the format only
|
|
62
|
+
* cares about the encoding shape.
|
|
63
|
+
*/
|
|
64
|
+
declare function isULID(value: string): boolean;
|
|
65
|
+
|
|
66
|
+
export { generateULID as g, isULID as i };
|