@djangocfg/api 2.1.192 → 2.1.193
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 +37 -3
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +37 -3
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +102 -5
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +4 -0
- package/dist/auth.d.ts +4 -0
- package/dist/auth.mjs +102 -5
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +107 -10
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +47 -0
- package/dist/clients.d.ts +47 -0
- package/dist/clients.mjs +107 -10
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +37 -3
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +20 -0
- package/dist/hooks.d.ts +20 -0
- package/dist/hooks.mjs +37 -3
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +69 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.mjs +69 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/generated/cfg_accounts/_utils/fetchers/accounts.ts +1 -0
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts +1 -0
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +1 -0
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +1 -0
- package/src/generated/cfg_accounts/_utils/fetchers/index.ts +1 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts.ts +1 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts__auth.ts +1 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +1 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +1 -0
- package/src/generated/cfg_accounts/_utils/hooks/index.ts +1 -0
- package/src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts +1 -0
- package/src/generated/cfg_accounts/_utils/schemas/User.schema.ts +1 -0
- package/src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts +1 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts/client.ts +1 -0
- package/src/generated/cfg_accounts/accounts/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts/models.ts +2 -0
- package/src/generated/cfg_accounts/accounts__auth/client.ts +1 -0
- package/src/generated/cfg_accounts/accounts__auth/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts__auth/models.ts +1 -0
- package/src/generated/cfg_accounts/accounts__oauth/client.ts +1 -0
- package/src/generated/cfg_accounts/accounts__oauth/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts__oauth/models.ts +1 -0
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +1 -0
- package/src/generated/cfg_accounts/accounts__user_profile/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +4 -0
- package/src/generated/cfg_accounts/api-instance.ts +1 -0
- package/src/generated/cfg_accounts/enums.ts +1 -0
- package/src/generated/cfg_accounts/errors.ts +1 -0
- package/src/generated/cfg_accounts/http.ts +1 -0
- package/src/generated/cfg_accounts/index.ts +37 -0
- package/src/generated/cfg_accounts/logger.ts +1 -0
- package/src/generated/cfg_accounts/retry.ts +1 -0
- package/src/generated/cfg_accounts/schema.json +12 -0
- package/src/generated/cfg_accounts/storage.ts +1 -0
- package/src/generated/cfg_accounts/validation-events.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/fetchers/index.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts +5 -4
- package/src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/hooks/index.ts +1 -0
- package/src/generated/cfg_centrifugo/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_centrifugo/api-instance.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/client.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/index.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/models.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/client.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/index.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/client.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/index.ts +1 -0
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +1 -0
- package/src/generated/cfg_centrifugo/errors.ts +1 -0
- package/src/generated/cfg_centrifugo/http.ts +1 -0
- package/src/generated/cfg_centrifugo/index.ts +37 -0
- package/src/generated/cfg_centrifugo/logger.ts +1 -0
- package/src/generated/cfg_centrifugo/retry.ts +1 -0
- package/src/generated/cfg_centrifugo/storage.ts +1 -0
- package/src/generated/cfg_centrifugo/validation-events.ts +1 -0
- package/src/generated/cfg_totp/_utils/fetchers/index.ts +1 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp.ts +1 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts +1 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +1 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__totp_setup.ts +1 -0
- package/src/generated/cfg_totp/_utils/fetchers/totp__totp_verification.ts +1 -0
- package/src/generated/cfg_totp/_utils/hooks/index.ts +1 -0
- package/src/generated/cfg_totp/_utils/hooks/totp.ts +1 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__backup_codes.ts +1 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +2 -1
- package/src/generated/cfg_totp/_utils/hooks/totp__totp_setup.ts +1 -0
- package/src/generated/cfg_totp/_utils/hooks/totp__totp_verification.ts +1 -0
- package/src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts +1 -0
- package/src/generated/cfg_totp/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_totp/api-instance.ts +1 -0
- package/src/generated/cfg_totp/enums.ts +1 -0
- package/src/generated/cfg_totp/errors.ts +1 -0
- package/src/generated/cfg_totp/http.ts +1 -0
- package/src/generated/cfg_totp/index.ts +37 -0
- package/src/generated/cfg_totp/logger.ts +1 -0
- package/src/generated/cfg_totp/retry.ts +1 -0
- package/src/generated/cfg_totp/schema.json +4 -0
- package/src/generated/cfg_totp/storage.ts +1 -0
- package/src/generated/cfg_totp/totp/client.ts +1 -0
- package/src/generated/cfg_totp/totp/index.ts +1 -0
- package/src/generated/cfg_totp/totp/models.ts +1 -0
- package/src/generated/cfg_totp/totp__backup_codes/client.ts +1 -0
- package/src/generated/cfg_totp/totp__backup_codes/index.ts +1 -0
- package/src/generated/cfg_totp/totp__backup_codes/models.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_management/client.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_management/index.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_management/models.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_setup/client.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_setup/index.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_setup/models.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_verification/client.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_verification/index.ts +1 -0
- package/src/generated/cfg_totp/totp__totp_verification/models.ts +2 -0
- package/src/generated/cfg_totp/validation-events.ts +1 -0
package/dist/index.d.cts
CHANGED
|
@@ -214,6 +214,7 @@ interface User$2 {
|
|
|
214
214
|
company?: string;
|
|
215
215
|
phone?: string;
|
|
216
216
|
position?: string;
|
|
217
|
+
language?: string;
|
|
217
218
|
avatar?: string | null;
|
|
218
219
|
/** Designates whether the user can log into this admin site. */
|
|
219
220
|
is_staff: boolean;
|
|
@@ -254,6 +255,7 @@ interface UserProfileUpdateRequest$1 {
|
|
|
254
255
|
company?: string;
|
|
255
256
|
phone?: string;
|
|
256
257
|
position?: string;
|
|
258
|
+
language?: string;
|
|
257
259
|
}
|
|
258
260
|
/**
|
|
259
261
|
* Serializer for updating user profile.
|
|
@@ -266,6 +268,7 @@ interface PatchedUserProfileUpdateRequest$1 {
|
|
|
266
268
|
company?: string;
|
|
267
269
|
phone?: string;
|
|
268
270
|
position?: string;
|
|
271
|
+
language?: string;
|
|
269
272
|
}
|
|
270
273
|
/**
|
|
271
274
|
* Nested serializer for Centrifugo WebSocket connection token.
|
|
@@ -435,6 +438,7 @@ interface User$1 {
|
|
|
435
438
|
company?: string;
|
|
436
439
|
phone?: string;
|
|
437
440
|
position?: string;
|
|
441
|
+
language?: string;
|
|
438
442
|
avatar?: string | null;
|
|
439
443
|
/** Designates whether the user can log into this admin site. */
|
|
440
444
|
is_staff: boolean;
|
|
@@ -1211,6 +1215,7 @@ declare const OTPVerifyResponseSchema: z.ZodObject<{
|
|
|
1211
1215
|
company: z.ZodOptional<z.ZodString>;
|
|
1212
1216
|
phone: z.ZodOptional<z.ZodString>;
|
|
1213
1217
|
position: z.ZodOptional<z.ZodString>;
|
|
1218
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1214
1219
|
avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
|
|
1215
1220
|
is_staff: z.ZodBoolean;
|
|
1216
1221
|
is_superuser: z.ZodBoolean;
|
|
@@ -1247,6 +1252,7 @@ declare const PatchedUserProfileUpdateRequestSchema: z.ZodObject<{
|
|
|
1247
1252
|
company: z.ZodOptional<z.ZodString>;
|
|
1248
1253
|
phone: z.ZodOptional<z.ZodString>;
|
|
1249
1254
|
position: z.ZodOptional<z.ZodString>;
|
|
1255
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1250
1256
|
}, z.core.$strip>;
|
|
1251
1257
|
/**
|
|
1252
1258
|
* Infer TypeScript type from Zod schema
|
|
@@ -1303,6 +1309,7 @@ declare const UserSchema: z.ZodObject<{
|
|
|
1303
1309
|
company: z.ZodOptional<z.ZodString>;
|
|
1304
1310
|
phone: z.ZodOptional<z.ZodString>;
|
|
1305
1311
|
position: z.ZodOptional<z.ZodString>;
|
|
1312
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1306
1313
|
avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
|
|
1307
1314
|
is_staff: z.ZodBoolean;
|
|
1308
1315
|
is_superuser: z.ZodBoolean;
|
|
@@ -1337,6 +1344,7 @@ declare const UserProfileUpdateRequestSchema: z.ZodObject<{
|
|
|
1337
1344
|
company: z.ZodOptional<z.ZodString>;
|
|
1338
1345
|
phone: z.ZodOptional<z.ZodString>;
|
|
1339
1346
|
position: z.ZodOptional<z.ZodString>;
|
|
1347
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1340
1348
|
}, z.core.$strip>;
|
|
1341
1349
|
/**
|
|
1342
1350
|
* Infer TypeScript type from Zod schema
|
|
@@ -1828,12 +1836,15 @@ interface APIOptions {
|
|
|
1828
1836
|
retryConfig?: RetryConfig;
|
|
1829
1837
|
/** Logger configuration */
|
|
1830
1838
|
loggerConfig?: Partial<LoggerConfig>;
|
|
1839
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
1840
|
+
locale?: string;
|
|
1831
1841
|
}
|
|
1832
1842
|
declare class API {
|
|
1833
1843
|
private baseUrl;
|
|
1834
1844
|
private _client;
|
|
1835
1845
|
private _token;
|
|
1836
1846
|
private _refreshToken;
|
|
1847
|
+
private _locale;
|
|
1837
1848
|
private storage;
|
|
1838
1849
|
private options?;
|
|
1839
1850
|
auth: Auth;
|
|
@@ -1875,6 +1886,15 @@ declare class API {
|
|
|
1875
1886
|
* Get current base URL
|
|
1876
1887
|
*/
|
|
1877
1888
|
getBaseUrl(): string;
|
|
1889
|
+
/**
|
|
1890
|
+
* Set locale for Accept-Language header
|
|
1891
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
1892
|
+
*/
|
|
1893
|
+
setLocale(locale: string | null): void;
|
|
1894
|
+
/**
|
|
1895
|
+
* Get current locale
|
|
1896
|
+
*/
|
|
1897
|
+
getLocale(): string | null;
|
|
1878
1898
|
/**
|
|
1879
1899
|
* Get OpenAPI schema path
|
|
1880
1900
|
* @returns Path to the OpenAPI schema JSON file
|
package/dist/index.d.ts
CHANGED
|
@@ -214,6 +214,7 @@ interface User$2 {
|
|
|
214
214
|
company?: string;
|
|
215
215
|
phone?: string;
|
|
216
216
|
position?: string;
|
|
217
|
+
language?: string;
|
|
217
218
|
avatar?: string | null;
|
|
218
219
|
/** Designates whether the user can log into this admin site. */
|
|
219
220
|
is_staff: boolean;
|
|
@@ -254,6 +255,7 @@ interface UserProfileUpdateRequest$1 {
|
|
|
254
255
|
company?: string;
|
|
255
256
|
phone?: string;
|
|
256
257
|
position?: string;
|
|
258
|
+
language?: string;
|
|
257
259
|
}
|
|
258
260
|
/**
|
|
259
261
|
* Serializer for updating user profile.
|
|
@@ -266,6 +268,7 @@ interface PatchedUserProfileUpdateRequest$1 {
|
|
|
266
268
|
company?: string;
|
|
267
269
|
phone?: string;
|
|
268
270
|
position?: string;
|
|
271
|
+
language?: string;
|
|
269
272
|
}
|
|
270
273
|
/**
|
|
271
274
|
* Nested serializer for Centrifugo WebSocket connection token.
|
|
@@ -435,6 +438,7 @@ interface User$1 {
|
|
|
435
438
|
company?: string;
|
|
436
439
|
phone?: string;
|
|
437
440
|
position?: string;
|
|
441
|
+
language?: string;
|
|
438
442
|
avatar?: string | null;
|
|
439
443
|
/** Designates whether the user can log into this admin site. */
|
|
440
444
|
is_staff: boolean;
|
|
@@ -1211,6 +1215,7 @@ declare const OTPVerifyResponseSchema: z.ZodObject<{
|
|
|
1211
1215
|
company: z.ZodOptional<z.ZodString>;
|
|
1212
1216
|
phone: z.ZodOptional<z.ZodString>;
|
|
1213
1217
|
position: z.ZodOptional<z.ZodString>;
|
|
1218
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1214
1219
|
avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
|
|
1215
1220
|
is_staff: z.ZodBoolean;
|
|
1216
1221
|
is_superuser: z.ZodBoolean;
|
|
@@ -1247,6 +1252,7 @@ declare const PatchedUserProfileUpdateRequestSchema: z.ZodObject<{
|
|
|
1247
1252
|
company: z.ZodOptional<z.ZodString>;
|
|
1248
1253
|
phone: z.ZodOptional<z.ZodString>;
|
|
1249
1254
|
position: z.ZodOptional<z.ZodString>;
|
|
1255
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1250
1256
|
}, z.core.$strip>;
|
|
1251
1257
|
/**
|
|
1252
1258
|
* Infer TypeScript type from Zod schema
|
|
@@ -1303,6 +1309,7 @@ declare const UserSchema: z.ZodObject<{
|
|
|
1303
1309
|
company: z.ZodOptional<z.ZodString>;
|
|
1304
1310
|
phone: z.ZodOptional<z.ZodString>;
|
|
1305
1311
|
position: z.ZodOptional<z.ZodString>;
|
|
1312
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1306
1313
|
avatar: z.ZodNullable<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
|
|
1307
1314
|
is_staff: z.ZodBoolean;
|
|
1308
1315
|
is_superuser: z.ZodBoolean;
|
|
@@ -1337,6 +1344,7 @@ declare const UserProfileUpdateRequestSchema: z.ZodObject<{
|
|
|
1337
1344
|
company: z.ZodOptional<z.ZodString>;
|
|
1338
1345
|
phone: z.ZodOptional<z.ZodString>;
|
|
1339
1346
|
position: z.ZodOptional<z.ZodString>;
|
|
1347
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1340
1348
|
}, z.core.$strip>;
|
|
1341
1349
|
/**
|
|
1342
1350
|
* Infer TypeScript type from Zod schema
|
|
@@ -1828,12 +1836,15 @@ interface APIOptions {
|
|
|
1828
1836
|
retryConfig?: RetryConfig;
|
|
1829
1837
|
/** Logger configuration */
|
|
1830
1838
|
loggerConfig?: Partial<LoggerConfig>;
|
|
1839
|
+
/** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */
|
|
1840
|
+
locale?: string;
|
|
1831
1841
|
}
|
|
1832
1842
|
declare class API {
|
|
1833
1843
|
private baseUrl;
|
|
1834
1844
|
private _client;
|
|
1835
1845
|
private _token;
|
|
1836
1846
|
private _refreshToken;
|
|
1847
|
+
private _locale;
|
|
1837
1848
|
private storage;
|
|
1838
1849
|
private options?;
|
|
1839
1850
|
auth: Auth;
|
|
@@ -1875,6 +1886,15 @@ declare class API {
|
|
|
1875
1886
|
* Get current base URL
|
|
1876
1887
|
*/
|
|
1877
1888
|
getBaseUrl(): string;
|
|
1889
|
+
/**
|
|
1890
|
+
* Set locale for Accept-Language header
|
|
1891
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
1892
|
+
*/
|
|
1893
|
+
setLocale(locale: string | null): void;
|
|
1894
|
+
/**
|
|
1895
|
+
* Get current locale
|
|
1896
|
+
*/
|
|
1897
|
+
getLocale(): string | null;
|
|
1878
1898
|
/**
|
|
1879
1899
|
* Get OpenAPI schema path
|
|
1880
1900
|
* @returns Path to the OpenAPI schema JSON file
|
package/dist/index.mjs
CHANGED
|
@@ -1143,6 +1143,7 @@ var UserSchema = z16.object({
|
|
|
1143
1143
|
company: z16.string().max(100).optional(),
|
|
1144
1144
|
phone: z16.string().max(20).optional(),
|
|
1145
1145
|
position: z16.string().max(100).optional(),
|
|
1146
|
+
language: z16.string().max(10).optional(),
|
|
1146
1147
|
avatar: z16.union([z16.url(), z16.literal("")]).nullable(),
|
|
1147
1148
|
is_staff: z16.boolean(),
|
|
1148
1149
|
is_superuser: z16.boolean(),
|
|
@@ -1169,7 +1170,8 @@ var PatchedUserProfileUpdateRequestSchema = z18.object({
|
|
|
1169
1170
|
last_name: z18.string().max(50).optional(),
|
|
1170
1171
|
company: z18.string().max(100).optional(),
|
|
1171
1172
|
phone: z18.string().max(20).optional(),
|
|
1172
|
-
position: z18.string().max(100).optional()
|
|
1173
|
+
position: z18.string().max(100).optional(),
|
|
1174
|
+
language: z18.string().max(10).optional()
|
|
1173
1175
|
});
|
|
1174
1176
|
|
|
1175
1177
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
|
|
@@ -1192,7 +1194,8 @@ var UserProfileUpdateRequestSchema = z21.object({
|
|
|
1192
1194
|
last_name: z21.string().max(50).optional(),
|
|
1193
1195
|
company: z21.string().max(100).optional(),
|
|
1194
1196
|
phone: z21.string().max(20).optional(),
|
|
1195
|
-
position: z21.string().max(100).optional()
|
|
1197
|
+
position: z21.string().max(100).optional(),
|
|
1198
|
+
language: z21.string().max(10).optional()
|
|
1196
1199
|
});
|
|
1197
1200
|
|
|
1198
1201
|
// src/generated/cfg_accounts/validation-events.ts
|
|
@@ -1913,14 +1916,30 @@ __name(partialUpdateAccountsProfileUpdatePartialUpdate, "partialUpdateAccountsPr
|
|
|
1913
1916
|
// src/generated/cfg_accounts/index.ts
|
|
1914
1917
|
var TOKEN_KEY = "auth_token";
|
|
1915
1918
|
var REFRESH_TOKEN_KEY = "refresh_token";
|
|
1919
|
+
function detectLocale() {
|
|
1920
|
+
try {
|
|
1921
|
+
if (typeof document !== "undefined") {
|
|
1922
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
1923
|
+
if (match) return match[1];
|
|
1924
|
+
}
|
|
1925
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
1926
|
+
return navigator.language;
|
|
1927
|
+
}
|
|
1928
|
+
} catch {
|
|
1929
|
+
}
|
|
1930
|
+
return null;
|
|
1931
|
+
}
|
|
1932
|
+
__name(detectLocale, "detectLocale");
|
|
1916
1933
|
var API = class {
|
|
1917
1934
|
constructor(baseUrl, options) {
|
|
1918
1935
|
this._token = null;
|
|
1919
1936
|
this._refreshToken = null;
|
|
1937
|
+
this._locale = null;
|
|
1920
1938
|
this.baseUrl = baseUrl;
|
|
1921
1939
|
this.options = options;
|
|
1922
1940
|
const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
|
|
1923
1941
|
this.storage = options?.storage || new LocalStorageAdapter(logger);
|
|
1942
|
+
this._locale = options?.locale || null;
|
|
1924
1943
|
this._loadTokensFromStorage();
|
|
1925
1944
|
this._client = new APIClient(this.baseUrl, {
|
|
1926
1945
|
retryConfig: this.options?.retryConfig,
|
|
@@ -1956,11 +1975,13 @@ var API = class {
|
|
|
1956
1975
|
const originalRequest = this._client.request.bind(this._client);
|
|
1957
1976
|
this._client.request = async (method, path, options) => {
|
|
1958
1977
|
const token = this.getToken();
|
|
1978
|
+
const locale = this._locale || detectLocale();
|
|
1959
1979
|
const mergedOptions = {
|
|
1960
1980
|
...options,
|
|
1961
1981
|
headers: {
|
|
1962
1982
|
...options?.headers || {},
|
|
1963
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
1983
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
1984
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
1964
1985
|
}
|
|
1965
1986
|
};
|
|
1966
1987
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -2022,6 +2043,19 @@ var API = class {
|
|
|
2022
2043
|
getBaseUrl() {
|
|
2023
2044
|
return this.baseUrl;
|
|
2024
2045
|
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Set locale for Accept-Language header
|
|
2048
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
2049
|
+
*/
|
|
2050
|
+
setLocale(locale) {
|
|
2051
|
+
this._locale = locale;
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* Get current locale
|
|
2055
|
+
*/
|
|
2056
|
+
getLocale() {
|
|
2057
|
+
return this._locale;
|
|
2058
|
+
}
|
|
2025
2059
|
/**
|
|
2026
2060
|
* Get OpenAPI schema path
|
|
2027
2061
|
* @returns Path to the OpenAPI schema JSON file
|
|
@@ -3272,14 +3306,30 @@ import { consola as consola8 } from "consola";
|
|
|
3272
3306
|
// src/generated/cfg_centrifugo/index.ts
|
|
3273
3307
|
var TOKEN_KEY2 = "auth_token";
|
|
3274
3308
|
var REFRESH_TOKEN_KEY2 = "refresh_token";
|
|
3309
|
+
function detectLocale2() {
|
|
3310
|
+
try {
|
|
3311
|
+
if (typeof document !== "undefined") {
|
|
3312
|
+
const match = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
|
|
3313
|
+
if (match) return match[1];
|
|
3314
|
+
}
|
|
3315
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
3316
|
+
return navigator.language;
|
|
3317
|
+
}
|
|
3318
|
+
} catch {
|
|
3319
|
+
}
|
|
3320
|
+
return null;
|
|
3321
|
+
}
|
|
3322
|
+
__name(detectLocale2, "detectLocale");
|
|
3275
3323
|
var API2 = class {
|
|
3276
3324
|
constructor(baseUrl, options) {
|
|
3277
3325
|
this._token = null;
|
|
3278
3326
|
this._refreshToken = null;
|
|
3327
|
+
this._locale = null;
|
|
3279
3328
|
this.baseUrl = baseUrl;
|
|
3280
3329
|
this.options = options;
|
|
3281
3330
|
const logger = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
|
|
3282
3331
|
this.storage = options?.storage || new LocalStorageAdapter2(logger);
|
|
3332
|
+
this._locale = options?.locale || null;
|
|
3283
3333
|
this._loadTokensFromStorage();
|
|
3284
3334
|
this._client = new APIClient2(this.baseUrl, {
|
|
3285
3335
|
retryConfig: this.options?.retryConfig,
|
|
@@ -3315,11 +3365,13 @@ var API2 = class {
|
|
|
3315
3365
|
const originalRequest = this._client.request.bind(this._client);
|
|
3316
3366
|
this._client.request = async (method, path, options) => {
|
|
3317
3367
|
const token = this.getToken();
|
|
3368
|
+
const locale = this._locale || detectLocale2();
|
|
3318
3369
|
const mergedOptions = {
|
|
3319
3370
|
...options,
|
|
3320
3371
|
headers: {
|
|
3321
3372
|
...options?.headers || {},
|
|
3322
|
-
...token ? { "Authorization": `Bearer ${token}` } : {}
|
|
3373
|
+
...token ? { "Authorization": `Bearer ${token}` } : {},
|
|
3374
|
+
...locale ? { "Accept-Language": locale } : {}
|
|
3323
3375
|
}
|
|
3324
3376
|
};
|
|
3325
3377
|
return originalRequest(method, path, mergedOptions);
|
|
@@ -3381,6 +3433,19 @@ var API2 = class {
|
|
|
3381
3433
|
getBaseUrl() {
|
|
3382
3434
|
return this.baseUrl;
|
|
3383
3435
|
}
|
|
3436
|
+
/**
|
|
3437
|
+
* Set locale for Accept-Language header
|
|
3438
|
+
* @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear
|
|
3439
|
+
*/
|
|
3440
|
+
setLocale(locale) {
|
|
3441
|
+
this._locale = locale;
|
|
3442
|
+
}
|
|
3443
|
+
/**
|
|
3444
|
+
* Get current locale
|
|
3445
|
+
*/
|
|
3446
|
+
getLocale() {
|
|
3447
|
+
return this._locale;
|
|
3448
|
+
}
|
|
3384
3449
|
/**
|
|
3385
3450
|
* Get OpenAPI schema path
|
|
3386
3451
|
* @returns Path to the OpenAPI schema JSON file
|