@seedprotocol/sdk 0.7.3-next.613.g79a8dfd → 0.7.3-next.654.g52217f6

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.
Files changed (164) hide show
  1. package/dist/{BasePathResolver-BdxCSIzn.js → BasePathResolver-CfSfMW5_.js} +7 -10
  2. package/dist/BasePathResolver-CfSfMW5_.js.map +1 -0
  3. package/dist/{ClientManager-DDA9956Y.js → ClientManager-C-QXqUK9.js} +438 -153
  4. package/dist/ClientManager-C-QXqUK9.js.map +1 -0
  5. package/dist/{Item-D4FigtYS.js → Item-C7sUUu2B.js} +291 -105
  6. package/dist/Item-C7sUUu2B.js.map +1 -0
  7. package/dist/{ModelProperty-BDt6AU2h.js → ModelProperty-DJxeOOrc.js} +28 -27
  8. package/dist/ModelProperty-DJxeOOrc.js.map +1 -0
  9. package/dist/{Schema-B8xqLWkL.js → Schema-fXtvd-yL.js} +30 -30
  10. package/dist/{Schema-B8xqLWkL.js.map → Schema-fXtvd-yL.js.map} +1 -1
  11. package/dist/{SchemaValidationService-BPxkfDLU.js → SchemaValidationService-CvRS2HSO.js} +10 -9
  12. package/dist/{SchemaValidationService-BPxkfDLU.js.map → SchemaValidationService-CvRS2HSO.js.map} +1 -1
  13. package/dist/{backfillMetadataPropertyIds-DuTPcv8t.js → backfillMetadataPropertyIds-SXW-8C64.js} +4 -4
  14. package/dist/{backfillMetadataPropertyIds-DuTPcv8t.js.map → backfillMetadataPropertyIds-SXW-8C64.js.map} +1 -1
  15. package/dist/cjs/{ModelProperty-B-cZm1yU.js → ModelProperty-DXZ39Wyv.js} +24 -23
  16. package/dist/cjs/{ModelProperty-B-cZm1yU.js.map → ModelProperty-DXZ39Wyv.js.map} +1 -1
  17. package/dist/cjs/{Schema-STP972Xw.js → Schema-DdP109QD.js} +26 -25
  18. package/dist/cjs/{Schema-STP972Xw.js.map → Schema-DdP109QD.js.map} +1 -1
  19. package/dist/cjs/{SchemaValidationService-CKNW1bKg.js → SchemaValidationService-CSXxx7sQ.js} +5 -4
  20. package/dist/cjs/{SchemaValidationService-CKNW1bKg.js.map → SchemaValidationService-CSXxx7sQ.js.map} +1 -1
  21. package/dist/cjs/{backfillMetadataPropertyIds-CP3y1skt.js → backfillMetadataPropertyIds-CPYoaMl4.js} +6 -5
  22. package/dist/cjs/{backfillMetadataPropertyIds-CP3y1skt.js.map → backfillMetadataPropertyIds-CPYoaMl4.js.map} +1 -1
  23. package/dist/cjs/{eas-CAnUC4wd.js → eas-B2YDQssV.js} +6 -5
  24. package/dist/cjs/{eas-CAnUC4wd.js.map → eas-B2YDQssV.js.map} +1 -1
  25. package/dist/cjs/{getItem-CWgb3e9G.js → getItem-DgnaQzbE.js} +5 -4
  26. package/dist/cjs/{getItem-CWgb3e9G.js.map → getItem-DgnaQzbE.js.map} +1 -1
  27. package/dist/cjs/{getPublishPayload-BsZWiJ03.js → getPublishPayload-CqlqRdot.js} +12 -11
  28. package/dist/cjs/{getPublishPayload-BsZWiJ03.js.map → getPublishPayload-CqlqRdot.js.map} +1 -1
  29. package/dist/cjs/getPublishUploads-DsXY9S4U.js +872 -0
  30. package/dist/cjs/getPublishUploads-DsXY9S4U.js.map +1 -0
  31. package/dist/cjs/{index-nA5PxBSs.js → index-BHaWOwNF.js} +6 -5
  32. package/dist/cjs/index-BHaWOwNF.js.map +1 -0
  33. package/dist/cjs/{index-usKaANAq.js → index-C4XlgCJ4.js} +1156 -526
  34. package/dist/cjs/index-C4XlgCJ4.js.map +1 -0
  35. package/dist/cjs/{property-xMwPhQ5N.js → property-fa0iju0J.js} +8 -7
  36. package/dist/cjs/{property-xMwPhQ5N.js.map → property-fa0iju0J.js.map} +1 -1
  37. package/dist/cjs/{publishDraftGraph-BRWlR1KO.js → publishDraftGraph-3ASwAlD7.js} +4 -4
  38. package/dist/cjs/{publishDraftGraph-BRWlR1KO.js.map → publishDraftGraph-3ASwAlD7.js.map} +1 -1
  39. package/dist/cjs/{resetAmbiguousLegacyItemData-8nfkj9rz.js → resetAmbiguousLegacyItemData-Bu_MBBYt.js} +5 -4
  40. package/dist/cjs/{resetAmbiguousLegacyItemData-8nfkj9rz.js.map → resetAmbiguousLegacyItemData-Bu_MBBYt.js.map} +1 -1
  41. package/dist/cjs/{resolveModelForSyncedSeed-kYRuDWYw.js → resolveModelForSyncedSeed-BANIiuFU.js} +2 -2
  42. package/dist/cjs/{resolveModelForSyncedSeed-kYRuDWYw.js.map → resolveModelForSyncedSeed-BANIiuFU.js.map} +1 -1
  43. package/dist/cjs/{syncDbWithEas-DqRhV8o2.js → syncDbWithEas-CrmxxmUW.js} +10 -9
  44. package/dist/cjs/{syncDbWithEas-DqRhV8o2.js.map → syncDbWithEas-CrmxxmUW.js.map} +1 -1
  45. package/dist/{configurePlatform-YcOiDQBZ.js → configurePlatform-BRw2j0ZN.js} +7 -4
  46. package/dist/{configurePlatform-YcOiDQBZ.js.map → configurePlatform-BRw2j0ZN.js.map} +1 -1
  47. package/dist/{db-CQt-gcAl.js → db-D9K_f5cF.js} +14 -14
  48. package/dist/{db-CQt-gcAl.js.map → db-D9K_f5cF.js.map} +1 -1
  49. package/dist/{eas-CpOD74Ke.js → eas-DHxfswCt.js} +8 -5
  50. package/dist/eas-DHxfswCt.js.map +1 -0
  51. package/dist/{getItem-B_OoFkd7.js → getItem-d6N_aM6S.js} +8 -5
  52. package/dist/{getItem-B_OoFkd7.js.map → getItem-d6N_aM6S.js.map} +1 -1
  53. package/dist/{getPublishPayload-Xl3sRkR-.js → getPublishPayload-BHrxVtzY.js} +16 -16
  54. package/dist/{getPublishPayload-Xl3sRkR-.js.map → getPublishPayload-BHrxVtzY.js.map} +1 -1
  55. package/dist/getPublishUploads-BEqRiKIS.js +657 -0
  56. package/dist/getPublishUploads-BEqRiKIS.js.map +1 -0
  57. package/dist/{index-BGt4_oPO.js → index-CiMEoGu3.js} +12 -11
  58. package/dist/index-CiMEoGu3.js.map +1 -0
  59. package/dist/{index-CSOQFAOn.js → index-DglvthOk.js} +2 -2
  60. package/dist/index-DglvthOk.js.map +1 -0
  61. package/dist/{index-Xl1_4Lmb.js → index-s15q14rm.js} +29 -29
  62. package/dist/{index-Xl1_4Lmb.js.map → index-s15q14rm.js.map} +1 -1
  63. package/dist/{index.browser-CjTe0vt1.js → index.browser-Cm06tP4X.js} +553 -165
  64. package/dist/index.browser-Cm06tP4X.js.map +1 -0
  65. package/dist/{index.node-Cfa7npS6.js → index.node-C30dmFgn.js} +5 -5
  66. package/dist/{index.node-Cfa7npS6.js.map → index.node-C30dmFgn.js.map} +1 -1
  67. package/dist/main.cjs +4 -3
  68. package/dist/main.cjs.map +1 -1
  69. package/dist/main.js +32 -44
  70. package/dist/main.js.map +1 -1
  71. package/dist/mimeTypes-DHAHC4eZ.js +204 -0
  72. package/dist/mimeTypes-DHAHC4eZ.js.map +1 -0
  73. package/dist/node.js +13 -12
  74. package/dist/node.js.map +1 -1
  75. package/dist/platform.browser.js +9 -7
  76. package/dist/platform.browser.js.map +1 -1
  77. package/dist/platform.node.js +3 -3
  78. package/dist/{property-BrXkY1Rg.js → property-DhmmYAvQ.js} +12 -9
  79. package/dist/property-DhmmYAvQ.js.map +1 -0
  80. package/dist/{publishDraftGraph-X0Wr9txE.js → publishDraftGraph-yYP74WRt.js} +8 -8
  81. package/dist/{publishDraftGraph-X0Wr9txE.js.map → publishDraftGraph-yYP74WRt.js.map} +1 -1
  82. package/dist/{resetAmbiguousLegacyItemData-Ci6PM_vC.js → resetAmbiguousLegacyItemData-Bk0QyDW8.js} +2 -2
  83. package/dist/{resetAmbiguousLegacyItemData-Ci6PM_vC.js.map → resetAmbiguousLegacyItemData-Bk0QyDW8.js.map} +1 -1
  84. package/dist/{resolveModelForSyncedSeed-DFVdnYq8.js → resolveModelForSyncedSeed-8cAzvUFd.js} +2 -2
  85. package/dist/{resolveModelForSyncedSeed-DFVdnYq8.js.map → resolveModelForSyncedSeed-8cAzvUFd.js.map} +1 -1
  86. package/dist/src/Item/Item.d.ts +1 -1
  87. package/dist/src/Item/Item.d.ts.map +1 -1
  88. package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -1
  89. package/dist/src/browser/helpers/FileManager.d.ts +4 -1
  90. package/dist/src/browser/helpers/FileManager.d.ts.map +1 -1
  91. package/dist/src/browser/helpers/tolerantWebAccess.d.ts +79 -4
  92. package/dist/src/browser/helpers/tolerantWebAccess.d.ts.map +1 -1
  93. package/dist/src/browser/workers/FileDownloader.d.ts +19 -4
  94. package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
  95. package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
  96. package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
  97. package/dist/src/db/migrateLegacyItemStorageRows.d.ts +57 -0
  98. package/dist/src/db/migrateLegacyItemStorageRows.d.ts.map +1 -0
  99. package/dist/src/db/read/getCompositeChildPaths.d.ts +13 -0
  100. package/dist/src/db/read/getCompositeChildPaths.d.ts.map +1 -0
  101. package/dist/src/db/read/getItems.d.ts.map +1 -1
  102. package/dist/src/db/read/getPublishUploads.d.ts +32 -3
  103. package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
  104. package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
  105. package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts +44 -0
  106. package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts.map +1 -0
  107. package/dist/src/db/write/createNewItem.d.ts.map +1 -1
  108. package/dist/src/events/files/download.d.ts.map +1 -1
  109. package/dist/src/helpers/FileManager/BaseFileManager.d.ts +3 -3
  110. package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
  111. package/dist/src/helpers/FileManager/IFileManager.d.ts +25 -1
  112. package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
  113. package/dist/src/helpers/arweaveContentTags.d.ts +33 -0
  114. package/dist/src/helpers/arweaveContentTags.d.ts.map +1 -0
  115. package/dist/src/helpers/compositeUpload.d.ts +28 -0
  116. package/dist/src/helpers/compositeUpload.d.ts.map +1 -0
  117. package/dist/src/helpers/itemStorageFile.d.ts +57 -0
  118. package/dist/src/helpers/itemStorageFile.d.ts.map +1 -0
  119. package/dist/src/helpers/mapWithConcurrency.d.ts +7 -0
  120. package/dist/src/helpers/mapWithConcurrency.d.ts.map +1 -0
  121. package/dist/src/helpers/mimeTypes.d.ts +43 -0
  122. package/dist/src/helpers/mimeTypes.d.ts.map +1 -0
  123. package/dist/src/helpers/ownership.d.ts +19 -3
  124. package/dist/src/helpers/ownership.d.ts.map +1 -1
  125. package/dist/src/helpers/storageDir.d.ts +16 -0
  126. package/dist/src/helpers/storageDir.d.ts.map +1 -0
  127. package/dist/src/helpers/tabCoordinator.d.ts +5 -1
  128. package/dist/src/helpers/tabCoordinator.d.ts.map +1 -1
  129. package/dist/src/helpers/tabEvents.d.ts +23 -2
  130. package/dist/src/helpers/tabEvents.d.ts.map +1 -1
  131. package/dist/src/index.d.ts +6 -4
  132. package/dist/src/index.d.ts.map +1 -1
  133. package/dist/src/types/fileManager.d.ts +3 -14
  134. package/dist/src/types/fileManager.d.ts.map +1 -1
  135. package/dist/src/types/publish.d.ts +14 -0
  136. package/dist/src/types/publish.d.ts.map +1 -1
  137. package/dist/{syncDbWithEas-BU-jZ5bJ.js → syncDbWithEas--HUA9WNb.js} +15 -14
  138. package/dist/syncDbWithEas--HUA9WNb.js.map +1 -0
  139. package/dist/{tabEvents-BZJMY5uK.js → tabEvents-DguZpCCv.js} +294 -58
  140. package/dist/tabEvents-DguZpCCv.js.map +1 -0
  141. package/dist/tolerantWebAccess-BZYWt09Y.js +551 -0
  142. package/dist/tolerantWebAccess-BZYWt09Y.js.map +1 -0
  143. package/dist/{updateSeedRevokedAt-iLpzae1i.js → updateSeedRevokedAt-D_EG-q3b.js} +3 -3
  144. package/dist/{updateSeedRevokedAt-iLpzae1i.js.map → updateSeedRevokedAt-D_EG-q3b.js.map} +1 -1
  145. package/package.json +5 -5
  146. package/dist/BasePathResolver-BdxCSIzn.js.map +0 -1
  147. package/dist/ClientManager-DDA9956Y.js.map +0 -1
  148. package/dist/Item-D4FigtYS.js.map +0 -1
  149. package/dist/ModelProperty-BDt6AU2h.js.map +0 -1
  150. package/dist/cjs/getPublishUploads-BQr8aMVP.js +0 -495
  151. package/dist/cjs/getPublishUploads-BQr8aMVP.js.map +0 -1
  152. package/dist/cjs/index-nA5PxBSs.js.map +0 -1
  153. package/dist/cjs/index-usKaANAq.js.map +0 -1
  154. package/dist/eas-CpOD74Ke.js.map +0 -1
  155. package/dist/getPublishUploads-DHP01KgU.js +0 -484
  156. package/dist/getPublishUploads-DHP01KgU.js.map +0 -1
  157. package/dist/index-BGt4_oPO.js.map +0 -1
  158. package/dist/index-CSOQFAOn.js.map +0 -1
  159. package/dist/index.browser-CjTe0vt1.js.map +0 -1
  160. package/dist/property-BrXkY1Rg.js.map +0 -1
  161. package/dist/syncDbWithEas-BU-jZ5bJ.js.map +0 -1
  162. package/dist/tabEvents-BZJMY5uK.js.map +0 -1
  163. package/dist/tolerantWebAccess-BZ2RA_mb.js +0 -160
  164. package/dist/tolerantWebAccess-BZ2RA_mb.js.map +0 -1
