@seedprotocol/sdk 0.1.47 → 0.1.48
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.map +1 -1
- package/dist/constants-BLctWkrn.js.map +1 -1
- package/dist/{index-DWf9Ls94.js → index-DMIKRod-.js} +3995 -3995
- package/dist/index-DMIKRod-.js.map +1 -0
- package/dist/{index-B2WbNudj.js → index-wKss7188.js} +10 -10
- package/dist/index-wKss7188.js.map +1 -0
- package/dist/main.js +7 -7
- package/dist/{seed.schema.config-mBqth17w.js → seed.schema.config-C0M8Rcti.js} +7 -7
- package/dist/seed.schema.config-C0M8Rcti.js.map +1 -0
- package/dist/src/AppStateSchema.ts +10 -0
- package/dist/src/Attestation.ts +21 -0
- package/dist/src/ConfigSchema.ts +15 -0
- package/dist/src/ItemProperty.ts +383 -0
- package/dist/src/MetadataSchema.ts +28 -0
- package/dist/src/ModelSchema.ts +46 -0
- package/dist/src/ModelUidSchema.ts +16 -0
- package/dist/src/PropertyUidSchema.ts +16 -0
- package/dist/src/Schema.ts +17 -0
- package/dist/src/SeedSchema.ts +29 -0
- package/dist/src/VersionSchema.ts +16 -0
- package/dist/src/actors.ts +10 -0
- package/dist/src/addModelsToDb.ts +150 -0
- package/dist/src/allItems.ts +23 -0
- package/dist/src/arweave.ts +37 -0
- package/dist/src/browser.app.db.config.ts +27 -0
- package/dist/src/browser.seed.db.config.ts +33 -0
- package/dist/src/browser.ts +30 -0
- package/dist/src/checkStatus.ts +50 -0
- package/dist/src/client.ts +85 -0
- package/dist/src/configureFs.ts +81 -0
- package/dist/src/connectToDb.ts +74 -0
- package/dist/src/connectionManager.ts +67 -0
- package/dist/src/constants.ts +118 -0
- package/dist/src/create.ts +39 -0
- package/dist/src/createItem.ts +15 -0
- package/dist/src/createItemMachine.ts +37 -0
- package/dist/src/createPublishAttempt.ts +16 -0
- package/dist/src/createSeeds.ts +24 -0
- package/dist/src/createVersion.ts +33 -0
- package/dist/src/db.ts +247 -0
- package/dist/src/dbMachine.ts +181 -0
- package/dist/src/deleteItem.ts +19 -0
- package/dist/src/download.ts +289 -0
- package/dist/src/drizzle.ts +82 -0
- package/dist/src/environment.ts +15 -0
- package/dist/src/eventBus.ts +5 -0
- package/dist/src/events.ts +14 -0
- package/dist/src/fetchDataFromEas.ts +90 -0
- package/dist/src/fetchDbData.ts +16 -0
- package/dist/src/fetchRelatedItems.ts +179 -0
- package/dist/src/fetchSeeds.ts +44 -0
- package/dist/src/fetchVersions.ts +41 -0
- package/dist/src/files.ts +16 -0
- package/dist/src/fragment-masking.ts +87 -0
- package/dist/src/fsProxy.ts +36 -0
- package/dist/src/getItem.ts +189 -0
- package/dist/src/getItemProperties.ts +162 -0
- package/dist/src/getItems.ts +75 -0
- package/dist/src/getMetadata.ts +40 -0
- package/dist/src/getModelSchemas.ts +88 -0
- package/dist/src/getSchemaForModel.ts +42 -0
- package/dist/src/getSeedData.ts +34 -0
- package/dist/src/getVersionData.ts +58 -0
- package/dist/src/getVersionsForVersionUids.ts +39 -0
- package/dist/src/globalMachine.ts +259 -0
- package/dist/src/gql.ts +113 -0
- package/dist/src/graphql.ts +3201 -0
- package/dist/src/helpers.ts +150 -0
- package/dist/src/hydrateExistingItem.ts +137 -0
- package/dist/src/hydrateFromDb.ts +254 -0
- package/dist/src/hydrateNewItem.ts +34 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.ts +21 -0
- package/dist/src/init.ts +61 -0
- package/dist/src/initialize.ts +127 -0
- package/dist/src/internalMachine.ts +220 -0
- package/dist/src/item.ts +324 -0
- package/dist/src/itemMachineAll.ts +158 -0
- package/dist/src/itemMachineSingle.ts +175 -0
- package/dist/src/loadAppDb.ts +47 -0
- package/dist/src/logger.ts +33 -0
- package/dist/src/machine.ts +55 -0
- package/dist/src/machines.ts +58 -0
- package/dist/src/migrate.ts +288 -0
- package/dist/src/model.ts +71 -0
- package/dist/src/modelClass.ts +19 -0
- package/dist/src/node.app.db.config.ts +40 -0
- package/dist/src/prepareDb.ts +34 -0
- package/dist/src/preparePublishRequestData.ts +81 -0
- package/dist/src/processItems.ts +71 -0
- package/dist/src/property.ts +161 -0
- package/dist/src/propertyMachine.ts +154 -0
- package/dist/src/publish.ts +31 -0
- package/dist/src/publishMachine.ts +77 -0
- package/dist/src/queries.ts +13 -0
- package/dist/src/read.ts +174 -0
- package/dist/src/recoverDeletedItem.ts +14 -0
- package/dist/src/request.ts +54 -0
- package/dist/src/requestAll.ts +157 -0
- package/dist/src/resolveRelatedValue.ts +348 -0
- package/dist/src/resolveRemoteStorage.ts +87 -0
- package/dist/src/save.ts +183 -0
- package/dist/src/saveConfig.ts +79 -0
- package/dist/src/saveDataToDb.ts +145 -0
- package/dist/src/saveMetadata.ts +18 -0
- package/dist/src/saveValueToDb.ts +94 -0
- package/dist/src/seed.schema.config.ts +25 -0
- package/dist/src/seed.ts +37 -0
- package/dist/src/seedData.ts +0 -0
- package/dist/src/seedProtocol.ts +17 -0
- package/dist/src/services.ts +359 -0
- package/dist/src/sqlWasmClient.ts +88 -0
- package/dist/src/syncDbWithEas.ts +686 -0
- package/dist/src/trash.ts +29 -0
- package/dist/src/ts-to-proto.ts +101 -0
- package/dist/src/types.ts +12 -0
- package/dist/src/upload.ts +86 -0
- package/dist/src/validate.ts +42 -0
- package/dist/src/validateInput.ts +33 -0
- package/dist/src/validateItemData.ts +20 -0
- package/dist/src/waitForDb.ts +23 -0
- package/dist/src/wasm.d.ts +8300 -0
- package/dist/src/write.ts +366 -0
- package/dist/types/src/browser/db/read/getModelSchemas.d.ts.map +1 -1
- package/dist/types/src/browser/item/single/actors/hydrateExistingItem.d.ts +3 -1
- package/dist/types/src/browser/item/single/actors/hydrateExistingItem.d.ts.map +1 -1
- package/dist/types/src/browser/item/single/actors/saveDataToDb.d.ts +3 -3
- package/dist/types/src/browser/item/single/itemMachineSingle.d.ts +3 -3
- package/dist/types/src/browser/property/ItemProperty.d.ts +7 -7
- package/dist/types/src/browser/property/ItemProperty.d.ts.map +1 -1
- package/dist/types/src/browser/property/actors/resolveRemoteStorage.d.ts +3 -3
- package/dist/types/src/browser/react/trash.d.ts +1 -1
- package/dist/types/src/browser/react/trash.d.ts.map +1 -1
- package/dist/types/src/browser/services/db/dbMachine.d.ts +6 -6
- package/dist/types/src/browser/services/publish/publishMachine.d.ts +17 -17
- package/dist/types/src/types/machines.d.ts +4 -0
- package/dist/types/src/types/machines.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-B2WbNudj.js.map +0 -1
- package/dist/index-DWf9Ls94.js.map +0 -1
- package/dist/seed.schema.config-mBqth17w.js.map +0 -1
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { sql } from 'drizzle-orm'
|
|
2
|
+
import { generateId } from '@/shared/helpers'
|
|
3
|
+
import { ModelValues } from '@/types'
|
|
4
|
+
import { escapeSqliteString } from '@/shared/helpers/db'
|
|
5
|
+
import { getSeedData } from '@/browser/db/read/getSeedData'
|
|
6
|
+
import { getVersionData } from '@/browser/db/read/getVersionData'
|
|
7
|
+
import debug from 'debug'
|
|
8
|
+
import { eventEmitter } from '@/eventBus'
|
|
9
|
+
import { getAppDb, runQueryForStatement } from '@/browser/db/sqlWasmClient'
|
|
10
|
+
import { appState, MetadataType, seeds } from '@/shared/seedSchema'
|
|
11
|
+
import { createVersion } from '@/browser/db/write/createVersion'
|
|
12
|
+
|
|
13
|
+
const logger = debug('app:write')
|
|
14
|
+
|
|
15
|
+
type CreateSeedProps = {
|
|
16
|
+
type: string
|
|
17
|
+
seedUid?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type CreateSeed = (props: CreateSeedProps) => Promise<string>
|
|
21
|
+
|
|
22
|
+
const sendItemUpdateEvent = ({ modelName, seedLocalId, seedUid }) => {
|
|
23
|
+
if (!modelName || (!seedLocalId && !seedUid)) {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
eventEmitter.emit(`item.${modelName}.${seedUid || seedLocalId}.update`)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const createSeed: CreateSeed = async ({ type, seedUid }) => {
|
|
30
|
+
const appDb = getAppDb()
|
|
31
|
+
|
|
32
|
+
const newSeedLocalId = generateId()
|
|
33
|
+
|
|
34
|
+
await appDb.insert(seeds).values({
|
|
35
|
+
localId: newSeedLocalId,
|
|
36
|
+
type,
|
|
37
|
+
uid: seedUid,
|
|
38
|
+
createdAt: Date.now(),
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
return newSeedLocalId
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type CreateMetadataForExistingRecordProps = {
|
|
45
|
+
existingRecord: MetadataType
|
|
46
|
+
propertyName: string
|
|
47
|
+
propertyValue: any
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type CreateMetadataForExistingRecord = (
|
|
51
|
+
props: CreateMetadataForExistingRecordProps,
|
|
52
|
+
) => Promise<void>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create a new metadata record from an existing record.
|
|
56
|
+
* @param existingRecord
|
|
57
|
+
* @param propertyName
|
|
58
|
+
* @param propertyValue
|
|
59
|
+
*/
|
|
60
|
+
export const createNewMetadataFromExistingRecord: CreateMetadataForExistingRecord =
|
|
61
|
+
async ({ existingRecord, propertyName, propertyValue }) => {
|
|
62
|
+
const appDb = getAppDb()
|
|
63
|
+
|
|
64
|
+
const newLocalId = generateId()
|
|
65
|
+
await appDb.run(
|
|
66
|
+
sql.raw(
|
|
67
|
+
`INSERT INTO metadata (local_id, seed_local_id, seed_uid, property_name, property_value, attestation_created_at,
|
|
68
|
+
schema_uid, model_type, version_local_id, version_uid, eas_data_type, ref_value_type,
|
|
69
|
+
ref_schema_uid, ref_seed_type, ref_resolved_value, ref_resolved_display_value,
|
|
70
|
+
attestation_raw)
|
|
71
|
+
VALUES ('${newLocalId}', '${existingRecord.seedLocalId}',
|
|
72
|
+
'${existingRecord.seedUid}' '${propertyName}', '${propertyValue}',
|
|
73
|
+
'${existingRecord.attestationCreatedAt}', '${existingRecord.schemaUid}',
|
|
74
|
+
'${existingRecord.modelType}',
|
|
75
|
+
'${existingRecord.versionLocalId}', '${existingRecord.versionUid}',
|
|
76
|
+
'${existingRecord.easDataType}', '${existingRecord.refValueType}',
|
|
77
|
+
'${existingRecord.refSchemaUid}', '${existingRecord.refSeedType}',
|
|
78
|
+
'${existingRecord.refResolvedValue}', '${existingRecord.refResolvedDisplayValue}',
|
|
79
|
+
'${existingRecord.attestationRaw}');
|
|
80
|
+
`,
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const updateMetadataValue = async (
|
|
86
|
+
localId: string,
|
|
87
|
+
propertyValue: any,
|
|
88
|
+
) => {
|
|
89
|
+
const appDb = getAppDb()
|
|
90
|
+
|
|
91
|
+
await appDb.run(
|
|
92
|
+
sql.raw(
|
|
93
|
+
`UPDATE metadata
|
|
94
|
+
SET property_value = '${propertyValue}'
|
|
95
|
+
WHERE local_id = '${localId}';
|
|
96
|
+
`,
|
|
97
|
+
),
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
type CreateNewItemProps = Partial<ModelValues<any>> & {
|
|
102
|
+
modelName: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type CreateNewItemReturnType = {
|
|
106
|
+
seedLocalId: string
|
|
107
|
+
versionLocalId: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type CreateNewItem = (
|
|
111
|
+
props: CreateNewItemProps,
|
|
112
|
+
) => Promise<CreateNewItemReturnType>
|
|
113
|
+
|
|
114
|
+
export const createNewItem: CreateNewItem = async ({
|
|
115
|
+
modelName,
|
|
116
|
+
...propertyData
|
|
117
|
+
}) => {
|
|
118
|
+
if (!modelName) {
|
|
119
|
+
throw new Error('A model name is required for createNewItem')
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const appDb = getAppDb()
|
|
123
|
+
|
|
124
|
+
const seedType = modelName.toLowerCase()
|
|
125
|
+
|
|
126
|
+
const newSeedId = await createSeed({ type: seedType })
|
|
127
|
+
|
|
128
|
+
const newVersionId = await createVersion({ seedLocalId: newSeedId })
|
|
129
|
+
|
|
130
|
+
for (const [propertyName, propertyValue] of Object.entries(propertyData)) {
|
|
131
|
+
await appDb.run(
|
|
132
|
+
sql.raw(
|
|
133
|
+
`INSERT INTO metadata (seed_local_id, version_local_id, property_name, property_value, model_type, created_at,
|
|
134
|
+
attestation_created_at)
|
|
135
|
+
VALUES ('${newSeedId}', '${newVersionId}', '${propertyName}', '${propertyValue}', '${seedType}', ${Date.now()},
|
|
136
|
+
${Date.now()});`,
|
|
137
|
+
),
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// eventEmitter.emit(`item.requestAll`, { modelName })
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
modelName,
|
|
145
|
+
seedLocalId: newSeedId,
|
|
146
|
+
versionLocalId: newVersionId,
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
type UpdateItemPropertyValueProps = {
|
|
151
|
+
propertyLocalId?: string
|
|
152
|
+
propertyName?: string
|
|
153
|
+
newValue: any
|
|
154
|
+
seedLocalId?: string
|
|
155
|
+
seedUid?: string
|
|
156
|
+
modelName?: string
|
|
157
|
+
refResolvedValue?: string
|
|
158
|
+
refResolvedDisplayValue?: string
|
|
159
|
+
refSeedType?: string
|
|
160
|
+
versionLocalId?: string
|
|
161
|
+
versionUid?: string
|
|
162
|
+
schemaUid?: string
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
type UpdateItemPropertyValue = (
|
|
166
|
+
props: UpdateItemPropertyValueProps,
|
|
167
|
+
) => Promise<void>
|
|
168
|
+
|
|
169
|
+
export const updateItemPropertyValue: UpdateItemPropertyValue = async ({
|
|
170
|
+
propertyLocalId,
|
|
171
|
+
propertyName,
|
|
172
|
+
newValue,
|
|
173
|
+
seedUid,
|
|
174
|
+
seedLocalId,
|
|
175
|
+
modelName,
|
|
176
|
+
refSeedType,
|
|
177
|
+
refResolvedValue,
|
|
178
|
+
refResolvedDisplayValue,
|
|
179
|
+
versionLocalId,
|
|
180
|
+
versionUid,
|
|
181
|
+
schemaUid,
|
|
182
|
+
}) => {
|
|
183
|
+
if (!propertyLocalId && !seedLocalId) {
|
|
184
|
+
logger(
|
|
185
|
+
`[db/write] [updateItemPropertyValue] no propertyLocalId or seedLocalId for property: ${propertyName}`,
|
|
186
|
+
)
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
let safeNewValue = newValue
|
|
191
|
+
|
|
192
|
+
if (
|
|
193
|
+
typeof newValue === 'string' &&
|
|
194
|
+
!refResolvedDisplayValue &&
|
|
195
|
+
!refResolvedValue
|
|
196
|
+
) {
|
|
197
|
+
safeNewValue = escapeSqliteString(newValue)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const mostRecentRecordStatement = `SELECT local_id,
|
|
201
|
+
uid,
|
|
202
|
+
property_name,
|
|
203
|
+
property_value,
|
|
204
|
+
model_type,
|
|
205
|
+
seed_uid,
|
|
206
|
+
seed_local_id,
|
|
207
|
+
version_local_id,
|
|
208
|
+
version_uid,
|
|
209
|
+
schema_uid,
|
|
210
|
+
eas_data_type
|
|
211
|
+
FROM metadata
|
|
212
|
+
WHERE property_name = '${propertyName}'
|
|
213
|
+
AND seed_local_id = '${seedLocalId}'
|
|
214
|
+
ORDER BY COALESCE(attestation_created_at, created_at) DESC;`
|
|
215
|
+
|
|
216
|
+
const { rows } = await runQueryForStatement(mostRecentRecordStatement)
|
|
217
|
+
|
|
218
|
+
if (rows && rows.length > 0) {
|
|
219
|
+
const mostRecentRecord = rows[0]
|
|
220
|
+
const localId = mostRecentRecord[0]
|
|
221
|
+
const uid = mostRecentRecord[1]
|
|
222
|
+
const propertyNameFromDb = mostRecentRecord[2]
|
|
223
|
+
const propertyValueFromDb = mostRecentRecord[3]
|
|
224
|
+
const modelType = mostRecentRecord[4]
|
|
225
|
+
const seedUid = mostRecentRecord[5]
|
|
226
|
+
const seedLocalIdFromDb = mostRecentRecord[6]
|
|
227
|
+
const versionLocalId = mostRecentRecord[7]
|
|
228
|
+
const versionUid = mostRecentRecord[8]
|
|
229
|
+
const schemaUid = mostRecentRecord[9]
|
|
230
|
+
const easDataType = mostRecentRecord[10]
|
|
231
|
+
|
|
232
|
+
if (propertyValueFromDb === newValue) {
|
|
233
|
+
logger(
|
|
234
|
+
`[db/write] [updateItemPropertyValue] value is the same as most recent record for property: ${propertyNameFromDb}`,
|
|
235
|
+
)
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// This means we already have a local-only record so we should just update that one
|
|
240
|
+
if (!uid) {
|
|
241
|
+
const updatePropertyStatement = `UPDATE metadata
|
|
242
|
+
SET property_value = '${safeNewValue}',
|
|
243
|
+
ref_seed_type = ${refSeedType ? `'${refSeedType}'` : 'NULL'},
|
|
244
|
+
ref_resolved_value = ${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'},
|
|
245
|
+
ref_resolved_display_value = ${refResolvedDisplayValue ? `'${refResolvedDisplayValue}'` : 'NULL'},
|
|
246
|
+
updated_at = ${Date.now()}
|
|
247
|
+
WHERE local_id = '${localId}';`
|
|
248
|
+
|
|
249
|
+
await runQueryForStatement(updatePropertyStatement)
|
|
250
|
+
|
|
251
|
+
sendItemUpdateEvent({ modelName, seedLocalId, seedUid })
|
|
252
|
+
|
|
253
|
+
return
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const seedDataFromDb = await getSeedData({ seedLocalId })
|
|
257
|
+
const versionDataFromDb = await getVersionData({ versionLocalId })
|
|
258
|
+
|
|
259
|
+
// Here we don't have a local-only record so we need to create a new one
|
|
260
|
+
const newLocalId = generateId()
|
|
261
|
+
|
|
262
|
+
const newPropertyStatement = `INSERT INTO metadata (local_id,
|
|
263
|
+
property_name,
|
|
264
|
+
property_value,
|
|
265
|
+
model_type,
|
|
266
|
+
seed_uid,
|
|
267
|
+
seed_local_id,
|
|
268
|
+
version_local_id,
|
|
269
|
+
version_uid,
|
|
270
|
+
schema_uid,
|
|
271
|
+
eas_data_type,
|
|
272
|
+
ref_seed_type,
|
|
273
|
+
ref_resolved_value,
|
|
274
|
+
ref_resolved_display_value,
|
|
275
|
+
created_at)
|
|
276
|
+
VALUES ('${newLocalId}',
|
|
277
|
+
'${propertyNameFromDb}',
|
|
278
|
+
'${safeNewValue}',
|
|
279
|
+
'${modelType}',
|
|
280
|
+
${seedDataFromDb?.uid ? `'${seedDataFromDb.uid}'` : 'NULL'},
|
|
281
|
+
'${seedLocalIdFromDb}',
|
|
282
|
+
'${versionLocalId}',
|
|
283
|
+
${versionDataFromDb?.uid ? `'${versionDataFromDb.uid}'` : 'NULL'},
|
|
284
|
+
'${schemaUid}',
|
|
285
|
+
${easDataType ? `'${easDataType}'` : 'NULL'},
|
|
286
|
+
${refSeedType ? `'${refSeedType}'` : 'NULL'},
|
|
287
|
+
${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'},
|
|
288
|
+
${refResolvedDisplayValue ? `'${refResolvedDisplayValue}'` : 'NULL'},
|
|
289
|
+
${Date.now()});`
|
|
290
|
+
|
|
291
|
+
await runQueryForStatement(newPropertyStatement)
|
|
292
|
+
|
|
293
|
+
sendItemUpdateEvent({ modelName, seedLocalId, seedUid })
|
|
294
|
+
|
|
295
|
+
return
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Here there are no records for this property on this seed so we should create one
|
|
299
|
+
|
|
300
|
+
const newLocalId = generateId()
|
|
301
|
+
|
|
302
|
+
if (!seedUid) {
|
|
303
|
+
const seedData = await getSeedData({ seedLocalId })
|
|
304
|
+
if (seedData) {
|
|
305
|
+
seedUid = seedData.uid
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (!versionUid) {
|
|
310
|
+
const versionData = await getVersionData({ versionLocalId })
|
|
311
|
+
if (versionData) {
|
|
312
|
+
versionUid = versionData.uid
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const newPropertyStatement = `INSERT INTO metadata (local_id,
|
|
317
|
+
property_name,
|
|
318
|
+
property_value,
|
|
319
|
+
model_type,
|
|
320
|
+
seed_uid,
|
|
321
|
+
seed_local_id,
|
|
322
|
+
version_local_id,
|
|
323
|
+
version_uid,
|
|
324
|
+
schema_uid,
|
|
325
|
+
ref_seed_type,
|
|
326
|
+
ref_resolved_value,
|
|
327
|
+
ref_resolved_display_value,
|
|
328
|
+
created_at)
|
|
329
|
+
VALUES ('${newLocalId}',
|
|
330
|
+
'${propertyName}',
|
|
331
|
+
'${safeNewValue}',
|
|
332
|
+
'${modelName?.toLowerCase()}',
|
|
333
|
+
${seedUid ? `'${seedUid}'` : 'NULL'},
|
|
334
|
+
'${seedLocalId}',
|
|
335
|
+
'${versionLocalId}',
|
|
336
|
+
${versionUid ? `'${versionUid}'` : 'NULL'},
|
|
337
|
+
'${schemaUid}',
|
|
338
|
+
${refSeedType ? `'${refSeedType}'` : 'NULL'},
|
|
339
|
+
${refResolvedValue ? `'${refResolvedValue}'` : 'NULL'},
|
|
340
|
+
${refResolvedDisplayValue ? `'${refResolvedDisplayValue}'` : 'NULL'},
|
|
341
|
+
${Date.now()});`
|
|
342
|
+
|
|
343
|
+
await runQueryForStatement(newPropertyStatement)
|
|
344
|
+
|
|
345
|
+
sendItemUpdateEvent({ modelName, seedLocalId, seedUid })
|
|
346
|
+
|
|
347
|
+
if (!seedLocalId && propertyName && modelName && newValue) {
|
|
348
|
+
// TODO: Does this ever happen? If so, what should we do?
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
export const writeAppState = async (key: string, value: string) => {
|
|
352
|
+
const appDb = getAppDb()
|
|
353
|
+
|
|
354
|
+
await appDb
|
|
355
|
+
.insert(appState)
|
|
356
|
+
.values({
|
|
357
|
+
key,
|
|
358
|
+
value,
|
|
359
|
+
})
|
|
360
|
+
.onConflictDoUpdate({
|
|
361
|
+
target: appState.key,
|
|
362
|
+
set: {
|
|
363
|
+
value,
|
|
364
|
+
},
|
|
365
|
+
})
|
|
366
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getModelSchemas.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/db/read/getModelSchemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"getModelSchemas.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/db/read/getModelSchemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAS/D,KAAK,qBAAqB,GAAG;IAC3B,YAAY,EAAE,eAAe,CAAA;IAC7B,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACtC,CAAA;AACD,KAAK,eAAe,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE3D,eAAO,MAAM,eAAe,EAAE,eAsE7B,CAAA"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { EventObject } from 'xstate';
|
|
2
|
+
import { FromCallbackInput, HydrateExistingItemEvent, ItemMachineContext } from '@/types';
|
|
3
|
+
export declare const hydrateExistingItem: import("xstate").CallbackActorLogic<EventObject, FromCallbackInput<ItemMachineContext<any>, HydrateExistingItemEvent>, EventObject>;
|
|
2
4
|
//# sourceMappingURL=hydrateExistingItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateExistingItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/item/single/actors/hydrateExistingItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hydrateExistingItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/item/single/actors/hydrateExistingItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAElD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,mBAAmB,qIAgI9B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventObject } from 'xstate';
|
|
2
2
|
export declare const saveDataToDb: import("xstate").CallbackActorLogic<EventObject, import("xstate").StateMachine<import("../../../../types").ItemMachineContext<any>, import("xstate").AnyEventObject, {
|
|
3
|
-
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<EventObject, import("../../../../types").FromCallbackInput<import("../../../../types").ItemMachineContext<any>>, EventObject>> | undefined;
|
|
3
|
+
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<EventObject, import("../../../../types").FromCallbackInput<import("../../../../types").ItemMachineContext<any>, import("../../../../types").HydrateExistingItemEvent>, EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<EventObject, import("../../../../types").FromCallbackInput<import("../../../../types").ItemMachineContext<any>>, EventObject>> | undefined;
|
|
4
4
|
}, import("xstate").Values<{
|
|
5
5
|
waitForDb: {
|
|
6
6
|
src: "waitForDb";
|
|
@@ -14,7 +14,7 @@ export declare const saveDataToDb: import("xstate").CallbackActorLogic<EventObje
|
|
|
14
14
|
};
|
|
15
15
|
hydrateExistingItem: {
|
|
16
16
|
src: "hydrateExistingItem";
|
|
17
|
-
logic: any
|
|
17
|
+
logic: import("xstate").CallbackActorLogic<EventObject, import("../../../../types").FromCallbackInput<import("../../../../types").ItemMachineContext<any>, import("../../../../types").HydrateExistingItemEvent>, EventObject>;
|
|
18
18
|
id: string | undefined;
|
|
19
19
|
};
|
|
20
20
|
hydrateNewItem: {
|
|
@@ -40,7 +40,7 @@ export declare const saveDataToDb: import("xstate").CallbackActorLogic<EventObje
|
|
|
40
40
|
};
|
|
41
41
|
hydrateExistingItem: {
|
|
42
42
|
src: "hydrateExistingItem";
|
|
43
|
-
logic: any
|
|
43
|
+
logic: import("xstate").CallbackActorLogic<EventObject, import("../../../../types").FromCallbackInput<import("../../../../types").ItemMachineContext<any>, import("../../../../types").HydrateExistingItemEvent>, EventObject>;
|
|
44
44
|
id: string | undefined;
|
|
45
45
|
};
|
|
46
46
|
hydrateNewItem: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ItemMachineContext } from '@/types';
|
|
2
2
|
export declare const itemMachineSingle: import("xstate").StateMachine<ItemMachineContext<any>, import("xstate").AnyEventObject, {
|
|
3
|
-
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<ItemMachineContext<any>>, import("xstate").EventObject>> | undefined;
|
|
3
|
+
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<ItemMachineContext<any>>, import("xstate").EventObject>> | undefined;
|
|
4
4
|
}, import("xstate").Values<{
|
|
5
5
|
waitForDb: {
|
|
6
6
|
src: "waitForDb";
|
|
@@ -14,7 +14,7 @@ export declare const itemMachineSingle: import("xstate").StateMachine<ItemMachin
|
|
|
14
14
|
};
|
|
15
15
|
hydrateExistingItem: {
|
|
16
16
|
src: "hydrateExistingItem";
|
|
17
|
-
logic: any
|
|
17
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>;
|
|
18
18
|
id: string | undefined;
|
|
19
19
|
};
|
|
20
20
|
hydrateNewItem: {
|
|
@@ -40,7 +40,7 @@ export declare const itemMachineSingle: import("xstate").StateMachine<ItemMachin
|
|
|
40
40
|
};
|
|
41
41
|
hydrateExistingItem: {
|
|
42
42
|
src: "hydrateExistingItem";
|
|
43
|
-
logic: any
|
|
43
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>;
|
|
44
44
|
id: string | undefined;
|
|
45
45
|
};
|
|
46
46
|
hydrateNewItem: {
|
|
@@ -2,7 +2,7 @@ import { ItemPropertyProps, PropertyMachineContext } from '@/types';
|
|
|
2
2
|
import { Subscriber } from 'rxjs';
|
|
3
3
|
import { immerable } from 'immer';
|
|
4
4
|
import { Static } from '@sinclair/typebox';
|
|
5
|
-
import { TProperty } from '@/browser';
|
|
5
|
+
import { TProperty } from '@/browser/property';
|
|
6
6
|
type ItemPropertyFindProps = {
|
|
7
7
|
propertyName: string;
|
|
8
8
|
propertyLocalId?: string;
|
|
@@ -28,7 +28,7 @@ export declare class ItemProperty<PropertyType> {
|
|
|
28
28
|
static cacheKey(seedLocalIdOrUid: string, propertyName: string): string;
|
|
29
29
|
getService(): import("xstate").ActorRef<import("xstate").MachineSnapshot<PropertyMachineContext, import("xstate").AnyEventObject, {
|
|
30
30
|
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<PropertyMachineContext>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").StateMachine<import("@/types").ItemMachineContext<any>, import("xstate").AnyEventObject, {
|
|
31
|
-
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>>, import("xstate").EventObject>> | undefined;
|
|
31
|
+
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>>, import("xstate").EventObject>> | undefined;
|
|
32
32
|
}, import("xstate").Values<{
|
|
33
33
|
waitForDb: {
|
|
34
34
|
src: "waitForDb";
|
|
@@ -42,7 +42,7 @@ export declare class ItemProperty<PropertyType> {
|
|
|
42
42
|
};
|
|
43
43
|
hydrateExistingItem: {
|
|
44
44
|
src: "hydrateExistingItem";
|
|
45
|
-
logic: any
|
|
45
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>;
|
|
46
46
|
id: string | undefined;
|
|
47
47
|
};
|
|
48
48
|
hydrateNewItem: {
|
|
@@ -68,7 +68,7 @@ export declare class ItemProperty<PropertyType> {
|
|
|
68
68
|
};
|
|
69
69
|
hydrateExistingItem: {
|
|
70
70
|
src: "hydrateExistingItem";
|
|
71
|
-
logic: any
|
|
71
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>;
|
|
72
72
|
id: string | undefined;
|
|
73
73
|
};
|
|
74
74
|
hydrateNewItem: {
|
|
@@ -106,7 +106,7 @@ export declare class ItemProperty<PropertyType> {
|
|
|
106
106
|
resolveRemoteStorage: {
|
|
107
107
|
src: "resolveRemoteStorage";
|
|
108
108
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").StateMachine<import("@/types").ItemMachineContext<any>, import("xstate").AnyEventObject, {
|
|
109
|
-
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>>, import("xstate").EventObject>> | undefined;
|
|
109
|
+
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>>, import("xstate").EventObject>> | undefined;
|
|
110
110
|
}, import("xstate").Values<{
|
|
111
111
|
waitForDb: {
|
|
112
112
|
src: "waitForDb";
|
|
@@ -120,7 +120,7 @@ export declare class ItemProperty<PropertyType> {
|
|
|
120
120
|
};
|
|
121
121
|
hydrateExistingItem: {
|
|
122
122
|
src: "hydrateExistingItem";
|
|
123
|
-
logic: any
|
|
123
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>;
|
|
124
124
|
id: string | undefined;
|
|
125
125
|
};
|
|
126
126
|
hydrateNewItem: {
|
|
@@ -146,7 +146,7 @@ export declare class ItemProperty<PropertyType> {
|
|
|
146
146
|
};
|
|
147
147
|
hydrateExistingItem: {
|
|
148
148
|
src: "hydrateExistingItem";
|
|
149
|
-
logic: any
|
|
149
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<import("@/types").ItemMachineContext<any>, import("@/types").HydrateExistingItemEvent>, import("xstate").EventObject>;
|
|
150
150
|
id: string | undefined;
|
|
151
151
|
};
|
|
152
152
|
hydrateNewItem: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemProperty.d.ts","sourceRoot":"","sources":["../../../../../src/browser/property/ItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ItemProperty.d.ts","sourceRoot":"","sources":["../../../../../src/browser/property/ItemProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAI9C,KAAK,qBAAqB,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAID,qBAAa,YAAY,CAAC,YAAY;IACpC,OAAO,CAAC,MAAM,CAAC,aAAa,CAGf;IACb,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsC;IAC/D,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,oBAAoB,CAAqB;IACjD,CAAC,SAAS,CAAC,UAAO;gBAKN,EACV,aAAa,EACb,OAAO,EACP,WAAW,EACX,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,SAAS,GACV,EAAE,iBAAiB;IA8IpB,OAAO,CAAC,uBAAuB;IAO/B,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,SAAS;WA0CzD,IAAI,CAAC,EAChB,YAAY,EACZ,WAAW,EACX,OAAO,GACR,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IA4BjE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;IAKvE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIV,IAAI,OAAO,WAEV;IAED,IAAI,GAAG,WAEN;IAED,IAAI,WAAW,uBAEd;IAED,IAAI,OAAO,uBAEV;IAED,IAAI,YAAY,WAKf;IAED,IAAI,aAAa,WAEhB;IAED,IAAI,WAAW,IAAI,MAAM,CAAC,OAAO,SAAS,CAAC,GAAG,SAAS,CAEtD;IAED,IAAI,MAAM,OAET;IAED,IAAI,KAAK,uBAER;IAED,IAAI,KAAK,IAOQ,GAAG,CAFnB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,EAYnB;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAItC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB3B,MAAM;CAWP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventObject } from 'xstate';
|
|
2
2
|
export declare const resolveRemoteStorage: import("xstate").CallbackActorLogic<EventObject, import("xstate").StateMachine<import("../../../types").ItemMachineContext<any>, import("xstate").AnyEventObject, {
|
|
3
|
-
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<EventObject, import("../../../types").FromCallbackInput<import("../../../types").ItemMachineContext<any>>, EventObject>> | undefined;
|
|
3
|
+
[x: string]: import("xstate").ActorRefFromLogic<any> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<EventObject, import("../../../types").FromCallbackInput<import("../../../types").ItemMachineContext<any>, import("../../../types").HydrateExistingItemEvent>, EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<EventObject, import("../../../types").FromCallbackInput<import("../../../types").ItemMachineContext<any>>, EventObject>> | undefined;
|
|
4
4
|
}, import("xstate").Values<{
|
|
5
5
|
waitForDb: {
|
|
6
6
|
src: "waitForDb";
|
|
@@ -14,7 +14,7 @@ export declare const resolveRemoteStorage: import("xstate").CallbackActorLogic<E
|
|
|
14
14
|
};
|
|
15
15
|
hydrateExistingItem: {
|
|
16
16
|
src: "hydrateExistingItem";
|
|
17
|
-
logic: any
|
|
17
|
+
logic: import("xstate").CallbackActorLogic<EventObject, import("../../../types").FromCallbackInput<import("../../../types").ItemMachineContext<any>, import("../../../types").HydrateExistingItemEvent>, EventObject>;
|
|
18
18
|
id: string | undefined;
|
|
19
19
|
};
|
|
20
20
|
hydrateNewItem: {
|
|
@@ -40,7 +40,7 @@ export declare const resolveRemoteStorage: import("xstate").CallbackActorLogic<E
|
|
|
40
40
|
};
|
|
41
41
|
hydrateExistingItem: {
|
|
42
42
|
src: "hydrateExistingItem";
|
|
43
|
-
logic: any
|
|
43
|
+
logic: import("xstate").CallbackActorLogic<EventObject, import("../../../types").FromCallbackInput<import("../../../types").ItemMachineContext<any>, import("../../../types").HydrateExistingItemEvent>, EventObject>;
|
|
44
44
|
id: string | undefined;
|
|
45
45
|
};
|
|
46
46
|
hydrateNewItem: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trash.d.ts","sourceRoot":"","sources":["../../../../../src/browser/react/trash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"trash.d.ts","sourceRoot":"","sources":["../../../../../src/browser/react/trash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI1C,eAAO,MAAM,aAAa;uBAIT,IAAI,CAAC,GAAG,CAAC;;CAmBzB,CAAA"}
|
|
@@ -2,6 +2,11 @@ import { DbServiceContext } from '@/types';
|
|
|
2
2
|
declare const dbMachine: import("xstate").StateMachine<Partial<DbServiceContext>, import("xstate").AnyEventObject, {
|
|
3
3
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, FromCallbackInput<DbServiceContext>, import("xstate").EventObject>> | undefined;
|
|
4
4
|
}, import("xstate").Values<{
|
|
5
|
+
migrate: {
|
|
6
|
+
src: "migrate";
|
|
7
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
8
|
+
id: string | undefined;
|
|
9
|
+
};
|
|
5
10
|
checkStatus: {
|
|
6
11
|
src: "checkStatus";
|
|
7
12
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
@@ -17,12 +22,12 @@ declare const dbMachine: import("xstate").StateMachine<Partial<DbServiceContext>
|
|
|
17
22
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
18
23
|
id: string | undefined;
|
|
19
24
|
};
|
|
25
|
+
}>, never, never, never, {}, string, Partial<DbServiceContext>, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, import("xstate").MachineConfig<Partial<DbServiceContext>, import("xstate").AnyEventObject, import("xstate").Values<{
|
|
20
26
|
migrate: {
|
|
21
27
|
src: "migrate";
|
|
22
28
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
23
29
|
id: string | undefined;
|
|
24
30
|
};
|
|
25
|
-
}>, never, never, never, {}, string, Partial<DbServiceContext>, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, import("xstate").MachineConfig<Partial<DbServiceContext>, import("xstate").AnyEventObject, import("xstate").Values<{
|
|
26
31
|
checkStatus: {
|
|
27
32
|
src: "checkStatus";
|
|
28
33
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
@@ -38,11 +43,6 @@ declare const dbMachine: import("xstate").StateMachine<Partial<DbServiceContext>
|
|
|
38
43
|
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
39
44
|
id: string | undefined;
|
|
40
45
|
};
|
|
41
|
-
migrate: {
|
|
42
|
-
src: "migrate";
|
|
43
|
-
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("@/types").FromCallbackInput<DbServiceContext>, import("xstate").EventObject>;
|
|
44
|
-
id: string | undefined;
|
|
45
|
-
};
|
|
46
46
|
}>, never, never, never, string, Partial<DbServiceContext>, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject>>;
|
|
47
47
|
export { dbMachine };
|
|
48
48
|
//# sourceMappingURL=dbMachine.d.ts.map
|