@create-flow/auth-ui 0.0.1 → 0.1.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/components/Hello.d.ts +7 -0
- package/dist/components/IAMConsole.d.ts +23 -0
- package/dist/components/Login.d.ts +15 -0
- package/dist/components/OAuthButtons.d.ts +11 -0
- package/dist/components/Profile.d.ts +13 -0
- package/dist/components/ResetPassword.d.ts +10 -0
- package/dist/components/Sidebar.d.ts +31 -0
- package/dist/components/Signup.d.ts +14 -0
- package/dist/components/UserMenu.d.ts +25 -0
- package/dist/components/VerifyEmail.d.ts +11 -0
- package/dist/components/iam/ConfirmDialog.d.ts +12 -0
- package/dist/components/iam/DropdownMenu.d.ts +20 -0
- package/dist/components/iam/GroupModal.d.ts +14 -0
- package/dist/components/iam/RoleModal.d.ts +15 -0
- package/dist/components/iam/UserModal.d.ts +14 -0
- package/dist/components/iam/icons.d.ts +22 -0
- package/dist/i18n/I18nContext.d.ts +23 -0
- package/dist/i18n/translations.d.ts +1 -0
- package/dist/index.css +1 -7
- package/dist/index.d.ts +10 -1
- package/dist/index.js +22143 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +22132 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/styles.css +1 -0
- package/dist/utils/__tests__/authApi.test.d.ts +1 -0
- package/dist/utils/authApi.d.ts +13 -0
- package/dist/utils/css-injection.d.ts +2 -0
- package/dist/utils/iamApi.d.ts +209 -0
- package/package.json +49 -17
- package/src/index.css +3 -0
- package/src/styles.module.css +9 -0
package/dist/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder, textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-24{bottom:-6rem}.-left-32{left:-8rem}.-right-24{right:-6rem}.-top-32{top:-8rem}.z-10{z-index:10}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-14{height:3.5rem}.h-16{height:4rem}.h-24{height:6rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-96{height:24rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-24{width:6rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-full{width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.gap-2\.5{gap:.625rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.border-zinc-300{--tw-border-opacity:1;border-color:rgb(212 212 216/var(--tw-border-opacity,1))}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgb(16 185 129/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.p-8{padding:2rem}.px-12{padding-left:3rem;padding-right:3rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.pb-16{padding-bottom:4rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.text-zinc-600{--tw-text-opacity:1;color:rgb(82 82 91/var(--tw-text-opacity,1))}.text-zinc-700{--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.placeholder-zinc-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.placeholder-zinc-400::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.opacity-60{opacity:.6}.opacity-\[0\.03\]{opacity:.03}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,0.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-2xl,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--background:#fff;--foreground:#171717}@theme inline{--color-background:var(--background);--color-foreground:var(--foreground);--font-sans:var(--font-geist-sans);--font-mono:var(--font-geist-mono)}@media (prefers-color-scheme:dark){:root{--background:#0a0a0a;--foreground:#ededed}}body{background:var(--background);color:var(--foreground);font-family:Arial,Helvetica,sans-serif}.hover\:bg-zinc-700:hover{--tw-bg-opacity:1;background-color:rgb(63 63 70/var(--tw-bg-opacity,1))}.hover\:text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.focus\:ring-zinc-900:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(24 24 27/var(--tw-ring-opacity,1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-5\/12{width:41.666667%}.md\:flex-row{flex-direction:row}.md\:px-16{padding-left:4rem;padding-right:4rem}}@media (min-width:1024px){.lg\:w-\[42\%\]{width:42%}.lg\:px-24{padding-left:6rem;padding-right:6rem}}@media (prefers-color-scheme:dark){.dark\:border-zinc-700{--tw-border-opacity:1;border-color:rgb(63 63 70/var(--tw-border-opacity,1))}.dark\:border-zinc-800{--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\:bg-red-950\/20{background-color:rgba(69,10,10,.2)}.dark\:bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.dark\:bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\:bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.dark\:bg-zinc-950{--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\:text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.dark\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\:text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.dark\:text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\:text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\:text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\:hover\:bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.dark\:hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\:focus\:ring-zinc-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const DEFAULT_AUTH_HOST: string;
|
|
2
|
+
declare const DEFAULT_APP_ID: string;
|
|
3
|
+
declare function buildAuthUrl(path: string, host?: string, query?: Record<string, string | undefined>): string;
|
|
4
|
+
export declare function postAuthJson(path: string, body: unknown, host?: string, authToken?: string): Promise<{
|
|
5
|
+
response: Response;
|
|
6
|
+
data: any;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function getAuthJson(path: string, host?: string, query?: Record<string, string | undefined>, authToken?: string): Promise<{
|
|
9
|
+
response: Response;
|
|
10
|
+
data: any;
|
|
11
|
+
}>;
|
|
12
|
+
declare function getResolvedAppId(appId?: string): string;
|
|
13
|
+
export { DEFAULT_AUTH_HOST, DEFAULT_APP_ID, buildAuthUrl, getResolvedAppId };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
export interface IAMUser {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
roles?: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}>;
|
|
12
|
+
groups?: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}>;
|
|
16
|
+
permissions?: string[];
|
|
17
|
+
permissionDetails?: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
module: string;
|
|
21
|
+
}>;
|
|
22
|
+
isActive: boolean;
|
|
23
|
+
approvalStatus?: 'approved' | 'pending' | 'rejected';
|
|
24
|
+
createdAt: string;
|
|
25
|
+
lastLoginAt?: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface IAMRole {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
isBuiltIn: boolean;
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
permissions?: string[];
|
|
35
|
+
permissionDetails?: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
module: string;
|
|
39
|
+
isBuiltIn: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export interface IAMPermission {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
module: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
isBuiltIn: boolean;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IAMGroup {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
userCount?: number;
|
|
56
|
+
permissions?: string[];
|
|
57
|
+
permissionDetails?: Array<{
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
module: string;
|
|
61
|
+
isBuiltIn: boolean;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export interface IAMPolicy {
|
|
65
|
+
id: string;
|
|
66
|
+
appId: string;
|
|
67
|
+
sessionTimeoutMinutes: number;
|
|
68
|
+
allowGuest: boolean;
|
|
69
|
+
allowSignUp: boolean;
|
|
70
|
+
requireSignupApproval: boolean;
|
|
71
|
+
passwordMinLength: number;
|
|
72
|
+
passwordRequireUppercase: boolean;
|
|
73
|
+
passwordRequireLowercase: boolean;
|
|
74
|
+
passwordRequireNumbers: boolean;
|
|
75
|
+
passwordRequireSpecialChars: boolean;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
}
|
|
79
|
+
export interface PaginationInfo {
|
|
80
|
+
page: number;
|
|
81
|
+
limit: number;
|
|
82
|
+
totalCount: number;
|
|
83
|
+
totalPages: number;
|
|
84
|
+
hasNext: boolean;
|
|
85
|
+
hasPrev: boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare class ApiError extends Error {
|
|
88
|
+
status: number;
|
|
89
|
+
code?: string;
|
|
90
|
+
constructor(message: string, status: number, code?: string);
|
|
91
|
+
}
|
|
92
|
+
export declare const usersApi: {
|
|
93
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined, options?: {
|
|
94
|
+
excludeGuests?: boolean | undefined;
|
|
95
|
+
page?: number | undefined;
|
|
96
|
+
limit?: number | undefined;
|
|
97
|
+
} | undefined) => Promise<{
|
|
98
|
+
users: IAMUser[];
|
|
99
|
+
pagination: PaginationInfo;
|
|
100
|
+
}>;
|
|
101
|
+
create: (appId: string, userData: Partial<IAMUser> & {
|
|
102
|
+
password: string;
|
|
103
|
+
roleIds?: string[];
|
|
104
|
+
groupIds?: string[];
|
|
105
|
+
permissionIds?: string[];
|
|
106
|
+
}, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMUser>;
|
|
107
|
+
update: (appId: string, userId: string, userData: Partial<IAMUser>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMUser>;
|
|
108
|
+
delete: (appId: string, userId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
109
|
+
updateRole: (appId: string, userId: string, roleIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
110
|
+
updateGroup: (appId: string, userId: string, groupIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
111
|
+
updatePermission: (appId: string, userId: string, permissionIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
112
|
+
resetPassword: (appId: string, userId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
113
|
+
message: string;
|
|
114
|
+
}>;
|
|
115
|
+
getLastLogins: (appId: string, userIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
116
|
+
lastLogins: Record<string, string | null>;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
export declare const rolesApi: {
|
|
120
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined, options?: {
|
|
121
|
+
page?: number | undefined;
|
|
122
|
+
limit?: number | undefined;
|
|
123
|
+
} | undefined) => Promise<{
|
|
124
|
+
roles: IAMRole[];
|
|
125
|
+
pagination: PaginationInfo;
|
|
126
|
+
}>;
|
|
127
|
+
create: (appId: string, roleData: Partial<IAMRole>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMRole>;
|
|
128
|
+
update: (appId: string, roleId: string, roleData: Partial<IAMRole>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMRole>;
|
|
129
|
+
delete: (appId: string, roleId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
130
|
+
};
|
|
131
|
+
export declare const permissionsApi: {
|
|
132
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
133
|
+
permissions: IAMPermission[];
|
|
134
|
+
}>;
|
|
135
|
+
create: (appId: string, permissionData: Partial<IAMPermission>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMPermission>;
|
|
136
|
+
};
|
|
137
|
+
export declare const groupsApi: {
|
|
138
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
139
|
+
groups: IAMGroup[];
|
|
140
|
+
}>;
|
|
141
|
+
create: (appId: string, groupData: Partial<IAMGroup>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMGroup>;
|
|
142
|
+
update: (appId: string, groupId: string, groupData: Partial<IAMGroup>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMGroup>;
|
|
143
|
+
delete: (appId: string, groupId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
144
|
+
};
|
|
145
|
+
export declare const policyApi: {
|
|
146
|
+
get: (appId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMPolicy>;
|
|
147
|
+
update: (appId: string, policyData: Partial<IAMPolicy>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMPolicy>;
|
|
148
|
+
};
|
|
149
|
+
export declare const iamApi: {
|
|
150
|
+
users: {
|
|
151
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined, options?: {
|
|
152
|
+
excludeGuests?: boolean | undefined;
|
|
153
|
+
page?: number | undefined;
|
|
154
|
+
limit?: number | undefined;
|
|
155
|
+
} | undefined) => Promise<{
|
|
156
|
+
users: IAMUser[];
|
|
157
|
+
pagination: PaginationInfo;
|
|
158
|
+
}>;
|
|
159
|
+
create: (appId: string, userData: Partial<IAMUser> & {
|
|
160
|
+
password: string;
|
|
161
|
+
roleIds?: string[];
|
|
162
|
+
groupIds?: string[];
|
|
163
|
+
permissionIds?: string[];
|
|
164
|
+
}, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMUser>;
|
|
165
|
+
update: (appId: string, userId: string, userData: Partial<IAMUser>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMUser>;
|
|
166
|
+
delete: (appId: string, userId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
167
|
+
updateRole: (appId: string, userId: string, roleIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
168
|
+
updateGroup: (appId: string, userId: string, groupIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
169
|
+
updatePermission: (appId: string, userId: string, permissionIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
170
|
+
resetPassword: (appId: string, userId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
171
|
+
message: string;
|
|
172
|
+
}>;
|
|
173
|
+
getLastLogins: (appId: string, userIds: string[], authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
174
|
+
lastLogins: Record<string, string | null>;
|
|
175
|
+
}>;
|
|
176
|
+
};
|
|
177
|
+
roles: {
|
|
178
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined, options?: {
|
|
179
|
+
page?: number | undefined;
|
|
180
|
+
limit?: number | undefined;
|
|
181
|
+
} | undefined) => Promise<{
|
|
182
|
+
roles: IAMRole[];
|
|
183
|
+
pagination: PaginationInfo;
|
|
184
|
+
}>;
|
|
185
|
+
create: (appId: string, roleData: Partial<IAMRole>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMRole>;
|
|
186
|
+
update: (appId: string, roleId: string, roleData: Partial<IAMRole>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMRole>;
|
|
187
|
+
delete: (appId: string, roleId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
188
|
+
};
|
|
189
|
+
permissions: {
|
|
190
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
191
|
+
permissions: IAMPermission[];
|
|
192
|
+
}>;
|
|
193
|
+
create: (appId: string, permissionData: Partial<IAMPermission>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMPermission>;
|
|
194
|
+
};
|
|
195
|
+
groups: {
|
|
196
|
+
getAll: (appId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<{
|
|
197
|
+
groups: IAMGroup[];
|
|
198
|
+
}>;
|
|
199
|
+
create: (appId: string, groupData: Partial<IAMGroup>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMGroup>;
|
|
200
|
+
update: (appId: string, groupId: string, groupData: Partial<IAMGroup>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMGroup>;
|
|
201
|
+
delete: (appId: string, groupId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<void>;
|
|
202
|
+
};
|
|
203
|
+
policy: {
|
|
204
|
+
get: (appId: string, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMPolicy>;
|
|
205
|
+
update: (appId: string, policyData: Partial<IAMPolicy>, authHost?: string | undefined, authToken?: string | undefined) => Promise<IAMPolicy>;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
export declare function fetchIamAuthToken(authHost?: string): Promise<string | null>;
|
|
209
|
+
export declare function fetchIamSession(authHost?: string): Promise<Record<string, any> | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@create-flow/auth-ui",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Made with create-react-library",
|
|
5
5
|
"author": "@create-flow",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,37 +11,60 @@
|
|
|
11
11
|
"main": "dist/index.js",
|
|
12
12
|
"module": "dist/index.modern.js",
|
|
13
13
|
"source": "src/index.tsx",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.modern.js",
|
|
18
|
+
"require": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./styles": {
|
|
21
|
+
"style": "./dist/index.css",
|
|
22
|
+
"default": "./dist/index.css"
|
|
23
|
+
},
|
|
24
|
+
"./dist/index.css": {
|
|
25
|
+
"style": "./dist/index.css",
|
|
26
|
+
"default": "./dist/index.css"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
14
29
|
"engines": {
|
|
15
30
|
"node": ">=10"
|
|
16
31
|
},
|
|
17
32
|
"scripts": {
|
|
18
|
-
"build": "
|
|
19
|
-
"
|
|
33
|
+
"build": "run-s build:css build:js build:use-client",
|
|
34
|
+
"build:js": "microbundle-crl --no-compress --format modern,cjs",
|
|
35
|
+
"build:use-client": "node -e \"const fs=require('fs');['dist/index.js','dist/index.modern.js'].forEach(f=>{const c=fs.readFileSync(f,'utf8');if(!c.startsWith('\\\"use client\\\"'))fs.writeFileSync(f,'\\\"use client\\\";\\n'+c)})\"",
|
|
36
|
+
"build:css": "tailwindcss -i ./src/index.css -o ./dist/index.css --minify",
|
|
37
|
+
"start": "run-p watch:css watch:js",
|
|
38
|
+
"watch:js": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
39
|
+
"watch:css": "tailwindcss -i ./src/index.css -o ./dist/index.css --watch",
|
|
20
40
|
"prepare": "run-s build",
|
|
21
|
-
"prepublishOnly": "run
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"test
|
|
26
|
-
"test:watch": "
|
|
27
|
-
"
|
|
28
|
-
"
|
|
41
|
+
"prepublishOnly": "bun run build",
|
|
42
|
+
"version:patch": "node -e \"const p=require('./package.json');const v=p.version.split('.');v[2]++;p.version=v.join('.');require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
43
|
+
"version:minor": "node -e \"const p=require('./package.json');const v=p.version.split('.');v[1]++;v[2]=0;p.version=v.join('.');require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
44
|
+
"version:major": "node -e \"const p=require('./package.json');const v=p.version.split('.');v[0]++;v[1]=0;v[2]=0;p.version=v.join('.');require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"publish:patch": "bun run version:patch && bun publish",
|
|
48
|
+
"publish:minor": "bun run version:minor && bun publish",
|
|
49
|
+
"publish:major": "bun run version:major && bun publish"
|
|
29
50
|
},
|
|
30
51
|
"peerDependencies": {
|
|
31
|
-
"
|
|
52
|
+
"next": "*",
|
|
53
|
+
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
54
|
+
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
32
55
|
},
|
|
33
56
|
"devDependencies": {
|
|
34
57
|
"@testing-library/jest-dom": "^4.2.4",
|
|
35
58
|
"@testing-library/react": "^9.5.0",
|
|
36
59
|
"@testing-library/user-event": "^7.2.1",
|
|
37
60
|
"@types/jest": "^25.1.4",
|
|
61
|
+
"@types/minimatch": "3.0.3",
|
|
38
62
|
"@types/node": "^12.12.38",
|
|
39
63
|
"@types/react": "^16.9.27",
|
|
40
64
|
"@types/react-dom": "^16.9.7",
|
|
41
|
-
"@types/minimatch": "3.0.3",
|
|
42
65
|
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
|
43
66
|
"@typescript-eslint/parser": "^2.26.0",
|
|
44
|
-
"
|
|
67
|
+
"autoprefixer": "^10.4.16",
|
|
45
68
|
"babel-eslint": "^10.0.3",
|
|
46
69
|
"cross-env": "^7.0.2",
|
|
47
70
|
"eslint": "^6.8.0",
|
|
@@ -55,14 +78,23 @@
|
|
|
55
78
|
"eslint-plugin-react": "^7.17.0",
|
|
56
79
|
"eslint-plugin-standard": "^4.0.1",
|
|
57
80
|
"gh-pages": "^2.2.0",
|
|
81
|
+
"microbundle-crl": "^0.13.10",
|
|
82
|
+
"next-auth": "5.0.0-beta.25",
|
|
58
83
|
"npm-run-all": "^4.1.5",
|
|
84
|
+
"postcss": "^8.4.31",
|
|
59
85
|
"prettier": "^2.0.4",
|
|
60
86
|
"react": "^16.13.1",
|
|
61
87
|
"react-dom": "^16.13.1",
|
|
62
88
|
"react-scripts": "^3.4.1",
|
|
63
|
-
"
|
|
89
|
+
"tailwindcss": "^3.3.5",
|
|
90
|
+
"typescript": "^3.7.5",
|
|
91
|
+
"vitest": "3"
|
|
64
92
|
},
|
|
65
93
|
"files": [
|
|
66
|
-
"dist"
|
|
67
|
-
|
|
94
|
+
"dist",
|
|
95
|
+
"src/**/*.css"
|
|
96
|
+
],
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"babel-plugin-transform-async-to-promises": "^0.8.18"
|
|
99
|
+
}
|
|
68
100
|
}
|
package/src/index.css
ADDED