@djangocfg/api 2.1.477 → 2.1.479

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 (42) hide show
  1. package/dist/auth.cjs +173 -121
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.d.cts +36 -2
  4. package/dist/auth.d.ts +36 -2
  5. package/dist/auth.mjs +173 -121
  6. package/dist/auth.mjs.map +1 -1
  7. package/dist/clients.cjs +18 -0
  8. package/dist/clients.cjs.map +1 -1
  9. package/dist/clients.d.cts +49 -0
  10. package/dist/clients.d.ts +49 -0
  11. package/dist/clients.mjs +18 -0
  12. package/dist/clients.mjs.map +1 -1
  13. package/dist/hooks.cjs +133 -1
  14. package/dist/hooks.cjs.map +1 -1
  15. package/dist/hooks.d.cts +61 -1
  16. package/dist/hooks.d.ts +61 -1
  17. package/dist/hooks.mjs +133 -1
  18. package/dist/hooks.mjs.map +1 -1
  19. package/dist/index.cjs +18 -0
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +72 -4
  22. package/dist/index.d.ts +72 -4
  23. package/dist/index.mjs +18 -0
  24. package/dist/index.mjs.map +1 -1
  25. package/package.json +2 -2
  26. package/src/_api/generated/_cfg_accounts/hooks/index.ts +1 -0
  27. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpConsentPolicyRetrieve.ts +74 -0
  28. package/src/_api/generated/_cfg_accounts/openapi.json +76 -0
  29. package/src/_api/generated/_cfg_accounts/schemas/ConsentPolicy.ts +13 -0
  30. package/src/_api/generated/_cfg_accounts/schemas/MarketingConsentDefaultEnum.ts +9 -0
  31. package/src/_api/generated/_cfg_accounts/schemas/OTPRequestRequest.ts +2 -0
  32. package/src/_api/generated/_cfg_accounts/schemas/index.ts +2 -0
  33. package/src/_api/generated/openapi.json +76 -0
  34. package/src/_api/generated/sdk.gen.ts +40 -21
  35. package/src/_api/generated/types.gen.ts +47 -0
  36. package/src/auth/context/AuthContext.tsx +12 -4
  37. package/src/auth/context/types.ts +2 -2
  38. package/src/auth/hooks/useAuthForm.ts +15 -3
  39. package/src/auth/hooks/useAuthFormState.ts +5 -0
  40. package/src/auth/types/form.ts +27 -0
  41. package/src/auth/types/index.ts +1 -0
  42. package/src/hooks/index.ts +6 -0
@@ -607,6 +607,22 @@ type ConnectionTokenResponse = {
607
607
  */
608
608
  channels: Array<string>;
609
609
  };
610
+ /**
611
+ * Marketing-consent UI policy derived from the request's geo context.
612
+ */
613
+ type ConsentPolicy = {
614
+ /**
615
+ * Country code seen by the edge (CF-IPCountry), '' if unknown
616
+ */
617
+ country: string;
618
+ /**
619
+ * Default state for the marketing-consent checkbox
620
+ *
621
+ * * `checked` - checked
622
+ * * `unchecked` - unchecked
623
+ */
624
+ marketing_consent_default: MarketingConsentDefaultEnum;
625
+ };
610
626
  /**
611
627
  * Serializer for listing TOTP devices.
612
628
  */
@@ -657,6 +673,14 @@ type DisableRequest = {
657
673
  */
658
674
  code: string;
659
675
  };
676
+ /**
677
+ * * `checked` - checked
678
+ * * `unchecked` - unchecked
679
+ */
680
+ declare enum MarketingConsentDefaultEnum {
681
+ CHECKED = "checked",
682
+ UNCHECKED = "unchecked"
683
+ }
660
684
  /**
661
685
  * Request to start OAuth flow.
662
686
  */
@@ -862,6 +886,14 @@ type OtpRequestRequest = {
862
886
  * Source URL for tracking registration (e.g., https://my.djangocfg.com)
863
887
  */
864
888
  source_url?: string;
889
+ /**
890
+ * Marketing-consent choice made at signup (absent/null = not asked, false = declined)
891
+ */
892
+ marketing_consent?: boolean | null;
893
+ /**
894
+ * Version of the consent disclosure text shown (e.g. product-updates-reg-v1)
895
+ */
896
+ consent_disclosure_version?: string;
865
897
  };
866
898
  /**
867
899
  * OTP request response.
@@ -1367,6 +1399,15 @@ type CfgAccountsOauthProvidersRetrieveData = {
1367
1399
  type CfgAccountsOauthProvidersRetrieveResponses = {
1368
1400
  200: OAuthProvidersResponse;
1369
1401
  };
1402
+ type CfgAccountsOtpConsentPolicyRetrieveData = {
1403
+ body?: never;
1404
+ path?: never;
1405
+ query?: never;
1406
+ url: '/cfg/accounts/otp/consent-policy/';
1407
+ };
1408
+ type CfgAccountsOtpConsentPolicyRetrieveResponses = {
1409
+ 200: ConsentPolicy;
1410
+ };
1370
1411
  type CfgAccountsOtpRequestCreateData = {
1371
1412
  body: OtpRequestRequest;
1372
1413
  path?: never;
@@ -1767,6 +1808,14 @@ declare class CfgAccountsOauth {
1767
1808
  static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>): RequestResult<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>;
1768
1809
  }
1769
1810
  declare class CfgAccounts {
1811
+ /**
1812
+ * Marketing-consent checkbox policy for the caller's jurisdiction.
1813
+ *
1814
+ * Derived from the edge-provided CF-IPCountry — the same signal stored
1815
+ * as consent evidence at request time. Unknown country fails safe to
1816
+ * "unchecked".
1817
+ */
1818
+ static cfgAccountsOtpConsentPolicyRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOtpConsentPolicyRetrieveData, ThrowOnError>): RequestResult<CfgAccountsOtpConsentPolicyRetrieveResponses, unknown, ThrowOnError>;
1770
1819
  /**
1771
1820
  * Request OTP code to email.
1772
1821
  */