@@ -0,0 +1,204 @@
1
+ /**
2
+ * File extension <-> MIME type, shared by the upload side (`getPublishUploads.ts`, which sets the
3
+ * `Content-Type` tag) and the download worker (`browser/workers/filesDownload.ts`, which picks the
4
+ * extension of a file saved under `files/`). The worker runs from a string and cannot import this
5
+ * module, so {@link MIME_TO_EXTENSION} is injected into its source as JSON.
6
+ */
7
+ /**
8
+ * Lowercase extension (no dot) to MIME type. Includes the odd extensions the SDK itself produces:
9
+ * `saveImage` names a file `<id>.<subtype>` (e.g. `.svg+xml`, `.x-icon`), so subtypes appear here too.
10
+ */
11
+ const EXTENSION_TO_MIME = {
12
+ // images
13
+ png: 'image/png',
14
+ apng: 'image/apng',
15
+ jpg: 'image/jpeg',
16
+ jpeg: 'image/jpeg',
17
+ jfif: 'image/jpeg',
18
+ gif: 'image/gif',
19
+ webp: 'image/webp',
20
+ avif: 'image/avif',
21
+ heic: 'image/heic',
22
+ heif: 'image/heif',
23
+ svg: 'image/svg+xml',
24
+ 'svg+xml': 'image/svg+xml',
25
+ bmp: 'image/bmp',
26
+ ico: 'image/x-icon',
27
+ 'x-icon': 'image/x-icon',
28
+ 'vnd.microsoft.icon': 'image/x-icon',
29
+ tif: 'image/tiff',
30
+ tiff: 'image/tiff',
31
+ // text / documents
32
+ html: 'text/html',
33
+ htm: 'text/html',
34
+ xhtml: 'application/xhtml+xml',
35
+ json: 'application/json',
36
+ txt: 'text/plain',
37
+ plain: 'text/plain',
38
+ md: 'text/markdown',
39
+ markdown: 'text/markdown',
40
+ csv: 'text/csv',
41
+ tsv: 'text/tab-separated-values',
42
+ xml: 'application/xml',
43
+ css: 'text/css',
44
+ js: 'text/javascript',
45
+ mjs: 'text/javascript',
46
+ pdf: 'application/pdf',
47
+ rtf: 'application/rtf',
48
+ epub: 'application/epub+zip',
49
+ zip: 'application/zip',
50
+ gz: 'application/gzip',
51
+ doc: 'application/msword',
52
+ docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
53
+ xls: 'application/vnd.ms-excel',
54
+ xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
55
+ ppt: 'application/vnd.ms-powerpoint',
56
+ pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
57
+ odt: 'application/vnd.oasis.opendocument.text',
58
+ // audio
59
+ mp3: 'audio/mpeg',
60
+ mpeg: 'audio/mpeg',
61
+ wav: 'audio/wav',
62
+ ogg: 'audio/ogg',
63
+ oga: 'audio/ogg',
64
+ opus: 'audio/opus',
65
+ m4a: 'audio/mp4',
66
+ aac: 'audio/aac',
67
+ flac: 'audio/flac',
68
+ weba: 'audio/webm',
69
+ // video
70
+ mp4: 'video/mp4',
71
+ m4v: 'video/mp4',
72
+ webm: 'video/webm',
73
+ mov: 'video/quicktime',
74
+ quicktime: 'video/quicktime',
75
+ ogv: 'video/ogg',
76
+ mkv: 'video/x-matroska',
77
+ avi: 'video/x-msvideo',
78
+ // fonts
79
+ woff: 'font/woff',
80
+ woff2: 'font/woff2',
81
+ ttf: 'font/ttf',
82
+ otf: 'font/otf',
83
+ };
84
+ /**
85
+ * MIME type to the extension a downloaded file gets. One canonical extension per type (the
86
+ * first one listed here wins over {@link EXTENSION_TO_MIME}'s aliases), plus a few common
87
+ * non-canonical spellings a gateway may send.
88
+ */
89
+ const MIME_TO_EXTENSION = (() => {
90
+ const preferred = {
91
+ 'image/jpeg': 'jpg',
92
+ 'image/svg+xml': 'svg',
93
+ 'image/x-icon': 'ico',
94
+ 'image/tiff': 'tiff',
95
+ 'text/html': 'html',
96
+ 'text/plain': 'txt',
97
+ 'text/markdown': 'md',
98
+ 'text/javascript': 'js',
99
+ 'audio/mpeg': 'mp3',
100
+ 'audio/ogg': 'ogg',
101
+ 'audio/mp4': 'm4a',
102
+ 'video/mp4': 'mp4',
103
+ 'video/quicktime': 'mov',
104
+ 'video/ogg': 'ogv',
105
+ };
106
+ const out = { ...preferred };
107
+ for (const [ext, mime] of Object.entries(EXTENSION_TO_MIME)) {
108
+ if (!(mime in out))
109
+ out[mime] = ext;
110
+ }
111
+ // Non-canonical names some servers use for the same formats.
112
+ Object.assign(out, {
113
+ 'audio/mp3': 'mp3',
114
+ 'audio/x-wav': 'wav',
115
+ 'audio/wave': 'wav',
116
+ 'audio/vnd.wave': 'wav',
117
+ 'audio/x-m4a': 'm4a',
118
+ 'audio/x-flac': 'flac',
119
+ 'application/x-zip-compressed': 'zip',
120
+ 'image/vnd.microsoft.icon': 'ico',
121
+ });
122
+ return out;
123
+ })();
124
+ /**
125
+ * Content types that say nothing about the content. A Blob carrying one of these is treated as
126
+ * untyped.
127
+ */
128
+ const GENERIC_MIME_TYPES = [
129
+ '',
130
+ 'application/octet-stream',
131
+ 'binary/octet-stream',
132
+ ];
133
+ /** Lowercase `type/subtype` without parameters; `undefined` when empty or generic. */
134
+ const normalizeMimeType = (mimeType) => {
135
+ const t = (mimeType ?? '').split(';')[0].trim().toLowerCase();
136
+ if (!t || GENERIC_MIME_TYPES.includes(t) || !t.includes('/'))
137
+ return undefined;
138
+ return t;
139
+ };
140
+ /** MIME type for a path or file name by its extension, if it has a known one. */
141
+ const getMimeTypeFromPath = (filePathOrName) => {
142
+ const name = filePathOrName.split('/').pop() ?? '';
143
+ const dot = name.lastIndexOf('.');
144
+ if (dot <= 0 || dot === name.length - 1)
145
+ return undefined;
146
+ return EXTENSION_TO_MIME[name.slice(dot + 1).toLowerCase()];
147
+ };
148
+ /**
149
+ * MIME type from the leading bytes, for formats with an unambiguous signature. Used when a local
150
+ * file has no (known) extension, e.g. a file seed named after its id.
151
+ */
152
+ const sniffMimeType = (bytes) => {
153
+ const at = (offset, ...sig) => bytes.length >= offset + sig.length && sig.every((b, i) => bytes[offset + i] === b);
154
+ const ascii = (offset, s) => at(offset, ...Array.from(s).map((c) => c.charCodeAt(0)));
155
+ if (at(0, 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a))
156
+ return 'image/png';
157
+ if (at(0, 0xff, 0xd8, 0xff))
158
+ return 'image/jpeg';
159
+ if (ascii(0, 'GIF87a') || ascii(0, 'GIF89a'))
160
+ return 'image/gif';
161
+ if (ascii(0, 'RIFF') && ascii(8, 'WEBP'))
162
+ return 'image/webp';
163
+ if (ascii(0, 'RIFF') && ascii(8, 'WAVE'))
164
+ return 'audio/wav';
165
+ if (ascii(0, 'RIFF') && ascii(8, 'AVI '))
166
+ return 'video/x-msvideo';
167
+ if (ascii(0, 'BM') && bytes.length > 14)
168
+ return 'image/bmp';
169
+ if (at(0, 0x49, 0x49, 0x2a, 0x00) || at(0, 0x4d, 0x4d, 0x00, 0x2a))
170
+ return 'image/tiff';
171
+ if (ascii(0, '%PDF-'))
172
+ return 'application/pdf';
173
+ if (ascii(0, 'OggS'))
174
+ return 'audio/ogg';
175
+ if (ascii(0, 'fLaC'))
176
+ return 'audio/flac';
177
+ if (ascii(0, 'ID3'))
178
+ return 'audio/mpeg';
179
+ if (at(0, 0x1a, 0x45, 0xdf, 0xa3))
180
+ return 'video/webm';
181
+ if (ascii(4, 'ftyp')) {
182
+ const brand = String.fromCharCode(...Array.from(bytes.slice(8, 12)));
183
+ if (brand === 'avif' || brand === 'avis')
184
+ return 'image/avif';
185
+ if (['heic', 'heix', 'heif', 'mif1', 'msf1'].includes(brand))
186
+ return 'image/heic';
187
+ if (brand === 'qt ')
188
+ return 'video/quicktime';
189
+ if (brand === 'M4A ')
190
+ return 'audio/mp4';
191
+ return 'video/mp4';
192
+ }
193
+ return undefined;
194
+ };
195
+ /**
196
+ * Best MIME type for upload bytes: the source's own type (a Blob/File `type`) when it is specific,
197
+ * then the file name's extension, then the bytes' signature.
198
+ */
199
+ const resolveUploadMimeType = (params) => normalizeMimeType(params.sourceType) ??
200
+ (params.fileName ? getMimeTypeFromPath(params.fileName) : undefined) ??
201
+ (params.bytes ? sniffMimeType(params.bytes) : undefined);
202
+
203
+ export { MIME_TO_EXTENSION as M, resolveUploadMimeType as r };
204
+ //# sourceMappingURL=mimeTypes-DHAHC4eZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeTypes-DHAHC4eZ.js","sources":["../../src/helpers/mimeTypes.ts"],"sourcesContent":["/**\n * File extension <-> MIME type, shared by the upload side (`getPublishUploads.ts`, which sets the\n * `Content-Type` tag) and the download worker (`browser/workers/filesDownload.ts`, which picks the\n * extension of a file saved under `files/`). The worker runs from a string and cannot import this\n * module, so {@link MIME_TO_EXTENSION} is injected into its source as JSON.\n */\n\n/**\n * Lowercase extension (no dot) to MIME type. Includes the odd extensions the SDK itself produces:\n * `saveImage` names a file `<id>.<subtype>` (e.g. `.svg+xml`, `.x-icon`), so subtypes appear here too.\n */\nexport const EXTENSION_TO_MIME: Readonly<Record<string, string>> = {\n // images\n png: 'image/png',\n apng: 'image/apng',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n jfif: 'image/jpeg',\n gif: 'image/gif',\n webp: 'image/webp',\n avif: 'image/avif',\n heic: 'image/heic',\n heif: 'image/heif',\n svg: 'image/svg+xml',\n 'svg+xml': 'image/svg+xml',\n bmp: 'image/bmp',\n ico: 'image/x-icon',\n 'x-icon': 'image/x-icon',\n 'vnd.microsoft.icon': 'image/x-icon',\n tif: 'image/tiff',\n tiff: 'image/tiff',\n // text / documents\n html: 'text/html',\n htm: 'text/html',\n xhtml: 'application/xhtml+xml',\n json: 'application/json',\n txt: 'text/plain',\n plain: 'text/plain',\n md: 'text/markdown',\n markdown: 'text/markdown',\n csv: 'text/csv',\n tsv: 'text/tab-separated-values',\n xml: 'application/xml',\n css: 'text/css',\n js: 'text/javascript',\n mjs: 'text/javascript',\n pdf: 'application/pdf',\n rtf: 'application/rtf',\n epub: 'application/epub+zip',\n zip: 'application/zip',\n gz: 'application/gzip',\n doc: 'application/msword',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n xls: 'application/vnd.ms-excel',\n xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n ppt: 'application/vnd.ms-powerpoint',\n pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n odt: 'application/vnd.oasis.opendocument.text',\n // audio\n mp3: 'audio/mpeg',\n mpeg: 'audio/mpeg',\n wav: 'audio/wav',\n ogg: 'audio/ogg',\n oga: 'audio/ogg',\n opus: 'audio/opus',\n m4a: 'audio/mp4',\n aac: 'audio/aac',\n flac: 'audio/flac',\n weba: 'audio/webm',\n // video\n mp4: 'video/mp4',\n m4v: 'video/mp4',\n webm: 'video/webm',\n mov: 'video/quicktime',\n quicktime: 'video/quicktime',\n ogv: 'video/ogg',\n mkv: 'video/x-matroska',\n avi: 'video/x-msvideo',\n // fonts\n woff: 'font/woff',\n woff2: 'font/woff2',\n ttf: 'font/ttf',\n otf: 'font/otf',\n}\n\n/**\n * MIME type to the extension a downloaded file gets. One canonical extension per type (the\n * first one listed here wins over {@link EXTENSION_TO_MIME}'s aliases), plus a few common\n * non-canonical spellings a gateway may send.\n */\nexport const MIME_TO_EXTENSION: Readonly<Record<string, string>> = (() => {\n const preferred: Record<string, string> = {\n 'image/jpeg': 'jpg',\n 'image/svg+xml': 'svg',\n 'image/x-icon': 'ico',\n 'image/tiff': 'tiff',\n 'text/html': 'html',\n 'text/plain': 'txt',\n 'text/markdown': 'md',\n 'text/javascript': 'js',\n 'audio/mpeg': 'mp3',\n 'audio/ogg': 'ogg',\n 'audio/mp4': 'm4a',\n 'video/mp4': 'mp4',\n 'video/quicktime': 'mov',\n 'video/ogg': 'ogv',\n }\n const out: Record<string, string> = { ...preferred }\n for (const [ext, mime] of Object.entries(EXTENSION_TO_MIME)) {\n if (!(mime in out)) out[mime] = ext\n }\n // Non-canonical names some servers use for the same formats.\n Object.assign(out, {\n 'audio/mp3': 'mp3',\n 'audio/x-wav': 'wav',\n 'audio/wave': 'wav',\n 'audio/vnd.wave': 'wav',\n 'audio/x-m4a': 'm4a',\n 'audio/x-flac': 'flac',\n 'application/x-zip-compressed': 'zip',\n 'image/vnd.microsoft.icon': 'ico',\n })\n return out\n})()\n\n/**\n * Content types that say nothing about the content. A Blob carrying one of these is treated as\n * untyped.\n */\nexport const GENERIC_MIME_TYPES: readonly string[] = [\n '',\n 'application/octet-stream',\n 'binary/octet-stream',\n]\n\n/** Lowercase `type/subtype` without parameters; `undefined` when empty or generic. */\nexport const normalizeMimeType = (mimeType: string | null | undefined): string | undefined => {\n const t = (mimeType ?? '').split(';')[0]!.trim().toLowerCase()\n if (!t || GENERIC_MIME_TYPES.includes(t) || !t.includes('/')) return undefined\n return t\n}\n\n/** MIME type for a path or file name by its extension, if it has a known one. */\nexport const getMimeTypeFromPath = (filePathOrName: string): string | undefined => {\n const name = filePathOrName.split('/').pop() ?? ''\n const dot = name.lastIndexOf('.')\n if (dot <= 0 || dot === name.length - 1) return undefined\n return EXTENSION_TO_MIME[name.slice(dot + 1).toLowerCase()]\n}\n\n/** Extension (no dot) for a MIME type, if it has a well-known one. */\nexport const getExtensionForMimeType = (mimeType: string | null | undefined): string | undefined => {\n const t = normalizeMimeType(mimeType)\n return t ? MIME_TO_EXTENSION[t] : undefined\n}\n\n/**\n * MIME type from the leading bytes, for formats with an unambiguous signature. Used when a local\n * file has no (known) extension, e.g. a file seed named after its id.\n */\nexport const sniffMimeType = (bytes: Uint8Array): string | undefined => {\n const at = (offset: number, ...sig: number[]) =>\n bytes.length >= offset + sig.length && sig.every((b, i) => bytes[offset + i] === b)\n const ascii = (offset: number, s: string) =>\n at(offset, ...Array.from(s).map((c) => c.charCodeAt(0)))\n\n if (at(0, 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a)) return 'image/png'\n if (at(0, 0xff, 0xd8, 0xff)) return 'image/jpeg'\n if (ascii(0, 'GIF87a') || ascii(0, 'GIF89a')) return 'image/gif'\n if (ascii(0, 'RIFF') && ascii(8, 'WEBP')) return 'image/webp'\n if (ascii(0, 'RIFF') && ascii(8, 'WAVE')) return 'audio/wav'\n if (ascii(0, 'RIFF') && ascii(8, 'AVI ')) return 'video/x-msvideo'\n if (ascii(0, 'BM') && bytes.length > 14) return 'image/bmp'\n if (at(0, 0x49, 0x49, 0x2a, 0x00) || at(0, 0x4d, 0x4d, 0x00, 0x2a)) return 'image/tiff'\n if (ascii(0, '%PDF-')) return 'application/pdf'\n if (ascii(0, 'OggS')) return 'audio/ogg'\n if (ascii(0, 'fLaC')) return 'audio/flac'\n if (ascii(0, 'ID3')) return 'audio/mpeg'\n if (at(0, 0x1a, 0x45, 0xdf, 0xa3)) return 'video/webm'\n if (ascii(4, 'ftyp')) {\n const brand = String.fromCharCode(...Array.from(bytes.slice(8, 12)))\n if (brand === 'avif' || brand === 'avis') return 'image/avif'\n if (['heic', 'heix', 'heif', 'mif1', 'msf1'].includes(brand)) return 'image/heic'\n if (brand === 'qt ') return 'video/quicktime'\n if (brand === 'M4A ') return 'audio/mp4'\n return 'video/mp4'\n }\n return undefined\n}\n\n/**\n * Best MIME type for upload bytes: the source's own type (a Blob/File `type`) when it is specific,\n * then the file name's extension, then the bytes' signature.\n */\nexport const resolveUploadMimeType = (params: {\n sourceType?: string | null\n fileName?: string | null\n bytes?: Uint8Array\n}): string | undefined =>\n normalizeMimeType(params.sourceType) ??\n (params.fileName ? getMimeTypeFromPath(params.fileName) : undefined) ??\n (params.bytes ? sniffMimeType(params.bytes) : undefined)\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAEH;;;AAGG;AACI,MAAM,iBAAiB,GAAqC;;AAEjE,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,GAAG,EAAE,eAAe;AACpB,IAAA,SAAS,EAAE,eAAe;AAC1B,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,GAAG,EAAE,cAAc;AACnB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,oBAAoB,EAAE,cAAc;AACpC,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,IAAI,EAAE,YAAY;;AAElB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,KAAK,EAAE,uBAAuB;AAC9B,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,KAAK,EAAE,YAAY;AACnB,IAAA,EAAE,EAAE,eAAe;AACnB,IAAA,QAAQ,EAAE,eAAe;AACzB,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,GAAG,EAAE,2BAA2B;AAChC,IAAA,GAAG,EAAE,iBAAiB;AACtB,IAAA,G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,CAAC;AAAE,QAAA,OAAO,YAAY;AACzC,IAAA,IAAI,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;AAAE,QAAA,OAAO,YAAY;IACxC,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAAE,QAAA,OAAO,YAAY;AACtD,IAAA,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;QACpB,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACpE,QAAA,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM;AAAE,YAAA,OAAO,YAAY;AAC7D,QAAA,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;AAAE,YAAA,OAAO,YAAY;QACjF,IAAI,KAAK,KAAK,MAAM;AAAE,YAAA,OAAO,iBAAiB;QAC9C,IAAI,KAAK,KAAK,MAAM;AAAE,YAAA,OAAO,WAAW;AACxC,QAAA,OAAO,WAAW;IACpB;AACA,IAAA,OAAO,SAAS;AAClB,CAAC;AAED;;;AAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,MAIrC,KACC,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC;AACpC,KAAC,MAAM,CAAC,QAAQ,GAAG,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;AACpE,KAAC,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS;;"}
package/dist/node.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import { enableMapSet } from 'immer';
2
2
  import 'reflect-metadata';
