@vulog/aima-user 1.2.38 → 1.2.39
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 +2 -2
- package/dist/index.d.cts +46 -40
- package/dist/index.d.mts +46 -40
- package/dist/index.mjs +2 -2
- package/package.json +6 -6
- package/src/getFleetBillingGroups.ts +2 -2
- package/src/getUsers.ts +2 -2
- package/tsconfig.json +1 -8
- package/vitest.config.ts +1 -8
package/dist/index.cjs
CHANGED
|
@@ -388,7 +388,7 @@ const getEntity = async (client, entityId) => {
|
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/getFleetBillingGroups.ts
|
|
390
390
|
const getFleetBillingGroups = async (client, options) => {
|
|
391
|
-
const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)().
|
|
391
|
+
const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)().safeParse(options ?? {});
|
|
392
392
|
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
393
393
|
const finalOptions = resultOptions.data;
|
|
394
394
|
const searchParams = new URLSearchParams();
|
|
@@ -437,7 +437,7 @@ const sortSchema = zod.z.enum([
|
|
|
437
437
|
"updateDate"
|
|
438
438
|
]);
|
|
439
439
|
const getUsers = async (client, options) => {
|
|
440
|
-
const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).
|
|
440
|
+
const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).safeParse(options ?? {});
|
|
441
441
|
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
442
442
|
const finalOptions = resultOptions.data;
|
|
443
443
|
const searchParams = new URLSearchParams();
|
package/dist/index.d.cts
CHANGED
|
@@ -105,10 +105,26 @@ type UserUpdateBody = Partial<Omit<User, 'id' | 'fleetId' | 'agreements' | 'prof
|
|
|
105
105
|
declare const personalInformationUserTypes: readonly ["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"];
|
|
106
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
107
|
type PersonalInformationUserType = (typeof personalInformationUserTypes)[number];
|
|
108
|
-
declare const personalInformationUserTypeSchema: z.ZodEnum<
|
|
108
|
+
declare const personalInformationUserTypeSchema: z.ZodEnum<{
|
|
109
|
+
IDENTITY: "IDENTITY";
|
|
110
|
+
USERNAME: "USERNAME";
|
|
111
|
+
BIRTH: "BIRTH";
|
|
112
|
+
NATIONALITY: "NATIONALITY";
|
|
113
|
+
NOTES: "NOTES";
|
|
114
|
+
GENDER: "GENDER";
|
|
115
|
+
PERSONAL_COMPANY: "PERSONAL_COMPANY";
|
|
116
|
+
FISCAL: "FISCAL";
|
|
117
|
+
ADDRESS: "ADDRESS";
|
|
118
|
+
MEMBERSHIP: "MEMBERSHIP";
|
|
119
|
+
}>;
|
|
109
120
|
declare const personalInformationProfileTypes: readonly ["ID_NUMBER", "PHONE_NUMBER", "EMAIL", "BILLING_ADDRESS"];
|
|
110
121
|
type PersonalInformationProfileType = (typeof personalInformationProfileTypes)[number];
|
|
111
|
-
declare const personalInformationProfileTypeSchema: z.ZodEnum<
|
|
122
|
+
declare const personalInformationProfileTypeSchema: z.ZodEnum<{
|
|
123
|
+
ID_NUMBER: "ID_NUMBER";
|
|
124
|
+
PHONE_NUMBER: "PHONE_NUMBER";
|
|
125
|
+
EMAIL: "EMAIL";
|
|
126
|
+
BILLING_ADDRESS: "BILLING_ADDRESS";
|
|
127
|
+
}>;
|
|
112
128
|
type PersonalInformationIdentity = {
|
|
113
129
|
firstName?: string;
|
|
114
130
|
lastName?: string;
|
|
@@ -254,33 +270,16 @@ declare const schema: z.ZodObject<{
|
|
|
254
270
|
actions: z.ZodArray<z.ZodObject<{
|
|
255
271
|
reasonForChange: z.ZodString;
|
|
256
272
|
serviceId: z.ZodString;
|
|
257
|
-
status: z.ZodEnum<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}, "strip", z.ZodTypeAny, {
|
|
268
|
-
disableEmailNotification: boolean;
|
|
269
|
-
operatorProfileId: string;
|
|
270
|
-
actions: {
|
|
271
|
-
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
272
|
-
serviceId: string;
|
|
273
|
-
reasonForChange: string;
|
|
274
|
-
}[];
|
|
275
|
-
}, {
|
|
276
|
-
disableEmailNotification: boolean;
|
|
277
|
-
operatorProfileId: string;
|
|
278
|
-
actions: {
|
|
279
|
-
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
280
|
-
serviceId: string;
|
|
281
|
-
reasonForChange: string;
|
|
282
|
-
}[];
|
|
283
|
-
}>;
|
|
273
|
+
status: z.ZodEnum<{
|
|
274
|
+
PENDING: "PENDING";
|
|
275
|
+
INCOMPLETE: "INCOMPLETE";
|
|
276
|
+
SUSPENDED: "SUSPENDED";
|
|
277
|
+
REJECTED: "REJECTED";
|
|
278
|
+
APPROVED: "APPROVED";
|
|
279
|
+
UNREGISTERED: "UNREGISTERED";
|
|
280
|
+
}>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
}, z.core.$strip>;
|
|
284
283
|
type ServicesUpdate = z.infer<typeof schema>;
|
|
285
284
|
declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
|
|
286
285
|
//#endregion
|
|
@@ -310,19 +309,26 @@ declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
|
|
|
310
309
|
//#endregion
|
|
311
310
|
//#region src/getUsers.d.ts
|
|
312
311
|
declare const userFiltersSchema: z.ZodObject<{
|
|
313
|
-
status: z.ZodOptional<z.ZodEnum<
|
|
314
|
-
|
|
312
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
313
|
+
PENDING: "PENDING";
|
|
314
|
+
INCOMPLETE: "INCOMPLETE";
|
|
315
|
+
SUSPENDED: "SUSPENDED";
|
|
316
|
+
REJECTED: "REJECTED";
|
|
317
|
+
APPROVED: "APPROVED";
|
|
318
|
+
}>>;
|
|
319
|
+
profileType: z.ZodOptional<z.ZodEnum<{
|
|
320
|
+
Single: "Single";
|
|
321
|
+
Business: "Business";
|
|
322
|
+
}>>;
|
|
315
323
|
serviceId: z.ZodOptional<z.ZodString>;
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
serviceId?: string | undefined;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
declare const sortSchema: z.ZodEnum<{
|
|
326
|
+
registrationDate: "registrationDate";
|
|
327
|
+
userName: "userName";
|
|
328
|
+
firstName: "firstName";
|
|
329
|
+
lastName: "lastName";
|
|
330
|
+
updateDate: "updateDate";
|
|
324
331
|
}>;
|
|
325
|
-
declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
|
|
326
332
|
type UserSort = z.infer<typeof sortSchema>;
|
|
327
333
|
type UserFilters = z.infer<typeof userFiltersSchema>;
|
|
328
334
|
declare const getUsers: (client: Client, options?: PaginableOptions<UserFilters, UserSort>) => Promise<PaginableResponse<UserStatus>>;
|
package/dist/index.d.mts
CHANGED
|
@@ -105,10 +105,26 @@ type UserUpdateBody = Partial<Omit<User, 'id' | 'fleetId' | 'agreements' | 'prof
|
|
|
105
105
|
declare const personalInformationUserTypes: readonly ["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"];
|
|
106
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
107
|
type PersonalInformationUserType = (typeof personalInformationUserTypes)[number];
|
|
108
|
-
declare const personalInformationUserTypeSchema: z.ZodEnum<
|
|
108
|
+
declare const personalInformationUserTypeSchema: z.ZodEnum<{
|
|
109
|
+
IDENTITY: "IDENTITY";
|
|
110
|
+
USERNAME: "USERNAME";
|
|
111
|
+
BIRTH: "BIRTH";
|
|
112
|
+
NATIONALITY: "NATIONALITY";
|
|
113
|
+
NOTES: "NOTES";
|
|
114
|
+
GENDER: "GENDER";
|
|
115
|
+
PERSONAL_COMPANY: "PERSONAL_COMPANY";
|
|
116
|
+
FISCAL: "FISCAL";
|
|
117
|
+
ADDRESS: "ADDRESS";
|
|
118
|
+
MEMBERSHIP: "MEMBERSHIP";
|
|
119
|
+
}>;
|
|
109
120
|
declare const personalInformationProfileTypes: readonly ["ID_NUMBER", "PHONE_NUMBER", "EMAIL", "BILLING_ADDRESS"];
|
|
110
121
|
type PersonalInformationProfileType = (typeof personalInformationProfileTypes)[number];
|
|
111
|
-
declare const personalInformationProfileTypeSchema: z.ZodEnum<
|
|
122
|
+
declare const personalInformationProfileTypeSchema: z.ZodEnum<{
|
|
123
|
+
ID_NUMBER: "ID_NUMBER";
|
|
124
|
+
PHONE_NUMBER: "PHONE_NUMBER";
|
|
125
|
+
EMAIL: "EMAIL";
|
|
126
|
+
BILLING_ADDRESS: "BILLING_ADDRESS";
|
|
127
|
+
}>;
|
|
112
128
|
type PersonalInformationIdentity = {
|
|
113
129
|
firstName?: string;
|
|
114
130
|
lastName?: string;
|
|
@@ -254,33 +270,16 @@ declare const schema: z.ZodObject<{
|
|
|
254
270
|
actions: z.ZodArray<z.ZodObject<{
|
|
255
271
|
reasonForChange: z.ZodString;
|
|
256
272
|
serviceId: z.ZodString;
|
|
257
|
-
status: z.ZodEnum<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}, "strip", z.ZodTypeAny, {
|
|
268
|
-
disableEmailNotification: boolean;
|
|
269
|
-
operatorProfileId: string;
|
|
270
|
-
actions: {
|
|
271
|
-
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
272
|
-
serviceId: string;
|
|
273
|
-
reasonForChange: string;
|
|
274
|
-
}[];
|
|
275
|
-
}, {
|
|
276
|
-
disableEmailNotification: boolean;
|
|
277
|
-
operatorProfileId: string;
|
|
278
|
-
actions: {
|
|
279
|
-
status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
|
|
280
|
-
serviceId: string;
|
|
281
|
-
reasonForChange: string;
|
|
282
|
-
}[];
|
|
283
|
-
}>;
|
|
273
|
+
status: z.ZodEnum<{
|
|
274
|
+
PENDING: "PENDING";
|
|
275
|
+
INCOMPLETE: "INCOMPLETE";
|
|
276
|
+
SUSPENDED: "SUSPENDED";
|
|
277
|
+
REJECTED: "REJECTED";
|
|
278
|
+
APPROVED: "APPROVED";
|
|
279
|
+
UNREGISTERED: "UNREGISTERED";
|
|
280
|
+
}>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
}, z.core.$strip>;
|
|
284
283
|
type ServicesUpdate = z.infer<typeof schema>;
|
|
285
284
|
declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
|
|
286
285
|
//#endregion
|
|
@@ -310,19 +309,26 @@ declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
|
|
|
310
309
|
//#endregion
|
|
311
310
|
//#region src/getUsers.d.ts
|
|
312
311
|
declare const userFiltersSchema: z.ZodObject<{
|
|
313
|
-
status: z.ZodOptional<z.ZodEnum<
|
|
314
|
-
|
|
312
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
313
|
+
PENDING: "PENDING";
|
|
314
|
+
INCOMPLETE: "INCOMPLETE";
|
|
315
|
+
SUSPENDED: "SUSPENDED";
|
|
316
|
+
REJECTED: "REJECTED";
|
|
317
|
+
APPROVED: "APPROVED";
|
|
318
|
+
}>>;
|
|
319
|
+
profileType: z.ZodOptional<z.ZodEnum<{
|
|
320
|
+
Single: "Single";
|
|
321
|
+
Business: "Business";
|
|
322
|
+
}>>;
|
|
315
323
|
serviceId: z.ZodOptional<z.ZodString>;
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
serviceId?: string | undefined;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
declare const sortSchema: z.ZodEnum<{
|
|
326
|
+
registrationDate: "registrationDate";
|
|
327
|
+
userName: "userName";
|
|
328
|
+
firstName: "firstName";
|
|
329
|
+
lastName: "lastName";
|
|
330
|
+
updateDate: "updateDate";
|
|
324
331
|
}>;
|
|
325
|
-
declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
|
|
326
332
|
type UserSort = z.infer<typeof sortSchema>;
|
|
327
333
|
type UserFilters = z.infer<typeof userFiltersSchema>;
|
|
328
334
|
declare const getUsers: (client: Client, options?: PaginableOptions<UserFilters, UserSort>) => Promise<PaginableResponse<UserStatus>>;
|
package/dist/index.mjs
CHANGED
|
@@ -387,7 +387,7 @@ const getEntity = async (client, entityId) => {
|
|
|
387
387
|
//#endregion
|
|
388
388
|
//#region src/getFleetBillingGroups.ts
|
|
389
389
|
const getFleetBillingGroups = async (client, options) => {
|
|
390
|
-
const resultOptions = createPaginableOptionsSchema().
|
|
390
|
+
const resultOptions = createPaginableOptionsSchema().safeParse(options ?? {});
|
|
391
391
|
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
392
392
|
const finalOptions = resultOptions.data;
|
|
393
393
|
const searchParams = new URLSearchParams();
|
|
@@ -436,7 +436,7 @@ const sortSchema = z.enum([
|
|
|
436
436
|
"updateDate"
|
|
437
437
|
]);
|
|
438
438
|
const getUsers = async (client, options) => {
|
|
439
|
-
const resultOptions = createPaginableOptionsSchema(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).
|
|
439
|
+
const resultOptions = createPaginableOptionsSchema(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).safeParse(options ?? {});
|
|
440
440
|
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
441
441
|
const finalOptions = resultOptions.data;
|
|
442
442
|
const searchParams = new URLSearchParams();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-user",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.39",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.cts",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"author": "Vulog",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vulog/aima-client": "1.2.
|
|
36
|
-
"@vulog/aima-config": "1.2.
|
|
37
|
-
"@vulog/aima-core": "1.2.
|
|
35
|
+
"@vulog/aima-client": "1.2.39",
|
|
36
|
+
"@vulog/aima-config": "1.2.39",
|
|
37
|
+
"@vulog/aima-core": "1.2.39"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"zod": "^3.
|
|
40
|
+
"zod": "^4.3.6"
|
|
41
41
|
},
|
|
42
42
|
"description": ""
|
|
43
|
-
}
|
|
43
|
+
}
|
|
@@ -8,9 +8,9 @@ export const getFleetBillingGroups = async (
|
|
|
8
8
|
client: Client,
|
|
9
9
|
options?: PaginableOptions
|
|
10
10
|
): Promise<PaginableResponse<BillingGroup>> => {
|
|
11
|
-
const PaginableOptionsSchema = createPaginableOptionsSchema()
|
|
11
|
+
const PaginableOptionsSchema = createPaginableOptionsSchema();
|
|
12
12
|
|
|
13
|
-
const resultOptions = PaginableOptionsSchema.safeParse(options);
|
|
13
|
+
const resultOptions = PaginableOptionsSchema.safeParse(options ?? {});
|
|
14
14
|
if (!resultOptions.success) {
|
|
15
15
|
throw new TypeError('Invalid options', {
|
|
16
16
|
cause: resultOptions.error.issues,
|
package/src/getUsers.ts
CHANGED
|
@@ -26,9 +26,9 @@ export const getUsers = async (
|
|
|
26
26
|
const paginableOptionsSchema = createPaginableOptionsSchema(
|
|
27
27
|
userFiltersSchema.default({}),
|
|
28
28
|
sortSchema.optional().default('registrationDate')
|
|
29
|
-
)
|
|
29
|
+
);
|
|
30
30
|
|
|
31
|
-
const resultOptions = paginableOptionsSchema.safeParse(options);
|
|
31
|
+
const resultOptions = paginableOptionsSchema.safeParse(options ?? {});
|
|
32
32
|
if (!resultOptions.success) {
|
|
33
33
|
throw new TypeError('Invalid options', {
|
|
34
34
|
cause: resultOptions.error.issues,
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
2
3
|
"include": ["src"],
|
|
3
4
|
"exclude": ["**/*.test.ts"],
|
|
4
5
|
"compilerOptions": {
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"target": "esnext",
|
|
7
|
-
"lib": ["esnext"],
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
6
|
"outDir": "dist",
|
|
14
7
|
"rootDir": "src"
|
|
15
8
|
}
|