@moicky/dynamodb 1.0.1

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.
@@ -0,0 +1,3 @@
1
+ export * from "./operations";
2
+ export * from "./lib/client";
3
+ export * from "./lib/helpers";
@@ -0,0 +1,4 @@
1
+ import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
2
+ import "dotenv/config";
3
+ export declare const client: DynamoDBClient;
4
+ export declare const TableName: string;
@@ -0,0 +1,5 @@
1
+ export declare function stripKey(key: any): Record<string, any>;
2
+ export declare function splitEvery<T>(items: T[], limit?: number): T[][];
3
+ export declare function getAttributeValues(key: any, attributesToGet?: string[]): Record<string, any>;
4
+ export declare function getAttributeNames(key: any, attributesToGet?: string[]): Record<string, string>;
5
+ export declare function getAttributesFromExpression(expression: string, prefix?: string): string[];
@@ -0,0 +1,3 @@
1
+ import { BatchWriteItemCommandInput, DeleteItemCommandInput, DeleteItemCommandOutput } from "@aws-sdk/client-dynamodb";
2
+ export declare function deleteItem(key: any, args?: Partial<DeleteItemCommandInput>): Promise<DeleteItemCommandOutput>;
3
+ export declare function deleteItems(keys: any[], args?: Partial<BatchWriteItemCommandInput>, retries?: number): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { BatchGetItemCommandInput, GetItemCommandInput, ScanCommandInput } from "@aws-sdk/client-dynamodb";
2
+ export declare function getItem(key: any, args?: Partial<GetItemCommandInput>): Promise<Record<string, any>>;
3
+ export declare function getItems(keys: any[], args?: Partial<BatchGetItemCommandInput>, retry?: number): Promise<Record<string, any>[]>;
4
+ export declare function getAllItems(args?: Partial<ScanCommandInput>): Promise<Record<string, any>[]>;
@@ -0,0 +1,6 @@
1
+ export * from "./delete";
2
+ export * from "./get";
3
+ export * from "./misc";
4
+ export * from "./put";
5
+ export * from "./query";
6
+ export * from "./update";
@@ -0,0 +1,7 @@
1
+ import { GetItemCommandInput } from "@aws-sdk/client-dynamodb";
2
+ export declare function itemExists(key: any, args?: Partial<GetItemCommandInput>): Promise<boolean>;
3
+ export declare function getNewId({ PK, SK, length, }: {
4
+ PK: string;
5
+ SK?: string;
6
+ length?: number;
7
+ }): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import { BatchWriteItemCommandInput, PutItemCommandInput, PutItemCommandOutput } from "@aws-sdk/client-dynamodb";
2
+ export declare function putItem(data: any, args?: Partial<PutItemCommandInput>): Promise<PutItemCommandOutput>;
3
+ export declare function putItems(items: any[], args?: Partial<BatchWriteItemCommandInput>): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { QueryCommandInput, QueryCommandOutput } from "@aws-sdk/client-dynamodb";
2
+ export declare function query(keyCondition: string, keys: any[], args?: Partial<QueryCommandInput>): Promise<QueryCommandOutput>;
3
+ export declare function queryItems(keyCondition: string, key: any, args?: Partial<QueryCommandInput>): Promise<Record<string, any>[]>;
4
+ export declare function queryAllItems(keyCondition: string, key: any, args?: Partial<QueryCommandInput>): Promise<Record<string, any>[]>;
@@ -0,0 +1,3 @@
1
+ import { UpdateItemCommandInput, UpdateItemCommandOutput } from "@aws-sdk/client-dynamodb";
2
+ export declare function updateItem(key: any, data: any, args?: Partial<UpdateItemCommandInput>): Promise<UpdateItemCommandOutput>;
3
+ export declare function removeAttributes(key: any, attributes: string[]): Promise<UpdateItemCommandOutput>;
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@moicky/dynamodb",
3
+ "version": "1.0.1",
4
+ "description": "",
5
+ "main": "dist/built/commonjs/index.js",
6
+ "module": "dist/built/esnext/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "private": false,
9
+ "scripts": {
10
+ "watch": "webpack --watch --mode=development",
11
+ "build": "webpack --mode=production",
12
+ "test": "jest --runInBand"
13
+ },
14
+ "keywords": [
15
+ "dynamodb-helpers",
16
+ "dynamodb",
17
+ "aws-dynamodb"
18
+ ],
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "author": "Moicky",
23
+ "license": "ISC",
24
+ "dependencies": {
25
+ "@aws-sdk/client-dynamodb": "^3.338.0",
26
+ "@aws-sdk/util-dynamodb": "^3.338.0",
27
+ "aws-crt": "^1.15.16"
28
+ },
29
+ "devDependencies": {
30
+ "@types/jest": "^29.5.1",
31
+ "jest": "^29.5.0",
32
+ "aws-sdk": "^2.1383.0",
33
+ "dotenv": "^16.0.3",
34
+ "ts-loader": "^9.4.3",
35
+ "webpack-cli": "^5.1.1"
36
+ }
37
+ }