@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.mjs CHANGED
@@ -2250,6 +2250,31 @@ var NotificationsModule = class {
2250
2250
  async markRead(ids, options) {
2251
2251
  return this.client.post("/notify/notifications/read", ids ? { ids } : {}, options);
2252
2252
  }
2253
+ /**
2254
+ * The caller's notification settings: categories with their channels, which channels can reach
2255
+ * them now, quiet hours, muted pop-ups and marketing consent.
2256
+ */
2257
+ async getPreferences(options) {
2258
+ return this.client.get("/notify/notifications/preferences", void 0, options);
2259
+ }
2260
+ /**
2261
+ * Set (or, with `enabled: null`, reset to default) 1 to 64 category × channel cells. A cell
2262
+ * applies to every event in its category. Answers the whole updated preferences.
2263
+ */
2264
+ async updatePreferences(cells, options) {
2265
+ return this.client.put("/notify/notifications/preferences", { cells }, options);
2266
+ }
2267
+ /** Change quiet hours, muted pop-up kinds, or both. Answers the whole updated preferences. */
2268
+ async updatePreferenceSettings(input, options) {
2269
+ return this.client.put("/notify/notifications/preferences/settings", input, options);
2270
+ }
2271
+ /**
2272
+ * Opt in to or out of marketing on one channel. The server records its own consent wording
2273
+ * (shown to the person as `consentWording`). Answers the whole updated preferences.
2274
+ */
2275
+ async setMarketingConsent(input, options) {
2276
+ return this.client.put("/notify/notifications/preferences/consent", { channel: input.channel, granted: input.granted }, options);
2277
+ }
2253
2278
  /** Create an inert live notification stream. Register listeners before `start()`. */
2254
2279
  stream(options) {
2255
2280
  return new ManagedNotificationStream(this.client, options);
@@ -2346,6 +2371,18 @@ var StoresModule = class {
2346
2371
  async getStats(storeId, options) {
2347
2372
  return this.client.get(`/listings/stores/${storeId}/stats`, void 0, options);
2348
2373
  }
2374
+ /** Where the shop owner's identity verification stands. Owner only (403 otherwise). */
2375
+ async getVerification(storeId, options) {
2376
+ return this.client.get(`/listings/stores/${storeId}/verification`, void 0, options);
2377
+ }
2378
+ /**
2379
+ * Submit an identity document for review: upload it first with `documents.upload` (purpose
2380
+ * `identity_document`, this store). Owner only. 400 `invalid_document` for any other document,
2381
+ * 409 `already_verified` or `no_seller_profile`.
2382
+ */
2383
+ async submitVerification(storeId, documentId, options) {
2384
+ return this.client.post(`/listings/stores/${storeId}/verification`, { document_id: documentId }, options);
2385
+ }
2349
2386
  /**
2350
2387
  * Get store settings.
2351
2388
  */
@@ -2963,14 +3000,25 @@ var AdminModule = class {
2963
3000
  return this.client.post(`/admin/stores/${storeId}/unverify`, void 0, options);
2964
3001
  }
2965
3002
  // ── Verification Queue ──
3003
+ /**
3004
+ * Read a private document as an operator. Dispute evidence needs `admin:read`; identity documents
3005
+ * and wholesale verification photos need `sellers:verify`.
3006
+ */
3007
+ async getDocument(documentId, options) {
3008
+ return this.client.getFile(`/admin/documents/${encodeURIComponent(documentId)}`, void 0, options);
3009
+ }
2966
3010
  async listVerifications(params, options) {
2967
3011
  return this.client.get("/admin/verifications", params, options);
2968
3012
  }
2969
3013
  async approveVerification(userId, options) {
2970
3014
  return this.client.post(`/admin/verifications/${userId}/approve`, void 0, options);
2971
3015
  }
3016
+ /**
3017
+ * Reject a seller's verification. `reason` (1–500 characters) is required and shown to the seller.
3018
+ * 409 `already_decided` when already rejected.
3019
+ */
2972
3020
  async rejectVerification(userId, reason, options) {
2973
- return this.client.post(`/admin/verifications/${userId}/reject`, reason ? { reason } : void 0, options);
3021
+ return this.client.post(`/admin/verifications/${userId}/reject`, { reason }, options);
2974
3022
  }
2975
3023
  // ── STI ──
2976
3024
  async adjustSti(userId, input, options) {
@@ -3324,6 +3372,28 @@ var UploadsModule = class {
3324
3372
  }
3325
3373
  };
3326
3374
 
3375
+ // src/modules/documents.ts
3376
+ function isDocumentId(value) {
3377
+ return /^doc_[a-z0-9]{1,60}$/.test(value);
3378
+ }
3379
+ var DocumentsModule = class {
3380
+ constructor(client) {
3381
+ this.client = client;
3382
+ }
3383
+ /** Upload a private document. Returns its id; the file itself is never public. */
3384
+ async upload(input, options) {
3385
+ const formData = new FormData();
3386
+ formData.append("purpose", input.purpose);
3387
+ formData.append("subject_id", input.subjectId);
3388
+ formData.append("file", input.file);
3389
+ return this.client.post("/listings/documents", formData, options);
3390
+ }
3391
+ /** Read a private document the signed-in user may see. 404 for any other. */
3392
+ async get(documentId, options) {
3393
+ return this.client.getFile(`/listings/documents/${encodeURIComponent(documentId)}`, void 0, options);
3394
+ }
3395
+ };
3396
+
3327
3397
  // src/modules/reports.ts
3328
3398
  var ReportsModule = class {
3329
3399
  constructor(client) {
@@ -3699,11 +3769,17 @@ var ORDER_STATUSES = [
3699
3769
  // src/types/pay.ts
3700
3770
  var PAYMENT_STATUSES = ["initiated", "funded", "failed", "refunded", "cancelled"];
3701
3771
 
3772
+ // src/types/stores.ts
3773
+ var SELLER_VERIFICATION_STATUSES = ["unverified", "pending", "verified", "rejected"];
3774
+
3702
3775
  // src/types/disputes.ts
3703
3776
  var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfeit", "wrong_item"];
3704
3777
  var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
3705
3778
  var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
3706
3779
 
3780
+ // src/types/documents.ts
3781
+ var DOCUMENT_PURPOSES = ["dispute_evidence", "identity_document", "wholesale_verification"];
3782
+
3707
3783
  // src/types/wholesale.ts
3708
3784
  var BALE_ORDER_STATUSES = ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
3709
3785
 
@@ -3912,6 +3988,7 @@ var MitumbaClient = class {
3912
3988
  admin;
3913
3989
  disputes;
3914
3990
  uploads;
3991
+ documents;
3915
3992
  reports;
3916
3993
  wholesale;
3917
3994
  iam;
@@ -3938,6 +4015,7 @@ var MitumbaClient = class {
3938
4015
  this.admin = new AdminModule(this.api);
3939
4016
  this.disputes = new DisputesModule(this.api);
3940
4017
  this.uploads = new UploadsModule(this.api);
4018
+ this.documents = new DocumentsModule(this.api);
3941
4019
  this.reports = new ReportsModule(this.api);
3942
4020
  this.wholesale = new WholesaleModule(this.api);
3943
4021
  this.iam = new IamModule(this.api);
@@ -3982,6 +4060,6 @@ var MitumbaClient = class {
3982
4060
  }
3983
4061
  };
3984
4062
 
3985
- export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, CheckoutsModule, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DisputesModule, IDBTokenStore, IamModule, LISTING_STATUSES, ListingsModule, MailerModule, MarketsModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, OAuthModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, RealtimeProtocolError, RealtimeUnavailableError, ReportsModule, ReviewsModule, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
4063
+ export { APIClient, APIError, AdminModule, AuthModule, BALE_ORDER_STATUSES, BusinessesModule, CONDITIONS, CartModule, CheckoutsModule, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, DOCUMENT_PURPOSES, DisputesModule, DocumentsModule, IDBTokenStore, IamModule, LISTING_STATUSES, ListingsModule, MailerModule, MarketsModule, MemoryTokenStore, MessagesModule, MitumbaClient, NotificationsModule, OAuthModule, ORDER_STATUSES, OrdersModule, PAYMENT_STATUSES, PayModule, RealtimeProtocolError, RealtimeUnavailableError, ReportsModule, ReviewsModule, SELLER_VERIFICATION_STATUSES, SearchModule, SettingsModule, StoresModule, TWO_FACTOR_METHOD_TYPES, UploadsModule, VaziModule, WholesaleModule, WishlistsModule, activeMarkets, baleShareUrl, cartLineAvailability, categoriesBySection, categorySection, checkoutRefusal, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isCartLineBuyable, isConditionAllowed, isConsentRequired, isDocumentId, isMessagingAPIError, isNewOnlyCategory, isValidPhone, listingShareUrl, maskPhone, normalizePhone, partitionCart, regionById, stepUpRequired, storeShareUrl };
3986
4064
  //# sourceMappingURL=index.mjs.map
3987
4065
  //# sourceMappingURL=index.mjs.map