@cobaltcore-dev/aurora 0.19.0 → 0.20.0
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/client/App.d.ts +12 -0
- package/dist/client/{DeletePcaModal-BU6kbKsw.mjs → DeletePcaModal-YUlNw8cw.mjs} +2 -2
- package/dist/client/{DeletePcaModal-BU6kbKsw.mjs.map → DeletePcaModal-YUlNw8cw.mjs.map} +1 -1
- package/dist/client/{DetailsInfo-BUyuYpJj.mjs → DetailsInfo-Cv3oke-R.mjs} +2 -2
- package/dist/client/{DetailsInfo-BUyuYpJj.mjs.map → DetailsInfo-Cv3oke-R.mjs.map} +1 -1
- package/dist/client/{FloatingIpActionModals-DAtZoYGS.mjs → FloatingIpActionModals-PLN6CWZ9.mjs} +2 -2
- package/dist/client/{FloatingIpActionModals-DAtZoYGS.mjs.map → FloatingIpActionModals-PLN6CWZ9.mjs.map} +1 -1
- package/dist/client/{ImageToastNotifications-BhjU1bfT.mjs → ImageToastNotifications-BQM7HOyE.mjs} +2 -2
- package/dist/client/{ImageToastNotifications-BhjU1bfT.mjs.map → ImageToastNotifications-BQM7HOyE.mjs.map} +1 -1
- package/dist/client/_auth-BtRCgHQe.mjs.map +1 -1
- package/dist/client/{_floatingIpId-BHZGh8U8.mjs → _floatingIpId-DFCaWI9K.mjs} +2 -2
- package/dist/client/{_floatingIpId-BHZGh8U8.mjs.map → _floatingIpId-DFCaWI9K.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-CR3aD38l2.mjs → _floatingIpId-De0hCSSN2.mjs} +4 -4
- package/dist/client/{_floatingIpId-CR3aD38l2.mjs.map → _floatingIpId-De0hCSSN2.mjs.map} +1 -1
- package/dist/client/{_imageId-Cf-Xdksv.mjs → _imageId-D8HiDS3P.mjs} +2 -2
- package/dist/client/{_imageId-Cf-Xdksv.mjs.map → _imageId-D8HiDS3P.mjs.map} +1 -1
- package/dist/client/{_pcaId-B7j0sXnY.mjs → _pcaId-CNbmhUF8.mjs} +4 -4
- package/dist/client/{_pcaId-B7j0sXnY.mjs.map → _pcaId-CNbmhUF8.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-BVSsCus9.mjs → _securityGroupId-a46ExjsA.mjs} +2 -2
- package/dist/client/{_securityGroupId-BVSsCus9.mjs.map → _securityGroupId-a46ExjsA.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-gwV4eB0s.mjs → _securityGroupId-ju2ZSIYe.mjs} +3 -3
- package/dist/client/{_securityGroupId-gwV4eB0s.mjs.map → _securityGroupId-ju2ZSIYe.mjs.map} +1 -1
- package/dist/client/analytics/setupRouterAnalytics.d.ts +20 -0
- package/dist/client/assets/__mocks__/svgMock.d.ts +3 -0
- package/dist/client/components/Auth/SessionExpirationTimer.d.ts +4 -0
- package/dist/client/components/ClipboardText.d.ts +10 -0
- package/dist/client/components/ContentHeader/ContentHeader.d.ts +10 -0
- package/dist/client/components/Error/RouteError.d.ts +9 -0
- package/dist/client/components/Error/StatusError.d.ts +11 -0
- package/dist/client/components/JsonEditor.d.ts +39 -0
- package/dist/client/components/ListToolbar/FiltersInput.d.ts +6 -0
- package/dist/client/components/ListToolbar/SelectedFilters.d.ts +24 -0
- package/dist/client/components/ListToolbar/SortInput.d.ts +11 -0
- package/dist/client/components/ListToolbar/index.d.ts +26 -0
- package/dist/client/components/ListToolbar/types.d.ts +116 -0
- package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +12 -0
- package/dist/client/components/Slot.d.ts +7 -0
- package/dist/client/components/navigation/LanguageSelect.d.ts +3 -0
- package/dist/client/components/navigation/MainNavigation.d.ts +10 -0
- package/dist/client/components/navigation/UserMenu.d.ts +1 -0
- package/dist/client/components/navigation/types.d.ts +4 -0
- package/dist/client/{floatingips-DyBEotB8.mjs → floatingips-D98DrjA0.mjs} +3 -3
- package/dist/client/{floatingips-DyBEotB8.mjs.map → floatingips-D98DrjA0.mjs.map} +1 -1
- package/dist/client/hooks/index.d.ts +18 -0
- package/dist/client/hooks/useDomainId.d.ts +21 -0
- package/dist/client/hooks/useModalTracking.d.ts +33 -0
- package/dist/client/hooks/useProjectId.d.ts +22 -0
- package/dist/client/hooks/useScope.d.ts +4 -0
- package/dist/client/{hooks-iGiEkLTp.mjs → hooks-BsbKkpZc.mjs} +13 -3
- package/dist/client/hooks-BsbKkpZc.mjs.map +1 -0
- package/dist/client/{images-C3voJ3B1.mjs → images-CkW8zNjs.mjs} +4 -4
- package/dist/client/{images-C3voJ3B1.mjs.map → images-CkW8zNjs.mjs.map} +1 -1
- package/dist/client/{images-BklbSacK.mjs → images-sNuJa6ce.mjs} +2 -2
- package/dist/client/{images-BklbSacK.mjs.map → images-sNuJa6ce.mjs.map} +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +254 -258
- package/dist/client/index.js.map +1 -1
- package/dist/client/{pca-72YR_Pk0.mjs → pca-B4_2DqT2.mjs} +2 -2
- package/dist/client/{pca-72YR_Pk0.mjs.map → pca-B4_2DqT2.mjs.map} +1 -1
- package/dist/client/{pca-CsBx_IDO.mjs → pca-BClYQElh.mjs} +4 -4
- package/dist/client/{pca-CsBx_IDO.mjs.map → pca-BClYQElh.mjs.map} +1 -1
- package/dist/client/router.d.ts +7 -0
- package/dist/client/{securitygroups-8vRbXmBL.mjs → securitygroups-BwhVyNmZ.mjs} +2 -2
- package/dist/client/{securitygroups-8vRbXmBL.mjs.map → securitygroups-BwhVyNmZ.mjs.map} +1 -1
- package/dist/client/store/AuthProvider.d.ts +23 -0
- package/dist/client/utils/buildFilterParams.d.ts +5 -0
- package/dist/client/utils/cn.d.ts +27 -0
- package/dist/client/utils/formatBytes.d.ts +40 -0
- package/dist/client/utils/formatFloatingIpStatus.d.ts +6 -0
- package/dist/client/utils/languageDetection.d.ts +11 -0
- package/dist/client/utils/trpcErrors.d.ts +13 -0
- package/dist/client/utils/useErrorTranslation.d.ts +4 -0
- package/dist/client/utils/useListWithFiltering.d.ts +84 -0
- package/dist/client/utils/useModal.d.ts +3 -0
- package/package.json +1 -1
- package/dist/client/hooks-iGiEkLTp.mjs.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface UseModalTrackingOptions {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
actionPrefix: string;
|
|
4
|
+
}
|
|
5
|
+
interface UseModalTrackingReturn {
|
|
6
|
+
trackClose: () => void;
|
|
7
|
+
markSubmitted: () => void;
|
|
8
|
+
resetTracking: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Custom hook to handle modal open/close analytics tracking.
|
|
12
|
+
*
|
|
13
|
+
* Tracks:
|
|
14
|
+
* - `.open` event when modal opens (once per modal open)
|
|
15
|
+
* - `.close` event when modal closes without submission (cancelled)
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const { trackClose, markSubmitted, resetTracking } = useModalTracking({
|
|
19
|
+
* isOpen,
|
|
20
|
+
* actionPrefix: "storage.ceph.bucket.create"
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* // In handleClose:
|
|
24
|
+
* trackClose()
|
|
25
|
+
*
|
|
26
|
+
* // In handleSubmit:
|
|
27
|
+
* markSubmitted()
|
|
28
|
+
*
|
|
29
|
+
* // In cleanup/reset:
|
|
30
|
+
* resetTracking()
|
|
31
|
+
*/
|
|
32
|
+
export declare const useModalTracking: ({ isOpen, actionPrefix }: UseModalTrackingOptions) => UseModalTrackingReturn;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract projectId from the current URL.
|
|
3
|
+
*
|
|
4
|
+
* This hook works with both old and new route structures:
|
|
5
|
+
* - Old: /accounts/:accountId/projects/:projectId/...
|
|
6
|
+
* - New: /projects/:projectId/...
|
|
7
|
+
*
|
|
8
|
+
* @throws {Error} If used outside of a project route context
|
|
9
|
+
* @returns {string} The current project ID from URL params
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* function SecurityGroupsList() {
|
|
14
|
+
* const projectId = useProjectId()
|
|
15
|
+
*
|
|
16
|
+
* const { data } = trpc.network.securityGroup.list.useQuery({
|
|
17
|
+
* project_id: projectId
|
|
18
|
+
* })
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useProjectId(): string;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { n as e } from "./AuthProvider-Cj_Btfnc.mjs";
|
|
2
2
|
import "./useProjectId-DBc5lpoU.mjs";
|
|
3
|
+
import { useParams as t } from "@tanstack/react-router";
|
|
3
4
|
//#region src/client/hooks/useDomainId.ts
|
|
4
|
-
function
|
|
5
|
+
function n() {
|
|
5
6
|
let { user: t } = e(), n = t?.domain?.id;
|
|
6
7
|
if (!n) throw Error("useDomainId() requires an authenticated user with a domain. This is likely an authentication error. Ensure the user is logged in and has a domain assigned.");
|
|
7
8
|
return n;
|
|
8
9
|
}
|
|
9
10
|
//#endregion
|
|
10
|
-
|
|
11
|
+
//#region src/client/hooks/useScope.ts
|
|
12
|
+
function r() {
|
|
13
|
+
let n = e(), { projectId: r } = t({ strict: !1 });
|
|
14
|
+
return {
|
|
15
|
+
userDomainId: n.user?.domain?.id,
|
|
16
|
+
projectId: r
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n, r as t };
|
|
11
21
|
|
|
12
|
-
//# sourceMappingURL=hooks-
|
|
22
|
+
//# sourceMappingURL=hooks-BsbKkpZc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-BsbKkpZc.mjs","names":["useAuth","useDomainId","user","domainId","domain","id","Error","useParams","useAuth","useScope","auth","projectId","strict","userDomainId","user","domain","id"],"sources":["../../src/client/hooks/useDomainId.ts","../../src/client/hooks/useScope.ts"],"sourcesContent":["import { useAuth } from \"@/client/store/AuthProvider\"\n\n/**\n * Get the current user's domain ID from the authentication context.\n *\n * This hook provides access to the domain ID of the currently authenticated user.\n * The domain ID is obtained from the user's session, not from URL parameters.\n *\n * @throws {Error} If user is not authenticated or domain ID is not available\n * @returns {string} The current domain ID from the user's session\n *\n * @example\n * ```tsx\n * function UsersList() {\n * const domainId = useDomainId()\n *\n * const { data } = trpc.identity.users.list.useQuery({\n * domain_id: domainId\n * })\n * }\n * ```\n */\nexport function useDomainId(): string {\n const { user } = useAuth()\n\n const domainId = user?.domain?.id\n\n if (!domainId) {\n throw new Error(\n \"useDomainId() requires an authenticated user with a domain. \" +\n \"This is likely an authentication error. \" +\n \"Ensure the user is logged in and has a domain assigned.\"\n )\n }\n\n return domainId\n}\n","import { useParams } from \"@tanstack/react-router\"\nimport { useAuth } from \"../store/AuthProvider\"\n\nexport function useScope() {\n const auth = useAuth()\n const { projectId } = useParams({ strict: false })\n\n const userDomainId = auth.user?.domain?.id\n return {\n userDomainId,\n projectId,\n }\n}\n"],"mappings":";;;;AAsBA,SAAgBC,IAAAA;CACd,IAAM,EAAEC,YAASF,EAAAA,GAEXG,IAAWD,GAAME,QAAQC;CAE/B,IAAI,CAACF,GACH,MAAUG,MACR,6JAEE;CAIN,OAAOH;AACT;;;ACjCA,SAAgBM,IAAAA;CACd,IAAMC,IAAOF,EAAAA,GACP,EAAEG,iBAAcJ,EAAU,EAAEK,QAAQ,GAAM,CAAA;CAGhD,OAAO;EACLC,cAFmBH,EAAKI,MAAMC,QAAQC;EAGtCL;CACF;AACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { A as e, B as t, C as n, E as r, G as i, H as a, I as o, J as s, K as c, M as l, P as u, R as d, U as f, X as p, Y as m, at as h, c as g, ct as _, dt as v, g as y, lt as ee, m as b, n as te, o as x, r as S, rt as C, st as w, tt as T, ut as E, y as D } from "./build-DgeVmENN.mjs";
|
|
2
2
|
import { n as O, r as k } from "./trpcClient-BxcNKnhv.mjs";
|
|
3
3
|
import { t as ne } from "./cn-DM4Cy3jv.mjs";
|
|
4
|
-
import { t as A } from "./images-
|
|
4
|
+
import { t as A } from "./images-sNuJa6ce.mjs";
|
|
5
5
|
import { t as j } from "./useProjectId-DBc5lpoU.mjs";
|
|
6
|
-
import "./hooks-
|
|
6
|
+
import "./hooks-BsbKkpZc.mjs";
|
|
7
7
|
import { t as M } from "./ContentHeader-BIScbvb4.mjs";
|
|
8
8
|
import { t as N } from "./SortInput-DjaEHvcO.mjs";
|
|
9
|
-
import { A as P, C as re, D as ie, E as F, F as ae, I, M as L, N as R, O as oe, P as z, S as se, T as B, _ as ce, a as le, b as V, c as H, d as U, f as W, g as ue, h as de, i as fe, j as pe, k as me, l as he, m as ge, n as _e, o as ve, p as ye, r as be, s as xe, t as Se, u as Ce, v as we, w as Te, x as Ee, y as De } from "./ImageToastNotifications-
|
|
9
|
+
import { A as P, C as re, D as ie, E as F, F as ae, I, M as L, N as R, O as oe, P as z, S as se, T as B, _ as ce, a as le, b as V, c as H, d as U, f as W, g as ue, h as de, i as fe, j as pe, k as me, l as he, m as ge, n as _e, o as ve, p as ye, r as be, s as xe, t as Se, u as Ce, v as we, w as Te, x as Ee, y as De } from "./ImageToastNotifications-BQM7HOyE.mjs";
|
|
10
10
|
import { n as Oe, t as ke } from "./FiltersInput-cOaaRpcQ.mjs";
|
|
11
11
|
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
12
12
|
import { Suspense as Ae, startTransition as je, use as Me, useCallback as Ne, useEffect as Pe, useMemo as Fe, useRef as Ie, useState as J } from "react";
|
|
@@ -1887,4 +1887,4 @@ function ut() {
|
|
|
1887
1887
|
//#endregion
|
|
1888
1888
|
export { ut as component };
|
|
1889
1889
|
|
|
1890
|
-
//# sourceMappingURL=images-
|
|
1890
|
+
//# sourceMappingURL=images-CkW8zNjs.mjs.map
|