@lucaapp/service-utils 4.4.3 → 4.6.0
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/lib/kafka/events/locationGroup.d.ts +4 -2
- package/dist/lib/kafka/events.d.ts +7 -0
- package/dist/lib/kafka/events.js +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/organization.d.ts +90 -0
- package/dist/types/organization.js +17 -0
- package/package.json +4 -4
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type LocationGroup = {
|
|
2
2
|
uuid: string;
|
|
3
|
+
name: string;
|
|
3
4
|
discoverId: string;
|
|
4
|
-
operatorId?: string | null;
|
|
5
5
|
discoveryEnabled: boolean;
|
|
6
|
+
operatorId?: string | null;
|
|
7
|
+
baseLocationId?: string | null;
|
|
6
8
|
createdAt: Date;
|
|
7
9
|
updatedAt: Date;
|
|
8
|
-
|
|
10
|
+
deletedAt?: Date | null;
|
|
9
11
|
};
|
|
@@ -14,6 +14,7 @@ import { OperatorLocationGroup } from '../../types/operatorLocationGroup';
|
|
|
14
14
|
import { PaymentSyncError } from './events/paymentSyncError';
|
|
15
15
|
import { OperatorDevice } from './events/operatorDevice';
|
|
16
16
|
import { OperatorPay } from './events/operatorPay';
|
|
17
|
+
import { Organization, OperatorOrganization } from '../../types/organization';
|
|
17
18
|
declare enum KafkaTopic {
|
|
18
19
|
PAYMENTS = "payments",
|
|
19
20
|
CONSUMERS = "consumers",
|
|
@@ -23,6 +24,8 @@ declare enum KafkaTopic {
|
|
|
23
24
|
LOCATIONS = "locations",
|
|
24
25
|
LOCATION_GROUPS = "location_groups",
|
|
25
26
|
OPERATOR_LOCATION_GROUPS = "operator_location_groups",
|
|
27
|
+
ORGANIZATIONS = "organizations",
|
|
28
|
+
OPERATOR_ORGANIZATIONS = "operator_organizations",
|
|
26
29
|
LOCATION_GROUP_EMPLOYEES = "location_group_employees",
|
|
27
30
|
RESERVATIONS = "reservations",
|
|
28
31
|
RESERVATION_FEES = "reservation_fees",
|
|
@@ -42,6 +45,8 @@ type MessageFormats = {
|
|
|
42
45
|
[KafkaTopic.LOCATIONS]: Location;
|
|
43
46
|
[KafkaTopic.LOCATION_GROUPS]: LocationGroup;
|
|
44
47
|
[KafkaTopic.OPERATOR_LOCATION_GROUPS]: OperatorLocationGroup;
|
|
48
|
+
[KafkaTopic.ORGANIZATIONS]: Organization;
|
|
49
|
+
[KafkaTopic.OPERATOR_ORGANIZATIONS]: OperatorOrganization;
|
|
45
50
|
[KafkaTopic.LOCATION_GROUP_EMPLOYEES]: LocationGroupEmployees;
|
|
46
51
|
[KafkaTopic.RESERVATIONS]: Reservation;
|
|
47
52
|
[KafkaTopic.RESERVATION_FEES]: ReservationFee;
|
|
@@ -61,6 +66,8 @@ declare const MessageIssuer: {
|
|
|
61
66
|
locations: Service;
|
|
62
67
|
location_groups: Service;
|
|
63
68
|
operator_location_groups: Service;
|
|
69
|
+
organizations: Service;
|
|
70
|
+
operator_organizations: Service;
|
|
64
71
|
location_group_employees: Service;
|
|
65
72
|
reservations: Service;
|
|
66
73
|
reservation_fees: Service;
|
package/dist/lib/kafka/events.js
CHANGED
|
@@ -12,6 +12,8 @@ var KafkaTopic;
|
|
|
12
12
|
KafkaTopic["LOCATIONS"] = "locations";
|
|
13
13
|
KafkaTopic["LOCATION_GROUPS"] = "location_groups";
|
|
14
14
|
KafkaTopic["OPERATOR_LOCATION_GROUPS"] = "operator_location_groups";
|
|
15
|
+
KafkaTopic["ORGANIZATIONS"] = "organizations";
|
|
16
|
+
KafkaTopic["OPERATOR_ORGANIZATIONS"] = "operator_organizations";
|
|
15
17
|
KafkaTopic["LOCATION_GROUP_EMPLOYEES"] = "location_group_employees";
|
|
16
18
|
KafkaTopic["RESERVATIONS"] = "reservations";
|
|
17
19
|
KafkaTopic["RESERVATION_FEES"] = "reservation_fees";
|
|
@@ -31,6 +33,8 @@ const MessageIssuer = {
|
|
|
31
33
|
[KafkaTopic.LOCATIONS]: serviceIdentity_1.Service.BACKEND,
|
|
32
34
|
[KafkaTopic.LOCATION_GROUPS]: serviceIdentity_1.Service.BACKEND,
|
|
33
35
|
[KafkaTopic.OPERATOR_LOCATION_GROUPS]: serviceIdentity_1.Service.BACKEND,
|
|
36
|
+
[KafkaTopic.ORGANIZATIONS]: serviceIdentity_1.Service.BACKEND,
|
|
37
|
+
[KafkaTopic.OPERATOR_ORGANIZATIONS]: serviceIdentity_1.Service.BACKEND,
|
|
34
38
|
[KafkaTopic.LOCATION_GROUP_EMPLOYEES]: serviceIdentity_1.Service.BACKEND,
|
|
35
39
|
[KafkaTopic.RESERVATIONS]: serviceIdentity_1.Service.BACKEND,
|
|
36
40
|
[KafkaTopic.RESERVATION_FEES]: serviceIdentity_1.Service.BACKEND_PAY,
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./http"), exports);
|
|
18
18
|
__exportStar(require("./operatorLocationGroup"), exports);
|
|
19
|
+
__exportStar(require("./organization"), exports);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export declare enum OrganizationType {
|
|
2
|
+
COMPANY = "COMPANY",
|
|
3
|
+
DIVISION = "DIVISION",
|
|
4
|
+
REGION = "REGION",
|
|
5
|
+
DEPARTMENT = "DEPARTMENT",
|
|
6
|
+
TEAM = "TEAM"
|
|
7
|
+
}
|
|
8
|
+
export declare enum InheritanceType {
|
|
9
|
+
DIRECT = "DIRECT",
|
|
10
|
+
INHERITED_ORG = "INHERITED_ORG",
|
|
11
|
+
INHERITED_PARENT = "INHERITED_PARENT"
|
|
12
|
+
}
|
|
13
|
+
export type OrganizationSettings = {
|
|
14
|
+
allowSelfRegistration?: boolean;
|
|
15
|
+
defaultLocationGroupSettings?: Record<string, unknown>;
|
|
16
|
+
paymentSettings?: {
|
|
17
|
+
enablePayments?: boolean;
|
|
18
|
+
defaultPaymentMethods?: string[];
|
|
19
|
+
requireKYB?: boolean;
|
|
20
|
+
};
|
|
21
|
+
reportingSettings?: {
|
|
22
|
+
consolidatedReporting?: boolean;
|
|
23
|
+
parentReportAccess?: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type Organization = {
|
|
27
|
+
uuid: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
organizationType: OrganizationType;
|
|
31
|
+
parentOrganizationId?: string;
|
|
32
|
+
path: string;
|
|
33
|
+
level: number;
|
|
34
|
+
leftValue?: number;
|
|
35
|
+
rightValue?: number;
|
|
36
|
+
settings?: OrganizationSettings;
|
|
37
|
+
isActive: boolean;
|
|
38
|
+
tenantId?: string;
|
|
39
|
+
createdAt: Date;
|
|
40
|
+
updatedAt: Date;
|
|
41
|
+
deletedAt?: Date;
|
|
42
|
+
};
|
|
43
|
+
export type OrganizationWithRelations = Organization & {
|
|
44
|
+
parent?: Organization;
|
|
45
|
+
children?: Organization[];
|
|
46
|
+
locationGroups?: Array<{
|
|
47
|
+
uuid: string;
|
|
48
|
+
name: string;
|
|
49
|
+
inheritSettings: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
};
|
|
52
|
+
export type OperatorOrganization = {
|
|
53
|
+
uuid: string;
|
|
54
|
+
operatorId: string;
|
|
55
|
+
organizationId: string;
|
|
56
|
+
role: string;
|
|
57
|
+
inheritToChildren: boolean;
|
|
58
|
+
inheritToLocationGroups: boolean;
|
|
59
|
+
createdAt: Date;
|
|
60
|
+
updatedAt: Date;
|
|
61
|
+
};
|
|
62
|
+
export type OperatorLocationGroupWithContext = {
|
|
63
|
+
uuid: string;
|
|
64
|
+
operatorId: string;
|
|
65
|
+
locationGroupId: string;
|
|
66
|
+
role: string;
|
|
67
|
+
sourceOrganizationId?: string;
|
|
68
|
+
inheritanceType: InheritanceType;
|
|
69
|
+
createdAt: Date;
|
|
70
|
+
updatedAt: Date;
|
|
71
|
+
};
|
|
72
|
+
export type OrganizationPermissionContext = {
|
|
73
|
+
organizationId: string;
|
|
74
|
+
organizationPath: string;
|
|
75
|
+
organizationName: string;
|
|
76
|
+
level: number;
|
|
77
|
+
hasChildren: boolean;
|
|
78
|
+
locationGroupIds: string[];
|
|
79
|
+
parentOrganizationId?: string;
|
|
80
|
+
};
|
|
81
|
+
export type OrganizationTreeNode = {
|
|
82
|
+
organization: Organization;
|
|
83
|
+
children: OrganizationTreeNode[];
|
|
84
|
+
permissions?: {
|
|
85
|
+
canRead: boolean;
|
|
86
|
+
canWrite: boolean;
|
|
87
|
+
canDelete: boolean;
|
|
88
|
+
canManageChildren: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InheritanceType = exports.OrganizationType = void 0;
|
|
4
|
+
var OrganizationType;
|
|
5
|
+
(function (OrganizationType) {
|
|
6
|
+
OrganizationType["COMPANY"] = "COMPANY";
|
|
7
|
+
OrganizationType["DIVISION"] = "DIVISION";
|
|
8
|
+
OrganizationType["REGION"] = "REGION";
|
|
9
|
+
OrganizationType["DEPARTMENT"] = "DEPARTMENT";
|
|
10
|
+
OrganizationType["TEAM"] = "TEAM";
|
|
11
|
+
})(OrganizationType || (exports.OrganizationType = OrganizationType = {}));
|
|
12
|
+
var InheritanceType;
|
|
13
|
+
(function (InheritanceType) {
|
|
14
|
+
InheritanceType["DIRECT"] = "DIRECT";
|
|
15
|
+
InheritanceType["INHERITED_ORG"] = "INHERITED_ORG";
|
|
16
|
+
InheritanceType["INHERITED_PARENT"] = "INHERITED_PARENT";
|
|
17
|
+
})(InheritanceType || (exports.InheritanceType = InheritanceType = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucaapp/service-utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/node": "22.13.11",
|
|
29
29
|
"@types/response-time": "^2.3.9",
|
|
30
30
|
"@types/swagger-ui-express": "4.1.8",
|
|
31
|
-
"axios": "^1.12.
|
|
31
|
+
"axios": "^1.12.2",
|
|
32
32
|
"axios-rate-limit": "^1.4.0",
|
|
33
33
|
"axios-retry": "^4.5.0",
|
|
34
34
|
"body-parser": "^2.2.0",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"cookie": ">= 1.0.2",
|
|
88
88
|
"string-width": "4.2.3",
|
|
89
89
|
"@types/express": "4.17.23",
|
|
90
|
-
"esbuild": "^0.25.
|
|
91
|
-
"axios": "^1.12.
|
|
90
|
+
"esbuild": "^0.25.10",
|
|
91
|
+
"axios": "^1.12.2",
|
|
92
92
|
"vite": "6.2.5"
|
|
93
93
|
}
|
|
94
94
|
}
|