@itzworking/single-table 0.0.137 → 0.0.139
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itzworking/single-table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.139",
|
|
4
4
|
"private": false,
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2.3.0"
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"peerDependencies": {
|
|
9
9
|
"@aws-sdk/client-dynamodb": "3.x",
|
|
10
10
|
"@aws-sdk/lib-dynamodb": "3.x",
|
|
11
|
-
"@itzworking/decorated-class": "0.0.
|
|
12
|
-
"@itzworking/powertools": "0.0.
|
|
11
|
+
"@itzworking/decorated-class": "0.0.139",
|
|
12
|
+
"@itzworking/powertools": "0.0.139",
|
|
13
13
|
"reflect-metadata": "0.2.x",
|
|
14
14
|
"uuid": "10.x"
|
|
15
15
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type CompositeKeyElement<T> = Uppercase<string> | keyof
|
|
1
|
+
import { SingleTableAttributes } from "../../types";
|
|
2
|
+
export type CompositeKeyElement<T> = Uppercase<string> | keyof SingleTableAttributes<T>;
|
|
3
3
|
export type CompositePrimaryKeyComposition<T> = {
|
|
4
4
|
PK: Array<CompositeKeyElement<T>>;
|
|
5
5
|
SK: Array<CompositeKeyElement<T>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeleteCommandInput, GetCommandInput, PutCommandInput, QueryCommandInput, UpdateCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
-
import {
|
|
2
|
+
import { SingleTableAttributes } from "../types";
|
|
3
3
|
export interface InsertItemOptions {
|
|
4
4
|
override?: boolean;
|
|
5
5
|
input?: Partial<PutCommandInput>;
|
|
@@ -8,7 +8,7 @@ export interface GetItemOptions {
|
|
|
8
8
|
input?: Partial<GetCommandInput>;
|
|
9
9
|
}
|
|
10
10
|
export interface UpdateItemOptions<T> {
|
|
11
|
-
attributes?: (keyof
|
|
11
|
+
attributes?: (keyof SingleTableAttributes<T>)[];
|
|
12
12
|
input?: Partial<UpdateCommandInput>;
|
|
13
13
|
}
|
|
14
14
|
export interface DeleteItemOptions {
|
package/src/types.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
type ExcludedKeys = "generateId" | "pk" | "sk" | "key" | "gsi1pk" | "gsi1sk" | "gsi2pk" | "gsi2sk" | "gsi3pk" | "gsi3sk" | "gsi4pk" | "gsi4sk" | "gsi5pk" | "gsi5sk" | "generateUpdateExpression" | "toSingleTableItem";
|
|
2
|
-
export type
|
|
3
|
-
[Key in keyof C]: C[Key];
|
|
4
|
-
};
|
|
5
|
-
export type ClassPropertiesWithExcludedKeys<C> = {
|
|
2
|
+
export type SingleTableAttributes<C> = {
|
|
6
3
|
[Key in keyof C as Key extends ExcludedKeys ? never : Key]: C[Key];
|
|
7
4
|
};
|
|
8
5
|
export {};
|