@djangocfg/api 2.1.308 → 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.
- package/dist/auth-server.cjs +18 -7
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +18 -7
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +54 -21
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +54 -21
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +54 -21
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +144 -144
- package/dist/clients.d.ts +144 -144
- package/dist/clients.mjs +54 -21
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +18 -7
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +92 -92
- package/dist/hooks.d.ts +92 -92
- package/dist/hooks.mjs +18 -7
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +36 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -105
- package/dist/index.d.ts +111 -105
- package/dist/index.mjs +36 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/cfg_accounts/accounts/models.ts +25 -25
- package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +62 -62
- package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +24 -24
- package/src/_api/generated/cfg_accounts/client.ts +3 -0
- package/src/_api/generated/cfg_accounts/http.ts +30 -7
- package/src/_api/generated/cfg_centrifugo/client.ts +3 -0
- package/src/_api/generated/cfg_centrifugo/http.ts +30 -7
- package/src/_api/generated/cfg_totp/client.ts +3 -0
- package/src/_api/generated/cfg_totp/http.ts +30 -7
- package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
- package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +18 -18
- package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +18 -18
package/dist/auth-server.mjs
CHANGED
|
@@ -214,7 +214,7 @@ var FetchAdapter = class {
|
|
|
214
214
|
__name(this, "FetchAdapter");
|
|
215
215
|
}
|
|
216
216
|
async request(request) {
|
|
217
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
217
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
218
218
|
let finalUrl = url;
|
|
219
219
|
if (params) {
|
|
220
220
|
const searchParams = new URLSearchParams();
|
|
@@ -247,11 +247,21 @@ var FetchAdapter = class {
|
|
|
247
247
|
// Include Django session cookies
|
|
248
248
|
});
|
|
249
249
|
let data = null;
|
|
250
|
-
const contentType = response.headers.get("content-type");
|
|
251
|
-
if (response.status !== 204
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
250
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
251
|
+
if (response.status !== 204) {
|
|
252
|
+
if (responseType === "blob") {
|
|
253
|
+
data = await response.blob();
|
|
254
|
+
} else if (responseType === "text") {
|
|
255
|
+
data = await response.text();
|
|
256
|
+
} else if (responseType === "json") {
|
|
257
|
+
data = await response.json();
|
|
258
|
+
} else if (contentType.includes("application/json")) {
|
|
259
|
+
data = await response.json();
|
|
260
|
+
} else if (contentType.startsWith("text/")) {
|
|
261
|
+
data = await response.text();
|
|
262
|
+
} else {
|
|
263
|
+
data = await response.blob();
|
|
264
|
+
}
|
|
255
265
|
}
|
|
256
266
|
const responseHeaders = {};
|
|
257
267
|
response.headers.forEach((value, key) => {
|
|
@@ -687,7 +697,8 @@ var APIClient = class {
|
|
|
687
697
|
params: options?.params,
|
|
688
698
|
body: options?.body,
|
|
689
699
|
formData: options?.formData,
|
|
690
|
-
binaryBody: options?.binaryBody
|
|
700
|
+
binaryBody: options?.binaryBody,
|
|
701
|
+
responseType: options?.responseType
|
|
691
702
|
});
|
|
692
703
|
const duration = Date.now() - startTime;
|
|
693
704
|
if (response.status >= 400) {
|