@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.
Files changed (59) hide show
  1. package/dist/auth-server.cjs +1963 -4
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.d.cts +35 -1
  4. package/dist/auth-server.d.ts +35 -1
  5. package/dist/auth-server.mjs +1953 -4
  6. package/dist/auth-server.mjs.map +1 -1
  7. package/dist/auth.cjs +692 -497
  8. package/dist/auth.cjs.map +1 -1
  9. package/dist/auth.d.cts +18 -2
  10. package/dist/auth.d.ts +18 -2
  11. package/dist/auth.mjs +655 -460
  12. package/dist/auth.mjs.map +1 -1
  13. package/dist/clients.cjs +460 -383
  14. package/dist/clients.cjs.map +1 -1
  15. package/dist/clients.d.cts +26 -6
  16. package/dist/clients.d.ts +26 -6
  17. package/dist/clients.mjs +460 -383
  18. package/dist/clients.mjs.map +1 -1
  19. package/dist/hooks.cjs +130 -105
  20. package/dist/hooks.cjs.map +1 -1
  21. package/dist/hooks.d.cts +24 -4
  22. package/dist/hooks.d.ts +24 -4
  23. package/dist/hooks.mjs +130 -105
  24. package/dist/hooks.mjs.map +1 -1
  25. package/dist/index.cjs +373 -311
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +54 -8
  28. package/dist/index.d.ts +54 -8
  29. package/dist/index.mjs +373 -311
  30. package/dist/index.mjs.map +1 -1
  31. package/package.json +3 -3
  32. package/src/auth/context/AccountsContext.tsx +3 -3
  33. package/src/auth/context/AuthContext.tsx +56 -10
  34. package/src/auth/hooks/index.ts +3 -0
  35. package/src/auth/hooks/useProfileCache.ts +1 -1
  36. package/src/auth/hooks/useTokenRefresh.ts +161 -0
  37. package/src/auth/middlewares/index.ts +8 -1
  38. package/src/auth/middlewares/tokenRefresh.ts +158 -0
  39. package/src/generated/cfg_accounts/CLAUDE.md +2 -9
  40. package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +2 -1
  41. package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +2 -1
  42. package/src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +15 -0
  43. package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
  44. package/src/generated/cfg_accounts/accounts/models.ts +0 -1
  45. package/src/generated/cfg_accounts/accounts__user_profile/client.ts +4 -2
  46. package/src/generated/cfg_accounts/accounts__user_profile/models.ts +9 -1
  47. package/src/generated/cfg_accounts/client.ts +18 -0
  48. package/src/generated/cfg_accounts/index.ts +3 -1
  49. package/src/generated/cfg_accounts/schema.json +2 -2
  50. package/src/generated/cfg_centrifugo/CLAUDE.md +1 -8
  51. package/src/generated/cfg_centrifugo/client.ts +18 -0
  52. package/src/generated/cfg_centrifugo/index.ts +3 -1
  53. package/src/generated/cfg_totp/CLAUDE.md +1 -8
  54. package/src/generated/cfg_totp/client.ts +18 -0
  55. package/src/generated/cfg_totp/index.ts +3 -1
  56. package/src/generated/cfg_totp/totp/models.ts +2 -0
  57. package/src/generated/cfg_webpush/CLAUDE.md +1 -8
  58. package/src/generated/cfg_webpush/client.ts +18 -0
  59. package/src/generated/cfg_webpush/index.ts +3 -1
