@seedprotocol/sdk 0.2.51 → 0.2.53
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/{ArweaveClient-D1TsTBoj.js → ArweaveClient-D5iJisYr.js} +2 -2
- package/dist/{ArweaveClient-DpdXUcVJ.js.map → ArweaveClient-D5iJisYr.js.map} +1 -1
- package/dist/{ArweaveClient-DpdXUcVJ.js → ArweaveClient-HEIIuOfB.js} +2 -2
- package/dist/{ArweaveClient-D1TsTBoj.js.map → ArweaveClient-HEIIuOfB.js.map} +1 -1
- package/dist/{Db-quJxmvHH.js → Db-Bh_lvrAN.js} +6 -3
- package/dist/Db-Bh_lvrAN.js.map +1 -0
- package/dist/{Db-DMJ0v3gO.js → Db-DqBP6XK2.js} +3 -3
- package/dist/{Db-DMJ0v3gO.js.map → Db-DqBP6XK2.js.map} +1 -1
- package/dist/{EasClient-ClZDuT3o.js → EasClient-D3wKgt0o.js} +2 -2
- package/dist/{EasClient-DfnGY_2X.js.map → EasClient-D3wKgt0o.js.map} +1 -1
- package/dist/{EasClient-DfnGY_2X.js → EasClient-jqkT2ZBt.js} +2 -2
- package/dist/{EasClient-ClZDuT3o.js.map → EasClient-jqkT2ZBt.js.map} +1 -1
- package/dist/{FileManager-texI7UwL.js → FileManager-4mWYO3Mt.js} +3 -5
- package/dist/FileManager-4mWYO3Mt.js.map +1 -0
- package/dist/{Item-D4n439Ei.js → Item-COP3FuaU.js} +3 -3
- package/dist/{Item-D4n439Ei.js.map → Item-COP3FuaU.js.map} +1 -1
- package/dist/{ItemProperty-Be5ymRVT.js → ItemProperty-BFn9wM65.js} +3 -3
- package/dist/{ItemProperty-Be5ymRVT.js.map → ItemProperty-BFn9wM65.js.map} +1 -1
- package/dist/{QueryClient-B1HkAaJo.js → QueryClient-CBOP3OoU.js} +2 -2
- package/dist/{QueryClient-B1HkAaJo.js.map → QueryClient-CBOP3OoU.js.map} +1 -1
- package/dist/{QueryClient-BPoc9eBn.js → QueryClient-bKb3SB0W.js} +2 -2
- package/dist/{QueryClient-BPoc9eBn.js.map → QueryClient-bKb3SB0W.js.map} +1 -1
- package/dist/bin.js +5 -5
- package/dist/{constants-5PxfAeqj.js → constants-CIDbABDz.js} +2 -2
- package/dist/{constants-5PxfAeqj.js.map → constants-CIDbABDz.js.map} +1 -1
- package/dist/{index-BLla2o05.js → index-C4xqqsLw.js} +3 -3
- package/dist/index-C4xqqsLw.js.map +1 -0
- package/dist/{index-BeKRizLf.js → index-CLvyWg5f.js} +257 -145
- package/dist/index-CLvyWg5f.js.map +1 -0
- package/dist/main.js +2 -2
- package/dist/package.json +189 -0
- package/dist/{seed.schema.config-CMpV_hyS.js → seed.schema.config-Bao3o6wu.js} +3 -3
- package/dist/{seed.schema.config-CMpV_hyS.js.map → seed.schema.config-Bao3o6wu.js.map} +1 -1
- package/dist/types/src/client/BaseClientManager.d.ts +7 -0
- package/dist/types/src/client/BaseClientManager.d.ts.map +1 -0
- package/dist/types/src/client/actions/setAddresses.d.ts +2 -0
- package/dist/types/src/client/actions/setAddresses.d.ts.map +1 -0
- package/dist/types/src/client/actors/initialize.d.ts +4 -0
- package/dist/types/src/client/actors/initialize.d.ts.map +1 -0
- package/dist/types/src/client/actors/saveAppState.d.ts +5 -0
- package/dist/types/src/client/actors/saveAppState.d.ts.map +1 -0
- package/dist/types/src/client/clientManagerMachine.d.ts +19 -0
- package/dist/types/src/client/clientManagerMachine.d.ts.map +1 -0
- package/dist/types/src/client/index.d.ts +41 -0
- package/dist/types/src/client/index.d.ts.map +1 -0
- package/dist/types/src/client.d.ts.map +1 -1
- package/dist/types/src/node/db/Db.d.ts.map +1 -1
- package/dist/types/src/node/helpers/FileManager.d.ts.map +1 -1
- package/dist/types/src/services/internal/actors/validateInput.d.ts.map +1 -1
- package/dist/types/src/types/machines.d.ts +5 -0
- package/dist/types/src/types/machines.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/Db-quJxmvHH.js.map +0 -1
- package/dist/FileManager-texI7UwL.js.map +0 -1
- package/dist/index-BLla2o05.js.map +0 -1
- package/dist/index-BeKRizLf.js.map +0 -1
- package/dist/src/AppStateSchema.ts +0 -10
- package/dist/src/ArweaveClient.ts +0 -13
- package/dist/src/Attestation.ts +0 -21
- package/dist/src/BaseArweaveClient.ts +0 -13
- package/dist/src/BaseDb.ts +0 -35
- package/dist/src/BaseEasClient.ts +0 -13
- package/dist/src/BaseFileManager.ts +0 -56
- package/dist/src/BaseItem.ts +0 -413
- package/dist/src/BaseItemProperty.ts +0 -416
- package/dist/src/BaseQueryClient.ts +0 -13
- package/dist/src/ConfigSchema.ts +0 -15
- package/dist/src/Db.ts +0 -78
- package/dist/src/EasClient.ts +0 -13
- package/dist/src/FileDownloader.ts +0 -63
- package/dist/src/FileManager.ts +0 -57
- package/dist/src/IDb.ts +0 -7
- package/dist/src/IEasClient.ts +0 -2
- package/dist/src/IItem.ts +0 -26
- package/dist/src/IItemProperty.ts +0 -28
- package/dist/src/IQueryClient.ts +0 -4
- package/dist/src/ImageResizer.ts +0 -81
- package/dist/src/Item.ts +0 -12
- package/dist/src/ItemProperty.ts +0 -9
- package/dist/src/MetadataSchema.ts +0 -28
- package/dist/src/ModelSchema.ts +0 -46
- package/dist/src/ModelUidSchema.ts +0 -16
- package/dist/src/PropertyUidSchema.ts +0 -16
- package/dist/src/QueryClient.ts +0 -22
- package/dist/src/Schema.ts +0 -17
- package/dist/src/SeedProtocolSdk.d.ts +0 -19
- package/dist/src/SeedSchema.ts +0 -29
- package/dist/src/VersionSchema.ts +0 -16
- package/dist/src/actors.ts +0 -295
- package/dist/src/addModelsToDb.ts +0 -152
- package/dist/src/allItems.ts +0 -31
- package/dist/src/analyzeInput.ts +0 -144
- package/dist/src/browser.app.db.config.ts +0 -27
- package/dist/src/browser.ts +0 -30
- package/dist/src/checkStatus.ts +0 -50
- package/dist/src/client.ts +0 -148
- package/dist/src/configureFs.ts +0 -94
- package/dist/src/connectToDb.ts +0 -41
- package/dist/src/connectionManager.ts +0 -67
- package/dist/src/constants.ts +0 -125
- package/dist/src/content-hash.ts +0 -30
- package/dist/src/create.ts +0 -39
- package/dist/src/createMetadata.ts +0 -77
- package/dist/src/createNewItem.ts +0 -61
- package/dist/src/createPublishAttempt.ts +0 -16
- package/dist/src/createSeed.ts +0 -31
- package/dist/src/createSeeds.ts +0 -24
- package/dist/src/createVersion.ts +0 -33
- package/dist/src/dbMachine.ts +0 -182
- package/dist/src/deleteItem.ts +0 -19
- package/dist/src/download.ts +0 -202
- package/dist/src/drizzle.ts +0 -78
- package/dist/src/eas.ts +0 -40
- package/dist/src/environment.ts +0 -35
- package/dist/src/eventBus.ts +0 -5
- package/dist/src/events.ts +0 -14
- package/dist/src/fetchDataFromEas.ts +0 -94
- package/dist/src/fetchDbData.ts +0 -19
- package/dist/src/fetchRelatedItems.ts +0 -184
- package/dist/src/fetchSeeds.ts +0 -52
- package/dist/src/fetchVersions.ts +0 -49
- package/dist/src/files.ts +0 -81
- package/dist/src/filesDownload.ts +0 -326
- package/dist/src/fragment-masking.ts +0 -87
- package/dist/src/getExistingItem.ts +0 -60
- package/dist/src/getItem.ts +0 -32
- package/dist/src/getItemData.ts +0 -99
- package/dist/src/getItemProperties.ts +0 -56
- package/dist/src/getItemProperty.ts +0 -34
- package/dist/src/getItems.ts +0 -70
- package/dist/src/getMetadata.ts +0 -40
- package/dist/src/getModelSchemas.ts +0 -89
- package/dist/src/getPropertyData.ts +0 -50
- package/dist/src/getPublishPayload.ts +0 -355
- package/dist/src/getPublishUploads.ts +0 -207
- package/dist/src/getRelationValueData.ts +0 -27
- package/dist/src/getSchemaForItemProperty.ts +0 -68
- package/dist/src/getSchemaForModel.ts +0 -42
- package/dist/src/getSchemaUidForModel.ts +0 -32
- package/dist/src/getSeedData.ts +0 -34
- package/dist/src/getSegmentedItemProperties.ts +0 -65
- package/dist/src/getStorageTransactionIdForSeedUid.ts +0 -38
- package/dist/src/getVersionData.ts +0 -46
- package/dist/src/getVersionsForVersionUids.ts +0 -39
- package/dist/src/globalMachine.ts +0 -280
- package/dist/src/gql.ts +0 -118
- package/dist/src/graphql.ts +0 -3209
- package/dist/src/helpers.ts +0 -273
- package/dist/src/hydrateExistingItem.ts +0 -137
- package/dist/src/hydrateFromDb.ts +0 -270
- package/dist/src/hydrateNewItem.ts +0 -34
- package/dist/src/imageResize.ts +0 -507
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.ts +0 -4
- package/dist/src/initialize.ts +0 -124
- package/dist/src/internalMachine.ts +0 -238
- package/dist/src/itemMachineAll.ts +0 -157
- package/dist/src/itemMachineSingle.ts +0 -158
- package/dist/src/loadAppDb.ts +0 -47
- package/dist/src/machines.ts +0 -60
- package/dist/src/metadataLatest.ts +0 -34
- package/dist/src/migrate.ts +0 -53
- package/dist/src/model.ts +0 -72
- package/dist/src/modelClass.ts +0 -19
- package/dist/src/node.app.db.config.ts +0 -41
- package/dist/src/prepareDb.ts +0 -29
- package/dist/src/preparePublishRequestData.ts +0 -81
- package/dist/src/processItems.ts +0 -74
- package/dist/src/property.ts +0 -156
- package/dist/src/propertyMachine.ts +0 -202
- package/dist/src/publish.ts +0 -28
- package/dist/src/publishMachine.ts +0 -77
- package/dist/src/queries.ts +0 -13
- package/dist/src/recoverDeletedItem.ts +0 -14
- package/dist/src/reload.ts +0 -33
- package/dist/src/request.ts +0 -45
- package/dist/src/requestAll.ts +0 -157
- package/dist/src/resolveRelatedValue.ts +0 -367
- package/dist/src/resolveRemoteStorage.ts +0 -88
- package/dist/src/saveAppState.ts +0 -19
- package/dist/src/saveConfig.ts +0 -88
- package/dist/src/saveDataToDb.ts +0 -145
- package/dist/src/saveImageSrc.ts +0 -242
- package/dist/src/saveItemStorage.ts +0 -156
- package/dist/src/saveMetadata.ts +0 -18
- package/dist/src/savePublishService.ts +0 -30
- package/dist/src/saveRelation.ts +0 -112
- package/dist/src/seed.schema.config.ts +0 -25
- package/dist/src/seed.ts +0 -10
- package/dist/src/seedProtocol.ts +0 -17
- package/dist/src/services.ts +0 -365
- package/dist/src/sqlWasmClient.ts +0 -88
- package/dist/src/syncDbWithEas.ts +0 -628
- package/dist/src/trash.ts +0 -29
- package/dist/src/ts-to-proto.ts +0 -101
- package/dist/src/types.ts +0 -12
- package/dist/src/updateItemPropertyValue.ts +0 -243
- package/dist/src/updateMachineContext.ts +0 -21
- package/dist/src/updateMetadata.ts +0 -59
- package/dist/src/upload.ts +0 -86
- package/dist/src/validate.ts +0 -45
- package/dist/src/validateInput.ts +0 -47
- package/dist/src/validateItemData.ts +0 -20
- package/dist/src/versionData.ts +0 -24
- package/dist/src/waitForDb.ts +0 -25
- package/dist/src/waitForFiles.ts +0 -34
- package/dist/src/wasm.d.ts +0 -8300
|
@@ -2,7 +2,7 @@ import { immerable, produce, enableMapSet } from 'immer';
|
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import { Type } from '@sinclair/typebox';
|
|
4
4
|
import { fromCallback, setup, assign, waitFor, createActor, raise } from 'xstate';
|
|
5
|
-
import {
|
|
5
|
+
import { c as BaseQueryClient, a as BaseEasClient, G as GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY, f as GLOBAL_INITIALIZING_SEND_CONFIG, g as GLOBAL_INITIALIZING_CREATE_ALL_ITEMS_SERVICES, h as GLOBAL_ADDING_MODELS_TO_DB_SUCCESS, D as DB_CHECK_STATUS_UPDATE_PATHS, i as DB_CHECK_STATUS_EXISTS, d as BROWSER_FS_TOP_DIR, j as DB_CREATING_SUCCESS, k as DB_VALIDATING_SUCCESS, l as DB_VALIDATING_WAIT, b as BaseFileManager, m as DB_MIGRATING_SUCCESS, n as DB_WAITING_FOR_FILES_RECEIVED, M as MachineIds, o as DB_MIGRATING_WAIT, p as DbState, I as INTERNAL_VALIDATING_INPUT_SUCCESS, q as ARWEAVE_HOST, B as BaseArweaveClient, r as INTERNAL_CONFIGURING_FS_SUCCESS, s as INTERNAL_SAVING_CONFIG_SUCCESS, t as INTERNAL_LOADING_APP_DB_SUCCESS, u as DB_ON_SNAPSHOT, v as DB_NAME_APP, w as InternalState, P as PublishMachineStates, x as GlobalState, y as INTERNAL_DATA_TYPES, z as ImageSize, C as internalPropertyNames, V as VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA, F as defaultAttestationData } from './constants-CIDbABDz.js';
|
|
6
6
|
import debug from 'debug';
|
|
7
7
|
import pluralize from 'pluralize';
|
|
8
8
|
import { sqliteTable, text, int, unique } from 'drizzle-orm/sqlite-core';
|
|
@@ -259,7 +259,7 @@ const getExistingItem = async ({ seedLocalId, seedUid, }) => {
|
|
|
259
259
|
return matchingRow;
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
-
const initialize$
|
|
262
|
+
const initialize$4 = fromCallback(({ sendBack, input: { context } }) => {
|
|
263
263
|
const { seedLocalId, seedUid, ModelClass } = context;
|
|
264
264
|
if (!ModelClass) {
|
|
265
265
|
throw new Error('ModelClass is required');
|
|
@@ -294,7 +294,7 @@ const initialize$3 = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
294
294
|
|
|
295
295
|
const eventEmitter = new EventEmitter();
|
|
296
296
|
|
|
297
|
-
const logger$
|
|
297
|
+
const logger$s = debug('app:shared:helpers');
|
|
298
298
|
const { alphanumeric } = nanoIdDictionary;
|
|
299
299
|
const generateId = () => {
|
|
300
300
|
return customAlphabet(alphanumeric, 10)();
|
|
@@ -351,7 +351,7 @@ const convertTxIdToImageSrc = async (txId) => {
|
|
|
351
351
|
const imageFilePath = `/files/images/${txId}`;
|
|
352
352
|
const fileExists = await fs.promises.exists(imageFilePath);
|
|
353
353
|
if (!fileExists) {
|
|
354
|
-
logger$
|
|
354
|
+
logger$s(`[ItemView] [updateImageSrc] ${imageFilePath} does not exist`);
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
357
|
const uint = await fs.promises.readFile(imageFilePath);
|
|
@@ -1233,8 +1233,8 @@ const getEnvironment = () => {
|
|
|
1233
1233
|
return 'node';
|
|
1234
1234
|
};
|
|
1235
1235
|
|
|
1236
|
-
const logger$
|
|
1237
|
-
const initialize$
|
|
1236
|
+
const logger$r = debug('app:services:global:actors:initialize');
|
|
1237
|
+
const initialize$3 = fromCallback(({ sendBack, input: { event, context } }) => {
|
|
1238
1238
|
const { internalService, models, endpoints, arweaveDomain, addresses, } = context;
|
|
1239
1239
|
if (!internalService) {
|
|
1240
1240
|
throw new Error('internalService is required');
|
|
@@ -1252,7 +1252,7 @@ const initialize$2 = fromCallback(({ sendBack, input: { event, context } }) => {
|
|
|
1252
1252
|
const _initInternal = async () => {
|
|
1253
1253
|
return new Promise((resolve) => {
|
|
1254
1254
|
internalSubscription = internalService.subscribe((snapshot) => {
|
|
1255
|
-
logger$
|
|
1255
|
+
logger$r('[sdk] [internal] snapshot', snapshot);
|
|
1256
1256
|
if (snapshot.value === 'ready') {
|
|
1257
1257
|
resolve();
|
|
1258
1258
|
}
|
|
@@ -1297,7 +1297,7 @@ const initialize$2 = fromCallback(({ sendBack, input: { event, context } }) => {
|
|
|
1297
1297
|
await fetchSchemaUids();
|
|
1298
1298
|
};
|
|
1299
1299
|
_initFileSystem().then(() => {
|
|
1300
|
-
logger$
|
|
1300
|
+
logger$r('[global/actors] File system initialized');
|
|
1301
1301
|
});
|
|
1302
1302
|
_initInternal()
|
|
1303
1303
|
.then(() => {
|
|
@@ -1307,7 +1307,7 @@ const initialize$2 = fromCallback(({ sendBack, input: { event, context } }) => {
|
|
|
1307
1307
|
return _initEas();
|
|
1308
1308
|
})
|
|
1309
1309
|
.then(() => {
|
|
1310
|
-
logger$
|
|
1310
|
+
logger$r('[global/actors] Internal initialized');
|
|
1311
1311
|
sendBack({ type: GLOBAL_INITIALIZING_INTERNAL_SERVICE_READY });
|
|
1312
1312
|
internalSubscription?.unsubscribe();
|
|
1313
1313
|
});
|
|
@@ -1320,7 +1320,7 @@ const initialize$2 = fromCallback(({ sendBack, input: { event, context } }) => {
|
|
|
1320
1320
|
};
|
|
1321
1321
|
});
|
|
1322
1322
|
|
|
1323
|
-
const logger$
|
|
1323
|
+
const logger$q = debug('app:services:global:actors:getSchemaForModel');
|
|
1324
1324
|
const getSchemaForModel = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
1325
1325
|
const { modelName } = event;
|
|
1326
1326
|
if (!modelName) {
|
|
@@ -1336,12 +1336,12 @@ const getSchemaForModel = fromCallback(({ sendBack, input: { context, event } })
|
|
|
1336
1336
|
if (!model) {
|
|
1337
1337
|
throw new Error(`Model ${modelName} not found`);
|
|
1338
1338
|
}
|
|
1339
|
-
logger$
|
|
1339
|
+
logger$q('[service/actor] [getSchemaForModel] model:', model);
|
|
1340
1340
|
sendBack({ type: 'schemaForModel', schema: model.schema });
|
|
1341
1341
|
return () => { };
|
|
1342
1342
|
});
|
|
1343
1343
|
|
|
1344
|
-
const logger$
|
|
1344
|
+
const logger$p = debug('app:services:global:actors:addModelsToDb');
|
|
1345
1345
|
const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
1346
1346
|
const { models: models$1 } = context;
|
|
1347
1347
|
const _addModelsToDb = async () => {
|
|
@@ -1349,7 +1349,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1349
1349
|
if (!models$1) {
|
|
1350
1350
|
return;
|
|
1351
1351
|
}
|
|
1352
|
-
const { models: SeedModels } = await import('./seed.schema.config-
|
|
1352
|
+
const { models: SeedModels } = await import('./seed.schema.config-Bao3o6wu.js');
|
|
1353
1353
|
const allModels = {
|
|
1354
1354
|
...SeedModels,
|
|
1355
1355
|
...models$1,
|
|
@@ -1357,7 +1357,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1357
1357
|
let hasModelsInDb = false;
|
|
1358
1358
|
const schemaDefsByModelName = new Map();
|
|
1359
1359
|
for (const [modelName, _] of Object.entries(allModels)) {
|
|
1360
|
-
logger$
|
|
1360
|
+
logger$p('[helpers/db] [addModelsToInternalDb] starting modelName:', modelName);
|
|
1361
1361
|
let foundModel;
|
|
1362
1362
|
const foundModelsQuery = await appDb
|
|
1363
1363
|
.select()
|
|
@@ -1367,7 +1367,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1367
1367
|
await appDb.insert(models).values({
|
|
1368
1368
|
name: modelName,
|
|
1369
1369
|
});
|
|
1370
|
-
logger$
|
|
1370
|
+
logger$p('[global/actors] [addModelsToDb] inserted model:', modelName);
|
|
1371
1371
|
const foundModels = await appDb
|
|
1372
1372
|
.select({
|
|
1373
1373
|
id: models.id,
|
|
@@ -1437,10 +1437,10 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1437
1437
|
return () => { };
|
|
1438
1438
|
});
|
|
1439
1439
|
|
|
1440
|
-
const logger$
|
|
1440
|
+
const logger$o = debug('app:services:db:actors:checkStatus');
|
|
1441
1441
|
const checkStatus = fromCallback(({ sendBack, input: { context } }) => {
|
|
1442
1442
|
const { dbName } = context;
|
|
1443
|
-
logger$
|
|
1443
|
+
logger$o('[db/actors] checkStatus context', context);
|
|
1444
1444
|
const pathToDir = `${BROWSER_FS_TOP_DIR}`;
|
|
1445
1445
|
const pathToDbDir = `${pathToDir}/db`;
|
|
1446
1446
|
const pathToDb = `${pathToDbDir}/${dbName}.sqlite3`;
|
|
@@ -1471,9 +1471,9 @@ const checkStatus = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1471
1471
|
});
|
|
1472
1472
|
});
|
|
1473
1473
|
|
|
1474
|
-
const logger$
|
|
1474
|
+
const logger$n = debug('app:services:db:actors:connectToDb');
|
|
1475
1475
|
const connectToDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
1476
|
-
logger$
|
|
1476
|
+
logger$n('[db/actors] connectToDb context', context);
|
|
1477
1477
|
const { dbName, pathToDir } = context;
|
|
1478
1478
|
if (!pathToDir || !dbName) {
|
|
1479
1479
|
throw new Error('pathToDir and dbName are required');
|
|
@@ -1526,7 +1526,7 @@ const validate = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
1526
1526
|
});
|
|
1527
1527
|
});
|
|
1528
1528
|
|
|
1529
|
-
const saveAppState = async (key, value) => {
|
|
1529
|
+
const saveAppState$1 = async (key, value) => {
|
|
1530
1530
|
const appDb = BaseDb.getAppDb();
|
|
1531
1531
|
await appDb
|
|
1532
1532
|
.insert(appState)
|
|
@@ -1802,7 +1802,7 @@ class FileDownloader {
|
|
|
1802
1802
|
localExcludedTransactions.add(e.data.transactionId);
|
|
1803
1803
|
}
|
|
1804
1804
|
if (e.data.done) {
|
|
1805
|
-
saveAppState('excludedTransactions', JSON.stringify(Array.from(localExcludedTransactions)))
|
|
1805
|
+
saveAppState$1('excludedTransactions', JSON.stringify(Array.from(localExcludedTransactions)))
|
|
1806
1806
|
.then(() => {
|
|
1807
1807
|
resolve(e.data);
|
|
1808
1808
|
})
|
|
@@ -2256,7 +2256,7 @@ class ImageResizer {
|
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
2258
|
|
|
2259
|
-
const logger$
|
|
2259
|
+
const logger$m = debug('app:browser:helpers:FileManager');
|
|
2260
2260
|
class FileManager extends BaseFileManager {
|
|
2261
2261
|
static async readFileAsBuffer(filePath) {
|
|
2262
2262
|
return new Promise((resolve, reject) => {
|
|
@@ -2362,7 +2362,7 @@ class FileManager extends BaseFileManager {
|
|
|
2362
2362
|
const startTime = Date.now();
|
|
2363
2363
|
let isBusy = false;
|
|
2364
2364
|
const cancelableInterval = new CancelableInterval(async (stop) => {
|
|
2365
|
-
logger$
|
|
2365
|
+
logger$m('waitForFile', filePath);
|
|
2366
2366
|
if (isBusy) {
|
|
2367
2367
|
return;
|
|
2368
2368
|
}
|
|
@@ -2522,10 +2522,10 @@ var FileManager$1 = /*#__PURE__*/Object.freeze({
|
|
|
2522
2522
|
FileManager: FileManager
|
|
2523
2523
|
});
|
|
2524
2524
|
|
|
2525
|
-
const logger$
|
|
2525
|
+
const logger$l = debug('app:services:db:actors:migrate');
|
|
2526
2526
|
const migrate = fromCallback(({ sendBack, input: { context } }) => {
|
|
2527
2527
|
const { pathToDbDir, dbId, dbName } = context;
|
|
2528
|
-
logger$
|
|
2528
|
+
logger$l('[db/actors] migrate context', context);
|
|
2529
2529
|
let journalExists = false;
|
|
2530
2530
|
const _checkForFiles = async () => {
|
|
2531
2531
|
const journalPath = `/${pathToDbDir}/meta/_journal.json`;
|
|
@@ -2569,7 +2569,7 @@ const waitForFiles$1 = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2569
2569
|
});
|
|
2570
2570
|
});
|
|
2571
2571
|
|
|
2572
|
-
const logger$
|
|
2572
|
+
const logger$k = debug('app:services:db:machine');
|
|
2573
2573
|
const { CHECKING_STATUS, VALIDATING, WAITING_FOR_FILES, CONNECTING_TO_DB, MIGRATING, } = DbState;
|
|
2574
2574
|
const dbMachine = setup({
|
|
2575
2575
|
types: {
|
|
@@ -2591,7 +2591,7 @@ const dbMachine = setup({
|
|
|
2591
2591
|
[DB_WAITING_FOR_FILES_RECEIVED]: {
|
|
2592
2592
|
actions: assign({
|
|
2593
2593
|
hasFiles: ({ event }) => {
|
|
2594
|
-
logger$
|
|
2594
|
+
logger$k('[db/machine] DB_WAITING_FOR_FILES_RECEIVED event:', event);
|
|
2595
2595
|
return true;
|
|
2596
2596
|
},
|
|
2597
2597
|
}),
|
|
@@ -2600,8 +2600,8 @@ const dbMachine = setup({
|
|
|
2600
2600
|
target: `.${CHECKING_STATUS}`,
|
|
2601
2601
|
actions: assign({
|
|
2602
2602
|
hasFiles: ({ context, event }) => {
|
|
2603
|
-
logger$
|
|
2604
|
-
logger$
|
|
2603
|
+
logger$k('[db/machine] updateHasFiles event:', event);
|
|
2604
|
+
logger$k('[db/machine] updateHasFiles context:', context);
|
|
2605
2605
|
return event.hasFiles;
|
|
2606
2606
|
},
|
|
2607
2607
|
}),
|
|
@@ -2727,9 +2727,6 @@ const validateInput = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2727
2727
|
if (!endpoints || !endpoints.filePaths || !endpoints.files) {
|
|
2728
2728
|
throw new Error('validateInput called with invalid endpoints');
|
|
2729
2729
|
}
|
|
2730
|
-
if (!addresses || !addresses.length) {
|
|
2731
|
-
throw new Error('validateInput called with invalid addresses');
|
|
2732
|
-
}
|
|
2733
2730
|
if (!filesDir) {
|
|
2734
2731
|
if (isBrowser()) {
|
|
2735
2732
|
filesDir = '/';
|
|
@@ -2768,13 +2765,13 @@ const prepareDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
2768
2765
|
});
|
|
2769
2766
|
});
|
|
2770
2767
|
|
|
2771
|
-
const logger$
|
|
2768
|
+
const logger$j = debug('app:services:internal:helpers');
|
|
2772
2769
|
/**
|
|
2773
2770
|
* Recursively create directories if they don't exist.
|
|
2774
2771
|
* @param {string} dirPath - The directory path to create.
|
|
2775
2772
|
*/
|
|
2776
2773
|
const createDirectories = async (dirPath) => {
|
|
2777
|
-
const dirPathExists = await
|
|
2774
|
+
const dirPathExists = await BaseFileManager.pathExists(dirPath);
|
|
2778
2775
|
if (dirPathExists) {
|
|
2779
2776
|
return;
|
|
2780
2777
|
}
|
|
@@ -2832,11 +2829,11 @@ class FileDownloadManager {
|
|
|
2832
2829
|
}
|
|
2833
2830
|
try {
|
|
2834
2831
|
await fs.promises.writeFile(localFilePath, fileData);
|
|
2835
|
-
logger$
|
|
2832
|
+
logger$j(`[downloadFile] Wrote file async to ${localFilePath}`);
|
|
2836
2833
|
}
|
|
2837
2834
|
catch (error) {
|
|
2838
2835
|
fs.writeFileSync(localFilePath, fileData);
|
|
2839
|
-
logger$
|
|
2836
|
+
logger$j(`[downloadFile] Wrote file sync to ${localFilePath}`);
|
|
2840
2837
|
}
|
|
2841
2838
|
}
|
|
2842
2839
|
async start() {
|
|
@@ -2926,7 +2923,7 @@ const syncDbFiles = async ({ filePaths, files }) => {
|
|
|
2926
2923
|
await downloadManager.start();
|
|
2927
2924
|
// await fetchFilesRecursively(files, BROWSER_FS_TOP_DIR, fileList)
|
|
2928
2925
|
await confirmFilesExist(fileList);
|
|
2929
|
-
logger$
|
|
2926
|
+
logger$j('[syncDbFiles] Files synced!');
|
|
2930
2927
|
};
|
|
2931
2928
|
|
|
2932
2929
|
const GET_FILES_METADATA = graphql(/* GraphQL */ `
|
|
@@ -3019,10 +3016,10 @@ const GET_TRANSACTION_TAGS = graphql(/* GraphQL */ `
|
|
|
3019
3016
|
|
|
3020
3017
|
const initArweaveClient = async () => {
|
|
3021
3018
|
if (isBrowser()) {
|
|
3022
|
-
(await import('./ArweaveClient-
|
|
3019
|
+
(await import('./ArweaveClient-D5iJisYr.js')).ArweaveClient;
|
|
3023
3020
|
}
|
|
3024
3021
|
if (!isBrowser()) {
|
|
3025
|
-
(await import('./ArweaveClient-
|
|
3022
|
+
(await import('./ArweaveClient-HEIIuOfB.js')).ArweaveClient;
|
|
3026
3023
|
}
|
|
3027
3024
|
};
|
|
3028
3025
|
let domain = 'arweave.net';
|
|
@@ -3065,7 +3062,7 @@ const setArweaveDomain = (newDomain) => {
|
|
|
3065
3062
|
domain = newDomain;
|
|
3066
3063
|
};
|
|
3067
3064
|
|
|
3068
|
-
const logger$
|
|
3065
|
+
const logger$i = debug('app:files:download');
|
|
3069
3066
|
const downloadAllFilesRequestHandler = async ({ endpoints, eventId, }) => {
|
|
3070
3067
|
await syncDbFiles(endpoints);
|
|
3071
3068
|
eventEmitter.emit('fs.downloadAll.success', { eventId });
|
|
@@ -3149,9 +3146,9 @@ const downloadAllFilesBinaryRequestHandler = async () => {
|
|
|
3149
3146
|
try {
|
|
3150
3147
|
const res = await fetch(`https://${ARWEAVE_HOST}/tx/${transactionId}/status`);
|
|
3151
3148
|
if (res.status !== 200) {
|
|
3152
|
-
logger$
|
|
3149
|
+
logger$i(`[fetchAll/actors] [fetchAllBinaryData] error fetching transaction data for ${transactionId}`);
|
|
3153
3150
|
excludedTransactions.add(transactionId);
|
|
3154
|
-
await saveAppState('excludedTransactions', JSON.stringify(Array.from(excludedTransactions)));
|
|
3151
|
+
await saveAppState$1('excludedTransactions', JSON.stringify(Array.from(excludedTransactions)));
|
|
3155
3152
|
continue;
|
|
3156
3153
|
}
|
|
3157
3154
|
const { tags: tagsResult } = await queryClient.fetchQuery({
|
|
@@ -3178,7 +3175,7 @@ const downloadAllFilesBinaryRequestHandler = async () => {
|
|
|
3178
3175
|
transactionIdsToDownload.push(transactionId);
|
|
3179
3176
|
}
|
|
3180
3177
|
catch (error) {
|
|
3181
|
-
logger$
|
|
3178
|
+
logger$i(error);
|
|
3182
3179
|
}
|
|
3183
3180
|
}
|
|
3184
3181
|
console.log('[download] Calling downloadAllFiles with transactionIdsToDownload', transactionIdsToDownload);
|
|
@@ -3229,14 +3226,14 @@ const isFsInitialized = () => {
|
|
|
3229
3226
|
return isInitialized;
|
|
3230
3227
|
};
|
|
3231
3228
|
|
|
3232
|
-
const logger$
|
|
3229
|
+
const logger$h = debug('app:internal:actors:configureFs');
|
|
3233
3230
|
const configureFs = fromCallback(({ sendBack, input: { context } }) => {
|
|
3234
3231
|
const { endpoints, appDbService, filesDir, } = context;
|
|
3235
|
-
logger$
|
|
3232
|
+
logger$h('[internal/actors] [configureFs] Configuring FS');
|
|
3236
3233
|
const _configureFs = async () => {
|
|
3237
|
-
logger$
|
|
3238
|
-
logger$
|
|
3239
|
-
logger$
|
|
3234
|
+
logger$h('[internal/actors] [configureFs] calling _configureFs');
|
|
3235
|
+
logger$h('[internal/actors] [configureFs] areFsListenersReady:', areFsListenersReady());
|
|
3236
|
+
logger$h('[internal/actors] [configureFs] isFsInitialized:', isFsInitialized());
|
|
3240
3237
|
await waitForEvent({
|
|
3241
3238
|
req: {
|
|
3242
3239
|
eventLabel: 'fs.downloadAll.request',
|
|
@@ -3253,7 +3250,7 @@ const configureFs = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3253
3250
|
}
|
|
3254
3251
|
if (journalExists) {
|
|
3255
3252
|
appDbService.send({ type: DB_WAITING_FOR_FILES_RECEIVED });
|
|
3256
|
-
logger$
|
|
3253
|
+
logger$h('[internal/actors] [configureFs] fs configured!');
|
|
3257
3254
|
return true;
|
|
3258
3255
|
}
|
|
3259
3256
|
sendBack({ type: 'shouldWaitForFiles' });
|
|
@@ -3286,7 +3283,7 @@ const configureFs = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3286
3283
|
return () => { };
|
|
3287
3284
|
});
|
|
3288
3285
|
|
|
3289
|
-
const logger$
|
|
3286
|
+
const logger$g = debug('app:services:internal:actors:saveConfig');
|
|
3290
3287
|
const saveConfig = fromCallback(({ sendBack, input: { context } }) => {
|
|
3291
3288
|
if (typeof window === 'undefined') {
|
|
3292
3289
|
console.error('seedInitBrowser called from non-browser context');
|
|
@@ -3347,20 +3344,20 @@ const saveConfig = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3347
3344
|
value: arweaveDomain || 'arweave.net',
|
|
3348
3345
|
},
|
|
3349
3346
|
});
|
|
3350
|
-
logger$
|
|
3347
|
+
logger$g('[sdk] [internal/actors] Should be done saving');
|
|
3351
3348
|
}
|
|
3352
3349
|
catch (error) {
|
|
3353
3350
|
console.error('Error saving config:', error);
|
|
3354
3351
|
}
|
|
3355
3352
|
};
|
|
3356
3353
|
_saveConfig().then(() => {
|
|
3357
|
-
logger$
|
|
3354
|
+
logger$g('[sdk] [internal/actors] Successfully saved config');
|
|
3358
3355
|
return sendBack({ type: INTERNAL_SAVING_CONFIG_SUCCESS });
|
|
3359
3356
|
});
|
|
3360
3357
|
return () => { };
|
|
3361
3358
|
});
|
|
3362
3359
|
|
|
3363
|
-
const logger$
|
|
3360
|
+
const logger$f = debug('app:services:internal:actors:loadAppDb');
|
|
3364
3361
|
const loadAppDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
3365
3362
|
const { appDbService } = context;
|
|
3366
3363
|
let subscription;
|
|
@@ -3381,7 +3378,7 @@ const loadAppDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3381
3378
|
};
|
|
3382
3379
|
_loadAppDb().then(() => {
|
|
3383
3380
|
sendBack({ type: INTERNAL_LOADING_APP_DB_SUCCESS });
|
|
3384
|
-
logger$
|
|
3381
|
+
logger$f('[sdk] [internal/actors] Successfully loaded app DB');
|
|
3385
3382
|
});
|
|
3386
3383
|
return () => {
|
|
3387
3384
|
if (subscription) {
|
|
@@ -3411,7 +3408,7 @@ const waitForFiles = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3411
3408
|
});
|
|
3412
3409
|
});
|
|
3413
3410
|
|
|
3414
|
-
const logger$
|
|
3411
|
+
const logger$e = debug('app:services:internal:machine');
|
|
3415
3412
|
createBrowserInspector({
|
|
3416
3413
|
autoStart: false,
|
|
3417
3414
|
});
|
|
@@ -3531,7 +3528,7 @@ const internalMachine = setup({
|
|
|
3531
3528
|
[INTERNAL_LOADING_APP_DB_SUCCESS]: {
|
|
3532
3529
|
target: SAVING_CONFIG,
|
|
3533
3530
|
actions: () => {
|
|
3534
|
-
logger$
|
|
3531
|
+
logger$e('[sdk] [internal/index] App DB loaded!');
|
|
3535
3532
|
},
|
|
3536
3533
|
},
|
|
3537
3534
|
},
|
|
@@ -3557,7 +3554,7 @@ const internalMachine = setup({
|
|
|
3557
3554
|
},
|
|
3558
3555
|
ready: {
|
|
3559
3556
|
entry: () => {
|
|
3560
|
-
logger$
|
|
3557
|
+
logger$e('[sdk] [internal/index] Ready!');
|
|
3561
3558
|
},
|
|
3562
3559
|
meta: {
|
|
3563
3560
|
displayText: "Crossing the t's ...",
|
|
@@ -3572,7 +3569,7 @@ const internalMachine = setup({
|
|
|
3572
3569
|
},
|
|
3573
3570
|
},
|
|
3574
3571
|
entry: () => {
|
|
3575
|
-
logger$
|
|
3572
|
+
logger$e('[sdk] [internal/index] Error!');
|
|
3576
3573
|
},
|
|
3577
3574
|
meta: {
|
|
3578
3575
|
displayText: 'Whoops! Something went wrong.',
|
|
@@ -3616,7 +3613,7 @@ const internalMachine = setup({
|
|
|
3616
3613
|
// })
|
|
3617
3614
|
// internalService.start()
|
|
3618
3615
|
|
|
3619
|
-
const initialize$
|
|
3616
|
+
const initialize$2 = fromCallback(({ sendBack, input: { context } }) => {
|
|
3620
3617
|
const { modelName, modelAddedToDb, ModelClass, times } = context;
|
|
3621
3618
|
const newTimes = {
|
|
3622
3619
|
initialize: {
|
|
@@ -3749,7 +3746,7 @@ const fetchDbData = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3749
3746
|
return () => { };
|
|
3750
3747
|
});
|
|
3751
3748
|
|
|
3752
|
-
const logger$
|
|
3749
|
+
const logger$d = debug('app:allItemsActors:fetchSeeds');
|
|
3753
3750
|
const fetchSeeds = fromCallback(({ sendBack, input: { context } }) => {
|
|
3754
3751
|
const { queryVariables, modelName } = context;
|
|
3755
3752
|
if (!queryVariables) {
|
|
@@ -3761,7 +3758,7 @@ const fetchSeeds = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
3761
3758
|
const queryClient = BaseQueryClient.getQueryClient();
|
|
3762
3759
|
const easClient = BaseEasClient.getEasClient();
|
|
3763
3760
|
const cachedResults = queryClient.getQueryData(queryKey);
|
|
3764
|
-
logger$
|
|
3761
|
+
logger$d(`[allItemsActors] [fetchSeeds] cachedResults ${Date.now()}`, cachedResults);
|
|
3765
3762
|
const results = await queryClient.fetchQuery({
|
|
3766
3763
|
queryKey,
|
|
3767
3764
|
queryFn: async () => easClient.request(GET_SEEDS, queryVariables),
|
|
@@ -3979,7 +3976,7 @@ const itemMachineAll = setup({
|
|
|
3979
3976
|
input: {},
|
|
3980
3977
|
},
|
|
3981
3978
|
actors: {
|
|
3982
|
-
initialize: initialize$
|
|
3979
|
+
initialize: initialize$2,
|
|
3983
3980
|
fetchDbData,
|
|
3984
3981
|
fetchSeeds,
|
|
3985
3982
|
fetchVersions,
|
|
@@ -4210,13 +4207,13 @@ const preparePublishRequestData = fromCallback(({ sendBack, input: { context } }
|
|
|
4210
4207
|
});
|
|
4211
4208
|
});
|
|
4212
4209
|
|
|
4213
|
-
const logger$
|
|
4210
|
+
const logger$c = debug('app:services:publish:actors:upload');
|
|
4214
4211
|
const upload = fromCallback(({ sendBack, input: { context } }) => {
|
|
4215
4212
|
const { localId } = context;
|
|
4216
4213
|
const _upload = async () => {
|
|
4217
4214
|
const item = await BaseItem.find({ seedLocalId: localId });
|
|
4218
4215
|
if (!item) {
|
|
4219
|
-
logger$
|
|
4216
|
+
logger$c('no item with localId', localId);
|
|
4220
4217
|
return false;
|
|
4221
4218
|
}
|
|
4222
4219
|
const editedProperties = await item.getEditedProperties();
|
|
@@ -4326,7 +4323,7 @@ const savePublishService = fromCallback(({ sendBack, input: { event, context } }
|
|
|
4326
4323
|
return;
|
|
4327
4324
|
}
|
|
4328
4325
|
const _savePublishService = async () => {
|
|
4329
|
-
await saveAppState(`snapshot__publishItemService`, JSON.stringify(publishItemService.getPersistedSnapshot()));
|
|
4326
|
+
await saveAppState$1(`snapshot__publishItemService`, JSON.stringify(publishItemService.getPersistedSnapshot()));
|
|
4330
4327
|
return true;
|
|
4331
4328
|
};
|
|
4332
4329
|
_savePublishService().then((success) => {
|
|
@@ -4346,7 +4343,7 @@ const globalMachine = setup({
|
|
|
4346
4343
|
input: {},
|
|
4347
4344
|
},
|
|
4348
4345
|
actors: {
|
|
4349
|
-
initialize: initialize$
|
|
4346
|
+
initialize: initialize$3,
|
|
4350
4347
|
addModelsToDb,
|
|
4351
4348
|
getSchemaForModel,
|
|
4352
4349
|
savePublishService,
|
|
@@ -4917,7 +4914,7 @@ const itemMachineSingle = setup({
|
|
|
4917
4914
|
},
|
|
4918
4915
|
actors: {
|
|
4919
4916
|
waitForDb: waitForDb$1,
|
|
4920
|
-
initialize: initialize$
|
|
4917
|
+
initialize: initialize$4,
|
|
4921
4918
|
hydrateExistingItem,
|
|
4922
4919
|
hydrateNewItem,
|
|
4923
4920
|
fetchDataFromEas,
|
|
@@ -5147,7 +5144,7 @@ const getSeedData = async ({ seedLocalId, seedUid }) => {
|
|
|
5147
5144
|
return rows[0];
|
|
5148
5145
|
};
|
|
5149
5146
|
|
|
5150
|
-
const logger$
|
|
5147
|
+
const logger$b = debug('app:db:read:getItemData');
|
|
5151
5148
|
const getItemData = async ({ modelName, seedLocalId, seedUid, }) => {
|
|
5152
5149
|
if (!seedLocalId && !seedUid) {
|
|
5153
5150
|
throw new Error('[db/queries] [getItem] no seedLocalId or seedUid');
|
|
@@ -5155,7 +5152,7 @@ const getItemData = async ({ modelName, seedLocalId, seedUid, }) => {
|
|
|
5155
5152
|
if (seedUid && !seedLocalId) {
|
|
5156
5153
|
const seedData = await getSeedData({ seedUid });
|
|
5157
5154
|
if (!seedData) {
|
|
5158
|
-
logger$
|
|
5155
|
+
logger$b('[db/queries] [getItem] no seedData seedUid', seedUid);
|
|
5159
5156
|
return;
|
|
5160
5157
|
}
|
|
5161
5158
|
seedLocalId = seedData.localId;
|
|
@@ -5190,7 +5187,7 @@ const getItemData = async ({ modelName, seedLocalId, seedUid, }) => {
|
|
|
5190
5187
|
.orderBy(sql.raw('COALESCE(attestation_created_at, created_at) DESC'))
|
|
5191
5188
|
.groupBy(seeds.localId);
|
|
5192
5189
|
if (!itemDataRows || itemDataRows.length === 0) {
|
|
5193
|
-
logger$
|
|
5190
|
+
logger$b('[db/queries] [getItemDataFromDb] no itemDataRows');
|
|
5194
5191
|
return;
|
|
5195
5192
|
}
|
|
5196
5193
|
let itemData = itemDataRows[0];
|
|
@@ -5325,7 +5322,7 @@ const waitForDb = fromCallback(({ sendBack }) => {
|
|
|
5325
5322
|
});
|
|
5326
5323
|
});
|
|
5327
5324
|
|
|
5328
|
-
const initialize = fromCallback(({ sendBack, input: { context } }) => {
|
|
5325
|
+
const initialize$1 = fromCallback(({ sendBack, input: { context } }) => {
|
|
5329
5326
|
const { isRelation, propertyName, storageTransactionId } = context;
|
|
5330
5327
|
let { schemaUid } = context;
|
|
5331
5328
|
if (!schemaUid) {
|
|
@@ -5419,7 +5416,7 @@ const getRelationValueData = async (propertyValue) => {
|
|
|
5419
5416
|
return rows[0];
|
|
5420
5417
|
};
|
|
5421
5418
|
|
|
5422
|
-
const logger$
|
|
5419
|
+
const logger$a = debug('app:property:actors:resolveRelatedValue');
|
|
5423
5420
|
const storageTransactionIdToContentUrl = new Map();
|
|
5424
5421
|
const refResolvedValueToContentUrl = new Map();
|
|
5425
5422
|
const seedUidToContentUrl = new Map();
|
|
@@ -5434,7 +5431,7 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
5434
5431
|
parsedValue = JSON.parse(propertyValue);
|
|
5435
5432
|
}
|
|
5436
5433
|
catch (error) {
|
|
5437
|
-
logger$
|
|
5434
|
+
logger$a(`${propertyName} value is not a JSON string.`);
|
|
5438
5435
|
}
|
|
5439
5436
|
if (!parsedValue && seedUidToContentUrl.has(propertyValue)) {
|
|
5440
5437
|
const contentUrl = seedUidToContentUrl.get(propertyValue);
|
|
@@ -5450,11 +5447,11 @@ const resolveRelatedValue = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
5450
5447
|
}
|
|
5451
5448
|
if (Array.isArray(propertyValue)) {
|
|
5452
5449
|
// TODO: Handle array of seedUids
|
|
5453
|
-
logger$
|
|
5450
|
+
logger$a(`${propertyName} value is an array of seedUids`);
|
|
5454
5451
|
return;
|
|
5455
5452
|
}
|
|
5456
5453
|
if (Array.isArray(parsedValue)) {
|
|
5457
|
-
logger$
|
|
5454
|
+
logger$a(`${propertyName} value is a stringified array of seedUids`);
|
|
5458
5455
|
return;
|
|
5459
5456
|
}
|
|
5460
5457
|
const storageTransactionId = await getStorageTransactionIdForSeedUid(propertyValue);
|
|
@@ -5894,7 +5891,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
|
|
|
5894
5891
|
if (propertyRecordSchema &&
|
|
5895
5892
|
propertyRecordSchema.storageType &&
|
|
5896
5893
|
propertyRecordSchema.storageType === 'ItemStorage') {
|
|
5897
|
-
const { Item } = await import('./index-
|
|
5894
|
+
const { Item } = await import('./index-C4xqqsLw.js');
|
|
5898
5895
|
const item = await Item.find({
|
|
5899
5896
|
seedLocalId,
|
|
5900
5897
|
modelName,
|
|
@@ -5939,10 +5936,10 @@ const getVersionData = async ({ localId, seedLocalId, uid, }) => {
|
|
|
5939
5936
|
return queryRows[0];
|
|
5940
5937
|
};
|
|
5941
5938
|
|
|
5942
|
-
const logger$
|
|
5939
|
+
const logger$9 = debug('app:write:updateItemPropertyValue');
|
|
5943
5940
|
const updateItemPropertyValue = async ({ localId, propertyName, newValue, seedUid, seedLocalId, modelName, refSeedType, refResolvedValue, refResolvedDisplayValue, versionLocalId, versionUid, schemaUid, localStorageDir, }) => {
|
|
5944
5941
|
if (!localId && !seedLocalId) {
|
|
5945
|
-
logger$
|
|
5942
|
+
logger$9(`[db/write] [updateItemPropertyValue] no propertyLocalId or seedLocalId for property: ${propertyName}`);
|
|
5946
5943
|
return;
|
|
5947
5944
|
}
|
|
5948
5945
|
let safeNewValue = newValue;
|
|
@@ -5980,7 +5977,7 @@ const updateItemPropertyValue = async ({ localId, propertyName, newValue, seedUi
|
|
|
5980
5977
|
modelType === modelName?.toLowerCase() &&
|
|
5981
5978
|
refSeedTypeFromDb === refSeedType &&
|
|
5982
5979
|
refResolvedValueFromDb === refResolvedValue) {
|
|
5983
|
-
logger$
|
|
5980
|
+
logger$9(`[db/write] [updateItemPropertyValue] value is the same as most recent record for property: ${propertyNameFromDb}`);
|
|
5984
5981
|
return;
|
|
5985
5982
|
}
|
|
5986
5983
|
// This means we already have a local-only record so we should just update that one
|
|
@@ -6598,7 +6595,7 @@ const propertyMachine = setup({
|
|
|
6598
6595
|
actors: {
|
|
6599
6596
|
waitForDb,
|
|
6600
6597
|
hydrateFromDb,
|
|
6601
|
-
initialize,
|
|
6598
|
+
initialize: initialize$1,
|
|
6602
6599
|
resolveRelatedValue,
|
|
6603
6600
|
resolveRemoteStorage,
|
|
6604
6601
|
analyzeInput,
|
|
@@ -6798,7 +6795,7 @@ const getPropertyData$1 = async ({ propertyName, seedLocalId, seedUid, }) => {
|
|
|
6798
6795
|
};
|
|
6799
6796
|
|
|
6800
6797
|
var _a$1;
|
|
6801
|
-
const logger$
|
|
6798
|
+
const logger$8 = debug('app:property:class');
|
|
6802
6799
|
class BaseItemProperty {
|
|
6803
6800
|
constructor(initialValues) {
|
|
6804
6801
|
this._isRelation = false;
|
|
@@ -6845,7 +6842,7 @@ class BaseItemProperty {
|
|
|
6845
6842
|
serviceInput.propertyValue = JSON.parse(propertyValue);
|
|
6846
6843
|
}
|
|
6847
6844
|
catch (e) {
|
|
6848
|
-
logger$
|
|
6845
|
+
logger$8('List property value is not JSON', e);
|
|
6849
6846
|
}
|
|
6850
6847
|
}
|
|
6851
6848
|
const propertyNameSingular = pluralize(propertyName, 1);
|
|
@@ -6892,7 +6889,7 @@ class BaseItemProperty {
|
|
|
6892
6889
|
}
|
|
6893
6890
|
}
|
|
6894
6891
|
catch (e) {
|
|
6895
|
-
logger$
|
|
6892
|
+
logger$8(`[ItemProperty] [${context.seedLocalId}] [${context.propertyName}] [storageType] error`, e);
|
|
6896
6893
|
renderValue = 'No file found';
|
|
6897
6894
|
}
|
|
6898
6895
|
}
|
|
@@ -7137,7 +7134,7 @@ const getSegmentedItemProperties = (item) => {
|
|
|
7137
7134
|
};
|
|
7138
7135
|
};
|
|
7139
7136
|
|
|
7140
|
-
const logger$
|
|
7137
|
+
const logger$7 = debug('app:item:getPublishUploads');
|
|
7141
7138
|
const prepareArweaveTransaction = async (data, contentHash) => {
|
|
7142
7139
|
const transactionData = {
|
|
7143
7140
|
data,
|
|
@@ -7145,8 +7142,8 @@ const prepareArweaveTransaction = async (data, contentHash) => {
|
|
|
7145
7142
|
};
|
|
7146
7143
|
const tx = await getArweave().createTransaction(transactionData);
|
|
7147
7144
|
if (contentHash) {
|
|
7148
|
-
logger$
|
|
7149
|
-
logger$
|
|
7145
|
+
logger$7('contentHash', contentHash);
|
|
7146
|
+
logger$7('adding content hash tag to tx.id:', tx.id);
|
|
7150
7147
|
tx.addTag('Content-SHA-256', contentHash);
|
|
7151
7148
|
}
|
|
7152
7149
|
return tx;
|
|
@@ -7844,7 +7841,7 @@ const initItem = async () => {
|
|
|
7844
7841
|
Item$2 = (await Promise.resolve().then(function () { return Item$1; })).Item;
|
|
7845
7842
|
}
|
|
7846
7843
|
if (!isBrowser()) {
|
|
7847
|
-
Item$2 = (await import('./Item-
|
|
7844
|
+
Item$2 = (await import('./Item-COP3FuaU.js')).Item;
|
|
7848
7845
|
}
|
|
7849
7846
|
};
|
|
7850
7847
|
|
|
@@ -7854,17 +7851,17 @@ const initItemProperty = async () => {
|
|
|
7854
7851
|
ItemProperty$2 = (await Promise.resolve().then(function () { return ItemProperty$1; })).ItemProperty;
|
|
7855
7852
|
}
|
|
7856
7853
|
if (!isBrowser()) {
|
|
7857
|
-
ItemProperty$2 = (await import('./ItemProperty-
|
|
7854
|
+
ItemProperty$2 = (await import('./ItemProperty-BFn9wM65.js')).ItemProperty;
|
|
7858
7855
|
}
|
|
7859
7856
|
};
|
|
7860
7857
|
|
|
7861
7858
|
let Db;
|
|
7862
7859
|
const initDb = async () => {
|
|
7863
7860
|
if (isBrowser()) {
|
|
7864
|
-
Db = (await import('./Db-
|
|
7861
|
+
Db = (await import('./Db-DqBP6XK2.js')).Db;
|
|
7865
7862
|
}
|
|
7866
7863
|
if (!isBrowser()) {
|
|
7867
|
-
Db = (await import('./Db-
|
|
7864
|
+
Db = (await import('./Db-Bh_lvrAN.js')).Db;
|
|
7868
7865
|
}
|
|
7869
7866
|
// TODO: Add config for React Native
|
|
7870
7867
|
};
|
|
@@ -7881,7 +7878,7 @@ var Item$1 = /*#__PURE__*/Object.freeze({
|
|
|
7881
7878
|
Item: Item
|
|
7882
7879
|
});
|
|
7883
7880
|
|
|
7884
|
-
const logger$
|
|
7881
|
+
const logger$6 = debug('app:react:services');
|
|
7885
7882
|
const finalStrings = ['idle', 'ready', 'done', 'success', 'initialized'];
|
|
7886
7883
|
const getServiceName = (service) => {
|
|
7887
7884
|
let name = 'actor';
|
|
@@ -7928,7 +7925,7 @@ const getServiceUniqueKey = (service) => {
|
|
|
7928
7925
|
snapshot = service.getSnapshot();
|
|
7929
7926
|
}
|
|
7930
7927
|
catch (error) {
|
|
7931
|
-
logger$
|
|
7928
|
+
logger$6('Error:', error);
|
|
7932
7929
|
return uniqueKey;
|
|
7933
7930
|
}
|
|
7934
7931
|
if (snapshot) {
|
|
@@ -8157,7 +8154,7 @@ const useGlobalServiceStatus = () => {
|
|
|
8157
8154
|
};
|
|
8158
8155
|
};
|
|
8159
8156
|
|
|
8160
|
-
const logger$
|
|
8157
|
+
const logger$5 = debug('app:react:item');
|
|
8161
8158
|
const useItem = ({ modelName, seedLocalId, seedUid }) => {
|
|
8162
8159
|
// const [itemSubscription, setItemSubscription] = useState<
|
|
8163
8160
|
// Subscription | undefined
|
|
@@ -8234,7 +8231,7 @@ const useItem = ({ modelName, seedLocalId, seedUid }) => {
|
|
|
8234
8231
|
seedUid,
|
|
8235
8232
|
});
|
|
8236
8233
|
if (!foundItem) {
|
|
8237
|
-
logger$
|
|
8234
|
+
logger$5('[useItem] [getItemFromDb] no item found', modelName, seedLocalId);
|
|
8238
8235
|
isReadingDb.current = false;
|
|
8239
8236
|
return;
|
|
8240
8237
|
}
|
|
@@ -8256,7 +8253,7 @@ const useItem = ({ modelName, seedLocalId, seedUid }) => {
|
|
|
8256
8253
|
const subscription = item.subscribe(async (_) => {
|
|
8257
8254
|
const newItem = await Item.find({ modelName, seedLocalId, seedUid });
|
|
8258
8255
|
if (!newItem) {
|
|
8259
|
-
logger$
|
|
8256
|
+
logger$5('[useItem] [itemSubscription] no item found', modelName, seedLocalId);
|
|
8260
8257
|
return;
|
|
8261
8258
|
}
|
|
8262
8259
|
updateItem(newItem);
|
|
@@ -8415,7 +8412,7 @@ var ItemProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
8415
8412
|
ItemProperty: ItemProperty
|
|
8416
8413
|
});
|
|
8417
8414
|
|
|
8418
|
-
const logger$
|
|
8415
|
+
const logger$4 = debug('app:react:property');
|
|
8419
8416
|
const useItemProperty = (props = {
|
|
8420
8417
|
propertyName: '',
|
|
8421
8418
|
seedLocalId: '',
|
|
@@ -8446,7 +8443,7 @@ const useItemProperty = (props = {
|
|
|
8446
8443
|
seedUid,
|
|
8447
8444
|
});
|
|
8448
8445
|
if (!foundProperty) {
|
|
8449
|
-
logger$
|
|
8446
|
+
logger$4(`[useItemPropertyTest] [readFromDb] no property found for Item.${seedLocalId}.${propertyName}`);
|
|
8450
8447
|
isReadingDb.current = false;
|
|
8451
8448
|
return;
|
|
8452
8449
|
}
|
|
@@ -8618,10 +8615,37 @@ const withSeed = (config, webpack, isServer) => {
|
|
|
8618
8615
|
return config;
|
|
8619
8616
|
};
|
|
8620
8617
|
|
|
8621
|
-
const
|
|
8618
|
+
const initEasClient = async () => {
|
|
8619
|
+
if (isBrowser()) {
|
|
8620
|
+
(await import('./EasClient-jqkT2ZBt.js')).EasClient;
|
|
8621
|
+
}
|
|
8622
|
+
if (!isBrowser()) {
|
|
8623
|
+
(await import('./EasClient-D3wKgt0o.js')).EasClient;
|
|
8624
|
+
}
|
|
8625
|
+
};
|
|
8626
|
+
|
|
8627
|
+
const initFileManager = async () => {
|
|
8628
|
+
if (isBrowser()) {
|
|
8629
|
+
(await Promise.resolve().then(function () { return FileManager$1; })).FileManager;
|
|
8630
|
+
}
|
|
8631
|
+
if (!isBrowser()) {
|
|
8632
|
+
(await import('./FileManager-4mWYO3Mt.js')).FileManager;
|
|
8633
|
+
}
|
|
8634
|
+
};
|
|
8635
|
+
|
|
8636
|
+
const initQueryClient = async () => {
|
|
8637
|
+
if (isBrowser()) {
|
|
8638
|
+
(await import('./QueryClient-CBOP3OoU.js')).QueryClient;
|
|
8639
|
+
}
|
|
8640
|
+
if (!isBrowser()) {
|
|
8641
|
+
(await import('./QueryClient-bKb3SB0W.js')).QueryClient;
|
|
8642
|
+
}
|
|
8643
|
+
};
|
|
8644
|
+
|
|
8645
|
+
const logger$3 = debug('app:services:events');
|
|
8622
8646
|
const handleServiceSaveState = (event) => {
|
|
8623
8647
|
const { state, serviceId } = event;
|
|
8624
|
-
logger$
|
|
8648
|
+
logger$3(`[browser] [service.saveState.request] serviceId: ${serviceId}`);
|
|
8625
8649
|
localStorage.setItem(`seed_sdk_service_${serviceId}`, JSON.stringify(state));
|
|
8626
8650
|
};
|
|
8627
8651
|
const setupServicesEventHandlers = () => {
|
|
@@ -8640,49 +8664,23 @@ const saveServiceHandler = async (event) => {
|
|
|
8640
8664
|
console.log(`[saveServiceHandler] service not found: ${nameOfService}`);
|
|
8641
8665
|
return;
|
|
8642
8666
|
}
|
|
8643
|
-
await saveAppState(`snapshot__${modelName}`, JSON.stringify(service.getPersistedSnapshot()));
|
|
8667
|
+
await saveAppState$1(`snapshot__${modelName}`, JSON.stringify(service.getPersistedSnapshot()));
|
|
8644
8668
|
};
|
|
8645
8669
|
|
|
8646
8670
|
const setupServiceHandlers = () => {
|
|
8647
8671
|
eventEmitter.addListener('service.save', saveServiceHandler);
|
|
8648
8672
|
};
|
|
8649
8673
|
|
|
8650
|
-
const
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
}
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
const initQueryClient = async () => {
|
|
8660
|
-
if (isBrowser()) {
|
|
8661
|
-
(await import('./QueryClient-B1HkAaJo.js')).QueryClient;
|
|
8662
|
-
}
|
|
8663
|
-
if (!isBrowser()) {
|
|
8664
|
-
(await import('./QueryClient-BPoc9eBn.js')).QueryClient;
|
|
8665
|
-
}
|
|
8666
|
-
};
|
|
8667
|
-
|
|
8668
|
-
const initFileManager = async () => {
|
|
8669
|
-
if (isBrowser()) {
|
|
8670
|
-
(await Promise.resolve().then(function () { return FileManager$1; })).FileManager;
|
|
8671
|
-
}
|
|
8672
|
-
if (!isBrowser()) {
|
|
8673
|
-
(await import('./FileManager-texI7UwL.js')).FileManager;
|
|
8674
|
+
const logger$2 = debug('app:ClientManager:initialize');
|
|
8675
|
+
const initialize = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
8676
|
+
logger$2('initialize from ClientManager');
|
|
8677
|
+
const { isInitialized } = context;
|
|
8678
|
+
const { options, } = event;
|
|
8679
|
+
if (isInitialized) {
|
|
8680
|
+
sendBack({ type: 'initialized' });
|
|
8681
|
+
return;
|
|
8674
8682
|
}
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
const logger = debug('app:client');
|
|
8678
|
-
const client = {
|
|
8679
|
-
isInitialized: false,
|
|
8680
|
-
init: async (options) => {
|
|
8681
|
-
logger('init client');
|
|
8682
|
-
if (client.isInitialized) {
|
|
8683
|
-
return;
|
|
8684
|
-
}
|
|
8685
|
-
client.isInitialized = true;
|
|
8683
|
+
const _initialize = async () => {
|
|
8686
8684
|
const { config, addresses } = options;
|
|
8687
8685
|
await initItem();
|
|
8688
8686
|
await initItemProperty();
|
|
@@ -8716,34 +8714,148 @@ const client = {
|
|
|
8716
8714
|
arweaveDomain,
|
|
8717
8715
|
filesDir,
|
|
8718
8716
|
});
|
|
8719
|
-
const { models: internalModels } = await import('./seed.schema.config-
|
|
8717
|
+
const { models: internalModels } = await import('./seed.schema.config-Bao3o6wu.js');
|
|
8720
8718
|
for (const [key, value] of Object.entries(internalModels)) {
|
|
8721
8719
|
setModel(key, value);
|
|
8722
8720
|
}
|
|
8723
|
-
}
|
|
8724
|
-
|
|
8721
|
+
};
|
|
8722
|
+
_initialize().then(() => {
|
|
8723
|
+
sendBack({ type: 'initialized' });
|
|
8724
|
+
});
|
|
8725
|
+
});
|
|
8726
|
+
|
|
8727
|
+
debug('app:client:writeToDb');
|
|
8728
|
+
const saveAppState = fromCallback(({ sendBack, input: { context, event } }) => {
|
|
8729
|
+
const { key, value } = event;
|
|
8730
|
+
const _saveAppState = async () => {
|
|
8725
8731
|
const { BaseDb } = await Promise.resolve().then(function () { return BaseDb$1; });
|
|
8726
8732
|
if (!BaseDb) {
|
|
8727
8733
|
throw new Error('BaseDb not found');
|
|
8728
8734
|
}
|
|
8729
|
-
if (!BaseDb.PlatformClass) {
|
|
8730
|
-
await initDb();
|
|
8731
|
-
}
|
|
8732
8735
|
const appDb = BaseDb.getAppDb();
|
|
8733
8736
|
if (!appDb) {
|
|
8734
8737
|
throw new Error('App DB not found');
|
|
8735
8738
|
}
|
|
8736
8739
|
appDb.insert(appState)
|
|
8737
8740
|
.values({
|
|
8738
|
-
key:
|
|
8739
|
-
value: JSON.stringify(
|
|
8741
|
+
key: key,
|
|
8742
|
+
value: JSON.stringify(value),
|
|
8740
8743
|
})
|
|
8741
8744
|
.onConflictDoUpdate({
|
|
8742
8745
|
target: appState.key,
|
|
8743
8746
|
set: {
|
|
8744
|
-
value: JSON.stringify(
|
|
8747
|
+
value: JSON.stringify(value),
|
|
8745
8748
|
},
|
|
8746
8749
|
});
|
|
8750
|
+
};
|
|
8751
|
+
_saveAppState().then(() => {
|
|
8752
|
+
sendBack({
|
|
8753
|
+
type: 'saveAppStateSuccess',
|
|
8754
|
+
});
|
|
8755
|
+
});
|
|
8756
|
+
});
|
|
8757
|
+
|
|
8758
|
+
const setAddresses = assign(({ event, spawn }) => {
|
|
8759
|
+
const { addresses } = event;
|
|
8760
|
+
spawn(saveAppState, {
|
|
8761
|
+
input: {
|
|
8762
|
+
key: 'addresses',
|
|
8763
|
+
value: addresses,
|
|
8764
|
+
},
|
|
8765
|
+
});
|
|
8766
|
+
return {
|
|
8767
|
+
addresses,
|
|
8768
|
+
};
|
|
8769
|
+
});
|
|
8770
|
+
|
|
8771
|
+
const clientManagerMachine = setup({
|
|
8772
|
+
types: {
|
|
8773
|
+
context: {},
|
|
8774
|
+
input: {},
|
|
8775
|
+
},
|
|
8776
|
+
actions: {
|
|
8777
|
+
setAddresses,
|
|
8778
|
+
},
|
|
8779
|
+
actors: {
|
|
8780
|
+
initialize,
|
|
8781
|
+
},
|
|
8782
|
+
}).createMachine({
|
|
8783
|
+
id: 'clientManager',
|
|
8784
|
+
initial: 'uninitialized',
|
|
8785
|
+
context: ({ input }) => input,
|
|
8786
|
+
states: {
|
|
8787
|
+
uninitialized: {
|
|
8788
|
+
on: {
|
|
8789
|
+
init: {
|
|
8790
|
+
target: 'initializing',
|
|
8791
|
+
},
|
|
8792
|
+
},
|
|
8793
|
+
},
|
|
8794
|
+
initializing: {
|
|
8795
|
+
on: {
|
|
8796
|
+
initialized: {
|
|
8797
|
+
target: 'idle',
|
|
8798
|
+
},
|
|
8799
|
+
},
|
|
8800
|
+
invoke: {
|
|
8801
|
+
src: 'initialize',
|
|
8802
|
+
input: ({ event, context }) => ({ event, context }),
|
|
8803
|
+
},
|
|
8804
|
+
},
|
|
8805
|
+
idle: {
|
|
8806
|
+
on: {
|
|
8807
|
+
setAddressesSuccess: {
|
|
8808
|
+
actions: assign({
|
|
8809
|
+
isSaving: false,
|
|
8810
|
+
}),
|
|
8811
|
+
},
|
|
8812
|
+
},
|
|
8813
|
+
setAddresses: {
|
|
8814
|
+
actions: ['setAddresses'],
|
|
8815
|
+
},
|
|
8816
|
+
},
|
|
8817
|
+
},
|
|
8818
|
+
});
|
|
8819
|
+
|
|
8820
|
+
const logger$1 = debug('app:client');
|
|
8821
|
+
const clientManager = createActor(clientManagerMachine, {
|
|
8822
|
+
input: {
|
|
8823
|
+
isInitialized: false,
|
|
8824
|
+
}
|
|
8825
|
+
});
|
|
8826
|
+
const subscription = clientManager.subscribe((snapshot) => {
|
|
8827
|
+
console.log('ClientManager snapshot:', snapshot);
|
|
8828
|
+
});
|
|
8829
|
+
clientManager.start();
|
|
8830
|
+
const ClientManager = {
|
|
8831
|
+
getService: () => clientManager,
|
|
8832
|
+
init: async (options) => {
|
|
8833
|
+
clientManager.send({ type: 'init', options, });
|
|
8834
|
+
await waitFor(clientManager, (snapshot) => snapshot.value === 'initialized');
|
|
8835
|
+
},
|
|
8836
|
+
setAddresses: async (addresses) => {
|
|
8837
|
+
logger$1('setAddresses', addresses);
|
|
8838
|
+
clientManager.send({ type: 'setAddresses', addresses });
|
|
8839
|
+
await waitFor(clientManager, (snapshot) => !snapshot.context.isSaving);
|
|
8840
|
+
logger$1('setAddresses success', addresses);
|
|
8841
|
+
},
|
|
8842
|
+
stop: () => clientManager.stop(),
|
|
8843
|
+
unload: () => {
|
|
8844
|
+
clientManager.stop();
|
|
8845
|
+
subscription.unsubscribe();
|
|
8846
|
+
},
|
|
8847
|
+
};
|
|
8848
|
+
|
|
8849
|
+
const logger = debug('app:client');
|
|
8850
|
+
const client = {
|
|
8851
|
+
isInitialized: false,
|
|
8852
|
+
init: async (options) => {
|
|
8853
|
+
logger('init client');
|
|
8854
|
+
await ClientManager.init(options);
|
|
8855
|
+
logger('client initialized');
|
|
8856
|
+
},
|
|
8857
|
+
setAddresses: async (addresses) => {
|
|
8858
|
+
ClientManager.setAddresses(addresses);
|
|
8747
8859
|
},
|
|
8748
8860
|
subscribe: (callback) => {
|
|
8749
8861
|
const subscription = globalService.subscribe(callback);
|
|
@@ -8788,4 +8900,4 @@ const client = {
|
|
|
8788
8900
|
enableMapSet();
|
|
8789
8901
|
|
|
8790
8902
|
export { BaseItem as B, Db as D, FileManager as F, Item as I, Json as J, List as L, Model as M, Property as P, Relation as R, Text as T, BaseItemProperty as a, BaseDb as b, ImageSrc as c, Item$2 as d, ItemProperty$2 as e, useItem as f, useItemProperties as g, useCreateItem as h, useItemProperty as i, useDeleteItem as j, useGlobalServiceStatus as k, usePublishItem as l, usePersistedSnapshots as m, useServices as n, useService as o, getCorrectId as p, getGlobalService as q, eventEmitter as r, client as s, useItems as u, withSeed as w };
|
|
8791
|
-
//# sourceMappingURL=index-
|
|
8903
|
+
//# sourceMappingURL=index-CLvyWg5f.js.map
|