@minimaltech/node-infra 0.3.11 → 0.3.12

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.
@@ -5,5 +5,5 @@ export * from './soft-delete.mixin';
5
5
  export * from './soft-persistent.mixin';
6
6
  export * from './text-search.mixin';
7
7
  export * from './tz.mixin';
8
- export * from './user-audit.mixin';
8
+ export * from './user-audit-v2.mixin';
9
9
  export * from './duplicatable.mixin';
@@ -21,6 +21,7 @@ __exportStar(require("./soft-delete.mixin"), exports);
21
21
  __exportStar(require("./soft-persistent.mixin"), exports);
22
22
  __exportStar(require("./text-search.mixin"), exports);
23
23
  __exportStar(require("./tz.mixin"), exports);
24
- __exportStar(require("./user-audit.mixin"), exports);
24
+ // export * from './user-audit.mixin';
25
+ __exportStar(require("./user-audit-v2.mixin"), exports);
25
26
  __exportStar(require("./duplicatable.mixin"), exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mixins/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wDAAsC;AACtC,oDAAkC;AAClC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,6CAA2B;AAC3B,qDAAmC;AACnC,uDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mixins/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wDAAsC;AACtC,oDAAkC;AAClC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,6CAA2B;AAC3B,sCAAsC;AACtC,wDAAsC;AACtC,uDAAqC"}
@@ -0,0 +1,20 @@
1
+ import { BaseTzEntity } from '../base';
2
+ import { IdType } from '../common/types';
3
+ import { MixinTarget } from '@loopback/core';
4
+ import { Entity, EntityResolver } from '@loopback/repository';
5
+ export declare const UserAuditMixin: <E extends MixinTarget<Entity>, C extends BaseTzEntity = BaseTzEntity, M extends BaseTzEntity = BaseTzEntity>(superClass: E, opts?: {
6
+ useRelation: boolean;
7
+ creatorResolver: EntityResolver<C>;
8
+ creatorKeyTo?: string;
9
+ modifierResolver: EntityResolver<M>;
10
+ modifierKeyTo?: string;
11
+ }) => {
12
+ new (...args: any[]): {
13
+ createdBy: IdType;
14
+ modifiedBy: IdType;
15
+ getId: () => any;
16
+ getIdObject: () => Object;
17
+ toJSON: () => Object;
18
+ toObject: (options?: import("@loopback/repository").Options) => Object;
19
+ };
20
+ } & E;
@@ -0,0 +1,81 @@
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.UserAuditMixin = void 0;
13
+ const utilities_1 = require("../utilities");
14
+ const repository_1 = require("@loopback/repository");
15
+ const UserAuditMixin = (superClass, opts) => {
16
+ const { useRelation = false, creatorResolver, creatorKeyTo, modifierResolver, modifierKeyTo } = opts !== null && opts !== void 0 ? opts : {};
17
+ if (!useRelation) {
18
+ let Mixed = class Mixed extends superClass {
19
+ };
20
+ __decorate([
21
+ (0, repository_1.property)({
22
+ type: 'number',
23
+ postgresql: {
24
+ columnName: 'created_by',
25
+ dataType: 'integer',
26
+ },
27
+ // hidden: true,
28
+ }),
29
+ __metadata("design:type", Object)
30
+ ], Mixed.prototype, "createdBy", void 0);
31
+ __decorate([
32
+ (0, repository_1.property)({
33
+ type: 'number',
34
+ postgresql: {
35
+ columnName: 'modified_by',
36
+ dataType: 'integer',
37
+ },
38
+ // hidden: true,
39
+ }),
40
+ __metadata("design:type", Object)
41
+ ], Mixed.prototype, "modifiedBy", void 0);
42
+ Mixed = __decorate([
43
+ (0, repository_1.model)()
44
+ ], Mixed);
45
+ return Mixed;
46
+ }
47
+ if (useRelation && !creatorResolver) {
48
+ throw (0, utilities_1.getError)({ message: '[UserAuditMixin] Invalid creatorResolver' });
49
+ }
50
+ if (useRelation && !modifierResolver) {
51
+ throw (0, utilities_1.getError)({ message: '[UserAuditMixin] Invalid modifierResolver' });
52
+ }
53
+ let Mixed = class Mixed extends superClass {
54
+ };
55
+ __decorate([
56
+ (0, repository_1.belongsTo)(creatorResolver, { keyFrom: 'createdBy', keyTo: creatorKeyTo, name: 'creator' }, {
57
+ type: 'number',
58
+ postgresql: {
59
+ columnName: 'created_by',
60
+ dataType: 'integer',
61
+ },
62
+ }),
63
+ __metadata("design:type", Object)
64
+ ], Mixed.prototype, "createdBy", void 0);
65
+ __decorate([
66
+ (0, repository_1.belongsTo)(creatorResolver, { keyFrom: 'modifiedBy', keyTo: modifierKeyTo, name: 'modifier' }, {
67
+ type: 'number',
68
+ postgresql: {
69
+ columnName: 'modified_by',
70
+ dataType: 'integer',
71
+ },
72
+ }),
73
+ __metadata("design:type", Object)
74
+ ], Mixed.prototype, "modifiedBy", void 0);
75
+ Mixed = __decorate([
76
+ (0, repository_1.model)()
77
+ ], Mixed);
78
+ return Mixed;
79
+ };
80
+ exports.UserAuditMixin = UserAuditMixin;
81
+ //# sourceMappingURL=user-audit-v2.mixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-audit-v2.mixin.js","sourceRoot":"","sources":["../../src/mixins/user-audit-v2.mixin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAuC;AAEvC,qDAA0F;AAEnF,MAAM,cAAc,GAAG,C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AAE,YAAY;gBACxB,QAAQ,EAAE,SAAS;aACpB;SACF,CACF;;4CACiB;IAalB;QAXC,IAAA,sBAAS,EACR,eAAgB,EAChB,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,EACjE;YACE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,aAAa;gBACzB,QAAQ,EAAE,SAAS;aACpB;SACF,CACF;;6CACkB;IAzBf,KAAK;QADV,IAAA,kBAAK,GAAE;OACF,KAAK,CA0BV;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAjFW,QAAA,cAAc,kBAiFzB"}
@@ -1,7 +1,10 @@
1
1
  import { IdType } from '../common/types';
2
2
  import { MixinTarget } from '@loopback/core';
3
3
  import { Entity } from '@loopback/repository';
4
- export declare const UserAuditMixin: <E extends MixinTarget<Entity>>(superClass: E) => {
4
+ /**
5
+ * @deprecated The method will soon deleted
6
+ */
7
+ export declare const UserAuditMixinDeprecated: <E extends MixinTarget<Entity>>(superClass: E) => {
5
8
  new (...args: any[]): {
6
9
  createdBy: IdType;
7
10
  modifiedBy: IdType;
@@ -9,9 +9,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UserAuditMixin = void 0;
12
+ exports.UserAuditMixinDeprecated = void 0;
13
13
  const repository_1 = require("@loopback/repository");
14
- const UserAuditMixin = (superClass) => {
14
+ /**
15
+ * @deprecated The method will soon deleted
16
+ */
17
+ const UserAuditMixinDeprecated = (superClass) => {
15
18
  class Mixed extends superClass {
16
19
  }
17
20
  __decorate([
@@ -21,7 +24,7 @@ const UserAuditMixin = (superClass) => {
21
24
  columnName: 'created_by',
22
25
  dataType: 'integer',
23
26
  },
24
- hidden: true,
27
+ // hidden: true,
25
28
  }),
26
29
  __metadata("design:type", Object)
27
30
  ], Mixed.prototype, "createdBy", void 0);
@@ -32,11 +35,11 @@ const UserAuditMixin = (superClass) => {
32
35
  columnName: 'modified_by',
33
36
  dataType: 'integer',
34
37
  },
35
- hidden: true,
38
+ // hidden: true,
36
39
  }),
37
40
  __metadata("design:type", Object)
38
41
  ], Mixed.prototype, "modifiedBy", void 0);
