@mitumba/sdk 5.33.0 → 5.35.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.js CHANGED
@@ -2252,6 +2252,31 @@ var NotificationsModule = class {
2252
2252
  async markRead(ids, options) {
2253
2253
  return this.client.post("/notify/notifications/read", ids ? { ids } : {}, options);
2254
2254
  }
2255
+ /**
2256
+ * The caller's notification settings: categories with their channels, which channels can reach
2257
+ * them now, quiet hours, muted pop-ups and marketing consent.
2258
+ */
2259
+ async getPreferences(options) {
2260
+ return this.client.get("/notify/notifications/preferences", void 0, options);
2261
+ }
2262
+ /**
2263
+ * Set (or, with `enabled: null`, reset to default) 1 to 64 category × channel cells. A cell
2264
+ * applies to every event in its category. Answers the whole updated preferences.
2265
+ */
2266
+ async updatePreferences(cells, options) {
2267
+ return this.client.put("/notify/notifications/preferences", { cells }, options);
2268
+ }
2269
+ /** Change quiet hours, muted pop-up kinds, or both. Answers the whole updated preferences. */
2270
+ async updatePreferenceSettings(input, options) {
2271
+ return this.client.put("/notify/notifications/preferences/settings", input, options);
2272
+ }
2273
+ /**
2274
+ * Opt in to or out of marketing on one channel. The server records its own consent wording
2275
+ * (shown to the person as `consentWording`). Answers the whole updated preferences.
2276
+ */
2277
+ async setMarketingConsent(input, options) {
2278
+ return this.client.put("/notify/notifications/preferences/consent", { channel: input.channel, granted: input.granted }, options);
2279
+ }
2255
2280
  /** Create an inert live notification stream. Register listeners before `start()`. */
2256
2281
  stream(options) {
2257
2282
  return new ManagedNotificationStream(this.client, options);
@@ -2348,6 +2373,18 @@ var StoresModule = class {
2348
2373
  async getStats(storeId, options) {
2349
2374
  return this.client.get(`/listings/stores/${storeId}/stats`, void 0, options);
2350
2375
  }
2376
+ /** Where the shop owner's identity verification stands. Owner only (403 otherwise). */
2377
+ async getVerification(storeId, options) {
2378
+ return this.client.get(`/listings/stores/${storeId}/verification`, void 0, options);
2379
+ }
2380
+ /**
2381
+ * Submit an identity document for review: upload it first with `documents.upload` (purpose
2382
+ * `identity_document`, this store). Owner only. 400 `invalid_document` for any other document,
2383
+ * 409 `already_verified` or `no_seller_profile`.
2384
+ */
2385
+ async submitVerification(storeId, documentId, options) {
2386
+ return this.client.post(`/listings/stores/${storeId}/verification`, { document_id: documentId }, options);
2387
+ }
2351
2388
  /**
2352
2389
  * Get store settings.
2353
2390
  */
@@ -2965,14 +3002,25 @@ var AdminModule = class {
2965
3002
  return this.client.post(`/admin/stores/${storeId}/unverify`, void 0, options);
2966
3003
  }
2967
3004
  // ── Verification Queue ──
3005
+ /**
3006
+ * Read a private document as an operator. Dispute evidence needs `admin:read`; identity documents
3007
+ * and wholesale verification photos need `sellers:verify`.
3008
+ */
3009
+ async getDocument(documentId, options) {
3010
+ return this.client.getFile(`/admin/documents/${encodeURIComponent(documentId)}`, void 0, options);
3011
+ }
2968
3012
  async listVerifications(params, options) {
2969
3013
  return this.client.get("/admin/verifications", params, options);
2970
3014
  }
2971
3015
  async approveVerification(userId, options) {
2972
3016
  return this.client.post(`/admin/verifications/${userId}/approve`, void 0, options);
2973
3017
  }
3018
+ /**
3019
+ * Reject a seller's verification. `reason` (1–500 characters) is required and shown to the seller.
3020
+ * 409 `already_decided` when already rejected.
3021
+ */
2974
3022
  async rejectVerification(userId, reason, options) {
2975
- return this.client.post(`/admin/verifications/${userId}/reject`, reason ? { reason } : void 0, options);
3023
+ return this.client.post(`/admin/verifications/${userId}/reject`, { reason }, options);
2976
3024
  }
2977
3025
  // ── STI ──
2978
3026
  async adjustSti(userId, input, options) {
@@ -3326,6 +3374,28 @@ var UploadsModule = class {
3326
3374
  }
3327
3375
  };
3328
3376
 
3377
+ // src/modules/documents.ts
3378
+ function isDocumentId(value) {
3379
+ return /^doc_[a-z0-9]{1,60}$/.test(value);
3380
+ }
3381
+ var DocumentsModule = class {
3382
+ constructor(client) {
3383
+ this.client = client;
3384
+ }
3385
+ /** Upload a private document. Returns its id; the file itself is never public. */
3386
+ async upload(input, options) {
3387
+ const formData = new FormData();
3388
+ formData.append("purpose", input.purpose);
3389
+ formData.append("subject_id", input.subjectId);
3390
+ formData.append("file", input.file);
3391
+ return this.client.post("/listings/documents", formData, options);
3392
+ }
3393
+ /** Read a private document the signed-in user may see. 404 for any other. */
3394
+ async get(documentId, options) {
3395
+ return this.client.getFile(`/listings/documents/${encodeURIComponent(documentId)}`, void 0, options);
3396
+ }
3397
+ };
3398
+
3329
3399
  // src/modules/reports.ts
3330
3400
  var ReportsModule = class {
3331
3401
  constructor(client) {
@@ -3701,11 +3771,17 @@ var ORDER_STATUSES = [
3701
3771
  // src/types/pay.ts
3702
3772
  var PAYMENT_STATUSES = ["initiated", "funded", "failed", "refunded", "cancelled"];
3703
3773
 
3774
+ // src/types/stores.ts
3775
+ var SELLER_VERIFICATION_STATUSES = ["unverified", "pending", "verified", "rejected"];
3776
+
3704
3777
  // src/types/disputes.ts
3705
3778
  var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
3706
3779
  var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
3707
3780
  var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
3708
3781
 
3782
+ // src/types/documents.ts
3783
+ var DOCUMENT_PURPOSES = ["dispute_evidence", "identity_document", "wholesale_verification"];
3784
+
3709
3785
  // src/types/wholesale.ts
3710
3786
  var BALE_ORDER_STATUSES = ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
3711
3787
 
@@ -3914,6 +3990,7 @@ var MitumbaClient = class {
3914
3990
  admin;
3915
3991
  disputes;
3916
3992
  uploads;
3993
+ documents;
3917
3994
  reports;
3918
3995
  wholesale;
3919
3996
  iam;
@@ -3940,6 +4017,7 @@ var MitumbaClient = class {
3940
4017
  this.admin = new AdminModule(this.api);
3941
4018
  this.disputes = new DisputesModule(this.api);
3942
4019
  this.uploads = new UploadsModule(this.api);
4020
+ this.documents = new DocumentsModule(this.api);
3943
4021
  this.reports = new ReportsModule(this.api);
3944
4022
  this.wholesale = new WholesaleModule(this.api);
3945
4023
  this.iam = new IamModule(this.api);
@@ -3997,7 +4075,9 @@ exports.DEFAULT_SHARE_ORIGIN = DEFAULT_SHARE_ORIGIN;
3997
4075
  exports.DESIRED_RESOLUTIONS = DESIRED_RESOLUTIONS;
3998
4076
  exports.DISPUTE_REASONS = DISPUTE_REASONS;
3999
4077
  exports.DISPUTE_STATUSES = DISPUTE_STATUSES;
4078
+ exports.DOCUMENT_PURPOSES = DOCUMENT_PURPOSES;
4000
4079
  exports.DisputesModule = DisputesModule;
4080
+ exports.DocumentsModule = DocumentsModule;
4001
4081
  exports.IDBTokenStore = IDBTokenStore;
4002
4082
  exports.IamModule = IamModule;
4003
4083
  exports.LISTING_STATUSES = LISTING_STATUSES;
@@ -4017,6 +4097,7 @@ exports.RealtimeProtocolError = RealtimeProtocolError;
4017
4097
  exports.RealtimeUnavailableError = RealtimeUnavailableError;
4018
4098
  exports.ReportsModule = ReportsModule;
4019
4099
  exports.ReviewsModule = ReviewsModule;
4100
+ exports.SELLER_VERIFICATION_STATUSES = SELLER_VERIFICATION_STATUSES;
4020
4101
  exports.SearchModule = SearchModule;
4021
4102
  exports.SettingsModule = SettingsModule;
4022
4103
  exports.StoresModule = StoresModule;
@@ -4041,6 +4122,7 @@ exports.formatPhone = formatPhone;
4041
4122
  exports.isCartLineBuyable = isCartLineBuyable;
4042
4123
  exports.isConditionAllowed = isConditionAllowed;
4043
4124
  exports.isConsentRequired = isConsentRequired;
4125
+ exports.isDocumentId = isDocumentId;
4044
4126
  exports.isMessagingAPIError = isMessagingAPIError;
4045
4127
  exports.isNewOnlyCategory = isNewOnlyCategory;
4046
4128
  exports.isValidPhone = isValidPhone;