@sigma-auth/better-auth-plugin 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +36 -9
- package/dist/client/index.js.map +1 -1
- package/dist/payload/index.js +1 -1
- package/dist/payload/index.js.map +1 -1
- package/dist/provider/index.d.ts +282 -882
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +1 -2
- package/dist/provider/index.js.map +1 -1
- package/package.json +5 -5
package/dist/provider/index.d.ts
CHANGED
|
@@ -73,914 +73,314 @@ export interface BapOrganizationOptions {
|
|
|
73
73
|
* });
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
-
export declare const createBapOrganization: (options?: BapOrganizationOptions) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
export declare const createBapOrganization: (options?: BapOrganizationOptions) => import("better-auth/plugins").DefaultOrganizationPlugin<{
|
|
77
|
+
allowUserToCreateOrganization: boolean | ((user: User & Record<string, any>) => import("better-auth").Awaitable<boolean>);
|
|
78
|
+
organizationLimit?: (number | ((user: User & Record<string, any>) => import("better-auth").Awaitable<boolean>)) | undefined;
|
|
79
|
+
creatorRole: string;
|
|
80
|
+
membershipLimit: number | ((user: User, organization: import("better-auth/plugins").Organization) => Promise<number> | number);
|
|
81
|
+
ac?: import("better-auth/plugins").AccessControl | undefined;
|
|
82
|
+
roles?: { [key in string]?: import("better-auth/plugins").Role<any>; } | undefined;
|
|
83
|
+
dynamicAccessControl?: {
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
maximumRolesPerOrganization?: number | ((organizationId: string) => import("better-auth").Awaitable<number>);
|
|
86
|
+
} | undefined;
|
|
87
|
+
teams?: {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
defaultTeam?: {
|
|
90
90
|
enabled: boolean;
|
|
91
|
-
|
|
92
|
-
enabled: boolean;
|
|
93
|
-
customCreateDefaultTeam?: (organization: import("better-auth/plugins").Organization & Record<string, any>, ctx?: import("better-auth").GenericEndpointContext) => Promise<import("better-auth/plugins").Team & Record<string, any>>;
|
|
94
|
-
};
|
|
95
|
-
maximumTeams?: ((data: {
|
|
96
|
-
organizationId: string;
|
|
97
|
-
session: {
|
|
98
|
-
user: User;
|
|
99
|
-
session: import("better-auth").Session;
|
|
100
|
-
} | null;
|
|
101
|
-
}, ctx?: import("better-auth").GenericEndpointContext) => import("better-auth").Awaitable<number>) | number;
|
|
102
|
-
maximumMembersPerTeam?: number | ((data: {
|
|
103
|
-
teamId: string;
|
|
104
|
-
session: {
|
|
105
|
-
user: User;
|
|
106
|
-
session: import("better-auth").Session;
|
|
107
|
-
};
|
|
108
|
-
organizationId: string;
|
|
109
|
-
}) => import("better-auth").Awaitable<number>) | undefined;
|
|
110
|
-
allowRemovingAllTeams?: boolean;
|
|
91
|
+
customCreateDefaultTeam?: (organization: import("better-auth/plugins").Organization & Record<string, any>, ctx?: import("better-auth").GenericEndpointContext) => Promise<import("better-auth/plugins").Team & Record<string, any>>;
|
|
111
92
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
116
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
117
|
-
}, ctx: import("better-auth").AuthContext) => import("better-auth").Awaitable<number>) | undefined;
|
|
118
|
-
cancelPendingInvitationsOnReInvite?: boolean | undefined;
|
|
119
|
-
requireEmailVerificationOnInvitation?: boolean | undefined;
|
|
120
|
-
sendInvitationEmail: (data: {
|
|
121
|
-
id: string;
|
|
122
|
-
role: string;
|
|
123
|
-
email: string;
|
|
124
|
-
organization: import("better-auth/plugins").Organization;
|
|
125
|
-
invitation: import("better-auth/plugins").Invitation;
|
|
126
|
-
inviter: import("better-auth/plugins").Member & {
|
|
127
|
-
user: User;
|
|
128
|
-
};
|
|
129
|
-
}, request?: Request) => Promise<void>;
|
|
130
|
-
schema?: {
|
|
131
|
-
session?: {
|
|
132
|
-
fields?: {
|
|
133
|
-
activeOrganizationId?: string;
|
|
134
|
-
activeTeamId?: string;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
organization?: {
|
|
138
|
-
modelName?: string;
|
|
139
|
-
fields?: { [key in keyof Omit<import("better-auth/plugins").Organization, "id">]?: string; };
|
|
140
|
-
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
141
|
-
};
|
|
142
|
-
member?: {
|
|
143
|
-
modelName?: string;
|
|
144
|
-
fields?: { [key in keyof Omit<import("better-auth/plugins").Member, "id">]?: string; };
|
|
145
|
-
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
146
|
-
};
|
|
147
|
-
invitation?: {
|
|
148
|
-
modelName?: string;
|
|
149
|
-
fields?: { [key in keyof Omit<import("better-auth/plugins").Invitation, "id">]?: string; };
|
|
150
|
-
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
151
|
-
};
|
|
152
|
-
team?: {
|
|
153
|
-
modelName?: string;
|
|
154
|
-
fields?: { [key in keyof Omit<import("better-auth/plugins").Team, "id">]?: string; };
|
|
155
|
-
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
156
|
-
};
|
|
157
|
-
teamMember?: {
|
|
158
|
-
modelName?: string;
|
|
159
|
-
fields?: { [key in keyof Omit<import("better-auth/plugins").TeamMember, "id">]?: string; };
|
|
160
|
-
};
|
|
161
|
-
organizationRole?: {
|
|
162
|
-
modelName?: string;
|
|
163
|
-
fields?: { [key in keyof Omit<import("better-auth/plugins").OrganizationRole, "id">]?: string; };
|
|
164
|
-
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
165
|
-
};
|
|
166
|
-
} | undefined;
|
|
167
|
-
disableOrganizationDeletion?: boolean | undefined;
|
|
168
|
-
organizationDeletion?: {
|
|
169
|
-
disabled?: boolean;
|
|
170
|
-
beforeDelete?: (data: {
|
|
171
|
-
organization: import("better-auth/plugins").Organization;
|
|
93
|
+
maximumTeams?: ((data: {
|
|
94
|
+
organizationId: string;
|
|
95
|
+
session: {
|
|
172
96
|
user: User;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
97
|
+
session: import("better-auth").Session;
|
|
98
|
+
} | null;
|
|
99
|
+
}, ctx?: import("better-auth").GenericEndpointContext) => import("better-auth").Awaitable<number>) | number;
|
|
100
|
+
maximumMembersPerTeam?: number | ((data: {
|
|
101
|
+
teamId: string;
|
|
102
|
+
session: {
|
|
176
103
|
user: User;
|
|
177
|
-
|
|
178
|
-
} | undefined;
|
|
179
|
-
organizationCreation?: {
|
|
180
|
-
disabled?: boolean;
|
|
181
|
-
beforeCreate?: (data: {
|
|
182
|
-
organization: Omit<import("better-auth/plugins").Organization, "id"> & Record<string, any>;
|
|
183
|
-
user: User & Record<string, any>;
|
|
184
|
-
}, request?: Request) => Promise<void | {
|
|
185
|
-
data: Record<string, any>;
|
|
186
|
-
}>;
|
|
187
|
-
afterCreate?: (data: {
|
|
188
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
189
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
190
|
-
user: User & Record<string, any>;
|
|
191
|
-
}, request?: Request) => Promise<void>;
|
|
192
|
-
} | undefined;
|
|
193
|
-
organizationHooks?: {
|
|
194
|
-
beforeCreateOrganization?: (data: {
|
|
195
|
-
organization: {
|
|
196
|
-
name?: string;
|
|
197
|
-
slug?: string;
|
|
198
|
-
logo?: string;
|
|
199
|
-
metadata?: Record<string, any>;
|
|
200
|
-
[key: string]: any;
|
|
201
|
-
};
|
|
202
|
-
user: User & Record<string, any>;
|
|
203
|
-
}) => Promise<void | {
|
|
204
|
-
data: Record<string, any>;
|
|
205
|
-
}>;
|
|
206
|
-
afterCreateOrganization?: (data: {
|
|
207
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
208
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
209
|
-
user: User & Record<string, any>;
|
|
210
|
-
}) => Promise<void>;
|
|
211
|
-
beforeUpdateOrganization?: (data: {
|
|
212
|
-
organization: {
|
|
213
|
-
name?: string;
|
|
214
|
-
slug?: string;
|
|
215
|
-
logo?: string;
|
|
216
|
-
metadata?: Record<string, any>;
|
|
217
|
-
[key: string]: any;
|
|
218
|
-
};
|
|
219
|
-
user: User & Record<string, any>;
|
|
220
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
221
|
-
}) => Promise<void | {
|
|
222
|
-
data: {
|
|
223
|
-
name?: string;
|
|
224
|
-
slug?: string;
|
|
225
|
-
logo?: string;
|
|
226
|
-
metadata?: Record<string, any>;
|
|
227
|
-
[key: string]: any;
|
|
228
|
-
};
|
|
229
|
-
}>;
|
|
230
|
-
afterUpdateOrganization?: (data: {
|
|
231
|
-
organization: (import("better-auth/plugins").Organization & Record<string, any>) | null;
|
|
232
|
-
user: User & Record<string, any>;
|
|
233
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
234
|
-
}) => Promise<void>;
|
|
235
|
-
beforeDeleteOrganization?: (data: {
|
|
236
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
237
|
-
user: User & Record<string, any>;
|
|
238
|
-
}) => Promise<void>;
|
|
239
|
-
afterDeleteOrganization?: (data: {
|
|
240
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
241
|
-
user: User & Record<string, any>;
|
|
242
|
-
}) => Promise<void>;
|
|
243
|
-
beforeAddMember?: (data: {
|
|
244
|
-
member: {
|
|
245
|
-
userId: string;
|
|
246
|
-
organizationId: string;
|
|
247
|
-
role: string;
|
|
248
|
-
[key: string]: any;
|
|
249
|
-
};
|
|
250
|
-
user: User & Record<string, any>;
|
|
251
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
252
|
-
}) => Promise<void | {
|
|
253
|
-
data: Record<string, any>;
|
|
254
|
-
}>;
|
|
255
|
-
afterAddMember?: (data: {
|
|
256
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
257
|
-
user: User & Record<string, any>;
|
|
258
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
259
|
-
}) => Promise<void>;
|
|
260
|
-
beforeRemoveMember?: (data: {
|
|
261
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
262
|
-
user: User & Record<string, any>;
|
|
263
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
264
|
-
}) => Promise<void>;
|
|
265
|
-
afterRemoveMember?: (data: {
|
|
266
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
267
|
-
user: User & Record<string, any>;
|
|
268
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
269
|
-
}) => Promise<void>;
|
|
270
|
-
beforeUpdateMemberRole?: (data: {
|
|
271
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
272
|
-
newRole: string;
|
|
273
|
-
user: User & Record<string, any>;
|
|
274
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
275
|
-
}) => Promise<void | {
|
|
276
|
-
data: {
|
|
277
|
-
role: string;
|
|
278
|
-
[key: string]: any;
|
|
279
|
-
};
|
|
280
|
-
}>;
|
|
281
|
-
afterUpdateMemberRole?: (data: {
|
|
282
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
283
|
-
previousRole: string;
|
|
284
|
-
user: User & Record<string, any>;
|
|
285
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
286
|
-
}) => Promise<void>;
|
|
287
|
-
beforeCreateInvitation?: (data: {
|
|
288
|
-
invitation: {
|
|
289
|
-
email: string;
|
|
290
|
-
role: string;
|
|
291
|
-
organizationId: string;
|
|
292
|
-
inviterId: string;
|
|
293
|
-
teamId?: string;
|
|
294
|
-
[key: string]: any;
|
|
295
|
-
};
|
|
296
|
-
inviter: User & Record<string, any>;
|
|
297
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
298
|
-
}) => Promise<void | {
|
|
299
|
-
data: Record<string, any>;
|
|
300
|
-
}>;
|
|
301
|
-
afterCreateInvitation?: (data: {
|
|
302
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
303
|
-
inviter: User & Record<string, any>;
|
|
304
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
305
|
-
}) => Promise<void>;
|
|
306
|
-
beforeAcceptInvitation?: (data: {
|
|
307
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
308
|
-
user: User & Record<string, any>;
|
|
309
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
310
|
-
}) => Promise<void>;
|
|
311
|
-
afterAcceptInvitation?: (data: {
|
|
312
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
313
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
314
|
-
user: User & Record<string, any>;
|
|
315
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
316
|
-
}) => Promise<void>;
|
|
317
|
-
beforeRejectInvitation?: (data: {
|
|
318
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
319
|
-
user: User & Record<string, any>;
|
|
320
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
321
|
-
}) => Promise<void>;
|
|
322
|
-
afterRejectInvitation?: (data: {
|
|
323
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
324
|
-
user: User & Record<string, any>;
|
|
325
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
326
|
-
}) => Promise<void>;
|
|
327
|
-
beforeCancelInvitation?: (data: {
|
|
328
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
329
|
-
cancelledBy: User & Record<string, any>;
|
|
330
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
331
|
-
}) => Promise<void>;
|
|
332
|
-
afterCancelInvitation?: (data: {
|
|
333
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
334
|
-
cancelledBy: User & Record<string, any>;
|
|
335
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
336
|
-
}) => Promise<void>;
|
|
337
|
-
beforeCreateTeam?: (data: {
|
|
338
|
-
team: {
|
|
339
|
-
name: string;
|
|
340
|
-
organizationId: string;
|
|
341
|
-
[key: string]: any;
|
|
342
|
-
};
|
|
343
|
-
user?: User & Record<string, any>;
|
|
344
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
345
|
-
}) => Promise<void | {
|
|
346
|
-
data: Record<string, any>;
|
|
347
|
-
}>;
|
|
348
|
-
afterCreateTeam?: (data: {
|
|
349
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
350
|
-
user?: User & Record<string, any>;
|
|
351
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
352
|
-
}) => Promise<void>;
|
|
353
|
-
beforeUpdateTeam?: (data: {
|
|
354
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
355
|
-
updates: {
|
|
356
|
-
name?: string;
|
|
357
|
-
[key: string]: any;
|
|
358
|
-
};
|
|
359
|
-
user: User & Record<string, any>;
|
|
360
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
361
|
-
}) => Promise<void | {
|
|
362
|
-
data: Record<string, any>;
|
|
363
|
-
}>;
|
|
364
|
-
afterUpdateTeam?: (data: {
|
|
365
|
-
team: (import("better-auth/plugins").Team & Record<string, any>) | null;
|
|
366
|
-
user: User & Record<string, any>;
|
|
367
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
368
|
-
}) => Promise<void>;
|
|
369
|
-
beforeDeleteTeam?: (data: {
|
|
370
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
371
|
-
user?: User & Record<string, any>;
|
|
372
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
373
|
-
}) => Promise<void>;
|
|
374
|
-
afterDeleteTeam?: (data: {
|
|
375
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
376
|
-
user?: User & Record<string, any>;
|
|
377
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
378
|
-
}) => Promise<void>;
|
|
379
|
-
beforeAddTeamMember?: (data: {
|
|
380
|
-
teamMember: {
|
|
381
|
-
teamId: string;
|
|
382
|
-
userId: string;
|
|
383
|
-
[key: string]: any;
|
|
384
|
-
};
|
|
385
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
386
|
-
user: User & Record<string, any>;
|
|
387
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
388
|
-
}) => Promise<void | {
|
|
389
|
-
data: Record<string, any>;
|
|
390
|
-
}>;
|
|
391
|
-
afterAddTeamMember?: (data: {
|
|
392
|
-
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
393
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
394
|
-
user: User & Record<string, any>;
|
|
395
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
396
|
-
}) => Promise<void>;
|
|
397
|
-
beforeRemoveTeamMember?: (data: {
|
|
398
|
-
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
399
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
400
|
-
user: User & Record<string, any>;
|
|
401
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
402
|
-
}) => Promise<void>;
|
|
403
|
-
afterRemoveTeamMember?: (data: {
|
|
404
|
-
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
405
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
406
|
-
user: User & Record<string, any>;
|
|
407
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
408
|
-
}) => Promise<void>;
|
|
409
|
-
} | undefined;
|
|
410
|
-
}>;
|
|
411
|
-
schema: {
|
|
412
|
-
organization: {
|
|
413
|
-
modelName: string;
|
|
414
|
-
fields: {
|
|
415
|
-
name: {
|
|
416
|
-
type: "string";
|
|
417
|
-
required: true;
|
|
418
|
-
sortable: true;
|
|
419
|
-
};
|
|
420
|
-
slug: {
|
|
421
|
-
type: "string";
|
|
422
|
-
required: true;
|
|
423
|
-
unique: true;
|
|
424
|
-
sortable: true;
|
|
425
|
-
};
|
|
426
|
-
logo: {
|
|
427
|
-
type: "string";
|
|
428
|
-
required: false;
|
|
429
|
-
};
|
|
430
|
-
createdAt: {
|
|
431
|
-
type: "date";
|
|
432
|
-
required: true;
|
|
433
|
-
};
|
|
434
|
-
updatedAt: {
|
|
435
|
-
type: "date";
|
|
436
|
-
required: false;
|
|
437
|
-
};
|
|
104
|
+
session: import("better-auth").Session;
|
|
438
105
|
};
|
|
106
|
+
organizationId: string;
|
|
107
|
+
}) => import("better-auth").Awaitable<number>) | undefined;
|
|
108
|
+
allowRemovingAllTeams?: boolean;
|
|
109
|
+
};
|
|
110
|
+
invitationExpiresIn?: number | undefined;
|
|
111
|
+
invitationLimit?: number | ((data: {
|
|
112
|
+
user: User & Record<string, any>;
|
|
113
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
114
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
115
|
+
}, ctx: import("better-auth").AuthContext) => import("better-auth").Awaitable<number>) | undefined;
|
|
116
|
+
cancelPendingInvitationsOnReInvite?: boolean | undefined;
|
|
117
|
+
requireEmailVerificationOnInvitation?: boolean | undefined;
|
|
118
|
+
sendInvitationEmail: (data: {
|
|
119
|
+
id: string;
|
|
120
|
+
role: string;
|
|
121
|
+
email: string;
|
|
122
|
+
organization: import("better-auth/plugins").Organization;
|
|
123
|
+
invitation: import("better-auth/plugins").Invitation;
|
|
124
|
+
inviter: import("better-auth/plugins").Member & {
|
|
125
|
+
user: User;
|
|
439
126
|
};
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
references: {
|
|
447
|
-
model: "organization";
|
|
448
|
-
field: "id";
|
|
449
|
-
};
|
|
450
|
-
};
|
|
451
|
-
userId: {
|
|
452
|
-
type: "string";
|
|
453
|
-
required: true;
|
|
454
|
-
references: {
|
|
455
|
-
model: "user";
|
|
456
|
-
field: "id";
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
|
-
role: {
|
|
460
|
-
type: "string";
|
|
461
|
-
required: true;
|
|
462
|
-
defaultValue: "member";
|
|
463
|
-
};
|
|
464
|
-
createdAt: {
|
|
465
|
-
type: "date";
|
|
466
|
-
required: true;
|
|
467
|
-
};
|
|
127
|
+
}, request?: Request) => Promise<void>;
|
|
128
|
+
schema?: {
|
|
129
|
+
session?: {
|
|
130
|
+
fields?: {
|
|
131
|
+
activeOrganizationId?: string;
|
|
132
|
+
activeTeamId?: string;
|
|
468
133
|
};
|
|
469
134
|
};
|
|
470
|
-
|
|
471
|
-
modelName
|
|
472
|
-
fields
|
|
473
|
-
|
|
474
|
-
type: "string";
|
|
475
|
-
required: true;
|
|
476
|
-
references: {
|
|
477
|
-
model: "organization";
|
|
478
|
-
field: "id";
|
|
479
|
-
};
|
|
480
|
-
};
|
|
481
|
-
email: {
|
|
482
|
-
type: "string";
|
|
483
|
-
required: true;
|
|
484
|
-
sortable: true;
|
|
485
|
-
};
|
|
486
|
-
role: {
|
|
487
|
-
type: "string";
|
|
488
|
-
required: true;
|
|
489
|
-
sortable: true;
|
|
490
|
-
};
|
|
491
|
-
status: {
|
|
492
|
-
type: "string";
|
|
493
|
-
required: true;
|
|
494
|
-
sortable: true;
|
|
495
|
-
defaultValue: "pending";
|
|
496
|
-
};
|
|
497
|
-
expiresAt: {
|
|
498
|
-
type: "date";
|
|
499
|
-
required: false;
|
|
500
|
-
};
|
|
501
|
-
createdAt: {
|
|
502
|
-
type: "date";
|
|
503
|
-
required: true;
|
|
504
|
-
defaultValue: Date;
|
|
505
|
-
};
|
|
506
|
-
inviterId: {
|
|
507
|
-
type: "string";
|
|
508
|
-
required: true;
|
|
509
|
-
references: {
|
|
510
|
-
model: "user";
|
|
511
|
-
field: "id";
|
|
512
|
-
};
|
|
513
|
-
};
|
|
514
|
-
};
|
|
135
|
+
organization?: {
|
|
136
|
+
modelName?: string;
|
|
137
|
+
fields?: { [key in keyof Omit<import("better-auth/plugins").Organization, "id">]?: string; };
|
|
138
|
+
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
515
139
|
};
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
required: false;
|
|
521
|
-
};
|
|
522
|
-
};
|
|
140
|
+
member?: {
|
|
141
|
+
modelName?: string;
|
|
142
|
+
fields?: { [key in keyof Omit<import("better-auth/plugins").Member, "id">]?: string; };
|
|
143
|
+
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
523
144
|
};
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
name: string;
|
|
529
|
-
slug: string;
|
|
530
|
-
createdAt: Date;
|
|
531
|
-
logo?: string | null | undefined;
|
|
532
|
-
metadata?: any;
|
|
145
|
+
invitation?: {
|
|
146
|
+
modelName?: string;
|
|
147
|
+
fields?: { [key in keyof Omit<import("better-auth/plugins").Invitation, "id">]?: string; };
|
|
148
|
+
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
533
149
|
};
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
role: "admin" | "owner" | "member";
|
|
539
|
-
status: import("better-auth/plugins").InvitationStatus;
|
|
540
|
-
inviterId: string;
|
|
541
|
-
expiresAt: Date;
|
|
542
|
-
createdAt: Date;
|
|
150
|
+
team?: {
|
|
151
|
+
modelName?: string;
|
|
152
|
+
fields?: { [key in keyof Omit<import("better-auth/plugins").Team, "id">]?: string; };
|
|
153
|
+
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
543
154
|
};
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
role: "admin" | "owner" | "member";
|
|
548
|
-
createdAt: Date;
|
|
549
|
-
userId: string;
|
|
550
|
-
user: {
|
|
551
|
-
id: string;
|
|
552
|
-
email: string;
|
|
553
|
-
name: string;
|
|
554
|
-
image?: string | undefined;
|
|
555
|
-
};
|
|
155
|
+
teamMember?: {
|
|
156
|
+
modelName?: string;
|
|
157
|
+
fields?: { [key in keyof Omit<import("better-auth/plugins").TeamMember, "id">]?: string; };
|
|
556
158
|
};
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
id: string;
|
|
562
|
-
organizationId: string;
|
|
563
|
-
role: "admin" | "owner" | "member";
|
|
564
|
-
createdAt: Date;
|
|
565
|
-
userId: string;
|
|
566
|
-
user: {
|
|
567
|
-
id: string;
|
|
568
|
-
email: string;
|
|
569
|
-
name: string;
|
|
570
|
-
image?: string | undefined;
|
|
571
|
-
};
|
|
572
|
-
}[];
|
|
573
|
-
invitations: {
|
|
574
|
-
id: string;
|
|
575
|
-
organizationId: string;
|
|
576
|
-
email: string;
|
|
577
|
-
role: "admin" | "owner" | "member";
|
|
578
|
-
status: import("better-auth/plugins").InvitationStatus;
|
|
579
|
-
inviterId: string;
|
|
580
|
-
expiresAt: Date;
|
|
581
|
-
createdAt: Date;
|
|
582
|
-
}[];
|
|
583
|
-
} & {
|
|
584
|
-
id: string;
|
|
585
|
-
name: string;
|
|
586
|
-
slug: string;
|
|
587
|
-
createdAt: Date;
|
|
588
|
-
logo?: string | null | undefined;
|
|
589
|
-
metadata?: any;
|
|
159
|
+
organizationRole?: {
|
|
160
|
+
modelName?: string;
|
|
161
|
+
fields?: { [key in keyof Omit<import("better-auth/plugins").OrganizationRole, "id">]?: string; };
|
|
162
|
+
additionalFields?: { [key in string]: import("better-auth").DBFieldAttribute; };
|
|
590
163
|
};
|
|
591
|
-
};
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
readonly NO_ACTIVE_ORGANIZATION: "No active organization";
|
|
602
|
-
readonly USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization";
|
|
603
|
-
readonly MEMBER_NOT_FOUND: "Member not found";
|
|
604
|
-
readonly ROLE_NOT_FOUND: "Role not found";
|
|
605
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: "You are not allowed to create a new team";
|
|
606
|
-
readonly TEAM_ALREADY_EXISTS: "Team already exists";
|
|
607
|
-
readonly TEAM_NOT_FOUND: "Team not found";
|
|
608
|
-
readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner";
|
|
609
|
-
readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: "You cannot leave the organization without an owner";
|
|
610
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member";
|
|
611
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization";
|
|
612
|
-
readonly USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization";
|
|
613
|
-
readonly INVITATION_NOT_FOUND: "Invitation not found";
|
|
614
|
-
readonly YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation";
|
|
615
|
-
readonly EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: "Email verification required before accepting or rejecting invitation";
|
|
616
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation";
|
|
617
|
-
readonly INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization";
|
|
618
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "You are not allowed to invite a user with this role";
|
|
619
|
-
readonly FAILED_TO_RETRIEVE_INVITATION: "Failed to retrieve invitation";
|
|
620
|
-
readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: "You have reached the maximum number of teams";
|
|
621
|
-
readonly UNABLE_TO_REMOVE_LAST_TEAM: "Unable to remove last team";
|
|
622
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: "You are not allowed to update this member";
|
|
623
|
-
readonly ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: "Organization membership limit reached";
|
|
624
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to create teams in this organization";
|
|
625
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to delete teams in this organization";
|
|
626
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: "You are not allowed to update this team";
|
|
627
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: "You are not allowed to delete this team";
|
|
628
|
-
readonly INVITATION_LIMIT_REACHED: "Invitation limit reached";
|
|
629
|
-
readonly TEAM_MEMBER_LIMIT_REACHED: "Team member limit reached";
|
|
630
|
-
readonly USER_IS_NOT_A_MEMBER_OF_THE_TEAM: "User is not a member of the team";
|
|
631
|
-
readonly YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: "You are not allowed to list the members of this team";
|
|
632
|
-
readonly YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: "You do not have an active team";
|
|
633
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: "You are not allowed to create a new member";
|
|
634
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: "You are not allowed to remove a team member";
|
|
635
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: "You are not allowed to access this organization as an owner";
|
|
636
|
-
readonly YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: "You are not a member of this organization";
|
|
637
|
-
readonly MISSING_AC_INSTANCE: "Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information";
|
|
638
|
-
readonly YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: "You must be in an organization to create a role";
|
|
639
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: "You are not allowed to create a role";
|
|
640
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: "You are not allowed to update a role";
|
|
641
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: "You are not allowed to delete a role";
|
|
642
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: "You are not allowed to read a role";
|
|
643
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: "You are not allowed to list a role";
|
|
644
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: "You are not allowed to get a role";
|
|
645
|
-
readonly TOO_MANY_ROLES: "This organization has too many roles";
|
|
646
|
-
readonly INVALID_RESOURCE: "The provided permission includes an invalid resource";
|
|
647
|
-
readonly ROLE_NAME_IS_ALREADY_TAKEN: "That role name is already taken";
|
|
648
|
-
readonly CANNOT_DELETE_A_PRE_DEFINED_ROLE: "Cannot delete a pre-defined role";
|
|
649
|
-
};
|
|
650
|
-
options: NoInfer<{
|
|
651
|
-
allowUserToCreateOrganization: boolean | ((user: User & Record<string, any>) => import("better-auth").Awaitable<boolean>);
|
|
652
|
-
organizationLimit?: (number | ((user: User & Record<string, any>) => import("better-auth").Awaitable<boolean>)) | undefined;
|
|
653
|
-
creatorRole: string;
|
|
654
|
-
membershipLimit: number;
|
|
655
|
-
ac?: import("better-auth/plugins").AccessControl | undefined;
|
|
656
|
-
roles?: { [key in string]?: import("better-auth/plugins").Role<any>; } | undefined;
|
|
657
|
-
dynamicAccessControl?: {
|
|
658
|
-
enabled?: boolean;
|
|
659
|
-
maximumRolesPerOrganization?: number | ((organizationId: string) => import("better-auth").Awaitable<number>);
|
|
660
|
-
} | undefined;
|
|
661
|
-
teams?: {
|
|
662
|
-
enabled: boolean;
|
|
663
|
-
defaultTeam?: {
|
|
664
|
-
enabled: boolean;
|
|
665
|
-
customCreateDefaultTeam?: (organization: import("better-auth/plugins").Organization & Record<string, any>, ctx?: import("better-auth").GenericEndpointContext) => Promise<import("better-auth/plugins").Team & Record<string, any>>;
|
|
164
|
+
} | undefined;
|
|
165
|
+
disableOrganizationDeletion?: boolean | undefined;
|
|
166
|
+
organizationHooks?: {
|
|
167
|
+
beforeCreateOrganization?: (data: {
|
|
168
|
+
organization: {
|
|
169
|
+
name?: string;
|
|
170
|
+
slug?: string;
|
|
171
|
+
logo?: string;
|
|
172
|
+
metadata?: Record<string, any>;
|
|
173
|
+
[key: string]: any;
|
|
666
174
|
};
|
|
667
|
-
maximumTeams?: ((data: {
|
|
668
|
-
organizationId: string;
|
|
669
|
-
session: {
|
|
670
|
-
user: User;
|
|
671
|
-
session: import("better-auth").Session;
|
|
672
|
-
} | null;
|
|
673
|
-
}, ctx?: import("better-auth").GenericEndpointContext) => import("better-auth").Awaitable<number>) | number;
|
|
674
|
-
maximumMembersPerTeam?: number | ((data: {
|
|
675
|
-
teamId: string;
|
|
676
|
-
session: {
|
|
677
|
-
user: User;
|
|
678
|
-
session: import("better-auth").Session;
|
|
679
|
-
};
|
|
680
|
-
organizationId: string;
|
|
681
|
-
}) => import("better-auth").Awaitable<number>) | undefined;
|
|
682
|
-
allowRemovingAllTeams?: boolean;
|
|
683
|
-
};
|
|
684
|
-
invitationExpiresIn?: number | undefined;
|
|
685
|
-
invitationLimit?: number | ((data: {
|
|
686
175
|
user: User & Record<string, any>;
|
|
176
|
+
}) => Promise<void | {
|
|
177
|
+
data: Record<string, any>;
|
|
178
|
+
}>;
|
|
179
|
+
afterCreateOrganization?: (data: {
|
|
687
180
|
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
688
181
|
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
inviter: import("better-auth/plugins").Member & {
|
|
699
|
-
user: User;
|
|
182
|
+
user: User & Record<string, any>;
|
|
183
|
+
}) => Promise<void>;
|
|
184
|
+
beforeUpdateOrganization?: (data: {
|
|
185
|
+
organization: {
|
|
186
|
+
name?: string;
|
|
187
|
+
slug?: string;
|
|
188
|
+
logo?: string;
|
|
189
|
+
metadata?: Record<string, any>;
|
|
190
|
+
[key: string]: any;
|
|
700
191
|
};
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
192
|
+
user: User & Record<string, any>;
|
|
193
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
194
|
+
}) => Promise<void | {
|
|
195
|
+
data: {
|
|
196
|
+
name?: string;
|
|
197
|
+
slug?: string;
|
|
198
|
+
logo?: string;
|
|
199
|
+
metadata?: Record<string, any>;
|
|
200
|
+
[key: string]: any;
|
|
708
201
|
};
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
202
|
+
}>;
|
|
203
|
+
afterUpdateOrganization?: (data: {
|
|
204
|
+
organization: (import("better-auth/plugins").Organization & Record<string, any>) | null;
|
|
205
|
+
user: User & Record<string, any>;
|
|
206
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
207
|
+
}) => Promise<void>;
|
|
208
|
+
beforeDeleteOrganization?: (data: {
|
|
209
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
210
|
+
user: User & Record<string, any>;
|
|
211
|
+
}) => Promise<void>;
|
|
212
|
+
afterDeleteOrganization?: (data: {
|
|
213
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
214
|
+
user: User & Record<string, any>;
|
|
215
|
+
}) => Promise<void>;
|
|
216
|
+
beforeAddMember?: (data: {
|
|
217
|
+
member: {
|
|
218
|
+
userId: string;
|
|
219
|
+
organizationId: string;
|
|
220
|
+
role: string;
|
|
221
|
+
[key: string]: any;
|
|
713
222
|
};
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
223
|
+
user: User & Record<string, any>;
|
|
224
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
225
|
+
}) => Promise<void | {
|
|
226
|
+
data: Record<string, any>;
|
|
227
|
+
}>;
|
|
228
|
+
afterAddMember?: (data: {
|
|
229
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
230
|
+
user: User & Record<string, any>;
|
|
231
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
232
|
+
}) => Promise<void>;
|
|
233
|
+
beforeRemoveMember?: (data: {
|
|
234
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
235
|
+
user: User & Record<string, any>;
|
|
236
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
237
|
+
}) => Promise<void>;
|
|
238
|
+
afterRemoveMember?: (data: {
|
|
239
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
240
|
+
user: User & Record<string, any>;
|
|
241
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
242
|
+
}) => Promise<void>;
|
|
243
|
+
beforeUpdateMemberRole?: (data: {
|
|
244
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
245
|
+
newRole: string;
|
|
246
|
+
user: User & Record<string, any>;
|
|
247
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
248
|
+
}) => Promise<void | {
|
|
249
|
+
data: {
|
|
250
|
+
role: string;
|
|
251
|
+
[key: string]: any;
|
|
718
252
|
};
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
253
|
+
}>;
|
|
254
|
+
afterUpdateMemberRole?: (data: {
|
|
255
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
256
|
+
previousRole: string;
|
|
257
|
+
user: User & Record<string, any>;
|
|
258
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
259
|
+
}) => Promise<void>;
|
|
260
|
+
beforeCreateInvitation?: (data: {
|
|
261
|
+
invitation: {
|
|
262
|
+
email: string;
|
|
263
|
+
role: string;
|
|
264
|
+
organizationId: string;
|
|
265
|
+
inviterId: string;
|
|
266
|
+
teamId?: string;
|
|
267
|
+
[key: string]: any;
|
|
723
268
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
269
|
+
inviter: User & Record<string, any>;
|
|
270
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
271
|
+
}) => Promise<void | {
|
|
272
|
+
data: Record<string, any>;
|
|
273
|
+
}>;
|
|
274
|
+
afterCreateInvitation?: (data: {
|
|
275
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
276
|
+
inviter: User & Record<string, any>;
|
|
277
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
278
|
+
}) => Promise<void>;
|
|
279
|
+
beforeAcceptInvitation?: (data: {
|
|
280
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
281
|
+
user: User & Record<string, any>;
|
|
282
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
283
|
+
}) => Promise<void>;
|
|
284
|
+
afterAcceptInvitation?: (data: {
|
|
285
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
286
|
+
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
287
|
+
user: User & Record<string, any>;
|
|
288
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
289
|
+
}) => Promise<void>;
|
|
290
|
+
beforeRejectInvitation?: (data: {
|
|
291
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
292
|
+
user: User & Record<string, any>;
|
|
293
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
294
|
+
}) => Promise<void>;
|
|
295
|
+
afterRejectInvitation?: (data: {
|
|
296
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
297
|
+
user: User & Record<string, any>;
|
|
298
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
299
|
+
}) => Promise<void>;
|
|
300
|
+
beforeCancelInvitation?: (data: {
|
|
301
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
302
|
+
cancelledBy: User & Record<string, any>;
|
|
303
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
304
|
+
}) => Promise<void>;
|
|
305
|
+
afterCancelInvitation?: (data: {
|
|
306
|
+
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
307
|
+
cancelledBy: User & Record<string, any>;
|
|
308
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
309
|
+
}) => Promise<void>;
|
|
310
|
+
beforeCreateTeam?: (data: {
|
|
311
|
+
team: {
|
|
312
|
+
name: string;
|
|
313
|
+
organizationId: string;
|
|
314
|
+
[key: string]: any;
|
|
728
315
|
};
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
316
|
+
user?: User & Record<string, any>;
|
|
317
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
318
|
+
}) => Promise<void | {
|
|
319
|
+
data: Record<string, any>;
|
|
320
|
+
}>;
|
|
321
|
+
afterCreateTeam?: (data: {
|
|
322
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
323
|
+
user?: User & Record<string, any>;
|
|
324
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
325
|
+
}) => Promise<void>;
|
|
326
|
+
beforeUpdateTeam?: (data: {
|
|
327
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
328
|
+
updates: {
|
|
329
|
+
name?: string;
|
|
330
|
+
[key: string]: any;
|
|
732
331
|
};
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
332
|
+
user: User & Record<string, any>;
|
|
333
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
334
|
+
}) => Promise<void | {
|
|
335
|
+
data: Record<string, any>;
|
|
336
|
+
}>;
|
|
337
|
+
afterUpdateTeam?: (data: {
|
|
338
|
+
team: (import("better-auth/plugins").Team & Record<string, any>) | null;
|
|
339
|
+
user: User & Record<string, any>;
|
|
340
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
341
|
+
}) => Promise<void>;
|
|
342
|
+
beforeDeleteTeam?: (data: {
|
|
343
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
344
|
+
user?: User & Record<string, any>;
|
|
345
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
346
|
+
}) => Promise<void>;
|
|
347
|
+
afterDeleteTeam?: (data: {
|
|
348
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
349
|
+
user?: User & Record<string, any>;
|
|
350
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
351
|
+
}) => Promise<void>;
|
|
352
|
+
beforeAddTeamMember?: (data: {
|
|
353
|
+
teamMember: {
|
|
354
|
+
teamId: string;
|
|
355
|
+
userId: string;
|
|
356
|
+
[key: string]: any;
|
|
737
357
|
};
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
} | undefined;
|
|
765
|
-
organizationHooks?: {
|
|
766
|
-
beforeCreateOrganization?: (data: {
|
|
767
|
-
organization: {
|
|
768
|
-
name?: string;
|
|
769
|
-
slug?: string;
|
|
770
|
-
logo?: string;
|
|
771
|
-
metadata?: Record<string, any>;
|
|
772
|
-
[key: string]: any;
|
|
773
|
-
};
|
|
774
|
-
user: User & Record<string, any>;
|
|
775
|
-
}) => Promise<void | {
|
|
776
|
-
data: Record<string, any>;
|
|
777
|
-
}>;
|
|
778
|
-
afterCreateOrganization?: (data: {
|
|
779
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
780
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
781
|
-
user: User & Record<string, any>;
|
|
782
|
-
}) => Promise<void>;
|
|
783
|
-
beforeUpdateOrganization?: (data: {
|
|
784
|
-
organization: {
|
|
785
|
-
name?: string;
|
|
786
|
-
slug?: string;
|
|
787
|
-
logo?: string;
|
|
788
|
-
metadata?: Record<string, any>;
|
|
789
|
-
[key: string]: any;
|
|
790
|
-
};
|
|
791
|
-
user: User & Record<string, any>;
|
|
792
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
793
|
-
}) => Promise<void | {
|
|
794
|
-
data: {
|
|
795
|
-
name?: string;
|
|
796
|
-
slug?: string;
|
|
797
|
-
logo?: string;
|
|
798
|
-
metadata?: Record<string, any>;
|
|
799
|
-
[key: string]: any;
|
|
800
|
-
};
|
|
801
|
-
}>;
|
|
802
|
-
afterUpdateOrganization?: (data: {
|
|
803
|
-
organization: (import("better-auth/plugins").Organization & Record<string, any>) | null;
|
|
804
|
-
user: User & Record<string, any>;
|
|
805
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
806
|
-
}) => Promise<void>;
|
|
807
|
-
beforeDeleteOrganization?: (data: {
|
|
808
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
809
|
-
user: User & Record<string, any>;
|
|
810
|
-
}) => Promise<void>;
|
|
811
|
-
afterDeleteOrganization?: (data: {
|
|
812
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
813
|
-
user: User & Record<string, any>;
|
|
814
|
-
}) => Promise<void>;
|
|
815
|
-
beforeAddMember?: (data: {
|
|
816
|
-
member: {
|
|
817
|
-
userId: string;
|
|
818
|
-
organizationId: string;
|
|
819
|
-
role: string;
|
|
820
|
-
[key: string]: any;
|
|
821
|
-
};
|
|
822
|
-
user: User & Record<string, any>;
|
|
823
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
824
|
-
}) => Promise<void | {
|
|
825
|
-
data: Record<string, any>;
|
|
826
|
-
}>;
|
|
827
|
-
afterAddMember?: (data: {
|
|
828
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
829
|
-
user: User & Record<string, any>;
|
|
830
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
831
|
-
}) => Promise<void>;
|
|
832
|
-
beforeRemoveMember?: (data: {
|
|
833
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
834
|
-
user: User & Record<string, any>;
|
|
835
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
836
|
-
}) => Promise<void>;
|
|
837
|
-
afterRemoveMember?: (data: {
|
|
838
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
839
|
-
user: User & Record<string, any>;
|
|
840
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
841
|
-
}) => Promise<void>;
|
|
842
|
-
beforeUpdateMemberRole?: (data: {
|
|
843
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
844
|
-
newRole: string;
|
|
845
|
-
user: User & Record<string, any>;
|
|
846
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
847
|
-
}) => Promise<void | {
|
|
848
|
-
data: {
|
|
849
|
-
role: string;
|
|
850
|
-
[key: string]: any;
|
|
851
|
-
};
|
|
852
|
-
}>;
|
|
853
|
-
afterUpdateMemberRole?: (data: {
|
|
854
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
855
|
-
previousRole: string;
|
|
856
|
-
user: User & Record<string, any>;
|
|
857
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
858
|
-
}) => Promise<void>;
|
|
859
|
-
beforeCreateInvitation?: (data: {
|
|
860
|
-
invitation: {
|
|
861
|
-
email: string;
|
|
862
|
-
role: string;
|
|
863
|
-
organizationId: string;
|
|
864
|
-
inviterId: string;
|
|
865
|
-
teamId?: string;
|
|
866
|
-
[key: string]: any;
|
|
867
|
-
};
|
|
868
|
-
inviter: User & Record<string, any>;
|
|
869
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
870
|
-
}) => Promise<void | {
|
|
871
|
-
data: Record<string, any>;
|
|
872
|
-
}>;
|
|
873
|
-
afterCreateInvitation?: (data: {
|
|
874
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
875
|
-
inviter: User & Record<string, any>;
|
|
876
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
877
|
-
}) => Promise<void>;
|
|
878
|
-
beforeAcceptInvitation?: (data: {
|
|
879
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
880
|
-
user: User & Record<string, any>;
|
|
881
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
882
|
-
}) => Promise<void>;
|
|
883
|
-
afterAcceptInvitation?: (data: {
|
|
884
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
885
|
-
member: import("better-auth/plugins").Member & Record<string, any>;
|
|
886
|
-
user: User & Record<string, any>;
|
|
887
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
888
|
-
}) => Promise<void>;
|
|
889
|
-
beforeRejectInvitation?: (data: {
|
|
890
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
891
|
-
user: User & Record<string, any>;
|
|
892
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
893
|
-
}) => Promise<void>;
|
|
894
|
-
afterRejectInvitation?: (data: {
|
|
895
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
896
|
-
user: User & Record<string, any>;
|
|
897
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
898
|
-
}) => Promise<void>;
|
|
899
|
-
beforeCancelInvitation?: (data: {
|
|
900
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
901
|
-
cancelledBy: User & Record<string, any>;
|
|
902
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
903
|
-
}) => Promise<void>;
|
|
904
|
-
afterCancelInvitation?: (data: {
|
|
905
|
-
invitation: import("better-auth/plugins").Invitation & Record<string, any>;
|
|
906
|
-
cancelledBy: User & Record<string, any>;
|
|
907
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
908
|
-
}) => Promise<void>;
|
|
909
|
-
beforeCreateTeam?: (data: {
|
|
910
|
-
team: {
|
|
911
|
-
name: string;
|
|
912
|
-
organizationId: string;
|
|
913
|
-
[key: string]: any;
|
|
914
|
-
};
|
|
915
|
-
user?: User & Record<string, any>;
|
|
916
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
917
|
-
}) => Promise<void | {
|
|
918
|
-
data: Record<string, any>;
|
|
919
|
-
}>;
|
|
920
|
-
afterCreateTeam?: (data: {
|
|
921
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
922
|
-
user?: User & Record<string, any>;
|
|
923
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
924
|
-
}) => Promise<void>;
|
|
925
|
-
beforeUpdateTeam?: (data: {
|
|
926
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
927
|
-
updates: {
|
|
928
|
-
name?: string;
|
|
929
|
-
[key: string]: any;
|
|
930
|
-
};
|
|
931
|
-
user: User & Record<string, any>;
|
|
932
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
933
|
-
}) => Promise<void | {
|
|
934
|
-
data: Record<string, any>;
|
|
935
|
-
}>;
|
|
936
|
-
afterUpdateTeam?: (data: {
|
|
937
|
-
team: (import("better-auth/plugins").Team & Record<string, any>) | null;
|
|
938
|
-
user: User & Record<string, any>;
|
|
939
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
940
|
-
}) => Promise<void>;
|
|
941
|
-
beforeDeleteTeam?: (data: {
|
|
942
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
943
|
-
user?: User & Record<string, any>;
|
|
944
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
945
|
-
}) => Promise<void>;
|
|
946
|
-
afterDeleteTeam?: (data: {
|
|
947
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
948
|
-
user?: User & Record<string, any>;
|
|
949
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
950
|
-
}) => Promise<void>;
|
|
951
|
-
beforeAddTeamMember?: (data: {
|
|
952
|
-
teamMember: {
|
|
953
|
-
teamId: string;
|
|
954
|
-
userId: string;
|
|
955
|
-
[key: string]: any;
|
|
956
|
-
};
|
|
957
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
958
|
-
user: User & Record<string, any>;
|
|
959
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
960
|
-
}) => Promise<void | {
|
|
961
|
-
data: Record<string, any>;
|
|
962
|
-
}>;
|
|
963
|
-
afterAddTeamMember?: (data: {
|
|
964
|
-
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
965
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
966
|
-
user: User & Record<string, any>;
|
|
967
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
968
|
-
}) => Promise<void>;
|
|
969
|
-
beforeRemoveTeamMember?: (data: {
|
|
970
|
-
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
971
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
972
|
-
user: User & Record<string, any>;
|
|
973
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
974
|
-
}) => Promise<void>;
|
|
975
|
-
afterRemoveTeamMember?: (data: {
|
|
976
|
-
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
977
|
-
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
978
|
-
user: User & Record<string, any>;
|
|
979
|
-
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
980
|
-
}) => Promise<void>;
|
|
981
|
-
} | undefined;
|
|
982
|
-
}>;
|
|
983
|
-
};
|
|
358
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
359
|
+
user: User & Record<string, any>;
|
|
360
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
361
|
+
}) => Promise<void | {
|
|
362
|
+
data: Record<string, any>;
|
|
363
|
+
}>;
|
|
364
|
+
afterAddTeamMember?: (data: {
|
|
365
|
+
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
366
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
367
|
+
user: User & Record<string, any>;
|
|
368
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
369
|
+
}) => Promise<void>;
|
|
370
|
+
beforeRemoveTeamMember?: (data: {
|
|
371
|
+
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
372
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
373
|
+
user: User & Record<string, any>;
|
|
374
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
375
|
+
}) => Promise<void>;
|
|
376
|
+
afterRemoveTeamMember?: (data: {
|
|
377
|
+
teamMember: import("better-auth/plugins").TeamMember & Record<string, any>;
|
|
378
|
+
team: import("better-auth/plugins").Team & Record<string, any>;
|
|
379
|
+
user: User & Record<string, any>;
|
|
380
|
+
organization: import("better-auth/plugins").Organization & Record<string, any>;
|
|
381
|
+
}) => Promise<void>;
|
|
382
|
+
} | undefined;
|
|
383
|
+
}>;
|
|
984
384
|
export { organization };
|
|
985
385
|
export type { OrganizationOptions };
|
|
986
386
|
/**
|