@djangocfg/api 2.1.88 → 2.1.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/auth-server.cjs +335 -320
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +335 -320
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +464 -394
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.d.cts +1 -1
  8. package/dist/auth.d.ts +1 -1
  9. package/dist/auth.mjs +464 -394
  10. package/dist/auth.mjs.map +1 -1
  11. package/dist/clients.cjs +460 -383
  12. package/dist/clients.cjs.map +1 -1
  13. package/dist/clients.d.cts +26 -6
  14. package/dist/clients.d.ts +26 -6
  15. package/dist/clients.mjs +460 -383
  16. package/dist/clients.mjs.map +1 -1
  17. package/dist/hooks.cjs +130 -105
  18. package/dist/hooks.cjs.map +1 -1
  19. package/dist/hooks.d.cts +24 -4
  20. package/dist/hooks.d.ts +24 -4
  21. package/dist/hooks.mjs +130 -105
  22. package/dist/hooks.mjs.map +1 -1
  23. package/dist/index.cjs +373 -311
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +54 -8
  26. package/dist/index.d.ts +54 -8
  27. package/dist/index.mjs +373 -311
  28. package/dist/index.mjs.map +1 -1
  29. package/package.json +3 -3
  30. package/src/auth/context/AccountsContext.tsx +3 -3
  31. package/src/auth/hooks/useTokenRefresh.ts +4 -10
  32. package/src/auth/middlewares/tokenRefresh.ts +4 -15
  33. package/src/generated/cfg_accounts/CLAUDE.md +2 -9
  34. package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +2 -1
  35. package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +2 -1
  36. package/src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +15 -0
  37. package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
  38. package/src/generated/cfg_accounts/accounts/models.ts +0 -1
  39. package/src/generated/cfg_accounts/accounts__user_profile/client.ts +4 -2
  40. package/src/generated/cfg_accounts/accounts__user_profile/models.ts +9 -1
  41. package/src/generated/cfg_accounts/client.ts +18 -0
  42. package/src/generated/cfg_accounts/index.ts +3 -1
  43. package/src/generated/cfg_accounts/schema.json +2 -2
  44. package/src/generated/cfg_centrifugo/CLAUDE.md +1 -8
  45. package/src/generated/cfg_centrifugo/client.ts +18 -0
  46. package/src/generated/cfg_centrifugo/index.ts +3 -1
  47. package/src/generated/cfg_totp/CLAUDE.md +1 -8
  48. package/src/generated/cfg_totp/client.ts +18 -0
  49. package/src/generated/cfg_totp/index.ts +3 -1
  50. package/src/generated/cfg_totp/totp/models.ts +2 -0
  51. package/src/generated/cfg_webpush/CLAUDE.md +1 -8
  52. package/src/generated/cfg_webpush/client.ts +18 -0
  53. package/src/generated/cfg_webpush/index.ts +3 -1
package/dist/auth.mjs CHANGED
@@ -116,7 +116,9 @@ var UserProfile = class {
116
116
  * multipart/form-data with 'avatar' field.
117
117
  */
118
118
  async accountsProfileAvatarCreate(data) {
119
- const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData: data });
119
+ const formData = new FormData();
120
+ formData.append("avatar", data.avatar);
121
+ const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
120
122
  return response;
121
123
  }
