@djangocfg/api 2.1.261 → 2.1.263

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 (43) hide show
  1. package/dist/auth-server.cjs +9 -0
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +9 -0
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +27 -0
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.mjs +27 -0
  8. package/dist/auth.mjs.map +1 -1
  9. package/dist/clients.cjs +65 -1
  10. package/dist/clients.cjs.map +1 -1
  11. package/dist/clients.d.cts +145 -122
  12. package/dist/clients.d.ts +145 -122
  13. package/dist/clients.mjs +65 -1
  14. package/dist/clients.mjs.map +1 -1
  15. package/dist/hooks.cjs +47 -1
  16. package/dist/hooks.cjs.map +1 -1
  17. package/dist/hooks.d.cts +91 -68
  18. package/dist/hooks.d.ts +91 -68
  19. package/dist/hooks.mjs +47 -1
  20. package/dist/hooks.mjs.map +1 -1
  21. package/dist/index.cjs +56 -1
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +89 -89
  24. package/dist/index.d.ts +89 -89
  25. package/dist/index.mjs +56 -1
  26. package/dist/index.mjs.map +1 -1
  27. package/package.json +2 -2
  28. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +46 -2
  29. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +3 -2
  30. package/src/_api/generated/cfg_accounts/accounts/models.ts +12 -12
  31. package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +1 -1
  32. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +55 -55
  33. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +23 -23
  34. package/src/_api/generated/cfg_accounts/client.ts +8 -0
  35. package/src/_api/generated/cfg_accounts/errors.ts +5 -0
  36. package/src/_api/generated/cfg_centrifugo/client.ts +8 -0
  37. package/src/_api/generated/cfg_centrifugo/errors.ts +5 -0
  38. package/src/_api/generated/cfg_totp/client.ts +8 -0
  39. package/src/_api/generated/cfg_totp/errors.ts +5 -0
  40. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
  41. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
  42. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +25 -25
  43. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
package/dist/auth.mjs CHANGED
@@ -539,6 +539,9 @@ var APIError = class extends Error {
539
539
  if (details.detail) {
540
540
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
541
541
  }
542
+ if (details.error) {
543
+ return String(details.error);
544
+ }
542
545
  if (details.message) {
543
546
  return String(details.message);
544
547
  }
@@ -877,6 +880,12 @@ var APIClient = class {
877
880
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
878
881
  headers["Content-Type"] = "application/json";
879
882
  }
883
+ if (!headers["Authorization"]) {
884
+ const token = this.getToken();
885
+ if (token) {
886
+ headers["Authorization"] = `Bearer ${token}`;
887
+ }
888
+ }
880
889
  if (this.logger) {
881
890
  this.logger.logRequest({
882
891
  method,
@@ -1883,6 +1892,9 @@ var APIError2 = class extends Error {
1883
1892
  if (details.detail) {
1884
1893
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
1885
1894
  }
1895
+ if (details.error) {
1896
+ return String(details.error);
1897
+ }
1886
1898
  if (details.message) {
1887
1899
  return String(details.message);
1888
1900
  }
@@ -2218,6 +2230,12 @@ var APIClient2 = class {
2218
2230
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
2219
2231
  headers["Content-Type"] = "application/json";
2220
2232
  }
2233
+ if (!headers["Authorization"]) {
2234
+ const token = this.getToken();
2235
+ if (token) {
2236
+ headers["Authorization"] = `Bearer ${token}`;
2237
+ }
2238
+ }
2221
2239
  if (this.logger) {
2222
2240
  this.logger.logRequest({
2223
2241
  method,
@@ -2800,6 +2818,9 @@ var APIError3 = class extends Error {
2800
2818
  if (details.detail) {
2801
2819
  return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
2802
2820
  }
2821
+ if (details.error) {
2822
+ return String(details.error);
2823
+ }
2803
2824
  if (details.message) {
2804
2825
  return String(details.message);
2805
2826
  }
@@ -3139,6 +3160,12 @@ var APIClient3 = class {
3139
3160
  if (!options?.formData && !options?.binaryBody && !headers["Content-Type"]) {
3140
3161
  headers["Content-Type"] = "application/json";
3141
3162
  }
3163
+ if (!headers["Authorization"]) {
3164
+ const token = this.getToken();
3165
+ if (token) {
3166
+ headers["Authorization"] = `Bearer ${token}`;
3167
+ }
3168
+ }
3142
3169
  if (this.logger) {
3143
3170
  this.logger.logRequest({
3144
3171
  method,