Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@decaf-ts/db-decorators

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@decaf-ts/db-decorators - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

8

lib/esm/interfaces/Contextual.d.ts

@@ -1,4 +0,6 @@

import { Context } from "../repository/Context";
export interface Contextual {
context(): Promise<Context>;
import { OperationKeys } from "../operations";
import { Constructor, Model } from "@decaf-ts/decorator-validation";
import { Context } from "../repository";
export interface Contextual<M extends Model> {
context(operation: OperationKeys, model: Constructor<M>): Promise<Context<M>>;
}
export {};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL0NvbnRleHR1YWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbnRlcmZhY2VzL0NvbnRleHR1YWwuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb250ZXh0IH0gZnJvbSBcIi4uL3JlcG9zaXRvcnkvQ29udGV4dFwiO1xuXG5leHBvcnQgaW50ZXJmYWNlIENvbnRleHR1YWwge1xuICBjb250ZXh0KCk6IFByb21pc2U8Q29udGV4dD47XG59XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL0NvbnRleHR1YWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbnRlcmZhY2VzL0NvbnRleHR1YWwuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBPcGVyYXRpb25LZXlzIH0gZnJvbSBcIi4uL29wZXJhdGlvbnNcIjtcbmltcG9ydCB7IENvbnN0cnVjdG9yLCBNb2RlbCB9IGZyb20gXCJAZGVjYWYtdHMvZGVjb3JhdG9yLXZhbGlkYXRpb25cIjtcbmltcG9ydCB7IENvbnRleHQgfSBmcm9tIFwiLi4vcmVwb3NpdG9yeVwiO1xuXG5leHBvcnQgaW50ZXJmYWNlIENvbnRleHR1YWw8TSBleHRlbmRzIE1vZGVsPiB7XG4gIGNvbnRleHQob3BlcmF0aW9uOiBPcGVyYXRpb25LZXlzLCBtb2RlbDogQ29uc3RydWN0b3I8TT4pOiBQcm9taXNlPENvbnRleHQ8TT4+O1xufVxuIl19

@@ -9,5 +9,6 @@ import { Constructor, Model } from "@decaf-ts/decorator-validation";

*/
export interface IRepository<M extends Model> extends BulkCrudOperator<M>, Contextual {
export interface IRepository<M extends Model> extends BulkCrudOperator<M>, Contextual<M> {
readonly class: Constructor<M>;
readonly pk: string;
timestamp(): Promise<Date>;
}
export {};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL0lSZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJmaWxlIjoiaW50ZXJmYWNlcy9JUmVwb3NpdG9yeS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbnN0cnVjdG9yLCBNb2RlbCB9IGZyb20gXCJAZGVjYWYtdHMvZGVjb3JhdG9yLXZhbGlkYXRpb25cIjtcbmltcG9ydCB7IEJ1bGtDcnVkT3BlcmF0b3IgfSBmcm9tIFwiLi9CdWxrQ3J1ZE9wZXJhdG9yXCI7XG5pbXBvcnQgeyBDb250ZXh0dWFsIH0gZnJvbSBcIi4vQ29udGV4dHVhbFwiO1xuXG4vKipcbiAqIEBzdW1tYXJ5IEludGVyZmFjZSBob2xkaW5nIGJhc2ljIENSVUQgQVBJc1xuICogQHR5cGVkZWYgVCBleHRlbmRzIHtAbGluayBNb2RlbH1cbiAqIEBpbnRlcmZhY2UgSVJlcG9zaXRvcnl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c3RhbXAoKTogUHJvbWlzZTxEYXRlPjtcbn1cbiJdfQ==

@@ -19,4 +19,4 @@ import { Model } from "@decaf-ts/decorator-validation";

};
export declare function composedFromCreateUpdate<T extends Model, V extends IRepository<T>>(this: V, context: Context, data: ComposedFromMetadata, key: string, model: T): void;
export declare function composedFromCreateUpdate<M extends Model, V extends IRepository<M>>(this: V, context: Context<M>, data: ComposedFromMetadata, key: string, model: M): void;
export declare function composedFromKeys(args: string[], separator?: string, hash?: boolean, prefix?: string, suffix?: string): (target: object, propertyKey?: any, descriptor?: any) => void;
export declare function composed(args: string[], separator?: string, hash?: boolean, prefix?: string, suffix?: string): (target: object, propertyKey?: any, descriptor?: any) => void;

@@ -69,2 +69,2 @@ import { DBKeys, DefaultSeparator } from "./constants";

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tb2RlbC9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDdkQsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzdDLE9BQU8sRUFDTCxPQUFPLEVBRVAsWUFBWSxFQUNaLEVBQUUsR0FDSCxNQUFNLGdDQUFnQyxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUUxRCxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDckQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBR3REOzs7O0dBSUc7QUFFSCxNQUFNLFVBQVUsa0JBQWtCLENBSXZCLElBQU8sRUFBRSxHQUFXLEVBQUUsS0FBUSxFQUFFLFFBQVk7SUFDckQsSUFBSSxDQUFFLEt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xuKSB7XG4gIHJldHVybiBjb21wb3NlZEZyb20oYXJncywgaGFzaCwgc2VwYXJhdG9yLCBcImtleXNcIiwgcHJlZml4LCBzdWZmaXgpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY29tcG9zZWQoXG4gIGFyZ3M6IHN0cmluZ1tdLFxuICBzZXBhcmF0b3I6IHN0cmluZyA9IERlZmF1bHRTZXBhcmF0b3IsXG4gIGhhc2g6IGJvb2xlYW4gPSBmYWxzZSxcbiAgcHJlZml4ID0gXCJcIixcbiAgc3VmZml4ID0gXCJcIlxuKSB7XG4gIHJldHVybiBjb21wb3NlZEZyb20oYXJncywgaGFzaCwgc2VwYXJhdG9yLCBcInZhbHVlc1wiLCBwcmVmaXgsIHN1ZmZpeCk7XG59XG4iXX0=

@@ -48,3 +48,7 @@ import { ModelErrorDefinition, ModelKeys, ReservedModels, sf, Validation, ValidationKeys, } from "@decaf-ts/decorator-validation";

// tests nested classes
for (const prop of Object.keys(newModel).filter((k) => !result || !result[k])) {
for (const prop of Object.keys(newModel).filter((k) => {
if (exceptions.includes(k))
return false;
return !result || !result[k];
})) {
let err;

@@ -123,2 +127,2 @@ // if a nested Model

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tb2RlbC92YWxpZGF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxvQkFBb0IsRUFFcEIsU0FBUyxFQUNULGNBQWMsRUFDZCxFQUFFLEVBRUYsVUFBVSxFQUNWLGNBQWMsR0FFZixNQUFNLGdDQUFnQyxDQUFDO0FBQ3hDLE9BQU8sRUFBcUIscUJBQXFCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNoRixPQUFPLEVBQUUsb0JBQW9CLEVBQW1CLE1BQU0sZUFBZSxDQUFDO0FBQ3RFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxhQUFhLENBQU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AgICAgICAgICAoZCkgPT4gZC5rZXkgPT09IFZhbGlkYXRpb25LZXlzLkxJU1RcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgaWYgKGxpc3REZWMpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVudExpc3QsIG9sZExpc3Q7XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGMpIHtcbiAgICAgICAgICAgICAgICAgIGNhc2UgQXJyYXkubmFtZTpcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudExpc3QgPSAobmV3TW9kZWwgYXMgUmVjb3JkPHN0cmluZywgYW55PilbcHJvcF07XG4gICAgICAgICAgICAgICAgICAgIG9sZExpc3QgPSAob2xkTW9kZWwgYXMgUmVjb3JkPHN0cmluZywgYW55PilbcHJvcF07XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgY2FzZSBTZXQubmFtZTpcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudExpc3QgPSAobmV3TW9kZWwgYXMgUmVjb3JkPHN0cmluZywgYW55PilbXG4gICAgICAgICAgICAgICAgICAgICAgcHJvcFxuICAgICAgICAgICAgICAgICAgICBdLnZhbHVlcygpO1xuICAgICAgICAgICAgICAgICAgICBvbGRMaXN0ID0gKG9sZE1vZGVsIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdLnZhbHVlcygpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBhdHRyaWJ1dGUgdHlwZSAke2N9YCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXJyID0gY3VycmVudExpc3RcbiAgICAgICAgICAgICAgICAgIC5tYXAoKHY6IFZhbGlkYXRhYmxlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGlkID0gZmluZE1vZGVsSWQodiBhcyBhbnksIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWlkKSByZXR1cm4gXCJGYWlsZWQgdG8gZmluZCBtb2RlbCBpZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBvbGRNb2RlbCA9IG9sZExpc3QuZmluZChcbiAgICAgICAgICAgICAgICAgICAgICAoZWw6IGFueSkgPT4gaWQgPT09IGZpbmRNb2RlbElkKGVsLCB0cnVlKVxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghb2xkTW9kZWwpIHJldHVybjsgLy8gbm90aGluZyB0byBjb21wYXJlIHdpdGhcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYuaGFzRXJyb3JzKG9sZE1vZGVsKTtcbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAuZmlsdGVyKChlOiBhbnkpID0+ICEhZSkgYXMgYW55O1xuXG4gICAgICAgICAgICAgICAgaWYgKCFlcnI/Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIHJlc3VsdCBpcyBhbiBlbXB0eSBsaXN0Li4uXG4gICAgICAgICAgICAgICAgICBlcnIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIChuZXdNb2RlbCBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXSAmJlxuICAgICAgICAgICAgICAgIChvbGRNb2RlbCBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXVxuICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgZXJyID0gKG5ld01vZGVsIGFzIFJlY29yZDxzdHJpbmcsIG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gICAgICAgICAgY2FzZSBBcnJheS5uYW1lOlxuICAgICAgICAgIGNhc2UgU2V0Lm5hbWU6XG4gICAgICAgICAgICBpZiAoYWxsRGVjb3JhdG9ycy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgY29uc3QgbGlzdERlYyA9IGFsbERlY29yYXRvcnMuZmluZChcbiAgICAgICAgICAgICAgICAoZCkgPT4gZC5rZXkgPT09IFZhbGlkYXRpb25LZXlzLkxJU1RcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgaWYgKGxpc3REZWMpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVudExpc3QsIG9sZExpc3Q7XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGMpIHtcbiAgICAgICAgICAgICAgICAgIGNhc2UgQXJyYXkubmFtZTpcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudExpc3QgPSAobmV3TW9kZWwgYXMgUmVjb3JkPHN0cmluZywgYW55PilbcHJvcF07XG4gICAgICAgICAgICAgICAgICAgIG9sZExpc3QgPSAob2xkTW9kZWwgYXMgUmVjb3JkPHN0cmluZywgYW55PilbcHJvcF07XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgY2FzZSBTZXQubmFtZTpcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudExpc3QgPSAobmV3TW9kZWwgYXMgUmVjb3JkPHN0cmluZywgYW55PilbXG4gICAgICAgICAgICAgICAgICAgICAgcHJvcFxuICAgICAgICAgICAgICAgICAgICBdLnZhbHVlcygpO1xuICAgICAgICAgICAgICAgICAgICBvbGRMaXN0ID0gKG9sZE1vZGVsIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdLnZhbHVlcygpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBhdHRyaWJ1dGUgdHlwZSAke2N9YCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXJyID0gY3VycmVudExpc3RcbiAgICAgICAgICAgICAgICAgIC5tYXAoKHY6IFZhbGlkYXRhYmxlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGlkID0gZmluZE1vZGVsSWQodiBhcyBhbnksIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWlkKSByZXR1cm4gXCJGYWlsZWQgdG8gZmluZCBtb2RlbCBpZFwiO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBvbGRNb2RlbCA9IG9sZExpc3QuZmluZChcbiAgICAgICAgICAgICAgICAgICAgICAoZWw6IGFueSkgPT4gaWQgPT09IGZpbmRNb2RlbElkKGVsLCB0cnVlKVxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghb2xkTW9kZWwpIHJldHVybjsgLy8gbm90aGluZyB0byBjb21wYXJlIHdpdGhcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHYuaGFzRXJyb3JzKG9sZE1vZGVsKTtcbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAuZmlsdGVyKChlOiBhbnkpID0+ICEhZSkgYXMgYW55O1xuXG4gICAgICAgICAgICAgICAgaWYgKCFlcnI/Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIHJlc3VsdCBpcyBhbiBlbXB0eSBsaXN0Li4uXG4gICAgICAgICAgICAgICAgICBlcnIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIChuZXdNb2RlbCBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXSAmJlxuICAgICAgICAgICAgICAgIChvbGRNb2RlbCBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXVxuICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgZXJyID0gKG5ld01vZGVsIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdLmhhc0Vycm9ycyhcbiAgICAgICAgICAgICAgICAgIChvbGRNb2RlbCBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcbiAgICAgICAgICAgIH0gY2F0Y2ggKGU6IGFueSkge1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oc2YoXCJNb2RlbCBzaG91bGQgYmUgdmFsaWRhdGFibGUgYnV0IGl0cyBub3RcIikpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoZXJyKSB7XG4gICAgICAgIHJlc3VsdCA9IHJlc3VsdCB8fCB7fTtcbiAgICAgICAgcmVzdWx0W3Byb3BdID0gZXJyIGFzIGFueTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdCA/IG5ldyBNb2RlbEVycm9yRGVmaW5pdGlvbihyZXN1bHQpIDogdW5kZWZpbmVkO1xufVxuIl19

@@ -19,3 +19,3 @@ import { OperationKeys } from "./constants";

*/
export type StandardOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context, metadata: V, key: any, model: M) => Promise<void> | void;
export type StandardOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context<M>, metadata: V, key: any, model: M) => Promise<void> | void;
/**

@@ -25,3 +25,3 @@ * @typedef IdOperationHandler

*/
export type IdOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context, decorator: V, key: any, id: string) => Promise<void> | void;
export type IdOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context<M>, decorator: V, key: any, id: string) => Promise<void> | void;
/**

@@ -31,2 +31,2 @@ * @typedef AfterOperationHandler

*/
export type UpdateOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context, decorator: V, key: any, model: M, oldModel: M) => Promise<void> | void;
export type UpdateOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context<M>, decorator: V, key: any, model: M, oldModel: M) => Promise<void> | void;
export {};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9vcGVyYXRpb25zL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJmaWxlIjoib3BlcmF0aW9ucy90eXBlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE9wZXJhdGlvbktleXMgfSBmcm9tIFwiLi9jb25zdGFudHNcIjtcbmltcG9ydCB7IElSZXBvc2l0b3J5IH0gZnJvbSBcIi4uL2ludGVyZmFjZXMvSVJlcG9zaXRvcnlcIjtcbmltcG9ydCB7IE1vZGVsIH0gZnJvbSBcIkBkZWNhZi10cy9kZWNvcmF0b3ItdmFsaWRhdGlvblwiO1xuaW1wb3J0IHsgQ29udGV4dCB9IGZyb20gXCIuLi9yZXBvc2l0b3J5L0NvbnRleHRcIjtcblxuZXhwb3J0IHR5cGUgT3BlcmF0aW9uTWV0YWRhdGE8Vj4gPSB7XG4gIG9wZXJhdGlvbjogT3BlcmF0aW9uS2V5cztcbiAgaGFuZGxlcjogc3RyaW5nO1xuICBtZXRhZGF0YT86IFY7XG59O1xuXG4vKipcbiAqIEB0eXBlZGVmIE9wZXJhdGlvbkhhbmRsZXJcbiAqIEBtZW1iZXJPZiBkYi1kZWNvcmF0b3JzLm9wZXJhdGlvbnNcbiAqL1xuZXhwb3J0I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RvcnMub3BlcmF0aW9uc1xuICovXG5leHBvcnQgdHlwZSBVcGRhdGVPcGVyYXRpb25IYW5kbGVyPFxuICBNIGV4dGVuZHMgTW9kZWwsXG4gIFIgZXh0ZW5kcyBJUmVwb3NpdG9yeTxNPixcbiAgVixcbj4gPSAoXG4gIHRoaXM6IFIsXG4gIGNvbnRleHQ6IENvbnRleHQ8TT4sXG4gIGRlY29yYXRvcjogVixcbiAga2V5OiBhbnksXG4gIG1vZGVsOiBNLFxuICBvbGRNb2RlbDogTVxuKSA9PiBQcm9taXNlPHZvaWQ+IHwgdm9pZDtcbiJdfQ==
import { IRepository } from "../interfaces/IRepository";
import { Constructor, Model } from "@decaf-ts/decorator-validation";
import { OperationKeys } from "../operations/constants";
import { Context } from "./Context";

