@djangocfg/api 2.1.103 → 2.1.105
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 +3348 -3218
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +77 -1
- package/dist/auth.d.ts +77 -1
- package/dist/auth.mjs +3295 -3165
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +95 -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 +95 -64
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs +1 -0
- package/dist/hooks.mjs.map +1 -1
- package/package.json +2 -3
- package/src/auth/context/AuthContext.tsx +1 -1
- package/src/auth/hooks/index.ts +4 -0
- package/src/auth/hooks/useAuthGuard.ts +1 -1
- package/src/auth/hooks/useAutoAuth.ts +2 -1
- package/src/auth/hooks/useCfgRouter.ts +153 -0
- package/src/auth/hooks/useGithubAuth.ts +1 -1
- package/src/auth/hooks/useQueryParams.ts +73 -0
- package/src/auth/hooks/useTwoFactor.ts +1 -1
- 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/clients.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
4
|
var __export = (target, all) => {
|
|
@@ -4512,11 +4513,13 @@ __export(schemas_exports3, {
|
|
|
4512
4513
|
BackupCodesStatusSchema: () => BackupCodesStatusSchema,
|
|
4513
4514
|
ConfirmSetupRequestSchema: () => ConfirmSetupRequestSchema,
|
|
4514
4515
|
ConfirmSetupResponseSchema: () => ConfirmSetupResponseSchema,
|
|
4516
|
+
DeviceListResponseSchema: () => DeviceListResponseSchema,
|
|
4515
4517
|
DeviceListSchema: () => DeviceListSchema,
|
|
4516
4518
|
DisableRequestSchema: () => DisableRequestSchema,
|
|
4517
|
-
|
|
4519
|
+
PaginatedDeviceListResponseListSchema: () => PaginatedDeviceListResponseListSchema,
|
|
4518
4520
|
SetupRequestSchema: () => SetupRequestSchema,
|
|
4519
4521
|
SetupResponseSchema: () => SetupResponseSchema,
|
|
4522
|
+
TotpVerifyUserSchema: () => TotpVerifyUserSchema,
|
|
4520
4523
|
VerifyBackupRequestSchema: () => VerifyBackupRequestSchema,
|
|
4521
4524
|
VerifyRequestSchema: () => VerifyRequestSchema,
|
|
4522
4525
|
VerifyResponseSchema: () => VerifyResponseSchema
|
|
@@ -4570,65 +4573,93 @@ var DeviceListSchema = z62.object({
|
|
|
4570
4573
|
last_used_at: z62.iso.datetime().nullable()
|
|
4571
4574
|
});
|
|
4572
4575
|
|
|
4573
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4576
|
+
// src/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts
|
|
4574
4577
|
import { z as z63 } from "zod";
|
|
4575
|
-
var
|
|
4576
|
-
|
|
4578
|
+
var DeviceListResponseSchema = z63.object({
|
|
4579
|
+
devices: z63.array(DeviceListSchema),
|
|
4580
|
+
has_2fa_enabled: z63.boolean()
|
|
4577
4581
|
});
|
|
4578
4582
|
|
|
4579
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4583
|
+
// src/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts
|
|
4580
4584
|
import { z as z64 } from "zod";
|
|
4581
|
-
var
|
|
4582
|
-
|
|
4583
|
-
page: z64.int(),
|
|
4584
|
-
pages: z64.int(),
|
|
4585
|
-
page_size: z64.int(),
|
|
4586
|
-
has_next: z64.boolean(),
|
|
4587
|
-
has_previous: z64.boolean(),
|
|
4588
|
-
next_page: z64.int().nullable().optional(),
|
|
4589
|
-
previous_page: z64.int().nullable().optional(),
|
|
4590
|
-
results: z64.array(DeviceListSchema)
|
|
4585
|
+
var DisableRequestSchema = z64.object({
|
|
4586
|
+
code: z64.string().min(6).max(6)
|
|
4591
4587
|
});
|
|
4592
4588
|
|
|
4593
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4589
|
+
// src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts
|
|
4594
4590
|
import { z as z65 } from "zod";
|
|
4595
|
-
var
|
|
4596
|
-
|
|
4591
|
+
var PaginatedDeviceListResponseListSchema = z65.object({
|
|
4592
|
+
count: z65.int(),
|
|
4593
|
+
page: z65.int(),
|
|
4594
|
+
pages: z65.int(),
|
|
4595
|
+
page_size: z65.int(),
|
|
4596
|
+
has_next: z65.boolean(),
|
|
4597
|
+
has_previous: z65.boolean(),
|
|
4598
|
+
next_page: z65.int().nullable().optional(),
|
|
4599
|
+
previous_page: z65.int().nullable().optional(),
|
|
4600
|
+
results: z65.array(DeviceListResponseSchema)
|
|
4597
4601
|
});
|
|
4598
4602
|
|
|
4599
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4603
|
+
// src/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
|
|
4600
4604
|
import { z as z66 } from "zod";
|
|
4601
|
-
var
|
|
4602
|
-
|
|
4603
|
-
secret: z66.string(),
|
|
4604
|
-
provisioning_uri: z66.string(),
|
|
4605
|
-
qr_code_base64: z66.string(),
|
|
4606
|
-
expires_in: z66.int()
|
|
4605
|
+
var SetupRequestSchema = z66.object({
|
|
4606
|
+
device_name: z66.string().min(1).max(100).optional()
|
|
4607
4607
|
});
|
|
4608
4608
|
|
|
4609
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4609
|
+
// src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
|
|
4610
4610
|
import { z as z67 } from "zod";
|
|
4611
|
-
var
|
|
4612
|
-
|
|
4613
|
-
|
|
4611
|
+
var SetupResponseSchema = z67.object({
|
|
4612
|
+
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),
|
|
4613
|
+
secret: z67.string(),
|
|
4614
|
+
provisioning_uri: z67.string(),
|
|
4615
|
+
qr_code_base64: z67.string(),
|
|
4616
|
+
expires_in: z67.int()
|
|
4614
4617
|
});
|
|
4615
4618
|
|
|
4616
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4619
|
+
// src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts
|
|
4617
4620
|
import { z as z68 } from "zod";
|
|
4618
|
-
var
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
+
var TotpVerifyUserSchema = z68.object({
|
|
4622
|
+
id: z68.int(),
|
|
4623
|
+
email: z68.email(),
|
|
4624
|
+
first_name: z68.string().max(50).optional(),
|
|
4625
|
+
last_name: z68.string().max(50).optional(),
|
|
4626
|
+
full_name: z68.string(),
|
|
4627
|
+
initials: z68.string(),
|
|
4628
|
+
display_username: z68.string(),
|
|
4629
|
+
company: z68.string().max(100).optional(),
|
|
4630
|
+
phone: z68.string().max(20).optional(),
|
|
4631
|
+
position: z68.string().max(100).optional(),
|
|
4632
|
+
avatar: z68.union([z68.url(), z68.literal("")]).nullable(),
|
|
4633
|
+
is_staff: z68.boolean(),
|
|
4634
|
+
is_superuser: z68.boolean(),
|
|
4635
|
+
date_joined: z68.iso.datetime(),
|
|
4636
|
+
last_login: z68.iso.datetime().nullable(),
|
|
4637
|
+
unanswered_messages_count: z68.int()
|
|
4621
4638
|
});
|
|
4622
4639
|
|
|
4623
|
-
// src/generated/cfg_totp/_utils/schemas/
|
|
4640
|
+
// src/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
|
|
4624
4641
|
import { z as z69 } from "zod";
|
|
4625
|
-
var
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4642
|
+
var VerifyBackupRequestSchema = z69.object({
|
|
4643
|
+
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),
|
|
4644
|
+
backup_code: z69.string().min(8).max(8)
|
|
4645
|
+
});
|
|
4646
|
+
|
|
4647
|
+
// src/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
|
|
4648
|
+
import { z as z70 } from "zod";
|
|
4649
|
+
var VerifyRequestSchema = z70.object({
|
|
4650
|
+
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),
|
|
4651
|
+
code: z70.string().min(6).max(6)
|
|
4652
|
+
});
|
|
4653
|
+
|
|
4654
|
+
// src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts
|
|
4655
|
+
import { z as z71 } from "zod";
|
|
4656
|
+
var VerifyResponseSchema = z71.object({
|
|
4657
|
+
message: z71.string(),
|
|
4658
|
+
access_token: z71.string(),
|
|
4659
|
+
refresh_token: z71.string(),
|
|
4660
|
+
user: TotpVerifyUserSchema,
|
|
4661
|
+
remaining_backup_codes: z71.int().optional(),
|
|
4662
|
+
warning: z71.string().optional()
|
|
4632
4663
|
});
|
|
4633
4664
|
|
|
4634
4665
|
// src/generated/cfg_totp/_utils/fetchers/index.ts
|
|
@@ -4773,7 +4804,7 @@ async function getTotpDevicesList(params, client) {
|
|
|
4773
4804
|
const api = client || getAPIInstance3();
|
|
4774
4805
|
const response = await api.totp_management.totpDevicesList(params?.page, params?.page_size);
|
|
4775
4806
|
try {
|
|
4776
|
-
return
|
|
4807
|
+
return PaginatedDeviceListResponseListSchema.parse(response);
|
|
4777
4808
|
} catch (error) {
|
|
4778
4809
|
consola10.error("\u274C Zod Validation Failed");
|
|
4779
4810
|
consola10.box(`getTotpDevicesList
|
|
@@ -5796,40 +5827,40 @@ __export(schemas_exports4, {
|
|
|
5796
5827
|
});
|
|
5797
5828
|
|
|
5798
5829
|
// src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
|
|
5799
|
-
import { z as
|
|
5800
|
-
var SendPushRequestRequestSchema =
|
|
5801
|
-
title:
|
|
5802
|
-
body:
|
|
5803
|
-
icon:
|
|
5804
|
-
url:
|
|
5830
|
+
import { z as z72 } from "zod";
|
|
5831
|
+
var SendPushRequestRequestSchema = z72.object({
|
|
5832
|
+
title: z72.string().min(1).max(255),
|
|
5833
|
+
body: z72.string().min(1),
|
|
5834
|
+
icon: z72.union([z72.url(), z72.literal("")]).nullable().optional(),
|
|
5835
|
+
url: z72.union([z72.url(), z72.literal("")]).nullable().optional()
|
|
5805
5836
|
});
|
|
5806
5837
|
|
|
5807
5838
|
// src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
|
|
5808
|
-
import { z as
|
|
5809
|
-
var SendPushResponseSchema =
|
|
5810
|
-
success:
|
|
5811
|
-
sent_to:
|
|
5839
|
+
import { z as z73 } from "zod";
|
|
5840
|
+
var SendPushResponseSchema = z73.object({
|
|
5841
|
+
success: z73.boolean(),
|
|
5842
|
+
sent_to: z73.int()
|
|
5812
5843
|
});
|
|
5813
5844
|
|
|
5814
5845
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
|
|
5815
|
-
import { z as
|
|
5816
|
-
var SubscribeRequestRequestSchema =
|
|
5817
|
-
endpoint:
|
|
5818
|
-
keys:
|
|
5846
|
+
import { z as z74 } from "zod";
|
|
5847
|
+
var SubscribeRequestRequestSchema = z74.object({
|
|
5848
|
+
endpoint: z74.union([z74.url(), z74.literal("")]),
|
|
5849
|
+
keys: z74.record(z74.string(), z74.string().min(1))
|
|
5819
5850
|
});
|
|
5820
5851
|
|
|
5821
5852
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
|
|
5822
|
-
import { z as
|
|
5823
|
-
var SubscribeResponseSchema =
|
|
5824
|
-
success:
|
|
5825
|
-
subscription_id:
|
|
5826
|
-
created:
|
|
5853
|
+
import { z as z75 } from "zod";
|
|
5854
|
+
var SubscribeResponseSchema = z75.object({
|
|
5855
|
+
success: z75.boolean(),
|
|
5856
|
+
subscription_id: z75.int(),
|
|
5857
|
+
created: z75.boolean()
|
|
5827
5858
|
});
|
|
5828
5859
|
|
|
5829
5860
|
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
5830
|
-
import { z as
|
|
5831
|
-
var VapidPublicKeyResponseSchema =
|
|
5832
|
-
publicKey:
|
|
5861
|
+
import { z as z76 } from "zod";
|
|
5862
|
+
var VapidPublicKeyResponseSchema = z76.object({
|
|
5863
|
+
publicKey: z76.string()
|
|
5833
5864
|
});
|
|
5834
5865
|
|
|
5835
5866
|
// src/generated/cfg_webpush/_utils/fetchers/index.ts
|