@seedprotocol/sdk 0.7.0 → 0.7.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-ndE8XTpw.js → BasePathResolver-DRT09oVv.js} +2 -2
- package/dist/{BasePathResolver-ndE8XTpw.js.map → BasePathResolver-DRT09oVv.js.map} +1 -1
- package/dist/{ClientManager-DLleL_2e.js → ClientManager-DngaZdw6.js} +20 -20
- package/dist/{ClientManager-DLleL_2e.js.map → ClientManager-DngaZdw6.js.map} +1 -1
- package/dist/{Item-zBFWQDU9.js → Item-ZUAmf943.js} +118 -72
- package/dist/{Item-zBFWQDU9.js.map → Item-ZUAmf943.js.map} +1 -1
- package/dist/{ModelProperty-lth9L37R.js → ModelProperty-6llK4MTH.js} +64 -35
- package/dist/ModelProperty-6llK4MTH.js.map +1 -0
- package/dist/{Schema-DOhlrQ-N.js → Schema-D-Ud-XYw.js} +106 -57
- package/dist/Schema-D-Ud-XYw.js.map +1 -0
- package/dist/{SchemaValidationService-DDKr5piy.js → SchemaValidationService-IoS7JquP.js} +7 -7
- package/dist/{SchemaValidationService-DDKr5piy.js.map → SchemaValidationService-IoS7JquP.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-fG3ujaSh.js → backfillMetadataPropertyIds-BlVeE7w7.js} +4 -4
- package/dist/{backfillMetadataPropertyIds-fG3ujaSh.js.map → backfillMetadataPropertyIds-BlVeE7w7.js.map} +1 -1
- package/dist/cjs/{ModelProperty-BEsIHAjk.js → ModelProperty-Dv7AQfmQ.js} +59 -30
- package/dist/cjs/ModelProperty-Dv7AQfmQ.js.map +1 -0
- package/dist/cjs/{Schema-qEp5mH1N.js → Schema-BHVp1g-M.js} +93 -44
- package/dist/cjs/Schema-BHVp1g-M.js.map +1 -0
- package/dist/cjs/{SchemaValidationService-CWEnZmOH.js → SchemaValidationService-BSU9knjf.js} +2 -2
- package/dist/cjs/{SchemaValidationService-CWEnZmOH.js.map → SchemaValidationService-BSU9knjf.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-tw8JGMT0.js → backfillMetadataPropertyIds-WIovQ_d8.js} +3 -3
- package/dist/cjs/{backfillMetadataPropertyIds-tw8JGMT0.js.map → backfillMetadataPropertyIds-WIovQ_d8.js.map} +1 -1
- package/dist/cjs/{eas-CLiV2Hmn.js → eas-CUYXdr2t.js} +3 -3
- package/dist/cjs/{eas-CLiV2Hmn.js.map → eas-CUYXdr2t.js.map} +1 -1
- package/dist/cjs/{getItem-DSRtx_68.js → getItem-z1tHu0hu.js} +2 -2
- package/dist/cjs/{getItem-DSRtx_68.js.map → getItem-z1tHu0hu.js.map} +1 -1
- package/dist/cjs/{getLatestVersionRow-DVizNNoI.js → getLatestVersionRow-CcaabxIW.js} +2 -2
- package/dist/cjs/{getLatestVersionRow-DVizNNoI.js.map → getLatestVersionRow-CcaabxIW.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-D5-dYtNq.js → getPublishPayload-CEP_e-Kv.js} +160 -204
- package/dist/cjs/getPublishPayload-CEP_e-Kv.js.map +1 -0
- package/dist/cjs/{getPublishUploads-B5Lq6q-_.js → getPublishUploads-Ctn5k1k6.js} +49 -10
- package/dist/cjs/getPublishUploads-Ctn5k1k6.js.map +1 -0
- package/dist/cjs/{index-C66AfYDG.js → index-Cvvt0-5B.js} +244 -87
- package/dist/cjs/index-Cvvt0-5B.js.map +1 -0
- package/dist/cjs/{index-B3UDbm1C.js → index-DfGhF1dc.js} +3 -3
- package/dist/cjs/index-DfGhF1dc.js.map +1 -0
- package/dist/cjs/{property-BVJIP7SX.js → property-DbEPQ1m9.js} +5 -5
- package/dist/cjs/{property-BVJIP7SX.js.map → property-DbEPQ1m9.js.map} +1 -1
- package/dist/cjs/publishDraftGraph-C38gf302.js +403 -0
- package/dist/cjs/publishDraftGraph-C38gf302.js.map +1 -0
- package/dist/cjs/{resetAmbiguousLegacyItemData-BaZqUui9.js → resetAmbiguousLegacyItemData-CfMhRHwK.js} +2 -2
- package/dist/cjs/{resetAmbiguousLegacyItemData-BaZqUui9.js.map → resetAmbiguousLegacyItemData-CfMhRHwK.js.map} +1 -1
- package/dist/cjs/{resolveModelForSyncedSeed-CC6dQctx.js → resolveModelForSyncedSeed-CNYaLOir.js} +2 -2
- package/dist/cjs/{resolveModelForSyncedSeed-CC6dQctx.js.map → resolveModelForSyncedSeed-CNYaLOir.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-Dk96sAG-.js → syncDbWithEas-d1iOdTTI.js} +20 -7
- package/dist/cjs/{syncDbWithEas-Dk96sAG-.js.map → syncDbWithEas-d1iOdTTI.js.map} +1 -1
- package/dist/{configurePlatform-BMoPG9vY.js → configurePlatform-CZpjyuCo.js} +4 -4
- package/dist/{configurePlatform-BMoPG9vY.js.map → configurePlatform-CZpjyuCo.js.map} +1 -1
- package/dist/{db-BJZN0a0a.js → db-Lw0KVZmc.js} +11 -11
- package/dist/{db-BJZN0a0a.js.map → db-Lw0KVZmc.js.map} +1 -1
- package/dist/{eas-B0hsMLqt.js → eas-CQ-Smzk2.js} +6 -6
- package/dist/{eas-B0hsMLqt.js.map → eas-CQ-Smzk2.js.map} +1 -1
- package/dist/{getItem-DEh4WfHG.js → getItem-CSfSok9f.js} +5 -5
- package/dist/{getItem-DEh4WfHG.js.map → getItem-CSfSok9f.js.map} +1 -1
- package/dist/{getLatestVersionRow-Brrl1AnW.js → getLatestVersionRow-72Atl9vB.js} +5 -5
- package/dist/{getLatestVersionRow-Brrl1AnW.js.map → getLatestVersionRow-72Atl9vB.js.map} +1 -1
- package/dist/{getPublishPayload-H032DHC7.js → getPublishPayload-76_KfB5Y.js} +155 -200
- package/dist/getPublishPayload-76_KfB5Y.js.map +1 -0
- package/dist/{getPublishUploads-CR66RlGJ.js → getPublishUploads-CqgMBD8f.js} +52 -13
- package/dist/getPublishUploads-CqgMBD8f.js.map +1 -0
- package/dist/{index-B0LgJblD.js → index-5b3JsS55.js} +2 -2
- package/dist/index-5b3JsS55.js.map +1 -0
- package/dist/{index-6bJuv5Tt.js → index-BpgD305l.js} +9 -9
- package/dist/{index-6bJuv5Tt.js.map → index-BpgD305l.js.map} +1 -1
- package/dist/{index-DtfjeuxC.js → index-Y-yYyRBf.js} +166 -75
- package/dist/index-Y-yYyRBf.js.map +1 -0
- package/dist/{index.browser-CNrqhvEA.js → index.browser-DaTzn79x.js} +9 -9
- package/dist/{index.browser-CNrqhvEA.js.map → index.browser-DaTzn79x.js.map} +1 -1
- package/dist/{index.node-DrHiTuOr.js → index.node-NYKqFOoe.js} +5 -5
- package/dist/{index.node-DrHiTuOr.js.map → index.node-NYKqFOoe.js.map} +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +257 -181
- package/dist/main.js.map +1 -1
- package/dist/node.js +12 -12
- package/dist/platform.browser.js +5 -5
- package/dist/platform.node.js +3 -3
- package/dist/{property-D2Nnsmm1.js → property-ByaiSyUK.js} +10 -10
- package/dist/{property-D2Nnsmm1.js.map → property-ByaiSyUK.js.map} +1 -1
- package/dist/publishDraftGraph-BRm6Pq3Q.js +405 -0
- package/dist/publishDraftGraph-BRm6Pq3Q.js.map +1 -0
- package/dist/{resetAmbiguousLegacyItemData-BqbHNUYk.js → resetAmbiguousLegacyItemData-B4dX6ZA1.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-BqbHNUYk.js.map → resetAmbiguousLegacyItemData-B4dX6ZA1.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-DQK6JfXS.js → resolveModelForSyncedSeed-B0tco3zG.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-DQK6JfXS.js.map → resolveModelForSyncedSeed-B0tco3zG.js.map} +1 -1
- package/dist/src/Item/Item.d.ts +11 -0
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +10 -0
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts +15 -2
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Model/service/actors/createModelProperties.d.ts.map +1 -1
- package/dist/src/Model/service/actors/loadOrCreateModel.d.ts.map +1 -1
- package/dist/src/Model/service/actors/validateModel.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts +9 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/saveToSchema.d.ts.map +1 -1
- package/dist/src/ModelProperty/service/actors/validateProperty.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts +7 -0
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/createModelInstances.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts +9 -0
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts +5 -0
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/publishDraftGraph.d.ts +57 -0
- package/dist/src/db/read/publishDraftGraph.d.ts.map +1 -0
- package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
- package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -1
- package/dist/src/helpers/entity/evictionEpoch.d.ts +18 -0
- package/dist/src/helpers/entity/evictionEpoch.d.ts.map +1 -0
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +28 -6
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/services/write/actors/validateEntity.d.ts.map +1 -1
- package/dist/src/types/item.d.ts +7 -8
- package/dist/src/types/item.d.ts.map +1 -1
- package/dist/{syncDbWithEas-LRKr_NZF.js → syncDbWithEas-BPap9Sru.js} +14 -14
- package/dist/{syncDbWithEas-LRKr_NZF.js.map → syncDbWithEas-BPap9Sru.js.map} +1 -1
- package/dist/{tabEvents-DYI2GU7i.js → tabEvents-C6NXS6Jl.js} +6 -6
- package/dist/{tabEvents-DYI2GU7i.js.map → tabEvents-C6NXS6Jl.js.map} +1 -1
- package/dist/{tolerantWebAccess-CzOBz5M6.js → tolerantWebAccess-NBQ1NB4i.js} +6 -6
- package/dist/{tolerantWebAccess-CzOBz5M6.js.map → tolerantWebAccess-NBQ1NB4i.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-B58ORbY3.js → updateSeedRevokedAt-CYwgVNlM.js} +3 -3
- package/dist/{updateSeedRevokedAt-B58ORbY3.js.map → updateSeedRevokedAt-CYwgVNlM.js.map} +1 -1
- package/package.json +8 -10
- package/dist/ModelProperty-lth9L37R.js.map +0 -1
- package/dist/Schema-DOhlrQ-N.js.map +0 -1
- package/dist/cjs/ModelProperty-BEsIHAjk.js.map +0 -1
- package/dist/cjs/Schema-qEp5mH1N.js.map +0 -1
- package/dist/cjs/getPublishPayload-D5-dYtNq.js.map +0 -1
- package/dist/cjs/getPublishUploads-B5Lq6q-_.js.map +0 -1
- package/dist/cjs/getSegmentedItemProperties-giHO7R3d.js +0 -147
- package/dist/cjs/getSegmentedItemProperties-giHO7R3d.js.map +0 -1
- package/dist/cjs/index-B3UDbm1C.js.map +0 -1
- package/dist/cjs/index-C66AfYDG.js.map +0 -1
- package/dist/getPublishPayload-H032DHC7.js.map +0 -1
- package/dist/getPublishUploads-CR66RlGJ.js.map +0 -1
- package/dist/getSegmentedItemProperties-C2EJ2G0N.js +0 -147
- package/dist/getSegmentedItemProperties-C2EJ2G0N.js.map +0 -1
- package/dist/index-B0LgJblD.js.map +0 -1
- package/dist/index-DtfjeuxC.js.map +0 -1
- package/dist/src/browser/helpers/index.d.ts +0 -4
- package/dist/src/browser/helpers/index.d.ts.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { waitFor, fromCallback, setup, assign, stateIn, createActor, isMachineSnapshot } from 'xstate';
|
|
2
|
-
import { B as BaseDb, v as versions,
|
|
2
|
+
import { B as BaseDb, v as versions, m as metadata, r as seeds, s as schemas, j as models, g as modelSchemas, Z as ZERO_BYTES32, I as INTERNAL_PROPERTY_NAMES, a as BaseFileManager, D as ImageSize, p as properties, x as INTERNAL_DATA_TYPES, i as modelUids, C as INTERNAL_STORAGE_MODEL_FILE_IDS, P as PROPERTY_NAMES_EXEMPT_FROM_ID_SUFFIX_STRIP } from './BasePathResolver-DRT09oVv.js';
|
|
3
3
|
import { or, isNull, eq, max, count, and, getTableColumns, sql, desc, inArray, isNotNull, gt } from 'drizzle-orm';
|
|
4
4
|
import pluralize from 'pluralize';
|
|
5
|
-
import { n as normalizeDataType, W as getOwnedAddressesFromDb, E as normalizeAddressList, u as normalizeHexAddress, z as getAddressesForItemsFilter, k as isDataType, s as normalizePublisher, M as ModelPropertyDataTypes,
|
|
5
|
+
import { n as normalizeDataType, W as getOwnedAddressesFromDb, E as normalizeAddressList, u as normalizeHexAddress, z as getAddressesForItemsFilter, k as isDataType, s as normalizePublisher, M as ModelPropertyDataTypes, r as resolveItemModelFileId, X as getPropertyIdForSchemaFileId, o as getPropertyIdForModelAndName, l as normalizePropertyRecordSchema, m as eventEmitter } from './db-Lw0KVZmc.js';
|
|
6
6
|
import debug from 'debug';
|
|
7
7
|
import { BehaviorSubject } from 'rxjs';
|
|
8
8
|
import { startCase, upperFirst, camelCase, orderBy } from 'lodash-es';
|
|
9
9
|
import { toSnakeCase } from 'drizzle-orm/casing';
|
|
10
10
|
import { isValidEasAttestationUid, isPlaceholderUid, BaseQueryClient, BaseEasClient, GET_SCHEMAS, getEasSchemaUidForSchemaDefinition, getSchemaUidForModelFromCache, cachedSchemaLookup, setSchemaUidForModel, getEasSchemaUidForExactDefinition } from '@seedprotocol/eas';
|
|
11
|
-
import { t as toSnakeCase$1, G as getStorageTransactionIdForSeedUid, H as convertTxIdToImage, f as ensureImageLocal, I as downloadTransactionIdWithDedupe, J as getDataTypeFromString, K as getMimeType, M as notifyFileSaved, g as getCorrectId, a as isStorageSeedRef } from './tabEvents-
|
|
11
|
+
import { t as toSnakeCase$1, G as getStorageTransactionIdForSeedUid, H as convertTxIdToImage, f as ensureImageLocal, I as downloadTransactionIdWithDedupe, J as getDataTypeFromString, K as getMimeType, M as notifyFileSaved, g as getCorrectId, a as isStorageSeedRef } from './tabEvents-C6NXS6Jl.js';
|
|
12
12
|
import { fetchArweaveRawTextAcrossGateways } from '@seedprotocol/arweave';
|
|
13
13
|
import { generateId } from './generateId-BopUwD8F.js';
|
|
14
14
|
import { modelPropertiesToObject } from './model-DGMe-TTm.js';
|
|
@@ -709,8 +709,8 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
709
709
|
const itemPropertyMod = await Promise.resolve().then(function () { return ItemProperty$1; });
|
|
710
710
|
const { ItemProperty } = itemPropertyMod;
|
|
711
711
|
const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
|
|
712
|
-
const _mod_0 = await import('./index-
|
|
713
|
-
const _ns_0 = _mod_0.
|
|
712
|
+
const _mod_0 = await import('./index-Y-yYyRBf.js');
|
|
713
|
+
const _ns_0 = _mod_0.f;
|
|
714
714
|
const { Model } = _ns_0;
|
|
715
715
|
// Resolve Model and build property schemas (use getByNameAsync for models not yet in cache)
|
|
716
716
|
let propertySchemas = {};
|
|
@@ -727,7 +727,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
727
727
|
const schemaNameToTry = schemaName ?? model?.schemaName;
|
|
728
728
|
if (schemaNameToTry) {
|
|
729
729
|
try {
|
|
730
|
-
const _mod_1 = await import('./Schema-
|
|
730
|
+
const _mod_1 = await import('./Schema-D-Ud-XYw.js');
|
|
731
731
|
const _ns_1 = _mod_1.b;
|
|
732
732
|
const { Schema } = _ns_1;
|
|
733
733
|
const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
|
|
@@ -743,7 +743,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
743
743
|
}
|
|
744
744
|
if (Object.keys(propertySchemas).length === 0) {
|
|
745
745
|
try {
|
|
746
|
-
const _mod_2 = await import('./ClientManager-
|
|
746
|
+
const _mod_2 = await import('./ClientManager-DngaZdw6.js');
|
|
747
747
|
const _ns_2 = _mod_2.G;
|
|
748
748
|
const { loadAllSchemasFromDb } = _ns_2;
|
|
749
749
|
const allSchemas = await loadAllSchemasFromDb();
|
|
@@ -764,10 +764,10 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
764
764
|
}
|
|
765
765
|
if (Object.keys(propertySchemas).length === 0) {
|
|
766
766
|
try {
|
|
767
|
-
const _mod_3 = await import('./ClientManager-
|
|
767
|
+
const _mod_3 = await import('./ClientManager-DngaZdw6.js');
|
|
768
768
|
const _ns_3 = _mod_3.G;
|
|
769
769
|
const { listCompleteSchemaFiles } = _ns_3;
|
|
770
|
-
const _mod_4 = await import('./BasePathResolver-
|
|
770
|
+
const _mod_4 = await import('./BasePathResolver-DRT09oVv.js');
|
|
771
771
|
const _ns_4 = _mod_4.O;
|
|
772
772
|
const { BaseFileManager } = _ns_4;
|
|
773
773
|
const schemaFiles = await listCompleteSchemaFiles();
|
|
@@ -788,7 +788,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
790
|
if (Object.keys(propertySchemas).length === 0) {
|
|
791
|
-
const schemaMod = await import('./index-
|
|
791
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
792
792
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
793
793
|
const KNOWN_MODEL_FALLBACKS = {
|
|
794
794
|
Post: {
|
|
@@ -805,7 +805,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
// Fallbacks above may return schema-file shape ({ type, model, items }); normalize to dataType/ref/refValueType.
|
|
808
|
-
const { normalizePropertyRecordSchema } = await import('./property-
|
|
808
|
+
const { normalizePropertyRecordSchema } = await import('./property-ByaiSyUK.js');
|
|
809
809
|
propertySchemas = Object.fromEntries(Object.entries(propertySchemas).map(([name, def]) => [name, normalizePropertyRecordSchema(def)]));
|
|
810
810
|
// Collapse rows that map to the same instance key (e.g. authorIdentityIds + authors -> authors).
|
|
811
811
|
// ItemProperty.create cache does not sync propertyValue on hit; processing order would otherwise
|
|
@@ -838,7 +838,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
838
838
|
// Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
|
|
839
839
|
let propSchema = propertySchemas[propertyName];
|
|
840
840
|
if (!propSchema && isRefTypeFromMeta) {
|
|
841
|
-
const schemaMod = await import('./index-
|
|
841
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
842
842
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
843
843
|
propSchema = {
|
|
844
844
|
dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
|
|
@@ -1105,9 +1105,9 @@ const runPublish = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1105
1105
|
sendBack({ type: 'publishError', error: new Error(`Item not found for seedLocalId: ${seedLocalId}`) });
|
|
1106
1106
|
return;
|
|
1107
1107
|
}
|
|
1108
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
1108
|
+
const getPublishUploadsMod = await import('./getPublishUploads-CqgMBD8f.js');
|
|
1109
1109
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
1110
|
-
const _mod_5 = await import('./getPublishPayload-
|
|
1110
|
+
const _mod_5 = await import('./getPublishPayload-76_KfB5Y.js');
|
|
1111
1111
|
const _ns_5 = _mod_5.g;
|
|
1112
1112
|
const getPublishPayloadMod = _ns_5;
|
|
1113
1113
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
@@ -1808,7 +1808,7 @@ const getItemsData = async ({ modelName, modelFileId, schemaName, deleted, inclu
|
|
|
1808
1808
|
conditions.push(eq(seeds.type, toSnakeCase(modelName)));
|
|
1809
1809
|
}
|
|
1810
1810
|
if (!modelFileId && schemaName && modelName) {
|
|
1811
|
-
const _mod_6 = await import('./db-
|
|
1811
|
+
const _mod_6 = await import('./db-Lw0KVZmc.js');
|
|
1812
1812
|
const _ns_6 = _mod_6.Y;
|
|
1813
1813
|
const { resolveModelRecord } = _ns_6;
|
|
1814
1814
|
modelFileId = (await resolveModelRecord(modelName, { schemaName }))?.schemaFileId ?? undefined;
|
|
@@ -2068,7 +2068,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2068
2068
|
const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
|
|
2069
2069
|
const _resolveRelatedValue = async () => {
|
|
2070
2070
|
// Use dynamic import to break circular dependency
|
|
2071
|
-
const schemaMod = await import('./index-
|
|
2071
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
2072
2072
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
2073
2073
|
if (!propertyValue || !isRelation || populatedFromDb) {
|
|
2074
2074
|
return;
|
|
@@ -2503,7 +2503,7 @@ async function readHtmlBodyFromChildStorageArweave(seedLocalId) {
|
|
|
2503
2503
|
/* offline / bad tx id */
|
|
2504
2504
|
}
|
|
2505
2505
|
try {
|
|
2506
|
-
const _mod_7 = await import('./tabEvents-
|
|
2506
|
+
const _mod_7 = await import('./tabEvents-C6NXS6Jl.js');
|
|
2507
2507
|
const _ns_7 = _mod_7.N;
|
|
2508
2508
|
const { downloadTransactionIdWithDedupe } = _ns_7;
|
|
2509
2509
|
await downloadTransactionIdWithDedupe(txId);
|
|
@@ -2564,7 +2564,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2564
2564
|
// to use dynamically imported ModelPropertyDataTypes
|
|
2565
2565
|
const _hydrateFromDb = async () => {
|
|
2566
2566
|
// Use dynamic import to break circular dependency
|
|
2567
|
-
const schemaMod = await import('./index-
|
|
2567
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
2568
2568
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
2569
2569
|
const appDb = BaseDb.getAppDb();
|
|
2570
2570
|
const whereClauses = [];
|
|
@@ -2843,11 +2843,11 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2843
2843
|
const modelNameForNew = context.modelName;
|
|
2844
2844
|
if (modelNameForNew) {
|
|
2845
2845
|
try {
|
|
2846
|
-
const _mod_8 = await import('./index-
|
|
2847
|
-
const _ns_8 = _mod_8.
|
|
2846
|
+
const _mod_8 = await import('./index-Y-yYyRBf.js');
|
|
2847
|
+
const _ns_8 = _mod_8.f;
|
|
2848
2848
|
const { Model } = _ns_8;
|
|
2849
2849
|
const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
|
|
2850
|
-
const _mod_9 = await import('./db-
|
|
2850
|
+
const _mod_9 = await import('./db-Lw0KVZmc.js');
|
|
2851
2851
|
const _ns_9 = _mod_9.Y;
|
|
2852
2852
|
const { resolveItemModelFileId } = _ns_9;
|
|
2853
2853
|
const normalizedModelName = upperFirst(camelCase(modelNameForNew));
|
|
@@ -2901,7 +2901,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2901
2901
|
// It ends up in the context below, and later lookups by name (Model.getByName) can't match it.
|
|
2902
2902
|
const modelName = context.modelName || (metadataRecord.modelType ? upperFirst(camelCase(metadataRecord.modelType)) : undefined);
|
|
2903
2903
|
// Model names are only unique per schema: pin lookups to the item's own model row.
|
|
2904
|
-
const _mod_10 = await import('./db-
|
|
2904
|
+
const _mod_10 = await import('./db-Lw0KVZmc.js');
|
|
2905
2905
|
const _ns_10 = _mod_10.Y;
|
|
2906
2906
|
const { resolveItemModelFileId, resolveModelRecord } = _ns_10;
|
|
2907
2907
|
const modelFileId = await resolveItemModelFileId({
|
|
@@ -2947,16 +2947,16 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2947
2947
|
};
|
|
2948
2948
|
// Merge with schema from file/DB to get validation rules (enum, pattern, etc.) - properties table doesn't store these
|
|
2949
2949
|
try {
|
|
2950
|
-
const { getPropertySchema } = await import('./property-
|
|
2950
|
+
const { getPropertySchema } = await import('./property-ByaiSyUK.js');
|
|
2951
2951
|
let schemaFromFile = await getPropertySchema(normalizedModelName, propertyName, {
|
|
2952
2952
|
modelFileId: modelRecord?.schemaFileId ?? modelFileId,
|
|
2953
2953
|
});
|
|
2954
2954
|
if (!schemaFromFile?.validation) {
|
|
2955
2955
|
// Fallback: get validation from schemaData in database (Schema context may not be loaded yet)
|
|
2956
|
-
const _mod_11 = await import('./BasePathResolver-
|
|
2956
|
+
const _mod_11 = await import('./BasePathResolver-DRT09oVv.js');
|
|
2957
2957
|
const _ns_11 = _mod_11.Q;
|
|
2958
2958
|
const { schemas: schemasTable } = _ns_11;
|
|
2959
|
-
const _mod_12 = await import('./BasePathResolver-
|
|
2959
|
+
const _mod_12 = await import('./BasePathResolver-DRT09oVv.js');
|
|
2960
2960
|
const _ns_12 = _mod_12.R;
|
|
2961
2961
|
const { modelSchemas } = _ns_12;
|
|
2962
2962
|
const modelSchemaRows = await db
|
|
@@ -2997,8 +2997,8 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2997
2997
|
}
|
|
2998
2998
|
if (!propertyRecordSchema && modelName) {
|
|
2999
2999
|
try {
|
|
3000
|
-
const _mod_13 = await import('./index-
|
|
3001
|
-
const _ns_13 = _mod_13.
|
|
3000
|
+
const _mod_13 = await import('./index-Y-yYyRBf.js');
|
|
3001
|
+
const _ns_13 = _mod_13.f;
|
|
3002
3002
|
const { Model } = _ns_13;
|
|
3003
3003
|
const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
|
|
3004
3004
|
const normalizedModelName = upperFirst(camelCase(modelName));
|
|
@@ -3374,9 +3374,9 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
3374
3374
|
}
|
|
3375
3375
|
const _analyzeInput = async () => {
|
|
3376
3376
|
// Use dynamic import to break circular dependency
|
|
3377
|
-
const schemaMod = await import('./index-
|
|
3377
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
3378
3378
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
3379
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
3379
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-IoS7JquP.js');
|
|
3380
3380
|
let propertyName = propertyNameRaw;
|
|
3381
3381
|
if (!propertyName) {
|
|
3382
3382
|
throw new Error('propertyName is required');
|
|
@@ -3666,7 +3666,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
|
|
|
3666
3666
|
propertyRecordSchema?.validation &&
|
|
3667
3667
|
metadataValues.propertyValue != null &&
|
|
3668
3668
|
metadataValues.propertyValue !== '') {
|
|
3669
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
3669
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-IoS7JquP.js');
|
|
3670
3670
|
const validationService = new SchemaValidationService();
|
|
3671
3671
|
const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, normalizeDataType(propertyRecordSchema.dataType), propertyRecordSchema.validation, propertyRecordSchema.refValueType
|
|
3672
3672
|
? normalizeDataType(String(propertyRecordSchema.refValueType))
|
|
@@ -4248,7 +4248,7 @@ const saveRelation = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
const _saveRelation = async () => {
|
|
4250
4250
|
// Use dynamic import to break circular dependency
|
|
4251
|
-
const schemaMod = await import('./index-
|
|
4251
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
4252
4252
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
4253
4253
|
if (!propertyNameRaw) {
|
|
4254
4254
|
throw new Error('propertyName is required');
|
|
@@ -4812,10 +4812,10 @@ const getPropertyData = async ({ propertyName, seedLocalId, seedUid, modelName,
|
|
|
4812
4812
|
let names = [...getMetadataPropertyNamesForQuery(propertyName)];
|
|
4813
4813
|
if (modelName) {
|
|
4814
4814
|
try {
|
|
4815
|
-
const _mod_14 = await import('./index-
|
|
4816
|
-
const _ns_14 = _mod_14.
|
|
4815
|
+
const _mod_14 = await import('./index-Y-yYyRBf.js');
|
|
4816
|
+
const _ns_14 = _mod_14.f;
|
|
4817
4817
|
const { Model } = _ns_14;
|
|
4818
|
-
const _mod_15 = await import('./db-
|
|
4818
|
+
const _mod_15 = await import('./db-Lw0KVZmc.js');
|
|
4819
4819
|
const _ns_15 = _mod_15.Y;
|
|
4820
4820
|
const { resolveItemModelFileId } = _ns_15;
|
|
4821
4821
|
// Model names are only unique per schema: use the seed's own model when it is recorded.
|
|
@@ -5006,7 +5006,7 @@ const HTML_PROP_SEED_UID_RE = /^0x[a-fA-F0-9]{64}$/;
|
|
|
5006
5006
|
*/
|
|
5007
5007
|
const resolvePropertyRecordSchemaFromSchemaData = async (modelName, propertyName, modelType, schemaName) => {
|
|
5008
5008
|
try {
|
|
5009
|
-
const _mod_16 = await import('./ClientManager-
|
|
5009
|
+
const _mod_16 = await import('./ClientManager-DngaZdw6.js');
|
|
5010
5010
|
const _ns_16 = _mod_16.G;
|
|
5011
5011
|
const { loadAllSchemasFromDb } = _ns_16;
|
|
5012
5012
|
const allSchemas = await loadAllSchemasFromDb();
|
|
@@ -5060,11 +5060,11 @@ hints = {}) => {
|
|
|
5060
5060
|
return undefined;
|
|
5061
5061
|
}
|
|
5062
5062
|
try {
|
|
5063
|
-
const _mod_17 = await import('./index-
|
|
5064
|
-
const _ns_17 = _mod_17.
|
|
5063
|
+
const _mod_17 = await import('./index-Y-yYyRBf.js');
|
|
5064
|
+
const _ns_17 = _mod_17.f;
|
|
5065
5065
|
const { Model } = _ns_17;
|
|
5066
5066
|
const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
|
|
5067
|
-
const _mod_18 = await import('./db-
|
|
5067
|
+
const _mod_18 = await import('./db-Lw0KVZmc.js');
|
|
5068
5068
|
const _ns_18 = _mod_18.Y;
|
|
5069
5069
|
const { resolveItemModelFileId } = _ns_18;
|
|
5070
5070
|
const modelFileId = await resolveItemModelFileId(hints);
|
|
@@ -5224,7 +5224,7 @@ class ItemProperty {
|
|
|
5224
5224
|
return;
|
|
5225
5225
|
}
|
|
5226
5226
|
// Use dynamic import to break circular dependency
|
|
5227
|
-
const schemaMod = await import('./index-
|
|
5227
|
+
const schemaMod = await import('./index-BpgD305l.js');
|
|
5228
5228
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5229
5229
|
const { context } = snapshot;
|
|
5230
5230
|
const { propertyRecordSchema } = context;
|
|
@@ -5395,7 +5395,7 @@ class ItemProperty {
|
|
|
5395
5395
|
const normalizedRefValueType = normalizeDataType(propertyRecordSchema?.refValueType);
|
|
5396
5396
|
const propertyNames = getMetadataPropertyNamesForQuery(propertyName, normalizedDataType, normalizedRefValueType);
|
|
5397
5397
|
const propertyNameVariant = propertyNames.length > 1 ? propertyNames[1] : undefined;
|
|
5398
|
-
const _mod_19 = await import('./index-
|
|
5398
|
+
const _mod_19 = await import('./index-5b3JsS55.js');
|
|
5399
5399
|
const _ns_19 = _mod_19.s;
|
|
5400
5400
|
const seedSchemaMod = _ns_19;
|
|
5401
5401
|
const { metadata } = seedSchemaMod;
|
|
@@ -5611,7 +5611,7 @@ class ItemProperty {
|
|
|
5611
5611
|
const ctx = this._service.getSnapshot().context;
|
|
5612
5612
|
let modelFileId;
|
|
5613
5613
|
try {
|
|
5614
|
-
const _mod_20 = await import('./db-
|
|
5614
|
+
const _mod_20 = await import('./db-Lw0KVZmc.js');
|
|
5615
5615
|
const _ns_20 = _mod_20.Y;
|
|
5616
5616
|
const { resolveItemModelFileId } = _ns_20;
|
|
5617
5617
|
modelFileId = await resolveItemModelFileId({
|
|
@@ -5889,6 +5889,29 @@ class ItemProperty {
|
|
|
5889
5889
|
return result;
|
|
5890
5890
|
return waitForEntityIdle(result, { timeout: readyTimeout }).then(() => result);
|
|
5891
5891
|
}
|
|
5892
|
+
/**
|
|
5893
|
+
* The cached ItemProperty when it can be read right now (idle, not saving), the state
|
|
5894
|
+
* `ItemProperty.find()` waits for. Otherwise undefined. Unlike `find`, it takes no cache hold, so
|
|
5895
|
+
* React hooks can call it during render.
|
|
5896
|
+
*/
|
|
5897
|
+
static peekReady({ propertyName, seedLocalId, seedUid, }) {
|
|
5898
|
+
if (!propertyName)
|
|
5899
|
+
return undefined;
|
|
5900
|
+
// Same key order as find(), then the other id: instances are cached under both when both are known.
|
|
5901
|
+
const keys = [seedUid, seedLocalId]
|
|
5902
|
+
.filter((id) => typeof id === 'string' && id.length > 0)
|
|
5903
|
+
.map((id) => this.cacheKey(id, propertyName));
|
|
5904
|
+
for (const key of keys) {
|
|
5905
|
+
const instance = this.instanceCache.get(key)?.instance;
|
|
5906
|
+
if (!instance)
|
|
5907
|
+
continue;
|
|
5908
|
+
const snap = instance.getService().getSnapshot();
|
|
5909
|
+
if (snap.status !== 'active' || snap.value !== 'idle' || snap.context?.isSaving)
|
|
5910
|
+
return undefined;
|
|
5911
|
+
return instance;
|
|
5912
|
+
}
|
|
5913
|
+
return undefined;
|
|
5914
|
+
}
|
|
5892
5915
|
static async find({ propertyName, seedLocalId, seedUid, modelName: modelNameOption, waitForReady = true, readyTimeout = 5000, }) {
|
|
5893
5916
|
if ((!seedLocalId && !seedUid) || !propertyName) {
|
|
5894
5917
|
return undefined;
|
|
@@ -5951,7 +5974,7 @@ class ItemProperty {
|
|
|
5951
5974
|
const propertiesData = await getItemProperties({ seedLocalId, seedUid });
|
|
5952
5975
|
const instances = [];
|
|
5953
5976
|
const seenNormalized = new Set();
|
|
5954
|
-
const _mod_21 = await import('./db-
|
|
5977
|
+
const _mod_21 = await import('./db-Lw0KVZmc.js');
|
|
5955
5978
|
const _ns_21 = _mod_21.Y;
|
|
5956
5979
|
const { resolveItemModelFileId } = _ns_21;
|
|
5957
5980
|
const itemModelFileId = await resolveItemModelFileId({ seedLocalId, seedUid });
|
|
@@ -5969,8 +5992,8 @@ class ItemProperty {
|
|
|
5969
5992
|
}
|
|
5970
5993
|
else if (baseName) {
|
|
5971
5994
|
try {
|
|
5972
|
-
const _mod_22 = await import('./index-
|
|
5973
|
-
const _ns_22 = _mod_22.
|
|
5995
|
+
const _mod_22 = await import('./index-Y-yYyRBf.js');
|
|
5996
|
+
const _ns_22 = _mod_22.f;
|
|
5974
5997
|
const { Model } = _ns_22;
|
|
5975
5998
|
const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
|
|
5976
5999
|
const model = await Model.resolveAsync(modelName, { modelFileId });
|
|
@@ -5986,8 +6009,8 @@ class ItemProperty {
|
|
|
5986
6009
|
}
|
|
5987
6010
|
if (modelName && propertyName) {
|
|
5988
6011
|
try {
|
|
5989
|
-
const _mod_23 = await import('./index-
|
|
5990
|
-
const _ns_23 = _mod_23.
|
|
6012
|
+
const _mod_23 = await import('./index-Y-yYyRBf.js');
|
|
6013
|
+
const _ns_23 = _mod_23.f;
|
|
5991
6014
|
const { Model } = _ns_23;
|
|
5992
6015
|
const { modelPropertiesToObject } = await import('./model-DGMe-TTm.js');
|
|
5993
6016
|
const model = await Model.resolveAsync(modelName, { modelFileId });
|
|
@@ -6308,7 +6331,7 @@ class ItemProperty {
|
|
|
6308
6331
|
if (!propertyName || (!seedLocalId && !seedUid))
|
|
6309
6332
|
return;
|
|
6310
6333
|
if (db) {
|
|
6311
|
-
const _mod_24 = await import('./index-
|
|
6334
|
+
const _mod_24 = await import('./index-5b3JsS55.js');
|
|
6312
6335
|
const _ns_24 = _mod_24.s;
|
|
6313
6336
|
const seedSchemaMod = _ns_24;
|
|
6314
6337
|
const { metadata } = seedSchemaMod;
|
|
@@ -6354,8 +6377,8 @@ const createNewItem = async ({ modelName, modelFileId, ...propertyData }) => {
|
|
|
6354
6377
|
}
|
|
6355
6378
|
const seedType = toSnakeCase(modelName);
|
|
6356
6379
|
// Dynamic import to break circular dependency
|
|
6357
|
-
const _mod_25 = await import('./index-
|
|
6358
|
-
const _ns_25 = _mod_25.
|
|
6380
|
+
const _mod_25 = await import('./index-Y-yYyRBf.js');
|
|
6381
|
+
const _ns_25 = _mod_25.f;
|
|
6359
6382
|
const modelMod = _ns_25;
|
|
6360
6383
|
const { Model } = modelMod;
|
|
6361
6384
|
const model = await Model.resolveAsync(modelName, { modelFileId });
|
|
@@ -6512,8 +6535,8 @@ const getModel = () => {
|
|
|
6512
6535
|
// the fragile `import(...).then(n => n.X)` chunk-namespace pattern.
|
|
6513
6536
|
if (!modelImportPromise) {
|
|
6514
6537
|
modelImportPromise = (async () => {
|
|
6515
|
-
const _mod_26 = await import('./index-
|
|
6516
|
-
const _ns_26 = _mod_26.
|
|
6538
|
+
const _mod_26 = await import('./index-Y-yYyRBf.js');
|
|
6539
|
+
const _ns_26 = _mod_26.f;
|
|
6517
6540
|
const mod = _ns_26;
|
|
6518
6541
|
ModelClass = mod.Model;
|
|
6519
6542
|
return mod;
|
|
@@ -6616,7 +6639,7 @@ class Item {
|
|
|
6616
6639
|
const revokedAt = Math.floor(Date.now() / 1000);
|
|
6617
6640
|
// The executor stamps the revoked version rows; the latest version is now the newest one left
|
|
6618
6641
|
// (a local draft) or none, never a revoked one.
|
|
6619
|
-
const { getLatestVersionRow } = await import('./getLatestVersionRow-
|
|
6642
|
+
const { getLatestVersionRow } = await import('./getLatestVersionRow-72Atl9vB.js');
|
|
6620
6643
|
const head = await getLatestVersionRow(this.seedLocalId);
|
|
6621
6644
|
this._service.send({
|
|
6622
6645
|
type: 'updateContext',
|
|
@@ -6662,12 +6685,12 @@ class Item {
|
|
|
6662
6685
|
};
|
|
6663
6686
|
this.getPublishUploads = async (options) => {
|
|
6664
6687
|
// Use dynamic import to break circular dependency
|
|
6665
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
6688
|
+
const getPublishUploadsMod = await import('./getPublishUploads-CqgMBD8f.js');
|
|
6666
6689
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
6667
6690
|
return await getPublishUploads(this, [], undefined, options);
|
|
6668
6691
|
};
|
|
6669
6692
|
this.getPublishPayload = async (uploadedTransactions, options) => {
|
|
6670
|
-
const _mod_27 = await import('./getPublishPayload-
|
|
6693
|
+
const _mod_27 = await import('./getPublishPayload-76_KfB5Y.js');
|
|
6671
6694
|
const _ns_27 = _mod_27.g;
|
|
6672
6695
|
const getPublishPayloadMod = _ns_27;
|
|
6673
6696
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
@@ -6686,7 +6709,7 @@ class Item {
|
|
|
6686
6709
|
});
|
|
6687
6710
|
// Publish has recorded the version it attested (updateVersionUid): reflect it here too, as
|
|
6688
6711
|
// the versions liveQuery does in the browser. After a republish this is the new version.
|
|
6689
|
-
const { getLatestVersionRow } = await import('./getLatestVersionRow-
|
|
6712
|
+
const { getLatestVersionRow } = await import('./getLatestVersionRow-72Atl9vB.js');
|
|
6690
6713
|
const head = await getLatestVersionRow(seedLocalId);
|
|
6691
6714
|
if (head?.localId) {
|
|
6692
6715
|
this._service.send({
|
|
@@ -6942,6 +6965,38 @@ class Item {
|
|
|
6942
6965
|
}
|
|
6943
6966
|
}
|
|
6944
6967
|
}
|
|
6968
|
+
/**
|
|
6969
|
+
* Idle, and not the shell the item machine can be in when it reaches `idle` before
|
|
6970
|
+
* `propertyInstances` is merged (an item with a version but no property instances yet).
|
|
6971
|
+
*/
|
|
6972
|
+
static isItemSnapshotReadyForRead(snap) {
|
|
6973
|
+
if (!snap || !('value' in snap) || snap.value !== 'idle') {
|
|
6974
|
+
return false;
|
|
6975
|
+
}
|
|
6976
|
+
const ctx = snap.context || {};
|
|
6977
|
+
const versionsCount = ctx.versionsCount ?? 0;
|
|
6978
|
+
const hasHeadVersion = !!ctx.latestVersionLocalId;
|
|
6979
|
+
if (versionsCount === 0 && !hasHeadVersion) {
|
|
6980
|
+
return true;
|
|
6981
|
+
}
|
|
6982
|
+
return (ctx.propertyInstances?.size ?? 0) > 0;
|
|
6983
|
+
}
|
|
6984
|
+
/**
|
|
6985
|
+
* The cached Item for a seedLocalId or seedUid when it can be read right now: idle and hydrated,
|
|
6986
|
+
* so at least what `Item.find()` would wait for. Otherwise undefined. Unlike `getById`, it takes
|
|
6987
|
+
* no cache hold, so React hooks can call it during render.
|
|
6988
|
+
*/
|
|
6989
|
+
static peekReady(id) {
|
|
6990
|
+
if (!id)
|
|
6991
|
+
return undefined;
|
|
6992
|
+
const instance = this.findItemInstanceCacheEntryById(id)?.instance;
|
|
6993
|
+
if (!instance)
|
|
6994
|
+
return undefined;
|
|
6995
|
+
const snap = instance.getService().getSnapshot();
|
|
6996
|
+
if (snap.status !== 'active')
|
|
6997
|
+
return undefined;
|
|
6998
|
+
return this.isItemSnapshotReadyForRead(snap) ? instance : undefined;
|
|
6999
|
+
}
|
|
6945
7000
|
/**
|
|
6946
7001
|
* Item machine can reach `idle` before `propertyInstances` is merged (race) or while
|
|
6947
7002
|
* child ItemProperty actors are still hydrating. useItems / Item.all must not return that shell.
|
|
@@ -6954,16 +7009,7 @@ class Item {
|
|
|
6954
7009
|
if ('value' in snap && snap.value === 'error') {
|
|
6955
7010
|
throw new Error('Entity failed to load');
|
|
6956
7011
|
}
|
|
6957
|
-
|
|
6958
|
-
return false;
|
|
6959
|
-
}
|
|
6960
|
-
const ctx = snap.context || {};
|
|
6961
|
-
const versionsCount = ctx.versionsCount ?? 0;
|
|
6962
|
-
const hasHeadVersion = !!ctx.latestVersionLocalId;
|
|
6963
|
-
if (versionsCount === 0 && !hasHeadVersion) {
|
|
6964
|
-
return true;
|
|
6965
|
-
}
|
|
6966
|
-
return (ctx.propertyInstances?.size ?? 0) > 0;
|
|
7012
|
+
return Item.isItemSnapshotReadyForRead(snap);
|
|
6967
7013
|
}, { timeout: readyTimeout });
|
|
6968
7014
|
}
|
|
6969
7015
|
catch (e) {
|
|
@@ -7180,7 +7226,7 @@ class Item {
|
|
|
7180
7226
|
const db = BaseDb.getAppDb();
|
|
7181
7227
|
if (db && props.modelName) {
|
|
7182
7228
|
// Model names are only unique per schema: resolve the exact models row from the most specific scope.
|
|
7183
|
-
const _mod_28 = await import('./db-
|
|
7229
|
+
const _mod_28 = await import('./db-Lw0KVZmc.js');
|
|
7184
7230
|
const _ns_28 = _mod_28.Y;
|
|
7185
7231
|
const { resolveModelRecord } = _ns_28;
|
|
7186
7232
|
const modelRecord = await resolveModelRecord(props.modelName, {
|
|
@@ -7194,10 +7240,10 @@ class Item {
|
|
|
7194
7240
|
// Scope the constructor's Model lookup to this model's schema (as getItemData does on reload),
|
|
7195
7241
|
// so a same-named model cached from another schema can't supply the property set.
|
|
7196
7242
|
if (modelRecord && !props.schemaName) {
|
|
7197
|
-
const _mod_29 = await import('./BasePathResolver-
|
|
7243
|
+
const _mod_29 = await import('./BasePathResolver-DRT09oVv.js');
|
|
7198
7244
|
const _ns_29 = _mod_29.R;
|
|
7199
7245
|
const { modelSchemas } = _ns_29;
|
|
7200
|
-
const _mod_30 = await import('./BasePathResolver-
|
|
7246
|
+
const _mod_30 = await import('./BasePathResolver-DRT09oVv.js');
|
|
7201
7247
|
const _ns_30 = _mod_30.Q;
|
|
7202
7248
|
const { schemas: schemasTable } = _ns_30;
|
|
7203
7249
|
const schemaRows = await db
|
|
@@ -7543,7 +7589,7 @@ class Item {
|
|
|
7543
7589
|
if (!appDb || Item.instanceCache.size === 0) {
|
|
7544
7590
|
return;
|
|
7545
7591
|
}
|
|
7546
|
-
const _mod_31 = await import('./index-
|
|
7592
|
+
const _mod_31 = await import('./index-5b3JsS55.js');
|
|
7547
7593
|
const _ns_31 = _mod_31.s;
|
|
7548
7594
|
const { metadata } = _ns_31;
|
|
7549
7595
|
const { eq, and } = await import('drizzle-orm');
|
|
@@ -8002,7 +8048,7 @@ class Item {
|
|
|
8002
8048
|
itemActor.send(event);
|
|
8003
8049
|
};
|
|
8004
8050
|
try {
|
|
8005
|
-
const _mod_32 = await import('./index-
|
|
8051
|
+
const _mod_32 = await import('./index-5b3JsS55.js');
|
|
8006
8052
|
const _ns_32 = _mod_32.s;
|
|
8007
8053
|
const seedSchemaMod = _ns_32;
|
|
8008
8054
|
const { seeds, versions, metadata } = seedSchemaMod;
|
|
@@ -8355,5 +8401,5 @@ var Item$1 = /*#__PURE__*/Object.freeze({
|
|
|
8355
8401
|
Item: Item
|
|
8356
8402
|
});
|
|
8357
8403
|
|
|
8358
|
-
export { getMetadataLatest as A, getRevokeExecutor as B, ClientManagerState as C, getUploadExecutor as D, getVersionData$1 as E, isItemOwned as F, isLocalUnsealedDraft as G, isSeedRowOwned as H, Item as I, ownedPublisherSql as J, pickLatestMetadataRowPerProperty as K, propertyMachine as L, METADATA_LATEST_FIRST_ORDER_SQL as M, publisherInAddressListSql as N, publisherIsInOwnedSet as O, setAdditionalSyncAddresses as P, setGetPublisherForNewSeeds as Q, setRevokeExecutor as R, setUploadExecutor as S, getInvariantSafePropertyDescriptor as T, clearDestroySubscriptions as U, unloadEntity as V, ClientManagerEvents as W, resolvePublisherFromSeedRow as X, getPropertyData$1 as Y, Item$1 as Z,
|
|
8359
|
-
//# sourceMappingURL=Item-
|
|
8404
|
+
export { getMetadataLatest as A, getRevokeExecutor as B, ClientManagerState as C, getUploadExecutor as D, getVersionData$1 as E, isItemOwned as F, isLocalUnsealedDraft as G, isSeedRowOwned as H, Item as I, ownedPublisherSql as J, pickLatestMetadataRowPerProperty as K, propertyMachine as L, METADATA_LATEST_FIRST_ORDER_SQL as M, publisherInAddressListSql as N, publisherIsInOwnedSet as O, setAdditionalSyncAddresses as P, setGetPublisherForNewSeeds as Q, setRevokeExecutor as R, setUploadExecutor as S, getInvariantSafePropertyDescriptor as T, clearDestroySubscriptions as U, unloadEntity as V, ClientManagerEvents as W, resolvePublisherFromSeedRow as X, getPropertyData$1 as Y, Item$1 as Z, getEasSchemaUidForModel as a, getLatestPublishedVersionRow as b, chunkValues as c, rowsPerInsert as d, getGetAdditionalSyncAddresses as e, ItemProperty as f, getItemData as g, ItemPropertySaveValidationError as h, isVersionRevoked as i, waitForEntityIdle as j, createReactiveProxy as k, listRelationEasPropertyName as l, findEntity as m, forceRemoveFromCaches as n, runDestroyLifecycle as o, parseListPropertyValueFromStorage as p, compareMetadataRowsLatestFirst as q, resolveStorageNameToSchemaName as r, selectInBatches as s, isPublishedMetadataRow as t, MachineIds as u, versionNotRevoked as v, writeInBatches as w, createNewItem as x, getEasSchemaForItemProperty as y, getGetPublisherForNewSeeds as z };
|
|
8405
|
+
//# sourceMappingURL=Item-ZUAmf943.js.map
|