@neuctra/authix 1.0.15 → 1.0.17
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/neuctra-authix.es.js +284 -269
- package/dist/neuctra-authix.umd.js +10 -10
- package/dist/src/sdk/index.d.ts +81 -21
- package/package.json +1 -1
package/dist/src/sdk/index.d.ts
CHANGED
|
@@ -120,43 +120,67 @@ export declare class NeuctraAuthix {
|
|
|
120
120
|
*/
|
|
121
121
|
constructor(config: NeuctraAuthixConfig);
|
|
122
122
|
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
* 🌐 Universal request helper with structured responses and error handling
|
|
124
|
+
* @param method HTTP method (GET, POST, PUT, DELETE)
|
|
125
|
+
* @param path API endpoint path
|
|
126
|
+
* @param data optional request body
|
|
127
|
+
* @param extraHeaders optional headers
|
|
128
|
+
*/
|
|
129
129
|
private request;
|
|
130
130
|
/**
|
|
131
131
|
* Register a new user
|
|
132
132
|
* @param params user details
|
|
133
133
|
*/
|
|
134
|
-
signup(params: SignupParams): Promise<
|
|
134
|
+
signup(params: SignupParams): Promise<{
|
|
135
|
+
success: boolean;
|
|
136
|
+
data?: any;
|
|
137
|
+
message: string;
|
|
138
|
+
}>;
|
|
135
139
|
/**
|
|
136
140
|
* Login a user
|
|
137
141
|
* @param params login details
|
|
138
142
|
*/
|
|
139
|
-
login(params: LoginParams): Promise<
|
|
143
|
+
login(params: LoginParams): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
data?: any;
|
|
146
|
+
message: string;
|
|
147
|
+
}>;
|
|
140
148
|
/**
|
|
141
149
|
* Update an existing user
|
|
142
150
|
* @param params fields to update
|
|
143
151
|
*/
|
|
144
|
-
updateUser(params: UpdateUserParams): Promise<
|
|
152
|
+
updateUser(params: UpdateUserParams): Promise<{
|
|
153
|
+
success: boolean;
|
|
154
|
+
data?: any;
|
|
155
|
+
message: string;
|
|
156
|
+
}>;
|
|
145
157
|
/**
|
|
146
158
|
* Change a user's password (Admin only)
|
|
147
159
|
* @param params requires userId, currentPassword, newPassword
|
|
148
160
|
*/
|
|
149
|
-
changePassword(params: ChangePasswordParams): Promise<
|
|
161
|
+
changePassword(params: ChangePasswordParams): Promise<{
|
|
162
|
+
success: boolean;
|
|
163
|
+
data?: any;
|
|
164
|
+
message: string;
|
|
165
|
+
}>;
|
|
150
166
|
/**
|
|
151
167
|
* Delete a user
|
|
152
168
|
* @param params requires userId and optionally appId
|
|
153
169
|
*/
|
|
154
|
-
deleteUser(params: DeleteUserParams): Promise<
|
|
170
|
+
deleteUser(params: DeleteUserParams): Promise<{
|
|
171
|
+
success: boolean;
|
|
172
|
+
data?: any;
|
|
173
|
+
message: string;
|
|
174
|
+
}>;
|
|
155
175
|
/**
|
|
156
176
|
* Get the profile of the authenticated user
|
|
157
177
|
* @param params requires JWT token
|
|
158
178
|
*/
|
|
159
|
-
getProfile(params: GetProfileParams): Promise<
|
|
179
|
+
getProfile(params: GetProfileParams): Promise<{
|
|
180
|
+
success: boolean;
|
|
181
|
+
data?: any;
|
|
182
|
+
message: string;
|
|
183
|
+
}>;
|
|
160
184
|
/**
|
|
161
185
|
* Send verification OTP (requires logged-in user token)
|
|
162
186
|
* @param params requires token
|
|
@@ -164,7 +188,11 @@ export declare class NeuctraAuthix {
|
|
|
164
188
|
sendVerifyOTP(params: {
|
|
165
189
|
token: string;
|
|
166
190
|
appId?: string;
|
|
167
|
-
}): Promise<
|
|
191
|
+
}): Promise<{
|
|
192
|
+
success: boolean;
|
|
193
|
+
data?: any;
|
|
194
|
+
message: string;
|
|
195
|
+
}>;
|
|
168
196
|
/**
|
|
169
197
|
* Verify email with OTP (requires logged-in user token)
|
|
170
198
|
* @param params requires token + otp
|
|
@@ -173,7 +201,11 @@ export declare class NeuctraAuthix {
|
|
|
173
201
|
token: string;
|
|
174
202
|
otp: string;
|
|
175
203
|
appId?: string;
|
|
176
|
-
}): Promise<
|
|
204
|
+
}): Promise<{
|
|
205
|
+
success: boolean;
|
|
206
|
+
data?: any;
|
|
207
|
+
message: string;
|
|
208
|
+
}>;
|
|
177
209
|
/**
|
|
178
210
|
* Forgot password (public route)
|
|
179
211
|
* @param params requires email
|
|
@@ -181,7 +213,11 @@ export declare class NeuctraAuthix {
|
|
|
181
213
|
forgotPassword(params: {
|
|
182
214
|
email: string;
|
|
183
215
|
appId?: string;
|
|
184
|
-
}): Promise<
|
|
216
|
+
}): Promise<{
|
|
217
|
+
success: boolean;
|
|
218
|
+
data?: any;
|
|
219
|
+
message: string;
|
|
220
|
+
}>;
|
|
185
221
|
/**
|
|
186
222
|
* Reset password (public route)
|
|
187
223
|
* @param params requires email, otp, newPassword
|
|
@@ -191,31 +227,55 @@ export declare class NeuctraAuthix {
|
|
|
191
227
|
otp: string;
|
|
192
228
|
newPassword: string;
|
|
193
229
|
appId?: string;
|
|
194
|
-
}): Promise<
|
|
230
|
+
}): Promise<{
|
|
231
|
+
success: boolean;
|
|
232
|
+
data?: any;
|
|
233
|
+
message: string;
|
|
234
|
+
}>;
|
|
195
235
|
/**
|
|
196
236
|
* Get all data objects for a user
|
|
197
237
|
* @param params requires userId
|
|
198
238
|
*/
|
|
199
|
-
getUserData(params: GetUserDataParams): Promise<
|
|
239
|
+
getUserData(params: GetUserDataParams): Promise<{
|
|
240
|
+
success: boolean;
|
|
241
|
+
data?: any;
|
|
242
|
+
message: string;
|
|
243
|
+
}>;
|
|
200
244
|
/**
|
|
201
245
|
* Get a single data object for a user
|
|
202
246
|
* @param params requires userId and dataId
|
|
203
247
|
*/
|
|
204
|
-
getSingleUserData(params: GetSingleUserDataParams): Promise<
|
|
248
|
+
getSingleUserData(params: GetSingleUserDataParams): Promise<{
|
|
249
|
+
success: boolean;
|
|
250
|
+
data?: any;
|
|
251
|
+
message: string;
|
|
252
|
+
}>;
|
|
205
253
|
/**
|
|
206
254
|
* Add a new data object to a user
|
|
207
255
|
* @param params requires userId and data object
|
|
208
256
|
*/
|
|
209
|
-
addUserData(params: AddUserDataParams): Promise<
|
|
257
|
+
addUserData(params: AddUserDataParams): Promise<{
|
|
258
|
+
success: boolean;
|
|
259
|
+
data?: any;
|
|
260
|
+
message: string;
|
|
261
|
+
}>;
|
|
210
262
|
/**
|
|
211
263
|
* Update a data object by its id
|
|
212
264
|
* @param params requires userId, dataId, and updated fields
|
|
213
265
|
*/
|
|
214
|
-
updateUserData(params: UpdateUserDataParams): Promise<
|
|
266
|
+
updateUserData(params: UpdateUserDataParams): Promise<{
|
|
267
|
+
success: boolean;
|
|
268
|
+
data?: any;
|
|
269
|
+
message: string;
|
|
270
|
+
}>;
|
|
215
271
|
/**
|
|
216
272
|
* Delete a data object by its id
|
|
217
273
|
* @param params requires userId and dataId
|
|
218
274
|
*/
|
|
219
|
-
deleteUserData(params: DeleteUserDataParams): Promise<
|
|
275
|
+
deleteUserData(params: DeleteUserDataParams): Promise<{
|
|
276
|
+
success: boolean;
|
|
277
|
+
data?: any;
|
|
278
|
+
message: string;
|
|
279
|
+
}>;
|
|
220
280
|
}
|
|
221
281
|
export {};
|