@vulog/aima-user 1.2.38 → 1.2.40

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 CHANGED
@@ -54,6 +54,7 @@ const createBusinessProfileSchema = zod.z.object({
54
54
  costCenterId: zod.z.string().uuid().nullish()
55
55
  })
56
56
  });
57
+ /** @deprecated Use `addUserToBusiness` from `@vulog/aima-business` instead */
57
58
  const createBusinessProfile = async (client, userId, businessId, data) => {
58
59
  const result = createBusinessProfileSchema.safeParse({
59
60
  userId,
@@ -388,7 +389,7 @@ const getEntity = async (client, entityId) => {
388
389
  //#endregion
389
390
  //#region src/getFleetBillingGroups.ts
390
391
  const getFleetBillingGroups = async (client, options) => {
391
- const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)().default({}).safeParse(options);
392
+ const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)().safeParse(options ?? {});
392
393
  if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
393
394
  const finalOptions = resultOptions.data;
394
395
  const searchParams = new URLSearchParams();
@@ -437,7 +438,7 @@ const sortSchema = zod.z.enum([
437
438
  "updateDate"
438
439
  ]);
439
440
  const getUsers = async (client, options) => {
440
- const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).default({}).safeParse(options);
441
+ const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).safeParse(options ?? {});
441
442
  if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
442
443
  const finalOptions = resultOptions.data;
443
444
  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<["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"]>;
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<["ID_NUMBER", "PHONE_NUMBER", "EMAIL", "BILLING_ADDRESS"]>;
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;
@@ -197,6 +213,7 @@ type CreateBusinessProfile = {
197
213
  requestId: string;
198
214
  costCenterId?: string | null;
199
215
  };
216
+ /** @deprecated Use `addUserToBusiness` from `@vulog/aima-business` instead */
200
217
  declare const createBusinessProfile: (client: Client, userId: string, businessId: string, data: CreateBusinessProfile) => Promise<UserProfile>;
201
218
  //#endregion
202
219
  //#region src/createUser.d.ts
@@ -254,33 +271,16 @@ declare const schema: z.ZodObject<{
254
271
  actions: z.ZodArray<z.ZodObject<{
255
272
  reasonForChange: z.ZodString;
256
273
  serviceId: z.ZodString;
257
- status: z.ZodEnum<["APPROVED", "INCOMPLETE", "PENDING", "REJECTED", "SUSPENDED", "UNREGISTERED"]>;
258
- }, "strip", z.ZodTypeAny, {
259
- status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
260
- serviceId: string;
261
- reasonForChange: string;
262
- }, {
263
- status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
264
- serviceId: string;
265
- reasonForChange: string;
266
- }>, "many">;
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
- }>;
274
+ status: z.ZodEnum<{
275
+ PENDING: "PENDING";
276
+ INCOMPLETE: "INCOMPLETE";
277
+ SUSPENDED: "SUSPENDED";
278
+ REJECTED: "REJECTED";
279
+ APPROVED: "APPROVED";
280
+ UNREGISTERED: "UNREGISTERED";
281
+ }>;
282
+ }, z.core.$strip>>;
283
+ }, z.core.$strip>;
284
284
  type ServicesUpdate = z.infer<typeof schema>;
285
285
  declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
286
286
  //#endregion
@@ -310,19 +310,26 @@ declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
310
310
  //#endregion
311
311
  //#region src/getUsers.d.ts
