@farukada/aws-langgraph-dynamodb-ts 1.0.0-rc.1 → 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 +1820 -290
- package/dist/cjs/backfill/backfill.d.ts +171 -0
- package/dist/cjs/backfill/backfill.js +177 -0
- package/dist/cjs/checkpointer/actions/delete-thread.d.ts +50 -0
- package/dist/cjs/checkpointer/actions/delete-thread.js +26 -0
- package/dist/cjs/checkpointer/actions/get-tuple.d.ts +36 -0
- package/dist/cjs/checkpointer/actions/get-tuple.js +22 -0
- package/dist/cjs/checkpointer/actions/list.d.ts +55 -0
- package/dist/cjs/checkpointer/actions/list.js +70 -0
- package/dist/cjs/checkpointer/actions/put-writes.d.ts +49 -0
- package/dist/cjs/checkpointer/actions/put-writes.js +21 -0
- package/dist/cjs/checkpointer/actions/put.d.ts +95 -0
- package/dist/cjs/checkpointer/actions/put.js +79 -0
- package/dist/cjs/checkpointer/internal/delta-history.d.ts +124 -0
- package/dist/cjs/checkpointer/internal/delta-history.js +131 -0
- package/dist/cjs/checkpointer/internal/listing.d.ts +149 -0
- package/dist/cjs/checkpointer/internal/listing.js +104 -0
- package/dist/cjs/checkpointer/internal/parse.d.ts +298 -0
- package/dist/cjs/checkpointer/internal/parse.js +184 -0
- package/dist/cjs/checkpointer/internal/pending-writes.d.ts +314 -0
- package/dist/cjs/checkpointer/internal/pending-writes.js +241 -0
- package/dist/cjs/checkpointer/internal/read.d.ts +135 -0
- package/dist/cjs/checkpointer/internal/read.js +132 -0
- package/dist/cjs/checkpointer/internal/rows.d.ts +644 -0
- package/dist/cjs/checkpointer/internal/rows.js +356 -0
- package/dist/cjs/checkpointer/internal/setup.d.ts +47 -0
- package/dist/cjs/checkpointer/internal/setup.js +25 -0
- package/dist/cjs/checkpointer/saver.d.ts +306 -0
- package/dist/cjs/checkpointer/saver.js +56 -0
- package/dist/cjs/checkpointer/types.d.ts +51 -0
- package/dist/cjs/factory/factory.d.ts +154 -0
- package/dist/cjs/factory/factory.js +137 -0
- package/dist/{factory → cjs/factory}/types.d.ts +33 -14
- package/dist/cjs/history/actions/add-messages.d.ts +51 -0
- package/dist/cjs/history/actions/add-messages.js +17 -0
- package/dist/cjs/history/actions/clear.d.ts +52 -0
- package/dist/cjs/history/actions/clear.js +29 -0
- package/dist/cjs/history/actions/get-messages.d.ts +60 -0
- package/dist/cjs/history/actions/get-messages.js +58 -0
- package/dist/cjs/history/actions/list-sessions.d.ts +55 -0
- package/dist/cjs/history/actions/list-sessions.js +67 -0
- package/dist/cjs/history/actions/reconcile-count.d.ts +49 -0
- package/dist/cjs/history/actions/reconcile-count.js +8 -0
- package/dist/cjs/history/chat-message-history.d.ts +267 -0
- package/dist/cjs/history/chat-message-history.js +61 -0
- package/dist/cjs/history/internal/append.d.ts +244 -0
- package/dist/cjs/history/internal/append.js +267 -0
- package/dist/cjs/history/internal/message-read.d.ts +84 -0
- package/dist/cjs/history/internal/message-read.js +93 -0
- package/dist/cjs/history/internal/parse.d.ts +153 -0
- package/dist/cjs/history/internal/parse.js +113 -0
- package/dist/cjs/history/internal/rows.d.ts +196 -0
- package/dist/cjs/history/internal/rows.js +96 -0
- package/dist/cjs/history/internal/session.d.ts +350 -0
- package/dist/cjs/history/internal/session.js +296 -0
- package/dist/cjs/history/internal/setup.d.ts +64 -0
- package/dist/cjs/history/internal/setup.js +60 -0
- package/dist/cjs/history/session-adapter.d.ts +112 -0
- package/dist/cjs/history/session-adapter.js +38 -0
- package/dist/cjs/history/types.d.ts +102 -0
- package/dist/cjs/index.d.ts +53 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/shared/adapter.d.ts +146 -0
- package/dist/cjs/shared/adapter.js +70 -0
- package/dist/cjs/shared/clock.d.ts +52 -0
- package/dist/cjs/shared/clock.js +14 -0
- package/dist/cjs/shared/codec/codec.d.ts +336 -0
- package/dist/cjs/shared/codec/codec.js +162 -0
- package/dist/cjs/shared/codec/compression.d.ts +66 -0
- package/dist/cjs/shared/codec/compression.js +45 -0
- package/dist/cjs/shared/codec/json-serde.d.ts +80 -0
- package/dist/cjs/shared/codec/json-serde.js +58 -0
- package/dist/{shared → cjs/shared}/codec/s3/client-types.d.ts +22 -2
- package/dist/{shared → cjs/shared}/codec/s3/client-types.js +0 -1
- package/dist/cjs/shared/codec/s3/client.d.ts +63 -0
- package/dist/cjs/shared/codec/s3/client.js +78 -0
- package/dist/cjs/shared/codec/s3/config.d.ts +260 -0
- package/dist/cjs/shared/codec/s3/config.js +92 -0
- package/dist/cjs/shared/codec/s3/lifecycle.d.ts +220 -0
- package/dist/cjs/shared/codec/s3/lifecycle.js +223 -0
- package/dist/cjs/shared/codec/s3/offloader.d.ts +428 -0
- package/dist/cjs/shared/codec/s3/offloader.js +289 -0
- package/dist/cjs/shared/concurrency.d.ts +43 -0
- package/dist/{shared → cjs/shared}/concurrency.js +10 -9
- package/dist/cjs/shared/dynamodb/abort.d.ts +47 -0
- package/dist/cjs/shared/dynamodb/abort.js +16 -0
- package/dist/cjs/shared/dynamodb/batch-write.d.ts +86 -0
- package/dist/cjs/shared/dynamodb/batch-write.js +79 -0
- package/dist/cjs/shared/dynamodb/cancellation.d.ts +124 -0
- package/dist/cjs/shared/dynamodb/cancellation.js +37 -0
- package/dist/cjs/shared/dynamodb/client.d.ts +177 -0
- package/dist/{shared → cjs/shared}/dynamodb/client.js +12 -14
- package/dist/cjs/shared/dynamodb/idempotent-write.d.ts +596 -0
- package/dist/cjs/shared/dynamodb/idempotent-write.js +173 -0
- package/dist/cjs/shared/dynamodb/paginate.d.ts +111 -0
- package/dist/cjs/shared/dynamodb/paginate.js +90 -0
- package/dist/cjs/shared/dynamodb/partition-delete.d.ts +204 -0
- package/dist/cjs/shared/dynamodb/partition-delete.js +177 -0
- package/dist/cjs/shared/dynamodb/recency-index.d.ts +243 -0
- package/dist/cjs/shared/dynamodb/recency-index.js +146 -0
- package/dist/cjs/shared/dynamodb/retry.d.ts +317 -0
- 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/cjs/shared/dynamodb/table-schema.d.ts +199 -0
- package/dist/cjs/shared/dynamodb/table-schema.js +52 -0
- package/dist/cjs/shared/errors/base-error.d.ts +231 -0
- package/dist/cjs/shared/errors/base-error.js +73 -0
- package/dist/cjs/shared/errors/boundary.d.ts +86 -0
- 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/cjs/shared/errors/error-code.d.ts +95 -0
- package/dist/{shared → cjs/shared}/errors/error-code.js +12 -2
- package/dist/cjs/shared/errors/errors.d.ts +233 -0
- package/dist/cjs/shared/errors/errors.js +123 -0
- package/dist/cjs/shared/logging/logger.d.ts +80 -0
- package/dist/cjs/shared/logging/logger.js +30 -0
- package/dist/cjs/shared/logging/redaction.d.ts +123 -0
- package/dist/cjs/shared/logging/redaction.js +145 -0
- package/dist/cjs/shared/logging/secret-patterns.d.ts +227 -0
- package/dist/cjs/shared/logging/secret-patterns.js +93 -0
- package/dist/cjs/shared/logging/truncate.d.ts +197 -0
- package/dist/cjs/shared/logging/truncate.js +31 -0
- package/dist/cjs/shared/options.d.ts +100 -0
- package/dist/cjs/shared/ulid.d.ts +80 -0
- package/dist/{shared → cjs/shared}/ulid.js +7 -21
- package/dist/cjs/shared/validation/collaborators.d.ts +160 -0
- package/dist/cjs/shared/validation/collaborators.js +79 -0
- package/dist/cjs/shared/validation/option-shape.d.ts +91 -0
- package/dist/cjs/shared/validation/option-shape.js +31 -0
- package/dist/cjs/shared/validation/options.d.ts +145 -0
- package/dist/cjs/shared/validation/options.js +166 -0
- package/dist/cjs/shared/validation/primitives.d.ts +292 -0
- package/dist/cjs/shared/validation/primitives.js +114 -0
- package/dist/cjs/shared/validation/ttl.d.ts +94 -0
- package/dist/cjs/shared/validation/ttl.js +52 -0
- package/dist/cjs/store/actions/list-namespaces.d.ts +79 -0
- package/dist/cjs/store/actions/list-namespaces.js +92 -0
- package/dist/cjs/store/actions/put.d.ts +43 -0
- package/dist/cjs/store/actions/put.js +49 -0
- package/dist/cjs/store/actions/reconcile-vector-index.d.ts +38 -0
- package/dist/cjs/store/actions/reconcile-vector-index.js +13 -0
- package/dist/cjs/store/actions/search.d.ts +38 -0
- 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/cjs/store/internal/filter.d.ts +43 -0
- 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/cjs/store/internal/item-write.d.ts +270 -0
- package/dist/cjs/store/internal/item-write.js +181 -0
- package/dist/cjs/store/internal/parse.d.ts +230 -0
- package/dist/cjs/store/internal/parse.js +180 -0
- package/dist/cjs/store/internal/rows.d.ts +359 -0
- package/dist/cjs/store/internal/rows.js +166 -0
- package/dist/cjs/store/internal/semantic-search.d.ts +168 -0
- package/dist/{store/internal/text-path.js → cjs/store/internal/semantic-search.js} +92 -28
- package/dist/cjs/store/internal/setup.d.ts +96 -0
- package/dist/cjs/store/internal/setup.js +103 -0
- package/dist/cjs/store/internal/table-search.d.ts +100 -0
- package/dist/cjs/store/internal/table-search.js +123 -0
- package/dist/cjs/store/internal/vector-index.d.ts +258 -0
- package/dist/cjs/store/internal/vector-index.js +269 -0
- package/dist/cjs/store/store.d.ts +329 -0
- package/dist/cjs/store/store.js +97 -0
- package/dist/cjs/store/types.d.ts +111 -0
- package/dist/cjs/store/vector-backend.d.ts +104 -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/esm/checkpointer/actions/delete-thread.d.ts +50 -0
- package/dist/esm/checkpointer/actions/delete-thread.js +23 -0
- package/dist/esm/checkpointer/actions/get-tuple.d.ts +36 -0
- 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/esm/checkpointer/actions/put-writes.d.ts +49 -0
- 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/esm/checkpointer/internal/listing.d.ts +149 -0
- 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/esm/checkpointer/saver.d.ts +306 -0
- 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/esm/history/actions/add-messages.d.ts +51 -0
- package/dist/esm/history/actions/add-messages.js +14 -0
- package/dist/esm/history/actions/clear.d.ts +52 -0
- 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/esm/history/actions/reconcile-count.d.ts +49 -0
- package/dist/esm/history/actions/reconcile-count.js +5 -0
- package/dist/esm/history/chat-message-history.d.ts +267 -0
- 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/esm/history/internal/rows.d.ts +196 -0
- 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/esm/history/session-adapter.d.ts +112 -0
- 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/esm/shared/clock.d.ts +52 -0
- 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/esm/shared/codec/s3/config.d.ts +260 -0
- 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/esm/shared/concurrency.d.ts +43 -0
- package/dist/esm/shared/concurrency.js +27 -0
- package/dist/esm/shared/dynamodb/abort.d.ts +47 -0
- 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/esm/shared/dynamodb/cancellation.d.ts +124 -0
- package/dist/esm/shared/dynamodb/cancellation.js +30 -0
- package/dist/esm/shared/dynamodb/client.d.ts +177 -0
- package/dist/esm/shared/dynamodb/client.js +35 -0
- package/dist/esm/shared/dynamodb/idempotent-write.d.ts +596 -0
- 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/esm/shared/dynamodb/table-schema.d.ts +199 -0
- 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/esm/shared/errors/error-code.d.ts +95 -0
- package/dist/esm/shared/errors/error-code.js +24 -0
- package/dist/esm/shared/errors/errors.d.ts +233 -0
- package/dist/esm/shared/errors/errors.js +110 -0
- package/dist/esm/shared/logging/logger.d.ts +80 -0
- 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/esm/shared/logging/secret-patterns.d.ts +227 -0
- package/dist/esm/shared/logging/secret-patterns.js +83 -0
- package/dist/esm/shared/logging/truncate.d.ts +197 -0
- 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/esm/shared/ulid.d.ts +80 -0
- package/dist/esm/shared/ulid.js +77 -0
- package/dist/esm/shared/validation/collaborators.d.ts +160 -0
- package/dist/esm/shared/validation/collaborators.js +70 -0
- package/dist/esm/shared/validation/option-shape.d.ts +91 -0
- 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/esm/shared/validation/primitives.d.ts +292 -0
- 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/esm/store/actions/reconcile-vector-index.d.ts +38 -0
- 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/esm/store/internal/rows.d.ts +359 -0
- 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/esm/store/store.d.ts +329 -0
- 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 +68 -46
- package/dist/checkpointer/actions/delete-thread.d.ts +0 -10
- package/dist/checkpointer/actions/delete-thread.js +0 -38
- package/dist/checkpointer/actions/get-tuple.d.ts +0 -11
- package/dist/checkpointer/actions/get-tuple.js +0 -25
- package/dist/checkpointer/actions/list.d.ts +0 -20
- package/dist/checkpointer/actions/list.js +0 -113
- package/dist/checkpointer/actions/put-writes.d.ts +0 -15
- package/dist/checkpointer/actions/put-writes.js +0 -62
- package/dist/checkpointer/actions/put.d.ts +0 -17
- package/dist/checkpointer/actions/put.js +0 -73
- package/dist/checkpointer/internal/assemble.d.ts +0 -17
- package/dist/checkpointer/internal/assemble.js +0 -38
- package/dist/checkpointer/internal/checkpoint-write-verify.d.ts +0 -24
- package/dist/checkpointer/internal/checkpoint-write-verify.js +0 -67
- package/dist/checkpointer/internal/configurable.d.ts +0 -12
- package/dist/checkpointer/internal/configurable.js +0 -24
- package/dist/checkpointer/internal/fetch.d.ts +0 -19
- package/dist/checkpointer/internal/fetch.js +0 -88
- package/dist/checkpointer/internal/filter-match.d.ts +0 -13
- package/dist/checkpointer/internal/filter-match.js +0 -15
- package/dist/checkpointer/internal/item-reader.d.ts +0 -66
- package/dist/checkpointer/internal/item-reader.js +0 -113
- package/dist/checkpointer/internal/item-writer.d.ts +0 -35
- package/dist/checkpointer/internal/item-writer.js +0 -107
- package/dist/checkpointer/internal/keys.d.ts +0 -41
- package/dist/checkpointer/internal/keys.js +0 -117
- package/dist/checkpointer/internal/list-scope.d.ts +0 -61
- package/dist/checkpointer/internal/list-scope.js +0 -108
- package/dist/checkpointer/internal/pending-sends.d.ts +0 -13
- package/dist/checkpointer/internal/pending-sends.js +0 -29
- package/dist/checkpointer/internal/query.d.ts +0 -21
- package/dist/checkpointer/internal/query.js +0 -42
- package/dist/checkpointer/internal/regular-write.d.ts +0 -28
- package/dist/checkpointer/internal/regular-write.js +0 -66
- package/dist/checkpointer/internal/setup.d.ts +0 -33
- package/dist/checkpointer/internal/setup.js +0 -38
- package/dist/checkpointer/internal/special-write-cas.d.ts +0 -29
- package/dist/checkpointer/internal/special-write-cas.js +0 -104
- package/dist/checkpointer/internal/special-write-cleanup.d.ts +0 -23
- package/dist/checkpointer/internal/special-write-cleanup.js +0 -50
- package/dist/checkpointer/internal/special-write-verify.d.ts +0 -53
- package/dist/checkpointer/internal/special-write-verify.js +0 -80
- package/dist/checkpointer/internal/stored-channels.d.ts +0 -31
- package/dist/checkpointer/internal/stored-channels.js +0 -70
- package/dist/checkpointer/internal/validation.d.ts +0 -18
- package/dist/checkpointer/internal/validation.js +0 -40
- package/dist/checkpointer/internal/write-guard.d.ts +0 -20
- package/dist/checkpointer/internal/write-guard.js +0 -48
- package/dist/checkpointer/internal/write-index.d.ts +0 -36
- package/dist/checkpointer/internal/write-index.js +0 -41
- package/dist/checkpointer/saver.d.ts +0 -70
- package/dist/checkpointer/saver.js +0 -105
- package/dist/checkpointer/types.d.ts +0 -58
- package/dist/factory/factory.d.ts +0 -40
- package/dist/factory/factory.js +0 -87
- package/dist/history/actions/add-messages.d.ts +0 -15
- package/dist/history/actions/add-messages.js +0 -77
- package/dist/history/actions/clear.d.ts +0 -10
- package/dist/history/actions/clear.js +0 -34
- package/dist/history/actions/get-messages.d.ts +0 -17
- package/dist/history/actions/get-messages.js +0 -79
- package/dist/history/actions/list-sessions.d.ts +0 -13
- package/dist/history/actions/list-sessions.js +0 -53
- package/dist/history/actions/reconcile-count.d.ts +0 -12
- package/dist/history/actions/reconcile-count.js +0 -64
- package/dist/history/chat-message-history.d.ts +0 -73
- package/dist/history/chat-message-history.js +0 -111
- package/dist/history/internal/append-saga.d.ts +0 -25
- package/dist/history/internal/append-saga.js +0 -79
- package/dist/history/internal/compensation.d.ts +0 -25
- package/dist/history/internal/compensation.js +0 -92
- package/dist/history/internal/item-mapper.d.ts +0 -9
- package/dist/history/internal/item-mapper.js +0 -27
- package/dist/history/internal/keys.d.ts +0 -16
- package/dist/history/internal/keys.js +0 -48
- package/dist/history/internal/message-chunker.d.ts +0 -13
- package/dist/history/internal/message-chunker.js +0 -67
- package/dist/history/internal/message-transaction.d.ts +0 -25
- package/dist/history/internal/message-transaction.js +0 -61
- package/dist/history/internal/message-window.d.ts +0 -17
- package/dist/history/internal/message-window.js +0 -49
- package/dist/history/internal/query.d.ts +0 -23
- package/dist/history/internal/query.js +0 -39
- package/dist/history/internal/session-count.d.ts +0 -47
- package/dist/history/internal/session-count.js +0 -115
- package/dist/history/internal/session-title.d.ts +0 -19
- package/dist/history/internal/session-title.js +0 -43
- package/dist/history/internal/session-update.d.ts +0 -27
- package/dist/history/internal/session-update.js +0 -69
- package/dist/history/internal/setup.d.ts +0 -31
- package/dist/history/internal/setup.js +0 -43
- package/dist/history/internal/title-generator.d.ts +0 -12
- package/dist/history/internal/title-generator.js +0 -41
- package/dist/history/internal/ttl-anchor.d.ts +0 -24
- package/dist/history/internal/ttl-anchor.js +0 -38
- package/dist/history/internal/validation.d.ts +0 -25
- package/dist/history/internal/validation.js +0 -53
- package/dist/history/session-adapter.d.ts +0 -29
- package/dist/history/session-adapter.js +0 -35
- package/dist/history/types.d.ts +0 -69
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -32
- package/dist/shared/clock.d.ts +0 -8
- package/dist/shared/clock.js +0 -16
- package/dist/shared/codec/codec.d.ts +0 -53
- package/dist/shared/codec/codec.js +0 -66
- package/dist/shared/codec/compression.d.ts +0 -24
- package/dist/shared/codec/compression.js +0 -48
- package/dist/shared/codec/descriptor-keys.d.ts +0 -12
- package/dist/shared/codec/descriptor-keys.js +0 -14
- package/dist/shared/codec/encode.d.ts +0 -13
- package/dist/shared/codec/encode.js +0 -43
- package/dist/shared/codec/json-serde.d.ts +0 -7
- package/dist/shared/codec/json-serde.js +0 -17
- package/dist/shared/codec/payload-loss.d.ts +0 -12
- package/dist/shared/codec/payload-loss.js +0 -38
- package/dist/shared/codec/s3/adapter-config.d.ts +0 -13
- package/dist/shared/codec/s3/adapter-config.js +0 -22
- package/dist/shared/codec/s3/bounded-body.d.ts +0 -14
- package/dist/shared/codec/s3/bounded-body.js +0 -47
- package/dist/shared/codec/s3/client.d.ts +0 -18
- package/dist/shared/codec/s3/client.js +0 -46
- package/dist/shared/codec/s3/config.d.ts +0 -51
- package/dist/shared/codec/s3/config.js +0 -58
- package/dist/shared/codec/s3/delete.d.ts +0 -7
- package/dist/shared/codec/s3/delete.js +0 -28
- package/dist/shared/codec/s3/key-scope.d.ts +0 -23
- package/dist/shared/codec/s3/key-scope.js +0 -44
- package/dist/shared/codec/s3/lifecycle.d.ts +0 -14
- package/dist/shared/codec/s3/lifecycle.js +0 -63
- package/dist/shared/codec/s3/offloader.d.ts +0 -44
- package/dist/shared/codec/s3/offloader.js +0 -118
- package/dist/shared/codec/s3/orphans.d.ts +0 -23
- package/dist/shared/codec/s3/orphans.js +0 -71
- package/dist/shared/codec/s3/read-write.d.ts +0 -18
- package/dist/shared/codec/s3/read-write.js +0 -51
- package/dist/shared/codec/s3/retry.d.ts +0 -5
- package/dist/shared/codec/s3/retry.js +0 -22
- package/dist/shared/concurrency.d.ts +0 -6
- package/dist/shared/constants.d.ts +0 -112
- package/dist/shared/constants.js +0 -115
- package/dist/shared/dynamodb/abort.d.ts +0 -9
- package/dist/shared/dynamodb/abort.js +0 -27
- package/dist/shared/dynamodb/backoff.d.ts +0 -15
- package/dist/shared/dynamodb/backoff.js +0 -48
- package/dist/shared/dynamodb/batch-write.d.ts +0 -22
- package/dist/shared/dynamodb/batch-write.js +0 -53
- package/dist/shared/dynamodb/cancellation.d.ts +0 -6
- package/dist/shared/dynamodb/cancellation.js +0 -7
- package/dist/shared/dynamodb/client.d.ts +0 -28
- package/dist/shared/dynamodb/conditional-put.d.ts +0 -67
- package/dist/shared/dynamodb/conditional-put.js +0 -76
- package/dist/shared/dynamodb/drain-unprocessed.d.ts +0 -21
- package/dist/shared/dynamodb/drain-unprocessed.js +0 -43
- package/dist/shared/dynamodb/expiry.d.ts +0 -16
- package/dist/shared/dynamodb/expiry.js +0 -29
- package/dist/shared/dynamodb/paginate-core.d.ts +0 -24
- package/dist/shared/dynamodb/paginate-core.js +0 -82
- package/dist/shared/dynamodb/paginate.d.ts +0 -14
- package/dist/shared/dynamodb/paginate.js +0 -19
- package/dist/shared/dynamodb/partition-delete.d.ts +0 -39
- package/dist/shared/dynamodb/partition-delete.js +0 -71
- package/dist/shared/dynamodb/retry-classifier.d.ts +0 -17
- package/dist/shared/dynamodb/retry-classifier.js +0 -118
- package/dist/shared/dynamodb/retry-policy.d.ts +0 -26
- package/dist/shared/dynamodb/retry-policy.js +0 -22
- package/dist/shared/dynamodb/retry.d.ts +0 -31
- package/dist/shared/dynamodb/retry.js +0 -57
- package/dist/shared/dynamodb/scan.d.ts +0 -14
- package/dist/shared/dynamodb/scan.js +0 -19
- package/dist/shared/dynamodb/types.d.ts +0 -23
- package/dist/shared/errors/base-error.d.ts +0 -30
- package/dist/shared/errors/base-error.js +0 -27
- package/dist/shared/errors/boundary.d.ts +0 -18
- package/dist/shared/errors/boundary.js +0 -46
- package/dist/shared/errors/error-code.d.ts +0 -13
- package/dist/shared/errors/errors.d.ts +0 -68
- package/dist/shared/errors/errors.js +0 -114
- package/dist/shared/errors/upstream-error.d.ts +0 -16
- package/dist/shared/errors/upstream-error.js +0 -27
- package/dist/shared/errors/wrap-error.d.ts +0 -7
- package/dist/shared/errors/wrap-error.js +0 -15
- package/dist/shared/logging/logger.d.ts +0 -18
- package/dist/shared/logging/logger.js +0 -15
- package/dist/shared/logging/redaction-walk.d.ts +0 -23
- package/dist/shared/logging/redaction-walk.js +0 -112
- package/dist/shared/logging/redaction.d.ts +0 -39
- package/dist/shared/logging/redaction.js +0 -75
- package/dist/shared/logging/secret-patterns.d.ts +0 -92
- package/dist/shared/logging/secret-patterns.js +0 -133
- package/dist/shared/options.d.ts +0 -37
- package/dist/shared/ulid.d.ts +0 -23
- package/dist/shared/validation/options.d.ts +0 -8
- package/dist/shared/validation/options.js +0 -90
- package/dist/shared/validation/primitives.d.ts +0 -29
- package/dist/shared/validation/primitives.js +0 -82
- package/dist/shared/validation/ttl.d.ts +0 -28
- package/dist/shared/validation/ttl.js +0 -52
- package/dist/store/actions/get.d.ts +0 -13
- package/dist/store/actions/get.js +0 -73
- package/dist/store/actions/list-namespaces.d.ts +0 -8
- package/dist/store/actions/list-namespaces.js +0 -59
- package/dist/store/actions/put.d.ts +0 -10
- package/dist/store/actions/put.js +0 -96
- package/dist/store/actions/reconcile-vector-index.d.ts +0 -18
- package/dist/store/actions/reconcile-vector-index.js +0 -26
- package/dist/store/actions/search.d.ts +0 -9
- package/dist/store/actions/search.js +0 -34
- package/dist/store/internal/backend-search.d.ts +0 -4
- package/dist/store/internal/backend-search.js +0 -74
- package/dist/store/internal/batch-plan.d.ts +0 -11
- package/dist/store/internal/batch-plan.js +0 -52
- package/dist/store/internal/candidates.d.ts +0 -23
- package/dist/store/internal/candidates.js +0 -94
- package/dist/store/internal/filter.d.ts +0 -9
- package/dist/store/internal/filter.js +0 -85
- package/dist/store/internal/index-reconcile.d.ts +0 -21
- package/dist/store/internal/index-reconcile.js +0 -118
- package/dist/store/internal/index-sync.d.ts +0 -10
- package/dist/store/internal/index-sync.js +0 -25
- package/dist/store/internal/item-mapper.d.ts +0 -27
- package/dist/store/internal/item-mapper.js +0 -61
- package/dist/store/internal/keys.d.ts +0 -17
- package/dist/store/internal/keys.js +0 -41
- package/dist/store/internal/namespace-match.d.ts +0 -11
- package/dist/store/internal/namespace-match.js +0 -40
- package/dist/store/internal/option-validation.d.ts +0 -13
- package/dist/store/internal/option-validation.js +0 -77
- package/dist/store/internal/overwrite-swap.d.ts +0 -32
- package/dist/store/internal/overwrite-swap.js +0 -68
- package/dist/store/internal/persist.d.ts +0 -28
- package/dist/store/internal/persist.js +0 -64
- package/dist/store/internal/query.d.ts +0 -11
- package/dist/store/internal/query.js +0 -48
- package/dist/store/internal/ranker.d.ts +0 -18
- package/dist/store/internal/ranker.js +0 -39
- package/dist/store/internal/read-existing.d.ts +0 -23
- package/dist/store/internal/read-existing.js +0 -41
- package/dist/store/internal/score-direction.d.ts +0 -31
- package/dist/store/internal/score-direction.js +0 -38
- package/dist/store/internal/search-filter.d.ts +0 -3
- package/dist/store/internal/search-filter.js +0 -10
- package/dist/store/internal/semantic-search.d.ts +0 -34
- package/dist/store/internal/semantic-search.js +0 -87
- package/dist/store/internal/setup.d.ts +0 -36
- package/dist/store/internal/setup.js +0 -40
- package/dist/store/internal/text-path.d.ts +0 -17
- package/dist/store/internal/validation.d.ts +0 -18
- package/dist/store/internal/validation.js +0 -51
- package/dist/store/internal/write-verify.d.ts +0 -42
- package/dist/store/internal/write-verify.js +0 -71
- package/dist/store/store.d.ts +0 -61
- package/dist/store/store.js +0 -107
- package/dist/store/types.d.ts +0 -50
- package/dist/store/types.js +0 -2
- package/dist/store/vector-backend.d.ts +0 -43
- package/dist/store/vector-backend.js +0 -2
- /package/dist/{checkpointer → cjs/checkpointer}/types.js +0 -0
- /package/dist/{factory → cjs/factory}/types.js +0 -0
- /package/dist/{history → cjs/history}/types.js +0 -0
- /package/dist/{shared → cjs/shared}/options.js +0 -0
- /package/dist/{shared/dynamodb → cjs/store}/types.js +0 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hides the checkpointer's collaborators behind LangGraph's saver contract.
|
|
3
|
+
*
|
|
4
|
+
* `DynamoDBSaver` is the `BaseCheckpointSaver` a graph is handed: it resolves
|
|
5
|
+
* its client, offloader, logger and retry policy once and delegates each
|
|
6
|
+
* read and write to one action, save `getDeltaChannelHistory`, whose walk
|
|
7
|
+
* lives in `internal/delta-history` instead. Every method is also the error
|
|
8
|
+
* boundary, so a raw AWS SDK error never reaches a caller unclassified
|
|
9
|
+
* (record 13) — an asynchronous one through `guardPublic`/`guardPublicIterable`,
|
|
10
|
+
* and the synchronous `destroy`, which releases what the saver owns, through
|
|
11
|
+
* `guardPublicSync`. Actions can be split, merged or reordered without the
|
|
12
|
+
* public surface moving.
|
|
13
|
+
*/
|
|
14
|
+
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
15
|
+
import { BaseCheckpointSaver, type ChannelVersions, type Checkpoint, type CheckpointListOptions, type CheckpointMetadata, type CheckpointTuple, type DeltaChannelHistory, type PendingWrite } from '@langchain/langgraph-checkpoint';
|
|
16
|
+
import type { CancelOptions } from '../shared/options.js';
|
|
17
|
+
import type { DeltaChannelHistoryOptions, DynamoDBSaverOptions } from './types.js';
|
|
18
|
+
/**
|
|
19
|
+
* DynamoDB-backed LangGraph checkpoint saver. Every public method rejects only
|
|
20
|
+
* with this library's error, whose `code` says what failed — an AWS failure
|
|
21
|
+
* included.
|
|
22
|
+
*/
|
|
23
|
+
export declare class DynamoDBSaver extends BaseCheckpointSaver {
|
|
24
|
+
private readonly context;
|
|
25
|
+
private readonly shell;
|
|
26
|
+
/**
|
|
27
|
+
* Accepts: `options` — validated here, so a misconfiguration surfaces at
|
|
28
|
+
* construction rather than on the first request. `options.serde` reaches the
|
|
29
|
+
* base class, which is why the resolved `this.serde` is what the context
|
|
30
|
+
* gets.
|
|
31
|
+
*
|
|
32
|
+
* Returns: a saver that owns the client it built, or borrows the one it was
|
|
33
|
+
* given.
|
|
34
|
+
*
|
|
35
|
+
* Throws: `VALIDATION` naming the offending option.
|
|
36
|
+
*
|
|
37
|
+
* Guarantees: no I/O. Constructing a saver issues no request, so it is safe
|
|
38
|
+
* at module scope and in a Lambda's init phase.
|
|
39
|
+
*/
|
|
40
|
+
constructor(options: DynamoDBSaverOptions);
|
|
41
|
+
/**
|
|
42
|
+
* Read one checkpoint with its metadata and pending writes.
|
|
43
|
+
*
|
|
44
|
+
* Accepts: `config` — an object; `config.configurable`, when present, an
|
|
45
|
+
* object too. `config.configurable.checkpoint_id` — names the checkpoint, and
|
|
46
|
+
* `thread_ts` is read in its place when it is absent; the absence of both
|
|
47
|
+
* asks for the newest in the namespace. `checkpoint_ns` defaults to the root
|
|
48
|
+
* namespace. A config naming no `thread_id` is accepted: its other
|
|
49
|
+
* identifiers are still validated. `config.signal` — aborts the reads.
|
|
50
|
+
*
|
|
51
|
+
* Returns: the tuple, or `undefined` for an unknown thread, an unknown
|
|
52
|
+
* checkpoint, a config naming no thread, or a checkpoint whose payload row is
|
|
53
|
+
* gone — a thread being deleted, or an expiry sweep that reached it first.
|
|
54
|
+
*
|
|
55
|
+
* Throws: `VALIDATION`, before any read, naming `config` for a config that
|
|
56
|
+
* is not an object, `configurable` for a `configurable` that is present and
|
|
57
|
+
* not an object, `signal` for a signal that is not `AbortSignal`-shaped, or
|
|
58
|
+
* `thread_id`, `checkpoint_ns`, `checkpoint_id` or `thread_ts` for a
|
|
59
|
+
* malformed identifier, and — from a row rather than from the call —
|
|
60
|
+
* `descriptor` for a payload descriptor no reader could make sense of, `s3`
|
|
61
|
+
* for an offloaded row with no offloader configured, `s3Key` for a row
|
|
62
|
+
* addressing an object outside the thread's own path, or `serde` for a
|
|
63
|
+
* payload the configured serializer refuses to reconstruct;
|
|
64
|
+
* `FORMAT_UNSUPPORTED` for a row, or a payload, a newer release wrote;
|
|
65
|
+
* `PAYLOAD_CORRUPT` for a payload that is no longer the form its row
|
|
66
|
+
* declares; `S3_OFFLOAD_FAILED` for an offloaded payload that cannot be
|
|
67
|
+
* downloaded; `COMPRESSION_LIMIT` for one whose decompressed size would pass
|
|
68
|
+
* the cap; a classified AWS failure; `RETRY_EXHAUSTED`; `ABORTED`.
|
|
69
|
+
*
|
|
70
|
+
* Guarantees: strongly consistent, so a checkpoint just written is always
|
|
71
|
+
* seen.
|
|
72
|
+
*/
|
|
73
|
+
getTuple(config: RunnableConfig): Promise<CheckpointTuple | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Stream checkpoints newest first — within a thread, and across threads
|
|
76
|
+
* through the recency index; the table scan a thread-less call falls back to
|
|
77
|
+
* without `indexName` yields in the table's own order, oldest first within a
|
|
78
|
+
* thread and threads in no particular order.
|
|
79
|
+
*
|
|
80
|
+
* Accepts: `config` — one namespace, every namespace of a thread when
|
|
81
|
+
* `checkpoint_ns` is omitted, or every thread in the table when `thread_id`
|
|
82
|
+
* is omitted, which is a table scan, or a read of the recency index when
|
|
83
|
+
* `indexName` is set. `options.before`, `options.filter` and
|
|
84
|
+
* `options.limit` follow the reference savers; `limit: 0` yields nothing,
|
|
85
|
+
* and a negative one is refused rather than answered with nothing, so that a
|
|
86
|
+
* page size whose computation went wrong is reported instead of hidden.
|
|
87
|
+
*
|
|
88
|
+
* Returns: an async generator over the tuples. Abandoning it stops the read,
|
|
89
|
+
* so a consumer that breaks early pays for no further page.
|
|
90
|
+
*
|
|
91
|
+
* Throws: `VALIDATION`, raised from the first `.next()`, since a
|
|
92
|
+
* generator runs none of its body until pulled, and before any read: naming
|
|
93
|
+
* `config`, `configurable` or `signal` for a config of the wrong shape, as
|
|
94
|
+
* {@link getTuple} does, or `thread_id`, `checkpoint_ns`, `checkpoint_id` or
|
|
95
|
+
* `thread_ts` for a malformed identifier — all checked before `options`;
|
|
96
|
+
* then `options` for options that are not an object, `filter` for a filter
|
|
97
|
+
* that is not an object, `limit` for a limit that is not an integer from 0 to
|
|
98
|
+
* 10,000, and `before` for a `before` that is not an
|
|
99
|
+
* object or whose `configurable.checkpoint_id` is
|
|
100
|
+
* neither absent (`undefined`, `null` or `''`) nor a well-formed checkpoint
|
|
101
|
+
* id. `FORMAT_UNSUPPORTED`; `RESULT_TRUNCATED`, without a `thread_id` and
|
|
102
|
+
* with `indexName`, for an index shard whose pages do not end; a classified AWS failure;
|
|
103
|
+
* `RETRY_EXHAUSTED`; `ABORTED`. An option key this version does not read is
|
|
104
|
+
* ignored rather than refused: LangGraph defines these options and passes
|
|
105
|
+
* its own through (`getStateHistory`), so a key it adds must not turn a
|
|
106
|
+
* listing into a refusal (decision record 28).
|
|
107
|
+
*
|
|
108
|
+
* Guarantees: eventually consistent — a listing tolerates the replica lag
|
|
109
|
+
* `getTuple` does not.
|
|
110
|
+
* @remarks One read per page — or, without a `thread_id` and with `indexName`,
|
|
111
|
+
* at least one query per index shard per page of 100 rows — plus two per
|
|
112
|
+
* yielded tuple (see the README cost table).
|
|
113
|
+
*/
|
|
114
|
+
list(config: RunnableConfig, options?: CheckpointListOptions): AsyncGenerator<CheckpointTuple>;
|
|
115
|
+
/**
|
|
116
|
+
* Store a checkpoint and its metadata in one transaction.
|
|
117
|
+
*
|
|
118
|
+
* Accepts: `config` — shaped as {@link getTuple} requires, and naming a
|
|
119
|
+
* `thread_id`. `config.configurable.checkpoint_id` — becomes the new
|
|
120
|
+
* checkpoint's parent. `config.signal` — aborts the write. `checkpoint` —
|
|
121
|
+
* every channel value it carries is stored. `newVersions` — accepted to
|
|
122
|
+
* satisfy `BaseCheckpointSaver.put` and deliberately ignored: LangGraph passes
|
|
123
|
+
* it empty for a fork and for an empty update, so narrowing by it would store
|
|
124
|
+
* nothing for either (decision record 10).
|
|
125
|
+
*
|
|
126
|
+
* Returns: the config addressing the stored checkpoint, which is what the
|
|
127
|
+
* caller passes back to continue the thread.
|
|
128
|
+
*
|
|
129
|
+
* Throws: `VALIDATION` naming `config`, `configurable` or `signal` for a
|
|
130
|
+
* config of the wrong shape, `thread_id` for a missing or malformed thread
|
|
131
|
+
* id, `checkpoint_ns`, `checkpoint_id` or `thread_ts` for a malformed
|
|
132
|
+
* identifier, `checkpoint` for a `null` or `undefined` checkpoint,
|
|
133
|
+
* `checkpoint_id` for a malformed `checkpoint.id`, `payload` for a payload
|
|
134
|
+
* too large to store inline without `s3`, or, once offloaded, larger than
|
|
135
|
+
* `s3.maxDownloadBytes`; `s3Key` for an offloaded object's key over S3's
|
|
136
|
+
* cap; `S3_OFFLOAD_FAILED` when an offloaded payload cannot be uploaded;
|
|
137
|
+
* a classified AWS failure; `RETRY_EXHAUSTED`; `ABORTED`.
|
|
138
|
+
*
|
|
139
|
+
* Guarantees: both rows land or neither does. Writing the same
|
|
140
|
+
* `checkpoint.id` again replaces both, so a retry is safe. Each put uploads
|
|
141
|
+
* its offloaded payloads under an id of its own, so the objects the replaced
|
|
142
|
+
* rows named are not deleted with them: they are left to the lifecycle rule
|
|
143
|
+
* `ensureS3LifecycleRule()` provisions.
|
|
144
|
+
*/
|
|
145
|
+
put(config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata, _newVersions?: ChannelVersions): Promise<RunnableConfig>;
|
|
146
|
+
/**
|
|
147
|
+
* Store a task's pending writes for the checkpoint `config` names.
|
|
148
|
+
*
|
|
149
|
+
* Accepts: `config` — shaped as {@link getTuple} requires, naming a
|
|
150
|
+
* `thread_id` and a `checkpoint_id`, since writes attach to a checkpoint.
|
|
151
|
+
* `config.signal` — aborts the writes. `writes` — an array of
|
|
152
|
+
* `[channel, value]` arrays, one row each: a special channel's row is
|
|
153
|
+
* written alongside the rest, a regular row at most 32 at a time; an empty
|
|
154
|
+
* list writes nothing. `taskId` — validated as the key segment it becomes.
|
|
155
|
+
* `taskPath` — the task's serialized path, which LangGraph 1.5 passes
|
|
156
|
+
* (`@langchain/langgraph-checkpoint@1.2.0`) and earlier LangGraphs do not;
|
|
157
|
+
* stored beside every row of the call, and the first key of the order
|
|
158
|
+
* `getTuple`, `list` and `getDeltaChannelHistory` read a checkpoint's
|
|
159
|
+
* writes back in (the reference's `writesSortKey`: path, then task id, then
|
|
160
|
+
* index, strings compared by code point). A row written without one sorts
|
|
161
|
+
* as the empty path, first.
|
|
162
|
+
*
|
|
163
|
+
* Returns: nothing. Losing a first-write-wins race is a normal outcome, not
|
|
164
|
+
* a failure.
|
|
165
|
+
*
|
|
166
|
+
* Throws: `VALIDATION` naming `taskId` for a malformed task id, or
|
|
167
|
+
* `taskPath` for a path that is not a string; `config`,
|
|
168
|
+
* `configurable` or `signal` for a config of the wrong shape; `thread_id`,
|
|
169
|
+
* `checkpoint_ns`, `checkpoint_id` or `thread_ts` for a malformed
|
|
170
|
+
* identifier, and `checkpoint_id` when the config names none; `writes` for
|
|
171
|
+
* writes that is not an array, or holds an entry that is not one; `channel`
|
|
172
|
+
* for a malformed channel; `sortKey` for identifiers composing a sort key
|
|
173
|
+
* over DynamoDB's cap; `payload` for a value too large to store inline
|
|
174
|
+
* without `s3`, or, once offloaded, larger than `s3.maxDownloadBytes`; or
|
|
175
|
+
* `s3Key` for an offloaded object's key over S3's cap. `S3_OFFLOAD_FAILED`;
|
|
176
|
+
* a classified AWS failure; `RETRY_EXHAUSTED`; `ABORTED`.
|
|
177
|
+
*
|
|
178
|
+
* Guarantees: regular writes are first-write-wins; special channels
|
|
179
|
+
* (`__interrupt__`, `__resume__`, `__error__`, `__scheduled__`) overwrite,
|
|
180
|
+
* with `s3` through a compare-and-swap on the row each call observed, so that
|
|
181
|
+
* each call releases the payload it superseded rather than one a concurrent
|
|
182
|
+
* call already replaced. An offloaded object can still be orphaned and left
|
|
183
|
+
* to the lifecycle rule: when the compare-and-swap is exhausted and the write
|
|
184
|
+
* overwrites unconditionally, when a delete fails, when the row cannot be read
|
|
185
|
+
* before the write, when a failed write cannot be verified, or in one
|
|
186
|
+
* double-fault interleaving (see the README's S3 offloading notes).
|
|
187
|
+
*/
|
|
188
|
+
putWrites(config: RunnableConfig, writes: PendingWrite[], taskId: string, taskPath?: string): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Delete every checkpoint, payload and pending write of a thread.
|
|
191
|
+
*
|
|
192
|
+
* Accepts: `threadId` — validated. `options.signal` — ends the read or
|
|
193
|
+
* delete in flight and any wait between them; the deletes already
|
|
194
|
+
* acknowledged stay deleted.
|
|
195
|
+
*
|
|
196
|
+
* Returns: nothing. Deleting a thread that does not exist is not an error.
|
|
197
|
+
*
|
|
198
|
+
* Throws: `VALIDATION` naming `options` for options that are not an
|
|
199
|
+
* object, `options.<key>` for a key this package does not read, `signal`
|
|
200
|
+
* for a signal that is not `AbortSignal`-shaped, or `thread_id` for a
|
|
201
|
+
* malformed `threadId`;
|
|
202
|
+
* `BATCH_WRITE_INCOMPLETE` when a row's delete fails, counting rows
|
|
203
|
+
* rather than batches and carrying what did succeed; a classified AWS failure;
|
|
204
|
+
* `ABORTED` when the signal fires, which is what a cancel surfaces as
|
|
205
|
+
* rather than an incomplete delete, even when it fires part-way through the
|
|
206
|
+
* pass. A row refused because it was rewritten after the partition read
|
|
207
|
+
* raises nothing: it is left exactly as its writer left it, reported at
|
|
208
|
+
* `warn`, and counted as skipped.
|
|
209
|
+
*
|
|
210
|
+
* Guarantees: a row this adapter did not write is left in place and logged,
|
|
211
|
+
* and neither is a row rewritten since the read — so an acknowledged write is
|
|
212
|
+
* no longer erased, nor the object it names released, by a delete that
|
|
213
|
+
* observed the row before it. Single pass: call it when the thread is
|
|
214
|
+
* quiescent, since a checkpoint written at a key the read never saw survives
|
|
215
|
+
* it, and so does the re-landing of an inline pending write, which carries no
|
|
216
|
+
* request token on purpose. What comes back there is an ordinary row, naming
|
|
217
|
+
* no object this call could have released.
|
|
218
|
+
*/
|
|
219
|
+
deleteThread(threadId: string, options?: CancelOptions): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Walk a checkpoint's ancestors for the delta channels named, returning each
|
|
222
|
+
* channel's on-path writes oldest-first and its nearest stored value.
|
|
223
|
+
*
|
|
224
|
+
* Overrides the inherited walk, which stops silently at an ancestor it cannot
|
|
225
|
+
* read and lets the consumer restart the channel from empty. A TTL computed
|
|
226
|
+
* per put puts that within reach here, so an ancestor a channel still needs
|
|
227
|
+
* that has expired is reported instead of dropped.
|
|
228
|
+
*
|
|
229
|
+
* Accepts: `options` — an object carrying `config` and `channels`, the
|
|
230
|
+
* shape `BaseCheckpointSaver`'s own signature declares; LangGraph calls this
|
|
231
|
+
* itself, so a key a later LangGraph adds is ignored rather than refused
|
|
232
|
+
* (decision record 28). `options.channels` — the delta channels to rebuild, required; an empty
|
|
233
|
+
* array reads nothing rather than being refused, since it is a legitimate
|
|
234
|
+
* "nothing to rebuild" request. `options.config` — the checkpoint to walk
|
|
235
|
+
* back from, shaped as {@link getTuple} requires and checked for that shape
|
|
236
|
+
* even when there is nothing to read; its `signal` aborts the whole walk —
|
|
237
|
+
* every ancestor read, not only the first — and the hop it fires on is the
|
|
238
|
+
* last read the call makes.
|
|
239
|
+
*
|
|
240
|
+
* Returns: per channel, its on-path writes oldest-first and the nearest
|
|
241
|
+
* stored value found.
|
|
242
|
+
*
|
|
243
|
+
* Throws: `VALIDATION` naming `options` for options that are not an
|
|
244
|
+
* object, `config`, `configurable` or
|
|
245
|
+
* `signal` for a config of the wrong shape, or `channels` for a value that
|
|
246
|
+
* is not an array of strings, and, once a channel is named, `thread_id`,
|
|
247
|
+
* `checkpoint_ns`, `checkpoint_id` or `thread_ts` for a malformed
|
|
248
|
+
* identifier; `ANCESTOR_EXPIRED` when a checkpoint a channel still needs has
|
|
249
|
+
* expired or is gone, or the chain of parents loops; a classified AWS
|
|
250
|
+
* failure; `RETRY_EXHAUSTED`; `ABORTED`, which a walk
|
|
251
|
+
* cancelled as it reached an expired ancestor reports in place of
|
|
252
|
+
* `ANCESTOR_EXPIRED`.
|
|
253
|
+
*
|
|
254
|
+
* Guarantees: the walk stops at the first ancestor answering for every
|
|
255
|
+
* channel, so a deep thread costs reads only as far back as the nearest
|
|
256
|
+
* snapshot.
|
|
257
|
+
*/
|
|
258
|
+
getDeltaChannelHistory(options: DeltaChannelHistoryOptions): Promise<Record<string, DeltaChannelHistory>>;
|
|
259
|
+
/**
|
|
260
|
+
* Release owned resources.
|
|
261
|
+
*
|
|
262
|
+
* Accepts: nothing.
|
|
263
|
+
*
|
|
264
|
+
* Returns: nothing. Idempotent, and a no-op for a client the caller injected
|
|
265
|
+
* — that one is theirs to close.
|
|
266
|
+
*
|
|
267
|
+
* Throws: the first failure a resource's own `destroy` raised, as a
|
|
268
|
+
* `DynamoDBLangGraphError` (`UNEXPECTED_ERROR` unless the failure was AWS's)
|
|
269
|
+
* with it as `cause` — raised only after every other resource has been
|
|
270
|
+
* released, and only by the first call: `destroy()` is idempotent.
|
|
271
|
+
*/
|
|
272
|
+
destroy(): void;
|
|
273
|
+
/**
|
|
274
|
+
* Provision an S3 lifecycle expiration rule matching the configured TTL, so
|
|
275
|
+
* offloaded payloads don't outlive the items that point at them.
|
|
276
|
+
*
|
|
277
|
+
* Accepts: nothing; the rule follows the configured `s3` and `ttl`. A no-op
|
|
278
|
+
* without both, since there would be no bucket to rule over or no expiry to
|
|
279
|
+
* match.
|
|
280
|
+
*
|
|
281
|
+
* Returns: nothing. Installing a rule that is already there is a no-op too,
|
|
282
|
+
* so calling it on every deploy is safe. When it writes the rules but
|
|
283
|
+
* cannot confirm within its polling window that a re-read shows them — S3
|
|
284
|
+
* documents that a lifecycle configuration can take minutes to propagate —
|
|
285
|
+
* it logs a `warn` and returns rather than throwing: the rules were
|
|
286
|
+
* written, and a later call can confirm them.
|
|
287
|
+
*
|
|
288
|
+
* Throws: `VALIDATION` naming `s3.keyPrefix` on a rule-id collision;
|
|
289
|
+
* a classified AWS failure when the bucket's lifecycle cannot be read or
|
|
290
|
+
* written; `CONTENTION` when every one of the five rounds this call polls
|
|
291
|
+
* needs a write — a competing writer replacing the configuration on every
|
|
292
|
+
* single re-read.
|
|
293
|
+
* @remarks Needs the bucket-level `s3:GetLifecycleConfiguration` and
|
|
294
|
+
* `s3:PutLifecycleConfiguration` permissions, which are broader than the
|
|
295
|
+
* object-level CRUD the rest of S3 offload needs. Call it once at deployment,
|
|
296
|
+
* not per request — and when several adapters or processes provision the
|
|
297
|
+
* same bucket, call them one at a time and run each again after a few
|
|
298
|
+
* minutes once every one of them has run.
|
|
299
|
+
*
|
|
300
|
+
* Lowering the `ttl` is safe for new rows at once; the rule is not. Lower
|
|
301
|
+
* `ttl` now, and call this again only once the old `ttl` has elapsed since,
|
|
302
|
+
* because until then rows written under the old value still name objects
|
|
303
|
+
* the shorter rule would expire. Raising the `ttl` is safe at once.
|
|
304
|
+
*/
|
|
305
|
+
ensureS3LifecycleRule(): Promise<void>;
|
|
306
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoDBSaver = void 0;
|
|
4
|
+
const langgraph_checkpoint_1 = require("@langchain/langgraph-checkpoint");
|
|
5
|
+
const boundary_js_1 = require("../shared/errors/boundary.js");
|
|
6
|
+
const collaborators_js_1 = require("../shared/validation/collaborators.js");
|
|
7
|
+
const option_shape_js_1 = require("../shared/validation/option-shape.js");
|
|
8
|
+
const delete_thread_js_1 = require("./actions/delete-thread.js");
|
|
9
|
+
const get_tuple_js_1 = require("./actions/get-tuple.js");
|
|
10
|
+
const list_js_1 = require("./actions/list.js");
|
|
11
|
+
const put_writes_js_1 = require("./actions/put-writes.js");
|
|
12
|
+
const put_js_1 = require("./actions/put.js");
|
|
13
|
+
const delta_history_js_1 = require("./internal/delta-history.js");
|
|
14
|
+
const parse_js_1 = require("./internal/parse.js");
|
|
15
|
+
const setup_js_1 = require("./internal/setup.js");
|
|
16
|
+
class DynamoDBSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
17
|
+
context;
|
|
18
|
+
shell;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
super((0, option_shape_js_1.parseShape)(options, setup_js_1.SAVER_KEYS, 'options').serde);
|
|
21
|
+
const setup = (0, setup_js_1.setUpCheckpointer)(options, this.serde);
|
|
22
|
+
this.context = setup.context;
|
|
23
|
+
this.shell = setup.shell;
|
|
24
|
+
}
|
|
25
|
+
async getTuple(config) {
|
|
26
|
+
return (0, boundary_js_1.guardPublic)('saver.getTuple', () => (0, get_tuple_js_1.getCheckpointTuple)(this.context, config), this.context.tableName);
|
|
27
|
+
}
|
|
28
|
+
list(config, options) {
|
|
29
|
+
return (0, boundary_js_1.guardPublicIterable)('saver.list', (0, list_js_1.listCheckpoints)(this.context, config, options), this.context.tableName);
|
|
30
|
+
}
|
|
31
|
+
async put(config, checkpoint, metadata, _newVersions) {
|
|
32
|
+
return (0, boundary_js_1.guardPublic)('saver.put', () => (0, put_js_1.putCheckpoint)(this.context, config, checkpoint, metadata), this.context.tableName);
|
|
33
|
+
}
|
|
34
|
+
async putWrites(config, writes, taskId, taskPath) {
|
|
35
|
+
return (0, boundary_js_1.guardPublic)('saver.putWrites', () => (0, put_writes_js_1.putWrites)(this.context, config, writes, taskId, taskPath), this.context.tableName);
|
|
36
|
+
}
|
|
37
|
+
async deleteThread(threadId, options) {
|
|
38
|
+
return (0, boundary_js_1.guardPublic)('saver.deleteThread', () => {
|
|
39
|
+
(0, collaborators_js_1.assertCancelOptions)(options);
|
|
40
|
+
return (0, delete_thread_js_1.deleteThread)(this.context, threadId, options);
|
|
41
|
+
}, this.context.tableName);
|
|
42
|
+
}
|
|
43
|
+
getDeltaChannelHistory(options) {
|
|
44
|
+
return (0, boundary_js_1.guardPublic)('saver.getDeltaChannelHistory', () => {
|
|
45
|
+
const request = (0, parse_js_1.parseDeltaHistoryRequest)(options);
|
|
46
|
+
return (0, delta_history_js_1.deltaChannelHistory)(this.context, (c) => this.getTuple(c), request.config, request.channels);
|
|
47
|
+
}, this.context.tableName);
|
|
48
|
+
}
|
|
49
|
+
destroy() {
|
|
50
|
+
(0, boundary_js_1.guardPublicSync)('saver.destroy', () => this.shell.release(), this.context.tableName);
|
|
51
|
+
}
|
|
52
|
+
async ensureS3LifecycleRule() {
|
|
53
|
+
return (0, boundary_js_1.guardPublic)('saver.ensureS3LifecycleRule', () => this.shell.ensureLifecycleRule(), this.context.tableName);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.DynamoDBSaver = DynamoDBSaver;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hides the saver's own modules from the shapes a caller types against.
|
|
3
|
+
*
|
|
4
|
+
* The saver's options and the options its delta-channel walk accepts are
|
|
5
|
+
* declared here, apart from the saver and its actions, so a caller can type
|
|
6
|
+
* what it builds without importing either. The narrowed `configurable` is
|
|
7
|
+
* declared beside them for the parser that reads it, not for a caller. The
|
|
8
|
+
* delta-channel options are pinned equal to upstream's inline parameter
|
|
9
|
+
* type, so they change only when LangGraph's do.
|
|
10
|
+
*/
|
|
11
|
+
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
12
|
+
import type { SerializerProtocol } from '@langchain/langgraph-checkpoint';
|
|
13
|
+
import type { BaseAdapterOptions, CodecOptions } from '../shared/options.js';
|
|
14
|
+
/** Options for {@link DynamoDBSaver}. */
|
|
15
|
+
export type DynamoDBSaverOptions = BaseAdapterOptions & CodecOptions & {
|
|
16
|
+
/**
|
|
17
|
+
* Optional serializer override. The default is the base class's, which is
|
|
18
|
+
* LangGraph's `JsonPlusSerializer` — **not** the plain JSON serializer the
|
|
19
|
+
* store and chat-history adapters default to. The two differ on read as
|
|
20
|
+
* well as on write: `JsonPlusSerializer` reconstructs a `Map`, a `Set`, a
|
|
21
|
+
* `Uint8Array` or an allow-listed `langchain_core` class from the `lc`
|
|
22
|
+
* record a stored row carries, so the row selects which constructor runs,
|
|
23
|
+
* while plain JSON parses and reconstructs nothing. Pass the exported
|
|
24
|
+
* `JSON_SERDE` for the narrower read path, at the cost of the JSON
|
|
25
|
+
* projection the README's *Table schema* section tabulates.
|
|
26
|
+
*/
|
|
27
|
+
serde?: SerializerProtocol;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Options {@link DynamoDBSaver.getDeltaChannelHistory} accepts: the object
|
|
31
|
+
* `BaseCheckpointSaver.getDeltaChannelHistory` declares inline, named so a
|
|
32
|
+
* caller can type the options it builds. A test pins it equal to upstream's
|
|
33
|
+
* parameter type.
|
|
34
|
+
*/
|
|
35
|
+
export interface DeltaChannelHistoryOptions {
|
|
36
|
+
/** The checkpoint to walk back from; must be an object. */
|
|
37
|
+
config: RunnableConfig;
|
|
38
|
+
/**
|
|
39
|
+
* The delta channels to rebuild, as an array of strings; `[]` reads nothing
|
|
40
|
+
* and returns `{}`.
|
|
41
|
+
*/
|
|
42
|
+
channels: string[];
|
|
43
|
+
}
|
|
44
|
+
/** Narrowed shape of `RunnableConfig.configurable` the saver relies on. */
|
|
45
|
+
export interface CheckpointConfigurable {
|
|
46
|
+
thread_id: string;
|
|
47
|
+
checkpoint_ns?: string;
|
|
48
|
+
checkpoint_id?: string;
|
|
49
|
+
/** Legacy alias of `checkpoint_id` that older callers and API-shaped configs still emit. */
|
|
50
|
+
thread_ts?: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hides how several adapters share one client and one set of defaults.
|
|
3
|
+
*
|
|
4
|
+
* A caller states its defaults once; which adapter gets the base client
|
|
5
|
+
* choice and which its own, how the DynamoDB region reaches a shared `s3`
|
|
6
|
+
* config, and who destroys a client the factory built rather than was handed
|
|
7
|
+
* are decided here. Teardown is total — one adapter failing to release cannot
|
|
8
|
+
* strand the others — and a `createAll` that fails partway releases what it
|
|
9
|
+
* had built before its own error propagates.
|
|
10
|
+
*/
|
|
11
|
+
import { DynamoDBSaver } from '../checkpointer/saver.js';
|
|
12
|
+
import type { DynamoDBSaverOptions } from '../checkpointer/types.js';
|
|
13
|
+
import { DynamoDBChatMessageHistory } from '../history/chat-message-history.js';
|
|
14
|
+
import type { DynamoDBChatMessageHistoryOptions } from '../history/types.js';
|
|
15
|
+
import { DynamoDBStore } from '../store/store.js';
|
|
16
|
+
import type { DynamoDBStoreOptions } from '../store/types.js';
|
|
17
|
+
import type { CreateAllOptions, CreatedAdapters, FactoryBaseOptions } from './types.js';
|
|
18
|
+
/**
|
|
19
|
+
* Convenience constructors for the adapters.
|
|
20
|
+
*
|
|
21
|
+
* Individual `create*` methods each build one adapter, on the factory's `client`
|
|
22
|
+
* when it was given one and otherwise on a client of their own; {@link createAll}
|
|
23
|
+
* builds one shared client used by all three and returns a combined `destroy`
|
|
24
|
+
* that tears everything down once. Each adapter validates the options it ends
|
|
25
|
+
* up with, so the same mistake is caught the same way however the adapter was
|
|
26
|
+
* built. The factory checks only what it reads itself before an adapter can:
|
|
27
|
+
* its own base options, client choice and logger, the keys of `createAll`'s
|
|
28
|
+
* argument, and that each adapter's options are an object at all.
|
|
29
|
+
*
|
|
30
|
+
* Every `create*` argument and every `createAll` section is one adapter's
|
|
31
|
+
* options, and a mistake in one is named the way that adapter's constructor
|
|
32
|
+
* names it: `options` for a value that is not an object, and the adapter's own
|
|
33
|
+
* field names (`options.<key>`, `tableName`, …) for anything inside one.
|
|
34
|
+
*/
|
|
35
|
+
export declare class DynamoDBFactory {
|
|
36
|
+
private readonly base;
|
|
37
|
+
/**
|
|
38
|
+
* Accepts: `base` — the defaults every adapter inherits. Checked here, where
|
|
39
|
+
* the caller wrote them: an unknown key would otherwise be ignored, and a
|
|
40
|
+
* `client` next to a `clientConfig` was refused by the first `create*` call
|
|
41
|
+
* and accepted by `createAll`, for the same base. So is the shape of
|
|
42
|
+
* `clientConfig`: `createAll` hands its adapters the client built from it,
|
|
43
|
+
* never the config, so no adapter would see a malformed one. And so is
|
|
44
|
+
* `logger`, which `createAll` logs its own teardown failures through: a
|
|
45
|
+
* malformed one threw from inside that teardown, replacing a failed build's
|
|
46
|
+
* own error with a bare `TypeError`.
|
|
47
|
+
*
|
|
48
|
+
* Returns: a factory holding those defaults. It opens nothing: every client
|
|
49
|
+
* is built by the `create*` call that needs one.
|
|
50
|
+
*
|
|
51
|
+
* Throws: `VALIDATION` naming `options.<key>`, `client`, `clientConfig`,
|
|
52
|
+
* `logger` or `logger.<method>`. Everything else each adapter validates for
|
|
53
|
+
* itself, since a per-adapter value may still replace it.
|
|
54
|
+
*/
|
|
55
|
+
constructor(base?: FactoryBaseOptions);
|
|
56
|
+
/** The base options every adapter inherits regardless of which client it uses. */
|
|
57
|
+
private sharedDefaults;
|
|
58
|
+
/**
|
|
59
|
+
* An `s3` config with the region the DynamoDB side was configured with
|
|
60
|
+
* filled in, when it names none of its own.
|
|
61
|
+
*
|
|
62
|
+
* An adapter normally reads that region off its own `clientConfig`
|
|
63
|
+
* (`offloaderConfigFor`), but the adapters {@link createAll} builds are given
|
|
64
|
+
* the one shared `client` instead — and a `clientConfig` beside a `client` is
|
|
65
|
+
* refused, because for the DynamoDB client it would be silently ignored. So
|
|
66
|
+
* the region has to be carried here, on the config that still needs it:
|
|
67
|
+
* without it, a bucket reachable only through that region fails with an
|
|
68
|
+
* opaque `PermanentRedirect` on the first offload, unlike the identical
|
|
69
|
+
* configuration through `createStore`, which resolves its own region
|
|
70
|
+
* directly. It is asked of the `s3` an adapter ends up with — the base one,
|
|
71
|
+
* or a section's own, which replaces the base one whole — so neither is left
|
|
72
|
+
* without the region the other would have had.
|
|
73
|
+
*
|
|
74
|
+
* An `s3`, or its `clientConfig`, that is not an object is handed on
|
|
75
|
+
* unchanged, for each adapter to refuse by its own name: reading `.region`
|
|
76
|
+
* off a `null` one would throw here instead, and writing a region into a
|
|
77
|
+
* malformed `clientConfig` would turn it into an object shape an adapter
|
|
78
|
+
* then accepts instead of refusing.
|
|
79
|
+
*/
|
|
80
|
+
private withTableRegion;
|
|
81
|
+
/**
|
|
82
|
+
* Per-adapter options replace the factory's client choice as a unit: a
|
|
83
|
+
* `client` handed to `createSaver` also displaces the base `clientConfig`
|
|
84
|
+
* and `createClient`, because carrying those along is exactly the ambiguous
|
|
85
|
+
* combination the adapters' option validation rejects. The shared
|
|
86
|
+
* `ttl`/`compression`/`s3`/`retry` defaults stay either way.
|
|
87
|
+
*/
|
|
88
|
+
private defaultsFor;
|
|
89
|
+
/**
|
|
90
|
+
* A saver, on the factory's `client` when it has one and otherwise on its own.
|
|
91
|
+
*
|
|
92
|
+
* Accepts: `options` — the saver's own, laid over the factory's defaults. A
|
|
93
|
+
* per-adapter value wins, and a key given as `undefined` is not a value;
|
|
94
|
+
* a client choice (`client`, `clientConfig` or neither) replaces the
|
|
95
|
+
* factory's as a unit.
|
|
96
|
+
*
|
|
97
|
+
* Returns: the saver. It owns, and releases on `destroy()`, only a client it
|
|
98
|
+
* built itself; a `client` from the factory is never closed by it.
|
|
99
|
+
*
|
|
100
|
+
* Throws: `VALIDATION` for any invalid option, naming it as the saver's
|
|
101
|
+
* constructor does — `options` for a value that is not an object, checked
|
|
102
|
+
* before the defaults are laid under it: reading `.client` off a `null`
|
|
103
|
+
* value would throw here, and spreading a string would iterate its
|
|
104
|
+
* characters instead of refusing it.
|
|
105
|
+
*/
|
|
106
|
+
createSaver(options: DynamoDBSaverOptions): DynamoDBSaver;
|
|
107
|
+
/**
|
|
108
|
+
* A store, on the factory's `client` when it has one and otherwise on its own.
|
|
109
|
+
*
|
|
110
|
+
* Accepts: as {@link createSaver}, for the store's options.
|
|
111
|
+
*
|
|
112
|
+
* Returns: the store.
|
|
113
|
+
*
|
|
114
|
+
* Throws: as {@link createSaver}.
|
|
115
|
+
*/
|
|
116
|
+
createStore(options: DynamoDBStoreOptions): DynamoDBStore;
|
|
117
|
+
/**
|
|
118
|
+
* A chat history, on the factory's `client` when it has one and otherwise on
|
|
119
|
+
* its own.
|
|
120
|
+
*
|
|
121
|
+
* Accepts: as {@link createSaver}, for the history's options.
|
|
122
|
+
*
|
|
123
|
+
* Returns: the chat history.
|
|
124
|
+
*
|
|
125
|
+
* Throws: as {@link createSaver}.
|
|
126
|
+
*/
|
|
127
|
+
createChatMessageHistory(options: DynamoDBChatMessageHistoryOptions): DynamoDBChatMessageHistory;
|
|
128
|
+
/**
|
|
129
|
+
* Build the adapters whose sections are given, all on one shared client.
|
|
130
|
+
*
|
|
131
|
+
* Accepts: `options` — a section per adapter, laid over the factory's shared
|
|
132
|
+
* defaults; omitting one, or giving it as `undefined`, skips that adapter,
|
|
133
|
+
* and `{}` builds none. A key that is not a section name is refused rather
|
|
134
|
+
* than ignored, so a misspelt one cannot silently build nothing. Each section
|
|
135
|
+
* is that adapter's options, so one that is not an object, `null` included,
|
|
136
|
+
* is refused before any client is built.
|
|
137
|
+
*
|
|
138
|
+
* Returns: the adapters, typed by the sections asked for, and one `destroy`
|
|
139
|
+
* that releases all of them and the shared client. A client the factory was
|
|
140
|
+
* given rather than built is never destroyed.
|
|
141
|
+
*
|
|
142
|
+
* Throws: `VALIDATION` naming `options` for an argument or a section that
|
|
143
|
+
* is not an object, or `options.<key>` for a key that is not a section name.
|
|
144
|
+
* Whatever an adapter's constructor throws — after the adapters already
|
|
145
|
+
* built and the freshly created client have been released, so a failed call
|
|
146
|
+
* leaks nothing and the constructor's own error is the one that propagates.
|
|
147
|
+
*
|
|
148
|
+
* Guarantees: one DynamoDB client for all three adapters, and one S3 client
|
|
149
|
+
* per adapter, each under its own key prefix in the shared bucket. Teardown
|
|
150
|
+
* is total: one adapter failing to release its resources cannot strand the
|
|
151
|
+
* others.
|
|
152
|
+
*/
|
|
153
|
+
createAll<O extends CreateAllOptions>(options: O): CreatedAdapters<O>;
|
|
154
|
+
}
|