mm-share-lib 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/src/{common/constant → constant}/entity-state.constant.d.ts +4 -4
- package/dist/src/{common/constant → constant}/entity-state.constant.js +8 -8
- package/dist/src/constant/entity-state.constant.js.map +1 -0
- package/dist/src/{common/constant → constant}/index.js +17 -17
- package/dist/src/constant/index.js.map +1 -0
- package/dist/src/dto/base-filter.dto.d.ts +4 -4
- package/dist/src/dto/base-filter.dto.js +10 -10
- package/dist/src/dto/index.d.ts +2 -2
- package/dist/src/dto/index.js +18 -18
- package/dist/src/dto/pagination.dto.d.ts +4 -4
- package/dist/src/dto/pagination.dto.js +10 -10
- package/dist/src/exception/index.js +1 -0
- package/dist/src/exception/index.js.map +1 -0
- package/dist/src/{common/generic → generic}/entity/entity.generic.d.ts +10 -10
- package/dist/src/{common/generic → generic}/entity/entity.generic.js +47 -47
- package/dist/src/generic/entity/entity.generic.js.map +1 -0
- package/dist/src/{common/generic → generic}/entity/index.js +17 -17
- package/dist/src/generic/entity/index.js.map +1 -0
- package/dist/src/{common/generic → generic}/index.js +18 -18
- package/dist/src/generic/index.js.map +1 -0
- package/dist/src/{common/generic → generic}/service/index.js +17 -17
- package/dist/src/generic/service/index.js.map +1 -0
- package/dist/src/{common/generic → generic}/service/service.generic.d.ts +18 -18
- package/dist/src/{common/generic → generic}/service/service.generic.js +84 -84
- package/dist/src/generic/service/service.generic.js.map +1 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.js +22 -21
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/index.d.ts +1 -1
- package/dist/src/lib/index.js +17 -17
- package/dist/src/lib/search-engine/document/base.document.d.ts +3 -3
- package/dist/src/lib/search-engine/document/base.document.js +6 -6
- package/dist/src/lib/search-engine/document/index.d.ts +1 -1
- package/dist/src/lib/search-engine/document/index.js +17 -17
- package/dist/src/lib/search-engine/index.d.ts +1 -1
- package/dist/src/lib/search-engine/index.js +17 -17
- package/dist/src/lib/search-engine/interface/index.d.ts +2 -2
- package/dist/src/lib/search-engine/interface/index.js +18 -18
- package/dist/src/lib/search-engine/interface/search-document.interface.d.ts +4 -4
- package/dist/src/lib/search-engine/interface/search-document.interface.js +2 -2
- package/dist/src/lib/search-engine/interface/transform-service.interface.d.ts +6 -6
- package/dist/src/lib/search-engine/interface/transform-service.interface.js +2 -2
- package/dist/src/lib/search-engine/schema/generic.schema.d.ts +2 -2
- package/dist/src/lib/search-engine/schema/generic.schema.js +6 -6
- package/dist/src/lib/search-engine/schema/index.d.ts +1 -1
- package/dist/src/lib/search-engine/schema/index.js +17 -17
- package/dist/src/lib/search-engine/typesense/index.d.ts +3 -3
- package/dist/src/lib/search-engine/typesense/index.js +19 -19
- package/dist/src/lib/search-engine/typesense/metadata/index.d.ts +2 -2
- package/dist/src/lib/search-engine/typesense/metadata/index.js +18 -18
- package/dist/src/lib/search-engine/typesense/metadata/schema.metadata.d.ts +12 -12
- package/dist/src/lib/search-engine/typesense/metadata/schema.metadata.js +2 -2
- package/dist/src/lib/search-engine/typesense/metadata/typesense.metadata-registry.d.ts +10 -10
- package/dist/src/lib/search-engine/typesense/metadata/typesense.metadata-registry.js +32 -33
- package/dist/src/lib/search-engine/typesense/metadata/typesense.metadata-registry.js.map +1 -1
- package/dist/src/lib/search-engine/typesense/service/client.service.d.ts +33 -33
- package/dist/src/lib/search-engine/typesense/service/client.service.js +196 -196
- package/dist/src/lib/search-engine/typesense/service/index.d.ts +1 -1
- package/dist/src/lib/search-engine/typesense/service/index.js +17 -17
- package/dist/src/lib/search-engine/typesense/typesense-module.interface.d.ts +27 -27
- package/dist/src/lib/search-engine/typesense/typesense-module.interface.js +2 -2
- package/dist/src/lib/search-engine/typesense/typesense.constants.d.ts +1 -1
- package/dist/src/lib/search-engine/typesense/typesense.constants.js +4 -4
- package/dist/src/lib/search-engine/typesense/typesense.module.d.ts +8 -8
- package/dist/src/lib/search-engine/typesense/typesense.module.js +67 -68
- package/dist/src/lib/search-engine/typesense/typesense.module.js.map +1 -1
- package/dist/src/lib/search-engine/typesense/typesense.module.test.d.ts +1 -1
- package/dist/src/lib/search-engine/typesense/typesense.module.test.js +88 -88
- package/dist/src/lib/search-engine/typesense/typesense.providers.d.ts +4 -4
- package/dist/src/lib/search-engine/typesense/typesense.providers.js +39 -39
- package/dist/src/response/index.d.ts +1 -1
- package/dist/src/response/index.js +17 -17
- package/dist/src/response/pagination.response.d.ts +17 -17
- package/dist/src/response/pagination.response.js +28 -28
- package/dist/src/util/date.util.d.ts +2 -2
- package/dist/src/util/date.util.js +13 -6
- package/dist/src/util/date.util.js.map +1 -1
- package/dist/src/util/generator.util.d.ts +4 -2
- package/dist/src/util/generator.util.js +28 -19
- package/dist/src/util/generator.util.js.map +1 -1
- package/dist/src/util/index.d.ts +2 -2
- package/dist/src/util/index.js +18 -18
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -1
- package/{dist/src/common/constant/index.d.ts → src/constant/index.ts} +1 -1
- package/src/exception/index.ts +0 -0
- package/{dist/src/common/generic/entity/index.d.ts → src/generic/entity/index.ts} +1 -1
- package/{dist/src/common/generic/index.d.ts → src/generic/index.ts} +2 -2
- package/{dist/src/common/generic/service/index.d.ts → src/generic/service/index.ts} +1 -1
- package/src/{common/generic → generic}/service/service.generic.ts +2 -2
- package/src/index.ts +6 -5
- package/src/lib/search-engine/index.ts +1 -1
- package/src/lib/search-engine/interface/transform-service.interface.ts +1 -1
- package/src/lib/search-engine/typesense/service/client.service.ts +1 -1
- package/src/util/date.util.spec.ts +49 -0
- package/src/util/date.util.ts +10 -1
- package/src/util/generator.util.spec.ts +45 -1
- package/src/util/generator.util.ts +16 -0
- package/src/util/index.ts +2 -2
- package/dist/src/common/constant/entity-state.constant.js.map +0 -1
- package/dist/src/common/constant/index.js.map +0 -1
- package/dist/src/common/generic/entity/entity.generic.js.map +0 -1
- package/dist/src/common/generic/entity/index.js.map +0 -1
- package/dist/src/common/generic/index.js.map +0 -1
- package/dist/src/common/generic/service/index.js.map +0 -1
- package/dist/src/common/generic/service/service.generic.js.map +0 -1
- package/dist/src/common/index.d.ts +0 -2
- package/dist/src/common/index.js +0 -19
- package/dist/src/common/index.js.map +0 -1
- package/src/common/generic/entity/entity.generic.spec.ts +0 -44
- package/src/common/index.ts +0 -2
- /package/{src/common/constant/index.ts → dist/src/constant/index.d.ts} +0 -0
- /package/{src/common/generic/service/service.generic.spec.ts → dist/src/exception/index.d.ts} +0 -0
- /package/{src/common/generic/entity/index.ts → dist/src/generic/entity/index.d.ts} +0 -0
- /package/{src/common/generic/index.ts → dist/src/generic/index.d.ts} +0 -0
- /package/{src/common/generic/service/index.ts → dist/src/generic/service/index.d.ts} +0 -0
- /package/src/{common/constant → constant}/entity-state.constant.ts +0 -0
- /package/src/{common/generic → generic}/entity/entity.generic.ts +0 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mm-share-lib",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.4",
|
4
4
|
"description": "Share the generic service, entity, dto.",
|
5
5
|
"author": "Mesa SOT",
|
6
6
|
"license": "MIT",
|
@@ -29,15 +29,18 @@
|
|
29
29
|
"@nestjs/typeorm": "^9.0.1",
|
30
30
|
"class-transformer": "^0.5.1",
|
31
31
|
"class-validator": "^0.14.0",
|
32
|
+
"dayjs": "^1.11.8",
|
32
33
|
"reflect-metadata": "^0.1.13",
|
33
34
|
"rxjs": "^7.8.1",
|
34
35
|
"typeorm": "^0.3.16",
|
36
|
+
"bcrypt": "^5.1.0",
|
35
37
|
"typesense": "^1.5.4"
|
36
38
|
},
|
37
39
|
"devDependencies": {
|
38
40
|
"@nestjs/cli": "^9.5.0",
|
39
41
|
"@nestjs/schematics": "^9.2.0",
|
40
42
|
"@nestjs/testing": "^9.4.2",
|
43
|
+
"@types/bcrypt": "^5.0.0",
|
41
44
|
"@types/express": "^4.17.17",
|
42
45
|
"@types/jest": "29.5.2",
|
43
46
|
"@types/node": "20.2.5",
|
@@ -1 +1 @@
|
|
1
|
-
export * from './entity-state.constant';
|
1
|
+
export * from './entity-state.constant';
|
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
export * from './entity.generic';
|
1
|
+
export * from './entity.generic';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './entity/entity.generic';
|
2
|
-
export * from './service/service.generic';
|
1
|
+
export * from './entity/entity.generic';
|
2
|
+
export * from './service/service.generic';
|
@@ -1 +1 @@
|
|
1
|
-
export * from './service.generic';
|
1
|
+
export * from './service.generic';
|
@@ -5,9 +5,9 @@ import {
|
|
5
5
|
SelectQueryBuilder,
|
6
6
|
} from 'typeorm';
|
7
7
|
import { EntityGeneric } from '../entity';
|
8
|
-
import { PaginationDto, BaseFilterDto } from '
|
8
|
+
import { PaginationDto, BaseFilterDto } from '../../dto';
|
9
9
|
import { EntityStateConstant } from '../../constant';
|
10
|
-
import { PaginationResponse } from '
|
10
|
+
import { PaginationResponse } from '../../response';
|
11
11
|
|
12
12
|
export abstract class ServiceGeneric<
|
13
13
|
Entity extends EntityGeneric,
|
package/src/index.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
export * from './
|
2
|
-
export * from './
|
3
|
-
export * from './
|
4
|
-
export * from './
|
5
|
-
export * from './
|
1
|
+
export * from './generic';
|
2
|
+
export * from './constant';
|
3
|
+
export * from './dto';
|
4
|
+
export * from './lib';
|
5
|
+
export * from './response';
|
6
|
+
export * from './util';
|
@@ -1 +1 @@
|
|
1
|
-
export * from 'typesense';
|
1
|
+
export * from 'typesense';
|
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
} from 'typesense/lib/Typesense/Documents';
|
12
12
|
import { BaseDocument } from '../../document';
|
13
13
|
import { SearchDocumentService } from '../../interface';
|
14
|
-
import { EntityGeneric } from '../../../../
|
14
|
+
import { EntityGeneric } from '../../../../generic';
|
15
15
|
import { PaginationResponse } from '../../../../response';
|
16
16
|
|
17
17
|
export abstract class ClientService<
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import dayjs from 'dayjs';
|
2
|
+
import { addSecond, isExpired } from './date.util';
|
3
|
+
|
4
|
+
describe('Utility Functions', () => {
|
5
|
+
test('addSecond should return a Date object with the specified duration added', () => {
|
6
|
+
// Arrange
|
7
|
+
const duration = 10;
|
8
|
+
|
9
|
+
// Act
|
10
|
+
const result = addSecond(duration);
|
11
|
+
|
12
|
+
// Assert
|
13
|
+
const expectedDate = dayjs().add(duration, 'seconds').toDate();
|
14
|
+
expect(result).toEqual(expectedDate);
|
15
|
+
});
|
16
|
+
|
17
|
+
test('isExpired should return true for a past date', () => {
|
18
|
+
// Arrange
|
19
|
+
const pastDate = dayjs().subtract(1, 'day').toDate();
|
20
|
+
|
21
|
+
// Act
|
22
|
+
const result = isExpired(pastDate);
|
23
|
+
|
24
|
+
// Assert
|
25
|
+
expect(result).toBe(true);
|
26
|
+
});
|
27
|
+
|
28
|
+
test('isExpired should return false for a future date', () => {
|
29
|
+
// Arrange
|
30
|
+
const futureDate = dayjs().add(1, 'day').toDate();
|
31
|
+
|
32
|
+
// Act
|
33
|
+
const result = isExpired(futureDate);
|
34
|
+
|
35
|
+
// Assert
|
36
|
+
expect(result).toBe(false);
|
37
|
+
});
|
38
|
+
|
39
|
+
test('isExpired should return false for the current date', () => {
|
40
|
+
// Arrange
|
41
|
+
const currentDate = dayjs().toDate();
|
42
|
+
|
43
|
+
// Act
|
44
|
+
const result = isExpired(currentDate);
|
45
|
+
|
46
|
+
// Assert
|
47
|
+
expect(result).toBe(false);
|
48
|
+
});
|
49
|
+
});
|
package/src/util/date.util.ts
CHANGED
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
import dayjs from 'dayjs';
|
2
|
+
|
3
|
+
export const addSecond = (duration: number): Date => {
|
4
|
+
return dayjs().add(duration, 'seconds').toDate();
|
5
|
+
};
|
6
|
+
|
7
|
+
export const isExpired = (date: Date): boolean => {
|
8
|
+
const currentDate = dayjs();
|
9
|
+
return dayjs(date).isBefore(currentDate);
|
10
|
+
};
|
@@ -1,4 +1,9 @@
|
|
1
|
-
import
|
1
|
+
import * as bcrypt from 'bcrypt';
|
2
|
+
import {
|
3
|
+
generateKey,
|
4
|
+
generateDigitCode,
|
5
|
+
generatePassword,
|
6
|
+
} from './generator.util';
|
2
7
|
|
3
8
|
describe('Utils', () => {
|
4
9
|
describe('generateKey', () => {
|
@@ -32,4 +37,43 @@ describe('Utils', () => {
|
|
32
37
|
expect(Number(code)).toBeLessThanOrEqual(9999);
|
33
38
|
});
|
34
39
|
});
|
40
|
+
|
41
|
+
describe('Utility Functions', () => {
|
42
|
+
test('generatePassword should return a hashed password with the specified salt rounds', async () => {
|
43
|
+
// Arrange
|
44
|
+
const password = 'password123';
|
45
|
+
const saltRounds = 12;
|
46
|
+
|
47
|
+
// Act
|
48
|
+
const hashedPassword = await generatePassword(password, saltRounds);
|
49
|
+
|
50
|
+
// Assert
|
51
|
+
expect(typeof hashedPassword).toBe('string');
|
52
|
+
expect(hashedPassword).not.toBe(password);
|
53
|
+
expect(await bcrypt.compare(password, hashedPassword)).toBeTruthy();
|
54
|
+
});
|
55
|
+
|
56
|
+
test('generatePassword should use the default salt rounds when no value is provided', async () => {
|
57
|
+
// Arrange
|
58
|
+
const password = 'password123';
|
59
|
+
const defaultSaltRounds = 10;
|
60
|
+
|
61
|
+
// Act
|
62
|
+
const hashedPassword = await generatePassword(password);
|
63
|
+
|
64
|
+
// Assert
|
65
|
+
expect(typeof hashedPassword).toBe('string');
|
66
|
+
expect(hashedPassword).not.toBe(password);
|
67
|
+
expect(await bcrypt.compare(password, hashedPassword)).toBeTruthy();
|
68
|
+
expect(bcrypt.getRounds(hashedPassword)).toBe(defaultSaltRounds);
|
69
|
+
});
|
70
|
+
|
71
|
+
test('generatePassword should throw an error when an invalid password is provided', async () => {
|
72
|
+
// Arrange
|
73
|
+
const invalidPassword = '';
|
74
|
+
|
75
|
+
// Act and Assert
|
76
|
+
await expect(generatePassword(invalidPassword)).rejects.toThrow();
|
77
|
+
});
|
78
|
+
});
|
35
79
|
});
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import * as bcrypt from 'bcrypt';
|
2
|
+
|
1
3
|
export const generateKey = (length = 36) => {
|
2
4
|
const chars =
|
3
5
|
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
@@ -16,3 +18,17 @@ export const generateDigitCode = (length = 4): string => {
|
|
16
18
|
)}`;
|
17
19
|
return generateCode;
|
18
20
|
};
|
21
|
+
|
22
|
+
export const generatePassword = async (
|
23
|
+
password: string,
|
24
|
+
saltOrRounds = 10,
|
25
|
+
): Promise<string> => {
|
26
|
+
return await bcrypt.hash(password, saltOrRounds);
|
27
|
+
};
|
28
|
+
|
29
|
+
export const comparePassword = (
|
30
|
+
password: string,
|
31
|
+
hashPassword: string,
|
32
|
+
): Promise<boolean> => {
|
33
|
+
return bcrypt.compare(password, hashPassword);
|
34
|
+
};
|
package/src/util/index.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './date.util';
|
2
|
-
export * from './generator.util';
|
1
|
+
export * from './date.util';
|
2
|
+
export * from './generator.util';
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"entity-state.constant.js","sourceRoot":"","sources":["../../../../src/common/constant/entity-state.constant.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/constant/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"entity.generic.js","sourceRoot":"","sources":["../../../../../src/common/generic/entity/entity.generic.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAEjB,MAAa,aAAa;IACxB,YAAY,EAAW;QACrB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;CAsBF;AApBC;IAAC,IAAA,gCAAsB,GAAE;;yCACd;AAEX;IAAC,IAAA,0BAAgB,GAAE;8BACR,IAAI;gDAAC;AAEhB;IAAC,IAAA,0BAAgB,GAAE;8BACR,IAAI;gDAAC;AAEhB;IAAC,IAAA,gBAAM,GAAE;;gDACS;AAElB;IAAC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;gDACR;AAElB;IAAC,IAAA,gBAAM,GAAE;;4CACK;AAEd;IAAC,IAAA,uBAAa,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;8CACjB;AAxBlB,sCAyBC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/common/generic/entity/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/generic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,4DAA0C"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/common/generic/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"service.generic.js","sourceRoot":"","sources":["../../../../../src/common/generic/service/service.generic.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AAGjB,6CAAqD;AACrD,gDAAuD;AAEvD,MAAsB,cAAc;IAQlC,YACqB,mBAA+C,EAClE,cAAkE;QAD/C,wBAAmB,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oGC"}
|
package/dist/src/common/index.js
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./generic"), exports);
|
18
|
-
__exportStar(require("./constant"), exports);
|
19
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,6CAA2B"}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import { EntityGeneric } from './entity.generic';
|
2
|
-
|
3
|
-
describe('EntityGeneric', () => {
|
4
|
-
let entity: EntityGeneric;
|
5
|
-
|
6
|
-
beforeEach(() => {
|
7
|
-
entity = new EntityGeneric();
|
8
|
-
});
|
9
|
-
|
10
|
-
it('should have an id property', () => {
|
11
|
-
expect(entity).toHaveProperty('id');
|
12
|
-
expect(entity.id).toBeUndefined(); // Assuming the constructor sets id as undefined
|
13
|
-
});
|
14
|
-
|
15
|
-
it('should have a createdAt property', () => {
|
16
|
-
expect(entity).toHaveProperty('createdAt');
|
17
|
-
expect(entity.createdAt).toBeInstanceOf(Date);
|
18
|
-
});
|
19
|
-
|
20
|
-
it('should have an updatedAt property', () => {
|
21
|
-
expect(entity).toHaveProperty('updatedAt');
|
22
|
-
expect(entity.updatedAt).toBeInstanceOf(Date);
|
23
|
-
});
|
24
|
-
|
25
|
-
it('should have a createdBy property', () => {
|
26
|
-
expect(entity).toHaveProperty('createdBy');
|
27
|
-
expect(entity.createdBy).toBeUndefined(); // Assuming createdBy is not set in the constructor
|
28
|
-
});
|
29
|
-
|
30
|
-
it('should have an updatedBy property', () => {
|
31
|
-
expect(entity).toHaveProperty('updatedBy');
|
32
|
-
expect(entity.updatedBy).toBeUndefined(); // Assuming updatedBy is not set in the constructor
|
33
|
-
});
|
34
|
-
|
35
|
-
it('should have a state property', () => {
|
36
|
-
expect(entity).toHaveProperty('state');
|
37
|
-
expect(entity.state).toBeUndefined(); // Assuming state is not set in the constructor
|
38
|
-
});
|
39
|
-
|
40
|
-
it('should have a version property', () => {
|
41
|
-
expect(entity).toHaveProperty('version');
|
42
|
-
expect(entity.version).toBeUndefined(); // Assuming version is not set in the constructor
|
43
|
-
});
|
44
|
-
});
|
package/src/common/index.ts
DELETED
File without changes
|
/package/{src/common/generic/service/service.generic.spec.ts → dist/src/exception/index.d.ts}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|