312
312
  declare const userFiltersSchema: z.ZodObject<{
313
- status: z.ZodOptional<z.ZodEnum<["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]>>;
314
- profileType: z.ZodOptional<z.ZodEnum<["Single", "Business"]>>;
313
+ status: z.ZodOptional<z.ZodEnum<{
314
+ PENDING: "PENDING";
315
+ INCOMPLETE: "INCOMPLETE";
316
+ SUSPENDED: "SUSPENDED";
317
+ REJECTED: "REJECTED";
318
+ APPROVED: "APPROVED";
319
+ }>>;
320
+ profileType: z.ZodOptional<z.ZodEnum<{
321
+ Single: "Single";
322
+ Business: "Business";
323
+ }>>;
315
324
  serviceId: z.ZodOptional<z.ZodString>;
316
- }, "strip", z.ZodTypeAny, {
317
- status?: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | undefined;
318
- profileType?: "Single" | "Business" | undefined;
319
- serviceId?: string | undefined;
320
- }, {
321
- status?: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | undefined;
322
- profileType?: "Single" | "Business" | undefined;
323
- serviceId?: string | undefined;
325
+ }, z.core.$strip>;
326
+ declare const sortSchema: z.ZodEnum<{
327
+ registrationDate: "registrationDate";
328
+ userName: "userName";
329
+ firstName: "firstName";
330
+ lastName: "lastName";
331
+ updateDate: "updateDate";
324
332
  }>;
325
- declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
326
333
  type UserSort = z.infer<typeof sortSchema>;
327
334
  type UserFilters = z.infer<typeof userFiltersSchema>;
328
335
  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<["IDENTITY", "USERNAME", "BIRTH", "NATIONALITY", "NOTES", "GENDER", "PERSONAL_COMPANY", "FISCAL", "ADDRESS", "MEMBERSHIP"]>;
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<["ID_NUMBER", "PHONE_NUMBER", "EMAIL", "BILLING_ADDRESS"]>;
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;
@@ -197,6 +213,7 @@ type CreateBusinessProfile = {
197
213
  requestId: string;
198
214
  costCenterId?: string | null;
199
215
  };
216
+ /** @deprecated Use `addUserToBusiness` from `@vulog/aima-business` instead */
200
217
  declare const createBusinessProfile: (client: Client, userId: string, businessId: string, data: CreateBusinessProfile) => Promise<UserProfile>;
201
218
  //#endregion
202
219
  //#region src/createUser.d.ts
@@ -254,33 +271,16 @@ declare const schema: z.ZodObject<{
254
271
  actions: z.ZodArray<z.ZodObject<{
255
272
  reasonForChange: z.ZodString;
256
273
  serviceId: z.ZodString;
257
- status: z.ZodEnum<["APPROVED", "INCOMPLETE", "PENDING", "REJECTED", "SUSPENDED", "UNREGISTERED"]>;
258
- }, "strip", z.ZodTypeAny, {
259
- status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
260
- serviceId: string;
261
- reasonForChange: string;
262
- }, {
263
- status: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | "UNREGISTERED";
264
- serviceId: string;
265
- reasonForChange: string;
266
- }>, "many">;
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
- }>;
274
+ status: z.ZodEnum<{
275
+ PENDING: "PENDING";
276
+ INCOMPLETE: "INCOMPLETE";
277
+ SUSPENDED: "SUSPENDED";
278
+ REJECTED: "REJECTED";
279
+ APPROVED: "APPROVED";
280
+ UNREGISTERED: "UNREGISTERED";
281
+ }>;
282
+ }, z.core.$strip>>;
283
+ }, z.core.$strip>;
284
284
  type ServicesUpdate = z.infer<typeof schema>;
285
285
  declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
286
286
  //#endregion
@@ -310,19 +310,26 @@ declare const getUsersByIds: (client: Client, ids: string[]) => Promise<User[]>;
310
310
  //#endregion
311
311
  //#region src/getUsers.d.ts
