@ginger.io/beyonce
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -27,7 +27,7 @@ import { DynamoDB } from "aws-sdk"; | ||
/** Write an item into Dynamo */ | ||
put<T extends Model, U extends Model>(itemAndKey: ItemAndKey<T, U>): Promise<void>; | ||
put<T extends Model>(itemAndKey: ItemAndKey<T>): Promise<void>; | ||
/** Write multiple items into Dynamo using a transaction. | ||
*/ | ||
batchPutWithTransaction<T extends Model, U extends Model>(items: ItemAndKey<T, U>[]): Promise<void>; | ||
batchPutWithTransaction<T extends Model>(items: ItemAndKey<T>[]): Promise<void>; | ||
private maybeEncryptItems; | ||
} |
@@ -5,5 +5,5 @@ import { EncryptedJayZItem } from "@ginger.io/jay-z"; | ||
import { Model } from "./Model"; | ||
export declare type ItemAndKey<T extends Model, U extends Model> = { | ||
key: PartitionAndSortKey<T, U>; | ||
item: U; | ||
export declare type ItemAndKey<T extends Model> = { | ||
key: PartitionAndSortKey<any, T>; | ||
item: T; | ||
}; | ||
@@ -10,0 +10,0 @@ export declare type PartitionAndSortKey<T extends Model, U extends Model> = { |
{ | ||
"name": "@ginger.io/beyonce", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Type-safe DynamoDB query builder for TypeScript. Designed with single-table architecture in mind.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -116,5 +116,3 @@ import { DynamoDB } from "aws-sdk" | ||
/** Write an item into Dynamo */ | ||
async put<T extends Model, U extends Model>( | ||
itemAndKey: ItemAndKey<T, U> | ||
): Promise<void> { | ||
async put<T extends Model>(itemAndKey: ItemAndKey<T>): Promise<void> { | ||
const item = await this.maybeEncryptItems(itemAndKey) | ||
@@ -132,4 +130,4 @@ | ||
*/ | ||
async batchPutWithTransaction<T extends Model, U extends Model>( | ||
items: ItemAndKey<T, U>[] | ||
async batchPutWithTransaction<T extends Model>( | ||
items: ItemAndKey<T>[] | ||
): Promise<void> { | ||
@@ -150,5 +148,5 @@ const asyncEncryptedItems = items.map(async (itemAndKey) => { | ||
private async maybeEncryptItems<T extends Model, U extends Model>( | ||
itemAndKey: ItemAndKey<T, U> | ||
): Promise<MaybeEncryptedItems<U>> { | ||
private async maybeEncryptItems<T extends Model>( | ||
itemAndKey: ItemAndKey<T> | ||
): Promise<MaybeEncryptedItems<T>> { | ||
const { item, key } = itemAndKey | ||
@@ -155,0 +153,0 @@ const maybeEncryptedItems = await encryptOrPassThroughItems(this.jayz, { |
@@ -6,5 +6,5 @@ import { EncryptedJayZItem } from "@ginger.io/jay-z" | ||
export type ItemAndKey<T extends Model, U extends Model> = { | ||
key: PartitionAndSortKey<T, U> | ||
item: U | ||
export type ItemAndKey<T extends Model> = { | ||
key: PartitionAndSortKey<any, T> | ||
item: T | ||
} | ||
@@ -11,0 +11,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
113435
2229