@viridial/shared 1.0.2 → 1.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/api/auth.service.d.ts.map +1 -1
- package/dist/api/auth.service.js +7 -6
- package/dist/api/http.client.d.ts.map +1 -1
- package/dist/api/http.client.js +18 -2
- package/dist/api/organization.service.d.ts +89 -0
- package/dist/api/organization.service.d.ts.map +1 -0
- package/dist/api/organization.service.js +72 -0
- package/dist/config/env.d.ts +9 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/env.js +20 -0
- package/dist/constants/api.constants.d.ts +14 -14
- package/dist/constants/api.constants.d.ts.map +1 -1
- package/dist/constants/api.constants.js +31 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../api/auth.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../api/auth.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAGlJ;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;uBACsB,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ9D;;OAEG;iBACgB,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAK1D;;OAEG;cACa,OAAO,CAAC,IAAI,CAAC;IAQ7B;;OAEG;yBACwB,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE;;OAEG;wBACuB,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D;;OAEG;oBACmB,OAAO,CAAC,aAAa,CAAC;IAQ5C;;OAEG;uBACgB,OAAO;CAG3B,CAAA"}
|
package/dist/api/auth.service.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { httpClient } from './http.client';
|
|
2
|
+
import { API_ENDPOINTS } from '../constants/api.constants';
|
|
2
3
|
import { tokenUtils } from '../utils/token.utils';
|
|
3
4
|
/**
|
|
4
5
|
* Service d'authentification
|
|
@@ -8,7 +9,7 @@ export const authService = {
|
|
|
8
9
|
* Connexion
|
|
9
10
|
*/
|
|
10
11
|
async login(credentials) {
|
|
11
|
-
const response = await httpClient.post(
|
|
12
|
+
const response = await httpClient.post(API_ENDPOINTS.AUTH.LOGIN, credentials);
|
|
12
13
|
if (response.data?.token) {
|
|
13
14
|
tokenUtils.setToken(response.data.token);
|
|
14
15
|
}
|
|
@@ -18,7 +19,7 @@ export const authService = {
|
|
|
18
19
|
* Inscription
|
|
19
20
|
*/
|
|
20
21
|
async signup(data) {
|
|
21
|
-
const response = await httpClient.post(
|
|
22
|
+
const response = await httpClient.post(API_ENDPOINTS.AUTH.REGISTER, data);
|
|
22
23
|
return response.data;
|
|
23
24
|
},
|
|
24
25
|
/**
|
|
@@ -26,7 +27,7 @@ export const authService = {
|
|
|
26
27
|
*/
|
|
27
28
|
async logout() {
|
|
28
29
|
try {
|
|
29
|
-
await httpClient.post(
|
|
30
|
+
await httpClient.post(API_ENDPOINTS.AUTH.LOGOUT);
|
|
30
31
|
}
|
|
31
32
|
finally {
|
|
32
33
|
tokenUtils.removeToken();
|
|
@@ -36,19 +37,19 @@ export const authService = {
|
|
|
36
37
|
* Demande de réinitialisation de mot de passe
|
|
37
38
|
*/
|
|
38
39
|
async forgotPassword(data) {
|
|
39
|
-
await httpClient.post(
|
|
40
|
+
await httpClient.post(API_ENDPOINTS.AUTH.FORGOT_PASSWORD, data);
|
|
40
41
|
},
|
|
41
42
|
/**
|
|
42
43
|
* Réinitialisation de mot de passe
|
|
43
44
|
*/
|
|
44
45
|
async resetPassword(data) {
|
|
45
|
-
await httpClient.post(
|
|
46
|
+
await httpClient.post(API_ENDPOINTS.AUTH.RESET_PASSWORD, data);
|
|
46
47
|
},
|
|
47
48
|
/**
|
|
48
49
|
* Rafraîchir le token
|
|
49
50
|
*/
|
|
50
51
|
async refreshToken() {
|
|
51
|
-
const response = await httpClient.post(
|
|
52
|
+
const response = await httpClient.post(API_ENDPOINTS.AUTH.REFRESH);
|
|
52
53
|
if (response.data?.token) {
|
|
53
54
|
tokenUtils.setToken(response.data.token);
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.client.d.ts","sourceRoot":"","sources":["../../api/http.client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAsB,KAAK,kBAAkB,EAAsB,MAAM,OAAO,CAAA;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"http.client.d.ts","sourceRoot":"","sources":["../../api/http.client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAsB,KAAK,kBAAkB,EAAsB,MAAM,OAAO,CAAA;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,oBAAoB,CAAA;AAmB/D;;GAEG;AACH,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAe;gBAEjB,OAAO,CAAC,EAAE,MAAM;IAc5B,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,WAAW;IAcb,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASzE,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAStF,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASrF,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASvF,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAQnF;AAED,eAAO,MAAM,UAAU,YAAmB,CAAA"}
|
package/dist/api/http.client.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { tokenUtils } from '../utils/token.utils';
|
|
3
|
+
/**
|
|
4
|
+
* Get API base URL from environment or use default
|
|
5
|
+
* Note: In the shared package, we use empty string as default
|
|
6
|
+
* The endpoints already include '/api' prefix for Vite proxy
|
|
7
|
+
*/
|
|
8
|
+
const getApiBaseUrl = () => {
|
|
9
|
+
// Try to get from window (if set by Vite at runtime)
|
|
10
|
+
if (typeof window !== 'undefined' && window.__API_BASE_URL__) {
|
|
11
|
+
const baseUrl = window.__API_BASE_URL__;
|
|
12
|
+
// If baseURL already includes /api, return as is, otherwise add it
|
|
13
|
+
return baseUrl.endsWith('/api') ? baseUrl : `${baseUrl}/api`;
|
|
14
|
+
}
|
|
15
|
+
// Default: empty string (endpoints already include /api prefix)
|
|
16
|
+
return '';
|
|
17
|
+
};
|
|
3
18
|
/**
|
|
4
19
|
* Client HTTP configuré avec intercepteurs pour l'authentification
|
|
5
20
|
*/
|
|
6
21
|
class HttpClient {
|
|
7
|
-
constructor(baseURL
|
|
22
|
+
constructor(baseURL) {
|
|
23
|
+
const apiBaseUrl = baseURL || getApiBaseUrl();
|
|
8
24
|
this.client = axios.create({
|
|
9
|
-
baseURL,
|
|
25
|
+
baseURL: apiBaseUrl,
|
|
10
26
|
timeout: 30000,
|
|
11
27
|
headers: {
|
|
12
28
|
'Content-Type': 'application/json'
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export interface Organization {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
type: 'AGENCY' | 'FREELANCE' | 'COMPANY';
|
|
5
|
+
email: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
address?: string;
|
|
8
|
+
siret?: string;
|
|
9
|
+
status: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'PENDING';
|
|
10
|
+
userCount?: number;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface OrganizationCreate {
|
|
15
|
+
name: string;
|
|
16
|
+
type: 'AGENCY' | 'FREELANCE' | 'COMPANY';
|
|
17
|
+
email: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
address?: string;
|
|
20
|
+
siret?: string;
|
|
21
|
+
status?: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'PENDING';
|
|
22
|
+
}
|
|
23
|
+
export interface OrganizationUpdate {
|
|
24
|
+
name?: string;
|
|
25
|
+
type?: 'AGENCY' | 'FREELANCE' | 'COMPANY';
|
|
26
|
+
email?: string;
|
|
27
|
+
phone?: string;
|
|
28
|
+
address?: string;
|
|
29
|
+
siret?: string;
|
|
30
|
+
status?: 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'PENDING';
|
|
31
|
+
}
|
|
32
|
+
export interface OrganizationSearchParams {
|
|
33
|
+
status?: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
search?: string;
|
|
36
|
+
page?: number;
|
|
37
|
+
size?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface OrganizationStats {
|
|
40
|
+
total: number;
|
|
41
|
+
active: number;
|
|
42
|
+
inactive: number;
|
|
43
|
+
suspended: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Service de gestion des organisations
|
|
47
|
+
*/
|
|
48
|
+
export declare const organizationService: {
|
|
49
|
+
/**
|
|
50
|
+
* Récupérer toutes les organisations
|
|
51
|
+
*/
|
|
52
|
+
getAll(params?: OrganizationSearchParams): Promise<{
|
|
53
|
+
organizations: Organization[];
|
|
54
|
+
total: number;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Récupérer une organisation par ID
|
|
58
|
+
*/
|
|
59
|
+
getById(id: number): Promise<Organization>;
|
|
60
|
+
/**
|
|
61
|
+
* Créer une organisation
|
|
62
|
+
*/
|
|
63
|
+
create(data: OrganizationCreate): Promise<Organization>;
|
|
64
|
+
/**
|
|
65
|
+
* Mettre à jour une organisation
|
|
66
|
+
*/
|
|
67
|
+
update(id: number, data: OrganizationUpdate): Promise<Organization>;
|
|
68
|
+
/**
|
|
69
|
+
* Supprimer une organisation
|
|
70
|
+
*/
|
|
71
|
+
delete(id: number): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Activer une organisation
|
|
74
|
+
*/
|
|
75
|
+
activate(id: number): Promise<Organization>;
|
|
76
|
+
/**
|
|
77
|
+
* Suspendre une organisation
|
|
78
|
+
*/
|
|
79
|
+
suspend(id: number, reason?: string): Promise<Organization>;
|
|
80
|
+
/**
|
|
81
|
+
* Récupérer les statistiques
|
|
82
|
+
*/
|
|
83
|
+
getStats(): Promise<OrganizationStats>;
|
|
84
|
+
/**
|
|
85
|
+
* Rechercher des organisations
|
|
86
|
+
*/
|
|
87
|
+
search(query: string, params?: OrganizationSearchParams): Promise<Organization[]>;
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=organization.service.d.ts.map
|
|
@@ -0,0 +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,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAA;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAA;CACzD;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAA;CACzD;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;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;IAW1G;;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;iBACgB,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAOjD;;OAEG;gBACe,MAAM,WAAW,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAQjE;;OAEG;gBACe,OAAO,CAAC,iBAAiB,CAAC;IAO5C;;OAEG;kBACiB,MAAM,WAAW,wBAAwB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAOxF,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { httpClient } from './http.client';
|
|
2
|
+
import { API_ENDPOINTS } from '../constants/api.constants';
|
|
3
|
+
/**
|
|
4
|
+
* Service de gestion des organisations
|
|
5
|
+
*/
|
|
6
|
+
export const organizationService = {
|
|
7
|
+
/**
|
|
8
|
+
* Récupérer toutes les organisations
|
|
9
|
+
*/
|
|
10
|
+
async getAll(params) {
|
|
11
|
+
const response = await httpClient.get(API_ENDPOINTS.ORGANIZATIONS.BASE, { params });
|
|
12
|
+
return {
|
|
13
|
+
organizations: response.data?.content || response.data || [],
|
|
14
|
+
total: response.data?.totalElements || 0
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Récupérer une organisation par ID
|
|
19
|
+
*/
|
|
20
|
+
async getById(id) {
|
|
21
|
+
const response = await httpClient.get(API_ENDPOINTS.ORGANIZATIONS.BY_ID(id));
|
|
22
|
+
return response.data;
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Créer une organisation
|
|
26
|
+
*/
|
|
27
|
+
async create(data) {
|
|
28
|
+
const response = await httpClient.post(API_ENDPOINTS.ORGANIZATIONS.BASE, data);
|
|
29
|
+
return response.data;
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Mettre à jour une organisation
|
|
33
|
+
*/
|
|
34
|
+
async update(id, data) {
|
|
35
|
+
const response = await httpClient.put(API_ENDPOINTS.ORGANIZATIONS.BY_ID(id), data);
|
|
36
|
+
return response.data;
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Supprimer une organisation
|
|
40
|
+
*/
|
|
41
|
+
async delete(id) {
|
|
42
|
+
await httpClient.delete(API_ENDPOINTS.ORGANIZATIONS.BY_ID(id));
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Activer une organisation
|
|
46
|
+
*/
|
|
47
|
+
async activate(id) {
|
|
48
|
+
const response = await httpClient.patch(`${API_ENDPOINTS.ORGANIZATIONS.BY_ID(id)}/activate`);
|
|
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;
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* Récupérer les statistiques
|
|
60
|
+
*/
|
|
61
|
+
async getStats() {
|
|
62
|
+
const response = await httpClient.get(`${API_ENDPOINTS.ORGANIZATIONS.BASE}/stats`);
|
|
63
|
+
return response.data;
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Rechercher des organisations
|
|
67
|
+
*/
|
|
68
|
+
async search(query, params) {
|
|
69
|
+
const response = await httpClient.get(`${API_ENDPOINTS.ORGANIZATIONS.BASE}/search`, { params: { q: query, ...params } });
|
|
70
|
+
return response.data || [];
|
|
71
|
+
}
|
|
72
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration des variables d'environnement pour le package shared
|
|
3
|
+
* Note: Ce fichier doit être utilisé côté client uniquement
|
|
4
|
+
*/
|
|
5
|
+
export declare const env: {
|
|
6
|
+
readonly apiBaseUrl: string;
|
|
7
|
+
};
|
|
8
|
+
export default env;
|
|
9
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../config/env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,eAAO,MAAM,GAAG;;CAEN,CAAA;AAEV,eAAe,GAAG,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration des variables d'environnement pour le package shared
|
|
3
|
+
* Note: Ce fichier doit être utilisé côté client uniquement
|
|
4
|
+
*/
|
|
5
|
+
// Pour le package shared, on utilise les variables d'environnement du projet parent
|
|
6
|
+
// ou des valeurs par défaut pour le développement local
|
|
7
|
+
const getApiBaseUrl = () => {
|
|
8
|
+
// En développement, utiliser la variable d'environnement ou la valeur par défaut
|
|
9
|
+
if (typeof window !== 'undefined') {
|
|
10
|
+
// Côté client, on peut utiliser import.meta.env si disponible
|
|
11
|
+
// Sinon, utiliser la valeur par défaut
|
|
12
|
+
return '/api'; // Proxy vers le gateway
|
|
13
|
+
}
|
|
14
|
+
// Côté serveur ou fallback
|
|
15
|
+
return process.env.VITE_API_BASE_URL || 'http://localhost:8080';
|
|
16
|
+
};
|
|
17
|
+
export const env = {
|
|
18
|
+
apiBaseUrl: getApiBaseUrl()
|
|
19
|
+
};
|
|
20
|
+
export default env;
|
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const API_ENDPOINTS: {
|
|
5
5
|
readonly AUTH: {
|
|
6
|
-
readonly LOGIN: "/identity/auth/login";
|
|
7
|
-
readonly REGISTER: "/identity/auth/register";
|
|
8
|
-
readonly LOGOUT: "/identity/auth/logout";
|
|
9
|
-
readonly REFRESH: "/identity/auth/refresh";
|
|
10
|
-
readonly FORGOT_PASSWORD: "/identity/auth/forgot-password";
|
|
11
|
-
readonly RESET_PASSWORD: "/identity/auth/reset-password";
|
|
6
|
+
readonly LOGIN: "/api/identity/auth/login";
|
|
7
|
+
readonly REGISTER: "/api/identity/auth/register";
|
|
8
|
+
readonly LOGOUT: "/api/identity/auth/logout";
|
|
9
|
+
readonly REFRESH: "/api/identity/auth/refresh";
|
|
10
|
+
readonly FORGOT_PASSWORD: "/api/identity/auth/forgot-password";
|
|
11
|
+
readonly RESET_PASSWORD: "/api/identity/auth/reset-password";
|
|
12
12
|
};
|
|
13
13
|
readonly PROPERTIES: {
|
|
14
|
-
readonly BASE: "/
|
|
15
|
-
readonly SEARCH: "/
|
|
14
|
+
readonly BASE: "/api/properties";
|
|
15
|
+
readonly SEARCH: "/api/properties/search";
|
|
16
16
|
readonly BY_ID: (id: number) => string;
|
|
17
17
|
};
|
|
18
18
|
readonly USERS: {
|
|
19
|
-
readonly BASE: "/identity
|
|
19
|
+
readonly BASE: "/api/identity/users";
|
|
20
20
|
readonly BY_ID: (id: number) => string;
|
|
21
|
-
readonly PROFILE: "/identity
|
|
22
|
-
readonly STATS: "/identity
|
|
23
|
-
readonly SEARCH: "/identity
|
|
21
|
+
readonly PROFILE: "/api/identity/users/profile";
|
|
22
|
+
readonly STATS: "/api/identity/users/stats";
|
|
23
|
+
readonly SEARCH: "/api/identity/users/search";
|
|
24
24
|
readonly ACTIVITY: (id: number) => string;
|
|
25
25
|
};
|
|
26
26
|
readonly ORGANIZATIONS: {
|
|
27
|
-
readonly BASE: "/
|
|
27
|
+
readonly BASE: "/api/organizations";
|
|
28
28
|
readonly BY_ID: (id: number) => string;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
export declare const API_BASE_URL
|
|
31
|
+
export declare const API_BASE_URL: string;
|
|
32
32
|
//# sourceMappingURL=api.constants.d.ts.map
|
|
@@ -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;;CAEZ,CAAA;
|
|
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;;CAEZ,CAAA;AAgBV,eAAO,MAAM,YAAY,QAAkB,CAAA"}
|
|
@@ -4,32 +4,45 @@
|
|
|
4
4
|
export const API_ENDPOINTS = {
|
|
5
5
|
// Authentication
|
|
6
6
|
AUTH: {
|
|
7
|
-
LOGIN: '/identity/auth/login',
|
|
8
|
-
REGISTER: '/identity/auth/register',
|
|
9
|
-
LOGOUT: '/identity/auth/logout',
|
|
10
|
-
REFRESH: '/identity/auth/refresh',
|
|
11
|
-
FORGOT_PASSWORD: '/identity/auth/forgot-password',
|
|
12
|
-
RESET_PASSWORD: '/identity/auth/reset-password'
|
|
7
|
+
LOGIN: '/api/identity/auth/login',
|
|
8
|
+
REGISTER: '/api/identity/auth/register',
|
|
9
|
+
LOGOUT: '/api/identity/auth/logout',
|
|
10
|
+
REFRESH: '/api/identity/auth/refresh',
|
|
11
|
+
FORGOT_PASSWORD: '/api/identity/auth/forgot-password',
|
|
12
|
+
RESET_PASSWORD: '/api/identity/auth/reset-password'
|
|
13
13
|
},
|
|
14
14
|
// Properties
|
|
15
15
|
PROPERTIES: {
|
|
16
|
-
BASE: '/
|
|
17
|
-
SEARCH: '/
|
|
18
|
-
BY_ID: (id) => `/
|
|
16
|
+
BASE: '/api/properties',
|
|
17
|
+
SEARCH: '/api/properties/search',
|
|
18
|
+
BY_ID: (id) => `/api/properties/${id}`
|
|
19
19
|
},
|
|
20
20
|
// Users
|
|
21
21
|
USERS: {
|
|
22
|
-
BASE: '/identity
|
|
23
|
-
BY_ID: (id) => `/identity
|
|
24
|
-
PROFILE: '/identity
|
|
25
|
-
STATS: '/identity
|
|
26
|
-
SEARCH: '/identity
|
|
27
|
-
ACTIVITY: (id) => `/identity
|
|
22
|
+
BASE: '/api/identity/users',
|
|
23
|
+
BY_ID: (id) => `/api/identity/users/${id}`,
|
|
24
|
+
PROFILE: '/api/identity/users/profile',
|
|
25
|
+
STATS: '/api/identity/users/stats',
|
|
26
|
+
SEARCH: '/api/identity/users/search',
|
|
27
|
+
ACTIVITY: (id) => `/api/identity/users/${id}/activity`
|
|
28
28
|
},
|
|
29
29
|
// Organizations
|
|
30
30
|
ORGANIZATIONS: {
|
|
31
|
-
BASE: '/
|
|
32
|
-
BY_ID: (id) => `/
|
|
31
|
+
BASE: '/api/organizations',
|
|
32
|
+
BY_ID: (id) => `/api/organizations/${id}`
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Get API base URL from environment
|
|
37
|
+
* Note: In the shared package, we use '/api' as default (proxy path)
|
|
38
|
+
* The actual URL is configured in the frontend application via Vite proxy
|
|
39
|
+
*/
|
|
40
|
+
const getApiBaseUrl = () => {
|
|
41
|
+
// Try to get from window (if set by Vite at runtime)
|
|
42
|
+
if (typeof window !== 'undefined' && window.__API_BASE_URL__) {
|
|
43
|
+
return window.__API_BASE_URL__;
|
|
44
|
+
}
|
|
45
|
+
// Default: use proxy path (Vite will proxy /api to the configured backend)
|
|
46
|
+
return '/api';
|
|
47
|
+
};
|
|
48
|
+
export const API_BASE_URL = getApiBaseUrl();
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { httpClient } from './api/http.client';
|
|
|
5
5
|
export { authService } from './api/auth.service';
|
|
6
6
|
export { propertyService } from './api/property.service';
|
|
7
7
|
export { userService } from './api/user.service';
|
|
8
|
+
export { organizationService } from './api/organization.service';
|
|
9
|
+
export type { Organization, OrganizationCreate, OrganizationUpdate, OrganizationSearchParams, OrganizationStats } from './api/organization.service';
|
|
8
10
|
export { useAuthStore } from './stores/auth.store';
|
|
9
11
|
export { useUserStore } from './stores/user.store';
|
|
10
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,mBAAmB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAG/C,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,oBAAoB,CAAA;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGvE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { httpClient } from './api/http.client';
|
|
|
6
6
|
export { authService } from './api/auth.service';
|
|
7
7
|
export { propertyService } from './api/property.service';
|
|
8
8
|
export { userService } from './api/user.service';
|
|
9
|
+
export { organizationService } from './api/organization.service';
|
|
9
10
|
// Stores
|
|
10
11
|
export { useAuthStore } from './stores/auth.store';
|
|
11
12
|
export { useUserStore } from './stores/user.store';
|