@djangocfg/api 2.1.88 → 2.1.89
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/auth.cjs
CHANGED
|
@@ -171,7 +171,9 @@ var UserProfile = class {
|
|
|
171
171
|
* multipart/form-data with 'avatar' field.
|
|
172
172
|
*/
|
|
173
173
|
async accountsProfileAvatarCreate(data) {
|
|
174
|
-
const
|
|
174
|
+
const formData = new FormData();
|
|
175
|
+
formData.append("avatar", data.avatar);
|
|
176
|
+
const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
|
|
175
177
|
return response;
|
|
176
178
|
}
|
|
177
179
|
/**
|
|
@@ -607,8 +609,10 @@ var APIClient = class {
|
|
|
607
609
|
constructor(baseUrl, options) {
|
|
608
610
|
this.logger = null;
|
|
609
611
|
this.retryConfig = null;
|
|
612
|
+
this.tokenGetter = null;
|
|
610
613
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
611
614
|
this.httpClient = options?.httpClient || new FetchAdapter();
|
|
615
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
612
616
|
if (options?.loggerConfig !== void 0) {
|
|
613
617
|
this.logger = new APILogger(options.loggerConfig);
|
|
614
618
|
}
|
|
@@ -637,6 +641,19 @@ var APIClient = class {
|
|
|
637
641
|
}
|
|
638
642
|
return null;
|
|
639
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* Get the base URL for building streaming/download URLs.
|
|
646
|
+
*/
|
|
647
|
+
getBaseUrl() {
|
|
648
|
+
return this.baseUrl;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
652
|
+
* Returns null if no token getter is configured or no token is available.
|
|
653
|
+
*/
|
|
654
|
+
getToken() {
|
|
655
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
656
|
+
}
|
|
640
657
|
/**
|
|
641
658
|
* Make HTTP request with Django CSRF and session handling.
|
|
642
659
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -884,168 +901,174 @@ var CentrifugoTokenSchema = import_zod.z.object({
|
|
|
884
901
|
channels: import_zod.z.array(import_zod.z.string())
|
|
885
902
|
});
|
|
886
903
|
|
|
887
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
904
|
+
// src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
|
|
888
905
|
var import_zod2 = require("zod");
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
source_url: import_zod2.z.union([import_zod2.z.url(), import_zod2.z.literal("")]).optional()
|
|
906
|
+
var CfgAccountsProfileAvatarCreateRequestSchema = import_zod2.z.object({
|
|
907
|
+
avatar: import_zod2.z.union([import_zod2.z.instanceof(File), import_zod2.z.instanceof(Blob)])
|
|
892
908
|
});
|
|
893
909
|
|
|
894
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
910
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
|
|
895
911
|
var import_zod3 = require("zod");
|
|
896
|
-
var
|
|
897
|
-
|
|
898
|
-
|
|
912
|
+
var OAuthAuthorizeRequestRequestSchema = import_zod3.z.object({
|
|
913
|
+
redirect_uri: import_zod3.z.union([import_zod3.z.url(), import_zod3.z.literal("")]).optional(),
|
|
914
|
+
source_url: import_zod3.z.union([import_zod3.z.url(), import_zod3.z.literal("")]).optional()
|
|
899
915
|
});
|
|
900
916
|
|
|
901
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
917
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
|
|
902
918
|
var import_zod4 = require("zod");
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
-
state: import_zod4.z.string()
|
|
906
|
-
redirect_uri: import_zod4.z.union([import_zod4.z.url(), import_zod4.z.literal("")]).optional()
|
|
919
|
+
var OAuthAuthorizeResponseSchema = import_zod4.z.object({
|
|
920
|
+
authorization_url: import_zod4.z.union([import_zod4.z.url(), import_zod4.z.literal("")]),
|
|
921
|
+
state: import_zod4.z.string()
|
|
907
922
|
});
|
|
908
923
|
|
|
909
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
924
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
|
|
910
925
|
var import_zod5 = require("zod");
|
|
911
|
-
var
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
provider_username: import_zod5.z.string(),
|
|
916
|
-
provider_email: import_zod5.z.email(),
|
|
917
|
-
provider_avatar_url: import_zod5.z.union([import_zod5.z.url(), import_zod5.z.literal("")]),
|
|
918
|
-
connected_at: import_zod5.z.iso.datetime(),
|
|
919
|
-
last_login_at: import_zod5.z.iso.datetime()
|
|
926
|
+
var OAuthCallbackRequestRequestSchema = import_zod5.z.object({
|
|
927
|
+
code: import_zod5.z.string().min(10).max(500),
|
|
928
|
+
state: import_zod5.z.string().min(20).max(100),
|
|
929
|
+
redirect_uri: import_zod5.z.union([import_zod5.z.url(), import_zod5.z.literal("")]).optional()
|
|
920
930
|
});
|
|
921
931
|
|
|
922
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
932
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
|
|
923
933
|
var import_zod6 = require("zod");
|
|
924
|
-
var
|
|
925
|
-
|
|
934
|
+
var OAuthConnectionSchema = import_zod6.z.object({
|
|
935
|
+
id: import_zod6.z.int(),
|
|
936
|
+
provider: import_zod6.z.nativeEnum(OAuthConnectionProvider),
|
|
937
|
+
provider_display: import_zod6.z.string(),
|
|
938
|
+
provider_username: import_zod6.z.string(),
|
|
939
|
+
provider_email: import_zod6.z.email(),
|
|
940
|
+
provider_avatar_url: import_zod6.z.union([import_zod6.z.url(), import_zod6.z.literal("")]),
|
|
941
|
+
connected_at: import_zod6.z.iso.datetime(),
|
|
942
|
+
last_login_at: import_zod6.z.iso.datetime()
|
|
926
943
|
});
|
|
927
944
|
|
|
928
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
945
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
|
|
929
946
|
var import_zod7 = require("zod");
|
|
930
|
-
var
|
|
931
|
-
|
|
932
|
-
error_description: import_zod7.z.string().optional()
|
|
947
|
+
var OAuthDisconnectRequestRequestSchema = import_zod7.z.object({
|
|
948
|
+
provider: import_zod7.z.nativeEnum(OAuthDisconnectRequestRequestProvider)
|
|
933
949
|
});
|
|
934
950
|
|
|
935
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
951
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
|
|
936
952
|
var import_zod8 = require("zod");
|
|
937
|
-
var
|
|
938
|
-
|
|
953
|
+
var OAuthErrorSchema = import_zod8.z.object({
|
|
954
|
+
error: import_zod8.z.string(),
|
|
955
|
+
error_description: import_zod8.z.string().optional()
|
|
939
956
|
});
|
|
940
957
|
|
|
941
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
958
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
|
|
942
959
|
var import_zod9 = require("zod");
|
|
943
|
-
var
|
|
944
|
-
|
|
945
|
-
session_id: import_zod9.z.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(),
|
|
946
|
-
access: import_zod9.z.string().nullable().optional(),
|
|
947
|
-
refresh: import_zod9.z.string().nullable().optional(),
|
|
948
|
-
user: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()).nullable().optional(),
|
|
949
|
-
is_new_user: import_zod9.z.boolean(),
|
|
950
|
-
is_new_connection: import_zod9.z.boolean(),
|
|
951
|
-
should_prompt_2fa: import_zod9.z.boolean().optional()
|
|
960
|
+
var OAuthProvidersResponseSchema = import_zod9.z.object({
|
|
961
|
+
providers: import_zod9.z.array(import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()))
|
|
952
962
|
});
|
|
953
963
|
|
|
954
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
964
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
|
|
955
965
|
var import_zod10 = require("zod");
|
|
956
|
-
var
|
|
957
|
-
|
|
966
|
+
var OAuthTokenResponseSchema = import_zod10.z.object({
|
|
967
|
+
requires_2fa: import_zod10.z.boolean().optional(),
|
|
968
|
+
session_id: import_zod10.z.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(),
|
|
969
|
+
access: import_zod10.z.string().nullable().optional(),
|
|
970
|
+
refresh: import_zod10.z.string().nullable().optional(),
|
|
971
|
+
user: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).nullable().optional(),
|
|
972
|
+
is_new_user: import_zod10.z.boolean(),
|
|
973
|
+
is_new_connection: import_zod10.z.boolean(),
|
|
974
|
+
should_prompt_2fa: import_zod10.z.boolean().optional()
|
|
958
975
|
});
|
|
959
976
|
|
|
960
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
977
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
|
|
961
978
|
var import_zod11 = require("zod");
|
|
962
|
-
var
|
|
963
|
-
|
|
964
|
-
channel: import_zod11.z.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
965
|
-
source_url: import_zod11.z.union([import_zod11.z.url(), import_zod11.z.literal("")]).optional()
|
|
979
|
+
var OTPErrorResponseSchema = import_zod11.z.object({
|
|
980
|
+
error: import_zod11.z.string()
|
|
966
981
|
});
|
|
967
982
|
|
|
968
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
983
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
|
|
969
984
|
var import_zod12 = require("zod");
|
|
970
|
-
var
|
|
971
|
-
|
|
985
|
+
var OTPRequestRequestSchema = import_zod12.z.object({
|
|
986
|
+
identifier: import_zod12.z.string().min(1),
|
|
987
|
+
channel: import_zod12.z.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
988
|
+
source_url: import_zod12.z.union([import_zod12.z.url(), import_zod12.z.literal("")]).optional()
|
|
972
989
|
});
|
|
973
990
|
|
|
974
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
991
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
|
|
975
992
|
var import_zod13 = require("zod");
|
|
976
|
-
var
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
993
|
+
var OTPRequestResponseSchema = import_zod13.z.object({
|
|
994
|
+
message: import_zod13.z.string()
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
|
|
998
|
+
var import_zod14 = require("zod");
|
|
999
|
+
var OTPVerifyRequestSchema = import_zod14.z.object({
|
|
1000
|
+
identifier: import_zod14.z.string().min(1),
|
|
1001
|
+
otp: import_zod14.z.string().min(6).max(6),
|
|
1002
|
+
channel: import_zod14.z.nativeEnum(OTPVerifyRequestChannel).optional(),
|
|
1003
|
+
source_url: import_zod14.z.union([import_zod14.z.url(), import_zod14.z.literal("")]).optional()
|
|
981
1004
|
});
|
|
982
1005
|
|
|
983
1006
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
984
|
-
var
|
|
1007
|
+
var import_zod16 = require("zod");
|
|
985
1008
|
|
|
986
1009
|
// src/generated/cfg_accounts/_utils/schemas/User.schema.ts
|
|
987
|
-
var
|
|
988
|
-
var UserSchema =
|
|
989
|
-
id:
|
|
990
|
-
email:
|
|
991
|
-
first_name:
|
|
992
|
-
last_name:
|
|
993
|
-
full_name:
|
|
994
|
-
initials:
|
|
995
|
-
display_username:
|
|
996
|
-
company:
|
|
997
|
-
phone:
|
|
998
|
-
position:
|
|
999
|
-
avatar:
|
|
1000
|
-
is_staff:
|
|
1001
|
-
is_superuser:
|
|
1002
|
-
date_joined:
|
|
1003
|
-
last_login:
|
|
1004
|
-
unanswered_messages_count:
|
|
1010
|
+
var import_zod15 = require("zod");
|
|
1011
|
+
var UserSchema = import_zod15.z.object({
|
|
1012
|
+
id: import_zod15.z.int(),
|
|
1013
|
+
email: import_zod15.z.email(),
|
|
1014
|
+
first_name: import_zod15.z.string().max(50).optional(),
|
|
1015
|
+
last_name: import_zod15.z.string().max(50).optional(),
|
|
1016
|
+
full_name: import_zod15.z.string(),
|
|
1017
|
+
initials: import_zod15.z.string(),
|
|
1018
|
+
display_username: import_zod15.z.string(),
|
|
1019
|
+
company: import_zod15.z.string().max(100).optional(),
|
|
1020
|
+
phone: import_zod15.z.string().max(20).optional(),
|
|
1021
|
+
position: import_zod15.z.string().max(100).optional(),
|
|
1022
|
+
avatar: import_zod15.z.union([import_zod15.z.url(), import_zod15.z.literal("")]).nullable(),
|
|
1023
|
+
is_staff: import_zod15.z.boolean(),
|
|
1024
|
+
is_superuser: import_zod15.z.boolean(),
|
|
1025
|
+
date_joined: import_zod15.z.iso.datetime(),
|
|
1026
|
+
last_login: import_zod15.z.iso.datetime().nullable(),
|
|
1027
|
+
unanswered_messages_count: import_zod15.z.int(),
|
|
1005
1028
|
centrifugo: CentrifugoTokenSchema.nullable()
|
|
1006
1029
|
});
|
|
1007
1030
|
|
|
1008
1031
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
1009
|
-
var OTPVerifyResponseSchema =
|
|
1010
|
-
requires_2fa:
|
|
1011
|
-
session_id:
|
|
1012
|
-
refresh:
|
|
1013
|
-
access:
|
|
1032
|
+
var OTPVerifyResponseSchema = import_zod16.z.object({
|
|
1033
|
+
requires_2fa: import_zod16.z.boolean().optional(),
|
|
1034
|
+
session_id: import_zod16.z.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(),
|
|
1035
|
+
refresh: import_zod16.z.string().nullable().optional(),
|
|
1036
|
+
access: import_zod16.z.string().nullable().optional(),
|
|
1014
1037
|
user: UserSchema.nullable().optional(),
|
|
1015
|
-
should_prompt_2fa:
|
|
1038
|
+
should_prompt_2fa: import_zod16.z.boolean().optional()
|
|
1016
1039
|
});
|
|
1017
1040
|
|
|
1018
1041
|
// src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
|
|
1019
|
-
var
|
|
1020
|
-
var PatchedUserProfileUpdateRequestSchema =
|
|
1021
|
-
first_name:
|
|
1022
|
-
last_name:
|
|
1023
|
-
company:
|
|
1024
|
-
phone:
|
|
1025
|
-
position:
|
|
1042
|
+
var import_zod17 = require("zod");
|
|
1043
|
+
var PatchedUserProfileUpdateRequestSchema = import_zod17.z.object({
|
|
1044
|
+
first_name: import_zod17.z.string().max(50).optional(),
|
|
1045
|
+
last_name: import_zod17.z.string().max(50).optional(),
|
|
1046
|
+
company: import_zod17.z.string().max(100).optional(),
|
|
1047
|
+
phone: import_zod17.z.string().max(20).optional(),
|
|
1048
|
+
position: import_zod17.z.string().max(100).optional()
|
|
1026
1049
|
});
|
|
1027
1050
|
|
|
1028
1051
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
|
|
1029
|
-
var
|
|
1030
|
-
var TokenRefreshSchema =
|
|
1031
|
-
access:
|
|
1032
|
-
refresh:
|
|
1052
|
+
var import_zod18 = require("zod");
|
|
1053
|
+
var TokenRefreshSchema = import_zod18.z.object({
|
|
1054
|
+
access: import_zod18.z.string(),
|
|
1055
|
+
refresh: import_zod18.z.string()
|
|
1033
1056
|
});
|
|
1034
1057
|
|
|
1035
1058
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
|
|
1036
|
-
var
|
|
1037
|
-
var TokenRefreshRequestSchema =
|
|
1038
|
-
refresh:
|
|
1059
|
+
var import_zod19 = require("zod");
|
|
1060
|
+
var TokenRefreshRequestSchema = import_zod19.z.object({
|
|
1061
|
+
refresh: import_zod19.z.string().min(1)
|
|
1039
1062
|
});
|
|
1040
1063
|
|
|
1041
1064
|
// src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
|
|
1042
|
-
var
|
|
1043
|
-
var UserProfileUpdateRequestSchema =
|
|
1044
|
-
first_name:
|
|
1045
|
-
last_name:
|
|
1046
|
-
company:
|
|
1047
|
-
phone:
|
|
1048
|
-
position:
|
|
1065
|
+
var import_zod20 = require("zod");
|
|
1066
|
+
var UserProfileUpdateRequestSchema = import_zod20.z.object({
|
|
1067
|
+
first_name: import_zod20.z.string().max(50).optional(),
|
|
1068
|
+
last_name: import_zod20.z.string().max(50).optional(),
|
|
1069
|
+
company: import_zod20.z.string().max(100).optional(),
|
|
1070
|
+
phone: import_zod20.z.string().max(20).optional(),
|
|
1071
|
+
position: import_zod20.z.string().max(100).optional()
|
|
1049
1072
|
});
|
|
1050
1073
|
|
|
1051
1074
|
// src/generated/cfg_accounts/_utils/fetchers/accounts.ts
|
|
@@ -1402,7 +1425,8 @@ var API = class {
|
|
|
1402
1425
|
this._loadTokensFromStorage();
|
|
1403
1426
|
this._client = new APIClient(this.baseUrl, {
|
|
1404
1427
|
retryConfig: this.options?.retryConfig,
|
|
1405
|
-
loggerConfig: this.options?.loggerConfig
|
|
1428
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1429
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1406
1430
|
});
|
|
1407
1431
|
this._injectAuthHeader();
|
|
1408
1432
|
this.auth = this._client.auth;
|
|
@@ -1420,7 +1444,8 @@ var API = class {
|
|
|
1420
1444
|
_reinitClients() {
|
|
1421
1445
|
this._client = new APIClient(this.baseUrl, {
|
|
1422
1446
|
retryConfig: this.options?.retryConfig,
|
|
1423
|
-
loggerConfig: this.options?.loggerConfig
|
|
1447
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1448
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1424
1449
|
});
|
|
1425
1450
|
this._injectAuthHeader();
|
|
1426
1451
|
this.auth = this._client.auth;
|
|
@@ -2091,8 +2116,10 @@ var APIClient2 = class {
|
|
|
2091
2116
|
constructor(baseUrl, options) {
|
|
2092
2117
|
this.logger = null;
|
|
2093
2118
|
this.retryConfig = null;
|
|
2119
|
+
this.tokenGetter = null;
|
|
2094
2120
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
2095
2121
|
this.httpClient = options?.httpClient || new FetchAdapter2();
|
|
2122
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
2096
2123
|
if (options?.loggerConfig !== void 0) {
|
|
2097
2124
|
this.logger = new APILogger2(options.loggerConfig);
|
|
2098
2125
|
}
|
|
@@ -2121,6 +2148,19 @@ var APIClient2 = class {
|
|
|
2121
2148
|
}
|
|
2122
2149
|
return null;
|
|
2123
2150
|
}
|
|
2151
|
+
/**
|
|
2152
|
+
* Get the base URL for building streaming/download URLs.
|
|
2153
|
+
*/
|
|
2154
|
+
getBaseUrl() {
|
|
2155
|
+
return this.baseUrl;
|
|
2156
|
+
}
|
|
2157
|
+
/**
|
|
2158
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
2159
|
+
* Returns null if no token getter is configured or no token is available.
|
|
2160
|
+
*/
|
|
2161
|
+
getToken() {
|
|
2162
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
2163
|
+
}
|
|
2124
2164
|
/**
|
|
2125
2165
|
* Make HTTP request with Django CSRF and session handling.
|
|
2126
2166
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -2333,320 +2373,320 @@ var LocalStorageAdapter2 = class {
|
|
|
2333
2373
|
};
|
|
2334
2374
|
|
|
2335
2375
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
|
|
2336
|
-
var
|
|
2337
|
-
var CentrifugoChannelInfoSchema =
|
|
2338
|
-
num_clients:
|
|
2376
|
+
var import_zod21 = require("zod");
|
|
2377
|
+
var CentrifugoChannelInfoSchema = import_zod21.z.object({
|
|
2378
|
+
num_clients: import_zod21.z.int()
|
|
2339
2379
|
});
|
|
2340
2380
|
|
|
2341
2381
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
|
|
2342
|
-
var
|
|
2343
|
-
var CentrifugoChannelsRequestRequestSchema =
|
|
2344
|
-
pattern:
|
|
2382
|
+
var import_zod22 = require("zod");
|
|
2383
|
+
var CentrifugoChannelsRequestRequestSchema = import_zod22.z.object({
|
|
2384
|
+
pattern: import_zod22.z.string().nullable().optional()
|
|
2345
2385
|
});
|
|
2346
2386
|
|
|
2347
2387
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2348
|
-
var
|
|
2388
|
+
var import_zod25 = require("zod");
|
|
2349
2389
|
|
|
2350
2390
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
|
|
2351
|
-
var
|
|
2352
|
-
var CentrifugoChannelsResultSchema =
|
|
2353
|
-
channels:
|
|
2391
|
+
var import_zod23 = require("zod");
|
|
2392
|
+
var CentrifugoChannelsResultSchema = import_zod23.z.object({
|
|
2393
|
+
channels: import_zod23.z.record(import_zod23.z.string(), CentrifugoChannelInfoSchema)
|
|
2354
2394
|
});
|
|
2355
2395
|
|
|
2356
2396
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
|
|
2357
|
-
var
|
|
2358
|
-
var CentrifugoErrorSchema =
|
|
2359
|
-
code:
|
|
2360
|
-
message:
|
|
2397
|
+
var import_zod24 = require("zod");
|
|
2398
|
+
var CentrifugoErrorSchema = import_zod24.z.object({
|
|
2399
|
+
code: import_zod24.z.int().optional(),
|
|
2400
|
+
message: import_zod24.z.string().optional()
|
|
2361
2401
|
});
|
|
2362
2402
|
|
|
2363
2403
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2364
|
-
var CentrifugoChannelsResponseSchema =
|
|
2404
|
+
var CentrifugoChannelsResponseSchema = import_zod25.z.object({
|
|
2365
2405
|
error: CentrifugoErrorSchema.optional(),
|
|
2366
2406
|
result: CentrifugoChannelsResultSchema.optional()
|
|
2367
2407
|
});
|
|
2368
2408
|
|
|
2369
2409
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
|
|
2370
|
-
var
|
|
2371
|
-
var CentrifugoClientInfoSchema =
|
|
2372
|
-
user:
|
|
2373
|
-
client:
|
|
2374
|
-
conn_info:
|
|
2375
|
-
chan_info:
|
|
2410
|
+
var import_zod26 = require("zod");
|
|
2411
|
+
var CentrifugoClientInfoSchema = import_zod26.z.object({
|
|
2412
|
+
user: import_zod26.z.string(),
|
|
2413
|
+
client: import_zod26.z.string(),
|
|
2414
|
+
conn_info: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).nullable().optional(),
|
|
2415
|
+
chan_info: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).nullable().optional()
|
|
2376
2416
|
});
|
|
2377
2417
|
|
|
2378
2418
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
|
|
2379
|
-
var
|
|
2380
|
-
var CentrifugoHealthCheckSchema =
|
|
2381
|
-
status:
|
|
2382
|
-
wrapper_url:
|
|
2383
|
-
has_api_key:
|
|
2384
|
-
timestamp:
|
|
2419
|
+
var import_zod27 = require("zod");
|
|
2420
|
+
var CentrifugoHealthCheckSchema = import_zod27.z.object({
|
|
2421
|
+
status: import_zod27.z.string(),
|
|
2422
|
+
wrapper_url: import_zod27.z.string(),
|
|
2423
|
+
has_api_key: import_zod27.z.boolean(),
|
|
2424
|
+
timestamp: import_zod27.z.string()
|
|
2385
2425
|
});
|
|
2386
2426
|
|
|
2387
2427
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2388
|
-
var
|
|
2428
|
+
var import_zod29 = require("zod");
|
|
2389
2429
|
|
|
2390
2430
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
|
|
2391
|
-
var
|
|
2392
|
-
var CentrifugoStreamPositionSchema =
|
|
2393
|
-
offset:
|
|
2394
|
-
epoch:
|
|
2431
|
+
var import_zod28 = require("zod");
|
|
2432
|
+
var CentrifugoStreamPositionSchema = import_zod28.z.object({
|
|
2433
|
+
offset: import_zod28.z.int(),
|
|
2434
|
+
epoch: import_zod28.z.string()
|
|
2395
2435
|
});
|
|
2396
2436
|
|
|
2397
2437
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2398
|
-
var CentrifugoHistoryRequestRequestSchema =
|
|
2399
|
-
channel:
|
|
2400
|
-
limit:
|
|
2438
|
+
var CentrifugoHistoryRequestRequestSchema = import_zod29.z.object({
|
|
2439
|
+
channel: import_zod29.z.string(),
|
|
2440
|
+
limit: import_zod29.z.int().nullable().optional(),
|
|
2401
2441
|
since: CentrifugoStreamPositionSchema.optional(),
|
|
2402
|
-
reverse:
|
|
2442
|
+
reverse: import_zod29.z.boolean().nullable().optional()
|
|
2403
2443
|
});
|
|
2404
2444
|
|
|
2405
2445
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2406
|
-
var
|
|
2446
|
+
var import_zod32 = require("zod");
|
|
2407
2447
|
|
|
2408
2448
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2409
|
-
var
|
|
2449
|
+
var import_zod31 = require("zod");
|
|
2410
2450
|
|
|
2411
2451
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
|
|
2412
|
-
var
|
|
2413
|
-
var CentrifugoPublicationSchema =
|
|
2414
|
-
data:
|
|
2452
|
+
var import_zod30 = require("zod");
|
|
2453
|
+
var CentrifugoPublicationSchema = import_zod30.z.object({
|
|
2454
|
+
data: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()),
|
|
2415
2455
|
info: CentrifugoClientInfoSchema.optional(),
|
|
2416
|
-
offset:
|
|
2417
|
-
tags:
|
|
2456
|
+
offset: import_zod30.z.int(),
|
|
2457
|
+
tags: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()).nullable().optional()
|
|
2418
2458
|
});
|
|
2419
2459
|
|
|
2420
2460
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2421
|
-
var CentrifugoHistoryResultSchema =
|
|
2422
|
-
publications:
|
|
2423
|
-
epoch:
|
|
2424
|
-
offset:
|
|
2461
|
+
var CentrifugoHistoryResultSchema = import_zod31.z.object({
|
|
2462
|
+
publications: import_zod31.z.array(CentrifugoPublicationSchema),
|
|
2463
|
+
epoch: import_zod31.z.string(),
|
|
2464
|
+
offset: import_zod31.z.int()
|
|
2425
2465
|
});
|
|
2426
2466
|
|
|
2427
2467
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2428
|
-
var CentrifugoHistoryResponseSchema =
|
|
2468
|
+
var CentrifugoHistoryResponseSchema = import_zod32.z.object({
|
|
2429
2469
|
error: CentrifugoErrorSchema.optional(),
|
|
2430
2470
|
result: CentrifugoHistoryResultSchema.optional()
|
|
2431
2471
|
});
|
|
2432
2472
|
|
|
2433
2473
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2434
|
-
var
|
|
2474
|
+
var import_zod37 = require("zod");
|
|
2435
2475
|
|
|
2436
2476
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2437
|
-
var
|
|
2477
|
+
var import_zod36 = require("zod");
|
|
2438
2478
|
|
|
2439
2479
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2440
|
-
var
|
|
2480
|
+
var import_zod35 = require("zod");
|
|
2441
2481
|
|
|
2442
2482
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
|
|
2443
|
-
var
|
|
2444
|
-
var CentrifugoMetricsSchema =
|
|
2445
|
-
interval:
|
|
2446
|
-
items:
|
|
2483
|
+
var import_zod33 = require("zod");
|
|
2484
|
+
var CentrifugoMetricsSchema = import_zod33.z.object({
|
|
2485
|
+
interval: import_zod33.z.number(),
|
|
2486
|
+
items: import_zod33.z.record(import_zod33.z.string(), import_zod33.z.number())
|
|
2447
2487
|
});
|
|
2448
2488
|
|
|
2449
2489
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
|
|
2450
|
-
var
|
|
2451
|
-
var CentrifugoProcessSchema =
|
|
2452
|
-
cpu:
|
|
2453
|
-
rss:
|
|
2490
|
+
var import_zod34 = require("zod");
|
|
2491
|
+
var CentrifugoProcessSchema = import_zod34.z.object({
|
|
2492
|
+
cpu: import_zod34.z.number(),
|
|
2493
|
+
rss: import_zod34.z.int()
|
|
2454
2494
|
});
|
|
2455
2495
|
|
|
2456
2496
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2457
|
-
var CentrifugoNodeInfoSchema =
|
|
2458
|
-
uid:
|
|
2459
|
-
name:
|
|
2460
|
-
version:
|
|
2461
|
-
num_clients:
|
|
2462
|
-
num_users:
|
|
2463
|
-
num_channels:
|
|
2464
|
-
uptime:
|
|
2465
|
-
num_subs:
|
|
2497
|
+
var CentrifugoNodeInfoSchema = import_zod35.z.object({
|
|
2498
|
+
uid: import_zod35.z.string(),
|
|
2499
|
+
name: import_zod35.z.string(),
|
|
2500
|
+
version: import_zod35.z.string(),
|
|
2501
|
+
num_clients: import_zod35.z.int(),
|
|
2502
|
+
num_users: import_zod35.z.int(),
|
|
2503
|
+
num_channels: import_zod35.z.int(),
|
|
2504
|
+
uptime: import_zod35.z.int(),
|
|
2505
|
+
num_subs: import_zod35.z.int(),
|
|
2466
2506
|
metrics: CentrifugoMetricsSchema.optional(),
|
|
2467
2507
|
process: CentrifugoProcessSchema.optional()
|
|
2468
2508
|
});
|
|
2469
2509
|
|
|
2470
2510
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2471
|
-
var CentrifugoInfoResultSchema =
|
|
2472
|
-
nodes:
|
|
2511
|
+
var CentrifugoInfoResultSchema = import_zod36.z.object({
|
|
2512
|
+
nodes: import_zod36.z.array(CentrifugoNodeInfoSchema)
|
|
2473
2513
|
});
|
|
2474
2514
|
|
|
2475
2515
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2476
|
-
var CentrifugoInfoResponseSchema =
|
|
2516
|
+
var CentrifugoInfoResponseSchema = import_zod37.z.object({
|
|
2477
2517
|
error: CentrifugoErrorSchema.optional(),
|
|
2478
2518
|
result: CentrifugoInfoResultSchema.optional()
|
|
2479
2519
|
});
|
|
2480
2520
|
|
|
2481
2521
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
|
|
2482
|
-
var
|
|
2483
|
-
var CentrifugoOverviewStatsSchema =
|
|
2484
|
-
total:
|
|
2485
|
-
successful:
|
|
2486
|
-
failed:
|
|
2487
|
-
timeout:
|
|
2488
|
-
success_rate:
|
|
2489
|
-
avg_duration_ms:
|
|
2490
|
-
avg_acks_received:
|
|
2491
|
-
period_hours:
|
|
2522
|
+
var import_zod38 = require("zod");
|
|
2523
|
+
var CentrifugoOverviewStatsSchema = import_zod38.z.object({
|
|
2524
|
+
total: import_zod38.z.int(),
|
|
2525
|
+
successful: import_zod38.z.int(),
|
|
2526
|
+
failed: import_zod38.z.int(),
|
|
2527
|
+
timeout: import_zod38.z.int(),
|
|
2528
|
+
success_rate: import_zod38.z.number(),
|
|
2529
|
+
avg_duration_ms: import_zod38.z.number(),
|
|
2530
|
+
avg_acks_received: import_zod38.z.number(),
|
|
2531
|
+
period_hours: import_zod38.z.int()
|
|
2492
2532
|
});
|
|
2493
2533
|
|
|
2494
2534
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
|
|
2495
|
-
var
|
|
2496
|
-
var CentrifugoPresenceRequestRequestSchema =
|
|
2497
|
-
channel:
|
|
2535
|
+
var import_zod39 = require("zod");
|
|
2536
|
+
var CentrifugoPresenceRequestRequestSchema = import_zod39.z.object({
|
|
2537
|
+
channel: import_zod39.z.string()
|
|
2498
2538
|
});
|
|
2499
2539
|
|
|
2500
2540
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
2501
|
-
var
|
|
2541
|
+
var import_zod41 = require("zod");
|
|
2502
2542
|
|
|
2503
2543
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
|
|
2504
|
-
var
|
|
2505
|
-
var CentrifugoPresenceResultSchema =
|
|
2506
|
-
presence:
|
|
2544
|
+
var import_zod40 = require("zod");
|
|
2545
|
+
var CentrifugoPresenceResultSchema = import_zod40.z.object({
|
|
2546
|
+
presence: import_zod40.z.record(import_zod40.z.string(), CentrifugoClientInfoSchema)
|
|
2507
2547
|
});
|
|
2508
2548
|
|
|
2509
2549
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
2510
|
-
var CentrifugoPresenceResponseSchema =
|
|
2550
|
+
var CentrifugoPresenceResponseSchema = import_zod41.z.object({
|
|
2511
2551
|
error: CentrifugoErrorSchema.optional(),
|
|
2512
2552
|
result: CentrifugoPresenceResultSchema.optional()
|
|
2513
2553
|
});
|
|
2514
2554
|
|
|
2515
2555
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
|
|
2516
|
-
var
|
|
2517
|
-
var CentrifugoPresenceStatsRequestRequestSchema =
|
|
2518
|
-
channel:
|
|
2556
|
+
var import_zod42 = require("zod");
|
|
2557
|
+
var CentrifugoPresenceStatsRequestRequestSchema = import_zod42.z.object({
|
|
2558
|
+
channel: import_zod42.z.string()
|
|
2519
2559
|
});
|
|
2520
2560
|
|
|
2521
2561
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
2522
|
-
var
|
|
2562
|
+
var import_zod44 = require("zod");
|
|
2523
2563
|
|
|
2524
2564
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
|
|
2525
|
-
var
|
|
2526
|
-
var CentrifugoPresenceStatsResultSchema =
|
|
2527
|
-
num_clients:
|
|
2528
|
-
num_users:
|
|
2565
|
+
var import_zod43 = require("zod");
|
|
2566
|
+
var CentrifugoPresenceStatsResultSchema = import_zod43.z.object({
|
|
2567
|
+
num_clients: import_zod43.z.int(),
|
|
2568
|
+
num_users: import_zod43.z.int()
|
|
2529
2569
|
});
|
|
2530
2570
|
|
|
2531
2571
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
2532
|
-
var CentrifugoPresenceStatsResponseSchema =
|
|
2572
|
+
var CentrifugoPresenceStatsResponseSchema = import_zod44.z.object({
|
|
2533
2573
|
error: CentrifugoErrorSchema.optional(),
|
|
2534
2574
|
result: CentrifugoPresenceStatsResultSchema.optional()
|
|
2535
2575
|
});
|
|
2536
2576
|
|
|
2537
2577
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
2538
|
-
var
|
|
2578
|
+
var import_zod46 = require("zod");
|
|
2539
2579
|
|
|
2540
2580
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
|
|
2541
|
-
var
|
|
2542
|
-
var ChannelStatsSchema =
|
|
2543
|
-
channel:
|
|
2544
|
-
total:
|
|
2545
|
-
successful:
|
|
2546
|
-
failed:
|
|
2547
|
-
avg_duration_ms:
|
|
2548
|
-
avg_acks:
|
|
2549
|
-
last_activity_at:
|
|
2581
|
+
var import_zod45 = require("zod");
|
|
2582
|
+
var ChannelStatsSchema = import_zod45.z.object({
|
|
2583
|
+
channel: import_zod45.z.string(),
|
|
2584
|
+
total: import_zod45.z.int(),
|
|
2585
|
+
successful: import_zod45.z.int(),
|
|
2586
|
+
failed: import_zod45.z.int(),
|
|
2587
|
+
avg_duration_ms: import_zod45.z.number(),
|
|
2588
|
+
avg_acks: import_zod45.z.number(),
|
|
2589
|
+
last_activity_at: import_zod45.z.string().nullable()
|
|
2550
2590
|
});
|
|
2551
2591
|
|
|
2552
2592
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
2553
|
-
var ChannelListSchema =
|
|
2554
|
-
channels:
|
|
2555
|
-
total_channels:
|
|
2593
|
+
var ChannelListSchema = import_zod46.z.object({
|
|
2594
|
+
channels: import_zod46.z.array(ChannelStatsSchema),
|
|
2595
|
+
total_channels: import_zod46.z.int()
|
|
2556
2596
|
});
|
|
2557
2597
|
|
|
2558
2598
|
// src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
|
|
2559
|
-
var
|
|
2560
|
-
var ConnectionTokenResponseSchema =
|
|
2561
|
-
token:
|
|
2562
|
-
centrifugo_url:
|
|
2563
|
-
expires_at:
|
|
2564
|
-
channels:
|
|
2599
|
+
var import_zod47 = require("zod");
|
|
2600
|
+
var ConnectionTokenResponseSchema = import_zod47.z.object({
|
|
2601
|
+
token: import_zod47.z.string(),
|
|
2602
|
+
centrifugo_url: import_zod47.z.string(),
|
|
2603
|
+
expires_at: import_zod47.z.string(),
|
|
2604
|
+
channels: import_zod47.z.array(import_zod47.z.string())
|
|
2565
2605
|
});
|
|
2566
2606
|
|
|
2567
2607
|
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
|
|
2568
|
-
var
|
|
2569
|
-
var ManualAckRequestRequestSchema =
|
|
2570
|
-
message_id:
|
|
2571
|
-
client_id:
|
|
2608
|
+
var import_zod48 = require("zod");
|
|
2609
|
+
var ManualAckRequestRequestSchema = import_zod48.z.object({
|
|
2610
|
+
message_id: import_zod48.z.string(),
|
|
2611
|
+
client_id: import_zod48.z.string()
|
|
2572
2612
|
});
|
|
2573
2613
|
|
|
2574
2614
|
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
|
|
2575
|
-
var
|
|
2576
|
-
var ManualAckResponseSchema =
|
|
2577
|
-
success:
|
|
2578
|
-
message_id:
|
|
2579
|
-
error:
|
|
2615
|
+
var import_zod49 = require("zod");
|
|
2616
|
+
var ManualAckResponseSchema = import_zod49.z.object({
|
|
2617
|
+
success: import_zod49.z.boolean(),
|
|
2618
|
+
message_id: import_zod49.z.string(),
|
|
2619
|
+
error: import_zod49.z.string().nullable().optional()
|
|
2580
2620
|
});
|
|
2581
2621
|
|
|
2582
2622
|
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
2583
|
-
var
|
|
2623
|
+
var import_zod51 = require("zod");
|
|
2584
2624
|
|
|
2585
2625
|
// src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
|
|
2586
|
-
var
|
|
2587
|
-
var PublishSchema =
|
|
2588
|
-
message_id:
|
|
2589
|
-
channel:
|
|
2590
|
-
status:
|
|
2591
|
-
wait_for_ack:
|
|
2592
|
-
acks_received:
|
|
2593
|
-
acks_expected:
|
|
2594
|
-
duration_ms:
|
|
2595
|
-
created_at:
|
|
2596
|
-
completed_at:
|
|
2597
|
-
error_code:
|
|
2598
|
-
error_message:
|
|
2626
|
+
var import_zod50 = require("zod");
|
|
2627
|
+
var PublishSchema = import_zod50.z.object({
|
|
2628
|
+
message_id: import_zod50.z.string(),
|
|
2629
|
+
channel: import_zod50.z.string(),
|
|
2630
|
+
status: import_zod50.z.string(),
|
|
2631
|
+
wait_for_ack: import_zod50.z.boolean(),
|
|
2632
|
+
acks_received: import_zod50.z.int(),
|
|
2633
|
+
acks_expected: import_zod50.z.int().nullable(),
|
|
2634
|
+
duration_ms: import_zod50.z.number().nullable(),
|
|
2635
|
+
created_at: import_zod50.z.iso.datetime(),
|
|
2636
|
+
completed_at: import_zod50.z.iso.datetime().nullable(),
|
|
2637
|
+
error_code: import_zod50.z.string().nullable(),
|
|
2638
|
+
error_message: import_zod50.z.string().nullable()
|
|
2599
2639
|
});
|
|
2600
2640
|
|
|
2601
2641
|
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
2602
|
-
var PaginatedPublishListSchema =
|
|
2603
|
-
count:
|
|
2604
|
-
page:
|
|
2605
|
-
pages:
|
|
2606
|
-
page_size:
|
|
2607
|
-
has_next:
|
|
2608
|
-
has_previous:
|
|
2609
|
-
next_page:
|
|
2610
|
-
previous_page:
|
|
2611
|
-
results:
|
|
2642
|
+
var PaginatedPublishListSchema = import_zod51.z.object({
|
|
2643
|
+
count: import_zod51.z.int(),
|
|
2644
|
+
page: import_zod51.z.int(),
|
|
2645
|
+
pages: import_zod51.z.int(),
|
|
2646
|
+
page_size: import_zod51.z.int(),
|
|
2647
|
+
has_next: import_zod51.z.boolean(),
|
|
2648
|
+
has_previous: import_zod51.z.boolean(),
|
|
2649
|
+
next_page: import_zod51.z.int().nullable().optional(),
|
|
2650
|
+
previous_page: import_zod51.z.int().nullable().optional(),
|
|
2651
|
+
results: import_zod51.z.array(PublishSchema)
|
|
2612
2652
|
});
|
|
2613
2653
|
|
|
2614
2654
|
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
|
|
2615
|
-
var
|
|
2616
|
-
var PublishTestRequestRequestSchema =
|
|
2617
|
-
channel:
|
|
2618
|
-
data:
|
|
2619
|
-
wait_for_ack:
|
|
2620
|
-
ack_timeout:
|
|
2655
|
+
var import_zod52 = require("zod");
|
|
2656
|
+
var PublishTestRequestRequestSchema = import_zod52.z.object({
|
|
2657
|
+
channel: import_zod52.z.string(),
|
|
2658
|
+
data: import_zod52.z.record(import_zod52.z.string(), import_zod52.z.any()),
|
|
2659
|
+
wait_for_ack: import_zod52.z.boolean().optional(),
|
|
2660
|
+
ack_timeout: import_zod52.z.int().min(1).max(60).optional()
|
|
2621
2661
|
});
|
|
2622
2662
|
|
|
2623
2663
|
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
|
|
2624
|
-
var
|
|
2625
|
-
var PublishTestResponseSchema =
|
|
2626
|
-
success:
|
|
2627
|
-
message_id:
|
|
2628
|
-
channel:
|
|
2629
|
-
acks_received:
|
|
2630
|
-
delivered:
|
|
2631
|
-
error:
|
|
2664
|
+
var import_zod53 = require("zod");
|
|
2665
|
+
var PublishTestResponseSchema = import_zod53.z.object({
|
|
2666
|
+
success: import_zod53.z.boolean(),
|
|
2667
|
+
message_id: import_zod53.z.string(),
|
|
2668
|
+
channel: import_zod53.z.string(),
|
|
2669
|
+
acks_received: import_zod53.z.int().optional(),
|
|
2670
|
+
delivered: import_zod53.z.boolean().optional(),
|
|
2671
|
+
error: import_zod53.z.string().nullable().optional()
|
|
2632
2672
|
});
|
|
2633
2673
|
|
|
2634
2674
|
// src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
|
|
2635
|
-
var
|
|
2636
|
-
var TimelineItemSchema =
|
|
2637
|
-
timestamp:
|
|
2638
|
-
count:
|
|
2639
|
-
successful:
|
|
2640
|
-
failed:
|
|
2641
|
-
timeout:
|
|
2675
|
+
var import_zod54 = require("zod");
|
|
2676
|
+
var TimelineItemSchema = import_zod54.z.object({
|
|
2677
|
+
timestamp: import_zod54.z.string(),
|
|
2678
|
+
count: import_zod54.z.int(),
|
|
2679
|
+
successful: import_zod54.z.int(),
|
|
2680
|
+
failed: import_zod54.z.int(),
|
|
2681
|
+
timeout: import_zod54.z.int()
|
|
2642
2682
|
});
|
|
2643
2683
|
|
|
2644
2684
|
// src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
|
|
2645
|
-
var
|
|
2646
|
-
var TimelineResponseSchema =
|
|
2647
|
-
timeline:
|
|
2648
|
-
period_hours:
|
|
2649
|
-
interval:
|
|
2685
|
+
var import_zod55 = require("zod");
|
|
2686
|
+
var TimelineResponseSchema = import_zod55.z.object({
|
|
2687
|
+
timeline: import_zod55.z.array(TimelineItemSchema),
|
|
2688
|
+
period_hours: import_zod55.z.int(),
|
|
2689
|
+
interval: import_zod55.z.string()
|
|
2650
2690
|
});
|
|
2651
2691
|
|
|
2652
2692
|
// src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
|
|
@@ -2675,7 +2715,8 @@ var API2 = class {
|
|
|
2675
2715
|
this._loadTokensFromStorage();
|
|
2676
2716
|
this._client = new APIClient2(this.baseUrl, {
|
|
2677
2717
|
retryConfig: this.options?.retryConfig,
|
|
2678
|
-
loggerConfig: this.options?.loggerConfig
|
|
2718
|
+
loggerConfig: this.options?.loggerConfig,
|
|
2719
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
2679
2720
|
});
|
|
2680
2721
|
this._injectAuthHeader();
|
|
2681
2722
|
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
@@ -2693,7 +2734,8 @@ var API2 = class {
|
|
|
2693
2734
|
_reinitClients() {
|
|
2694
2735
|
this._client = new APIClient2(this.baseUrl, {
|
|
2695
2736
|
retryConfig: this.options?.retryConfig,
|
|
2696
|
-
loggerConfig: this.options?.loggerConfig
|
|
2737
|
+
loggerConfig: this.options?.loggerConfig,
|
|
2738
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
2697
2739
|
});
|
|
2698
2740
|
this._injectAuthHeader();
|
|
2699
2741
|
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
@@ -3192,8 +3234,10 @@ var APIClient3 = class {
|
|
|
3192
3234
|
constructor(baseUrl, options) {
|
|
3193
3235
|
this.logger = null;
|
|
3194
3236
|
this.retryConfig = null;
|
|
3237
|
+
this.tokenGetter = null;
|
|
3195
3238
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
3196
3239
|
this.httpClient = options?.httpClient || new FetchAdapter3();
|
|
3240
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
3197
3241
|
if (options?.loggerConfig !== void 0) {
|
|
3198
3242
|
this.logger = new APILogger3(options.loggerConfig);
|
|
3199
3243
|
}
|
|
@@ -3219,6 +3263,19 @@ var APIClient3 = class {
|
|
|
3219
3263
|
}
|
|
3220
3264
|
return null;
|
|
3221
3265
|
}
|
|
3266
|
+
/**
|
|
3267
|
+
* Get the base URL for building streaming/download URLs.
|
|
3268
|
+
*/
|
|
3269
|
+
getBaseUrl() {
|
|
3270
|
+
return this.baseUrl;
|
|
3271
|
+
}
|
|
3272
|
+
/**
|
|
3273
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
3274
|
+
* Returns null if no token getter is configured or no token is available.
|
|
3275
|
+
*/
|
|
3276
|
+
getToken() {
|
|
3277
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
3278
|
+
}
|
|
3222
3279
|
/**
|
|
3223
3280
|
* Make HTTP request with Django CSRF and session handling.
|
|
3224
3281
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -3431,40 +3488,40 @@ var LocalStorageAdapter3 = class {
|
|
|
3431
3488
|
};
|
|
3432
3489
|
|
|
3433
3490
|
// src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
|
|
3434
|
-
var
|
|
3435
|
-
var SendPushRequestRequestSchema =
|
|
3436
|
-
title:
|
|
3437
|
-
body:
|
|
3438
|
-
icon:
|
|
3439
|
-
url:
|
|
3491
|
+
var import_zod56 = require("zod");
|
|
3492
|
+
var SendPushRequestRequestSchema = import_zod56.z.object({
|
|
3493
|
+
title: import_zod56.z.string().min(1).max(255),
|
|
3494
|
+
body: import_zod56.z.string().min(1),
|
|
3495
|
+
icon: import_zod56.z.union([import_zod56.z.url(), import_zod56.z.literal("")]).nullable().optional(),
|
|
3496
|
+
url: import_zod56.z.union([import_zod56.z.url(), import_zod56.z.literal("")]).nullable().optional()
|
|
3440
3497
|
});
|
|
3441
3498
|
|
|
3442
3499
|
// src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
|
|
3443
|
-
var
|
|
3444
|
-
var SendPushResponseSchema =
|
|
3445
|
-
success:
|
|
3446
|
-
sent_to:
|
|
3500
|
+
var import_zod57 = require("zod");
|
|
3501
|
+
var SendPushResponseSchema = import_zod57.z.object({
|
|
3502
|
+
success: import_zod57.z.boolean(),
|
|
3503
|
+
sent_to: import_zod57.z.int()
|
|
3447
3504
|
});
|
|
3448
3505
|
|
|
3449
3506
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
|
|
3450
|
-
var
|
|
3451
|
-
var SubscribeRequestRequestSchema =
|
|
3452
|
-
endpoint:
|
|
3453
|
-
keys:
|
|
3507
|
+
var import_zod58 = require("zod");
|
|
3508
|
+
var SubscribeRequestRequestSchema = import_zod58.z.object({
|
|
3509
|
+
endpoint: import_zod58.z.union([import_zod58.z.url(), import_zod58.z.literal("")]),
|
|
3510
|
+
keys: import_zod58.z.record(import_zod58.z.string(), import_zod58.z.string().min(1))
|
|
3454
3511
|
});
|
|
3455
3512
|
|
|
3456
3513
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
|
|
3457
|
-
var
|
|
3458
|
-
var SubscribeResponseSchema =
|
|
3459
|
-
success:
|
|
3460
|
-
subscription_id:
|
|
3461
|
-
created:
|
|
3514
|
+
var import_zod59 = require("zod");
|
|
3515
|
+
var SubscribeResponseSchema = import_zod59.z.object({
|
|
3516
|
+
success: import_zod59.z.boolean(),
|
|
3517
|
+
subscription_id: import_zod59.z.int(),
|
|
3518
|
+
created: import_zod59.z.boolean()
|
|
3462
3519
|
});
|
|
3463
3520
|
|
|
3464
3521
|
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
3465
|
-
var
|
|
3466
|
-
var VapidPublicKeyResponseSchema =
|
|
3467
|
-
publicKey:
|
|
3522
|
+
var import_zod60 = require("zod");
|
|
3523
|
+
var VapidPublicKeyResponseSchema = import_zod60.z.object({
|
|
3524
|
+
publicKey: import_zod60.z.string()
|
|
3468
3525
|
});
|
|
3469
3526
|
|
|
3470
3527
|
// src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
|
|
@@ -3484,7 +3541,8 @@ var API3 = class {
|
|
|
3484
3541
|
this._loadTokensFromStorage();
|
|
3485
3542
|
this._client = new APIClient3(this.baseUrl, {
|
|
3486
3543
|
retryConfig: this.options?.retryConfig,
|
|
3487
|
-
loggerConfig: this.options?.loggerConfig
|
|
3544
|
+
loggerConfig: this.options?.loggerConfig,
|
|
3545
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
3488
3546
|
});
|
|
3489
3547
|
this._injectAuthHeader();
|
|
3490
3548
|
this.web_push = this._client.web_push;
|
|
@@ -3499,7 +3557,8 @@ var API3 = class {
|
|
|
3499
3557
|
_reinitClients() {
|
|
3500
3558
|
this._client = new APIClient3(this.baseUrl, {
|
|
3501
3559
|
retryConfig: this.options?.retryConfig,
|
|
3502
|
-
loggerConfig: this.options?.loggerConfig
|
|
3560
|
+
loggerConfig: this.options?.loggerConfig,
|
|
3561
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
3503
3562
|
});
|
|
3504
3563
|
this._injectAuthHeader();
|
|
3505
3564
|
this.web_push = this._client.web_push;
|
|
@@ -3995,16 +4054,10 @@ function useTokenRefresh(options = {}) {
|
|
|
3995
4054
|
isRefreshingRef.current = true;
|
|
3996
4055
|
authLogger.info("Refreshing token...");
|
|
3997
4056
|
try {
|
|
3998
|
-
const
|
|
3999
|
-
|
|
4000
|
-
headers: { "Content-Type": "application/json" },
|
|
4001
|
-
body: JSON.stringify({ refresh: refreshTokenValue })
|
|
4057
|
+
const result = await api.auth.accountsTokenRefreshCreate({
|
|
4058
|
+
refresh: refreshTokenValue
|
|
4002
4059
|
});
|
|
4003
|
-
|
|
4004
|
-
throw new Error(`Token refresh failed: ${response.status}`);
|
|
4005
|
-
}
|
|
4006
|
-
const data = await response.json();
|
|
4007
|
-
const newAccessToken = data.access;
|
|
4060
|
+
const newAccessToken = result.access;
|
|
4008
4061
|
if (!newAccessToken) {
|
|
4009
4062
|
throw new Error("No access token in refresh response");
|
|
4010
4063
|
}
|
|
@@ -4228,8 +4281,8 @@ function AccountsProvider({ children }) {
|
|
|
4228
4281
|
await refreshProfile("AccountsContext.partialUpdateProfile");
|
|
4229
4282
|
return result;
|
|
4230
4283
|
}, "partialUpdateProfile");
|
|
4231
|
-
const uploadAvatar = /* @__PURE__ */ __name(async (
|
|
4232
|
-
const result = await avatarMutation(
|
|
4284
|
+
const uploadAvatar = /* @__PURE__ */ __name(async (avatar) => {
|
|
4285
|
+
const result = await avatarMutation({ avatar }, api);
|
|
4233
4286
|
await refreshProfile("AccountsContext.uploadAvatar");
|
|
4234
4287
|
return result;
|
|
4235
4288
|
}, "uploadAvatar");
|
|
@@ -5336,8 +5389,10 @@ var APIClient4 = class {
|
|
|
5336
5389
|
constructor(baseUrl, options) {
|
|
5337
5390
|
this.logger = null;
|
|
5338
5391
|
this.retryConfig = null;
|
|
5392
|
+
this.tokenGetter = null;
|
|
5339
5393
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
5340
5394
|
this.httpClient = options?.httpClient || new FetchAdapter4();
|
|
5395
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
5341
5396
|
if (options?.loggerConfig !== void 0) {
|
|
5342
5397
|
this.logger = new APILogger4(options.loggerConfig);
|
|
5343
5398
|
}
|
|
@@ -5367,6 +5422,19 @@ var APIClient4 = class {
|
|
|
5367
5422
|
}
|
|
5368
5423
|
return null;
|
|
5369
5424
|
}
|
|
5425
|
+
/**
|
|
5426
|
+
* Get the base URL for building streaming/download URLs.
|
|
5427
|
+
*/
|
|
5428
|
+
getBaseUrl() {
|
|
5429
|
+
return this.baseUrl;
|
|
5430
|
+
}
|
|
5431
|
+
/**
|
|
5432
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
5433
|
+
* Returns null if no token getter is configured or no token is available.
|
|
5434
|
+
*/
|
|
5435
|
+
getToken() {
|
|
5436
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
5437
|
+
}
|
|
5370
5438
|
/**
|
|
5371
5439
|
* Make HTTP request with Django CSRF and session handling.
|
|
5372
5440
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -5587,112 +5655,112 @@ var DeviceListStatus = /* @__PURE__ */ ((DeviceListStatus2) => {
|
|
|
5587
5655
|
})(DeviceListStatus || {});
|
|
5588
5656
|
|
|
5589
5657
|
// src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts
|
|
5590
|
-
var
|
|
5591
|
-
var BackupCodesRegenerateRequestSchema =
|
|
5592
|
-
code:
|
|
5658
|
+
var import_zod61 = require("zod");
|
|
5659
|
+
var BackupCodesRegenerateRequestSchema = import_zod61.z.object({
|
|
5660
|
+
code: import_zod61.z.string().min(6).max(6)
|
|
5593
5661
|
});
|
|
5594
5662
|
|
|
5595
5663
|
// src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts
|
|
5596
|
-
var
|
|
5597
|
-
var BackupCodesRegenerateResponseSchema =
|
|
5598
|
-
backup_codes:
|
|
5599
|
-
warning:
|
|
5664
|
+
var import_zod62 = require("zod");
|
|
5665
|
+
var BackupCodesRegenerateResponseSchema = import_zod62.z.object({
|
|
5666
|
+
backup_codes: import_zod62.z.array(import_zod62.z.string()),
|
|
5667
|
+
warning: import_zod62.z.string()
|
|
5600
5668
|
});
|
|
5601
5669
|
|
|
5602
5670
|
// src/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts
|
|
5603
|
-
var
|
|
5604
|
-
var BackupCodesStatusSchema =
|
|
5605
|
-
remaining_count:
|
|
5606
|
-
total_generated:
|
|
5607
|
-
warning:
|
|
5671
|
+
var import_zod63 = require("zod");
|
|
5672
|
+
var BackupCodesStatusSchema = import_zod63.z.object({
|
|
5673
|
+
remaining_count: import_zod63.z.int(),
|
|
5674
|
+
total_generated: import_zod63.z.int(),
|
|
5675
|
+
warning: import_zod63.z.string().nullable().optional()
|
|
5608
5676
|
});
|
|
5609
5677
|
|
|
5610
5678
|
// src/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts
|
|
5611
|
-
var
|
|
5612
|
-
var ConfirmSetupRequestSchema =
|
|
5613
|
-
device_id:
|
|
5614
|
-
code:
|
|
5679
|
+
var import_zod64 = require("zod");
|
|
5680
|
+
var ConfirmSetupRequestSchema = import_zod64.z.object({
|
|
5681
|
+
device_id: import_zod64.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5682
|
+
code: import_zod64.z.string().min(6).max(6)
|
|
5615
5683
|
});
|
|
5616
5684
|
|
|
5617
5685
|
// src/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts
|
|
5618
|
-
var
|
|
5619
|
-
var ConfirmSetupResponseSchema =
|
|
5620
|
-
message:
|
|
5621
|
-
backup_codes:
|
|
5622
|
-
backup_codes_warning:
|
|
5686
|
+
var import_zod65 = require("zod");
|
|
5687
|
+
var ConfirmSetupResponseSchema = import_zod65.z.object({
|
|
5688
|
+
message: import_zod65.z.string(),
|
|
5689
|
+
backup_codes: import_zod65.z.array(import_zod65.z.string()),
|
|
5690
|
+
backup_codes_warning: import_zod65.z.string()
|
|
5623
5691
|
});
|
|
5624
5692
|
|
|
5625
5693
|
// src/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts
|
|
5626
|
-
var
|
|
5627
|
-
var DeviceListSchema =
|
|
5628
|
-
id:
|
|
5629
|
-
name:
|
|
5630
|
-
is_primary:
|
|
5631
|
-
status:
|
|
5632
|
-
created_at:
|
|
5633
|
-
confirmed_at:
|
|
5634
|
-
last_used_at:
|
|
5694
|
+
var import_zod66 = require("zod");
|
|
5695
|
+
var DeviceListSchema = import_zod66.z.object({
|
|
5696
|
+
id: import_zod66.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5697
|
+
name: import_zod66.z.string(),
|
|
5698
|
+
is_primary: import_zod66.z.boolean(),
|
|
5699
|
+
status: import_zod66.z.nativeEnum(DeviceListStatus),
|
|
5700
|
+
created_at: import_zod66.z.iso.datetime(),
|
|
5701
|
+
confirmed_at: import_zod66.z.iso.datetime().nullable(),
|
|
5702
|
+
last_used_at: import_zod66.z.iso.datetime().nullable()
|
|
5635
5703
|
});
|
|
5636
5704
|
|
|
5637
5705
|
// src/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts
|
|
5638
|
-
var
|
|
5639
|
-
var DisableRequestSchema =
|
|
5640
|
-
code:
|
|
5706
|
+
var import_zod67 = require("zod");
|
|
5707
|
+
var DisableRequestSchema = import_zod67.z.object({
|
|
5708
|
+
code: import_zod67.z.string().min(6).max(6)
|
|
5641
5709
|
});
|
|
5642
5710
|
|
|
5643
5711
|
// src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListList.schema.ts
|
|
5644
|
-
var
|
|
5645
|
-
var PaginatedDeviceListListSchema =
|
|
5646
|
-
count:
|
|
5647
|
-
page:
|
|
5648
|
-
pages:
|
|
5649
|
-
page_size:
|
|
5650
|
-
has_next:
|
|
5651
|
-
has_previous:
|
|
5652
|
-
next_page:
|
|
5653
|
-
previous_page:
|
|
5654
|
-
results:
|
|
5712
|
+
var import_zod68 = require("zod");
|
|
5713
|
+
var PaginatedDeviceListListSchema = import_zod68.z.object({
|
|
5714
|
+
count: import_zod68.z.int(),
|
|
5715
|
+
page: import_zod68.z.int(),
|
|
5716
|
+
pages: import_zod68.z.int(),
|
|
5717
|
+
page_size: import_zod68.z.int(),
|
|
5718
|
+
has_next: import_zod68.z.boolean(),
|
|
5719
|
+
has_previous: import_zod68.z.boolean(),
|
|
5720
|
+
next_page: import_zod68.z.int().nullable().optional(),
|
|
5721
|
+
previous_page: import_zod68.z.int().nullable().optional(),
|
|
5722
|
+
results: import_zod68.z.array(DeviceListSchema)
|
|
5655
5723
|
});
|
|
5656
5724
|
|
|
5657
5725
|
// src/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
|
|
5658
|
-
var
|
|
5659
|
-
var SetupRequestSchema =
|
|
5660
|
-
device_name:
|
|
5726
|
+
var import_zod69 = require("zod");
|
|
5727
|
+
var SetupRequestSchema = import_zod69.z.object({
|
|
5728
|
+
device_name: import_zod69.z.string().min(1).max(100).optional()
|
|
5661
5729
|
});
|
|
5662
5730
|
|
|
5663
5731
|
// src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
|
|
5664
|
-
var
|
|
5665
|
-
var SetupResponseSchema =
|
|
5666
|
-
device_id:
|
|
5667
|
-
secret:
|
|
5668
|
-
provisioning_uri:
|
|
5669
|
-
qr_code_base64:
|
|
5670
|
-
expires_in:
|
|
5732
|
+
var import_zod70 = require("zod");
|
|
5733
|
+
var SetupResponseSchema = import_zod70.z.object({
|
|
5734
|
+
device_id: import_zod70.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5735
|
+
secret: import_zod70.z.string(),
|
|
5736
|
+
provisioning_uri: import_zod70.z.string(),
|
|
5737
|
+
qr_code_base64: import_zod70.z.string(),
|
|
5738
|
+
expires_in: import_zod70.z.int()
|
|
5671
5739
|
});
|
|
5672
5740
|
|
|
5673
5741
|
// src/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
|
|
5674
|
-
var
|
|
5675
|
-
var VerifyBackupRequestSchema =
|
|
5676
|
-
session_id:
|
|
5677
|
-
backup_code:
|
|
5742
|
+
var import_zod71 = require("zod");
|
|
5743
|
+
var VerifyBackupRequestSchema = import_zod71.z.object({
|
|
5744
|
+
session_id: import_zod71.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5745
|
+
backup_code: import_zod71.z.string().min(8).max(8)
|
|
5678
5746
|
});
|
|
5679
5747
|
|
|
5680
5748
|
// src/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
|
|
5681
|
-
var
|
|
5682
|
-
var VerifyRequestSchema =
|
|
5683
|
-
session_id:
|
|
5684
|
-
code:
|
|
5749
|
+
var import_zod72 = require("zod");
|
|
5750
|
+
var VerifyRequestSchema = import_zod72.z.object({
|
|
5751
|
+
session_id: import_zod72.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
5752
|
+
code: import_zod72.z.string().min(6).max(6)
|
|
5685
5753
|
});
|
|
5686
5754
|
|
|
5687
5755
|
// src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts
|
|
5688
|
-
var
|
|
5689
|
-
var VerifyResponseSchema =
|
|
5690
|
-
message:
|
|
5691
|
-
access_token:
|
|
5692
|
-
refresh_token:
|
|
5693
|
-
user:
|
|
5694
|
-
remaining_backup_codes:
|
|
5695
|
-
warning:
|
|
5756
|
+
var import_zod73 = require("zod");
|
|
5757
|
+
var VerifyResponseSchema = import_zod73.z.object({
|
|
5758
|
+
message: import_zod73.z.string(),
|
|
5759
|
+
access_token: import_zod73.z.string(),
|
|
5760
|
+
refresh_token: import_zod73.z.string(),
|
|
5761
|
+
user: import_zod73.z.record(import_zod73.z.string(), import_zod73.z.any()),
|
|
5762
|
+
remaining_backup_codes: import_zod73.z.int().optional(),
|
|
5763
|
+
warning: import_zod73.z.string().optional()
|
|
5696
5764
|
});
|
|
5697
5765
|
|
|
5698
5766
|
// src/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts
|
|
@@ -5721,7 +5789,8 @@ var API4 = class {
|
|
|
5721
5789
|
this._loadTokensFromStorage();
|
|
5722
5790
|
this._client = new APIClient4(this.baseUrl, {
|
|
5723
5791
|
retryConfig: this.options?.retryConfig,
|
|
5724
|
-
loggerConfig: this.options?.loggerConfig
|
|
5792
|
+
loggerConfig: this.options?.loggerConfig,
|
|
5793
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
5725
5794
|
});
|
|
5726
5795
|
this._injectAuthHeader();
|
|
5727
5796
|
this.backup_codes = this._client.backup_codes;
|
|
@@ -5740,7 +5809,8 @@ var API4 = class {
|
|
|
5740
5809
|
_reinitClients() {
|
|
5741
5810
|
this._client = new APIClient4(this.baseUrl, {
|
|
5742
5811
|
retryConfig: this.options?.retryConfig,
|
|
5743
|
-
loggerConfig: this.options?.loggerConfig
|
|
5812
|
+
loggerConfig: this.options?.loggerConfig,
|
|
5813
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
5744
5814
|
});
|
|
5745
5815
|
this._injectAuthHeader();
|
|
5746
5816
|
this.backup_codes = this._client.backup_codes;
|