@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.
- 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/clients.d.ts
CHANGED
|
@@ -45,24 +45,15 @@ declare namespace enums {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* Response model (includes read-only fields).
|
|
51
|
-
*/
|
|
52
|
-
interface OAuthProvidersResponse$1 {
|
|
53
|
-
/** List of available OAuth providers */
|
|
54
|
-
providers: Array<Record<string, any>>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Response with OAuth authorization URL.
|
|
48
|
+
* Request to start OAuth flow.
|
|
58
49
|
*
|
|
59
|
-
*
|
|
50
|
+
* Request model (no read-only fields).
|
|
60
51
|
*/
|
|
61
|
-
interface
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
|
|
52
|
+
interface OAuthAuthorizeRequestRequest$1 {
|
|
53
|
+
/** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
|
|
54
|
+
redirect_uri?: string;
|
|
55
|
+
/** Optional source URL for registration tracking */
|
|
56
|
+
source_url?: string;
|
|
66
57
|
}
|
|
67
58
|
/**
|
|
68
59
|
* Request to complete OAuth flow (callback handler).
|
|
@@ -77,6 +68,32 @@ interface OAuthCallbackRequestRequest$1 {
|
|
|
77
68
|
/** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
|
|
78
69
|
redirect_uri?: string;
|
|
79
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Response with JWT tokens after OAuth authentication. When 2FA is required: -
|
|
73
|
+
* requires_2fa: True - session_id: UUID of 2FA verification session -
|
|
74
|
+
* access/refresh/user: null When 2FA is not required: - requires_2fa: False -
|
|
75
|
+
* session_id: null - access/refresh/user: populated
|
|
76
|
+
*
|
|
77
|
+
* Response model (includes read-only fields).
|
|
78
|
+
*/
|
|
79
|
+
interface OAuthTokenResponse$1 {
|
|
80
|
+
/** True if 2FA verification is required */
|
|
81
|
+
requires_2fa?: boolean;
|
|
82
|
+
/** 2FA session ID (only when requires_2fa=True) */
|
|
83
|
+
session_id?: string | null;
|
|
84
|
+
/** JWT access token (null when requires_2fa=True) */
|
|
85
|
+
access?: string | null;
|
|
86
|
+
/** JWT refresh token (null when requires_2fa=True) */
|
|
87
|
+
refresh?: string | null;
|
|
88
|
+
/** Authenticated user info (null when requires_2fa=True) */
|
|
89
|
+
user?: Record<string, any> | null;
|
|
90
|
+
/** True if a new user was created during this OAuth flow */
|
|
91
|
+
is_new_user: boolean;
|
|
92
|
+
/** True if a new OAuth connection was created */
|
|
93
|
+
is_new_connection: boolean;
|
|
94
|
+
/** True if user should be prompted to enable 2FA */
|
|
95
|
+
should_prompt_2fa?: boolean;
|
|
96
|
+
}
|
|
80
97
|
/**
|
|
81
98
|
* Serializer for OAuth connection info (user-facing).
|
|
82
99
|
*
|
|
@@ -101,41 +118,15 @@ interface OAuthConnection$1 {
|
|
|
101
118
|
last_login_at: string;
|
|
102
119
|
}
|
|
103
120
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* Request model (no read-only fields).
|
|
107
|
-
*/
|
|
108
|
-
interface OAuthAuthorizeRequestRequest$1 {
|
|
109
|
-
/** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
|
|
110
|
-
redirect_uri?: string;
|
|
111
|
-
/** Optional source URL for registration tracking */
|
|
112
|
-
source_url?: string;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Response with JWT tokens after OAuth authentication. When 2FA is required: -
|
|
116
|
-
* requires_2fa: True - session_id: UUID of 2FA verification session -
|
|
117
|
-
* access/refresh/user: null When 2FA is not required: - requires_2fa: False -
|
|
118
|
-
* session_id: null - access/refresh/user: populated
|
|
121
|
+
* Response with OAuth authorization URL.
|
|
119
122
|
*
|
|
120
123
|
* Response model (includes read-only fields).
|
|
121
124
|
*/
|
|
122
|
-
interface
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
/** JWT access token (null when requires_2fa=True) */
|
|
128
|
-
access?: string | null;
|
|
129
|
-
/** JWT refresh token (null when requires_2fa=True) */
|
|
130
|
-
refresh?: string | null;
|
|
131
|
-
/** Authenticated user info (null when requires_2fa=True) */
|
|
132
|
-
user?: Record<string, any> | null;
|
|
133
|
-
/** True if a new user was created during this OAuth flow */
|
|
134
|
-
is_new_user: boolean;
|
|
135
|
-
/** True if a new OAuth connection was created */
|
|
136
|
-
is_new_connection: boolean;
|
|
137
|
-
/** True if user should be prompted to enable 2FA */
|
|
138
|
-
should_prompt_2fa?: boolean;
|
|
125
|
+
interface OAuthAuthorizeResponse$1 {
|
|
126
|
+
/** Full URL to redirect user to OAuth provider */
|
|
127
|
+
authorization_url: string;
|
|
128
|
+
/** State token for CSRF protection. Store this and verify on callback. */
|
|
129
|
+
state: string;
|
|
139
130
|
}
|
|
140
131
|
/**
|
|
141
132
|
* Request to disconnect OAuth provider.
|
|
@@ -148,6 +139,15 @@ interface OAuthDisconnectRequestRequest$1 {
|
|
|
148
139
|
* `github` - GitHub */
|
|
149
140
|
provider: OAuthConnectionProvider;
|
|
150
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Response with available OAuth providers.
|
|
144
|
+
*
|
|
145
|
+
* Response model (includes read-only fields).
|
|
146
|
+
*/
|
|
147
|
+
interface OAuthProvidersResponse$1 {
|
|
148
|
+
/** List of available OAuth providers */
|
|
149
|
+
providers: Array<Record<string, any>>;
|
|
150
|
+
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
153
|
* API endpoints for Oauth.
|
|
@@ -194,7 +194,7 @@ declare class Oauth {
|
|
|
194
194
|
*
|
|
195
195
|
* Request model (no read-only fields).
|
|
196
196
|
*/
|
|
197
|
-
interface
|
|
197
|
+
interface PatchedUserProfileUpdateRequest$1 {
|
|
198
198
|
first_name?: string;
|
|
199
199
|
last_name?: string;
|
|
200
200
|
company?: string;
|
|
@@ -203,17 +203,23 @@ interface UserProfileUpdateRequest$1 {
|
|
|
203
203
|
language?: string;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
* Serializer for updating user profile.
|
|
207
206
|
*
|
|
208
207
|
* Request model (no read-only fields).
|
|
209
208
|
*/
|
|
210
|
-
interface
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
209
|
+
interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
210
|
+
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
211
|
+
avatar: File | Blob;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Response serializer for account deletion.
|
|
215
|
+
*
|
|
216
|
+
* Response model (includes read-only fields).
|
|
217
|
+
*/
|
|
218
|
+
interface AccountDeleteResponse$1 {
|
|
219
|
+
/** Whether the account was successfully deleted */
|
|
220
|
+
success: boolean;
|
|
221
|
+
/** Human-readable message about the deletion */
|
|
222
|
+
message: string;
|
|
217
223
|
}
|
|
218
224
|
/**
|
|
219
225
|
* Serializer for user details.
|
|
@@ -246,23 +252,17 @@ interface User$2 {
|
|
|
246
252
|
centrifugo: CentrifugoToken$2 | null;
|
|
247
253
|
}
|
|
248
254
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* Response model (includes read-only fields).
|
|
252
|
-
*/
|
|
253
|
-
interface AccountDeleteResponse$1 {
|
|
254
|
-
/** Whether the account was successfully deleted */
|
|
255
|
-
success: boolean;
|
|
256
|
-
/** Human-readable message about the deletion */
|
|
257
|
-
message: string;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
255
|
+
* Serializer for updating user profile.
|
|
260
256
|
*
|
|
261
257
|
* Request model (no read-only fields).
|
|
262
258
|
*/
|
|
263
|
-
interface
|
|
264
|
-
|
|
265
|
-
|
|
259
|
+
interface UserProfileUpdateRequest$1 {
|
|
260
|
+
first_name?: string;
|
|
261
|
+
last_name?: string;
|
|
262
|
+
company?: string;
|
|
263
|
+
phone?: string;
|
|
264
|
+
position?: string;
|
|
265
|
+
language?: string;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* Nested serializer for Centrifugo WebSocket connection token.
|
|
@@ -337,18 +337,6 @@ declare class UserProfile {
|
|
|
337
337
|
accountsProfileUpdatePartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
/**
|
|
341
|
-
* Serializer for OTP verification.
|
|
342
|
-
*
|
|
343
|
-
* Request model (no read-only fields).
|
|
344
|
-
*/
|
|
345
|
-
interface OTPVerifyRequest$1 {
|
|
346
|
-
/** Email address used for OTP request */
|
|
347
|
-
identifier: string;
|
|
348
|
-
otp: string;
|
|
349
|
-
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
350
|
-
source_url?: string;
|
|
351
|
-
}
|
|
352
340
|
/**
|
|
353
341
|
* OTP verification response. When 2FA is required: - requires_2fa: True -
|
|
354
342
|
* session_id: UUID of 2FA verification session - refresh/access/user: null
|
|
@@ -371,24 +359,36 @@ interface OTPVerifyResponse$1 {
|
|
|
371
359
|
should_prompt_2fa?: boolean;
|
|
372
360
|
}
|
|
373
361
|
/**
|
|
374
|
-
*
|
|
362
|
+
* OTP request response.
|
|
363
|
+
*
|
|
364
|
+
* Response model (includes read-only fields).
|
|
365
|
+
*/
|
|
366
|
+
interface OTPRequestResponse$1 {
|
|
367
|
+
/** Success message */
|
|
368
|
+
message: string;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Serializer for OTP verification.
|
|
375
372
|
*
|
|
376
373
|
* Request model (no read-only fields).
|
|
377
374
|
*/
|
|
378
|
-
interface
|
|
379
|
-
/** Email address for OTP
|
|
375
|
+
interface OTPVerifyRequest$1 {
|
|
376
|
+
/** Email address used for OTP request */
|
|
380
377
|
identifier: string;
|
|
381
|
-
|
|
378
|
+
otp: string;
|
|
379
|
+
/** Source URL for tracking login (e.g., https://my.djangocfg.com) */
|
|
382
380
|
source_url?: string;
|
|
383
381
|
}
|
|
384
382
|
/**
|
|
385
|
-
* OTP request
|
|
383
|
+
* Serializer for OTP request.
|
|
386
384
|
*
|
|
387
|
-
*
|
|
385
|
+
* Request model (no read-only fields).
|
|
388
386
|
*/
|
|
389
|
-
interface
|
|
390
|
-
/**
|
|
391
|
-
|
|
387
|
+
interface OTPRequestRequest$1 {
|
|
388
|
+
/** Email address for OTP delivery */
|
|
389
|
+
identifier: string;
|
|
390
|
+
/** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
|
|
391
|
+
source_url?: string;
|
|
392
392
|
}
|
|
393
393
|
/**
|
|
394
394
|
* Serializer for user details.
|
|
@@ -1630,15 +1630,6 @@ declare class API$1 {
|
|
|
1630
1630
|
getSchemaPath(): string;
|
|
1631
1631
|
}
|
|
1632
1632
|
|
|
1633
|
-
/**
|
|
1634
|
-
* Serializer for regenerating backup codes.
|
|
1635
|
-
*
|
|
1636
|
-
* Request model (no read-only fields).
|
|
1637
|
-
*/
|
|
1638
|
-
interface BackupCodesRegenerateRequest$1 {
|
|
1639
|
-
/** TOTP code for verification */
|
|
1640
|
-
code: string;
|
|
1641
|
-
}
|
|
1642
1633
|
/**
|
|
1643
1634
|
* Response serializer for backup codes regeneration.
|
|
1644
1635
|
*
|
|
@@ -1663,6 +1654,15 @@ interface BackupCodesStatus$1 {
|
|
|
1663
1654
|
/** Warning if running low on codes */
|
|
1664
1655
|
warning?: string | null;
|
|
1665
1656
|
}
|
|
1657
|
+
/**
|
|
1658
|
+
* Serializer for regenerating backup codes.
|
|
1659
|
+
*
|
|
1660
|
+
* Request model (no read-only fields).
|
|
1661
|
+
*/
|
|
1662
|
+
interface BackupCodesRegenerateRequest$1 {
|
|
1663
|
+
/** TOTP code for verification */
|
|
1664
|
+
code: string;
|
|
1665
|
+
}
|
|
1666
1666
|
|
|
1667
1667
|
/**
|
|
1668
1668
|
* API endpoints for Backup Codes.
|
|
@@ -1692,15 +1692,6 @@ declare enum DeviceListStatus {
|
|
|
1692
1692
|
DISABLED = "disabled"
|
|
1693
1693
|
}
|
|
1694
1694
|
|
|
1695
|
-
/**
|
|
1696
|
-
* Response serializer for device list endpoint.
|
|
1697
|
-
*
|
|
1698
|
-
* Response model (includes read-only fields).
|
|
1699
|
-
*/
|
|
1700
|
-
interface DeviceListResponse$1 {
|
|
1701
|
-
devices: Array<DeviceList$1>;
|
|
1702
|
-
has_2fa_enabled: boolean;
|
|
1703
|
-
}
|
|
1704
1695
|
/**
|
|
1705
1696
|
* Serializer for completely disabling 2FA.
|
|
1706
1697
|
*
|
|
@@ -1710,6 +1701,15 @@ interface DisableRequest$1 {
|
|
|
1710
1701
|
/** TOTP code for verification */
|
|
1711
1702
|
code: string;
|
|
1712
1703
|
}
|
|
1704
|
+
/**
|
|
1705
|
+
* Response serializer for device list endpoint.
|
|
1706
|
+
*
|
|
1707
|
+
* Response model (includes read-only fields).
|
|
1708
|
+
*/
|
|
1709
|
+
interface DeviceListResponse$1 {
|
|
1710
|
+
devices: Array<DeviceList$1>;
|
|
1711
|
+
has_2fa_enabled: boolean;
|
|
1712
|
+
}
|
|
1713
1713
|
/**
|
|
1714
1714
|
* Serializer for listing TOTP devices.
|
|
1715
1715
|
*
|
|
@@ -1759,23 +1759,6 @@ interface ConfirmSetupRequest$1 {
|
|
|
1759
1759
|
/** 6-digit TOTP code from authenticator app */
|
|
1760
1760
|
code: string;
|
|
1761
1761
|
}
|
|
1762
|
-
/**
|
|
1763
|
-
* Response serializer for setup initiation.
|
|
1764
|
-
*
|
|
1765
|
-
* Response model (includes read-only fields).
|
|
1766
|
-
*/
|
|
1767
|
-
interface SetupResponse$1 {
|
|
1768
|
-
/** Device ID to use for confirmation */
|
|
1769
|
-
device_id: string;
|
|
1770
|
-
/** Base32-encoded TOTP secret (for manual entry) */
|
|
1771
|
-
secret: string;
|
|
1772
|
-
/** otpauth:// URI for QR code generation */
|
|
1773
|
-
provisioning_uri: string;
|
|
1774
|
-
/** Base64-encoded QR code image (data URI) */
|
|
1775
|
-
qr_code_base64: string;
|
|
1776
|
-
/** Seconds until setup expires (typically 600 = 10 minutes) */
|
|
1777
|
-
expires_in: number;
|
|
1778
|
-
}
|
|
1779
1762
|
/**
|
|
1780
1763
|
* Serializer for starting 2FA setup.
|
|
1781
1764
|
*
|
|
@@ -1797,6 +1780,23 @@ interface ConfirmSetupResponse$1 {
|
|
|
1797
1780
|
/** Warning message about backup codes */
|
|
1798
1781
|
backup_codes_warning: string;
|
|
1799
1782
|
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Response serializer for setup initiation.
|
|
1785
|
+
*
|
|
1786
|
+
* Response model (includes read-only fields).
|
|
1787
|
+
*/
|
|
1788
|
+
interface SetupResponse$1 {
|
|
1789
|
+
/** Device ID to use for confirmation */
|
|
1790
|
+
device_id: string;
|
|
1791
|
+
/** Base32-encoded TOTP secret (for manual entry) */
|
|
1792
|
+
secret: string;
|
|
1793
|
+
/** otpauth:// URI for QR code generation */
|
|
1794
|
+
provisioning_uri: string;
|
|
1795
|
+
/** Base64-encoded QR code image (data URI) */
|
|
1796
|
+
qr_code_base64: string;
|
|
1797
|
+
/** Seconds until setup expires (typically 600 = 10 minutes) */
|
|
1798
|
+
expires_in: number;
|
|
1799
|
+
}
|
|
1800
1800
|
|
|
1801
1801
|
/**
|
|
1802
1802
|
* API endpoints for TOTP Setup.
|
|
@@ -1816,6 +1816,23 @@ declare class TotpSetup {
|
|
|
1816
1816
|
confirmCreate(data: ConfirmSetupRequest$1): Promise<ConfirmSetupResponse$1>;
|
|
1817
1817
|
}
|
|
1818
1818
|
|
|
1819
|
+
/**
|
|
1820
|
+
* Response serializer for successful 2FA verification.
|
|
1821
|
+
*
|
|
1822
|
+
* Response model (includes read-only fields).
|
|
1823
|
+
*/
|
|
1824
|
+
interface VerifyResponse$1 {
|
|
1825
|
+
message: string;
|
|
1826
|
+
/** JWT access token */
|
|
1827
|
+
access_token: string;
|
|
1828
|
+
/** JWT refresh token */
|
|
1829
|
+
refresh_token: string;
|
|
1830
|
+
user: TotpVerifyUser$1;
|
|
1831
|
+
/** Number of remaining backup codes (if backup code was used) */
|
|
1832
|
+
remaining_backup_codes?: number;
|
|
1833
|
+
/** Warning message (e.g., low backup codes) */
|
|
1834
|
+
warning?: string;
|
|
1835
|
+
}
|
|
1819
1836
|
/**
|
|
1820
1837
|
* Serializer for TOTP code verification during login.
|
|
1821
1838
|
*
|
|
@@ -1838,23 +1855,6 @@ interface VerifyBackupRequest$1 {
|
|
|
1838
1855
|
/** 8-character backup recovery code */
|
|
1839
1856
|
backup_code: string;
|
|
1840
1857
|
}
|
|
1841
|
-
/**
|
|
1842
|
-
* Response serializer for successful 2FA verification.
|
|
1843
|
-
*
|
|
1844
|
-
* Response model (includes read-only fields).
|
|
1845
|
-
*/
|
|
1846
|
-
interface VerifyResponse$1 {
|
|
1847
|
-
message: string;
|
|
1848
|
-
/** JWT access token */
|
|
1849
|
-
access_token: string;
|
|
1850
|
-
/** JWT refresh token */
|
|
1851
|
-
refresh_token: string;
|
|
1852
|
-
user: TotpVerifyUser$1;
|
|
1853
|
-
/** Number of remaining backup codes (if backup code was used) */
|
|
1854
|
-
remaining_backup_codes?: number;
|
|
1855
|
-
/** Warning message (e.g., low backup codes) */
|
|
1856
|
-
warning?: string;
|
|
1857
|
-
}
|
|
1858
1858
|
/**
|
|
1859
1859
|
* User data returned after 2FA verification.
|
|
1860
1860
|
*
|
package/dist/clients.mjs
CHANGED
|
@@ -199,7 +199,7 @@ var FetchAdapter = class {
|
|
|
199
199
|
__name(this, "FetchAdapter");
|
|
200
200
|
}
|
|
201
201
|
async request(request) {
|
|
202
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
202
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
203
203
|
let finalUrl = url;
|
|
204
204
|
if (params) {
|
|
205
205
|
const searchParams = new URLSearchParams();
|
|
@@ -232,11 +232,21 @@ var FetchAdapter = class {
|
|
|
232
232
|
// Include Django session cookies
|
|
233
233
|
});
|
|
234
234
|
let data = null;
|
|
235
|
-
const contentType = response.headers.get("content-type");
|
|
236
|
-
if (response.status !== 204
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
235
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
236
|
+
if (response.status !== 204) {
|
|
237
|
+
if (responseType === "blob") {
|
|
238
|
+
data = await response.blob();
|
|
239
|
+
} else if (responseType === "text") {
|
|
240
|
+
data = await response.text();
|
|
241
|
+
} else if (responseType === "json") {
|
|
242
|
+
data = await response.json();
|
|
243
|
+
} else if (contentType.includes("application/json")) {
|
|
244
|
+
data = await response.json();
|
|
245
|
+
} else if (contentType.startsWith("text/")) {
|
|
246
|
+
data = await response.text();
|
|
247
|
+
} else {
|
|
248
|
+
data = await response.blob();
|
|
249
|
+
}
|
|
240
250
|
}
|
|
241
251
|
const responseHeaders = {};
|
|
242
252
|
response.headers.forEach((value, key) => {
|
|
@@ -672,7 +682,8 @@ var APIClient = class {
|
|
|
672
682
|
params: options?.params,
|
|
673
683
|
body: options?.body,
|
|
674
684
|
formData: options?.formData,
|
|
675
|
-
binaryBody: options?.binaryBody
|
|
685
|
+
binaryBody: options?.binaryBody,
|
|
686
|
+
responseType: options?.responseType
|
|
676
687
|
});
|
|
677
688
|
const duration = Date.now() - startTime;
|
|
678
689
|
if (response.status >= 400) {
|
|
@@ -1883,7 +1894,7 @@ var FetchAdapter2 = class {
|
|
|
1883
1894
|
__name(this, "FetchAdapter");
|
|
1884
1895
|
}
|
|
1885
1896
|
async request(request) {
|
|
1886
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
1897
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
1887
1898
|
let finalUrl = url;
|
|
1888
1899
|
if (params) {
|
|
1889
1900
|
const searchParams = new URLSearchParams();
|
|
@@ -1916,11 +1927,21 @@ var FetchAdapter2 = class {
|
|
|
1916
1927
|
// Include Django session cookies
|
|
1917
1928
|
});
|
|
1918
1929
|
let data = null;
|
|
1919
|
-
const contentType = response.headers.get("content-type");
|
|
1920
|
-
if (response.status !== 204
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1930
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
1931
|
+
if (response.status !== 204) {
|
|
1932
|
+
if (responseType === "blob") {
|
|
1933
|
+
data = await response.blob();
|
|
1934
|
+
} else if (responseType === "text") {
|
|
1935
|
+
data = await response.text();
|
|
1936
|
+
} else if (responseType === "json") {
|
|
1937
|
+
data = await response.json();
|
|
1938
|
+
} else if (contentType.includes("application/json")) {
|
|
1939
|
+
data = await response.json();
|
|
1940
|
+
} else if (contentType.startsWith("text/")) {
|
|
1941
|
+
data = await response.text();
|
|
1942
|
+
} else {
|
|
1943
|
+
data = await response.blob();
|
|
1944
|
+
}
|
|
1924
1945
|
}
|
|
1925
1946
|
const responseHeaders = {};
|
|
1926
1947
|
response.headers.forEach((value, key) => {
|
|
@@ -2350,7 +2371,8 @@ var APIClient2 = class {
|
|
|
2350
2371
|
params: options?.params,
|
|
2351
2372
|
body: options?.body,
|
|
2352
2373
|
formData: options?.formData,
|
|
2353
|
-
binaryBody: options?.binaryBody
|
|
2374
|
+
binaryBody: options?.binaryBody,
|
|
2375
|
+
responseType: options?.responseType
|
|
2354
2376
|
});
|
|
2355
2377
|
const duration = Date.now() - startTime;
|
|
2356
2378
|
if (response.status >= 400) {
|
|
@@ -2902,7 +2924,7 @@ var FetchAdapter3 = class {
|
|
|
2902
2924
|
__name(this, "FetchAdapter");
|
|
2903
2925
|
}
|
|
2904
2926
|
async request(request) {
|
|
2905
|
-
const { method, url, headers, body, params, formData, binaryBody } = request;
|
|
2927
|
+
const { method, url, headers, body, params, formData, binaryBody, responseType } = request;
|
|
2906
2928
|
let finalUrl = url;
|
|
2907
2929
|
if (params) {
|
|
2908
2930
|
const searchParams = new URLSearchParams();
|
|
@@ -2935,11 +2957,21 @@ var FetchAdapter3 = class {
|
|
|
2935
2957
|
// Include Django session cookies
|
|
2936
2958
|
});
|
|
2937
2959
|
let data = null;
|
|
2938
|
-
const contentType = response.headers.get("content-type");
|
|
2939
|
-
if (response.status !== 204
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2960
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
2961
|
+
if (response.status !== 204) {
|
|
2962
|
+
if (responseType === "blob") {
|
|
2963
|
+
data = await response.blob();
|
|
2964
|
+
} else if (responseType === "text") {
|
|
2965
|
+
data = await response.text();
|
|
2966
|
+
} else if (responseType === "json") {
|
|
2967
|
+
data = await response.json();
|
|
2968
|
+
} else if (contentType.includes("application/json")) {
|
|
2969
|
+
data = await response.json();
|
|
2970
|
+
} else if (contentType.startsWith("text/")) {
|
|
2971
|
+
data = await response.text();
|
|
2972
|
+
} else {
|
|
2973
|
+
data = await response.blob();
|
|
2974
|
+
}
|
|
2943
2975
|
}
|
|
2944
2976
|
const responseHeaders = {};
|
|
2945
2977
|
response.headers.forEach((value, key) => {
|
|
@@ -3377,7 +3409,8 @@ var APIClient3 = class {
|
|
|
3377
3409
|
params: options?.params,
|
|
3378
3410
|
body: options?.body,
|
|
3379
3411
|
formData: options?.formData,
|
|
3380
|
-
binaryBody: options?.binaryBody
|
|
3412
|
+
binaryBody: options?.binaryBody,
|
|
3413
|
+
responseType: options?.responseType
|
|
3381
3414
|
});
|
|
3382
3415
|
const duration = Date.now() - startTime;
|
|
3383
3416
|
if (response.status >= 400) {
|