@faiber/faiber-profile 0.11.6 → 0.12.0

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.
Files changed (2) hide show
  1. package/README.md +10 -19
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -22,18 +22,12 @@ const client = new FaiberClient("profile", {
22
22
  });
23
23
  const api = new ProfileApi(client);
24
24
 
25
- const updated = await api.updateProfileByUserId(userId, {
25
+ const updated = await api.updateProfile(userId, {
26
26
  first_name: { en: "Ava", fa: "آوا" },
27
27
  phone: "+989121234567",
28
28
  properties: { workout_plan: plan, membership },
29
29
  });
30
30
  console.log(updated.data.data.profile);
31
-
32
- const uploaded = await api.uploadAvatar(userId, avatarFile);
33
- const avatar = await api.avatar(userId, uploaded.data.data.key, {
34
- signal: AbortSignal.timeout(5_000),
35
- });
36
- console.log(avatar.data.type, avatar.data.size);
37
31
  ```
38
32
 
39
33
  ## Complete capability
@@ -42,31 +36,28 @@ This package exposes 173 registered operations from the profiles service. Common
42
36
 
43
37
  | Area | Operations | HTTP methods |
44
38
  |---|---:|---|
45
- | `city` | 8 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
46
39
  | `campaign` | 4 | `GET`, `POST` |
40
+ | `city` | 8 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
47
41
  | `country` | 8 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
42
+ | `custom-type` | 5 | `DELETE`, `GET`, `PATCH`, `POST` |
48
43
  | `integration` | 2 | `GET` |
44
+ | `lifecycle` | 24 | `DELETE`, `GET`, `POST`, `PUT` |
49
45
  | `log-action` | 3 | `POST` |
50
46
  | `logger` | 2 | `GET` |
51
- | `option` | 4 | `GET`, `POST` |
52
- | `profile` | 52 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
47
+ | `option` | 5 | `GET`, `POST` |
48
+ | `profile` | 57 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
53
49
  | `profile-property` | 8 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
54
50
  | `profile-search` | 1 | `POST` |
55
51
  | `province` | 8 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
52
+ | `referral` | 7 | `DELETE`, `GET`, `POST`, `PUT` |
53
+ | `relation` | 10 | `DELETE`, `GET`, `POST`, `PUT` |
56
54
  | `router` | 3 | `GET` |
57
- | `session` | 1 | `GET` |
55
+ | `session` | 2 | `GET` |
58
56
  | `setting` | 2 | `GET`, `POST` |
59
57
  | `survey` | 2 | `GET`, `POST` |
60
58
  | `trusted-service` | 12 | `DELETE`, `GET`, `PATCH`, `POST`, `PUT` |
61
59
 
62
- `listProfiles` returns merged profile status, active-enrollment state, and IDP-synchronized role records, with `filter[role]`, `filter[status]`, `filter[active]`, and search support. `updateProfileByUserId` sends one atomic `PATCH /api/v1/profile/{uuid}` using `profile.user_id`; do not pass the profile row's `profile.id`. Omitted fields stay unchanged; `null` clears nullable fields. System-managed balances, gems, enrollment state, roles, IDs, and avatar objects are not mass-assignable. Use `uploadAvatar` and IDP role operations for those concerns.
63
-
64
- Profile detail, full, and admin reads expose Office-synchronized balances, enrollments,
65
- transactions, installments, wallets, and wallet transactions as `data.profile.office`.
66
- They also expose UUID-based LMS classrooms, sessions, and membership data as
67
- `data.profile.lms`. Profile lists and chat context omit these heavier, sensitive objects.
68
-
69
- `avatar(userId, key)` downloads the stored image as a `Blob` through the public profile-media route. The service constrains `key` to `profiles/{userId}/avatar/`; a mismatched or unsafe key returns `403`, and a missing object returns `404`.
60
+ `updateProfile` sends one atomic `PATCH /api/v1/profile/{uuid}`. Omitted fields stay unchanged; `null` clears nullable fields. System-managed balances, gems, enrollment state, roles, IDs, and avatar objects are not mass-assignable. Use `uploadAvatar` and IDP role operations for those concerns.
70
61
 
71
62
  ## Authentication and authorization
72
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faiber/faiber-profile",
3
- "version": "0.11.6",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -16,6 +16,6 @@
16
16
  "README.md"
17
17
  ],
18
18
  "dependencies": {
19
- "@faiber/sdk-core": "0.11.6"
19
+ "@faiber/sdk-core": "0.12.0"
20
20
  }
21
21
  }