@vulog/aima-user 1.2.8 → 1.2.10
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.d.mts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +46 -0
- package/dist/index.mjs +45 -0
- package/package.json +4 -4
- package/src/getUsers.ts +63 -0
- package/src/index.ts +1 -0
- package/src/types.ts +5 -0
package/dist/index.d.mts
CHANGED
|
@@ -75,6 +75,7 @@ type AccountStatus = (typeof accountStatus)[number];
|
|
|
75
75
|
type User = {
|
|
76
76
|
fleetId: string;
|
|
77
77
|
id: string;
|
|
78
|
+
registrationDate: string;
|
|
78
79
|
accountStatus?: AccountStatus;
|
|
79
80
|
locale: string;
|
|
80
81
|
agreements: UserAgreement[];
|
|
@@ -89,6 +90,9 @@ type User = {
|
|
|
89
90
|
profilingConsentUpdateDate: string;
|
|
90
91
|
membershipNumber: string;
|
|
91
92
|
};
|
|
93
|
+
type UserStatus = Exclude<User, 'agreements' | 'profiles'> & {
|
|
94
|
+
profiles: ProfileServiceRegistration[];
|
|
95
|
+
};
|
|
92
96
|
type UserUpdateBody = Partial<Omit<User, 'id' | 'fleetId' | 'agreements' | 'profiles' | 'surveyConsentUpdateDate' | 'shareDataConsentUpdateDate' | 'profilingConsentUpdateDate'>>;
|
|
93
97
|
declare const personalInformationUserTypes: readonly ["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"];
|
|
94
98
|
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"];
|
|
@@ -276,4 +280,22 @@ declare const getFleetBillingGroups: (client: Client, options?: PaginableOptions
|
|
|
276
280
|
|
|
277
281
|
declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
|
|
278
282
|
|
|
279
|
-
|
|
283
|
+
declare const userFiltersSchema: z.ZodObject<{
|
|
284
|
+
status: z.ZodOptional<z.ZodEnum<["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]>>;
|
|
285
|
+
profileType: z.ZodOptional<z.ZodEnum<["Single", "Business"]>>;
|
|
286
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
status?: "PENDING" | "APPROVED" | "REJECTED" | "SUSPENDED" | "INCOMPLETE" | undefined;
|
|
289
|
+
serviceId?: string | undefined;
|
|
290
|
+
profileType?: "Single" | "Business" | undefined;
|
|
291
|
+
}, {
|
|
292
|
+
status?: "PENDING" | "APPROVED" | "REJECTED" | "SUSPENDED" | "INCOMPLETE" | undefined;
|
|
293
|
+
serviceId?: string | undefined;
|
|
294
|
+
profileType?: "Single" | "Business" | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
|
|
297
|
+
type UserSort = z.infer<typeof sortSchema>;
|
|
298
|
+
type UserFilters = z.infer<typeof userFiltersSchema>;
|
|
299
|
+
declare const getUsers: (client: Client, options?: PaginableOptions<UserFilters, UserSort>) => Promise<PaginableResponse<UserStatus>>;
|
|
300
|
+
|
|
301
|
+
export { type AccountStatus, type Address, type BillingGroup, type CreateBusinessProfile, type CreateUser, type CreateUserOptions, type Entity, type FiscalInformation, type IndividualBusiness, type Label, type PersonalCompany, type PersonalInformationBirth, type PersonalInformationIdentity, type PersonalInformationProfile, type PersonalInformationProfileType, type PersonalInformationUser, type PersonalInformationUserType, type Profile, type ProfilePaths, type ProfileServiceRegistration, type ProfileStatus, type ProfileType, type ResponseFind, type SearchType, type ServiceRegistrationWithReason, type ServiceStatus, type ServicesRegistrationList, type ServicesUpdate, type User, type UserAgreement, type UserFilters, type UserFull, type UserPaths, type UserProfile, type UserServiceRegistration, type UserSort, type UserStatus, type 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, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
|
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ type AccountStatus = (typeof accountStatus)[number];
|
|
|
75
75
|
type User = {
|
|
76
76
|
fleetId: string;
|
|
77
77
|
id: string;
|
|
78
|
+
registrationDate: string;
|
|
78
79
|
accountStatus?: AccountStatus;
|
|
79
80
|
locale: string;
|
|
80
81
|
agreements: UserAgreement[];
|
|
@@ -89,6 +90,9 @@ type User = {
|
|
|
89
90
|
profilingConsentUpdateDate: string;
|
|
90
91
|
membershipNumber: string;
|
|
91
92
|
};
|
|
93
|
+
type UserStatus = Exclude<User, 'agreements' | 'profiles'> & {
|
|
94
|
+
profiles: ProfileServiceRegistration[];
|
|
95
|
+
};
|
|
92
96
|
type UserUpdateBody = Partial<Omit<User, 'id' | 'fleetId' | 'agreements' | 'profiles' | 'surveyConsentUpdateDate' | 'shareDataConsentUpdateDate' | 'profilingConsentUpdateDate'>>;
|
|
93
97
|
declare const personalInformationUserTypes: readonly ["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"];
|
|
94
98
|
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"];
|
|
@@ -276,4 +280,22 @@ declare const getFleetBillingGroups: (client: Client, options?: PaginableOptions
|
|
|
276
280
|
|
|
277
281
|
declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
|
|
278
282
|
|
|
279
|
-
|
|
283
|
+
declare const userFiltersSchema: z.ZodObject<{
|
|
284
|
+
status: z.ZodOptional<z.ZodEnum<["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]>>;
|
|
285
|
+
profileType: z.ZodOptional<z.ZodEnum<["Single", "Business"]>>;
|
|
286
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
status?: "PENDING" | "APPROVED" | "REJECTED" | "SUSPENDED" | "INCOMPLETE" | undefined;
|
|
289
|
+
serviceId?: string | undefined;
|
|
290
|
+
profileType?: "Single" | "Business" | undefined;
|
|
291
|
+
}, {
|
|
292
|
+
status?: "PENDING" | "APPROVED" | "REJECTED" | "SUSPENDED" | "INCOMPLETE" | undefined;
|
|
293
|
+
serviceId?: string | undefined;
|
|
294
|
+
profileType?: "Single" | "Business" | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
|
|
297
|
+
type UserSort = z.infer<typeof sortSchema>;
|
|
298
|
+
type UserFilters = z.infer<typeof userFiltersSchema>;
|
|
299
|
+
declare const getUsers: (client: Client, options?: PaginableOptions<UserFilters, UserSort>) => Promise<PaginableResponse<UserStatus>>;
|
|
300
|
+
|
|
301
|
+
export { type AccountStatus, type Address, type BillingGroup, type CreateBusinessProfile, type CreateUser, type CreateUserOptions, type Entity, type FiscalInformation, type IndividualBusiness, type Label, type PersonalCompany, type PersonalInformationBirth, type PersonalInformationIdentity, type PersonalInformationProfile, type PersonalInformationProfileType, type PersonalInformationUser, type PersonalInformationUserType, type Profile, type ProfilePaths, type ProfileServiceRegistration, type ProfileStatus, type ProfileType, type ResponseFind, type SearchType, type ServiceRegistrationWithReason, type ServiceStatus, type ServicesRegistrationList, type ServicesUpdate, type User, type UserAgreement, type UserFilters, type UserFull, type UserPaths, type UserProfile, type UserServiceRegistration, type UserSort, type UserStatus, type 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, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
getRegistrationOverview: () => getRegistrationOverview,
|
|
35
35
|
getUserById: () => getUserById,
|
|
36
36
|
getUserPersonalInfoById: () => getUserPersonalInfoById,
|
|
37
|
+
getUsers: () => getUsers,
|
|
37
38
|
getUsersByIds: () => getUsersByIds,
|
|
38
39
|
getUsersPIByIds: () => getUsersPIByIds,
|
|
39
40
|
personalInformationProfileTypeSchema: () => personalInformationProfileTypeSchema,
|
|
@@ -570,6 +571,50 @@ var getUsersByIds = async (client, ids) => {
|
|
|
570
571
|
}
|
|
571
572
|
return client.post(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users/list`, result.data.ids).then(({ data }) => data);
|
|
572
573
|
};
|
|
574
|
+
|
|
575
|
+
// src/getUsers.ts
|
|
576
|
+
var import_aima_core2 = require("@vulog/aima-core");
|
|
577
|
+
var import_zod20 = require("zod");
|
|
578
|
+
var statusSchema = import_zod20.z.enum(["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]);
|
|
579
|
+
var profileTypeSchema = import_zod20.z.enum(["Single", "Business"]);
|
|
580
|
+
var userFiltersSchema = import_zod20.z.object({
|
|
581
|
+
status: statusSchema.optional(),
|
|
582
|
+
profileType: profileTypeSchema.optional(),
|
|
583
|
+
serviceId: import_zod20.z.string().uuid().optional()
|
|
584
|
+
});
|
|
585
|
+
var sortSchema = import_zod20.z.enum(["registrationDate", "userName", "firstName", "lastName", "updateDate"]);
|
|
586
|
+
var getUsers = async (client, options) => {
|
|
587
|
+
const paginableOptionsSchema = (0, import_aima_core2.createPaginableOptionsSchema)(
|
|
588
|
+
userFiltersSchema.default({}),
|
|
589
|
+
sortSchema.optional().default("registrationDate")
|
|
590
|
+
).default({});
|
|
591
|
+
const resultOptions = paginableOptionsSchema.safeParse(options);
|
|
592
|
+
if (!resultOptions.success) {
|
|
593
|
+
throw new TypeError("Invalid options", {
|
|
594
|
+
cause: resultOptions.error.issues
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
const finalOptions = resultOptions.data;
|
|
598
|
+
const searchParams = new URLSearchParams();
|
|
599
|
+
searchParams.append("page", finalOptions.page.toString());
|
|
600
|
+
searchParams.append("pageSize", finalOptions.pageSize.toString());
|
|
601
|
+
searchParams.append("sort", `${finalOptions.sort.toString()},${finalOptions.sortDirection.toString()}`);
|
|
602
|
+
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
603
|
+
if (value === void 0) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
searchParams.append(key, value);
|
|
607
|
+
});
|
|
608
|
+
return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users?${searchParams.toString()}`).then(({ data, headers }) => {
|
|
609
|
+
return {
|
|
610
|
+
data,
|
|
611
|
+
page: headers.number,
|
|
612
|
+
pageSize: headers.size,
|
|
613
|
+
total: headers.totalelements,
|
|
614
|
+
totalPages: headers.totalpages
|
|
615
|
+
};
|
|
616
|
+
});
|
|
617
|
+
};
|
|
573
618
|
// Annotate the CommonJS export names for ESM import in node:
|
|
574
619
|
0 && (module.exports = {
|
|
575
620
|
acceptTAndC,
|
|
@@ -586,6 +631,7 @@ var getUsersByIds = async (client, ids) => {
|
|
|
586
631
|
getRegistrationOverview,
|
|
587
632
|
getUserById,
|
|
588
633
|
getUserPersonalInfoById,
|
|
634
|
+
getUsers,
|
|
589
635
|
getUsersByIds,
|
|
590
636
|
getUsersPIByIds,
|
|
591
637
|
personalInformationProfileTypeSchema,
|
package/dist/index.mjs
CHANGED
|
@@ -518,6 +518,50 @@ var getUsersByIds = async (client, ids) => {
|
|
|
518
518
|
}
|
|
519
519
|
return client.post(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users/list`, result.data.ids).then(({ data }) => data);
|
|
520
520
|
};
|
|
521
|
+
|
|
522
|
+
// src/getUsers.ts
|
|
523
|
+
import { createPaginableOptionsSchema as createPaginableOptionsSchema2 } from "@vulog/aima-core";
|
|
524
|
+
import { z as z20 } from "zod";
|
|
525
|
+
var statusSchema = z20.enum(["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]);
|
|
526
|
+
var profileTypeSchema = z20.enum(["Single", "Business"]);
|
|
527
|
+
var userFiltersSchema = z20.object({
|
|
528
|
+
status: statusSchema.optional(),
|
|
529
|
+
profileType: profileTypeSchema.optional(),
|
|
530
|
+
serviceId: z20.string().uuid().optional()
|
|
531
|
+
});
|
|
532
|
+
var sortSchema = z20.enum(["registrationDate", "userName", "firstName", "lastName", "updateDate"]);
|
|
533
|
+
var getUsers = async (client, options) => {
|
|
534
|
+
const paginableOptionsSchema = createPaginableOptionsSchema2(
|
|
535
|
+
userFiltersSchema.default({}),
|
|
536
|
+
sortSchema.optional().default("registrationDate")
|
|
537
|
+
).default({});
|
|
538
|
+
const resultOptions = paginableOptionsSchema.safeParse(options);
|
|
539
|
+
if (!resultOptions.success) {
|
|
540
|
+
throw new TypeError("Invalid options", {
|
|
541
|
+
cause: resultOptions.error.issues
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
const finalOptions = resultOptions.data;
|
|
545
|
+
const searchParams = new URLSearchParams();
|
|
546
|
+
searchParams.append("page", finalOptions.page.toString());
|
|
547
|
+
searchParams.append("pageSize", finalOptions.pageSize.toString());
|
|
548
|
+
searchParams.append("sort", `${finalOptions.sort.toString()},${finalOptions.sortDirection.toString()}`);
|
|
549
|
+
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
550
|
+
if (value === void 0) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
searchParams.append(key, value);
|
|
554
|
+
});
|
|
555
|
+
return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users?${searchParams.toString()}`).then(({ data, headers }) => {
|
|
556
|
+
return {
|
|
557
|
+
data,
|
|
558
|
+
page: headers.number,
|
|
559
|
+
pageSize: headers.size,
|
|
560
|
+
total: headers.totalelements,
|
|
561
|
+
totalPages: headers.totalpages
|
|
562
|
+
};
|
|
563
|
+
});
|
|
564
|
+
};
|
|
521
565
|
export {
|
|
522
566
|
acceptTAndC,
|
|
523
567
|
accountStatus,
|
|
@@ -533,6 +577,7 @@ export {
|
|
|
533
577
|
getRegistrationOverview,
|
|
534
578
|
getUserById,
|
|
535
579
|
getUserPersonalInfoById,
|
|
580
|
+
getUsers,
|
|
536
581
|
getUsersByIds,
|
|
537
582
|
getUsersPIByIds,
|
|
538
583
|
personalInformationProfileTypeSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-user",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"author": "Vulog",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@vulog/aima-client": "1.2.
|
|
23
|
-
"@vulog/aima-config": "1.2.
|
|
24
|
-
"@vulog/aima-core": "1.2.
|
|
22
|
+
"@vulog/aima-client": "1.2.10",
|
|
23
|
+
"@vulog/aima-config": "1.2.10",
|
|
24
|
+
"@vulog/aima-core": "1.2.10"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"zod": "^3.25.76"
|
package/src/getUsers.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Client } from '@vulog/aima-client';
|
|
2
|
+
import { createPaginableOptionsSchema, PaginableOptions, PaginableResponse } from '@vulog/aima-core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
import { UserStatus } from './types';
|
|
6
|
+
|
|
7
|
+
// /users?page=0&size=50&sort=registrationDate%2CDESC&status=PENDING&profileType=Single&startDate=&endDate=&service=
|
|
8
|
+
|
|
9
|
+
const statusSchema = z.enum(['PENDING', 'INCOMPLETE', 'SUSPENDED', 'REJECTED', 'APPROVED']);
|
|
10
|
+
const profileTypeSchema = z.enum(['Single', 'Business']);
|
|
11
|
+
const userFiltersSchema = z.object({
|
|
12
|
+
status: statusSchema.optional(),
|
|
13
|
+
profileType: profileTypeSchema.optional(),
|
|
14
|
+
serviceId: z.string().uuid().optional(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const sortSchema = z.enum(['registrationDate', 'userName', 'firstName', 'lastName', 'updateDate']);
|
|
18
|
+
export type UserSort = z.infer<typeof sortSchema>;
|
|
19
|
+
|
|
20
|
+
export type UserFilters = z.infer<typeof userFiltersSchema>;
|
|
21
|
+
|
|
22
|
+
export const getUsers = async (
|
|
23
|
+
client: Client,
|
|
24
|
+
options?: PaginableOptions<UserFilters, UserSort>
|
|
25
|
+
): Promise<PaginableResponse<UserStatus>> => {
|
|
26
|
+
const paginableOptionsSchema = createPaginableOptionsSchema(
|
|
27
|
+
userFiltersSchema.default({}),
|
|
28
|
+
sortSchema.optional().default('registrationDate')
|
|
29
|
+
).default({});
|
|
30
|
+
|
|
31
|
+
const resultOptions = paginableOptionsSchema.safeParse(options);
|
|
32
|
+
if (!resultOptions.success) {
|
|
33
|
+
throw new TypeError('Invalid options', {
|
|
34
|
+
cause: resultOptions.error.issues,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const finalOptions = resultOptions.data;
|
|
39
|
+
|
|
40
|
+
const searchParams = new URLSearchParams();
|
|
41
|
+
searchParams.append('page', finalOptions.page!.toString());
|
|
42
|
+
searchParams.append('pageSize', finalOptions.pageSize!.toString());
|
|
43
|
+
searchParams.append('sort', `${finalOptions.sort!.toString()},${finalOptions.sortDirection!.toString()}`);
|
|
44
|
+
|
|
45
|
+
Object.entries(finalOptions.filters!).forEach(([key, value]) => {
|
|
46
|
+
if (value === undefined) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
searchParams.append(key, value as string);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return client
|
|
53
|
+
.get<UserStatus[]>(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/users?${searchParams.toString()}`)
|
|
54
|
+
.then(({ data, headers }) => {
|
|
55
|
+
return {
|
|
56
|
+
data,
|
|
57
|
+
page: headers.number,
|
|
58
|
+
pageSize: headers.size,
|
|
59
|
+
total: headers.totalelements,
|
|
60
|
+
totalPages: headers.totalpages,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
};
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -87,6 +87,7 @@ export type AccountStatus = (typeof accountStatus)[number];
|
|
|
87
87
|
export type User = {
|
|
88
88
|
fleetId: string;
|
|
89
89
|
id: string;
|
|
90
|
+
registrationDate: string;
|
|
90
91
|
accountStatus?: AccountStatus;
|
|
91
92
|
locale: string;
|
|
92
93
|
agreements: UserAgreement[];
|
|
@@ -102,6 +103,10 @@ export type User = {
|
|
|
102
103
|
membershipNumber: string;
|
|
103
104
|
};
|
|
104
105
|
|
|
106
|
+
export type UserStatus = Exclude<User, 'agreements' | 'profiles'> & {
|
|
107
|
+
profiles: ProfileServiceRegistration[];
|
|
108
|
+
};
|
|
109
|
+
|
|
105
110
|
export type UserUpdateBody = Partial<
|
|
106
111
|
Omit<
|
|
107
112
|
User,
|