@djangocfg/api 2.1.104 → 2.1.106
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/auth.cjs +92 -63
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +92 -63
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +94 -64
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +134 -21
- package/dist/clients.d.ts +134 -21
- package/dist/clients.mjs +94 -64
- package/dist/clients.mjs.map +1 -1
- package/package.json +2 -2
- package/src/auth/hooks/useTwoFactorStatus.ts +5 -1
- package/src/generated/cfg_totp/CLAUDE.md +1 -1
- package/src/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +3 -3
- package/src/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +3 -3
- package/src/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts +21 -0
- package/src/generated/cfg_totp/_utils/schemas/{PaginatedDeviceListList.schema.ts → PaginatedDeviceListResponseList.schema.ts} +5 -5
- package/src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts +34 -0
- package/src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +2 -1
- package/src/generated/cfg_totp/_utils/schemas/index.ts +3 -1
- package/src/generated/cfg_totp/schema.json +124 -5
- package/src/generated/cfg_totp/totp__totp_management/client.ts +3 -3
- package/src/generated/cfg_totp/totp__totp_management/models.ts +12 -2
- package/src/generated/cfg_totp/totp__totp_verification/models.ts +30 -2
package/dist/auth.mjs
CHANGED
|
@@ -3841,65 +3841,93 @@ var DeviceListSchema = z62.object({
|
|
|
3841
3841
|
last_used_at: z62.iso.datetime().nullable()
|
|
3842
3842
|
});
|
|
3843
3843
|
|
|
3844
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3844
|
+
// src/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts
|
|
3845
3845
|
import { z as z63 } from "zod";
|
|
3846
|
-
var
|
|
3847
|
-
|
|
3846
|
+
var DeviceListResponseSchema = z63.object({
|
|
3847
|
+
devices: z63.array(DeviceListSchema),
|
|
3848
|
+
has_2fa_enabled: z63.boolean()
|
|
3848
3849
|
});
|
|
3849
3850
|
|
|
3850
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3851
|
+
// src/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts
|
|
3851
3852
|
import { z as z64 } from "zod";
|
|
3852
|
-
var
|
|
3853
|
-
|
|
3854
|
-
page: z64.int(),
|
|
3855
|
-
pages: z64.int(),
|
|
3856
|
-
page_size: z64.int(),
|
|
3857
|
-
has_next: z64.boolean(),
|
|
3858
|
-
has_previous: z64.boolean(),
|
|
3859
|
-
next_page: z64.int().nullable().optional(),
|
|
3860
|
-
previous_page: z64.int().nullable().optional(),
|
|
3861
|
-
results: z64.array(DeviceListSchema)
|
|
3853
|
+
var DisableRequestSchema = z64.object({
|
|
3854
|
+
code: z64.string().min(6).max(6)
|
|
3862
3855
|
});
|
|
3863
3856
|
|
|
3864
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3857
|
+
// src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts
|
|
3865
3858
|
import { z as z65 } from "zod";
|
|
3866
|
-
var
|
|
3867
|
-
|
|
3859
|
+
var PaginatedDeviceListResponseListSchema = z65.object({
|
|
3860
|
+
count: z65.int(),
|
|
3861
|
+
page: z65.int(),
|
|
3862
|
+
pages: z65.int(),
|
|
3863
|
+
page_size: z65.int(),
|
|
3864
|
+
has_next: z65.boolean(),
|
|
3865
|
+
has_previous: z65.boolean(),
|
|
3866
|
+
next_page: z65.int().nullable().optional(),
|
|
3867
|
+
previous_page: z65.int().nullable().optional(),
|
|
3868
|
+
results: z65.array(DeviceListResponseSchema)
|
|
3868
3869
|
});
|
|
3869
3870
|
|
|
3870
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3871
|
+
// src/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
|
|
3871
3872
|
import { z as z66 } from "zod";
|
|
3872
|
-
var
|
|
3873
|
-
|
|
3874
|
-
secret: z66.string(),
|
|
3875
|
-
provisioning_uri: z66.string(),
|
|
3876
|
-
qr_code_base64: z66.string(),
|
|
3877
|
-
expires_in: z66.int()
|
|
3873
|
+
var SetupRequestSchema = z66.object({
|
|
3874
|
+
device_name: z66.string().min(1).max(100).optional()
|
|
3878
3875
|
});
|
|
3879
3876
|
|
|
3880
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3877
|
+
// src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
|
|
3881
3878
|
import { z as z67 } from "zod";
|
|
3882
|
-
var
|
|
3883
|
-
|
|
3884
|
-
|
|
3879
|
+
var SetupResponseSchema = z67.object({
|
|
3880
|
+
device_id: z67.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
3881
|
+
secret: z67.string(),
|
|
3882
|
+
provisioning_uri: z67.string(),
|
|
3883
|
+
qr_code_base64: z67.string(),
|
|
3884
|
+
expires_in: z67.int()
|
|
3885
3885
|
});
|
|
3886
3886
|
|
|
3887
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3887
|
+
// src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts
|
|
3888
3888
|
import { z as z68 } from "zod";
|
|
3889
|
-
var
|
|
3890
|
-
|
|
3891
|
-
|
|
3889
|
+
var TotpVerifyUserSchema = z68.object({
|
|
3890
|
+
id: z68.int(),
|
|
3891
|
+
email: z68.email(),
|
|
3892
|
+
first_name: z68.string().max(50).optional(),
|
|
3893
|
+
last_name: z68.string().max(50).optional(),
|
|
3894
|
+
full_name: z68.string(),
|
|
3895
|
+
initials: z68.string(),
|
|
3896
|
+
display_username: z68.string(),
|
|
3897
|
+
company: z68.string().max(100).optional(),
|
|
3898
|
+
phone: z68.string().max(20).optional(),
|
|
3899
|
+
position: z68.string().max(100).optional(),
|
|
3900
|
+
avatar: z68.union([z68.url(), z68.literal("")]).nullable(),
|
|
3901
|
+
is_staff: z68.boolean(),
|
|
3902
|
+
is_superuser: z68.boolean(),
|
|
3903
|
+
date_joined: z68.iso.datetime(),
|
|
3904
|
+
last_login: z68.iso.datetime().nullable(),
|
|
3905
|
+
unanswered_messages_count: z68.int()
|
|
3892
3906
|
});
|
|
3893
3907
|
|
|
3894
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
3908
|
+
// src/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
|
|
3895
3909
|
import { z as z69 } from "zod";
|
|
3896
|
-
var
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3910
|
+
var VerifyBackupRequestSchema = z69.object({
|
|
3911
|
+
session_id: z69.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
3912
|
+
backup_code: z69.string().min(8).max(8)
|
|
3913
|
+
});
|
|
3914
|
+
|
|
3915
|
+
// src/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
|
|
3916
|
+
import { z as z70 } from "zod";
|
|
3917
|
+
var VerifyRequestSchema = z70.object({
|
|
3918
|
+
session_id: z70.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
3919
|
+
code: z70.string().min(6).max(6)
|
|
3920
|
+
});
|
|
3921
|
+
|
|
3922
|
+
// src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts
|
|
3923
|
+
import { z as z71 } from "zod";
|
|
3924
|
+
var VerifyResponseSchema = z71.object({
|
|
3925
|
+
message: z71.string(),
|
|
3926
|
+
access_token: z71.string(),
|
|
3927
|
+
refresh_token: z71.string(),
|
|
3928
|
+
user: TotpVerifyUserSchema,
|
|
3929
|
+
remaining_backup_codes: z71.int().optional(),
|
|
3930
|
+
warning: z71.string().optional()
|
|
3903
3931
|
});
|
|
3904
3932
|
|
|
3905
3933
|
// src/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts
|
|
@@ -4703,40 +4731,40 @@ var LocalStorageAdapter4 = class {
|
|
|
4703
4731
|
};
|
|
4704
4732
|
|
|
4705
4733
|
// src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
|
|
4706
|
-
import { z as
|
|
4707
|
-
var SendPushRequestRequestSchema =
|
|
4708
|
-
title:
|
|
4709
|
-
body:
|
|
4710
|
-
icon:
|
|
4711
|
-
url:
|
|
4734
|
+
import { z as z72 } from "zod";
|
|
4735
|
+
var SendPushRequestRequestSchema = z72.object({
|
|
4736
|
+
title: z72.string().min(1).max(255),
|
|
4737
|
+
body: z72.string().min(1),
|
|
4738
|
+
icon: z72.union([z72.url(), z72.literal("")]).nullable().optional(),
|
|
4739
|
+
url: z72.union([z72.url(), z72.literal("")]).nullable().optional()
|
|
4712
4740
|
});
|
|
4713
4741
|
|
|
4714
4742
|
// src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
|
|
4715
|
-
import { z as
|
|
4716
|
-
var SendPushResponseSchema =
|
|
4717
|
-
success:
|
|
4718
|
-
sent_to:
|
|
4743
|
+
import { z as z73 } from "zod";
|
|
4744
|
+
var SendPushResponseSchema = z73.object({
|
|
4745
|
+
success: z73.boolean(),
|
|
4746
|
+
sent_to: z73.int()
|
|
4719
4747
|
});
|
|
4720
4748
|
|
|
4721
4749
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
|
|
4722
|
-
import { z as
|
|
4723
|
-
var SubscribeRequestRequestSchema =
|
|
4724
|
-
endpoint:
|
|
4725
|
-
keys:
|
|
4750
|
+
import { z as z74 } from "zod";
|
|
4751
|
+
var SubscribeRequestRequestSchema = z74.object({
|
|
4752
|
+
endpoint: z74.union([z74.url(), z74.literal("")]),
|
|
4753
|
+
keys: z74.record(z74.string(), z74.string().min(1))
|
|
4726
4754
|
});
|
|
4727
4755
|
|
|
4728
4756
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
|
|
4729
|
-
import { z as
|
|
4730
|
-
var SubscribeResponseSchema =
|
|
4731
|
-
success:
|
|
4732
|
-
subscription_id:
|
|
4733
|
-
created:
|
|
4757
|
+
import { z as z75 } from "zod";
|
|
4758
|
+
var SubscribeResponseSchema = z75.object({
|
|
4759
|
+
success: z75.boolean(),
|
|
4760
|
+
subscription_id: z75.int(),
|
|
4761
|
+
created: z75.boolean()
|
|
4734
4762
|
});
|
|
4735
4763
|
|
|
4736
4764
|
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
4737
|
-
import { z as
|
|
4738
|
-
var VapidPublicKeyResponseSchema =
|
|
4739
|
-
publicKey:
|
|
4765
|
+
import { z as z76 } from "zod";
|
|
4766
|
+
var VapidPublicKeyResponseSchema = z76.object({
|
|
4767
|
+
publicKey: z76.string()
|
|
4740
4768
|
});
|
|
4741
4769
|
|
|
4742
4770
|
// src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
|
|
@@ -5670,7 +5698,8 @@ var useTwoFactorStatus = /* @__PURE__ */ __name(() => {
|
|
|
5670
5698
|
try {
|
|
5671
5699
|
authLogger.info("Fetching 2FA status...");
|
|
5672
5700
|
const response = await apiTotp.totp_management.totpDevicesList();
|
|
5673
|
-
const
|
|
5701
|
+
const devices2 = response.results.flatMap((device) => device.devices);
|
|
5702
|
+
const mappedDevices = devices2.map((device) => ({
|
|
5674
5703
|
id: device.id,
|
|
5675
5704
|
name: device.name,
|
|
5676
5705
|
createdAt: device.created_at,
|