better-auth 1.6.26 → 1.6.28
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/adapters/index.d.mts +6 -1
- package/dist/api/dispatch.d.mts +1 -0
- package/dist/api/index.d.mts +508 -505
- package/dist/api/middlewares/authorization.d.mts +10 -14
- package/dist/api/middlewares/authorization.mjs +1 -2
- package/dist/api/middlewares/index.d.mts +1 -2
- package/dist/api/middlewares/origin-check.d.mts +5 -3
- package/dist/api/routes/account.d.mts +16 -13
- package/dist/api/routes/callback.d.mts +3 -1
- package/dist/api/routes/email-verification.d.mts +8 -4
- package/dist/api/routes/error.d.mts +3 -1
- package/dist/api/routes/index.d.mts +1 -2
- package/dist/api/routes/ok.d.mts +3 -1
- package/dist/api/routes/password.d.mts +10 -8
- package/dist/api/routes/session.d.mts +32 -30
- package/dist/api/routes/session.mjs +2 -3
- package/dist/api/routes/sign-in.d.mts +5 -3
- package/dist/api/routes/sign-out.d.mts +3 -1
- package/dist/api/routes/sign-up.d.mts +4 -3
- package/dist/api/routes/update-session.d.mts +5 -4
- package/dist/api/routes/update-user.d.mts +19 -18
- package/dist/auth/full.d.mts +1 -1
- package/dist/auth/minimal.d.mts +1 -1
- package/dist/client/config.d.mts +14 -12
- package/dist/client/config.mjs +2 -2
- package/dist/client/equality.d.mts +1 -0
- package/dist/client/index.d.mts +5 -6
- package/dist/client/lynx/index.d.mts +5 -4
- package/dist/client/lynx/lynx-store.d.mts +2 -1
- package/dist/client/parser.d.mts +3 -7
- package/dist/client/path-to-object.d.mts +4 -3
- package/dist/client/plugins/index.d.mts +1 -1
- package/dist/client/plugins/infer-plugin.d.mts +1 -0
- package/dist/client/query.d.mts +1 -0
- package/dist/client/react/index.d.mts +5 -4
- package/dist/client/react/react-store.d.mts +2 -1
- package/dist/client/session-atom.mjs +59 -46
- package/dist/client/session-refresh.d.mts +1 -0
- package/dist/client/solid/index.d.mts +5 -4
- package/dist/client/svelte/index.d.mts +5 -4
- package/dist/client/types.d.mts +2 -2
- package/dist/client/vanilla.d.mts +2 -1
- package/dist/client/vue/index.d.mts +5 -4
- package/dist/context/create-context.mjs +3 -3
- package/dist/context/helpers.mjs +2 -2
- package/dist/cookies/index.d.mts +7 -6
- package/dist/cookies/session-store.d.mts +0 -1
- package/dist/cookies/session-store.mjs +1 -2
- package/dist/crypto/index.d.mts +9 -2
- package/dist/crypto/jwt.d.mts +1 -0
- package/dist/crypto/password.d.mts +5 -1
- package/dist/db/adapter-base.d.mts +1 -0
- package/dist/db/adapter-kysely.d.mts +1 -0
- package/dist/db/field-converter.d.mts +1 -0
- package/dist/db/field.d.mts +10 -9
- package/dist/db/get-migration.d.mts +1 -0
- package/dist/db/get-schema.d.mts +1 -0
- package/dist/db/internal-adapter.d.mts +1 -0
- package/dist/db/internal-adapter.mjs +1 -2
- package/dist/db/revoke-unproven-account-access.d.mts +1 -0
- package/dist/db/schema.d.mts +2 -2
- package/dist/db/to-zod.d.mts +7 -3
- package/dist/db/with-hooks.d.mts +1 -0
- package/dist/index.d.mts +3 -4
- package/dist/integrations/next-js.d.mts +7 -4
- package/dist/integrations/node.d.mts +3 -2
- package/dist/integrations/svelte-kit.d.mts +9 -2
- package/dist/integrations/tanstack-start-solid.d.mts +5 -2
- package/dist/integrations/tanstack-start.d.mts +5 -2
- package/dist/oauth2/link-account.d.mts +1 -1
- package/dist/oauth2/state.d.mts +1 -0
- package/dist/oauth2/utils.d.mts +1 -0
- package/dist/package.mjs +1 -1
- package/dist/plugins/access/access.d.mts +1 -0
- package/dist/plugins/access/types.d.mts +5 -4
- package/dist/plugins/additional-fields/client.d.mts +1 -0
- package/dist/plugins/admin/access/statement.d.mts +0 -1
- package/dist/plugins/admin/admin.d.mts +137 -132
- package/dist/plugins/admin/client.d.mts +30 -30
- package/dist/plugins/admin/client.mjs +1 -1
- package/dist/plugins/admin/error-codes.d.mts +25 -23
- package/dist/plugins/admin/index.d.mts +1 -1
- package/dist/plugins/admin/schema.d.mts +1 -1
- package/dist/plugins/admin/types.d.mts +2 -3
- package/dist/plugins/anonymous/client.d.mts +11 -9
- package/dist/plugins/anonymous/client.mjs +1 -1
- package/dist/plugins/anonymous/error-codes.d.mts +10 -8
- package/dist/plugins/anonymous/index.d.mts +19 -15
- package/dist/plugins/anonymous/types.d.mts +1 -1
- package/dist/plugins/bearer/index.d.mts +8 -5
- package/dist/plugins/captcha/index.d.mts +8 -5
- package/dist/plugins/captcha/types.d.mts +1 -0
- package/dist/plugins/custom-session/client.d.mts +1 -0
- package/dist/plugins/custom-session/index.d.mts +12 -7
- package/dist/plugins/device-authorization/client.d.mts +1 -0
- package/dist/plugins/device-authorization/index.d.mts +22 -19
- package/dist/plugins/email-otp/client.d.mts +6 -4
- package/dist/plugins/email-otp/client.mjs +1 -1
- package/dist/plugins/email-otp/error-codes.d.mts +5 -3
- package/dist/plugins/email-otp/index.d.mts +76 -69
- package/dist/plugins/email-otp/types.d.mts +1 -0
- package/dist/plugins/generic-oauth/client.d.mts +11 -10
- package/dist/plugins/generic-oauth/client.mjs +1 -1
- package/dist/plugins/generic-oauth/error-codes.d.mts +10 -8
- package/dist/plugins/generic-oauth/index.d.mts +45 -41
- package/dist/plugins/generic-oauth/providers/auth0.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/gumroad.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/hubspot.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/index.d.mts +1 -2
- package/dist/plugins/generic-oauth/providers/keycloak.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/line.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/okta.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/patreon.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/slack.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/yandex.d.mts +1 -0
- package/dist/plugins/generic-oauth/types.d.mts +2 -1
- package/dist/plugins/haveibeenpwned/index.d.mts +6 -3
- package/dist/plugins/index.d.mts +1 -4
- package/dist/plugins/jwt/client.d.mts +2 -1
- package/dist/plugins/jwt/index.d.mts +12 -9
- package/dist/plugins/jwt/sign.d.mts +2 -2
- package/dist/plugins/jwt/types.d.mts +1 -1
- package/dist/plugins/jwt/utils.d.mts +4 -2
- package/dist/plugins/jwt/verify.d.mts +1 -0
- package/dist/plugins/last-login-method/index.d.mts +6 -3
- package/dist/plugins/magic-link/client.d.mts +1 -0
- package/dist/plugins/magic-link/index.d.mts +6 -4
- package/dist/plugins/mcp/client/adapters.d.mts +1 -0
- package/dist/plugins/mcp/client/index.mjs +2 -4
- package/dist/plugins/mcp/index.d.mts +12 -11
- package/dist/plugins/multi-session/client.d.mts +4 -2
- package/dist/plugins/multi-session/client.mjs +1 -1
- package/dist/plugins/multi-session/error-codes.d.mts +3 -1
- package/dist/plugins/multi-session/index.d.mts +12 -8
- package/dist/plugins/oauth-popup/client.d.mts +12 -6
- package/dist/plugins/oauth-popup/client.mjs +3 -5
- package/dist/plugins/oauth-popup/error-codes.d.mts +6 -4
- package/dist/plugins/oauth-popup/index.d.mts +12 -8
- package/dist/plugins/oauth-popup/index.mjs +1 -1
- package/dist/plugins/oauth-popup/types.d.mts +2 -1
- package/dist/plugins/oauth-proxy/index.d.mts +9 -6
- package/dist/plugins/oauth-proxy/index.mjs +2 -2
- package/dist/plugins/oidc-provider/client.d.mts +2 -1
- package/dist/plugins/oidc-provider/index.d.mts +20 -18
- package/dist/plugins/oidc-provider/schema.d.mts +1 -0
- package/dist/plugins/oidc-provider/types.d.mts +1 -1
- package/dist/plugins/one-tap/client.d.mts +3 -1
- package/dist/plugins/one-tap/index.d.mts +3 -1
- package/dist/plugins/one-time-token/client.d.mts +2 -1
- package/dist/plugins/one-time-token/index.d.mts +7 -6
- package/dist/plugins/open-api/generator.d.mts +1 -0
- package/dist/plugins/open-api/generator.mjs +5 -5
- package/dist/plugins/open-api/index.d.mts +5 -3
- package/dist/plugins/organization/access/statement.d.mts +0 -1
- package/dist/plugins/organization/adapter.d.mts +82 -56
- package/dist/plugins/organization/client.d.mts +103 -104
- package/dist/plugins/organization/client.mjs +4 -7
- package/dist/plugins/organization/error-codes.d.mts +61 -59
- package/dist/plugins/organization/has-permission.d.mts +1 -0
- package/dist/plugins/organization/has-permission.mjs +1 -1
- package/dist/plugins/organization/index.d.mts +1 -1
- package/dist/plugins/organization/organization.d.mts +33 -9
- package/dist/plugins/organization/organization.mjs +1 -1
- package/dist/plugins/organization/permission.d.mts +2 -2
- package/dist/plugins/organization/routes/crud-access-control.d.mts +147 -27
- package/dist/plugins/organization/routes/crud-invites.d.mts +186 -65
- package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
- package/dist/plugins/organization/routes/crud-members.d.mts +178 -56
- package/dist/plugins/organization/routes/crud-members.mjs +1 -1
- package/dist/plugins/organization/routes/crud-org.d.mts +130 -57
- package/dist/plugins/organization/routes/crud-team.d.mts +235 -66
- package/dist/plugins/organization/schema.d.mts +4 -4
- package/dist/plugins/organization/schema.mjs +1 -1
- package/dist/plugins/organization/types.d.mts +14 -14
- package/dist/plugins/phone-number/client.d.mts +15 -13
- package/dist/plugins/phone-number/client.mjs +1 -1
- package/dist/plugins/phone-number/error-codes.d.mts +14 -12
- package/dist/plugins/phone-number/index.d.mts +47 -41
- package/dist/plugins/phone-number/types.d.mts +1 -1
- package/dist/plugins/siwe/client.d.mts +1 -0
- package/dist/plugins/siwe/index.d.mts +5 -4
- package/dist/plugins/test-utils/index.d.mts +4 -2
- package/dist/plugins/test-utils/types.d.mts +0 -1
- package/dist/plugins/two-factor/backup-codes/index.d.mts +7 -5
- package/dist/plugins/two-factor/backup-codes/index.mjs +1 -1
- package/dist/plugins/two-factor/client.d.mts +15 -12
- package/dist/plugins/two-factor/client.mjs +1 -1
- package/dist/plugins/two-factor/error-code.d.mts +12 -10
- package/dist/plugins/two-factor/index.d.mts +36 -32
- package/dist/plugins/two-factor/otp/index.d.mts +4 -2
- package/dist/plugins/two-factor/totp/index.d.mts +7 -5
- package/dist/plugins/two-factor/types.d.mts +1 -1
- package/dist/plugins/username/client.d.mts +11 -9
- package/dist/plugins/username/client.mjs +1 -1
- package/dist/plugins/username/error-codes.d.mts +10 -8
- package/dist/plugins/username/index.d.mts +22 -17
- package/dist/plugins/username/schema.d.mts +5 -3
- package/dist/state.d.mts +1 -0
- package/dist/test-utils/test-instance.d.mts +3 -5
- package/dist/types/adapter.d.mts +1 -1
- package/dist/types/api.d.mts +2 -1
- package/dist/types/auth.d.mts +1 -0
- package/dist/types/helper.d.mts +5 -5
- package/dist/types/index.d.mts +2 -2
- package/dist/types/models.d.mts +1 -0
- package/dist/types/plugins.d.mts +3 -2
- package/dist/utils/index.d.mts +1 -2
- package/dist/utils/url.d.mts +1 -0
- package/package.json +12 -11
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { FieldAttributeToObject, InferAdditionalFieldsFromPluginOptions, RemoveFieldsWithReturnedFalse } from "../../../db/field.mjs";
|
|
2
2
|
import { Role } from "../../access/types.mjs";
|
|
3
|
-
import "../../../db/index.mjs";
|
|
4
3
|
import { OrganizationOptions } from "../types.mjs";
|
|
5
4
|
import { InferInvitation, InferMember, InferTeam } from "../schema.mjs";
|
|
6
|
-
import "../../index.mjs";
|
|
7
5
|
import { defaultRoles } from "../access/statement.mjs";
|
|
8
|
-
import "
|
|
6
|
+
import * as _$_better_auth_core0 from "@better-auth/core";
|
|
7
|
+
import * as _$_better_auth_core_db0 from "@better-auth/core/db";
|
|
8
|
+
import * as _$better_call0 from "better-call";
|
|
9
9
|
import * as z from "zod";
|
|
10
|
+
|
|
10
11
|
//#region src/plugins/organization/routes/crud-org.d.ts
|
|
11
|
-
declare const createOrganization: <O extends OrganizationOptions>(options?: O | undefined) =>
|
|
12
|
+
declare const createOrganization: <O extends OrganizationOptions>(options?: O | undefined) => _$better_call0.StrictEndpoint<"/organization/create", {
|
|
12
13
|
method: "POST";
|
|
13
14
|
body: z.ZodObject<{
|
|
14
15
|
name: z.ZodString;
|
|
@@ -18,12 +19,12 @@ declare const createOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
18
19
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
19
20
|
keepCurrentActiveOrganization: z.ZodOptional<z.ZodBoolean>;
|
|
20
21
|
}, z.core.$strip>;
|
|
21
|
-
use: (
|
|
22
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
22
23
|
orgOptions: OrganizationOptions;
|
|
23
24
|
roles: typeof defaultRoles & {
|
|
24
25
|
[key: string]: Role<{}>;
|
|
25
26
|
};
|
|
26
|
-
getSession: (context:
|
|
27
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
27
28
|
session: {
|
|
28
29
|
id: string;
|
|
29
30
|
createdAt: Date;
|
|
@@ -47,7 +48,7 @@ declare const createOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
47
48
|
image?: string | null | undefined;
|
|
48
49
|
};
|
|
49
50
|
}>;
|
|
50
|
-
}
|
|
51
|
+
}>>[];
|
|
51
52
|
metadata: {
|
|
52
53
|
$Infer: {
|
|
53
54
|
body: InferAdditionalFieldsFromPluginOptions<"organization", O> & {
|
|
@@ -86,9 +87,9 @@ declare const createOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
86
87
|
metadata?: any;
|
|
87
88
|
} & (O["schema"] extends {
|
|
88
89
|
organization?: {
|
|
89
|
-
additionalFields: infer Field extends Record<string,
|
|
90
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
90
91
|
} | undefined;
|
|
91
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
92
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
92
93
|
metadata: any;
|
|
93
94
|
members: (({
|
|
94
95
|
id: string;
|
|
@@ -98,12 +99,12 @@ declare const createOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
98
99
|
createdAt: Date;
|
|
99
100
|
} & InferAdditionalFieldsFromPluginOptions<"member", O, false>) | undefined)[];
|
|
100
101
|
}>;
|
|
101
|
-
declare const checkOrganizationSlug: <O extends OrganizationOptions>(options: O) =>
|
|
102
|
+
declare const checkOrganizationSlug: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/check-slug", {
|
|
102
103
|
method: "POST";
|
|
103
104
|
body: z.ZodObject<{
|
|
104
105
|
slug: z.ZodString;
|
|
105
106
|
}, z.core.$strip>;
|
|
106
|
-
use: ((
|
|
107
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
107
108
|
session: {
|
|
108
109
|
session: Record<string, any> & {
|
|
109
110
|
id: string;
|
|
@@ -125,12 +126,12 @@ declare const checkOrganizationSlug: <O extends OrganizationOptions>(options: O)
|
|
|
125
126
|
image?: string | null | undefined;
|
|
126
127
|
};
|
|
127
128
|
} | null;
|
|
128
|
-
}
|
|
129
|
+
}>> | _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
129
130
|
orgOptions: OrganizationOptions;
|
|
130
131
|
roles: typeof defaultRoles & {
|
|
131
132
|
[key: string]: Role<{}>;
|
|
132
133
|
};
|
|
133
|
-
getSession: (context:
|
|
134
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
134
135
|
session: {
|
|
135
136
|
id: string;
|
|
136
137
|
createdAt: Date;
|
|
@@ -154,11 +155,11 @@ declare const checkOrganizationSlug: <O extends OrganizationOptions>(options: O)
|
|
|
154
155
|
image?: string | null | undefined;
|
|
155
156
|
};
|
|
156
157
|
}>;
|
|
157
|
-
}
|
|
158
|
+
}>>)[];
|
|
158
159
|
}, {
|
|
159
160
|
status: boolean;
|
|
160
161
|
}>;
|
|
161
|
-
declare const updateOrganization: <O extends OrganizationOptions>(options?: O | undefined) =>
|
|
162
|
+
declare const updateOrganization: <O extends OrganizationOptions>(options?: O | undefined) => _$better_call0.StrictEndpoint<"/organization/update", {
|
|
162
163
|
method: "POST";
|
|
163
164
|
body: z.ZodObject<{
|
|
164
165
|
data: z.ZodObject<{
|
|
@@ -170,12 +171,12 @@ declare const updateOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
170
171
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
171
172
|
}, z.core.$strip>;
|
|
172
173
|
requireHeaders: true;
|
|
173
|
-
use: (
|
|
174
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
174
175
|
orgOptions: OrganizationOptions;
|
|
175
176
|
roles: typeof defaultRoles & {
|
|
176
177
|
[key: string]: Role<{}>;
|
|
177
178
|
};
|
|
178
|
-
getSession: (context:
|
|
179
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
179
180
|
session: {
|
|
180
181
|
id: string;
|
|
181
182
|
createdAt: Date;
|
|
@@ -199,7 +200,7 @@ declare const updateOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
199
200
|
image?: string | null | undefined;
|
|
200
201
|
};
|
|
201
202
|
}>;
|
|
202
|
-
}
|
|
203
|
+
}>>[];
|
|
203
204
|
metadata: {
|
|
204
205
|
$Infer: {
|
|
205
206
|
body: {
|
|
@@ -239,21 +240,21 @@ declare const updateOrganization: <O extends OrganizationOptions>(options?: O |
|
|
|
239
240
|
metadata?: any;
|
|
240
241
|
} & (O["schema"] extends {
|
|
241
242
|
organization?: {
|
|
242
|
-
additionalFields: infer Field extends Record<string,
|
|
243
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
243
244
|
} | undefined;
|
|
244
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
245
|
-
declare const deleteOrganization: <O extends OrganizationOptions>(options: O) =>
|
|
245
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
246
|
+
declare const deleteOrganization: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/delete", {
|
|
246
247
|
method: "POST";
|
|
247
248
|
body: z.ZodObject<{
|
|
248
249
|
organizationId: z.ZodString;
|
|
249
250
|
}, z.core.$strip>;
|
|
250
251
|
requireHeaders: true;
|
|
251
|
-
use: (
|
|
252
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
252
253
|
orgOptions: OrganizationOptions;
|
|
253
254
|
roles: typeof defaultRoles & {
|
|
254
255
|
[key: string]: Role<{}>;
|
|
255
256
|
};
|
|
256
|
-
getSession: (context:
|
|
257
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
257
258
|
session: {
|
|
258
259
|
id: string;
|
|
259
260
|
createdAt: Date;
|
|
@@ -277,7 +278,7 @@ declare const deleteOrganization: <O extends OrganizationOptions>(options: O) =>
|
|
|
277
278
|
image?: string | null | undefined;
|
|
278
279
|
};
|
|
279
280
|
}>;
|
|
280
|
-
}
|
|
281
|
+
}>>[];
|
|
281
282
|
metadata: {
|
|
282
283
|
openapi: {
|
|
283
284
|
description: string;
|
|
@@ -305,10 +306,10 @@ declare const deleteOrganization: <O extends OrganizationOptions>(options: O) =>
|
|
|
305
306
|
metadata?: any;
|
|
306
307
|
} & (O["schema"] extends {
|
|
307
308
|
organization?: {
|
|
308
|
-
additionalFields: infer Field extends Record<string,
|
|
309
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
309
310
|
} | undefined;
|
|
310
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
311
|
-
declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =>
|
|
311
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
312
|
+
declare const getFullOrganization: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/get-full-organization", {
|
|
312
313
|
method: "GET";
|
|
313
314
|
query: z.ZodOptional<z.ZodObject<{
|
|
314
315
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -316,12 +317,12 @@ declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =
|
|
|
316
317
|
membersLimit: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>;
|
|
317
318
|
}, z.core.$strip>>;
|
|
318
319
|
requireHeaders: true;
|
|
319
|
-
use: ((
|
|
320
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
320
321
|
orgOptions: OrganizationOptions;
|
|
321
322
|
roles: typeof defaultRoles & {
|
|
322
323
|
[key: string]: Role<{}>;
|
|
323
324
|
};
|
|
324
|
-
getSession: (context:
|
|
325
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
325
326
|
session: {
|
|
326
327
|
id: string;
|
|
327
328
|
createdAt: Date;
|
|
@@ -345,8 +346,8 @@ declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =
|
|
|
345
346
|
image?: string | null | undefined;
|
|
346
347
|
};
|
|
347
348
|
}>;
|
|
348
|
-
}
|
|
349
|
-
use: (
|
|
349
|
+
}>> | _$better_call0.Middleware<{
|
|
350
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
350
351
|
session: {
|
|
351
352
|
session: Record<string, any> & {
|
|
352
353
|
id: string;
|
|
@@ -368,7 +369,31 @@ declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =
|
|
|
368
369
|
image?: string | null | undefined;
|
|
369
370
|
};
|
|
370
371
|
};
|
|
371
|
-
}
|
|
372
|
+
}>>[];
|
|
373
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
374
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
375
|
+
session: {
|
|
376
|
+
session: Record<string, any> & {
|
|
377
|
+
id: string;
|
|
378
|
+
createdAt: Date;
|
|
379
|
+
updatedAt: Date;
|
|
380
|
+
userId: string;
|
|
381
|
+
expiresAt: Date;
|
|
382
|
+
token: string;
|
|
383
|
+
ipAddress?: string | null | undefined;
|
|
384
|
+
userAgent?: string | null | undefined;
|
|
385
|
+
};
|
|
386
|
+
user: Record<string, any> & {
|
|
387
|
+
id: string;
|
|
388
|
+
createdAt: Date;
|
|
389
|
+
updatedAt: Date;
|
|
390
|
+
email: string;
|
|
391
|
+
emailVerified: boolean;
|
|
392
|
+
name: string;
|
|
393
|
+
image?: string | null | undefined;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
}>>[];
|
|
372
397
|
}>) => Promise<{
|
|
373
398
|
session: {
|
|
374
399
|
session: {
|
|
@@ -394,7 +419,7 @@ declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =
|
|
|
394
419
|
image?: string | null | undefined;
|
|
395
420
|
};
|
|
396
421
|
};
|
|
397
|
-
}
|
|
422
|
+
}>>)[];
|
|
398
423
|
metadata: {
|
|
399
424
|
openapi: {
|
|
400
425
|
operationId: string;
|
|
@@ -430,9 +455,9 @@ declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =
|
|
|
430
455
|
metadata?: any;
|
|
431
456
|
} & (O["schema"] extends {
|
|
432
457
|
organization?: {
|
|
433
|
-
additionalFields: infer Field extends Record<string,
|
|
458
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
434
459
|
} | undefined;
|
|
435
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
460
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) : {
|
|
436
461
|
members: InferMember<O>[];
|
|
437
462
|
invitations: InferInvitation<O>[];
|
|
438
463
|
} & ({
|
|
@@ -444,21 +469,21 @@ declare const getFullOrganization: <O extends OrganizationOptions>(options: O) =
|
|
|
444
469
|
metadata?: any;
|
|
445
470
|
} & (O["schema"] extends {
|
|
446
471
|
organization?: {
|
|
447
|
-
additionalFields: infer Field extends Record<string,
|
|
472
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
448
473
|
} | undefined;
|
|
449
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
450
|
-
declare const setActiveOrganization: <O extends OrganizationOptions>(options: O) =>
|
|
474
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_1 ? { [K in keyof T_1]: T_1[K] } : never)) | null>;
|
|
475
|
+
declare const setActiveOrganization: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/set-active", {
|
|
451
476
|
method: "POST";
|
|
452
477
|
body: z.ZodObject<{
|
|
453
478
|
organizationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
454
479
|
organizationSlug: z.ZodOptional<z.ZodString>;
|
|
455
480
|
}, z.core.$strip>;
|
|
456
|
-
use: ((
|
|
481
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
457
482
|
orgOptions: OrganizationOptions;
|
|
458
483
|
roles: typeof defaultRoles & {
|
|
459
484
|
[key: string]: Role<{}>;
|
|
460
485
|
};
|
|
461
|
-
getSession: (context:
|
|
486
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
462
487
|
session: {
|
|
463
488
|
id: string;
|
|
464
489
|
createdAt: Date;
|
|
@@ -482,8 +507,8 @@ declare const setActiveOrganization: <O extends OrganizationOptions>(options: O)
|
|
|
482
507
|
image?: string | null | undefined;
|
|
483
508
|
};
|
|
484
509
|
}>;
|
|
485
|
-
}
|
|
486
|
-
use: (
|
|
510
|
+
}>> | _$better_call0.Middleware<{
|
|
511
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
487
512
|
session: {
|
|
488
513
|
session: Record<string, any> & {
|
|
489
514
|
id: string;
|
|
@@ -505,7 +530,31 @@ declare const setActiveOrganization: <O extends OrganizationOptions>(options: O)
|
|
|
505
530
|
image?: string | null | undefined;
|
|
506
531
|
};
|
|
507
532
|
};
|
|
508
|
-
}
|
|
533
|
+
}>>[];
|
|
534
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
535
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
536
|
+
session: {
|
|
537
|
+
session: Record<string, any> & {
|
|
538
|
+
id: string;
|
|
539
|
+
createdAt: Date;
|
|
540
|
+
updatedAt: Date;
|
|
541
|
+
userId: string;
|
|
542
|
+
expiresAt: Date;
|
|
543
|
+
token: string;
|
|
544
|
+
ipAddress?: string | null | undefined;
|
|
545
|
+
userAgent?: string | null | undefined;
|
|
546
|
+
};
|
|
547
|
+
user: Record<string, any> & {
|
|
548
|
+
id: string;
|
|
549
|
+
createdAt: Date;
|
|
550
|
+
updatedAt: Date;
|
|
551
|
+
email: string;
|
|
552
|
+
emailVerified: boolean;
|
|
553
|
+
name: string;
|
|
554
|
+
image?: string | null | undefined;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
}>>[];
|
|
509
558
|
}>) => Promise<{
|
|
510
559
|
session: {
|
|
511
560
|
session: {
|
|
@@ -531,7 +580,7 @@ declare const setActiveOrganization: <O extends OrganizationOptions>(options: O)
|
|
|
531
580
|
image?: string | null | undefined;
|
|
532
581
|
};
|
|
533
582
|
};
|
|
534
|
-
}
|
|
583
|
+
}>>)[];
|
|
535
584
|
requireHeaders: true;
|
|
536
585
|
metadata: {
|
|
537
586
|
openapi: {
|
|
@@ -568,9 +617,9 @@ declare const setActiveOrganization: <O extends OrganizationOptions>(options: O)
|
|
|
568
617
|
metadata?: any;
|
|
569
618
|
} & (O["schema"] extends {
|
|
570
619
|
organization?: {
|
|
571
|
-
additionalFields: infer Field extends Record<string,
|
|
620
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
572
621
|
} | undefined;
|
|
573
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
622
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) : {
|
|
574
623
|
members: InferMember<O>[];
|
|
575
624
|
invitations: InferInvitation<O>[];
|
|
576
625
|
} & ({
|
|
@@ -582,17 +631,17 @@ declare const setActiveOrganization: <O extends OrganizationOptions>(options: O)
|
|
|
582
631
|
metadata?: any;
|
|
583
632
|
} & (O["schema"] extends {
|
|
584
633
|
organization?: {
|
|
585
|
-
additionalFields: infer Field extends Record<string,
|
|
634
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
586
635
|
} | undefined;
|
|
587
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
588
|
-
declare const listOrganizations: <O extends OrganizationOptions>(options: O) =>
|
|
636
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_1 ? { [K in keyof T_1]: T_1[K] } : never)) | null>;
|
|
637
|
+
declare const listOrganizations: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/list", {
|
|
589
638
|
method: "GET";
|
|
590
|
-
use: ((
|
|
639
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
591
640
|
orgOptions: OrganizationOptions;
|
|
592
641
|
roles: typeof defaultRoles & {
|
|
593
642
|
[key: string]: Role<{}>;
|
|
594
643
|
};
|
|
595
|
-
getSession: (context:
|
|
644
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
596
645
|
session: {
|
|
597
646
|
id: string;
|
|
598
647
|
createdAt: Date;
|
|
@@ -616,8 +665,32 @@ declare const listOrganizations: <O extends OrganizationOptions>(options: O) =>
|
|
|
616
665
|
image?: string | null | undefined;
|
|
617
666
|
};
|
|
618
667
|
}>;
|
|
619
|
-
}
|
|
620
|
-
use: (
|
|
668
|
+
}>> | _$better_call0.Middleware<{
|
|
669
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
670
|
+
session: {
|
|
671
|
+
session: Record<string, any> & {
|
|
672
|
+
id: string;
|
|
673
|
+
createdAt: Date;
|
|
674
|
+
updatedAt: Date;
|
|
675
|
+
userId: string;
|
|
676
|
+
expiresAt: Date;
|
|
677
|
+
token: string;
|
|
678
|
+
ipAddress?: string | null | undefined;
|
|
679
|
+
userAgent?: string | null | undefined;
|
|
680
|
+
};
|
|
681
|
+
user: Record<string, any> & {
|
|
682
|
+
id: string;
|
|
683
|
+
createdAt: Date;
|
|
684
|
+
updatedAt: Date;
|
|
685
|
+
email: string;
|
|
686
|
+
emailVerified: boolean;
|
|
687
|
+
name: string;
|
|
688
|
+
image?: string | null | undefined;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
}>>[];
|
|
692
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
693
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
621
694
|
session: {
|
|
622
695
|
session: Record<string, any> & {
|
|
623
696
|
id: string;
|
|
@@ -639,7 +712,7 @@ declare const listOrganizations: <O extends OrganizationOptions>(options: O) =>
|
|
|
639
712
|
image?: string | null | undefined;
|
|
640
713
|
};
|
|
641
714
|
};
|
|
642
|
-
}
|
|
715
|
+
}>>[];
|
|
643
716
|
}>) => Promise<{
|
|
644
717
|
session: {
|
|
645
718
|
session: {
|
|
@@ -665,7 +738,7 @@ declare const listOrganizations: <O extends OrganizationOptions>(options: O) =>
|
|
|
665
738
|
image?: string | null | undefined;
|
|
666
739
|
};
|
|
667
740
|
};
|
|
668
|
-
}
|
|
741
|
+
}>>)[];
|
|
669
742
|
requireHeaders: true;
|
|
670
743
|
metadata: {
|
|
671
744
|
openapi: {
|
|
@@ -696,8 +769,8 @@ declare const listOrganizations: <O extends OrganizationOptions>(options: O) =>
|
|
|
696
769
|
metadata?: any;
|
|
697
770
|
} & (O["schema"] extends {
|
|
698
771
|
organization?: {
|
|
699
|
-
additionalFields: infer Field extends Record<string,
|
|
772
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
700
773
|
} | undefined;
|
|
701
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
774
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
702
775
|
//#endregion
|
|
703
776
|
export { checkOrganizationSlug, createOrganization, deleteOrganization, getFullOrganization, listOrganizations, setActiveOrganization, updateOrganization };
|