@djangocfg/api 2.1.263 → 2.1.264

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.
Files changed (31) hide show
  1. package/dist/auth.cjs +49 -72
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.mjs +49 -72
  4. package/dist/auth.mjs.map +1 -1
  5. package/dist/clients.cjs +57 -79
  6. package/dist/clients.cjs.map +1 -1
  7. package/dist/clients.d.cts +113 -179
  8. package/dist/clients.d.ts +113 -179
  9. package/dist/clients.mjs +57 -79
  10. package/dist/clients.mjs.map +1 -1
  11. package/dist/hooks.d.cts +72 -72
  12. package/dist/hooks.d.ts +72 -72
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +97 -97
  15. package/dist/index.d.ts +97 -97
  16. package/dist/index.mjs.map +1 -1
  17. package/package.json +2 -2
  18. package/src/_api/generated/cfg_accounts/accounts/models.ts +31 -31
  19. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +40 -40
  20. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +31 -31
  21. package/src/_api/generated/cfg_totp/CLAUDE.md +3 -3
  22. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +7 -7
  23. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +5 -5
  24. package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -1
  25. package/src/_api/generated/cfg_totp/schema.json +2 -103
  26. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
  27. package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +2 -13
  28. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +4 -29
  29. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +13 -13
  30. package/src/auth/hooks/useTwoFactorStatus.ts +5 -11
  31. package/src/_api/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts +0 -24
