@vulog/aima-user 1.2.29 → 1.2.31
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/index.cjs +483 -0
- package/dist/index.d.cts +327 -0
- package/dist/index.d.mts +222 -200
- package/dist/index.mjs +411 -570
- package/package.json +21 -8
- package/{tsup.config.ts → tsdown.config.ts} +1 -1
- package/dist/index.d.ts +0 -305
- package/dist/index.js +0 -668
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { Client } from "@vulog/aima-client";
|
|
2
|
+
import { Service } from "@vulog/aima-config";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { PaginableOptions, PaginableResponse, PatchAction } from "@vulog/aima-core";
|
|
5
|
+
|
|
6
|
+
//#region src/acceptTAndC.d.ts
|
|
7
|
+
declare const acceptTAndC: (client: Client, userId: string, cityId: string) => Promise<void>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/assignBillingGroup.d.ts
|
|
10
|
+
declare const assignBillingGroup: (client: Client, entityId: string, billingGroupId: string) => Promise<void>;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/unassignBillingGroup.d.ts
|
|
13
|
+
declare const unassignBillingGroup: (client: Client, entityId: string, billingGroupId: string) => Promise<void>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/types.d.ts
|
|
16
|
+
type Address = {
|
|
17
|
+
streetName?: string;
|
|
18
|
+
city?: string;
|
|
19
|
+
postalCode?: string;
|
|
20
|
+
region?: string;
|
|
21
|
+
country?: string;
|
|
22
|
+
number?: string;
|
|
23
|
+
addressAdditionalInformation?: string;
|
|
24
|
+
};
|
|
25
|
+
type IndividualBusiness = Address & {
|
|
26
|
+
companyName: string;
|
|
27
|
+
vat?: string;
|
|
28
|
+
};
|
|
29
|
+
type UserAgreement = {
|
|
30
|
+
cityId: string;
|
|
31
|
+
date: string;
|
|
32
|
+
hasAcceptedLatest: boolean;
|
|
33
|
+
};
|
|
34
|
+
type ProfileType = 'Single' | 'Business';
|
|
35
|
+
type ProfileStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'SUSPENDED' | 'INACTIVE' | 'ARCHIVED' | 'PENDING_REGISTRATION';
|
|
36
|
+
type ServiceStatus = {
|
|
37
|
+
cityId: string;
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
status: string;
|
|
41
|
+
visibility: string;
|
|
42
|
+
};
|
|
43
|
+
type UserProfile = {
|
|
44
|
+
id: string;
|
|
45
|
+
rfid?: string;
|
|
46
|
+
creationDate: string;
|
|
47
|
+
updateDate?: string;
|
|
48
|
+
entityId: string;
|
|
49
|
+
entityName: string;
|
|
50
|
+
status: ProfileStatus;
|
|
51
|
+
type: ProfileType;
|
|
52
|
+
emailConsent: boolean;
|
|
53
|
+
services: ServiceStatus[];
|
|
54
|
+
};
|
|
55
|
+
type ServicesRegistrationList = {
|
|
56
|
+
approved: string[];
|
|
57
|
+
incomplete: string[];
|
|
58
|
+
pending: string[];
|
|
59
|
+
rejected: string[];
|
|
60
|
+
suspended: string[];
|
|
61
|
+
unregistered: string[];
|
|
62
|
+
};
|
|
63
|
+
type ServiceRegistrationWithReason = {
|
|
64
|
+
serviceId: string;
|
|
65
|
+
reason: string;
|
|
66
|
+
status: string;
|
|
67
|
+
};
|
|
68
|
+
type ProfileServiceRegistration = {
|
|
69
|
+
profileId: string;
|
|
70
|
+
profileType: ProfileType;
|
|
71
|
+
profileStatus: ProfileStatus;
|
|
72
|
+
services: ServicesRegistrationList;
|
|
73
|
+
reasonsForChange: ServiceRegistrationWithReason[];
|
|
74
|
+
};
|
|
75
|
+
type UserServiceRegistration = {
|
|
76
|
+
catalog: Service[];
|
|
77
|
+
profiles: ProfileServiceRegistration[];
|
|
78
|
+
};
|
|
79
|
+
declare const accountStatus: readonly ["INCOMPLETE", "PENDING", "APPROVED", "REJECTED", "SUSPENDED", "ARCHIVED"];
|
|
80
|
+
type AccountStatus = (typeof accountStatus)[number];
|
|
81
|
+
type User = {
|
|
82
|
+
fleetId: string;
|
|
83
|
+
id: string;
|
|
84
|
+
registrationDate: string;
|
|
85
|
+
accountStatus?: AccountStatus;
|
|
86
|
+
locale: string;
|
|
87
|
+
agreements: UserAgreement[];
|
|
88
|
+
profiles: UserProfile[];
|
|
89
|
+
dataPrivacyConsent: boolean;
|
|
90
|
+
marketingConsent: boolean;
|
|
91
|
+
surveyConsent: boolean;
|
|
92
|
+
shareDataConsent: boolean;
|
|
93
|
+
surveyConsentUpdateDate: string;
|
|
94
|
+
shareDataConsentUpdateDate: string;
|
|
95
|
+
profilingConsent: boolean;
|
|
96
|
+
profilingConsentUpdateDate: string;
|
|
97
|
+
membershipNumber: string;
|
|
98
|
+
updateDate: string;
|
|
99
|
+
dateOfAgreements: string;
|
|
100
|
+
};
|
|
101
|
+
type UserStatus = Exclude<User, 'agreements' | 'profiles'> & {
|
|
102
|
+
profiles: ProfileServiceRegistration[];
|
|
103
|
+
};
|
|
104
|
+
type UserUpdateBody = Partial<Omit<User, 'id' | 'fleetId' | 'agreements' | 'profiles' | 'surveyConsentUpdateDate' | 'shareDataConsentUpdateDate' | 'profilingConsentUpdateDate'>>;
|
|
105
|
+
declare const personalInformationUserTypes: readonly ["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"];
|
|
106
|
+
declare const personalInformationUserPaths: readonly ["/identity/firstName", "/identity/lastName", "/identity/middleName", "/identity/preferredName", "/birth/birthDate", "/birth/countryBirth", "/birth/provinceBirth", "/birth/cityBirth", "/nationality", "/notes", "/gender", "/personalCompany/companyName", "/personalCompany/companyVat", "/personalCompany/companyAddress/streetName", "/personalCompany/companyAddress/city", "/personalCompany/companyAddress/postalCode", "/personalCompany/companyAddress/region", "/personalCompany/companyAddress/country", "/personalCompany/companyAddress/number", "/personalCompany/companyAddress/addressAdditionalInformation", "/fiscalInformation/fiscal", "/fiscalInformation/personalVatNumber", "/fiscalInformation/sdi", "/fiscalInformation/pecAddress", "/fiscalInformation/marketReference", "/address/streetName", "/address/city", "/address/postalCode", "/address/region", "/address/country", "/address/number", "/address/addressAdditionalInformation", "/membership"];
|
|
107
|
+
type PersonalInformationUserType = (typeof personalInformationUserTypes)[number];
|
|
108
|
+
declare const personalInformationUserTypeSchema: z.ZodEnum<["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"]>;
|
|
109
|
+
declare const personalInformationProfileTypes: readonly ["ID_NUMBER", "PHONE_NUMBER", "EMAIL", "BILLING_ADDRESS"];
|
|
110
|
+
type PersonalInformationProfileType = (typeof personalInformationProfileTypes)[number];
|
|
111
|
+
declare const personalInformationProfileTypeSchema: z.ZodEnum<["ID_NUMBER", "PHONE_NUMBER", "EMAIL", "BILLING_ADDRESS"]>;
|
|
112
|
+
type PersonalInformationIdentity = {
|
|
113
|
+
firstName?: string;
|
|
114
|
+
lastName?: string;
|
|
115
|
+
middleName?: string;
|
|
116
|
+
preferredName?: string;
|
|
117
|
+
};
|
|
118
|
+
type PersonalInformationBirth = {
|
|
119
|
+
birthDate?: string;
|
|
120
|
+
countryBirth?: string;
|
|
121
|
+
provinceBirth?: string;
|
|
122
|
+
cityBirth?: string;
|
|
123
|
+
};
|
|
124
|
+
type PersonalCompany = {
|
|
125
|
+
companyName?: string;
|
|
126
|
+
companyVat?: string;
|
|
127
|
+
companyAddress?: Address;
|
|
128
|
+
};
|
|
129
|
+
type FiscalInformation = {
|
|
130
|
+
fiscal?: string;
|
|
131
|
+
personalVatNumber?: string;
|
|
132
|
+
sdi?: string;
|
|
133
|
+
pecAddress?: string;
|
|
134
|
+
marketReference?: string;
|
|
135
|
+
};
|
|
136
|
+
type PersonalInformationUser = {
|
|
137
|
+
fleetId: string;
|
|
138
|
+
userId: string;
|
|
139
|
+
userName?: string;
|
|
140
|
+
identity?: PersonalInformationIdentity;
|
|
141
|
+
birth?: PersonalInformationBirth;
|
|
142
|
+
nationality?: string;
|
|
143
|
+
notes?: string;
|
|
144
|
+
gender?: 'MALE' | 'FEMALE' | 'UNDEFINED';
|
|
145
|
+
personalCompany?: PersonalCompany;
|
|
146
|
+
fiscalInformation?: FiscalInformation;
|
|
147
|
+
address?: Address;
|
|
148
|
+
membership?: string;
|
|
149
|
+
};
|
|
150
|
+
type PersonalInformationProfile = {
|
|
151
|
+
fleetId: string;
|
|
152
|
+
userId: string;
|
|
153
|
+
profileId: string;
|
|
154
|
+
idNumber?: string;
|
|
155
|
+
phoneNumber?: string;
|
|
156
|
+
email?: string;
|
|
157
|
+
billingAddress?: Address;
|
|
158
|
+
};
|
|
159
|
+
type Label = {
|
|
160
|
+
id: number;
|
|
161
|
+
name: string;
|
|
162
|
+
createDate: string;
|
|
163
|
+
};
|
|
164
|
+
type Entity = {
|
|
165
|
+
id: string;
|
|
166
|
+
fleetId: string;
|
|
167
|
+
name: string;
|
|
168
|
+
entityName: string;
|
|
169
|
+
type: 'Personal' | 'Business';
|
|
170
|
+
status: 'APPROVED' | 'PENDING' | 'REJECTED' | 'SUSPENDED' | 'INACTIVE' | 'ARCHIVED';
|
|
171
|
+
isMasterEntity: boolean;
|
|
172
|
+
billingGroupId: string | null;
|
|
173
|
+
billingGroup: string | null;
|
|
174
|
+
billingAddress: Address | null;
|
|
175
|
+
fiscalCode: string | null;
|
|
176
|
+
services: Service[];
|
|
177
|
+
};
|
|
178
|
+
type Profile = UserProfile & {
|
|
179
|
+
entity: Entity;
|
|
180
|
+
};
|
|
181
|
+
type UserFull = User & {
|
|
182
|
+
profiles: Profile[];
|
|
183
|
+
};
|
|
184
|
+
type BillingGroup = {
|
|
185
|
+
id: string;
|
|
186
|
+
fleetId: string;
|
|
187
|
+
name: string;
|
|
188
|
+
discount: number;
|
|
189
|
+
overMileageCap: number | null;
|
|
190
|
+
overMileageRate: number | null;
|
|
191
|
+
};
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/createBusinessProfile.d.ts
|
|
194
|
+
type CreateBusinessProfile = {
|
|
195
|
+
emailConsent: boolean;
|
|
196
|
+
email: string;
|
|
197
|
+
requestId: string;
|
|
198
|
+
costCenterId: string;
|
|
199
|
+
};
|
|
200
|
+
declare const createBusinessProfile: (client: Client, userId: string, businessId: string, data: CreateBusinessProfile) => Promise<UserProfile>;
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/createUser.d.ts
|
|
203
|
+
type CreateUser = {
|
|
204
|
+
userName: string;
|
|
205
|
+
password: string;
|
|
206
|
+
locale: string;
|
|
207
|
+
email: string;
|
|
208
|
+
dataPrivacyConsent?: boolean;
|
|
209
|
+
profilingConsent?: boolean;
|
|
210
|
+
marketingConsent?: boolean;
|
|
211
|
+
phoneNumber?: string;
|
|
212
|
+
};
|
|
213
|
+
type CreateUserOptions = {
|
|
214
|
+
tcApproval?: boolean;
|
|
215
|
+
skipUserNotification?: boolean;
|
|
216
|
+
};
|
|
217
|
+
declare const createUser: (client: Client, user: CreateUser, option?: CreateUserOptions) => Promise<User>;
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/findUser.d.ts
|
|
220
|
+
declare const searchTypes: readonly ["email", "username", "phoneNumber"];
|
|
221
|
+
type SearchType = (typeof searchTypes)[number];
|
|
222
|
+
type ResponseFind = {
|
|
223
|
+
content: PersonalInformationUser[];
|
|
224
|
+
};
|
|
225
|
+
declare const findUser: (client: Client, searchType: SearchType, searchQuery: string, types: PersonalInformationUserType[]) => Promise<ResponseFind>;
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/getProfilePersonalInfoById.d.ts
|
|
228
|
+
declare const getProfilePersonalInfoById: (client: Client, userId: string, profileId: string, types: PersonalInformationProfileType[]) => Promise<PersonalInformationProfile>;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/getRegistrationOverview.d.ts
|
|
231
|
+
declare const getRegistrationOverview: (client: Client, userId: string) => Promise<UserServiceRegistration>;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/getUserById.d.ts
|
|
234
|
+
declare const getUserById: (client: Client, id: string, addAccountStatus?: boolean) => Promise<User>;
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/getUserPersonalInfoById.d.ts
|
|
237
|
+
declare const getUserPersonalInfoById: (client: Client, id: string, types: PersonalInformationUserType[]) => Promise<PersonalInformationUser>;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/getUsersPIByIds.d.ts
|
|
240
|
+
declare const getUsersPIByIds: (client: Client, ids: string[], types: PersonalInformationUserType[]) => Promise<PersonalInformationUser[]>;
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/label.d.ts
|
|
243
|
+
declare const getLabelsForUser: (client: Client, userId: string) => Promise<Label[]>;
|
|
244
|
+
declare const addLabelForUser: (client: Client, userId: string, labelId: number) => Promise<void>;
|
|
245
|
+
declare const removeLabelForUser: (client: Client, userId: string, labelId: number) => Promise<void>;
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/setServicesStatus.d.ts
|
|
248
|
+
declare const schema: z.ZodObject<{
|
|
249
|
+
disableEmailNotification: z.ZodBoolean;
|
|
250
|
+
operatorProfileId: z.ZodString;
|
|
251
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
252
|
+
reasonForChange: z.ZodString;
|
|
253
|
+
serviceId: z.ZodString;
|
|
254
|
+
status: z.ZodEnum<["APPROVED", "INCOMPLETE", "PENDING", "REJECTED", "SUSPENDED", "UNREGISTERED"]>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
257
|
+
serviceId: string;
|
|
258
|
+
reasonForChange: string;
|
|
259
|
+
}, {
|
|
260
|
+
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
261
|
+
serviceId: string;
|
|
262
|
+
reasonForChange: string;
|
|
263
|
+
}>, "many">;
|
|
264
|
+
}, "strip", z.ZodTypeAny, {
|
|
265
|
+
disableEmailNotification: boolean;
|
|
266
|
+
operatorProfileId: string;
|
|
267
|
+
actions: {
|
|
268
|
+
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
269
|
+
serviceId: string;
|
|
270
|
+
reasonForChange: string;
|
|
271
|
+
}[];
|
|
272
|
+
}, {
|
|
273
|
+
disableEmailNotification: boolean;
|
|
274
|
+
operatorProfileId: string;
|
|
275
|
+
actions: {
|
|
276
|
+
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
277
|
+
serviceId: string;
|
|
278
|
+
reasonForChange: string;
|
|
279
|
+
}[];
|
|
280
|
+
}>;
|
|
281
|
+
type ServicesUpdate = z.infer<typeof schema>;
|
|
282
|
+
declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region src/registerUserToService.d.ts
|
|
285
|
+
declare const registerUserToService: (client: Client, entityId: string, serviceId: string) => Promise<void>;
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/updateProfilePersonalInfo.d.ts
|
|
288
|
+
declare const paths: readonly ["/phoneNumber", "/email", "/idNumber"];
|
|
289
|
+
type ProfilePaths = (typeof paths)[number];
|
|
290
|
+
declare const updateProfilePersonalInfo: (client: Client, userId: string, profileId: string, actions: PatchAction<ProfilePaths>[]) => Promise<void>;
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/updateUser.d.ts
|
|
293
|
+
declare const updateUser: (client: Client, id: string, user: UserUpdateBody) => Promise<User>;
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/updateUserPersonalInfo.d.ts
|
|
296
|
+
type UserPaths = (typeof personalInformationUserPaths)[number];
|
|
297
|
+
declare const updateUserPersonalInfo: (client: Client, userId: string, actions: PatchAction<UserPaths>[]) => Promise<void>;
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/getEntity.d.ts
|
|
300
|
+
declare const getEntity: (client: Client, entityId: string) => Promise<Entity>;
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/getFleetBillingGroups.d.ts
|
|
303
|
+
declare const getFleetBillingGroups: (client: Client, options?: PaginableOptions) => Promise<PaginableResponse<BillingGroup>>;
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/getUsersByIds.d.ts
|
|
306
|
+
declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/getUsers.d.ts
|
|
309
|
+
declare const userFiltersSchema: z.ZodObject<{
|
|
310
|
+
status: z.ZodOptional<z.ZodEnum<["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]>>;
|
|
311
|
+
profileType: z.ZodOptional<z.ZodEnum<["Single", "Business"]>>;
|
|
312
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
status?: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | undefined;
|
|
315
|
+
profileType?: "Single" | "Business" | undefined;
|
|
316
|
+
serviceId?: string | undefined;
|
|
317
|
+
}, {
|
|
318
|
+
status?: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | undefined;
|
|
319
|
+
profileType?: "Single" | "Business" | undefined;
|
|
320
|
+
serviceId?: string | undefined;
|
|
321
|
+
}>;
|
|
322
|
+
declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
|
|
323
|
+
type UserSort = z.infer<typeof sortSchema>;
|
|
324
|
+
type UserFilters = z.infer<typeof userFiltersSchema>;
|
|
325
|
+
declare const getUsers: (client: Client, options?: PaginableOptions<UserFilters, UserSort>) => Promise<PaginableResponse<UserStatus>>;
|
|
326
|
+
//#endregion
|
|
327
|
+
export { AccountStatus, Address, BillingGroup, CreateBusinessProfile, CreateUser, CreateUserOptions, Entity, FiscalInformation, IndividualBusiness, Label, PersonalCompany, PersonalInformationBirth, PersonalInformationIdentity, PersonalInformationProfile, PersonalInformationProfileType, PersonalInformationUser, PersonalInformationUserType, Profile, ProfilePaths, ProfileServiceRegistration, ProfileStatus, ProfileType, ResponseFind, SearchType, ServiceRegistrationWithReason, ServiceStatus, ServicesRegistrationList, ServicesUpdate, User, UserAgreement, UserFilters, UserFull, UserPaths, UserProfile, UserServiceRegistration, UserSort, UserStatus, UserUpdateBody, acceptTAndC, accountStatus, addLabelForUser, assignBillingGroup, createBusinessProfile, createUser, findUser, getEntity, getFleetBillingGroups, getLabelsForUser, getProfilePersonalInfoById, getRegistrationOverview, getUserById, getUserPersonalInfoById, getUsers, getUsersByIds, getUsersPIByIds, personalInformationProfileTypeSchema, personalInformationProfileTypes, personalInformationUserPaths, personalInformationUserTypeSchema, personalInformationUserTypes, registerUserToService, removeLabelForUser, setServicesStatus, unassignBillingGroup, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
|