3
- export { M as Model } from './index-Xl1_4Lmb.js';
4
- import { M as ModelPropertyDataTypes, P as Property, w as addModelsToDb } from './db-CQt-gcAl.js';
5
- export { B as Boolean, a as Date, I as Image, J as Json, L as List, N as Number, R as Relation, j as Text, m as eventEmitter } from './db-CQt-gcAl.js';
3
+ export { M as Model } from './index-s15q14rm.js';
4
+ import { M as ModelPropertyDataTypes, P as Property, w as addModelsToDb } from './db-D9K_f5cF.js';
5
+ export { B as Boolean, a as Date, I as Image, J as Json, L as List, N as Number, R as Relation, j as Text, m as eventEmitter } from './db-D9K_f5cF.js';
6
6
  import 'pluralize';
7
- import { a as BaseDb } from './BasePathResolver-BdxCSIzn.js';
8
- export { t as BasePathResolver, y as INIT_SCRIPT_SUCCESS_MESSAGE, S as SCHEMA_TS, b as appState, d as config, m as metadata, i as modelUids, j as models, r as seeds, v as versions } from './BasePathResolver-BdxCSIzn.js';
7
+ import { B as BaseDb } from './BasePathResolver-CfSfMW5_.js';
8
+ export { r as BasePathResolver, y as INIT_SCRIPT_SUCCESS_MESSAGE, S as SCHEMA_TS, a as appState, c as config, m as metadata, g as modelUids, i as models, q as seeds, v as versions } from './BasePathResolver-CfSfMW5_.js';
9
9
  import 'drizzle-orm';
