@djangocfg/api 2.1.309 → 2.1.312
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/index.mjs
CHANGED
|
@@ -283,7 +283,7 @@ var FetchAdapter = class {
|
|
|
283
283
|
__name(this, "FetchAdapter");
|
|
284
284
|
}
|
|
285
285
|
async request(request) {
|
|
286
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
286
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
287
287
|
let finalUrl = url;
|
|
288
288
|
if (params) {
|
|
289
289
|
const searchParams = new URLSearchParams();
|
|
@@ -316,11 +316,21 @@ var FetchAdapter = class {
|
|
|
316
316
|
// Include Django session cookies
|
|
317
317
|
});
|
|
318
318
|
let data = null;
|
|
319
|
-
const contentType = response.headers.get("content-type");
|
|
320
|
-
if (response.status !== 204
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
320
|
+
if (response.status !== 204) {
|
|
321
|
+
if (responseType === "blob") {
|
|
322
|
+
data = await response.blob();
|
|
323
|
+
} else if (responseType === "text") {
|
|
324
|
+
data = await response.text();
|
|
325
|
+
} else if (responseType === "json") {
|
|
326
|
+
data = await response.json();
|
|
327
|
+
} else if (contentType.includes("application/json")) {
|
|
328
|
+
data = await response.json();
|
|
329
|
+
} else if (contentType.startsWith("text/")) {
|
|
330
|
+
data = await response.text();
|
|
331
|
+
} else {
|
|
332
|
+
data = await response.blob();
|
|
333
|
+
}
|
|
324
334
|
}
|
|
325
335
|
const responseHeaders = {};
|
|
326
336
|
response.headers.forEach((value, key) => {
|
|
@@ -770,7 +780,8 @@ var APIClient = class {
|
|
|
770
780
|
params: options?.params,
|
|
771
781
|
body: options?.body,
|
|
772
782
|
formData: options?.formData,
|
|
773
|
-
binaryBody: options?.binaryBody
|
|
783
|
+
binaryBody: options?.binaryBody,
|
|
784
|
+
responseType: options?.responseType
|
|
774
785
|
});
|
|
775
786
|
const duration = Date.now() - startTime;
|
|
776
787
|
if (response.status >= 400) {
|
|
@@ -2188,7 +2199,7 @@ var FetchAdapter2 = class {
|
|
|
2188
2199
|
__name(this, "FetchAdapter");
|
|
2189
2200
|
}
|
|
2190
2201
|
async request(request) {
|
|
2191
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
2202
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
2192
2203
|
let finalUrl = url;
|
|
2193
2204
|
if (params) {
|
|
2194
2205
|
const searchParams = new URLSearchParams();
|
|
@@ -2221,11 +2232,21 @@ var FetchAdapter2 = class {
|
|
|
2221
2232
|
// Include Django session cookies
|
|
2222
2233
|
});
|
|
2223
2234
|
let data = null;
|
|
2224
|
-
const contentType = response.headers.get("content-type");
|
|
2225
|
-
if (response.status !== 204
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2235
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
2236
|
+
if (response.status !== 204) {
|
|
2237
|
+
if (responseType === "blob") {
|
|
2238
|
+
data = await response.blob();
|
|
2239
|
+
} else if (responseType === "text") {
|
|
2240
|
+
data = await response.text();
|
|
2241
|
+
} else if (responseType === "json") {
|
|
2242
|
+
data = await response.json();
|
|
2243
|
+
} else if (contentType.includes("application/json")) {
|
|
2244
|
+
data = await response.json();
|
|
2245
|
+
} else if (contentType.startsWith("text/")) {
|
|
2246
|
+
data = await response.text();
|
|
2247
|
+
} else {
|
|
2248
|
+
data = await response.blob();
|
|
2249
|
+
}
|
|
2229
2250
|
}
|
|
2230
2251
|
const responseHeaders = {};
|
|
2231
2252
|
response.headers.forEach((value, key) => {
|
|
@@ -2655,7 +2676,8 @@ var APIClient2 = class {
|
|
|
2655
2676
|
params: options?.params,
|
|
2656
2677
|
body: options?.body,
|
|
2657
2678
|
formData: options?.formData,
|
|
2658
|
-
binaryBody: options?.binaryBody
|
|
2679
|
+
binaryBody: options?.binaryBody,
|
|
2680
|
+
responseType: options?.responseType
|
|
2659
2681
|
});
|
|
2660
2682
|
const duration = Date.now() - startTime;
|
|
2661
2683
|
if (response.status >= 400) {
|