@schemavaults/auth-ui 0.6.37 → 0.6.40
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/components/AppsCard/apps_card.js +11 -7
- package/dist/components/AppsCard/apps_card.js.map +1 -1
- package/dist/components/AppsTable/AppsTable.js +13 -7
- package/dist/components/AppsTable/AppsTable.js.map +1 -1
- package/dist/components/AppsTable/frontend_app_actions.js +8 -1
- package/dist/components/AppsTable/frontend_app_actions.js.map +1 -1
- package/dist/components/AppsTable/send-authorize-app-request.d.ts +6 -4
- package/dist/components/AppsTable/send-authorize-app-request.js +10 -12
- package/dist/components/AppsTable/send-authorize-app-request.js.map +1 -1
- package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialog.d.ts +8 -0
- package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialog.js +66 -0
- package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialog.js.map +1 -0
- package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialogOpenDispatchContext.d.ts +2 -0
- package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialogOpenDispatchContext.js +8 -0
- package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialogOpenDispatchContext.js.map +1 -0
- package/dist/components/AuthorizeClientApplicationDialog/index.d.ts +3 -0
- package/dist/components/AuthorizeClientApplicationDialog/index.js +3 -0
- package/dist/components/AuthorizeClientApplicationDialog/index.js.map +1 -0
- package/dist/components/CreateAppDialog/CreateAppDialog.d.ts +2 -5
- package/dist/components/CreateAppDialog/CreateAppDialog.js +4 -1
- package/dist/components/CreateAppDialog/CreateAppDialog.js.map +1 -1
- package/package.json +3 -3
|
@@ -5,6 +5,7 @@ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle,
|
|
|
5
5
|
import { AppsTable, clearUseAppsListCache, } from "../AppsTable";
|
|
6
6
|
import CreateAppDialog, { CreateAppDialogOpenDispatchContext, } from "../CreateAppDialog";
|
|
7
7
|
import CreateAppDomainDialog, { CreateAppDomainDialogOpenContext, CreateAppDomainDialogOpenDispatchContext, } from "../CreateAppDomainDialog";
|
|
8
|
+
import AuthorizeClientApplicationDialog, { AuthorizeClientApplicationDialogOpenDispatchContext, } from "../AuthorizeClientApplicationDialog";
|
|
8
9
|
import { SCHEMAVAULTS_ORGANIZATION_ID } from "@schemavaults/auth-common";
|
|
9
10
|
export function AppsCard(props) {
|
|
10
11
|
const cardTitle = props.cardTitle ?? "Applications";
|
|
@@ -13,13 +14,16 @@ export function AppsCard(props) {
|
|
|
13
14
|
const cardClassName = cn("w-full", props.cardClassName);
|
|
14
15
|
const [createAppDialogOpen, setCreateAppDialogOpen] = useState(false);
|
|
15
16
|
const [isAddAppDomainDialogOpen, setAddAppDomainDialogOpen] = useState(false);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const [authorizeAppDialogOpen, setAuthorizeAppDialogOpen] = useState(false);
|
|
18
|
+
return (_jsx(CreateAppDialogOpenDispatchContext.Provider, { value: setCreateAppDialogOpen, children: _jsx(AuthorizeClientApplicationDialogOpenDispatchContext.Provider, { value: setAuthorizeAppDialogOpen, children: _jsx(CreateAppDomainDialogOpenDispatchContext.Provider, { value: setAddAppDomainDialogOpen, children: _jsxs(CreateAppDomainDialogOpenContext.Provider, { value: isAddAppDomainDialogOpen, children: [_jsxs(Card, { className: cardClassName, children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: cardTitle }), _jsx(CardDescription, { children: cardDescription })] }), _jsx(CardContent, { children: _jsx(AppsTable, { queryType: props.queryType, preloaded: props.preloaded, organization_id: props.organization_id, isOrgOwner: props.isOrgOwner }) }), _jsx(CardFooter, { children: _jsx("div", { className: "flex flex-row items-start justify-start gap-2" }) })] }), _jsxs(_Fragment, { children: [(props.queryType === "all" ||
|
|
19
|
+
(props.queryType === "org" && props.isOrgOwner)) && (_jsx(CreateAppDialog, { clearFrontendAppsCache: clearUseAppsListCache, owner_organization_id: props.queryType === "all"
|
|
20
|
+
? SCHEMAVAULTS_ORGANIZATION_ID
|
|
21
|
+
: props.organization_id, open: createAppDialogOpen, onOpenChange: setCreateAppDialogOpen, uuid: props.uuid })), props.queryType === "authorized" && (_jsx(AuthorizeClientApplicationDialog, { open: authorizeAppDialogOpen, onOpenChange: setAuthorizeAppDialogOpen })), (props.queryType === "all" ||
|
|
22
|
+
(props.queryType === "org" && props.isOrgOwner)) && (_jsx(CreateAppDomainDialog, { open: typeof isAddAppDomainDialogOpen === "string", onOpenChange: (val) => {
|
|
23
|
+
if (!val) {
|
|
24
|
+
setAddAppDomainDialogOpen(false);
|
|
25
|
+
}
|
|
26
|
+
}, uuid: props.uuid }))] })] }) }) }) }));
|
|
23
27
|
}
|
|
24
28
|
export default AppsCard;
|
|
25
29
|
//# sourceMappingURL=apps_card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps_card.js","sourceRoot":"","sources":["../../../src/components/AppsCard/apps_card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,EAAE,GACH,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,qBAAqB,GAEtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,eAAe,EAAE,EACtB,kCAAkC,GACnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,qBAAqB,EAAE,EAC5B,gCAAgC,EAChC,wCAAwC,GACzC,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"apps_card.js","sourceRoot":"","sources":["../../../src/components/AppsCard/apps_card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OA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AAK,CAAC,CAAC;wCACnC,CAAC;oCACH,CAAC,EACD,IAAI,EAAE,KAAK,CAAC,IAAI,GAChB,CACH,IACA,IACuC,GACM,GACS,GACnB,CAC/C,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
4
|
import { Datatable } from "@schemavaults/ui";
|
|
5
5
|
import { getAppsTableColumns } from "./columns";
|
|
6
6
|
import { useAppsList } from "./useAppsList";
|
|
7
|
-
import {
|
|
7
|
+
import { CreateAppDialogTrigger } from "../CreateAppDialog";
|
|
8
|
+
import { AuthorizeClientApplicationDialogTrigger } from "../AuthorizeClientApplicationDialog";
|
|
8
9
|
import { Loader2 } from "lucide-react";
|
|
9
|
-
function AppsTableHeaderButtons() {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
function AppsTableHeaderButtons({ queryType, isOrgOwner, }) {
|
|
11
|
+
return (_jsxs(_Fragment, { children: [queryType === "authorized" && ( // From a user's list of authorized apps, allow them to add more authorized apps
|
|
12
|
+
_jsx(AuthorizeClientApplicationDialogTrigger, {})), (queryType === "all" || (queryType === "org" && isOrgOwner)) && (_jsx(CreateAppDialogTrigger, {}))] }));
|
|
12
13
|
}
|
|
13
14
|
export function AppsTable({ queryType, preloaded, organization_id, isOrgOwner, }) {
|
|
14
15
|
const apps = useAppsList({
|
|
@@ -20,6 +21,11 @@ export function AppsTable({ queryType, preloaded, organization_id, isOrgOwner, }
|
|
|
20
21
|
const columns = useMemo(() => {
|
|
21
22
|
return getAppsTableColumns(queryType, preloaded, isOrgOwner);
|
|
22
23
|
}, [queryType, preloaded, isOrgOwner]);
|
|
24
|
+
const HeaderButtons = useMemo(() => {
|
|
25
|
+
return function AppsTableHeaderButtonsWithQueryType() {
|
|
26
|
+
return (_jsx(AppsTableHeaderButtons, { queryType: queryType, isOrgOwner: isOrgOwner }));
|
|
27
|
+
};
|
|
28
|
+
}, [queryType, isOrgOwner]);
|
|
23
29
|
if (!data && isLoading) {
|
|
24
30
|
return (_jsx("div", { className: "min-h-48 w-full flex items-center justify-center", children: _jsx(Loader2, { className: "h-12 w-12 animate-spin" }) }));
|
|
25
31
|
}
|
|
@@ -37,7 +43,7 @@ export function AppsTable({ queryType, preloaded, organization_id, isOrgOwner, }
|
|
|
37
43
|
"app_name",
|
|
38
44
|
"app_description",
|
|
39
45
|
"owner_organization_id",
|
|
40
|
-
], HeaderButtons:
|
|
46
|
+
], HeaderButtons: HeaderButtons, datatypeLabel: "App" }));
|
|
41
47
|
}
|
|
42
48
|
export default AppsTable;
|
|
43
49
|
//# sourceMappingURL=AppsTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppsTable.js","sourceRoot":"","sources":["../../../src/components/AppsTable/AppsTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AppsTable.js","sourceRoot":"","sources":["../../../src/components/AppsTable/AppsTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAA8B,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,uCAAuC,EAAE,MAAM,+CAA+C,CAAC;AACxG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAgBvC,SAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,UAAU,GACk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IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EACtD,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE;YACrB,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,IAAI;YACrB,qBAAqB,EAAE,KAAK;YAC5B,GAAG,EAAE,IAAI;YACT,OAAO,EAAE,IAAI;SACd,EACD,YAAY,EAAE;YACZ,QAAQ;YACR,UAAU;YACV,iBAAiB;YACjB,uBAAuB;SACxB,EACD,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAC,KAAK,GACnB,CACH,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { cn, useToast } from "@schemavaults/ui";
|
|
|
5
5
|
import { Button } from "@schemavaults/ui";
|
|
6
6
|
import { AppWindow, ClipboardCopy, EarthLock, MoreHorizontal, PlayCircle, PlugZap, Trash, } from "lucide-react";
|
|
7
7
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@schemavaults/ui";
|
|
8
|
-
import { useAdmin, useAppEnvironment } from "@schemavaults/auth-react-provider";
|
|
8
|
+
import { useAdmin, useAppEnvironment, useAuth, } from "@schemavaults/auth-react-provider";
|
|
9
9
|
import { sendAuthorizeFrontendAppRequest } from "./send-authorize-app-request";
|
|
10
10
|
import { useAppDomains } from "./useAppDomains";
|
|
11
11
|
import { launchWebApp } from "./launchWebApp";
|
|
@@ -19,6 +19,7 @@ export function FrontendApplicationActions({ app, queryType, isOrgOwner, }) {
|
|
|
19
19
|
const hardcoded = app.hardcoded && isHardcodedAppId(app_id);
|
|
20
20
|
const { toast } = useToast();
|
|
21
21
|
const [authorizingApp, startAuthorizingApp] = useTransition();
|
|
22
|
+
const authContext = useAuth();
|
|
22
23
|
let preloadedAppDomains = undefined;
|
|
23
24
|
if (hardcoded) {
|
|
24
25
|
preloadedAppDomains = HARDCODED_CORE_SCHEMAVAULTS_APP_DOMAINS.filter((a) => a.app_id === app_id);
|
|
@@ -117,9 +118,15 @@ export function FrontendApplicationActions({ app, queryType, isOrgOwner, }) {
|
|
|
117
118
|
}, "data-testid": "copy-app-id-menu-item", children: [_jsx(ClipboardCopy, { className: "h-4 w-4" }), " Copy app ID"] }), queryType !== "authorized" && _jsx(DropdownMenuSeparator, {}), queryType !== "authorized" && (_jsxs(DropdownMenuItem, { className: cn(dropdownMenuActionsClassName), onClick: () => {
|
|
118
119
|
startAuthorizingApp(async () => {
|
|
119
120
|
try {
|
|
121
|
+
if (!authContext ||
|
|
122
|
+
!authContext.ready ||
|
|
123
|
+
!authContext.client.current) {
|
|
124
|
+
throw new Error("Auth client is not ready!");
|
|
125
|
+
}
|
|
120
126
|
await sendAuthorizeFrontendAppRequest({
|
|
121
127
|
toast,
|
|
122
128
|
app_id: app.app_id,
|
|
129
|
+
auth: authContext.client.current,
|
|
123
130
|
});
|
|
124
131
|
}
|
|
125
132
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend_app_actions.js","sourceRoot":"","sources":["../../../src/components/AppsTable/frontend_app_actions.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"frontend_app_actions.js","sourceRoot":"","sources":["../../../src/components/AppsTable/frontend_app_actions.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAQb,OAAO,EAAqB,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,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gCAClB,KAAK,CAAC;oCACJ,OAAO,EAAE,SAAS;oCAClB,KAAK,EAAE,iBAAiB;iCACzB,CAAC,CAAC;4BACL,CAAC,aAED,KAAC,OAAO,IAAC,SAAS,EAAC,SAAS,GAAG,oBACd,CACpB,EAEA,gBAAgB,IAAI,CACnB,MAAC,gBAAgB,IACf,SAAS,EAAE,EAAE,CAAC,4BAA4B,CAAC,EAC3C,OAAO,EAAE,GAAS,EAAE;gCAClB,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gCACnC,OAAO;4BACT,CAAC,aAED,KAAC,SAAS,IAAC,SAAS,EAAC,SAAS,GAAG,mBAChB,CACpB,EAEA,CAAC,mBAAmB,IAAI,CACvB,8BACE,KAAC,qBAAqB,KAAG,EACzB,MAAC,gBAAgB,IACf,SAAS,EAAE,EAAE,CAAC,4BAA4B,CAAC,EAC3C,OAAO,EAAE,GAAS,EAAE;wCAClB,KAAK,CAAC;4CACJ,OAAO,EAAE,SAAS;4CAClB,KAAK,EAAE,iBAAiB;yCACzB,CAAC,CAAC;oCACL,CAAC,EACD,QAAQ,EAAE,mBAAmB,aAE7B,KAAC,KAAK,IAAC,SAAS,EAAC,SAAS,GAAG,mBACZ,IAClB,CACJ,IACmB,IACT,GACd,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ISchemaVaultsAuthClient } from "@schemavaults/auth-react-provider";
|
|
2
|
+
import type { useToast } from "@schemavaults/ui";
|
|
2
3
|
interface SendAuthorizeFrontendAppRequestOpts {
|
|
3
|
-
toast: ReturnType<typeof useToast>[
|
|
4
|
+
toast: ReturnType<typeof useToast>["toast"];
|
|
5
|
+
auth: ISchemaVaultsAuthClient;
|
|
4
6
|
app_id: string;
|
|
5
7
|
}
|
|
6
|
-
export declare function sendAuthorizeFrontendAppRequest({
|
|
7
|
-
export
|
|
8
|
+
export declare function sendAuthorizeFrontendAppRequest({ auth, app_id, toast, }: SendAuthorizeFrontendAppRequestOpts): Promise<void>;
|
|
9
|
+
export default sendAuthorizeFrontendAppRequest;
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
export async function sendAuthorizeFrontendAppRequest({ auth, app_id, toast, }) {
|
|
3
|
+
if (typeof app_id !== "string") {
|
|
3
4
|
throw new Error("Expected app to authorize's id to be a string");
|
|
5
|
+
}
|
|
4
6
|
try {
|
|
5
|
-
|
|
6
|
-
method: "POST",
|
|
7
|
-
body: JSON.stringify({ app_id }),
|
|
8
|
-
credentials: "include",
|
|
9
|
-
});
|
|
10
|
-
if (!response.ok || response.status !== 200)
|
|
11
|
-
throw new Error("Received failure response from server");
|
|
7
|
+
await auth.sendAuthorizeClientApplicationRequest(app_id);
|
|
12
8
|
}
|
|
13
9
|
catch (e) {
|
|
14
10
|
toast({
|
|
15
|
-
variant:
|
|
11
|
+
variant: "destructive",
|
|
16
12
|
title: "Error sending authorize app request",
|
|
17
13
|
description: e instanceof Error ? e.message : `Failed to send network request`,
|
|
18
14
|
});
|
|
19
15
|
return;
|
|
20
16
|
}
|
|
21
17
|
toast({
|
|
22
|
-
variant:
|
|
18
|
+
variant: "default",
|
|
23
19
|
title: "Successfully authorized application",
|
|
24
|
-
description: "You should now be able to log in through it"
|
|
20
|
+
description: "You should now be able to log in through it",
|
|
25
21
|
});
|
|
22
|
+
return;
|
|
26
23
|
}
|
|
24
|
+
export default sendAuthorizeFrontendAppRequest;
|
|
27
25
|
//# sourceMappingURL=send-authorize-app-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-authorize-app-request.js","sourceRoot":"","sources":["../../../src/components/AppsTable/send-authorize-app-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"send-authorize-app-request.js","sourceRoot":"","sources":["../../../src/components/AppsTable/send-authorize-app-request.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAWb,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,EACpD,IAAI,EACJ,MAAM,EACN,KAAK,GAC+B;IACpC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,KAAK,CAAC;YACJ,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,qCAAqC;YAC5C,WAAW,EACT,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC;SACpE,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,KAAK,CAAC;QACJ,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,6CAA6C;KAC3D,CAAC,CAAC;IACH,OAAO;AACT,CAAC;AAED,eAAe,+BAA+B,CAAC"}
|
package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialog.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
interface AuthorizeClientApplicationDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (val: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function AuthorizeClientApplicationDialog({ open, onOpenChange, }: AuthorizeClientApplicationDialogProps): ReactElement;
|
|
7
|
+
export declare function AuthorizeClientApplicationDialogTrigger(): ReactElement;
|
|
8
|
+
export default AuthorizeClientApplicationDialog;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useContext, useTransition } from "react";
|
|
4
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, useForm, useToast, } from "@schemavaults/ui";
|
|
5
|
+
import { useAuth } from "@schemavaults/auth-react-provider";
|
|
6
|
+
import { useSWRConfig } from "swr";
|
|
7
|
+
import { authorizeClientApplicationFormType } from "@schemavaults/auth-common";
|
|
8
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
9
|
+
import { AppWindow } from "lucide-react";
|
|
10
|
+
import { sendAuthorizeFrontendAppRequest } from "../AppsTable/send-authorize-app-request";
|
|
11
|
+
import { clearUseAppsListCache } from "../AppsTable/useAppsList";
|
|
12
|
+
import AuthorizeClientApplicationDialogOpenDispatchContext from "./AuthorizeClientApplicationDialogOpenDispatchContext";
|
|
13
|
+
export function AuthorizeClientApplicationDialog({ open, onOpenChange, }) {
|
|
14
|
+
const form = useForm({
|
|
15
|
+
resolver: zodResolver(authorizeClientApplicationFormType),
|
|
16
|
+
defaultValues: {
|
|
17
|
+
app_id: "",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const { toast } = useToast();
|
|
21
|
+
const authContext = useAuth();
|
|
22
|
+
const { mutate } = useSWRConfig();
|
|
23
|
+
const [submitting, startSubmitting] = useTransition();
|
|
24
|
+
async function onSubmit(values) {
|
|
25
|
+
startSubmitting(async () => {
|
|
26
|
+
try {
|
|
27
|
+
if (!authContext || !authContext.ready || !authContext.client.current) {
|
|
28
|
+
throw new Error("Auth client is not ready!");
|
|
29
|
+
}
|
|
30
|
+
await sendAuthorizeFrontendAppRequest({
|
|
31
|
+
toast,
|
|
32
|
+
app_id: values.app_id,
|
|
33
|
+
auth: authContext.client.current,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
toast({
|
|
38
|
+
variant: "destructive",
|
|
39
|
+
title: "Failed to authorize application",
|
|
40
|
+
description: e instanceof Error ? e.message : undefined,
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
clearUseAppsListCache(mutate);
|
|
45
|
+
onOpenChange(false);
|
|
46
|
+
form.reset();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { id: "authorize-app-dialog-content", className: "sm:max-w-[425px]", children: _jsx(Form, { ...form, children: _jsxs("form", { onSubmit: form.handleSubmit(onSubmit, (e) => {
|
|
50
|
+
console.error(e);
|
|
51
|
+
toast({
|
|
52
|
+
variant: "destructive",
|
|
53
|
+
title: "Failed to validate authorize app form inputs",
|
|
54
|
+
description: "See console for full error message",
|
|
55
|
+
});
|
|
56
|
+
}), className: "flex flex-col justify-start gap-4", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Authorize an application" }), _jsx(DialogDescription, { children: "Authorize a client application to access SchemaVaults APIs on your behalf by entering its app ID." })] }), _jsx(FormField, { control: form.control, name: "app_id", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: "App ID" }), _jsx(FormControl, { children: _jsx(Input, { placeholder: "Enter application ID", ...field, disabled: submitting }) }), _jsx(FormDescription, { children: "The unique identifier of the application you want to authorize." }), _jsx(FormMessage, {})] })) }), _jsx(DialogFooter, { children: _jsxs(Button, { id: "submit-authorize-app-form-button", type: "submit", disabled: submitting, children: [_jsx(AppWindow, { className: "h-4 w-4 mr-2" }), "Authorize application"] }) })] }) }) }) }));
|
|
57
|
+
}
|
|
58
|
+
export function AuthorizeClientApplicationDialogTrigger() {
|
|
59
|
+
const onOpenChange = useContext(AuthorizeClientApplicationDialogOpenDispatchContext);
|
|
60
|
+
return (_jsxs(Button, { id: "open-authorize-app-dialog-button", onClick: (e) => {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
onOpenChange(true);
|
|
63
|
+
}, children: [_jsx(AppWindow, { className: "h-4 w-4 mr-2" }), " Authorize app"] }));
|
|
64
|
+
}
|
|
65
|
+
export default AuthorizeClientApplicationDialog;
|
|
66
|
+
//# sourceMappingURL=AuthorizeClientApplicationDialog.js.map
|
package/dist/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialog.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizeClientApplicationDialog.js","sourceRoot":"","sources":["../../../src/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAqB,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,mDAAmD,MAAM,uDAAuD,CAAC;AAWxH,MAAM,UAAU,gCAAgC,CAAC,EAC/C,IAAI,EACJ,YAAY,GAC0B;IACtC,MAAM,IAAI,GAAG,OAAO,CAAyB;QAC3C,QAAQ,EAAE,WAAW,CAAC,kCAAkC,CAAC;QACzD,aAAa,EAAE;YACb,MAAM,EAAE,EAAE;SACX;KACF,CAAC,CAAC;IAEH,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ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CAAgC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
export const AuthorizeClientApplicationDialogOpenDispatchContext = createContext((val) => {
|
|
4
|
+
void val;
|
|
5
|
+
throw new Error("Not within AuthorizeClientApplicationDialogOpenDispatchContext.Provider render tree!");
|
|
6
|
+
});
|
|
7
|
+
export default AuthorizeClientApplicationDialogOpenDispatchContext;
|
|
8
|
+
//# sourceMappingURL=AuthorizeClientApplicationDialogOpenDispatchContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizeClientApplicationDialogOpenDispatchContext.js","sourceRoot":"","sources":["../../../src/components/AuthorizeClientApplicationDialog/AuthorizeClientApplicationDialogOpenDispatchContext.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,mDAAmD,GAAG,aAAa,CAE9E,CAAC,GAAY,EAAE,EAAE;IACjB,KAAK,GAAG,CAAC;IACT,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mDAAmD,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AuthorizeClientApplicationDialog, AuthorizeClientApplicationDialog as default, AuthorizeClientApplicationDialogTrigger, } from "./AuthorizeClientApplicationDialog";
|
|
2
|
+
export type * from "./AuthorizeClientApplicationDialog";
|
|
3
|
+
export { AuthorizeClientApplicationDialogOpenDispatchContext } from "./AuthorizeClientApplicationDialogOpenDispatchContext";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AuthorizeClientApplicationDialog, AuthorizeClientApplicationDialog as default, AuthorizeClientApplicationDialogTrigger, } from "./AuthorizeClientApplicationDialog";
|
|
2
|
+
export { AuthorizeClientApplicationDialogOpenDispatchContext } from "./AuthorizeClientApplicationDialogOpenDispatchContext";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AuthorizeClientApplicationDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,gCAAgC,IAAI,OAAO,EAC3C,uCAAuC,GACxC,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,mDAAmD,EAAE,MAAM,uDAAuD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
2
|
import { useSWRConfig } from "swr";
|
|
3
3
|
interface CreateFrontendAppDialogProps {
|
|
4
4
|
clearFrontendAppsCache: (mutate: ReturnType<typeof useSWRConfig>["mutate"]) => void;
|
|
@@ -8,8 +8,5 @@ interface CreateFrontendAppDialogProps {
|
|
|
8
8
|
uuid: () => string;
|
|
9
9
|
}
|
|
10
10
|
export declare function CreateAppDialog({ clearFrontendAppsCache, owner_organization_id, ...props }: CreateFrontendAppDialogProps): ReactElement;
|
|
11
|
-
|
|
12
|
-
onOpenChange: (val: boolean) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare function CreateAppDialogTrigger({ onOpenChange, }: CreateFrontendAppDialogTriggerProps): ReactElement;
|
|
11
|
+
export declare function CreateAppDialogTrigger(): ReactElement;
|
|
15
12
|
export default CreateAppDialog;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Button } from "@schemavaults/ui";
|
|
4
|
+
import { useContext } from "react";
|
|
4
5
|
import { Dialog, DialogContent } from "@schemavaults/ui";
|
|
5
6
|
import { SCHEMAVAULTS_ORGANIZATION_ID } from "@schemavaults/auth-common";
|
|
6
7
|
import { AppWindow } from "lucide-react";
|
|
7
8
|
import CreateAppForm from "./CreateAppForm";
|
|
9
|
+
import CreateAppDialogOpenDispatchContext from "./CreateAppDialogOpenDispatchContext";
|
|
8
10
|
export function CreateAppDialog({ clearFrontendAppsCache, owner_organization_id, ...props }) {
|
|
9
11
|
return (_jsx(Dialog, { open: props.open, onOpenChange: props.onOpenChange, children: _jsx(DialogContent, { id: "create-app-dialog-content", className: "sm:max-w-[425px]", children: _jsx(CreateAppForm, { owner_organization_id: owner_organization_id ?? SCHEMAVAULTS_ORGANIZATION_ID, clearFrontendAppsCache: clearFrontendAppsCache, onSuccess: () => props.onOpenChange(false), uuid: props.uuid }) }) }));
|
|
10
12
|
}
|
|
11
|
-
export function CreateAppDialogTrigger(
|
|
13
|
+
export function CreateAppDialogTrigger() {
|
|
14
|
+
const onOpenChange = useContext(CreateAppDialogOpenDispatchContext);
|
|
12
15
|
return (_jsxs(Button, { id: "open-create-app-dialog-button", onClick: (e) => {
|
|
13
16
|
e.preventDefault();
|
|
14
17
|
onOpenChange(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAppDialog.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/CreateAppDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateAppDialog.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/CreateAppDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AAYtF,MAAM,UAAU,eAAe,CAAC,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,GAAG,KAAK,EACqB;IAC7B,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,YACxD,KAAC,aAAa,IACZ,EAAE,EAAC,2BAA2B,EAC9B,SAAS,EAAC,kBAAkB,YAE5B,KAAC,aAAa,IACZ,qBAAqB,EACnB,qBAAqB,IAAI,4BAA4B,EAEvD,sBAAsB,EAAE,sBAAsB,EAC9C,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAC1C,IAAI,EAAE,KAAK,CAAC,IAAI,GAChB,GACY,GACT,CACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,YAAY,GAA4B,UAAU,CACtD,kCAAkC,CACnC,CAAC;IAEF,OAAO,CACL,MAAC,MAAM,IACL,EAAE,EAAC,+BAA+B,EAClC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,aAED,KAAC,SAAS,IAAC,SAAS,EAAC,cAAc,GAAG,mBAC/B,CACV,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schemavaults/auth-ui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.40",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "React.js UI components for authentication/authorization shared between different SchemaVaults apps",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@schemavaults/ui": "0.13.12",
|
|
14
|
-
"@schemavaults/auth-react-provider": "0.
|
|
14
|
+
"@schemavaults/auth-react-provider": "0.9.4",
|
|
15
15
|
"@schemavaults/app-definitions": "0.6.17",
|
|
16
|
-
"@schemavaults/auth-common": "0.
|
|
16
|
+
"@schemavaults/auth-common": "0.9.1",
|
|
17
17
|
"@hookform/resolvers": "3.9.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|