cmp-aws-database
Version:
The package "cmp-aws-database" is for its database, which defines global tables. These tables are designed to be imported and used across multiple applications of "craft-my-plate."
33 lines (32 loc) • 2.06 kB
TypeScript
import { DataMapper, ParallelScanOptions, ParallelScanWorkerOptions, QueryOptions, ReadConsistency, ScanOptions } from '@nova-odm/mapper';
import { ZeroArgumentsConstructor } from '@nova-odm/marshaller';
import { ConditionExpression, ConditionExpressionPredicate } from '@nova-odm/expressions';
import { BaseModel } from './base-model';
export declare const dynamoDB: any;
export declare const mapper: DataMapper;
export declare class GenericDAO<T extends BaseModel> {
batchUpdate(items: T[], batchSize?: number, authContext?: any): Promise<T[]>;
parallelBatchPut(inputItems: T[], batchSize?: number, maxConcurrentSegments?: number, authContext?: any): Promise<T[]>;
parallelBatchDelete(inputItems: T[], batchSize?: number, maxConcurrentSegments?: number): Promise<T[]>;
/**
* This function has to be used only in the scripts.
*
* @param valueConstructor the model class
*/
parallelScan(valueConstructor: ZeroArgumentsConstructor<T>, options?: ParallelScanOptions): Promise<T[]>;
scan(valueConstructor: ZeroArgumentsConstructor<T>, options?: ScanOptions | ParallelScanWorkerOptions): Promise<T[]>;
save(item: T, authContext?: any): Promise<T>;
update(item: T, authContext?: any): Promise<T>;
delete(item: T): Promise<T | undefined>;
get(item: T, readConsistency?: ReadConsistency): Promise<T>;
batchPut(items: T[], authContext?: any): Promise<T[]>;
batchDelete(items: T[]): Promise<T[]>;
batchGet(items: T[], readConsistency?: ReadConsistency): Promise<T[]>;
parallelBatchGet(inputItems: T[], batchSize?: number, maxConcurrentSegments?: number, readConsistency?: ReadConsistency): Promise<T[]>;
parallelQuery(valueConstructor: ZeroArgumentsConstructor<T>, keyConditions: Array<ConditionExpression | {
[propertyName: string]: ConditionExpressionPredicate | any;
}>, maxConcurrentCalls?: number, options?: QueryOptions): Promise<T[]>;
private customQuery;
decode(continuationToken: string | undefined): any;
encode(lastEvaluatedKey: any): Promise<string>;
}