@minimaltech/node-infra 0.5.9-25 → 0.5.9-27

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.
@@ -1,14 +1,16 @@
1
1
  import { ControllerClass } from '@loopback/core';
2
2
  import { SchemaObject } from '@loopback/rest';
3
3
  import { NullableType, TRelationType } from '../../common/types';
4
- import { Class } from '@loopback/service-proxy';
5
- import { TBaseTzEntity } from '../models';
6
- import { BaseController } from './common';
7
- export interface IRelationCrudControllerOptions {
4
+ import { BaseEntity, TBaseTzEntity } from '../models';
5
+ export interface IRelationCrudControllerOptions<S, T> {
8
6
  association: {
9
7
  entities: {
10
- source: string;
11
- target: string;
8
+ source: typeof BaseEntity & {
9
+ prototype: S;
10
+ };
11
+ target: typeof BaseEntity & {
12
+ prototype: T;
13
+ };
12
14
  };
13
15
  repositories?: {
14
16
  source: string;
@@ -34,10 +36,14 @@ export interface IRelationCrudControllerOptions {
34
36
  export declare const defineRelationViewController: <S extends TBaseTzEntity, // Source Entity Type
35
37
  T extends TBaseTzEntity, // Target Entity Type
36
38
  TE extends TBaseTzEntity = any>(opts: {
37
- baseClass?: Class<BaseController>;
39
+ baseClass?: ControllerClass;
38
40
  entities: {
39
- source: string;
40
- target: string;
41
+ source: typeof BaseEntity & {
42
+ prototype: S;
43
+ };
44
+ target: typeof BaseEntity & {
45
+ prototype: T;
46
+ };
41
47
  };
42
48
  relation: {
43
49
  name: string;
@@ -48,7 +54,15 @@ TE extends TBaseTzEntity = any>(opts: {
48
54
  schema?: SchemaObject;
49
55
  }) => ControllerClass;
50
56
  export declare const defineAssociateController: <S extends TBaseTzEntity, T extends TBaseTzEntity, R extends TBaseTzEntity | NullableType>(opts: {
51
- baseClass: ReturnType<typeof defineRelationViewController>;
57
+ baseClass: ControllerClass;
58
+ entities: {
59
+ source: typeof BaseEntity & {
60
+ prototype: S;
61
+ };
62
+ target: typeof BaseEntity & {
63
+ prototype: T;
64
+ };
65
+ };
52
66
  relation: {
53
67
  name: string;
54
68
  type: TRelationType;
@@ -57,4 +71,4 @@ export declare const defineAssociateController: <S extends TBaseTzEntity, T exte
57
71
  endPoint?: string;
58
72
  schema?: SchemaObject;
59
73
  }) => ControllerClass;
60
- export declare const defineRelationCrudController: <S extends TBaseTzEntity, T extends TBaseTzEntity, R extends TBaseTzEntity | NullableType>(controllerOptions: IRelationCrudControllerOptions) => ControllerClass;
74
+ export declare const defineRelationCrudController: <S extends TBaseTzEntity, T extends TBaseTzEntity, R extends TBaseTzEntity | NullableType>(controllerOptions: IRelationCrudControllerOptions<S, T>) => ControllerClass;
@@ -38,6 +38,11 @@ const defineRelationViewController = (opts) => {
38
38
  const { baseClass, entities, relation, defaultLimit = common_1.App.DEFAULT_QUERY_LIMIT, endPoint = '', schema, } = opts;
39
39
  const restPath = `/{id}/${endPoint ? endPoint : relation.name}`;
40
40
  const BaseClass = baseClass !== null && baseClass !== void 0 ? baseClass : common_2.BaseController;
41
+ const sourceIdPathParam = {
42
+ name: 'id',
43
+ in: 'path',
44
+ schema: (0, utilities_1.getIdSchema)(entities.source),
45
+ };
41
46
  class ViewController extends BaseClass {
42
47
  constructor(sourceRepository, targetRepository, getCurrentUser) {
43
48
  super({ scope: `ViewController.${relation.name}` });
@@ -197,7 +202,7 @@ const defineRelationViewController = (opts) => {
197
202
  },
198
203
  },
199
204
  }),
200
- __param(0, rest_1.param.path.number('id')),
205
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
201
206
  __param(1, rest_1.param.query.object('filter')),
202
207
  __metadata("design:type", Function),
203
208
  __metadata("design:paramtypes", [Object, Object]),
@@ -215,7 +220,7 @@ const defineRelationViewController = (opts) => {
215
220
  },
216
221
  },
217
222
  }),
218
- __param(0, rest_1.param.path.number('id')),
223
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
219
224
  __param(1, rest_1.param.query.object('where')),
220
225
  __metadata("design:type", Function),
221
226
  __metadata("design:paramtypes", [Object, Object]),
@@ -226,8 +231,18 @@ const defineRelationViewController = (opts) => {
226
231
  exports.defineRelationViewController = defineRelationViewController;
227
232
  // --------------------------------------------------------------------------------------------------------------
228
233
  const defineAssociateController = (opts) => {
229
- const { baseClass, relation, defaultLimit = common_1.App.DEFAULT_QUERY_LIMIT, endPoint = '', schema, } = opts;
234
+ const { baseClass, entities, relation, defaultLimit = common_1.App.DEFAULT_QUERY_LIMIT, endPoint = '', schema, } = opts;
230
235
  const restPath = `/{id}/${endPoint ? endPoint : relation.name}`;
236
+ const sourceIdPathParam = {
237
+ name: 'id',
238
+ in: 'path',
239
+ schema: (0, utilities_1.getIdSchema)(entities.source),
240
+ };
241
+ const targetIdPathParam = {
242
+ name: 'id',
243
+ in: 'path',
244
+ schema: (0, utilities_1.getIdSchema)(entities.target),
245
+ };
231
246
  class AssociationController extends baseClass {
232
247
  constructor(sourceRepository, targetRepository, getCurrentUser) {
233
248
  super(sourceRepository, targetRepository, getCurrentUser);
@@ -275,10 +290,10 @@ const defineAssociateController = (opts) => {
275
290
  },
276
291
  },
277
292
  }),
278
- __param(0, rest_1.param.path.number('id')),
279
- __param(1, rest_1.param.path.number('link_id')),
293
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
294
+ __param(1, (0, rest_1.param)(targetIdPathParam)),
280
295
  __metadata("design:type", Function),
281
- __metadata("design:paramtypes", [Number, Number]),
296
+ __metadata("design:paramtypes", [Object, Object]),
282
297
  __metadata("design:returntype", Promise)
283
298
  ], AssociationController.prototype, "link", null);
284
299
  __decorate([
@@ -290,10 +305,10 @@ const defineAssociateController = (opts) => {
290
305
  },
291
306
  },
292
307
  }),
293
- __param(0, rest_1.param.path.number('id')),
294
- __param(1, rest_1.param.path.number('link_id')),
308
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
309
+ __param(1, (0, rest_1.param)(targetIdPathParam)),
295
310
  __metadata("design:type", Function),
296
- __metadata("design:paramtypes", [Number, Number]),
311
+ __metadata("design:paramtypes", [Object, Object]),
297
312
  __metadata("design:returntype", Promise)
298
313
  ], AssociationController.prototype, "unlink", null);
299
314
  return AssociationController;
@@ -320,7 +335,10 @@ const defineRelationCrudController = (controllerOptions) => {
320
335
  const restPath = `{id}/${endPoint}`;
321
336
  const ViewController = (0, exports.defineRelationViewController)({
322
337
  baseClass: common_2.BaseController,
323
- entities,
338
+ entities: {
339
+ source: entities.source,
340
+ target: entities.target,
341
+ },
324
342
  relation,
325
343
  defaultLimit,
326
344
  endPoint,
@@ -328,6 +346,7 @@ const defineRelationCrudController = (controllerOptions) => {
328
346
  });
329
347
  const AssociationController = (0, exports.defineAssociateController)({
330
348
  baseClass: ViewController,
349
+ entities,
331
350
  relation,
332
351
  defaultLimit,
333
352
  endPoint,
@@ -338,6 +357,11 @@ const defineRelationCrudController = (controllerOptions) => {
338
357
  if (!useControlTarget) {
339
358
  return ExtendsableClass;
340
359
  }
360
+ const sourceIdPathParam = {
361
+ name: 'id',
362
+ in: 'path',
363
+ schema: (0, utilities_1.getIdSchema)(entities.source),
364
+ };
341
365
  // -----------------------------------------------------------------------------------------------
342
366
  class Controller extends ExtendsableClass {
343
367
  constructor(sourceRepository, targetRepository, getCurrentUser) {
@@ -405,7 +429,7 @@ const defineRelationCrudController = (controllerOptions) => {
405
429
  },
406
430
  },
407
431
  }),
408
- __param(0, rest_1.param.path.number('id')),
432
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
409
433
  __param(1, (0, rest_1.requestBody)({
410
434
  required: true,
411
435
  content: {
@@ -413,7 +437,7 @@ const defineRelationCrudController = (controllerOptions) => {
413
437
  },
414
438
  })),
415
439
  __metadata("design:type", Function),
416
- __metadata("design:paramtypes", [Number, Object]),
440
+ __metadata("design:paramtypes", [Object, Object]),
417
441
  __metadata("design:returntype", Promise)
418
442
  ], Controller.prototype, "create", null);
419
443
  __decorate([
@@ -425,7 +449,7 @@ const defineRelationCrudController = (controllerOptions) => {
425
449
  },
426
450
  },
427
451
  }),
428
- __param(0, rest_1.param.path.number('id')),
452
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
429
453
  __param(1, (0, rest_1.requestBody)({
430
454
  required: true,
431
455
  content: {
@@ -434,7 +458,7 @@ const defineRelationCrudController = (controllerOptions) => {
434
458
  })),
435
459
  __param(2, rest_1.param.query.object('where')),
436
460
  __metadata("design:type", Function),
437
- __metadata("design:paramtypes", [Number, Object, Object]),
461
+ __metadata("design:paramtypes", [Object, Object, Object]),
438
462
  __metadata("design:returntype", Promise)
439
463
  ], Controller.prototype, "patch", null);
440
464
  __decorate([
@@ -446,14 +470,14 @@ const defineRelationCrudController = (controllerOptions) => {
446
470
  },
447
471
  },
448
472
  }),
449
- __param(0, rest_1.param.path.number('id')),
473
+ __param(0, (0, rest_1.param)(sourceIdPathParam)),
450
474
  __param(1, rest_1.param.query.object('where')),
451
475
  __metadata("design:type", Function),
452
- __metadata("design:paramtypes", [Number, Object]),
476
+ __metadata("design:paramtypes", [Object, Object]),
453
477
  __metadata("design:returntype", Promise)
454
478
  ], Controller.prototype, "delete", null);
455
- (0, core_1.inject)(`repositories.${(_a = repositories === null || repositories === void 0 ? void 0 : repositories.source) !== null && _a !== void 0 ? _a : `${entities.source}Repository`}`)(Controller, undefined, 0);
456
- (0, core_1.inject)(`repositories.${(_b = repositories === null || repositories === void 0 ? void 0 : repositories.target) !== null && _b !== void 0 ? _b : `${entities.target}Repository`}`)(Controller, undefined, 1);
479
+ (0, core_1.inject)(`repositories.${(_a = repositories === null || repositories === void 0 ? void 0 : repositories.source) !== null && _a !== void 0 ? _a : `${entities.source.name}Repository`}`)(Controller, undefined, 0);
480
+ (0, core_1.inject)(`repositories.${(_b = repositories === null || repositories === void 0 ? void 0 : repositories.target) !== null && _b !== void 0 ? _b : `${entities.target.name}Repository`}`)(Controller, undefined, 1);
457
481
  if (options.doInjectCurrentUser) {
458
482
  core_1.inject.getter(security_1.SecurityBindings.USER, { optional: true })(Controller, undefined, 2);
459
483
  }
@@ -120,10 +120,14 @@ class BaseSoftDeleteTzEntity extends BaseNumberSoftDeleteTzEntity {
120
120
  }
121
121
  exports.BaseSoftDeleteTzEntity = BaseSoftDeleteTzEntity;
122
122
  // ---------------------------------------------------------------------
123
- class BaseNumberDuplicatableTzEntity extends (0, mixins_1.DuplicatableMixin)(BaseNumberTzEntity) {
123
+ class BaseNumberDuplicatableTzEntity extends (0, mixins_1.DuplicatableMixin)(BaseNumberTzEntity, {
124
+ idType: 'number',
125
+ }) {
124
126
  }
125
127
  exports.BaseNumberDuplicatableTzEntity = BaseNumberDuplicatableTzEntity;
126
- class BaseStringDuplicatableTzEntity extends (0, mixins_1.DuplicatableMixin)(BaseNumberTzEntity) {
128
+ class BaseStringDuplicatableTzEntity extends (0, mixins_1.DuplicatableMixin)(BaseNumberTzEntity, {
129
+ idType: 'string',
130
+ }) {
127
131
  }
128
132
  exports.BaseStringDuplicatableTzEntity = BaseStringDuplicatableTzEntity;
129
133
  class BaseDuplicatableTzEntity extends BaseNumberDuplicatableTzEntity {
@@ -204,7 +204,7 @@ class TzCrudRepository extends base_repository_1.AbstractTzRepository {
204
204
  if (options === null || options === void 0 ? void 0 : options.newInstance) {
205
205
  entity.createdAt = new Date();
206
206
  }
207
- if (!options.ignoreModified) {
207
+ if (!options.ignoreModified && 'modifiedAt' in entity) {
208
208
  entity.modifiedAt = new Date();
209
209
  }
210
210
  return entity;
@@ -1,4 +1,4 @@
1
- import { BaseNumberTzEntity } from '../../../base';
1
+ import { BaseNumberTzEntity } from '../../../base/models';
2
2
  import { NumberIdType } from '../../../common';
3
3
  export declare class OAuth2Client extends BaseNumberTzEntity {
4
4
  identifier: string;
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OAuth2Client = void 0;
13
- const base_1 = require("../../../base");
13
+ const models_1 = require("../../../base/models");
14
14
  const repository_1 = require("@loopback/repository");
15
- let OAuth2Client = class OAuth2Client extends base_1.BaseNumberTzEntity {
15
+ let OAuth2Client = class OAuth2Client extends models_1.BaseNumberTzEntity {
16
16
  constructor(data) {
17
17
  super(data);
18
18
  }
@@ -1,4 +1,4 @@
1
- import { BaseNumberTzEntity } from '../../../base';
1
+ import { BaseNumberTzEntity } from '../../../base/models';
2
2
  export declare class OAuth2Scope extends BaseNumberTzEntity {
3
3
  identifier: string;
4
4
  name: string;
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OAuth2Scope = void 0;
13
- const base_1 = require("../../../base");
13
+ const models_1 = require("../../../base/models");
14
14
  const repository_1 = require("@loopback/repository");
15
- let OAuth2Scope = class OAuth2Scope extends base_1.BaseNumberTzEntity {
15
+ let OAuth2Scope = class OAuth2Scope extends models_1.BaseNumberTzEntity {
16
16
  constructor(data) {
17
17
  super(data);
18
18
  }
@@ -1,4 +1,4 @@
1
- import { BaseNumberTzEntity } from '../../../base';
1
+ import { BaseNumberTzEntity } from '../../../base/models';
2
2
  import { AnyObject, IdType } from '../../../common';
3
3
  export declare class OAuth2Token extends BaseNumberTzEntity {
4
4
  token: string;
@@ -10,11 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OAuth2Token = void 0;
13
- const base_1 = require("../../../base");
13
+ const models_1 = require("../../../base/models");
14
14
  const common_1 = require("../../../common");
15
15
  const repository_1 = require("@loopback/repository");
16
16
  const oauth2_client_model_1 = require("./oauth2-client.model");
17
- let OAuth2Token = class OAuth2Token extends base_1.BaseNumberTzEntity {
17
+ let OAuth2Token = class OAuth2Token extends models_1.BaseNumberTzEntity {
18
18
  constructor(data) {
19
19
  super(data);
20
20
  }
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.defineUserRole = exports.definePermissionMapping = exports.definePermission = exports.defineRole = exports.defineUser = void 0;
13
- const base_1 = require("../../../base");
13
+ const models_1 = require("../../../base/models");
14
14
  const common_1 = require("../../../common");
15
15
  const mixins_1 = require("../../../mixins");
16
16
  const repository_1 = require("@loopback/repository");
17
17
  // -----------------------------------------------------------------------
18
18
  const defineUser = () => {
19
- class User extends base_1.BaseNumberTzEntity {
19
+ class User extends models_1.BaseNumberTzEntity {
20
20
  constructor(data) {
21
21
  super(data);
22
22
  }
@@ -83,7 +83,7 @@ const defineUser = () => {
83
83
  exports.defineUser = defineUser;
84
84
  // -----------------------------------------------------------------------
85
85
  const defineRole = () => {
86
- class Role extends base_1.BaseNumberTzEntity {
86
+ class Role extends models_1.BaseNumberTzEntity {
87
87
  constructor(data) {
88
88
  super(data);
89
89
  }
@@ -126,7 +126,7 @@ const defineRole = () => {
126
126
  exports.defineRole = defineRole;
127
127
  // -----------------------------------------------------------------------
128
128
  const definePermission = () => {
129
- class Permission extends base_1.BaseNumberTzEntity {
129
+ class Permission extends models_1.BaseNumberTzEntity {
130
130
  constructor(data) {
131
131
  super(data);
132
132
  }
@@ -190,7 +190,7 @@ const definePermission = () => {
190
190
  exports.definePermission = definePermission;
191
191
  // -----------------------------------------------------------------------
192
192
  const definePermissionMapping = () => {
193
- class PermissionMapping extends base_1.BaseNumberTzEntity {
193
+ class PermissionMapping extends models_1.BaseNumberTzEntity {
194
194
  constructor(data) {
195
195
  super(data);
196
196
  }
@@ -225,7 +225,7 @@ const definePermissionMapping = () => {
225
225
  exports.definePermissionMapping = definePermissionMapping;
226
226
  // -----------------------------------------------------------------------
227
227
  const defineUserRole = () => {
228
- class UserRole extends (0, mixins_1.PrincipalMixin)(base_1.BaseNumberTzEntity, 'Role', 'number') {
228
+ class UserRole extends (0, mixins_1.PrincipalMixin)(models_1.BaseNumberTzEntity, 'Role', 'number') {
229
229
  constructor(data) {
230
230
  super(data);
231
231
  }
@@ -1,4 +1,4 @@
1
- import { BaseNumberTzEntity } from '../../../base';
1
+ import { BaseNumberTzEntity } from '../../../base/models';
2
2
  export declare class Migration extends BaseNumberTzEntity {
3
3
  name: string;
4
4
  status: string;
@@ -10,10 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Migration = void 0;
13
- const base_1 = require("../../../base");
13
+ const models_1 = require("../../../base/models");
14
14
  const common_1 = require("../../../common");
15
15
  const repository_1 = require("@loopback/repository");
16
- let Migration = class Migration extends base_1.BaseNumberTzEntity {
16
+ let Migration = class Migration extends models_1.BaseNumberTzEntity {
17
17
  constructor(data) {
18
18
  super(data);
19
19
  }
@@ -1,4 +1,4 @@
1
- import { TBaseIdEntity } from '../base';
1
+ import { TBaseIdEntity } from '../base/models';
2
2
  import { IController } from '../common';
3
3
  import { Interceptor, InvocationContext, InvocationResult, Provider, ValueOrPromise } from '@loopback/core';
4
4
  import { Response } from '@loopback/rest';
@@ -1,7 +1,9 @@
1
1
  import { BaseEntity } from '../base/models';
2
2
  import { IdType } from '../common';
3
3
  import { MixinTarget } from '@loopback/core';
4
- export declare const DuplicatableMixin: <E extends MixinTarget<BaseEntity>>(superClass: E) => {
4
+ export declare const DuplicatableMixin: <E extends MixinTarget<BaseEntity>>(superClass: E, opts: {
5
+ idType: "string" | "number";
6
+ }) => {
5
7
  new (...args: any[]): {
6
8
  sourceId?: IdType;
7
9
  getId: () => any;
@@ -10,19 +10,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DuplicatableMixin = void 0;
13
- const models_1 = require("../base/models");
14
- const model_utility_1 = require("../utilities/model.utility");
15
13
  const repository_1 = require("@loopback/repository");
16
- const DuplicatableMixin = (superClass) => {
17
- const sourceIdType = (0, model_utility_1.getIdType)(models_1.BaseNumberIdEntity);
14
+ const DuplicatableMixin = (superClass, opts) => {
15
+ // const sourceIdType = getIdType(BaseNumberIdEntity);
18
16
  let Mixed = class Mixed extends superClass {
19
17
  };
20
18
  __decorate([
21
19
  (0, repository_1.property)({
22
- type: sourceIdType,
20
+ type: opts.idType,
23
21
  postgresql: {
24
22
  columnName: 'source_id',
25
- dataType: sourceIdType === 'number' ? 'integer' : 'text',
23
+ dataType: opts.idType === 'number' ? 'integer' : 'text',
26
24
  },
27
25
  }),
28
26
  __metadata("design:type", Object)
@@ -6,6 +6,9 @@ export declare const TzMixin: <E extends MixinTarget<Entity>>(superClass: E, opt
6
6
  dataType: string;
7
7
  };
8
8
  modifiedAt: {
9
+ enable: false;
10
+ } | {
11
+ enable?: true;
9
12
  columnName: string;
10
13
  dataType: string;
11
14
  };
@@ -12,15 +12,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TzMixin = void 0;
13
13
  const repository_1 = require("@loopback/repository");
14
14
  const TzMixin = (superClass, opts) => {
15
- var _a, _b, _c, _d, _e, _f, _g, _h;
15
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
16
+ if (!(opts === null || opts === void 0 ? void 0 : opts.modifiedAt.enable)) {
17
+ class Mixed extends superClass {
18
+ }
19
+ __decorate([
20
+ (0, repository_1.property)({
21
+ type: 'date',
22
+ postgresql: {
23
+ columnName: (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.createdAt) === null || _a === void 0 ? void 0 : _a.columnName) !== null && _b !== void 0 ? _b : 'created_at',
24
+ dataType: (_d = (_c = opts === null || opts === void 0 ? void 0 : opts.createdAt) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : 'TIMESTAMPTZ',
25
+ default: 'NOW()',
26
+ nullable: 'NO',
27
+ },
28
+ }),
29
+ __metadata("design:type", Date)
30
+ ], Mixed.prototype, "createdAt", void 0);
31
+ return Mixed;
32
+ }
16
33
  class Mixed extends superClass {
17
34
  }
18
35
  __decorate([
19
36
  (0, repository_1.property)({
20
37
  type: 'date',
21
38
  postgresql: {
22
- columnName: (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.createdAt) === null || _a === void 0 ? void 0 : _a.columnName) !== null && _b !== void 0 ? _b : 'created_at',
23
- dataType: (_d = (_c = opts === null || opts === void 0 ? void 0 : opts.createdAt) === null || _c === void 0 ? void 0 : _c.dataType) !== null && _d !== void 0 ? _d : 'TIMESTAMPTZ',
39
+ columnName: (_f = (_e = opts === null || opts === void 0 ? void 0 : opts.createdAt) === null || _e === void 0 ? void 0 : _e.columnName) !== null && _f !== void 0 ? _f : 'created_at',
40
+ dataType: (_h = (_g = opts === null || opts === void 0 ? void 0 : opts.createdAt) === null || _g === void 0 ? void 0 : _g.dataType) !== null && _h !== void 0 ? _h : 'TIMESTAMPTZ',
24
41
  default: 'NOW()',
25
42
  nullable: 'NO',
26
43
  },
@@ -31,8 +48,8 @@ const TzMixin = (superClass, opts) => {
31
48
  (0, repository_1.property)({
32
49
  type: 'date',
33
50
  postgresql: {
34
- columnName: (_f = (_e = opts === null || opts === void 0 ? void 0 : opts.modifiedAt) === null || _e === void 0 ? void 0 : _e.columnName) !== null && _f !== void 0 ? _f : 'modified_at',
35
- dataType: (_h = (_g = opts === null || opts === void 0 ? void 0 : opts.modifiedAt) === null || _g === void 0 ? void 0 : _g.dataType) !== null && _h !== void 0 ? _h : 'TIMESTAMPTZ',
51
+ columnName: (_k = (_j = opts === null || opts === void 0 ? void 0 : opts.modifiedAt) === null || _j === void 0 ? void 0 : _j.columnName) !== null && _k !== void 0 ? _k : 'modified_at',
52
+ dataType: (_m = (_l = opts === null || opts === void 0 ? void 0 : opts.modifiedAt) === null || _l === void 0 ? void 0 : _l.dataType) !== null && _m !== void 0 ? _m : 'TIMESTAMPTZ',
36
53
  default: 'NOW()',
37
54
  nullable: 'NO',
38
55
  },
@@ -1,4 +1,4 @@
1
- import { TBaseTzEntity } from '../base';
1
+ import { TBaseTzEntity } from '../base/models';
2
2
  import { IdType } from '../common/types';
3
3
  import { MixinTarget } from '@loopback/core';
4
4
  import { Entity, EntityResolver } from '@loopback/repository';
@@ -1,8 +1,8 @@
1
1
  import { SchemaObject } from '@loopback/rest';
2
- import { BaseEntity } from '../base/models/base.model';
2
+ import { BaseEntity, BaseIdEntity } from '../base/models/base.model';
3
3
  export declare const getIdSchema: <E extends BaseEntity>(entity: typeof BaseEntity & {
4
4
  prototype: E;
5
5
  }) => SchemaObject;
6
- export declare const getIdType: <E extends BaseEntity>(entity: typeof BaseEntity & {
6
+ export declare const getIdType: <E extends BaseEntity>(entity: typeof BaseIdEntity & {
7
7
  prototype: E;
8
8
  }) => "string" | "number";
@@ -1,5 +1,5 @@
1
- import { BaseEntity } from '../base';
2
1
  import { AnyType, EntityClassType } from '../common';
2
+ import { BaseEntity } from '../base/models';
3
3
  export declare const getTableDefinition: <T extends BaseEntity>(opts: {
4
4
  model: EntityClassType<T>;
5
5
  alias?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minimaltech/node-infra",
3
- "version": "0.5.9-25",
3
+ "version": "0.5.9-27",
4
4
  "description": "Minimal Technology - NodeJS Infrastructure - Loopback 4 Framework",
5
5
  "keywords": [
6
6
  "web",