@djangocfg/api 2.1.227 → 2.1.229
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 +8 -9
- package/dist/auth-server.cjs +4 -9
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +4 -9
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +120 -158
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +120 -177
- package/dist/auth.d.ts +120 -177
- package/dist/auth.mjs +149 -191
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +5 -11
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +253 -254
- package/dist/clients.d.ts +253 -254
- package/dist/clients.mjs +5 -11
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +4 -9
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +64 -85
- package/dist/hooks.d.ts +64 -85
- package/dist/hooks.mjs +4 -9
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +5 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -99
- package/dist/index.d.ts +109 -99
- package/dist/index.mjs +5 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts +24 -2
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +0 -2
- package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +0 -2
- package/src/_api/generated/cfg_accounts/accounts/client.ts +1 -1
- package/src/_api/generated/cfg_accounts/accounts/models.ts +37 -38
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +36 -36
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +15 -15
- package/src/_api/generated/cfg_accounts/enums.ts +0 -10
- package/src/_api/generated/cfg_accounts/schema.json +31 -25
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +74 -74
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +36 -36
- package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +22 -22
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +22 -22
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
- package/src/auth/context/AccountsContext.tsx +6 -2
- package/src/auth/context/AuthContext.tsx +32 -39
- package/src/auth/context/types.ts +5 -9
- package/src/auth/hooks/index.ts +1 -1
- package/src/auth/hooks/useAuthForm.ts +42 -75
- package/src/auth/hooks/useAuthFormState.ts +35 -6
- package/src/auth/hooks/useAuthValidation.ts +5 -65
- package/src/auth/hooks/useTwoFactor.ts +17 -2
- package/src/auth/types/form.ts +25 -70
- package/src/auth/types/index.ts +2 -6
package/dist/index.mjs
CHANGED
|
@@ -252,7 +252,7 @@ var Accounts = class {
|
|
|
252
252
|
this.client = client;
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
|
-
* Request OTP code to email
|
|
255
|
+
* Request OTP code to email.
|
|
256
256
|
*/
|
|
257
257
|
async otpRequestCreate(data) {
|
|
258
258
|
const response = await this.client.request("POST", "/cfg/accounts/otp/request/", { body: data });
|
|
@@ -985,18 +985,12 @@ var MemoryStorageAdapter = class {
|
|
|
985
985
|
// src/_api/generated/cfg_accounts/enums.ts
|
|
986
986
|
var enums_exports = {};
|
|
987
987
|
__export(enums_exports, {
|
|
988
|
-
OAuthConnectionProvider: () => OAuthConnectionProvider
|
|
989
|
-
OTPRequestRequestChannel: () => OTPRequestRequestChannel
|
|
988
|
+
OAuthConnectionProvider: () => OAuthConnectionProvider
|
|
990
989
|
});
|
|
991
990
|
var OAuthConnectionProvider = /* @__PURE__ */ ((OAuthConnectionProvider2) => {
|
|
992
991
|
OAuthConnectionProvider2["GITHUB"] = "github";
|
|
993
992
|
return OAuthConnectionProvider2;
|
|
994
993
|
})(OAuthConnectionProvider || {});
|
|
995
|
-
var OTPRequestRequestChannel = /* @__PURE__ */ ((OTPRequestRequestChannel2) => {
|
|
996
|
-
OTPRequestRequestChannel2["EMAIL"] = "email";
|
|
997
|
-
OTPRequestRequestChannel2["PHONE"] = "phone";
|
|
998
|
-
return OTPRequestRequestChannel2;
|
|
999
|
-
})(OTPRequestRequestChannel || {});
|
|
1000
994
|
|
|
1001
995
|
// src/_api/generated/cfg_accounts/_utils/schemas/index.ts
|
|
1002
996
|
var schemas_exports = {};
|
|
@@ -1116,14 +1110,15 @@ var OAuthTokenResponseSchema = z11.object({
|
|
|
1116
1110
|
// src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
|
|
1117
1111
|
import { z as z12 } from "zod";
|
|
1118
1112
|
var OTPErrorResponseSchema = z12.object({
|
|
1119
|
-
error: z12.string()
|
|
1113
|
+
error: z12.string(),
|
|
1114
|
+
error_code: z12.string().nullable().optional(),
|
|
1115
|
+
retry_after: z12.number().int().nullable().optional()
|
|
1120
1116
|
});
|
|
1121
1117
|
|
|
1122
1118
|
// src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
|
|
1123
1119
|
import { z as z13 } from "zod";
|
|
1124
1120
|
var OTPRequestRequestSchema = z13.object({
|
|
1125
1121
|
identifier: z13.string().min(1),
|
|
1126
|
-
channel: z13.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
1127
1122
|
source_url: z13.string().optional()
|
|
1128
1123
|
});
|
|
1129
1124
|
|
|
@@ -1138,7 +1133,6 @@ import { z as z15 } from "zod";
|
|
|
1138
1133
|
var OTPVerifyRequestSchema = z15.object({
|
|
1139
1134
|
identifier: z15.string().min(1),
|
|
1140
1135
|
otp: z15.string().min(6).max(6),
|
|
1141
|
-
channel: z15.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
1142
1136
|
source_url: z15.string().optional()
|
|
1143
1137
|
});
|
|
1144
1138
|
|