@djangocfg/api 2.1.309 → 2.1.310

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 (40) hide show
  1. package/dist/auth-server.cjs +18 -7
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +18 -7
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +54 -21
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.mjs +54 -21
  8. package/dist/auth.mjs.map +1 -1
  9. package/dist/clients.cjs +54 -21
  10. package/dist/clients.cjs.map +1 -1
  11. package/dist/clients.d.cts +144 -144
  12. package/dist/clients.d.ts +144 -144
  13. package/dist/clients.mjs +54 -21
  14. package/dist/clients.mjs.map +1 -1
  15. package/dist/hooks.cjs +18 -7
  16. package/dist/hooks.cjs.map +1 -1
  17. package/dist/hooks.d.cts +92 -92
  18. package/dist/hooks.d.ts +92 -92
  19. package/dist/hooks.mjs +18 -7
  20. package/dist/hooks.mjs.map +1 -1
  21. package/dist/index.cjs +36 -14
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +111 -105
  24. package/dist/index.d.ts +111 -105
  25. package/dist/index.mjs +36 -14
  26. package/dist/index.mjs.map +1 -1
  27. package/package.json +2 -2
  28. package/src/_api/generated/cfg_accounts/accounts/models.ts +25 -25
  29. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +62 -62
  30. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +24 -24
  31. package/src/_api/generated/cfg_accounts/client.ts +3 -0
  32. package/src/_api/generated/cfg_accounts/http.ts +30 -7
  33. package/src/_api/generated/cfg_centrifugo/client.ts +3 -0
  34. package/src/_api/generated/cfg_centrifugo/http.ts +30 -7
  35. package/src/_api/generated/cfg_totp/client.ts +3 -0
  36. package/src/_api/generated/cfg_totp/http.ts +30 -7
  37. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +10 -10
  38. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
  39. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +18 -18
  40. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +18 -18
package/dist/index.cjs CHANGED
@@ -382,7 +382,7 @@ var FetchAdapter = class {
382
382
  __name(this, "FetchAdapter");
383
383
  }
384
384
  async request(request) {
385
- const { method, url, headers, body, params, formData, binaryBody } = request;
385
+ const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
386
386
  let finalUrl = url;
387
387
  if (params) {
388
388
  const searchParams = new URLSearchParams();
@@ -415,11 +415,21 @@ var FetchAdapter = class {
415
415
  // Include Django session cookies
416
416
  });
417
417
  let data = null;
418
- const contentType = response.headers.get("content-type");
419
- if (response.status !== 204 && contentType?.includes("application/json")) {
420
- data = await response.json();
421
- } else if (response.status !== 204) {
422
- data = await response.text();
418
+ const contentType = response.headers.get("content-type") ?? "";
419
+ if (response.status !== 204) {
420
+ if (responseType === "blob") {
421
+ data = await response.blob();
422
+ } else if (responseType === "text") {
423
+ data = await response.text();
424
+ } else if (responseType === "json") {
425
+ data = await response.json();
426
+ } else if (contentType.includes("application/json")) {
427
+ data = await response.json();
428
+ } else if (contentType.startsWith("text/")) {
429
+ data = await response.text();
430
+ } else {
431
+ data = await response.blob();
432
+ }
423
433
  }
424
434
  const responseHeaders = {};
425
435
  response.headers.forEach((value, key) => {
@@ -869,7 +879,8 @@ var APIClient = class {
869
879
  params: options?.params,
870
880
  body: options?.body,
871
881
  formData: options?.formData,
872
- binaryBody: options?.binaryBody
882
+ binaryBody: options?.binaryBody,
883
+ responseType: options?.responseType
873
884
  });
874
885
  const duration = Date.now() - startTime;
875
886
  if (response.status >= 400) {
@@ -2287,7 +2298,7 @@ var FetchAdapter2 = class {
2287
2298
  __name(this, "FetchAdapter");
2288
2299
  }
2289
2300
  async request(request) {
2290
- const { method, url, headers, body, params, formData, binaryBody } = request;
2301
+ const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
2291
2302
  let finalUrl = url;
2292
2303
  if (params) {
2293
2304
  const searchParams = new URLSearchParams();
@@ -2320,11 +2331,21 @@ var FetchAdapter2 = class {
2320
2331
  // Include Django session cookies
2321
2332
  });
2322
2333
  let data = null;
2323
- const contentType = response.headers.get("content-type");
2324
- if (response.status !== 204 && contentType?.includes("application/json")) {
2325
- data = await response.json();
2326
- } else if (response.status !== 204) {
2327
- data = await response.text();
2334
+ const contentType = response.headers.get("content-type") ?? "";
2335
+ if (response.status !== 204) {
2336
+ if (responseType === "blob") {
2337
+ data = await response.blob();
2338
+ } else if (responseType === "text") {
2339
+ data = await response.text();
2340
+ } else if (responseType === "json") {
2341
+ data = await response.json();
2342
+ } else if (contentType.includes("application/json")) {
2343
+ data = await response.json();
2344
+ } else if (contentType.startsWith("text/")) {
2345
+ data = await response.text();
2346
+ } else {
2347
+ data = await response.blob();
2348
+ }
2328
2349
  }
2329
2350
  const responseHeaders = {};
2330
2351
  response.headers.forEach((value, key) => {
@@ -2754,7 +2775,8 @@ var APIClient2 = class {
2754
2775
  params: options?.params,
2755
2776
  body: options?.body,
2756
2777
  formData: options?.formData,
2757
- binaryBody: options?.binaryBody
2778
+ binaryBody: options?.binaryBody,
2779
+ responseType: options?.responseType
2758
2780
  });
2759
2781
  const duration = Date.now() - startTime;
2760
2782
  if (response.status >= 400) {