@@ -8,32 +9,32 @@ export declare abstract class BaseRepository<M extends Model> implements IRepository<M> {

get class(): Constructor<M>;
protected get pk(): string;
get pk(): string;
protected constructor(clazz?: Constructor<M>);
timestamp(): Promise<Date>;
context(): Promise<Context>;
context(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE): Promise<Context<M>>;
create(model: M, ...args: any[]): Promise<M>;
createAll(models: M[], ...args: any[]): Promise<M[]>;
protected createPrefix(model: M, ...args: any[]): Promise<any[]>;
protected createSuffix(model: M, context: Context): Promise<M>;
protected createSuffix(model: M, context: Context<M>): Promise<M>;
protected createAllPrefix(models: M[], ...args: any[]): Promise<any[]>;
protected createAllSuffix(models: M[], context: Context): Promise<M[]>;
protected createAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
read(key: string | number, ...args: any[]): Promise<M>;
readAll(keys: string[] | number[], ...args: any[]): Promise<M[]>;
protected readSuffix(model: M, context: Context): Promise<M>;
protected readSuffix(model: M, context: Context<M>): Promise<M>;
protected readPrefix(key: string, ...args: any[]): Promise<any[]>;
protected readAllPrefix(keys: string[] | number[], ...args: any[]): Promise<any[]>;
protected readAllSuffix(models: M[], context: Context): Promise<M[]>;
protected readAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
update(model: M, ...args: any[]): Promise<M>;
updateAll(models: M[], ...args: any): Promise<M[]>;
protected updateSuffix(model: M, context: Context): Promise<M>;
protected updateSuffix(model: M, context: Context<M>): Promise<M>;
protected updatePrefix(model: M, ...args: any[]): Promise<any[]>;
protected updateAllPrefix(models: M[], ...args: any[]): Promise<any[]>;
protected updateAllSuffix(models: M[], context: Context): Promise<M[]>;
protected updateAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
delete(key: string | number, ...args: any[]): Promise<M>;
deleteAll(keys: string[] | number[], ...args: any[]): Promise<M[]>;
protected deleteSuffix(model: M, context: Context): Promise<M>;
protected deleteSuffix(model: M, context: Context<M>): Promise<M>;
protected deletePrefix(key: any, ...args: any[]): Promise<any[]>;
protected deleteAllPrefix(keys: string[] | number[], ...args: any[]): Promise<any[]>;
protected deleteAllSuffix(models: M[], context: Context): Promise<M[]>;
protected deleteAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
protected merge(oldModel: M, model: M): M;
toString(): string;
}

