@seedprotocol/sdk 0.4.18 → 0.4.19

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.
Files changed (115) hide show
  1. package/dist/{ArweaveClient-CpShI0B0.js → ArweaveClient-CAdWVQnJ.js} +3 -3
  2. package/dist/{ArweaveClient-CpShI0B0.js.map → ArweaveClient-CAdWVQnJ.js.map} +1 -1
  3. package/dist/{ArweaveClient-WfxkMgxb.js → ArweaveClient-V62RJhsZ.js} +3 -3
  4. package/dist/{ArweaveClient-WfxkMgxb.js.map → ArweaveClient-V62RJhsZ.js.map} +1 -1
  5. package/dist/{Db-29bu0gJx.js → Db-8N3-le9a.js} +4 -4
  6. package/dist/{Db-29bu0gJx.js.map → Db-8N3-le9a.js.map} +1 -1
  7. package/dist/{Db-DWvxJG22.js → Db-DS2GBY6h.js} +133 -6
  8. package/dist/Db-DS2GBY6h.js.map +1 -0
  9. package/dist/{EasClient-BwBg9Kkd.js → EasClient-D1eibg8b.js} +2 -2
  10. package/dist/{EasClient-CtLqK_qz.js.map → EasClient-D1eibg8b.js.map} +1 -1
  11. package/dist/{EasClient-CtLqK_qz.js → EasClient-nOmY5meW.js} +2 -2
  12. package/dist/{EasClient-BwBg9Kkd.js.map → EasClient-nOmY5meW.js.map} +1 -1
  13. package/dist/{FileManager-DgraLHZS.js → FileManager-Cze8qmS1.js} +2 -2
  14. package/dist/{FileManager-DgraLHZS.js.map → FileManager-Cze8qmS1.js.map} +1 -1
  15. package/dist/{FileManager-DSihj6Sj.js → FileManager-DSTAwkqw.js} +2 -2
  16. package/dist/{FileManager-DSihj6Sj.js.map → FileManager-DSTAwkqw.js.map} +1 -1
  17. package/dist/{ModelProperty-Bz3V3LoI.js → ModelProperty-ChevZoUy.js} +24 -24
  18. package/dist/{ModelProperty-Bz3V3LoI.js.map → ModelProperty-ChevZoUy.js.map} +1 -1
  19. package/dist/{PathResolver-DOu-0k75.js → PathResolver-3TuYA9yv.js} +2 -2
  20. package/dist/{PathResolver-DOu-0k75.js.map → PathResolver-3TuYA9yv.js.map} +1 -1
  21. package/dist/{PathResolver-DQ5hyu8X.js → PathResolver-C5gj9EU2.js} +2 -2
  22. package/dist/{PathResolver-DQ5hyu8X.js.map → PathResolver-C5gj9EU2.js.map} +1 -1
  23. package/dist/{QueryClient-DYaqIx7e.js → QueryClient-BGv6JOls.js} +2 -2
  24. package/dist/{QueryClient-DYaqIx7e.js.map → QueryClient-BGv6JOls.js.map} +1 -1
  25. package/dist/{QueryClient-CJV1m2rc.js → QueryClient-By2vdhIz.js} +2 -2
  26. package/dist/{QueryClient-CJV1m2rc.js.map → QueryClient-By2vdhIz.js.map} +1 -1
  27. package/dist/{Schema-CFMbnImW.js → Schema-BQ5W3aOW.js} +38 -38
  28. package/dist/{Schema-CFMbnImW.js.map → Schema-BQ5W3aOW.js.map} +1 -1
  29. package/dist/{SchemaValidationService-D4ZVetLE.js → SchemaValidationService-DQx83Cte.js} +2 -2
  30. package/dist/{SchemaValidationService-D4ZVetLE.js.map → SchemaValidationService-DQx83Cte.js.map} +1 -1
  31. package/dist/{backfillMetadataPropertyIds-DptGKVzG.js → backfillMetadataPropertyIds-CMsU83q9.js} +2 -2
  32. package/dist/{backfillMetadataPropertyIds-DptGKVzG.js.map → backfillMetadataPropertyIds-CMsU83q9.js.map} +1 -1
  33. package/dist/cjs/{ModelProperty-TPey_B4m.js → ModelProperty-Cuj839nX.js} +17 -17
  34. package/dist/cjs/{ModelProperty-TPey_B4m.js.map → ModelProperty-Cuj839nX.js.map} +1 -1
  35. package/dist/cjs/{Schema-B-IQEtpX.js → Schema-TFe24NNG.js} +20 -20
  36. package/dist/cjs/{Schema-B-IQEtpX.js.map → Schema-TFe24NNG.js.map} +1 -1
  37. package/dist/cjs/{SchemaValidationService-IQ0Gc9HM.js → SchemaValidationService-DVQrRpse.js} +2 -2
  38. package/dist/cjs/{SchemaValidationService-IQ0Gc9HM.js.map → SchemaValidationService-DVQrRpse.js.map} +1 -1
  39. package/dist/cjs/{backfillMetadataPropertyIds-BBPgBc2W.js → backfillMetadataPropertyIds-BiXK4hT1.js} +2 -2
  40. package/dist/cjs/{backfillMetadataPropertyIds-BBPgBc2W.js.map → backfillMetadataPropertyIds-BiXK4hT1.js.map} +1 -1
  41. package/dist/cjs/{getItem-CWf0OO0F.js → getItem-FgLv9abh.js} +2 -2
  42. package/dist/cjs/{getItem-CWf0OO0F.js.map → getItem-FgLv9abh.js.map} +1 -1
  43. package/dist/cjs/{getPublishPayload-muuS1j0F.js → getPublishPayload-h_Rz8nVX.js} +18 -10
  44. package/dist/cjs/getPublishPayload-h_Rz8nVX.js.map +1 -0
  45. package/dist/cjs/{getPublishUploads-CONYV9QQ.js → getPublishUploads-DdSwst2x.js} +4 -4
  46. package/dist/cjs/{getPublishUploads-CONYV9QQ.js.map → getPublishUploads-DdSwst2x.js.map} +1 -1
  47. package/dist/cjs/{getSegmentedItemProperties-Dl3J_uCe.js → getSegmentedItemProperties-Bu4P_MG8.js} +3 -3
  48. package/dist/cjs/{getSegmentedItemProperties-Dl3J_uCe.js.map → getSegmentedItemProperties-Bu4P_MG8.js.map} +1 -1
  49. package/dist/cjs/{index-D7a8oFJP.js → index-CKJeh6ic.js} +3 -3
  50. package/dist/cjs/index-CKJeh6ic.js.map +1 -0
  51. package/dist/cjs/{index-Bte-I6OD.js → index-pyKmk9hA.js} +161 -38
  52. package/dist/cjs/index-pyKmk9hA.js.map +1 -0
  53. package/dist/cjs/{ownership-Bxv6CUrH.js → ownership-gfm5thj7.js} +2 -2
  54. package/dist/cjs/{ownership-Bxv6CUrH.js.map → ownership-gfm5thj7.js.map} +1 -1
  55. package/dist/cjs/{property-xOF5k4ka.js → property-Dw0b_Sf8.js} +4 -4
  56. package/dist/cjs/{property-xOF5k4ka.js.map → property-Dw0b_Sf8.js.map} +1 -1
  57. package/dist/db/drizzle/drizzle/0010_add_arweave_l1_finalize_jobs.sql +16 -0
  58. package/dist/db/drizzle/drizzle/meta/0010_snapshot.json +1182 -0
  59. package/dist/db/drizzle/drizzle/meta/_journal.json +7 -0
  60. package/dist/{getItem-Hubs_yxu.js → getItem-Bd9U9Yih.js} +2 -2
  61. package/dist/{getItem-Hubs_yxu.js.map → getItem-Bd9U9Yih.js.map} +1 -1
  62. package/dist/{getPublishPayload-CqUCIlu1.js → getPublishPayload-eJL7ktes.js} +21 -13
  63. package/dist/getPublishPayload-eJL7ktes.js.map +1 -0
  64. package/dist/{getPublishUploads-QgfPyhcs.js → getPublishUploads-CKm5dsL6.js} +4 -4
  65. package/dist/{getPublishUploads-QgfPyhcs.js.map → getPublishUploads-CKm5dsL6.js.map} +1 -1
  66. package/dist/{getSegmentedItemProperties-Dzscmm_m.js → getSegmentedItemProperties-B74LN_bz.js} +3 -3
  67. package/dist/{getSegmentedItemProperties-Dzscmm_m.js.map → getSegmentedItemProperties-B74LN_bz.js.map} +1 -1
  68. package/dist/{index-QSl4EYun.js → index-BQv2k74p.js} +3 -2
  69. package/dist/index-BQv2k74p.js.map +1 -0
  70. package/dist/{index-CtzvJMAE.js → index-BvZCYMxA.js} +188 -53
  71. package/dist/index-BvZCYMxA.js.map +1 -0
  72. package/dist/{index-VmIdPfTW.js → index-BxfqPvtu.js} +3 -3
  73. package/dist/index-BxfqPvtu.js.map +1 -0
  74. package/dist/main.cjs +1 -1
  75. package/dist/main.js +55 -14
  76. package/dist/main.js.map +1 -1
  77. package/dist/node.js +10 -10
  78. package/dist/{ownership-loPNh3_a.js → ownership-tVhYQomL.js} +2 -2
  79. package/dist/{ownership-loPNh3_a.js.map → ownership-tVhYQomL.js.map} +1 -1
  80. package/dist/{property-D8HimAKw.js → property-BOdk-wW1.js} +6 -6
  81. package/dist/{property-D8HimAKw.js.map → property-BOdk-wW1.js.map} +1 -1
  82. package/dist/{queries-DPADHnwy.js → queries-DBqVwEdv.js} +2 -2
  83. package/dist/{queries-DPADHnwy.js.map → queries-DBqVwEdv.js.map} +1 -1
  84. package/dist/seedSchema/ArweaveL1FinalizeSchema.ts +28 -0
  85. package/dist/seedSchema/index.d.ts +3 -0
  86. package/dist/seedSchema/index.ts +1 -0
  87. package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
  88. package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
  89. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  90. package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +12 -0
  91. package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +1 -0
  92. package/dist/src/eas.d.ts +6 -0
  93. package/dist/src/eas.d.ts.map +1 -1
  94. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
  95. package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts +46 -0
  96. package/dist/src/helpers/ArweaveClient/arweaveL1UploadApi.d.ts.map +1 -0
  97. package/dist/src/helpers/constants.d.ts +2 -0
  98. package/dist/src/helpers/constants.d.ts.map +1 -1
  99. package/dist/src/helpers/index.d.ts +1 -0
  100. package/dist/src/helpers/index.d.ts.map +1 -1
  101. package/dist/src/index.d.ts +6 -4
  102. package/dist/src/index.d.ts.map +1 -1
  103. package/dist/src/seedSchema/ArweaveL1FinalizeSchema.d.ts +233 -0
  104. package/dist/src/seedSchema/ArweaveL1FinalizeSchema.d.ts.map +1 -0
  105. package/dist/src/seedSchema/index.d.ts +1 -0
  106. package/dist/src/seedSchema/index.d.ts.map +1 -1
  107. package/package.json +1 -1
  108. package/dist/Db-DWvxJG22.js.map +0 -1
  109. package/dist/cjs/getPublishPayload-muuS1j0F.js.map +0 -1
  110. package/dist/cjs/index-Bte-I6OD.js.map +0 -1
  111. package/dist/cjs/index-D7a8oFJP.js.map +0 -1
  112. package/dist/getPublishPayload-CqUCIlu1.js.map +0 -1
  113. package/dist/index-CtzvJMAE.js.map +0 -1
  114. package/dist/index-QSl4EYun.js.map +0 -1
  115. package/dist/index-VmIdPfTW.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { fromCallback, setup, assign, createActor } from 'xstate';
