@seedprotocol/sdk 0.1.37 → 0.1.40
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/{index-CsLLp7nN.js → index-B6e21b8Z.js} +40 -31
- package/dist/{index-CsLLp7nN.js.map → index-B6e21b8Z.js.map} +1 -1
- package/dist/{index-D3rzHFx5.js → index-BbMR37dq.js} +2 -2
- package/dist/index-BbMR37dq.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/{seed-DZ28dPJI.js → seed-C8LDZtnw.js} +3 -3
- package/dist/{seed-DZ28dPJI.js.map → seed-C8LDZtnw.js.map} +1 -1
- package/dist/{seed-DY1HnBke.js → seed-Dm6nbxxo.js} +3 -3
- package/dist/{seed-DY1HnBke.js.map → seed-Dm6nbxxo.js.map} +1 -1
- package/dist/{seed-B_KC4Qsr.js → seed-E3XylWTI.js} +2 -2
- package/dist/{seed-B_KC4Qsr.js.map → seed-E3XylWTI.js.map} +1 -1
- package/dist/{seed.schema.config-CcFj0B6S.js → seed.schema.config-cLeX7Oyb.js} +2 -2
- package/dist/{seed.schema.config-CcFj0B6S.js.map → seed.schema.config-cLeX7Oyb.js.map} +1 -1
- package/dist/types/src/browser/db/write.d.ts +2 -3
- package/dist/types/src/browser/db/write.d.ts.map +1 -1
- package/dist/types/src/browser/events/files/download.d.ts.map +1 -1
- package/dist/types/src/browser/item/class.d.ts +1 -1
- package/dist/types/src/browser/item/class.d.ts.map +1 -1
- package/dist/types/src/browser/item/single/actors/saveDataToDb.d.ts +55 -1
- package/dist/types/src/browser/item/single/actors/saveDataToDb.d.ts.map +1 -1
- package/dist/types/src/browser/item/single/itemMachineSingle.d.ts +56 -1
- package/dist/types/src/browser/item/single/itemMachineSingle.d.ts.map +1 -1
- package/dist/types/src/browser/property/actors/resolveRelatedValue.d.ts +1 -2
- package/dist/types/src/browser/property/actors/resolveRelatedValue.d.ts.map +1 -1
- package/dist/types/src/browser/property/actors/saveValueToDb.d.ts +1 -2
- package/dist/types/src/browser/property/actors/saveValueToDb.d.ts.map +1 -1
- package/dist/types/src/browser/property/class.d.ts +158 -13
- package/dist/types/src/browser/property/class.d.ts.map +1 -1
- package/dist/types/src/browser/schema/file/fetchAll/actors.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-D3rzHFx5.js.map +0 -1
|
@@ -984,7 +984,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
984
984
|
renderValue: refResolvedDisplayValue,
|
|
985
985
|
});
|
|
986
986
|
if (propertyNameFromDb === 'storageTransactionId') {
|
|
987
|
-
const { Item } = yield import('./index-
|
|
987
|
+
const { Item } = yield import('./index-BbMR37dq.js');
|
|
988
988
|
const item = yield Item.find({
|
|
989
989
|
seedLocalId,
|
|
990
990
|
modelName: itemModelName,
|
|
@@ -3355,31 +3355,37 @@ class Item {
|
|
|
3355
3355
|
});
|
|
3356
3356
|
}
|
|
3357
3357
|
static create(props) {
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3358
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3359
|
+
if (props.seedUid || props.seedLocalId) {
|
|
3360
|
+
const seedId = props.seedUid || props.seedLocalId;
|
|
3361
|
+
if (Item.instanceCache.has(seedId)) {
|
|
3362
|
+
const { instance, refCount } = Item.instanceCache.get(seedId);
|
|
3363
|
+
Item.instanceCache.set(seedId, {
|
|
3364
|
+
instance,
|
|
3365
|
+
refCount: refCount + 1,
|
|
3366
|
+
});
|
|
3367
|
+
return instance;
|
|
3368
|
+
}
|
|
3369
|
+
if (!Item.instanceCache.has(props.seedLocalId)) {
|
|
3370
|
+
const newInstance = new Item(props);
|
|
3371
|
+
Item.instanceCache.set(seedId, {
|
|
3372
|
+
instance: newInstance,
|
|
3373
|
+
refCount: 1,
|
|
3374
|
+
});
|
|
3375
|
+
return newInstance;
|
|
3376
|
+
}
|
|
3375
3377
|
}
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3378
|
+
const { seedLocalId } = yield createNewItem({
|
|
3379
|
+
modelName: props.modelName,
|
|
3380
|
+
});
|
|
3381
|
+
props.seedLocalId = seedLocalId;
|
|
3382
|
+
const newInstance = new Item(props);
|
|
3383
|
+
Item.instanceCache.set(newInstance.seedUid || newInstance.seedLocalId, {
|
|
3384
|
+
instance: newInstance,
|
|
3385
|
+
refCount: 1,
|
|
3386
|
+
});
|
|
3387
|
+
return newInstance;
|
|
3381
3388
|
});
|
|
3382
|
-
return newInstance;
|
|
3383
3389
|
}
|
|
3384
3390
|
static find(_b) {
|
|
3385
3391
|
return __awaiter(this, arguments, void 0, function* ({ modelName, seedLocalId, seedUid, }) {
|
|
@@ -3399,7 +3405,7 @@ class Item {
|
|
|
3399
3405
|
const itemsData = yield getItemsData(modelName);
|
|
3400
3406
|
const itemInstances = [];
|
|
3401
3407
|
for (const itemData of itemsData) {
|
|
3402
|
-
itemInstances.push(Item.create(Object.assign(Object.assign({}, itemData), { modelName })));
|
|
3408
|
+
itemInstances.push(yield Item.create(Object.assign(Object.assign({}, itemData), { modelName })));
|
|
3403
3409
|
}
|
|
3404
3410
|
return orderBy(itemInstances, ['createdAt'], ['desc']);
|
|
3405
3411
|
});
|
|
@@ -3409,6 +3415,9 @@ class Item {
|
|
|
3409
3415
|
props.storageTransactionId = this._storageTransactionId;
|
|
3410
3416
|
}
|
|
3411
3417
|
const propertyInstance = ItemProperty.create(props);
|
|
3418
|
+
if (!propertyInstance) {
|
|
3419
|
+
return;
|
|
3420
|
+
}
|
|
3412
3421
|
if (!propertyInstance.alias) {
|
|
3413
3422
|
this._service.send({
|
|
3414
3423
|
type: 'addPropertyInstance',
|
|
@@ -4353,7 +4362,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
4353
4362
|
if (!models$1) {
|
|
4354
4363
|
return;
|
|
4355
4364
|
}
|
|
4356
|
-
const { models: SeedModels } = yield import('./seed.schema.config-
|
|
4365
|
+
const { models: SeedModels } = yield import('./seed.schema.config-cLeX7Oyb.js');
|
|
4357
4366
|
const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
|
|
4358
4367
|
let hasModelsInDb = false;
|
|
4359
4368
|
const schemaDefsByModelName = new Map();
|
|
@@ -5238,7 +5247,7 @@ const downloadAllFilesBinaryRequestHandler = () => __awaiter(void 0, void 0, voi
|
|
|
5238
5247
|
if (res.status !== 200) {
|
|
5239
5248
|
logger$8(`[fetchAll/actors] [fetchAllBinaryData] error fetching transaction data for ${transactionId}`);
|
|
5240
5249
|
excludedTransactions.add(transactionId);
|
|
5241
|
-
yield writeAppState(
|
|
5250
|
+
yield writeAppState('excludedTransactions', JSON.stringify(Array.from(excludedTransactions)));
|
|
5242
5251
|
continue;
|
|
5243
5252
|
}
|
|
5244
5253
|
const dataString = yield arweave.transactions
|
|
@@ -5829,11 +5838,11 @@ const globalMachine = setup({
|
|
|
5829
5838
|
(_a) => __awaiter(void 0, [_a], void 0, function* ({ context }) {
|
|
5830
5839
|
let SeedClass;
|
|
5831
5840
|
if (context.environment === 'node') {
|
|
5832
|
-
const { SeedNode } = yield import('./seed-
|
|
5841
|
+
const { SeedNode } = yield import('./seed-C8LDZtnw.js');
|
|
5833
5842
|
SeedClass = SeedNode;
|
|
5834
5843
|
}
|
|
5835
5844
|
else {
|
|
5836
|
-
const { SeedBrowser } = yield import('./seed-
|
|
5845
|
+
const { SeedBrowser } = yield import('./seed-Dm6nbxxo.js');
|
|
5837
5846
|
SeedClass = SeedBrowser;
|
|
5838
5847
|
}
|
|
5839
5848
|
return SeedClass;
|
|
@@ -6634,7 +6643,7 @@ const client = {
|
|
|
6634
6643
|
console.error('fs listeners not ready during init');
|
|
6635
6644
|
}
|
|
6636
6645
|
globalService.send({ type: 'init', endpoints, models, addresses });
|
|
6637
|
-
import('./seed.schema.config-
|
|
6646
|
+
import('./seed.schema.config-cLeX7Oyb.js').then(({ models }) => {
|
|
6638
6647
|
for (const [key, value] of Object.entries(models)) {
|
|
6639
6648
|
setModel(key, value);
|
|
6640
6649
|
}
|
|
@@ -6691,4 +6700,4 @@ if (isNode()) {
|
|
|
6691
6700
|
}
|
|
6692
6701
|
|
|
6693
6702
|
export { CHILD_SNAPSHOT as C, GET_SCHEMAS as G, Item as I, Json as J, List as L, Model as M, Property as P, Relation as R, Text as T, GET_SEEDS as a, 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, ImageSrc as m, ItemProperty as n, useItem as o, useItemProperties as p, useCreateItem as q, useItemProperty as r, useDeleteItem as s, useGlobalServiceStatus as t, useItems as u, useServices as v, withSeed as w, getGlobalService as x, client as y, getCorrectId as z };
|
|
6694
|
-
//# sourceMappingURL=index-
|
|
6703
|
+
//# sourceMappingURL=index-B6e21b8Z.js.map
|