@seedprotocol/sdk 0.4.32 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BasePathResolver-BDgc7c4T.js +485 -0
- package/dist/BasePathResolver-BDgc7c4T.js.map +1 -0
- package/dist/{ModelProperty-e_hXSFvf.js → ModelProperty-D-ysg8zA.js} +37 -43
- package/dist/ModelProperty-D-ysg8zA.js.map +1 -0
- package/dist/{Schema-DonRkUOJ.js → Schema-CyCftnKI.js} +40 -40
- package/dist/{Schema-DonRkUOJ.js.map → Schema-CyCftnKI.js.map} +1 -1
- package/dist/{SchemaValidationService-DcmfhQae.js → SchemaValidationService-POM6jHbJ.js} +9 -5
- package/dist/{SchemaValidationService-DcmfhQae.js.map → SchemaValidationService-POM6jHbJ.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-CKTfvFgQ.js → backfillMetadataPropertyIds-DzZw57iJ.js} +3 -11
- package/dist/{backfillMetadataPropertyIds-CKTfvFgQ.js.map → backfillMetadataPropertyIds-DzZw57iJ.js.map} +1 -1
- package/dist/cjs/{ModelProperty-BQYU5hPQ.js → ModelProperty-CmuGJvyi.js} +25 -26
- package/dist/cjs/{ModelProperty-BQYU5hPQ.js.map → ModelProperty-CmuGJvyi.js.map} +1 -1
- package/dist/cjs/{Schema-BcRHcQ0W.js → Schema-gpFnZMhB.js} +28 -29
- package/dist/cjs/{Schema-BcRHcQ0W.js.map → Schema-gpFnZMhB.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-CQNDgyZl.js → SchemaValidationService-E3xTSRai.js} +9 -10
- package/dist/cjs/{SchemaValidationService-CQNDgyZl.js.map → SchemaValidationService-E3xTSRai.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-Dn4oVmEv.js → backfillMetadataPropertyIds-_bivrvRs.js} +11 -12
- package/dist/cjs/{backfillMetadataPropertyIds-Dn4oVmEv.js.map → backfillMetadataPropertyIds-_bivrvRs.js.map} +1 -1
- package/dist/cjs/eas-BwDKJmlb.js +112 -0
- package/dist/cjs/eas-BwDKJmlb.js.map +1 -0
- package/dist/cjs/{getItem-DpnPrzl3.js → getItem-MShQw3sz.js} +11 -12
- package/dist/cjs/{getItem-DpnPrzl3.js.map → getItem-MShQw3sz.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-CGKMEL3H.js → getPublishPayload-C1nOOXp_.js} +93 -83
- package/dist/cjs/getPublishPayload-C1nOOXp_.js.map +1 -0
- package/dist/cjs/{getPublishUploads-DeI0f2UN.js → getPublishUploads-BjgxgrKD.js} +17 -18
- package/dist/cjs/{getPublishUploads-DeI0f2UN.js.map → getPublishUploads-BjgxgrKD.js.map} +1 -1
- package/dist/cjs/{getSegmentedItemProperties-BgS_FhAx.js → getSegmentedItemProperties-Cuw7wcxb.js} +64 -15
- package/dist/cjs/getSegmentedItemProperties-Cuw7wcxb.js.map +1 -0
- package/dist/cjs/{index-BnAqr2le.js → index-9Z2FOvLD.js} +12 -13
- package/dist/cjs/index-9Z2FOvLD.js.map +1 -0
- package/dist/cjs/{index-ByozbTn_.js → index-vk2DeF2D.js} +1237 -3235
- package/dist/cjs/index-vk2DeF2D.js.map +1 -0
- package/dist/cjs/index.browser-BSf8HpnU.js +22 -0
- package/dist/cjs/index.browser-BSf8HpnU.js.map +1 -0
- package/dist/cjs/{ownership-CsWuaNfH.js → ownership-DhWda0J9.js} +11 -25
- package/dist/cjs/{ownership-CsWuaNfH.js.map → ownership-DhWda0J9.js.map} +1 -1
- package/dist/cjs/{property-CeR45LMx.js → property-D3Ww2_Qh.js} +13 -14
- package/dist/cjs/{property-CeR45LMx.js.map → property-D3Ww2_Qh.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-CA2Lum5V.js → syncDbWithEas-Dht3_7UD.js} +26 -39
- package/dist/cjs/syncDbWithEas-Dht3_7UD.js.map +1 -0
- package/dist/configurePlatform-R5neRbQ9.js +27 -0
- package/dist/configurePlatform-R5neRbQ9.js.map +1 -0
- package/dist/constants-B5S5JPDK.js +660 -0
- package/dist/constants-B5S5JPDK.js.map +1 -0
- package/dist/constants-DMHTYMgJ.js +120 -0
- package/dist/constants-DMHTYMgJ.js.map +1 -0
- package/dist/db-Cvh84NY7.js +1972 -0
- package/dist/db-Cvh84NY7.js.map +1 -0
- package/dist/eas-D9b7z2Wn.js +68 -0
- package/dist/eas-D9b7z2Wn.js.map +1 -0
- package/dist/{getItem-GOXWo_Iy.js → getItem-B81V3m4S.js} +10 -6
- package/dist/{getItem-GOXWo_Iy.js.map → getItem-B81V3m4S.js.map} +1 -1
- package/dist/{getPublishPayload-D16enahU.js → getPublishPayload-CNYsn8-6.js} +87 -74
- package/dist/getPublishPayload-CNYsn8-6.js.map +1 -0
- package/dist/{getPublishUploads-wGqH19UY.js → getPublishUploads-D9rPHkB7.js} +14 -10
- package/dist/{getPublishUploads-wGqH19UY.js.map → getPublishUploads-D9rPHkB7.js.map} +1 -1
- package/dist/{getSegmentedItemProperties-Be3kYWY3.js → getSegmentedItemProperties-Bg3_b-b1.js} +18 -15
- package/dist/getSegmentedItemProperties-Bg3_b-b1.js.map +1 -0
- package/dist/{index-BcXKZQpX.js → index--F3Wolt5.js} +1171 -5452
- package/dist/index--F3Wolt5.js.map +1 -0
- package/dist/{index-BFyMxc7e.js → index-QMrBK-L3.js} +2 -2
- package/dist/index-QMrBK-L3.js.map +1 -0
- package/dist/index-oi4roUVf.js +22 -0
- package/dist/index-oi4roUVf.js.map +1 -0
- package/dist/index.node-Bow8kHew.js +503 -0
- package/dist/index.node-Bow8kHew.js.map +1 -0
- package/dist/main.cjs +16 -15
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +31 -22
- package/dist/main.js.map +1 -1
- package/dist/node.js +37 -363
- package/dist/node.js.map +1 -1
- package/dist/{ownership-C17YhE7J.js → ownership-BF_ZUKIp.js} +13 -9
- package/dist/{ownership-C17YhE7J.js.map → ownership-BF_ZUKIp.js.map} +1 -1
- package/dist/platform.browser.js +3499 -0
- package/dist/platform.browser.js.map +1 -0
- package/dist/platform.node.js +19 -0
- package/dist/platform.node.js.map +1 -0
- package/dist/{property-CRAau-Q-.js → property-BdyDfcSc.js} +14 -11
- package/dist/property-BdyDfcSc.js.map +1 -0
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/actors/fetchDataFromEas.d.ts.map +1 -1
- package/dist/src/Model/service/actors/createModelProperties.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +1 -1
- package/dist/src/browser/db/Db.d.ts +17 -18
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/helpers/ArweaveClient.d.ts +10 -27
- package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
- package/dist/src/browser/helpers/EasClient.d.ts +6 -4
- package/dist/src/browser/helpers/EasClient.d.ts.map +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts +27 -26
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/browser/helpers/PathResolver.d.ts +6 -5
- package/dist/src/browser/helpers/PathResolver.d.ts.map +1 -1
- package/dist/src/browser/helpers/QueryClient.d.ts +6 -5
- package/dist/src/browser/helpers/QueryClient.d.ts.map +1 -1
- package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/db/Db/BaseDb.d.ts +6 -26
- package/dist/src/db/Db/BaseDb.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/write/createMetadata.d.ts.map +1 -1
- package/dist/src/db/write/updateMetadata.d.ts.map +1 -1
- package/dist/src/eas.d.ts +4 -37
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts +1 -101
- package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts +1 -51
- package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/index.d.ts +2 -2
- package/dist/src/helpers/ArweaveClient/index.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts +1 -15
- package/dist/src/helpers/ArweaveClient/selectReadGateway.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts +1 -22
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts.map +1 -1
- package/dist/src/helpers/EasClient/BaseEasClient.d.ts +1 -9
- package/dist/src/helpers/EasClient/BaseEasClient.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts +4 -2
- package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/IFileManager.d.ts +44 -0
- package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -0
- package/dist/src/helpers/PathResolver/BasePathResolver.d.ts +16 -12
- package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +1 -1
- package/dist/src/helpers/PathResolver/IPathResolver.d.ts +16 -0
- package/dist/src/helpers/PathResolver/IPathResolver.d.ts.map +1 -0
- package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts +1 -6
- package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts +4 -22
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/easPropertyCanonical.d.ts +1 -14
- package/dist/src/helpers/easPropertyCanonical.d.ts.map +1 -1
- package/dist/src/helpers/easRevokedFilter.d.ts +1 -9
- package/dist/src/helpers/easRevokedFilter.d.ts.map +1 -1
- package/dist/src/helpers/easUid.d.ts +1 -12
- package/dist/src/helpers/easUid.d.ts.map +1 -1
- package/dist/src/helpers/ethereumUtils.d.ts +5 -0
- package/dist/src/helpers/ethereumUtils.d.ts.map +1 -0
- package/dist/src/helpers/file/fetchAll/index.d.ts +1 -1
- package/dist/src/helpers/file/fetchAll/index.d.ts.map +1 -1
- package/dist/src/helpers/gateway/gatewayState.d.ts +2 -0
- package/dist/src/helpers/gateway/gatewayState.d.ts.map +1 -0
- package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts +2 -0
- package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts.map +1 -0
- package/dist/src/helpers/gateway/seedGatewayConfig.d.ts +2 -0
- package/dist/src/helpers/gateway/seedGatewayConfig.d.ts.map +1 -0
- package/dist/src/helpers/generateId.d.ts +2 -0
- package/dist/src/helpers/generateId.d.ts.map +1 -0
- package/dist/src/helpers/getSchemaForItemProperty.d.ts +1 -1
- package/dist/src/helpers/getSchemaForItemProperty.d.ts.map +1 -1
- package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +15 -10
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts +7 -0
- package/dist/src/helpers/isSqliteUniqueConstraintError.d.ts.map +1 -0
- package/dist/src/helpers/mediaRef.d.ts.map +1 -1
- package/dist/src/helpers/property/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +9 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IDb.d.ts +11 -0
- package/dist/src/interfaces/IDb.d.ts.map +1 -1
- package/dist/src/node/db/Db.d.ts +22 -37
- package/dist/src/node/db/Db.d.ts.map +1 -1
- package/dist/src/node/helpers/ArweaveClient.d.ts +4 -30
- package/dist/src/node/helpers/ArweaveClient.d.ts.map +1 -1
- package/dist/src/node/helpers/EasClient.d.ts +4 -6
- package/dist/src/node/helpers/EasClient.d.ts.map +1 -1
- package/dist/src/node/helpers/FileManager.d.ts +26 -25
- package/dist/src/node/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/node/helpers/PathResolver.d.ts +6 -5
- package/dist/src/node/helpers/PathResolver.d.ts.map +1 -1
- package/dist/src/node/helpers/QueryClient.d.ts +4 -6
- package/dist/src/node/helpers/QueryClient.d.ts.map +1 -1
- package/dist/src/node/helpers/scripts.d.ts +5 -7
- package/dist/src/node/helpers/scripts.d.ts.map +1 -1
- package/dist/src/node/index.d.ts +2 -9
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/node/webpack/index.d.ts +1 -1
- package/dist/src/node/webpack/index.d.ts.map +1 -1
- package/dist/src/platform/configurePlatform.d.ts +6 -0
- package/dist/src/platform/configurePlatform.d.ts.map +1 -0
- package/dist/src/platform/index.browser.d.ts +3 -0
- package/dist/src/platform/index.browser.d.ts.map +1 -0
- package/dist/src/platform/index.d.ts +9 -0
- package/dist/src/platform/index.d.ts.map +1 -0
- package/dist/src/platform/index.node.d.ts +3 -0
- package/dist/src/platform/index.node.d.ts.map +1 -0
- package/dist/src/platform/types.d.ts +14 -0
- package/dist/src/platform/types.d.ts.map +1 -0
- package/dist/src/stores/eas.d.ts +1 -18
- package/dist/src/stores/eas.d.ts.map +1 -1
- package/dist/src/testing/platformTestHandle.d.ts +8 -0
- package/dist/src/testing/platformTestHandle.d.ts.map +1 -0
- package/dist/src/types/gateway.d.ts +2 -0
- package/dist/src/types/gateway.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +5 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/item.d.ts +1 -1
- package/dist/src/types/item.d.ts.map +1 -1
- package/dist/src/types/machines.d.ts +10 -0
- package/dist/src/types/machines.d.ts.map +1 -1
- package/dist/src/types/seedProtocol.d.ts +1 -1
- package/dist/src/types/seedProtocol.d.ts.map +1 -1
- package/dist/src/vite/index.d.ts +2 -47
- package/dist/src/vite/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-CB5aXPtf.js → syncDbWithEas-DMOJHtkP.js} +20 -15
- package/dist/syncDbWithEas-DMOJHtkP.js.map +1 -0
- package/dist/{updateSeedRevokedAt-BIu5Q4Po.js → updateSeedRevokedAt-Ba0OhDQj.js} +2 -2
- package/dist/{updateSeedRevokedAt-BIu5Q4Po.js.map → updateSeedRevokedAt-Ba0OhDQj.js.map} +1 -1
- package/dist/vite.cjs +5 -481
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +1 -483
- package/dist/vite.js.map +1 -1
- package/package.json +42 -37
- package/dist/ArweaveClient-CZpZgmR2.js +0 -204
- package/dist/ArweaveClient-CZpZgmR2.js.map +0 -1
- package/dist/ArweaveClient-Cs7AL9dp.js +0 -204
- package/dist/ArweaveClient-Cs7AL9dp.js.map +0 -1
- package/dist/Db-CF6R7HIy.js +0 -2098
- package/dist/Db-CF6R7HIy.js.map +0 -1
- package/dist/Db-CZkONsdT.js +0 -248
- package/dist/Db-CZkONsdT.js.map +0 -1
- package/dist/EasClient-PXOzSzPG.js +0 -29
- package/dist/EasClient-PXOzSzPG.js.map +0 -1
- package/dist/EasClient-qfTiM2we.js +0 -29
- package/dist/EasClient-qfTiM2we.js.map +0 -1
- package/dist/FileManager-5GkHtxF7.js +0 -1256
- package/dist/FileManager-5GkHtxF7.js.map +0 -1
- package/dist/FileManager-jORQ8Bb6.js +0 -177
- package/dist/FileManager-jORQ8Bb6.js.map +0 -1
- package/dist/ModelProperty-e_hXSFvf.js.map +0 -1
- package/dist/PathResolver-B4_X69Rd.js +0 -204
- package/dist/PathResolver-B4_X69Rd.js.map +0 -1
- package/dist/PathResolver-Dz0RVGIz.js +0 -78
- package/dist/PathResolver-Dz0RVGIz.js.map +0 -1
- package/dist/QueryClient-CXHZ239d.js +0 -51
- package/dist/QueryClient-CXHZ239d.js.map +0 -1
- package/dist/QueryClient-D_UK4YLm.js +0 -35
- package/dist/QueryClient-D_UK4YLm.js.map +0 -1
- package/dist/arweave-default-shim.js +0 -6
- package/dist/cjs/getPublishPayload-CGKMEL3H.js.map +0 -1
- package/dist/cjs/getSegmentedItemProperties-BgS_FhAx.js.map +0 -1
- package/dist/cjs/index-BnAqr2le.js.map +0 -1
- package/dist/cjs/index-ByozbTn_.js.map +0 -1
- package/dist/cjs/syncDbWithEas-CA2Lum5V.js.map +0 -1
- package/dist/debug-default-shim.js +0 -27
- package/dist/getPublishPayload-D16enahU.js.map +0 -1
- package/dist/getSegmentedItemProperties-Be3kYWY3.js.map +0 -1
- package/dist/index-BFyMxc7e.js.map +0 -1
- package/dist/index-BcXKZQpX.js.map +0 -1
- package/dist/index-C9p-skT3.js +0 -18
- package/dist/index-C9p-skT3.js.map +0 -1
- package/dist/property-CRAau-Q-.js.map +0 -1
- package/dist/queries-Ct7CcQ3g.js +0 -16
- package/dist/queries-Ct7CcQ3g.js.map +0 -1
- package/dist/src/Item/queries.d.ts +0 -27
- package/dist/src/Item/queries.d.ts.map +0 -1
- package/dist/src/graphql/fragments/Attestation.d.ts +0 -2
- package/dist/src/graphql/fragments/Attestation.d.ts.map +0 -1
- package/dist/src/graphql/fragments/Schema.d.ts +0 -2
- package/dist/src/graphql/fragments/Schema.d.ts.map +0 -1
- package/dist/src/graphql/fragments/index.d.ts +0 -3
- package/dist/src/graphql/fragments/index.d.ts.map +0 -1
- package/dist/src/graphql/gql/fragment-masking.d.ts +0 -20
- package/dist/src/graphql/gql/fragment-masking.d.ts.map +0 -1
- package/dist/src/graphql/gql/gql.d.ts +0 -107
- package/dist/src/graphql/gql/gql.d.ts.map +0 -1
- package/dist/src/graphql/gql/graphql.d.ts +0 -2969
- package/dist/src/graphql/gql/graphql.d.ts.map +0 -1
- package/dist/src/graphql/gql/index.d.ts +0 -3
- package/dist/src/graphql/gql/index.d.ts.map +0 -1
- package/dist/src/helpers/ArweaveClient/queries.d.ts +0 -13
- package/dist/src/helpers/ArweaveClient/queries.d.ts.map +0 -1
- package/dist/src/helpers/file/queries.d.ts +0 -9
- package/dist/src/helpers/file/queries.d.ts.map +0 -1
- package/dist/src/helpers/image/queries.d.ts +0 -7
- package/dist/src/helpers/image/queries.d.ts.map +0 -1
- package/dist/src/node/codegen/drizzle.d.ts +0 -5
- package/dist/src/node/codegen/drizzle.d.ts.map +0 -1
- package/dist/src/node/codegen/index.d.ts +0 -2
- package/dist/src/node/codegen/index.d.ts.map +0 -1
- package/dist/src/node/codegen/ts-to-proto.d.ts +0 -9
- package/dist/src/node/codegen/ts-to-proto.d.ts.map +0 -1
- package/dist/src/node/db/node.app.db.config.d.ts +0 -4
- package/dist/src/node/db/node.app.db.config.d.ts.map +0 -1
- package/dist/src/node/helpers/index.d.ts +0 -3
- package/dist/src/node/helpers/index.d.ts.map +0 -1
- package/dist/src/vite/arweave-default-shim.d.ts +0 -4
- package/dist/src/vite/arweave-default-shim.d.ts.map +0 -1
- package/dist/src/vite/debug-default-shim.d.ts +0 -3
- package/dist/src/vite/debug-default-shim.d.ts.map +0 -1
- package/dist/src/vite/easFix.d.ts +0 -2
- package/dist/src/vite/easFix.d.ts.map +0 -1
- package/dist/syncDbWithEas-CB5aXPtf.js.map +0 -1
- /package/dist/db/drizzle/{drizzle/0000_married_malice.sql → 0000_married_malice.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0001_sweet_bruce_banner.sql → 0001_sweet_bruce_banner.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0002_bitter_proudstar.sql → 0002_bitter_proudstar.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0003_cultured_senator_kelly.sql → 0003_cultured_senator_kelly.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0004_add_publisher_to_seeds.sql → 0004_add_publisher_to_seeds.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0005_bright_lily_hollister.sql → 0005_bright_lily_hollister.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0006_add_publisher_to_versions_and_metadata.sql → 0006_add_publisher_to_versions_and_metadata.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0007_add_required_to_properties.sql → 0007_add_required_to_properties.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0008_add_revoked_at_to_seeds.sql → 0008_add_revoked_at_to_seeds.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0009_happy_namor.sql → 0009_happy_namor.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0010_add_arweave_l1_finalize_jobs.sql → 0010_add_arweave_l1_finalize_jobs.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0011_normalize_placeholder_uids.sql → 0011_normalize_placeholder_uids.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0012_html_embedded_image_co_publish.sql → 0012_html_embedded_image_co_publish.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/0013_eas_sync_processes.sql → 0013_eas_sync_processes.sql} +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0000_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0001_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0002_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0003_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0004_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0005_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0006_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0007_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0008_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0009_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0010_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/0013_snapshot.json +0 -0
- /package/dist/db/drizzle/{drizzle/meta → meta}/_journal.json +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as appState, c as arweaveL1FinalizeJobs, d as config, e as easSyncProcesses, h as htmlEmbeddedImageCoPublish, f as metadata, g as modelRelations, i as modelSchemas, j as modelUids, m as models, k as modelsRelations, p as properties, l as propertiesRelations, n as propertyUidRelations, o as propertyUids, q as publishProcesses, r as schemas, s as seeds, u as uploadProcesses, v as versions } from './BasePathResolver-BDgc7c4T.js';
|
|
2
2
|
|
|
3
3
|
var schema = /*#__PURE__*/Object.freeze({
|
|
4
4
|
__proto__: null,
|
|
@@ -25,4 +25,4 @@ var schema = /*#__PURE__*/Object.freeze({
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
export { schema as s };
|
|
28
|
-
//# sourceMappingURL=index-
|
|
28
|
+
//# sourceMappingURL=index-QMrBK-L3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-QMrBK-L3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
export { M as Model, a as TModelSchema, T as TModelValues } from './index--F3Wolt5.js';
|
|
3
|
+
export { B as Boolean, i as DEFAULT_TEXT_MAX_LENGTH, D as Date, F as File, H as Html, I as Image, J as Json, L as List, M as ModelPropertyDataTypes, N as Number, P as Property, g as PropertyConstructor, f as PropertyMetadataKey, R as Relation, b as THtmlEmbeddedDataUriPolicy, c as TProperty, d as TPropertyConstructor, T as TPropertyDataType, e as TPropertyDefs, a as TStorageType, j as TValidationRules, h as Text, n as normalizeDataType } from './constants-B5S5JPDK.js';
|
|
4
|
+
export { getPropertySchema } from './property-BdyDfcSc.js';
|
|
5
|
+
import 'xstate';
|
|
6
|
+
import './BasePathResolver-BDgc7c4T.js';
|
|
7
|
+
import 'drizzle-orm/sqlite-core';
|
|
8
|
+
import 'drizzle-orm';
|
|
9
|
+
import 'debug';
|
|
10
|
+
import 'nanoid';
|
|
11
|
+
import 'nanoid-dictionary';
|
|
12
|
+
import './db-Cvh84NY7.js';
|
|
13
|
+
import 'drizzle-orm/casing';
|
|
14
|
+
import 'lodash-es';
|
|
15
|
+
import 'pluralize';
|
|
16
|
+
import '@seedprotocol/eas';
|
|
17
|
+
import './constants-DMHTYMgJ.js';
|
|
18
|
+
import '@seedprotocol/arweave';
|
|
19
|
+
import 'rxjs';
|
|
20
|
+
import 'js-sha3';
|
|
21
|
+
import '@sinclair/typebox';
|
|
22
|
+
//# sourceMappingURL=index-oi4roUVf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-oi4roUVf.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import fs__default from 'fs';
|
|
4
|
+
import { SEED_CONFIG_FILE, SEED_CONFIG_FALLBACKS } from './constants-DMHTYMgJ.js';
|
|
5
|
+
import { a as BaseFileManager, b as appState, t as BasePathResolver, B as BaseDb } from './BasePathResolver-BDgc7c4T.js';
|
|
6
|
+
import debug from 'debug';
|
|
7
|
+
import * as fsAsync from 'fs/promises';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { s as schema } from './index-QMrBK-L3.js';
|
|
10
|
+
import { createClient } from '@libsql/client';
|
|
11
|
+
import { drizzle } from 'drizzle-orm/libsql';
|
|
12
|
+
import { migrate } from 'drizzle-orm/libsql/migrator';
|
|
13
|
+
import { interval, startWith, switchMap, distinctUntilChanged } from 'rxjs';
|
|
14
|
+
import { NodeArweaveClient } from '@seedprotocol/arweave/node';
|
|
15
|
+
import { NodeQueryClient, NodeEasClient } from '@seedprotocol/eas/node';
|
|
16
|
+
|
|
17
|
+
class NodeFileManager {
|
|
18
|
+
async getFs() {
|
|
19
|
+
return fs;
|
|
20
|
+
}
|
|
21
|
+
getFsSync() {
|
|
22
|
+
return fs;
|
|
23
|
+
}
|
|
24
|
+
async getContentUrlFromPath(_path) {
|
|
25
|
+
throw new Error('Not implemented');
|
|
26
|
+
}
|
|
27
|
+
async initializeFileSystem(_workingDir) {
|
|
28
|
+
return; // No need to initialize file system in node
|
|
29
|
+
}
|
|
30
|
+
async downloadAllFiles() {
|
|
31
|
+
throw new Error('Not implemented');
|
|
32
|
+
}
|
|
33
|
+
async resizeImage() {
|
|
34
|
+
throw new Error('Not implemented');
|
|
35
|
+
}
|
|
36
|
+
async resizeAllImages() {
|
|
37
|
+
throw new Error('Not implemented');
|
|
38
|
+
}
|
|
39
|
+
async pathExists(filePath) {
|
|
40
|
+
return await fsAsync.access(filePath).then(() => true).catch(() => false);
|
|
41
|
+
}
|
|
42
|
+
async listImageFiles() {
|
|
43
|
+
return this.listFiles('images');
|
|
44
|
+
}
|
|
45
|
+
async listFiles(dir) {
|
|
46
|
+
const targetDir = BaseFileManager.getFilesPath(dir);
|
|
47
|
+
const exists = await this.pathExists(targetDir);
|
|
48
|
+
if (!exists) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
const entries = await fsAsync.readdir(targetDir, { withFileTypes: true });
|
|
52
|
+
return entries.filter((entry) => entry.isFile()).map((entry) => entry.name);
|
|
53
|
+
}
|
|
54
|
+
async createDirIfNotExists(filePath) {
|
|
55
|
+
await fsAsync.mkdir(filePath, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
async waitForFile(filePath, interval = 1000, timeout = 60000) {
|
|
58
|
+
const pathExists = await this.pathExists(filePath);
|
|
59
|
+
if (pathExists) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
const startTime = Date.now();
|
|
64
|
+
let isBusy = false;
|
|
65
|
+
const checkInterval = setInterval(async () => {
|
|
66
|
+
if (isBusy) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
isBusy = true;
|
|
70
|
+
try {
|
|
71
|
+
const exists = await this.pathExists(filePath);
|
|
72
|
+
if (exists) {
|
|
73
|
+
clearInterval(checkInterval);
|
|
74
|
+
resolve(true);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (Date.now() - startTime >= timeout) {
|
|
78
|
+
clearInterval(checkInterval);
|
|
79
|
+
reject(new Error('Timeout exceeded while waiting for file'));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
clearInterval(checkInterval);
|
|
85
|
+
reject(error);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
isBusy = false;
|
|
90
|
+
}
|
|
91
|
+
}, interval);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async waitForFileWithContent(filePath, interval = 100, timeout = 5000) {
|
|
95
|
+
return this.waitForFile(filePath, interval, timeout);
|
|
96
|
+
}
|
|
97
|
+
async saveFile(filePath, content) {
|
|
98
|
+
const dir = path.dirname(filePath);
|
|
99
|
+
await fsAsync.mkdir(dir, { recursive: true });
|
|
100
|
+
if (typeof content === 'string') {
|
|
101
|
+
await fsAsync.writeFile(filePath, content, 'utf-8');
|
|
102
|
+
}
|
|
103
|
+
else if (content instanceof Blob) {
|
|
104
|
+
const arrayBuffer = await content.arrayBuffer();
|
|
105
|
+
await fsAsync.writeFile(filePath, new Uint8Array(arrayBuffer));
|
|
106
|
+
}
|
|
107
|
+
else if (content instanceof ArrayBuffer) {
|
|
108
|
+
await fsAsync.writeFile(filePath, new Uint8Array(content));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
throw new Error('Unsupported content type');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
saveFileSync(filePath, content) {
|
|
115
|
+
const dir = path.dirname(filePath);
|
|
116
|
+
if (!fs.existsSync(dir)) {
|
|
117
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
118
|
+
}
|
|
119
|
+
if (typeof content === 'string') {
|
|
120
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
121
|
+
}
|
|
122
|
+
else if (content instanceof Blob) {
|
|
123
|
+
throw new Error('Blob content not supported in saveFileSync. Use saveFile() instead or convert to ArrayBuffer first.');
|
|
124
|
+
}
|
|
125
|
+
else if (content instanceof ArrayBuffer) {
|
|
126
|
+
fs.writeFileSync(filePath, new Uint8Array(content));
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
throw new Error('Unsupported content type');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async readFileAsBuffer(filePath) {
|
|
133
|
+
return await fsAsync.readFile(filePath);
|
|
134
|
+
}
|
|
135
|
+
async readFileAsString(filePath) {
|
|
136
|
+
return await fsAsync.readFile(filePath, 'utf-8');
|
|
137
|
+
}
|
|
138
|
+
async readFile(filePath) {
|
|
139
|
+
return new File([await fsAsync.readFile(filePath)], filePath);
|
|
140
|
+
}
|
|
141
|
+
readFileSync(filePath) {
|
|
142
|
+
return new File([fs.readFileSync(filePath)], filePath);
|
|
143
|
+
}
|
|
144
|
+
getParentDirPath(filePath) {
|
|
145
|
+
return path.dirname(filePath);
|
|
146
|
+
}
|
|
147
|
+
getFilenameFromPath(filePath) {
|
|
148
|
+
return path.basename(filePath);
|
|
149
|
+
}
|
|
150
|
+
getPathModule() {
|
|
151
|
+
return path;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** @deprecated Prefer NodeFileManager */
|
|
155
|
+
const FileManager = NodeFileManager;
|
|
156
|
+
BaseFileManager.configure(new NodeFileManager());
|
|
157
|
+
|
|
158
|
+
const logger$1 = debug('seedSdk:node:db:Db');
|
|
159
|
+
function resolveDbPaths(filesDir, config) {
|
|
160
|
+
const outDir = config?.outDir || path.join(filesDir, 'db');
|
|
161
|
+
const dbPath = config?.dbUrl
|
|
162
|
+
? (config.dbUrl.startsWith('file:') ? config.dbUrl.replace(/^file:/, '') : config.dbUrl)
|
|
163
|
+
: path.join(outDir, 'seed.db');
|
|
164
|
+
return { outDir, dbPath };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Locate prebuilt drizzle migration SQL shipped with the SDK
|
|
168
|
+
* (same files the browser embeds via drizzleFiles.ts).
|
|
169
|
+
*/
|
|
170
|
+
function resolveSdkDrizzleMigrationsDir(sdkRootDir) {
|
|
171
|
+
const root = sdkRootDir ||
|
|
172
|
+
(() => {
|
|
173
|
+
try {
|
|
174
|
+
return BasePathResolver.getSdkRootDir();
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
return process.cwd();
|
|
178
|
+
}
|
|
179
|
+
})();
|
|
180
|
+
// Also resolve relative to this module so temp-cwd tests / odd roots still find
|
|
181
|
+
// packages/sdk/src/db/drizzle (or dist/db/drizzle after publish).
|
|
182
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
183
|
+
const candidates = [
|
|
184
|
+
path.join(root, 'db', 'drizzle'), // production: sdkRoot is dist/
|
|
185
|
+
path.join(root, 'dist', 'db', 'drizzle'), // sdk package root with built dist
|
|
186
|
+
path.join(root, 'src', 'db', 'drizzle'), // monorepo / sdk-dev
|
|
187
|
+
path.join(root, 'packages', 'sdk', 'src', 'db', 'drizzle'), // monorepo root as cwd
|
|
188
|
+
path.join(root, 'packages', 'sdk', 'dist', 'db', 'drizzle'),
|
|
189
|
+
path.join(moduleDir, '..', '..', 'db', 'drizzle'), // src/node/db -> src/db/drizzle
|
|
190
|
+
path.join(moduleDir, '..', '..', '..', 'src', 'db', 'drizzle'), // dist/node -> src
|
|
191
|
+
path.join(moduleDir, '..', 'db', 'drizzle'), // dist layout variants
|
|
192
|
+
];
|
|
193
|
+
for (const candidate of candidates) {
|
|
194
|
+
if (fs__default.existsSync(path.join(candidate, 'meta', '_journal.json'))) {
|
|
195
|
+
return candidate;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
throw new Error(`Could not find SDK drizzle migrations (meta/_journal.json). Searched under: ${candidates.join(', ')}`);
|
|
199
|
+
}
|
|
200
|
+
function copyDirRecursive(sourceDir, targetDir) {
|
|
201
|
+
if (!fs__default.existsSync(targetDir)) {
|
|
202
|
+
fs__default.mkdirSync(targetDir, { recursive: true });
|
|
203
|
+
}
|
|
204
|
+
for (const entry of fs__default.readdirSync(sourceDir)) {
|
|
205
|
+
const sourcePath = path.join(sourceDir, entry);
|
|
206
|
+
const targetPath = path.join(targetDir, entry);
|
|
207
|
+
const stats = fs__default.statSync(sourcePath);
|
|
208
|
+
if (stats.isDirectory()) {
|
|
209
|
+
copyDirRecursive(sourcePath, targetPath);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
fs__default.copyFileSync(sourcePath, targetPath);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
class NodeDb {
|
|
217
|
+
getAppDb() {
|
|
218
|
+
return this.db;
|
|
219
|
+
}
|
|
220
|
+
isAppDbReady() {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Copy prebuilt SQL migrations into the app db directory (overwrite to stay current).
|
|
225
|
+
*/
|
|
226
|
+
copyDrizzleFiles(filesDir, migrationsSourceDir) {
|
|
227
|
+
const { outDir } = resolveDbPaths(filesDir);
|
|
228
|
+
const source = migrationsSourceDir || resolveSdkDrizzleMigrationsDir();
|
|
229
|
+
logger$1('[Db.copyDrizzleFiles] copying from %s to %s', source, outDir);
|
|
230
|
+
copyDirRecursive(source, outDir);
|
|
231
|
+
return outDir;
|
|
232
|
+
}
|
|
233
|
+
async prepareDb(filesDir, config) {
|
|
234
|
+
const resolvedFilesDir = path.resolve(filesDir);
|
|
235
|
+
if (!fs__default.existsSync(resolvedFilesDir)) {
|
|
236
|
+
fs__default.mkdirSync(resolvedFilesDir, { recursive: true });
|
|
237
|
+
}
|
|
238
|
+
const { outDir, dbPath } = resolveDbPaths(resolvedFilesDir, config);
|
|
239
|
+
if (!fs__default.existsSync(outDir)) {
|
|
240
|
+
fs__default.mkdirSync(outDir, { recursive: true });
|
|
241
|
+
}
|
|
242
|
+
// Install SDK migration SQL next to the DB (same source of truth as browser)
|
|
243
|
+
this.copyDrizzleFiles(resolvedFilesDir);
|
|
244
|
+
const dbUrl = config?.dbUrl
|
|
245
|
+
? (config.dbUrl.startsWith('file:') ? config.dbUrl : `file:${path.resolve(config.dbUrl)}`)
|
|
246
|
+
: `file:${path.resolve(dbPath)}`;
|
|
247
|
+
const client = createClient({ url: dbUrl });
|
|
248
|
+
const db = drizzle(client, { schema });
|
|
249
|
+
logger$1('[Db.prepareDb] running migrations from %s', outDir);
|
|
250
|
+
await migrate(db, { migrationsFolder: outDir });
|
|
251
|
+
this.db = db;
|
|
252
|
+
const { backfillMetadataPropertyIds } = await import('./backfillMetadataPropertyIds-DzZw57iJ.js');
|
|
253
|
+
await backfillMetadataPropertyIds();
|
|
254
|
+
return this.db;
|
|
255
|
+
}
|
|
256
|
+
async connectToDb(_pathToDir) {
|
|
257
|
+
return {
|
|
258
|
+
id: this.db ? this.db.constructor.name : '',
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
async migrate(pathToDbDir, _dbName, _dbId) {
|
|
262
|
+
try {
|
|
263
|
+
if (!this.db) {
|
|
264
|
+
throw new Error('Database not initialized. Call prepareDb first.');
|
|
265
|
+
}
|
|
266
|
+
await migrate(this.db, { migrationsFolder: pathToDbDir });
|
|
267
|
+
const queryResult = await this.db.select().from(appState);
|
|
268
|
+
logger$1('queryResult', queryResult);
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
const errorMessage = error.message || String(error) || '';
|
|
272
|
+
const errorString = String(error);
|
|
273
|
+
const isMigrationError = errorMessage.includes("Can't find meta/_journal.json") ||
|
|
274
|
+
errorMessage.includes('_journal.json') ||
|
|
275
|
+
errorMessage.includes("Cannot read properties of undefined") ||
|
|
276
|
+
errorMessage.includes("reading 'dialect'") ||
|
|
277
|
+
errorMessage.includes('undefined is not an object') ||
|
|
278
|
+
errorString.includes('dialect') ||
|
|
279
|
+
errorString.includes('undefined is not an object');
|
|
280
|
+
if (isMigrationError) {
|
|
281
|
+
if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {
|
|
282
|
+
logger$1('Warning: Migration failed, but continuing in test environment:', errorMessage || errorString);
|
|
283
|
+
return this.db;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
throw error;
|
|
287
|
+
}
|
|
288
|
+
return this.db;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Polling-based liveQuery stub for Node. Prefer browser reactive queries in UI apps.
|
|
292
|
+
*/
|
|
293
|
+
liveQuery(query) {
|
|
294
|
+
if (!this.db) {
|
|
295
|
+
throw new Error('Database not initialized. Call prepareDb first.');
|
|
296
|
+
}
|
|
297
|
+
const pollInterval = 1000;
|
|
298
|
+
if (typeof query === 'function') {
|
|
299
|
+
throw new Error('SQL tag functions are not supported in node liveQuery stub implementation. Use Drizzle query builders instead.');
|
|
300
|
+
}
|
|
301
|
+
const queryBuilder = query;
|
|
302
|
+
return interval(pollInterval).pipe(startWith(0), switchMap(async () => {
|
|
303
|
+
try {
|
|
304
|
+
const result = await Promise.resolve(queryBuilder);
|
|
305
|
+
return result;
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
logger$1('[Db.liveQuery] Error executing query:', error);
|
|
309
|
+
throw error;
|
|
310
|
+
}
|
|
311
|
+
}), distinctUntilChanged((prev, curr) => {
|
|
312
|
+
return JSON.stringify(prev) === JSON.stringify(curr);
|
|
313
|
+
}));
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/** @deprecated Prefer NodeDb */
|
|
317
|
+
const Db = NodeDb;
|
|
318
|
+
BaseDb.configure(new NodeDb());
|
|
319
|
+
|
|
320
|
+
const logger = debug('seedSdk:node:helpers:PathResolver');
|
|
321
|
+
class NodePathResolver {
|
|
322
|
+
/** @deprecated Prefer BasePathResolver static methods or configure(). */
|
|
323
|
+
static getInstance() {
|
|
324
|
+
return BasePathResolver.getInstance();
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Detects the current environment based on filesystem structure and package.json
|
|
328
|
+
*/
|
|
329
|
+
detectEnvironment() {
|
|
330
|
+
// Check if we're in the SDK repo itself
|
|
331
|
+
if (process.env.NODE_ENV !== 'test' && this.isInSdkRepo()) {
|
|
332
|
+
return 'sdk-dev';
|
|
333
|
+
}
|
|
334
|
+
// Check if we're running tests
|
|
335
|
+
if (process.env.NODE_ENV === 'test') {
|
|
336
|
+
return 'test';
|
|
337
|
+
}
|
|
338
|
+
// Check if we're using a linked version of the SDK
|
|
339
|
+
if (this.isUsingLinkedSdk()) {
|
|
340
|
+
return 'linked-sdk';
|
|
341
|
+
}
|
|
342
|
+
// Default to production environment
|
|
343
|
+
return 'production';
|
|
344
|
+
}
|
|
345
|
+
isInSdkRepo() {
|
|
346
|
+
try {
|
|
347
|
+
const currentDir = process.cwd();
|
|
348
|
+
// Check when running from packages/sdk (SDK package root)
|
|
349
|
+
if (fs__default.existsSync(path.join(currentDir, 'src', 'node')) &&
|
|
350
|
+
fs__default.existsSync(path.join(currentDir, 'package.json')) &&
|
|
351
|
+
JSON.parse(fs__default.readFileSync(path.join(currentDir, 'package.json'), 'utf8')).name === '@seedprotocol/sdk') {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
// Check when running from monorepo root
|
|
355
|
+
if (fs__default.existsSync(path.join(currentDir, 'packages', 'sdk', 'src', 'node')) &&
|
|
356
|
+
fs__default.existsSync(path.join(currentDir, 'packages', 'sdk', 'package.json')) &&
|
|
357
|
+
JSON.parse(fs__default.readFileSync(path.join(currentDir, 'packages', 'sdk', 'package.json'), 'utf8')).name === '@seedprotocol/sdk') {
|
|
358
|
+
return true;
|
|
359
|
+
}
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
catch {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
isUsingLinkedSdk() {
|
|
367
|
+
try {
|
|
368
|
+
const pkgPath = path.join(process.cwd(), 'package.json');
|
|
369
|
+
if (!fs__default.existsSync(pkgPath))
|
|
370
|
+
return false;
|
|
371
|
+
const pkg = JSON.parse(fs__default.readFileSync(pkgPath, 'utf8'));
|
|
372
|
+
const sdkDep = pkg.dependencies?.['@seedprotocol/sdk'];
|
|
373
|
+
return sdkDep && (sdkDep.startsWith('link:') || sdkDep.startsWith('portal:'));
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Gets the root directory containing node_modules
|
|
381
|
+
*/
|
|
382
|
+
getRootWithNodeModules() {
|
|
383
|
+
const processCwd = process.cwd();
|
|
384
|
+
const calledFromMocks = processCwd.includes('__mocks__');
|
|
385
|
+
if (calledFromMocks) {
|
|
386
|
+
return path.join(processCwd, '..', '..', '..', '..');
|
|
387
|
+
}
|
|
388
|
+
return processCwd;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Gets the SDK root directory
|
|
392
|
+
*/
|
|
393
|
+
getSdkRootDir() {
|
|
394
|
+
const env = this.detectEnvironment();
|
|
395
|
+
const rootWithNodeModules = this.getRootWithNodeModules();
|
|
396
|
+
const processCwd = process.cwd();
|
|
397
|
+
// For test environment, always return the SDK root directory
|
|
398
|
+
if (env === 'test') {
|
|
399
|
+
return rootWithNodeModules;
|
|
400
|
+
}
|
|
401
|
+
if (env === 'linked-sdk') {
|
|
402
|
+
// For linked packages, find the package directory
|
|
403
|
+
const pkgJson = JSON.parse(fs__default.readFileSync(path.join(processCwd, 'package.json'), 'utf8'));
|
|
404
|
+
const sdkPath = pkgJson.dependencies?.['@seedprotocol/sdk'] || pkgJson.devDependencies?.['@seedprotocol/sdk'];
|
|
405
|
+
if (sdkPath === 'link:@seedprotocol/sdk') {
|
|
406
|
+
return path.join(processCwd, 'node_modules', '@seedprotocol', 'sdk');
|
|
407
|
+
}
|
|
408
|
+
return path.resolve(processCwd, sdkPath.replace(/^(link:|portal:)/, ''));
|
|
409
|
+
}
|
|
410
|
+
// After early returns, env can only be 'sdk-dev' or 'production'
|
|
411
|
+
if (env === 'sdk-dev') {
|
|
412
|
+
// When running from monorepo root, SDK root is packages/sdk
|
|
413
|
+
if (fs__default.existsSync(path.join(rootWithNodeModules, 'packages', 'sdk', 'package.json'))) {
|
|
414
|
+
return path.join(rootWithNodeModules, 'packages', 'sdk');
|
|
415
|
+
}
|
|
416
|
+
// When running from packages/sdk directly
|
|
417
|
+
return rootWithNodeModules;
|
|
418
|
+
}
|
|
419
|
+
// Default to production environment
|
|
420
|
+
// This should be {projectDir}/node_modules/@seedprotocol/sdk/dist
|
|
421
|
+
return path.join(rootWithNodeModules, 'node_modules', '@seedprotocol', 'sdk', 'dist');
|
|
422
|
+
}
|
|
423
|
+
getNodeModulesDir() {
|
|
424
|
+
const env = this.detectEnvironment();
|
|
425
|
+
const rootWithNodeModules = this.getRootWithNodeModules();
|
|
426
|
+
let nodeModulesDir = path.join(rootWithNodeModules, 'node_modules');
|
|
427
|
+
if (env !== 'linked-sdk' && env !== 'sdk-dev' && nodeModulesDir.includes('__tests__')) {
|
|
428
|
+
nodeModulesDir = path.join(process.cwd(), '..', '..', '..', '..', 'node_modules');
|
|
429
|
+
}
|
|
430
|
+
return nodeModulesDir;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Gets the .seed directory path
|
|
434
|
+
*/
|
|
435
|
+
getDotSeedDir(schemaFileDir) {
|
|
436
|
+
if (!schemaFileDir && process.env.SEED_SDK_TEST_PROJECT_TYPE && !process.cwd().includes('__mocks__')) {
|
|
437
|
+
return path.join(process.cwd(), '__tests__', '__mocks__', process.env.SEED_SDK_TEST_PROJECT_TYPE, 'project', '.seed');
|
|
438
|
+
}
|
|
439
|
+
return path.join(schemaFileDir || process.cwd(), '.seed');
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Finds the Seed Protocol config file in the given directory
|
|
443
|
+
* @param searchDir - Directory to search for the config file
|
|
444
|
+
* @returns The path to the found config file, or null if not found
|
|
445
|
+
*/
|
|
446
|
+
findConfigFile(searchDir = process.cwd()) {
|
|
447
|
+
// First try the primary config file name
|
|
448
|
+
const primaryPath = path.join(searchDir, SEED_CONFIG_FILE);
|
|
449
|
+
if (fs__default.existsSync(primaryPath)) {
|
|
450
|
+
return primaryPath;
|
|
451
|
+
}
|
|
452
|
+
// Then try fallback names in order
|
|
453
|
+
for (const fallbackName of SEED_CONFIG_FALLBACKS) {
|
|
454
|
+
const fallbackPath = path.join(searchDir, fallbackName);
|
|
455
|
+
if (fs__default.existsSync(fallbackPath)) {
|
|
456
|
+
return fallbackPath;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Gets paths for app-specific directories
|
|
463
|
+
*/
|
|
464
|
+
getAppPaths(schemaFileDir) {
|
|
465
|
+
const env = this.detectEnvironment();
|
|
466
|
+
const dotSeedDir = this.getDotSeedDir(schemaFileDir);
|
|
467
|
+
const nodeModulesDir = this.getNodeModulesDir();
|
|
468
|
+
logger('env', env);
|
|
469
|
+
logger('getAppPaths', {
|
|
470
|
+
sdkRootDir: this.getSdkRootDir(),
|
|
471
|
+
dotSeedDir,
|
|
472
|
+
nodeModulesDir,
|
|
473
|
+
appSchemaDir: path.join(dotSeedDir, 'schema'),
|
|
474
|
+
appDbDir: path.join(dotSeedDir, 'db'),
|
|
475
|
+
appMetaDir: path.join(dotSeedDir, 'db', 'meta'),
|
|
476
|
+
});
|
|
477
|
+
return {
|
|
478
|
+
sdkRootDir: this.getSdkRootDir(),
|
|
479
|
+
dotSeedDir,
|
|
480
|
+
nodeModulesDir,
|
|
481
|
+
appSchemaDir: path.join(dotSeedDir, 'schema'),
|
|
482
|
+
appDbDir: path.join(dotSeedDir, 'db'),
|
|
483
|
+
appMetaDir: path.join(dotSeedDir, 'db', 'meta'),
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
/** @deprecated Prefer NodePathResolver; kept for CLI / node entry exports. */
|
|
488
|
+
const PathResolver = NodePathResolver;
|
|
489
|
+
BasePathResolver.configure(new NodePathResolver());
|
|
490
|
+
|
|
491
|
+
function createPlatformServices() {
|
|
492
|
+
return {
|
|
493
|
+
pathResolver: new NodePathResolver(),
|
|
494
|
+
fileManager: new NodeFileManager(),
|
|
495
|
+
db: new NodeDb(),
|
|
496
|
+
arweaveClient: new NodeArweaveClient(),
|
|
497
|
+
easClient: new NodeEasClient(),
|
|
498
|
+
queryClient: new NodeQueryClient(),
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export { Db as D, FileManager as F, PathResolver as P, createPlatformServices as c, resolveSdkDrizzleMigrationsDir as r };
|
|
503
|
+
//# sourceMappingURL=index.node-Bow8kHew.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node-Bow8kHew.js","sources":["../../src/node/helpers/FileManager.ts","../../src/node/db/Db.ts","../../src/node/helpers/PathResolver.ts","../../src/platform/index.node.ts"],"sourcesContent":["import * as fsAsync from 'fs/promises'\nimport * as fs from 'fs'\nimport { BaseFileManager } from '@/helpers/FileManager/BaseFileManager'\nimport type { IFileManager } from '@/helpers/FileManager/IFileManager'\nimport path from 'path'\n\nexport class NodeFileManager implements IFileManager {\n async getFs() {\n return fs\n }\n\n getFsSync() {\n return fs\n }\n\n async getContentUrlFromPath(_path: string): Promise<string | undefined> {\n throw new Error('Not implemented')\n }\n\n async initializeFileSystem(_workingDir?: string): Promise<void> {\n return // No need to initialize file system in node\n }\n\n async downloadAllFiles(): Promise<void> {\n throw new Error('Not implemented')\n }\n\n async resizeImage(): Promise<void> {\n throw new Error('Not implemented')\n }\n\n async resizeAllImages(): Promise<void> {\n throw new Error('Not implemented')\n }\n\n async pathExists(filePath: string): Promise<boolean> {\n return await fsAsync.access(filePath).then(() => true).catch(() => false)\n }\n\n async listImageFiles(): Promise<string[]> {\n return this.listFiles('images')\n }\n\n async listFiles(dir: string): Promise<string[]> {\n const targetDir = BaseFileManager.getFilesPath(dir)\n const exists = await this.pathExists(targetDir)\n if (!exists) {\n return []\n }\n const entries = await fsAsync.readdir(targetDir, { withFileTypes: true })\n return entries.filter((entry) => entry.isFile()).map((entry) => entry.name)\n }\n\n async createDirIfNotExists(filePath: string): Promise<void> {\n await fsAsync.mkdir(filePath, { recursive: true })\n }\n\n async waitForFile(filePath: string, interval: number = 1000, timeout: number = 60000): Promise<boolean> {\n const pathExists = await this.pathExists(filePath)\n if (pathExists) {\n return true\n }\n\n return new Promise((resolve, reject) => {\n const startTime = Date.now()\n let isBusy = false\n\n const checkInterval = setInterval(async () => {\n if (isBusy) {\n return\n }\n isBusy = true\n\n try {\n const exists = await this.pathExists(filePath)\n if (exists) {\n clearInterval(checkInterval)\n resolve(true)\n return\n }\n\n if (Date.now() - startTime >= timeout) {\n clearInterval(checkInterval)\n reject(new Error('Timeout exceeded while waiting for file'))\n return\n }\n } catch (error) {\n clearInterval(checkInterval)\n reject(error)\n return\n } finally {\n isBusy = false\n }\n }, interval)\n })\n }\n\n async waitForFileWithContent(filePath: string, interval: number = 100, timeout: number = 5000): Promise<boolean> {\n return this.waitForFile(filePath, interval, timeout)\n }\n\n async saveFile(filePath: string, content: string | Blob | ArrayBuffer): Promise<void> {\n const dir = path.dirname(filePath)\n await fsAsync.mkdir(dir, { recursive: true })\n\n if (typeof content === 'string') {\n await fsAsync.writeFile(filePath, content, 'utf-8')\n } else if (content instanceof Blob) {\n const arrayBuffer = await content.arrayBuffer()\n await fsAsync.writeFile(filePath, new Uint8Array(arrayBuffer))\n } else if (content instanceof ArrayBuffer) {\n await fsAsync.writeFile(filePath, new Uint8Array(content))\n } else {\n throw new Error('Unsupported content type')\n }\n }\n\n saveFileSync(filePath: string, content: string | Blob | ArrayBuffer): void {\n const dir = path.dirname(filePath)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n\n if (typeof content === 'string') {\n fs.writeFileSync(filePath, content, 'utf-8')\n } else if (content instanceof Blob) {\n throw new Error('Blob content not supported in saveFileSync. Use saveFile() instead or convert to ArrayBuffer first.')\n } else if (content instanceof ArrayBuffer) {\n fs.writeFileSync(filePath, new Uint8Array(content))\n } else {\n throw new Error('Unsupported content type')\n }\n }\n\n async readFileAsBuffer(filePath: string): Promise<Buffer> {\n return await fsAsync.readFile(filePath)\n }\n\n async readFileAsString(filePath: string): Promise<string> {\n return await fsAsync.readFile(filePath, 'utf-8')\n }\n\n async readFile(filePath: string): Promise<File> {\n return new File([await fsAsync.readFile(filePath)], filePath)\n }\n\n readFileSync(filePath: string): File {\n return new File([fs.readFileSync(filePath)], filePath)\n }\n\n getParentDirPath(filePath: string): string {\n return path.dirname(filePath)\n }\n\n getFilenameFromPath(filePath: string): string {\n return path.basename(filePath)\n }\n\n getPathModule(): any {\n return path\n }\n}\n\n/** @deprecated Prefer NodeFileManager */\nexport const FileManager = NodeFileManager\n\nBaseFileManager.configure(new NodeFileManager())\n\nconst _check: IFileManager = new NodeFileManager()\nvoid _check\n","import { BaseDb } from '@/db/Db/BaseDb'\nimport type { IDb } from '@/interfaces/IDb'\nimport path from 'path'\nimport { fileURLToPath } from 'node:url'\nimport debug from 'debug'\nimport { appState } from '@/seedSchema'\nimport fs from 'fs'\nimport { createClient } from '@libsql/client'\nimport { drizzle } from 'drizzle-orm/libsql'\nimport { migrate } from 'drizzle-orm/libsql/migrator'\nimport * as schema from '@/seedSchema'\nimport { Observable, interval, switchMap, distinctUntilChanged, startWith } from 'rxjs'\nimport { BasePathResolver } from '@/helpers/PathResolver/BasePathResolver'\n\nconst logger = debug('seedSdk:node:db:Db')\n\nexport interface DbConfig {\n dbUrl?: string\n /** @deprecated Unused — schema is the static SDK seedSchema + prebuilt SQL migrations */\n schemaDir?: string\n outDir?: string\n}\n\nfunction resolveDbPaths(filesDir: string, config?: DbConfig) {\n const outDir = config?.outDir || path.join(filesDir, 'db')\n const dbPath = config?.dbUrl\n ? (config.dbUrl.startsWith('file:') ? config.dbUrl.replace(/^file:/, '') : config.dbUrl)\n : path.join(outDir, 'seed.db')\n return { outDir, dbPath }\n}\n\n/**\n * Locate prebuilt drizzle migration SQL shipped with the SDK\n * (same files the browser embeds via drizzleFiles.ts).\n */\nexport function resolveSdkDrizzleMigrationsDir(sdkRootDir?: string): string {\n const root =\n sdkRootDir ||\n (() => {\n try {\n return BasePathResolver.getSdkRootDir()\n } catch {\n return process.cwd()\n }\n })()\n\n // Also resolve relative to this module so temp-cwd tests / odd roots still find\n // packages/sdk/src/db/drizzle (or dist/db/drizzle after publish).\n const moduleDir = path.dirname(fileURLToPath(import.meta.url))\n\n const candidates = [\n path.join(root, 'db', 'drizzle'), // production: sdkRoot is dist/\n path.join(root, 'dist', 'db', 'drizzle'), // sdk package root with built dist\n path.join(root, 'src', 'db', 'drizzle'), // monorepo / sdk-dev\n path.join(root, 'packages', 'sdk', 'src', 'db', 'drizzle'), // monorepo root as cwd\n path.join(root, 'packages', 'sdk', 'dist', 'db', 'drizzle'),\n path.join(moduleDir, '..', '..', 'db', 'drizzle'), // src/node/db -> src/db/drizzle\n path.join(moduleDir, '..', '..', '..', 'src', 'db', 'drizzle'), // dist/node -> src\n path.join(moduleDir, '..', 'db', 'drizzle'), // dist layout variants\n ]\n\n for (const candidate of candidates) {\n if (fs.existsSync(path.join(candidate, 'meta', '_journal.json'))) {\n return candidate\n }\n }\n\n throw new Error(\n `Could not find SDK drizzle migrations (meta/_journal.json). Searched under: ${candidates.join(', ')}`,\n )\n}\n\nfunction copyDirRecursive(sourceDir: string, targetDir: string) {\n if (!fs.existsSync(targetDir)) {\n fs.mkdirSync(targetDir, { recursive: true })\n }\n for (const entry of fs.readdirSync(sourceDir)) {\n const sourcePath = path.join(sourceDir, entry)\n const targetPath = path.join(targetDir, entry)\n const stats = fs.statSync(sourcePath)\n if (stats.isDirectory()) {\n copyDirRecursive(sourcePath, targetPath)\n } else {\n fs.copyFileSync(sourcePath, targetPath)\n }\n }\n}\n\nexport class NodeDb implements IDb {\n db: any\n\n\n getAppDb() {\n return this.db\n }\n\n isAppDbReady() {\n return true\n }\n\n /**\n * Copy prebuilt SQL migrations into the app db directory (overwrite to stay current).\n */\n copyDrizzleFiles(filesDir: string, migrationsSourceDir?: string): string {\n const { outDir } = resolveDbPaths(filesDir)\n const source = migrationsSourceDir || resolveSdkDrizzleMigrationsDir()\n logger('[Db.copyDrizzleFiles] copying from %s to %s', source, outDir)\n copyDirRecursive(source, outDir)\n return outDir\n }\n\n async prepareDb(filesDir: string, config?: DbConfig) {\n const resolvedFilesDir = path.resolve(filesDir)\n\n if (!fs.existsSync(resolvedFilesDir)) {\n fs.mkdirSync(resolvedFilesDir, { recursive: true })\n }\n\n const { outDir, dbPath } = resolveDbPaths(resolvedFilesDir, config)\n\n if (!fs.existsSync(outDir)) {\n fs.mkdirSync(outDir, { recursive: true })\n }\n\n // Install SDK migration SQL next to the DB (same source of truth as browser)\n this.copyDrizzleFiles(resolvedFilesDir)\n\n const dbUrl = config?.dbUrl\n ? (config.dbUrl.startsWith('file:') ? config.dbUrl : `file:${path.resolve(config.dbUrl)}`)\n : `file:${path.resolve(dbPath)}`\n\n const client = createClient({ url: dbUrl })\n const db = drizzle(client, { schema })\n\n logger('[Db.prepareDb] running migrations from %s', outDir)\n await migrate(db, { migrationsFolder: outDir })\n\n this.db = db\n\n const { backfillMetadataPropertyIds } = await import('@/db/backfillMetadataPropertyIds')\n await backfillMetadataPropertyIds()\n\n return this.db\n }\n\n async connectToDb(_pathToDir: string) {\n return {\n id: this.db ? this.db.constructor.name : '',\n }\n }\n\n async migrate(pathToDbDir: string, _dbName: string, _dbId: string) {\n try {\n if (!this.db) {\n throw new Error('Database not initialized. Call prepareDb first.')\n }\n\n await migrate(this.db, { migrationsFolder: pathToDbDir })\n const queryResult = await this.db.select().from(appState)\n logger('queryResult', queryResult)\n } catch (error: any) {\n const errorMessage = error.message || String(error) || ''\n const errorString = String(error)\n const isMigrationError =\n errorMessage.includes(\"Can't find meta/_journal.json\") ||\n errorMessage.includes('_journal.json') ||\n errorMessage.includes(\"Cannot read properties of undefined\") ||\n errorMessage.includes(\"reading 'dialect'\") ||\n errorMessage.includes('undefined is not an object') ||\n errorString.includes('dialect') ||\n errorString.includes('undefined is not an object')\n\n if (isMigrationError) {\n if (process.env.NODE_ENV === 'test' || process.env.IS_SEED_DEV) {\n logger(\n 'Warning: Migration failed, but continuing in test environment:',\n errorMessage || errorString,\n )\n return this.db\n }\n }\n throw error\n }\n\n return this.db\n }\n\n /**\n * Polling-based liveQuery stub for Node. Prefer browser reactive queries in UI apps.\n */\n liveQuery<T>(query: ((sql: any) => any) | any): Observable<T[]> {\n if (!this.db) {\n throw new Error('Database not initialized. Call prepareDb first.')\n }\n\n const pollInterval = 1000\n\n if (typeof query === 'function') {\n throw new Error(\n 'SQL tag functions are not supported in node liveQuery stub implementation. Use Drizzle query builders instead.',\n )\n }\n\n const queryBuilder = query\n\n return interval(pollInterval).pipe(\n startWith(0),\n switchMap(async () => {\n try {\n const result = await Promise.resolve(queryBuilder)\n return result as T[]\n } catch (error) {\n logger('[Db.liveQuery] Error executing query:', error)\n throw error\n }\n }),\n distinctUntilChanged((prev, curr) => {\n return JSON.stringify(prev) === JSON.stringify(curr)\n }),\n )\n }\n}\n\n/** @deprecated Prefer NodeDb */\nexport const Db = NodeDb\n\nBaseDb.configure(new NodeDb())\n\nconst _check: IDb = new NodeDb()\nvoid _check\n","import path from 'path'\nimport fs from 'fs'\nimport { SEED_CONFIG_FILE, SEED_CONFIG_FALLBACKS } from '@/helpers/constants'\nimport type { IPathResolver } from '@/helpers/PathResolver/IPathResolver'\nimport { BasePathResolver } from '@/helpers/PathResolver/BasePathResolver'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:node:helpers:PathResolver')\n\nexport class NodePathResolver implements IPathResolver {\n /** @deprecated Prefer BasePathResolver static methods or configure(). */\n static getInstance(): IPathResolver {\n return BasePathResolver.getInstance()\n }\n\n /**\n * Detects the current environment based on filesystem structure and package.json\n */\n private detectEnvironment(): 'sdk-dev' | 'linked-sdk' | 'production' | 'test' {\n // Check if we're in the SDK repo itself\n if (process.env.NODE_ENV !== 'test' && this.isInSdkRepo()) {\n return 'sdk-dev'\n }\n\n // Check if we're running tests\n if (process.env.NODE_ENV === 'test') {\n return 'test'\n }\n\n // Check if we're using a linked version of the SDK\n if (this.isUsingLinkedSdk()) {\n return 'linked-sdk'\n }\n\n // Default to production environment\n return 'production'\n }\n\n private isInSdkRepo(): boolean {\n try {\n const currentDir = process.cwd()\n // Check when running from packages/sdk (SDK package root)\n if (fs.existsSync(path.join(currentDir, 'src', 'node')) &&\n fs.existsSync(path.join(currentDir, 'package.json')) &&\n JSON.parse(fs.readFileSync(path.join(currentDir, 'package.json'), 'utf8')).name === '@seedprotocol/sdk') {\n return true\n }\n // Check when running from monorepo root\n if (fs.existsSync(path.join(currentDir, 'packages', 'sdk', 'src', 'node')) &&\n fs.existsSync(path.join(currentDir, 'packages', 'sdk', 'package.json')) &&\n JSON.parse(fs.readFileSync(path.join(currentDir, 'packages', 'sdk', 'package.json'), 'utf8')).name === '@seedprotocol/sdk') {\n return true\n }\n return false\n } catch {\n return false\n }\n }\n\n private isUsingLinkedSdk(): boolean {\n try {\n const pkgPath = path.join(process.cwd(), 'package.json')\n if (!fs.existsSync(pkgPath)) return false\n \n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))\n const sdkDep = pkg.dependencies?.['@seedprotocol/sdk']\n \n return sdkDep && (sdkDep.startsWith('link:') || sdkDep.startsWith('portal:'))\n } catch {\n return false\n }\n }\n\n /**\n * Gets the root directory containing node_modules\n */\n getRootWithNodeModules(): string {\n const processCwd = process.cwd()\n\n const calledFromMocks = processCwd.includes('__mocks__')\n\n if (calledFromMocks) {\n return path.join(processCwd, '..', '..', '..', '..',)\n }\n\n return processCwd\n }\n\n /**\n * Gets the SDK root directory\n */\n getSdkRootDir(): string {\n const env = this.detectEnvironment()\n const rootWithNodeModules = this.getRootWithNodeModules()\n const processCwd = process.cwd()\n\n // For test environment, always return the SDK root directory\n if (env === 'test') {\n return rootWithNodeModules\n }\n\n if (env === 'linked-sdk') {\n // For linked packages, find the package directory\n const pkgJson = JSON.parse(fs.readFileSync(path.join(processCwd, 'package.json'), 'utf8'))\n const sdkPath = pkgJson.dependencies?.['@seedprotocol/sdk'] || pkgJson.devDependencies?.['@seedprotocol/sdk']\n if (sdkPath === 'link:@seedprotocol/sdk') {\n return path.join(processCwd, 'node_modules', '@seedprotocol', 'sdk',)\n }\n return path.resolve(processCwd, sdkPath.replace(/^(link:|portal:)/, ''))\n }\n\n // After early returns, env can only be 'sdk-dev' or 'production'\n if (env === 'sdk-dev') {\n // When running from monorepo root, SDK root is packages/sdk\n if (fs.existsSync(path.join(rootWithNodeModules, 'packages', 'sdk', 'package.json'))) {\n return path.join(rootWithNodeModules, 'packages', 'sdk')\n }\n // When running from packages/sdk directly\n return rootWithNodeModules\n }\n \n // Default to production environment\n // This should be {projectDir}/node_modules/@seedprotocol/sdk/dist\n return path.join(rootWithNodeModules, 'node_modules', '@seedprotocol', 'sdk', 'dist')\n }\n\n getNodeModulesDir(): string {\n const env = this.detectEnvironment()\n const rootWithNodeModules = this.getRootWithNodeModules()\n\n let nodeModulesDir = path.join(rootWithNodeModules, 'node_modules')\n\n if (env !== 'linked-sdk' && env !== 'sdk-dev' && nodeModulesDir.includes('__tests__')) {\n nodeModulesDir = path.join(process.cwd(), '..', '..', '..', '..', 'node_modules',)\n }\n\n return nodeModulesDir\n }\n\n /**\n * Gets the .seed directory path\n */\n getDotSeedDir(schemaFileDir?: string): string {\n if (!schemaFileDir && process.env.SEED_SDK_TEST_PROJECT_TYPE && !process.cwd().includes('__mocks__')) {\n return path.join(process.cwd(), '__tests__', '__mocks__', process.env.SEED_SDK_TEST_PROJECT_TYPE, 'project', '.seed')\n }\n return path.join(schemaFileDir || process.cwd(), '.seed')\n }\n\n /**\n * Finds the Seed Protocol config file in the given directory\n * @param searchDir - Directory to search for the config file\n * @returns The path to the found config file, or null if not found\n */\n findConfigFile(searchDir: string = process.cwd()): string | null {\n // First try the primary config file name\n const primaryPath = path.join(searchDir, SEED_CONFIG_FILE)\n if (fs.existsSync(primaryPath)) {\n return primaryPath\n }\n\n // Then try fallback names in order\n for (const fallbackName of SEED_CONFIG_FALLBACKS) {\n const fallbackPath = path.join(searchDir, fallbackName)\n if (fs.existsSync(fallbackPath)) {\n return fallbackPath\n }\n }\n\n return null\n }\n\n /**\n * Gets paths for app-specific directories\n */\n getAppPaths(schemaFileDir?: string | undefined) {\n const env = this.detectEnvironment()\n const dotSeedDir = this.getDotSeedDir(schemaFileDir)\n const nodeModulesDir = this.getNodeModulesDir()\n\n logger('env', env)\n\n logger('getAppPaths', {\n sdkRootDir: this.getSdkRootDir(),\n dotSeedDir,\n nodeModulesDir,\n appSchemaDir: path.join(dotSeedDir, 'schema'),\n appDbDir: path.join(dotSeedDir, 'db'),\n appMetaDir: path.join(dotSeedDir, 'db', 'meta'),\n })\n\n return {\n sdkRootDir: this.getSdkRootDir(),\n dotSeedDir,\n nodeModulesDir,\n appSchemaDir: path.join(dotSeedDir, 'schema'),\n appDbDir: path.join(dotSeedDir, 'db'),\n appMetaDir: path.join(dotSeedDir, 'db', 'meta'),\n }\n }\n}\n\n/** @deprecated Prefer NodePathResolver; kept for CLI / node entry exports. */\nexport const PathResolver = NodePathResolver\n\nBasePathResolver.configure(new NodePathResolver())\n\nconst _check: IPathResolver = new NodePathResolver()\nvoid _check\n","import { NodePathResolver } from '@/node/helpers/PathResolver'\nimport { NodeFileManager } from '@/node/helpers/FileManager'\nimport { NodeDb } from '@/node/db/Db'\nimport { NodeArweaveClient } from '@/node/helpers/ArweaveClient'\nimport { NodeEasClient } from '@/node/helpers/EasClient'\nimport { NodeQueryClient } from '@/node/helpers/QueryClient'\nimport type { PlatformServices } from './types'\n\nexport function createPlatformServices(): PlatformServices {\n return {\n pathResolver: new NodePathResolver(),\n fileManager: new NodeFileManager(),\n db: new NodeDb(),\n arweaveClient: new NodeArweaveClient(),\n easClient: new NodeEasClient(),\n queryClient: new NodeQueryClient(),\n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