{"_id":"@aws-blocks/bb-distributed-table","_rev":"9-0113d51560fbde1b33b50385db7dab71","name":"@aws-blocks/bb-distributed-table","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.0","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.0","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"dist":{"shasum":"8d575f092da568a98cbe5e396520081027982f43","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.0.tgz","fileCount":48,"integrity":"sha512-RkfI0HzPdPCHLjDKKhvoTfGgwxi/C/yFRk1znliWPGRjKfBjoztb4BHjTejFV1UxbzOogDkfnp4UfVEVH7HcQQ==","signatures":[{"sig":"MEYCIQDW/gNkDgQUgXC2mtJraP76NWHZLGWLvSJnzqqXuePriwIhAJ4JBVkh56zVxGa3hHOs0dU5C99Wtxed/m8DnH5Imj4p","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":312802},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"639f6fad510d473abd72286351b3294a646d9895","scripts":{"test":"node --test dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@aws-blocks/core":"^0.1.0","@aws-blocks/bb-logger":"^0.1.0","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.0_1781566759789_0.669074687867975","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.1","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.1","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"dist":{"shasum":"7a335626a471b2375f48c03d8fce4af872005a30","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.1.tgz","fileCount":48,"integrity":"sha512-wF70c4haPKoh1MvBG+UOSwQQHa40andi5ElxsobJai1eu6dGQLicCW0BAz31HJrqy9YxlRAhGIVVDYm4VfiZdQ==","signatures":[{"sig":"MEQCICEDHiVh7YF02b31rX+WVDGH6im8dz9VQEhD82VBWKbHAiBaPrCWyebxyOoTSAjF20A3dyFJ/kRT4lXeg+3+Bm3awA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":312713},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"ed3e0ad5724d28c2a2fb0ea9207dfc9e941257f9","scripts":{"test":"node --test dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@aws-blocks/core":"^0.1.1","@aws-blocks/bb-logger":"^0.1.1","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.1_1781633765167_0.8311402136042152","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.2","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.2","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"dist":{"shasum":"48c5b9b585b2a0b9d315044b97f9e8caaebd225d","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.2.tgz","fileCount":48,"integrity":"sha512-TjlF3VbrkDAdb3DMODMOhf/6uHwWtVxMlGihp3RYqBHNm562pjz1FrH9avs/Mbt/D4PggoabTEoyKU1ndFCD2A==","signatures":[{"sig":"MEYCIQDW9sJZW5RbMsmIzNfUat58OJNCFkkz7MLXoQemVhZvfAIhAKShFfh7Y+JouEkBMa71qVZq27heyLrRuQtwV2z0Tc47","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":312734},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"4c367f4fb4d80d7b98dfe0296573d48aaf4b1ddf","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@aws-blocks/core":"^0.1.2","@aws-blocks/bb-logger":"^0.1.1","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.2_1781753360047_0.12385670756499745","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.3","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.3","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"dist":{"shasum":"febf65751934fe4abdbb2d77c994f0bbfa3235bd","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.3.tgz","fileCount":49,"integrity":"sha512-7TrTLAMFM39qog8xxzbH98brsuVzzbO7ZYTIRqLPl7K4K6B38cLNaEC4+KWFnsIV4MUvHMRwzc1zEylvcP9H8A==","signatures":[{"sig":"MEUCICdFqNA/JLhU7PDoivJH16DwHVUgCVI7SF9aaGSV/a6+AiEAz2CRmIgd04DFVX2nbmQoZt9MXuCoqtLktzgbD33hHTw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":329494},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"3328f36992d39dc20b0c0d760e4a38c866ddfbbd","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@aws-blocks/core":"^0.1.2","@aws-blocks/bb-logger":"^0.1.2","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.3_1782192246037_0.9863968756131201","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.4","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.4","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"homepage":"https://github.com/aws-devtools-labs/aws-blocks/tree/main/packages/bb-distributed-table#readme","bugs":{"url":"https://github.com/aws-devtools-labs/aws-blocks/issues"},"dist":{"shasum":"34fea9016a40de5d9d816a98f48f83bd9ccee5a0","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.4.tgz","fileCount":49,"integrity":"sha512-vNRmnxecJLD7Puv3BpPhfYXTTdaKbXwSI++85Yv4tnNDxn37P8dnXIylh9zb5puQcJAYTGjdIQCVVa+Cc8LmvA==","signatures":[{"sig":"MEUCIQDIbiJupOMveKVlhSN1tg8csuh767lefNeee6e7ldJpqgIgSBNMycfi6rjpMlnKq/Kd8Q9X5GcrCyIens9P+027FCg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aws-blocks%2fbb-distributed-table@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":390473},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"f6b9cad7b543663cc9ea73a4476ca5511255d779","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"repository":{"url":"git+https://github.com/aws-devtools-labs/aws-blocks.git","type":"git","directory":"packages/bb-distributed-table"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.23.1","dependencies":{"defu":"^6.1.7","@aws-blocks/core":"^0.1.17","@aws-blocks/bb-logger":"^0.1.3","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.4_1786135407489_0.6005185225680927","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.5","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.5","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"homepage":"https://github.com/aws-devtools-labs/aws-blocks/tree/main/packages/bb-distributed-table#readme","bugs":{"url":"https://github.com/aws-devtools-labs/aws-blocks/issues"},"dist":{"shasum":"8d485c469e358ec67359f095fb8aefea4c838f95","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.5.tgz","fileCount":49,"integrity":"sha512-M/F13waomNwdq4NmHxygJWechZfqKB9xxWBeBEtl89xpH9AvzW3soBisHs6kjxuK6BwQUv2xfPtwhCVOTOJciw==","signatures":[{"sig":"MEQCIBfJgxAYJfdHT45a0Y4ZiZVjqFek5dJp+Av6yOHVCcOfAiASqZP6pwxKj4QdwhSOUou5Zk5wHontmdcAQDT4Mg0dhg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aws-blocks%2fbb-distributed-table@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":393511},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"164b106810e2b4f7801426158feae82a4ccbe3d4","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"repository":{"url":"git+https://github.com/aws-devtools-labs/aws-blocks.git","type":"git","directory":"packages/bb-distributed-table"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"defu":"^6.1.7","@aws-blocks/core":"^0.2.0","@aws-blocks/bb-logger":"^0.1.4","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.5_1787230453782_0.7982211383847269","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.6","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.6","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"homepage":"https://github.com/aws-devtools-labs/aws-blocks/tree/main/packages/bb-distributed-table#readme","bugs":{"url":"https://github.com/aws-devtools-labs/aws-blocks/issues"},"dist":{"shasum":"9e99c1b4b79b399315e9a8a503484b24a05691cb","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.6.tgz","fileCount":49,"integrity":"sha512-wXhB7lEucURjeeA7JESua2TTiEeZ3GusFwyBOD3cPIQNPwJXKndRhhHM+N5M4rGB1b+8c8orbvqEHL7Z7TE0Ew==","signatures":[{"sig":"MEQCIA0f/JnoOtDggex/YOZ7xKJ2Cly+QXDWCrwcth3rCVjYAiBZwEWyJ4Hv6H5zmUqHdWVaTxuIEeU44pz0hJ/zwKydew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aws-blocks%2fbb-distributed-table@0.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":455546},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"04d4b21b1cae9600c44a2fc63c0020ca21894316","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"repository":{"url":"git+https://github.com/aws-devtools-labs/aws-blocks.git","type":"git","directory":"packages/bb-distributed-table"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"defu":"^6.1.7","@aws-blocks/core":"^0.3.0","@aws-blocks/bb-logger":"^0.1.5","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.6_1788264346708_0.4312005554987801","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@aws-blocks/bb-distributed-table","version":"0.1.7","author":{"name":"Amazon Web Services"},"license":"Apache-2.0","_id":"@aws-blocks/bb-distributed-table@0.1.7","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"homepage":"https://github.com/aws-devtools-labs/aws-blocks/tree/main/packages/bb-distributed-table#readme","bugs":{"url":"https://github.com/aws-devtools-labs/aws-blocks/issues"},"dist":{"shasum":"ff5f76904c6bdcaf45496f70ddaeb4a20845d8a1","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.1.7.tgz","fileCount":49,"integrity":"sha512-SskELMbfn3OrNmPKLuYmSeQm/SvCQ5Ym/F0DRMwxzBtZrqclmU0I4oSADECOsuyyjw8Kmgw07+DZz4WfiiEgew==","signatures":[{"sig":"MEYCIQDvtg6LVjg8b6Z3FI3tu+rRphHjL6ekak3pvEpiPXCaaQIhAKRAdWPfoPkqwe9BFBvCRrSWbmxcERgF4TeSbsPvqMQx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aws-blocks%2fbb-distributed-table@0.1.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":467483},"type":"module","exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"ce01923c591828486e07d3d3f2b6b9d585e39057","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"repository":{"url":"git+https://github.com/aws-devtools-labs/aws-blocks.git","type":"git","directory":"packages/bb-distributed-table"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"defu":"^6.1.7","@aws-blocks/core":"^0.4.0","@aws-blocks/bb-logger":"^0.1.6","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"tmp":"tmp/bb-distributed-table_0.1.7_1788867486505_0.8856628706244356","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"_id":"@aws-blocks/bb-distributed-table@0.2.0","bugs":{"url":"https://github.com/aws-devtools-labs/aws-blocks/issues"},"dist":{"shasum":"8c46954a6b4ed29c411eb2f21a02b62ed8395c82","tarball":"https://registry.npmjs.org/@aws-blocks/bb-distributed-table/-/bb-distributed-table-0.2.0.tgz","fileCount":49,"integrity":"sha512-PlSddcdz40YvNyNpHLg/4abAPCnuv4QTo6VI7mA9xSfgpzn8N1i1cCoFmNFX8kAw5Ej0AFM5tmTohlZD77+UVg==","signatures":[{"sig":"MEYCIQD3Z22epv/CzXBQriWLYtOv9v/eLAgcCA+iDK4xg+sjFwIhANiD56rZOfVp/Brc3K2OzzqaoQs5PdmnnlgvKyWe+5Jm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHiepjjBXqa4O8JP0WeA2Of2ws4Wiptr3+haMl+k/ZzPAiEA5zVSL98OgOM/xbqzRBf+7UuYQYAT7S1696NkfDSE0oI="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aws-blocks%2fbb-distributed-table@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":489221},"name":"@aws-blocks/bb-distributed-table","type":"module","author":{"name":"Amazon Web Services"},"exports":{".":{"cdk":{"types":"./dist/index.cdk.d.ts","default":"./dist/index.cdk.js"},"types":"./dist/index.mock.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.mock.js","aws-runtime":"./dist/index.aws.js"}},"gitHead":"51eeb265ab5efdbd853e989cf8bd6d30951c29c7","license":"Apache-2.0","scripts":{"test":"node --test --test-concurrency=1 dist/index.test.js dist/parity.test.js dist/index.cdk.test.js","build":"tsc --build && npm run build:lambda","prebuild":"node ../../scripts/generate-version.mjs DistributedTable","build:lambda":"esbuild src/gsi-manager-lambda.ts --bundle --platform=node --target=node24 --outfile=dist/gsi-manager-lambda/index.js --format=cjs --external:@aws-sdk/*"},"version":"0.2.0","_npmUser":{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"},"homepage":"https://github.com/aws-devtools-labs/aws-blocks/tree/main/packages/bb-distributed-table#readme","keywords":["aws-blocks","dynamodb","nosql","database"],"repository":{"url":"git+https://github.com/aws-devtools-labs/aws-blocks.git","type":"git","directory":"packages/bb-distributed-table"},"_npmVersion":"10.9.8","description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","directories":{},"maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"_nodeVersion":"22.23.2","dependencies":{"defu":"^6.1.7","@aws-blocks/core":"^0.5.0","@aws-blocks/bb-logger":"^0.2.0","@aws-sdk/lib-dynamodb":"^3.0.0","@standard-schema/spec":"^1.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.12","esbuild":"^0.25.0","typescript":"^5.3.0","@types/node":"^20.0.0"},"peerDependencies":{"constructs":"^10.6.0","aws-cdk-lib":"^2.257.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bb-distributed-table_0.2.0_1789678938159_0.1261863760017694"}}},"time":{"created":"2026-06-15T23:39:19.641Z","modified":"2026-09-17T21:02:18.811Z","0.1.0":"2026-06-15T23:39:19.935Z","0.1.1":"2026-06-16T18:16:05.306Z","0.1.2":"2026-06-18T03:29:20.183Z","0.1.3":"2026-06-23T05:24:06.197Z","0.1.4":"2026-08-07T20:43:27.626Z","0.1.5":"2026-08-20T12:54:13.975Z","0.1.6":"2026-09-01T12:05:46.861Z","0.1.7":"2026-09-08T11:38:06.642Z","0.2.0":"2026-09-17T21:02:18.273Z"},"bugs":{"url":"https://github.com/aws-devtools-labs/aws-blocks/issues"},"author":{"name":"Amazon Web Services"},"license":"Apache-2.0","homepage":"https://github.com/aws-devtools-labs/aws-blocks/tree/main/packages/bb-distributed-table#readme","repository":{"url":"git+https://github.com/aws-devtools-labs/aws-blocks.git","type":"git","directory":"packages/bb-distributed-table"},"description":"Structured data storage backed by DynamoDB with secondary indexes and rich query capabilities.","maintainers":[{"name":"aws-blocks-npm-ops","email":"aws-blocks@amazon.com"}],"readme":"# DistributedTable\n\nStructured data storage backed by DynamoDB with secondary indexes and rich query capabilities.\n\n**When to use:** You need to query by multiple fields, use composite keys, or perform sort-key-based range queries. Good for entities with relationships, time-series data, and access patterns that require multiple indexes.\n\n**When NOT to use:** If you only need single-key lookups, use `KVStore`. If you need full SQL (joins, aggregations), use `Database`.\n\n> Design & mock parity details: [DESIGN.md](./DESIGN.md)\n\n## API\n\n```typescript\nconst table = new DistributedTable(scope, id, options)\n```\n\n> **Type inference (important):** Do **not** pass a single explicit type argument like `new DistributedTable<MyType>(...)`. Doing so pins only `T` and lets the key/index generics fall back to their broad defaults, which breaks key-type inference — `get()` and `query({ where })` will then demand *every* field of the type instead of just the key fields. Either let all generics infer (`new DistributedTable(scope, id, { schema, key, indexes })` with no explicit `<...>`), or pass all three generics. Note that `as const` alone does **not** fix it.\n\n| Method | Returns | Description |\n|--------|---------|-------------|\n| `get(key)` | `Promise<T \\| null>` | Retrieve a single item by primary key. |\n| `put(item, options?)` | `Promise<void>` | Store an item. Overwrites unless conditions are set. |\n| `delete(key, options?)` | `Promise<void>` | Remove an item by primary key. |\n| `query(options)` | `AsyncIterable<T>` | Query items by index or primary key. |\n| `scan(options?)` | `AsyncIterable<T>` | Enumerate all items. Expensive on large datasets. |\n| `getBatch(keys)` | `Promise<(T \\| null)[]>` | Retrieve multiple items by key. |\n| `putBatch(items)` | `Promise<void>` | Store multiple items. |\n| `deleteBatch(keys)` | `Promise<void>` | Remove multiple items by key. |\n| `DistributedTable.fromExisting(tableName)` | `ExternalTableRef` | Wrap a pre-existing DynamoDB table. |\n\n**Runtime only.** Data methods (`get`, `put`, `delete`, `query`, `scan`, `getBatch`, `putBatch`, `deleteBatch`) run at request time — call them inside an `ApiNamespace` method, `RawRoute` handler, job handler, or a runtime script, **not** at the top level of your `aws-blocks/index.ts`. Top-level code runs during CDK synth, where the block resolves to its infrastructure construct (no data methods), so a top-level call throws `table.<method> is not a function` (throws `TypeError` at runtime if called during CDK synth). To seed data, do it from inside a handler or a separate runtime script. Constructing the block at module scope is fine; only method calls must move into handlers.\n\n> **Collecting `scan()` results:** like `query()`, `scan()` returns an `AsyncIterable` — collect with `await Array.fromAsync(table.scan())` or iterate with `for await`. Prefer `query()` over `scan()` (scans read every item).\n\n### Options\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `schema` | `StandardSchemaV1` | Yes | Runtime validation schema (Zod, Valibot, ArkType, etc.). Type `T` is inferred from the schema. |\n| `key` | `TableKeyConfig<T>` | Yes | Primary key configuration: `{ partitionKey, sortKey? }`. Field names must exist in the schema. |\n| `indexes` | `Record<string, TableKeyConfig<T>>` | No | Global secondary index definitions. |\n| `ttl` | `keyof T & string` | No | Enable DynamoDB TTL on the specified attribute. The field should contain a Unix epoch timestamp in seconds. |\n| `pointInTimeRecovery` | `boolean \\| { retentionDays: number }` | No | Point-in-Time Recovery (continuous backups). `true` = on with the default 35-day window; `false` = off; `{ retentionDays: n }` = on with an `n`-day window (**1–35**). Defaults to the stack `defaults.pointInTimeRecovery` (on under `BlocksPresets.production`, off under `sandbox`). Bills for backup storage per GB-month; a shorter window trims cost. |\n| `protection` | `'disposable' \\| 'retained' \\| 'locked'` | No | How hard the table is to destroy (spans removal policy + deletion protection). `'disposable'` = deleted with the stack; `'retained'` = orphaned on stack delete but a direct delete still works; `'locked'` = orphaned **and** deletion-protected. When omitted, removal policy + deletion protection follow the stack `defaults` (`BlocksPresets.production` ≈ `'locked'`, `sandbox` ≈ `'disposable'`). |\n| `encryption` | `'aws-managed' \\| 'customer-managed' \\| ExternalKmsKeyRef` | No | At-rest encryption key. `'aws-managed'` (default) uses the `aws/dynamodb` KMS key (auditable, no key charge); `'customer-managed'` provisions a dedicated CMK; pass `DistributedTable.fromKmsKey(arn)` to encrypt with an existing CMK you own (shareable across tables). |\n| `readValidation` | `'off' \\| 'coerce' \\| 'strict'` | No | How reads (`get`/`getBatch`/`query`/`scan`) reconcile a stored item with `schema`. `'coerce'` (**default**) returns the coerced value and, on failure, the raw value + a warning (never throws); `'strict'` throws `ValidationFailed` on a non-conforming item; `'off'` returns the raw value with no validation. See [Reads and schema evolution](#reads-and-schema-evolution). |\n| `table` | `ExternalTableRef` | No | Wrap an existing DynamoDB table instead of creating one. Durability/encryption options are ignored — the customer owns the table's configuration. |\n| `logger` | `ChildLogger` | No | Optional logger for internal operations. When omitted, a default Logger at error level is created. |\n\n### Key Object Pattern\n\nAll methods that accept a key (`get`, `delete`, `getBatch`, `deleteBatch`) take a key object with the partition key field (and sort key field if defined). The key type is computed from your schema and key configuration — TypeScript enforces exactly the right fields:\n\n```typescript\n// Table with partition key + sort key\nconst orders = new DistributedTable(scope, 'orders', {\n  schema: orderSchema,\n  key: { partitionKey: 'userId', sortKey: 'orderId' },\n});\n\n// Key object requires both fields\nawait orders.get({ userId: 'alice', orderId: '001' });\n\n// Table with partition key only\nconst settings = new DistributedTable(scope, 'settings', {\n  schema: settingsSchema,\n  key: { partitionKey: 'settingId' },\n});\n\n// Key object requires only the partition key\nawait settings.get({ settingId: 'theme' });\n```\n\n### Query\n\n`query()` takes a single options object. Specify `index` to query a GSI, or omit it to query the primary key. The `where` clause is type-safe — field names and condition types are computed from the index (or primary key) definition.\n\n```typescript\n// Query a GSI\nfor await (const order of orders.query({\n  index: 'byStatus',\n  where: { status: { equals: 'pending' } },\n  limit: 10,\n  order: 'desc',\n})) {\n  console.log(order);\n}\n\n// Query the primary key (omit index)\nfor await (const order of orders.query({\n  where: { userId: { equals: 'alice' }, orderId: { beginsWith: '2024-' } },\n})) {\n  console.log(order);\n}\n```\n\n> **Tip:** When collecting all results into an array, use `Array.fromAsync()` instead of a manual loop:\n> ```typescript\n> const pending = await Array.fromAsync(orders.query({\n>   index: 'byStatus',\n>   where: { status: { equals: 'pending' } },\n> }));\n> ```\n\n**Query options:**\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| `index` | `keyof Indexes` | No | GSI to query. Omit to query the primary key. |\n| `where` | `KeyCondition<T, K>` | Yes | Key conditions. Partition key requires `{ equals }`. Sort key supports `equals`, `greaterThan`, `lessThan`, `between`, `beginsWith`, etc. |\n| `limit` | `number` | No | Maximum number of items to return. |\n| `order` | `'asc' \\| 'desc'` | No | Sort direction on the sort key. Defaults to `'asc'`. |\n\n### Conditional Operations\n\nBoth `put` and `delete` accept optional conditions:\n\n```typescript\n// Only write if key doesn't exist (idempotent create)\nawait table.put(item, { ifNotExists: true });\n\n// Only write if existing item's field matches (optimistic locking)\nawait table.put(updatedItem, { ifFieldEquals: { version: 3 } });\n\n// Only delete if item exists\nawait table.delete(key, { ifExists: true });\n\n// Only delete if field matches\nawait table.delete(key, { ifFieldEquals: { status: 'archived' } });\n```\n\nAll condition failures throw with `error.name === DistributedTableErrors.ConditionalCheckFailed`. They serialize to JSON-RPC **409 (Conflict)** over the wire (not 500), in both the mock and AWS runtime. Only `ifFieldEquals` optimistic-lock conflicts are flagged retriable; `ifNotExists` / `ifExists` existence assertions are **not** retriable (a blind retry fails identically).\n\n> **No partial update:** There is no `update()` or `patch()` method. To change a field, do a read-modify-write — `get()` the item, mutate it, then `put()` the full item back. For safe concurrent updates, pass `{ ifFieldEquals: { version: <previous> } }` to `put()` so the write fails (via `ConditionalCheckFailed`) if another writer changed the item in the meantime (optimistic locking).\n\n### Reads and schema evolution\n\nWrites always validate against `schema`. Reads reconcile a stored item with the schema according to the **`readValidation`** option, which matters after a schema change: a row written under an older schema may no longer match the declared type `T` — a newly added field is **absent** from the read (so the value silently violates `T`, and a `.default()` is neither applied nor persisted on write-back), and a **required, no-default** field makes the read-modify-write cycle above **fail on the write** as `put()` rejects the legacy shape.\n\n`readValidation` has three modes:\n\n| Mode | On read | On a non-conforming item |\n|---|---|---|\n| **`'coerce'`** (default) | returns the schema's coerced output (defaults filled, types narrowed) | returns the **raw** value + logs a warning — **never throws** |\n| **`'strict'`** | validates against the schema | **throws** `ValidationFailed` |\n| **`'off'`** | returns the raw stored value, no validation | returns it as-is |\n\nThe default `'coerce'` closes the schema-evolution gap so a legacy row round-trips cleanly:\n\n```typescript\nconst orderSchema = z.object({\n  orderId: z.string(),\n  total: z.number(),\n  currency: z.string().default('USD'),   // added in a later release\n});\n\nconst orders = new DistributedTable(scope, 'orders', {\n  schema: orderSchema,\n  key: { partitionKey: 'orderId' },\n  // readValidation: 'coerce' is the default\n});\n\nconst order = await orders.get({ orderId: 'o1' }); // legacy row → { …, currency: 'USD' }\nawait orders.put({ ...order, total: 20 });          // round-trips without ValidationFailed\n```\n\n**`'coerce'` never throws:** a value that genuinely can't be coerced (e.g. a required field with no default) is returned **as-is** with a warning, so unrecoverable rows stay readable for migration and `get()` never throws for a bad row.\n\n> **Best-effort coercion (validator-dependent).** Coercion depends on the schema *transforming* its input. Zod fills defaults and casts; a check-only Standard Schema validator (some Valibot/ArkType schemas) validates without transforming, so `'coerce'` returns the value unchanged for those — it never invents data.\n\n> **`'coerce'` preserves stored keys not in the schema.** Many schemas discard unrecognized keys when they validate (Zod object schemas `.strip()` by default), which would drop attributes a stored row carries beyond the current schema — and a read-modify-write would then persist the loss. To avoid that, `'coerce'` deep-merges the coerced output **over the raw stored item**: schema output wins per key (defaults filled, types narrowed), while attributes the schema doesn't declare — from an older schema version, or columns another writer owns — are **kept**. Arrays are replaced wholesale (the coerced array wins), and nested unknown keys are preserved too. So a routine read-modify-write never silently deletes a field you didn't touch. (Use **`'strict'`** if you instead want a schema mismatch to be rejected, or **`'off'`** to skip the schema pass entirely.)\n\nChoose **`'strict'`** for tables where a schema mismatch should be treated as corruption and rejected (note: one bad row then fails the whole `query`/`scan`/`getBatch`). Choose **`'off'`** for hot paths, data you trust was written through this schema, or to read (and preserve) rows you can't yet coerce during a migration.\n\n### Error Handling\n\nErrors thrown by DistributedTable carry an `error.name` you can match with `isBlocksError`:\n\n| Constant | `error.name` | Thrown when |\n|----------|--------------|-------------|\n| `DistributedTableErrors.ConditionalCheckFailed` | `ConditionalCheckFailedException` | An `ifNotExists` / `ifExists` / `ifFieldEquals` condition failed. Serializes to HTTP **409 (Conflict)**; retriable only for `ifFieldEquals` optimistic-lock conflicts (not `ifNotExists` / `ifExists`). |\n| `DistributedTableErrors.ValidationFailed` | `ValidationFailedException` | An item failed the configured `schema` validation on `put()` / `putBatch()`. |\n| `DistributedTableErrors.InvalidQuery` | `InvalidQueryException` | The query/condition shape is wrong: missing `where`, partition key not given as `{ equals }`, unknown index, multiple sort-key conditions, or an empty `ifFieldEquals`. A caller bug. |\n| `DistributedTableErrors.ItemTooLarge` | `ItemTooLargeException` | A `put`/`putBatch` item exceeds DynamoDB's 400 KB per-item size limit. |\n| `DistributedTableErrors.BatchIncomplete` | `BatchIncompleteException` | A batch op left entries unprocessed after the retry budget (sustained throttling). AWS runtime only. |\n\n```typescript\nimport { isBlocksError } from '@aws-blocks/core';\nimport { DistributedTableErrors } from '@aws-blocks/bb-distributed-table';\n\ntry {\n  await table.put(item, { ifNotExists: true });\n} catch (e: unknown) {\n  if (isBlocksError(e, DistributedTableErrors.ConditionalCheckFailed)) {\n    // item already exists\n  }\n  if (isBlocksError(e, DistributedTableErrors.ItemTooLarge)) {\n    // item > 400 KB — split it or store a reference instead\n  }\n  throw e;\n}\n```\n\n## Examples\n\n### Basic CRUD\n\n> The examples use Zod, but `schema` accepts any StandardSchemaV1 implementation (Zod, Valibot, ArkType). Install your chosen library, e.g. `npm install zod`.\n\n```typescript\nimport { z } from 'zod';\n\nconst orderSchema = z.object({\n  userId: z.string(),\n  orderId: z.string(),\n  total: z.number(),\n  status: z.string(),\n  createdAt: z.number(),\n});\n\nconst orders = new DistributedTable(scope, 'orders', {\n  schema: orderSchema,\n  key: { partitionKey: 'userId', sortKey: 'orderId' },\n});\n\nexport const api = new ApiNamespace(scope, 'api', (context) => ({\n  async getOrder(userId: string, orderId: string) {\n    return await orders.get({ userId, orderId });\n  },\n  async createOrder(order: z.infer<typeof orderSchema>) {\n    await orders.put(order, { ifNotExists: true });\n  },\n  async deleteOrder(userId: string, orderId: string) {\n    await orders.delete({ userId, orderId });\n  },\n}));\n```\n\n### Query with Sort Key Conditions\n\n```typescript\nconst orders = new DistributedTable(scope, 'orders', {\n  schema: orderSchema,\n  key: { partitionKey: 'userId', sortKey: 'orderId' },\n  indexes: {\n    byDate: { partitionKey: 'userId', sortKey: 'createdAt' },\n  },\n});\n\n// Ctrl+Space on the where object shows: userId, createdAt\n// userId requires { equals }, createdAt supports greaterThan, between, etc.\nconst results = [];\nfor await (const order of orders.query({\n  index: 'byDate',\n  where: {\n    userId: { equals: 'alice' },\n    createdAt: { greaterThan: Date.now() - 86400000 },\n  },\n})) {\n  results.push(order);\n}\n```\n\n### TTL (Auto-Expiring Items)\n\n```typescript\nconst sessions = new DistributedTable(scope, 'sessions', {\n  schema: sessionSchema,\n  key: { partitionKey: 'sessionId' },\n  ttl: 'expiresAt',\n});\n\n// DynamoDB automatically deletes items after the TTL timestamp\nawait sessions.put({\n  sessionId: 'abc123',\n  userId: 'alice',\n  expiresAt: Math.floor(Date.now() / 1000) + 3600, // 1 hour from now\n});\n```\n\n### Batch Operations\n\n```typescript\n// Write many items\nawait orders.putBatch([order1, order2, order3]);\n\n// Read many items\nconst items = await orders.getBatch([\n  { userId: 'alice', orderId: '001' },\n  { userId: 'bob', orderId: '002' },\n]);\n\n// Delete many items\nawait orders.deleteBatch([\n  { userId: 'alice', orderId: '001' },\n  { userId: 'bob', orderId: '002' },\n]);\n```\n\n### Wrapping an Existing Table\n\n```typescript\nconst legacy = new DistributedTable(scope, 'legacy', {\n  schema: orderSchema,\n  key: { partitionKey: 'userId', sortKey: 'orderId' },\n  table: DistributedTable.fromExisting('my-existing-table'),\n});\n```\n\n## Best Practices\n\n- Design partition keys for even data distribution (e.g., `userId`, `tenantId`)\n- Use sort keys for range queries (e.g., timestamps, alphabetical ordering)\n- Define GSIs upfront for known access patterns — adding them later requires backfill\n- Use `{ ifNotExists: true }` for idempotent creates\n- Use `{ ifFieldEquals }` for optimistic locking when multiple writers are possible\n- Prefer `query()` over `scan()` — scans read every item and are expensive\n\n## Scaling & Cost (AWS)\n\n- **Billing:** PAY_PER_REQUEST — no provisioned capacity to manage\n- **Latency:** Single-digit ms reads and writes\n- **Throughput:** Scales automatically, no upper limit on table size\n- **Item size limit:** 400 KB per item\n- **GSI limit:** Up to 20 global secondary indexes per table\n- **Cost:** ~$1.25 per million writes, ~$0.25 per million reads\n- **Durability:** 99.999999999% (11 nines) across 3 AZs\n\n## Durability & Security defaults\n\nDurability posture comes from the **stack-wide `BlocksDefaults`** you pass to `BlocksStack.create` / `BlocksBackend.create` (`BlocksPresets.production` or `BlocksPresets.sandbox` from `@aws-blocks/core/cdk`) — the same knobs every Building Block reads, so a table's removal policy, deletion protection, and continuous-backup posture all follow the app's chosen preset. There's no per-block `sandboxMode` guessing.\n\nUnder **`BlocksPresets.production`**, every table this block provisions ships with:\n\n- **Point-in-Time Recovery** enabled (`defaults.pointInTimeRecovery`) — restore to any second in the last 35 days.\n- **Retained + deletion-protected** (`defaults.removalPolicy = RETAIN`, `defaults.deletionProtection = true`) — neither a stack teardown nor a stray `cdk destroy`/console delete can wipe the table until you explicitly relax it. (Equivalent to `protection: 'locked'`.)\n- **SSE-KMS** with the AWS-managed `aws/dynamodb` key — encryption-at-rest that's auditable via CloudTrail, at no per-key charge.\n\nUnder **`BlocksPresets.sandbox`** these flip the other way — PITR off, `RemovalPolicy.DESTROY`, deletion protection off (equivalent to `protection: 'disposable'`) — so throwaway stacks stay cheap and `sandbox:destroy` is a one-command teardown. SSE-KMS stays on in both (encryption isn't part of `BlocksDefaults` — it's a per-block option defaulting to `aws-managed`).\n\n> **PITR is not free.** Point-in-Time Recovery charges for continuous-backup storage (per GB-month of table size), so a large production table carries an ongoing cost. It's on by default because unrecoverable data loss is usually the worse outcome — but for regenerable data (caches, derived tables) set `pointInTimeRecovery: false`.\n\n> **`protection: 'locked'`/`'retained'` orphans the table on stack delete.** Because the removal policy is `RETAIN`, deleting the stack leaves the table behind (by design — your data survives). But the table name is derived deterministically from the block's id, so **redeploying the same app afterward fails with `Table already exists`** until you delete the orphaned table (`aws dynamodb delete-table`, after disabling deletion protection if `'locked'`) or import it into the new stack. This is inherent to retain-on-delete; use `protection: 'disposable'` for tables you expect to recreate freely.\n\nEvery stack default is overridable per table (a per-block option always wins over `defaults`):\n\n```typescript\n// Cost-sensitive prod table: keep it protected, skip PITR's backup cost\nconst cache = new DistributedTable(scope, 'cache', {\n  schema, key: { partitionKey: 'id' },\n  pointInTimeRecovery: false,\n});\n\n// Long-lived data you still want to be able to delete directly\nconst staging = new DistributedTable(scope, 'staging', {\n  schema, key: { partitionKey: 'id' },\n  protection: 'retained',   // survives stack delete, but not deletion-protected\n});\n\n// Compliance-strict table: dedicated customer-managed KMS key\nconst ledger = new DistributedTable(scope, 'ledger', {\n  schema, key: { partitionKey: 'id' },\n  encryption: 'customer-managed',\n});\n\n// Share one customer-managed key across several tables (one key, one bill)\nconst key = DistributedTable.fromKmsKey('arn:aws:kms:us-east-1:111122223333:key/abcd-1234');\nconst orders = new DistributedTable(scope, 'orders', {\n  schema, key: { partitionKey: 'id' },\n  encryption: key,\n});\nconst events = new DistributedTable(scope, 'events', {\n  schema, key: { partitionKey: 'id' },\n  encryption: key,\n});\n```\n\n> Overrides always win over the environment default, so you can force a fully durable, protected table in a sandbox (or relax one in prod) explicitly. When you bring your own table via `fromExisting()`, none of these options apply — you own that table's configuration.\n\n> **`customer-managed` provisions a dedicated CMK per table** — an app with a dozen customer-managed tables gets a dozen KMS keys (~$1/month each, plus request charges). To share one key across several tables, create the key once and pass `DistributedTable.fromKmsKey(keyArn)` as the `encryption` option on each table (see below). Use the default `'aws-managed'` unless a table needs its own rotation/key-policy control.\n\n## Local Development\n\nMock data persists to disk at `.bb-data/{fullId}/` across dev server restarts. Wipe with `rm -rf .bb-data`. The mock validates the 400 KB item size limit, schema validation, and conditional check failures, matching AWS behavior. Index queries are implemented via in-memory filtering — correctness is preserved but performance characteristics differ from DynamoDB.\n\n\n\n","readmeFilename":"README.md","keywords":["aws-blocks","dynamodb","nosql","database"]}