@adobe/data 0.5.2 → 0.5.3

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 (349) hide show
  1. package/dist/blob/blob-handle.d.ts +29 -0
  2. package/dist/blob/blob-handle.js +11 -0
  3. package/dist/blob/blob-handle.js.map +1 -0
  4. package/dist/blob/blob-meta.d.ts +23 -0
  5. package/dist/blob/blob-meta.js +12 -0
  6. package/dist/blob/blob-meta.js.map +1 -0
  7. package/dist/blob/download-handle.d.ts +4 -0
  8. package/dist/blob/download-handle.js +2 -0
  9. package/dist/blob/download-handle.js.map +1 -0
  10. package/dist/blob/index.d.ts +4 -0
  11. package/dist/blob/index.js +5 -0
  12. package/dist/blob/index.js.map +1 -0
  13. package/dist/blob/upload-handle.d.ts +4 -0
  14. package/dist/blob/upload-handle.js +2 -0
  15. package/dist/blob/upload-handle.js.map +1 -0
  16. package/dist/schema/schema.d.ts +8 -12
  17. package/dist/schema/schema.js.map +1 -1
  18. package/dist/service/is-service.js +1 -2
  19. package/dist/service/is-service.js.map +1 -1
  20. package/dist/service/progressive-result.d.ts +5 -6
  21. package/dist/service/progressive-result.js.map +1 -1
  22. package/dist/services/add-observable-actions.d.ts +29 -0
  23. package/dist/services/add-observable-actions.js +108 -0
  24. package/dist/services/add-observable-actions.js.map +1 -0
  25. package/dist/services/index.d.ts +4 -0
  26. package/dist/{core → services}/index.js +3 -3
  27. package/dist/services/index.js.map +1 -0
  28. package/dist/services/is-service.d.ts +2 -0
  29. package/dist/{cache/functions/omit.js → services/is-service.js} +3 -7
  30. package/dist/services/is-service.js.map +1 -0
  31. package/dist/services/progressive-result.d.ts +96 -0
  32. package/dist/services/progressive-result.js +99 -0
  33. package/dist/services/progressive-result.js.map +1 -0
  34. package/dist/services/service.d.ts +4 -0
  35. package/dist/{cache/functions/types.js → services/service.js} +1 -1
  36. package/dist/services/service.js.map +1 -0
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/index.js +1 -0
  40. package/dist/types/index.js.map +1 -1
  41. package/dist/types/replace.d.ts +7 -0
  42. package/dist/types/replace.js +5 -0
  43. package/dist/types/replace.js.map +1 -0
  44. package/package.json +8 -1
  45. package/dist/README.md +0 -310
  46. package/dist/cache/functions/bind-functions.d.ts +0 -6
  47. package/dist/cache/functions/bind-functions.js +0 -33
  48. package/dist/cache/functions/bind-functions.js.map +0 -1
  49. package/dist/cache/functions/hashing/arrayBufferToHex.d.ts +0 -1
  50. package/dist/cache/functions/hashing/arrayBufferToHex.js +0 -27
  51. package/dist/cache/functions/hashing/arrayBufferToHex.js.map +0 -1
  52. package/dist/cache/functions/omit.d.ts +0 -1
  53. package/dist/cache/functions/omit.js.map +0 -1
  54. package/dist/cache/functions/types.d.ts +0 -1
  55. package/dist/cache/functions/types.js.map +0 -1
  56. package/dist/core/data.d.ts +0 -22
  57. package/dist/core/data.js +0 -52
  58. package/dist/core/data.js.map +0 -1
  59. package/dist/core/data.test.d.ts +0 -1
  60. package/dist/core/data.test.js +0 -48
  61. package/dist/core/data.test.js.map +0 -1
  62. package/dist/core/functions/array-equals.d.ts +0 -1
  63. package/dist/core/functions/array-equals.js +0 -34
  64. package/dist/core/functions/array-equals.js.map +0 -1
  65. package/dist/core/functions/deep-merge.d.ts +0 -32
  66. package/dist/core/functions/deep-merge.js +0 -54
  67. package/dist/core/functions/deep-merge.js.map +0 -1
  68. package/dist/core/functions/deep-merge.test.d.ts +0 -1
  69. package/dist/core/functions/deep-merge.test.js +0 -94
  70. package/dist/core/functions/deep-merge.test.js.map +0 -1
  71. package/dist/core/functions/index.d.ts +0 -3
  72. package/dist/core/functions/index.js +0 -25
  73. package/dist/core/functions/index.js.map +0 -1
  74. package/dist/core/functions/is-async-generator.d.ts +0 -1
  75. package/dist/core/functions/is-async-generator.js +0 -25
  76. package/dist/core/functions/is-async-generator.js.map +0 -1
  77. package/dist/core/functions/is-promise.d.ts +0 -1
  78. package/dist/core/functions/is-promise.js +0 -26
  79. package/dist/core/functions/is-promise.js.map +0 -1
  80. package/dist/core/functions/with-validation.d.ts +0 -5
  81. package/dist/core/functions/with-validation.js +0 -38
  82. package/dist/core/functions/with-validation.js.map +0 -1
  83. package/dist/core/functions/with-validation.test.d.ts +0 -1
  84. package/dist/core/functions/with-validation.test.js +0 -96
  85. package/dist/core/functions/with-validation.test.js.map +0 -1
  86. package/dist/core/index.d.ts +0 -3
  87. package/dist/core/index.js.map +0 -1
  88. package/dist/core/schema/dynamic/dynamic-schema.d.ts +0 -27
  89. package/dist/core/schema/dynamic/dynamic-schema.js +0 -2
  90. package/dist/core/schema/dynamic/dynamic-schema.js.map +0 -1
  91. package/dist/core/schema/dynamic/enumerate-patches.d.ts +0 -9
  92. package/dist/core/schema/dynamic/enumerate-patches.js +0 -50
  93. package/dist/core/schema/dynamic/enumerate-patches.js.map +0 -1
  94. package/dist/core/schema/dynamic/enumerate-patches.test.d.ts +0 -134
  95. package/dist/core/schema/dynamic/enumerate-patches.test.js +0 -209
  96. package/dist/core/schema/dynamic/enumerate-patches.test.js.map +0 -1
  97. package/dist/core/schema/dynamic/get-dynamic-schema.d.ts +0 -5
  98. package/dist/core/schema/dynamic/get-dynamic-schema.js +0 -26
  99. package/dist/core/schema/dynamic/get-dynamic-schema.js.map +0 -1
  100. package/dist/core/schema/dynamic/get-dynamic-schema.test.d.ts +0 -1
  101. package/dist/core/schema/dynamic/get-dynamic-schema.test.js +0 -94
  102. package/dist/core/schema/dynamic/get-dynamic-schema.test.js.map +0 -1
  103. package/dist/core/schema/dynamic/index.d.ts +0 -1
  104. package/dist/core/schema/dynamic/index.js +0 -2
  105. package/dist/core/schema/dynamic/index.js.map +0 -1
  106. package/dist/core/schema/dynamic/schema-path-value-path.d.ts +0 -5
  107. package/dist/core/schema/dynamic/schema-path-value-path.js +0 -12
  108. package/dist/core/schema/dynamic/schema-path-value-path.js.map +0 -1
  109. package/dist/core/schema/dynamic-schema.d.ts +0 -27
  110. package/dist/core/schema/dynamic-schema.js +0 -2
  111. package/dist/core/schema/dynamic-schema.js.map +0 -1
  112. package/dist/core/schema/index.d.ts +0 -4
  113. package/dist/core/schema/index.js +0 -26
  114. package/dist/core/schema/index.js.map +0 -1
  115. package/dist/core/schema/schema.d.ts +0 -122
  116. package/dist/core/schema/schema.js +0 -34
  117. package/dist/core/schema/schema.js.map +0 -1
  118. package/dist/core/schema/schemas.d.ts +0 -45
  119. package/dist/core/schema/schemas.js +0 -39
  120. package/dist/core/schema/schemas.js.map +0 -1
  121. package/dist/core/schema/ui-schema.d.ts +0 -25
  122. package/dist/core/schema/ui-schema.js +0 -2
  123. package/dist/core/schema/ui-schema.js.map +0 -1
  124. package/dist/core/schema/validation/is-valid.d.ts +0 -2
  125. package/dist/core/schema/validation/is-valid.js +0 -14
  126. package/dist/core/schema/validation/is-valid.js.map +0 -1
  127. package/dist/core/schema/validation/is-valid.test.d.ts +0 -1
  128. package/dist/core/schema/validation/is-valid.test.js +0 -40
  129. package/dist/core/schema/validation/is-valid.test.js.map +0 -1
  130. package/dist/core/schema/validation/validate.d.ts +0 -2
  131. package/dist/core/schema/validation/validate.js +0 -38
  132. package/dist/core/schema/validation/validate.js.map +0 -1
  133. package/dist/core/schema/validation/validate.test.d.ts +0 -1
  134. package/dist/core/schema/validation/validate.test.js +0 -106
  135. package/dist/core/schema/validation/validate.test.js.map +0 -1
  136. package/dist/core/schema/validation/with-validation.d.ts +0 -5
  137. package/dist/core/schema/validation/with-validation.js +0 -16
  138. package/dist/core/schema/validation/with-validation.js.map +0 -1
  139. package/dist/core/schema/validation/with-validation.test.d.ts +0 -1
  140. package/dist/core/schema/validation/with-validation.test.js +0 -96
  141. package/dist/core/schema/validation/with-validation.test.js.map +0 -1
  142. package/dist/core/schema.d.ts +0 -86
  143. package/dist/core/schema.js +0 -33
  144. package/dist/core/schema.js.map +0 -1
  145. package/dist/core/schema.test.d.ts +0 -1
  146. package/dist/core/schema.test.js +0 -16
  147. package/dist/core/schema.test.js.map +0 -1
  148. package/dist/core/schemas.d.ts +0 -45
  149. package/dist/core/schemas.js +0 -39
  150. package/dist/core/schemas.js.map +0 -1
  151. package/dist/ecs/action-ecs/action-ecs.d.ts +0 -19
  152. package/dist/ecs/action-ecs/action-ecs.js +0 -203
  153. package/dist/ecs/action-ecs/action-ecs.js.map +0 -1
  154. package/dist/ecs/action-ecs/action-ecs.test.d.ts +0 -1
  155. package/dist/ecs/action-ecs/action-ecs.test.js +0 -362
  156. package/dist/ecs/action-ecs/action-ecs.test.js.map +0 -1
  157. package/dist/ecs/action-ecs/action-types.d.ts +0 -106
  158. package/dist/ecs/action-ecs/action-types.js +0 -19
  159. package/dist/ecs/action-ecs/action-types.js.map +0 -1
  160. package/dist/ecs/action-ecs/index.d.ts +0 -2
  161. package/dist/ecs/action-ecs/index.js +0 -23
  162. package/dist/ecs/action-ecs/index.js.map +0 -1
  163. package/dist/ecs/core-ecs/core-ecs-serialization.test.d.ts +0 -1
  164. package/dist/ecs/core-ecs/core-ecs-serialization.test.js +0 -230
  165. package/dist/ecs/core-ecs/core-ecs-serialization.test.js.map +0 -1
  166. package/dist/ecs/core-ecs/core-ecs-types.d.ts +0 -141
  167. package/dist/ecs/core-ecs/core-ecs-types.js +0 -23
  168. package/dist/ecs/core-ecs/core-ecs-types.js.map +0 -1
  169. package/dist/ecs/core-ecs/core-ecs.d.ts +0 -7
  170. package/dist/ecs/core-ecs/core-ecs.js +0 -492
  171. package/dist/ecs/core-ecs/core-ecs.js.map +0 -1
  172. package/dist/ecs/core-ecs/core-ecs.test.d.ts +0 -1
  173. package/dist/ecs/core-ecs/core-ecs.test.js +0 -425
  174. package/dist/ecs/core-ecs/core-ecs.test.js.map +0 -1
  175. package/dist/ecs/core-ecs/index.d.ts +0 -1
  176. package/dist/ecs/core-ecs/index.js +0 -2
  177. package/dist/ecs/core-ecs/index.js.map +0 -1
  178. package/dist/ecs/database/database-schema/create-database-schema-test.d.ts +0 -1
  179. package/dist/ecs/database/database-schema/create-database-schema-test.js +0 -42
  180. package/dist/ecs/database/database-schema/create-database-schema-test.js.map +0 -1
  181. package/dist/ecs/database/database-schema/create-database-schema.d.ts +0 -12
  182. package/dist/ecs/database/database-schema/create-database-schema.js +0 -26
  183. package/dist/ecs/database/database-schema/create-database-schema.js.map +0 -1
  184. package/dist/ecs/database/database-schema/database-schema.d.ts +0 -15
  185. package/dist/ecs/database/database-schema/database-schema.js +0 -23
  186. package/dist/ecs/database/database-schema/database-schema.js.map +0 -1
  187. package/dist/ecs/database/database-schema/index.d.ts +0 -2
  188. package/dist/ecs/database/database-schema/index.js +0 -24
  189. package/dist/ecs/database/database-schema/index.js.map +0 -1
  190. package/dist/ecs/database/register-database-codec.d.ts +0 -1
  191. package/dist/ecs/database/register-database-codec.js +0 -35
  192. package/dist/ecs/database/register-database-codec.js.map +0 -1
  193. package/dist/ecs/database/register-database-codecs.d.ts +0 -1
  194. package/dist/ecs/database/register-database-codecs.js +0 -35
  195. package/dist/ecs/database/register-database-codecs.js.map +0 -1
  196. package/dist/ecs/database/register-store-codec.d.ts +0 -1
  197. package/dist/ecs/database/register-store-codec.js +0 -35
  198. package/dist/ecs/database/register-store-codec.js.map +0 -1
  199. package/dist/ecs/database/register-typed-buffer-codecs.d.ts +0 -1
  200. package/dist/ecs/database/register-typed-buffer-codecs.js +0 -80
  201. package/dist/ecs/database/register-typed-buffer-codecs.js.map +0 -1
  202. package/dist/ecs/database/transactional-store/apply-write-operations.d.ts +0 -7
  203. package/dist/ecs/database/transactional-store/apply-write-operations.js +0 -20
  204. package/dist/ecs/database/transactional-store/apply-write-operations.js.map +0 -1
  205. package/dist/ecs/database/transactional-store/applyWriteOperations.d.ts +0 -7
  206. package/dist/ecs/database/transactional-store/applyWriteOperations.js +0 -20
  207. package/dist/ecs/database/transactional-store/applyWriteOperations.js.map +0 -1
  208. package/dist/ecs/database/transactional-store/create-test-transaction.d.ts +0 -7
  209. package/dist/ecs/database/transactional-store/create-test-transaction.js +0 -7
  210. package/dist/ecs/database/transactional-store/create-test-transaction.js.map +0 -1
  211. package/dist/ecs/database/transactional-store/patch.d.ts +0 -3
  212. package/dist/ecs/database/transactional-store/patch.js +0 -7
  213. package/dist/ecs/database/transactional-store/patch.js.map +0 -1
  214. package/dist/ecs/database/transactional-store/undoable.d.ts +0 -13
  215. package/dist/ecs/database/transactional-store/undoable.js +0 -23
  216. package/dist/ecs/database/transactional-store/undoable.js.map +0 -1
  217. package/dist/ecs/database/transactional-store/with-undoable.d.ts +0 -10
  218. package/dist/ecs/database/transactional-store/with-undoable.js +0 -13
  219. package/dist/ecs/database/transactional-store/with-undoable.js.map +0 -1
  220. package/dist/ecs/database/with-undoable.d.ts +0 -10
  221. package/dist/ecs/database/with-undoable.js +0 -13
  222. package/dist/ecs/database/with-undoable.js.map +0 -1
  223. package/dist/ecs/ecs/ecs-types.d.ts +0 -132
  224. package/dist/ecs/ecs/ecs-types.js +0 -23
  225. package/dist/ecs/ecs/ecs-types.js.map +0 -1
  226. package/dist/ecs/ecs/ecs-where-functions.d.ts +0 -6
  227. package/dist/ecs/ecs/ecs-where-functions.js +0 -91
  228. package/dist/ecs/ecs/ecs-where-functions.js.map +0 -1
  229. package/dist/ecs/ecs/ecs.d.ts +0 -13
  230. package/dist/ecs/ecs/ecs.js +0 -177
  231. package/dist/ecs/ecs/ecs.js.map +0 -1
  232. package/dist/ecs/ecs/ecs.test.d.ts +0 -1
  233. package/dist/ecs/ecs/ecs.test.js +0 -399
  234. package/dist/ecs/ecs/ecs.test.js.map +0 -1
  235. package/dist/ecs/ecs/index.d.ts +0 -3
  236. package/dist/ecs/ecs/index.js +0 -3
  237. package/dist/ecs/ecs/index.js.map +0 -1
  238. package/dist/ecs/entity-location-table/register-database-codec.d.ts +0 -1
  239. package/dist/ecs/entity-location-table/register-database-codec.js +0 -35
  240. package/dist/ecs/entity-location-table/register-database-codec.js.map +0 -1
  241. package/dist/ecs/entity-location-table/register-entity-location-table-codec.d.ts +0 -1
  242. package/dist/ecs/entity-location-table/register-entity-location-table-codec.js +0 -42
  243. package/dist/ecs/entity-location-table/register-entity-location-table-codec.js.map +0 -1
  244. package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.d.ts +0 -1
  245. package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js +0 -70
  246. package/dist/ecs/entity-location-table/register-entity-location-table-codec.test.js.map +0 -1
  247. package/dist/ecs/persistence-service/create-persistence-service.d.ts +0 -6
  248. package/dist/ecs/persistence-service/create-persistence-service.js +0 -24
  249. package/dist/ecs/persistence-service/create-persistence-service.js.map +0 -1
  250. package/dist/ecs/persistence-service/create-session-persistence-service.d.ts +0 -8
  251. package/dist/ecs/persistence-service/create-session-persistence-service.js +0 -49
  252. package/dist/ecs/persistence-service/create-session-persistence-service.js.map +0 -1
  253. package/dist/ecs/persistence-service/persistence-service copy.d.ts +0 -5
  254. package/dist/ecs/persistence-service/persistence-service copy.js +0 -2
  255. package/dist/ecs/persistence-service/persistence-service copy.js.map +0 -1
  256. package/dist/ecs/persistence-service/to-blob-refs.d.ts +0 -2
  257. package/dist/ecs/persistence-service/to-blob-refs.js +0 -3
  258. package/dist/ecs/persistence-service/to-blob-refs.js.map +0 -1
  259. package/dist/ecs/persistence-service/undo-redo-service.d.ts +0 -11
  260. package/dist/ecs/persistence-service/undo-redo-service.js +0 -23
  261. package/dist/ecs/persistence-service/undo-redo-service.js.map +0 -1
  262. package/dist/ecs/store/core/register-core-codec.d.ts +0 -1
  263. package/dist/ecs/store/core/register-core-codec.js +0 -45
  264. package/dist/ecs/store/core/register-core-codec.js.map +0 -1
  265. package/dist/ecs/store/core/register-core-codec.test.d.ts +0 -1
  266. package/dist/ecs/store/core/register-core-codec.test.js +0 -136
  267. package/dist/ecs/store/core/register-core-codec.test.js.map +0 -1
  268. package/dist/ecs/store/query.d.ts +0 -47
  269. package/dist/ecs/store/query.js +0 -2
  270. package/dist/ecs/store/query.js.map +0 -1
  271. package/dist/ecs/store/register-core-codec.d.ts +0 -1
  272. package/dist/ecs/store/register-core-codec.js +0 -38
  273. package/dist/ecs/store/register-core-codec.js.map +0 -1
  274. package/dist/ecs/store/register-store-codec.d.ts +0 -1
  275. package/dist/ecs/store/register-store-codec.js +0 -38
  276. package/dist/ecs/store/register-store-codec.js.map +0 -1
  277. package/dist/ecs/store/restore-store.d.ts +0 -12
  278. package/dist/ecs/store/restore-store.js +0 -91
  279. package/dist/ecs/store/restore-store.js.map +0 -1
  280. package/dist/ecs/store/select-options.d.ts +0 -1
  281. package/dist/ecs/store/select-options.js +0 -16
  282. package/dist/ecs/store/select-options.js.map +0 -1
  283. package/dist/ecs/store/select.d.ts +0 -44
  284. package/dist/ecs/store/select.js +0 -2
  285. package/dist/ecs/store/select.js.map +0 -1
  286. package/dist/ecs/transaction-ecs/index.d.ts +0 -2
  287. package/dist/ecs/transaction-ecs/index.js +0 -24
  288. package/dist/ecs/transaction-ecs/index.js.map +0 -1
  289. package/dist/ecs/transaction-ecs/transaction-ecs.d.ts +0 -11
  290. package/dist/ecs/transaction-ecs/transaction-ecs.js +0 -184
  291. package/dist/ecs/transaction-ecs/transaction-ecs.js.map +0 -1
  292. package/dist/ecs/transaction-ecs/transaction-ecs.test.d.ts +0 -1
  293. package/dist/ecs/transaction-ecs/transaction-ecs.test.js +0 -599
  294. package/dist/ecs/transaction-ecs/transaction-ecs.test.js.map +0 -1
  295. package/dist/ecs/transaction-ecs/transaction-types.d.ts +0 -135
  296. package/dist/ecs/transaction-ecs/transaction-types.js +0 -2
  297. package/dist/ecs/transaction-ecs/transaction-types.js.map +0 -1
  298. package/dist/ecs/transaction-ecs/transactions.d.ts +0 -5
  299. package/dist/ecs/transaction-ecs/transactions.js +0 -158
  300. package/dist/ecs/transaction-ecs/transactions.js.map +0 -1
  301. package/dist/ecs/undo-redo/create-undo-redo-actions.d.ts +0 -10
  302. package/dist/ecs/undo-redo/create-undo-redo-actions.js +0 -69
  303. package/dist/ecs/undo-redo/create-undo-redo-actions.js.map +0 -1
  304. package/dist/ecs/undo-redo/create-undo-redo-actions.test.d.ts +0 -1
  305. package/dist/ecs/undo-redo/create-undo-redo-actions.test.js +0 -295
  306. package/dist/ecs/undo-redo/create-undo-redo-actions.test.js.map +0 -1
  307. package/dist/ecs/undo-redo/do.d.ts +0 -3
  308. package/dist/ecs/undo-redo/do.js +0 -3
  309. package/dist/ecs/undo-redo/do.js.map +0 -1
  310. package/dist/ecs/undo-redo/index.d.ts +0 -1
  311. package/dist/ecs/undo-redo/index.js +0 -23
  312. package/dist/ecs/undo-redo/index.js.map +0 -1
  313. package/dist/functions/serialization/deserialize.d.ts +0 -1
  314. package/dist/functions/serialization/deserialize.js +0 -2
  315. package/dist/functions/serialization/deserialize.js.map +0 -1
  316. package/dist/functions/serialization/register-typed-array-codecs copy.d.ts +0 -1
  317. package/dist/functions/serialization/register-typed-array-codecs copy.js +0 -13
  318. package/dist/functions/serialization/register-typed-array-codecs copy.js.map +0 -1
  319. package/dist/functions/serialization/serialize-to-blobs copy.d.ts +0 -8
  320. package/dist/functions/serialization/serialize-to-blobs copy.js +0 -21
  321. package/dist/functions/serialization/serialize-to-blobs copy.js.map +0 -1
  322. package/dist/internal/typed-array/typed-array-constructer.d.ts +0 -7
  323. package/dist/internal/typed-array/typed-array-constructer.js +0 -2
  324. package/dist/internal/typed-array/typed-array-constructer.js.map +0 -1
  325. package/dist/internal/typed-array/typed-array.d.ts +0 -1
  326. package/dist/internal/typed-array/typed-array.js +0 -23
  327. package/dist/internal/typed-array/typed-array.js.map +0 -1
  328. package/dist/observe/with-map copy.d.ts +0 -5
  329. package/dist/observe/with-map copy.js +0 -14
  330. package/dist/observe/with-map copy.js.map +0 -1
  331. package/dist/package.json +0 -129
  332. package/dist/schema/f32 copy.d.ts +0 -6
  333. package/dist/schema/f32 copy.js +0 -6
  334. package/dist/schema/f32 copy.js.map +0 -1
  335. package/dist/schemas/index.d.ts +0 -1
  336. package/dist/schemas/index.js +0 -23
  337. package/dist/schemas/index.js.map +0 -1
  338. package/dist/schemas/schemas.d.ts +0 -45
  339. package/dist/schemas/schemas.js +0 -39
  340. package/dist/schemas/schemas.js.map +0 -1
  341. package/dist/service/sequential-action.d.ts +0 -18
  342. package/dist/service/sequential-action.js +0 -45
  343. package/dist/service/sequential-action.js.map +0 -1
  344. package/dist/table/ensure-capacity copy.d.ts +0 -2
  345. package/dist/table/ensure-capacity copy.js +0 -15
  346. package/dist/table/ensure-capacity copy.js.map +0 -1
  347. package/dist/table/filter-rows.d.ts +0 -2
  348. package/dist/table/filter-rows.js +0 -15
  349. package/dist/table/filter-rows.js.map +0 -1
