@djangocfg/api 2.1.541 → 2.1.543
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 +1 -2
- package/dist/auth-server.cjs +1 -0
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth.cjs +156 -170
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +134 -29
- package/dist/auth.d.ts +134 -29
- package/dist/auth.mjs +168 -183
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +4 -99
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +4 -136
- package/dist/clients.d.ts +4 -136
- package/dist/clients.mjs +3 -99
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +2 -4
- package/dist/hooks.d.ts +2 -4
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +4 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -340
- package/dist/index.d.ts +10 -340
- package/dist/index.mjs +3 -100
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRetrieve.ts +8 -2
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +8 -2
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +8 -2
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpConsentPolicyRetrieve.ts +8 -2
- package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +8 -2
- package/src/_api/generated/_cfg_accounts/openapi.json +0 -45
- package/src/_api/generated/_cfg_accounts/schemas/User.ts +0 -2
- package/src/_api/generated/_cfg_accounts/schemas/index.ts +0 -1
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +8 -2
- package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +8 -2
- package/src/_api/generated/index.ts +1 -5
- package/src/_api/generated/openapi.json +0 -135
- package/src/_api/generated/sdk.gen.ts +1 -20
- package/src/_api/generated/types.gen.ts +0 -79
- package/src/_api/index.ts +1 -1
- package/src/auth/__tests__/useTwoFactorStatus.test.ts +2 -2
- package/src/auth/context/AccountsContext.tsx +15 -11
- package/src/auth/hooks/useAuthForm.ts +0 -1
- package/src/auth/hooks/useCfgRouter.ts +1 -4
- package/src/auth/hooks/useGithubAuth.ts +25 -3
- package/src/auth/hooks/useLocalStorage.ts +7 -30
- package/src/auth/hooks/useSessionStorage.ts +6 -29
- package/src/auth/hooks/useTwoFactorVerify.ts +5 -9
- package/src/auth/utils/analytics.ts +22 -2
- package/src/auth/utils/errors.ts +22 -11
- package/src/auth/utils/storage.ts +64 -0
- package/src/clients.ts +2 -4
- package/src/index.ts +0 -2
- package/src/log-control.ts +1 -1
- package/src/server.ts +0 -4
- package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +0 -14
- package/src/_api/generated/_cfg_centrifugo/api.ts +0 -87
- package/src/_api/generated/_cfg_centrifugo/hooks/index.ts +0 -4
- package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +0 -74
- package/src/_api/generated/_cfg_centrifugo/index.ts +0 -29
- package/src/_api/generated/_cfg_centrifugo/openapi.json +0 -136
- package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +0 -14
- package/src/_api/generated/_cfg_centrifugo/schemas/index.ts +0 -4
- package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +0 -5
- package/src/_api/generated/_cfg_centrifugo/types.gen.ts +0 -5
package/dist/clients.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
"use strict";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -22,10 +23,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
23
|
var clients_exports = {};
|
|
23
24
|
__export(clients_exports, {
|
|
24
25
|
AccountsAPI: () => API,
|
|
25
|
-
|
|
26
|
-
TotpAPI: () => API3,
|
|
26
|
+
TotpAPI: () => API2,
|
|
27
27
|
apiAccounts: () => CfgAccountsApi,
|
|
28
|
-
apiCentrifugo: () => CfgCentrifugoApi,
|
|
29
28
|
apiTotp: () => CfgTotpApi
|
|
30
29
|
});
|
|
31
30
|
module.exports = __toCommonJS(clients_exports);
|
|
@@ -2057,27 +2056,6 @@ var CfgAccountsAuth = class {
|
|
|
2057
2056
|
});
|
|
2058
2057
|
}
|
|
2059
2058
|
};
|
|
2060
|
-
var CfgCentrifugo = class {
|
|
2061
|
-
static {
|
|
2062
|
-
__name(this, "CfgCentrifugo");
|
|
2063
|
-
}
|
|
2064
|
-
/**
|
|
2065
|
-
* Get Centrifugo connection token
|
|
2066
|
-
*
|
|
2067
|
-
* Generate JWT token for WebSocket connection to Centrifugo. Token includes user's allowed channels based on their permissions. Requires authentication.
|
|
2068
|
-
*/
|
|
2069
|
-
static cfgCentrifugoAuthTokenRetrieve(options) {
|
|
2070
|
-
return (options?.client ?? client).get({
|
|
2071
|
-
security: [
|
|
2072
|
-
{ name: "X-API-Key", type: "apiKey" },
|
|
2073
|
-
{ scheme: "bearer", type: "http" },
|
|
2074
|
-
{ name: "Authorization", type: "apiKey" }
|
|
2075
|
-
],
|
|
2076
|
-
url: "/cfg/centrifugo/auth/token/",
|
|
2077
|
-
...options
|
|
2078
|
-
});
|
|
2079
|
-
}
|
|
2080
|
-
};
|
|
2081
2059
|
var CfgTotpBackupCodes = class {
|
|
2082
2060
|
static {
|
|
2083
2061
|
__name(this, "CfgTotpBackupCodes");
|
|
@@ -2340,80 +2318,8 @@ var API = class {
|
|
|
2340
2318
|
}
|
|
2341
2319
|
};
|
|
2342
2320
|
|
|
2343
|
-
// src/_api/generated/_cfg_centrifugo/api.ts
|
|
2344
|
-
var API2 = class {
|
|
2345
|
-
static {
|
|
2346
|
-
__name(this, "API");
|
|
2347
|
-
}
|
|
2348
|
-
logger;
|
|
2349
|
-
cfgCentrifugo = CfgCentrifugo;
|
|
2350
|
-
constructor(_baseUrl, opts = {}) {
|
|
2351
|
-
this.logger = new APILogger(opts.logger);
|
|
2352
|
-
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
2353
|
-
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
2354
|
-
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
2355
|
-
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
2356
|
-
}
|
|
2357
|
-
// ── Base URL ────────────────────────────────────────────────────────────
|
|
2358
|
-
getBaseUrl() {
|
|
2359
|
-
return auth.getBaseUrl();
|
|
2360
|
-
}
|
|
2361
|
-
setBaseUrl(url) {
|
|
2362
|
-
auth.setBaseUrl(url);
|
|
2363
|
-
}
|
|
2364
|
-
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
2365
|
-
getToken() {
|
|
2366
|
-
return auth.getToken();
|
|
2367
|
-
}
|
|
2368
|
-
setToken(token) {
|
|
2369
|
-
auth.setToken(token);
|
|
2370
|
-
}
|
|
2371
|
-
getRefreshToken() {
|
|
2372
|
-
return auth.getRefreshToken();
|
|
2373
|
-
}
|
|
2374
|
-
setRefreshToken(token) {
|
|
2375
|
-
auth.setRefreshToken(token);
|
|
2376
|
-
}
|
|
2377
|
-
clearToken() {
|
|
2378
|
-
auth.clearTokens();
|
|
2379
|
-
}
|
|
2380
|
-
isAuthenticated() {
|
|
2381
|
-
return auth.isAuthenticated();
|
|
2382
|
-
}
|
|
2383
|
-
// ── Locale / API key ────────────────────────────────────────────────────
|
|
2384
|
-
getLocale() {
|
|
2385
|
-
return auth.getLocale();
|
|
2386
|
-
}
|
|
2387
|
-
setLocale(locale) {
|
|
2388
|
-
auth.setLocale(locale);
|
|
2389
|
-
}
|
|
2390
|
-
getApiKey() {
|
|
2391
|
-
return auth.getApiKey();
|
|
2392
|
-
}
|
|
2393
|
-
setApiKey(key) {
|
|
2394
|
-
auth.setApiKey(key);
|
|
2395
|
-
}
|
|
2396
|
-
// ── 401 handling ────────────────────────────────────────────────────────
|
|
2397
|
-
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
2398
|
-
onUnauthorized(cb) {
|
|
2399
|
-
auth.onUnauthorized(cb);
|
|
2400
|
-
}
|
|
2401
|
-
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
2402
|
-
setRefreshHandler(fn) {
|
|
2403
|
-
auth.setRefreshHandler(fn);
|
|
2404
|
-
}
|
|
2405
|
-
/**
|
|
2406
|
-
* Proactively refresh now via the registered handler, sharing the single
|
|
2407
|
-
* 401-recovery flight (rotation + dedup + rotated-token persistence).
|
|
2408
|
-
* See `auth.refreshNow`.
|
|
2409
|
-
*/
|
|
2410
|
-
refreshNow() {
|
|
2411
|
-
return auth.refreshNow();
|
|
2412
|
-
}
|
|
2413
|
-
};
|
|
2414
|
-
|
|
2415
2321
|
// src/_api/generated/_cfg_totp/api.ts
|
|
2416
|
-
var
|
|
2322
|
+
var API2 = class {
|
|
2417
2323
|
static {
|
|
2418
2324
|
__name(this, "API");
|
|
2419
2325
|
}
|
|
@@ -2489,6 +2395,5 @@ var API3 = class {
|
|
|
2489
2395
|
|
|
2490
2396
|
// src/_api/generated/index.ts
|
|
2491
2397
|
var CfgAccountsApi = new API();
|
|
2492
|
-
var
|
|
2493
|
-
var CfgTotpApi = new API3();
|
|
2398
|
+
var CfgTotpApi = new API2();
|
|
2494
2399
|
//# sourceMappingURL=clients.cjs.map
|