-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,391 additions
and
744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.vscode | ||
/dist | ||
/src | ||
dist/ | ||
src/ | ||
/docs | ||
/preview | ||
/tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
import { BaseEntity } from "./base-entity"; | ||
|
||
|
||
export class BaseAbstractEntity extends BaseEntity { | ||
|
||
id: string; | ||
|
||
version: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
|
||
|
||
export class BaseClass { | ||
inject<T>(ctor: new (...args: any[]) => T): T { | ||
return new Proxy({}, { | ||
get: (_, propName) => { | ||
const res = this[Symbols.ctxInClassOrClassObj] as EndpointContext; | ||
let instance: T = res.inject(ctor); | ||
return typeof instance[propName] === 'function' ? instance[propName].bind(instance) : instance[propName]; | ||
}, | ||
}) as T; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
import { BaseClass } from "./base-class"; | ||
|
||
|
||
export class BaseController extends BaseClass { | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
import { BaseController } from "./base-controller"; | ||
|
||
|
||
export class BaseCrudController extends BaseController { | ||
constructor(__entity: Function) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
import { BaseClass } from "./base-class"; | ||
|
||
|
||
export class BaseEntity extends BaseClass { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
import { BaseClass } from "./base-class"; | ||
|
||
|
||
export class BaseProvider extends BaseClass { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//#region @websql | ||
import { ObjectLiteral, Repository } from "firedev-typeorm/lib"; | ||
//#endregion | ||
import { EndpointContext } from "../endpoint-context"; | ||
import { Symbols } from "../symbols"; | ||
|
||
export class BaseRepository | ||
//#region @websql | ||
<Entity extends ObjectLiteral> | ||
extends Repository<Entity> | ||
//#endregion | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as controller from './base-controller'; | ||
import * as crudController from './base-crud-controller'; | ||
import * as entity from './base-entity'; | ||
import * as abstractEntity from './base-abstract-entity'; | ||
import * as repository from './base-repository'; | ||
import * as provider from './base-provider'; | ||
|
||
export namespace Base { | ||
export import Controller = controller; | ||
export import CrudController = crudController; | ||
export import Entity = entity; | ||
export import AbstractEntity = abstractEntity; | ||
export import Provider = provider; | ||
//#region @websql | ||
export import Repository = repository; | ||
//#endregion | ||
} |
Oops, something went wrong.