@vulog/aima-user 1.1.79 → 1.1.81

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 CHANGED
@@ -141,6 +141,20 @@ type Label = {
141
141
  name: string;
142
142
  createDate: string;
143
143
  };
144
+ type Entity = {
145
+ id: string;
146
+ fleetId: string;
147
+ name: string;
148
+ entityName: string;
149
+ type: 'Personal' | 'Business';
150
+ status: 'APPROVED' | 'PENDING' | 'REJECTED' | 'SUSPENDED' | 'INACTIVE' | 'ARCHIVED';
151
+ isMasterEntity: boolean;
152
+ billingGroupId: string | null;
153
+ billingGroup: string | null;
154
+ billingAddress: Address | null;
155
+ fiscalCode: string | null;
156
+ services: Service[];
157
+ };
144
158
 
145
159
  type CreateBusinessProfile = {
146
160
  emailConsent: boolean;
@@ -232,4 +246,6 @@ declare const updateUser: (client: Client, id: string, user: UserUpdateBody) =>
232
246
  type Paths = (typeof personalInformationUserPaths)[number];
233
247
  declare const updateUserPersonalInfo: (client: Client, userId: string, actions: PatchAction<Paths>[]) => Promise<void>;
234
248
 
235
- export { type AccountStatus, type Address, type CreateBusinessProfile, type CreateUser, type CreateUserOptions, type FiscalInformation, type IndividualBusiness, type Label, type PersonalCompany, type PersonalInformationBirth, type PersonalInformationIdentity, type PersonalInformationProfile, type PersonalInformationProfileType, type PersonalInformationUser, type PersonalInformationUserType, type ProfileServiceRegistration, type ProfileStatus, type ProfileType, type ResponseFind, type SearchType, type ServiceRegistrationWithReason, type ServicesRegistrationList, type ServicesUpdate, type User, type UserAgreement, type UserProfile, type UserServiceRegistration, type UserUpdateBody, acceptTAndC, accountStatus, addLabelForUser, assignBillingGroup, createBusinessProfile, createUser, findUser, getLabelsForUser, getProfilePersonalInfoById, getRegistrationOverview, getUserById, getUserPersonalInfoById, getUsersPIByIds, personalInformationProfileTypeSchema, personalInformationProfileTypes, personalInformationUserPaths, personalInformationUserTypeSchema, personalInformationUserTypes, removeLabelForUser, setServicesStatus, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
249
+ declare const getEntity: (client: Client, entityId: string) => Promise<Entity>;
250
+
251
+ export { type AccountStatus, type Address, 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 ProfileServiceRegistration, type ProfileStatus, type ProfileType, type ResponseFind, type SearchType, type ServiceRegistrationWithReason, type ServicesRegistrationList, type ServicesUpdate, type User, type UserAgreement, type UserProfile, type UserServiceRegistration, type UserUpdateBody, acceptTAndC, accountStatus, addLabelForUser, assignBillingGroup, createBusinessProfile, createUser, findUser, getEntity, getLabelsForUser, getProfilePersonalInfoById, getRegistrationOverview, getUserById, getUserPersonalInfoById, getUsersPIByIds, personalInformationProfileTypeSchema, personalInformationProfileTypes, personalInformationUserPaths, personalInformationUserTypeSchema, personalInformationUserTypes, removeLabelForUser, setServicesStatus, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
package/dist/index.d.ts CHANGED
@@ -141,6 +141,20 @@ type Label = {
141
141
  name: string;
142
142
  createDate: string;
143
143
  };
144
+ type Entity = {
145
+ id: string;
146
+ fleetId: string;
147
+ name: string;
148
+ entityName: string;
149
+ type: 'Personal' | 'Business';
150
+ status: 'APPROVED' | 'PENDING' | 'REJECTED' | 'SUSPENDED' | 'INACTIVE' | 'ARCHIVED';
151
+ isMasterEntity: boolean;
152
+ billingGroupId: string | null;
153
+ billingGroup: string | null;
154
+ billingAddress: Address | null;
155
+ fiscalCode: string | null;
156
+ services: Service[];
157
+ };
144
158
 
145
159
  type CreateBusinessProfile = {
146
160
  emailConsent: boolean;
@@ -232,4 +246,6 @@ declare const updateUser: (client: Client, id: string, user: UserUpdateBody) =>
232
246
  type Paths = (typeof personalInformationUserPaths)[number];
233
247
  declare const updateUserPersonalInfo: (client: Client, userId: string, actions: PatchAction<Paths>[]) => Promise<void>;
234
248
 
235
- export { type AccountStatus, type Address, type CreateBusinessProfile, type CreateUser, type CreateUserOptions, type FiscalInformation, type IndividualBusiness, type Label, type PersonalCompany, type PersonalInformationBirth, type PersonalInformationIdentity, type PersonalInformationProfile, type PersonalInformationProfileType, type PersonalInformationUser, type PersonalInformationUserType, type ProfileServiceRegistration, type ProfileStatus, type ProfileType, type ResponseFind, type SearchType, type ServiceRegistrationWithReason, type ServicesRegistrationList, type ServicesUpdate, type User, type UserAgreement, type UserProfile, type UserServiceRegistration, type UserUpdateBody, acceptTAndC, accountStatus, addLabelForUser, assignBillingGroup, createBusinessProfile, createUser, findUser, getLabelsForUser, getProfilePersonalInfoById, getRegistrationOverview, getUserById, getUserPersonalInfoById, getUsersPIByIds, personalInformationProfileTypeSchema, personalInformationProfileTypes, personalInformationUserPaths, personalInformationUserTypeSchema, personalInformationUserTypes, removeLabelForUser, setServicesStatus, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
249
+ declare const getEntity: (client: Client, entityId: string) => Promise<Entity>;
250
+
251
+ export { type AccountStatus, type Address, 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 ProfileServiceRegistration, type ProfileStatus, type ProfileType, type ResponseFind, type SearchType, type ServiceRegistrationWithReason, type ServicesRegistrationList, type ServicesUpdate, type User, type UserAgreement, type UserProfile, type UserServiceRegistration, type UserUpdateBody, acceptTAndC, accountStatus, addLabelForUser, assignBillingGroup, createBusinessProfile, createUser, findUser, getEntity, getLabelsForUser, getProfilePersonalInfoById, getRegistrationOverview, getUserById, getUserPersonalInfoById, getUsersPIByIds, personalInformationProfileTypeSchema, personalInformationProfileTypes, personalInformationUserPaths, personalInformationUserTypeSchema, personalInformationUserTypes, removeLabelForUser, setServicesStatus, updateProfilePersonalInfo, updateUser, updateUserPersonalInfo };
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __export(index_exports, {
27
27
  createBusinessProfile: () => createBusinessProfile,
28
28
  createUser: () => createUser,
29
29
  findUser: () => findUser,
30
+ getEntity: () => getEntity,
30
31
  getLabelsForUser: () => getLabelsForUser,
31
32
  getProfilePersonalInfoById: () => getProfilePersonalInfoById,
32
33
  getRegistrationOverview: () => getRegistrationOverview,
@@ -489,6 +490,19 @@ var updateUserPersonalInfo = async (client, userId, actions) => {
489
490
  }
490
491
  }).then(({ data }) => data);
491
492
  };
493
+
494
+ // src/getEntity.ts
495
+ var import_zod17 = require("zod");
496
+ var getEntity = async (client, entityId) => {
497
+ const result = import_zod17.z.string().trim().min(1).uuid().safeParse(entityId);
498
+ if (!result.success) {
499
+ throw new TypeError("Invalid entity id", {
500
+ cause: result.error.issues
501
+ });
502
+ }
503
+ const entity = await client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}`).then(({ data }) => data);
504
+ return entity;
505
+ };
492
506
  // Annotate the CommonJS export names for ESM import in node:
493
507
  0 && (module.exports = {
494
508
  acceptTAndC,
@@ -498,6 +512,7 @@ var updateUserPersonalInfo = async (client, userId, actions) => {
498
512
  createBusinessProfile,
499
513
  createUser,
500
514
  findUser,
515
+ getEntity,
501
516
  getLabelsForUser,
502
517
  getProfilePersonalInfoById,
503
518
  getRegistrationOverview,
package/dist/index.mjs CHANGED
@@ -441,6 +441,19 @@ var updateUserPersonalInfo = async (client, userId, actions) => {
441
441
  }
442
442
  }).then(({ data }) => data);
443
443
  };
444
+
445
+ // src/getEntity.ts
446
+ import { z as z17 } from "zod";
447
+ var getEntity = async (client, entityId) => {
448
+ const result = z17.string().trim().min(1).uuid().safeParse(entityId);
449
+ if (!result.success) {
450
+ throw new TypeError("Invalid entity id", {
451
+ cause: result.error.issues
452
+ });
453
+ }
454
+ const entity = await client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}`).then(({ data }) => data);
455
+ return entity;
456
+ };
444
457
  export {
445
458
  acceptTAndC,
446
459
  accountStatus,
@@ -449,6 +462,7 @@ export {
449
462
  createBusinessProfile,
450
463
  createUser,
451
464
  findUser,
465
+ getEntity,
452
466
  getLabelsForUser,
453
467
  getProfilePersonalInfoById,
454
468
  getRegistrationOverview,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulog/aima-user",
3
- "version": "1.1.79",
3
+ "version": "1.1.81",
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.1.79",
23
- "@vulog/aima-config": "1.1.79",
24
- "@vulog/aima-core": "1.1.79"
22
+ "@vulog/aima-client": "1.1.81",
23
+ "@vulog/aima-config": "1.1.81",
24
+ "@vulog/aima-core": "1.1.81"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "zod": "^3.24.2"
@@ -0,0 +1,20 @@
1
+ import { Client } from '@vulog/aima-client';
2
+ import { z } from 'zod';
3
+
4
+ import { Entity } from './types';
5
+
6
+ export const getEntity = async (client: Client, entityId: string): Promise<Entity> => {
7
+ const result = z.string().trim().min(1).uuid().safeParse(entityId);
8
+ if (!result.success) {
9
+ throw new TypeError('Invalid entity id', {
10
+ cause: result.error.issues,
11
+ });
12
+ }
13
+
14
+ const entity = await client
15
+ .get<Entity>(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}`)
16
+ .then(({ data }) => data);
17
+
18
+ return entity;
19
+ };
20
+ export default getEntity;
package/src/index.ts CHANGED
@@ -14,3 +14,4 @@ export * from './types';
14
14
  export * from './updateProfilePersonalInfo';
15
15
  export * from './updateUser';
16
16
  export * from './updateUserPersonalInfo';
17
+ export * from './getEntity';
package/src/types.ts CHANGED
@@ -220,3 +220,18 @@ export type Label = {
220
220
  name: string;
221
221
  createDate: string;
222
222
  };
223
+
224
+ export type Entity = {
225
+ id: string;
226
+ fleetId: string;
227
+ name: string;
228
+ entityName: string;
229
+ type: 'Personal' | 'Business';
230
+ status: 'APPROVED' | 'PENDING' | 'REJECTED' | 'SUSPENDED' | 'INACTIVE' | 'ARCHIVED';
231
+ isMasterEntity: boolean;
232
+ billingGroupId: string | null;
233
+ billingGroup: string | null;
234
+ billingAddress: Address | null;
235
+ fiscalCode: string | null;
236
+ services: Service[];
237
+ };