@vulog/aima-user 1.2.2 → 1.2.4
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/README.md +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +5 -5
- package/src/registerUserToService.ts +6 -6
package/README.md
CHANGED
|
@@ -219,15 +219,15 @@ const result = await setServicesStatus(client, {
|
|
|
219
219
|
|
|
220
220
|
#### registerUserToService
|
|
221
221
|
|
|
222
|
-
Register a user
|
|
222
|
+
Register a user entity to a specific service it's optional if the service is public (users are subscribed by default to public services). but mandatory to be able to book on a private service.
|
|
223
223
|
|
|
224
224
|
```javascript
|
|
225
|
-
await registerUserToService(client, '
|
|
225
|
+
await registerUserToService(client, 'entity-uuid-here', 'service-uuid-here');
|
|
226
226
|
```
|
|
227
227
|
|
|
228
228
|
**Parameters:**
|
|
229
229
|
- `client`: AIMA client instance
|
|
230
|
-
- `
|
|
230
|
+
- `entityId`: Entity UUID to register
|
|
231
231
|
- `serviceId`: Service UUID to register the profile to
|
|
232
232
|
|
|
233
233
|
## Types
|
package/dist/index.d.mts
CHANGED
|
@@ -259,7 +259,7 @@ declare const schema: z.ZodObject<{
|
|
|
259
259
|
type ServicesUpdate = z.infer<typeof schema>;
|
|
260
260
|
declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
|
|
261
261
|
|
|
262
|
-
declare const registerUserToService: (client: Client,
|
|
262
|
+
declare const registerUserToService: (client: Client, entityId: string, serviceId: string) => Promise<void>;
|
|
263
263
|
|
|
264
264
|
declare const paths: readonly ["/phoneNumber", "/email", "/idNumber"];
|
|
265
265
|
type Paths$1 = (typeof paths)[number];
|
package/dist/index.d.ts
CHANGED
|
@@ -259,7 +259,7 @@ declare const schema: z.ZodObject<{
|
|
|
259
259
|
type ServicesUpdate = z.infer<typeof schema>;
|
|
260
260
|
declare const setServicesStatus: (client: Client, profileId: string, servicesUpdate: ServicesUpdate) => Promise<void>;
|
|
261
261
|
|
|
262
|
-
declare const registerUserToService: (client: Client,
|
|
262
|
+
declare const registerUserToService: (client: Client, entityId: string, serviceId: string) => Promise<void>;
|
|
263
263
|
|
|
264
264
|
declare const paths: readonly ["/phoneNumber", "/email", "/idNumber"];
|
|
265
265
|
type Paths$1 = (typeof paths)[number];
|
package/dist/index.js
CHANGED
|
@@ -402,11 +402,11 @@ var setServicesStatus = async (client, profileId, servicesUpdate) => {
|
|
|
402
402
|
|
|
403
403
|
// src/registerUserToService.ts
|
|
404
404
|
var import_zod14 = require("zod");
|
|
405
|
-
var registerUserToService = async (client,
|
|
406
|
-
const
|
|
407
|
-
if (!
|
|
408
|
-
throw new TypeError("Invalid
|
|
409
|
-
cause:
|
|
405
|
+
var registerUserToService = async (client, entityId, serviceId) => {
|
|
406
|
+
const resultEntityId = import_zod14.z.string().uuid().safeParse(entityId);
|
|
407
|
+
if (!resultEntityId.success) {
|
|
408
|
+
throw new TypeError("Invalid entityId", {
|
|
409
|
+
cause: resultEntityId.error.issues
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
const resultServiceId = import_zod14.z.string().uuid().safeParse(serviceId);
|
|
@@ -416,7 +416,7 @@ var registerUserToService = async (client, profileId, serviceId) => {
|
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
await client.put(
|
|
419
|
-
`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/
|
|
419
|
+
`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}/services/${serviceId}`
|
|
420
420
|
);
|
|
421
421
|
};
|
|
422
422
|
|
package/dist/index.mjs
CHANGED
|
@@ -350,11 +350,11 @@ var setServicesStatus = async (client, profileId, servicesUpdate) => {
|
|
|
350
350
|
|
|
351
351
|
// src/registerUserToService.ts
|
|
352
352
|
import { z as z14 } from "zod";
|
|
353
|
-
var registerUserToService = async (client,
|
|
354
|
-
const
|
|
355
|
-
if (!
|
|
356
|
-
throw new TypeError("Invalid
|
|
357
|
-
cause:
|
|
353
|
+
var registerUserToService = async (client, entityId, serviceId) => {
|
|
354
|
+
const resultEntityId = z14.string().uuid().safeParse(entityId);
|
|
355
|
+
if (!resultEntityId.success) {
|
|
356
|
+
throw new TypeError("Invalid entityId", {
|
|
357
|
+
cause: resultEntityId.error.issues
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
const resultServiceId = z14.string().uuid().safeParse(serviceId);
|
|
@@ -364,7 +364,7 @@ var registerUserToService = async (client, profileId, serviceId) => {
|
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
await client.put(
|
|
367
|
-
`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/
|
|
367
|
+
`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}/services/${serviceId}`
|
|
368
368
|
);
|
|
369
369
|
};
|
|
370
370
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-user",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,12 +19,12 @@
|
|
|
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.4",
|
|
23
|
+
"@vulog/aima-config": "1.2.4",
|
|
24
|
+
"@vulog/aima-core": "1.2.4"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"zod": "^3.25.76"
|
|
28
28
|
},
|
|
29
29
|
"description": ""
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Client } from '@vulog/aima-client';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
export const registerUserToService = async (client: Client,
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
7
|
-
throw new TypeError('Invalid
|
|
8
|
-
cause:
|
|
4
|
+
export const registerUserToService = async (client: Client, entityId: string, serviceId: string): Promise<void> => {
|
|
5
|
+
const resultEntityId = z.string().uuid().safeParse(entityId);
|
|
6
|
+
if (!resultEntityId.success) {
|
|
7
|
+
throw new TypeError('Invalid entityId', {
|
|
8
|
+
cause: resultEntityId.error.issues,
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -17,6 +17,6 @@ export const registerUserToService = async (client: Client, profileId: string, s
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
await client.put(
|
|
20
|
-
`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/
|
|
20
|
+
`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/entities/${entityId}/services/${serviceId}`
|
|
21
21
|
);
|
|
22
22
|
};
|