@seedprotocol/sdk 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ModelProperty-D-ysg8zA.js → ModelProperty-BBXBvgvy.js} +19 -18
- package/dist/ModelProperty-BBXBvgvy.js.map +1 -0
- package/dist/{Schema-CyCftnKI.js → Schema-xAt7jWlW.js} +36 -36
- package/dist/{Schema-CyCftnKI.js.map → Schema-xAt7jWlW.js.map} +1 -1
- package/dist/{SchemaValidationService-POM6jHbJ.js → SchemaValidationService-CLzAdBm-.js} +5 -4
- package/dist/{SchemaValidationService-POM6jHbJ.js.map → SchemaValidationService-CLzAdBm-.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-DzZw57iJ.js → backfillMetadataPropertyIds-DBVaIs7O.js} +2 -2
- package/dist/{backfillMetadataPropertyIds-DzZw57iJ.js.map → backfillMetadataPropertyIds-DBVaIs7O.js.map} +1 -1
- package/dist/cjs/{ModelProperty-CmuGJvyi.js → ModelProperty-Dgd4tGrB.js} +18 -18
- package/dist/cjs/{ModelProperty-CmuGJvyi.js.map → ModelProperty-Dgd4tGrB.js.map} +1 -1
- package/dist/cjs/{Schema-gpFnZMhB.js → Schema-dkd-eo3B.js} +21 -21
- package/dist/cjs/{Schema-gpFnZMhB.js.map → Schema-dkd-eo3B.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-E3xTSRai.js → SchemaValidationService-BMnjcVWV.js} +3 -3
- package/dist/cjs/{SchemaValidationService-E3xTSRai.js.map → SchemaValidationService-BMnjcVWV.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-_bivrvRs.js → backfillMetadataPropertyIds-ClLuj3s6.js} +3 -3
- package/dist/cjs/{backfillMetadataPropertyIds-_bivrvRs.js.map → backfillMetadataPropertyIds-ClLuj3s6.js.map} +1 -1
- package/dist/cjs/{eas-BwDKJmlb.js → eas-nWAzbl_F.js} +4 -4
- package/dist/cjs/{eas-BwDKJmlb.js.map → eas-nWAzbl_F.js.map} +1 -1
- package/dist/cjs/{getItem-MShQw3sz.js → getItem-B08FgglK.js} +3 -3
- package/dist/cjs/{getItem-MShQw3sz.js.map → getItem-B08FgglK.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-C1nOOXp_.js → getPublishPayload-B_G_6qkE.js} +12 -12
- package/dist/cjs/{getPublishPayload-C1nOOXp_.js.map → getPublishPayload-B_G_6qkE.js.map} +1 -1
- package/dist/cjs/{getPublishUploads-BjgxgrKD.js → getPublishUploads-Dt-DS-lo.js} +5 -5
- package/dist/cjs/{getPublishUploads-BjgxgrKD.js.map → getPublishUploads-Dt-DS-lo.js.map} +1 -1
- package/dist/cjs/{getSegmentedItemProperties-Cuw7wcxb.js → getSegmentedItemProperties-BDGbeDW7.js} +3 -3
- package/dist/cjs/{getSegmentedItemProperties-Cuw7wcxb.js.map → getSegmentedItemProperties-BDGbeDW7.js.map} +1 -1
- package/dist/cjs/{index-vk2DeF2D.js → index-CRBI6dSD.js} +475 -58
- package/dist/cjs/index-CRBI6dSD.js.map +1 -0
- package/dist/cjs/{index-9Z2FOvLD.js → index-Dx19j60c.js} +4 -4
- package/dist/cjs/index-Dx19j60c.js.map +1 -0
- package/dist/cjs/{ownership-DhWda0J9.js → ownership-3Tc1-Yrc.js} +3 -3
- package/dist/cjs/{ownership-DhWda0J9.js.map → ownership-3Tc1-Yrc.js.map} +1 -1
- package/dist/cjs/{property-D3Ww2_Qh.js → property-628qAHpN.js} +5 -5
- package/dist/cjs/{property-D3Ww2_Qh.js.map → property-628qAHpN.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-Dht3_7UD.js → syncDbWithEas-DOBtMPw-.js} +46 -49
- package/dist/cjs/syncDbWithEas-DOBtMPw-.js.map +1 -0
- package/dist/{configurePlatform-R5neRbQ9.js → configurePlatform-Ce6NIKRP.js} +3 -2
- package/dist/{configurePlatform-R5neRbQ9.js.map → configurePlatform-Ce6NIKRP.js.map} +1 -1
- package/dist/{constants-B5S5JPDK.js → constants-slkc9uq0.js} +13 -18
- package/dist/constants-slkc9uq0.js.map +1 -0
- package/dist/{db-Cvh84NY7.js → db-CSmK0c3e.js} +9 -9
- package/dist/{db-Cvh84NY7.js.map → db-CSmK0c3e.js.map} +1 -1
- package/dist/{eas-D9b7z2Wn.js → eas-rx1grht5.js} +5 -4
- package/dist/eas-rx1grht5.js.map +1 -0
- package/dist/{getItem-B81V3m4S.js → getItem-hPBJU5JF.js} +5 -4
- package/dist/{getItem-B81V3m4S.js.map → getItem-hPBJU5JF.js.map} +1 -1
- package/dist/{getPublishPayload-CNYsn8-6.js → getPublishPayload-5ugovGK5.js} +16 -15
- package/dist/getPublishPayload-5ugovGK5.js.map +1 -0
- package/dist/{getPublishUploads-D9rPHkB7.js → getPublishUploads-CdWeci-s.js} +7 -6
- package/dist/{getPublishUploads-D9rPHkB7.js.map → getPublishUploads-CdWeci-s.js.map} +1 -1
- package/dist/{getSegmentedItemProperties-Bg3_b-b1.js → getSegmentedItemProperties-DV2LHElJ.js} +4 -4
- package/dist/{getSegmentedItemProperties-Bg3_b-b1.js.map → getSegmentedItemProperties-DV2LHElJ.js.map} +1 -1
- package/dist/{index-oi4roUVf.js → index-CcH2e0Zr.js} +6 -5
- package/dist/index-CcH2e0Zr.js.map +1 -0
- package/dist/{index--F3Wolt5.js → index-ClwdGWfr.js} +477 -45
- package/dist/index-ClwdGWfr.js.map +1 -0
- package/dist/{index.node-Bow8kHew.js → index.node-CrXwRoiB.js} +2 -2
- package/dist/{index.node-Bow8kHew.js.map → index.node-CrXwRoiB.js.map} +1 -1
- package/dist/main.cjs +3 -6
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +19 -18
- package/dist/main.js.map +1 -1
- package/dist/node.js +30 -9
- package/dist/node.js.map +1 -1
- package/dist/{ownership-BF_ZUKIp.js → ownership-58i0iyD9.js} +5 -4
- package/dist/{ownership-BF_ZUKIp.js.map → ownership-58i0iyD9.js.map} +1 -1
- package/dist/platform.browser.js +16 -3
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.node.js +1 -1
- package/dist/{property-BdyDfcSc.js → property-CKhOxRNt.js} +8 -7
- package/dist/property-CKhOxRNt.js.map +1 -0
- package/dist/src/Item/service/actors/saveDataToDb.d.ts.map +1 -1
- package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/db/read/getItemData.d.ts +8 -0
- package/dist/src/db/read/getItemData.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts +1 -1
- package/dist/src/helpers/gateway/resolveSeedGatewayEndpoints.d.ts.map +1 -1
- package/dist/src/helpers/index.d.ts +1 -5
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/mediaRef.d.ts +3 -0
- package/dist/src/helpers/mediaRef.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/webpack/index.d.ts +4 -1
- package/dist/src/node/webpack/index.d.ts.map +1 -1
- package/dist/src/query/createLocalQueryDataSource.d.ts +6 -0
- package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -0
- package/dist/src/query/index.d.ts +4 -0
- package/dist/src/query/index.d.ts.map +1 -0
- package/dist/src/query/registerSeedQueryLocalSource.d.ts +25 -0
- package/dist/src/query/registerSeedQueryLocalSource.d.ts.map +1 -0
- package/dist/src/types/machines.d.ts +2 -0
- package/dist/src/types/machines.d.ts.map +1 -1
- package/dist/{syncDbWithEas-DMOJHtkP.js → syncDbWithEas-GsaXzTIY.js} +50 -52
- package/dist/syncDbWithEas-GsaXzTIY.js.map +1 -0
- package/package.json +5 -5
- package/dist/ModelProperty-D-ysg8zA.js.map +0 -1
- package/dist/cjs/index-9Z2FOvLD.js.map +0 -1
- package/dist/cjs/index-vk2DeF2D.js.map +0 -1
- package/dist/cjs/syncDbWithEas-Dht3_7UD.js.map +0 -1
- package/dist/constants-B5S5JPDK.js.map +0 -1
- package/dist/eas-D9b7z2Wn.js.map +0 -1
- package/dist/getPublishPayload-CNYsn8-6.js.map +0 -1
- package/dist/index--F3Wolt5.js.map +0 -1
- package/dist/index-oi4roUVf.js.map +0 -1
- package/dist/property-BdyDfcSc.js.map +0 -1
- package/dist/syncDbWithEas-DMOJHtkP.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
-
import { w as writeProcessMachine, M as Model, m as modelPropertiesToObject,
|
|
4
|
-
import { n as normalizeDataType } from './constants-
|
|
3
|
+
import { w as writeProcessMachine, M as Model, m as modelPropertiesToObject, i as generateId, u as waitForEntityIdle, v as createReactiveProxy, x as findEntity, y as forceRemoveFromCaches, z as runDestroyLifecycle } from './index-ClwdGWfr.js';
|
|
4
|
+
import { n as normalizeDataType } from './constants-slkc9uq0.js';
|
|
5
5
|
import 'pluralize';
|
|
6
6
|
import { B as BaseDb, m as models, p as properties, r as schemas, i as modelSchemas, a as BaseFileManager } from './BasePathResolver-BDgc7c4T.js';
|
|
7
7
|
import { eq, and } from 'drizzle-orm';
|
|
8
8
|
import debug from 'debug';
|
|
9
|
-
import { getModelIdByFileId, getModelId } from './db-
|
|
10
|
-
import { S as Schema } from './Schema-
|
|
9
|
+
import { getModelIdByFileId, getModelId } from './db-CSmK0c3e.js';
|
|
10
|
+
import { S as Schema } from './Schema-xAt7jWlW.js';
|
|
11
11
|
import 'nanoid';
|
|
12
12
|
import 'nanoid-dictionary';
|
|
13
13
|
import '@seedprotocol/eas';
|
|
@@ -17,9 +17,10 @@ import 'rxjs';
|
|
|
17
17
|
import 'lodash-es';
|
|
18
18
|
import 'drizzle-orm/casing';
|
|
19
19
|
import 'js-sha3';
|
|
20
|
+
import '@seedprotocol/query';
|
|
20
21
|
import '@sinclair/typebox';
|
|
21
22
|
import 'drizzle-orm/sqlite-core';
|
|
22
|
-
import './SchemaValidationService-
|
|
23
|
+
import './SchemaValidationService-CLzAdBm-.js';
|
|
23
24
|
import '@sinclair/typebox/value';
|
|
24
25
|
|
|
25
26
|
const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
@@ -30,8 +31,8 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
30
31
|
*/
|
|
31
32
|
async function getSchemaNameFromModel(modelName) {
|
|
32
33
|
// Get the latest schema files and find which one contains this model
|
|
33
|
-
const _mod_0 = await import('./index
|
|
34
|
-
const _ns_0 = _mod_0.
|
|
34
|
+
const _mod_0 = await import('./index-ClwdGWfr.js');
|
|
35
|
+
const _ns_0 = _mod_0.ak;
|
|
35
36
|
const schemaHelpersMod = _ns_0;
|
|
36
37
|
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
37
38
|
const latestSchemas = await listLatestSchemaFiles();
|
|
@@ -57,7 +58,7 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
57
58
|
const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
58
59
|
const _saveToSchema = async () => {
|
|
59
60
|
// Use dynamic import to break circular dependency
|
|
60
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
61
|
+
const validationServiceMod = await import('./SchemaValidationService-CLzAdBm-.js');
|
|
61
62
|
const { SchemaValidationService } = validationServiceMod;
|
|
62
63
|
const validationService = new SchemaValidationService();
|
|
63
64
|
// Validate property structure before saving
|
|
@@ -76,13 +77,13 @@ const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
76
77
|
throw new Error(`Model not found for modelId: ${context.modelId}`);
|
|
77
78
|
}
|
|
78
79
|
// Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
|
|
79
|
-
const dbMod = await import('./db-
|
|
80
|
+
const dbMod = await import('./db-CSmK0c3e.js');
|
|
80
81
|
const { savePropertyToDb } = dbMod;
|
|
81
82
|
await savePropertyToDb(context);
|
|
82
83
|
// Mark schema as draft so user knows to save
|
|
83
84
|
const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
|
|
84
85
|
if (schemaName) {
|
|
85
|
-
const _mod_2 = await import('./Schema-
|
|
86
|
+
const _mod_2 = await import('./Schema-xAt7jWlW.js');
|
|
86
87
|
const _ns_2 = _mod_2.b;
|
|
87
88
|
const schemaMod = _ns_2;
|
|
88
89
|
const { Schema } = schemaMod;
|
|
@@ -117,7 +118,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
117
118
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
118
119
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
119
120
|
try {
|
|
120
|
-
const dbMod = await import('./db-
|
|
121
|
+
const dbMod = await import('./db-CSmK0c3e.js');
|
|
121
122
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
122
123
|
let fromDb;
|
|
123
124
|
for (let attempt = 0; attempt < 6; attempt++) {
|
|
@@ -162,7 +163,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
162
163
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
163
164
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
164
165
|
try {
|
|
165
|
-
const dbMod = await import('./db-
|
|
166
|
+
const dbMod = await import('./db-CSmK0c3e.js');
|
|
166
167
|
const { savePropertyToDb } = dbMod;
|
|
167
168
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
168
169
|
const contextWithFileId = {
|
|
@@ -222,7 +223,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
222
223
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
223
224
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
224
225
|
// Use dynamic import to break circular dependency
|
|
225
|
-
const dbMod = await import('./db-
|
|
226
|
+
const dbMod = await import('./db-CSmK0c3e.js');
|
|
226
227
|
const { savePropertyToDb } = dbMod;
|
|
227
228
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
228
229
|
try {
|
|
@@ -236,7 +237,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
236
237
|
// Mark schema as draft if schema name is available
|
|
237
238
|
if (fullContext._schemaName) {
|
|
238
239
|
// Get the Schema instance and mark it as draft
|
|
239
|
-
const _mod_3 = await import('./Schema-
|
|
240
|
+
const _mod_3 = await import('./Schema-xAt7jWlW.js');
|
|
240
241
|
const _ns_3 = _mod_3.b;
|
|
241
242
|
const schemaMod = _ns_3;
|
|
242
243
|
const { Schema } = schemaMod;
|
|
@@ -321,7 +322,7 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
321
322
|
// Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
|
|
322
323
|
await new Promise((r) => setTimeout(r, 60));
|
|
323
324
|
try {
|
|
324
|
-
const dbMod = await import('./db-
|
|
325
|
+
const dbMod = await import('./db-CSmK0c3e.js');
|
|
325
326
|
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
326
327
|
// Try pending write first (property row may not exist yet)
|
|
327
328
|
if (fullContext.modelName === undefined && schemaFileId) {
|
|
@@ -373,10 +374,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
373
374
|
fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
|
|
374
375
|
}
|
|
375
376
|
// Use dynamic imports to break circular dependencies
|
|
376
|
-
const validationServiceMod = await import('./SchemaValidationService-
|
|
377
|
+
const validationServiceMod = await import('./SchemaValidationService-CLzAdBm-.js');
|
|
377
378
|
const { SchemaValidationService } = validationServiceMod;
|
|
378
379
|
const validationService = new SchemaValidationService();
|
|
379
|
-
const _mod_5 = await import('./Schema-
|
|
380
|
+
const _mod_5 = await import('./Schema-xAt7jWlW.js');
|
|
380
381
|
const _ns_5 = _mod_5.b;
|
|
381
382
|
const schemaMod = _ns_5;
|
|
382
383
|
const { Schema } = schemaMod;
|
|
@@ -1762,4 +1763,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
1762
1763
|
});
|
|
1763
1764
|
|
|
1764
1765
|
export { ModelProperty };
|
|
1765
|
-
//# sourceMappingURL=ModelProperty-
|
|
1766
|
+
//# sourceMappingURL=ModelProperty-BBXBvgvy.js.map
|