@seedprotocol/sdk 0.7.4 → 0.7.5-next.850.g9ab585b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -0
- package/dist/{BasePathResolver-DrzGVH9L.js → BasePathResolver-CsZHPrk9.js} +141 -7
- package/dist/BasePathResolver-CsZHPrk9.js.map +1 -0
- package/dist/{ClientManager-Dfu4jcgm.js → ClientManager-DETTj0_z.js} +43 -33
- package/dist/ClientManager-DETTj0_z.js.map +1 -0
- package/dist/{Item-BUUFuywT.js → Item-TMrVEPeX.js} +63 -63
- package/dist/{Item-BUUFuywT.js.map → Item-TMrVEPeX.js.map} +1 -1
- package/dist/{ModelProperty-B6cnRvIz.js → ModelProperty-Bw6N8OMK.js} +36 -36
- package/dist/{ModelProperty-B6cnRvIz.js.map → ModelProperty-Bw6N8OMK.js.map} +1 -1
- package/dist/{Schema-Bf-jOLq0.js → Schema-VLenyJDy.js} +56 -36
- package/dist/Schema-VLenyJDy.js.map +1 -0
- package/dist/{SchemaValidationService-BNYMacsx.js → SchemaValidationService-CLGadxgf.js} +6 -6
- package/dist/{SchemaValidationService-BNYMacsx.js.map → SchemaValidationService-CLGadxgf.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-C2-s_jUa.js → backfillMetadataPropertyIds-C8fSvzy2.js} +3 -3
- package/dist/{backfillMetadataPropertyIds-C2-s_jUa.js.map → backfillMetadataPropertyIds-C8fSvzy2.js.map} +1 -1
- package/dist/{configurePlatform-BzfirKuM.js → configurePlatform-C3E0BS3u.js} +2 -2
- package/dist/{configurePlatform-BzfirKuM.js.map → configurePlatform-C3E0BS3u.js.map} +1 -1
- package/dist/{detachRowsBeforeDelete-B0Daoz9Z.js → detachRowsBeforeDelete-D1gTseFW.js} +2 -2
- package/dist/{detachRowsBeforeDelete-B0Daoz9Z.js.map → detachRowsBeforeDelete-D1gTseFW.js.map} +1 -1
- package/dist/{eas-Dq5Kx_Nd.js → eas-A82zVNQ9.js} +25 -12
- package/dist/eas-A82zVNQ9.js.map +1 -0
- package/dist/{errors-DdWbxb_n.js → errors-CWKup8tw.js} +40 -37
- package/dist/errors-CWKup8tw.js.map +1 -0
- package/dist/{getItem-9bYSErSj.js → getItem-ChieGxJV.js} +4 -4
- package/dist/{getItem-9bYSErSj.js.map → getItem-ChieGxJV.js.map} +1 -1
- package/dist/{getPublishPayload-DPy-uMrR.js → getPublishPayload-CWfjl8PM.js} +25 -15
- package/dist/getPublishPayload-CWfjl8PM.js.map +1 -0
- package/dist/{getPublishUploads-J-143iSV.js → getPublishUploads-cLbSEXLk.js} +8 -8
- package/dist/{getPublishUploads-J-143iSV.js.map → getPublishUploads-cLbSEXLk.js.map} +1 -1
- package/dist/{index-7y2f_iQz.js → index-CURf9L4d.js} +2 -2
- package/dist/index-CURf9L4d.js.map +1 -0
- package/dist/{index-C61Rxy0F.js → index-CXkcz4hT.js} +8 -8
- package/dist/index-CXkcz4hT.js.map +1 -0
- package/dist/{index.browser-C1pisOEa.js → index.browser-47W0fJPw.js} +10 -10
- package/dist/{index.browser-C1pisOEa.js.map → index.browser-47W0fJPw.js.map} +1 -1
- package/dist/{index.node-BAlST8pD.js → index.node-BiQhZQvH.js} +6 -6
- package/dist/{index.node-BAlST8pD.js.map → index.node-BiQhZQvH.js.map} +1 -1
- package/dist/main.js +25 -23
- package/dist/main.js.map +1 -1
- package/dist/node.js +10 -10
- package/dist/platform.browser.js +5 -5
- package/dist/platform.node.js +4 -4
- package/dist/{property-zFPMtR3T.js → property-tgPI5hMu.js} +7 -7
- package/dist/{property-zFPMtR3T.js.map → property-tgPI5hMu.js.map} +1 -1
- package/dist/{propertyValidationRules-CeFVhdQg.js → propertyValidationRules-BLVxTejW.js} +10 -10
- package/dist/{propertyValidationRules-CeFVhdQg.js.map → propertyValidationRules-BLVxTejW.js.map} +1 -1
- package/dist/{publishDraftGraph-CuVq6iAR.js → publishDraftGraph-FAfecR_4.js} +6 -6
- package/dist/{publishDraftGraph-CuVq6iAR.js.map → publishDraftGraph-FAfecR_4.js.map} +1 -1
- package/dist/{resetAmbiguousLegacyItemData-DsFTnMBz.js → resetAmbiguousLegacyItemData-kz2PYdZi.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-DsFTnMBz.js.map → resetAmbiguousLegacyItemData-kz2PYdZi.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-RUsgAZXG.js → resolveModelForSyncedSeed-Dm1E4ebt.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-RUsgAZXG.js.map → resolveModelForSyncedSeed-Dm1E4ebt.js.map} +1 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts +2 -1
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/Schema/Schema.d.ts.map +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +3 -0
- package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
- package/dist/src/db/canonicalizeModelTypes.d.ts +2 -2
- package/dist/src/db/canonicalizeModelTypes.d.ts.map +1 -1
- package/dist/src/db/read/getModelSchemas.d.ts +3 -2
- package/dist/src/db/read/getModelSchemas.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/nameMatchLevels.d.ts +64 -0
- package/dist/src/db/read/nameMatchLevels.d.ts.map +1 -0
- package/dist/src/db/read/resolveModelRecord.d.ts.map +1 -1
- package/dist/src/db/read/summarizePublishWork.d.ts +2 -0
- package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
- package/dist/src/eas.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/easValueTypes.d.ts +16 -0
- package/dist/src/helpers/easValueTypes.d.ts.map +1 -0
- package/dist/src/imports/index.d.ts +1 -1
- package/dist/src/imports/index.d.ts.map +1 -1
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/import.d.ts +20 -0
- package/dist/src/types/import.d.ts.map +1 -1
- package/dist/{syncDbWithEas-CRpnkq00.js → syncDbWithEas-CMCAihFh.js} +92 -22
- package/dist/syncDbWithEas-CMCAihFh.js.map +1 -0
- package/dist/{tabEvents-nBUq_1u1.js → tabEvents-BEAmMncP.js} +4 -4
- package/dist/{tabEvents-nBUq_1u1.js.map → tabEvents-BEAmMncP.js.map} +1 -1
- package/dist/{tolerantWebAccess-DIt3R8_u.js → tolerantWebAccess-CqiDGEyR.js} +6 -6
- package/dist/{tolerantWebAccess-DIt3R8_u.js.map → tolerantWebAccess-CqiDGEyR.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-DtTPSzpM.js → updateSeedRevokedAt-Bw3uEStt.js} +3 -3
- package/dist/{updateSeedRevokedAt-DtTPSzpM.js.map → updateSeedRevokedAt-Bw3uEStt.js.map} +1 -1
- package/package.json +9 -5
- package/dist/BasePathResolver-DrzGVH9L.js.map +0 -1
- package/dist/ClientManager-Dfu4jcgm.js.map +0 -1
- package/dist/Schema-Bf-jOLq0.js.map +0 -1
- package/dist/eas-Dq5Kx_Nd.js.map +0 -1
- package/dist/errors-DdWbxb_n.js.map +0 -1
- package/dist/getPublishPayload-DPy-uMrR.js.map +0 -1
- package/dist/index-7y2f_iQz.js.map +0 -1
- package/dist/index-C61Rxy0F.js.map +0 -1
- package/dist/syncDbWithEas-CRpnkq00.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { waitFor, fromCallback, setup, assign, stateIn, createActor, isMachineSnapshot } from 'xstate';
|
|
2
|
-
import { E as BaseDb, C as versions, m as metadata, A as seeds, F as resolveStorageNameToSchemaName,
|
|
2
|
+
import { E as BaseDb, C as versions, m as metadata, A as seeds, F as resolveStorageNameToSchemaName, a_ as toSchemaPropertyName, z as schemas, s as models, q as modelSchemas, aY as getOwnedAddressesFromDb, a3 as ZERO_BYTES32, aG as normalizeAddressList, ak as normalizeHexAddress, aD as getAddressesForItemsFilter, a7 as INTERNAL_PROPERTY_NAMES, K as BaseFileManager, a$ as getStorageTransactionIdForSeedUid, b0 as convertTxIdToImage, i as isDataType, af as normalizePublisher, n as normalizeDataType, b1 as getMetadataPropertyNamesForQuery, aC as ensureImageLocal, au as ImageSize, b2 as downloadTransactionIdWithDedupe, b3 as resolveMetadataRecord, u as properties, M as ModelPropertyDataTypes, aj as generateId, aa as INTERNAL_DATA_TYPES, r as modelUids, ab as listRelationEasPropertyName, ac as easPropertyNameForPublish, N as resolveItemModelFileId, b4 as getPropertyIdForSchemaFileId, L as getPropertyIdForModelAndName, al as toMetadataPropertyName, b5 as getDataTypeFromString, b6 as getMimeType, ar as INTERNAL_STORAGE_MODEL_FILE_IDS, W as getItemStorageSubdir, X as getItemStorageLocalFileName, g as normalizePropertyRecordSchema, b7 as listRelationStoragePropertyName, b8 as PROPERTY_NAMES_EXEMPT_FROM_ID_SUFFIX_STRIP, $ as getCorrectId, H as eventEmitter, b9 as getAlternatePropertyNameForInstanceLookup, a8 as isStorageSeedRef } from './BasePathResolver-CsZHPrk9.js';
|
|
3
3
|
import { or, isNull, eq, max, count, and, getTableColumns, sql, desc, inArray, isNotNull, gt } from 'drizzle-orm';
|
|
4
4
|
import debug from 'debug';
|
|
5
5
|
import { BehaviorSubject } from 'rxjs';
|
|
@@ -7,7 +7,7 @@ import pluralize from 'pluralize';
|
|
|
7
7
|
import { startCase, upperFirst, camelCase, orderBy } from 'lodash-es';
|
|
8
8
|
import { isValidEasAttestationUid, easName, isPlaceholderUid, BaseQueryClient, BaseEasClient, GET_SCHEMAS, getEasSchemaUidForSchemaDefinition, getSchemaUidForModelFromCache, setSchemaUidForModel, cachedSchemaLookup, getEasSchemaUidForExactDefinition } from '@seedprotocol/eas';
|
|
9
9
|
import { fetchArweaveRawTextAcrossGateways } from '@seedprotocol/arweave';
|
|
10
|
-
import { d as notifyFileSaved, f as withTabLock } from './tabEvents-
|
|
10
|
+
import { d as notifyFileSaved, f as withTabLock } from './tabEvents-BEAmMncP.js';
|
|
11
11
|
import { modelPropertiesToObject } from './model-oHA3YhOd.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -580,7 +580,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
580
580
|
const itemPropertyMod = await Promise.resolve().then(function () { return ItemProperty$1; });
|
|
581
581
|
const { ItemProperty } = itemPropertyMod;
|
|
582
582
|
const { modelPropertiesToObject } = await import('./model-oHA3YhOd.js');
|
|
583
|
-
const _mod_0 = await import('./errors-
|
|
583
|
+
const _mod_0 = await import('./errors-CWKup8tw.js');
|
|
584
584
|
const _ns_0 = _mod_0.h;
|
|
585
585
|
const { Model } = _ns_0;
|
|
586
586
|
// Resolve Model and build property schemas (use getByNameAsync for models not yet in cache)
|
|
@@ -598,7 +598,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
598
598
|
const schemaNameToTry = schemaName ?? model?.schemaName;
|
|
599
599
|
if (schemaNameToTry) {
|
|
600
600
|
try {
|
|
601
|
-
const _mod_1 = await import('./Schema-
|
|
601
|
+
const _mod_1 = await import('./Schema-VLenyJDy.js');
|
|
602
602
|
const _ns_1 = _mod_1.b;
|
|
603
603
|
const { Schema } = _ns_1;
|
|
604
604
|
const schemaInstance = Schema.create(schemaNameToTry, { waitForReady: false });
|
|
@@ -614,7 +614,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
614
614
|
}
|
|
615
615
|
if (Object.keys(propertySchemas).length === 0) {
|
|
616
616
|
try {
|
|
617
|
-
const _mod_2 = await import('./ClientManager-
|
|
617
|
+
const _mod_2 = await import('./ClientManager-DETTj0_z.js');
|
|
618
618
|
const _ns_2 = _mod_2.L;
|
|
619
619
|
const { loadAllSchemasFromDb } = _ns_2;
|
|
620
620
|
const allSchemas = await loadAllSchemasFromDb();
|
|
@@ -635,11 +635,11 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
635
635
|
}
|
|
636
636
|
if (Object.keys(propertySchemas).length === 0) {
|
|
637
637
|
try {
|
|
638
|
-
const _mod_3 = await import('./ClientManager-
|
|
638
|
+
const _mod_3 = await import('./ClientManager-DETTj0_z.js');
|
|
639
639
|
const _ns_3 = _mod_3.L;
|
|
640
640
|
const { listCompleteSchemaFiles } = _ns_3;
|
|
641
|
-
const _mod_4 = await import('./BasePathResolver-
|
|
642
|
-
const _ns_4 = _mod_4.
|
|
641
|
+
const _mod_4 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
642
|
+
const _ns_4 = _mod_4.bc;
|
|
643
643
|
const { BaseFileManager } = _ns_4;
|
|
644
644
|
const schemaFiles = await listCompleteSchemaFiles();
|
|
645
645
|
for (const { filePath } of schemaFiles) {
|
|
@@ -659,7 +659,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
if (Object.keys(propertySchemas).length === 0) {
|
|
662
|
-
const schemaMod = await import('./index-
|
|
662
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
663
663
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
664
664
|
const KNOWN_MODEL_FALLBACKS = {
|
|
665
665
|
Post: {
|
|
@@ -676,7 +676,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
// Fallbacks above may return schema-file shape ({ type, model, items }); normalize to dataType/ref/refValueType.
|
|
679
|
-
const { normalizePropertyRecordSchema } = await import('./property-
|
|
679
|
+
const { normalizePropertyRecordSchema } = await import('./property-tgPI5hMu.js');
|
|
680
680
|
propertySchemas = Object.fromEntries(Object.entries(propertySchemas).map(([name, def]) => [name, normalizePropertyRecordSchema(def)]));
|
|
681
681
|
// Collapse rows that map to the same instance key (e.g. authorIdentityIds + authors -> authors).
|
|
682
682
|
// ItemProperty.create cache does not sync propertyValue on hit; processing order would otherwise
|
|
@@ -709,7 +709,7 @@ const createItemPropertyInstances = async (metadataRows, seedLocalId, seedUid, m
|
|
|
709
709
|
// Infer propertyRecordSchema from metadata when schema is missing (enables persistence)
|
|
710
710
|
let propSchema = propertySchemas[propertyName];
|
|
711
711
|
if (!propSchema && isRefTypeFromMeta) {
|
|
712
|
-
const schemaMod = await import('./index-
|
|
712
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
713
713
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
714
714
|
propSchema = {
|
|
715
715
|
dataType: refSeedType === 'html' ? ModelPropertyDataTypes.Html
|
|
@@ -1715,8 +1715,8 @@ const getItemsData = async ({ modelName, modelFileId, schemaName, deleted, inclu
|
|
|
1715
1715
|
conditions.push(eq(seeds.type, easName(modelName)));
|
|
1716
1716
|
}
|
|
1717
1717
|
if (!modelFileId && schemaName && modelName) {
|
|
1718
|
-
const _mod_5 = await import('./BasePathResolver-
|
|
1719
|
-
const _ns_5 = _mod_5.
|
|
1718
|
+
const _mod_5 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
1719
|
+
const _ns_5 = _mod_5.bf;
|
|
1720
1720
|
const { resolveModelRecord } = _ns_5;
|
|
1721
1721
|
modelFileId = (await resolveModelRecord(modelName, { schemaName }))?.schemaFileId ?? undefined;
|
|
1722
1722
|
if (!modelFileId)
|
|
@@ -1998,7 +1998,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1998
1998
|
const { isRelation, propertyValue, propertyName, seedUid, propertyRecordSchema, populatedFromDb, schemaUid, } = context;
|
|
1999
1999
|
const _resolveRelatedValue = async () => {
|
|
2000
2000
|
// Use dynamic import to break circular dependency
|
|
2001
|
-
const schemaMod = await import('./index-
|
|
2001
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
2002
2002
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
2003
2003
|
if (!propertyValue || !isRelation || populatedFromDb) {
|
|
2004
2004
|
return;
|
|
@@ -2433,8 +2433,8 @@ async function readHtmlBodyFromChildStorageArweave(seedLocalId) {
|
|
|
2433
2433
|
/* offline / bad tx id */
|
|
2434
2434
|
}
|
|
2435
2435
|
try {
|
|
2436
|
-
const _mod_6 = await import('./BasePathResolver-
|
|
2437
|
-
const _ns_6 = _mod_6.
|
|
2436
|
+
const _mod_6 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
2437
|
+
const _ns_6 = _mod_6.bh;
|
|
2438
2438
|
const { downloadTransactionIdWithDedupe } = _ns_6;
|
|
2439
2439
|
await downloadTransactionIdWithDedupe(txId);
|
|
2440
2440
|
const retryFp = BaseFileManager.getFilesPath('html', `${seedLocalId}.html`);
|
|
@@ -2494,7 +2494,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2494
2494
|
// to use dynamically imported ModelPropertyDataTypes
|
|
2495
2495
|
const _hydrateFromDb = async () => {
|
|
2496
2496
|
// Use dynamic import to break circular dependency
|
|
2497
|
-
const schemaMod = await import('./index-
|
|
2497
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
2498
2498
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
2499
2499
|
const appDb = BaseDb.getAppDb();
|
|
2500
2500
|
const whereClauses = [];
|
|
@@ -2775,12 +2775,12 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2775
2775
|
const modelNameForNew = context.modelName;
|
|
2776
2776
|
if (modelNameForNew) {
|
|
2777
2777
|
try {
|
|
2778
|
-
const _mod_7 = await import('./errors-
|
|
2778
|
+
const _mod_7 = await import('./errors-CWKup8tw.js');
|
|
2779
2779
|
const _ns_7 = _mod_7.h;
|
|
2780
2780
|
const { Model } = _ns_7;
|
|
2781
2781
|
const { modelPropertiesToObject } = await import('./model-oHA3YhOd.js');
|
|
2782
|
-
const _mod_8 = await import('./BasePathResolver-
|
|
2783
|
-
const _ns_8 = _mod_8.
|
|
2782
|
+
const _mod_8 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
2783
|
+
const _ns_8 = _mod_8.bf;
|
|
2784
2784
|
const { resolveItemModelFileId } = _ns_8;
|
|
2785
2785
|
const normalizedModelName = upperFirst(camelCase(modelNameForNew));
|
|
2786
2786
|
const itemModelFileId = await resolveItemModelFileId({
|
|
@@ -2833,8 +2833,8 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2833
2833
|
// It ends up in the context below, and later lookups by name (Model.getByName) can't match it.
|
|
2834
2834
|
const modelName = context.modelName || (metadataRecord.modelType ? upperFirst(camelCase(metadataRecord.modelType)) : undefined);
|
|
2835
2835
|
// Model names are only unique per schema: pin lookups to the item's own model row.
|
|
2836
|
-
const _mod_9 = await import('./BasePathResolver-
|
|
2837
|
-
const _ns_9 = _mod_9.
|
|
2836
|
+
const _mod_9 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
2837
|
+
const _ns_9 = _mod_9.bf;
|
|
2838
2838
|
const { resolveItemModelFileId, resolveModelRecord } = _ns_9;
|
|
2839
2839
|
const modelFileId = await resolveItemModelFileId({
|
|
2840
2840
|
modelFileId: context.modelFileId,
|
|
@@ -2878,7 +2878,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2878
2878
|
required: propRecord.required ?? undefined,
|
|
2879
2879
|
};
|
|
2880
2880
|
// Validation rules (enum, pattern, ...) aren't in the properties table
|
|
2881
|
-
const { resolvePropertyValidationRules } = await import('./propertyValidationRules-
|
|
2881
|
+
const { resolvePropertyValidationRules } = await import('./propertyValidationRules-BLVxTejW.js');
|
|
2882
2882
|
const validation = await resolvePropertyValidationRules(normalizedModelName, propertyName, {
|
|
2883
2883
|
modelFileId: modelRecord?.schemaFileId ?? modelFileId,
|
|
2884
2884
|
});
|
|
@@ -2895,7 +2895,7 @@ const loadOrCreateProperty = fromCallback(({ sendBack, input: { context } }) =>
|
|
|
2895
2895
|
}
|
|
2896
2896
|
if (!propertyRecordSchema && modelName) {
|
|
2897
2897
|
try {
|
|
2898
|
-
const _mod_10 = await import('./errors-
|
|
2898
|
+
const _mod_10 = await import('./errors-CWKup8tw.js');
|
|
2899
2899
|
const _ns_10 = _mod_10.h;
|
|
2900
2900
|
const { Model } = _ns_10;
|
|
2901
2901
|
const { modelPropertiesToObject } = await import('./model-oHA3YhOd.js');
|
|
@@ -3329,9 +3329,9 @@ const analyzeInput = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
3329
3329
|
return false;
|
|
3330
3330
|
}
|
|
3331
3331
|
// Use dynamic import to break circular dependency
|
|
3332
|
-
const schemaMod = await import('./index-
|
|
3332
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
3333
3333
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
3334
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
3334
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-CLGadxgf.js');
|
|
3335
3335
|
let propertyName = propertyNameRaw;
|
|
3336
3336
|
if (!propertyName) {
|
|
3337
3337
|
throw new Error('propertyName is required');
|
|
@@ -3643,7 +3643,7 @@ const createMetadata = async (metadataValues, propertyRecordSchema, options) =>
|
|
|
3643
3643
|
propertyRecordSchema?.validation &&
|
|
3644
3644
|
metadataValues.propertyValue != null &&
|
|
3645
3645
|
metadataValues.propertyValue !== '') {
|
|
3646
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
3646
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-CLGadxgf.js');
|
|
3647
3647
|
const validationService = new SchemaValidationService();
|
|
3648
3648
|
const validationResult = validationService.validatePropertyValue(metadataValues.propertyValue, normalizeDataType(propertyRecordSchema.dataType), propertyRecordSchema.validation, propertyRecordSchema.refValueType
|
|
3649
3649
|
? normalizeDataType(String(propertyRecordSchema.refValueType))
|
|
@@ -4256,7 +4256,7 @@ const saveRelation = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
|
4256
4256
|
}
|
|
4257
4257
|
const _saveRelation = async () => {
|
|
4258
4258
|
// Use dynamic import to break circular dependency
|
|
4259
|
-
const schemaMod = await import('./index-
|
|
4259
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
4260
4260
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
4261
4261
|
if (!propertyNameRaw) {
|
|
4262
4262
|
throw new Error('propertyName is required');
|
|
@@ -4975,11 +4975,11 @@ const getPropertyData = async ({ propertyName, seedLocalId, seedUid, modelName,
|
|
|
4975
4975
|
let names = [...getMetadataPropertyNamesForQuery(propertyName)];
|
|
4976
4976
|
if (modelName) {
|
|
4977
4977
|
try {
|
|
4978
|
-
const _mod_11 = await import('./errors-
|
|
4978
|
+
const _mod_11 = await import('./errors-CWKup8tw.js');
|
|
4979
4979
|
const _ns_11 = _mod_11.h;
|
|
4980
4980
|
const { Model } = _ns_11;
|
|
4981
|
-
const _mod_12 = await import('./BasePathResolver-
|
|
4982
|
-
const _ns_12 = _mod_12.
|
|
4981
|
+
const _mod_12 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
4982
|
+
const _ns_12 = _mod_12.bf;
|
|
4983
4983
|
const { resolveItemModelFileId } = _ns_12;
|
|
4984
4984
|
// Model names are only unique per schema: use the seed's own model when it is recorded.
|
|
4985
4985
|
const modelFileId = await resolveItemModelFileId({ seedLocalId, seedUid });
|
|
@@ -5179,7 +5179,7 @@ const HTML_PROP_SEED_UID_RE = /^0x[a-fA-F0-9]{64}$/;
|
|
|
5179
5179
|
*/
|
|
5180
5180
|
const resolvePropertyRecordSchemaFromSchemaData = async (modelName, propertyName, modelType, schemaName) => {
|
|
5181
5181
|
try {
|
|
5182
|
-
const _mod_13 = await import('./ClientManager-
|
|
5182
|
+
const _mod_13 = await import('./ClientManager-DETTj0_z.js');
|
|
5183
5183
|
const _ns_13 = _mod_13.L;
|
|
5184
5184
|
const { loadAllSchemasFromDb } = _ns_13;
|
|
5185
5185
|
const allSchemas = await loadAllSchemasFromDb();
|
|
@@ -5233,12 +5233,12 @@ hints = {}) => {
|
|
|
5233
5233
|
return undefined;
|
|
5234
5234
|
}
|
|
5235
5235
|
try {
|
|
5236
|
-
const _mod_14 = await import('./errors-
|
|
5236
|
+
const _mod_14 = await import('./errors-CWKup8tw.js');
|
|
5237
5237
|
const _ns_14 = _mod_14.h;
|
|
5238
5238
|
const { Model } = _ns_14;
|
|
5239
5239
|
const { modelPropertiesToObject } = await import('./model-oHA3YhOd.js');
|
|
5240
|
-
const _mod_15 = await import('./BasePathResolver-
|
|
5241
|
-
const _ns_15 = _mod_15.
|
|
5240
|
+
const _mod_15 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
5241
|
+
const _ns_15 = _mod_15.bf;
|
|
5242
5242
|
const { resolveItemModelFileId } = _ns_15;
|
|
5243
5243
|
const modelFileId = await resolveItemModelFileId(hints);
|
|
5244
5244
|
let model = modelFileId
|
|
@@ -5397,7 +5397,7 @@ class ItemProperty {
|
|
|
5397
5397
|
return;
|
|
5398
5398
|
}
|
|
5399
5399
|
// Use dynamic import to break circular dependency
|
|
5400
|
-
const schemaMod = await import('./index-
|
|
5400
|
+
const schemaMod = await import('./index-CXkcz4hT.js');
|
|
5401
5401
|
const { ModelPropertyDataTypes } = schemaMod;
|
|
5402
5402
|
const { context } = snapshot;
|
|
5403
5403
|
const { propertyRecordSchema } = context;
|
|
@@ -5568,7 +5568,7 @@ class ItemProperty {
|
|
|
5568
5568
|
const normalizedRefValueType = normalizeDataType(propertyRecordSchema?.refValueType);
|
|
5569
5569
|
const propertyNames = getMetadataPropertyNamesForQuery(propertyName, normalizedDataType, normalizedRefValueType);
|
|
5570
5570
|
const propertyNameVariant = propertyNames.length > 1 ? propertyNames[1] : undefined;
|
|
5571
|
-
const _mod_16 = await import('./index-
|
|
5571
|
+
const _mod_16 = await import('./index-CURf9L4d.js');
|
|
5572
5572
|
const _ns_16 = _mod_16.s;
|
|
5573
5573
|
const seedSchemaMod = _ns_16;
|
|
5574
5574
|
const { metadata } = seedSchemaMod;
|
|
@@ -5792,8 +5792,8 @@ class ItemProperty {
|
|
|
5792
5792
|
const ctx = this._service.getSnapshot().context;
|
|
5793
5793
|
let modelFileId;
|
|
5794
5794
|
try {
|
|
5795
|
-
const _mod_17 = await import('./BasePathResolver-
|
|
5796
|
-
const _ns_17 = _mod_17.
|
|
5795
|
+
const _mod_17 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
5796
|
+
const _ns_17 = _mod_17.bf;
|
|
5797
5797
|
const { resolveItemModelFileId } = _ns_17;
|
|
5798
5798
|
modelFileId = await resolveItemModelFileId({
|
|
5799
5799
|
modelFileId: ctx.modelFileId,
|
|
@@ -6155,8 +6155,8 @@ class ItemProperty {
|
|
|
6155
6155
|
const propertiesData = await getItemProperties({ seedLocalId, seedUid });
|
|
6156
6156
|
const instances = [];
|
|
6157
6157
|
const seenNormalized = new Set();
|
|
6158
|
-
const _mod_18 = await import('./BasePathResolver-
|
|
6159
|
-
const _ns_18 = _mod_18.
|
|
6158
|
+
const _mod_18 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
6159
|
+
const _ns_18 = _mod_18.bf;
|
|
6160
6160
|
const { resolveItemModelFileId } = _ns_18;
|
|
6161
6161
|
const itemModelFileId = await resolveItemModelFileId({ seedLocalId, seedUid });
|
|
6162
6162
|
for (const data of propertiesData) {
|
|
@@ -6173,7 +6173,7 @@ class ItemProperty {
|
|
|
6173
6173
|
}
|
|
6174
6174
|
else if (baseName) {
|
|
6175
6175
|
try {
|
|
6176
|
-
const _mod_19 = await import('./errors-
|
|
6176
|
+
const _mod_19 = await import('./errors-CWKup8tw.js');
|
|
6177
6177
|
const _ns_19 = _mod_19.h;
|
|
6178
6178
|
const { Model } = _ns_19;
|
|
6179
6179
|
const { modelPropertiesToObject } = await import('./model-oHA3YhOd.js');
|
|
@@ -6190,7 +6190,7 @@ class ItemProperty {
|
|
|
6190
6190
|
}
|
|
6191
6191
|
if (modelName && propertyName) {
|
|
6192
6192
|
try {
|
|
6193
|
-
const _mod_20 = await import('./errors-
|
|
6193
|
+
const _mod_20 = await import('./errors-CWKup8tw.js');
|
|
6194
6194
|
const _ns_20 = _mod_20.h;
|
|
6195
6195
|
const { Model } = _ns_20;
|
|
6196
6196
|
const { modelPropertiesToObject } = await import('./model-oHA3YhOd.js');
|
|
@@ -6522,7 +6522,7 @@ class ItemProperty {
|
|
|
6522
6522
|
if (!propertyName || (!seedLocalId && !seedUid))
|
|
6523
6523
|
return;
|
|
6524
6524
|
if (db) {
|
|
6525
|
-
const _mod_21 = await import('./index-
|
|
6525
|
+
const _mod_21 = await import('./index-CURf9L4d.js');
|
|
6526
6526
|
const _ns_21 = _mod_21.s;
|
|
6527
6527
|
const seedSchemaMod = _ns_21;
|
|
6528
6528
|
const { metadata } = seedSchemaMod;
|
|
@@ -6567,7 +6567,7 @@ const createNewItem = async ({ modelName, modelFileId, ...propertyData }) => {
|
|
|
6567
6567
|
}
|
|
6568
6568
|
const seedType = easName(modelName);
|
|
6569
6569
|
// Dynamic import to break circular dependency
|
|
6570
|
-
const _mod_22 = await import('./errors-
|
|
6570
|
+
const _mod_22 = await import('./errors-CWKup8tw.js');
|
|
6571
6571
|
const _ns_22 = _mod_22.h;
|
|
6572
6572
|
const modelMod = _ns_22;
|
|
6573
6573
|
const { Model } = modelMod;
|
|
@@ -6750,7 +6750,7 @@ const getModel = () => {
|
|
|
6750
6750
|
// the fragile `import(...).then(n => n.X)` chunk-namespace pattern.
|
|
6751
6751
|
if (!modelImportPromise) {
|
|
6752
6752
|
modelImportPromise = (async () => {
|
|
6753
|
-
const _mod_23 = await import('./errors-
|
|
6753
|
+
const _mod_23 = await import('./errors-CWKup8tw.js');
|
|
6754
6754
|
const _ns_23 = _mod_23.h;
|
|
6755
6755
|
const mod = _ns_23;
|
|
6756
6756
|
ModelClass = mod.Model;
|
|
@@ -6918,12 +6918,12 @@ class Item {
|
|
|
6918
6918
|
};
|
|
6919
6919
|
this.getPublishUploads = async (options) => {
|
|
6920
6920
|
// Use dynamic import to break circular dependency
|
|
6921
|
-
const getPublishUploadsMod = await import('./getPublishUploads-
|
|
6921
|
+
const getPublishUploadsMod = await import('./getPublishUploads-cLbSEXLk.js');
|
|
6922
6922
|
const { getPublishUploads } = getPublishUploadsMod;
|
|
6923
6923
|
return await getPublishUploads(this, [], undefined, options);
|
|
6924
6924
|
};
|
|
6925
6925
|
this.getPublishPayload = async (uploadedTransactions, options) => {
|
|
6926
|
-
const _mod_24 = await import('./getPublishPayload-
|
|
6926
|
+
const _mod_24 = await import('./getPublishPayload-CWfjl8PM.js');
|
|
6927
6927
|
const _ns_24 = _mod_24.g;
|
|
6928
6928
|
const getPublishPayloadMod = _ns_24;
|
|
6929
6929
|
const { getPublishPayload } = getPublishPayloadMod;
|
|
@@ -7459,8 +7459,8 @@ class Item {
|
|
|
7459
7459
|
const db = BaseDb.getAppDb();
|
|
7460
7460
|
if (db && props.modelName) {
|
|
7461
7461
|
// Model names are only unique per schema: resolve the exact models row from the most specific scope.
|
|
7462
|
-
const _mod_25 = await import('./BasePathResolver-
|
|
7463
|
-
const _ns_25 = _mod_25.
|
|
7462
|
+
const _mod_25 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
7463
|
+
const _ns_25 = _mod_25.bf;
|
|
7464
7464
|
const { resolveModelRecord } = _ns_25;
|
|
7465
7465
|
const modelRecord = await resolveModelRecord(props.modelName, {
|
|
7466
7466
|
modelFileId: props.modelFileId ?? modelInstance?.id,
|
|
@@ -7468,7 +7468,7 @@ class Item {
|
|
|
7468
7468
|
});
|
|
7469
7469
|
const modelRecords = modelRecord ? [modelRecord] : [];
|
|
7470
7470
|
if (!modelRecord) {
|
|
7471
|
-
const _mod_26 = await import('./errors-
|
|
7471
|
+
const _mod_26 = await import('./errors-CWKup8tw.js');
|
|
7472
7472
|
const _ns_26 = _mod_26.j;
|
|
7473
7473
|
const { UnknownModelError } = _ns_26;
|
|
7474
7474
|
throw new UnknownModelError(props.modelName, schemaName ?? modelInstance?.schemaName);
|
|
@@ -7479,11 +7479,11 @@ class Item {
|
|
|
7479
7479
|
// Scope the constructor's Model lookup to this model's schema (as getItemData does on reload),
|
|
7480
7480
|
// so a same-named model cached from another schema can't supply the property set.
|
|
7481
7481
|
if (modelRecord && !props.schemaName) {
|
|
7482
|
-
const _mod_27 = await import('./BasePathResolver-
|
|
7483
|
-
const _ns_27 = _mod_27.
|
|
7482
|
+
const _mod_27 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
7483
|
+
const _ns_27 = _mod_27.be;
|
|
7484
7484
|
const { modelSchemas } = _ns_27;
|
|
7485
|
-
const _mod_28 = await import('./BasePathResolver-
|
|
7486
|
-
const _ns_28 = _mod_28.
|
|
7485
|
+
const _mod_28 = await import('./BasePathResolver-CsZHPrk9.js');
|
|
7486
|
+
const _ns_28 = _mod_28.bd;
|
|
7487
7487
|
const { schemas: schemasTable } = _ns_28;
|
|
7488
7488
|
const schemaRows = await db
|
|
7489
7489
|
.select({ schemaName: schemasTable.name })
|
|
@@ -7841,7 +7841,7 @@ class Item {
|
|
|
7841
7841
|
if (!appDb || Item.instanceCache.size === 0) {
|
|
7842
7842
|
return;
|
|
7843
7843
|
}
|
|
7844
|
-
const _mod_29 = await import('./index-
|
|
7844
|
+
const _mod_29 = await import('./index-CURf9L4d.js');
|
|
7845
7845
|
const _ns_29 = _mod_29.s;
|
|
7846
7846
|
const { metadata } = _ns_29;
|
|
7847
7847
|
const { eq, and } = await import('drizzle-orm');
|
|
@@ -8004,11 +8004,11 @@ class Item {
|
|
|
8004
8004
|
}
|
|
8005
8005
|
/** Throws ItemCreateValidationError for unknown keys and values that break their property's rules. */
|
|
8006
8006
|
static async assertValidCreateValues(props, propertyNames, dataTypeByPropertyName, skipKeys) {
|
|
8007
|
-
const _mod_30 = await import('./errors-
|
|
8007
|
+
const _mod_30 = await import('./errors-CWKup8tw.js');
|
|
8008
8008
|
const _ns_30 = _mod_30.j;
|
|
8009
8009
|
const { ItemCreateValidationError } = _ns_30;
|
|
8010
|
-
const { getPropertySchema } = await import('./property-
|
|
8011
|
-
const { SchemaValidationService } = await import('./SchemaValidationService-
|
|
8010
|
+
const { getPropertySchema } = await import('./property-tgPI5hMu.js');
|
|
8011
|
+
const { SchemaValidationService } = await import('./SchemaValidationService-CLGadxgf.js');
|
|
8012
8012
|
const validationService = new SchemaValidationService();
|
|
8013
8013
|
const modelName = props.modelName;
|
|
8014
8014
|
const known = new Set(propertyNames);
|
|
@@ -8045,7 +8045,7 @@ class Item {
|
|
|
8045
8045
|
// Not JSON: validated as given, and rejected as a non-array
|
|
8046
8046
|
}
|
|
8047
8047
|
}
|
|
8048
|
-
const { resolvePropertyValidationRules } = await import('./propertyValidationRules-
|
|
8048
|
+
const { resolvePropertyValidationRules } = await import('./propertyValidationRules-BLVxTejW.js');
|
|
8049
8049
|
const rules = propertySchema?.validation ??
|
|
8050
8050
|
(await resolvePropertyValidationRules(modelName, key, {
|
|
8051
8051
|
modelFileId: props.modelFileId,
|
|
@@ -8376,7 +8376,7 @@ class Item {
|
|
|
8376
8376
|
itemActor.send(event);
|
|
8377
8377
|
};
|
|
8378
8378
|
try {
|
|
8379
|
-
const _mod_31 = await import('./index-
|
|
8379
|
+
const _mod_31 = await import('./index-CURf9L4d.js');
|
|
8380
8380
|
const _ns_31 = _mod_31.s;
|
|
8381
8381
|
const seedSchemaMod = _ns_31;
|
|
8382
8382
|
const { seeds, versions, metadata } = seedSchemaMod;
|
|
@@ -8740,5 +8740,5 @@ var Item$1 = /*#__PURE__*/Object.freeze({
|
|
|
8740
8740
|
Item: Item
|
|
8741
8741
|
});
|
|
8742
8742
|
|
|
8743
|
-
export { unloadEntity as $, getPublishExecutor as A, getRevokeExecutor as B, ClientManagerState as C, DEFAULT_READY_TIMEOUT_MS as D, getUploadExecutor as E, getVersionData$1 as F, isLocalUnsealedDraft as G, isSeedRowOwned as H, Item as I, localUnsealedDraftSql as J, ownedPublisherSql as K, ownedSeedsSql as L, METADATA_LATEST_FIRST_ORDER_SQL as M, pickLatestMetadataRowPerProperty as N, OwnershipError as O, PUBLISH_NOT_CONFIGURED_MESSAGE as P, placeholderUidSql as Q, propertyMachine as R, publisherInAddressListSql as S, publisherIsInOwnedSet as T, setAdditionalSyncAddresses as U, setGetPublisherForNewSeeds as V, setPublishExecutor as W, setRevokeExecutor as X, setUploadExecutor as Y, getInvariantSafePropertyDescriptor as Z, clearDestroySubscriptions as _,
|
|
8744
|
-
//# sourceMappingURL=Item-
|
|
8743
|
+
export { unloadEntity as $, getPublishExecutor as A, getRevokeExecutor as B, ClientManagerState as C, DEFAULT_READY_TIMEOUT_MS as D, getUploadExecutor as E, getVersionData$1 as F, isLocalUnsealedDraft as G, isSeedRowOwned as H, Item as I, localUnsealedDraftSql as J, ownedPublisherSql as K, ownedSeedsSql as L, METADATA_LATEST_FIRST_ORDER_SQL as M, pickLatestMetadataRowPerProperty as N, OwnershipError as O, PUBLISH_NOT_CONFIGURED_MESSAGE as P, placeholderUidSql as Q, propertyMachine as R, publisherInAddressListSql as S, publisherIsInOwnedSet as T, setAdditionalSyncAddresses as U, setGetPublisherForNewSeeds as V, setPublishExecutor as W, setRevokeExecutor as X, setUploadExecutor as Y, getInvariantSafePropertyDescriptor as Z, clearDestroySubscriptions as _, ItemProperty as a, ClientManagerEvents as a0, withLockedItemStorageRow as a1, getItemStorageFilePath as a2, writeItemStorageFile as a3, resolvePublisherFromSeedRow as a4, getPropertyData$1 as a5, Item$1 as a6, ItemPropertySaveValidationError as b, compareMetadataRowsLatestFirst as c, assertItemOwned as d, getEasSchemaUidForModel as e, getLatestPublishedVersionRow as f, getItemData as g, isVersionRevoked as h, isItemOwned as i, chunkValues as j, getGetAdditionalSyncAddresses as k, waitForEntityIdle as l, createReactiveProxy as m, findEntity as n, forceRemoveFromCaches as o, parseListPropertyValueFromStorage as p, runDestroyLifecycle as q, rowsPerInsert as r, selectInBatches as s, isPublishedMetadataRow as t, MachineIds as u, createNewItem as v, writeInBatches as w, getEasSchemaForItemProperty as x, getGetPublisherForNewSeeds as y, getMetadataLatest as z };
|
|
8744
|
+
//# sourceMappingURL=Item-TMrVEPeX.js.map
|