@service_laboratory/auth 2.0.4 → 2.0.6
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 +3 -0
- package/package.json +3 -9
- package/dist/index.css +0 -1
- package/dist/index.d.ts +0 -94
- package/dist/index.js +0 -4891
- package/dist/index.umd.cjs +0 -109
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@service_laboratory/auth",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -17,18 +17,12 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"import": "./dist/index.js",
|
|
19
19
|
"require": "./dist/index.umd.cjs"
|
|
20
|
-
},
|
|
21
|
-
"./index.css": {
|
|
22
|
-
"import": "./dist/index.css",
|
|
23
|
-
"require": "./dist/index.css"
|
|
24
20
|
}
|
|
25
21
|
},
|
|
26
22
|
"dependencies": {
|
|
27
|
-
"@service_laboratory/ui": "1.0.
|
|
28
|
-
"@tailwindcss/vite": "^4.1.13",
|
|
23
|
+
"@service_laboratory/ui": "1.0.2",
|
|
29
24
|
"axios": "^1.11.0",
|
|
30
|
-
"lucide-react": "^0.544.0"
|
|
31
|
-
"tailwindcss": "^4.1.13"
|
|
25
|
+
"lucide-react": "^0.544.0"
|
|
32
26
|
},
|
|
33
27
|
"peerDependencies": {
|
|
34
28
|
"@tanstack/store": "^0.7.4",
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-gray-500:oklch(55.1% .027 264.364);--spacing:.25rem;--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.top-1\/2{top:50%}.right-3{right:calc(var(--spacing)*3)}.z-10{z-index:10}.flex{display:flex}.grid{display:grid}.w-full{width:100%}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.gap-2{gap:calc(var(--spacing)*2)}.gap-6{gap:calc(var(--spacing)*6)}.pr-10{padding-right:calc(var(--spacing)*10)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-gray-500{color:var(--color-gray-500)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}
|
package/dist/index.d.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Axios } from 'axios';
|
|
2
|
-
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { Derived } from '@tanstack/store';
|
|
4
|
-
import { JSX } from 'react/jsx-runtime';
|
|
5
|
-
import { ReactNode } from 'react';
|
|
6
|
-
import { Store } from '@tanstack/store';
|
|
7
|
-
|
|
8
|
-
declare interface AccountData {
|
|
9
|
-
user: AccountUser;
|
|
10
|
-
isLoaded: boolean;
|
|
11
|
-
isAuthenticated: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export declare interface AccountUser {
|
|
15
|
-
id: string | null;
|
|
16
|
-
email: string | null;
|
|
17
|
-
roles: Role[];
|
|
18
|
-
is_enabled: boolean;
|
|
19
|
-
is_active: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
declare interface ActivateRequest {
|
|
23
|
-
code: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export declare class Auth {
|
|
27
|
-
accountStore: Store<AccountData, (cb: AccountData) => AccountData>;
|
|
28
|
-
httpClient: Axios;
|
|
29
|
-
constructor(httpClient: Axios);
|
|
30
|
-
initAuthData(): void;
|
|
31
|
-
load(): Promise<void>;
|
|
32
|
-
login(values: LoginRequest): Promise<any>;
|
|
33
|
-
register(values: RegisterRequest): Promise<AxiosResponse<any, any>>;
|
|
34
|
-
activate(values: ActivateRequest): Promise<void>;
|
|
35
|
-
logout(): void;
|
|
36
|
-
startResetPassword(values: StartResetPasswordRequest): Promise<AxiosResponse<any, any>>;
|
|
37
|
-
resetPassword(values: ResetPasswordRequest): Promise<void>;
|
|
38
|
-
_initUserData({ user, access_token }: {
|
|
39
|
-
user: AccountUser;
|
|
40
|
-
access_token: string;
|
|
41
|
-
}): void;
|
|
42
|
-
_setAuthData(token: string): void;
|
|
43
|
-
_clearAuthData(): void;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export declare const isAdmin: Derived<boolean, readonly [Store<AccountData, (cb: AccountData) => AccountData>]>;
|
|
47
|
-
|
|
48
|
-
export declare function LoginForm(props: LoginFormProps): JSX.Element;
|
|
49
|
-
|
|
50
|
-
declare interface LoginFormProps {
|
|
51
|
-
submit: ({ email, password }: {
|
|
52
|
-
email: string;
|
|
53
|
-
password: string;
|
|
54
|
-
}) => void;
|
|
55
|
-
loginFormTitle: string;
|
|
56
|
-
loginFormDescription: string;
|
|
57
|
-
emailLabel: string;
|
|
58
|
-
passwordLabel: string;
|
|
59
|
-
forgotPasswordMessage: string;
|
|
60
|
-
submitButtonLabel: string;
|
|
61
|
-
form: any;
|
|
62
|
-
resetPasswordLinkComponent?: () => ReactNode;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
declare interface LoginRequest {
|
|
66
|
-
email: string;
|
|
67
|
-
password: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
declare interface Permission {
|
|
71
|
-
name: string;
|
|
72
|
-
app: string;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare interface RegisterRequest {
|
|
76
|
-
email: string;
|
|
77
|
-
password: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
declare interface ResetPasswordRequest {
|
|
81
|
-
code: string;
|
|
82
|
-
password: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
declare interface Role {
|
|
86
|
-
name: string;
|
|
87
|
-
permissions: Permission[];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
declare interface StartResetPasswordRequest {
|
|
91
|
-
email: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export { }
|