@djangocfg/api 2.1.127 → 2.1.129

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 (49) hide show
  1. package/dist/auth-server.cjs +10 -19
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +10 -19
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +18 -29
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.d.cts +7 -16
  8. package/dist/auth.d.ts +7 -16
  9. package/dist/auth.mjs +18 -29
  10. package/dist/auth.mjs.map +1 -1
  11. package/dist/clients.cjs +20 -31
  12. package/dist/clients.cjs.map +1 -1
  13. package/dist/clients.d.cts +46 -54
  14. package/dist/clients.d.ts +46 -54
  15. package/dist/clients.mjs +20 -31
  16. package/dist/clients.mjs.map +1 -1
  17. package/dist/hooks.cjs +8 -17
  18. package/dist/hooks.cjs.map +1 -1
  19. package/dist/hooks.d.cts +11 -20
  20. package/dist/hooks.d.ts +11 -20
  21. package/dist/hooks.mjs +8 -17
  22. package/dist/hooks.mjs.map +1 -1
  23. package/dist/index.cjs +12 -23
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +15 -35
  26. package/dist/index.d.ts +15 -35
  27. package/dist/index.mjs +12 -23
  28. package/dist/index.mjs.map +1 -1
  29. package/package.json +2 -2
  30. package/src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts +1 -1
  31. package/src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts +2 -2
  32. package/src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts +1 -1
  33. package/src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +1 -1
  34. package/src/generated/cfg_accounts/_utils/schemas/User.schema.ts +2 -2
  35. package/src/generated/cfg_accounts/accounts/models.ts +1 -1
  36. package/src/generated/cfg_accounts/accounts__oauth/client.ts +1 -1
  37. package/src/generated/cfg_accounts/accounts__oauth/models.ts +1 -1
  38. package/src/generated/cfg_accounts/enums.ts +1 -19
  39. package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts +2 -2
  40. package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts +1 -1
  41. package/src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts +2 -2
  42. package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/client.ts +3 -3
  43. package/src/generated/cfg_centrifugo/schema.json +18 -0
  44. package/src/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +2 -2
  45. package/src/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +1 -1
  46. package/src/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts +3 -3
  47. package/src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts +2 -2
  48. package/src/generated/cfg_totp/schema.json +18 -0
  49. package/src/generated/cfg_totp/totp__totp_management/client.ts +3 -3
package/dist/hooks.d.cts CHANGED
@@ -34,7 +34,7 @@ declare class Auth {
34
34
  * OAuth provider to disconnect
35
35
  * * `github` - GitHub
36
36
  */
37
- declare enum OAuthDisconnectRequestRequestProvider {
37
+ declare enum OAuthConnectionProvider {
38
38
  GITHUB = "github"
39
39
  }
40
40
  /**
@@ -46,15 +46,6 @@ declare enum OTPRequestRequestChannel {
46
46
  EMAIL = "email",
47
47
  PHONE = "phone"
48
48
  }
49
- /**
50
- * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
51
- * * `email` - Email
52
- * * `phone` - Phone
53
- */
54
- declare enum OTPVerifyRequestChannel {
55
- EMAIL = "email",
56
- PHONE = "phone"
57
- }
58
49
 
59
50
  /**
60
51
  * Request to disconnect OAuth provider.
@@ -65,7 +56,7 @@ interface OAuthDisconnectRequestRequest$1 {
65
56
  /** OAuth provider to disconnect
66
57
 
67
58
  * `github` - GitHub */
68
- provider: OAuthDisconnectRequestRequestProvider;
59
+ provider: OAuthConnectionProvider;
69
60
  }
70
61
  /**
71
62
  * Request to start OAuth flow.
@@ -361,7 +352,7 @@ interface OTPVerifyRequest$1 {
361
352
 
362
353
  * `email` - Email
363
354
  * `phone` - Phone */
364
- channel?: OTPVerifyRequestChannel;
355
+ channel?: OTPRequestRequestChannel;
365
356
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
366
357
  source_url?: string;
367
358
  }