@@ -3,3 +3,4 @@ export * from "./assert.js";
3
3
  export * from "./equal.js";
4
4
  export * from "./typed-array-constructer.js";
5
5
  export * from "./typed-array.js";
6
+ export * from "./replace.js";
@@ -24,4 +24,5 @@ export * from "./assert.js";
24
24
  export * from "./equal.js";
25
25
  export * from "./typed-array-constructer.js";
26
26
  export * from "./typed-array.js";
27
+ export * from "./replace.js";
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Traverses T and for every item or property value of type Find, replaces it with type Replace.
3
+ * Example: Replace<{ a: { b: { c: string } } }, string, number> = { a: { b: { c: number } } }
4
+ */
5
+ export type Replace<T, Find, Replacement> = T extends Find ? Replacement : T extends readonly (infer U)[] ? Replace<U, Find, Replacement>[] : T extends object ? {
6
+ [K in keyof T]: Replace<T[K], Find, Replacement>;
7
+ } : T;
@@ -0,0 +1,5 @@
1
+ // Compile-time type checking tests
2
+ {
3
+ }
4
+ export {};
5
+ //# sourceMappingURL=replace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace.js","sourceRoot":"","sources":["../../src/types/replace.ts"],"names":[],"mappings":"AAkBA,mCAAmC;AACnC,CAAC;AAiED,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/data",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Adobe data oriented programming library",
5
5
  "type": "module",
