@delopay/sdk 0.12.1 → 0.14.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/internal.cjs +44 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +63 -3
- package/dist/internal.d.ts +63 -3
- package/dist/internal.js +44 -0
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
package/dist/internal.cjs
CHANGED
|
@@ -3005,6 +3005,50 @@ var AdminPortal = class {
|
|
|
3005
3005
|
async deleteAccount(merchantId) {
|
|
3006
3006
|
return this.request("DELETE", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
|
|
3007
3007
|
}
|
|
3008
|
+
/**
|
|
3009
|
+
* Create a brand-new user attached to the given merchant. The user is
|
|
3010
|
+
* marked `is_verified = true` so the admin can hand off credentials
|
|
3011
|
+
* immediately — no email round-trip is sent.
|
|
3012
|
+
*/
|
|
3013
|
+
async createUserForMerchant(customerId, body) {
|
|
3014
|
+
return this.request("POST", `/admin-portal/customers/${encodeURIComponent(customerId)}/users`, {
|
|
3015
|
+
body
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
/**
|
|
3019
|
+
* Edit a user record. Any subset of fields may be supplied. `role_id`
|
|
3020
|
+
* requires `merchant_id`. `password` triggers a password reset (validated
|
|
3021
|
+
* against signup policy + JWT blacklist). `reset_2fa` clears TOTP state
|
|
3022
|
+
* so the user re-enrolls on next login. `is_active` supports both
|
|
3023
|
+
* directions: false soft-disables, true reactivates a soft-disabled user.
|
|
3024
|
+
*/
|
|
3025
|
+
async updateUser(userId, body) {
|
|
3026
|
+
return this.request("PATCH", `/admin-portal/users/${encodeURIComponent(userId)}`, { body });
|
|
3027
|
+
}
|
|
3028
|
+
/**
|
|
3029
|
+
* Soft-delete a user globally: deactivates the row, blacklists existing
|
|
3030
|
+
* JWTs, and wipes credentials. Distinct from `deleteUserRole`, which
|
|
3031
|
+
* removes a single role binding while leaving the user signed-in elsewhere.
|
|
3032
|
+
*/
|
|
3033
|
+
async deleteUser(userId) {
|
|
3034
|
+
return this.request("DELETE", `/admin-portal/users/${encodeURIComponent(userId)}`);
|
|
3035
|
+
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Set a target merchant's shop iframe-allowed origins. Internal-admin
|
|
3038
|
+
* route — accepts an admin JWT or admin API key without requiring the
|
|
3039
|
+
* caller to be scoped to the target merchant. Pass `null` (or an empty
|
|
3040
|
+
* array) to clear the allowlist back to same-origin only.
|
|
3041
|
+
*
|
|
3042
|
+
* Server validates each origin: full origin (scheme + host[:port]),
|
|
3043
|
+
* no path/query/fragment, no wildcards.
|
|
3044
|
+
*/
|
|
3045
|
+
async updateShopIframeOrigins(merchantId, profileId, origins) {
|
|
3046
|
+
return this.request(
|
|
3047
|
+
"POST",
|
|
3048
|
+
`/admin-portal/accounts/${encodeURIComponent(merchantId)}/business_profile/${encodeURIComponent(profileId)}/iframe-origins`,
|
|
3049
|
+
{ body: { iframe_allowed_origins: origins } }
|
|
3050
|
+
);
|
|
3051
|
+
}
|
|
3008
3052
|
};
|
|
3009
3053
|
|
|
3010
3054
|
// src/internal/resources/auditLogs.ts
|