@absolutejs/auth 0.0.1 → 0.0.2

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.
Files changed (32) hide show
  1. package/dist/example/components/AuthOptions.d.ts +1 -0
  2. package/dist/example/components/Example.d.ts +1 -0
  3. package/dist/example/components/Head.d.ts +6 -0
  4. package/dist/example/components/Modal.d.ts +8 -0
  5. package/dist/example/components/Navbar.d.ts +10 -0
  6. package/dist/example/components/NotAuthorized.d.ts +1 -0
  7. package/dist/example/components/Protected.d.ts +1 -0
  8. package/dist/example/db/migrate.d.ts +1 -0
  9. package/dist/example/db/schema.d.ts +216 -0
  10. package/dist/example/hooks/useAuthStatus.d.ts +18 -0
  11. package/dist/example/indexes/ExampleIndex.d.ts +1 -0
  12. package/dist/example/indexes/NotAuthorizedIndex.d.ts +1 -0
  13. package/dist/example/indexes/ProtectedIndex.d.ts +1 -0
  14. package/dist/example/server.d.ts +1 -0
  15. package/dist/example/utils/networking.d.ts +1 -0
  16. package/dist/example/utils/pageUtils.d.ts +2 -0
  17. package/dist/example/utils/styles.d.ts +15 -0
  18. package/dist/example/utils/userUtils.d.ts +19 -0
  19. package/dist/index.js +208 -207
  20. package/dist/{callback.d.ts → src/callback.d.ts} +1 -1
  21. package/dist/{index.d.ts → src/index.d.ts} +5 -5
  22. package/dist/{logout.d.ts → src/logout.d.ts} +1 -1
  23. package/dist/{protectRoute.d.ts → src/protectRoute.d.ts} +2 -2
  24. package/dist/{refresh.d.ts → src/refresh.d.ts} +1 -1
  25. package/dist/{status.d.ts → src/status.d.ts} +2 -2
  26. package/package.json +14 -15
  27. /package/dist/{authorize.d.ts → src/authorize.d.ts} +0 -0
  28. /package/dist/{providers.d.ts → src/providers.d.ts} +0 -0
  29. /package/dist/{revoke.d.ts → src/revoke.d.ts} +0 -0
  30. /package/dist/{sessionStore.d.ts → src/sessionStore.d.ts} +0 -0
  31. /package/dist/{typeGuards.d.ts → src/typeGuards.d.ts} +0 -0
  32. /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,6 @@
