better-auth 1.4.21 → 1.4.22
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/api/index.d.mts +407 -407
- package/dist/api/middlewares/origin-check.d.mts +4 -4
- package/dist/api/routes/account.d.mts +11 -11
- package/dist/api/routes/callback.d.mts +2 -2
- package/dist/api/routes/email-verification.d.mts +4 -4
- package/dist/api/routes/error.d.mts +2 -2
- package/dist/api/routes/ok.d.mts +2 -2
- package/dist/api/routes/password.d.mts +7 -7
- package/dist/api/routes/sign-in.d.mts +4 -4
- package/dist/api/routes/sign-out.d.mts +2 -2
- package/dist/api/routes/sign-up.d.mts +3 -3
- package/dist/api/routes/update-user.d.mts +13 -13
- package/dist/client/lynx/index.d.mts +15 -15
- package/dist/client/react/index.d.mts +15 -15
- package/dist/client/solid/index.d.mts +13 -13
- package/dist/client/svelte/index.d.mts +13 -13
- package/dist/client/vanilla.d.mts +15 -15
- package/dist/client/vue/index.d.mts +15 -15
- package/dist/db/field.d.mts +6 -6
- package/dist/integrations/next-js.d.mts +4 -4
- package/dist/integrations/svelte-kit.d.mts +2 -2
- package/dist/integrations/tanstack-start-solid.d.mts +4 -4
- package/dist/integrations/tanstack-start.d.mts +4 -4
- package/dist/plugins/admin/admin.d.mts +114 -114
- package/dist/plugins/anonymous/index.d.mts +5 -5
- package/dist/plugins/api-key/index.d.mts +79 -79
- package/dist/plugins/bearer/index.d.mts +6 -6
- package/dist/plugins/captcha/index.d.mts +2 -2
- package/dist/plugins/custom-session/index.d.mts +5 -5
- package/dist/plugins/device-authorization/index.d.mts +6 -6
- package/dist/plugins/email-otp/index.d.mts +52 -52
- package/dist/plugins/generic-oauth/index.d.mts +32 -32
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -3
- package/dist/plugins/jwt/client.d.mts +2 -2
- package/dist/plugins/jwt/index.d.mts +7 -7
- package/dist/plugins/last-login-method/index.d.mts +4 -4
- package/dist/plugins/magic-link/index.d.mts +4 -4
- package/dist/plugins/mcp/index.d.mts +10 -10
- package/dist/plugins/multi-session/index.d.mts +9 -9
- package/dist/plugins/oauth-proxy/index.d.mts +8 -8
- package/dist/plugins/oidc-provider/index.d.mts +13 -13
- package/dist/plugins/one-tap/client.d.mts +4 -4
- package/dist/plugins/one-tap/index.d.mts +2 -2
- package/dist/plugins/one-time-token/index.d.mts +5 -5
- package/dist/plugins/open-api/index.d.mts +3 -3
- package/dist/plugins/organization/adapter.d.mts +24 -24
- package/dist/plugins/organization/client.d.mts +8 -8
- package/dist/plugins/organization/organization.d.mts +7 -7
- package/dist/plugins/organization/routes/crud-access-control.d.mts +22 -22
- package/dist/plugins/organization/routes/crud-invites.d.mts +69 -69
- package/dist/plugins/organization/routes/crud-members.d.mts +67 -67
- package/dist/plugins/organization/routes/crud-org.d.mts +59 -59
- package/dist/plugins/organization/routes/crud-team.d.mts +79 -79
- package/dist/plugins/phone-number/index.d.mts +33 -33
- package/dist/plugins/siwe/index.d.mts +3 -3
- package/dist/plugins/two-factor/backup-codes/index.d.mts +5 -5
- package/dist/plugins/two-factor/index.d.mts +16 -16
- package/dist/plugins/two-factor/otp/index.d.mts +3 -3
- package/dist/plugins/two-factor/totp/index.d.mts +5 -5
- package/dist/plugins/username/index.d.mts +9 -9
- package/dist/plugins/username/schema.d.mts +3 -3
- package/dist/test-utils/test-instance.d.mts +1225 -1225
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldSchema, OpenAPIModelSchema, Path, generator } from "./generator.mjs";
|
|
2
2
|
import { LiteralString } from "@better-auth/core";
|
|
3
|
-
import * as
|
|
3
|
+
import * as better_call0 from "better-call";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/open-api/index.d.ts
|
|
6
6
|
type ScalarTheme = "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "saturn" | "kepler" | "mars" | "deepSpace" | "laserwave" | "none";
|
|
@@ -36,7 +36,7 @@ interface OpenAPIOptions {
|
|
|
36
36
|
declare const openAPI: <O extends OpenAPIOptions>(options?: O | undefined) => {
|
|
37
37
|
id: "open-api";
|
|
38
38
|
endpoints: {
|
|
39
|
-
generateOpenAPISchema:
|
|
39
|
+
generateOpenAPISchema: better_call0.StrictEndpoint<"/open-api/generate-schema", {
|
|
40
40
|
method: "GET";
|
|
41
41
|
}, {
|
|
42
42
|
openapi: string;
|
|
@@ -76,7 +76,7 @@ declare const openAPI: <O extends OpenAPIOptions>(options?: O | undefined) => {
|
|
|
76
76
|
}[];
|
|
77
77
|
paths: Record<string, Path>;
|
|
78
78
|
}>;
|
|
79
|
-
openAPIReference:
|
|
79
|
+
openAPIReference: better_call0.StrictEndpoint<"/reference", {
|
|
80
80
|
method: "GET";
|
|
81
81
|
metadata: {
|
|
82
82
|
readonly scope: "server";
|
|
@@ -5,7 +5,7 @@ import "../../db/index.mjs";
|
|
|
5
5
|
import { OrganizationOptions } from "./types.mjs";
|
|
6
6
|
import { InferInvitation, InferMember, InferOrganization, InferOrganizationRolesFromOption, InferTeam, InvitationStatus, MemberInput, OrganizationInput, TeamInput, TeamMember } from "./schema.mjs";
|
|
7
7
|
import { AuthContext, GenericEndpointContext } from "@better-auth/core";
|
|
8
|
-
import * as
|
|
8
|
+
import * as _better_auth_core_db35 from "@better-auth/core/db";
|
|
9
9
|
|
|
10
10
|
//#region src/plugins/organization/adapter.d.ts
|
|
11
11
|
declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContext, options?: O | undefined) => {
|
|
@@ -45,7 +45,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
45
45
|
};
|
|
46
46
|
}) & (O["schema"] extends {
|
|
47
47
|
member?: {
|
|
48
|
-
additionalFields: infer Field extends Record<string,
|
|
48
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
49
49
|
} | undefined;
|
|
50
50
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
51
51
|
user: {
|
|
@@ -96,7 +96,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
96
96
|
};
|
|
97
97
|
}) & (O["schema"] extends {
|
|
98
98
|
member?: {
|
|
99
|
-
additionalFields: infer Field extends Record<string,
|
|
99
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
100
100
|
} | undefined;
|
|
101
101
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
102
102
|
user: {
|
|
@@ -140,7 +140,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
140
140
|
};
|
|
141
141
|
}) & (O["schema"] extends {
|
|
142
142
|
member?: {
|
|
143
|
-
additionalFields: infer Field extends Record<string,
|
|
143
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
144
144
|
} | undefined;
|
|
145
145
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
146
146
|
user: User$1;
|
|
@@ -181,7 +181,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
181
181
|
};
|
|
182
182
|
}) & (O["schema"] extends {
|
|
183
183
|
member?: {
|
|
184
|
-
additionalFields: infer Field extends Record<string,
|
|
184
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
185
185
|
} | undefined;
|
|
186
186
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
187
187
|
user: {
|
|
@@ -227,7 +227,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
227
227
|
};
|
|
228
228
|
}) & (O["schema"] extends {
|
|
229
229
|
member?: {
|
|
230
|
-
additionalFields: infer Field extends Record<string,
|
|
230
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
231
231
|
} | undefined;
|
|
232
232
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
233
233
|
deleteMember: ({
|
|
@@ -287,7 +287,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
287
287
|
};
|
|
288
288
|
}) & (O["schema"] extends {
|
|
289
289
|
member?: {
|
|
290
|
-
additionalFields: infer Field extends Record<string,
|
|
290
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
291
291
|
} | undefined;
|
|
292
292
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
293
293
|
/**
|
|
@@ -312,7 +312,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
312
312
|
metadata?: any;
|
|
313
313
|
} & (O["schema"] extends {
|
|
314
314
|
organization?: {
|
|
315
|
-
additionalFields: infer Field extends Record<string,
|
|
315
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
316
316
|
} | undefined;
|
|
317
317
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
318
318
|
invitation: InferInvitation<O>[];
|
|
@@ -342,7 +342,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
342
342
|
createdAt: Date;
|
|
343
343
|
}) & (O["schema"] extends {
|
|
344
344
|
invitation?: {
|
|
345
|
-
additionalFields: infer Field extends Record<string,
|
|
345
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
346
346
|
} | undefined;
|
|
347
347
|
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never)[];
|
|
348
348
|
members: (((O["teams"] extends {
|
|
@@ -374,7 +374,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
374
374
|
};
|
|
375
375
|
}) & (O["schema"] extends {
|
|
376
376
|
member?: {
|
|
377
|
-
additionalFields: infer Field extends Record<string,
|
|
377
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
378
378
|
} | undefined;
|
|
379
379
|
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_2 ? { [K_2 in keyof T_2]: T_2[K_2] } : never) & {
|
|
380
380
|
user: {
|
|
@@ -392,7 +392,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
392
392
|
updatedAt?: Date | undefined;
|
|
393
393
|
} & (O["schema"] extends {
|
|
394
394
|
team?: {
|
|
395
|
-
additionalFields: infer Field extends Record<string,
|
|
395
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
396
396
|
} | undefined;
|
|
397
397
|
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_3 ? { [K_3 in keyof T_3]: T_3[K_3] } : never)[] | undefined;
|
|
398
398
|
}) | null>;
|
|
@@ -405,7 +405,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
405
405
|
updatedAt?: Date | undefined;
|
|
406
406
|
} & (O["schema"] extends {
|
|
407
407
|
team?: {
|
|
408
|
-
additionalFields: infer Field extends Record<string,
|
|
408
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
409
409
|
} | undefined;
|
|
410
410
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
411
411
|
findTeamById: <IncludeMembers extends boolean>({
|
|
@@ -431,7 +431,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
431
431
|
updatedAt?: Date | undefined;
|
|
432
432
|
} & (O["schema"] extends {
|
|
433
433
|
team?: {
|
|
434
|
-
additionalFields: infer Field extends Record<string,
|
|
434
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
435
435
|
} | undefined;
|
|
436
436
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & InferAdditionalFieldsFromPluginOptions<"team", O>) | null>;
|
|
437
437
|
deleteTeam: (teamId: string) => Promise<void>;
|
|
@@ -443,7 +443,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
443
443
|
updatedAt?: Date | undefined;
|
|
444
444
|
} & (O["schema"] extends {
|
|
445
445
|
team?: {
|
|
446
|
-
additionalFields: infer Field extends Record<string,
|
|
446
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
447
447
|
} | undefined;
|
|
448
448
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
449
449
|
createTeamInvitation: ({
|
|
@@ -483,7 +483,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
483
483
|
createdAt: Date;
|
|
484
484
|
}) & (O["schema"] extends {
|
|
485
485
|
invitation?: {
|
|
486
|
-
additionalFields: infer Field extends Record<string,
|
|
486
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
487
487
|
} | undefined;
|
|
488
488
|
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
489
489
|
setActiveTeam: (sessionToken: string, teamId: string | null, ctx: GenericEndpointContext) => Promise<{
|
|
@@ -564,7 +564,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
564
564
|
createdAt: Date;
|
|
565
565
|
}) & (O["schema"] extends {
|
|
566
566
|
invitation?: {
|
|
567
|
-
additionalFields: infer Field extends Record<string,
|
|
567
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
568
568
|
} | undefined;
|
|
569
569
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
570
570
|
listUserInvitations: (email: string) => Promise<(Omit<((O["teams"] extends {
|
|
@@ -590,7 +590,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
590
590
|
createdAt: Date;
|
|
591
591
|
}) & (O["schema"] extends {
|
|
592
592
|
invitation?: {
|
|
593
|
-
additionalFields: infer Field extends Record<string,
|
|
593
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
594
594
|
} | undefined;
|
|
595
595
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
596
596
|
organization: InferOrganization<O, false>;
|
|
@@ -604,7 +604,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
604
604
|
metadata?: any;
|
|
605
605
|
} & (O["schema"] extends {
|
|
606
606
|
organization?: {
|
|
607
|
-
additionalFields: infer Field extends Record<string,
|
|
607
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
608
608
|
} | undefined;
|
|
609
609
|
} ? FieldAttributeToObject<Field> : {}))["name"];
|
|
610
610
|
})[]>;
|
|
@@ -642,7 +642,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
642
642
|
createdAt: Date;
|
|
643
643
|
}) & (O["schema"] extends {
|
|
644
644
|
invitation?: {
|
|
645
|
-
additionalFields: infer Field extends Record<string,
|
|
645
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
646
646
|
} | undefined;
|
|
647
647
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
648
648
|
findInvitationById: (id: string) => Promise<((O["teams"] extends {
|
|
@@ -668,7 +668,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
668
668
|
createdAt: Date;
|
|
669
669
|
}) & (O["schema"] extends {
|
|
670
670
|
invitation?: {
|
|
671
|
-
additionalFields: infer Field extends Record<string,
|
|
671
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
672
672
|
} | undefined;
|
|
673
673
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
674
674
|
findPendingInvitation: (data: {
|
|
@@ -697,7 +697,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
697
697
|
createdAt: Date;
|
|
698
698
|
}) & (O["schema"] extends {
|
|
699
699
|
invitation?: {
|
|
700
|
-
additionalFields: infer Field extends Record<string,
|
|
700
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
701
701
|
} | undefined;
|
|
702
702
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
703
703
|
findPendingInvitations: (data: {
|
|
@@ -725,7 +725,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
725
725
|
createdAt: Date;
|
|
726
726
|
}) & (O["schema"] extends {
|
|
727
727
|
invitation?: {
|
|
728
|
-
additionalFields: infer Field extends Record<string,
|
|
728
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
729
729
|
} | undefined;
|
|
730
730
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
731
731
|
listInvitations: (data: {
|
|
@@ -753,7 +753,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
753
753
|
createdAt: Date;
|
|
754
754
|
}) & (O["schema"] extends {
|
|
755
755
|
invitation?: {
|
|
756
|
-
additionalFields: infer Field extends Record<string,
|
|
756
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
757
757
|
} | undefined;
|
|
758
758
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
759
759
|
updateInvitation: (data: {
|
|
@@ -782,7 +782,7 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
782
782
|
createdAt: Date;
|
|
783
783
|
}) & (O["schema"] extends {
|
|
784
784
|
invitation?: {
|
|
785
|
-
additionalFields: infer Field extends Record<string,
|
|
785
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db35.DBFieldAttribute>;
|
|
786
786
|
} | undefined;
|
|
787
787
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
788
788
|
};
|
|
@@ -14,8 +14,8 @@ import "../../client/index.mjs";
|
|
|
14
14
|
import { HasPermissionBaseInput } from "./permission.mjs";
|
|
15
15
|
import * as _better_auth_core43 from "@better-auth/core";
|
|
16
16
|
import { DBFieldAttribute } from "@better-auth/core/db";
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
17
|
+
import * as nanostores6 from "nanostores";
|
|
18
|
+
import * as _better_fetch_fetch115 from "@better-fetch/fetch";
|
|
19
19
|
|
|
20
20
|
//#region src/plugins/organization/client.d.ts
|
|
21
21
|
/**
|
|
@@ -86,7 +86,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
|
|
|
86
86
|
} ? true : false;
|
|
87
87
|
};
|
|
88
88
|
}>;
|
|
89
|
-
getActions: ($fetch:
|
|
89
|
+
getActions: ($fetch: _better_fetch_fetch115.BetterFetch, _$store: _better_auth_core43.ClientStore, co: _better_auth_core43.BetterAuthClientOptions | undefined) => {
|
|
90
90
|
$Infer: {
|
|
91
91
|
ActiveOrganization: CO["teams"] extends {
|
|
92
92
|
enabled: true;
|
|
@@ -178,11 +178,11 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
|
|
|
178
178
|
}) => boolean;
|
|
179
179
|
};
|
|
180
180
|
};
|
|
181
|
-
getAtoms: ($fetch:
|
|
182
|
-
$listOrg:
|
|
183
|
-
$activeOrgSignal:
|
|
184
|
-
$activeMemberSignal:
|
|
185
|
-
$activeMemberRoleSignal:
|
|
181
|
+
getAtoms: ($fetch: _better_fetch_fetch115.BetterFetch) => {
|
|
182
|
+
$listOrg: nanostores6.PreinitializedWritableAtom<boolean> & object;
|
|
183
|
+
$activeOrgSignal: nanostores6.PreinitializedWritableAtom<boolean> & object;
|
|
184
|
+
$activeMemberSignal: nanostores6.PreinitializedWritableAtom<boolean> & object;
|
|
185
|
+
$activeMemberRoleSignal: nanostores6.PreinitializedWritableAtom<boolean> & object;
|
|
186
186
|
activeOrganization: AuthQueryAtom<Prettify<({
|
|
187
187
|
id: string;
|
|
188
188
|
name: string;
|
|
@@ -9,8 +9,8 @@ import { acceptInvitation, cancelInvitation, createInvitation, getInvitation, li
|
|
|
9
9
|
import { addMember, getActiveMember, getActiveMemberRole, leaveOrganization, listMembers, removeMember, updateMemberRole } from "./routes/crud-members.mjs";
|
|
10
10
|
import { checkOrganizationSlug, createOrganization, deleteOrganization, getFullOrganization, listOrganizations, setActiveOrganization, updateOrganization } from "./routes/crud-org.mjs";
|
|
11
11
|
import { addTeamMember, createTeam, listOrganizationTeams, listTeamMembers, listUserTeams, removeTeam, removeTeamMember, setActiveTeam, updateTeam } from "./routes/crud-team.mjs";
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
12
|
+
import * as _better_auth_core_db58 from "@better-auth/core/db";
|
|
13
|
+
import * as better_call742 from "better-call";
|
|
14
14
|
import * as z from "zod";
|
|
15
15
|
|
|
16
16
|
//#region src/plugins/organization/organization.d.ts
|
|
@@ -88,7 +88,7 @@ type OrganizationEndpoints<O extends OrganizationOptions> = {
|
|
|
88
88
|
getActiveMemberRole: ReturnType<typeof getActiveMemberRole<O>>;
|
|
89
89
|
hasPermission: ReturnType<typeof createHasPermission<O>>;
|
|
90
90
|
};
|
|
91
|
-
declare const createHasPermission: <O extends OrganizationOptions>(options: O) =>
|
|
91
|
+
declare const createHasPermission: <O extends OrganizationOptions>(options: O) => better_call742.StrictEndpoint<"/organization/has-permission", {
|
|
92
92
|
method: "POST";
|
|
93
93
|
requireHeaders: true;
|
|
94
94
|
body: z.ZodIntersection<z.ZodObject<{
|
|
@@ -100,8 +100,8 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
100
100
|
permission: z.ZodUndefined;
|
|
101
101
|
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
102
102
|
}, z.core.$strip>]>>;
|
|
103
|
-
use: ((inputContext:
|
|
104
|
-
use: ((inputContext:
|
|
103
|
+
use: ((inputContext: better_call742.MiddlewareInputContext<{
|
|
104
|
+
use: ((inputContext: better_call742.MiddlewareInputContext<better_call742.MiddlewareOptions>) => Promise<{
|
|
105
105
|
session: {
|
|
106
106
|
session: Record<string, any> & {
|
|
107
107
|
id: string;
|
|
@@ -126,11 +126,11 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
126
126
|
}>)[];
|
|
127
127
|
}>) => Promise<{
|
|
128
128
|
session: {
|
|
129
|
-
session:
|
|
129
|
+
session: _better_auth_core_db58.Session & {
|
|
130
130
|
activeTeamId?: string | undefined;
|
|
131
131
|
activeOrganizationId?: string | undefined;
|
|
132
132
|
};
|
|
133
|
-
user:
|
|
133
|
+
user: _better_auth_core_db58.User;
|
|
134
134
|
};
|
|
135
135
|
}>)[];
|
|
136
136
|
metadata: {
|
|
@@ -6,13 +6,13 @@ import { Statements, Subset } from "../../access/types.mjs";
|
|
|
6
6
|
import { OrganizationOptions } from "../types.mjs";
|
|
7
7
|
import { OrganizationRole } from "../schema.mjs";
|
|
8
8
|
import "../../index.mjs";
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
9
|
+
import * as _better_auth_core_db95 from "@better-auth/core/db";
|
|
10
|
+
import * as better_call888 from "better-call";
|
|
11
11
|
import * as z from "zod";
|
|
12
12
|
|
|
13
13
|
//#region src/plugins/organization/routes/crud-access-control.d.ts
|
|
14
14
|
type IsExactlyEmptyObject<T> = keyof T extends never ? T extends {} ? {} extends T ? true : false : false : false;
|
|
15
|
-
declare const createOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
15
|
+
declare const createOrgRole: <O extends OrganizationOptions>(options: O) => better_call888.StrictEndpoint<"/organization/create-role", {
|
|
16
16
|
method: "POST";
|
|
17
17
|
body: z.ZodObject<{
|
|
18
18
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -36,8 +36,8 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
requireHeaders: true;
|
|
39
|
-
use: ((inputContext:
|
|
40
|
-
use: ((inputContext:
|
|
39
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<{
|
|
40
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<better_call888.MiddlewareOptions>) => Promise<{
|
|
41
41
|
session: {
|
|
42
42
|
session: Record<string, any> & {
|
|
43
43
|
id: string;
|
|
@@ -62,7 +62,7 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
62
62
|
}>)[];
|
|
63
63
|
}>) => Promise<{
|
|
64
64
|
session: {
|
|
65
|
-
session:
|
|
65
|
+
session: _better_auth_core_db95.Session & {
|
|
66
66
|
activeTeamId?: string | undefined;
|
|
67
67
|
activeOrganizationId?: string | undefined;
|
|
68
68
|
};
|
|
@@ -81,7 +81,7 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
81
81
|
} & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>;
|
|
82
82
|
statements: Subset<string, Statements>;
|
|
83
83
|
}>;
|
|
84
|
-
declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
84
|
+
declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => better_call888.StrictEndpoint<"/organization/delete-role", {
|
|
85
85
|
method: "POST";
|
|
86
86
|
body: z.ZodIntersection<z.ZodObject<{
|
|
87
87
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -91,8 +91,8 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
91
91
|
roleId: z.ZodString;
|
|
92
92
|
}, z.core.$strip>]>>;
|
|
93
93
|
requireHeaders: true;
|
|
94
|
-
use: ((inputContext:
|
|
95
|
-
use: ((inputContext:
|
|
94
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<{
|
|
95
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<better_call888.MiddlewareOptions>) => Promise<{
|
|
96
96
|
session: {
|
|
97
97
|
session: Record<string, any> & {
|
|
98
98
|
id: string;
|
|
@@ -117,7 +117,7 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
117
117
|
}>)[];
|
|
118
118
|
}>) => Promise<{
|
|
119
119
|
session: {
|
|
120
|
-
session:
|
|
120
|
+
session: _better_auth_core_db95.Session & {
|
|
121
121
|
activeTeamId?: string | undefined;
|
|
122
122
|
activeOrganizationId?: string | undefined;
|
|
123
123
|
};
|
|
@@ -136,11 +136,11 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
136
136
|
}, {
|
|
137
137
|
success: boolean;
|
|
138
138
|
}>;
|
|
139
|
-
declare const listOrgRoles: <O extends OrganizationOptions>(options: O) =>
|
|
139
|
+
declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => better_call888.StrictEndpoint<"/organization/list-roles", {
|
|
140
140
|
method: "GET";
|
|
141
141
|
requireHeaders: true;
|
|
142
|
-
use: ((inputContext:
|
|
143
|
-
use: ((inputContext:
|
|
142
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<{
|
|
143
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<better_call888.MiddlewareOptions>) => Promise<{
|
|
144
144
|
session: {
|
|
145
145
|
session: Record<string, any> & {
|
|
146
146
|
id: string;
|
|
@@ -165,7 +165,7 @@ declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => bette
|
|
|
165
165
|
}>)[];
|
|
166
166
|
}>) => Promise<{
|
|
167
167
|
session: {
|
|
168
|
-
session:
|
|
168
|
+
session: _better_auth_core_db95.Session & {
|
|
169
169
|
activeTeamId?: string | undefined;
|
|
170
170
|
activeOrganizationId?: string | undefined;
|
|
171
171
|
};
|
|
@@ -183,11 +183,11 @@ declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => bette
|
|
|
183
183
|
createdAt: Date;
|
|
184
184
|
updatedAt?: Date | undefined;
|
|
185
185
|
} & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>)[]>;
|
|
186
|
-
declare const getOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
186
|
+
declare const getOrgRole: <O extends OrganizationOptions>(options: O) => better_call888.StrictEndpoint<"/organization/get-role", {
|
|
187
187
|
method: "GET";
|
|
188
188
|
requireHeaders: true;
|
|
189
|
-
use: ((inputContext:
|
|
190
|
-
use: ((inputContext:
|
|
189
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<{
|
|
190
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<better_call888.MiddlewareOptions>) => Promise<{
|
|
191
191
|
session: {
|
|
192
192
|
session: Record<string, any> & {
|
|
193
193
|
id: string;
|
|
@@ -212,7 +212,7 @@ declare const getOrgRole: <O extends OrganizationOptions>(options: O) => better_
|
|
|
212
212
|
}>)[];
|
|
213
213
|
}>) => Promise<{
|
|
214
214
|
session: {
|
|
215
|
-
session:
|
|
215
|
+
session: _better_auth_core_db95.Session & {
|
|
216
216
|
activeTeamId?: string | undefined;
|
|
217
217
|
activeOrganizationId?: string | undefined;
|
|
218
218
|
};
|
|
@@ -243,7 +243,7 @@ declare const getOrgRole: <O extends OrganizationOptions>(options: O) => better_
|
|
|
243
243
|
createdAt: Date;
|
|
244
244
|
updatedAt?: Date | undefined;
|
|
245
245
|
} & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>>;
|
|
246
|
-
declare const updateOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
246
|
+
declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => better_call888.StrictEndpoint<"/organization/update-role", {
|
|
247
247
|
method: "POST";
|
|
248
248
|
body: z.ZodIntersection<z.ZodObject<{
|
|
249
249
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -270,8 +270,8 @@ declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
270
270
|
};
|
|
271
271
|
};
|
|
272
272
|
requireHeaders: true;
|
|
273
|
-
use: ((inputContext:
|
|
274
|
-
use: ((inputContext:
|
|
273
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<{
|
|
274
|
+
use: ((inputContext: better_call888.MiddlewareInputContext<better_call888.MiddlewareOptions>) => Promise<{
|
|
275
275
|
session: {
|
|
276
276
|
session: Record<string, any> & {
|
|
277
277
|
id: string;
|
|
@@ -296,7 +296,7 @@ declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
296
296
|
}>)[];
|
|
297
297
|
}>) => Promise<{
|
|
298
298
|
session: {
|
|
299
|
-
session:
|
|
299
|
+
session: _better_auth_core_db95.Session & {
|
|
300
300
|
activeTeamId?: string | undefined;
|
|
301
301
|
activeOrganizationId?: string | undefined;
|
|
302
302
|
};
|