@mitumba/sdk 5.33.0 → 5.34.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 +132 -1
- package/dist/index.d.ts +132 -1
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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);
|
|
@@ -2963,6 +2988,13 @@ var AdminModule = class {
|
|
|
2963
2988
|
return this.client.post(`/admin/stores/${storeId}/unverify`, void 0, options);
|
|
2964
2989
|
}
|
|
2965
2990
|
// ── Verification Queue ──
|
|
2991
|
+
/**
|
|
2992
|
+
* Read a private document as an operator. Dispute evidence needs `admin:read`; identity documents
|
|
2993
|
+
* and wholesale verification photos need `sellers:verify`.
|
|
2994
|
+
*/
|
|
2995
|
+
async getDocument(documentId, options) {
|
|
2996
|
+
return this.client.getFile(`/admin/documents/${encodeURIComponent(documentId)}`, void 0, options);
|
|
2997
|
+
}
|
|
2966
2998
|
async listVerifications(params, options) {
|
|
2967
2999
|
return this.client.get("/admin/verifications", params, options);
|
|
2968
3000
|
}
|
|
@@ -3324,6 +3356,28 @@ var UploadsModule = class {
|
|
|
3324
3356
|
}
|
|
3325
3357
|
};
|
|
3326
3358
|
|
|
3359
|
+
// src/modules/documents.ts
|
|
3360
|
+
function isDocumentId(value) {
|
|
3361
|
+
return /^doc_[a-z0-9]{1,60}$/.test(value);
|
|
3362
|
+
}
|
|
3363
|
+
var DocumentsModule = class {
|
|
3364
|
+
constructor(client) {
|
|
3365
|
+
this.client = client;
|
|
3366
|
+
}
|
|
3367
|
+
/** Upload a private document. Returns its id; the file itself is never public. */
|
|
3368
|
+
async upload(input, options) {
|
|
3369
|
+
const formData = new FormData();
|
|
3370
|
+
formData.append("purpose", input.purpose);
|
|
3371
|
+
formData.append("subject_id", input.subjectId);
|
|
3372
|
+
formData.append("file", input.file);
|
|
3373
|
+
return this.client.post("/listings/documents", formData, options);
|
|
3374
|
+
}
|
|
3375
|
+
/** Read a private document the signed-in user may see. 404 for any other. */
|
|
3376
|
+
async get(documentId, options) {
|
|
3377
|
+
return this.client.getFile(`/listings/documents/${encodeURIComponent(documentId)}`, void 0, options);
|
|
3378
|
+
}
|
|
3379
|
+
};
|
|
3380
|
+
|
|
3327
3381
|
// src/modules/reports.ts
|
|
3328
3382
|
var ReportsModule = class {
|
|
3329
3383
|
constructor(client) {
|
|
@@ -3704,6 +3758,9 @@ var DISPUTE_REASONS = ["not_received", "not_as_described", "damaged", "counterfe
|
|
|
3704
3758
|
var DESIRED_RESOLUTIONS = ["refund", "replacement", "partial_refund"];
|
|
3705
3759
|
var DISPUTE_STATUSES = ["open", "seller_responded", "under_review", "resolved_refund", "resolved_release", "resolved_partial", "withdrawn"];
|
|
3706
3760
|
|
|
3761
|
+
// src/types/documents.ts
|
|
3762
|
+
var DOCUMENT_PURPOSES = ["dispute_evidence", "identity_document", "wholesale_verification"];
|
|
3763
|
+
|
|
3707
3764
|
// src/types/wholesale.ts
|
|
3708
3765
|
var BALE_ORDER_STATUSES = ["pending_payment", "paid", "confirmed", "in_transit", "delivered", "completed", "cancelled"];
|
|
3709
3766
|
|
|
@@ -3912,6 +3969,7 @@ var MitumbaClient = class {
|
|
|
3912
3969
|
admin;
|
|
3913
3970
|
disputes;
|
|
3914
3971
|
uploads;
|
|
3972
|
+
documents;
|
|
3915
3973
|
reports;
|
|
3916
3974
|
wholesale;
|
|
3917
3975
|
iam;
|
|
@@ -3938,6 +3996,7 @@ var MitumbaClient = class {
|
|
|
3938
3996
|
this.admin = new AdminModule(this.api);
|
|
3939
3997
|
this.disputes = new DisputesModule(this.api);
|
|
3940
3998
|
this.uploads = new UploadsModule(this.api);
|
|
3999
|
+
this.documents = new DocumentsModule(this.api);
|
|
3941
4000
|
this.reports = new ReportsModule(this.api);
|
|
3942
4001
|
this.wholesale = new WholesaleModule(this.api);
|
|
3943
4002
|
this.iam = new IamModule(this.api);
|
|
@@ -3982,6 +4041,6 @@ var MitumbaClient = class {
|
|
|
3982
4041
|
}
|
|
3983
4042
|
};
|
|
3984
4043
|
|
|
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 };
|
|
4044
|
+
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, 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
4045
|
//# sourceMappingURL=index.mjs.map
|
|
3987
4046
|
//# sourceMappingURL=index.mjs.map
|