10
- export { I as Item, f as ItemProperty, h as ItemPropertySaveValidationError } from './Item-D4FigtYS.js';
11
- import { c as createPlatformServices } from './index.node-Cfa7npS6.js';
12
- export { D as Db, F as FileManager, P as PathResolver, r as resolveSdkDrizzleMigrationsDir } from './index.node-Cfa7npS6.js';
13
- export { g as getCorrectId, i as isPublishedSeedRef, n as normalizeRelationPropertyValue, r as resolveSeedIdsFromRefString } from './tabEvents-BZJMY5uK.js';
10
+ export { I as Item, h as ItemProperty, i as ItemPropertySaveValidationError } from './Item-C7sUUu2B.js';
11
+ import { c as createPlatformServices } from './index.node-C30dmFgn.js';
12
+ export { D as Db, F as FileManager, P as PathResolver, r as resolveSdkDrizzleMigrationsDir } from './index.node-C30dmFgn.js';
13
+ export { e as getCorrectId, i as isPublishedSeedRef, n as normalizeRelationPropertyValue, r as resolveSeedIdsFromRefString } from './tabEvents-DguZpCCv.js';
14
14
  import yaml from 'js-yaml';
15
15
  import fs__default, { readFileSync } from 'fs';
16
- export { C as client, b as getRefValueType, i as importJsonSchema, l as loadSchemaFromFile, r as readJsonImportFile, s as syncSchemaFromSource, t as transformImportToSchemaFile } from './ClientManager-DDA9956Y.js';
16
+ export { C as client, g as getRefValueType, b as importJsonSchema, l as loadSchemaFromFile, r as readJsonImportFile, s as syncSchemaFromSource, t as transformImportToSchemaFile } from './ClientManager-C-QXqUK9.js';
17
17
  import { execSync } from 'child_process';
18
18
  import path from 'path';
19
- import { configurePlatform } from './configurePlatform-YcOiDQBZ.js';
19
+ import { configurePlatform } from './configurePlatform-BRw2j0ZN.js';
20
20
  import 'xstate';
21
21
  import 'debug';
22
22
  import './model-DGMe-TTm.js';
@@ -30,7 +30,7 @@ import '@seedprotocol/eas';
30
30
  import 'fs/promises';
31
31
  import 'url';
32
32
  import 'node:url';
33
- import './index-CSOQFAOn.js';
33
+ import './index-DglvthOk.js';
34
34
  import '@libsql/client';
35
35
  import 'drizzle-orm/libsql';
36
36
  import 'drizzle-orm/libsql/migrator';
@@ -39,6 +39,7 @@ import '@seedprotocol/eas/node';
39
39
  import 'nanoid';
40
40
  import 'nanoid-dictionary';
41
41
  import '@seedprotocol/query';
42
+ import '@noble/hashes/sha256';
42
43
  import '@noble/hashes/sha3';
43
44
  import '@noble/hashes/utils';
