@warlock.js/auth 4.0.161 → 4.0.163

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 (83) hide show
  1. package/esm/commands/auth-cleanup-command.d.ts +10 -0
  2. package/esm/commands/auth-cleanup-command.d.ts.map +1 -0
  3. package/esm/commands/auth-cleanup-command.js +29 -0
  4. package/esm/commands/auth-cleanup-command.js.map +1 -0
  5. package/esm/commands/jwt-secret-generator-command.d.ts +2 -0
  6. package/esm/commands/jwt-secret-generator-command.d.ts.map +1 -0
  7. package/esm/commands/jwt-secret-generator-command.js +7 -0
  8. package/esm/commands/jwt-secret-generator-command.js.map +1 -0
  9. package/esm/contracts/auth-contract.d.ts +23 -0
  10. package/esm/contracts/auth-contract.d.ts.map +1 -0
  11. package/esm/contracts/index.d.ts +3 -0
  12. package/esm/contracts/index.d.ts.map +1 -0
  13. package/esm/contracts/types.d.ts +167 -0
  14. package/esm/contracts/types.d.ts.map +1 -0
  15. package/esm/contracts/types.js +20 -0
  16. package/esm/contracts/types.js.map +1 -0
  17. package/esm/index.d.ts +8 -0
  18. package/esm/index.d.ts.map +1 -0
  19. package/esm/index.js +1 -0
  20. package/esm/index.js.map +1 -0
  21. package/esm/middleware/auth.middleware.d.ts +2 -0
  22. package/esm/middleware/auth.middleware.d.ts.map +1 -0
  23. package/esm/middleware/auth.middleware.js +72 -0
  24. package/esm/middleware/auth.middleware.js.map +1 -0
  25. package/esm/middleware/index.d.ts +2 -0
  26. package/esm/middleware/index.d.ts.map +1 -0
  27. package/esm/models/access-token/access-token.model.d.ts +9 -0
  28. package/esm/models/access-token/access-token.model.d.ts.map +1 -0
  29. package/esm/models/access-token/access-token.model.js +14 -0
  30. package/esm/models/access-token/access-token.model.js.map +1 -0
  31. package/esm/models/access-token/index.d.ts +2 -0
  32. package/esm/models/access-token/index.d.ts.map +1 -0
  33. package/esm/models/access-token/migration.d.ts +2 -0
  34. package/esm/models/access-token/migration.d.ts.map +1 -0
  35. package/esm/models/access-token/migration.js +22 -0
  36. package/esm/models/access-token/migration.js.map +1 -0
  37. package/esm/models/auth.model.d.ts +58 -0
  38. package/esm/models/auth.model.d.ts.map +1 -0
  39. package/esm/models/auth.model.js +68 -0
  40. package/esm/models/auth.model.js.map +1 -0
  41. package/esm/models/index.d.ts +5 -0
  42. package/esm/models/index.d.ts.map +1 -0
  43. package/esm/models/index.js +1 -0
  44. package/esm/models/index.js.map +1 -0
  45. package/esm/models/refresh-token/index.d.ts +2 -0
  46. package/esm/models/refresh-token/index.d.ts.map +1 -0
  47. package/esm/models/refresh-token/migration.d.ts +2 -0
  48. package/esm/models/refresh-token/migration.d.ts.map +1 -0
  49. package/esm/models/refresh-token/migration.js +23 -0
  50. package/esm/models/refresh-token/migration.js.map +1 -0
  51. package/esm/models/refresh-token/refresh-token.model.d.ts +32 -0
  52. package/esm/models/refresh-token/refresh-token.model.d.ts.map +1 -0
  53. package/esm/models/refresh-token/refresh-token.model.js +53 -0
  54. package/esm/models/refresh-token/refresh-token.model.js.map +1 -0
  55. package/esm/services/auth-events.d.ts +85 -0
  56. package/esm/services/auth-events.d.ts.map +1 -0
  57. package/esm/services/auth-events.js +65 -0
  58. package/esm/services/auth-events.js.map +1 -0
  59. package/esm/services/auth.service.d.ts +92 -0
  60. package/esm/services/auth.service.d.ts.map +1 -0
  61. package/esm/services/auth.service.js +322 -0
  62. package/esm/services/auth.service.js.map +1 -0
  63. package/esm/services/generate-jwt-secret.d.ts +2 -0
  64. package/esm/services/generate-jwt-secret.d.ts.map +1 -0
  65. package/esm/services/generate-jwt-secret.js +47 -0
  66. package/esm/services/generate-jwt-secret.js.map +1 -0
  67. package/esm/services/index.d.ts +5 -0
  68. package/esm/services/index.d.ts.map +1 -0
  69. package/esm/services/jwt.d.ts +23 -0
  70. package/esm/services/jwt.d.ts.map +1 -0
  71. package/esm/services/jwt.js +40 -0
  72. package/esm/services/jwt.js.map +1 -0
  73. package/esm/utils/auth-error-codes.d.ts +18 -0
  74. package/esm/utils/auth-error-codes.d.ts.map +1 -0
  75. package/esm/utils/auth-error-codes.js +18 -0
  76. package/esm/utils/auth-error-codes.js.map +1 -0
  77. package/esm/utils/duration.d.ts +45 -0
  78. package/esm/utils/duration.d.ts.map +1 -0
  79. package/esm/utils/duration.js +93 -0
  80. package/esm/utils/duration.js.map +1 -0
  81. package/esm/utils/index.d.ts +3 -0
  82. package/esm/utils/index.d.ts.map +1 -0
  83. package/package.json +5 -5
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Register the auth:cleanup CLI command
3
+ *
4
+ * @example
5
+ * ```bash
6
+ * warlock auth:cleanup
7
+ * ```
8
+ */
9
+ export declare function registerAuthCleanupCommand(): any;
10
+ //# sourceMappingURL=auth-cleanup-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-cleanup-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-cleanup-command.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,QAqBzC"}
@@ -0,0 +1,29 @@
1
+ import {colors}from'@mongez/copper';import {command}from'@warlock.js/core';import {authService}from'../services/auth.service.js';/**
2
+ * Register the auth:cleanup CLI command
3
+ *
4
+ * @example
5
+ * ```bash
6
+ * warlock auth:cleanup
7
+ * ```
8
+ */
9
+ function registerAuthCleanupCommand() {
10
+ return command({
11
+ name: "auth.cleanup",
12
+ description: "Remove expired refresh tokens from the database",
13
+ preload: {
14
+ env: true,
15
+ config: ["auth", "database"],
16
+ connectors: ["database"],
17
+ },
18
+ action: async () => {
19
+ console.log(colors.cyan("🧹 Cleaning up expired tokens..."));
20
+ const count = await authService.cleanupExpiredTokens();
21
+ if (count === 0) {
22
+ console.log(colors.green("✅ No expired tokens found."));
23
+ }
24
+ else {
25
+ console.log(colors.green(`✅ Removed ${count} expired token(s).`));
26
+ }
27
+ },
28
+ });
29
+ }export{registerAuthCleanupCommand};//# sourceMappingURL=auth-cleanup-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-cleanup-command.js","sources":["../../src/commands/auth-cleanup-command.ts"],"sourcesContent":[null],"names":[],"mappings":"iIAIA;;;;;;;AAOG;SACa,0BAA0B,GAAA;AACxC,IAAA,OAAO,OAAO,CAAC;AACb,QAAA,IAAI,EAAE,cAAc;AACpB,QAAA,WAAW,EAAE,iDAAiD;AAC9D,QAAA,OAAO,EAAE;AACP,YAAA,GAAG,EAAE,IAAI;AACT,YAAA,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;YAC5B,UAAU,EAAE,CAAC,UAAU,CAAC;AACzB,SAAA;QACD,MAAM,EAAE,YAAW;YACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC;AAE7D,YAAA,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,oBAAoB,EAAE,CAAC;YAEvD,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;AACzD,aAAA;AAAM,iBAAA;AACL,gBAAA,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,UAAA,EAAa,KAAK,CAAA,kBAAA,CAAoB,CAAC,CAAC,CAAC;AACnE,aAAA;SACF;AACF,KAAA,CAAC,CAAC;AACL"}
@@ -0,0 +1,2 @@
1
+ export declare function registerJWTSecretGeneratorCommand(): any;
2
+ //# sourceMappingURL=jwt-secret-generator-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-secret-generator-command.d.ts","sourceRoot":"","sources":["../../src/commands/jwt-secret-generator-command.ts"],"names":[],"mappings":"AAGA,wBAAgB,iCAAiC,QAMhD"}
@@ -0,0 +1,7 @@
1
+ import {command}from'@warlock.js/core';import {generateJWTSecret}from'../services/generate-jwt-secret.js';function registerJWTSecretGeneratorCommand() {
2
+ return command({
3
+ name: "jwt.generate",
4
+ description: "Generate JWT Secret key in .env file",
5
+ action: generateJWTSecret,
6
+ });
7
+ }export{registerJWTSecretGeneratorCommand};//# sourceMappingURL=jwt-secret-generator-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-secret-generator-command.js","sources":["../../src/commands/jwt-secret-generator-command.ts"],"sourcesContent":[null],"names":[],"mappings":"mHAGgB,iCAAiC,GAAA;AAC/C,IAAA,OAAO,OAAO,CAAC;AACb,QAAA,IAAI,EAAE,cAAc;AACpB,QAAA,WAAW,EAAE,sCAAsC;AACnD,QAAA,MAAM,EAAE,iBAAiB;AAC1B,KAAA,CAAC,CAAC;AACL"}
@@ -0,0 +1,23 @@
1
+ export interface Authenticable {
2
+ /**
3
+ * Generate access token
4
+ */
5
+ generateAccessToken(): Promise<string>;
6
+ /**
7
+ * Generate refresh token
8
+ */
9
+ generateRefreshToken(): Promise<string>;
10
+ /**
11
+ * Change password
12
+ */
13
+ changePassword(password: string): Promise<void>;
14
+ /**
15
+ * Verify Password
16
+ */
17
+ verifyPassword(password: string): Promise<boolean>;
18
+ /**
19
+ * Get user type
20
+ */
21
+ getUserType(): string;
22
+ }
23
+ //# sourceMappingURL=auth-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-contract.d.ts","sourceRoot":"","sources":["../../src/contracts/auth-contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAExC;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnD;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ export * from "./auth-contract";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,167 @@
1
+ import { ChildModel } from "@warlock.js/cascade";
2
+ import { type Algorithm } from "fast-jwt";
3
+ import type { Auth } from "../models/auth.model";
4
+ import type { Duration, ExpiresIn } from "../utils/duration";
5
+ /**
6
+ * Symbol to indicate no expiration for tokens
7
+ * Use this when you explicitly want tokens to never expire
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // src/config/auth.ts
12
+ * import { NO_EXPIRATION, type AuthConfigurations } from "@warlock.js/auth";
13
+ *
14
+ * const authConfigurations: AuthConfigurations = {
15
+ * jwt: {
16
+ * secret: env("JWT_SECRET"),
17
+ * expiresIn: NO_EXPIRATION, // Token never expires
18
+ * },
19
+ * };
20
+ *
21
+ * export default authConfigurations;
22
+ * ```
23
+ */
24
+ export declare const NO_EXPIRATION: unique symbol;
25
+ /**
26
+ * Behavior when logout is called without a refresh token
27
+ * - "revoke-all": Revoke all refresh tokens for the user (secure default)
28
+ * - "error": Return an error requiring the refresh token
29
+ */
30
+ export type LogoutWithoutTokenBehavior = "revoke-all" | "error";
31
+ export type AuthConfigurations = {
32
+ /**
33
+ * Define all user types
34
+ * This is important to differentiate between user types when validating and generating tokens
35
+ */
36
+ userType: {
37
+ [userType: string]: ChildModel<Auth>;
38
+ };
39
+ /**
40
+ * JWT configurations
41
+ */
42
+ jwt: {
43
+ /**
44
+ * JWT secret key for signing access tokens
45
+ */
46
+ secret: string;
47
+ /**
48
+ * JWT algorithm
49
+ * @default "HS256"
50
+ */
51
+ algorithm?: Algorithm;
52
+ /**
53
+ * Access token expiration time
54
+ * Supports Duration object, string format, or NO_EXPIRATION
55
+ * @example { hours: 1 }, { days: 7, hours: 12 }, "1h", "1d 2h", NO_EXPIRATION
56
+ * @default { hours: 1 }
57
+ */
58
+ expiresIn?: ExpiresIn;
59
+ /**
60
+ * Refresh token configurations
61
+ */
62
+ refresh?: {
63
+ /**
64
+ * Separate secret for refresh tokens (recommended for security)
65
+ * If not provided, falls back to main JWT secret
66
+ */
67
+ secret?: string;
68
+ /**
69
+ * Enable refresh token
70
+ * @default true
71
+ */
72
+ enabled?: boolean;
73
+ /**
74
+ * Refresh token expiration time
75
+ * Supports Duration object or string format
76
+ * @example { days: 7 }, { weeks: 1 }, "7d", "1w"
77
+ * @default { days: 7 }
78
+ */
79
+ expiresIn?: Duration | string | number;
80
+ /**
81
+ * Enable token rotation (issue new refresh token on each use)
82
+ * Old refresh token is invalidated after use
83
+ * @default true
84
+ */
85
+ rotation?: boolean;
86
+ /**
87
+ * Maximum number of active refresh tokens per user
88
+ * When exceeded, oldest tokens are revoked
89
+ * @default 5
90
+ */
91
+ maxPerUser?: number;
92
+ /**
93
+ * Behavior when logout is called without a refresh token
94
+ * - "revoke-all": Revoke all tokens for security (default)
95
+ * - "error": Require refresh token, return error if missing
96
+ * @default "revoke-all"
97
+ */
98
+ logoutWithoutToken?: LogoutWithoutTokenBehavior;
99
+ };
100
+ };
101
+ /**
102
+ * Password configurations
103
+ */
104
+ password?: {
105
+ /**
106
+ * Password salt
107
+ * The higher the salt, the more secure the password is
108
+ * But, it will take more time to generate the password
109
+ * @default 12
110
+ */
111
+ salt?: number;
112
+ };
113
+ };
114
+ export type AccessTokenOutput = {
115
+ /**
116
+ * JWT Token
117
+ */
118
+ token: string;
119
+ /**
120
+ * Exprie time in ISO format UTC time
121
+ */
122
+ expiresAt: string;
123
+ };
124
+ /**
125
+ * Token pair returned after login or token refresh
126
+ */
127
+ export type TokenPair = {
128
+ /**
129
+ * JWT access token (short-lived)
130
+ */
131
+ accessToken: AccessTokenOutput;
132
+ /**
133
+ * JWT refresh token (long-lived)
134
+ */
135
+ refreshToken?: AccessTokenOutput;
136
+ };
137
+ /**
138
+ * Device information for session tracking
139
+ */
140
+ export type DeviceInfo = {
141
+ /**
142
+ * User agent string from request
143
+ */
144
+ userAgent?: string;
145
+ /**
146
+ * Client IP address
147
+ */
148
+ ip?: string;
149
+ /**
150
+ * Optional device identifier
151
+ */
152
+ deviceId?: string;
153
+ /**
154
+ * Token family ID (for rotation tracking)
155
+ * @internal
156
+ */
157
+ familyId?: string;
158
+ /**
159
+ * Access token payload
160
+ */
161
+ payload?: Record<string, any>;
162
+ };
163
+ export type LoginResult<UserType extends Auth> = {
164
+ user: UserType;
165
+ tokens: TokenPair;
166
+ };
167
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/contracts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,eAA0B,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,YAAY,GAAG,OAAO,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,QAAQ,EAAE;QACR,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;KACtC,CAAC;IACF;;OAEG;IACH,GAAG,EAAE;QACH;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB;;;;;WAKG;QACH,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB;;WAEG;QACH,OAAO,CAAC,EAAE;YACR;;;eAGG;YACH,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB;;;eAGG;YACH,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB;;;;;eAKG;YACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;YACvC;;;;eAIG;YACH,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB;;;;eAIG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB;;;;;eAKG;YACH,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;SACjD,CAAC;KACH,CAAC;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;;;;WAKG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,iBAAiB,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,IAAI,IAAI;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Symbol to indicate no expiration for tokens
3
+ * Use this when you explicitly want tokens to never expire
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * // src/config/auth.ts
8
+ * import { NO_EXPIRATION, type AuthConfigurations } from "@warlock.js/auth";
9
+ *
10
+ * const authConfigurations: AuthConfigurations = {
11
+ * jwt: {
12
+ * secret: env("JWT_SECRET"),
13
+ * expiresIn: NO_EXPIRATION, // Token never expires
14
+ * },
15
+ * };
16
+ *
17
+ * export default authConfigurations;
18
+ * ```
19
+ */
20
+ const NO_EXPIRATION = Symbol("NO_EXPIRATION");export{NO_EXPIRATION};//# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../src/contracts/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;AAkBG;MACU,aAAa,GAAG,MAAM,CAAC,eAAe"}
package/esm/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from "./commands/auth-cleanup-command";
2
+ export * from "./commands/jwt-secret-generator-command";
3
+ export * from "./contracts";
4
+ export * from "./middleware";
5
+ export * from "./models";
6
+ export * from "./services";
7
+ export * from "./utils";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
package/esm/index.js ADDED
@@ -0,0 +1 @@
1
+ export{registerAuthCleanupCommand}from'./commands/auth-cleanup-command.js';export{registerJWTSecretGeneratorCommand}from'./commands/jwt-secret-generator-command.js';export{NO_EXPIRATION}from'./contracts/types.js';export{authMiddleware}from'./middleware/auth.middleware.js';export{authMigrations}from'./models/index.js';export{authEvents}from'./services/auth-events.js';export{authService}from'./services/auth.service.js';export{generateJWTSecret}from'./services/generate-jwt-secret.js';export{jwt}from'./services/jwt.js';export{AuthErrorCodes}from'./utils/auth-error-codes.js';export{parseExpirationToMs,toJwtExpiresIn}from'./utils/duration.js';export{AccessToken}from'./models/access-token/access-token.model.js';export{Auth}from'./models/auth.model.js';export{RefreshToken}from'./models/refresh-token/refresh-token.model.js';//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function authMiddleware(allowedUserType?: string | string[]): Middleware;
2
+ //# sourceMappingURL=auth.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.middleware.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,cAsFjE"}
@@ -0,0 +1,72 @@
1
+ import {t,config}from'@warlock.js/core';import {log}from'@warlock.js/logger';import {AccessToken}from'../models/access-token/access-token.model.js';import {jwt}from'../services/jwt.js';import {AuthErrorCodes}from'../utils/auth-error-codes.js';function authMiddleware(allowedUserType) {
2
+ const allowedTypes = !allowedUserType
3
+ ? []
4
+ : Array.isArray(allowedUserType)
5
+ ? allowedUserType
6
+ : [allowedUserType];
7
+ const auth = async (request, response) => {
8
+ try {
9
+ const authorizationValue = request.authorizationValue;
10
+ if (!allowedTypes.length && !authorizationValue)
11
+ return;
12
+ if (!authorizationValue) {
13
+ return response.unauthorized({
14
+ error: t("auth.errors.missingAccessToken"),
15
+ errorCode: AuthErrorCodes.MissingAccessToken,
16
+ });
17
+ }
18
+ // get current user jwt
19
+ const user = await jwt.verify(authorizationValue);
20
+ // store decoded access token object in request object
21
+ request.decodedAccessToken = user;
22
+ // use our own jwt verify to verify the token
23
+ const accessToken = await AccessToken.first({
24
+ token: authorizationValue,
25
+ });
26
+ if (!accessToken) {
27
+ return response.unauthorized({
28
+ error: t("auth.errors.invalidAccessToken"),
29
+ errorCode: AuthErrorCodes.InvalidAccessToken,
30
+ });
31
+ }
32
+ // now, we need to get an instance of user using its corresponding model
33
+ const userType = user.userType || accessToken.get("userType");
34
+ // check if the user type is allowed
35
+ if (allowedTypes.length && !allowedTypes.includes(userType)) {
36
+ return response.unauthorized({
37
+ error: t("auth.errors.unauthorized"),
38
+ errorCode: AuthErrorCodes.Unauthorized,
39
+ });
40
+ }
41
+ // get user model class
42
+ const UserModel = config.key(`auth.userType.${userType}`);
43
+ if (!UserModel) {
44
+ throw new Error(`User type ${userType} is unknown type.`);
45
+ }
46
+ // get user model instance
47
+ const currentUser = await UserModel.find(user.id);
48
+ if (!currentUser) {
49
+ accessToken.destroy();
50
+ return response.unauthorized({
51
+ error: t("auth.errors.invalidAccessToken"),
52
+ errorCode: AuthErrorCodes.InvalidAccessToken,
53
+ });
54
+ }
55
+ // update last access
56
+ // accessToken.set("lastAccess", new Date());
57
+ // await accessToken.save({ skipEvents: true });
58
+ // set current user
59
+ request.user = currentUser;
60
+ }
61
+ catch (err) {
62
+ log.error("http", "auth", err);
63
+ // unset current user
64
+ request.clearCurrentUser();
65
+ return response.unauthorized({
66
+ error: t("auth.errors.invalidAccessToken"),
67
+ errorCode: AuthErrorCodes.InvalidAccessToken,
68
+ });
69
+ }
70
+ };
71
+ return auth;
72
+ }export{authMiddleware};//# sourceMappingURL=auth.middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.middleware.js","sources":["../../src/middleware/auth.middleware.ts"],"sourcesContent":[null],"names":[],"mappings":"mPAMM,SAAU,cAAc,CAAC,eAAmC,EAAA;IAChE,MAAM,YAAY,GAAG,CAAC,eAAe;AACnC,UAAE,EAAE;AACJ,UAAE,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC;AAC9B,cAAE,eAAe;AACjB,cAAE,CAAC,eAAe,CAAC,CAAC;IAExB,MAAM,IAAI,GAAe,OAAO,OAAgB,EAAE,QAAkB,KAAI;QACtE,IAAI;AACF,YAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAEtD,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,kBAAkB;gBAAE,OAAO;YAExD,IAAI,CAAC,kBAAkB,EAAE;gBACvB,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC3B,oBAAA,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC;oBAC1C,SAAS,EAAE,cAAc,CAAC,kBAAkB;AAC7C,iBAAA,CAAC,CAAC;AACJ,aAAA;;YAGD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;;AAGlD,YAAA,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;;AAElC,YAAA,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC;AAC1C,gBAAA,KAAK,EAAE,kBAAkB;AAC1B,aAAA,CAAC,CAAC;YAEH,IAAI,CAAC,WAAW,EAAE;gBAChB,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC3B,oBAAA,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC;oBAC1C,SAAS,EAAE,cAAc,CAAC,kBAAkB;AAC7C,iBAAA,CAAC,CAAC;AACJ,aAAA;;AAGD,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;;YAG9D,IAAI,YAAY,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAC3D,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC3B,oBAAA,KAAK,EAAE,CAAC,CAAC,0BAA0B,CAAC;oBACpC,SAAS,EAAE,cAAc,CAAC,YAAY;AACvC,iBAAA,CAAC,CAAC;AACJ,aAAA;;YAGD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAiB,cAAA,EAAA,QAAQ,CAAE,CAAA,CAAC,CAAC;YAE1D,IAAI,CAAC,SAAS,EAAE;AACd,gBAAA,MAAM,IAAI,KAAK,CAAC,aAAa,QAAQ,CAAA,iBAAA,CAAmB,CAAC,CAAC;AAC3D,aAAA;;YAGD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAElD,IAAI,CAAC,WAAW,EAAE;gBAChB,WAAW,CAAC,OAAO,EAAE,CAAC;gBACtB,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC3B,oBAAA,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC;oBAC1C,SAAS,EAAE,cAAc,CAAC,kBAAkB;AAC7C,iBAAA,CAAC,CAAC;AACJ,aAAA;;;;;AAOD,YAAA,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC;AAC5B,SAAA;AAAC,QAAA,OAAO,GAAQ,EAAE;YACjB,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;;YAG/B,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAE3B,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC3B,gBAAA,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC;gBAC1C,SAAS,EAAE,cAAc,CAAC,kBAAkB;AAC7C,aAAA,CAAC,CAAC;AACJ,SAAA;AACH,KAAC,CAAC;AAEF,IAAA,OAAO,IAAI,CAAC;AACd"}
@@ -0,0 +1,2 @@
1
+ export * from "./auth.middleware";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Model } from "@warlock.js/cascade";
2
+ export declare class AccessToken extends Model {
3
+ /**
4
+ * {@inheritDoc}
5
+ */
6
+ static table: string;
7
+ static schema: any;
8
+ }
9
+ //# sourceMappingURL=access-token.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-token.model.d.ts","sourceRoot":"","sources":["../../../src/models/access-token/access-token.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAW5C,qBAAa,WAAY,SAAQ,KAAK;IACpC;;OAEG;IACH,OAAc,KAAK,SAAmB;IAEtC,OAAc,MAAM,MAAqB;CAC1C"}
@@ -0,0 +1,14 @@
1
+ import {Model}from'@warlock.js/cascade';import {v}from'@warlock.js/seal';const accessTokenSchema = v.object({
2
+ token: v.string().required(),
3
+ last_access: v.date().defaultNow().optional(),
4
+ user_id: v.scalar().required(),
5
+ user_type: v.string().required(),
6
+ is_active: v.boolean().default(true),
7
+ });
8
+ class AccessToken extends Model {
9
+ /**
10
+ * {@inheritDoc}
11
+ */
12
+ static table = "access_tokens";
13
+ static schema = accessTokenSchema;
14
+ }export{AccessToken};//# sourceMappingURL=access-token.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-token.model.js","sources":["../../../src/models/access-token/access-token.model.ts"],"sourcesContent":[null],"names":[],"mappings":"yEAGA,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;AACjC,IAAA,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE;AAC7C,IAAA,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;AAC9B,IAAA,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;AACrC,CAAA,CAAC,CAAC;AAEG,MAAO,WAAY,SAAQ,KAAK,CAAA;AACpC;;AAEG;AACI,IAAA,OAAO,KAAK,GAAG,eAAe,CAAC;AAE/B,IAAA,OAAO,MAAM,GAAG,iBAAiB,CAAC;"}
@@ -0,0 +1,2 @@
1
+ export * from "./access-token.model";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/access-token/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const AccessTokenMigration: any;
2
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/models/access-token/migration.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,KA0B/B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import {migrate}from'@warlock.js/cascade';import {AccessToken}from'./access-token.model.js';const AccessTokenMigration = migrate(AccessToken, {
2
+ name: "accessToken",
3
+ up() {
4
+ // Create table
5
+ this.createTableIfNotExists();
6
+ // Primary key
7
+ this.primaryUuid();
8
+ // Token field
9
+ this.text("token").unique();
10
+ this.timestamp("last_access").nullable();
11
+ // User reference (flat columns for cross-driver compatibility)
12
+ this.uuid("user_id").index();
13
+ this.string("user_type", 50).nullable();
14
+ // Status (for token revocation)
15
+ this.boolean("is_active").nullable();
16
+ // Timestamps
17
+ this.timestamps();
18
+ },
19
+ down() {
20
+ this.dropTableIfExists();
21
+ },
22
+ });export{AccessTokenMigration};//# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.js","sources":["../../../src/models/access-token/migration.ts"],"sourcesContent":[null],"names":[],"mappings":"4FAGa,MAAA,oBAAoB,GAAG,OAAO,CAAC,WAAW,EAAE;AACvD,IAAA,IAAI,EAAE,aAAa;IACnB,EAAE,GAAA;;QAEA,IAAI,CAAC,sBAAsB,EAAE,CAAC;;QAG9B,IAAI,CAAC,WAAW,EAAE,CAAC;;QAGnB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;;QAGzC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;;QAGxC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC;;QAGrC,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;IACD,IAAI,GAAA;QACF,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;AACF,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { type ChildModel, Model, type ModelSchema } from "@warlock.js/cascade";
2
+ import type { AccessTokenOutput, DeviceInfo, TokenPair } from "../contracts/types";
3
+ import type { RefreshToken } from "./refresh-token/refresh-token.model";
4
+ export declare abstract class Auth<Schema extends ModelSchema = ModelSchema> extends Model<Schema> {
5
+ /**
6
+ * Get user type
7
+ */
8
+ abstract get userType(): string;
9
+ /**
10
+ * Get access token payload
11
+ */
12
+ accessTokenPayload(): {
13
+ id: any;
14
+ userType: string;
15
+ created_at: number;
16
+ };
17
+ /**
18
+ * Create both access and refresh tokens
19
+ */
20
+ createTokenPair(deviceInfo?: DeviceInfo): Promise<TokenPair>;
21
+ /**
22
+ * Generate access token
23
+ */
24
+ generateAccessToken(data?: any): Promise<AccessTokenOutput>;
25
+ /**
26
+ * Generate refresh token
27
+ */
28
+ generateRefreshToken(deviceInfo?: DeviceInfo): Promise<RefreshToken>;
29
+ /**
30
+ * Remove current access token
31
+ */
32
+ removeAccessToken(token: string): Promise<void>;
33
+ /**
34
+ * Remove refresh token
35
+ */
36
+ removeRefreshToken(token: string): Promise<void>;
37
+ /**
38
+ * Remove all access tokens
39
+ */
40
+ removeAllAccessTokens(): Promise<void>;
41
+ /**
42
+ * Revoke all tokens (logout from all devices)
43
+ */
44
+ revokeAllTokens(): Promise<void>;
45
+ /**
46
+ * Get active sessions
47
+ */
48
+ activeSessions(): Promise<RefreshToken[]>;
49
+ /**
50
+ * Attempt to login the user
51
+ */
52
+ static attempt(this: ChildModel<Auth>, data: any): Promise<Auth | null>;
53
+ /**
54
+ * Confirm password
55
+ */
56
+ confirmPassword(password: string): Promise<boolean>;
57
+ }
58
+ //# sourceMappingURL=auth.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.model.d.ts","sourceRoot":"","sources":["../../src/models/auth.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE,8BAAsB,IAAI,CAAC,MAAM,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,KAAK,CAAC,MAAM,CAAC;IACxF;;OAEG;IACH,aAAoB,QAAQ,IAAI,MAAM,CAAC;IAEvC;;OAEG;IACI,kBAAkB;;;;;IAIzB;;OAEG;IACU,eAAe,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAIzE;;OAEG;IACU,mBAAmB,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIxE;;OAEG;IACU,oBAAoB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IAIjF;;OAEG;IACU,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D;;OAEG;IACU,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D;;OAEG;IACU,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAInD;;OAEG;IACU,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7C;;OAEG;IACU,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAItD;;OAEG;WACiB,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAIpF;;OAEG;IACU,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGjE"}
@@ -0,0 +1,68 @@
1
+ import {Model}from'@warlock.js/cascade';import'@mongez/events';import {authService}from'../services/auth.service.js';import'@mongez/fs';import'@mongez/reinforcements';import'@warlock.js/core';import'@warlock.js/logger';import'fast-jwt';class Auth extends Model {
2
+ /**
3
+ * Get access token payload
4
+ */
5
+ accessTokenPayload() {
6
+ return authService.buildAccessTokenPayload(this);
7
+ }
8
+ /**
9
+ * Create both access and refresh tokens
10
+ */
11
+ async createTokenPair(deviceInfo) {
12
+ return authService.createTokenPair(this, deviceInfo);
13
+ }
14
+ /**
15
+ * Generate access token
16
+ */
17
+ async generateAccessToken(data) {
18
+ return authService.generateAccessToken(this, data);
19
+ }
20
+ /**
21
+ * Generate refresh token
22
+ */
23
+ async generateRefreshToken(deviceInfo) {
24
+ return authService.createRefreshToken(this, deviceInfo);
25
+ }
26
+ /**
27
+ * Remove current access token
28
+ */
29
+ async removeAccessToken(token) {
30
+ return authService.removeAccessToken(this, token);
31
+ }
32
+ /**
33
+ * Remove refresh token
34
+ */
35
+ async removeRefreshToken(token) {
36
+ return authService.removeRefreshToken(this, token);
37
+ }
38
+ /**
39
+ * Remove all access tokens
40
+ */
41
+ async removeAllAccessTokens() {
42
+ return authService.removeAllAccessTokens(this);
43
+ }
44
+ /**
45
+ * Revoke all tokens (logout from all devices)
46
+ */
47
+ async revokeAllTokens() {
48
+ return authService.revokeAllTokens(this);
49
+ }
50
+ /**
51
+ * Get active sessions
52
+ */
53
+ async activeSessions() {
54
+ return authService.getActiveSessions(this);
55
+ }
56
+ /**
57
+ * Attempt to login the user
58
+ */
59
+ static async attempt(data) {
60
+ return authService.attemptLogin(this, data);
61
+ }
62
+ /**
63
+ * Confirm password
64
+ */
65
+ async confirmPassword(password) {
66
+ return authService.verifyPassword(this.string("password"), password);
67
+ }
68
+ }export{Auth};//# sourceMappingURL=auth.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.model.js","sources":["../../src/models/auth.model.ts"],"sourcesContent":[null],"names":[],"mappings":"4OAKM,MAAgB,IAA+C,SAAQ,KAAa,CAAA;AAMxF;;AAEG;IACI,kBAAkB,GAAA;AACvB,QAAA,OAAO,WAAW,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;KAClD;AAED;;AAEG;IACI,MAAM,eAAe,CAAC,UAAuB,EAAA;QAClD,OAAO,WAAW,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;KACtD;AAED;;AAEG;IACI,MAAM,mBAAmB,CAAC,IAAU,EAAA;QACzC,OAAO,WAAW,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACpD;AAED;;AAEG;IACI,MAAM,oBAAoB,CAAC,UAAuB,EAAA;QACvD,OAAO,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;KACzD;AAED;;AAEG;IACI,MAAM,iBAAiB,CAAC,KAAa,EAAA;QAC1C,OAAO,WAAW,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACnD;AAED;;AAEG;IACI,MAAM,kBAAkB,CAAC,KAAa,EAAA;QAC3C,OAAO,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACpD;AAED;;AAEG;AACI,IAAA,MAAM,qBAAqB,GAAA;AAChC,QAAA,OAAO,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;KAChD;AAED;;AAEG;AACI,IAAA,MAAM,eAAe,GAAA;AAC1B,QAAA,OAAO,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;KAC1C;AAED;;AAEG;AACI,IAAA,MAAM,cAAc,GAAA;AACzB,QAAA,OAAO,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;KAC5C;AAED;;AAEG;AACI,IAAA,aAAa,OAAO,CAAyB,IAAS,EAAA;QAC3D,OAAO,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KAC7C;AAED;;AAEG;IACI,MAAM,eAAe,CAAC,QAAgB,EAAA;AAC3C,QAAA,OAAO,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAE,EAAE,QAAQ,CAAC,CAAC;KACvE;AACF"}
@@ -0,0 +1,5 @@
1
+ export * from "./access-token";
2
+ export * from "./auth.model";
3
+ export * from "./refresh-token";
4
+ export declare const authMigrations: any[];
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAEhC,eAAO,MAAM,cAAc,OAAgD,CAAC"}