@delopay/sdk 0.2.0 → 0.3.1
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.cjs +29 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -13
- package/dist/index.d.ts +101 -13
- package/dist/index.js +29 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -79,16 +79,27 @@ var Admin = class {
|
|
|
79
79
|
async createTenant(params) {
|
|
80
80
|
return this.request("POST", "/admin/tenant_signup", { body: params });
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Create a new merchant admin user and merchant account atomically.
|
|
84
|
+
*
|
|
85
|
+
* This is the correct endpoint for bootstrapping the first admin user in a
|
|
86
|
+
* fresh deployment — `internal_signup`/`tenant_signup` both require
|
|
87
|
+
* pre-existing merchant records that don't exist on a clean database.
|
|
88
|
+
*
|
|
89
|
+
* `POST /admin/signup_with_merchant_id`
|
|
90
|
+
*/
|
|
91
|
+
async signupWithMerchantId(params) {
|
|
92
|
+
return this.request("POST", "/admin/signup_with_merchant_id", { body: params });
|
|
93
|
+
}
|
|
94
|
+
/** Toggle public signup on/off. `POST /admin/settings/signup` */
|
|
84
95
|
async setSignupSettings(params) {
|
|
85
96
|
return this.request("POST", "/admin/settings/signup", { body: params });
|
|
86
97
|
}
|
|
87
|
-
/**
|
|
98
|
+
/** Read current public-signup status. `GET /admin/settings/signup` */
|
|
88
99
|
async getSignupSettings() {
|
|
89
100
|
return this.request("GET", "/admin/settings/signup");
|
|
90
101
|
}
|
|
91
|
-
/**
|
|
102
|
+
/** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
|
|
92
103
|
async onboardMerchant(params) {
|
|
93
104
|
return this.request("POST", "/admin/onboard_merchant", { body: params });
|
|
94
105
|
}
|
|
@@ -2058,8 +2069,21 @@ var Users = class {
|
|
|
2058
2069
|
async forgotPassword(params) {
|
|
2059
2070
|
return this.request("POST", "/user/forgot_password", { body: params });
|
|
2060
2071
|
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Reset a user's password using the single-purpose JWT delivered by the
|
|
2074
|
+
* forgot-password email.
|
|
2075
|
+
*
|
|
2076
|
+
* The backend's `SinglePurposeJWTAuth` reads the token from the
|
|
2077
|
+
* `Authorization: Bearer …` header, not from the request body, so the
|
|
2078
|
+
* SDK lifts the `token` field out of `params` and sends it as the header.
|
|
2079
|
+
* Callers still pass `{ password, token }` — the shape is unchanged.
|
|
2080
|
+
*/
|
|
2061
2081
|
async resetPassword(params) {
|
|
2062
|
-
|
|
2082
|
+
const { token, password } = params;
|
|
2083
|
+
return this.request("POST", "/user/reset_password", {
|
|
2084
|
+
body: { password },
|
|
2085
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
2086
|
+
});
|
|
2063
2087
|
}
|
|
2064
2088
|
async verifyEmail(params) {
|
|
2065
2089
|
return this.request("POST", "/user/verify_email", { body: params });
|