@entity-access/server-pages 1.1.494 → 1.1.496
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/AppDbContext.d.ts +7 -0
- package/dist/core/AppDbContext.d.ts.map +1 -0
- package/dist/core/AppDbContext.js +7 -0
- package/dist/core/AppDbContext.js.map +1 -0
- package/dist/core/Wrapped.js +1 -1
- package/dist/core/Wrapped.js.map +1 -1
- package/dist/routes/api/entity/generate/[schema]/[table]/get.d.ts +2 -2
- package/dist/routes/api/entity/generate/[schema]/[table]/get.d.ts.map +1 -1
- package/dist/routes/api/entity/generate/[schema]/[table]/get.js +2 -2
- package/dist/routes/api/entity/generate/[schema]/[table]/get.js.map +1 -1
- package/dist/routes/api/entity/index.d.ts.map +1 -1
- package/dist/routes/api/entity/index.js +2 -2
- package/dist/routes/api/entity/index.js.map +1 -1
- package/dist/routes/api/entity/invoke/[entityName]/[methodName]/post.d.ts +2 -1
- package/dist/routes/api/entity/invoke/[entityName]/[methodName]/post.d.ts.map +1 -1
- package/dist/routes/api/entity/invoke/[entityName]/[methodName]/post.js +2 -2
- package/dist/routes/api/entity/invoke/[entityName]/[methodName]/post.js.map +1 -1
- package/dist/routes/api/entity/model/get.d.ts +2 -2
- package/dist/routes/api/entity/model/get.d.ts.map +1 -1
- package/dist/routes/api/entity/model/get.js +2 -2
- package/dist/routes/api/entity/model/get.js.map +1 -1
- package/dist/routes/api/entity/model.ts/get.d.ts +2 -2
- package/dist/routes/api/entity/model.ts/get.d.ts.map +1 -1
- package/dist/routes/api/entity/model.ts/get.js +2 -2
- package/dist/routes/api/entity/model.ts/get.js.map +1 -1
- package/dist/routes/api/entity/query/[entity]/index.d.ts +2 -1
- package/dist/routes/api/entity/query/[entity]/index.d.ts.map +1 -1
- package/dist/routes/api/entity/query/[entity]/index.js +2 -2
- package/dist/routes/api/entity/query/[entity]/index.js.map +1 -1
- package/dist/routes/api/entity/run/[entity]/[methodName]/index.d.ts +2 -1
- package/dist/routes/api/entity/run/[entity]/[methodName]/index.d.ts.map +1 -1
- package/dist/routes/api/entity/run/[entity]/[methodName]/index.js +2 -2
- package/dist/routes/api/entity/run/[entity]/[methodName]/index.js.map +1 -1
- package/dist/services/EntityAccessServer.d.ts +2 -2
- package/dist/services/EntityAccessServer.d.ts.map +1 -1
- package/dist/services/EntityAccessServer.js.map +1 -1
- package/dist/services/ModelService.d.ts +3 -3
- package/dist/services/ModelService.d.ts.map +1 -1
- package/dist/services/ModelService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core/AppDbContext.ts +10 -0
- package/src/core/Wrapped.ts +1 -1
- package/src/routes/api/entity/generate/[schema]/[table]/get.tsx +3 -3
- package/src/routes/api/entity/index.tsx +2 -2
- package/src/routes/api/entity/invoke/[entityName]/[methodName]/post.tsx +2 -2
- package/src/routes/api/entity/model/get.tsx +2 -2
- package/src/routes/api/entity/model.ts/get.tsx +2 -2
- package/src/routes/api/entity/query/[entity]/index.ts +2 -2
- package/src/routes/api/entity/run/[entity]/[methodName]/index.ts +2 -2
- package/src/services/EntityAccessServer.ts +2 -3
- package/src/services/ModelService.ts +4 -5
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import Inject from "@entity-access/entity-access/dist/di/di.js";
|
|
2
|
-
import EntityContext from "@entity-access/entity-access/dist/model/EntityContext.js";
|
|
3
2
|
import Page from "../../../../../Page.js";
|
|
4
3
|
import EntityAccessServer from "../../../../../services/EntityAccessServer.js";
|
|
5
4
|
import { Prepare } from "../../../../../decorators/Prepare.js";
|
|
6
5
|
import { Route } from "../../../../../core/Route.js";
|
|
7
6
|
import SessionSecurity from "../../../../../services/SessionSecurity.js";
|
|
8
7
|
import EntityAccessError from "@entity-access/entity-access/dist/common/EntityAccessError.js";
|
|
8
|
+
import AppDbContext from "../../../../../core/AppDbContext.js";
|
|
9
9
|
|
|
10
10
|
@Prepare.authorize
|
|
11
11
|
@Prepare.parseJsonBody
|
|
12
12
|
export default class extends Page {
|
|
13
13
|
|
|
14
14
|
@Inject
|
|
15
|
-
|
|
15
|
+
db: AppDbContext;
|
|
16
16
|
|
|
17
17
|
@Route
|
|
18
18
|
entity: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Inject from "@entity-access/entity-access/dist/di/di.js";
|
|
2
|
-
import EntityContext from "@entity-access/entity-access/dist/model/EntityContext.js";
|
|
3
2
|
import Page from "../../../../../../Page.js";
|
|
4
3
|
import { Route } from "../../../../../../core/Route.js";
|
|
5
4
|
import { Prepare } from "../../../../../../decorators/Prepare.js";
|
|
@@ -9,13 +8,14 @@ import ExternalInvoke from "../../../../../../decorators/ExternalInvoke.js";
|
|
|
9
8
|
import JsonService from "../../../../../../services/DbJsonService.js";
|
|
10
9
|
import SessionSecurity from "../../../../../../services/SessionSecurity.js";
|
|
11
10
|
import Content from "../../../../../../Content.js";
|
|
11
|
+
import AppDbContext from "../../../../../../core/AppDbContext.js";
|
|
12
12
|
|
|
13
13
|
@Prepare.authorize
|
|
14
14
|
@Prepare.parseJsonBody
|
|
15
15
|
export default class extends Page {
|
|
16
16
|
|
|
17
17
|
@Inject
|
|
18
|
-
|
|
18
|
+
db: AppDbContext;
|
|
19
19
|
|
|
20
20
|
@Route
|
|
21
21
|
entity: string;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import SchemaRegistry from "@entity-access/entity-access/dist/decorators/SchemaRegistry.js";
|
|
3
|
-
import EntityContext from "@entity-access/entity-access/dist/model/EntityContext.js";
|
|
4
3
|
import { StringHelper } from "./StringHelper.js";
|
|
5
4
|
import ExternalQuery from "../decorators/ExternalQuery.js";
|
|
6
5
|
import EntityAccessError from "@entity-access/entity-access/dist/common/EntityAccessError.js";
|
|
7
6
|
import { FilteredExpression } from "@entity-access/entity-access/dist/model/events/FilteredExpression.js";
|
|
8
7
|
import type { IEntityQuery, IOrderedEntityQuery } from "@entity-access/entity-access/dist/model/IFilterWithParameter.js";
|
|
9
|
-
import { SessionUser } from "../core/SessionUser.js";
|
|
10
8
|
import DbJsonService from "./DbJsonService.js";
|
|
11
9
|
import { ServiceProvider } from "@entity-access/entity-access/dist/di/di.js";
|
|
12
10
|
import SessionSecurity from "./SessionSecurity.js";
|
|
11
|
+
import AppDbContext from "../core/AppDbContext.js";
|
|
13
12
|
|
|
14
13
|
export type IQueryMethod = [string, string, ... any[]];
|
|
15
14
|
|
|
@@ -58,7 +57,7 @@ const allowedMethods = {
|
|
|
58
57
|
export default class EntityAccessServer {
|
|
59
58
|
|
|
60
59
|
public static async query(
|
|
61
|
-
db:
|
|
60
|
+
db: AppDbContext,
|
|
62
61
|
options: IEntityQueryOptions) {
|
|
63
62
|
|
|
64
63
|
db.verifyFilters = true;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { IColumn, IEntityRelation } from "@entity-access/entity-access/dist/decorators/IColumn.js";
|
|
2
|
-
import
|
|
3
|
-
import EntityType, { addColumnSymbol } from "@entity-access/entity-access/dist/entity-query/EntityType.js";
|
|
4
|
-
import EntityContext from "@entity-access/entity-access/dist/model/EntityContext.js";
|
|
2
|
+
import EntityType from "@entity-access/entity-access/dist/entity-query/EntityType.js";
|
|
5
3
|
import IndentedStringWriter from "./IndentedStringWriter.js";
|
|
6
4
|
import DateTime from "@entity-access/entity-access/dist/types/DateTime.js";
|
|
7
5
|
import { IClassOf } from "@entity-access/entity-access/dist/decorators/IClassOf.js";
|
|
8
6
|
import EntityEvents from "@entity-access/entity-access/dist/model/events/EntityEvents.js";
|
|
9
7
|
import ExternalQuery from "../decorators/ExternalQuery.js";
|
|
10
8
|
import ExternalInvoke from "../decorators/ExternalInvoke.js";
|
|
9
|
+
import AppDbContext from "../core/AppDbContext.js";
|
|
11
10
|
|
|
12
11
|
const modelProperties = Symbol("modelProperty");
|
|
13
12
|
|
|
@@ -243,7 +242,7 @@ export default class ModelService {
|
|
|
243
242
|
};
|
|
244
243
|
}
|
|
245
244
|
|
|
246
|
-
public static getModel(context:
|
|
245
|
+
public static getModel(context: AppDbContext) {
|
|
247
246
|
const model = [] as IEntityModel[];
|
|
248
247
|
|
|
249
248
|
for (const [type] of context.model.sources) {
|
|
@@ -253,7 +252,7 @@ export default class ModelService {
|
|
|
253
252
|
return model;
|
|
254
253
|
}
|
|
255
254
|
|
|
256
|
-
public static getModelDeclaration(context:
|
|
255
|
+
public static getModelDeclaration(context: AppDbContext) {
|
|
257
256
|
const writer = new IndentedStringWriter("\t");
|
|
258
257
|
writer.writeLine(`import DateTime from "@web-atoms/date-time/dist/DateTime";
|
|
259
258
|
import type IClrEntity from "@web-atoms/entity/dist/models/IClrEntity";
|