{"_id":"@bippo-libs/aws-dynamodb-client","_rev":"4-b29afdb59664921b37889b6303f66042","name":"@bippo-libs/aws-dynamodb-client","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@bippo-libs/aws-dynamodb-client","version":"0.0.1","type":"commonjs","license":"MIT","keywords":["dynamodb","client"],"repository":{"type":"git","url":"git+https://github.com/wiowou/bippo-util.git"},"homepage":"https://github.com/wiowou/bippo-util/blob/master/libs/aws-dynamodb-client/README.md","peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/util-dynamodb":"^3.0.0","class-transformer":"^0.5.0"},"devDependencies":{},"dependencies":{},"gitHead":"0dbee5bfa6580a3c2b43463f79c7c0893d8d53ba","description":"![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)","bugs":{"url":"https://github.com/wiowou/bippo-util/issues"},"_id":"@bippo-libs/aws-dynamodb-client@0.0.1","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-XZdV6+FoX8e9WFrCMZZi4xgsbQRVAswd0VT4bM3/l0VquGRn4sGPJh9GJOWymiSs2v1+gkLkKHIjmZkcl1qovw==","shasum":"e6f896b6b255a0ecb3aae5306bcac7b914a40234","tarball":"https://registry.npmjs.org/@bippo-libs/aws-dynamodb-client/-/aws-dynamodb-client-0.0.1.tgz","fileCount":47,"unpackedSize":47592,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2bUYzMmCGH5/ciIz0p1luwChL2m7OJvZx+O0mrtZisQIhANIC+kbogBj8GfMMAYm6hZxiLQdGppGrKnCpBg+R80Kw"}]},"_npmUser":{"name":"bkap799","email":"bkap799@gmail.com"},"directories":{},"maintainers":[{"name":"bkap799","email":"bkap799@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aws-dynamodb-client_0.0.1_1692156268963_0.6847777944217681"},"_hasShrinkwrap":false},"0.0.2":{"name":"@bippo-libs/aws-dynamodb-client","version":"0.0.2","type":"commonjs","license":"MIT","keywords":["dynamodb","client"],"repository":{"type":"git","url":"git+https://github.com/wiowou/bippo-util.git"},"homepage":"https://github.com/wiowou/bippo-util/blob/master/libs/aws-dynamodb-client/README.md","peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/util-dynamodb":"^3.0.0","class-transformer":"^0.5.0","tslib":"^2.0.0"},"devDependencies":{},"dependencies":{},"main":"./src/index.js","types":"./src/index.d.ts","gitHead":"9d58cb3c3d6704c54569feb38da1c696dab3e5d7","description":"![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)","bugs":{"url":"https://github.com/wiowou/bippo-util/issues"},"_id":"@bippo-libs/aws-dynamodb-client@0.0.2","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-7rld2e4nHehOdmsAOkdTS+Eop4OiS6Lzol7OPfkKrFtVrUyoT1nt67fL6GoikhD1btNoT1selYHJBgVvzbUWtA==","shasum":"34de91c093932b924d5dd0304af17d54d452e2ba","tarball":"https://registry.npmjs.org/@bippo-libs/aws-dynamodb-client/-/aws-dynamodb-client-0.0.2.tgz","fileCount":60,"unpackedSize":47528,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKukcGdjD8seaiVR6VThkdm099AGsgYWwP8uGumS4BAAiBSypO34H4zzfbgCqhwxkFW+dIzq62Wyp7wuEhdVcnHpA=="}]},"_npmUser":{"name":"bkap799","email":"bkap799@gmail.com"},"directories":{},"maintainers":[{"name":"bkap799","email":"bkap799@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aws-dynamodb-client_0.0.2_1692156947077_0.6213026885091122"},"_hasShrinkwrap":false},"0.0.3":{"name":"@bippo-libs/aws-dynamodb-client","version":"0.0.3","type":"commonjs","license":"MIT","keywords":["dynamodb","client"],"repository":{"type":"git","url":"git+https://github.com/wiowou/bippo-libs.git"},"homepage":"https://github.com/wiowou/bippo-libs/blob/master/libs/aws-dynamodb-client/README.md","peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/util-dynamodb":"^3.0.0","class-transformer":"^0.5.0","tslib":"^2.0.0"},"devDependencies":{},"dependencies":{},"main":"./src/index.js","types":"./src/index.d.ts","gitHead":"a4227293c3aedbea13b6bf259f3064aa43bfc45f","description":"![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)","bugs":{"url":"https://github.com/wiowou/bippo-libs/issues"},"_id":"@bippo-libs/aws-dynamodb-client@0.0.3","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-+oJdauKt9ptEoBku/+3NglWxSfywoBYXS2G+09mF/ZeRpaEIbpG6MRkkwEC2jvyOdsNHG+MeLmA4zUUj+zzLJw==","shasum":"5ecc3551240d0cccf979d5090e647a8a95f93ba9","tarball":"https://registry.npmjs.org/@bippo-libs/aws-dynamodb-client/-/aws-dynamodb-client-0.0.3.tgz","fileCount":60,"unpackedSize":47528,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTnMo4ASk9+66FVQLdzBtKcvc4sY1RC8pxXQBuurpkcAiEA6354ft3AjGz8Oth0h2rHFwhZteZghvnblq9Vn6szK+I="}]},"_npmUser":{"name":"bkap799","email":"bkap799@gmail.com"},"directories":{},"maintainers":[{"name":"bkap799","email":"bkap799@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aws-dynamodb-client_0.0.3_1692157688797_0.540401613681964"},"_hasShrinkwrap":false},"0.0.4":{"name":"@bippo-libs/aws-dynamodb-client","version":"0.0.4","type":"commonjs","license":"MIT","keywords":["dynamodb","client"],"repository":{"type":"git","url":"git+https://github.com/wiowou/bippo-libs.git"},"homepage":"https://github.com/wiowou/bippo-libs/blob/master/libs/aws-dynamodb-client/README.md","peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/util-dynamodb":"^3.0.0","class-transformer":"^0.5.0","tslib":"^2.0.0"},"devDependencies":{},"dependencies":{},"main":"./src/index.js","types":"./src/index.d.ts","gitHead":"5cd57ea0a979ca0099e5dc2be8a9dbfa85628234","description":"![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)","bugs":{"url":"https://github.com/wiowou/bippo-libs/issues"},"_id":"@bippo-libs/aws-dynamodb-client@0.0.4","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-gBCIVKNT0MHD098ZRIIqDhQTzY0WQobwsGgvRdOWWaYZJ3+1j93UjHBjOk1HmOemd7+RLtGDYDfDIOngjHKzTg==","shasum":"16ab78035f5aa9927613b337c22ebbfa0b9885ee","tarball":"https://registry.npmjs.org/@bippo-libs/aws-dynamodb-client/-/aws-dynamodb-client-0.0.4.tgz","fileCount":60,"unpackedSize":49339,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDIFHJZu/sRqF5V1eN90L9+WrYl0+B92mv4PX9KRYM8CAiEAtbY0Jfaerwm8IMTrSbhia897giRd3b72R16xcst9uZo="}]},"_npmUser":{"name":"bkap799","email":"bkap799@gmail.com"},"directories":{},"maintainers":[{"name":"bkap799","email":"bkap799@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aws-dynamodb-client_0.0.4_1692498069573_0.5994049650792022"},"_hasShrinkwrap":false},"0.0.5":{"name":"@bippo-libs/aws-dynamodb-client","version":"0.0.5","type":"commonjs","license":"MIT","keywords":["dynamodb","client"],"repository":{"type":"git","url":"git+https://github.com/wiowou/bippo-libs.git"},"homepage":"https://github.com/wiowou/bippo-libs/blob/master/libs/aws-dynamodb-client/README.md","peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/util-dynamodb":"^3.0.0","class-transformer":"^0.5.0","tslib":"^2.0.0"},"devDependencies":{},"dependencies":{},"main":"./src/index.js","types":"./src/index.d.ts","gitHead":"4230be84d0993d94a6afca8a950f7677edf52899","description":"![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)","bugs":{"url":"https://github.com/wiowou/bippo-libs/issues"},"_id":"@bippo-libs/aws-dynamodb-client@0.0.5","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-dV8CUbYRVHPe4yzGWpS+tzNFMlGE52CA1H4rofLoCIcR+P7dSesQPYuApEIbqcE0CUMjoL4pqJsWwruSejTUOw==","shasum":"eb5e982684b2a4b5a7e1207455172c05e531f9a6","tarball":"https://registry.npmjs.org/@bippo-libs/aws-dynamodb-client/-/aws-dynamodb-client-0.0.5.tgz","fileCount":60,"unpackedSize":49463,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPuT8CqUd5uIY0QDLdeVbVXbRAp8dt3YxC/Amvn+Js2AiEAzdgrBOy/ri/YbddNvj7ywJ+z8+/xENjjPIYvbUCtJy4="}]},"_npmUser":{"name":"bkap799","email":"bkap799@gmail.com"},"directories":{},"maintainers":[{"name":"bkap799","email":"bkap799@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aws-dynamodb-client_0.0.5_1692498464488_0.4485445198876463"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-16T03:24:28.840Z","0.0.1":"2023-08-16T03:24:29.141Z","modified":"2023-08-20T02:27:44.903Z","0.0.2":"2023-08-16T03:35:47.225Z","0.0.3":"2023-08-16T03:48:08.998Z","0.0.4":"2023-08-20T02:21:09.932Z","0.0.5":"2023-08-20T02:27:44.667Z"},"maintainers":[{"name":"bkap799","email":"bkap799@gmail.com"}],"description":"![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)","homepage":"https://github.com/wiowou/bippo-libs/blob/master/libs/aws-dynamodb-client/README.md","keywords":["dynamodb","client"],"repository":{"type":"git","url":"git+https://github.com/wiowou/bippo-libs.git"},"bugs":{"url":"https://github.com/wiowou/bippo-libs/issues"},"license":"MIT","readme":"# aws-dynamodb-client\n\n![Build Status](https://github.com/wiowou/bippo-util/workflows/CI/badge.svg)\n\nUse decorators on model classes to simplify the inputs to the DynamoDB client and receive model classes as an output.\nInternally uses [@aws-sdk/lib-dynamodb v3](https://github.com/aws/aws-sdk-js-v3/tree/main/lib/lib-dynamodb) and [class-validator](https://github.com/typestack/class-validator/tree/develop)\n\n## Installation\n\n```sh\nnpm install @bippo-libs/aws-dynamodb-client\n```\n\n## Usage\n\nCreate a model class and use decorators for attributes and keys. Properties without decorators are ignored when the model is mapped to a dynamodb item. Here, a DTO (Data Transfer Object) class is also defined so that keys and meta data like `createdOn` remain in the data access layer. Note that attributes can have aliases, and that some attributes are properties, others defined using methods, and still others with accessors. Attributes defined using properties and methods are overwritten with the values pulled from dynamodb whereas accessors (in this case getters) are not. This means after an item/model has been retrieved from dynamodb, `updatedOn` will always assume the datetime value of when it is written to dynamodb whereas `createdOn` will retain the value from dynamodb by default.\n\n```typescript\nimport {\n  Attribute,\n  IndexPartitionKey,\n  IndexSortKey,\n  Model,\n  PartitionKey,\n  SortKey,\n  Table,\n} from '@bippo-libs/aws-dynamodb-client';\n\n@Table('MyTable')\nexport class PersonDTO extends Model<PersonDTO> {\n  @Attribute()\n  public phone: string;\n\n  @Attribute()\n  public email: string;\n\n  @Attribute('dob')\n  public dateOfBirth: Date;\n\n  @Attribute()\n  public firstName: string;\n\n  @Attribute()\n  public lastName: string;\n\n  public club: string;\n}\n\n@Table('MyTable')\nexport class PersonModel extends PersonDTO {\n  @PartitionKey()\n  public PK() {\n    return `CLUB#${this.club}`;\n  }\n\n  @SortKey()\n  public SK() {\n    return `PERSON#${this.firstName}#${this.lastName}`;\n  }\n\n  @IndexPartitionKey('GSI1')\n  public get GSI1PK(): string {\n    return `LASTNAME#${this.lastname}`;\n  }\n\n  @IndexSortKey('GSI1')\n  public get GSI1SK(): string {\n    return this.email;\n  }\n\n  @Attribute()\n  public createdOn() {\n    return new Date().toISOString();\n  }\n\n  @Attribute()\n  public get updatedOn() {\n    return new Date().toISOString();\n  }\n}\n```\n","readmeFilename":"README.md"}