package/dist/clients.cjs CHANGED
@@ -2863,15 +2863,8 @@ var TotpManagement = class {
2863
2863
  /**
2864
2864
  * List all TOTP devices for user.
2865
2865
  */
2866
- async totpDevicesList(...args) {
2867
- const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
2868
- let params;
2869
- if (isParamsObject) {
2870
- params = args[0];
2871
- } else {
2872
- params = { ordering: args[0], page: args[1], page_size: args[2], search: args[3] };
2873
- }
2874
- const response = await this.client.request("GET", "/cfg/totp/devices/", { params });
2866
+ async totpDevicesRetrieve() {
2867
+ const response = await this.client.request("GET", "/cfg/totp/devices/");
2875
2868
  return response;
2876
2869
  }
2877
2870
  /**
@@ -3608,7 +3601,6 @@ __export(schemas_exports3, {
3608
3601
  DeviceListResponseSchema: () => DeviceListResponseSchema,
3609
3602
  DeviceListSchema: () => DeviceListSchema,
3610
3603
  DisableRequestSchema: () => DisableRequestSchema,
3611
- PaginatedDeviceListResponseListSchema: () => PaginatedDeviceListResponseListSchema,
3612
3604
  SetupRequestSchema: () => SetupRequestSchema,
3613
3605
  SetupResponseSchema: () => SetupResponseSchema,
3614
3606
  TotpVerifyUserSchema: () => TotpVerifyUserSchema,
@@ -3678,81 +3670,67 @@ var DisableRequestSchema = import_zod30.z.object({
3678
3670
  code: import_zod30.z.string().min(6).max(6)
3679
3671
  });
3680
3672
 
3681
- // src/_api/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts
3673
+ // src/_api/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
3682
3674
  var import_zod31 = require("zod");
3683
- var PaginatedDeviceListResponseListSchema = import_zod31.z.object({
3684
- count: import_zod31.z.number().int(),
3685
- page: import_zod31.z.number().int(),
3686
- pages: import_zod31.z.number().int(),
3687
- page_size: import_zod31.z.number().int(),
3688
- has_next: import_zod31.z.boolean(),
3689
- has_previous: import_zod31.z.boolean(),
3690
- next_page: import_zod31.z.number().int().nullable().optional(),
3691
- previous_page: import_zod31.z.number().int().nullable().optional(),
3692
- results: import_zod31.z.array(DeviceListResponseSchema)
3675
+ var SetupRequestSchema = import_zod31.z.object({
3676
+ device_name: import_zod31.z.string().min(1).max(100).optional()
3693
3677
  });
3694
3678
 
3695
- // src/_api/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
3679
+ // src/_api/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
3696
3680
  var import_zod32 = require("zod");
3697
- var SetupRequestSchema = import_zod32.z.object({
3698
- device_name: import_zod32.z.string().min(1).max(100).optional()
3681
+ var SetupResponseSchema = import_zod32.z.object({
3682
+ device_id: import_zod32.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
3683
+ secret: import_zod32.z.string(),
3684
+ provisioning_uri: import_zod32.z.string(),
3685
+ qr_code_base64: import_zod32.z.string(),
3686
+ expires_in: import_zod32.z.number().int()
3699
3687
  });
3700
3688
 
3701
- // src/_api/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
3689
+ // src/_api/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts
3702
3690
  var import_zod33 = require("zod");
3703
- var SetupResponseSchema = import_zod33.z.object({
3704
- device_id: import_zod33.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
3705
- secret: import_zod33.z.string(),
3706
- provisioning_uri: import_zod33.z.string(),
3707
- qr_code_base64: import_zod33.z.string(),
3708
- expires_in: import_zod33.z.number().int()
3691
+ var TotpVerifyUserSchema = import_zod33.z.object({
3692
+ id: import_zod33.z.number().int(),
3693
+ email: import_zod33.z.email(),
3694
+ first_name: import_zod33.z.string().max(50).optional(),
3695
+ last_name: import_zod33.z.string().max(50).optional(),
3696
+ full_name: import_zod33.z.string(),
3697
+ initials: import_zod33.z.string(),
3698
+ display_username: import_zod33.z.string(),
3699
+ company: import_zod33.z.string().max(100).optional(),
3700
+ phone: import_zod33.z.string().max(20).optional(),
3701
+ position: import_zod33.z.string().max(100).optional(),
3702
+ language: import_zod33.z.string().max(10).optional(),
3703
+ avatar: import_zod33.z.string().nullable(),
3704
+ is_staff: import_zod33.z.boolean(),
3705
+ is_superuser: import_zod33.z.boolean(),
3706
+ date_joined: import_zod33.z.string().datetime({ offset: true }),
3707
+ last_login: import_zod33.z.string().datetime({ offset: true }).nullable(),
3708
+ unanswered_messages_count: import_zod33.z.number().int()
3709
3709
  });
3710
3710
 
3711
- // src/_api/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts
3711
+ // src/_api/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
3712
3712
  var import_zod34 = require("zod");
3713
- var TotpVerifyUserSchema = import_zod34.z.object({
3714
- id: import_zod34.z.number().int(),
3715
- email: import_zod34.z.email(),
3716
- first_name: import_zod34.z.string().max(50).optional(),
3717
- last_name: import_zod34.z.string().max(50).optional(),
3718
- full_name: import_zod34.z.string(),
3719
- initials: import_zod34.z.string(),
3720
- display_username: import_zod34.z.string(),
3721
- company: import_zod34.z.string().max(100).optional(),
3722
- phone: import_zod34.z.string().max(20).optional(),
3723
- position: import_zod34.z.string().max(100).optional(),
3724
- language: import_zod34.z.string().max(10).optional(),
3725
- avatar: import_zod34.z.string().nullable(),
3726
- is_staff: import_zod34.z.boolean(),
3727
- is_superuser: import_zod34.z.boolean(),
3728
- date_joined: import_zod34.z.string().datetime({ offset: true }),
3729
- last_login: import_zod34.z.string().datetime({ offset: true }).nullable(),
3730
- unanswered_messages_count: import_zod34.z.number().int()
3713
+ var VerifyBackupRequestSchema = import_zod34.z.object({
3714
+ session_id: import_zod34.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
3715
+ backup_code: import_zod34.z.string().min(8).max(8)
3731
3716
  });
3732
3717
 
3733
- // src/_api/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
3718
+ // src/_api/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
3734
3719
  var import_zod35 = require("zod");
3735
- var VerifyBackupRequestSchema = import_zod35.z.object({
3720
+ var VerifyRequestSchema = import_zod35.z.object({
3736
3721
  session_id: import_zod35.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
3737
- backup_code: import_zod35.z.string().min(8).max(8)
3738
- });
3739
-
3740
- // src/_api/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
3741
- var import_zod36 = require("zod");
3742
- var VerifyRequestSchema = import_zod36.z.object({
3743
- session_id: import_zod36.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
3744
- code: import_zod36.z.string().min(6).max(6)
3722
+ code: import_zod35.z.string().min(6).max(6)
3745
3723
  });
3746
3724
 
3747
3725
  // src/_api/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts
3748
- var import_zod37 = require("zod");
3749
- var VerifyResponseSchema = import_zod37.z.object({
3750
- message: import_zod37.z.string(),
3751
- access_token: import_zod37.z.string(),
3752
- refresh_token: import_zod37.z.string(),
3726
+ var import_zod36 = require("zod");
3727
+ var VerifyResponseSchema = import_zod36.z.object({
3728
+ message: import_zod36.z.string(),
3729
+ access_token: import_zod36.z.string(),
3730
+ refresh_token: import_zod36.z.string(),
3753
3731
  user: TotpVerifyUserSchema,
3754
- remaining_backup_codes: import_zod37.z.number().int().optional(),
3755
- warning: import_zod37.z.string().optional()
3732
+ remaining_backup_codes: import_zod36.z.number().int().optional(),
3733
+ warning: import_zod36.z.string().optional()
3756
3734
  });
3757
3735
 
3758
3736
  // src/_api/generated/cfg_totp/_utils/fetchers/index.ts
@@ -3766,7 +3744,7 @@ __export(fetchers_exports3, {
3766
3744
  createTotpVerifyCreate: () => createTotpVerifyCreate,
3767
3745
  deleteTotpDevicesDestroy: () => deleteTotpDevicesDestroy,
3768
3746
  getTotpBackupCodesRetrieve: () => getTotpBackupCodesRetrieve,
3769
- getTotpDevicesList: () => getTotpDevicesList
3747
+ getTotpDevicesRetrieve: () => getTotpDevicesRetrieve
3770
3748
  });
3771
3749
 
3772
3750
  // src/_api/generated/cfg_totp/api-instance.ts
@@ -3893,14 +3871,14 @@ __name(createTotpBackupCodesRegenerateCreate, "createTotpBackupCodesRegenerateCr
3893
3871
 
3894
3872
  // src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts
3895
3873
  var import_consola10 = require("consola");
3896
- async function getTotpDevicesList(params, client) {
3874
+ async function getTotpDevicesRetrieve(client) {
3897
3875
  const api = client || getAPIInstance3();
3898
- const response = await api.totp_management.totpDevicesList(params?.ordering, params?.page, params?.page_size, params?.search);
3876
+ const response = await api.totp_management.totpDevicesRetrieve();
3899
3877
  try {
3900
- return PaginatedDeviceListResponseListSchema.parse(response);
3878
+ return DeviceListResponseSchema.parse(response);
3901
3879
  } catch (error) {
3902
3880
  import_consola10.consola.error("\u274C Zod Validation Failed");
3903
- import_consola10.consola.box(`getTotpDevicesList
3881
+ import_consola10.consola.box(`getTotpDevicesRetrieve
3904
3882
  Path: /cfg/totp/devices/
3905
3883
  Method: GET`);
3906
3884
  if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
@@ -3917,7 +3895,7 @@ Method: GET`);
3917
3895
  try {
3918
3896
  const event = new CustomEvent("zod-validation-error", {
3919
3897
  detail: {
3920
- operation: "getTotpDevicesList",
3898
+ operation: "getTotpDevicesRetrieve",
3921
3899
  path: "/cfg/totp/devices/",
3922
3900
  method: "GET",
3923
3901
  error,
@@ -3935,7 +3913,7 @@ Method: GET`);
3935
3913
  throw error;
3936
3914
  }
3937
3915
  }
3938
- __name(getTotpDevicesList, "getTotpDevicesList");
3916
+ __name(getTotpDevicesRetrieve, "getTotpDevicesRetrieve");
3939
3917
  async function createTotpDisableCreate(data, client) {
3940
3918
  const api = client || getAPIInstance3();
3941
3919
  const response = await api.totp_management.totpDisableCreate(data);
@@ -4455,7 +4433,7 @@ __export(hooks_exports2, {
4455
4433
  useCreateTotpVerifyCreate: () => useCreateTotpVerifyCreate,
4456
4434
  useDeleteTotpDevicesDestroy: () => useDeleteTotpDevicesDestroy,
4457
4435
  useTotpBackupCodesRetrieve: () => useTotpBackupCodesRetrieve,
4458
- useTotpDevicesList: () => useTotpDevicesList
4436
+ useTotpDevicesRetrieve: () => useTotpDevicesRetrieve
4459
4437
  });
4460
4438
 
4461
4439
  // src/_api/generated/cfg_totp/_utils/hooks/totp__backup_codes.ts
@@ -4481,13 +4459,13 @@ __name(useCreateTotpBackupCodesRegenerateCreate, "useCreateTotpBackupCodesRegene
4481
4459
  // src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts
4482
4460
  var import_swr10 = __toESM(require("swr"), 1);
4483
4461
  var import_swr11 = require("swr");
4484
- function useTotpDevicesList(params, client) {
4462
+ function useTotpDevicesRetrieve(client) {
4485
4463
  return (0, import_swr10.default)(
4486
- ["cfg-totp-devices", params],
4487
- () => getTotpDevicesList(params, client)
4464
+ "cfg-totp-device",
4465
+ () => getTotpDevicesRetrieve(client)
4488
4466
  );
4489
4467
  }
4490
- __name(useTotpDevicesList, "useTotpDevicesList");
4468
+ __name(useTotpDevicesRetrieve, "useTotpDevicesRetrieve");
4491
4469
  function useCreateTotpDisableCreate() {
4492
4470
  const { mutate } = (0, import_swr11.useSWRConfig)();
4493
4471
  return async (data, client) => {