@absolutejs/auth 0.65.2 → 0.65.4
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/cli/migrate.js.map +3 -3
- package/dist/index.js +36 -6
- package/dist/index.js.map +10 -9
- package/dist/linkedProviders/index.js +3 -3
- package/dist/linkedProviders/index.js.map +4 -4
- package/dist/linkedProviders/neonStores.d.ts +5 -5
- package/dist/linkedProviders/oauthAccountResolver.d.ts +2 -2
- package/dist/server.js +34 -6
- package/dist/server.js.map +10 -9
- package/dist/session/neonStore.d.ts +9 -8
- package/dist/types.d.ts +12 -5
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JsonObject } from '../types';
|
|
1
2
|
import type { AuthSessionStore, SessionUserDecoder } from './types';
|
|
2
3
|
export declare const authSessionsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3
4
|
name: "auth_sessions";
|
|
@@ -235,11 +236,11 @@ export declare const authUnregisteredSessionsTable: import("drizzle-orm/pg-core"
|
|
|
235
236
|
identity: undefined;
|
|
236
237
|
generated: undefined;
|
|
237
238
|
}>;
|
|
238
|
-
session_information_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder,
|
|
239
|
+
session_information_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, JsonObject>, {
|
|
239
240
|
name: string;
|
|
240
241
|
tableName: "auth_unregistered_sessions";
|
|
241
242
|
dataType: "object json";
|
|
242
|
-
data:
|
|
243
|
+
data: JsonObject;
|
|
243
244
|
driverParam: unknown;
|
|
244
245
|
notNull: false;
|
|
245
246
|
hasDefault: false;
|
|
@@ -265,11 +266,11 @@ export declare const authUnregisteredSessionsTable: import("drizzle-orm/pg-core"
|
|
|
265
266
|
identity: undefined;
|
|
266
267
|
generated: undefined;
|
|
267
268
|
}>;
|
|
268
|
-
user_identity_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder,
|
|
269
|
+
user_identity_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, JsonObject>, {
|
|
269
270
|
name: string;
|
|
270
271
|
tableName: "auth_unregistered_sessions";
|
|
271
272
|
dataType: "object json";
|
|
272
|
-
data:
|
|
273
|
+
data: JsonObject;
|
|
273
274
|
driverParam: unknown;
|
|
274
275
|
notNull: false;
|
|
275
276
|
hasDefault: false;
|
|
@@ -520,11 +521,11 @@ export declare const authSessionSchema: {
|
|
|
520
521
|
identity: undefined;
|
|
521
522
|
generated: undefined;
|
|
522
523
|
}>;
|
|
523
|
-
session_information_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder,
|
|
524
|
+
session_information_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, JsonObject>, {
|
|
524
525
|
name: string;
|
|
525
526
|
tableName: "auth_unregistered_sessions";
|
|
526
527
|
dataType: "object json";
|
|
527
|
-
data:
|
|
528
|
+
data: JsonObject;
|
|
528
529
|
driverParam: unknown;
|
|
529
530
|
notNull: false;
|
|
530
531
|
hasDefault: false;
|
|
@@ -550,11 +551,11 @@ export declare const authSessionSchema: {
|
|
|
550
551
|
identity: undefined;
|
|
551
552
|
generated: undefined;
|
|
552
553
|
}>;
|
|
553
|
-
user_identity_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder,
|
|
554
|
+
user_identity_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_unregistered_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, JsonObject>, {
|
|
554
555
|
name: string;
|
|
555
556
|
tableName: "auth_unregistered_sessions";
|
|
556
557
|
dataType: "object json";
|
|
557
|
-
data:
|
|
558
|
+
data: JsonObject;
|
|
558
559
|
driverParam: unknown;
|
|
559
560
|
notNull: false;
|
|
560
561
|
hasDefault: false;
|
package/dist/types.d.ts
CHANGED
|
@@ -113,8 +113,8 @@ export type SessionData<UserType> = {
|
|
|
113
113
|
};
|
|
114
114
|
export type SessionRecord<UserType> = Record<UserSessionId, SessionData<UserType>>;
|
|
115
115
|
export type UnregisteredSessionData = {
|
|
116
|
-
userIdentity?:
|
|
117
|
-
sessionInformation?:
|
|
116
|
+
userIdentity?: JsonObject;
|
|
117
|
+
sessionInformation?: JsonObject;
|
|
118
118
|
expiresAt: number;
|
|
119
119
|
accessToken?: string;
|
|
120
120
|
refreshToken?: string;
|
|
@@ -122,7 +122,7 @@ export type UnregisteredSessionData = {
|
|
|
122
122
|
};
|
|
123
123
|
export type UnregisteredSessionRecord = Record<UserSessionId, UnregisteredSessionData>;
|
|
124
124
|
export type ResolvedOAuthAuthorization = {
|
|
125
|
-
userIdentity:
|
|
125
|
+
userIdentity: JsonObject;
|
|
126
126
|
accessToken: string;
|
|
127
127
|
oauthSubject?: string | number;
|
|
128
128
|
refreshToken?: string;
|
|
@@ -130,8 +130,8 @@ export type ResolvedOAuthAuthorization = {
|
|
|
130
130
|
tokenType?: string;
|
|
131
131
|
};
|
|
132
132
|
export type StatusReturn = Pick<ElysiaCustomStatusResponse<number | keyof StatusMap, unknown>, 'code' | 'response'>;
|
|
133
|
-
export type OnNewUser<UserType> = (userIdentity:
|
|
134
|
-
export type GetUser<UserType> = (userIdentity:
|
|
133
|
+
export type OnNewUser<UserType> = (userIdentity: JsonObject) => UserType | StatusReturn | Response | Promise<UserType | StatusReturn | Response>;
|
|
134
|
+
export type GetUser<UserType> = (userIdentity: JsonObject) => UserType | StatusReturn | Response | null | undefined | Promise<UserType | StatusReturn | Response | null | undefined>;
|
|
135
135
|
export type CallbackCookie = Record<string, Cookie<unknown>> & {
|
|
136
136
|
auth_client: Cookie<string | undefined>;
|
|
137
137
|
auth_intent: Cookie<AuthIntent | undefined>;
|
|
@@ -429,3 +429,10 @@ export type InsantiateUserSessionProps<UserType> = {
|
|
|
429
429
|
sessionDurationMs?: number;
|
|
430
430
|
unregisteredSessionDurationMs?: number;
|
|
431
431
|
};
|
|
432
|
+
export type JsonPrimitive = boolean | null | number | string;
|
|
433
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
434
|
+
export type JsonObject = {
|
|
435
|
+
[key: string]: JsonValue;
|
|
436
|
+
};
|
|
437
|
+
export declare function isJsonValue(value: unknown): value is JsonValue;
|
|
438
|
+
export declare const parseJsonObject: (value: unknown) => JsonObject;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.65.
|
|
2
|
+
"version": "0.65.4",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@absolutejs/linked-providers": "0.0.
|
|
79
|
+
"@absolutejs/linked-providers": "0.0.6",
|
|
80
80
|
"@absolutejs/manifest": "^0.7.2",
|
|
81
81
|
"@neondatabase/serverless": "1.0.0",
|
|
82
82
|
"@sinclair/typebox": "^0.34.0",
|