@@ -653,7 +644,7 @@ type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSch
653
644
  * Request to disconnect OAuth provider.
654
645
  */
655
646
  declare const OAuthDisconnectRequestRequestSchema: z.ZodObject<{
656
- provider: z.ZodEnum<typeof OAuthDisconnectRequestRequestProvider>;
647
+ provider: z.ZodEnum<typeof OAuthConnectionProvider>;
657
648
  }, z.core.$strip>;
658
649
  /**
659
650
  * Infer TypeScript type from Zod schema
@@ -756,7 +747,7 @@ type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;
756
747
  declare const OTPVerifyRequestSchema: z.ZodObject<{
757
748
  identifier: z.ZodString;
758
749
  otp: z.ZodString;
759
- channel: z.ZodOptional<z.ZodEnum<typeof OTPVerifyRequestChannel>>;
750
+ channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
760
751
  source_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
761
752
  }, z.core.$strip>;
762
753
  /**
@@ -813,13 +804,13 @@ declare const OTPVerifyResponseSchema: z.ZodObject<{
813
804
  avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
814
805
  is_staff: z.ZodBoolean;
815
806
  is_superuser: z.ZodBoolean;
816
- date_joined: z.ZodISODateTime;
817
- last_login: z.ZodNullable<z.ZodISODateTime>;
807
+ date_joined: z.ZodString;
808
+ last_login: z.ZodNullable<z.ZodString>;
818
809
  unanswered_messages_count: z.ZodInt;
819
810
  centrifugo: z.ZodNullable<z.ZodObject<{
820
811
  token: z.ZodString;
821
812
  centrifugo_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
822
- expires_at: z.ZodISODateTime;
813
+ expires_at: z.ZodString;
823
814
  channels: z.ZodArray<z.ZodString>;
824
815
  }, z.core.$strip>>;
825
816
  }, z.core.$strip>>>;
@@ -905,13 +896,13 @@ declare const UserSchema: z.ZodObject<{
905
896
  avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
906
897
  is_staff: z.ZodBoolean;
907
898
  is_superuser: z.ZodBoolean;
908
- date_joined: z.ZodISODateTime;
909
- last_login: z.ZodNullable<z.ZodISODateTime>;
899
+ date_joined: z.ZodString;
900
+ last_login: z.ZodNullable<z.ZodString>;
910
901
  unanswered_messages_count: z.ZodInt;
911
902
  centrifugo: z.ZodNullable<z.ZodObject<{
912
903
  token: z.ZodString;
913
904
  centrifugo_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
914
- expires_at: z.ZodISODateTime;
905
+ expires_at: z.ZodString;
915
906
  channels: z.ZodArray<z.ZodString>;
916
907
  }, z.core.$strip>>;
917
908
  }, z.core.$strip>;
package/dist/hooks.d.ts CHANGED
@@ -34,7 +34,7 @@ declare class Auth {
34
34
  * OAuth provider to disconnect
35
35
  * * `github` - GitHub
36
36
  */
37
- declare enum OAuthDisconnectRequestRequestProvider {
37
+ declare enum OAuthConnectionProvider {
38
38
  GITHUB = "github"
39
39
  }
40
40
  /**
@@ -46,15 +46,6 @@ declare enum OTPRequestRequestChannel {
46
46
  EMAIL = "email",
47
47
  PHONE = "phone"
48
48
  }
49
- /**
50
- * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
51
- * * `email` - Email
52
- * * `phone` - Phone
53
- */
54
- declare enum OTPVerifyRequestChannel {
55
- EMAIL = "email",
56
- PHONE = "phone"
57
- }
58
49
 
59
50
  /**
60
51
  * Request to disconnect OAuth provider.
@@ -65,7 +56,7 @@ interface OAuthDisconnectRequestRequest$1 {
65
56
  /** OAuth provider to disconnect
66
57
 
67
58
  * `github` - GitHub */
68
- provider: OAuthDisconnectRequestRequestProvider;
59
+ provider: OAuthConnectionProvider;
69
60
  }
