@seedprotocol/sdk 0.4.19 → 0.4.21
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-CAdWVQnJ.js → ArweaveClient-Cz9ZLiEV.js} +3 -3
- package/dist/{ArweaveClient-CAdWVQnJ.js.map → ArweaveClient-Cz9ZLiEV.js.map} +1 -1
- package/dist/{ArweaveClient-V62RJhsZ.js → ArweaveClient-DxpJnJXU.js} +3 -3
- package/dist/{ArweaveClient-V62RJhsZ.js.map → ArweaveClient-DxpJnJXU.js.map} +1 -1
- package/dist/{Db-DS2GBY6h.js → Db-CXwQVLZv.js} +41 -4
- package/dist/Db-CXwQVLZv.js.map +1 -0
- package/dist/{Db-8N3-le9a.js → Db-DkTBncAM.js} +4 -4
- package/dist/{Db-8N3-le9a.js.map → Db-DkTBncAM.js.map} +1 -1
- package/dist/{EasClient-D1eibg8b.js → EasClient-DjpbHjU9.js} +2 -2
- package/dist/{EasClient-D1eibg8b.js.map → EasClient-DjpbHjU9.js.map} +1 -1
- package/dist/{EasClient-nOmY5meW.js → EasClient-JYkmHxu1.js} +2 -2
- package/dist/{EasClient-nOmY5meW.js.map → EasClient-JYkmHxu1.js.map} +1 -1
- package/dist/{FileManager-DSTAwkqw.js → FileManager-CKyoLrBP.js} +2 -2
- package/dist/{FileManager-DSTAwkqw.js.map → FileManager-CKyoLrBP.js.map} +1 -1
- package/dist/{FileManager-Cze8qmS1.js → FileManager-DHnyb040.js} +34 -5
- package/dist/FileManager-DHnyb040.js.map +1 -0
- package/dist/{ModelProperty-ChevZoUy.js → ModelProperty-DWtv9fQr.js} +24 -24
- package/dist/{ModelProperty-ChevZoUy.js.map → ModelProperty-DWtv9fQr.js.map} +1 -1
- package/dist/{PathResolver-3TuYA9yv.js → PathResolver-Ce4K9acQ.js} +2 -2
- package/dist/{PathResolver-3TuYA9yv.js.map → PathResolver-Ce4K9acQ.js.map} +1 -1
- package/dist/{PathResolver-C5gj9EU2.js → PathResolver-pmw--Ea2.js} +2 -2
- package/dist/{PathResolver-C5gj9EU2.js.map → PathResolver-pmw--Ea2.js.map} +1 -1
- package/dist/{QueryClient-BGv6JOls.js → QueryClient-OUjfvY3g.js} +2 -2
- package/dist/{QueryClient-BGv6JOls.js.map → QueryClient-OUjfvY3g.js.map} +1 -1
- package/dist/{QueryClient-By2vdhIz.js → QueryClient-unspcsWa.js} +2 -2
- package/dist/{QueryClient-By2vdhIz.js.map → QueryClient-unspcsWa.js.map} +1 -1
- package/dist/{Schema-BQ5W3aOW.js → Schema-CqqcEexA.js} +38 -38
- package/dist/{Schema-BQ5W3aOW.js.map → Schema-CqqcEexA.js.map} +1 -1
- package/dist/{SchemaValidationService-DQx83Cte.js → SchemaValidationService-Cb-b4kpD.js} +2 -2
- package/dist/{SchemaValidationService-DQx83Cte.js.map → SchemaValidationService-Cb-b4kpD.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-CMsU83q9.js → backfillMetadataPropertyIds-CRyRez3h.js} +2 -2
- package/dist/{backfillMetadataPropertyIds-CMsU83q9.js.map → backfillMetadataPropertyIds-CRyRez3h.js.map} +1 -1
- package/dist/cjs/{ModelProperty-Cuj839nX.js → ModelProperty-sNx_ZQZX.js} +17 -17
- package/dist/cjs/{ModelProperty-Cuj839nX.js.map → ModelProperty-sNx_ZQZX.js.map} +1 -1
- package/dist/cjs/{Schema-TFe24NNG.js → Schema-B4RRA-0g.js} +20 -20
- package/dist/cjs/{Schema-TFe24NNG.js.map → Schema-B4RRA-0g.js.map} +1 -1
- package/dist/cjs/{SchemaValidationService-DVQrRpse.js → SchemaValidationService-DCflhpcI.js} +2 -2
- package/dist/cjs/{SchemaValidationService-DVQrRpse.js.map → SchemaValidationService-DCflhpcI.js.map} +1 -1
- package/dist/cjs/{backfillMetadataPropertyIds-BiXK4hT1.js → backfillMetadataPropertyIds-DhAXAuSf.js} +2 -2
- package/dist/cjs/{backfillMetadataPropertyIds-BiXK4hT1.js.map → backfillMetadataPropertyIds-DhAXAuSf.js.map} +1 -1
- package/dist/cjs/{getItem-FgLv9abh.js → getItem-lyM2x5pT.js} +5 -3
- package/dist/cjs/getItem-lyM2x5pT.js.map +1 -0
- package/dist/cjs/{getPublishPayload-h_Rz8nVX.js → getPublishPayload-DP2fm4q8.js} +125 -26
- package/dist/cjs/getPublishPayload-DP2fm4q8.js.map +1 -0
- package/dist/cjs/{getPublishUploads-DdSwst2x.js → getPublishUploads-DdVy-5fK.js} +69 -23
- package/dist/cjs/getPublishUploads-DdVy-5fK.js.map +1 -0
- package/dist/cjs/{getSegmentedItemProperties-Bu4P_MG8.js → getSegmentedItemProperties-DtHofn5i.js} +3 -3
- package/dist/cjs/{getSegmentedItemProperties-Bu4P_MG8.js.map → getSegmentedItemProperties-DtHofn5i.js.map} +1 -1
- package/dist/cjs/{index-pyKmk9hA.js → index-D1qR8xnb.js} +1055 -388
- package/dist/cjs/index-D1qR8xnb.js.map +1 -0
- package/dist/cjs/{index-CKJeh6ic.js → index-DTkoTvcq.js} +5 -3
- package/dist/cjs/index-DTkoTvcq.js.map +1 -0
- package/dist/cjs/{ownership-gfm5thj7.js → ownership-DanM_n8E.js} +4 -4
- package/dist/cjs/ownership-DanM_n8E.js.map +1 -0
- package/dist/cjs/{property-Dw0b_Sf8.js → property-BQokoaRe.js} +6 -4
- package/dist/cjs/{property-Dw0b_Sf8.js.map → property-BQokoaRe.js.map} +1 -1
- package/dist/db/drizzle/drizzle/0011_normalize_placeholder_uids.sql +9 -0
- package/dist/db/drizzle/drizzle/0012_html_embedded_image_co_publish.sql +10 -0
- package/dist/db/drizzle/drizzle/meta/_journal.json +14 -0
- package/dist/{getItem-Bd9U9Yih.js → getItem-VI3QqdZH.js} +5 -3
- package/dist/getItem-VI3QqdZH.js.map +1 -0
- package/dist/{getPublishPayload-eJL7ktes.js → getPublishPayload-DpYwi-rd.js} +129 -30
- package/dist/getPublishPayload-DpYwi-rd.js.map +1 -0
- package/dist/{getPublishUploads-CKm5dsL6.js → getPublishUploads-DS2dQ4Ho.js} +69 -23
- package/dist/getPublishUploads-DS2dQ4Ho.js.map +1 -0
- package/dist/{getSegmentedItemProperties-B74LN_bz.js → getSegmentedItemProperties-Bz5B4DSA.js} +3 -3
- package/dist/{getSegmentedItemProperties-B74LN_bz.js.map → getSegmentedItemProperties-Bz5B4DSA.js.map} +1 -1
- package/dist/{index-BvZCYMxA.js → index-BrD_NNaX.js} +1056 -395
- package/dist/index-BrD_NNaX.js.map +1 -0
- package/dist/index-Cqf_DxkJ.js +19 -0
- package/dist/index-Cqf_DxkJ.js.map +1 -0
- package/dist/{index-BQv2k74p.js → index-DdzhrbkF.js} +3 -2
- package/dist/index-DdzhrbkF.js.map +1 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +528 -41
- package/dist/main.js.map +1 -1
- package/dist/node.js +10 -10
- package/dist/{ownership-tVhYQomL.js → ownership-BK6suksO.js} +4 -4
- package/dist/ownership-BK6suksO.js.map +1 -0
- package/dist/{property-BOdk-wW1.js → property-C63Ddzap.js} +6 -6
- package/dist/{property-BOdk-wW1.js.map → property-C63Ddzap.js.map} +1 -1
- package/dist/{queries-DBqVwEdv.js → queries-BGuWjEqt.js} +2 -2
- package/dist/{queries-DBqVwEdv.js.map → queries-BGuWjEqt.js.map} +1 -1
- package/dist/seedSchema/HtmlEmbeddedImageCoPublishSchema.ts +25 -0
- package/dist/seedSchema/index.ts +1 -0
- package/dist/src/Item/Item.d.ts +2 -2
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/Item/service/actors/loadOrCreateItem.d.ts.map +1 -1
- package/dist/src/Item/service/itemMachineSingle.d.ts +1 -1
- package/dist/src/ItemProperty/ItemProperty.d.ts +2 -2
- package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +1 -1
- package/dist/src/Model/Model.d.ts +1 -1
- package/dist/src/Model/index.d.ts +1 -0
- package/dist/src/Model/index.d.ts.map +1 -1
- package/dist/src/Model/service/modelMachine.d.ts +3 -3
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +2 -2
- package/dist/src/Schema/Schema.d.ts +1 -1
- package/dist/src/Schema/service/schemaMachine.d.ts +3 -3
- package/dist/src/browser/db/drizzleFiles.d.ts +3 -1
- package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/src/client/ClientManager.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/src/client/events.d.ts +8 -0
- package/dist/src/client/events.d.ts.map +1 -0
- package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts +10 -0
- package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts.map +1 -0
- package/dist/src/db/read/getItem.d.ts.map +1 -1
- package/dist/src/db/read/getItemData.d.ts.map +1 -1
- package/dist/src/db/read/getItems.d.ts +9 -0
- package/dist/src/db/read/getItems.d.ts.map +1 -1
- package/dist/src/db/read/getLatestPublishedVersionRow.d.ts +11 -0
- package/dist/src/db/read/getLatestPublishedVersionRow.d.ts.map +1 -0
- package/dist/src/db/read/getMetadataAttestationUidsForSeedUid.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/read/getPublishPendingDiff.d.ts +3 -3
- package/dist/src/db/read/getPublishPendingDiff.d.ts.map +1 -1
- package/dist/src/db/read/getPublishUploads.d.ts +17 -3
- package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
- package/dist/src/db/read/getSeedPublishState.d.ts +21 -0
- package/dist/src/db/read/getSeedPublishState.d.ts.map +1 -0
- package/dist/src/db/read/subqueries/versionData.d.ts +7 -0
- package/dist/src/db/read/subqueries/versionData.d.ts.map +1 -1
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts +17 -0
- package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts.map +1 -0
- package/dist/src/db/write/updateSeedUid.d.ts +3 -1
- package/dist/src/db/write/updateSeedUid.d.ts.map +1 -1
- package/dist/src/db/write/updateVersionUid.d.ts +3 -1
- package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts +5 -1
- package/dist/src/helpers/ArweaveClient/uploadApiVerification.d.ts.map +1 -1
- package/dist/src/helpers/constants.d.ts +2 -0
- package/dist/src/helpers/constants.d.ts.map +1 -1
- package/dist/src/helpers/easUid.d.ts +13 -0
- package/dist/src/helpers/easUid.d.ts.map +1 -0
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +55 -0
- package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -0
- package/dist/src/helpers/index.d.ts +2 -0
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/mediaRef.d.ts +72 -0
- package/dist/src/helpers/mediaRef.d.ts.map +1 -0
- package/dist/src/helpers/ownership.d.ts +2 -2
- package/dist/src/helpers/property/index.d.ts +30 -0
- package/dist/src/helpers/property/index.d.ts.map +1 -1
- package/dist/src/helpers/publishConfig.d.ts +3 -4
- package/dist/src/helpers/publishConfig.d.ts.map +1 -1
- package/dist/src/helpers/waitForEntityIdle.d.ts.map +1 -1
- package/dist/src/index.d.ts +14 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/interfaces/IItem.d.ts +2 -2
- package/dist/src/interfaces/IItem.d.ts.map +1 -1
- package/dist/src/seedSchema/HtmlEmbeddedImageCoPublishSchema.d.ts +122 -0
- package/dist/src/seedSchema/HtmlEmbeddedImageCoPublishSchema.d.ts.map +1 -0
- package/dist/src/seedSchema/index.d.ts +1 -0
- package/dist/src/seedSchema/index.d.ts.map +1 -1
- package/dist/src/services/write/writeProcessMachine.d.ts +1 -1
- package/dist/src/types/index.d.ts +6 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/item.d.ts +3 -0
- package/dist/src/types/item.d.ts.map +1 -1
- package/dist/src/types/machines.d.ts +2 -0
- package/dist/src/types/machines.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/Db-DS2GBY6h.js.map +0 -1
- package/dist/FileManager-Cze8qmS1.js.map +0 -1
- package/dist/cjs/getItem-FgLv9abh.js.map +0 -1
- package/dist/cjs/getPublishPayload-h_Rz8nVX.js.map +0 -1
- package/dist/cjs/getPublishUploads-DdSwst2x.js.map +0 -1
- package/dist/cjs/index-CKJeh6ic.js.map +0 -1
- package/dist/cjs/index-pyKmk9hA.js.map +0 -1
- package/dist/cjs/ownership-gfm5thj7.js.map +0 -1
- package/dist/getItem-Bd9U9Yih.js.map +0 -1
- package/dist/getPublishPayload-eJL7ktes.js.map +0 -1
- package/dist/getPublishUploads-CKm5dsL6.js.map +0 -1
- package/dist/index-BQv2k74p.js.map +0 -1
- package/dist/index-BvZCYMxA.js.map +0 -1
- package/dist/index-BxfqPvtu.js +0 -19
- package/dist/index-BxfqPvtu.js.map +0 -1
- package/dist/ownership-tVhYQomL.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as resolveSeedIdsFromRefString,
|
|
2
|
-
import { g as getSegmentedItemProperties } from './getSegmentedItemProperties-
|
|
1
|
+
import { r as resolveSeedIdsFromRefString, t as normalizeRelationPropertyValue, u as Item, b as ModelPropertyDataTypes, v as BaseFileManager, w as getContentHash, p as BaseDb, x as htmlEmbeddedImageCoPublish, y as BaseArweaveClient } from './index-BrD_NNaX.js';
|
|
2
|
+
import { g as getSegmentedItemProperties } from './getSegmentedItemProperties-Bz5B4DSA.js';
|
|
3
3
|
import debug from 'debug';
|
|
4
|
+
import { eq } from 'drizzle-orm';
|
|
5
|
+
import 'pluralize';
|
|
4
6
|
import 'xstate';
|
|
5
7
|
import 'drizzle-orm/sqlite-core';
|
|
6
|
-
import 'drizzle-orm';
|
|
7
8
|
import 'nanoid';
|
|
8
9
|
import 'nanoid-dictionary';
|
|
9
10
|
import 'ethers';
|
|
10
|
-
import 'pluralize';
|
|
11
11
|
import '@sinclair/typebox';
|
|
12
12
|
import 'drizzle-orm/casing';
|
|
13
13
|
import 'lodash-es';
|
|
@@ -16,7 +16,7 @@ import 'eventemitter3';
|
|
|
16
16
|
import 'arweave';
|
|
17
17
|
import 'js-sha3';
|
|
18
18
|
import 'reflect-metadata';
|
|
19
|
-
import './property-
|
|
19
|
+
import './property-C63Ddzap.js';
|
|
20
20
|
|
|
21
21
|
const logger = debug('seedSdk:item:getPublishUploads');
|
|
22
22
|
const EXTENSION_TO_MIME = {
|
|
@@ -41,7 +41,7 @@ const toUint8Array = async (data) => {
|
|
|
41
41
|
}
|
|
42
42
|
return new Uint8Array(data);
|
|
43
43
|
};
|
|
44
|
-
const prepareArweaveTransaction = async (data, contentHash, contentType) => {
|
|
44
|
+
const prepareArweaveTransaction = async (data, contentHash, contentType, additionalTags) => {
|
|
45
45
|
const tags = [];
|
|
46
46
|
if (contentHash) {
|
|
47
47
|
tags.push({ name: 'Content-SHA-256', value: contentHash });
|
|
@@ -51,6 +51,9 @@ const prepareArweaveTransaction = async (data, contentHash, contentType) => {
|
|
|
51
51
|
if (contentType) {
|
|
52
52
|
tags.push({ name: 'Content-Type', value: contentType });
|
|
53
53
|
}
|
|
54
|
+
if (additionalTags?.length) {
|
|
55
|
+
tags.push(...additionalTags);
|
|
56
|
+
}
|
|
54
57
|
const tx = await BaseArweaveClient.createTransaction(data, {
|
|
55
58
|
tags: tags.length ? tags : undefined,
|
|
56
59
|
});
|
|
@@ -70,8 +73,9 @@ const getStorageDirForDataType = (dataType) => {
|
|
|
70
73
|
return BaseFileManager.getFilesPath('images');
|
|
71
74
|
}
|
|
72
75
|
};
|
|
73
|
-
const getStorageSeedUploads = async (itemStorageSeedProperties) => {
|
|
76
|
+
const getStorageSeedUploads = async (itemStorageSeedProperties, options) => {
|
|
74
77
|
const uploads = [];
|
|
78
|
+
const extra = options?.arweaveUploadTags;
|
|
75
79
|
for (const itemProperty of itemStorageSeedProperties) {
|
|
76
80
|
const snapshot = itemProperty.getService().getSnapshot();
|
|
77
81
|
const context = 'context' in snapshot ? snapshot.context : null;
|
|
@@ -91,6 +95,18 @@ const getStorageSeedUploads = async (itemStorageSeedProperties) => {
|
|
|
91
95
|
const dataType = itemProperty.propertyDef?.refValueType ??
|
|
92
96
|
itemProperty.propertyDef?.dataType ??
|
|
93
97
|
'Image';
|
|
98
|
+
if (dataType === ModelPropertyDataTypes.Html) {
|
|
99
|
+
if (options?.deferHtmlStorageSeedLocalIds?.includes(seedLocalId)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (options?.onlyHtmlStorageSeedLocalIds?.length &&
|
|
103
|
+
!options.onlyHtmlStorageSeedLocalIds.includes(seedLocalId)) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else if (options?.onlyHtmlStorageSeedLocalIds?.length) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
94
110
|
const baseDir = getStorageDirForDataType(dataType);
|
|
95
111
|
const filePath = `${baseDir}/${refResolvedValue}`;
|
|
96
112
|
const exists = await BaseFileManager.pathExists(filePath);
|
|
@@ -101,7 +117,7 @@ const getStorageSeedUploads = async (itemStorageSeedProperties) => {
|
|
|
101
117
|
const fileContents = await toUint8Array(fileBuffer);
|
|
102
118
|
const contentHash = await getContentHash(fileContents);
|
|
103
119
|
const contentType = getMimeTypeFromPath(refResolvedValue);
|
|
104
|
-
const transaction = await prepareArweaveTransaction(fileContents, contentHash, contentType);
|
|
120
|
+
const transaction = await prepareArweaveTransaction(fileContents, contentHash, contentType, extra);
|
|
105
121
|
uploads.push({
|
|
106
122
|
itemPropertyName: itemProperty.propertyName,
|
|
107
123
|
itemPropertyLocalId: itemProperty.localId,
|
|
@@ -112,6 +128,32 @@ const getStorageSeedUploads = async (itemStorageSeedProperties) => {
|
|
|
112
128
|
}
|
|
113
129
|
return uploads;
|
|
114
130
|
};
|
|
131
|
+
async function appendCoPublishedImageUploads(item, uploads, options) {
|
|
132
|
+
const appDb = BaseDb.getAppDb();
|
|
133
|
+
if (!appDb || options?.onlyHtmlStorageSeedLocalIds?.length)
|
|
134
|
+
return uploads;
|
|
135
|
+
const rows = await appDb
|
|
136
|
+
.select()
|
|
137
|
+
.from(htmlEmbeddedImageCoPublish)
|
|
138
|
+
.where(eq(htmlEmbeddedImageCoPublish.parentSeedLocalId, item.seedLocalId));
|
|
139
|
+
const seen = new Set(uploads.map((u) => u.seedLocalId));
|
|
140
|
+
for (const row of rows) {
|
|
141
|
+
if (seen.has(row.imageSeedLocalId))
|
|
142
|
+
continue;
|
|
143
|
+
const imageItem = await Item.find({ seedLocalId: row.imageSeedLocalId, modelName: 'Image' });
|
|
144
|
+
if (!imageItem)
|
|
145
|
+
continue;
|
|
146
|
+
const { itemImageProperties } = await getSegmentedItemProperties(imageItem);
|
|
147
|
+
const more = await getStorageSeedUploads(itemImageProperties, options);
|
|
148
|
+
for (const u of more) {
|
|
149
|
+
if (!seen.has(u.seedLocalId)) {
|
|
150
|
+
uploads.push(u);
|
|
151
|
+
seen.add(u.seedLocalId);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return uploads;
|
|
156
|
+
}
|
|
115
157
|
/**
|
|
116
158
|
* True if publish would include at least one Arweave upload (local file / storage seed present).
|
|
117
159
|
* Does not create Arweave transactions or hit the network — use for routing (e.g. skip EAS-only)
|
|
@@ -209,7 +251,8 @@ async function itemHasPublishUploadCandidates(item, relatedItemProperty) {
|
|
|
209
251
|
}
|
|
210
252
|
return false;
|
|
211
253
|
}
|
|
212
|
-
const processUploadProperty = async (uploadProperty, uploads, relatedItemProperty) => {
|
|
254
|
+
const processUploadProperty = async (uploadProperty, uploads, relatedItemProperty, options) => {
|
|
255
|
+
const extra = options?.arweaveUploadTags;
|
|
213
256
|
const itemProperty = uploadProperty.itemProperty;
|
|
214
257
|
const childUploads = [];
|
|
215
258
|
for (const childProperty of uploadProperty.childProperties) {
|
|
@@ -285,7 +328,7 @@ const processUploadProperty = async (uploadProperty, uploads, relatedItemPropert
|
|
|
285
328
|
else if (childUploads.length > 0) {
|
|
286
329
|
contentType = 'application/octet-stream';
|
|
287
330
|
}
|
|
288
|
-
transaction = await prepareArweaveTransaction(uint8Array, contentHash, contentType);
|
|
331
|
+
transaction = await prepareArweaveTransaction(uint8Array, contentHash, contentType, extra);
|
|
289
332
|
let itemPropertyLocalId = relatedItemProperty
|
|
290
333
|
? relatedItemProperty.localId
|
|
291
334
|
: itemProperty.localId;
|
|
@@ -301,21 +344,24 @@ const processUploadProperty = async (uploadProperty, uploads, relatedItemPropert
|
|
|
301
344
|
});
|
|
302
345
|
return uploads;
|
|
303
346
|
};
|
|
304
|
-
const getPublishUploads = async (item, uploads = [], relatedItemProperty) => {
|
|
305
|
-
// if (item.modelName === 'Post') {
|
|
306
|
-
// if (!item.authors) {
|
|
307
|
-
// item.authors = [
|
|
308
|
-
// 'Sr0bIx9Fwj',
|
|
309
|
-
// '0xc2879650e9503a303ceb46f966e55baab480b267dc20cede23ef503622eee6d7',
|
|
310
|
-
// ]
|
|
311
|
-
// }
|
|
312
|
-
// }
|
|
347
|
+
const getPublishUploads = async (item, uploads = [], relatedItemProperty, options) => {
|
|
313
348
|
const { itemUploadProperties, itemRelationProperties, itemImageProperties } = await getSegmentedItemProperties(item);
|
|
349
|
+
if (!relatedItemProperty && options?.onlyHtmlStorageSeedLocalIds?.length) {
|
|
350
|
+
const storageSeedUploads = await getStorageSeedUploads(itemImageProperties, options);
|
|
351
|
+
uploads.push(...storageSeedUploads);
|
|
352
|
+
return uploads;
|
|
353
|
+
}
|
|
314
354
|
for (const uploadProperty of itemUploadProperties) {
|
|
315
|
-
uploads = await processUploadProperty(uploadProperty, uploads, relatedItemProperty);
|
|
355
|
+
uploads = await processUploadProperty(uploadProperty, uploads, relatedItemProperty, options);
|
|
316
356
|
}
|
|
317
|
-
const storageSeedUploads = await getStorageSeedUploads(itemImageProperties);
|
|
357
|
+
const storageSeedUploads = await getStorageSeedUploads(itemImageProperties, options);
|
|
318
358
|
uploads.push(...storageSeedUploads);
|
|
359
|
+
if (!relatedItemProperty && !options?.onlyHtmlStorageSeedLocalIds?.length) {
|
|
360
|
+
uploads = await appendCoPublishedImageUploads(item, uploads, options);
|
|
361
|
+
}
|
|
362
|
+
if (options?.skipRelationRecursion) {
|
|
363
|
+
return uploads;
|
|
364
|
+
}
|
|
319
365
|
for (const relationProperty of itemRelationProperties) {
|
|
320
366
|
const snapshot = relationProperty.getService().getSnapshot();
|
|
321
367
|
const context = 'context' in snapshot ? snapshot.context : null;
|
|
@@ -337,10 +383,10 @@ const getPublishUploads = async (item, uploads = [], relatedItemProperty) => {
|
|
|
337
383
|
if (!relatedItem) {
|
|
338
384
|
throw new Error(`No relatedItem found for ${relationProperty.propertyName}`);
|
|
339
385
|
}
|
|
340
|
-
uploads = await getPublishUploads(relatedItem, uploads, relationProperty);
|
|
386
|
+
uploads = await getPublishUploads(relatedItem, uploads, relationProperty, options);
|
|
341
387
|
}
|
|
342
388
|
return uploads;
|
|
343
389
|
};
|
|
344
390
|
|
|
345
391
|
export { getPublishUploads, itemHasPublishUploadCandidates, prepareArweaveTransaction };
|
|
346
|
-
//# sourceMappingURL=getPublishUploads-
|
|
392
|
+
//# sourceMappingURL=getPublishUploads-DS2dQ4Ho.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPublishUploads-DS2dQ4Ho.js","sources":["../../src/db/read/getPublishUploads.ts"],"sourcesContent":["import { BaseFileManager } from '@/helpers'\nimport {\n normalizeRelationPropertyValue,\n resolveSeedIdsFromRefString,\n} from '@/helpers/relationSeedRef'\nimport { BaseArweaveClient } from '@/helpers/ArweaveClient/BaseArweaveClient'\nimport { getSegmentedItemProperties } from '@/helpers/getSegmentedItemProperties'\nimport debug from 'debug'\nimport { IItem, IItemProperty } from '@/interfaces'\nimport { getContentHash } from '@/helpers/crypto'\nimport { Item } from '@/Item/Item'\nimport type { ArweaveTransaction, TransactionTag } from '@/types/arweave'\nimport { PublishUpload } from '@/types/publish'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { htmlEmbeddedImageCoPublish } from '@/seedSchema/HtmlEmbeddedImageCoPublishSchema'\nimport { eq } from 'drizzle-orm'\nimport { ModelPropertyDataTypes } from '@/helpers/property'\n\nconst logger = debug('seedSdk:item:getPublishUploads')\n\n/** Optional tags merged into each Arweave tx after Content-SHA-256 / Content-Type. */\nexport type GetPublishUploadsOptions = {\n arweaveUploadTags?: TransactionTag[]\n /**\n * Html storage seed local ids to skip (phase 1 of two-phase embedded-image publish).\n */\n deferHtmlStorageSeedLocalIds?: string[]\n /**\n * When set, only Html storage seeds in this list are included (phase 2). Non-Html storage uploads are omitted.\n */\n onlyHtmlStorageSeedLocalIds?: string[]\n /** When true, do not recurse into relation properties (phase 2 must not re-upload related items). */\n skipRelationRecursion?: boolean\n}\n\nconst EXTENSION_TO_MIME: Record<string, string> = {\n png: 'image/png',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n gif: 'image/gif',\n webp: 'image/webp',\n svg: 'image/svg+xml',\n html: 'text/html',\n htm: 'text/html',\n json: 'application/json',\n txt: 'text/plain',\n}\n\nconst getMimeTypeFromPath = (filePathOrName: string): string | undefined => {\n const ext = filePathOrName.split('.').pop()?.toLowerCase()\n return ext ? EXTENSION_TO_MIME[ext] : undefined\n}\n\nconst toUint8Array = async (data: Buffer | Blob): Promise<Uint8Array> => {\n if (typeof Blob !== 'undefined' && data instanceof Blob) {\n return new Uint8Array(await data.arrayBuffer())\n }\n return new Uint8Array(data as Buffer)\n}\n\nexport const prepareArweaveTransaction = async (\n data: string | Uint8Array,\n contentHash: string | undefined,\n contentType?: string,\n additionalTags?: TransactionTag[],\n): Promise<ArweaveTransaction> => {\n const tags: TransactionTag[] = []\n if (contentHash) {\n tags.push({ name: 'Content-SHA-256', value: contentHash })\n logger('contentHash', contentHash)\n logger('adding content hash tag')\n }\n if (contentType) {\n tags.push({ name: 'Content-Type', value: contentType })\n }\n if (additionalTags?.length) {\n tags.push(...additionalTags)\n }\n\n const tx = await BaseArweaveClient.createTransaction(data, {\n tags: tags.length ? tags : undefined,\n })\n\n return tx\n}\n\n\nconst getStorageDirForDataType = (dataType: string): string => {\n switch (dataType) {\n case 'Image':\n return BaseFileManager.getFilesPath('images')\n case 'File':\n return BaseFileManager.getFilesPath('files')\n case 'Html':\n return BaseFileManager.getFilesPath('html')\n case 'Json':\n return BaseFileManager.getFilesPath('json')\n default:\n return BaseFileManager.getFilesPath('images')\n }\n}\n\nconst getStorageSeedUploads = async (\n itemStorageSeedProperties: IItemProperty<any>[],\n options?: GetPublishUploadsOptions,\n) => {\n const uploads: PublishUpload[] = []\n const extra = options?.arweaveUploadTags\n\n for (const itemProperty of itemStorageSeedProperties) {\n const snapshot = itemProperty.getService().getSnapshot()\n const context = 'context' in snapshot ? snapshot.context : null\n if (!context) {\n continue\n }\n const propertyValue = (context as any).propertyValue\n const refResolvedValue = (context as any).refResolvedValue\n if (!refResolvedValue) {\n continue\n }\n\n // propertyValue is the storage seed's seedLocalId; use it for the upload so processRelationOrImageProperty can match\n const { seedLocalId } = resolveSeedIdsFromRefString(\n normalizeRelationPropertyValue(propertyValue) ?? '',\n )\n if (!seedLocalId) {\n continue\n }\n\n const dataType =\n itemProperty.propertyDef?.refValueType ??\n itemProperty.propertyDef?.dataType ??\n 'Image'\n\n if (dataType === ModelPropertyDataTypes.Html) {\n if (options?.deferHtmlStorageSeedLocalIds?.includes(seedLocalId)) {\n continue\n }\n if (\n options?.onlyHtmlStorageSeedLocalIds?.length &&\n !options.onlyHtmlStorageSeedLocalIds.includes(seedLocalId)\n ) {\n continue\n }\n } else if (options?.onlyHtmlStorageSeedLocalIds?.length) {\n continue\n }\n\n const baseDir = getStorageDirForDataType(dataType)\n const filePath = `${baseDir}/${refResolvedValue}`\n\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n continue\n }\n\n const fileBuffer = await BaseFileManager.readFileAsBuffer(filePath)\n const fileContents = await toUint8Array(fileBuffer)\n\n const contentHash = await getContentHash(fileContents)\n const contentType = getMimeTypeFromPath(refResolvedValue)\n\n const transaction = await prepareArweaveTransaction(\n fileContents,\n contentHash,\n contentType,\n extra,\n )\n\n uploads.push({\n itemPropertyName: itemProperty.propertyName,\n itemPropertyLocalId: itemProperty.localId,\n seedLocalId,\n versionLocalId: itemProperty.versionLocalId!,\n transactionToSign: transaction,\n })\n }\n\n return uploads\n}\n\nasync function appendCoPublishedImageUploads(\n item: IItem<any>,\n uploads: PublishUpload[],\n options?: GetPublishUploadsOptions,\n): Promise<PublishUpload[]> {\n const appDb = BaseDb.getAppDb()\n if (!appDb || options?.onlyHtmlStorageSeedLocalIds?.length) return uploads\n\n const rows = await appDb\n .select()\n .from(htmlEmbeddedImageCoPublish)\n .where(eq(htmlEmbeddedImageCoPublish.parentSeedLocalId, item.seedLocalId))\n\n const seen = new Set(uploads.map((u) => u.seedLocalId))\n\n for (const row of rows) {\n if (seen.has(row.imageSeedLocalId)) continue\n const imageItem = await Item.find({ seedLocalId: row.imageSeedLocalId, modelName: 'Image' })\n if (!imageItem) continue\n const { itemImageProperties } = await getSegmentedItemProperties(imageItem)\n const more = await getStorageSeedUploads(itemImageProperties, options)\n for (const u of more) {\n if (!seen.has(u.seedLocalId)) {\n uploads.push(u)\n seen.add(u.seedLocalId)\n }\n }\n }\n return uploads\n}\n\nexport type UploadProperty = {\n itemProperty: IItemProperty<any>\n childProperties: IItemProperty<any>[]\n}\ntype ChildUploadData = {\n propertyName: string\n localStoragePath: string\n}\n\n/**\n * True if publish would include at least one Arweave upload (local file / storage seed present).\n * Does not create Arweave transactions or hit the network — use for routing (e.g. skip EAS-only)\n * when {@link getPublishUploads} would fail early (e.g. gateway unreachable during tx creation).\n */\nasync function storageSeedHasUploadCandidates(\n itemStorageSeedProperties: IItemProperty<any>[],\n): Promise<boolean> {\n for (const itemProperty of itemStorageSeedProperties) {\n const snapshot = itemProperty.getService().getSnapshot()\n const context = 'context' in snapshot ? snapshot.context : null\n if (!context) {\n continue\n }\n const propertyValue = (context as any).propertyValue\n const refResolvedValue = (context as any).refResolvedValue\n if (!refResolvedValue) {\n continue\n }\n\n const { seedLocalId } = resolveSeedIdsFromRefString(\n normalizeRelationPropertyValue(propertyValue) ?? '',\n )\n if (!seedLocalId) {\n continue\n }\n\n const dataType =\n itemProperty.propertyDef?.refValueType ??\n itemProperty.propertyDef?.dataType ??\n 'Image'\n const baseDir = getStorageDirForDataType(dataType)\n const filePath = `${baseDir}/${refResolvedValue}`\n\n if (await BaseFileManager.pathExists(filePath)) {\n return true\n }\n }\n\n return false\n}\n\nasync function uploadPropertyWouldUpload(\n uploadProperty: UploadProperty,\n relatedItemProperty?: IItemProperty<any>,\n): Promise<boolean> {\n const childUploads: ChildUploadData[] = []\n\n for (const childProperty of uploadProperty.childProperties) {\n const filePath = childProperty.localStoragePath\n\n if (!filePath || filePath.endsWith('undefined')) {\n continue\n }\n\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n continue\n }\n\n childUploads.push({\n propertyName: childProperty.propertyName,\n localStoragePath: filePath,\n })\n }\n\n if (childUploads.length > 0) {\n return true\n }\n\n if (relatedItemProperty && relatedItemProperty.localStoragePath) {\n const filePath = relatedItemProperty.localStoragePath\n\n if (!filePath || filePath.endsWith('undefined')) {\n return false\n }\n\n return await BaseFileManager.pathExists(filePath)\n }\n\n return false\n}\n\nexport async function itemHasPublishUploadCandidates(\n item: IItem<any>,\n relatedItemProperty?: IItemProperty<any>,\n): Promise<boolean> {\n const { itemUploadProperties, itemRelationProperties, itemImageProperties } =\n await getSegmentedItemProperties(item)\n\n for (const uploadProperty of itemUploadProperties) {\n if (await uploadPropertyWouldUpload(uploadProperty, relatedItemProperty)) {\n return true\n }\n }\n\n if (await storageSeedHasUploadCandidates(itemImageProperties)) {\n return true\n }\n\n for (const relationProperty of itemRelationProperties) {\n const snapshot = relationProperty.getService().getSnapshot()\n const context = 'context' in snapshot ? snapshot.context : null\n if (!context) {\n continue\n }\n const propertyValue = (context as any).propertyValue\n\n if (!propertyValue || relationProperty.uid) {\n continue\n }\n\n const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(\n normalizeRelationPropertyValue(propertyValue) ?? '',\n )\n if (!seedLocalId && !seedUid) {\n throw new Error(\n `Invalid relation value for ${relationProperty.propertyName}: expected local seed id or 0x uid`,\n )\n }\n\n const relatedItem = await Item.find({\n seedLocalId,\n seedUid,\n })\n\n if (!relatedItem) {\n throw new Error(\n `No relatedItem found for ${relationProperty.propertyName}`,\n )\n }\n\n if (await itemHasPublishUploadCandidates(relatedItem, relationProperty)) {\n return true\n }\n }\n\n return false\n}\n\nconst processUploadProperty = async (\n uploadProperty: UploadProperty,\n uploads: PublishUpload[],\n relatedItemProperty?: IItemProperty<any>,\n options?: GetPublishUploadsOptions,\n): Promise<PublishUpload[]> => {\n const extra = options?.arweaveUploadTags\n const itemProperty = uploadProperty.itemProperty\n\n const childUploads: ChildUploadData[] = []\n\n for (const childProperty of uploadProperty.childProperties) {\n const filePath = childProperty.localStoragePath\n\n if (!filePath || filePath.endsWith('undefined')) {\n continue\n }\n\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n continue\n }\n\n childUploads.push({\n propertyName: childProperty.propertyName,\n localStoragePath: filePath,\n })\n }\n\n let fileContents\n let transaction: ArweaveTransaction\n\n if (!childUploads || childUploads.length === 0) {\n if (relatedItemProperty && relatedItemProperty.localStoragePath) {\n const filePath = relatedItemProperty.localStoragePath\n\n if (!filePath || filePath.endsWith('undefined')) {\n return uploads\n }\n\n const exists = await BaseFileManager.pathExists(filePath)\n if (!exists) {\n return uploads\n }\n\n try {\n const fileBuffer = await BaseFileManager.readFileAsBuffer(filePath)\n fileContents = await toUint8Array(fileBuffer)\n } catch (e) {\n const fs = await BaseFileManager.getFs()\n fileContents = await toUint8Array(fs.readFileSync(filePath))\n }\n }\n if (!fileContents) {\n return uploads\n }\n }\n\n if (childUploads.length > 0) {\n const separator = '===FILE_SEPARATOR==='\n // let compositeFileContents = `${itemProperty.propertyName}${separator}${mainFileContents}`\n let compositeFileContents = ''\n\n for (const childUpload of childUploads) {\n let childUploadContents\n\n const fs = await BaseFileManager.getFs()\n\n try {\n childUploadContents = await fs.promises.readFile(\n childUpload.localStoragePath,\n )\n } catch (e) {\n childUploadContents = fs.readFileSync(childUpload.localStoragePath)\n }\n\n compositeFileContents += `${separator}${childUpload.propertyName}${separator}${childUploadContents}`\n }\n\n if (typeof document !== 'undefined') {\n fileContents = new TextEncoder().encode(compositeFileContents)\n } else {\n fileContents = Buffer.from(compositeFileContents)\n }\n }\n\n if (!fileContents) {\n throw new Error(`No file contents found for ${itemProperty.propertyName}`)\n }\n\n const uint8Array = new Uint8Array(fileContents)\n\n const contentHash = await getContentHash(uint8Array)\n\n let contentType: string | undefined\n if (childUploads.length === 0 && relatedItemProperty?.localStoragePath) {\n contentType = getMimeTypeFromPath(relatedItemProperty.localStoragePath)\n } else if (childUploads.length > 0) {\n contentType = 'application/octet-stream'\n }\n\n transaction = await prepareArweaveTransaction(\n uint8Array,\n contentHash,\n contentType,\n extra,\n )\n\n let itemPropertyLocalId = relatedItemProperty\n ? relatedItemProperty.localId\n : itemProperty.localId\n let itemPropertyName = relatedItemProperty\n ? relatedItemProperty.propertyName\n : itemProperty.propertyName\n\n uploads.push({\n itemPropertyName,\n itemPropertyLocalId,\n seedLocalId: itemProperty.seedLocalId!,\n versionLocalId: itemProperty.versionLocalId!,\n transactionToSign: transaction,\n })\n\n return uploads\n}\n\nexport const getPublishUploads = async (\n item: IItem<any>,\n uploads: PublishUpload[] = [],\n relatedItemProperty?: IItemProperty<any>,\n options?: GetPublishUploadsOptions,\n) => {\n const { itemUploadProperties, itemRelationProperties, itemImageProperties } =\n await getSegmentedItemProperties(item)\n\n if (!relatedItemProperty && options?.onlyHtmlStorageSeedLocalIds?.length) {\n const storageSeedUploads = await getStorageSeedUploads(itemImageProperties, options)\n uploads.push(...storageSeedUploads)\n return uploads\n }\n\n for (const uploadProperty of itemUploadProperties) {\n uploads = await processUploadProperty(\n uploadProperty,\n uploads,\n relatedItemProperty,\n options,\n )\n }\n\n const storageSeedUploads = await getStorageSeedUploads(itemImageProperties, options)\n uploads.push(...storageSeedUploads)\n\n if (!relatedItemProperty && !options?.onlyHtmlStorageSeedLocalIds?.length) {\n uploads = await appendCoPublishedImageUploads(item, uploads, options)\n }\n\n if (options?.skipRelationRecursion) {\n return uploads\n }\n\n for (const relationProperty of itemRelationProperties) {\n const snapshot = relationProperty.getService().getSnapshot()\n const context = 'context' in snapshot ? snapshot.context : null\n if (!context) {\n continue\n }\n const propertyValue = (context as any).propertyValue\n\n if (!propertyValue || relationProperty.uid) {\n continue\n }\n\n const { seedLocalId, seedUid } = resolveSeedIdsFromRefString(\n normalizeRelationPropertyValue(propertyValue) ?? '',\n )\n if (!seedLocalId && !seedUid) {\n throw new Error(\n `Invalid relation value for ${relationProperty.propertyName}: expected local seed id or 0x uid`,\n )\n }\n\n const relatedItem = await Item.find({\n seedLocalId,\n seedUid,\n })\n\n if (!relatedItem) {\n throw new Error(\n `No relatedItem found for ${relationProperty.propertyName}`,\n )\n }\n\n uploads = await getPublishUploads(relatedItem, uploads, relationProperty, options)\n }\n\n return uploads\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,MAAM,GAAG,KAAK,CAAC,gCAAgC,CAAC;AAiBtD,MAAM,iBAAiB,GAA2B;AAChD,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,GAAG,EAAE,eAAe;AACpB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,IAAI,EAAE,kBAAkB;AACxB,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
import 'reflect-metadata';
|
|
2
|
-
import { b as ModelPropertyDataTypes,
|
|
3
|
-
import { getPropertySchema } from './property-
|
|
2
|
+
import { b as ModelPropertyDataTypes, p as BaseDb, A as models, C as properties } from './index-BrD_NNaX.js';
|
|
3
|
+
import { getPropertySchema } from './property-C63Ddzap.js';
|
|
4
4
|
import { eq, and } from 'drizzle-orm';
|
|
5
5
|
import { upperFirst, camelCase } from 'lodash-es';
|
|
6
6
|
|
|
@@ -142,4 +142,4 @@ const getSegmentedItemProperties = async (item) => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
export { getSegmentedItemProperties as g };
|
|
145
|
-
//# sourceMappingURL=getSegmentedItemProperties-
|
|
145
|
+
//# sourceMappingURL=getSegmentedItemProperties-Bz5B4DSA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSegmentedItemProperties-B74LN_bz.js","sources":["../../src/helpers/getSegmentedItemProperties.ts"],"sourcesContent":["import { UploadProperty } from '@/db/read/getPublishUploads'\nimport { IItem } from '@/interfaces'\nimport { ModelPropertyDataTypes } from '@/Schema'\nimport { getPropertySchema, TProperty } from '@/helpers/property'\nimport type { Static } from '@sinclair/typebox'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { models, properties } from '@/seedSchema'\nimport { eq, and } from 'drizzle-orm'\nimport { camelCase, upperFirst } from 'lodash-es'\nasync function resolvePropertyDef(\n modelName: string,\n propertyName: string,\n): Promise<{ dataType?: string; ref?: string; refValueType?: string; storageType?: string; localStorageDir?: string; filenameSuffix?: string; required?: boolean } | undefined> {\n let schema = await getPropertySchema(modelName, propertyName)\n if (schema) return schema\n const db = BaseDb.getAppDb()\n if (!db) return undefined\n try {\n const normalizedModelName = upperFirst(camelCase(modelName))\n const modelRecords = await db\n .select({ id: models.id })\n .from(models)\n .where(eq(models.name, normalizedModelName))\n .limit(1)\n if (modelRecords.length === 0 || !modelRecords[0].id) return undefined\n const propertyRecords = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.modelId, modelRecords[0].id),\n eq(properties.name, propertyName),\n ),\n )\n .limit(1)\n if (propertyRecords.length === 0) return undefined\n const propRecord = propertyRecords[0]\n let refModelName: string | undefined\n if (propRecord.refModelId != null) {\n const refModelRows = await db\n .select({ name: models.name })\n .from(models)\n .where(eq(models.id, propRecord.refModelId))\n .limit(1)\n refModelName = refModelRows[0]?.name ?? undefined\n }\n return {\n dataType: propRecord.dataType,\n ref: refModelName ?? undefined,\n refValueType: propRecord.refValueType || undefined,\n storageType: propRecord.storageType || undefined,\n localStorageDir: propRecord.localStorageDir || undefined,\n filenameSuffix: propRecord.filenameSuffix || undefined,\n required: propRecord.required ?? undefined,\n }\n } catch {\n return undefined\n }\n}\n\nexport const getSegmentedItemProperties = async (item: IItem<any>) => {\n const itemBasicProperties = []\n const itemRelationProperties = []\n const itemListProperties = []\n const itemUploadProperties: UploadProperty[] = []\n const itemImageProperties = []\n const itemStorageProperties = []\n let itemStorageTransactionProperty: UploadProperty | undefined\n\n for (const itemProperty of item.properties) {\n let propertyDef = itemProperty.propertyDef\n // When propertyDef is missing (e.g. external app, Model not registered), resolve inline\n // so properties are not skipped and metadata attestations can be created\n if (!propertyDef && item.modelName) {\n const resolved = await resolvePropertyDef(item.modelName, itemProperty.propertyName)\n if (resolved) {\n itemProperty.getService().send({ type: 'updateContext', propertyRecordSchema: resolved })\n propertyDef = resolved as Static<typeof TProperty>\n } else {\n // Last resort: Model and DB don't have schema. Use Text so property routes to\n // itemBasicProperties and can be attested (covers title, description, etc.)\n const fallbackDef = { dataType: 'Text' as const }\n itemProperty.getService().send({ type: 'updateContext', propertyRecordSchema: fallbackDef })\n propertyDef = fallbackDef as Static<typeof TProperty>\n }\n }\n if (!propertyDef) {\n continue\n }\n\n const isItemStorage =\n propertyDef.storageType &&\n propertyDef.storageType === 'ItemStorage'\n\n\n const isStorageTransaction =\n itemProperty.propertyName === 'storageTransactionId' ||\n itemProperty.propertyName === 'storage_transaction_id'\n\n const isStorageSeedType =\n propertyDef.dataType === ModelPropertyDataTypes.Image ||\n propertyDef.dataType === ModelPropertyDataTypes.File ||\n propertyDef.dataType === ModelPropertyDataTypes.Html ||\n propertyDef.dataType === ModelPropertyDataTypes.Json ||\n (propertyDef.dataType === ModelPropertyDataTypes.Relation &&\n (propertyDef.refValueType === ModelPropertyDataTypes.Image ||\n propertyDef.refValueType === ModelPropertyDataTypes.File ||\n propertyDef.refValueType === ModelPropertyDataTypes.Html ||\n propertyDef.refValueType === ModelPropertyDataTypes.Json))\n\n if (isStorageSeedType) {\n itemImageProperties.push(itemProperty)\n if (propertyDef.dataType === ModelPropertyDataTypes.Relation) {\n itemRelationProperties.push(itemProperty)\n }\n continue\n }\n\n if (propertyDef.dataType === ModelPropertyDataTypes.Relation) {\n itemRelationProperties.push(itemProperty)\n continue\n }\n\n if (propertyDef.dataType === ModelPropertyDataTypes.List) {\n // List-of-relations: ref present, goes to processListProperty\n // List-of-primitives: ref absent, treat as basic property\n const listRef =\n propertyDef.ref || (propertyDef as { refModelName?: string }).refModelName\n if (listRef) {\n itemListProperties.push(itemProperty)\n } else {\n itemBasicProperties.push(itemProperty)\n }\n continue\n }\n\n if (isItemStorage) {\n itemStorageProperties.push(itemProperty)\n continue\n }\n\n if (isStorageTransaction) {\n itemStorageTransactionProperty = { itemProperty, childProperties: [] }\n continue\n }\n\n itemBasicProperties.push(itemProperty)\n }\n\n if (itemStorageTransactionProperty && itemStorageProperties.length > 0) {\n itemStorageTransactionProperty.childProperties = itemStorageProperties\n }\n\n if (itemStorageTransactionProperty) {\n itemUploadProperties.push(itemStorageTransactionProperty)\n }\n\n return {\n itemBasicProperties,\n itemRelationProperties,\n itemListProperties,\n itemUploadProperties,\n itemImageProperties,\n }\n}\n"],"names":[],"mappings":";;;;;;AASA,eAAe,kBAAkB,CAC/B,SAAiB,EACjB,YAAoB,EAAA;IAEpB,IAAI,MAAM,GAAG,MAAM,iBAAiB,CAAC,SAAS,EAAE,YAAY,CAAC;AAC7D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C3C;YACA;QACF;QAEA,IAAI,WAAW,CAAC,QAAQ,KAAK,sBAAsB,CAAC,QAAQ,EAAE;AAC5D,YAAA,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC;YACzC;QACF;QAEA,IAAI,WAAW,CAAC,QAAQ,KAAK,sBAAsB,CAAC,IAAI,EAAE;;;YAGxD,MAAM,OAAO,GACX,WAAW,CAAC,GAAG,IAAK,WAAyC,CAAC,YAAY;YAC5E,IAAI,OAAO,EAAE;AACX,gBAAA,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC;YACvC;iBAAO;AACL,gBAAA,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC;YACxC;YACA;QACF;QAEA,IAAI,aAAa,EAAE;AACjB,YAAA,qBAAqB,CAAC,IAAI,CAAC,YAAY,CAAC;YACxC;QACF;QAEA,IAAI,oBAAoB,EAAE;YACxB,8BAA8B,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,EAAE;YACtE;QACF;AAEA,QAAA,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC;IACxC;IAEA,IAAI,8BAA8B,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE;AACtE,QAAA,8BAA8B,CAAC,eAAe,GAAG,qBAAqB;IACxE;IAEA,IAAI,8BAA8B,EAAE;AAClC,QAAA,oBAAoB,CAAC,IAAI,CAAC,8BAA8B,CAAC;IAC3D;IAEA,OAAO;QACL,mBAAmB;QACnB,sBAAsB;QACtB,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;KACpB;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"getSegmentedItemProperties-Bz5B4DSA.js","sources":["../../src/helpers/getSegmentedItemProperties.ts"],"sourcesContent":["import { UploadProperty } from '@/db/read/getPublishUploads'\nimport { IItem } from '@/interfaces'\nimport { ModelPropertyDataTypes } from '@/Schema'\nimport { getPropertySchema, TProperty } from '@/helpers/property'\nimport type { Static } from '@sinclair/typebox'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { models, properties } from '@/seedSchema'\nimport { eq, and } from 'drizzle-orm'\nimport { camelCase, upperFirst } from 'lodash-es'\nasync function resolvePropertyDef(\n modelName: string,\n propertyName: string,\n): Promise<{ dataType?: string; ref?: string; refValueType?: string; storageType?: string; localStorageDir?: string; filenameSuffix?: string; required?: boolean } | undefined> {\n let schema = await getPropertySchema(modelName, propertyName)\n if (schema) return schema\n const db = BaseDb.getAppDb()\n if (!db) return undefined\n try {\n const normalizedModelName = upperFirst(camelCase(modelName))\n const modelRecords = await db\n .select({ id: models.id })\n .from(models)\n .where(eq(models.name, normalizedModelName))\n .limit(1)\n if (modelRecords.length === 0 || !modelRecords[0].id) return undefined\n const propertyRecords = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.modelId, modelRecords[0].id),\n eq(properties.name, propertyName),\n ),\n )\n .limit(1)\n if (propertyRecords.length === 0) return undefined\n const propRecord = propertyRecords[0]\n let refModelName: string | undefined\n if (propRecord.refModelId != null) {\n const refModelRows = await db\n .select({ name: models.name })\n .from(models)\n .where(eq(models.id, propRecord.refModelId))\n .limit(1)\n refModelName = refModelRows[0]?.name ?? undefined\n }\n return {\n dataType: propRecord.dataType,\n ref: refModelName ?? undefined,\n refValueType: propRecord.refValueType || undefined,\n storageType: propRecord.storageType || undefined,\n localStorageDir: propRecord.localStorageDir || undefined,\n filenameSuffix: propRecord.filenameSuffix || undefined,\n required: propRecord.required ?? undefined,\n }\n } catch {\n return undefined\n }\n}\n\nexport const getSegmentedItemProperties = async (item: IItem<any>) => {\n const itemBasicProperties = []\n const itemRelationProperties = []\n const itemListProperties = []\n const itemUploadProperties: UploadProperty[] = []\n const itemImageProperties = []\n const itemStorageProperties = []\n let itemStorageTransactionProperty: UploadProperty | undefined\n\n for (const itemProperty of item.properties) {\n let propertyDef = itemProperty.propertyDef\n // When propertyDef is missing (e.g. external app, Model not registered), resolve inline\n // so properties are not skipped and metadata attestations can be created\n if (!propertyDef && item.modelName) {\n const resolved = await resolvePropertyDef(item.modelName, itemProperty.propertyName)\n if (resolved) {\n itemProperty.getService().send({ type: 'updateContext', propertyRecordSchema: resolved })\n propertyDef = resolved as Static<typeof TProperty>\n } else {\n // Last resort: Model and DB don't have schema. Use Text so property routes to\n // itemBasicProperties and can be attested (covers title, description, etc.)\n const fallbackDef = { dataType: 'Text' as const }\n itemProperty.getService().send({ type: 'updateContext', propertyRecordSchema: fallbackDef })\n propertyDef = fallbackDef as Static<typeof TProperty>\n }\n }\n if (!propertyDef) {\n continue\n }\n\n const isItemStorage =\n propertyDef.storageType &&\n propertyDef.storageType === 'ItemStorage'\n\n\n const isStorageTransaction =\n itemProperty.propertyName === 'storageTransactionId' ||\n itemProperty.propertyName === 'storage_transaction_id'\n\n const isStorageSeedType =\n propertyDef.dataType === ModelPropertyDataTypes.Image ||\n propertyDef.dataType === ModelPropertyDataTypes.File ||\n propertyDef.dataType === ModelPropertyDataTypes.Html ||\n propertyDef.dataType === ModelPropertyDataTypes.Json ||\n (propertyDef.dataType === ModelPropertyDataTypes.Relation &&\n (propertyDef.refValueType === ModelPropertyDataTypes.Image ||\n propertyDef.refValueType === ModelPropertyDataTypes.File ||\n propertyDef.refValueType === ModelPropertyDataTypes.Html ||\n propertyDef.refValueType === ModelPropertyDataTypes.Json))\n\n if (isStorageSeedType) {\n itemImageProperties.push(itemProperty)\n if (propertyDef.dataType === ModelPropertyDataTypes.Relation) {\n itemRelationProperties.push(itemProperty)\n }\n continue\n }\n\n if (propertyDef.dataType === ModelPropertyDataTypes.Relation) {\n itemRelationProperties.push(itemProperty)\n continue\n }\n\n if (propertyDef.dataType === ModelPropertyDataTypes.List) {\n // List-of-relations: ref present, goes to processListProperty\n // List-of-primitives: ref absent, treat as basic property\n const listRef =\n propertyDef.ref || (propertyDef as { refModelName?: string }).refModelName\n if (listRef) {\n itemListProperties.push(itemProperty)\n } else {\n itemBasicProperties.push(itemProperty)\n }\n continue\n }\n\n if (isItemStorage) {\n itemStorageProperties.push(itemProperty)\n continue\n }\n\n if (isStorageTransaction) {\n itemStorageTransactionProperty = { itemProperty, childProperties: [] }\n continue\n }\n\n itemBasicProperties.push(itemProperty)\n }\n\n if (itemStorageTransactionProperty && itemStorageProperties.length > 0) {\n itemStorageTransactionProperty.childProperties = itemStorageProperties\n }\n\n if (itemStorageTransactionProperty) {\n itemUploadProperties.push(itemStorageTransactionProperty)\n }\n\n return {\n itemBasicProperties,\n itemRelationProperties,\n itemListProperties,\n itemUploadProperties,\n itemImageProperties,\n }\n}\n"],"names":[],"mappings":";;;;;;AASA,eAAe,kBAAkB,CAC/B,SAAiB,EACjB,YAAoB,EAAA;IAEpB,IAAI,MAAM,GAAG,MAAM,iBAAiB,CAAC,SAAS,EAAE,YAAY,CAAC;AAC7D,IAAA,IAAI,MAAM;AAAE,QAAA,OAAO,MAAM;AACzB,IAAA,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE;AAC5B,IAAA,IAAI,CAAC,EAAE;AAAE,QAAA,OAAO,SAAS;AACzB,IAAA,IAAI;QACF,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5D,MAAM,YAAY,GAAG,MAAM;aACxB,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;aACxB,IAAI,CAAC,MAAM;aACX,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,mBAAmB,CAAC;aAC1C,KAAK,CAAC,CAAC,CAAC;AACX,QAAA,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;AAAE,YAAA,OAAO,SAAS;QACtE,MAAM,eAAe,GAAG,MAAM;AAC3B,aAAA,MAAM;aACN,IAAI,CAAC,UAAU;aACf,KAAK,CACJ,GAAG,CACD,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAC1C,EA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