law-common 12.6.3-beta.13 → 12.6.3-beta.15
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/README.md +1 -1
- package/dist/src/api/index.d.ts +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/country.create.dto.interface.d.ts +4 -0
- package/dist/src/api/interface/country.create.dto.interface.js +2 -0
- package/dist/src/api/interface/country.update.dto.interface.d.ts +11 -0
- package/dist/src/api/interface/country.update.dto.interface.js +5 -0
- package/dist/src/api/interface/industry.update.dto.interface.d.ts +1 -8
- package/dist/src/api/interface/industry.update.dto.interface.js +0 -15
- package/dist/src/entities/enums/country.action.enum.d.ts +8 -0
- package/dist/src/entities/enums/country.action.enum.js +17 -0
- package/dist/src/entities/enums/country_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/country_status_enum.js +9 -0
- package/dist/src/entities/enums/industry.action.enum.d.ts +8 -0
- package/dist/src/entities/enums/industry.action.enum.js +17 -0
- package/dist/src/entities/flow-configs/country_flow.config.d.ts +6 -0
- package/dist/src/entities/flow-configs/country_flow.config.js +70 -0
- package/dist/src/entities/flow-configs/industry_flow.config.d.ts +1 -1
- package/dist/src/entities/flow-configs/industry_flow.config.js +21 -21
- package/dist/src/entities/index.d.ts +5 -0
- package/dist/src/entities/index.js +5 -0
- package/dist/src/entities/interface/country.entity.interface.d.ts +5 -2
- package/dist/src/entities/interface/field-constraint/country_field_constraints.interface.d.ts +8 -0
- package/dist/src/entities/interface/field-constraint/country_field_constraints.interface.js +9 -0
- package/dist/src/entities/model/country.entity.model.d.ts +25 -3
- package/dist/src/entities/model/country.entity.model.js +77 -8
- package/dist/src/entities/model/entity.model.interface.js +1 -1
- package/dist/src/entities/model/industry.entity.model.d.ts +4 -4
- package/dist/src/entities/model/industry.entity.model.js +3 -3
- package/dist/src/entities/model/task.entity.model.js +1 -1
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# law-common
|
|
1
|
+
# law-common
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export * from "./interface/tds_rate_voucher_type_mapping.create.dto.interface";
|
|
|
66
66
|
export * from "./interface/tds_rate_voucher_type_mapping.update.dto.interface";
|
|
67
67
|
export * from "./interface/voucher_type.create.dto.interface";
|
|
68
68
|
export * from "./interface/voucher_type.update.dto.interface";
|
|
69
|
+
export * from "./interface/country.create.dto.interface";
|
|
70
|
+
export * from "./interface/country.update.dto.interface";
|
|
69
71
|
export * from "./interface/client.create.dto.interface";
|
|
70
72
|
export * from "./interface/expense_head.create.dto.interface";
|
|
71
73
|
export * from "./interface/expense_head.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -86,6 +86,8 @@ __exportStar(require("./interface/tds_rate_voucher_type_mapping.create.dto.inter
|
|
|
86
86
|
__exportStar(require("./interface/tds_rate_voucher_type_mapping.update.dto.interface"), exports);
|
|
87
87
|
__exportStar(require("./interface/voucher_type.create.dto.interface"), exports);
|
|
88
88
|
__exportStar(require("./interface/voucher_type.update.dto.interface"), exports);
|
|
89
|
+
__exportStar(require("./interface/country.create.dto.interface"), exports);
|
|
90
|
+
__exportStar(require("./interface/country.update.dto.interface"), exports);
|
|
89
91
|
__exportStar(require("./interface/client.create.dto.interface"), exports);
|
|
90
92
|
__exportStar(require("./interface/expense_head.create.dto.interface"), exports);
|
|
91
93
|
__exportStar(require("./interface/expense_head.update.dto.interface"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CountryActionEnum } from "../../entities/enums/country.action.enum";
|
|
2
|
+
export { CountryActionEnum };
|
|
3
|
+
import { DeepPartialButRequired } from "./api.utils.interface";
|
|
4
|
+
import { ICountryCreateDto, ICountryCreateDtoExclude } from "./country.create.dto.interface";
|
|
5
|
+
export type ICountryEntityUpdateDto = Omit<DeepPartialButRequired<ICountryCreateDto, never> & {
|
|
6
|
+
actionData: ICountryActionDataDto;
|
|
7
|
+
}, ICountryCreateDtoExclude>;
|
|
8
|
+
export interface ICountryActionDataDto {
|
|
9
|
+
action: CountryActionEnum;
|
|
10
|
+
remark?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountryActionEnum = void 0;
|
|
4
|
+
const country_action_enum_1 = require("../../entities/enums/country.action.enum");
|
|
5
|
+
Object.defineProperty(exports, "CountryActionEnum", { enumerable: true, get: function () { return country_action_enum_1.CountryActionEnum; } });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DeepPartialButRequired } from "./api.utils.interface";
|
|
2
|
+
import { IndustryActionEnum } from "../../entities/enums/industry.action.enum";
|
|
2
3
|
import { IIndustryCreateDto } from "./industry.create.dto.interface";
|
|
3
4
|
export type IIndustryUpdateDto = DeepPartialButRequired<IIndustryCreateDto, never> & {
|
|
4
5
|
actionData: IIndustryActionDataDto;
|
|
@@ -7,11 +8,3 @@ export interface IIndustryActionDataDto {
|
|
|
7
8
|
action: IndustryActionEnum;
|
|
8
9
|
remark?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare enum IndustryActionEnum {
|
|
11
|
-
CREATE = "create",
|
|
12
|
-
UPDATE = "update",
|
|
13
|
-
DELETE = "delete",
|
|
14
|
-
DEACTIVATE = "deactivate",
|
|
15
|
-
ACTIVATE = "activate",
|
|
16
|
-
RESTORE = "restore"
|
|
17
|
-
}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndustryActionEnum = void 0;
|
|
4
|
-
var IndustryActionEnum;
|
|
5
|
-
(function (IndustryActionEnum) {
|
|
6
|
-
IndustryActionEnum["CREATE"] = "create";
|
|
7
|
-
IndustryActionEnum["UPDATE"] = "update";
|
|
8
|
-
IndustryActionEnum["DELETE"] = "delete";
|
|
9
|
-
IndustryActionEnum["DEACTIVATE"] = "deactivate";
|
|
10
|
-
IndustryActionEnum["ACTIVATE"] = "activate";
|
|
11
|
-
IndustryActionEnum["RESTORE"] = "restore";
|
|
12
|
-
// APPROVE = "approve",
|
|
13
|
-
// REJECT = "reject",
|
|
14
|
-
// RECALL = "recall",
|
|
15
|
-
// REQUEST_CHANGES = "request_changes",
|
|
16
|
-
// CHANGES_DONE = "changes_done",
|
|
17
|
-
})(IndustryActionEnum || (exports.IndustryActionEnum = IndustryActionEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountryActionEnum = void 0;
|
|
4
|
+
var CountryActionEnum;
|
|
5
|
+
(function (CountryActionEnum) {
|
|
6
|
+
CountryActionEnum["CREATE"] = "create";
|
|
7
|
+
CountryActionEnum["UPDATE"] = "update";
|
|
8
|
+
CountryActionEnum["DELETE"] = "delete";
|
|
9
|
+
CountryActionEnum["DEACTIVATE"] = "deactivate";
|
|
10
|
+
CountryActionEnum["ACTIVATE"] = "activate";
|
|
11
|
+
CountryActionEnum["RESTORE"] = "restore";
|
|
12
|
+
// APPROVE = "approve",
|
|
13
|
+
// REJECT = "reject",
|
|
14
|
+
// RECALL = "recall",
|
|
15
|
+
// REQUEST_CHANGES = "request_changes",
|
|
16
|
+
// CHANGES_DONE = "changes_done",
|
|
17
|
+
})(CountryActionEnum || (exports.CountryActionEnum = CountryActionEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountryStatusEnum = void 0;
|
|
4
|
+
var CountryStatusEnum;
|
|
5
|
+
(function (CountryStatusEnum) {
|
|
6
|
+
CountryStatusEnum["APPROVED"] = "APPROVED";
|
|
7
|
+
CountryStatusEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
8
|
+
CountryStatusEnum["DELETED"] = "DELETED";
|
|
9
|
+
})(CountryStatusEnum || (exports.CountryStatusEnum = CountryStatusEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndustryActionEnum = void 0;
|
|
4
|
+
var IndustryActionEnum;
|
|
5
|
+
(function (IndustryActionEnum) {
|
|
6
|
+
IndustryActionEnum["CREATE"] = "create";
|
|
7
|
+
IndustryActionEnum["UPDATE"] = "update";
|
|
8
|
+
IndustryActionEnum["DELETE"] = "delete";
|
|
9
|
+
IndustryActionEnum["DEACTIVATE"] = "deactivate";
|
|
10
|
+
IndustryActionEnum["ACTIVATE"] = "activate";
|
|
11
|
+
IndustryActionEnum["RESTORE"] = "restore";
|
|
12
|
+
// APPROVE = "approve",
|
|
13
|
+
// REJECT = "reject",
|
|
14
|
+
// RECALL = "recall",
|
|
15
|
+
// REQUEST_CHANGES = "request_changes",
|
|
16
|
+
// CHANGES_DONE = "changes_done",
|
|
17
|
+
})(IndustryActionEnum || (exports.IndustryActionEnum = IndustryActionEnum = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CountryActionEnum } from "../enums/country.action.enum";
|
|
2
|
+
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
3
|
+
import { FlowConfig } from "./flow-config.type";
|
|
4
|
+
export interface ICountryFlowConfigContextData {
|
|
5
|
+
}
|
|
6
|
+
export declare const countryFlowConfig: FlowConfig<CountryStatusEnum, CountryActionEnum, ICountryFlowConfigContextData>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countryFlowConfig = void 0;
|
|
4
|
+
const country_action_enum_1 = require("../enums/country.action.enum");
|
|
5
|
+
const country_status_enum_1 = require("../enums/country_status_enum");
|
|
6
|
+
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
7
|
+
const COUNTRY_CREATE_PERMISSION = ["COUNTRY_CREATE"];
|
|
8
|
+
const COUNTRY_UPDATE_PERMISSION = ["COUNTRY_UPDATE"];
|
|
9
|
+
const COUNTRY_DELETE_PERMISSION = ["COUNTRY_DELETE"];
|
|
10
|
+
const COUNTRY_DEACTIVATE_PERMISSION = ["COUNTRY_DEACTIVATE"];
|
|
11
|
+
const COUNTRY_ACTIVATE_PERMISSION = ["COUNTRY_ACTIVATE"];
|
|
12
|
+
const COUNTRY_RESTORE_PERMISSION = ["COUNTRY_RESTORE"];
|
|
13
|
+
const ACTION_MAP = {
|
|
14
|
+
[country_action_enum_1.CountryActionEnum.CREATE]: {
|
|
15
|
+
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
16
|
+
permissions: COUNTRY_CREATE_PERMISSION,
|
|
17
|
+
},
|
|
18
|
+
[country_action_enum_1.CountryActionEnum.UPDATE]: {
|
|
19
|
+
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
20
|
+
permissions: COUNTRY_UPDATE_PERMISSION,
|
|
21
|
+
},
|
|
22
|
+
[country_action_enum_1.CountryActionEnum.DELETE]: {
|
|
23
|
+
reachableStatues: [country_status_enum_1.CountryStatusEnum.DELETED],
|
|
24
|
+
permissions: COUNTRY_DELETE_PERMISSION,
|
|
25
|
+
},
|
|
26
|
+
[country_action_enum_1.CountryActionEnum.DEACTIVATE]: {
|
|
27
|
+
reachableStatues: [country_status_enum_1.CountryStatusEnum.DEACTIVATED],
|
|
28
|
+
permissions: COUNTRY_DEACTIVATE_PERMISSION,
|
|
29
|
+
},
|
|
30
|
+
[country_action_enum_1.CountryActionEnum.ACTIVATE]: {
|
|
31
|
+
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
32
|
+
permissions: COUNTRY_ACTIVATE_PERMISSION,
|
|
33
|
+
},
|
|
34
|
+
[country_action_enum_1.CountryActionEnum.RESTORE]: {
|
|
35
|
+
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
36
|
+
permissions: COUNTRY_RESTORE_PERMISSION,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
|
+
// APPROVED status transitions
|
|
41
|
+
const transitionApprovedStatusUpdateAction = createActionConfig(country_action_enum_1.CountryActionEnum.UPDATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
42
|
+
const transitionApprovedStatusDeleteAction = createActionConfig(country_action_enum_1.CountryActionEnum.DELETE, country_status_enum_1.CountryStatusEnum.DELETED);
|
|
43
|
+
const transitionApprovedStatusDeactivateAction = createActionConfig(country_action_enum_1.CountryActionEnum.DEACTIVATE, country_status_enum_1.CountryStatusEnum.DEACTIVATED);
|
|
44
|
+
// DEACTIVATED status transitions
|
|
45
|
+
const transitionDeactivatedStatusDeleteAction = createActionConfig(country_action_enum_1.CountryActionEnum.DELETE, country_status_enum_1.CountryStatusEnum.DELETED);
|
|
46
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(country_action_enum_1.CountryActionEnum.ACTIVATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
47
|
+
// DELETED status transitions
|
|
48
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(country_action_enum_1.CountryActionEnum.UPDATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
49
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(country_action_enum_1.CountryActionEnum.RESTORE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
50
|
+
exports.countryFlowConfig = {
|
|
51
|
+
[country_status_enum_1.CountryStatusEnum.APPROVED]: {
|
|
52
|
+
actions: {
|
|
53
|
+
[country_action_enum_1.CountryActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
54
|
+
[country_action_enum_1.CountryActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
55
|
+
[country_action_enum_1.CountryActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
[country_status_enum_1.CountryStatusEnum.DEACTIVATED]: {
|
|
59
|
+
actions: {
|
|
60
|
+
[country_action_enum_1.CountryActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
61
|
+
[country_action_enum_1.CountryActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
[country_status_enum_1.CountryStatusEnum.DELETED]: {
|
|
65
|
+
actions: {
|
|
66
|
+
[country_action_enum_1.CountryActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
67
|
+
[country_action_enum_1.CountryActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
|
-
import { IndustryActionEnum } from "
|
|
2
|
+
import { IndustryActionEnum } from "../enums/industry.action.enum";
|
|
3
3
|
import { IndustryStatusEnum } from "../enums/industry_status_enum";
|
|
4
4
|
export interface IIndustryFlowConfigContextData {
|
|
5
5
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.industryFlowConfig = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
|
-
const
|
|
5
|
+
const industry_action_enum_1 = require("../enums/industry.action.enum");
|
|
6
6
|
const industry_status_enum_1 = require("../enums/industry_status_enum");
|
|
7
7
|
const INDUSTRY_CREATE_PERMISSION = ["INDUSTRY_CREATE"];
|
|
8
8
|
const INDUSTRY_UPDATE_PERMISSION = ["INDUSTRY_UPDATE"];
|
|
@@ -11,60 +11,60 @@ const INDUSTRY_DEACTIVATE_PERMISSION = ["INDUSTRY_DEACTIVATE"];
|
|
|
11
11
|
const INDUSTRY_ACTIVATE_PERMISSION = ["INDUSTRY_ACTIVATE"];
|
|
12
12
|
const INDUSTRY_RESTORE_PERMISSION = ["INDUSTRY_RESTORE"];
|
|
13
13
|
const ACTION_MAP = {
|
|
14
|
-
[
|
|
14
|
+
[industry_action_enum_1.IndustryActionEnum.CREATE]: {
|
|
15
15
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
16
16
|
permissions: INDUSTRY_CREATE_PERMISSION,
|
|
17
17
|
},
|
|
18
|
-
[
|
|
18
|
+
[industry_action_enum_1.IndustryActionEnum.UPDATE]: {
|
|
19
19
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
20
20
|
permissions: INDUSTRY_UPDATE_PERMISSION,
|
|
21
21
|
},
|
|
22
|
-
[
|
|
22
|
+
[industry_action_enum_1.IndustryActionEnum.DELETE]: {
|
|
23
23
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.DELETED],
|
|
24
24
|
permissions: INDUSTRY_DELETE_PERMISSION,
|
|
25
25
|
},
|
|
26
|
-
[
|
|
26
|
+
[industry_action_enum_1.IndustryActionEnum.DEACTIVATE]: {
|
|
27
27
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.DEACTIVATED],
|
|
28
28
|
permissions: INDUSTRY_DEACTIVATE_PERMISSION,
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[industry_action_enum_1.IndustryActionEnum.ACTIVATE]: {
|
|
31
31
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
32
32
|
permissions: INDUSTRY_ACTIVATE_PERMISSION,
|
|
33
33
|
},
|
|
34
|
-
[
|
|
34
|
+
[industry_action_enum_1.IndustryActionEnum.RESTORE]: {
|
|
35
35
|
reachableStatues: [industry_status_enum_1.IndustryStatusEnum.APPROVED],
|
|
36
36
|
permissions: INDUSTRY_RESTORE_PERMISSION,
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
40
|
// APPROVED status transitions
|
|
41
|
-
const transitionApprovedStatusUpdateAction = createActionConfig(
|
|
42
|
-
const transitionApprovedStatusDeleteAction = createActionConfig(
|
|
43
|
-
const transitionApprovedStatusDeactivateAction = createActionConfig(
|
|
41
|
+
const transitionApprovedStatusUpdateAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.UPDATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
42
|
+
const transitionApprovedStatusDeleteAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.DELETE, industry_status_enum_1.IndustryStatusEnum.DELETED);
|
|
43
|
+
const transitionApprovedStatusDeactivateAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.DEACTIVATE, industry_status_enum_1.IndustryStatusEnum.DEACTIVATED);
|
|
44
44
|
// DEACTIVATED status transitions
|
|
45
|
-
const transitionDeactivatedStatusDeleteAction = createActionConfig(
|
|
46
|
-
const transitionDeactivatedStatusActivateAction = createActionConfig(
|
|
45
|
+
const transitionDeactivatedStatusDeleteAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.DELETE, industry_status_enum_1.IndustryStatusEnum.DELETED);
|
|
46
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.ACTIVATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
47
47
|
// DELETED status transitions
|
|
48
|
-
const transitionDeletedStatusUpdateAction = createActionConfig(
|
|
49
|
-
const transitionDeletedStatusRestoreAction = createActionConfig(
|
|
48
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.UPDATE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
49
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(industry_action_enum_1.IndustryActionEnum.RESTORE, industry_status_enum_1.IndustryStatusEnum.APPROVED);
|
|
50
50
|
exports.industryFlowConfig = {
|
|
51
51
|
[industry_status_enum_1.IndustryStatusEnum.APPROVED]: {
|
|
52
52
|
actions: {
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
53
|
+
[industry_action_enum_1.IndustryActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
54
|
+
[industry_action_enum_1.IndustryActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
55
|
+
[industry_action_enum_1.IndustryActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
[industry_status_enum_1.IndustryStatusEnum.DEACTIVATED]: {
|
|
59
59
|
actions: {
|
|
60
|
-
[
|
|
61
|
-
[
|
|
60
|
+
[industry_action_enum_1.IndustryActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
61
|
+
[industry_action_enum_1.IndustryActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
[industry_status_enum_1.IndustryStatusEnum.DELETED]: {
|
|
65
65
|
actions: {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
66
|
+
[industry_action_enum_1.IndustryActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
67
|
+
[industry_action_enum_1.IndustryActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
};
|
|
@@ -59,6 +59,9 @@ export * from "./enums/work.from.home.action.enum";
|
|
|
59
59
|
export * from "./enums/work.from.home.status.enum";
|
|
60
60
|
export * from "./interface/work_from_home.entity.interface";
|
|
61
61
|
export * from "./interface/work_from_home_history.entity.interface";
|
|
62
|
+
export * from "./enums/country.action.enum";
|
|
63
|
+
export * from "./enums/country_status_enum";
|
|
64
|
+
export * from "./flow-configs/country_flow.config";
|
|
62
65
|
export * from "./interface/country.entity.interface";
|
|
63
66
|
export * from "./enums/billing_invoice_type.enum";
|
|
64
67
|
export * from "./interface/billing_timesheet.entity.interface";
|
|
@@ -265,6 +268,7 @@ export * from "./interface/debit_note_sequence_generator.entity.interface";
|
|
|
265
268
|
export * from "./model/debit_note_sequence_generator.entity.model";
|
|
266
269
|
export * from "./enums/client_debit_note_gst_visible_enum";
|
|
267
270
|
export * from "./enums/client_debit_note_pan_visible_enum";
|
|
271
|
+
export * from "./enums/industry.action.enum";
|
|
268
272
|
export * from "./enums/industry_status_enum";
|
|
269
273
|
export * from "./flow-configs/industry_flow.config";
|
|
270
274
|
export * from "./interface/industry.entity.interface";
|
|
@@ -272,5 +276,6 @@ export * from "./model/industry.entity.model";
|
|
|
272
276
|
export * from "./enums/task.action.enum";
|
|
273
277
|
export * from "./enums/task_status_enum";
|
|
274
278
|
export * from "./flow-configs/task_flow.config";
|
|
279
|
+
export * from "./interface/field-constraint/country_field_constraints.interface";
|
|
275
280
|
export * from "./interface/field-constraint/industry_field_constraints.interface";
|
|
276
281
|
export * from "./interface/field-constraint/task_field_constraints.interface";
|
|
@@ -75,6 +75,9 @@ __exportStar(require("./enums/work.from.home.action.enum"), exports);
|
|
|
75
75
|
__exportStar(require("./enums/work.from.home.status.enum"), exports);
|
|
76
76
|
__exportStar(require("./interface/work_from_home.entity.interface"), exports);
|
|
77
77
|
__exportStar(require("./interface/work_from_home_history.entity.interface"), exports);
|
|
78
|
+
__exportStar(require("./enums/country.action.enum"), exports);
|
|
79
|
+
__exportStar(require("./enums/country_status_enum"), exports);
|
|
80
|
+
__exportStar(require("./flow-configs/country_flow.config"), exports);
|
|
78
81
|
__exportStar(require("./interface/country.entity.interface"), exports);
|
|
79
82
|
__exportStar(require("./enums/billing_invoice_type.enum"), exports);
|
|
80
83
|
__exportStar(require("./interface/billing_timesheet.entity.interface"), exports);
|
|
@@ -282,6 +285,7 @@ __exportStar(require("./interface/debit_note_sequence_generator.entity.interface
|
|
|
282
285
|
__exportStar(require("./model/debit_note_sequence_generator.entity.model"), exports);
|
|
283
286
|
__exportStar(require("./enums/client_debit_note_gst_visible_enum"), exports);
|
|
284
287
|
__exportStar(require("./enums/client_debit_note_pan_visible_enum"), exports);
|
|
288
|
+
__exportStar(require("./enums/industry.action.enum"), exports);
|
|
285
289
|
__exportStar(require("./enums/industry_status_enum"), exports);
|
|
286
290
|
__exportStar(require("./flow-configs/industry_flow.config"), exports);
|
|
287
291
|
__exportStar(require("./interface/industry.entity.interface"), exports);
|
|
@@ -289,5 +293,6 @@ __exportStar(require("./model/industry.entity.model"), exports);
|
|
|
289
293
|
__exportStar(require("./enums/task.action.enum"), exports);
|
|
290
294
|
__exportStar(require("./enums/task_status_enum"), exports);
|
|
291
295
|
__exportStar(require("./flow-configs/task_flow.config"), exports);
|
|
296
|
+
__exportStar(require("./interface/field-constraint/country_field_constraints.interface"), exports);
|
|
292
297
|
__exportStar(require("./interface/field-constraint/industry_field_constraints.interface"), exports);
|
|
293
298
|
__exportStar(require("./interface/field-constraint/task_field_constraints.interface"), exports);
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
1
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
3
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
3
4
|
export interface ICountryEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
name: string;
|
|
7
|
+
status: CountryStatusEnum;
|
|
6
8
|
}
|
|
7
|
-
export
|
|
9
|
+
export type ICountryCreateDtoExclude = "status";
|
|
10
|
+
export interface ICountryEntityCreateDto extends Omit<IEntityCreateDto<ICountryEntity>, ICountryCreateDtoExclude> {
|
|
8
11
|
}
|
|
9
|
-
export interface ICountryEntityUpdateDto extends IEntityUpdateDto<ICountryEntity> {
|
|
12
|
+
export interface ICountryEntityUpdateDto extends Omit<IEntityUpdateDto<ICountryEntity>, ICountryCreateDtoExclude> {
|
|
10
13
|
}
|
|
11
14
|
export type ICountryEntityFilterData = IEntityFilterData<ICountryEntity>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICountryEntity } from "../country.entity.interface";
|
|
2
|
+
import { IEntityAuditColumn } from "../entity-audit-columns.interface";
|
|
3
|
+
import { IFieldMinMaxConstraint } from "./utils";
|
|
4
|
+
export type ICountryFieldLengthConstraintsExclude = "status" | "id" | keyof IEntityAuditColumn;
|
|
5
|
+
export type ICountryFieldLengthConstraints = {
|
|
6
|
+
[K in keyof Omit<ICountryEntity, ICountryFieldLengthConstraintsExclude>]-?: IFieldMinMaxConstraint;
|
|
7
|
+
};
|
|
8
|
+
export declare const countryFieldMinMaxConstraints: ICountryFieldLengthConstraints;
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
+
import { CountryActionEnum } from "../enums/country.action.enum";
|
|
2
|
+
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
3
|
+
import { ICountryFlowConfigContextData } from "../flow-configs/country_flow.config";
|
|
1
4
|
import { ICountryEntity } from "../interface/country.entity.interface";
|
|
2
|
-
|
|
5
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
6
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
7
|
+
import { IUserEntity } from "../interface/user.entity.interface";
|
|
8
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
9
|
+
import { IRowActions } from "./interface/row-actions.interface";
|
|
10
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
11
|
+
export declare class CountryEntityModel extends BaseEntityModel<EntityEnum.COUNTRY> implements ICountryEntity {
|
|
3
12
|
id: number;
|
|
4
13
|
name: string;
|
|
14
|
+
status: CountryStatusEnum;
|
|
5
15
|
createdBy: number;
|
|
6
16
|
updatedBy: number;
|
|
7
17
|
createdOn: number;
|
|
8
18
|
updatedOn: number;
|
|
9
|
-
|
|
10
|
-
static
|
|
19
|
+
static fromEntity(entity: ICountryEntity): CountryEntityModel;
|
|
20
|
+
static relationConfigs: RelationConfigs<[], EntityEnum.COUNTRY>;
|
|
21
|
+
getRelationConfigs(): any[];
|
|
22
|
+
getNextStatus(currentUser: IUserEntity, action: CountryActionEnum, countryFlowConfigContextData: ICountryFlowConfigContextData): CountryStatusEnum;
|
|
23
|
+
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
24
|
+
combinedActions?: Record<string, {
|
|
25
|
+
combineActions: CountryActionEnum[];
|
|
26
|
+
label: string;
|
|
27
|
+
}>;
|
|
28
|
+
customLabels?: Partial<Record<CountryActionEnum, string>>;
|
|
29
|
+
}): IRowActions<EntityEnum.COUNTRY>[];
|
|
30
|
+
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
31
|
+
[key: string]: () => boolean;
|
|
32
|
+
};
|
|
11
33
|
}
|
|
@@ -1,21 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import { ICountryApiEntity } from "../../api";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.CountryEntityModel = void 0;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const enums_1 = require("../../enums");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const country_status_enum_1 = require("../enums/country_status_enum");
|
|
8
|
+
const country_flow_config_1 = require("../flow-configs/country_flow.config");
|
|
9
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
10
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
11
|
+
class CountryEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
7
14
|
this.id = 0;
|
|
8
15
|
this.name = "";
|
|
16
|
+
this.status = country_status_enum_1.CountryStatusEnum.APPROVED;
|
|
9
17
|
this.createdBy = 0;
|
|
10
18
|
this.updatedBy = 0;
|
|
11
19
|
this.createdOn = 0;
|
|
12
20
|
this.updatedOn = 0;
|
|
13
|
-
Object.assign(this, data);
|
|
14
21
|
}
|
|
15
|
-
static
|
|
16
|
-
const
|
|
17
|
-
Object.assign(
|
|
18
|
-
return
|
|
22
|
+
static fromEntity(entity) {
|
|
23
|
+
const model = new CountryEntityModel(entity_utils_interface_1.EntityEnum.COUNTRY);
|
|
24
|
+
Object.assign(model, entity);
|
|
25
|
+
return model;
|
|
26
|
+
}
|
|
27
|
+
getRelationConfigs() {
|
|
28
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
|
+
}
|
|
30
|
+
getNextStatus(currentUser, action, countryFlowConfigContextData) {
|
|
31
|
+
if (!this.status) {
|
|
32
|
+
throw new exceptions_1.AppBadRequestException({
|
|
33
|
+
key: enums_1.ErrorKeyEnum.STATUS,
|
|
34
|
+
message: [`Status not found: ${this.status}`],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const flowForStatus = country_flow_config_1.countryFlowConfig[this.status];
|
|
38
|
+
if (!flowForStatus) {
|
|
39
|
+
throw new exceptions_1.AppBadRequestException({
|
|
40
|
+
key: enums_1.ErrorKeyEnum.STATUS,
|
|
41
|
+
message: [`No flow configuration found for status: ${this.status}`],
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (!action) {
|
|
45
|
+
throw new exceptions_1.AppBadRequestException({
|
|
46
|
+
key: enums_1.ErrorKeyEnum.ACTION_DATA,
|
|
47
|
+
message: ["actionData is required"],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const matchingPermissionConfig = flowForStatus.actions[action];
|
|
51
|
+
if (!matchingPermissionConfig) {
|
|
52
|
+
throw new exceptions_1.AppBadRequestException({
|
|
53
|
+
key: enums_1.ErrorKeyEnum.ACTION,
|
|
54
|
+
message: [`Action '${action}' is not valid for the current status.`],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
58
|
+
throw new exceptions_1.AppBadRequestException({
|
|
59
|
+
key: enums_1.ErrorKeyEnum.PERMISSIONS,
|
|
60
|
+
message: ["Permission not available for currentUser"],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
|
|
64
|
+
if (!hasPermission) {
|
|
65
|
+
throw new exceptions_1.AppBadRequestException({
|
|
66
|
+
key: enums_1.ErrorKeyEnum.PERMISSION,
|
|
67
|
+
message: [`Current user does not have permission to ${action} country`],
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const nextStatus = matchingPermissionConfig.next(countryFlowConfigContextData);
|
|
71
|
+
return nextStatus;
|
|
72
|
+
}
|
|
73
|
+
getAvailableActions(currentUser, config) {
|
|
74
|
+
var _a;
|
|
75
|
+
const params = {
|
|
76
|
+
flowConfig: country_flow_config_1.countryFlowConfig,
|
|
77
|
+
currentStatus: this.status,
|
|
78
|
+
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
79
|
+
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
80
|
+
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
81
|
+
customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
|
|
82
|
+
};
|
|
83
|
+
return utils_1.EntityActionFlowResolverV2.getAvailableActionsData(params);
|
|
84
|
+
}
|
|
85
|
+
getUpdateActionVisibility(currentUser) {
|
|
86
|
+
return {};
|
|
19
87
|
}
|
|
20
88
|
}
|
|
21
89
|
exports.CountryEntityModel = CountryEntityModel;
|
|
90
|
+
CountryEntityModel.relationConfigs = [];
|
|
@@ -146,7 +146,7 @@ exports.entityEnumToEntityModel = {
|
|
|
146
146
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET_HISTORY]: billing_timesheet_history_entity_model_1.BillingTimesheetHistoryEntityModel.fromEntity,
|
|
147
147
|
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
148
148
|
[entity_utils_interface_1.EntityEnum.TIMESHEET_HISTORY]: timesheet_history_entity_model_1.TimesheetHistoryEntityModel.fromEntity,
|
|
149
|
-
[entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.
|
|
149
|
+
[entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.fromEntity,
|
|
150
150
|
[entity_utils_interface_1.EntityEnum.ADDRESS_BOOK]: address_book_model_1.AddressBookEntityModel.fromEntity,
|
|
151
151
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
152
152
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION_HISTORY]: billing_transaction_history_entity_model_1.BillingTransactionHistoryEntityModel.fromEntity,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
3
2
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
3
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
5
|
-
import {
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
6
5
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
7
|
-
import {
|
|
6
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
7
|
+
import { IndustryActionEnum } from "../enums/industry.action.enum";
|
|
8
8
|
import { IndustryStatusEnum } from "../enums/industry_status_enum";
|
|
9
|
-
import { IndustryActionEnum } from "../../api";
|
|
10
9
|
import { IIndustryFlowConfigContextData } from "../flow-configs/industry_flow.config";
|
|
10
|
+
import { IIndustryEntity } from "../interface/industry.entity.interface";
|
|
11
11
|
export declare class IndustryEntityModel extends BaseEntityModel<EntityEnum.INDUSTRY> implements IIndustryEntity {
|
|
12
12
|
id: number;
|
|
13
13
|
name: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IndustryEntityModel = void 0;
|
|
4
|
-
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
-
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
-
const exceptions_1 = require("../../exceptions");
|
|
7
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
8
6
|
const utils_1 = require("../../utils");
|
|
7
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
8
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
9
9
|
const industry_status_enum_1 = require("../enums/industry_status_enum");
|
|
10
10
|
const industry_flow_config_1 = require("../flow-configs/industry_flow.config");
|
|
11
11
|
class IndustryEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -67,7 +67,7 @@ class TaskEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
67
67
|
if (!hasPermission) {
|
|
68
68
|
throw new exceptions_1.AppBadRequestException({
|
|
69
69
|
key: enums_1.ErrorKeyEnum.PERMISSION,
|
|
70
|
-
message: [`Current user does not have permission to ${action}
|
|
70
|
+
message: [`Current user does not have permission to ${action} task.`],
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
const nextStatus = matchingPermissionConfig.next(taskFlowConfigContextData);
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "12.6.3-beta.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"publish:beta": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta",
|
|
13
|
-
"publish:beta:link": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta && npm run link",
|
|
14
|
-
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
15
|
-
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
16
|
-
"publish:major": "npm verYsion major && git push && npm run build && npm publish",
|
|
17
|
-
"link": "npm run build && npm link",
|
|
18
|
-
"link:backend": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-common",
|
|
19
|
-
"link:frontend": "npm run build && npm link && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
20
|
-
"link:both": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
21
|
-
"test": "jest",
|
|
22
|
-
"format": "prettier --write .",
|
|
23
|
-
"check-format": "prettier --check .",
|
|
24
|
-
"pull:link": "git pull && npm run link",
|
|
25
|
-
"check-version": "npm view law-common versions --json | jq -r '.[-1]'",
|
|
26
|
-
"script:publish": "node scripts/publish.js",
|
|
27
|
-
"script:publish:latest:beta": "npm run build && node scripts/publish.js prerelease beta && git push",
|
|
28
|
-
"script:publish:latest:patch": "npm run build && node scripts/publish.js patch && git push",
|
|
29
|
-
"script:nobuild:publish:latest:beta": "node scripts/publish.js prerelease beta && git push",
|
|
30
|
-
"install:version": "node scripts/install-version.js",
|
|
31
|
-
"script:publish:install:beta": "node scripts/publish-and-install.js prerelease beta",
|
|
32
|
-
"script:publish:install:patch": "node scripts/publish-and-install.js patch",
|
|
33
|
-
"script:publish:install:minor": "node scripts/publish-and-install.js minor",
|
|
34
|
-
"script:publish:install:major": "node scripts/publish-and-install.js major"
|
|
35
|
-
},
|
|
36
|
-
"keywords": [],
|
|
37
|
-
"author": "",
|
|
38
|
-
"license": "ISC",
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/jest": "^29.5.13",
|
|
41
|
-
"@types/lodash": "^4.17.21",
|
|
42
|
-
"@types/node": "^22.6.1",
|
|
43
|
-
"jest": "^29.7.0",
|
|
44
|
-
"prettier": "3.8.1",
|
|
45
|
-
"semver": "^7.8.1",
|
|
46
|
-
"ts-jest": "^29.2.5",
|
|
47
|
-
"ts-node": "^10.9.2",
|
|
48
|
-
"typescript": "^5.6.2"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@types/express": "^5.0.0",
|
|
52
|
-
"@types/multer": "^1.4.12",
|
|
53
|
-
"date-fns": "^4.1.0",
|
|
54
|
-
"lodash": "4.17.21"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "12.6.3-beta.15",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"publish:beta": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta",
|
|
13
|
+
"publish:beta:link": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta && npm run link",
|
|
14
|
+
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
15
|
+
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
16
|
+
"publish:major": "npm verYsion major && git push && npm run build && npm publish",
|
|
17
|
+
"link": "npm run build && npm link",
|
|
18
|
+
"link:backend": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-common",
|
|
19
|
+
"link:frontend": "npm run build && npm link && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
20
|
+
"link:both": "npm run build && npm link && cd ../law-backend && npm link law-common && cd ../law-admin-web && npm link law-common && cd ../law-common",
|
|
21
|
+
"test": "jest",
|
|
22
|
+
"format": "prettier --write .",
|
|
23
|
+
"check-format": "prettier --check .",
|
|
24
|
+
"pull:link": "git pull && npm run link",
|
|
25
|
+
"check-version": "npm view law-common versions --json | jq -r '.[-1]'",
|
|
26
|
+
"script:publish": "node scripts/publish.js",
|
|
27
|
+
"script:publish:latest:beta": "npm run build && node scripts/publish.js prerelease beta && git push",
|
|
28
|
+
"script:publish:latest:patch": "npm run build && node scripts/publish.js patch && git push",
|
|
29
|
+
"script:nobuild:publish:latest:beta": "node scripts/publish.js prerelease beta && git push",
|
|
30
|
+
"install:version": "node scripts/install-version.js",
|
|
31
|
+
"script:publish:install:beta": "node scripts/publish-and-install.js prerelease beta",
|
|
32
|
+
"script:publish:install:patch": "node scripts/publish-and-install.js patch",
|
|
33
|
+
"script:publish:install:minor": "node scripts/publish-and-install.js minor",
|
|
34
|
+
"script:publish:install:major": "node scripts/publish-and-install.js major"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [],
|
|
37
|
+
"author": "",
|
|
38
|
+
"license": "ISC",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/jest": "^29.5.13",
|
|
41
|
+
"@types/lodash": "^4.17.21",
|
|
42
|
+
"@types/node": "^22.6.1",
|
|
43
|
+
"jest": "^29.7.0",
|
|
44
|
+
"prettier": "3.8.1",
|
|
45
|
+
"semver": "^7.8.1",
|
|
46
|
+
"ts-jest": "^29.2.5",
|
|
47
|
+
"ts-node": "^10.9.2",
|
|
48
|
+
"typescript": "^5.6.2"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@types/express": "^5.0.0",
|
|
52
|
+
"@types/multer": "^1.4.12",
|
|
53
|
+
"date-fns": "^4.1.0",
|
|
54
|
+
"lodash": "4.17.21"
|
|
55
|
+
}
|
|
56
|
+
}
|