2
2
  import 'reflect-metadata';
3
- import { o as BaseDb, ba as writeProcessMachine, y as models, z as properties, M as Model, C as modelPropertiesToObject, ae as schemas, a7 as modelSchemas, bb as getModelIdByFileId, n as normalizeDataType, aD as generateId, aP as waitForEntityIdle, bc as createReactiveProxy, bd as findEntity, u as BaseFileManager, be as forceRemoveFromCaches, bf as runDestroyLifecycle, bg as getModelId } from './index-CtzvJMAE.js';
3
+ import { o as BaseDb, ax as writeProcessMachine, y as models, z as properties, M as Model, C as modelPropertiesToObject, af as schemas, a8 as modelSchemas, ay as getModelIdByFileId, n as normalizeDataType, az as generateId, aA as waitForEntityIdle, aB as createReactiveProxy, aC as findEntity, u as BaseFileManager, aD as forceRemoveFromCaches, aE as runDestroyLifecycle, aF as getModelId } from './index-BvZCYMxA.js';
4
4
  import 'pluralize';
5
5
  import { eq, and } from 'drizzle-orm';
6
6
  import debug from 'debug';
7
- import { S as Schema } from './Schema-CFMbnImW.js';
7
+ import { S as Schema } from './Schema-BQ5W3aOW.js';
8
8
  import 'drizzle-orm/sqlite-core';
