@djangocfg/api 2.1.356 → 2.1.358
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/README.md +53 -632
- package/dist/auth-server.cjs +717 -200
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +717 -200
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +843 -783
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +58 -37
- package/dist/auth.d.ts +58 -37
- package/dist/auth.mjs +846 -784
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +1427 -0
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +1686 -0
- package/dist/clients.d.ts +1686 -0
- package/dist/clients.mjs +1427 -0
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1277 -1924
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +18 -1206
- package/dist/hooks.d.ts +18 -1206
- package/dist/hooks.mjs +1253 -1900
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +545 -1232
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1389 -1455
- package/dist/index.d.ts +1389 -1455
- package/dist/index.mjs +545 -1232
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
- package/src/_api/generated/_cfg_accounts/api.ts +11 -3
- package/src/_api/generated/_cfg_accounts/hooks/index.ts +3 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRegenerateCreate.ts +64 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRetrieve.ts +65 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyTestCreate.ts +64 -0
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +43 -3
- package/src/_api/generated/_cfg_accounts/index.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/APIKey.ts +13 -0
- package/src/_api/generated/_cfg_accounts/schemas/APIKeyRegenerate.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/APIKeyRequest.ts +13 -0
- package/src/_api/generated/{_cfg_totp/schemas/DeviceListStatusEnum.ts → _cfg_accounts/schemas/APIKeyTestRequest.ts} +4 -2
- package/src/_api/generated/_cfg_accounts/schemas/APIKeyTestResult.ts +12 -0
- package/src/_api/generated/_cfg_accounts/schemas/AccountDeleteResponse.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/CfgUserUpdateRequest.ts +3 -2
- package/src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/OAuthConnection.ts +6 -6
- package/src/_api/generated/_cfg_accounts/schemas/OAuthDisconnectRequestRequest.ts +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/{ProviderEnum.ts → OAuthProviderEnum.ts} +2 -2
- package/src/_api/generated/_cfg_accounts/schemas/OAuthTokenResponse.ts +5 -5
- package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyRequest.ts +1 -1
- package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyResponse.ts +3 -3
- package/src/_api/generated/_cfg_accounts/schemas/PatchedCfgUserUpdateRequest.ts +3 -2
- package/src/_api/generated/_cfg_accounts/schemas/User.ts +12 -10
- package/src/_api/generated/_cfg_accounts/schemas/cfg_accounts_oauth_connections_response_200_AutoRef.ts +10 -0
- package/src/_api/generated/_cfg_accounts/schemas/cfg_accounts_oauth_disconnect_response_200_AutoRef.ts +11 -0
- package/src/_api/generated/_cfg_accounts/schemas/index.ts +8 -1
- package/src/_api/generated/_cfg_centrifugo/api.ts +3 -3
- package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_centrifugo/index.ts +1 -1
- package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +2 -2
- package/src/_api/generated/_cfg_totp/api.ts +9 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +7 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDisableCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyCreate.ts +43 -3
- package/src/_api/generated/_cfg_totp/index.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupRequest.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupResponse.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/DeviceList.ts +5 -5
- package/src/_api/generated/_cfg_totp/schemas/DeviceStatusEnum.ts +9 -0
- package/src/_api/generated/_cfg_totp/schemas/SetupResponse.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/TotpVerifyUser.ts +11 -9
- package/src/_api/generated/_cfg_totp/schemas/VerifyBackupRequest.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/VerifyRequest.ts +1 -1
- package/src/_api/generated/_cfg_totp/schemas/VerifyResponse.ts +2 -2
- package/src/_api/generated/_cfg_totp/schemas/cfg_totp_disable_response_200_AutoRef.ts +9 -0
- package/src/_api/generated/_cfg_totp/schemas/index.ts +2 -1
- package/src/_api/generated/index.ts +3 -1
- package/src/_api/generated/sdk.gen.ts +80 -813
- package/src/_api/generated/types.gen.ts +320 -159
- package/src/auth/context/AccountsContext.tsx +18 -6
- package/src/auth/context/AuthContext.tsx +11 -3
- package/src/auth/hooks/useDeleteAccount.ts +2 -2
- package/src/auth/hooks/useGithubAuth.ts +3 -3
- package/src/auth/hooks/useTokenRefresh.ts +2 -2
- package/src/auth/hooks/useTwoFactor.ts +3 -3
- package/src/auth/hooks/useTwoFactorSetup.ts +3 -3
- package/src/auth/hooks/useTwoFactorStatus.ts +3 -3
- package/src/auth/middlewares/tokenRefresh.ts +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useApiKey.ts +73 -0
- package/src/index.ts +12 -16
- package/src/lib/env.ts +10 -0
package/dist/auth-server.cjs
CHANGED
|
@@ -432,201 +432,32 @@ var APILogger = class {
|
|
|
432
432
|
};
|
|
433
433
|
var defaultLogger = new APILogger();
|
|
434
434
|
|
|
435
|
-
// src/_api/generated/_cfg_accounts/api.ts
|
|
436
|
-
var API = class {
|
|
437
|
-
static {
|
|
438
|
-
__name(this, "API");
|
|
439
|
-
}
|
|
440
|
-
logger;
|
|
441
|
-
constructor(_baseUrl, opts = {}) {
|
|
442
|
-
this.logger = new APILogger(opts.logger);
|
|
443
|
-
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
444
|
-
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
445
|
-
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
446
|
-
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
447
|
-
}
|
|
448
|
-
// ── Base URL ────────────────────────────────────────────────────────────
|
|
449
|
-
getBaseUrl() {
|
|
450
|
-
return auth.getBaseUrl();
|
|
451
|
-
}
|
|
452
|
-
setBaseUrl(url) {
|
|
453
|
-
auth.setBaseUrl(url);
|
|
454
|
-
}
|
|
455
|
-
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
456
|
-
getToken() {
|
|
457
|
-
return auth.getToken();
|
|
458
|
-
}
|
|
459
|
-
setToken(token) {
|
|
460
|
-
auth.setToken(token);
|
|
461
|
-
}
|
|
462
|
-
getRefreshToken() {
|
|
463
|
-
return auth.getRefreshToken();
|
|
464
|
-
}
|
|
465
|
-
setRefreshToken(token) {
|
|
466
|
-
auth.setRefreshToken(token);
|
|
467
|
-
}
|
|
468
|
-
clearToken() {
|
|
469
|
-
auth.clearTokens();
|
|
470
|
-
}
|
|
471
|
-
isAuthenticated() {
|
|
472
|
-
return auth.isAuthenticated();
|
|
473
|
-
}
|
|
474
|
-
// ── Locale / API key ────────────────────────────────────────────────────
|
|
475
|
-
getLocale() {
|
|
476
|
-
return auth.getLocale();
|
|
477
|
-
}
|
|
478
|
-
setLocale(locale) {
|
|
479
|
-
auth.setLocale(locale);
|
|
480
|
-
}
|
|
481
|
-
getApiKey() {
|
|
482
|
-
return auth.getApiKey();
|
|
483
|
-
}
|
|
484
|
-
setApiKey(key) {
|
|
485
|
-
auth.setApiKey(key);
|
|
486
|
-
}
|
|
487
|
-
// ── 401 handling ────────────────────────────────────────────────────────
|
|
488
|
-
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
489
|
-
onUnauthorized(cb) {
|
|
490
|
-
auth.onUnauthorized(cb);
|
|
491
|
-
}
|
|
492
|
-
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
493
|
-
setRefreshHandler(fn) {
|
|
494
|
-
auth.setRefreshHandler(fn);
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
// src/_api/generated/_cfg_centrifugo/api.ts
|
|
499
|
-
var API2 = class {
|
|
500
|
-
static {
|
|
501
|
-
__name(this, "API");
|
|
502
|
-
}
|
|
503
|
-
logger;
|
|
504
|
-
constructor(_baseUrl, opts = {}) {
|
|
505
|
-
this.logger = new APILogger(opts.logger);
|
|
506
|
-
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
507
|
-
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
508
|
-
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
509
|
-
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
510
|
-
}
|
|
511
|
-
// ── Base URL ────────────────────────────────────────────────────────────
|
|
512
|
-
getBaseUrl() {
|
|
513
|
-
return auth.getBaseUrl();
|
|
514
|
-
}
|
|
515
|
-
setBaseUrl(url) {
|
|
516
|
-
auth.setBaseUrl(url);
|
|
517
|
-
}
|
|
518
|
-
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
519
|
-
getToken() {
|
|
520
|
-
return auth.getToken();
|
|
521
|
-
}
|
|
522
|
-
setToken(token) {
|
|
523
|
-
auth.setToken(token);
|
|
524
|
-
}
|
|
525
|
-
getRefreshToken() {
|
|
526
|
-
return auth.getRefreshToken();
|
|
527
|
-
}
|
|
528
|
-
setRefreshToken(token) {
|
|
529
|
-
auth.setRefreshToken(token);
|
|
530
|
-
}
|
|
531
|
-
clearToken() {
|
|
532
|
-
auth.clearTokens();
|
|
533
|
-
}
|
|
534
|
-
isAuthenticated() {
|
|
535
|
-
return auth.isAuthenticated();
|
|
536
|
-
}
|
|
537
|
-
// ── Locale / API key ────────────────────────────────────────────────────
|
|
538
|
-
getLocale() {
|
|
539
|
-
return auth.getLocale();
|
|
540
|
-
}
|
|
541
|
-
setLocale(locale) {
|
|
542
|
-
auth.setLocale(locale);
|
|
543
|
-
}
|
|
544
|
-
getApiKey() {
|
|
545
|
-
return auth.getApiKey();
|
|
546
|
-
}
|
|
547
|
-
setApiKey(key) {
|
|
548
|
-
auth.setApiKey(key);
|
|
549
|
-
}
|
|
550
|
-
// ── 401 handling ────────────────────────────────────────────────────────
|
|
551
|
-
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
552
|
-
onUnauthorized(cb) {
|
|
553
|
-
auth.onUnauthorized(cb);
|
|
554
|
-
}
|
|
555
|
-
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
556
|
-
setRefreshHandler(fn) {
|
|
557
|
-
auth.setRefreshHandler(fn);
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
// src/_api/generated/_cfg_totp/api.ts
|
|
562
|
-
var API3 = class {
|
|
563
|
-
static {
|
|
564
|
-
__name(this, "API");
|
|
565
|
-
}
|
|
566
|
-
logger;
|
|
567
|
-
constructor(_baseUrl, opts = {}) {
|
|
568
|
-
this.logger = new APILogger(opts.logger);
|
|
569
|
-
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
570
|
-
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
571
|
-
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
572
|
-
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
573
|
-
}
|
|
574
|
-
// ── Base URL ────────────────────────────────────────────────────────────
|
|
575
|
-
getBaseUrl() {
|
|
576
|
-
return auth.getBaseUrl();
|
|
577
|
-
}
|
|
578
|
-
setBaseUrl(url) {
|
|
579
|
-
auth.setBaseUrl(url);
|
|
580
|
-
}
|
|
581
|
-
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
582
|
-
getToken() {
|
|
583
|
-
return auth.getToken();
|
|
584
|
-
}
|
|
585
|
-
setToken(token) {
|
|
586
|
-
auth.setToken(token);
|
|
587
|
-
}
|
|
588
|
-
getRefreshToken() {
|
|
589
|
-
return auth.getRefreshToken();
|
|
590
|
-
}
|
|
591
|
-
setRefreshToken(token) {
|
|
592
|
-
auth.setRefreshToken(token);
|
|
593
|
-
}
|
|
594
|
-
clearToken() {
|
|
595
|
-
auth.clearTokens();
|
|
596
|
-
}
|
|
597
|
-
isAuthenticated() {
|
|
598
|
-
return auth.isAuthenticated();
|
|
599
|
-
}
|
|
600
|
-
// ── Locale / API key ────────────────────────────────────────────────────
|
|
601
|
-
getLocale() {
|
|
602
|
-
return auth.getLocale();
|
|
603
|
-
}
|
|
604
|
-
setLocale(locale) {
|
|
605
|
-
auth.setLocale(locale);
|
|
606
|
-
}
|
|
607
|
-
getApiKey() {
|
|
608
|
-
return auth.getApiKey();
|
|
609
|
-
}
|
|
610
|
-
setApiKey(key) {
|
|
611
|
-
auth.setApiKey(key);
|
|
612
|
-
}
|
|
613
|
-
// ── 401 handling ────────────────────────────────────────────────────────
|
|
614
|
-
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
615
|
-
onUnauthorized(cb) {
|
|
616
|
-
auth.onUnauthorized(cb);
|
|
617
|
-
}
|
|
618
|
-
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
619
|
-
setRefreshHandler(fn) {
|
|
620
|
-
auth.setRefreshHandler(fn);
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
// src/_api/generated/index.ts
|
|
625
|
-
var CfgAccountsApi = new API();
|
|
626
|
-
var CfgCentrifugoApi = new API2();
|
|
627
|
-
var CfgTotpApi = new API3();
|
|
628
|
-
|
|
629
435
|
// src/_api/generated/core/bodySerializer.gen.ts
|
|
436
|
+
var serializeFormDataPair = /* @__PURE__ */ __name((data, key, value) => {
|
|
437
|
+
if (typeof value === "string" || value instanceof Blob) {
|
|
438
|
+
data.append(key, value);
|
|
439
|
+
} else if (value instanceof Date) {
|
|
440
|
+
data.append(key, value.toISOString());
|
|
441
|
+
} else {
|
|
442
|
+
data.append(key, JSON.stringify(value));
|
|
443
|
+
}
|
|
444
|
+
}, "serializeFormDataPair");
|
|
445
|
+
var formDataBodySerializer = {
|
|
446
|
+
bodySerializer: /* @__PURE__ */ __name((body) => {
|
|
447
|
+
const data = new FormData();
|
|
448
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
449
|
+
if (value === void 0 || value === null) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
if (Array.isArray(value)) {
|
|
453
|
+
value.forEach((v) => serializeFormDataPair(data, key, v));
|
|
454
|
+
} else {
|
|
455
|
+
serializeFormDataPair(data, key, value);
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
return data;
|
|
459
|
+
}, "bodySerializer")
|
|
460
|
+
};
|
|
630
461
|
var jsonBodySerializer = {
|
|
631
462
|
bodySerializer: /* @__PURE__ */ __name((body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value), "bodySerializer")
|
|
632
463
|
};
|
|
@@ -1427,16 +1258,59 @@ var client = createClient(createConfig({ baseUrl: "http://localhost:8000" }));
|
|
|
1427
1258
|
installAuthOnClient(client);
|
|
1428
1259
|
|
|
1429
1260
|
// src/_api/generated/sdk.gen.ts
|
|
1430
|
-
var
|
|
1261
|
+
var CfgAccountsApiKey = class {
|
|
1431
1262
|
static {
|
|
1432
|
-
__name(this, "
|
|
1263
|
+
__name(this, "CfgAccountsApiKey");
|
|
1433
1264
|
}
|
|
1434
1265
|
/**
|
|
1435
|
-
*
|
|
1266
|
+
* Get API key details
|
|
1267
|
+
*
|
|
1268
|
+
* Retrieve the current user's API key (masked) and metadata.
|
|
1436
1269
|
*/
|
|
1437
|
-
static
|
|
1270
|
+
static cfgAccountsApiKeyRetrieve(options) {
|
|
1271
|
+
return (options?.client ?? client).get({
|
|
1272
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1273
|
+
in: "cookie",
|
|
1274
|
+
name: "sessionid",
|
|
1275
|
+
type: "apiKey"
|
|
1276
|
+
}],
|
|
1277
|
+
url: "/cfg/accounts/api-key/",
|
|
1278
|
+
...options
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Regenerate API key
|
|
1283
|
+
*
|
|
1284
|
+
* Generate a new API key. The full key is returned only once.
|
|
1285
|
+
*/
|
|
1286
|
+
static cfgAccountsApiKeyRegenerateCreate(options) {
|
|
1438
1287
|
return (options.client ?? client).post({
|
|
1439
|
-
|
|
1288
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1289
|
+
in: "cookie",
|
|
1290
|
+
name: "sessionid",
|
|
1291
|
+
type: "apiKey"
|
|
1292
|
+
}],
|
|
1293
|
+
url: "/cfg/accounts/api-key/regenerate/",
|
|
1294
|
+
...options,
|
|
1295
|
+
headers: {
|
|
1296
|
+
"Content-Type": "application/json",
|
|
1297
|
+
...options.headers
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Test API key
|
|
1303
|
+
*
|
|
1304
|
+
* Test whether an API key is valid without consuming it.
|
|
1305
|
+
*/
|
|
1306
|
+
static cfgAccountsApiKeyTestCreate(options) {
|
|
1307
|
+
return (options.client ?? client).post({
|
|
1308
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1309
|
+
in: "cookie",
|
|
1310
|
+
name: "sessionid",
|
|
1311
|
+
type: "apiKey"
|
|
1312
|
+
}],
|
|
1313
|
+
url: "/cfg/accounts/api-key/test/",
|
|
1440
1314
|
...options,
|
|
1441
1315
|
headers: {
|
|
1442
1316
|
"Content-Type": "application/json",
|
|
@@ -1445,6 +1319,649 @@ var Auth = class {
|
|
|
1445
1319
|
});
|
|
1446
1320
|
}
|
|
1447
1321
|
};
|
|
1322
|
+
var CfgAccountsOauth = class {
|
|
1323
|
+
static {
|
|
1324
|
+
__name(this, "CfgAccountsOauth");
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* List OAuth connections
|
|
1328
|
+
*
|
|
1329
|
+
* Get all OAuth connections for the current user.
|
|
1330
|
+
*/
|
|
1331
|
+
static cfgAccountsOauthConnectionsList(options) {
|
|
1332
|
+
return (options?.client ?? client).get({
|
|
1333
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1334
|
+
url: "/cfg/accounts/oauth/connections/",
|
|
1335
|
+
...options
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Disconnect OAuth provider
|
|
1340
|
+
*
|
|
1341
|
+
* Remove OAuth connection for the specified provider.
|
|
1342
|
+
*/
|
|
1343
|
+
static cfgAccountsOauthDisconnectCreate(options) {
|
|
1344
|
+
return (options.client ?? client).post({
|
|
1345
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1346
|
+
url: "/cfg/accounts/oauth/disconnect/",
|
|
1347
|
+
...options,
|
|
1348
|
+
headers: {
|
|
1349
|
+
"Content-Type": "application/json",
|
|
1350
|
+
...options.headers
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Start GitHub OAuth
|
|
1356
|
+
*
|
|
1357
|
+
* Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.
|
|
1358
|
+
*/
|
|
1359
|
+
static cfgAccountsOauthGithubAuthorizeCreate(options) {
|
|
1360
|
+
return (options?.client ?? client).post({
|
|
1361
|
+
url: "/cfg/accounts/oauth/github/authorize/",
|
|
1362
|
+
...options,
|
|
1363
|
+
headers: {
|
|
1364
|
+
"Content-Type": "application/json",
|
|
1365
|
+
...options?.headers
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Complete GitHub OAuth
|
|
1371
|
+
*
|
|
1372
|
+
* Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.
|
|
1373
|
+
*/
|
|
1374
|
+
static cfgAccountsOauthGithubCallbackCreate(options) {
|
|
1375
|
+
return (options.client ?? client).post({
|
|
1376
|
+
url: "/cfg/accounts/oauth/github/callback/",
|
|
1377
|
+
...options,
|
|
1378
|
+
headers: {
|
|
1379
|
+
"Content-Type": "application/json",
|
|
1380
|
+
...options.headers
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* List OAuth providers
|
|
1386
|
+
*
|
|
1387
|
+
* Get list of available OAuth providers for authentication.
|
|
1388
|
+
*/
|
|
1389
|
+
static cfgAccountsOauthProvidersRetrieve(options) {
|
|
1390
|
+
return (options?.client ?? client).get({ url: "/cfg/accounts/oauth/providers/", ...options });
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
var CfgAccounts = class {
|
|
1394
|
+
static {
|
|
1395
|
+
__name(this, "CfgAccounts");
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* Request OTP code to email.
|
|
1399
|
+
*/
|
|
1400
|
+
static cfgAccountsOtpRequestCreate(options) {
|
|
1401
|
+
return (options.client ?? client).post({
|
|
1402
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1403
|
+
url: "/cfg/accounts/otp/request/",
|
|
1404
|
+
...options,
|
|
1405
|
+
headers: {
|
|
1406
|
+
"Content-Type": "application/json",
|
|
1407
|
+
...options.headers
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Verify OTP code and return JWT tokens or 2FA session.
|
|
1413
|
+
*
|
|
1414
|
+
* If user has 2FA enabled:
|
|
1415
|
+
* - Returns requires_2fa=True with session_id
|
|
1416
|
+
* - Client must complete 2FA verification at /cfg/totp/verify/
|
|
1417
|
+
*
|
|
1418
|
+
* If user has no 2FA:
|
|
1419
|
+
* - Returns JWT tokens and user data directly
|
|
1420
|
+
*/
|
|
1421
|
+
static cfgAccountsOtpVerifyCreate(options) {
|
|
1422
|
+
return (options.client ?? client).post({
|
|
1423
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1424
|
+
url: "/cfg/accounts/otp/verify/",
|
|
1425
|
+
...options,
|
|
1426
|
+
headers: {
|
|
1427
|
+
"Content-Type": "application/json",
|
|
1428
|
+
...options.headers
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
var CfgAccountsProfile = class {
|
|
1434
|
+
static {
|
|
1435
|
+
__name(this, "CfgAccountsProfile");
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Get current user profile
|
|
1439
|
+
*
|
|
1440
|
+
* Retrieve the current authenticated user's profile information.
|
|
1441
|
+
*/
|
|
1442
|
+
static cfgAccountsProfileRetrieve(options) {
|
|
1443
|
+
return (options?.client ?? client).get({
|
|
1444
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1445
|
+
in: "cookie",
|
|
1446
|
+
name: "sessionid",
|
|
1447
|
+
type: "apiKey"
|
|
1448
|
+
}],
|
|
1449
|
+
url: "/cfg/accounts/profile/",
|
|
1450
|
+
...options
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Upload user avatar
|
|
1455
|
+
*
|
|
1456
|
+
* Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.
|
|
1457
|
+
*/
|
|
1458
|
+
static cfgAccountsProfileAvatarCreate(options) {
|
|
1459
|
+
return (options?.client ?? client).post({
|
|
1460
|
+
...formDataBodySerializer,
|
|
1461
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1462
|
+
url: "/cfg/accounts/profile/avatar/",
|
|
1463
|
+
...options,
|
|
1464
|
+
headers: {
|
|
1465
|
+
"Content-Type": null,
|
|
1466
|
+
...options?.headers
|
|
1467
|
+
}
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
/**
|
|
1471
|
+
* Delete user account
|
|
1472
|
+
*
|
|
1473
|
+
*
|
|
1474
|
+
* Permanently delete the current user's account.
|
|
1475
|
+
*
|
|
1476
|
+
* This operation:
|
|
1477
|
+
* - Deactivates the account (user cannot log in)
|
|
1478
|
+
* - Anonymizes personal data (GDPR compliance)
|
|
1479
|
+
* - Frees up the email address for re-registration
|
|
1480
|
+
* - Preserves audit trail
|
|
1481
|
+
*
|
|
1482
|
+
* The account can be restored by an administrator if needed.
|
|
1483
|
+
*
|
|
1484
|
+
*/
|
|
1485
|
+
static cfgAccountsProfileDeleteCreate(options) {
|
|
1486
|
+
return (options?.client ?? client).post({
|
|
1487
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1488
|
+
in: "cookie",
|
|
1489
|
+
name: "sessionid",
|
|
1490
|
+
type: "apiKey"
|
|
1491
|
+
}],
|
|
1492
|
+
url: "/cfg/accounts/profile/delete/",
|
|
1493
|
+
...options
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Partial update user profile
|
|
1498
|
+
*
|
|
1499
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
1500
|
+
*/
|
|
1501
|
+
static cfgAccountsProfilePartialPartialUpdate(options) {
|
|
1502
|
+
return (options?.client ?? client).patch({
|
|
1503
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1504
|
+
in: "cookie",
|
|
1505
|
+
name: "sessionid",
|
|
1506
|
+
type: "apiKey"
|
|
1507
|
+
}],
|
|
1508
|
+
url: "/cfg/accounts/profile/partial/",
|
|
1509
|
+
...options,
|
|
1510
|
+
headers: {
|
|
1511
|
+
"Content-Type": "application/json",
|
|
1512
|
+
...options?.headers
|
|
1513
|
+
}
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* Partial update user profile
|
|
1518
|
+
*
|
|
1519
|
+
* Partially update the current authenticated user's profile information. Supports avatar upload.
|
|
1520
|
+
*/
|
|
1521
|
+
static cfgAccountsProfilePartialUpdate(options) {
|
|
1522
|
+
return (options?.client ?? client).put({
|
|
1523
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1524
|
+
in: "cookie",
|
|
1525
|
+
name: "sessionid",
|
|
1526
|
+
type: "apiKey"
|
|
1527
|
+
}],
|
|
1528
|
+
url: "/cfg/accounts/profile/partial/",
|
|
1529
|
+
...options,
|
|
1530
|
+
headers: {
|
|
1531
|
+
"Content-Type": "application/json",
|
|
1532
|
+
...options?.headers
|
|
1533
|
+
}
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Update user profile
|
|
1538
|
+
*
|
|
1539
|
+
* Update the current authenticated user's profile information.
|
|
1540
|
+
*/
|
|
1541
|
+
static cfgAccountsProfileUpdatePartialUpdate(options) {
|
|
1542
|
+
return (options?.client ?? client).patch({
|
|
1543
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1544
|
+
in: "cookie",
|
|
1545
|
+
name: "sessionid",
|
|
1546
|
+
type: "apiKey"
|
|
1547
|
+
}],
|
|
1548
|
+
url: "/cfg/accounts/profile/update/",
|
|
1549
|
+
...options,
|
|
1550
|
+
headers: {
|
|
1551
|
+
"Content-Type": "application/json",
|
|
1552
|
+
...options?.headers
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* Update user profile
|
|
1558
|
+
*
|
|
1559
|
+
* Update the current authenticated user's profile information.
|
|
1560
|
+
*/
|
|
1561
|
+
static cfgAccountsProfileUpdateUpdate(options) {
|
|
1562
|
+
return (options?.client ?? client).put({
|
|
1563
|
+
security: [{ scheme: "bearer", type: "http" }, {
|
|
1564
|
+
in: "cookie",
|
|
1565
|
+
name: "sessionid",
|
|
1566
|
+
type: "apiKey"
|
|
1567
|
+
}],
|
|
1568
|
+
url: "/cfg/accounts/profile/update/",
|
|
1569
|
+
...options,
|
|
1570
|
+
headers: {
|
|
1571
|
+
"Content-Type": "application/json",
|
|
1572
|
+
...options?.headers
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
var CfgAccountsAuth = class {
|
|
1578
|
+
static {
|
|
1579
|
+
__name(this, "CfgAccountsAuth");
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Refresh JWT token.
|
|
1583
|
+
*/
|
|
1584
|
+
static cfgAccountsTokenRefreshCreate(options) {
|
|
1585
|
+
return (options.client ?? client).post({
|
|
1586
|
+
url: "/cfg/accounts/token/refresh/",
|
|
1587
|
+
...options,
|
|
1588
|
+
headers: {
|
|
1589
|
+
"Content-Type": "application/json",
|
|
1590
|
+
...options.headers
|
|
1591
|
+
}
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
var CfgCentrifugo = class {
|
|
1596
|
+
static {
|
|
1597
|
+
__name(this, "CfgCentrifugo");
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Get Centrifugo connection token
|
|
1601
|
+
*
|
|
1602
|
+
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
1603
|
+
*/
|
|
1604
|
+
static cfgCentrifugoAuthTokenRetrieve(options) {
|
|
1605
|
+
return (options?.client ?? client).get({
|
|
1606
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1607
|
+
url: "/cfg/centrifugo/auth/token/",
|
|
1608
|
+
...options
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
var CfgTotpBackupCodes = class {
|
|
1613
|
+
static {
|
|
1614
|
+
__name(this, "CfgTotpBackupCodes");
|
|
1615
|
+
}
|
|
1616
|
+
/**
|
|
1617
|
+
* Get backup codes status for user.
|
|
1618
|
+
*/
|
|
1619
|
+
static cfgTotpBackupCodesRetrieve(options) {
|
|
1620
|
+
return (options?.client ?? client).get({
|
|
1621
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1622
|
+
url: "/cfg/totp/backup-codes/",
|
|
1623
|
+
...options
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Regenerate backup codes.
|
|
1628
|
+
*
|
|
1629
|
+
* Requires TOTP code for verification.
|
|
1630
|
+
* Invalidates all existing codes.
|
|
1631
|
+
*/
|
|
1632
|
+
static cfgTotpBackupCodesRegenerateCreate(options) {
|
|
1633
|
+
return (options.client ?? client).post({
|
|
1634
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1635
|
+
url: "/cfg/totp/backup-codes/regenerate/",
|
|
1636
|
+
...options,
|
|
1637
|
+
headers: {
|
|
1638
|
+
"Content-Type": "application/json",
|
|
1639
|
+
...options.headers
|
|
1640
|
+
}
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
var CfgTotp = class {
|
|
1645
|
+
static {
|
|
1646
|
+
__name(this, "CfgTotp");
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* List all TOTP devices for user.
|
|
1650
|
+
*/
|
|
1651
|
+
static cfgTotpDevicesRetrieve(options) {
|
|
1652
|
+
return (options?.client ?? client).get({
|
|
1653
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1654
|
+
url: "/cfg/totp/devices/",
|
|
1655
|
+
...options
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Delete a TOTP device.
|
|
1660
|
+
*
|
|
1661
|
+
* Requires verification code if removing the last/primary device.
|
|
1662
|
+
*/
|
|
1663
|
+
static cfgTotpDevicesDestroy(options) {
|
|
1664
|
+
return (options.client ?? client).delete({
|
|
1665
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1666
|
+
url: "/cfg/totp/devices/{id}/",
|
|
1667
|
+
...options
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Completely disable 2FA for account.
|
|
1672
|
+
*
|
|
1673
|
+
* Requires verification code.
|
|
1674
|
+
*/
|
|
1675
|
+
static cfgTotpDisableCreate(options) {
|
|
1676
|
+
return (options.client ?? client).post({
|
|
1677
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1678
|
+
url: "/cfg/totp/disable/",
|
|
1679
|
+
...options,
|
|
1680
|
+
headers: {
|
|
1681
|
+
"Content-Type": "application/json",
|
|
1682
|
+
...options.headers
|
|
1683
|
+
}
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
var CfgTotpSetup = class {
|
|
1688
|
+
static {
|
|
1689
|
+
__name(this, "CfgTotpSetup");
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Start 2FA setup process.
|
|
1693
|
+
*
|
|
1694
|
+
* Creates a new TOTP device and returns QR code for scanning.
|
|
1695
|
+
*/
|
|
1696
|
+
static cfgTotpSetupCreate(options) {
|
|
1697
|
+
return (options?.client ?? client).post({
|
|
1698
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1699
|
+
url: "/cfg/totp/setup/",
|
|
1700
|
+
...options,
|
|
1701
|
+
headers: {
|
|
1702
|
+
"Content-Type": "application/json",
|
|
1703
|
+
...options?.headers
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* Confirm 2FA setup with first valid code.
|
|
1709
|
+
*
|
|
1710
|
+
* Activates the device and generates backup codes.
|
|
1711
|
+
*/
|
|
1712
|
+
static cfgTotpSetupConfirmCreate(options) {
|
|
1713
|
+
return (options.client ?? client).post({
|
|
1714
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1715
|
+
url: "/cfg/totp/setup/confirm/",
|
|
1716
|
+
...options,
|
|
1717
|
+
headers: {
|
|
1718
|
+
"Content-Type": "application/json",
|
|
1719
|
+
...options.headers
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
var CfgTotpVerify = class {
|
|
1725
|
+
static {
|
|
1726
|
+
__name(this, "CfgTotpVerify");
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* Verify TOTP code for 2FA session.
|
|
1730
|
+
*
|
|
1731
|
+
* Completes authentication and returns JWT tokens on success.
|
|
1732
|
+
*/
|
|
1733
|
+
static cfgTotpVerifyCreate(options) {
|
|
1734
|
+
return (options.client ?? client).post({
|
|
1735
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1736
|
+
url: "/cfg/totp/verify/",
|
|
1737
|
+
...options,
|
|
1738
|
+
headers: {
|
|
1739
|
+
"Content-Type": "application/json",
|
|
1740
|
+
...options.headers
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* Verify backup recovery code for 2FA session.
|
|
1746
|
+
*
|
|
1747
|
+
* Alternative verification method when TOTP device unavailable.
|
|
1748
|
+
*/
|
|
1749
|
+
static cfgTotpVerifyBackupCreate(options) {
|
|
1750
|
+
return (options.client ?? client).post({
|
|
1751
|
+
security: [{ name: "X-API-Key", type: "apiKey" }, { scheme: "bearer", type: "http" }],
|
|
1752
|
+
url: "/cfg/totp/verify/backup/",
|
|
1753
|
+
...options,
|
|
1754
|
+
headers: {
|
|
1755
|
+
"Content-Type": "application/json",
|
|
1756
|
+
...options.headers
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1762
|
+
// src/_api/generated/_cfg_accounts/api.ts
|
|
1763
|
+
var API = class {
|
|
1764
|
+
static {
|
|
1765
|
+
__name(this, "API");
|
|
1766
|
+
}
|
|
1767
|
+
logger;
|
|
1768
|
+
cfgAccountsApiKey = CfgAccountsApiKey;
|
|
1769
|
+
cfgAccountsOauth = CfgAccountsOauth;
|
|
1770
|
+
cfgAccounts = CfgAccounts;
|
|
1771
|
+
cfgAccountsProfile = CfgAccountsProfile;
|
|
1772
|
+
cfgAccountsAuth = CfgAccountsAuth;
|
|
1773
|
+
constructor(_baseUrl, opts = {}) {
|
|
1774
|
+
this.logger = new APILogger(opts.logger);
|
|
1775
|
+
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
1776
|
+
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
1777
|
+
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
1778
|
+
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
1779
|
+
}
|
|
1780
|
+
// ── Base URL ────────────────────────────────────────────────────────────
|
|
1781
|
+
getBaseUrl() {
|
|
1782
|
+
return auth.getBaseUrl();
|
|
1783
|
+
}
|
|
1784
|
+
setBaseUrl(url) {
|
|
1785
|
+
auth.setBaseUrl(url);
|
|
1786
|
+
}
|
|
1787
|
+
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
1788
|
+
getToken() {
|
|
1789
|
+
return auth.getToken();
|
|
1790
|
+
}
|
|
1791
|
+
setToken(token) {
|
|
1792
|
+
auth.setToken(token);
|
|
1793
|
+
}
|
|
1794
|
+
getRefreshToken() {
|
|
1795
|
+
return auth.getRefreshToken();
|
|
1796
|
+
}
|
|
1797
|
+
setRefreshToken(token) {
|
|
1798
|
+
auth.setRefreshToken(token);
|
|
1799
|
+
}
|
|
1800
|
+
clearToken() {
|
|
1801
|
+
auth.clearTokens();
|
|
1802
|
+
}
|
|
1803
|
+
isAuthenticated() {
|
|
1804
|
+
return auth.isAuthenticated();
|
|
1805
|
+
}
|
|
1806
|
+
// ── Locale / API key ────────────────────────────────────────────────────
|
|
1807
|
+
getLocale() {
|
|
1808
|
+
return auth.getLocale();
|
|
1809
|
+
}
|
|
1810
|
+
setLocale(locale) {
|
|
1811
|
+
auth.setLocale(locale);
|
|
1812
|
+
}
|
|
1813
|
+
getApiKey() {
|
|
1814
|
+
return auth.getApiKey();
|
|
1815
|
+
}
|
|
1816
|
+
setApiKey(key) {
|
|
1817
|
+
auth.setApiKey(key);
|
|
1818
|
+
}
|
|
1819
|
+
// ── 401 handling ────────────────────────────────────────────────────────
|
|
1820
|
+
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
1821
|
+
onUnauthorized(cb) {
|
|
1822
|
+
auth.onUnauthorized(cb);
|
|
1823
|
+
}
|
|
1824
|
+
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
1825
|
+
setRefreshHandler(fn) {
|
|
1826
|
+
auth.setRefreshHandler(fn);
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
// src/_api/generated/_cfg_centrifugo/api.ts
|
|
1831
|
+
var API2 = class {
|
|
1832
|
+
static {
|
|
1833
|
+
__name(this, "API");
|
|
1834
|
+
}
|
|
1835
|
+
logger;
|
|
1836
|
+
cfgCentrifugo = CfgCentrifugo;
|
|
1837
|
+
constructor(_baseUrl, opts = {}) {
|
|
1838
|
+
this.logger = new APILogger(opts.logger);
|
|
1839
|
+
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
1840
|
+
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
1841
|
+
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
1842
|
+
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
1843
|
+
}
|
|
1844
|
+
// ── Base URL ────────────────────────────────────────────────────────────
|
|
1845
|
+
getBaseUrl() {
|
|
1846
|
+
return auth.getBaseUrl();
|
|
1847
|
+
}
|
|
1848
|
+
setBaseUrl(url) {
|
|
1849
|
+
auth.setBaseUrl(url);
|
|
1850
|
+
}
|
|
1851
|
+
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
1852
|
+
getToken() {
|
|
1853
|
+
return auth.getToken();
|
|
1854
|
+
}
|
|
1855
|
+
setToken(token) {
|
|
1856
|
+
auth.setToken(token);
|
|
1857
|
+
}
|
|
1858
|
+
getRefreshToken() {
|
|
1859
|
+
return auth.getRefreshToken();
|
|
1860
|
+
}
|
|
1861
|
+
setRefreshToken(token) {
|
|
1862
|
+
auth.setRefreshToken(token);
|
|
1863
|
+
}
|
|
1864
|
+
clearToken() {
|
|
1865
|
+
auth.clearTokens();
|
|
1866
|
+
}
|
|
1867
|
+
isAuthenticated() {
|
|
1868
|
+
return auth.isAuthenticated();
|
|
1869
|
+
}
|
|
1870
|
+
// ── Locale / API key ────────────────────────────────────────────────────
|
|
1871
|
+
getLocale() {
|
|
1872
|
+
return auth.getLocale();
|
|
1873
|
+
}
|
|
1874
|
+
setLocale(locale) {
|
|
1875
|
+
auth.setLocale(locale);
|
|
1876
|
+
}
|
|
1877
|
+
getApiKey() {
|
|
1878
|
+
return auth.getApiKey();
|
|
1879
|
+
}
|
|
1880
|
+
setApiKey(key) {
|
|
1881
|
+
auth.setApiKey(key);
|
|
1882
|
+
}
|
|
1883
|
+
// ── 401 handling ────────────────────────────────────────────────────────
|
|
1884
|
+
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
1885
|
+
onUnauthorized(cb) {
|
|
1886
|
+
auth.onUnauthorized(cb);
|
|
1887
|
+
}
|
|
1888
|
+
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
1889
|
+
setRefreshHandler(fn) {
|
|
1890
|
+
auth.setRefreshHandler(fn);
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
|
|
1894
|
+
// src/_api/generated/_cfg_totp/api.ts
|
|
1895
|
+
var API3 = class {
|
|
1896
|
+
static {
|
|
1897
|
+
__name(this, "API");
|
|
1898
|
+
}
|
|
1899
|
+
logger;
|
|
1900
|
+
cfgTotpBackupCodes = CfgTotpBackupCodes;
|
|
1901
|
+
cfgTotp = CfgTotp;
|
|
1902
|
+
cfgTotpSetup = CfgTotpSetup;
|
|
1903
|
+
cfgTotpVerify = CfgTotpVerify;
|
|
1904
|
+
constructor(_baseUrl, opts = {}) {
|
|
1905
|
+
this.logger = new APILogger(opts.logger);
|
|
1906
|
+
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
1907
|
+
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
1908
|
+
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
1909
|
+
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
1910
|
+
}
|
|
1911
|
+
// ── Base URL ────────────────────────────────────────────────────────────
|
|
1912
|
+
getBaseUrl() {
|
|
1913
|
+
return auth.getBaseUrl();
|
|
1914
|
+
}
|
|
1915
|
+
setBaseUrl(url) {
|
|
1916
|
+
auth.setBaseUrl(url);
|
|
1917
|
+
}
|
|
1918
|
+
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
1919
|
+
getToken() {
|
|
1920
|
+
return auth.getToken();
|
|
1921
|
+
}
|
|
1922
|
+
setToken(token) {
|
|
1923
|
+
auth.setToken(token);
|
|
1924
|
+
}
|
|
1925
|
+
getRefreshToken() {
|
|
1926
|
+
return auth.getRefreshToken();
|
|
1927
|
+
}
|
|
1928
|
+
setRefreshToken(token) {
|
|
1929
|
+
auth.setRefreshToken(token);
|
|
1930
|
+
}
|
|
1931
|
+
clearToken() {
|
|
1932
|
+
auth.clearTokens();
|
|
1933
|
+
}
|
|
1934
|
+
isAuthenticated() {
|
|
1935
|
+
return auth.isAuthenticated();
|
|
1936
|
+
}
|
|
1937
|
+
// ── Locale / API key ────────────────────────────────────────────────────
|
|
1938
|
+
getLocale() {
|
|
1939
|
+
return auth.getLocale();
|
|
1940
|
+
}
|
|
1941
|
+
setLocale(locale) {
|
|
1942
|
+
auth.setLocale(locale);
|
|
1943
|
+
}
|
|
1944
|
+
getApiKey() {
|
|
1945
|
+
return auth.getApiKey();
|
|
1946
|
+
}
|
|
1947
|
+
setApiKey(key) {
|
|
1948
|
+
auth.setApiKey(key);
|
|
1949
|
+
}
|
|
1950
|
+
// ── 401 handling ────────────────────────────────────────────────────────
|
|
1951
|
+
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
1952
|
+
onUnauthorized(cb) {
|
|
1953
|
+
auth.onUnauthorized(cb);
|
|
1954
|
+
}
|
|
1955
|
+
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
1956
|
+
setRefreshHandler(fn) {
|
|
1957
|
+
auth.setRefreshHandler(fn);
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
|
|
1961
|
+
// src/_api/generated/index.ts
|
|
1962
|
+
var CfgAccountsApi = new API();
|
|
1963
|
+
var CfgCentrifugoApi = new API2();
|
|
1964
|
+
var CfgTotpApi = new API3();
|
|
1448
1965
|
|
|
1449
1966
|
// src/auth/utils/logger.ts
|
|
1450
1967
|
var import_consola2 = require("consola");
|
|
@@ -1488,7 +2005,7 @@ async function refreshAccessToken() {
|
|
|
1488
2005
|
onTokenRefreshed(null);
|
|
1489
2006
|
return null;
|
|
1490
2007
|
}
|
|
1491
|
-
const result = await
|
|
2008
|
+
const result = await CfgAccountsAuth.cfgAccountsTokenRefreshCreate({
|
|
1492
2009
|
body: { refresh: refreshToken },
|
|
1493
2010
|
throwOnError: true
|
|
1494
2011
|
});
|