@adobe/data 0.2.5 → 0.2.6

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 (464) hide show
  1. package/dist/ecs/database/create-database.d.ts +3 -1
  2. package/dist/ecs/database/create-database.js +2 -2
  3. package/dist/ecs/database/create-database.js.map +1 -1
  4. package/dist/ecs/database/create-database.test.js +17 -17
  5. package/dist/ecs/database/create-database.test.js.map +1 -1
  6. package/dist/ecs/database/database-schema/create-database-from-schema.d.ts +12 -0
  7. package/dist/ecs/database/database-schema/create-database-from-schema.js +8 -0
  8. package/dist/ecs/database/database-schema/create-database-from-schema.js.map +1 -0
  9. package/dist/ecs/database/database-schema/create-database-schema-test.js +25 -0
  10. package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -0
  11. package/dist/ecs/database/database-schema/create-database-schema.d.ts +11 -5
  12. package/dist/ecs/database/database-schema/create-database-schema.js +2 -2
  13. package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
  14. package/dist/ecs/database/database-schema/database-schema.d.ts +7 -4
  15. package/dist/ecs/database/database-schema/index.d.ts +1 -2
  16. package/dist/ecs/database/database-schema/index.js +1 -1
  17. package/dist/ecs/database/database-schema/index.js.map +1 -1
  18. package/dist/ecs/database/database.d.ts +4 -3
  19. package/dist/ecs/database/observe-dependent-value.d.ts +1 -1
  20. package/dist/ecs/database/observe-dependent-value.js +1 -1
  21. package/dist/ecs/database/observe-dependent-value.js.map +1 -1
  22. package/dist/ecs/database/transactional-store/create-transactional-store.d.ts +3 -1
  23. package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
  24. package/dist/ecs/database/transactional-store/transactional-store.d.ts +5 -3
  25. package/dist/ecs/store/archetype-components.d.ts +1 -0
  26. package/dist/ecs/{core-ecs/core-ecs-types.js → store/archetype-components.js} +1 -1
  27. package/dist/ecs/store/archetype-components.js.map +1 -0
  28. package/dist/ecs/store/create-store.d.ts +4 -4
  29. package/dist/ecs/store/create-store.js +6 -1
  30. package/dist/ecs/store/create-store.js.map +1 -1
  31. package/dist/ecs/store/create-store.test.js +17 -7
  32. package/dist/ecs/store/create-store.test.js.map +1 -1
  33. package/dist/ecs/store/index.d.ts +1 -0
  34. package/dist/ecs/store/index.js +1 -0
  35. package/dist/ecs/store/index.js.map +1 -1
  36. package/dist/ecs/store/store.d.ts +14 -2
  37. package/dist/internal/typed-array/get-byte-size.d.ts +1 -1
  38. package/dist/schema/schema.d.ts +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +1 -1
  41. package/dist/README.md +0 -310
  42. package/dist/_/data.d.ts +0 -11
  43. package/dist/_/data.js +0 -23
  44. package/dist/_/data.js.map +0 -1
  45. package/dist/_/equals.d.ts +0 -11
  46. package/dist/_/equals.js +0 -73
  47. package/dist/_/equals.js.map +0 -1
  48. package/dist/_/equals.test.js +0 -150
  49. package/dist/_/equals.test.js.map +0 -1
  50. package/dist/_/index.d.ts +0 -4
  51. package/dist/_/index.js +0 -24
  52. package/dist/_/index.js.map +0 -1
  53. package/dist/_/is-data.d.ts +0 -11
  54. package/dist/_/is-data.js +0 -2
  55. package/dist/_/is-data.js.map +0 -1
  56. package/dist/_/normalize.d.ts +0 -1
  57. package/dist/_/normalize.js +0 -34
  58. package/dist/_/normalize.js.map +0 -1
  59. package/dist/_/normalize.test.d.ts +0 -1
  60. package/dist/_/normalize.test.js +0 -48
  61. package/dist/_/normalize.test.js.map +0 -1
  62. package/dist/_/schema.test.d.ts +0 -1
  63. package/dist/_/schema.test.js +0 -16
  64. package/dist/_/schema.test.js.map +0 -1
  65. package/dist/blob-store/blob-store.d.ts +0 -94
  66. package/dist/blob-store/blob-store.js +0 -194
  67. package/dist/blob-store/blob-store.js.map +0 -1
  68. package/dist/blob-store/blob-store.test.d.ts +0 -1
  69. package/dist/blob-store/blob-store.test.js +0 -142
  70. package/dist/blob-store/blob-store.test.js.map +0 -1
  71. package/dist/cache/functions/bind-functions.d.ts +0 -6
  72. package/dist/cache/functions/bind-functions.js +0 -33
  73. package/dist/cache/functions/bind-functions.js.map +0 -1
  74. package/dist/cache/functions/omit.d.ts +0 -1
  75. package/dist/cache/functions/omit.js +0 -29
  76. package/dist/cache/functions/omit.js.map +0 -1
  77. package/dist/cache/functions/types.d.ts +0 -1
  78. package/dist/cache/functions/types.js +0 -23
  79. package/dist/cache/functions/types.js.map +0 -1
  80. package/dist/core/IsData.d.ts +0 -6
  81. package/dist/core/IsData.js +0 -2
  82. package/dist/core/IsData.js.map +0 -1
  83. package/dist/core/data.d.ts +0 -11
  84. package/dist/core/data.js +0 -23
  85. package/dist/core/data.js.map +0 -1
  86. package/dist/core/data.test.d.ts +0 -1
  87. package/dist/core/data.test.js +0 -48
  88. package/dist/core/data.test.js.map +0 -1
  89. package/dist/core/equals.d.ts +0 -11
  90. package/dist/core/equals.js +0 -73
  91. package/dist/core/equals.js.map +0 -1
  92. package/dist/core/equals.test.d.ts +0 -1
  93. package/dist/core/equals.test.js +0 -150
  94. package/dist/core/equals.test.js.map +0 -1
  95. package/dist/core/functions/array-equals-shallow.d.ts +0 -1
  96. package/dist/core/functions/array-equals-shallow.js +0 -34
  97. package/dist/core/functions/array-equals-shallow.js.map +0 -1
  98. package/dist/core/functions/deep-assign.d.ts +0 -11
  99. package/dist/core/functions/deep-assign.js +0 -61
  100. package/dist/core/functions/deep-assign.js.map +0 -1
  101. package/dist/core/functions/deep-assign.test.d.ts +0 -1
  102. package/dist/core/functions/deep-assign.test.js +0 -180
  103. package/dist/core/functions/deep-assign.test.js.map +0 -1
  104. package/dist/core/functions/deep-merge.d.ts +0 -32
  105. package/dist/core/functions/deep-merge.js +0 -54
  106. package/dist/core/functions/deep-merge.js.map +0 -1
  107. package/dist/core/functions/deep-merge.test.d.ts +0 -1
  108. package/dist/core/functions/deep-merge.test.js +0 -94
  109. package/dist/core/functions/deep-merge.test.js.map +0 -1
  110. package/dist/core/functions/index.d.ts +0 -1
  111. package/dist/core/functions/index.js +0 -23
  112. package/dist/core/functions/index.js.map +0 -1
  113. package/dist/core/functions/is-async-generator.d.ts +0 -1
  114. package/dist/core/functions/is-async-generator.js +0 -25
  115. package/dist/core/functions/is-async-generator.js.map +0 -1
  116. package/dist/core/functions/is-promise.d.ts +0 -1
  117. package/dist/core/functions/is-promise.js +0 -26
  118. package/dist/core/functions/is-promise.js.map +0 -1
  119. package/dist/core/functions/memoize-factory.d.ts +0 -1
  120. package/dist/core/functions/memoize-factory.js +0 -12
  121. package/dist/core/functions/memoize-factory.js.map +0 -1
  122. package/dist/core/index.d.ts +0 -4
  123. package/dist/core/index.js +0 -24
  124. package/dist/core/index.js.map +0 -1
  125. package/dist/core/is-data.d.ts +0 -11
  126. package/dist/core/is-data.js +0 -2
  127. package/dist/core/is-data.js.map +0 -1
  128. package/dist/core/normalize.d.ts +0 -1
  129. package/dist/core/normalize.js +0 -34
  130. package/dist/core/normalize.js.map +0 -1
  131. package/dist/core/normalize.test.d.ts +0 -1
  132. package/dist/core/normalize.test.js +0 -48
  133. package/dist/core/normalize.test.js.map +0 -1
  134. package/dist/core/schema.test.d.ts +0 -1
  135. package/dist/core/schema.test.js +0 -16
  136. package/dist/core/schema.test.js.map +0 -1
  137. package/dist/ecs/action-ecs/action-ecs.d.ts +0 -19
  138. package/dist/ecs/action-ecs/action-ecs.js +0 -203
  139. package/dist/ecs/action-ecs/action-ecs.js.map +0 -1
  140. package/dist/ecs/action-ecs/action-ecs.test.d.ts +0 -1
  141. package/dist/ecs/action-ecs/action-ecs.test.js +0 -363
  142. package/dist/ecs/action-ecs/action-ecs.test.js.map +0 -1
  143. package/dist/ecs/action-ecs/action-types.d.ts +0 -106
  144. package/dist/ecs/action-ecs/action-types.js +0 -19
  145. package/dist/ecs/action-ecs/action-types.js.map +0 -1
  146. package/dist/ecs/action-ecs/index.d.ts +0 -3
  147. package/dist/ecs/action-ecs/index.js +0 -24
  148. package/dist/ecs/action-ecs/index.js.map +0 -1
  149. package/dist/ecs/action-ecs/sequential-action.d.ts +0 -18
  150. package/dist/ecs/action-ecs/sequential-action.js +0 -45
  151. package/dist/ecs/action-ecs/sequential-action.js.map +0 -1
  152. package/dist/ecs/core-ecs/core-ecs-serialization.test.d.ts +0 -1
  153. package/dist/ecs/core-ecs/core-ecs-serialization.test.js +0 -231
  154. package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +0 -1
  155. package/dist/ecs/core-ecs/core-ecs-types.d.ts +0 -142
  156. package/dist/ecs/core-ecs/core-ecs-types.js.map +0 -1
  157. package/dist/ecs/core-ecs/core-ecs.d.ts +0 -7
  158. package/dist/ecs/core-ecs/core-ecs.js +0 -492
  159. package/dist/ecs/core-ecs/core-ecs.js.map +0 -1
  160. package/dist/ecs/core-ecs/core-ecs.test.d.ts +0 -1
  161. package/dist/ecs/core-ecs/core-ecs.test.js +0 -426
  162. package/dist/ecs/core-ecs/core-ecs.test.js.map +0 -1
  163. package/dist/ecs/core-ecs/index.d.ts +0 -1
  164. package/dist/ecs/core-ecs/index.js +0 -2
  165. package/dist/ecs/core-ecs/index.js.map +0 -1
  166. package/dist/ecs/database/database-schema/create-database-from-schemas.d.ts +0 -15
  167. package/dist/ecs/database/database-schema/create-database-from-schemas.js +0 -33
  168. package/dist/ecs/database/database-schema/create-database-from-schemas.js.map +0 -1
  169. package/dist/ecs/ecs/ecs-types.d.ts +0 -133
  170. package/dist/ecs/ecs/ecs-types.js +0 -23
  171. package/dist/ecs/ecs/ecs-types.js.map +0 -1
  172. package/dist/ecs/ecs/ecs-where-functions.d.ts +0 -6
  173. package/dist/ecs/ecs/ecs-where-functions.js +0 -91
  174. package/dist/ecs/ecs/ecs-where-functions.js.map +0 -1
  175. package/dist/ecs/ecs/ecs.d.ts +0 -13
  176. package/dist/ecs/ecs/ecs.js +0 -177
  177. package/dist/ecs/ecs/ecs.js.map +0 -1
  178. package/dist/ecs/ecs/ecs.test.d.ts +0 -1
  179. package/dist/ecs/ecs/ecs.test.js +0 -399
  180. package/dist/ecs/ecs/ecs.test.js.map +0 -1
  181. package/dist/ecs/ecs/index.d.ts +0 -2
  182. package/dist/ecs/ecs/index.js +0 -24
  183. package/dist/ecs/ecs/index.js.map +0 -1
  184. package/dist/ecs/store/resource-components copy.d.ts +0 -1
  185. package/dist/ecs/store/resource-components copy.js +0 -23
  186. package/dist/ecs/store/resource-components copy.js.map +0 -1
  187. package/dist/ecs/systems/index.d.ts +0 -2
  188. package/dist/ecs/systems/index.js +0 -2
  189. package/dist/ecs/systems/index.js.map +0 -1
  190. package/dist/ecs/systems/system-phase.d.ts +0 -5
  191. package/dist/ecs/systems/system-phase.js +0 -16
  192. package/dist/ecs/systems/system-phase.js.map +0 -1
  193. package/dist/ecs/systems/system.d.ts +0 -7
  194. package/dist/ecs/systems/system.js +0 -2
  195. package/dist/ecs/systems/system.js.map +0 -1
  196. package/dist/ecs/transaction-ecs/index.d.ts +0 -2
  197. package/dist/ecs/transaction-ecs/index.js +0 -24
  198. package/dist/ecs/transaction-ecs/index.js.map +0 -1
  199. package/dist/ecs/transaction-ecs/transaction-ecs.d.ts +0 -11
  200. package/dist/ecs/transaction-ecs/transaction-ecs.js +0 -184
  201. package/dist/ecs/transaction-ecs/transaction-ecs.js.map +0 -1
  202. package/dist/ecs/transaction-ecs/transaction-ecs.test.d.ts +0 -1
  203. package/dist/ecs/transaction-ecs/transaction-ecs.test.js +0 -599
  204. package/dist/ecs/transaction-ecs/transaction-ecs.test.js.map +0 -1
  205. package/dist/ecs/transaction-ecs/transaction-types.d.ts +0 -136
  206. package/dist/ecs/transaction-ecs/transaction-types.js +0 -2
  207. package/dist/ecs/transaction-ecs/transaction-types.js.map +0 -1
  208. package/dist/ecs/transaction-ecs/transactions.d.ts +0 -5
  209. package/dist/ecs/transaction-ecs/transactions.js +0 -158
  210. package/dist/ecs/transaction-ecs/transactions.js.map +0 -1
  211. package/dist/equalsShallow.d.ts +0 -1
  212. package/dist/equalsShallow.js +0 -37
  213. package/dist/equalsShallow.js.map +0 -1
  214. package/dist/equalsShallow.test.d.ts +0 -1
  215. package/dist/equalsShallow.test.js +0 -113
  216. package/dist/equalsShallow.test.js.map +0 -1
  217. package/dist/internal/object/mutable-clone.d.ts +0 -5
  218. package/dist/internal/object/mutable-clone.js +0 -4
  219. package/dist/internal/object/mutable-clone.js.map +0 -1
  220. package/dist/old-ecs/ecs/ecs-where-cache.test.d.ts +0 -1
  221. package/dist/old-ecs/ecs/ecs-where-cache.test.js +0 -164
  222. package/dist/old-ecs/ecs/ecs-where-cache.test.js.map +0 -1
  223. package/dist/package.json +0 -129
  224. package/dist/schema/FromSchema.d.ts +0 -25
  225. package/dist/schema/FromSchema.js +0 -2
  226. package/dist/schema/FromSchema.js.map +0 -1
  227. package/dist/service/isService.d.ts +0 -2
  228. package/dist/service/isService.js +0 -5
  229. package/dist/service/isService.js.map +0 -1
  230. package/dist/service/sequential-action.d.ts +0 -18
  231. package/dist/service/sequential-action.js +0 -45
  232. package/dist/service/sequential-action.js.map +0 -1
  233. package/dist/table/copy-to-gpu-buffer.d.ts +0 -2
  234. package/dist/table/copy-to-gpu-buffer.js +0 -16
  235. package/dist/table/copy-to-gpu-buffer.js.map +0 -1
  236. package/dist/table/create-composite-table.d.ts +0 -5
  237. package/dist/table/create-composite-table.js +0 -20
  238. package/dist/table/create-composite-table.js.map +0 -1
  239. package/dist/typed-buffer/create-composite-buffer.d.ts +0 -2
  240. package/dist/typed-buffer/create-composite-buffer.js +0 -85
  241. package/dist/typed-buffer/create-composite-buffer.js.map +0 -1
  242. package/dist/typed-buffer/create-composite-buffer.test.d.ts +0 -1
  243. package/dist/typed-buffer/create-composite-buffer.test.js +0 -291
  244. package/dist/typed-buffer/create-composite-buffer.test.js.map +0 -1
  245. package/dist/typed-buffer/create-mapped-buffer.d.ts +0 -6
  246. package/dist/typed-buffer/create-mapped-buffer.js +0 -32
  247. package/dist/typed-buffer/create-mapped-buffer.js.map +0 -1
  248. package/dist/typed-buffer/create-mapped-buffer.test.d.ts +0 -1
  249. package/dist/typed-buffer/create-mapped-buffer.test.js +0 -202
  250. package/dist/typed-buffer/create-mapped-buffer.test.js.map +0 -1
  251. package/dist/types/array/equalsShallow.d.ts +0 -1
  252. package/dist/types/array/equalsShallow.js +0 -37
  253. package/dist/types/array/equalsShallow.js.map +0 -1
  254. package/dist/types/array/equalsShallow.test.d.ts +0 -1
  255. package/dist/types/array/equalsShallow.test.js +0 -113
  256. package/dist/types/array/equalsShallow.test.js.map +0 -1
  257. package/dist/types/array/index.d.ts +0 -1
  258. package/dist/types/array/index.js +0 -2
  259. package/dist/types/array/index.js.map +0 -1
  260. package/dist/types/array-buffer-like/copy.d.ts +0 -1
  261. package/dist/types/array-buffer-like/copy.js +0 -469
  262. package/dist/types/array-buffer-like/copy.js.map +0 -1
  263. package/dist/types/array-buffer-like/grow.d.ts +0 -1
  264. package/dist/types/array-buffer-like/grow.js +0 -53
  265. package/dist/types/array-buffer-like/grow.js.map +0 -1
  266. package/dist/types/array-buffer-like/index.d.ts +0 -4
  267. package/dist/types/array-buffer-like/index.js +0 -26
  268. package/dist/types/array-buffer-like/index.js.map +0 -1
  269. package/dist/types/array-buffer-like/is-array-buffer.d.ts +0 -1
  270. package/dist/types/array-buffer-like/is-array-buffer.js +0 -445
  271. package/dist/types/array-buffer-like/is-array-buffer.js.map +0 -1
  272. package/dist/types/array-buffer-like/is-shared-array-buffer.d.ts +0 -1
  273. package/dist/types/array-buffer-like/is-shared-array-buffer.js +0 -445
  274. package/dist/types/array-buffer-like/is-shared-array-buffer.js.map +0 -1
  275. package/dist/types/data-view-32/create-data-view-32.d.ts +0 -2
  276. package/dist/types/data-view-32/create-data-view-32.js +0 -8
  277. package/dist/types/data-view-32/create-data-view-32.js.map +0 -1
  278. package/dist/types/data-view-32/data-view-32.d.ts +0 -5
  279. package/dist/types/data-view-32/data-view-32.js +0 -23
  280. package/dist/types/data-view-32/data-view-32.js.map +0 -1
  281. package/dist/types/data-view-32/index.d.ts +0 -2
  282. package/dist/types/data-view-32/index.js +0 -24
  283. package/dist/types/data-view-32/index.js.map +0 -1
  284. package/dist/types/object/index.d.ts +0 -2
  285. package/dist/types/object/index.js +0 -24
  286. package/dist/types/object/index.js.map +0 -1
  287. package/dist/types/object/map-entries.d.ts +0 -5
  288. package/dist/types/object/map-entries.js +0 -29
  289. package/dist/types/object/map-entries.js.map +0 -1
  290. package/dist/types/object/mutable-clone.d.ts +0 -5
  291. package/dist/types/object/mutable-clone.js +0 -4
  292. package/dist/types/object/mutable-clone.js.map +0 -1
  293. package/dist/types/remove-readonly.d.ts +0 -3
  294. package/dist/types/remove-readonly.js +0 -2
  295. package/dist/types/remove-readonly.js.map +0 -1
  296. package/dist/types/table/add-row.d.ts +0 -8
  297. package/dist/types/table/add-row.js +0 -40
  298. package/dist/types/table/add-row.js.map +0 -1
  299. package/dist/types/table/create-table.d.ts +0 -3
  300. package/dist/types/table/create-table.js +0 -33
  301. package/dist/types/table/create-table.js.map +0 -1
  302. package/dist/types/table/delete-row.d.ts +0 -9
  303. package/dist/types/table/delete-row.js +0 -18
  304. package/dist/types/table/delete-row.js.map +0 -1
  305. package/dist/types/table/ensure-capacity.d.ts +0 -2
  306. package/dist/types/table/ensure-capacity.js +0 -15
  307. package/dist/types/table/ensure-capacity.js.map +0 -1
  308. package/dist/types/table/get-row-data.d.ts +0 -3
  309. package/dist/types/table/get-row-data.js +0 -8
  310. package/dist/types/table/get-row-data.js.map +0 -1
  311. package/dist/types/table/index.d.ts +0 -8
  312. package/dist/types/table/index.js +0 -30
  313. package/dist/types/table/index.js.map +0 -1
  314. package/dist/types/table/row-index.d.ts +0 -8
  315. package/dist/types/table/row-index.js +0 -3
  316. package/dist/types/table/row-index.js.map +0 -1
  317. package/dist/types/table/table.d.ts +0 -13
  318. package/dist/types/table/table.js +0 -2
  319. package/dist/types/table/table.js.map +0 -1
  320. package/dist/types/table/update-row.d.ts +0 -8
  321. package/dist/types/table/update-row.js +0 -12
  322. package/dist/types/table/update-row.js.map +0 -1
  323. package/dist/types/typed-array/copy-to-gpu-buffer.d.ts +0 -2
  324. package/dist/types/typed-array/copy-to-gpu-buffer.js +0 -16
  325. package/dist/types/typed-array/copy-to-gpu-buffer.js.map +0 -1
  326. package/dist/types/typed-array/get-byte-size.d.ts +0 -2
  327. package/dist/types/typed-array/get-byte-size.js +0 -28
  328. package/dist/types/typed-array/get-byte-size.js.map +0 -1
  329. package/dist/types/typed-array/index.d.ts +0 -4
  330. package/dist/types/typed-array/index.js +0 -26
  331. package/dist/types/typed-array/index.js.map +0 -1
  332. package/dist/types/typed-array/typed-array-constructer.d.ts +0 -7
  333. package/dist/types/typed-array/typed-array-constructer.js +0 -2
  334. package/dist/types/typed-array/typed-array-constructer.js.map +0 -1
  335. package/dist/types/typed-array/typed-array.d.ts +0 -1
  336. package/dist/types/typed-array/typed-array.js +0 -23
  337. package/dist/types/typed-array/typed-array.js.map +0 -1
  338. package/dist/types/typed-buffer/copy-to-gpu-buffer.d.ts +0 -2
  339. package/dist/types/typed-buffer/copy-to-gpu-buffer.js +0 -16
  340. package/dist/types/typed-buffer/copy-to-gpu-buffer.js.map +0 -1
  341. package/dist/types/typed-buffer/create-array-buffer.d.ts +0 -4
  342. package/dist/types/typed-buffer/create-array-buffer.js +0 -29
  343. package/dist/types/typed-buffer/create-array-buffer.js.map +0 -1
  344. package/dist/types/typed-buffer/create-number-buffer.d.ts +0 -8
  345. package/dist/types/typed-buffer/create-number-buffer.js +0 -75
  346. package/dist/types/typed-buffer/create-number-buffer.js.map +0 -1
  347. package/dist/types/typed-buffer/create-struct-buffer.d.ts +0 -10
  348. package/dist/types/typed-buffer/create-struct-buffer.js +0 -78
  349. package/dist/types/typed-buffer/create-struct-buffer.js.map +0 -1
  350. package/dist/types/typed-buffer/create-typed-buffer.d.ts +0 -7
  351. package/dist/types/typed-buffer/create-typed-buffer.js +0 -17
  352. package/dist/types/typed-buffer/create-typed-buffer.js.map +0 -1
  353. package/dist/types/typed-buffer/index.d.ts +0 -6
  354. package/dist/types/typed-buffer/index.js +0 -28
  355. package/dist/types/typed-buffer/index.js.map +0 -1
  356. package/dist/types/typed-buffer/structs/assert-struct.d.ts +0 -8
  357. package/dist/types/typed-buffer/structs/assert-struct.js +0 -15
  358. package/dist/types/typed-buffer/structs/assert-struct.js.map +0 -1
  359. package/dist/types/typed-buffer/structs/create-read-struct.d.ts +0 -3
  360. package/dist/types/typed-buffer/structs/create-read-struct.js +0 -62
  361. package/dist/types/typed-buffer/structs/create-read-struct.js.map +0 -1
  362. package/dist/types/typed-buffer/structs/create-read-struct.test.d.ts +0 -1
  363. package/dist/types/typed-buffer/structs/create-read-struct.test.js +0 -189
  364. package/dist/types/typed-buffer/structs/create-read-struct.test.js.map +0 -1
  365. package/dist/types/typed-buffer/structs/create-write-struct.d.ts +0 -3
  366. package/dist/types/typed-buffer/structs/create-write-struct.js +0 -58
  367. package/dist/types/typed-buffer/structs/create-write-struct.js.map +0 -1
  368. package/dist/types/typed-buffer/structs/get-field-offset.d.ts +0 -2
  369. package/dist/types/typed-buffer/structs/get-field-offset.js +0 -14
  370. package/dist/types/typed-buffer/structs/get-field-offset.js.map +0 -1
  371. package/dist/types/typed-buffer/structs/get-struct-layout.d.ts +0 -5
  372. package/dist/types/typed-buffer/structs/get-struct-layout.js +0 -198
  373. package/dist/types/typed-buffer/structs/get-struct-layout.js.map +0 -1
  374. package/dist/types/typed-buffer/structs/get-struct-layout.test.d.ts +0 -1
  375. package/dist/types/typed-buffer/structs/get-struct-layout.test.js +0 -133
  376. package/dist/types/typed-buffer/structs/get-struct-layout.test.js.map +0 -1
  377. package/dist/types/typed-buffer/structs/index.d.ts +0 -1
  378. package/dist/types/typed-buffer/structs/index.js +0 -23
  379. package/dist/types/typed-buffer/structs/index.js.map +0 -1
  380. package/dist/types/typed-buffer/structs/read-struct.d.ts +0 -2
  381. package/dist/types/typed-buffer/structs/read-struct.js +0 -2
  382. package/dist/types/typed-buffer/structs/read-struct.js.map +0 -1
  383. package/dist/types/typed-buffer/structs/struct-layout.d.ts +0 -21
  384. package/dist/types/typed-buffer/structs/struct-layout.js +0 -23
  385. package/dist/types/typed-buffer/structs/struct-layout.js.map +0 -1
  386. package/dist/types/typed-buffer/structs/write-struct.d.ts +0 -2
  387. package/dist/types/typed-buffer/structs/write-struct.js +0 -2
  388. package/dist/types/typed-buffer/structs/write-struct.js.map +0 -1
  389. package/dist/types/typed-buffer/structs/write-struct.test.d.ts +0 -1
  390. package/dist/types/typed-buffer/structs/write-struct.test.js +0 -181
  391. package/dist/types/typed-buffer/structs/write-struct.test.js.map +0 -1
  392. package/dist/types/typed-buffer/typed-buffer.d.ts +0 -16
  393. package/dist/types/typed-buffer/typed-buffer.js +0 -2
  394. package/dist/types/typed-buffer/typed-buffer.js.map +0 -1
  395. package/dist/types/typed-buffer/typed-buffer.test.d.ts +0 -1
  396. package/dist/types/typed-buffer/typed-buffer.test.js +0 -223
  397. package/dist/types/typed-buffer/typed-buffer.test.js.map +0 -1
  398. package/dist/ui/decorators/apply-decorator.d.ts +0 -1
  399. package/dist/ui/decorators/apply-decorator.js +0 -18
  400. package/dist/ui/decorators/apply-decorator.js.map +0 -1
  401. package/dist/ui/decorators/apply-service-decorators.d.ts +0 -1
  402. package/dist/ui/decorators/apply-service-decorators.js +0 -12
  403. package/dist/ui/decorators/apply-service-decorators.js.map +0 -1
  404. package/dist/ui/decorators/require-service.d.ts +0 -1
  405. package/dist/ui/decorators/require-service.js +0 -13
  406. package/dist/ui/decorators/require-service.js.map +0 -1
  407. package/dist/ui/elements/index.d.ts +0 -3
  408. package/dist/ui/elements/index.js +0 -4
  409. package/dist/ui/elements/index.js.map +0 -1
  410. package/dist/ui/elements/service-application.d.ts +0 -8
  411. package/dist/ui/elements/service-application.js +0 -27
  412. package/dist/ui/elements/service-application.js.map +0 -1
  413. package/dist/ui/elements/service-context.d.ts +0 -1
  414. package/dist/ui/elements/service-context.js +0 -3
  415. package/dist/ui/elements/service-context.js.map +0 -1
  416. package/dist/ui/elements/service-element.d.ts +0 -6
  417. package/dist/ui/elements/service-element.js +0 -22
  418. package/dist/ui/elements/service-element.js.map +0 -1
  419. package/dist/ui/hooks/component/component.d.ts +0 -9
  420. package/dist/ui/hooks/component/component.js +0 -2
  421. package/dist/ui/hooks/component/component.js.map +0 -1
  422. package/dist/ui/hooks/component/stack.d.ts +0 -6
  423. package/dist/ui/hooks/component/stack.js +0 -15
  424. package/dist/ui/hooks/component/stack.js.map +0 -1
  425. package/dist/ui/hooks/index.d.ts +0 -7
  426. package/dist/ui/hooks/index.js +0 -9
  427. package/dist/ui/hooks/index.js.map +0 -1
  428. package/dist/ui/hooks/use-connected.d.ts +0 -2
  429. package/dist/ui/hooks/use-connected.js +0 -31
  430. package/dist/ui/hooks/use-connected.js.map +0 -1
  431. package/dist/ui/hooks/use-effect.d.ts +0 -3
  432. package/dist/ui/hooks/use-effect.js +0 -13
  433. package/dist/ui/hooks/use-effect.js.map +0 -1
  434. package/dist/ui/hooks/use-element.d.ts +0 -4
  435. package/dist/ui/hooks/use-element.js +0 -8
  436. package/dist/ui/hooks/use-element.js.map +0 -1
  437. package/dist/ui/hooks/use-memo.d.ts +0 -1
  438. package/dist/ui/hooks/use-memo.js +0 -12
  439. package/dist/ui/hooks/use-memo.js.map +0 -1
  440. package/dist/ui/hooks/use-observable-values.d.ts +0 -5
  441. package/dist/ui/hooks/use-observable-values.js +0 -8
  442. package/dist/ui/hooks/use-observable-values.js.map +0 -1
  443. package/dist/ui/hooks/use-observable.d.ts +0 -2
  444. package/dist/ui/hooks/use-observable.js +0 -12
  445. package/dist/ui/hooks/use-observable.js.map +0 -1
  446. package/dist/ui/hooks/use-ref.d.ts +0 -3
  447. package/dist/ui/hooks/use-ref.js +0 -6
  448. package/dist/ui/hooks/use-ref.js.map +0 -1
  449. package/dist/ui/hooks/use-resize-observer.d.ts +0 -10
  450. package/dist/ui/hooks/use-resize-observer.js +0 -20
  451. package/dist/ui/hooks/use-resize-observer.js.map +0 -1
  452. package/dist/ui/hooks/use-state.d.ts +0 -2
  453. package/dist/ui/hooks/use-state.js +0 -14
  454. package/dist/ui/hooks/use-state.js.map +0 -1
  455. package/dist/ui/hooks/use-window-event.d.ts +0 -1
  456. package/dist/ui/hooks/use-window-event.js +0 -10
  457. package/dist/ui/hooks/use-window-event.js.map +0 -1
  458. package/dist/ui/hooks/with-hooks.d.ts +0 -2
  459. package/dist/ui/hooks/with-hooks.js +0 -15
  460. package/dist/ui/hooks/with-hooks.js.map +0 -1
  461. package/dist/ui/index.d.ts +0 -1
  462. package/dist/ui/index.js +0 -2
  463. package/dist/ui/index.js.map +0 -1
  464. /package/dist/{_/equals.test.d.ts → ecs/database/database-schema/create-database-schema-test.d.ts} +0 -0
