@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
@@ -1 +1 @@
1
- {"version":3,"file":"getItems.d.ts","sourceRoot":"","sources":["../../../../src/db/read/getItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAWlC,KAAK,iBAAiB,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;CAC5C,CAAA;AAED,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;AAErE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,YA4G1B,CAAA"}
1
+ {"version":3,"file":"getItems.d.ts","sourceRoot":"","sources":["../../../../src/db/read/getItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAclC,KAAK,iBAAiB,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;CAC5C,CAAA;AAED,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;AAErE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,YAqG1B,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import { IItem, IItemProperty } from '../../interfaces';
2
2
  import type { ArweaveTransaction, TransactionTag } from '../../types/arweave';
3
- import { PublishUpload } from '../../types/publish';
3
+ import type { PublishUpload, PublishUploadData } from '../../types/publish';
4
+ /** L1 transactions {@link getPublishUploads} creates at once (each asks the gateway for price and anchor). */
5
+ export declare const CREATE_TRANSACTION_CONCURRENCY = 4;
4
6
  /** Optional tags merged into each Arweave tx after Content-SHA-256 / Content-Type. */
5
7
  export type GetPublishUploadsOptions = {
6
8
  arweaveUploadTags?: TransactionTag[];
@@ -20,11 +22,38 @@ export type UploadProperty = {
20
22
  itemProperty: IItemProperty<any>;
21
23
  childProperties: IItemProperty<any>[];
22
24
  };
25
+ /**
26
+ * Local file of one ItemStorage child of a composite upload. Tries, in order: the property's
27
+ * localStoragePath (context set by save / hydration / the live query), its newest metadata row's
28
+ * refResolvedValue + localStorageDir, then (for a local draft whose propertyValue is the content
29
+ * itself, as rows made before Item.create saved ItemStorage values) that content written to its
30
+ * file, then (for a local draft, or no row) the name
31
+ * saveItemStorage gives a new file (`<seedUid or seedLocalId><extension>` in the model's storage
32
+ * directory). A published or derived row is never swapped for a local file of another name: that
33
+ * file would be older content.
34
+ *
35
+ * `missingLocalEdit` lists the paths tried when nothing exists although the newest row is a saved
36
+ * local edit (no attestation uid, not derived from one, refResolvedValue set by saveItemStorage):
37
+ * that edit's file should be there. A published or derived row without a file (e.g. content not
38
+ * downloaded, or a property the composite never had) is skipped as before.
39
+ */
40
+ export declare const resolveItemStorageChildFile: (childProperty: IItemProperty<any>) => Promise<{
41
+ filePath?: string;
42
+ missingLocalEdit?: string[];
43
+ }>;
23
44
  /** Same walk as getPublishUploads: the item and the draft items its publish carries along. */
24
45
  export declare function itemHasPublishUploadCandidates(item: IItem<any>, relatedItemProperty?: IItemProperty<any>): Promise<boolean>;
25
46
  /**
26
- * Arweave uploads for a publish of `item`: its own, and those of every draft item the publish
27
- * carries along (reachable through relation and list properties, see publishDraftGraph.ts).
47
+ * Upload data for a publish of `item`: its own, and that of every draft item the publish carries
48
+ * along (reachable through relation and list properties, see publishDraftGraph.ts). Raw bytes plus
49
+ * Content-SHA-256 / Content-Type / configured tags; no Arweave transaction is created, so this
50
+ * does not touch the network. The bundler path in `@seedprotocol/publish` signs these as
51
+ * DataItems; {@link getPublishUploads} turns them into L1 transactions.
52
+ */
53
+ export declare const getPublishUploadData: (item: IItem<any>, uploads?: PublishUploadData[], relatedItemProperty?: IItemProperty<any>, options?: GetPublishUploadsOptions) => Promise<PublishUploadData[]>;
54
+ /**
55
+ * Arweave L1 transactions for a publish of `item`: {@link getPublishUploadData}, each made into an
56
+ * unsigned transaction carrying the same tags.
28
57
  */
29
58
  export declare const getPublishUploads: (item: IItem<any>, uploads?: PublishUpload[], relatedItemProperty?: IItemProperty<any>, options?: GetPublishUploadsOptions) => Promise<PublishUpload[]>;
30
59
  //# sourceMappingURL=getPublishUploads.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPublishUploads.d.ts","sourceRoot":"","sources":["../../../../src/db/read/getPublishUploads.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAS/C,sFAAsF;AACtF,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAA;IACpC;;OAEG;IACH,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAA;IACvC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAA;IACtC,qGAAqG;IACrG,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AA2BD,eAAO,MAAM,yBAAyB,GACpC,MAAM,MAAM,GAAG,UAAU,EACzB,aAAa,MAAM,GAAG,SAAS,EAC/B,cAAc,MAAM,EACpB,iBAAiB,cAAc,EAAE,KAChC,OAAO,CAAC,kBAAkB,CAmB5B,CAAA;AAwKD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,aAAa,CAAC,GAAG,CAAC,CAAA;IAChC,eAAe,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,CAAA;CACtC,CAAA;AAwJD,8FAA8F;AAC9F,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAChB,mBAAmB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GACvC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAyND;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAS,aAAa,EAAO,EAC7B,sBAAsB,aAAa,CAAC,GAAG,CA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ClD,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAChB,mBAAmB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GACvC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAoND;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAS,iBAAiB,EAAO,EACjC,sBAAsB,aAAa,CAAC,GAAG,CAAC,EACxC,UAAU,wBAAwB,KACjC,OAAO,CAAC,iBAAiB,EAAE,CAa7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAS,aAAa,EAAO,EAC7B,sBAAsB,aAAa,CAAC,GAAG,CAAC,EACxC,UAAU,wBAAwB,KACjC,OAAO,CAAC,aAAa,EAAE,CAczB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"summarizePublishWork.d.ts","sourceRoot":"","sources":["../../../../src/db/read/summarizePublishWork.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAQrE,YAAY,EAAE,WAAW,EAAE,CAAA;AAE3B,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,uBAAuB,EAAE,sBAAs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,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOxE;AAuCD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EACxB,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAcT;AAyVD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAU,2BAA2B,KACpC,OAAO,CAAC,sBAAsB,EAAE,CAUlC,CAAA;AAED,eAAO,MAAM,oBAAoB,GAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,EAChB,UAAU,2BAA2B,KACpC,OAAO,CAAC,kBAAkB,CAwB5B,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { type MetadataType } from '../../seedSchema';
2
+ type VerbatimRowFields = Pick<MetadataType, 'uid' | 'derivedFromUid' | 'refResolvedValue' | 'propertyValue'>;
3
+ /**
4
+ * A legacy ItemStorage draft row: a local edit (no attestation uid, not derived from one) that holds
5
+ * the content itself in property_value, with no file reference. Item.create / createNewItem stored
6
+ * ItemStorage values like this before they went through the save pipeline.
7
+ */
8
+ export declare const isVerbatimItemStorageDraftRow: (row: VerbatimRowFields) => boolean;
9
+ export type ItemStorageRowStorage = {
10
+ /** The property's `storage.path` (e.g. `/html`); the row's own localStorageDir, else `files`, when unset. */
11
+ localStorageDir?: string | null;
12
+ /** The property's `storage.extension` (e.g. `.html`). */
13
+ filenameSuffix?: string | null;
14
+ /** Seed id to name the file after; the row's seedUid, else its seedLocalId, when unset. */
15
+ seedId?: string | null;
16
+ };
17
+ export type ConvertedItemStorageRow = {
18
+ fileName: string;
19
+ filePath: string;
20
+ localStorageDir: string;
21
+ /** The content now in the file (the row's former property_value). */
22
+ content: string;
23
+ };
24
+ /**
25
+ * Convert one legacy ItemStorage draft row (see {@link isVerbatimItemStorageDraftRow}) into the
26
+ * shape saveItemStorage gives a row: the content goes to the file a save would write
27
+ * (`<seedUid or seedLocalId><extension>` in the property's storage directory), and the row records
28
+ * `refResolvedValue`, `localStorageDir` and `refValueType: 'file'` with property_value cleared.
29
+ * Used by publish (resolveItemStorageChildFile) and the one-time migration (migrateLegacyItemStorageRows).
30
+ *
31
+ * Reading the row, writing the file and updating the row happen under the file's lock
32
+ * ({@link withItemStorageFileLock}), which saveItemStorage holds too: a save in this or another tab
33
+ * either finishes before (the row, read again once the lock is held, is no longer legacy and is
34
+ * left alone) or starts after (and overwrites the file and row with its content). Without the lock
35
+ * a save landing between the read and the file write would have its file overwritten with the old
36
+ * content. The row update also stays conditional on the row being unchanged, for writers that
37
+ * don't take the lock (a tab still running an older SDK).
38
+ *
39
+ * Returns undefined when there was nothing to convert. Throws when the file can't be written; the
40
+ * row is then unchanged.
41
+ */
42
+ export declare const convertVerbatimItemStorageRow: (localId: string, storage?: ItemStorageRowStorage) => Promise<ConvertedItemStorageRow | undefined>;
43
+ export {};
44
+ //# sourceMappingURL=convertVerbatimItemStorageRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertVerbatimItemStorageRow.d.ts","sourceRoot":"","sources":["../../../../src/db/write/convertVerbatimItemStorageRow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAO1D,KAAK,iBAAiB,GAAG,IAAI,CAC3B,YAAY,EACZ,KAAK,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,eAAe,CAChE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,KAAK,iBAAiB,KAAG,OAK7C,CAAA;AAE1B,MAAM,MAAM,qBAAqB,GAAG;IAClC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,UAAS,qBAA0B,KAClC,OAAO,CAAC,uBAAuB,GAAG,SAAS,CA+C7C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"createNewItem.d.ts","sourceRoot":"","sources":["../../../../src/db/write/createNewItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AASrC,KAAK,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,6CAIjC,kBAAkB,KAAG,OAAO,CAAC,uBAAuB,CAkDtD,CAAA"}
1
+ {"version":3,"file":"createNewItem.d.ts","sourceRoot":"","sources":["../../../../src/db/write/createNewItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAcrC,KAAK,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,6CAIjC,kBAAkB,KAAG,OAAO,CAAC,uBAAuB,CAiFtD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../src/events/files/download.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAkSnC,KAAK,mCAAmC,GAAG;IACzC,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,8BAA8B,GAAU,yBAGlD,mCAAmC,kBAUrC,CAAA;AAED,eAAO,MAAM,oCAAoC,GAC/C,yBAAyB,MAAM,EAAE,GAAG;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,kBAyE9D,CAAA;AAED,eAAO,MAAM,+BAA+B,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,OAAO,CAuB5F,CAAA;AAQD,eAAO,MAAM,oCAAoC,GAAI,gBAAgB,MAAM,EAAE,KAAG,IAK/E,CAAA"}
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../../src/events/files/download.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAgVnC,KAAK,mCAAmC,GAAG;IACzC,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,8BAA8B,GAAU,yBAGlD,mCAAmC,kBAUrC,CAAA;AAED,eAAO,MAAM,oCAAoC,GAC/C,yBAAyB,MAAM,EAAE,GAAG;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,kBA0E9D,CAAA;AAED,eAAO,MAAM,+BAA+B,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,OAAO,CAuB5F,CAAA;AAQD,eAAO,MAAM,oCAAoC,GAAI,gBAAgB,MAAM,EAAE,KAAG,IAK/E,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { DownloadAllFilesParams, DownloadSingleFileParams, IFileManager, ResizeAllImagesParams, ResizeImageParams } from './IFileManager';
1
+ import type { DownloadAllFilesParams, DownloadAllFilesResult, DownloadSingleFileParams, IFileManager, ResizeAllImagesParams, ResizeImageParams } from './IFileManager';
2
2
  export declare abstract class BaseFileManager {
3
3
  private static fileSystemInitialized;
4
4
  private static initializing;
@@ -23,8 +23,8 @@ export declare abstract class BaseFileManager {
23
23
  */
24
24
  static getFilesPath(...subpaths: string[]): string;
25
25
  static getContentUrlFromPath(path: string): Promise<string | undefined>;
26
- static downloadAllFiles({ transactionIds, arweaveHost, arweaveBaseUrls, excludedTransactions, }: DownloadAllFilesParams): Promise<void>;
27
- static downloadFileByTransactionId({ transactionId, arweaveHost, arweaveBaseUrls, excludedTransactions, }: DownloadSingleFileParams): Promise<void>;
26
+ static downloadAllFiles(params: DownloadAllFilesParams): Promise<DownloadAllFilesResult | void>;
27
+ static downloadFileByTransactionId({ transactionId, arweaveHost, arweaveBaseUrls, excludedTransactions, expectedContentHash, compositeChildPaths, }: DownloadSingleFileParams): Promise<DownloadAllFilesResult | void>;
28
28
  static resizeImage({ filePath, width, height }: ResizeImageParams): Promise<void>;
29
29
  static resizeAllImages({ width, height }: ResizeAllImagesParams): Promise<void>;
30
30
  static pathExists(filePath: string): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseFileManager.d.ts","sourceRoot":"","sources":["../../../../src/helpers/FileManager/BaseFileManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,gBAAgB,CAAA;AAEvB,8BAAsB,eAAe;IACnC,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAQ;IAC5C,OAAO,CAAC,MAAM,CAAC,YAAY,CAAQ;IACnC,OAAO,CAAC,MAAM,CAAC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MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI;WAIpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;WAI9B,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAI1D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WAInD,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC;IAIlC,MAAM,CAAC,SAAS,IAAI,GAAG;IAIvB,MAAM,CAAC,aAAa,IAAI,GAAG;IAI3B,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIjD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAGrD"}
@@ -4,6 +4,26 @@ export type DownloadAllFilesParams = {
4
4
  /** Ordered read gateways (scheme + host + path) tried before `arweaveHost`; see `getArweaveReadBaseUrls`. */
5
5
  arweaveBaseUrls?: string[];
6
6
  excludedTransactions: Set<string>;
7
+ /**
8
+ * Content-SHA-256 tag values by transaction id. A download with one is saved only when its bytes
9
+ * match (SHA-256, or SHA3-256 for uploads from SDK 0.7.2 and earlier); see `contentSha256TagMatches`.
10
+ */
11
+ expectedContentHashes?: Record<string, string>;
12
+ /**
13
+ * Where each child of a composite upload is saved, by transaction id then child (property) name:
14
+ * a path relative to the files root, the one the SDK reads that ItemStorage property from. See
15
+ * `getCompositeChildPaths`. Children without one use the legacy html / json layout.
16
+ */
17
+ compositeChildPaths?: Record<string, Record<string, string>>;
18
+ };
19
+ /** What a browser download run did, by transaction id. */
20
+ export type DownloadAllFilesResult = {
21
+ /** Bytes matched the expected Content-SHA-256 and were saved. */
22
+ verifiedTransactionIds: string[];
23
+ /** No gateway served bytes matching the expected Content-SHA-256; nothing was saved. */
24
+ hashMismatchTransactionIds: string[];
25
+ /** Saving failed (e.g. an OPFS write error). */
26
+ failedTransactionIds: string[];
7
27
  };
8
28
  export type DownloadSingleFileParams = {
9
29
  transactionId: string;
@@ -11,6 +31,10 @@ export type DownloadSingleFileParams = {
11
31
  /** Ordered read gateways (scheme + host + path) tried before `arweaveHost`; see `getArweaveReadBaseUrls`. */
12
32
  arweaveBaseUrls?: string[];
13
33
  excludedTransactions: Set<string>;
34
+ /** Content-SHA-256 tag value to verify the download against; see {@link DownloadAllFilesParams}. */
35
+ expectedContentHash?: string;
36
+ /** Where this transaction's composite children go, by child name; see {@link DownloadAllFilesParams}. */
37
+ compositeChildPaths?: Record<string, string>;
14
38
  };
15
39
  export type ResizeAllImagesParams = {
16
40
  width: number;
@@ -24,7 +48,7 @@ export type ResizeImageParams = {
24
48
  export interface IFileManager {
25
49
  initializeFileSystem(workingDir?: string): Promise<void>;
26
50
  getContentUrlFromPath(path: string): Promise<string | undefined>;
27
- downloadAllFiles(params: DownloadAllFilesParams): Promise<void>;
51
+ downloadAllFiles(params: DownloadAllFilesParams): Promise<DownloadAllFilesResult | void>;
28
52
  resizeImage(params: ResizeImageParams): Promise<void>;
29
53
  resizeAllImages(params: ResizeAllImagesParams): Promise<void>;
30
54
  pathExists(filePath: string): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"IFileManager.d.ts","sourceRoot":"","sources":["../../../../src/helpers/FileManager/IFileManager.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,6GAA6G;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E,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAAA;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC1D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACnD,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;IACrB,SAAS,IAAI,GAAG,CAAA;IAChB,aAAa,IAAI,GAAG,CAAA;IACpB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1C,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC9C"}
@@ -0,0 +1,33 @@
1
+ import type { TransactionTag } from '../types/arweave';
2
+ /**
3
+ * Tag every Seed upload carries with the hex digest of its data. Producers: the SDK's
4
+ * `getPublishUploadData` / `getPublishUploads` (and through them both the L1 transaction path and
5
+ * the bundler / DataItem path in `@seedprotocol/publish`). Consumer: the files download
6
+ * (`events/files/download.ts` and the download worker), which verifies downloaded bytes against it
7
+ * and copies a verified value into `metadata.content_hash`.
8
+ */
9
+ export declare const CONTENT_SHA256_TAG = "Content-SHA-256";
10
+ export declare const CONTENT_TYPE_TAG = "Content-Type";
11
+ /**
12
+ * Lowercase hex SHA-256 of `data`: the value of the {@link CONTENT_SHA256_TAG} tag.
13
+ *
14
+ * Uses @noble/hashes rather than WebCrypto so it also works outside secure contexts (WebCrypto's
15
+ * `crypto.subtle` is missing on plain-http origins); the digest is the same.
16
+ *
17
+ * In SDK 0.7.2 and earlier the L1 transaction path (`getPublishUploads`) wrote SHA3-256 under this tag name
18
+ * while the bundler path wrote SHA-256. Uploads from that path still carry SHA3-256 digests; use
19
+ * {@link contentSha256TagMatches} to check a tag value against bytes.
20
+ */
21
+ export declare const getContentSha256: (data: Uint8Array) => string;
22
+ /**
23
+ * True when `tagValue` (a {@link CONTENT_SHA256_TAG} value read from Arweave) is the digest of
24
+ * `data`. Accepts SHA-256 and, for uploads made by SDK 0.7.2 and earlier through the L1 transaction path,
25
+ * SHA3-256.
26
+ */
27
+ export declare const contentSha256TagMatches: (data: Uint8Array, tagValue: string) => boolean;
28
+ /**
29
+ * Tags for one upload, in the order every upload uses: content hash, content type, then any
30
+ * configured extra tags (e.g. App-Name from `arweaveUploadTags`).
31
+ */
32
+ export declare const buildArweaveContentTags: (contentHash: string | undefined, contentType: string | undefined, extra?: TransactionTag[]) => TransactionTag[];
33
+ //# sourceMappingURL=arweaveContentTags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arweaveContentTags.d.ts","sourceRoot":"","sources":["../../../src/helpers/arweaveContentTags.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,oBAAoB,CAAA;AACnD,eAAO,MAAM,gBAAgB,iBAAiB,CAAA;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,UAAU,KAAG,MAAkC,CAAA;AAEtF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,MAAM,UAAU,EAAE,UAAU,MAAM,KAAG,OAI5E,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,MAAM,GAAG,SAAS,EAC/B,aAAa,MAAM,GAAG,SAAS,EAC/B,QAAQ,cAAc,EAAE,KACvB,cAAc,EAMhB,CAAA"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Composite uploads: several ItemStorage files of one item in a single Arweave transaction.
3
+ *
4
+ * Producer: `getPublishUploads.ts` (`processUploadPropertyData`), for an item with a
5
+ * `storageTransactionId` property and ItemStorage properties (e.g. a Post's `html` and `json`).
6
+ * Consumer: the download worker (`browser/workers/filesDownload.ts`), which keeps its own copy of
7
+ * {@link decodeCompositeUpload} because it runs from a string; a test keeps the two in step.
8
+ *
9
+ * Format (unchanged for text children, so composites already on Arweave still read):
10
+ *
11
+ * ===FILE_SEPARATOR===<name>===FILE_SEPARATOR===<utf-8 text> (repeated per child)
12
+ *
13
+ * A child that is not valid UTF-8 text (or whose text contains the separator) is written as
14
+ * base64 under the name `<name>;base64`. Composites written before this suffix existed converted
15
+ * every child to text, which corrupted binary children; those bytes cannot be recovered.
16
+ */
17
+ export declare const COMPOSITE_SEPARATOR = "===FILE_SEPARATOR===";
18
+ export declare const COMPOSITE_BASE64_SUFFIX = ";base64";
19
+ export type CompositeChild = {
20
+ name: string;
21
+ bytes: Uint8Array;
22
+ };
23
+ export declare const encodeCompositeUpload: (children: CompositeChild[]) => Uint8Array;
24
+ /** True when `bytes` start with the composite separator (checked on bytes, before any text heuristics). */
25
+ export declare const isCompositeUpload: (bytes: Uint8Array) => boolean;
26
+ /** Children of a composite, or `undefined` when `bytes` are not a well-formed composite. */
27
+ export declare const decodeCompositeUpload: (bytes: Uint8Array) => CompositeChild[] | undefined;
28
+ //# sourceMappingURL=compositeUpload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compositeUpload.d.ts","sourceRoot":"","sources":["../../../src/helpers/compositeUpload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,yBAAyB,CAAA;AACzD,eAAO,MAAM,uBAAuB,YAAY,CAAA;AAEhD,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAA;AAkChE,eAAO,MAAM,qBAAqB,GAAI,UAAU,cAAc,EAAE,KAAG,UAUlE,CAAA;AAID,2GAA2G;AAC3G,eAAO,MAAM,iBAAiB,GAAI,OAAO,UAAU,KAAG,OACqC,CAAA;AAE3F,4FAA4F;AAC5F,eAAO,MAAM,qBAAqB,GAAI,OAAO,UAAU,KAAG,cAAc,EAAE,GAAG,SAkB5E,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { type MetadataType } from '../seedSchema';
2
+ export type ItemStorageFileTarget = {
3
+ /** The item's seedUid, else its seedLocalId: the file is `<seedId><extension>`. */
4
+ seedId: string;
5
+ /** The property's `storage.path` (e.g. `/html`); `files` when unset. */
6
+ localStorageDir?: string | null;
7
+ /** The property's `storage.extension` (e.g. `.html`). */
8
+ filenameSuffix?: string | null;
9
+ /** An existing file name to write to instead (the row's refResolvedValue). */
10
+ fileName?: string | null;
11
+ };
12
+ /** Absolute path of the file {@link writeItemStorageFile} writes for `target`. */
13
+ export declare const getItemStorageFilePath: (target: ItemStorageFileTarget) => string;
14
+ /**
15
+ * Write an ItemStorage property's content to its local file, where saveItemStorage, reads, publish
16
+ * (resolveItemStorageChildFile) and download all look for it. Returns what the metadata row records:
17
+ * `refResolvedValue` (the file name) and `localStorageDir` (with a leading slash).
18
+ *
19
+ * Callers that also update the file's metadata row hold {@link withItemStorageFileLock} around
20
+ * both, so another writer of the same file can't land in between.
21
+ */
22
+ export declare const writeItemStorageFile: (target: ItemStorageFileTarget, content: string | Blob | ArrayBuffer) => Promise<{
23
+ fileName: string;
24
+ filePath: string;
25
+ localStorageDir: string;
26
+ }>;
27
+ /**
28
+ * Lock name for one ItemStorage file: `seed:item-storage:<absolute file path>`. The path starts
29
+ * with the files root, which also names the database (`<filesDir>/db/seed.db`), so the name is
30
+ * per database as well as per file.
31
+ */
32
+ export declare const itemStorageFileLockName: (filePath: string) => string;
33
+ /**
34
+ * Runs `fn` holding the lock of one ItemStorage file, across tabs (Web Locks) and within this JS
35
+ * realm (an in-process queue where Web Locks are missing, e.g. Node < 24.5; see `withTabLock`).
36
+ *
37
+ * Writers of a local draft's file (saveItemStorage, convertVerbatimItemStorageRow, createNewItem)
38
+ * hold it across "read the row → write the file → update the row", so the file and the row end
39
+ * with the same writer's content. See docs/MULTI_TAB.md.
40
+ *
41
+ * Lock ordering: this lock is always the innermost. It may be taken while holding a broader lock
42
+ * (`seed:item-storage-migration:<db>`, `seed:publish:<seedLocalId>`), never the other way round,
43
+ * and no other lock (nor a second file lock) is requested while it is held. Keep the section to
44
+ * local DB and file I/O: no network. Not re-entrant.
45
+ */
46
+ export declare function withItemStorageFileLock<T>(filePath: string, fn: () => Promise<T>): Promise<T>;
47
+ /**
48
+ * Runs `fn` with a fresh read of metadata row `localId`, holding the lock of the file that row's
49
+ * content goes to. `fileOf` names that file (absolute path) for a row, or returns undefined when
50
+ * there is nothing to write (then `fn` isn't called and the result is undefined).
51
+ *
52
+ * The file depends on the row, so the row is read once to pick the lock and again once it is held;
53
+ * if the row now points at another file (another writer changed it meanwhile), the lock is
54
+ * released and taken again for that file.
55
+ */
56
+ export declare function withLockedItemStorageRow<T>(localId: string, fileOf: (row: MetadataType) => string | undefined, fn: (row: MetadataType, filePath: string) => Promise<T>): Promise<T | undefined>;
57
+ //# sourceMappingURL=itemStorageFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemStorageFile.d.ts","sourceRoot":"","sources":["../../../src/helpers/itemStorageFile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAK1D,MAAM,MAAM,qBAAqB,GAAG;IAClC,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAA;IACd,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,qBAAqB,KAAG,MAIpE,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,qBAAqB,EAC7B,SAAS,MAAM,GAAG,IAAI,GAAG,WAAW,KACnC,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAOzE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,KAAG,MAAyC,CAAA;AAEpG;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE7F;AAcD;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,GAAG,SAAS,EACjD,EAAE,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACtD,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAgBxB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `Promise.all(items.map(fn))` with at most `limit` calls in flight. Results keep the input order.
3
+ * Rejects with the first error (by time); after that no new calls start, though calls already in
4
+ * flight run to completion.
5
+ */
6
+ export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
7
+ //# sourceMappingURL=mapWithConcurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapWithConcurrency.d.ts","sourceRoot":"","sources":["../../../src/helpers/mapWithConcurrency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAC3C,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACzC,OAAO,CAAC,CAAC,EAAE,CAAC,CAoBd"}
@@ -0,0 +1,43 @@
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
+ export declare const EXTENSION_TO_MIME: Readonly<Record<string, string>>;
12
+ /**
13
+ * MIME type to the extension a downloaded file gets. One canonical extension per type (the
14
+ * first one listed here wins over {@link EXTENSION_TO_MIME}'s aliases), plus a few common
15
+ * non-canonical spellings a gateway may send.
16
+ */
17
+ export declare const MIME_TO_EXTENSION: Readonly<Record<string, string>>;
18
+ /**
19
+ * Content types that say nothing about the content. A Blob carrying one of these is treated as
20
+ * untyped.
21
+ */
22
+ export declare const GENERIC_MIME_TYPES: readonly string[];
23
+ /** Lowercase `type/subtype` without parameters; `undefined` when empty or generic. */
24
+ export declare const normalizeMimeType: (mimeType: string | null | undefined) => string | undefined;
25
+ /** MIME type for a path or file name by its extension, if it has a known one. */
26
+ export declare const getMimeTypeFromPath: (filePathOrName: string) => string | undefined;
27
+ /** Extension (no dot) for a MIME type, if it has a well-known one. */
28
+ export declare const getExtensionForMimeType: (mimeType: string | null | undefined) => string | undefined;
29
+ /**
30
+ * MIME type from the leading bytes, for formats with an unambiguous signature. Used when a local
31
+ * file has no (known) extension, e.g. a file seed named after its id.
32
+ */
33
+ export declare const sniffMimeType: (bytes: Uint8Array) => string | undefined;
34
+ /**
35
+ * Best MIME type for upload bytes: the source's own type (a Blob/File `type`) when it is specific,
36
+ * then the file name's extension, then the bytes' signature.
37
+ */
38
+ export declare const resolveUploadMimeType: (params: {
39
+ sourceType?: string | null;
40
+ fileName?: string | null;
41
+ bytes?: Uint8Array;
42
+ }) => string | undefined;
43
+ //# sourceMappingURL=mimeTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeTypes.d.ts","sourceRoot":"","sources":["../../../src/helpers/mimeTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwE9D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiC3D,CAAA;AAEJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAI/C,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MAAM,GAAG,SAIhF,CAAA;AAED,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,MAAM,KAAG,MAAM,GAAG,SAKrE,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MAAM,GAAG,SAGtF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,UAAU,KAAG,MAAM,GAAG,SA4B1D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ;IAC5C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,KAAG,MAAM,GAAG,SAG6C,CAAA"}
@@ -25,12 +25,28 @@ export declare function publisherIsInOwnedSet(publisher: string | null | undefin
25
25
  */
26
26
  export declare function isSeedRowOwned(row: SeedOwnershipRow, ownedAddresses: readonly string[]): boolean;
27
27
  /**
28
- * SQL for `addressFilter: 'owned' | 'watched'`. Empty list → no rows (`1=0`).
29
- * Compares `lower(publisher)` so checksummed rows match persisted lowercase owned.
28
+ * SQL for an address list on `publisher`. Empty list → no rows (`1=0`).
29
+ * Compares `lower(publisher)` so checksummed rows match persisted lowercase addresses.
30
+ * Used for `addressFilter: 'watched'`; `'owned'` uses {@link ownedSeedsSql}.
30
31
  */
31
32
  export declare function publisherInAddressListSql(column: typeof seeds.publisher, addresses: readonly string[]): SQL;
32
- /** Owned-list SQL on `seeds.publisher`. */
33
+ /**
34
+ * @deprecated Matches `seeds.publisher` only. Use {@link ownedSeedsSql}, which agrees
35
+ * with {@link isSeedRowOwned} (empty owned → local unsealed drafts; attester fallback).
36
+ */
33
37
  export declare function ownedPublisherSql(ownedAddresses: readonly string[]): SQL;
38
+ /** SQL form of {@link isPlaceholderUid}: null, `''`, `'NULL'`, or zero bytes32 (trimmed, any case). */
39
+ export declare function placeholderUidSql(column: typeof seeds.uid): SQL;
40
+ /** SQL form of {@link isLocalUnsealedDraft} on `seeds`. */
41
+ export declare function localUnsealedDraftSql(): SQL;
42
+ /**
43
+ * SQL for `addressFilter: 'owned'`: a row passes exactly when {@link isSeedRowOwned} is true.
44
+ * - Empty owned → local unsealed drafts (pre-connect authoring), not every row.
45
+ * - Owned set → `lower(trim(publisher))` in the set, or, when publisher is blank, the
46
+ * `attestationRaw.attester` ({@link resolvePublisherFromSeedRow}). `json_valid` guards
47
+ * `json_extract`, which throws on malformed JSON.
48
+ */
49
+ export declare function ownedSeedsSql(ownedAddresses: readonly string[]): SQL;
34
50
  /**
35
51
  * Checks if the current user owns the item (publisher is in persisted owned addresses).
36
52
  *
@@ -1 +1 @@
1
- {"version":3,"file":"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AAK,CAAC,SAAS,EAC9B,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,GAAG,CAML;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAExE;AAED,uGAAuG;AACvG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG,GAAG,CAO/D;AAKD,2DAA2D;AAC3D,wBAAgB,qBAAqB,IAAI,GAAG,CAM3C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAUpE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAK/E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhF"}
@@ -0,0 +1,16 @@
1
+ /** Subdirectory of the files root that holds a storage seed's file, by its data type. */
2
+ export declare const getStorageSubdirForDataType: (dataType: string | null | undefined) => "images" | "files" | "html" | "json";
3
+ /** Absolute directory for a storage seed's file (`images/`, `files/`, `html/` or `json/` under the files root). */
4
+ export declare const getStorageDirForDataType: (dataType: string | null | undefined) => string;
5
+ /**
6
+ * Subdirectory (relative to the files root, no leading slash) for an ItemStorage property's file:
7
+ * its model's `storage.path` (`localStorageDir`), else `files`.
8
+ */
9
+ export declare const getItemStorageSubdir: (localStorageDir: string | null | undefined) => string;
10
+ /**
11
+ * File name a local save gives an ItemStorage property: `<seedUid or seedLocalId><extension>`
12
+ * (see saveItemStorage). Downloaded content is named after its transaction instead
13
+ * (`<txId><extension>`, see syncDbWithEas), which is what the metadata row's refResolvedValue says.
14
+ */
15
+ export declare const getItemStorageLocalFileName: (seedId: string, filenameSuffix: string | null | undefined) => string;
16
+ //# sourceMappingURL=storageDir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storageDir.d.ts","sourceRoot":"","sources":["../../../src/helpers/storageDir.ts"],"names":[],"mappings":"AAGA,yFAAyF;AACzF,eAAO,MAAM,2BAA2B,GACtC,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,KAClC,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAahC,CAAA;AAED,mHAAmH;AACnH,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MACV,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,iBAAiB,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MACN,CAAA;AAE5E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GACtC,QAAQ,MAAM,EACd,gBAAgB,MAAM,GAAG,IAAI,GAAG,SAAS,KACxC,MAA4C,CAAA"}
@@ -20,11 +20,13 @@ export type TabMessage = {
20
20
  name: string;
21
21
  payload?: unknown;
22
22
  }
23
- /** OPFS paths another tab (or its workers) wrote. */
23
+ /** OPFS paths another tab (or its workers) wrote or removed, coalesced (helpers/tabEvents.ts). */
24
24
  | {
25
25
  type: 'files-changed';
26
26
  paths: string[];
27
27
  };
28
+ /** Identifies this tab (this page's SDK instance) in the messages it sends. */
29
+ export declare const TAB_ID: string;
28
30
  /** Starts once per page; later calls (re-init) keep the first database. */
29
31
  export declare function startTabCoordination({ filesDir, mode }: {
30
32
  filesDir: string;
@@ -35,6 +37,8 @@ export declare function isLeaderTab(): boolean;
35
37
  export declare function whenLeaderTab(): Promise<void>;
36
38
  /** Sends to the other tabs of this database; a no-op when not coordinating. */
37
39
  export declare function postTabMessage(message: TabMessage): void;
40
+ /** Whether postTabMessage reaches other tabs (a browser tab coordinating with Web Locks). */
41
+ export declare function isPostingTabMessages(): boolean;
38
42
  export declare function onTabMessage(handler: (message: TabMessage) => void): () => void;
39
43
  /** `withTabLock` named for this database (`seed:<scope>:<db>`); runs `fn` directly before init. */
40
44
  export declare function withDbTabLock<T>(scope: string, fn: () => Promise<T>, options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"tabCoordinator.d.ts","sourceRoot":"","sources":["../../../src/helpers/tabCoordinator.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,KAAK,CAAA;AAE/C,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,yBAAyB,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE;AAC1D,4EAA4E;GAC1E;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;AACpD,qDAAqD;GACnD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAc9C,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,IAAmB,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,CA4BvH;AAWD,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,iEAAiE;AACjE,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAG7C;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAExD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAG/E;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE;IA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nG,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAElH;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,IAAI,IAAI,CAMnD"}
@@ -13,8 +13,8 @@ export type CrossTabEventName = typeof EAS_SEED_DATA_SYNCED_TO_DB_EVENT | typeof
13
13
  /** Emits on this tab's event bus and in every other tab of this database. */
14
14
  export declare function emitAcrossTabs(name: CrossTabEventName, payload?: unknown): void;
15
15
  /**
16
- * A file saved through this tab's file system: emits `file-saved` here (as before) and tells other
17
- * tabs, whose caches don't see it.
16
+ * A file saved through this tab's file system: emits `file-saved` here. Other tabs hear about it
17
+ * from the file system itself (see queueFilesChangedNotice), once the write has reached OPFS.
18
18
  */
19
19
  export declare function notifyFileSaved(filePath: string): void;
20
20
  /**
@@ -22,6 +22,27 @@ export declare function notifyFileSaved(filePath: string): void;
22
22
  * FILES_CHANGED_EVENT, and tells other tabs to do the same.
23
23
  */
24
24
  export declare function notifyFilesWrittenOutsideCache(paths: string[]): Promise<void>;
25
+ /**
26
+ * How long changed paths gather before one `files-changed` message goes out. Counted from the
27
+ * first queued path, so a steady stream of writes still sends once per window, never later.
28
+ */
29
+ export declare const FILES_CHANGED_FLUSH_MS = 25;
30
+ /** Keeps a message for a huge batch (a bulk download) from being one giant structured clone. */
31
+ export declare const FILES_CHANGED_MAX_PATHS = 500;
32
+ /**
33
+ * Tells other tabs that these absolute ZenFS paths changed in OPFS, so they drop and re-read their
34
+ * cached copies (the sync API's in-memory copy in particular). The browser file system calls this
35
+ * for every file it writes, truncates or removes (`TolerantWebAccessFS.onOpfsChange`, wired in
36
+ * `BrowserFileManager.initializeFileSystem`), after the change reached OPFS. Paths are coalesced
37
+ * for FILES_CHANGED_FLUSH_MS, so bulk writes (migrations, schema processing, downloads) send a few
38
+ * messages rather than one per write.
39
+ *
40
+ * Defense in depth only: a tab that misses a message still sees the change on its next async
41
+ * stat() (see TolerantWebAccessFS.stat). A no-op unless this tab coordinates with others.
42
+ */
43
+ export declare function queueFilesChangedNotice(paths: Iterable<string>): void;
44
+ /** Sends the queued paths now (page hide, tests). */
45
+ export declare function flushFilesChangedNotices(): void;
25
46
  /** Applies other tabs' events and file changes in this tab. */
26
47
  export declare function listenForOtherTabsEvents(): void;
27
48
  //# sourceMappingURL=tabEvents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabEvents.d.ts","sourceRoot":"","sources":["../../../src/helpers/tabEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAA;AAMtE;;;;;GAKG;AAEH,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,EAAG,kBAA2B,CAAA;AAE9D,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GACzB,OAAO,gCAAgC,GACvC,OAAO,yBAAyB,GAChC,OAAO,0BAA0B,CAAA;AAErC,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAO/E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAGtD;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAKnF;AAyBD,+DAA+D;AAC/D,wBAAgB,wBAAwB,IAAI,IAAI,CAoB/C"}
1
+ {"version":3,"file":"tabEvents.d.ts","sourceRoot":"","sources":["../../../src/helpers/tabEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,M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