44
45
 
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sources":["../../src/imports/markdown.ts","../../src/node/webpack/index.ts","../../src/node/helpers/scripts.ts","../../src/node/index.ts"],"sourcesContent":["import yaml from 'js-yaml'\nimport { readFileSync } from 'fs'\nimport { Property, ModelPropertyDataTypes } from '@/Schema'\nimport { ModelDefinitions } from '@/types'\nimport { addModelsToDb } from '../helpers/db'\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'\nimport { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy'\nimport type { Model } from '@/Model/Model'\n\n/**\n * Configuration structure expected in markdown frontmatter\n */\ntype SeedConfig = {\n seed: {\n model: string\n properties: {\n [propertyName: string]: {\n type: string\n target?: string\n /** For List: element type when primitive (e.g. 'Text', 'Number'). Use target for list of relations. */\n itemsType?: string\n }\n }\n }\n}\n\n/**\n * Parses markdown frontmatter from a file\n * @param filePath Path to the markdown file\n * @returns The parsed frontmatter as an object, or null if no frontmatter found\n */\nexport const parseMarkdownFrontmatter = (\n filePath: string,\n): Record<string, any> | null => {\n const content = readFileSync(filePath, 'utf-8')\n \n // Check for frontmatter delimiters (more flexible regex)\n // Matches --- at start, optional whitespace, content, ---, optional whitespace\n const frontmatterRegex = /^---\\s*\\n([\\s\\S]*?)\\n---(\\s*\\n|$)/\n const match = content.match(frontmatterRegex)\n \n if (!match) {\n return null\n }\n \n const frontmatterYaml = match[1]\n \n try {\n const frontmatter = yaml.load(frontmatterYaml) as Record<string, any>\n return frontmatter\n } catch (error) {\n throw new Error(\n `Failed to parse YAML frontmatter in ${filePath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Converts a seed config from frontmatter to ModelDefinitions format\n * @param config The seed configuration from frontmatter\n * @returns ModelDefinitions object ready to be saved to database\n */\nexport const processSeedConfig = (config: SeedConfig): ModelDefinitions => {\n if (!config.seed) {\n throw new Error('No seed configuration found in frontmatter')\n }\n \n const { model: modelName, properties: propertiesConfig } = config.seed\n \n if (!modelName) {\n throw new Error('Model name is required in seed configuration')\n }\n \n if (!propertiesConfig || Object.keys(propertiesConfig).length === 0) {\n throw new Error('Properties are required in seed configuration')\n }\n \n // Convert property configs to Property definitions\n const schema: Record<string, any> = {}\n \n for (const [propertyName, propertyConfig] of Object.entries(propertiesConfig)) {\n const { type, target, itemsType } = propertyConfig\n \n if (!type) {\n throw new Error(`Property type is required for ${propertyName}`)\n }\n \n // Map the type to Property constructor\n switch (type) {\n case ModelPropertyDataTypes.Text:\n schema[propertyName] = Property.Text()\n break\n case ModelPropertyDataTypes.Number:\n schema[propertyName] = Property.Number()\n break\n case ModelPropertyDataTypes.Boolean:\n schema[propertyName] = Property.Boolean()\n break\n case ModelPropertyDataTypes.Date:\n schema[propertyName] = Property.Date()\n break\n case ModelPropertyDataTypes.Image:\n schema[propertyName] = Property.Image()\n break\n case ModelPropertyDataTypes.Json:\n schema[propertyName] = Property.Json()\n break\n case ModelPropertyDataTypes.File:\n schema[propertyName] = Property.File()\n break\n case ModelPropertyDataTypes.Relation:\n if (!target) {\n throw new Error(\n `Target model is required for Relation property ${propertyName}`,\n )\n }\n schema[propertyName] = Property.Relation(target)\n break\n case ModelPropertyDataTypes.List:\n if (itemsType) {\n // List of primitives: itemsType = 'Text', 'Number', etc.\n if (itemsType === ModelPropertyDataTypes.Relation && target) {\n schema[propertyName] = Property.List('Relation', target)\n } else if (itemsType !== ModelPropertyDataTypes.Relation) {\n schema[propertyName] = Property.List(itemsType as any)\n } else {\n throw new Error(\n `List of relations requires target model for property ${propertyName}`,\n )\n }\n } else if (target) {\n // Backward compat: target = model name for list of relations\n schema[propertyName] = Property.List('Relation', target)\n } else {\n throw new Error(\n `List property ${propertyName} requires either itemsType (e.g. 'Text') or target (model name for list of relations)`,\n )\n }\n break\n default:\n throw new Error(\n `Unknown property type: ${type} for property ${propertyName}`,\n )\n }\n }\n \n // Create a mock ModelClass structure that matches ModelDefinitions\n // This is a simplified version that works with addModelsToInternalDb\n const modelClass = {\n schema,\n // addModelsToDb reads property definitions from the model's snapshot context, not from `schema`;\n // without this it saves the model with no properties (and no Relation/List ref models).\n _getSnapshotContext: () => ({ properties: schema }),\n create: async () => {\n throw new Error('Model.create() should not be called directly')\n },\n originalConstructor: class {},\n }\n \n return {\n [modelName]: modelClass as any as Model,\n }\n}\n\n/**\n * Reads a markdown file, parses frontmatter, and saves models/properties to database\n * @param filePath Path to the markdown file\n * @param db Database instance (BetterSQLite3Database or SqliteRemoteDatabase)\n * @returns The created ModelDefinitions\n */\nexport const saveModelsFromMarkdown = async (\n filePath: string,\n db: BetterSQLite3Database<any> | SqliteRemoteDatabase<any>,\n): Promise<ModelDefinitions> => {\n // Parse frontmatter\n const frontmatter = parseMarkdownFrontmatter(filePath)\n \n if (!frontmatter) {\n throw new Error(`No frontmatter found in ${filePath}`)\n }\n \n // Validate and process seed config\n const seedConfig = frontmatter as SeedConfig\n const modelDefinitions = processSeedConfig(seedConfig)\n \n // Save to database\n await addModelsToDb(modelDefinitions, undefined, undefined, undefined)\n \n return modelDefinitions\n}\n","/**\n * Webpack / Next.js config helper for Seed Protocol apps.\n */\nexport const withSeed = (config: any, webpack: any, isServer: boolean) => {\n config.plugins.push(\n new webpack.NormalModuleReplacementPlugin(/node:/, (resource: { request: string }) => {\n resource.request = resource.request.replace(/^node:/, '')\n }),\n )\n\n if (!isServer) {\n config.resolve.alias['fs'] = '@zenfs/core'\n config.resolve.alias['node:fs'] = '@zenfs/core'\n config.resolve.alias['node:path'] = 'path-browserify'\n config.resolve.alias['path'] = 'path-browserify'\n }\n\n if (isServer) {\n config.externals.push('@sqlite.org/sqlite-wasm')\n config.externals.push('chokidar')\n config.externals.push('arweave')\n }\n\n return config\n}\n","import { execSync } from 'child_process'\nimport path from 'path'\nimport fs from 'fs'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nexport const commandExists = (command: string): boolean => {\n try {\n execSync(`which ${command}`, { stdio: 'ignore' })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Finds the seed binary path, trying multiple locations\n * @returns The path to the seed binary, or null if not found\n */\nexport const findSeedBinary = (): string | null => {\n const cwd = process.cwd()\n\n const possiblePaths = [\n path.join(cwd, 'node_modules', '.bin', 'seed'),\n path.join(cwd, 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n ]\n\n for (const binPath of possiblePaths) {\n if (fs.existsSync(binPath)) {\n return binPath\n }\n }\n\n return null\n}\n\n/**\n * Ensures the Node app DB exists and SDK migrations are applied.\n * (Formerly `runSeedInit`; CLI spawn / npx fallbacks archived under docs/archive/commented/.)\n */\nexport const ensureNodeDbSchema = async (\n _schemaFileDir?: string,\n appFilesDirPath?: string\n): Promise<void> => {\n if (!appFilesDirPath) {\n throw new Error('ensureNodeDbSchema requires appFilesDirPath')\n }\n\n await BaseDb.prepareDb(appFilesDirPath)\n}\n\n/** @deprecated Use ensureNodeDbSchema */\nexport const runSeedInit = ensureNodeDbSchema\n","import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport {\n Model,\n Property,\n Image,\n List,\n Text,\n Json,\n Relation,\n Boolean,\n Number,\n Date,\n} from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty, ItemPropertySaveValidationError } from '../ItemProperty/ItemProperty'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\nexport {\n isPublishedSeedRef,\n normalizeRelationPropertyValue,\n resolveSeedIdsFromRefString,\n} from '../helpers/relationSeedRef'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Webpack helper\nexport { withSeed } from './webpack'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\n\n// CLI exports\nexport { PathResolver } from './helpers/PathResolver'\nexport { BasePathResolver } from '../helpers/PathResolver/BasePathResolver'\nexport {\n commandExists,\n ensureNodeDbSchema,\n runSeedInit,\n findSeedBinary,\n} from './helpers/scripts'\nexport { INIT_SCRIPT_SUCCESS_MESSAGE, SCHEMA_TS } from '../helpers/constants'\n\n// Side effect imports for CLI — register platform services\nimport { createPlatformServices } from '../platform/index.node'\nimport { configurePlatform } from '../platform/configurePlatform'\nconfigurePlatform(createPlatformServices())\n\nenableMapSet() "],"names":["fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;AAIG;AACI,MAAM,wBAAwB,GAAG,CACtC,QAAgB,KACc;IAC9B,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;;;IAI/C,MAAM,gBAAgB,GAAG,mCAAmC;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAE7C,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;AAEhC,IAAA,IAAI;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAwB;AACrE,QAAA,OAAO,WAAW;IACpB;IAAE,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,CAAA,oCAAA,EAAuC,QAAQ,KAAK,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,CAAE,CAC7G;IACH;AACF;AAEA;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAkB,KAAsB;AACxE,IAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AAChB,QAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;IAC/D;AAEA,IAAA,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,g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AE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;KACrF;AAED,IAAA,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE;AACnC,QAAA,IAAIA,WAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AAC1B,YAAA,OAAO,OAAO;QAChB;IACF;AAEA,IAAA,OAAO,IAAI;AACb;AAEA;;;AAGG;AACI,MAAM,kBAAkB,GAAG,OAChC,cAAuB,EACvB,eAAwB,KACP;IACjB,IAAI,CAAC,eAAe,EAAE;AACpB,QAAA,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC;IAChE;AAEA,IAAA,MAAM,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;AACzC;AAEA;AACO,MAAM,WAAW,GAAG;;ACiB3B,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;AAE3C,YAAY,EAAE;;"}
1
+ {"version":3,"file":"node.js","sources":["../../src/imports/markdown.ts","../../src/node/webpack/index.ts","../../src/node/helpers/scripts.ts","../../src/node/index.ts"],"sourcesContent":["import yaml from 'js-yaml'\nimport { readFileSync } from 'fs'\nimport { Property, ModelPropertyDataTypes } from '@/Schema'\nimport { ModelDefinitions } from '@/types'\nimport { addModelsToDb } from '../helpers/db'\nimport type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'\nimport { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy'\nimport type { Model } from '@/Model/Model'\n\n/**\n * Configuration structure expected in markdown frontmatter\n */\ntype SeedConfig = {\n seed: {\n model: string\n properties: {\n [propertyName: string]: {\n type: string\n target?: string\n /** For List: element type when primitive (e.g. 'Text', 'Number'). Use target for list of relations. */\n itemsType?: string\n }\n }\n }\n}\n\n/**\n * Parses markdown frontmatter from a file\n * @param filePath Path to the markdown file\n * @returns The parsed frontmatter as an object, or null if no frontmatter found\n */\nexport const parseMarkdownFrontmatter = (\n filePath: string,\n): Record<string, any> | null => {\n const content = readFileSync(filePath, 'utf-8')\n \n // Check for frontmatter delimiters (more flexible regex)\n // Matches --- at start, optional whitespace, content, ---, optional whitespace\n const frontmatterRegex = /^---\\s*\\n([\\s\\S]*?)\\n---(\\s*\\n|$)/\n const match = content.match(frontmatterRegex)\n \n if (!match) {\n return null\n }\n \n const frontmatterYaml = match[1]\n \n try {\n const frontmatter = yaml.load(frontmatterYaml) as Record<string, any>\n return frontmatter\n } catch (error) {\n throw new Error(\n `Failed to parse YAML frontmatter in ${filePath}: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n}\n\n/**\n * Converts a seed config from frontmatter to ModelDefinitions format\n * @param config The seed configuration from frontmatter\n * @returns ModelDefinitions object ready to be saved to database\n */\nexport const processSeedConfig = (config: SeedConfig): ModelDefinitions => {\n if (!config.seed) {\n throw new Error('No seed configuration found in frontmatter')\n }\n \n const { model: modelName, properties: propertiesConfig } = config.seed\n \n if (!modelName) {\n throw new Error('Model name is required in seed configuration')\n }\n \n if (!propertiesConfig || Object.keys(propertiesConfig).length === 0) {\n throw new Error('Properties are required in seed configuration')\n }\n \n // Convert property configs to Property definitions\n const schema: Record<string, any> = {}\n \n for (const [propertyName, propertyConfig] of Object.entries(propertiesConfig)) {\n const { type, target, itemsType } = propertyConfig\n \n if (!type) {\n throw new Error(`Property type is required for ${propertyName}`)\n }\n \n // Map the type to Property constructor\n switch (type) {\n case ModelPropertyDataTypes.Text:\n schema[propertyName] = Property.Text()\n break\n case ModelPropertyDataTypes.Number:\n schema[propertyName] = Property.Number()\n break\n case ModelPropertyDataTypes.Boolean:\n schema[propertyName] = Property.Boolean()\n break\n case ModelPropertyDataTypes.Date:\n schema[propertyName] = Property.Date()\n break\n case ModelPropertyDataTypes.Image:\n schema[propertyName] = Property.Image()\n break\n case ModelPropertyDataTypes.Json:\n schema[propertyName] = Property.Json()\n break\n case ModelPropertyDataTypes.File:\n schema[propertyName] = Property.File()\n break\n case ModelPropertyDataTypes.Relation:\n if (!target) {\n throw new Error(\n `Target model is required for Relation property ${propertyName}`,\n )\n }\n schema[propertyName] = Property.Relation(target)\n break\n case ModelPropertyDataTypes.List:\n if (itemsType) {\n // List of primitives: itemsType = 'Text', 'Number', etc.\n if (itemsType === ModelPropertyDataTypes.Relation && target) {\n schema[propertyName] = Property.List('Relation', target)\n } else if (itemsType !== ModelPropertyDataTypes.Relation) {\n schema[propertyName] = Property.List(itemsType as any)\n } else {\n throw new Error(\n `List of relations requires target model for property ${propertyName}`,\n )\n }\n } else if (target) {\n // Backward compat: target = model name for list of relations\n schema[propertyName] = Property.List('Relation', target)\n } else {\n throw new Error(\n `List property ${propertyName} requires either itemsType (e.g. 'Text') or target (model name for list of relations)`,\n )\n }\n break\n default:\n throw new Error(\n `Unknown property type: ${type} for property ${propertyName}`,\n )\n }\n }\n \n // Create a mock ModelClass structure that matches ModelDefinitions\n // This is a simplified version that works with addModelsToInternalDb\n const modelClass = {\n schema,\n // addModelsToDb reads property definitions from the model's snapshot context, not from `schema`;\n // without this it saves the model with no properties (and no Relation/List ref models).\n _getSnapshotContext: () => ({ properties: schema }),\n create: async () => {\n throw new Error('Model.create() should not be called directly')\n },\n originalConstructor: class {},\n }\n \n return {\n [modelName]: modelClass as any as Model,\n }\n}\n\n/**\n * Reads a markdown file, parses frontmatter, and saves models/properties to database\n * @param filePath Path to the markdown file\n * @param db Database instance (BetterSQLite3Database or SqliteRemoteDatabase)\n * @returns The created ModelDefinitions\n */\nexport const saveModelsFromMarkdown = async (\n filePath: string,\n db: BetterSQLite3Database<any> | SqliteRemoteDatabase<any>,\n): Promise<ModelDefinitions> => {\n // Parse frontmatter\n const frontmatter = parseMarkdownFrontmatter(filePath)\n \n if (!frontmatter) {\n throw new Error(`No frontmatter found in ${filePath}`)\n }\n \n // Validate and process seed config\n const seedConfig = frontmatter as SeedConfig\n const modelDefinitions = processSeedConfig(seedConfig)\n \n // Save to database\n await addModelsToDb(modelDefinitions, undefined, undefined, undefined)\n \n return modelDefinitions\n}\n","/**\n * Webpack / Next.js config helper for Seed Protocol apps.\n */\nexport const withSeed = (config: any, webpack: any, isServer: boolean) => {\n config.plugins.push(\n new webpack.NormalModuleReplacementPlugin(/node:/, (resource: { request: string }) => {\n resource.request = resource.request.replace(/^node:/, '')\n }),\n )\n\n if (!isServer) {\n config.resolve.alias['fs'] = '@zenfs/core'\n config.resolve.alias['node:fs'] = '@zenfs/core'\n config.resolve.alias['node:path'] = 'path-browserify'\n config.resolve.alias['path'] = 'path-browserify'\n }\n\n if (isServer) {\n config.externals.push('@sqlite.org/sqlite-wasm')\n config.externals.push('chokidar')\n config.externals.push('arweave')\n }\n\n return config\n}\n","import { execSync } from 'child_process'\nimport path from 'path'\nimport fs from 'fs'\nimport { BaseDb } from '@/db/Db/BaseDb'\n\nexport const commandExists = (command: string): boolean => {\n try {\n execSync(`which ${command}`, { stdio: 'ignore' })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Finds the seed binary path, trying multiple locations\n * @returns The path to the seed binary, or null if not found\n */\nexport const findSeedBinary = (): string | null => {\n const cwd = process.cwd()\n\n const possiblePaths = [\n path.join(cwd, 'node_modules', '.bin', 'seed'),\n path.join(cwd, 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n path.join(cwd, '..', '..', 'node_modules', '.bin', 'seed'),\n path.join(cwd, '..', '..', 'node_modules', '@seedprotocol', 'cli', 'dist', 'bin.js'),\n ]\n\n for (const binPath of possiblePaths) {\n if (fs.existsSync(binPath)) {\n return binPath\n }\n }\n\n return null\n}\n\n/**\n * Ensures the Node app DB exists and SDK migrations are applied.\n * (Formerly `runSeedInit`; CLI spawn / npx fallbacks archived under docs/archive/commented/.)\n */\nexport const ensureNodeDbSchema = async (\n _schemaFileDir?: string,\n appFilesDirPath?: string\n): Promise<void> => {\n if (!appFilesDirPath) {\n throw new Error('ensureNodeDbSchema requires appFilesDirPath')\n }\n\n await BaseDb.prepareDb(appFilesDirPath)\n}\n\n/** @deprecated Use ensureNodeDbSchema */\nexport const runSeedInit = ensureNodeDbSchema\n","import { enableMapSet } from 'immer'\n\n// Core schema exports\nexport {\n Model,\n Property,\n Image,\n List,\n Text,\n Json,\n Relation,\n Boolean,\n Number,\n Date,\n} from '../Schema'\n\n// Core classes\nexport { Item } from '../Item/Item'\nexport { ItemProperty, ItemPropertySaveValidationError } from '../ItemProperty/ItemProperty'\n\n// Node.js specific exports\nexport { FileManager } from './helpers/FileManager'\nexport { Db, resolveSdkDrizzleMigrationsDir } from './db/Db'\n\n// Schema exports\nexport { models, versions, seeds, metadata, appState, config, modelUids } from '../seedSchema'\n\n// Model access - use Model static methods instead\n// Models are accessible via Model.all(), Model.getById(), Model.getByName(), etc.\n\n// Helper exports\nexport { getCorrectId } from '../helpers'\nexport {\n isPublishedSeedRef,\n normalizeRelationPropertyValue,\n resolveSeedIdsFromRefString,\n} from '../helpers/relationSeedRef'\n\n// Import exports\nexport * from '../imports'\n\n// Event bus\nexport { eventEmitter } from '../eventBus'\n\n// Webpack helper\nexport { withSeed } from './webpack'\n\n// Types\n// Note: PublishUpload type is available from '../db/read/getPublishUploads'\n// Type-only exports cause issues with Rollup's parser. Import directly if needed:\n// import type { PublishUpload } from '@seedprotocol/sdk/db/read/getPublishUploads'\n\n// Client\nexport { client } from '../client'\n\n// All types\nexport * from '../types'\n\n// CLI exports\nexport { PathResolver } from './helpers/PathResolver'\nexport { BasePathResolver } from '../helpers/PathResolver/BasePathResolver'\nexport {\n commandExists,\n ensureNodeDbSchema,\n runSeedInit,\n findSeedBinary,\n} from './helpers/scripts'\nexport { INIT_SCRIPT_SUCCESS_MESSAGE, SCHEMA_TS } from '../helpers/constants'\n\n// Side effect imports for CLI — register platform services\nimport { createPlatformServices } from '../platform/index.node'\nimport { configurePlatform } from '../platform/configurePlatform'\nconfigurePlatform(createPlatformServices())\n\nenableMapSet() "],"names":["fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,KAAK,CAAC,6CAA6C,CAAC;IAChE;AAEA,IAAA,MAAM,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;AACzC;AAEA;AACO,MAAM,WAAW,GAAG;;ACiB3B,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;AAE3C,YAAY,EAAE;;"}
@@ -1,25 +1,27 @@
1
- export { c as createPlatformServices } from './index.browser-CjTe0vt1.js';
2
- import './BasePathResolver-BdxCSIzn.js';
1
+ export { c as createPlatformServices } from './index.browser-Cm06tP4X.js';
2
+ import './BasePathResolver-CfSfMW5_.js';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
  import 'drizzle-orm';
5
5
  import '@seedprotocol/arweave';
6
- import './tabEvents-BZJMY5uK.js';
6
+ import './tabEvents-DguZpCCv.js';
7
7
  import 'debug';
8
8
  import '@seedprotocol/eas';
9
9
  import 'xstate';
10
10
  import 'pluralize';
11
- import './db-CQt-gcAl.js';
11
+ import './db-D9K_f5cF.js';
12
12
  import 'drizzle-orm/casing';
13
13
  import 'lodash-es';
14
14
  import '@sinclair/typebox';
15
15
  import 'nanoid';
16
16
  import 'nanoid-dictionary';
17
17
  import '@seedprotocol/query';
18
- import './errors-CrBxGWah.js';
19
- import 'drizzle-orm/sqlite-proxy';
20
18
  import '@noble/hashes/sha256';
19
+ import '@noble/hashes/sha3';
21
20
  import '@noble/hashes/utils';
22
- import './index-CSOQFAOn.js';
21
+ import './mimeTypes-DHAHC4eZ.js';
22
+ import './errors-CrBxGWah.js';
23
+ import 'drizzle-orm/sqlite-proxy';
24
+ import './index-DglvthOk.js';
23
25
  import 'sqlocal/drizzle';
24
26
  import 'rxjs';
25
27
  import 'graphql-request';
@@ -1 +1 @@
1
- {"version":3,"file":"platform.browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"platform.browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
- export { c as createPlatformServices } from './index.node-Cfa7npS6.js';
1
+ export { c as createPlatformServices } from './index.node-C30dmFgn.js';
2
2
  import '@seedprotocol/arweave/node';
3
3
  import '@seedprotocol/eas/node';
4
4
  import 'path';
5
5
  import 'fs';
6
- import './BasePathResolver-BdxCSIzn.js';
6
+ import './BasePathResolver-CfSfMW5_.js';
7
7
  import 'drizzle-orm/sqlite-core';
8
8
  import 'drizzle-orm';
9
9
  import '@seedprotocol/arweave';
@@ -11,7 +11,7 @@ import 'debug';
11
11
  import 'fs/promises';
12
12
  import 'url';
13
13
  import 'node:url';
14
- import './index-CSOQFAOn.js';
14
+ import './index-DglvthOk.js';
15
15
  import '@libsql/client';
16
16
  import 'drizzle-orm/libsql';
17
17
  import 'drizzle-orm/libsql/migrator';
@@ -1,21 +1,24 @@
1
1
  import pluralize from 'pluralize';
2
- import { r as resolveStorageNameToSchemaName } from './Item-D4FigtYS.js';
3
- import { a as BaseDb, p as properties, j as models } from './BasePathResolver-BdxCSIzn.js';
2
+ import { r as resolveStorageNameToSchemaName } from './Item-C7sUUu2B.js';
3
+ import { B as BaseDb, p as properties, i as models } from './BasePathResolver-CfSfMW5_.js';
4
4
  import { and, eq } from 'drizzle-orm';
5
5
  import { modelPropertiesToObject } from './model-DGMe-TTm.js';
6
- import { l as normalizePropertyRecordSchema } from './db-CQt-gcAl.js';
7
- export { B as Boolean, a as Date, F as File, H as Html, I as Image, J as Json, L as List, M as ModelPropertyDataTypes, N as Number, P as Property, b as PropertyConstructor, c as PropertyMetadataKey, R as Relation, T as THtmlEmbeddedDataUriPolicy, d as TProperty, e as TPropertyConstructor, f as TPropertyDataType, g as TPropertyDefs, h as TStorageType, j as Text, k as isDataType, n as normalizeDataType } from './db-CQt-gcAl.js';
6
+ import { l as normalizePropertyRecordSchema } from './db-D9K_f5cF.js';
7
+ export { B as Boolean, a as Date, F as File, H as Html, I as Image, J as Json, L as List, M as ModelPropertyDataTypes, N as Number, P as Property, b as PropertyConstructor, c as PropertyMetadataKey, R as Relation, T as THtmlEmbeddedDataUriPolicy, d as TProperty, e as TPropertyConstructor, f as TPropertyDataType, g as TPropertyDefs, h as TStorageType, j as Text, k as isDataType, n as normalizeDataType } from './db-D9K_f5cF.js';
8
8
  import 'xstate';
9
9
  import 'debug';
10
10
  import 'rxjs';
11
11
  import 'lodash-es';
12
12
  import 'drizzle-orm/casing';
13
13
  import '@seedprotocol/eas';
14
- import './tabEvents-BZJMY5uK.js';
14
+ import './tabEvents-DguZpCCv.js';
15
15
  import '@seedprotocol/arweave';
16
16
  import 'nanoid';
17
17
  import 'nanoid-dictionary';
18
18
  import '@seedprotocol/query';
19
+ import '@noble/hashes/sha256';
20
+ import '@noble/hashes/sha3';
21
+ import '@noble/hashes/utils';
19
22
  import 'drizzle-orm/sqlite-core';
20
23
  import '@sinclair/typebox';
21
24
 
@@ -57,15 +60,15 @@ const getPropertySchema = async (modelName, propertyName,
57
60
  /** Which model is meant when several schemas define one named modelName (Model.id and/or schema). */
58
61
  scope = {}) => {
59
62
  // Dynamic import to break circular dependency
60
- const _mod_0 = await import('./index-Xl1_4Lmb.js');
63
+ const _mod_0 = await import('./index-s15q14rm.js');
61
64
  const _ns_0 = _mod_0.f;
62
65
  const modelMod = _ns_0;
63
66
  const { Model } = modelMod;
64
- const _mod_1 = await import('./Schema-B8xqLWkL.js');
67
+ const _mod_1 = await import('./Schema-fXtvd-yL.js');
65
68
  const _ns_1 = _mod_1.b;
66
69
  const schemaMod = _ns_1;
67
70
  const { Schema } = schemaMod;
68
- const _mod_2 = await import('./db-CQt-gcAl.js');
71
+ const _mod_2 = await import('./db-D9K_f5cF.js');
69
72
  const _ns_2 = _mod_2.Y;
70
73
  const { resolveModelRecord } = _ns_2;
71
74
  const model = await Model.resolveAsync(modelName, scope);
@@ -291,4 +294,4 @@ scope = {}) => {
291
294
  };
292
295
 
293
296
  export { getPropertySchema, normalizePropertyRecordSchema };
294
- //# sourceMappingURL=property-BrXkY1Rg.js.map
297
+ //# sourceMappingURL=property-DhmmYAvQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-DhmmYAvQ.js","sources":["../../src/helpers/property.ts"],"sourcesContent":["import { Static } from '@sinclair/typebox'\nimport { TProperty } from '@/Schema'\n// Dynamic import to break circular dependency: Model -> ... -> helpers/property -> Model\n// import { Model } from '@/Model/Model'\nimport pluralize from 'pluralize'\nimport { resolveStorageNameToSchemaName } from '@/helpers/metadataPropertyNames'\nimport { BaseDb } from '@/db/Db/BaseDb'\nimport { models as modelsTable, properties, PropertyType } from '@/seedSchema'\nimport { eq, and } from 'drizzle-orm'\nimport { modelPropertiesToObject } from '@/helpers/model'\n\n// Re-export everything from property/index.ts to make it available when importing from helpers/property\nexport * from './property/index'\n\n/**\n * Gets the propertyRecordSchema object for a given model and property name.\n * \n * The propertyRecordSchema is the property definition object that contains\n * information about the property's data type, storage configuration, and\n * relationship details (for Relation and List types).\n * \n * This function first checks the database for property definitions (which may\n * have been edited), then falls back to schema files. This ensures that\n * edited properties persist across page reloads.\n * \n * This function handles property names that end with 'Id' or 'Ids' by automatically\n * looking up the base property name in the schema (e.g., 'authorId' -> 'author',\n * 'tagIds' -> 'tags').\n * \n * @param modelName - The name of the model (e.g., 'Article', 'Author')\n * @param propertyName - The name of the property (e.g., 'title', 'author', 'authorId', 'tags', 'tagIds')\n * @returns The propertyRecordSchema object (TProperty with optional _propertyFileId) or undefined if not found\n * \n * @example\n * ```typescript\n * const schema = await getPropertySchema('Article', 'title')\n * // Returns: { dataType: 'Text', ... }\n * \n * const relationSchema = await getPropertySchema('Article', 'author')\n * // Returns: { dataType: 'Relation', ref: 'Author', ... }\n * \n * // Also works with Id/Ids suffixes\n * const relationSchemaById = await getPropertySchema('Article', 'authorId')\n * // Returns: { dataType: 'Relation', ref: 'Author', ... }\n * ```\n */\nexport const getPropertySchema = async (\n modelName: string,\n propertyName: string,\n /** Which model is meant when several schemas define one named modelName (Model.id and/or schema). */\n scope: { modelFileId?: string | null; schemaName?: string | null } = {},\n): Promise<(Static<typeof TProperty> & { _propertyFileId?: string }) | undefined> => {\n // Dynamic import to break circular dependency\n const modelMod = await import('../Model/Model')\n const { Model } = modelMod\n const schemaMod = await import('../Schema/Schema')\n const { Schema } = schemaMod\n const { resolveModelRecord } = await import('../db/read/resolveModelRecord')\n const model = await Model.resolveAsync(modelName, scope)\n\n if (!model) {\n return undefined\n }\n \n // Get the original schema from Schema instance context (has ref fields from schema file)\n // This is more reliable than modelPropertiesToObject which depends on ModelProperty instances\n let schema: { [propertyName: string]: any } = {}\n try {\n const schemaName = model.schemaName\n if (schemaName) {\n const schemaInstance = Schema.create(schemaName, {\n waitForReady: false,\n }) as import('@/Schema/Schema').Schema\n const schemaContext = schemaInstance.getService().getSnapshot().context\n if (schemaContext.models && schemaContext.models[modelName]) {\n // Get properties from Schema context (original schema file data)\n const modelDef = schemaContext.models[modelName]\n schema = modelDef.properties || {}\n }\n }\n } catch (error) {\n // Fall through to modelPropertiesToObject\n }\n \n // Fallback to modelPropertiesToObject if Schema context doesn't have the data\n const usingModelProperties = Object.keys(schema).length === 0\n if (usingModelProperties) {\n const properties = model.properties || []\n if (properties.length === 0) {\n return undefined\n }\n schema = modelPropertiesToObject(properties)\n }\n \n // Helper to resolve property name (handles Id/Ids suffixes)\n const resolvePropertyName = (propName: string): string | undefined => {\n // First, try direct lookup\n if (schema[propName]) {\n return propName\n }\n\n // List-of-relation storage name (e.g. authorIdentityIds) -> schema key (authors)\n const listSchemaKey = resolveStorageNameToSchemaName(schema, propName)\n if (listSchemaKey && schema[listSchemaKey]) {\n return listSchemaKey\n }\n\n // Handle properties ending with 'Id' or 'Ids'\n let propertyNameWithoutId: string | undefined\n \n if (propName.endsWith('Id')) {\n propertyNameWithoutId = propName.slice(0, -2)\n } else if (propName.endsWith('Ids')) {\n propertyNameWithoutId = propName.slice(0, -3)\n propertyNameWithoutId = pluralize(propertyNameWithoutId)\n }\n \n if (propertyNameWithoutId && schema[propertyNameWithoutId]) {\n return propertyNameWithoutId\n }\n \n return undefined\n }\n \n let resolvedPropertyName = resolvePropertyName(propertyName)\n if (!resolvedPropertyName && !usingModelProperties) {\n // A property added at runtime (ModelProperty.create) to a schema-file model isn't in the\n // Schema context. The schema file's definitions still win.\n const runtimeProperties = model.properties || []\n if (runtimeProperties.length > 0) {\n schema = { ...modelPropertiesToObject(runtimeProperties), ...schema }\n resolvedPropertyName = resolvePropertyName(propertyName)\n }\n // model.properties can lag behind the properties table (in Node it never follows rows added\n // after the model found its own), so also look for a row with this exact name below.\n if (!resolvedPropertyName) resolvedPropertyName = propertyName\n }\n if (!resolvedPropertyName) {\n return undefined\n }\n \n // Try to get property from database first (may have edited values)\n try {\n const db = BaseDb.getAppDb()\n if (db) {\n // Find the model in the database (the same row as `model`, not just any model with this name)\n const resolvedModelRecord = await resolveModelRecord(\n modelName,\n { modelFileId: model.id ?? scope.modelFileId, schemaName: model.schemaName ?? scope.schemaName },\n db,\n )\n const modelRecords = resolvedModelRecord ? [resolvedModelRecord] : []\n \n if (modelRecords.length > 0) {\n const modelRecord = modelRecords[0]\n \n // Find the property in the database by name\n let propertyRecords = await db\n .select()\n .from(properties)\n .where(\n and(\n eq(properties.name, resolvedPropertyName),\n eq(properties.modelId, modelRecord.id!),\n ),\n )\n .limit(1)\n \n // If not found by name, check for renamed properties (orphaned DB properties)\n if (propertyRecords.length === 0) {\n // Get all properties for this model\n const allDbProperties = await db\n .select()\n .from(properties)\n .where(eq(properties.modelId, modelRecord.id!))\n \n // Get all schema property names to identify orphaned properties\n const schemaPropertyNames = new Set(Object.keys(schema))\n \n // Get the schema property definition to match characteristics\n const schemaPropertyDef = schema[resolvedPropertyName]\n \n if (schemaPropertyDef) {\n // Find orphaned properties (don't match any schema property name) that match characteristics\n const orphanedProperties = allDbProperties.filter((p: PropertyType) => \n !schemaPropertyNames.has(p.name) && // Doesn't match any schema property name\n p.dataType === schemaPropertyDef.dataType // Same dataType\n )\n \n // If there's exactly one orphaned property with matching characteristics, it's likely the renamed property\n // We can also match by refModelId if it's a relation\n if (orphanedProperties.length > 0) {\n let matchedProperty = orphanedProperties[0]\n \n // If it's a relation, try to match by refModelId\n if (schemaPropertyDef.ref) {\n const refModelRecord = await resolveModelRecord(\n schemaPropertyDef.ref,\n { schemaName: model.schemaName },\n db,\n )\n \n if (refModelRecord) {\n const expectedRefModelId = refModelRecord.id\n const matchingByRef = orphanedProperties.find((p: PropertyType) => p.refModelId === expectedRefModelId)\n if (matchingByRef) {\n matchedProperty = matchingByRef\n }\n }\n } else {\n // For non-relation properties, prefer ones without refModelId\n const withoutRef = orphanedProperties.find((p: PropertyType) => p.refModelId === null)\n if (withoutRef) {\n matchedProperty = withoutRef\n }\n }\n \n propertyRecords = [matchedProperty]\n }\n }\n }\n \n if (propertyRecords.length > 0) {\n const propertyRecord = propertyRecords[0]\n \n // Get the base schema from file to merge with database values\n // Use the schema object created earlier, not model.schema (which doesn't exist)\n const schemaFromFile = schema[resolvedPropertyName]\n \n // Build property schema from database, merging with file schema for fields not in DB\n // Use the schema property name (resolvedPropertyName) even if DB has different name (renamed)\n const propertySchema: Static<typeof TProperty> & { _propertyFileId?: string; _dbId?: number } = {\n ...schemaFromFile, // Start with file schema (has all fields like storageType, etc.)\n id: propertyRecord.schemaFileId || propertyRecord.id?.toString(), // id should be schemaFileId (string), not database ID\n _dbId: propertyRecord.id, // Store database integer ID separately\n name: resolvedPropertyName, // Use schema name, not DB name (for renamed properties)\n dataType: propertyRecord.dataType as any,\n modelId: propertyRecord.modelId,\n modelName,\n refModelId: propertyRecord.refModelId || undefined,\n refValueType: (propertyRecord.refValueType as any) || undefined,\n required: (propertyRecord as { required?: boolean }).required ?? undefined,\n storageType: (propertyRecord.storageType as any) ?? schemaFromFile?.storageType,\n localStorageDir: propertyRecord.localStorageDir ?? schemaFromFile?.localStorageDir,\n filenameSuffix: propertyRecord.filenameSuffix ?? schemaFromFile?.filenameSuffix,\n // Include schemaFileId from database as _propertyFileId for ModelProperty.create()\n _propertyFileId: propertyRecord.schemaFileId || undefined,\n }\n \n // If refModelId is set, try to get the refModelName\n if (propertyRecord.refModelId) {\n const refModelRecords = await db\n .select()\n .from(modelsTable)\n .where(eq(modelsTable.id, propertyRecord.refModelId))\n .limit(1)\n \n if (refModelRecords.length > 0) {\n propertySchema.refModelName = refModelRecords[0].name\n propertySchema.ref = refModelRecords[0].name\n }\n } else if (schemaFromFile?.ref) {\n // If refModelId is not set but schema file has ref, resolve it from the database\n // This handles cases where the property was just created and refModelId hasn't been set yet\n propertySchema.ref = schemaFromFile.ref\n propertySchema.refModelName = schemaFromFile.ref\n \n // Try to resolve refModelId from the database using the model name\n try {\n const refModelRecord = await resolveModelRecord(\n schemaFromFile.ref,\n { schemaName: model.schemaName },\n db,\n )\n \n if (refModelRecord?.id) {\n propertySchema.refModelId = refModelRecord.id\n }\n } catch (error) {\n // Ignore errors - model might not exist yet\n }\n }\n \n return propertySchema\n }\n }\n }\n } catch (error) {\n // Database not available or error - fall through to schema file lookup\n }\n \n // Fall back to schema file lookup\n const schemaFromFile = schema[resolvedPropertyName]\n if (schemaFromFile) {\n const propertySchema: Static<typeof TProperty> & { _propertyFileId?: string } = { ...schemaFromFile, name: resolvedPropertyName }\n \n // If schema file has id as a string (propertyFileId), set it as _propertyFileId\n // This handles cases where the property hasn't been saved to the database yet\n if (typeof schemaFromFile.id === 'string') {\n propertySchema._propertyFileId = schemaFromFile.id\n }\n \n // If the schema file has ref but no refModelId, try to resolve it from the database\n if (schemaFromFile.ref && !propertySchema.refModelId) {\n try {\n const db = BaseDb.getAppDb()\n if (db) {\n const refModelRecord = await resolveModelRecord(\n schemaFromFile.ref,\n { schemaName: model.schemaName },\n db,\n )\n \n if (refModelRecord?.id) {\n propertySchema.refModelId = refModelRecord.id\n propertySchema.refModelName = schemaFromFile.ref\n }\n }\n } catch (error) {\n // Ignore errors - model might not exist yet or database not available\n }\n }\n \n return propertySchema\n }\n return undefined\n}\n"],"names":["modelsTable"],"mappings":";;;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