@viridial/shared 1.0.11 → 1.0.12
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/organization.service.d.ts +18 -38
- package/dist/api/organization.service.d.ts.map +1 -1
- package/dist/api/organization.service.js +15 -21
- package/dist/api/user.service.d.ts.map +1 -1
- package/dist/api/user.service.js +5 -2
- package/dist/constants/api.constants.d.ts +6 -1
- package/dist/constants/api.constants.d.ts.map +1 -1
- package/dist/constants/api.constants.js +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
export interface Organization {
|
|
2
2
|
id: number;
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
siret?: string;
|
|
9
|
-
status: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'PENDING';
|
|
10
|
-
userCount?: number;
|
|
4
|
+
description?: string;
|
|
5
|
+
domain?: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
parentId?: number;
|
|
11
8
|
createdAt: string;
|
|
12
9
|
updatedAt?: string;
|
|
13
10
|
}
|
|
14
11
|
export interface OrganizationCreate {
|
|
15
12
|
name: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
siret?: string;
|
|
21
|
-
status?: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'PENDING';
|
|
13
|
+
description?: string;
|
|
14
|
+
domain?: string;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
parentId?: number;
|
|
22
17
|
}
|
|
23
18
|
export interface OrganizationUpdate {
|
|
24
19
|
name?: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
siret?: string;
|
|
30
|
-
status?: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'PENDING';
|
|
20
|
+
description?: string;
|
|
21
|
+
domain?: string;
|
|
22
|
+
active?: boolean;
|
|
23
|
+
parentId?: number;
|
|
31
24
|
}
|
|
32
25
|
export interface OrganizationSearchParams {
|
|
33
|
-
status?: string;
|
|
34
|
-
type?: string;
|
|
35
|
-
search?: string;
|
|
36
26
|
page?: number;
|
|
37
27
|
size?: number;
|
|
38
28
|
}
|
|
39
|
-
export interface OrganizationStats {
|
|
40
|
-
total: number;
|
|
41
|
-
active: number;
|
|
42
|
-
inactive: number;
|
|
43
|
-
suspended: number;
|
|
44
|
-
}
|
|
45
29
|
/**
|
|
46
30
|
* Service de gestion des organisations
|
|
47
31
|
*/
|
|
@@ -70,20 +54,16 @@ export declare const organizationService: {
|
|
|
70
54
|
*/
|
|
71
55
|
delete(id: number): Promise<void>;
|
|
72
56
|
/**
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
activate(id: number): Promise<Organization>;
|
|
76
|
-
/**
|
|
77
|
-
* Suspendre une organisation
|
|
57
|
+
* Récupérer les organisations d'un utilisateur
|
|
78
58
|
*/
|
|
79
|
-
|
|
59
|
+
getByUserId(userId: number): Promise<Organization[]>;
|
|
80
60
|
/**
|
|
81
|
-
* Récupérer les
|
|
61
|
+
* Récupérer les organisations racines (sans parent)
|
|
82
62
|
*/
|
|
83
|
-
|
|
63
|
+
getRoot(): Promise<Organization[]>;
|
|
84
64
|
/**
|
|
85
|
-
*
|
|
65
|
+
* Récupérer les organisations enfants d'un parent
|
|
86
66
|
*/
|
|
87
|
-
|
|
67
|
+
getChildren(parentId: number): Promise<Organization[]>;
|
|
88
68
|
};
|
|
89
69
|
//# sourceMappingURL=organization.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.d.ts","sourceRoot":"","sources":["../../api/organization.service.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,
|
|
1
|
+
{"version":3,"file":"organization.service.d.ts","sourceRoot":"","sources":["../../api/organization.service.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;OAEG;oBACmB,wBAAwB,GAAG,OAAO,CAAC;QAAE,aAAa,EAAE,YAAY,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAY1G;;OAEG;gBACe,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAKhD;;OAEG;iBACgB,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAK7D;;OAEG;eACc,MAAM,QAAQ,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAKzE;;OAEG;eACc,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC;;OAEG;wBACuB,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAO1D;;OAEG;eACc,OAAO,CAAC,YAAY,EAAE,CAAC;IAOxC;;OAEG;0BACyB,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAM7D,CAAA"}
|
|
@@ -9,9 +9,10 @@ export const organizationService = {
|
|
|
9
9
|
*/
|
|
10
10
|
async getAll(params) {
|
|
11
11
|
const response = await httpClient.get(API_ENDPOINTS.ORGANIZATIONS.BASE, { params });
|
|
12
|
+
const organizations = Array.isArray(response.data) ? response.data : [];
|
|
12
13
|
return {
|
|
13
|
-
organizations
|
|
14
|
-
total:
|
|
14
|
+
organizations,
|
|
15
|
+
total: organizations.length
|
|
15
16
|
};
|
|
16
17
|
},
|
|
17
18
|
/**
|
|
@@ -42,31 +43,24 @@ export const organizationService = {
|
|
|
42
43
|
await httpClient.delete(API_ENDPOINTS.ORGANIZATIONS.BY_ID(id));
|
|
43
44
|
},
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
+
* Récupérer les organisations d'un utilisateur
|
|
46
47
|
*/
|
|
47
|
-
async
|
|
48
|
-
const response = await httpClient.
|
|
49
|
-
return response.data;
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* Suspendre une organisation
|
|
53
|
-
*/
|
|
54
|
-
async suspend(id, reason) {
|
|
55
|
-
const response = await httpClient.patch(`${API_ENDPOINTS.ORGANIZATIONS.BY_ID(id)}/suspend`, { reason });
|
|
56
|
-
return response.data;
|
|
48
|
+
async getByUserId(userId) {
|
|
49
|
+
const response = await httpClient.get(API_ENDPOINTS.ORGANIZATIONS.BY_USER_ID(userId));
|
|
50
|
+
return Array.isArray(response.data) ? response.data : [];
|
|
57
51
|
},
|
|
58
52
|
/**
|
|
59
|
-
* Récupérer les
|
|
53
|
+
* Récupérer les organisations racines (sans parent)
|
|
60
54
|
*/
|
|
61
|
-
async
|
|
62
|
-
const response = await httpClient.get(
|
|
63
|
-
return response.data;
|
|
55
|
+
async getRoot() {
|
|
56
|
+
const response = await httpClient.get(API_ENDPOINTS.ORGANIZATIONS.ROOT);
|
|
57
|
+
return Array.isArray(response.data) ? response.data : [];
|
|
64
58
|
},
|
|
65
59
|
/**
|
|
66
|
-
*
|
|
60
|
+
* Récupérer les organisations enfants d'un parent
|
|
67
61
|
*/
|
|
68
|
-
async
|
|
69
|
-
const response = await httpClient.get(
|
|
70
|
-
return response.data
|
|
62
|
+
async getChildren(parentId) {
|
|
63
|
+
const response = await httpClient.get(API_ENDPOINTS.ORGANIZATIONS.CHILDREN(parentId));
|
|
64
|
+
return Array.isArray(response.data) ? response.data : [];
|
|
71
65
|
}
|
|
72
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../api/user.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAoE/H;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;oBACmB,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../api/user.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAoE/H;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;oBACmB,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,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11 +51,14 @@ export const userService = {
|
|
|
51
51
|
*/
|
|
52
52
|
async getAll(params) {
|
|
53
53
|
const response = await httpClient.get(API_ENDPOINTS.USERS.BASE, { params });
|
|
54
|
+
// Handle both paginated response (content) and simple list response
|
|
54
55
|
const backendUsers = response.data?.content || response.data || [];
|
|
55
|
-
const users =
|
|
56
|
+
const users = Array.isArray(backendUsers)
|
|
57
|
+
? backendUsers.map(mapBackendUserToUser)
|
|
58
|
+
: [];
|
|
56
59
|
return {
|
|
57
60
|
users,
|
|
58
|
-
total: response.data?.totalElements ||
|
|
61
|
+
total: response.data?.totalElements || users.length
|
|
59
62
|
};
|
|
60
63
|
},
|
|
61
64
|
/**
|
|
@@ -24,8 +24,13 @@ export declare const API_ENDPOINTS: {
|
|
|
24
24
|
readonly ACTIVITY: (id: number) => string;
|
|
25
25
|
};
|
|
26
26
|
readonly ORGANIZATIONS: {
|
|
27
|
-
readonly BASE: "/api/organizations";
|
|
27
|
+
readonly BASE: "/api/identity/organizations";
|
|
28
28
|
readonly BY_ID: (id: number) => string;
|
|
29
|
+
readonly BY_USER_ID: (userId: number) => string;
|
|
30
|
+
readonly ROOT: "/api/identity/organizations/root";
|
|
31
|
+
readonly CHILDREN: (parentId: number) => string;
|
|
32
|
+
readonly STATS: "/api/identity/organizations/stats";
|
|
33
|
+
readonly SEARCH: "/api/identity/organizations/search";
|
|
29
34
|
};
|
|
30
35
|
};
|
|
31
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.constants.d.ts","sourceRoot":"","sources":["../../constants/api.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;6BAcV,MAAM;;;;6BAKN,MAAM;;;;gCAIH,MAAM;;;;6BAKT,MAAM;;
|
|
1
|
+
{"version":3,"file":"api.constants.d.ts","sourceRoot":"","sources":["../../constants/api.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;6BAcV,MAAM;;;;6BAKN,MAAM;;;;gCAIH,MAAM;;;;6BAKT,MAAM;sCACG,MAAM;;sCAEN,MAAM;;;;CAIrB,CAAA;AAEV;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,SAAS,CAAA"}
|
|
@@ -28,8 +28,13 @@ export const API_ENDPOINTS = {
|
|
|
28
28
|
},
|
|
29
29
|
// Organizations
|
|
30
30
|
ORGANIZATIONS: {
|
|
31
|
-
BASE: '/api/organizations',
|
|
32
|
-
BY_ID: (id) => `/api/organizations/${id}
|
|
31
|
+
BASE: '/api/identity/organizations',
|
|
32
|
+
BY_ID: (id) => `/api/identity/organizations/${id}`,
|
|
33
|
+
BY_USER_ID: (userId) => `/api/identity/organizations/user/${userId}`,
|
|
34
|
+
ROOT: '/api/identity/organizations/root',
|
|
35
|
+
CHILDREN: (parentId) => `/api/identity/organizations/${parentId}/children`,
|
|
36
|
+
STATS: '/api/identity/organizations/stats',
|
|
37
|
+
SEARCH: '/api/identity/organizations/search'
|
|
33
38
|
}
|
|
34
39
|
};
|
|
35
40
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { authService } from './api/auth.service';
|
|
|
6
6
|
export { propertyService } from './api/property.service';
|
|
7
7
|
export { userService } from './api/user.service';
|
|
8
8
|
export { organizationService } from './api/organization.service';
|
|
9
|
-
export type { Organization, OrganizationCreate, OrganizationUpdate, OrganizationSearchParams
|
|
9
|
+
export type { Organization, OrganizationCreate, OrganizationUpdate, OrganizationSearchParams } from './api/organization.service';
|
|
10
10
|
export { useAuthStore } from './stores/auth.store';
|
|
11
11
|
export { useUserStore } from './stores/user.store';
|
|
12
12
|
export { useAuth } from './composables/useAuth';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,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