@djangocfg/api 2.1.87 → 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 +1963 -4
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.d.cts +35 -1
- package/dist/auth-server.d.ts +35 -1
- package/dist/auth-server.mjs +1953 -4
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +692 -497
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +18 -2
- package/dist/auth.d.ts +18 -2
- package/dist/auth.mjs +655 -460
- 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/context/AuthContext.tsx +56 -10
- package/src/auth/hooks/index.ts +3 -0
- package/src/auth/hooks/useProfileCache.ts +1 -1
- package/src/auth/hooks/useTokenRefresh.ts +161 -0
- package/src/auth/middlewares/index.ts +8 -1
- package/src/auth/middlewares/tokenRefresh.ts +158 -0
- 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/clients.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(clients_exports, {
|
|
|
36
36
|
CentrifugoHooks: () => hooks_exports2,
|
|
37
37
|
CentrifugoTokenSchema: () => CentrifugoTokenSchema,
|
|
38
38
|
CentrifugoTypes: () => schemas_exports2,
|
|
39
|
+
CfgAccountsProfileAvatarCreateRequestSchema: () => CfgAccountsProfileAvatarCreateRequestSchema,
|
|
39
40
|
Enums: () => enums_exports,
|
|
40
41
|
OAuthAuthorizeRequestRequestSchema: () => OAuthAuthorizeRequestRequestSchema,
|
|
41
42
|
OAuthAuthorizeResponseSchema: () => OAuthAuthorizeResponseSchema,
|
|
@@ -196,7 +197,9 @@ var UserProfile = class {
|
|
|
196
197
|
* multipart/form-data with 'avatar' field.
|
|
197
198
|
*/
|
|
198
199
|
async accountsProfileAvatarCreate(data) {
|
|
199
|
-
const
|
|
200
|
+
const formData = new FormData();
|
|
201
|
+
formData.append("avatar", data.avatar);
|
|
202
|
+
const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
|
|
200
203
|
return response;
|
|
201
204
|
}
|
|
202
205
|
/**
|
|
@@ -632,8 +635,10 @@ var APIClient = class {
|
|
|
632
635
|
constructor(baseUrl, options) {
|
|
633
636
|
this.logger = null;
|
|
634
637
|
this.retryConfig = null;
|
|
638
|
+
this.tokenGetter = null;
|
|
635
639
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
636
640
|
this.httpClient = options?.httpClient || new FetchAdapter();
|
|
641
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
637
642
|
if (options?.loggerConfig !== void 0) {
|
|
638
643
|
this.logger = new APILogger(options.loggerConfig);
|
|
639
644
|
}
|
|
@@ -662,6 +667,19 @@ var APIClient = class {
|
|
|
662
667
|
}
|
|
663
668
|
return null;
|
|
664
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Get the base URL for building streaming/download URLs.
|
|
672
|
+
*/
|
|
673
|
+
getBaseUrl() {
|
|
674
|
+
return this.baseUrl;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
678
|
+
* Returns null if no token getter is configured or no token is available.
|
|
679
|
+
*/
|
|
680
|
+
getToken() {
|
|
681
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
682
|
+
}
|
|
665
683
|
/**
|
|
666
684
|
* Make HTTP request with Django CSRF and session handling.
|
|
667
685
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -909,168 +927,174 @@ var CentrifugoTokenSchema = import_zod.z.object({
|
|
|
909
927
|
channels: import_zod.z.array(import_zod.z.string())
|
|
910
928
|
});
|
|
911
929
|
|
|
912
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
930
|
+
// src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
|
|
913
931
|
var import_zod2 = require("zod");
|
|
914
|
-
var
|
|
915
|
-
|
|
916
|
-
source_url: import_zod2.z.union([import_zod2.z.url(), import_zod2.z.literal("")]).optional()
|
|
932
|
+
var CfgAccountsProfileAvatarCreateRequestSchema = import_zod2.z.object({
|
|
933
|
+
avatar: import_zod2.z.union([import_zod2.z.instanceof(File), import_zod2.z.instanceof(Blob)])
|
|
917
934
|
});
|
|
918
935
|
|
|
919
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
936
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
|
|
920
937
|
var import_zod3 = require("zod");
|
|
921
|
-
var
|
|
922
|
-
|
|
923
|
-
|
|
938
|
+
var OAuthAuthorizeRequestRequestSchema = import_zod3.z.object({
|
|
939
|
+
redirect_uri: import_zod3.z.union([import_zod3.z.url(), import_zod3.z.literal("")]).optional(),
|
|
940
|
+
source_url: import_zod3.z.union([import_zod3.z.url(), import_zod3.z.literal("")]).optional()
|
|
924
941
|
});
|
|
925
942
|
|
|
926
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
943
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
|
|
927
944
|
var import_zod4 = require("zod");
|
|
928
|
-
var
|
|
929
|
-
|
|
930
|
-
state: import_zod4.z.string()
|
|
931
|
-
redirect_uri: import_zod4.z.union([import_zod4.z.url(), import_zod4.z.literal("")]).optional()
|
|
945
|
+
var OAuthAuthorizeResponseSchema = import_zod4.z.object({
|
|
946
|
+
authorization_url: import_zod4.z.union([import_zod4.z.url(), import_zod4.z.literal("")]),
|
|
947
|
+
state: import_zod4.z.string()
|
|
932
948
|
});
|
|
933
949
|
|
|
934
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
950
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
|
|
935
951
|
var import_zod5 = require("zod");
|
|
936
|
-
var
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
provider_username: import_zod5.z.string(),
|
|
941
|
-
provider_email: import_zod5.z.email(),
|
|
942
|
-
provider_avatar_url: import_zod5.z.union([import_zod5.z.url(), import_zod5.z.literal("")]),
|
|
943
|
-
connected_at: import_zod5.z.iso.datetime(),
|
|
944
|
-
last_login_at: import_zod5.z.iso.datetime()
|
|
952
|
+
var OAuthCallbackRequestRequestSchema = import_zod5.z.object({
|
|
953
|
+
code: import_zod5.z.string().min(10).max(500),
|
|
954
|
+
state: import_zod5.z.string().min(20).max(100),
|
|
955
|
+
redirect_uri: import_zod5.z.union([import_zod5.z.url(), import_zod5.z.literal("")]).optional()
|
|
945
956
|
});
|
|
946
957
|
|
|
947
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
958
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
|
|
948
959
|
var import_zod6 = require("zod");
|
|
949
|
-
var
|
|
950
|
-
|
|
960
|
+
var OAuthConnectionSchema = import_zod6.z.object({
|
|
961
|
+
id: import_zod6.z.int(),
|
|
962
|
+
provider: import_zod6.z.nativeEnum(OAuthConnectionProvider),
|
|
963
|
+
provider_display: import_zod6.z.string(),
|
|
964
|
+
provider_username: import_zod6.z.string(),
|
|
965
|
+
provider_email: import_zod6.z.email(),
|
|
966
|
+
provider_avatar_url: import_zod6.z.union([import_zod6.z.url(), import_zod6.z.literal("")]),
|
|
967
|
+
connected_at: import_zod6.z.iso.datetime(),
|
|
968
|
+
last_login_at: import_zod6.z.iso.datetime()
|
|
951
969
|
});
|
|
952
970
|
|
|
953
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
971
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
|
|
954
972
|
var import_zod7 = require("zod");
|
|
955
|
-
var
|
|
956
|
-
|
|
957
|
-
error_description: import_zod7.z.string().optional()
|
|
973
|
+
var OAuthDisconnectRequestRequestSchema = import_zod7.z.object({
|
|
974
|
+
provider: import_zod7.z.nativeEnum(OAuthDisconnectRequestRequestProvider)
|
|
958
975
|
});
|
|
959
976
|
|
|
960
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
977
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
|
|
961
978
|
var import_zod8 = require("zod");
|
|
962
|
-
var
|
|
963
|
-
|
|
979
|
+
var OAuthErrorSchema = import_zod8.z.object({
|
|
980
|
+
error: import_zod8.z.string(),
|
|
981
|
+
error_description: import_zod8.z.string().optional()
|
|
964
982
|
});
|
|
965
983
|
|
|
966
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
984
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
|
|
967
985
|
var import_zod9 = require("zod");
|
|
968
|
-
var
|
|
969
|
-
|
|
970
|
-
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(),
|
|
971
|
-
access: import_zod9.z.string().nullable().optional(),
|
|
972
|
-
refresh: import_zod9.z.string().nullable().optional(),
|
|
973
|
-
user: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()).nullable().optional(),
|
|
974
|
-
is_new_user: import_zod9.z.boolean(),
|
|
975
|
-
is_new_connection: import_zod9.z.boolean(),
|
|
976
|
-
should_prompt_2fa: import_zod9.z.boolean().optional()
|
|
986
|
+
var OAuthProvidersResponseSchema = import_zod9.z.object({
|
|
987
|
+
providers: import_zod9.z.array(import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()))
|
|
977
988
|
});
|
|
978
989
|
|
|
979
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
990
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
|
|
980
991
|
var import_zod10 = require("zod");
|
|
981
|
-
var
|
|
982
|
-
|
|
992
|
+
var OAuthTokenResponseSchema = import_zod10.z.object({
|
|
993
|
+
requires_2fa: import_zod10.z.boolean().optional(),
|
|
994
|
+
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(),
|
|
995
|
+
access: import_zod10.z.string().nullable().optional(),
|
|
996
|
+
refresh: import_zod10.z.string().nullable().optional(),
|
|
997
|
+
user: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).nullable().optional(),
|
|
998
|
+
is_new_user: import_zod10.z.boolean(),
|
|
999
|
+
is_new_connection: import_zod10.z.boolean(),
|
|
1000
|
+
should_prompt_2fa: import_zod10.z.boolean().optional()
|
|
983
1001
|
});
|
|
984
1002
|
|
|
985
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1003
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
|
|
986
1004
|
var import_zod11 = require("zod");
|
|
987
|
-
var
|
|
988
|
-
|
|
989
|
-
channel: import_zod11.z.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
990
|
-
source_url: import_zod11.z.union([import_zod11.z.url(), import_zod11.z.literal("")]).optional()
|
|
1005
|
+
var OTPErrorResponseSchema = import_zod11.z.object({
|
|
1006
|
+
error: import_zod11.z.string()
|
|
991
1007
|
});
|
|
992
1008
|
|
|
993
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1009
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
|
|
994
1010
|
var import_zod12 = require("zod");
|
|
995
|
-
var
|
|
996
|
-
|
|
1011
|
+
var OTPRequestRequestSchema = import_zod12.z.object({
|
|
1012
|
+
identifier: import_zod12.z.string().min(1),
|
|
1013
|
+
channel: import_zod12.z.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
1014
|
+
source_url: import_zod12.z.union([import_zod12.z.url(), import_zod12.z.literal("")]).optional()
|
|
997
1015
|
});
|
|
998
1016
|
|
|
999
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
1017
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
|
|
1000
1018
|
var import_zod13 = require("zod");
|
|
1001
|
-
var
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1019
|
+
var OTPRequestResponseSchema = import_zod13.z.object({
|
|
1020
|
+
message: import_zod13.z.string()
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
|
|
1024
|
+
var import_zod14 = require("zod");
|
|
1025
|
+
var OTPVerifyRequestSchema = import_zod14.z.object({
|
|
1026
|
+
identifier: import_zod14.z.string().min(1),
|
|
1027
|
+
otp: import_zod14.z.string().min(6).max(6),
|
|
1028
|
+
channel: import_zod14.z.nativeEnum(OTPVerifyRequestChannel).optional(),
|
|
1029
|
+
source_url: import_zod14.z.union([import_zod14.z.url(), import_zod14.z.literal("")]).optional()
|
|
1006
1030
|
});
|
|
1007
1031
|
|
|
1008
1032
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
1009
|
-
var
|
|
1033
|
+
var import_zod16 = require("zod");
|
|
1010
1034
|
|
|
1011
1035
|
// src/generated/cfg_accounts/_utils/schemas/User.schema.ts
|
|
1012
|
-
var
|
|
1013
|
-
var UserSchema =
|
|
1014
|
-
id:
|
|
1015
|
-
email:
|
|
1016
|
-
first_name:
|
|
1017
|
-
last_name:
|
|
1018
|
-
full_name:
|
|
1019
|
-
initials:
|
|
1020
|
-
display_username:
|
|
1021
|
-
company:
|
|
1022
|
-
phone:
|
|
1023
|
-
position:
|
|
1024
|
-
avatar:
|
|
1025
|
-
is_staff:
|
|
1026
|
-
is_superuser:
|
|
1027
|
-
date_joined:
|
|
1028
|
-
last_login:
|
|
1029
|
-
unanswered_messages_count:
|
|
1036
|
+
var import_zod15 = require("zod");
|
|
1037
|
+
var UserSchema = import_zod15.z.object({
|
|
1038
|
+
id: import_zod15.z.int(),
|
|
1039
|
+
email: import_zod15.z.email(),
|
|
1040
|
+
first_name: import_zod15.z.string().max(50).optional(),
|
|
1041
|
+
last_name: import_zod15.z.string().max(50).optional(),
|
|
1042
|
+
full_name: import_zod15.z.string(),
|
|
1043
|
+
initials: import_zod15.z.string(),
|
|
1044
|
+
display_username: import_zod15.z.string(),
|
|
1045
|
+
company: import_zod15.z.string().max(100).optional(),
|
|
1046
|
+
phone: import_zod15.z.string().max(20).optional(),
|
|
1047
|
+
position: import_zod15.z.string().max(100).optional(),
|
|
1048
|
+
avatar: import_zod15.z.union([import_zod15.z.url(), import_zod15.z.literal("")]).nullable(),
|
|
1049
|
+
is_staff: import_zod15.z.boolean(),
|
|
1050
|
+
is_superuser: import_zod15.z.boolean(),
|
|
1051
|
+
date_joined: import_zod15.z.iso.datetime(),
|
|
1052
|
+
last_login: import_zod15.z.iso.datetime().nullable(),
|
|
1053
|
+
unanswered_messages_count: import_zod15.z.int(),
|
|
1030
1054
|
centrifugo: CentrifugoTokenSchema.nullable()
|
|
1031
1055
|
});
|
|
1032
1056
|
|
|
1033
1057
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
1034
|
-
var OTPVerifyResponseSchema =
|
|
1035
|
-
requires_2fa:
|
|
1036
|
-
session_id:
|
|
1037
|
-
refresh:
|
|
1038
|
-
access:
|
|
1058
|
+
var OTPVerifyResponseSchema = import_zod16.z.object({
|
|
1059
|
+
requires_2fa: import_zod16.z.boolean().optional(),
|
|
1060
|
+
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(),
|
|
1061
|
+
refresh: import_zod16.z.string().nullable().optional(),
|
|
1062
|
+
access: import_zod16.z.string().nullable().optional(),
|
|
1039
1063
|
user: UserSchema.nullable().optional(),
|
|
1040
|
-
should_prompt_2fa:
|
|
1064
|
+
should_prompt_2fa: import_zod16.z.boolean().optional()
|
|
1041
1065
|
});
|
|
1042
1066
|
|
|
1043
1067
|
// src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
|
|
1044
|
-
var
|
|
1045
|
-
var PatchedUserProfileUpdateRequestSchema =
|
|
1046
|
-
first_name:
|
|
1047
|
-
last_name:
|
|
1048
|
-
company:
|
|
1049
|
-
phone:
|
|
1050
|
-
position:
|
|
1068
|
+
var import_zod17 = require("zod");
|
|
1069
|
+
var PatchedUserProfileUpdateRequestSchema = import_zod17.z.object({
|
|
1070
|
+
first_name: import_zod17.z.string().max(50).optional(),
|
|
1071
|
+
last_name: import_zod17.z.string().max(50).optional(),
|
|
1072
|
+
company: import_zod17.z.string().max(100).optional(),
|
|
1073
|
+
phone: import_zod17.z.string().max(20).optional(),
|
|
1074
|
+
position: import_zod17.z.string().max(100).optional()
|
|
1051
1075
|
});
|
|
1052
1076
|
|
|
1053
1077
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
|
|
1054
|
-
var
|
|
1055
|
-
var TokenRefreshSchema =
|
|
1056
|
-
access:
|
|
1057
|
-
refresh:
|
|
1078
|
+
var import_zod18 = require("zod");
|
|
1079
|
+
var TokenRefreshSchema = import_zod18.z.object({
|
|
1080
|
+
access: import_zod18.z.string(),
|
|
1081
|
+
refresh: import_zod18.z.string()
|
|
1058
1082
|
});
|
|
1059
1083
|
|
|
1060
1084
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
|
|
1061
|
-
var
|
|
1062
|
-
var TokenRefreshRequestSchema =
|
|
1063
|
-
refresh:
|
|
1085
|
+
var import_zod19 = require("zod");
|
|
1086
|
+
var TokenRefreshRequestSchema = import_zod19.z.object({
|
|
1087
|
+
refresh: import_zod19.z.string().min(1)
|
|
1064
1088
|
});
|
|
1065
1089
|
|
|
1066
1090
|
// src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
|
|
1067
|
-
var
|
|
1068
|
-
var UserProfileUpdateRequestSchema =
|
|
1069
|
-
first_name:
|
|
1070
|
-
last_name:
|
|
1071
|
-
company:
|
|
1072
|
-
phone:
|
|
1073
|
-
position:
|
|
1091
|
+
var import_zod20 = require("zod");
|
|
1092
|
+
var UserProfileUpdateRequestSchema = import_zod20.z.object({
|
|
1093
|
+
first_name: import_zod20.z.string().max(50).optional(),
|
|
1094
|
+
last_name: import_zod20.z.string().max(50).optional(),
|
|
1095
|
+
company: import_zod20.z.string().max(100).optional(),
|
|
1096
|
+
phone: import_zod20.z.string().max(20).optional(),
|
|
1097
|
+
position: import_zod20.z.string().max(100).optional()
|
|
1074
1098
|
});
|
|
1075
1099
|
|
|
1076
1100
|
// src/generated/cfg_accounts/_utils/fetchers/accounts.ts
|
|
@@ -1654,7 +1678,8 @@ var API = class {
|
|
|
1654
1678
|
this._loadTokensFromStorage();
|
|
1655
1679
|
this._client = new APIClient(this.baseUrl, {
|
|
1656
1680
|
retryConfig: this.options?.retryConfig,
|
|
1657
|
-
loggerConfig: this.options?.loggerConfig
|
|
1681
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1682
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1658
1683
|
});
|
|
1659
1684
|
this._injectAuthHeader();
|
|
1660
1685
|
this.auth = this._client.auth;
|
|
@@ -1672,7 +1697,8 @@ var API = class {
|
|
|
1672
1697
|
_reinitClients() {
|
|
1673
1698
|
this._client = new APIClient(this.baseUrl, {
|
|
1674
1699
|
retryConfig: this.options?.retryConfig,
|
|
1675
|
-
loggerConfig: this.options?.loggerConfig
|
|
1700
|
+
loggerConfig: this.options?.loggerConfig,
|
|
1701
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
1676
1702
|
});
|
|
1677
1703
|
this._injectAuthHeader();
|
|
1678
1704
|
this.auth = this._client.auth;
|
|
@@ -2343,8 +2369,10 @@ var APIClient2 = class {
|
|
|
2343
2369
|
constructor(baseUrl, options) {
|
|
2344
2370
|
this.logger = null;
|
|
2345
2371
|
this.retryConfig = null;
|
|
2372
|
+
this.tokenGetter = null;
|
|
2346
2373
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
2347
2374
|
this.httpClient = options?.httpClient || new FetchAdapter2();
|
|
2375
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
2348
2376
|
if (options?.loggerConfig !== void 0) {
|
|
2349
2377
|
this.logger = new APILogger2(options.loggerConfig);
|
|
2350
2378
|
}
|
|
@@ -2373,6 +2401,19 @@ var APIClient2 = class {
|
|
|
2373
2401
|
}
|
|
2374
2402
|
return null;
|
|
2375
2403
|
}
|
|
2404
|
+
/**
|
|
2405
|
+
* Get the base URL for building streaming/download URLs.
|
|
2406
|
+
*/
|
|
2407
|
+
getBaseUrl() {
|
|
2408
|
+
return this.baseUrl;
|
|
2409
|
+
}
|
|
2410
|
+
/**
|
|
2411
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
2412
|
+
* Returns null if no token getter is configured or no token is available.
|
|
2413
|
+
*/
|
|
2414
|
+
getToken() {
|
|
2415
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
2416
|
+
}
|
|
2376
2417
|
/**
|
|
2377
2418
|
* Make HTTP request with Django CSRF and session handling.
|
|
2378
2419
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -2625,320 +2666,320 @@ __export(schemas_exports2, {
|
|
|
2625
2666
|
});
|
|
2626
2667
|
|
|
2627
2668
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
|
|
2628
|
-
var
|
|
2629
|
-
var CentrifugoChannelInfoSchema =
|
|
2630
|
-
num_clients:
|
|
2669
|
+
var import_zod21 = require("zod");
|
|
2670
|
+
var CentrifugoChannelInfoSchema = import_zod21.z.object({
|
|
2671
|
+
num_clients: import_zod21.z.int()
|
|
2631
2672
|
});
|
|
2632
2673
|
|
|
2633
2674
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
|
|
2634
|
-
var
|
|
2635
|
-
var CentrifugoChannelsRequestRequestSchema =
|
|
2636
|
-
pattern:
|
|
2675
|
+
var import_zod22 = require("zod");
|
|
2676
|
+
var CentrifugoChannelsRequestRequestSchema = import_zod22.z.object({
|
|
2677
|
+
pattern: import_zod22.z.string().nullable().optional()
|
|
2637
2678
|
});
|
|
2638
2679
|
|
|
2639
2680
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2640
|
-
var
|
|
2681
|
+
var import_zod25 = require("zod");
|
|
2641
2682
|
|
|
2642
2683
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
|
|
2643
|
-
var
|
|
2644
|
-
var CentrifugoChannelsResultSchema =
|
|
2645
|
-
channels:
|
|
2684
|
+
var import_zod23 = require("zod");
|
|
2685
|
+
var CentrifugoChannelsResultSchema = import_zod23.z.object({
|
|
2686
|
+
channels: import_zod23.z.record(import_zod23.z.string(), CentrifugoChannelInfoSchema)
|
|
2646
2687
|
});
|
|
2647
2688
|
|
|
2648
2689
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
|
|
2649
|
-
var
|
|
2650
|
-
var CentrifugoErrorSchema =
|
|
2651
|
-
code:
|
|
2652
|
-
message:
|
|
2690
|
+
var import_zod24 = require("zod");
|
|
2691
|
+
var CentrifugoErrorSchema = import_zod24.z.object({
|
|
2692
|
+
code: import_zod24.z.int().optional(),
|
|
2693
|
+
message: import_zod24.z.string().optional()
|
|
2653
2694
|
});
|
|
2654
2695
|
|
|
2655
2696
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
|
|
2656
|
-
var CentrifugoChannelsResponseSchema =
|
|
2697
|
+
var CentrifugoChannelsResponseSchema = import_zod25.z.object({
|
|
2657
2698
|
error: CentrifugoErrorSchema.optional(),
|
|
2658
2699
|
result: CentrifugoChannelsResultSchema.optional()
|
|
2659
2700
|
});
|
|
2660
2701
|
|
|
2661
2702
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
|
|
2662
|
-
var
|
|
2663
|
-
var CentrifugoClientInfoSchema =
|
|
2664
|
-
user:
|
|
2665
|
-
client:
|
|
2666
|
-
conn_info:
|
|
2667
|
-
chan_info:
|
|
2703
|
+
var import_zod26 = require("zod");
|
|
2704
|
+
var CentrifugoClientInfoSchema = import_zod26.z.object({
|
|
2705
|
+
user: import_zod26.z.string(),
|
|
2706
|
+
client: import_zod26.z.string(),
|
|
2707
|
+
conn_info: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).nullable().optional(),
|
|
2708
|
+
chan_info: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).nullable().optional()
|
|
2668
2709
|
});
|
|
2669
2710
|
|
|
2670
2711
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
|
|
2671
|
-
var
|
|
2672
|
-
var CentrifugoHealthCheckSchema =
|
|
2673
|
-
status:
|
|
2674
|
-
wrapper_url:
|
|
2675
|
-
has_api_key:
|
|
2676
|
-
timestamp:
|
|
2712
|
+
var import_zod27 = require("zod");
|
|
2713
|
+
var CentrifugoHealthCheckSchema = import_zod27.z.object({
|
|
2714
|
+
status: import_zod27.z.string(),
|
|
2715
|
+
wrapper_url: import_zod27.z.string(),
|
|
2716
|
+
has_api_key: import_zod27.z.boolean(),
|
|
2717
|
+
timestamp: import_zod27.z.string()
|
|
2677
2718
|
});
|
|
2678
2719
|
|
|
2679
2720
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2680
|
-
var
|
|
2721
|
+
var import_zod29 = require("zod");
|
|
2681
2722
|
|
|
2682
2723
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
|
|
2683
|
-
var
|
|
2684
|
-
var CentrifugoStreamPositionSchema =
|
|
2685
|
-
offset:
|
|
2686
|
-
epoch:
|
|
2724
|
+
var import_zod28 = require("zod");
|
|
2725
|
+
var CentrifugoStreamPositionSchema = import_zod28.z.object({
|
|
2726
|
+
offset: import_zod28.z.int(),
|
|
2727
|
+
epoch: import_zod28.z.string()
|
|
2687
2728
|
});
|
|
2688
2729
|
|
|
2689
2730
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
|
|
2690
|
-
var CentrifugoHistoryRequestRequestSchema =
|
|
2691
|
-
channel:
|
|
2692
|
-
limit:
|
|
2731
|
+
var CentrifugoHistoryRequestRequestSchema = import_zod29.z.object({
|
|
2732
|
+
channel: import_zod29.z.string(),
|
|
2733
|
+
limit: import_zod29.z.int().nullable().optional(),
|
|
2693
2734
|
since: CentrifugoStreamPositionSchema.optional(),
|
|
2694
|
-
reverse:
|
|
2735
|
+
reverse: import_zod29.z.boolean().nullable().optional()
|
|
2695
2736
|
});
|
|
2696
2737
|
|
|
2697
2738
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2698
|
-
var
|
|
2739
|
+
var import_zod32 = require("zod");
|
|
2699
2740
|
|
|
2700
2741
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2701
|
-
var
|
|
2742
|
+
var import_zod31 = require("zod");
|
|
2702
2743
|
|
|
2703
2744
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
|
|
2704
|
-
var
|
|
2705
|
-
var CentrifugoPublicationSchema =
|
|
2706
|
-
data:
|
|
2745
|
+
var import_zod30 = require("zod");
|
|
2746
|
+
var CentrifugoPublicationSchema = import_zod30.z.object({
|
|
2747
|
+
data: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()),
|
|
2707
2748
|
info: CentrifugoClientInfoSchema.optional(),
|
|
2708
|
-
offset:
|
|
2709
|
-
tags:
|
|
2749
|
+
offset: import_zod30.z.int(),
|
|
2750
|
+
tags: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.any()).nullable().optional()
|
|
2710
2751
|
});
|
|
2711
2752
|
|
|
2712
2753
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
|
|
2713
|
-
var CentrifugoHistoryResultSchema =
|
|
2714
|
-
publications:
|
|
2715
|
-
epoch:
|
|
2716
|
-
offset:
|
|
2754
|
+
var CentrifugoHistoryResultSchema = import_zod31.z.object({
|
|
2755
|
+
publications: import_zod31.z.array(CentrifugoPublicationSchema),
|
|
2756
|
+
epoch: import_zod31.z.string(),
|
|
2757
|
+
offset: import_zod31.z.int()
|
|
2717
2758
|
});
|
|
2718
2759
|
|
|
2719
2760
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
|
|
2720
|
-
var CentrifugoHistoryResponseSchema =
|
|
2761
|
+
var CentrifugoHistoryResponseSchema = import_zod32.z.object({
|
|
2721
2762
|
error: CentrifugoErrorSchema.optional(),
|
|
2722
2763
|
result: CentrifugoHistoryResultSchema.optional()
|
|
2723
2764
|
});
|
|
2724
2765
|
|
|
2725
2766
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2726
|
-
var
|
|
2767
|
+
var import_zod37 = require("zod");
|
|
2727
2768
|
|
|
2728
2769
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2729
|
-
var
|
|
2770
|
+
var import_zod36 = require("zod");
|
|
2730
2771
|
|
|
2731
2772
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2732
|
-
var
|
|
2773
|
+
var import_zod35 = require("zod");
|
|
2733
2774
|
|
|
2734
2775
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
|
|
2735
|
-
var
|
|
2736
|
-
var CentrifugoMetricsSchema =
|
|
2737
|
-
interval:
|
|
2738
|
-
items:
|
|
2776
|
+
var import_zod33 = require("zod");
|
|
2777
|
+
var CentrifugoMetricsSchema = import_zod33.z.object({
|
|
2778
|
+
interval: import_zod33.z.number(),
|
|
2779
|
+
items: import_zod33.z.record(import_zod33.z.string(), import_zod33.z.number())
|
|
2739
2780
|
});
|
|
2740
2781
|
|
|
2741
2782
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
|
|
2742
|
-
var
|
|
2743
|
-
var CentrifugoProcessSchema =
|
|
2744
|
-
cpu:
|
|
2745
|
-
rss:
|
|
2783
|
+
var import_zod34 = require("zod");
|
|
2784
|
+
var CentrifugoProcessSchema = import_zod34.z.object({
|
|
2785
|
+
cpu: import_zod34.z.number(),
|
|
2786
|
+
rss: import_zod34.z.int()
|
|
2746
2787
|
});
|
|
2747
2788
|
|
|
2748
2789
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
|
|
2749
|
-
var CentrifugoNodeInfoSchema =
|
|
2750
|
-
uid:
|
|
2751
|
-
name:
|
|
2752
|
-
version:
|
|
2753
|
-
num_clients:
|
|
2754
|
-
num_users:
|
|
2755
|
-
num_channels:
|
|
2756
|
-
uptime:
|
|
2757
|
-
num_subs:
|
|
2790
|
+
var CentrifugoNodeInfoSchema = import_zod35.z.object({
|
|
2791
|
+
uid: import_zod35.z.string(),
|
|
2792
|
+
name: import_zod35.z.string(),
|
|
2793
|
+
version: import_zod35.z.string(),
|
|
2794
|
+
num_clients: import_zod35.z.int(),
|
|
2795
|
+
num_users: import_zod35.z.int(),
|
|
2796
|
+
num_channels: import_zod35.z.int(),
|
|
2797
|
+
uptime: import_zod35.z.int(),
|
|
2798
|
+
num_subs: import_zod35.z.int(),
|
|
2758
2799
|
metrics: CentrifugoMetricsSchema.optional(),
|
|
2759
2800
|
process: CentrifugoProcessSchema.optional()
|
|
2760
2801
|
});
|
|
2761
2802
|
|
|
2762
2803
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
|
|
2763
|
-
var CentrifugoInfoResultSchema =
|
|
2764
|
-
nodes:
|
|
2804
|
+
var CentrifugoInfoResultSchema = import_zod36.z.object({
|
|
2805
|
+
nodes: import_zod36.z.array(CentrifugoNodeInfoSchema)
|
|
2765
2806
|
});
|
|
2766
2807
|
|
|
2767
2808
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
|
|
2768
|
-
var CentrifugoInfoResponseSchema =
|
|
2809
|
+
var CentrifugoInfoResponseSchema = import_zod37.z.object({
|
|
2769
2810
|
error: CentrifugoErrorSchema.optional(),
|
|
2770
2811
|
result: CentrifugoInfoResultSchema.optional()
|
|
2771
2812
|
});
|
|
2772
2813
|
|
|
2773
2814
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
|
|
2774
|
-
var
|
|
2775
|
-
var CentrifugoOverviewStatsSchema =
|
|
2776
|
-
total:
|
|
2777
|
-
successful:
|
|
2778
|
-
failed:
|
|
2779
|
-
timeout:
|
|
2780
|
-
success_rate:
|
|
2781
|
-
avg_duration_ms:
|
|
2782
|
-
avg_acks_received:
|
|
2783
|
-
period_hours:
|
|
2815
|
+
var import_zod38 = require("zod");
|
|
2816
|
+
var CentrifugoOverviewStatsSchema = import_zod38.z.object({
|
|
2817
|
+
total: import_zod38.z.int(),
|
|
2818
|
+
successful: import_zod38.z.int(),
|
|
2819
|
+
failed: import_zod38.z.int(),
|
|
2820
|
+
timeout: import_zod38.z.int(),
|
|
2821
|
+
success_rate: import_zod38.z.number(),
|
|
2822
|
+
avg_duration_ms: import_zod38.z.number(),
|
|
2823
|
+
avg_acks_received: import_zod38.z.number(),
|
|
2824
|
+
period_hours: import_zod38.z.int()
|
|
2784
2825
|
});
|
|
2785
2826
|
|
|
2786
2827
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
|
|
2787
|
-
var
|
|
2788
|
-
var CentrifugoPresenceRequestRequestSchema =
|
|
2789
|
-
channel:
|
|
2828
|
+
var import_zod39 = require("zod");
|
|
2829
|
+
var CentrifugoPresenceRequestRequestSchema = import_zod39.z.object({
|
|
2830
|
+
channel: import_zod39.z.string()
|
|
2790
2831
|
});
|
|
2791
2832
|
|
|
2792
2833
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
2793
|
-
var
|
|
2834
|
+
var import_zod41 = require("zod");
|
|
2794
2835
|
|
|
2795
2836
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
|
|
2796
|
-
var
|
|
2797
|
-
var CentrifugoPresenceResultSchema =
|
|
2798
|
-
presence:
|
|
2837
|
+
var import_zod40 = require("zod");
|
|
2838
|
+
var CentrifugoPresenceResultSchema = import_zod40.z.object({
|
|
2839
|
+
presence: import_zod40.z.record(import_zod40.z.string(), CentrifugoClientInfoSchema)
|
|
2799
2840
|
});
|
|
2800
2841
|
|
|
2801
2842
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
|
|
2802
|
-
var CentrifugoPresenceResponseSchema =
|
|
2843
|
+
var CentrifugoPresenceResponseSchema = import_zod41.z.object({
|
|
2803
2844
|
error: CentrifugoErrorSchema.optional(),
|
|
2804
2845
|
result: CentrifugoPresenceResultSchema.optional()
|
|
2805
2846
|
});
|
|
2806
2847
|
|
|
2807
2848
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
|
|
2808
|
-
var
|
|
2809
|
-
var CentrifugoPresenceStatsRequestRequestSchema =
|
|
2810
|
-
channel:
|
|
2849
|
+
var import_zod42 = require("zod");
|
|
2850
|
+
var CentrifugoPresenceStatsRequestRequestSchema = import_zod42.z.object({
|
|
2851
|
+
channel: import_zod42.z.string()
|
|
2811
2852
|
});
|
|
2812
2853
|
|
|
2813
2854
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
2814
|
-
var
|
|
2855
|
+
var import_zod44 = require("zod");
|
|
2815
2856
|
|
|
2816
2857
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
|
|
2817
|
-
var
|
|
2818
|
-
var CentrifugoPresenceStatsResultSchema =
|
|
2819
|
-
num_clients:
|
|
2820
|
-
num_users:
|
|
2858
|
+
var import_zod43 = require("zod");
|
|
2859
|
+
var CentrifugoPresenceStatsResultSchema = import_zod43.z.object({
|
|
2860
|
+
num_clients: import_zod43.z.int(),
|
|
2861
|
+
num_users: import_zod43.z.int()
|
|
2821
2862
|
});
|
|
2822
2863
|
|
|
2823
2864
|
// src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
|
|
2824
|
-
var CentrifugoPresenceStatsResponseSchema =
|
|
2865
|
+
var CentrifugoPresenceStatsResponseSchema = import_zod44.z.object({
|
|
2825
2866
|
error: CentrifugoErrorSchema.optional(),
|
|
2826
2867
|
result: CentrifugoPresenceStatsResultSchema.optional()
|
|
2827
2868
|
});
|
|
2828
2869
|
|
|
2829
2870
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
2830
|
-
var
|
|
2871
|
+
var import_zod46 = require("zod");
|
|
2831
2872
|
|
|
2832
2873
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
|
|
2833
|
-
var
|
|
2834
|
-
var ChannelStatsSchema =
|
|
2835
|
-
channel:
|
|
2836
|
-
total:
|
|
2837
|
-
successful:
|
|
2838
|
-
failed:
|
|
2839
|
-
avg_duration_ms:
|
|
2840
|
-
avg_acks:
|
|
2841
|
-
last_activity_at:
|
|
2874
|
+
var import_zod45 = require("zod");
|
|
2875
|
+
var ChannelStatsSchema = import_zod45.z.object({
|
|
2876
|
+
channel: import_zod45.z.string(),
|
|
2877
|
+
total: import_zod45.z.int(),
|
|
2878
|
+
successful: import_zod45.z.int(),
|
|
2879
|
+
failed: import_zod45.z.int(),
|
|
2880
|
+
avg_duration_ms: import_zod45.z.number(),
|
|
2881
|
+
avg_acks: import_zod45.z.number(),
|
|
2882
|
+
last_activity_at: import_zod45.z.string().nullable()
|
|
2842
2883
|
});
|
|
2843
2884
|
|
|
2844
2885
|
// src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
|
|
2845
|
-
var ChannelListSchema =
|
|
2846
|
-
channels:
|
|
2847
|
-
total_channels:
|
|
2886
|
+
var ChannelListSchema = import_zod46.z.object({
|
|
2887
|
+
channels: import_zod46.z.array(ChannelStatsSchema),
|
|
2888
|
+
total_channels: import_zod46.z.int()
|
|
2848
2889
|
});
|
|
2849
2890
|
|
|
2850
2891
|
// src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
|
|
2851
|
-
var
|
|
2852
|
-
var ConnectionTokenResponseSchema =
|
|
2853
|
-
token:
|
|
2854
|
-
centrifugo_url:
|
|
2855
|
-
expires_at:
|
|
2856
|
-
channels:
|
|
2892
|
+
var import_zod47 = require("zod");
|
|
2893
|
+
var ConnectionTokenResponseSchema = import_zod47.z.object({
|
|
2894
|
+
token: import_zod47.z.string(),
|
|
2895
|
+
centrifugo_url: import_zod47.z.string(),
|
|
2896
|
+
expires_at: import_zod47.z.string(),
|
|
2897
|
+
channels: import_zod47.z.array(import_zod47.z.string())
|
|
2857
2898
|
});
|
|
2858
2899
|
|
|
2859
2900
|
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
|
|
2860
|
-
var
|
|
2861
|
-
var ManualAckRequestRequestSchema =
|
|
2862
|
-
message_id:
|
|
2863
|
-
client_id:
|
|
2901
|
+
var import_zod48 = require("zod");
|
|
2902
|
+
var ManualAckRequestRequestSchema = import_zod48.z.object({
|
|
2903
|
+
message_id: import_zod48.z.string(),
|
|
2904
|
+
client_id: import_zod48.z.string()
|
|
2864
2905
|
});
|
|
2865
2906
|
|
|
2866
2907
|
// src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
|
|
2867
|
-
var
|
|
2868
|
-
var ManualAckResponseSchema =
|
|
2869
|
-
success:
|
|
2870
|
-
message_id:
|
|
2871
|
-
error:
|
|
2908
|
+
var import_zod49 = require("zod");
|
|
2909
|
+
var ManualAckResponseSchema = import_zod49.z.object({
|
|
2910
|
+
success: import_zod49.z.boolean(),
|
|
2911
|
+
message_id: import_zod49.z.string(),
|
|
2912
|
+
error: import_zod49.z.string().nullable().optional()
|
|
2872
2913
|
});
|
|
2873
2914
|
|
|
2874
2915
|
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
2875
|
-
var
|
|
2916
|
+
var import_zod51 = require("zod");
|
|
2876
2917
|
|
|
2877
2918
|
// src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
|
|
2878
|
-
var
|
|
2879
|
-
var PublishSchema =
|
|
2880
|
-
message_id:
|
|
2881
|
-
channel:
|
|
2882
|
-
status:
|
|
2883
|
-
wait_for_ack:
|
|
2884
|
-
acks_received:
|
|
2885
|
-
acks_expected:
|
|
2886
|
-
duration_ms:
|
|
2887
|
-
created_at:
|
|
2888
|
-
completed_at:
|
|
2889
|
-
error_code:
|
|
2890
|
-
error_message:
|
|
2919
|
+
var import_zod50 = require("zod");
|
|
2920
|
+
var PublishSchema = import_zod50.z.object({
|
|
2921
|
+
message_id: import_zod50.z.string(),
|
|
2922
|
+
channel: import_zod50.z.string(),
|
|
2923
|
+
status: import_zod50.z.string(),
|
|
2924
|
+
wait_for_ack: import_zod50.z.boolean(),
|
|
2925
|
+
acks_received: import_zod50.z.int(),
|
|
2926
|
+
acks_expected: import_zod50.z.int().nullable(),
|
|
2927
|
+
duration_ms: import_zod50.z.number().nullable(),
|
|
2928
|
+
created_at: import_zod50.z.iso.datetime(),
|
|
2929
|
+
completed_at: import_zod50.z.iso.datetime().nullable(),
|
|
2930
|
+
error_code: import_zod50.z.string().nullable(),
|
|
2931
|
+
error_message: import_zod50.z.string().nullable()
|
|
2891
2932
|
});
|
|
2892
2933
|
|
|
2893
2934
|
// src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
|
|
2894
|
-
var PaginatedPublishListSchema =
|
|
2895
|
-
count:
|
|
2896
|
-
page:
|
|
2897
|
-
pages:
|
|
2898
|
-
page_size:
|
|
2899
|
-
has_next:
|
|
2900
|
-
has_previous:
|
|
2901
|
-
next_page:
|
|
2902
|
-
previous_page:
|
|
2903
|
-
results:
|
|
2935
|
+
var PaginatedPublishListSchema = import_zod51.z.object({
|
|
2936
|
+
count: import_zod51.z.int(),
|
|
2937
|
+
page: import_zod51.z.int(),
|
|
2938
|
+
pages: import_zod51.z.int(),
|
|
2939
|
+
page_size: import_zod51.z.int(),
|
|
2940
|
+
has_next: import_zod51.z.boolean(),
|
|
2941
|
+
has_previous: import_zod51.z.boolean(),
|
|
2942
|
+
next_page: import_zod51.z.int().nullable().optional(),
|
|
2943
|
+
previous_page: import_zod51.z.int().nullable().optional(),
|
|
2944
|
+
results: import_zod51.z.array(PublishSchema)
|
|
2904
2945
|
});
|
|
2905
2946
|
|
|
2906
2947
|
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
|
|
2907
|
-
var
|
|
2908
|
-
var PublishTestRequestRequestSchema =
|
|
2909
|
-
channel:
|
|
2910
|
-
data:
|
|
2911
|
-
wait_for_ack:
|
|
2912
|
-
ack_timeout:
|
|
2948
|
+
var import_zod52 = require("zod");
|
|
2949
|
+
var PublishTestRequestRequestSchema = import_zod52.z.object({
|
|
2950
|
+
channel: import_zod52.z.string(),
|
|
2951
|
+
data: import_zod52.z.record(import_zod52.z.string(), import_zod52.z.any()),
|
|
2952
|
+
wait_for_ack: import_zod52.z.boolean().optional(),
|
|
2953
|
+
ack_timeout: import_zod52.z.int().min(1).max(60).optional()
|
|
2913
2954
|
});
|
|
2914
2955
|
|
|
2915
2956
|
// src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
|
|
2916
|
-
var
|
|
2917
|
-
var PublishTestResponseSchema =
|
|
2918
|
-
success:
|
|
2919
|
-
message_id:
|
|
2920
|
-
channel:
|
|
2921
|
-
acks_received:
|
|
2922
|
-
delivered:
|
|
2923
|
-
error:
|
|
2957
|
+
var import_zod53 = require("zod");
|
|
2958
|
+
var PublishTestResponseSchema = import_zod53.z.object({
|
|
2959
|
+
success: import_zod53.z.boolean(),
|
|
2960
|
+
message_id: import_zod53.z.string(),
|
|
2961
|
+
channel: import_zod53.z.string(),
|
|
2962
|
+
acks_received: import_zod53.z.int().optional(),
|
|
2963
|
+
delivered: import_zod53.z.boolean().optional(),
|
|
2964
|
+
error: import_zod53.z.string().nullable().optional()
|
|
2924
2965
|
});
|
|
2925
2966
|
|
|
2926
2967
|
// src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
|
|
2927
|
-
var
|
|
2928
|
-
var TimelineItemSchema =
|
|
2929
|
-
timestamp:
|
|
2930
|
-
count:
|
|
2931
|
-
successful:
|
|
2932
|
-
failed:
|
|
2933
|
-
timeout:
|
|
2968
|
+
var import_zod54 = require("zod");
|
|
2969
|
+
var TimelineItemSchema = import_zod54.z.object({
|
|
2970
|
+
timestamp: import_zod54.z.string(),
|
|
2971
|
+
count: import_zod54.z.int(),
|
|
2972
|
+
successful: import_zod54.z.int(),
|
|
2973
|
+
failed: import_zod54.z.int(),
|
|
2974
|
+
timeout: import_zod54.z.int()
|
|
2934
2975
|
});
|
|
2935
2976
|
|
|
2936
2977
|
// src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
|
|
2937
|
-
var
|
|
2938
|
-
var TimelineResponseSchema =
|
|
2939
|
-
timeline:
|
|
2940
|
-
period_hours:
|
|
2941
|
-
interval:
|
|
2978
|
+
var import_zod55 = require("zod");
|
|
2979
|
+
var TimelineResponseSchema = import_zod55.z.object({
|
|
2980
|
+
timeline: import_zod55.z.array(TimelineItemSchema),
|
|
2981
|
+
period_hours: import_zod55.z.int(),
|
|
2982
|
+
interval: import_zod55.z.string()
|
|
2942
2983
|
});
|
|
2943
2984
|
|
|
2944
2985
|
// src/generated/cfg_centrifugo/_utils/fetchers/index.ts
|
|
@@ -3622,7 +3663,8 @@ var API2 = class {
|
|
|
3622
3663
|
this._loadTokensFromStorage();
|
|
3623
3664
|
this._client = new APIClient2(this.baseUrl, {
|
|
3624
3665
|
retryConfig: this.options?.retryConfig,
|
|
3625
|
-
loggerConfig: this.options?.loggerConfig
|
|
3666
|
+
loggerConfig: this.options?.loggerConfig,
|
|
3667
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
3626
3668
|
});
|
|
3627
3669
|
this._injectAuthHeader();
|
|
3628
3670
|
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
@@ -3640,7 +3682,8 @@ var API2 = class {
|
|
|
3640
3682
|
_reinitClients() {
|
|
3641
3683
|
this._client = new APIClient2(this.baseUrl, {
|
|
3642
3684
|
retryConfig: this.options?.retryConfig,
|
|
3643
|
-
loggerConfig: this.options?.loggerConfig
|
|
3685
|
+
loggerConfig: this.options?.loggerConfig,
|
|
3686
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
3644
3687
|
});
|
|
3645
3688
|
this._injectAuthHeader();
|
|
3646
3689
|
this.centrifugo_admin_api = this._client.centrifugo_admin_api;
|
|
@@ -4227,8 +4270,10 @@ var APIClient3 = class {
|
|
|
4227
4270
|
constructor(baseUrl, options) {
|
|
4228
4271
|
this.logger = null;
|
|
4229
4272
|
this.retryConfig = null;
|
|
4273
|
+
this.tokenGetter = null;
|
|
4230
4274
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
4231
4275
|
this.httpClient = options?.httpClient || new FetchAdapter3();
|
|
4276
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
4232
4277
|
if (options?.loggerConfig !== void 0) {
|
|
4233
4278
|
this.logger = new APILogger3(options.loggerConfig);
|
|
4234
4279
|
}
|
|
@@ -4258,6 +4303,19 @@ var APIClient3 = class {
|
|
|
4258
4303
|
}
|
|
4259
4304
|
return null;
|
|
4260
4305
|
}
|
|
4306
|
+
/**
|
|
4307
|
+
* Get the base URL for building streaming/download URLs.
|
|
4308
|
+
*/
|
|
4309
|
+
getBaseUrl() {
|
|
4310
|
+
return this.baseUrl;
|
|
4311
|
+
}
|
|
4312
|
+
/**
|
|
4313
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
4314
|
+
* Returns null if no token getter is configured or no token is available.
|
|
4315
|
+
*/
|
|
4316
|
+
getToken() {
|
|
4317
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
4318
|
+
}
|
|
4261
4319
|
/**
|
|
4262
4320
|
* Make HTTP request with Django CSRF and session handling.
|
|
4263
4321
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -4496,112 +4554,112 @@ __export(schemas_exports3, {
|
|
|
4496
4554
|
});
|
|
4497
4555
|
|
|
4498
4556
|
// src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts
|
|
4499
|
-
var
|
|
4500
|
-
var BackupCodesRegenerateRequestSchema =
|
|
4501
|
-
code:
|
|
4557
|
+
var import_zod56 = require("zod");
|
|
4558
|
+
var BackupCodesRegenerateRequestSchema = import_zod56.z.object({
|
|
4559
|
+
code: import_zod56.z.string().min(6).max(6)
|
|
4502
4560
|
});
|
|
4503
4561
|
|
|
4504
4562
|
// src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts
|
|
4505
|
-
var
|
|
4506
|
-
var BackupCodesRegenerateResponseSchema =
|
|
4507
|
-
backup_codes:
|
|
4508
|
-
warning:
|
|
4563
|
+
var import_zod57 = require("zod");
|
|
4564
|
+
var BackupCodesRegenerateResponseSchema = import_zod57.z.object({
|
|
4565
|
+
backup_codes: import_zod57.z.array(import_zod57.z.string()),
|
|
4566
|
+
warning: import_zod57.z.string()
|
|
4509
4567
|
});
|
|
4510
4568
|
|
|
4511
4569
|
// src/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts
|
|
4512
|
-
var
|
|
4513
|
-
var BackupCodesStatusSchema =
|
|
4514
|
-
remaining_count:
|
|
4515
|
-
total_generated:
|
|
4516
|
-
warning:
|
|
4570
|
+
var import_zod58 = require("zod");
|
|
4571
|
+
var BackupCodesStatusSchema = import_zod58.z.object({
|
|
4572
|
+
remaining_count: import_zod58.z.int(),
|
|
4573
|
+
total_generated: import_zod58.z.int(),
|
|
4574
|
+
warning: import_zod58.z.string().nullable().optional()
|
|
4517
4575
|
});
|
|
4518
4576
|
|
|
4519
4577
|
// src/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts
|
|
4520
|
-
var
|
|
4521
|
-
var ConfirmSetupRequestSchema =
|
|
4522
|
-
device_id:
|
|
4523
|
-
code:
|
|
4578
|
+
var import_zod59 = require("zod");
|
|
4579
|
+
var ConfirmSetupRequestSchema = import_zod59.z.object({
|
|
4580
|
+
device_id: import_zod59.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
4581
|
+
code: import_zod59.z.string().min(6).max(6)
|
|
4524
4582
|
});
|
|
4525
4583
|
|
|
4526
4584
|
// src/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts
|
|
4527
|
-
var
|
|
4528
|
-
var ConfirmSetupResponseSchema =
|
|
4529
|
-
message:
|
|
4530
|
-
backup_codes:
|
|
4531
|
-
backup_codes_warning:
|
|
4585
|
+
var import_zod60 = require("zod");
|
|
4586
|
+
var ConfirmSetupResponseSchema = import_zod60.z.object({
|
|
4587
|
+
message: import_zod60.z.string(),
|
|
4588
|
+
backup_codes: import_zod60.z.array(import_zod60.z.string()),
|
|
4589
|
+
backup_codes_warning: import_zod60.z.string()
|
|
4532
4590
|
});
|
|
4533
4591
|
|
|
4534
4592
|
// src/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts
|
|
4535
|
-
var
|
|
4536
|
-
var DeviceListSchema =
|
|
4537
|
-
id:
|
|
4538
|
-
name:
|
|
4539
|
-
is_primary:
|
|
4540
|
-
status:
|
|
4541
|
-
created_at:
|
|
4542
|
-
confirmed_at:
|
|
4543
|
-
last_used_at:
|
|
4593
|
+
var import_zod61 = require("zod");
|
|
4594
|
+
var DeviceListSchema = import_zod61.z.object({
|
|
4595
|
+
id: import_zod61.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
4596
|
+
name: import_zod61.z.string(),
|
|
4597
|
+
is_primary: import_zod61.z.boolean(),
|
|
4598
|
+
status: import_zod61.z.nativeEnum(DeviceListStatus),
|
|
4599
|
+
created_at: import_zod61.z.iso.datetime(),
|
|
4600
|
+
confirmed_at: import_zod61.z.iso.datetime().nullable(),
|
|
4601
|
+
last_used_at: import_zod61.z.iso.datetime().nullable()
|
|
4544
4602
|
});
|
|
4545
4603
|
|
|
4546
4604
|
// src/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts
|
|
4547
|
-
var
|
|
4548
|
-
var DisableRequestSchema =
|
|
4549
|
-
code:
|
|
4605
|
+
var import_zod62 = require("zod");
|
|
4606
|
+
var DisableRequestSchema = import_zod62.z.object({
|
|
4607
|
+
code: import_zod62.z.string().min(6).max(6)
|
|
4550
4608
|
});
|
|
4551
4609
|
|
|
4552
4610
|
// src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListList.schema.ts
|
|
4553
|
-
var
|
|
4554
|
-
var PaginatedDeviceListListSchema =
|
|
4555
|
-
count:
|
|
4556
|
-
page:
|
|
4557
|
-
pages:
|
|
4558
|
-
page_size:
|
|
4559
|
-
has_next:
|
|
4560
|
-
has_previous:
|
|
4561
|
-
next_page:
|
|
4562
|
-
previous_page:
|
|
4563
|
-
results:
|
|
4611
|
+
var import_zod63 = require("zod");
|
|
4612
|
+
var PaginatedDeviceListListSchema = import_zod63.z.object({
|
|
4613
|
+
count: import_zod63.z.int(),
|
|
4614
|
+
page: import_zod63.z.int(),
|
|
4615
|
+
pages: import_zod63.z.int(),
|
|
4616
|
+
page_size: import_zod63.z.int(),
|
|
4617
|
+
has_next: import_zod63.z.boolean(),
|
|
4618
|
+
has_previous: import_zod63.z.boolean(),
|
|
4619
|
+
next_page: import_zod63.z.int().nullable().optional(),
|
|
4620
|
+
previous_page: import_zod63.z.int().nullable().optional(),
|
|
4621
|
+
results: import_zod63.z.array(DeviceListSchema)
|
|
4564
4622
|
});
|
|
4565
4623
|
|
|
4566
4624
|
// src/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
|
|
4567
|
-
var
|
|
4568
|
-
var SetupRequestSchema =
|
|
4569
|
-
device_name:
|
|
4625
|
+
var import_zod64 = require("zod");
|
|
4626
|
+
var SetupRequestSchema = import_zod64.z.object({
|
|
4627
|
+
device_name: import_zod64.z.string().min(1).max(100).optional()
|
|
4570
4628
|
});
|
|
4571
4629
|
|
|
4572
4630
|
// src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
|
|
4573
|
-
var
|
|
4574
|
-
var SetupResponseSchema =
|
|
4575
|
-
device_id:
|
|
4576
|
-
secret:
|
|
4577
|
-
provisioning_uri:
|
|
4578
|
-
qr_code_base64:
|
|
4579
|
-
expires_in:
|
|
4631
|
+
var import_zod65 = require("zod");
|
|
4632
|
+
var SetupResponseSchema = import_zod65.z.object({
|
|
4633
|
+
device_id: import_zod65.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
4634
|
+
secret: import_zod65.z.string(),
|
|
4635
|
+
provisioning_uri: import_zod65.z.string(),
|
|
4636
|
+
qr_code_base64: import_zod65.z.string(),
|
|
4637
|
+
expires_in: import_zod65.z.int()
|
|
4580
4638
|
});
|
|
4581
4639
|
|
|
4582
4640
|
// src/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
|
|
4583
|
-
var
|
|
4584
|
-
var VerifyBackupRequestSchema =
|
|
4585
|
-
session_id:
|
|
4586
|
-
backup_code:
|
|
4641
|
+
var import_zod66 = require("zod");
|
|
4642
|
+
var VerifyBackupRequestSchema = import_zod66.z.object({
|
|
4643
|
+
session_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),
|
|
4644
|
+
backup_code: import_zod66.z.string().min(8).max(8)
|
|
4587
4645
|
});
|
|
4588
4646
|
|
|
4589
4647
|
// src/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
|
|
4590
|
-
var
|
|
4591
|
-
var VerifyRequestSchema =
|
|
4592
|
-
session_id:
|
|
4593
|
-
code:
|
|
4648
|
+
var import_zod67 = require("zod");
|
|
4649
|
+
var VerifyRequestSchema = import_zod67.z.object({
|
|
4650
|
+
session_id: import_zod67.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
|
|
4651
|
+
code: import_zod67.z.string().min(6).max(6)
|
|
4594
4652
|
});
|
|
4595
4653
|
|
|
4596
4654
|
// src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts
|
|
4597
|
-
var
|
|
4598
|
-
var VerifyResponseSchema =
|
|
4599
|
-
message:
|
|
4600
|
-
access_token:
|
|
4601
|
-
refresh_token:
|
|
4602
|
-
user:
|
|
4603
|
-
remaining_backup_codes:
|
|
4604
|
-
warning:
|
|
4655
|
+
var import_zod68 = require("zod");
|
|
4656
|
+
var VerifyResponseSchema = import_zod68.z.object({
|
|
4657
|
+
message: import_zod68.z.string(),
|
|
4658
|
+
access_token: import_zod68.z.string(),
|
|
4659
|
+
refresh_token: import_zod68.z.string(),
|
|
4660
|
+
user: import_zod68.z.record(import_zod68.z.string(), import_zod68.z.any()),
|
|
4661
|
+
remaining_backup_codes: import_zod68.z.int().optional(),
|
|
4662
|
+
warning: import_zod68.z.string().optional()
|
|
4605
4663
|
});
|
|
4606
4664
|
|
|
4607
4665
|
// src/generated/cfg_totp/_utils/fetchers/index.ts
|
|
@@ -4984,7 +5042,8 @@ var API3 = class {
|
|
|
4984
5042
|
this._loadTokensFromStorage();
|
|
4985
5043
|
this._client = new APIClient3(this.baseUrl, {
|
|
4986
5044
|
retryConfig: this.options?.retryConfig,
|
|
4987
|
-
loggerConfig: this.options?.loggerConfig
|
|
5045
|
+
loggerConfig: this.options?.loggerConfig,
|
|
5046
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
4988
5047
|
});
|
|
4989
5048
|
this._injectAuthHeader();
|
|
4990
5049
|
this.backup_codes = this._client.backup_codes;
|
|
@@ -5003,7 +5062,8 @@ var API3 = class {
|
|
|
5003
5062
|
_reinitClients() {
|
|
5004
5063
|
this._client = new APIClient3(this.baseUrl, {
|
|
5005
5064
|
retryConfig: this.options?.retryConfig,
|
|
5006
|
-
loggerConfig: this.options?.loggerConfig
|
|
5065
|
+
loggerConfig: this.options?.loggerConfig,
|
|
5066
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
5007
5067
|
});
|
|
5008
5068
|
this._injectAuthHeader();
|
|
5009
5069
|
this.backup_codes = this._client.backup_codes;
|
|
@@ -5503,8 +5563,10 @@ var APIClient4 = class {
|
|
|
5503
5563
|
constructor(baseUrl, options) {
|
|
5504
5564
|
this.logger = null;
|
|
5505
5565
|
this.retryConfig = null;
|
|
5566
|
+
this.tokenGetter = null;
|
|
5506
5567
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
5507
5568
|
this.httpClient = options?.httpClient || new FetchAdapter4();
|
|
5569
|
+
this.tokenGetter = options?.tokenGetter || null;
|
|
5508
5570
|
if (options?.loggerConfig !== void 0) {
|
|
5509
5571
|
this.logger = new APILogger4(options.loggerConfig);
|
|
5510
5572
|
}
|
|
@@ -5530,6 +5592,19 @@ var APIClient4 = class {
|
|
|
5530
5592
|
}
|
|
5531
5593
|
return null;
|
|
5532
5594
|
}
|
|
5595
|
+
/**
|
|
5596
|
+
* Get the base URL for building streaming/download URLs.
|
|
5597
|
+
*/
|
|
5598
|
+
getBaseUrl() {
|
|
5599
|
+
return this.baseUrl;
|
|
5600
|
+
}
|
|
5601
|
+
/**
|
|
5602
|
+
* Get JWT token for URL authentication (used in streaming endpoints).
|
|
5603
|
+
* Returns null if no token getter is configured or no token is available.
|
|
5604
|
+
*/
|
|
5605
|
+
getToken() {
|
|
5606
|
+
return this.tokenGetter ? this.tokenGetter() : null;
|
|
5607
|
+
}
|
|
5533
5608
|
/**
|
|
5534
5609
|
* Make HTTP request with Django CSRF and session handling.
|
|
5535
5610
|
* Automatically retries on network errors and 5xx server errors.
|
|
@@ -5752,40 +5827,40 @@ __export(schemas_exports4, {
|
|
|
5752
5827
|
});
|
|
5753
5828
|
|
|
5754
5829
|
// src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
|
|
5755
|
-
var
|
|
5756
|
-
var SendPushRequestRequestSchema =
|
|
5757
|
-
title:
|
|
5758
|
-
body:
|
|
5759
|
-
icon:
|
|
5760
|
-
url:
|
|
5830
|
+
var import_zod69 = require("zod");
|
|
5831
|
+
var SendPushRequestRequestSchema = import_zod69.z.object({
|
|
5832
|
+
title: import_zod69.z.string().min(1).max(255),
|
|
5833
|
+
body: import_zod69.z.string().min(1),
|
|
5834
|
+
icon: import_zod69.z.union([import_zod69.z.url(), import_zod69.z.literal("")]).nullable().optional(),
|
|
5835
|
+
url: import_zod69.z.union([import_zod69.z.url(), import_zod69.z.literal("")]).nullable().optional()
|
|
5761
5836
|
});
|
|
5762
5837
|
|
|
5763
5838
|
// src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
|
|
5764
|
-
var
|
|
5765
|
-
var SendPushResponseSchema =
|
|
5766
|
-
success:
|
|
5767
|
-
sent_to:
|
|
5839
|
+
var import_zod70 = require("zod");
|
|
5840
|
+
var SendPushResponseSchema = import_zod70.z.object({
|
|
5841
|
+
success: import_zod70.z.boolean(),
|
|
5842
|
+
sent_to: import_zod70.z.int()
|
|
5768
5843
|
});
|
|
5769
5844
|
|
|
5770
5845
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
|
|
5771
|
-
var
|
|
5772
|
-
var SubscribeRequestRequestSchema =
|
|
5773
|
-
endpoint:
|
|
5774
|
-
keys:
|
|
5846
|
+
var import_zod71 = require("zod");
|
|
5847
|
+
var SubscribeRequestRequestSchema = import_zod71.z.object({
|
|
5848
|
+
endpoint: import_zod71.z.union([import_zod71.z.url(), import_zod71.z.literal("")]),
|
|
5849
|
+
keys: import_zod71.z.record(import_zod71.z.string(), import_zod71.z.string().min(1))
|
|
5775
5850
|
});
|
|
5776
5851
|
|
|
5777
5852
|
// src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
|
|
5778
|
-
var
|
|
5779
|
-
var SubscribeResponseSchema =
|
|
5780
|
-
success:
|
|
5781
|
-
subscription_id:
|
|
5782
|
-
created:
|
|
5853
|
+
var import_zod72 = require("zod");
|
|
5854
|
+
var SubscribeResponseSchema = import_zod72.z.object({
|
|
5855
|
+
success: import_zod72.z.boolean(),
|
|
5856
|
+
subscription_id: import_zod72.z.int(),
|
|
5857
|
+
created: import_zod72.z.boolean()
|
|
5783
5858
|
});
|
|
5784
5859
|
|
|
5785
5860
|
// src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
|
|
5786
|
-
var
|
|
5787
|
-
var VapidPublicKeyResponseSchema =
|
|
5788
|
-
publicKey:
|
|
5861
|
+
var import_zod73 = require("zod");
|
|
5862
|
+
var VapidPublicKeyResponseSchema = import_zod73.z.object({
|
|
5863
|
+
publicKey: import_zod73.z.string()
|
|
5789
5864
|
});
|
|
5790
5865
|
|
|
5791
5866
|
// src/generated/cfg_webpush/_utils/fetchers/index.ts
|
|
@@ -5969,7 +6044,8 @@ var API4 = class {
|
|
|
5969
6044
|
this._loadTokensFromStorage();
|
|
5970
6045
|
this._client = new APIClient4(this.baseUrl, {
|
|
5971
6046
|
retryConfig: this.options?.retryConfig,
|
|
5972
|
-
loggerConfig: this.options?.loggerConfig
|
|
6047
|
+
loggerConfig: this.options?.loggerConfig,
|
|
6048
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
5973
6049
|
});
|
|
5974
6050
|
this._injectAuthHeader();
|
|
5975
6051
|
this.web_push = this._client.web_push;
|
|
@@ -5984,7 +6060,8 @@ var API4 = class {
|
|
|
5984
6060
|
_reinitClients() {
|
|
5985
6061
|
this._client = new APIClient4(this.baseUrl, {
|
|
5986
6062
|
retryConfig: this.options?.retryConfig,
|
|
5987
|
-
loggerConfig: this.options?.loggerConfig
|
|
6063
|
+
loggerConfig: this.options?.loggerConfig,
|
|
6064
|
+
tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
|
|
5988
6065
|
});
|
|
5989
6066
|
this._injectAuthHeader();
|
|
5990
6067
|
this.web_push = this._client.web_push;
|