1
+ type HeadProps = {
2
+ title?: string;
3
+ icon?: string;
4
+ };
5
+ export declare const Head: ({ title, icon }: HeadProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ type ModalProps = {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ children: ReactNode;
6
+ };
7
+ export declare const Modal: ({ isOpen, onClose, children }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -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,216 @@
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
+ generated: undefined;
21
+ }, {}, {}>;
22
+ family_name: import("drizzle-orm/pg-core").PgColumn<{
23
+ name: "family_name";
24
+ tableName: "users";
25
+ dataType: "string";
26
+ columnType: "PgVarchar";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: false;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: [string, ...string[]];
35
+ baseColumn: never;
36
+ generated: undefined;
37
+ }, {}, {}>;
38
+ email: import("drizzle-orm/pg-core").PgColumn<{
39
+ name: "email";
40
+ tableName: "users";
41
+ dataType: "string";
42
+ columnType: "PgVarchar";
43
+ data: string;
44
+ driverParam: string;
45
+ notNull: false;
46
+ hasDefault: false;
47
+ isPrimaryKey: false;
48
+ isAutoincrement: false;
49
+ hasRuntimeDefault: false;
50
+ enumValues: [string, ...string[]];
51
+ baseColumn: never;
52
+ generated: undefined;
53
+ }, {}, {}>;
54
+ created_at: import("drizzle-orm/pg-core").PgColumn<{
55
+ name: "created_at";
56
+ tableName: "users";
57
+ dataType: "date";
58
+ columnType: "PgTimestamp";
59
+ data: Date;
60
+ driverParam: string;
61
+ notNull: true;
62
+ hasDefault: true;
63
+ isPrimaryKey: false;
64
+ isAutoincrement: false;
65
+ hasRuntimeDefault: false;
66
+ enumValues: undefined;
67
+ baseColumn: never;
68
+ generated: undefined;
69
+ }, {}, {}>;
70
+ auth_sub: import("drizzle-orm/pg-core").PgColumn<{
71
+ name: "auth_sub";
72
+ tableName: "users";
73
+ dataType: "string";
74
+ columnType: "PgVarchar";
75
+ data: string;
76
+ driverParam: string;
77
+ notNull: true;
78
+ hasDefault: false;
79
+ isPrimaryKey: true;
80
+ isAutoincrement: false;
81
+ hasRuntimeDefault: false;
82
+ enumValues: [string, ...string[]];
83
+ baseColumn: never;
84
+ generated: undefined;
85
+ }, {}, {}>;
86
+ picture: import("drizzle-orm/pg-core").PgColumn<{
87
+ name: "picture";
88
+ tableName: "users";
89
+ dataType: "string";
90
+ columnType: "PgVarchar";
91
+ data: string;
92
+ driverParam: string;
93
+ notNull: false;
94
+ hasDefault: false;
95
+ isPrimaryKey: false;
96
+ isAutoincrement: false;
97
+ hasRuntimeDefault: false;
98
+ enumValues: [string, ...string[]];
99
+ baseColumn: never;
100
+ generated: undefined;
101
+ }, {}, {}>;
102
+ };
103
+ dialect: "pg";
104
+ }>;
105
+ export declare const schema: {
106
+ users: import("drizzle-orm/pg-core").PgTableWithColumns<{
107
+ name: "users";
108
+ schema: undefined;
109
+ columns: {
110
+ given_name: import("drizzle-orm/pg-core").PgColumn<{
111
+ name: "given_name";
112
+ tableName: "users";
113
+ dataType: "string";
114
+ columnType: "PgVarchar";
115
+ data: string;
116
+ driverParam: string;
117
+ notNull: false;
118
+ hasDefault: false;
119
+ isPrimaryKey: false;
120
+ isAutoincrement: false;
121
+ hasRuntimeDefault: false;
122
+ enumValues: [string, ...string[]];
123
+ baseColumn: never;
124
+ generated: undefined;
125
+ }, {}, {}>;
126
+ family_name: import("drizzle-orm/pg-core").PgColumn<{
127
+ name: "family_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
+ generated: undefined;
141
+ }, {}, {}>;
142
+ email: import("drizzle-orm/pg-core").PgColumn<{
143
+ name: "email";
144
+ tableName: "users";
145
+ dataType: "string";
146
+ columnType: "PgVarchar";
147
+ data: string;
148
+ driverParam: string;
149
+ notNull: false;
150
+ hasDefault: false;
151
+ isPrimaryKey: false;
152
+ isAutoincrement: false;
153
+ hasRuntimeDefault: false;
154
+ enumValues: [string, ...string[]];
155
+ baseColumn: never;
156
+ generated: undefined;
157
+ }, {}, {}>;
158
+ created_at: import("drizzle-orm/pg-core").PgColumn<{
159
+ name: "created_at";
160
+ tableName: "users";
161
+ dataType: "date";
162
+ columnType: "PgTimestamp";
163
+ data: Date;
164
+ driverParam: string;
165
+ notNull: true;
166
+ hasDefault: true;
167
+ isPrimaryKey: false;
168
+ isAutoincrement: false;
169
+ hasRuntimeDefault: false;
170
+ enumValues: undefined;
171
+ baseColumn: never;
172
+ generated: undefined;
173
+ }, {}, {}>;
174
+ auth_sub: import("drizzle-orm/pg-core").PgColumn<{
175
+ name: "auth_sub";
176
+ tableName: "users";
177
+ dataType: "string";
178
+ columnType: "PgVarchar";
179
+ data: string;
180
+ driverParam: string;
181
+ notNull: true;
182
+ hasDefault: false;
183
+ isPrimaryKey: true;
184
+ isAutoincrement: false;
185
+ hasRuntimeDefault: false;
186
+ enumValues: [string, ...string[]];
187
+ baseColumn: never;
188
+ generated: undefined;
189
+ }, {}, {}>;
190
+ picture: import("drizzle-orm/pg-core").PgColumn<{
191
+ name: "picture";
192
+ tableName: "users";
193
+ dataType: "string";
194
+ columnType: "PgVarchar";
195
+ data: string;
196
+ driverParam: string;
197
+ notNull: false;
198
+ hasDefault: false;
199
+ isPrimaryKey: false;
200
+ isAutoincrement: false;
201
+ hasRuntimeDefault: false;
202
+ enumValues: [string, ...string[]];
203
+ baseColumn: never;
204
+ generated: undefined;
205
+ }, {}, {}>;
206
+ };
207
+ dialect: "pg";
208
+ }>;
209
+ };
210
+ export type schemaType = typeof schema;
211
+ export type User = typeof users.$inferSelect;
212
+ export type NewUser = typeof users.$inferInsert;
213
+ export type DatabaseFunctionProps = {
214
+ db: NeonHttpDatabase<schemaType>;
215
+ schema: schemaType;
216
+ };
@@ -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,2 @@
1
+ import type { ComponentType } from 'react';
2
+ export declare const handlePageRequest: (pageComponent: ComponentType, index: string) => Promise<Response>;
@@ -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
+ }>;