@keystrokehq/platform 0.1.1 → 0.1.2
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/{awk2-LA3USKJP-CKefzQCd.mjs → awk2-LA3USKJP-C4BD4eVg.mjs} +2 -2
- package/dist/{awk2-LA3USKJP-CKefzQCd.mjs.map → awk2-LA3USKJP-C4BD4eVg.mjs.map} +1 -1
- package/dist/{awk2-LA3USKJP-BNV-PUu0.cjs → awk2-LA3USKJP-Ddh1vPYe.cjs} +2 -2
- package/dist/{awk2-LA3USKJP-BNV-PUu0.cjs.map → awk2-LA3USKJP-Ddh1vPYe.cjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-Ca8wsOx8.cjs → base64-C2AIWVNC-BaiY8WTm.cjs} +2 -2
- package/dist/{base64-C2AIWVNC-Ca8wsOx8.cjs.map → base64-C2AIWVNC-BaiY8WTm.cjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-Bw6COidZ.mjs → base64-C2AIWVNC-ChQw62cb.mjs} +2 -2
- package/dist/{base64-C2AIWVNC-Bw6COidZ.mjs.map → base64-C2AIWVNC-ChQw62cb.mjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-DafyaX5Y.cjs → bash-YZ33HQZQ-CSOYNHWg.cjs} +2 -2
- package/dist/{bash-YZ33HQZQ-DafyaX5Y.cjs.map → bash-YZ33HQZQ-CSOYNHWg.cjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-DcfJU6Ux.mjs → bash-YZ33HQZQ-Y0B3uk-_.mjs} +2 -2
- package/dist/{bash-YZ33HQZQ-DcfJU6Ux.mjs.map → bash-YZ33HQZQ-Y0B3uk-_.mjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-CoIsiESf.cjs → cat-TSFMZVYS-DA84HtAp.cjs} +3 -3
- package/dist/{cat-TSFMZVYS-CoIsiESf.cjs.map → cat-TSFMZVYS-DA84HtAp.cjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-CH5_fwTr.mjs → cat-TSFMZVYS-xDkdXP7N.mjs} +3 -3
- package/dist/{cat-TSFMZVYS-CH5_fwTr.mjs.map → cat-TSFMZVYS-xDkdXP7N.mjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-B8_eAK5q.cjs → chunk-5H5SCKJM-CH5cUv3d.cjs} +2 -2
- package/dist/{chunk-5H5SCKJM-B8_eAK5q.cjs.map → chunk-5H5SCKJM-CH5cUv3d.cjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-7YDw0nlX.mjs → chunk-5H5SCKJM-CS7KORUE.mjs} +2 -2
- package/dist/{chunk-5H5SCKJM-7YDw0nlX.mjs.map → chunk-5H5SCKJM-CS7KORUE.mjs.map} +1 -1
- package/dist/{chunk-AQ6FYS2X-j91QPdH4.cjs → chunk-AQ6FYS2X-BHfS6zKK.cjs} +2 -2
- package/dist/{chunk-AQ6FYS2X-j91QPdH4.cjs.map → chunk-AQ6FYS2X-BHfS6zKK.cjs.map} +1 -1
- package/dist/{chunk-AQ6FYS2X-BC0cOnb9.mjs → chunk-AQ6FYS2X-CmF-1vT3.mjs} +2 -2
- package/dist/{chunk-AQ6FYS2X-BC0cOnb9.mjs.map → chunk-AQ6FYS2X-CmF-1vT3.mjs.map} +1 -1
- package/dist/{chunk-CHFEPBH4-TM0eBc-8.cjs → chunk-CHFEPBH4-BeM01F0F.cjs} +2 -2
- package/dist/{chunk-CHFEPBH4-TM0eBc-8.cjs.map → chunk-CHFEPBH4-BeM01F0F.cjs.map} +1 -1
- package/dist/{chunk-CHFEPBH4-5WV6pMBA.mjs → chunk-CHFEPBH4-C7eTbJVK.mjs} +2 -2
- package/dist/{chunk-CHFEPBH4-5WV6pMBA.mjs.map → chunk-CHFEPBH4-C7eTbJVK.mjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-BGEWfN_e.mjs → chunk-EBAPSGAO-BZyQwwNU.mjs} +2 -2
- package/dist/{chunk-EBAPSGAO-BGEWfN_e.mjs.map → chunk-EBAPSGAO-BZyQwwNU.mjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-X4NT2DxA.cjs → chunk-EBAPSGAO-fp1lOUs3.cjs} +2 -2
- package/dist/{chunk-EBAPSGAO-X4NT2DxA.cjs.map → chunk-EBAPSGAO-fp1lOUs3.cjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-BPVzbmRh.cjs → chunk-LEKBROJD-CC4SPOIA.cjs} +2 -2
- package/dist/{chunk-LEKBROJD-BPVzbmRh.cjs.map → chunk-LEKBROJD-CC4SPOIA.cjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-DTQWQf0a.mjs → chunk-LEKBROJD-DgEXP_ty.mjs} +2 -2
- package/dist/{chunk-LEKBROJD-DTQWQf0a.mjs.map → chunk-LEKBROJD-DgEXP_ty.mjs.map} +1 -1
- package/dist/{chunk-VPADYNBD-qbL_T5Uh.cjs → chunk-VPADYNBD-CuU1_5VT.cjs} +2 -2
- package/dist/{chunk-VPADYNBD-qbL_T5Uh.cjs.map → chunk-VPADYNBD-CuU1_5VT.cjs.map} +1 -1
- package/dist/{chunk-VPADYNBD-DTef7dIx.mjs → chunk-VPADYNBD-DypZmvfB.mjs} +2 -2
- package/dist/{chunk-VPADYNBD-DTef7dIx.mjs.map → chunk-VPADYNBD-DypZmvfB.mjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-DS2ZbXdJ.mjs → chunk-YCLFEX4T-B5a3ihBC.mjs} +2 -2
- package/dist/{chunk-YCLFEX4T-DS2ZbXdJ.mjs.map → chunk-YCLFEX4T-B5a3ihBC.mjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-B5mxliVb.cjs → chunk-YCLFEX4T-D4AWfbT8.cjs} +2 -2
- package/dist/{chunk-YCLFEX4T-B5mxliVb.cjs.map → chunk-YCLFEX4T-D4AWfbT8.cjs.map} +1 -1
- package/dist/{column-XT6UFXNQ-DxJuuCZO.mjs → column-XT6UFXNQ-B3nI2VCJ.mjs} +2 -2
- package/dist/{column-XT6UFXNQ-DxJuuCZO.mjs.map → column-XT6UFXNQ-B3nI2VCJ.mjs.map} +1 -1
- package/dist/{column-XT6UFXNQ-CjqSbReY.cjs → column-XT6UFXNQ-D-31htgy.cjs} +2 -2
- package/dist/{column-XT6UFXNQ-CjqSbReY.cjs.map → column-XT6UFXNQ-D-31htgy.cjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-Ct7AXc22.cjs → comm-VV2LDX2J-CSfuzlYr.cjs} +2 -2
- package/dist/{comm-VV2LDX2J-Ct7AXc22.cjs.map → comm-VV2LDX2J-CSfuzlYr.cjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-CRUrgndw.mjs → comm-VV2LDX2J-DpNYwHST.mjs} +2 -2
- package/dist/{comm-VV2LDX2J-CRUrgndw.mjs.map → comm-VV2LDX2J-DpNYwHST.mjs.map} +1 -1
- package/dist/{config-CH-0zvAi.d.cts → config-Ck1BY0Ga.d.mts} +28 -6
- package/dist/{config-CJZBcsy6.d.mts → config-PWJeAlTn.d.cts} +26 -8
- package/dist/config.cjs +2 -3
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +1 -2
- package/dist/config.d.mts +1 -2
- package/dist/config.mjs +1 -2
- package/dist/config.mjs.map +1 -1
- package/dist/{cp-BISAAS7A-BEWIC1ep.mjs → cp-BISAAS7A-BHfTBk1S.mjs} +2 -2
- package/dist/{cp-BISAAS7A-BEWIC1ep.mjs.map → cp-BISAAS7A-BHfTBk1S.mjs.map} +1 -1
- package/dist/{cp-BISAAS7A-BTlFdjse.cjs → cp-BISAAS7A-CPlXYVs4.cjs} +2 -2
- package/dist/{cp-BISAAS7A-BTlFdjse.cjs.map → cp-BISAAS7A-CPlXYVs4.cjs.map} +1 -1
- package/dist/{cut-OKARJCCV-Cq3QNcN-.mjs → cut-OKARJCCV-CgfLOcVz.mjs} +3 -3
- package/dist/{cut-OKARJCCV-Cq3QNcN-.mjs.map → cut-OKARJCCV-CgfLOcVz.mjs.map} +1 -1
- package/dist/{cut-OKARJCCV-LemaM014.cjs → cut-OKARJCCV-Ci0PtEgB.cjs} +3 -3
- package/dist/{cut-OKARJCCV-LemaM014.cjs.map → cut-OKARJCCV-Ci0PtEgB.cjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-dQTRnWAk.mjs → diff-MWJFIG7X-CJdAnnog.mjs} +2 -2
- package/dist/{diff-MWJFIG7X-dQTRnWAk.mjs.map → diff-MWJFIG7X-CJdAnnog.mjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-CM3vdBmY.cjs → diff-MWJFIG7X-F82OACp-.cjs} +2 -2
- package/dist/{diff-MWJFIG7X-CM3vdBmY.cjs.map → diff-MWJFIG7X-F82OACp-.cjs.map} +1 -1
- package/dist/{dist-dELW1gaR.mjs → dist-B1hOOWjl.mjs} +273 -74
- package/dist/dist-B1hOOWjl.mjs.map +1 -0
- package/dist/{dist-COpoWBp6.cjs → dist-DvjFaP47.cjs} +283 -131
- package/dist/dist-DvjFaP47.cjs.map +1 -0
- package/dist/{du-572XNP42-3RIhvC5P.cjs → du-572XNP42-BnHmg4U2.cjs} +2 -2
- package/dist/{du-572XNP42-3RIhvC5P.cjs.map → du-572XNP42-BnHmg4U2.cjs.map} +1 -1
- package/dist/{du-572XNP42-CyPYCo2M.mjs → du-572XNP42-D6bH6wn1.mjs} +2 -2
- package/dist/{du-572XNP42-CyPYCo2M.mjs.map → du-572XNP42-D6bH6wn1.mjs.map} +1 -1
- package/dist/{env-36M5BO7M-D_8C_5X5.cjs → env-36M5BO7M-BxusWRsf.cjs} +2 -2
- package/dist/{env-36M5BO7M-D_8C_5X5.cjs.map → env-36M5BO7M-BxusWRsf.cjs.map} +1 -1
- package/dist/{env-36M5BO7M-Ds8s_D_j.mjs → env-36M5BO7M-a702Fh7w.mjs} +2 -2
- package/dist/{env-36M5BO7M-Ds8s_D_j.mjs.map → env-36M5BO7M-a702Fh7w.mjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-3UquG3Wf.mjs → expand-JSPG6VOP-BbtpP_uq.mjs} +2 -2
- package/dist/{expand-JSPG6VOP-3UquG3Wf.mjs.map → expand-JSPG6VOP-BbtpP_uq.mjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-BDy27RvB.cjs → expand-JSPG6VOP-DjHywCfM.cjs} +2 -2
- package/dist/{expand-JSPG6VOP-BDy27RvB.cjs.map → expand-JSPG6VOP-DjHywCfM.cjs.map} +1 -1
- package/dist/{expr-5JAACS4X-B-xIQg5e.mjs → expr-5JAACS4X-Cp_dIjlS.mjs} +2 -2
- package/dist/{expr-5JAACS4X-B-xIQg5e.mjs.map → expr-5JAACS4X-Cp_dIjlS.mjs.map} +1 -1
- package/dist/{expr-5JAACS4X-z-ugAUQD.cjs → expr-5JAACS4X-Df3xFZ4w.cjs} +2 -2
- package/dist/{expr-5JAACS4X-z-ugAUQD.cjs.map → expr-5JAACS4X-Df3xFZ4w.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-D6LkPRVn.cjs → find-INTH3OLC-B5hj2iWq.cjs} +3 -3
- package/dist/{find-INTH3OLC-D6LkPRVn.cjs.map → find-INTH3OLC-B5hj2iWq.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-C0oDj6Aa.mjs → find-INTH3OLC-DorC8D7k.mjs} +3 -3
- package/dist/{find-INTH3OLC-C0oDj6Aa.mjs.map → find-INTH3OLC-DorC8D7k.mjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-BNAAhi3M.mjs → fold-4TQNYMSW-DOzlyQla.mjs} +2 -2
- package/dist/{fold-4TQNYMSW-BNAAhi3M.mjs.map → fold-4TQNYMSW-DOzlyQla.mjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-C4KhiKXo.cjs → fold-4TQNYMSW-DU7ysgn3.cjs} +2 -2
- package/dist/{fold-4TQNYMSW-C4KhiKXo.cjs.map → fold-4TQNYMSW-DU7ysgn3.cjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-T3Pk0g-u.mjs → grep-V3LQVMRQ-C7va-nQQ.mjs} +4 -4
- package/dist/{grep-V3LQVMRQ-T3Pk0g-u.mjs.map → grep-V3LQVMRQ-C7va-nQQ.mjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-Ds_E1Mcg.cjs → grep-V3LQVMRQ-CnT0y0-P.cjs} +4 -4
- package/dist/{grep-V3LQVMRQ-Ds_E1Mcg.cjs.map → grep-V3LQVMRQ-CnT0y0-P.cjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-CQEhgQhi.mjs → gzip-O5ASJAFY-D25F69KM.mjs} +2 -2
- package/dist/{gzip-O5ASJAFY-CQEhgQhi.mjs.map → gzip-O5ASJAFY-D25F69KM.mjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-MdBB0FQ4.cjs → gzip-O5ASJAFY-Dwnbh7Hd.cjs} +2 -2
- package/dist/{gzip-O5ASJAFY-MdBB0FQ4.cjs.map → gzip-O5ASJAFY-Dwnbh7Hd.cjs.map} +1 -1
- package/dist/{head-442HYESI-_I53Pnb1.cjs → head-442HYESI-Dh7Qcjzs.cjs} +2 -2
- package/dist/{head-442HYESI-_I53Pnb1.cjs.map → head-442HYESI-Dh7Qcjzs.cjs.map} +1 -1
- package/dist/{head-442HYESI-C9ip0oZ6.mjs → head-442HYESI-W6FegHpm.mjs} +2 -2
- package/dist/{head-442HYESI-C9ip0oZ6.mjs.map → head-442HYESI-W6FegHpm.mjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-7klk39e-.mjs → help-HZ6M2CKN-B2mT_z-L.mjs} +2 -2
- package/dist/{help-HZ6M2CKN-7klk39e-.mjs.map → help-HZ6M2CKN-B2mT_z-L.mjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-C_gwqv6N.cjs → help-HZ6M2CKN-pRM3zbwR.cjs} +2 -2
- package/dist/{help-HZ6M2CKN-C_gwqv6N.cjs.map → help-HZ6M2CKN-pRM3zbwR.cjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-CxCkv6Mj.cjs → html-to-markdown-JW4MSQZO-CD4oQKoL.cjs} +3 -3
- package/dist/{html-to-markdown-JW4MSQZO-CxCkv6Mj.cjs.map → html-to-markdown-JW4MSQZO-CD4oQKoL.cjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-DAeOlJb4.mjs → html-to-markdown-JW4MSQZO-VzjAEp3C.mjs} +2 -2
- package/dist/{html-to-markdown-JW4MSQZO-DAeOlJb4.mjs.map → html-to-markdown-JW4MSQZO-VzjAEp3C.mjs.map} +1 -1
- package/dist/{join-TBRGI3LQ-C1FTmc74.mjs → join-TBRGI3LQ-CC2R6oH8.mjs} +2 -2
- package/dist/{join-TBRGI3LQ-C1FTmc74.mjs.map → join-TBRGI3LQ-CC2R6oH8.mjs.map} +1 -1
- package/dist/{join-TBRGI3LQ-C-dsbt1O.cjs → join-TBRGI3LQ-DR2e5mf6.cjs} +2 -2
- package/dist/{join-TBRGI3LQ-C-dsbt1O.cjs.map → join-TBRGI3LQ-DR2e5mf6.cjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-DwRPL82B.cjs → jq-4XLYLOS5-CKdOTiVR.cjs} +4 -4
- package/dist/{jq-4XLYLOS5-DwRPL82B.cjs.map → jq-4XLYLOS5-CKdOTiVR.cjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-f2AdWe3I.mjs → jq-4XLYLOS5-QOU61AvR.mjs} +4 -4
- package/dist/{jq-4XLYLOS5-f2AdWe3I.mjs.map → jq-4XLYLOS5-QOU61AvR.mjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7-C-U_T49T.cjs → js-exec-N5KEZBH7-8xgWmlL7.cjs} +4 -4
- package/dist/{js-exec-N5KEZBH7-C-U_T49T.cjs.map → js-exec-N5KEZBH7-8xgWmlL7.cjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7-J0fE5u49.mjs → js-exec-N5KEZBH7-CrHAJDpT.mjs} +3 -3
- package/dist/{js-exec-N5KEZBH7-J0fE5u49.mjs.map → js-exec-N5KEZBH7-CrHAJDpT.mjs.map} +1 -1
- package/dist/{lib-DE8ataza.cjs → lib-DLRZ2u6t.cjs} +2 -2
- package/dist/{lib-DE8ataza.cjs.map → lib-DLRZ2u6t.cjs.map} +1 -1
- package/dist/{lib-xIAY37Rj.mjs → lib-DecFXHrv.mjs} +2 -2
- package/dist/{lib-xIAY37Rj.mjs.map → lib-DecFXHrv.mjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-lLnmqTxq.cjs → ln-4LGSXXGD-DxTw2TAq.cjs} +2 -2
- package/dist/{ln-4LGSXXGD-lLnmqTxq.cjs.map → ln-4LGSXXGD-DxTw2TAq.cjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-BgxP6RU_.mjs → ln-4LGSXXGD-Or1qYweN.mjs} +2 -2
- package/dist/{ln-4LGSXXGD-BgxP6RU_.mjs.map → ln-4LGSXXGD-Or1qYweN.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-C8j4Tvbv.mjs → ls-ZJGQER7M-BnKqqleV.mjs} +2 -2
- package/dist/{ls-ZJGQER7M-C8j4Tvbv.mjs.map → ls-ZJGQER7M-BnKqqleV.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-BYVAD1YO.cjs → ls-ZJGQER7M-CynOwieQ.cjs} +2 -2
- package/dist/{ls-ZJGQER7M-BYVAD1YO.cjs.map → ls-ZJGQER7M-CynOwieQ.cjs.map} +1 -1
- package/dist/{lzma-C-qU8rCo.cjs → lzma-YuGttxCP.cjs} +2 -2
- package/dist/{lzma-C-qU8rCo.cjs.map → lzma-YuGttxCP.cjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-BXWbsDvm.cjs → md5sum-SPU24VSG-8_h79vAu.cjs} +3 -3
- package/dist/{md5sum-SPU24VSG-BXWbsDvm.cjs.map → md5sum-SPU24VSG-8_h79vAu.cjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-BVd8_jGG.mjs → md5sum-SPU24VSG-BusAHdrK.mjs} +3 -3
- package/dist/{md5sum-SPU24VSG-BVd8_jGG.mjs.map → md5sum-SPU24VSG-BusAHdrK.mjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-Jxa36lH-.mjs → mkdir-MEPGZOB6-BnYYgVxv.mjs} +2 -2
- package/dist/{mkdir-MEPGZOB6-Jxa36lH-.mjs.map → mkdir-MEPGZOB6-BnYYgVxv.mjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-BY2rSz4n.cjs → mkdir-MEPGZOB6-Z0WHNFtR.cjs} +2 -2
- package/dist/{mkdir-MEPGZOB6-BY2rSz4n.cjs.map → mkdir-MEPGZOB6-Z0WHNFtR.cjs.map} +1 -1
- package/dist/{mv-W5BIQ646-C6iMhYnr.mjs → mv-W5BIQ646-CDQ60965.mjs} +2 -2
- package/dist/{mv-W5BIQ646-C6iMhYnr.mjs.map → mv-W5BIQ646-CDQ60965.mjs.map} +1 -1
- package/dist/{mv-W5BIQ646-DmAtW345.cjs → mv-W5BIQ646-tAPnueJb.cjs} +2 -2
- package/dist/{mv-W5BIQ646-DmAtW345.cjs.map → mv-W5BIQ646-tAPnueJb.cjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-DqGjVldy.cjs → nl-WSDW7I4O-BfBF-iiF.cjs} +2 -2
- package/dist/{nl-WSDW7I4O-DqGjVldy.cjs.map → nl-WSDW7I4O-BfBF-iiF.cjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-BTmNrRjW.mjs → nl-WSDW7I4O-C8m5GQ1G.mjs} +2 -2
- package/dist/{nl-WSDW7I4O-BTmNrRjW.mjs.map → nl-WSDW7I4O-C8m5GQ1G.mjs.map} +1 -1
- package/dist/{od-WOKFDJTP-BNpft7pj.cjs → od-WOKFDJTP-CHXPdcv9.cjs} +2 -2
- package/dist/{od-WOKFDJTP-BNpft7pj.cjs.map → od-WOKFDJTP-CHXPdcv9.cjs.map} +1 -1
- package/dist/{od-WOKFDJTP-nBx_t02N.mjs → od-WOKFDJTP-KIq-UMwl.mjs} +2 -2
- package/dist/{od-WOKFDJTP-nBx_t02N.mjs.map → od-WOKFDJTP-KIq-UMwl.mjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-C-0O4u2q.cjs → paste-7JC6S4DX-Bs8ByIXb.cjs} +2 -2
- package/dist/{paste-7JC6S4DX-C-0O4u2q.cjs.map → paste-7JC6S4DX-Bs8ByIXb.cjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-KVzg2jll.mjs → paste-7JC6S4DX-u6xdoWS3.mjs} +2 -2
- package/dist/{paste-7JC6S4DX-KVzg2jll.mjs.map → paste-7JC6S4DX-u6xdoWS3.mjs.map} +1 -1
- package/dist/platform-database.cjs +13 -3
- package/dist/platform-database.d.cts +1 -1
- package/dist/platform-database.d.mts +1 -1
- package/dist/platform-database.mjs +1 -1
- package/dist/{printf-TWGXF445-RWHVX5FV.cjs → printf-TWGXF445-B0tOxQT6.cjs} +3 -3
- package/dist/{printf-TWGXF445-RWHVX5FV.cjs.map → printf-TWGXF445-B0tOxQT6.cjs.map} +1 -1
- package/dist/{printf-TWGXF445-Dj6F3iWo.mjs → printf-TWGXF445-CtvDPfv-.mjs} +2 -2
- package/dist/{printf-TWGXF445-Dj6F3iWo.mjs.map → printf-TWGXF445-CtvDPfv-.mjs.map} +1 -1
- package/dist/{python3-POMOR4OA-CBslj-gJ.mjs → python3-POMOR4OA-CYRVTFwe.mjs} +3 -3
- package/dist/{python3-POMOR4OA-CBslj-gJ.mjs.map → python3-POMOR4OA-CYRVTFwe.mjs.map} +1 -1
- package/dist/{python3-POMOR4OA-BuqCCpBS.cjs → python3-POMOR4OA-DYjQ3ccZ.cjs} +4 -4
- package/dist/{python3-POMOR4OA-BuqCCpBS.cjs.map → python3-POMOR4OA-DYjQ3ccZ.cjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-Dcpld4RG.mjs → rev-5EHFX4EJ-C41ieMgj.mjs} +2 -2
- package/dist/{rev-5EHFX4EJ-Dcpld4RG.mjs.map → rev-5EHFX4EJ-C41ieMgj.mjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-gMcdZInq.cjs → rev-5EHFX4EJ-Cgya-Fo0.cjs} +2 -2
- package/dist/{rev-5EHFX4EJ-gMcdZInq.cjs.map → rev-5EHFX4EJ-Cgya-Fo0.cjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-CfvW0egS.cjs → rg-S4FXYXWB-ByK2CLxu.cjs} +3 -3
- package/dist/{rg-S4FXYXWB-CfvW0egS.cjs.map → rg-S4FXYXWB-ByK2CLxu.cjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-CCi5yOZW.mjs → rg-S4FXYXWB-DixtanJa.mjs} +3 -3
- package/dist/{rg-S4FXYXWB-CCi5yOZW.mjs.map → rg-S4FXYXWB-DixtanJa.mjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-bPTxcRcX.cjs → rm-SSGETQVQ-BSLrKStW.cjs} +2 -2
- package/dist/{rm-SSGETQVQ-bPTxcRcX.cjs.map → rm-SSGETQVQ-BSLrKStW.cjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-DOU8kqH1.mjs → rm-SSGETQVQ-CkwXZzCb.mjs} +2 -2
- package/dist/{rm-SSGETQVQ-DOU8kqH1.mjs.map → rm-SSGETQVQ-CkwXZzCb.mjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-BTIoCXcX.mjs → rmdir-OC4ZLPYA-DmK6bDKx.mjs} +2 -2
- package/dist/{rmdir-OC4ZLPYA-BTIoCXcX.mjs.map → rmdir-OC4ZLPYA-DmK6bDKx.mjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-BuPVwHWE.cjs → rmdir-OC4ZLPYA-DrF3bZoQ.cjs} +2 -2
- package/dist/{rmdir-OC4ZLPYA-BuPVwHWE.cjs.map → rmdir-OC4ZLPYA-DrF3bZoQ.cjs.map} +1 -1
- package/dist/run.cjs +1 -1
- package/dist/run.mjs +1 -1
- package/dist/{sed-S5UIK574-CedHHKip.cjs → sed-S5UIK574-B3Klx8N4.cjs} +2 -2
- package/dist/{sed-S5UIK574-CedHHKip.cjs.map → sed-S5UIK574-B3Klx8N4.cjs.map} +1 -1
- package/dist/{sed-S5UIK574-Z6_JbTpH.mjs → sed-S5UIK574-tnYwSWkL.mjs} +2 -2
- package/dist/{sed-S5UIK574-Z6_JbTpH.mjs.map → sed-S5UIK574-tnYwSWkL.mjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-DE6FG5_u.mjs → sha1sum-2PTOAFR6-BP6dQ8V1.mjs} +3 -3
- package/dist/{sha1sum-2PTOAFR6-DE6FG5_u.mjs.map → sha1sum-2PTOAFR6-BP6dQ8V1.mjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-CkkcLEco.cjs → sha1sum-2PTOAFR6-Bl7iC2ql.cjs} +3 -3
- package/dist/{sha1sum-2PTOAFR6-CkkcLEco.cjs.map → sha1sum-2PTOAFR6-Bl7iC2ql.cjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-C6E752Cf.mjs → sha256sum-NS7D3IXX-BJzrJC0M.mjs} +3 -3
- package/dist/{sha256sum-NS7D3IXX-C6E752Cf.mjs.map → sha256sum-NS7D3IXX-BJzrJC0M.mjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-Czd21v8R.cjs → sha256sum-NS7D3IXX-DdD-z8yU.cjs} +3 -3
- package/dist/{sha256sum-NS7D3IXX-Czd21v8R.cjs.map → sha256sum-NS7D3IXX-DdD-z8yU.cjs.map} +1 -1
- package/dist/{sleep-X22JJINO-7H7IWY2o.mjs → sleep-X22JJINO-D3SDAJt4.mjs} +2 -2
- package/dist/{sleep-X22JJINO-7H7IWY2o.mjs.map → sleep-X22JJINO-D3SDAJt4.mjs.map} +1 -1
- package/dist/{sleep-X22JJINO-Dx_bFfIX.cjs → sleep-X22JJINO-UJvessts.cjs} +2 -2
- package/dist/{sleep-X22JJINO-Dx_bFfIX.cjs.map → sleep-X22JJINO-UJvessts.cjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-BFOkdC51.mjs → sort-SW2YEO5B-CFc2Uu_A.mjs} +3 -3
- package/dist/{sort-SW2YEO5B-BFOkdC51.mjs.map → sort-SW2YEO5B-CFc2Uu_A.mjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-CNvaPgBI.cjs → sort-SW2YEO5B-DIDExLis.cjs} +3 -3
- package/dist/{sort-SW2YEO5B-CNvaPgBI.cjs.map → sort-SW2YEO5B-DIDExLis.cjs.map} +1 -1
- package/dist/{split-4KKZZXXE-nt0tLTli.cjs → split-4KKZZXXE-CSVvRIzD.cjs} +2 -2
- package/dist/{split-4KKZZXXE-nt0tLTli.cjs.map → split-4KKZZXXE-CSVvRIzD.cjs.map} +1 -1
- package/dist/{split-4KKZZXXE-DtBxVEO8.mjs → split-4KKZZXXE-DMjoEV89.mjs} +2 -2
- package/dist/{split-4KKZZXXE-DtBxVEO8.mjs.map → split-4KKZZXXE-DMjoEV89.mjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-BGLep8e5.mjs → sqlite3-CGOEFJAO-BXYj3z3Q.mjs} +2 -2
- package/dist/{sqlite3-CGOEFJAO-BGLep8e5.mjs.map → sqlite3-CGOEFJAO-BXYj3z3Q.mjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-BWLd6W0g.cjs → sqlite3-CGOEFJAO-DTNqDMXu.cjs} +4 -4
- package/dist/{sqlite3-CGOEFJAO-BWLd6W0g.cjs.map → sqlite3-CGOEFJAO-DTNqDMXu.cjs.map} +1 -1
- package/dist/{start-BQ0b7Zex.cjs → start-Cm1hxyF_.cjs} +3224 -234
- package/dist/start-Cm1hxyF_.cjs.map +1 -0
- package/dist/{start-jG7mVE-h.mjs → start-DmsuxtBI.mjs} +3081 -91
- package/dist/start-DmsuxtBI.mjs.map +1 -0
- package/dist/start.cjs +1 -1
- package/dist/start.d.cts +1 -1
- package/dist/start.d.mts +1 -1
- package/dist/start.mjs +1 -1
- package/dist/{strings-6WDHLGMX-CGaZuwJ8.mjs → strings-6WDHLGMX-Cs9B6z8x.mjs} +2 -2
- package/dist/{strings-6WDHLGMX-CGaZuwJ8.mjs.map → strings-6WDHLGMX-Cs9B6z8x.mjs.map} +1 -1
- package/dist/{strings-6WDHLGMX-CHWp5DnU.cjs → strings-6WDHLGMX-D2bfJpyh.cjs} +2 -2
- package/dist/{strings-6WDHLGMX-CHWp5DnU.cjs.map → strings-6WDHLGMX-D2bfJpyh.cjs.map} +1 -1
- package/dist/{tac-2STMMJYW-DJvRhvlJ.cjs → tac-2STMMJYW-D0fFvjly.cjs} +2 -2
- package/dist/{tac-2STMMJYW-DJvRhvlJ.cjs.map → tac-2STMMJYW-D0fFvjly.cjs.map} +1 -1
- package/dist/{tac-2STMMJYW-D0B5neHF.mjs → tac-2STMMJYW-ceGFflzJ.mjs} +2 -2
- package/dist/{tac-2STMMJYW-D0B5neHF.mjs.map → tac-2STMMJYW-ceGFflzJ.mjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-CBXSleY_.mjs → tail-R4PCA2C4-BopvFWyi.mjs} +2 -2
- package/dist/{tail-R4PCA2C4-CBXSleY_.mjs.map → tail-R4PCA2C4-BopvFWyi.mjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-CtnCdzuO.cjs → tail-R4PCA2C4-CLtu5GPs.cjs} +2 -2
- package/dist/{tail-R4PCA2C4-CtnCdzuO.cjs.map → tail-R4PCA2C4-CLtu5GPs.cjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-Btz1HNi9.cjs → tar-STHHZTZ6-Bxk0yG7D.cjs} +5 -5
- package/dist/{tar-STHHZTZ6-Btz1HNi9.cjs.map → tar-STHHZTZ6-Bxk0yG7D.cjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-3cydfi4Z.mjs → tar-STHHZTZ6-QbV1N_D9.mjs} +3 -3
- package/dist/{tar-STHHZTZ6-3cydfi4Z.mjs.map → tar-STHHZTZ6-QbV1N_D9.mjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-DJYybbg7.cjs → tee-YUZ2FKCJ-BbxSWxw6.cjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-DJYybbg7.cjs.map → tee-YUZ2FKCJ-BbxSWxw6.cjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-CtrtrXSY.mjs → tee-YUZ2FKCJ-DiFGWp4G.mjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-CtrtrXSY.mjs.map → tee-YUZ2FKCJ-DiFGWp4G.mjs.map} +1 -1
- package/dist/{time-D4LNBSWX-DNNPSFOx.cjs → time-D4LNBSWX-BQSWzFeK.cjs} +2 -2
- package/dist/{time-D4LNBSWX-DNNPSFOx.cjs.map → time-D4LNBSWX-BQSWzFeK.cjs.map} +1 -1
- package/dist/{time-D4LNBSWX-BU6J60I4.mjs → time-D4LNBSWX-CTjUJUms.mjs} +2 -2
- package/dist/{time-D4LNBSWX-BU6J60I4.mjs.map → time-D4LNBSWX-CTjUJUms.mjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-HSD3vHsz.mjs → timeout-YDCRSLPQ-DC-fdp1t.mjs} +2 -2
- package/dist/{timeout-YDCRSLPQ-HSD3vHsz.mjs.map → timeout-YDCRSLPQ-DC-fdp1t.mjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-C2SC5vB7.cjs → timeout-YDCRSLPQ-DEPvQ6Ih.cjs} +2 -2
- package/dist/{timeout-YDCRSLPQ-C2SC5vB7.cjs.map → timeout-YDCRSLPQ-DEPvQ6Ih.cjs.map} +1 -1
- package/dist/{touch-UA33VN3N-sh2TXNDe.mjs → touch-UA33VN3N-BMhGO9VC.mjs} +2 -2
- package/dist/{touch-UA33VN3N-sh2TXNDe.mjs.map → touch-UA33VN3N-BMhGO9VC.mjs.map} +1 -1
- package/dist/{touch-UA33VN3N-DazOwQQS.cjs → touch-UA33VN3N-DIda6f8u.cjs} +2 -2
- package/dist/{touch-UA33VN3N-DazOwQQS.cjs.map → touch-UA33VN3N-DIda6f8u.cjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-CrF6131T.cjs → tr-36LHWFRQ-COkRmY_6.cjs} +2 -2
- package/dist/{tr-36LHWFRQ-CrF6131T.cjs.map → tr-36LHWFRQ-COkRmY_6.cjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-D_2pGQp9.mjs → tr-36LHWFRQ-DjY4IsPF.mjs} +2 -2
- package/dist/{tr-36LHWFRQ-D_2pGQp9.mjs.map → tr-36LHWFRQ-DjY4IsPF.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-BIC19isL.mjs → tree-YLD52CNT-N-vPBfJO.mjs} +2 -2
- package/dist/{tree-YLD52CNT-BIC19isL.mjs.map → tree-YLD52CNT-N-vPBfJO.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-u4cOkoBM.cjs → tree-YLD52CNT-kZ9vPZ-R.cjs} +2 -2
- package/dist/{tree-YLD52CNT-u4cOkoBM.cjs.map → tree-YLD52CNT-kZ9vPZ-R.cjs.map} +1 -1
- package/dist/{unexpand-CADSA4VO-C5t4tamX.mjs → unexpand-CADSA4VO-Byi4s0o8.mjs} +2 -2
- package/dist/{unexpand-CADSA4VO-C5t4tamX.mjs.map → unexpand-CADSA4VO-Byi4s0o8.mjs.map} +1 -1
- package/dist/{unexpand-CADSA4VO-BwtCgpf8.cjs → unexpand-CADSA4VO-DekKk-hg.cjs} +2 -2
- package/dist/{unexpand-CADSA4VO-BwtCgpf8.cjs.map → unexpand-CADSA4VO-DekKk-hg.cjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-D1uH-xXs.cjs → uniq-XSIZR6PB-BhdgA9iI.cjs} +3 -3
- package/dist/{uniq-XSIZR6PB-D1uH-xXs.cjs.map → uniq-XSIZR6PB-BhdgA9iI.cjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-BPhswb-D.mjs → uniq-XSIZR6PB-D0HICyAj.mjs} +3 -3
- package/dist/{uniq-XSIZR6PB-BPhswb-D.mjs.map → uniq-XSIZR6PB-D0HICyAj.mjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-Dha3d9oq.cjs → wc-LF7NU4LA-Ci3_hJug.cjs} +3 -3
- package/dist/{wc-LF7NU4LA-Dha3d9oq.cjs.map → wc-LF7NU4LA-Ci3_hJug.cjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-HonUXgc3.mjs → wc-LF7NU4LA-CnEel3wT.mjs} +3 -3
- package/dist/{wc-LF7NU4LA-HonUXgc3.mjs.map → wc-LF7NU4LA-CnEel3wT.mjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-DKE1_HEE.mjs → xan-Y6WF3IRG-BEGK5ruS.mjs} +6 -6
- package/dist/{xan-Y6WF3IRG-DKE1_HEE.mjs.map → xan-Y6WF3IRG-BEGK5ruS.mjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-DF8LgdcK.cjs → xan-Y6WF3IRG-EnrntEIM.cjs} +6 -6
- package/dist/{xan-Y6WF3IRG-DF8LgdcK.cjs.map → xan-Y6WF3IRG-EnrntEIM.cjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-CBWjF4AF.mjs → xan-view-HDVKHFC2-CvEDnphU.mjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-CBWjF4AF.mjs.map → xan-view-HDVKHFC2-CvEDnphU.mjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-BTj5UUmy.cjs → xan-view-HDVKHFC2-c1gcVO0A.cjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-BTj5UUmy.cjs.map → xan-view-HDVKHFC2-c1gcVO0A.cjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-w6s3TO73.mjs → xargs-MGZPH7AX-BvI6LK8I.mjs} +2 -2
- package/dist/{xargs-MGZPH7AX-w6s3TO73.mjs.map → xargs-MGZPH7AX-BvI6LK8I.mjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-BX6HS5mB.cjs → xargs-MGZPH7AX-DNyBXxK4.cjs} +2 -2
- package/dist/{xargs-MGZPH7AX-BX6HS5mB.cjs.map → xargs-MGZPH7AX-DNyBXxK4.cjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-CqoPq62R.cjs → yq-4QJW3EQG-9kH_HlxF.cjs} +3 -3
- package/dist/{yq-4QJW3EQG-CqoPq62R.cjs.map → yq-4QJW3EQG-9kH_HlxF.cjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-DgunUMhp.mjs → yq-4QJW3EQG-CYt1C3ZB.mjs} +3 -3
- package/dist/{yq-4QJW3EQG-DgunUMhp.mjs.map → yq-4QJW3EQG-CYt1C3ZB.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist-BPaInPOA.cjs +0 -287
- package/dist/dist-BPaInPOA.cjs.map +0 -1
- package/dist/dist-COpoWBp6.cjs.map +0 -1
- package/dist/dist-CW17n9gj.cjs +0 -11507
- package/dist/dist-CW17n9gj.cjs.map +0 -1
- package/dist/dist-DkMgDyky.mjs +0 -274
- package/dist/dist-DkMgDyky.mjs.map +0 -1
- package/dist/dist-a3xv8a0D.mjs +0 -10904
- package/dist/dist-a3xv8a0D.mjs.map +0 -1
- package/dist/dist-dELW1gaR.mjs.map +0 -1
- package/dist/index-BwAU1YGx.d.mts +0 -37
- package/dist/index-Ceq3LoQV.d.cts +0 -35
- package/dist/index-Cf2z5TA-.d.cts +0 -807
- package/dist/index-UhcpOLvB.d.mts +0 -809
- package/dist/start-BQ0b7Zex.cjs.map +0 -1
- package/dist/start-jG7mVE-h.mjs.map +0 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
const require_dist$2 = require("./dist-
|
|
2
|
-
const require_dist$3 = require("./dist-BPaInPOA.cjs");
|
|
3
|
-
const require_dist$4 = require("./dist-CW17n9gj.cjs");
|
|
1
|
+
const require_dist$2 = require("./dist-DvjFaP47.cjs");
|
|
4
2
|
require("./chunk-BZUGFHVS-7RRM7Jpb.cjs");
|
|
5
3
|
const require_chunk_TN7HHBQW = require("./chunk-TN7HHBQW-D_SK6w5n.cjs");
|
|
6
4
|
let node_fs = require("node:fs");
|
|
@@ -16,18 +14,17 @@ let better_auth = require("better-auth");
|
|
|
16
14
|
let better_auth_plugins_bearer = require("better-auth/plugins/bearer");
|
|
17
15
|
let better_auth_plugins_device_authorization = require("better-auth/plugins/device-authorization");
|
|
18
16
|
let better_auth_plugins = require("better-auth/plugins");
|
|
19
|
-
let
|
|
20
|
-
let pg = require("pg");
|
|
21
|
-
pg = require_dist$2.__toESM(pg, 1);
|
|
22
|
-
require("node:url");
|
|
23
|
-
let node_crypto = require("node:crypto");
|
|
24
|
-
let node_async_hooks = require("node:async_hooks");
|
|
17
|
+
let _keystrokehq_platform_database = require("@keystrokehq/platform-database");
|
|
25
18
|
let better_auth_api = require("better-auth/api");
|
|
26
19
|
let better_auth_plugins_magic_link = require("better-auth/plugins/magic-link");
|
|
27
20
|
let resend = require("resend");
|
|
28
21
|
let _keystrokehq_runtime = require("@keystrokehq/runtime");
|
|
29
22
|
require("node:fs/promises");
|
|
23
|
+
require("node:url");
|
|
24
|
+
let _keystrokehq_database = require("@keystrokehq/database");
|
|
30
25
|
let node_module = require("node:module");
|
|
26
|
+
let node_crypto = require("node:crypto");
|
|
27
|
+
let node_async_hooks = require("node:async_hooks");
|
|
31
28
|
require("zod/v3");
|
|
32
29
|
require("zod/v4-mini");
|
|
33
30
|
let zod_v4 = require("zod/v4");
|
|
@@ -40,6 +37,8 @@ node_events = require_dist$2.__toESM(node_events, 1);
|
|
|
40
37
|
let node_assert = require("node:assert");
|
|
41
38
|
node_assert = require_dist$2.__toESM(node_assert, 1);
|
|
42
39
|
let node_timers_promises = require("node:timers/promises");
|
|
40
|
+
let pg = require("pg");
|
|
41
|
+
pg = require_dist$2.__toESM(pg, 1);
|
|
43
42
|
let _keystrokehq_http = require("@keystrokehq/http");
|
|
44
43
|
let hono = require("hono");
|
|
45
44
|
//#region ../../node_modules/.pnpm/jose@6.2.3/node_modules/jose/dist/webapi/lib/buffer_utils.js
|
|
@@ -1296,26 +1295,3017 @@ function createAuthJwtVerifier(authBaseUrl) {
|
|
|
1296
1295
|
});
|
|
1297
1296
|
}
|
|
1298
1297
|
//#endregion
|
|
1298
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/entity.js
|
|
1299
|
+
const entityKind = Symbol.for("drizzle:entityKind");
|
|
1300
|
+
function is(value, type) {
|
|
1301
|
+
if (!value || typeof value !== "object") return false;
|
|
1302
|
+
if (value instanceof type) return true;
|
|
1303
|
+
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) throw new Error(`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);
|
|
1304
|
+
let cls = Object.getPrototypeOf(value).constructor;
|
|
1305
|
+
if (cls) while (cls) {
|
|
1306
|
+
if (entityKind in cls && cls[entityKind] === type[entityKind]) return true;
|
|
1307
|
+
cls = Object.getPrototypeOf(cls);
|
|
1308
|
+
}
|
|
1309
|
+
return false;
|
|
1310
|
+
}
|
|
1311
|
+
//#endregion
|
|
1312
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/column.js
|
|
1313
|
+
var Column = class {
|
|
1314
|
+
constructor(table, config) {
|
|
1315
|
+
this.table = table;
|
|
1316
|
+
this.config = config;
|
|
1317
|
+
this.name = config.name;
|
|
1318
|
+
this.keyAsName = config.keyAsName;
|
|
1319
|
+
this.notNull = config.notNull;
|
|
1320
|
+
this.default = config.default;
|
|
1321
|
+
this.defaultFn = config.defaultFn;
|
|
1322
|
+
this.onUpdateFn = config.onUpdateFn;
|
|
1323
|
+
this.hasDefault = config.hasDefault;
|
|
1324
|
+
this.primary = config.primaryKey;
|
|
1325
|
+
this.isUnique = config.isUnique;
|
|
1326
|
+
this.uniqueName = config.uniqueName;
|
|
1327
|
+
this.uniqueType = config.uniqueType;
|
|
1328
|
+
this.dataType = config.dataType;
|
|
1329
|
+
this.columnType = config.columnType;
|
|
1330
|
+
this.generated = config.generated;
|
|
1331
|
+
this.generatedIdentity = config.generatedIdentity;
|
|
1332
|
+
}
|
|
1333
|
+
static [entityKind] = "Column";
|
|
1334
|
+
name;
|
|
1335
|
+
keyAsName;
|
|
1336
|
+
primary;
|
|
1337
|
+
notNull;
|
|
1338
|
+
default;
|
|
1339
|
+
defaultFn;
|
|
1340
|
+
onUpdateFn;
|
|
1341
|
+
hasDefault;
|
|
1342
|
+
isUnique;
|
|
1343
|
+
uniqueName;
|
|
1344
|
+
uniqueType;
|
|
1345
|
+
dataType;
|
|
1346
|
+
columnType;
|
|
1347
|
+
enumValues = void 0;
|
|
1348
|
+
generated = void 0;
|
|
1349
|
+
generatedIdentity = void 0;
|
|
1350
|
+
config;
|
|
1351
|
+
mapFromDriverValue(value) {
|
|
1352
|
+
return value;
|
|
1353
|
+
}
|
|
1354
|
+
mapToDriverValue(value) {
|
|
1355
|
+
return value;
|
|
1356
|
+
}
|
|
1357
|
+
shouldDisableInsert() {
|
|
1358
|
+
return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
//#endregion
|
|
1362
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/column-builder.js
|
|
1363
|
+
var ColumnBuilder = class {
|
|
1364
|
+
static [entityKind] = "ColumnBuilder";
|
|
1365
|
+
config;
|
|
1366
|
+
constructor(name, dataType, columnType) {
|
|
1367
|
+
this.config = {
|
|
1368
|
+
name,
|
|
1369
|
+
keyAsName: name === "",
|
|
1370
|
+
notNull: false,
|
|
1371
|
+
default: void 0,
|
|
1372
|
+
hasDefault: false,
|
|
1373
|
+
primaryKey: false,
|
|
1374
|
+
isUnique: false,
|
|
1375
|
+
uniqueName: void 0,
|
|
1376
|
+
uniqueType: void 0,
|
|
1377
|
+
dataType,
|
|
1378
|
+
columnType,
|
|
1379
|
+
generated: void 0
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Changes the data type of the column. Commonly used with `json` columns. Also, useful for branded types.
|
|
1384
|
+
*
|
|
1385
|
+
* @example
|
|
1386
|
+
* ```ts
|
|
1387
|
+
* const users = pgTable('users', {
|
|
1388
|
+
* id: integer('id').$type<UserId>().primaryKey(),
|
|
1389
|
+
* details: json('details').$type<UserDetails>().notNull(),
|
|
1390
|
+
* });
|
|
1391
|
+
* ```
|
|
1392
|
+
*/
|
|
1393
|
+
$type() {
|
|
1394
|
+
return this;
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Adds a `not null` clause to the column definition.
|
|
1398
|
+
*
|
|
1399
|
+
* Affects the `select` model of the table - columns *without* `not null` will be nullable on select.
|
|
1400
|
+
*/
|
|
1401
|
+
notNull() {
|
|
1402
|
+
this.config.notNull = true;
|
|
1403
|
+
return this;
|
|
1404
|
+
}
|
|
1405
|
+
/**
|
|
1406
|
+
* Adds a `default <value>` clause to the column definition.
|
|
1407
|
+
*
|
|
1408
|
+
* Affects the `insert` model of the table - columns *with* `default` are optional on insert.
|
|
1409
|
+
*
|
|
1410
|
+
* If you need to set a dynamic default value, use {@link $defaultFn} instead.
|
|
1411
|
+
*/
|
|
1412
|
+
default(value) {
|
|
1413
|
+
this.config.default = value;
|
|
1414
|
+
this.config.hasDefault = true;
|
|
1415
|
+
return this;
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Adds a dynamic default value to the column.
|
|
1419
|
+
* The function will be called when the row is inserted, and the returned value will be used as the column value.
|
|
1420
|
+
*
|
|
1421
|
+
* **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.
|
|
1422
|
+
*/
|
|
1423
|
+
$defaultFn(fn) {
|
|
1424
|
+
this.config.defaultFn = fn;
|
|
1425
|
+
this.config.hasDefault = true;
|
|
1426
|
+
return this;
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Alias for {@link $defaultFn}.
|
|
1430
|
+
*/
|
|
1431
|
+
$default = this.$defaultFn;
|
|
1432
|
+
/**
|
|
1433
|
+
* Adds a dynamic update value to the column.
|
|
1434
|
+
* The function will be called when the row is updated, and the returned value will be used as the column value if none is provided.
|
|
1435
|
+
* If no `default` (or `$defaultFn`) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value.
|
|
1436
|
+
*
|
|
1437
|
+
* **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.
|
|
1438
|
+
*/
|
|
1439
|
+
$onUpdateFn(fn) {
|
|
1440
|
+
this.config.onUpdateFn = fn;
|
|
1441
|
+
this.config.hasDefault = true;
|
|
1442
|
+
return this;
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Alias for {@link $onUpdateFn}.
|
|
1446
|
+
*/
|
|
1447
|
+
$onUpdate = this.$onUpdateFn;
|
|
1448
|
+
/**
|
|
1449
|
+
* Adds a `primary key` clause to the column definition. This implicitly makes the column `not null`.
|
|
1450
|
+
*
|
|
1451
|
+
* In SQLite, `integer primary key` implicitly makes the column auto-incrementing.
|
|
1452
|
+
*/
|
|
1453
|
+
primaryKey() {
|
|
1454
|
+
this.config.primaryKey = true;
|
|
1455
|
+
this.config.notNull = true;
|
|
1456
|
+
return this;
|
|
1457
|
+
}
|
|
1458
|
+
/** @internal Sets the name of the column to the key within the table definition if a name was not given. */
|
|
1459
|
+
setName(name) {
|
|
1460
|
+
if (this.config.name !== "") return;
|
|
1461
|
+
this.config.name = name;
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
//#endregion
|
|
1465
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/table.utils.js
|
|
1466
|
+
const TableName = Symbol.for("drizzle:Name");
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/foreign-keys.js
|
|
1469
|
+
var ForeignKeyBuilder$1 = class {
|
|
1470
|
+
static [entityKind] = "PgForeignKeyBuilder";
|
|
1471
|
+
/** @internal */
|
|
1472
|
+
reference;
|
|
1473
|
+
/** @internal */
|
|
1474
|
+
_onUpdate = "no action";
|
|
1475
|
+
/** @internal */
|
|
1476
|
+
_onDelete = "no action";
|
|
1477
|
+
constructor(config, actions) {
|
|
1478
|
+
this.reference = () => {
|
|
1479
|
+
const { name, columns, foreignColumns } = config();
|
|
1480
|
+
return {
|
|
1481
|
+
name,
|
|
1482
|
+
columns,
|
|
1483
|
+
foreignTable: foreignColumns[0].table,
|
|
1484
|
+
foreignColumns
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
if (actions) {
|
|
1488
|
+
this._onUpdate = actions.onUpdate;
|
|
1489
|
+
this._onDelete = actions.onDelete;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
onUpdate(action) {
|
|
1493
|
+
this._onUpdate = action === void 0 ? "no action" : action;
|
|
1494
|
+
return this;
|
|
1495
|
+
}
|
|
1496
|
+
onDelete(action) {
|
|
1497
|
+
this._onDelete = action === void 0 ? "no action" : action;
|
|
1498
|
+
return this;
|
|
1499
|
+
}
|
|
1500
|
+
/** @internal */
|
|
1501
|
+
build(table) {
|
|
1502
|
+
return new ForeignKey$1(table, this);
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
var ForeignKey$1 = class {
|
|
1506
|
+
constructor(table, builder) {
|
|
1507
|
+
this.table = table;
|
|
1508
|
+
this.reference = builder.reference;
|
|
1509
|
+
this.onUpdate = builder._onUpdate;
|
|
1510
|
+
this.onDelete = builder._onDelete;
|
|
1511
|
+
}
|
|
1512
|
+
static [entityKind] = "PgForeignKey";
|
|
1513
|
+
reference;
|
|
1514
|
+
onUpdate;
|
|
1515
|
+
onDelete;
|
|
1516
|
+
getName() {
|
|
1517
|
+
const { name, columns, foreignColumns } = this.reference();
|
|
1518
|
+
const columnNames = columns.map((column) => column.name);
|
|
1519
|
+
const foreignColumnNames = foreignColumns.map((column) => column.name);
|
|
1520
|
+
const chunks = [
|
|
1521
|
+
this.table[TableName],
|
|
1522
|
+
...columnNames,
|
|
1523
|
+
foreignColumns[0].table[TableName],
|
|
1524
|
+
...foreignColumnNames
|
|
1525
|
+
];
|
|
1526
|
+
return name ?? `${chunks.join("_")}_fk`;
|
|
1527
|
+
}
|
|
1528
|
+
};
|
|
1529
|
+
//#endregion
|
|
1530
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/tracing-utils.js
|
|
1531
|
+
function iife(fn, ...args) {
|
|
1532
|
+
return fn(...args);
|
|
1533
|
+
}
|
|
1534
|
+
//#endregion
|
|
1535
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
1536
|
+
function uniqueKeyName$1(table, columns) {
|
|
1537
|
+
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
1538
|
+
}
|
|
1539
|
+
//#endregion
|
|
1540
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/utils/array.js
|
|
1541
|
+
function parsePgArrayValue(arrayString, startFrom, inQuotes) {
|
|
1542
|
+
for (let i = startFrom; i < arrayString.length; i++) {
|
|
1543
|
+
const char = arrayString[i];
|
|
1544
|
+
if (char === "\\") {
|
|
1545
|
+
i++;
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
if (char === "\"") return [arrayString.slice(startFrom, i).replace(/\\/g, ""), i + 1];
|
|
1549
|
+
if (inQuotes) continue;
|
|
1550
|
+
if (char === "," || char === "}") return [arrayString.slice(startFrom, i).replace(/\\/g, ""), i];
|
|
1551
|
+
}
|
|
1552
|
+
return [arrayString.slice(startFrom).replace(/\\/g, ""), arrayString.length];
|
|
1553
|
+
}
|
|
1554
|
+
function parsePgNestedArray(arrayString, startFrom = 0) {
|
|
1555
|
+
const result = [];
|
|
1556
|
+
let i = startFrom;
|
|
1557
|
+
let lastCharIsComma = false;
|
|
1558
|
+
while (i < arrayString.length) {
|
|
1559
|
+
const char = arrayString[i];
|
|
1560
|
+
if (char === ",") {
|
|
1561
|
+
if (lastCharIsComma || i === startFrom) result.push("");
|
|
1562
|
+
lastCharIsComma = true;
|
|
1563
|
+
i++;
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
lastCharIsComma = false;
|
|
1567
|
+
if (char === "\\") {
|
|
1568
|
+
i += 2;
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
if (char === "\"") {
|
|
1572
|
+
const [value2, startFrom2] = parsePgArrayValue(arrayString, i + 1, true);
|
|
1573
|
+
result.push(value2);
|
|
1574
|
+
i = startFrom2;
|
|
1575
|
+
continue;
|
|
1576
|
+
}
|
|
1577
|
+
if (char === "}") return [result, i + 1];
|
|
1578
|
+
if (char === "{") {
|
|
1579
|
+
const [value2, startFrom2] = parsePgNestedArray(arrayString, i + 1);
|
|
1580
|
+
result.push(value2);
|
|
1581
|
+
i = startFrom2;
|
|
1582
|
+
continue;
|
|
1583
|
+
}
|
|
1584
|
+
const [value, newStartFrom] = parsePgArrayValue(arrayString, i, false);
|
|
1585
|
+
result.push(value);
|
|
1586
|
+
i = newStartFrom;
|
|
1587
|
+
}
|
|
1588
|
+
return [result, i];
|
|
1589
|
+
}
|
|
1590
|
+
function parsePgArray(arrayString) {
|
|
1591
|
+
const [result] = parsePgNestedArray(arrayString, 1);
|
|
1592
|
+
return result;
|
|
1593
|
+
}
|
|
1594
|
+
function makePgArray(array) {
|
|
1595
|
+
return `{${array.map((item) => {
|
|
1596
|
+
if (Array.isArray(item)) return makePgArray(item);
|
|
1597
|
+
if (typeof item === "string") return `"${item.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
|
|
1598
|
+
return `${item}`;
|
|
1599
|
+
}).join(",")}}`;
|
|
1600
|
+
}
|
|
1601
|
+
//#endregion
|
|
1602
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
1603
|
+
var PgColumnBuilder = class extends ColumnBuilder {
|
|
1604
|
+
foreignKeyConfigs = [];
|
|
1605
|
+
static [entityKind] = "PgColumnBuilder";
|
|
1606
|
+
array(size) {
|
|
1607
|
+
return new PgArrayBuilder(this.config.name, this, size);
|
|
1608
|
+
}
|
|
1609
|
+
references(ref, actions = {}) {
|
|
1610
|
+
this.foreignKeyConfigs.push({
|
|
1611
|
+
ref,
|
|
1612
|
+
actions
|
|
1613
|
+
});
|
|
1614
|
+
return this;
|
|
1615
|
+
}
|
|
1616
|
+
unique(name, config) {
|
|
1617
|
+
this.config.isUnique = true;
|
|
1618
|
+
this.config.uniqueName = name;
|
|
1619
|
+
this.config.uniqueType = config?.nulls;
|
|
1620
|
+
return this;
|
|
1621
|
+
}
|
|
1622
|
+
generatedAlwaysAs(as) {
|
|
1623
|
+
this.config.generated = {
|
|
1624
|
+
as,
|
|
1625
|
+
type: "always",
|
|
1626
|
+
mode: "stored"
|
|
1627
|
+
};
|
|
1628
|
+
return this;
|
|
1629
|
+
}
|
|
1630
|
+
/** @internal */
|
|
1631
|
+
buildForeignKeys(column, table) {
|
|
1632
|
+
return this.foreignKeyConfigs.map(({ ref, actions }) => {
|
|
1633
|
+
return iife((ref2, actions2) => {
|
|
1634
|
+
const builder = new ForeignKeyBuilder$1(() => {
|
|
1635
|
+
const foreignColumn = ref2();
|
|
1636
|
+
return {
|
|
1637
|
+
columns: [column],
|
|
1638
|
+
foreignColumns: [foreignColumn]
|
|
1639
|
+
};
|
|
1640
|
+
});
|
|
1641
|
+
if (actions2.onUpdate) builder.onUpdate(actions2.onUpdate);
|
|
1642
|
+
if (actions2.onDelete) builder.onDelete(actions2.onDelete);
|
|
1643
|
+
return builder.build(table);
|
|
1644
|
+
}, ref, actions);
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
/** @internal */
|
|
1648
|
+
buildExtraConfigColumn(table) {
|
|
1649
|
+
return new ExtraConfigColumn(table, this.config);
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
var PgColumn = class extends Column {
|
|
1653
|
+
constructor(table, config) {
|
|
1654
|
+
if (!config.uniqueName) config.uniqueName = uniqueKeyName$1(table, [config.name]);
|
|
1655
|
+
super(table, config);
|
|
1656
|
+
this.table = table;
|
|
1657
|
+
}
|
|
1658
|
+
static [entityKind] = "PgColumn";
|
|
1659
|
+
};
|
|
1660
|
+
var ExtraConfigColumn = class extends PgColumn {
|
|
1661
|
+
static [entityKind] = "ExtraConfigColumn";
|
|
1662
|
+
getSQLType() {
|
|
1663
|
+
return this.getSQLType();
|
|
1664
|
+
}
|
|
1665
|
+
indexConfig = {
|
|
1666
|
+
order: this.config.order ?? "asc",
|
|
1667
|
+
nulls: this.config.nulls ?? "last",
|
|
1668
|
+
opClass: this.config.opClass
|
|
1669
|
+
};
|
|
1670
|
+
defaultConfig = {
|
|
1671
|
+
order: "asc",
|
|
1672
|
+
nulls: "last",
|
|
1673
|
+
opClass: void 0
|
|
1674
|
+
};
|
|
1675
|
+
asc() {
|
|
1676
|
+
this.indexConfig.order = "asc";
|
|
1677
|
+
return this;
|
|
1678
|
+
}
|
|
1679
|
+
desc() {
|
|
1680
|
+
this.indexConfig.order = "desc";
|
|
1681
|
+
return this;
|
|
1682
|
+
}
|
|
1683
|
+
nullsFirst() {
|
|
1684
|
+
this.indexConfig.nulls = "first";
|
|
1685
|
+
return this;
|
|
1686
|
+
}
|
|
1687
|
+
nullsLast() {
|
|
1688
|
+
this.indexConfig.nulls = "last";
|
|
1689
|
+
return this;
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* ### PostgreSQL documentation quote
|
|
1693
|
+
*
|
|
1694
|
+
* > An operator class with optional parameters can be specified for each column of an index.
|
|
1695
|
+
* The operator class identifies the operators to be used by the index for that column.
|
|
1696
|
+
* For example, a B-tree index on four-byte integers would use the int4_ops class;
|
|
1697
|
+
* this operator class includes comparison functions for four-byte integers.
|
|
1698
|
+
* In practice the default operator class for the column's data type is usually sufficient.
|
|
1699
|
+
* The main point of having operator classes is that for some data types, there could be more than one meaningful ordering.
|
|
1700
|
+
* For example, we might want to sort a complex-number data type either by absolute value or by real part.
|
|
1701
|
+
* We could do this by defining two operator classes for the data type and then selecting the proper class when creating an index.
|
|
1702
|
+
* More information about operator classes check:
|
|
1703
|
+
*
|
|
1704
|
+
* ### Useful links
|
|
1705
|
+
* https://www.postgresql.org/docs/current/sql-createindex.html
|
|
1706
|
+
*
|
|
1707
|
+
* https://www.postgresql.org/docs/current/indexes-opclass.html
|
|
1708
|
+
*
|
|
1709
|
+
* https://www.postgresql.org/docs/current/xindex.html
|
|
1710
|
+
*
|
|
1711
|
+
* ### Additional types
|
|
1712
|
+
* If you have the `pg_vector` extension installed in your database, you can use the
|
|
1713
|
+
* `vector_l2_ops`, `vector_ip_ops`, `vector_cosine_ops`, `vector_l1_ops`, `bit_hamming_ops`, `bit_jaccard_ops`, `halfvec_l2_ops`, `sparsevec_l2_ops` options, which are predefined types.
|
|
1714
|
+
*
|
|
1715
|
+
* **You can always specify any string you want in the operator class, in case Drizzle doesn't have it natively in its types**
|
|
1716
|
+
*
|
|
1717
|
+
* @param opClass
|
|
1718
|
+
* @returns
|
|
1719
|
+
*/
|
|
1720
|
+
op(opClass) {
|
|
1721
|
+
this.indexConfig.opClass = opClass;
|
|
1722
|
+
return this;
|
|
1723
|
+
}
|
|
1724
|
+
};
|
|
1725
|
+
var IndexedColumn = class {
|
|
1726
|
+
static [entityKind] = "IndexedColumn";
|
|
1727
|
+
constructor(name, keyAsName, type, indexConfig) {
|
|
1728
|
+
this.name = name;
|
|
1729
|
+
this.keyAsName = keyAsName;
|
|
1730
|
+
this.type = type;
|
|
1731
|
+
this.indexConfig = indexConfig;
|
|
1732
|
+
}
|
|
1733
|
+
name;
|
|
1734
|
+
keyAsName;
|
|
1735
|
+
type;
|
|
1736
|
+
indexConfig;
|
|
1737
|
+
};
|
|
1738
|
+
var PgArrayBuilder = class extends PgColumnBuilder {
|
|
1739
|
+
static [entityKind] = "PgArrayBuilder";
|
|
1740
|
+
constructor(name, baseBuilder, size) {
|
|
1741
|
+
super(name, "array", "PgArray");
|
|
1742
|
+
this.config.baseBuilder = baseBuilder;
|
|
1743
|
+
this.config.size = size;
|
|
1744
|
+
}
|
|
1745
|
+
/** @internal */
|
|
1746
|
+
build(table) {
|
|
1747
|
+
const baseColumn = this.config.baseBuilder.build(table);
|
|
1748
|
+
return new PgArray(table, this.config, baseColumn);
|
|
1749
|
+
}
|
|
1750
|
+
};
|
|
1751
|
+
var PgArray = class PgArray extends PgColumn {
|
|
1752
|
+
constructor(table, config, baseColumn, range) {
|
|
1753
|
+
super(table, config);
|
|
1754
|
+
this.baseColumn = baseColumn;
|
|
1755
|
+
this.range = range;
|
|
1756
|
+
this.size = config.size;
|
|
1757
|
+
}
|
|
1758
|
+
size;
|
|
1759
|
+
static [entityKind] = "PgArray";
|
|
1760
|
+
getSQLType() {
|
|
1761
|
+
return `${this.baseColumn.getSQLType()}[${typeof this.size === "number" ? this.size : ""}]`;
|
|
1762
|
+
}
|
|
1763
|
+
mapFromDriverValue(value) {
|
|
1764
|
+
if (typeof value === "string") value = parsePgArray(value);
|
|
1765
|
+
return value.map((v) => this.baseColumn.mapFromDriverValue(v));
|
|
1766
|
+
}
|
|
1767
|
+
mapToDriverValue(value, isNestedArray = false) {
|
|
1768
|
+
const a = value.map((v) => v === null ? null : is(this.baseColumn, PgArray) ? this.baseColumn.mapToDriverValue(v, true) : this.baseColumn.mapToDriverValue(v));
|
|
1769
|
+
if (isNestedArray) return a;
|
|
1770
|
+
return makePgArray(a);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
//#endregion
|
|
1774
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
1775
|
+
const isPgEnumSym = Symbol.for("drizzle:isPgEnum");
|
|
1776
|
+
function isPgEnum(obj) {
|
|
1777
|
+
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
|
1778
|
+
}
|
|
1779
|
+
//#endregion
|
|
1780
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/subquery.js
|
|
1781
|
+
var Subquery = class {
|
|
1782
|
+
static [entityKind] = "Subquery";
|
|
1783
|
+
constructor(sql, fields, alias, isWith = false, usedTables = []) {
|
|
1784
|
+
this._ = {
|
|
1785
|
+
brand: "Subquery",
|
|
1786
|
+
sql,
|
|
1787
|
+
selectedFields: fields,
|
|
1788
|
+
alias,
|
|
1789
|
+
isWith,
|
|
1790
|
+
usedTables
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
};
|
|
1794
|
+
//#endregion
|
|
1795
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/tracing.js
|
|
1796
|
+
const tracer = { startActiveSpan(name, fn) {
|
|
1797
|
+
return fn();
|
|
1798
|
+
} };
|
|
1799
|
+
//#endregion
|
|
1800
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/view-common.js
|
|
1801
|
+
const ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/table.js
|
|
1804
|
+
const Schema = Symbol.for("drizzle:Schema");
|
|
1805
|
+
const Columns = Symbol.for("drizzle:Columns");
|
|
1806
|
+
const ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
|
1807
|
+
const OriginalName = Symbol.for("drizzle:OriginalName");
|
|
1808
|
+
const BaseName = Symbol.for("drizzle:BaseName");
|
|
1809
|
+
const IsAlias = Symbol.for("drizzle:IsAlias");
|
|
1810
|
+
const ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
|
1811
|
+
const IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
|
1812
|
+
var Table = class {
|
|
1813
|
+
static [entityKind] = "Table";
|
|
1814
|
+
/** @internal */
|
|
1815
|
+
static Symbol = {
|
|
1816
|
+
Name: TableName,
|
|
1817
|
+
Schema,
|
|
1818
|
+
OriginalName,
|
|
1819
|
+
Columns,
|
|
1820
|
+
ExtraConfigColumns,
|
|
1821
|
+
BaseName,
|
|
1822
|
+
IsAlias,
|
|
1823
|
+
ExtraConfigBuilder
|
|
1824
|
+
};
|
|
1825
|
+
/**
|
|
1826
|
+
* @internal
|
|
1827
|
+
* Can be changed if the table is aliased.
|
|
1828
|
+
*/
|
|
1829
|
+
[TableName];
|
|
1830
|
+
/**
|
|
1831
|
+
* @internal
|
|
1832
|
+
* Used to store the original name of the table, before any aliasing.
|
|
1833
|
+
*/
|
|
1834
|
+
[OriginalName];
|
|
1835
|
+
/** @internal */
|
|
1836
|
+
[Schema];
|
|
1837
|
+
/** @internal */
|
|
1838
|
+
[Columns];
|
|
1839
|
+
/** @internal */
|
|
1840
|
+
[ExtraConfigColumns];
|
|
1841
|
+
/**
|
|
1842
|
+
* @internal
|
|
1843
|
+
* Used to store the table name before the transformation via the `tableCreator` functions.
|
|
1844
|
+
*/
|
|
1845
|
+
[BaseName];
|
|
1846
|
+
/** @internal */
|
|
1847
|
+
[IsAlias] = false;
|
|
1848
|
+
/** @internal */
|
|
1849
|
+
[IsDrizzleTable] = true;
|
|
1850
|
+
/** @internal */
|
|
1851
|
+
[ExtraConfigBuilder] = void 0;
|
|
1852
|
+
constructor(name, schema, baseName) {
|
|
1853
|
+
this[TableName] = this[OriginalName] = name;
|
|
1854
|
+
this[Schema] = schema;
|
|
1855
|
+
this[BaseName] = baseName;
|
|
1856
|
+
}
|
|
1857
|
+
};
|
|
1858
|
+
//#endregion
|
|
1859
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sql/sql.js
|
|
1860
|
+
function isSQLWrapper(value) {
|
|
1861
|
+
return value !== null && value !== void 0 && typeof value.getSQL === "function";
|
|
1862
|
+
}
|
|
1863
|
+
function mergeQueries(queries) {
|
|
1864
|
+
const result = {
|
|
1865
|
+
sql: "",
|
|
1866
|
+
params: []
|
|
1867
|
+
};
|
|
1868
|
+
for (const query of queries) {
|
|
1869
|
+
result.sql += query.sql;
|
|
1870
|
+
result.params.push(...query.params);
|
|
1871
|
+
if (query.typings?.length) {
|
|
1872
|
+
if (!result.typings) result.typings = [];
|
|
1873
|
+
result.typings.push(...query.typings);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
return result;
|
|
1877
|
+
}
|
|
1878
|
+
var StringChunk = class {
|
|
1879
|
+
static [entityKind] = "StringChunk";
|
|
1880
|
+
value;
|
|
1881
|
+
constructor(value) {
|
|
1882
|
+
this.value = Array.isArray(value) ? value : [value];
|
|
1883
|
+
}
|
|
1884
|
+
getSQL() {
|
|
1885
|
+
return new SQL([this]);
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
var SQL = class SQL {
|
|
1889
|
+
constructor(queryChunks) {
|
|
1890
|
+
this.queryChunks = queryChunks;
|
|
1891
|
+
for (const chunk of queryChunks) if (is(chunk, Table)) {
|
|
1892
|
+
const schemaName = chunk[Table.Symbol.Schema];
|
|
1893
|
+
this.usedTables.push(schemaName === void 0 ? chunk[Table.Symbol.Name] : schemaName + "." + chunk[Table.Symbol.Name]);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
static [entityKind] = "SQL";
|
|
1897
|
+
/** @internal */
|
|
1898
|
+
decoder = noopDecoder;
|
|
1899
|
+
shouldInlineParams = false;
|
|
1900
|
+
/** @internal */
|
|
1901
|
+
usedTables = [];
|
|
1902
|
+
append(query) {
|
|
1903
|
+
this.queryChunks.push(...query.queryChunks);
|
|
1904
|
+
return this;
|
|
1905
|
+
}
|
|
1906
|
+
toQuery(config) {
|
|
1907
|
+
return tracer.startActiveSpan("drizzle.buildSQL", (span) => {
|
|
1908
|
+
const query = this.buildQueryFromSourceParams(this.queryChunks, config);
|
|
1909
|
+
span?.setAttributes({
|
|
1910
|
+
"drizzle.query.text": query.sql,
|
|
1911
|
+
"drizzle.query.params": JSON.stringify(query.params)
|
|
1912
|
+
});
|
|
1913
|
+
return query;
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
buildQueryFromSourceParams(chunks, _config) {
|
|
1917
|
+
const config = Object.assign({}, _config, {
|
|
1918
|
+
inlineParams: _config.inlineParams || this.shouldInlineParams,
|
|
1919
|
+
paramStartIndex: _config.paramStartIndex || { value: 0 }
|
|
1920
|
+
});
|
|
1921
|
+
const { casing, escapeName, escapeParam, prepareTyping, inlineParams, paramStartIndex } = config;
|
|
1922
|
+
return mergeQueries(chunks.map((chunk) => {
|
|
1923
|
+
if (is(chunk, StringChunk)) return {
|
|
1924
|
+
sql: chunk.value.join(""),
|
|
1925
|
+
params: []
|
|
1926
|
+
};
|
|
1927
|
+
if (is(chunk, Name)) return {
|
|
1928
|
+
sql: escapeName(chunk.value),
|
|
1929
|
+
params: []
|
|
1930
|
+
};
|
|
1931
|
+
if (chunk === void 0) return {
|
|
1932
|
+
sql: "",
|
|
1933
|
+
params: []
|
|
1934
|
+
};
|
|
1935
|
+
if (Array.isArray(chunk)) {
|
|
1936
|
+
const result = [new StringChunk("(")];
|
|
1937
|
+
for (const [i, p] of chunk.entries()) {
|
|
1938
|
+
result.push(p);
|
|
1939
|
+
if (i < chunk.length - 1) result.push(new StringChunk(", "));
|
|
1940
|
+
}
|
|
1941
|
+
result.push(new StringChunk(")"));
|
|
1942
|
+
return this.buildQueryFromSourceParams(result, config);
|
|
1943
|
+
}
|
|
1944
|
+
if (is(chunk, SQL)) return this.buildQueryFromSourceParams(chunk.queryChunks, {
|
|
1945
|
+
...config,
|
|
1946
|
+
inlineParams: inlineParams || chunk.shouldInlineParams
|
|
1947
|
+
});
|
|
1948
|
+
if (is(chunk, Table)) {
|
|
1949
|
+
const schemaName = chunk[Table.Symbol.Schema];
|
|
1950
|
+
const tableName = chunk[Table.Symbol.Name];
|
|
1951
|
+
return {
|
|
1952
|
+
sql: schemaName === void 0 || chunk[IsAlias] ? escapeName(tableName) : escapeName(schemaName) + "." + escapeName(tableName),
|
|
1953
|
+
params: []
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
if (is(chunk, Column)) {
|
|
1957
|
+
const columnName = casing.getColumnCasing(chunk);
|
|
1958
|
+
if (_config.invokeSource === "indexes") return {
|
|
1959
|
+
sql: escapeName(columnName),
|
|
1960
|
+
params: []
|
|
1961
|
+
};
|
|
1962
|
+
const schemaName = chunk.table[Table.Symbol.Schema];
|
|
1963
|
+
return {
|
|
1964
|
+
sql: chunk.table[IsAlias] || schemaName === void 0 ? escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName) : escapeName(schemaName) + "." + escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName),
|
|
1965
|
+
params: []
|
|
1966
|
+
};
|
|
1967
|
+
}
|
|
1968
|
+
if (is(chunk, View)) {
|
|
1969
|
+
const schemaName = chunk[ViewBaseConfig].schema;
|
|
1970
|
+
const viewName = chunk[ViewBaseConfig].name;
|
|
1971
|
+
return {
|
|
1972
|
+
sql: schemaName === void 0 || chunk[ViewBaseConfig].isAlias ? escapeName(viewName) : escapeName(schemaName) + "." + escapeName(viewName),
|
|
1973
|
+
params: []
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
if (is(chunk, Param)) {
|
|
1977
|
+
if (is(chunk.value, Placeholder)) return {
|
|
1978
|
+
sql: escapeParam(paramStartIndex.value++, chunk),
|
|
1979
|
+
params: [chunk],
|
|
1980
|
+
typings: ["none"]
|
|
1981
|
+
};
|
|
1982
|
+
const mappedValue = chunk.value === null ? null : chunk.encoder.mapToDriverValue(chunk.value);
|
|
1983
|
+
if (is(mappedValue, SQL)) return this.buildQueryFromSourceParams([mappedValue], config);
|
|
1984
|
+
if (inlineParams) return {
|
|
1985
|
+
sql: this.mapInlineParam(mappedValue, config),
|
|
1986
|
+
params: []
|
|
1987
|
+
};
|
|
1988
|
+
let typings = ["none"];
|
|
1989
|
+
if (prepareTyping) typings = [prepareTyping(chunk.encoder)];
|
|
1990
|
+
return {
|
|
1991
|
+
sql: escapeParam(paramStartIndex.value++, mappedValue),
|
|
1992
|
+
params: [mappedValue],
|
|
1993
|
+
typings
|
|
1994
|
+
};
|
|
1995
|
+
}
|
|
1996
|
+
if (is(chunk, Placeholder)) return {
|
|
1997
|
+
sql: escapeParam(paramStartIndex.value++, chunk),
|
|
1998
|
+
params: [chunk],
|
|
1999
|
+
typings: ["none"]
|
|
2000
|
+
};
|
|
2001
|
+
if (is(chunk, SQL.Aliased) && chunk.fieldAlias !== void 0) return {
|
|
2002
|
+
sql: escapeName(chunk.fieldAlias),
|
|
2003
|
+
params: []
|
|
2004
|
+
};
|
|
2005
|
+
if (is(chunk, Subquery)) {
|
|
2006
|
+
if (chunk._.isWith) return {
|
|
2007
|
+
sql: escapeName(chunk._.alias),
|
|
2008
|
+
params: []
|
|
2009
|
+
};
|
|
2010
|
+
return this.buildQueryFromSourceParams([
|
|
2011
|
+
new StringChunk("("),
|
|
2012
|
+
chunk._.sql,
|
|
2013
|
+
new StringChunk(") "),
|
|
2014
|
+
new Name(chunk._.alias)
|
|
2015
|
+
], config);
|
|
2016
|
+
}
|
|
2017
|
+
if (isPgEnum(chunk)) {
|
|
2018
|
+
if (chunk.schema) return {
|
|
2019
|
+
sql: escapeName(chunk.schema) + "." + escapeName(chunk.enumName),
|
|
2020
|
+
params: []
|
|
2021
|
+
};
|
|
2022
|
+
return {
|
|
2023
|
+
sql: escapeName(chunk.enumName),
|
|
2024
|
+
params: []
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
if (isSQLWrapper(chunk)) {
|
|
2028
|
+
if (chunk.shouldOmitSQLParens?.()) return this.buildQueryFromSourceParams([chunk.getSQL()], config);
|
|
2029
|
+
return this.buildQueryFromSourceParams([
|
|
2030
|
+
new StringChunk("("),
|
|
2031
|
+
chunk.getSQL(),
|
|
2032
|
+
new StringChunk(")")
|
|
2033
|
+
], config);
|
|
2034
|
+
}
|
|
2035
|
+
if (inlineParams) return {
|
|
2036
|
+
sql: this.mapInlineParam(chunk, config),
|
|
2037
|
+
params: []
|
|
2038
|
+
};
|
|
2039
|
+
return {
|
|
2040
|
+
sql: escapeParam(paramStartIndex.value++, chunk),
|
|
2041
|
+
params: [chunk],
|
|
2042
|
+
typings: ["none"]
|
|
2043
|
+
};
|
|
2044
|
+
}));
|
|
2045
|
+
}
|
|
2046
|
+
mapInlineParam(chunk, { escapeString }) {
|
|
2047
|
+
if (chunk === null) return "null";
|
|
2048
|
+
if (typeof chunk === "number" || typeof chunk === "boolean") return chunk.toString();
|
|
2049
|
+
if (typeof chunk === "string") return escapeString(chunk);
|
|
2050
|
+
if (typeof chunk === "object") {
|
|
2051
|
+
const mappedValueAsString = chunk.toString();
|
|
2052
|
+
if (mappedValueAsString === "[object Object]") return escapeString(JSON.stringify(chunk));
|
|
2053
|
+
return escapeString(mappedValueAsString);
|
|
2054
|
+
}
|
|
2055
|
+
throw new Error("Unexpected param value: " + chunk);
|
|
2056
|
+
}
|
|
2057
|
+
getSQL() {
|
|
2058
|
+
return this;
|
|
2059
|
+
}
|
|
2060
|
+
as(alias) {
|
|
2061
|
+
if (alias === void 0) return this;
|
|
2062
|
+
return new SQL.Aliased(this, alias);
|
|
2063
|
+
}
|
|
2064
|
+
mapWith(decoder) {
|
|
2065
|
+
this.decoder = typeof decoder === "function" ? { mapFromDriverValue: decoder } : decoder;
|
|
2066
|
+
return this;
|
|
2067
|
+
}
|
|
2068
|
+
inlineParams() {
|
|
2069
|
+
this.shouldInlineParams = true;
|
|
2070
|
+
return this;
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* This method is used to conditionally include a part of the query.
|
|
2074
|
+
*
|
|
2075
|
+
* @param condition - Condition to check
|
|
2076
|
+
* @returns itself if the condition is `true`, otherwise `undefined`
|
|
2077
|
+
*/
|
|
2078
|
+
if(condition) {
|
|
2079
|
+
return condition ? this : void 0;
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
var Name = class {
|
|
2083
|
+
constructor(value) {
|
|
2084
|
+
this.value = value;
|
|
2085
|
+
}
|
|
2086
|
+
static [entityKind] = "Name";
|
|
2087
|
+
brand;
|
|
2088
|
+
getSQL() {
|
|
2089
|
+
return new SQL([this]);
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
2092
|
+
const noopDecoder = { mapFromDriverValue: (value) => value };
|
|
2093
|
+
const noopEncoder = { mapToDriverValue: (value) => value };
|
|
2094
|
+
({
|
|
2095
|
+
...noopDecoder,
|
|
2096
|
+
...noopEncoder
|
|
2097
|
+
});
|
|
2098
|
+
var Param = class {
|
|
2099
|
+
/**
|
|
2100
|
+
* @param value - Parameter value
|
|
2101
|
+
* @param encoder - Encoder to convert the value to a driver parameter
|
|
2102
|
+
*/
|
|
2103
|
+
constructor(value, encoder = noopEncoder) {
|
|
2104
|
+
this.value = value;
|
|
2105
|
+
this.encoder = encoder;
|
|
2106
|
+
}
|
|
2107
|
+
static [entityKind] = "Param";
|
|
2108
|
+
brand;
|
|
2109
|
+
getSQL() {
|
|
2110
|
+
return new SQL([this]);
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
function sql(strings, ...params) {
|
|
2114
|
+
const queryChunks = [];
|
|
2115
|
+
if (params.length > 0 || strings.length > 0 && strings[0] !== "") queryChunks.push(new StringChunk(strings[0]));
|
|
2116
|
+
for (const [paramIndex, param2] of params.entries()) queryChunks.push(param2, new StringChunk(strings[paramIndex + 1]));
|
|
2117
|
+
return new SQL(queryChunks);
|
|
2118
|
+
}
|
|
2119
|
+
((sql2) => {
|
|
2120
|
+
function empty() {
|
|
2121
|
+
return new SQL([]);
|
|
2122
|
+
}
|
|
2123
|
+
sql2.empty = empty;
|
|
2124
|
+
function fromList(list) {
|
|
2125
|
+
return new SQL(list);
|
|
2126
|
+
}
|
|
2127
|
+
sql2.fromList = fromList;
|
|
2128
|
+
function raw(str) {
|
|
2129
|
+
return new SQL([new StringChunk(str)]);
|
|
2130
|
+
}
|
|
2131
|
+
sql2.raw = raw;
|
|
2132
|
+
function join(chunks, separator) {
|
|
2133
|
+
const result = [];
|
|
2134
|
+
for (const [i, chunk] of chunks.entries()) {
|
|
2135
|
+
if (i > 0 && separator !== void 0) result.push(separator);
|
|
2136
|
+
result.push(chunk);
|
|
2137
|
+
}
|
|
2138
|
+
return new SQL(result);
|
|
2139
|
+
}
|
|
2140
|
+
sql2.join = join;
|
|
2141
|
+
function identifier(value) {
|
|
2142
|
+
return new Name(value);
|
|
2143
|
+
}
|
|
2144
|
+
sql2.identifier = identifier;
|
|
2145
|
+
function placeholder2(name2) {
|
|
2146
|
+
return new Placeholder(name2);
|
|
2147
|
+
}
|
|
2148
|
+
sql2.placeholder = placeholder2;
|
|
2149
|
+
function param2(value, encoder) {
|
|
2150
|
+
return new Param(value, encoder);
|
|
2151
|
+
}
|
|
2152
|
+
sql2.param = param2;
|
|
2153
|
+
})(sql || (sql = {}));
|
|
2154
|
+
((SQL2) => {
|
|
2155
|
+
class Aliased {
|
|
2156
|
+
constructor(sql2, fieldAlias) {
|
|
2157
|
+
this.sql = sql2;
|
|
2158
|
+
this.fieldAlias = fieldAlias;
|
|
2159
|
+
}
|
|
2160
|
+
static [entityKind] = "SQL.Aliased";
|
|
2161
|
+
/** @internal */
|
|
2162
|
+
isSelectionField = false;
|
|
2163
|
+
getSQL() {
|
|
2164
|
+
return this.sql;
|
|
2165
|
+
}
|
|
2166
|
+
/** @internal */
|
|
2167
|
+
clone() {
|
|
2168
|
+
return new Aliased(this.sql, this.fieldAlias);
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
SQL2.Aliased = Aliased;
|
|
2172
|
+
})(SQL || (SQL = {}));
|
|
2173
|
+
var Placeholder = class {
|
|
2174
|
+
constructor(name2) {
|
|
2175
|
+
this.name = name2;
|
|
2176
|
+
}
|
|
2177
|
+
static [entityKind] = "Placeholder";
|
|
2178
|
+
getSQL() {
|
|
2179
|
+
return new SQL([this]);
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
const IsDrizzleView = Symbol.for("drizzle:IsDrizzleView");
|
|
2183
|
+
var View = class {
|
|
2184
|
+
static [entityKind] = "View";
|
|
2185
|
+
/** @internal */
|
|
2186
|
+
[ViewBaseConfig];
|
|
2187
|
+
/** @internal */
|
|
2188
|
+
[IsDrizzleView] = true;
|
|
2189
|
+
constructor({ name: name2, schema, selectedFields, query }) {
|
|
2190
|
+
this[ViewBaseConfig] = {
|
|
2191
|
+
name: name2,
|
|
2192
|
+
originalName: name2,
|
|
2193
|
+
schema,
|
|
2194
|
+
selectedFields,
|
|
2195
|
+
query,
|
|
2196
|
+
isExisting: !query,
|
|
2197
|
+
isAlias: false
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
getSQL() {
|
|
2201
|
+
return new SQL([this]);
|
|
2202
|
+
}
|
|
2203
|
+
};
|
|
2204
|
+
Column.prototype.getSQL = function() {
|
|
2205
|
+
return new SQL([this]);
|
|
2206
|
+
};
|
|
2207
|
+
Table.prototype.getSQL = function() {
|
|
2208
|
+
return new SQL([this]);
|
|
2209
|
+
};
|
|
2210
|
+
Subquery.prototype.getSQL = function() {
|
|
2211
|
+
return new SQL([this]);
|
|
2212
|
+
};
|
|
2213
|
+
//#endregion
|
|
2214
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/utils.js
|
|
2215
|
+
function getColumnNameAndConfig(a, b) {
|
|
2216
|
+
return {
|
|
2217
|
+
name: typeof a === "string" && a.length > 0 ? a : "",
|
|
2218
|
+
config: typeof a === "object" ? a : b
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
|
|
2222
|
+
//#endregion
|
|
2223
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/int.common.js
|
|
2224
|
+
var PgIntColumnBaseBuilder = class extends PgColumnBuilder {
|
|
2225
|
+
static [entityKind] = "PgIntColumnBaseBuilder";
|
|
2226
|
+
generatedAlwaysAsIdentity(sequence) {
|
|
2227
|
+
if (sequence) {
|
|
2228
|
+
const { name, ...options } = sequence;
|
|
2229
|
+
this.config.generatedIdentity = {
|
|
2230
|
+
type: "always",
|
|
2231
|
+
sequenceName: name,
|
|
2232
|
+
sequenceOptions: options
|
|
2233
|
+
};
|
|
2234
|
+
} else this.config.generatedIdentity = { type: "always" };
|
|
2235
|
+
this.config.hasDefault = true;
|
|
2236
|
+
this.config.notNull = true;
|
|
2237
|
+
return this;
|
|
2238
|
+
}
|
|
2239
|
+
generatedByDefaultAsIdentity(sequence) {
|
|
2240
|
+
if (sequence) {
|
|
2241
|
+
const { name, ...options } = sequence;
|
|
2242
|
+
this.config.generatedIdentity = {
|
|
2243
|
+
type: "byDefault",
|
|
2244
|
+
sequenceName: name,
|
|
2245
|
+
sequenceOptions: options
|
|
2246
|
+
};
|
|
2247
|
+
} else this.config.generatedIdentity = { type: "byDefault" };
|
|
2248
|
+
this.config.hasDefault = true;
|
|
2249
|
+
this.config.notNull = true;
|
|
2250
|
+
return this;
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
//#endregion
|
|
2254
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/bigint.js
|
|
2255
|
+
var PgBigInt53Builder = class extends PgIntColumnBaseBuilder {
|
|
2256
|
+
static [entityKind] = "PgBigInt53Builder";
|
|
2257
|
+
constructor(name) {
|
|
2258
|
+
super(name, "number", "PgBigInt53");
|
|
2259
|
+
}
|
|
2260
|
+
/** @internal */
|
|
2261
|
+
build(table) {
|
|
2262
|
+
return new PgBigInt53(table, this.config);
|
|
2263
|
+
}
|
|
2264
|
+
};
|
|
2265
|
+
var PgBigInt53 = class extends PgColumn {
|
|
2266
|
+
static [entityKind] = "PgBigInt53";
|
|
2267
|
+
getSQLType() {
|
|
2268
|
+
return "bigint";
|
|
2269
|
+
}
|
|
2270
|
+
mapFromDriverValue(value) {
|
|
2271
|
+
if (typeof value === "number") return value;
|
|
2272
|
+
return Number(value);
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
var PgBigInt64Builder = class extends PgIntColumnBaseBuilder {
|
|
2276
|
+
static [entityKind] = "PgBigInt64Builder";
|
|
2277
|
+
constructor(name) {
|
|
2278
|
+
super(name, "bigint", "PgBigInt64");
|
|
2279
|
+
}
|
|
2280
|
+
/** @internal */
|
|
2281
|
+
build(table) {
|
|
2282
|
+
return new PgBigInt64(table, this.config);
|
|
2283
|
+
}
|
|
2284
|
+
};
|
|
2285
|
+
var PgBigInt64 = class extends PgColumn {
|
|
2286
|
+
static [entityKind] = "PgBigInt64";
|
|
2287
|
+
getSQLType() {
|
|
2288
|
+
return "bigint";
|
|
2289
|
+
}
|
|
2290
|
+
mapFromDriverValue(value) {
|
|
2291
|
+
return BigInt(value);
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
function bigint(a, b) {
|
|
2295
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2296
|
+
if (config.mode === "number") return new PgBigInt53Builder(name);
|
|
2297
|
+
return new PgBigInt64Builder(name);
|
|
2298
|
+
}
|
|
2299
|
+
//#endregion
|
|
2300
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/bigserial.js
|
|
2301
|
+
var PgBigSerial53Builder = class extends PgColumnBuilder {
|
|
2302
|
+
static [entityKind] = "PgBigSerial53Builder";
|
|
2303
|
+
constructor(name) {
|
|
2304
|
+
super(name, "number", "PgBigSerial53");
|
|
2305
|
+
this.config.hasDefault = true;
|
|
2306
|
+
this.config.notNull = true;
|
|
2307
|
+
}
|
|
2308
|
+
/** @internal */
|
|
2309
|
+
build(table) {
|
|
2310
|
+
return new PgBigSerial53(table, this.config);
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
var PgBigSerial53 = class extends PgColumn {
|
|
2314
|
+
static [entityKind] = "PgBigSerial53";
|
|
2315
|
+
getSQLType() {
|
|
2316
|
+
return "bigserial";
|
|
2317
|
+
}
|
|
2318
|
+
mapFromDriverValue(value) {
|
|
2319
|
+
if (typeof value === "number") return value;
|
|
2320
|
+
return Number(value);
|
|
2321
|
+
}
|
|
2322
|
+
};
|
|
2323
|
+
var PgBigSerial64Builder = class extends PgColumnBuilder {
|
|
2324
|
+
static [entityKind] = "PgBigSerial64Builder";
|
|
2325
|
+
constructor(name) {
|
|
2326
|
+
super(name, "bigint", "PgBigSerial64");
|
|
2327
|
+
this.config.hasDefault = true;
|
|
2328
|
+
}
|
|
2329
|
+
/** @internal */
|
|
2330
|
+
build(table) {
|
|
2331
|
+
return new PgBigSerial64(table, this.config);
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
var PgBigSerial64 = class extends PgColumn {
|
|
2335
|
+
static [entityKind] = "PgBigSerial64";
|
|
2336
|
+
getSQLType() {
|
|
2337
|
+
return "bigserial";
|
|
2338
|
+
}
|
|
2339
|
+
mapFromDriverValue(value) {
|
|
2340
|
+
return BigInt(value);
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
function bigserial(a, b) {
|
|
2344
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2345
|
+
if (config.mode === "number") return new PgBigSerial53Builder(name);
|
|
2346
|
+
return new PgBigSerial64Builder(name);
|
|
2347
|
+
}
|
|
2348
|
+
//#endregion
|
|
2349
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/boolean.js
|
|
2350
|
+
var PgBooleanBuilder = class extends PgColumnBuilder {
|
|
2351
|
+
static [entityKind] = "PgBooleanBuilder";
|
|
2352
|
+
constructor(name) {
|
|
2353
|
+
super(name, "boolean", "PgBoolean");
|
|
2354
|
+
}
|
|
2355
|
+
/** @internal */
|
|
2356
|
+
build(table) {
|
|
2357
|
+
return new PgBoolean(table, this.config);
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2360
|
+
var PgBoolean = class extends PgColumn {
|
|
2361
|
+
static [entityKind] = "PgBoolean";
|
|
2362
|
+
getSQLType() {
|
|
2363
|
+
return "boolean";
|
|
2364
|
+
}
|
|
2365
|
+
};
|
|
2366
|
+
function boolean(name) {
|
|
2367
|
+
return new PgBooleanBuilder(name ?? "");
|
|
2368
|
+
}
|
|
2369
|
+
//#endregion
|
|
2370
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/char.js
|
|
2371
|
+
var PgCharBuilder = class extends PgColumnBuilder {
|
|
2372
|
+
static [entityKind] = "PgCharBuilder";
|
|
2373
|
+
constructor(name, config) {
|
|
2374
|
+
super(name, "string", "PgChar");
|
|
2375
|
+
this.config.length = config.length;
|
|
2376
|
+
this.config.enumValues = config.enum;
|
|
2377
|
+
}
|
|
2378
|
+
/** @internal */
|
|
2379
|
+
build(table) {
|
|
2380
|
+
return new PgChar(table, this.config);
|
|
2381
|
+
}
|
|
2382
|
+
};
|
|
2383
|
+
var PgChar = class extends PgColumn {
|
|
2384
|
+
static [entityKind] = "PgChar";
|
|
2385
|
+
length = this.config.length;
|
|
2386
|
+
enumValues = this.config.enumValues;
|
|
2387
|
+
getSQLType() {
|
|
2388
|
+
return this.length === void 0 ? `char` : `char(${this.length})`;
|
|
2389
|
+
}
|
|
2390
|
+
};
|
|
2391
|
+
function char(a, b = {}) {
|
|
2392
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2393
|
+
return new PgCharBuilder(name, config);
|
|
2394
|
+
}
|
|
2395
|
+
//#endregion
|
|
2396
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/cidr.js
|
|
2397
|
+
var PgCidrBuilder = class extends PgColumnBuilder {
|
|
2398
|
+
static [entityKind] = "PgCidrBuilder";
|
|
2399
|
+
constructor(name) {
|
|
2400
|
+
super(name, "string", "PgCidr");
|
|
2401
|
+
}
|
|
2402
|
+
/** @internal */
|
|
2403
|
+
build(table) {
|
|
2404
|
+
return new PgCidr(table, this.config);
|
|
2405
|
+
}
|
|
2406
|
+
};
|
|
2407
|
+
var PgCidr = class extends PgColumn {
|
|
2408
|
+
static [entityKind] = "PgCidr";
|
|
2409
|
+
getSQLType() {
|
|
2410
|
+
return "cidr";
|
|
2411
|
+
}
|
|
2412
|
+
};
|
|
2413
|
+
function cidr(name) {
|
|
2414
|
+
return new PgCidrBuilder(name ?? "");
|
|
2415
|
+
}
|
|
2416
|
+
//#endregion
|
|
2417
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/custom.js
|
|
2418
|
+
var PgCustomColumnBuilder = class extends PgColumnBuilder {
|
|
2419
|
+
static [entityKind] = "PgCustomColumnBuilder";
|
|
2420
|
+
constructor(name, fieldConfig, customTypeParams) {
|
|
2421
|
+
super(name, "custom", "PgCustomColumn");
|
|
2422
|
+
this.config.fieldConfig = fieldConfig;
|
|
2423
|
+
this.config.customTypeParams = customTypeParams;
|
|
2424
|
+
}
|
|
2425
|
+
/** @internal */
|
|
2426
|
+
build(table) {
|
|
2427
|
+
return new PgCustomColumn(table, this.config);
|
|
2428
|
+
}
|
|
2429
|
+
};
|
|
2430
|
+
var PgCustomColumn = class extends PgColumn {
|
|
2431
|
+
static [entityKind] = "PgCustomColumn";
|
|
2432
|
+
sqlName;
|
|
2433
|
+
mapTo;
|
|
2434
|
+
mapFrom;
|
|
2435
|
+
constructor(table, config) {
|
|
2436
|
+
super(table, config);
|
|
2437
|
+
this.sqlName = config.customTypeParams.dataType(config.fieldConfig);
|
|
2438
|
+
this.mapTo = config.customTypeParams.toDriver;
|
|
2439
|
+
this.mapFrom = config.customTypeParams.fromDriver;
|
|
2440
|
+
}
|
|
2441
|
+
getSQLType() {
|
|
2442
|
+
return this.sqlName;
|
|
2443
|
+
}
|
|
2444
|
+
mapFromDriverValue(value) {
|
|
2445
|
+
return typeof this.mapFrom === "function" ? this.mapFrom(value) : value;
|
|
2446
|
+
}
|
|
2447
|
+
mapToDriverValue(value) {
|
|
2448
|
+
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
function customType$1(customTypeParams) {
|
|
2452
|
+
return (a, b) => {
|
|
2453
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2454
|
+
return new PgCustomColumnBuilder(name, config, customTypeParams);
|
|
2455
|
+
};
|
|
2456
|
+
}
|
|
2457
|
+
//#endregion
|
|
2458
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/date.common.js
|
|
2459
|
+
var PgDateColumnBaseBuilder = class extends PgColumnBuilder {
|
|
2460
|
+
static [entityKind] = "PgDateColumnBaseBuilder";
|
|
2461
|
+
defaultNow() {
|
|
2462
|
+
return this.default(sql`now()`);
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
//#endregion
|
|
2466
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/date.js
|
|
2467
|
+
var PgDateBuilder = class extends PgDateColumnBaseBuilder {
|
|
2468
|
+
static [entityKind] = "PgDateBuilder";
|
|
2469
|
+
constructor(name) {
|
|
2470
|
+
super(name, "date", "PgDate");
|
|
2471
|
+
}
|
|
2472
|
+
/** @internal */
|
|
2473
|
+
build(table) {
|
|
2474
|
+
return new PgDate(table, this.config);
|
|
2475
|
+
}
|
|
2476
|
+
};
|
|
2477
|
+
var PgDate = class extends PgColumn {
|
|
2478
|
+
static [entityKind] = "PgDate";
|
|
2479
|
+
getSQLType() {
|
|
2480
|
+
return "date";
|
|
2481
|
+
}
|
|
2482
|
+
mapFromDriverValue(value) {
|
|
2483
|
+
if (typeof value === "string") return new Date(value);
|
|
2484
|
+
return value;
|
|
2485
|
+
}
|
|
2486
|
+
mapToDriverValue(value) {
|
|
2487
|
+
return value.toISOString();
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
var PgDateStringBuilder = class extends PgDateColumnBaseBuilder {
|
|
2491
|
+
static [entityKind] = "PgDateStringBuilder";
|
|
2492
|
+
constructor(name) {
|
|
2493
|
+
super(name, "string", "PgDateString");
|
|
2494
|
+
}
|
|
2495
|
+
/** @internal */
|
|
2496
|
+
build(table) {
|
|
2497
|
+
return new PgDateString(table, this.config);
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
var PgDateString = class extends PgColumn {
|
|
2501
|
+
static [entityKind] = "PgDateString";
|
|
2502
|
+
getSQLType() {
|
|
2503
|
+
return "date";
|
|
2504
|
+
}
|
|
2505
|
+
mapFromDriverValue(value) {
|
|
2506
|
+
if (typeof value === "string") return value;
|
|
2507
|
+
return value.toISOString().slice(0, -14);
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
function date(a, b) {
|
|
2511
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2512
|
+
if (config?.mode === "date") return new PgDateBuilder(name);
|
|
2513
|
+
return new PgDateStringBuilder(name);
|
|
2514
|
+
}
|
|
2515
|
+
//#endregion
|
|
2516
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/double-precision.js
|
|
2517
|
+
var PgDoublePrecisionBuilder = class extends PgColumnBuilder {
|
|
2518
|
+
static [entityKind] = "PgDoublePrecisionBuilder";
|
|
2519
|
+
constructor(name) {
|
|
2520
|
+
super(name, "number", "PgDoublePrecision");
|
|
2521
|
+
}
|
|
2522
|
+
/** @internal */
|
|
2523
|
+
build(table) {
|
|
2524
|
+
return new PgDoublePrecision(table, this.config);
|
|
2525
|
+
}
|
|
2526
|
+
};
|
|
2527
|
+
var PgDoublePrecision = class extends PgColumn {
|
|
2528
|
+
static [entityKind] = "PgDoublePrecision";
|
|
2529
|
+
getSQLType() {
|
|
2530
|
+
return "double precision";
|
|
2531
|
+
}
|
|
2532
|
+
mapFromDriverValue(value) {
|
|
2533
|
+
if (typeof value === "string") return Number.parseFloat(value);
|
|
2534
|
+
return value;
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2537
|
+
function doublePrecision(name) {
|
|
2538
|
+
return new PgDoublePrecisionBuilder(name ?? "");
|
|
2539
|
+
}
|
|
2540
|
+
//#endregion
|
|
2541
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/inet.js
|
|
2542
|
+
var PgInetBuilder = class extends PgColumnBuilder {
|
|
2543
|
+
static [entityKind] = "PgInetBuilder";
|
|
2544
|
+
constructor(name) {
|
|
2545
|
+
super(name, "string", "PgInet");
|
|
2546
|
+
}
|
|
2547
|
+
/** @internal */
|
|
2548
|
+
build(table) {
|
|
2549
|
+
return new PgInet(table, this.config);
|
|
2550
|
+
}
|
|
2551
|
+
};
|
|
2552
|
+
var PgInet = class extends PgColumn {
|
|
2553
|
+
static [entityKind] = "PgInet";
|
|
2554
|
+
getSQLType() {
|
|
2555
|
+
return "inet";
|
|
2556
|
+
}
|
|
2557
|
+
};
|
|
2558
|
+
function inet(name) {
|
|
2559
|
+
return new PgInetBuilder(name ?? "");
|
|
2560
|
+
}
|
|
2561
|
+
//#endregion
|
|
2562
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/integer.js
|
|
2563
|
+
var PgIntegerBuilder = class extends PgIntColumnBaseBuilder {
|
|
2564
|
+
static [entityKind] = "PgIntegerBuilder";
|
|
2565
|
+
constructor(name) {
|
|
2566
|
+
super(name, "number", "PgInteger");
|
|
2567
|
+
}
|
|
2568
|
+
/** @internal */
|
|
2569
|
+
build(table) {
|
|
2570
|
+
return new PgInteger(table, this.config);
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2573
|
+
var PgInteger = class extends PgColumn {
|
|
2574
|
+
static [entityKind] = "PgInteger";
|
|
2575
|
+
getSQLType() {
|
|
2576
|
+
return "integer";
|
|
2577
|
+
}
|
|
2578
|
+
mapFromDriverValue(value) {
|
|
2579
|
+
if (typeof value === "string") return Number.parseInt(value);
|
|
2580
|
+
return value;
|
|
2581
|
+
}
|
|
2582
|
+
};
|
|
2583
|
+
function integer$1(name) {
|
|
2584
|
+
return new PgIntegerBuilder(name ?? "");
|
|
2585
|
+
}
|
|
2586
|
+
//#endregion
|
|
2587
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/interval.js
|
|
2588
|
+
var PgIntervalBuilder = class extends PgColumnBuilder {
|
|
2589
|
+
static [entityKind] = "PgIntervalBuilder";
|
|
2590
|
+
constructor(name, intervalConfig) {
|
|
2591
|
+
super(name, "string", "PgInterval");
|
|
2592
|
+
this.config.intervalConfig = intervalConfig;
|
|
2593
|
+
}
|
|
2594
|
+
/** @internal */
|
|
2595
|
+
build(table) {
|
|
2596
|
+
return new PgInterval(table, this.config);
|
|
2597
|
+
}
|
|
2598
|
+
};
|
|
2599
|
+
var PgInterval = class extends PgColumn {
|
|
2600
|
+
static [entityKind] = "PgInterval";
|
|
2601
|
+
fields = this.config.intervalConfig.fields;
|
|
2602
|
+
precision = this.config.intervalConfig.precision;
|
|
2603
|
+
getSQLType() {
|
|
2604
|
+
return `interval${this.fields ? ` ${this.fields}` : ""}${this.precision ? `(${this.precision})` : ""}`;
|
|
2605
|
+
}
|
|
2606
|
+
};
|
|
2607
|
+
function interval(a, b = {}) {
|
|
2608
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2609
|
+
return new PgIntervalBuilder(name, config);
|
|
2610
|
+
}
|
|
2611
|
+
//#endregion
|
|
2612
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/json.js
|
|
2613
|
+
var PgJsonBuilder = class extends PgColumnBuilder {
|
|
2614
|
+
static [entityKind] = "PgJsonBuilder";
|
|
2615
|
+
constructor(name) {
|
|
2616
|
+
super(name, "json", "PgJson");
|
|
2617
|
+
}
|
|
2618
|
+
/** @internal */
|
|
2619
|
+
build(table) {
|
|
2620
|
+
return new PgJson(table, this.config);
|
|
2621
|
+
}
|
|
2622
|
+
};
|
|
2623
|
+
var PgJson = class extends PgColumn {
|
|
2624
|
+
static [entityKind] = "PgJson";
|
|
2625
|
+
constructor(table, config) {
|
|
2626
|
+
super(table, config);
|
|
2627
|
+
}
|
|
2628
|
+
getSQLType() {
|
|
2629
|
+
return "json";
|
|
2630
|
+
}
|
|
2631
|
+
mapToDriverValue(value) {
|
|
2632
|
+
return JSON.stringify(value);
|
|
2633
|
+
}
|
|
2634
|
+
mapFromDriverValue(value) {
|
|
2635
|
+
if (typeof value === "string") try {
|
|
2636
|
+
return JSON.parse(value);
|
|
2637
|
+
} catch {
|
|
2638
|
+
return value;
|
|
2639
|
+
}
|
|
2640
|
+
return value;
|
|
2641
|
+
}
|
|
2642
|
+
};
|
|
2643
|
+
function json(name) {
|
|
2644
|
+
return new PgJsonBuilder(name ?? "");
|
|
2645
|
+
}
|
|
2646
|
+
//#endregion
|
|
2647
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/jsonb.js
|
|
2648
|
+
var PgJsonbBuilder = class extends PgColumnBuilder {
|
|
2649
|
+
static [entityKind] = "PgJsonbBuilder";
|
|
2650
|
+
constructor(name) {
|
|
2651
|
+
super(name, "json", "PgJsonb");
|
|
2652
|
+
}
|
|
2653
|
+
/** @internal */
|
|
2654
|
+
build(table) {
|
|
2655
|
+
return new PgJsonb(table, this.config);
|
|
2656
|
+
}
|
|
2657
|
+
};
|
|
2658
|
+
var PgJsonb = class extends PgColumn {
|
|
2659
|
+
static [entityKind] = "PgJsonb";
|
|
2660
|
+
constructor(table, config) {
|
|
2661
|
+
super(table, config);
|
|
2662
|
+
}
|
|
2663
|
+
getSQLType() {
|
|
2664
|
+
return "jsonb";
|
|
2665
|
+
}
|
|
2666
|
+
mapToDriverValue(value) {
|
|
2667
|
+
return JSON.stringify(value);
|
|
2668
|
+
}
|
|
2669
|
+
mapFromDriverValue(value) {
|
|
2670
|
+
if (typeof value === "string") try {
|
|
2671
|
+
return JSON.parse(value);
|
|
2672
|
+
} catch {
|
|
2673
|
+
return value;
|
|
2674
|
+
}
|
|
2675
|
+
return value;
|
|
2676
|
+
}
|
|
2677
|
+
};
|
|
2678
|
+
function jsonb(name) {
|
|
2679
|
+
return new PgJsonbBuilder(name ?? "");
|
|
2680
|
+
}
|
|
2681
|
+
//#endregion
|
|
2682
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/line.js
|
|
2683
|
+
var PgLineBuilder = class extends PgColumnBuilder {
|
|
2684
|
+
static [entityKind] = "PgLineBuilder";
|
|
2685
|
+
constructor(name) {
|
|
2686
|
+
super(name, "array", "PgLine");
|
|
2687
|
+
}
|
|
2688
|
+
/** @internal */
|
|
2689
|
+
build(table) {
|
|
2690
|
+
return new PgLineTuple(table, this.config);
|
|
2691
|
+
}
|
|
2692
|
+
};
|
|
2693
|
+
var PgLineTuple = class extends PgColumn {
|
|
2694
|
+
static [entityKind] = "PgLine";
|
|
2695
|
+
getSQLType() {
|
|
2696
|
+
return "line";
|
|
2697
|
+
}
|
|
2698
|
+
mapFromDriverValue(value) {
|
|
2699
|
+
const [a, b, c] = value.slice(1, -1).split(",");
|
|
2700
|
+
return [
|
|
2701
|
+
Number.parseFloat(a),
|
|
2702
|
+
Number.parseFloat(b),
|
|
2703
|
+
Number.parseFloat(c)
|
|
2704
|
+
];
|
|
2705
|
+
}
|
|
2706
|
+
mapToDriverValue(value) {
|
|
2707
|
+
return `{${value[0]},${value[1]},${value[2]}}`;
|
|
2708
|
+
}
|
|
2709
|
+
};
|
|
2710
|
+
var PgLineABCBuilder = class extends PgColumnBuilder {
|
|
2711
|
+
static [entityKind] = "PgLineABCBuilder";
|
|
2712
|
+
constructor(name) {
|
|
2713
|
+
super(name, "json", "PgLineABC");
|
|
2714
|
+
}
|
|
2715
|
+
/** @internal */
|
|
2716
|
+
build(table) {
|
|
2717
|
+
return new PgLineABC(table, this.config);
|
|
2718
|
+
}
|
|
2719
|
+
};
|
|
2720
|
+
var PgLineABC = class extends PgColumn {
|
|
2721
|
+
static [entityKind] = "PgLineABC";
|
|
2722
|
+
getSQLType() {
|
|
2723
|
+
return "line";
|
|
2724
|
+
}
|
|
2725
|
+
mapFromDriverValue(value) {
|
|
2726
|
+
const [a, b, c] = value.slice(1, -1).split(",");
|
|
2727
|
+
return {
|
|
2728
|
+
a: Number.parseFloat(a),
|
|
2729
|
+
b: Number.parseFloat(b),
|
|
2730
|
+
c: Number.parseFloat(c)
|
|
2731
|
+
};
|
|
2732
|
+
}
|
|
2733
|
+
mapToDriverValue(value) {
|
|
2734
|
+
return `{${value.a},${value.b},${value.c}}`;
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
function line(a, b) {
|
|
2738
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2739
|
+
if (!config?.mode || config.mode === "tuple") return new PgLineBuilder(name);
|
|
2740
|
+
return new PgLineABCBuilder(name);
|
|
2741
|
+
}
|
|
2742
|
+
//#endregion
|
|
2743
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/macaddr.js
|
|
2744
|
+
var PgMacaddrBuilder = class extends PgColumnBuilder {
|
|
2745
|
+
static [entityKind] = "PgMacaddrBuilder";
|
|
2746
|
+
constructor(name) {
|
|
2747
|
+
super(name, "string", "PgMacaddr");
|
|
2748
|
+
}
|
|
2749
|
+
/** @internal */
|
|
2750
|
+
build(table) {
|
|
2751
|
+
return new PgMacaddr(table, this.config);
|
|
2752
|
+
}
|
|
2753
|
+
};
|
|
2754
|
+
var PgMacaddr = class extends PgColumn {
|
|
2755
|
+
static [entityKind] = "PgMacaddr";
|
|
2756
|
+
getSQLType() {
|
|
2757
|
+
return "macaddr";
|
|
2758
|
+
}
|
|
2759
|
+
};
|
|
2760
|
+
function macaddr(name) {
|
|
2761
|
+
return new PgMacaddrBuilder(name ?? "");
|
|
2762
|
+
}
|
|
2763
|
+
//#endregion
|
|
2764
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
|
|
2765
|
+
var PgMacaddr8Builder = class extends PgColumnBuilder {
|
|
2766
|
+
static [entityKind] = "PgMacaddr8Builder";
|
|
2767
|
+
constructor(name) {
|
|
2768
|
+
super(name, "string", "PgMacaddr8");
|
|
2769
|
+
}
|
|
2770
|
+
/** @internal */
|
|
2771
|
+
build(table) {
|
|
2772
|
+
return new PgMacaddr8(table, this.config);
|
|
2773
|
+
}
|
|
2774
|
+
};
|
|
2775
|
+
var PgMacaddr8 = class extends PgColumn {
|
|
2776
|
+
static [entityKind] = "PgMacaddr8";
|
|
2777
|
+
getSQLType() {
|
|
2778
|
+
return "macaddr8";
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
function macaddr8(name) {
|
|
2782
|
+
return new PgMacaddr8Builder(name ?? "");
|
|
2783
|
+
}
|
|
2784
|
+
//#endregion
|
|
2785
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/numeric.js
|
|
2786
|
+
var PgNumericBuilder = class extends PgColumnBuilder {
|
|
2787
|
+
static [entityKind] = "PgNumericBuilder";
|
|
2788
|
+
constructor(name, precision, scale) {
|
|
2789
|
+
super(name, "string", "PgNumeric");
|
|
2790
|
+
this.config.precision = precision;
|
|
2791
|
+
this.config.scale = scale;
|
|
2792
|
+
}
|
|
2793
|
+
/** @internal */
|
|
2794
|
+
build(table) {
|
|
2795
|
+
return new PgNumeric(table, this.config);
|
|
2796
|
+
}
|
|
2797
|
+
};
|
|
2798
|
+
var PgNumeric = class extends PgColumn {
|
|
2799
|
+
static [entityKind] = "PgNumeric";
|
|
2800
|
+
precision;
|
|
2801
|
+
scale;
|
|
2802
|
+
constructor(table, config) {
|
|
2803
|
+
super(table, config);
|
|
2804
|
+
this.precision = config.precision;
|
|
2805
|
+
this.scale = config.scale;
|
|
2806
|
+
}
|
|
2807
|
+
mapFromDriverValue(value) {
|
|
2808
|
+
if (typeof value === "string") return value;
|
|
2809
|
+
return String(value);
|
|
2810
|
+
}
|
|
2811
|
+
getSQLType() {
|
|
2812
|
+
if (this.precision !== void 0 && this.scale !== void 0) return `numeric(${this.precision}, ${this.scale})`;
|
|
2813
|
+
else if (this.precision === void 0) return "numeric";
|
|
2814
|
+
else return `numeric(${this.precision})`;
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
var PgNumericNumberBuilder = class extends PgColumnBuilder {
|
|
2818
|
+
static [entityKind] = "PgNumericNumberBuilder";
|
|
2819
|
+
constructor(name, precision, scale) {
|
|
2820
|
+
super(name, "number", "PgNumericNumber");
|
|
2821
|
+
this.config.precision = precision;
|
|
2822
|
+
this.config.scale = scale;
|
|
2823
|
+
}
|
|
2824
|
+
/** @internal */
|
|
2825
|
+
build(table) {
|
|
2826
|
+
return new PgNumericNumber(table, this.config);
|
|
2827
|
+
}
|
|
2828
|
+
};
|
|
2829
|
+
var PgNumericNumber = class extends PgColumn {
|
|
2830
|
+
static [entityKind] = "PgNumericNumber";
|
|
2831
|
+
precision;
|
|
2832
|
+
scale;
|
|
2833
|
+
constructor(table, config) {
|
|
2834
|
+
super(table, config);
|
|
2835
|
+
this.precision = config.precision;
|
|
2836
|
+
this.scale = config.scale;
|
|
2837
|
+
}
|
|
2838
|
+
mapFromDriverValue(value) {
|
|
2839
|
+
if (typeof value === "number") return value;
|
|
2840
|
+
return Number(value);
|
|
2841
|
+
}
|
|
2842
|
+
mapToDriverValue = String;
|
|
2843
|
+
getSQLType() {
|
|
2844
|
+
if (this.precision !== void 0 && this.scale !== void 0) return `numeric(${this.precision}, ${this.scale})`;
|
|
2845
|
+
else if (this.precision === void 0) return "numeric";
|
|
2846
|
+
else return `numeric(${this.precision})`;
|
|
2847
|
+
}
|
|
2848
|
+
};
|
|
2849
|
+
var PgNumericBigIntBuilder = class extends PgColumnBuilder {
|
|
2850
|
+
static [entityKind] = "PgNumericBigIntBuilder";
|
|
2851
|
+
constructor(name, precision, scale) {
|
|
2852
|
+
super(name, "bigint", "PgNumericBigInt");
|
|
2853
|
+
this.config.precision = precision;
|
|
2854
|
+
this.config.scale = scale;
|
|
2855
|
+
}
|
|
2856
|
+
/** @internal */
|
|
2857
|
+
build(table) {
|
|
2858
|
+
return new PgNumericBigInt(table, this.config);
|
|
2859
|
+
}
|
|
2860
|
+
};
|
|
2861
|
+
var PgNumericBigInt = class extends PgColumn {
|
|
2862
|
+
static [entityKind] = "PgNumericBigInt";
|
|
2863
|
+
precision;
|
|
2864
|
+
scale;
|
|
2865
|
+
constructor(table, config) {
|
|
2866
|
+
super(table, config);
|
|
2867
|
+
this.precision = config.precision;
|
|
2868
|
+
this.scale = config.scale;
|
|
2869
|
+
}
|
|
2870
|
+
mapFromDriverValue = BigInt;
|
|
2871
|
+
mapToDriverValue = String;
|
|
2872
|
+
getSQLType() {
|
|
2873
|
+
if (this.precision !== void 0 && this.scale !== void 0) return `numeric(${this.precision}, ${this.scale})`;
|
|
2874
|
+
else if (this.precision === void 0) return "numeric";
|
|
2875
|
+
else return `numeric(${this.precision})`;
|
|
2876
|
+
}
|
|
2877
|
+
};
|
|
2878
|
+
function numeric$1(a, b) {
|
|
2879
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2880
|
+
const mode = config?.mode;
|
|
2881
|
+
return mode === "number" ? new PgNumericNumberBuilder(name, config?.precision, config?.scale) : mode === "bigint" ? new PgNumericBigIntBuilder(name, config?.precision, config?.scale) : new PgNumericBuilder(name, config?.precision, config?.scale);
|
|
2882
|
+
}
|
|
2883
|
+
//#endregion
|
|
2884
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/point.js
|
|
2885
|
+
var PgPointTupleBuilder = class extends PgColumnBuilder {
|
|
2886
|
+
static [entityKind] = "PgPointTupleBuilder";
|
|
2887
|
+
constructor(name) {
|
|
2888
|
+
super(name, "array", "PgPointTuple");
|
|
2889
|
+
}
|
|
2890
|
+
/** @internal */
|
|
2891
|
+
build(table) {
|
|
2892
|
+
return new PgPointTuple(table, this.config);
|
|
2893
|
+
}
|
|
2894
|
+
};
|
|
2895
|
+
var PgPointTuple = class extends PgColumn {
|
|
2896
|
+
static [entityKind] = "PgPointTuple";
|
|
2897
|
+
getSQLType() {
|
|
2898
|
+
return "point";
|
|
2899
|
+
}
|
|
2900
|
+
mapFromDriverValue(value) {
|
|
2901
|
+
if (typeof value === "string") {
|
|
2902
|
+
const [x, y] = value.slice(1, -1).split(",");
|
|
2903
|
+
return [Number.parseFloat(x), Number.parseFloat(y)];
|
|
2904
|
+
}
|
|
2905
|
+
return [value.x, value.y];
|
|
2906
|
+
}
|
|
2907
|
+
mapToDriverValue(value) {
|
|
2908
|
+
return `(${value[0]},${value[1]})`;
|
|
2909
|
+
}
|
|
2910
|
+
};
|
|
2911
|
+
var PgPointObjectBuilder = class extends PgColumnBuilder {
|
|
2912
|
+
static [entityKind] = "PgPointObjectBuilder";
|
|
2913
|
+
constructor(name) {
|
|
2914
|
+
super(name, "json", "PgPointObject");
|
|
2915
|
+
}
|
|
2916
|
+
/** @internal */
|
|
2917
|
+
build(table) {
|
|
2918
|
+
return new PgPointObject(table, this.config);
|
|
2919
|
+
}
|
|
2920
|
+
};
|
|
2921
|
+
var PgPointObject = class extends PgColumn {
|
|
2922
|
+
static [entityKind] = "PgPointObject";
|
|
2923
|
+
getSQLType() {
|
|
2924
|
+
return "point";
|
|
2925
|
+
}
|
|
2926
|
+
mapFromDriverValue(value) {
|
|
2927
|
+
if (typeof value === "string") {
|
|
2928
|
+
const [x, y] = value.slice(1, -1).split(",");
|
|
2929
|
+
return {
|
|
2930
|
+
x: Number.parseFloat(x),
|
|
2931
|
+
y: Number.parseFloat(y)
|
|
2932
|
+
};
|
|
2933
|
+
}
|
|
2934
|
+
return value;
|
|
2935
|
+
}
|
|
2936
|
+
mapToDriverValue(value) {
|
|
2937
|
+
return `(${value.x},${value.y})`;
|
|
2938
|
+
}
|
|
2939
|
+
};
|
|
2940
|
+
function point(a, b) {
|
|
2941
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
2942
|
+
if (!config?.mode || config.mode === "tuple") return new PgPointTupleBuilder(name);
|
|
2943
|
+
return new PgPointObjectBuilder(name);
|
|
2944
|
+
}
|
|
2945
|
+
//#endregion
|
|
2946
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
|
|
2947
|
+
function hexToBytes(hex) {
|
|
2948
|
+
const bytes = [];
|
|
2949
|
+
for (let c = 0; c < hex.length; c += 2) bytes.push(Number.parseInt(hex.slice(c, c + 2), 16));
|
|
2950
|
+
return new Uint8Array(bytes);
|
|
2951
|
+
}
|
|
2952
|
+
function bytesToFloat64(bytes, offset) {
|
|
2953
|
+
const view = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
|
|
2954
|
+
for (let i = 0; i < 8; i++) view.setUint8(i, bytes[offset + i]);
|
|
2955
|
+
return view.getFloat64(0, true);
|
|
2956
|
+
}
|
|
2957
|
+
function parseEWKB(hex) {
|
|
2958
|
+
const bytes = hexToBytes(hex);
|
|
2959
|
+
let offset = 0;
|
|
2960
|
+
const byteOrder = bytes[offset];
|
|
2961
|
+
offset += 1;
|
|
2962
|
+
const view = new DataView(bytes.buffer);
|
|
2963
|
+
const geomType = view.getUint32(offset, byteOrder === 1);
|
|
2964
|
+
offset += 4;
|
|
2965
|
+
if (geomType & 536870912) {
|
|
2966
|
+
view.getUint32(offset, byteOrder === 1);
|
|
2967
|
+
offset += 4;
|
|
2968
|
+
}
|
|
2969
|
+
if ((geomType & 65535) === 1) {
|
|
2970
|
+
const x = bytesToFloat64(bytes, offset);
|
|
2971
|
+
offset += 8;
|
|
2972
|
+
const y = bytesToFloat64(bytes, offset);
|
|
2973
|
+
offset += 8;
|
|
2974
|
+
return [x, y];
|
|
2975
|
+
}
|
|
2976
|
+
throw new Error("Unsupported geometry type");
|
|
2977
|
+
}
|
|
2978
|
+
//#endregion
|
|
2979
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
|
|
2980
|
+
var PgGeometryBuilder = class extends PgColumnBuilder {
|
|
2981
|
+
static [entityKind] = "PgGeometryBuilder";
|
|
2982
|
+
constructor(name) {
|
|
2983
|
+
super(name, "array", "PgGeometry");
|
|
2984
|
+
}
|
|
2985
|
+
/** @internal */
|
|
2986
|
+
build(table) {
|
|
2987
|
+
return new PgGeometry(table, this.config);
|
|
2988
|
+
}
|
|
2989
|
+
};
|
|
2990
|
+
var PgGeometry = class extends PgColumn {
|
|
2991
|
+
static [entityKind] = "PgGeometry";
|
|
2992
|
+
getSQLType() {
|
|
2993
|
+
return "geometry(point)";
|
|
2994
|
+
}
|
|
2995
|
+
mapFromDriverValue(value) {
|
|
2996
|
+
return parseEWKB(value);
|
|
2997
|
+
}
|
|
2998
|
+
mapToDriverValue(value) {
|
|
2999
|
+
return `point(${value[0]} ${value[1]})`;
|
|
3000
|
+
}
|
|
3001
|
+
};
|
|
3002
|
+
var PgGeometryObjectBuilder = class extends PgColumnBuilder {
|
|
3003
|
+
static [entityKind] = "PgGeometryObjectBuilder";
|
|
3004
|
+
constructor(name) {
|
|
3005
|
+
super(name, "json", "PgGeometryObject");
|
|
3006
|
+
}
|
|
3007
|
+
/** @internal */
|
|
3008
|
+
build(table) {
|
|
3009
|
+
return new PgGeometryObject(table, this.config);
|
|
3010
|
+
}
|
|
3011
|
+
};
|
|
3012
|
+
var PgGeometryObject = class extends PgColumn {
|
|
3013
|
+
static [entityKind] = "PgGeometryObject";
|
|
3014
|
+
getSQLType() {
|
|
3015
|
+
return "geometry(point)";
|
|
3016
|
+
}
|
|
3017
|
+
mapFromDriverValue(value) {
|
|
3018
|
+
const parsed = parseEWKB(value);
|
|
3019
|
+
return {
|
|
3020
|
+
x: parsed[0],
|
|
3021
|
+
y: parsed[1]
|
|
3022
|
+
};
|
|
3023
|
+
}
|
|
3024
|
+
mapToDriverValue(value) {
|
|
3025
|
+
return `point(${value.x} ${value.y})`;
|
|
3026
|
+
}
|
|
3027
|
+
};
|
|
3028
|
+
function geometry(a, b) {
|
|
3029
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3030
|
+
if (!config?.mode || config.mode === "tuple") return new PgGeometryBuilder(name);
|
|
3031
|
+
return new PgGeometryObjectBuilder(name);
|
|
3032
|
+
}
|
|
3033
|
+
//#endregion
|
|
3034
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/real.js
|
|
3035
|
+
var PgRealBuilder = class extends PgColumnBuilder {
|
|
3036
|
+
static [entityKind] = "PgRealBuilder";
|
|
3037
|
+
constructor(name, length) {
|
|
3038
|
+
super(name, "number", "PgReal");
|
|
3039
|
+
this.config.length = length;
|
|
3040
|
+
}
|
|
3041
|
+
/** @internal */
|
|
3042
|
+
build(table) {
|
|
3043
|
+
return new PgReal(table, this.config);
|
|
3044
|
+
}
|
|
3045
|
+
};
|
|
3046
|
+
var PgReal = class extends PgColumn {
|
|
3047
|
+
static [entityKind] = "PgReal";
|
|
3048
|
+
constructor(table, config) {
|
|
3049
|
+
super(table, config);
|
|
3050
|
+
}
|
|
3051
|
+
getSQLType() {
|
|
3052
|
+
return "real";
|
|
3053
|
+
}
|
|
3054
|
+
mapFromDriverValue = (value) => {
|
|
3055
|
+
if (typeof value === "string") return Number.parseFloat(value);
|
|
3056
|
+
return value;
|
|
3057
|
+
};
|
|
3058
|
+
};
|
|
3059
|
+
function real$1(name) {
|
|
3060
|
+
return new PgRealBuilder(name ?? "");
|
|
3061
|
+
}
|
|
3062
|
+
//#endregion
|
|
3063
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/serial.js
|
|
3064
|
+
var PgSerialBuilder = class extends PgColumnBuilder {
|
|
3065
|
+
static [entityKind] = "PgSerialBuilder";
|
|
3066
|
+
constructor(name) {
|
|
3067
|
+
super(name, "number", "PgSerial");
|
|
3068
|
+
this.config.hasDefault = true;
|
|
3069
|
+
this.config.notNull = true;
|
|
3070
|
+
}
|
|
3071
|
+
/** @internal */
|
|
3072
|
+
build(table) {
|
|
3073
|
+
return new PgSerial(table, this.config);
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
var PgSerial = class extends PgColumn {
|
|
3077
|
+
static [entityKind] = "PgSerial";
|
|
3078
|
+
getSQLType() {
|
|
3079
|
+
return "serial";
|
|
3080
|
+
}
|
|
3081
|
+
};
|
|
3082
|
+
function serial(name) {
|
|
3083
|
+
return new PgSerialBuilder(name ?? "");
|
|
3084
|
+
}
|
|
3085
|
+
//#endregion
|
|
3086
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/smallint.js
|
|
3087
|
+
var PgSmallIntBuilder = class extends PgIntColumnBaseBuilder {
|
|
3088
|
+
static [entityKind] = "PgSmallIntBuilder";
|
|
3089
|
+
constructor(name) {
|
|
3090
|
+
super(name, "number", "PgSmallInt");
|
|
3091
|
+
}
|
|
3092
|
+
/** @internal */
|
|
3093
|
+
build(table) {
|
|
3094
|
+
return new PgSmallInt(table, this.config);
|
|
3095
|
+
}
|
|
3096
|
+
};
|
|
3097
|
+
var PgSmallInt = class extends PgColumn {
|
|
3098
|
+
static [entityKind] = "PgSmallInt";
|
|
3099
|
+
getSQLType() {
|
|
3100
|
+
return "smallint";
|
|
3101
|
+
}
|
|
3102
|
+
mapFromDriverValue = (value) => {
|
|
3103
|
+
if (typeof value === "string") return Number(value);
|
|
3104
|
+
return value;
|
|
3105
|
+
};
|
|
3106
|
+
};
|
|
3107
|
+
function smallint(name) {
|
|
3108
|
+
return new PgSmallIntBuilder(name ?? "");
|
|
3109
|
+
}
|
|
3110
|
+
//#endregion
|
|
3111
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/smallserial.js
|
|
3112
|
+
var PgSmallSerialBuilder = class extends PgColumnBuilder {
|
|
3113
|
+
static [entityKind] = "PgSmallSerialBuilder";
|
|
3114
|
+
constructor(name) {
|
|
3115
|
+
super(name, "number", "PgSmallSerial");
|
|
3116
|
+
this.config.hasDefault = true;
|
|
3117
|
+
this.config.notNull = true;
|
|
3118
|
+
}
|
|
3119
|
+
/** @internal */
|
|
3120
|
+
build(table) {
|
|
3121
|
+
return new PgSmallSerial(table, this.config);
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
var PgSmallSerial = class extends PgColumn {
|
|
3125
|
+
static [entityKind] = "PgSmallSerial";
|
|
3126
|
+
getSQLType() {
|
|
3127
|
+
return "smallserial";
|
|
3128
|
+
}
|
|
3129
|
+
};
|
|
3130
|
+
function smallserial(name) {
|
|
3131
|
+
return new PgSmallSerialBuilder(name ?? "");
|
|
3132
|
+
}
|
|
3133
|
+
//#endregion
|
|
3134
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/text.js
|
|
3135
|
+
var PgTextBuilder = class extends PgColumnBuilder {
|
|
3136
|
+
static [entityKind] = "PgTextBuilder";
|
|
3137
|
+
constructor(name, config) {
|
|
3138
|
+
super(name, "string", "PgText");
|
|
3139
|
+
this.config.enumValues = config.enum;
|
|
3140
|
+
}
|
|
3141
|
+
/** @internal */
|
|
3142
|
+
build(table) {
|
|
3143
|
+
return new PgText(table, this.config);
|
|
3144
|
+
}
|
|
3145
|
+
};
|
|
3146
|
+
var PgText = class extends PgColumn {
|
|
3147
|
+
static [entityKind] = "PgText";
|
|
3148
|
+
enumValues = this.config.enumValues;
|
|
3149
|
+
getSQLType() {
|
|
3150
|
+
return "text";
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
function text$1(a, b = {}) {
|
|
3154
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3155
|
+
return new PgTextBuilder(name, config);
|
|
3156
|
+
}
|
|
3157
|
+
//#endregion
|
|
3158
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/time.js
|
|
3159
|
+
var PgTimeBuilder = class extends PgDateColumnBaseBuilder {
|
|
3160
|
+
constructor(name, withTimezone, precision) {
|
|
3161
|
+
super(name, "string", "PgTime");
|
|
3162
|
+
this.withTimezone = withTimezone;
|
|
3163
|
+
this.precision = precision;
|
|
3164
|
+
this.config.withTimezone = withTimezone;
|
|
3165
|
+
this.config.precision = precision;
|
|
3166
|
+
}
|
|
3167
|
+
static [entityKind] = "PgTimeBuilder";
|
|
3168
|
+
/** @internal */
|
|
3169
|
+
build(table) {
|
|
3170
|
+
return new PgTime(table, this.config);
|
|
3171
|
+
}
|
|
3172
|
+
};
|
|
3173
|
+
var PgTime = class extends PgColumn {
|
|
3174
|
+
static [entityKind] = "PgTime";
|
|
3175
|
+
withTimezone;
|
|
3176
|
+
precision;
|
|
3177
|
+
constructor(table, config) {
|
|
3178
|
+
super(table, config);
|
|
3179
|
+
this.withTimezone = config.withTimezone;
|
|
3180
|
+
this.precision = config.precision;
|
|
3181
|
+
}
|
|
3182
|
+
getSQLType() {
|
|
3183
|
+
return `time${this.precision === void 0 ? "" : `(${this.precision})`}${this.withTimezone ? " with time zone" : ""}`;
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
function time(a, b = {}) {
|
|
3187
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3188
|
+
return new PgTimeBuilder(name, config.withTimezone ?? false, config.precision);
|
|
3189
|
+
}
|
|
3190
|
+
//#endregion
|
|
3191
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/timestamp.js
|
|
3192
|
+
var PgTimestampBuilder = class extends PgDateColumnBaseBuilder {
|
|
3193
|
+
static [entityKind] = "PgTimestampBuilder";
|
|
3194
|
+
constructor(name, withTimezone, precision) {
|
|
3195
|
+
super(name, "date", "PgTimestamp");
|
|
3196
|
+
this.config.withTimezone = withTimezone;
|
|
3197
|
+
this.config.precision = precision;
|
|
3198
|
+
}
|
|
3199
|
+
/** @internal */
|
|
3200
|
+
build(table) {
|
|
3201
|
+
return new PgTimestamp(table, this.config);
|
|
3202
|
+
}
|
|
3203
|
+
};
|
|
3204
|
+
var PgTimestamp = class extends PgColumn {
|
|
3205
|
+
static [entityKind] = "PgTimestamp";
|
|
3206
|
+
withTimezone;
|
|
3207
|
+
precision;
|
|
3208
|
+
constructor(table, config) {
|
|
3209
|
+
super(table, config);
|
|
3210
|
+
this.withTimezone = config.withTimezone;
|
|
3211
|
+
this.precision = config.precision;
|
|
3212
|
+
}
|
|
3213
|
+
getSQLType() {
|
|
3214
|
+
return `timestamp${this.precision === void 0 ? "" : ` (${this.precision})`}${this.withTimezone ? " with time zone" : ""}`;
|
|
3215
|
+
}
|
|
3216
|
+
mapFromDriverValue(value) {
|
|
3217
|
+
if (typeof value === "string") return new Date(this.withTimezone ? value : value + "+0000");
|
|
3218
|
+
return value;
|
|
3219
|
+
}
|
|
3220
|
+
mapToDriverValue = (value) => {
|
|
3221
|
+
return value.toISOString();
|
|
3222
|
+
};
|
|
3223
|
+
};
|
|
3224
|
+
var PgTimestampStringBuilder = class extends PgDateColumnBaseBuilder {
|
|
3225
|
+
static [entityKind] = "PgTimestampStringBuilder";
|
|
3226
|
+
constructor(name, withTimezone, precision) {
|
|
3227
|
+
super(name, "string", "PgTimestampString");
|
|
3228
|
+
this.config.withTimezone = withTimezone;
|
|
3229
|
+
this.config.precision = precision;
|
|
3230
|
+
}
|
|
3231
|
+
/** @internal */
|
|
3232
|
+
build(table) {
|
|
3233
|
+
return new PgTimestampString(table, this.config);
|
|
3234
|
+
}
|
|
3235
|
+
};
|
|
3236
|
+
var PgTimestampString = class extends PgColumn {
|
|
3237
|
+
static [entityKind] = "PgTimestampString";
|
|
3238
|
+
withTimezone;
|
|
3239
|
+
precision;
|
|
3240
|
+
constructor(table, config) {
|
|
3241
|
+
super(table, config);
|
|
3242
|
+
this.withTimezone = config.withTimezone;
|
|
3243
|
+
this.precision = config.precision;
|
|
3244
|
+
}
|
|
3245
|
+
getSQLType() {
|
|
3246
|
+
return `timestamp${this.precision === void 0 ? "" : `(${this.precision})`}${this.withTimezone ? " with time zone" : ""}`;
|
|
3247
|
+
}
|
|
3248
|
+
mapFromDriverValue(value) {
|
|
3249
|
+
if (typeof value === "string") return value;
|
|
3250
|
+
const shortened = value.toISOString().slice(0, -1).replace("T", " ");
|
|
3251
|
+
if (this.withTimezone) {
|
|
3252
|
+
const offset = value.getTimezoneOffset();
|
|
3253
|
+
return `${shortened}${offset <= 0 ? "+" : "-"}${Math.floor(Math.abs(offset) / 60).toString().padStart(2, "0")}`;
|
|
3254
|
+
}
|
|
3255
|
+
return shortened;
|
|
3256
|
+
}
|
|
3257
|
+
};
|
|
3258
|
+
function timestamp(a, b = {}) {
|
|
3259
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3260
|
+
if (config?.mode === "string") return new PgTimestampStringBuilder(name, config.withTimezone ?? false, config.precision);
|
|
3261
|
+
return new PgTimestampBuilder(name, config?.withTimezone ?? false, config?.precision);
|
|
3262
|
+
}
|
|
3263
|
+
//#endregion
|
|
3264
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/uuid.js
|
|
3265
|
+
var PgUUIDBuilder = class extends PgColumnBuilder {
|
|
3266
|
+
static [entityKind] = "PgUUIDBuilder";
|
|
3267
|
+
constructor(name) {
|
|
3268
|
+
super(name, "string", "PgUUID");
|
|
3269
|
+
}
|
|
3270
|
+
/**
|
|
3271
|
+
* Adds `default gen_random_uuid()` to the column definition.
|
|
3272
|
+
*/
|
|
3273
|
+
defaultRandom() {
|
|
3274
|
+
return this.default(sql`gen_random_uuid()`);
|
|
3275
|
+
}
|
|
3276
|
+
/** @internal */
|
|
3277
|
+
build(table) {
|
|
3278
|
+
return new PgUUID(table, this.config);
|
|
3279
|
+
}
|
|
3280
|
+
};
|
|
3281
|
+
var PgUUID = class extends PgColumn {
|
|
3282
|
+
static [entityKind] = "PgUUID";
|
|
3283
|
+
getSQLType() {
|
|
3284
|
+
return "uuid";
|
|
3285
|
+
}
|
|
3286
|
+
};
|
|
3287
|
+
function uuid(name) {
|
|
3288
|
+
return new PgUUIDBuilder(name ?? "");
|
|
3289
|
+
}
|
|
3290
|
+
//#endregion
|
|
3291
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/varchar.js
|
|
3292
|
+
var PgVarcharBuilder = class extends PgColumnBuilder {
|
|
3293
|
+
static [entityKind] = "PgVarcharBuilder";
|
|
3294
|
+
constructor(name, config) {
|
|
3295
|
+
super(name, "string", "PgVarchar");
|
|
3296
|
+
this.config.length = config.length;
|
|
3297
|
+
this.config.enumValues = config.enum;
|
|
3298
|
+
}
|
|
3299
|
+
/** @internal */
|
|
3300
|
+
build(table) {
|
|
3301
|
+
return new PgVarchar(table, this.config);
|
|
3302
|
+
}
|
|
3303
|
+
};
|
|
3304
|
+
var PgVarchar = class extends PgColumn {
|
|
3305
|
+
static [entityKind] = "PgVarchar";
|
|
3306
|
+
length = this.config.length;
|
|
3307
|
+
enumValues = this.config.enumValues;
|
|
3308
|
+
getSQLType() {
|
|
3309
|
+
return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
|
|
3310
|
+
}
|
|
3311
|
+
};
|
|
3312
|
+
function varchar(a, b = {}) {
|
|
3313
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3314
|
+
return new PgVarcharBuilder(name, config);
|
|
3315
|
+
}
|
|
3316
|
+
//#endregion
|
|
3317
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
|
|
3318
|
+
var PgBinaryVectorBuilder = class extends PgColumnBuilder {
|
|
3319
|
+
static [entityKind] = "PgBinaryVectorBuilder";
|
|
3320
|
+
constructor(name, config) {
|
|
3321
|
+
super(name, "string", "PgBinaryVector");
|
|
3322
|
+
this.config.dimensions = config.dimensions;
|
|
3323
|
+
}
|
|
3324
|
+
/** @internal */
|
|
3325
|
+
build(table) {
|
|
3326
|
+
return new PgBinaryVector(table, this.config);
|
|
3327
|
+
}
|
|
3328
|
+
};
|
|
3329
|
+
var PgBinaryVector = class extends PgColumn {
|
|
3330
|
+
static [entityKind] = "PgBinaryVector";
|
|
3331
|
+
dimensions = this.config.dimensions;
|
|
3332
|
+
getSQLType() {
|
|
3333
|
+
return `bit(${this.dimensions})`;
|
|
3334
|
+
}
|
|
3335
|
+
};
|
|
3336
|
+
function bit(a, b) {
|
|
3337
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3338
|
+
return new PgBinaryVectorBuilder(name, config);
|
|
3339
|
+
}
|
|
3340
|
+
//#endregion
|
|
3341
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
|
|
3342
|
+
var PgHalfVectorBuilder = class extends PgColumnBuilder {
|
|
3343
|
+
static [entityKind] = "PgHalfVectorBuilder";
|
|
3344
|
+
constructor(name, config) {
|
|
3345
|
+
super(name, "array", "PgHalfVector");
|
|
3346
|
+
this.config.dimensions = config.dimensions;
|
|
3347
|
+
}
|
|
3348
|
+
/** @internal */
|
|
3349
|
+
build(table) {
|
|
3350
|
+
return new PgHalfVector(table, this.config);
|
|
3351
|
+
}
|
|
3352
|
+
};
|
|
3353
|
+
var PgHalfVector = class extends PgColumn {
|
|
3354
|
+
static [entityKind] = "PgHalfVector";
|
|
3355
|
+
dimensions = this.config.dimensions;
|
|
3356
|
+
getSQLType() {
|
|
3357
|
+
return `halfvec(${this.dimensions})`;
|
|
3358
|
+
}
|
|
3359
|
+
mapToDriverValue(value) {
|
|
3360
|
+
return JSON.stringify(value);
|
|
3361
|
+
}
|
|
3362
|
+
mapFromDriverValue(value) {
|
|
3363
|
+
return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
|
|
3364
|
+
}
|
|
3365
|
+
};
|
|
3366
|
+
function halfvec(a, b) {
|
|
3367
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3368
|
+
return new PgHalfVectorBuilder(name, config);
|
|
3369
|
+
}
|
|
3370
|
+
//#endregion
|
|
3371
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
|
|
3372
|
+
var PgSparseVectorBuilder = class extends PgColumnBuilder {
|
|
3373
|
+
static [entityKind] = "PgSparseVectorBuilder";
|
|
3374
|
+
constructor(name, config) {
|
|
3375
|
+
super(name, "string", "PgSparseVector");
|
|
3376
|
+
this.config.dimensions = config.dimensions;
|
|
3377
|
+
}
|
|
3378
|
+
/** @internal */
|
|
3379
|
+
build(table) {
|
|
3380
|
+
return new PgSparseVector(table, this.config);
|
|
3381
|
+
}
|
|
3382
|
+
};
|
|
3383
|
+
var PgSparseVector = class extends PgColumn {
|
|
3384
|
+
static [entityKind] = "PgSparseVector";
|
|
3385
|
+
dimensions = this.config.dimensions;
|
|
3386
|
+
getSQLType() {
|
|
3387
|
+
return `sparsevec(${this.dimensions})`;
|
|
3388
|
+
}
|
|
3389
|
+
};
|
|
3390
|
+
function sparsevec(a, b) {
|
|
3391
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3392
|
+
return new PgSparseVectorBuilder(name, config);
|
|
3393
|
+
}
|
|
3394
|
+
//#endregion
|
|
3395
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
|
|
3396
|
+
var PgVectorBuilder = class extends PgColumnBuilder {
|
|
3397
|
+
static [entityKind] = "PgVectorBuilder";
|
|
3398
|
+
constructor(name, config) {
|
|
3399
|
+
super(name, "array", "PgVector");
|
|
3400
|
+
this.config.dimensions = config.dimensions;
|
|
3401
|
+
}
|
|
3402
|
+
/** @internal */
|
|
3403
|
+
build(table) {
|
|
3404
|
+
return new PgVector(table, this.config);
|
|
3405
|
+
}
|
|
3406
|
+
};
|
|
3407
|
+
var PgVector = class extends PgColumn {
|
|
3408
|
+
static [entityKind] = "PgVector";
|
|
3409
|
+
dimensions = this.config.dimensions;
|
|
3410
|
+
getSQLType() {
|
|
3411
|
+
return `vector(${this.dimensions})`;
|
|
3412
|
+
}
|
|
3413
|
+
mapToDriverValue(value) {
|
|
3414
|
+
return JSON.stringify(value);
|
|
3415
|
+
}
|
|
3416
|
+
mapFromDriverValue(value) {
|
|
3417
|
+
return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
|
|
3418
|
+
}
|
|
3419
|
+
};
|
|
3420
|
+
function vector(a, b) {
|
|
3421
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3422
|
+
return new PgVectorBuilder(name, config);
|
|
3423
|
+
}
|
|
3424
|
+
//#endregion
|
|
3425
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/columns/all.js
|
|
3426
|
+
function getPgColumnBuilders() {
|
|
3427
|
+
return {
|
|
3428
|
+
bigint,
|
|
3429
|
+
bigserial,
|
|
3430
|
+
boolean,
|
|
3431
|
+
char,
|
|
3432
|
+
cidr,
|
|
3433
|
+
customType: customType$1,
|
|
3434
|
+
date,
|
|
3435
|
+
doublePrecision,
|
|
3436
|
+
inet,
|
|
3437
|
+
integer: integer$1,
|
|
3438
|
+
interval,
|
|
3439
|
+
json,
|
|
3440
|
+
jsonb,
|
|
3441
|
+
line,
|
|
3442
|
+
macaddr,
|
|
3443
|
+
macaddr8,
|
|
3444
|
+
numeric: numeric$1,
|
|
3445
|
+
point,
|
|
3446
|
+
geometry,
|
|
3447
|
+
real: real$1,
|
|
3448
|
+
serial,
|
|
3449
|
+
smallint,
|
|
3450
|
+
smallserial,
|
|
3451
|
+
text: text$1,
|
|
3452
|
+
time,
|
|
3453
|
+
timestamp,
|
|
3454
|
+
uuid,
|
|
3455
|
+
varchar,
|
|
3456
|
+
bit,
|
|
3457
|
+
halfvec,
|
|
3458
|
+
sparsevec,
|
|
3459
|
+
vector
|
|
3460
|
+
};
|
|
3461
|
+
}
|
|
3462
|
+
//#endregion
|
|
3463
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/table.js
|
|
3464
|
+
const InlineForeignKeys$1 = Symbol.for("drizzle:PgInlineForeignKeys");
|
|
3465
|
+
const EnableRLS = Symbol.for("drizzle:EnableRLS");
|
|
3466
|
+
var PgTable = class extends Table {
|
|
3467
|
+
static [entityKind] = "PgTable";
|
|
3468
|
+
/** @internal */
|
|
3469
|
+
static Symbol = Object.assign({}, Table.Symbol, {
|
|
3470
|
+
InlineForeignKeys: InlineForeignKeys$1,
|
|
3471
|
+
EnableRLS
|
|
3472
|
+
});
|
|
3473
|
+
/**@internal */
|
|
3474
|
+
[InlineForeignKeys$1] = [];
|
|
3475
|
+
/** @internal */
|
|
3476
|
+
[EnableRLS] = false;
|
|
3477
|
+
/** @internal */
|
|
3478
|
+
[Table.Symbol.ExtraConfigBuilder] = void 0;
|
|
3479
|
+
/** @internal */
|
|
3480
|
+
[Table.Symbol.ExtraConfigColumns] = {};
|
|
3481
|
+
};
|
|
3482
|
+
function pgTableWithSchema(name, columns, extraConfig, schema, baseName = name) {
|
|
3483
|
+
const rawTable = new PgTable(name, schema, baseName);
|
|
3484
|
+
const parsedColumns = typeof columns === "function" ? columns(getPgColumnBuilders()) : columns;
|
|
3485
|
+
const builtColumns = Object.fromEntries(Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
|
|
3486
|
+
const colBuilder = colBuilderBase;
|
|
3487
|
+
colBuilder.setName(name2);
|
|
3488
|
+
const column = colBuilder.build(rawTable);
|
|
3489
|
+
rawTable[InlineForeignKeys$1].push(...colBuilder.buildForeignKeys(column, rawTable));
|
|
3490
|
+
return [name2, column];
|
|
3491
|
+
}));
|
|
3492
|
+
const builtColumnsForExtraConfig = Object.fromEntries(Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
|
|
3493
|
+
const colBuilder = colBuilderBase;
|
|
3494
|
+
colBuilder.setName(name2);
|
|
3495
|
+
return [name2, colBuilder.buildExtraConfigColumn(rawTable)];
|
|
3496
|
+
}));
|
|
3497
|
+
const table = Object.assign(rawTable, builtColumns);
|
|
3498
|
+
table[Table.Symbol.Columns] = builtColumns;
|
|
3499
|
+
table[Table.Symbol.ExtraConfigColumns] = builtColumnsForExtraConfig;
|
|
3500
|
+
if (extraConfig) table[PgTable.Symbol.ExtraConfigBuilder] = extraConfig;
|
|
3501
|
+
return Object.assign(table, { enableRLS: () => {
|
|
3502
|
+
table[PgTable.Symbol.EnableRLS] = true;
|
|
3503
|
+
return table;
|
|
3504
|
+
} });
|
|
3505
|
+
}
|
|
3506
|
+
const pgTable = (name, columns, extraConfig) => {
|
|
3507
|
+
return pgTableWithSchema(name, columns, extraConfig, void 0);
|
|
3508
|
+
};
|
|
3509
|
+
//#endregion
|
|
3510
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/pg-core/indexes.js
|
|
3511
|
+
var IndexBuilderOn$1 = class {
|
|
3512
|
+
constructor(unique, name) {
|
|
3513
|
+
this.unique = unique;
|
|
3514
|
+
this.name = name;
|
|
3515
|
+
}
|
|
3516
|
+
static [entityKind] = "PgIndexBuilderOn";
|
|
3517
|
+
on(...columns) {
|
|
3518
|
+
return new IndexBuilder$1(columns.map((it) => {
|
|
3519
|
+
if (is(it, SQL)) return it;
|
|
3520
|
+
it = it;
|
|
3521
|
+
const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
|
|
3522
|
+
it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
|
|
3523
|
+
return clonedIndexedColumn;
|
|
3524
|
+
}), this.unique, false, this.name);
|
|
3525
|
+
}
|
|
3526
|
+
onOnly(...columns) {
|
|
3527
|
+
return new IndexBuilder$1(columns.map((it) => {
|
|
3528
|
+
if (is(it, SQL)) return it;
|
|
3529
|
+
it = it;
|
|
3530
|
+
const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
|
|
3531
|
+
it.indexConfig = it.defaultConfig;
|
|
3532
|
+
return clonedIndexedColumn;
|
|
3533
|
+
}), this.unique, true, this.name);
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* Specify what index method to use. Choices are `btree`, `hash`, `gist`, `spgist`, `gin`, `brin`, or user-installed access methods like `bloom`. The default method is `btree.
|
|
3537
|
+
*
|
|
3538
|
+
* If you have the `pg_vector` extension installed in your database, you can use the `hnsw` and `ivfflat` options, which are predefined types.
|
|
3539
|
+
*
|
|
3540
|
+
* **You can always specify any string you want in the method, in case Drizzle doesn't have it natively in its types**
|
|
3541
|
+
*
|
|
3542
|
+
* @param method The name of the index method to be used
|
|
3543
|
+
* @param columns
|
|
3544
|
+
* @returns
|
|
3545
|
+
*/
|
|
3546
|
+
using(method, ...columns) {
|
|
3547
|
+
return new IndexBuilder$1(columns.map((it) => {
|
|
3548
|
+
if (is(it, SQL)) return it;
|
|
3549
|
+
it = it;
|
|
3550
|
+
const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
|
|
3551
|
+
it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
|
|
3552
|
+
return clonedIndexedColumn;
|
|
3553
|
+
}), this.unique, true, this.name, method);
|
|
3554
|
+
}
|
|
3555
|
+
};
|
|
3556
|
+
var IndexBuilder$1 = class {
|
|
3557
|
+
static [entityKind] = "PgIndexBuilder";
|
|
3558
|
+
/** @internal */
|
|
3559
|
+
config;
|
|
3560
|
+
constructor(columns, unique, only, name, method = "btree") {
|
|
3561
|
+
this.config = {
|
|
3562
|
+
name,
|
|
3563
|
+
columns,
|
|
3564
|
+
unique,
|
|
3565
|
+
only,
|
|
3566
|
+
method
|
|
3567
|
+
};
|
|
3568
|
+
}
|
|
3569
|
+
concurrently() {
|
|
3570
|
+
this.config.concurrently = true;
|
|
3571
|
+
return this;
|
|
3572
|
+
}
|
|
3573
|
+
with(obj) {
|
|
3574
|
+
this.config.with = obj;
|
|
3575
|
+
return this;
|
|
3576
|
+
}
|
|
3577
|
+
where(condition) {
|
|
3578
|
+
this.config.where = condition;
|
|
3579
|
+
return this;
|
|
3580
|
+
}
|
|
3581
|
+
/** @internal */
|
|
3582
|
+
build(table) {
|
|
3583
|
+
return new Index$1(this.config, table);
|
|
3584
|
+
}
|
|
3585
|
+
};
|
|
3586
|
+
var Index$1 = class {
|
|
3587
|
+
static [entityKind] = "PgIndex";
|
|
3588
|
+
config;
|
|
3589
|
+
constructor(config, table) {
|
|
3590
|
+
this.config = {
|
|
3591
|
+
...config,
|
|
3592
|
+
table
|
|
3593
|
+
};
|
|
3594
|
+
}
|
|
3595
|
+
};
|
|
3596
|
+
function index$1(name) {
|
|
3597
|
+
return new IndexBuilderOn$1(false, name);
|
|
3598
|
+
}
|
|
3599
|
+
//#endregion
|
|
3600
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
3601
|
+
var ForeignKeyBuilder = class {
|
|
3602
|
+
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
3603
|
+
/** @internal */
|
|
3604
|
+
reference;
|
|
3605
|
+
/** @internal */
|
|
3606
|
+
_onUpdate;
|
|
3607
|
+
/** @internal */
|
|
3608
|
+
_onDelete;
|
|
3609
|
+
constructor(config, actions) {
|
|
3610
|
+
this.reference = () => {
|
|
3611
|
+
const { name, columns, foreignColumns } = config();
|
|
3612
|
+
return {
|
|
3613
|
+
name,
|
|
3614
|
+
columns,
|
|
3615
|
+
foreignTable: foreignColumns[0].table,
|
|
3616
|
+
foreignColumns
|
|
3617
|
+
};
|
|
3618
|
+
};
|
|
3619
|
+
if (actions) {
|
|
3620
|
+
this._onUpdate = actions.onUpdate;
|
|
3621
|
+
this._onDelete = actions.onDelete;
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
onUpdate(action) {
|
|
3625
|
+
this._onUpdate = action;
|
|
3626
|
+
return this;
|
|
3627
|
+
}
|
|
3628
|
+
onDelete(action) {
|
|
3629
|
+
this._onDelete = action;
|
|
3630
|
+
return this;
|
|
3631
|
+
}
|
|
3632
|
+
/** @internal */
|
|
3633
|
+
build(table) {
|
|
3634
|
+
return new ForeignKey(table, this);
|
|
3635
|
+
}
|
|
3636
|
+
};
|
|
3637
|
+
var ForeignKey = class {
|
|
3638
|
+
constructor(table, builder) {
|
|
3639
|
+
this.table = table;
|
|
3640
|
+
this.reference = builder.reference;
|
|
3641
|
+
this.onUpdate = builder._onUpdate;
|
|
3642
|
+
this.onDelete = builder._onDelete;
|
|
3643
|
+
}
|
|
3644
|
+
static [entityKind] = "SQLiteForeignKey";
|
|
3645
|
+
reference;
|
|
3646
|
+
onUpdate;
|
|
3647
|
+
onDelete;
|
|
3648
|
+
getName() {
|
|
3649
|
+
const { name, columns, foreignColumns } = this.reference();
|
|
3650
|
+
const columnNames = columns.map((column) => column.name);
|
|
3651
|
+
const foreignColumnNames = foreignColumns.map((column) => column.name);
|
|
3652
|
+
const chunks = [
|
|
3653
|
+
this.table[TableName],
|
|
3654
|
+
...columnNames,
|
|
3655
|
+
foreignColumns[0].table[TableName],
|
|
3656
|
+
...foreignColumnNames
|
|
3657
|
+
];
|
|
3658
|
+
return name ?? `${chunks.join("_")}_fk`;
|
|
3659
|
+
}
|
|
3660
|
+
};
|
|
3661
|
+
//#endregion
|
|
3662
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/unique-constraint.js
|
|
3663
|
+
function uniqueKeyName(table, columns) {
|
|
3664
|
+
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
3665
|
+
}
|
|
3666
|
+
//#endregion
|
|
3667
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/common.js
|
|
3668
|
+
var SQLiteColumnBuilder = class extends ColumnBuilder {
|
|
3669
|
+
static [entityKind] = "SQLiteColumnBuilder";
|
|
3670
|
+
foreignKeyConfigs = [];
|
|
3671
|
+
references(ref, actions = {}) {
|
|
3672
|
+
this.foreignKeyConfigs.push({
|
|
3673
|
+
ref,
|
|
3674
|
+
actions
|
|
3675
|
+
});
|
|
3676
|
+
return this;
|
|
3677
|
+
}
|
|
3678
|
+
unique(name) {
|
|
3679
|
+
this.config.isUnique = true;
|
|
3680
|
+
this.config.uniqueName = name;
|
|
3681
|
+
return this;
|
|
3682
|
+
}
|
|
3683
|
+
generatedAlwaysAs(as, config) {
|
|
3684
|
+
this.config.generated = {
|
|
3685
|
+
as,
|
|
3686
|
+
type: "always",
|
|
3687
|
+
mode: config?.mode ?? "virtual"
|
|
3688
|
+
};
|
|
3689
|
+
return this;
|
|
3690
|
+
}
|
|
3691
|
+
/** @internal */
|
|
3692
|
+
buildForeignKeys(column, table) {
|
|
3693
|
+
return this.foreignKeyConfigs.map(({ ref, actions }) => {
|
|
3694
|
+
return ((ref2, actions2) => {
|
|
3695
|
+
const builder = new ForeignKeyBuilder(() => {
|
|
3696
|
+
const foreignColumn = ref2();
|
|
3697
|
+
return {
|
|
3698
|
+
columns: [column],
|
|
3699
|
+
foreignColumns: [foreignColumn]
|
|
3700
|
+
};
|
|
3701
|
+
});
|
|
3702
|
+
if (actions2.onUpdate) builder.onUpdate(actions2.onUpdate);
|
|
3703
|
+
if (actions2.onDelete) builder.onDelete(actions2.onDelete);
|
|
3704
|
+
return builder.build(table);
|
|
3705
|
+
})(ref, actions);
|
|
3706
|
+
});
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
var SQLiteColumn = class extends Column {
|
|
3710
|
+
constructor(table, config) {
|
|
3711
|
+
if (!config.uniqueName) config.uniqueName = uniqueKeyName(table, [config.name]);
|
|
3712
|
+
super(table, config);
|
|
3713
|
+
this.table = table;
|
|
3714
|
+
}
|
|
3715
|
+
static [entityKind] = "SQLiteColumn";
|
|
3716
|
+
};
|
|
3717
|
+
//#endregion
|
|
3718
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/blob.js
|
|
3719
|
+
var SQLiteBigIntBuilder = class extends SQLiteColumnBuilder {
|
|
3720
|
+
static [entityKind] = "SQLiteBigIntBuilder";
|
|
3721
|
+
constructor(name) {
|
|
3722
|
+
super(name, "bigint", "SQLiteBigInt");
|
|
3723
|
+
}
|
|
3724
|
+
/** @internal */
|
|
3725
|
+
build(table) {
|
|
3726
|
+
return new SQLiteBigInt(table, this.config);
|
|
3727
|
+
}
|
|
3728
|
+
};
|
|
3729
|
+
var SQLiteBigInt = class extends SQLiteColumn {
|
|
3730
|
+
static [entityKind] = "SQLiteBigInt";
|
|
3731
|
+
getSQLType() {
|
|
3732
|
+
return "blob";
|
|
3733
|
+
}
|
|
3734
|
+
mapFromDriverValue(value) {
|
|
3735
|
+
if (typeof Buffer !== "undefined" && Buffer.from) {
|
|
3736
|
+
const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
|
|
3737
|
+
return BigInt(buf.toString("utf8"));
|
|
3738
|
+
}
|
|
3739
|
+
return BigInt(textDecoder.decode(value));
|
|
3740
|
+
}
|
|
3741
|
+
mapToDriverValue(value) {
|
|
3742
|
+
return Buffer.from(value.toString());
|
|
3743
|
+
}
|
|
3744
|
+
};
|
|
3745
|
+
var SQLiteBlobJsonBuilder = class extends SQLiteColumnBuilder {
|
|
3746
|
+
static [entityKind] = "SQLiteBlobJsonBuilder";
|
|
3747
|
+
constructor(name) {
|
|
3748
|
+
super(name, "json", "SQLiteBlobJson");
|
|
3749
|
+
}
|
|
3750
|
+
/** @internal */
|
|
3751
|
+
build(table) {
|
|
3752
|
+
return new SQLiteBlobJson(table, this.config);
|
|
3753
|
+
}
|
|
3754
|
+
};
|
|
3755
|
+
var SQLiteBlobJson = class extends SQLiteColumn {
|
|
3756
|
+
static [entityKind] = "SQLiteBlobJson";
|
|
3757
|
+
getSQLType() {
|
|
3758
|
+
return "blob";
|
|
3759
|
+
}
|
|
3760
|
+
mapFromDriverValue(value) {
|
|
3761
|
+
if (typeof Buffer !== "undefined" && Buffer.from) {
|
|
3762
|
+
const buf = Buffer.isBuffer(value) ? value : value instanceof ArrayBuffer ? Buffer.from(value) : value.buffer ? Buffer.from(value.buffer, value.byteOffset, value.byteLength) : Buffer.from(value);
|
|
3763
|
+
return JSON.parse(buf.toString("utf8"));
|
|
3764
|
+
}
|
|
3765
|
+
return JSON.parse(textDecoder.decode(value));
|
|
3766
|
+
}
|
|
3767
|
+
mapToDriverValue(value) {
|
|
3768
|
+
return Buffer.from(JSON.stringify(value));
|
|
3769
|
+
}
|
|
3770
|
+
};
|
|
3771
|
+
var SQLiteBlobBufferBuilder = class extends SQLiteColumnBuilder {
|
|
3772
|
+
static [entityKind] = "SQLiteBlobBufferBuilder";
|
|
3773
|
+
constructor(name) {
|
|
3774
|
+
super(name, "buffer", "SQLiteBlobBuffer");
|
|
3775
|
+
}
|
|
3776
|
+
/** @internal */
|
|
3777
|
+
build(table) {
|
|
3778
|
+
return new SQLiteBlobBuffer(table, this.config);
|
|
3779
|
+
}
|
|
3780
|
+
};
|
|
3781
|
+
var SQLiteBlobBuffer = class extends SQLiteColumn {
|
|
3782
|
+
static [entityKind] = "SQLiteBlobBuffer";
|
|
3783
|
+
mapFromDriverValue(value) {
|
|
3784
|
+
if (Buffer.isBuffer(value)) return value;
|
|
3785
|
+
return Buffer.from(value);
|
|
3786
|
+
}
|
|
3787
|
+
getSQLType() {
|
|
3788
|
+
return "blob";
|
|
3789
|
+
}
|
|
3790
|
+
};
|
|
3791
|
+
function blob(a, b) {
|
|
3792
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3793
|
+
if (config?.mode === "json") return new SQLiteBlobJsonBuilder(name);
|
|
3794
|
+
if (config?.mode === "bigint") return new SQLiteBigIntBuilder(name);
|
|
3795
|
+
return new SQLiteBlobBufferBuilder(name);
|
|
3796
|
+
}
|
|
3797
|
+
//#endregion
|
|
3798
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/custom.js
|
|
3799
|
+
var SQLiteCustomColumnBuilder = class extends SQLiteColumnBuilder {
|
|
3800
|
+
static [entityKind] = "SQLiteCustomColumnBuilder";
|
|
3801
|
+
constructor(name, fieldConfig, customTypeParams) {
|
|
3802
|
+
super(name, "custom", "SQLiteCustomColumn");
|
|
3803
|
+
this.config.fieldConfig = fieldConfig;
|
|
3804
|
+
this.config.customTypeParams = customTypeParams;
|
|
3805
|
+
}
|
|
3806
|
+
/** @internal */
|
|
3807
|
+
build(table) {
|
|
3808
|
+
return new SQLiteCustomColumn(table, this.config);
|
|
3809
|
+
}
|
|
3810
|
+
};
|
|
3811
|
+
var SQLiteCustomColumn = class extends SQLiteColumn {
|
|
3812
|
+
static [entityKind] = "SQLiteCustomColumn";
|
|
3813
|
+
sqlName;
|
|
3814
|
+
mapTo;
|
|
3815
|
+
mapFrom;
|
|
3816
|
+
constructor(table, config) {
|
|
3817
|
+
super(table, config);
|
|
3818
|
+
this.sqlName = config.customTypeParams.dataType(config.fieldConfig);
|
|
3819
|
+
this.mapTo = config.customTypeParams.toDriver;
|
|
3820
|
+
this.mapFrom = config.customTypeParams.fromDriver;
|
|
3821
|
+
}
|
|
3822
|
+
getSQLType() {
|
|
3823
|
+
return this.sqlName;
|
|
3824
|
+
}
|
|
3825
|
+
mapFromDriverValue(value) {
|
|
3826
|
+
return typeof this.mapFrom === "function" ? this.mapFrom(value) : value;
|
|
3827
|
+
}
|
|
3828
|
+
mapToDriverValue(value) {
|
|
3829
|
+
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
|
|
3830
|
+
}
|
|
3831
|
+
};
|
|
3832
|
+
function customType(customTypeParams) {
|
|
3833
|
+
return (a, b) => {
|
|
3834
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3835
|
+
return new SQLiteCustomColumnBuilder(name, config, customTypeParams);
|
|
3836
|
+
};
|
|
3837
|
+
}
|
|
3838
|
+
//#endregion
|
|
3839
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/integer.js
|
|
3840
|
+
var SQLiteBaseIntegerBuilder = class extends SQLiteColumnBuilder {
|
|
3841
|
+
static [entityKind] = "SQLiteBaseIntegerBuilder";
|
|
3842
|
+
constructor(name, dataType, columnType) {
|
|
3843
|
+
super(name, dataType, columnType);
|
|
3844
|
+
this.config.autoIncrement = false;
|
|
3845
|
+
}
|
|
3846
|
+
primaryKey(config) {
|
|
3847
|
+
if (config?.autoIncrement) this.config.autoIncrement = true;
|
|
3848
|
+
this.config.hasDefault = true;
|
|
3849
|
+
return super.primaryKey();
|
|
3850
|
+
}
|
|
3851
|
+
};
|
|
3852
|
+
var SQLiteBaseInteger = class extends SQLiteColumn {
|
|
3853
|
+
static [entityKind] = "SQLiteBaseInteger";
|
|
3854
|
+
autoIncrement = this.config.autoIncrement;
|
|
3855
|
+
getSQLType() {
|
|
3856
|
+
return "integer";
|
|
3857
|
+
}
|
|
3858
|
+
};
|
|
3859
|
+
var SQLiteIntegerBuilder = class extends SQLiteBaseIntegerBuilder {
|
|
3860
|
+
static [entityKind] = "SQLiteIntegerBuilder";
|
|
3861
|
+
constructor(name) {
|
|
3862
|
+
super(name, "number", "SQLiteInteger");
|
|
3863
|
+
}
|
|
3864
|
+
build(table) {
|
|
3865
|
+
return new SQLiteInteger(table, this.config);
|
|
3866
|
+
}
|
|
3867
|
+
};
|
|
3868
|
+
var SQLiteInteger = class extends SQLiteBaseInteger {
|
|
3869
|
+
static [entityKind] = "SQLiteInteger";
|
|
3870
|
+
};
|
|
3871
|
+
var SQLiteTimestampBuilder = class extends SQLiteBaseIntegerBuilder {
|
|
3872
|
+
static [entityKind] = "SQLiteTimestampBuilder";
|
|
3873
|
+
constructor(name, mode) {
|
|
3874
|
+
super(name, "date", "SQLiteTimestamp");
|
|
3875
|
+
this.config.mode = mode;
|
|
3876
|
+
}
|
|
3877
|
+
/**
|
|
3878
|
+
* @deprecated Use `default()` with your own expression instead.
|
|
3879
|
+
*
|
|
3880
|
+
* Adds `DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer))` to the column, which is the current epoch timestamp in milliseconds.
|
|
3881
|
+
*/
|
|
3882
|
+
defaultNow() {
|
|
3883
|
+
return this.default(sql`(cast((julianday('now') - 2440587.5)*86400000 as integer))`);
|
|
3884
|
+
}
|
|
3885
|
+
build(table) {
|
|
3886
|
+
return new SQLiteTimestamp(table, this.config);
|
|
3887
|
+
}
|
|
3888
|
+
};
|
|
3889
|
+
var SQLiteTimestamp = class extends SQLiteBaseInteger {
|
|
3890
|
+
static [entityKind] = "SQLiteTimestamp";
|
|
3891
|
+
mode = this.config.mode;
|
|
3892
|
+
mapFromDriverValue(value) {
|
|
3893
|
+
if (this.config.mode === "timestamp") return /* @__PURE__ */ new Date(value * 1e3);
|
|
3894
|
+
return new Date(value);
|
|
3895
|
+
}
|
|
3896
|
+
mapToDriverValue(value) {
|
|
3897
|
+
const unix = value.getTime();
|
|
3898
|
+
if (this.config.mode === "timestamp") return Math.floor(unix / 1e3);
|
|
3899
|
+
return unix;
|
|
3900
|
+
}
|
|
3901
|
+
};
|
|
3902
|
+
var SQLiteBooleanBuilder = class extends SQLiteBaseIntegerBuilder {
|
|
3903
|
+
static [entityKind] = "SQLiteBooleanBuilder";
|
|
3904
|
+
constructor(name, mode) {
|
|
3905
|
+
super(name, "boolean", "SQLiteBoolean");
|
|
3906
|
+
this.config.mode = mode;
|
|
3907
|
+
}
|
|
3908
|
+
build(table) {
|
|
3909
|
+
return new SQLiteBoolean(table, this.config);
|
|
3910
|
+
}
|
|
3911
|
+
};
|
|
3912
|
+
var SQLiteBoolean = class extends SQLiteBaseInteger {
|
|
3913
|
+
static [entityKind] = "SQLiteBoolean";
|
|
3914
|
+
mode = this.config.mode;
|
|
3915
|
+
mapFromDriverValue(value) {
|
|
3916
|
+
return Number(value) === 1;
|
|
3917
|
+
}
|
|
3918
|
+
mapToDriverValue(value) {
|
|
3919
|
+
return value ? 1 : 0;
|
|
3920
|
+
}
|
|
3921
|
+
};
|
|
3922
|
+
function integer(a, b) {
|
|
3923
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3924
|
+
if (config?.mode === "timestamp" || config?.mode === "timestamp_ms") return new SQLiteTimestampBuilder(name, config.mode);
|
|
3925
|
+
if (config?.mode === "boolean") return new SQLiteBooleanBuilder(name, config.mode);
|
|
3926
|
+
return new SQLiteIntegerBuilder(name);
|
|
3927
|
+
}
|
|
3928
|
+
//#endregion
|
|
3929
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/numeric.js
|
|
3930
|
+
var SQLiteNumericBuilder = class extends SQLiteColumnBuilder {
|
|
3931
|
+
static [entityKind] = "SQLiteNumericBuilder";
|
|
3932
|
+
constructor(name) {
|
|
3933
|
+
super(name, "string", "SQLiteNumeric");
|
|
3934
|
+
}
|
|
3935
|
+
/** @internal */
|
|
3936
|
+
build(table) {
|
|
3937
|
+
return new SQLiteNumeric(table, this.config);
|
|
3938
|
+
}
|
|
3939
|
+
};
|
|
3940
|
+
var SQLiteNumeric = class extends SQLiteColumn {
|
|
3941
|
+
static [entityKind] = "SQLiteNumeric";
|
|
3942
|
+
mapFromDriverValue(value) {
|
|
3943
|
+
if (typeof value === "string") return value;
|
|
3944
|
+
return String(value);
|
|
3945
|
+
}
|
|
3946
|
+
getSQLType() {
|
|
3947
|
+
return "numeric";
|
|
3948
|
+
}
|
|
3949
|
+
};
|
|
3950
|
+
var SQLiteNumericNumberBuilder = class extends SQLiteColumnBuilder {
|
|
3951
|
+
static [entityKind] = "SQLiteNumericNumberBuilder";
|
|
3952
|
+
constructor(name) {
|
|
3953
|
+
super(name, "number", "SQLiteNumericNumber");
|
|
3954
|
+
}
|
|
3955
|
+
/** @internal */
|
|
3956
|
+
build(table) {
|
|
3957
|
+
return new SQLiteNumericNumber(table, this.config);
|
|
3958
|
+
}
|
|
3959
|
+
};
|
|
3960
|
+
var SQLiteNumericNumber = class extends SQLiteColumn {
|
|
3961
|
+
static [entityKind] = "SQLiteNumericNumber";
|
|
3962
|
+
mapFromDriverValue(value) {
|
|
3963
|
+
if (typeof value === "number") return value;
|
|
3964
|
+
return Number(value);
|
|
3965
|
+
}
|
|
3966
|
+
mapToDriverValue = String;
|
|
3967
|
+
getSQLType() {
|
|
3968
|
+
return "numeric";
|
|
3969
|
+
}
|
|
3970
|
+
};
|
|
3971
|
+
var SQLiteNumericBigIntBuilder = class extends SQLiteColumnBuilder {
|
|
3972
|
+
static [entityKind] = "SQLiteNumericBigIntBuilder";
|
|
3973
|
+
constructor(name) {
|
|
3974
|
+
super(name, "bigint", "SQLiteNumericBigInt");
|
|
3975
|
+
}
|
|
3976
|
+
/** @internal */
|
|
3977
|
+
build(table) {
|
|
3978
|
+
return new SQLiteNumericBigInt(table, this.config);
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
var SQLiteNumericBigInt = class extends SQLiteColumn {
|
|
3982
|
+
static [entityKind] = "SQLiteNumericBigInt";
|
|
3983
|
+
mapFromDriverValue = BigInt;
|
|
3984
|
+
mapToDriverValue = String;
|
|
3985
|
+
getSQLType() {
|
|
3986
|
+
return "numeric";
|
|
3987
|
+
}
|
|
3988
|
+
};
|
|
3989
|
+
function numeric(a, b) {
|
|
3990
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
3991
|
+
const mode = config?.mode;
|
|
3992
|
+
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
|
|
3993
|
+
}
|
|
3994
|
+
//#endregion
|
|
3995
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/real.js
|
|
3996
|
+
var SQLiteRealBuilder = class extends SQLiteColumnBuilder {
|
|
3997
|
+
static [entityKind] = "SQLiteRealBuilder";
|
|
3998
|
+
constructor(name) {
|
|
3999
|
+
super(name, "number", "SQLiteReal");
|
|
4000
|
+
}
|
|
4001
|
+
/** @internal */
|
|
4002
|
+
build(table) {
|
|
4003
|
+
return new SQLiteReal(table, this.config);
|
|
4004
|
+
}
|
|
4005
|
+
};
|
|
4006
|
+
var SQLiteReal = class extends SQLiteColumn {
|
|
4007
|
+
static [entityKind] = "SQLiteReal";
|
|
4008
|
+
getSQLType() {
|
|
4009
|
+
return "real";
|
|
4010
|
+
}
|
|
4011
|
+
};
|
|
4012
|
+
function real(name) {
|
|
4013
|
+
return new SQLiteRealBuilder(name ?? "");
|
|
4014
|
+
}
|
|
4015
|
+
//#endregion
|
|
4016
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/text.js
|
|
4017
|
+
var SQLiteTextBuilder = class extends SQLiteColumnBuilder {
|
|
4018
|
+
static [entityKind] = "SQLiteTextBuilder";
|
|
4019
|
+
constructor(name, config) {
|
|
4020
|
+
super(name, "string", "SQLiteText");
|
|
4021
|
+
this.config.enumValues = config.enum;
|
|
4022
|
+
this.config.length = config.length;
|
|
4023
|
+
}
|
|
4024
|
+
/** @internal */
|
|
4025
|
+
build(table) {
|
|
4026
|
+
return new SQLiteText(table, this.config);
|
|
4027
|
+
}
|
|
4028
|
+
};
|
|
4029
|
+
var SQLiteText = class extends SQLiteColumn {
|
|
4030
|
+
static [entityKind] = "SQLiteText";
|
|
4031
|
+
enumValues = this.config.enumValues;
|
|
4032
|
+
length = this.config.length;
|
|
4033
|
+
constructor(table, config) {
|
|
4034
|
+
super(table, config);
|
|
4035
|
+
}
|
|
4036
|
+
getSQLType() {
|
|
4037
|
+
return `text${this.config.length ? `(${this.config.length})` : ""}`;
|
|
4038
|
+
}
|
|
4039
|
+
};
|
|
4040
|
+
var SQLiteTextJsonBuilder = class extends SQLiteColumnBuilder {
|
|
4041
|
+
static [entityKind] = "SQLiteTextJsonBuilder";
|
|
4042
|
+
constructor(name) {
|
|
4043
|
+
super(name, "json", "SQLiteTextJson");
|
|
4044
|
+
}
|
|
4045
|
+
/** @internal */
|
|
4046
|
+
build(table) {
|
|
4047
|
+
return new SQLiteTextJson(table, this.config);
|
|
4048
|
+
}
|
|
4049
|
+
};
|
|
4050
|
+
var SQLiteTextJson = class extends SQLiteColumn {
|
|
4051
|
+
static [entityKind] = "SQLiteTextJson";
|
|
4052
|
+
getSQLType() {
|
|
4053
|
+
return "text";
|
|
4054
|
+
}
|
|
4055
|
+
mapFromDriverValue(value) {
|
|
4056
|
+
return JSON.parse(value);
|
|
4057
|
+
}
|
|
4058
|
+
mapToDriverValue(value) {
|
|
4059
|
+
return JSON.stringify(value);
|
|
4060
|
+
}
|
|
4061
|
+
};
|
|
4062
|
+
function text(a, b = {}) {
|
|
4063
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
4064
|
+
if (config.mode === "json") return new SQLiteTextJsonBuilder(name);
|
|
4065
|
+
return new SQLiteTextBuilder(name, config);
|
|
4066
|
+
}
|
|
4067
|
+
//#endregion
|
|
4068
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/columns/all.js
|
|
4069
|
+
function getSQLiteColumnBuilders() {
|
|
4070
|
+
return {
|
|
4071
|
+
blob,
|
|
4072
|
+
customType,
|
|
4073
|
+
integer,
|
|
4074
|
+
numeric,
|
|
4075
|
+
real,
|
|
4076
|
+
text
|
|
4077
|
+
};
|
|
4078
|
+
}
|
|
4079
|
+
//#endregion
|
|
4080
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/table.js
|
|
4081
|
+
const InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
|
4082
|
+
var SQLiteTable = class extends Table {
|
|
4083
|
+
static [entityKind] = "SQLiteTable";
|
|
4084
|
+
/** @internal */
|
|
4085
|
+
static Symbol = Object.assign({}, Table.Symbol, { InlineForeignKeys });
|
|
4086
|
+
/** @internal */
|
|
4087
|
+
[Table.Symbol.Columns];
|
|
4088
|
+
/** @internal */
|
|
4089
|
+
[InlineForeignKeys] = [];
|
|
4090
|
+
/** @internal */
|
|
4091
|
+
[Table.Symbol.ExtraConfigBuilder] = void 0;
|
|
4092
|
+
};
|
|
4093
|
+
function sqliteTableBase(name, columns, extraConfig, schema, baseName = name) {
|
|
4094
|
+
const rawTable = new SQLiteTable(name, schema, baseName);
|
|
4095
|
+
const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns;
|
|
4096
|
+
const builtColumns = Object.fromEntries(Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
|
|
4097
|
+
const colBuilder = colBuilderBase;
|
|
4098
|
+
colBuilder.setName(name2);
|
|
4099
|
+
const column = colBuilder.build(rawTable);
|
|
4100
|
+
rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));
|
|
4101
|
+
return [name2, column];
|
|
4102
|
+
}));
|
|
4103
|
+
const table = Object.assign(rawTable, builtColumns);
|
|
4104
|
+
table[Table.Symbol.Columns] = builtColumns;
|
|
4105
|
+
table[Table.Symbol.ExtraConfigColumns] = builtColumns;
|
|
4106
|
+
if (extraConfig) table[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig;
|
|
4107
|
+
return table;
|
|
4108
|
+
}
|
|
4109
|
+
const sqliteTable = (name, columns, extraConfig) => {
|
|
4110
|
+
return sqliteTableBase(name, columns, extraConfig);
|
|
4111
|
+
};
|
|
4112
|
+
//#endregion
|
|
4113
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+better-sqlite3@7.6.13_@types+pg@8.20_77911661b3ede76946c974aead4d265f/node_modules/drizzle-orm/sqlite-core/indexes.js
|
|
4114
|
+
var IndexBuilderOn = class {
|
|
4115
|
+
constructor(name, unique) {
|
|
4116
|
+
this.name = name;
|
|
4117
|
+
this.unique = unique;
|
|
4118
|
+
}
|
|
4119
|
+
static [entityKind] = "SQLiteIndexBuilderOn";
|
|
4120
|
+
on(...columns) {
|
|
4121
|
+
return new IndexBuilder(this.name, columns, this.unique);
|
|
4122
|
+
}
|
|
4123
|
+
};
|
|
4124
|
+
var IndexBuilder = class {
|
|
4125
|
+
static [entityKind] = "SQLiteIndexBuilder";
|
|
4126
|
+
/** @internal */
|
|
4127
|
+
config;
|
|
4128
|
+
constructor(name, columns, unique) {
|
|
4129
|
+
this.config = {
|
|
4130
|
+
name,
|
|
4131
|
+
columns,
|
|
4132
|
+
unique,
|
|
4133
|
+
where: void 0
|
|
4134
|
+
};
|
|
4135
|
+
}
|
|
4136
|
+
/**
|
|
4137
|
+
* Condition for partial index.
|
|
4138
|
+
*/
|
|
4139
|
+
where(condition) {
|
|
4140
|
+
this.config.where = condition;
|
|
4141
|
+
return this;
|
|
4142
|
+
}
|
|
4143
|
+
/** @internal */
|
|
4144
|
+
build(table) {
|
|
4145
|
+
return new Index(this.config, table);
|
|
4146
|
+
}
|
|
4147
|
+
};
|
|
4148
|
+
var Index = class {
|
|
4149
|
+
static [entityKind] = "SQLiteIndex";
|
|
4150
|
+
config;
|
|
4151
|
+
constructor(config, table) {
|
|
4152
|
+
this.config = {
|
|
4153
|
+
...config,
|
|
4154
|
+
table
|
|
4155
|
+
};
|
|
4156
|
+
}
|
|
4157
|
+
};
|
|
4158
|
+
function index(name) {
|
|
4159
|
+
return new IndexBuilderOn(name, false);
|
|
4160
|
+
}
|
|
4161
|
+
function getDatabaseHandle() {
|
|
4162
|
+
throw new Error("Database not initialized. Call initDatabase() before getDb().");
|
|
4163
|
+
}
|
|
4164
|
+
const users = pgTable("users", {
|
|
4165
|
+
id: text$1("id").primaryKey(),
|
|
4166
|
+
name: text$1("name").notNull(),
|
|
4167
|
+
email: text$1("email").notNull().unique(),
|
|
4168
|
+
emailVerified: boolean("email_verified").notNull(),
|
|
4169
|
+
image: text$1("image"),
|
|
4170
|
+
preferences: jsonb("preferences"),
|
|
4171
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
4172
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
4173
|
+
});
|
|
4174
|
+
const usersSqlite = sqliteTable("users", {
|
|
4175
|
+
id: text("id").primaryKey(),
|
|
4176
|
+
name: text("name").notNull(),
|
|
4177
|
+
email: text("email").notNull().unique(),
|
|
4178
|
+
emailVerified: integer("email_verified", { mode: "boolean" }).notNull(),
|
|
4179
|
+
image: text("image"),
|
|
4180
|
+
preferences: text("preferences", { mode: "json" }),
|
|
4181
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
4182
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
4183
|
+
});
|
|
4184
|
+
const authAccounts = pgTable("accounts", {
|
|
4185
|
+
id: text$1("id").primaryKey(),
|
|
4186
|
+
accountId: text$1("account_id").notNull(),
|
|
4187
|
+
providerId: text$1("provider_id").notNull(),
|
|
4188
|
+
userId: text$1("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
4189
|
+
accessToken: text$1("access_token"),
|
|
4190
|
+
refreshToken: text$1("refresh_token"),
|
|
4191
|
+
idToken: text$1("id_token"),
|
|
4192
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at", { withTimezone: true }),
|
|
4193
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at", { withTimezone: true }),
|
|
4194
|
+
scope: text$1("scope"),
|
|
4195
|
+
password: text$1("password"),
|
|
4196
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
4197
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
4198
|
+
}, (table) => [index$1("account_user_id_idx").on(table.userId)]);
|
|
4199
|
+
const authAccountsSqlite = sqliteTable("accounts", {
|
|
4200
|
+
id: text("id").primaryKey(),
|
|
4201
|
+
accountId: text("account_id").notNull(),
|
|
4202
|
+
providerId: text("provider_id").notNull(),
|
|
4203
|
+
userId: text("user_id").notNull().references(() => usersSqlite.id, { onDelete: "cascade" }),
|
|
4204
|
+
accessToken: text("access_token"),
|
|
4205
|
+
refreshToken: text("refresh_token"),
|
|
4206
|
+
idToken: text("id_token"),
|
|
4207
|
+
accessTokenExpiresAt: integer("access_token_expires_at", { mode: "timestamp_ms" }),
|
|
4208
|
+
refreshTokenExpiresAt: integer("refresh_token_expires_at", { mode: "timestamp_ms" }),
|
|
4209
|
+
scope: text("scope"),
|
|
4210
|
+
password: text("password"),
|
|
4211
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
4212
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
4213
|
+
}, (table) => [index("account_user_id_idx").on(table.userId)]);
|
|
4214
|
+
const authDeviceCodes = pgTable("device_auth_codes", {
|
|
4215
|
+
id: text$1("id").primaryKey(),
|
|
4216
|
+
deviceCode: text$1("device_code").notNull(),
|
|
4217
|
+
userCode: text$1("user_code").notNull(),
|
|
4218
|
+
userId: text$1("user_id"),
|
|
4219
|
+
expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
|
|
4220
|
+
status: text$1("status").notNull(),
|
|
4221
|
+
lastPolledAt: timestamp("last_polled_at", { withTimezone: true }),
|
|
4222
|
+
pollingInterval: integer$1("polling_interval"),
|
|
4223
|
+
clientId: text$1("client_id"),
|
|
4224
|
+
scope: text$1("scope")
|
|
4225
|
+
});
|
|
4226
|
+
const authDeviceCodesSqlite = sqliteTable("device_auth_codes", {
|
|
4227
|
+
id: text("id").primaryKey(),
|
|
4228
|
+
deviceCode: text("device_code").notNull(),
|
|
4229
|
+
userCode: text("user_code").notNull(),
|
|
4230
|
+
userId: text("user_id"),
|
|
4231
|
+
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),
|
|
4232
|
+
status: text("status").notNull(),
|
|
4233
|
+
lastPolledAt: integer("last_polled_at", { mode: "timestamp_ms" }),
|
|
4234
|
+
pollingInterval: integer("polling_interval"),
|
|
4235
|
+
clientId: text("client_id"),
|
|
4236
|
+
scope: text("scope")
|
|
4237
|
+
});
|
|
4238
|
+
const authJwks = pgTable("jwks", {
|
|
4239
|
+
id: text$1("id").primaryKey(),
|
|
4240
|
+
publicKey: text$1("public_key").notNull(),
|
|
4241
|
+
privateKey: text$1("private_key").notNull(),
|
|
4242
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
4243
|
+
expiresAt: timestamp("expires_at", { withTimezone: true })
|
|
4244
|
+
});
|
|
4245
|
+
const authJwksSqlite = sqliteTable("jwks", {
|
|
4246
|
+
id: text("id").primaryKey(),
|
|
4247
|
+
publicKey: text("public_key").notNull(),
|
|
4248
|
+
privateKey: text("private_key").notNull(),
|
|
4249
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
4250
|
+
expiresAt: integer("expires_at", { mode: "timestamp_ms" })
|
|
4251
|
+
});
|
|
4252
|
+
const authSessions = pgTable("sessions", {
|
|
4253
|
+
id: text$1("id").primaryKey(),
|
|
4254
|
+
expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
|
|
4255
|
+
token: text$1("token").notNull().unique(),
|
|
4256
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
4257
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
4258
|
+
ipAddress: text$1("ip_address"),
|
|
4259
|
+
userAgent: text$1("user_agent"),
|
|
4260
|
+
userId: text$1("user_id").notNull().references(() => users.id, { onDelete: "cascade" })
|
|
4261
|
+
}, (table) => [index$1("session_user_id_idx").on(table.userId)]);
|
|
4262
|
+
const authSessionsSqlite = sqliteTable("sessions", {
|
|
4263
|
+
id: text("id").primaryKey(),
|
|
4264
|
+
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),
|
|
4265
|
+
token: text("token").notNull().unique(),
|
|
4266
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
4267
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
4268
|
+
ipAddress: text("ip_address"),
|
|
4269
|
+
userAgent: text("user_agent"),
|
|
4270
|
+
userId: text("user_id").notNull().references(() => usersSqlite.id, { onDelete: "cascade" })
|
|
4271
|
+
}, (table) => [index("session_user_id_idx").on(table.userId)]);
|
|
4272
|
+
const authVerifications = pgTable("verification", {
|
|
4273
|
+
id: text$1("id").primaryKey(),
|
|
4274
|
+
identifier: text$1("identifier").notNull(),
|
|
4275
|
+
value: text$1("value").notNull(),
|
|
4276
|
+
expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
|
|
4277
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
4278
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
4279
|
+
}, (table) => [index$1("verification_identifier_idx").on(table.identifier)]);
|
|
4280
|
+
const authVerificationsSqlite = sqliteTable("verification", {
|
|
4281
|
+
id: text("id").primaryKey(),
|
|
4282
|
+
identifier: text("identifier").notNull(),
|
|
4283
|
+
value: text("value").notNull(),
|
|
4284
|
+
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),
|
|
4285
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
4286
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
4287
|
+
}, (table) => [index("verification_identifier_idx").on(table.identifier)]);
|
|
4288
|
+
//#endregion
|
|
1299
4289
|
//#region ../../packages/platform-database/dist/schema/auth/index.mjs
|
|
1300
|
-
function authSchemaFor(dialect =
|
|
4290
|
+
function authSchemaFor(dialect = getDatabaseHandle().dialect) {
|
|
1301
4291
|
if (dialect === "sqlite") return {
|
|
1302
|
-
users:
|
|
1303
|
-
session:
|
|
1304
|
-
account:
|
|
1305
|
-
verification:
|
|
1306
|
-
deviceCode:
|
|
1307
|
-
jwks:
|
|
4292
|
+
users: usersSqlite,
|
|
4293
|
+
session: authSessionsSqlite,
|
|
4294
|
+
account: authAccountsSqlite,
|
|
4295
|
+
verification: authVerificationsSqlite,
|
|
4296
|
+
deviceCode: authDeviceCodesSqlite,
|
|
4297
|
+
jwks: authJwksSqlite
|
|
1308
4298
|
};
|
|
1309
4299
|
return {
|
|
1310
|
-
users
|
|
1311
|
-
session:
|
|
1312
|
-
account:
|
|
1313
|
-
verification:
|
|
1314
|
-
deviceCode:
|
|
1315
|
-
jwks:
|
|
4300
|
+
users,
|
|
4301
|
+
session: authSessions,
|
|
4302
|
+
account: authAccounts,
|
|
4303
|
+
verification: authVerifications,
|
|
4304
|
+
deviceCode: authDeviceCodes,
|
|
4305
|
+
jwks: authJwks
|
|
1316
4306
|
};
|
|
1317
4307
|
}
|
|
1318
|
-
function authDatabaseAdapterOptions(dialect =
|
|
4308
|
+
function authDatabaseAdapterOptions(dialect = getDatabaseHandle().dialect) {
|
|
1319
4309
|
return {
|
|
1320
4310
|
provider: dialect === "sqlite" ? "sqlite" : "pg",
|
|
1321
4311
|
schema: authSchemaFor(dialect)
|
|
@@ -1323,7 +4313,7 @@ function authDatabaseAdapterOptions(dialect = require_dist$4.getDatabaseHandle()
|
|
|
1323
4313
|
}
|
|
1324
4314
|
/** Better Auth database adapter wired to the active Drizzle handle. */
|
|
1325
4315
|
function createAuthDatabaseAdapter() {
|
|
1326
|
-
const { db } =
|
|
4316
|
+
const { db } = getDatabaseHandle();
|
|
1327
4317
|
const { provider, schema } = authDatabaseAdapterOptions();
|
|
1328
4318
|
return (0, _better_auth_drizzle_adapter.drizzleAdapter)(db, {
|
|
1329
4319
|
provider,
|
|
@@ -1356,7 +4346,7 @@ function createCliDeviceOrganizationPlugin() {
|
|
|
1356
4346
|
error: "invalid_request",
|
|
1357
4347
|
error_description: "Organization id is required"
|
|
1358
4348
|
});
|
|
1359
|
-
if (!await
|
|
4349
|
+
if (!await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(session.user.id, organizationId)) throw new better_auth_api.APIError("FORBIDDEN", {
|
|
1360
4350
|
error: "access_denied",
|
|
1361
4351
|
error_description: "You are not a member of this organization"
|
|
1362
4352
|
});
|
|
@@ -1493,8 +4483,8 @@ function resolveSocialProviders() {
|
|
|
1493
4483
|
return Object.keys(providers).length > 0 ? providers : void 0;
|
|
1494
4484
|
}
|
|
1495
4485
|
async function linkUserCreateBeforeHook(user) {
|
|
1496
|
-
const email =
|
|
1497
|
-
const existing = await
|
|
4486
|
+
const email = (0, _keystrokehq_platform_database.normalizeUserEmail)(user.email);
|
|
4487
|
+
const existing = await (0, _keystrokehq_platform_database.selectUserByNormalizedEmail)(email);
|
|
1498
4488
|
if (existing) return {
|
|
1499
4489
|
data: {
|
|
1500
4490
|
...user,
|
|
@@ -25112,43 +28102,43 @@ var tt = [
|
|
|
25112
28102
|
},
|
|
25113
28103
|
{
|
|
25114
28104
|
name: "cat",
|
|
25115
|
-
load: async () => (await Promise.resolve().then(() => require("./cat-TSFMZVYS-
|
|
28105
|
+
load: async () => (await Promise.resolve().then(() => require("./cat-TSFMZVYS-DA84HtAp.cjs"))).catCommand
|
|
25116
28106
|
},
|
|
25117
28107
|
{
|
|
25118
28108
|
name: "printf",
|
|
25119
|
-
load: async () => (await Promise.resolve().then(() => require("./printf-TWGXF445-
|
|
28109
|
+
load: async () => (await Promise.resolve().then(() => require("./printf-TWGXF445-B0tOxQT6.cjs"))).printfCommand
|
|
25120
28110
|
},
|
|
25121
28111
|
{
|
|
25122
28112
|
name: "ls",
|
|
25123
|
-
load: async () => (await Promise.resolve().then(() => require("./ls-ZJGQER7M-
|
|
28113
|
+
load: async () => (await Promise.resolve().then(() => require("./ls-ZJGQER7M-CynOwieQ.cjs"))).lsCommand
|
|
25124
28114
|
},
|
|
25125
28115
|
{
|
|
25126
28116
|
name: "mkdir",
|
|
25127
|
-
load: async () => (await Promise.resolve().then(() => require("./mkdir-MEPGZOB6-
|
|
28117
|
+
load: async () => (await Promise.resolve().then(() => require("./mkdir-MEPGZOB6-Z0WHNFtR.cjs"))).mkdirCommand
|
|
25128
28118
|
},
|
|
25129
28119
|
{
|
|
25130
28120
|
name: "rmdir",
|
|
25131
|
-
load: async () => (await Promise.resolve().then(() => require("./rmdir-OC4ZLPYA-
|
|
28121
|
+
load: async () => (await Promise.resolve().then(() => require("./rmdir-OC4ZLPYA-DrF3bZoQ.cjs"))).rmdirCommand
|
|
25132
28122
|
},
|
|
25133
28123
|
{
|
|
25134
28124
|
name: "touch",
|
|
25135
|
-
load: async () => (await Promise.resolve().then(() => require("./touch-UA33VN3N-
|
|
28125
|
+
load: async () => (await Promise.resolve().then(() => require("./touch-UA33VN3N-DIda6f8u.cjs"))).touchCommand
|
|
25136
28126
|
},
|
|
25137
28127
|
{
|
|
25138
28128
|
name: "rm",
|
|
25139
|
-
load: async () => (await Promise.resolve().then(() => require("./rm-SSGETQVQ-
|
|
28129
|
+
load: async () => (await Promise.resolve().then(() => require("./rm-SSGETQVQ-BSLrKStW.cjs"))).rmCommand
|
|
25140
28130
|
},
|
|
25141
28131
|
{
|
|
25142
28132
|
name: "cp",
|
|
25143
|
-
load: async () => (await Promise.resolve().then(() => require("./cp-BISAAS7A-
|
|
28133
|
+
load: async () => (await Promise.resolve().then(() => require("./cp-BISAAS7A-CPlXYVs4.cjs"))).cpCommand
|
|
25144
28134
|
},
|
|
25145
28135
|
{
|
|
25146
28136
|
name: "mv",
|
|
25147
|
-
load: async () => (await Promise.resolve().then(() => require("./mv-W5BIQ646-
|
|
28137
|
+
load: async () => (await Promise.resolve().then(() => require("./mv-W5BIQ646-tAPnueJb.cjs"))).mvCommand
|
|
25148
28138
|
},
|
|
25149
28139
|
{
|
|
25150
28140
|
name: "ln",
|
|
25151
|
-
load: async () => (await Promise.resolve().then(() => require("./ln-4LGSXXGD-
|
|
28141
|
+
load: async () => (await Promise.resolve().then(() => require("./ln-4LGSXXGD-DxTw2TAq.cjs"))).lnCommand
|
|
25152
28142
|
},
|
|
25153
28143
|
{
|
|
25154
28144
|
name: "chmod",
|
|
@@ -25164,15 +28154,15 @@ var tt = [
|
|
|
25164
28154
|
},
|
|
25165
28155
|
{
|
|
25166
28156
|
name: "head",
|
|
25167
|
-
load: async () => (await Promise.resolve().then(() => require("./head-442HYESI-
|
|
28157
|
+
load: async () => (await Promise.resolve().then(() => require("./head-442HYESI-Dh7Qcjzs.cjs"))).headCommand
|
|
25168
28158
|
},
|
|
25169
28159
|
{
|
|
25170
28160
|
name: "tail",
|
|
25171
|
-
load: async () => (await Promise.resolve().then(() => require("./tail-R4PCA2C4-
|
|
28161
|
+
load: async () => (await Promise.resolve().then(() => require("./tail-R4PCA2C4-CLtu5GPs.cjs"))).tailCommand
|
|
25172
28162
|
},
|
|
25173
28163
|
{
|
|
25174
28164
|
name: "wc",
|
|
25175
|
-
load: async () => (await Promise.resolve().then(() => require("./wc-LF7NU4LA-
|
|
28165
|
+
load: async () => (await Promise.resolve().then(() => require("./wc-LF7NU4LA-Ci3_hJug.cjs"))).wcCommand
|
|
25176
28166
|
},
|
|
25177
28167
|
{
|
|
25178
28168
|
name: "stat",
|
|
@@ -25180,95 +28170,95 @@ var tt = [
|
|
|
25180
28170
|
},
|
|
25181
28171
|
{
|
|
25182
28172
|
name: "grep",
|
|
25183
|
-
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-
|
|
28173
|
+
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-CnT0y0-P.cjs"))).grepCommand
|
|
25184
28174
|
},
|
|
25185
28175
|
{
|
|
25186
28176
|
name: "fgrep",
|
|
25187
|
-
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-
|
|
28177
|
+
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-CnT0y0-P.cjs"))).fgrepCommand
|
|
25188
28178
|
},
|
|
25189
28179
|
{
|
|
25190
28180
|
name: "egrep",
|
|
25191
|
-
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-
|
|
28181
|
+
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-CnT0y0-P.cjs"))).egrepCommand
|
|
25192
28182
|
},
|
|
25193
28183
|
{
|
|
25194
28184
|
name: "rg",
|
|
25195
|
-
load: async () => (await Promise.resolve().then(() => require("./rg-S4FXYXWB-
|
|
28185
|
+
load: async () => (await Promise.resolve().then(() => require("./rg-S4FXYXWB-ByK2CLxu.cjs"))).rgCommand
|
|
25196
28186
|
},
|
|
25197
28187
|
{
|
|
25198
28188
|
name: "sed",
|
|
25199
|
-
load: async () => (await Promise.resolve().then(() => require("./sed-S5UIK574-
|
|
28189
|
+
load: async () => (await Promise.resolve().then(() => require("./sed-S5UIK574-B3Klx8N4.cjs"))).sedCommand
|
|
25200
28190
|
},
|
|
25201
28191
|
{
|
|
25202
28192
|
name: "awk",
|
|
25203
|
-
load: async () => (await Promise.resolve().then(() => require("./awk2-LA3USKJP-
|
|
28193
|
+
load: async () => (await Promise.resolve().then(() => require("./awk2-LA3USKJP-Ddh1vPYe.cjs"))).awkCommand2
|
|
25204
28194
|
},
|
|
25205
28195
|
{
|
|
25206
28196
|
name: "sort",
|
|
25207
|
-
load: async () => (await Promise.resolve().then(() => require("./sort-SW2YEO5B-
|
|
28197
|
+
load: async () => (await Promise.resolve().then(() => require("./sort-SW2YEO5B-DIDExLis.cjs"))).sortCommand
|
|
25208
28198
|
},
|
|
25209
28199
|
{
|
|
25210
28200
|
name: "uniq",
|
|
25211
|
-
load: async () => (await Promise.resolve().then(() => require("./uniq-XSIZR6PB-
|
|
28201
|
+
load: async () => (await Promise.resolve().then(() => require("./uniq-XSIZR6PB-BhdgA9iI.cjs"))).uniqCommand
|
|
25212
28202
|
},
|
|
25213
28203
|
{
|
|
25214
28204
|
name: "comm",
|
|
25215
|
-
load: async () => (await Promise.resolve().then(() => require("./comm-VV2LDX2J-
|
|
28205
|
+
load: async () => (await Promise.resolve().then(() => require("./comm-VV2LDX2J-CSfuzlYr.cjs"))).commCommand
|
|
25216
28206
|
},
|
|
25217
28207
|
{
|
|
25218
28208
|
name: "cut",
|
|
25219
|
-
load: async () => (await Promise.resolve().then(() => require("./cut-OKARJCCV-
|
|
28209
|
+
load: async () => (await Promise.resolve().then(() => require("./cut-OKARJCCV-Ci0PtEgB.cjs"))).cutCommand
|
|
25220
28210
|
},
|
|
25221
28211
|
{
|
|
25222
28212
|
name: "paste",
|
|
25223
|
-
load: async () => (await Promise.resolve().then(() => require("./paste-7JC6S4DX-
|
|
28213
|
+
load: async () => (await Promise.resolve().then(() => require("./paste-7JC6S4DX-Bs8ByIXb.cjs"))).pasteCommand
|
|
25224
28214
|
},
|
|
25225
28215
|
{
|
|
25226
28216
|
name: "tr",
|
|
25227
|
-
load: async () => (await Promise.resolve().then(() => require("./tr-36LHWFRQ-
|
|
28217
|
+
load: async () => (await Promise.resolve().then(() => require("./tr-36LHWFRQ-COkRmY_6.cjs"))).trCommand
|
|
25228
28218
|
},
|
|
25229
28219
|
{
|
|
25230
28220
|
name: "rev",
|
|
25231
|
-
load: async () => (await Promise.resolve().then(() => require("./rev-5EHFX4EJ-
|
|
28221
|
+
load: async () => (await Promise.resolve().then(() => require("./rev-5EHFX4EJ-Cgya-Fo0.cjs"))).rev
|
|
25232
28222
|
},
|
|
25233
28223
|
{
|
|
25234
28224
|
name: "nl",
|
|
25235
|
-
load: async () => (await Promise.resolve().then(() => require("./nl-WSDW7I4O-
|
|
28225
|
+
load: async () => (await Promise.resolve().then(() => require("./nl-WSDW7I4O-BfBF-iiF.cjs"))).nl
|
|
25236
28226
|
},
|
|
25237
28227
|
{
|
|
25238
28228
|
name: "fold",
|
|
25239
|
-
load: async () => (await Promise.resolve().then(() => require("./fold-4TQNYMSW-
|
|
28229
|
+
load: async () => (await Promise.resolve().then(() => require("./fold-4TQNYMSW-DU7ysgn3.cjs"))).fold
|
|
25240
28230
|
},
|
|
25241
28231
|
{
|
|
25242
28232
|
name: "expand",
|
|
25243
|
-
load: async () => (await Promise.resolve().then(() => require("./expand-JSPG6VOP-
|
|
28233
|
+
load: async () => (await Promise.resolve().then(() => require("./expand-JSPG6VOP-DjHywCfM.cjs"))).expand
|
|
25244
28234
|
},
|
|
25245
28235
|
{
|
|
25246
28236
|
name: "unexpand",
|
|
25247
|
-
load: async () => (await Promise.resolve().then(() => require("./unexpand-CADSA4VO-
|
|
28237
|
+
load: async () => (await Promise.resolve().then(() => require("./unexpand-CADSA4VO-DekKk-hg.cjs"))).unexpand
|
|
25248
28238
|
},
|
|
25249
28239
|
{
|
|
25250
28240
|
name: "strings",
|
|
25251
|
-
load: async () => (await Promise.resolve().then(() => require("./strings-6WDHLGMX-
|
|
28241
|
+
load: async () => (await Promise.resolve().then(() => require("./strings-6WDHLGMX-D2bfJpyh.cjs"))).strings
|
|
25252
28242
|
},
|
|
25253
28243
|
{
|
|
25254
28244
|
name: "split",
|
|
25255
|
-
load: async () => (await Promise.resolve().then(() => require("./split-4KKZZXXE-
|
|
28245
|
+
load: async () => (await Promise.resolve().then(() => require("./split-4KKZZXXE-CSVvRIzD.cjs"))).split
|
|
25256
28246
|
},
|
|
25257
28247
|
{
|
|
25258
28248
|
name: "column",
|
|
25259
|
-
load: async () => (await Promise.resolve().then(() => require("./column-XT6UFXNQ-
|
|
28249
|
+
load: async () => (await Promise.resolve().then(() => require("./column-XT6UFXNQ-D-31htgy.cjs"))).column
|
|
25260
28250
|
},
|
|
25261
28251
|
{
|
|
25262
28252
|
name: "join",
|
|
25263
|
-
load: async () => (await Promise.resolve().then(() => require("./join-TBRGI3LQ-
|
|
28253
|
+
load: async () => (await Promise.resolve().then(() => require("./join-TBRGI3LQ-DR2e5mf6.cjs"))).join
|
|
25264
28254
|
},
|
|
25265
28255
|
{
|
|
25266
28256
|
name: "tee",
|
|
25267
|
-
load: async () => (await Promise.resolve().then(() => require("./tee-YUZ2FKCJ-
|
|
28257
|
+
load: async () => (await Promise.resolve().then(() => require("./tee-YUZ2FKCJ-BbxSWxw6.cjs"))).teeCommand
|
|
25268
28258
|
},
|
|
25269
28259
|
{
|
|
25270
28260
|
name: "find",
|
|
25271
|
-
load: async () => (await Promise.resolve().then(() => require("./find-INTH3OLC-
|
|
28261
|
+
load: async () => (await Promise.resolve().then(() => require("./find-INTH3OLC-B5hj2iWq.cjs"))).findCommand
|
|
25272
28262
|
},
|
|
25273
28263
|
{
|
|
25274
28264
|
name: "basename",
|
|
@@ -25280,19 +28270,19 @@ var tt = [
|
|
|
25280
28270
|
},
|
|
25281
28271
|
{
|
|
25282
28272
|
name: "tree",
|
|
25283
|
-
load: async () => (await Promise.resolve().then(() => require("./tree-YLD52CNT-
|
|
28273
|
+
load: async () => (await Promise.resolve().then(() => require("./tree-YLD52CNT-kZ9vPZ-R.cjs"))).treeCommand
|
|
25284
28274
|
},
|
|
25285
28275
|
{
|
|
25286
28276
|
name: "du",
|
|
25287
|
-
load: async () => (await Promise.resolve().then(() => require("./du-572XNP42-
|
|
28277
|
+
load: async () => (await Promise.resolve().then(() => require("./du-572XNP42-BnHmg4U2.cjs"))).duCommand
|
|
25288
28278
|
},
|
|
25289
28279
|
{
|
|
25290
28280
|
name: "env",
|
|
25291
|
-
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-
|
|
28281
|
+
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-BxusWRsf.cjs"))).envCommand
|
|
25292
28282
|
},
|
|
25293
28283
|
{
|
|
25294
28284
|
name: "printenv",
|
|
25295
|
-
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-
|
|
28285
|
+
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-BxusWRsf.cjs"))).printenvCommand
|
|
25296
28286
|
},
|
|
25297
28287
|
{
|
|
25298
28288
|
name: "alias",
|
|
@@ -25308,7 +28298,7 @@ var tt = [
|
|
|
25308
28298
|
},
|
|
25309
28299
|
{
|
|
25310
28300
|
name: "xargs",
|
|
25311
|
-
load: async () => (await Promise.resolve().then(() => require("./xargs-MGZPH7AX-
|
|
28301
|
+
load: async () => (await Promise.resolve().then(() => require("./xargs-MGZPH7AX-DNyBXxK4.cjs"))).xargsCommand
|
|
25312
28302
|
},
|
|
25313
28303
|
{
|
|
25314
28304
|
name: "true",
|
|
@@ -25324,23 +28314,23 @@ var tt = [
|
|
|
25324
28314
|
},
|
|
25325
28315
|
{
|
|
25326
28316
|
name: "bash",
|
|
25327
|
-
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-
|
|
28317
|
+
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-CSOYNHWg.cjs"))).bashCommand
|
|
25328
28318
|
},
|
|
25329
28319
|
{
|
|
25330
28320
|
name: "sh",
|
|
25331
|
-
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-
|
|
28321
|
+
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-CSOYNHWg.cjs"))).shCommand
|
|
25332
28322
|
},
|
|
25333
28323
|
{
|
|
25334
28324
|
name: "jq",
|
|
25335
|
-
load: async () => (await Promise.resolve().then(() => require("./jq-4XLYLOS5-
|
|
28325
|
+
load: async () => (await Promise.resolve().then(() => require("./jq-4XLYLOS5-CKdOTiVR.cjs"))).jqCommand
|
|
25336
28326
|
},
|
|
25337
28327
|
{
|
|
25338
28328
|
name: "base64",
|
|
25339
|
-
load: async () => (await Promise.resolve().then(() => require("./base64-C2AIWVNC-
|
|
28329
|
+
load: async () => (await Promise.resolve().then(() => require("./base64-C2AIWVNC-BaiY8WTm.cjs"))).base64Command
|
|
25340
28330
|
},
|
|
25341
28331
|
{
|
|
25342
28332
|
name: "diff",
|
|
25343
|
-
load: async () => (await Promise.resolve().then(() => require("./diff-MWJFIG7X-
|
|
28333
|
+
load: async () => (await Promise.resolve().then(() => require("./diff-MWJFIG7X-F82OACp-.cjs"))).diffCommand
|
|
25344
28334
|
},
|
|
25345
28335
|
{
|
|
25346
28336
|
name: "date",
|
|
@@ -25348,15 +28338,15 @@ var tt = [
|
|
|
25348
28338
|
},
|
|
25349
28339
|
{
|
|
25350
28340
|
name: "sleep",
|
|
25351
|
-
load: async () => (await Promise.resolve().then(() => require("./sleep-X22JJINO-
|
|
28341
|
+
load: async () => (await Promise.resolve().then(() => require("./sleep-X22JJINO-UJvessts.cjs"))).sleepCommand
|
|
25352
28342
|
},
|
|
25353
28343
|
{
|
|
25354
28344
|
name: "timeout",
|
|
25355
|
-
load: async () => (await Promise.resolve().then(() => require("./timeout-YDCRSLPQ-
|
|
28345
|
+
load: async () => (await Promise.resolve().then(() => require("./timeout-YDCRSLPQ-DEPvQ6Ih.cjs"))).timeoutCommand
|
|
25356
28346
|
},
|
|
25357
28347
|
{
|
|
25358
28348
|
name: "time",
|
|
25359
|
-
load: async () => (await Promise.resolve().then(() => require("./time-D4LNBSWX-
|
|
28349
|
+
load: async () => (await Promise.resolve().then(() => require("./time-D4LNBSWX-BQSWzFeK.cjs"))).timeCommand
|
|
25360
28350
|
},
|
|
25361
28351
|
{
|
|
25362
28352
|
name: "seq",
|
|
@@ -25364,19 +28354,19 @@ var tt = [
|
|
|
25364
28354
|
},
|
|
25365
28355
|
{
|
|
25366
28356
|
name: "expr",
|
|
25367
|
-
load: async () => (await Promise.resolve().then(() => require("./expr-5JAACS4X-
|
|
28357
|
+
load: async () => (await Promise.resolve().then(() => require("./expr-5JAACS4X-Df3xFZ4w.cjs"))).exprCommand
|
|
25368
28358
|
},
|
|
25369
28359
|
{
|
|
25370
28360
|
name: "md5sum",
|
|
25371
|
-
load: async () => (await Promise.resolve().then(() => require("./md5sum-SPU24VSG-
|
|
28361
|
+
load: async () => (await Promise.resolve().then(() => require("./md5sum-SPU24VSG-8_h79vAu.cjs"))).md5sumCommand
|
|
25372
28362
|
},
|
|
25373
28363
|
{
|
|
25374
28364
|
name: "sha1sum",
|
|
25375
|
-
load: async () => (await Promise.resolve().then(() => require("./sha1sum-2PTOAFR6-
|
|
28365
|
+
load: async () => (await Promise.resolve().then(() => require("./sha1sum-2PTOAFR6-Bl7iC2ql.cjs"))).sha1sumCommand
|
|
25376
28366
|
},
|
|
25377
28367
|
{
|
|
25378
28368
|
name: "sha256sum",
|
|
25379
|
-
load: async () => (await Promise.resolve().then(() => require("./sha256sum-NS7D3IXX-
|
|
28369
|
+
load: async () => (await Promise.resolve().then(() => require("./sha256sum-NS7D3IXX-DdD-z8yU.cjs"))).sha256sumCommand
|
|
25380
28370
|
},
|
|
25381
28371
|
{
|
|
25382
28372
|
name: "file",
|
|
@@ -25384,11 +28374,11 @@ var tt = [
|
|
|
25384
28374
|
},
|
|
25385
28375
|
{
|
|
25386
28376
|
name: "html-to-markdown",
|
|
25387
|
-
load: async () => (await Promise.resolve().then(() => require("./html-to-markdown-JW4MSQZO-
|
|
28377
|
+
load: async () => (await Promise.resolve().then(() => require("./html-to-markdown-JW4MSQZO-CD4oQKoL.cjs"))).htmlToMarkdownCommand
|
|
25388
28378
|
},
|
|
25389
28379
|
{
|
|
25390
28380
|
name: "help",
|
|
25391
|
-
load: async () => (await Promise.resolve().then(() => require("./help-HZ6M2CKN-
|
|
28381
|
+
load: async () => (await Promise.resolve().then(() => require("./help-HZ6M2CKN-pRM3zbwR.cjs"))).helpCommand
|
|
25392
28382
|
},
|
|
25393
28383
|
{
|
|
25394
28384
|
name: "which",
|
|
@@ -25396,7 +28386,7 @@ var tt = [
|
|
|
25396
28386
|
},
|
|
25397
28387
|
{
|
|
25398
28388
|
name: "tac",
|
|
25399
|
-
load: async () => (await Promise.resolve().then(() => require("./tac-2STMMJYW-
|
|
28389
|
+
load: async () => (await Promise.resolve().then(() => require("./tac-2STMMJYW-D0fFvjly.cjs"))).tac
|
|
25400
28390
|
},
|
|
25401
28391
|
{
|
|
25402
28392
|
name: "hostname",
|
|
@@ -25408,49 +28398,49 @@ var tt = [
|
|
|
25408
28398
|
},
|
|
25409
28399
|
{
|
|
25410
28400
|
name: "od",
|
|
25411
|
-
load: async () => (await Promise.resolve().then(() => require("./od-WOKFDJTP-
|
|
28401
|
+
load: async () => (await Promise.resolve().then(() => require("./od-WOKFDJTP-CHXPdcv9.cjs"))).od
|
|
25412
28402
|
},
|
|
25413
28403
|
{
|
|
25414
28404
|
name: "gzip",
|
|
25415
|
-
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-
|
|
28405
|
+
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-Dwnbh7Hd.cjs"))).gzipCommand
|
|
25416
28406
|
},
|
|
25417
28407
|
{
|
|
25418
28408
|
name: "gunzip",
|
|
25419
|
-
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-
|
|
28409
|
+
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-Dwnbh7Hd.cjs"))).gunzipCommand
|
|
25420
28410
|
},
|
|
25421
28411
|
{
|
|
25422
28412
|
name: "zcat",
|
|
25423
|
-
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-
|
|
28413
|
+
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-Dwnbh7Hd.cjs"))).zcatCommand
|
|
25424
28414
|
}
|
|
25425
28415
|
];
|
|
25426
28416
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (tt.push({
|
|
25427
28417
|
name: "tar",
|
|
25428
|
-
load: async () => (await Promise.resolve().then(() => require("./tar-STHHZTZ6-
|
|
28418
|
+
load: async () => (await Promise.resolve().then(() => require("./tar-STHHZTZ6-Bxk0yG7D.cjs"))).tarCommand
|
|
25429
28419
|
}), tt.push({
|
|
25430
28420
|
name: "yq",
|
|
25431
|
-
load: async () => (await Promise.resolve().then(() => require("./yq-4QJW3EQG-
|
|
28421
|
+
load: async () => (await Promise.resolve().then(() => require("./yq-4QJW3EQG-9kH_HlxF.cjs"))).yqCommand
|
|
25432
28422
|
}), tt.push({
|
|
25433
28423
|
name: "xan",
|
|
25434
|
-
load: async () => (await Promise.resolve().then(() => require("./xan-Y6WF3IRG-
|
|
28424
|
+
load: async () => (await Promise.resolve().then(() => require("./xan-Y6WF3IRG-EnrntEIM.cjs"))).xanCommand
|
|
25435
28425
|
}), tt.push({
|
|
25436
28426
|
name: "sqlite3",
|
|
25437
|
-
load: async () => (await Promise.resolve().then(() => require("./sqlite3-CGOEFJAO-
|
|
28427
|
+
load: async () => (await Promise.resolve().then(() => require("./sqlite3-CGOEFJAO-DTNqDMXu.cjs"))).sqlite3Command
|
|
25438
28428
|
}));
|
|
25439
28429
|
var Yt = [];
|
|
25440
28430
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (Yt.push({
|
|
25441
28431
|
name: "python3",
|
|
25442
|
-
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-
|
|
28432
|
+
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-DYjQ3ccZ.cjs"))).python3Command
|
|
25443
28433
|
}), Yt.push({
|
|
25444
28434
|
name: "python",
|
|
25445
|
-
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-
|
|
28435
|
+
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-DYjQ3ccZ.cjs"))).pythonCommand
|
|
25446
28436
|
}));
|
|
25447
28437
|
var Qt = [];
|
|
25448
28438
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (Qt.push({
|
|
25449
28439
|
name: "js-exec",
|
|
25450
|
-
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-
|
|
28440
|
+
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-8xgWmlL7.cjs"))).jsExecCommand
|
|
25451
28441
|
}), Qt.push({
|
|
25452
28442
|
name: "node",
|
|
25453
|
-
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-
|
|
28443
|
+
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-8xgWmlL7.cjs"))).nodeStubCommand
|
|
25454
28444
|
}));
|
|
25455
28445
|
new TextEncoder();
|
|
25456
28446
|
Object.freeze({
|
|
@@ -25938,7 +28928,7 @@ function decryptSecretPayload(ciphertext) {
|
|
|
25938
28928
|
return Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
|
|
25939
28929
|
}
|
|
25940
28930
|
function usePlatformStore() {
|
|
25941
|
-
return
|
|
28931
|
+
return (0, _keystrokehq_platform_database.getOrganizationScopeId)() !== void 0;
|
|
25942
28932
|
}
|
|
25943
28933
|
function assertOrganizationScope() {
|
|
25944
28934
|
if (!usePlatformStore()) throw new Error("Secret store requires organization scope");
|
|
@@ -25947,7 +28937,7 @@ function createSecretStore() {
|
|
|
25947
28937
|
return {
|
|
25948
28938
|
async get(ref) {
|
|
25949
28939
|
assertOrganizationScope();
|
|
25950
|
-
const row = await
|
|
28940
|
+
const row = await (0, _keystrokehq_platform_database.selectSecretValue)(ref.kind, ref.id, ref.field);
|
|
25951
28941
|
if (!row) return null;
|
|
25952
28942
|
return decryptSecretPayload(row.ciphertext);
|
|
25953
28943
|
},
|
|
@@ -25955,7 +28945,7 @@ function createSecretStore() {
|
|
|
25955
28945
|
assertOrganizationScope();
|
|
25956
28946
|
const now = /* @__PURE__ */ new Date();
|
|
25957
28947
|
const ciphertext = encryptSecretPayload(plaintext);
|
|
25958
|
-
await
|
|
28948
|
+
await (0, _keystrokehq_platform_database.upsertSecretValue)({
|
|
25959
28949
|
id: crypto.randomUUID(),
|
|
25960
28950
|
refKind: ref.kind,
|
|
25961
28951
|
refId: ref.id,
|
|
@@ -25967,7 +28957,7 @@ function createSecretStore() {
|
|
|
25967
28957
|
},
|
|
25968
28958
|
async deleteRef(kind, id) {
|
|
25969
28959
|
assertOrganizationScope();
|
|
25970
|
-
await
|
|
28960
|
+
await (0, _keystrokehq_platform_database.deleteSecretValuesForRef)(kind, id);
|
|
25971
28961
|
}
|
|
25972
28962
|
};
|
|
25973
28963
|
}
|
|
@@ -25980,7 +28970,7 @@ async function setCredentialInstanceSecret(options) {
|
|
|
25980
28970
|
scopeId: options.scopeId,
|
|
25981
28971
|
exceptId: options.id
|
|
25982
28972
|
});
|
|
25983
|
-
if (
|
|
28973
|
+
if ((0, _keystrokehq_platform_database.getOrganizationScopeId)() !== void 0) {
|
|
25984
28974
|
await (0, _keystrokehq_database.upsertCredentialInstance)({
|
|
25985
28975
|
id: options.id,
|
|
25986
28976
|
slug: options.key,
|
|
@@ -26016,7 +29006,7 @@ async function setCredentialInstanceSecret(options) {
|
|
|
26016
29006
|
});
|
|
26017
29007
|
}
|
|
26018
29008
|
async function readCredentialInstanceSecret(instanceId) {
|
|
26019
|
-
if (
|
|
29009
|
+
if ((0, _keystrokehq_platform_database.getOrganizationScopeId)() === void 0) return null;
|
|
26020
29010
|
return createSecretStore().get({
|
|
26021
29011
|
kind: "credential_instance",
|
|
26022
29012
|
id: instanceId,
|
|
@@ -26024,7 +29014,7 @@ async function readCredentialInstanceSecret(instanceId) {
|
|
|
26024
29014
|
});
|
|
26025
29015
|
}
|
|
26026
29016
|
async function deleteCredentialInstanceSecret(instanceId) {
|
|
26027
|
-
if (
|
|
29017
|
+
if ((0, _keystrokehq_platform_database.getOrganizationScopeId)() === void 0) return;
|
|
26028
29018
|
await createSecretStore().deleteRef("credential_instance", instanceId);
|
|
26029
29019
|
}
|
|
26030
29020
|
//#endregion
|
|
@@ -47930,11 +50920,11 @@ async function resolveDeployManifest(input) {
|
|
|
47930
50920
|
}
|
|
47931
50921
|
/** Cut over activeArtifactId, then sync org project registry from the artifact manifest. */
|
|
47932
50922
|
async function promoteProjectDeploy(input) {
|
|
47933
|
-
const project = await
|
|
50923
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectById)(input.projectId);
|
|
47934
50924
|
if (!project) throw new Error(`Project ${input.projectId} not found`);
|
|
47935
|
-
const artifact = await
|
|
50925
|
+
const artifact = await (0, _keystrokehq_platform_database.selectProjectArtifactById)(input.artifactId);
|
|
47936
50926
|
if (!artifact || artifact.projectId !== input.projectId) throw new Error(`Artifact ${input.artifactId} not found for project ${input.projectId}`);
|
|
47937
|
-
const organization = await
|
|
50927
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
47938
50928
|
if (!organization) throw new Error(`Organization not found for project ${input.projectId}`);
|
|
47939
50929
|
if (!input.artifactBytes && artifact.manifestJson == null) throw new require_dist$2.RouteManifestNotFoundError("Artifact has no stored route manifest; rebuild and redeploy");
|
|
47940
50930
|
const manifest = await resolveDeployManifest({
|
|
@@ -47942,18 +50932,18 @@ async function promoteProjectDeploy(input) {
|
|
|
47942
50932
|
artifactManifest: artifact.manifestJson,
|
|
47943
50933
|
artifactBytes: input.artifactBytes ?? Buffer.alloc(0)
|
|
47944
50934
|
});
|
|
47945
|
-
if (artifact.manifestJson == null) await
|
|
50935
|
+
if (artifact.manifestJson == null) await (0, _keystrokehq_platform_database.updateProjectArtifactManifest)({
|
|
47946
50936
|
artifactId: input.artifactId,
|
|
47947
50937
|
manifestJson: manifest
|
|
47948
50938
|
});
|
|
47949
|
-
if (project.pendingArtifactId === input.artifactId) await
|
|
50939
|
+
if (project.pendingArtifactId === input.artifactId) await (0, _keystrokehq_platform_database.promoteProjectArtifact)({
|
|
47950
50940
|
projectId: input.projectId,
|
|
47951
50941
|
artifactId: input.artifactId
|
|
47952
50942
|
});
|
|
47953
50943
|
else if (project.activeArtifactId !== input.artifactId) throw new Error(`Artifact ${input.artifactId} is not the pending deploy for project ${input.projectId}`);
|
|
47954
50944
|
const ephemeralRoutes = [];
|
|
47955
50945
|
await (0, _keystrokehq_database.runWithProjectDatabase)({
|
|
47956
|
-
url:
|
|
50946
|
+
url: (0, _keystrokehq_platform_database.resolveOrgDatabaseUrl)(organization),
|
|
47957
50947
|
searchPath: organization.dbSchema
|
|
47958
50948
|
}, async () => (0, _keystrokehq_database.runWithProjectScope)(project.id, async () => {
|
|
47959
50949
|
await (0, _keystrokehq_runtime.syncRegistryFromStoredManifest)(manifest);
|
|
@@ -47969,7 +50959,7 @@ async function promoteProjectDeploy(input) {
|
|
|
47969
50959
|
});
|
|
47970
50960
|
}));
|
|
47971
50961
|
const webhookRoutes = [...(0, _keystrokehq_runtime.extractWebhookRoutesFromManifest)(manifest), ...ephemeralRoutes];
|
|
47972
|
-
if (webhookRoutes.length > 0) await
|
|
50962
|
+
if (webhookRoutes.length > 0) await (0, _keystrokehq_platform_database.ensureWebhookApiKeys)(project.id, webhookRoutes, project.id);
|
|
47973
50963
|
}
|
|
47974
50964
|
/** Decide whether a pg-boss job should start runtime, skip as stale, or fail. */
|
|
47975
50965
|
function resolveRuntimeArtifact(project, jobArtifactId) {
|
|
@@ -48035,7 +51025,7 @@ async function handleProjectRuntimeJob(runtime, resolveStartInput, payload) {
|
|
|
48035
51025
|
if (payload.kind !== "runtime") return;
|
|
48036
51026
|
const job = toProjectRuntimeJob(payload);
|
|
48037
51027
|
try {
|
|
48038
|
-
const project = await
|
|
51028
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectById)(job.projectId);
|
|
48039
51029
|
if (!project) throw new Error(`Project ${job.projectId} not found`);
|
|
48040
51030
|
const resolved = resolveRuntimeArtifact(project, job.artifactId);
|
|
48041
51031
|
if (resolved.action === "skip") return;
|
|
@@ -48052,7 +51042,7 @@ async function handleProjectRuntimeJob(runtime, resolveStartInput, payload) {
|
|
|
48052
51042
|
artifactId: resolved.artifactId,
|
|
48053
51043
|
baseUrl: result.baseUrl
|
|
48054
51044
|
});
|
|
48055
|
-
await
|
|
51045
|
+
await (0, _keystrokehq_platform_database.updateProjectActive)(job.projectId, result);
|
|
48056
51046
|
if (input.previousRuntimeId) await destroyProjectRuntime(runtime, input, input.previousRuntimeId);
|
|
48057
51047
|
} catch (error) {
|
|
48058
51048
|
if (result) await destroyProjectRuntime(runtime, input, result.runtimeId);
|
|
@@ -48060,7 +51050,7 @@ async function handleProjectRuntimeJob(runtime, resolveStartInput, payload) {
|
|
|
48060
51050
|
}
|
|
48061
51051
|
} catch (error) {
|
|
48062
51052
|
console.error(`[project.runtime] ${job.projectId} failed`, error);
|
|
48063
|
-
if (payload.exhaustedRetries) await
|
|
51053
|
+
if (payload.exhaustedRetries) await (0, _keystrokehq_platform_database.updateProjectFailed)(job.projectId, "Project runtime failed after retries");
|
|
48064
51054
|
throw error;
|
|
48065
51055
|
}
|
|
48066
51056
|
}
|
|
@@ -48224,7 +51214,7 @@ async function resolveOrganizationContext(c) {
|
|
|
48224
51214
|
ok: false,
|
|
48225
51215
|
response: c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Forbidden" }), 403)
|
|
48226
51216
|
};
|
|
48227
|
-
const membership = await
|
|
51217
|
+
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
48228
51218
|
if (!membership) return {
|
|
48229
51219
|
ok: false,
|
|
48230
51220
|
response: c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Forbidden" }), 403)
|
|
@@ -48251,11 +51241,11 @@ function requireProject() {
|
|
|
48251
51241
|
const organization = c.get("organization");
|
|
48252
51242
|
const projectId = c.req.param("projectId")?.trim();
|
|
48253
51243
|
if (!projectId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Project id is required" }), 400);
|
|
48254
|
-
const [project, organizationRow] = await Promise.all([
|
|
51244
|
+
const [project, organizationRow] = await Promise.all([(0, _keystrokehq_platform_database.selectProjectForOrganization)(organization.organizationId, projectId), (0, _keystrokehq_platform_database.selectOrganizationById)(organization.organizationId)]);
|
|
48255
51245
|
if (!project) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
48256
51246
|
if (!organizationRow) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
48257
51247
|
c.set("project", project);
|
|
48258
|
-
await
|
|
51248
|
+
await (0, _keystrokehq_platform_database.runWithWorkspaceContext)({
|
|
48259
51249
|
organizationId: organization.organizationId,
|
|
48260
51250
|
role: organization.role,
|
|
48261
51251
|
projectId: project.id,
|
|
@@ -48280,7 +51270,7 @@ function requireProjectMembership() {
|
|
|
48280
51270
|
await next();
|
|
48281
51271
|
return;
|
|
48282
51272
|
}
|
|
48283
|
-
const membership = await
|
|
51273
|
+
const membership = await (0, _keystrokehq_platform_database.selectUserProjectMembership)(c.get("user").id, project.id);
|
|
48284
51274
|
if (!membership) return notFound(c, "Project not found");
|
|
48285
51275
|
c.set("projectMember", { role: membership.role });
|
|
48286
51276
|
await next();
|
|
@@ -48319,9 +51309,9 @@ function requireSession(jwtVerifier) {
|
|
|
48319
51309
|
}
|
|
48320
51310
|
const apiKeySecret = extractWebhookApiKeyFromRequest(c.req.raw);
|
|
48321
51311
|
if (apiKeySecret) {
|
|
48322
|
-
const verified = await
|
|
51312
|
+
const verified = await (0, _keystrokehq_platform_database.verifyOrgPlatformApiKeySecret)(apiKeySecret);
|
|
48323
51313
|
if (verified) {
|
|
48324
|
-
const user = await
|
|
51314
|
+
const user = await (0, _keystrokehq_platform_database.loadOrgPlatformApiKeyUser)(verified.userId);
|
|
48325
51315
|
if (user) {
|
|
48326
51316
|
const session = sessionFromApiKeyUser(user, apiKeySecret);
|
|
48327
51317
|
c.set("user", session.user);
|
|
@@ -48365,7 +51355,7 @@ function requireOrganizationParam() {
|
|
|
48365
51355
|
return async (c, next) => {
|
|
48366
51356
|
const organizationId = c.req.param("organizationId")?.trim();
|
|
48367
51357
|
if (!organizationId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization id is required" }), 400);
|
|
48368
|
-
const membership = await
|
|
51358
|
+
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
48369
51359
|
if (!membership) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Forbidden" }), 403);
|
|
48370
51360
|
c.set("organization", {
|
|
48371
51361
|
organizationId: membership.organization.id,
|
|
@@ -48392,7 +51382,7 @@ async function flushRequestBackgroundTasks() {
|
|
|
48392
51382
|
}
|
|
48393
51383
|
/** Org DB connection options for `@keystrokehq/database` project scope (pg schema vs sqlite file). */
|
|
48394
51384
|
function resolveOrgProjectDatabaseOptions(organization) {
|
|
48395
|
-
const url =
|
|
51385
|
+
const url = (0, _keystrokehq_platform_database.resolveOrgDatabaseUrl)(organization);
|
|
48396
51386
|
if ((0, _keystrokehq_database.inferDialect)(url) === "postgres") return {
|
|
48397
51387
|
url,
|
|
48398
51388
|
searchPath: organization.dbSchema
|
|
@@ -48403,10 +51393,10 @@ function resolveOrgProjectDatabaseOptions(organization) {
|
|
|
48403
51393
|
function withOrganizationProjectDatabase() {
|
|
48404
51394
|
return async (c, next) => {
|
|
48405
51395
|
const { organizationId } = c.get("organization");
|
|
48406
|
-
const organization = await
|
|
51396
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
48407
51397
|
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
48408
51398
|
const dbOptions = resolveOrgProjectDatabaseOptions(organization);
|
|
48409
|
-
await
|
|
51399
|
+
await (0, _keystrokehq_platform_database.runWithOrganizationScope)(organizationId, () => (0, _keystrokehq_database.runWithProjectDatabase)(dbOptions, () => (0, _keystrokehq_database.runWithTenantScope)(organizationId, () => runWithRequestBackgroundTasks(async () => {
|
|
48410
51400
|
await next();
|
|
48411
51401
|
await flushRequestBackgroundTasks();
|
|
48412
51402
|
}))));
|
|
@@ -48415,7 +51405,7 @@ function withOrganizationProjectDatabase() {
|
|
|
48415
51405
|
//#endregion
|
|
48416
51406
|
//#region src/routes/account/users/me/avatar/GET.ts
|
|
48417
51407
|
const handler$60 = async (c) => {
|
|
48418
|
-
const dbUser = await
|
|
51408
|
+
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(c.get("user").id);
|
|
48419
51409
|
if (!dbUser) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
48420
51410
|
return c.json(require_dist$2.UserAvatarSchema.parse({ url: dbUser.image ?? null }));
|
|
48421
51411
|
};
|
|
@@ -48477,7 +51467,7 @@ const handler$58 = async (c) => {
|
|
|
48477
51467
|
const parsed = require_dist$2.UserAvatarPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
48478
51468
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid avatar update" }), 400);
|
|
48479
51469
|
const user = c.get("user");
|
|
48480
|
-
const dbUser = await
|
|
51470
|
+
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(user.id);
|
|
48481
51471
|
if (!dbUser) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
48482
51472
|
const storage = require_dist$2.createAssetsStorageClient();
|
|
48483
51473
|
const { storageKey } = parsed.data;
|
|
@@ -48488,7 +51478,7 @@ const handler$58 = async (c) => {
|
|
|
48488
51478
|
isOwnedPublicUrl: require_dist$2.isKeystrokeAssetsAvatarPublicUrl,
|
|
48489
51479
|
keyFromPublicUrl: require_dist$2.keystrokeAssetsAvatarKeyFromPublicUrl
|
|
48490
51480
|
});
|
|
48491
|
-
await
|
|
51481
|
+
await (0, _keystrokehq_platform_database.updateUserById)(user.id, {
|
|
48492
51482
|
image: null,
|
|
48493
51483
|
updatedAt: /* @__PURE__ */ new Date()
|
|
48494
51484
|
});
|
|
@@ -48507,7 +51497,7 @@ const handler$58 = async (c) => {
|
|
|
48507
51497
|
isOwnedPublicUrl: require_dist$2.isKeystrokeAssetsAvatarPublicUrl,
|
|
48508
51498
|
keyFromPublicUrl: require_dist$2.keystrokeAssetsAvatarKeyFromPublicUrl
|
|
48509
51499
|
});
|
|
48510
|
-
await
|
|
51500
|
+
await (0, _keystrokehq_platform_database.updateUserById)(user.id, {
|
|
48511
51501
|
image: finalized.publicUrl,
|
|
48512
51502
|
updatedAt: /* @__PURE__ */ new Date()
|
|
48513
51503
|
});
|
|
@@ -48516,7 +51506,7 @@ const handler$58 = async (c) => {
|
|
|
48516
51506
|
//#endregion
|
|
48517
51507
|
//#region src/routes/account/users/me/preferences/GET.ts
|
|
48518
51508
|
const handler$57 = async (c) => {
|
|
48519
|
-
const dbUser = await
|
|
51509
|
+
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(c.get("user").id);
|
|
48520
51510
|
if (!dbUser) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
48521
51511
|
return c.json(require_dist$2.UserPreferencesSchema.parse(require_dist$2.normalizeUserPreferences(dbUser.preferences)));
|
|
48522
51512
|
};
|
|
@@ -48526,10 +51516,10 @@ const handler$56 = async (c) => {
|
|
|
48526
51516
|
const parsed = require_dist$2.UserPreferencesPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
48527
51517
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid preferences update" }), 400);
|
|
48528
51518
|
const user = c.get("user");
|
|
48529
|
-
const dbUser = await
|
|
51519
|
+
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(user.id);
|
|
48530
51520
|
if (!dbUser) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
48531
51521
|
const next = require_dist$2.mergeUserPreferences(require_dist$2.normalizeUserPreferences(dbUser.preferences), parsed.data);
|
|
48532
|
-
await
|
|
51522
|
+
await (0, _keystrokehq_platform_database.updateUserById)(user.id, {
|
|
48533
51523
|
preferences: next,
|
|
48534
51524
|
updatedAt: /* @__PURE__ */ new Date()
|
|
48535
51525
|
});
|
|
@@ -48538,14 +51528,14 @@ const handler$56 = async (c) => {
|
|
|
48538
51528
|
//#endregion
|
|
48539
51529
|
//#region src/routes/account/organizations/GET.ts
|
|
48540
51530
|
const handler$55 = async (c) => {
|
|
48541
|
-
const memberships = await
|
|
51531
|
+
const memberships = await (0, _keystrokehq_platform_database.selectUserOrganizations)(c.get("user").id);
|
|
48542
51532
|
return c.json(require_dist$2.ListOrganizationsResponseSchema.parse({ organizations: memberships.map(require_dist$2.mapUserOrganization) }));
|
|
48543
51533
|
};
|
|
48544
51534
|
//#endregion
|
|
48545
51535
|
//#region src/services/create-organization.ts
|
|
48546
51536
|
async function createOrganizationWithHosting(deps, userId, name, preferredSlug) {
|
|
48547
51537
|
const { hosting, storage } = deps;
|
|
48548
|
-
const identity = await
|
|
51538
|
+
const identity = await (0, _keystrokehq_platform_database.resolveNewOrganizationIdentity)(name, preferredSlug);
|
|
48549
51539
|
let hostedAppName;
|
|
48550
51540
|
let provisionedStorage;
|
|
48551
51541
|
let organizationPersisted = false;
|
|
@@ -48558,15 +51548,15 @@ async function createOrganizationWithHosting(deps, userId, name, preferredSlug)
|
|
|
48558
51548
|
organizationId: identity.organizationId,
|
|
48559
51549
|
name: name.trim()
|
|
48560
51550
|
});
|
|
48561
|
-
const membership = await
|
|
51551
|
+
const membership = await (0, _keystrokehq_platform_database.createOrganizationForUser)(userId, name, preferredSlug, {
|
|
48562
51552
|
organizationId: identity.organizationId,
|
|
48563
51553
|
slug: identity.slug,
|
|
48564
51554
|
hostingAppName: hostedAppName ?? null,
|
|
48565
51555
|
storage: {
|
|
48566
51556
|
bucket: provisionedStorage.bucket,
|
|
48567
51557
|
endpoint: provisionedStorage.endpoint,
|
|
48568
|
-
accessKeyIdCiphertext: (0,
|
|
48569
|
-
secretAccessKeyCiphertext: (0,
|
|
51558
|
+
accessKeyIdCiphertext: (0, _keystrokehq_platform_database.encryptCredentialPayload)(provisionedStorage.accessKeyId),
|
|
51559
|
+
secretAccessKeyCiphertext: (0, _keystrokehq_platform_database.encryptCredentialPayload)(provisionedStorage.secretAccessKey),
|
|
48570
51560
|
region: provisionedStorage.region ?? null,
|
|
48571
51561
|
forcePathStyle: provisionedStorage.forcePathStyle ?? null
|
|
48572
51562
|
}
|
|
@@ -48576,7 +51566,7 @@ async function createOrganizationWithHosting(deps, userId, name, preferredSlug)
|
|
|
48576
51566
|
return membership;
|
|
48577
51567
|
} catch (error) {
|
|
48578
51568
|
if (provisionedStorage && !organizationPersisted) {
|
|
48579
|
-
if (!await
|
|
51569
|
+
if (!await (0, _keystrokehq_platform_database.isOrganizationStorageBucketInUse)(provisionedStorage.bucket)) await storage.deprovisionOrganization(provisionedStorage).catch(() => void 0);
|
|
48580
51570
|
}
|
|
48581
51571
|
if (hostedAppName && hosting.deprovisionOrganization) await hosting.deprovisionOrganization({ appName: hostedAppName }).catch(() => void 0);
|
|
48582
51572
|
throw error;
|
|
@@ -48585,7 +51575,7 @@ async function createOrganizationWithHosting(deps, userId, name, preferredSlug)
|
|
|
48585
51575
|
//#endregion
|
|
48586
51576
|
//#region src/routes/account/organizations/slug-errors.ts
|
|
48587
51577
|
function organizationSlugErrorBody(error) {
|
|
48588
|
-
if (error instanceof
|
|
51578
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return {
|
|
48589
51579
|
error: error.message,
|
|
48590
51580
|
code: "slug_taken"
|
|
48591
51581
|
};
|
|
@@ -48607,7 +51597,7 @@ function createOrganizationHandler(deps) {
|
|
|
48607
51597
|
const membership = await createOrganizationWithHosting(deps, user.id, parsed.data.name, parsed.data.slug);
|
|
48608
51598
|
return c.json(require_dist$2.CreateOrganizationResponseSchema.parse({ organization: require_dist$2.mapUserOrganization(membership) }), 201);
|
|
48609
51599
|
} catch (error) {
|
|
48610
|
-
if (error instanceof
|
|
51600
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist$2.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
48611
51601
|
if (error instanceof zod.ZodError) return c.json(require_dist$2.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
48612
51602
|
throw error;
|
|
48613
51603
|
}
|
|
@@ -48621,14 +51611,14 @@ const handler$54 = async (c) => {
|
|
|
48621
51611
|
excludeOrganizationId: c.req.query("excludeOrganizationId")
|
|
48622
51612
|
});
|
|
48623
51613
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
48624
|
-
const availability = await
|
|
51614
|
+
const availability = await (0, _keystrokehq_platform_database.checkOrganizationSlugAvailability)(parsed.data.slug, parsed.data.excludeOrganizationId);
|
|
48625
51615
|
return c.json(require_dist$2.SlugAvailabilityResponseSchema.parse(availability));
|
|
48626
51616
|
};
|
|
48627
51617
|
//#endregion
|
|
48628
51618
|
//#region src/routes/account/organizations/[organizationId]/GET.ts
|
|
48629
51619
|
const handler$53 = async (c) => {
|
|
48630
51620
|
const { organizationId } = c.get("organization");
|
|
48631
|
-
const membership = await
|
|
51621
|
+
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
48632
51622
|
if (!membership) throw new Error(`Organization membership missing after param guard: ${organizationId}`);
|
|
48633
51623
|
return c.json(require_dist$2.ActiveOrganizationResponseSchema.parse({ organization: require_dist$2.mapUserOrganization(membership) }));
|
|
48634
51624
|
};
|
|
@@ -48644,15 +51634,15 @@ const handler$52 = async (c) => {
|
|
|
48644
51634
|
}
|
|
48645
51635
|
try {
|
|
48646
51636
|
let updated;
|
|
48647
|
-
if (parsed.data.name !== void 0) updated = await
|
|
48648
|
-
if (parsed.data.slug !== void 0) updated = await
|
|
51637
|
+
if (parsed.data.name !== void 0) updated = await (0, _keystrokehq_platform_database.updateOrganizationName)(organization.organizationId, parsed.data.name);
|
|
51638
|
+
if (parsed.data.slug !== void 0) updated = await (0, _keystrokehq_platform_database.updateOrganizationSlug)(organization.organizationId, parsed.data.slug);
|
|
48649
51639
|
if (!updated) throw new Error(`Organization update produced no result: ${organization.organizationId}`);
|
|
48650
51640
|
return c.json(require_dist$2.ActiveOrganizationResponseSchema.parse({ organization: require_dist$2.mapUserOrganization({
|
|
48651
51641
|
organization: updated,
|
|
48652
51642
|
role: organization.role
|
|
48653
51643
|
}) }));
|
|
48654
51644
|
} catch (error) {
|
|
48655
|
-
if (error instanceof
|
|
51645
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist$2.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
48656
51646
|
if (error instanceof zod.ZodError) return c.json(require_dist$2.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
48657
51647
|
throw error;
|
|
48658
51648
|
}
|
|
@@ -48661,9 +51651,9 @@ const handler$52 = async (c) => {
|
|
|
48661
51651
|
//#region src/routes/account/organizations/[organizationId]/branding/GET.ts
|
|
48662
51652
|
const handler$51 = async (c) => {
|
|
48663
51653
|
const { organizationId } = c.get("organization");
|
|
48664
|
-
const organization = await
|
|
51654
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
48665
51655
|
if (!organization) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
48666
|
-
return c.json(require_dist$2.OrganizationSidebarBrandingSchema.parse(
|
|
51656
|
+
return c.json(require_dist$2.OrganizationSidebarBrandingSchema.parse((0, _keystrokehq_platform_database.organizationRowToSidebarBranding)(organization)));
|
|
48667
51657
|
};
|
|
48668
51658
|
//#endregion
|
|
48669
51659
|
//#region src/routes/account/organizations/[organizationId]/branding/PATCH.ts
|
|
@@ -48712,7 +51702,7 @@ const handler$50 = async (c) => {
|
|
|
48712
51702
|
const parsed = require_dist$2.OrganizationSidebarBrandingPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
48713
51703
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid branding update" }), 400);
|
|
48714
51704
|
const { organizationId } = c.get("organization");
|
|
48715
|
-
const organization = await
|
|
51705
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
48716
51706
|
if (!organization) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
48717
51707
|
const dbUpdate = {
|
|
48718
51708
|
customLogoEnabled: parsed.data.customLogoEnabled,
|
|
@@ -48731,8 +51721,8 @@ const handler$50 = async (c) => {
|
|
|
48731
51721
|
if (!result.ok) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: result.error }), 400);
|
|
48732
51722
|
dbUpdate[urlField] = result.publicUrl;
|
|
48733
51723
|
}
|
|
48734
|
-
const updated = await
|
|
48735
|
-
return c.json(require_dist$2.OrganizationSidebarBrandingSchema.parse(
|
|
51724
|
+
const updated = await (0, _keystrokehq_platform_database.updateOrganizationSidebarBranding)(organizationId, dbUpdate);
|
|
51725
|
+
return c.json(require_dist$2.OrganizationSidebarBrandingSchema.parse((0, _keystrokehq_platform_database.organizationRowToSidebarBranding)(updated)));
|
|
48736
51726
|
};
|
|
48737
51727
|
//#endregion
|
|
48738
51728
|
//#region src/routes/account/organizations/[organizationId]/branding/logo/presign/POST.ts
|
|
@@ -48764,7 +51754,7 @@ function listScope(c, capability) {
|
|
|
48764
51754
|
async function grantedProjectIds(c, scope) {
|
|
48765
51755
|
if (scope.kind === "all") return;
|
|
48766
51756
|
const { organizationId } = c.get("organization");
|
|
48767
|
-
return
|
|
51757
|
+
return (0, _keystrokehq_platform_database.selectProjectIdsForUser)(organizationId, c.get("user").id);
|
|
48768
51758
|
}
|
|
48769
51759
|
async function resolveListProjectIds(c, scope, requested) {
|
|
48770
51760
|
const granted = await grantedProjectIds(c, scope);
|
|
@@ -48786,7 +51776,7 @@ async function canAccessProjectId(c, projectId, check) {
|
|
|
48786
51776
|
//#region src/routes/account/history/enrich.ts
|
|
48787
51777
|
async function resolveHistoryRunActor(ranByUserId) {
|
|
48788
51778
|
if (!ranByUserId) return null;
|
|
48789
|
-
const user = await
|
|
51779
|
+
const user = await (0, _keystrokehq_platform_database.selectUserById)(ranByUserId);
|
|
48790
51780
|
if (!user) return null;
|
|
48791
51781
|
return {
|
|
48792
51782
|
userId: user.id,
|
|
@@ -48844,7 +51834,7 @@ const handler$48 = async (c) => {
|
|
|
48844
51834
|
...query.kind ? { kind: query.kind } : {}
|
|
48845
51835
|
});
|
|
48846
51836
|
const grantedProjectIdsList = await grantedProjectIds(c, scope);
|
|
48847
|
-
const projects = await
|
|
51837
|
+
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
48848
51838
|
const historyRuns = await enrichHistoryRuns(runs, new Map(projects.map((project) => [project.id, project.name])));
|
|
48849
51839
|
return c.json(require_dist$2.HistoryRunListResponseSchema.parse(historyRuns));
|
|
48850
51840
|
};
|
|
@@ -48940,11 +51930,11 @@ async function cancelHistoryRun(c, kind, cancel) {
|
|
|
48940
51930
|
if (!await canAccessProjectId(c, core.projectId, canAccessHistoryRun)) return c.json(null, 404);
|
|
48941
51931
|
const run = await (0, _keystrokehq_database.runWithProjectScope)(core.projectId, () => cancel(id));
|
|
48942
51932
|
if (!run) return c.json(null, 404);
|
|
48943
|
-
const organization = await
|
|
51933
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationContext.organizationId);
|
|
48944
51934
|
if (!organization) return c.json(null, 404);
|
|
48945
51935
|
await (await (0, _keystrokehq_http.getProjectScheduler)(organization, core.projectId)).publishCancel(id);
|
|
48946
51936
|
const grantedProjectIdsList = await grantedProjectIds(c, historyListScope(accessContext(c)));
|
|
48947
|
-
const projects = await
|
|
51937
|
+
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organizationContext.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
48948
51938
|
const historyRun = await enrichHistoryRun(run, new Map(projects.map((project) => [project.id, project.name])));
|
|
48949
51939
|
return c.json(require_dist$2.HistoryRunCancelResponseSchema.parse(historyRun));
|
|
48950
51940
|
}
|
|
@@ -49075,7 +52065,7 @@ const handler$38 = async (c) => {
|
|
|
49075
52065
|
(0, _keystrokehq_database.selectActiveAgentsByIds)(agentIds),
|
|
49076
52066
|
(0, _keystrokehq_database.selectActiveWorkflowsByIds)(workflowIds),
|
|
49077
52067
|
(0, _keystrokehq_database.selectActiveSkillsByIds)(skillIds),
|
|
49078
|
-
|
|
52068
|
+
(0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: grantedProjectIdsList })
|
|
49079
52069
|
]);
|
|
49080
52070
|
const projectNameById = new Map(projects.map((project) => [project.id, project.name]));
|
|
49081
52071
|
const lookup = {
|
|
@@ -49091,7 +52081,7 @@ const handler$38 = async (c) => {
|
|
|
49091
52081
|
const handler$37 = async (c) => {
|
|
49092
52082
|
const organization = c.get("organization");
|
|
49093
52083
|
const grantedProjectIdsList = await grantedProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
49094
|
-
const projects = await
|
|
52084
|
+
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
49095
52085
|
return c.json(require_dist$2.ListProjectsResponseSchema.parse({ projects: projects.map(require_dist$2.mapProject) }));
|
|
49096
52086
|
};
|
|
49097
52087
|
//#endregion
|
|
@@ -49117,7 +52107,7 @@ function mergeProjectListMetrics(input) {
|
|
|
49117
52107
|
const handler$36 = async (c) => {
|
|
49118
52108
|
const organization = c.get("organization");
|
|
49119
52109
|
const grantedProjectIdsList = await grantedProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
49120
|
-
const [resourceCounts, lastDeploymentAtByProject] = await Promise.all([(0, _keystrokehq_database.selectProjectResourceCounts)(grantedProjectIdsList !== void 0 ? { projectIds: grantedProjectIdsList } : void 0),
|
|
52110
|
+
const [resourceCounts, lastDeploymentAtByProject] = await Promise.all([(0, _keystrokehq_database.selectProjectResourceCounts)(grantedProjectIdsList !== void 0 ? { projectIds: grantedProjectIdsList } : void 0), (0, _keystrokehq_platform_database.selectLastDeploymentAtByProject)(organization.organizationId)]);
|
|
49121
52111
|
let metrics = mergeProjectListMetrics({
|
|
49122
52112
|
resourceCounts,
|
|
49123
52113
|
lastDeploymentAtByProject
|
|
@@ -49136,7 +52126,7 @@ const handler$35 = async (c) => {
|
|
|
49136
52126
|
const body = await c.req.json().catch(() => null);
|
|
49137
52127
|
const parsed = require_dist$2.CreateProjectRequestSchema.safeParse(body);
|
|
49138
52128
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Project name is required" }), 400);
|
|
49139
|
-
const project = await
|
|
52129
|
+
const project = await (0, _keystrokehq_platform_database.createProjectForOrganization)(organization.organizationId, parsed.data.name, parsed.data.description, user.id);
|
|
49140
52130
|
return c.json(require_dist$2.CreateProjectResponseSchema.parse({ project: require_dist$2.mapProject(project) }), 201);
|
|
49141
52131
|
};
|
|
49142
52132
|
//#endregion
|
|
@@ -49148,7 +52138,7 @@ const handler$34 = async (c) => {
|
|
|
49148
52138
|
excludeProjectId: c.req.query("excludeProjectId")
|
|
49149
52139
|
});
|
|
49150
52140
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
49151
|
-
const availability = await
|
|
52141
|
+
const availability = await (0, _keystrokehq_platform_database.checkProjectSlugAvailability)(organization.organizationId, parsed.data.slug, parsed.data.excludeProjectId);
|
|
49152
52142
|
return c.json(require_dist$2.ProjectSlugAvailabilityResponseSchema.parse(availability));
|
|
49153
52143
|
};
|
|
49154
52144
|
//#endregion
|
|
@@ -49166,9 +52156,9 @@ const handler$32 = async (c) => {
|
|
|
49166
52156
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid project update request" }), 400);
|
|
49167
52157
|
let updated;
|
|
49168
52158
|
try {
|
|
49169
|
-
updated = await
|
|
52159
|
+
updated = await (0, _keystrokehq_platform_database.updateProjectForOrganization)(organization.organizationId, project.id, parsed.data);
|
|
49170
52160
|
} catch (error) {
|
|
49171
|
-
if (error instanceof
|
|
52161
|
+
if (error instanceof _keystrokehq_platform_database.ProjectSlugTakenError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: require_dist$2.PROJECT_SLUG_TAKEN_MESSAGE }), 409);
|
|
49172
52162
|
throw error;
|
|
49173
52163
|
}
|
|
49174
52164
|
if (!updated) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
@@ -49179,13 +52169,13 @@ const handler$32 = async (c) => {
|
|
|
49179
52169
|
const handler$31 = async (c) => {
|
|
49180
52170
|
const organization = c.get("organization");
|
|
49181
52171
|
const project = c.get("project");
|
|
49182
|
-
if (!await
|
|
52172
|
+
if (!await (0, _keystrokehq_platform_database.deleteProjectForOrganization)(organization.organizationId, project.id)) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
49183
52173
|
return c.body(null, 204);
|
|
49184
52174
|
};
|
|
49185
52175
|
//#endregion
|
|
49186
52176
|
//#region src/routes/account/projects/[projectId]/deployments/GET.ts
|
|
49187
52177
|
const handler$30 = async (c) => {
|
|
49188
|
-
const rows = await
|
|
52178
|
+
const rows = await (0, _keystrokehq_platform_database.selectProjectDeployments)(c.get("project").id);
|
|
49189
52179
|
return c.json(require_dist$2.ListProjectDeploymentsResponseSchema.parse({ deployments: rows.map(require_dist$2.mapProjectDeployment) }));
|
|
49190
52180
|
};
|
|
49191
52181
|
//#endregion
|
|
@@ -49195,12 +52185,12 @@ const ARTIFACT_CONTENT_TYPE = "application/gzip";
|
|
|
49195
52185
|
const handler$29 = async (c) => {
|
|
49196
52186
|
const project = c.get("project");
|
|
49197
52187
|
const { organizationId } = c.get("organization");
|
|
49198
|
-
const organization = await
|
|
52188
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
49199
52189
|
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
49200
52190
|
const artifactId = crypto.randomUUID();
|
|
49201
52191
|
const storageKey = require_dist$2.projectArtifactKey(project.id, artifactId);
|
|
49202
|
-
const storage =
|
|
49203
|
-
const artifact = await
|
|
52192
|
+
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
52193
|
+
const artifact = await (0, _keystrokehq_platform_database.insertProjectArtifact)({
|
|
49204
52194
|
id: artifactId,
|
|
49205
52195
|
projectId: project.id,
|
|
49206
52196
|
storageKey,
|
|
@@ -49223,11 +52213,11 @@ const DEFAULT_PRESIGN_TTL_SECONDS = 900;
|
|
|
49223
52213
|
const handler$28 = async (c) => {
|
|
49224
52214
|
const project = c.get("project");
|
|
49225
52215
|
const { organizationId } = c.get("organization");
|
|
49226
|
-
const organization = await
|
|
52216
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
49227
52217
|
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
49228
|
-
const artifact = await
|
|
52218
|
+
const artifact = await (0, _keystrokehq_platform_database.selectActiveProjectArtifactForProject)(project.id);
|
|
49229
52219
|
if (!artifact) return c.json({ error: "No active artifact for project" }, 404);
|
|
49230
|
-
const downloadUrl = await
|
|
52220
|
+
const downloadUrl = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).presignGet({
|
|
49231
52221
|
key: artifact.storageKey,
|
|
49232
52222
|
expiresInSeconds: DEFAULT_PRESIGN_TTL_SECONDS
|
|
49233
52223
|
});
|
|
@@ -49243,20 +52233,20 @@ const handler$27 = async (c) => {
|
|
|
49243
52233
|
const project = c.get("project");
|
|
49244
52234
|
const artifactId = c.req.param("artifactId");
|
|
49245
52235
|
if (!artifactId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
49246
|
-
const existing = await
|
|
52236
|
+
const existing = await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id);
|
|
49247
52237
|
if (!existing) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
49248
52238
|
if (existing.status === "ready") return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact already completed" }), 409);
|
|
49249
52239
|
const { organizationId } = c.get("organization");
|
|
49250
|
-
const organization = await
|
|
52240
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
49251
52241
|
if (!organization) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
49252
|
-
const storage =
|
|
52242
|
+
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
49253
52243
|
const head = await storage.headObject(existing.storageKey);
|
|
49254
52244
|
if (!head || head.contentLength <= 0) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact upload not found in storage" }), 400);
|
|
49255
52245
|
try {
|
|
49256
52246
|
const artifactBytes = await storage.getObject(existing.storageKey);
|
|
49257
52247
|
if (!artifactBytes || artifactBytes.byteLength <= 0) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact upload not found in storage" }), 400);
|
|
49258
52248
|
const manifestJson = require_dist$2.parseStoredRouteManifest(require_dist$2.extractRouteManifestFromArtifact(Buffer.from(artifactBytes)));
|
|
49259
|
-
const result = await
|
|
52249
|
+
const result = await (0, _keystrokehq_platform_database.completeProjectArtifact)({
|
|
49260
52250
|
artifactId,
|
|
49261
52251
|
projectId: project.id,
|
|
49262
52252
|
manifestJson
|
|
@@ -49282,13 +52272,13 @@ const handler$26 = async (c) => {
|
|
|
49282
52272
|
const project = c.get("project");
|
|
49283
52273
|
const artifactId = c.req.param("artifactId");
|
|
49284
52274
|
if (!artifactId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
49285
|
-
if (!await
|
|
52275
|
+
if (!await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id)) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
49286
52276
|
const parsed = require_dist$2.PresignProjectSourceRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
49287
52277
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid blob list" }), 400);
|
|
49288
52278
|
const { organizationId } = c.get("organization");
|
|
49289
|
-
const organization = await
|
|
52279
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
49290
52280
|
if (!organization) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
49291
|
-
const storage =
|
|
52281
|
+
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
49292
52282
|
const hashes = [...new Set(parsed.data.blobs.map((blob) => blob.hash))];
|
|
49293
52283
|
const uploads = await Promise.all(hashes.map(async (hash) => {
|
|
49294
52284
|
const key = require_dist$2.projectSourceBlobKey(project.id, hash);
|
|
@@ -49310,7 +52300,7 @@ const handler$25 = async (c) => {
|
|
|
49310
52300
|
const project = c.get("project");
|
|
49311
52301
|
const artifactId = c.req.param("artifactId");
|
|
49312
52302
|
if (!artifactId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
49313
|
-
if (!await
|
|
52303
|
+
if (!await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id)) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
49314
52304
|
const parsed = require_dist$2.UploadProjectSourceManifestRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
49315
52305
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid source manifest" }), 400);
|
|
49316
52306
|
const manifest = require_dist$2.StoredProjectSourceManifestSchema.parse({
|
|
@@ -49321,7 +52311,7 @@ const handler$25 = async (c) => {
|
|
|
49321
52311
|
})),
|
|
49322
52312
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
49323
52313
|
});
|
|
49324
|
-
await
|
|
52314
|
+
await (0, _keystrokehq_platform_database.updateProjectArtifactSourceManifest)({
|
|
49325
52315
|
artifactId,
|
|
49326
52316
|
projectId: project.id,
|
|
49327
52317
|
sourceManifestJson: manifest
|
|
@@ -49353,7 +52343,7 @@ function resolveSourcePaths(rows, kindDir, filePaths) {
|
|
|
49353
52343
|
}
|
|
49354
52344
|
const handler$24 = async (c) => {
|
|
49355
52345
|
const project = c.get("project");
|
|
49356
|
-
const active = await
|
|
52346
|
+
const active = await (0, _keystrokehq_platform_database.selectActiveArtifactSourceManifestForProject)(project.id);
|
|
49357
52347
|
if (!active || !active.sourceManifestJson) return c.json(require_dist$2.ListProjectFilesResponseSchema.parse({
|
|
49358
52348
|
artifactId: active?.artifactId ?? null,
|
|
49359
52349
|
files: []
|
|
@@ -49391,14 +52381,14 @@ const handler$23 = async (c) => {
|
|
|
49391
52381
|
if (!artifactId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
49392
52382
|
const path = c.req.query("path");
|
|
49393
52383
|
if (!path) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
49394
|
-
const artifact = await
|
|
52384
|
+
const artifact = await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id);
|
|
49395
52385
|
if (!artifact || !artifact.sourceManifestJson) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
49396
52386
|
const file = require_dist$2.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === path);
|
|
49397
52387
|
if (!file) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
49398
52388
|
const { organizationId } = c.get("organization");
|
|
49399
|
-
const organization = await
|
|
52389
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
49400
52390
|
if (!organization) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
49401
|
-
const storage =
|
|
52391
|
+
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
49402
52392
|
let bytes;
|
|
49403
52393
|
try {
|
|
49404
52394
|
bytes = await storage.getObject(require_dist$2.projectSourceBlobKey(project.id, file.hash));
|
|
@@ -49414,7 +52404,7 @@ function createProjectReachabilityHandler(hosting) {
|
|
|
49414
52404
|
return async (c) => {
|
|
49415
52405
|
const project = c.get("project");
|
|
49416
52406
|
if (project.status !== "active") return c.json(require_dist$2.ProjectReachabilityResponseSchema.parse({ reachable: false }));
|
|
49417
|
-
const reachable = await require_dist$
|
|
52407
|
+
const reachable = await require_dist$2.pingProjectTarget({
|
|
49418
52408
|
baseUrl: project.baseUrl,
|
|
49419
52409
|
runtimeId: project.runtimeId
|
|
49420
52410
|
}, { plugin: hosting });
|
|
@@ -49426,7 +52416,7 @@ function createProjectReachabilityHandler(hosting) {
|
|
|
49426
52416
|
const handler$22 = async (c) => {
|
|
49427
52417
|
const project = c.get("project");
|
|
49428
52418
|
const currentUserId = c.get("user").id;
|
|
49429
|
-
const members = await
|
|
52419
|
+
const members = await (0, _keystrokehq_platform_database.selectProjectMembers)(project.id);
|
|
49430
52420
|
return c.json(require_dist$2.ListProjectMembersResponseSchema.parse({ members: members.map((member) => require_dist$2.mapProjectMember(member, { isCurrentUser: member.id === currentUserId })) }));
|
|
49431
52421
|
};
|
|
49432
52422
|
//#endregion
|
|
@@ -49437,7 +52427,7 @@ const handler$21 = async (c) => {
|
|
|
49437
52427
|
const body = await c.req.json().catch(() => null);
|
|
49438
52428
|
const parsed = require_dist$2.InviteProjectMembersRequestSchema.safeParse(body);
|
|
49439
52429
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid invite request" }), 400);
|
|
49440
|
-
const results = await
|
|
52430
|
+
const results = await (0, _keystrokehq_platform_database.inviteProjectMembers)({
|
|
49441
52431
|
projectId: project.id,
|
|
49442
52432
|
organizationId: organization.organizationId,
|
|
49443
52433
|
emails: parsed.data.emails,
|
|
@@ -49455,10 +52445,10 @@ const handler$20 = async (c) => {
|
|
|
49455
52445
|
if (!userId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
49456
52446
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
49457
52447
|
try {
|
|
49458
|
-
const member = await
|
|
52448
|
+
const member = await (0, _keystrokehq_platform_database.updateProjectMemberRole)(project.id, userId, parsed.data.role);
|
|
49459
52449
|
return c.json(require_dist$2.UpdateProjectMemberResponseSchema.parse({ member: require_dist$2.mapProjectMember(member) }));
|
|
49460
52450
|
} catch (error) {
|
|
49461
|
-
if (error instanceof
|
|
52451
|
+
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
49462
52452
|
throw error;
|
|
49463
52453
|
}
|
|
49464
52454
|
};
|
|
@@ -49469,10 +52459,10 @@ const handler$19 = async (c) => {
|
|
|
49469
52459
|
const userId = c.req.param("userId");
|
|
49470
52460
|
if (!userId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
49471
52461
|
try {
|
|
49472
|
-
await
|
|
52462
|
+
await (0, _keystrokehq_platform_database.removeProjectMember)(project.id, userId);
|
|
49473
52463
|
return c.body(null, 204);
|
|
49474
52464
|
} catch (error) {
|
|
49475
|
-
if (error instanceof
|
|
52465
|
+
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
49476
52466
|
throw error;
|
|
49477
52467
|
}
|
|
49478
52468
|
};
|
|
@@ -49482,10 +52472,10 @@ const handler$18 = async (c) => {
|
|
|
49482
52472
|
const project = c.get("project");
|
|
49483
52473
|
const userId = c.get("user").id;
|
|
49484
52474
|
try {
|
|
49485
|
-
await
|
|
52475
|
+
await (0, _keystrokehq_platform_database.removeProjectMember)(project.id, userId);
|
|
49486
52476
|
return c.body(null, 204);
|
|
49487
52477
|
} catch (error) {
|
|
49488
|
-
if (error instanceof
|
|
52478
|
+
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
49489
52479
|
throw error;
|
|
49490
52480
|
}
|
|
49491
52481
|
};
|
|
@@ -49503,7 +52493,7 @@ const handler$16 = async (c) => {
|
|
|
49503
52493
|
const body = await c.req.json().catch(() => null);
|
|
49504
52494
|
const parsed = require_dist$2.UpdateProjectSettingsRequestSchema.safeParse(body);
|
|
49505
52495
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid project settings request" }), 400);
|
|
49506
|
-
const updated = await
|
|
52496
|
+
const updated = await (0, _keystrokehq_platform_database.updateProjectSettings)(organization.organizationId, project.id, {
|
|
49507
52497
|
description: parsed.data.description,
|
|
49508
52498
|
defaultMemberRole: parsed.data.defaultRole,
|
|
49509
52499
|
invitePermission: parsed.data.invitePermission
|
|
@@ -49573,9 +52563,9 @@ function uniqueIds(rows, pick) {
|
|
|
49573
52563
|
/** Cross-database lookups: instances live in the org DB; projects/users/connections in the platform DB. */
|
|
49574
52564
|
async function loadCredentialLookups(rows, organizationId) {
|
|
49575
52565
|
const [projects, owners, connections] = await Promise.all([
|
|
49576
|
-
|
|
49577
|
-
|
|
49578
|
-
|
|
52566
|
+
(0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organizationId),
|
|
52567
|
+
(0, _keystrokehq_platform_database.selectUsersByIds)(uniqueIds(rows, (row) => row.scopeType === "user" ? row.scopeId : null)),
|
|
52568
|
+
(0, _keystrokehq_platform_database.selectOAuthConnectionsByIds)(uniqueIds(rows, (row) => row.authKind === "oauth_managed" ? row.connectionId : null))
|
|
49579
52569
|
]);
|
|
49580
52570
|
return {
|
|
49581
52571
|
projectNameById: new Map(projects.map((project) => [project.id, project.name])),
|
|
@@ -49641,7 +52631,7 @@ const handler$14 = async (c) => {
|
|
|
49641
52631
|
const input = parsed.data;
|
|
49642
52632
|
const resolvedProjects = [];
|
|
49643
52633
|
for (const slug of input.projects) {
|
|
49644
|
-
const project = await
|
|
52634
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectForOrganizationBySlug)(organization.organizationId, slug);
|
|
49645
52635
|
if (!project) return c.json({ error: `Project "${slug}" not found` }, 400);
|
|
49646
52636
|
resolvedProjects.push({
|
|
49647
52637
|
id: project.id,
|
|
@@ -49780,7 +52770,7 @@ function createDeleteCredentialHandler(options = {}) {
|
|
|
49780
52770
|
if (!canManageCredential(existing, user.id)) return c.json({ error: "Forbidden" }, 403);
|
|
49781
52771
|
if (existing.authKind === "oauth_managed") {
|
|
49782
52772
|
if (existing.connectionId) {
|
|
49783
|
-
if ((await (0, _keystrokehq_database.listCredentialInstancesByConnectionId)(existing.connectionId)).every((row) => row.id === existing.id)) await
|
|
52773
|
+
if ((await (0, _keystrokehq_database.listCredentialInstancesByConnectionId)(existing.connectionId)).every((row) => row.id === existing.id)) await (0, _keystrokehq_platform_database.deleteOAuthConnectionById)(existing.connectionId);
|
|
49784
52774
|
}
|
|
49785
52775
|
} else if (existing.authKind === "keystroke") {
|
|
49786
52776
|
if (existing.connectionId) {
|
|
@@ -49798,7 +52788,7 @@ function createDeleteCredentialHandler(options = {}) {
|
|
|
49798
52788
|
//#region src/routes/account/members/GET.ts
|
|
49799
52789
|
const handler$11 = async (c) => {
|
|
49800
52790
|
const { organizationId } = c.get("organization");
|
|
49801
|
-
const members = await
|
|
52791
|
+
const members = await (0, _keystrokehq_platform_database.selectOrganizationMembers)(organizationId);
|
|
49802
52792
|
return c.json(require_dist$2.ListOrganizationMembersResponseSchema.parse({ members: members.map(require_dist$2.mapOrganizationMember) }));
|
|
49803
52793
|
};
|
|
49804
52794
|
//#endregion
|
|
@@ -49850,13 +52840,13 @@ const handler$10 = async (c) => {
|
|
|
49850
52840
|
const body = await c.req.json().catch(() => null);
|
|
49851
52841
|
const parsed = require_dist$2.InviteOrganizationMembersRequestSchema.safeParse(body);
|
|
49852
52842
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid invite request" }), 400);
|
|
49853
|
-
const results = await
|
|
52843
|
+
const results = await (0, _keystrokehq_platform_database.inviteOrganizationMembers)({
|
|
49854
52844
|
organizationId: organization.organizationId,
|
|
49855
52845
|
invitedByUserId: user.id,
|
|
49856
52846
|
emails: parsed.data.emails,
|
|
49857
52847
|
role: parsed.data.role
|
|
49858
52848
|
});
|
|
49859
|
-
const inviter = await
|
|
52849
|
+
const inviter = await (0, _keystrokehq_platform_database.selectUserById)(user.id);
|
|
49860
52850
|
for (const result of results) {
|
|
49861
52851
|
if (!result.invitationId || result.status !== "sent" && result.status !== "pending") continue;
|
|
49862
52852
|
await sendOrganizationInviteEmail({
|
|
@@ -49878,10 +52868,10 @@ const handler$9 = async (c) => {
|
|
|
49878
52868
|
if (!userId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
49879
52869
|
if (!parsed.success) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
49880
52870
|
try {
|
|
49881
|
-
const member = await
|
|
52871
|
+
const member = await (0, _keystrokehq_platform_database.updateOrganizationMemberRole)(organizationId, userId, parsed.data.role);
|
|
49882
52872
|
return c.json(require_dist$2.UpdateOrganizationMemberResponseSchema.parse({ member: require_dist$2.mapOrganizationMember(member) }));
|
|
49883
52873
|
} catch (error) {
|
|
49884
|
-
if (error instanceof
|
|
52874
|
+
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
49885
52875
|
throw error;
|
|
49886
52876
|
}
|
|
49887
52877
|
};
|
|
@@ -49892,17 +52882,17 @@ const handler$8 = async (c) => {
|
|
|
49892
52882
|
const userId = c.req.param("userId");
|
|
49893
52883
|
if (!userId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
49894
52884
|
try {
|
|
49895
|
-
await
|
|
52885
|
+
await (0, _keystrokehq_platform_database.removeOrganizationMember)(organizationId, userId);
|
|
49896
52886
|
return c.body(null, 204);
|
|
49897
52887
|
} catch (error) {
|
|
49898
|
-
if (error instanceof
|
|
52888
|
+
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
49899
52889
|
throw error;
|
|
49900
52890
|
}
|
|
49901
52891
|
};
|
|
49902
52892
|
//#endregion
|
|
49903
52893
|
//#region src/routes/account/invitations/GET.ts
|
|
49904
52894
|
const handler$7 = async (c) => {
|
|
49905
|
-
const invitations = await
|
|
52895
|
+
const invitations = await (0, _keystrokehq_platform_database.selectPendingInvitationsForUser)(c.get("user").id);
|
|
49906
52896
|
return c.json(require_dist$2.ListOrganizationInvitationsResponseSchema.parse({ invitations: invitations.map(require_dist$2.mapOrganizationInvitation) }));
|
|
49907
52897
|
};
|
|
49908
52898
|
//#endregion
|
|
@@ -49912,12 +52902,12 @@ const handler$6 = async (c) => {
|
|
|
49912
52902
|
const invitationId = c.req.param("invitationId");
|
|
49913
52903
|
if (!invitationId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
49914
52904
|
try {
|
|
49915
|
-
const membership = await
|
|
52905
|
+
const membership = await (0, _keystrokehq_platform_database.acceptInvitation)(invitationId, user.id);
|
|
49916
52906
|
return c.json(require_dist$2.AcceptOrganizationInvitationResponseSchema.parse({ organization: require_dist$2.mapUserOrganization(membership) }));
|
|
49917
52907
|
} catch (error) {
|
|
49918
|
-
if (error instanceof
|
|
49919
|
-
if (error instanceof
|
|
49920
|
-
if (error instanceof
|
|
52908
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
52909
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
52910
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationExpiredError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 410);
|
|
49921
52911
|
throw error;
|
|
49922
52912
|
}
|
|
49923
52913
|
};
|
|
@@ -49928,11 +52918,11 @@ const handler$5 = async (c) => {
|
|
|
49928
52918
|
const invitationId = c.req.param("invitationId");
|
|
49929
52919
|
if (!invitationId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
49930
52920
|
try {
|
|
49931
|
-
await
|
|
52921
|
+
await (0, _keystrokehq_platform_database.declineInvitation)(invitationId, user.id);
|
|
49932
52922
|
return c.json(require_dist$2.DeclineOrganizationInvitationResponseSchema.parse({ success: true }));
|
|
49933
52923
|
} catch (error) {
|
|
49934
|
-
if (error instanceof
|
|
49935
|
-
if (error instanceof
|
|
52924
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
52925
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
49936
52926
|
throw error;
|
|
49937
52927
|
}
|
|
49938
52928
|
};
|
|
@@ -49954,7 +52944,7 @@ function appRowToCatalogEntry(row) {
|
|
|
49954
52944
|
//#endregion
|
|
49955
52945
|
//#region src/routes/account/apps/GET.ts
|
|
49956
52946
|
const handler$4 = async (c) => {
|
|
49957
|
-
const apps = (await
|
|
52947
|
+
const apps = (await (0, _keystrokehq_platform_database.listOfficialApps)()).map(appRowToCatalogEntry);
|
|
49958
52948
|
return c.json(require_dist$2.ListAppsResponseSchema.parse({ apps }));
|
|
49959
52949
|
};
|
|
49960
52950
|
//#endregion
|
|
@@ -49962,15 +52952,15 @@ const handler$4 = async (c) => {
|
|
|
49962
52952
|
const handler$3 = async (c) => {
|
|
49963
52953
|
const { organizationId } = c.get("organization");
|
|
49964
52954
|
const user = c.get("user");
|
|
49965
|
-
const records = apiKeyListScope(accessContext(c)).kind === "all" ? await
|
|
49966
|
-
const creators = await
|
|
52955
|
+
const records = apiKeyListScope(accessContext(c)).kind === "all" ? await (0, _keystrokehq_platform_database.listOrgPlatformApiKeysForOrganization)(organizationId) : await (0, _keystrokehq_platform_database.listOrgPlatformApiKeysForUser)(organizationId, user.id);
|
|
52956
|
+
const creators = await (0, _keystrokehq_platform_database.selectUsersByIds)([...new Set(records.map((record) => record.createdByUserId))]);
|
|
49967
52957
|
const creatorsById = new Map(creators.map((creator) => [creator.id, creator]));
|
|
49968
52958
|
return c.json(require_dist$2.ListApiKeysResponseSchema.parse({ apiKeys: records.map((record) => ({
|
|
49969
52959
|
id: record.id,
|
|
49970
52960
|
name: record.name,
|
|
49971
52961
|
keyPreview: record.keyPreview,
|
|
49972
52962
|
createdAt: record.createdAt.toISOString(),
|
|
49973
|
-
createdBy:
|
|
52963
|
+
createdBy: (0, _keystrokehq_platform_database.mapOrgPlatformApiKeyCreatorOrDeleted)(record.createdByUserId, creatorsById.get(record.createdByUserId)),
|
|
49974
52964
|
isCreatedByCurrentUser: record.createdByUserId === user.id
|
|
49975
52965
|
})) }));
|
|
49976
52966
|
};
|
|
@@ -49980,19 +52970,19 @@ const handler$2 = async (c) => {
|
|
|
49980
52970
|
const { organizationId } = c.get("organization");
|
|
49981
52971
|
const user = c.get("user");
|
|
49982
52972
|
const body = require_dist$2.CreateApiKeyRequestSchema.parse(await c.req.json());
|
|
49983
|
-
const created = await
|
|
52973
|
+
const created = await (0, _keystrokehq_platform_database.createOrgPlatformApiKey)({
|
|
49984
52974
|
organizationId,
|
|
49985
52975
|
userId: user.id,
|
|
49986
52976
|
name: body.name
|
|
49987
52977
|
});
|
|
49988
|
-
const creator = await
|
|
52978
|
+
const creator = await (0, _keystrokehq_platform_database.loadOrgPlatformApiKeyUser)(user.id);
|
|
49989
52979
|
if (!creator) return c.json({ error: "User not found" }, 404);
|
|
49990
52980
|
return c.json(require_dist$2.CreateApiKeyResponseSchema.parse({
|
|
49991
52981
|
id: created.id,
|
|
49992
52982
|
name: created.name,
|
|
49993
52983
|
keyPreview: created.keyPreview,
|
|
49994
52984
|
createdAt: created.createdAt.toISOString(),
|
|
49995
|
-
createdBy:
|
|
52985
|
+
createdBy: (0, _keystrokehq_platform_database.mapOrgPlatformApiKeyCreator)(creator),
|
|
49996
52986
|
isCreatedByCurrentUser: true,
|
|
49997
52987
|
secret: created.secret
|
|
49998
52988
|
}), 201);
|
|
@@ -50004,7 +52994,7 @@ const handler$1 = async (c) => {
|
|
|
50004
52994
|
const user = c.get("user");
|
|
50005
52995
|
const apiKeyId = c.req.param("apiKeyId");
|
|
50006
52996
|
if (!apiKeyId) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "API key id is required" }), 400);
|
|
50007
|
-
const apiKey = await
|
|
52997
|
+
const apiKey = await (0, _keystrokehq_platform_database.selectOrgPlatformApiKeyForOrganization)(apiKeyId, organizationId);
|
|
50008
52998
|
if (!apiKey) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: "API key not found" }), 404);
|
|
50009
52999
|
if (!canReadApiKey(accessContext(c), {
|
|
50010
53000
|
userId: user.id,
|
|
@@ -50015,10 +53005,10 @@ const handler$1 = async (c) => {
|
|
|
50015
53005
|
createdByUserId: apiKey.createdByUserId
|
|
50016
53006
|
})) return forbidden(c);
|
|
50017
53007
|
try {
|
|
50018
|
-
await
|
|
53008
|
+
await (0, _keystrokehq_platform_database.revokeOrgPlatformApiKey)(apiKeyId, organizationId);
|
|
50019
53009
|
return c.body(null, 204);
|
|
50020
53010
|
} catch (error) {
|
|
50021
|
-
if (error instanceof
|
|
53011
|
+
if (error instanceof _keystrokehq_platform_database.OrgPlatformApiKeyNotFoundError) return c.json(require_dist$2.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
50022
53012
|
throw error;
|
|
50023
53013
|
}
|
|
50024
53014
|
};
|
|
@@ -50101,7 +53091,7 @@ const handler = async (c) => {
|
|
|
50101
53091
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
50102
53092
|
return c.json({ error: message }, 400);
|
|
50103
53093
|
}
|
|
50104
|
-
const organization = await
|
|
53094
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationContext.organizationId);
|
|
50105
53095
|
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
50106
53096
|
try {
|
|
50107
53097
|
await postTeamRequestToSlack({
|
|
@@ -50269,13 +53259,13 @@ async function proxyExaWebSearchRequest(options) {
|
|
|
50269
53259
|
//#endregion
|
|
50270
53260
|
//#region src/routes/internal/with-project-scope.ts
|
|
50271
53261
|
async function withProjectScope(projectId, fn) {
|
|
50272
|
-
const project = await
|
|
53262
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectById)(projectId);
|
|
50273
53263
|
if (!project) return;
|
|
50274
|
-
const organization = await
|
|
53264
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
50275
53265
|
if (!organization) return;
|
|
50276
|
-
const url =
|
|
53266
|
+
const url = (0, _keystrokehq_platform_database.resolveOrgDatabaseUrl)(organization);
|
|
50277
53267
|
let result;
|
|
50278
|
-
await
|
|
53268
|
+
await (0, _keystrokehq_platform_database.runWithOrganizationScope)(project.organizationId, () => (0, _keystrokehq_database.runWithProjectDatabase)({
|
|
50279
53269
|
url,
|
|
50280
53270
|
searchPath: organization.dbSchema
|
|
50281
53271
|
}, () => (0, _keystrokehq_database.runWithProjectScope)(project.id, () => (0, _keystrokehq_database.runWithTenantScope)(project.organizationId, async () => {
|
|
@@ -50434,7 +53424,7 @@ function mountInternalRoutes(workerToken, tokenRefresh, llmProxy, sandboxProxy)
|
|
|
50434
53424
|
const origin = (0, _keystrokehq_http.platformWebhookOrigin)(projectId, (0, _keystrokehq_http.externalPlatformOrigin)());
|
|
50435
53425
|
if (!origin) return c.json({ error: "PUBLIC_PLATFORM_URL is not configured" }, 500);
|
|
50436
53426
|
try {
|
|
50437
|
-
const token = await
|
|
53427
|
+
const token = await (0, _keystrokehq_platform_database.ensureWebhookApiKeyForRoute)(projectId, parsed.data.route, parsed.data.attachmentKeys);
|
|
50438
53428
|
return c.json({ webhookUrl: (0, _keystrokehq_runtime.buildWebhookUrl)(origin, parsed.data.route, token) });
|
|
50439
53429
|
} catch (error) {
|
|
50440
53430
|
const message = error instanceof Error ? error.message : "Failed to ensure webhook API key.";
|
|
@@ -50484,19 +53474,19 @@ async function usesPgBossScheduler() {
|
|
|
50484
53474
|
}
|
|
50485
53475
|
async function startPlatformServer(platformConfig, hooks = {}) {
|
|
50486
53476
|
const runtime = platformConfig.hosting.createRuntime();
|
|
50487
|
-
await
|
|
53477
|
+
await (0, _keystrokehq_platform_database.initDatabase)();
|
|
50488
53478
|
await require_dist$2.ensureKeystrokeAssetsBucket();
|
|
50489
53479
|
await (0, _keystrokehq_runtime.seedOAuthAppsFromEnvForAllOrganizations)();
|
|
50490
|
-
if (await usesPgBossScheduler()) await
|
|
53480
|
+
if (await usesPgBossScheduler()) await (0, _keystrokehq_platform_database.ensureProjectPgBossGrants)();
|
|
50491
53481
|
await startProjectRuntimeWorker(runtime, { resolveStartInput: async (job) => {
|
|
50492
|
-
const project = await
|
|
53482
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectById)(job.projectId);
|
|
50493
53483
|
if (!project) throw new Error(`Project ${job.projectId} not found`);
|
|
50494
53484
|
const resolved = resolveRuntimeArtifact(project, job.artifactId);
|
|
50495
53485
|
if (resolved.action === "error") throw new Error(resolved.message);
|
|
50496
53486
|
if (resolved.action === "skip") throw new Error(`Project ${job.projectId} has no deploy artifact to start`);
|
|
50497
|
-
const artifact = await
|
|
53487
|
+
const artifact = await (0, _keystrokehq_platform_database.selectProjectArtifactById)(resolved.artifactId);
|
|
50498
53488
|
if (!artifact || artifact.status !== "ready") throw new Error(`Project ${job.projectId} pending artifact is not ready`);
|
|
50499
|
-
const organization = await
|
|
53489
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
50500
53490
|
if (!organization) throw new Error(`Organization not found for project ${job.projectId}`);
|
|
50501
53491
|
const workerRuntime = platformConfig.hosting.workerRuntime;
|
|
50502
53492
|
return {
|
|
@@ -50504,12 +53494,12 @@ async function startPlatformServer(platformConfig, hooks = {}) {
|
|
|
50504
53494
|
name: job.name,
|
|
50505
53495
|
artifactId: resolved.artifactId,
|
|
50506
53496
|
artifactStorageKey: artifact.storageKey,
|
|
50507
|
-
database: await
|
|
53497
|
+
database: await (0, _keystrokehq_platform_database.resolveProjectRuntimeDatabase)({
|
|
50508
53498
|
organizationId: project.organizationId,
|
|
50509
53499
|
projectId: project.id
|
|
50510
53500
|
}),
|
|
50511
53501
|
env: {
|
|
50512
|
-
...
|
|
53502
|
+
...(0, _keystrokehq_platform_database.orgWorkspacesRuntimeEnv)(organization, { containerEnv: process.env }),
|
|
50513
53503
|
...platformConfig.llmProxy?.workerEnv({
|
|
50514
53504
|
platformUrl: workerRuntime.platformUrl,
|
|
50515
53505
|
workerToken: workerRuntime.workerToken,
|
|
@@ -50691,4 +53681,4 @@ Object.defineProperty(exports, "x$1", {
|
|
|
50691
53681
|
}
|
|
50692
53682
|
});
|
|
50693
53683
|
|
|
50694
|
-
//# sourceMappingURL=start-
|
|
53684
|
+
//# sourceMappingURL=start-Cm1hxyF_.cjs.map
|