@@ -32,4 +32,4 @@ import { sf } from "@decaf-ts/decorator-validation";

}
async context() {
return new Context();
async context(operation) {
return Context.from(operation, this.class);
}

@@ -41,7 +41,6 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars

async createAll(models, ...args) {
const contextArgs = await Context.fromArgs(this, args);
return Promise.all(models.map((m) => this.create(m, ...contextArgs.args)));
return Promise.all(models.map((m) => this.create(m, ...args)));
}
async createPrefix(model, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.CREATE, this.class, args);
model = new this.class(model);

@@ -56,3 +55,3 @@ await enforceDBDecorators(this, contextArgs.context, model, OperationKeys.CREATE, OperationKeys.ON);

async createAllPrefix(models, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.CREATE, this.class, args);
await Promise.all(models.map(async (m) => {

@@ -81,3 +80,3 @@ m = new this.class(m);

async readPrefix(key, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.READ, this.class, args);
const model = new this.class();

@@ -89,3 +88,3 @@ model[this.pk] = key;

async readAllPrefix(keys, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.READ, this.class, args);
await Promise.all(keys.map(async (k) => {

@@ -107,4 +106,3 @@ const m = new this.class();

async updateAll(models, ...args) {
const contextArgs = await Context.fromArgs(this, args);
return Promise.all(models.map((m) => this.update(m, ...contextArgs.args)));
return Promise.all(models.map((m) => this.update(m, ...args)));
}

@@ -116,3 +114,3 @@ async updateSuffix(model, context) {

async updatePrefix(model, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.UPDATE, this.class, args);
const id = model[this.pk];

@@ -126,3 +124,3 @@ if (!id)

async updateAllPrefix(models, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.UPDATE, this.class, args);
await Promise.all(models.map((m) => {

@@ -144,4 +142,3 @@ m = new this.class(m);

async deleteAll(keys, ...args) {
const contextArgs = await Context.fromArgs(this, args);
return Promise.all(keys.map((k) => this.delete(k, ...contextArgs.args)));
return Promise.all(keys.map((k) => this.delete(k, ...args)));
}

@@ -153,3 +150,3 @@ async deleteSuffix(model, context) {

async deletePrefix(key, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.DELETE, this.class, args);
const model = await this.read(key, ...contextArgs.args);

@@ -160,3 +157,3 @@ await enforceDBDecorators(this, contextArgs.context, model, OperationKeys.DELETE, OperationKeys.ON);

async deleteAllPrefix(keys, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.DELETE, this.class, args);
const models = await this.readAll(keys, ...contextArgs.args);

@@ -185,2 +182,2 @@ await Promise.all(models.map(async (m) => {

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJz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ZXh0QXJncyA9IGF3YWl0IENvbnRleHQuZnJvbUFyZ3ModGhpcywgYXJncyk7XG4gICAgYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICBtb2RlbHMubWFwKGFzeW5jIChtKSA9PiB7XG4gICAgICAgIG0gPSBuZXcgdGhpcy5jbGFzcyhtKTtcbiAgICAgICAgYXdhaXQgZW5mb3JjZURCRGVjb3JhdG9ycyhcbiAgICAgICAgICB0aGlzLFxuICAgICAgICAgIGNvbnRleHRBcmdzLmNvbnRleHQsXG4gICAgICAgICAgbSxcbiAgICAgICAgICBPcGVyYXRpb25LZXlzLkNSRUFURSxcbiAgICAgICAgICBPcGVyYXRpb25LZXlzLk9OXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybiBtO1xuICAgICAgfSlcbiAgICApO1xuICAgIHJldHVybiBbbW9kZWxzLCAuLi5jb250ZXh0QXJncy5hcmdzXTtcbiAgfVxuXG4gIHByb3RlY3RlZCBhc3luYyBjcmVhdGVBbGxTdWZmaXgobW9kZWxzOiBNW10sIGNvbnRleHQ6IENvbnRleHQpIHtcbiAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgIG1vZGVscy5tYXAoKG0pID0+XG4gICAgICAgIGVuZm9yY2VEQkRlY29yYXRvcnMoXG4gICAgICAgICAgdGhpcyxcbiAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgIG0sXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5DUkVBVEUsXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5BRlRFUlxuICAgICAgICApXG4gICAgICApXG4gICAgKTtcbiAgICByZXR1cm4gbW9kZWxzO1xuICB9XG5cbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnVzZWQtdmFyc1xuICBhc3luYyByZWFkKGtleTogc3RyaW5nIHwgbnVtYmVyLCAuLi5hcmdzOiBhbnlbXSk6IFByb21pc2U8TT4ge1xuICAgIHRoc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zXTtcbiAgfVxuXG4gIHByb3RlY3RlZCBhc3luYyByZWFkQWxsUHJlZml4KGtleXM6IHN0cmluZ1tdIHwgbnVtYmVyW10sIC4uLmFyZ3M6IGFueVtdKSB7XG4gICAgY29uc3QgY29udGV4dEFyZ3MgPSBhd2FpdCBDb250ZXh0LmZyb21BcmdzKHRoaXMsIGFyZ3MpO1xuICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAga2V5cy5tYXAoYXN5bmMgKGspID0+IHtcbiAgICAgICAgY29uc3QgbSA9IG5ldyB0aGlzLmNsYXNzKCk7XG4gICAgICAgIChtIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3RoaXMucGtdID0gaztcbiAgICAgICAgcmV0dXJuIGVuZm9yY2VEQkRlY29yYXRvcnMoXG4gICAgICAgICAgdGhpcyxcbiAgICAgICAgICBjb250ZXh0QXJncy5jb250ZXh0LFxuICAgICAgICAgIG0sXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5SRUFELFxuICAgICAgICAgIE9wZXJhdGlvbktleXMuT05cbiAgICAgICAgKTtcbiAgICAgIH0pXG4gICAgKTtcbiAgICByZXR1cm4gW2tleXMsIC4uLmNvbnRleHRBcmdzLmFyZ3NdO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFzeW5jIHJlYWRBbGxTdWZmaXgobW9kZWxzOiBNW10sIGNvbnRleHQ6IENvbnRleHQpIHtcbiAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgIG1vZGVscy5tYXAoKG0pID0+XG4gICAgICAgIGVuZm9yY2VEQkRlY29yYXRvcnMoXG4gICAgICAgICAgdGhpcyxcbiAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgIG0sXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5SRUFELFxuICAgICAgICAgIE9wZXJhdGlvbktleXMuQUZURVJcbiAgICAgICAgKVxuICAgICAgKVxuICAgICk7XG4gICAgcmV0dXJuIG1vZGVscztcbiAgfVxuXG4gIC8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Wl0IFByb21pc2UuYWxsKFxuICAgICAga2V5cy5tYXAoYXN5bmMgKGspID0+IHtcbiAgICAgICAgY29uc3QgbSA9IG5ldyB0aGlzLmNsYXNzKCk7XG4gICAgICAgIChtIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3RoaXMucGtdID0gaztcbiAgICAgICAgcmV0dXJuIGVuZm9yY2VEQkRlY29yYXRvcnMoXG4gICAgICAgICAgdGhpcyxcbiAgICAgICAgICBjb250ZXh0QXJncy5jb250ZXh0LFxuICAgICAgICAgIG0sXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5SRUFELFxuICAgICAgICAgIE9wZXJhdGlvbktleXMuT05cbiAgICAgICAgKTtcbiAgICAgIH0pXG4gICAgKTtcbiAgICByZXR1cm4gW2tleXMsIC4uLmNvbnRleHRBcmdzLmFyZ3NdO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFzeW5jIHJlYWRBbGxTdWZmaXgobW9kZWxzOiBNW10sIGNvbnRleHQ6IENvbnRleHQ8TT4pIHtcbiAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgIG1vZGVscy5tYXAoKG0pID0+XG4gICAgICAgIGVuZm9yY2VEQkRlY29yYXRvcnMoXG4gICAgICAgICAgdGhpcyxcbiAgICAgICAgICBjb250ZXh0LFxuICAgICAgICAgIG0sXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5SRUFELFxuICAgICAgICAgIE9wZXJhdGlvbktleXMuQUZURVJcbiAgICAgICAgKVxuICAgICAgKVxuICAgICk7XG4gICAgcmV0dXJuIG1vZGVscztcbiAgfVxuXG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcbiAgYXN5bmMgdXBkYXRlKG1vZGVsOiBNLCAuLi5hcmdzOiBhbnlbXSk6IFByb21pc2U8TT4ge1xuICAgIHRocm93IG5ldyBFcnJvcihcIkNoaWxkIGNsYXNzZXMg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nMoXG4gICAgICB0aGlzLFxuICAgICAgY29udGV4dEFyZ3MuY29udGV4dCxcbiAgICAgIG1vZGVsLFxuICAgICAgT3BlcmF0aW9uS2V5cy5VUERBVEUsXG4gICAgICBPcGVyYXRpb25LZXlzLk9OLFxuICAgICAgb2xkTW9kZWxcbiAgICApO1xuICAgIHJldHVybiBbbW9kZWwsIC4uLmNvbnRleHRBcmdzLmFyZ3NdO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFzeW5jIHVwZGF0ZUFsbFByZWZpeChtb2RlbHM6IE1bXSwgLi4uYXJnczogYW55W10pIHtcbiAgICBjb25zdCBjb250ZXh0QXJncyA9IGF3YWl0IENvbnRleHQuYXJncyhcbiAgICAgIHRoaXMsXG4gICAgICBPcGVyYXRpb25LZXlzLlVQREFURSxcbiAgICAgIHRoaXMuY2xhc3MsXG4gICAgICBhcmdzXG4gICAgKTtcbiAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgIG1vZGVscy5tYXAoKG0pID0+IHtcbiAgICAgICAgbSA9IG5ldyB0aGlzLmNsYXNzKG0pO1xuICAgICAgICBlbmZvcmNlREJEZWNvcmF0b3JzKFxuICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgY29udGV4dEFyZ3MuY29udGV4dCxcbiAgICAgICAgICBtLFxuICAgICAgICAgIE9wZXJhdGlvbktleXMuVVBEQVRFLFxuICAgICAgICAgIE9wZXJhdGlvbktleXMuT05cbiAgICAgICAgKTtcbiAgICAgICAgcmV0dXJuIG07XG4gICAgICB9KVxuICAgICk7XG4gICAgcmV0dXJuIFttb2RlbHMsIC4uLmNvbnRleHRBcmdzLmFyZ3NdO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFzeW5jIHVwZGF0ZUFsbFN1ZmZpeChtb2RlbHM6IE1bXSwgY29udGV4dDogQ29udGV4dDxNPikge1xuICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgbW9kZWxzLm1hcCgobSkgPT5cbiAgICAgICAgZW5mb3JjZURCRGVjb3JhdG9ycyhcbiAgICAgICAgICB0aGlzLFxuICAgICAgICAgIGNvbnRleHQsXG4gICAgICAgICAgbSxcbiAgICAgICAgICBPcGVyYXRpb25LZXlzLlVQREFURSxcbiAgICAgICAgICBPcGVyYXRpb25LZXlzLkFGVEVSXG4gICAgICAgIClcbiAgICAgIClcbiAgICApO1xuICAgIHJldHVybiBtb2RlbHM7XG4gIH1cblxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVudXNlZC12YXJzXG4gIGFzeW5jIGRlbGV0ZShrZXk6IHN0cmluZyB8IG51bWJlciwgLi4uYXJnczogYW55W10pOiBQcm9taXNlPE0+IHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJDaGlsZCBjbGFzc2VzIG11c3QgaW1wbGVtZW50IHRoaXNcIik7XG4gIH1cblxuICBhc3luYyBkZWxldGVBbGwoa2V5czogc3RyaW5nW10gfCBudW1iZXJbXSwgLi4uYXJnczogYW55W10pOiBQcm9taXNlPE1bXT4ge1xuICAgIHJldHVybiBQcm9taXNlLmFsbChrZXlzLm1hcCgoaykgPT4gdGhpcy5kZWxldGUoaywgLi4uYXJncykpKTtcbiAgfVxuXG4gIHByb3RlY3RlZCBhc3luYyBkZWxldGVTdWZmaXgobW9kZWw6IE0sIGNvbnRleHQ6IENvbnRleHQ8TT4pIHtcbiAgICBhd2FpdCBlbmZvcmNlREJEZWNvcmF0b3JzKFxuICAgICAgdGhpcyxcbiAgICAgIGNvbnRleHQsXG4gICAgICBtb2RlbCxcbiAgICAgIE9wZXJhdGlvbktleXMuREVMRVRFLFxuICAgICAgT3BlcmF0aW9uS2V5cy5BRlRFUlxuICAgICk7XG4gICAgcmV0dXJuIG1vZGVsO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFzeW5jIGRlbGV0ZVByZWZpeChrZXk6IGFueSwgLi4uYXJnczogYW55W10pIHtcbiAgICBjb25zdCBjb250Z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yIHsxfVwiLFxuICAgICAgdGhpcy5jb25zdHJ1Y3Rvci5uYW1lLFxuICAgICAgdGhpcy5jbGFzcy5uYW1lXG4gICAgKTtcbiAgfVxufVxuIl19
import { DataCache } from "./DataCache";
import { ContextArgs } from "./utils";
import { Contextual } from "../interfaces/Contextual";
export declare class Context extends DataCache {
import { OperationKeys } from "../operations/constants";
import { Constructor, Model } from "@decaf-ts/decorator-validation";
export declare class Context<M extends Model> extends DataCache {
private operation;
private model?;
private parent?;
constructor(parent?: Context | undefined);
protected constructor(operation: OperationKeys, model?: Constructor<M> | undefined, parent?: Context<any> | undefined);
get(key: string): Promise<any>;
pop(key: string): Promise<any>;
child(): Context;
static fromArgs(contextual: Contextual, args: any[]): Promise<ContextArgs>;
child<N extends Model>(operation: OperationKeys, model?: Constructor<N>): Context<N>;
static from<M extends Model>(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE, model: Constructor<M>): Promise<Context<M>>;
static args<M extends Model>(contextual: Contextual<M>, operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE, model: Constructor<M>, args: any[]): Promise<ContextArgs<M>>;
}
import { DataCache } from "./DataCache";
import { NotFoundError } from "./errors";
export class Context extends DataCache {
constructor(parent) {
constructor(operation, model, parent) {
super();
this.operation = operation;
this.model = model;
this.parent = parent;

@@ -25,6 +27,9 @@ }

}
child() {
return this.constructor(this);
child(operation, model) {
return this.constructor(operation, model, this);
}
static async fromArgs(contextual, args) {
static async from(operation, model) {
return new Context(operation, model);
}
static async args(contextual, operation, model, args) {
const last = args.pop();

@@ -38,3 +43,3 @@ let c;

else {
c = await contextual.context();
c = await contextual.context(operation, model);
args.push(last, c);

@@ -44,3 +49,3 @@ }

else {
c = await contextual.context();
c = await contextual.context(operation, model);
args.push(c);

@@ -52,2 +57,2 @@ }

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN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W9uLCBtb2RlbCk7XG4gICAgICBhcmdzLnB1c2goYyk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHsgY29udGV4dDogYywgYXJnczogYXJncyB9O1xuICB9XG59XG4iXX0=

@@ -16,3 +16,3 @@ import { enforceDBDecorators } from "./utils";

async createPrefix(model, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.CREATE, this.class, args);
model = new this.class(model);

@@ -26,3 +26,3 @@ await enforceDBDecorators(this, contextArgs.context, model, OperationKeys.CREATE, OperationKeys.ON);

async createAllPrefix(models, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.CREATE, this.class, args);
await Promise.all(models.map(async (m) => {

@@ -60,3 +60,3 @@ m = new this.class(m);

async updatePrefix(model, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.UPDATE, this.class, args);
const pk = model[this.pk];

@@ -74,3 +74,3 @@ if (!pk)

async updateAllPrefix(models, ...args) {
const contextArgs = await Context.fromArgs(this, args);
const contextArgs = await Context.args(this, OperationKeys.UPDATE, this.class, args);
const ids = models.map((m) => {

@@ -104,2 +104,2 @@ const id = m[this.pk];

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9yZXBvc2l0b3J5L1JlcG9zaXRvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQzlDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN4RCxPQUFPLEVBQUUsYUFBYSxFQUFFLGVBQWUsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUMxRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFbEQsT0FBTyxFQUFFLE1BQU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F3YWl0IFByb21pc2UuYWxsKFxuICAgICAgbW9kZWxzLm1hcCgobSwgaSkgPT5cbiAgICAgICAgZW5mb3JjZURCRGVjb3JhdG9ycyhcbiAgICAgICAgICB0aGlzLFxuICAgICAgICAgIGNvbnRleHRBcmdzLmNvbnRleHQsXG4gICAgICAgICAgbSxcbiAgICAgICAgICBPcGVyYXRpb25LZXlzLlVQREFURSxcbiAgICAgICAgICBPcGVyYXRpb25LZXlzLk9OLFxuICAgICAgICAgIG9sZE1vZGVsc1tpXVxuICAgICAgICApXG4gICAgICApXG4gICAgKTtcblxuICAgIGNvbnN0IGVycm9ycyA9IG1vZGVsc1xuICAgICAgLm1hcCgobSwgaSkgPT4gbS5oYXNFcnJvcnMob2xkTW9kZWxzW2ldLCBtKSlcbiAgICAgIC5yZWR1Y2UoKGFjY3VtOiBzdHJpbmcgfCB1bmRlZmluZWQsIGUsIGkpID0+IHtcbiAgICAgICAgaWYgKGUpXG4gICAgICAgICAgYWNjdW0gPVxuICAgICAgICAgICAgdHlwZW9mIGFjY3VtID09PSBcInN0cmluZ1wiXG4gICAgICAgICAgICAgID8gYWNjdW0gKyBgXFxuIC0gJHtpfTogJHtlLnRvU3RyaW5nKCl9YFxuICAgICAgICAgICAgICA6IGAgLSAke2l9OiAke2UudG9TdHJpbmcoKX1gO1xuICAgICAgICByZXR1cm4gYWNjdW07XG4gICAgICB9LCB1bmRlZmluZWQpO1xuICAgIGlmIChlcnJvcnMpIHRocm93IG5ldyBWYWxpZGF0aW9uRXJyb3IoZXJyb3JzKTtcbiAgICByZXR1cm4gW21vZGVscywgLi4uY29udGV4dEFyZ3MuYXJnc107XG4gIH1cblxuICBzdGF0aWMga2V5KGtleTogc3RyaW5nKSB7XG4gICAgcmV0dXJuIERCS2V5cy5SRUZMRUNUICsga2V5O1xuICB9XG59XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9yZXBvc2l0b3J5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4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5VUERBVEUsXG4gICAgICAgICAgT3BlcmF0aW9uS2V5cy5PTixcbiAgICAgICAgICBvbGRNb2RlbHNbaV1cbiAgICAgICAgKVxuICAgICAgKVxuICAgICk7XG5cbiAgICBjb25zdCBlcnJvcnMgPSBtb2RlbHNcbiAgICAgIC5tYXAoKG0sIGkpID0+IG0uaGFzRXJyb3JzKG9sZE1vZGVsc1tpXSwgbSkpXG4gICAgICAucmVkdWNlKChhY2N1bTogc3RyaW5nIHwgdW5kZWZpbmVkLCBlLCBpKSA9PiB7XG4gICAgICAgIGlmIChlKVxuICAgICAgICAgIGFjY3VtID1cbiAgICAgICAgICAgIHR5cGVvZiBhY2N1bSA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICA/IGFjY3VtICsgYFxcbiAtICR7aX06ICR7ZS50b1N0cmluZygpfWBcbiAgICAgICAgICAgICAgOiBgIC0gJHtpfTogJHtlLnRvU3RyaW5nKCl9YDtcbiAgICAgICAgcmV0dXJuIGFjY3VtO1xuICAgICAgfSwgdW5kZWZpbmVkKTtcbiAgICBpZiAoZXJyb3JzKSB0aHJvdyBuZXcgVmFsaWRhdGlvbkVycm9yKGVycm9ycyk7XG4gICAgcmV0dXJuIFttb2RlbHMsIC4uLmNvbnRleHRBcmdzLmFyZ3NdO1xuICB9XG5cbiAgc3RhdGljIGtleShrZXk6IHN0cmluZykge1xuICAgIHJldHVybiBEQktleXMuUkVGTEVDVCArIGtleTtcbiAgfVxufVxuIl19

@@ -5,4 +5,4 @@ import { IRepository } from "../interfaces/IRepository";

import { Context } from "./Context";
export type ContextArgs = {
context: Context;
export type ContextArgs<M extends Model> = {
context: Context<M>;
args: any[];

@@ -38,3 +38,3 @@ };

*/
export declare function enforceDBDecorators<T extends Model, Y extends IRepository<T>, V>(repo: Y, context: Context, model: T, operation: string, prefix: string, oldModel?: T): Promise<void>;
export declare function enforceDBDecorators<M extends Model, Y extends IRepository<M>, V>(repo: Y, context: Context<M>, model: M, operation: string, prefix: string, oldModel?: M): Promise<void>;
/**

@@ -41,0 +41,0 @@ * Specific for DB Decorators

@@ -168,2 +168,2 @@ import { Operations } from "../operations/Operations";

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9yZXBvc2l0b3J5L3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUd0RCxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDeEQsT0FBTyxFQUVMLHdCQUF3QixHQUN6QixNQUFNLHNCQUFzQixDQUFDO0FBQzlCLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDekMsT0FBTyxFQUdMLFNBQVMsRUFDVCxFQUFFLEdBQ0gsTUFBTSxnQ0FBZ0MsQ0FBQztBQVF4Qzs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsVUFDNUIsR0FBUSxFQUNSLElBQVksRUFDWixDQUFtQixFQUNuQixLQUEwQztJQUUxQyxNQUFNLElBQUksR0FBRyxDQUFDLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQztJQUNoQyxJQUFJLENBQUMsSUFBSTtRQUFFLE1BQU0sSUFBSSxhQUFhLENBQUMsaUNBQWlDLENBQUMsQ0FBQztJQUN0RSxLQUFLLEdBQUcsS0FBSyxJQUFJLEVBQUUsQ0FBQztJQUVwQixJQUFJLEdBQUcsQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLEdBQUcsQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksQ0FBQztRQUM1RCxLQUFLLEdBQUcsRUFBRSxHQUFHLEdBQUcsQ0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PSBhY2N1bXVsYXRvcltrZXldLmZpbmQoKGUpID0+IGUua2V5ID09PSB2YWwua2V5KSkgfHxcbiAgICAgICAgICBtYXRjaC5wcm9wcy5vcGVyYXRpb24gIT09IHZhbC5wcm9wcy5vcGVyYXRpb25cbiAgICAgICAgKSB7XG4gICAgICAgICAgYWNjdW11bGF0b3Jba2V5XS5wdXNoKHZhbCk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHZhbC5rZXkgPT09IE1vZGVsS2V5cy5UWVBFKSByZXR1cm47XG5cbiAgICAgICAgY29uc3QgeyBoYW5kbGVycywgb3BlcmF0aW9uIH0gPSB2YWwucHJvcHM7XG5cbiAgICAgICAgaWYgKFxuICAgICAgICAgICFvcGVyYXRpb24gfHxcbiAgICAgICAgICAhb3BlcmF0aW9uLm1hdGNoKFxuICAgICAgICAgICAgbmV3IFJlZ0V4cChcbiAgICAgICAgICAgICAgYF4oOj8ke09wZXJhdGlvbktleXMuT059fCR7T3BlcmF0aW9uS2V5cy5BRlRFUn0pKDo/JHtPcGVyYXRpb25LZXlzLkNSRUFURX18JHtPcGVyYXRpb25LZXlzLlJFQUR9fCR7T3BlcmF0aW9uS2V5cy5VUERBVEV9fCR7T3BlcmF0aW9uS2V5cy5ERUxFVEV9KSRgXG4gICAgICAgICAgICApXG4gICAgICAgICAgKVxuICAgICAgICApIHtcbiAgICAgICAgICBhY2N1bXVsYXRvcltrZXldLnB1c2godmFsKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBhY2N1bUhhbmRsZXJzID0gbWF0Y2gucHJvcHMuaGFuZGxlcnM7XG5cbiAgICAgICAgT2JqZWN0LmVudHJpZXMoaGFuZGxlcnMpLmZvckVhY2goKFtjbGF6eiwgaGFuZGxlckRlZl0pID0+IHtcbiAgICAgICAgICBpZiAoIShjbGF6eiBpbiBhY2N1bUhhbmRsZXJzKSkge1xuICAgICAgICAgICAgYWNjdW1IYW5kbGVyc1tjbGF6el0gPSBoYW5kbGVyRGVmO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGhhbmRsZXJEZWYgYXMgb2JqZWN0KS5mb3JFYWNoKFxuICAgICAgICAgICAgKFtoYW5kbGVyUHJvcCwgaGFuZGxlcl0pID0+IHtcbiAgICAgICAgICAgICAgaWYgKCEoaGFuZGxlclByb3AgaW4gYWNjdW1IYW5kbGVyc1tjbGF6el0pKSB7XG4gICAgICAgICAgICAgICAgYWNjdW1IYW5kbGVyc1tjbGF6el1baGFuZGxlclByb3BdID0gaGFuZGxlcjtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhoYW5kbGVyIGFzIG9iamVjdCkuZm9yRWFjaChcbiAgICAgICAgICAgICAgICAoW2hhbmRsZXJLZXksIGFyZ3NPYmpdKSA9PiB7XG4gICAgICAgICAgICAgICAgICBpZiAoIShoYW5kbGVyS2V5IGluIGFjY3VtSGFuZGxlcnNbY2xhenpdW2hhbmRsZXJQcm9wXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjdW1IYW5kbGVyc1tjbGF6el1baGFuZGxlclByb3BdW2hhbmRsZXJLZXldID0gYXJnc09iajtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICBzZihcbiAgICAgICAgICAgICAgICAgICAgICBcIlNraXBwaW5nIGhhbmRsZXIgcmVnaXN0cmF0aW9uIGZvciB7MH0gdW5kZXIgcHJvcCB7MH0gYmVjYXVzZSBoYW5kbGVyIGlzIHRoZSBzYW1lXCIsXG4gICAgICAgICAgICAgICAgICAgICAgY2xhenosXG4gICAgICAgICAgICAgICAgICAgICAgaGFuZGxlclBy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tleV0uZmluZCgoZSkgPT4gZS5rZXkgPT09IHZhbC5rZXkpKSB8fFxuICAgICAgICAgIG1hdGNoLnByb3BzLm9wZXJhdGlvbiAhPT0gdmFsLnByb3BzLm9wZXJhdGlvblxuICAgICAgICApIHtcbiAgICAgICAgICBhY2N1bXVsYXRvcltrZXldLnB1c2godmFsKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodmFsLmtleSA9PT0gTW9kZWxLZXlzLlRZUEUpIHJldHVybjtcblxuICAgICAgICBjb25zdCB7IGhhbmRsZXJzLCBvcGVyYXRpb24gfSA9IHZhbC5wcm9wcztcblxuICAgICAgICBpZiAoXG4gICAgICAgICAgIW9wZXJhdGlvbiB8fFxuICAgICAgICAgICFvcGVyYXRpb24ubWF0Y2goXG4gICAgICAgICAgICBuZXcgUmVnRXhwKFxuICAgICAgICAgICAgICBgXig6PyR7T3BlcmF0aW9uS2V5cy5PTn18JHtPcGVyYXRpb25LZXlzLkFGVEVSfSkoOj8ke09wZXJhdGlvbktleXMuQ1JFQVRFfXwke09wZXJhdGlvbktleXMuUkVBRH18JHtPcGVyYXRpb25LZXlzLlVQREFURX18JHtPcGVyYXRpb25LZXlzLkRFTEVURX0pJGBcbiAgICAgICAgICAgIClcbiAgICAgICAgICApXG4gICAgICAgICkge1xuICAgICAgICAgIGFjY3VtdWxhdG9yW2tleV0ucHVzaCh2YWwpO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGFjY3VtSGFuZGxlcnMgPSBtYXRjaC5wcm9wcy5oYW5kbGVycztcblxuICAgICAgICBPYmplY3QuZW50cmllcyhoYW5kbGVycykuZm9yRWFjaCgoW2NsYXp6LCBoYW5kbGVyRGVmXSkgPT4ge1xuICAgICAgICAgIGlmICghKGNsYXp6IGluIGFjY3VtSGFuZGxlcnMpKSB7XG4gICAgICAgICAgICBhY2N1bUhhbmRsZXJzW2NsYXp6XSA9IGhhbmRsZXJEZWY7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMoaGFuZGxlckRlZiBhcyBvYmplY3QpLmZvckVhY2goXG4gICAgICAgICAgICAoW2hhbmRsZXJQcm9wLCBoYW5kbGVyXSkgPT4ge1xuICAgICAgICAgICAgICBpZiAoIShoYW5kbGVyUHJvcCBpbiBhY2N1bUhhbmRsZXJzW2NsYXp6XSkpIHtcbiAgICAgICAgICAgICAgICBhY2N1bUhhbmRsZXJzW2NsYXp6XVtoYW5kbGVyUHJvcF0gPSBoYW5kbGVyO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGhhbmRsZXIgYXMgb2JqZWN0KS5mb3JFYWNoKFxuICAgICAgICAgICAgICAgIChbaGFuZGxlcktleSwgYXJnc09ial0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICghKGhhbmRsZXJLZXkgaW4gYWNjdW1IYW5kbGVyc1tjbGF6el1baGFuZGxlclByb3BdKSkge1xuICAgICAgICAgICAgICAgICAgICBhY2N1bUhhbmRsZXJzW2NsYXp6XVtoYW5kbGVyUHJvcF1baGFuZGxlcktleV0gPSBhcmdzT2JqO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIHNmKFxuICAgICAgICAgICAgICAgICAgICAgIFwiU2tpcHBpbmcgaGFuZGxlciByZWdpc3RyYXRpb24gZm9yIHswfSB1bmRlciBwcm9wIHswfSBiZWNhdXNlIGhhbmRsZXIgaXMgdGhlIHNhbWVcIixcbiAgICAgICAgICAgICAgICAgICAgICBjbGF6eixcbiAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVyUHJvcFxuICAgICAgICAgICAgICAgICAgICApXG4gICA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15,3 @@ import { Model } from "@decaf-ts/decorator-validation";

export declare function readonly(message?: string): PropertyDecorator;
export declare function timestampHandler<T extends Model, V extends IRepository<T>, Y = any>(this: V, context: Context, data: Y, key: string, model: T): Promise<void>;
export declare function timestampHandler<M extends Model, V extends IRepository<M>, Y = any>(this: V, context: Context<M>, data: Y, key: string, model: M): Promise<void>;
/**

@@ -18,0 +18,0 @@ * Marks the property as timestamp.

@@ -220,2 +220,2 @@ import { date, propMetadata, required, sf, type, Validation, } from "@decaf-ts/decorator-validation";

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL2RlY29yYXRvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLElBQUksRUFFSixZQUFZLEVBQ1osUUFBUSxFQUNSLEVBQUUsRUFDRixJQUFJLEVBQ0osVUFBVSxHQUNYLE1BQU0sZ0NBQWdDLENBQUM7QUFDeEMsT0FBTyxFQUFFLE1BQU0sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ3RFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUNyRCxPQUFPLEVBQUUsWUFBWSxFQUFFLGFBQWEsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3RFLE9BQU8sRUFBRSxLQUFLLEVBQUUsRUFBRSxFQUFFLGNBQWMsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRXJFLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzFELE9BQU8sRUFBRSxLQUFLLEVBQW1CLFFBQVEsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3hFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFHM0M7Ozs7Ozs7O0dBUUc7QUFDSCxNQUFN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ICogQHBhcmFtIHtDb25zdHJ1Y3Rvcjxhbnk+fSBjbGF6eiB0aGUge0BsaW5rIFNlcXVlbmNlfSB0byB1c2UuIERlZmF1bHRzIHRvIHtAbGluayBOb25lU2VxdWVuY2V9XG4vLyAgKiBAcGFyYW0ge0Nhc2NhZGVNZXRhZGF0YX0gW2Nhc2NhZGVPcHRpb25zXVxuLy8gICpcbi8vICAqIEBmdW5jdGlvbiBtYW55VG9PbmVcbi8vICAqXG4vLyAgKiBAbWVtYmVyT2YgbW9kdWxlOndhbGxldC1kYi5EZWNvcmF0b3JzXG4vLyAgKlxuLy8gICogQHNlZSBvbmVUb01hbnlcbi8vICAqIEBzZWUgb25lVG9PbmVcbi8vICAqL1xuLy8gZXhwb3J0IGZ1bmN0aW9uIG1hbnlUb09uZShcbi8vICAgY2xheno6IENvbnN0cnVjdG9yPGFueT4sXG4vLyAgIGNhc2NhZGVPcHRpb25zOiBDYXNjYWRlTWV0YWRhdGEgPSBEZWZhdWx0Q2FzY2FkZSxcbi8vICkge1xuLy8gICBNb2RlbC5yZWdpc3RlcihjbGF6eik7XG4vLyAgIHJldHVybiAodGFyZ2V0OiBhbnksIHByb3BlcnR5S2V5OiBzdHJpbmcpID0+IHtcbi8vICAgICBSZWZsZWN0LmRlZmluZU1ldGFkYXRhKFxuLy8gICAgICAgZ2V0REJLZXkoV2FsbGV0RGJLZXlzLk1BTllfVE9fT05FKSxcbi8vICAgICAgIHtcbi8vICAgICAgICAgY29uc3RydWN0b3I6IGNsYXp6Lm5hbWUsXG4vLyAgICAgICAgIGNhc2NhZGU6IGNhc2NhZGVPcHRpb25zLFxuLy8gICAgICAgfSxcbi8vICAgICAgIHRhcmdldCxcbi8vICAgICAgIHByb3BlcnR5S2V5LFxuLy8gICAgICk7XG4vLyAgIH07XG4vLyB9XG4iXX0=

@@ -1,4 +0,6 @@

import { Context } from "../repository/Context";
export interface Contextual {
context(): Promise<Context>;
import { OperationKeys } from "../operations";
import { Constructor, Model } from "@decaf-ts/decorator-validation";
import { Context } from "../repository";
export interface Contextual<M extends Model> {
context(operation: OperationKeys, model: Constructor<M>): Promise<Context<M>>;
}

@@ -9,5 +9,6 @@ import { Constructor, Model } from "@decaf-ts/decorator-validation";

*/
export interface IRepository<M extends Model> extends BulkCrudOperator<M>, Contextual {
export interface IRepository<M extends Model> extends BulkCrudOperator<M>, Contextual<M> {
readonly class: Constructor<M>;
readonly pk: string;
timestamp(): Promise<Date>;
}

@@ -19,4 +19,4 @@ import { Model } from "@decaf-ts/decorator-validation";

};
export declare function composedFromCreateUpdate<T extends Model, V extends IRepository<T>>(this: V, context: Context, data: ComposedFromMetadata, key: string, model: T): void;
export declare function composedFromCreateUpdate<M extends Model, V extends IRepository<M>>(this: V, context: Context<M>, data: ComposedFromMetadata, key: string, model: M): void;
export declare function composedFromKeys(args: string[], separator?: string, hash?: boolean, prefix?: string, suffix?: string): (target: object, propertyKey?: any, descriptor?: any) => void;
export declare function composed(args: string[], separator?: string, hash?: boolean, prefix?: string, suffix?: string): (target: object, propertyKey?: any, descriptor?: any) => void;

@@ -19,3 +19,3 @@ import { OperationKeys } from "./constants";

*/
export type StandardOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context, metadata: V, key: any, model: M) => Promise<void> | void;
export type StandardOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context<M>, metadata: V, key: any, model: M) => Promise<void> | void;
/**

@@ -25,3 +25,3 @@ * @typedef IdOperationHandler

*/
export type IdOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context, decorator: V, key: any, id: string) => Promise<void> | void;
export type IdOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context<M>, decorator: V, key: any, id: string) => Promise<void> | void;
/**

@@ -31,2 +31,2 @@ * @typedef AfterOperationHandler

*/
export type UpdateOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context, decorator: V, key: any, model: M, oldModel: M) => Promise<void> | void;
export type UpdateOperationHandler<M extends Model, R extends IRepository<M>, V> = (this: R, context: Context<M>, decorator: V, key: any, model: M, oldModel: M) => Promise<void> | void;
import { IRepository } from "../interfaces/IRepository";
import { Constructor, Model } from "@decaf-ts/decorator-validation";
import { OperationKeys } from "../operations/constants";
import { Context } from "./Context";

@@ -8,32 +9,32 @@ export declare abstract class BaseRepository<M extends Model> implements IRepository<M> {

get class(): Constructor<M>;
protected get pk(): string;
get pk(): string;
protected constructor(clazz?: Constructor<M>);
timestamp(): Promise<Date>;
context(): Promise<Context>;
context(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE): Promise<Context<M>>;
create(model: M, ...args: any[]): Promise<M>;
createAll(models: M[], ...args: any[]): Promise<M[]>;
protected createPrefix(model: M, ...args: any[]): Promise<any[]>;
protected createSuffix(model: M, context: Context): Promise<M>;
protected createSuffix(model: M, context: Context<M>): Promise<M>;
protected createAllPrefix(models: M[], ...args: any[]): Promise<any[]>;
protected createAllSuffix(models: M[], context: Context): Promise<M[]>;
protected createAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
read(key: string | number, ...args: any[]): Promise<M>;
readAll(keys: string[] | number[], ...args: any[]): Promise<M[]>;
protected readSuffix(model: M, context: Context): Promise<M>;
protected readSuffix(model: M, context: Context<M>): Promise<M>;
protected readPrefix(key: string, ...args: any[]): Promise<any[]>;
protected readAllPrefix(keys: string[] | number[], ...args: any[]): Promise<any[]>;
protected readAllSuffix(models: M[], context: Context): Promise<M[]>;
protected readAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
update(model: M, ...args: any[]): Promise<M>;
updateAll(models: M[], ...args: any): Promise<M[]>;
protected updateSuffix(model: M, context: Context): Promise<M>;
protected updateSuffix(model: M, context: Context<M>): Promise<M>;
protected updatePrefix(model: M, ...args: any[]): Promise<any[]>;
protected updateAllPrefix(models: M[], ...args: any[]): Promise<any[]>;
protected updateAllSuffix(models: M[], context: Context): Promise<M[]>;
protected updateAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
delete(key: string | number, ...args: any[]): Promise<M>;
deleteAll(keys: string[] | number[], ...args: any[]): Promise<M[]>;
protected deleteSuffix(model: M, context: Context): Promise<M>;
protected deleteSuffix(model: M, context: Context<M>): Promise<M>;
protected deletePrefix(key: any, ...args: any[]): Promise<any[]>;
protected deleteAllPrefix(keys: string[] | number[], ...args: any[]): Promise<any[]>;
protected deleteAllSuffix(models: M[], context: Context): Promise<M[]>;
protected deleteAllSuffix(models: M[], context: Context<M>): Promise<M[]>;
protected merge(oldModel: M, model: M): M;
toString(): string;
}
import { DataCache } from "./DataCache";
import { ContextArgs } from "./utils";
import { Contextual } from "../interfaces/Contextual";
export declare class Context extends DataCache {
import { OperationKeys } from "../operations/constants";
import { Constructor, Model } from "@decaf-ts/decorator-validation";
export declare class Context<M extends Model> extends DataCache {
private operation;
private model?;
private parent?;
constructor(parent?: Context | undefined);
protected constructor(operation: OperationKeys, model?: Constructor<M> | undefined, parent?: Context<any> | undefined);
get(key: string): Promise<any>;
pop(key: string): Promise<any>;
child(): Context;
static fromArgs(contextual: Contextual, args: any[]): Promise<ContextArgs>;
child<N extends Model>(operation: OperationKeys, model?: Constructor<N>): Context<N>;
static from<M extends Model>(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE, model: Constructor<M>): Promise<Context<M>>;
static args<M extends Model>(contextual: Contextual<M>, operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE, model: Constructor<M>, args: any[]): Promise<ContextArgs<M>>;
}

@@ -5,4 +5,4 @@ import { IRepository } from "../interfaces/IRepository";

import { Context } from "./Context";
export type ContextArgs = {
context: Context;
export type ContextArgs<M extends Model> = {
context: Context<M>;
args: any[];

@@ -38,3 +38,3 @@ };

*/
export declare function enforceDBDecorators<T extends Model, Y extends IRepository<T>, V>(repo: Y, context: Context, model: T, operation: string, prefix: string, oldModel?: T): Promise<void>;
export declare function enforceDBDecorators<M extends Model, Y extends IRepository<M>, V>(repo: Y, context: Context<M>, model: M, operation: string, prefix: string, oldModel?: M): Promise<void>;
/**

@@ -41,0 +41,0 @@ * Specific for DB Decorators

@@ -15,3 +15,3 @@ import { Model } from "@decaf-ts/decorator-validation";

export declare function readonly(message?: string): PropertyDecorator;
export declare function timestampHandler<T extends Model, V extends IRepository<T>, Y = any>(this: V, context: Context, data: Y, key: string, model: T): Promise<void>;
export declare function timestampHandler<M extends Model, V extends IRepository<M>, Y = any>(this: V, context: Context<M>, data: Y, key: string, model: M): Promise<void>;
/**

@@ -18,0 +18,0 @@ * Marks the property as timestamp.

{
"name": "@decaf-ts/db-decorators",
"version": "0.4.1",
"version": "0.4.2",
"description": "Agnostic database decorators and repository",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc