@seedprotocol/sdk 0.4.17 → 0.4.18
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/{ArweaveClient-Zz6VwCkj.js → ArweaveClient-CpShI0B0.js} +3 -3
- package/dist/{ArweaveClient-Zz6VwCkj.js.map → ArweaveClient-CpShI0B0.js.map} +1 -1
- package/dist/{ArweaveClient-DPeCeRMF.js → ArweaveClient-WfxkMgxb.js} +3 -3
- package/dist/{ArweaveClient-DPeCeRMF.js.map → ArweaveClient-WfxkMgxb.js.map} +1 -1
- package/dist/{Db-Cvoi9q3N.js → Db-29bu0gJx.js} +4 -4
- package/dist/{Db-Cvoi9q3N.js.map → Db-29bu0gJx.js.map} +1 -1
- package/dist/{Db-DsFElL33.js → Db-DWvxJG22.js} +4 -4
- package/dist/{Db-DsFElL33.js.map → Db-DWvxJG22.js.map} +1 -1
- package/dist/{EasClient-B2N8bc3C.js → EasClient-BwBg9Kkd.js} +2 -2
- package/dist/{EasClient-D5Nn1WBF.js.map → EasClient-BwBg9Kkd.js.map} +1 -1
- package/dist/{EasClient-D5Nn1WBF.js → EasClient-CtLqK_qz.js} +2 -2
- package/dist/{EasClient-B2N8bc3C.js.map → EasClient-CtLqK_qz.js.map} +1 -1
- package/dist/{FileManager-Cqy_Lq46.js → FileManager-DSihj6Sj.js} +2 -2
- package/dist/{FileManager-Cqy_Lq46.js.map → FileManager-DSihj6Sj.js.map} +1 -1
- package/dist/{FileManager-Bk-JeMoA.js → FileManager-DgraLHZS.js} +2 -2
- package/dist/{FileManager-Bk-JeMoA.js.map → FileManager-DgraLHZS.js.map} +1 -1
- package/dist/{ModelProperty-CkQaEsBu.js → ModelProperty-Bz3V3LoI.js} +24 -24
- package/dist/{ModelProperty-CkQaEsBu.js.map → ModelProperty-Bz3V3LoI.js.map} +1 -1
- package/dist/{PathResolver-DF1QFI1d.js → PathResolver-DOu-0k75.js} +2 -2
- package/dist/{PathResolver-DF1QFI1d.js.map → PathResolver-DOu-0k75.js.map} +1 -1
- package/dist/{PathResolver-C3sdR5LL.js → PathResolver-DQ5hyu8X.js} +2 -2
- package/dist/{PathResolver-C3sdR5LL.js.map → PathResolver-DQ5hyu8X.js.map} +1 -1
- package/dist/{QueryClient-CnONLIkA.js → QueryClient-CJV1m2rc.js} +2 -2
- package/dist/{QueryClient-CnONLIkA.js.map → QueryClient-CJV1m2rc.js.map} +1 -1
- package/dist/{QueryClient-Ctgd0tDn.js → QueryClient-DYaqIx7e.js} +2 -2
- package/dist/{QueryClient-Ctgd0tDn.js.map → QueryClient-DYaqIx7e.js.map} +1 -1
- package/dist/{Schema-Bnim4hAF.js → Schema-CFMbnImW.js} +38 -38
- package/dist/{Schema-Bnim4hAF.js.map → Schema-CFMbnImW.js.map} +1 -1
- package/dist/{SchemaValidationService-DXxRk-9Q.js → SchemaValidationService-D4ZVetLE.js} +2 -2
- package/dist/{SchemaValidationService-DXxRk-9Q.js.map → SchemaValidationService-D4ZVetLE.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-dzwzz4dA.js → backfillMetadataPropertyIds-DptGKVzG.js} +2 -2
- package/dist/{backfillMetadataPropertyIds-dzwzz4dA.js.map → backfillMetadataPropertyIds-DptGKVzG.js.map} +1 -1
- package/dist/cjs/{ModelProperty-C80601ai.js → ModelProperty-TPey_B4m.js} +17 -17
- package/dist/cjs/{ModelProperty-C80601ai.js.map → ModelProperty-TPey_B4m.js.map} +1 -1
- package/dist/cjs/{Schema-6BQKp7hO.js → Schema-B-IQEtpX.js} +20 -20
- package/dist/cjs/{Schema-6BQKp7hO.js.map → Schema-B-IQEtpX.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-BySF1P0v.js → SchemaValidationService-IQ0Gc9HM.js} +2 -2
- package/dist/cjs/{SchemaValidationService-BySF1P0v.js.map → SchemaValidationService-IQ0Gc9HM.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-D9uzW5bW.js → backfillMetadataPropertyIds-BBPgBc2W.js} +2 -2
- package/dist/cjs/{backfillMetadataPropertyIds-D9uzW5bW.js.map → backfillMetadataPropertyIds-BBPgBc2W.js.map} +1 -1
- package/dist/cjs/{getItem-Dj49AjWB.js → getItem-CWf0OO0F.js} +2 -2
- package/dist/cjs/{getItem-Dj49AjWB.js.map → getItem-CWf0OO0F.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-dR9co4rH.js → getPublishPayload-muuS1j0F.js} +519 -79
- package/dist/cjs/getPublishPayload-muuS1j0F.js.map +1 -0
- package/dist/cjs/{getPublishUploads-g61mgXaA.js → getPublishUploads-CONYV9QQ.js} +14 -8
- package/dist/cjs/getPublishUploads-CONYV9QQ.js.map +1 -0
- package/dist/cjs/{getSegmentedItemProperties-NFvOHlAi.js → getSegmentedItemProperties-Dl3J_uCe.js} +5 -4
- package/dist/cjs/getSegmentedItemProperties-Dl3J_uCe.js.map +1 -0
- package/dist/cjs/{index-9O_Ji1kY.js → index-Bte-I6OD.js} +119 -59
- package/dist/cjs/index-Bte-I6OD.js.map +1 -0
- package/dist/cjs/{index-ud9i9fpp.js → index-D7a8oFJP.js} +3 -3
- package/dist/cjs/index-D7a8oFJP.js.map +1 -0
- package/dist/cjs/{ownership-CyLRNReQ.js → ownership-Bxv6CUrH.js} +2 -2
- package/dist/cjs/{ownership-CyLRNReQ.js.map → ownership-Bxv6CUrH.js.map} +1 -1
- package/dist/cjs/{property-Hj-RhQVX.js → property-xOF5k4ka.js} +4 -4
- package/dist/cjs/{property-Hj-RhQVX.js.map → property-xOF5k4ka.js.map} +1 -1
- package/dist/{getItem-ClK0UZqi.js → getItem-Hubs_yxu.js} +2 -2
- package/dist/{getItem-ClK0UZqi.js.map → getItem-Hubs_yxu.js.map} +1 -1
- package/dist/{getPublishPayload-CdfPTl8l.js → getPublishPayload-CqUCIlu1.js} +522 -82
- package/dist/getPublishPayload-CqUCIlu1.js.map +1 -0
- package/dist/{getPublishUploads-CGBky9q9.js → getPublishUploads-QgfPyhcs.js} +14 -8
- package/dist/getPublishUploads-QgfPyhcs.js.map +1 -0
- package/dist/{getSegmentedItemProperties-CJWdYH9W.js → getSegmentedItemProperties-Dzscmm_m.js} +5 -4
- package/dist/getSegmentedItemProperties-Dzscmm_m.js.map +1 -0
- package/dist/{index-uPXtq2cf.js → index-CtzvJMAE.js} +131 -73
- package/dist/index-CtzvJMAE.js.map +1 -0
- package/dist/{index-C74KrwXN.js → index-QSl4EYun.js} +2 -2
- package/dist/index-QSl4EYun.js.map +1 -0
- package/dist/{index-CgmWq1sF.js → index-VmIdPfTW.js} +3 -3
- package/dist/index-VmIdPfTW.js.map +1 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +114 -18
- package/dist/main.js.map +1 -1
- package/dist/node.js +10 -10
- package/dist/{ownership-QK5haR3-.js → ownership-loPNh3_a.js} +2 -2
- package/dist/{ownership-QK5haR3-.js.map → ownership-loPNh3_a.js.map} +1 -1
- package/dist/{property-Dt0U3UXJ.js → property-D8HimAKw.js} +6 -6
- package/dist/{property-Dt0U3UXJ.js.map → property-D8HimAKw.js.map} +1 -1
- package/dist/{queries-BUB-vUBm.js → queries-DPADHnwy.js} +2 -2
- package/dist/{queries-BUB-vUBm.js.map → queries-DPADHnwy.js.map} +1 -1
- package/dist/src/Item/Item.d.ts +12 -9
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/queries.d.ts +3 -3
- package/dist/src/Item/service/actors/fetchDataFromEas.d.ts +1 -1
- package/dist/src/Item/service/actors/fetchDataFromEas.d.ts.map +1 -1
- package/dist/src/Item/service/actors/hydrateExistingItem.d.ts +1 -1
- package/dist/src/Item/service/actors/hydrateNewItem.d.ts +1 -1
- package/dist/src/Item/service/actors/initialize.d.ts +1 -1
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts +2 -2
- package/dist/src/Item/service/actors/reload.d.ts +2 -2
- package/dist/src/Item/service/actors/runPublish.d.ts +2 -2
- package/dist/src/Item/service/actors/saveDataToDb.d.ts +1 -1
- package/dist/src/Item/service/actors/waitForDb.d.ts +1 -1
- package/dist/src/Item/service/itemMachineSingle.d.ts +11 -11
- package/dist/src/ItemProperty/ItemProperty.d.ts +5 -5
- package/dist/src/ItemProperty/service/actors/hydrateFromDb.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/initialize.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/loadOrCreateProperty.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/resolveRelatedValue.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/resolveRemoteStorage.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts +2 -2
- package/dist/src/ItemProperty/service/actors/waitForDb.d.ts +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +14 -14
- package/dist/src/Model/Model.d.ts +2 -2
- package/dist/src/Model/service/actors/createModelProperties.d.ts +1 -1
- package/dist/src/Model/service/actors/loadOrCreateModel.d.ts +1 -1
- package/dist/src/Model/service/actors/validateModel.d.ts +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +6 -6
- package/dist/src/ModelProperty/ModelProperty.d.ts +3 -3
- package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts +1 -1
- package/dist/src/ModelProperty/service/actors/saveToSchema.d.ts +1 -1
- package/dist/src/ModelProperty/service/actors/validateProperty.d.ts +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +7 -7
- package/dist/src/Schema/Schema.d.ts +1 -1
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts +1 -1
- package/dist/src/Schema/service/actors/validateSchema.d.ts +1 -1
- package/dist/src/Schema/service/actors/writeModelsToDb.d.ts +1 -1
- package/dist/src/Schema/service/actors/writeSchemaToDb.d.ts +1 -1
- package/dist/src/Schema/service/addModelsMachine.d.ts +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +7 -7
- package/dist/src/Schema/service/validation/SchemaValidationService.d.ts +4 -4
- package/dist/src/browser/db/Db.d.ts +2 -2
- package/dist/src/browser/helpers/ArweaveClient.d.ts +2 -2
- package/dist/src/browser/helpers/EasClient.d.ts +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts +1 -1
- package/dist/src/browser/helpers/PathResolver.d.ts +1 -1
- package/dist/src/browser/helpers/QueryClient.d.ts +2 -2
- package/dist/src/browser/seed.d.ts +1 -1
- package/dist/src/client/BaseClientManager.d.ts +1 -1
- package/dist/src/client/ClientManager.d.ts +41 -41
- package/dist/src/client/actors/addModelsToDb.d.ts +1 -1
- package/dist/src/client/actors/addModelsToStore.d.ts +1 -1
- package/dist/src/client/actors/dbInit.d.ts +1 -1
- package/dist/src/client/actors/fileSystemInit.d.ts +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts +1 -1
- package/dist/src/client/actors/processSchemaFiles.d.ts +1 -1
- package/dist/src/client/actors/saveConfig.d.ts +1 -1
- package/dist/src/client/clientManagerMachine.d.ts +11 -11
- package/dist/src/client/constants.d.ts +2 -2
- package/dist/src/db/Db/BaseDb.d.ts +1 -1
- package/dist/src/db/read/getItem.d.ts +1 -1
- package/dist/src/db/read/getItemData.d.ts +1 -1
- package/dist/src/db/read/getItemProperties.d.ts +1 -1
- package/dist/src/db/read/getItemProperty.d.ts +1 -1
- package/dist/src/db/read/getItems.d.ts +1 -1
- package/dist/src/db/read/getMetadata.d.ts +1 -1
- package/dist/src/db/read/getModels.d.ts +1 -1
- package/dist/src/db/read/getPropertyData.d.ts +2 -2
- package/dist/src/db/read/getPublishPayload.d.ts +12 -4
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPendingDiff.d.ts +25 -0
- package/dist/src/db/read/getPublishPendingDiff.d.ts.map +1 -0
- package/dist/src/db/read/getPublishUploads.d.ts +3 -3
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts +1 -1
- package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
- package/dist/src/db/read/getRelationValueData.d.ts +1 -1
- package/dist/src/db/read/getSeedData.d.ts +1 -1
- package/dist/src/db/read/getVersionData.d.ts +1 -1
- package/dist/src/db/write/createMetadata.d.ts +2 -2
- package/dist/src/db/write/createNewItem.d.ts +1 -1
- package/dist/src/db/write/createSeeds.d.ts +1 -1
- package/dist/src/db/write/saveMetadata.d.ts +1 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts +1 -1
- package/dist/src/db/write/updateMetadata.d.ts +2 -2
- package/dist/src/eas.d.ts +6 -1
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/events/files/download.d.ts +1 -1
- package/dist/src/helpers/ArweaveClient/BaseArweaveClient.d.ts +1 -1
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts +1 -1
- package/dist/src/helpers/EasClient/BaseEasClient.d.ts +1 -1
- package/dist/src/helpers/QueryClient/BaseQueryClient.d.ts +1 -1
- package/dist/src/helpers/addresses.d.ts +1 -1
- package/dist/src/helpers/db.d.ts +4 -4
- package/dist/src/helpers/easPropertyCanonical.d.ts +15 -0
- package/dist/src/helpers/easPropertyCanonical.d.ts.map +1 -0
- package/dist/src/helpers/file/fetchAll/index.d.ts +1 -1
- package/dist/src/helpers/getSchemaForItemProperty.d.ts +1 -1
- package/dist/src/helpers/getSegmentedItemProperties.d.ts +6 -6
- package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +3 -1
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/model.d.ts +1 -1
- package/dist/src/helpers/ownership.d.ts +1 -1
- package/dist/src/helpers/property/index.d.ts +1 -1
- package/dist/src/helpers/property.d.ts +1 -1
- package/dist/src/helpers/publishConfig.d.ts +1 -1
- package/dist/src/helpers/relationSeedRef.d.ts +8 -0
- package/dist/src/helpers/relationSeedRef.d.ts.map +1 -0
- package/dist/src/helpers/schema.d.ts +2 -2
- package/dist/src/helpers/updateSchema.d.ts +2 -2
- package/dist/src/imports/json.d.ts +1 -1
- package/dist/src/imports/markdown.d.ts +1 -1
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IItem.d.ts +5 -3
- package/dist/src/interfaces/IItem.d.ts.map +1 -1
- package/dist/src/interfaces/IItemProperty.d.ts +3 -3
- package/dist/src/node/codegen/drizzle.d.ts +1 -1
- package/dist/src/node/db/Db.d.ts +3 -3
- package/dist/src/node/helpers/ArweaveClient.d.ts +2 -2
- package/dist/src/node/helpers/EasClient.d.ts +1 -1
- package/dist/src/node/helpers/FileManager.d.ts +1 -1
- package/dist/src/node/helpers/PathResolver.d.ts +1 -1
- package/dist/src/node/helpers/QueryClient.d.ts +2 -2
- package/dist/src/services/publish/actors/createPublishAttempt.d.ts +1 -1
- package/dist/src/services/publish/actors/preparePublishRequestData.d.ts +1 -1
- package/dist/src/services/publish/actors/upload.d.ts +1 -1
- package/dist/src/services/publish/actors/validateItemData.d.ts +1 -1
- package/dist/src/services/publish/publishMachine.d.ts +7 -7
- package/dist/src/services/write/writeProcessMachine.d.ts +1 -1
- package/dist/src/types/db.d.ts +1 -1
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/item.d.ts +6 -6
- package/dist/src/types/machines.d.ts +2 -2
- package/dist/src/types/model.d.ts +3 -3
- package/dist/src/types/property.d.ts +3 -3
- package/dist/src/types/publish.d.ts +1 -1
- package/dist/src/types/seedProtocol.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/getPublishPayload-dR9co4rH.js.map +0 -1
- package/dist/cjs/getPublishUploads-g61mgXaA.js.map +0 -1
- package/dist/cjs/getSegmentedItemProperties-NFvOHlAi.js.map +0 -1
- package/dist/cjs/index-9O_Ji1kY.js.map +0 -1
- package/dist/cjs/index-ud9i9fpp.js.map +0 -1
- package/dist/getPublishPayload-CdfPTl8l.js.map +0 -1
- package/dist/getPublishUploads-CGBky9q9.js.map +0 -1
- package/dist/getSegmentedItemProperties-CJWdYH9W.js.map +0 -1
- package/dist/index-C74KrwXN.js.map +0 -1
- package/dist/index-CgmWq1sF.js.map +0 -1
- package/dist/index-uPXtq2cf.js.map +0 -1
|
@@ -1010,6 +1010,69 @@ function resolveMetadataRecord(records, preferredPropertyName, dataType, refValu
|
|
|
1010
1010
|
return (records.find((r) => r.propertyName === preferredPropertyName) ?? records[0]);
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
+
/** Same rules as getCorrectId in helpers/index (avoid barrel circular import). */
|
|
1014
|
+
function parseLocalIdOrUid(localIdOrUid) {
|
|
1015
|
+
const id = { localId: undefined, uid: undefined };
|
|
1016
|
+
if (!localIdOrUid)
|
|
1017
|
+
return id;
|
|
1018
|
+
if (localIdOrUid.length === 10) {
|
|
1019
|
+
id.localId = localIdOrUid;
|
|
1020
|
+
}
|
|
1021
|
+
if (localIdOrUid.startsWith('0x') && localIdOrUid.length === 66) {
|
|
1022
|
+
id.uid = localIdOrUid;
|
|
1023
|
+
}
|
|
1024
|
+
return id;
|
|
1025
|
+
}
|
|
1026
|
+
/** Relation/image refs may be string ids or `{ seedLocalId?, seedUid? }`. */
|
|
1027
|
+
function normalizeRelationPropertyValue(value) {
|
|
1028
|
+
if (value == null)
|
|
1029
|
+
return undefined;
|
|
1030
|
+
if (typeof value === 'string') {
|
|
1031
|
+
const t = value.trim();
|
|
1032
|
+
return t !== '' ? t : undefined;
|
|
1033
|
+
}
|
|
1034
|
+
if (typeof value === 'object' && value !== null) {
|
|
1035
|
+
const o = value;
|
|
1036
|
+
if (typeof o.seedLocalId === 'string' && o.seedLocalId.trim() !== '') {
|
|
1037
|
+
return o.seedLocalId.trim();
|
|
1038
|
+
}
|
|
1039
|
+
if (typeof o.seedUid === 'string' && o.seedUid.trim() !== '') {
|
|
1040
|
+
return o.seedUid.trim();
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
return undefined;
|
|
1044
|
+
}
|
|
1045
|
+
/** getCorrectId only accepts 10-char local ids and 0x66 uids; local seed refs can be up to 21 chars. */
|
|
1046
|
+
const LOCAL_SEED_REF = /^[a-zA-Z0-9_-]{10,21}$/;
|
|
1047
|
+
/** Resolve seed ids from a single string (context propertyValue or DB row). */
|
|
1048
|
+
function resolveSeedIdsFromRefString(s) {
|
|
1049
|
+
const fromCorrect = parseLocalIdOrUid(s);
|
|
1050
|
+
if (fromCorrect.localId || fromCorrect.uid) {
|
|
1051
|
+
return { seedLocalId: fromCorrect.localId, seedUid: fromCorrect.uid };
|
|
1052
|
+
}
|
|
1053
|
+
if (LOCAL_SEED_REF.test(s) && !s.startsWith('0x')) {
|
|
1054
|
+
return { seedLocalId: s };
|
|
1055
|
+
}
|
|
1056
|
+
return {};
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
function pickLatestPropertyAttestationsByRefAndSchema(attestations) {
|
|
1060
|
+
const byKey = new Map();
|
|
1061
|
+
for (const att of attestations) {
|
|
1062
|
+
const sid = att.schemaId;
|
|
1063
|
+
if (!sid)
|
|
1064
|
+
continue;
|
|
1065
|
+
const key = `${att.refUID ?? ''}:${sid}`;
|
|
1066
|
+
const existing = byKey.get(key);
|
|
1067
|
+
const t = att.timeCreated ?? 0;
|
|
1068
|
+
const t0 = existing?.timeCreated ?? 0;
|
|
1069
|
+
if (!existing || t > t0) {
|
|
1070
|
+
byKey.set(key, att);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
return [...byKey.values()];
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1013
1076
|
const logger$u = debug('seedSdk:shared:helpers');
|
|
1014
1077
|
const { alphanumeric } = nanoIdDictionary;
|
|
1015
1078
|
const generateId = () => {
|
|
@@ -1200,9 +1263,12 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
1200
1263
|
isBinary: isBinary,
|
|
1201
1264
|
listRelationStoragePropertyName: listRelationStoragePropertyName,
|
|
1202
1265
|
needsMetadataIdSuffix: needsMetadataIdSuffix,
|
|
1266
|
+
normalizeRelationPropertyValue: normalizeRelationPropertyValue,
|
|
1203
1267
|
normalizeUploadApiBaseUrl: normalizeUploadApiBaseUrl,
|
|
1204
1268
|
parseEasRelationPropertyName: parseEasRelationPropertyName,
|
|
1269
|
+
pickLatestPropertyAttestationsByRefAndSchema: pickLatestPropertyAttestationsByRefAndSchema,
|
|
1205
1270
|
resolveMetadataRecord: resolveMetadataRecord,
|
|
1271
|
+
resolveSeedIdsFromRefString: resolveSeedIdsFromRefString,
|
|
1206
1272
|
resolveStorageNameToSchemaName: resolveStorageNameToSchemaName,
|
|
1207
1273
|
setAdditionalSyncAddresses: setAdditionalSyncAddresses,
|
|
1208
1274
|
setGetPublisherForNewSeeds: setGetPublisherForNewSeeds,
|
|
@@ -1226,7 +1292,7 @@ const createPropertyInstances = async (propertyFileIds) => {
|
|
|
1226
1292
|
return;
|
|
1227
1293
|
}
|
|
1228
1294
|
try {
|
|
1229
|
-
const mod = await import('./ModelProperty-
|
|
1295
|
+
const mod = await import('./ModelProperty-Bz3V3LoI.js');
|
|
1230
1296
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1231
1297
|
if (!ModelProperty) {
|
|
1232
1298
|
logger$t('createPropertyInstances: ModelProperty not available from dynamic import');
|
|
@@ -1410,7 +1476,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1410
1476
|
// Step 2: Fallback to Schema context (only if database doesn't have the model)
|
|
1411
1477
|
// This handles the case where model exists in schema file but not yet in database
|
|
1412
1478
|
try {
|
|
1413
|
-
const _mod_0 = await import('./Schema-
|
|
1479
|
+
const _mod_0 = await import('./Schema-CFMbnImW.js');
|
|
1414
1480
|
const _ns_0 = _mod_0.b;
|
|
1415
1481
|
const schemaMod = _ns_0;
|
|
1416
1482
|
const { Schema } = schemaMod;
|
|
@@ -1656,7 +1722,7 @@ const loadOrCreateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1656
1722
|
}
|
|
1657
1723
|
// Mark schema as draft when a new model is created so saveNewVersion() can persist it
|
|
1658
1724
|
try {
|
|
1659
|
-
const _mod_1 = await import('./Schema-
|
|
1725
|
+
const _mod_1 = await import('./Schema-CFMbnImW.js');
|
|
1660
1726
|
const _ns_1 = _mod_1.b;
|
|
1661
1727
|
const schemaMod = _ns_1;
|
|
1662
1728
|
const { Schema } = schemaMod;
|
|
@@ -1702,10 +1768,10 @@ const validateModel = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1702
1768
|
const _validateModel = async () => {
|
|
1703
1769
|
try {
|
|
1704
1770
|
// Use dynamic imports to break circular dependencies
|
|
1705
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
1771
|
+
const validationServiceMod = await import('./SchemaValidationService-D4ZVetLE.js');
|
|
1706
1772
|
const { SchemaValidationService } = validationServiceMod;
|
|
1707
1773
|
const validationService = new SchemaValidationService();
|
|
1708
|
-
const _mod_2 = await import('./Schema-
|
|
1774
|
+
const _mod_2 = await import('./Schema-CFMbnImW.js');
|
|
1709
1775
|
const _ns_2 = _mod_2.b;
|
|
1710
1776
|
const schemaMod = _ns_2;
|
|
1711
1777
|
const { Schema } = schemaMod;
|
|
@@ -1817,7 +1883,7 @@ const createModelProperties = fromCallback(({ sendBack, input }) => {
|
|
|
1817
1883
|
return;
|
|
1818
1884
|
}
|
|
1819
1885
|
logger$r(`Creating ${Object.keys(propertyDefinitions).length} properties for model "${modelName}" (id: ${_dbId})`);
|
|
1820
|
-
const mod = await import('./ModelProperty-
|
|
1886
|
+
const mod = await import('./ModelProperty-Bz3V3LoI.js');
|
|
1821
1887
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
1822
1888
|
if (!ModelProperty) {
|
|
1823
1889
|
logger$r('ModelProperty not available from dynamic import');
|
|
@@ -1921,7 +1987,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1921
1987
|
const structureMsg = `[validateEntity] Validating model structure`;
|
|
1922
1988
|
logger$q(structureMsg);
|
|
1923
1989
|
// Use existing Model validation
|
|
1924
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
1990
|
+
const validationServiceMod = await import('./SchemaValidationService-D4ZVetLE.js');
|
|
1925
1991
|
const { SchemaValidationService } = validationServiceMod;
|
|
1926
1992
|
const validationService = new SchemaValidationService();
|
|
1927
1993
|
// Validate model structure
|
|
@@ -1939,7 +2005,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1939
2005
|
if (entityInput.entityData.schemaName) {
|
|
1940
2006
|
try {
|
|
1941
2007
|
logger$q(`[validateEntity] Validating model against schema "${entityInput.entityData.schemaName}"`);
|
|
1942
|
-
const _mod_3 = await import('./Schema-
|
|
2008
|
+
const _mod_3 = await import('./Schema-CFMbnImW.js');
|
|
1943
2009
|
const _ns_3 = _mod_3.b;
|
|
1944
2010
|
const schemaMod = _ns_3;
|
|
1945
2011
|
const { Schema } = schemaMod;
|
|
@@ -1977,7 +2043,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1977
2043
|
}
|
|
1978
2044
|
else if (entityInput.entityType === 'modelProperty') {
|
|
1979
2045
|
// Use existing ModelProperty validation
|
|
1980
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
2046
|
+
const validationServiceMod = await import('./SchemaValidationService-D4ZVetLE.js');
|
|
1981
2047
|
const { SchemaValidationService } = validationServiceMod;
|
|
1982
2048
|
const validationService = new SchemaValidationService();
|
|
1983
2049
|
// Validate property structure
|
|
@@ -1992,7 +2058,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
1992
2058
|
// If schema name and model name provided, validate against schema
|
|
1993
2059
|
if (entityInput.entityData._schemaName && entityInput.entityData.modelName) {
|
|
1994
2060
|
try {
|
|
1995
|
-
const _mod_4 = await import('./Schema-
|
|
2061
|
+
const _mod_4 = await import('./Schema-CFMbnImW.js');
|
|
1996
2062
|
const _ns_4 = _mod_4.b;
|
|
1997
2063
|
const schemaMod = _ns_4;
|
|
1998
2064
|
const { Schema } = schemaMod;
|
|
@@ -2023,7 +2089,7 @@ const validateEntity = fromPromise(async ({ input }) => {
|
|
|
2023
2089
|
}
|
|
2024
2090
|
else if (entityInput.entityType === 'schema') {
|
|
2025
2091
|
// Schema validation - use existing validation
|
|
2026
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
2092
|
+
const validationServiceMod = await import('./SchemaValidationService-D4ZVetLE.js');
|
|
2027
2093
|
const { SchemaValidationService } = validationServiceMod;
|
|
2028
2094
|
const validationService = new SchemaValidationService();
|
|
2029
2095
|
const schemaResult = validationService.validateSchema(entityInput.entityData);
|
|
@@ -4129,7 +4195,7 @@ const writeToDatabase = fromCallback(({ sendBack, input }) => {
|
|
|
4129
4195
|
// initial write completes is not overwritten by the stale requestWrite payload.
|
|
4130
4196
|
let dataToWrite = input.entityData;
|
|
4131
4197
|
try {
|
|
4132
|
-
const mod = await import('./ModelProperty-
|
|
4198
|
+
const mod = await import('./ModelProperty-Bz3V3LoI.js');
|
|
4133
4199
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
4134
4200
|
if (ModelProperty && typeof ModelProperty.getById === 'function') {
|
|
4135
4201
|
const instance = ModelProperty.getById(input.entityId);
|
|
@@ -4509,7 +4575,7 @@ const modelMachine = setup({
|
|
|
4509
4575
|
// Create ModelProperty instances for any new property IDs
|
|
4510
4576
|
if (Array.isArray(newPropertyIds) && newPropertyIds.length > 0) {
|
|
4511
4577
|
// Import and create instances asynchronously (fire-and-forget)
|
|
4512
|
-
import('./ModelProperty-
|
|
4578
|
+
import('./ModelProperty-Bz3V3LoI.js').then(({ ModelProperty }) => {
|
|
4513
4579
|
const createPromises = newPropertyIds.map(async (propertyFileId) => {
|
|
4514
4580
|
try {
|
|
4515
4581
|
const property = await ModelProperty.createById(propertyFileId);
|
|
@@ -5301,6 +5367,11 @@ const getItemVersionsFromEas = async ({ seedUids, excludeRevoked = true, }) => {
|
|
|
5301
5367
|
});
|
|
5302
5368
|
return itemVersions;
|
|
5303
5369
|
};
|
|
5370
|
+
/**
|
|
5371
|
+
* Returns all property attestations for the given Version UIDs. May include multiple
|
|
5372
|
+
* rows per schema (patch updates). Use `pickLatestPropertyAttestationsByRefAndSchema`
|
|
5373
|
+
* from `@seedprotocol/sdk` to resolve canonical values per `(refUID, schemaId)`.
|
|
5374
|
+
*/
|
|
5304
5375
|
const getItemPropertiesFromEas = async ({ versionUids, excludeRevoked = true, }) => {
|
|
5305
5376
|
const queryClient = BaseQueryClient.getQueryClient();
|
|
5306
5377
|
const easClient = BaseEasClient.getEasClient();
|
|
@@ -5676,26 +5747,14 @@ const fetchDataFromEas = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
5676
5747
|
},
|
|
5677
5748
|
}),
|
|
5678
5749
|
});
|
|
5679
|
-
|
|
5750
|
+
const latest = pickLatestPropertyAttestationsByRefAndSchema(itemProperties);
|
|
5680
5751
|
const selectedPropertiesMap = {};
|
|
5681
|
-
|
|
5682
|
-
const
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
Object.keys(selectedPropertiesMap).forEach((schemaId) => {
|
|
5688
|
-
const sorted = selectedPropertiesMap[schemaId].sort((a, b) => {
|
|
5689
|
-
return a.timeCreated - b.timeCreated;
|
|
5690
|
-
});
|
|
5691
|
-
selectedPropertiesMap[schemaId] = sorted;
|
|
5692
|
-
});
|
|
5693
|
-
Object.keys(selectedPropertiesMap).forEach((schemaId) => {
|
|
5694
|
-
// TODO: Finish this logic
|
|
5695
|
-
// console.log('[singleItemActors] [fetchDataFromEas] schemaId', schemaId)
|
|
5696
|
-
// sendBack({ type: 'addPropertyAttestation', schemaId })
|
|
5697
|
-
});
|
|
5698
|
-
// Attach processed properties to the itemService/itemMachine context
|
|
5752
|
+
for (const property of latest) {
|
|
5753
|
+
const sid = property.schemaId;
|
|
5754
|
+
if (!sid)
|
|
5755
|
+
continue;
|
|
5756
|
+
selectedPropertiesMap[sid] = [property];
|
|
5757
|
+
}
|
|
5699
5758
|
sendBack({
|
|
5700
5759
|
type: 'updatedPropertiesBySchemaUid',
|
|
5701
5760
|
propertiesBySchemaUid: selectedPropertiesMap,
|
|
@@ -5789,7 +5848,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
5789
5848
|
const schemaNameToTry = model$1?.schemaName;
|
|
5790
5849
|
if (schemaNameToTry) {
|
|
5791
5850
|
try {
|
|
5792
|
-
const _mod_5 = await import('./Schema-
|
|
5851
|
+
const _mod_5 = await import('./Schema-CFMbnImW.js');
|
|
5793
5852
|
const _ns_5 = _mod_5.b;
|
|
5794
5853
|
const { Schema } = _ns_5;
|
|
5795
5854
|
const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
|
|
@@ -5840,7 +5899,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
5840
5899
|
}
|
|
5841
5900
|
}
|
|
5842
5901
|
if (Object.keys(propertySchemas).length === 0) {
|
|
5843
|
-
const schemaMod = await import('./index-
|
|
5902
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
5844
5903
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5845
5904
|
const KNOWN_MODEL_FALLBACKS = {
|
|
5846
5905
|
Post: {
|
|
@@ -5889,7 +5948,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
5889
5948
|
// Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
|
|
5890
5949
|
let propSchema = propertySchemas[propertyName];
|
|
5891
5950
|
if (!propSchema && isRefTypeFromMeta) {
|
|
5892
|
-
const schemaMod = await import('./index-
|
|
5951
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
5893
5952
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5894
5953
|
propSchema = {
|
|
5895
5954
|
dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
|
|
@@ -6137,9 +6196,9 @@ const runPublish = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
6137
6196
|
sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
|
|
6138
6197
|
return;
|
|
6139
6198
|
}
|
|
6140
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
6199
|
+
const getPublishUploadsMod = await import('./getPublishUploads-QgfPyhcs.js');
|
|
6141
6200
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
6142
|
-
const getPublishPayloadMod = await import('./getPublishPayload-
|
|
6201
|
+
const getPublishPayloadMod = await import('./getPublishPayload-CqUCIlu1.js');
|
|
6143
6202
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
6144
6203
|
const uploads = await getPublishUploads(item);
|
|
6145
6204
|
let uploadedTransactions = [];
|
|
@@ -6904,7 +6963,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
6904
6963
|
const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
|
|
6905
6964
|
const _resolveRelatedValue = async () => {
|
|
6906
6965
|
// Use dynamic import to break circular dependency
|
|
6907
|
-
const schemaMod = await import('./index-
|
|
6966
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
6908
6967
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
6909
6968
|
if (!propertyValue || !isRelation || populatedFromDb) {
|
|
6910
6969
|
return;
|
|
@@ -7280,7 +7339,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
7280
7339
|
// to use dynamically imported ModelPropertyDataTypes
|
|
7281
7340
|
const _hydrateFromDb = async () => {
|
|
7282
7341
|
// Use dynamic import to break circular dependency
|
|
7283
|
-
const schemaMod = await import('./index-
|
|
7342
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
7284
7343
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7285
7344
|
const appDb = BaseDb.getAppDb();
|
|
7286
7345
|
const whereClauses = [];
|
|
@@ -7585,7 +7644,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
7585
7644
|
};
|
|
7586
7645
|
// Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
|
|
7587
7646
|
try {
|
|
7588
|
-
const { getPropertySchema } = await import('./property-
|
|
7647
|
+
const { getPropertySchema } = await import('./property-D8HimAKw.js');
|
|
7589
7648
|
let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName);
|
|
7590
7649
|
if (!schemaFromFile?.validation) {
|
|
7591
7650
|
// Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
|
|
@@ -7969,9 +8028,9 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
7969
8028
|
}
|
|
7970
8029
|
const _analyzeInput = async () => {
|
|
7971
8030
|
// Use dynamic import to break circular dependency
|
|
7972
|
-
const schemaMod = await import('./index-
|
|
8031
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
7973
8032
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
7974
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
8033
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-D4ZVetLE.js');
|
|
7975
8034
|
let propertyName = propertyNameRaw;
|
|
7976
8035
|
if (!propertyName) {
|
|
7977
8036
|
throw new Error('propertyName is required');
|
|
@@ -8169,7 +8228,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
|
|
|
8169
8228
|
propertyRecordSchema?.validation &&
|
|
8170
8229
|
metadataValues.propertyValue != null &&
|
|
8171
8230
|
metadataValues.propertyValue !== '') {
|
|
8172
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
8231
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-D4ZVetLE.js');
|
|
8173
8232
|
const validationService = new SchemaValidationService();
|
|
8174
8233
|
const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, propertyRecordSchema.dataType, propertyRecordSchema.validation, propertyRecordSchema.refValueType);
|
|
8175
8234
|
if (!validationResult.isValid && validationResult.errors.length > 0) {
|
|
@@ -8756,7 +8815,7 @@ const saveRelation = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
8756
8815
|
}
|
|
8757
8816
|
const _saveRelation = async () => {
|
|
8758
8817
|
// Use dynamic import to break circular dependency
|
|
8759
|
-
const schemaMod = await import('./index-
|
|
8818
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
8760
8819
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
8761
8820
|
if (!propertyNameRaw) {
|
|
8762
8821
|
throw new Error('propertyName is required');
|
|
@@ -9788,7 +9847,7 @@ class ItemProperty {
|
|
|
9788
9847
|
return;
|
|
9789
9848
|
}
|
|
9790
9849
|
// Use dynamic import to break circular dependency
|
|
9791
|
-
const schemaMod = await import('./index-
|
|
9850
|
+
const schemaMod = await import('./index-VmIdPfTW.js');
|
|
9792
9851
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
9793
9852
|
const { context } = snapshot;
|
|
9794
9853
|
const { propertyRecordSchema } = context;
|
|
@@ -9946,7 +10005,7 @@ class ItemProperty {
|
|
|
9946
10005
|
const normalizedRefValueType = normalizeDataType(propertyRecordSchema?.refValueType);
|
|
9947
10006
|
const propertyNames = getMetadataPropertyNamesForQuery(propertyName, normalizedDataType, normalizedRefValueType);
|
|
9948
10007
|
const propertyNameVariant = propertyNames.length > 1 ? propertyNames[1] : undefined;
|
|
9949
|
-
const _mod_6 = await import('./index-
|
|
10008
|
+
const _mod_6 = await import('./index-QSl4EYun.js');
|
|
9950
10009
|
const _ns_6 = _mod_6.s;
|
|
9951
10010
|
const seedSchemaMod = _ns_6;
|
|
9952
10011
|
const { metadata } = seedSchemaMod;
|
|
@@ -10647,7 +10706,7 @@ class ItemProperty {
|
|
|
10647
10706
|
}
|
|
10648
10707
|
async save() {
|
|
10649
10708
|
const ctx = this._getSnapshotContext();
|
|
10650
|
-
const { assertItemOwned } = await import('./ownership-
|
|
10709
|
+
const { assertItemOwned } = await import('./ownership-loPNh3_a.js');
|
|
10651
10710
|
await assertItemOwned({
|
|
10652
10711
|
seedLocalId: ctx?.seedLocalId ?? undefined,
|
|
10653
10712
|
seedUid: ctx?.seedUid ?? undefined,
|
|
@@ -10740,7 +10799,7 @@ class ItemProperty {
|
|
|
10740
10799
|
if (!propertyName || (!seedLocalId && !seedUid))
|
|
10741
10800
|
return;
|
|
10742
10801
|
if (db) {
|
|
10743
|
-
const _mod_7 = await import('./index-
|
|
10802
|
+
const _mod_7 = await import('./index-QSl4EYun.js');
|
|
10744
10803
|
const _ns_7 = _mod_7.s;
|
|
10745
10804
|
const seedSchemaMod = _ns_7;
|
|
10746
10805
|
const { metadata } = seedSchemaMod;
|
|
@@ -10987,7 +11046,7 @@ class Item {
|
|
|
10987
11046
|
});
|
|
10988
11047
|
};
|
|
10989
11048
|
this.unpublish = async () => {
|
|
10990
|
-
const { assertItemOwned } = await import('./ownership-
|
|
11049
|
+
const { assertItemOwned } = await import('./ownership-loPNh3_a.js');
|
|
10991
11050
|
const { getRevokeExecutor } = await Promise.resolve().then(function () { return publishConfig; });
|
|
10992
11051
|
await assertItemOwned(this);
|
|
10993
11052
|
const seedUid = this.seedUid;
|
|
@@ -11011,7 +11070,7 @@ class Item {
|
|
|
11011
11070
|
this._service.send({ type: 'updateContext', revokedAt });
|
|
11012
11071
|
};
|
|
11013
11072
|
this.publish = async () => {
|
|
11014
|
-
const { assertItemOwned } = await import('./ownership-
|
|
11073
|
+
const { assertItemOwned } = await import('./ownership-loPNh3_a.js');
|
|
11015
11074
|
await assertItemOwned(this);
|
|
11016
11075
|
this._service.send({ type: 'startPublish' });
|
|
11017
11076
|
return new Promise((resolve, reject) => {
|
|
@@ -11047,15 +11106,14 @@ class Item {
|
|
|
11047
11106
|
};
|
|
11048
11107
|
this.getPublishUploads = async () => {
|
|
11049
11108
|
// Use dynamic import to break circular dependency
|
|
11050
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
11109
|
+
const getPublishUploadsMod = await import('./getPublishUploads-QgfPyhcs.js');
|
|
11051
11110
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
11052
11111
|
return await getPublishUploads(this);
|
|
11053
11112
|
};
|
|
11054
|
-
this.getPublishPayload = async (uploadedTransactions) => {
|
|
11055
|
-
|
|
11056
|
-
const getPublishPayloadMod = await import('./getPublishPayload-CdfPTl8l.js');
|
|
11113
|
+
this.getPublishPayload = async (uploadedTransactions, options) => {
|
|
11114
|
+
const getPublishPayloadMod = await import('./getPublishPayload-CqUCIlu1.js');
|
|
11057
11115
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
11058
|
-
return await getPublishPayload(this, uploadedTransactions);
|
|
11116
|
+
return await getPublishPayload(this, uploadedTransactions, options);
|
|
11059
11117
|
};
|
|
11060
11118
|
this.persistSeedUid = async (publisher) => {
|
|
11061
11119
|
const ctx = this._getSnapshotContext();
|
|
@@ -11944,7 +12002,7 @@ class Item {
|
|
|
11944
12002
|
setupState.subscriptionSetUp = true;
|
|
11945
12003
|
logger(`[Item._setupLiveQuerySubscription] Setting up liveQuery for seedLocalId: ${seedLocalId}`);
|
|
11946
12004
|
try {
|
|
11947
|
-
const _mod_8 = await import('./index-
|
|
12005
|
+
const _mod_8 = await import('./index-QSl4EYun.js');
|
|
11948
12006
|
const _ns_8 = _mod_8.s;
|
|
11949
12007
|
const seedSchemaMod = _ns_8;
|
|
11950
12008
|
const { seeds, versions, metadata } = seedSchemaMod;
|
|
@@ -12255,7 +12313,7 @@ class Item {
|
|
|
12255
12313
|
* Destroy the item: soft delete in DB, remove from caches, clean up subscriptions, stop service.
|
|
12256
12314
|
*/
|
|
12257
12315
|
async destroy() {
|
|
12258
|
-
const { assertItemOwned } = await import('./ownership-
|
|
12316
|
+
const { assertItemOwned } = await import('./ownership-loPNh3_a.js');
|
|
12259
12317
|
await assertItemOwned(this);
|
|
12260
12318
|
const context = this._getSnapshotContext();
|
|
12261
12319
|
const cacheKey = context.seedUid || context.seedLocalId;
|
|
@@ -12989,20 +13047,20 @@ const platformClassesInit = fromCallback(({ sendBack, input: { context, event }
|
|
|
12989
13047
|
let PathResolver;
|
|
12990
13048
|
let EasClient;
|
|
12991
13049
|
if (isBrowser()) {
|
|
12992
|
-
FileManager = (await import('./FileManager-
|
|
12993
|
-
Db = (await import('./Db-
|
|
12994
|
-
QueryClient = (await import('./QueryClient-
|
|
12995
|
-
ArweaveClient = (await import('./ArweaveClient-
|
|
12996
|
-
PathResolver = (await import('./PathResolver-
|
|
12997
|
-
EasClient = (await import('./EasClient-
|
|
13050
|
+
FileManager = (await import('./FileManager-DgraLHZS.js')).FileManager;
|
|
13051
|
+
Db = (await import('./Db-DWvxJG22.js')).Db;
|
|
13052
|
+
QueryClient = (await import('./QueryClient-CJV1m2rc.js')).QueryClient;
|
|
13053
|
+
ArweaveClient = (await import('./ArweaveClient-CpShI0B0.js')).ArweaveClient;
|
|
13054
|
+
PathResolver = (await import('./PathResolver-DQ5hyu8X.js')).PathResolver;
|
|
13055
|
+
EasClient = (await import('./EasClient-CtLqK_qz.js')).EasClient;
|
|
12998
13056
|
}
|
|
12999
13057
|
else if (isNode()) {
|
|
13000
|
-
FileManager = (await import('./FileManager-
|
|
13001
|
-
Db = (await import('./Db-
|
|
13002
|
-
QueryClient = (await import('./QueryClient-
|
|
13003
|
-
ArweaveClient = (await import('./ArweaveClient-
|
|
13004
|
-
PathResolver = (await import('./PathResolver-
|
|
13005
|
-
EasClient = (await import('./EasClient-
|
|
13058
|
+
FileManager = (await import('./FileManager-DSihj6Sj.js')).FileManager;
|
|
13059
|
+
Db = (await import('./Db-29bu0gJx.js')).Db;
|
|
13060
|
+
QueryClient = (await import('./QueryClient-DYaqIx7e.js')).QueryClient;
|
|
13061
|
+
ArweaveClient = (await import('./ArweaveClient-WfxkMgxb.js')).ArweaveClient;
|
|
13062
|
+
PathResolver = (await import('./PathResolver-DOu-0k75.js')).PathResolver;
|
|
13063
|
+
EasClient = (await import('./EasClient-BwBg9Kkd.js')).EasClient;
|
|
13006
13064
|
}
|
|
13007
13065
|
else {
|
|
13008
13066
|
throw new Error(`Unable to determine environment. isBrowser()=${isBrowser()}, isNode()=${isNode()}. Platform-specific implementations could not be loaded.`);
|
|
@@ -16537,7 +16595,7 @@ const saveDraftLogger = debug('seedSdk:model:saveDraftToDb');
|
|
|
16537
16595
|
// Lazy import cache for ModelProperty to avoid circular dependency
|
|
16538
16596
|
// Eagerly start loading to minimize delay on first access
|
|
16539
16597
|
let ModelPropertyClass = null;
|
|
16540
|
-
const modelPropertyImportPromise = import('./ModelProperty-
|
|
16598
|
+
const modelPropertyImportPromise = import('./ModelProperty-Bz3V3LoI.js')
|
|
16541
16599
|
.then(module => {
|
|
16542
16600
|
ModelPropertyClass = module.ModelProperty;
|
|
16543
16601
|
return ModelPropertyClass;
|
|
@@ -16554,7 +16612,7 @@ function getModelProperty() {
|
|
|
16554
16612
|
}
|
|
16555
16613
|
// Lazy import cache for Schema to avoid circular dependency
|
|
16556
16614
|
let SchemaClass = null;
|
|
16557
|
-
const schemaImportPromise = (async () => { const _mod_9 = await import('./Schema-
|
|
16615
|
+
const schemaImportPromise = (async () => { const _mod_9 = await import('./Schema-CFMbnImW.js'); return _mod_9.b; })()
|
|
16558
16616
|
.then(module => {
|
|
16559
16617
|
SchemaClass = module.Schema;
|
|
16560
16618
|
return SchemaClass;
|
|
@@ -18294,5 +18352,5 @@ var Model$1 = /*#__PURE__*/Object.freeze({
|
|
|
18294
18352
|
const TModelValues = Type.Record(Type.String(), Type.Any());
|
|
18295
18353
|
const TModelSchema = Type.Record(Type.String(), TProperty);
|
|
18296
18354
|
|
|
18297
|
-
export {
|
|
18298
|
-
//# sourceMappingURL=index-
|
|
18355
|
+
export { SEED_CONFIG_FILE as $, versions as A, Boolean$1 as B, modelPropertiesToObject as C, Date$1 as D, parseListPropertyValueFromStorage as E, File$1 as F, getCorrectId as G, INTERNAL_PROPERTY_NAMES as H, Image as I, Json as J, defaultAttestationData as K, List as L, Model as M, Number$1 as N, INTERNAL_DATA_TYPES as O, Property as P, toSnakeCase as Q, Relation as R, getEasSchemaUidForSchemaDefinition as S, TModelValues as T, getEasSchemaForItemProperty as U, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as V, getItemData as W, resolveStorageNameToSchemaName as X, appState as Y, ZERO_BYTES32 as Z, BasePathResolver as _, TModelSchema as a, importJsonSchema as a$, SEED_CONFIG_FALLBACKS as a0, BaseEasClient as a1, EAS_ENDPOINT as a2, BaseQueryClient as a3, config as a4, metadata$1 as a5, modelRelations as a6, modelSchemas as a7, modelUids as a8, modelsRelations as a9, getEasSchemaUidBySchemaName as aA, getSeedsFromSchemaUids as aB, getSeedsBySchemaName as aC, generateId as aD, withExcludeRevokedFilter as aE, pickLatestPropertyAttestationsByRefAndSchema as aF, SeedModels as aG, DEFAULT_ARWEAVE_HOST as aH, DEFAULT_ARWEAVE_GATEWAYS as aI, updateSeedRevokedAt as aJ, getAddressesForItemsFilter as aK, getArweaveUrlForTransaction as aL, normalizeUploadApiBaseUrl as aM, getUploadApiArweaveDataUrl as aN, getUploadPipelineTransactionStatus as aO, waitForEntityIdle as aP, setUploadExecutor as aQ, getUploadExecutor as aR, setGetPublisherForNewSeeds as aS, getGetPublisherForNewSeeds as aT, setRevokeExecutor as aU, getRevokeExecutor as aV, setAdditionalSyncAddresses as aW, createSchema as aX, readSchema as aY, listCompleteSchemaFiles as aZ, getSchemaNameFromId as a_, propertiesRelations as aa, propertyUidRelations as ab, propertyUids as ac, publishProcesses as ad, schemas as ae, uploadProcesses as af, graphql as ag, getPropertyIdForModelAndName as ah, saveAppState as ai, eventEmitter as aj, getClient as ak, ClientManagerState as al, MachineIds as am, createNewItem as an, getVersionData$1 as ao, getMetadataLatest as ap, loadAllSchemasFromDb as aq, propertyMachine as ar, SEED_PROTOCOL_SCHEMA_NAME as as, ImageSize as at, ItemProperty as au, setSchemaUidForSchemaDefinition as av, setSchemaUidForModel as aw, getModelSchemasFromEas as ax, getItemVersionsFromEas as ay, getItemPropertiesFromEas as az, ModelPropertyDataTypes as b, readJsonImportFile as b0, syncSchemaFromSource as b1, transformImportToSchemaFile as b2, ClientManager as b3, addModelsToDb$1 as b4, SCHEMA_NJK as b5, INIT_SCRIPT_SUCCESS_MESSAGE as b6, SCHEMA_TS as b7, getRefValueType as b8, loadSchemaFromFile as b9, writeProcessMachine as ba, getModelIdByFileId as bb, createReactiveProxy as bc, findEntity as bd, forceRemoveFromCaches as be, runDestroyLifecycle as bf, getModelId as bg, addSchemaToDb as bh, createModelsFromJson as bi, loadModelsFromDbForSchema as bj, getLatestSchemaVersion as bk, isInternalSchema as bl, createModelFromJson as bm, ConflictError as bn, unloadEntity as bo, clearDestroySubscriptions as bp, setupEntityLiveQuery as bq, ModelSchema as br, BaseFileManager$1 as bs, db as bt, eas as bu, getPropertyData$1 as bv, schema as bw, SEEDPROTOCOL_Seed_Protocol_v1 as bx, Model$1 as by, TPropertyDataType as c, TStorageType as d, TProperty as e, TPropertyConstructor as f, TPropertyDefs as g, PropertyMetadataKey as h, PropertyConstructor as i, Text as j, DEFAULT_TEXT_MAX_LENGTH as k, TValidationRules as l, getOwnedAddressesFromDb as m, normalizeDataType as n, BaseDb as o, getGetAdditionalSyncAddresses as p, normalizeRelationPropertyValue as q, resolveSeedIdsFromRefString as r, seeds as s, Item as t, BaseFileManager as u, getContentHash as v, BaseArweaveClient as w, getEasSchemaUidForModel as x, models$1 as y, properties as z };
|
|
18356
|
+
//# sourceMappingURL=index-CtzvJMAE.js.map
|