@spfn/auth 0.1.0-alpha.88 → 0.2.0-beta.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/README.md +1385 -1199
- package/dist/config.d.ts +405 -0
- package/dist/config.js +240 -0
- package/dist/config.js.map +1 -0
- package/dist/dto-81uR9gzF.d.ts +630 -0
- package/dist/errors.d.ts +196 -0
- package/dist/errors.js +173 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +273 -14
- package/dist/index.js +511 -6665
- package/dist/index.js.map +1 -1
- package/dist/nextjs/api.js +345 -0
- package/dist/nextjs/api.js.map +1 -0
- package/dist/{adapters/nextjs → nextjs}/server.d.ts +47 -65
- package/dist/nextjs/server.js +179 -0
- package/dist/nextjs/server.js.map +1 -0
- package/dist/server.d.ts +4328 -529
- package/dist/server.js +7841 -1247
- package/dist/server.js.map +1 -1
- package/migrations/{0000_skinny_christian_walker.sql → 0000_mysterious_colossus.sql} +53 -23
- package/migrations/meta/0000_snapshot.json +281 -46
- package/migrations/meta/_journal.json +2 -2
- package/package.json +31 -31
- package/dist/adapters/nextjs/api.d.ts +0 -446
- package/dist/adapters/nextjs/api.js +0 -3279
- package/dist/adapters/nextjs/api.js.map +0 -1
- package/dist/adapters/nextjs/server.js +0 -3645
- package/dist/adapters/nextjs/server.js.map +0 -1
- package/dist/lib/api/auth-codes-verify.d.ts +0 -37
- package/dist/lib/api/auth-codes-verify.js +0 -2949
- package/dist/lib/api/auth-codes-verify.js.map +0 -1
- package/dist/lib/api/auth-codes.d.ts +0 -37
- package/dist/lib/api/auth-codes.js +0 -2949
- package/dist/lib/api/auth-codes.js.map +0 -1
- package/dist/lib/api/auth-exists.d.ts +0 -38
- package/dist/lib/api/auth-exists.js +0 -2949
- package/dist/lib/api/auth-exists.js.map +0 -1
- package/dist/lib/api/auth-invitations-accept.d.ts +0 -38
- package/dist/lib/api/auth-invitations-accept.js +0 -2883
- package/dist/lib/api/auth-invitations-accept.js.map +0 -1
- package/dist/lib/api/auth-invitations-cancel.d.ts +0 -37
- package/dist/lib/api/auth-invitations-cancel.js +0 -2883
- package/dist/lib/api/auth-invitations-cancel.js.map +0 -1
- package/dist/lib/api/auth-invitations-delete.d.ts +0 -36
- package/dist/lib/api/auth-invitations-delete.js +0 -2883
- package/dist/lib/api/auth-invitations-delete.js.map +0 -1
- package/dist/lib/api/auth-invitations-resend.d.ts +0 -37
- package/dist/lib/api/auth-invitations-resend.js +0 -2883
- package/dist/lib/api/auth-invitations-resend.js.map +0 -1
- package/dist/lib/api/auth-invitations.d.ts +0 -109
- package/dist/lib/api/auth-invitations.js +0 -2887
- package/dist/lib/api/auth-invitations.js.map +0 -1
- package/dist/lib/api/auth-keys-rotate.d.ts +0 -37
- package/dist/lib/api/auth-keys-rotate.js +0 -2949
- package/dist/lib/api/auth-keys-rotate.js.map +0 -1
- package/dist/lib/api/auth-login.d.ts +0 -39
- package/dist/lib/api/auth-login.js +0 -2949
- package/dist/lib/api/auth-login.js.map +0 -1
- package/dist/lib/api/auth-logout.d.ts +0 -36
- package/dist/lib/api/auth-logout.js +0 -2949
- package/dist/lib/api/auth-logout.js.map +0 -1
- package/dist/lib/api/auth-me.d.ts +0 -50
- package/dist/lib/api/auth-me.js +0 -2949
- package/dist/lib/api/auth-me.js.map +0 -1
- package/dist/lib/api/auth-password.d.ts +0 -36
- package/dist/lib/api/auth-password.js +0 -2949
- package/dist/lib/api/auth-password.js.map +0 -1
- package/dist/lib/api/auth-register.d.ts +0 -38
- package/dist/lib/api/auth-register.js +0 -2949
- package/dist/lib/api/auth-register.js.map +0 -1
- package/dist/lib/api/index.d.ts +0 -356
- package/dist/lib/api/index.js +0 -3261
- package/dist/lib/api/index.js.map +0 -1
- package/dist/lib/config.d.ts +0 -70
- package/dist/lib/config.js +0 -64
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/contracts/auth.d.ts +0 -302
- package/dist/lib/contracts/auth.js +0 -2951
- package/dist/lib/contracts/auth.js.map +0 -1
- package/dist/lib/contracts/index.d.ts +0 -3
- package/dist/lib/contracts/index.js +0 -3190
- package/dist/lib/contracts/index.js.map +0 -1
- package/dist/lib/contracts/invitation.d.ts +0 -243
- package/dist/lib/contracts/invitation.js +0 -2883
- package/dist/lib/contracts/invitation.js.map +0 -1
- package/dist/lib/crypto.d.ts +0 -76
- package/dist/lib/crypto.js +0 -127
- package/dist/lib/crypto.js.map +0 -1
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/index.js +0 -313
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/session.d.ts +0 -68
- package/dist/lib/session.js +0 -126
- package/dist/lib/session.js.map +0 -1
- package/dist/lib/types/api.d.ts +0 -45
- package/dist/lib/types/api.js +0 -1
- package/dist/lib/types/api.js.map +0 -1
- package/dist/lib/types/index.d.ts +0 -3
- package/dist/lib/types/index.js +0 -2647
- package/dist/lib/types/index.js.map +0 -1
- package/dist/lib/types/schemas.d.ts +0 -45
- package/dist/lib/types/schemas.js +0 -2647
- package/dist/lib/types/schemas.js.map +0 -1
- package/dist/lib.js +0 -1
- package/dist/lib.js.map +0 -1
- package/dist/plugin.d.ts +0 -12
- package/dist/plugin.js +0 -9083
- package/dist/plugin.js.map +0 -1
- package/dist/server/entities/index.d.ts +0 -11
- package/dist/server/entities/index.js +0 -395
- package/dist/server/entities/index.js.map +0 -1
- package/dist/server/entities/invitations.d.ts +0 -241
- package/dist/server/entities/invitations.js +0 -184
- package/dist/server/entities/invitations.js.map +0 -1
- package/dist/server/entities/permissions.d.ts +0 -196
- package/dist/server/entities/permissions.js +0 -49
- package/dist/server/entities/permissions.js.map +0 -1
- package/dist/server/entities/role-permissions.d.ts +0 -107
- package/dist/server/entities/role-permissions.js +0 -115
- package/dist/server/entities/role-permissions.js.map +0 -1
- package/dist/server/entities/roles.d.ts +0 -196
- package/dist/server/entities/roles.js +0 -50
- package/dist/server/entities/roles.js.map +0 -1
- package/dist/server/entities/schema.d.ts +0 -14
- package/dist/server/entities/schema.js +0 -7
- package/dist/server/entities/schema.js.map +0 -1
- package/dist/server/entities/user-permissions.d.ts +0 -163
- package/dist/server/entities/user-permissions.js +0 -193
- package/dist/server/entities/user-permissions.js.map +0 -1
- package/dist/server/entities/user-public-keys.d.ts +0 -227
- package/dist/server/entities/user-public-keys.js +0 -156
- package/dist/server/entities/user-public-keys.js.map +0 -1
- package/dist/server/entities/user-social-accounts.d.ts +0 -189
- package/dist/server/entities/user-social-accounts.js +0 -149
- package/dist/server/entities/user-social-accounts.js.map +0 -1
- package/dist/server/entities/users.d.ts +0 -235
- package/dist/server/entities/users.js +0 -117
- package/dist/server/entities/users.js.map +0 -1
- package/dist/server/entities/verification-codes.d.ts +0 -191
- package/dist/server/entities/verification-codes.js +0 -49
- package/dist/server/entities/verification-codes.js.map +0 -1
- package/dist/server/routes/auth/index.d.ts +0 -10
- package/dist/server/routes/auth/index.js +0 -4460
- package/dist/server/routes/auth/index.js.map +0 -1
- package/dist/server/routes/index.d.ts +0 -6
- package/dist/server/routes/index.js +0 -6584
- package/dist/server/routes/index.js.map +0 -1
- package/dist/server/routes/invitations/index.d.ts +0 -10
- package/dist/server/routes/invitations/index.js +0 -4395
- package/dist/server/routes/invitations/index.js.map +0 -1
- /package/dist/{lib.d.ts → nextjs/api.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spfn/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Authentication, authorization, and RBAC module for SPFN",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,25 +21,25 @@
|
|
|
21
21
|
"import": "./dist/client.js",
|
|
22
22
|
"require": "./dist/client.js"
|
|
23
23
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./dist/
|
|
26
|
-
"import": "./dist/
|
|
27
|
-
"require": "./dist/
|
|
24
|
+
"./config": {
|
|
25
|
+
"types": "./dist/config.d.ts",
|
|
26
|
+
"import": "./dist/config.js",
|
|
27
|
+
"require": "./dist/config.js"
|
|
28
28
|
},
|
|
29
|
-
"./
|
|
30
|
-
"types": "./dist/
|
|
31
|
-
"import": "./dist/
|
|
32
|
-
"require": "./dist/
|
|
29
|
+
"./errors": {
|
|
30
|
+
"types": "./dist/errors.d.ts",
|
|
31
|
+
"import": "./dist/errors.js",
|
|
32
|
+
"require": "./dist/errors.js"
|
|
33
33
|
},
|
|
34
34
|
"./nextjs/api": {
|
|
35
|
-
"types": "./dist/
|
|
36
|
-
"import": "./dist/
|
|
37
|
-
"require": "./dist/
|
|
35
|
+
"types": "./dist/nextjs/api.d.ts",
|
|
36
|
+
"import": "./dist/nextjs/api.js",
|
|
37
|
+
"require": "./dist/nextjs/api.js"
|
|
38
38
|
},
|
|
39
39
|
"./nextjs/server": {
|
|
40
|
-
"types": "./dist/
|
|
41
|
-
"import": "./dist/
|
|
42
|
-
"require": "./dist/
|
|
40
|
+
"types": "./dist/nextjs/server.d.ts",
|
|
41
|
+
"import": "./dist/nextjs/server.js",
|
|
42
|
+
"require": "./dist/nextjs/server.js"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
@@ -66,66 +66,66 @@
|
|
|
66
66
|
},
|
|
67
67
|
"homepage": "https://github.com/spfn/spfn/tree/main/packages/auth#readme",
|
|
68
68
|
"spfn": {
|
|
69
|
-
"prefix": "/_auth",
|
|
70
69
|
"schemas": [
|
|
71
70
|
"./dist/server/entities/*.js"
|
|
72
71
|
],
|
|
73
|
-
"routes": {
|
|
74
|
-
"basePath": "/auth",
|
|
75
|
-
"dir": "./dist/server/routes"
|
|
76
|
-
},
|
|
77
72
|
"migrations": {
|
|
78
73
|
"dir": "./migrations"
|
|
79
74
|
},
|
|
80
75
|
"setupMessage": " 📚 Next steps:\n 1. Import auth: import { authMiddleware } from '@spfn/auth/server'\n 2. View tables: pnpm spfn db studio\n 3. API at: http://localhost:8790/_auth"
|
|
81
76
|
},
|
|
82
77
|
"dependencies": {
|
|
83
|
-
"
|
|
78
|
+
"bcryptjs": "^2.4.3",
|
|
84
79
|
"drizzle-orm": "^0.44.7",
|
|
80
|
+
"jose": "^6.1.0",
|
|
85
81
|
"jsonwebtoken": "^9.0.2",
|
|
86
82
|
"postgres": "^3.4.0",
|
|
87
|
-
"
|
|
88
|
-
"@spfn/core": "0.1.0-alpha.88"
|
|
83
|
+
"@spfn/core": "0.2.0-beta.1"
|
|
89
84
|
},
|
|
90
85
|
"devDependencies": {
|
|
91
|
-
"@types/
|
|
86
|
+
"@types/bcryptjs": "^2.4.6",
|
|
92
87
|
"@types/jsonwebtoken": "^9.0.6",
|
|
93
88
|
"@types/node": "^20.11.0",
|
|
94
89
|
"@types/react": "^19.2.2",
|
|
95
90
|
"@types/react-dom": "^19.2.2",
|
|
96
91
|
"@vitest/coverage-v8": "^4.0.6",
|
|
97
92
|
"drizzle-kit": "^0.31.6",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"next": "
|
|
93
|
+
"hono": "^4.10.6",
|
|
94
|
+
"madge": "^8.0.0",
|
|
95
|
+
"next": "16.0.7",
|
|
101
96
|
"tsup": "^8.5.0",
|
|
102
97
|
"tsx": "^4.20.6",
|
|
103
98
|
"typescript": "^5.3.3",
|
|
104
99
|
"vitest": "^4.0.6",
|
|
105
|
-
"spfn": "0.
|
|
100
|
+
"spfn": "0.2.0-beta.1"
|
|
106
101
|
},
|
|
107
102
|
"peerDependencies": {
|
|
108
|
-
"
|
|
103
|
+
"@aws-sdk/client-sns": "^3.0.0",
|
|
104
|
+
"next": "^15.0.0 || ^16.0.0"
|
|
109
105
|
},
|
|
110
106
|
"peerDependenciesMeta": {
|
|
107
|
+
"@aws-sdk/client-sns": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
111
110
|
"next": {
|
|
112
111
|
"optional": true
|
|
113
112
|
}
|
|
114
113
|
},
|
|
115
114
|
"scripts": {
|
|
116
|
-
"build": "npm run db:generate && tsup",
|
|
115
|
+
"build": "pnpm check:circular && npm run db:generate && tsup",
|
|
117
116
|
"watch": "tsup --watch",
|
|
118
117
|
"dev": "tsup --watch",
|
|
119
118
|
"type-check": "tsc --noEmit",
|
|
120
119
|
"clean": "rm -rf dist migrations",
|
|
121
120
|
"db:generate": "drizzle-kit generate",
|
|
122
121
|
"codegen": "spfn codegen run",
|
|
123
|
-
"test": "vitest",
|
|
122
|
+
"test": "vitest run",
|
|
124
123
|
"test:coverage": "vitest run --coverage",
|
|
125
124
|
"test:routes": "vitest src/server/routes",
|
|
126
125
|
"docker:test:up": "docker compose -f docker-compose.test.yml up -d",
|
|
127
126
|
"docker:test:down": "docker compose -f docker-compose.test.yml down",
|
|
128
127
|
"docker:test:logs": "docker compose -f docker-compose.test.yml logs -f",
|
|
128
|
+
"check:circular": "madge --circular --extensions ts src/",
|
|
129
129
|
"publish:alpha": "npm publish --access public --tag alpha",
|
|
130
130
|
"publish:beta": "npm publish --access public --tag beta",
|
|
131
131
|
"publish:latest": "npm publish --access public"
|
|
@@ -1,446 +0,0 @@
|
|
|
1
|
-
import { DeleteInvitationBody } from '../../lib/api/auth-invitations-delete.js';
|
|
2
|
-
export { DeleteInvitationResponse } from '../../lib/api/auth-invitations-delete.js';
|
|
3
|
-
import { ResendInvitationBody } from '../../lib/api/auth-invitations-resend.js';
|
|
4
|
-
export { ResendInvitationResponse } from '../../lib/api/auth-invitations-resend.js';
|
|
5
|
-
import { CancelInvitationBody } from '../../lib/api/auth-invitations-cancel.js';
|
|
6
|
-
export { CancelInvitationResponse } from '../../lib/api/auth-invitations-cancel.js';
|
|
7
|
-
import { AcceptInvitationBody } from '../../lib/api/auth-invitations-accept.js';
|
|
8
|
-
export { AcceptInvitationResponse } from '../../lib/api/auth-invitations-accept.js';
|
|
9
|
-
import { GetInvitationParams, CreateInvitationBody, ListInvitationsQuery } from '../../lib/api/auth-invitations.js';
|
|
10
|
-
export { CreateInvitationResponse, GetInvitationResponse, ListInvitationsResponse } from '../../lib/api/auth-invitations.js';
|
|
11
|
-
import { GetMeBody } from '../../lib/api/auth-me.js';
|
|
12
|
-
import { ChangePasswordBody } from '../../lib/api/auth-password.js';
|
|
13
|
-
export { ChangePasswordResponse } from '../../lib/api/auth-password.js';
|
|
14
|
-
export { RotateKeyResponse } from '../../lib/api/auth-keys-rotate.js';
|
|
15
|
-
export { LogoutResponse } from '../../lib/api/auth-logout.js';
|
|
16
|
-
export { LoginResponse } from '../../lib/api/auth-login.js';
|
|
17
|
-
export { RegisterResponse } from '../../lib/api/auth-register.js';
|
|
18
|
-
import { CheckAccountExistsBody } from '../../lib/api/auth-exists.js';
|
|
19
|
-
export { CheckAccountExistsResponse } from '../../lib/api/auth-exists.js';
|
|
20
|
-
import { VerifyCodeBody } from '../../lib/api/auth-codes-verify.js';
|
|
21
|
-
export { VerifyCodeResponse } from '../../lib/api/auth-codes-verify.js';
|
|
22
|
-
import { SendVerificationCodeBody } from '../../lib/api/auth-codes.js';
|
|
23
|
-
export { SendVerificationCodeResponse } from '../../lib/api/auth-codes.js';
|
|
24
|
-
export { client } from '@spfn/core/client';
|
|
25
|
-
import '@spfn/core';
|
|
26
|
-
import '../../lib/contracts/invitation.js';
|
|
27
|
-
import '@sinclair/typebox';
|
|
28
|
-
import '../../lib/contracts/auth.js';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Client-side login types (without key fields)
|
|
32
|
-
*/
|
|
33
|
-
type ClientLoginParams = {
|
|
34
|
-
body: {
|
|
35
|
-
email?: string;
|
|
36
|
-
phone?: string;
|
|
37
|
-
password: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Client-side register types (without key fields)
|
|
42
|
-
*/
|
|
43
|
-
type ClientRegisterParams = {
|
|
44
|
-
body: {
|
|
45
|
-
email?: string;
|
|
46
|
-
phone?: string;
|
|
47
|
-
password: string;
|
|
48
|
-
verificationToken: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Login with email/password
|
|
53
|
-
*
|
|
54
|
-
* Interceptor automatically generates and injects publicKey fields
|
|
55
|
-
*/
|
|
56
|
-
declare const login: (params: ClientLoginParams) => Promise<{
|
|
57
|
-
message?: string | undefined;
|
|
58
|
-
success: true;
|
|
59
|
-
data: {
|
|
60
|
-
email?: string | undefined;
|
|
61
|
-
phone?: string | undefined;
|
|
62
|
-
userId: string;
|
|
63
|
-
passwordChangeRequired: boolean;
|
|
64
|
-
};
|
|
65
|
-
} | {
|
|
66
|
-
success: false;
|
|
67
|
-
error: {
|
|
68
|
-
details?: any;
|
|
69
|
-
message: string;
|
|
70
|
-
code: string;
|
|
71
|
-
};
|
|
72
|
-
}>;
|
|
73
|
-
/**
|
|
74
|
-
* Register new account
|
|
75
|
-
*
|
|
76
|
-
* Interceptor automatically generates and injects publicKey fields
|
|
77
|
-
*/
|
|
78
|
-
declare const register: (params: ClientRegisterParams) => Promise<{
|
|
79
|
-
success: false;
|
|
80
|
-
error: {
|
|
81
|
-
details?: any;
|
|
82
|
-
message: string;
|
|
83
|
-
code: string;
|
|
84
|
-
};
|
|
85
|
-
} | {
|
|
86
|
-
message?: string | undefined;
|
|
87
|
-
success: true;
|
|
88
|
-
data: {
|
|
89
|
-
email?: string | undefined;
|
|
90
|
-
phone?: string | undefined;
|
|
91
|
-
userId: string;
|
|
92
|
-
};
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Logout current session
|
|
96
|
-
*
|
|
97
|
-
* Interceptor automatically adds JWT authentication
|
|
98
|
-
*/
|
|
99
|
-
declare const logout: () => Promise<{
|
|
100
|
-
success: false;
|
|
101
|
-
error: {
|
|
102
|
-
details?: any;
|
|
103
|
-
message: string;
|
|
104
|
-
code: string;
|
|
105
|
-
};
|
|
106
|
-
} | {
|
|
107
|
-
message?: string | undefined;
|
|
108
|
-
success: true;
|
|
109
|
-
data: {
|
|
110
|
-
success: boolean;
|
|
111
|
-
};
|
|
112
|
-
}>;
|
|
113
|
-
/**
|
|
114
|
-
* Rotate encryption keys
|
|
115
|
-
*
|
|
116
|
-
* Interceptor automatically generates new key pair and adds JWT authentication
|
|
117
|
-
*/
|
|
118
|
-
declare const rotateKey: () => Promise<{
|
|
119
|
-
success: false;
|
|
120
|
-
error: {
|
|
121
|
-
details?: any;
|
|
122
|
-
message: string;
|
|
123
|
-
code: string;
|
|
124
|
-
};
|
|
125
|
-
} | {
|
|
126
|
-
message?: string | undefined;
|
|
127
|
-
success: true;
|
|
128
|
-
data: {
|
|
129
|
-
success: boolean;
|
|
130
|
-
keyId: string;
|
|
131
|
-
};
|
|
132
|
-
}>;
|
|
133
|
-
/**
|
|
134
|
-
* Auth API collection
|
|
135
|
-
*/
|
|
136
|
-
declare const authApi: {
|
|
137
|
-
readonly login: (params: ClientLoginParams) => Promise<{
|
|
138
|
-
message?: string | undefined;
|
|
139
|
-
success: true;
|
|
140
|
-
data: {
|
|
141
|
-
email?: string | undefined;
|
|
142
|
-
phone?: string | undefined;
|
|
143
|
-
userId: string;
|
|
144
|
-
passwordChangeRequired: boolean;
|
|
145
|
-
};
|
|
146
|
-
} | {
|
|
147
|
-
success: false;
|
|
148
|
-
error: {
|
|
149
|
-
details?: any;
|
|
150
|
-
message: string;
|
|
151
|
-
code: string;
|
|
152
|
-
};
|
|
153
|
-
}>;
|
|
154
|
-
readonly register: (params: ClientRegisterParams) => Promise<{
|
|
155
|
-
success: false;
|
|
156
|
-
error: {
|
|
157
|
-
details?: any;
|
|
158
|
-
message: string;
|
|
159
|
-
code: string;
|
|
160
|
-
};
|
|
161
|
-
} | {
|
|
162
|
-
message?: string | undefined;
|
|
163
|
-
success: true;
|
|
164
|
-
data: {
|
|
165
|
-
email?: string | undefined;
|
|
166
|
-
phone?: string | undefined;
|
|
167
|
-
userId: string;
|
|
168
|
-
};
|
|
169
|
-
}>;
|
|
170
|
-
readonly logout: () => Promise<{
|
|
171
|
-
success: false;
|
|
172
|
-
error: {
|
|
173
|
-
details?: any;
|
|
174
|
-
message: string;
|
|
175
|
-
code: string;
|
|
176
|
-
};
|
|
177
|
-
} | {
|
|
178
|
-
message?: string | undefined;
|
|
179
|
-
success: true;
|
|
180
|
-
data: {
|
|
181
|
-
success: boolean;
|
|
182
|
-
};
|
|
183
|
-
}>;
|
|
184
|
-
readonly rotateKey: () => Promise<{
|
|
185
|
-
success: false;
|
|
186
|
-
error: {
|
|
187
|
-
details?: any;
|
|
188
|
-
message: string;
|
|
189
|
-
code: string;
|
|
190
|
-
};
|
|
191
|
-
} | {
|
|
192
|
-
message?: string | undefined;
|
|
193
|
-
success: true;
|
|
194
|
-
data: {
|
|
195
|
-
success: boolean;
|
|
196
|
-
keyId: string;
|
|
197
|
-
};
|
|
198
|
-
}>;
|
|
199
|
-
readonly sendVerificationCode: (options: {
|
|
200
|
-
body: SendVerificationCodeBody;
|
|
201
|
-
}) => Promise<{
|
|
202
|
-
success: false;
|
|
203
|
-
error: {
|
|
204
|
-
details?: any;
|
|
205
|
-
message: string;
|
|
206
|
-
code: string;
|
|
207
|
-
};
|
|
208
|
-
} | {
|
|
209
|
-
message?: string | undefined;
|
|
210
|
-
success: true;
|
|
211
|
-
data: {
|
|
212
|
-
success: boolean;
|
|
213
|
-
expiresAt: string;
|
|
214
|
-
};
|
|
215
|
-
}>;
|
|
216
|
-
readonly verifyCode: (options: {
|
|
217
|
-
body: VerifyCodeBody;
|
|
218
|
-
}) => Promise<{
|
|
219
|
-
success: false;
|
|
220
|
-
error: {
|
|
221
|
-
details?: any;
|
|
222
|
-
message: string;
|
|
223
|
-
code: string;
|
|
224
|
-
};
|
|
225
|
-
} | {
|
|
226
|
-
message?: string | undefined;
|
|
227
|
-
success: true;
|
|
228
|
-
data: {
|
|
229
|
-
verificationToken?: string | undefined;
|
|
230
|
-
valid: boolean;
|
|
231
|
-
};
|
|
232
|
-
}>;
|
|
233
|
-
readonly checkAccountExists: (options: {
|
|
234
|
-
body: CheckAccountExistsBody;
|
|
235
|
-
}) => Promise<{
|
|
236
|
-
success: false;
|
|
237
|
-
error: {
|
|
238
|
-
details?: any;
|
|
239
|
-
message: string;
|
|
240
|
-
code: string;
|
|
241
|
-
};
|
|
242
|
-
} | {
|
|
243
|
-
message?: string | undefined;
|
|
244
|
-
success: true;
|
|
245
|
-
data: {
|
|
246
|
-
exists: boolean;
|
|
247
|
-
identifier: string;
|
|
248
|
-
identifierType: "email" | "phone";
|
|
249
|
-
};
|
|
250
|
-
}>;
|
|
251
|
-
readonly changePassword: (options: {
|
|
252
|
-
body: ChangePasswordBody;
|
|
253
|
-
}) => Promise<{
|
|
254
|
-
success: false;
|
|
255
|
-
error: {
|
|
256
|
-
details?: any;
|
|
257
|
-
message: string;
|
|
258
|
-
code: string;
|
|
259
|
-
};
|
|
260
|
-
} | {
|
|
261
|
-
message?: string | undefined;
|
|
262
|
-
success: true;
|
|
263
|
-
data: {
|
|
264
|
-
success: boolean;
|
|
265
|
-
};
|
|
266
|
-
}>;
|
|
267
|
-
readonly getMe: (options: {
|
|
268
|
-
body: GetMeBody;
|
|
269
|
-
}) => Promise<{
|
|
270
|
-
success: false;
|
|
271
|
-
error: {
|
|
272
|
-
details?: any;
|
|
273
|
-
message: string;
|
|
274
|
-
code: string;
|
|
275
|
-
};
|
|
276
|
-
} | {
|
|
277
|
-
message?: string | undefined;
|
|
278
|
-
success: true;
|
|
279
|
-
data: {
|
|
280
|
-
email?: string | undefined;
|
|
281
|
-
phone?: string | undefined;
|
|
282
|
-
userId: string;
|
|
283
|
-
role: {
|
|
284
|
-
id: number;
|
|
285
|
-
name: string;
|
|
286
|
-
displayName: string;
|
|
287
|
-
priority: number;
|
|
288
|
-
};
|
|
289
|
-
permissions: {
|
|
290
|
-
category?: string | undefined;
|
|
291
|
-
id: number;
|
|
292
|
-
name: string;
|
|
293
|
-
displayName: string;
|
|
294
|
-
}[];
|
|
295
|
-
};
|
|
296
|
-
}>;
|
|
297
|
-
readonly getInvitation: (options: {
|
|
298
|
-
params: GetInvitationParams;
|
|
299
|
-
}) => Promise<{
|
|
300
|
-
success: false;
|
|
301
|
-
error: {
|
|
302
|
-
details?: any;
|
|
303
|
-
message: string;
|
|
304
|
-
code: string;
|
|
305
|
-
};
|
|
306
|
-
} | {
|
|
307
|
-
message?: string | undefined;
|
|
308
|
-
success: true;
|
|
309
|
-
data: {
|
|
310
|
-
metadata?: any;
|
|
311
|
-
email: string;
|
|
312
|
-
expiresAt: string;
|
|
313
|
-
role: string;
|
|
314
|
-
roleDisplayName: string;
|
|
315
|
-
invitedBy: string;
|
|
316
|
-
};
|
|
317
|
-
}>;
|
|
318
|
-
readonly createInvitation: (options: {
|
|
319
|
-
body: CreateInvitationBody;
|
|
320
|
-
}) => Promise<{
|
|
321
|
-
success: false;
|
|
322
|
-
error: {
|
|
323
|
-
details?: any;
|
|
324
|
-
message: string;
|
|
325
|
-
code: string;
|
|
326
|
-
};
|
|
327
|
-
} | {
|
|
328
|
-
message?: string | undefined;
|
|
329
|
-
success: true;
|
|
330
|
-
data: {
|
|
331
|
-
email: string;
|
|
332
|
-
expiresAt: string;
|
|
333
|
-
id: number;
|
|
334
|
-
token: string;
|
|
335
|
-
roleId: number;
|
|
336
|
-
invitationUrl: string;
|
|
337
|
-
};
|
|
338
|
-
}>;
|
|
339
|
-
readonly listInvitations: (options: {
|
|
340
|
-
query?: ListInvitationsQuery;
|
|
341
|
-
}) => Promise<{
|
|
342
|
-
success: false;
|
|
343
|
-
error: {
|
|
344
|
-
details?: any;
|
|
345
|
-
message: string;
|
|
346
|
-
code: string;
|
|
347
|
-
};
|
|
348
|
-
} | {
|
|
349
|
-
message?: string | undefined;
|
|
350
|
-
success: true;
|
|
351
|
-
data: {
|
|
352
|
-
page: number;
|
|
353
|
-
limit: number;
|
|
354
|
-
invitations: {
|
|
355
|
-
acceptedAt?: string | undefined;
|
|
356
|
-
cancelledAt?: string | undefined;
|
|
357
|
-
email: string;
|
|
358
|
-
expiresAt: string;
|
|
359
|
-
role: {
|
|
360
|
-
id: number;
|
|
361
|
-
name: string;
|
|
362
|
-
displayName: string;
|
|
363
|
-
};
|
|
364
|
-
id: number;
|
|
365
|
-
status: string;
|
|
366
|
-
inviter: {
|
|
367
|
-
email: string;
|
|
368
|
-
id: number;
|
|
369
|
-
};
|
|
370
|
-
createdAt: string;
|
|
371
|
-
}[];
|
|
372
|
-
total: number;
|
|
373
|
-
totalPages: number;
|
|
374
|
-
};
|
|
375
|
-
}>;
|
|
376
|
-
readonly acceptInvitation: (options: {
|
|
377
|
-
body: AcceptInvitationBody;
|
|
378
|
-
}) => Promise<{
|
|
379
|
-
success: false;
|
|
380
|
-
error: {
|
|
381
|
-
details?: any;
|
|
382
|
-
message: string;
|
|
383
|
-
code: string;
|
|
384
|
-
};
|
|
385
|
-
} | {
|
|
386
|
-
message?: string | undefined;
|
|
387
|
-
success: true;
|
|
388
|
-
data: {
|
|
389
|
-
email: string;
|
|
390
|
-
userId: number;
|
|
391
|
-
role: string;
|
|
392
|
-
};
|
|
393
|
-
}>;
|
|
394
|
-
readonly cancelInvitation: (options: {
|
|
395
|
-
body: CancelInvitationBody;
|
|
396
|
-
}) => Promise<{
|
|
397
|
-
success: false;
|
|
398
|
-
error: {
|
|
399
|
-
details?: any;
|
|
400
|
-
message: string;
|
|
401
|
-
code: string;
|
|
402
|
-
};
|
|
403
|
-
} | {
|
|
404
|
-
message?: string | undefined;
|
|
405
|
-
success: true;
|
|
406
|
-
data: {
|
|
407
|
-
success: boolean;
|
|
408
|
-
cancelledAt: string;
|
|
409
|
-
};
|
|
410
|
-
}>;
|
|
411
|
-
readonly resendInvitation: (options: {
|
|
412
|
-
body: ResendInvitationBody;
|
|
413
|
-
}) => Promise<{
|
|
414
|
-
success: false;
|
|
415
|
-
error: {
|
|
416
|
-
details?: any;
|
|
417
|
-
message: string;
|
|
418
|
-
code: string;
|
|
419
|
-
};
|
|
420
|
-
} | {
|
|
421
|
-
message?: string | undefined;
|
|
422
|
-
success: true;
|
|
423
|
-
data: {
|
|
424
|
-
success: boolean;
|
|
425
|
-
expiresAt: string;
|
|
426
|
-
};
|
|
427
|
-
}>;
|
|
428
|
-
readonly deleteInvitation: (options: {
|
|
429
|
-
body: DeleteInvitationBody;
|
|
430
|
-
}) => Promise<{
|
|
431
|
-
success: false;
|
|
432
|
-
error: {
|
|
433
|
-
details?: any;
|
|
434
|
-
message: string;
|
|
435
|
-
code: string;
|
|
436
|
-
};
|
|
437
|
-
} | {
|
|
438
|
-
message?: string | undefined;
|
|
439
|
-
success: true;
|
|
440
|
-
data: {
|
|
441
|
-
success: boolean;
|
|
442
|
-
};
|
|
443
|
-
}>;
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
export { AcceptInvitationBody, CancelInvitationBody, ChangePasswordBody, CheckAccountExistsBody, type ClientLoginParams, type ClientRegisterParams, CreateInvitationBody, DeleteInvitationBody, GetInvitationParams, ListInvitationsQuery, ResendInvitationBody, SendVerificationCodeBody, VerifyCodeBody, authApi, login, logout, register, rotateKey };
|