@farukada/aws-langgraph-dynamodb-ts 1.0.0-rc.2 → 1.0.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 +390 -193
- package/dist/{backfill → cjs/backfill}/backfill.d.ts +15 -12
- package/dist/cjs/backfill/backfill.js +177 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/delete-thread.d.ts +1 -1
- package/dist/cjs/checkpointer/actions/delete-thread.js +26 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/get-tuple.d.ts +4 -3
- package/dist/cjs/checkpointer/actions/get-tuple.js +22 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/list.d.ts +7 -4
- package/dist/cjs/checkpointer/actions/list.js +70 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/put-writes.d.ts +8 -6
- package/dist/cjs/checkpointer/actions/put-writes.js +21 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/put.d.ts +21 -15
- package/dist/cjs/checkpointer/actions/put.js +79 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/delta-history.d.ts +38 -26
- package/dist/cjs/checkpointer/internal/delta-history.js +131 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/listing.d.ts +4 -4
- package/dist/cjs/checkpointer/internal/listing.js +104 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/parse.d.ts +51 -15
- package/dist/cjs/checkpointer/internal/parse.js +184 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/pending-writes.d.ts +64 -25
- package/dist/cjs/checkpointer/internal/pending-writes.js +241 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/read.d.ts +15 -10
- package/dist/cjs/checkpointer/internal/read.js +132 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/rows.d.ts +94 -21
- package/dist/cjs/checkpointer/internal/rows.js +356 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/setup.d.ts +13 -20
- package/dist/cjs/checkpointer/internal/setup.js +25 -0
- package/dist/{checkpointer → cjs/checkpointer}/saver.d.ts +72 -36
- package/dist/cjs/checkpointer/saver.js +56 -0
- package/dist/{checkpointer → cjs/checkpointer}/types.d.ts +1 -1
- package/dist/cjs/checkpointer/types.js +2 -0
- package/dist/{factory → cjs/factory}/factory.d.ts +25 -20
- package/dist/cjs/factory/factory.js +137 -0
- package/dist/{factory → cjs/factory}/types.d.ts +12 -12
- package/dist/cjs/factory/types.js +2 -0
- package/dist/{history → cjs/history}/actions/add-messages.d.ts +18 -10
- package/dist/cjs/history/actions/add-messages.js +17 -0
- package/dist/{history → cjs/history}/actions/clear.d.ts +1 -1
- package/dist/cjs/history/actions/clear.js +29 -0
- package/dist/{history → cjs/history}/actions/get-messages.d.ts +11 -9
- package/dist/cjs/history/actions/get-messages.js +58 -0
- package/dist/{history → cjs/history}/actions/list-sessions.d.ts +3 -3
- package/dist/cjs/history/actions/list-sessions.js +67 -0
- package/dist/{history → cjs/history}/actions/reconcile-count.d.ts +13 -9
- package/dist/cjs/history/actions/reconcile-count.js +8 -0
- package/dist/{history → cjs/history}/chat-message-history.d.ts +62 -30
- package/dist/cjs/history/chat-message-history.js +61 -0
- package/dist/{history → cjs/history}/internal/append.d.ts +64 -32
- package/dist/cjs/history/internal/append.js +267 -0
- package/dist/{history → cjs/history}/internal/message-read.d.ts +3 -3
- package/dist/cjs/history/internal/message-read.js +93 -0
- package/dist/{history → cjs/history}/internal/parse.d.ts +2 -2
- package/dist/cjs/history/internal/parse.js +113 -0
- package/dist/{history → cjs/history}/internal/rows.d.ts +11 -10
- package/dist/cjs/history/internal/rows.js +96 -0
- package/dist/{history → cjs/history}/internal/session.d.ts +41 -22
- package/dist/cjs/history/internal/session.js +296 -0
- package/dist/{history → cjs/history}/internal/setup.d.ts +2 -2
- package/dist/cjs/history/internal/setup.js +60 -0
- package/dist/{history → cjs/history}/session-adapter.d.ts +0 -6
- package/dist/cjs/history/session-adapter.js +38 -0
- package/dist/{history → cjs/history}/types.d.ts +18 -15
- package/dist/cjs/history/types.js +2 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +27 -27
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/package.json +1 -0
- package/dist/{shared → cjs/shared}/adapter.d.ts +27 -16
- package/dist/cjs/shared/adapter.js +70 -0
- package/dist/cjs/shared/clock.js +14 -0
- package/dist/{shared → cjs/shared}/codec/codec.d.ts +37 -20
- package/dist/cjs/shared/codec/codec.js +162 -0
- package/dist/{shared → cjs/shared}/codec/compression.d.ts +9 -4
- package/dist/cjs/shared/codec/compression.js +45 -0
- package/dist/cjs/shared/codec/json-serde.js +58 -0
- package/dist/{shared → cjs/shared}/codec/s3/client-types.d.ts +2 -1
- package/dist/cjs/shared/codec/s3/client-types.js +6 -0
- package/dist/{shared → cjs/shared}/codec/s3/client.d.ts +25 -7
- package/dist/cjs/shared/codec/s3/client.js +78 -0
- package/dist/{shared → cjs/shared}/codec/s3/config.d.ts +12 -7
- package/dist/cjs/shared/codec/s3/config.js +92 -0
- package/dist/{shared → cjs/shared}/codec/s3/lifecycle.d.ts +71 -17
- package/dist/cjs/shared/codec/s3/lifecycle.js +223 -0
- package/dist/{shared → cjs/shared}/codec/s3/offloader.d.ts +42 -29
- package/dist/cjs/shared/codec/s3/offloader.js +289 -0
- package/dist/cjs/shared/concurrency.js +31 -0
- package/dist/{shared → cjs/shared}/dynamodb/abort.d.ts +2 -2
- package/dist/cjs/shared/dynamodb/abort.js +16 -0
- package/dist/{shared → cjs/shared}/dynamodb/batch-write.d.ts +2 -2
- package/dist/cjs/shared/dynamodb/batch-write.js +79 -0
- package/dist/cjs/shared/dynamodb/cancellation.js +37 -0
- package/dist/{shared → cjs/shared}/dynamodb/client.d.ts +24 -22
- package/dist/cjs/shared/dynamodb/client.js +40 -0
- package/dist/{shared → cjs/shared}/dynamodb/idempotent-write.d.ts +64 -19
- package/dist/cjs/shared/dynamodb/idempotent-write.js +173 -0
- package/dist/{shared → cjs/shared}/dynamodb/paginate.d.ts +2 -2
- package/dist/cjs/shared/dynamodb/paginate.js +90 -0
- package/dist/{shared → cjs/shared}/dynamodb/partition-delete.d.ts +6 -6
- package/dist/cjs/shared/dynamodb/partition-delete.js +177 -0
- package/dist/{shared → cjs/shared}/dynamodb/recency-index.d.ts +27 -15
- package/dist/cjs/shared/dynamodb/recency-index.js +146 -0
- package/dist/{shared → cjs/shared}/dynamodb/retry.d.ts +37 -6
- package/dist/cjs/shared/dynamodb/retry.js +193 -0
- package/dist/cjs/shared/dynamodb/row-size.d.ts +33 -0
- package/dist/cjs/shared/dynamodb/row-size.js +30 -0
- package/dist/{shared → cjs/shared}/dynamodb/table-schema.d.ts +27 -18
- package/dist/cjs/shared/dynamodb/table-schema.js +52 -0
- package/dist/{shared → cjs/shared}/errors/base-error.d.ts +42 -7
- package/dist/cjs/shared/errors/base-error.js +73 -0
- package/dist/{shared → cjs/shared}/errors/boundary.d.ts +29 -14
- package/dist/cjs/shared/errors/boundary.js +61 -0
- package/dist/cjs/shared/errors/classify.d.ts +206 -0
- package/dist/cjs/shared/errors/classify.js +232 -0
- package/dist/{shared → cjs/shared}/errors/error-code.d.ts +17 -10
- package/dist/cjs/shared/errors/error-code.js +27 -0
- package/dist/{shared → cjs/shared}/errors/errors.d.ts +75 -9
- package/dist/cjs/shared/errors/errors.js +123 -0
- package/dist/cjs/shared/logging/logger.js +30 -0
- package/dist/{shared → cjs/shared}/logging/redaction.d.ts +8 -4
- package/dist/cjs/shared/logging/redaction.js +145 -0
- package/dist/{shared → cjs/shared}/logging/secret-patterns.d.ts +30 -7
- package/dist/cjs/shared/logging/secret-patterns.js +93 -0
- package/dist/cjs/shared/logging/truncate.js +31 -0
- package/dist/{shared → cjs/shared}/options.d.ts +27 -11
- package/dist/cjs/shared/options.js +2 -0
- package/dist/cjs/shared/ulid.js +83 -0
- package/dist/{shared → cjs/shared}/validation/collaborators.d.ts +21 -2
- package/dist/cjs/shared/validation/collaborators.js +79 -0
- package/dist/{shared → cjs/shared}/validation/option-shape.d.ts +7 -5
- package/dist/cjs/shared/validation/option-shape.js +31 -0
- package/dist/{shared → cjs/shared}/validation/options.d.ts +4 -4
- package/dist/cjs/shared/validation/options.js +166 -0
- package/dist/cjs/shared/validation/primitives.js +114 -0
- package/dist/{shared → cjs/shared}/validation/ttl.d.ts +26 -9
- package/dist/cjs/shared/validation/ttl.js +52 -0
- package/dist/{store → cjs/store}/actions/list-namespaces.d.ts +5 -5
- package/dist/cjs/store/actions/list-namespaces.js +92 -0
- package/dist/{store → cjs/store}/actions/put.d.ts +11 -4
- package/dist/cjs/store/actions/put.js +49 -0
- package/dist/{store → cjs/store}/actions/reconcile-vector-index.d.ts +5 -5
- package/dist/cjs/store/actions/reconcile-vector-index.js +13 -0
- package/dist/{store → cjs/store}/actions/search.d.ts +2 -2
- package/dist/cjs/store/actions/search.js +26 -0
- package/dist/cjs/store/internal/batch-plan.d.ts +56 -0
- package/dist/cjs/store/internal/batch-plan.js +32 -0
- package/dist/{store → cjs/store}/internal/filter.d.ts +3 -3
- package/dist/cjs/store/internal/filter.js +64 -0
- package/dist/cjs/store/internal/get-item.d.ts +77 -0
- package/dist/cjs/store/internal/get-item.js +58 -0
- package/dist/{store → cjs/store}/internal/item-write.d.ts +72 -32
- package/dist/cjs/store/internal/item-write.js +181 -0
- package/dist/{store → cjs/store}/internal/parse.d.ts +15 -10
- package/dist/cjs/store/internal/parse.js +180 -0
- package/dist/{store → cjs/store}/internal/rows.d.ts +38 -34
- package/dist/cjs/store/internal/rows.js +166 -0
- package/dist/{store → cjs/store}/internal/semantic-search.d.ts +2 -2
- package/dist/cjs/store/internal/semantic-search.js +211 -0
- package/dist/{store → cjs/store}/internal/setup.d.ts +10 -15
- package/dist/cjs/store/internal/setup.js +103 -0
- package/dist/{store → cjs/store}/internal/table-search.d.ts +5 -5
- package/dist/cjs/store/internal/table-search.js +123 -0
- package/dist/{store → cjs/store}/internal/vector-index.d.ts +26 -15
- package/dist/cjs/store/internal/vector-index.js +269 -0
- package/dist/{store → cjs/store}/store.d.ts +82 -39
- package/dist/cjs/store/store.js +97 -0
- package/dist/{store → cjs/store}/types.d.ts +25 -10
- package/dist/cjs/store/types.js +2 -0
- package/dist/cjs/store/vector-backend.js +4 -0
- package/dist/esm/backfill/backfill.d.ts +171 -0
- package/dist/esm/backfill/backfill.js +170 -0
- package/dist/{checkpointer/actions/delete-thread.js → esm/checkpointer/actions/delete-thread.d.ts} +4 -26
- package/dist/esm/checkpointer/actions/delete-thread.js +23 -0
- package/dist/{checkpointer/actions/get-tuple.js → esm/checkpointer/actions/get-tuple.d.ts} +7 -24
- package/dist/esm/checkpointer/actions/get-tuple.js +19 -0
- package/dist/esm/checkpointer/actions/list.d.ts +55 -0
- package/dist/esm/checkpointer/actions/list.js +67 -0
- package/dist/{checkpointer/actions/put-writes.js → esm/checkpointer/actions/put-writes.d.ts} +10 -37
- package/dist/esm/checkpointer/actions/put-writes.js +18 -0
- package/dist/esm/checkpointer/actions/put.d.ts +95 -0
- package/dist/esm/checkpointer/actions/put.js +75 -0
- package/dist/esm/checkpointer/internal/delta-history.d.ts +124 -0
- package/dist/esm/checkpointer/internal/delta-history.js +126 -0
- package/dist/{checkpointer/internal/listing.js → esm/checkpointer/internal/listing.d.ts} +22 -118
- package/dist/esm/checkpointer/internal/listing.js +95 -0
- package/dist/esm/checkpointer/internal/parse.d.ts +298 -0
- package/dist/esm/checkpointer/internal/parse.js +169 -0
- package/dist/esm/checkpointer/internal/pending-writes.d.ts +314 -0
- package/dist/esm/checkpointer/internal/pending-writes.js +229 -0
- package/dist/esm/checkpointer/internal/read.d.ts +135 -0
- package/dist/esm/checkpointer/internal/read.js +125 -0
- package/dist/esm/checkpointer/internal/rows.d.ts +644 -0
- package/dist/esm/checkpointer/internal/rows.js +323 -0
- package/dist/esm/checkpointer/internal/setup.d.ts +47 -0
- package/dist/esm/checkpointer/internal/setup.js +21 -0
- package/dist/{checkpointer/saver.js → esm/checkpointer/saver.d.ts} +84 -87
- package/dist/esm/checkpointer/saver.js +52 -0
- package/dist/esm/checkpointer/types.d.ts +51 -0
- package/dist/esm/checkpointer/types.js +1 -0
- package/dist/esm/factory/factory.d.ts +154 -0
- package/dist/esm/factory/factory.js +133 -0
- package/dist/esm/factory/types.d.ts +76 -0
- package/dist/esm/factory/types.js +1 -0
- package/dist/{history/actions/add-messages.js → esm/history/actions/add-messages.d.ts} +20 -26
- package/dist/esm/history/actions/add-messages.js +14 -0
- package/dist/{history/actions/clear.js → esm/history/actions/clear.d.ts} +4 -35
- package/dist/esm/history/actions/clear.js +26 -0
- package/dist/esm/history/actions/get-messages.d.ts +60 -0
- package/dist/esm/history/actions/get-messages.js +55 -0
- package/dist/esm/history/actions/list-sessions.d.ts +55 -0
- package/dist/esm/history/actions/list-sessions.js +64 -0
- package/dist/{history/actions/reconcile-count.js → esm/history/actions/reconcile-count.d.ts} +14 -16
- package/dist/esm/history/actions/reconcile-count.js +5 -0
- package/dist/{history/chat-message-history.js → esm/history/chat-message-history.d.ts} +76 -87
- package/dist/esm/history/chat-message-history.js +57 -0
- package/dist/esm/history/internal/append.d.ts +244 -0
- package/dist/esm/history/internal/append.js +259 -0
- package/dist/esm/history/internal/message-read.d.ts +84 -0
- package/dist/esm/history/internal/message-read.js +89 -0
- package/dist/esm/history/internal/parse.d.ts +153 -0
- package/dist/esm/history/internal/parse.js +105 -0
- package/dist/{history/internal/rows.js → esm/history/internal/rows.d.ts} +58 -112
- package/dist/esm/history/internal/rows.js +83 -0
- package/dist/esm/history/internal/session.d.ts +350 -0
- package/dist/esm/history/internal/session.js +285 -0
- package/dist/esm/history/internal/setup.d.ts +64 -0
- package/dist/esm/history/internal/setup.js +56 -0
- package/dist/{history/session-adapter.js → esm/history/session-adapter.d.ts} +25 -39
- package/dist/esm/history/session-adapter.js +34 -0
- package/dist/esm/history/types.d.ts +102 -0
- package/dist/esm/history/types.js +1 -0
- package/dist/esm/index.d.ts +53 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/shared/adapter.d.ts +146 -0
- package/dist/esm/shared/adapter.js +65 -0
- package/dist/{shared/clock.js → esm/shared/clock.d.ts} +3 -14
- package/dist/esm/shared/clock.js +9 -0
- package/dist/esm/shared/codec/codec.d.ts +336 -0
- package/dist/esm/shared/codec/codec.js +150 -0
- package/dist/esm/shared/codec/compression.d.ts +66 -0
- package/dist/esm/shared/codec/compression.js +40 -0
- package/dist/esm/shared/codec/json-serde.d.ts +80 -0
- package/dist/esm/shared/codec/json-serde.js +54 -0
- package/dist/esm/shared/codec/s3/client-types.d.ts +54 -0
- package/dist/esm/shared/codec/s3/client-types.js +3 -0
- package/dist/esm/shared/codec/s3/client.d.ts +63 -0
- package/dist/esm/shared/codec/s3/client.js +40 -0
- package/dist/{shared/codec/s3/config.js → esm/shared/codec/s3/config.d.ts} +45 -93
- package/dist/esm/shared/codec/s3/config.js +79 -0
- package/dist/esm/shared/codec/s3/lifecycle.d.ts +220 -0
- package/dist/esm/shared/codec/s3/lifecycle.js +214 -0
- package/dist/esm/shared/codec/s3/offloader.d.ts +428 -0
- package/dist/esm/shared/codec/s3/offloader.js +278 -0
- package/dist/{shared/concurrency.js → esm/shared/concurrency.d.ts} +2 -37
- package/dist/esm/shared/concurrency.js +27 -0
- package/dist/{shared/dynamodb/abort.js → esm/shared/dynamodb/abort.d.ts} +4 -16
- package/dist/esm/shared/dynamodb/abort.js +12 -0
- package/dist/esm/shared/dynamodb/batch-write.d.ts +86 -0
- package/dist/esm/shared/dynamodb/batch-write.js +74 -0
- package/dist/{shared/dynamodb/cancellation.js → esm/shared/dynamodb/cancellation.d.ts} +25 -53
- package/dist/esm/shared/dynamodb/cancellation.js +30 -0
- package/dist/{shared/dynamodb/client.js → esm/shared/dynamodb/client.d.ts} +74 -64
- package/dist/esm/shared/dynamodb/client.js +35 -0
- package/dist/{shared/dynamodb/idempotent-write.js → esm/shared/dynamodb/idempotent-write.d.ts} +172 -169
- package/dist/esm/shared/dynamodb/idempotent-write.js +153 -0
- package/dist/esm/shared/dynamodb/paginate.d.ts +111 -0
- package/dist/esm/shared/dynamodb/paginate.js +84 -0
- package/dist/esm/shared/dynamodb/partition-delete.d.ts +204 -0
- package/dist/esm/shared/dynamodb/partition-delete.js +171 -0
- package/dist/esm/shared/dynamodb/recency-index.d.ts +243 -0
- package/dist/esm/shared/dynamodb/recency-index.js +136 -0
- package/dist/esm/shared/dynamodb/retry.d.ts +317 -0
- package/dist/esm/shared/dynamodb/retry.js +180 -0
- package/dist/esm/shared/dynamodb/row-size.d.ts +33 -0
- package/dist/esm/shared/dynamodb/row-size.js +26 -0
- package/dist/{shared/dynamodb/table-schema.js → esm/shared/dynamodb/table-schema.d.ts} +57 -67
- package/dist/esm/shared/dynamodb/table-schema.js +43 -0
- package/dist/esm/shared/errors/base-error.d.ts +231 -0
- package/dist/esm/shared/errors/base-error.js +64 -0
- package/dist/esm/shared/errors/boundary.d.ts +86 -0
- package/dist/esm/shared/errors/boundary.js +54 -0
- package/dist/esm/shared/errors/classify.d.ts +206 -0
- package/dist/esm/shared/errors/classify.js +220 -0
- package/dist/{shared/errors/error-code.js → esm/shared/errors/error-code.d.ts} +39 -43
- package/dist/esm/shared/errors/error-code.js +24 -0
- package/dist/{shared/errors/errors.js → esm/shared/errors/errors.d.ts} +92 -98
- package/dist/esm/shared/errors/errors.js +110 -0
- package/dist/{shared/logging/logger.js → esm/shared/logging/logger.d.ts} +22 -52
- package/dist/esm/shared/logging/logger.js +25 -0
- package/dist/esm/shared/logging/redaction.d.ts +123 -0
- package/dist/esm/shared/logging/redaction.js +140 -0
- package/dist/{shared/logging/secret-patterns.js → esm/shared/logging/secret-patterns.d.ts} +46 -87
- package/dist/esm/shared/logging/secret-patterns.js +83 -0
- package/dist/{shared/logging/truncate.js → esm/shared/logging/truncate.d.ts} +6 -40
- package/dist/esm/shared/logging/truncate.js +25 -0
- package/dist/esm/shared/options.d.ts +100 -0
- package/dist/esm/shared/options.js +1 -0
- package/dist/{shared/ulid.js → esm/shared/ulid.d.ts} +4 -84
- package/dist/esm/shared/ulid.js +77 -0
- package/dist/{shared/validation/collaborators.js → esm/shared/validation/collaborators.d.ts} +37 -65
- package/dist/esm/shared/validation/collaborators.js +70 -0
- package/dist/{shared/validation/option-shape.js → esm/shared/validation/option-shape.d.ts} +14 -36
- package/dist/esm/shared/validation/option-shape.js +24 -0
- package/dist/esm/shared/validation/options.d.ts +145 -0
- package/dist/esm/shared/validation/options.js +156 -0
- package/dist/{shared/validation/primitives.js → esm/shared/validation/primitives.d.ts} +30 -125
- package/dist/esm/shared/validation/primitives.js +100 -0
- package/dist/esm/shared/validation/ttl.d.ts +94 -0
- package/dist/esm/shared/validation/ttl.js +46 -0
- package/dist/esm/store/actions/list-namespaces.d.ts +79 -0
- package/dist/esm/store/actions/list-namespaces.js +86 -0
- package/dist/esm/store/actions/put.d.ts +43 -0
- package/dist/esm/store/actions/put.js +46 -0
- package/dist/{store/actions/reconcile-vector-index.js → esm/store/actions/reconcile-vector-index.d.ts} +8 -16
- package/dist/esm/store/actions/reconcile-vector-index.js +10 -0
- package/dist/esm/store/actions/search.d.ts +38 -0
- package/dist/esm/store/actions/search.js +23 -0
- package/dist/esm/store/internal/batch-plan.d.ts +56 -0
- package/dist/esm/store/internal/batch-plan.js +28 -0
- package/dist/esm/store/internal/filter.d.ts +43 -0
- package/dist/esm/store/internal/filter.js +60 -0
- package/dist/esm/store/internal/get-item.d.ts +77 -0
- package/dist/esm/store/internal/get-item.js +54 -0
- package/dist/esm/store/internal/item-write.d.ts +270 -0
- package/dist/esm/store/internal/item-write.js +173 -0
- package/dist/esm/store/internal/parse.d.ts +230 -0
- package/dist/esm/store/internal/parse.js +169 -0
- package/dist/{store/internal/rows.js → esm/store/internal/rows.d.ts} +111 -199
- package/dist/esm/store/internal/rows.js +147 -0
- package/dist/esm/store/internal/semantic-search.d.ts +168 -0
- package/dist/esm/store/internal/semantic-search.js +200 -0
- package/dist/esm/store/internal/setup.d.ts +96 -0
- package/dist/esm/store/internal/setup.js +98 -0
- package/dist/esm/store/internal/table-search.d.ts +100 -0
- package/dist/esm/store/internal/table-search.js +119 -0
- package/dist/esm/store/internal/vector-index.d.ts +258 -0
- package/dist/esm/store/internal/vector-index.js +256 -0
- package/dist/{store/store.js → esm/store/store.d.ts} +99 -133
- package/dist/esm/store/store.js +93 -0
- package/dist/esm/store/types.d.ts +111 -0
- package/dist/esm/store/types.js +1 -0
- package/dist/esm/store/vector-backend.d.ts +104 -0
- package/dist/esm/store/vector-backend.js +1 -0
- package/package.json +50 -44
- package/dist/backfill/backfill.js +0 -393
- package/dist/checkpointer/actions/list.js +0 -142
- package/dist/checkpointer/actions/put.js +0 -195
- package/dist/checkpointer/internal/delta-history.js +0 -252
- package/dist/checkpointer/internal/parse.js +0 -372
- package/dist/checkpointer/internal/pending-writes.js +0 -588
- package/dist/checkpointer/internal/read.js +0 -264
- package/dist/checkpointer/internal/rows.js +0 -834
- package/dist/checkpointer/internal/setup.js +0 -72
- package/dist/checkpointer/types.js +0 -12
- package/dist/factory/factory.js +0 -266
- package/dist/factory/types.js +0 -10
- package/dist/history/actions/get-messages.js +0 -141
- package/dist/history/actions/list-sessions.js +0 -156
- package/dist/history/internal/append.js +0 -500
- package/dist/history/internal/message-read.js +0 -204
- package/dist/history/internal/parse.js +0 -252
- package/dist/history/internal/session.js +0 -628
- package/dist/history/internal/setup.js +0 -106
- package/dist/history/types.js +0 -12
- package/dist/index.js +0 -51
- package/dist/shared/adapter.js +0 -143
- package/dist/shared/codec/codec.js +0 -441
- package/dist/shared/codec/compression.js +0 -89
- package/dist/shared/codec/json-serde.js +0 -191
- package/dist/shared/codec/s3/client-types.js +0 -26
- package/dist/shared/codec/s3/client.js +0 -97
- package/dist/shared/codec/s3/lifecycle.js +0 -355
- package/dist/shared/codec/s3/offloader.js +0 -658
- package/dist/shared/dynamodb/batch-write.js +0 -173
- package/dist/shared/dynamodb/paginate.js +0 -188
- package/dist/shared/dynamodb/partition-delete.js +0 -340
- package/dist/shared/dynamodb/recency-index.js +0 -377
- package/dist/shared/dynamodb/retry.js +0 -463
- package/dist/shared/errors/base-error.js +0 -174
- package/dist/shared/errors/boundary.js +0 -143
- package/dist/shared/errors/classify.d.ts +0 -97
- package/dist/shared/errors/classify.js +0 -257
- package/dist/shared/logging/redaction.js +0 -316
- package/dist/shared/options.js +0 -11
- package/dist/shared/validation/options.js +0 -328
- package/dist/shared/validation/ttl.js +0 -132
- package/dist/store/actions/list-namespaces.js +0 -197
- package/dist/store/actions/put.js +0 -78
- package/dist/store/actions/search.js +0 -66
- package/dist/store/internal/batch-plan.d.ts +0 -26
- package/dist/store/internal/batch-plan.js +0 -109
- package/dist/store/internal/filter.js +0 -137
- package/dist/store/internal/get-item.d.ts +0 -45
- package/dist/store/internal/get-item.js +0 -115
- package/dist/store/internal/item-write.js +0 -463
- package/dist/store/internal/parse.js +0 -350
- package/dist/store/internal/semantic-search.js +0 -389
- package/dist/store/internal/setup.js +0 -223
- package/dist/store/internal/table-search.js +0 -213
- package/dist/store/internal/vector-index.js +0 -546
- package/dist/store/types.js +0 -15
- package/dist/store/vector-backend.js +0 -17
- /package/dist/{shared → cjs/shared}/clock.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/codec/json-serde.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/concurrency.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/dynamodb/cancellation.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/logging/logger.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/logging/truncate.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/ulid.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/validation/primitives.d.ts +0 -0
- /package/dist/{store → cjs/store}/vector-backend.d.ts +0 -0
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Hides which options the history and its methods accept, and how the history
|
|
4
|
-
* is assembled from them.
|
|
5
|
-
*
|
|
6
|
-
* The exhaustive key list of every option bag — the constructor's,
|
|
7
|
-
* `getMessages`', `listSessions`' — lives here, compiler-checked against its
|
|
8
|
-
* type, beside the code that resolves the constructor's options into the
|
|
9
|
-
* context every action receives.
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LIST_SESSIONS_KEYS = exports.GET_MESSAGES_KEYS = exports.HISTORY_KEYS = exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = void 0;
|
|
13
|
-
exports.setUpHistory = setUpHistory;
|
|
14
|
-
const adapter_1 = require("../../shared/adapter");
|
|
15
|
-
const json_serde_1 = require("../../shared/codec/json-serde");
|
|
16
|
-
const errors_1 = require("../../shared/errors/errors");
|
|
17
|
-
const ulid_1 = require("../../shared/ulid");
|
|
18
|
-
const option_shape_1 = require("../../shared/validation/option-shape");
|
|
19
|
-
/**
|
|
20
|
-
* Max attempts for the message-append transaction. It shares one session's
|
|
21
|
-
* metadata row across every concurrent `addMessages` caller on that session,
|
|
22
|
-
* so a burst of concurrent appends can collide repeatedly; combined with the
|
|
23
|
-
* existing 100ms base / 5000ms cap backoff, this keeps worst-case retrying
|
|
24
|
-
* within AWS's documented guidance to bound conflict retries to "around one
|
|
25
|
-
* minute" (see DynamoDB's "Error retries and exponential backoff" guide).
|
|
26
|
-
* This bound is exact for clients this library constructs, which disable the
|
|
27
|
-
* AWS SDK's own internal retries (`maxAttempts: 1`, see
|
|
28
|
-
* `resolveDynamoDBClient`). An injected client that keeps SDK retries stacks
|
|
29
|
-
* them inside each attempt; construction warns about that.
|
|
30
|
-
*/
|
|
31
|
-
exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = 18;
|
|
32
|
-
/**
|
|
33
|
-
* The keys of each chat-history option bag, exhaustive in both directions:
|
|
34
|
-
* `allKeysOf<T>` makes omitting or inventing one a compile error, so a list
|
|
35
|
-
* cannot rot away from the type it guards. They live with the feature because
|
|
36
|
-
* the types they are checked against do; `shared/` knows no feature.
|
|
37
|
-
*/
|
|
38
|
-
exports.HISTORY_KEYS = (0, option_shape_1.allKeysOf)({
|
|
39
|
-
tableName: 'tableName',
|
|
40
|
-
client: 'client',
|
|
41
|
-
clientConfig: 'clientConfig',
|
|
42
|
-
createClient: 'createClient',
|
|
43
|
-
ttl: 'ttl',
|
|
44
|
-
logger: 'logger',
|
|
45
|
-
retry: 'retry',
|
|
46
|
-
indexShards: 'indexShards',
|
|
47
|
-
indexName: 'indexName',
|
|
48
|
-
readConcurrency: 'readConcurrency',
|
|
49
|
-
compression: 'compression',
|
|
50
|
-
s3: 's3',
|
|
51
|
-
serde: 'serde',
|
|
52
|
-
onCorruptMessage: 'onCorruptMessage',
|
|
53
|
-
});
|
|
54
|
-
/** See {@link HISTORY_KEYS}. */
|
|
55
|
-
exports.GET_MESSAGES_KEYS = (0, option_shape_1.allKeysOf)({
|
|
56
|
-
limit: 'limit',
|
|
57
|
-
before: 'before',
|
|
58
|
-
signal: 'signal',
|
|
59
|
-
});
|
|
60
|
-
/** See {@link HISTORY_KEYS}. */
|
|
61
|
-
exports.LIST_SESSIONS_KEYS = (0, option_shape_1.allKeysOf)({
|
|
62
|
-
limit: 'limit',
|
|
63
|
-
cursor: 'cursor',
|
|
64
|
-
maxIterations: 'maxIterations',
|
|
65
|
-
maxItems: 'maxItems',
|
|
66
|
-
signal: 'signal',
|
|
67
|
-
});
|
|
68
|
-
const CORRUPT_MESSAGE_POLICIES = ['skip', 'throw'];
|
|
69
|
-
/** Reject an `onCorruptMessage` outside its union; see {@link setUpHistory} for why. */
|
|
70
|
-
function assertCorruptMessagePolicy(policy) {
|
|
71
|
-
if (policy !== undefined && !CORRUPT_MESSAGE_POLICIES.includes(policy)) {
|
|
72
|
-
throw (0, errors_1.validationError)(`onCorruptMessage must be one of ${CORRUPT_MESSAGE_POLICIES.join(' | ')}`, 'onCorruptMessage');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Validate the options, then resolve the client, offloader and serializer.
|
|
77
|
-
*
|
|
78
|
-
* Accepts: `options` — validated first, so no half-built adapter exists when
|
|
79
|
-
* one is wrong. `onCorruptMessage` is checked against its union here because a
|
|
80
|
-
* JavaScript caller can pass a string the type never admits, and an
|
|
81
|
-
* unrecognised policy would silently behave as `'skip'` — dropping messages a
|
|
82
|
-
* caller asked to be told about.
|
|
83
|
-
*
|
|
84
|
-
* Returns: the context every action shares, and the shell that releases what
|
|
85
|
-
* it holds — a client the caller passed in is never destroyed by `destroy()`.
|
|
86
|
-
*
|
|
87
|
-
* Throws: `VALIDATION` naming the offending option.
|
|
88
|
-
*
|
|
89
|
-
* Guarantees: constructing an adapter performs no I/O.
|
|
90
|
-
*/
|
|
91
|
-
function setUpHistory(options) {
|
|
92
|
-
(0, option_shape_1.assertShape)(options, exports.HISTORY_KEYS, 'options');
|
|
93
|
-
const shell = (0, adapter_1.openAdapter)(options, 'history', {
|
|
94
|
-
options: () => assertCorruptMessagePolicy(options.onCorruptMessage),
|
|
95
|
-
attemptFloor: exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS,
|
|
96
|
-
});
|
|
97
|
-
return {
|
|
98
|
-
shell,
|
|
99
|
-
context: {
|
|
100
|
-
...shell.core,
|
|
101
|
-
serde: options.serde ?? json_serde_1.JSON_SERDE,
|
|
102
|
-
ulid: (0, ulid_1.createUlidFactory)(),
|
|
103
|
-
onCorruptMessage: options.onCorruptMessage ?? 'skip',
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
package/dist/history/types.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Hides the history's implementation from the types a caller names.
|
|
4
|
-
*
|
|
5
|
-
* Every option and result of the multi-session history's reads, writes and
|
|
6
|
-
* listings is declared here, with no run-time code, so a caller can type
|
|
7
|
-
* what it builds without importing an action, a parser or a row module. The
|
|
8
|
-
* parsed forms the actions work from belong to the parser and the row
|
|
9
|
-
* shapes to the modules that own them, so either can change without moving
|
|
10
|
-
* a published type.
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AWS DynamoDB implementation of LangGraph's checkpoint saver, memory store
|
|
4
|
-
* and chat message history, in TypeScript.
|
|
5
|
-
*
|
|
6
|
-
* Hides where anything lives.
|
|
7
|
-
*
|
|
8
|
-
* This module re-exports and declares nothing of its own, so which module
|
|
9
|
-
* holds an adapter, the factory, the error class, the serializer or a
|
|
10
|
-
* collaborator type is free to change without moving anything a caller
|
|
11
|
-
* imports. What appears here is the whole supported surface; the package's
|
|
12
|
-
* exports map admits no deep import, so nothing else is reachable.
|
|
13
|
-
*
|
|
14
|
-
* @packageDocumentation
|
|
15
|
-
*/
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.redactSecrets = exports.redactLogger = exports.ErrorCode = exports.isDynamoDBLangGraphError = exports.DynamoDBLangGraphError = exports.JSON_SERDE = exports.DynamoDBFactory = exports.backfillRecencyIndex = exports.DynamoDBSessionChatMessageHistory = exports.DynamoDBChatMessageHistory = exports.DynamoDBStore = exports.DynamoDBSaver = void 0;
|
|
18
|
-
var saver_1 = require("./checkpointer/saver");
|
|
19
|
-
Object.defineProperty(exports, "DynamoDBSaver", { enumerable: true, get: function () { return saver_1.DynamoDBSaver; } });
|
|
20
|
-
var store_1 = require("./store/store");
|
|
21
|
-
Object.defineProperty(exports, "DynamoDBStore", { enumerable: true, get: function () { return store_1.DynamoDBStore; } });
|
|
22
|
-
var chat_message_history_1 = require("./history/chat-message-history");
|
|
23
|
-
Object.defineProperty(exports, "DynamoDBChatMessageHistory", { enumerable: true, get: function () { return chat_message_history_1.DynamoDBChatMessageHistory; } });
|
|
24
|
-
var session_adapter_1 = require("./history/session-adapter");
|
|
25
|
-
Object.defineProperty(exports, "DynamoDBSessionChatMessageHistory", { enumerable: true, get: function () { return session_adapter_1.DynamoDBSessionChatMessageHistory; } });
|
|
26
|
-
/**
|
|
27
|
-
* Operator tool: give rows written before the recency index their index keys.
|
|
28
|
-
* Run it before setting `indexName` on any adapter — see its own documentation
|
|
29
|
-
* for why enabling the index first hides pre-existing rows from the listings.
|
|
30
|
-
*/
|
|
31
|
-
var backfill_1 = require("./backfill/backfill");
|
|
32
|
-
Object.defineProperty(exports, "backfillRecencyIndex", { enumerable: true, get: function () { return backfill_1.backfillRecencyIndex; } });
|
|
33
|
-
var factory_1 = require("./factory/factory");
|
|
34
|
-
Object.defineProperty(exports, "DynamoDBFactory", { enumerable: true, get: function () { return factory_1.DynamoDBFactory; } });
|
|
35
|
-
/**
|
|
36
|
-
* The plain JSON serializer the store and chat-history adapters use by
|
|
37
|
-
* default, exported so a checkpointer can be given it in place of LangGraph's
|
|
38
|
-
* `JsonPlusSerializer`, whose read path instantiates the class a stored
|
|
39
|
-
* `{"lc": …}` record names. See the README's *Trust boundary* note and
|
|
40
|
-
* `SECURITY.md`.
|
|
41
|
-
*/
|
|
42
|
-
var json_serde_1 = require("./shared/codec/json-serde");
|
|
43
|
-
Object.defineProperty(exports, "JSON_SERDE", { enumerable: true, get: function () { return json_serde_1.JSON_SERDE; } });
|
|
44
|
-
var base_error_1 = require("./shared/errors/base-error");
|
|
45
|
-
Object.defineProperty(exports, "DynamoDBLangGraphError", { enumerable: true, get: function () { return base_error_1.DynamoDBLangGraphError; } });
|
|
46
|
-
Object.defineProperty(exports, "isDynamoDBLangGraphError", { enumerable: true, get: function () { return base_error_1.isDynamoDBLangGraphError; } });
|
|
47
|
-
var error_code_1 = require("./shared/errors/error-code");
|
|
48
|
-
Object.defineProperty(exports, "ErrorCode", { enumerable: true, get: function () { return error_code_1.ErrorCode; } });
|
|
49
|
-
var redaction_1 = require("./shared/logging/redaction");
|
|
50
|
-
Object.defineProperty(exports, "redactLogger", { enumerable: true, get: function () { return redaction_1.redactLogger; } });
|
|
51
|
-
Object.defineProperty(exports, "redactSecrets", { enumerable: true, get: function () { return redaction_1.redactSecrets; } });
|
package/dist/shared/adapter.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Hides what an adapter owns for its lifetime, and how it lets go of it.
|
|
4
|
-
*
|
|
5
|
-
* Every adapter resolves the same things from its options — a DynamoDB client
|
|
6
|
-
* it either built, and so must destroy, or was handed, and so must not; an S3
|
|
7
|
-
* offloader when it offloads; a logger; a retry policy; the recency index's
|
|
8
|
-
* settings — releases them the same way, and provisions the same lifecycle
|
|
9
|
-
* rule from its ttl. Whether an adapter owns its client is decided in
|
|
10
|
-
* `dynamodb/client.ts`; this module only reads that decision, to release a
|
|
11
|
-
* client it built and leave an injected one alone.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.releaseOwned = releaseOwned;
|
|
15
|
-
exports.ensureLifecycleFor = ensureLifecycleFor;
|
|
16
|
-
exports.openAdapter = openAdapter;
|
|
17
|
-
const config_1 = require("./codec/s3/config");
|
|
18
|
-
const offloader_1 = require("./codec/s3/offloader");
|
|
19
|
-
const concurrency_1 = require("./concurrency");
|
|
20
|
-
const client_1 = require("./dynamodb/client");
|
|
21
|
-
const recency_index_1 = require("./dynamodb/recency-index");
|
|
22
|
-
const retry_1 = require("./dynamodb/retry");
|
|
23
|
-
const base_error_1 = require("./errors/base-error");
|
|
24
|
-
const logger_1 = require("./logging/logger");
|
|
25
|
-
const collaborators_1 = require("./validation/collaborators");
|
|
26
|
-
const options_1 = require("./validation/options");
|
|
27
|
-
const ttl_1 = require("./validation/ttl");
|
|
28
|
-
/**
|
|
29
|
-
* Release every resource, whatever any one of them does.
|
|
30
|
-
*
|
|
31
|
-
* The hazard is the one `DynamoDBFactory`'s own `release` names: a teardown
|
|
32
|
-
* written as a sequence of statements stops at the first throw, so everything
|
|
33
|
-
* after it is stranded with no reference left to reach it by. Each adapter's
|
|
34
|
-
* `destroy` was exactly that sequence — the S3 offloader, then the DynamoDB
|
|
35
|
-
* client it built — and an S3 client whose sockets are already gone throws from
|
|
36
|
-
* its own `destroy`, so the DynamoDB client leaked for the life of the process.
|
|
37
|
-
*
|
|
38
|
-
* Accepts: `resources` — in the order they should be released; an absent one
|
|
39
|
-
* (an adapter with no offloader, a client the caller injected and therefore
|
|
40
|
-
* owns) is skipped rather than guarded at each call site.
|
|
41
|
-
*
|
|
42
|
-
* Returns: nothing.
|
|
43
|
-
*
|
|
44
|
-
* Throws: the **first** failure, and only after every resource has been
|
|
45
|
-
* offered its release, so nothing is stranded behind it. Raised rather than
|
|
46
|
-
* logged because the default logger discards everything: a caller who never
|
|
47
|
-
* configured one would otherwise be told nowhere at all that a client of theirs
|
|
48
|
-
* is still holding sockets. A later failure is dropped, because a caller can
|
|
49
|
-
* act on one report and the first one names the resource that actually broke.
|
|
50
|
-
* A `throw` that produced something other than an `Error` is normalised, so a
|
|
51
|
-
* caller's `catch` is handed the same shape whatever a client raised.
|
|
52
|
-
*/
|
|
53
|
-
function releaseOwned(resources) {
|
|
54
|
-
let first;
|
|
55
|
-
for (const resource of resources) {
|
|
56
|
-
try {
|
|
57
|
-
resource?.destroy();
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
first ??= (0, base_error_1.toError)(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (first !== undefined)
|
|
64
|
-
throw first;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Provision the S3 lifecycle rule that expires what an adapter offloads, on its
|
|
68
|
-
* ttl, so an offloaded payload does not outlive the DynamoDB item that points
|
|
69
|
-
* at it.
|
|
70
|
-
*
|
|
71
|
-
* The rule is expressed in whole days because that is the only granularity S3
|
|
72
|
-
* lifecycle expiration accepts, while the DynamoDB TTL is in seconds; see
|
|
73
|
-
* `lifecycleExpirationDays` for the rounding, which is always up.
|
|
74
|
-
*
|
|
75
|
-
* Accepts: `core` — the adapter's offloader, ttl and logger.
|
|
76
|
-
*
|
|
77
|
-
* Returns: nothing. Without an offloader there is nothing to rule over, and
|
|
78
|
-
* without a ttl no item expires, so any rule would delete a payload a live row
|
|
79
|
-
* still needs: either absence does nothing. Installing a rule that is already
|
|
80
|
-
* there is a no-op too, so calling this on every deploy is safe.
|
|
81
|
-
*
|
|
82
|
-
* Throws: whatever reading or writing the bucket's lifecycle configuration
|
|
83
|
-
* throws, and `VALIDATION` naming `s3.keyPrefix` when the rule id this
|
|
84
|
-
* prefix would take is already held by a different prefix.
|
|
85
|
-
*
|
|
86
|
-
* Guarantees: needs the bucket-level `s3:GetLifecycleConfiguration` /
|
|
87
|
-
* `s3:PutLifecycleConfiguration` permissions, which are broader than the
|
|
88
|
-
* object-level CRUD the rest of offload uses — so this is a provisioning call,
|
|
89
|
-
* not a per-request one.
|
|
90
|
-
*/
|
|
91
|
-
async function ensureLifecycleFor(core) {
|
|
92
|
-
if (!core.offloader || !core.ttl)
|
|
93
|
-
return;
|
|
94
|
-
await core.offloader.ensureLifecycleRule((0, ttl_1.lifecycleExpirationDays)(core.ttl), core.logger);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Check an adapter's options and resolve what it will own.
|
|
98
|
-
*
|
|
99
|
-
* Accepts: `options` — the adapter's, already held to its own key list, and
|
|
100
|
-
* checked first, so no half-built adapter exists when one is wrong.
|
|
101
|
-
* `adapter` — which adapter, which names its default S3 key prefix. `checks` —
|
|
102
|
-
* the adapter's own option and collaborator checks, and its retry floor.
|
|
103
|
-
*
|
|
104
|
-
* Returns: the shell: the core every operation reads, with every shared
|
|
105
|
-
* default filled in here and nowhere else, and the adapter's two lifetime
|
|
106
|
-
* operations. A client the caller passed in is never destroyed by `release`.
|
|
107
|
-
*
|
|
108
|
-
* Throws: `VALIDATION` for an option or a collaborator that fails a shared
|
|
109
|
-
* check or one of `checks`, in that order.
|
|
110
|
-
*
|
|
111
|
-
* Guarantees: no I/O. The stacked-retry check is deliberately not awaited: it
|
|
112
|
-
* is a warning about a caller-supplied client, not a precondition.
|
|
113
|
-
*/
|
|
114
|
-
function openAdapter(options, adapter, checks = {}) {
|
|
115
|
-
(0, options_1.assertBaseAdapterOptions)(options);
|
|
116
|
-
checks.options?.();
|
|
117
|
-
(0, collaborators_1.assertBaseCollaborators)(options);
|
|
118
|
-
checks.collaborators?.();
|
|
119
|
-
const logger = (0, logger_1.resolveLogger)(options.logger);
|
|
120
|
-
const resolved = (0, client_1.resolveDynamoDBClient)(options);
|
|
121
|
-
if (!resolved.ownsClient)
|
|
122
|
-
void (0, client_1.warnOnStackedRetries)(resolved.client, logger);
|
|
123
|
-
const offloader = options.s3
|
|
124
|
-
? new offloader_1.S3Offloader((0, config_1.offloaderConfigFor)(options.s3, adapter, options.clientConfig))
|
|
125
|
-
: undefined;
|
|
126
|
-
const core = {
|
|
127
|
-
client: resolved.client,
|
|
128
|
-
tableName: options.tableName,
|
|
129
|
-
compression: options.compression,
|
|
130
|
-
offloader,
|
|
131
|
-
ttl: options.ttl,
|
|
132
|
-
logger,
|
|
133
|
-
retry: (0, retry_1.resolveRetryPolicy)(options.retry, logger, checks.attemptFloor),
|
|
134
|
-
indexShards: options.indexShards ?? recency_index_1.DEFAULT_INDEX_SHARDS,
|
|
135
|
-
readConcurrency: options.readConcurrency ?? concurrency_1.DEFAULT_READ_CONCURRENCY,
|
|
136
|
-
indexName: options.indexName,
|
|
137
|
-
};
|
|
138
|
-
return {
|
|
139
|
-
core,
|
|
140
|
-
ensureLifecycleRule: () => ensureLifecycleFor(core),
|
|
141
|
-
release: () => releaseOwned([offloader, resolved.ownsClient ? resolved.ddbClient : undefined]),
|
|
142
|
-
};
|
|
143
|
-
}
|