@tapanmeena/authkit-shared 0.0.0-stage → 0.1.1
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/admin.d.ts +95 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +50 -0
- package/dist/admin.js.map +1 -0
- package/dist/auth.d.ts +154 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +127 -0
- package/dist/auth.js.map +1 -0
- package/dist/claims.d.ts +26 -0
- package/dist/claims.d.ts.map +1 -0
- package/dist/claims.js +7 -0
- package/dist/claims.js.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +34 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -3
- package/README.md +0 -3
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createPoolSchema: z.ZodObject<{
|
|
3
|
+
slug: z.ZodString;
|
|
4
|
+
displayName: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
allowSignup: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
requireEmailVerification: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
emailFromName: z.ZodOptional<z.ZodString>;
|
|
9
|
+
accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
refreshTokenTtlDays: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const updatePoolSchema: z.ZodObject<{
|
|
13
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
14
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
allowSignup: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
requireEmailVerification: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
emailFromName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
accessTokenTtlSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
|
+
refreshTokenTtlDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const createAppSchema: z.ZodObject<{
|
|
23
|
+
clientId: z.ZodString;
|
|
24
|
+
displayName: z.ZodString;
|
|
25
|
+
poolSlug: z.ZodOptional<z.ZodString>;
|
|
26
|
+
isolated: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
emailFromName: z.ZodOptional<z.ZodString>;
|
|
28
|
+
accentColor: z.ZodOptional<z.ZodString>;
|
|
29
|
+
allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
+
redirectUris: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const updateAppSchema: z.ZodObject<{
|
|
33
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
34
|
+
emailFromName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
accentColor: z.ZodOptional<z.ZodString>;
|
|
36
|
+
allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
+
redirectUris: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
38
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type CreatePoolInput = z.infer<typeof createPoolSchema>;
|
|
41
|
+
export type UpdatePoolInput = z.infer<typeof updatePoolSchema>;
|
|
42
|
+
export type CreateAppInput = z.infer<typeof createAppSchema>;
|
|
43
|
+
export type UpdateAppInput = z.infer<typeof updateAppSchema>;
|
|
44
|
+
export interface UserPoolDto {
|
|
45
|
+
id: string;
|
|
46
|
+
slug: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
description: string | null;
|
|
49
|
+
allowSignup: boolean;
|
|
50
|
+
requireEmailVerification: boolean;
|
|
51
|
+
emailFromName: string | null;
|
|
52
|
+
accessTokenTtlSeconds: number | null;
|
|
53
|
+
refreshTokenTtlDays: number | null;
|
|
54
|
+
isActive: boolean;
|
|
55
|
+
appCount?: number | undefined;
|
|
56
|
+
userCount?: number | undefined;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
updatedAt: string;
|
|
59
|
+
}
|
|
60
|
+
export interface AppClientDto {
|
|
61
|
+
id: string;
|
|
62
|
+
clientId: string;
|
|
63
|
+
poolId: string;
|
|
64
|
+
poolSlug: string;
|
|
65
|
+
displayName: string;
|
|
66
|
+
emailFromName: string | null;
|
|
67
|
+
accentColor: string;
|
|
68
|
+
allowedOrigins: string[];
|
|
69
|
+
redirectUris: string[];
|
|
70
|
+
isActive: boolean;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
}
|
|
74
|
+
export interface CreateAppResponseDto {
|
|
75
|
+
app: AppClientDto;
|
|
76
|
+
pool: UserPoolDto;
|
|
77
|
+
createdPool: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface SigningKeyDto {
|
|
80
|
+
kid: string;
|
|
81
|
+
algorithm: string;
|
|
82
|
+
status: 'active' | 'retired' | 'revoked';
|
|
83
|
+
createdAt: string;
|
|
84
|
+
retiredAt: string | null;
|
|
85
|
+
}
|
|
86
|
+
export interface AdminUserSummaryDto {
|
|
87
|
+
id: string;
|
|
88
|
+
poolSlug: string;
|
|
89
|
+
email: string;
|
|
90
|
+
name: string | null;
|
|
91
|
+
emailVerified: boolean;
|
|
92
|
+
hasPassword: boolean;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin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E,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,YAAY,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/admin.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { slugFieldSchema } from "./auth.js";
|
|
3
|
+
const hexColorSchema = z
|
|
4
|
+
.string()
|
|
5
|
+
.trim()
|
|
6
|
+
.regex(/^#[0-9a-fA-F]{6}$/, 'Color must be a 6-digit hex value like #2563eb');
|
|
7
|
+
export const createPoolSchema = z.object({
|
|
8
|
+
slug: slugFieldSchema,
|
|
9
|
+
displayName: z.string().trim().min(1).max(100),
|
|
10
|
+
description: z.string().trim().max(300).optional(),
|
|
11
|
+
allowSignup: z.boolean().optional(),
|
|
12
|
+
requireEmailVerification: z.boolean().optional(),
|
|
13
|
+
emailFromName: z.string().trim().min(1).max(100).optional(),
|
|
14
|
+
accessTokenTtlSeconds: z.number().int().min(60).max(86400).optional(),
|
|
15
|
+
refreshTokenTtlDays: z.number().int().min(1).max(365).optional(),
|
|
16
|
+
});
|
|
17
|
+
export const updatePoolSchema = z.object({
|
|
18
|
+
displayName: z.string().trim().min(1).max(100).optional(),
|
|
19
|
+
description: z.string().trim().max(300).nullable().optional(),
|
|
20
|
+
allowSignup: z.boolean().optional(),
|
|
21
|
+
requireEmailVerification: z.boolean().optional(),
|
|
22
|
+
emailFromName: z.string().trim().min(1).max(100).nullable().optional(),
|
|
23
|
+
accessTokenTtlSeconds: z.number().int().min(60).max(86400).nullable().optional(),
|
|
24
|
+
refreshTokenTtlDays: z.number().int().min(1).max(365).nullable().optional(),
|
|
25
|
+
isActive: z.boolean().optional(),
|
|
26
|
+
});
|
|
27
|
+
export const createAppSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
clientId: slugFieldSchema,
|
|
30
|
+
displayName: z.string().trim().min(1).max(100),
|
|
31
|
+
poolSlug: slugFieldSchema.optional(),
|
|
32
|
+
isolated: z.boolean().optional(),
|
|
33
|
+
emailFromName: z.string().trim().min(1).max(100).optional(),
|
|
34
|
+
accentColor: hexColorSchema.optional(),
|
|
35
|
+
allowedOrigins: z.array(z.string().trim().min(1).max(256)).max(50).optional(),
|
|
36
|
+
redirectUris: z.array(z.string().trim().min(1).max(512)).max(50).optional(),
|
|
37
|
+
})
|
|
38
|
+
.refine((data) => Boolean(data.poolSlug) !== Boolean(data.isolated), {
|
|
39
|
+
message: 'Specify either poolSlug (to join a pool) or isolated: true (to auto-create a dedicated pool)',
|
|
40
|
+
path: ['poolSlug'],
|
|
41
|
+
});
|
|
42
|
+
export const updateAppSchema = z.object({
|
|
43
|
+
displayName: z.string().trim().min(1).max(100).optional(),
|
|
44
|
+
emailFromName: z.string().trim().min(1).max(100).nullable().optional(),
|
|
45
|
+
accentColor: hexColorSchema.optional(),
|
|
46
|
+
allowedOrigins: z.array(z.string().trim().min(1).max(256)).max(50).optional(),
|
|
47
|
+
redirectUris: z.array(z.string().trim().min(1).max(512)).max(50).optional(),
|
|
48
|
+
isActive: z.boolean().optional(),
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,EAAE;KACR,IAAI,EAAE;KACN,KAAK,CAAC,mBAAmB,EAAE,gDAAgD,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC9C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAClD,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,wBAAwB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3D,qBAAq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,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACzD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACtE,WAAW,EAAE,cAAc,CAAC,QAAQ,EAAE;IACtC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC7E,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3E,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PASSWORD_MIN_LENGTH = 8;
|
|
3
|
+
export declare const PASSWORD_MAX_LENGTH = 128;
|
|
4
|
+
export declare const OTP_CODE_LENGTH = 6;
|
|
5
|
+
export declare const OTP_PURPOSES: readonly ["email_verification", "password_reset", "login_otp"];
|
|
6
|
+
export type OtpPurpose = (typeof OTP_PURPOSES)[number];
|
|
7
|
+
export declare const otpPurposeSchema: z.ZodEnum<{
|
|
8
|
+
email_verification: "email_verification";
|
|
9
|
+
password_reset: "password_reset";
|
|
10
|
+
login_otp: "login_otp";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const slugFieldSchema: z.ZodString;
|
|
13
|
+
export declare const emailFieldSchema: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
14
|
+
export declare const nameFieldSchema: z.ZodString;
|
|
15
|
+
export declare const passwordPolicySchema: z.ZodString;
|
|
16
|
+
export declare const loginPasswordSchema: z.ZodString;
|
|
17
|
+
export declare const otpCodeSchema: z.ZodString;
|
|
18
|
+
export declare const deviceNameSchema: z.ZodOptional<z.ZodString>;
|
|
19
|
+
export declare const clientIdOptionalSchema: z.ZodOptional<z.ZodString>;
|
|
20
|
+
export declare const registerSchema: z.ZodObject<{
|
|
21
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
name: z.ZodOptional<z.ZodString>;
|
|
23
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
24
|
+
password: z.ZodString;
|
|
25
|
+
deviceName: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const loginSchema: z.ZodObject<{
|
|
28
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
30
|
+
password: z.ZodString;
|
|
31
|
+
deviceName: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export declare const sendOtpSchema: z.ZodObject<{
|
|
34
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
36
|
+
purpose: z.ZodEnum<{
|
|
37
|
+
email_verification: "email_verification";
|
|
38
|
+
password_reset: "password_reset";
|
|
39
|
+
login_otp: "login_otp";
|
|
40
|
+
}>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const verifyEmailOtpSchema: z.ZodObject<{
|
|
43
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
45
|
+
code: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const loginWithOtpSchema: z.ZodObject<{
|
|
48
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
50
|
+
code: z.ZodString;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
deviceName: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const resetPasswordSchema: z.ZodObject<{
|
|
55
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
57
|
+
code: z.ZodString;
|
|
58
|
+
newPassword: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare const changePasswordSchema: z.ZodObject<{
|
|
61
|
+
currentPassword: z.ZodOptional<z.ZodString>;
|
|
62
|
+
newPassword: z.ZodString;
|
|
63
|
+
revokeOtherSessions: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export declare const updateProfileSchema: z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export declare const refreshTokenSchema: z.ZodObject<{
|
|
69
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
refreshToken: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const logoutSchema: z.ZodObject<{
|
|
73
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export declare const oauthAuthorizeQuerySchema: z.ZodObject<{
|
|
76
|
+
response_type: z.ZodLiteral<"code">;
|
|
77
|
+
client_id: z.ZodString;
|
|
78
|
+
redirect_uri: z.ZodString;
|
|
79
|
+
code_challenge: z.ZodString;
|
|
80
|
+
code_challenge_method: z.ZodLiteral<"S256">;
|
|
81
|
+
state: z.ZodOptional<z.ZodString>;
|
|
82
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
login: "login";
|
|
84
|
+
register: "register";
|
|
85
|
+
otp: "otp";
|
|
86
|
+
}>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const oauthTokenRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
89
|
+
grant_type: z.ZodLiteral<"authorization_code">;
|
|
90
|
+
client_id: z.ZodString;
|
|
91
|
+
code: z.ZodString;
|
|
92
|
+
redirect_uri: z.ZodString;
|
|
93
|
+
code_verifier: z.ZodString;
|
|
94
|
+
device_name: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
grant_type: z.ZodLiteral<"refresh_token">;
|
|
97
|
+
client_id: z.ZodString;
|
|
98
|
+
refresh_token: z.ZodString;
|
|
99
|
+
}, z.core.$strip>], "grant_type">;
|
|
100
|
+
export type RegisterInput = z.infer<typeof registerSchema>;
|
|
101
|
+
export type LoginInput = z.infer<typeof loginSchema>;
|
|
102
|
+
export type SendOtpInput = z.infer<typeof sendOtpSchema>;
|
|
103
|
+
export type VerifyEmailOtpInput = z.infer<typeof verifyEmailOtpSchema>;
|
|
104
|
+
export type LoginWithOtpInput = z.infer<typeof loginWithOtpSchema>;
|
|
105
|
+
export type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
|
|
106
|
+
export type ChangePasswordInput = z.infer<typeof changePasswordSchema>;
|
|
107
|
+
export type UpdateProfileInput = z.infer<typeof updateProfileSchema>;
|
|
108
|
+
export type RefreshTokenInput = z.infer<typeof refreshTokenSchema>;
|
|
109
|
+
export type LogoutInput = z.infer<typeof logoutSchema>;
|
|
110
|
+
export type OAuthAuthorizeQuery = z.infer<typeof oauthAuthorizeQuerySchema>;
|
|
111
|
+
export type OAuthTokenRequest = z.infer<typeof oauthTokenRequestSchema>;
|
|
112
|
+
export interface AuthUserDto {
|
|
113
|
+
id: string;
|
|
114
|
+
poolSlug: string;
|
|
115
|
+
email: string;
|
|
116
|
+
name: string | null;
|
|
117
|
+
emailVerified: boolean;
|
|
118
|
+
emailVerifiedAt: string | null;
|
|
119
|
+
hasPassword: boolean;
|
|
120
|
+
createdAt: string;
|
|
121
|
+
updatedAt: string;
|
|
122
|
+
}
|
|
123
|
+
export interface AuthTokensDto {
|
|
124
|
+
accessToken: string;
|
|
125
|
+
refreshToken: string;
|
|
126
|
+
tokenType: 'Bearer';
|
|
127
|
+
expiresIn: number;
|
|
128
|
+
}
|
|
129
|
+
export interface AuthSessionResponseDto {
|
|
130
|
+
user: AuthUserDto;
|
|
131
|
+
tokens: AuthTokensDto;
|
|
132
|
+
verificationRequired: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface AuthSessionItemDto {
|
|
135
|
+
id: string;
|
|
136
|
+
clientId: string;
|
|
137
|
+
deviceName: string | null;
|
|
138
|
+
ipAddress: string | null;
|
|
139
|
+
userAgent: string | null;
|
|
140
|
+
createdAt: string;
|
|
141
|
+
expiresAt: string;
|
|
142
|
+
current: boolean;
|
|
143
|
+
}
|
|
144
|
+
export interface MessageResponseDto {
|
|
145
|
+
message: string;
|
|
146
|
+
}
|
|
147
|
+
export interface OAuthTokenResponseDto {
|
|
148
|
+
access_token: string;
|
|
149
|
+
refresh_token: string;
|
|
150
|
+
token_type: 'Bearer';
|
|
151
|
+
expires_in: number;
|
|
152
|
+
user: AuthUserDto;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,MAA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C;IACrB,SAAS,EAAE,QAAQ,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB"}
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const PASSWORD_MIN_LENGTH = 8;
|
|
3
|
+
export const PASSWORD_MAX_LENGTH = 128;
|
|
4
|
+
export const OTP_CODE_LENGTH = 6;
|
|
5
|
+
export const OTP_PURPOSES = ['email_verification', 'password_reset', 'login_otp'];
|
|
6
|
+
export const otpPurposeSchema = z.enum(OTP_PURPOSES);
|
|
7
|
+
export const slugFieldSchema = z
|
|
8
|
+
.string()
|
|
9
|
+
.trim()
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.min(2, 'Identifier must be at least 2 characters')
|
|
12
|
+
.max(64, 'Identifier must be at most 64 characters')
|
|
13
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'Identifier must be lowercase kebab-case');
|
|
14
|
+
export const emailFieldSchema = z
|
|
15
|
+
.string()
|
|
16
|
+
.trim()
|
|
17
|
+
.max(254, 'Email must be at most 254 characters')
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.pipe(z.email('Enter a valid email address'));
|
|
20
|
+
export const nameFieldSchema = z
|
|
21
|
+
.string()
|
|
22
|
+
.trim()
|
|
23
|
+
.min(1, 'Name is required')
|
|
24
|
+
.max(100, 'Name must be at most 100 characters');
|
|
25
|
+
export const passwordPolicySchema = z
|
|
26
|
+
.string()
|
|
27
|
+
.min(PASSWORD_MIN_LENGTH, `Password must be at least ${PASSWORD_MIN_LENGTH} characters`)
|
|
28
|
+
.max(PASSWORD_MAX_LENGTH, `Password must be at most ${PASSWORD_MAX_LENGTH} characters`)
|
|
29
|
+
.refine((value) => /[a-z]/.test(value), 'Password must include at least one lowercase letter')
|
|
30
|
+
.refine((value) => /[A-Z]/.test(value), 'Password must include at least one uppercase letter')
|
|
31
|
+
.refine((value) => /[0-9]/.test(value), 'Password must include at least one number');
|
|
32
|
+
export const loginPasswordSchema = z
|
|
33
|
+
.string()
|
|
34
|
+
.min(1, 'Password is required')
|
|
35
|
+
.max(PASSWORD_MAX_LENGTH, `Password must be at most ${PASSWORD_MAX_LENGTH} characters`);
|
|
36
|
+
export const otpCodeSchema = z
|
|
37
|
+
.string()
|
|
38
|
+
.trim()
|
|
39
|
+
.regex(/^\d{6}$/, 'Enter a valid 6-digit code');
|
|
40
|
+
export const deviceNameSchema = z.string().trim().min(1).max(120).optional();
|
|
41
|
+
export const clientIdOptionalSchema = slugFieldSchema.optional();
|
|
42
|
+
export const registerSchema = z.object({
|
|
43
|
+
clientId: clientIdOptionalSchema,
|
|
44
|
+
name: nameFieldSchema.optional(),
|
|
45
|
+
email: emailFieldSchema,
|
|
46
|
+
password: passwordPolicySchema,
|
|
47
|
+
deviceName: deviceNameSchema,
|
|
48
|
+
});
|
|
49
|
+
export const loginSchema = z.object({
|
|
50
|
+
clientId: clientIdOptionalSchema,
|
|
51
|
+
email: emailFieldSchema,
|
|
52
|
+
password: loginPasswordSchema,
|
|
53
|
+
deviceName: deviceNameSchema,
|
|
54
|
+
});
|
|
55
|
+
export const sendOtpSchema = z.object({
|
|
56
|
+
clientId: clientIdOptionalSchema,
|
|
57
|
+
email: emailFieldSchema,
|
|
58
|
+
purpose: otpPurposeSchema,
|
|
59
|
+
});
|
|
60
|
+
export const verifyEmailOtpSchema = z.object({
|
|
61
|
+
clientId: clientIdOptionalSchema,
|
|
62
|
+
email: emailFieldSchema,
|
|
63
|
+
code: otpCodeSchema,
|
|
64
|
+
});
|
|
65
|
+
export const loginWithOtpSchema = z.object({
|
|
66
|
+
clientId: clientIdOptionalSchema,
|
|
67
|
+
email: emailFieldSchema,
|
|
68
|
+
code: otpCodeSchema,
|
|
69
|
+
name: nameFieldSchema.optional(),
|
|
70
|
+
deviceName: deviceNameSchema,
|
|
71
|
+
});
|
|
72
|
+
export const resetPasswordSchema = z.object({
|
|
73
|
+
clientId: clientIdOptionalSchema,
|
|
74
|
+
email: emailFieldSchema,
|
|
75
|
+
code: otpCodeSchema,
|
|
76
|
+
newPassword: passwordPolicySchema,
|
|
77
|
+
});
|
|
78
|
+
export const changePasswordSchema = z.object({
|
|
79
|
+
currentPassword: loginPasswordSchema.optional(),
|
|
80
|
+
newPassword: passwordPolicySchema,
|
|
81
|
+
revokeOtherSessions: z.boolean().optional(),
|
|
82
|
+
});
|
|
83
|
+
export const updateProfileSchema = z.object({
|
|
84
|
+
name: nameFieldSchema,
|
|
85
|
+
});
|
|
86
|
+
export const refreshTokenSchema = z.object({
|
|
87
|
+
clientId: clientIdOptionalSchema,
|
|
88
|
+
refreshToken: z.string().min(1, 'Refresh token is required'),
|
|
89
|
+
});
|
|
90
|
+
export const logoutSchema = z.object({
|
|
91
|
+
refreshToken: z.string().min(1).optional(),
|
|
92
|
+
});
|
|
93
|
+
export const oauthAuthorizeQuerySchema = z.object({
|
|
94
|
+
response_type: z.literal('code'),
|
|
95
|
+
client_id: slugFieldSchema,
|
|
96
|
+
redirect_uri: z.string().trim().min(1).max(512),
|
|
97
|
+
code_challenge: z
|
|
98
|
+
.string()
|
|
99
|
+
.trim()
|
|
100
|
+
.min(43)
|
|
101
|
+
.max(128)
|
|
102
|
+
.regex(/^[A-Za-z0-9_-]+$/, 'Invalid PKCE code_challenge'),
|
|
103
|
+
code_challenge_method: z.literal('S256'),
|
|
104
|
+
state: z.string().trim().max(256).optional(),
|
|
105
|
+
mode: z.enum(['login', 'register', 'otp']).optional(),
|
|
106
|
+
});
|
|
107
|
+
export const oauthTokenRequestSchema = z.discriminatedUnion('grant_type', [
|
|
108
|
+
z.object({
|
|
109
|
+
grant_type: z.literal('authorization_code'),
|
|
110
|
+
client_id: slugFieldSchema,
|
|
111
|
+
code: z.string().trim().min(1),
|
|
112
|
+
redirect_uri: z.string().trim().min(1).max(512),
|
|
113
|
+
code_verifier: z
|
|
114
|
+
.string()
|
|
115
|
+
.trim()
|
|
116
|
+
.min(43)
|
|
117
|
+
.max(128)
|
|
118
|
+
.regex(/^[A-Za-z0-9_-]+$/, 'Invalid PKCE code_verifier'),
|
|
119
|
+
device_name: deviceNameSchema,
|
|
120
|
+
}),
|
|
121
|
+
z.object({
|
|
122
|
+
grant_type: z.literal('refresh_token'),
|
|
123
|
+
client_id: slugFieldSchema,
|
|
124
|
+
refresh_token: z.string().trim().min(1),
|
|
125
|
+
}),
|
|
126
|
+
]);
|
|
127
|
+
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC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AAG,CAAC,EAAE,CAAC;aACP,GAAG,CAAC,GAAG,CAAC;aACR,KAAK,CAAC,kBAAkB,EAAE,4BAA4B,CAAC;QAC1D,WAAW,EAAE,gBAAgB;KAC9B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;QACtC,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KACxC,CAAC;CACH,CAAC,CAAC"}
|
package/dist/claims.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare function poolAudience(poolSlug: string): string;
|
|
2
|
+
export declare function appAudience(clientId: string): string;
|
|
3
|
+
export interface AuthKitJwtClaims {
|
|
4
|
+
iss: string;
|
|
5
|
+
sub: string;
|
|
6
|
+
aud: string[];
|
|
7
|
+
pool: string;
|
|
8
|
+
azp: string;
|
|
9
|
+
sid: string;
|
|
10
|
+
email: string;
|
|
11
|
+
email_verified: boolean;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
iat: number;
|
|
14
|
+
exp: number;
|
|
15
|
+
}
|
|
16
|
+
export interface VerifiedAuthUser {
|
|
17
|
+
userId: string;
|
|
18
|
+
email: string;
|
|
19
|
+
emailVerified: boolean;
|
|
20
|
+
name?: string | undefined;
|
|
21
|
+
pool: string;
|
|
22
|
+
clientId: string;
|
|
23
|
+
sessionId: string;
|
|
24
|
+
claims: AuthKitJwtClaims;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;CAC1B"}
|
package/dist/claims.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,QAAQ,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,OAAO,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const AUTH_ERROR_CODES: {
|
|
2
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
3
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
4
|
+
readonly FORBIDDEN: "FORBIDDEN";
|
|
5
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
6
|
+
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
7
|
+
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
8
|
+
readonly POOL_NOT_FOUND: "POOL_NOT_FOUND";
|
|
9
|
+
readonly POOL_ALREADY_EXISTS: "POOL_ALREADY_EXISTS";
|
|
10
|
+
readonly POOL_INACTIVE: "POOL_INACTIVE";
|
|
11
|
+
readonly SIGNUP_DISABLED: "SIGNUP_DISABLED";
|
|
12
|
+
readonly APP_NOT_FOUND: "APP_NOT_FOUND";
|
|
13
|
+
readonly APP_ALREADY_EXISTS: "APP_ALREADY_EXISTS";
|
|
14
|
+
readonly APP_INACTIVE: "APP_INACTIVE";
|
|
15
|
+
readonly INVALID_CLIENT: "INVALID_CLIENT";
|
|
16
|
+
readonly INVALID_REDIRECT_URI: "INVALID_REDIRECT_URI";
|
|
17
|
+
readonly INVALID_GRANT: "INVALID_GRANT";
|
|
18
|
+
readonly INVALID_PKCE: "INVALID_PKCE";
|
|
19
|
+
readonly EMAIL_ALREADY_IN_USE: "EMAIL_ALREADY_IN_USE";
|
|
20
|
+
readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
|
|
21
|
+
readonly PASSWORD_NOT_SET: "PASSWORD_NOT_SET";
|
|
22
|
+
readonly EMAIL_NOT_VERIFIED: "EMAIL_NOT_VERIFIED";
|
|
23
|
+
readonly OTP_INVALID_OR_EXPIRED: "OTP_INVALID_OR_EXPIRED";
|
|
24
|
+
readonly OTP_MAX_ATTEMPTS_EXCEEDED: "OTP_MAX_ATTEMPTS_EXCEEDED";
|
|
25
|
+
readonly OTP_COOLDOWN_ACTIVE: "OTP_COOLDOWN_ACTIVE";
|
|
26
|
+
readonly REFRESH_TOKEN_INVALID: "REFRESH_TOKEN_INVALID";
|
|
27
|
+
readonly REFRESH_TOKEN_EXPIRED: "REFRESH_TOKEN_EXPIRED";
|
|
28
|
+
readonly REFRESH_TOKEN_REUSED: "REFRESH_TOKEN_REUSED";
|
|
29
|
+
readonly TOKEN_INVALID: "TOKEN_INVALID";
|
|
30
|
+
readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
|
|
31
|
+
readonly POOL_MISMATCH: "POOL_MISMATCH";
|
|
32
|
+
readonly APP_MISMATCH: "APP_MISMATCH";
|
|
33
|
+
};
|
|
34
|
+
export type AuthErrorCode = (typeof AUTH_ERROR_CODES)[keyof typeof AUTH_ERROR_CODES];
|
|
35
|
+
export interface ApiErrorResponseDto {
|
|
36
|
+
error: {
|
|
37
|
+
code: AuthErrorCode;
|
|
38
|
+
message: string;
|
|
39
|
+
details?: Record<string, string[]> | undefined;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAErF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE;QACL,IAAI,EAAE,aAAa,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;KAChD,CAAC;CACH"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const AUTH_ERROR_CODES = {
|
|
2
|
+
VALIDATION_ERROR: 'VALIDATION_ERROR',
|
|
3
|
+
UNAUTHORIZED: 'UNAUTHORIZED',
|
|
4
|
+
FORBIDDEN: 'FORBIDDEN',
|
|
5
|
+
NOT_FOUND: 'NOT_FOUND',
|
|
6
|
+
RATE_LIMITED: 'RATE_LIMITED',
|
|
7
|
+
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
8
|
+
POOL_NOT_FOUND: 'POOL_NOT_FOUND',
|
|
9
|
+
POOL_ALREADY_EXISTS: 'POOL_ALREADY_EXISTS',
|
|
10
|
+
POOL_INACTIVE: 'POOL_INACTIVE',
|
|
11
|
+
SIGNUP_DISABLED: 'SIGNUP_DISABLED',
|
|
12
|
+
APP_NOT_FOUND: 'APP_NOT_FOUND',
|
|
13
|
+
APP_ALREADY_EXISTS: 'APP_ALREADY_EXISTS',
|
|
14
|
+
APP_INACTIVE: 'APP_INACTIVE',
|
|
15
|
+
INVALID_CLIENT: 'INVALID_CLIENT',
|
|
16
|
+
INVALID_REDIRECT_URI: 'INVALID_REDIRECT_URI',
|
|
17
|
+
INVALID_GRANT: 'INVALID_GRANT',
|
|
18
|
+
INVALID_PKCE: 'INVALID_PKCE',
|
|
19
|
+
EMAIL_ALREADY_IN_USE: 'EMAIL_ALREADY_IN_USE',
|
|
20
|
+
INVALID_CREDENTIALS: 'INVALID_CREDENTIALS',
|
|
21
|
+
PASSWORD_NOT_SET: 'PASSWORD_NOT_SET',
|
|
22
|
+
EMAIL_NOT_VERIFIED: 'EMAIL_NOT_VERIFIED',
|
|
23
|
+
OTP_INVALID_OR_EXPIRED: 'OTP_INVALID_OR_EXPIRED',
|
|
24
|
+
OTP_MAX_ATTEMPTS_EXCEEDED: 'OTP_MAX_ATTEMPTS_EXCEEDED',
|
|
25
|
+
OTP_COOLDOWN_ACTIVE: 'OTP_COOLDOWN_ACTIVE',
|
|
26
|
+
REFRESH_TOKEN_INVALID: 'REFRESH_TOKEN_INVALID',
|
|
27
|
+
REFRESH_TOKEN_EXPIRED: 'REFRESH_TOKEN_EXPIRED',
|
|
28
|
+
REFRESH_TOKEN_REUSED: 'REFRESH_TOKEN_REUSED',
|
|
29
|
+
TOKEN_INVALID: 'TOKEN_INVALID',
|
|
30
|
+
TOKEN_EXPIRED: 'TOKEN_EXPIRED',
|
|
31
|
+
POOL_MISMATCH: 'POOL_MISMATCH',
|
|
32
|
+
APP_MISMATCH: 'APP_MISMATCH',
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAEhC,cAAc,EAAE,gBAAgB;IAChC,mBAAmB,EAAE,qBAAqB;IAC1C,aAAa,EAAE,eAAe;IAC9B,eAAe,EAAE,iBAAiB;IAElC,aAAa,EAAE,eAAe;IAC9B,kBAAkB,EAAE,oBAAoB;IACxC,YAAY,EAAE,cAAc;IAE5B,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAE5B,oBAAoB,EAAE,sBAAsB;IAC5C,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;IAExC,sBAAsB,EAAE,wBAAwB;IAChD,yBAAyB,EAAE,2BAA2B;IACtD,mBAAmB,EAAE,qBAAqB;IAE1C,qBAAqB,EAAE,uBAAuB;IAC9C,qBAAqB,EAAE,uBAAuB;IAC9C,oBAAoB,EAAE,sBAAsB;IAE5C,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;CACpB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapanmeena/authkit-shared",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Shared Zod schemas, DTOs, JWT claim types, and error codes for AuthKit",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Tapan Meena",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/tapanmeena/AuthKit.git",
|
|
14
|
+
"directory": "packages/shared"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"zod": "4.6.7"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^9.39.5",
|
|
36
|
+
"eslint": "^9.0.0",
|
|
37
|
+
"eslint-config-prettier": "10.1.8",
|
|
38
|
+
"typescript": "~6.0.3",
|
|
39
|
+
"typescript-eslint": "^8.72.2"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"lint": "eslint .",
|
|
45
|
+
"lint:fix": "eslint . --fix"
|
|
46
|
+
}
|
|
6
47
|
}
|
package/README.md
DELETED