@dyrected/sdk 2.5.12 → 2.5.13
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 +16 -0
- package/dist/index.d.cts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +16 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1031,6 +1031,22 @@ var DyrectedClient = class {
|
|
|
1031
1031
|
acceptInvite: (token, password, extraFields) => this.request(`/api/collections/${slug}/accept-invite`, {
|
|
1032
1032
|
method: "POST",
|
|
1033
1033
|
body: JSON.stringify({ token, password, ...extraFields })
|
|
1034
|
+
}),
|
|
1035
|
+
/**
|
|
1036
|
+
* Change the password for a specific user document.
|
|
1037
|
+
* Non-admins must supply oldPassword. newPassword and confirmPassword must match.
|
|
1038
|
+
*/
|
|
1039
|
+
changePassword: (id, payload) => this.request(`/api/collections/${slug}/${id}/change-password`, {
|
|
1040
|
+
method: "POST",
|
|
1041
|
+
body: JSON.stringify(payload)
|
|
1042
|
+
}),
|
|
1043
|
+
/**
|
|
1044
|
+
* Admin-initiated password reset. Sends a reset link to the given email address.
|
|
1045
|
+
* Wraps the existing POST /forgot-password endpoint.
|
|
1046
|
+
*/
|
|
1047
|
+
sendResetLink: (email) => this.request(`/api/collections/${slug}/forgot-password`, {
|
|
1048
|
+
method: "POST",
|
|
1049
|
+
body: JSON.stringify({ email })
|
|
1034
1050
|
})
|
|
1035
1051
|
};
|
|
1036
1052
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -149,6 +149,26 @@ declare class DyrectedClient<TSchema extends BaseSchema = any> {
|
|
|
149
149
|
token: string;
|
|
150
150
|
user: TSchema["collections"][K];
|
|
151
151
|
}>;
|
|
152
|
+
/**
|
|
153
|
+
* Change the password for a specific user document.
|
|
154
|
+
* Non-admins must supply oldPassword. newPassword and confirmPassword must match.
|
|
155
|
+
*/
|
|
156
|
+
changePassword: (id: string, payload: {
|
|
157
|
+
oldPassword?: string;
|
|
158
|
+
newPassword: string;
|
|
159
|
+
confirmPassword: string;
|
|
160
|
+
}) => Promise<{
|
|
161
|
+
success: boolean;
|
|
162
|
+
message: string;
|
|
163
|
+
}>;
|
|
164
|
+
/**
|
|
165
|
+
* Admin-initiated password reset. Sends a reset link to the given email address.
|
|
166
|
+
* Wraps the existing POST /forgot-password endpoint.
|
|
167
|
+
*/
|
|
168
|
+
sendResetLink: (email: string) => Promise<{
|
|
169
|
+
success: boolean;
|
|
170
|
+
message: string;
|
|
171
|
+
}>;
|
|
152
172
|
};
|
|
153
173
|
/**
|
|
154
174
|
* Access a global by its slug with a fluent builder.
|
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,26 @@ declare class DyrectedClient<TSchema extends BaseSchema = any> {
|
|
|
149
149
|
token: string;
|
|
150
150
|
user: TSchema["collections"][K];
|
|
151
151
|
}>;
|
|
152
|
+
/**
|
|
153
|
+
* Change the password for a specific user document.
|
|
154
|
+
* Non-admins must supply oldPassword. newPassword and confirmPassword must match.
|
|
155
|
+
*/
|
|
156
|
+
changePassword: (id: string, payload: {
|
|
157
|
+
oldPassword?: string;
|
|
158
|
+
newPassword: string;
|
|
159
|
+
confirmPassword: string;
|
|
160
|
+
}) => Promise<{
|
|
161
|
+
success: boolean;
|
|
162
|
+
message: string;
|
|
163
|
+
}>;
|
|
164
|
+
/**
|
|
165
|
+
* Admin-initiated password reset. Sends a reset link to the given email address.
|
|
166
|
+
* Wraps the existing POST /forgot-password endpoint.
|
|
167
|
+
*/
|
|
168
|
+
sendResetLink: (email: string) => Promise<{
|
|
169
|
+
success: boolean;
|
|
170
|
+
message: string;
|
|
171
|
+
}>;
|
|
152
172
|
};
|
|
153
173
|
/**
|
|
154
174
|
* Access a global by its slug with a fluent builder.
|
package/dist/index.js
CHANGED
|
@@ -993,6 +993,22 @@ var DyrectedClient = class {
|
|
|
993
993
|
acceptInvite: (token, password, extraFields) => this.request(`/api/collections/${slug}/accept-invite`, {
|
|
994
994
|
method: "POST",
|
|
995
995
|
body: JSON.stringify({ token, password, ...extraFields })
|
|
996
|
+
}),
|
|
997
|
+
/**
|
|
998
|
+
* Change the password for a specific user document.
|
|
999
|
+
* Non-admins must supply oldPassword. newPassword and confirmPassword must match.
|
|
1000
|
+
*/
|
|
1001
|
+
changePassword: (id, payload) => this.request(`/api/collections/${slug}/${id}/change-password`, {
|
|
1002
|
+
method: "POST",
|
|
1003
|
+
body: JSON.stringify(payload)
|
|
1004
|
+
}),
|
|
1005
|
+
/**
|
|
1006
|
+
* Admin-initiated password reset. Sends a reset link to the given email address.
|
|
1007
|
+
* Wraps the existing POST /forgot-password endpoint.
|
|
1008
|
+
*/
|
|
1009
|
+
sendResetLink: (email) => this.request(`/api/collections/${slug}/forgot-password`, {
|
|
1010
|
+
method: "POST",
|
|
1011
|
+
body: JSON.stringify({ email })
|
|
996
1012
|
})
|
|
997
1013
|
};
|
|
998
1014
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/sdk",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"tsup": "^8.5.1",
|
|
24
24
|
"typescript": "^5.4.5",
|
|
25
25
|
"vitest": "^1.0.0",
|
|
26
|
-
"@dyrected/core": "2.5.
|
|
26
|
+
"@dyrected/core": "2.5.13"
|
|
27
27
|
},
|
|
28
28
|
"license": "BSL-1.1",
|
|
29
29
|
"author": "Busola Okeowo <busolaokemoney@gmail.com>",
|