@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.mjs CHANGED
@@ -256,6 +256,7 @@ var Auth = class {
256
256
  static {
257
257
  __name(this, "Auth");
258
258
  }
259
+ client;
259
260
  constructor(client) {
260
261
  this.client = client;
261
262
  }
@@ -273,6 +274,7 @@ var Oauth = class {
273
274
  static {
274
275
  __name(this, "Oauth");
275
276
  }
277
+ client;
276
278
  constructor(client) {
277
279
  this.client = client;
278
280
  }
@@ -330,6 +332,7 @@ var UserProfile = class {
330
332
  static {
331
333
  __name(this, "UserProfile");
332
334
  }
335
+ client;
333
336
  constructor(client) {
334
337
  this.client = client;
335
338
  }
@@ -412,6 +415,7 @@ var Accounts = class {
412
415
  static {
413
416
  __name(this, "Accounts");
414
417
  }
418
+ client;
415
419
  constructor(client) {
416
420
  this.client = client;
417
421
  }
@@ -605,6 +609,8 @@ var APILogger = class {
605
609
  static {
606
610
  __name(this, "APILogger");
607
611
  }
612
+ config;
613
+ consola;
608
614
  constructor(config = {}) {
609
615
  this.config = { ...DEFAULT_CONFIG, ...config };
610
616
  this.consola = config.consola || createConsola2({
@@ -800,10 +806,20 @@ __name(withRetry, "withRetry");
800
806
 
801
807
  // src/_api/generated/cfg_accounts/client.ts
802
808
  var APIClient = class {
809
+ static {
810
+ __name(this, "APIClient");
811
+ }
812
+ baseUrl;
813
+ httpClient;
814
+ logger = null;
815
+ retryConfig = null;
816
+ tokenGetter = null;
817
+ // Sub-clients
818
+ auth;
819
+ oauth;
820
+ user_profile;
821
+ accounts;
803
822
  constructor(baseUrl, options) {
804
- this.logger = null;
805
- this.retryConfig = null;
806
- this.tokenGetter = null;
807
823
  this.baseUrl = baseUrl.replace(/\/$/, "");
808
824
  this.httpClient = options?.httpClient || new FetchAdapter();
809
825
  this.tokenGetter = options?.tokenGetter || null;
@@ -818,9 +834,6 @@ var APIClient = class {
818
834
  this.user_profile = new UserProfile(this);
819
835
  this.accounts = new Accounts(this);
820
836
  }
821
- static {
822
- __name(this, "APIClient");
823
- }
824
837
  /**
825
838
  * Get CSRF token from cookies (for SessionAuthentication).
826
839
  *
@@ -1027,6 +1040,7 @@ var LocalStorageAdapter = class {
1027
1040
  static {
1028
1041
  __name(this, "LocalStorageAdapter");
1029
1042
  }
1043
+ logger;
1030
1044
  constructor(logger2) {
1031
1045
  this.logger = logger2;
1032
1046
  }
@@ -1622,10 +1636,22 @@ function detectLocale() {
1622
1636
  }
1623
1637
  __name(detectLocale, "detectLocale");
1624
1638
  var API = class {
1639
+ static {
1640
+ __name(this, "API");
1641
+ }
1642
+ baseUrl;
1643
+ _client;
1644
+ _token = null;
1645
+ _refreshToken = null;
1646
+ _locale = null;
1647
+ storage;
1648
+ options;
1649
+ // Sub-clients
1650
+ auth;
1651
+ oauth;
1652
+ user_profile;
1653
+ accounts;
1625
1654
  constructor(baseUrl, options) {
1626
- this._token = null;
1627
- this._refreshToken = null;
1628
- this._locale = null;
1629
1655
  this.baseUrl = baseUrl;
1630
1656
  this.options = options;
1631
1657
  const logger2 = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
@@ -1644,9 +1670,6 @@ var API = class {
1644
1670
  this.user_profile = this._client.user_profile;
1645
1671
  this.accounts = this._client.accounts;
1646
1672
  }
1647
- static {
1648
- __name(this, "API");
1649
- }
1650
1673
  _loadTokensFromStorage() {
1651
1674
  this._token = this.storage.getItem(TOKEN_KEY);
1652
1675
  this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);
@@ -1771,6 +1794,7 @@ var CentrifugoAuth = class {
1771
1794
  static {
1772
1795
  __name(this, "CentrifugoAuth");
1773
1796
  }
1797
+ client;
1774
1798
  constructor(client) {
1775
1799
  this.client = client;
1776
1800
  }
@@ -1958,6 +1982,8 @@ var APILogger2 = class {
1958
1982
  static {
1959
1983
  __name(this, "APILogger");
1960
1984
  }
1985
+ config;
1986
+ consola;
1961
1987
  constructor(config = {}) {
1962
1988
  this.config = { ...DEFAULT_CONFIG2, ...config };
1963
1989
  this.consola = config.consola || createConsola3({
@@ -2153,10 +2179,17 @@ __name(withRetry2, "withRetry");
2153
2179
 
2154
2180
  // src/_api/generated/cfg_centrifugo/client.ts
2155
2181
  var APIClient2 = class {
2182
+ static {
2183
+ __name(this, "APIClient");
2184
+ }
2185
+ baseUrl;
2186
+ httpClient;
2187
+ logger = null;
2188
+ retryConfig = null;
2189
+ tokenGetter = null;
2190
+ // Sub-clients
2191
+ centrifugo_auth;
2156
2192
  constructor(baseUrl, options) {
2157
- this.logger = null;
2158
- this.retryConfig = null;
2159
- this.tokenGetter = null;
2160
2193
  this.baseUrl = baseUrl.replace(/\/$/, "");
2161
2194
  this.httpClient = options?.httpClient || new FetchAdapter2();
2162
2195
  this.tokenGetter = options?.tokenGetter || null;
@@ -2168,9 +2201,6 @@ var APIClient2 = class {
2168
2201
  }
2169
2202
  this.centrifugo_auth = new CentrifugoAuth(this);
2170
2203
  }
2171
- static {
2172
- __name(this, "APIClient");
2173
- }
2174
2204
  /**
2175
2205
  * Get CSRF token from cookies (for SessionAuthentication).
2176
2206
  *
@@ -2377,6 +2407,7 @@ var LocalStorageAdapter2 = class {
2377
2407
  static {
2378
2408
  __name(this, "LocalStorageAdapter");
2379
2409
  }
2410
+ logger;
2380
2411
  constructor(logger2) {
2381
2412
  this.logger = logger2;
2382
2413
  }
@@ -2449,10 +2480,19 @@ function detectLocale2() {
2449
2480
  }
2450
2481
  __name(detectLocale2, "detectLocale");
2451
2482
  var API2 = class {
2483
+ static {
2484
+ __name(this, "API");
2485
+ }
2486
+ baseUrl;
2487
+ _client;
2488
+ _token = null;
2489
+ _refreshToken = null;
2490
+ _locale = null;
2491
+ storage;
2492
+ options;
2493
+ // Sub-clients
2494
+ centrifugo_auth;
2452
2495
  constructor(baseUrl, options) {
2453
- this._token = null;
2454
- this._refreshToken = null;
2455
- this._locale = null;
2456
2496
  this.baseUrl = baseUrl;
2457
2497
  this.options = options;
2458
2498
  const logger2 = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
@@ -2468,9 +2508,6 @@ var API2 = class {
2468
2508
  this._injectAuthHeader();
2469
2509
  this.centrifugo_auth = this._client.centrifugo_auth;
2470
2510
  }
2471
- static {
2472
- __name(this, "API");
2473
- }
2474
2511
  _loadTokensFromStorage() {
2475
2512
  this._token = this.storage.getItem(TOKEN_KEY2);
2476
2513
  this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY2);
@@ -2592,6 +2629,7 @@ var BackupCodes = class {
2592
2629
  static {
2593
2630
  __name(this, "BackupCodes");
2594
2631
  }
2632
+ client;
2595
2633
  constructor(client) {
2596
2634
  this.client = client;
2597
2635
  }
@@ -2617,6 +2655,7 @@ var TotpManagement = class {
2617
2655
  static {
2618
2656
  __name(this, "TotpManagement");
2619
2657
  }
2658
+ client;
2620
2659
  constructor(client) {
2621
2660
  this.client = client;
2622
2661
  }
@@ -2641,6 +2680,7 @@ var TotpSetup = class {
2641
2680
  static {
2642
2681
  __name(this, "TotpSetup");
2643
2682
  }
2683
+ client;
2644
2684
  constructor(client) {
2645
2685
  this.client = client;
2646
2686
  }
@@ -2667,6 +2707,7 @@ var TotpVerification = class {
2667
2707
  static {
2668
2708
  __name(this, "TotpVerification");
2669
2709
  }
2710
+ client;
2670
2711
  constructor(client) {
2671
2712
  this.client = client;
2672
2713
  }
@@ -2693,6 +2734,7 @@ var Totp = class {
2693
2734
  static {
2694
2735
  __name(this, "Totp");
2695
2736
  }
2737
+ client;
2696
2738
  constructor(client) {
2697
2739
  this.client = client;
2698
2740
  }
@@ -2877,6 +2919,8 @@ var APILogger3 = class {
2877
2919
  static {
2878
2920
  __name(this, "APILogger");
2879
2921
  }
2922
+ config;
2923
+ consola;
2880
2924
  constructor(config = {}) {
2881
2925
  this.config = { ...DEFAULT_CONFIG3, ...config };
2882
2926
  this.consola = config.consola || createConsola4({
@@ -3072,10 +3116,21 @@ __name(withRetry3, "withRetry");
3072
3116
 
3073
3117
  // src/_api/generated/cfg_totp/client.ts
3074
3118
  var APIClient3 = class {
3119
+ static {
3120
+ __name(this, "APIClient");
3121
+ }
3122
+ baseUrl;
3123
+ httpClient;
3124
+ logger = null;
3125
+ retryConfig = null;
3126
+ tokenGetter = null;
3127
+ // Sub-clients
3128
+ backup_codes;
3129
+ totp_management;
3130
+ totp_setup;
3131
+ totp_verification;
3132
+ totp;
3075
3133
  constructor(baseUrl, options) {
3076
- this.logger = null;
3077
- this.retryConfig = null;
3078
- this.tokenGetter = null;
3079
3134
  this.baseUrl = baseUrl.replace(/\/$/, "");
3080
3135
  this.httpClient = options?.httpClient || new FetchAdapter3();
3081
3136
  this.tokenGetter = options?.tokenGetter || null;
@@ -3091,9 +3146,6 @@ var APIClient3 = class {
3091
3146
  this.totp_verification = new TotpVerification(this);
3092
3147
  this.totp = new Totp(this);
3093
3148
  }
3094
- static {
3095
- __name(this, "APIClient");
3096
- }
3097
3149
  /**
3098
3150
  * Get CSRF token from cookies (for SessionAuthentication).
3099
3151
  *
@@ -3300,6 +3352,7 @@ var LocalStorageAdapter3 = class {
3300
3352
  static {
3301
3353
  __name(this, "LocalStorageAdapter");
3302
3354
  }
3355
+ logger;
3303
3356
  constructor(logger2) {
3304
3357
  this.logger = logger2;
3305
3358
  }
@@ -3504,10 +3557,23 @@ function detectLocale3() {
3504
3557
  }
3505
3558
  __name(detectLocale3, "detectLocale");
3506
3559
  var API3 = class {
3560
+ static {
3561
+ __name(this, "API");
3562
+ }
3563
+ baseUrl;
3564
+ _client;
3565
+ _token = null;
3566
+ _refreshToken = null;
3567
+ _locale = null;
3568
+ storage;
3569
+ options;
3570
+ // Sub-clients
3571
+ backup_codes;
3572
+ totp_management;
3573
+ totp_setup;
3574
+ totp_verification;
3575
+ totp;
3507
3576
  constructor(baseUrl, options) {
3508
- this._token = null;
3509
- this._refreshToken = null;
3510
- this._locale = null;
3511
3577
  this.baseUrl = baseUrl;
3512
3578
  this.options = options;
3513
3579
  const logger2 = options?.loggerConfig ? new APILogger3(options.loggerConfig) : void 0;
@@ -3527,9 +3593,6 @@ var API3 = class {
3527
3593
  this.totp_verification = this._client.totp_verification;
3528
3594
  this.totp = this._client.totp;
3529
3595
  }
3530
- static {
3531
- __name(this, "API");
3532
- }
3533
3596
  _loadTokensFromStorage() {
3534
3597
  this._token = this.storage.getItem(TOKEN_KEY3);
3535
3598
  this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY3);
@@ -5019,14 +5082,6 @@ var api = new API(
5019
5082
  storage: new LocalStorageAdapter()
5020
5083
  }
5021
5084
  );
5022
- var BaseClient = class {
5023
- static {
5024
- __name(this, "BaseClient");
5025
- }
5026
- static {
5027
- this.api = api;
5028
- }
5029
- };
5030
5085
 
5031
5086
  // src/auth/hooks/useTokenRefresh.ts
5032
5087
  var TOKEN_REFRESH_THRESHOLD_MS = 10 * 60 * 1e3;