39
42
  return Mixed;
40
43
  };
41
- exports.UserAuditMixin = UserAuditMixin;
44
+ exports.UserAuditMixinDeprecated = UserAuditMixinDeprecated;
42
45
  //# sourceMappingURL=user-audit.mixin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-audit.mixin.js","sourceRoot":"","sources":["../../src/mixins/user-audit.mixin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,qDAAwD;AAEjD,MAAM,cAAc,GAAG,CAAgC,UAAa,EAAE,EAAE;IAC7E,MAAM,KAAM,SAAQ,UAAU;KAoB7B;IAXC;QARC,IAAA,qBAAQ,EAAC;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,YAAY;gBACxB,QAAQ,EAAE,SAAS;aACpB;YACD,MAAM,EAAE,IAAI;SACb,CAAC;;4CACgB;IAUlB;QARC,IAAA,qBAAQ,EAAC;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,aAAa;gBACzB,QAAQ,EAAE,SAAS;aACpB;YACD,MAAM,EAAE,IAAI;SACb,CAAC;;6CACiB;IAGrB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAxBW,QAAA,cAAc,kBAwBzB"}
1
+ {"version":3,"file":"user-audit.mixin.js","sourceRoot":"","sources":["../../src/mixins/user-audit.mixin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,qDAAwD;AAExD;;GAEG;AACI,MAAM,wBAAwB,GAAG,CAAgC,UAAa,EAAE,EAAE;IACvF,MAAM,KAAM,SAAQ,UAAU;KAoB7B;IAXC;QARC,IAAA,qBAAQ,EAAC;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,YAAY;gBACxB,QAAQ,EAAE,SAAS;aACpB;YACD,gBAAgB;SACjB,CAAC;;4CACgB;IAUlB;QARC,IAAA,qBAAQ,EAAC;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,aAAa;gBACzB,QAAQ,EAAE,SAAS;aACpB;YACD,gBAAgB;SACjB,CAAC;;6CACiB;IAGrB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAxBW,QAAA,wBAAwB,4BAwBnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minimaltech/node-infra",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Minimal Technology NodeJS Infrastructure - Loopback 4 Framework",
5
5
  "keywords": [
6
6
  "web",