@spfn/auth 0.1.0-alpha.87 → 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.
Files changed (151) hide show
  1. package/README.md +1385 -1199
  2. package/dist/config.d.ts +405 -0
  3. package/dist/config.js +240 -0
  4. package/dist/config.js.map +1 -0
  5. package/dist/dto-81uR9gzF.d.ts +630 -0
  6. package/dist/errors.d.ts +196 -0
  7. package/dist/errors.js +173 -0
  8. package/dist/errors.js.map +1 -0
  9. package/dist/index.d.ts +273 -14
  10. package/dist/index.js +511 -6665
  11. package/dist/index.js.map +1 -1
  12. package/dist/nextjs/api.js +345 -0
  13. package/dist/nextjs/api.js.map +1 -0
  14. package/dist/{adapters/nextjs → nextjs}/server.d.ts +47 -65
  15. package/dist/nextjs/server.js +179 -0
  16. package/dist/nextjs/server.js.map +1 -0
  17. package/dist/server.d.ts +4328 -529
  18. package/dist/server.js +7841 -1247
  19. package/dist/server.js.map +1 -1
  20. package/migrations/{0000_familiar_firebrand.sql → 0000_mysterious_colossus.sql} +53 -23
  21. package/migrations/meta/0000_snapshot.json +281 -46
  22. package/migrations/meta/_journal.json +2 -2
  23. package/package.json +33 -33
  24. package/dist/adapters/nextjs/api.d.ts +0 -446
  25. package/dist/adapters/nextjs/api.js +0 -3279
  26. package/dist/adapters/nextjs/api.js.map +0 -1
  27. package/dist/adapters/nextjs/server.js +0 -3645
  28. package/dist/adapters/nextjs/server.js.map +0 -1
  29. package/dist/lib/api/auth-codes-verify.d.ts +0 -37
  30. package/dist/lib/api/auth-codes-verify.js +0 -2949
  31. package/dist/lib/api/auth-codes-verify.js.map +0 -1
  32. package/dist/lib/api/auth-codes.d.ts +0 -37
  33. package/dist/lib/api/auth-codes.js +0 -2949
  34. package/dist/lib/api/auth-codes.js.map +0 -1
  35. package/dist/lib/api/auth-exists.d.ts +0 -38
  36. package/dist/lib/api/auth-exists.js +0 -2949
  37. package/dist/lib/api/auth-exists.js.map +0 -1
  38. package/dist/lib/api/auth-invitations-accept.d.ts +0 -38
  39. package/dist/lib/api/auth-invitations-accept.js +0 -2883
  40. package/dist/lib/api/auth-invitations-accept.js.map +0 -1
  41. package/dist/lib/api/auth-invitations-cancel.d.ts +0 -37
  42. package/dist/lib/api/auth-invitations-cancel.js +0 -2883
  43. package/dist/lib/api/auth-invitations-cancel.js.map +0 -1
  44. package/dist/lib/api/auth-invitations-delete.d.ts +0 -36
  45. package/dist/lib/api/auth-invitations-delete.js +0 -2883
  46. package/dist/lib/api/auth-invitations-delete.js.map +0 -1
  47. package/dist/lib/api/auth-invitations-resend.d.ts +0 -37
  48. package/dist/lib/api/auth-invitations-resend.js +0 -2883
  49. package/dist/lib/api/auth-invitations-resend.js.map +0 -1
  50. package/dist/lib/api/auth-invitations.d.ts +0 -109
  51. package/dist/lib/api/auth-invitations.js +0 -2887
  52. package/dist/lib/api/auth-invitations.js.map +0 -1
  53. package/dist/lib/api/auth-keys-rotate.d.ts +0 -37
  54. package/dist/lib/api/auth-keys-rotate.js +0 -2949
  55. package/dist/lib/api/auth-keys-rotate.js.map +0 -1
  56. package/dist/lib/api/auth-login.d.ts +0 -39
  57. package/dist/lib/api/auth-login.js +0 -2949
  58. package/dist/lib/api/auth-login.js.map +0 -1
  59. package/dist/lib/api/auth-logout.d.ts +0 -36
  60. package/dist/lib/api/auth-logout.js +0 -2949
  61. package/dist/lib/api/auth-logout.js.map +0 -1
  62. package/dist/lib/api/auth-me.d.ts +0 -50
  63. package/dist/lib/api/auth-me.js +0 -2949
  64. package/dist/lib/api/auth-me.js.map +0 -1
  65. package/dist/lib/api/auth-password.d.ts +0 -36
  66. package/dist/lib/api/auth-password.js +0 -2949
  67. package/dist/lib/api/auth-password.js.map +0 -1
  68. package/dist/lib/api/auth-register.d.ts +0 -38
  69. package/dist/lib/api/auth-register.js +0 -2949
  70. package/dist/lib/api/auth-register.js.map +0 -1
  71. package/dist/lib/api/index.d.ts +0 -356
  72. package/dist/lib/api/index.js +0 -3261
  73. package/dist/lib/api/index.js.map +0 -1
  74. package/dist/lib/config.d.ts +0 -70
  75. package/dist/lib/config.js +0 -64
  76. package/dist/lib/config.js.map +0 -1
  77. package/dist/lib/contracts/auth.d.ts +0 -302
  78. package/dist/lib/contracts/auth.js +0 -2951
  79. package/dist/lib/contracts/auth.js.map +0 -1
  80. package/dist/lib/contracts/index.d.ts +0 -3
  81. package/dist/lib/contracts/index.js +0 -3190
  82. package/dist/lib/contracts/index.js.map +0 -1
  83. package/dist/lib/contracts/invitation.d.ts +0 -243
  84. package/dist/lib/contracts/invitation.js +0 -2883
  85. package/dist/lib/contracts/invitation.js.map +0 -1
  86. package/dist/lib/crypto.d.ts +0 -76
  87. package/dist/lib/crypto.js +0 -127
  88. package/dist/lib/crypto.js.map +0 -1
  89. package/dist/lib/index.d.ts +0 -4
  90. package/dist/lib/index.js +0 -313
  91. package/dist/lib/index.js.map +0 -1
  92. package/dist/lib/session.d.ts +0 -68
  93. package/dist/lib/session.js +0 -126
  94. package/dist/lib/session.js.map +0 -1
  95. package/dist/lib/types/api.d.ts +0 -45
  96. package/dist/lib/types/api.js +0 -1
  97. package/dist/lib/types/api.js.map +0 -1
  98. package/dist/lib/types/index.d.ts +0 -3
  99. package/dist/lib/types/index.js +0 -2647
  100. package/dist/lib/types/index.js.map +0 -1
  101. package/dist/lib/types/schemas.d.ts +0 -45
  102. package/dist/lib/types/schemas.js +0 -2647
  103. package/dist/lib/types/schemas.js.map +0 -1
  104. package/dist/lib.js +0 -1
  105. package/dist/lib.js.map +0 -1
  106. package/dist/plugin.d.ts +0 -12
  107. package/dist/plugin.js +0 -9083
  108. package/dist/plugin.js.map +0 -1
  109. package/dist/server/entities/index.d.ts +0 -11
  110. package/dist/server/entities/index.js +0 -395
  111. package/dist/server/entities/index.js.map +0 -1
  112. package/dist/server/entities/invitations.d.ts +0 -241
  113. package/dist/server/entities/invitations.js +0 -184
  114. package/dist/server/entities/invitations.js.map +0 -1
  115. package/dist/server/entities/permissions.d.ts +0 -196
  116. package/dist/server/entities/permissions.js +0 -49
  117. package/dist/server/entities/permissions.js.map +0 -1
  118. package/dist/server/entities/role-permissions.d.ts +0 -107
  119. package/dist/server/entities/role-permissions.js +0 -115
  120. package/dist/server/entities/role-permissions.js.map +0 -1
  121. package/dist/server/entities/roles.d.ts +0 -196
  122. package/dist/server/entities/roles.js +0 -50
  123. package/dist/server/entities/roles.js.map +0 -1
  124. package/dist/server/entities/schema.d.ts +0 -14
  125. package/dist/server/entities/schema.js +0 -7
  126. package/dist/server/entities/schema.js.map +0 -1
  127. package/dist/server/entities/user-permissions.d.ts +0 -163
  128. package/dist/server/entities/user-permissions.js +0 -193
  129. package/dist/server/entities/user-permissions.js.map +0 -1
  130. package/dist/server/entities/user-public-keys.d.ts +0 -227
  131. package/dist/server/entities/user-public-keys.js +0 -156
  132. package/dist/server/entities/user-public-keys.js.map +0 -1
  133. package/dist/server/entities/user-social-accounts.d.ts +0 -189
  134. package/dist/server/entities/user-social-accounts.js +0 -149
  135. package/dist/server/entities/user-social-accounts.js.map +0 -1
  136. package/dist/server/entities/users.d.ts +0 -235
  137. package/dist/server/entities/users.js +0 -117
  138. package/dist/server/entities/users.js.map +0 -1
  139. package/dist/server/entities/verification-codes.d.ts +0 -191
  140. package/dist/server/entities/verification-codes.js +0 -49
  141. package/dist/server/entities/verification-codes.js.map +0 -1
  142. package/dist/server/routes/auth/index.d.ts +0 -10
  143. package/dist/server/routes/auth/index.js +0 -4460
  144. package/dist/server/routes/auth/index.js.map +0 -1
  145. package/dist/server/routes/index.d.ts +0 -6
  146. package/dist/server/routes/index.js +0 -6584
  147. package/dist/server/routes/index.js.map +0 -1
  148. package/dist/server/routes/invitations/index.d.ts +0 -10
  149. package/dist/server/routes/invitations/index.js +0 -4395
  150. package/dist/server/routes/invitations/index.js.map +0 -1
  151. /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.1.0-alpha.87",
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
- "./lib": {
25
- "types": "./dist/lib.d.ts",
26
- "import": "./dist/lib.js",
27
- "require": "./dist/lib.js"
24
+ "./config": {
25
+ "types": "./dist/config.d.ts",
26
+ "import": "./dist/config.js",
27
+ "require": "./dist/config.js"
28
28
  },
29
- "./adapters": {
30
- "types": "./dist/adapters.d.ts",
31
- "import": "./dist/adapters.js",
32
- "require": "./dist/adapters.js"
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/adapters/nextjs/api.d.ts",
36
- "import": "./dist/adapters/nextjs/api.js",
37
- "require": "./dist/adapters/nextjs/api.js"
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/adapters/nextjs/server.d.ts",
41
- "import": "./dist/adapters/nextjs/server.js",
42
- "require": "./dist/adapters/nextjs/server.js"
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
- "bcrypt": "^6.0.0",
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
- "jose": "^6.1.0",
88
- "@spfn/core": "0.1.0-alpha.86"
83
+ "@spfn/core": "0.2.0-beta.1"
89
84
  },
90
85
  "devDependencies": {
91
- "@types/bcrypt": "^5.0.2",
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
- "glob": "^11.0.3",
99
- "hono": "^4.9.0",
100
- "next": "^15.0.0",
101
- "tsup": "^8.3.5",
102
- "tsx": "^4.19.2",
93
+ "hono": "^4.10.6",
94
+ "madge": "^8.0.0",
95
+ "next": "16.0.7",
96
+ "tsup": "^8.5.0",
97
+ "tsx": "^4.20.6",
103
98
  "typescript": "^5.3.3",
104
99
  "vitest": "^4.0.6",
105
- "spfn": "0.1.0-alpha.86"
100
+ "spfn": "0.2.0-beta.1"
106
101
  },
107
102
  "peerDependencies": {
108
- "next": ">=13.0.0"
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
- success: false;
58
- error: {
59
- details?: any;
60
- code: string;
61
- message: string;
62
- };
63
- } | {
64
- message?: string | undefined;
65
- success: true;
66
- data: {
67
- email?: string | undefined;
68
- phone?: string | undefined;
69
- userId: string;
70
- passwordChangeRequired: boolean;
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
- code: string;
83
- message: 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
- code: string;
104
- message: 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
- code: string;
123
- message: 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
- success: false;
139
- error: {
140
- details?: any;
141
- code: string;
142
- message: string;
143
- };
144
- } | {
145
- message?: string | undefined;
146
- success: true;
147
- data: {
148
- email?: string | undefined;
149
- phone?: string | undefined;
150
- userId: string;
151
- passwordChangeRequired: boolean;
152
- };
153
- }>;
154
- readonly register: (params: ClientRegisterParams) => Promise<{
155
- success: false;
156
- error: {
157
- details?: any;
158
- code: string;
159
- message: 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
- code: string;
175
- message: 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
- code: string;
189
- message: 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
- message?: string | undefined;
203
- success: true;
204
- data: {
205
- success: boolean;
206
- expiresAt: string;
207
- };
208
- } | {
209
- success: false;
210
- error: {
211
- details?: any;
212
- code: string;
213
- message: string;
214
- };
215
- }>;
216
- readonly verifyCode: (options: {
217
- body: VerifyCodeBody;
218
- }) => Promise<{
219
- success: false;
220
- error: {
221
- details?: any;
222
- code: string;
223
- message: 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
- code: string;
240
- message: 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
- code: string;
258
- message: 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
- code: string;
274
- message: 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
- code: string;
304
- message: 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
- code: string;
325
- message: 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
- code: string;
346
- message: 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
- code: string;
383
- message: 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
- code: string;
401
- message: 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
- code: string;
418
- message: 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
- code: string;
435
- message: 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 };