@solidxai/core 0.1.13-beta.8 → 0.1.13
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/CHANGELOG.md +8568 -0
- package/README.md +19 -0
- package/dist/commands/run-tests.command.d.ts +2 -0
- package/dist/commands/run-tests.command.d.ts.map +1 -1
- package/dist/commands/run-tests.command.js +20 -3
- package/dist/commands/run-tests.command.js.map +1 -1
- package/dist/config/cache.options.d.ts.map +1 -1
- package/dist/config/cache.options.js +2 -2
- package/dist/config/cache.options.js.map +1 -1
- package/dist/constants/error-messages.d.ts +7 -0
- package/dist/constants/error-messages.d.ts.map +1 -1
- package/dist/constants/error-messages.js +7 -0
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/constants/media-file-types.d.ts +3 -0
- package/dist/constants/media-file-types.d.ts.map +1 -1
- package/dist/constants/media-file-types.js +47 -8
- package/dist/constants/media-file-types.js.map +1 -1
- package/dist/constants/success-messages.d.ts +3 -0
- package/dist/constants/success-messages.d.ts.map +1 -1
- package/dist/constants/success-messages.js +3 -0
- package/dist/constants/success-messages.js.map +1 -1
- package/dist/controllers/authentication.controller.d.ts +1 -1
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/authentication.controller.js +4 -3
- package/dist/controllers/authentication.controller.js.map +1 -1
- package/dist/controllers/field-metadata.controller.d.ts +2 -2
- package/dist/controllers/mpin-authentication.controller.d.ts +44 -0
- package/dist/controllers/mpin-authentication.controller.d.ts.map +1 -0
- package/dist/controllers/mpin-authentication.controller.js +102 -0
- package/dist/controllers/mpin-authentication.controller.js.map +1 -0
- package/dist/dtos/change-mpin.dto.d.ts +6 -0
- package/dist/dtos/change-mpin.dto.d.ts.map +1 -0
- package/dist/dtos/change-mpin.dto.js +39 -0
- package/dist/dtos/change-mpin.dto.js.map +1 -0
- package/dist/dtos/create-field-metadata.dto.d.ts +3 -6
- package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-field-metadata.dto.js +15 -10
- package/dist/dtos/create-field-metadata.dto.js.map +1 -1
- package/dist/dtos/create-model-sequence.dto.d.ts +1 -1
- package/dist/dtos/create-model-sequence.dto.d.ts.map +1 -1
- package/dist/dtos/create-model-sequence.dto.js +1 -1
- package/dist/dtos/create-model-sequence.dto.js.map +1 -1
- package/dist/dtos/mpin-login.dto.d.ts +5 -0
- package/dist/dtos/mpin-login.dto.d.ts.map +1 -0
- package/dist/dtos/mpin-login.dto.js +33 -0
- package/dist/dtos/mpin-login.dto.js.map +1 -0
- package/dist/dtos/setup-mpin.dto.d.ts +7 -0
- package/dist/dtos/setup-mpin.dto.d.ts.map +1 -0
- package/dist/dtos/setup-mpin.dto.js +47 -0
- package/dist/dtos/setup-mpin.dto.js.map +1 -0
- package/dist/entities/common.entity.d.ts +4 -4
- package/dist/entities/common.entity.d.ts.map +1 -1
- package/dist/entities/common.entity.js +1 -1
- package/dist/entities/common.entity.js.map +1 -1
- package/dist/entities/dashboard-user-layout.entity.js +2 -2
- package/dist/entities/dashboard-user-layout.entity.js.map +1 -1
- package/dist/entities/field-metadata.entity.d.ts +1 -0
- package/dist/entities/field-metadata.entity.d.ts.map +1 -1
- package/dist/entities/field-metadata.entity.js +5 -1
- package/dist/entities/field-metadata.entity.js.map +1 -1
- package/dist/entities/user-device-credential.entity.d.ts +18 -0
- package/dist/entities/user-device-credential.entity.d.ts.map +1 -0
- package/dist/entities/user-device-credential.entity.js +91 -0
- package/dist/entities/user-device-credential.entity.js.map +1 -0
- package/dist/entities/user.entity.js +2 -2
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/view-metadata.entity.js.map +1 -1
- package/dist/entities/workflow-execution-artifact.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution-artifact.entity.js +4 -3
- package/dist/entities/workflow-execution-artifact.entity.js.map +1 -1
- package/dist/entities/workflow-execution-log.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution-log.entity.js +4 -3
- package/dist/entities/workflow-execution-log.entity.js.map +1 -1
- package/dist/entities/workflow-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution.entity.js +3 -2
- package/dist/entities/workflow-execution.entity.js.map +1 -1
- package/dist/entities/workflow-secret.entity.d.ts.map +1 -1
- package/dist/entities/workflow-secret.entity.js +3 -2
- package/dist/entities/workflow-secret.entity.js.map +1 -1
- package/dist/entities/workflow-step-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-step-execution.entity.js +3 -2
- package/dist/entities/workflow-step-execution.entity.js.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.js +6 -5
- package/dist/entities/workflow-trigger-execution.entity.js.map +1 -1
- package/dist/filters/http-exception.filter.d.ts.map +1 -1
- package/dist/filters/http-exception.filter.js +5 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/helpers/bootstrap.helper.d.ts +5 -2
- package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
- package/dist/helpers/bootstrap.helper.js +7 -3
- package/dist/helpers/bootstrap.helper.js.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts +6 -0
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js +54 -27
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js.map +1 -1
- package/dist/helpers/file-download.helper.d.ts.map +1 -1
- package/dist/helpers/file-download.helper.js +6 -1
- package/dist/helpers/file-download.helper.js.map +1 -1
- package/dist/helpers/security.helper.d.ts +5 -1
- package/dist/helpers/security.helper.d.ts.map +1 -1
- package/dist/helpers/security.helper.js +15 -4
- package/dist/helpers/security.helper.js.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.d.ts.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.js +45 -0
- package/dist/helpers/solid-core-error-codes-provider.service.js.map +1 -1
- package/dist/helpers/solid-microservice-adapter.service.d.ts.map +1 -1
- package/dist/helpers/solid-microservice-adapter.service.js +1 -1
- package/dist/helpers/solid-microservice-adapter.service.js.map +1 -1
- package/dist/helpers/typeorm-db-helper.d.ts.map +1 -1
- package/dist/helpers/typeorm-db-helper.js +9 -0
- package/dist/helpers/typeorm-db-helper.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/active-user-data.interface.d.ts +1 -0
- package/dist/interfaces/active-user-data.interface.d.ts.map +1 -1
- package/dist/interfaces/active-user-data.interface.js.map +1 -1
- package/dist/repository/user-device-credential.repository.d.ts +12 -0
- package/dist/repository/user-device-credential.repository.d.ts.map +1 -0
- package/dist/repository/user-device-credential.repository.js +34 -0
- package/dist/repository/user-device-credential.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +7 -3
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +168 -2
- package/dist/services/api-key.service.d.ts.map +1 -1
- package/dist/services/api-key.service.js +1 -1
- package/dist/services/api-key.service.js.map +1 -1
- package/dist/services/authentication.service.d.ts +5 -4
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +50 -19
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +5 -1
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +48 -13
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts +1 -2
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +2 -16
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +2 -1
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/draft-publish-helper.service.d.ts +1 -0
- package/dist/services/draft-publish-helper.service.d.ts.map +1 -1
- package/dist/services/draft-publish-helper.service.js +38 -4
- package/dist/services/draft-publish-helper.service.js.map +1 -1
- package/dist/services/field-metadata.service.d.ts +2 -2
- package/dist/services/field-metadata.service.d.ts.map +1 -1
- package/dist/services/field-metadata.service.js +4 -1
- package/dist/services/field-metadata.service.js.map +1 -1
- package/dist/services/media-storage.utils.d.ts +1 -0
- package/dist/services/media-storage.utils.d.ts.map +1 -1
- package/dist/services/media-storage.utils.js +12 -1
- package/dist/services/media-storage.utils.js.map +1 -1
- package/dist/services/media.service.d.ts.map +1 -1
- package/dist/services/media.service.js +1 -0
- package/dist/services/media.service.js.map +1 -1
- package/dist/services/module-metadata.service.d.ts.map +1 -1
- package/dist/services/module-metadata.service.js +9 -1
- package/dist/services/module-metadata.service.js.map +1 -1
- package/dist/services/mpin.service.d.ts +67 -0
- package/dist/services/mpin.service.d.ts.map +1 -0
- package/dist/services/mpin.service.js +282 -0
- package/dist/services/mpin.service.js.map +1 -0
- package/dist/services/refresh-token-ids-storage.service.d.ts +25 -6
- package/dist/services/refresh-token-ids-storage.service.d.ts.map +1 -1
- package/dist/services/refresh-token-ids-storage.service.js +80 -42
- package/dist/services/refresh-token-ids-storage.service.js.map +1 -1
- package/dist/services/setting.service.d.ts.map +1 -1
- package/dist/services/setting.service.js +6 -1
- package/dist/services/setting.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +206 -10
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +120 -5
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/solid-core.module.d.ts +1 -3
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +14 -39
- package/dist/solid-core.module.js.map +1 -1
- package/dist/testing/reporter/console-reporter.d.ts +3 -0
- package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/console-reporter.js +2 -0
- package/dist/testing/reporter/console-reporter.js.map +1 -1
- package/dist/testing/reporter/progress-reporter.d.ts +64 -0
- package/dist/testing/reporter/progress-reporter.d.ts.map +1 -0
- package/dist/testing/reporter/progress-reporter.js +224 -0
- package/dist/testing/reporter/progress-reporter.js.map +1 -0
- package/dist/testing/reporter/reporter.types.d.ts +3 -0
- package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
- package/dist/testing/reporter/reporter.types.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +1 -0
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/dist/theme/theme-registry.d.ts +14 -0
- package/dist/theme/theme-registry.d.ts.map +1 -0
- package/dist/theme/theme-registry.js +147 -0
- package/dist/theme/theme-registry.js.map +1 -0
- package/package.json +2 -2
- package/src/commands/run-tests.command.ts +17 -3
- package/src/config/cache.options.ts +9 -1
- package/src/constants/error-messages.ts +14 -0
- package/src/constants/media-file-types.ts +87 -9
- package/src/constants/success-messages.ts +5 -0
- package/src/controllers/authentication.controller.ts +5 -2
- package/src/controllers/mpin-authentication.controller.ts +67 -0
- package/src/dtos/change-mpin.dto.ts +18 -0
- package/src/dtos/create-field-metadata.dto.ts +17 -9
- package/src/dtos/create-model-sequence.dto.ts +1 -1
- package/src/dtos/mpin-login.dto.ts +24 -0
- package/src/dtos/setup-mpin.dto.ts +51 -0
- package/src/entities/common.entity.ts +8 -4
- package/src/entities/dashboard-user-layout.entity.ts +2 -2
- package/src/entities/field-metadata.entity.ts +3 -0
- package/src/entities/user-device-credential.entity.ts +130 -0
- package/src/entities/user.entity.ts +2 -2
- package/src/entities/view-metadata.entity.ts +2 -2
- package/src/entities/workflow-execution-artifact.entity.ts +4 -3
- package/src/entities/workflow-execution-log.entity.ts +4 -3
- package/src/entities/workflow-execution.entity.ts +3 -2
- package/src/entities/workflow-secret.entity.ts +3 -2
- package/src/entities/workflow-step-execution.entity.ts +3 -2
- package/src/entities/workflow-trigger-execution.entity.ts +6 -5
- package/src/filters/http-exception.filter.ts +11 -1
- package/src/helpers/bootstrap.helper.ts +43 -6
- package/src/helpers/field-crud-managers/MediaFieldCrudManager.ts +73 -34
- package/src/helpers/file-download.helper.ts +15 -1
- package/src/helpers/security.helper.ts +35 -8
- package/src/helpers/solid-core-error-codes-provider.service.ts +53 -0
- package/src/helpers/solid-microservice-adapter.service.ts +6 -1
- package/src/helpers/typeorm-db-helper.ts +12 -1
- package/src/index.ts +6 -0
- package/src/interfaces/active-user-data.interface.ts +9 -0
- package/src/repository/user-device-credential.repository.ts +17 -0
- package/src/seeders/module-metadata-seeder.service.ts +11 -3
- package/src/seeders/seed-data/solid-core-metadata.json +168 -2
- package/src/services/api-key.service.ts +13 -1
- package/src/services/authentication.service.ts +127 -36
- package/src/services/chatter-message.service.ts +78 -15
- package/src/services/crud-helper.service.ts +19 -16
- package/src/services/crud.service.ts +3 -1
- package/src/services/draft-publish-helper.service.ts +56 -4
- package/src/services/field-metadata.service.ts +5 -2
- package/src/services/media-storage.utils.ts +26 -1
- package/src/services/media.service.ts +1 -0
- package/src/services/module-metadata.service.ts +10 -1
- package/src/services/mpin.service.ts +447 -0
- package/src/services/refresh-token-ids-storage.service.ts +229 -90
- package/src/services/setting.service.ts +8 -1
- package/src/services/settings/default-settings-provider.service.ts +131 -5
- package/src/solid-core.module.ts +26 -12
- package/src/testing/README.md +11 -1
- package/src/testing/reporter/console-reporter.ts +4 -0
- package/src/testing/reporter/progress-reporter.ts +251 -0
- package/src/testing/reporter/reporter.types.ts +3 -0
- package/src/testing/runner/run-from-metadata.ts +1 -0
- package/src/theme/theme-registry.ts +181 -0
- package/CLAUDE.md +0 -26
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MpinLoginDto = void 0;
|
|
13
|
+
const openapi = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class MpinLoginDto {
|
|
16
|
+
static _OPENAPI_METADATA_FACTORY() {
|
|
17
|
+
return { credentialRef: { required: true, type: () => String, maxLength: 128 }, mpin: { required: true, type: () => String, maxLength: 32 } };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.MpinLoginDto = MpinLoginDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.MaxLength)(128),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], MpinLoginDto.prototype, "credentialRef", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.MaxLength)(32),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], MpinLoginDto.prototype, "mpin", void 0);
|
|
33
|
+
//# sourceMappingURL=mpin-login.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpin-login.dto.js","sourceRoot":"","sources":["../../src/dtos/mpin-login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAAkE;AAWlE,MAAa,YAAY;;;;CAYxB;AAZD,oCAYC;AANG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;mDACO;AAKtB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;;0CACD","sourcesContent":["import { IsNotEmpty, IsString, MaxLength } from 'class-validator';\n\n/**\n * Deliberately carries no identifier - no mobile, email or username.\n *\n * `credentialRef` is a server-issued 256-bit handle that already points at a\n * single credential row, and therefore at a single user. That is what removes\n * the user-enumeration surface a public login route would otherwise have: an\n * attacker cannot probe \"does this phone number have MPIN?\" because there is\n * nowhere to put a phone number.\n */\nexport class MpinLoginDto {\n // Bounded so a pathological payload never reaches the regex test or the\n // hash comparison. The handle is always 64 hex characters.\n @IsNotEmpty()\n @IsString()\n @MaxLength(128)\n credentialRef: string;\n\n @IsNotEmpty()\n @IsString()\n @MaxLength(32)\n mpin: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-mpin.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/setup-mpin.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,YAAY;IAOrB,QAAQ,EAAE,MAAM,CAAC;IAsBjB,IAAI,EAAE,MAAM,CAAC;IAYb,UAAU,CAAC,EAAE,MAAM,CAAC;IAMpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SetupMpinDto = void 0;
|
|
13
|
+
const openapi = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class SetupMpinDto {
|
|
16
|
+
static _OPENAPI_METADATA_FACTORY() {
|
|
17
|
+
return { deviceId: { required: true, type: () => String }, mpin: { required: true, type: () => String, maxLength: 32 }, deviceName: { required: false, type: () => String, maxLength: 64, pattern: "/^[\\w\\s.'()-]*$/" }, platform: { required: false, type: () => String, maxLength: 32, pattern: "/^[\\w.-]*$/" } };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SetupMpinDto = SetupMpinDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsUUID)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SetupMpinDto.prototype, "deviceId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.MaxLength)(32),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], SetupMpinDto.prototype, "mpin", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.MaxLength)(64),
|
|
35
|
+
(0, class_validator_1.Matches)(/^[\w\s.'()-]*$/, {
|
|
36
|
+
message: 'deviceName may contain only letters, numbers, spaces and . \' ( ) - _',
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], SetupMpinDto.prototype, "deviceName", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.MaxLength)(32),
|
|
44
|
+
(0, class_validator_1.Matches)(/^[\w.-]*$/, { message: 'platform may contain only letters, numbers and . - _' }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SetupMpinDto.prototype, "platform", void 0);
|
|
47
|
+
//# sourceMappingURL=setup-mpin.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-mpin.dto.js","sourceRoot":"","sources":["../../src/dtos/setup-mpin.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA+F;AAE/F,MAAa,YAAY;;;;CAgDxB;AAhDD,oCAgDC;AAzCG;IADC,IAAA,wBAAM,GAAE;;8CACQ;AAsBjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;;0CACD;AAYb;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,yBAAO,EAAC,gBAAgB,EAAE;QACvB,OAAO,EAAE,uEAAuE;KACnF,CAAC;;gDACkB;AAMpB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,yBAAO,EAAC,WAAW,EAAE,EAAE,OAAO,EAAE,sDAAsD,EAAE,CAAC;;8CACxE","sourcesContent":["import { IsNotEmpty, IsOptional, IsString, IsUUID, Matches, MaxLength } from 'class-validator';\n\nexport class SetupMpinDto {\n /**\n * Stable identifier for the physical device, generated once by the client.\n * Validated as a UUID before it ever reaches a cache key or a bucket name,\n * so it cannot smuggle delimiters into the keyspace.\n */\n @IsUUID()\n deviceId: string;\n\n /**\n * A string, not a number, even though it looks like digits.\n *\n * A numeric MPIN cannot carry a leading zero: JSON forbids leading zeros in\n * number literals, so a client serialising `012345` numerically emits\n * `12345` and the server stores a five-digit MPIN the user never chose -\n * which still satisfies the default `^\\d{4,6}$` and so raises no error.\n * `mpinRegex` is also tenant-configurable and may permit non-digits.\n *\n * Note this cannot be enforced here: the global ValidationPipe runs with\n * `enableImplicitConversion`, so a numeric payload is coerced to a string\n * before @IsString() sees it. Clients must send a quoted JSON string; that\n * requirement is documented in the mobile integration guide.\n *\n * Length and shape are checked server-side against `mpinRegex`, since that\n * setting is the single authority. This only bounds the input.\n */\n @IsNotEmpty()\n @IsString()\n @MaxLength(32)\n mpin: string;\n\n /**\n * Rendered in a device-management list, so it is bounded here rather than\n * trusting every consuming UI to escape it.\n */\n @IsOptional()\n @IsString()\n @MaxLength(64)\n @Matches(/^[\\w\\s.'()-]*$/, {\n message: 'deviceName may contain only letters, numbers, spaces and . \\' ( ) - _',\n })\n deviceName?: string;\n\n @IsOptional()\n @IsString()\n @MaxLength(32)\n @Matches(/^[\\w.-]*$/, { message: 'platform may contain only letters, numbers and . - _' })\n platform?: string;\n}\n"]}
|
|
@@ -5,10 +5,10 @@ export declare abstract class CommonEntity {
|
|
|
5
5
|
deletedAt: Date;
|
|
6
6
|
deletedTracker: string;
|
|
7
7
|
publishedAt: Date;
|
|
8
|
-
isPublished
|
|
9
|
-
isLatest
|
|
10
|
-
initialEntityVersionId
|
|
11
|
-
publishedTracker
|
|
8
|
+
isPublished?: boolean;
|
|
9
|
+
isLatest?: boolean;
|
|
10
|
+
initialEntityVersionId?: number;
|
|
11
|
+
publishedTracker?: string;
|
|
12
12
|
localeName: string;
|
|
13
13
|
defaultEntityLocaleId: number;
|
|
14
14
|
createdBy: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.entity.d.ts","sourceRoot":"","sources":["../../src/entities/common.entity.ts"],"names":[],"mappings":"AAIA,8BACsB,YAAY;IAG9B,EAAE,EAAE,MAAM,CAAA;IAGV,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAGhB,cAAc,EAAE,MAAM,CAAC;IAIvB,WAAW,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"common.entity.d.ts","sourceRoot":"","sources":["../../src/entities/common.entity.ts"],"names":[],"mappings":"AAIA,8BACsB,YAAY;IAG9B,EAAE,EAAE,MAAM,CAAA;IAGV,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAGhB,cAAc,EAAE,MAAM,CAAC;IAIvB,WAAW,EAAE,IAAI,CAAC;IASlB,WAAW,CAAC,EAAE,OAAO,CAAC;IAKtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAKhC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAI1B,UAAU,EAAE,MAAM,CAAC;IAInB,qBAAqB,EAAE,MAAM,CAAC;IAc9B,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -16,7 +16,7 @@ const local_date_time_transformer_1 = require("../transformers/typeorm/local-dat
|
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
17
|
let CommonEntity = class CommonEntity {
|
|
18
18
|
static _OPENAPI_METADATA_FACTORY() {
|
|
19
|
-
return { id: { required: true, type: () => Number }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date }, deletedAt: { required: true, type: () => Date }, deletedTracker: { required: true, type: () => String }, publishedAt: { required: true, type: () => Date }, isPublished: { required:
|
|
19
|
+
return { id: { required: true, type: () => Number }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date }, deletedAt: { required: true, type: () => Date }, deletedTracker: { required: true, type: () => String }, publishedAt: { required: true, type: () => Date }, isPublished: { required: false, type: () => Boolean }, isLatest: { required: false, type: () => Boolean }, initialEntityVersionId: { required: false, type: () => Number }, publishedTracker: { required: false, type: () => String }, localeName: { required: true, type: () => String }, defaultEntityLocaleId: { required: true, type: () => Number }, createdBy: { required: true, type: () => Number }, updatedBy: { required: true, type: () => Number } };
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
exports.CommonEntity = CommonEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.entity.js","sourceRoot":"","sources":["../../src/entities/common.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,qGAAgG;AAChG,qCAAsH;AAG/G,IAAe,YAAY,GAA3B,MAAe,YAAY;;;;
|
|
1
|
+
{"version":3,"file":"common.entity.js","sourceRoot":"","sources":["../../src/entities/common.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,qGAAgG;AAChG,qCAAsH;AAG/G,IAAe,YAAY,GAA3B,MAAe,YAAY;;;;CAuEjC,CAAA;AAvEqB,oCAAY;AAG9B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCAClC;AAGV;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;8BACrE,IAAI;+CAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;8BACrE,IAAI;+CAAC;AAIhB;IAFC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,sDAAwB,EAAE,CAAC;IAC/E,IAAA,eAAK,GAAE;8BACG,IAAI;+C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CAAC;;2DAC3C;AAc9B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAChC;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAChC;uBAtEA,YAAY;IADjC,IAAA,2BAAO,GAAE;GACY,YAAY,CAuEjC","sourcesContent":["import { Exclude, Expose } from \"class-transformer\";\nimport { LocalDateTimeTransformer } from \"src/transformers/typeorm/local-date-time-transformer\";\nimport { Column, CreateDateColumn, DeleteDateColumn, Index, PrimaryGeneratedColumn, UpdateDateColumn } from \"typeorm\";\n\n@Exclude()\nexport abstract class CommonEntity {\n @Expose()\n @PrimaryGeneratedColumn({ type: 'integer' })\n id: number\n\n @CreateDateColumn({ name: \"created_at\", transformer: LocalDateTimeTransformer })\n createdAt: Date;\n\n @UpdateDateColumn({ name: \"updated_at\", transformer: LocalDateTimeTransformer })\n updatedAt: Date;\n\n @DeleteDateColumn({ name: \"deleted_at\", transformer: LocalDateTimeTransformer })\n @Index()\n deletedAt: Date;\n\n @Column({ name: \"deletedTracker\", default: \"not-deleted\" })\n deletedTracker: string;\n\n @Expose()\n @Column({ name: 'published_at', default: null, nullable: true, transformer: LocalDateTimeTransformer })\n publishedAt: Date;\n\n // Optional (not just nullable) because legacy tables (see LegacyCommonEntityWithExistingId)\n // don't carry these versioning columns at all. CRUDService<T extends CommonEntity> is\n // otherwise used for both plain and legacy entities, so these must stay structurally\n // satisfiable by a type that never declares them.\n @Expose()\n @Column({ name: 'is_published', default: false })\n @Index()\n isPublished?: boolean;\n\n @Expose()\n @Column({ name: 'is_latest', default: true })\n @Index()\n isLatest?: boolean;\n\n @Expose()\n @Column({ type: \"int\", name: 'initial_entity_version_id', default: null, nullable: true })\n @Index()\n initialEntityVersionId?: number;\n\n @Expose()\n @Column({ name: 'published_tracker', default: \"na\" })\n @Index()\n publishedTracker?: string;\n\n @Expose()\n @Column({ type: \"varchar\", name: 'locale_name', default: null })\n localeName: string;\n\n @Expose()\n @Column({ type: \"int\", name: 'default_entity_locale_id', default: null })\n defaultEntityLocaleId: number;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // createdBy: User;\n\n // @Expose()\n // @Type( () => require('./user.entity').User?.default ?? require('./user.entity').User )\n // @ManyToOne(() => require('./user.entity').User?.default ?? require('./user.entity').User, { nullable: true })\n // updatedBy: User;\n\n @Expose()\n @Column({ name: `created_by_id`, nullable: true })\n createdBy: number;\n\n @Expose()\n @Column({ name: `updated_by_id`, nullable: true })\n updatedBy: number;\n}\n"]}
|
|
@@ -23,13 +23,13 @@ let DashboardUserLayout = class DashboardUserLayout extends common_entity_1.Comm
|
|
|
23
23
|
exports.DashboardUserLayout = DashboardUserLayout;
|
|
24
24
|
__decorate([
|
|
25
25
|
(0, typeorm_1.Index)(),
|
|
26
|
-
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, {
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { nullable: false }),
|
|
27
27
|
(0, typeorm_1.JoinColumn)(),
|
|
28
28
|
__metadata("design:type", user_entity_1.User)
|
|
29
29
|
], DashboardUserLayout.prototype, "user", void 0);
|
|
30
30
|
__decorate([
|
|
31
31
|
(0, typeorm_1.Index)(),
|
|
32
|
-
(0, typeorm_1.ManyToOne)(() => module_metadata_entity_1.ModuleMetadata, {
|
|
32
|
+
(0, typeorm_1.ManyToOne)(() => module_metadata_entity_1.ModuleMetadata, { nullable: false }),
|
|
33
33
|
(0, typeorm_1.JoinColumn)(),
|
|
34
34
|
__metadata("design:type", module_metadata_entity_1.ModuleMetadata)
|
|
35
35
|
], DashboardUserLayout.prototype, "module", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-user-layout.entity.js","sourceRoot":"","sources":["../../src/entities/dashboard-user-layout.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,+CAAgD;AAChD,qEAAoE;AAG7D,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;;;;CAoBpD,CAAA;AApBY,kDAAmB;AAI5B;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"dashboard-user-layout.entity.js","sourceRoot":"","sources":["../../src/entities/dashboard-user-layout.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,+CAAgD;AAChD,qEAAoE;AAG7D,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;;;;CAoBpD,CAAA;AApBY,kDAAmB;AAI5B;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC1C,IAAA,oBAAU,GAAE;8BACP,kBAAI;iDAAC;AAKX;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACpD,IAAA,oBAAU,GAAE;8BACL,uCAAc;mDAAC;AAIvB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;0DAC9B;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAC3B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAC5B;8BAnBP,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,0BAA0B,CAAC;GACtB,mBAAmB,CAoB/B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, JoinColumn, ManyToOne, Index, Column } from 'typeorm';\nimport { User } from 'src/entities/user.entity';\nimport { ModuleMetadata } from 'src/entities/module-metadata.entity'\n\n@Entity('ss_dashboard_user_layout')\nexport class DashboardUserLayout extends CommonEntity {\n @Index()\n @ManyToOne(() => User, { nullable: false })\n @JoinColumn()\n user: User;\n\n @Index()\n @ManyToOne(() => ModuleMetadata, { nullable: false })\n @JoinColumn()\n module: ModuleMetadata;\n\n @Index()\n @Column({ name: \"dashboard_name\", type: \"varchar\" })\n dashboardName: string;\n\n @Column({ name: \"layout_json\", type: \"text\" })\n layoutJson: string;\n\n @Column({ type: \"integer\", nullable: true })\n version: number;\n}"]}
|
|
@@ -24,6 +24,7 @@ export declare class FieldMetadata extends CommonEntity {
|
|
|
24
24
|
private: boolean;
|
|
25
25
|
mediaTypes: string[];
|
|
26
26
|
mediaMaxSizeKb: number;
|
|
27
|
+
mediaAllowedExtensions: string[];
|
|
27
28
|
mediaStorageProvider: MediaStorageProviderMetadata;
|
|
28
29
|
relationType: string;
|
|
29
30
|
relationCoModelSingularName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-metadata.entity.d.ts","sourceRoot":"","sources":["../../src/entities/field-metadata.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,qBACa,aAAc,SAAQ,YAAY;IAI3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,CAAC;IAGnB,qBAAqB,EAAE,MAAM,CAAC;IAG9B,mBAAmB,EAAE,OAAO,CAAS;IAGrC,aAAa,EAAE,OAAO,CAAC;IAGvB,YAAY,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -23,7 +23,7 @@ let FieldMetadata = class FieldMetadata extends common_entity_1.CommonEntity {
|
|
|
23
23
|
this.enableAuditTracking = false;
|
|
24
24
|
}
|
|
25
25
|
static _OPENAPI_METADATA_FACTORY() {
|
|
26
|
-
return { name: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, type: { required: true, type: () => String }, ormType: { required: true, type: () => String }, model: { required: true, type: () => require("./model-metadata.entity").ModelMetadata }, defaultValue: { required: true, type: () => String }, regexPattern: { required: true, type: () => String }, regexPatternNotMatchingErrorMsg: { required: true, type: () => String }, required: { required: true, type: () => Boolean }, unique: { required: true, type: () => Boolean }, encrypt: { required: true, type: () => Boolean }, encryptionType: { required: true, type: () => String }, decryptWhen: { required: true, type: () => String }, index: { required: true, type: () => Boolean }, length: { required: true, type: () => Number }, max: { required: true, type: () => Number }, min: { required: true, type: () => Number }, private: { required: true, type: () => Boolean }, mediaTypes: { required: true, type: () => [String] }, mediaMaxSizeKb: { required: true, type: () => Number }, mediaStorageProvider: { required: true, type: () => require("./media-storage-provider-metadata.entity").MediaStorageProviderMetadata }, relationType: { required: true, type: () => String }, relationCoModelSingularName: { required: true, type: () => String }, relationCreateInverse: { required: true, type: () => Boolean }, relationCascade: { required: true, type: () => String }, relationModelModuleName: { required: true, type: () => String }, relationCoModelFieldName: { required: true, type: () => String }, isRelationManyToManyOwner: { required: true, type: () => Boolean }, relationFieldFixedFilter: { required: true, type: () => String }, selectionDynamicProvider: { required: true, type: () => String }, selectionDynamicProviderCtxt: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => [String] }, selectionValueType: { required: true, type: () => String, default: "string" }, computedFieldValueProvider: { required: true, type: () => String }, computedFieldValueProviderCtxt: { required: true, type: () => String }, computedFieldValueType: { required: true, type: () => String }, computedFieldTriggerConfig: { required: true, type: () => [require("../dtos/create-field-metadata.dto").ComputedFieldTriggerConfig] }, uuid: { required: true, type: () => String }, isSystem: { required: true, type: () => Boolean }, isMarkedForRemoval: { required: true, type: () => Boolean }, columnName: { required: true, type: () => String }, relationCoModelColumnName: { required: true, type: () => String }, isUserKey: { required: true, type: () => Boolean }, relationJoinTableName: { required: true, type: () => String }, enableAuditTracking: { required: true, type: () => Boolean, default: false }, isMultiSelect: { required: true, type: () => Boolean }, isPrimaryKey: { required: true, type: () => Boolean } };
|
|
26
|
+
return { name: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, type: { required: true, type: () => String }, ormType: { required: true, type: () => String }, model: { required: true, type: () => require("./model-metadata.entity").ModelMetadata }, defaultValue: { required: true, type: () => String }, regexPattern: { required: true, type: () => String }, regexPatternNotMatchingErrorMsg: { required: true, type: () => String }, required: { required: true, type: () => Boolean }, unique: { required: true, type: () => Boolean }, encrypt: { required: true, type: () => Boolean }, encryptionType: { required: true, type: () => String }, decryptWhen: { required: true, type: () => String }, index: { required: true, type: () => Boolean }, length: { required: true, type: () => Number }, max: { required: true, type: () => Number }, min: { required: true, type: () => Number }, private: { required: true, type: () => Boolean }, mediaTypes: { required: true, type: () => [String] }, mediaMaxSizeKb: { required: true, type: () => Number }, mediaAllowedExtensions: { required: true, type: () => [String] }, mediaStorageProvider: { required: true, type: () => require("./media-storage-provider-metadata.entity").MediaStorageProviderMetadata }, relationType: { required: true, type: () => String }, relationCoModelSingularName: { required: true, type: () => String }, relationCreateInverse: { required: true, type: () => Boolean }, relationCascade: { required: true, type: () => String }, relationModelModuleName: { required: true, type: () => String }, relationCoModelFieldName: { required: true, type: () => String }, isRelationManyToManyOwner: { required: true, type: () => Boolean }, relationFieldFixedFilter: { required: true, type: () => String }, selectionDynamicProvider: { required: true, type: () => String }, selectionDynamicProviderCtxt: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => [String] }, selectionValueType: { required: true, type: () => String, default: "string" }, computedFieldValueProvider: { required: true, type: () => String }, computedFieldValueProviderCtxt: { required: true, type: () => String }, computedFieldValueType: { required: true, type: () => String }, computedFieldTriggerConfig: { required: true, type: () => [require("../dtos/create-field-metadata.dto").ComputedFieldTriggerConfig] }, uuid: { required: true, type: () => String }, isSystem: { required: true, type: () => Boolean }, isMarkedForRemoval: { required: true, type: () => Boolean }, columnName: { required: true, type: () => String }, relationCoModelColumnName: { required: true, type: () => String }, isUserKey: { required: true, type: () => Boolean }, relationJoinTableName: { required: true, type: () => String }, enableAuditTracking: { required: true, type: () => Boolean, default: false }, isMultiSelect: { required: true, type: () => Boolean }, isPrimaryKey: { required: true, type: () => Boolean } };
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
exports.FieldMetadata = FieldMetadata;
|
|
@@ -116,6 +116,10 @@ __decorate([
|
|
|
116
116
|
(0, typeorm_1.Column)({ name: 'media_max_size_kb', nullable: true }),
|
|
117
117
|
__metadata("design:type", Number)
|
|
118
118
|
], FieldMetadata.prototype, "mediaMaxSizeKb", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, typeorm_1.Column)({ name: 'media_allowed_extensions', nullable: true, type: "simple-json" }),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], FieldMetadata.prototype, "mediaAllowedExtensions", void 0);
|
|
119
123
|
__decorate([
|
|
120
124
|
(0, typeorm_1.Index)(),
|
|
121
125
|
(0, typeorm_1.ManyToOne)(() => media_storage_provider_metadata_entity_1.MediaStorageProviderMetadata, { onDelete: 'SET NULL' }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-metadata.entity.js","sourceRoot":"","sources":["../../src/entities/field-metadata.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,mDAA0D;AAC1D,qCAAuE;AACvE,qGAAwF;AACxF,mEAAwD;AACxD,gEAA8D;AAGvD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ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E,IAAI,EAAE,CAAC;;gEAChC;AAGlC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDAC7B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DAC/B;AAG9B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0DACrB;AAGrC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;oDAC5B;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDAC7B;wBAlKb,aAAa;IADzB,IAAA,gBAAM,EAAC,mBAAmB,CAAC;GACf,aAAa,CAmKzB","sourcesContent":["import { ComputedFieldTriggerConfig } from \"src/dtos/create-field-metadata.dto\";\nimport { CommonEntity } from \"src/entities/common.entity\";\nimport { Column, Entity, Index, JoinColumn, ManyToOne } from \"typeorm\";\nimport { MediaStorageProviderMetadata } from \"./media-storage-provider-metadata.entity\";\nimport { ModelMetadata } from \"./model-metadata.entity\";\nimport { ERROR_MESSAGES } from \"src/constants/error-messages\";\n\n@Entity(\"ss_field_metadata\")\nexport class FieldMetadata extends CommonEntity {\n\n @Index()\n @Column({ name: \"name\" })\n name: string;\n\n @Index()\n @Column({ name: \"display_name\" })\n displayName: string;\n\n @Column({ name: \"description\", nullable: true, length: 1024 })\n description: string;\n\n /** int, char etc... */\n @Index()\n @Column({ name: 'type' })\n type: string;\n\n @Column({ name: 'orm_type', nullable: true })\n ormType: string;\n\n @Index()\n @ManyToOne(() => ModelMetadata, (model) => model.fields, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'model_id', referencedColumnName: 'id' })\n model: ModelMetadata;\n\n @Column({ name: 'default_value', nullable: true })\n defaultValue: string;\n\n @Column({ name: 'regex_pattern', nullable: true })\n regexPattern: string;\n\n @Column({ name: 'regex_pattern_not_matching_error_msg', nullable: true, default: ERROR_MESSAGES.DEFAULT_REGEX_PATTERN_NOT_MATCHING_ERROR_MSG })\n regexPatternNotMatchingErrorMsg: string;\n\n @Column({ name: \"required\", default: false })\n required: boolean;\n\n @Column({ name: \"unique\", default: false })\n unique: boolean;\n\n @Column({ name: \"encrypt\", default: false })\n encrypt: boolean;\n\n @Column({ name: 'encryption_type', nullable: true })\n encryptionType: string;\n\n @Column({ name: 'decrypt_when', nullable: true })\n decryptWhen: string;\n\n @Column({ name: \"index\", default: false })\n index: boolean;\n\n @Column({ name: 'length', nullable: true })\n length: number;\n\n @Column({ name: 'max', nullable: true })\n max: number;\n\n @Column({ name: 'min', nullable: true })\n min: number;\n\n @Column({ name: \"private\", default: false })\n private: boolean;\n\n @Column({ name: 'media_types', nullable: true, type: \"simple-json\" })\n mediaTypes: string[];\n\n @Column({ name: 'media_max_size_kb', nullable: true })\n mediaMaxSizeKb: number;\n\n @Index()\n @ManyToOne(() => MediaStorageProviderMetadata, { onDelete: 'SET NULL' })\n @JoinColumn({ name: 'media_storage_provider_id' })\n mediaStorageProvider: MediaStorageProviderMetadata;\n\n // @Column({ name: 'media_embedded', default: true })\n // mediaEmbedded: boolean;\n\n @Column({ name: 'relation_type', nullable: true })\n relationType: string;\n\n @Column({ name: 'relation_model_singular_name', nullable: true })\n relationCoModelSingularName: string;\n\n @Column({ name: \"relation_create_inverse\", default: false })\n relationCreateInverse: boolean;\n\n @Column({ name: \"relation_cascade\", nullable: true })\n relationCascade: string;\n\n @Column({ name: 'relation_model_module_name', nullable: true })\n relationModelModuleName: string;\n\n // This field will be used to set the inverse field name in the related model e.g required for many to many relation\n @Column({ name: 'relation_model_field_name', nullable: true })\n relationCoModelFieldName: string;\n\n @Column({ name: 'is_relation_many_to_many_owner', nullable: true })\n isRelationManyToManyOwner: boolean;\n\n // We can store a filter json like this {\"fieldName\": ${someVarWhichWillComeFromParentModel... or can be hard coded...}}\n // {\"type\": \"INDUSTRY\"} .... Eg. static fixedFilter \n // {\"country_id\", \"${country}\"} ... Eg. dynamic fixedFilter \n @Column({ name: 'relation_field_fixed_filter', nullable: true })\n relationFieldFixedFilter: string;\n\n @Column({ name: 'selection_dynamic_provider', nullable: true })\n selectionDynamicProvider: string;\n\n @Column({ name: 'selection_dynamic_provider_ctxt', nullable: true })\n selectionDynamicProviderCtxt: string;\n\n @Column({ name: 'selection_static_values', nullable: true, type: 'simple-array' })\n selectionStaticValues: string[];\n\n @Column({ name: 'selection_value_type', nullable: true, default: 'string' })\n selectionValueType: string = 'string';\n\n // @Column({ name: \"computed\", default: false })\n // computed: boolean;\n\n @Column({ name: 'computed_field_value_provider', nullable: true })\n computedFieldValueProvider: string;\n\n @Column({ name: 'computed_field_value_provider_ctxt', nullable: true })\n computedFieldValueProviderCtxt: string;\n\n @Column({ name: 'computed_field_value_type', nullable: true })\n computedFieldValueType: string;\n\n @Column({ name: 'computed_field_trigger_config', nullable: true, type: 'simple-json' })\n computedFieldTriggerConfig: ComputedFieldTriggerConfig[];\n\n @Column({ name: 'uuid', nullable: true })\n uuid: string;\n\n @Column({ default: false })\n isSystem: boolean;\n\n @Column({ default: false })\n isMarkedForRemoval: boolean;\n\n @Column({ name: 'column_name', nullable: true })\n columnName: string;\n\n @Column({ name: 'relation_co_model_column_name', nullable: true })\n relationCoModelColumnName: string;\n\n @Column({ name: \"is_user_key\", default: false })\n isUserKey: boolean;\n\n @Column({ name: 'relation_join_table_name', nullable: true })\n relationJoinTableName: string;\n\n @Column({ name: 'enable_audit_tracking', default: false })\n enableAuditTracking: boolean = false;\n\n @Column({ name: \"is_multiSelect\", default: false })\n isMultiSelect: boolean;\n\n @Column({ name: \"is_primary_key\", default: false })\n isPrimaryKey: boolean;\n}"]}
|
|
1
|
+
{"version":3,"file":"field-metadata.entity.js","sourceRoot":"","sources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C,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACT;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;yDACC;AAG5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC7B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,+BAA+B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gEAChC;AAGlC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDAC7B;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DAC/B;AAG9B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0DACrB;AAGrC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;oDAC5B;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDAC7B;wBArKb,aAAa;IADzB,IAAA,gBAAM,EAAC,mBAAmB,CAAC;GACf,aAAa,CAsKzB","sourcesContent":["import { ComputedFieldTriggerConfig } from \"src/dtos/create-field-metadata.dto\";\nimport { CommonEntity } from \"src/entities/common.entity\";\nimport { Column, Entity, Index, JoinColumn, ManyToOne } from \"typeorm\";\nimport { MediaStorageProviderMetadata } from \"./media-storage-provider-metadata.entity\";\nimport { ModelMetadata } from \"./model-metadata.entity\";\nimport { ERROR_MESSAGES } from \"src/constants/error-messages\";\n\n@Entity(\"ss_field_metadata\")\nexport class FieldMetadata extends CommonEntity {\n\n @Index()\n @Column({ name: \"name\" })\n name: string;\n\n @Index()\n @Column({ name: \"display_name\" })\n displayName: string;\n\n @Column({ name: \"description\", nullable: true, length: 1024 })\n description: string;\n\n /** int, char etc... */\n @Index()\n @Column({ name: 'type' })\n type: string;\n\n @Column({ name: 'orm_type', nullable: true })\n ormType: string;\n\n @Index()\n @ManyToOne(() => ModelMetadata, (model) => model.fields, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'model_id', referencedColumnName: 'id' })\n model: ModelMetadata;\n\n @Column({ name: 'default_value', nullable: true })\n defaultValue: string;\n\n @Column({ name: 'regex_pattern', nullable: true })\n regexPattern: string;\n\n @Column({ name: 'regex_pattern_not_matching_error_msg', nullable: true, default: ERROR_MESSAGES.DEFAULT_REGEX_PATTERN_NOT_MATCHING_ERROR_MSG })\n regexPatternNotMatchingErrorMsg: string;\n\n @Column({ name: \"required\", default: false })\n required: boolean;\n\n @Column({ name: \"unique\", default: false })\n unique: boolean;\n\n @Column({ name: \"encrypt\", default: false })\n encrypt: boolean;\n\n @Column({ name: 'encryption_type', nullable: true })\n encryptionType: string;\n\n @Column({ name: 'decrypt_when', nullable: true })\n decryptWhen: string;\n\n @Column({ name: \"index\", default: false })\n index: boolean;\n\n @Column({ name: 'length', nullable: true })\n length: number;\n\n @Column({ name: 'max', nullable: true })\n max: number;\n\n @Column({ name: 'min', nullable: true })\n min: number;\n\n @Column({ name: \"private\", default: false })\n private: boolean;\n\n @Column({ name: 'media_types', nullable: true, type: \"simple-json\" })\n mediaTypes: string[];\n\n @Column({ name: 'media_max_size_kb', nullable: true })\n mediaMaxSizeKb: number;\n\n @Column({ name: 'media_allowed_extensions', nullable: true, type: \"simple-json\" })\n mediaAllowedExtensions: string[];\n\n @Index()\n @ManyToOne(() => MediaStorageProviderMetadata, { onDelete: 'SET NULL' })\n @JoinColumn({ name: 'media_storage_provider_id' })\n mediaStorageProvider: MediaStorageProviderMetadata;\n\n // @Column({ name: 'media_embedded', default: true })\n // mediaEmbedded: boolean;\n\n @Column({ name: 'relation_type', nullable: true })\n relationType: string;\n\n @Column({ name: 'relation_model_singular_name', nullable: true })\n relationCoModelSingularName: string;\n\n @Column({ name: \"relation_create_inverse\", default: false })\n relationCreateInverse: boolean;\n\n @Column({ name: \"relation_cascade\", nullable: true })\n relationCascade: string;\n\n @Column({ name: 'relation_model_module_name', nullable: true })\n relationModelModuleName: string;\n\n // This field will be used to set the inverse field name in the related model e.g required for many to many relation\n @Column({ name: 'relation_model_field_name', nullable: true })\n relationCoModelFieldName: string;\n\n @Column({ name: 'is_relation_many_to_many_owner', nullable: true })\n isRelationManyToManyOwner: boolean;\n\n // We can store a filter json like this {\"fieldName\": ${someVarWhichWillComeFromParentModel... or can be hard coded...}}\n // {\"type\": \"INDUSTRY\"} .... Eg. static fixedFilter \n // {\"country_id\", \"${country}\"} ... Eg. dynamic fixedFilter \n @Column({ name: 'relation_field_fixed_filter', nullable: true })\n relationFieldFixedFilter: string;\n\n @Column({ name: 'selection_dynamic_provider', nullable: true })\n selectionDynamicProvider: string;\n\n @Column({ name: 'selection_dynamic_provider_ctxt', nullable: true })\n selectionDynamicProviderCtxt: string;\n\n @Column({ name: 'selection_static_values', nullable: true, type: 'simple-array' })\n selectionStaticValues: string[];\n\n @Column({ name: 'selection_value_type', nullable: true, default: 'string' })\n selectionValueType: string = 'string';\n\n // @Column({ name: \"computed\", default: false })\n // computed: boolean;\n\n @Column({ name: 'computed_field_value_provider', nullable: true })\n computedFieldValueProvider: string;\n\n @Column({ name: 'computed_field_value_provider_ctxt', nullable: true })\n computedFieldValueProviderCtxt: string;\n\n @Column({ name: 'computed_field_value_type', nullable: true })\n computedFieldValueType: string;\n\n @Column({ name: 'computed_field_trigger_config', nullable: true, type: 'simple-json' })\n computedFieldTriggerConfig: ComputedFieldTriggerConfig[];\n\n @Column({ name: 'uuid', nullable: true })\n uuid: string;\n\n @Column({ default: false })\n isSystem: boolean;\n\n @Column({ default: false })\n isMarkedForRemoval: boolean;\n\n @Column({ name: 'column_name', nullable: true })\n columnName: string;\n\n @Column({ name: 'relation_co_model_column_name', nullable: true })\n relationCoModelColumnName: string;\n\n @Column({ name: \"is_user_key\", default: false })\n isUserKey: boolean;\n\n @Column({ name: 'relation_join_table_name', nullable: true })\n relationJoinTableName: string;\n\n @Column({ name: 'enable_audit_tracking', default: false })\n enableAuditTracking: boolean = false;\n\n @Column({ name: \"is_multiSelect\", default: false })\n isMultiSelect: boolean;\n\n @Column({ name: \"is_primary_key\", default: false })\n isPrimaryKey: boolean;\n}"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CommonEntity } from "../entities/common.entity";
|
|
2
|
+
import { User } from "./user.entity";
|
|
3
|
+
export declare class UserDeviceCredential extends CommonEntity {
|
|
4
|
+
hashedCredentialRef: string;
|
|
5
|
+
hashedMpin: string;
|
|
6
|
+
mpinScheme: string;
|
|
7
|
+
mpinSchemeVersion: number;
|
|
8
|
+
deviceId: string;
|
|
9
|
+
credentialKey: string;
|
|
10
|
+
deviceName: string;
|
|
11
|
+
platform: string;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
failedAttempts: number;
|
|
14
|
+
lockedUntil: Date;
|
|
15
|
+
lastUsedAt: Date;
|
|
16
|
+
user: User;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=user-device-credential.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-device-credential.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user-device-credential.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAUrC,qBAKa,oBAAqB,SAAQ,YAAY;IASlD,mBAAmB,EAAE,MAAM,CAAC;IAM5B,UAAU,EAAE,MAAM,CAAC;IAKnB,UAAU,EAAE,MAAM,CAAC;IAoBnB,iBAAiB,EAAE,MAAM,CAAC;IAO1B,QAAQ,EAAE,MAAM,CAAC;IAqBjB,aAAa,EAAE,MAAM,CAAC;IAItB,UAAU,EAAE,MAAM,CAAC;IAInB,QAAQ,EAAE,MAAM,CAAC;IAOjB,QAAQ,EAAE,OAAO,CAAC;IAOlB,cAAc,EAAE,MAAM,CAAC;IAIvB,WAAW,EAAE,IAAI,CAAC;IAIlB,UAAU,EAAE,IAAI,CAAC;IAYjB,IAAI,EAAE,IAAI,CAAC;CACd"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UserDeviceCredential = void 0;
|
|
13
|
+
const openapi = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const common_entity_1 = require("./common.entity");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const user_entity_1 = require("./user.entity");
|
|
18
|
+
let UserDeviceCredential = class UserDeviceCredential extends common_entity_1.CommonEntity {
|
|
19
|
+
static _OPENAPI_METADATA_FACTORY() {
|
|
20
|
+
return { hashedCredentialRef: { required: true, type: () => String }, hashedMpin: { required: true, type: () => String }, mpinScheme: { required: true, type: () => String }, mpinSchemeVersion: { required: true, type: () => Number }, deviceId: { required: true, type: () => String }, credentialKey: { required: true, type: () => String }, deviceName: { required: true, type: () => String }, platform: { required: true, type: () => String }, isActive: { required: true, type: () => Boolean }, failedAttempts: { required: true, type: () => Number }, lockedUntil: { required: true, type: () => Date }, lastUsedAt: { required: true, type: () => Date }, user: { required: true, type: () => require("./user.entity").User } };
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.UserDeviceCredential = UserDeviceCredential;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
26
|
+
(0, typeorm_1.Column)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], UserDeviceCredential.prototype, "hashedCredentialRef", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], UserDeviceCredential.prototype, "hashedMpin", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], UserDeviceCredential.prototype, "mpinScheme", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ default: 1 }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], UserDeviceCredential.prototype, "mpinSchemeVersion", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, typeorm_1.Column)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], UserDeviceCredential.prototype, "deviceId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_transformer_1.Expose)(),
|
|
48
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
49
|
+
(0, typeorm_1.Column)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], UserDeviceCredential.prototype, "credentialKey", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], UserDeviceCredential.prototype, "deviceName", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_transformer_1.Expose)(),
|
|
59
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], UserDeviceCredential.prototype, "platform", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
(0, typeorm_1.Column)({ default: true }),
|
|
65
|
+
__metadata("design:type", Boolean)
|
|
66
|
+
], UserDeviceCredential.prototype, "isActive", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_transformer_1.Expose)(),
|
|
69
|
+
(0, typeorm_1.Column)({ default: 0 }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], UserDeviceCredential.prototype, "failedAttempts", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, class_transformer_1.Expose)(),
|
|
74
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
75
|
+
__metadata("design:type", Date)
|
|
76
|
+
], UserDeviceCredential.prototype, "lockedUntil", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_transformer_1.Expose)(),
|
|
79
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
80
|
+
__metadata("design:type", Date)
|
|
81
|
+
], UserDeviceCredential.prototype, "lastUsedAt", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { nullable: false }),
|
|
84
|
+
__metadata("design:type", user_entity_1.User)
|
|
85
|
+
], UserDeviceCredential.prototype, "user", void 0);
|
|
86
|
+
exports.UserDeviceCredential = UserDeviceCredential = __decorate([
|
|
87
|
+
(0, typeorm_1.Entity)("ss_user_device_credential"),
|
|
88
|
+
(0, typeorm_1.Index)(["user", "deviceId"]),
|
|
89
|
+
(0, class_transformer_1.Exclude)()
|
|
90
|
+
], UserDeviceCredential);
|
|
91
|
+
//# sourceMappingURL=user-device-credential.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-device-credential.entity.js","sourceRoot":"","sources":["../../src/entities/user-device-credential.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAoD;AACpD,mDAA0D;AAC1D,qCAA2D;AAC3D,+CAAqC;AAe9B,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,4BAAY;;;;CA+GrD,CAAA;AA/GY,oDAAoB;AAS7B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;iEACmB;AAM5B;IADC,IAAA,gBAAM,GAAE;;wDACU;AAKnB;IADC,IAAA,gBAAM,GAAE;;wDACU;AAoBnB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACG;AAO1B;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,GAAE;;sDACQ;AAqBjB;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;2DACa;AAItB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACR;AAInB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACV;AAOjB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;sDACR;AAOlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4DACA;AAIvB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACd,IAAI;yDAAC;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;wDAAC;AAYjB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BACrC,kBAAI;kDAAC;+BA9GF,oBAAoB;IALhC,IAAA,gBAAM,EAAC,2BAA2B,CAAC;IAGnC,IAAA,eAAK,EAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3B,IAAA,2BAAO,GAAE;GACG,oBAAoB,CA+GhC","sourcesContent":["import { Exclude, Expose } from \"class-transformer\";\nimport { CommonEntity } from \"src/entities/common.entity\";\nimport { Column, Entity, Index, ManyToOne } from \"typeorm\";\nimport { User } from \"./user.entity\";\n\n/**\n * A per-device MPIN credential.\n *\n * Login presents `credentialRef` (a server-issued opaque handle) plus the MPIN.\n * The handle - not a mobile number or email - is what identifies the account,\n * which is why the login route needs no identifier and offers no user\n * enumeration surface.\n */\n@Entity(\"ss_user_device_credential\")\n// Non-unique: one physical device may legitimately hold credentials for\n// several accounts, and each account setup mints its own row.\n@Index([\"user\", \"deviceId\"])\n@Exclude()\nexport class UserDeviceCredential extends CommonEntity {\n\n // SHA-256 of the opaque handle, and the login lookup key. Never exposed:\n // the raw handle is returned to the client once at setup and never stored.\n // SHA-256 rather than bcrypt because the handle is 256 bits of randomness -\n // there is nothing to brute-force, so a slow hash would only add latency.\n // Same treatment as UserApiKey.hashedKey.\n @Index({ unique: true })\n @Column()\n hashedCredentialRef: string;\n\n // bcrypt hash of the MPIN, via HashingService. Never exposed - same\n // treatment as User.password. Slow hashing is warranted here: a 4-6 digit\n // secret is exactly the low-entropy case bcrypt exists for.\n @Column()\n hashedMpin: string;\n\n // Mirrors User.passwordScheme / passwordSchemeVersion so\n // HashingService.needsRehash can upgrade the hash on a successful login.\n @Column()\n mpinScheme: string;\n\n /**\n * The hashing *policy* version this row was hashed under - not a version of\n * MPIN itself. It comes from `HashingService.currentVersion()`, which\n * `BcryptService` currently returns as **2**, so freshly created rows read\n * 2, exactly as `ss_user.password_scheme_version` does.\n *\n * It matters because `BcryptService.normalize` applies the configured\n * pepper only when `version >= 2`. Storing the version per row means an\n * older hash still verifies after the policy changes: `compare()` uses the\n * version the row was written with, and `needsRehash()` upgrades it on the\n * next successful login.\n *\n * The `default: 1` is inherited from the `User` precedent and is never\n * reached, since every write path sets this explicitly. Note it would be\n * *wrong* if it ever were: a row hashed at 2 but recorded as 1 would be\n * compared without the pepper and could never authenticate.\n */\n @Column({ default: 1 })\n mpinSchemeVersion: number;\n\n // Client-supplied, stable for the physical device. Used for grouping and\n // the device-management UI only - never a lookup key. Deliberately NOT\n // unique: several accounts on one device share a deviceId.\n @Expose()\n @Column()\n deviceId: string;\n\n /**\n * Human-readable natural key - `<username>-<deviceId>` - unique per row.\n *\n * Neither column alone can serve as the model's user key: `deviceId` is\n * shared by every account on a device, and `deviceName` is nullable.\n * Combining them is unique in both directions - one user across many\n * devices, and many users on one device.\n *\n * Populated by MpinService rather than declared as a `computed` field in\n * the metadata manifest. Computed fields are evaluated by\n * ComputedFieldCrudManager on the generic CRUD path (`crud.service.ts`),\n * which this service bypasses by writing through the repository directly,\n * so a computed declaration would silently leave this null. It is also\n * beyond ConcatComputedFieldProvider, which resolves `dto[field]` flatly\n * within one model and cannot reach `username` across the user relation.\n */\n @Expose()\n @Index({ unique: true })\n @Column()\n credentialKey: string;\n\n @Expose()\n @Column({ nullable: true })\n deviceName: string;\n\n @Expose()\n @Column({ nullable: true })\n platform: string;\n\n // Revocation is a soft-delete: the row survives so that a correct MPIN can\n // be answered with \"this device was removed\" rather than a baffling\n // \"incorrect MPIN\". Only active rows count towards mpinMaxDevicesPerUser.\n @Expose()\n @Column({ default: true })\n isActive: boolean;\n\n // Cumulative, and reset only on a successful login - never when a lockout\n // expires. That is what makes the second threshold detectable without a\n // separate lockout counter.\n @Expose()\n @Column({ default: 0 })\n failedAttempts: number;\n\n @Expose()\n @Column({ nullable: true })\n lockedUntil: Date;\n\n @Expose()\n @Column({ nullable: true })\n lastUsedAt: Date;\n\n // Deliberately no inverse property on User. Nothing needs\n // `user.deviceCredentials`, and leaving the most widely referenced entity\n // in the system untouched keeps this feature purely additive.\n //\n // `nullable: false` because TypeORM makes relations nullable by default,\n // which would let a credential exist with no owner. Such a row could never\n // authenticate - loginWithMpin rejects it - so it would simply be dead\n // data, but the database should refuse it outright. This also keeps the\n // column honest against the metadata manifest, which declares it required.\n @ManyToOne(() => User, { nullable: false })\n user: User;\n}\n"]}
|
|
@@ -44,13 +44,13 @@ __decorate([
|
|
|
44
44
|
__metadata("design:type", String)
|
|
45
45
|
], User.prototype, "username", void 0);
|
|
46
46
|
__decorate([
|
|
47
|
-
(0, typeorm_1.Index)(
|
|
47
|
+
(0, typeorm_1.Index)(),
|
|
48
48
|
(0, typeorm_1.Column)({ type: "varchar", nullable: true }),
|
|
49
49
|
(0, class_transformer_1.Expose)(),
|
|
50
50
|
__metadata("design:type", String)
|
|
51
51
|
], User.prototype, "email", void 0);
|
|
52
52
|
__decorate([
|
|
53
|
-
(0, typeorm_1.Index)(
|
|
53
|
+
(0, typeorm_1.Index)(),
|
|
54
54
|
(0, typeorm_1.Column)({ type: "varchar", nullable: true }),
|
|
55
55
|
(0, class_transformer_1.Expose)(),
|
|
56
56
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAoG;AACpG,iEAAiE;AACjE,2EAAyE;AACzE,+DAA6D;AAC7D,yDAAoD;AAsB7C,IAAM,IAAI,GAAV,MAAM,IAAK,SAA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,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iDACJ;AAGhC;IADC,IAAA,0BAAM,GAAE;;oCACG;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,IAAA,0BAAM,GAAE;;wDACmC;AAI5C;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gCAAU,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;IAC5C,IAAA,0BAAM,GAAE;;qCACa;eApMb,IAAI;IAHhB,IAAA,gBAAM,EAAC,SAAS,CAAC;IACjB,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IAChF,IAAA,2BAAO,GAAE;GACG,IAAI,CAsMhB","sourcesContent":["import { CommonEntity } from \"src/entities/common.entity\"\nimport { Entity, Column, Index, JoinTable, ManyToMany, OneToMany, TableInheritance } from \"typeorm\";\nimport { RoleMetadata } from 'src/entities/role-metadata.entity';\nimport { UserViewMetadata } from 'src/entities/user-view-metadata.entity'\nimport { UserApiKey } from 'src/entities/user-api-key.entity'\nimport { Exclude, Expose } from \"class-transformer\";\n\n/**\n * Serialization is locked down twice over, and both halves are load-bearing:\n *\n * - The class-level `@Exclude()` below makes User itself an allowlist: only `@Expose()`d\n * properties are serialized.\n * - Every other property additionally carries its own `@Exclude()`. That looks redundant\n * here, and for `User` it is - but class-transformer resolves the *class-level* strategy\n * with a direct lookup on the exact constructor (MetadataStorage.getStrategy), so a\n * subclass inherits nothing and falls back to `exposeAll`. Since this entity is a\n * `@TableInheritance` root that consuming projects extend (see\n * IExtensionUserCreationProvider), an extension user that forgets its own `@Exclude()`\n * would otherwise serialize the password hash and every OAuth/verification token.\n * Property-level metadata *is* walked up the prototype chain, so the per-property\n * decorators are what actually protect subclasses.\n *\n * Keep both. Adding a new column? Give it `@Expose()` or `@Exclude()` - never neither.\n */\n@Entity(\"ss_user\")\n@TableInheritance({ column: { type: \"varchar\", name: \"type\", default: \"User\" } })\n@Exclude()\nexport class User extends CommonEntity {\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n fullName: string;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n @Expose()\n username: string;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n email: string;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n mobile: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n password: string;\n\n @Column({ nullable: true, default: true })\n @Expose()\n forcePasswordChange: boolean = true;\n\n @Column({ type: \"varchar\", default: \"local\" })\n @Exclude()\n lastLoginProvider: string = \"local\";\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n accessCode: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n googleAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n googleId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n googleProfilePicture: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n facebookId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n facebookAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n facebookProfilePicture: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n appleId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n appleAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftProfilePicture: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftActiveDirectoryId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftActiveDirectoryAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftActiveDirectoryProfilePicture: string;\n\n @Index()\n @Column({ default: true })\n @Expose()\n active: boolean = true;\n\n @Column({ nullable: true })\n @Exclude()\n forgotPasswordConfirmedAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n verificationTokenOnForgotPassword: string;\n\n @Column({ nullable: true })\n @Exclude()\n verificationTokenOnForgotPasswordExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerifiedOnRegistrationAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n emailVerificationTokenOnRegistration: string;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerificationTokenOnRegistrationExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerifiedOnRegistrationAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n mobileVerificationTokenOnRegistration: string;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerificationTokenOnRegistrationExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerifiedOnLoginAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n emailVerificationTokenOnLogin: string;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerificationTokenOnLoginExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerifiedOnLoginAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n mobileVerificationTokenOnLogin: string;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerificationTokenOnLoginExpiresAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n customPayload: string;\n\n @ManyToMany(() => RoleMetadata, roleMetadata => roleMetadata.users, { cascade: true })\n @JoinTable()\n @Expose()\n roles: RoleMetadata[];\n\n @OneToMany(() => UserViewMetadata, userViewMetadata => userViewMetadata.user, { cascade: true })\n @Exclude()\n userViewMetadata: UserViewMetadata[];\n\n @Exclude()\n @Column({ type: \"varchar\", default: \"bcrypt\" })\n passwordScheme: string;\n\n @Exclude()\n @Column({ type: \"int\", default: 1 })\n passwordSchemeVersion: number;\n\n @Exclude()\n @Column({ nullable: true })\n rehashedAt: Date;\n\n @Expose()\n @Column({ type: \"int\", default: 0 })\n failedLoginAttempts: number = 0;\n\n @Expose()\n _media: any;\n\n @Column({ default: false })\n @Expose()\n isAllowedToGenerateApiKeys: boolean = false;\n\n @OneToMany(() => UserApiKey, key => key.user)\n @Expose()\n apiKeys: UserApiKey[];\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAoG;AACpG,iEAAiE;AACjE,2EAAyE;AACzE,+DAA6D;AAC7D,yDAAoD;AAsB7C,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAY;IAA/B;;QA2BH,wBAAmB,GAAY,IAAI,CAAC;QAIpC,sBAAiB,GAAW,OAAO,CAAC;QAiEpC,WAAM,GAAY,IAAI,CAAC;QAyFvB,wBAAmB,GAAW,CAAC,CAAC;QAOhC,+BAA0B,GAAY,KAAK,CAAC;KAM/C;;2UA3KkC,IAAI,yhCAqEjB,IAAI,ysDAgGgB,KAAK;;CAM9C,CAAA;AAtMY,oBAAI;AAIb;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,0BAAM,GAAE;;sCACQ;AAKjB;IAHC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,0BAAM,GAAE;;sCACQ;AAKjB;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,gB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AC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC/F,IAAA,2BAAO,GAAE;;8CAC2B;AAIrC;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;4CACxB;AAIvB;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDACN;AAI9B;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;wCAAC;AAIjB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iDACJ;AAGhC;IADC,IAAA,0BAAM,GAAE;;oCACG;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,IAAA,0BAAM,GAAE;;wDACmC;AAI5C;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gCAAU,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;IAC5C,IAAA,0BAAM,GAAE;;qCACa;eApMb,IAAI;IAHhB,IAAA,gBAAM,EAAC,SAAS,CAAC;IACjB,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IAChF,IAAA,2BAAO,GAAE;GACG,IAAI,CAsMhB","sourcesContent":["import { CommonEntity } from \"src/entities/common.entity\"\nimport { Entity, Column, Index, JoinTable, ManyToMany, OneToMany, TableInheritance } from \"typeorm\";\nimport { RoleMetadata } from 'src/entities/role-metadata.entity';\nimport { UserViewMetadata } from 'src/entities/user-view-metadata.entity'\nimport { UserApiKey } from 'src/entities/user-api-key.entity'\nimport { Exclude, Expose } from \"class-transformer\";\n\n/**\n * Serialization is locked down twice over, and both halves are load-bearing:\n *\n * - The class-level `@Exclude()` below makes User itself an allowlist: only `@Expose()`d\n * properties are serialized.\n * - Every other property additionally carries its own `@Exclude()`. That looks redundant\n * here, and for `User` it is - but class-transformer resolves the *class-level* strategy\n * with a direct lookup on the exact constructor (MetadataStorage.getStrategy), so a\n * subclass inherits nothing and falls back to `exposeAll`. Since this entity is a\n * `@TableInheritance` root that consuming projects extend (see\n * IExtensionUserCreationProvider), an extension user that forgets its own `@Exclude()`\n * would otherwise serialize the password hash and every OAuth/verification token.\n * Property-level metadata *is* walked up the prototype chain, so the per-property\n * decorators are what actually protect subclasses.\n *\n * Keep both. Adding a new column? Give it `@Expose()` or `@Exclude()` - never neither.\n */\n@Entity(\"ss_user\")\n@TableInheritance({ column: { type: \"varchar\", name: \"type\", default: \"User\" } })\n@Exclude()\nexport class User extends CommonEntity {\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n fullName: string;\n\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n @Expose()\n username: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n email: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n mobile: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n password: string;\n\n @Column({ nullable: true, default: true })\n @Expose()\n forcePasswordChange: boolean = true;\n\n @Column({ type: \"varchar\", default: \"local\" })\n @Exclude()\n lastLoginProvider: string = \"local\";\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n accessCode: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n googleAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n googleId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n googleProfilePicture: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n facebookId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n facebookAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n facebookProfilePicture: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n appleId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n appleAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftProfilePicture: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftActiveDirectoryId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftActiveDirectoryAccessToken: string;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n microsoftActiveDirectoryProfilePicture: string;\n\n @Index()\n @Column({ default: true })\n @Expose()\n active: boolean = true;\n\n @Column({ nullable: true })\n @Exclude()\n forgotPasswordConfirmedAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n verificationTokenOnForgotPassword: string;\n\n @Column({ nullable: true })\n @Exclude()\n verificationTokenOnForgotPasswordExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerifiedOnRegistrationAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n emailVerificationTokenOnRegistration: string;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerificationTokenOnRegistrationExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerifiedOnRegistrationAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n mobileVerificationTokenOnRegistration: string;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerificationTokenOnRegistrationExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerifiedOnLoginAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n emailVerificationTokenOnLogin: string;\n\n @Column({ nullable: true })\n @Exclude()\n emailVerificationTokenOnLoginExpiresAt: Date;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerifiedOnLoginAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Exclude()\n mobileVerificationTokenOnLogin: string;\n\n @Column({ nullable: true })\n @Exclude()\n mobileVerificationTokenOnLoginExpiresAt: Date;\n\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n customPayload: string;\n\n @ManyToMany(() => RoleMetadata, roleMetadata => roleMetadata.users, { cascade: true })\n @JoinTable()\n @Expose()\n roles: RoleMetadata[];\n\n @OneToMany(() => UserViewMetadata, userViewMetadata => userViewMetadata.user, { cascade: true })\n @Exclude()\n userViewMetadata: UserViewMetadata[];\n\n @Exclude()\n @Column({ type: \"varchar\", default: \"bcrypt\" })\n passwordScheme: string;\n\n @Exclude()\n @Column({ type: \"int\", default: 1 })\n passwordSchemeVersion: number;\n\n @Exclude()\n @Column({ nullable: true })\n rehashedAt: Date;\n\n @Expose()\n @Column({ type: \"int\", default: 0 })\n failedLoginAttempts: number = 0;\n\n @Expose()\n _media: any;\n\n @Column({ default: false })\n @Expose()\n isAllowedToGenerateApiKeys: boolean = false;\n\n @OneToMany(() => UserApiKey, key => key.user)\n @Expose()\n apiKeys: UserApiKey[];\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-metadata.entity.js","sourceRoot":"","sources":["../../src/entities/view-metadata.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAkF;AAElF,qEAAqE;AACrE,mEAAmE;AACnE,2EAAyE;AAGlE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAAvC;;QAeH,YAAO,GAAQ,IAAI,CAAC;KAkBvB;;;;CAAA,CAAA;AAjCY,oCAAY;AAGrB;IAFC,IAAA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d,YAAY,CAiCxB","sourcesContent":["import { CommonEntity } from \"src/entities/common.entity\"\nimport { Entity, Column, ManyToOne, Index, JoinColumn, OneToMany } from \"typeorm\";\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\nimport { ModuleMetadata } from 'src/entities/module-metadata.entity';\nimport { ModelMetadata } from 'src/entities/model-metadata.entity';\nimport { UserViewMetadata } from 'src/entities/user-view-metadata.entity'\n\n@Entity(\"ss_view_metadata\")\nexport class ViewMetadata extends CommonEntity {\n @Index({ unique: true })\n @Column({ name: \"name\", type: \"varchar\"})\n name: string;\n\n @Index()\n @Column({ name: \"display_name\", type: \"varchar\" })\n displayName: string;\n\n @Index()\n @Column({ name: \"type\", type: \"varchar\" })\n type: string;\n\n //TODO: To make this truly cross db compatible, we should avoid setting a db type\n @Column({ name: \"context\", type: \"text\" })\n context: any = \"{}\";\n\n //TODO: To make this truly cross db compatible, we should avoid setting a db type\n @Column({ name: \"layout\", type: \"text\" })\n layout: any;\n\n @Index()\n @ManyToOne(() => ModuleMetadata, { nullable: false })\n @JoinColumn({ referencedColumnName: 'id' })\n module: ModuleMetadata;\n\n @Index()\n @ManyToOne(() => ModelMetadata, { nullable: false })\n @JoinColumn({ referencedColumnName: 'id' })\n model: ModelMetadata;\n\n @OneToMany(() => UserViewMetadata, userViewMetadata => userViewMetadata.viewMetadata, { cascade: true })\n userViewMetadata: UserViewMetadata[];\n}"]}
|
|
1
|
+
{"version":3,"file":"view-metadata.entity.js","sourceRoot":"","sources":["../../src/entities/view-metadata.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAkF;AAElF,qEAAqE;AACrE,mEAAmE;AACnE,2EAAyE;AAGlE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAAvC;;QAeH,YAAO,GAAQ,IAAI,CAAC;KAkBvB;;;;CAAA,CAAA;AAjCY,oCAAY;AAGrB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,I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Entity } from \"src/entities/common.entity\"\nimport { Entity, Column, ManyToOne, Index, JoinColumn, OneToMany } from \"typeorm\";\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\nimport { ModuleMetadata } from 'src/entities/module-metadata.entity';\nimport { ModelMetadata } from 'src/entities/model-metadata.entity';\nimport { UserViewMetadata } from 'src/entities/user-view-metadata.entity'\n\n@Entity(\"ss_view_metadata\")\nexport class ViewMetadata extends CommonEntity {\n @Index({ unique: true })\n @Column({ name: \"name\", type: \"varchar\"})\n name: string;\n\n @Index()\n @Column({ name: \"display_name\", type: \"varchar\" })\n displayName: string;\n\n @Index()\n @Column({ name: \"type\", type: \"varchar\" })\n type: string;\n\n // TODO: To make this truly cross db compatible, we should avoid setting a db type \n @Column({ name: \"context\", type: \"text\" })\n context: any = \"{}\";\n\n // TODO: To make this truly cross db compatible, we should avoid setting a db type\n @Column({ name: \"layout\", type: \"text\" })\n layout: any;\n\n @Index()\n @ManyToOne(() => ModuleMetadata, { nullable: false })\n @JoinColumn({ referencedColumnName: 'id' })\n module: ModuleMetadata;\n\n @Index()\n @ManyToOne(() => ModelMetadata, { nullable: false })\n @JoinColumn({ referencedColumnName: 'id' })\n model: ModelMetadata;\n\n @OneToMany(() => UserViewMetadata, userViewMetadata => userViewMetadata.viewMetadata, { cascade: true })\n userViewMetadata: UserViewMetadata[];\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution-artifact.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution-artifact.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-execution-artifact.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution-artifact.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGxE,qBACa,yBAA0B,SAAQ,YAAY;IAGvD,WAAW,EAAE,MAAM,CAAC;IAKpB,iBAAiB,EAAE,iBAAiB,CAAC;IAKrC,qBAAqB,EAAE,qBAAqB,CAAC;IAI7C,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,CAAC;IAIpB,YAAY,EAAE,MAAM,CAAa;IAIjC,MAAM,EAAE,MAAM,CAAC;IAIf,QAAQ,EAAE,MAAM,CAAC;IAIjB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,GAAG,EAAE,MAAM,CAAC;IAIZ,QAAQ,EAAE,MAAM,CAAC;IAIjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,MAAM,CAAC;IAIlB,QAAQ,EAAE,MAAM,CAAC;IAIjB,UAAU,EAAE,IAAI,CAAC;IAGjB,OAAO,EAAE,GAAG,CAAC;IAGb,QAAQ,EAAE,GAAG,CAAC;CACjB"}
|
|
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const workflow_execution_entity_1 = require("./workflow-execution.entity");
|
|
17
17
|
const workflow_step_execution_entity_1 = require("./workflow-step-execution.entity");
|
|
18
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
18
19
|
let WorkflowExecutionArtifact = class WorkflowExecutionArtifact extends common_entity_1.CommonEntity {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -32,13 +33,13 @@ __decorate([
|
|
|
32
33
|
], WorkflowExecutionArtifact.prototype, "artifactKey", void 0);
|
|
33
34
|
__decorate([
|
|
34
35
|
(0, typeorm_1.Index)(),
|
|
35
|
-
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, {
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, { nullable: false }),
|
|
36
37
|
(0, typeorm_1.JoinColumn)(),
|
|
37
38
|
__metadata("design:type", workflow_execution_entity_1.WorkflowExecution)
|
|
38
39
|
], WorkflowExecutionArtifact.prototype, "workflowExecution", void 0);
|
|
39
40
|
__decorate([
|
|
40
41
|
(0, typeorm_1.Index)(),
|
|
41
|
-
(0, typeorm_1.ManyToOne)(() => workflow_step_execution_entity_1.WorkflowStepExecution, {
|
|
42
|
+
(0, typeorm_1.ManyToOne)(() => workflow_step_execution_entity_1.WorkflowStepExecution, { nullable: true }),
|
|
42
43
|
(0, typeorm_1.JoinColumn)(),
|
|
43
44
|
__metadata("design:type", workflow_step_execution_entity_1.WorkflowStepExecution)
|
|
44
45
|
], WorkflowExecutionArtifact.prototype, "workflowStepExecution", void 0);
|
|
@@ -96,7 +97,7 @@ __decorate([
|
|
|
96
97
|
], WorkflowExecutionArtifact.prototype, "checksum", void 0);
|
|
97
98
|
__decorate([
|
|
98
99
|
(0, typeorm_1.Index)(),
|
|
99
|
-
(0, typeorm_1.Column)({
|
|
100
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
100
101
|
__metadata("design:type", Date)
|
|
101
102
|
], WorkflowExecutionArtifact.prototype, "producedAt", void 0);
|
|
102
103
|
__decorate([
|