@seedprotocol/sdk 0.6.2 → 0.6.4
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-DMjKVphl.js → ModelProperty-BiDQu5rE.js} +17 -17
- package/dist/{ModelProperty-DMjKVphl.js.map → ModelProperty-BiDQu5rE.js.map} +1 -1
- package/dist/{Schema-cK2z7wet.js → Schema-qciDB7Nu.js} +23 -23
- package/dist/{Schema-cK2z7wet.js.map → Schema-qciDB7Nu.js.map} +1 -1
- package/dist/{SchemaValidationService-B3pQ_q-9.js → SchemaValidationService-BaOkRjsU.js} +4 -4
- package/dist/{SchemaValidationService-B3pQ_q-9.js.map → SchemaValidationService-BaOkRjsU.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-C-YLFeI2.js → backfillMetadataPropertyIds-oypxoBXv.js} +2 -2
- package/dist/{backfillMetadataPropertyIds-C-YLFeI2.js.map → backfillMetadataPropertyIds-oypxoBXv.js.map} +1 -1
- package/dist/cjs/{ModelProperty-CCwtTuvi.js → ModelProperty-DvIIhBnK.js} +17 -17
- package/dist/cjs/{ModelProperty-CCwtTuvi.js.map → ModelProperty-DvIIhBnK.js.map} +1 -1
- package/dist/cjs/{Schema-DU28JWKv.js → Schema-FdzNqyGo.js} +20 -20
- package/dist/cjs/{Schema-DU28JWKv.js.map → Schema-FdzNqyGo.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-BOYI1syg.js → SchemaValidationService-pxRoOs79.js} +2 -2
- package/dist/cjs/{SchemaValidationService-BOYI1syg.js.map → SchemaValidationService-pxRoOs79.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-CrvyL7Xq.js → backfillMetadataPropertyIds-D0o5VwBh.js} +2 -2
- package/dist/cjs/{backfillMetadataPropertyIds-CrvyL7Xq.js.map → backfillMetadataPropertyIds-D0o5VwBh.js.map} +1 -1
- package/dist/cjs/{eas-D-Casv2P.js → eas-DSZkoDUn.js} +3 -3
- package/dist/cjs/{eas-D-Casv2P.js.map → eas-DSZkoDUn.js.map} +1 -1
- package/dist/cjs/{getItem-BPAs0Jxp.js → getItem-CPcdcFuS.js} +2 -2
- package/dist/cjs/{getItem-BPAs0Jxp.js.map → getItem-CPcdcFuS.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-BeoNRCLY.js → getPublishPayload-BvmVTKoc.js} +11 -11
- package/dist/cjs/{getPublishPayload-BeoNRCLY.js.map → getPublishPayload-BvmVTKoc.js.map} +1 -1
- package/dist/cjs/{getPublishUploads-C75vy7nb.js → getPublishUploads-D2VZHZnu.js} +4 -4
- package/dist/cjs/{getPublishUploads-C75vy7nb.js.map → getPublishUploads-D2VZHZnu.js.map} +1 -1
- package/dist/cjs/{getSegmentedItemProperties-CDmkM9Yc.js → getSegmentedItemProperties-Bm1TEvBS.js} +3 -3
- package/dist/cjs/{getSegmentedItemProperties-CDmkM9Yc.js.map → getSegmentedItemProperties-Bm1TEvBS.js.map} +1 -1
- package/dist/cjs/{index-BbfxH7OY.js → index-C-POwaLs.js} +158 -160
- package/dist/cjs/index-C-POwaLs.js.map +1 -0
- package/dist/cjs/{index-CA6kGjZH.js → index-D_ph4zut.js} +3 -3
- package/dist/cjs/index-D_ph4zut.js.map +1 -0
- package/dist/cjs/{property-aeBSv5CF.js → property-DkUtJxV2.js} +4 -4
- package/dist/cjs/{property-aeBSv5CF.js.map → property-DkUtJxV2.js.map} +1 -1
- package/dist/cjs/{syncDbWithEas-ChvunkwQ.js → syncDbWithEas-DRoys7eo.js} +6 -6
- package/dist/cjs/{syncDbWithEas-ChvunkwQ.js.map → syncDbWithEas-DRoys7eo.js.map} +1 -1
- package/dist/{constants-DMHTYMgJ.js → constants-Bre6dTJR.js} +3 -1
- package/dist/constants-Bre6dTJR.js.map +1 -0
- package/dist/{db-BwVuO1tO.js → db-DVsy4QZe.js} +4 -4
- package/dist/{db-BwVuO1tO.js.map → db-DVsy4QZe.js.map} +1 -1
- package/dist/{eas-C0H0EbDo.js → eas-z4W41ith.js} +2 -2
- package/dist/{eas-C0H0EbDo.js.map → eas-z4W41ith.js.map} +1 -1
- package/dist/{getItem-Cxa-rKqh.js → getItem-BiE_b7Fu.js} +4 -4
- package/dist/{getItem-Cxa-rKqh.js.map → getItem-BiE_b7Fu.js.map} +1 -1
- package/dist/{getPublishPayload-DmOu0I29.js → getPublishPayload-CuRGEZa5.js} +13 -13
- package/dist/{getPublishPayload-DmOu0I29.js.map → getPublishPayload-CuRGEZa5.js.map} +1 -1
- package/dist/{getPublishUploads-gWv4tDyT.js → getPublishUploads-CMgzBCzZ.js} +6 -6
- package/dist/{getPublishUploads-gWv4tDyT.js.map → getPublishUploads-CMgzBCzZ.js.map} +1 -1
- package/dist/{getSegmentedItemProperties-BfIBZbR7.js → getSegmentedItemProperties-BCCSwTxr.js} +3 -3
- package/dist/{getSegmentedItemProperties-BfIBZbR7.js.map → getSegmentedItemProperties-BCCSwTxr.js.map} +1 -1
- package/dist/{index-DAwvrNga.js → index-C41UZTmQ.js} +5 -5
- package/dist/index-C41UZTmQ.js.map +1 -0
- package/dist/{index-C1pktvdj.js → index-DjwIC6U3.js} +160 -164
- package/dist/index-DjwIC6U3.js.map +1 -0
- package/dist/{index.node-DqC_o5EN.js → index.node-DQZ3cPe-.js} +3 -3
- package/dist/{index.node-DqC_o5EN.js.map → index.node-DQZ3cPe-.js.map} +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +18 -18
- package/dist/node.js +5 -5
- package/dist/platform.browser.js +1 -1
- package/dist/platform.node.js +2 -2
- package/dist/{property-eMrSbAWU.js → property-Bs3a4Dna.js} +6 -6
- package/dist/{property-eMrSbAWU.js.map → property-Bs3a4Dna.js.map} +1 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/reactiveProxy.d.ts +10 -0
- package/dist/src/helpers/reactiveProxy.d.ts.map +1 -1
- package/dist/{syncDbWithEas-c9Xe17zq.js → syncDbWithEas-DRpLRxwb.js} +8 -8
- package/dist/{syncDbWithEas-c9Xe17zq.js.map → syncDbWithEas-DRpLRxwb.js.map} +1 -1
- package/package.json +5 -5
- package/dist/cjs/index-BbfxH7OY.js.map +0 -1
- package/dist/cjs/index-CA6kGjZH.js.map +0 -1
- package/dist/constants-DMHTYMgJ.js.map +0 -1
- package/dist/index-C1pktvdj.js.map +0 -1
- package/dist/index-DAwvrNga.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { fromCallback, setup, assign, createActor } from 'xstate';
|
|
2
|
-
import { k as getRefValueType, h as generateId, ag as createModelsFromJson, Y as listCompleteSchemaFiles, ah as getLatestSchemaVersion, ai as createModelFromJson, M as Model, w as writeProcessMachine, n as loadSchemaFromFile, u as waitForEntityIdle, v as createReactiveProxy, x as findEntity, Z as loadAllSchemasFromDb, aj as ConflictError, J as getClient, ak as unloadEntity, al as clearDestroySubscriptions, y as forceRemoveFromCaches, z as runDestroyLifecycle, am as setupEntityLiveQuery } from './index-
|
|
2
|
+
import { k as getRefValueType, h as generateId, ag as createModelsFromJson, Y as listCompleteSchemaFiles, ah as getLatestSchemaVersion, ai as createModelFromJson, M as Model, w as writeProcessMachine, n as loadSchemaFromFile, u as waitForEntityIdle, v as createReactiveProxy, x as findEntity, Z as loadAllSchemasFromDb, aj as ConflictError, J as getClient, ak as unloadEntity, al as clearDestroySubscriptions, y as forceRemoveFromCaches, z as runDestroyLifecycle, am as setupEntityLiveQuery } from './index-DjwIC6U3.js';
|
|
3
3
|
import { C as ClientManagerState } from './constants-CROrIRd-.js';
|
|
4
|
-
import { k as addSchemaToDb, c as addModelsToDb, l as loadModelsFromDbForSchema } from './db-
|
|
4
|
+
import { k as addSchemaToDb, c as addModelsToDb, l as loadModelsFromDbForSchema } from './db-DVsy4QZe.js';
|
|
5
5
|
import { a as BaseDb, s as schemas, m as models, i as modelSchemas, p as properties, B as BaseFileManager } from './BasePathResolver-0IHnXxtL.js';
|
|
6
6
|
import { eq, desc, and } from 'drizzle-orm';
|
|
7
7
|
import debug from 'debug';
|
|
8
|
-
import { SEED_PROTOCOL_SCHEMA_NAME, isInternalSchema } from './constants-
|
|
9
|
-
import { SchemaValidationService } from './SchemaValidationService-
|
|
8
|
+
import { SEED_PROTOCOL_SCHEMA_NAME, isInternalSchema } from './constants-Bre6dTJR.js';
|
|
9
|
+
import { SchemaValidationService } from './SchemaValidationService-BaOkRjsU.js';
|
|
10
10
|
import 'pluralize';
|
|
11
11
|
|
|
12
12
|
const logger$d = debug('seedSdk:schema:actors:loadOrCreateSchema');
|
|
@@ -51,7 +51,7 @@ const createModelInstances$2 = async (modelIds) => {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
const _mod_0 = await import('./index-
|
|
54
|
+
const _mod_0 = await import('./index-DjwIC6U3.js');
|
|
55
55
|
const _ns_0 = _mod_0.at;
|
|
56
56
|
const modelMod = _ns_0;
|
|
57
57
|
const { Model } = modelMod;
|
|
@@ -166,7 +166,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
166
166
|
// For Seed Protocol, always load from internal file, never create new
|
|
167
167
|
logger$d(`Loading internal Seed Protocol schema from SDK`);
|
|
168
168
|
try {
|
|
169
|
-
const _mod_1 = await import('./index-
|
|
169
|
+
const _mod_1 = await import('./index-DjwIC6U3.js');
|
|
170
170
|
const _ns_1 = _mod_1.as;
|
|
171
171
|
const internalSchema = _ns_1;
|
|
172
172
|
const schemaFile = internalSchema.default;
|
|
@@ -661,7 +661,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
661
661
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
662
662
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
663
663
|
try {
|
|
664
|
-
const _mod_2 = await import('./index-
|
|
664
|
+
const _mod_2 = await import('./index-DjwIC6U3.js');
|
|
665
665
|
const _ns_2 = _mod_2.as;
|
|
666
666
|
const internalSchema = _ns_2;
|
|
667
667
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -890,7 +890,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
890
890
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
891
891
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
892
892
|
try {
|
|
893
|
-
const _mod_3 = await import('./index-
|
|
893
|
+
const _mod_3 = await import('./index-DjwIC6U3.js');
|
|
894
894
|
const _ns_3 = _mod_3.as;
|
|
895
895
|
const internalSchema = _ns_3;
|
|
896
896
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -981,7 +981,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
981
981
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
982
982
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
983
983
|
try {
|
|
984
|
-
const _mod_4 = await import('./index-
|
|
984
|
+
const _mod_4 = await import('./index-DjwIC6U3.js');
|
|
985
985
|
const _ns_4 = _mod_4.as;
|
|
986
986
|
const internalSchema = _ns_4;
|
|
987
987
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -1069,7 +1069,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1069
1069
|
// If schemaData is missing, try to load from internal schema file for seed-protocol
|
|
1070
1070
|
if (!dbSchema.schemaData && schemaName === 'Seed Protocol') {
|
|
1071
1071
|
try {
|
|
1072
|
-
const _mod_5 = await import('./index-
|
|
1072
|
+
const _mod_5 = await import('./index-DjwIC6U3.js');
|
|
1073
1073
|
const _ns_5 = _mod_5.as;
|
|
1074
1074
|
const internalSchema = _ns_5;
|
|
1075
1075
|
const schemaFile = internalSchema.default;
|
|
@@ -1180,7 +1180,7 @@ const loadOrCreateSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1180
1180
|
// Ensure models are populated (fallback for seed-protocol if missing)
|
|
1181
1181
|
if ((!mergedModels || Object.keys(mergedModels).length === 0) && schemaName === 'Seed Protocol') {
|
|
1182
1182
|
try {
|
|
1183
|
-
const _mod_6 = await import('./index-
|
|
1183
|
+
const _mod_6 = await import('./index-DjwIC6U3.js');
|
|
1184
1184
|
const _ns_6 = _mod_6.as;
|
|
1185
1185
|
const internalSchema = _ns_6;
|
|
1186
1186
|
const internalSchemaFile = internalSchema.default;
|
|
@@ -2083,7 +2083,7 @@ const createModelInstances$1 = async (modelIds) => {
|
|
|
2083
2083
|
return;
|
|
2084
2084
|
}
|
|
2085
2085
|
try {
|
|
2086
|
-
const _mod_7 = await import('./index-
|
|
2086
|
+
const _mod_7 = await import('./index-DjwIC6U3.js');
|
|
2087
2087
|
const _ns_7 = _mod_7.at;
|
|
2088
2088
|
const mod = _ns_7;
|
|
2089
2089
|
const Model = mod?.Model ?? mod?.default;
|
|
@@ -2130,7 +2130,7 @@ const checkExistingSchema = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2130
2130
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
2131
2131
|
// For Seed Protocol, check if it exists in database
|
|
2132
2132
|
try {
|
|
2133
|
-
const _mod_8 = await import('./index-
|
|
2133
|
+
const _mod_8 = await import('./index-DjwIC6U3.js');
|
|
2134
2134
|
const _ns_8 = _mod_8.as;
|
|
2135
2135
|
const internalSchema = _ns_8;
|
|
2136
2136
|
const schemaFile = internalSchema.default;
|
|
@@ -2490,7 +2490,7 @@ const writeSchemaToDb = fromCallback(({ sendBack, input }) => {
|
|
|
2490
2490
|
if (isInternal && schemaName === SEED_PROTOCOL_SCHEMA_NAME) {
|
|
2491
2491
|
// For Seed Protocol, load from internal file
|
|
2492
2492
|
logger$b(`Loading internal Seed Protocol schema from SDK`);
|
|
2493
|
-
const _mod_9 = await import('./index-
|
|
2493
|
+
const _mod_9 = await import('./index-DjwIC6U3.js');
|
|
2494
2494
|
const _ns_9 = _mod_9.as;
|
|
2495
2495
|
const internalSchema = _ns_9;
|
|
2496
2496
|
finalSchema = internalSchema.default;
|
|
@@ -2960,7 +2960,7 @@ const createModelInstances = fromCallback(({ sendBack, input }) => {
|
|
|
2960
2960
|
return;
|
|
2961
2961
|
}
|
|
2962
2962
|
try {
|
|
2963
|
-
const _mod_10 = await import('./index-
|
|
2963
|
+
const _mod_10 = await import('./index-DjwIC6U3.js');
|
|
2964
2964
|
const _ns_10 = _mod_10.at;
|
|
2965
2965
|
const modelMod = _ns_10;
|
|
2966
2966
|
const { Model } = modelMod;
|
|
@@ -3048,7 +3048,7 @@ const verifyModelInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
3048
3048
|
}
|
|
3049
3049
|
try {
|
|
3050
3050
|
const result = await verifyWithRetry$2(async () => {
|
|
3051
|
-
const _mod_11 = await import('./index-
|
|
3051
|
+
const _mod_11 = await import('./index-DjwIC6U3.js');
|
|
3052
3052
|
const _ns_11 = _mod_11.at;
|
|
3053
3053
|
const modelMod = _ns_11;
|
|
3054
3054
|
const { Model } = modelMod;
|
|
@@ -3297,9 +3297,9 @@ const createPropertyInstances = fromCallback(({ sendBack, input }) => {
|
|
|
3297
3297
|
return;
|
|
3298
3298
|
}
|
|
3299
3299
|
try {
|
|
3300
|
-
const modProp = await import('./ModelProperty-
|
|
3300
|
+
const modProp = await import('./ModelProperty-BiDQu5rE.js');
|
|
3301
3301
|
const ModelProperty = modProp?.ModelProperty ?? modProp?.default;
|
|
3302
|
-
const _mod_13 = await import('./index-
|
|
3302
|
+
const _mod_13 = await import('./index-DjwIC6U3.js');
|
|
3303
3303
|
const _ns_13 = _mod_13.at;
|
|
3304
3304
|
const modModel = _ns_13;
|
|
3305
3305
|
const Model = modModel?.Model ?? modModel?.default;
|
|
@@ -3406,7 +3406,7 @@ const verifyPropertyInstancesInCache = fromCallback(({ sendBack, input }) => {
|
|
|
3406
3406
|
}
|
|
3407
3407
|
try {
|
|
3408
3408
|
const result = await verifyWithRetry(async () => {
|
|
3409
|
-
const mod = await import('./ModelProperty-
|
|
3409
|
+
const mod = await import('./ModelProperty-BiDQu5rE.js');
|
|
3410
3410
|
const ModelProperty = mod?.ModelProperty ?? mod?.default;
|
|
3411
3411
|
if (!ModelProperty) {
|
|
3412
3412
|
throw new Error('ModelProperty not available from dynamic import');
|
|
@@ -4428,7 +4428,7 @@ async function loadSchemaWithRenames(schemaFilePath, modelRenames) {
|
|
|
4428
4428
|
updatedAt: new Date(schemaFile.metadata.updatedAt).getTime(),
|
|
4429
4429
|
};
|
|
4430
4430
|
// Use dynamic import to break circular dependency
|
|
4431
|
-
const _mod_14 = await import('./db-
|
|
4431
|
+
const _mod_14 = await import('./db-DVsy4QZe.js');
|
|
4432
4432
|
const _ns_14 = _mod_14.q;
|
|
4433
4433
|
const dbMod = _ns_14;
|
|
4434
4434
|
const { addSchemaToDb, addModelsToDb } = dbMod;
|
|
@@ -4541,7 +4541,7 @@ async function renameModelProperty(schemaName, modelName, oldPropertyName, newPr
|
|
|
4541
4541
|
await BaseFileManager.waitForFileWithContent(newFilePath);
|
|
4542
4542
|
logger$1(`Renamed property ${oldPropertyName} to ${newPropertyName} in schema ${schemaName} v${newVersion}`);
|
|
4543
4543
|
// Migrate metadata rows so ItemProperty values follow the new name (prevents duplicate ItemProperties)
|
|
4544
|
-
const _mod_15 = await import('./db-
|
|
4544
|
+
const _mod_15 = await import('./db-DVsy4QZe.js');
|
|
4545
4545
|
const _ns_15 = _mod_15.q;
|
|
4546
4546
|
const { migrateMetadataForPropertyRename } = _ns_15;
|
|
4547
4547
|
const migratedCount = await migrateMetadataForPropertyRename(modelName, oldPropertyName, newPropertyName, oldProperty.id);
|
|
@@ -5752,7 +5752,7 @@ class Schema {
|
|
|
5752
5752
|
_dbVersion: publishedSchema.version,
|
|
5753
5753
|
});
|
|
5754
5754
|
// Clear edited flags on all ModelProperty instances and in database
|
|
5755
|
-
const modelPropertyMod = await import('./ModelProperty-
|
|
5755
|
+
const modelPropertyMod = await import('./ModelProperty-BiDQu5rE.js');
|
|
5756
5756
|
const { ModelProperty } = modelPropertyMod;
|
|
5757
5757
|
for (const propertyKey of context._editedProperties) {
|
|
5758
5758
|
const [modelName, propertyName] = propertyKey.split(':');
|
|
@@ -6555,4 +6555,4 @@ var Schema$1 = /*#__PURE__*/Object.freeze({
|
|
|
6555
6555
|
});
|
|
6556
6556
|
|
|
6557
6557
|
export { Schema as S, deletePropertyFromModel as a, Schema$1 as b, deleteModelFromSchema as d, renameModelProperty as r, schemaMachine as s, updateModelProperties as u };
|
|
6558
|
-
//# sourceMappingURL=Schema-
|
|
6558
|
+
//# sourceMappingURL=Schema-qciDB7Nu.js.map
|