9
9
  import 'nanoid';
10
10
  import 'nanoid-dictionary';
@@ -16,7 +16,7 @@ import 'rxjs';
16
16
  import 'eventemitter3';
17
17
  import 'arweave';
18
18
  import 'js-sha3';
19
- import './SchemaValidationService-D4ZVetLE.js';
19
+ import './SchemaValidationService-DQx83Cte.js';
20
20
  import '@sinclair/typebox/value';
21
21
 
22
22
  const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
@@ -27,15 +27,15 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
27
27
  */
28
28
  async function getSchemaNameFromModel(modelName) {
29
29
  // Get the latest schema files and find which one contains this model
30
- const _mod_0 = await import('./index-CtzvJMAE.js');
31
- const _ns_0 = _mod_0.bw;
30
+ const _mod_0 = await import('./index-BvZCYMxA.js');
31
+ const _ns_0 = _mod_0.bD;
32
32
  const schemaHelpersMod = _ns_0;
33
33
  const { listLatestSchemaFiles } = schemaHelpersMod;
34
34
  const latestSchemas = await listLatestSchemaFiles();
35
35
  for (const schema of latestSchemas) {
36
36
  try {
37
- const _mod_1 = await import('./index-CtzvJMAE.js');
38
- const _ns_1 = _mod_1.bs;
37
+ const _mod_1 = await import('./index-BvZCYMxA.js');
38
+ const _ns_1 = _mod_1.bz;
39
39
  const fileManagerMod = _ns_1;
40
40
  const { BaseFileManager } = fileManagerMod;
41
41
  const content = await BaseFileManager.readFileAsString(schema.filePath);
@@ -54,7 +54,7 @@ async function getSchemaNameFromModel(modelName) {
54
54
  const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
55
55
  const _saveToSchema = async () => {
56
56
  // Use dynamic import to break circular dependency
57
- const validationServiceMod = await import('./SchemaValidationService-D4ZVetLE.js');
57
+ const validationServiceMod = await import('./SchemaValidationService-DQx83Cte.js');
58
58
  const { SchemaValidationService } = validationServiceMod;
59
59
  const validationService = new SchemaValidationService();
60
60
  // Validate property structure before saving
@@ -73,15 +73,15 @@ const saveToSchema = fromCallback(({ sendBack, input: { context } }) => {
73
73
  throw new Error(`Model not found for modelId: ${context.modelId}`);
74
74
  }
75
75
  // Persist to database only - schema file is updated only when user calls Schema.saveNewVersion()
76
- const _mod_2 = await import('./index-CtzvJMAE.js');
77
- const _ns_2 = _mod_2.bt;
76
+ const _mod_2 = await import('./index-BvZCYMxA.js');
77
+ const _ns_2 = _mod_2.bA;
78
78
  const dbMod = _ns_2;
79
79
  const { savePropertyToDb } = dbMod;
80
80
  await savePropertyToDb(context);
81
81
  // Mark schema as draft so user knows to save
82
82
  const schemaName = context._schemaName ?? (await getSchemaNameFromModel(context.modelName));
83
83
  if (schemaName) {
84
- const _mod_3 = await import('./Schema-CFMbnImW.js');
84
+ const _mod_3 = await import('./Schema-BQ5W3aOW.js');
85
85
  const _ns_3 = _mod_3.b;
86
86
  const schemaMod = _ns_3;
87
87
  const { Schema } = schemaMod;
@@ -116,8 +116,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
116
116
  const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
117
117
  if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
118
118
  try {
119
- const _mod_4 = await import('./index-CtzvJMAE.js');
120
- const _ns_4 = _mod_4.bt;
119
+ const _mod_4 = await import('./index-BvZCYMxA.js');
120
+ const _ns_4 = _mod_4.bA;
121
121
  const dbMod = _ns_4;
122
122
  const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
123
123
  let fromDb;
@@ -163,8 +163,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
163
163
  if (fullContext.modelName && fullContext.name && schemaFileId) {
164
164
  logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
165
165
  try {
166
- const _mod_5 = await import('./index-CtzvJMAE.js');
167
- const _ns_5 = _mod_5.bt;
166
+ const _mod_5 = await import('./index-BvZCYMxA.js');
167
+ const _ns_5 = _mod_5.bA;
168
168
  const dbMod = _ns_5;
169
169
  const { savePropertyToDb } = dbMod;
170
170
  // Ensure _propertyFileId is set for savePropertyToDb to find the property
@@ -225,8 +225,8 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
225
225
  logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
226
226
  logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
227
227
  // Use dynamic import to break circular dependency
228
- const _mod_6 = await import('./index-CtzvJMAE.js');
229
- const _ns_6 = _mod_6.bt;
228
+ const _mod_6 = await import('./index-BvZCYMxA.js');
229
+ const _ns_6 = _mod_6.bA;
230
230
  const dbMod = _ns_6;
231
231
  const { savePropertyToDb } = dbMod;
232
232
  // Save to database (but not JSON file) - always save to DB when there are changes
@@ -241,7 +241,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
241
241
  // Mark schema as draft if schema name is available
242
242
  if (fullContext._schemaName) {
243
243
  // Get the Schema instance and mark it as draft
244
- const _mod_7 = await import('./Schema-CFMbnImW.js');
244
+ const _mod_7 = await import('./Schema-BQ5W3aOW.js');
245
245
  const _ns_7 = _mod_7.b;
246
246
  const schemaMod = _ns_7;
247
247
  const { Schema } = schemaMod;
@@ -260,7 +260,7 @@ const compareAndMarkDraft = fromCallback(({ sendBack, input: { context } }) => {
260
260
  logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
261
261
  // Clear isEdited flag in database
262
262
  try {
263
- const _mod_8 = await import('./index-QSl4EYun.js');
263
+ const _mod_8 = await import('./index-BQv2k74p.js');
264
264
  const _ns_8 = _mod_8.s;
265
265
  const seedSchemaMod = _ns_8;
266
266
  const { properties: propertiesTable, models: modelsTable } = seedSchemaMod;
@@ -326,8 +326,8 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
326
326
  // Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
327
327
  await new Promise((r) => setTimeout(r, 60));
328
328
  try {
329
- const _mod_9 = await import('./index-CtzvJMAE.js');
330
- const _ns_9 = _mod_9.bt;
329
+ const _mod_9 = await import('./index-BvZCYMxA.js');
330
+ const _ns_9 = _mod_9.bA;
331
331
  const dbMod = _ns_9;
332
332
  const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
333
333
  // Try pending write first (property row may not exist yet)
@@ -380,10 +380,10 @@ const validateProperty = fromCallback(({ sendBack, input: { context } }) => {
380
380
  fullContext = { ...fullContext, dataType: (fullContext.dataType ?? context._originalValues?.dataType) || 'Text' };
381
381
  }
382
382
  // Use dynamic imports to break circular dependencies
383
- const validationServiceMod = await import('./SchemaValidationService-D4ZVetLE.js');
383
+ const validationServiceMod = await import('./SchemaValidationService-DQx83Cte.js');
384
384
  const { SchemaValidationService } = validationServiceMod;
385
385
  const validationService = new SchemaValidationService();
386
- const _mod_10 = await import('./Schema-CFMbnImW.js');
386
+ const _mod_10 = await import('./Schema-BQ5W3aOW.js');
387
387
  const _ns_10 = _mod_10.b;
388
388
  const schemaMod = _ns_10;
389
389
  const { Schema } = schemaMod;
@@ -1769,4 +1769,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
1769
1769
  });
1770
1770
 
1771
1771
  export { ModelProperty };
1772
- //# sourceMappingURL=ModelProperty-Bz3V3LoI.js.map
1772
+ //# sourceMappingURL=ModelProperty-ChevZoUy.js.map