package/dist/index.mjs CHANGED
@@ -15,6 +15,7 @@ __export(cfg_accounts_exports, {
15
15
  AccountsTypes: () => models_exports4,
16
16
  AuthTypes: () => models_exports,
17
17
  CentrifugoTokenSchema: () => CentrifugoTokenSchema,
18
+ CfgAccountsProfileAvatarCreateRequestSchema: () => CfgAccountsProfileAvatarCreateRequestSchema,
18
19
  CookieStorageAdapter: () => CookieStorageAdapter,
19
20
  DEFAULT_RETRY_CONFIG: () => DEFAULT_RETRY_CONFIG,
20
21
  Enums: () => enums_exports,
@@ -178,7 +179,9 @@ var UserProfile = class {
178
179
  * multipart/form-data with 'avatar' field.
179
180
  */
180
181
  async accountsProfileAvatarCreate(data) {
181
- const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData: data });
182
+ const formData = new FormData();
183
+ formData.append("avatar", data.avatar);
184
+ const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
182
185
  return response;
183
186
  }
184
187
  /**
@@ -620,8 +623,10 @@ var APIClient = class {
620
623
  constructor(baseUrl, options) {
621
624
  this.logger = null;
622
625
  this.retryConfig = null;
626
+ this.tokenGetter = null;
623
627
  this.baseUrl = baseUrl.replace(/\/$/, "");
624
628
  this.httpClient = options?.httpClient || new FetchAdapter();
629
+ this.tokenGetter = options?.tokenGetter || null;
625
630
  if (options?.loggerConfig !== void 0) {
626
631
  this.logger = new APILogger(options.loggerConfig);
627
632
  }
@@ -650,6 +655,19 @@ var APIClient = class {
650
655
  }
651
656
  return null;
652
657
  }
658
+ /**
659
+ * Get the base URL for building streaming/download URLs.
660
+ */
661
+ getBaseUrl() {
662
+ return this.baseUrl;
663
+ }
664
+ /**
665
+ * Get JWT token for URL authentication (used in streaming endpoints).
666
+ * Returns null if no token getter is configured or no token is available.
667
+ */
668
+ getToken() {
669
+ return this.tokenGetter ? this.tokenGetter() : null;
670
+ }
653
671
  /**
654
672
  * Make HTTP request with Django CSRF and session handling.
655
673
  * Automatically retries on network errors and 5xx server errors.
@@ -965,6 +983,7 @@ var OTPVerifyRequestChannel = /* @__PURE__ */ ((OTPVerifyRequestChannel2) => {
965
983
  var schemas_exports = {};
966
984
  __export(schemas_exports, {
967
985
  CentrifugoTokenSchema: () => CentrifugoTokenSchema,
986
+ CfgAccountsProfileAvatarCreateRequestSchema: () => CfgAccountsProfileAvatarCreateRequestSchema,
968
987
  OAuthAuthorizeRequestRequestSchema: () => OAuthAuthorizeRequestRequestSchema,
969
988
  OAuthAuthorizeResponseSchema: () => OAuthAuthorizeResponseSchema,
970
989
  OAuthCallbackRequestRequestSchema: () => OAuthCallbackRequestRequestSchema,
@@ -994,168 +1013,174 @@ var CentrifugoTokenSchema = z.object({
994
1013
  channels: z.array(z.string())
995
1014
  });
996
1015
 
997
- // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
1016
+ // src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
998
1017
  import { z as z2 } from "zod";
999
- var OAuthAuthorizeRequestRequestSchema = z2.object({
1000
- redirect_uri: z2.union([z2.url(), z2.literal("")]).optional(),
1001
- source_url: z2.union([z2.url(), z2.literal("")]).optional()
1018
+ var CfgAccountsProfileAvatarCreateRequestSchema = z2.object({
1019
+ avatar: z2.union([z2.instanceof(File), z2.instanceof(Blob)])
1002
1020
  });
1003
1021
 
1004
- // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
1022
+ // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
1005
1023
  import { z as z3 } from "zod";
1006
- var OAuthAuthorizeResponseSchema = z3.object({
1007
- authorization_url: z3.union([z3.url(), z3.literal("")]),
1008
- state: z3.string()
1024
+ var OAuthAuthorizeRequestRequestSchema = z3.object({
1025
+ redirect_uri: z3.union([z3.url(), z3.literal("")]).optional(),
1026
+ source_url: z3.union([z3.url(), z3.literal("")]).optional()
1009
1027
  });
1010
1028
 
1011
- // src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
1029
+ // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
1012
1030
  import { z as z4 } from "zod";
1013
- var OAuthCallbackRequestRequestSchema = z4.object({
1014
- code: z4.string().min(10).max(500),
1015
- state: z4.string().min(20).max(100),
1016
- redirect_uri: z4.union([z4.url(), z4.literal("")]).optional()
1031
+ var OAuthAuthorizeResponseSchema = z4.object({
1032
+ authorization_url: z4.union([z4.url(), z4.literal("")]),
1033
+ state: z4.string()
1017
1034
  });
1018
1035
 
1019
- // src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
1036
+ // src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
1020
1037
  import { z as z5 } from "zod";
1021
- var OAuthConnectionSchema = z5.object({
1022
- id: z5.int(),
1023
- provider: z5.nativeEnum(OAuthConnectionProvider),
1024
- provider_display: z5.string(),
1025
- provider_username: z5.string(),
1026
- provider_email: z5.email(),
1027
- provider_avatar_url: z5.union([z5.url(), z5.literal("")]),
1028
- connected_at: z5.iso.datetime(),
1029
- last_login_at: z5.iso.datetime()
1038
+ var OAuthCallbackRequestRequestSchema = z5.object({
1039
+ code: z5.string().min(10).max(500),
1040
+ state: z5.string().min(20).max(100),
1041
+ redirect_uri: z5.union([z5.url(), z5.literal("")]).optional()
1030
1042
  });
1031
1043
 
1032
- // src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
1044
+ // src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
1033
1045
  import { z as z6 } from "zod";
1034
- var OAuthDisconnectRequestRequestSchema = z6.object({
1035
- provider: z6.nativeEnum(OAuthDisconnectRequestRequestProvider)
1046
+ var OAuthConnectionSchema = z6.object({
1047
+ id: z6.int(),
1048
+ provider: z6.nativeEnum(OAuthConnectionProvider),
1049
+ provider_display: z6.string(),
1050
+ provider_username: z6.string(),
1051
+ provider_email: z6.email(),
1052
+ provider_avatar_url: z6.union([z6.url(), z6.literal("")]),
1053
+ connected_at: z6.iso.datetime(),
1054
+ last_login_at: z6.iso.datetime()
1036
1055
  });
1037
1056
 
1038
- // src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
1057
+ // src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
1039
1058
  import { z as z7 } from "zod";
1040
- var OAuthErrorSchema = z7.object({
1041
- error: z7.string(),
1042
- error_description: z7.string().optional()
1059
+ var OAuthDisconnectRequestRequestSchema = z7.object({
1060
+ provider: z7.nativeEnum(OAuthDisconnectRequestRequestProvider)
1043
1061
  });
1044
1062
 
1045
- // src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
1063
+ // src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
1046
1064
  import { z as z8 } from "zod";
1047
- var OAuthProvidersResponseSchema = z8.object({
1048
- providers: z8.array(z8.record(z8.string(), z8.any()))
1065
+ var OAuthErrorSchema = z8.object({
1066
+ error: z8.string(),
1067
+ error_description: z8.string().optional()
1049
1068
  });
1050
1069
 
1051
- // src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
1070
+ // src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
1052
1071
  import { z as z9 } from "zod";
1053
- var OAuthTokenResponseSchema = z9.object({
1054
- requires_2fa: z9.boolean().optional(),
1055
- session_id: z9.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(),
1056
- access: z9.string().nullable().optional(),
1057
- refresh: z9.string().nullable().optional(),
1058
- user: z9.record(z9.string(), z9.any()).nullable().optional(),
1059
- is_new_user: z9.boolean(),
1060
- is_new_connection: z9.boolean(),
1061
- should_prompt_2fa: z9.boolean().optional()
1072
+ var OAuthProvidersResponseSchema = z9.object({
1073
+ providers: z9.array(z9.record(z9.string(), z9.any()))
1062
1074
  });
1063
1075
 
1064
- // src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
1076
+ // src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
1065
1077
  import { z as z10 } from "zod";
1066
- var OTPErrorResponseSchema = z10.object({
1067
- error: z10.string()
1078
+ var OAuthTokenResponseSchema = z10.object({
1079
+ requires_2fa: z10.boolean().optional(),
1080
+ session_id: z10.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
1081
+ access: z10.string().nullable().optional(),
1082
+ refresh: z10.string().nullable().optional(),
1083
+ user: z10.record(z10.string(), z10.any()).nullable().optional(),
1084
+ is_new_user: z10.boolean(),
1085
+ is_new_connection: z10.boolean(),
1086
+ should_prompt_2fa: z10.boolean().optional()
1068
1087
  });
1069
1088
 
1070
- // src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
1089
+ // src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
1071
1090
  import { z as z11 } from "zod";
1072
- var OTPRequestRequestSchema = z11.object({
1073
- identifier: z11.string().min(1),
1074
- channel: z11.nativeEnum(OTPRequestRequestChannel).optional(),
1075
- source_url: z11.union([z11.url(), z11.literal("")]).optional()
1091
+ var OTPErrorResponseSchema = z11.object({
1092
+ error: z11.string()
1076
1093
  });
1077
1094
 
1078
- // src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
1095
+ // src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
1079
1096
  import { z as z12 } from "zod";
1080
- var OTPRequestResponseSchema = z12.object({
1081
- message: z12.string()
1097
+ var OTPRequestRequestSchema = z12.object({
1098
+ identifier: z12.string().min(1),
1099
+ channel: z12.nativeEnum(OTPRequestRequestChannel).optional(),
1100
+ source_url: z12.union([z12.url(), z12.literal("")]).optional()
1082
1101
  });
1083
1102
 
1084
- // src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
1103
+ // src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
1085
1104
  import { z as z13 } from "zod";
1086
- var OTPVerifyRequestSchema = z13.object({
1087
- identifier: z13.string().min(1),
1088
- otp: z13.string().min(6).max(6),
1089
- channel: z13.nativeEnum(OTPVerifyRequestChannel).optional(),
1090
- source_url: z13.union([z13.url(), z13.literal("")]).optional()
1105
+ var OTPRequestResponseSchema = z13.object({
1106
+ message: z13.string()
1107
+ });
1108
+
1109
+ // src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
1110
+ import { z as z14 } from "zod";
1111
+ var OTPVerifyRequestSchema = z14.object({
1112
+ identifier: z14.string().min(1),
1113
+ otp: z14.string().min(6).max(6),
1114
+ channel: z14.nativeEnum(OTPVerifyRequestChannel).optional(),
1115
+ source_url: z14.union([z14.url(), z14.literal("")]).optional()
1091
1116
  });
1092
1117
 
1093
1118
  // src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
1094
- import { z as z15 } from "zod";
1119
+ import { z as z16 } from "zod";
1095
1120
 
1096
1121
  // src/generated/cfg_accounts/_utils/schemas/User.schema.ts
1097
- import { z as z14 } from "zod";
1098
- var UserSchema = z14.object({
1099
- id: z14.int(),
1100
- email: z14.email(),
1101
- first_name: z14.string().max(50).optional(),
1102
- last_name: z14.string().max(50).optional(),
1103
- full_name: z14.string(),
1104
- initials: z14.string(),
1105
- display_username: z14.string(),
1106
- company: z14.string().max(100).optional(),
1107
- phone: z14.string().max(20).optional(),
1108
- position: z14.string().max(100).optional(),
1109
- avatar: z14.union([z14.url(), z14.literal("")]).nullable(),
1110
- is_staff: z14.boolean(),
1111
- is_superuser: z14.boolean(),
1112
- date_joined: z14.iso.datetime(),
1113
- last_login: z14.iso.datetime().nullable(),
1114
- unanswered_messages_count: z14.int(),
1122
+ import { z as z15 } from "zod";
1123
+ var UserSchema = z15.object({
1124
+ id: z15.int(),
1125
+ email: z15.email(),
1126
+ first_name: z15.string().max(50).optional(),
1127
+ last_name: z15.string().max(50).optional(),
1128
+ full_name: z15.string(),
1129
+ initials: z15.string(),
1130
+ display_username: z15.string(),
1131
+ company: z15.string().max(100).optional(),
1132
+ phone: z15.string().max(20).optional(),
1133
+ position: z15.string().max(100).optional(),
1134
+ avatar: z15.union([z15.url(), z15.literal("")]).nullable(),
1135
+ is_staff: z15.boolean(),
1136
+ is_superuser: z15.boolean(),
1137
+ date_joined: z15.iso.datetime(),
1138
+ last_login: z15.iso.datetime().nullable(),
1139
+ unanswered_messages_count: z15.int(),
1115
1140
  centrifugo: CentrifugoTokenSchema.nullable()
1116
1141
  });
1117
1142
 
1118
1143
  // src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
1119
- var OTPVerifyResponseSchema = z15.object({
1120
- requires_2fa: z15.boolean().optional(),
1121
- session_id: z15.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(),
1122
- refresh: z15.string().nullable().optional(),
1123
- access: z15.string().nullable().optional(),
1144
+ var OTPVerifyResponseSchema = z16.object({
1145
+ requires_2fa: z16.boolean().optional(),
1146
+ session_id: z16.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(),
1147
+ refresh: z16.string().nullable().optional(),
1148
+ access: z16.string().nullable().optional(),
1124
1149
  user: UserSchema.nullable().optional(),
1125
- should_prompt_2fa: z15.boolean().optional()
1150
+ should_prompt_2fa: z16.boolean().optional()
1126
1151
  });
1127
1152
 
1128
1153
  // src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
1129
- import { z as z16 } from "zod";
1130
- var PatchedUserProfileUpdateRequestSchema = z16.object({
1131
- first_name: z16.string().max(50).optional(),
1132
- last_name: z16.string().max(50).optional(),
1133
- company: z16.string().max(100).optional(),
1134
- phone: z16.string().max(20).optional(),
1135
- position: z16.string().max(100).optional()
1154
+ import { z as z17 } from "zod";
1155
+ var PatchedUserProfileUpdateRequestSchema = z17.object({
1156
+ first_name: z17.string().max(50).optional(),
1157
+ last_name: z17.string().max(50).optional(),
1158
+ company: z17.string().max(100).optional(),
1159
+ phone: z17.string().max(20).optional(),
1160
+ position: z17.string().max(100).optional()
1136
1161
  });
1137
1162
 
1138
1163
  // src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
1139
- import { z as z17 } from "zod";
1140
- var TokenRefreshSchema = z17.object({
1141
- access: z17.string(),
1142
- refresh: z17.string()
1164
+ import { z as z18 } from "zod";
1165
+ var TokenRefreshSchema = z18.object({
1166
+ access: z18.string(),
1167
+ refresh: z18.string()
1143
1168
  });
1144
1169
 
1145
1170
  // src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
1146
- import { z as z18 } from "zod";
1147
- var TokenRefreshRequestSchema = z18.object({
1148
- refresh: z18.string().min(1)
1171
+ import { z as z19 } from "zod";
1172
+ var TokenRefreshRequestSchema = z19.object({
1173
+ refresh: z19.string().min(1)
1149
1174
  });
1150
1175
 
1151
1176
  // src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
1152
- import { z as z19 } from "zod";
1153
- var UserProfileUpdateRequestSchema = z19.object({
1154
- first_name: z19.string().max(50).optional(),
1155
- last_name: z19.string().max(50).optional(),
1156
- company: z19.string().max(100).optional(),
1157
- phone: z19.string().max(20).optional(),
1158
- position: z19.string().max(100).optional()
1177
+ import { z as z20 } from "zod";
1178
+ var UserProfileUpdateRequestSchema = z20.object({
1179
+ first_name: z20.string().max(50).optional(),
1180
+ last_name: z20.string().max(50).optional(),
1181
+ company: z20.string().max(100).optional(),
1182
+ phone: z20.string().max(20).optional(),
1183
+ position: z20.string().max(100).optional()
1159
1184
  });
1160
1185
 
1161
1186
  // src/generated/cfg_accounts/validation-events.ts
@@ -1843,7 +1868,8 @@ var API = class {
1843
1868
  this._loadTokensFromStorage();
1844
1869
  this._client = new APIClient(this.baseUrl, {
1845
1870
  retryConfig: this.options?.retryConfig,
1846
- loggerConfig: this.options?.loggerConfig
1871
+ loggerConfig: this.options?.loggerConfig,
1872
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
1847
1873
  });
1848
1874
  this._injectAuthHeader();
1849
1875
  this.auth = this._client.auth;
@@ -1861,7 +1887,8 @@ var API = class {
1861
1887
  _reinitClients() {
1862
1888
  this._client = new APIClient(this.baseUrl, {
1863
1889
  retryConfig: this.options?.retryConfig,
1864
- loggerConfig: this.options?.loggerConfig
1890
+ loggerConfig: this.options?.loggerConfig,
1891
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
1865
1892
  });
1866
1893
  this._injectAuthHeader();
1867
1894
  this.auth = this._client.auth;
@@ -2533,8 +2560,10 @@ var APIClient2 = class {
2533
2560
  constructor(baseUrl, options) {
2534
2561
  this.logger = null;
2535
2562
  this.retryConfig = null;
2563
+ this.tokenGetter = null;
2536
2564
  this.baseUrl = baseUrl.replace(/\/$/, "");
2537
2565
  this.httpClient = options?.httpClient || new FetchAdapter2();
2566
+ this.tokenGetter = options?.tokenGetter || null;
2538
2567
  if (options?.loggerConfig !== void 0) {
2539
2568
  this.logger = new APILogger2(options.loggerConfig);
2540
2569
  }
@@ -2563,6 +2592,19 @@ var APIClient2 = class {
2563
2592
  }
2564
2593
  return null;
2565
2594
  }
2595
+ /**
2596
+ * Get the base URL for building streaming/download URLs.
2597
+ */
2598
+ getBaseUrl() {
2599
+ return this.baseUrl;
2600
+ }
2601
+ /**
2602
+ * Get JWT token for URL authentication (used in streaming endpoints).
2603
+ * Returns null if no token getter is configured or no token is available.
2604
+ */
2605
+ getToken() {
2606
+ return this.tokenGetter ? this.tokenGetter() : null;
2607
+ }
2566
2608
  /**
2567
2609
  * Make HTTP request with Django CSRF and session handling.
2568
2610
  * Automatically retries on network errors and 5xx server errors.
@@ -2775,320 +2817,320 @@ var LocalStorageAdapter2 = class {
2775
2817
  };
2776
2818
 
2777
2819
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
2778
- import { z as z20 } from "zod";
2779
- var CentrifugoChannelInfoSchema = z20.object({
2780
- num_clients: z20.int()
2820
+ import { z as z21 } from "zod";
2821
+ var CentrifugoChannelInfoSchema = z21.object({
2822
+ num_clients: z21.int()
2781
2823
  });
2782
2824
 
2783
2825
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
2784
- import { z as z21 } from "zod";
2785
- var CentrifugoChannelsRequestRequestSchema = z21.object({
2786
- pattern: z21.string().nullable().optional()
2826
+ import { z as z22 } from "zod";
2827
+ var CentrifugoChannelsRequestRequestSchema = z22.object({
2828
+ pattern: z22.string().nullable().optional()
2787
2829
  });
2788
2830
 
2789
2831
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
2790
- import { z as z24 } from "zod";
2832
+ import { z as z25 } from "zod";
2791
2833
 
2792
2834
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
2793
- import { z as z22 } from "zod";
2794
- var CentrifugoChannelsResultSchema = z22.object({
2795
- channels: z22.record(z22.string(), CentrifugoChannelInfoSchema)
2835
+ import { z as z23 } from "zod";
2836
+ var CentrifugoChannelsResultSchema = z23.object({
2837
+ channels: z23.record(z23.string(), CentrifugoChannelInfoSchema)
2796
2838
  });
2797
2839
 
2798
2840
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
2799
- import { z as z23 } from "zod";
2800
- var CentrifugoErrorSchema = z23.object({
2801
- code: z23.int().optional(),
2802
- message: z23.string().optional()
2841
+ import { z as z24 } from "zod";
2842
+ var CentrifugoErrorSchema = z24.object({
2843
+ code: z24.int().optional(),
2844
+ message: z24.string().optional()
2803
2845
  });
2804
2846
 
2805
2847
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
2806
- var CentrifugoChannelsResponseSchema = z24.object({
2848
+ var CentrifugoChannelsResponseSchema = z25.object({
2807
2849
  error: CentrifugoErrorSchema.optional(),
2808
2850
  result: CentrifugoChannelsResultSchema.optional()
2809
2851
  });
2810
2852
 
2811
2853
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
2812
- import { z as z25 } from "zod";
2813
- var CentrifugoClientInfoSchema = z25.object({
2814
- user: z25.string(),
2815
- client: z25.string(),
2816
- conn_info: z25.record(z25.string(), z25.any()).nullable().optional(),
2817
- chan_info: z25.record(z25.string(), z25.any()).nullable().optional()
2854
+ import { z as z26 } from "zod";
2855
+ var CentrifugoClientInfoSchema = z26.object({
2856
+ user: z26.string(),
2857
+ client: z26.string(),
2858
+ conn_info: z26.record(z26.string(), z26.any()).nullable().optional(),
2859
+ chan_info: z26.record(z26.string(), z26.any()).nullable().optional()
2818
2860
  });
2819
2861
 
2820
2862
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
2821
- import { z as z26 } from "zod";
2822
- var CentrifugoHealthCheckSchema = z26.object({
2823
- status: z26.string(),
2824
- wrapper_url: z26.string(),
2825
- has_api_key: z26.boolean(),
2826
- timestamp: z26.string()
2863
+ import { z as z27 } from "zod";
2864
+ var CentrifugoHealthCheckSchema = z27.object({
2865
+ status: z27.string(),
2866
+ wrapper_url: z27.string(),
2867
+ has_api_key: z27.boolean(),
2868
+ timestamp: z27.string()
2827
2869
  });
2828
2870
 
2829
2871
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
2830
- import { z as z28 } from "zod";
2872
+ import { z as z29 } from "zod";
2831
2873
 
2832
2874
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
2833
- import { z as z27 } from "zod";
2834
- var CentrifugoStreamPositionSchema = z27.object({
2835
- offset: z27.int(),
2836
- epoch: z27.string()
2875
+ import { z as z28 } from "zod";
2876
+ var CentrifugoStreamPositionSchema = z28.object({
2877
+ offset: z28.int(),
2878
+ epoch: z28.string()
2837
2879
  });
2838
2880
 
2839
2881
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
2840
- var CentrifugoHistoryRequestRequestSchema = z28.object({
2841
- channel: z28.string(),
2842
- limit: z28.int().nullable().optional(),
2882
+ var CentrifugoHistoryRequestRequestSchema = z29.object({
2883
+ channel: z29.string(),
2884
+ limit: z29.int().nullable().optional(),
2843
2885
  since: CentrifugoStreamPositionSchema.optional(),
2844
- reverse: z28.boolean().nullable().optional()
2886
+ reverse: z29.boolean().nullable().optional()
2845
2887
  });
2846
2888
 
2847
2889
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
2848
- import { z as z31 } from "zod";
2890
+ import { z as z32 } from "zod";
2849
2891
 
2850
2892
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
2851
- import { z as z30 } from "zod";
2893
+ import { z as z31 } from "zod";
2852
2894
 
2853
2895
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
2854
- import { z as z29 } from "zod";
2855
- var CentrifugoPublicationSchema = z29.object({
2856
- data: z29.record(z29.string(), z29.any()),
2896
+ import { z as z30 } from "zod";
2897
+ var CentrifugoPublicationSchema = z30.object({
2898
+ data: z30.record(z30.string(), z30.any()),
2857
2899
  info: CentrifugoClientInfoSchema.optional(),
2858
- offset: z29.int(),
2859
- tags: z29.record(z29.string(), z29.any()).nullable().optional()
2900
+ offset: z30.int(),
2901
+ tags: z30.record(z30.string(), z30.any()).nullable().optional()
2860
2902
  });
2861
2903
 
2862
2904
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
2863
- var CentrifugoHistoryResultSchema = z30.object({
2864
- publications: z30.array(CentrifugoPublicationSchema),
2865
- epoch: z30.string(),
2866
- offset: z30.int()
2905
+ var CentrifugoHistoryResultSchema = z31.object({
2906
+ publications: z31.array(CentrifugoPublicationSchema),
2907
+ epoch: z31.string(),
2908
+ offset: z31.int()
2867
2909
  });
2868
2910
 
2869
2911
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
2870
- var CentrifugoHistoryResponseSchema = z31.object({
2912
+ var CentrifugoHistoryResponseSchema = z32.object({
2871
2913
  error: CentrifugoErrorSchema.optional(),
2872
2914
  result: CentrifugoHistoryResultSchema.optional()
2873
2915
  });
2874
2916
 
2875
2917
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
2876
- import { z as z36 } from "zod";
2918
+ import { z as z37 } from "zod";
2877
2919
 
2878
2920
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
2879
- import { z as z35 } from "zod";
2921
+ import { z as z36 } from "zod";
2880
2922
 
2881
2923
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
2882
- import { z as z34 } from "zod";
2924
+ import { z as z35 } from "zod";
2883
2925
 
2884
2926
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
2885
- import { z as z32 } from "zod";
2886
- var CentrifugoMetricsSchema = z32.object({
2887
- interval: z32.number(),
2888
- items: z32.record(z32.string(), z32.number())
2927
+ import { z as z33 } from "zod";
2928
+ var CentrifugoMetricsSchema = z33.object({
2929
+ interval: z33.number(),
2930
+ items: z33.record(z33.string(), z33.number())
2889
2931
  });
2890
2932
 
2891
2933
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
2892
- import { z as z33 } from "zod";
2893
- var CentrifugoProcessSchema = z33.object({
2894
- cpu: z33.number(),
2895
- rss: z33.int()
2934
+ import { z as z34 } from "zod";
2935
+ var CentrifugoProcessSchema = z34.object({
2936
+ cpu: z34.number(),
2937
+ rss: z34.int()
2896
2938
  });
2897
2939
 
2898
2940
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
2899
- var CentrifugoNodeInfoSchema = z34.object({
2900
- uid: z34.string(),
2901
- name: z34.string(),
2902
- version: z34.string(),
2903
- num_clients: z34.int(),
2904
- num_users: z34.int(),
2905
- num_channels: z34.int(),
2906
- uptime: z34.int(),
2907
- num_subs: z34.int(),
2941
+ var CentrifugoNodeInfoSchema = z35.object({
2942
+ uid: z35.string(),
2943
+ name: z35.string(),
2944
+ version: z35.string(),
2945
+ num_clients: z35.int(),
2946
+ num_users: z35.int(),
2947
+ num_channels: z35.int(),
2948
+ uptime: z35.int(),
2949
+ num_subs: z35.int(),
2908
2950
  metrics: CentrifugoMetricsSchema.optional(),
2909
2951
  process: CentrifugoProcessSchema.optional()
2910
2952
  });
2911
2953
 
2912
2954
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
2913
- var CentrifugoInfoResultSchema = z35.object({
2914
- nodes: z35.array(CentrifugoNodeInfoSchema)
2955
+ var CentrifugoInfoResultSchema = z36.object({
2956
+ nodes: z36.array(CentrifugoNodeInfoSchema)
2915
2957
  });
2916
2958
 
2917
2959
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
2918
- var CentrifugoInfoResponseSchema = z36.object({
2960
+ var CentrifugoInfoResponseSchema = z37.object({
2919
2961
  error: CentrifugoErrorSchema.optional(),
2920
2962
  result: CentrifugoInfoResultSchema.optional()
2921
2963
  });
2922
2964
 
2923
2965
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
2924
- import { z as z37 } from "zod";
2925
- var CentrifugoOverviewStatsSchema = z37.object({
2926
- total: z37.int(),
2927
- successful: z37.int(),
2928
- failed: z37.int(),
2929
- timeout: z37.int(),
2930
- success_rate: z37.number(),
2931
- avg_duration_ms: z37.number(),
2932
- avg_acks_received: z37.number(),
2933
- period_hours: z37.int()
2966
+ import { z as z38 } from "zod";
2967
+ var CentrifugoOverviewStatsSchema = z38.object({
2968
+ total: z38.int(),
2969
+ successful: z38.int(),
2970
+ failed: z38.int(),
2971
+ timeout: z38.int(),
2972
+ success_rate: z38.number(),
2973
+ avg_duration_ms: z38.number(),
2974
+ avg_acks_received: z38.number(),
2975
+ period_hours: z38.int()
2934
2976
  });
2935
2977
 
2936
2978
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
2937
- import { z as z38 } from "zod";
2938
- var CentrifugoPresenceRequestRequestSchema = z38.object({
2939
- channel: z38.string()
2979
+ import { z as z39 } from "zod";
2980
+ var CentrifugoPresenceRequestRequestSchema = z39.object({
2981
+ channel: z39.string()
2940
2982
  });
2941
2983
 
2942
2984
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
2943
- import { z as z40 } from "zod";
2985
+ import { z as z41 } from "zod";
2944
2986
 
2945
2987
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
2946
- import { z as z39 } from "zod";
2947
- var CentrifugoPresenceResultSchema = z39.object({
2948
- presence: z39.record(z39.string(), CentrifugoClientInfoSchema)
2988
+ import { z as z40 } from "zod";
2989
+ var CentrifugoPresenceResultSchema = z40.object({
2990
+ presence: z40.record(z40.string(), CentrifugoClientInfoSchema)
2949
2991
  });
2950
2992
 
2951
2993
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
2952
- var CentrifugoPresenceResponseSchema = z40.object({
2994
+ var CentrifugoPresenceResponseSchema = z41.object({
2953
2995
  error: CentrifugoErrorSchema.optional(),
2954
2996
  result: CentrifugoPresenceResultSchema.optional()
2955
2997
  });
2956
2998
 
2957
2999
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
2958
- import { z as z41 } from "zod";
2959
- var CentrifugoPresenceStatsRequestRequestSchema = z41.object({
2960
- channel: z41.string()
3000
+ import { z as z42 } from "zod";
3001
+ var CentrifugoPresenceStatsRequestRequestSchema = z42.object({
3002
+ channel: z42.string()
2961
3003
  });
2962
3004
 
2963
3005
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
2964
- import { z as z43 } from "zod";
3006
+ import { z as z44 } from "zod";
2965
3007
 
2966
3008
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
2967
- import { z as z42 } from "zod";
2968
- var CentrifugoPresenceStatsResultSchema = z42.object({
2969
- num_clients: z42.int(),
2970
- num_users: z42.int()
3009
+ import { z as z43 } from "zod";
3010
+ var CentrifugoPresenceStatsResultSchema = z43.object({
3011
+ num_clients: z43.int(),
3012
+ num_users: z43.int()
2971
3013
  });
2972
3014
 
2973
3015
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
2974
- var CentrifugoPresenceStatsResponseSchema = z43.object({
3016
+ var CentrifugoPresenceStatsResponseSchema = z44.object({
2975
3017
  error: CentrifugoErrorSchema.optional(),
2976
3018
  result: CentrifugoPresenceStatsResultSchema.optional()
2977
3019
  });
2978
3020
 
2979
3021
  // src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
2980
- import { z as z45 } from "zod";
3022
+ import { z as z46 } from "zod";
2981
3023
 
2982
3024
  // src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
2983
- import { z as z44 } from "zod";
2984
- var ChannelStatsSchema = z44.object({
2985
- channel: z44.string(),
2986
- total: z44.int(),
2987
- successful: z44.int(),
2988
- failed: z44.int(),
2989
- avg_duration_ms: z44.number(),
2990
- avg_acks: z44.number(),
2991
- last_activity_at: z44.string().nullable()
3025
+ import { z as z45 } from "zod";
3026
+ var ChannelStatsSchema = z45.object({
3027
+ channel: z45.string(),
3028
+ total: z45.int(),
3029
+ successful: z45.int(),
3030
+ failed: z45.int(),
3031
+ avg_duration_ms: z45.number(),
3032
+ avg_acks: z45.number(),
3033
+ last_activity_at: z45.string().nullable()
2992
3034
  });
2993
3035
 
2994
3036
  // src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
2995
- var ChannelListSchema = z45.object({
2996
- channels: z45.array(ChannelStatsSchema),
2997
- total_channels: z45.int()
3037
+ var ChannelListSchema = z46.object({
3038
+ channels: z46.array(ChannelStatsSchema),
3039
+ total_channels: z46.int()
2998
3040
  });
2999
3041
 
3000
3042
  // src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
3001
- import { z as z46 } from "zod";
3002
- var ConnectionTokenResponseSchema = z46.object({
3003
- token: z46.string(),
3004
- centrifugo_url: z46.string(),
3005
- expires_at: z46.string(),
3006
- channels: z46.array(z46.string())
3043
+ import { z as z47 } from "zod";
3044
+ var ConnectionTokenResponseSchema = z47.object({
3045
+ token: z47.string(),
3046
+ centrifugo_url: z47.string(),
3047
+ expires_at: z47.string(),
3048
+ channels: z47.array(z47.string())
3007
3049
  });
3008
3050
 
3009
3051
  // src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
3010
- import { z as z47 } from "zod";
3011
- var ManualAckRequestRequestSchema = z47.object({
3012
- message_id: z47.string(),
3013
- client_id: z47.string()
3052
+ import { z as z48 } from "zod";
3053
+ var ManualAckRequestRequestSchema = z48.object({
3054
+ message_id: z48.string(),
3055
+ client_id: z48.string()
3014
3056
  });
3015
3057
 
3016
3058
  // src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
3017
- import { z as z48 } from "zod";
3018
- var ManualAckResponseSchema = z48.object({
3019
- success: z48.boolean(),
3020
- message_id: z48.string(),
3021
- error: z48.string().nullable().optional()
3059
+ import { z as z49 } from "zod";
3060
+ var ManualAckResponseSchema = z49.object({
3061
+ success: z49.boolean(),
3062
+ message_id: z49.string(),
3063
+ error: z49.string().nullable().optional()
3022
3064
  });
3023
3065
 
3024
3066
  // src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
3025
- import { z as z50 } from "zod";
3067
+ import { z as z51 } from "zod";
3026
3068
 
3027
3069
  // src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
3028
- import { z as z49 } from "zod";
3029
- var PublishSchema = z49.object({
3030
- message_id: z49.string(),
3031
- channel: z49.string(),
3032
- status: z49.string(),
3033
- wait_for_ack: z49.boolean(),
3034
- acks_received: z49.int(),
3035
- acks_expected: z49.int().nullable(),
3036
- duration_ms: z49.number().nullable(),
3037
- created_at: z49.iso.datetime(),
3038
- completed_at: z49.iso.datetime().nullable(),
3039
- error_code: z49.string().nullable(),
3040
- error_message: z49.string().nullable()
3070
+ import { z as z50 } from "zod";
3071
+ var PublishSchema = z50.object({
3072
+ message_id: z50.string(),
3073
+ channel: z50.string(),
3074
+ status: z50.string(),
3075
+ wait_for_ack: z50.boolean(),
3076
+ acks_received: z50.int(),
3077
+ acks_expected: z50.int().nullable(),
3078
+ duration_ms: z50.number().nullable(),
3079
+ created_at: z50.iso.datetime(),
3080
+ completed_at: z50.iso.datetime().nullable(),
3081
+ error_code: z50.string().nullable(),
3082
+ error_message: z50.string().nullable()
3041
3083
  });
3042
3084
 
3043
3085
  // src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
3044
- var PaginatedPublishListSchema = z50.object({
3045
- count: z50.int(),
3046
- page: z50.int(),
3047
- pages: z50.int(),
3048
- page_size: z50.int(),
3049
- has_next: z50.boolean(),
3050
- has_previous: z50.boolean(),
3051
- next_page: z50.int().nullable().optional(),
3052
- previous_page: z50.int().nullable().optional(),
3053
- results: z50.array(PublishSchema)
3086
+ var PaginatedPublishListSchema = z51.object({
3087
+ count: z51.int(),
3088
+ page: z51.int(),
3089
+ pages: z51.int(),
3090
+ page_size: z51.int(),
3091
+ has_next: z51.boolean(),
3092
+ has_previous: z51.boolean(),
3093
+ next_page: z51.int().nullable().optional(),
3094
+ previous_page: z51.int().nullable().optional(),
3095
+ results: z51.array(PublishSchema)
3054
3096
  });
3055
3097
 
3056
3098
  // src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
3057
- import { z as z51 } from "zod";
3058
- var PublishTestRequestRequestSchema = z51.object({
3059
- channel: z51.string(),
3060
- data: z51.record(z51.string(), z51.any()),
3061
- wait_for_ack: z51.boolean().optional(),
3062
- ack_timeout: z51.int().min(1).max(60).optional()
3099
+ import { z as z52 } from "zod";
3100
+ var PublishTestRequestRequestSchema = z52.object({
3101
+ channel: z52.string(),
3102
+ data: z52.record(z52.string(), z52.any()),
3103
+ wait_for_ack: z52.boolean().optional(),
3104
+ ack_timeout: z52.int().min(1).max(60).optional()
3063
3105
  });
3064
3106
 
3065
3107
  // src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
3066
- import { z as z52 } from "zod";
3067
- var PublishTestResponseSchema = z52.object({
3068
- success: z52.boolean(),
3069
- message_id: z52.string(),
3070
- channel: z52.string(),
3071
- acks_received: z52.int().optional(),
3072
- delivered: z52.boolean().optional(),
3073
- error: z52.string().nullable().optional()
3108
+ import { z as z53 } from "zod";
3109
+ var PublishTestResponseSchema = z53.object({
3110
+ success: z53.boolean(),
3111
+ message_id: z53.string(),
3112
+ channel: z53.string(),
3113
+ acks_received: z53.int().optional(),
3114
+ delivered: z53.boolean().optional(),
3115
+ error: z53.string().nullable().optional()
3074
3116
  });
3075
3117
 
3076
3118
  // src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
3077
- import { z as z53 } from "zod";
3078
- var TimelineItemSchema = z53.object({
3079
- timestamp: z53.string(),
3080
- count: z53.int(),
3081
- successful: z53.int(),
3082
- failed: z53.int(),
3083
- timeout: z53.int()
3119
+ import { z as z54 } from "zod";
3120
+ var TimelineItemSchema = z54.object({
3121
+ timestamp: z54.string(),
3122
+ count: z54.int(),
3123
+ successful: z54.int(),
3124
+ failed: z54.int(),
3125
+ timeout: z54.int()
3084
3126
  });
3085
3127
 
3086
3128
  // src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
3087
- import { z as z54 } from "zod";
3088
- var TimelineResponseSchema = z54.object({
3089
- timeline: z54.array(TimelineItemSchema),
3090
- period_hours: z54.int(),
3091
- interval: z54.string()
3129
+ import { z as z55 } from "zod";
3130
+ var TimelineResponseSchema = z55.object({
3131
+ timeline: z55.array(TimelineItemSchema),
3132
+ period_hours: z55.int(),
3133
+ interval: z55.string()
3092
3134
  });
3093
3135
 
3094
3136
  // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
@@ -3185,7 +3227,8 @@ var API2 = class {
3185
3227
  this._loadTokensFromStorage();
3186
3228
  this._client = new APIClient2(this.baseUrl, {
3187
3229
  retryConfig: this.options?.retryConfig,
3188
- loggerConfig: this.options?.loggerConfig
3230
+ loggerConfig: this.options?.loggerConfig,
3231
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
3189
3232
  });
3190
3233
  this._injectAuthHeader();
3191
3234
  this.centrifugo_admin_api = this._client.centrifugo_admin_api;
@@ -3203,7 +3246,8 @@ var API2 = class {
3203
3246
  _reinitClients() {
3204
3247
  this._client = new APIClient2(this.baseUrl, {
3205
3248
  retryConfig: this.options?.retryConfig,
3206
- loggerConfig: this.options?.loggerConfig
3249
+ loggerConfig: this.options?.loggerConfig,
3250
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
3207
3251
  });
3208
3252
  this._injectAuthHeader();
3209
3253
  this.centrifugo_admin_api = this._client.centrifugo_admin_api;
@@ -3745,8 +3789,10 @@ var APIClient3 = class {
3745
3789
  constructor(baseUrl, options) {
3746
3790
  this.logger = null;
3747
3791
  this.retryConfig = null;
3792
+ this.tokenGetter = null;
3748
3793
  this.baseUrl = baseUrl.replace(/\/$/, "");
3749
3794
  this.httpClient = options?.httpClient || new FetchAdapter3();
3795
+ this.tokenGetter = options?.tokenGetter || null;
3750
3796
  if (options?.loggerConfig !== void 0) {
3751
3797
  this.logger = new APILogger3(options.loggerConfig);
3752
3798
  }
@@ -3772,6 +3818,19 @@ var APIClient3 = class {
3772
3818
  }
3773
3819
  return null;
3774
3820
  }
3821
+ /**
3822
+ * Get the base URL for building streaming/download URLs.
3823
+ */
3824
+ getBaseUrl() {
3825
+ return this.baseUrl;
3826
+ }
3827
+ /**
3828
+ * Get JWT token for URL authentication (used in streaming endpoints).
3829
+ * Returns null if no token getter is configured or no token is available.
3830
+ */
3831
+ getToken() {
3832
+ return this.tokenGetter ? this.tokenGetter() : null;
3833
+ }
3775
3834
  /**
3776
3835
  * Make HTTP request with Django CSRF and session handling.
3777
3836
  * Automatically retries on network errors and 5xx server errors.
@@ -4067,40 +4126,40 @@ __export(schemas_exports3, {
4067
4126
  });
4068
4127
 
4069
4128
  // src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
4070
- import { z as z55 } from "zod";
4071
- var SendPushRequestRequestSchema = z55.object({
4072
- title: z55.string().min(1).max(255),
4073
- body: z55.string().min(1),
4074
- icon: z55.union([z55.url(), z55.literal("")]).nullable().optional(),
4075
- url: z55.union([z55.url(), z55.literal("")]).nullable().optional()
4129
+ import { z as z56 } from "zod";
4130
+ var SendPushRequestRequestSchema = z56.object({
4131
+ title: z56.string().min(1).max(255),
4132
+ body: z56.string().min(1),
4133
+ icon: z56.union([z56.url(), z56.literal("")]).nullable().optional(),
4134
+ url: z56.union([z56.url(), z56.literal("")]).nullable().optional()
4076
4135
  });
4077
4136
 
4078
4137
  // src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
4079
- import { z as z56 } from "zod";
4080
- var SendPushResponseSchema = z56.object({
4081
- success: z56.boolean(),
4082
- sent_to: z56.int()
4138
+ import { z as z57 } from "zod";
4139
+ var SendPushResponseSchema = z57.object({
4140
+ success: z57.boolean(),
4141
+ sent_to: z57.int()
4083
4142
  });
4084
4143
 
4085
4144
  // src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
4086
- import { z as z57 } from "zod";
4087
- var SubscribeRequestRequestSchema = z57.object({
4088
- endpoint: z57.union([z57.url(), z57.literal("")]),
4089
- keys: z57.record(z57.string(), z57.string().min(1))
4145
+ import { z as z58 } from "zod";
4146
+ var SubscribeRequestRequestSchema = z58.object({
4147
+ endpoint: z58.union([z58.url(), z58.literal("")]),
4148
+ keys: z58.record(z58.string(), z58.string().min(1))
4090
4149
  });
4091
4150
 
4092
4151
  // src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
4093
- import { z as z58 } from "zod";
4094
- var SubscribeResponseSchema = z58.object({
4095
- success: z58.boolean(),
4096
- subscription_id: z58.int(),
4097
- created: z58.boolean()
4152
+ import { z as z59 } from "zod";
4153
+ var SubscribeResponseSchema = z59.object({
4154
+ success: z59.boolean(),
4155
+ subscription_id: z59.int(),
4156
+ created: z59.boolean()
4098
4157
  });
4099
4158
 
4100
4159
  // src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
4101
- import { z as z59 } from "zod";
4102
- var VapidPublicKeyResponseSchema = z59.object({
4103
- publicKey: z59.string()
4160
+ import { z as z60 } from "zod";
4161
+ var VapidPublicKeyResponseSchema = z60.object({
4162
+ publicKey: z60.string()
4104
4163
  });
4105
4164
 
4106
4165
  // src/generated/cfg_webpush/validation-events.ts
@@ -4369,7 +4428,8 @@ var API3 = class {
4369
4428
  this._loadTokensFromStorage();
4370
4429
  this._client = new APIClient3(this.baseUrl, {
4371
4430
  retryConfig: this.options?.retryConfig,
4372
- loggerConfig: this.options?.loggerConfig
4431
+ loggerConfig: this.options?.loggerConfig,
4432
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
4373
4433
  });
4374
4434
  this._injectAuthHeader();
4375
4435
  this.web_push = this._client.web_push;
@@ -4384,7 +4444,8 @@ var API3 = class {
4384
4444
  _reinitClients() {
4385
4445
  this._client = new APIClient3(this.baseUrl, {
4386
4446
  retryConfig: this.options?.retryConfig,
4387
- loggerConfig: this.options?.loggerConfig
4447
+ loggerConfig: this.options?.loggerConfig,
4448
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
4388
4449
  });
4389
4450
  this._injectAuthHeader();
4390
4451
  this.web_push = this._client.web_push;
@@ -4503,6 +4564,7 @@ export {
4503
4564
  models_exports as AuthTypes,
4504
4565
  BaseClient,
4505
4566
  CentrifugoTokenSchema,
4567
+ CfgAccountsProfileAvatarCreateRequestSchema,
4506
4568
  cfg_accounts_exports as CfgAccountsTypes,
4507
4569
  CookieStorageAdapter,
4508
4570
  DEFAULT_RETRY_CONFIG,