@adobe/data 0.5.23 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -110
- package/dist/blob/blob-handle.d.ts +53 -2
- package/dist/blob/blob-handle.js +48 -4
- package/dist/blob/blob-handle.js.map +1 -1
- package/dist/blob/blob-meta.d.ts +26 -1
- package/dist/blob/blob-meta.js +14 -1
- package/dist/blob/blob-meta.js.map +1 -1
- package/dist/blob/index.d.ts +0 -2
- package/dist/blob/index.js +21 -2
- package/dist/blob/index.js.map +1 -1
- package/dist/cache/functions/hashing/blob-to-hash.js +7 -5
- package/dist/cache/functions/hashing/blob-to-hash.js.map +1 -1
- package/dist/ecs/database/create-database.js +56 -50
- package/dist/ecs/database/create-database.js.map +1 -1
- package/dist/ecs/database/create-database.test.js +2 -1
- package/dist/ecs/database/create-database.test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-schema-test.js +1 -1
- package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -1
- package/dist/ecs/database/database-schema/create-database-schema.js +0 -2
- package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
- package/dist/ecs/database/transactional-store/apply-operations.js.map +1 -1
- package/dist/ecs/database/transactional-store/coalesce-transactions.js +2 -2
- package/dist/ecs/database/transactional-store/coalesce-transactions.js.map +1 -1
- package/dist/ecs/database/transactional-store/patch-entity-values.js.map +1 -1
- package/dist/ecs/store/core/select-entities.js +2 -2
- package/dist/ecs/store/core/select-entities.js.map +1 -1
- package/dist/ecs/store/store-schema/create-store-schema-test.js +2 -2
- package/dist/ecs/store/store-schema/create-store-schema-test.js.map +1 -1
- package/dist/ecs/store/store-schema/create-store-schema.d.ts +11 -1
- package/dist/ecs/store/store-schema/create-store-schema.js +30 -44
- package/dist/ecs/store/store-schema/create-store-schema.js.map +1 -1
- package/dist/ecs/store/store-schema/index.d.ts +2 -1
- package/dist/ecs/store/store-schema/index.js +23 -20
- package/dist/ecs/store/store-schema/index.js.map +1 -1
- package/dist/ecs/store/store-schema/store-schema.d.ts +12 -1
- package/dist/ecs/store/store-schema/store-schema.js +21 -55
- package/dist/ecs/store/store-schema/store-schema.js.map +1 -1
- package/dist/ecs/store/store.js +2 -2
- package/dist/ecs/store/store.js.map +1 -1
- package/dist/functions/merge-patch.js.map +1 -1
- package/dist/functions/merge-patch.test.js +21 -0
- package/dist/functions/merge-patch.test.js.map +1 -1
- package/dist/functions/serialization/index.js +21 -0
- package/dist/functions/serialization/index.js.map +1 -1
- package/dist/functions/serialization/register-blob-codecs.js.map +1 -1
- package/dist/functions/serialization/register-typed-array-codecs.js.map +1 -1
- package/dist/functions/serialization/serialize-to-blobs.js +21 -0
- package/dist/functions/serialization/serialize-to-blobs.js.map +1 -1
- package/dist/functions/serialization/serialize-to-blobs.test.js +21 -0
- package/dist/functions/serialization/serialize-to-blobs.test.js.map +1 -1
- package/dist/functions/serialization/serialize-to-storage.js +21 -0
- package/dist/functions/serialization/serialize-to-storage.js.map +1 -1
- package/dist/functions/serialization/serialize-to-storage.test.js +21 -0
- package/dist/functions/serialization/serialize-to-storage.test.js.map +1 -1
- package/dist/functions/serialization/serialize.js +21 -0
- package/dist/functions/serialization/serialize.js.map +1 -1
- package/dist/graphics/frame.d.ts +22 -1
- package/dist/graphics/frame.js +11 -14
- package/dist/graphics/frame.js.map +1 -1
- package/dist/graphics/get-web-gpu-device-and-context.d.ts +2 -1
- package/dist/graphics/get-web-gpu-device-and-context.js +20 -23
- package/dist/graphics/get-web-gpu-device-and-context.js.map +1 -1
- package/dist/graphics/graphics-context.d.ts +5 -1
- package/dist/graphics/graphics-context.js +0 -5
- package/dist/graphics/graphics-context.js.map +1 -1
- package/dist/internal/array-buffer-like/copy.js +0 -420
- package/dist/internal/array-buffer-like/copy.js.map +1 -1
- package/dist/internal/array-buffer-like/is-array-buffer.js +0 -420
- package/dist/internal/array-buffer-like/is-array-buffer.js.map +1 -1
- package/dist/internal/array-buffer-like/is-shared-array-buffer.js +0 -420
- package/dist/internal/array-buffer-like/is-shared-array-buffer.js.map +1 -1
- package/dist/internal/data-view-32/data-view-32.js +0 -21
- package/dist/internal/data-view-32/data-view-32.js.map +1 -1
- package/dist/lit/elements/service-application.d.ts +9 -0
- package/dist/lit/elements/service-application.js +55 -0
- package/dist/lit/elements/service-application.js.map +1 -0
- package/dist/lit/elements/service-context.d.ts +1 -0
- package/dist/{ecs/entity/u32.js → lit/elements/service-context.js} +3 -3
- package/dist/lit/elements/service-context.js.map +1 -0
- package/dist/lit/elements/service-element.d.ts +6 -0
- package/dist/lit/elements/service-element.js +43 -0
- package/dist/lit/elements/service-element.js.map +1 -0
- package/dist/lit/hooks/index.d.ts +1 -0
- package/dist/lit/hooks/index.js +1 -0
- package/dist/lit/hooks/index.js.map +1 -1
- package/dist/lit/hooks/use-debounce.d.ts +8 -0
- package/dist/lit/hooks/use-debounce.js +41 -0
- package/dist/lit/hooks/use-debounce.js.map +1 -0
- package/dist/lit/hooks/use-drag-observe.d.ts +6 -5
- package/dist/lit/hooks/use-drag-observe.js +2 -2
- package/dist/lit/hooks/use-drag-observe.js.map +1 -1
- package/dist/lit/hooks/use-drag-transaction.d.ts +1 -1
- package/dist/lit/hooks/use-drag-transaction.js +1 -2
- package/dist/lit/hooks/use-drag-transaction.js.map +1 -1
- package/dist/lit/hooks/use-draggable.d.ts +5 -6
- package/dist/lit/hooks/use-draggable.js +23 -31
- package/dist/lit/hooks/use-draggable.js.map +1 -1
- package/dist/lit/hooks/use-effect.js +1 -1
- package/dist/lit/hooks/use-effect.js.map +1 -1
- package/dist/lit/hooks/use-resize-observer.d.ts +2 -0
- package/dist/lit/hooks/use-resize-observer.js +2 -0
- package/dist/lit/hooks/use-resize-observer.js.map +1 -1
- package/dist/lit/hooks/use-updated.js +21 -0
- package/dist/lit/hooks/use-updated.js.map +1 -1
- package/dist/math/aabb/aabb.js +1 -0
- package/dist/math/aabb/aabb.js.map +1 -1
- package/dist/math/aabb-face/aabb-face.d.ts +14 -19
- package/dist/math/aabb-face/aabb-face.js +31 -19
- package/dist/math/aabb-face/aabb-face.js.map +1 -1
- package/dist/math/f32/f32.js +1 -0
- package/dist/math/f32/f32.js.map +1 -1
- package/dist/math/i32/i32.js +1 -0
- package/dist/math/i32/i32.js.map +1 -1
- package/dist/math/line2/line2.js +1 -0
- package/dist/math/line2/line2.js.map +1 -1
- package/dist/math/line3/line3.js +1 -0
- package/dist/math/line3/line3.js.map +1 -1
- package/dist/math/mat4x4/mat4x4.js +1 -0
- package/dist/math/mat4x4/mat4x4.js.map +1 -1
- package/dist/math/picking/get-closest-entity-to-line.js +1 -1
- package/dist/math/picking/get-closest-entity-to-line.js.map +1 -1
- package/dist/math/picking/get-closest-entity-to-point.js +1 -1
- package/dist/math/picking/get-closest-entity-to-point.js.map +1 -1
- package/dist/math/picking/pick-from-tables.js +1 -1
- package/dist/math/picking/pick-from-tables.js.map +1 -1
- package/dist/math/picking/pick-result.d.ts +2 -4
- package/dist/math/plane/plane.js +1 -0
- package/dist/math/plane/plane.js.map +1 -1
- package/dist/math/quat/quat.js +1 -0
- package/dist/math/quat/quat.js.map +1 -1
- package/dist/math/u32/u32.js +1 -0
- package/dist/math/u32/u32.js.map +1 -1
- package/dist/math/vec2/vec2.js +1 -0
- package/dist/math/vec2/vec2.js.map +1 -1
- package/dist/math/vec3/vec3.d.ts +1 -0
- package/dist/math/vec3/vec3.js +2 -0
- package/dist/math/vec3/vec3.js.map +1 -1
- package/dist/math/vec4/vec4.d.ts +1 -0
- package/dist/math/vec4/vec4.js +7 -0
- package/dist/math/vec4/vec4.js.map +1 -1
- package/dist/observe/to-async-generator.test.js +5 -8
- package/dist/observe/to-async-generator.test.js.map +1 -1
- package/dist/observe/with-default.js +0 -1
- package/dist/observe/with-default.js.map +1 -1
- package/dist/old-ecs/action-ecs/action-ecs.test.js +1 -1
- package/dist/old-ecs/action-ecs/action-ecs.test.js.map +1 -1
- package/dist/old-ecs/core-ecs/core-ecs-serialization.test.js +4 -208
- package/dist/old-ecs/core-ecs/core-ecs-serialization.test.js.map +1 -1
- package/dist/old-ecs/core-ecs/core-ecs-types.d.ts +1 -4
- package/dist/old-ecs/core-ecs/core-ecs.d.ts +0 -2
- package/dist/old-ecs/core-ecs/core-ecs.js +9 -13
- package/dist/old-ecs/core-ecs/core-ecs.js.map +1 -1
- package/dist/old-ecs/ecs/ecs.test.js +1 -1
- package/dist/old-ecs/ecs/ecs.test.js.map +1 -1
- package/dist/old-ecs/transaction-ecs/transaction-ecs.test.js +1 -1
- package/dist/old-ecs/transaction-ecs/transaction-ecs.test.js.map +1 -1
- package/dist/samples/todo/elements/todo-list/todo-list-presentation.d.ts +0 -17
- package/dist/samples/todo/elements/todo-list/todo-list-presentation.js.map +1 -1
- package/dist/samples/todo/elements/todo-list/todo-list.css.d.ts +0 -17
- package/dist/samples/todo/elements/todo-list/todo-list.css.js +21 -17
- package/dist/samples/todo/elements/todo-list/todo-list.css.js.map +1 -1
- package/dist/samples/todo/elements/todo-list/todo-list.js +21 -17
- package/dist/samples/todo/elements/todo-list/todo-list.js.map +1 -1
- package/dist/samples/todo/elements/todo-row/index.d.ts +0 -17
- package/dist/samples/todo/elements/todo-row/index.js +21 -17
- package/dist/samples/todo/elements/todo-row/index.js.map +1 -1
- package/dist/samples/todo/elements/todo-row/todo-row-presentation.js +23 -19
- package/dist/samples/todo/elements/todo-row/todo-row-presentation.js.map +1 -1
- package/dist/samples/todo/elements/todo-row/todo-row.css.js +21 -17
- package/dist/samples/todo/elements/todo-row/todo-row.css.js.map +1 -1
- package/dist/samples/todo/elements/todo-row/todo-row.js +21 -17
- package/dist/samples/todo/elements/todo-row/todo-row.js.map +1 -1
- package/dist/samples/todo/elements/todo-toolbar/index.d.ts +0 -17
- package/dist/samples/todo/elements/todo-toolbar/index.js +21 -17
- package/dist/samples/todo/elements/todo-toolbar/index.js.map +1 -1
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js +21 -17
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js.map +1 -1
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.js +21 -17
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.js.map +1 -1
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js +21 -17
- package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +1 -1
- package/dist/samples/todo/elements/todo-undo-redo/index.d.ts +0 -17
- package/dist/samples/todo/elements/todo-undo-redo/index.js +21 -17
- package/dist/samples/todo/elements/todo-undo-redo/index.js.map +1 -1
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js +21 -17
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js.map +1 -1
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js +21 -17
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js.map +1 -1
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.js +21 -17
- package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.js +21 -17
- package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.d.ts +0 -17
- package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.d.ts +0 -17
- package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.d.ts +0 -17
- package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state/index.d.ts +0 -17
- package/dist/samples/todo/services/dependent-state-service/dependent-state/index.js +21 -17
- package/dist/samples/todo/services/dependent-state-service/dependent-state/index.js.map +1 -1
- package/dist/samples/todo/services/dependent-state-service/dependent-state-service.d.ts +0 -17
- package/dist/samples/todo/services/main-service/create-main-service.d.ts +0 -17
- package/dist/samples/todo/services/main-service/create-main-service.js.map +1 -1
- package/dist/samples/todo/services/main-service/todo-main-service.d.ts +0 -17
- package/dist/samples/todo/services/state-service/create-todo-database.js +21 -17
- package/dist/samples/todo/services/state-service/create-todo-database.js.map +1 -1
- package/dist/samples/todo/services/state-service/create-todo-store.js +21 -17
- package/dist/samples/todo/services/state-service/create-todo-store.js.map +1 -1
- package/dist/samples/todo/services/state-service/todo-state-service.d.ts +0 -17
- package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/create-todo.d.ts +0 -17
- package/dist/samples/todo/services/state-service/transactions/create-todo.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/create-todo.test.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/create-todo.test.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/delete-all-todos.d.ts +0 -17
- package/dist/samples/todo/services/state-service/transactions/delete-all-todos.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/delete-todo.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/delete-todo.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/delete-todo.test.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/delete-todo.test.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/drag-todo.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/drag-todo.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/index.d.ts +0 -17
- package/dist/samples/todo/services/state-service/transactions/index.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/index.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/reorder-todos.d.ts +0 -17
- package/dist/samples/todo/services/state-service/transactions/reorder-todos.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.d.ts +0 -17
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.js +21 -17
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.js.map +1 -1
- package/dist/samples/todo/todo-element.d.ts +0 -17
- package/dist/samples/todo/todo-element.js.map +1 -1
- package/dist/samples/todo/todo-main-element.d.ts +0 -17
- package/dist/samples/todo/todo-main-element.js +21 -17
- package/dist/samples/todo/todo-main-element.js.map +1 -1
- package/dist/schema/schema.d.ts +12 -15
- package/dist/schema/schema.js +2 -5
- package/dist/schema/schema.js.map +1 -1
- package/dist/service/index.d.ts +1 -1
- package/dist/service/index.js +1 -1
- package/dist/service/index.js.map +1 -1
- package/dist/table/table.js +1 -0
- package/dist/table/table.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typed-buffer/create-struct-buffer.js +0 -1
- package/dist/typed-buffer/create-struct-buffer.js.map +1 -1
- package/dist/typed-buffer/create-struct-buffer.test.js +5 -3
- package/dist/typed-buffer/create-struct-buffer.test.js.map +1 -1
- package/dist/typed-buffer/is-typed-buffer.js +21 -0
- package/dist/typed-buffer/is-typed-buffer.js.map +1 -1
- package/dist/typed-buffer/is-typed-buffer.test.js +21 -0
- package/dist/typed-buffer/is-typed-buffer.test.js.map +1 -1
- package/dist/typed-buffer/typed-buffer-equals.js +21 -0
- package/dist/typed-buffer/typed-buffer-equals.js.map +1 -1
- package/dist/types/replace.d.ts +0 -4
- package/dist/types/replace.js.map +1 -1
- package/package.json +1 -1
- package/dist/ecs/entity/entity.d.ts +0 -8
- package/dist/ecs/entity/entity.js +0 -3
- package/dist/ecs/entity/entity.js.map +0 -1
- package/dist/ecs/entity/u32.d.ts +0 -8
- package/dist/ecs/entity/u32.js.map +0 -1
- package/dist/math/aabb-face/face.d.ts +0 -51
- package/dist/math/aabb-face/face.js +0 -110
- package/dist/math/aabb-face/face.js.map +0 -1
- package/dist/math/aabb-face/face.test.d.ts +0 -1
- package/dist/math/aabb-face/face.test.js +0 -94
- package/dist/math/aabb-face/face.test.js.map +0 -1
- package/dist/math/box/box.d.ts +0 -50
- package/dist/math/box/box.js +0 -23
- package/dist/math/box/box.js.map +0 -1
- package/dist/math/face/face.d.ts +0 -51
- package/dist/math/face/face.js +0 -110
- package/dist/math/face/face.js.map +0 -1
- package/dist/math/face/face.test.d.ts +0 -1
- package/dist/math/face/face.test.js +0 -94
- package/dist/math/face/face.test.js.map +0 -1
- package/dist/math/picking/face.d.ts +0 -1
- package/dist/math/picking/face.js +0 -2
- package/dist/math/picking/face.js.map +0 -1
- package/dist/math/picking/getClosestEntityToLine.d.ts +0 -4
- package/dist/math/picking/getClosestEntityToLine.js +0 -29
- package/dist/math/picking/getClosestEntityToLine.js.map +0 -1
- package/dist/math/picking/getClosestEntityToPoint.d.ts +0 -4
- package/dist/math/picking/getClosestEntityToPoint.js +0 -27
- package/dist/math/picking/getClosestEntityToPoint.js.map +0 -1
- package/dist/math/picking/getIntersectingEntities.d.ts +0 -12
- package/dist/math/picking/getIntersectingEntities.js +0 -15
- package/dist/math/picking/getIntersectingEntities.js.map +0 -1
- package/dist/math/transform/debug-inverse.d.ts +0 -1
- package/dist/math/transform/debug-inverse.js +0 -28
- package/dist/math/transform/debug-inverse.js.map +0 -1
- package/dist/math/transform/debug-quat.d.ts +0 -1
- package/dist/math/transform/debug-quat.js +0 -23
- package/dist/math/transform/debug-quat.js.map +0 -1
- package/dist/math/transform/debug-test.d.ts +0 -1
- package/dist/math/transform/debug-test.js +0 -34
- package/dist/math/transform/debug-test.js.map +0 -1
- package/dist/math/transform/transform.d.ts +0 -58
- package/dist/math/transform/transform.js +0 -101
- package/dist/math/transform/transform.js.map +0 -1
- package/dist/math/transform/transform.test.d.ts +0 -1
- package/dist/math/transform/transform.test.js +0 -309
- package/dist/math/transform/transform.test.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,6 +11,11 @@ Adobe Data Oriented Programming Library
|
|
|
11
11
|
|
|
12
12
|
Until we reach 1.0.0, minor version changes may be API breaking.
|
|
13
13
|
|
|
14
|
+
## Data Oriented Programming
|
|
15
|
+
|
|
16
|
+
This library is built using a data oriented and functional programming paradigm.
|
|
17
|
+
We prefer composition over inheritance, avoid classes when possible and emphasize separation of concerns.
|
|
18
|
+
|
|
14
19
|
## Data
|
|
15
20
|
|
|
16
21
|
This library uses data oriented design paradigm and prefers pure functional interfaces whenever practical.
|
|
@@ -156,7 +161,7 @@ The `memoize` function can be used to cache expensive, deterministic, asynchrono
|
|
|
156
161
|
|
|
157
162
|
### BlobStore
|
|
158
163
|
|
|
159
|
-
It is important to handle `Blob`s correctly within an application.
|
|
164
|
+
It is important to handle `Blob`s correctly within an application.
|
|
160
165
|
|
|
161
166
|
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
167
|
|
|
@@ -165,7 +170,6 @@ The `BlobStore` interface and corresponding `blobStore` exported instance provid
|
|
|
165
170
|
`BlobRef`s have a number of advantages over directly using blobs.
|
|
166
171
|
`BlobRef`s are:
|
|
167
172
|
- small json objects
|
|
168
|
-
- use negligible memory since the `Blob` is stored on disc till needed.
|
|
169
173
|
- deterministic for each `Blob` based on mime type and content.
|
|
170
174
|
- suitable for persistence to locations with limited size.
|
|
171
175
|
- suitable for use as a cache key
|
|
@@ -179,132 +183,114 @@ Contains some standard data type schemas in JSON Schema format for convenience.
|
|
|
179
183
|
|
|
180
184
|
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
185
|
|
|
182
|
-
This library provides
|
|
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?
|
|
186
|
+
This library provides two main interfaces for ECS operations: **Store** and **Database**. They share the same read API but differ significantly in their approach to writing and observability.
|
|
198
187
|
|
|
199
|
-
|
|
188
|
+
### Store Interface
|
|
200
189
|
|
|
201
|
-
|
|
190
|
+
The **Store** is the foundational, low-level interface for direct ECS data operations.
|
|
202
191
|
|
|
203
|
-
|
|
192
|
+
**Key Characteristics:**
|
|
193
|
+
- **Direct Access**: Provides immediate, synchronous read/write access to entities, components, and resources
|
|
194
|
+
- **No Transaction Control**: Changes are applied directly without transaction boundaries
|
|
195
|
+
- **No Observability**: Changes are not automatically observable or trackable
|
|
196
|
+
- **High Performance**: Minimal overhead for direct operations using Structure of Arrays (SoA) with linear memory layout of numeric types for optimal cache performance
|
|
197
|
+
- **Core ECS Operations**: Includes entity creation, component updates, archetype querying, and resource management
|
|
204
198
|
|
|
205
|
-
|
|
199
|
+
**Usage**: Ideal for scenarios requiring fast, direct ECS manipulation where you don't need change tracking or transactional safety.
|
|
206
200
|
|
|
207
201
|
```typescript
|
|
208
|
-
//
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
position: Vector3Schema,
|
|
213
|
-
velocity: Vector3Schema,
|
|
214
|
-
color: Vector4Schema,
|
|
215
|
-
size: { type: "number" },
|
|
202
|
+
// Create a store with components, resources, and archetypes
|
|
203
|
+
const store = createStore(
|
|
204
|
+
{
|
|
205
|
+
position: Vec3.schema,
|
|
216
206
|
health: { type: "number" },
|
|
217
|
-
player: { const: true }
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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);
|
|
207
|
+
player: { const: true }
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
gravity: { default: 9.8 as number }
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
Player: ["position", "health", "player"],
|
|
214
|
+
Particle: ["position"]
|
|
262
215
|
}
|
|
263
|
-
|
|
216
|
+
);
|
|
264
217
|
|
|
218
|
+
// Direct operations
|
|
219
|
+
const playerId = store.archetypes.Player.insert({
|
|
220
|
+
position: [0, 0, 0],
|
|
221
|
+
health: 100,
|
|
222
|
+
player: true
|
|
223
|
+
});
|
|
224
|
+
store.update(playerId, { position: [1, 1, 1] });
|
|
225
|
+
store.resources.gravity = 10.0;
|
|
265
226
|
```
|
|
266
227
|
|
|
267
|
-
###
|
|
228
|
+
### Database Interface
|
|
229
|
+
|
|
230
|
+
The **Database** wraps a Store to provide **transaction-based operations** with **full observability**.
|
|
231
|
+
|
|
232
|
+
**Key Characteristics:**
|
|
233
|
+
- **Transaction-Based**: All changes must occur within predefined atomic transactions that can be undone.
|
|
234
|
+
- **Full Observability**: Every change is observable through the `observe` API
|
|
235
|
+
- **Predefined Operations**: Uses predefined transaction functions rather than direct mutations
|
|
236
|
+
- **Undo/Redo Support**: Transactions generate undo/redo operations automatically
|
|
237
|
+
- **Change Tracking**: Tracks which entities, components, and archetypes changed
|
|
238
|
+
- **Event Notifications**: Automatically notifies observers of changes
|
|
268
239
|
|
|
269
|
-
|
|
240
|
+
**Usage**: Ideal for applications requiring change history, multiplayer synchronization, undo/redo functionality, or reactive UI updates.
|
|
270
241
|
|
|
271
|
-
|
|
242
|
+
**Important Note**: Even when using a Database, transaction functions are written as direct modifications to the underlying Store interface. The Database wraps these operations to provide transactional guarantees and observability.
|
|
272
243
|
|
|
273
244
|
```typescript
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
size: { type: 'number' }, health: { type: 'number' }, player: { const: true },
|
|
283
|
-
gravity: {}
|
|
245
|
+
// Create a database with predefined transactions
|
|
246
|
+
const database = createDatabase(store, {
|
|
247
|
+
createPlayer(t, args: { position: Vector3, health: number }) {
|
|
248
|
+
// Transaction function receives Store interface for direct operations
|
|
249
|
+
return t.archetypes.Player.insert({
|
|
250
|
+
...args,
|
|
251
|
+
player: true
|
|
252
|
+
});
|
|
284
253
|
},
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
254
|
+
movePlayer(t, args: { entity: Entity, position: Vector3 }) {
|
|
255
|
+
// Direct Store operations within transaction context
|
|
256
|
+
t.update(args.entity, { position: args.position });
|
|
257
|
+
},
|
|
258
|
+
setGravity(t, gravity: number) {
|
|
259
|
+
// Direct resource modification within transaction
|
|
260
|
+
t.resources.gravity = gravity;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// Execute transactions (these provide observability and undo/redo)
|
|
265
|
+
const playerId = database.transactions.createPlayer({
|
|
266
|
+
position: [10, 20, 0],
|
|
267
|
+
health: 100
|
|
268
|
+
});
|
|
269
|
+
database.transactions.movePlayer({ entity: playerId, position: [15, 25, 5] });
|
|
270
|
+
|
|
271
|
+
// Observe all changes
|
|
272
|
+
database.observe.transactions((result) => {
|
|
273
|
+
console.log('Transaction applied:', result);
|
|
274
|
+
console.log('Changed entities:', result.changedEntities);
|
|
275
|
+
console.log('Undo operations:', result.undo);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
// Observe specific entities
|
|
279
|
+
database.observe.entity(playerId)((entityData) => {
|
|
280
|
+
if (entityData) {
|
|
281
|
+
console.log('Player moved to:', entityData.position);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
306
284
|
```
|
|
307
285
|
|
|
286
|
+
### What is an ECS?
|
|
287
|
+
|
|
288
|
+
Sanders Mertens also covers this thoroughly in his ECS FAQ:
|
|
289
|
+
|
|
290
|
+
[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)
|
|
291
|
+
|
|
292
|
+
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. You can think of them as a singleton Component.
|
|
293
|
+
|
|
308
294
|
## Performance Test
|
|
309
295
|
|
|
310
296
|
[Performance Test](https://git.corp.adobe.com/pages/neuralfiltersplatform/firefly-data/docs/perftest.html)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FromSchema } from "../schema/schema.js";
|
|
2
|
-
|
|
2
|
+
declare const BlobHandleSchema: {
|
|
3
3
|
readonly type: "object";
|
|
4
4
|
readonly properties: {
|
|
5
5
|
readonly handle: {
|
|
@@ -8,6 +8,12 @@ export declare const BlobHandleSchema: {
|
|
|
8
8
|
readonly expires: {
|
|
9
9
|
readonly type: "string";
|
|
10
10
|
};
|
|
11
|
+
readonly upload: {
|
|
12
|
+
readonly type: "boolean";
|
|
13
|
+
};
|
|
14
|
+
readonly download: {
|
|
15
|
+
readonly type: "boolean";
|
|
16
|
+
};
|
|
11
17
|
readonly type: {
|
|
12
18
|
readonly type: "string";
|
|
13
19
|
};
|
|
@@ -24,6 +30,51 @@ export declare const BlobHandleSchema: {
|
|
|
24
30
|
readonly type: "number";
|
|
25
31
|
};
|
|
26
32
|
};
|
|
27
|
-
readonly required: readonly ["type", "size", "handle"];
|
|
33
|
+
readonly required: readonly ["type", "size", "handle", "expires"];
|
|
28
34
|
};
|
|
29
35
|
export type BlobHandle = FromSchema<typeof BlobHandleSchema>;
|
|
36
|
+
export type UploadHandle = BlobHandle & {
|
|
37
|
+
upload: true;
|
|
38
|
+
};
|
|
39
|
+
export type DownloadHandle = BlobHandle & {
|
|
40
|
+
download: true;
|
|
41
|
+
};
|
|
42
|
+
export declare namespace BlobHandle {
|
|
43
|
+
const schema: {
|
|
44
|
+
readonly type: "object";
|
|
45
|
+
readonly properties: {
|
|
46
|
+
readonly handle: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
};
|
|
49
|
+
readonly expires: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
};
|
|
52
|
+
readonly upload: {
|
|
53
|
+
readonly type: "boolean";
|
|
54
|
+
};
|
|
55
|
+
readonly download: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
};
|
|
58
|
+
readonly type: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
};
|
|
61
|
+
readonly size: {
|
|
62
|
+
readonly type: "number";
|
|
63
|
+
};
|
|
64
|
+
readonly width: {
|
|
65
|
+
readonly type: "number";
|
|
66
|
+
};
|
|
67
|
+
readonly height: {
|
|
68
|
+
readonly type: "number";
|
|
69
|
+
};
|
|
70
|
+
readonly duration: {
|
|
71
|
+
readonly type: "number";
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly required: readonly ["type", "size", "handle", "expires"];
|
|
75
|
+
};
|
|
76
|
+
function is(value: unknown): value is BlobHandle;
|
|
77
|
+
function isUpload(value: unknown): value is UploadHandle;
|
|
78
|
+
function isDownload(value: unknown): value is DownloadHandle;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
package/dist/blob/blob-handle.js
CHANGED
|
@@ -1,11 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { BlobMeta } from "./blob-meta.js";
|
|
23
|
+
const BlobHandleSchema = {
|
|
3
24
|
type: 'object',
|
|
4
25
|
properties: {
|
|
5
|
-
...
|
|
26
|
+
...BlobMeta.schema.properties,
|
|
6
27
|
handle: { type: 'string' },
|
|
7
28
|
expires: { type: 'string' },
|
|
29
|
+
upload: { type: 'boolean' },
|
|
30
|
+
download: { type: 'boolean' },
|
|
8
31
|
},
|
|
9
|
-
required: [...
|
|
32
|
+
required: [...BlobMeta.schema.required, 'handle', 'expires'],
|
|
10
33
|
};
|
|
34
|
+
export var BlobHandle;
|
|
35
|
+
(function (BlobHandle) {
|
|
36
|
+
BlobHandle.schema = BlobHandleSchema;
|
|
37
|
+
function is(value) {
|
|
38
|
+
return (typeof value === 'object' &&
|
|
39
|
+
value !== null &&
|
|
40
|
+
'handle' in value &&
|
|
41
|
+
'expires' in value &&
|
|
42
|
+
typeof value.handle === 'string' &&
|
|
43
|
+
typeof value.expires === 'string');
|
|
44
|
+
}
|
|
45
|
+
BlobHandle.is = is;
|
|
46
|
+
function isUpload(value) {
|
|
47
|
+
return is(value) && 'upload' in value && value.upload === true;
|
|
48
|
+
}
|
|
49
|
+
BlobHandle.isUpload = isUpload;
|
|
50
|
+
function isDownload(value) {
|
|
51
|
+
return is(value) && 'download' in value && value.download === true;
|
|
52
|
+
}
|
|
53
|
+
BlobHandle.isDownload = isDownload;
|
|
54
|
+
})(BlobHandle || (BlobHandle = {}));
|
|
11
55
|
//# sourceMappingURL=blob-handle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob-handle.js","sourceRoot":"","sources":["../../src/blob/blob-handle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blob-handle.js","sourceRoot":"","sources":["../../src/blob/blob-handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,gBAAgB,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAChC;IACD,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;CACrC,CAAC;AAK5B,MAAM,KAAW,UAAU,CAkB1B;AAlBD,WAAiB,UAAU;IACV,iBAAM,GAAG,gBAAgB,CAAC;IACvC,SAAgB,EAAE,CAAC,KAAc;QAC7B,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACd,QAAQ,IAAI,KAAK;YACjB,SAAS,IAAI,KAAK;YAClB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAChC,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAC;IACN,CAAC;IATe,aAAE,KASjB,CAAA;IACD,SAAgB,QAAQ,CAAC,KAAc;QACnC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IACnE,CAAC;IAFe,mBAAQ,WAEvB,CAAA;IACD,SAAgB,UAAU,CAAC,KAAc;QACrC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;IACvE,CAAC;IAFe,qBAAU,aAEzB,CAAA;AACL,CAAC,EAlBgB,UAAU,KAAV,UAAU,QAkB1B"}
|
package/dist/blob/blob-meta.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FromSchema } from "../schema/schema.js";
|
|
2
|
-
|
|
2
|
+
declare const BlobMetaSchema: {
|
|
3
3
|
readonly type: "object";
|
|
4
4
|
readonly properties: {
|
|
5
5
|
readonly type: {
|
|
@@ -21,3 +21,28 @@ export declare const BlobMetaSchema: {
|
|
|
21
21
|
readonly required: readonly ["type", "size"];
|
|
22
22
|
};
|
|
23
23
|
export type BlobMeta = FromSchema<typeof BlobMetaSchema>;
|
|
24
|
+
export declare namespace BlobMeta {
|
|
25
|
+
const schema: {
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly type: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
};
|
|
31
|
+
readonly size: {
|
|
32
|
+
readonly type: "number";
|
|
33
|
+
};
|
|
34
|
+
readonly width: {
|
|
35
|
+
readonly type: "number";
|
|
36
|
+
};
|
|
37
|
+
readonly height: {
|
|
38
|
+
readonly type: "number";
|
|
39
|
+
};
|
|
40
|
+
readonly duration: {
|
|
41
|
+
readonly type: "number";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly required: readonly ["type", "size"];
|
|
45
|
+
};
|
|
46
|
+
function is(value: unknown): value is BlobMeta;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
package/dist/blob/blob-meta.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const BlobMetaSchema = {
|
|
2
2
|
type: 'object',
|
|
3
3
|
properties: {
|
|
4
4
|
type: { type: 'string' },
|
|
@@ -9,4 +9,17 @@ export const BlobMetaSchema = {
|
|
|
9
9
|
},
|
|
10
10
|
required: ['type', 'size'],
|
|
11
11
|
};
|
|
12
|
+
export var BlobMeta;
|
|
13
|
+
(function (BlobMeta) {
|
|
14
|
+
BlobMeta.schema = BlobMetaSchema;
|
|
15
|
+
function is(value) {
|
|
16
|
+
return (typeof value === 'object' &&
|
|
17
|
+
value !== null &&
|
|
18
|
+
'type' in value &&
|
|
19
|
+
'size' in value &&
|
|
20
|
+
typeof value.type === 'string' &&
|
|
21
|
+
typeof value.size === 'number');
|
|
22
|
+
}
|
|
23
|
+
BlobMeta.is = is;
|
|
24
|
+
})(BlobMeta || (BlobMeta = {}));
|
|
12
25
|
//# sourceMappingURL=blob-meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob-meta.js","sourceRoot":"","sources":["../../src/blob/blob-meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blob-meta.js","sourceRoot":"","sources":["../../src/blob/blob-meta.ts"],"names":[],"mappings":"AAuBA,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;CACH,CAAC;AAG5B,MAAM,KAAW,QAAQ,CAYxB;AAZD,WAAiB,QAAQ;IACR,eAAM,GAAG,cAAc,CAAC;IACrC,SAAgB,EAAE,CAAC,KAAc;QAC7B,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACd,MAAM,IAAI,KAAK;YACf,MAAM,IAAI,KAAK;YACf,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;YAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CACjC,CAAC;IACN,CAAC;IATe,WAAE,KASjB,CAAA;AACL,CAAC,EAZgB,QAAQ,KAAR,QAAQ,QAYxB"}
|
package/dist/blob/index.d.ts
CHANGED
package/dist/blob/index.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
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.*/
|
|
1
22
|
export * from "./blob-handle.js";
|
|
2
23
|
export * from "./blob-meta.js";
|
|
3
|
-
export * from "./download-handle.js";
|
|
4
|
-
export * from "./upload-handle.js";
|
|
5
24
|
//# sourceMappingURL=index.js.map
|
package/dist/blob/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -42,11 +42,13 @@ export async function blobToHash(blob) {
|
|
|
42
42
|
const writer = digestStream.writable.getWriter();
|
|
43
43
|
await writer.write(tBytes);
|
|
44
44
|
const reader = blob.stream().getReader();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
let done = false;
|
|
46
|
+
while (!done) {
|
|
47
|
+
const result = await reader.read();
|
|
48
|
+
done = result.done;
|
|
49
|
+
if (!done) {
|
|
50
|
+
await writer.write(result.value);
|
|
51
|
+
}
|
|
50
52
|
}
|
|
51
53
|
await writer.close();
|
|
52
54
|
const hashBuf = await digestStream.digest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob-to-hash.js","sourceRoot":"","sources":["../../../../src/cache/functions/hashing/blob-to-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAU;IACzC,sBAAsB;IACtB,IAAI,cAAc,IAAI,MAAM,EAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,IAAK,MAAc,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAEjE,mCAAmC;QACnC,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;YAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,wCAAwC;QACxC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QACjD,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC;QACzC,
|
|
1
|
+
{"version":3,"file":"blob-to-hash.js","sourceRoot":"","sources":["../../../../src/cache/functions/hashing/blob-to-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAU;IACzC,sBAAsB;IACtB,IAAI,cAAc,IAAI,MAAM,EAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,IAAK,MAAc,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAEjE,mCAAmC;QACnC,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;YAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,wCAAwC;QACxC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QACjD,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,IAAI,GAAG,KAAK,CAAC;QACjB,OAAO,CAAC,IAAI,EAAE,CAAC;YACb,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACnB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAM,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QACD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QAErB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC;QAC1C,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,iBAAiB;IACjB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IACtB,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAE3D,mEAAmE;IACnE,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAEvE,wBAAwB;IACxB,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IACjD,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,eAAe,CAAC,EAAE,cAAc,CAAC,CAAC;IAE9D,2BAA2B;IAC3B,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
|