@decaf-ts/core 0.0.4 → 0.1.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.
- package/dist/core.bundle.min.js +1 -1
- package/dist/esm/core.bundle.min.esm.js +1 -1
- package/lib/esm/identity/decorators.js +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/interfaces/SequenceOptions.d.ts +2 -1
- package/lib/esm/interfaces/index.d.ts +0 -1
- package/lib/esm/interfaces/index.js +1 -1
- package/lib/esm/model/decorators.d.ts +26 -0
- package/lib/esm/model/decorators.js +1 -0
- package/lib/esm/persistence/Adapter.d.ts +16 -7
- package/lib/esm/persistence/Adapter.js +1 -1
- package/lib/esm/persistence/constants.js +1 -1
- package/lib/esm/persistence/decorators.d.ts +0 -1
- package/lib/esm/persistence/decorators.js +1 -1
- package/lib/esm/persistence/utils.d.ts +2 -0
- package/lib/esm/persistence/utils.js +1 -1
- package/lib/esm/repository/Repository.d.ts +11 -5
- package/lib/esm/repository/Repository.js +1 -1
- package/lib/esm/repository/constants.d.ts +25 -0
- package/lib/esm/repository/constants.js +1 -0
- package/lib/esm/repository/decorators.d.ts +3 -0
- package/lib/esm/repository/decorators.js +1 -0
- package/lib/esm/repository/types.d.ts +12 -0
- package/lib/esm/repository/utils.d.ts +5 -0
- package/lib/esm/repository/utils.js +1 -0
- package/lib/identity/decorators.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/interfaces/SequenceOptions.d.ts +2 -1
- package/lib/interfaces/index.cjs +1 -1
- package/lib/interfaces/index.d.ts +0 -1
- package/lib/model/decorators.cjs +1 -0
- package/lib/model/decorators.d.ts +26 -0
- package/lib/persistence/Adapter.cjs +1 -1
- package/lib/persistence/Adapter.d.ts +16 -7
- package/lib/persistence/constants.cjs +1 -1
- package/lib/persistence/decorators.cjs +1 -1
- package/lib/persistence/decorators.d.ts +0 -1
- package/lib/persistence/utils.cjs +1 -1
- package/lib/persistence/utils.d.ts +2 -0
- package/lib/repository/Repository.cjs +1 -1
- package/lib/repository/Repository.d.ts +11 -5
- package/lib/repository/constants.cjs +1 -0
- package/lib/repository/constants.d.ts +25 -0
- package/lib/repository/decorators.cjs +1 -0
- package/lib/repository/decorators.d.ts +3 -0
- package/lib/repository/types.d.ts +12 -0
- package/lib/repository/utils.cjs +1 -0
- package/lib/repository/utils.d.ts +5 -0
- package/package.json +2 -1
- package/lib/esm/interfaces/IAdapter.d.ts +0 -5
- package/lib/interfaces/IAdapter.d.ts +0 -5
- /package/lib/esm/{interfaces/IAdapter.js → repository/types.js} +0 -0
- /package/lib/{interfaces/IAdapter.cjs → repository/types.cjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./Builder";export*from"./Executor";export*from"./
|
|
1
|
+
export*from"./Builder";export*from"./Executor";export*from"./Observable";export*from"./Observer";export*from"./RawExecutor";export*from"./Sequence";export*from"./SequenceOptions";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DBModel, IRepository } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { OrderDirection } from "../repository/constants";
|
|
3
|
+
export declare function table(tableName: string): import("@decaf-ts/reflection").CustomDecorator<V>;
|
|
4
|
+
export declare function column(columnName: string): import("@decaf-ts/reflection").CustomDecorator<V>;
|
|
5
|
+
/**
|
|
6
|
+
* @summary Index Decorator
|
|
7
|
+
* @description properties decorated will the index in the
|
|
8
|
+
* DB for performance in queries
|
|
9
|
+
*
|
|
10
|
+
* @param {OrderDirection[]} [directions]
|
|
11
|
+
* @param {string[]} [compositions]
|
|
12
|
+
*
|
|
13
|
+
* @function index
|
|
14
|
+
*/
|
|
15
|
+
export declare function index(compositions?: string[], directions?: OrderDirection[]): import("@decaf-ts/reflection").CustomDecorator<V>;
|
|
16
|
+
export declare function uniqueOnCreateUpdate<T extends DBModel, V extends IRepository<T>, Y = any>(this: V, data: Y, key: string, model: T): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* @summary Unique Decorator
|
|
19
|
+
* @description Tags a property as unique.
|
|
20
|
+
* No other elements in that table can have the same property value
|
|
21
|
+
*
|
|
22
|
+
* @function unique
|
|
23
|
+
*
|
|
24
|
+
* @memberOf module:wallet-db.Decorators
|
|
25
|
+
*/
|
|
26
|
+
export declare function unique(): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ConflictError,getDBKey,NotFoundError,onCreateUpdate}from"@decaf-ts/db-decorators";import{apply,metadata}from"@decaf-ts/reflection";import{PersistenceKeys}from"../persistence/constants";import{getPersistenceKey}from"../persistence";function table(e){return metadata(getPersistenceKey(PersistenceKeys.TABLE),e)}function column(e){return metadata(getPersistenceKey(PersistenceKeys.COLUMN),e)}function index(e,t){return metadata(getDBKey(""+PersistenceKeys.INDEX+(e&&e.length?"."+e.join("."):"")),{directions:t,compositions:e})}async function uniqueOnCreateUpdate(e,t,n){if(n[t]){try{await this.read(n[t])}catch(e){if(e instanceof NotFoundError)return}throw new ConflictError(`model already exists with ${t} equal to `+JSON.stringify(n[t],void 0,2))}}function unique(){return apply(onCreateUpdate(uniqueOnCreateUpdate),metadata(getDBKey(PersistenceKeys.UNIQUE),{}))}export{table,column,index,uniqueOnCreateUpdate,unique};
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { DBModel } from "@decaf-ts/db-decorators";
|
|
2
2
|
import { Observer } from "../interfaces/Observer";
|
|
3
|
-
import { IAdapter } from "../interfaces/IAdapter";
|
|
4
3
|
import { Sequence } from "../interfaces/Sequence";
|
|
5
4
|
import { Constructor } from "@decaf-ts/decorator-validation";
|
|
6
5
|
import { SequenceOptions } from "../interfaces/SequenceOptions";
|
|
7
|
-
|
|
6
|
+
import { Observable, RawExecutor } from "../interfaces";
|
|
7
|
+
export declare abstract class Adapter<Y, T = string> implements RawExecutor<T>, Observable {
|
|
8
8
|
private static _current;
|
|
9
|
+
private static _cache;
|
|
9
10
|
private observers;
|
|
11
|
+
private readonly _native;
|
|
12
|
+
get native(): Y;
|
|
13
|
+
constructor(native: Y, flavour: string);
|
|
10
14
|
abstract createIndex(...args: any[]): Promise<any>;
|
|
11
15
|
abstract getSequence<V extends DBModel>(model: V, sequence: Constructor<Sequence>, options?: SequenceOptions): Promise<Sequence>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
prepare<V extends DBModel>(model: V, pk: string | number): Promise<{
|
|
17
|
+
record: Record<string, any>;
|
|
18
|
+
id: string;
|
|
19
|
+
}>;
|
|
20
|
+
revert<V extends DBModel>(obj: Record<string, any>, clazz: string | Constructor<V>, pk: string, id: string | number): Promise<V>;
|
|
21
|
+
abstract create(tableName: string, id: string | number, model: Record<string, any>, ...args: any[]): Promise<Record<string, any>>;
|
|
22
|
+
abstract read(tableName: string, id: string | number, ...args: any[]): Promise<Record<string, any>>;
|
|
23
|
+
abstract update(tableName: string, id: string | number, model: Record<string, any>, ...args: any[]): Promise<Record<string, any>>;
|
|
24
|
+
abstract delete(tableName: string, id: string | number, ...args: any[]): Promise<Record<string, any>>;
|
|
16
25
|
abstract raw<V>(rawInput: T, ...args: any[]): Promise<V>;
|
|
17
26
|
/**
|
|
18
27
|
* @summary Registers an {@link Observer}
|
|
@@ -33,7 +42,7 @@ export declare abstract class Adapter<T = string> implements IAdapter<T> {
|
|
|
33
42
|
* @param {any[]} [args] optional arguments to be passed to the {@link Observer#refresh} method
|
|
34
43
|
*/
|
|
35
44
|
updateObservers(...args: any[]): Promise<void>;
|
|
36
|
-
static get current(): Adapter<any>;
|
|
45
|
+
static get current(): Adapter<any, any>;
|
|
37
46
|
static get(flavour: any): Adapter<any> | undefined;
|
|
38
47
|
static setCurrent(flavour: string): void;
|
|
39
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InternalError,NotFoundError}from"@decaf-ts/db-decorators";import{
|
|
1
|
+
import{InternalError,NotFoundError}from"@decaf-ts/db-decorators";import{ObserverError}from"../repository/errors";import{Model}from"@decaf-ts/decorator-validation";import{getColumnName}from"./utils";class Adapter{static{this._cache={}}get native(){return this._native}constructor(r,e){this.observers=[],this._native=r,Adapter._cache[e]=this}async prepare(s,r){return{record:Object.entries(s).reduce((r,[e,t])=>(r[getColumnName(s,e)]=t,r),{}),id:s[r]}}async revert(t,r,s,e){var o={},e=(o[s]=e,"string"==typeof r?Model.build(o,r):new r(o));return Object.keys(e).reduce((r,e)=>(e!==s&&(r[e]=t[getColumnName(r,e)]),r),e)}observe(r){if(-1!==this.observers.indexOf(r))throw new InternalError("Observer already registered");this.observers.push(r)}unObserve(r){r=this.observers.indexOf(r);if(-1===r)throw new InternalError("Failed to find Observer");this.observers.splice(r,1)}async updateObservers(...t){return new Promise((r,e)=>{Promise.all(this.observers.map(r=>r.refresh(...t))).then(()=>{r()}).catch(r=>e(new ObserverError(r)))})}static get current(){return this._current}static get(r){if(r in this._cache)return this._cache[r];throw new InternalError(`No Adapter registered under ${r}. Did you use the @adapter decorator?`)}static setCurrent(r){var e=this.get(r);if(!e)throw new NotFoundError(`No persistence flavour ${r} registered`);this._current=e}}export{Adapter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let PersistenceKeys={REFLECT:"model.persistence.",ADAPTER:"adapter",INJECTABLE:"decaf-adapter-{0}"};export{PersistenceKeys};
|
|
1
|
+
let PersistenceKeys={REFLECT:"model.persistence.",INDEX:"index",UNIQUE:"unique",ADAPTER:"adapter",INJECTABLE:"decaf-adapter-{0}",TABLE:"table",COLUMN:"column"};export{PersistenceKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{metadata}from"@decaf-ts/reflection";import{PersistenceKeys}from"./constants";function getPersistenceKey(e){return PersistenceKeys.REFLECT+e}function uses(e){return metadata(getPersistenceKey(PersistenceKeys.ADAPTER),e)}export{getPersistenceKey,uses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sf}from"@decaf-ts/decorator-validation";import{PersistenceKeys}from"./constants";function genAdapterInjectableKey(e){return sf(PersistenceKeys.INJECTABLE,e)}export{genAdapterInjectableKey};
|
|
1
|
+
import{sf}from"@decaf-ts/decorator-validation";import{PersistenceKeys}from"./constants";import{getPersistenceKey}from"./decorators";function genAdapterInjectableKey(e){return sf(PersistenceKeys.INJECTABLE,e)}function getColumnName(e,t){e=Reflect.getMetadata(getPersistenceKey(PersistenceKeys.COLUMN),e,t);return e||t}export{genAdapterInjectableKey,getColumnName};
|
|
@@ -2,15 +2,20 @@ import { DBModel, Repository as Rep } from "@decaf-ts/db-decorators";
|
|
|
2
2
|
import { Observable } from "../interfaces/Observable";
|
|
3
3
|
import { Observer } from "../interfaces/Observer";
|
|
4
4
|
import { Adapter } from "../persistence/Adapter";
|
|
5
|
-
|
|
5
|
+
import { Constructor } from "@decaf-ts/decorator-validation";
|
|
6
|
+
export declare class Repository<T extends DBModel, V = any> extends Rep<T> implements Observable {
|
|
6
7
|
private observers;
|
|
7
8
|
private readonly _adapter;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
private _tableName;
|
|
10
|
+
private _pk;
|
|
11
|
+
get adapter(): Adapter<any, V>;
|
|
12
|
+
protected get tableName(): string;
|
|
13
|
+
protected get pk(): string;
|
|
14
|
+
constructor(adapter?: Adapter<any, V>, clazz?: Constructor<T>);
|
|
10
15
|
create(model: T, ...args: any[]): Promise<T>;
|
|
11
|
-
read(
|
|
16
|
+
read(id: string, ...args: any[]): Promise<T>;
|
|
12
17
|
update(model: T, ...args: any[]): Promise<T>;
|
|
13
|
-
delete(
|
|
18
|
+
delete(id: string, ...args: any[]): Promise<T>;
|
|
14
19
|
/**
|
|
15
20
|
* @summary Registers an {@link Observer}
|
|
16
21
|
* @param {Observer} observer
|
|
@@ -30,4 +35,5 @@ export declare abstract class Repository<T extends DBModel> extends Rep<T> imple
|
|
|
30
35
|
* @param {any[]} [args] optional arguments to be passed to the {@link Observer#refresh} method
|
|
31
36
|
*/
|
|
32
37
|
updateObservers(...args: any[]): Promise<void>;
|
|
38
|
+
static forModel<T extends DBModel>(model: Constructor<T>): Repository<T>;
|
|
33
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InternalError,Repository as Rep}from"@decaf-ts/db-decorators";import{ObserverError}from"./errors";class Repository extends Rep{get adapter(){if(this._adapter)return this._adapter;throw new InternalError("No adapter found for this repository. did you use the @uses decorator or pass it in the constructor?")}constructor(){super(),this.observers=[]}async create(r
|
|
1
|
+
import{DBKeys,findPrimaryKey,getDBKey,InternalError,Repository as Rep}from"@decaf-ts/db-decorators";import{ObserverError}from"./errors";import{Adapter}from"../persistence/Adapter";import{getPersistenceKey,PersistenceKeys}from"../persistence";import{getTableName}from"./utils";class Repository extends Rep{get adapter(){if(this._adapter)return this._adapter;throw new InternalError("No adapter found for this repository. did you use the @uses decorator or pass it in the constructor?")}get tableName(){return this._tableName||(this._tableName=getTableName(this.class)),this._tableName}get pk(){return this._pk||(this._pk=findPrimaryKey(new this.class).id),this._pk}constructor(e,r){super(r),this.observers=[],e&&(this._adapter=e)}async create(e,...r){var{record:e,id:t}=await this.adapter.prepare(e,this.pk),e=await this.adapter.create(this.tableName,t,e,...r);return this.adapter.revert(e,this.class,this.pk,t)}async read(e,...r){r=await this.adapter.read(this.tableName,e,...r);return this.adapter.revert(r,this.class,this.pk,e)}async update(e,...r){var{record:e,id:t}=await this.adapter.prepare(e,this.pk),e=await this.adapter.update(this.tableName,t,e,...r);return this.adapter.revert(e,this.class,this.pk,t)}async delete(e,...r){r=await this.adapter.delete(this.tableName,e,...r);return this.adapter.revert(r,this.class,this.pk,e)}observe(e){if(-1!==this.observers.indexOf(e))throw new InternalError("Observer already registered");this.observers.push(e)}unObserve(e){e=this.observers.indexOf(e);if(-1===e)throw new InternalError("Failed to find Observer");this.observers.splice(e,1)}async updateObservers(...t){return new Promise((e,r)=>{Promise.all(this.observers.map(e=>e.refresh(...t))).then(()=>{e()}).catch(e=>r(new ObserverError(e)))})}static forModel(r){var e=Reflect.getMetadata(getDBKey(DBKeys.REPOSITORY),r.constructor);if(!e)throw new InternalError("No registered repository found for model "+r.constructor.name);var t=Reflect.getMetadata(getPersistenceKey(PersistenceKeys.ADAPTER),e.constructor);if(!t)throw new InternalError("No registered persistence adapter found for model "+r.constructor.name);var s=Adapter.get(t);if(!s)throw new InternalError("No registered persistence adapter found flavour "+t);let a;try{a=e(s)}catch(e){throw new InternalError(`Failed to boot repository for ${r.constructor.name} using persistence adapter `+t)}return a}}export{Repository};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CascadeMetadata } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* @summary defines order directions when sorting
|
|
4
|
+
*
|
|
5
|
+
* @constant OrderDirection
|
|
6
|
+
*
|
|
7
|
+
* @category Query
|
|
8
|
+
*/
|
|
9
|
+
export declare enum OrderDirection {
|
|
10
|
+
/**
|
|
11
|
+
* @summary Defines the sort order as ascending
|
|
12
|
+
* @prop ASC
|
|
13
|
+
*/
|
|
14
|
+
ASC = "asc",
|
|
15
|
+
/**
|
|
16
|
+
* @summary Defines the sort order as descending
|
|
17
|
+
* @property {string} DSC
|
|
18
|
+
*/
|
|
19
|
+
DSC = "desc"
|
|
20
|
+
}
|
|
21
|
+
export declare enum Cascade {
|
|
22
|
+
CASCADE = "cascade",
|
|
23
|
+
NONE = "none"
|
|
24
|
+
}
|
|
25
|
+
export declare const DefaultCascade: CascadeMetadata;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var OrderDirection,Cascade;(e=>{e.ASC="asc",e.DSC="desc"})(OrderDirection=OrderDirection||{}),(e=>{e.CASCADE="cascade",e.NONE="none"})(Cascade=Cascade||{});let DefaultCascade={update:Cascade.CASCADE,delete:Cascade.NONE};export{OrderDirection,Cascade,DefaultCascade};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{inject,injectable}from"@decaf-ts/injectable-decorators";import{DBKeys,getDBKey}from"@decaf-ts/db-decorators";import{metadata}from"@decaf-ts/reflection";import{bootRepository}from"./utils";function repository(o,a){return(e,t)=>{var r;return t?(r=bootRepository(o,e),inject(r)(e,t)):(metadata(getDBKey(DBKeys.REPOSITORY),a||e.name)(o),injectable(a||e.name,!0,e=>{Object.defineProperty(e,DBKeys.CLASS,{enumerable:!1,configurable:!1,writable:!1,value:o})})(e))}}export{repository};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Cascade, OrderDirection } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* @summary defines the cascading behaviour
|
|
4
|
+
*/
|
|
5
|
+
export type CascadeMetadata = {
|
|
6
|
+
update: Cascade;
|
|
7
|
+
delete: Cascade;
|
|
8
|
+
};
|
|
9
|
+
export type IndexMetadata = {
|
|
10
|
+
directions?: OrderDirection[2];
|
|
11
|
+
compositions?: string[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DBModel } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { Repository } from "./Repository";
|
|
3
|
+
import { Constructor } from "@decaf-ts/decorator-validation";
|
|
4
|
+
export declare function bootRepository<T extends DBModel>(model: Constructor<T>, original: (...args: any[]) => Repository<T>): string;
|
|
5
|
+
export declare function getTableName<T extends DBModel>(model: T | Constructor<T>): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DBKeys,getDBKey,InternalError}from"@decaf-ts/db-decorators";import{Adapter,getPersistenceKey,PersistenceKeys}from"../persistence";import{Injectables}from"@decaf-ts/injectable-decorators";function bootRepository(e,t){var r=Reflect.getMetadata(getDBKey(DBKeys.REPOSITORY),e);if(!r)throw new InternalError("No Repository defined for model "+e.constructor.name);e=Reflect.getMetadata(getPersistenceKey(PersistenceKeys.ADAPTER),t);if(!e)throw new InternalError("Could not find persistence adapter definition for repository "+t.name);try{var o=Adapter.get(e);Injectables.get(r,o)}catch(e){throw new InternalError(e)}return r}function getTableName(e){var t=Reflect.getMetadata(getPersistenceKey(PersistenceKeys.TABLE),e.constructor);return t||e.constructor.name}export{bootRepository,getTableName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.pkOnCreate=pkOnCreate,exports.pk=pk;let decorator_validation_1=require("@decaf-ts/decorator-validation"),db_decorators_1=require("@decaf-ts/db-decorators"),reflection_1=require("@decaf-ts/reflection");async function pkOnCreate(r,t,
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.pkOnCreate=pkOnCreate,exports.pk=pk;let decorator_validation_1=require("@decaf-ts/decorator-validation"),db_decorators_1=require("@decaf-ts/db-decorators"),reflection_1=require("@decaf-ts/reflection"),decorators_1=require("../model/decorators.cjs");async function pkOnCreate(r,t,o){if(r.sequence){let e;try{e=await this.adapter.getSequence(o,r.sequence,r.options)}catch(e){throw new db_decorators_1.InternalError(`Failed to instantiate Sequence ${r.sequence.name}: `+e)}r=await e.next();Object.defineProperty(o,t,{enumerable:!0,writable:!1,configurable:!0,value:r})}}function pk(e,r){return(0,reflection_1.apply)((0,decorators_1.index)(),(0,decorator_validation_1.required)(),(0,db_decorators_1.readonly)(),(0,reflection_1.metadata)((0,db_decorators_1.getDBKey)(db_decorators_1.DBKeys.ID),{}),(0,db_decorators_1.onCreate)(pkOnCreate,{sequence:e,options:r}))}
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&("get"in i?r.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.VERSION=void 0,__exportStar(require("./identity/index.cjs"),exports),__exportStar(require("./interfaces/index.cjs"),exports),__exportStar(require("./model/index.cjs"),exports),__exportStar(require("./persistence/index.cjs"),exports),__exportStar(require("./repository/index.cjs"),exports),exports.VERSION="0.0
|
|
1
|
+
var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&("get"in i?r.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.VERSION=void 0,__exportStar(require("./identity/index.cjs"),exports),__exportStar(require("./interfaces/index.cjs"),exports),__exportStar(require("./model/index.cjs"),exports),__exportStar(require("./persistence/index.cjs"),exports),__exportStar(require("./repository/index.cjs"),exports),exports.VERSION="0.1.0";
|
package/lib/index.d.ts
CHANGED
package/lib/interfaces/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&("get"in i?r.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./Builder.cjs"),exports),__exportStar(require("./Executor.cjs"),exports),__exportStar(require("./
|
|
1
|
+
var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&("get"in i?r.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}:function(e,r,t,o){e[o=void 0===o?t:o]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./Builder.cjs"),exports),__exportStar(require("./Executor.cjs"),exports),__exportStar(require("./Observable.cjs"),exports),__exportStar(require("./Observer.cjs"),exports),__exportStar(require("./RawExecutor.cjs"),exports),__exportStar(require("./Sequence.cjs"),exports),__exportStar(require("./SequenceOptions.cjs"),exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.table=table,exports.column=column,exports.index=index,exports.uniqueOnCreateUpdate=uniqueOnCreateUpdate,exports.unique=unique;let db_decorators_1=require("@decaf-ts/db-decorators"),reflection_1=require("@decaf-ts/reflection"),constants_1=require("../persistence/constants.cjs"),persistence_1=require("../persistence/index.cjs");function table(e){return(0,reflection_1.metadata)((0,persistence_1.getPersistenceKey)(constants_1.PersistenceKeys.TABLE),e)}function column(e){return(0,reflection_1.metadata)((0,persistence_1.getPersistenceKey)(constants_1.PersistenceKeys.COLUMN),e)}function index(e,t){return(0,reflection_1.metadata)((0,db_decorators_1.getDBKey)(""+constants_1.PersistenceKeys.INDEX+(e&&e.length?"."+e.join("."):"")),{directions:t,compositions:e})}async function uniqueOnCreateUpdate(e,t,n){if(n[t]){try{await this.read(n[t])}catch(e){if(e instanceof db_decorators_1.NotFoundError)return}throw new db_decorators_1.ConflictError(`model already exists with ${t} equal to `+JSON.stringify(n[t],void 0,2))}}function unique(){return(0,reflection_1.apply)((0,db_decorators_1.onCreateUpdate)(uniqueOnCreateUpdate),(0,reflection_1.metadata)((0,db_decorators_1.getDBKey)(constants_1.PersistenceKeys.UNIQUE),{}))}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DBModel, IRepository } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { OrderDirection } from "../repository/constants";
|
|
3
|
+
export declare function table(tableName: string): import("@decaf-ts/reflection").CustomDecorator<V>;
|
|
4
|
+
export declare function column(columnName: string): import("@decaf-ts/reflection").CustomDecorator<V>;
|
|
5
|
+
/**
|
|
6
|
+
* @summary Index Decorator
|
|
7
|
+
* @description properties decorated will the index in the
|
|
8
|
+
* DB for performance in queries
|
|
9
|
+
*
|
|
10
|
+
* @param {OrderDirection[]} [directions]
|
|
11
|
+
* @param {string[]} [compositions]
|
|
12
|
+
*
|
|
13
|
+
* @function index
|
|
14
|
+
*/
|
|
15
|
+
export declare function index(compositions?: string[], directions?: OrderDirection[]): import("@decaf-ts/reflection").CustomDecorator<V>;
|
|
16
|
+
export declare function uniqueOnCreateUpdate<T extends DBModel, V extends IRepository<T>, Y = any>(this: V, data: Y, key: string, model: T): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* @summary Unique Decorator
|
|
19
|
+
* @description Tags a property as unique.
|
|
20
|
+
* No other elements in that table can have the same property value
|
|
21
|
+
*
|
|
22
|
+
* @function unique
|
|
23
|
+
*
|
|
24
|
+
* @memberOf module:wallet-db.Decorators
|
|
25
|
+
*/
|
|
26
|
+
export declare function unique(): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Adapter=void 0;let db_decorators_1=require("@decaf-ts/db-decorators"),
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Adapter=void 0;let db_decorators_1=require("@decaf-ts/db-decorators"),errors_1=require("../repository/errors.cjs"),decorator_validation_1=require("@decaf-ts/decorator-validation"),utils_1=require("./utils.cjs");class Adapter{static{this._cache={}}get native(){return this._native}constructor(e,r){this.observers=[],this._native=e,Adapter._cache[r]=this}async prepare(s,e){return{record:Object.entries(s).reduce((e,[r,t])=>(e[(0,utils_1.getColumnName)(s,r)]=t,e),{}),id:s[e]}}async revert(t,e,s,r){var o={},r=(o[s]=r,"string"==typeof e?decorator_validation_1.Model.build(o,e):new e(o));return Object.keys(r).reduce((e,r)=>(r!==s&&(e[r]=t[(0,utils_1.getColumnName)(e,r)]),e),r)}observe(e){if(-1!==this.observers.indexOf(e))throw new db_decorators_1.InternalError("Observer already registered");this.observers.push(e)}unObserve(e){e=this.observers.indexOf(e);if(-1===e)throw new db_decorators_1.InternalError("Failed to find Observer");this.observers.splice(e,1)}async updateObservers(...t){return new Promise((e,r)=>{Promise.all(this.observers.map(e=>e.refresh(...t))).then(()=>{e()}).catch(e=>r(new errors_1.ObserverError(e)))})}static get current(){return this._current}static get(e){if(e in this._cache)return this._cache[e];throw new db_decorators_1.InternalError(`No Adapter registered under ${e}. Did you use the @adapter decorator?`)}static setCurrent(e){var r=this.get(e);if(!r)throw new db_decorators_1.NotFoundError(`No persistence flavour ${e} registered`);this._current=r}}exports.Adapter=Adapter;
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { DBModel } from "@decaf-ts/db-decorators";
|
|
2
2
|
import { Observer } from "../interfaces/Observer";
|
|
3
|
-
import { IAdapter } from "../interfaces/IAdapter";
|
|
4
3
|
import { Sequence } from "../interfaces/Sequence";
|
|
5
4
|
import { Constructor } from "@decaf-ts/decorator-validation";
|
|
6
5
|
import { SequenceOptions } from "../interfaces/SequenceOptions";
|
|
7
|
-
|
|
6
|
+
import { Observable, RawExecutor } from "../interfaces";
|
|
7
|
+
export declare abstract class Adapter<Y, T = string> implements RawExecutor<T>, Observable {
|
|
8
8
|
private static _current;
|
|
9
|
+
private static _cache;
|
|
9
10
|
private observers;
|
|
11
|
+
private readonly _native;
|
|
12
|
+
get native(): Y;
|
|
13
|
+
constructor(native: Y, flavour: string);
|
|
10
14
|
abstract createIndex(...args: any[]): Promise<any>;
|
|
11
15
|
abstract getSequence<V extends DBModel>(model: V, sequence: Constructor<Sequence>, options?: SequenceOptions): Promise<Sequence>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
prepare<V extends DBModel>(model: V, pk: string | number): Promise<{
|
|
17
|
+
record: Record<string, any>;
|
|
18
|
+
id: string;
|
|
19
|
+
}>;
|
|
20
|
+
revert<V extends DBModel>(obj: Record<string, any>, clazz: string | Constructor<V>, pk: string, id: string | number): Promise<V>;
|
|
21
|
+
abstract create(tableName: string, id: string | number, model: Record<string, any>, ...args: any[]): Promise<Record<string, any>>;
|
|
22
|
+
abstract read(tableName: string, id: string | number, ...args: any[]): Promise<Record<string, any>>;
|
|
23
|
+
abstract update(tableName: string, id: string | number, model: Record<string, any>, ...args: any[]): Promise<Record<string, any>>;
|
|
24
|
+
abstract delete(tableName: string, id: string | number, ...args: any[]): Promise<Record<string, any>>;
|
|
16
25
|
abstract raw<V>(rawInput: T, ...args: any[]): Promise<V>;
|
|
17
26
|
/**
|
|
18
27
|
* @summary Registers an {@link Observer}
|
|
@@ -33,7 +42,7 @@ export declare abstract class Adapter<T = string> implements IAdapter<T> {
|
|
|
33
42
|
* @param {any[]} [args] optional arguments to be passed to the {@link Observer#refresh} method
|
|
34
43
|
*/
|
|
35
44
|
updateObservers(...args: any[]): Promise<void>;
|
|
36
|
-
static get current(): Adapter<any>;
|
|
45
|
+
static get current(): Adapter<any, any>;
|
|
37
46
|
static get(flavour: any): Adapter<any> | undefined;
|
|
38
47
|
static setCurrent(flavour: string): void;
|
|
39
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.PersistenceKeys=void 0,exports.PersistenceKeys={REFLECT:"model.persistence.",ADAPTER:"adapter",INJECTABLE:"decaf-adapter-{0}"};
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.PersistenceKeys=void 0,exports.PersistenceKeys={REFLECT:"model.persistence.",INDEX:"index",UNIQUE:"unique",ADAPTER:"adapter",INJECTABLE:"decaf-adapter-{0}",TABLE:"table",COLUMN:"column"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPersistenceKey=getPersistenceKey,exports.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPersistenceKey=getPersistenceKey,exports.uses=uses;let reflection_1=require("@decaf-ts/reflection"),constants_1=require("./constants.cjs");function getPersistenceKey(e){return constants_1.PersistenceKeys.REFLECT+e}function uses(e){return(0,reflection_1.metadata)(getPersistenceKey(constants_1.PersistenceKeys.ADAPTER),e)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.genAdapterInjectableKey=genAdapterInjectableKey;let decorator_validation_1=require("@decaf-ts/decorator-validation"),constants_1=require("./constants.cjs");function genAdapterInjectableKey(e){return(0,decorator_validation_1.sf)(constants_1.PersistenceKeys.INJECTABLE,e)}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.genAdapterInjectableKey=genAdapterInjectableKey,exports.getColumnName=getColumnName;let decorator_validation_1=require("@decaf-ts/decorator-validation"),constants_1=require("./constants.cjs"),decorators_1=require("./decorators.cjs");function genAdapterInjectableKey(e){return(0,decorator_validation_1.sf)(constants_1.PersistenceKeys.INJECTABLE,e)}function getColumnName(e,t){e=Reflect.getMetadata((0,decorators_1.getPersistenceKey)(constants_1.PersistenceKeys.COLUMN),e,t);return e||t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Repository=void 0;let db_decorators_1=require("@decaf-ts/db-decorators"),errors_1=require("./errors.cjs");class Repository extends db_decorators_1.Repository{get adapter(){if(this._adapter)return this._adapter;throw new db_decorators_1.InternalError("No adapter found for this repository. did you use the @uses decorator or pass it in the constructor?")}constructor(){super(),this.observers=[]}async create(r
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Repository=void 0;let db_decorators_1=require("@decaf-ts/db-decorators"),errors_1=require("./errors.cjs"),Adapter_1=require("../persistence/Adapter.cjs"),persistence_1=require("../persistence/index.cjs"),utils_1=require("./utils.cjs");class Repository extends db_decorators_1.Repository{get adapter(){if(this._adapter)return this._adapter;throw new db_decorators_1.InternalError("No adapter found for this repository. did you use the @uses decorator or pass it in the constructor?")}get tableName(){return this._tableName||(this._tableName=(0,utils_1.getTableName)(this.class)),this._tableName}get pk(){return this._pk||(this._pk=(0,db_decorators_1.findPrimaryKey)(new this.class).id),this._pk}constructor(e,r){super(r),this.observers=[],e&&(this._adapter=e)}async create(e,...r){var{record:e,id:t}=await this.adapter.prepare(e,this.pk),e=await this.adapter.create(this.tableName,t,e,...r);return this.adapter.revert(e,this.class,this.pk,t)}async read(e,...r){r=await this.adapter.read(this.tableName,e,...r);return this.adapter.revert(r,this.class,this.pk,e)}async update(e,...r){var{record:e,id:t}=await this.adapter.prepare(e,this.pk),e=await this.adapter.update(this.tableName,t,e,...r);return this.adapter.revert(e,this.class,this.pk,t)}async delete(e,...r){r=await this.adapter.delete(this.tableName,e,...r);return this.adapter.revert(r,this.class,this.pk,e)}observe(e){if(-1!==this.observers.indexOf(e))throw new db_decorators_1.InternalError("Observer already registered");this.observers.push(e)}unObserve(e){e=this.observers.indexOf(e);if(-1===e)throw new db_decorators_1.InternalError("Failed to find Observer");this.observers.splice(e,1)}async updateObservers(...t){return new Promise((e,r)=>{Promise.all(this.observers.map(e=>e.refresh(...t))).then(()=>{e()}).catch(e=>r(new errors_1.ObserverError(e)))})}static forModel(r){var e=Reflect.getMetadata((0,db_decorators_1.getDBKey)(db_decorators_1.DBKeys.REPOSITORY),r.constructor);if(!e)throw new db_decorators_1.InternalError("No registered repository found for model "+r.constructor.name);var t=Reflect.getMetadata((0,persistence_1.getPersistenceKey)(persistence_1.PersistenceKeys.ADAPTER),e.constructor);if(!t)throw new db_decorators_1.InternalError("No registered persistence adapter found for model "+r.constructor.name);var s=Adapter_1.Adapter.get(t);if(!s)throw new db_decorators_1.InternalError("No registered persistence adapter found flavour "+t);let a;try{a=e(s)}catch(e){throw new db_decorators_1.InternalError(`Failed to boot repository for ${r.constructor.name} using persistence adapter `+t)}return a}}exports.Repository=Repository;
|
|
@@ -2,15 +2,20 @@ import { DBModel, Repository as Rep } from "@decaf-ts/db-decorators";
|
|
|
2
2
|
import { Observable } from "../interfaces/Observable";
|
|
3
3
|
import { Observer } from "../interfaces/Observer";
|
|
4
4
|
import { Adapter } from "../persistence/Adapter";
|
|
5
|
-
|
|
5
|
+
import { Constructor } from "@decaf-ts/decorator-validation";
|
|
6
|
+
export declare class Repository<T extends DBModel, V = any> extends Rep<T> implements Observable {
|
|
6
7
|
private observers;
|
|
7
8
|
private readonly _adapter;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
private _tableName;
|
|
10
|
+
private _pk;
|
|
11
|
+
get adapter(): Adapter<any, V>;
|
|
12
|
+
protected get tableName(): string;
|
|
13
|
+
protected get pk(): string;
|
|
14
|
+
constructor(adapter?: Adapter<any, V>, clazz?: Constructor<T>);
|
|
10
15
|
create(model: T, ...args: any[]): Promise<T>;
|
|
11
|
-
read(
|
|
16
|
+
read(id: string, ...args: any[]): Promise<T>;
|
|
12
17
|
update(model: T, ...args: any[]): Promise<T>;
|
|
13
|
-
delete(
|
|
18
|
+
delete(id: string, ...args: any[]): Promise<T>;
|
|
14
19
|
/**
|
|
15
20
|
* @summary Registers an {@link Observer}
|
|
16
21
|
* @param {Observer} observer
|
|
@@ -30,4 +35,5 @@ export declare abstract class Repository<T extends DBModel> extends Rep<T> imple
|
|
|
30
35
|
* @param {any[]} [args] optional arguments to be passed to the {@link Observer#refresh} method
|
|
31
36
|
*/
|
|
32
37
|
updateObservers(...args: any[]): Promise<void>;
|
|
38
|
+
static forModel<T extends DBModel>(model: Constructor<T>): Repository<T>;
|
|
33
39
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var OrderDirection,Cascade;Object.defineProperty(exports,"__esModule",{value:!0}),exports.DefaultCascade=exports.Cascade=exports.OrderDirection=void 0,(e=>{e.ASC="asc",e.DSC="desc"})(OrderDirection||(exports.OrderDirection=OrderDirection={})),(e=>{e.CASCADE="cascade",e.NONE="none"})(Cascade||(exports.Cascade=Cascade={})),exports.DefaultCascade={update:Cascade.CASCADE,delete:Cascade.NONE};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CascadeMetadata } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* @summary defines order directions when sorting
|
|
4
|
+
*
|
|
5
|
+
* @constant OrderDirection
|
|
6
|
+
*
|
|
7
|
+
* @category Query
|
|
8
|
+
*/
|
|
9
|
+
export declare enum OrderDirection {
|
|
10
|
+
/**
|
|
11
|
+
* @summary Defines the sort order as ascending
|
|
12
|
+
* @prop ASC
|
|
13
|
+
*/
|
|
14
|
+
ASC = "asc",
|
|
15
|
+
/**
|
|
16
|
+
* @summary Defines the sort order as descending
|
|
17
|
+
* @property {string} DSC
|
|
18
|
+
*/
|
|
19
|
+
DSC = "desc"
|
|
20
|
+
}
|
|
21
|
+
export declare enum Cascade {
|
|
22
|
+
CASCADE = "cascade",
|
|
23
|
+
NONE = "none"
|
|
24
|
+
}
|
|
25
|
+
export declare const DefaultCascade: CascadeMetadata;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.repository=repository;let injectable_decorators_1=require("@decaf-ts/injectable-decorators"),db_decorators_1=require("@decaf-ts/db-decorators"),reflection_1=require("@decaf-ts/reflection"),utils_1=require("./utils.cjs");function repository(o,a){return(e,r)=>{var t;return r?(t=(0,utils_1.bootRepository)(o,e),(0,injectable_decorators_1.inject)(t)(e,r)):((0,reflection_1.metadata)((0,db_decorators_1.getDBKey)(db_decorators_1.DBKeys.REPOSITORY),a||e.name)(o),(0,injectable_decorators_1.injectable)(a||e.name,!0,e=>{Object.defineProperty(e,db_decorators_1.DBKeys.CLASS,{enumerable:!1,configurable:!1,writable:!1,value:o})})(e))}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Cascade, OrderDirection } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* @summary defines the cascading behaviour
|
|
4
|
+
*/
|
|
5
|
+
export type CascadeMetadata = {
|
|
6
|
+
update: Cascade;
|
|
7
|
+
delete: Cascade;
|
|
8
|
+
};
|
|
9
|
+
export type IndexMetadata = {
|
|
10
|
+
directions?: OrderDirection[2];
|
|
11
|
+
compositions?: string[];
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.bootRepository=bootRepository,exports.getTableName=getTableName;let db_decorators_1=require("@decaf-ts/db-decorators"),persistence_1=require("../persistence/index.cjs"),injectable_decorators_1=require("@decaf-ts/injectable-decorators");function bootRepository(e,t){var r=Reflect.getMetadata((0,db_decorators_1.getDBKey)(db_decorators_1.DBKeys.REPOSITORY),e);if(!r)throw new db_decorators_1.InternalError("No Repository defined for model "+e.constructor.name);e=Reflect.getMetadata((0,persistence_1.getPersistenceKey)(persistence_1.PersistenceKeys.ADAPTER),t);if(!e)throw new db_decorators_1.InternalError("Could not find persistence adapter definition for repository "+t.name);try{var o=persistence_1.Adapter.get(e);injectable_decorators_1.Injectables.get(r,o)}catch(e){throw new db_decorators_1.InternalError(e)}return r}function getTableName(e){var t=Reflect.getMetadata((0,persistence_1.getPersistenceKey)(persistence_1.PersistenceKeys.TABLE),e.constructor);return t||e.constructor.name}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DBModel } from "@decaf-ts/db-decorators";
|
|
2
|
+
import { Repository } from "./Repository";
|
|
3
|
+
import { Constructor } from "@decaf-ts/decorator-validation";
|
|
4
|
+
export declare function bootRepository<T extends DBModel>(model: Constructor<T>, original: (...args: any[]) => Repository<T>): string;
|
|
5
|
+
export declare function getTableName<T extends DBModel>(model: T | Constructor<T>): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "template for ts projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"homepage": "https://github.com/decaf-ts/ts-workspace#readme",
|
|
66
66
|
"devDependencies": {
|
|
67
|
+
"@decaf-ts/transactional-decorators": "latest",
|
|
67
68
|
"@types/jest": "^29.5.12",
|
|
68
69
|
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
|
69
70
|
"clean-publish": "^4.3.0",
|
|
File without changes
|
|
File without changes
|