package/dist/clients.d.ts CHANGED
@@ -607,6 +607,22 @@ type ConnectionTokenResponse = {
607
607
  */
608
608
  channels: Array<string>;
609
609
  };
610
+ /**
611
+ * Marketing-consent UI policy derived from the request's geo context.
612
+ */
613
+ type ConsentPolicy = {
614
+ /**
615
+ * Country code seen by the edge (CF-IPCountry), '' if unknown
616
+ */
617
+ country: string;
618
+ /**
619
+ * Default state for the marketing-consent checkbox
620
+ *
621
+ * * `checked` - checked
622
+ * * `unchecked` - unchecked
623
+ */
624
+ marketing_consent_default: MarketingConsentDefaultEnum;
625
+ };
610
626
  /**
611
627
  * Serializer for listing TOTP devices.
612
628
  */
@@ -657,6 +673,14 @@ type DisableRequest = {
657
673
  */
658
674
  code: string;
659
675
  };
676
+ /**
677
+ * * `checked` - checked
678
+ * * `unchecked` - unchecked
679
+ */
680
+ declare enum MarketingConsentDefaultEnum {
681
+ CHECKED = "checked",
682
+ UNCHECKED = "unchecked"
683
+ }
660
684
  /**
661
685
  * Request to start OAuth flow.
662
686
  */
@@ -862,6 +886,14 @@ type OtpRequestRequest = {
862
886
  * Source URL for tracking registration (e.g., https://my.djangocfg.com)
863
887
  */
864
888
  source_url?: string;
889
+ /**
890
+ * Marketing-consent choice made at signup (absent/null = not asked, false = declined)
891
+ */
892
+ marketing_consent?: boolean | null;
893
+ /**
894
+ * Version of the consent disclosure text shown (e.g. product-updates-reg-v1)
895
+ */
896
+ consent_disclosure_version?: string;
865
897
  };
866
898
  /**
867
899
  * OTP request response.
@@ -1367,6 +1399,15 @@ type CfgAccountsOauthProvidersRetrieveData = {
1367
1399
  type CfgAccountsOauthProvidersRetrieveResponses = {
1368
1400
  200: OAuthProvidersResponse;
1369
1401
  };
1402
+ type CfgAccountsOtpConsentPolicyRetrieveData = {
1403
+ body?: never;
1404
+ path?: never;
1405
+ query?: never;
1406
+ url: '/cfg/accounts/otp/consent-policy/';
1407
+ };
1408
+ type CfgAccountsOtpConsentPolicyRetrieveResponses = {
1409
+ 200: ConsentPolicy;
1410
+ };
1370
1411
  type CfgAccountsOtpRequestCreateData = {
1371
1412
  body: OtpRequestRequest;
1372
1413
  path?: never;
@@ -1767,6 +1808,14 @@ declare class CfgAccountsOauth {
1767
1808
  static cfgAccountsOauthProvidersRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOauthProvidersRetrieveData, ThrowOnError>): RequestResult<CfgAccountsOauthProvidersRetrieveResponses, unknown, ThrowOnError>;
1768
1809
  }
1769
1810
  declare class CfgAccounts {
1811
+ /**
1812
+ * Marketing-consent checkbox policy for the caller's jurisdiction.
1813
+ *
1814
+ * Derived from the edge-provided CF-IPCountry — the same signal stored
1815
+ * as consent evidence at request time. Unknown country fails safe to
1816
+ * "unchecked".
1817
+ */
1818
+ static cfgAccountsOtpConsentPolicyRetrieve<ThrowOnError extends boolean = false>(options?: Options<CfgAccountsOtpConsentPolicyRetrieveData, ThrowOnError>): RequestResult<CfgAccountsOtpConsentPolicyRetrieveResponses, unknown, ThrowOnError>;
1770
1819
  /**
1771
1820
  * Request OTP code to email.
1772
1821
  */
package/dist/clients.mjs CHANGED
@@ -1748,6 +1748,24 @@ var CfgAccounts = class {
1748
1748
  static {
1749
1749
  __name(this, "CfgAccounts");
1750
1750
  }
1751
+ /**
1752
+ * Marketing-consent checkbox policy for the caller's jurisdiction.
1753
+ *
1754
+ * Derived from the edge-provided CF-IPCountry — the same signal stored
1755
+ * as consent evidence at request time. Unknown country fails safe to
1756
+ * "unchecked".
1757
+ */
1758
+ static cfgAccountsOtpConsentPolicyRetrieve(options) {
1759
+ return (options?.client ?? client).get({
1760
+ security: [
1761
+ { name: "X-API-Key", type: "apiKey" },
1762
+ { scheme: "bearer", type: "http" },
1763
+ { name: "Authorization", type: "apiKey" }
1764
+ ],
1765
+ url: "/cfg/accounts/otp/consent-policy/",
1766
+ ...options
1767
+ });
1768
+ }
1751
1769
  /**
1752
1770
  * Request OTP code to email.
1753
1771
  */