312
312
  declare const userFiltersSchema: z.ZodObject<{
313
- status: z.ZodOptional<z.ZodEnum<["PENDING", "INCOMPLETE", "SUSPENDED", "REJECTED", "APPROVED"]>>;
314
- profileType: z.ZodOptional<z.ZodEnum<["Single", "Business"]>>;
313
+ status: z.ZodOptional<z.ZodEnum<{
314
+ PENDING: "PENDING";
315
+ INCOMPLETE: "INCOMPLETE";
316
+ SUSPENDED: "SUSPENDED";
317
+ REJECTED: "REJECTED";
318
+ APPROVED: "APPROVED";
319
+ }>>;
320
+ profileType: z.ZodOptional<z.ZodEnum<{
321
+ Single: "Single";
322
+ Business: "Business";
323
+ }>>;
315
324
  serviceId: z.ZodOptional<z.ZodString>;
316
- }, "strip", z.ZodTypeAny, {
317
- status?: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | undefined;
318
- profileType?: "Single" | "Business" | undefined;
319
- serviceId?: string | undefined;
320
- }, {
321
- status?: "PENDING" | "INCOMPLETE" | "SUSPENDED" | "REJECTED" | "APPROVED" | undefined;
322
- profileType?: "Single" | "Business" | undefined;
323
- serviceId?: string | undefined;
325
+ }, z.core.$strip>;
326
+ declare const sortSchema: z.ZodEnum<{
327
+ registrationDate: "registrationDate";
328
+ userName: "userName";
329
+ firstName: "firstName";
330
+ lastName: "lastName";
331
+ updateDate: "updateDate";
324
332
  }>;
325
- declare const sortSchema: z.ZodEnum<["registrationDate", "userName", "firstName", "lastName", "updateDate"]>;
326
333
  type UserSort = z.infer<typeof sortSchema>;
327
334
  type UserFilters = z.infer<typeof userFiltersSchema>;
328
335
  declare const getUsers: (client: Client, options?: PaginableOptions<UserFilters, UserSort>) => Promise<PaginableResponse<UserStatus>>;
package/dist/index.mjs CHANGED
@@ -53,6 +53,7 @@ const createBusinessProfileSchema = z.object({
53
53
  costCenterId: z.string().uuid().nullish()
54
54
  })
55
55
  });
56
+ /** @deprecated Use `addUserToBusiness` from `@vulog/aima-business` instead */
56
57
  const createBusinessProfile = async (client, userId, businessId, data) => {
57
58
  const result = createBusinessProfileSchema.safeParse({
58
59
  userId,
@@ -387,7 +388,7 @@ const getEntity = async (client, entityId) => {
387
388
  //#endregion
388
389
  //#region src/getFleetBillingGroups.ts
389
390
  const getFleetBillingGroups = async (client, options) => {
390
- const resultOptions = createPaginableOptionsSchema().default({}).safeParse(options);
391
+ const resultOptions = createPaginableOptionsSchema().safeParse(options ?? {});
391
392
  if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
392
393
  const finalOptions = resultOptions.data;
393
394
  const searchParams = new URLSearchParams();
@@ -436,7 +437,7 @@ const sortSchema = z.enum([
436
437
  "updateDate"
437
438
  ]);
438
439
  const getUsers = async (client, options) => {
439
- const resultOptions = createPaginableOptionsSchema(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).default({}).safeParse(options);
440
+ const resultOptions = createPaginableOptionsSchema(userFiltersSchema.default({}), sortSchema.optional().default("registrationDate")).safeParse(options ?? {});
440
441
  if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
441
442
  const finalOptions = resultOptions.data;
442
443
  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.38",
4
+ "version": "1.2.40",
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.38",
36
- "@vulog/aima-config": "1.2.38",
37
- "@vulog/aima-core": "1.2.38"
35
+ "@vulog/aima-client": "1.2.40",
36
+ "@vulog/aima-config": "1.2.40",
37
+ "@vulog/aima-core": "1.2.40"
38
38
  },
39
39
  "peerDependencies": {
40
- "zod": "^3.25.76"
40
+ "zod": "^4.3.6"
41
41
  },
42
42
  "description": ""
43
- }
43
+ }
@@ -21,6 +21,7 @@ const createBusinessProfileSchema = z.object({
21
21
  }),
22
22
  });
23
23
 
24
+ /** @deprecated Use `addUserToBusiness` from `@vulog/aima-business` instead */
24
25
  export const createBusinessProfile = async (
25
26
  client: Client,
26
27
  userId: string,
@@ -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().default({});
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
- ).default({});
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
  }
package/vitest.config.ts CHANGED
@@ -1,8 +1 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- globals: true,
6
- environment: 'node',
7
- },
8
- });
1
+ export { default } from '../../vitest.config.base.ts';