@seedprotocol/sdk 0.1.15 → 0.1.16

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/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { _ as __awaiter, D as DB_NAME_SDK_CONFIG, o as models, S as SCHEMA_NJK, p as SCHEMA_TS, q as SDK_DB_CONFIG, r as SEED_DB_CONFIG, A as APP_DB_CONFIG, s as addModelsToInternalDb } from './events-DgKqHqww.js';
2
+ import { _ as __awaiter, D as DB_NAME_SDK_CONFIG, o as models, S as SCHEMA_NJK, p as SCHEMA_TS, q as SDK_DB_CONFIG, r as SEED_DB_CONFIG, A as APP_DB_CONFIG, s as addModelsToInternalDb } from './events-Coj2v7ep.js';
3
3
  import path from 'path';
4
4
  import fs from 'fs';
5
5
  import { exec as exec$1 } from 'child_process';
@@ -17,7 +17,7 @@ import { camelCase, snakeCase } from 'lodash-es';
17
17
  import * as nunjucks from 'nunjucks';
18
18
  import Database from 'better-sqlite3';
19
19
  import { drizzle } from 'drizzle-orm/better-sqlite3';
20
- import './seed.schema.config-C9CEFOxM.js';
20
+ import './seed.schema.config-fpg0HLo5.js';
21
21
  import { defineConfig } from 'drizzle-kit';
22
22
  import dotenv from 'dotenv';
23
23
  import 'use-immer';
@@ -1617,7 +1617,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
1617
1617
  renderValue: refResolvedDisplayValue,
1618
1618
  });
1619
1619
  if (propertyNameFromDb === 'storageTransactionId') {
1620
- const { Item } = yield import('./index-CckG4Nv5.js');
1620
+ const { Item } = yield import('./index-DiVYILvi.js');
1621
1621
  const item = yield Item.find({
1622
1622
  seedLocalId,
1623
1623
  modelName: itemModelName,
@@ -4895,7 +4895,14 @@ const getServiceUniqueKey = (service) => {
4895
4895
  if (config.id.includes('@seedSdk/')) {
4896
4896
  uniqueKey = config.id.match(/^.*@seedSdk\/(\w+)[\.\w]*/)[1];
4897
4897
  }
4898
- const snapshot = service.getSnapshot();
4898
+ let snapshot;
4899
+ try {
4900
+ snapshot = service.getSnapshot();
4901
+ }
4902
+ catch (error) {
4903
+ console.error('Error:', error);
4904
+ return;
4905
+ }
4899
4906
  if (snapshot) {
4900
4907
  const context = snapshot.context;
4901
4908
  if (context && context.dbName) {
@@ -4916,6 +4923,9 @@ const useServices = () => {
4916
4923
  const actorsMap = new Map();
4917
4924
  useEffect(() => {
4918
4925
  const globalServiceListener = (event) => {
4926
+ if (event && event.type === 'init') {
4927
+ return;
4928
+ }
4919
4929
  if (event.actorRef &&
4920
4930
  event.actorRef.logic &&
4921
4931
  event.actorRef.logic.config) {
@@ -5278,7 +5288,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
5278
5288
  if (!models$1) {
5279
5289
  return;
5280
5290
  }
5281
- const { models: SeedModels } = yield import('./seed.schema.config-C9CEFOxM.js');
5291
+ const { models: SeedModels } = yield import('./seed.schema.config-fpg0HLo5.js');
5282
5292
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
5283
5293
  let hasModelsInDb = false;
5284
5294
  const schemaDefsByModelName = new Map();
@@ -6528,11 +6538,11 @@ const globalMachine = setup({
6528
6538
  (_a) => __awaiter(void 0, [_a], void 0, function* ({ context }) {
6529
6539
  let SeedClass;
6530
6540
  if (context.environment === 'node') {
6531
- const { SeedNode } = yield import('./seed-C8JBI4UL.js');
6541
+ const { SeedNode } = yield import('./seed-CnyxDQnB.js');
6532
6542
  SeedClass = SeedNode;
6533
6543
  }
6534
6544
  else {
6535
- const { SeedBrowser } = yield import('./seed-CJB6INNH.js');
6545
+ const { SeedBrowser } = yield import('./seed-D4FumM_8.js');
6536
6546
  SeedClass = SeedBrowser;
6537
6547
  }
6538
6548
  return SeedClass;
@@ -6637,4 +6647,4 @@ const setupServicesEventHandlers = () => {
6637
6647
  };
6638
6648
 
6639
6649
  export { useDeleteItem as $, APP_DB_CONFIG as A, setupFsListeners as B, CHILD_SNAPSHOT as C, DB_NAME_SDK_CONFIG as D, setupAllItemsEventHandlers as E, setupServicesEventHandlers as F, GET_SCHEMAS as G, globalService as H, Item as I, Json as J, getModel as K, List as L, Model as M, getModels as N, getModelNames as O, Property as P, areFsListenersReady as Q, Relation as R, SCHEMA_NJK as S, Text as T, ItemProperty as U, useItems as V, useItem as W, useItemProperties as X, useCreateItem as Y, useItemProperty as Z, __awaiter as _, GET_SEEDS as a, useServices as a0, getGlobalService as a1, getCorrectId as a2, GET_SEED_IDS as b, GET_STORAGE_TRANSACTION_ID as c, GET_VERSIONS as d, GET_PROPERTIES as e, GET_ALL_PROPERTIES_FOR_ALL_VERSIONS as f, itemMachineAll as g, internalMachine as h, itemMachineSingle as i, isNode as j, isBrowser as k, isReactNative as l, __decorate as m, __metadata as n, models as o, SCHEMA_TS as p, SDK_DB_CONFIG as q, SEED_DB_CONFIG as r, addModelsToInternalDb as s, ImageSrc as t, createNewMetadataFromExistingRecord as u, generateId as v, eventEmitter as w, getDb as x, DB_NAME_APP as y, setModel as z };
6640
- //# sourceMappingURL=events-DgKqHqww.js.map
6650
+ //# sourceMappingURL=events-Coj2v7ep.js.map