@chilibase/backend 0.1.1 → 0.2.0
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/README.md +4 -8
- package/lib/auth/auth.module.d.ts +2 -0
- package/lib/auth/auth.module.js +22 -7
- package/lib/auth/auth.module.js.map +1 -1
- package/lib/auth/jwt.strategy.js +13 -0
- package/lib/auth/jwt.strategy.js.map +1 -1
- package/lib/auth/local-auth.guard.d.ts +4 -0
- package/lib/auth/local-auth.guard.js +15 -0
- package/lib/auth/local-auth.guard.js.map +1 -0
- package/lib/auth/local-auth.service.d.ts +17 -0
- package/lib/auth/local-auth.service.js +65 -0
- package/lib/auth/local-auth.service.js.map +1 -0
- package/lib/auth/local.strategy.d.ts +11 -0
- package/lib/auth/local.strategy.js +33 -0
- package/lib/auth/local.strategy.js.map +1 -0
- package/lib/common/EntityMetadata.d.ts +35 -0
- package/lib/common/EntityMetadata.js +2 -0
- package/lib/common/EntityMetadata.js.map +1 -0
- package/lib/{serverApi → common}/ExportImportParam.d.ts +7 -7
- package/lib/{serverApi → common}/ExportImportParam.js +6 -6
- package/lib/common/ExportImportParam.js.map +1 -0
- package/lib/common/FindParam.d.ts +61 -0
- package/lib/common/FindParam.js +22 -0
- package/lib/common/FindParam.js.map +1 -0
- package/lib/{serverApi → common}/FindResult.d.ts +2 -2
- package/lib/{serverApi → common}/FindResult.js.map +1 -1
- package/lib/common/PrimeFilterSortMeta.js.map +1 -0
- package/lib/{serverApi/XUtilsCommon.d.ts → common/UtilsCommon.d.ts} +13 -11
- package/lib/{serverApi/XUtilsCommon.js → common/UtilsCommon.js} +42 -23
- package/lib/common/UtilsCommon.js.map +1 -0
- package/lib/{serverApi/XUtilsConversions.d.ts → common/UtilsConversions.d.ts} +7 -7
- package/lib/{serverApi/XUtilsConversions.js → common/UtilsConversions.js} +33 -35
- package/lib/common/UtilsConversions.js.map +1 -0
- package/lib/common/UtilsMetadataCommon.d.ts +29 -0
- package/lib/common/UtilsMetadataCommon.js +170 -0
- package/lib/common/UtilsMetadataCommon.js.map +1 -0
- package/lib/common/auth-api.d.ts +14 -0
- package/lib/common/auth-api.js +2 -0
- package/lib/common/auth-api.js.map +1 -0
- package/lib/common/index.d.ts +21 -0
- package/lib/common/index.js +14 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/lib-api.d.ts +36 -0
- package/lib/common/lib-api.js +2 -0
- package/lib/common/lib-api.js.map +1 -0
- package/lib/common/types.d.ts +5 -0
- package/lib/common/types.js +2 -0
- package/lib/common/types.js.map +1 -0
- package/lib/locale/x-en.d.ts +4 -0
- package/lib/locale/x-en.js +7 -0
- package/lib/locale/x-en.js.map +1 -0
- package/lib/modules/administration/browse-meta.entity.d.ts +8 -0
- package/lib/{administration/x-browse-meta.entity.js → modules/administration/browse-meta.entity.js} +11 -11
- package/lib/modules/administration/browse-meta.entity.js.map +1 -0
- package/lib/{administration/x-column-meta.entity.d.ts → modules/administration/column-meta.entity.d.ts} +3 -3
- package/lib/{administration/x-column-meta.entity.js → modules/administration/column-meta.entity.js} +16 -16
- package/lib/modules/administration/column-meta.entity.js.map +1 -0
- package/lib/modules/administration/index.d.ts +8 -0
- package/lib/modules/administration/index.js +8 -0
- package/lib/modules/administration/index.js.map +1 -0
- package/lib/{administration/x-user.entity.d.ts → modules/administration/user.entity.d.ts} +2 -2
- package/lib/{administration/x-user.entity.js → modules/administration/user.entity.js} +17 -17
- package/lib/modules/administration/user.entity.js.map +1 -0
- package/lib/{administration → modules/administration}/x-enum-enum.entity.d.ts +2 -2
- package/lib/{administration → modules/administration}/x-enum-enum.entity.js +5 -5
- package/lib/modules/administration/x-enum-enum.entity.js.map +1 -0
- package/lib/modules/administration/x-enum.entity.js.map +1 -0
- package/lib/{administration → modules/administration}/x-file.entity.d.ts +1 -1
- package/lib/{administration → modules/administration}/x-file.entity.js +2 -2
- package/lib/modules/administration/x-file.entity.js.map +1 -0
- package/lib/{administration → modules/administration}/x-param.entity.d.ts +2 -2
- package/lib/{administration → modules/administration}/x-param.entity.js +5 -5
- package/lib/modules/administration/x-param.entity.js.map +1 -0
- package/lib/services/FindParamRows.d.ts +1 -1
- package/lib/services/XEnvVars.d.ts +1 -0
- package/lib/services/XEnvVars.js +1 -0
- package/lib/services/XEnvVars.js.map +1 -1
- package/lib/services/XLocale.d.ts +5 -0
- package/lib/services/XLocale.js +19 -0
- package/lib/services/XLocale.js.map +1 -0
- package/lib/services/XUtils.d.ts +4 -4
- package/lib/services/XUtils.js +7 -1
- package/lib/services/XUtils.js.map +1 -1
- package/lib/services/x-browse-form-metadata.service.d.ts +2 -2
- package/lib/services/x-browse-form-metadata.service.js +2 -2
- package/lib/services/x-browse-form-metadata.service.js.map +1 -1
- package/lib/services/x-entity-metadata.service.d.ts +7 -7
- package/lib/services/x-entity-metadata.service.js +8 -8
- package/lib/services/x-entity-metadata.service.js.map +1 -1
- package/lib/services/x-export-csv.service.d.ts +2 -2
- package/lib/services/x-export-csv.service.js +8 -8
- package/lib/services/x-export-csv.service.js.map +1 -1
- package/lib/services/x-export-excel.service.d.ts +2 -2
- package/lib/services/x-export-excel.service.js +4 -4
- package/lib/services/x-export-excel.service.js.map +1 -1
- package/lib/services/x-export-json.service.js +5 -5
- package/lib/services/x-export-json.service.js.map +1 -1
- package/lib/services/x-export.service.d.ts +3 -3
- package/lib/services/x-export.service.js +7 -7
- package/lib/services/x-export.service.js.map +1 -1
- package/lib/services/x-file.controller.d.ts +1 -1
- package/lib/services/x-file.controller.js +2 -2
- package/lib/services/x-file.controller.js.map +1 -1
- package/lib/services/x-file.service.d.ts +1 -1
- package/lib/services/x-file.service.js +1 -1
- package/lib/services/x-file.service.js.map +1 -1
- package/lib/services/x-lazy-data-table.service.d.ts +17 -13
- package/lib/services/x-lazy-data-table.service.js +41 -19
- package/lib/services/x-lazy-data-table.service.js.map +1 -1
- package/lib/services/x-lib.controller.d.ts +23 -15
- package/lib/services/x-lib.controller.js +43 -4
- package/lib/services/x-lib.controller.js.map +1 -1
- package/lib/services/x-lib.module.js +2 -1
- package/lib/services/x-lib.module.js.map +1 -1
- package/lib/services/x-lib.service.d.ts +16 -8
- package/lib/services/x-lib.service.js +69 -7
- package/lib/services/x-lib.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/x-query-data/XMainQueryData.d.ts +8 -8
- package/lib/x-query-data/XMainQueryData.js +5 -5
- package/lib/x-query-data/XMainQueryData.js.map +1 -1
- package/lib/x-query-data/XQueryData.d.ts +3 -3
- package/lib/x-query-data/XQueryData.js +27 -11
- package/lib/x-query-data/XQueryData.js.map +1 -1
- package/package.json +15 -16
- package/lib/administration/x-browse-meta.entity.d.ts +0 -8
- package/lib/administration/x-browse-meta.entity.js.map +0 -1
- package/lib/administration/x-column-meta.entity.js.map +0 -1
- package/lib/administration/x-enum-enum.entity.js.map +0 -1
- package/lib/administration/x-enum.entity.js.map +0 -1
- package/lib/administration/x-file.entity.js.map +0 -1
- package/lib/administration/x-param.entity.js.map +0 -1
- package/lib/administration/x-user.entity.js.map +0 -1
- package/lib/serverApi/ExportImportParam.js.map +0 -1
- package/lib/serverApi/FindParam.d.ts +0 -59
- package/lib/serverApi/FindParam.js +0 -20
- package/lib/serverApi/FindParam.js.map +0 -1
- package/lib/serverApi/PrimeFilterSortMeta.js.map +0 -1
- package/lib/serverApi/XBrowseMetadata.d.ts +0 -4
- package/lib/serverApi/XBrowseMetadata.js +0 -2
- package/lib/serverApi/XBrowseMetadata.js.map +0 -1
- package/lib/serverApi/XEntityMetadata.d.ts +0 -35
- package/lib/serverApi/XEntityMetadata.js +0 -2
- package/lib/serverApi/XEntityMetadata.js.map +0 -1
- package/lib/serverApi/XFileJsonField.d.ts +0 -6
- package/lib/serverApi/XFileJsonField.js +0 -2
- package/lib/serverApi/XFileJsonField.js.map +0 -1
- package/lib/serverApi/XPostLoginIfc.d.ts +0 -7
- package/lib/serverApi/XPostLoginIfc.js +0 -2
- package/lib/serverApi/XPostLoginIfc.js.map +0 -1
- package/lib/serverApi/XUser.d.ts +0 -8
- package/lib/serverApi/XUser.js +0 -2
- package/lib/serverApi/XUser.js.map +0 -1
- package/lib/serverApi/XUserAuthenticationIfc.d.ts +0 -9
- package/lib/serverApi/XUserAuthenticationIfc.js +0 -2
- package/lib/serverApi/XUserAuthenticationIfc.js.map +0 -1
- package/lib/serverApi/XUtilsCommon.js.map +0 -1
- package/lib/serverApi/XUtilsConversions.js.map +0 -1
- package/lib/serverApi/XUtilsMetadataCommon.d.ts +0 -29
- package/lib/serverApi/XUtilsMetadataCommon.js +0 -170
- package/lib/serverApi/XUtilsMetadataCommon.js.map +0 -1
- package/lib/serverApi/index.d.ts +0 -2
- package/lib/serverApi/index.js +0 -3
- package/lib/serverApi/index.js.map +0 -1
- package/lib/serverApi/x-lib-api.d.ts +0 -12
- package/lib/serverApi/x-lib-api.js +0 -2
- package/lib/serverApi/x-lib-api.js.map +0 -1
- package/lib/services/FindRowByIdParam.d.ts +0 -5
- package/lib/services/FindRowByIdParam.js +0 -2
- package/lib/services/FindRowByIdParam.js.map +0 -1
- /package/lib/{serverApi → common}/FindResult.js +0 -0
- /package/lib/{serverApi → common}/PrimeFilterSortMeta.d.ts +0 -0
- /package/lib/{serverApi → common}/PrimeFilterSortMeta.js +0 -0
- /package/lib/{administration → modules/administration}/x-enum.entity.d.ts +0 -0
- /package/lib/{administration → modules/administration}/x-enum.entity.js +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
Backend part of the opensource fullstack framework chilibase
|
|
2
|
-
Based on nestjs, typeorm, postgres DB
|
|
3
|
-
<br/>
|
|
4
|
-
Source code:<br/>
|
|
5
|
-
https://github.com/chilibase/chilibase<br/>
|
|
6
|
-
<br/>
|
|
7
|
-
Example of use:<br/>
|
|
8
|
-
https://github.com/chilibase/car-demo<br/>
|
|
1
|
+
Backend part of the opensource fullstack framework chilibase.
|
|
2
|
+
Based on nestjs, typeorm, postgres DB.
|
|
9
3
|
|
|
4
|
+
Source code and documentation:
|
|
5
|
+
https://github.com/chilibase/chilibase
|
package/lib/auth/auth.module.js
CHANGED
|
@@ -4,16 +4,31 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var AuthModule_1;
|
|
7
8
|
import { Module } from "@nestjs/common";
|
|
8
9
|
import { JwtStrategy } from "./jwt.strategy.js";
|
|
9
|
-
|
|
10
|
+
import { JwtModule } from "@nestjs/jwt";
|
|
11
|
+
import { LocalStrategy } from "./local.strategy.js";
|
|
12
|
+
import { LocalAuthService } from "./local-auth.service.js";
|
|
13
|
+
import { XUtils } from "../services/XUtils.js";
|
|
14
|
+
import { XAuth, XEnvVar } from "../services/XEnvVars.js";
|
|
15
|
+
let AuthModule = AuthModule_1 = class AuthModule {
|
|
16
|
+
static forRoot() {
|
|
17
|
+
return {
|
|
18
|
+
imports: [
|
|
19
|
+
JwtModule.register({
|
|
20
|
+
secret: XUtils.getEnvVarValue(XEnvVar.X_AUTH) === XAuth.LOCAL ? XUtils.getEnvVarValue(XEnvVar.X_AUTH_LOCAL_JWT_SECRET) : "dummy",
|
|
21
|
+
signOptions: { expiresIn: '180m' },
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
providers: [JwtStrategy, LocalStrategy, LocalAuthService],
|
|
25
|
+
exports: [LocalAuthService],
|
|
26
|
+
module: AuthModule_1
|
|
27
|
+
};
|
|
28
|
+
}
|
|
10
29
|
};
|
|
11
|
-
AuthModule = __decorate([
|
|
12
|
-
Module({
|
|
13
|
-
imports: [],
|
|
14
|
-
providers: [JwtStrategy],
|
|
15
|
-
exports: [],
|
|
16
|
-
})
|
|
30
|
+
AuthModule = AuthModule_1 = __decorate([
|
|
31
|
+
Module({})
|
|
17
32
|
], AuthModule);
|
|
18
33
|
export { AuthModule };
|
|
19
34
|
//# sourceMappingURL=auth.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAgB,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,yBAAyB,CAAC;AAGhD,IAAM,UAAU,kBAAhB,MAAM,UAAU;IAEnB,MAAM,CAAC,OAAO;QAEV,OAAO;YACH,OAAO,EAAE;gBAEL,SAAS,CAAC,QAAQ,CAAC;oBACf,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,OAAO;oBAChI,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;iBACrC,CAAC;aACL;YACD,SAAS,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,gBAAgB,CAAC;YACzD,OAAO,EAAE,CAAC,gBAAgB,CAAC;YAC3B,MAAM,EAAE,YAAU;SACrB,CAAC;IACN,CAAC;CACJ,CAAA;AAjBY,UAAU;IADtB,MAAM,CAAC,EAAE,CAAC;GACE,UAAU,CAiBtB"}
|
package/lib/auth/jwt.strategy.js
CHANGED
|
@@ -43,6 +43,19 @@ let JwtStrategy = class JwtStrategy extends PassportStrategy(Strategy, 'x-jwt-st
|
|
|
43
43
|
algorithms: ['RS256'],
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
else if (XUtils.getEnvVarValue(XEnvVar.X_AUTH) === XAuth.LOCAL) {
|
|
47
|
+
super({
|
|
48
|
+
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
49
|
+
ignoreExpiration: false,
|
|
50
|
+
secretOrKey: XUtils.getEnvVarValue(XEnvVar.X_AUTH_LOCAL_JWT_SECRET),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else if (XUtils.getEnvVarValue(XEnvVar.X_AUTH) === XAuth.OFF) {
|
|
54
|
+
super({
|
|
55
|
+
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
56
|
+
secretOrKey: "dummy",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
46
59
|
else {
|
|
47
60
|
console.log(`JwtStrategy: authentication not implemented for X_AUTH = ${XUtils.getEnvVarValue(XEnvVar.X_AUTH)}`);
|
|
48
61
|
throw `JwtStrategy: authentication not implemented for X_AUTH = ${XUtils.getEnvVarValue(XEnvVar.X_AUTH)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../src/auth/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,MAAM,EAA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QAErB,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;AA1DY,WAAW;IADvB,UAAU,EAAE;;GACA,WAAW,CA0DvB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from '@nestjs/common';
|
|
8
|
+
import { AuthGuard } from '@nestjs/passport';
|
|
9
|
+
let LocalAuthGuard = class LocalAuthGuard extends AuthGuard('local') {
|
|
10
|
+
};
|
|
11
|
+
LocalAuthGuard = __decorate([
|
|
12
|
+
Injectable()
|
|
13
|
+
], LocalAuthGuard);
|
|
14
|
+
export { LocalAuthGuard };
|
|
15
|
+
//# sourceMappingURL=local-auth.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-auth.guard.js","sourceRoot":"","sources":["../../src/auth/local-auth.guard.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAIpC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,SAAS,CAAC,OAAO,CAAC;CAAG,CAAA;AAA5C,cAAc;IAD1B,UAAU,EAAE;GACA,cAAc,CAA8B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataSource } from "typeorm";
|
|
2
|
+
import { User } from "../modules/administration/user.entity.js";
|
|
3
|
+
import { JwtService } from '@nestjs/jwt';
|
|
4
|
+
import { LocalAuthLoginResponse } from "../common/auth-api.js";
|
|
5
|
+
export declare class LocalAuthService {
|
|
6
|
+
private readonly dataSource;
|
|
7
|
+
private jwtService;
|
|
8
|
+
constructor(dataSource: DataSource, jwtService: JwtService);
|
|
9
|
+
validateUser(username: string, password: string): Promise<User | null>;
|
|
10
|
+
createJwtToken(user: User): Promise<LocalAuthLoginResponse>;
|
|
11
|
+
changePassword(user: User, request: {
|
|
12
|
+
passwordCurrent: string;
|
|
13
|
+
passwordNew: string;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
validatePassword(password: string | null, passwordDB: string | null): Promise<boolean>;
|
|
16
|
+
hashPassword(password: string): Promise<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Injectable } from '@nestjs/common';
|
|
11
|
+
import { DataSource } from "typeorm";
|
|
12
|
+
import { User } from "../modules/administration/user.entity.js";
|
|
13
|
+
import { JwtService } from '@nestjs/jwt';
|
|
14
|
+
import * as bcrypt from "bcrypt";
|
|
15
|
+
let LocalAuthService = class LocalAuthService {
|
|
16
|
+
dataSource;
|
|
17
|
+
jwtService;
|
|
18
|
+
constructor(dataSource, jwtService) {
|
|
19
|
+
this.dataSource = dataSource;
|
|
20
|
+
this.jwtService = jwtService;
|
|
21
|
+
}
|
|
22
|
+
async validateUser(username, password) {
|
|
23
|
+
const repository = this.dataSource.getRepository(User);
|
|
24
|
+
const selectQueryBuilder = repository.createQueryBuilder("xUser");
|
|
25
|
+
selectQueryBuilder.where("xUser.username = :username", { username: username });
|
|
26
|
+
const xUser = await selectQueryBuilder.getOne();
|
|
27
|
+
if (xUser && await this.validatePassword(password, xUser.password)) {
|
|
28
|
+
delete xUser.password;
|
|
29
|
+
return xUser;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
async createJwtToken(user) {
|
|
34
|
+
const payload = { username: user.username, sub: user.id };
|
|
35
|
+
return { accessToken: this.jwtService.sign(payload) };
|
|
36
|
+
}
|
|
37
|
+
async changePassword(user, request) {
|
|
38
|
+
const repository = this.dataSource.getRepository(User);
|
|
39
|
+
const selectQueryBuilder = repository.createQueryBuilder("xUser");
|
|
40
|
+
selectQueryBuilder.where("xUser.username = :username", { username: user.username });
|
|
41
|
+
const xUser = await selectQueryBuilder.getOneOrFail();
|
|
42
|
+
if (!await this.validatePassword(request.passwordCurrent, xUser.password)) {
|
|
43
|
+
throw "Current password invalid.";
|
|
44
|
+
}
|
|
45
|
+
xUser.password = await this.hashPassword(request.passwordNew);
|
|
46
|
+
await repository.save(xUser);
|
|
47
|
+
}
|
|
48
|
+
async validatePassword(password, passwordDB) {
|
|
49
|
+
let valid = false;
|
|
50
|
+
if (password && passwordDB) {
|
|
51
|
+
valid = await bcrypt.compare(password, passwordDB);
|
|
52
|
+
}
|
|
53
|
+
return valid;
|
|
54
|
+
}
|
|
55
|
+
hashPassword(password) {
|
|
56
|
+
return bcrypt.hash(password, 10);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
LocalAuthService = __decorate([
|
|
60
|
+
Injectable(),
|
|
61
|
+
__metadata("design:paramtypes", [DataSource,
|
|
62
|
+
JwtService])
|
|
63
|
+
], LocalAuthService);
|
|
64
|
+
export { LocalAuthService };
|
|
65
|
+
//# sourceMappingURL=local-auth.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-auth.service.js","sourceRoot":"","sources":["../../src/auth/local-auth.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAqB,MAAM,SAAS,CAAC;AACvD,OAAO,EAAC,IAAI,EAAC,MAAM,0CAA0C,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAEvC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAG1B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGJ;IACT;IAFZ,YACqB,UAAsB,EAC/B,UAAsB;QADb,eAAU,GAAV,UAAU,CAAY;QAC/B,eAAU,GAAV,UAAU,CAAY;IAC/B,CAAC;IAEJ,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,QAAgB;QAEjD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,kBAAkB,GAA6B,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC5F,kBAAkB,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC,CAAC,CAAC;QAC7E,MAAM,KAAK,GAAgB,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC7D,IAAI,KAAK,IAAI,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjE,OAAO,KAAK,CAAC,QAAQ,CAAC;YACtB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KA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,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;CACJ,CAAA;AArDY,gBAAgB;IAD5B,UAAU,EAAE;qCAIwB,UAAU;QACnB,UAAU;GAJzB,gBAAgB,CAqD5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Strategy } from 'passport-local';
|
|
2
|
+
import { LocalAuthService } from "./local-auth.service.js";
|
|
3
|
+
declare const LocalStrategy_base: new (...args: [] | [options: import("passport-local").IStrategyOptionsWithRequest] | [options: import("passport-local").IStrategyOptions]) => Strategy & {
|
|
4
|
+
validate(...args: any[]): unknown;
|
|
5
|
+
};
|
|
6
|
+
export declare class LocalStrategy extends LocalStrategy_base {
|
|
7
|
+
private localAuthService;
|
|
8
|
+
constructor(localAuthService: LocalAuthService);
|
|
9
|
+
validate(username: string, password: string): Promise<any>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Strategy } from 'passport-local';
|
|
11
|
+
import { PassportStrategy } from '@nestjs/passport';
|
|
12
|
+
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
|
13
|
+
import { LocalAuthService } from "./local-auth.service.js";
|
|
14
|
+
let LocalStrategy = class LocalStrategy extends PassportStrategy(Strategy) {
|
|
15
|
+
localAuthService;
|
|
16
|
+
constructor(localAuthService) {
|
|
17
|
+
super();
|
|
18
|
+
this.localAuthService = localAuthService;
|
|
19
|
+
}
|
|
20
|
+
async validate(username, password) {
|
|
21
|
+
const user = await this.localAuthService.validateUser(username, password);
|
|
22
|
+
if (!user) {
|
|
23
|
+
throw new UnauthorizedException();
|
|
24
|
+
}
|
|
25
|
+
return user;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
LocalStrategy = __decorate([
|
|
29
|
+
Injectable(),
|
|
30
|
+
__metadata("design:paramtypes", [LocalAuthService])
|
|
31
|
+
], LocalStrategy);
|
|
32
|
+
export { LocalStrategy };
|
|
33
|
+
//# sourceMappingURL=local.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.strategy.js","sourceRoot":"","sources":["../../src/auth/local.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAIlD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,gBAAgB,CAAC,QAAQ,CAAC;IACrC;IAApB,YAAoB,gBAAkC;QAClD,KAAK,EAAE,CAAC;QADQ,qBAAgB,GAAhB,gBAAgB,CAAkB;IAEtD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,QAAgB;QAG7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,MAAM,IAAI,qBAAqB,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAdY,aAAa;IADzB,UAAU,EAAE;qCAE6B,gBAAgB;GAD7C,aAAa,CAczB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface EntityMap {
|
|
2
|
+
[name: string]: Entity;
|
|
3
|
+
}
|
|
4
|
+
export interface Entity {
|
|
5
|
+
name: string;
|
|
6
|
+
idField: string;
|
|
7
|
+
fieldMap: FieldMap;
|
|
8
|
+
assocMap: AssocMap;
|
|
9
|
+
}
|
|
10
|
+
export interface FieldMap {
|
|
11
|
+
[name: string]: Field;
|
|
12
|
+
}
|
|
13
|
+
export interface AssocMap {
|
|
14
|
+
[name: string]: Assoc;
|
|
15
|
+
}
|
|
16
|
+
export interface Field {
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
isNullable: boolean;
|
|
20
|
+
length?: number;
|
|
21
|
+
precision?: number;
|
|
22
|
+
scale?: number;
|
|
23
|
+
width?: number;
|
|
24
|
+
}
|
|
25
|
+
export type RelationType = "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many";
|
|
26
|
+
export interface Assoc {
|
|
27
|
+
relationType: RelationType;
|
|
28
|
+
name: string;
|
|
29
|
+
entityName: string;
|
|
30
|
+
inverseAssocName?: string;
|
|
31
|
+
isCascadeInsert: boolean;
|
|
32
|
+
isCascadeUpdate: boolean;
|
|
33
|
+
isCascadeRemove: boolean;
|
|
34
|
+
isNullable: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityMetadata.js","sourceRoot":"","sources":["../../src/common/EntityMetadata.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTableSortMeta } from "./PrimeFilterSortMeta.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CustomFilterItem, ExtendedDataTableFilterMeta, FullTextSearch } from "./FindParam.js";
|
|
3
3
|
export declare enum ExportType {
|
|
4
4
|
Excel = "excel",
|
|
5
5
|
Csv = "csv",
|
|
@@ -19,20 +19,20 @@ export interface ExportJsonParam {
|
|
|
19
19
|
queryParam: LazyDataTableQueryParam;
|
|
20
20
|
}
|
|
21
21
|
export interface LazyDataTableQueryParam {
|
|
22
|
-
filters:
|
|
23
|
-
fullTextSearch?:
|
|
24
|
-
customFilterItems?:
|
|
22
|
+
filters: ExtendedDataTableFilterMeta;
|
|
23
|
+
fullTextSearch?: FullTextSearch;
|
|
24
|
+
customFilterItems?: CustomFilterItem[];
|
|
25
25
|
multiSortMeta?: DataTableSortMeta[];
|
|
26
26
|
entity: string;
|
|
27
27
|
fields: string[];
|
|
28
28
|
}
|
|
29
29
|
export interface ExcelCsvParam {
|
|
30
30
|
headers?: string[];
|
|
31
|
-
toManyAssocExport:
|
|
32
|
-
multilineTextExport:
|
|
31
|
+
toManyAssocExport: MultilineExportType;
|
|
32
|
+
multilineTextExport: MultilineExportType;
|
|
33
33
|
fieldsToDuplicateValues?: string[];
|
|
34
34
|
}
|
|
35
|
-
export declare enum
|
|
35
|
+
export declare enum MultilineExportType {
|
|
36
36
|
Singleline = "singleline",
|
|
37
37
|
Multiline = "multiline",
|
|
38
38
|
Off = "off"
|
|
@@ -4,12 +4,12 @@ export var ExportType;
|
|
|
4
4
|
ExportType["Csv"] = "csv";
|
|
5
5
|
ExportType["Json"] = "json";
|
|
6
6
|
})(ExportType || (ExportType = {}));
|
|
7
|
-
export var
|
|
8
|
-
(function (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(
|
|
7
|
+
export var MultilineExportType;
|
|
8
|
+
(function (MultilineExportType) {
|
|
9
|
+
MultilineExportType["Singleline"] = "singleline";
|
|
10
|
+
MultilineExportType["Multiline"] = "multiline";
|
|
11
|
+
MultilineExportType["Off"] = "off";
|
|
12
|
+
})(MultilineExportType || (MultilineExportType = {}));
|
|
13
13
|
export var CsvSeparator;
|
|
14
14
|
(function (CsvSeparator) {
|
|
15
15
|
CsvSeparator["Semicolon"] = ";";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportImportParam.js","sourceRoot":"","sources":["../../src/common/ExportImportParam.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,6BAAe,CAAA;IACf,yBAAW,CAAA;IACX,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAoCD,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC3B,gDAAyB,CAAA;IACzB,8CAAuB,CAAA;IACvB,kCAAW,CAAA;AACf,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAWD,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,+BAAe,CAAA;IACf,2BAAW,CAAA;AACf,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAGD,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;AACrB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAKD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,6BAAc,CAAA;IACd,kCAAmB,CAAA;AACvB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAID,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,yBAAW,CAAA;IACX,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DataTableFilterMetaData, DataTableOperatorFilterMetaData, DataTableSortMeta } from "./PrimeFilterSortMeta.js";
|
|
2
|
+
import { Params } from "./UtilsCommon.js";
|
|
3
|
+
export declare enum ResultType {
|
|
4
|
+
OnlyRowCount = 0,
|
|
5
|
+
OnlyPagedRows = 1,
|
|
6
|
+
RowCountAndPagedRows = 2,
|
|
7
|
+
AllRows = 3
|
|
8
|
+
}
|
|
9
|
+
export interface CustomFilterItem {
|
|
10
|
+
where: string;
|
|
11
|
+
params: Params;
|
|
12
|
+
}
|
|
13
|
+
export type CustomFilter = CustomFilterItem | CustomFilterItem[];
|
|
14
|
+
export declare enum ExtendedFilterMatchMode {
|
|
15
|
+
IS_NOT_NULL = "isNotNull",
|
|
16
|
+
IS_NULL = "isNull",
|
|
17
|
+
AUTO_COMPLETE = "xAutoComplete",
|
|
18
|
+
FILTER_ELEMENT = "xFilterElement"
|
|
19
|
+
}
|
|
20
|
+
export interface ExtendedDataTableFilterMetaData extends DataTableFilterMetaData {
|
|
21
|
+
customFilterItems?: CustomFilterItem[];
|
|
22
|
+
}
|
|
23
|
+
export interface ExtendedDataTableFilterMeta {
|
|
24
|
+
[key: string]: ExtendedDataTableFilterMetaData | DataTableOperatorFilterMetaData;
|
|
25
|
+
}
|
|
26
|
+
export interface FullTextSearch {
|
|
27
|
+
fields?: string[];
|
|
28
|
+
value: string;
|
|
29
|
+
splitValue: boolean;
|
|
30
|
+
matchMode: 'startsWith' | 'contains' | 'endsWith' | 'equals';
|
|
31
|
+
}
|
|
32
|
+
export declare enum AggregateFunction {
|
|
33
|
+
Min = "MIN",
|
|
34
|
+
Max = "MAX",
|
|
35
|
+
Sum = "SUM",
|
|
36
|
+
Avg = "AVG"
|
|
37
|
+
}
|
|
38
|
+
export interface SimpleAggregateItem {
|
|
39
|
+
field: string;
|
|
40
|
+
aggregateFunction: AggregateFunction;
|
|
41
|
+
}
|
|
42
|
+
export interface FindParam {
|
|
43
|
+
resultType: ResultType;
|
|
44
|
+
first?: number;
|
|
45
|
+
rows?: number;
|
|
46
|
+
filters?: ExtendedDataTableFilterMeta;
|
|
47
|
+
fullTextSearch?: FullTextSearch;
|
|
48
|
+
customFilterItems?: CustomFilterItem[];
|
|
49
|
+
multiSortMeta?: DataTableSortMeta[];
|
|
50
|
+
entity: string;
|
|
51
|
+
fields?: string[];
|
|
52
|
+
aggregateItems?: SimpleAggregateItem[];
|
|
53
|
+
}
|
|
54
|
+
export interface LazyAutoCompleteSuggestionsRequest {
|
|
55
|
+
maxRows: number;
|
|
56
|
+
fullTextSearch?: FullTextSearch;
|
|
57
|
+
entity: string;
|
|
58
|
+
filterItems?: CustomFilterItem[];
|
|
59
|
+
multiSortMeta?: DataTableSortMeta[];
|
|
60
|
+
fields?: string[];
|
|
61
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var ResultType;
|
|
2
|
+
(function (ResultType) {
|
|
3
|
+
ResultType[ResultType["OnlyRowCount"] = 0] = "OnlyRowCount";
|
|
4
|
+
ResultType[ResultType["OnlyPagedRows"] = 1] = "OnlyPagedRows";
|
|
5
|
+
ResultType[ResultType["RowCountAndPagedRows"] = 2] = "RowCountAndPagedRows";
|
|
6
|
+
ResultType[ResultType["AllRows"] = 3] = "AllRows";
|
|
7
|
+
})(ResultType || (ResultType = {}));
|
|
8
|
+
export var ExtendedFilterMatchMode;
|
|
9
|
+
(function (ExtendedFilterMatchMode) {
|
|
10
|
+
ExtendedFilterMatchMode["IS_NOT_NULL"] = "isNotNull";
|
|
11
|
+
ExtendedFilterMatchMode["IS_NULL"] = "isNull";
|
|
12
|
+
ExtendedFilterMatchMode["AUTO_COMPLETE"] = "xAutoComplete";
|
|
13
|
+
ExtendedFilterMatchMode["FILTER_ELEMENT"] = "xFilterElement";
|
|
14
|
+
})(ExtendedFilterMatchMode || (ExtendedFilterMatchMode = {}));
|
|
15
|
+
export var AggregateFunction;
|
|
16
|
+
(function (AggregateFunction) {
|
|
17
|
+
AggregateFunction["Min"] = "MIN";
|
|
18
|
+
AggregateFunction["Max"] = "MAX";
|
|
19
|
+
AggregateFunction["Sum"] = "SUM";
|
|
20
|
+
AggregateFunction["Avg"] = "AVG";
|
|
21
|
+
})(AggregateFunction || (AggregateFunction = {}));
|
|
22
|
+
//# sourceMappingURL=FindParam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FindParam.js","sourceRoot":"","sources":["../../src/common/FindParam.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,2DAAY,CAAA;IACZ,6DAAa,CAAA;IACb,2EAAoB,CAAA;IACpB,iDAAO,CAAA;AACX,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAYD,MAAM,CAAN,IAAY,uBAKX;AALD,WAAY,uBAAuB;IAC/B,oDAAyB,CAAA;IACzB,6CAAkB,CAAA;IAClB,0DAA+B,CAAA;IAC/B,4DAAiC,CAAA;AACrC,CAAC,EALW,uBAAuB,KAAvB,uBAAuB,QAKlC;AAuBD,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,gCAAW,CAAA;IACX,gCAAW,CAAA;IACX,gCAAW,CAAA;AACf,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FindResult.js","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"FindResult.js","sourceRoot":"","sources":["../../src/common/FindResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimeFilterSortMeta.js","sourceRoot":"","sources":["../../src/common/PrimeFilterSortMeta.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,eAkBX;AAlBD,WAAY,eAAe;IACvB,6CAA0B,CAAA;IAC1B,wCAAqB,CAAA;IACrB,+CAA4B,CAAA;IAC5B,yCAAsB,CAAA;IACtB,oCAAiB,CAAA;IACjB,2CAAwB,CAAA;IACxB,4BAAS,CAAA;IACT,mCAAgB,CAAA;IAChB,gDAA6B,CAAA;IAC7B,sCAAmB,CAAA;IACnB,mDAAgC,CAAA;IAChC,sCAAmB,CAAA;IACnB,qCAAkB,CAAA;IAClB,4CAAyB,CAAA;IACzB,6CAA0B,CAAA;IAC1B,2CAAwB,CAAA;IACxB,oCAAiB,CAAA;AACrB,CAAC,EAlBW,eAAe,KAAf,eAAe,QAkB1B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,6BAAW,CAAA;IACX,2BAAS,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,0CAAS,CAAA;IACT,iDAAY,CAAA;IACZ,uCAAO,CAAA;AACX,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Entity, Field } from "./EntityMetadata.js";
|
|
2
|
+
import { CustomFilter, CustomFilterItem } from "./FindParam.js";
|
|
3
3
|
import { DataTableSortMeta } from "./PrimeFilterSortMeta.js";
|
|
4
|
-
export interface
|
|
4
|
+
export interface Params {
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class UtilsCommon {
|
|
8
8
|
static newLine: string;
|
|
9
9
|
static getValueByPath(object: any, path: string): any;
|
|
10
10
|
static getValueOrValueListByPath(object: any, path: string): any | any[];
|
|
@@ -15,20 +15,22 @@ export declare class XUtilsCommon {
|
|
|
15
15
|
static getPathToAssocAndField(path: string): [string | null, string];
|
|
16
16
|
static isSingleField(path: string): boolean;
|
|
17
17
|
static getPrefixAndField(path: string): [string | null, string];
|
|
18
|
-
static createDisplayValue(object: any, xEntity:
|
|
19
|
-
static createDisplayValueForField(object: any, xEntity:
|
|
20
|
-
static displayValueAsUI(prefix: string | null, value: any, xField:
|
|
18
|
+
static createDisplayValue(object: any, xEntity: Entity | undefined, fields: string[]): string;
|
|
19
|
+
static createDisplayValueForField(object: any, xEntity: Entity | undefined, field: string): string;
|
|
20
|
+
static displayValueAsUI(prefix: string | null, value: any, xField: Field | undefined): string;
|
|
21
21
|
static objectAsJSON(value: any): string;
|
|
22
22
|
static arrayCreateMap<ID, T>(array: T[], idField: string): Map<ID, T>;
|
|
23
23
|
static arrayMoveElement(array: any[], position: number, offset: number): void;
|
|
24
24
|
static arraySort(array: any[], fieldOrValueFunction: string | ((item: any) => any)): any[];
|
|
25
25
|
static arrayIncludes<T>(array: T[], item: T, idField: string): boolean;
|
|
26
26
|
static arrayIntersect<T>(array1: T[], array2: T[], idField: string): T[];
|
|
27
|
-
static
|
|
28
|
-
static
|
|
27
|
+
static numberArraySymmetricDiff(idListA: number[], idListB: number[]): number[];
|
|
28
|
+
static numberArrayUnion(idListA: number[], idListB: number[]): number[];
|
|
29
|
+
static createCustomFilter(filter: string | undefined | null): CustomFilterItem | undefined;
|
|
30
|
+
static createCustomFilterItems(customFilter: CustomFilter | undefined): CustomFilterItem[] | undefined;
|
|
29
31
|
static createMultiSortMeta(sortField: string | DataTableSortMeta[] | undefined): DataTableSortMeta[] | undefined;
|
|
30
|
-
static filterAnd(...filters: (
|
|
31
|
-
static filterIdIn(idField: string, idList: number[]):
|
|
32
|
+
static filterAnd(...filters: (CustomFilter | undefined)[]): CustomFilterItem[] | undefined;
|
|
33
|
+
static filterIdIn(idField: string, idList: number[]): CustomFilter;
|
|
32
34
|
static createPathFieldExp(pathFieldOrPathFieldExp: string): string;
|
|
33
35
|
static isPathField(pathFieldOrPathFieldExp: string): boolean;
|
|
34
36
|
static getDayName(date: Date | null | undefined): string | undefined;
|