@objectstack/plugin-auth 3.2.6 → 3.2.8
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +49 -22
- package/dist/index.d.ts +49 -22
- package/dist/index.js +210 -127
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +210 -127
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/auth-manager.test.ts +345 -0
- package/src/auth-manager.ts +71 -2
- package/src/auth-plugin.test.ts +89 -0
- package/src/auth-plugin.ts +45 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/plugin-auth@3.2.
|
|
2
|
+
> @objectstack/plugin-auth@3.2.8 build /home/runner/work/spec/spec/packages/plugins/plugin-auth
|
|
3
3
|
> tsup --config ../../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
╵ [32m~~~~~~~~~[0m
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
70
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
71
|
-
[32mESM[39m ⚡️ Build success in
|
|
72
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
73
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
74
|
-
[32mCJS[39m ⚡️ Build success in
|
|
69
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m42.00 KB[39m
|
|
70
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m93.72 KB[39m
|
|
71
|
+
[32mESM[39m ⚡️ Build success in 101ms
|
|
72
|
+
[32mCJS[39m [1mdist/index.js [22m[32m45.49 KB[39m
|
|
73
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m94.25 KB[39m
|
|
74
|
+
[32mCJS[39m ⚡️ Build success in 101ms
|
|
75
75
|
[34mDTS[39m Build start
|
|
76
|
-
[32mDTS[39m ⚡️ Build success in
|
|
77
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
78
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
76
|
+
[32mDTS[39m ⚡️ Build success in 9397ms
|
|
77
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m867.98 KB[39m
|
|
78
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m867.98 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1fe5612: fix vercel
|
|
8
|
+
- @objectstack/spec@3.2.8
|
|
9
|
+
- @objectstack/core@3.2.8
|
|
10
|
+
|
|
11
|
+
## 3.2.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 35a1ebb: fix auth
|
|
16
|
+
- @objectstack/spec@3.2.7
|
|
17
|
+
- @objectstack/core@3.2.7
|
|
18
|
+
|
|
3
19
|
## 3.2.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -45,6 +45,7 @@ interface AuthPluginOptions extends Partial<AuthConfig> {
|
|
|
45
45
|
*
|
|
46
46
|
* This plugin registers:
|
|
47
47
|
* - `auth` service (auth manager instance) — always
|
|
48
|
+
* - `app.com.objectstack.system` service (system object definitions) — always
|
|
48
49
|
* - HTTP routes for authentication endpoints — only when HTTP server is available
|
|
49
50
|
*
|
|
50
51
|
* Integrates with better-auth library to provide comprehensive
|
|
@@ -148,6 +149,17 @@ declare class AuthManager {
|
|
|
148
149
|
* Generate a secure secret if not provided
|
|
149
150
|
*/
|
|
150
151
|
private generateSecret;
|
|
152
|
+
/**
|
|
153
|
+
* Update the base URL at runtime.
|
|
154
|
+
*
|
|
155
|
+
* This **must** be called before the first request triggers lazy
|
|
156
|
+
* initialisation of the better-auth instance — typically from a
|
|
157
|
+
* `kernel:ready` hook where the actual server port is known.
|
|
158
|
+
*
|
|
159
|
+
* If the auth instance has already been created this is a no-op and
|
|
160
|
+
* a warning is emitted.
|
|
161
|
+
*/
|
|
162
|
+
setRuntimeBaseUrl(url: string): void;
|
|
151
163
|
/**
|
|
152
164
|
* Get the underlying better-auth instance
|
|
153
165
|
* Useful for advanced use cases
|
|
@@ -237,6 +249,13 @@ declare class AuthManager {
|
|
|
237
249
|
accessToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
238
250
|
refreshToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
239
251
|
expiresAt: better_auth.ZodOptional<better_auth.ZodNumber>;
|
|
252
|
+
user: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
253
|
+
name: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
254
|
+
firstName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
255
|
+
lastName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
256
|
+
}, better_auth.$strip>>;
|
|
257
|
+
email: better_auth.ZodOptional<better_auth.ZodString>;
|
|
258
|
+
}, better_auth.$strip>>;
|
|
240
259
|
}, better_auth.$strip>>;
|
|
241
260
|
scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
|
|
242
261
|
requestSignUp: better_auth.ZodOptional<better_auth.ZodBoolean>;
|
|
@@ -257,6 +276,13 @@ declare class AuthManager {
|
|
|
257
276
|
accessToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
258
277
|
refreshToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
259
278
|
expiresAt: better_auth.ZodOptional<better_auth.ZodNumber>;
|
|
279
|
+
user: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
280
|
+
name: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
281
|
+
firstName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
282
|
+
lastName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
283
|
+
}, better_auth.$strip>>;
|
|
284
|
+
email: better_auth.ZodOptional<better_auth.ZodString>;
|
|
285
|
+
}, better_auth.$strip>>;
|
|
260
286
|
}, better_auth.$strip>>;
|
|
261
287
|
scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
|
|
262
288
|
requestSignUp: better_auth.ZodOptional<better_auth.ZodBoolean>;
|
|
@@ -1515,6 +1541,7 @@ declare class AuthManager {
|
|
|
1515
1541
|
};
|
|
1516
1542
|
};
|
|
1517
1543
|
};
|
|
1544
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>)[];
|
|
1518
1545
|
}, {
|
|
1519
1546
|
status: boolean;
|
|
1520
1547
|
message: string;
|
|
@@ -2719,7 +2746,7 @@ declare const SysUser: Omit<{
|
|
|
2719
2746
|
abstract: boolean;
|
|
2720
2747
|
datasource: string;
|
|
2721
2748
|
fields: Record<string, {
|
|
2722
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
2749
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
2723
2750
|
required: boolean;
|
|
2724
2751
|
searchable: boolean;
|
|
2725
2752
|
multiple: boolean;
|
|
@@ -2909,7 +2936,7 @@ declare const SysUser: Omit<{
|
|
|
2909
2936
|
} | undefined;
|
|
2910
2937
|
partitioning?: {
|
|
2911
2938
|
enabled: boolean;
|
|
2912
|
-
strategy: "
|
|
2939
|
+
strategy: "hash" | "range" | "list";
|
|
2913
2940
|
key: string;
|
|
2914
2941
|
interval?: string | undefined;
|
|
2915
2942
|
} | undefined;
|
|
@@ -4194,7 +4221,7 @@ declare const SysSession: Omit<{
|
|
|
4194
4221
|
abstract: boolean;
|
|
4195
4222
|
datasource: string;
|
|
4196
4223
|
fields: Record<string, {
|
|
4197
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
4224
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
4198
4225
|
required: boolean;
|
|
4199
4226
|
searchable: boolean;
|
|
4200
4227
|
multiple: boolean;
|
|
@@ -4384,7 +4411,7 @@ declare const SysSession: Omit<{
|
|
|
4384
4411
|
} | undefined;
|
|
4385
4412
|
partitioning?: {
|
|
4386
4413
|
enabled: boolean;
|
|
4387
|
-
strategy: "
|
|
4414
|
+
strategy: "hash" | "range" | "list";
|
|
4388
4415
|
key: string;
|
|
4389
4416
|
interval?: string | undefined;
|
|
4390
4417
|
} | undefined;
|
|
@@ -5822,7 +5849,7 @@ declare const SysAccount: Omit<{
|
|
|
5822
5849
|
abstract: boolean;
|
|
5823
5850
|
datasource: string;
|
|
5824
5851
|
fields: Record<string, {
|
|
5825
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
5852
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
5826
5853
|
required: boolean;
|
|
5827
5854
|
searchable: boolean;
|
|
5828
5855
|
multiple: boolean;
|
|
@@ -6012,7 +6039,7 @@ declare const SysAccount: Omit<{
|
|
|
6012
6039
|
} | undefined;
|
|
6013
6040
|
partitioning?: {
|
|
6014
6041
|
enabled: boolean;
|
|
6015
|
-
strategy: "
|
|
6042
|
+
strategy: "hash" | "range" | "list";
|
|
6016
6043
|
key: string;
|
|
6017
6044
|
interval?: string | undefined;
|
|
6018
6045
|
} | undefined;
|
|
@@ -8237,7 +8264,7 @@ declare const SysVerification: Omit<{
|
|
|
8237
8264
|
abstract: boolean;
|
|
8238
8265
|
datasource: string;
|
|
8239
8266
|
fields: Record<string, {
|
|
8240
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
8267
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
8241
8268
|
required: boolean;
|
|
8242
8269
|
searchable: boolean;
|
|
8243
8270
|
multiple: boolean;
|
|
@@ -8427,7 +8454,7 @@ declare const SysVerification: Omit<{
|
|
|
8427
8454
|
} | undefined;
|
|
8428
8455
|
partitioning?: {
|
|
8429
8456
|
enabled: boolean;
|
|
8430
|
-
strategy: "
|
|
8457
|
+
strategy: "hash" | "range" | "list";
|
|
8431
8458
|
key: string;
|
|
8432
8459
|
interval?: string | undefined;
|
|
8433
8460
|
} | undefined;
|
|
@@ -9549,7 +9576,7 @@ declare const SysOrganization: Omit<{
|
|
|
9549
9576
|
abstract: boolean;
|
|
9550
9577
|
datasource: string;
|
|
9551
9578
|
fields: Record<string, {
|
|
9552
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
9579
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
9553
9580
|
required: boolean;
|
|
9554
9581
|
searchable: boolean;
|
|
9555
9582
|
multiple: boolean;
|
|
@@ -9739,7 +9766,7 @@ declare const SysOrganization: Omit<{
|
|
|
9739
9766
|
} | undefined;
|
|
9740
9767
|
partitioning?: {
|
|
9741
9768
|
enabled: boolean;
|
|
9742
|
-
strategy: "
|
|
9769
|
+
strategy: "hash" | "range" | "list";
|
|
9743
9770
|
key: string;
|
|
9744
9771
|
interval?: string | undefined;
|
|
9745
9772
|
} | undefined;
|
|
@@ -11015,7 +11042,7 @@ declare const SysMember: Omit<{
|
|
|
11015
11042
|
abstract: boolean;
|
|
11016
11043
|
datasource: string;
|
|
11017
11044
|
fields: Record<string, {
|
|
11018
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
11045
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
11019
11046
|
required: boolean;
|
|
11020
11047
|
searchable: boolean;
|
|
11021
11048
|
multiple: boolean;
|
|
@@ -11205,7 +11232,7 @@ declare const SysMember: Omit<{
|
|
|
11205
11232
|
} | undefined;
|
|
11206
11233
|
partitioning?: {
|
|
11207
11234
|
enabled: boolean;
|
|
11208
|
-
strategy: "
|
|
11235
|
+
strategy: "hash" | "range" | "list";
|
|
11209
11236
|
key: string;
|
|
11210
11237
|
interval?: string | undefined;
|
|
11211
11238
|
} | undefined;
|
|
@@ -12165,7 +12192,7 @@ declare const SysInvitation: Omit<{
|
|
|
12165
12192
|
abstract: boolean;
|
|
12166
12193
|
datasource: string;
|
|
12167
12194
|
fields: Record<string, {
|
|
12168
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
12195
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
12169
12196
|
required: boolean;
|
|
12170
12197
|
searchable: boolean;
|
|
12171
12198
|
multiple: boolean;
|
|
@@ -12355,7 +12382,7 @@ declare const SysInvitation: Omit<{
|
|
|
12355
12382
|
} | undefined;
|
|
12356
12383
|
partitioning?: {
|
|
12357
12384
|
enabled: boolean;
|
|
12358
|
-
strategy: "
|
|
12385
|
+
strategy: "hash" | "range" | "list";
|
|
12359
12386
|
key: string;
|
|
12360
12387
|
interval?: string | undefined;
|
|
12361
12388
|
} | undefined;
|
|
@@ -13948,7 +13975,7 @@ declare const SysTeam: Omit<{
|
|
|
13948
13975
|
abstract: boolean;
|
|
13949
13976
|
datasource: string;
|
|
13950
13977
|
fields: Record<string, {
|
|
13951
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
13978
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
13952
13979
|
required: boolean;
|
|
13953
13980
|
searchable: boolean;
|
|
13954
13981
|
multiple: boolean;
|
|
@@ -14138,7 +14165,7 @@ declare const SysTeam: Omit<{
|
|
|
14138
14165
|
} | undefined;
|
|
14139
14166
|
partitioning?: {
|
|
14140
14167
|
enabled: boolean;
|
|
14141
|
-
strategy: "
|
|
14168
|
+
strategy: "hash" | "range" | "list";
|
|
14142
14169
|
key: string;
|
|
14143
14170
|
interval?: string | undefined;
|
|
14144
14171
|
} | undefined;
|
|
@@ -15098,7 +15125,7 @@ declare const SysTeamMember: Omit<{
|
|
|
15098
15125
|
abstract: boolean;
|
|
15099
15126
|
datasource: string;
|
|
15100
15127
|
fields: Record<string, {
|
|
15101
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
15128
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
15102
15129
|
required: boolean;
|
|
15103
15130
|
searchable: boolean;
|
|
15104
15131
|
multiple: boolean;
|
|
@@ -15288,7 +15315,7 @@ declare const SysTeamMember: Omit<{
|
|
|
15288
15315
|
} | undefined;
|
|
15289
15316
|
partitioning?: {
|
|
15290
15317
|
enabled: boolean;
|
|
15291
|
-
strategy: "
|
|
15318
|
+
strategy: "hash" | "range" | "list";
|
|
15292
15319
|
key: string;
|
|
15293
15320
|
interval?: string | undefined;
|
|
15294
15321
|
} | undefined;
|
|
@@ -16089,7 +16116,7 @@ declare const SysApiKey: Omit<{
|
|
|
16089
16116
|
abstract: boolean;
|
|
16090
16117
|
datasource: string;
|
|
16091
16118
|
fields: Record<string, {
|
|
16092
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
16119
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
16093
16120
|
required: boolean;
|
|
16094
16121
|
searchable: boolean;
|
|
16095
16122
|
multiple: boolean;
|
|
@@ -16279,7 +16306,7 @@ declare const SysApiKey: Omit<{
|
|
|
16279
16306
|
} | undefined;
|
|
16280
16307
|
partitioning?: {
|
|
16281
16308
|
enabled: boolean;
|
|
16282
|
-
strategy: "
|
|
16309
|
+
strategy: "hash" | "range" | "list";
|
|
16283
16310
|
key: string;
|
|
16284
16311
|
interval?: string | undefined;
|
|
16285
16312
|
} | undefined;
|
|
@@ -18189,7 +18216,7 @@ declare const SysTwoFactor: Omit<{
|
|
|
18189
18216
|
abstract: boolean;
|
|
18190
18217
|
datasource: string;
|
|
18191
18218
|
fields: Record<string, {
|
|
18192
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
18219
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
18193
18220
|
required: boolean;
|
|
18194
18221
|
searchable: boolean;
|
|
18195
18222
|
multiple: boolean;
|
|
@@ -18379,7 +18406,7 @@ declare const SysTwoFactor: Omit<{
|
|
|
18379
18406
|
} | undefined;
|
|
18380
18407
|
partitioning?: {
|
|
18381
18408
|
enabled: boolean;
|
|
18382
|
-
strategy: "
|
|
18409
|
+
strategy: "hash" | "range" | "list";
|
|
18383
18410
|
key: string;
|
|
18384
18411
|
interval?: string | undefined;
|
|
18385
18412
|
} | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ interface AuthPluginOptions extends Partial<AuthConfig> {
|
|
|
45
45
|
*
|
|
46
46
|
* This plugin registers:
|
|
47
47
|
* - `auth` service (auth manager instance) — always
|
|
48
|
+
* - `app.com.objectstack.system` service (system object definitions) — always
|
|
48
49
|
* - HTTP routes for authentication endpoints — only when HTTP server is available
|
|
49
50
|
*
|
|
50
51
|
* Integrates with better-auth library to provide comprehensive
|
|
@@ -148,6 +149,17 @@ declare class AuthManager {
|
|
|
148
149
|
* Generate a secure secret if not provided
|
|
149
150
|
*/
|
|
150
151
|
private generateSecret;
|
|
152
|
+
/**
|
|
153
|
+
* Update the base URL at runtime.
|
|
154
|
+
*
|
|
155
|
+
* This **must** be called before the first request triggers lazy
|
|
156
|
+
* initialisation of the better-auth instance — typically from a
|
|
157
|
+
* `kernel:ready` hook where the actual server port is known.
|
|
158
|
+
*
|
|
159
|
+
* If the auth instance has already been created this is a no-op and
|
|
160
|
+
* a warning is emitted.
|
|
161
|
+
*/
|
|
162
|
+
setRuntimeBaseUrl(url: string): void;
|
|
151
163
|
/**
|
|
152
164
|
* Get the underlying better-auth instance
|
|
153
165
|
* Useful for advanced use cases
|
|
@@ -237,6 +249,13 @@ declare class AuthManager {
|
|
|
237
249
|
accessToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
238
250
|
refreshToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
239
251
|
expiresAt: better_auth.ZodOptional<better_auth.ZodNumber>;
|
|
252
|
+
user: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
253
|
+
name: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
254
|
+
firstName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
255
|
+
lastName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
256
|
+
}, better_auth.$strip>>;
|
|
257
|
+
email: better_auth.ZodOptional<better_auth.ZodString>;
|
|
258
|
+
}, better_auth.$strip>>;
|
|
240
259
|
}, better_auth.$strip>>;
|
|
241
260
|
scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
|
|
242
261
|
requestSignUp: better_auth.ZodOptional<better_auth.ZodBoolean>;
|
|
@@ -257,6 +276,13 @@ declare class AuthManager {
|
|
|
257
276
|
accessToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
258
277
|
refreshToken: better_auth.ZodOptional<better_auth.ZodString>;
|
|
259
278
|
expiresAt: better_auth.ZodOptional<better_auth.ZodNumber>;
|
|
279
|
+
user: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
280
|
+
name: better_auth.ZodOptional<better_auth.ZodObject<{
|
|
281
|
+
firstName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
282
|
+
lastName: better_auth.ZodOptional<better_auth.ZodString>;
|
|
283
|
+
}, better_auth.$strip>>;
|
|
284
|
+
email: better_auth.ZodOptional<better_auth.ZodString>;
|
|
285
|
+
}, better_auth.$strip>>;
|
|
260
286
|
}, better_auth.$strip>>;
|
|
261
287
|
scopes: better_auth.ZodOptional<better_auth.ZodArray<better_auth.ZodString>>;
|
|
262
288
|
requestSignUp: better_auth.ZodOptional<better_auth.ZodBoolean>;
|
|
@@ -1515,6 +1541,7 @@ declare class AuthManager {
|
|
|
1515
1541
|
};
|
|
1516
1542
|
};
|
|
1517
1543
|
};
|
|
1544
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>)[];
|
|
1518
1545
|
}, {
|
|
1519
1546
|
status: boolean;
|
|
1520
1547
|
message: string;
|
|
@@ -2719,7 +2746,7 @@ declare const SysUser: Omit<{
|
|
|
2719
2746
|
abstract: boolean;
|
|
2720
2747
|
datasource: string;
|
|
2721
2748
|
fields: Record<string, {
|
|
2722
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
2749
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
2723
2750
|
required: boolean;
|
|
2724
2751
|
searchable: boolean;
|
|
2725
2752
|
multiple: boolean;
|
|
@@ -2909,7 +2936,7 @@ declare const SysUser: Omit<{
|
|
|
2909
2936
|
} | undefined;
|
|
2910
2937
|
partitioning?: {
|
|
2911
2938
|
enabled: boolean;
|
|
2912
|
-
strategy: "
|
|
2939
|
+
strategy: "hash" | "range" | "list";
|
|
2913
2940
|
key: string;
|
|
2914
2941
|
interval?: string | undefined;
|
|
2915
2942
|
} | undefined;
|
|
@@ -4194,7 +4221,7 @@ declare const SysSession: Omit<{
|
|
|
4194
4221
|
abstract: boolean;
|
|
4195
4222
|
datasource: string;
|
|
4196
4223
|
fields: Record<string, {
|
|
4197
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
4224
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
4198
4225
|
required: boolean;
|
|
4199
4226
|
searchable: boolean;
|
|
4200
4227
|
multiple: boolean;
|
|
@@ -4384,7 +4411,7 @@ declare const SysSession: Omit<{
|
|
|
4384
4411
|
} | undefined;
|
|
4385
4412
|
partitioning?: {
|
|
4386
4413
|
enabled: boolean;
|
|
4387
|
-
strategy: "
|
|
4414
|
+
strategy: "hash" | "range" | "list";
|
|
4388
4415
|
key: string;
|
|
4389
4416
|
interval?: string | undefined;
|
|
4390
4417
|
} | undefined;
|
|
@@ -5822,7 +5849,7 @@ declare const SysAccount: Omit<{
|
|
|
5822
5849
|
abstract: boolean;
|
|
5823
5850
|
datasource: string;
|
|
5824
5851
|
fields: Record<string, {
|
|
5825
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
5852
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
5826
5853
|
required: boolean;
|
|
5827
5854
|
searchable: boolean;
|
|
5828
5855
|
multiple: boolean;
|
|
@@ -6012,7 +6039,7 @@ declare const SysAccount: Omit<{
|
|
|
6012
6039
|
} | undefined;
|
|
6013
6040
|
partitioning?: {
|
|
6014
6041
|
enabled: boolean;
|
|
6015
|
-
strategy: "
|
|
6042
|
+
strategy: "hash" | "range" | "list";
|
|
6016
6043
|
key: string;
|
|
6017
6044
|
interval?: string | undefined;
|
|
6018
6045
|
} | undefined;
|
|
@@ -8237,7 +8264,7 @@ declare const SysVerification: Omit<{
|
|
|
8237
8264
|
abstract: boolean;
|
|
8238
8265
|
datasource: string;
|
|
8239
8266
|
fields: Record<string, {
|
|
8240
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
8267
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
8241
8268
|
required: boolean;
|
|
8242
8269
|
searchable: boolean;
|
|
8243
8270
|
multiple: boolean;
|
|
@@ -8427,7 +8454,7 @@ declare const SysVerification: Omit<{
|
|
|
8427
8454
|
} | undefined;
|
|
8428
8455
|
partitioning?: {
|
|
8429
8456
|
enabled: boolean;
|
|
8430
|
-
strategy: "
|
|
8457
|
+
strategy: "hash" | "range" | "list";
|
|
8431
8458
|
key: string;
|
|
8432
8459
|
interval?: string | undefined;
|
|
8433
8460
|
} | undefined;
|
|
@@ -9549,7 +9576,7 @@ declare const SysOrganization: Omit<{
|
|
|
9549
9576
|
abstract: boolean;
|
|
9550
9577
|
datasource: string;
|
|
9551
9578
|
fields: Record<string, {
|
|
9552
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
9579
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
9553
9580
|
required: boolean;
|
|
9554
9581
|
searchable: boolean;
|
|
9555
9582
|
multiple: boolean;
|
|
@@ -9739,7 +9766,7 @@ declare const SysOrganization: Omit<{
|
|
|
9739
9766
|
} | undefined;
|
|
9740
9767
|
partitioning?: {
|
|
9741
9768
|
enabled: boolean;
|
|
9742
|
-
strategy: "
|
|
9769
|
+
strategy: "hash" | "range" | "list";
|
|
9743
9770
|
key: string;
|
|
9744
9771
|
interval?: string | undefined;
|
|
9745
9772
|
} | undefined;
|
|
@@ -11015,7 +11042,7 @@ declare const SysMember: Omit<{
|
|
|
11015
11042
|
abstract: boolean;
|
|
11016
11043
|
datasource: string;
|
|
11017
11044
|
fields: Record<string, {
|
|
11018
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
11045
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
11019
11046
|
required: boolean;
|
|
11020
11047
|
searchable: boolean;
|
|
11021
11048
|
multiple: boolean;
|
|
@@ -11205,7 +11232,7 @@ declare const SysMember: Omit<{
|
|
|
11205
11232
|
} | undefined;
|
|
11206
11233
|
partitioning?: {
|
|
11207
11234
|
enabled: boolean;
|
|
11208
|
-
strategy: "
|
|
11235
|
+
strategy: "hash" | "range" | "list";
|
|
11209
11236
|
key: string;
|
|
11210
11237
|
interval?: string | undefined;
|
|
11211
11238
|
} | undefined;
|
|
@@ -12165,7 +12192,7 @@ declare const SysInvitation: Omit<{
|
|
|
12165
12192
|
abstract: boolean;
|
|
12166
12193
|
datasource: string;
|
|
12167
12194
|
fields: Record<string, {
|
|
12168
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
12195
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
12169
12196
|
required: boolean;
|
|
12170
12197
|
searchable: boolean;
|
|
12171
12198
|
multiple: boolean;
|
|
@@ -12355,7 +12382,7 @@ declare const SysInvitation: Omit<{
|
|
|
12355
12382
|
} | undefined;
|
|
12356
12383
|
partitioning?: {
|
|
12357
12384
|
enabled: boolean;
|
|
12358
|
-
strategy: "
|
|
12385
|
+
strategy: "hash" | "range" | "list";
|
|
12359
12386
|
key: string;
|
|
12360
12387
|
interval?: string | undefined;
|
|
12361
12388
|
} | undefined;
|
|
@@ -13948,7 +13975,7 @@ declare const SysTeam: Omit<{
|
|
|
13948
13975
|
abstract: boolean;
|
|
13949
13976
|
datasource: string;
|
|
13950
13977
|
fields: Record<string, {
|
|
13951
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
13978
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
13952
13979
|
required: boolean;
|
|
13953
13980
|
searchable: boolean;
|
|
13954
13981
|
multiple: boolean;
|
|
@@ -14138,7 +14165,7 @@ declare const SysTeam: Omit<{
|
|
|
14138
14165
|
} | undefined;
|
|
14139
14166
|
partitioning?: {
|
|
14140
14167
|
enabled: boolean;
|
|
14141
|
-
strategy: "
|
|
14168
|
+
strategy: "hash" | "range" | "list";
|
|
14142
14169
|
key: string;
|
|
14143
14170
|
interval?: string | undefined;
|
|
14144
14171
|
} | undefined;
|
|
@@ -15098,7 +15125,7 @@ declare const SysTeamMember: Omit<{
|
|
|
15098
15125
|
abstract: boolean;
|
|
15099
15126
|
datasource: string;
|
|
15100
15127
|
fields: Record<string, {
|
|
15101
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
15128
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
15102
15129
|
required: boolean;
|
|
15103
15130
|
searchable: boolean;
|
|
15104
15131
|
multiple: boolean;
|
|
@@ -15288,7 +15315,7 @@ declare const SysTeamMember: Omit<{
|
|
|
15288
15315
|
} | undefined;
|
|
15289
15316
|
partitioning?: {
|
|
15290
15317
|
enabled: boolean;
|
|
15291
|
-
strategy: "
|
|
15318
|
+
strategy: "hash" | "range" | "list";
|
|
15292
15319
|
key: string;
|
|
15293
15320
|
interval?: string | undefined;
|
|
15294
15321
|
} | undefined;
|
|
@@ -16089,7 +16116,7 @@ declare const SysApiKey: Omit<{
|
|
|
16089
16116
|
abstract: boolean;
|
|
16090
16117
|
datasource: string;
|
|
16091
16118
|
fields: Record<string, {
|
|
16092
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
16119
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
16093
16120
|
required: boolean;
|
|
16094
16121
|
searchable: boolean;
|
|
16095
16122
|
multiple: boolean;
|
|
@@ -16279,7 +16306,7 @@ declare const SysApiKey: Omit<{
|
|
|
16279
16306
|
} | undefined;
|
|
16280
16307
|
partitioning?: {
|
|
16281
16308
|
enabled: boolean;
|
|
16282
|
-
strategy: "
|
|
16309
|
+
strategy: "hash" | "range" | "list";
|
|
16283
16310
|
key: string;
|
|
16284
16311
|
interval?: string | undefined;
|
|
16285
16312
|
} | undefined;
|
|
@@ -18189,7 +18216,7 @@ declare const SysTwoFactor: Omit<{
|
|
|
18189
18216
|
abstract: boolean;
|
|
18190
18217
|
datasource: string;
|
|
18191
18218
|
fields: Record<string, {
|
|
18192
|
-
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "
|
|
18219
|
+
type: "number" | "boolean" | "select" | "date" | "file" | "email" | "url" | "image" | "password" | "time" | "code" | "json" | "tags" | "lookup" | "text" | "textarea" | "phone" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "toggle" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "vector";
|
|
18193
18220
|
required: boolean;
|
|
18194
18221
|
searchable: boolean;
|
|
18195
18222
|
multiple: boolean;
|
|
@@ -18379,7 +18406,7 @@ declare const SysTwoFactor: Omit<{
|
|
|
18379
18406
|
} | undefined;
|
|
18380
18407
|
partitioning?: {
|
|
18381
18408
|
enabled: boolean;
|
|
18382
|
-
strategy: "
|
|
18409
|
+
strategy: "hash" | "range" | "list";
|
|
18383
18410
|
key: string;
|
|
18384
18411
|
interval?: string | undefined;
|
|
18385
18412
|
} | undefined;
|