@jaws-developers-customers/consulca-types 1.0.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/README.md +81 -0
- package/index.d.ts +252 -0
- package/index.js +141 -0
- package/index.mjs +27 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @jaws-developers-customers/consulca-types
|
|
2
|
+
|
|
3
|
+
Pacchetto NPM con tipi del dominio Consulca e helper pronti all'uso per date, valuta e oggetti principali derivati dallo schema MariaDB.
|
|
4
|
+
|
|
5
|
+
## Installazione
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @jaws-developers-customers/consulca-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Pubblicazione automatica
|
|
12
|
+
|
|
13
|
+
Ogni push su `main` esegue i test e pubblica automaticamente il pacchetto su npm tramite GitHub Actions.
|
|
14
|
+
|
|
15
|
+
Prerequisito:
|
|
16
|
+
|
|
17
|
+
- npm Trusted Publisher configurato per questo repository/workflow su npm
|
|
18
|
+
|
|
19
|
+
Il workflow genera una versione unica per ogni run su `main`, così la pubblicazione non fallisce per versioni duplicate.
|
|
20
|
+
|
|
21
|
+
## Cosa esporta
|
|
22
|
+
|
|
23
|
+
- tipi TypeScript per le entità principali (`User`, `Property`, `Lease`, `Inspection`, `Claim`, `Work`, ...)
|
|
24
|
+
- cataloghi `ENUM` dello schema (`USER_ROLES`, `ACCESS_CHANNELS`, `PROPERTY_TYPES`, ...)
|
|
25
|
+
- helper:
|
|
26
|
+
- `formatDate`
|
|
27
|
+
- `formatDateTime`
|
|
28
|
+
- `formatCurrency`
|
|
29
|
+
- `getUserFullName`
|
|
30
|
+
- `formatAddress`
|
|
31
|
+
- `hasUserRole`
|
|
32
|
+
- `hasAccessChannel`
|
|
33
|
+
|
|
34
|
+
## Esempio
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
const {
|
|
38
|
+
formatCurrency,
|
|
39
|
+
formatDate,
|
|
40
|
+
getUserFullName,
|
|
41
|
+
hasUserRole,
|
|
42
|
+
} = require('@jaws-developers-customers/consulca-types');
|
|
43
|
+
|
|
44
|
+
console.log(formatDate('2026-09-16T10:30:00Z'));
|
|
45
|
+
console.log(formatCurrency(1250.5));
|
|
46
|
+
console.log(getUserFullName({ first_name: 'Mario', last_name: 'Rossi' }));
|
|
47
|
+
console.log(hasUserRole([{ role: 'manager' }], 'manager'));
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Esempio TypeScript
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import {
|
|
54
|
+
formatDateTime,
|
|
55
|
+
type Inspection,
|
|
56
|
+
type User,
|
|
57
|
+
} from '@jaws-developers-customers/consulca-types';
|
|
58
|
+
|
|
59
|
+
const user: User = {
|
|
60
|
+
id: 'uuid',
|
|
61
|
+
email: 'mario.rossi@example.com',
|
|
62
|
+
password_hash: 'hashed',
|
|
63
|
+
first_name: 'Mario',
|
|
64
|
+
last_name: 'Rossi',
|
|
65
|
+
status: 'active',
|
|
66
|
+
created_at: new Date(),
|
|
67
|
+
updated_at: new Date(),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const inspection: Inspection = {
|
|
71
|
+
id: 'uuid',
|
|
72
|
+
lease_id: 'lease-id',
|
|
73
|
+
inspector_id: user.id,
|
|
74
|
+
inspection_type: 'move_in',
|
|
75
|
+
status: 'draft',
|
|
76
|
+
created_at: new Date(),
|
|
77
|
+
updated_at: new Date(),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
console.log(formatDateTime(inspection.created_at, 'it-CH'));
|
|
81
|
+
```
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
export type UserStatus = 'active' | 'invited' | 'suspended' | 'disabled';
|
|
2
|
+
export type UserRole = 'lessor' | 'manager' | 'website_manager' | 'inspector';
|
|
3
|
+
export type AccessChannel = 'intranet_dashboard' | 'mobile_app' | 'website_admin';
|
|
4
|
+
export type AccessStatus = 'active' | 'revoked';
|
|
5
|
+
export type PropertyType = 'apartment' | 'house' | 'commercial' | 'parking' | 'other';
|
|
6
|
+
export type PropertyStatus = 'active' | 'inactive' | 'archived';
|
|
7
|
+
export type ManagementRole = 'primary' | 'secondary' | 'accounting' | 'technical' | 'other';
|
|
8
|
+
export type LeaseStatus = 'planned' | 'active' | 'ended' | 'cancelled';
|
|
9
|
+
export type InspectionType = 'move_in' | 'move_out';
|
|
10
|
+
export type InspectionStatus = 'draft' | 'in_progress' | 'submitted' | 'approved' | 'rejected';
|
|
11
|
+
export type ConditionStatus = 'good' | 'minor_damage' | 'major_damage' | 'not_checked';
|
|
12
|
+
export type ClaimStatus = 'draft' | 'submitted' | 'in_review' | 'approved' | 'rejected' | 'closed';
|
|
13
|
+
export type WorkStatus = 'planned' | 'assigned' | 'in_progress' | 'completed' | 'cancelled';
|
|
14
|
+
|
|
15
|
+
export interface Addressable {
|
|
16
|
+
address_line1?: string | null;
|
|
17
|
+
address_line2?: string | null;
|
|
18
|
+
postal_code?: string | null;
|
|
19
|
+
city?: string | null;
|
|
20
|
+
country_code?: string | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface User extends Addressable {
|
|
24
|
+
id: string;
|
|
25
|
+
email: string;
|
|
26
|
+
password_hash: string;
|
|
27
|
+
first_name: string;
|
|
28
|
+
last_name: string;
|
|
29
|
+
phone?: string | null;
|
|
30
|
+
status: UserStatus;
|
|
31
|
+
email_verified_at?: string | Date | null;
|
|
32
|
+
last_login_at?: string | Date | null;
|
|
33
|
+
created_at: string | Date;
|
|
34
|
+
updated_at: string | Date;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface UserRoleAssignment {
|
|
38
|
+
user_id: string;
|
|
39
|
+
role: UserRole;
|
|
40
|
+
created_at: string | Date;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface UserAccessChannel {
|
|
44
|
+
user_id: string;
|
|
45
|
+
channel: AccessChannel;
|
|
46
|
+
status: AccessStatus;
|
|
47
|
+
created_at: string | Date;
|
|
48
|
+
revoked_at?: string | Date | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface Session {
|
|
52
|
+
id: string;
|
|
53
|
+
user_id: string;
|
|
54
|
+
channel: AccessChannel;
|
|
55
|
+
access_token_hash: string;
|
|
56
|
+
refresh_token_hash?: string | null;
|
|
57
|
+
expires_at: string | Date;
|
|
58
|
+
refresh_expires_at?: string | Date | null;
|
|
59
|
+
user_agent?: string | null;
|
|
60
|
+
ip_address?: Uint8Array | string | null;
|
|
61
|
+
created_at: string | Date;
|
|
62
|
+
revoked_at?: string | Date | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Building extends Addressable {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
created_at: string | Date;
|
|
69
|
+
updated_at: string | Date;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface Property {
|
|
73
|
+
id: string;
|
|
74
|
+
building_id: string;
|
|
75
|
+
property_number: string;
|
|
76
|
+
property_type: PropertyType;
|
|
77
|
+
floor?: string | null;
|
|
78
|
+
rooms?: number | null;
|
|
79
|
+
area_m2?: number | null;
|
|
80
|
+
status: PropertyStatus;
|
|
81
|
+
created_at: string | Date;
|
|
82
|
+
updated_at: string | Date;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface PropertyLessor {
|
|
86
|
+
property_id: string;
|
|
87
|
+
user_id: string;
|
|
88
|
+
ownership_share?: number | null;
|
|
89
|
+
is_primary: boolean | number;
|
|
90
|
+
created_at: string | Date;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface PropertyManager {
|
|
94
|
+
property_id: string;
|
|
95
|
+
user_id: string;
|
|
96
|
+
management_role: ManagementRole;
|
|
97
|
+
valid_from?: string | Date | null;
|
|
98
|
+
valid_until?: string | Date | null;
|
|
99
|
+
created_at: string | Date;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface Lease {
|
|
103
|
+
id: string;
|
|
104
|
+
property_id: string;
|
|
105
|
+
tenant_name?: string | null;
|
|
106
|
+
tenant_email?: string | null;
|
|
107
|
+
tenant_phone?: string | null;
|
|
108
|
+
start_date: string | Date;
|
|
109
|
+
end_date?: string | Date | null;
|
|
110
|
+
status: LeaseStatus;
|
|
111
|
+
created_at: string | Date;
|
|
112
|
+
updated_at: string | Date;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface Inspection {
|
|
116
|
+
id: string;
|
|
117
|
+
lease_id: string;
|
|
118
|
+
inspector_id: string;
|
|
119
|
+
inspection_type: InspectionType;
|
|
120
|
+
status: InspectionStatus;
|
|
121
|
+
scheduled_at?: string | Date | null;
|
|
122
|
+
started_at?: string | Date | null;
|
|
123
|
+
submitted_at?: string | Date | null;
|
|
124
|
+
notes?: string | null;
|
|
125
|
+
created_at: string | Date;
|
|
126
|
+
updated_at: string | Date;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface InspectionItem {
|
|
130
|
+
id: string;
|
|
131
|
+
inspection_id: string;
|
|
132
|
+
room?: string | null;
|
|
133
|
+
item_name: string;
|
|
134
|
+
condition_status: ConditionStatus;
|
|
135
|
+
comment?: string | null;
|
|
136
|
+
created_at: string | Date;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface InspectionAttachment {
|
|
140
|
+
id: string;
|
|
141
|
+
inspection_id: string;
|
|
142
|
+
item_id?: string | null;
|
|
143
|
+
file_name: string;
|
|
144
|
+
storage_key: string;
|
|
145
|
+
mime_type?: string | null;
|
|
146
|
+
file_size?: number | null;
|
|
147
|
+
created_at: string | Date;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface Claim {
|
|
151
|
+
id: string;
|
|
152
|
+
property_id: string;
|
|
153
|
+
submitted_by: string;
|
|
154
|
+
status: ClaimStatus;
|
|
155
|
+
incident_date?: string | Date | null;
|
|
156
|
+
title: string;
|
|
157
|
+
description: string;
|
|
158
|
+
amount_estimate?: number | null;
|
|
159
|
+
currency: string;
|
|
160
|
+
submitted_at?: string | Date | null;
|
|
161
|
+
created_at: string | Date;
|
|
162
|
+
updated_at: string | Date;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface ClaimAttachment {
|
|
166
|
+
id: string;
|
|
167
|
+
claim_id: string;
|
|
168
|
+
file_name: string;
|
|
169
|
+
storage_key: string;
|
|
170
|
+
mime_type?: string | null;
|
|
171
|
+
file_size?: number | null;
|
|
172
|
+
created_at: string | Date;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface Manufacturer extends Addressable {
|
|
176
|
+
id: string;
|
|
177
|
+
name: string;
|
|
178
|
+
country_code: string;
|
|
179
|
+
email?: string | null;
|
|
180
|
+
phone?: string | null;
|
|
181
|
+
created_at: string | Date;
|
|
182
|
+
updated_at: string | Date;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface Work {
|
|
186
|
+
id: string;
|
|
187
|
+
property_id: string;
|
|
188
|
+
manufacturer_id?: string | null;
|
|
189
|
+
created_by: string;
|
|
190
|
+
title: string;
|
|
191
|
+
description?: string | null;
|
|
192
|
+
status: WorkStatus;
|
|
193
|
+
scheduled_at?: string | Date | null;
|
|
194
|
+
completed_at?: string | Date | null;
|
|
195
|
+
created_at: string | Date;
|
|
196
|
+
updated_at: string | Date;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface AuditLog {
|
|
200
|
+
id: number;
|
|
201
|
+
user_id?: string | null;
|
|
202
|
+
channel?: AccessChannel | null;
|
|
203
|
+
action: string;
|
|
204
|
+
entity_type?: string | null;
|
|
205
|
+
entity_id?: string | null;
|
|
206
|
+
metadata?: Record<string, unknown> | null;
|
|
207
|
+
created_at: string | Date;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export declare const USER_STATUSES: readonly UserStatus[];
|
|
211
|
+
export declare const USER_ROLES: readonly UserRole[];
|
|
212
|
+
export declare const ACCESS_CHANNELS: readonly AccessChannel[];
|
|
213
|
+
export declare const ACCESS_STATUSES: readonly AccessStatus[];
|
|
214
|
+
export declare const PROPERTY_TYPES: readonly PropertyType[];
|
|
215
|
+
export declare const PROPERTY_STATUSES: readonly PropertyStatus[];
|
|
216
|
+
export declare const MANAGEMENT_ROLES: readonly ManagementRole[];
|
|
217
|
+
export declare const LEASE_STATUSES: readonly LeaseStatus[];
|
|
218
|
+
export declare const INSPECTION_TYPES: readonly InspectionType[];
|
|
219
|
+
export declare const INSPECTION_STATUSES: readonly InspectionStatus[];
|
|
220
|
+
export declare const CONDITION_STATUSES: readonly ConditionStatus[];
|
|
221
|
+
export declare const CLAIM_STATUSES: readonly ClaimStatus[];
|
|
222
|
+
export declare const WORK_STATUSES: readonly WorkStatus[];
|
|
223
|
+
|
|
224
|
+
export declare function toDate(value: string | number | Date | null | undefined): Date | null;
|
|
225
|
+
export declare function formatDate(
|
|
226
|
+
value: string | number | Date | null | undefined,
|
|
227
|
+
locales?: string | string[],
|
|
228
|
+
options?: Intl.DateTimeFormatOptions
|
|
229
|
+
): string;
|
|
230
|
+
export declare function formatDateTime(
|
|
231
|
+
value: string | number | Date | null | undefined,
|
|
232
|
+
locales?: string | string[],
|
|
233
|
+
options?: Intl.DateTimeFormatOptions
|
|
234
|
+
): string;
|
|
235
|
+
export declare function formatCurrency(
|
|
236
|
+
amount: string | number | null | undefined,
|
|
237
|
+
currency?: string,
|
|
238
|
+
locales?: string | string[],
|
|
239
|
+
options?: Intl.NumberFormatOptions
|
|
240
|
+
): string;
|
|
241
|
+
export declare function getUserFullName(
|
|
242
|
+
user: Pick<User, 'first_name' | 'last_name'> | Partial<Pick<User, 'first_name' | 'last_name'>> | null | undefined
|
|
243
|
+
): string;
|
|
244
|
+
export declare function formatAddress(entity: Addressable | null | undefined): string;
|
|
245
|
+
export declare function hasUserRole(
|
|
246
|
+
userRoles: Array<UserRoleAssignment | UserRole> | null | undefined,
|
|
247
|
+
role: UserRole
|
|
248
|
+
): boolean;
|
|
249
|
+
export declare function hasAccessChannel(
|
|
250
|
+
accessChannels: Array<UserAccessChannel | AccessChannel> | null | undefined,
|
|
251
|
+
channel: AccessChannel
|
|
252
|
+
): boolean;
|
package/index.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const USER_STATUSES = Object.freeze(['active', 'invited', 'suspended', 'disabled']);
|
|
4
|
+
const USER_ROLES = Object.freeze(['lessor', 'manager', 'website_manager', 'inspector']);
|
|
5
|
+
const ACCESS_CHANNELS = Object.freeze(['intranet_dashboard', 'mobile_app', 'website_admin']);
|
|
6
|
+
const ACCESS_STATUSES = Object.freeze(['active', 'revoked']);
|
|
7
|
+
const PROPERTY_TYPES = Object.freeze(['apartment', 'house', 'commercial', 'parking', 'other']);
|
|
8
|
+
const PROPERTY_STATUSES = Object.freeze(['active', 'inactive', 'archived']);
|
|
9
|
+
const MANAGEMENT_ROLES = Object.freeze(['primary', 'secondary', 'accounting', 'technical', 'other']);
|
|
10
|
+
const LEASE_STATUSES = Object.freeze(['planned', 'active', 'ended', 'cancelled']);
|
|
11
|
+
const INSPECTION_TYPES = Object.freeze(['move_in', 'move_out']);
|
|
12
|
+
const INSPECTION_STATUSES = Object.freeze(['draft', 'in_progress', 'submitted', 'approved', 'rejected']);
|
|
13
|
+
const CONDITION_STATUSES = Object.freeze(['good', 'minor_damage', 'major_damage', 'not_checked']);
|
|
14
|
+
const CLAIM_STATUSES = Object.freeze(['draft', 'submitted', 'in_review', 'approved', 'rejected', 'closed']);
|
|
15
|
+
const WORK_STATUSES = Object.freeze(['planned', 'assigned', 'in_progress', 'completed', 'cancelled']);
|
|
16
|
+
|
|
17
|
+
function toDate(value) {
|
|
18
|
+
if (value === null || value === undefined || value === '') {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
23
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function formatDate(value, locales = 'it-CH', options = {}) {
|
|
27
|
+
const date = toDate(value);
|
|
28
|
+
if (!date) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return new Intl.DateTimeFormat(locales, {
|
|
33
|
+
year: 'numeric',
|
|
34
|
+
month: '2-digit',
|
|
35
|
+
day: '2-digit',
|
|
36
|
+
...options,
|
|
37
|
+
}).format(date);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function formatDateTime(value, locales = 'it-CH', options = {}) {
|
|
41
|
+
const date = toDate(value);
|
|
42
|
+
if (!date) {
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return new Intl.DateTimeFormat(locales, {
|
|
47
|
+
year: 'numeric',
|
|
48
|
+
month: '2-digit',
|
|
49
|
+
day: '2-digit',
|
|
50
|
+
hour: '2-digit',
|
|
51
|
+
minute: '2-digit',
|
|
52
|
+
...options,
|
|
53
|
+
}).format(date);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function formatCurrency(amount, currency = 'CHF', locales = 'it-CH', options = {}) {
|
|
57
|
+
if (amount === null || amount === undefined || amount === '') {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const numericAmount = Number(amount);
|
|
62
|
+
if (Number.isNaN(numericAmount)) {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return new Intl.NumberFormat(locales, {
|
|
67
|
+
style: 'currency',
|
|
68
|
+
currency,
|
|
69
|
+
...options,
|
|
70
|
+
}).format(numericAmount);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getUserFullName(user) {
|
|
74
|
+
return [user?.first_name, user?.last_name].filter(Boolean).join(' ').trim();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function formatAddress(entity) {
|
|
78
|
+
if (!entity) {
|
|
79
|
+
return '';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const line1 = [entity.address_line1, entity.address_line2].filter(Boolean).join(', ');
|
|
83
|
+
const line2 = [entity.postal_code, entity.city].filter(Boolean).join(' ');
|
|
84
|
+
|
|
85
|
+
return [line1, line2, entity.country_code].filter(Boolean).join(', ');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function hasUserRole(userRoles, role) {
|
|
89
|
+
return (userRoles ?? []).some((userRole) => {
|
|
90
|
+
if (typeof userRole === 'string') {
|
|
91
|
+
return userRole === role;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return userRole?.role === role;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function hasAccessChannel(accessChannels, channel) {
|
|
99
|
+
return (accessChannels ?? []).some((accessChannel) => {
|
|
100
|
+
if (typeof accessChannel === 'string') {
|
|
101
|
+
return accessChannel === channel;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return accessChannel?.channel === channel && accessChannel?.status !== 'revoked';
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function getColorPalette(){
|
|
109
|
+
return {
|
|
110
|
+
"parcoCeresio": {
|
|
111
|
+
|
|
112
|
+
},
|
|
113
|
+
"general": {
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
module.exports = {
|
|
120
|
+
ACCESS_CHANNELS,
|
|
121
|
+
ACCESS_STATUSES,
|
|
122
|
+
CLAIM_STATUSES,
|
|
123
|
+
CONDITION_STATUSES,
|
|
124
|
+
INSPECTION_STATUSES,
|
|
125
|
+
INSPECTION_TYPES,
|
|
126
|
+
LEASE_STATUSES,
|
|
127
|
+
MANAGEMENT_ROLES,
|
|
128
|
+
PROPERTY_STATUSES,
|
|
129
|
+
PROPERTY_TYPES,
|
|
130
|
+
USER_ROLES,
|
|
131
|
+
USER_STATUSES,
|
|
132
|
+
WORK_STATUSES,
|
|
133
|
+
formatAddress,
|
|
134
|
+
formatCurrency,
|
|
135
|
+
formatDate,
|
|
136
|
+
formatDateTime,
|
|
137
|
+
getUserFullName,
|
|
138
|
+
hasAccessChannel,
|
|
139
|
+
hasUserRole,
|
|
140
|
+
toDate,
|
|
141
|
+
};
|
package/index.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import pkg from './index.js';
|
|
2
|
+
|
|
3
|
+
export const {
|
|
4
|
+
ACCESS_CHANNELS,
|
|
5
|
+
ACCESS_STATUSES,
|
|
6
|
+
CLAIM_STATUSES,
|
|
7
|
+
CONDITION_STATUSES,
|
|
8
|
+
INSPECTION_STATUSES,
|
|
9
|
+
INSPECTION_TYPES,
|
|
10
|
+
LEASE_STATUSES,
|
|
11
|
+
MANAGEMENT_ROLES,
|
|
12
|
+
PROPERTY_STATUSES,
|
|
13
|
+
PROPERTY_TYPES,
|
|
14
|
+
USER_ROLES,
|
|
15
|
+
USER_STATUSES,
|
|
16
|
+
WORK_STATUSES,
|
|
17
|
+
formatAddress,
|
|
18
|
+
formatCurrency,
|
|
19
|
+
formatDate,
|
|
20
|
+
formatDateTime,
|
|
21
|
+
getUserFullName,
|
|
22
|
+
hasAccessChannel,
|
|
23
|
+
hasUserRole,
|
|
24
|
+
toDate,
|
|
25
|
+
} = pkg;
|
|
26
|
+
|
|
27
|
+
export default pkg;
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jaws-developers-customers/consulca-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Tipi e helper per il dominio Consulca.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"consulca",
|
|
7
|
+
"mariadb",
|
|
8
|
+
"types",
|
|
9
|
+
"helpers",
|
|
10
|
+
"formatter"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/JAWS-Developers-Customers/15-NPMPackage#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/JAWS-Developers-Customers/15-NPMPackage/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/JAWS-Developers-Customers/15-NPMPackage.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"author": "JAWS-Developers-Customers",
|
|
22
|
+
"type": "commonjs",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"require": "./index.js",
|
|
27
|
+
"import": "./index.mjs",
|
|
28
|
+
"default": "./index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"main": "index.js",
|
|
32
|
+
"types": "index.d.ts",
|
|
33
|
+
"directories": {
|
|
34
|
+
"test": "test"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"index.js",
|
|
38
|
+
"index.mjs",
|
|
39
|
+
"index.d.ts",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"test": "node --test"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
}
|
|
48
|
+
}
|