@absolutejs/auth 0.0.1 → 0.0.3
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/example/components/AuthOptions.d.ts +1 -0
- package/dist/example/components/Example.d.ts +1 -0
- package/dist/example/components/Head.d.ts +6 -0
- package/dist/example/components/Modal.d.ts +8 -0
- package/dist/example/components/Navbar.d.ts +10 -0
- package/dist/example/components/NotAuthorized.d.ts +1 -0
- package/dist/example/components/Protected.d.ts +1 -0
- package/dist/example/db/migrate.d.ts +1 -0
- package/dist/example/db/schema.d.ts +248 -0
- package/dist/example/hooks/useAuthStatus.d.ts +18 -0
- package/dist/example/indexes/ExampleIndex.d.ts +1 -0
- package/dist/example/indexes/NotAuthorizedIndex.d.ts +1 -0
- package/dist/example/indexes/ProtectedIndex.d.ts +1 -0
- package/dist/example/server.d.ts +1 -0
- package/dist/example/utils/networking.d.ts +1 -0
- package/dist/example/utils/pageUtils.d.ts +2 -0
- package/dist/example/utils/styles.d.ts +15 -0
- package/dist/example/utils/userUtils.d.ts +19 -0
- package/dist/index.js +230 -222
- package/dist/{callback.d.ts → src/callback.d.ts} +2 -2
- package/dist/{index.d.ts → src/index.d.ts} +6 -6
- package/dist/{logout.d.ts → src/logout.d.ts} +1 -1
- package/dist/{protectRoute.d.ts → src/protectRoute.d.ts} +3 -3
- package/dist/{refresh.d.ts → src/refresh.d.ts} +1 -1
- package/dist/{status.d.ts → src/status.d.ts} +3 -3
- package/package.json +15 -16
- /package/dist/{authorize.d.ts → src/authorize.d.ts} +0 -0
- /package/dist/{providers.d.ts → src/providers.d.ts} +0 -0
- /package/dist/{revoke.d.ts → src/revoke.d.ts} +0 -0
- /package/dist/{sessionStore.d.ts → src/sessionStore.d.ts} +0 -0
- /package/dist/{typeGuards.d.ts → src/typeGuards.d.ts} +0 -0
- /package/dist/{types.d.ts → src/types.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AuthOptions: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Example: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { User } from '../db/schema';
|
|
3
|
+
type NavbarProps = {
|
|
4
|
+
userIdentity: User | null;
|
|
5
|
+
setUserIdentity: Dispatch<SetStateAction<User | null>>;
|
|
6
|
+
modalOpen: boolean;
|
|
7
|
+
setModalOpen: Dispatch<SetStateAction<boolean>>;
|
|
8
|
+
};
|
|
9
|
+
export declare const Navbar: ({ userIdentity, setUserIdentity, modalOpen, setModalOpen }: NavbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NotAuthorized: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Protected: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { NeonHttpDatabase } from 'drizzle-orm/neon-http';
|
|
2
|
+
export declare const users: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3
|
+
name: "users";
|
|
4
|
+
schema: undefined;
|
|
5
|
+
columns: {
|
|
6
|
+
given_name: import("drizzle-orm/pg-core").PgColumn<{
|
|
7
|
+
name: "given_name";
|
|
8
|
+
tableName: "users";
|
|
9
|
+
dataType: "string";
|
|
10
|
+
columnType: "PgVarchar";
|
|
11
|
+
data: string;
|
|
12
|
+
driverParam: string;
|
|
13
|
+
notNull: false;
|
|
14
|
+
hasDefault: false;
|
|
15
|
+
isPrimaryKey: false;
|
|
16
|
+
isAutoincrement: false;
|
|
17
|
+
hasRuntimeDefault: false;
|
|
18
|
+
enumValues: [string, ...string[]];
|
|
19
|
+
baseColumn: never;
|
|
20
|
+
identity: undefined;
|
|
21
|
+
generated: undefined;
|
|
22
|
+
}, {}, {
|
|
23
|
+
length: 255;
|
|
24
|
+
}>;
|
|
25
|
+
family_name: import("drizzle-orm/pg-core").PgColumn<{
|
|
26
|
+
name: "family_name";
|
|
27
|
+
tableName: "users";
|
|
28
|
+
dataType: "string";
|
|
29
|
+
columnType: "PgVarchar";
|
|
30
|
+
data: string;
|
|
31
|
+
driverParam: string;
|
|
32
|
+
notNull: false;
|
|
33
|
+
hasDefault: false;
|
|
34
|
+
isPrimaryKey: false;
|
|
35
|
+
isAutoincrement: false;
|
|
36
|
+
hasRuntimeDefault: false;
|
|
37
|
+
enumValues: [string, ...string[]];
|
|
38
|
+
baseColumn: never;
|
|
39
|
+
identity: undefined;
|
|
40
|
+
generated: undefined;
|
|
41
|
+
}, {}, {
|
|
42
|
+
length: 255;
|
|
43
|
+
}>;
|
|
44
|
+
email: import("drizzle-orm/pg-core").PgColumn<{
|
|
45
|
+
name: "email";
|
|
46
|
+
tableName: "users";
|
|
47
|
+
dataType: "string";
|
|
48
|
+
columnType: "PgVarchar";
|
|
49
|
+
data: string;
|
|
50
|
+
driverParam: string;
|
|
51
|
+
notNull: false;
|
|
52
|
+
hasDefault: false;
|
|
53
|
+
isPrimaryKey: false;
|
|
54
|
+
isAutoincrement: false;
|
|
55
|
+
hasRuntimeDefault: false;
|
|
56
|
+
enumValues: [string, ...string[]];
|
|
57
|
+
baseColumn: never;
|
|
58
|
+
identity: undefined;
|
|
59
|
+
generated: undefined;
|
|
60
|
+
}, {}, {
|
|
61
|
+
length: 255;
|
|
62
|
+
}>;
|
|
63
|
+
created_at: import("drizzle-orm/pg-core").PgColumn<{
|
|
64
|
+
name: "created_at";
|
|
65
|
+
tableName: "users";
|
|
66
|
+
dataType: "date";
|
|
67
|
+
columnType: "PgTimestamp";
|
|
68
|
+
data: Date;
|
|
69
|
+
driverParam: string;
|
|
70
|
+
notNull: true;
|
|
71
|
+
hasDefault: true;
|
|
72
|
+
isPrimaryKey: false;
|
|
73
|
+
isAutoincrement: false;
|
|
74
|
+
hasRuntimeDefault: false;
|
|
75
|
+
enumValues: undefined;
|
|
76
|
+
baseColumn: never;
|
|
77
|
+
identity: undefined;
|
|
78
|
+
generated: undefined;
|
|
79
|
+
}, {}, {}>;
|
|
80
|
+
auth_sub: import("drizzle-orm/pg-core").PgColumn<{
|
|
81
|
+
name: "auth_sub";
|
|
82
|
+
tableName: "users";
|
|
83
|
+
dataType: "string";
|
|
84
|
+
columnType: "PgVarchar";
|
|
85
|
+
data: string;
|
|
86
|
+
driverParam: string;
|
|
87
|
+
notNull: true;
|
|
88
|
+
hasDefault: false;
|
|
89
|
+
isPrimaryKey: true;
|
|
90
|
+
isAutoincrement: false;
|
|
91
|
+
hasRuntimeDefault: false;
|
|
92
|
+
enumValues: [string, ...string[]];
|
|
93
|
+
baseColumn: never;
|
|
94
|
+
identity: undefined;
|
|
95
|
+
generated: undefined;
|
|
96
|
+
}, {}, {
|
|
97
|
+
length: 255;
|
|
98
|
+
}>;
|
|
99
|
+
picture: import("drizzle-orm/pg-core").PgColumn<{
|
|
100
|
+
name: "picture";
|
|
101
|
+
tableName: "users";
|
|
102
|
+
dataType: "string";
|
|
103
|
+
columnType: "PgVarchar";
|
|
104
|
+
data: string;
|
|
105
|
+
driverParam: string;
|
|
106
|
+
notNull: false;
|
|
107
|
+
hasDefault: false;
|
|
108
|
+
isPrimaryKey: false;
|
|
109
|
+
isAutoincrement: false;
|
|
110
|
+
hasRuntimeDefault: false;
|
|
111
|
+
enumValues: [string, ...string[]];
|
|
112
|
+
baseColumn: never;
|
|
113
|
+
identity: undefined;
|
|
114
|
+
generated: undefined;
|
|
115
|
+
}, {}, {
|
|
116
|
+
length: 255;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
dialect: "pg";
|
|
120
|
+
}>;
|
|
121
|
+
export declare const schema: {
|
|
122
|
+
users: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
123
|
+
name: "users";
|
|
124
|
+
schema: undefined;
|
|
125
|
+
columns: {
|
|
126
|
+
given_name: import("drizzle-orm/pg-core").PgColumn<{
|
|
127
|
+
name: "given_name";
|
|
128
|
+
tableName: "users";
|
|
129
|
+
dataType: "string";
|
|
130
|
+
columnType: "PgVarchar";
|
|
131
|
+
data: string;
|
|
132
|
+
driverParam: string;
|
|
133
|
+
notNull: false;
|
|
134
|
+
hasDefault: false;
|
|
135
|
+
isPrimaryKey: false;
|
|
136
|
+
isAutoincrement: false;
|
|
137
|
+
hasRuntimeDefault: false;
|
|
138
|
+
enumValues: [string, ...string[]];
|
|
139
|
+
baseColumn: never;
|
|
140
|
+
identity: undefined;
|
|
141
|
+
generated: undefined;
|
|
142
|
+
}, {}, {
|
|
143
|
+
length: 255;
|
|
144
|
+
}>;
|
|
145
|
+
family_name: import("drizzle-orm/pg-core").PgColumn<{
|
|
146
|
+
name: "family_name";
|
|
147
|
+
tableName: "users";
|
|
148
|
+
dataType: "string";
|
|
149
|
+
columnType: "PgVarchar";
|
|
150
|
+
data: string;
|
|
151
|
+
driverParam: string;
|
|
152
|
+
notNull: false;
|
|
153
|
+
hasDefault: false;
|
|
154
|
+
isPrimaryKey: false;
|
|
155
|
+
isAutoincrement: false;
|
|
156
|
+
hasRuntimeDefault: false;
|
|
157
|
+
enumValues: [string, ...string[]];
|
|
158
|
+
baseColumn: never;
|
|
159
|
+
identity: undefined;
|
|
160
|
+
generated: undefined;
|
|
161
|
+
}, {}, {
|
|
162
|
+
length: 255;
|
|
163
|
+
}>;
|
|
164
|
+
email: import("drizzle-orm/pg-core").PgColumn<{
|
|
165
|
+
name: "email";
|
|
166
|
+
tableName: "users";
|
|
167
|
+
dataType: "string";
|
|
168
|
+
columnType: "PgVarchar";
|
|
169
|
+
data: string;
|
|
170
|
+
driverParam: string;
|
|
171
|
+
notNull: false;
|
|
172
|
+
hasDefault: false;
|
|
173
|
+
isPrimaryKey: false;
|
|
174
|
+
isAutoincrement: false;
|
|
175
|
+
hasRuntimeDefault: false;
|
|
176
|
+
enumValues: [string, ...string[]];
|
|
177
|
+
baseColumn: never;
|
|
178
|
+
identity: undefined;
|
|
179
|
+
generated: undefined;
|
|
180
|
+
}, {}, {
|
|
181
|
+
length: 255;
|
|
182
|
+
}>;
|
|
183
|
+
created_at: import("drizzle-orm/pg-core").PgColumn<{
|
|
184
|
+
name: "created_at";
|
|
185
|
+
tableName: "users";
|
|
186
|
+
dataType: "date";
|
|
187
|
+
columnType: "PgTimestamp";
|
|
188
|
+
data: Date;
|
|
189
|
+
driverParam: string;
|
|
190
|
+
notNull: true;
|
|
191
|
+
hasDefault: true;
|
|
192
|
+
isPrimaryKey: false;
|
|
193
|
+
isAutoincrement: false;
|
|
194
|
+
hasRuntimeDefault: false;
|
|
195
|
+
enumValues: undefined;
|
|
196
|
+
baseColumn: never;
|
|
197
|
+
identity: undefined;
|
|
198
|
+
generated: undefined;
|
|
199
|
+
}, {}, {}>;
|
|
200
|
+
auth_sub: import("drizzle-orm/pg-core").PgColumn<{
|
|
201
|
+
name: "auth_sub";
|
|
202
|
+
tableName: "users";
|
|
203
|
+
dataType: "string";
|
|
204
|
+
columnType: "PgVarchar";
|
|
205
|
+
data: string;
|
|
206
|
+
driverParam: string;
|
|
207
|
+
notNull: true;
|
|
208
|
+
hasDefault: false;
|
|
209
|
+
isPrimaryKey: true;
|
|
210
|
+
isAutoincrement: false;
|
|
211
|
+
hasRuntimeDefault: false;
|
|
212
|
+
enumValues: [string, ...string[]];
|
|
213
|
+
baseColumn: never;
|
|
214
|
+
identity: undefined;
|
|
215
|
+
generated: undefined;
|
|
216
|
+
}, {}, {
|
|
217
|
+
length: 255;
|
|
218
|
+
}>;
|
|
219
|
+
picture: import("drizzle-orm/pg-core").PgColumn<{
|
|
220
|
+
name: "picture";
|
|
221
|
+
tableName: "users";
|
|
222
|
+
dataType: "string";
|
|
223
|
+
columnType: "PgVarchar";
|
|
224
|
+
data: string;
|
|
225
|
+
driverParam: string;
|
|
226
|
+
notNull: false;
|
|
227
|
+
hasDefault: false;
|
|
228
|
+
isPrimaryKey: false;
|
|
229
|
+
isAutoincrement: false;
|
|
230
|
+
hasRuntimeDefault: false;
|
|
231
|
+
enumValues: [string, ...string[]];
|
|
232
|
+
baseColumn: never;
|
|
233
|
+
identity: undefined;
|
|
234
|
+
generated: undefined;
|
|
235
|
+
}, {}, {
|
|
236
|
+
length: 255;
|
|
237
|
+
}>;
|
|
238
|
+
};
|
|
239
|
+
dialect: "pg";
|
|
240
|
+
}>;
|
|
241
|
+
};
|
|
242
|
+
export type schemaType = typeof schema;
|
|
243
|
+
export type User = typeof users.$inferSelect;
|
|
244
|
+
export type NewUser = typeof users.$inferInsert;
|
|
245
|
+
export type DatabaseFunctionProps = {
|
|
246
|
+
db: NeonHttpDatabase<schemaType>;
|
|
247
|
+
schema: schemaType;
|
|
248
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const useAuthStatus: () => {
|
|
2
|
+
userIdentity: {
|
|
3
|
+
given_name: string | null;
|
|
4
|
+
family_name: string | null;
|
|
5
|
+
email: string | null;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
auth_sub: string;
|
|
8
|
+
picture: string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
setUserIdentity: import("react").Dispatch<import("react").SetStateAction<{
|
|
11
|
+
given_name: string | null;
|
|
12
|
+
family_name: string | null;
|
|
13
|
+
email: string | null;
|
|
14
|
+
created_at: Date;
|
|
15
|
+
auth_sub: string;
|
|
16
|
+
picture: string | null;
|
|
17
|
+
} | null>>;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLocalIPAddress: () => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const styleReset = "\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n font-weight: inherit;\n }\n";
|
|
3
|
+
export declare const bodyDefault: CSSProperties;
|
|
4
|
+
export declare const mainDefault: CSSProperties;
|
|
5
|
+
export declare const htmlDefault: CSSProperties;
|
|
6
|
+
type ButtonStyleProps = {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
width?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const buttonStyle: ({ backgroundColor, color, width }: ButtonStyleProps) => CSSProperties;
|
|
12
|
+
export declare const authContainerStyle: CSSProperties;
|
|
13
|
+
export declare const textButtonStyle: CSSProperties;
|
|
14
|
+
export declare const contentStyle: CSSProperties;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DatabaseFunctionProps, NewUser } from '../db/schema';
|
|
2
|
+
export declare const getDBUser: ({ authSub, db, schema }: DatabaseFunctionProps & {
|
|
3
|
+
authSub: string;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
given_name: string | null;
|
|
6
|
+
family_name: string | null;
|
|
7
|
+
email: string | null;
|
|
8
|
+
created_at: Date;
|
|
9
|
+
auth_sub: string;
|
|
10
|
+
picture: string | null;
|
|
11
|
+
} | null>;
|
|
12
|
+
export declare const createDBUser: ({ auth_sub, given_name, family_name, email, picture, db, schema }: DatabaseFunctionProps & NewUser) => Promise<{
|
|
13
|
+
given_name: string | null;
|
|
14
|
+
family_name: string | null;
|
|
15
|
+
email: string | null;
|
|
16
|
+
created_at: Date;
|
|
17
|
+
auth_sub: string;
|
|
18
|
+
picture: string | null;
|
|
19
|
+
}>;
|