@djangocfg/api 2.1.88 → 2.1.90
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 +335 -320
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +335 -320
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +464 -394
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.mjs +464 -394
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +460 -383
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +26 -6
- package/dist/clients.d.ts +26 -6
- package/dist/clients.mjs +460 -383
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +130 -105
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +24 -4
- package/dist/hooks.d.ts +24 -4
- package/dist/hooks.mjs +130 -105
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +373 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -8
- package/dist/index.d.ts +54 -8
- package/dist/index.mjs +373 -311
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/context/AccountsContext.tsx +3 -3
- package/src/auth/hooks/useTokenRefresh.ts +4 -10
- package/src/auth/middlewares/tokenRefresh.ts +4 -15
- package/src/generated/cfg_accounts/CLAUDE.md +2 -9
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +2 -1
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +2 -1
- package/src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +15 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts/models.ts +0 -1
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +4 -2
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +9 -1
- package/src/generated/cfg_accounts/client.ts +18 -0
- package/src/generated/cfg_accounts/index.ts +3 -1
- package/src/generated/cfg_accounts/schema.json +2 -2
- package/src/generated/cfg_centrifugo/CLAUDE.md +1 -8
- package/src/generated/cfg_centrifugo/client.ts +18 -0
- package/src/generated/cfg_centrifugo/index.ts +3 -1
- package/src/generated/cfg_totp/CLAUDE.md +1 -8
- package/src/generated/cfg_totp/client.ts +18 -0
- package/src/generated/cfg_totp/index.ts +3 -1
- package/src/generated/cfg_totp/totp/models.ts +2 -0
- package/src/generated/cfg_webpush/CLAUDE.md +1 -8
- package/src/generated/cfg_webpush/client.ts +18 -0
- package/src/generated/cfg_webpush/index.ts +3 -1
package/dist/hooks.d.cts
CHANGED
|
@@ -204,10 +204,17 @@ interface User$2 {
|
|
|
204
204
|
is_superuser: boolean;
|
|
205
205
|
date_joined: string;
|
|
206
206
|
last_login?: string | null;
|
|
207
|
-
/** Get count of unanswered messages for the user. */
|
|
208
207
|
unanswered_messages_count: number;
|
|
209
208
|
centrifugo: CentrifugoToken$1 | null;
|
|
210
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
* Request model (no read-only fields).
|
|
213
|
+
*/
|
|
214
|
+
interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
215
|
+
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
216
|
+
avatar: File | Blob;
|
|
217
|
+
}
|
|
211
218
|
/**
|
|
212
219
|
* Serializer for updating user profile.
|
|
213
220
|
*
|
|
@@ -266,7 +273,7 @@ declare class UserProfile {
|
|
|
266
273
|
* Upload avatar image for the current authenticated user. Accepts
|
|
267
274
|
* multipart/form-data with 'avatar' field.
|
|
268
275
|
*/
|
|
269
|
-
accountsProfileAvatarCreate(data:
|
|
276
|
+
accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
|
|
270
277
|
/**
|
|
271
278
|
* Partial update user profile
|
|
272
279
|
*
|
|
@@ -384,7 +391,6 @@ interface User$1 {
|
|
|
384
391
|
is_superuser: boolean;
|
|
385
392
|
date_joined: string;
|
|
386
393
|
last_login?: string | null;
|
|
387
|
-
/** Get count of unanswered messages for the user. */
|
|
388
394
|
unanswered_messages_count: number;
|
|
389
395
|
centrifugo: CentrifugoToken | null;
|
|
390
396
|
}
|
|
@@ -524,6 +530,20 @@ interface StorageAdapter {
|
|
|
524
530
|
removeItem(key: string): void;
|
|
525
531
|
}
|
|
526
532
|
|
|
533
|
+
/**
|
|
534
|
+
* Zod schema for CfgAccountsProfileAvatarCreateRequest
|
|
535
|
+
*
|
|
536
|
+
* This schema provides runtime validation and type inference.
|
|
537
|
+
* */
|
|
538
|
+
|
|
539
|
+
declare const CfgAccountsProfileAvatarCreateRequestSchema: z.ZodObject<{
|
|
540
|
+
avatar: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>]>;
|
|
541
|
+
}, z.core.$strip>;
|
|
542
|
+
/**
|
|
543
|
+
* Infer TypeScript type from Zod schema
|
|
544
|
+
*/
|
|
545
|
+
type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>;
|
|
546
|
+
|
|
527
547
|
/**
|
|
528
548
|
* Zod schema for OAuthAuthorizeRequestRequest
|
|
529
549
|
*
|
|
@@ -1076,7 +1096,7 @@ declare function useAccountsProfileRetrieve(client?: API): ReturnType<typeof use
|
|
|
1076
1096
|
* @method POST
|
|
1077
1097
|
* @path /cfg/accounts/profile/avatar/
|
|
1078
1098
|
*/
|
|
1079
|
-
declare function useCreateAccountsProfileAvatarCreate(): (data:
|
|
1099
|
+
declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API) => Promise<User>;
|
|
1080
1100
|
/**
|
|
1081
1101
|
* Partial update user profile
|
|
1082
1102
|
*
|
package/dist/hooks.d.ts
CHANGED
|
@@ -204,10 +204,17 @@ interface User$2 {
|
|
|
204
204
|
is_superuser: boolean;
|
|
205
205
|
date_joined: string;
|
|
206
206
|
last_login?: string | null;
|
|
207
|
-
/** Get count of unanswered messages for the user. */
|
|
208
207
|
unanswered_messages_count: number;
|
|
209
208
|
centrifugo: CentrifugoToken$1 | null;
|
|
210
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
* Request model (no read-only fields).
|
|
213
|
+
*/
|
|
214
|
+
interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
215
|
+
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
216
|
+
avatar: File | Blob;
|
|
217
|
+
}
|
|
211
218
|
/**
|
|
212
219
|
* Serializer for updating user profile.
|
|
213
220
|
*
|
|
@@ -266,7 +273,7 @@ declare class UserProfile {
|
|
|
266
273
|
* Upload avatar image for the current authenticated user. Accepts
|
|
267
274
|
* multipart/form-data with 'avatar' field.
|
|
268
275
|
*/
|
|
269
|
-
accountsProfileAvatarCreate(data:
|
|
276
|
+
accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
|
|
270
277
|
/**
|
|
271
278
|
* Partial update user profile
|
|
272
279
|
*
|
|
@@ -384,7 +391,6 @@ interface User$1 {
|
|
|
384
391
|
is_superuser: boolean;
|
|
385
392
|
date_joined: string;
|
|
386
393
|
last_login?: string | null;
|
|
387
|
-
/** Get count of unanswered messages for the user. */
|
|
388
394
|
unanswered_messages_count: number;
|
|
389
395
|
centrifugo: CentrifugoToken | null;
|
|
390
396
|
}
|
|
@@ -524,6 +530,20 @@ interface StorageAdapter {
|
|
|
524
530
|
removeItem(key: string): void;
|
|
525
531
|
}
|
|
526
532
|
|
|
533
|
+
/**
|
|
534
|
+
* Zod schema for CfgAccountsProfileAvatarCreateRequest
|
|
535
|
+
*
|
|
536
|
+
* This schema provides runtime validation and type inference.
|
|
537
|
+
* */
|
|
538
|
+
|
|
539
|
+
declare const CfgAccountsProfileAvatarCreateRequestSchema: z.ZodObject<{
|
|
540
|
+
avatar: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>]>;
|
|
541
|
+
}, z.core.$strip>;
|
|
542
|
+
/**
|
|
543
|
+
* Infer TypeScript type from Zod schema
|
|
544
|
+
*/
|
|
545
|
+
type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>;
|
|
546
|
+
|
|
527
547
|
/**
|
|
528
548
|
* Zod schema for OAuthAuthorizeRequestRequest
|
|
529
549
|
*
|
|
@@ -1076,7 +1096,7 @@ declare function useAccountsProfileRetrieve(client?: API): ReturnType<typeof use
|
|
|
1076
1096
|
* @method POST
|
|
1077
1097
|
* @path /cfg/accounts/profile/avatar/
|
|
1078
1098
|
*/
|
|
1079
|
-
declare function useCreateAccountsProfileAvatarCreate(): (data:
|
|
1099
|
+
declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API) => Promise<User>;
|
|
1080
1100
|
/**
|
|
1081
1101
|
* Partial update user profile
|
|
1082
1102
|
*
|
package/dist/hooks.mjs
CHANGED
|
@@ -113,7 +113,9 @@ var UserProfile = class {
|
|
|
113
113
|
* multipart/form-data with 'avatar' field.
|
|
114
114
|
*/
|
|
115
115
|
async accountsProfileAvatarCreate(data) {
|
|
116
|
-
const
|
|
116
|
+
const formData = new FormData();
|
|
117
|
+
formData.append("avatar", data.avatar);
|
|
118
|
+
const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
|
|
117
119
|
return response;
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
@@ -549,8 +551,10 @@ var APIClient = class {
|
|
|
549
551
|
constructor(baseUrl, options) {
|
|
550
552
|
this.logger = null;
|
|
551
553
|
this.retryConfig = null;
|
|
554
|
+
this.tokenGetter = null;
|
|
552
555
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
553
556
|
this.httpClient = options?.httpClient || new FetchAdapter();
|
|
557
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
554
558
|
if (options?.loggerConfig !== void 0) {
|
|
555
559
|
this.logger = new APILogger(options.loggerConfig);
|
|
556
560
|
}
|
|
@@ -579,6 +583,19 @@ var APIClient = class {
|
|
|
579
583
|
}
|
|
580
584
|
return null;
|
|
581
585
|
}
|
|
586
|
+
/**
|
|
587
|
+
* Get the base URL for building streaming/download URLs.
|
|
588
|
+
*/
|
|
589
|
+
getBaseUrl() {
|
|
590
|
+
return this.baseUrl;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
594
|
+
* Returns null if no token getter is configured or no token is available.
|
|
595
|
+
*/
|
|
596
|
+
getToken() {
|
|
597
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
598
|
+
}
|
|
582
599
|
/**
|
|
583
600
|
* Make HTTP request with Django CSRF and session handling.
|
|
584
601
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -819,161 +836,167 @@ var CentrifugoTokenSchema = z2.object({
|
|
|
819
836
|
channels: z2.array(z2.string())
|
|
820
837
|
});
|
|
821
838
|
|
|
822
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
839
|
+
// src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
|
|
823
840
|
import { z as z3 } from "zod";
|
|
824
|
-
var
|
|
825
|
-
|
|
826
|
-
source_url: z3.union([z3.url(), z3.literal("")]).optional()
|
|
841
|
+
var CfgAccountsProfileAvatarCreateRequestSchema = z3.object({
|
|
842
|
+
avatar: z3.union([z3.instanceof(File), z3.instanceof(Blob)])
|
|
827
843
|
});
|
|
828
844
|
|
|
829
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
845
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
|
|
830
846
|
import { z as z4 } from "zod";
|
|
831
|
-
var
|
|
832
|
-
|
|
833
|
-
|
|
847
|
+
var OAuthAuthorizeRequestRequestSchema = z4.object({
|
|
848
|
+
redirect_uri: z4.union([z4.url(), z4.literal("")]).optional(),
|
|
849
|
+
source_url: z4.union([z4.url(), z4.literal("")]).optional()
|
|
834
850
|
});
|
|
835
851
|
|
|
836
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
852
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
|
|
837
853
|
import { z as z5 } from "zod";
|
|
838
|
-
var
|
|
839
|
-
|
|
840
|
-
state: z5.string()
|
|
841
|
-
redirect_uri: z5.union([z5.url(), z5.literal("")]).optional()
|
|
854
|
+
var OAuthAuthorizeResponseSchema = z5.object({
|
|
855
|
+
authorization_url: z5.union([z5.url(), z5.literal("")]),
|
|
856
|
+
state: z5.string()
|
|
842
857
|
});
|
|
843
858
|
|
|
844
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
859
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
|
|
845
860
|
import { z as z6 } from "zod";
|
|
846
|
-
var
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
provider_username: z6.string(),
|
|
851
|
-
provider_email: z6.email(),
|
|
852
|
-
provider_avatar_url: z6.union([z6.url(), z6.literal("")]),
|
|
853
|
-
connected_at: z6.iso.datetime(),
|
|
854
|
-
last_login_at: z6.iso.datetime()
|
|
861
|
+
var OAuthCallbackRequestRequestSchema = z6.object({
|
|
862
|
+
code: z6.string().min(10).max(500),
|
|
863
|
+
state: z6.string().min(20).max(100),
|
|
864
|
+
redirect_uri: z6.union([z6.url(), z6.literal("")]).optional()
|
|
855
865
|
});
|
|
856
866
|
|
|
857
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
867
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
|
|
858
868
|
import { z as z7 } from "zod";
|
|
859
|
-
var
|
|
860
|
-
|
|
869
|
+
var OAuthConnectionSchema = z7.object({
|
|
870
|
+
id: z7.int(),
|
|
871
|
+
provider: z7.nativeEnum(OAuthConnectionProvider),
|
|
872
|
+
provider_display: z7.string(),
|
|
873
|
+
provider_username: z7.string(),
|
|
874
|
+
provider_email: z7.email(),
|
|
875
|
+
provider_avatar_url: z7.union([z7.url(), z7.literal("")]),
|
|
876
|
+
connected_at: z7.iso.datetime(),
|
|
877
|
+
last_login_at: z7.iso.datetime()
|
|
861
878
|
});
|
|
862
879
|
|
|
863
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
880
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
|
|
864
881
|
import { z as z8 } from "zod";
|
|
865
|
-
var
|
|
866
|
-
|
|
867
|
-
error_description: z8.string().optional()
|
|
882
|
+
var OAuthDisconnectRequestRequestSchema = z8.object({
|
|
883
|
+
provider: z8.nativeEnum(OAuthDisconnectRequestRequestProvider)
|
|
868
884
|
});
|
|
869
885
|
|
|
870
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
886
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
|
|
871
887
|
import { z as z9 } from "zod";
|
|
872
|
-
var
|
|
873
|
-
|
|
888
|
+
var OAuthErrorSchema = z9.object({
|
|
889
|
+
error: z9.string(),
|
|
890
|
+
error_description: z9.string().optional()
|
|
874
891
|
});
|
|
875
892
|
|
|
876
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
893
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
|
|
877
894
|
import { z as z10 } from "zod";
|
|
878
|
-
var
|
|
879
|
-
|
|
880
|
-
session_id: z10.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
881
|
-
access: z10.string().nullable().optional(),
|
|
882
|
-
refresh: z10.string().nullable().optional(),
|
|
883
|
-
user: z10.record(z10.string(), z10.any()).nullable().optional(),
|
|
884
|
-
is_new_user: z10.boolean(),
|
|
885
|
-
is_new_connection: z10.boolean(),
|
|
886
|
-
should_prompt_2fa: z10.boolean().optional()
|
|
895
|
+
var OAuthProvidersResponseSchema = z10.object({
|
|
896
|
+
providers: z10.array(z10.record(z10.string(), z10.any()))
|
|
887
897
|
});
|
|
888
898
|
|
|
889
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
899
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
|
|
890
900
|
import { z as z11 } from "zod";
|
|
891
|
-
var
|
|
892
|
-
|
|
901
|
+
var OAuthTokenResponseSchema = z11.object({
|
|
902
|
+
requires_2fa: z11.boolean().optional(),
|
|
903
|
+
session_id: z11.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
904
|
+
access: z11.string().nullable().optional(),
|
|
905
|
+
refresh: z11.string().nullable().optional(),
|
|
906
|
+
user: z11.record(z11.string(), z11.any()).nullable().optional(),
|
|
907
|
+
is_new_user: z11.boolean(),
|
|
908
|
+
is_new_connection: z11.boolean(),
|
|
909
|
+
should_prompt_2fa: z11.boolean().optional()
|
|
893
910
|
});
|
|
894
911
|
|
|
895
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
912
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
|
|
896
913
|
import { z as z12 } from "zod";
|
|
897
|
-
var
|
|
898
|
-
|
|
899
|
-
channel: z12.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
900
|
-
source_url: z12.union([z12.url(), z12.literal("")]).optional()
|
|
914
|
+
var OTPErrorResponseSchema = z12.object({
|
|
915
|
+
error: z12.string()
|
|
901
916
|
});
|
|
902
917
|
|
|
903
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
918
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
|
|
904
919
|
import { z as z13 } from "zod";
|
|
905
|
-
var
|
|
906
|
-
|
|
920
|
+
var OTPRequestRequestSchema = z13.object({
|
|
921
|
+
identifier: z13.string().min(1),
|
|
922
|
+
channel: z13.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
923
|
+
source_url: z13.union([z13.url(), z13.literal("")]).optional()
|
|
907
924
|
});
|
|
908
925
|
|
|
909
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
926
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
|
|
910
927
|
import { z as z14 } from "zod";
|
|
911
|
-
var
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
928
|
+
var OTPRequestResponseSchema = z14.object({
|
|
929
|
+
message: z14.string()
|
|
930
|
+
});
|
|
931
|
+
|
|
932
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
|
|
933
|
+
import { z as z15 } from "zod";
|
|
934
|
+
var OTPVerifyRequestSchema = z15.object({
|
|
935
|
+
identifier: z15.string().min(1),
|
|
936
|
+
otp: z15.string().min(6).max(6),
|
|
937
|
+
channel: z15.nativeEnum(OTPVerifyRequestChannel).optional(),
|
|
938
|
+
source_url: z15.union([z15.url(), z15.literal("")]).optional()
|
|
916
939
|
});
|
|
917
940
|
|
|
918
941
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
919
|
-
import { z as
|
|
942
|
+
import { z as z17 } from "zod";
|
|
920
943
|
|
|
921
944
|
// src/generated/cfg_accounts/_utils/schemas/User.schema.ts
|
|
922
|
-
import { z as
|
|
923
|
-
var UserSchema =
|
|
924
|
-
id:
|
|
925
|
-
email:
|
|
926
|
-
first_name:
|
|
927
|
-
last_name:
|
|
928
|
-
full_name:
|
|
929
|
-
initials:
|
|
930
|
-
display_username:
|
|
931
|
-
company:
|
|
932
|
-
phone:
|
|
933
|
-
position:
|
|
934
|
-
avatar:
|
|
935
|
-
is_staff:
|
|
936
|
-
is_superuser:
|
|
937
|
-
date_joined:
|
|
938
|
-
last_login:
|
|
939
|
-
unanswered_messages_count:
|
|
945
|
+
import { z as z16 } from "zod";
|
|
946
|
+
var UserSchema = z16.object({
|
|
947
|
+
id: z16.int(),
|
|
948
|
+
email: z16.email(),
|
|
949
|
+
first_name: z16.string().max(50).optional(),
|
|
950
|
+
last_name: z16.string().max(50).optional(),
|
|
951
|
+
full_name: z16.string(),
|
|
952
|
+
initials: z16.string(),
|
|
953
|
+
display_username: z16.string(),
|
|
954
|
+
company: z16.string().max(100).optional(),
|
|
955
|
+
phone: z16.string().max(20).optional(),
|
|
956
|
+
position: z16.string().max(100).optional(),
|
|
957
|
+
avatar: z16.union([z16.url(), z16.literal("")]).nullable(),
|
|
958
|
+
is_staff: z16.boolean(),
|
|
959
|
+
is_superuser: z16.boolean(),
|
|
960
|
+
date_joined: z16.iso.datetime(),
|
|
961
|
+
last_login: z16.iso.datetime().nullable(),
|
|
962
|
+
unanswered_messages_count: z16.int(),
|
|
940
963
|
centrifugo: CentrifugoTokenSchema.nullable()
|
|
941
964
|
});
|
|
942
965
|
|
|
943
966
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
944
|
-
var OTPVerifyResponseSchema =
|
|
945
|
-
requires_2fa:
|
|
946
|
-
session_id:
|
|
947
|
-
refresh:
|
|
948
|
-
access:
|
|
967
|
+
var OTPVerifyResponseSchema = z17.object({
|
|
968
|
+
requires_2fa: z17.boolean().optional(),
|
|
969
|
+
session_id: z17.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
970
|
+
refresh: z17.string().nullable().optional(),
|
|
971
|
+
access: z17.string().nullable().optional(),
|
|
949
972
|
user: UserSchema.nullable().optional(),
|
|
950
|
-
should_prompt_2fa:
|
|
973
|
+
should_prompt_2fa: z17.boolean().optional()
|
|
951
974
|
});
|
|
952
975
|
|
|
953
976
|
// src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
|
|
954
|
-
import { z as
|
|
955
|
-
var PatchedUserProfileUpdateRequestSchema =
|
|
956
|
-
first_name:
|
|
957
|
-
last_name:
|
|
958
|
-
company:
|
|
959
|
-
phone:
|
|
960
|
-
position:
|
|
977
|
+
import { z as z18 } from "zod";
|
|
978
|
+
var PatchedUserProfileUpdateRequestSchema = z18.object({
|
|
979
|
+
first_name: z18.string().max(50).optional(),
|
|
980
|
+
last_name: z18.string().max(50).optional(),
|
|
981
|
+
company: z18.string().max(100).optional(),
|
|
982
|
+
phone: z18.string().max(20).optional(),
|
|
983
|
+
position: z18.string().max(100).optional()
|
|
961
984
|
});
|
|
962
985
|
|
|
963
986
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
|
|
964
|
-
import { z as
|
|
965
|
-
var TokenRefreshRequestSchema =
|
|
966
|
-
refresh:
|
|
987
|
+
import { z as z19 } from "zod";
|
|
988
|
+
var TokenRefreshRequestSchema = z19.object({
|
|
989
|
+
refresh: z19.string().min(1)
|
|
967
990
|
});
|
|
968
991
|
|
|
969
992
|
// src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
|
|
970
|
-
import { z as
|
|
971
|
-
var UserProfileUpdateRequestSchema =
|
|
972
|
-
first_name:
|
|
973
|
-
last_name:
|
|
974
|
-
company:
|
|
975
|
-
phone:
|
|
976
|
-
position:
|
|
993
|
+
import { z as z20 } from "zod";
|
|
994
|
+
var UserProfileUpdateRequestSchema = z20.object({
|
|
995
|
+
first_name: z20.string().max(50).optional(),
|
|
996
|
+
last_name: z20.string().max(50).optional(),
|
|
997
|
+
company: z20.string().max(100).optional(),
|
|
998
|
+
phone: z20.string().max(20).optional(),
|
|
999
|
+
position: z20.string().max(100).optional()
|
|
977
1000
|
});
|
|
978
1001
|
|
|
979
1002
|
// src/generated/cfg_accounts/_utils/fetchers/accounts.ts
|
|
@@ -1484,7 +1507,8 @@ var API = class {
|
|
|
1484
1507
|
this._loadTokensFromStorage();
|
|
1485
1508
|
this._client = new APIClient(this.baseUrl, {
|
|
1486
1509
|
retryConfig: this.options?.retryConfig,
|
|
1487
|
-
loggerConfig: this.options?.loggerConfig
|
|
1510
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1511
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1488
1512
|
});
|
|
1489
1513
|
this._injectAuthHeader();
|
|
1490
1514
|
this.auth = this._client.auth;
|
|
@@ -1502,7 +1526,8 @@ var API = class {
|
|
|
1502
1526
|
_reinitClients() {
|
|
1503
1527
|
this._client = new APIClient(this.baseUrl, {
|
|
1504
1528
|
retryConfig: this.options?.retryConfig,
|
|
1505
|
-
loggerConfig: this.options?.loggerConfig
|
|
1529
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1530
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1506
1531
|
});
|
|
1507
1532
|
this._injectAuthHeader();
|
|
1508
1533
|
this.auth = this._client.auth;
|