law-common 1.2.2 → 1.2.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/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/interface/client.entity.response.d.ts +10 -0
- package/dist/api/interface/client.entity.response.js +2 -0
- package/dist/entities/interface/client.entity.interface.d.ts +5 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/utils/helper.fn.util.d.ts +5 -0
- package/dist/utils/helper.fn.util.js +30 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +16 -0
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export * from "./interface/login.dto.interface";
|
|
|
14
14
|
export * from "./interface/industry.entity.response";
|
|
15
15
|
export * from "./interface/configuration.entity.response";
|
|
16
16
|
export * from "./interface/rate.entity.response";
|
|
17
|
+
export * from "./interface/client.entity.response";
|
package/dist/api/index.js
CHANGED
|
@@ -30,3 +30,4 @@ __exportStar(require("./interface/login.dto.interface"), exports);
|
|
|
30
30
|
__exportStar(require("./interface/industry.entity.response"), exports);
|
|
31
31
|
__exportStar(require("./interface/configuration.entity.response"), exports);
|
|
32
32
|
__exportStar(require("./interface/rate.entity.response"), exports);
|
|
33
|
+
__exportStar(require("./interface/client.entity.response"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IApiEntity, IClientEntity } from "../../entities";
|
|
2
|
+
import { IUserApiEntity } from "./user.entity.api";
|
|
3
|
+
export type IClientApiEntity = IApiEntity<IClientEntity>;
|
|
4
|
+
export type IClientApiEntityArray = IClientApiEntity[];
|
|
5
|
+
export type IGetClientsByFilter = {
|
|
6
|
+
clients: IClientApiEntityArray;
|
|
7
|
+
users: {
|
|
8
|
+
[key: string]: IUserApiEntity;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CountryEnum } from "../enums/country.entity.enum";
|
|
2
2
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
|
-
import { IEntityCreateDto } from "./entity.utils.interface";
|
|
3
|
+
import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
|
|
4
4
|
export interface IClientEntity extends IAuditColumnEntity {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
@@ -13,11 +13,14 @@ export interface IClientEntity extends IAuditColumnEntity {
|
|
|
13
13
|
country?: CountryEnum;
|
|
14
14
|
industry?: string;
|
|
15
15
|
description?: string;
|
|
16
|
+
organizationId: number;
|
|
16
17
|
}
|
|
17
|
-
export interface IClientEntityCreateDto extends Omit<IEntityCreateDto<IClientEntity>, "industry"> {
|
|
18
|
+
export interface IClientEntityCreateDto extends Omit<IEntityCreateDto<IClientEntity>, "industry" | "organizationId"> {
|
|
18
19
|
partnerIds: number[];
|
|
19
20
|
industries?: string[];
|
|
20
21
|
}
|
|
22
|
+
export interface IClientEntityFilterDto extends IEntityFilterData<IClientEntity> {
|
|
23
|
+
}
|
|
21
24
|
export interface IClientUserMappingEntity extends IAuditColumnEntity {
|
|
22
25
|
id: number;
|
|
23
26
|
clientId: number;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.enums = exports.utils = exports.misc = exports.exceptions = exports.api = void 0;
|
|
27
30
|
exports.api = __importStar(require("./@api"));
|
|
@@ -29,3 +32,4 @@ exports.exceptions = __importStar(require("./@exceptions"));
|
|
|
29
32
|
exports.misc = __importStar(require("./@misc"));
|
|
30
33
|
exports.utils = __importStar(require("./@entities"));
|
|
31
34
|
exports.enums = __importStar(require("./enums"));
|
|
35
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function groupByFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T[]>;
|
|
2
|
+
export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T>;
|
|
3
|
+
export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
4
|
+
[key: string]: T;
|
|
5
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.groupByFunction = groupByFunction;
|
|
4
|
+
exports.groupByOneToOneFunction = groupByOneToOneFunction;
|
|
5
|
+
exports.convertMapToObject = convertMapToObject;
|
|
6
|
+
function groupByFunction(list, keyGetter) {
|
|
7
|
+
const map = new Map();
|
|
8
|
+
list.forEach((item) => {
|
|
9
|
+
const key = keyGetter(item);
|
|
10
|
+
const collection = map.get(key);
|
|
11
|
+
if (!collection) {
|
|
12
|
+
map.set(key, [item]);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
collection.push(item);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return map;
|
|
19
|
+
}
|
|
20
|
+
function groupByOneToOneFunction(list, keyGetter) {
|
|
21
|
+
const map = new Map();
|
|
22
|
+
list.forEach((item) => {
|
|
23
|
+
const key = keyGetter(item);
|
|
24
|
+
map.set(key, item);
|
|
25
|
+
});
|
|
26
|
+
return map;
|
|
27
|
+
}
|
|
28
|
+
function convertMapToObject(map) {
|
|
29
|
+
return Object.fromEntries(map);
|
|
30
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./helper.fn.util";
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
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 });
|
|
2
17
|
// export * from "./date.util";
|
|
18
|
+
__exportStar(require("./helper.fn.util"), exports);
|