122
124
  /**
@@ -552,8 +554,10 @@ var APIClient = class {
552
554
  constructor(baseUrl, options) {
553
555
  this.logger = null;
554
556
  this.retryConfig = null;
557
+ this.tokenGetter = null;
555
558
  this.baseUrl = baseUrl.replace(/\/$/, "");
556
559
  this.httpClient = options?.httpClient || new FetchAdapter();
560
+ this.tokenGetter = options?.tokenGetter || null;
557
561
  if (options?.loggerConfig !== void 0) {
558
562
  this.logger = new APILogger(options.loggerConfig);
559
563
  }
@@ -582,6 +586,19 @@ var APIClient = class {
582
586
  }
583
587
  return null;
584
588
  }
589
+ /**
590
+ * Get the base URL for building streaming/download URLs.
591
+ */
592
+ getBaseUrl() {
593
+ return this.baseUrl;
594
+ }
595
+ /**
596
+ * Get JWT token for URL authentication (used in streaming endpoints).
597
+ * Returns null if no token getter is configured or no token is available.
598
+ */
599
+ getToken() {
600
+ return this.tokenGetter ? this.tokenGetter() : null;
601
+ }
585
602
  /**
586
603
  * Make HTTP request with Django CSRF and session handling.
587
604
  * Automatically retries on network errors and 5xx server errors.
@@ -829,168 +846,174 @@ var CentrifugoTokenSchema = z.object({
829
846
  channels: z.array(z.string())
830
847
  });
831
848
 
832
- // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
849
+ // src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
833
850
  import { z as z2 } from "zod";
834
- var OAuthAuthorizeRequestRequestSchema = z2.object({
835
- redirect_uri: z2.union([z2.url(), z2.literal("")]).optional(),
836
- source_url: z2.union([z2.url(), z2.literal("")]).optional()
851
+ var CfgAccountsProfileAvatarCreateRequestSchema = z2.object({
852
+ avatar: z2.union([z2.instanceof(File), z2.instanceof(Blob)])
837
853
  });
838
854
 
839
- // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
855
+ // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
840
856
  import { z as z3 } from "zod";
841
- var OAuthAuthorizeResponseSchema = z3.object({
842
- authorization_url: z3.union([z3.url(), z3.literal("")]),
843
- state: z3.string()
857
+ var OAuthAuthorizeRequestRequestSchema = z3.object({
858
+ redirect_uri: z3.union([z3.url(), z3.literal("")]).optional(),
859
+ source_url: z3.union([z3.url(), z3.literal("")]).optional()
844
860
  });
845
861
 
846
- // src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
862
+ // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
847
863
  import { z as z4 } from "zod";
848
- var OAuthCallbackRequestRequestSchema = z4.object({
849
- code: z4.string().min(10).max(500),
850
- state: z4.string().min(20).max(100),
851
- redirect_uri: z4.union([z4.url(), z4.literal("")]).optional()
864
+ var OAuthAuthorizeResponseSchema = z4.object({
865
+ authorization_url: z4.union([z4.url(), z4.literal("")]),
866
+ state: z4.string()
852
867
  });
853
868
 
854
- // src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
869
+ // src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
855
870
  import { z as z5 } from "zod";
856
- var OAuthConnectionSchema = z5.object({
857
- id: z5.int(),
858
- provider: z5.nativeEnum(OAuthConnectionProvider),
859
- provider_display: z5.string(),
860
- provider_username: z5.string(),
861
- provider_email: z5.email(),
862
- provider_avatar_url: z5.union([z5.url(), z5.literal("")]),
863
- connected_at: z5.iso.datetime(),
864
- last_login_at: z5.iso.datetime()
871
+ var OAuthCallbackRequestRequestSchema = z5.object({
872
+ code: z5.string().min(10).max(500),
873
+ state: z5.string().min(20).max(100),
874
+ redirect_uri: z5.union([z5.url(), z5.literal("")]).optional()
865
875
  });
866
876
 
867
- // src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
877
+ // src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
868
878
  import { z as z6 } from "zod";
869
- var OAuthDisconnectRequestRequestSchema = z6.object({
870
- provider: z6.nativeEnum(OAuthDisconnectRequestRequestProvider)
879
+ var OAuthConnectionSchema = z6.object({
880
+ id: z6.int(),
881
+ provider: z6.nativeEnum(OAuthConnectionProvider),
882
+ provider_display: z6.string(),
883
+ provider_username: z6.string(),
884
+ provider_email: z6.email(),
885
+ provider_avatar_url: z6.union([z6.url(), z6.literal("")]),
886
+ connected_at: z6.iso.datetime(),
887
+ last_login_at: z6.iso.datetime()
871
888
  });
872
889
 
873
- // src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
890
+ // src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
874
891
  import { z as z7 } from "zod";
875
- var OAuthErrorSchema = z7.object({
876
- error: z7.string(),
877
- error_description: z7.string().optional()
892
+ var OAuthDisconnectRequestRequestSchema = z7.object({
893
+ provider: z7.nativeEnum(OAuthDisconnectRequestRequestProvider)
878
894
  });
879
895
 
880
- // src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
896
+ // src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
881
897
  import { z as z8 } from "zod";
882
- var OAuthProvidersResponseSchema = z8.object({
883
- providers: z8.array(z8.record(z8.string(), z8.any()))
898
+ var OAuthErrorSchema = z8.object({
899
+ error: z8.string(),
900
+ error_description: z8.string().optional()
884
901
  });
885
902
 
886
- // src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
903
+ // src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
887
904
  import { z as z9 } from "zod";
888
- var OAuthTokenResponseSchema = z9.object({
889
- requires_2fa: z9.boolean().optional(),
890
- 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(),
891
- access: z9.string().nullable().optional(),
892
- refresh: z9.string().nullable().optional(),
893
- user: z9.record(z9.string(), z9.any()).nullable().optional(),
894
- is_new_user: z9.boolean(),
895
- is_new_connection: z9.boolean(),
896
- should_prompt_2fa: z9.boolean().optional()
905
+ var OAuthProvidersResponseSchema = z9.object({
906
+ providers: z9.array(z9.record(z9.string(), z9.any()))
897
907
  });
898
908
 
899
- // src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
909
+ // src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
900
910
  import { z as z10 } from "zod";
901
- var OTPErrorResponseSchema = z10.object({
902
- error: z10.string()
911
+ var OAuthTokenResponseSchema = z10.object({
912
+ requires_2fa: z10.boolean().optional(),
913
+ 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(),
914
+ access: z10.string().nullable().optional(),
915
+ refresh: z10.string().nullable().optional(),
916
+ user: z10.record(z10.string(), z10.any()).nullable().optional(),
917
+ is_new_user: z10.boolean(),
918
+ is_new_connection: z10.boolean(),
919
+ should_prompt_2fa: z10.boolean().optional()
903
920
  });
904
921
 
905
- // src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
922
+ // src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
906
923
  import { z as z11 } from "zod";
907
- var OTPRequestRequestSchema = z11.object({
908
- identifier: z11.string().min(1),
909
- channel: z11.nativeEnum(OTPRequestRequestChannel).optional(),
910
- source_url: z11.union([z11.url(), z11.literal("")]).optional()
924
+ var OTPErrorResponseSchema = z11.object({
925
+ error: z11.string()
911
926
  });
912
927
 
913
- // src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
928
+ // src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
914
929
  import { z as z12 } from "zod";
915
- var OTPRequestResponseSchema = z12.object({
916
- message: z12.string()
930
+ var OTPRequestRequestSchema = z12.object({
931
+ identifier: z12.string().min(1),
932
+ channel: z12.nativeEnum(OTPRequestRequestChannel).optional(),
933
+ source_url: z12.union([z12.url(), z12.literal("")]).optional()
917
934
  });
918
935
 
919
- // src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
936
+ // src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
920
937
  import { z as z13 } from "zod";
921
- var OTPVerifyRequestSchema = z13.object({
922
- identifier: z13.string().min(1),
923
- otp: z13.string().min(6).max(6),
924
- channel: z13.nativeEnum(OTPVerifyRequestChannel).optional(),
925
- source_url: z13.union([z13.url(), z13.literal("")]).optional()
938
+ var OTPRequestResponseSchema = z13.object({
939
+ message: z13.string()
940
+ });
941
+
942
+ // src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
943
+ import { z as z14 } from "zod";
944
+ var OTPVerifyRequestSchema = z14.object({
945
+ identifier: z14.string().min(1),
946
+ otp: z14.string().min(6).max(6),
947
+ channel: z14.nativeEnum(OTPVerifyRequestChannel).optional(),
948
+ source_url: z14.union([z14.url(), z14.literal("")]).optional()
926
949
  });
927
950
 
928
951
  // src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
929
- import { z as z15 } from "zod";
952
+ import { z as z16 } from "zod";
930
953
 
931
954
  // src/generated/cfg_accounts/_utils/schemas/User.schema.ts
932
- import { z as z14 } from "zod";
933
- var UserSchema = z14.object({
934
- id: z14.int(),
935
- email: z14.email(),
936
- first_name: z14.string().max(50).optional(),
937
- last_name: z14.string().max(50).optional(),
938
- full_name: z14.string(),
939
- initials: z14.string(),
940
- display_username: z14.string(),
941
- company: z14.string().max(100).optional(),
942
- phone: z14.string().max(20).optional(),
943
- position: z14.string().max(100).optional(),
944
- avatar: z14.union([z14.url(), z14.literal("")]).nullable(),
945
- is_staff: z14.boolean(),
946
- is_superuser: z14.boolean(),
947
- date_joined: z14.iso.datetime(),
948
- last_login: z14.iso.datetime().nullable(),
949
- unanswered_messages_count: z14.int(),
955
+ import { z as z15 } from "zod";
956
+ var UserSchema = z15.object({
957
+ id: z15.int(),
958
+ email: z15.email(),
959
+ first_name: z15.string().max(50).optional(),
960
+ last_name: z15.string().max(50).optional(),
961
+ full_name: z15.string(),
962
+ initials: z15.string(),
963
+ display_username: z15.string(),
964
+ company: z15.string().max(100).optional(),
965
+ phone: z15.string().max(20).optional(),
966
+ position: z15.string().max(100).optional(),
967
+ avatar: z15.union([z15.url(), z15.literal("")]).nullable(),
968
+ is_staff: z15.boolean(),
969
+ is_superuser: z15.boolean(),
970
+ date_joined: z15.iso.datetime(),
971
+ last_login: z15.iso.datetime().nullable(),
972
+ unanswered_messages_count: z15.int(),
950
973
  centrifugo: CentrifugoTokenSchema.nullable()
951
974
  });
952
975
 
953
976
  // src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
954
- var OTPVerifyResponseSchema = z15.object({
955
- requires_2fa: z15.boolean().optional(),
956
- 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(),
957
- refresh: z15.string().nullable().optional(),
958
- access: z15.string().nullable().optional(),
977
+ var OTPVerifyResponseSchema = z16.object({
978
+ requires_2fa: z16.boolean().optional(),
979
+ 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(),
980
+ refresh: z16.string().nullable().optional(),
981
+ access: z16.string().nullable().optional(),
959
982
  user: UserSchema.nullable().optional(),
960
- should_prompt_2fa: z15.boolean().optional()
983
+ should_prompt_2fa: z16.boolean().optional()
961
984
  });
962
985
 
963
986
  // src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
964
- import { z as z16 } from "zod";
965
- var PatchedUserProfileUpdateRequestSchema = z16.object({
966
- first_name: z16.string().max(50).optional(),
967
- last_name: z16.string().max(50).optional(),
968
- company: z16.string().max(100).optional(),
969
- phone: z16.string().max(20).optional(),
970
- position: z16.string().max(100).optional()
987
+ import { z as z17 } from "zod";
988
+ var PatchedUserProfileUpdateRequestSchema = z17.object({
989
+ first_name: z17.string().max(50).optional(),
990
+ last_name: z17.string().max(50).optional(),
991
+ company: z17.string().max(100).optional(),
992
+ phone: z17.string().max(20).optional(),
993
+ position: z17.string().max(100).optional()
971
994
  });
972
995
 
973
996
  // src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
974
- import { z as z17 } from "zod";
975
- var TokenRefreshSchema = z17.object({
976
- access: z17.string(),
977
- refresh: z17.string()
997
+ import { z as z18 } from "zod";
998
+ var TokenRefreshSchema = z18.object({
999
+ access: z18.string(),
1000
+ refresh: z18.string()
978
1001
  });
979
1002
 
980
1003
  // src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
981
- import { z as z18 } from "zod";
982
- var TokenRefreshRequestSchema = z18.object({
983
- refresh: z18.string().min(1)
1004
+ import { z as z19 } from "zod";
1005
+ var TokenRefreshRequestSchema = z19.object({
1006
+ refresh: z19.string().min(1)
984
1007
  });
985
1008
 
986
1009
  // src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
987
- import { z as z19 } from "zod";
988
- var UserProfileUpdateRequestSchema = z19.object({
989
- first_name: z19.string().max(50).optional(),
990
- last_name: z19.string().max(50).optional(),
991
- company: z19.string().max(100).optional(),
992
- phone: z19.string().max(20).optional(),
993
- position: z19.string().max(100).optional()
1010
+ import { z as z20 } from "zod";
1011
+ var UserProfileUpdateRequestSchema = z20.object({
1012
+ first_name: z20.string().max(50).optional(),
1013
+ last_name: z20.string().max(50).optional(),
1014
+ company: z20.string().max(100).optional(),
1015
+ phone: z20.string().max(20).optional(),
1016
+ position: z20.string().max(100).optional()
994
1017
  });
995
1018
 
996
1019
  // src/generated/cfg_accounts/_utils/fetchers/accounts.ts
@@ -1347,7 +1370,8 @@ var API = class {
1347
1370
  this._loadTokensFromStorage();
1348
1371
  this._client = new APIClient(this.baseUrl, {
1349
1372
  retryConfig: this.options?.retryConfig,
1350
- loggerConfig: this.options?.loggerConfig
1373
+ loggerConfig: this.options?.loggerConfig,
1374
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
1351
1375
  });
1352
1376
  this._injectAuthHeader();
1353
1377
  this.auth = this._client.auth;
@@ -1365,7 +1389,8 @@ var API = class {
1365
1389
  _reinitClients() {
1366
1390
  this._client = new APIClient(this.baseUrl, {
1367
1391
  retryConfig: this.options?.retryConfig,
1368
- loggerConfig: this.options?.loggerConfig
1392
+ loggerConfig: this.options?.loggerConfig,
1393
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
1369
1394
  });
1370
1395
  this._injectAuthHeader();
1371
1396
  this.auth = this._client.auth;
@@ -2036,8 +2061,10 @@ var APIClient2 = class {
2036
2061
  constructor(baseUrl, options) {
2037
2062
  this.logger = null;
2038
2063
  this.retryConfig = null;
2064
+ this.tokenGetter = null;
2039
2065
  this.baseUrl = baseUrl.replace(/\/$/, "");
2040
2066
  this.httpClient = options?.httpClient || new FetchAdapter2();
2067
+ this.tokenGetter = options?.tokenGetter || null;
2041
2068
  if (options?.loggerConfig !== void 0) {
2042
2069
  this.logger = new APILogger2(options.loggerConfig);
2043
2070
  }
@@ -2066,6 +2093,19 @@ var APIClient2 = class {
2066
2093
  }
2067
2094
  return null;
2068
2095
  }
2096
+ /**
2097
+ * Get the base URL for building streaming/download URLs.
2098
+ */
2099
+ getBaseUrl() {
2100
+ return this.baseUrl;
2101
+ }
2102
+ /**
2103
+ * Get JWT token for URL authentication (used in streaming endpoints).
2104
+ * Returns null if no token getter is configured or no token is available.
2105
+ */
2106
+ getToken() {
2107
+ return this.tokenGetter ? this.tokenGetter() : null;
2108
+ }
2069
2109
  /**
2070
2110
  * Make HTTP request with Django CSRF and session handling.
2071
2111
  * Automatically retries on network errors and 5xx server errors.
@@ -2278,320 +2318,320 @@ var LocalStorageAdapter2 = class {
2278
2318
  };
2279
2319
 
2280
2320
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
2281
- import { z as z20 } from "zod";
2282
- var CentrifugoChannelInfoSchema = z20.object({
2283
- num_clients: z20.int()
2321
+ import { z as z21 } from "zod";
2322
+ var CentrifugoChannelInfoSchema = z21.object({
2323
+ num_clients: z21.int()
2284
2324
  });
2285
2325
 
2286
2326
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
2287
- import { z as z21 } from "zod";
2288
- var CentrifugoChannelsRequestRequestSchema = z21.object({
2289
- pattern: z21.string().nullable().optional()
2327
+ import { z as z22 } from "zod";
2328
+ var CentrifugoChannelsRequestRequestSchema = z22.object({
2329
+ pattern: z22.string().nullable().optional()
2290
2330
  });
2291
2331
 
2292
2332
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
2293
- import { z as z24 } from "zod";
2333
+ import { z as z25 } from "zod";
2294
2334
 
2295
2335
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
2296
- import { z as z22 } from "zod";
2297
- var CentrifugoChannelsResultSchema = z22.object({
2298
- channels: z22.record(z22.string(), CentrifugoChannelInfoSchema)
2336
+ import { z as z23 } from "zod";
2337
+ var CentrifugoChannelsResultSchema = z23.object({
2338
+ channels: z23.record(z23.string(), CentrifugoChannelInfoSchema)
2299
2339
  });
2300
2340
 
2301
2341
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
2302
- import { z as z23 } from "zod";
2303
- var CentrifugoErrorSchema = z23.object({
2304
- code: z23.int().optional(),
2305
- message: z23.string().optional()
2342
+ import { z as z24 } from "zod";
2343
+ var CentrifugoErrorSchema = z24.object({
2344
+ code: z24.int().optional(),
2345
+ message: z24.string().optional()
2306
2346
  });
2307
2347
 
2308
2348
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
2309
- var CentrifugoChannelsResponseSchema = z24.object({
2349
+ var CentrifugoChannelsResponseSchema = z25.object({
2310
2350
  error: CentrifugoErrorSchema.optional(),
2311
2351
  result: CentrifugoChannelsResultSchema.optional()
2312
2352
  });
2313
2353
 
2314
2354
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
2315
- import { z as z25 } from "zod";
2316
- var CentrifugoClientInfoSchema = z25.object({
2317
- user: z25.string(),
2318
- client: z25.string(),
2319
- conn_info: z25.record(z25.string(), z25.any()).nullable().optional(),
2320
- chan_info: z25.record(z25.string(), z25.any()).nullable().optional()
2355
+ import { z as z26 } from "zod";
2356
+ var CentrifugoClientInfoSchema = z26.object({
2357
+ user: z26.string(),
2358
+ client: z26.string(),
2359
+ conn_info: z26.record(z26.string(), z26.any()).nullable().optional(),
2360
+ chan_info: z26.record(z26.string(), z26.any()).nullable().optional()
2321
2361
  });
2322
2362
 
2323
2363
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
2324
- import { z as z26 } from "zod";
2325
- var CentrifugoHealthCheckSchema = z26.object({
2326
- status: z26.string(),
2327
- wrapper_url: z26.string(),
2328
- has_api_key: z26.boolean(),
2329
- timestamp: z26.string()
2364
+ import { z as z27 } from "zod";
2365
+ var CentrifugoHealthCheckSchema = z27.object({
2366
+ status: z27.string(),
2367
+ wrapper_url: z27.string(),
2368
+ has_api_key: z27.boolean(),
2369
+ timestamp: z27.string()
2330
2370
  });
2331
2371
 
2332
2372
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
2333
- import { z as z28 } from "zod";
2373
+ import { z as z29 } from "zod";
2334
2374
 
2335
2375
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
2336
- import { z as z27 } from "zod";
2337
- var CentrifugoStreamPositionSchema = z27.object({
2338
- offset: z27.int(),
2339
- epoch: z27.string()
2376
+ import { z as z28 } from "zod";
2377
+ var CentrifugoStreamPositionSchema = z28.object({
2378
+ offset: z28.int(),
2379
+ epoch: z28.string()
2340
2380
  });
2341
2381
 
2342
2382
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
2343
- var CentrifugoHistoryRequestRequestSchema = z28.object({
2344
- channel: z28.string(),
2345
- limit: z28.int().nullable().optional(),
2383
+ var CentrifugoHistoryRequestRequestSchema = z29.object({
2384
+ channel: z29.string(),
2385
+ limit: z29.int().nullable().optional(),
2346
2386
  since: CentrifugoStreamPositionSchema.optional(),
2347
- reverse: z28.boolean().nullable().optional()
2387
+ reverse: z29.boolean().nullable().optional()
2348
2388
  });
2349
2389
 
2350
2390
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
2351
- import { z as z31 } from "zod";
2391
+ import { z as z32 } from "zod";
2352
2392
 
2353
2393
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
2354
- import { z as z30 } from "zod";
2394
+ import { z as z31 } from "zod";
2355
2395
 
2356
2396
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
2357
- import { z as z29 } from "zod";
2358
- var CentrifugoPublicationSchema = z29.object({
2359
- data: z29.record(z29.string(), z29.any()),
2397
+ import { z as z30 } from "zod";
2398
+ var CentrifugoPublicationSchema = z30.object({
2399
+ data: z30.record(z30.string(), z30.any()),
2360
2400
  info: CentrifugoClientInfoSchema.optional(),
2361
- offset: z29.int(),
2362
- tags: z29.record(z29.string(), z29.any()).nullable().optional()
2401
+ offset: z30.int(),
2402
+ tags: z30.record(z30.string(), z30.any()).nullable().optional()
2363
2403
  });
2364
2404
 
2365
2405
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
2366
- var CentrifugoHistoryResultSchema = z30.object({
2367
- publications: z30.array(CentrifugoPublicationSchema),
2368
- epoch: z30.string(),
2369
- offset: z30.int()
2406
+ var CentrifugoHistoryResultSchema = z31.object({
2407
+ publications: z31.array(CentrifugoPublicationSchema),
2408
+ epoch: z31.string(),
2409
+ offset: z31.int()
2370
2410
  });
2371
2411
 
2372
2412
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
2373
- var CentrifugoHistoryResponseSchema = z31.object({
2413
+ var CentrifugoHistoryResponseSchema = z32.object({
2374
2414
  error: CentrifugoErrorSchema.optional(),
2375
2415
  result: CentrifugoHistoryResultSchema.optional()
2376
2416
  });
2377
2417
 
2378
2418
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
2379
- import { z as z36 } from "zod";
2419
+ import { z as z37 } from "zod";
2380
2420
 
2381
2421
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
2382
- import { z as z35 } from "zod";
2422
+ import { z as z36 } from "zod";
2383
2423
 
2384
2424
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
2385
- import { z as z34 } from "zod";
2425
+ import { z as z35 } from "zod";
2386
2426
 
2387
2427
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
2388
- import { z as z32 } from "zod";
2389
- var CentrifugoMetricsSchema = z32.object({
2390
- interval: z32.number(),
2391
- items: z32.record(z32.string(), z32.number())
2428
+ import { z as z33 } from "zod";
2429
+ var CentrifugoMetricsSchema = z33.object({
2430
+ interval: z33.number(),
2431
+ items: z33.record(z33.string(), z33.number())
2392
2432
  });
2393
2433
 
2394
2434
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
2395
- import { z as z33 } from "zod";
2396
- var CentrifugoProcessSchema = z33.object({
2397
- cpu: z33.number(),
2398
- rss: z33.int()
2435
+ import { z as z34 } from "zod";
2436
+ var CentrifugoProcessSchema = z34.object({
2437
+ cpu: z34.number(),
2438
+ rss: z34.int()
2399
2439
  });
2400
2440
 
2401
2441
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
2402
- var CentrifugoNodeInfoSchema = z34.object({
2403
- uid: z34.string(),
2404
- name: z34.string(),
2405
- version: z34.string(),
2406
- num_clients: z34.int(),
2407
- num_users: z34.int(),
2408
- num_channels: z34.int(),
2409
- uptime: z34.int(),
2410
- num_subs: z34.int(),
2442
+ var CentrifugoNodeInfoSchema = z35.object({
2443
+ uid: z35.string(),
2444
+ name: z35.string(),
2445
+ version: z35.string(),
2446
+ num_clients: z35.int(),
2447
+ num_users: z35.int(),
2448
+ num_channels: z35.int(),
2449
+ uptime: z35.int(),
2450
+ num_subs: z35.int(),
2411
2451
  metrics: CentrifugoMetricsSchema.optional(),
2412
2452
  process: CentrifugoProcessSchema.optional()
2413
2453
  });
2414
2454
 
2415
2455
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
2416
- var CentrifugoInfoResultSchema = z35.object({
2417
- nodes: z35.array(CentrifugoNodeInfoSchema)
2456
+ var CentrifugoInfoResultSchema = z36.object({
2457
+ nodes: z36.array(CentrifugoNodeInfoSchema)
2418
2458
  });
2419
2459
 
2420
2460
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
2421
- var CentrifugoInfoResponseSchema = z36.object({
2461
+ var CentrifugoInfoResponseSchema = z37.object({
2422
2462
  error: CentrifugoErrorSchema.optional(),
2423
2463
  result: CentrifugoInfoResultSchema.optional()
2424
2464
  });
2425
2465
 
2426
2466
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
2427
- import { z as z37 } from "zod";
2428
- var CentrifugoOverviewStatsSchema = z37.object({
2429
- total: z37.int(),
2430
- successful: z37.int(),
2431
- failed: z37.int(),
2432
- timeout: z37.int(),
2433
- success_rate: z37.number(),
2434
- avg_duration_ms: z37.number(),
2435
- avg_acks_received: z37.number(),
2436
- period_hours: z37.int()
2467
+ import { z as z38 } from "zod";
2468
+ var CentrifugoOverviewStatsSchema = z38.object({
2469
+ total: z38.int(),
2470
+ successful: z38.int(),
2471
+ failed: z38.int(),
2472
+ timeout: z38.int(),
2473
+ success_rate: z38.number(),
2474
+ avg_duration_ms: z38.number(),
2475
+ avg_acks_received: z38.number(),
2476
+ period_hours: z38.int()
2437
2477
  });
2438
2478
 
2439
2479
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
2440
- import { z as z38 } from "zod";
2441
- var CentrifugoPresenceRequestRequestSchema = z38.object({
2442
- channel: z38.string()
2480
+ import { z as z39 } from "zod";
2481
+ var CentrifugoPresenceRequestRequestSchema = z39.object({
2482
+ channel: z39.string()
2443
2483
  });
2444
2484
 
2445
2485
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
2446
- import { z as z40 } from "zod";
2486
+ import { z as z41 } from "zod";
2447
2487
 
2448
2488
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
2449
- import { z as z39 } from "zod";
2450
- var CentrifugoPresenceResultSchema = z39.object({
2451
- presence: z39.record(z39.string(), CentrifugoClientInfoSchema)
2489
+ import { z as z40 } from "zod";
2490
+ var CentrifugoPresenceResultSchema = z40.object({
2491
+ presence: z40.record(z40.string(), CentrifugoClientInfoSchema)
2452
2492
  });
2453
2493
 
2454
2494
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
2455
- var CentrifugoPresenceResponseSchema = z40.object({
2495
+ var CentrifugoPresenceResponseSchema = z41.object({
2456
2496
  error: CentrifugoErrorSchema.optional(),
2457
2497
  result: CentrifugoPresenceResultSchema.optional()
2458
2498
  });
2459
2499
 
2460
2500
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
2461
- import { z as z41 } from "zod";
2462
- var CentrifugoPresenceStatsRequestRequestSchema = z41.object({
2463
- channel: z41.string()
2501
+ import { z as z42 } from "zod";
2502
+ var CentrifugoPresenceStatsRequestRequestSchema = z42.object({
2503
+ channel: z42.string()
2464
2504
  });
2465
2505
 
2466
2506
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
2467
- import { z as z43 } from "zod";
2507
+ import { z as z44 } from "zod";
2468
2508
 
2469
2509
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
2470
- import { z as z42 } from "zod";
2471
- var CentrifugoPresenceStatsResultSchema = z42.object({
2472
- num_clients: z42.int(),
2473
- num_users: z42.int()
2510
+ import { z as z43 } from "zod";
2511
+ var CentrifugoPresenceStatsResultSchema = z43.object({
2512
+ num_clients: z43.int(),
2513
+ num_users: z43.int()
2474
2514
  });
2475
2515
 
2476
2516
  // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
2477
- var CentrifugoPresenceStatsResponseSchema = z43.object({
2517
+ var CentrifugoPresenceStatsResponseSchema = z44.object({
2478
2518
  error: CentrifugoErrorSchema.optional(),
2479
2519
  result: CentrifugoPresenceStatsResultSchema.optional()
2480
2520
  });
2481
2521
 
2482
2522
  // src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
2483
- import { z as z45 } from "zod";
2523
+ import { z as z46 } from "zod";
2484
2524
 
2485
2525
  // src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
2486
- import { z as z44 } from "zod";
2487
- var ChannelStatsSchema = z44.object({
2488
- channel: z44.string(),
2489
- total: z44.int(),
2490
- successful: z44.int(),
2491
- failed: z44.int(),
2492
- avg_duration_ms: z44.number(),
2493
- avg_acks: z44.number(),
2494
- last_activity_at: z44.string().nullable()
2526
+ import { z as z45 } from "zod";
2527
+ var ChannelStatsSchema = z45.object({
2528
+ channel: z45.string(),
2529
+ total: z45.int(),
2530
+ successful: z45.int(),
2531
+ failed: z45.int(),
2532
+ avg_duration_ms: z45.number(),
2533
+ avg_acks: z45.number(),
2534
+ last_activity_at: z45.string().nullable()
2495
2535
  });
2496
2536
 
2497
2537
  // src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
2498
- var ChannelListSchema = z45.object({
2499
- channels: z45.array(ChannelStatsSchema),
2500
- total_channels: z45.int()
2538
+ var ChannelListSchema = z46.object({
2539
+ channels: z46.array(ChannelStatsSchema),
2540
+ total_channels: z46.int()
2501
2541
  });
2502
2542
 
2503
2543
  // src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
2504
- import { z as z46 } from "zod";
2505
- var ConnectionTokenResponseSchema = z46.object({
2506
- token: z46.string(),
2507
- centrifugo_url: z46.string(),
2508
- expires_at: z46.string(),
2509
- channels: z46.array(z46.string())
2544
+ import { z as z47 } from "zod";
2545
+ var ConnectionTokenResponseSchema = z47.object({
2546
+ token: z47.string(),
2547
+ centrifugo_url: z47.string(),
2548
+ expires_at: z47.string(),
2549
+ channels: z47.array(z47.string())
2510
2550
  });
2511
2551
 
2512
2552
  // src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
2513
- import { z as z47 } from "zod";
2514
- var ManualAckRequestRequestSchema = z47.object({
2515
- message_id: z47.string(),
2516
- client_id: z47.string()
2553
+ import { z as z48 } from "zod";
2554
+ var ManualAckRequestRequestSchema = z48.object({
2555
+ message_id: z48.string(),
2556
+ client_id: z48.string()
2517
2557
  });
2518
2558
 
2519
2559
  // src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
2520
- import { z as z48 } from "zod";
2521
- var ManualAckResponseSchema = z48.object({
2522
- success: z48.boolean(),
2523
- message_id: z48.string(),
2524
- error: z48.string().nullable().optional()
2560
+ import { z as z49 } from "zod";
2561
+ var ManualAckResponseSchema = z49.object({
2562
+ success: z49.boolean(),
2563
+ message_id: z49.string(),
2564
+ error: z49.string().nullable().optional()
2525
2565
  });
2526
2566
 
2527
2567
  // src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
2528
- import { z as z50 } from "zod";
2568
+ import { z as z51 } from "zod";
2529
2569
 
2530
2570
  // src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
2531
- import { z as z49 } from "zod";
2532
- var PublishSchema = z49.object({
2533
- message_id: z49.string(),
2534
- channel: z49.string(),
2535
- status: z49.string(),
2536
- wait_for_ack: z49.boolean(),
2537
- acks_received: z49.int(),
2538
- acks_expected: z49.int().nullable(),
2539
- duration_ms: z49.number().nullable(),
2540
- created_at: z49.iso.datetime(),
2541
- completed_at: z49.iso.datetime().nullable(),
2542
- error_code: z49.string().nullable(),
2543
- error_message: z49.string().nullable()
2571
+ import { z as z50 } from "zod";
2572
+ var PublishSchema = z50.object({
2573
+ message_id: z50.string(),
2574
+ channel: z50.string(),
2575
+ status: z50.string(),
2576
+ wait_for_ack: z50.boolean(),
2577
+ acks_received: z50.int(),
2578
+ acks_expected: z50.int().nullable(),
2579
+ duration_ms: z50.number().nullable(),
2580
+ created_at: z50.iso.datetime(),
2581
+ completed_at: z50.iso.datetime().nullable(),
2582
+ error_code: z50.string().nullable(),
2583
+ error_message: z50.string().nullable()
2544
2584
  });
2545
2585
 
2546
2586
  // src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
2547
- var PaginatedPublishListSchema = z50.object({
2548
- count: z50.int(),
2549
- page: z50.int(),
2550
- pages: z50.int(),
2551
- page_size: z50.int(),
2552
- has_next: z50.boolean(),
2553
- has_previous: z50.boolean(),
2554
- next_page: z50.int().nullable().optional(),
2555
- previous_page: z50.int().nullable().optional(),
2556
- results: z50.array(PublishSchema)
2587
+ var PaginatedPublishListSchema = z51.object({
2588
+ count: z51.int(),
2589
+ page: z51.int(),
2590
+ pages: z51.int(),
2591
+ page_size: z51.int(),
2592
+ has_next: z51.boolean(),
2593
+ has_previous: z51.boolean(),
2594
+ next_page: z51.int().nullable().optional(),
2595
+ previous_page: z51.int().nullable().optional(),
2596
+ results: z51.array(PublishSchema)
2557
2597
  });
2558
2598
 
2559
2599
  // src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
2560
- import { z as z51 } from "zod";
2561
- var PublishTestRequestRequestSchema = z51.object({
2562
- channel: z51.string(),
2563
- data: z51.record(z51.string(), z51.any()),
2564
- wait_for_ack: z51.boolean().optional(),
2565
- ack_timeout: z51.int().min(1).max(60).optional()
2600
+ import { z as z52 } from "zod";
2601
+ var PublishTestRequestRequestSchema = z52.object({
2602
+ channel: z52.string(),
2603
+ data: z52.record(z52.string(), z52.any()),
2604
+ wait_for_ack: z52.boolean().optional(),
2605
+ ack_timeout: z52.int().min(1).max(60).optional()
2566
2606
  });
2567
2607
 
2568
2608
  // src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
2569
- import { z as z52 } from "zod";
2570
- var PublishTestResponseSchema = z52.object({
2571
- success: z52.boolean(),
2572
- message_id: z52.string(),
2573
- channel: z52.string(),
2574
- acks_received: z52.int().optional(),
2575
- delivered: z52.boolean().optional(),
2576
- error: z52.string().nullable().optional()
2609
+ import { z as z53 } from "zod";
2610
+ var PublishTestResponseSchema = z53.object({
2611
+ success: z53.boolean(),
2612
+ message_id: z53.string(),
2613
+ channel: z53.string(),
2614
+ acks_received: z53.int().optional(),
2615
+ delivered: z53.boolean().optional(),
2616
+ error: z53.string().nullable().optional()
2577
2617
  });
2578
2618
 
2579
2619
  // src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
2580
- import { z as z53 } from "zod";
2581
- var TimelineItemSchema = z53.object({
2582
- timestamp: z53.string(),
2583
- count: z53.int(),
2584
- successful: z53.int(),
2585
- failed: z53.int(),
2586
- timeout: z53.int()
2620
+ import { z as z54 } from "zod";
2621
+ var TimelineItemSchema = z54.object({
2622
+ timestamp: z54.string(),
2623
+ count: z54.int(),
2624
+ successful: z54.int(),
2625
+ failed: z54.int(),
2626
+ timeout: z54.int()
2587
2627
  });
2588
2628
 
2589
2629
  // src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
2590
- import { z as z54 } from "zod";
2591
- var TimelineResponseSchema = z54.object({
2592
- timeline: z54.array(TimelineItemSchema),
2593
- period_hours: z54.int(),
2594
- interval: z54.string()
2630
+ import { z as z55 } from "zod";
2631
+ var TimelineResponseSchema = z55.object({
2632
+ timeline: z55.array(TimelineItemSchema),
2633
+ period_hours: z55.int(),
2634
+ interval: z55.string()
2595
2635
  });
2596
2636
 
2597
2637
  // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
@@ -2620,7 +2660,8 @@ var API2 = class {
2620
2660
  this._loadTokensFromStorage();
2621
2661
  this._client = new APIClient2(this.baseUrl, {
2622
2662
  retryConfig: this.options?.retryConfig,
2623
- loggerConfig: this.options?.loggerConfig
2663
+ loggerConfig: this.options?.loggerConfig,
2664
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
2624
2665
  });
2625
2666
  this._injectAuthHeader();
2626
2667
  this.centrifugo_admin_api = this._client.centrifugo_admin_api;
@@ -2638,7 +2679,8 @@ var API2 = class {
2638
2679
  _reinitClients() {
2639
2680
  this._client = new APIClient2(this.baseUrl, {
2640
2681
  retryConfig: this.options?.retryConfig,
2641
- loggerConfig: this.options?.loggerConfig
2682
+ loggerConfig: this.options?.loggerConfig,
2683
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
2642
2684
  });
2643
2685
  this._injectAuthHeader();
2644
2686
  this.centrifugo_admin_api = this._client.centrifugo_admin_api;
@@ -3137,8 +3179,10 @@ var APIClient3 = class {
3137
3179
  constructor(baseUrl, options) {
3138
3180
  this.logger = null;
3139
3181
  this.retryConfig = null;
3182
+ this.tokenGetter = null;
3140
3183
  this.baseUrl = baseUrl.replace(/\/$/, "");
3141
3184
  this.httpClient = options?.httpClient || new FetchAdapter3();
3185
+ this.tokenGetter = options?.tokenGetter || null;
3142
3186
  if (options?.loggerConfig !== void 0) {
3143
3187
  this.logger = new APILogger3(options.loggerConfig);
3144
3188
  }
@@ -3164,6 +3208,19 @@ var APIClient3 = class {
3164
3208
  }
3165
3209
  return null;
3166
3210
  }
3211
+ /**
3212
+ * Get the base URL for building streaming/download URLs.
3213
+ */
3214
+ getBaseUrl() {
3215
+ return this.baseUrl;
3216
+ }
3217
+ /**
3218
+ * Get JWT token for URL authentication (used in streaming endpoints).
3219
+ * Returns null if no token getter is configured or no token is available.
3220
+ */
3221
+ getToken() {
3222
+ return this.tokenGetter ? this.tokenGetter() : null;
3223
+ }
3167
3224
  /**
3168
3225
  * Make HTTP request with Django CSRF and session handling.
3169
3226
  * Automatically retries on network errors and 5xx server errors.
@@ -3376,40 +3433,40 @@ var LocalStorageAdapter3 = class {
3376
3433
  };
3377
3434
 
3378
3435
  // src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
3379
- import { z as z55 } from "zod";
3380
- var SendPushRequestRequestSchema = z55.object({
3381
- title: z55.string().min(1).max(255),
3382
- body: z55.string().min(1),
3383
- icon: z55.union([z55.url(), z55.literal("")]).nullable().optional(),
3384
- url: z55.union([z55.url(), z55.literal("")]).nullable().optional()
3436
+ import { z as z56 } from "zod";
3437
+ var SendPushRequestRequestSchema = z56.object({
3438
+ title: z56.string().min(1).max(255),
3439
+ body: z56.string().min(1),
3440
+ icon: z56.union([z56.url(), z56.literal("")]).nullable().optional(),
3441
+ url: z56.union([z56.url(), z56.literal("")]).nullable().optional()
3385
3442
  });
3386
3443
 
3387
3444
  // src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
3388
- import { z as z56 } from "zod";
3389
- var SendPushResponseSchema = z56.object({
3390
- success: z56.boolean(),
3391
- sent_to: z56.int()
3445
+ import { z as z57 } from "zod";
3446
+ var SendPushResponseSchema = z57.object({
3447
+ success: z57.boolean(),
3448
+ sent_to: z57.int()
3392
3449
  });
3393
3450
 
3394
3451
  // src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
3395
- import { z as z57 } from "zod";
3396
- var SubscribeRequestRequestSchema = z57.object({
3397
- endpoint: z57.union([z57.url(), z57.literal("")]),
3398
- keys: z57.record(z57.string(), z57.string().min(1))
3452
+ import { z as z58 } from "zod";
3453
+ var SubscribeRequestRequestSchema = z58.object({
3454
+ endpoint: z58.union([z58.url(), z58.literal("")]),
3455
+ keys: z58.record(z58.string(), z58.string().min(1))
3399
3456
  });
3400
3457
 
3401
3458
  // src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
3402
- import { z as z58 } from "zod";
3403
- var SubscribeResponseSchema = z58.object({
3404
- success: z58.boolean(),
3405
- subscription_id: z58.int(),
3406
- created: z58.boolean()
3459
+ import { z as z59 } from "zod";
3460
+ var SubscribeResponseSchema = z59.object({
3461
+ success: z59.boolean(),
3462
+ subscription_id: z59.int(),
3463
+ created: z59.boolean()
3407
3464
  });
3408
3465
 
3409
3466
  // src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
3410
- import { z as z59 } from "zod";
3411
- var VapidPublicKeyResponseSchema = z59.object({
3412
- publicKey: z59.string()
3467
+ import { z as z60 } from "zod";
3468
+ var VapidPublicKeyResponseSchema = z60.object({
3469
+ publicKey: z60.string()
3413
3470
  });
3414
3471
 
3415
3472
  // src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
@@ -3429,7 +3486,8 @@ var API3 = class {
3429
3486
  this._loadTokensFromStorage();
3430
3487
  this._client = new APIClient3(this.baseUrl, {
3431
3488
  retryConfig: this.options?.retryConfig,
3432
- loggerConfig: this.options?.loggerConfig
3489
+ loggerConfig: this.options?.loggerConfig,
3490
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
3433
3491
  });
3434
3492
  this._injectAuthHeader();
3435
3493
  this.web_push = this._client.web_push;
@@ -3444,7 +3502,8 @@ var API3 = class {
3444
3502
  _reinitClients() {
3445
3503
  this._client = new APIClient3(this.baseUrl, {
3446
3504
  retryConfig: this.options?.retryConfig,
3447
- loggerConfig: this.options?.loggerConfig
3505
+ loggerConfig: this.options?.loggerConfig,
3506
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
3448
3507
  });
3449
3508
  this._injectAuthHeader();
3450
3509
  this.web_push = this._client.web_push;
@@ -3940,16 +3999,10 @@ function useTokenRefresh(options = {}) {
3940
3999
  isRefreshingRef.current = true;
3941
4000
  authLogger.info("Refreshing token...");
3942
4001
  try {
3943
- const response = await fetch("/api/accounts/token/refresh/", {
3944
- method: "POST",
3945
- headers: { "Content-Type": "application/json" },
3946
- body: JSON.stringify({ refresh: refreshTokenValue })
4002
+ const result = await api.auth.accountsTokenRefreshCreate({
4003
+ refresh: refreshTokenValue
3947
4004
  });
3948
- if (!response.ok) {
3949
- throw new Error(`Token refresh failed: ${response.status}`);
3950
- }
3951
- const data = await response.json();
3952
- const newAccessToken = data.access;
4005
+ const newAccessToken = result.access;
3953
4006
  if (!newAccessToken) {
3954
4007
  throw new Error("No access token in refresh response");
3955
4008
  }
@@ -4180,8 +4233,8 @@ function AccountsProvider({ children }) {
4180
4233
  await refreshProfile("AccountsContext.partialUpdateProfile");
4181
4234
  return result;
4182
4235
  }, "partialUpdateProfile");
4183
- const uploadAvatar = /* @__PURE__ */ __name(async (formData) => {
4184
- const result = await avatarMutation(formData, api);
4236
+ const uploadAvatar = /* @__PURE__ */ __name(async (avatar) => {
4237
+ const result = await avatarMutation({ avatar }, api);
4185
4238
  await refreshProfile("AccountsContext.uploadAvatar");
4186
4239
  return result;
4187
4240
  }, "uploadAvatar");
@@ -5288,8 +5341,10 @@ var APIClient4 = class {
5288
5341
  constructor(baseUrl, options) {
5289
5342
  this.logger = null;
5290
5343
  this.retryConfig = null;
5344
+ this.tokenGetter = null;
5291
5345
  this.baseUrl = baseUrl.replace(/\/$/, "");
5292
5346
  this.httpClient = options?.httpClient || new FetchAdapter4();
5347
+ this.tokenGetter = options?.tokenGetter || null;
5293
5348
  if (options?.loggerConfig !== void 0) {
5294
5349
  this.logger = new APILogger4(options.loggerConfig);
5295
5350
  }
@@ -5319,6 +5374,19 @@ var APIClient4 = class {
5319
5374
  }
5320
5375
  return null;
5321
5376
  }
5377
+ /**
5378
+ * Get the base URL for building streaming/download URLs.
5379
+ */
5380
+ getBaseUrl() {
5381
+ return this.baseUrl;
5382
+ }
5383
+ /**
5384
+ * Get JWT token for URL authentication (used in streaming endpoints).
5385
+ * Returns null if no token getter is configured or no token is available.
5386
+ */
5387
+ getToken() {
5388
+ return this.tokenGetter ? this.tokenGetter() : null;
5389
+ }
5322
5390
  /**
5323
5391
  * Make HTTP request with Django CSRF and session handling.
5324
5392
  * Automatically retries on network errors and 5xx server errors.
@@ -5539,112 +5607,112 @@ var DeviceListStatus = /* @__PURE__ */ ((DeviceListStatus2) => {
5539
5607
  })(DeviceListStatus || {});
5540
5608
 
5541
5609
  // src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts
5542
- import { z as z60 } from "zod";
5543
- var BackupCodesRegenerateRequestSchema = z60.object({
5544
- code: z60.string().min(6).max(6)
5610
+ import { z as z61 } from "zod";
5611
+ var BackupCodesRegenerateRequestSchema = z61.object({
5612
+ code: z61.string().min(6).max(6)
5545
5613
  });
5546
5614
 
5547
5615
  // src/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts
5548
- import { z as z61 } from "zod";
5549
- var BackupCodesRegenerateResponseSchema = z61.object({
5550
- backup_codes: z61.array(z61.string()),
5551
- warning: z61.string()
5616
+ import { z as z62 } from "zod";
5617
+ var BackupCodesRegenerateResponseSchema = z62.object({
5618
+ backup_codes: z62.array(z62.string()),
5619
+ warning: z62.string()
5552
5620
  });
5553
5621
 
5554
5622
  // src/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts
5555
- import { z as z62 } from "zod";
5556
- var BackupCodesStatusSchema = z62.object({
5557
- remaining_count: z62.int(),
5558
- total_generated: z62.int(),
5559
- warning: z62.string().nullable().optional()
5623
+ import { z as z63 } from "zod";
5624
+ var BackupCodesStatusSchema = z63.object({
5625
+ remaining_count: z63.int(),
5626
+ total_generated: z63.int(),
5627
+ warning: z63.string().nullable().optional()
5560
5628
  });
5561
5629
 
5562
5630
  // src/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts
5563
- import { z as z63 } from "zod";
5564
- var ConfirmSetupRequestSchema = z63.object({
5565
- device_id: z63.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5566
- code: z63.string().min(6).max(6)
5631
+ import { z as z64 } from "zod";
5632
+ var ConfirmSetupRequestSchema = z64.object({
5633
+ device_id: z64.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5634
+ code: z64.string().min(6).max(6)
5567
5635
  });
5568
5636
 
5569
5637
  // src/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts
5570
- import { z as z64 } from "zod";
5571
- var ConfirmSetupResponseSchema = z64.object({
5572
- message: z64.string(),
5573
- backup_codes: z64.array(z64.string()),
5574
- backup_codes_warning: z64.string()
5638
+ import { z as z65 } from "zod";
5639
+ var ConfirmSetupResponseSchema = z65.object({
5640
+ message: z65.string(),
5641
+ backup_codes: z65.array(z65.string()),
5642
+ backup_codes_warning: z65.string()
5575
5643
  });
5576
5644
 
5577
5645
  // src/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts
5578
- import { z as z65 } from "zod";
5579
- var DeviceListSchema = z65.object({
5580
- id: z65.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5581
- name: z65.string(),
5582
- is_primary: z65.boolean(),
5583
- status: z65.nativeEnum(DeviceListStatus),
5584
- created_at: z65.iso.datetime(),
5585
- confirmed_at: z65.iso.datetime().nullable(),
5586
- last_used_at: z65.iso.datetime().nullable()
5646
+ import { z as z66 } from "zod";
5647
+ var DeviceListSchema = z66.object({
5648
+ id: z66.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5649
+ name: z66.string(),
5650
+ is_primary: z66.boolean(),
5651
+ status: z66.nativeEnum(DeviceListStatus),
5652
+ created_at: z66.iso.datetime(),
5653
+ confirmed_at: z66.iso.datetime().nullable(),
5654
+ last_used_at: z66.iso.datetime().nullable()
5587
5655
  });
5588
5656
 
5589
5657
  // src/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts
5590
- import { z as z66 } from "zod";
5591
- var DisableRequestSchema = z66.object({
5592
- code: z66.string().min(6).max(6)
5658
+ import { z as z67 } from "zod";
5659
+ var DisableRequestSchema = z67.object({
5660
+ code: z67.string().min(6).max(6)
5593
5661
  });
5594
5662
 
5595
5663
  // src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListList.schema.ts
5596
- import { z as z67 } from "zod";
5597
- var PaginatedDeviceListListSchema = z67.object({
5598
- count: z67.int(),
5599
- page: z67.int(),
5600
- pages: z67.int(),
5601
- page_size: z67.int(),
5602
- has_next: z67.boolean(),
5603
- has_previous: z67.boolean(),
5604
- next_page: z67.int().nullable().optional(),
5605
- previous_page: z67.int().nullable().optional(),
5606
- results: z67.array(DeviceListSchema)
5664
+ import { z as z68 } from "zod";
5665
+ var PaginatedDeviceListListSchema = z68.object({
5666
+ count: z68.int(),
5667
+ page: z68.int(),
5668
+ pages: z68.int(),
5669
+ page_size: z68.int(),
5670
+ has_next: z68.boolean(),
5671
+ has_previous: z68.boolean(),
5672
+ next_page: z68.int().nullable().optional(),
5673
+ previous_page: z68.int().nullable().optional(),
5674
+ results: z68.array(DeviceListSchema)
5607
5675
  });
5608
5676
 
5609
5677
  // src/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts
5610
- import { z as z68 } from "zod";
5611
- var SetupRequestSchema = z68.object({
5612
- device_name: z68.string().min(1).max(100).optional()
5678
+ import { z as z69 } from "zod";
5679
+ var SetupRequestSchema = z69.object({
5680
+ device_name: z69.string().min(1).max(100).optional()
5613
5681
  });
5614
5682
 
5615
5683
  // src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts
5616
- import { z as z69 } from "zod";
5617
- var SetupResponseSchema = z69.object({
5618
- device_id: z69.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5619
- secret: z69.string(),
5620
- provisioning_uri: z69.string(),
5621
- qr_code_base64: z69.string(),
5622
- expires_in: z69.int()
5684
+ import { z as z70 } from "zod";
5685
+ var SetupResponseSchema = z70.object({
5686
+ device_id: z70.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5687
+ secret: z70.string(),
5688
+ provisioning_uri: z70.string(),
5689
+ qr_code_base64: z70.string(),
5690
+ expires_in: z70.int()
5623
5691
  });
5624
5692
 
5625
5693
  // src/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts
5626
- import { z as z70 } from "zod";
5627
- var VerifyBackupRequestSchema = z70.object({
5628
- session_id: z70.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5629
- backup_code: z70.string().min(8).max(8)
5694
+ import { z as z71 } from "zod";
5695
+ var VerifyBackupRequestSchema = z71.object({
5696
+ session_id: z71.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5697
+ backup_code: z71.string().min(8).max(8)
5630
5698
  });
5631
5699
 
5632
5700
  // src/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts
5633
- import { z as z71 } from "zod";
5634
- var VerifyRequestSchema = z71.object({
5635
- session_id: z71.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5636
- code: z71.string().min(6).max(6)
5701
+ import { z as z72 } from "zod";
5702
+ var VerifyRequestSchema = z72.object({
5703
+ session_id: z72.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i),
5704
+ code: z72.string().min(6).max(6)
5637
5705
  });
5638
5706
 
5639
5707
  // src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts
5640
- import { z as z72 } from "zod";
5641
- var VerifyResponseSchema = z72.object({
5642
- message: z72.string(),
5643
- access_token: z72.string(),
5644
- refresh_token: z72.string(),
5645
- user: z72.record(z72.string(), z72.any()),
5646
- remaining_backup_codes: z72.int().optional(),
5647
- warning: z72.string().optional()
5708
+ import { z as z73 } from "zod";
5709
+ var VerifyResponseSchema = z73.object({
5710
+ message: z73.string(),
5711
+ access_token: z73.string(),
5712
+ refresh_token: z73.string(),
5713
+ user: z73.record(z73.string(), z73.any()),
5714
+ remaining_backup_codes: z73.int().optional(),
5715
+ warning: z73.string().optional()
5648
5716
  });
5649
5717
 
5650
5718
  // src/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts
@@ -5673,7 +5741,8 @@ var API4 = class {
5673
5741
  this._loadTokensFromStorage();
5674
5742
  this._client = new APIClient4(this.baseUrl, {
5675
5743
  retryConfig: this.options?.retryConfig,
5676
- loggerConfig: this.options?.loggerConfig
5744
+ loggerConfig: this.options?.loggerConfig,
5745
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
5677
5746
  });
5678
5747
  this._injectAuthHeader();
5679
5748
  this.backup_codes = this._client.backup_codes;
@@ -5692,7 +5761,8 @@ var API4 = class {
5692
5761
  _reinitClients() {
5693
5762
  this._client = new APIClient4(this.baseUrl, {
5694
5763
  retryConfig: this.options?.retryConfig,
5695
- loggerConfig: this.options?.loggerConfig
5764
+ loggerConfig: this.options?.loggerConfig,
5765
+ tokenGetter: /* @__PURE__ */ __name(() => this.getToken(), "tokenGetter")
5696
5766
  });
5697
5767
  this._injectAuthHeader();
5698
5768
  this.backup_codes = this._client.backup_codes;