70
61
  /**
71
62
  * Request to start OAuth flow.
@@ -361,7 +352,7 @@ interface OTPVerifyRequest$1 {
361
352
 
362
353
  * `email` - Email
363
354
  * `phone` - Phone */
364
- channel?: OTPVerifyRequestChannel;
355
+ channel?: OTPRequestRequestChannel;
365
356
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
366
357
  source_url?: string;
367
358
  }
@@ -653,7 +644,7 @@ type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSch
653
644
  * Request to disconnect OAuth provider.
654
645
  */
655
646
  declare const OAuthDisconnectRequestRequestSchema: z.ZodObject<{
656
- provider: z.ZodEnum<typeof OAuthDisconnectRequestRequestProvider>;
647
+ provider: z.ZodEnum<typeof OAuthConnectionProvider>;
657
648
  }, z.core.$strip>;
658
649
  /**
659
650
  * Infer TypeScript type from Zod schema
@@ -756,7 +747,7 @@ type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;
756
747
  declare const OTPVerifyRequestSchema: z.ZodObject<{
757
748
  identifier: z.ZodString;
758
749
  otp: z.ZodString;
759
- channel: z.ZodOptional<z.ZodEnum<typeof OTPVerifyRequestChannel>>;
750
+ channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
760
751
  source_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
761
752
  }, z.core.$strip>;
762
753
  /**
@@ -813,13 +804,13 @@ declare const OTPVerifyResponseSchema: z.ZodObject<{
813
804
  avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
814
805
  is_staff: z.ZodBoolean;
815
806
  is_superuser: z.ZodBoolean;
816
- date_joined: z.ZodISODateTime;
817
- last_login: z.ZodNullable<z.ZodISODateTime>;
807
+ date_joined: z.ZodString;
808
+ last_login: z.ZodNullable<z.ZodString>;
818
809
  unanswered_messages_count: z.ZodInt;
819
810
  centrifugo: z.ZodNullable<z.ZodObject<{
820
811
  token: z.ZodString;
821
812
  centrifugo_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
822
- expires_at: z.ZodISODateTime;
813
+ expires_at: z.ZodString;
823
814
  channels: z.ZodArray<z.ZodString>;
824
815
  }, z.core.$strip>>;
825
816
  }, z.core.$strip>>>;
@@ -905,13 +896,13 @@ declare const UserSchema: z.ZodObject<{
905
896
  avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
906
897
  is_staff: z.ZodBoolean;
907
898
  is_superuser: z.ZodBoolean;
908
- date_joined: z.ZodISODateTime;
909
- last_login: z.ZodNullable<z.ZodISODateTime>;
899
+ date_joined: z.ZodString;
900
+ last_login: z.ZodNullable<z.ZodString>;
910
901
  unanswered_messages_count: z.ZodInt;
911
902
  centrifugo: z.ZodNullable<z.ZodObject<{
912
903
  token: z.ZodString;
913
904
  centrifugo_url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
914
- expires_at: z.ZodISODateTime;
905
+ expires_at: z.ZodString;
915
906
  channels: z.ZodArray<z.ZodString>;
916
907
  }, z.core.$strip>>;
917
908
  }, z.core.$strip>;
package/dist/hooks.mjs CHANGED
@@ -48,7 +48,7 @@ var Oauth = class {
48
48
  */
49
49
  async accountsOauthConnectionsList() {
50
50
  const response = await this.client.request("GET", "/cfg/accounts/oauth/connections/");
51
- return response;
51
+ return response.results || response;
52
52
  }
53
53
  /**
54
54
  * Disconnect OAuth provider
@@ -826,20 +826,11 @@ var OAuthConnectionProvider = /* @__PURE__ */ ((OAuthConnectionProvider2) => {
826
826
  OAuthConnectionProvider2["GITHUB"] = "github";
827
827
  return OAuthConnectionProvider2;
828
828
  })(OAuthConnectionProvider || {});
