@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.cjs
CHANGED
|
@@ -253,7 +253,7 @@ var FetchAdapter = class {
|
|
|
253
253
|
__name(this, "FetchAdapter");
|
|
254
254
|
}
|
|
255
255
|
async request(request) {
|
|
256
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
256
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
257
257
|
let finalUrl = url;
|
|
258
258
|
if (params) {
|
|
259
259
|
const searchParams = new URLSearchParams();
|
|
@@ -286,11 +286,21 @@ var FetchAdapter = class {
|
|
|
286
286
|
// Include Django session cookies
|
|
287
287
|
});
|
|
288
288
|
let data = null;
|
|
289
|
-
const contentType = response.headers.get("content-type");
|
|
290
|
-
if (response.status !== 204
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
289
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
290
|
+
if (response.status !== 204) {
|
|
291
|
+
if (responseType === "blob") {
|
|
292
|
+
data = await response.blob();
|
|
293
|
+
} else if (responseType === "text") {
|
|
294
|
+
data = await response.text();
|
|
295
|
+
} else if (responseType === "json") {
|
|
296
|
+
data = await response.json();
|
|
297
|
+
} else if (contentType.includes("application/json")) {
|
|
298
|
+
data = await response.json();
|
|
299
|
+
} else if (contentType.startsWith("text/")) {
|
|
300
|
+
data = await response.text();
|
|
301
|
+
} else {
|
|
302
|
+
data = await response.blob();
|
|
303
|
+
}
|
|
294
304
|
}
|
|
295
305
|
const responseHeaders = {};
|
|
296
306
|
response.headers.forEach((value, key) => {
|
|
@@ -726,7 +736,8 @@ var APIClient = class {
|
|
|
726
736
|
params: options?.params,
|
|
727
737
|
body: options?.body,
|
|
728
738
|
formData: options?.formData,
|
|
729
|
-
binaryBody: options?.binaryBody
|
|
739
|
+
binaryBody: options?.binaryBody,
|
|
740
|
+
responseType: options?.responseType
|
|
730
741
|
});
|
|
731
742
|
const duration = Date.now() - startTime;
|
|
732
743
|
if (response.status >= 400) {
|