@mitumba/sdk 5.11.0 → 5.13.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 +44 -14
- package/dist/index.d.ts +44 -14
- package/dist/index.js +30 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -4
package/dist/index.d.mts
CHANGED
|
@@ -1413,6 +1413,12 @@ interface OAuthAuthorizeInput {
|
|
|
1413
1413
|
state: string;
|
|
1414
1414
|
/** The PKCE code challenge (base64url SHA-256 of the verifier). */
|
|
1415
1415
|
code_challenge: string;
|
|
1416
|
+
/**
|
|
1417
|
+
* The OpenID Connect `nonce` from the relying party's authentication request. Carried to the
|
|
1418
|
+
* one-time code and echoed in the id_token's `nonce` claim, so the relying party can bind the
|
|
1419
|
+
* id_token to its own request and reject a replayed one. Pass it whenever the relying party sent it.
|
|
1420
|
+
*/
|
|
1421
|
+
nonce?: string;
|
|
1416
1422
|
}
|
|
1417
1423
|
/**
|
|
1418
1424
|
* Result of the authorize (mint) step: a one-time authorization code plus the echoed state.
|
|
@@ -1442,13 +1448,24 @@ interface OAuthTokenExchangeInput {
|
|
|
1442
1448
|
client_secret?: string;
|
|
1443
1449
|
}
|
|
1444
1450
|
/**
|
|
1445
|
-
* Result of a successful token exchange
|
|
1451
|
+
* Result of a successful token exchange.
|
|
1452
|
+
*
|
|
1453
|
+
* What a client receives depends on its registration:
|
|
1454
|
+
*
|
|
1455
|
+
* - **The Mitumba marketplace** receives a Mitumba session: `access_token` plus `refresh_token`.
|
|
1456
|
+
* - **Every other relying party** receives an access token addressed only to itself (its `aud` is the
|
|
1457
|
+
* client's `client_id`), limited to the consented `scope`, plus an `id_token`. There is **no**
|
|
1458
|
+
* `refresh_token`: renew by repeating the authorization flow (silently with `prompt=none` where the
|
|
1459
|
+
* client is permitted). Verify both tokens against the published JWKS (`getJwks()`). The access
|
|
1460
|
+
* token is not accepted by Mitumba's APIs, only by `userinfo()` and the relying party's own API.
|
|
1446
1461
|
*/
|
|
1447
1462
|
interface OAuthTokenResult {
|
|
1448
1463
|
/** The access token (JWT) for authenticated requests. */
|
|
1449
1464
|
access_token: string;
|
|
1450
|
-
/** The refresh token used to rotate the access token. */
|
|
1451
|
-
refresh_token
|
|
1465
|
+
/** The refresh token used to rotate the access token. Present only for a Mitumba session. */
|
|
1466
|
+
refresh_token?: string;
|
|
1467
|
+
/** The OpenID Connect ID token (ES256). Always present for a relying party. */
|
|
1468
|
+
id_token?: string;
|
|
1452
1469
|
/** Lifetime of the access token in seconds. */
|
|
1453
1470
|
expires_in: number;
|
|
1454
1471
|
/** Always `'Bearer'`. */
|
|
@@ -2959,9 +2976,13 @@ declare class AuthModule {
|
|
|
2959
2976
|
*/
|
|
2960
2977
|
sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse>;
|
|
2961
2978
|
/**
|
|
2962
|
-
* Verify
|
|
2979
|
+
* Verify a phone OTP code.
|
|
2980
|
+
*
|
|
2981
|
+
* Returns the session tokens (auto-persisted) for an account without a second factor. An account
|
|
2982
|
+
* with 2FA gets a `TwoFactorRequired` challenge instead, exactly like `login()`: complete it with
|
|
2983
|
+
* `verify2FA()` or the passkey ceremony. Narrow with `'requires_2fa' in result`.
|
|
2963
2984
|
*/
|
|
2964
|
-
verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens>;
|
|
2985
|
+
verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens | TwoFactorRequired>;
|
|
2965
2986
|
/**
|
|
2966
2987
|
* Refresh the access token using a refresh token.
|
|
2967
2988
|
*/
|
|
@@ -3169,18 +3190,23 @@ declare class OAuthModule {
|
|
|
3169
3190
|
*/
|
|
3170
3191
|
authorize(input: OAuthAuthorizeInput, options?: RequestOptions): Promise<OAuthAuthorizeResult | OAuthConsentRequired>;
|
|
3171
3192
|
/**
|
|
3172
|
-
* Exchange a one-time authorization code for
|
|
3193
|
+
* Exchange a one-time authorization code for tokens.
|
|
3173
3194
|
*
|
|
3174
3195
|
* The relying party calls this server-to-server (or from its own origin) with the PKCE verifier
|
|
3175
3196
|
* that matches the earlier challenge. The authorization code is single-use — a reused, expired,
|
|
3176
|
-
* or tampered code is rejected with `400 invalid_grant`.
|
|
3177
|
-
*
|
|
3178
|
-
*
|
|
3197
|
+
* or tampered code is rejected with `400 invalid_grant`. `grant_type` is set to
|
|
3198
|
+
* `'authorization_code'` by the SDK.
|
|
3199
|
+
*
|
|
3200
|
+
* When the result is a Mitumba session (it carries a `refresh_token`, as for the Mitumba
|
|
3201
|
+
* marketplace), the tokens are persisted into the client session via `setSession`, so the caller
|
|
3202
|
+
* is signed in immediately. Any other relying party receives an access token addressed only to
|
|
3203
|
+
* itself and no refresh token; that result is returned untouched and the client session is left
|
|
3204
|
+
* as it was, because such a token cannot call Mitumba's APIs or be refreshed.
|
|
3179
3205
|
*
|
|
3180
3206
|
* @param input - The token exchange request (code, redirect URI, client, PKCE verifier, optional secret)
|
|
3181
3207
|
* @param options - Optional per-request options (abort signal, extra headers)
|
|
3182
|
-
* @returns The access
|
|
3183
|
-
* @throws {APIError} On `400 invalid_grant` (bad/expired/replayed code
|
|
3208
|
+
* @returns The access token, granted scope, and either a refresh token (Mitumba session) or an id_token (relying party)
|
|
3209
|
+
* @throws {APIError} On `400 invalid_grant` (bad/expired/replayed code or withdrawn consent), `401 invalid_client` (wrong secret), or `503 temporarily_unavailable` (token signing unavailable)
|
|
3184
3210
|
*
|
|
3185
3211
|
* @example
|
|
3186
3212
|
* ```typescript
|
|
@@ -3216,13 +3242,17 @@ declare class OAuthModule {
|
|
|
3216
3242
|
*/
|
|
3217
3243
|
getJwks(options?: RequestOptions): Promise<Jwks>;
|
|
3218
3244
|
/**
|
|
3219
|
-
* Fetch the userinfo claim set
|
|
3245
|
+
* Fetch the userinfo claim set.
|
|
3220
3246
|
*
|
|
3221
|
-
* Returns `sub` plus the identity claims the
|
|
3222
|
-
*
|
|
3247
|
+
* Returns `sub` plus the identity claims the token's granted scopes allow. With a Mitumba session
|
|
3248
|
+
* the SDK attaches the session's bearer token automatically. A relying party, whose client holds no
|
|
3249
|
+
* Mitumba session (`exchangeCode()` does not set one for it), passes its own access token explicitly:
|
|
3250
|
+
* `sdk.oauth.userinfo({ headers: { Authorization: `Bearer ${tokens.access_token}` } })`. A custom
|
|
3251
|
+
* `Authorization` header never replaces an active session's token.
|
|
3223
3252
|
*
|
|
3224
3253
|
* @param options - Optional per-request options (abort signal, extra headers)
|
|
3225
3254
|
* @returns The userinfo claims
|
|
3255
|
+
* @throws {APIError} On `401` with no token, or `401 invalid_token` for a token that is expired, revoked, or no longer consented
|
|
3226
3256
|
*/
|
|
3227
3257
|
userinfo(options?: RequestOptions): Promise<UserInfo>;
|
|
3228
3258
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1413,6 +1413,12 @@ interface OAuthAuthorizeInput {
|
|
|
1413
1413
|
state: string;
|
|
1414
1414
|
/** The PKCE code challenge (base64url SHA-256 of the verifier). */
|
|
1415
1415
|
code_challenge: string;
|
|
1416
|
+
/**
|
|
1417
|
+
* The OpenID Connect `nonce` from the relying party's authentication request. Carried to the
|
|
1418
|
+
* one-time code and echoed in the id_token's `nonce` claim, so the relying party can bind the
|
|
1419
|
+
* id_token to its own request and reject a replayed one. Pass it whenever the relying party sent it.
|
|
1420
|
+
*/
|
|
1421
|
+
nonce?: string;
|
|
1416
1422
|
}
|
|
1417
1423
|
/**
|
|
1418
1424
|
* Result of the authorize (mint) step: a one-time authorization code plus the echoed state.
|
|
@@ -1442,13 +1448,24 @@ interface OAuthTokenExchangeInput {
|
|
|
1442
1448
|
client_secret?: string;
|
|
1443
1449
|
}
|
|
1444
1450
|
/**
|
|
1445
|
-
* Result of a successful token exchange
|
|
1451
|
+
* Result of a successful token exchange.
|
|
1452
|
+
*
|
|
1453
|
+
* What a client receives depends on its registration:
|
|
1454
|
+
*
|
|
1455
|
+
* - **The Mitumba marketplace** receives a Mitumba session: `access_token` plus `refresh_token`.
|
|
1456
|
+
* - **Every other relying party** receives an access token addressed only to itself (its `aud` is the
|
|
1457
|
+
* client's `client_id`), limited to the consented `scope`, plus an `id_token`. There is **no**
|
|
1458
|
+
* `refresh_token`: renew by repeating the authorization flow (silently with `prompt=none` where the
|
|
1459
|
+
* client is permitted). Verify both tokens against the published JWKS (`getJwks()`). The access
|
|
1460
|
+
* token is not accepted by Mitumba's APIs, only by `userinfo()` and the relying party's own API.
|
|
1446
1461
|
*/
|
|
1447
1462
|
interface OAuthTokenResult {
|
|
1448
1463
|
/** The access token (JWT) for authenticated requests. */
|
|
1449
1464
|
access_token: string;
|
|
1450
|
-
/** The refresh token used to rotate the access token. */
|
|
1451
|
-
refresh_token
|
|
1465
|
+
/** The refresh token used to rotate the access token. Present only for a Mitumba session. */
|
|
1466
|
+
refresh_token?: string;
|
|
1467
|
+
/** The OpenID Connect ID token (ES256). Always present for a relying party. */
|
|
1468
|
+
id_token?: string;
|
|
1452
1469
|
/** Lifetime of the access token in seconds. */
|
|
1453
1470
|
expires_in: number;
|
|
1454
1471
|
/** Always `'Bearer'`. */
|
|
@@ -2959,9 +2976,13 @@ declare class AuthModule {
|
|
|
2959
2976
|
*/
|
|
2960
2977
|
sendOtp(input: SendOtpInput, options?: RequestOptions): Promise<MessageResponse>;
|
|
2961
2978
|
/**
|
|
2962
|
-
* Verify
|
|
2979
|
+
* Verify a phone OTP code.
|
|
2980
|
+
*
|
|
2981
|
+
* Returns the session tokens (auto-persisted) for an account without a second factor. An account
|
|
2982
|
+
* with 2FA gets a `TwoFactorRequired` challenge instead, exactly like `login()`: complete it with
|
|
2983
|
+
* `verify2FA()` or the passkey ceremony. Narrow with `'requires_2fa' in result`.
|
|
2963
2984
|
*/
|
|
2964
|
-
verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens>;
|
|
2985
|
+
verifyOtp(input: VerifyOtpInput, options?: RequestOptions): Promise<AuthTokens | TwoFactorRequired>;
|
|
2965
2986
|
/**
|
|
2966
2987
|
* Refresh the access token using a refresh token.
|
|
2967
2988
|
*/
|
|
@@ -3169,18 +3190,23 @@ declare class OAuthModule {
|
|
|
3169
3190
|
*/
|
|
3170
3191
|
authorize(input: OAuthAuthorizeInput, options?: RequestOptions): Promise<OAuthAuthorizeResult | OAuthConsentRequired>;
|
|
3171
3192
|
/**
|
|
3172
|
-
* Exchange a one-time authorization code for
|
|
3193
|
+
* Exchange a one-time authorization code for tokens.
|
|
3173
3194
|
*
|
|
3174
3195
|
* The relying party calls this server-to-server (or from its own origin) with the PKCE verifier
|
|
3175
3196
|
* that matches the earlier challenge. The authorization code is single-use — a reused, expired,
|
|
3176
|
-
* or tampered code is rejected with `400 invalid_grant`.
|
|
3177
|
-
*
|
|
3178
|
-
*
|
|
3197
|
+
* or tampered code is rejected with `400 invalid_grant`. `grant_type` is set to
|
|
3198
|
+
* `'authorization_code'` by the SDK.
|
|
3199
|
+
*
|
|
3200
|
+
* When the result is a Mitumba session (it carries a `refresh_token`, as for the Mitumba
|
|
3201
|
+
* marketplace), the tokens are persisted into the client session via `setSession`, so the caller
|
|
3202
|
+
* is signed in immediately. Any other relying party receives an access token addressed only to
|
|
3203
|
+
* itself and no refresh token; that result is returned untouched and the client session is left
|
|
3204
|
+
* as it was, because such a token cannot call Mitumba's APIs or be refreshed.
|
|
3179
3205
|
*
|
|
3180
3206
|
* @param input - The token exchange request (code, redirect URI, client, PKCE verifier, optional secret)
|
|
3181
3207
|
* @param options - Optional per-request options (abort signal, extra headers)
|
|
3182
|
-
* @returns The access
|
|
3183
|
-
* @throws {APIError} On `400 invalid_grant` (bad/expired/replayed code
|
|
3208
|
+
* @returns The access token, granted scope, and either a refresh token (Mitumba session) or an id_token (relying party)
|
|
3209
|
+
* @throws {APIError} On `400 invalid_grant` (bad/expired/replayed code or withdrawn consent), `401 invalid_client` (wrong secret), or `503 temporarily_unavailable` (token signing unavailable)
|
|
3184
3210
|
*
|
|
3185
3211
|
* @example
|
|
3186
3212
|
* ```typescript
|
|
@@ -3216,13 +3242,17 @@ declare class OAuthModule {
|
|
|
3216
3242
|
*/
|
|
3217
3243
|
getJwks(options?: RequestOptions): Promise<Jwks>;
|
|
3218
3244
|
/**
|
|
3219
|
-
* Fetch the userinfo claim set
|
|
3245
|
+
* Fetch the userinfo claim set.
|
|
3220
3246
|
*
|
|
3221
|
-
* Returns `sub` plus the identity claims the
|
|
3222
|
-
*
|
|
3247
|
+
* Returns `sub` plus the identity claims the token's granted scopes allow. With a Mitumba session
|
|
3248
|
+
* the SDK attaches the session's bearer token automatically. A relying party, whose client holds no
|
|
3249
|
+
* Mitumba session (`exchangeCode()` does not set one for it), passes its own access token explicitly:
|
|
3250
|
+
* `sdk.oauth.userinfo({ headers: { Authorization: `Bearer ${tokens.access_token}` } })`. A custom
|
|
3251
|
+
* `Authorization` header never replaces an active session's token.
|
|
3223
3252
|
*
|
|
3224
3253
|
* @param options - Optional per-request options (abort signal, extra headers)
|
|
3225
3254
|
* @returns The userinfo claims
|
|
3255
|
+
* @throws {APIError} On `401` with no token, or `401 invalid_token` for a token that is expired, revoked, or no longer consented
|
|
3226
3256
|
*/
|
|
3227
3257
|
userinfo(options?: RequestOptions): Promise<UserInfo>;
|
|
3228
3258
|
/**
|
package/dist/index.js
CHANGED
|
@@ -447,7 +447,6 @@ var AuthModule = class {
|
|
|
447
447
|
constructor(client) {
|
|
448
448
|
this.client = client;
|
|
449
449
|
}
|
|
450
|
-
client;
|
|
451
450
|
/**
|
|
452
451
|
* Register a new account.
|
|
453
452
|
* If using EmailRegisterInput, returns AuthTokens (auto-persisted).
|
|
@@ -479,11 +478,15 @@ var AuthModule = class {
|
|
|
479
478
|
return this.client.post("/auth/otp/send", input, options);
|
|
480
479
|
}
|
|
481
480
|
/**
|
|
482
|
-
* Verify
|
|
481
|
+
* Verify a phone OTP code.
|
|
482
|
+
*
|
|
483
|
+
* Returns the session tokens (auto-persisted) for an account without a second factor. An account
|
|
484
|
+
* with 2FA gets a `TwoFactorRequired` challenge instead, exactly like `login()`: complete it with
|
|
485
|
+
* `verify2FA()` or the passkey ceremony. Narrow with `'requires_2fa' in result`.
|
|
483
486
|
*/
|
|
484
487
|
async verifyOtp(input, options) {
|
|
485
488
|
const result = await this.client.post("/auth/otp/verify", input, options);
|
|
486
|
-
await this.client.setSession(result);
|
|
489
|
+
if (isAuthTokens(result)) await this.client.setSession(result);
|
|
487
490
|
return result;
|
|
488
491
|
}
|
|
489
492
|
/**
|
|
@@ -701,7 +704,6 @@ var OAuthModule = class {
|
|
|
701
704
|
constructor(client) {
|
|
702
705
|
this.client = client;
|
|
703
706
|
}
|
|
704
|
-
client;
|
|
705
707
|
/**
|
|
706
708
|
* Mint a one-time authorization code for the relying party.
|
|
707
709
|
*
|
|
@@ -735,18 +737,23 @@ var OAuthModule = class {
|
|
|
735
737
|
);
|
|
736
738
|
}
|
|
737
739
|
/**
|
|
738
|
-
* Exchange a one-time authorization code for
|
|
740
|
+
* Exchange a one-time authorization code for tokens.
|
|
739
741
|
*
|
|
740
742
|
* The relying party calls this server-to-server (or from its own origin) with the PKCE verifier
|
|
741
743
|
* that matches the earlier challenge. The authorization code is single-use — a reused, expired,
|
|
742
|
-
* or tampered code is rejected with `400 invalid_grant`.
|
|
743
|
-
*
|
|
744
|
-
*
|
|
744
|
+
* or tampered code is rejected with `400 invalid_grant`. `grant_type` is set to
|
|
745
|
+
* `'authorization_code'` by the SDK.
|
|
746
|
+
*
|
|
747
|
+
* When the result is a Mitumba session (it carries a `refresh_token`, as for the Mitumba
|
|
748
|
+
* marketplace), the tokens are persisted into the client session via `setSession`, so the caller
|
|
749
|
+
* is signed in immediately. Any other relying party receives an access token addressed only to
|
|
750
|
+
* itself and no refresh token; that result is returned untouched and the client session is left
|
|
751
|
+
* as it was, because such a token cannot call Mitumba's APIs or be refreshed.
|
|
745
752
|
*
|
|
746
753
|
* @param input - The token exchange request (code, redirect URI, client, PKCE verifier, optional secret)
|
|
747
754
|
* @param options - Optional per-request options (abort signal, extra headers)
|
|
748
|
-
* @returns The access
|
|
749
|
-
* @throws {APIError} On `400 invalid_grant` (bad/expired/replayed code
|
|
755
|
+
* @returns The access token, granted scope, and either a refresh token (Mitumba session) or an id_token (relying party)
|
|
756
|
+
* @throws {APIError} On `400 invalid_grant` (bad/expired/replayed code or withdrawn consent), `401 invalid_client` (wrong secret), or `503 temporarily_unavailable` (token signing unavailable)
|
|
750
757
|
*
|
|
751
758
|
* @example
|
|
752
759
|
* ```typescript
|
|
@@ -765,10 +772,12 @@ var OAuthModule = class {
|
|
|
765
772
|
{ ...input, grant_type: "authorization_code" },
|
|
766
773
|
options
|
|
767
774
|
);
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
775
|
+
if (result.refresh_token) {
|
|
776
|
+
await this.client.setSession({
|
|
777
|
+
access_token: result.access_token,
|
|
778
|
+
refresh_token: result.refresh_token
|
|
779
|
+
});
|
|
780
|
+
}
|
|
772
781
|
return result;
|
|
773
782
|
}
|
|
774
783
|
/**
|
|
@@ -797,13 +806,17 @@ var OAuthModule = class {
|
|
|
797
806
|
return this.client.get("/auth/oauth/jwks.json", void 0, options);
|
|
798
807
|
}
|
|
799
808
|
/**
|
|
800
|
-
* Fetch the userinfo claim set
|
|
809
|
+
* Fetch the userinfo claim set.
|
|
801
810
|
*
|
|
802
|
-
* Returns `sub` plus the identity claims the
|
|
803
|
-
*
|
|
811
|
+
* Returns `sub` plus the identity claims the token's granted scopes allow. With a Mitumba session
|
|
812
|
+
* the SDK attaches the session's bearer token automatically. A relying party, whose client holds no
|
|
813
|
+
* Mitumba session (`exchangeCode()` does not set one for it), passes its own access token explicitly:
|
|
814
|
+
* `sdk.oauth.userinfo({ headers: { Authorization: `Bearer ${tokens.access_token}` } })`. A custom
|
|
815
|
+
* `Authorization` header never replaces an active session's token.
|
|
804
816
|
*
|
|
805
817
|
* @param options - Optional per-request options (abort signal, extra headers)
|
|
806
818
|
* @returns The userinfo claims
|
|
819
|
+
* @throws {APIError} On `401` with no token, or `401 invalid_token` for a token that is expired, revoked, or no longer consented
|
|
807
820
|
*/
|
|
808
821
|
async userinfo(options) {
|
|
809
822
|
return this.client.get("/auth/oauth/userinfo", void 0, options);
|
|
@@ -899,7 +912,6 @@ var ListingsModule = class {
|
|
|
899
912
|
constructor(client) {
|
|
900
913
|
this.client = client;
|
|
901
914
|
}
|
|
902
|
-
client;
|
|
903
915
|
/**
|
|
904
916
|
* Browse the marketplace feed with optional filters.
|
|
905
917
|
*/
|
|
@@ -1044,7 +1056,6 @@ var SearchModule = class {
|
|
|
1044
1056
|
constructor(client) {
|
|
1045
1057
|
this.client = client;
|
|
1046
1058
|
}
|
|
1047
|
-
client;
|
|
1048
1059
|
/**
|
|
1049
1060
|
* Perform a full-text search with optional filters.
|
|
1050
1061
|
*/
|
|
@@ -1084,7 +1095,6 @@ var OrdersModule = class {
|
|
|
1084
1095
|
constructor(client) {
|
|
1085
1096
|
this.client = client;
|
|
1086
1097
|
}
|
|
1087
|
-
client;
|
|
1088
1098
|
/**
|
|
1089
1099
|
* Create a new order from a listing.
|
|
1090
1100
|
*/
|
|
@@ -1120,7 +1130,6 @@ var PayModule = class {
|
|
|
1120
1130
|
constructor(client) {
|
|
1121
1131
|
this.client = client;
|
|
1122
1132
|
}
|
|
1123
|
-
client;
|
|
1124
1133
|
/**
|
|
1125
1134
|
* Initiate an M-Pesa STK Push payment for an order.
|
|
1126
1135
|
*/
|
|
@@ -1176,7 +1185,6 @@ var VaziModule = class {
|
|
|
1176
1185
|
constructor(client) {
|
|
1177
1186
|
this.client = client;
|
|
1178
1187
|
}
|
|
1179
|
-
client;
|
|
1180
1188
|
/**
|
|
1181
1189
|
* Browse the AI-curated outfit feed.
|
|
1182
1190
|
*/
|
|
@@ -1305,8 +1313,6 @@ var ManagedMessagesRealtimeConnection = class {
|
|
|
1305
1313
|
this.options = options;
|
|
1306
1314
|
this.currentCursor = options.resumeCursor ?? null;
|
|
1307
1315
|
}
|
|
1308
|
-
client;
|
|
1309
|
-
options;
|
|
1310
1316
|
currentState = "closed";
|
|
1311
1317
|
currentCursor;
|
|
1312
1318
|
socket = null;
|
|
@@ -1640,7 +1646,6 @@ var MessagesModule = class {
|
|
|
1640
1646
|
constructor(client) {
|
|
1641
1647
|
this.client = client;
|
|
1642
1648
|
}
|
|
1643
|
-
client;
|
|
1644
1649
|
/**
|
|
1645
1650
|
* Create a bilateral block from a v2 inbox perspective. A buyer blocks a store (`{ store_id }`);
|
|
1646
1651
|
* a store blocks a buyer (`{ buyer_id }`). Idempotent.
|
|
@@ -1826,7 +1831,6 @@ var NotificationsModule = class {
|
|
|
1826
1831
|
constructor(client) {
|
|
1827
1832
|
this.client = client;
|
|
1828
1833
|
}
|
|
1829
|
-
client;
|
|
1830
1834
|
/**
|
|
1831
1835
|
* List paginated notifications with unread count.
|
|
1832
1836
|
*/
|
|
@@ -1850,7 +1854,6 @@ var StoresModule = class {
|
|
|
1850
1854
|
constructor(client) {
|
|
1851
1855
|
this.client = client;
|
|
1852
1856
|
}
|
|
1853
|
-
client;
|
|
1854
1857
|
/**
|
|
1855
1858
|
* Get a store by its URL slug.
|
|
1856
1859
|
*/
|
|
@@ -1964,7 +1967,6 @@ var ReviewsModule = class {
|
|
|
1964
1967
|
constructor(client) {
|
|
1965
1968
|
this.client = client;
|
|
1966
1969
|
}
|
|
1967
|
-
client;
|
|
1968
1970
|
/**
|
|
1969
1971
|
* List reviews for a store (public).
|
|
1970
1972
|
*/
|
|
@@ -1998,7 +2000,6 @@ var WishlistsModule = class {
|
|
|
1998
2000
|
constructor(client) {
|
|
1999
2001
|
this.client = client;
|
|
2000
2002
|
}
|
|
2001
|
-
client;
|
|
2002
2003
|
/**
|
|
2003
2004
|
* List saved listings.
|
|
2004
2005
|
*/
|
|
@@ -2024,7 +2025,6 @@ var CartModule = class {
|
|
|
2024
2025
|
constructor(client) {
|
|
2025
2026
|
this.client = client;
|
|
2026
2027
|
}
|
|
2027
|
-
client;
|
|
2028
2028
|
/**
|
|
2029
2029
|
* List items in the cart.
|
|
2030
2030
|
*/
|
|
@@ -2062,7 +2062,6 @@ var SettingsModule = class {
|
|
|
2062
2062
|
constructor(client) {
|
|
2063
2063
|
this.client = client;
|
|
2064
2064
|
}
|
|
2065
|
-
client;
|
|
2066
2065
|
// ── Profile ──
|
|
2067
2066
|
async getProfile(options) {
|
|
2068
2067
|
return this.client.get("/auth/me", void 0, options);
|
|
@@ -2195,7 +2194,6 @@ var MailerModule = class {
|
|
|
2195
2194
|
constructor(client) {
|
|
2196
2195
|
this.client = client;
|
|
2197
2196
|
}
|
|
2198
|
-
client;
|
|
2199
2197
|
/**
|
|
2200
2198
|
* Send a transactional email via the notifications worker.
|
|
2201
2199
|
*/
|
|
@@ -2209,7 +2207,6 @@ var BusinessesModule = class {
|
|
|
2209
2207
|
constructor(client) {
|
|
2210
2208
|
this.client = client;
|
|
2211
2209
|
}
|
|
2212
|
-
client;
|
|
2213
2210
|
/** Get all businesses owned by the current user. */
|
|
2214
2211
|
async getMine(options) {
|
|
2215
2212
|
return this.client.get("/listings/businesses/mine", void 0, options);
|
|
@@ -2229,7 +2226,6 @@ var AdminModule = class {
|
|
|
2229
2226
|
constructor(client) {
|
|
2230
2227
|
this.client = client;
|
|
2231
2228
|
}
|
|
2232
|
-
client;
|
|
2233
2229
|
async blockIp(ip, reasonOrDuration = 24, durationOrOptions, maybeOptions) {
|
|
2234
2230
|
const modern = typeof reasonOrDuration === "string";
|
|
2235
2231
|
const reason = modern ? reasonOrDuration : "No reason supplied by legacy SDK caller";
|
|
@@ -2433,7 +2429,6 @@ var DisputesModule = class {
|
|
|
2433
2429
|
constructor(client) {
|
|
2434
2430
|
this.client = client;
|
|
2435
2431
|
}
|
|
2436
|
-
client;
|
|
2437
2432
|
/** Raise a dispute on an order (buyer). */
|
|
2438
2433
|
async raise(orderId, input, options) {
|
|
2439
2434
|
return this.client.post(`/orders/${orderId}/dispute`, input, options);
|
|
@@ -2481,7 +2476,6 @@ var UploadsModule = class {
|
|
|
2481
2476
|
constructor(client) {
|
|
2482
2477
|
this.client = client;
|
|
2483
2478
|
}
|
|
2484
|
-
client;
|
|
2485
2479
|
/** Upload a file (avatar, evidence, etc). Returns the public CDN URL. */
|
|
2486
2480
|
async upload(file, options) {
|
|
2487
2481
|
const formData = new FormData();
|
|
@@ -2495,7 +2489,6 @@ var ReportsModule = class {
|
|
|
2495
2489
|
constructor(client) {
|
|
2496
2490
|
this.client = client;
|
|
2497
2491
|
}
|
|
2498
|
-
client;
|
|
2499
2492
|
/** Report a listing, review, store, or user for admin review. */
|
|
2500
2493
|
async create(input, options) {
|
|
2501
2494
|
return this.client.post("/listings/reports", input, options);
|
|
@@ -2507,7 +2500,6 @@ var WholesaleModule = class {
|
|
|
2507
2500
|
constructor(client) {
|
|
2508
2501
|
this.client = client;
|
|
2509
2502
|
}
|
|
2510
|
-
client;
|
|
2511
2503
|
// ── Wholesale Store ──
|
|
2512
2504
|
/** Get the current user's wholesale store and depots. */
|
|
2513
2505
|
async getWholesaleStore(options) {
|
|
@@ -2643,7 +2635,6 @@ var IamModule = class {
|
|
|
2643
2635
|
constructor(client) {
|
|
2644
2636
|
this.client = client;
|
|
2645
2637
|
}
|
|
2646
|
-
client;
|
|
2647
2638
|
/** Start IAM sign-in with an organization ID or alias, email and password. */
|
|
2648
2639
|
async login(input, options) {
|
|
2649
2640
|
const result = await this.client.post("/auth/iam/login", input, options);
|
|
@@ -2780,7 +2771,6 @@ var MarketsModule = class {
|
|
|
2780
2771
|
constructor(client) {
|
|
2781
2772
|
this.client = client;
|
|
2782
2773
|
}
|
|
2783
|
-
client;
|
|
2784
2774
|
/**
|
|
2785
2775
|
* List the platform's markets: the countries Mitumba operates in or plans to, with each
|
|
2786
2776
|
* market's currency, locale, phone rules, region naming and payment rails.
|