829
- var OAuthDisconnectRequestRequestProvider = /* @__PURE__ */ ((OAuthDisconnectRequestRequestProvider2) => {
830
- OAuthDisconnectRequestRequestProvider2["GITHUB"] = "github";
831
- return OAuthDisconnectRequestRequestProvider2;
832
- })(OAuthDisconnectRequestRequestProvider || {});
833
829
  var OTPRequestRequestChannel = /* @__PURE__ */ ((OTPRequestRequestChannel2) => {
834
830
  OTPRequestRequestChannel2["EMAIL"] = "email";
835
831
  OTPRequestRequestChannel2["PHONE"] = "phone";
836
832
  return OTPRequestRequestChannel2;
837
833
  })(OTPRequestRequestChannel || {});
838
- var OTPVerifyRequestChannel = /* @__PURE__ */ ((OTPVerifyRequestChannel2) => {
839
- OTPVerifyRequestChannel2["EMAIL"] = "email";
840
- OTPVerifyRequestChannel2["PHONE"] = "phone";
841
- return OTPVerifyRequestChannel2;
842
- })(OTPVerifyRequestChannel || {});
843
834
 
844
835
  // src/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts
845
836
  import { z as z2 } from "zod";
@@ -853,7 +844,7 @@ import { z as z3 } from "zod";
853
844
  var CentrifugoTokenSchema = z3.object({
854
845
  token: z3.string(),
855
846
  centrifugo_url: z3.union([z3.url(), z3.literal("")]),
856
- expires_at: z3.iso.datetime(),
847
+ expires_at: z3.string().datetime({ offset: true }),
857
848
  channels: z3.array(z3.string())
858
849
  });
859
850
 
@@ -894,14 +885,14 @@ var OAuthConnectionSchema = z8.object({
894
885
  provider_username: z8.string(),
895
886
  provider_email: z8.email(),
896
887
  provider_avatar_url: z8.union([z8.url(), z8.literal("")]),
897
- connected_at: z8.iso.datetime(),
898
- last_login_at: z8.iso.datetime()
888
+ connected_at: z8.string().datetime({ offset: true }),
889
+ last_login_at: z8.string().datetime({ offset: true })
899
890
  });
900
891
 
901
892
  // src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
902
893
  import { z as z9 } from "zod";
903
894
  var OAuthDisconnectRequestRequestSchema = z9.object({
904
- provider: z9.nativeEnum(OAuthDisconnectRequestRequestProvider)
895
+ provider: z9.nativeEnum(OAuthConnectionProvider)
905
896
  });
906
897
 
907
898
  // src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
@@ -955,7 +946,7 @@ import { z as z16 } from "zod";
955
946
  var OTPVerifyRequestSchema = z16.object({
956
947
  identifier: z16.string().min(1),
957
948
  otp: z16.string().min(6).max(6),
958
- channel: z16.nativeEnum(OTPVerifyRequestChannel).optional(),
949
+ channel: z16.nativeEnum(OTPRequestRequestChannel).optional(),
959
950
  source_url: z16.union([z16.url(), z16.literal("")]).optional()
960
951
  });
961
952
 
@@ -978,8 +969,8 @@ var UserSchema = z17.object({
978
969
  avatar: z17.union([z17.url(), z17.literal("")]).nullable(),
979
970
  is_staff: z17.boolean(),
980
971
  is_superuser: z17.boolean(),
981
- date_joined: z17.iso.datetime(),
982
- last_login: z17.iso.datetime().nullable(),
972
+ date_joined: z17.string().datetime({ offset: true }),
973
+ last_login: z17.string().datetime({ offset: true }).nullable(),
983
974
  unanswered_messages_count: z17.int(),
984
975
  centrifugo: CentrifugoTokenSchema.nullable()
985
976
  });