@meistrari/auth-core 1.4.6 → 1.4.7
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +24 -23
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6221,7 +6221,7 @@ declare class OrganizationService {
|
|
|
6221
6221
|
* @param options - User identifier (either memberId or userEmail must be provided)
|
|
6222
6222
|
* @param options.memberId - The member ID to remove
|
|
6223
6223
|
* @param options.userEmail - The user email to remove
|
|
6224
|
-
|
|
6224
|
+
|
|
6225
6225
|
*/
|
|
6226
6226
|
removeUserFromOrganization({ memberId, userEmail }: RemoveUserFromOrganizationOptions): Promise<void>;
|
|
6227
6227
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -6221,7 +6221,7 @@ declare class OrganizationService {
|
|
|
6221
6221
|
* @param options - User identifier (either memberId or userEmail must be provided)
|
|
6222
6222
|
* @param options.memberId - The member ID to remove
|
|
6223
6223
|
* @param options.userEmail - The user email to remove
|
|
6224
|
-
|
|
6224
|
+
|
|
6225
6225
|
*/
|
|
6226
6226
|
removeUserFromOrganization({ memberId, userEmail }: RemoveUserFromOrganizationOptions): Promise<void>;
|
|
6227
6227
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import { createAccessControl } from 'better-auth/plugins/access';
|
|
|
6
6
|
import { defaultStatements } from 'better-auth/plugins/organization/access';
|
|
7
7
|
export { BetterFetchError as APIError } from '@better-fetch/fetch';
|
|
8
8
|
|
|
9
|
+
const version = "1.4.7";
|
|
10
|
+
|
|
9
11
|
const statements = {
|
|
10
12
|
...defaultStatements,
|
|
11
13
|
access: ["admin", "member", "reviewer"]
|
|
@@ -46,7 +48,6 @@ const organizationAdditionalFields = {
|
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
|
|
49
|
-
const version = "1.4.6";
|
|
50
51
|
function customEndpointsPluginClient() {
|
|
51
52
|
return {
|
|
52
53
|
id: "custom-endpoints",
|
|
@@ -213,7 +214,7 @@ class OrganizationService {
|
|
|
213
214
|
* @returns The active member object
|
|
214
215
|
*/
|
|
215
216
|
async getActiveMember() {
|
|
216
|
-
return this.client.organization.getActiveMember();
|
|
217
|
+
return await this.client.organization.getActiveMember();
|
|
217
218
|
}
|
|
218
219
|
/**
|
|
219
220
|
* Invites a user to join the active organization.
|
|
@@ -226,7 +227,7 @@ class OrganizationService {
|
|
|
226
227
|
* @returns The created invitation
|
|
227
228
|
*/
|
|
228
229
|
async inviteUserToOrganization({ userEmail, role, teamId, resend }) {
|
|
229
|
-
return this.client.organization.inviteMember({
|
|
230
|
+
return await this.client.organization.inviteMember({
|
|
230
231
|
email: userEmail,
|
|
231
232
|
role,
|
|
232
233
|
teamId,
|
|
@@ -254,13 +255,13 @@ class OrganizationService {
|
|
|
254
255
|
});
|
|
255
256
|
}
|
|
256
257
|
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
258
|
+
* Removes a user from the active organization.
|
|
259
|
+
*
|
|
260
|
+
* @param options - User identifier (either memberId or userEmail must be provided)
|
|
261
|
+
* @param options.memberId - The member ID to remove
|
|
262
|
+
* @param options.userEmail - The user email to remove
|
|
263
|
+
|
|
264
|
+
*/
|
|
264
265
|
async removeUserFromOrganization({ memberId, userEmail }) {
|
|
265
266
|
await this.client.organization.removeMember({
|
|
266
267
|
memberIdOrEmail: memberId ?? userEmail
|
|
@@ -287,7 +288,7 @@ class OrganizationService {
|
|
|
287
288
|
* @returns The created team
|
|
288
289
|
*/
|
|
289
290
|
async createTeam(payload) {
|
|
290
|
-
return this.client.organization.createTeam(payload);
|
|
291
|
+
return await this.client.organization.createTeam(payload);
|
|
291
292
|
}
|
|
292
293
|
/**
|
|
293
294
|
* Updates an existing team's details.
|
|
@@ -298,7 +299,7 @@ class OrganizationService {
|
|
|
298
299
|
* @returns The updated team
|
|
299
300
|
*/
|
|
300
301
|
async updateTeam(id, payload) {
|
|
301
|
-
return this.client.organization.updateTeam({
|
|
302
|
+
return await this.client.organization.updateTeam({
|
|
302
303
|
teamId: id,
|
|
303
304
|
data: payload
|
|
304
305
|
});
|
|
@@ -319,7 +320,7 @@ class OrganizationService {
|
|
|
319
320
|
* @returns An array of teams
|
|
320
321
|
*/
|
|
321
322
|
async listTeams() {
|
|
322
|
-
return this.client.organization.listTeams();
|
|
323
|
+
return await this.client.organization.listTeams();
|
|
323
324
|
}
|
|
324
325
|
/**
|
|
325
326
|
* Lists all members of a specific team.
|
|
@@ -328,7 +329,7 @@ class OrganizationService {
|
|
|
328
329
|
* @returns An array of team members
|
|
329
330
|
*/
|
|
330
331
|
async listTeamMembers(id) {
|
|
331
|
-
return this.client.organization.listTeamMembers({
|
|
332
|
+
return await this.client.organization.listTeamMembers({
|
|
332
333
|
query: {
|
|
333
334
|
teamId: id
|
|
334
335
|
}
|
|
@@ -342,7 +343,7 @@ class OrganizationService {
|
|
|
342
343
|
* @returns The added team member
|
|
343
344
|
*/
|
|
344
345
|
async addTeamMember(teamId, userId) {
|
|
345
|
-
return this.client.organization.addTeamMember({
|
|
346
|
+
return await this.client.organization.addTeamMember({
|
|
346
347
|
teamId,
|
|
347
348
|
userId
|
|
348
349
|
});
|
|
@@ -410,7 +411,7 @@ class SessionService {
|
|
|
410
411
|
* @returns The current user session
|
|
411
412
|
*/
|
|
412
413
|
async getSession(token) {
|
|
413
|
-
return this.client.getSession({
|
|
414
|
+
return await this.client.getSession({
|
|
414
415
|
...token && {
|
|
415
416
|
fetchOptions: {
|
|
416
417
|
headers: {
|
|
@@ -426,7 +427,7 @@ class SessionService {
|
|
|
426
427
|
* @returns The JWT token
|
|
427
428
|
*/
|
|
428
429
|
async getToken() {
|
|
429
|
-
return this.client.token();
|
|
430
|
+
return await this.client.token();
|
|
430
431
|
}
|
|
431
432
|
/**
|
|
432
433
|
* Initiates social authentication flow with Google or Microsoft.
|
|
@@ -549,7 +550,7 @@ class SessionService {
|
|
|
549
550
|
* @returns The JWT token for the nonce
|
|
550
551
|
*/
|
|
551
552
|
async getNoncePayload(nonce) {
|
|
552
|
-
return this.client.handshake.noncePayload({
|
|
553
|
+
return await this.client.handshake.noncePayload({
|
|
553
554
|
query: {
|
|
554
555
|
nonce
|
|
555
556
|
}
|
|
@@ -567,7 +568,7 @@ class ApiKeyService {
|
|
|
567
568
|
this.client = client;
|
|
568
569
|
}
|
|
569
570
|
async createApiKey(payload) {
|
|
570
|
-
return this.client.apiKey.create({
|
|
571
|
+
return await this.client.apiKey.create({
|
|
571
572
|
name: payload.name,
|
|
572
573
|
expiresIn: payload.expiresIn,
|
|
573
574
|
prefix: payload.prefix,
|
|
@@ -575,23 +576,23 @@ class ApiKeyService {
|
|
|
575
576
|
});
|
|
576
577
|
}
|
|
577
578
|
async getApiKey(id) {
|
|
578
|
-
return this.client.apiKey.get({
|
|
579
|
+
return await this.client.apiKey.get({
|
|
579
580
|
query: {
|
|
580
581
|
id
|
|
581
582
|
}
|
|
582
583
|
});
|
|
583
584
|
}
|
|
584
585
|
async listApiKeys() {
|
|
585
|
-
return this.client.apiKey.list();
|
|
586
|
+
return await this.client.apiKey.list();
|
|
586
587
|
}
|
|
587
588
|
async updateApiKey(payload) {
|
|
588
|
-
return this.client.apiKey.update({
|
|
589
|
+
return await this.client.apiKey.update({
|
|
589
590
|
keyId: payload.id,
|
|
590
591
|
name: payload.name
|
|
591
592
|
});
|
|
592
593
|
}
|
|
593
594
|
async deleteApiKey(id) {
|
|
594
|
-
return this.client.apiKey.delete({
|
|
595
|
+
return await this.client.apiKey.delete({
|
|
595
596
|
keyId: id
|
|
596
597
|
});
|
|
597
598
|
}
|