@noy-db/hub 0.2.0-pre.9 → 0.3.0-pre.1
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/README.md +129 -3
- package/dist/adapter/index.d.ts +5 -0
- package/dist/adapter/index.js +15 -0
- package/dist/aggregate/index.d.ts +6 -2
- package/dist/aggregate/index.js +24 -16
- package/dist/aggregate/index.js.map +1 -1
- package/dist/api-RW3KP7WU.js +14 -0
- package/dist/as/index.d.ts +7 -0
- package/dist/as/index.js +24 -0
- package/dist/at/index.d.ts +5 -0
- package/dist/at/index.js +1 -0
- package/dist/attestation/index.d.ts +15 -47
- package/dist/attestation/index.js +54 -10
- package/dist/attestation/index.js.map +1 -1
- package/dist/backup-XV3IOEGB.js +217 -0
- package/dist/backup-XV3IOEGB.js.map +1 -0
- package/dist/blobs/index.d.ts +6 -8
- package/dist/blobs/index.js +19 -12
- package/dist/blobs/index.js.map +1 -1
- package/dist/bundle/index.d.ts +16 -70
- package/dist/bundle/index.js +39 -476
- package/dist/bundle/index.js.map +1 -1
- package/dist/{ulid-CJ8RzRrm.d.ts → bundle-CH-H06dp.d.ts} +31 -86
- package/dist/by/index.d.ts +1 -0
- package/dist/by/index.js +11 -0
- package/dist/cargo/index.d.ts +9 -0
- package/dist/cargo/index.js +89 -0
- package/dist/chunk-26LGBE4T.js +42 -0
- package/dist/chunk-26LGBE4T.js.map +1 -0
- package/dist/chunk-2P2HZEXU.js +233 -0
- package/dist/chunk-2P2HZEXU.js.map +1 -0
- package/dist/{chunk-K3DK3NU5.js → chunk-3YFXJ3ZP.js} +20 -5
- package/dist/chunk-3YFXJ3ZP.js.map +1 -0
- package/dist/chunk-4Q6HSHHL.js +90 -0
- package/dist/chunk-4Q6HSHHL.js.map +1 -0
- package/dist/chunk-5LUY7UTV.js +380 -0
- package/dist/chunk-5LUY7UTV.js.map +1 -0
- package/dist/chunk-5N6CZTCY.js +367 -0
- package/dist/chunk-5N6CZTCY.js.map +1 -0
- package/dist/chunk-5O3AOPDT.js +992 -0
- package/dist/chunk-5O3AOPDT.js.map +1 -0
- package/dist/chunk-5R3ERCDH.js +239 -0
- package/dist/chunk-5R3ERCDH.js.map +1 -0
- package/dist/{chunk-6CME4UEK.js → chunk-5R5JW2JT.js} +7000 -4827
- package/dist/chunk-5R5JW2JT.js.map +1 -0
- package/dist/chunk-5TDJ56JE.js +32 -0
- package/dist/chunk-5TDJ56JE.js.map +1 -0
- package/dist/{chunk-T7JEBOGN.js → chunk-62QYRORB.js} +18 -11
- package/dist/chunk-62QYRORB.js.map +1 -0
- package/dist/{chunk-J66GRPNH.js → chunk-6S7T6WC4.js} +2 -2
- package/dist/chunk-6S7T6WC4.js.map +1 -0
- package/dist/chunk-76722EBH.js +451 -0
- package/dist/chunk-76722EBH.js.map +1 -0
- package/dist/{chunk-Z6FNBOTC.js → chunk-AIWULCUO.js} +13 -17
- package/dist/chunk-AIWULCUO.js.map +1 -0
- package/dist/{chunk-O3VZPBZG.js → chunk-AQTBSL7R.js} +47 -11
- package/dist/chunk-AQTBSL7R.js.map +1 -0
- package/dist/chunk-AURFOK3D.js +35 -0
- package/dist/chunk-AURFOK3D.js.map +1 -0
- package/dist/{chunk-53XBRIRT.js → chunk-AXRXJTE2.js} +9 -9
- package/dist/chunk-AXRXJTE2.js.map +1 -0
- package/dist/chunk-AZAOEIKW.js +155 -0
- package/dist/chunk-AZAOEIKW.js.map +1 -0
- package/dist/{chunk-HNRHLRDC.js → chunk-BG3SPSR4.js} +3 -3
- package/dist/chunk-BG3SPSR4.js.map +1 -0
- package/dist/chunk-BGIZAFY7.js +1 -0
- package/dist/chunk-CHFZDSE4.js +1 -0
- package/dist/{chunk-DJHHA6XH.js → chunk-CMGR4ZEW.js} +50 -20
- package/dist/chunk-CMGR4ZEW.js.map +1 -0
- package/dist/chunk-CWPPNPOH.js +23 -0
- package/dist/chunk-CWPPNPOH.js.map +1 -0
- package/dist/{chunk-QODLLGQ7.js → chunk-DFEMTNPJ.js} +371 -38
- package/dist/chunk-DFEMTNPJ.js.map +1 -0
- package/dist/{chunk-ZYWZWG6G.js → chunk-DGDI2D4M.js} +10 -10
- package/dist/chunk-DGDI2D4M.js.map +1 -0
- package/dist/{chunk-SYMWGEET.js → chunk-EIZUR2XW.js} +3 -3
- package/dist/chunk-EIZUR2XW.js.map +1 -0
- package/dist/{chunk-BVRYKATC.js → chunk-FISN7WE4.js} +36 -33
- package/dist/chunk-FISN7WE4.js.map +1 -0
- package/dist/chunk-GHVIKOHT.js +1 -0
- package/dist/chunk-GYGWYIOZ.js +200 -0
- package/dist/chunk-GYGWYIOZ.js.map +1 -0
- package/dist/chunk-HCIPRAGS.js +45 -0
- package/dist/chunk-HCIPRAGS.js.map +1 -0
- package/dist/{chunk-PX35GA7L.js → chunk-I2NOIW44.js} +10 -10
- package/dist/chunk-I2NOIW44.js.map +1 -0
- package/dist/{chunk-OIF6LZUR.js → chunk-I3TIKTJO.js} +3 -3
- package/dist/chunk-I3TIKTJO.js.map +1 -0
- package/dist/chunk-I7FD46FF.js +9 -0
- package/dist/chunk-I7FD46FF.js.map +1 -0
- package/dist/chunk-IAGBDSCS.js +40 -0
- package/dist/chunk-IAGBDSCS.js.map +1 -0
- package/dist/{chunk-JWRVQKRZ.js → chunk-IELYAOGG.js} +6 -18
- package/dist/chunk-IELYAOGG.js.map +1 -0
- package/dist/chunk-IGUYVGGI.js +205 -0
- package/dist/chunk-IGUYVGGI.js.map +1 -0
- package/dist/{chunk-U26HQ6KJ.js → chunk-IO6GRPT6.js} +4 -4
- package/dist/chunk-IO6GRPT6.js.map +1 -0
- package/dist/chunk-IPB7FTQX.js +273 -0
- package/dist/chunk-IPB7FTQX.js.map +1 -0
- package/dist/chunk-ITNUCOXM.js +148 -0
- package/dist/chunk-ITNUCOXM.js.map +1 -0
- package/dist/{chunk-WPLVTJ5D.js → chunk-IUEN57TV.js} +10 -10
- package/dist/chunk-IUEN57TV.js.map +1 -0
- package/dist/{chunk-DL3HWOQ5.js → chunk-JNUWZ6D3.js} +9 -9
- package/dist/chunk-JNUWZ6D3.js.map +1 -0
- package/dist/chunk-K2WCO3NX.js +1 -0
- package/dist/chunk-KVOXU4T5.js +30 -0
- package/dist/chunk-KVOXU4T5.js.map +1 -0
- package/dist/chunk-KXGNJJXB.js +135 -0
- package/dist/chunk-KXGNJJXB.js.map +1 -0
- package/dist/chunk-LB7FD65R.js +163 -0
- package/dist/chunk-LB7FD65R.js.map +1 -0
- package/dist/{chunk-22DWZL57.js → chunk-LFLXAY2W.js} +43 -218
- package/dist/chunk-LFLXAY2W.js.map +1 -0
- package/dist/chunk-LMTH2RM6.js +129 -0
- package/dist/chunk-LMTH2RM6.js.map +1 -0
- package/dist/{aggregate/index.cjs → chunk-LV7M27WM.js} +390 -219
- package/dist/chunk-LV7M27WM.js.map +1 -0
- package/dist/{chunk-PE2FR4J3.js → chunk-LXQT4WMP.js} +16 -18
- package/dist/chunk-LXQT4WMP.js.map +1 -0
- package/dist/chunk-M2YKN37S.js +524 -0
- package/dist/chunk-M2YKN37S.js.map +1 -0
- package/dist/chunk-M6OST55S.js +14 -0
- package/dist/chunk-M6OST55S.js.map +1 -0
- package/dist/{chunk-F3GDRNUT.js → chunk-MD3Y6J3L.js} +35 -69
- package/dist/chunk-MD3Y6J3L.js.map +1 -0
- package/dist/{chunk-XJFLDA7A.js → chunk-MTMJVJ5W.js} +8 -7
- package/dist/chunk-MTMJVJ5W.js.map +1 -0
- package/dist/{chunk-DFMLEQZB.js → chunk-NF5JWERG.js} +5 -10
- package/dist/chunk-NF5JWERG.js.map +1 -0
- package/dist/{chunk-DO7C2TOG.js → chunk-PKHL44ER.js} +3 -3
- package/dist/{chunk-DO7C2TOG.js.map → chunk-PKHL44ER.js.map} +1 -1
- package/dist/chunk-PSMV73A5.js +117 -0
- package/dist/chunk-PSMV73A5.js.map +1 -0
- package/dist/chunk-PY4KJPYU.js +9 -0
- package/dist/chunk-PY4KJPYU.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/{chunk-DE6GKS6G.js → chunk-Q7SS3IME.js} +50 -9
- package/dist/chunk-Q7SS3IME.js.map +1 -0
- package/dist/chunk-QHJW5EXU.js +54 -0
- package/dist/chunk-QHJW5EXU.js.map +1 -0
- package/dist/{chunk-NONAAENK.js → chunk-RUEKROOS.js} +11 -4
- package/dist/chunk-RUEKROOS.js.map +1 -0
- package/dist/chunk-RUIMKQTA.js +23 -0
- package/dist/chunk-RUIMKQTA.js.map +1 -0
- package/dist/{chunk-TFBP23BX.js → chunk-SKF73JOP.js} +66 -7
- package/dist/chunk-SKF73JOP.js.map +1 -0
- package/dist/chunk-SM3AVUHC.js +42 -0
- package/dist/chunk-SM3AVUHC.js.map +1 -0
- package/dist/{chunk-ML236QKC.js → chunk-SMXWYP24.js} +5 -5
- package/dist/chunk-SMXWYP24.js.map +1 -0
- package/dist/chunk-SRB2XEWB.js +148 -0
- package/dist/chunk-SRB2XEWB.js.map +1 -0
- package/dist/chunk-SVLR4POP.js +64 -0
- package/dist/chunk-SVLR4POP.js.map +1 -0
- package/dist/chunk-TA66UMI4.js +123 -0
- package/dist/chunk-TA66UMI4.js.map +1 -0
- package/dist/chunk-TEILUWOI.js +664 -0
- package/dist/chunk-TEILUWOI.js.map +1 -0
- package/dist/chunk-TJYQIGAP.js +82 -0
- package/dist/chunk-TJYQIGAP.js.map +1 -0
- package/dist/{chunk-H2X3ISXG.js → chunk-UAG5KWVA.js} +7 -7
- package/dist/chunk-UAG5KWVA.js.map +1 -0
- package/dist/chunk-UDRIWL7A.js +382 -0
- package/dist/chunk-UDRIWL7A.js.map +1 -0
- package/dist/{chunk-2GLDA55J.js → chunk-UIU2THRG.js} +498 -133
- package/dist/chunk-UIU2THRG.js.map +1 -0
- package/dist/{chunk-3YPCK6JX.js → chunk-UPJNJGGA.js} +165 -423
- package/dist/chunk-UPJNJGGA.js.map +1 -0
- package/dist/chunk-UV5MFVO3.js +21 -0
- package/dist/chunk-UV5MFVO3.js.map +1 -0
- package/dist/{chunk-2WUSG3IT.js → chunk-V7RWQRG7.js} +5 -5
- package/dist/chunk-V7RWQRG7.js.map +1 -0
- package/dist/{chunk-VTKGMEPP.js → chunk-VCTFO5CO.js} +13 -3
- package/dist/chunk-VCTFO5CO.js.map +1 -0
- package/dist/{chunk-5T22KDPN.js → chunk-VFQGRQIH.js} +8 -8
- package/dist/chunk-VFQGRQIH.js.map +1 -0
- package/dist/{chunk-2QR2PQTT.js → chunk-VQNJ7UZL.js} +5 -3
- package/dist/chunk-VQNJ7UZL.js.map +1 -0
- package/dist/{chunk-DONMZAD2.js → chunk-WWGT2MDV.js} +43 -165
- package/dist/chunk-WWGT2MDV.js.map +1 -0
- package/dist/{chunk-EMIGCR7X.js → chunk-WXSYDNBT.js} +2 -2
- package/dist/chunk-WXSYDNBT.js.map +1 -0
- package/dist/chunk-WYSO2NIH.js +30 -0
- package/dist/chunk-WYSO2NIH.js.map +1 -0
- package/dist/chunk-XXYIOFUB.js +164 -0
- package/dist/chunk-XXYIOFUB.js.map +1 -0
- package/dist/{chunk-3BFJOWSU.js → chunk-Y22T3KQE.js} +35 -7
- package/dist/chunk-Y22T3KQE.js.map +1 -0
- package/dist/{chunk-A3JMGXPG.js → chunk-YMUGBZN2.js} +2 -2
- package/dist/chunk-YMUGBZN2.js.map +1 -0
- package/dist/{chunk-I5FOWO4J.js → chunk-ZCGAHGUS.js} +52 -73
- package/dist/chunk-ZCGAHGUS.js.map +1 -0
- package/dist/{chunk-FZU343FL.js → chunk-ZJADGNYF.js} +2 -2
- package/dist/chunk-ZJADGNYF.js.map +1 -0
- package/dist/{chunk-B6PB7JLN.js → chunk-ZYUC53LT.js} +427 -6
- package/dist/chunk-ZYUC53LT.js.map +1 -0
- package/dist/collection-facade-GQAOGJP2.js +33 -0
- package/dist/consent/index.d.ts +5 -7
- package/dist/consent/index.js +7 -5
- package/dist/consent/index.js.map +1 -1
- package/dist/crdt/index.d.ts +6 -2
- package/dist/crdt/index.js +3 -2
- package/dist/crdt/index.js.map +1 -1
- package/dist/decrypt-partition-IHtxEnTi.d.ts +21 -0
- package/dist/delegation-UL5HKLER.js +19 -0
- package/dist/derivations/index.d.ts +7 -9
- package/dist/derivations/index.js +11 -6
- package/dist/describe/index.d.ts +1 -0
- package/dist/describe/index.js +1 -0
- package/dist/describe-aBkJR2sd.d.ts +131 -0
- package/dist/{dev-unlock-B4kDxep_.d.ts → dev-unlock-C9Ro3v_O.d.ts} +1 -1
- package/dist/discriminant-BN9REW3o.d.ts +60 -0
- package/dist/enclave-UL5LW66V.js +88 -0
- package/dist/executor-2FWQRLMG.js +15 -0
- package/dist/executor-QZ7BXICW.js +9 -0
- package/dist/executor-Z5ZLJVTV.js +9 -0
- package/dist/export-accessible-KRV5W4GH.js +17 -0
- package/dist/extract-partition-GLKBOXFQ.js +30 -0
- package/dist/{fanout-sidecar-OKPMMPLG.js → fanout-sidecar-GF3DJ6KR.js} +34 -14
- package/dist/fanout-sidecar-GF3DJ6KR.js.map +1 -0
- package/dist/forget/index.d.ts +36 -0
- package/dist/forget/index.js +19 -0
- package/dist/forget/index.js.map +1 -0
- package/dist/guards/index.d.ts +13 -9
- package/dist/guards/index.js +12 -5
- package/dist/{hash-DdpVypUp.d.cts → hash-Cp5uwiox.d.ts} +5 -1
- package/dist/history/index.d.ts +6 -8
- package/dist/history/index.js +19 -12
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.d.ts +5 -7
- package/dist/i18n/index.js +104 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/in/index.d.ts +5 -0
- package/dist/in/index.js +1 -0
- package/dist/in/index.js.map +1 -0
- package/dist/index-B9QdHytu.d.ts +123 -0
- package/dist/index-BF9_96A5.d.ts +123 -0
- package/dist/{types-Df28QFKb.d.ts → index-BzUo1B6n.d.ts} +16270 -8358
- package/dist/index.d.ts +1088 -450
- package/dist/index.js +1165 -293
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.d.ts +6 -3
- package/dist/indexing/index.js +6 -5
- package/dist/indexing/index.js.map +1 -1
- package/dist/issue-Y6UVIR43.js +13 -0
- package/dist/issue-Y6UVIR43.js.map +1 -0
- package/dist/kernel/index.d.ts +32 -0
- package/dist/kernel/index.js +53 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/{ledger-TMRZYNVJ.js → ledger-RYI35CDS.js} +12 -9
- package/dist/ledger-RYI35CDS.js.map +1 -0
- package/dist/liberate-CRPZEV7O.js +18 -0
- package/dist/liberate-CRPZEV7O.js.map +1 -0
- package/dist/materialized-views/index.d.ts +6 -19
- package/dist/materialized-views/index.js +16 -12
- package/dist/mime-magic-CGhw37_E.d.ts +103 -0
- package/dist/noydb-367AM4HT.js +50 -0
- package/dist/noydb-367AM4HT.js.map +1 -0
- package/dist/on/index.d.ts +5 -0
- package/dist/on/index.js +11 -0
- package/dist/on/index.js.map +1 -0
- package/dist/overlay-views/index.d.ts +27 -11
- package/dist/overlay-views/index.js +7 -6
- package/dist/periods/index.d.ts +5 -7
- package/dist/periods/index.js +13 -9
- package/dist/pod/index.d.ts +63 -0
- package/dist/pod/index.js +61 -0
- package/dist/pod/index.js.map +1 -0
- package/dist/policy-IXK4FVXP.js +41 -0
- package/dist/policy-IXK4FVXP.js.map +1 -0
- package/dist/portability/index.d.ts +20 -0
- package/dist/portability/index.js +43 -0
- package/dist/portability/index.js.map +1 -0
- package/dist/{public-envelope-BW6OXORV.js → public-envelope-JHDQCPSX.js} +6 -5
- package/dist/public-envelope-JHDQCPSX.js.map +1 -0
- package/dist/query/index.d.ts +5 -3
- package/dist/query/index.js +21 -13
- package/dist/read-only-facade-5ADRJVTM.js +8 -0
- package/dist/read-only-facade-5ADRJVTM.js.map +1 -0
- package/dist/registry-45RJNWGU.js +9 -0
- package/dist/registry-45RJNWGU.js.map +1 -0
- package/dist/registry-5GRV5VXI.js +13 -0
- package/dist/registry-5GRV5VXI.js.map +1 -0
- package/dist/registry-VW6P6A3J.js +8 -0
- package/dist/registry-VW6P6A3J.js.map +1 -0
- package/dist/registry-WEUCHBO4.js +11 -0
- package/dist/registry-WEUCHBO4.js.map +1 -0
- package/dist/request-withdrawal-GBPH2FDY.js +25 -0
- package/dist/request-withdrawal-GBPH2FDY.js.map +1 -0
- package/dist/revoke-TUFRGI6S.js +18 -0
- package/dist/revoke-TUFRGI6S.js.map +1 -0
- package/dist/sealed-record/index.d.ts +69 -0
- package/dist/sealed-record/index.js +65 -0
- package/dist/sealed-record/index.js.map +1 -0
- package/dist/session/index.d.ts +6 -8
- package/dist/session/index.js +7 -5
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.d.ts +5 -7
- package/dist/shadow/index.js +4 -3
- package/dist/shadow/index.js.map +1 -1
- package/dist/{signer-72QAUSVW.js → signer-PNKTBVF7.js} +6 -5
- package/dist/signer-PNKTBVF7.js.map +1 -0
- package/dist/snapshots/index.d.ts +6 -8
- package/dist/snapshots/index.js +13 -11
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-6ZDBTQT7.js → stale-3JWHNDIY.js} +3 -2
- package/dist/stale-3JWHNDIY.js.map +1 -0
- package/dist/store-coordination-provider-3I7XWZZK.js +142 -0
- package/dist/store-coordination-provider-3I7XWZZK.js.map +1 -0
- package/dist/subject-index-O75wKshW.d.ts +362 -0
- package/dist/sync/index.d.ts +4 -6
- package/dist/sync/index.js +7 -6
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.d.ts +5 -7
- package/dist/team/index.js +20 -16
- package/dist/tiers/index.d.ts +5 -0
- package/dist/tiers/index.js +33 -0
- package/dist/tiers/index.js.map +1 -0
- package/dist/to/index.d.ts +5 -0
- package/dist/to/index.js +17 -0
- package/dist/to/index.js.map +1 -0
- package/dist/transition-guard-C7ol6oPw.d.ts +165 -0
- package/dist/tx/index.d.ts +23 -9
- package/dist/tx/index.js +13 -8
- package/dist/tx/index.js.map +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ulid-DRH25k3y.d.ts +66 -0
- package/dist/ulid-PTAIMDG4.js +10 -0
- package/dist/ulid-PTAIMDG4.js.map +1 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +7 -2
- package/dist/util/index.js.map +1 -1
- package/dist/vault-diff-B5fYNBL7.d.ts +147 -0
- package/dist/with/index.d.ts +38 -0
- package/dist/with/index.js +25 -0
- package/dist/with/index.js.map +1 -0
- package/dist/{with-materialized-view-BLkQxoQN.d.ts → with-materialized-view-6p0Fk8bL.d.ts} +1 -1
- package/dist/{with-overlayed-view-CRsSEwHR.d.ts → with-overlayed-view-BJ6mXGMd.d.ts} +2 -3
- package/dist/with-rollup-BvQo3ROo.d.ts +47 -0
- package/dist/withdraw-accessible-FFS46EOD.js +22 -0
- package/dist/withdraw-accessible-FFS46EOD.js.map +1 -0
- package/dist/zod-HAJM7LMS.js +14763 -0
- package/dist/zod-HAJM7LMS.js.map +1 -0
- package/package.json +121 -201
- package/dist/aggregate/index.cjs.map +0 -1
- package/dist/aggregate/index.d.cts +0 -38
- package/dist/attestation/index.cjs +0 -305
- package/dist/attestation/index.cjs.map +0 -1
- package/dist/attestation/index.d.cts +0 -52
- package/dist/blobs/index.cjs +0 -1480
- package/dist/blobs/index.cjs.map +0 -1
- package/dist/blobs/index.d.cts +0 -46
- package/dist/bundle/index.cjs +0 -19264
- package/dist/bundle/index.cjs.map +0 -1
- package/dist/bundle/index.d.cts +0 -176
- package/dist/chunk-22DWZL57.js.map +0 -1
- package/dist/chunk-2GLDA55J.js.map +0 -1
- package/dist/chunk-2QR2PQTT.js.map +0 -1
- package/dist/chunk-2WUSG3IT.js.map +0 -1
- package/dist/chunk-3BFJOWSU.js.map +0 -1
- package/dist/chunk-3YPCK6JX.js.map +0 -1
- package/dist/chunk-53XBRIRT.js.map +0 -1
- package/dist/chunk-5T22KDPN.js.map +0 -1
- package/dist/chunk-5XHKQ56N.js +0 -340
- package/dist/chunk-5XHKQ56N.js.map +0 -1
- package/dist/chunk-6CME4UEK.js.map +0 -1
- package/dist/chunk-6STK5TQP.js +0 -139
- package/dist/chunk-6STK5TQP.js.map +0 -1
- package/dist/chunk-A3JMGXPG.js.map +0 -1
- package/dist/chunk-B6PB7JLN.js.map +0 -1
- package/dist/chunk-BVRYKATC.js.map +0 -1
- package/dist/chunk-DE6GKS6G.js.map +0 -1
- package/dist/chunk-DFMLEQZB.js.map +0 -1
- package/dist/chunk-DJHHA6XH.js.map +0 -1
- package/dist/chunk-DL3HWOQ5.js.map +0 -1
- package/dist/chunk-DONMZAD2.js.map +0 -1
- package/dist/chunk-EMIGCR7X.js.map +0 -1
- package/dist/chunk-F3GDRNUT.js.map +0 -1
- package/dist/chunk-FZU343FL.js.map +0 -1
- package/dist/chunk-H2X3ISXG.js.map +0 -1
- package/dist/chunk-HNRHLRDC.js.map +0 -1
- package/dist/chunk-I5FOWO4J.js.map +0 -1
- package/dist/chunk-J66GRPNH.js.map +0 -1
- package/dist/chunk-JWRVQKRZ.js.map +0 -1
- package/dist/chunk-K3DK3NU5.js.map +0 -1
- package/dist/chunk-ML236QKC.js.map +0 -1
- package/dist/chunk-NONAAENK.js.map +0 -1
- package/dist/chunk-O3VZPBZG.js.map +0 -1
- package/dist/chunk-OIF6LZUR.js.map +0 -1
- package/dist/chunk-OQ6PIGHA.js +0 -19
- package/dist/chunk-OQ6PIGHA.js.map +0 -1
- package/dist/chunk-PE2FR4J3.js.map +0 -1
- package/dist/chunk-PP6W64Y3.js +0 -275
- package/dist/chunk-PP6W64Y3.js.map +0 -1
- package/dist/chunk-PX35GA7L.js.map +0 -1
- package/dist/chunk-QEILDE6R.js +0 -793
- package/dist/chunk-QEILDE6R.js.map +0 -1
- package/dist/chunk-QODLLGQ7.js.map +0 -1
- package/dist/chunk-RAZ4OVLL.js +0 -51
- package/dist/chunk-RAZ4OVLL.js.map +0 -1
- package/dist/chunk-SYMWGEET.js.map +0 -1
- package/dist/chunk-T7JEBOGN.js.map +0 -1
- package/dist/chunk-TFBP23BX.js.map +0 -1
- package/dist/chunk-TV3YZ35S.js +0 -90
- package/dist/chunk-TV3YZ35S.js.map +0 -1
- package/dist/chunk-U26HQ6KJ.js.map +0 -1
- package/dist/chunk-UF3BUNQZ.js +0 -1
- package/dist/chunk-UMLVJTYV.js +0 -20
- package/dist/chunk-UMLVJTYV.js.map +0 -1
- package/dist/chunk-VTKGMEPP.js.map +0 -1
- package/dist/chunk-W6EQLGMB.js +0 -100
- package/dist/chunk-W6EQLGMB.js.map +0 -1
- package/dist/chunk-WIRRPTFH.js +0 -17
- package/dist/chunk-WIRRPTFH.js.map +0 -1
- package/dist/chunk-WPLVTJ5D.js.map +0 -1
- package/dist/chunk-XJFLDA7A.js.map +0 -1
- package/dist/chunk-Z6FNBOTC.js.map +0 -1
- package/dist/chunk-ZYWZWG6G.js.map +0 -1
- package/dist/consent/index.cjs +0 -204
- package/dist/consent/index.cjs.map +0 -1
- package/dist/consent/index.d.cts +0 -25
- package/dist/crdt/index.cjs +0 -152
- package/dist/crdt/index.cjs.map +0 -1
- package/dist/crdt/index.d.cts +0 -30
- package/dist/crypto-HTZ4FJOP.js +0 -44
- package/dist/delegation-RI54P6I5.js +0 -17
- package/dist/derivations/index.cjs +0 -351
- package/dist/derivations/index.cjs.map +0 -1
- package/dist/derivations/index.d.cts +0 -72
- package/dist/dev-unlock-BIoEFbwm.d.cts +0 -263
- package/dist/executor-5PNY7LGW.js +0 -8
- package/dist/executor-B4QIYGZX.js +0 -8
- package/dist/executor-BWXXDQ7K.js +0 -11
- package/dist/fanout-sidecar-OKPMMPLG.js.map +0 -1
- package/dist/guards/index.cjs +0 -322
- package/dist/guards/index.cjs.map +0 -1
- package/dist/guards/index.d.cts +0 -31
- package/dist/hash-HJqD14vS.d.ts +0 -63
- package/dist/history/index.cjs +0 -1222
- package/dist/history/index.cjs.map +0 -1
- package/dist/history/index.d.cts +0 -63
- package/dist/i18n/index.cjs +0 -1100
- package/dist/i18n/index.cjs.map +0 -1
- package/dist/i18n/index.d.cts +0 -39
- package/dist/index-4fBVt8j9.d.cts +0 -2387
- package/dist/index-D8I_pyJD.d.ts +0 -2387
- package/dist/index.cjs +0 -24487
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -776
- package/dist/indexing/index.cjs +0 -742
- package/dist/indexing/index.cjs.map +0 -1
- package/dist/indexing/index.d.cts +0 -36
- package/dist/issue-VGDPP4B5.js +0 -12
- package/dist/lazy-builder-7tIpFyWN.d.ts +0 -304
- package/dist/lazy-builder-wY4pMCEe.d.cts +0 -304
- package/dist/materialized-views/index.cjs +0 -854
- package/dist/materialized-views/index.cjs.map +0 -1
- package/dist/materialized-views/index.d.cts +0 -186
- package/dist/mime-magic-CBBSOkjm.d.cts +0 -50
- package/dist/mime-magic-CBBSOkjm.d.ts +0 -50
- package/dist/noydb-G725ZSZG.js +0 -34
- package/dist/overlay-views/index.cjs +0 -359
- package/dist/overlay-views/index.cjs.map +0 -1
- package/dist/overlay-views/index.d.cts +0 -82
- package/dist/periods/index.cjs +0 -1041
- package/dist/periods/index.cjs.map +0 -1
- package/dist/periods/index.d.cts +0 -22
- package/dist/predicate-BSAGEyu5.d.cts +0 -209
- package/dist/predicate-BSAGEyu5.d.ts +0 -209
- package/dist/query/index.cjs +0 -2375
- package/dist/query/index.cjs.map +0 -1
- package/dist/query/index.d.cts +0 -3
- package/dist/read-only-facade-ITU6L7BL.js +0 -7
- package/dist/registry-3QP3YKQS.js +0 -8
- package/dist/registry-DKEXOJVO.js +0 -7
- package/dist/registry-OJIOSBV6.js +0 -10
- package/dist/registry-USRVT6YF.js +0 -8
- package/dist/revoke-JCC7N56X.js +0 -17
- package/dist/session/index.cjs +0 -495
- package/dist/session/index.cjs.map +0 -1
- package/dist/session/index.d.cts +0 -46
- package/dist/shadow/index.cjs +0 -133
- package/dist/shadow/index.cjs.map +0 -1
- package/dist/shadow/index.d.cts +0 -17
- package/dist/snapshots/index.cjs +0 -937
- package/dist/snapshots/index.cjs.map +0 -1
- package/dist/snapshots/index.d.cts +0 -28
- package/dist/store/index.cjs +0 -1083
- package/dist/store/index.cjs.map +0 -1
- package/dist/store/index.d.cts +0 -492
- package/dist/store/index.d.ts +0 -492
- package/dist/store/index.js +0 -37
- package/dist/strategy-BSxFXGzb.d.cts +0 -110
- package/dist/strategy-BSxFXGzb.d.ts +0 -110
- package/dist/strategy-DSTrsZ8t.d.cts +0 -601
- package/dist/strategy-DSTrsZ8t.d.ts +0 -601
- package/dist/sync/index.cjs +0 -1062
- package/dist/sync/index.cjs.map +0 -1
- package/dist/sync/index.d.cts +0 -43
- package/dist/team/index.cjs +0 -2798
- package/dist/team/index.cjs.map +0 -1
- package/dist/team/index.d.cts +0 -118
- package/dist/tx/index.cjs +0 -544
- package/dist/tx/index.cjs.map +0 -1
- package/dist/tx/index.d.cts +0 -21
- package/dist/types-DyXYr8rE.d.cts +0 -12818
- package/dist/ulid-COREQ2RQ.js +0 -9
- package/dist/ulid-Drr7ykr6.d.cts +0 -603
- package/dist/util/index.cjs +0 -230
- package/dist/util/index.cjs.map +0 -1
- package/dist/util/index.d.cts +0 -77
- package/dist/with-derivation-DFnFByiQ.d.ts +0 -13
- package/dist/with-derivation-DU3Sjazm.d.cts +0 -13
- package/dist/with-guard-ByyxmEe7.d.cts +0 -18
- package/dist/with-guard-qube6BMI.d.ts +0 -18
- package/dist/with-materialized-view-BmEToIR1.d.cts +0 -27
- package/dist/with-overlayed-view-BMsQQbWm.d.cts +0 -13
- /package/dist/{store → adapter}/index.js.map +0 -0
- /package/dist/{chunk-UF3BUNQZ.js.map → api-RW3KP7WU.js.map} +0 -0
- /package/dist/{crypto-HTZ4FJOP.js.map → as/index.js.map} +0 -0
- /package/dist/{delegation-RI54P6I5.js.map → at/index.js.map} +0 -0
- /package/dist/{executor-5PNY7LGW.js.map → by/index.js.map} +0 -0
- /package/dist/{executor-B4QIYGZX.js.map → cargo/index.js.map} +0 -0
- /package/dist/{executor-BWXXDQ7K.js.map → chunk-BGIZAFY7.js.map} +0 -0
- /package/dist/{issue-VGDPP4B5.js.map → chunk-CHFZDSE4.js.map} +0 -0
- /package/dist/{ledger-TMRZYNVJ.js.map → chunk-GHVIKOHT.js.map} +0 -0
- /package/dist/{noydb-G725ZSZG.js.map → chunk-K2WCO3NX.js.map} +0 -0
- /package/dist/{public-envelope-BW6OXORV.js.map → chunk-PZ5AY32C.js.map} +0 -0
- /package/dist/{read-only-facade-ITU6L7BL.js.map → collection-facade-GQAOGJP2.js.map} +0 -0
- /package/dist/{registry-3QP3YKQS.js.map → delegation-UL5HKLER.js.map} +0 -0
- /package/dist/{registry-DKEXOJVO.js.map → describe/index.js.map} +0 -0
- /package/dist/{registry-OJIOSBV6.js.map → enclave-UL5LW66V.js.map} +0 -0
- /package/dist/{registry-USRVT6YF.js.map → executor-2FWQRLMG.js.map} +0 -0
- /package/dist/{revoke-JCC7N56X.js.map → executor-QZ7BXICW.js.map} +0 -0
- /package/dist/{signer-72QAUSVW.js.map → executor-Z5ZLJVTV.js.map} +0 -0
- /package/dist/{stale-6ZDBTQT7.js.map → export-accessible-KRV5W4GH.js.map} +0 -0
- /package/dist/{ulid-COREQ2RQ.js.map → extract-partition-GLKBOXFQ.js.map} +0 -0
package/dist/query/index.d.cts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { E as CrossJoinSourceUnknownError, G as CrossJoinTooLargeError, H as DEFAULT_CROSS_JOIN_MAX_ROWS, J as DEFAULT_JOIN_MAX_ROWS, K as DanglingReferenceError, _ as GroupCardinalityError, a0 as IndexRequiredError, a1 as IndexWriteFailureError, a3 as JoinContext, a4 as JoinLeg, a5 as JoinStrategy, a6 as JoinTooLargeError, a7 as JoinableSource, ab as LiveQuery, ac as LiveUpstream, ai as OrderBy, Q as Query, an as QueryPlan, ao as QuerySource, az as ScanBuilder, aA as ScanPageProvider, aK as applyJoins, aL as buildLiveQuery, aM as executePlan, aO as resetJoinWarnings } from '../index-4fBVt8j9.cjs';
|
|
2
|
-
export { a as Clause, C as CollectionIndexes, d as CrossJoinClause, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from '../predicate-BSAGEyu5.cjs';
|
|
3
|
-
export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedQueryN, i as GroupedRow, j as GroupedRowN, L as LiveAggregation, R as Reducer, k as ReducerOptions, l as avg, m as buildLiveAggregation, n as count, o as groupAndReduce, p as max, q as min, r as reduceRecords, s as resetGroupByWarnings, t as sum } from '../strategy-DSTrsZ8t.cjs';
|
package/dist/revoke-JCC7N56X.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getRevokedDocIdsCore,
|
|
3
|
-
publishRevocationListCore,
|
|
4
|
-
revokeDocCore,
|
|
5
|
-
unrevokeDocCore
|
|
6
|
-
} from "./chunk-PX35GA7L.js";
|
|
7
|
-
import "./chunk-DL3HWOQ5.js";
|
|
8
|
-
import "./chunk-WIRRPTFH.js";
|
|
9
|
-
import "./chunk-PP6W64Y3.js";
|
|
10
|
-
import "./chunk-B6PB7JLN.js";
|
|
11
|
-
export {
|
|
12
|
-
getRevokedDocIdsCore,
|
|
13
|
-
publishRevocationListCore,
|
|
14
|
-
revokeDocCore,
|
|
15
|
-
unrevokeDocCore
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=revoke-JCC7N56X.js.map
|
package/dist/session/index.cjs
DELETED
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/session/index.ts
|
|
21
|
-
var session_exports = {};
|
|
22
|
-
__export(session_exports, {
|
|
23
|
-
PolicyEnforcer: () => PolicyEnforcer,
|
|
24
|
-
SessionExpiredError: () => SessionExpiredError,
|
|
25
|
-
SessionNotFoundError: () => SessionNotFoundError,
|
|
26
|
-
SessionPolicyError: () => SessionPolicyError,
|
|
27
|
-
activeSessionCount: () => activeSessionCount,
|
|
28
|
-
clearDevUnlock: () => clearDevUnlock,
|
|
29
|
-
createEnforcer: () => createEnforcer,
|
|
30
|
-
createSession: () => createSession,
|
|
31
|
-
enableDevUnlock: () => enableDevUnlock,
|
|
32
|
-
isDevUnlockActive: () => isDevUnlockActive,
|
|
33
|
-
isSessionAlive: () => isSessionAlive,
|
|
34
|
-
loadDevUnlock: () => loadDevUnlock,
|
|
35
|
-
resolveSession: () => resolveSession,
|
|
36
|
-
revokeAllSessions: () => revokeAllSessions,
|
|
37
|
-
revokeSession: () => revokeSession,
|
|
38
|
-
validateSessionPolicy: () => validateSessionPolicy,
|
|
39
|
-
withSession: () => withSession
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(session_exports);
|
|
42
|
-
|
|
43
|
-
// src/errors.ts
|
|
44
|
-
var NoydbError = class extends Error {
|
|
45
|
-
/** Machine-readable error code. Stable across library versions. */
|
|
46
|
-
code;
|
|
47
|
-
constructor(code, message) {
|
|
48
|
-
super(message);
|
|
49
|
-
this.name = "NoydbError";
|
|
50
|
-
this.code = code;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var ValidationError = class extends NoydbError {
|
|
54
|
-
constructor(message = "Validation error") {
|
|
55
|
-
super("VALIDATION_ERROR", message);
|
|
56
|
-
this.name = "ValidationError";
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
var SessionExpiredError = class extends NoydbError {
|
|
60
|
-
sessionId;
|
|
61
|
-
constructor(sessionId) {
|
|
62
|
-
super("SESSION_EXPIRED", `Session "${sessionId}" has expired. Re-unlock to continue.`);
|
|
63
|
-
this.name = "SessionExpiredError";
|
|
64
|
-
this.sessionId = sessionId;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var SessionNotFoundError = class extends NoydbError {
|
|
68
|
-
sessionId;
|
|
69
|
-
constructor(sessionId) {
|
|
70
|
-
super("SESSION_NOT_FOUND", `Session key for "${sessionId}" not found. The session may have been revoked or the page reloaded.`);
|
|
71
|
-
this.name = "SessionNotFoundError";
|
|
72
|
-
this.sessionId = sessionId;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var SessionPolicyError = class extends NoydbError {
|
|
76
|
-
operation;
|
|
77
|
-
constructor(operation, message) {
|
|
78
|
-
super(
|
|
79
|
-
"SESSION_POLICY",
|
|
80
|
-
message ?? `Operation "${operation}" requires re-authentication per the active session policy.`
|
|
81
|
-
);
|
|
82
|
-
this.name = "SessionPolicyError";
|
|
83
|
-
this.operation = operation;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
// src/crypto.ts
|
|
88
|
-
var subtle = globalThis.crypto.subtle;
|
|
89
|
-
function bufferToBase64(buffer) {
|
|
90
|
-
const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
91
|
-
let binary = "";
|
|
92
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
93
|
-
binary += String.fromCharCode(bytes[i]);
|
|
94
|
-
}
|
|
95
|
-
return btoa(binary);
|
|
96
|
-
}
|
|
97
|
-
function base64ToBuffer(base64) {
|
|
98
|
-
const binary = atob(base64);
|
|
99
|
-
const bytes = new Uint8Array(binary.length);
|
|
100
|
-
for (let i = 0; i < binary.length; i++) {
|
|
101
|
-
bytes[i] = binary.charCodeAt(i);
|
|
102
|
-
}
|
|
103
|
-
return bytes;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// src/bundle/ulid.ts
|
|
107
|
-
var CROCKFORD_ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
108
|
-
function encodeBase32(value, length) {
|
|
109
|
-
let out = "";
|
|
110
|
-
let v = value;
|
|
111
|
-
for (let i = 0; i < length; i++) {
|
|
112
|
-
out = CROCKFORD_ALPHABET[v % 32] + out;
|
|
113
|
-
v = Math.floor(v / 32);
|
|
114
|
-
}
|
|
115
|
-
return out;
|
|
116
|
-
}
|
|
117
|
-
function generateULID() {
|
|
118
|
-
const now = Date.now();
|
|
119
|
-
const timestampHigh = Math.floor(now / 16777216);
|
|
120
|
-
const timestampLow = now & 16777215;
|
|
121
|
-
const tsPart = encodeBase32(timestampHigh, 5) + encodeBase32(timestampLow, 5);
|
|
122
|
-
const randBytes = new Uint8Array(10);
|
|
123
|
-
crypto.getRandomValues(randBytes);
|
|
124
|
-
const rand1 = randBytes[0] * 2 ** 32 + (randBytes[1] << 24 >>> 0) + (randBytes[2] << 16) + (randBytes[3] << 8) + randBytes[4];
|
|
125
|
-
const rand2 = randBytes[5] * 2 ** 32 + (randBytes[6] << 24 >>> 0) + (randBytes[7] << 16) + (randBytes[8] << 8) + randBytes[9];
|
|
126
|
-
const randPart = encodeBase32(rand1, 8) + encodeBase32(rand2, 8);
|
|
127
|
-
return tsPart + randPart;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// src/session/session.ts
|
|
131
|
-
var subtle2 = globalThis.crypto.subtle;
|
|
132
|
-
var DEFAULT_TTL_MS = 60 * 60 * 1e3;
|
|
133
|
-
var sessionKeyStore = /* @__PURE__ */ new Map();
|
|
134
|
-
async function createSession(keyring, vault, options = {}) {
|
|
135
|
-
const ttlMs = options.ttlMs ?? DEFAULT_TTL_MS;
|
|
136
|
-
const sessionId = generateULID();
|
|
137
|
-
const expiresAt = new Date(Date.now() + ttlMs).toISOString();
|
|
138
|
-
const sessionKey = await subtle2.generateKey(
|
|
139
|
-
{ name: "AES-GCM", length: 256 },
|
|
140
|
-
false,
|
|
141
|
-
// non-extractable — this is the tab-scope security invariant
|
|
142
|
-
["encrypt", "decrypt"]
|
|
143
|
-
);
|
|
144
|
-
const dekMap = {};
|
|
145
|
-
for (const [collName, dek] of keyring.deks) {
|
|
146
|
-
const raw = await subtle2.exportKey("raw", dek);
|
|
147
|
-
dekMap[collName] = bufferToBase64(raw);
|
|
148
|
-
}
|
|
149
|
-
const payload = JSON.stringify({
|
|
150
|
-
userId: keyring.userId,
|
|
151
|
-
displayName: keyring.displayName,
|
|
152
|
-
role: keyring.role,
|
|
153
|
-
permissions: keyring.permissions,
|
|
154
|
-
deks: dekMap,
|
|
155
|
-
salt: bufferToBase64(keyring.salt)
|
|
156
|
-
});
|
|
157
|
-
const iv = globalThis.crypto.getRandomValues(new Uint8Array(12));
|
|
158
|
-
const encrypted = await subtle2.encrypt(
|
|
159
|
-
{ name: "AES-GCM", iv },
|
|
160
|
-
sessionKey,
|
|
161
|
-
new TextEncoder().encode(payload)
|
|
162
|
-
);
|
|
163
|
-
const token = {
|
|
164
|
-
_noydb_session: 1,
|
|
165
|
-
sessionId,
|
|
166
|
-
userId: keyring.userId,
|
|
167
|
-
vault,
|
|
168
|
-
role: keyring.role,
|
|
169
|
-
expiresAt,
|
|
170
|
-
wrappedKek: bufferToBase64(encrypted),
|
|
171
|
-
kekIv: bufferToBase64(iv)
|
|
172
|
-
};
|
|
173
|
-
sessionKeyStore.set(sessionId, sessionKey);
|
|
174
|
-
return { token, sessionId };
|
|
175
|
-
}
|
|
176
|
-
async function resolveSession(token) {
|
|
177
|
-
if (Date.now() > new Date(token.expiresAt).getTime()) {
|
|
178
|
-
sessionKeyStore.delete(token.sessionId);
|
|
179
|
-
throw new SessionExpiredError(token.sessionId);
|
|
180
|
-
}
|
|
181
|
-
const sessionKey = sessionKeyStore.get(token.sessionId);
|
|
182
|
-
if (!sessionKey) {
|
|
183
|
-
throw new SessionNotFoundError(token.sessionId);
|
|
184
|
-
}
|
|
185
|
-
const iv = base64ToBuffer(token.kekIv);
|
|
186
|
-
const ciphertext = base64ToBuffer(token.wrappedKek);
|
|
187
|
-
let plaintext;
|
|
188
|
-
try {
|
|
189
|
-
plaintext = await subtle2.decrypt(
|
|
190
|
-
{ name: "AES-GCM", iv },
|
|
191
|
-
sessionKey,
|
|
192
|
-
ciphertext
|
|
193
|
-
);
|
|
194
|
-
} catch {
|
|
195
|
-
throw new SessionNotFoundError(token.sessionId);
|
|
196
|
-
}
|
|
197
|
-
const payload = JSON.parse(new TextDecoder().decode(plaintext));
|
|
198
|
-
const deks = /* @__PURE__ */ new Map();
|
|
199
|
-
for (const [collName, rawBase64] of Object.entries(payload.deks)) {
|
|
200
|
-
const dek = await subtle2.importKey(
|
|
201
|
-
"raw",
|
|
202
|
-
base64ToBuffer(rawBase64),
|
|
203
|
-
{ name: "AES-GCM", length: 256 },
|
|
204
|
-
true,
|
|
205
|
-
["encrypt", "decrypt"]
|
|
206
|
-
);
|
|
207
|
-
deks.set(collName, dek);
|
|
208
|
-
}
|
|
209
|
-
return {
|
|
210
|
-
userId: payload.userId,
|
|
211
|
-
displayName: payload.displayName,
|
|
212
|
-
role: payload.role,
|
|
213
|
-
permissions: payload.permissions,
|
|
214
|
-
deks,
|
|
215
|
-
kek: null,
|
|
216
|
-
// KEK not available in session context
|
|
217
|
-
salt: base64ToBuffer(payload.salt),
|
|
218
|
-
authenticators: []
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
function revokeSession(sessionId) {
|
|
222
|
-
sessionKeyStore.delete(sessionId);
|
|
223
|
-
}
|
|
224
|
-
function isSessionAlive(token) {
|
|
225
|
-
if (Date.now() > new Date(token.expiresAt).getTime()) return false;
|
|
226
|
-
return sessionKeyStore.has(token.sessionId);
|
|
227
|
-
}
|
|
228
|
-
function revokeAllSessions() {
|
|
229
|
-
sessionKeyStore.clear();
|
|
230
|
-
}
|
|
231
|
-
function activeSessionCount() {
|
|
232
|
-
return sessionKeyStore.size;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// src/session/session-policy.ts
|
|
236
|
-
var PolicyEnforcer = class {
|
|
237
|
-
policy;
|
|
238
|
-
sessionId;
|
|
239
|
-
onRevoke;
|
|
240
|
-
createdAt;
|
|
241
|
-
lastActivityAt;
|
|
242
|
-
idleTimer = null;
|
|
243
|
-
absoluteTimer = null;
|
|
244
|
-
visibilityHandler = null;
|
|
245
|
-
constructor(opts) {
|
|
246
|
-
this.policy = opts.policy;
|
|
247
|
-
this.sessionId = opts.sessionId;
|
|
248
|
-
this.onRevoke = opts.onRevoke;
|
|
249
|
-
this.createdAt = Date.now();
|
|
250
|
-
this.lastActivityAt = Date.now();
|
|
251
|
-
this.scheduleIdleTimer();
|
|
252
|
-
this.scheduleAbsoluteTimer();
|
|
253
|
-
this.registerBackgroundLock();
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Record an activity timestamp and reset the idle timer.
|
|
257
|
-
* Call this at the top of every Noydb public method.
|
|
258
|
-
*/
|
|
259
|
-
touch() {
|
|
260
|
-
this.lastActivityAt = Date.now();
|
|
261
|
-
this.scheduleIdleTimer();
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Check whether the given operation is allowed under the active policy.
|
|
265
|
-
* Throws `SessionPolicyError` if the operation requires re-authentication.
|
|
266
|
-
* Throws `SessionExpiredError` if the absolute timeout has been exceeded
|
|
267
|
-
* (defensive check in case the timer fired before the call arrived).
|
|
268
|
-
*
|
|
269
|
-
* This is a synchronous check — callers don't await it.
|
|
270
|
-
*/
|
|
271
|
-
checkOperation(op) {
|
|
272
|
-
const { absoluteTimeoutMs } = this.policy;
|
|
273
|
-
if (absoluteTimeoutMs !== void 0 && Date.now() - this.createdAt >= absoluteTimeoutMs) {
|
|
274
|
-
this.expire("absolute");
|
|
275
|
-
throw new SessionExpiredError(this.sessionId);
|
|
276
|
-
}
|
|
277
|
-
const required = this.policy.requireReAuthFor ?? [];
|
|
278
|
-
if (required.includes(op)) {
|
|
279
|
-
throw new SessionPolicyError(op);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Tear down timers and background-lock listener. Call from `Noydb.close()`
|
|
284
|
-
* and whenever the session is revoked externally.
|
|
285
|
-
*/
|
|
286
|
-
destroy() {
|
|
287
|
-
if (this.idleTimer) {
|
|
288
|
-
clearTimeout(this.idleTimer);
|
|
289
|
-
this.idleTimer = null;
|
|
290
|
-
}
|
|
291
|
-
if (this.absoluteTimer) {
|
|
292
|
-
clearTimeout(this.absoluteTimer);
|
|
293
|
-
this.absoluteTimer = null;
|
|
294
|
-
}
|
|
295
|
-
if (this.visibilityHandler && typeof document !== "undefined") {
|
|
296
|
-
document.removeEventListener("visibilitychange", this.visibilityHandler);
|
|
297
|
-
this.visibilityHandler = null;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
/** How long since the last activity, in ms. */
|
|
301
|
-
get idleMs() {
|
|
302
|
-
return Date.now() - this.lastActivityAt;
|
|
303
|
-
}
|
|
304
|
-
/** How long since session creation, in ms. */
|
|
305
|
-
get ageMs() {
|
|
306
|
-
return Date.now() - this.createdAt;
|
|
307
|
-
}
|
|
308
|
-
// ── Private ──────────────────────────────────────────────────────────
|
|
309
|
-
scheduleIdleTimer() {
|
|
310
|
-
const { idleTimeoutMs } = this.policy;
|
|
311
|
-
if (!idleTimeoutMs) return;
|
|
312
|
-
if (this.idleTimer) clearTimeout(this.idleTimer);
|
|
313
|
-
this.idleTimer = setTimeout(() => {
|
|
314
|
-
this.expire("idle");
|
|
315
|
-
}, idleTimeoutMs);
|
|
316
|
-
}
|
|
317
|
-
scheduleAbsoluteTimer() {
|
|
318
|
-
const { absoluteTimeoutMs } = this.policy;
|
|
319
|
-
if (!absoluteTimeoutMs) return;
|
|
320
|
-
if (this.absoluteTimer) clearTimeout(this.absoluteTimer);
|
|
321
|
-
this.absoluteTimer = setTimeout(() => {
|
|
322
|
-
this.expire("absolute");
|
|
323
|
-
}, absoluteTimeoutMs);
|
|
324
|
-
}
|
|
325
|
-
registerBackgroundLock() {
|
|
326
|
-
if (!this.policy.lockOnBackground) return;
|
|
327
|
-
if (typeof document === "undefined") return;
|
|
328
|
-
this.visibilityHandler = () => {
|
|
329
|
-
if (document.hidden) {
|
|
330
|
-
this.expire("background");
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
document.addEventListener("visibilitychange", this.visibilityHandler);
|
|
334
|
-
}
|
|
335
|
-
expire(reason) {
|
|
336
|
-
this.destroy();
|
|
337
|
-
revokeSession(this.sessionId);
|
|
338
|
-
this.onRevoke(reason);
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
function createEnforcer(opts) {
|
|
342
|
-
return new PolicyEnforcer(opts);
|
|
343
|
-
}
|
|
344
|
-
function validateSessionPolicy(policy) {
|
|
345
|
-
const { idleTimeoutMs, absoluteTimeoutMs } = policy;
|
|
346
|
-
if (idleTimeoutMs !== void 0 && (typeof idleTimeoutMs !== "number" || idleTimeoutMs <= 0)) {
|
|
347
|
-
throw new Error(`SessionPolicy.idleTimeoutMs must be a positive number, got ${idleTimeoutMs}`);
|
|
348
|
-
}
|
|
349
|
-
if (absoluteTimeoutMs !== void 0 && (typeof absoluteTimeoutMs !== "number" || absoluteTimeoutMs <= 0)) {
|
|
350
|
-
throw new Error(`SessionPolicy.absoluteTimeoutMs must be a positive number, got ${absoluteTimeoutMs}`);
|
|
351
|
-
}
|
|
352
|
-
if (idleTimeoutMs !== void 0 && absoluteTimeoutMs !== void 0 && idleTimeoutMs >= absoluteTimeoutMs) {
|
|
353
|
-
throw new Error(
|
|
354
|
-
`SessionPolicy.idleTimeoutMs (${idleTimeoutMs}ms) must be less than absoluteTimeoutMs (${absoluteTimeoutMs}ms)`
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// src/session/dev-unlock.ts
|
|
360
|
-
var REQUIRED_ACKNOWLEDGE = "I-UNDERSTAND-THIS-DISABLES-UNLOCK-SECURITY";
|
|
361
|
-
var STORAGE_PREFIX = "noydb:dev-unlock:";
|
|
362
|
-
function assertDevEnvironment() {
|
|
363
|
-
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") {
|
|
364
|
-
throw new ValidationError(
|
|
365
|
-
'devUnlock is not available in production builds. process.env.NODE_ENV is "production".'
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
if (typeof globalThis !== "undefined" && globalThis.__vite_is_production__ === true) {
|
|
369
|
-
throw new ValidationError("devUnlock is not available in production builds.");
|
|
370
|
-
}
|
|
371
|
-
if (typeof window !== "undefined" && typeof window.location !== "undefined") {
|
|
372
|
-
const host = window.location.hostname;
|
|
373
|
-
if (host !== "localhost" && host !== "127.0.0.1" && host !== "::1" && !host.endsWith(".local")) {
|
|
374
|
-
throw new ValidationError(
|
|
375
|
-
`devUnlock is only available on localhost. Current hostname: "${host}". Set NODE_ENV=development and run on localhost to use dev unlock.`
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
function storageKey(vault, userId) {
|
|
381
|
-
return `${STORAGE_PREFIX}${vault}:${userId}`;
|
|
382
|
-
}
|
|
383
|
-
function resolveStorage(persistAcrossTabs) {
|
|
384
|
-
if (typeof window === "undefined") {
|
|
385
|
-
throw new ValidationError("devUnlock requires a browser environment (window.sessionStorage / window.localStorage).");
|
|
386
|
-
}
|
|
387
|
-
return persistAcrossTabs ? window.localStorage : window.sessionStorage;
|
|
388
|
-
}
|
|
389
|
-
async function enableDevUnlock(vault, userId, keyring, options) {
|
|
390
|
-
if (options.acknowledge !== REQUIRED_ACKNOWLEDGE) {
|
|
391
|
-
throw new ValidationError(
|
|
392
|
-
`devUnlock requires acknowledge: '${REQUIRED_ACKNOWLEDGE}'. Got: '${options.acknowledge}'. This is intentional \u2014 the full string must appear in your source.`
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
assertDevEnvironment();
|
|
396
|
-
const storage = resolveStorage(options.persistAcrossTabs);
|
|
397
|
-
const dekMap = {};
|
|
398
|
-
for (const [collName, dek] of keyring.deks) {
|
|
399
|
-
const raw = await globalThis.crypto.subtle.exportKey("raw", dek);
|
|
400
|
-
dekMap[collName] = bufferToBase64(raw);
|
|
401
|
-
}
|
|
402
|
-
const payload = JSON.stringify({
|
|
403
|
-
_noydb_dev_unlock: 1,
|
|
404
|
-
userId: keyring.userId,
|
|
405
|
-
displayName: keyring.displayName,
|
|
406
|
-
role: keyring.role,
|
|
407
|
-
permissions: keyring.permissions,
|
|
408
|
-
deks: dekMap,
|
|
409
|
-
salt: bufferToBase64(keyring.salt)
|
|
410
|
-
});
|
|
411
|
-
storage.setItem(storageKey(vault, userId), payload);
|
|
412
|
-
console.warn(
|
|
413
|
-
"%c\u26A0\uFE0F NOYDB DEV UNLOCK ACTIVE \u26A0\uFE0F",
|
|
414
|
-
"color: red; font-size: 16px; font-weight: bold",
|
|
415
|
-
`
|
|
416
|
-
|
|
417
|
-
Vault "${vault}" user "${userId}" is stored in ${options.persistAcrossTabs ? "localStorage" : "sessionStorage"} in PLAINTEXT DEKs.
|
|
418
|
-
This is ONLY safe for local development. Never use in production.
|
|
419
|
-
Call clearDevUnlock() to remove.`
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
async function loadDevUnlock(vault, userId, options = {}) {
|
|
423
|
-
if (typeof window === "undefined") return null;
|
|
424
|
-
const storage = resolveStorage(options.persistAcrossTabs);
|
|
425
|
-
const raw = storage.getItem(storageKey(vault, userId));
|
|
426
|
-
if (!raw) return null;
|
|
427
|
-
let parsed;
|
|
428
|
-
try {
|
|
429
|
-
parsed = JSON.parse(raw);
|
|
430
|
-
} catch {
|
|
431
|
-
return null;
|
|
432
|
-
}
|
|
433
|
-
if (parsed._noydb_dev_unlock !== 1) return null;
|
|
434
|
-
const deks = /* @__PURE__ */ new Map();
|
|
435
|
-
for (const [collName, rawBase64] of Object.entries(parsed.deks)) {
|
|
436
|
-
const dek = await globalThis.crypto.subtle.importKey(
|
|
437
|
-
"raw",
|
|
438
|
-
base64ToBuffer(rawBase64),
|
|
439
|
-
{ name: "AES-GCM", length: 256 },
|
|
440
|
-
true,
|
|
441
|
-
["encrypt", "decrypt"]
|
|
442
|
-
);
|
|
443
|
-
deks.set(collName, dek);
|
|
444
|
-
}
|
|
445
|
-
return {
|
|
446
|
-
userId: parsed.userId,
|
|
447
|
-
displayName: parsed.displayName,
|
|
448
|
-
role: parsed.role,
|
|
449
|
-
permissions: parsed.permissions,
|
|
450
|
-
deks,
|
|
451
|
-
kek: null,
|
|
452
|
-
salt: base64ToBuffer(parsed.salt),
|
|
453
|
-
authenticators: []
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
function clearDevUnlock(vault, userId, options = {}) {
|
|
457
|
-
if (typeof window === "undefined") return;
|
|
458
|
-
const storage = resolveStorage(options.persistAcrossTabs);
|
|
459
|
-
storage.removeItem(storageKey(vault, userId));
|
|
460
|
-
}
|
|
461
|
-
function isDevUnlockActive(vault, userId, options = {}) {
|
|
462
|
-
if (typeof window === "undefined") return false;
|
|
463
|
-
const storage = resolveStorage(options.persistAcrossTabs);
|
|
464
|
-
return storage.getItem(storageKey(vault, userId)) !== null;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// src/session/active.ts
|
|
468
|
-
function withSession() {
|
|
469
|
-
return {
|
|
470
|
-
validateSessionPolicy,
|
|
471
|
-
createEnforcer,
|
|
472
|
-
revokeAllSessions
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
476
|
-
0 && (module.exports = {
|
|
477
|
-
PolicyEnforcer,
|
|
478
|
-
SessionExpiredError,
|
|
479
|
-
SessionNotFoundError,
|
|
480
|
-
SessionPolicyError,
|
|
481
|
-
activeSessionCount,
|
|
482
|
-
clearDevUnlock,
|
|
483
|
-
createEnforcer,
|
|
484
|
-
createSession,
|
|
485
|
-
enableDevUnlock,
|
|
486
|
-
isDevUnlockActive,
|
|
487
|
-
isSessionAlive,
|
|
488
|
-
loadDevUnlock,
|
|
489
|
-
resolveSession,
|
|
490
|
-
revokeAllSessions,
|
|
491
|
-
revokeSession,
|
|
492
|
-
validateSessionPolicy,
|
|
493
|
-
withSession
|
|
494
|
-
});
|
|
495
|
-
//# sourceMappingURL=index.cjs.map
|