@djangocfg/api 2.1.287 → 2.1.290

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auth.cjs CHANGED
@@ -317,6 +317,7 @@ var Auth = class {
317
317
  static {
318
318
  __name(this, "Auth");
319
319
  }
320
+ client;
320
321
  constructor(client) {
321
322
  this.client = client;
322
323
  }
@@ -334,6 +335,7 @@ var Oauth = class {
334
335
  static {
335
336
  __name(this, "Oauth");
336
337
  }
338
+ client;
337
339
  constructor(client) {
338
340
  this.client = client;
339
341
  }
@@ -391,6 +393,7 @@ var UserProfile = class {
391
393
  static {
392
394
  __name(this, "UserProfile");
393
395
  }
396
+ client;
394
397
  constructor(client) {
395
398
  this.client = client;
396
399
  }
@@ -473,6 +476,7 @@ var Accounts = class {
473
476
  static {
474
477
  __name(this, "Accounts");
475
478
  }
479
+ client;
476
480
  constructor(client) {
477
481
  this.client = client;
478
482
  }
@@ -666,6 +670,8 @@ var APILogger = class {
666
670
  static {
667
671
  __name(this, "APILogger");
668
672
  }
673
+ config;
674
+ consola;
669
675
  constructor(config = {}) {
670
676
  this.config = { ...DEFAULT_CONFIG, ...config };
671
677
  this.consola = config.consola || (0, import_consola2.createConsola)({
@@ -861,10 +867,20 @@ __name(withRetry, "withRetry");
861
867
 
862
868
  // src/_api/generated/cfg_accounts/client.ts
863
869
  var APIClient = class {
870
+ static {
871
+ __name(this, "APIClient");
872
+ }
873
+ baseUrl;
874
+ httpClient;
875
+ logger = null;
876
+ retryConfig = null;
877
+ tokenGetter = null;
878
+ // Sub-clients
879
+ auth;
880
+ oauth;
881
+ user_profile;
882
+ accounts;
864
883
  constructor(baseUrl, options) {
865
- this.logger = null;
866
- this.retryConfig = null;
867
- this.tokenGetter = null;
868
884
  this.baseUrl = baseUrl.replace(/\/$/, "");
869
885
  this.httpClient = options?.httpClient || new FetchAdapter();
870
886
  this.tokenGetter = options?.tokenGetter || null;
@@ -879,9 +895,6 @@ var APIClient = class {
879
895
  this.user_profile = new UserProfile(this);
880
896
  this.accounts = new Accounts(this);
881
897
  }
882
- static {
883
- __name(this, "APIClient");
884
- }
885
898
  /**
886
899
  * Get CSRF token from cookies (for SessionAuthentication).
887
900
  *
@@ -1088,6 +1101,7 @@ var LocalStorageAdapter = class {
1088
1101
  static {
1089
1102
  __name(this, "LocalStorageAdapter");
1090
1103
  }
1104
+ logger;
1091
1105
  constructor(logger2) {
1092
1106
  this.logger = logger2;
1093
1107
  }
@@ -1683,10 +1697,22 @@ function detectLocale() {
1683
1697
  }
1684
1698
  __name(detectLocale, "detectLocale");
1685
1699
  var API = class {
1700
+ static {
1701
+ __name(this, "API");
1702
+ }
1703
+ baseUrl;
1704
+ _client;
1705
+ _token = null;
1706
+ _refreshToken = null;
1707
+ _locale = null;
1708
+ storage;
1709
+ options;
1710
+ // Sub-clients
1711
+ auth;
1712
+ oauth;
1713
+ user_profile;
1714
+ accounts;
1686
1715
  constructor(baseUrl, options) {
1687
- this._token = null;
1688
- this._refreshToken = null;
1689
- this._locale = null;
1690
1716
  this.baseUrl = baseUrl;
1691
1717
  this.options = options;
1692
1718
  const logger2 = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
@@ -1705,9 +1731,6 @@ var API = class {
1705
1731
  this.user_profile = this._client.user_profile;
1706
1732
  this.accounts = this._client.accounts;
1707
1733
  }
1708
- static {
1709
- __name(this, "API");
1710
- }
1711
1734
  _loadTokensFromStorage() {
1712
1735
  this._token = this.storage.getItem(TOKEN_KEY);
1713
1736
  this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);
@@ -1832,6 +1855,7 @@ var CentrifugoAuth = class {
1832
1855
  static {
1833
1856
  __name(this, "CentrifugoAuth");
1834
1857
  }
1858
+ client;
1835
1859
  constructor(client) {
1836
1860
  this.client = client;
1837
1861
  }
@@ -2019,6 +2043,8 @@ var APILogger2 = class {
2019
2043
  static {
2020
2044
  __name(this, "APILogger");
2021
2045
  }
2046
+ config;
2047
+ consola;
2022
2048
  constructor(config = {}) {
2023
2049
  this.config = { ...DEFAULT_CONFIG2, ...config };
2024
2050
  this.consola = config.consola || (0, import_consola7.createConsola)({
@@ -2214,10 +2240,17 @@ __name(withRetry2, "withRetry");
2214
2240
 
2215
2241
  // src/_api/generated/cfg_centrifugo/client.ts
2216
2242
  var APIClient2 = class {
2243
+ static {
2244
+ __name(this, "APIClient");
2245
+ }
2246
+ baseUrl;
2247
+ httpClient;
2248
+ logger = null;
2249
+ retryConfig = null;
2250
+ tokenGetter = null;
2251
+ // Sub-clients
2252
+ centrifugo_auth;
2217
2253
  constructor(baseUrl, options) {
2218
- this.logger = null;
2219
- this.retryConfig = null;
2220
- this.tokenGetter = null;
2221
2254
  this.baseUrl = baseUrl.replace(/\/$/, "");
2222
2255
  this.httpClient = options?.httpClient || new FetchAdapter2();
2223
2256
  this.tokenGetter = options?.tokenGetter || null;
@@ -2229,9 +2262,6 @@ var APIClient2 = class {
2229
2262
  }
2230
2263
  this.centrifugo_auth = new CentrifugoAuth(this);
2231
2264
  }
2232
- static {
2233
- __name(this, "APIClient");
2234
- }
2235
2265
  /**
2236
2266
  * Get CSRF token from cookies (for SessionAuthentication).
2237
2267
  *
@@ -2438,6 +2468,7 @@ var LocalStorageAdapter2 = class {
2438
2468
  static {
2439
2469
  __name(this, "LocalStorageAdapter");
2440
2470
  }
2471
+ logger;
2441
2472
  constructor(logger2) {
2442
2473
  this.logger = logger2;
2443
2474
  }
@@ -2510,10 +2541,19 @@ function detectLocale2() {
2510
2541
  }
2511
2542
  __name(detectLocale2, "detectLocale");
2512
2543
  var API2 = class {
2544
+ static {
2545
+ __name(this, "API");
2546
+ }
2547
+ baseUrl;
2548
+ _client;
2549
+ _token = null;
2550
+ _refreshToken = null;
2551
+ _locale = null;
2552
+ storage;
2553
+ options;
2554
+ // Sub-clients
2555
+ centrifugo_auth;
2513
2556
  constructor(baseUrl, options) {
2514
- this._token = null;
2515
- this._refreshToken = null;
2516
- this._locale = null;
2517
2557
  this.baseUrl = baseUrl;
2518
2558
  this.options = options;
2519
2559
  const logger2 = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
@@ -2529,9 +2569,6 @@ var API2 = class {
2529
2569
  this._injectAuthHeader();
2530
2570
  this.centrifugo_auth = this._client.centrifugo_auth;
2531
2571
  }
2532
- static {
2533
- __name(this, "API");
2534
- }
2535
2572
  _loadTokensFromStorage() {
2536
2573
  this._token = this.storage.getItem(TOKEN_KEY2);
2537
2574
  this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY2);
@@ -2653,6 +2690,7 @@ var BackupCodes = class {
2653
2690
  static {
2654
2691
  __name(this, "BackupCodes");
2655
2692
  }
2693
+ client;
2656
2694
  constructor(client) {
2657
2695
  this.client = client;
2658
2696
  }
@@ -2678,6 +2716,7 @@ var TotpManagement = class {
2678
2716
  static {
2679
2717
  __name(this, "TotpManagement");
2680
2718
  }
2719
+ client;
2681
2720
  constructor(client) {
2682
2721
  this.client = client;
2683
2722
  }
@@ -2702,6 +2741,7 @@ var TotpSetup = class {
2702
2741
  static {
2703
2742
  __name(this, "TotpSetup");
2704
2743
  }
2744
+ client;
2705
2745
  constructor(client) {
2706
2746
  this.client = client;
2707
2747
  }
@@ -2728,6 +2768,7 @@ var TotpVerification = class {
2728
2768
  static {
2729
2769
  __name(this, "TotpVerification");
2730
2770
  }
2771
+ client;
2731
2772
  constructor(client) {
2732
2773
  this.client = client;
2733
2774
  }
@@ -2754,6 +2795,7 @@ var Totp = class {
2754
2795
  static {
2755
2796
  __name(this, "Totp");
2756
2797
  }
2798
+ client;
2757
2799
  constructor(client) {
2758
2800
  this.client = client;
2759
2801
  }
@@ -2938,6 +2980,8 @@ var APILogger3 = class {
2938
2980
  static {
2939
2981
  __name(this, "APILogger");
2940
2982
  }
2983
+ config;
2984
+ consola;
2941
2985
  constructor(config = {}) {
2942
2986
  this.config = { ...DEFAULT_CONFIG3, ...config };
2943
2987
  this.consola = config.consola || (0, import_consola9.createConsola)({
@@ -3133,10 +3177,21 @@ __name(withRetry3, "withRetry");
3133
3177
 
3134
3178
  // src/_api/generated/cfg_totp/client.ts
3135
3179
  var APIClient3 = class {
3180
+ static {
3181
+ __name(this, "APIClient");
3182
+ }
3183
+ baseUrl;
3184
+ httpClient;
3185
+ logger = null;
3186
+ retryConfig = null;
3187
+ tokenGetter = null;
3188
+ // Sub-clients
3189
+ backup_codes;
3190
+ totp_management;
3191
+ totp_setup;
3192
+ totp_verification;
3193
+ totp;
3136
3194
  constructor(baseUrl, options) {
3137
- this.logger = null;
3138
- this.retryConfig = null;
3139
- this.tokenGetter = null;
3140
3195
  this.baseUrl = baseUrl.replace(/\/$/, "");
3141
3196
  this.httpClient = options?.httpClient || new FetchAdapter3();
3142
3197
  this.tokenGetter = options?.tokenGetter || null;
@@ -3152,9 +3207,6 @@ var APIClient3 = class {
3152
3207
  this.totp_verification = new TotpVerification(this);
3153
3208
  this.totp = new Totp(this);
3154
3209
  }
3155
- static {
3156
- __name(this, "APIClient");
3157
- }
3158
3210
  /**
3159
3211
  * Get CSRF token from cookies (for SessionAuthentication).
3160
3212
  *
@@ -3361,6 +3413,7 @@ var LocalStorageAdapter3 = class {
3361
3413
  static {
3362
3414
  __name(this, "LocalStorageAdapter");
3363
3415
  }
3416
+ logger;
3364
3417
  constructor(logger2) {
3365
3418
  this.logger = logger2;
3366
3419
  }
@@ -3565,10 +3618,23 @@ function detectLocale3() {
3565
3618
  }
3566
3619
  __name(detectLocale3, "detectLocale");
3567
3620
  var API3 = class {
3621
+ static {
3622
+ __name(this, "API");
3623
+ }
3624
+ baseUrl;
3625
+ _client;
3626
+ _token = null;
3627
+ _refreshToken = null;
3628
+ _locale = null;
3629
+ storage;
3630
+ options;
3631
+ // Sub-clients
3632
+ backup_codes;
3633
+ totp_management;
3634
+ totp_setup;
3635
+ totp_verification;
3636
+ totp;
3568
3637
  constructor(baseUrl, options) {
3569
- this._token = null;
3570
- this._refreshToken = null;
3571
- this._locale = null;
3572
3638
  this.baseUrl = baseUrl;
3573
3639
  this.options = options;
3574
3640
  const logger2 = options?.loggerConfig ? new APILogger3(options.loggerConfig) : void 0;
@@ -3588,9 +3654,6 @@ var API3 = class {
3588
3654
  this.totp_verification = this._client.totp_verification;
3589
3655
  this.totp = this._client.totp;
3590
3656
  }
3591
- static {
3592
- __name(this, "API");
3593
- }
3594
3657
  _loadTokensFromStorage() {
3595
3658
  this._token = this.storage.getItem(TOKEN_KEY3);
3596
3659
  this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY3);
@@ -5080,14 +5143,6 @@ var api = new API(
5080
5143
  storage: new LocalStorageAdapter()
5081
5144
  }
5082
5145
  );
5083
- var BaseClient = class {
5084
- static {
5085
- __name(this, "BaseClient");
5086
- }
5087
- static {
5088
- this.api = api;
5089
- }
5090
- };
5091
5146
 
5092
5147
  // src/auth/hooks/useTokenRefresh.ts
5093
5148
  var TOKEN_REFRESH_THRESHOLD_MS = 10 * 60 * 1e3;