@sylphx/sdk 0.10.3 → 0.10.4
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/README.md +6 -0
- package/dist/index.d.ts +39 -12
- package/dist/index.mjs +96 -20
- package/dist/index.mjs.map +1 -1
- package/dist/nextjs/index.d.ts +62 -1
- package/dist/nextjs/index.mjs +220 -24
- package/dist/nextjs/index.mjs.map +1 -1
- package/dist/react/index.d.ts +6 -1
- package/dist/react/index.mjs +24 -4
- package/dist/react/index.mjs.map +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.mjs.map +1 -1
- package/package.json +21 -2
package/dist/react/index.d.ts
CHANGED
|
@@ -3440,6 +3440,7 @@ interface SignUpFormState {
|
|
|
3440
3440
|
email: string;
|
|
3441
3441
|
password: string;
|
|
3442
3442
|
inviteCode: string;
|
|
3443
|
+
captchaToken: string;
|
|
3443
3444
|
verificationCode: string;
|
|
3444
3445
|
[key: string]: string;
|
|
3445
3446
|
}
|
|
@@ -4150,7 +4151,11 @@ interface SdkRegisterResult {
|
|
|
4150
4151
|
interface SdkAuthContextValue {
|
|
4151
4152
|
login: (email: string, password: string) => Promise<SdkLoginResult>;
|
|
4152
4153
|
verifyTwoFactor: (userId: string, code: string) => Promise<SdkVerify2FAResult>;
|
|
4153
|
-
register: (name: string, email: string, password: string
|
|
4154
|
+
register: (name: string, email: string, password: string, options?: {
|
|
4155
|
+
captchaToken?: string;
|
|
4156
|
+
invitationToken?: string;
|
|
4157
|
+
metadata?: Record<string, unknown>;
|
|
4158
|
+
}) => Promise<SdkRegisterResult>;
|
|
4154
4159
|
forgotPassword: (email: string) => Promise<{
|
|
4155
4160
|
success: boolean;
|
|
4156
4161
|
message: string;
|
package/dist/react/index.mjs
CHANGED
|
@@ -7433,7 +7433,8 @@ function useSignUpForm(options = {}) {
|
|
|
7433
7433
|
email: "",
|
|
7434
7434
|
password: "",
|
|
7435
7435
|
inviteCode: initialInviteCode,
|
|
7436
|
-
verificationCode: ""
|
|
7436
|
+
verificationCode: "",
|
|
7437
|
+
captchaToken: ""
|
|
7437
7438
|
});
|
|
7438
7439
|
const [inviteInfo, setInviteInfo] = useState16(null);
|
|
7439
7440
|
const [isVerifyingInvite, setIsVerifyingInvite] = useState16(!!initialInviteCode);
|
|
@@ -7498,6 +7499,7 @@ function useSignUpForm(options = {}) {
|
|
|
7498
7499
|
email: "",
|
|
7499
7500
|
password: "",
|
|
7500
7501
|
inviteCode: initialInviteCode,
|
|
7502
|
+
captchaToken: "",
|
|
7501
7503
|
verificationCode: ""
|
|
7502
7504
|
});
|
|
7503
7505
|
setError(null);
|
|
@@ -7528,7 +7530,10 @@ function useSignUpForm(options = {}) {
|
|
|
7528
7530
|
setError("SDK not configured. Please wrap your app with SylphxProvider.");
|
|
7529
7531
|
return;
|
|
7530
7532
|
}
|
|
7531
|
-
const registerResult = await authContext.register(form.name, form.email, form.password
|
|
7533
|
+
const registerResult = await authContext.register(form.name, form.email, form.password, {
|
|
7534
|
+
invitationToken: form.inviteCode || void 0,
|
|
7535
|
+
captchaToken: form.captchaToken || void 0
|
|
7536
|
+
});
|
|
7532
7537
|
result = {
|
|
7533
7538
|
requiresVerification: registerResult.requiresVerification
|
|
7534
7539
|
};
|
|
@@ -14082,8 +14087,15 @@ function SylphxProviderInner({
|
|
|
14082
14087
|
}
|
|
14083
14088
|
};
|
|
14084
14089
|
},
|
|
14085
|
-
register: async (name, email, password) => {
|
|
14086
|
-
const result = await api.post("/auth/register", {
|
|
14090
|
+
register: async (name, email, password, options) => {
|
|
14091
|
+
const result = await api.post("/auth/register", {
|
|
14092
|
+
email,
|
|
14093
|
+
password,
|
|
14094
|
+
name,
|
|
14095
|
+
captchaToken: options?.captchaToken,
|
|
14096
|
+
invitationToken: options?.invitationToken,
|
|
14097
|
+
metadata: options?.metadata
|
|
14098
|
+
});
|
|
14087
14099
|
return {
|
|
14088
14100
|
requiresVerification: true,
|
|
14089
14101
|
message: "Please check your email to verify your account",
|
|
@@ -14823,6 +14835,7 @@ var PATHS = {
|
|
|
14823
14835
|
uploadPart: (id, n2) => `/storage/uploads/${encodeURIComponent(String(id))}/parts/${n2}`,
|
|
14824
14836
|
files: "/storage/files",
|
|
14825
14837
|
file: (id) => `/storage/files/${encodeURIComponent(String(id))}`,
|
|
14838
|
+
fileTakedown: (id) => `/storage/files/${encodeURIComponent(String(id))}:takedown`,
|
|
14826
14839
|
fileRestore: (id) => `/storage/files/${encodeURIComponent(String(id))}:restore`,
|
|
14827
14840
|
fileSignedUrl: (id) => `/storage/files/${encodeURIComponent(String(id))}:signedUrl`,
|
|
14828
14841
|
fileCopy: (id) => `/storage/files/${encodeURIComponent(String(id))}:copy`,
|
|
@@ -15147,6 +15160,12 @@ async function filesGet(config2, fileId) {
|
|
|
15147
15160
|
async function filesDelete(config2, fileId) {
|
|
15148
15161
|
return callApi(config2, PATHS.file(fileId), { method: "DELETE" });
|
|
15149
15162
|
}
|
|
15163
|
+
async function filesTakedown(config2, fileId, options) {
|
|
15164
|
+
return callApi(config2, PATHS.fileTakedown(fileId), {
|
|
15165
|
+
method: "POST",
|
|
15166
|
+
body: options
|
|
15167
|
+
});
|
|
15168
|
+
}
|
|
15150
15169
|
async function filesRestore(config2, fileId) {
|
|
15151
15170
|
return callApi(config2, PATHS.fileRestore(fileId), { method: "POST" });
|
|
15152
15171
|
}
|
|
@@ -15191,6 +15210,7 @@ var storage = {
|
|
|
15191
15210
|
list: filesList,
|
|
15192
15211
|
get: filesGet,
|
|
15193
15212
|
delete: filesDelete,
|
|
15213
|
+
takedown: filesTakedown,
|
|
15194
15214
|
restore: filesRestore,
|
|
15195
15215
|
signedUrl: filesSignedUrl,
|
|
15196
15216
|
copy: filesCopy,
|