@mitumba/sdk 3.1.0 → 4.0.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.
package/dist/index.d.mts CHANGED
@@ -1518,7 +1518,19 @@ interface Order {
1518
1518
  listing_condition: string | null;
1519
1519
  listing_size: string | null;
1520
1520
  buyer_name: string | null;
1521
+ /**
1522
+ * The buyer's phone. Visible to the buyer at any status. Visible to the seller **only** while
1523
+ * they are handing the parcel over — statuses `paid`, `seller_confirmed`, `shipped`,
1524
+ * `delivered` — and `null` for the seller otherwise (before payment, and on `completed`,
1525
+ * `cancelled`, or `disputed`). Before payment a seller sees only `buyer_name` and the delivery
1526
+ * `county`. (Mitumba-Ltd/mitumba#321)
1527
+ */
1521
1528
  buyer_phone: string | null;
1529
+ /**
1530
+ * The buyer's delivery address. Same visibility rule as `buyer_phone`: always visible to the
1531
+ * buyer; visible to the seller only during the `paid`→`delivered` handover window, `null`
1532
+ * otherwise. (Mitumba-Ltd/mitumba#321)
1533
+ */
1522
1534
  delivery_address: DeliveryAddress | null;
1523
1535
  events?: OrderEvent[];
1524
1536
  }
@@ -2134,6 +2146,19 @@ interface CartItem {
2134
2146
  delivery_fee: number;
2135
2147
  }
2136
2148
 
2149
+ /**
2150
+ * Fields a user may change on their own profile via `PUT /auth/me`. Every field is optional;
2151
+ * only the ones provided are updated. The server enforces the profile contract:
2152
+ *
2153
+ * - `display_name`: non-empty, at most 80 characters.
2154
+ * - `phone`: canonical Kenyan E.164, `+254` followed by 9 digits. Must be unique — a number
2155
+ * already used by another account is rejected with `phone_taken` (409).
2156
+ * - `county`: one of Kenya's 47 canonical county names.
2157
+ * - `bio`: at most 500 characters.
2158
+ * - `avatar_url`: an absolute URL on a trusted Mitumba CDN origin (no arbitrary remote hosts).
2159
+ *
2160
+ * Invalid input is rejected with `invalid_input` (400). The updated `UserProfile` is returned.
2161
+ */
2137
2162
  interface UpdateProfileInput {
2138
2163
  display_name?: string;
2139
2164
  phone?: string;
@@ -3095,9 +3120,14 @@ declare class SettingsModule {
3095
3120
  private readonly client;
3096
3121
  constructor(client: APIClient);
3097
3122
  getProfile(options?: RequestOptions): Promise<UserProfile>;
3098
- updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<{
3099
- ok: true;
3100
- }>;
3123
+ /**
3124
+ * Update the current user's profile. Only the provided fields change. Returns the updated
3125
+ * {@link UserProfile}. See {@link UpdateProfileInput} for the server-enforced contract.
3126
+ *
3127
+ * @throws {APIError} `invalid_input` (400) when a field violates the contract, and
3128
+ * `phone_taken` (409) when the phone number already belongs to another account.
3129
+ */
3130
+ updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<UserProfile>;
3101
3131
  changePassword(input: ChangePasswordInput, options?: RequestOptions): Promise<{
3102
3132
  ok: true;
3103
3133
  }>;
package/dist/index.d.ts CHANGED
@@ -1518,7 +1518,19 @@ interface Order {
1518
1518
  listing_condition: string | null;
1519
1519
  listing_size: string | null;
1520
1520
  buyer_name: string | null;
1521
+ /**
1522
+ * The buyer's phone. Visible to the buyer at any status. Visible to the seller **only** while
1523
+ * they are handing the parcel over — statuses `paid`, `seller_confirmed`, `shipped`,
1524
+ * `delivered` — and `null` for the seller otherwise (before payment, and on `completed`,
1525
+ * `cancelled`, or `disputed`). Before payment a seller sees only `buyer_name` and the delivery
1526
+ * `county`. (Mitumba-Ltd/mitumba#321)
1527
+ */
1521
1528
  buyer_phone: string | null;
1529
+ /**
1530
+ * The buyer's delivery address. Same visibility rule as `buyer_phone`: always visible to the
1531
+ * buyer; visible to the seller only during the `paid`→`delivered` handover window, `null`
1532
+ * otherwise. (Mitumba-Ltd/mitumba#321)
1533
+ */
1522
1534
  delivery_address: DeliveryAddress | null;
1523
1535
  events?: OrderEvent[];
1524
1536
  }
@@ -2134,6 +2146,19 @@ interface CartItem {
2134
2146
  delivery_fee: number;
2135
2147
  }
2136
2148
 
2149
+ /**
2150
+ * Fields a user may change on their own profile via `PUT /auth/me`. Every field is optional;
2151
+ * only the ones provided are updated. The server enforces the profile contract:
2152
+ *
2153
+ * - `display_name`: non-empty, at most 80 characters.
2154
+ * - `phone`: canonical Kenyan E.164, `+254` followed by 9 digits. Must be unique — a number
2155
+ * already used by another account is rejected with `phone_taken` (409).
2156
+ * - `county`: one of Kenya's 47 canonical county names.
2157
+ * - `bio`: at most 500 characters.
2158
+ * - `avatar_url`: an absolute URL on a trusted Mitumba CDN origin (no arbitrary remote hosts).
2159
+ *
2160
+ * Invalid input is rejected with `invalid_input` (400). The updated `UserProfile` is returned.
2161
+ */
2137
2162
  interface UpdateProfileInput {
2138
2163
  display_name?: string;
2139
2164
  phone?: string;
@@ -3095,9 +3120,14 @@ declare class SettingsModule {
3095
3120
  private readonly client;
3096
3121
  constructor(client: APIClient);
3097
3122
  getProfile(options?: RequestOptions): Promise<UserProfile>;
3098
- updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<{
3099
- ok: true;
3100
- }>;
3123
+ /**
3124
+ * Update the current user's profile. Only the provided fields change. Returns the updated
3125
+ * {@link UserProfile}. See {@link UpdateProfileInput} for the server-enforced contract.
3126
+ *
3127
+ * @throws {APIError} `invalid_input` (400) when a field violates the contract, and
3128
+ * `phone_taken` (409) when the phone number already belongs to another account.
3129
+ */
3130
+ updateProfile(input: UpdateProfileInput, options?: RequestOptions): Promise<UserProfile>;
3101
3131
  changePassword(input: ChangePasswordInput, options?: RequestOptions): Promise<{
3102
3132
  ok: true;
3103
3133
  }>;
package/dist/index.js CHANGED
@@ -1828,6 +1828,13 @@ var SettingsModule = class {
1828
1828
  async getProfile(options) {
1829
1829
  return this.client.get("/auth/me", void 0, options);
1830
1830
  }
1831
+ /**
1832
+ * Update the current user's profile. Only the provided fields change. Returns the updated
1833
+ * {@link UserProfile}. See {@link UpdateProfileInput} for the server-enforced contract.
1834
+ *
1835
+ * @throws {APIError} `invalid_input` (400) when a field violates the contract, and
1836
+ * `phone_taken` (409) when the phone number already belongs to another account.
1837
+ */
1831
1838
  async updateProfile(input, options) {
1832
1839
  return this.client.put("/auth/me", input, options);
1833
1840
  }