@seedprotocol/sdk 0.1.56 → 0.1.57
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/constants-BLctWkrn.js.map +1 -1
- package/dist/{index-Cdz3ZpGp.js → index-COcsVb0S.js} +19 -45
- package/dist/index-COcsVb0S.js.map +1 -0
- package/dist/{index-DcYDcCt6.js → index-p5KR99fK.js} +2 -2
- package/dist/index-p5KR99fK.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/{seed.schema.config-BjnTnTUw.js → seed.schema.config-CJEIY4ZZ.js} +2 -2
- package/dist/{seed.schema.config-BjnTnTUw.js.map → seed.schema.config-CJEIY4ZZ.js.map} +1 -1
- package/dist/src/hydrateFromDb.ts +15 -44
- package/dist/src/saveImageSrc.ts +2 -2
- package/dist/types/src/browser/property/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/types/src/browser/property/actors/saveValueToDb/index.d.ts.map +1 -1
- package/dist/types/src/shared/helpers/constants.d.ts +0 -1
- package/dist/types/src/shared/helpers/constants.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-Cdz3ZpGp.js.map +0 -1
- package/dist/index-DcYDcCt6.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, e as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SEEDS, b as GET_SEED_IDS, c as GET_STORAGE_TRANSACTION_ID, d as GET_VERSIONS, I as Item, g as itemMachineAll, i as itemMachineSingle } from './index-
|
|
1
|
+
export { f as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, e as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SEEDS, b as GET_SEED_IDS, c as GET_STORAGE_TRANSACTION_ID, d as GET_VERSIONS, I as Item, g as itemMachineAll, i as itemMachineSingle } from './index-COcsVb0S.js';
|
|
2
2
|
import './constants-BLctWkrn.js';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'reflect-metadata';
|
|
@@ -27,4 +27,4 @@ import '@zenfs/dom';
|
|
|
27
27
|
import 'arweave';
|
|
28
28
|
import 'use-immer';
|
|
29
29
|
import '@xstate/react';
|
|
30
|
-
//# sourceMappingURL=index-
|
|
30
|
+
//# sourceMappingURL=index-p5KR99fK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-p5KR99fK.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { h as ImageSrc, I as Item, j as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, s as client, t as getCorrectId, r as getGlobalService, m as useCreateItem, o as useDeleteItem, p as useGlobalServiceStatus, k as useItem, l as useItemProperties, n as useItemProperty, u as useItems, q as useServices, w as withSeed } from './index-
|
|
1
|
+
export { h as ImageSrc, I as Item, j as ItemProperty, J as Json, L as List, M as Model, P as Property, R as Relation, T as Text, s as client, t as getCorrectId, r as getGlobalService, m as useCreateItem, o as useDeleteItem, p as useGlobalServiceStatus, k as useItem, l as useItemProperties, n as useItemProperty, u as useItems, q as useServices, w as withSeed } from './index-COcsVb0S.js';
|
|
2
2
|
import 'immer';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
4
|
import './constants-BLctWkrn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as __decorate, a as __metadata } from './constants-BLctWkrn.js';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
|
-
import { T as Text, M as Model } from './index-
|
|
3
|
+
import { T as Text, M as Model } from './index-COcsVb0S.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'reflect-metadata';
|
|
6
6
|
import 'xstate';
|
|
@@ -74,4 +74,4 @@ const models = {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
export { models };
|
|
77
|
-
//# sourceMappingURL=seed.schema.config-
|
|
77
|
+
//# sourceMappingURL=seed.schema.config-CJEIY4ZZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.schema.config-
|
|
1
|
+
{"version":3,"file":"seed.schema.config-CJEIY4ZZ.js","sources":["../../src/shared/configs/seed.schema.config.ts"],"sourcesContent":["import { Model, Text } from '@/browser'\n\n@Model\nclass Seed {\n @Text() uid!: string\n @Text() type!: string\n}\n\n@Model\nclass Version {\n @Text() seedUid!: string\n @Text() note!: string\n}\n\n@Model\nclass Metadata {\n @Text() key!: string\n @Text() value!: string\n}\n\nexport const models = {\n Seed,\n Version,\n Metadata,\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAM,IAAI,GAAV,MAAM,IAAI,CAAA;CAGT;AAFS,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAa,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,KAAA,EAAA,KAAA,CAAA,CAAA;AACZ,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAc,CAAA,EAAA,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AAFjB,IAAI,GAAA,UAAA,CAAA;IADT;AACK,CAAA,EAAA,IAAI,CAGT;AAGD,IAAM,OAAO,GAAb,MAAM,OAAO,CAAA;CAGZ;AAFS,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAiB,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;AAChB,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAc,CAAA,EAAA,OAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AAFjB,OAAO,GAAA,UAAA,CAAA;IADZ;AACK,CAAA,EAAA,OAAO,CAGZ;AAGD,IAAM,QAAQ,GAAd,MAAM,QAAQ,CAAA;CAGb;AAFS,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAa,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,KAAA,EAAA,KAAA,CAAA,CAAA;AACZ,UAAA,CAAA;AAAP,IAAA,IAAI,EAAE;;AAAe,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;AAFlB,QAAQ,GAAA,UAAA,CAAA;IADb;AACK,CAAA,EAAA,QAAQ,CAGb;AAEY,MAAA,MAAM,GAAG;IACpB,IAAI;IACJ,OAAO;IACP,QAAQ;;;;;"}
|
|
@@ -188,57 +188,28 @@ export const hydrateFromDb = fromCallback<EventObject, typeof propertyMachine>(
|
|
|
188
188
|
renderValue: refResolvedDisplayValue,
|
|
189
189
|
})
|
|
190
190
|
|
|
191
|
-
if (
|
|
191
|
+
if (
|
|
192
|
+
propertyRecordSchema &&
|
|
193
|
+
propertyRecordSchema.storageType &&
|
|
194
|
+
propertyRecordSchema.storageType === 'ItemStorage'
|
|
195
|
+
) {
|
|
192
196
|
const { Item } = await import(`@/browser/item`)
|
|
193
197
|
const item = await Item.find({
|
|
194
198
|
seedLocalId,
|
|
195
199
|
modelName: itemModelName,
|
|
196
200
|
})
|
|
197
201
|
if (item) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
propertyValueFromDb &&
|
|
204
|
-
propertyValueFromDb.length === 43
|
|
205
|
-
) {
|
|
206
|
-
const htmlFilePath = `/files/html/${propertyValueFromDb}.html`
|
|
207
|
-
const exists = await fs.promises.exists(htmlFilePath)
|
|
208
|
-
if (!exists) {
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
const renderValue = await fs.promises
|
|
212
|
-
.readFile(htmlFilePath, 'utf8')
|
|
213
|
-
.catch((error) => {
|
|
214
|
-
logger('Error reading html file', error)
|
|
215
|
-
})
|
|
216
|
-
property
|
|
217
|
-
.getService()
|
|
218
|
-
.send({ type: 'updateRenderValue', renderValue })
|
|
219
|
-
return
|
|
220
|
-
}
|
|
221
|
-
if (
|
|
222
|
-
propertyName === 'json' &&
|
|
223
|
-
propertyValueFromDb &&
|
|
224
|
-
propertyValueFromDb.length === 43
|
|
225
|
-
) {
|
|
226
|
-
const jsonFilePath = `/files/json/${propertyValueFromDb}.json`
|
|
227
|
-
const exists = await fs.promises.exists(jsonFilePath)
|
|
228
|
-
if (!exists) {
|
|
229
|
-
return
|
|
230
|
-
}
|
|
231
|
-
const renderValue = await fs.promises
|
|
232
|
-
.readFile(jsonFilePath, 'utf8')
|
|
233
|
-
.catch((error) => {
|
|
234
|
-
logger('Error reading json file', error)
|
|
235
|
-
})
|
|
236
|
-
property
|
|
237
|
-
.getService()
|
|
238
|
-
.send({ type: 'updateRenderValue', renderValue })
|
|
239
|
-
return
|
|
240
|
-
}
|
|
202
|
+
const filePath = `/files/${localStorageDir}/${refResolvedValue}`
|
|
203
|
+
const exists = await fs.promises.exists(filePath)
|
|
204
|
+
|
|
205
|
+
if (!exists) {
|
|
206
|
+
return
|
|
241
207
|
}
|
|
208
|
+
|
|
209
|
+
const renderValue = await fs.promises.readFile(filePath, 'utf8')
|
|
210
|
+
const property = item.properties[propertyName]
|
|
211
|
+
property.getService().send({ type: 'updateRenderValue', renderValue })
|
|
212
|
+
return
|
|
242
213
|
}
|
|
243
214
|
}
|
|
244
215
|
}
|
package/dist/src/saveImageSrc.ts
CHANGED
|
@@ -158,7 +158,7 @@ export const saveImageSrc = fromCallback<
|
|
|
158
158
|
propertyValue: newImageSeedLocalId,
|
|
159
159
|
seedLocalId,
|
|
160
160
|
seedUid,
|
|
161
|
-
versionLocalId: imageVersionLocalId,
|
|
161
|
+
versionLocalId: imageVersionLocalId || versionLocalId,
|
|
162
162
|
versionUid,
|
|
163
163
|
modelName: itemModelName,
|
|
164
164
|
schemaUid,
|
|
@@ -176,7 +176,7 @@ export const saveImageSrc = fromCallback<
|
|
|
176
176
|
propertyName: propertyNameRaw,
|
|
177
177
|
newValue: newImageSeedLocalId,
|
|
178
178
|
seedLocalId,
|
|
179
|
-
versionLocalId,
|
|
179
|
+
versionLocalId: imageVersionLocalId || versionLocalId,
|
|
180
180
|
modelName: itemModelName,
|
|
181
181
|
schemaUid,
|
|
182
182
|
refSeedType: 'image',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateFromDb.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/property/actors/hydrateFromDb.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"hydrateFromDb.d.ts","sourceRoot":"","sources":["../../../../../../src/browser/property/actors/hydrateFromDb.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa,KAiNzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/property/actors/saveValueToDb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAEL,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AAEzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AAEjC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/browser/property/actors/saveValueToDb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAEL,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AAEzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AAEjC,eAAO,MAAM,YAAY,8HA0FvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/helpers/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/helpers/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,eAAe,CAAA;AACtC,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;CAgB/B,CAAA;AAED,eAAO,MAAM,qBAAqB,UAmBjC,CAAA"}
|