@@ -1,11 +0,0 @@
1
- type Primitive = string | number | boolean | null;
2
- /** invariant type-equality check (handles `readonly` correctly) */
3
- type EqualReadonly<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? (<T>() => T extends Y ? 1 : 2) extends (<T>() => T extends X ? 1 : 2) ? true : false : false;
4
- /** are *all* own props already `readonly`? */
5
- type IsFullyReadonly<T> = EqualReadonly<T, Readonly<T>>;
6
- export type IsData<T> = [
7
- T
8
- ] extends [Primitive] ? true : T extends ReadonlyArray<infer U> ? EqualReadonly<T, ReadonlyArray<U>> extends true ? IsData<U> : false : T extends object ? IsFullyReadonly<T> extends true ? {
9
- [K in keyof T]-?: IsData<T[K]>;
10
- }[keyof T] extends false ? false : true : false : false;
11
- export {};
package/dist/_/is-data.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=is-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-data.js","sourceRoot":"","sources":["../../src/_/is-data.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export declare function normalize<D>(d: D): D;
@@ -1,34 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- export function normalize(d) {
23
- // we could structured clone but let's explicitly shed any keys with undefined values.
24
- return JSON.parse(JSON.stringify(d), (_key, value) => {
25
- if (value && !Array.isArray(value) && typeof value === "object") {
26
- return Object.fromEntries(Object.entries(value).sort(([a], [b]) =>
27
- // not using String.localeCompare
28
- // we want this consistent no matter locale
29
- a < b ? -1 : a > b ? 1 : 0));
30
- }
31
- return value;
32
- });
33
- }
34
- //# sourceMappingURL=normalize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/_/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,MAAM,UAAU,SAAS,CAAI,CAAI;IAC/B,uFAAuF;IACvF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAY,EAAE,KAAc,EAAE,EAAE;QACpE,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAChE,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;YACtC,kCAAkC;YAClC,4CAA4C;YAC5C,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3B,CACF,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,48 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- import { normalize } from "../normalize.js";
23
- import { describe, expect, it } from "vitest";
24
- describe("Data.normalize", () => {
25
- it("should sort object keys alphabetically", () => {
26
- expect(normalize({ b: 1, a: 2, c: null })).toEqual({
27
- a: 2,
28
- b: 1,
29
- c: null,
30
- });
31
- expect(normalize([{ A: [], b: 1, a: 2 }])).toEqual([{ a: 2, A: [], b: 1 }]);
32
- expect(normalize([[{ b: 1, a: 2 }]])).toEqual([[{ a: 2, b: 1 }]]);
33
- expect(normalize({ z: [[{ b: 1, a: 2 }]], q: 10 })).toEqual({
34
- q: 10,
35
- z: [[{ a: 2, b: 1 }]],
36
- });
37
- });
38
- it("should remove undefined values", () => {
39
- expect(normalize({ b: 1, a: 2, value: undefined })).toEqual({
40
- a: 2,
41
- b: 1,
42
- });
43
- expect(normalize([{ b: 1, a: 2, value: undefined }])).toEqual([
44
- { a: 2, b: 1 },
45
- ]);
46
- });
47
- });
48
- //# sourceMappingURL=normalize.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize.test.js","sourceRoot":"","sources":["../../src/_/normalize.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACjD,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,IAAI;SACR,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC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-1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import { describe, it } from "vitest";
2
- describe("Schema", () => {
3
- it("should provide compile time and runtime type validation", () => {
4
- const mySchema = {
5
- type: "object",
6
- required: ["name", "aspect"],
7
- properties: {
8
- name: { type: "string" },
9
- age: { type: "integer", minimum: 0 },
10
- aspect: { enum: ["landscape", "portrait"] },
11
- },
12
- additionalProperties: false,
13
- };
14
- });
15
- });
16
- //# sourceMappingURL=schema.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.test.js","sourceRoot":"","sources":["../../src/_/schema.test.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEtC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,QAAQ,GAAG;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;YAC5B,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;gBACpC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE;aAC5C;YACD,oBAAoB,EAAE,KAAK;SACF,CAAC;IAiB9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,94 +0,0 @@
1
- import { type FromSchema } from "../schema/index.js";
2
- export declare const BlobRefSchema: {
3
- readonly oneOf: readonly [{
4
- readonly required: readonly ["remoteBlobRef"];
5
- readonly properties: {
6
- readonly remoteBlobRef: {
7
- readonly type: "string";
8
- readonly pattern: "http.*";
9
- };
10
- };
11
- readonly additionalProperties: false;
12
- }, {
13
- readonly required: readonly ["localBlobRef"];
14
- readonly properties: {
15
- readonly localBlobRef: {
16
- readonly type: "string";
17
- };
18
- };
19
- readonly additionalProperties: false;
20
- }];
21
- };
22
- /**
23
- * Represents a reference to a blob as a plain JSON object.
24
- * Do NOT create this type directly.
25
- * Use the BlobStore to create and manage blob references.
26
- */
27
- export type BlobRef = FromSchema<typeof BlobRefSchema>;
28
- export declare function isBlobRef(value: unknown): value is BlobRef;
29
- /**
30
- * Defined as a symbol because we only want it used by internal code like DataCache.
31
- */
32
- export declare const hasBlobInternalDoNotUse: unique symbol;
33
- /**
34
- * A blob store is a service that can efficiently store blobs across sessions and retrieve them using the browsers Cache api.
35
- */
36
- export interface BlobStore {
37
- /**
38
- * Stores a blob and returns a reference to it.
39
- * Blob references are based upon the content and type of the Blob.
40
- * If an equivalent blob is stored, an equivalent reference will be returned every time.
41
- */
42
- getRef(b: Blob | string): Promise<BlobRef>;
43
- /**
44
- * Gets a blob from the blob store or null if it is not available.
45
- */
46
- getBlob(r: BlobRef | null): Promise<Blob | null>;
47
- /**
48
- * Checks if the blob is still available.
49
- */
50
- hasBlob(r: BlobRef | null): Promise<boolean>;
51
- /**
52
- * Do NOT use this directly, use useBorrowUrl hook instead as it will automatically return the url when the component unmounts.
53
- */
54
- borrowUrl(r: BlobRef | null): Promise<string | null>;
55
- /**
56
- * Return a url that was previously borrowed from borrowUrl.
57
- * Failure to do so may result in memory leaking.
58
- * @param url The url provided by borrowUrl.
59
- */
60
- returnUrl(url: string | null): void;
61
- /**
62
- * Removes a blob from the store.
63
- */
64
- releaseBlob(r: BlobRef): Promise<void>;
65
- /**
66
- * Creates a new remote blob ref. The url must start with http.
67
- * This should only be called if the remote content is persistent and immutable.
68
- */
69
- createRemoteBlobRef(url: string): BlobRef;
70
- /**
71
- * TEST ONLY: Gets the current borrow count for a blob reference.
72
- * This should only be used in tests to verify reference counting behavior.
73
- * @param r The blob reference to check
74
- * @returns The number of times the blob reference has been borrowed, or 0 if not borrowed
75
- */
76
- _testGetBorrowCount(r: BlobRef): number;
77
- }
78
- /**
79
- * Creates a new blob store instance.
80
- */
81
- export declare function createBlobStore(): {
82
- readonly getRef: (blob: Blob | string) => Promise<BlobRef>;
83
- readonly getBlob: (r?: BlobRef | null) => Promise<Blob | null>;
84
- readonly hasBlob: (r: BlobRef) => Promise<boolean>;
85
- readonly borrowUrl: (r: BlobRef) => Promise<string | null>;
86
- readonly returnUrl: (url: string | null) => void;
87
- readonly releaseBlob: (r: BlobRef) => Promise<void>;
88
- readonly createRemoteBlobRef: (url: string) => BlobRef;
89
- readonly _testGetBorrowCount: (r: BlobRef) => number;
90
- };
91
- /**
92
- * The global blob store that can be used to store and retrieve blobs.
93
- */
94
- export declare const blobStore: BlobStore;
@@ -1,194 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- import { getManagedPersistentCache } from "../cache/get-persistent-cache.js";
23
- import { blobToHash } from "../cache/functions/hashing/blob-to-hash.js";
24
- import { preventParallelExecution } from "../cache/functions/prevent-parallel-execution.js";
25
- const remoteUrlPrefix = "http";
26
- const RemoteUrlSchema = {
27
- type: "string",
28
- pattern: `${remoteUrlPrefix}.*`,
29
- };
30
- const RemoteBlobRefSchema = {
31
- required: ["remoteBlobRef"],
32
- properties: {
33
- remoteBlobRef: RemoteUrlSchema,
34
- },
35
- additionalProperties: false,
36
- };
37
- const LocalBlobRefSchema = {
38
- required: ["localBlobRef"],
39
- properties: {
40
- localBlobRef: { type: "string" },
41
- },
42
- additionalProperties: false,
43
- };
44
- export const BlobRefSchema = {
45
- oneOf: [RemoteBlobRefSchema, LocalBlobRefSchema],
46
- };
47
- function isRemoteBlobRef(ref) {
48
- const maybe = ref;
49
- return typeof maybe?.remoteBlobRef === "string";
50
- }
51
- function isLocalBlobRef(ref) {
52
- const maybe = ref;
53
- return typeof maybe?.localBlobRef === "string";
54
- }
55
- export function isBlobRef(value) {
56
- return isRemoteBlobRef(value) || isLocalBlobRef(value);
57
- }
58
- function isRemoteUrl(url) {
59
- return url.startsWith(remoteUrlPrefix);
60
- }
61
- function toRequest(ref) {
62
- return new Request(`${window.location.origin}/${ref.localBlobRef}`);
63
- }
64
- /**
65
- * Defined as a symbol because we only want it used by internal code like DataCache.
66
- */
67
- export const hasBlobInternalDoNotUse = Symbol("hasBlob");
68
- /**
69
- * Creates a new blob store instance.
70
- */
71
- export function createBlobStore() {
72
- const cachePromise = getManagedPersistentCache("blobstore", {
73
- maximumMemoryEntries: 10,
74
- maximumStorageEntries: 1000,
75
- });
76
- // Track borrowed URLs and their reference counts
77
- const borrowedUrls = new Map();
78
- // Reverse mapping for O(1) lookup
79
- const urlToKey = new Map();
80
- async function getRef(blob) {
81
- const cache = await cachePromise;
82
- if (typeof blob === "string") {
83
- // if this is not a remote url, then we can assume it is a data url and fetch the blob from it.
84
- blob = await (await fetch(blob)).blob();
85
- }
86
- const ref = {
87
- localBlobRef: await blobToHash(blob),
88
- };
89
- const request = toRequest(ref);
90
- const response = new Response(blob);
91
- await cache.put(request, response);
92
- return ref;
93
- }
94
- async function hasBlob(r) {
95
- if (isRemoteBlobRef(r)) {
96
- return true;
97
- }
98
- const cache = await cachePromise;
99
- const response = await cache.match(toRequest(r));
100
- return response !== undefined;
101
- }
102
- async function getBlob(r) {
103
- if (!r) {
104
- return null;
105
- }
106
- const response = await (isRemoteBlobRef(r)
107
- ? fetch(r.remoteBlobRef)
108
- : (await cachePromise).match(toRequest(r)));
109
- if (!response) {
110
- return null;
111
- }
112
- if (!response.ok) {
113
- // this should only happen with remote urls. local blob responses are always ok.
114
- throw new Error(response.statusText);
115
- }
116
- return response.blob();
117
- }
118
- async function releaseBlob(r) {
119
- if (isLocalBlobRef(r)) {
120
- const cache = await cachePromise;
121
- cache.delete(toRequest(r));
122
- }
123
- }
124
- /**
125
- * prevent parallel execution to avoid race condition in borrowUrl while awaiting getBlob
126
- */
127
- const borrowUrlInternalNoIncrement = preventParallelExecution(async (key, r) => {
128
- if (isRemoteBlobRef(r)) {
129
- return { url: r.remoteBlobRef, count: 0 };
130
- }
131
- const blob = await getBlob(r);
132
- if (!blob) {
133
- return null;
134
- }
135
- const url = URL.createObjectURL(blob);
136
- const existing = { url, count: 0 };
137
- borrowedUrls.set(key, existing);
138
- urlToKey.set(url, key);
139
- return existing;
140
- });
141
- async function borrowUrl(r) {
142
- const key = JSON.stringify(r);
143
- const existing = borrowedUrls.get(key) ?? await borrowUrlInternalNoIncrement(key, r);
144
- if (!existing) {
145
- return null;
146
- }
147
- existing.count++;
148
- return existing.url;
149
- }
150
- function returnUrl(url) {
151
- if (!url) {
152
- return;
153
- }
154
- const key = urlToKey.get(url);
155
- if (key) {
156
- const entry = borrowedUrls.get(key);
157
- if (entry) {
158
- entry.count--;
159
- if (entry.count <= 0) {
160
- borrowedUrls.delete(key);
161
- urlToKey.delete(url);
162
- if (!isRemoteUrl(url)) {
163
- URL.revokeObjectURL(url);
164
- }
165
- }
166
- }
167
- }
168
- }
169
- function createRemoteBlobRef(url) {
170
- if (!isRemoteUrl(url)) {
171
- throw new Error(`Invalid url, expected to start with (${remoteUrlPrefix}): ${url}`);
172
- }
173
- return { remoteBlobRef: url };
174
- }
175
- function _testGetBorrowCount(r) {
176
- const key = JSON.stringify(r);
177
- return borrowedUrls.get(key)?.count ?? 0;
178
- }
179
- return {
180
- getRef,
181
- getBlob,
182
- hasBlob,
183
- borrowUrl,
184
- returnUrl,
185
- releaseBlob,
186
- createRemoteBlobRef,
187
- _testGetBorrowCount,
188
- };
189
- }
190
- /**
191
- * The global blob store that can be used to store and retrieve blobs.
192
- */
193
- export const blobStore = createBlobStore();
194
- //# sourceMappingURL=blob-store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blob-store.js","sourceRoot":"","sources":["../../src/blob-store/blob-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAE5F,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,GAAG,eAAe,IAAI;CACN,CAAC;AAG5B,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,CAAC,eAAe,CAAC;IAC3B,UAAU,EAAE;QACV,aAAa,EAAE,eAAe;KAC/B;IACD,oBAAoB,EAAE,KAAK;CACF,CAAC;AAG5B,MAAM,kBAAkB,GAAG;IACzB,QAAQ,EAAE,CAAC,cAAc,CAAC;IAC1B,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACjC;IACD,oBAAoB,EAAE,KAAK;CACF,CAAC;AAG5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;CACvB,C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,CAAC,MAAM,SAAS,GAAc,eAAe,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,142 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
23
- import { createBlobStore } from "./blob-store.js";
24
- describe("blobStore", () => {
25
- // Mock URL.createObjectURL and URL.revokeObjectURL
26
- const mockCreateObjectURL = vi.fn((blob) => `blob:${Math.random()}`);
27
- const mockRevokeObjectURL = vi.fn();
28
- let testBlobStore;
29
- let createdUrl;
30
- beforeEach(async () => {
31
- // Setup URL mock functions
32
- const originalCreateObjectURL = URL.createObjectURL;
33
- const originalRevokeObjectURL = URL.revokeObjectURL;
34
- // Ensure we create a non-http URL
35
- mockCreateObjectURL.mockImplementation((blob) => {
36
- createdUrl = `blob:${Math.random()}`;
37
- return createdUrl;
38
- });
39
- URL.createObjectURL = mockCreateObjectURL;
40
- URL.revokeObjectURL = mockRevokeObjectURL;
41
- // Clear mock call history
42
- mockCreateObjectURL.mockClear();
43
- mockRevokeObjectURL.mockClear();
44
- testBlobStore = await createBlobStore();
45
- return () => {
46
- URL.createObjectURL = originalCreateObjectURL;
47
- URL.revokeObjectURL = originalRevokeObjectURL;
48
- };
49
- });
50
- afterEach(() => {
51
- // Clean up any remaining borrowed URLs
52
- mockCreateObjectURL.mockReset();
53
- mockRevokeObjectURL.mockReset();
54
- });
55
- describe("URL reference counting", () => {
56
- it("should reuse the same URL for multiple borrows of the same blob", async () => {
57
- // Create a test blob
58
- const testBlob = new Blob(["test"], { type: "text/plain" });
59
- const blobRef = await testBlobStore.getRef(testBlob);
60
- // Borrow the URL multiple times
61
- const url1 = await testBlobStore.borrowUrl(blobRef);
62
- const url2 = await testBlobStore.borrowUrl(blobRef);
63
- const url3 = await testBlobStore.borrowUrl(blobRef);
64
- expect(url1).toBeTruthy();
65
- expect(url1).toBe(url2);
66
- expect(url2).toBe(url3);
67
- expect(url1).toMatch(/^blob:/); // Verify it's a blob URL
68
- // createObjectURL should only be called once
69
- expect(mockCreateObjectURL).toHaveBeenCalledTimes(1);
70
- // Clean up
71
- testBlobStore.returnUrl(url1);
72
- testBlobStore.returnUrl(url2);
73
- testBlobStore.returnUrl(url3);
74
- });
75
- it("should only revoke URL when all references are returned", async () => {
76
- const testBlob = new Blob(["test"], { type: "text/plain" });
77
- const blobRef = await testBlobStore.getRef(testBlob);
78
- // Borrow the URL three times
79
- const url1 = await testBlobStore.borrowUrl(blobRef);
80
- const url2 = await testBlobStore.borrowUrl(blobRef);
81
- const url3 = await testBlobStore.borrowUrl(blobRef);
82
- expect(url1).toMatch(/^blob:/); // Verify it's a blob URL
83
- // Return URLs one by one
84
- testBlobStore.returnUrl(url1);
85
- expect(mockRevokeObjectURL).not.toHaveBeenCalled();
86
- testBlobStore.returnUrl(url2);
87
- expect(mockRevokeObjectURL).not.toHaveBeenCalled();
88
- testBlobStore.returnUrl(url3);
89
- expect(mockRevokeObjectURL).toHaveBeenCalledTimes(1);
90
- expect(mockRevokeObjectURL).toHaveBeenCalledWith(createdUrl);
91
- });
92
- it("should handle remote URLs correctly", async () => {
93
- const remoteRef = testBlobStore.createRemoteBlobRef("http://example.com/image.jpg");
94
- // Borrow remote URL multiple times
95
- const url1 = await testBlobStore.borrowUrl(remoteRef);
96
- const url2 = await testBlobStore.borrowUrl(remoteRef);
97
- expect(url1).toBe("http://example.com/image.jpg");
98
- expect(url2).toBe("http://example.com/image.jpg");
99
- expect(mockCreateObjectURL).not.toHaveBeenCalled();
100
- // Return URLs
101
- testBlobStore.returnUrl(url1);
102
- testBlobStore.returnUrl(url2);
103
- // Should not revoke remote URLs
104
- expect(mockRevokeObjectURL).not.toHaveBeenCalled();
105
- });
106
- it("should handle null inputs gracefully", async () => {
107
- const nullUrl = await testBlobStore.borrowUrl(null);
108
- expect(nullUrl).toBeNull();
109
- // Should not throw when returning null
110
- expect(() => testBlobStore.returnUrl(null)).not.toThrow();
111
- });
112
- it('demonstrates race condition in borrowUrl', async () => {
113
- const store = testBlobStore;
114
- const testBlob = new Blob(['test data'], { type: 'text/plain' });
115
- const blobRef = await store.getRef(testBlob);
116
- // Create an artificially delayed getBlob to simulate network latency
117
- const originalGetBlob = store.getBlob;
118
- store.getBlob = async (ref) => {
119
- await new Promise(resolve => setTimeout(resolve, 50)); // Add delay
120
- return originalGetBlob(ref);
121
- };
122
- // Make two parallel borrowUrl calls
123
- const [url1, url2] = await Promise.all([
124
- store.borrowUrl(blobRef),
125
- store.borrowUrl(blobRef)
126
- ]);
127
- expect(url1).toBe(url2); // Same URL should be returned
128
- // Return one of the URLs
129
- store.returnUrl(url1);
130
- // Verify that the borrow count is still 1 since we borrowed twice and returned once
131
- expect(store._testGetBorrowCount(blobRef)).toBe(1);
132
- // Return the second URL
133
- store.returnUrl(url2);
134
- // Verify the borrow count is now 0
135
- expect(store._testGetBorrowCount(blobRef)).toBe(0);
136
- // Verify the URL was revoked
137
- expect(mockRevokeObjectURL).toHaveBeenCalledTimes(1);
138
- expect(mockRevokeObjectURL).toHaveBeenCalledWith(url1);
139
- });
140
- });
141
- });
142
- //# sourceMappingURL=blob-store.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blob-store.test.js","sourceRoot":"","sources":["../../src/blob-store/blob-store.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAkB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACvB,mDAAmD;IACnD,MAAM,mBAAmB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC3E,MAAM,mBAAmB,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;IACpC,IAAI,aAAwB,CAAC;IAC7B,IAAI,UAAkB,CAAC;IAEvB,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,2BAA2B;QAC3B,MAAM,uBAAuB,GAAG,GAAG,CAAC,eAAe,CAAC;QACpD,MAAM,uBAAuB,GAAG,GAAG,CAAC,eAAe,CAAC;QAEpD,kCAAkC;QAClC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,IAAU,EAAE,EAAE;YAClD,UAAU,GAAG,QAAQ,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACrC,OAAO,UAAU,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,eAAe,GAAG,mBAAmB,CAAC;QAC1C,GAAG,CAAC,eAAe,GAAG,mBAAmB,CAAC;QAE1C,0BAA0B;QAC1B,mBAAmB,CAAC,SAAS,EAAE,CAAC;QAChC,mBAAmB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CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Binds all functions to the object containing them.
3
- * @param obj
4
- * @returns
5
- */
6
- export declare function bindFunctions<T extends object>(obj: T): void;
@@ -1,33 +0,0 @@
1
- /*MIT License
2
-
3
- © Copyright 2025 Adobe. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.*/
22
- /**
23
- * Binds all functions to the object containing them.
24
- * @param obj
25
- * @returns
26
- */
27
- export function bindFunctions(obj) {
28
- for (const key in obj) {
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- need to bind functions
30
- obj[key] = obj[key].bind(obj);
31
- }
32
- }
33
- //# sourceMappingURL=bind-functions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bind-functions.js","sourceRoot":"","sources":["../../../src/cache/functions/bind-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAmB,GAAM;IAEpD,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,wFAAwF;QACxF,GAAG,CAAC,GAAG,CAAC,GAAI,GAAG,CAAC,GAAG,CAAiB,CAAC,IAAI,CAAC,GAAG,CAAQ,CAAC;IACxD,CAAC;AACH,CAAC"}
@@ -1 +0,0 @@
1
- export declare function omit<T extends object, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;