6
6
  "sideEffects": true,
@@ -30,6 +30,9 @@
30
30
  "types": [
31
31
  "./dist/types/index.d.ts"
32
32
  ],
33
+ "blob": [
34
+ "./dist/blob/index.d.ts"
35
+ ],
33
36
  "ecs": [
34
37
  "./dist/ecs/index.d.ts"
35
38
  ],
@@ -59,6 +62,10 @@
59
62
  "import": "./dist/functions/index.js",
60
63
  "types": "./dist/functions/index.d.ts"
61
64
  },
65
+ "./blob": {
66
+ "import": "./dist/blob/index.js",
67
+ "types": "./dist/blob/index.d.ts"
68
+ },
62
69
  "./cache": {
63
70
  "import": "./dist/cache/index.js",
64
71
  "types": "./dist/cache/index.d.ts"
package/dist/README.md DELETED
@@ -1,310 +0,0 @@
1
- # @adobe/data
2
- Adobe Data Oriented Programming Library
3
-
4
- ## Documentation
5
-
6
- [Main Page](https://git.corp.adobe.com/pages/neuralfiltersplatform/firefly-data/docs/api/)
7
-
8
- [ECS Performance Test](https://git.corp.adobe.com/pages/neuralfiltersplatform/firefly-data/docs/perftest.html)
9
-
10
- ## Breaking API Changes
11
-
12
- Until we reach 1.0.0, minor version changes may be API breaking.
13
-
14
- ## Data
15
-
16
- This library uses data oriented design paradigm and prefers pure functional interfaces whenever practical.
17
-
18
- For our purposes, `Data` is immutable `JSON` (de)serializable objects and primitives.
19
-
20
- ### Why immutable Data?
21
-
22
- We prefer Data because it is easy to:
23
- - serialize
24
- - deserialize
25
- - inspect
26
- - compare
27
- - hash
28
- - validate
29
-
30
- We prefer immutable Data because it is easy to:
31
- - reason about
32
- - avoid side effects
33
- - avoid defensive copying
34
- - use for pure function arguments and return values
35
- - use with concurrency
36
- - memoize results
37
- - use as cache key (stringified)
38
- - use as cache value
39
-
40
- ### What is Data Oriented Design?
41
-
42
- Sanders Mertens covers this thoroughly in his ECS FAQ:
43
-
44
- [https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-data-oriented-design](https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-data-oriented-design)
45
-
46
- ### Data Schemas
47
-
48
- When runtime type information is required we use `JSON Schema`. In order to avoid redundancy, we can use `FromSchema` to derive a typescript type at compile time.
49
-
50
- Example:
51
-
52
- ```typescript
53
- const Float32Schema = { type: "number", precision: 1 } as const satisfies Schema;
54
- const Float32 = FromSchema<typeof Float32Schema>; // number
55
- ```
56
-
57
- It is important that we use `as const` for the schema definition. Without that, the typeof Float32Schema would be `{ type: string, precision: number }` instead of `{ type: "number", precision: 1 }` and we would not be able to derive a correct type using `FromSchema`.
58
-
59
- ### Normalized Data
60
-
61
- Data is considered "Normalized" when all object keys contained anywhere within it are alphabetically sorted. We include a `normalize` function which performs this conversion. This is particularly useful when you want to use data as a cache key.
62
-
63
- ```typescript
64
- const notNormalized = { b: 2, a: 1 };
65
- const normalized = normalize(notNormalized); // { a: 1, b: 2 }
66
- ```
67
-
68
- ## Observables
69
-
70
- An `Observable<T>` is a subscription function that you can pass a callback function to. Your callback function can accept a single argument of type `T`. The subscription function returns a dispose function that accepts no parameters and can be called at any point in the future to cancel your subscription.
71
-
72
- Your callback function *may* be called back synchronously (before the initial call returns) zero or one times and asynchronously later any number of times.
73
-
74
- For more information see the [Observable API documentation](./docs/api/modules/observe.html)
75
-
76
- ### Observable Types
77
-
78
- ```typescript
79
- /**
80
- * Called to add a new observer to an Observable.
81
- * Returns an Unobserve function that can be called to stop observing the Observable.
82
- */
83
- export type Observable<T> = (observer: Callback<T>) => Unobserve;
84
- /**
85
- * Callback function called zero or more times with a sequence of values.
86
- * *may* be called back synchronously, immediately when selector function is called.
87
- * *may* also be called back asynchronously later any number of times.
88
- * *may* be called multiple sequential times with the same value.
89
- */
90
- export type Callback<T> = (value: T) => void;
91
- /**
92
- * Function called to stop observing an Observable.
93
- */
94
- export type Unobserve = () => void;
95
- ```
96
-
97
- An Observable can be thought of sort of like a Promise but with a few important differences.
98
- - A Promise only yields a single value, an Observable yields a sequence of values.
99
- - A Promise can reject with an error, an Observable can not. (It could yield type `MyResult | MyError` though.)
100
- - A Promise can only resolve asynchronously, an Observable *may* yield an initial result synchronously.
101
- - An Observable is allowed to call the Callback callback function immediately upon observation if it has a value.
102
- - A Promise begins executing immediately, an Observable may lazily wait for a first observer before taking any action.
103
- - An Observable can be unobserved.
104
-
105
- ### Observable Creation
106
-
107
- This simple definition of an Observable makes it very easy to create them from various sources.
108
-
109
- - `fromConstant<T>(value: T) => Observable<T>`
110
- - `fromPromise<T>(promise: Promise<T>): Observable<T>`
111
- - `fromPromiseWithError<T, E extends Error>(promise: Promise<T>): Observable<T | E>`
112
- - `fromObservableProperties` converts an object with named Observable values into a single Observable of an object with corresponding types.
113
-
114
- For instance:
115
-
116
- ```typescript
117
- fromObservables({ a: fromConstant(1), b: fromConstant("s")})
118
- // yields type Observable<{ a: number, b: string }>
119
- ```
120
-
121
- `fromObservableProperties` will only yield a result once every contained observable has provided a result. If some properties are optional then use the `withOptional` higher order function described below.
122
-
123
- ### Observable Modification
124
-
125
- They are also very easy to modify in order to build higher order Observables.
126
-
127
- For the purposes of discussion let us use an array to indicate the sequential values yielded by an Observable with the first element being any synchronous callback and `void` meaning no synchronous callback.
128
-
129
- So our `fromConstant(12)` would yield `[12]` and `fromPromise(Promise.resolve(12))` would yield `[void, 12]`
130
-
131
- These examples will use the form of: Sequence Before => Higher Order Function => Sequence After.
132
-
133
- withDeduplicate removes any sequentially equivalent values:
134
-
135
- `[1, 1, 2, 2, 2, 3]` => `withDeduplicate` => `[1, 2, 3]`
136
-
137
- withDefault replaces any undefined values, including initial synchronous value with a default value:
138
-
139
- `[void, 1, 2, undefined, 4]` => `withDefault(-1)` => `[-1, 1, 2, -1, 4]`
140
-
141
- withMap applies a mapping function to each value at notification time:
142
-
143
- `[void, 1, 2, 3]` => `withMap(x => x * 2)` => `[void, 2, 4, 6]`
144
-
145
- withOptional converts an `Observable<T>` to `Observable<T | undefined>` and will always respond synchronously.
146
-
147
- `[void, 1, 2, 3, 4]` => `withOptional` => `[undefined, 1, 2, 3, 4]`
148
-
149
- ## Cache
150
-
151
- The cache module contains functions and interfaces related to caching, hashing, memoization and storage and retrieval of `Blob`s.
152
-
153
- The `memoize` function and `BlobStore` are the most important public interfaces in the cache submodule. They are described below. See the API reference for hashing and other lower level functions.
154
-
155
- The `memoize` function can be used to cache expensive, deterministic, asynchronous functions that take data arguments and return data results. In addition to caching the results, it also blocks multiple simultaneous calls with the same arguments and makes them wait for the first result.
156
-
157
- ### BlobStore
158
-
159
- It is important to handle `Blob`s correctly within an application. Retaining references to a large number of them can cause memory problems depending upon their size.
160
-
161
- The `BlobStore` interface and corresponding `blobStore` exported instance provide a convenient way to convert `Blob`s into small JSON handles to them called `BlobRef`s. Those `BlobRef`s can later be converted back into a `Blob`.
162
-
163
- `Blob`s within the `blobStore` are generally persisted across sessions using the browsers buid in `Cache` storage.
164
-
165
- `BlobRef`s have a number of advantages over directly using blobs.
166
- `BlobRef`s are:
167
- - small json objects
168
- - use negligible memory since the `Blob` is stored on disc till needed.
169
- - deterministic for each `Blob` based on mime type and content.
170
- - suitable for persistence to locations with limited size.
171
- - suitable for use as a cache key
172
- - suitable for use as a cache value
173
-
174
- ## Schemas
175
-
176
- Contains some standard data type schemas in JSON Schema format for convenience. These types are most frequently used when describing components within the Entity Component System. Knowing the precise size and signedness of primitive numeric types allows the ECS to store these values within tightly packed typed arrays internally. This makes memory usage and processing time more efficient.
177
-
178
- ## Entity Component System (ECS)
179
-
180
- This ECS database is a high performance, strongly typed typescript implementation inspired by the Sanders Mertens C++ based [Flecs](https://www.flecs.dev/flecs/md_docs_2Docs.html).
181
-
182
- This library provides three different high performance ECS interfaces. They each share the same basic read API but differ in their interface for writing and observability of changes.
183
-
184
- - [ECS](./docs/api/interfaces/ecs.ECS.html)
185
- - allows direct write access to the data.
186
- - no changes are observability.
187
- - [Transaction ECS](./docs/api/interfaces/ecs.TransactionECS.html)
188
- - requires transactions for writing changes.
189
- - all changes are observable.
190
- - [Action ECS](./docs/api/interfaces/ecs.ActionECS.html)
191
- - requires pre-defined actions for writing changes.
192
- - actions are implemented using transactions.
193
- - action functions must be synchronous and may never throw.
194
- - all changes are observable.
195
- - provides Operational Transform to resolve concurrent multi player edits.
196
-
197
- ### What is an ECS?
198
-
199
- Sanders Mertens also covers this thoroughly in his ECS FAQ:
200
-
201
- [https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-ecs](https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-ecs)
202
-
203
- In addition to the Entity, Component and System definitions which are standard, we also use the term Resource. A Resource is just a value which is defined globally on the ECS itself and not attached to any specific Entity.
204
-
205
- ### Action ECS Usage
206
-
207
- ```typescript
208
- // create an action ecs
209
- const ecs = createActionECS()
210
- // define components with schemas
211
- .withComponents({
212
- position: Vector3Schema,
213
- velocity: Vector3Schema,
214
- color: Vector4Schema,
215
- size: { type: "number" },
216
- health: { type: "number" },
217
- player: { const: true },
218
- } as const)
219
- // define archetypes with component names
220
- .withArchetypes({
221
- particle: ["position", "velocity", "color", "size"],
222
- player: ["position", "health", "player"],
223
- })
224
- // define resources with initial values
225
- .withResources({
226
- gravity: 9.8,
227
- })
228
- // define actions with transactional functions
229
- .withActions({
230
- createParticle(t, props: { position: Vector3, velocity: Vector3, color: Vector4, size: number }) {
231
- t.createEntity(t.ecs.archetypes.particle, props);
232
- },
233
- deleteParticle(t, entity: number) {
234
- t.deleteEntity(entity);
235
- },
236
- createPlayer(t, position: Vector3) {
237
- t.createEntity(t.ecs.archetypes.player, { position, health: 100, player: true });
238
- },
239
- movePlayer(t, entity: number, position: Vector3) {
240
- t.setComponentValue(entity, "position", position);
241
- },
242
- setGravity(t, gravity: number) {
243
- t.resources.gravity = gravity;
244
- },
245
- })
246
-
247
- // call some actions to modify the ECS
248
- ecs.actions.createParticle({ position: [0, 0, 0], velocity: [1, 0, 0], color: [1, 1, 1, 1], size: 1 });
249
- ecs.actions.createParticle({ position: [1, 1, 1], velocity: [1, 1, 1], color: [1, 1, 1, 1], size: 2 });
250
- ecs.actions.createPlayer([10, 20, 0]);
251
- ecs.actions.movePlayer(1, [10, 20, 0]);
252
-
253
- // read some values from the ECS
254
- const players = ecs.selectEntities(ecs.archetypes.player);
255
- const particles = ecs.selectEntities(ecs.archetypes.particle);
256
-
257
- // observe changes to the ECS
258
- ecs.observe.archetypeEntities(ecs.archetypes.player)((playerEntities) => {
259
- for (const playerEntity of playerEntities) {
260
- const player = ecs.getEntityValues(playerEntity);
261
- console.log("Player entity changed", player);
262
- }
263
- });
264
-
265
- ```
266
-
267
- ### ECS Persistence
268
-
269
- The ECS can be converted to JSON and from JSON.
270
-
271
- The persistence format is logically consistent with the internal ECS data format so studying it may help you understand how an ECS is structured:
272
-
273
- ```typescript
274
- {
275
- ecs: true,
276
- version: 2,
277
- components: {
278
- id: { type: 'integer', minimum: +0, maximum: 4294967295 },
279
- position: { type: 'array', items: { type: 'number', precision: 1 }, minItems: 3, maxItems: 3 },
280
- velocity: { type: 'array', items: { type: 'number', precision: 1 }, minItems: 3, maxItems: 3 },
281
- color: { type: 'array', items: { type: 'number', precision: 1 }, minItems: 3, maxItems: 3 },
282
- size: { type: 'number' }, health: { type: 'number' }, player: { const: true },
283
- gravity: {}
284
- },
285
- // The main entities table has two entries for each entity.
286
- // The first value is the index of the tables array and represents the entities archetype.
287
- // The second value is the row of the entity within the archetype table.
288
- entities: [ 3, +0, 1, +0, 1, +1, 2, +0 ],
289
- tables: [
290
- { rows: +0, columns: { id: [] } }, // the empty archetype contains only an id component
291
- {
292
- rows: 2,
293
- columns: {
294
- // component data is stored as Structure of Arrays (SoA)
295
- id: [ 1, 2 ],
296
- color: [ [1, 0, 0, 0], [1, 1, 1, 1] ],
297
- position: [ [0, 0, 0, 0], [1, 1, 1, 1] ],
298
- size: [ 1, 2 ],
299
- velocity: [ [0, 0, 0], [1, 1, 1] ]
300
- }
301
- },
302
- { rows: 1, columns: { id: [ 3 ], health: [ 100 ], player: true, position: [ [ 10, 20, +0 ] ] } },
303
- { rows: 1, columns: { gravity: [ 9.8 ], id: [ +0 ] } } // resources are stored internally as components
304
- ]
305
- }
306
- ```
307
-
308
- ## Performance Test
309
-
310
- [Performance Test](https://git.corp.adobe.com/pages/neuralfiltersplatform/firefly-data/docs/perftest.html)
@@ -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 arrayBufferToHex(buffer: ArrayBuffer): string;
@@ -1,27 +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 arrayBufferToHex(buffer) {
23
- return [...new Uint8Array(buffer)]
24
- .map((x) => x.toString(16).padStart(2, "0"))
25
- .join("");
26
- }
27
- //# sourceMappingURL=arrayBufferToHex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"arrayBufferToHex.js","sourceRoot":"","sources":["../../../../src/cache/functions/hashing/arrayBufferToHex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAChD,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
@@ -1 +0,0 @@
1
- export declare function omit<T extends object, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"omit.js","sourceRoot":"","sources":["../../../src/cache/functions/omit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,MAAM,UAAU,IAAI,CAClB,GAAM,EACN,GAAG,IAAS;IAEZ,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1 +0,0 @@
1
- export type AsyncDataFunction<InputArgs extends Array<unknown>, Output> = (...args: InputArgs) => Promise<Output>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cache/functions/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Data is readonly JSON.
3
- * This type forms the foundation for all of our internal state models and interfaces to external APIs.
4
- * It is easy to serialize/deserialize/compare/hash/cache and validate (with JSON-Schema).
5
- * These traits make it an ideal foundation for building a robust state engine which cannot enter into invalid states.
6
- * It also allows us to strongly define contracts between our application and external services.
7
- * Validation of input arguments and output results allows strict enforcement of agreed upon contracts.
8
- */
9
- export type Data = string | number | boolean | null | undefined | ReadonlyArray<Data> | {
10
- readonly [K in string]?: Data;
11
- };
12
- /**
13
- * Compares two Data objects for deep equality.
14
- * Ordering of keys matters.
15
- * If order is not important then use normalize first.
16
- */
17
- export declare function equals(a?: unknown, b?: unknown): boolean;
18
- /**
19
- * Returns a new normalized object of the same type by
20
- * recursively sorting any contained objects keys alphabetically.
21
- */
22
- export declare function normalize<D>(d: D): D;
package/dist/core/data.js DELETED
@@ -1,52 +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
- * Compares two Data objects for deep equality.
24
- * Ordering of keys matters.
25
- * If order is not important then use normalize first.
26
- */
27
- export function equals(a, b) {
28
- if (a === b) {
29
- return true;
30
- }
31
- if (!a || !b) {
32
- return false;
33
- }
34
- return JSON.stringify(a) === JSON.stringify(b);
35
- }
36
- /**
37
- * Returns a new normalized object of the same type by
38
- * recursively sorting any contained objects keys alphabetically.
39
- */
40
- export function normalize(d) {
41
- // we could structured clone but let's explicitly shed any keys with undefined values.
42
- return JSON.parse(JSON.stringify(d), (_key, value) => {
43
- if (value && !Array.isArray(value) && typeof value === "object") {
44
- return Object.fromEntries(Object.entries(value).sort(([a], [b]) =>
45
- // not using String.localeCompare
46
- // we want this consistent no matter locale
47
- a < b ? -1 : a > b ? 1 : 0));
48
- }
49
- return value;
50
- });
51
- }
52
- //# sourceMappingURL=data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/core/data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAmBX;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,CAAW,EAAE,CAAW;IAC7C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,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 "./data.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=data.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.test.js","sourceRoot":"","sources":["../../src/core/data.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,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,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5E,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAC1D,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SACtB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAC1D,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;SACL,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC5D,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;SACf,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare function arrayEquals(a: unknown[], b: unknown[]): boolean;
@@ -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 arrayEquals(a, b) {
23
- const length = a.length;
24
- if (length !== b.length) {
25
- return false;
26
- }
27
- for (let i = 0; i < length; i++) {
28
- if (a[i] !== b[i]) {
29
- return false;
30
- }
31
- }
32
- return true;
33
- }
34
- //# sourceMappingURL=array-equals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-equals.js","sourceRoot":"","sources":["../../../src/core/functions/array-equals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,MAAM,UAAU,WAAW,CAAC,CAAY,EAAE,CAAY;IACpD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACxB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}