better-auth 1.2.0-beta.1 → 1.2.0-beta.11
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/drizzle.cjs +12 -5
- package/dist/adapters/drizzle.d.cts +6 -2
- package/dist/adapters/drizzle.d.ts +6 -2
- package/dist/adapters/drizzle.js +11 -4
- package/dist/adapters/kysely.cjs +5 -5
- package/dist/adapters/kysely.d.cts +6 -2
- package/dist/adapters/kysely.d.ts +6 -2
- package/dist/adapters/kysely.js +3 -3
- package/dist/adapters/memory.cjs +4 -4
- package/dist/adapters/memory.d.cts +6 -2
- package/dist/adapters/memory.d.ts +6 -2
- package/dist/adapters/memory.js +3 -3
- package/dist/adapters/mongodb.cjs +26 -8
- package/dist/adapters/mongodb.d.cts +6 -2
- package/dist/adapters/mongodb.d.ts +6 -2
- package/dist/adapters/mongodb.js +24 -6
- package/dist/adapters/prisma.cjs +18 -5
- package/dist/adapters/prisma.d.cts +6 -2
- package/dist/adapters/prisma.d.ts +6 -2
- package/dist/adapters/prisma.js +16 -3
- package/dist/adapters/test.cjs +1 -1
- package/dist/adapters/test.d.cts +2 -2
- package/dist/adapters/test.d.ts +2 -2
- package/dist/adapters/test.js +1 -1
- package/dist/api.cjs +48 -44
- package/dist/api.d.cts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.js +5 -5
- package/dist/{auth-DcMc3BIq.d.ts → auth-C-uLTIcY.d.ts} +12002 -7646
- package/dist/{auth-D4rdpxtI.d.cts → auth-lDfjrjVd.d.cts} +12002 -7646
- package/dist/{chunk-MGJLVQOV.js → chunk-2OAHQPLI.js} +100 -38
- package/dist/{chunk-5E75URIA.cjs → chunk-2Z6CVQHH.cjs} +0 -4
- package/dist/{chunk-WVLPJXQR.cjs → chunk-3FWLBBDV.cjs} +109 -51
- package/dist/{chunk-WDOY7YUW.cjs → chunk-6P33VPUY.cjs} +106 -44
- package/dist/{chunk-ADGXBH3Y.js → chunk-6XMAWIGH.js} +29 -26
- package/dist/{chunk-G7HOSQ5N.cjs → chunk-75MYIQ34.cjs} +15 -18
- package/dist/{chunk-YW3B2ST3.js → chunk-BY25AMN4.js} +116 -5
- package/dist/{chunk-LZ5DEQVH.cjs → chunk-C4T7TNDG.cjs} +3 -3
- package/dist/{chunk-PJ4KWXLQ.cjs → chunk-DH5E7574.cjs} +8 -8
- package/dist/{chunk-5RY45WFV.js → chunk-DIIVSN3J.js} +36 -13
- package/dist/{chunk-OSBTXYDD.cjs → chunk-GQKBG2VQ.cjs} +125 -14
- package/dist/{chunk-BKFMDM3P.js → chunk-HRI7BYTU.js} +115 -16
- package/dist/{chunk-6O2GLU2U.cjs → chunk-ICONG5HP.cjs} +18 -13
- package/dist/{chunk-3EY3LSQR.js → chunk-IVS5VS3V.js} +75 -36
- package/dist/{chunk-YRUDZRY3.cjs → chunk-IYCSNEDU.cjs} +79 -56
- package/dist/{chunk-NU4SXYJ5.cjs → chunk-JDAHD767.cjs} +198 -42
- package/dist/{chunk-UP6VJQDB.js → chunk-JHLVXVME.js} +17 -10
- package/dist/{chunk-WLXFBYQ6.cjs → chunk-JU56U5MW.cjs} +79 -9
- package/dist/{chunk-QFYRLTM5.cjs → chunk-JYPC7ZAL.cjs} +52 -49
- package/dist/{chunk-UHGAA4GH.cjs → chunk-KNVDJ4WK.cjs} +5 -5
- package/dist/{chunk-CVDYU5OC.js → chunk-M6SPJGF4.js} +5 -8
- package/dist/{chunk-BAPXDO3E.cjs → chunk-MKNA7SED.cjs} +125 -26
- package/dist/{chunk-GTM45OYP.cjs → chunk-NQFRXDEY.cjs} +3 -3
- package/dist/{chunk-FXNG3YQA.js → chunk-NXQP77NI.js} +146 -79
- package/dist/{chunk-FA6UYV37.js → chunk-PR54V2QL.js} +29 -10
- package/dist/{chunk-JLATHUM5.cjs → chunk-QBYD37C7.cjs} +21 -14
- package/dist/{chunk-E6LJZ5ME.js → chunk-QFIG4XKQ.js} +1 -1
- package/dist/{chunk-764RYNTE.cjs → chunk-QS2XIJC4.cjs} +63 -29
- package/dist/{chunk-GTQM7JU7.js → chunk-R42K7GPF.js} +3 -1
- package/dist/{chunk-3BWJXTLC.cjs → chunk-RHWADEUT.cjs} +81 -58
- package/dist/{chunk-JNZYTS3B.js → chunk-RS2A52JD.js} +1 -1
- package/dist/{chunk-5OBRFII2.js → chunk-SIAKIOPW.js} +81 -23
- package/dist/{chunk-V6RGXSG4.cjs → chunk-SVC7H7K4.cjs} +3 -1
- package/dist/{chunk-EM73ZZSP.cjs → chunk-TID6AR5K.cjs} +49 -30
- package/dist/{chunk-VXDYNCOX.js → chunk-TODG5RSV.js} +172 -19
- package/dist/{chunk-VPCROEJW.cjs → chunk-TZ2VLKIG.cjs} +170 -103
- package/dist/{chunk-WGCTQNSQ.js → chunk-UHBMFLSF.js} +1 -1
- package/dist/{chunk-PIWBUHRB.cjs → chunk-UPQLFVFU.cjs} +83 -43
- package/dist/{chunk-B5UCLTPZ.cjs → chunk-UQC2FUXC.cjs} +2 -1
- package/dist/{chunk-RGG6OEA3.js → chunk-VUXQHI6K.js} +60 -26
- package/dist/{chunk-2LQ7T2GE.js → chunk-WUUDJ3TF.js} +3 -3
- package/dist/{chunk-HZBNUY7E.js → chunk-WZ6OIVJK.js} +2 -1
- package/dist/{chunk-5XAVWKUN.js → chunk-X4X6WCXH.js} +74 -4
- package/dist/{chunk-NPO64SVN.js → chunk-ZFUBVSZD.js} +0 -4
- package/dist/{chunk-S6MI7ZLE.js → chunk-ZKNBNGHR.js} +12 -7
- package/dist/{chunk-5KMF6HGF.js → chunk-ZUGWIOG4.js} +75 -52
- package/dist/client/plugins.cjs +215 -21
- package/dist/client/plugins.d.cts +176 -10
- package/dist/client/plugins.d.ts +176 -10
- package/dist/client/plugins.js +214 -14
- package/dist/client.d.cts +6 -7
- package/dist/client.d.ts +6 -7
- package/dist/cookies.d.cts +2 -2
- package/dist/cookies.d.ts +2 -2
- package/dist/db.cjs +29 -29
- package/dist/db.d.cts +6 -6
- package/dist/db.d.ts +6 -6
- package/dist/db.js +3 -3
- package/dist/index-BX_H-j6k.d.cts +7755 -0
- package/dist/{index-Ba5bMY6A.d.cts → index-BuRgaJZR.d.cts} +194 -2
- package/dist/index-D5zWKzf9.d.ts +7755 -0
- package/dist/{index-XrJz4AYF.d.ts → index-moQjyfmm.d.ts} +194 -2
- package/dist/index.cjs +19 -19
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/next-js.cjs +24 -24
- package/dist/next-js.d.cts +2 -2
- package/dist/next-js.d.ts +2 -2
- package/dist/next-js.js +23 -23
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/oauth2.cjs +9 -9
- package/dist/oauth2.d.cts +6 -5
- package/dist/oauth2.d.ts +6 -5
- package/dist/oauth2.js +2 -2
- package/dist/plugins/admin.cjs +7 -7
- package/dist/plugins/admin.d.cts +163 -32
- package/dist/plugins/admin.d.ts +163 -32
- package/dist/plugins/admin.js +6 -6
- package/dist/plugins/anonymous.cjs +7 -7
- package/dist/plugins/anonymous.d.cts +8 -4
- package/dist/plugins/anonymous.d.ts +8 -4
- package/dist/plugins/anonymous.js +6 -6
- package/dist/plugins/bearer.cjs +7 -7
- package/dist/plugins/bearer.d.cts +2 -2
- package/dist/plugins/bearer.d.ts +2 -2
- package/dist/plugins/bearer.js +6 -6
- package/dist/{plugin → plugins}/custom-session.cjs +7 -7
- package/dist/{plugin → plugins}/custom-session.d.cts +8 -4
- package/dist/{plugin → plugins}/custom-session.d.ts +8 -4
- package/dist/{plugin → plugins}/custom-session.js +6 -6
- package/dist/plugins/email-otp.cjs +7 -7
- package/dist/plugins/email-otp.d.cts +44 -16
- package/dist/plugins/email-otp.d.ts +44 -16
- package/dist/plugins/email-otp.js +6 -6
- package/dist/plugins/generic-oauth.cjs +7 -7
- package/dist/plugins/generic-oauth.d.cts +95 -6
- package/dist/plugins/generic-oauth.d.ts +95 -6
- package/dist/plugins/generic-oauth.js +6 -6
- package/dist/plugins/jwt.cjs +7 -7
- package/dist/plugins/jwt.d.cts +28 -6
- package/dist/plugins/jwt.d.ts +28 -6
- package/dist/plugins/jwt.js +6 -6
- package/dist/plugins/magic-link.cjs +7 -7
- package/dist/plugins/magic-link.d.cts +16 -4
- package/dist/plugins/magic-link.d.ts +16 -4
- package/dist/plugins/magic-link.js +6 -6
- package/dist/plugins/multi-session.cjs +7 -7
- package/dist/plugins/multi-session.d.cts +20 -8
- package/dist/plugins/multi-session.d.ts +20 -8
- package/dist/plugins/multi-session.js +6 -6
- package/dist/plugins/oidc-provider.cjs +7 -7
- package/dist/plugins/oidc-provider.d.cts +58 -15
- package/dist/plugins/oidc-provider.d.ts +58 -15
- package/dist/plugins/oidc-provider.js +6 -6
- package/dist/plugins/one-tap.cjs +7 -7
- package/dist/plugins/one-tap.d.cts +13 -2
- package/dist/plugins/one-tap.d.ts +13 -2
- package/dist/plugins/one-tap.js +6 -6
- package/dist/plugins/open-api.cjs +8 -8
- package/dist/plugins/open-api.d.cts +14 -6
- package/dist/plugins/open-api.d.ts +14 -6
- package/dist/plugins/open-api.js +7 -7
- package/dist/plugins/organization.cjs +7 -7
- package/dist/plugins/organization.d.cts +3 -3
- package/dist/plugins/organization.d.ts +3 -3
- package/dist/plugins/organization.js +6 -6
- package/dist/plugins/passkey.cjs +19 -31
- package/dist/plugins/passkey.d.cts +45 -148
- package/dist/plugins/passkey.d.ts +45 -148
- package/dist/plugins/passkey.js +5 -9
- package/dist/plugins/phone-number.cjs +7 -7
- package/dist/plugins/phone-number.d.cts +122 -9
- package/dist/plugins/phone-number.d.ts +122 -9
- package/dist/plugins/phone-number.js +6 -6
- package/dist/plugins/sso.cjs +27 -19
- package/dist/plugins/sso.d.cts +24 -8
- package/dist/plugins/sso.d.ts +24 -8
- package/dist/plugins/sso.js +14 -6
- package/dist/plugins/two-factor.cjs +7 -7
- package/dist/plugins/two-factor.d.cts +62 -22
- package/dist/plugins/two-factor.d.ts +62 -22
- package/dist/plugins/two-factor.js +6 -6
- package/dist/plugins/username.cjs +7 -7
- package/dist/plugins/username.d.cts +36 -4
- package/dist/plugins/username.d.ts +36 -4
- package/dist/plugins/username.js +6 -6
- package/dist/plugins.cjs +43 -43
- package/dist/plugins.d.cts +11 -7
- package/dist/plugins.d.ts +11 -7
- package/dist/plugins.js +23 -23
- package/dist/react.d.cts +7 -9
- package/dist/react.d.ts +7 -9
- package/dist/social.cjs +32 -20
- package/dist/social.d.cts +1 -1
- package/dist/social.d.ts +1 -1
- package/dist/social.js +3 -3
- package/dist/solid.d.cts +7 -7
- package/dist/solid.d.ts +7 -7
- package/dist/{state-Cm8el5M1.d.ts → state-CLmFUxz3.d.ts} +1 -1
- package/dist/{state-DcraY2_H.d.cts → state-CZgzjtR5.d.cts} +1 -1
- package/dist/svelte-kit.d.cts +2 -2
- package/dist/svelte-kit.d.ts +2 -2
- package/dist/svelte.d.cts +7 -7
- package/dist/svelte.d.ts +7 -7
- package/dist/types.d.cts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/vue.d.cts +7 -7
- package/dist/vue.d.ts +7 -7
- package/package.json +4 -4
- package/dist/chunk-4WCY4Y5J.js +0 -173
- package/dist/chunk-5AZFOKWY.cjs +0 -176
- package/dist/index-CvlKSqnF.d.cts +0 -4023
- package/dist/index-Ivs2EsUL.d.ts +0 -4023
package/dist/index-Ivs2EsUL.d.ts
DELETED
|
@@ -1,4023 +0,0 @@
|
|
|
1
|
-
import { z, ZodLiteral, ZodObject, ZodOptional, ZodArray, ZodString } from 'zod';
|
|
2
|
-
import * as better_call from 'better-call';
|
|
3
|
-
import { AccessControl, Role, StatementsPrimitive, defaultRoles } from './plugins/access.js';
|
|
4
|
-
import { U as User, S as Session, G as GenericEndpointContext } from './auth-DcMc3BIq.js';
|
|
5
|
-
import { b as Prettify } from './helper-Bi8FQwDD.js';
|
|
6
|
-
|
|
7
|
-
declare const organizationSchema: z.ZodObject<{
|
|
8
|
-
id: z.ZodDefault<z.ZodString>;
|
|
9
|
-
name: z.ZodString;
|
|
10
|
-
slug: z.ZodString;
|
|
11
|
-
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodEffects<z.ZodString, any, string>]>>>;
|
|
13
|
-
createdAt: z.ZodDate;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
createdAt: Date;
|
|
18
|
-
slug: string;
|
|
19
|
-
metadata?: any;
|
|
20
|
-
logo?: string | null | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
name: string;
|
|
23
|
-
createdAt: Date;
|
|
24
|
-
slug: string;
|
|
25
|
-
metadata?: string | Record<string, string> | null | undefined;
|
|
26
|
-
id?: string | undefined;
|
|
27
|
-
logo?: string | null | undefined;
|
|
28
|
-
}>;
|
|
29
|
-
declare const memberSchema: z.ZodObject<{
|
|
30
|
-
id: z.ZodDefault<z.ZodString>;
|
|
31
|
-
organizationId: z.ZodString;
|
|
32
|
-
userId: z.ZodString;
|
|
33
|
-
role: z.ZodString;
|
|
34
|
-
createdAt: z.ZodDate;
|
|
35
|
-
}, "strip", z.ZodTypeAny, {
|
|
36
|
-
id: string;
|
|
37
|
-
createdAt: Date;
|
|
38
|
-
userId: string;
|
|
39
|
-
organizationId: string;
|
|
40
|
-
role: string;
|
|
41
|
-
}, {
|
|
42
|
-
createdAt: Date;
|
|
43
|
-
userId: string;
|
|
44
|
-
organizationId: string;
|
|
45
|
-
role: string;
|
|
46
|
-
id?: string | undefined;
|
|
47
|
-
}>;
|
|
48
|
-
declare const invitationSchema: z.ZodObject<{
|
|
49
|
-
id: z.ZodDefault<z.ZodString>;
|
|
50
|
-
organizationId: z.ZodString;
|
|
51
|
-
email: z.ZodString;
|
|
52
|
-
role: z.ZodString;
|
|
53
|
-
status: z.ZodDefault<z.ZodEnum<["pending", "accepted", "rejected", "canceled"]>>;
|
|
54
|
-
/**
|
|
55
|
-
* The id of the user who invited the user.
|
|
56
|
-
*/
|
|
57
|
-
inviterId: z.ZodString;
|
|
58
|
-
expiresAt: z.ZodDate;
|
|
59
|
-
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
id: string;
|
|
61
|
-
email: string;
|
|
62
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
63
|
-
expiresAt: Date;
|
|
64
|
-
organizationId: string;
|
|
65
|
-
role: string;
|
|
66
|
-
inviterId: string;
|
|
67
|
-
}, {
|
|
68
|
-
email: string;
|
|
69
|
-
expiresAt: Date;
|
|
70
|
-
organizationId: string;
|
|
71
|
-
role: string;
|
|
72
|
-
inviterId: string;
|
|
73
|
-
id?: string | undefined;
|
|
74
|
-
status?: "pending" | "accepted" | "rejected" | "canceled" | undefined;
|
|
75
|
-
}>;
|
|
76
|
-
type Organization = z.infer<typeof organizationSchema>;
|
|
77
|
-
type Member = z.infer<typeof memberSchema>;
|
|
78
|
-
type Invitation = z.infer<typeof invitationSchema>;
|
|
79
|
-
type InferRolesFromOption<O extends OrganizationOptions | undefined> = ZodLiteral<O extends {
|
|
80
|
-
roles: any;
|
|
81
|
-
} ? keyof O["roles"] : "admin" | "member" | "owner">;
|
|
82
|
-
|
|
83
|
-
interface OrganizationOptions {
|
|
84
|
-
/**
|
|
85
|
-
* Configure whether new users are able to create new organizations.
|
|
86
|
-
* You can also pass a function that returns a boolean.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* allowUserToCreateOrganization: async (user) => {
|
|
91
|
-
* const plan = await getUserPlan(user);
|
|
92
|
-
* return plan.name === "pro";
|
|
93
|
-
* }
|
|
94
|
-
* ```
|
|
95
|
-
* @default true
|
|
96
|
-
*/
|
|
97
|
-
allowUserToCreateOrganization?: boolean | ((user: User) => Promise<boolean> | boolean);
|
|
98
|
-
/**
|
|
99
|
-
* The maximum number of organizations a user can create.
|
|
100
|
-
*
|
|
101
|
-
* You can also pass a function that returns a boolean
|
|
102
|
-
*/
|
|
103
|
-
organizationLimit?: number | ((user: User) => Promise<boolean> | boolean);
|
|
104
|
-
/**
|
|
105
|
-
* The role that is assigned to the creator of the
|
|
106
|
-
* organization.
|
|
107
|
-
*
|
|
108
|
-
* @default "owner"
|
|
109
|
-
*/
|
|
110
|
-
creatorRole?: string;
|
|
111
|
-
/**
|
|
112
|
-
* The number of memberships a user can have in an organization.
|
|
113
|
-
*
|
|
114
|
-
* @default "unlimited"
|
|
115
|
-
*/
|
|
116
|
-
membershipLimit?: number;
|
|
117
|
-
/**
|
|
118
|
-
* Configure the roles and permissions for the
|
|
119
|
-
* organization plugin.
|
|
120
|
-
*/
|
|
121
|
-
ac?: AccessControl;
|
|
122
|
-
/**
|
|
123
|
-
* Custom permissions for roles.
|
|
124
|
-
*/
|
|
125
|
-
roles?: {
|
|
126
|
-
[key in string]?: Role<any>;
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* The expiration time for the invitation link.
|
|
130
|
-
*
|
|
131
|
-
* @default 48 hours
|
|
132
|
-
*/
|
|
133
|
-
invitationExpiresIn?: number;
|
|
134
|
-
/**
|
|
135
|
-
* Send an email with the
|
|
136
|
-
* invitation link to the user.
|
|
137
|
-
*
|
|
138
|
-
* Note: Better Auth doesn't
|
|
139
|
-
* generate invitation URLs.
|
|
140
|
-
* You'll need to construct the
|
|
141
|
-
* URL using the invitation ID
|
|
142
|
-
* and pass it to the
|
|
143
|
-
* acceptInvitation endpoint for
|
|
144
|
-
* the user to accept the
|
|
145
|
-
* invitation.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```ts
|
|
149
|
-
* sendInvitationEmail: async (data) => {
|
|
150
|
-
* const url = `https://yourapp.com/organization/
|
|
151
|
-
* accept-invitation?id=${data.id}`;
|
|
152
|
-
* await sendEmail(data.email, "Invitation to join
|
|
153
|
-
* organization", `Click the link to join the
|
|
154
|
-
* organization: ${url}`);
|
|
155
|
-
* }
|
|
156
|
-
* ```
|
|
157
|
-
*/
|
|
158
|
-
sendInvitationEmail?: (data: {
|
|
159
|
-
/**
|
|
160
|
-
* the invitation id
|
|
161
|
-
*/
|
|
162
|
-
id: string;
|
|
163
|
-
/**
|
|
164
|
-
* the role of the user
|
|
165
|
-
*/
|
|
166
|
-
role: string;
|
|
167
|
-
/**
|
|
168
|
-
* the email of the user
|
|
169
|
-
*/
|
|
170
|
-
email: string;
|
|
171
|
-
/**
|
|
172
|
-
* the organization the user is invited to join
|
|
173
|
-
*/
|
|
174
|
-
organization: Organization;
|
|
175
|
-
/**
|
|
176
|
-
* the member who is inviting the user
|
|
177
|
-
*/
|
|
178
|
-
inviter: Member & {
|
|
179
|
-
user: User;
|
|
180
|
-
};
|
|
181
|
-
},
|
|
182
|
-
/**
|
|
183
|
-
* The request object
|
|
184
|
-
*/
|
|
185
|
-
request?: Request) => Promise<void>;
|
|
186
|
-
/**
|
|
187
|
-
* The schema for the organization plugin.
|
|
188
|
-
*/
|
|
189
|
-
schema?: {
|
|
190
|
-
session?: {
|
|
191
|
-
fields?: {
|
|
192
|
-
activeOrganizationId?: string;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
organization?: {
|
|
196
|
-
modelName?: string;
|
|
197
|
-
fields?: {
|
|
198
|
-
[key in keyof Omit<Organization, "id">]?: string;
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
member?: {
|
|
202
|
-
modelName?: string;
|
|
203
|
-
fields?: {
|
|
204
|
-
[key in keyof Omit<Member, "id">]?: string;
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
invitation?: {
|
|
208
|
-
modelName?: string;
|
|
209
|
-
fields?: {
|
|
210
|
-
[key in keyof Omit<Invitation, "id">]?: string;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* Configure how organization deletion is handled
|
|
216
|
-
*/
|
|
217
|
-
organizationDeletion?: {
|
|
218
|
-
/**
|
|
219
|
-
* disable deleting organization
|
|
220
|
-
*/
|
|
221
|
-
disabled?: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* A callback that runs before the organization is
|
|
224
|
-
* deleted
|
|
225
|
-
*
|
|
226
|
-
* @param data - organization and user object
|
|
227
|
-
* @param request - the request object
|
|
228
|
-
* @returns
|
|
229
|
-
*/
|
|
230
|
-
beforeDelete?: (data: {
|
|
231
|
-
organization: Organization;
|
|
232
|
-
user: User;
|
|
233
|
-
}, request?: Request) => Promise<void>;
|
|
234
|
-
/**
|
|
235
|
-
* A callback that runs after the organization is
|
|
236
|
-
* deleted
|
|
237
|
-
*
|
|
238
|
-
* @param data - organization and user object
|
|
239
|
-
* @param request - the request object
|
|
240
|
-
* @returns
|
|
241
|
-
*/
|
|
242
|
-
afterDelete?: (data: {
|
|
243
|
-
organization: Organization;
|
|
244
|
-
user: User;
|
|
245
|
-
}, request?: Request) => Promise<void>;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Organization plugin for Better Auth. Organization allows you to create teams, members,
|
|
250
|
-
* and manage access control for your users.
|
|
251
|
-
*
|
|
252
|
-
* @example
|
|
253
|
-
* ```ts
|
|
254
|
-
* const auth = createAuth({
|
|
255
|
-
* plugins: [
|
|
256
|
-
* organization({
|
|
257
|
-
* allowUserToCreateOrganization: true,
|
|
258
|
-
* }),
|
|
259
|
-
* ],
|
|
260
|
-
* });
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
declare const organization: <O extends OrganizationOptions>(options?: O) => {
|
|
264
|
-
id: "organization";
|
|
265
|
-
endpoints: {
|
|
266
|
-
hasPermission: {
|
|
267
|
-
<Context extends ({
|
|
268
|
-
body: z.baseObjectInputType<{
|
|
269
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
270
|
-
readonly organization: readonly ["update", "delete"];
|
|
271
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
272
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
273
|
-
} : {
|
|
274
|
-
readonly organization: readonly ["update", "delete"];
|
|
275
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
276
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
277
|
-
} : {
|
|
278
|
-
readonly organization: readonly ["update", "delete"];
|
|
279
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
280
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
281
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
282
|
-
readonly organization: readonly ["update", "delete"];
|
|
283
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
284
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
285
|
-
} : {
|
|
286
|
-
readonly organization: readonly ["update", "delete"];
|
|
287
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
288
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
289
|
-
} : {
|
|
290
|
-
readonly organization: readonly ["update", "delete"];
|
|
291
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
292
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
293
|
-
})[key][number]>>>; }>;
|
|
294
|
-
organizationId: ZodOptional<ZodString>;
|
|
295
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
296
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
297
|
-
readonly organization: readonly ["update", "delete"];
|
|
298
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
299
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
300
|
-
} : {
|
|
301
|
-
readonly organization: readonly ["update", "delete"];
|
|
302
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
303
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
304
|
-
} : {
|
|
305
|
-
readonly organization: readonly ["update", "delete"];
|
|
306
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
307
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
308
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
309
|
-
readonly organization: readonly ["update", "delete"];
|
|
310
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
311
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
312
|
-
} : {
|
|
313
|
-
readonly organization: readonly ["update", "delete"];
|
|
314
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
315
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
316
|
-
} : {
|
|
317
|
-
readonly organization: readonly ["update", "delete"];
|
|
318
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
319
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
320
|
-
})[key][number]>>>; }>;
|
|
321
|
-
organizationId: ZodOptional<ZodString>;
|
|
322
|
-
}>[k]; } : never;
|
|
323
|
-
method: "POST" | undefined;
|
|
324
|
-
query: Record<string, any> | undefined;
|
|
325
|
-
params: Record<string, any> | undefined;
|
|
326
|
-
request: Request | undefined;
|
|
327
|
-
headers: HeadersInit;
|
|
328
|
-
asResponse?: boolean;
|
|
329
|
-
returnHeaders?: boolean;
|
|
330
|
-
use?: better_call.Middleware[];
|
|
331
|
-
path?: string;
|
|
332
|
-
} extends infer T ? { [K_1 in keyof T as {
|
|
333
|
-
body: z.baseObjectInputType<{
|
|
334
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
335
|
-
readonly organization: readonly ["update", "delete"];
|
|
336
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
337
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
338
|
-
} : {
|
|
339
|
-
readonly organization: readonly ["update", "delete"];
|
|
340
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
341
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
342
|
-
} : {
|
|
343
|
-
readonly organization: readonly ["update", "delete"];
|
|
344
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
345
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
346
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
347
|
-
readonly organization: readonly ["update", "delete"];
|
|
348
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
349
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
350
|
-
} : {
|
|
351
|
-
readonly organization: readonly ["update", "delete"];
|
|
352
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
353
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
354
|
-
} : {
|
|
355
|
-
readonly organization: readonly ["update", "delete"];
|
|
356
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
357
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
358
|
-
})[key][number]>>>; }>;
|
|
359
|
-
organizationId: ZodOptional<ZodString>;
|
|
360
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
361
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
362
|
-
readonly organization: readonly ["update", "delete"];
|
|
363
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
364
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
365
|
-
} : {
|
|
366
|
-
readonly organization: readonly ["update", "delete"];
|
|
367
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
368
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
369
|
-
} : {
|
|
370
|
-
readonly organization: readonly ["update", "delete"];
|
|
371
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
372
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
373
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
374
|
-
readonly organization: readonly ["update", "delete"];
|
|
375
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
376
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
377
|
-
} : {
|
|
378
|
-
readonly organization: readonly ["update", "delete"];
|
|
379
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
380
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
381
|
-
} : {
|
|
382
|
-
readonly organization: readonly ["update", "delete"];
|
|
383
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
384
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
385
|
-
})[key][number]>>>; }>;
|
|
386
|
-
organizationId: ZodOptional<ZodString>;
|
|
387
|
-
}>[k]; } : never;
|
|
388
|
-
method: "POST" | undefined;
|
|
389
|
-
query: Record<string, any> | undefined;
|
|
390
|
-
params: Record<string, any> | undefined;
|
|
391
|
-
request: Request | undefined;
|
|
392
|
-
headers: HeadersInit;
|
|
393
|
-
asResponse?: boolean;
|
|
394
|
-
returnHeaders?: boolean;
|
|
395
|
-
use?: better_call.Middleware[];
|
|
396
|
-
path?: string;
|
|
397
|
-
}[K_1] extends never ? never : undefined extends {
|
|
398
|
-
body: z.baseObjectInputType<{
|
|
399
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
400
|
-
readonly organization: readonly ["update", "delete"];
|
|
401
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
402
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
403
|
-
} : {
|
|
404
|
-
readonly organization: readonly ["update", "delete"];
|
|
405
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
406
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
407
|
-
} : {
|
|
408
|
-
readonly organization: readonly ["update", "delete"];
|
|
409
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
410
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
411
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
412
|
-
readonly organization: readonly ["update", "delete"];
|
|
413
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
414
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
415
|
-
} : {
|
|
416
|
-
readonly organization: readonly ["update", "delete"];
|
|
417
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
418
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
419
|
-
} : {
|
|
420
|
-
readonly organization: readonly ["update", "delete"];
|
|
421
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
422
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
423
|
-
})[key][number]>>>; }>;
|
|
424
|
-
organizationId: ZodOptional<ZodString>;
|
|
425
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
426
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
427
|
-
readonly organization: readonly ["update", "delete"];
|
|
428
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
429
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
430
|
-
} : {
|
|
431
|
-
readonly organization: readonly ["update", "delete"];
|
|
432
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
433
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
434
|
-
} : {
|
|
435
|
-
readonly organization: readonly ["update", "delete"];
|
|
436
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
437
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
438
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
439
|
-
readonly organization: readonly ["update", "delete"];
|
|
440
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
441
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
442
|
-
} : {
|
|
443
|
-
readonly organization: readonly ["update", "delete"];
|
|
444
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
445
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
446
|
-
} : {
|
|
447
|
-
readonly organization: readonly ["update", "delete"];
|
|
448
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
449
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
450
|
-
})[key][number]>>>; }>;
|
|
451
|
-
organizationId: ZodOptional<ZodString>;
|
|
452
|
-
}>[k]; } : never;
|
|
453
|
-
method: "POST" | undefined;
|
|
454
|
-
query: Record<string, any> | undefined;
|
|
455
|
-
params: Record<string, any> | undefined;
|
|
456
|
-
request: Request | undefined;
|
|
457
|
-
headers: HeadersInit;
|
|
458
|
-
asResponse?: boolean;
|
|
459
|
-
returnHeaders?: boolean;
|
|
460
|
-
use?: better_call.Middleware[];
|
|
461
|
-
path?: string;
|
|
462
|
-
}[K_1] ? never : K_1]: {
|
|
463
|
-
body: z.baseObjectInputType<{
|
|
464
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
465
|
-
readonly organization: readonly ["update", "delete"];
|
|
466
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
467
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
468
|
-
} : {
|
|
469
|
-
readonly organization: readonly ["update", "delete"];
|
|
470
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
471
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
472
|
-
} : {
|
|
473
|
-
readonly organization: readonly ["update", "delete"];
|
|
474
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
475
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
476
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
477
|
-
readonly organization: readonly ["update", "delete"];
|
|
478
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
479
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
480
|
-
} : {
|
|
481
|
-
readonly organization: readonly ["update", "delete"];
|
|
482
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
483
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
484
|
-
} : {
|
|
485
|
-
readonly organization: readonly ["update", "delete"];
|
|
486
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
487
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
488
|
-
})[key][number]>>>; }>;
|
|
489
|
-
organizationId: ZodOptional<ZodString>;
|
|
490
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
491
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
492
|
-
readonly organization: readonly ["update", "delete"];
|
|
493
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
494
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
495
|
-
} : {
|
|
496
|
-
readonly organization: readonly ["update", "delete"];
|
|
497
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
498
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
499
|
-
} : {
|
|
500
|
-
readonly organization: readonly ["update", "delete"];
|
|
501
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
502
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
503
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
504
|
-
readonly organization: readonly ["update", "delete"];
|
|
505
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
506
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
507
|
-
} : {
|
|
508
|
-
readonly organization: readonly ["update", "delete"];
|
|
509
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
510
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
511
|
-
} : {
|
|
512
|
-
readonly organization: readonly ["update", "delete"];
|
|
513
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
514
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
515
|
-
})[key][number]>>>; }>;
|
|
516
|
-
organizationId: ZodOptional<ZodString>;
|
|
517
|
-
}>[k]; } : never;
|
|
518
|
-
method: "POST" | undefined;
|
|
519
|
-
query: Record<string, any> | undefined;
|
|
520
|
-
params: Record<string, any> | undefined;
|
|
521
|
-
request: Request | undefined;
|
|
522
|
-
headers: HeadersInit;
|
|
523
|
-
asResponse?: boolean;
|
|
524
|
-
returnHeaders?: boolean;
|
|
525
|
-
use?: better_call.Middleware[];
|
|
526
|
-
path?: string;
|
|
527
|
-
}[K_1]; } : never) & ({
|
|
528
|
-
body: z.baseObjectInputType<{
|
|
529
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
530
|
-
readonly organization: readonly ["update", "delete"];
|
|
531
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
532
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
533
|
-
} : {
|
|
534
|
-
readonly organization: readonly ["update", "delete"];
|
|
535
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
536
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
537
|
-
} : {
|
|
538
|
-
readonly organization: readonly ["update", "delete"];
|
|
539
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
540
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
541
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
542
|
-
readonly organization: readonly ["update", "delete"];
|
|
543
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
544
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
545
|
-
} : {
|
|
546
|
-
readonly organization: readonly ["update", "delete"];
|
|
547
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
548
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
549
|
-
} : {
|
|
550
|
-
readonly organization: readonly ["update", "delete"];
|
|
551
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
552
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
553
|
-
})[key][number]>>>; }>;
|
|
554
|
-
organizationId: ZodOptional<ZodString>;
|
|
555
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
556
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
557
|
-
readonly organization: readonly ["update", "delete"];
|
|
558
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
559
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
560
|
-
} : {
|
|
561
|
-
readonly organization: readonly ["update", "delete"];
|
|
562
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
563
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
564
|
-
} : {
|
|
565
|
-
readonly organization: readonly ["update", "delete"];
|
|
566
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
567
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
568
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
569
|
-
readonly organization: readonly ["update", "delete"];
|
|
570
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
571
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
572
|
-
} : {
|
|
573
|
-
readonly organization: readonly ["update", "delete"];
|
|
574
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
575
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
576
|
-
} : {
|
|
577
|
-
readonly organization: readonly ["update", "delete"];
|
|
578
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
579
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
580
|
-
})[key][number]>>>; }>;
|
|
581
|
-
organizationId: ZodOptional<ZodString>;
|
|
582
|
-
}>[k]; } : never;
|
|
583
|
-
method: "POST" | undefined;
|
|
584
|
-
query: Record<string, any> | undefined;
|
|
585
|
-
params: Record<string, any> | undefined;
|
|
586
|
-
request: Request | undefined;
|
|
587
|
-
headers: HeadersInit;
|
|
588
|
-
asResponse?: boolean;
|
|
589
|
-
returnHeaders?: boolean;
|
|
590
|
-
use?: better_call.Middleware[];
|
|
591
|
-
path?: string;
|
|
592
|
-
} extends infer T_2 ? { [K_2 in keyof T_2 as undefined extends {
|
|
593
|
-
body: z.baseObjectInputType<{
|
|
594
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
595
|
-
readonly organization: readonly ["update", "delete"];
|
|
596
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
597
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
598
|
-
} : {
|
|
599
|
-
readonly organization: readonly ["update", "delete"];
|
|
600
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
601
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
602
|
-
} : {
|
|
603
|
-
readonly organization: readonly ["update", "delete"];
|
|
604
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
605
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
606
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
607
|
-
readonly organization: readonly ["update", "delete"];
|
|
608
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
609
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
610
|
-
} : {
|
|
611
|
-
readonly organization: readonly ["update", "delete"];
|
|
612
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
613
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
614
|
-
} : {
|
|
615
|
-
readonly organization: readonly ["update", "delete"];
|
|
616
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
617
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
618
|
-
})[key][number]>>>; }>;
|
|
619
|
-
organizationId: ZodOptional<ZodString>;
|
|
620
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
621
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
622
|
-
readonly organization: readonly ["update", "delete"];
|
|
623
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
624
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
625
|
-
} : {
|
|
626
|
-
readonly organization: readonly ["update", "delete"];
|
|
627
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
628
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
629
|
-
} : {
|
|
630
|
-
readonly organization: readonly ["update", "delete"];
|
|
631
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
632
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
633
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
634
|
-
readonly organization: readonly ["update", "delete"];
|
|
635
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
636
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
637
|
-
} : {
|
|
638
|
-
readonly organization: readonly ["update", "delete"];
|
|
639
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
640
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
641
|
-
} : {
|
|
642
|
-
readonly organization: readonly ["update", "delete"];
|
|
643
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
644
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
645
|
-
})[key][number]>>>; }>;
|
|
646
|
-
organizationId: ZodOptional<ZodString>;
|
|
647
|
-
}>[k]; } : never;
|
|
648
|
-
method: "POST" | undefined;
|
|
649
|
-
query: Record<string, any> | undefined;
|
|
650
|
-
params: Record<string, any> | undefined;
|
|
651
|
-
request: Request | undefined;
|
|
652
|
-
headers: HeadersInit;
|
|
653
|
-
asResponse?: boolean;
|
|
654
|
-
returnHeaders?: boolean;
|
|
655
|
-
use?: better_call.Middleware[];
|
|
656
|
-
path?: string;
|
|
657
|
-
}[K_2] ? K_2 : never]?: {
|
|
658
|
-
body: z.baseObjectInputType<{
|
|
659
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
660
|
-
readonly organization: readonly ["update", "delete"];
|
|
661
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
662
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
663
|
-
} : {
|
|
664
|
-
readonly organization: readonly ["update", "delete"];
|
|
665
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
666
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
667
|
-
} : {
|
|
668
|
-
readonly organization: readonly ["update", "delete"];
|
|
669
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
670
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
671
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
672
|
-
readonly organization: readonly ["update", "delete"];
|
|
673
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
674
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
675
|
-
} : {
|
|
676
|
-
readonly organization: readonly ["update", "delete"];
|
|
677
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
678
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
679
|
-
} : {
|
|
680
|
-
readonly organization: readonly ["update", "delete"];
|
|
681
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
682
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
683
|
-
})[key][number]>>>; }>;
|
|
684
|
-
organizationId: ZodOptional<ZodString>;
|
|
685
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
686
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
687
|
-
readonly organization: readonly ["update", "delete"];
|
|
688
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
689
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
690
|
-
} : {
|
|
691
|
-
readonly organization: readonly ["update", "delete"];
|
|
692
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
693
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
694
|
-
} : {
|
|
695
|
-
readonly organization: readonly ["update", "delete"];
|
|
696
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
697
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
698
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
699
|
-
readonly organization: readonly ["update", "delete"];
|
|
700
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
701
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
702
|
-
} : {
|
|
703
|
-
readonly organization: readonly ["update", "delete"];
|
|
704
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
705
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
706
|
-
} : {
|
|
707
|
-
readonly organization: readonly ["update", "delete"];
|
|
708
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
709
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
710
|
-
})[key][number]>>>; }>;
|
|
711
|
-
organizationId: ZodOptional<ZodString>;
|
|
712
|
-
}>[k]; } : never;
|
|
713
|
-
method: "POST" | undefined;
|
|
714
|
-
query: Record<string, any> | undefined;
|
|
715
|
-
params: Record<string, any> | undefined;
|
|
716
|
-
request: Request | undefined;
|
|
717
|
-
headers: HeadersInit;
|
|
718
|
-
asResponse?: boolean;
|
|
719
|
-
returnHeaders?: boolean;
|
|
720
|
-
use?: better_call.Middleware[];
|
|
721
|
-
path?: string;
|
|
722
|
-
}[K_2] | undefined; } : never) extends infer T_3 ? { [K in keyof T_3]: (({
|
|
723
|
-
body: z.baseObjectInputType<{
|
|
724
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
725
|
-
readonly organization: readonly ["update", "delete"];
|
|
726
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
727
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
728
|
-
} : {
|
|
729
|
-
readonly organization: readonly ["update", "delete"];
|
|
730
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
731
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
732
|
-
} : {
|
|
733
|
-
readonly organization: readonly ["update", "delete"];
|
|
734
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
735
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
736
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
737
|
-
readonly organization: readonly ["update", "delete"];
|
|
738
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
739
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
740
|
-
} : {
|
|
741
|
-
readonly organization: readonly ["update", "delete"];
|
|
742
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
743
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
744
|
-
} : {
|
|
745
|
-
readonly organization: readonly ["update", "delete"];
|
|
746
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
747
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
748
|
-
})[key][number]>>>; }>;
|
|
749
|
-
organizationId: ZodOptional<ZodString>;
|
|
750
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
751
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
752
|
-
readonly organization: readonly ["update", "delete"];
|
|
753
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
754
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
755
|
-
} : {
|
|
756
|
-
readonly organization: readonly ["update", "delete"];
|
|
757
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
758
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
759
|
-
} : {
|
|
760
|
-
readonly organization: readonly ["update", "delete"];
|
|
761
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
762
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
763
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
764
|
-
readonly organization: readonly ["update", "delete"];
|
|
765
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
766
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
767
|
-
} : {
|
|
768
|
-
readonly organization: readonly ["update", "delete"];
|
|
769
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
770
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
771
|
-
} : {
|
|
772
|
-
readonly organization: readonly ["update", "delete"];
|
|
773
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
774
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
775
|
-
})[key][number]>>>; }>;
|
|
776
|
-
organizationId: ZodOptional<ZodString>;
|
|
777
|
-
}>[k]; } : never;
|
|
778
|
-
method: "POST" | undefined;
|
|
779
|
-
query: Record<string, any> | undefined;
|
|
780
|
-
params: Record<string, any> | undefined;
|
|
781
|
-
request: Request | undefined;
|
|
782
|
-
headers: HeadersInit;
|
|
783
|
-
asResponse?: boolean;
|
|
784
|
-
returnHeaders?: boolean;
|
|
785
|
-
use?: better_call.Middleware[];
|
|
786
|
-
path?: string;
|
|
787
|
-
} extends infer T_4 ? { [K_1_1 in keyof T_4 as {
|
|
788
|
-
body: z.baseObjectInputType<{
|
|
789
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
790
|
-
readonly organization: readonly ["update", "delete"];
|
|
791
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
792
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
793
|
-
} : {
|
|
794
|
-
readonly organization: readonly ["update", "delete"];
|
|
795
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
796
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
797
|
-
} : {
|
|
798
|
-
readonly organization: readonly ["update", "delete"];
|
|
799
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
800
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
801
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
802
|
-
readonly organization: readonly ["update", "delete"];
|
|
803
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
804
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
805
|
-
} : {
|
|
806
|
-
readonly organization: readonly ["update", "delete"];
|
|
807
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
808
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
809
|
-
} : {
|
|
810
|
-
readonly organization: readonly ["update", "delete"];
|
|
811
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
812
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
813
|
-
})[key][number]>>>; }>;
|
|
814
|
-
organizationId: ZodOptional<ZodString>;
|
|
815
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
816
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
817
|
-
readonly organization: readonly ["update", "delete"];
|
|
818
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
819
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
820
|
-
} : {
|
|
821
|
-
readonly organization: readonly ["update", "delete"];
|
|
822
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
823
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
824
|
-
} : {
|
|
825
|
-
readonly organization: readonly ["update", "delete"];
|
|
826
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
827
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
828
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
829
|
-
readonly organization: readonly ["update", "delete"];
|
|
830
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
831
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
832
|
-
} : {
|
|
833
|
-
readonly organization: readonly ["update", "delete"];
|
|
834
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
835
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
836
|
-
} : {
|
|
837
|
-
readonly organization: readonly ["update", "delete"];
|
|
838
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
839
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
840
|
-
})[key][number]>>>; }>;
|
|
841
|
-
organizationId: ZodOptional<ZodString>;
|
|
842
|
-
}>[k]; } : never;
|
|
843
|
-
method: "POST" | undefined;
|
|
844
|
-
query: Record<string, any> | undefined;
|
|
845
|
-
params: Record<string, any> | undefined;
|
|
846
|
-
request: Request | undefined;
|
|
847
|
-
headers: HeadersInit;
|
|
848
|
-
asResponse?: boolean;
|
|
849
|
-
returnHeaders?: boolean;
|
|
850
|
-
use?: better_call.Middleware[];
|
|
851
|
-
path?: string;
|
|
852
|
-
}[K_1_1] extends never ? never : undefined extends {
|
|
853
|
-
body: z.baseObjectInputType<{
|
|
854
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
855
|
-
readonly organization: readonly ["update", "delete"];
|
|
856
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
857
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
858
|
-
} : {
|
|
859
|
-
readonly organization: readonly ["update", "delete"];
|
|
860
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
861
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
862
|
-
} : {
|
|
863
|
-
readonly organization: readonly ["update", "delete"];
|
|
864
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
865
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
866
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
867
|
-
readonly organization: readonly ["update", "delete"];
|
|
868
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
869
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
870
|
-
} : {
|
|
871
|
-
readonly organization: readonly ["update", "delete"];
|
|
872
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
873
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
874
|
-
} : {
|
|
875
|
-
readonly organization: readonly ["update", "delete"];
|
|
876
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
877
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
878
|
-
})[key][number]>>>; }>;
|
|
879
|
-
organizationId: ZodOptional<ZodString>;
|
|
880
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
881
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
882
|
-
readonly organization: readonly ["update", "delete"];
|
|
883
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
884
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
885
|
-
} : {
|
|
886
|
-
readonly organization: readonly ["update", "delete"];
|
|
887
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
888
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
889
|
-
} : {
|
|
890
|
-
readonly organization: readonly ["update", "delete"];
|
|
891
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
892
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
893
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
894
|
-
readonly organization: readonly ["update", "delete"];
|
|
895
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
896
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
897
|
-
} : {
|
|
898
|
-
readonly organization: readonly ["update", "delete"];
|
|
899
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
900
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
901
|
-
} : {
|
|
902
|
-
readonly organization: readonly ["update", "delete"];
|
|
903
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
904
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
905
|
-
})[key][number]>>>; }>;
|
|
906
|
-
organizationId: ZodOptional<ZodString>;
|
|
907
|
-
}>[k]; } : never;
|
|
908
|
-
method: "POST" | undefined;
|
|
909
|
-
query: Record<string, any> | undefined;
|
|
910
|
-
params: Record<string, any> | undefined;
|
|
911
|
-
request: Request | undefined;
|
|
912
|
-
headers: HeadersInit;
|
|
913
|
-
asResponse?: boolean;
|
|
914
|
-
returnHeaders?: boolean;
|
|
915
|
-
use?: better_call.Middleware[];
|
|
916
|
-
path?: string;
|
|
917
|
-
}[K_1_1] ? never : K_1_1]: {
|
|
918
|
-
body: z.baseObjectInputType<{
|
|
919
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
920
|
-
readonly organization: readonly ["update", "delete"];
|
|
921
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
922
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
923
|
-
} : {
|
|
924
|
-
readonly organization: readonly ["update", "delete"];
|
|
925
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
926
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
927
|
-
} : {
|
|
928
|
-
readonly organization: readonly ["update", "delete"];
|
|
929
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
930
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
931
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
932
|
-
readonly organization: readonly ["update", "delete"];
|
|
933
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
934
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
935
|
-
} : {
|
|
936
|
-
readonly organization: readonly ["update", "delete"];
|
|
937
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
938
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
939
|
-
} : {
|
|
940
|
-
readonly organization: readonly ["update", "delete"];
|
|
941
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
942
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
943
|
-
})[key][number]>>>; }>;
|
|
944
|
-
organizationId: ZodOptional<ZodString>;
|
|
945
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
946
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
947
|
-
readonly organization: readonly ["update", "delete"];
|
|
948
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
949
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
950
|
-
} : {
|
|
951
|
-
readonly organization: readonly ["update", "delete"];
|
|
952
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
953
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
954
|
-
} : {
|
|
955
|
-
readonly organization: readonly ["update", "delete"];
|
|
956
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
957
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
958
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
959
|
-
readonly organization: readonly ["update", "delete"];
|
|
960
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
961
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
962
|
-
} : {
|
|
963
|
-
readonly organization: readonly ["update", "delete"];
|
|
964
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
965
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
966
|
-
} : {
|
|
967
|
-
readonly organization: readonly ["update", "delete"];
|
|
968
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
969
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
970
|
-
})[key][number]>>>; }>;
|
|
971
|
-
organizationId: ZodOptional<ZodString>;
|
|
972
|
-
}>[k]; } : never;
|
|
973
|
-
method: "POST" | undefined;
|
|
974
|
-
query: Record<string, any> | undefined;
|
|
975
|
-
params: Record<string, any> | undefined;
|
|
976
|
-
request: Request | undefined;
|
|
977
|
-
headers: HeadersInit;
|
|
978
|
-
asResponse?: boolean;
|
|
979
|
-
returnHeaders?: boolean;
|
|
980
|
-
use?: better_call.Middleware[];
|
|
981
|
-
path?: string;
|
|
982
|
-
}[K_1_1]; } : never) & ({
|
|
983
|
-
body: z.baseObjectInputType<{
|
|
984
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
985
|
-
readonly organization: readonly ["update", "delete"];
|
|
986
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
987
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
988
|
-
} : {
|
|
989
|
-
readonly organization: readonly ["update", "delete"];
|
|
990
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
991
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
992
|
-
} : {
|
|
993
|
-
readonly organization: readonly ["update", "delete"];
|
|
994
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
995
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
996
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
997
|
-
readonly organization: readonly ["update", "delete"];
|
|
998
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
999
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1000
|
-
} : {
|
|
1001
|
-
readonly organization: readonly ["update", "delete"];
|
|
1002
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1003
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1004
|
-
} : {
|
|
1005
|
-
readonly organization: readonly ["update", "delete"];
|
|
1006
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1007
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1008
|
-
})[key][number]>>>; }>;
|
|
1009
|
-
organizationId: ZodOptional<ZodString>;
|
|
1010
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
1011
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1012
|
-
readonly organization: readonly ["update", "delete"];
|
|
1013
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1014
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1015
|
-
} : {
|
|
1016
|
-
readonly organization: readonly ["update", "delete"];
|
|
1017
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1018
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1019
|
-
} : {
|
|
1020
|
-
readonly organization: readonly ["update", "delete"];
|
|
1021
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1022
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1023
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1024
|
-
readonly organization: readonly ["update", "delete"];
|
|
1025
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1026
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1027
|
-
} : {
|
|
1028
|
-
readonly organization: readonly ["update", "delete"];
|
|
1029
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1030
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1031
|
-
} : {
|
|
1032
|
-
readonly organization: readonly ["update", "delete"];
|
|
1033
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1034
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1035
|
-
})[key][number]>>>; }>;
|
|
1036
|
-
organizationId: ZodOptional<ZodString>;
|
|
1037
|
-
}>[k]; } : never;
|
|
1038
|
-
method: "POST" | undefined;
|
|
1039
|
-
query: Record<string, any> | undefined;
|
|
1040
|
-
params: Record<string, any> | undefined;
|
|
1041
|
-
request: Request | undefined;
|
|
1042
|
-
headers: HeadersInit;
|
|
1043
|
-
asResponse?: boolean;
|
|
1044
|
-
returnHeaders?: boolean;
|
|
1045
|
-
use?: better_call.Middleware[];
|
|
1046
|
-
path?: string;
|
|
1047
|
-
} extends infer T_5 ? { [K_2_1 in keyof T_5 as undefined extends {
|
|
1048
|
-
body: z.baseObjectInputType<{
|
|
1049
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1050
|
-
readonly organization: readonly ["update", "delete"];
|
|
1051
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1052
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1053
|
-
} : {
|
|
1054
|
-
readonly organization: readonly ["update", "delete"];
|
|
1055
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1056
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1057
|
-
} : {
|
|
1058
|
-
readonly organization: readonly ["update", "delete"];
|
|
1059
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1060
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1061
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1062
|
-
readonly organization: readonly ["update", "delete"];
|
|
1063
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1064
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1065
|
-
} : {
|
|
1066
|
-
readonly organization: readonly ["update", "delete"];
|
|
1067
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1068
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1069
|
-
} : {
|
|
1070
|
-
readonly organization: readonly ["update", "delete"];
|
|
1071
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1072
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1073
|
-
})[key][number]>>>; }>;
|
|
1074
|
-
organizationId: ZodOptional<ZodString>;
|
|
1075
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
1076
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1077
|
-
readonly organization: readonly ["update", "delete"];
|
|
1078
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1079
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1080
|
-
} : {
|
|
1081
|
-
readonly organization: readonly ["update", "delete"];
|
|
1082
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1083
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1084
|
-
} : {
|
|
1085
|
-
readonly organization: readonly ["update", "delete"];
|
|
1086
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1087
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1088
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1089
|
-
readonly organization: readonly ["update", "delete"];
|
|
1090
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1091
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1092
|
-
} : {
|
|
1093
|
-
readonly organization: readonly ["update", "delete"];
|
|
1094
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1095
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1096
|
-
} : {
|
|
1097
|
-
readonly organization: readonly ["update", "delete"];
|
|
1098
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1099
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1100
|
-
})[key][number]>>>; }>;
|
|
1101
|
-
organizationId: ZodOptional<ZodString>;
|
|
1102
|
-
}>[k]; } : never;
|
|
1103
|
-
method: "POST" | undefined;
|
|
1104
|
-
query: Record<string, any> | undefined;
|
|
1105
|
-
params: Record<string, any> | undefined;
|
|
1106
|
-
request: Request | undefined;
|
|
1107
|
-
headers: HeadersInit;
|
|
1108
|
-
asResponse?: boolean;
|
|
1109
|
-
returnHeaders?: boolean;
|
|
1110
|
-
use?: better_call.Middleware[];
|
|
1111
|
-
path?: string;
|
|
1112
|
-
}[K_2_1] ? K_2_1 : never]?: {
|
|
1113
|
-
body: z.baseObjectInputType<{
|
|
1114
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1115
|
-
readonly organization: readonly ["update", "delete"];
|
|
1116
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1117
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1118
|
-
} : {
|
|
1119
|
-
readonly organization: readonly ["update", "delete"];
|
|
1120
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1121
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1122
|
-
} : {
|
|
1123
|
-
readonly organization: readonly ["update", "delete"];
|
|
1124
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1125
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1126
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1127
|
-
readonly organization: readonly ["update", "delete"];
|
|
1128
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1129
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1130
|
-
} : {
|
|
1131
|
-
readonly organization: readonly ["update", "delete"];
|
|
1132
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1133
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1134
|
-
} : {
|
|
1135
|
-
readonly organization: readonly ["update", "delete"];
|
|
1136
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1137
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1138
|
-
})[key][number]>>>; }>;
|
|
1139
|
-
organizationId: ZodOptional<ZodString>;
|
|
1140
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
1141
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1142
|
-
readonly organization: readonly ["update", "delete"];
|
|
1143
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1144
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1145
|
-
} : {
|
|
1146
|
-
readonly organization: readonly ["update", "delete"];
|
|
1147
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1148
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1149
|
-
} : {
|
|
1150
|
-
readonly organization: readonly ["update", "delete"];
|
|
1151
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1152
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1153
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1154
|
-
readonly organization: readonly ["update", "delete"];
|
|
1155
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1156
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1157
|
-
} : {
|
|
1158
|
-
readonly organization: readonly ["update", "delete"];
|
|
1159
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1160
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1161
|
-
} : {
|
|
1162
|
-
readonly organization: readonly ["update", "delete"];
|
|
1163
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1164
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1165
|
-
})[key][number]>>>; }>;
|
|
1166
|
-
organizationId: ZodOptional<ZodString>;
|
|
1167
|
-
}>[k]; } : never;
|
|
1168
|
-
method: "POST" | undefined;
|
|
1169
|
-
query: Record<string, any> | undefined;
|
|
1170
|
-
params: Record<string, any> | undefined;
|
|
1171
|
-
request: Request | undefined;
|
|
1172
|
-
headers: HeadersInit;
|
|
1173
|
-
asResponse?: boolean;
|
|
1174
|
-
returnHeaders?: boolean;
|
|
1175
|
-
use?: better_call.Middleware[];
|
|
1176
|
-
path?: string;
|
|
1177
|
-
}[K_2_1] | undefined; } : never))[K]; } : never>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1178
|
-
headers: Headers;
|
|
1179
|
-
response: {
|
|
1180
|
-
error: string;
|
|
1181
|
-
success: boolean;
|
|
1182
|
-
} | {
|
|
1183
|
-
error: null;
|
|
1184
|
-
success: boolean;
|
|
1185
|
-
};
|
|
1186
|
-
} : {
|
|
1187
|
-
error: string;
|
|
1188
|
-
success: boolean;
|
|
1189
|
-
} | {
|
|
1190
|
-
error: null;
|
|
1191
|
-
success: boolean;
|
|
1192
|
-
}>;
|
|
1193
|
-
options: {
|
|
1194
|
-
method: "POST";
|
|
1195
|
-
requireHeaders: true;
|
|
1196
|
-
body: ZodObject<{
|
|
1197
|
-
permission: ZodObject<{ [key in keyof (O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1198
|
-
readonly organization: readonly ["update", "delete"];
|
|
1199
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1200
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1201
|
-
} : {
|
|
1202
|
-
readonly organization: readonly ["update", "delete"];
|
|
1203
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1204
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1205
|
-
} : {
|
|
1206
|
-
readonly organization: readonly ["update", "delete"];
|
|
1207
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1208
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1209
|
-
})]: ZodOptional<ZodArray<ZodLiteral<(O["ac"] extends AccessControl<infer S extends StatementsPrimitive> ? S extends Record<string, any> ? S & {
|
|
1210
|
-
readonly organization: readonly ["update", "delete"];
|
|
1211
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1212
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1213
|
-
} : {
|
|
1214
|
-
readonly organization: readonly ["update", "delete"];
|
|
1215
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1216
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1217
|
-
} : {
|
|
1218
|
-
readonly organization: readonly ["update", "delete"];
|
|
1219
|
-
readonly member: readonly ["create", "update", "delete"];
|
|
1220
|
-
readonly invitation: readonly ["create", "cancel"];
|
|
1221
|
-
})[key][number]>>>; }>;
|
|
1222
|
-
organizationId: ZodOptional<ZodString>;
|
|
1223
|
-
}>;
|
|
1224
|
-
use: ((inputContext: {
|
|
1225
|
-
body?: any;
|
|
1226
|
-
query?: Record<string, any> | undefined;
|
|
1227
|
-
request?: Request | undefined;
|
|
1228
|
-
headers?: Headers | undefined;
|
|
1229
|
-
asResponse?: boolean | undefined;
|
|
1230
|
-
returnHeaders?: boolean | undefined;
|
|
1231
|
-
use?: better_call.Middleware[] | undefined;
|
|
1232
|
-
}) => Promise<{
|
|
1233
|
-
session: {
|
|
1234
|
-
session: Session & {
|
|
1235
|
-
activeOrganizationId?: string;
|
|
1236
|
-
};
|
|
1237
|
-
user: User;
|
|
1238
|
-
};
|
|
1239
|
-
}>)[];
|
|
1240
|
-
metadata: {
|
|
1241
|
-
openapi: {
|
|
1242
|
-
description: string;
|
|
1243
|
-
requestBody: {
|
|
1244
|
-
content: {
|
|
1245
|
-
"application/json": {
|
|
1246
|
-
schema: {
|
|
1247
|
-
type: string;
|
|
1248
|
-
properties: {
|
|
1249
|
-
permission: {
|
|
1250
|
-
type: string;
|
|
1251
|
-
description: string;
|
|
1252
|
-
};
|
|
1253
|
-
};
|
|
1254
|
-
required: string[];
|
|
1255
|
-
};
|
|
1256
|
-
};
|
|
1257
|
-
};
|
|
1258
|
-
};
|
|
1259
|
-
responses: {
|
|
1260
|
-
"200": {
|
|
1261
|
-
description: string;
|
|
1262
|
-
content: {
|
|
1263
|
-
"application/json": {
|
|
1264
|
-
schema: {
|
|
1265
|
-
type: string;
|
|
1266
|
-
properties: {
|
|
1267
|
-
error: {
|
|
1268
|
-
type: string;
|
|
1269
|
-
};
|
|
1270
|
-
success: {
|
|
1271
|
-
type: string;
|
|
1272
|
-
};
|
|
1273
|
-
};
|
|
1274
|
-
required: string[];
|
|
1275
|
-
};
|
|
1276
|
-
};
|
|
1277
|
-
};
|
|
1278
|
-
};
|
|
1279
|
-
};
|
|
1280
|
-
};
|
|
1281
|
-
};
|
|
1282
|
-
} & {
|
|
1283
|
-
use: any[];
|
|
1284
|
-
};
|
|
1285
|
-
path: "/organization/has-permission";
|
|
1286
|
-
};
|
|
1287
|
-
createOrganization: {
|
|
1288
|
-
<Context extends {
|
|
1289
|
-
body: {
|
|
1290
|
-
name: string;
|
|
1291
|
-
slug: string;
|
|
1292
|
-
metadata?: Record<string, any> | undefined;
|
|
1293
|
-
userId?: string | undefined;
|
|
1294
|
-
logo?: string | undefined;
|
|
1295
|
-
};
|
|
1296
|
-
method?: "POST" | undefined;
|
|
1297
|
-
query?: Record<string, any> | undefined;
|
|
1298
|
-
params?: Record<string, any> | undefined;
|
|
1299
|
-
request?: Request | undefined;
|
|
1300
|
-
headers?: HeadersInit | undefined;
|
|
1301
|
-
asResponse?: boolean | undefined;
|
|
1302
|
-
returnHeaders?: boolean | undefined;
|
|
1303
|
-
use?: better_call.Middleware[] | undefined;
|
|
1304
|
-
path?: string | undefined;
|
|
1305
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1306
|
-
headers: Headers;
|
|
1307
|
-
response: {
|
|
1308
|
-
metadata: any;
|
|
1309
|
-
members: {
|
|
1310
|
-
user: {
|
|
1311
|
-
id: string;
|
|
1312
|
-
name: string;
|
|
1313
|
-
email: string;
|
|
1314
|
-
image: string | null | undefined;
|
|
1315
|
-
};
|
|
1316
|
-
createdAt: Date;
|
|
1317
|
-
userId: string;
|
|
1318
|
-
organizationId: string;
|
|
1319
|
-
role: string;
|
|
1320
|
-
id?: string | undefined;
|
|
1321
|
-
}[];
|
|
1322
|
-
id: string;
|
|
1323
|
-
name: string;
|
|
1324
|
-
createdAt: Date;
|
|
1325
|
-
slug: string;
|
|
1326
|
-
logo?: string | null | undefined;
|
|
1327
|
-
} | null;
|
|
1328
|
-
} : {
|
|
1329
|
-
metadata: any;
|
|
1330
|
-
members: {
|
|
1331
|
-
user: {
|
|
1332
|
-
id: string;
|
|
1333
|
-
name: string;
|
|
1334
|
-
email: string;
|
|
1335
|
-
image: string | null | undefined;
|
|
1336
|
-
};
|
|
1337
|
-
createdAt: Date;
|
|
1338
|
-
userId: string;
|
|
1339
|
-
organizationId: string;
|
|
1340
|
-
role: string;
|
|
1341
|
-
id?: string | undefined;
|
|
1342
|
-
}[];
|
|
1343
|
-
id: string;
|
|
1344
|
-
name: string;
|
|
1345
|
-
createdAt: Date;
|
|
1346
|
-
slug: string;
|
|
1347
|
-
logo?: string | null | undefined;
|
|
1348
|
-
} | null>;
|
|
1349
|
-
options: {
|
|
1350
|
-
method: "POST";
|
|
1351
|
-
body: ZodObject<{
|
|
1352
|
-
name: ZodString;
|
|
1353
|
-
slug: ZodString;
|
|
1354
|
-
userId: ZodOptional<ZodString>;
|
|
1355
|
-
logo: ZodOptional<ZodString>;
|
|
1356
|
-
metadata: ZodOptional<z.ZodRecord<ZodString, z.ZodAny>>;
|
|
1357
|
-
}, "strip", z.ZodTypeAny, {
|
|
1358
|
-
name: string;
|
|
1359
|
-
slug: string;
|
|
1360
|
-
metadata?: Record<string, any> | undefined;
|
|
1361
|
-
userId?: string | undefined;
|
|
1362
|
-
logo?: string | undefined;
|
|
1363
|
-
}, {
|
|
1364
|
-
name: string;
|
|
1365
|
-
slug: string;
|
|
1366
|
-
metadata?: Record<string, any> | undefined;
|
|
1367
|
-
userId?: string | undefined;
|
|
1368
|
-
logo?: string | undefined;
|
|
1369
|
-
}>;
|
|
1370
|
-
use: ((inputContext: {
|
|
1371
|
-
body?: any;
|
|
1372
|
-
query?: Record<string, any> | undefined;
|
|
1373
|
-
request?: Request | undefined;
|
|
1374
|
-
headers?: Headers | undefined;
|
|
1375
|
-
asResponse?: boolean | undefined;
|
|
1376
|
-
returnHeaders?: boolean | undefined;
|
|
1377
|
-
use?: better_call.Middleware[] | undefined;
|
|
1378
|
-
}) => Promise<{
|
|
1379
|
-
orgOptions: OrganizationOptions;
|
|
1380
|
-
roles: typeof defaultRoles & {
|
|
1381
|
-
[key: string]: Role<{}>;
|
|
1382
|
-
};
|
|
1383
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
1384
|
-
session: Session & {
|
|
1385
|
-
activeOrganizationId?: string;
|
|
1386
|
-
};
|
|
1387
|
-
user: User;
|
|
1388
|
-
}>;
|
|
1389
|
-
}>)[];
|
|
1390
|
-
metadata: {
|
|
1391
|
-
openapi: {
|
|
1392
|
-
description: string;
|
|
1393
|
-
responses: {
|
|
1394
|
-
"200": {
|
|
1395
|
-
description: string;
|
|
1396
|
-
content: {
|
|
1397
|
-
"application/json": {
|
|
1398
|
-
schema: {
|
|
1399
|
-
type: string;
|
|
1400
|
-
description: string;
|
|
1401
|
-
$ref: string;
|
|
1402
|
-
};
|
|
1403
|
-
};
|
|
1404
|
-
};
|
|
1405
|
-
};
|
|
1406
|
-
};
|
|
1407
|
-
};
|
|
1408
|
-
};
|
|
1409
|
-
} & {
|
|
1410
|
-
use: any[];
|
|
1411
|
-
};
|
|
1412
|
-
path: "/organization/create";
|
|
1413
|
-
};
|
|
1414
|
-
updateOrganization: {
|
|
1415
|
-
<Context extends {
|
|
1416
|
-
body: {
|
|
1417
|
-
data: {
|
|
1418
|
-
metadata?: Record<string, any> | undefined;
|
|
1419
|
-
name?: string | undefined;
|
|
1420
|
-
slug?: string | undefined;
|
|
1421
|
-
logo?: string | undefined;
|
|
1422
|
-
};
|
|
1423
|
-
organizationId?: string | undefined;
|
|
1424
|
-
};
|
|
1425
|
-
headers: HeadersInit;
|
|
1426
|
-
method?: "POST" | undefined;
|
|
1427
|
-
query?: Record<string, any> | undefined;
|
|
1428
|
-
params?: Record<string, any> | undefined;
|
|
1429
|
-
request?: Request | undefined;
|
|
1430
|
-
asResponse?: boolean | undefined;
|
|
1431
|
-
returnHeaders?: boolean | undefined;
|
|
1432
|
-
use?: better_call.Middleware[] | undefined;
|
|
1433
|
-
path?: string | undefined;
|
|
1434
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1435
|
-
headers: Headers;
|
|
1436
|
-
response: {
|
|
1437
|
-
metadata: Record<string, any> | undefined;
|
|
1438
|
-
id: string;
|
|
1439
|
-
name: string;
|
|
1440
|
-
createdAt: Date;
|
|
1441
|
-
slug: string;
|
|
1442
|
-
logo?: string | null | undefined;
|
|
1443
|
-
} | null;
|
|
1444
|
-
} : {
|
|
1445
|
-
metadata: Record<string, any> | undefined;
|
|
1446
|
-
id: string;
|
|
1447
|
-
name: string;
|
|
1448
|
-
createdAt: Date;
|
|
1449
|
-
slug: string;
|
|
1450
|
-
logo?: string | null | undefined;
|
|
1451
|
-
} | null>;
|
|
1452
|
-
options: {
|
|
1453
|
-
method: "POST";
|
|
1454
|
-
body: ZodObject<{
|
|
1455
|
-
data: ZodObject<{
|
|
1456
|
-
name: ZodOptional<ZodOptional<ZodString>>;
|
|
1457
|
-
slug: ZodOptional<ZodOptional<ZodString>>;
|
|
1458
|
-
logo: ZodOptional<ZodOptional<ZodString>>;
|
|
1459
|
-
metadata: ZodOptional<ZodOptional<z.ZodRecord<ZodString, z.ZodAny>>>;
|
|
1460
|
-
}, "strip", z.ZodTypeAny, {
|
|
1461
|
-
metadata?: Record<string, any> | undefined;
|
|
1462
|
-
name?: string | undefined;
|
|
1463
|
-
slug?: string | undefined;
|
|
1464
|
-
logo?: string | undefined;
|
|
1465
|
-
}, {
|
|
1466
|
-
metadata?: Record<string, any> | undefined;
|
|
1467
|
-
name?: string | undefined;
|
|
1468
|
-
slug?: string | undefined;
|
|
1469
|
-
logo?: string | undefined;
|
|
1470
|
-
}>;
|
|
1471
|
-
organizationId: ZodOptional<ZodString>;
|
|
1472
|
-
}, "strip", z.ZodTypeAny, {
|
|
1473
|
-
data: {
|
|
1474
|
-
metadata?: Record<string, any> | undefined;
|
|
1475
|
-
name?: string | undefined;
|
|
1476
|
-
slug?: string | undefined;
|
|
1477
|
-
logo?: string | undefined;
|
|
1478
|
-
};
|
|
1479
|
-
organizationId?: string | undefined;
|
|
1480
|
-
}, {
|
|
1481
|
-
data: {
|
|
1482
|
-
metadata?: Record<string, any> | undefined;
|
|
1483
|
-
name?: string | undefined;
|
|
1484
|
-
slug?: string | undefined;
|
|
1485
|
-
logo?: string | undefined;
|
|
1486
|
-
};
|
|
1487
|
-
organizationId?: string | undefined;
|
|
1488
|
-
}>;
|
|
1489
|
-
requireHeaders: true;
|
|
1490
|
-
use: ((inputContext: {
|
|
1491
|
-
body?: any;
|
|
1492
|
-
query?: Record<string, any> | undefined;
|
|
1493
|
-
request?: Request | undefined;
|
|
1494
|
-
headers?: Headers | undefined;
|
|
1495
|
-
asResponse?: boolean | undefined;
|
|
1496
|
-
returnHeaders?: boolean | undefined;
|
|
1497
|
-
use?: better_call.Middleware[] | undefined;
|
|
1498
|
-
}) => Promise<{
|
|
1499
|
-
orgOptions: OrganizationOptions;
|
|
1500
|
-
roles: typeof defaultRoles & {
|
|
1501
|
-
[key: string]: Role<{}>;
|
|
1502
|
-
};
|
|
1503
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
1504
|
-
session: Session & {
|
|
1505
|
-
activeOrganizationId?: string;
|
|
1506
|
-
};
|
|
1507
|
-
user: User;
|
|
1508
|
-
}>;
|
|
1509
|
-
}>)[];
|
|
1510
|
-
metadata: {
|
|
1511
|
-
openapi: {
|
|
1512
|
-
description: string;
|
|
1513
|
-
responses: {
|
|
1514
|
-
"200": {
|
|
1515
|
-
description: string;
|
|
1516
|
-
content: {
|
|
1517
|
-
"application/json": {
|
|
1518
|
-
schema: {
|
|
1519
|
-
type: string;
|
|
1520
|
-
description: string;
|
|
1521
|
-
$ref: string;
|
|
1522
|
-
};
|
|
1523
|
-
};
|
|
1524
|
-
};
|
|
1525
|
-
};
|
|
1526
|
-
};
|
|
1527
|
-
};
|
|
1528
|
-
};
|
|
1529
|
-
} & {
|
|
1530
|
-
use: any[];
|
|
1531
|
-
};
|
|
1532
|
-
path: "/organization/update";
|
|
1533
|
-
};
|
|
1534
|
-
deleteOrganization: {
|
|
1535
|
-
<Context extends {
|
|
1536
|
-
body: {
|
|
1537
|
-
organizationId: string;
|
|
1538
|
-
};
|
|
1539
|
-
headers: HeadersInit;
|
|
1540
|
-
method?: "POST" | undefined;
|
|
1541
|
-
query?: Record<string, any> | undefined;
|
|
1542
|
-
params?: Record<string, any> | undefined;
|
|
1543
|
-
request?: Request | undefined;
|
|
1544
|
-
asResponse?: boolean | undefined;
|
|
1545
|
-
returnHeaders?: boolean | undefined;
|
|
1546
|
-
use?: better_call.Middleware[] | undefined;
|
|
1547
|
-
path?: string | undefined;
|
|
1548
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1549
|
-
headers: Headers;
|
|
1550
|
-
response: {
|
|
1551
|
-
id: string;
|
|
1552
|
-
name: string;
|
|
1553
|
-
createdAt: Date;
|
|
1554
|
-
slug: string;
|
|
1555
|
-
metadata?: any;
|
|
1556
|
-
logo?: string | null | undefined;
|
|
1557
|
-
} | null;
|
|
1558
|
-
} : {
|
|
1559
|
-
id: string;
|
|
1560
|
-
name: string;
|
|
1561
|
-
createdAt: Date;
|
|
1562
|
-
slug: string;
|
|
1563
|
-
metadata?: any;
|
|
1564
|
-
logo?: string | null | undefined;
|
|
1565
|
-
} | null>;
|
|
1566
|
-
options: {
|
|
1567
|
-
method: "POST";
|
|
1568
|
-
body: ZodObject<{
|
|
1569
|
-
organizationId: ZodString;
|
|
1570
|
-
}, "strip", z.ZodTypeAny, {
|
|
1571
|
-
organizationId: string;
|
|
1572
|
-
}, {
|
|
1573
|
-
organizationId: string;
|
|
1574
|
-
}>;
|
|
1575
|
-
requireHeaders: true;
|
|
1576
|
-
use: ((inputContext: {
|
|
1577
|
-
body?: any;
|
|
1578
|
-
query?: Record<string, any> | undefined;
|
|
1579
|
-
request?: Request | undefined;
|
|
1580
|
-
headers?: Headers | undefined;
|
|
1581
|
-
asResponse?: boolean | undefined;
|
|
1582
|
-
returnHeaders?: boolean | undefined;
|
|
1583
|
-
use?: better_call.Middleware[] | undefined;
|
|
1584
|
-
}) => Promise<{
|
|
1585
|
-
orgOptions: OrganizationOptions;
|
|
1586
|
-
roles: typeof defaultRoles & {
|
|
1587
|
-
[key: string]: Role<{}>;
|
|
1588
|
-
};
|
|
1589
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
1590
|
-
session: Session & {
|
|
1591
|
-
activeOrganizationId?: string;
|
|
1592
|
-
};
|
|
1593
|
-
user: User;
|
|
1594
|
-
}>;
|
|
1595
|
-
}>)[];
|
|
1596
|
-
metadata: {
|
|
1597
|
-
openapi: {
|
|
1598
|
-
description: string;
|
|
1599
|
-
responses: {
|
|
1600
|
-
"200": {
|
|
1601
|
-
description: string;
|
|
1602
|
-
content: {
|
|
1603
|
-
"application/json": {
|
|
1604
|
-
schema: {
|
|
1605
|
-
type: string;
|
|
1606
|
-
description: string;
|
|
1607
|
-
};
|
|
1608
|
-
};
|
|
1609
|
-
};
|
|
1610
|
-
};
|
|
1611
|
-
};
|
|
1612
|
-
};
|
|
1613
|
-
};
|
|
1614
|
-
} & {
|
|
1615
|
-
use: any[];
|
|
1616
|
-
};
|
|
1617
|
-
path: "/organization/delete";
|
|
1618
|
-
};
|
|
1619
|
-
setActiveOrganization: {
|
|
1620
|
-
<Context extends {
|
|
1621
|
-
body: {
|
|
1622
|
-
organizationId?: string | null | undefined;
|
|
1623
|
-
organizationSlug?: string | undefined;
|
|
1624
|
-
};
|
|
1625
|
-
method?: "POST" | undefined;
|
|
1626
|
-
query?: Record<string, any> | undefined;
|
|
1627
|
-
params?: Record<string, any> | undefined;
|
|
1628
|
-
request?: Request | undefined;
|
|
1629
|
-
headers?: HeadersInit | undefined;
|
|
1630
|
-
asResponse?: boolean | undefined;
|
|
1631
|
-
returnHeaders?: boolean | undefined;
|
|
1632
|
-
use?: better_call.Middleware[] | undefined;
|
|
1633
|
-
path?: string | undefined;
|
|
1634
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1635
|
-
headers: Headers;
|
|
1636
|
-
response: {
|
|
1637
|
-
invitations: {
|
|
1638
|
-
id: string;
|
|
1639
|
-
email: string;
|
|
1640
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
1641
|
-
expiresAt: Date;
|
|
1642
|
-
organizationId: string;
|
|
1643
|
-
role: string;
|
|
1644
|
-
inviterId: string;
|
|
1645
|
-
}[];
|
|
1646
|
-
members: {
|
|
1647
|
-
user: {
|
|
1648
|
-
id: string;
|
|
1649
|
-
name: string;
|
|
1650
|
-
email: string;
|
|
1651
|
-
image: string | null | undefined;
|
|
1652
|
-
};
|
|
1653
|
-
id: string;
|
|
1654
|
-
createdAt: Date;
|
|
1655
|
-
userId: string;
|
|
1656
|
-
organizationId: string;
|
|
1657
|
-
role: string;
|
|
1658
|
-
}[];
|
|
1659
|
-
id: string;
|
|
1660
|
-
name: string;
|
|
1661
|
-
createdAt: Date;
|
|
1662
|
-
slug: string;
|
|
1663
|
-
metadata?: any;
|
|
1664
|
-
logo?: string | null | undefined;
|
|
1665
|
-
} | null;
|
|
1666
|
-
} : {
|
|
1667
|
-
invitations: {
|
|
1668
|
-
id: string;
|
|
1669
|
-
email: string;
|
|
1670
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
1671
|
-
expiresAt: Date;
|
|
1672
|
-
organizationId: string;
|
|
1673
|
-
role: string;
|
|
1674
|
-
inviterId: string;
|
|
1675
|
-
}[];
|
|
1676
|
-
members: {
|
|
1677
|
-
user: {
|
|
1678
|
-
id: string;
|
|
1679
|
-
name: string;
|
|
1680
|
-
email: string;
|
|
1681
|
-
image: string | null | undefined;
|
|
1682
|
-
};
|
|
1683
|
-
id: string;
|
|
1684
|
-
createdAt: Date;
|
|
1685
|
-
userId: string;
|
|
1686
|
-
organizationId: string;
|
|
1687
|
-
role: string;
|
|
1688
|
-
}[];
|
|
1689
|
-
id: string;
|
|
1690
|
-
name: string;
|
|
1691
|
-
createdAt: Date;
|
|
1692
|
-
slug: string;
|
|
1693
|
-
metadata?: any;
|
|
1694
|
-
logo?: string | null | undefined;
|
|
1695
|
-
} | null>;
|
|
1696
|
-
options: {
|
|
1697
|
-
method: "POST";
|
|
1698
|
-
body: ZodObject<{
|
|
1699
|
-
organizationId: ZodOptional<z.ZodNullable<ZodString>>;
|
|
1700
|
-
organizationSlug: ZodOptional<ZodString>;
|
|
1701
|
-
}, "strip", z.ZodTypeAny, {
|
|
1702
|
-
organizationId?: string | null | undefined;
|
|
1703
|
-
organizationSlug?: string | undefined;
|
|
1704
|
-
}, {
|
|
1705
|
-
organizationId?: string | null | undefined;
|
|
1706
|
-
organizationSlug?: string | undefined;
|
|
1707
|
-
}>;
|
|
1708
|
-
use: (((inputContext: {
|
|
1709
|
-
body?: any;
|
|
1710
|
-
query?: Record<string, any> | undefined;
|
|
1711
|
-
request?: Request | undefined;
|
|
1712
|
-
headers?: Headers | undefined;
|
|
1713
|
-
asResponse?: boolean | undefined;
|
|
1714
|
-
returnHeaders?: boolean | undefined;
|
|
1715
|
-
use?: better_call.Middleware[] | undefined;
|
|
1716
|
-
}) => Promise<{
|
|
1717
|
-
orgOptions: OrganizationOptions;
|
|
1718
|
-
roles: typeof defaultRoles & {
|
|
1719
|
-
[key: string]: Role<{}>;
|
|
1720
|
-
};
|
|
1721
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
1722
|
-
session: Session & {
|
|
1723
|
-
activeOrganizationId?: string;
|
|
1724
|
-
};
|
|
1725
|
-
user: User;
|
|
1726
|
-
}>;
|
|
1727
|
-
}>) | ((inputContext: {
|
|
1728
|
-
body?: any;
|
|
1729
|
-
query?: Record<string, any> | undefined;
|
|
1730
|
-
request?: Request | undefined;
|
|
1731
|
-
headers?: Headers | undefined;
|
|
1732
|
-
asResponse?: boolean | undefined;
|
|
1733
|
-
returnHeaders?: boolean | undefined;
|
|
1734
|
-
use?: better_call.Middleware[] | undefined;
|
|
1735
|
-
}) => Promise<{
|
|
1736
|
-
session: {
|
|
1737
|
-
session: Session & {
|
|
1738
|
-
activeOrganizationId?: string;
|
|
1739
|
-
};
|
|
1740
|
-
user: User;
|
|
1741
|
-
};
|
|
1742
|
-
}>))[];
|
|
1743
|
-
metadata: {
|
|
1744
|
-
openapi: {
|
|
1745
|
-
description: string;
|
|
1746
|
-
responses: {
|
|
1747
|
-
"200": {
|
|
1748
|
-
description: string;
|
|
1749
|
-
content: {
|
|
1750
|
-
"application/json": {
|
|
1751
|
-
schema: {
|
|
1752
|
-
type: string;
|
|
1753
|
-
description: string;
|
|
1754
|
-
$ref: string;
|
|
1755
|
-
};
|
|
1756
|
-
};
|
|
1757
|
-
};
|
|
1758
|
-
};
|
|
1759
|
-
};
|
|
1760
|
-
};
|
|
1761
|
-
};
|
|
1762
|
-
} & {
|
|
1763
|
-
use: any[];
|
|
1764
|
-
};
|
|
1765
|
-
path: "/organization/set-active";
|
|
1766
|
-
};
|
|
1767
|
-
getFullOrganization: {
|
|
1768
|
-
<Context extends {
|
|
1769
|
-
headers: HeadersInit;
|
|
1770
|
-
body?: undefined;
|
|
1771
|
-
method?: "GET" | undefined;
|
|
1772
|
-
query?: {
|
|
1773
|
-
organizationId?: string | undefined;
|
|
1774
|
-
organizationSlug?: string | undefined;
|
|
1775
|
-
} | undefined;
|
|
1776
|
-
params?: Record<string, any> | undefined;
|
|
1777
|
-
request?: Request | undefined;
|
|
1778
|
-
asResponse?: boolean | undefined;
|
|
1779
|
-
returnHeaders?: boolean | undefined;
|
|
1780
|
-
use?: better_call.Middleware[] | undefined;
|
|
1781
|
-
path?: string | undefined;
|
|
1782
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1783
|
-
headers: Headers;
|
|
1784
|
-
response: {
|
|
1785
|
-
invitations: {
|
|
1786
|
-
id: string;
|
|
1787
|
-
email: string;
|
|
1788
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
1789
|
-
expiresAt: Date;
|
|
1790
|
-
organizationId: string;
|
|
1791
|
-
role: string;
|
|
1792
|
-
inviterId: string;
|
|
1793
|
-
}[];
|
|
1794
|
-
members: {
|
|
1795
|
-
user: {
|
|
1796
|
-
id: string;
|
|
1797
|
-
name: string;
|
|
1798
|
-
email: string;
|
|
1799
|
-
image: string | null | undefined;
|
|
1800
|
-
};
|
|
1801
|
-
id: string;
|
|
1802
|
-
createdAt: Date;
|
|
1803
|
-
userId: string;
|
|
1804
|
-
organizationId: string;
|
|
1805
|
-
role: string;
|
|
1806
|
-
}[];
|
|
1807
|
-
id: string;
|
|
1808
|
-
name: string;
|
|
1809
|
-
createdAt: Date;
|
|
1810
|
-
slug: string;
|
|
1811
|
-
metadata?: any;
|
|
1812
|
-
logo?: string | null | undefined;
|
|
1813
|
-
} | null;
|
|
1814
|
-
} : {
|
|
1815
|
-
invitations: {
|
|
1816
|
-
id: string;
|
|
1817
|
-
email: string;
|
|
1818
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
1819
|
-
expiresAt: Date;
|
|
1820
|
-
organizationId: string;
|
|
1821
|
-
role: string;
|
|
1822
|
-
inviterId: string;
|
|
1823
|
-
}[];
|
|
1824
|
-
members: {
|
|
1825
|
-
user: {
|
|
1826
|
-
id: string;
|
|
1827
|
-
name: string;
|
|
1828
|
-
email: string;
|
|
1829
|
-
image: string | null | undefined;
|
|
1830
|
-
};
|
|
1831
|
-
id: string;
|
|
1832
|
-
createdAt: Date;
|
|
1833
|
-
userId: string;
|
|
1834
|
-
organizationId: string;
|
|
1835
|
-
role: string;
|
|
1836
|
-
}[];
|
|
1837
|
-
id: string;
|
|
1838
|
-
name: string;
|
|
1839
|
-
createdAt: Date;
|
|
1840
|
-
slug: string;
|
|
1841
|
-
metadata?: any;
|
|
1842
|
-
logo?: string | null | undefined;
|
|
1843
|
-
} | null>;
|
|
1844
|
-
options: {
|
|
1845
|
-
method: "GET";
|
|
1846
|
-
query: ZodOptional<ZodObject<{
|
|
1847
|
-
organizationId: ZodOptional<ZodString>;
|
|
1848
|
-
organizationSlug: ZodOptional<ZodString>;
|
|
1849
|
-
}, "strip", z.ZodTypeAny, {
|
|
1850
|
-
organizationId?: string | undefined;
|
|
1851
|
-
organizationSlug?: string | undefined;
|
|
1852
|
-
}, {
|
|
1853
|
-
organizationId?: string | undefined;
|
|
1854
|
-
organizationSlug?: string | undefined;
|
|
1855
|
-
}>>;
|
|
1856
|
-
requireHeaders: true;
|
|
1857
|
-
use: (((inputContext: {
|
|
1858
|
-
body?: any;
|
|
1859
|
-
query?: Record<string, any> | undefined;
|
|
1860
|
-
request?: Request | undefined;
|
|
1861
|
-
headers?: Headers | undefined;
|
|
1862
|
-
asResponse?: boolean | undefined;
|
|
1863
|
-
returnHeaders?: boolean | undefined;
|
|
1864
|
-
use?: better_call.Middleware[] | undefined;
|
|
1865
|
-
}) => Promise<{
|
|
1866
|
-
orgOptions: OrganizationOptions;
|
|
1867
|
-
roles: typeof defaultRoles & {
|
|
1868
|
-
[key: string]: Role<{}>;
|
|
1869
|
-
};
|
|
1870
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
1871
|
-
session: Session & {
|
|
1872
|
-
activeOrganizationId?: string;
|
|
1873
|
-
};
|
|
1874
|
-
user: User;
|
|
1875
|
-
}>;
|
|
1876
|
-
}>) | ((inputContext: {
|
|
1877
|
-
body?: any;
|
|
1878
|
-
query?: Record<string, any> | undefined;
|
|
1879
|
-
request?: Request | undefined;
|
|
1880
|
-
headers?: Headers | undefined;
|
|
1881
|
-
asResponse?: boolean | undefined;
|
|
1882
|
-
returnHeaders?: boolean | undefined;
|
|
1883
|
-
use?: better_call.Middleware[] | undefined;
|
|
1884
|
-
}) => Promise<{
|
|
1885
|
-
session: {
|
|
1886
|
-
session: Session & {
|
|
1887
|
-
activeOrganizationId?: string;
|
|
1888
|
-
};
|
|
1889
|
-
user: User;
|
|
1890
|
-
};
|
|
1891
|
-
}>))[];
|
|
1892
|
-
metadata: {
|
|
1893
|
-
openapi: {
|
|
1894
|
-
description: string;
|
|
1895
|
-
responses: {
|
|
1896
|
-
"200": {
|
|
1897
|
-
description: string;
|
|
1898
|
-
content: {
|
|
1899
|
-
"application/json": {
|
|
1900
|
-
schema: {
|
|
1901
|
-
type: string;
|
|
1902
|
-
description: string;
|
|
1903
|
-
$ref: string;
|
|
1904
|
-
};
|
|
1905
|
-
};
|
|
1906
|
-
};
|
|
1907
|
-
};
|
|
1908
|
-
};
|
|
1909
|
-
};
|
|
1910
|
-
};
|
|
1911
|
-
} & {
|
|
1912
|
-
use: any[];
|
|
1913
|
-
};
|
|
1914
|
-
path: "/organization/get-full-organization";
|
|
1915
|
-
};
|
|
1916
|
-
listOrganizations: {
|
|
1917
|
-
<Context extends {
|
|
1918
|
-
body?: undefined;
|
|
1919
|
-
method?: "GET" | undefined;
|
|
1920
|
-
query?: Record<string, any> | undefined;
|
|
1921
|
-
params?: Record<string, any> | undefined;
|
|
1922
|
-
request?: Request | undefined;
|
|
1923
|
-
headers?: HeadersInit | undefined;
|
|
1924
|
-
asResponse?: boolean | undefined;
|
|
1925
|
-
returnHeaders?: boolean | undefined;
|
|
1926
|
-
use?: better_call.Middleware[] | undefined;
|
|
1927
|
-
path?: string | undefined;
|
|
1928
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
1929
|
-
headers: Headers;
|
|
1930
|
-
response: {
|
|
1931
|
-
id: string;
|
|
1932
|
-
name: string;
|
|
1933
|
-
createdAt: Date;
|
|
1934
|
-
slug: string;
|
|
1935
|
-
metadata?: any;
|
|
1936
|
-
logo?: string | null | undefined;
|
|
1937
|
-
}[];
|
|
1938
|
-
} : {
|
|
1939
|
-
id: string;
|
|
1940
|
-
name: string;
|
|
1941
|
-
createdAt: Date;
|
|
1942
|
-
slug: string;
|
|
1943
|
-
metadata?: any;
|
|
1944
|
-
logo?: string | null | undefined;
|
|
1945
|
-
}[]>;
|
|
1946
|
-
options: {
|
|
1947
|
-
method: "GET";
|
|
1948
|
-
use: (((inputContext: {
|
|
1949
|
-
body?: any;
|
|
1950
|
-
query?: Record<string, any> | undefined;
|
|
1951
|
-
request?: Request | undefined;
|
|
1952
|
-
headers?: Headers | undefined;
|
|
1953
|
-
asResponse?: boolean | undefined;
|
|
1954
|
-
returnHeaders?: boolean | undefined;
|
|
1955
|
-
use?: better_call.Middleware[] | undefined;
|
|
1956
|
-
}) => Promise<{
|
|
1957
|
-
orgOptions: OrganizationOptions;
|
|
1958
|
-
roles: typeof defaultRoles & {
|
|
1959
|
-
[key: string]: Role<{}>;
|
|
1960
|
-
};
|
|
1961
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
1962
|
-
session: Session & {
|
|
1963
|
-
activeOrganizationId?: string;
|
|
1964
|
-
};
|
|
1965
|
-
user: User;
|
|
1966
|
-
}>;
|
|
1967
|
-
}>) | ((inputContext: {
|
|
1968
|
-
body?: any;
|
|
1969
|
-
query?: Record<string, any> | undefined;
|
|
1970
|
-
request?: Request | undefined;
|
|
1971
|
-
headers?: Headers | undefined;
|
|
1972
|
-
asResponse?: boolean | undefined;
|
|
1973
|
-
returnHeaders?: boolean | undefined;
|
|
1974
|
-
use?: better_call.Middleware[] | undefined;
|
|
1975
|
-
}) => Promise<{
|
|
1976
|
-
session: {
|
|
1977
|
-
session: Session & {
|
|
1978
|
-
activeOrganizationId?: string;
|
|
1979
|
-
};
|
|
1980
|
-
user: User;
|
|
1981
|
-
};
|
|
1982
|
-
}>))[];
|
|
1983
|
-
metadata: {
|
|
1984
|
-
openapi: {
|
|
1985
|
-
description: string;
|
|
1986
|
-
responses: {
|
|
1987
|
-
"200": {
|
|
1988
|
-
description: string;
|
|
1989
|
-
content: {
|
|
1990
|
-
"application/json": {
|
|
1991
|
-
schema: {
|
|
1992
|
-
type: string;
|
|
1993
|
-
items: {
|
|
1994
|
-
$ref: string;
|
|
1995
|
-
};
|
|
1996
|
-
};
|
|
1997
|
-
};
|
|
1998
|
-
};
|
|
1999
|
-
};
|
|
2000
|
-
};
|
|
2001
|
-
};
|
|
2002
|
-
};
|
|
2003
|
-
} & {
|
|
2004
|
-
use: any[];
|
|
2005
|
-
};
|
|
2006
|
-
path: "/organization/list";
|
|
2007
|
-
};
|
|
2008
|
-
createInvitation: {
|
|
2009
|
-
<Context extends ({
|
|
2010
|
-
body: z.baseObjectInputType<{
|
|
2011
|
-
email: ZodString;
|
|
2012
|
-
role: InferRolesFromOption<O>;
|
|
2013
|
-
organizationId: ZodOptional<ZodString>;
|
|
2014
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2015
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2016
|
-
email: ZodString;
|
|
2017
|
-
role: InferRolesFromOption<O>;
|
|
2018
|
-
organizationId: ZodOptional<ZodString>;
|
|
2019
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2020
|
-
}>[k]; } : never;
|
|
2021
|
-
method: "POST" | undefined;
|
|
2022
|
-
query: Record<string, any> | undefined;
|
|
2023
|
-
params: Record<string, any> | undefined;
|
|
2024
|
-
request: Request | undefined;
|
|
2025
|
-
headers: HeadersInit | undefined;
|
|
2026
|
-
asResponse?: boolean;
|
|
2027
|
-
returnHeaders?: boolean;
|
|
2028
|
-
use?: better_call.Middleware[];
|
|
2029
|
-
path?: string;
|
|
2030
|
-
} extends infer T ? { [K_1 in keyof T as {
|
|
2031
|
-
body: z.baseObjectInputType<{
|
|
2032
|
-
email: ZodString;
|
|
2033
|
-
role: InferRolesFromOption<O>;
|
|
2034
|
-
organizationId: ZodOptional<ZodString>;
|
|
2035
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2036
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2037
|
-
email: ZodString;
|
|
2038
|
-
role: InferRolesFromOption<O>;
|
|
2039
|
-
organizationId: ZodOptional<ZodString>;
|
|
2040
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2041
|
-
}>[k]; } : never;
|
|
2042
|
-
method: "POST" | undefined;
|
|
2043
|
-
query: Record<string, any> | undefined;
|
|
2044
|
-
params: Record<string, any> | undefined;
|
|
2045
|
-
request: Request | undefined;
|
|
2046
|
-
headers: HeadersInit | undefined;
|
|
2047
|
-
asResponse?: boolean;
|
|
2048
|
-
returnHeaders?: boolean;
|
|
2049
|
-
use?: better_call.Middleware[];
|
|
2050
|
-
path?: string;
|
|
2051
|
-
}[K_1] extends never ? never : undefined extends {
|
|
2052
|
-
body: z.baseObjectInputType<{
|
|
2053
|
-
email: ZodString;
|
|
2054
|
-
role: InferRolesFromOption<O>;
|
|
2055
|
-
organizationId: ZodOptional<ZodString>;
|
|
2056
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2057
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2058
|
-
email: ZodString;
|
|
2059
|
-
role: InferRolesFromOption<O>;
|
|
2060
|
-
organizationId: ZodOptional<ZodString>;
|
|
2061
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2062
|
-
}>[k]; } : never;
|
|
2063
|
-
method: "POST" | undefined;
|
|
2064
|
-
query: Record<string, any> | undefined;
|
|
2065
|
-
params: Record<string, any> | undefined;
|
|
2066
|
-
request: Request | undefined;
|
|
2067
|
-
headers: HeadersInit | undefined;
|
|
2068
|
-
asResponse?: boolean;
|
|
2069
|
-
returnHeaders?: boolean;
|
|
2070
|
-
use?: better_call.Middleware[];
|
|
2071
|
-
path?: string;
|
|
2072
|
-
}[K_1] ? never : K_1]: {
|
|
2073
|
-
body: z.baseObjectInputType<{
|
|
2074
|
-
email: ZodString;
|
|
2075
|
-
role: InferRolesFromOption<O>;
|
|
2076
|
-
organizationId: ZodOptional<ZodString>;
|
|
2077
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2078
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2079
|
-
email: ZodString;
|
|
2080
|
-
role: InferRolesFromOption<O>;
|
|
2081
|
-
organizationId: ZodOptional<ZodString>;
|
|
2082
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2083
|
-
}>[k]; } : never;
|
|
2084
|
-
method: "POST" | undefined;
|
|
2085
|
-
query: Record<string, any> | undefined;
|
|
2086
|
-
params: Record<string, any> | undefined;
|
|
2087
|
-
request: Request | undefined;
|
|
2088
|
-
headers: HeadersInit | undefined;
|
|
2089
|
-
asResponse?: boolean;
|
|
2090
|
-
returnHeaders?: boolean;
|
|
2091
|
-
use?: better_call.Middleware[];
|
|
2092
|
-
path?: string;
|
|
2093
|
-
}[K_1]; } : never) & ({
|
|
2094
|
-
body: z.baseObjectInputType<{
|
|
2095
|
-
email: ZodString;
|
|
2096
|
-
role: InferRolesFromOption<O>;
|
|
2097
|
-
organizationId: ZodOptional<ZodString>;
|
|
2098
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2099
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2100
|
-
email: ZodString;
|
|
2101
|
-
role: InferRolesFromOption<O>;
|
|
2102
|
-
organizationId: ZodOptional<ZodString>;
|
|
2103
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2104
|
-
}>[k]; } : never;
|
|
2105
|
-
method: "POST" | undefined;
|
|
2106
|
-
query: Record<string, any> | undefined;
|
|
2107
|
-
params: Record<string, any> | undefined;
|
|
2108
|
-
request: Request | undefined;
|
|
2109
|
-
headers: HeadersInit | undefined;
|
|
2110
|
-
asResponse?: boolean;
|
|
2111
|
-
returnHeaders?: boolean;
|
|
2112
|
-
use?: better_call.Middleware[];
|
|
2113
|
-
path?: string;
|
|
2114
|
-
} extends infer T_2 ? { [K_2 in keyof T_2 as undefined extends {
|
|
2115
|
-
body: z.baseObjectInputType<{
|
|
2116
|
-
email: ZodString;
|
|
2117
|
-
role: InferRolesFromOption<O>;
|
|
2118
|
-
organizationId: ZodOptional<ZodString>;
|
|
2119
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2120
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2121
|
-
email: ZodString;
|
|
2122
|
-
role: InferRolesFromOption<O>;
|
|
2123
|
-
organizationId: ZodOptional<ZodString>;
|
|
2124
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2125
|
-
}>[k]; } : never;
|
|
2126
|
-
method: "POST" | undefined;
|
|
2127
|
-
query: Record<string, any> | undefined;
|
|
2128
|
-
params: Record<string, any> | undefined;
|
|
2129
|
-
request: Request | undefined;
|
|
2130
|
-
headers: HeadersInit | undefined;
|
|
2131
|
-
asResponse?: boolean;
|
|
2132
|
-
returnHeaders?: boolean;
|
|
2133
|
-
use?: better_call.Middleware[];
|
|
2134
|
-
path?: string;
|
|
2135
|
-
}[K_2] ? K_2 : never]?: {
|
|
2136
|
-
body: z.baseObjectInputType<{
|
|
2137
|
-
email: ZodString;
|
|
2138
|
-
role: InferRolesFromOption<O>;
|
|
2139
|
-
organizationId: ZodOptional<ZodString>;
|
|
2140
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2141
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2142
|
-
email: ZodString;
|
|
2143
|
-
role: InferRolesFromOption<O>;
|
|
2144
|
-
organizationId: ZodOptional<ZodString>;
|
|
2145
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2146
|
-
}>[k]; } : never;
|
|
2147
|
-
method: "POST" | undefined;
|
|
2148
|
-
query: Record<string, any> | undefined;
|
|
2149
|
-
params: Record<string, any> | undefined;
|
|
2150
|
-
request: Request | undefined;
|
|
2151
|
-
headers: HeadersInit | undefined;
|
|
2152
|
-
asResponse?: boolean;
|
|
2153
|
-
returnHeaders?: boolean;
|
|
2154
|
-
use?: better_call.Middleware[];
|
|
2155
|
-
path?: string;
|
|
2156
|
-
}[K_2] | undefined; } : never) extends infer T_3 ? { [K in keyof T_3]: (({
|
|
2157
|
-
body: z.baseObjectInputType<{
|
|
2158
|
-
email: ZodString;
|
|
2159
|
-
role: InferRolesFromOption<O>;
|
|
2160
|
-
organizationId: ZodOptional<ZodString>;
|
|
2161
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2162
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2163
|
-
email: ZodString;
|
|
2164
|
-
role: InferRolesFromOption<O>;
|
|
2165
|
-
organizationId: ZodOptional<ZodString>;
|
|
2166
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2167
|
-
}>[k]; } : never;
|
|
2168
|
-
method: "POST" | undefined;
|
|
2169
|
-
query: Record<string, any> | undefined;
|
|
2170
|
-
params: Record<string, any> | undefined;
|
|
2171
|
-
request: Request | undefined;
|
|
2172
|
-
headers: HeadersInit | undefined;
|
|
2173
|
-
asResponse?: boolean;
|
|
2174
|
-
returnHeaders?: boolean;
|
|
2175
|
-
use?: better_call.Middleware[];
|
|
2176
|
-
path?: string;
|
|
2177
|
-
} extends infer T_4 ? { [K_1_1 in keyof T_4 as {
|
|
2178
|
-
body: z.baseObjectInputType<{
|
|
2179
|
-
email: ZodString;
|
|
2180
|
-
role: InferRolesFromOption<O>;
|
|
2181
|
-
organizationId: ZodOptional<ZodString>;
|
|
2182
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2183
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2184
|
-
email: ZodString;
|
|
2185
|
-
role: InferRolesFromOption<O>;
|
|
2186
|
-
organizationId: ZodOptional<ZodString>;
|
|
2187
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2188
|
-
}>[k]; } : never;
|
|
2189
|
-
method: "POST" | undefined;
|
|
2190
|
-
query: Record<string, any> | undefined;
|
|
2191
|
-
params: Record<string, any> | undefined;
|
|
2192
|
-
request: Request | undefined;
|
|
2193
|
-
headers: HeadersInit | undefined;
|
|
2194
|
-
asResponse?: boolean;
|
|
2195
|
-
returnHeaders?: boolean;
|
|
2196
|
-
use?: better_call.Middleware[];
|
|
2197
|
-
path?: string;
|
|
2198
|
-
}[K_1_1] extends never ? never : undefined extends {
|
|
2199
|
-
body: z.baseObjectInputType<{
|
|
2200
|
-
email: ZodString;
|
|
2201
|
-
role: InferRolesFromOption<O>;
|
|
2202
|
-
organizationId: ZodOptional<ZodString>;
|
|
2203
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2204
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2205
|
-
email: ZodString;
|
|
2206
|
-
role: InferRolesFromOption<O>;
|
|
2207
|
-
organizationId: ZodOptional<ZodString>;
|
|
2208
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2209
|
-
}>[k]; } : never;
|
|
2210
|
-
method: "POST" | undefined;
|
|
2211
|
-
query: Record<string, any> | undefined;
|
|
2212
|
-
params: Record<string, any> | undefined;
|
|
2213
|
-
request: Request | undefined;
|
|
2214
|
-
headers: HeadersInit | undefined;
|
|
2215
|
-
asResponse?: boolean;
|
|
2216
|
-
returnHeaders?: boolean;
|
|
2217
|
-
use?: better_call.Middleware[];
|
|
2218
|
-
path?: string;
|
|
2219
|
-
}[K_1_1] ? never : K_1_1]: {
|
|
2220
|
-
body: z.baseObjectInputType<{
|
|
2221
|
-
email: ZodString;
|
|
2222
|
-
role: InferRolesFromOption<O>;
|
|
2223
|
-
organizationId: ZodOptional<ZodString>;
|
|
2224
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2225
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2226
|
-
email: ZodString;
|
|
2227
|
-
role: InferRolesFromOption<O>;
|
|
2228
|
-
organizationId: ZodOptional<ZodString>;
|
|
2229
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2230
|
-
}>[k]; } : never;
|
|
2231
|
-
method: "POST" | undefined;
|
|
2232
|
-
query: Record<string, any> | undefined;
|
|
2233
|
-
params: Record<string, any> | undefined;
|
|
2234
|
-
request: Request | undefined;
|
|
2235
|
-
headers: HeadersInit | undefined;
|
|
2236
|
-
asResponse?: boolean;
|
|
2237
|
-
returnHeaders?: boolean;
|
|
2238
|
-
use?: better_call.Middleware[];
|
|
2239
|
-
path?: string;
|
|
2240
|
-
}[K_1_1]; } : never) & ({
|
|
2241
|
-
body: z.baseObjectInputType<{
|
|
2242
|
-
email: ZodString;
|
|
2243
|
-
role: InferRolesFromOption<O>;
|
|
2244
|
-
organizationId: ZodOptional<ZodString>;
|
|
2245
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2246
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2247
|
-
email: ZodString;
|
|
2248
|
-
role: InferRolesFromOption<O>;
|
|
2249
|
-
organizationId: ZodOptional<ZodString>;
|
|
2250
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2251
|
-
}>[k]; } : never;
|
|
2252
|
-
method: "POST" | undefined;
|
|
2253
|
-
query: Record<string, any> | undefined;
|
|
2254
|
-
params: Record<string, any> | undefined;
|
|
2255
|
-
request: Request | undefined;
|
|
2256
|
-
headers: HeadersInit | undefined;
|
|
2257
|
-
asResponse?: boolean;
|
|
2258
|
-
returnHeaders?: boolean;
|
|
2259
|
-
use?: better_call.Middleware[];
|
|
2260
|
-
path?: string;
|
|
2261
|
-
} extends infer T_5 ? { [K_2_1 in keyof T_5 as undefined extends {
|
|
2262
|
-
body: z.baseObjectInputType<{
|
|
2263
|
-
email: ZodString;
|
|
2264
|
-
role: InferRolesFromOption<O>;
|
|
2265
|
-
organizationId: ZodOptional<ZodString>;
|
|
2266
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2267
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2268
|
-
email: ZodString;
|
|
2269
|
-
role: InferRolesFromOption<O>;
|
|
2270
|
-
organizationId: ZodOptional<ZodString>;
|
|
2271
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2272
|
-
}>[k]; } : never;
|
|
2273
|
-
method: "POST" | undefined;
|
|
2274
|
-
query: Record<string, any> | undefined;
|
|
2275
|
-
params: Record<string, any> | undefined;
|
|
2276
|
-
request: Request | undefined;
|
|
2277
|
-
headers: HeadersInit | undefined;
|
|
2278
|
-
asResponse?: boolean;
|
|
2279
|
-
returnHeaders?: boolean;
|
|
2280
|
-
use?: better_call.Middleware[];
|
|
2281
|
-
path?: string;
|
|
2282
|
-
}[K_2_1] ? K_2_1 : never]?: {
|
|
2283
|
-
body: z.baseObjectInputType<{
|
|
2284
|
-
email: ZodString;
|
|
2285
|
-
role: InferRolesFromOption<O>;
|
|
2286
|
-
organizationId: ZodOptional<ZodString>;
|
|
2287
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2288
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2289
|
-
email: ZodString;
|
|
2290
|
-
role: InferRolesFromOption<O>;
|
|
2291
|
-
organizationId: ZodOptional<ZodString>;
|
|
2292
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2293
|
-
}>[k]; } : never;
|
|
2294
|
-
method: "POST" | undefined;
|
|
2295
|
-
query: Record<string, any> | undefined;
|
|
2296
|
-
params: Record<string, any> | undefined;
|
|
2297
|
-
request: Request | undefined;
|
|
2298
|
-
headers: HeadersInit | undefined;
|
|
2299
|
-
asResponse?: boolean;
|
|
2300
|
-
returnHeaders?: boolean;
|
|
2301
|
-
use?: better_call.Middleware[];
|
|
2302
|
-
path?: string;
|
|
2303
|
-
}[K_2_1] | undefined; } : never))[K]; } : never>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
2304
|
-
headers: Headers;
|
|
2305
|
-
response: {
|
|
2306
|
-
id: string;
|
|
2307
|
-
email: string;
|
|
2308
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2309
|
-
expiresAt: Date;
|
|
2310
|
-
organizationId: string;
|
|
2311
|
-
role: string;
|
|
2312
|
-
inviterId: string;
|
|
2313
|
-
};
|
|
2314
|
-
} : {
|
|
2315
|
-
id: string;
|
|
2316
|
-
email: string;
|
|
2317
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2318
|
-
expiresAt: Date;
|
|
2319
|
-
organizationId: string;
|
|
2320
|
-
role: string;
|
|
2321
|
-
inviterId: string;
|
|
2322
|
-
}>;
|
|
2323
|
-
options: {
|
|
2324
|
-
method: "POST";
|
|
2325
|
-
use: (((inputContext: {
|
|
2326
|
-
body?: any;
|
|
2327
|
-
query?: Record<string, any> | undefined;
|
|
2328
|
-
request?: Request | undefined;
|
|
2329
|
-
headers?: Headers | undefined;
|
|
2330
|
-
asResponse?: boolean | undefined;
|
|
2331
|
-
returnHeaders?: boolean | undefined;
|
|
2332
|
-
use?: better_call.Middleware[] | undefined;
|
|
2333
|
-
}) => Promise<{
|
|
2334
|
-
orgOptions: OrganizationOptions;
|
|
2335
|
-
roles: typeof defaultRoles & {
|
|
2336
|
-
[key: string]: Role<{}>;
|
|
2337
|
-
};
|
|
2338
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
2339
|
-
session: Session & {
|
|
2340
|
-
activeOrganizationId?: string;
|
|
2341
|
-
};
|
|
2342
|
-
user: User;
|
|
2343
|
-
}>;
|
|
2344
|
-
}>) | ((inputContext: {
|
|
2345
|
-
body?: any;
|
|
2346
|
-
query?: Record<string, any> | undefined;
|
|
2347
|
-
request?: Request | undefined;
|
|
2348
|
-
headers?: Headers | undefined;
|
|
2349
|
-
asResponse?: boolean | undefined;
|
|
2350
|
-
returnHeaders?: boolean | undefined;
|
|
2351
|
-
use?: better_call.Middleware[] | undefined;
|
|
2352
|
-
}) => Promise<{
|
|
2353
|
-
session: {
|
|
2354
|
-
session: Session & {
|
|
2355
|
-
activeOrganizationId?: string;
|
|
2356
|
-
};
|
|
2357
|
-
user: User;
|
|
2358
|
-
};
|
|
2359
|
-
}>))[];
|
|
2360
|
-
body: ZodObject<{
|
|
2361
|
-
email: ZodString;
|
|
2362
|
-
role: InferRolesFromOption<O>;
|
|
2363
|
-
organizationId: ZodOptional<ZodString>;
|
|
2364
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2365
|
-
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
2366
|
-
email: ZodString;
|
|
2367
|
-
role: InferRolesFromOption<O>;
|
|
2368
|
-
organizationId: ZodOptional<ZodString>;
|
|
2369
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2370
|
-
}>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
2371
|
-
email: ZodString;
|
|
2372
|
-
role: InferRolesFromOption<O>;
|
|
2373
|
-
organizationId: ZodOptional<ZodString>;
|
|
2374
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2375
|
-
}>, any>[k]; } : never, z.baseObjectInputType<{
|
|
2376
|
-
email: ZodString;
|
|
2377
|
-
role: InferRolesFromOption<O>;
|
|
2378
|
-
organizationId: ZodOptional<ZodString>;
|
|
2379
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2380
|
-
}> extends infer T_1 ? { [k in keyof T_1]: z.baseObjectInputType<{
|
|
2381
|
-
email: ZodString;
|
|
2382
|
-
role: InferRolesFromOption<O>;
|
|
2383
|
-
organizationId: ZodOptional<ZodString>;
|
|
2384
|
-
resend: ZodOptional<z.ZodBoolean>;
|
|
2385
|
-
}>[k]; } : never>;
|
|
2386
|
-
metadata: {
|
|
2387
|
-
openapi: {
|
|
2388
|
-
description: string;
|
|
2389
|
-
responses: {
|
|
2390
|
-
"200": {
|
|
2391
|
-
description: string;
|
|
2392
|
-
content: {
|
|
2393
|
-
"application/json": {
|
|
2394
|
-
schema: {
|
|
2395
|
-
type: string;
|
|
2396
|
-
properties: {
|
|
2397
|
-
id: {
|
|
2398
|
-
type: string;
|
|
2399
|
-
};
|
|
2400
|
-
email: {
|
|
2401
|
-
type: string;
|
|
2402
|
-
};
|
|
2403
|
-
role: {
|
|
2404
|
-
type: string;
|
|
2405
|
-
};
|
|
2406
|
-
organizationId: {
|
|
2407
|
-
type: string;
|
|
2408
|
-
};
|
|
2409
|
-
inviterId: {
|
|
2410
|
-
type: string;
|
|
2411
|
-
};
|
|
2412
|
-
status: {
|
|
2413
|
-
type: string;
|
|
2414
|
-
};
|
|
2415
|
-
expiresAt: {
|
|
2416
|
-
type: string;
|
|
2417
|
-
};
|
|
2418
|
-
};
|
|
2419
|
-
required: string[];
|
|
2420
|
-
};
|
|
2421
|
-
};
|
|
2422
|
-
};
|
|
2423
|
-
};
|
|
2424
|
-
};
|
|
2425
|
-
};
|
|
2426
|
-
};
|
|
2427
|
-
} & {
|
|
2428
|
-
use: any[];
|
|
2429
|
-
};
|
|
2430
|
-
path: "/organization/invite-member";
|
|
2431
|
-
};
|
|
2432
|
-
cancelInvitation: {
|
|
2433
|
-
<Context extends {
|
|
2434
|
-
body: {
|
|
2435
|
-
invitationId: string;
|
|
2436
|
-
};
|
|
2437
|
-
method?: "POST" | undefined;
|
|
2438
|
-
query?: Record<string, any> | undefined;
|
|
2439
|
-
params?: Record<string, any> | undefined;
|
|
2440
|
-
request?: Request | undefined;
|
|
2441
|
-
headers?: HeadersInit | undefined;
|
|
2442
|
-
asResponse?: boolean | undefined;
|
|
2443
|
-
returnHeaders?: boolean | undefined;
|
|
2444
|
-
use?: better_call.Middleware[] | undefined;
|
|
2445
|
-
path?: string | undefined;
|
|
2446
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
2447
|
-
headers: Headers;
|
|
2448
|
-
response: {
|
|
2449
|
-
id: string;
|
|
2450
|
-
email: string;
|
|
2451
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2452
|
-
expiresAt: Date;
|
|
2453
|
-
organizationId: string;
|
|
2454
|
-
role: string;
|
|
2455
|
-
inviterId: string;
|
|
2456
|
-
} | null;
|
|
2457
|
-
} : {
|
|
2458
|
-
id: string;
|
|
2459
|
-
email: string;
|
|
2460
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2461
|
-
expiresAt: Date;
|
|
2462
|
-
organizationId: string;
|
|
2463
|
-
role: string;
|
|
2464
|
-
inviterId: string;
|
|
2465
|
-
} | null>;
|
|
2466
|
-
options: {
|
|
2467
|
-
method: "POST";
|
|
2468
|
-
body: ZodObject<{
|
|
2469
|
-
invitationId: ZodString;
|
|
2470
|
-
}, "strip", z.ZodTypeAny, {
|
|
2471
|
-
invitationId: string;
|
|
2472
|
-
}, {
|
|
2473
|
-
invitationId: string;
|
|
2474
|
-
}>;
|
|
2475
|
-
use: (((inputContext: {
|
|
2476
|
-
body?: any;
|
|
2477
|
-
query?: Record<string, any> | undefined;
|
|
2478
|
-
request?: Request | undefined;
|
|
2479
|
-
headers?: Headers | undefined;
|
|
2480
|
-
asResponse?: boolean | undefined;
|
|
2481
|
-
returnHeaders?: boolean | undefined;
|
|
2482
|
-
use?: better_call.Middleware[] | undefined;
|
|
2483
|
-
}) => Promise<{
|
|
2484
|
-
orgOptions: OrganizationOptions;
|
|
2485
|
-
roles: typeof defaultRoles & {
|
|
2486
|
-
[key: string]: Role<{}>;
|
|
2487
|
-
};
|
|
2488
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
2489
|
-
session: Session & {
|
|
2490
|
-
activeOrganizationId?: string;
|
|
2491
|
-
};
|
|
2492
|
-
user: User;
|
|
2493
|
-
}>;
|
|
2494
|
-
}>) | ((inputContext: {
|
|
2495
|
-
body?: any;
|
|
2496
|
-
query?: Record<string, any> | undefined;
|
|
2497
|
-
request?: Request | undefined;
|
|
2498
|
-
headers?: Headers | undefined;
|
|
2499
|
-
asResponse?: boolean | undefined;
|
|
2500
|
-
returnHeaders?: boolean | undefined;
|
|
2501
|
-
use?: better_call.Middleware[] | undefined;
|
|
2502
|
-
}) => Promise<{
|
|
2503
|
-
session: {
|
|
2504
|
-
session: Session & {
|
|
2505
|
-
activeOrganizationId?: string;
|
|
2506
|
-
};
|
|
2507
|
-
user: User;
|
|
2508
|
-
};
|
|
2509
|
-
}>))[];
|
|
2510
|
-
openapi: {
|
|
2511
|
-
description: string;
|
|
2512
|
-
responses: {
|
|
2513
|
-
"200": {
|
|
2514
|
-
description: string;
|
|
2515
|
-
content: {
|
|
2516
|
-
"application/json": {
|
|
2517
|
-
schema: {
|
|
2518
|
-
type: string;
|
|
2519
|
-
properties: {
|
|
2520
|
-
invitation: {
|
|
2521
|
-
type: string;
|
|
2522
|
-
};
|
|
2523
|
-
};
|
|
2524
|
-
};
|
|
2525
|
-
};
|
|
2526
|
-
};
|
|
2527
|
-
};
|
|
2528
|
-
};
|
|
2529
|
-
};
|
|
2530
|
-
} & {
|
|
2531
|
-
use: any[];
|
|
2532
|
-
};
|
|
2533
|
-
path: "/organization/cancel-invitation";
|
|
2534
|
-
};
|
|
2535
|
-
acceptInvitation: {
|
|
2536
|
-
<Context extends {
|
|
2537
|
-
body: {
|
|
2538
|
-
invitationId: string;
|
|
2539
|
-
};
|
|
2540
|
-
method?: "POST" | undefined;
|
|
2541
|
-
query?: Record<string, any> | undefined;
|
|
2542
|
-
params?: Record<string, any> | undefined;
|
|
2543
|
-
request?: Request | undefined;
|
|
2544
|
-
headers?: HeadersInit | undefined;
|
|
2545
|
-
asResponse?: boolean | undefined;
|
|
2546
|
-
returnHeaders?: boolean | undefined;
|
|
2547
|
-
use?: better_call.Middleware[] | undefined;
|
|
2548
|
-
path?: string | undefined;
|
|
2549
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
2550
|
-
headers: Headers;
|
|
2551
|
-
response: {
|
|
2552
|
-
invitation: {
|
|
2553
|
-
id: string;
|
|
2554
|
-
email: string;
|
|
2555
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2556
|
-
expiresAt: Date;
|
|
2557
|
-
organizationId: string;
|
|
2558
|
-
role: string;
|
|
2559
|
-
inviterId: string;
|
|
2560
|
-
};
|
|
2561
|
-
member: {
|
|
2562
|
-
createdAt: Date;
|
|
2563
|
-
userId: string;
|
|
2564
|
-
organizationId: string;
|
|
2565
|
-
role: string;
|
|
2566
|
-
id?: string | undefined;
|
|
2567
|
-
};
|
|
2568
|
-
} | null;
|
|
2569
|
-
} : {
|
|
2570
|
-
invitation: {
|
|
2571
|
-
id: string;
|
|
2572
|
-
email: string;
|
|
2573
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2574
|
-
expiresAt: Date;
|
|
2575
|
-
organizationId: string;
|
|
2576
|
-
role: string;
|
|
2577
|
-
inviterId: string;
|
|
2578
|
-
};
|
|
2579
|
-
member: {
|
|
2580
|
-
createdAt: Date;
|
|
2581
|
-
userId: string;
|
|
2582
|
-
organizationId: string;
|
|
2583
|
-
role: string;
|
|
2584
|
-
id?: string | undefined;
|
|
2585
|
-
};
|
|
2586
|
-
} | null>;
|
|
2587
|
-
options: {
|
|
2588
|
-
method: "POST";
|
|
2589
|
-
body: ZodObject<{
|
|
2590
|
-
invitationId: ZodString;
|
|
2591
|
-
}, "strip", z.ZodTypeAny, {
|
|
2592
|
-
invitationId: string;
|
|
2593
|
-
}, {
|
|
2594
|
-
invitationId: string;
|
|
2595
|
-
}>;
|
|
2596
|
-
use: (((inputContext: {
|
|
2597
|
-
body?: any;
|
|
2598
|
-
query?: Record<string, any> | undefined;
|
|
2599
|
-
request?: Request | undefined;
|
|
2600
|
-
headers?: Headers | undefined;
|
|
2601
|
-
asResponse?: boolean | undefined;
|
|
2602
|
-
returnHeaders?: boolean | undefined;
|
|
2603
|
-
use?: better_call.Middleware[] | undefined;
|
|
2604
|
-
}) => Promise<{
|
|
2605
|
-
orgOptions: OrganizationOptions;
|
|
2606
|
-
roles: typeof defaultRoles & {
|
|
2607
|
-
[key: string]: Role<{}>;
|
|
2608
|
-
};
|
|
2609
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
2610
|
-
session: Session & {
|
|
2611
|
-
activeOrganizationId?: string;
|
|
2612
|
-
};
|
|
2613
|
-
user: User;
|
|
2614
|
-
}>;
|
|
2615
|
-
}>) | ((inputContext: {
|
|
2616
|
-
body?: any;
|
|
2617
|
-
query?: Record<string, any> | undefined;
|
|
2618
|
-
request?: Request | undefined;
|
|
2619
|
-
headers?: Headers | undefined;
|
|
2620
|
-
asResponse?: boolean | undefined;
|
|
2621
|
-
returnHeaders?: boolean | undefined;
|
|
2622
|
-
use?: better_call.Middleware[] | undefined;
|
|
2623
|
-
}) => Promise<{
|
|
2624
|
-
session: {
|
|
2625
|
-
session: Session & {
|
|
2626
|
-
activeOrganizationId?: string;
|
|
2627
|
-
};
|
|
2628
|
-
user: User;
|
|
2629
|
-
};
|
|
2630
|
-
}>))[];
|
|
2631
|
-
metadata: {
|
|
2632
|
-
openapi: {
|
|
2633
|
-
description: string;
|
|
2634
|
-
responses: {
|
|
2635
|
-
"200": {
|
|
2636
|
-
description: string;
|
|
2637
|
-
content: {
|
|
2638
|
-
"application/json": {
|
|
2639
|
-
schema: {
|
|
2640
|
-
type: string;
|
|
2641
|
-
properties: {
|
|
2642
|
-
invitation: {
|
|
2643
|
-
type: string;
|
|
2644
|
-
};
|
|
2645
|
-
member: {
|
|
2646
|
-
type: string;
|
|
2647
|
-
};
|
|
2648
|
-
};
|
|
2649
|
-
};
|
|
2650
|
-
};
|
|
2651
|
-
};
|
|
2652
|
-
};
|
|
2653
|
-
};
|
|
2654
|
-
};
|
|
2655
|
-
};
|
|
2656
|
-
} & {
|
|
2657
|
-
use: any[];
|
|
2658
|
-
};
|
|
2659
|
-
path: "/organization/accept-invitation";
|
|
2660
|
-
};
|
|
2661
|
-
getInvitation: {
|
|
2662
|
-
<Context extends {
|
|
2663
|
-
query: {
|
|
2664
|
-
id: string;
|
|
2665
|
-
};
|
|
2666
|
-
headers: HeadersInit;
|
|
2667
|
-
body?: undefined;
|
|
2668
|
-
method?: "GET" | undefined;
|
|
2669
|
-
params?: Record<string, any> | undefined;
|
|
2670
|
-
request?: Request | undefined;
|
|
2671
|
-
asResponse?: boolean | undefined;
|
|
2672
|
-
returnHeaders?: boolean | undefined;
|
|
2673
|
-
use?: better_call.Middleware[] | undefined;
|
|
2674
|
-
path?: string | undefined;
|
|
2675
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
2676
|
-
headers: Headers;
|
|
2677
|
-
response: {
|
|
2678
|
-
organizationName: string;
|
|
2679
|
-
organizationSlug: string;
|
|
2680
|
-
inviterEmail: string;
|
|
2681
|
-
id: string;
|
|
2682
|
-
email: string;
|
|
2683
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2684
|
-
expiresAt: Date;
|
|
2685
|
-
organizationId: string;
|
|
2686
|
-
role: string;
|
|
2687
|
-
inviterId: string;
|
|
2688
|
-
};
|
|
2689
|
-
} : {
|
|
2690
|
-
organizationName: string;
|
|
2691
|
-
organizationSlug: string;
|
|
2692
|
-
inviterEmail: string;
|
|
2693
|
-
id: string;
|
|
2694
|
-
email: string;
|
|
2695
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2696
|
-
expiresAt: Date;
|
|
2697
|
-
organizationId: string;
|
|
2698
|
-
role: string;
|
|
2699
|
-
inviterId: string;
|
|
2700
|
-
}>;
|
|
2701
|
-
options: {
|
|
2702
|
-
method: "GET";
|
|
2703
|
-
use: ((inputContext: {
|
|
2704
|
-
body?: any;
|
|
2705
|
-
query?: Record<string, any> | undefined;
|
|
2706
|
-
request?: Request | undefined;
|
|
2707
|
-
headers?: Headers | undefined;
|
|
2708
|
-
asResponse?: boolean | undefined;
|
|
2709
|
-
returnHeaders?: boolean | undefined;
|
|
2710
|
-
use?: better_call.Middleware[] | undefined;
|
|
2711
|
-
}) => Promise<{
|
|
2712
|
-
orgOptions: OrganizationOptions;
|
|
2713
|
-
roles: typeof defaultRoles & {
|
|
2714
|
-
[key: string]: Role<{}>;
|
|
2715
|
-
};
|
|
2716
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
2717
|
-
session: Session & {
|
|
2718
|
-
activeOrganizationId?: string;
|
|
2719
|
-
};
|
|
2720
|
-
user: User;
|
|
2721
|
-
}>;
|
|
2722
|
-
}>)[];
|
|
2723
|
-
requireHeaders: true;
|
|
2724
|
-
query: ZodObject<{
|
|
2725
|
-
id: ZodString;
|
|
2726
|
-
}, "strip", z.ZodTypeAny, {
|
|
2727
|
-
id: string;
|
|
2728
|
-
}, {
|
|
2729
|
-
id: string;
|
|
2730
|
-
}>;
|
|
2731
|
-
metadata: {
|
|
2732
|
-
openapi: {
|
|
2733
|
-
description: string;
|
|
2734
|
-
responses: {
|
|
2735
|
-
"200": {
|
|
2736
|
-
description: string;
|
|
2737
|
-
content: {
|
|
2738
|
-
"application/json": {
|
|
2739
|
-
schema: {
|
|
2740
|
-
type: string;
|
|
2741
|
-
properties: {
|
|
2742
|
-
id: {
|
|
2743
|
-
type: string;
|
|
2744
|
-
};
|
|
2745
|
-
email: {
|
|
2746
|
-
type: string;
|
|
2747
|
-
};
|
|
2748
|
-
role: {
|
|
2749
|
-
type: string;
|
|
2750
|
-
};
|
|
2751
|
-
organizationId: {
|
|
2752
|
-
type: string;
|
|
2753
|
-
};
|
|
2754
|
-
inviterId: {
|
|
2755
|
-
type: string;
|
|
2756
|
-
};
|
|
2757
|
-
status: {
|
|
2758
|
-
type: string;
|
|
2759
|
-
};
|
|
2760
|
-
expiresAt: {
|
|
2761
|
-
type: string;
|
|
2762
|
-
};
|
|
2763
|
-
organizationName: {
|
|
2764
|
-
type: string;
|
|
2765
|
-
};
|
|
2766
|
-
organizationSlug: {
|
|
2767
|
-
type: string;
|
|
2768
|
-
};
|
|
2769
|
-
inviterEmail: {
|
|
2770
|
-
type: string;
|
|
2771
|
-
};
|
|
2772
|
-
};
|
|
2773
|
-
required: string[];
|
|
2774
|
-
};
|
|
2775
|
-
};
|
|
2776
|
-
};
|
|
2777
|
-
};
|
|
2778
|
-
};
|
|
2779
|
-
};
|
|
2780
|
-
};
|
|
2781
|
-
} & {
|
|
2782
|
-
use: any[];
|
|
2783
|
-
};
|
|
2784
|
-
path: "/organization/get-invitation";
|
|
2785
|
-
};
|
|
2786
|
-
rejectInvitation: {
|
|
2787
|
-
<Context extends {
|
|
2788
|
-
body: {
|
|
2789
|
-
invitationId: string;
|
|
2790
|
-
};
|
|
2791
|
-
method?: "POST" | undefined;
|
|
2792
|
-
query?: Record<string, any> | undefined;
|
|
2793
|
-
params?: Record<string, any> | undefined;
|
|
2794
|
-
request?: Request | undefined;
|
|
2795
|
-
headers?: HeadersInit | undefined;
|
|
2796
|
-
asResponse?: boolean | undefined;
|
|
2797
|
-
returnHeaders?: boolean | undefined;
|
|
2798
|
-
use?: better_call.Middleware[] | undefined;
|
|
2799
|
-
path?: string | undefined;
|
|
2800
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
2801
|
-
headers: Headers;
|
|
2802
|
-
response: {
|
|
2803
|
-
invitation: {
|
|
2804
|
-
id: string;
|
|
2805
|
-
email: string;
|
|
2806
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2807
|
-
expiresAt: Date;
|
|
2808
|
-
organizationId: string;
|
|
2809
|
-
role: string;
|
|
2810
|
-
inviterId: string;
|
|
2811
|
-
} | null;
|
|
2812
|
-
member: null;
|
|
2813
|
-
};
|
|
2814
|
-
} : {
|
|
2815
|
-
invitation: {
|
|
2816
|
-
id: string;
|
|
2817
|
-
email: string;
|
|
2818
|
-
status: "pending" | "accepted" | "rejected" | "canceled";
|
|
2819
|
-
expiresAt: Date;
|
|
2820
|
-
organizationId: string;
|
|
2821
|
-
role: string;
|
|
2822
|
-
inviterId: string;
|
|
2823
|
-
} | null;
|
|
2824
|
-
member: null;
|
|
2825
|
-
}>;
|
|
2826
|
-
options: {
|
|
2827
|
-
method: "POST";
|
|
2828
|
-
body: ZodObject<{
|
|
2829
|
-
invitationId: ZodString;
|
|
2830
|
-
}, "strip", z.ZodTypeAny, {
|
|
2831
|
-
invitationId: string;
|
|
2832
|
-
}, {
|
|
2833
|
-
invitationId: string;
|
|
2834
|
-
}>;
|
|
2835
|
-
use: (((inputContext: {
|
|
2836
|
-
body?: any;
|
|
2837
|
-
query?: Record<string, any> | undefined;
|
|
2838
|
-
request?: Request | undefined;
|
|
2839
|
-
headers?: Headers | undefined;
|
|
2840
|
-
asResponse?: boolean | undefined;
|
|
2841
|
-
returnHeaders?: boolean | undefined;
|
|
2842
|
-
use?: better_call.Middleware[] | undefined;
|
|
2843
|
-
}) => Promise<{
|
|
2844
|
-
orgOptions: OrganizationOptions;
|
|
2845
|
-
roles: typeof defaultRoles & {
|
|
2846
|
-
[key: string]: Role<{}>;
|
|
2847
|
-
};
|
|
2848
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
2849
|
-
session: Session & {
|
|
2850
|
-
activeOrganizationId?: string;
|
|
2851
|
-
};
|
|
2852
|
-
user: User;
|
|
2853
|
-
}>;
|
|
2854
|
-
}>) | ((inputContext: {
|
|
2855
|
-
body?: any;
|
|
2856
|
-
query?: Record<string, any> | undefined;
|
|
2857
|
-
request?: Request | undefined;
|
|
2858
|
-
headers?: Headers | undefined;
|
|
2859
|
-
asResponse?: boolean | undefined;
|
|
2860
|
-
returnHeaders?: boolean | undefined;
|
|
2861
|
-
use?: better_call.Middleware[] | undefined;
|
|
2862
|
-
}) => Promise<{
|
|
2863
|
-
session: {
|
|
2864
|
-
session: Session & {
|
|
2865
|
-
activeOrganizationId?: string;
|
|
2866
|
-
};
|
|
2867
|
-
user: User;
|
|
2868
|
-
};
|
|
2869
|
-
}>))[];
|
|
2870
|
-
metadata: {
|
|
2871
|
-
openapi: {
|
|
2872
|
-
description: string;
|
|
2873
|
-
responses: {
|
|
2874
|
-
"200": {
|
|
2875
|
-
description: string;
|
|
2876
|
-
content: {
|
|
2877
|
-
"application/json": {
|
|
2878
|
-
schema: {
|
|
2879
|
-
type: string;
|
|
2880
|
-
properties: {
|
|
2881
|
-
invitation: {
|
|
2882
|
-
type: string;
|
|
2883
|
-
};
|
|
2884
|
-
member: {
|
|
2885
|
-
type: string;
|
|
2886
|
-
};
|
|
2887
|
-
};
|
|
2888
|
-
};
|
|
2889
|
-
};
|
|
2890
|
-
};
|
|
2891
|
-
};
|
|
2892
|
-
};
|
|
2893
|
-
};
|
|
2894
|
-
};
|
|
2895
|
-
} & {
|
|
2896
|
-
use: any[];
|
|
2897
|
-
};
|
|
2898
|
-
path: "/organization/reject-invitation";
|
|
2899
|
-
};
|
|
2900
|
-
addMember: {
|
|
2901
|
-
<Context extends ({
|
|
2902
|
-
body: z.baseObjectInputType<{
|
|
2903
|
-
userId: ZodString;
|
|
2904
|
-
role: InferRolesFromOption<O>;
|
|
2905
|
-
organizationId: ZodOptional<ZodString>;
|
|
2906
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
2907
|
-
userId: ZodString;
|
|
2908
|
-
role: InferRolesFromOption<O>;
|
|
2909
|
-
organizationId: ZodOptional<ZodString>;
|
|
2910
|
-
}>[k_1]; } : never;
|
|
2911
|
-
method: "POST" | undefined;
|
|
2912
|
-
query: Record<string, any> | undefined;
|
|
2913
|
-
params: Record<string, any> | undefined;
|
|
2914
|
-
request: Request | undefined;
|
|
2915
|
-
headers: HeadersInit | undefined;
|
|
2916
|
-
asResponse?: boolean;
|
|
2917
|
-
returnHeaders?: boolean;
|
|
2918
|
-
use?: better_call.Middleware[];
|
|
2919
|
-
path?: string;
|
|
2920
|
-
} extends infer T_1 ? { [K_1 in keyof T_1 as {
|
|
2921
|
-
body: z.baseObjectInputType<{
|
|
2922
|
-
userId: ZodString;
|
|
2923
|
-
role: InferRolesFromOption<O>;
|
|
2924
|
-
organizationId: ZodOptional<ZodString>;
|
|
2925
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
2926
|
-
userId: ZodString;
|
|
2927
|
-
role: InferRolesFromOption<O>;
|
|
2928
|
-
organizationId: ZodOptional<ZodString>;
|
|
2929
|
-
}>[k_1]; } : never;
|
|
2930
|
-
method: "POST" | undefined;
|
|
2931
|
-
query: Record<string, any> | undefined;
|
|
2932
|
-
params: Record<string, any> | undefined;
|
|
2933
|
-
request: Request | undefined;
|
|
2934
|
-
headers: HeadersInit | undefined;
|
|
2935
|
-
asResponse?: boolean;
|
|
2936
|
-
returnHeaders?: boolean;
|
|
2937
|
-
use?: better_call.Middleware[];
|
|
2938
|
-
path?: string;
|
|
2939
|
-
}[K_1] extends never ? never : undefined extends {
|
|
2940
|
-
body: z.baseObjectInputType<{
|
|
2941
|
-
userId: ZodString;
|
|
2942
|
-
role: InferRolesFromOption<O>;
|
|
2943
|
-
organizationId: ZodOptional<ZodString>;
|
|
2944
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
2945
|
-
userId: ZodString;
|
|
2946
|
-
role: InferRolesFromOption<O>;
|
|
2947
|
-
organizationId: ZodOptional<ZodString>;
|
|
2948
|
-
}>[k_1]; } : never;
|
|
2949
|
-
method: "POST" | undefined;
|
|
2950
|
-
query: Record<string, any> | undefined;
|
|
2951
|
-
params: Record<string, any> | undefined;
|
|
2952
|
-
request: Request | undefined;
|
|
2953
|
-
headers: HeadersInit | undefined;
|
|
2954
|
-
asResponse?: boolean;
|
|
2955
|
-
returnHeaders?: boolean;
|
|
2956
|
-
use?: better_call.Middleware[];
|
|
2957
|
-
path?: string;
|
|
2958
|
-
}[K_1] ? never : K_1]: {
|
|
2959
|
-
body: z.baseObjectInputType<{
|
|
2960
|
-
userId: ZodString;
|
|
2961
|
-
role: InferRolesFromOption<O>;
|
|
2962
|
-
organizationId: ZodOptional<ZodString>;
|
|
2963
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
2964
|
-
userId: ZodString;
|
|
2965
|
-
role: InferRolesFromOption<O>;
|
|
2966
|
-
organizationId: ZodOptional<ZodString>;
|
|
2967
|
-
}>[k_1]; } : never;
|
|
2968
|
-
method: "POST" | undefined;
|
|
2969
|
-
query: Record<string, any> | undefined;
|
|
2970
|
-
params: Record<string, any> | undefined;
|
|
2971
|
-
request: Request | undefined;
|
|
2972
|
-
headers: HeadersInit | undefined;
|
|
2973
|
-
asResponse?: boolean;
|
|
2974
|
-
returnHeaders?: boolean;
|
|
2975
|
-
use?: better_call.Middleware[];
|
|
2976
|
-
path?: string;
|
|
2977
|
-
}[K_1]; } : never) & ({
|
|
2978
|
-
body: z.baseObjectInputType<{
|
|
2979
|
-
userId: ZodString;
|
|
2980
|
-
role: InferRolesFromOption<O>;
|
|
2981
|
-
organizationId: ZodOptional<ZodString>;
|
|
2982
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
2983
|
-
userId: ZodString;
|
|
2984
|
-
role: InferRolesFromOption<O>;
|
|
2985
|
-
organizationId: ZodOptional<ZodString>;
|
|
2986
|
-
}>[k_1]; } : never;
|
|
2987
|
-
method: "POST" | undefined;
|
|
2988
|
-
query: Record<string, any> | undefined;
|
|
2989
|
-
params: Record<string, any> | undefined;
|
|
2990
|
-
request: Request | undefined;
|
|
2991
|
-
headers: HeadersInit | undefined;
|
|
2992
|
-
asResponse?: boolean;
|
|
2993
|
-
returnHeaders?: boolean;
|
|
2994
|
-
use?: better_call.Middleware[];
|
|
2995
|
-
path?: string;
|
|
2996
|
-
} extends infer T_3 ? { [K_2 in keyof T_3 as undefined extends {
|
|
2997
|
-
body: z.baseObjectInputType<{
|
|
2998
|
-
userId: ZodString;
|
|
2999
|
-
role: InferRolesFromOption<O>;
|
|
3000
|
-
organizationId: ZodOptional<ZodString>;
|
|
3001
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3002
|
-
userId: ZodString;
|
|
3003
|
-
role: InferRolesFromOption<O>;
|
|
3004
|
-
organizationId: ZodOptional<ZodString>;
|
|
3005
|
-
}>[k_1]; } : never;
|
|
3006
|
-
method: "POST" | undefined;
|
|
3007
|
-
query: Record<string, any> | undefined;
|
|
3008
|
-
params: Record<string, any> | undefined;
|
|
3009
|
-
request: Request | undefined;
|
|
3010
|
-
headers: HeadersInit | undefined;
|
|
3011
|
-
asResponse?: boolean;
|
|
3012
|
-
returnHeaders?: boolean;
|
|
3013
|
-
use?: better_call.Middleware[];
|
|
3014
|
-
path?: string;
|
|
3015
|
-
}[K_2] ? K_2 : never]?: {
|
|
3016
|
-
body: z.baseObjectInputType<{
|
|
3017
|
-
userId: ZodString;
|
|
3018
|
-
role: InferRolesFromOption<O>;
|
|
3019
|
-
organizationId: ZodOptional<ZodString>;
|
|
3020
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3021
|
-
userId: ZodString;
|
|
3022
|
-
role: InferRolesFromOption<O>;
|
|
3023
|
-
organizationId: ZodOptional<ZodString>;
|
|
3024
|
-
}>[k_1]; } : never;
|
|
3025
|
-
method: "POST" | undefined;
|
|
3026
|
-
query: Record<string, any> | undefined;
|
|
3027
|
-
params: Record<string, any> | undefined;
|
|
3028
|
-
request: Request | undefined;
|
|
3029
|
-
headers: HeadersInit | undefined;
|
|
3030
|
-
asResponse?: boolean;
|
|
3031
|
-
returnHeaders?: boolean;
|
|
3032
|
-
use?: better_call.Middleware[];
|
|
3033
|
-
path?: string;
|
|
3034
|
-
}[K_2] | undefined; } : never) extends infer T_4 ? { [K in keyof T_4]: (({
|
|
3035
|
-
body: z.baseObjectInputType<{
|
|
3036
|
-
userId: ZodString;
|
|
3037
|
-
role: InferRolesFromOption<O>;
|
|
3038
|
-
organizationId: ZodOptional<ZodString>;
|
|
3039
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3040
|
-
userId: ZodString;
|
|
3041
|
-
role: InferRolesFromOption<O>;
|
|
3042
|
-
organizationId: ZodOptional<ZodString>;
|
|
3043
|
-
}>[k_1]; } : never;
|
|
3044
|
-
method: "POST" | undefined;
|
|
3045
|
-
query: Record<string, any> | undefined;
|
|
3046
|
-
params: Record<string, any> | undefined;
|
|
3047
|
-
request: Request | undefined;
|
|
3048
|
-
headers: HeadersInit | undefined;
|
|
3049
|
-
asResponse?: boolean;
|
|
3050
|
-
returnHeaders?: boolean;
|
|
3051
|
-
use?: better_call.Middleware[];
|
|
3052
|
-
path?: string;
|
|
3053
|
-
} extends infer T_5 ? { [K_1_1 in keyof T_5 as {
|
|
3054
|
-
body: z.baseObjectInputType<{
|
|
3055
|
-
userId: ZodString;
|
|
3056
|
-
role: InferRolesFromOption<O>;
|
|
3057
|
-
organizationId: ZodOptional<ZodString>;
|
|
3058
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3059
|
-
userId: ZodString;
|
|
3060
|
-
role: InferRolesFromOption<O>;
|
|
3061
|
-
organizationId: ZodOptional<ZodString>;
|
|
3062
|
-
}>[k_1]; } : never;
|
|
3063
|
-
method: "POST" | undefined;
|
|
3064
|
-
query: Record<string, any> | undefined;
|
|
3065
|
-
params: Record<string, any> | undefined;
|
|
3066
|
-
request: Request | undefined;
|
|
3067
|
-
headers: HeadersInit | undefined;
|
|
3068
|
-
asResponse?: boolean;
|
|
3069
|
-
returnHeaders?: boolean;
|
|
3070
|
-
use?: better_call.Middleware[];
|
|
3071
|
-
path?: string;
|
|
3072
|
-
}[K_1_1] extends never ? never : undefined extends {
|
|
3073
|
-
body: z.baseObjectInputType<{
|
|
3074
|
-
userId: ZodString;
|
|
3075
|
-
role: InferRolesFromOption<O>;
|
|
3076
|
-
organizationId: ZodOptional<ZodString>;
|
|
3077
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3078
|
-
userId: ZodString;
|
|
3079
|
-
role: InferRolesFromOption<O>;
|
|
3080
|
-
organizationId: ZodOptional<ZodString>;
|
|
3081
|
-
}>[k_1]; } : never;
|
|
3082
|
-
method: "POST" | undefined;
|
|
3083
|
-
query: Record<string, any> | undefined;
|
|
3084
|
-
params: Record<string, any> | undefined;
|
|
3085
|
-
request: Request | undefined;
|
|
3086
|
-
headers: HeadersInit | undefined;
|
|
3087
|
-
asResponse?: boolean;
|
|
3088
|
-
returnHeaders?: boolean;
|
|
3089
|
-
use?: better_call.Middleware[];
|
|
3090
|
-
path?: string;
|
|
3091
|
-
}[K_1_1] ? never : K_1_1]: {
|
|
3092
|
-
body: z.baseObjectInputType<{
|
|
3093
|
-
userId: ZodString;
|
|
3094
|
-
role: InferRolesFromOption<O>;
|
|
3095
|
-
organizationId: ZodOptional<ZodString>;
|
|
3096
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3097
|
-
userId: ZodString;
|
|
3098
|
-
role: InferRolesFromOption<O>;
|
|
3099
|
-
organizationId: ZodOptional<ZodString>;
|
|
3100
|
-
}>[k_1]; } : never;
|
|
3101
|
-
method: "POST" | undefined;
|
|
3102
|
-
query: Record<string, any> | undefined;
|
|
3103
|
-
params: Record<string, any> | undefined;
|
|
3104
|
-
request: Request | undefined;
|
|
3105
|
-
headers: HeadersInit | undefined;
|
|
3106
|
-
asResponse?: boolean;
|
|
3107
|
-
returnHeaders?: boolean;
|
|
3108
|
-
use?: better_call.Middleware[];
|
|
3109
|
-
path?: string;
|
|
3110
|
-
}[K_1_1]; } : never) & ({
|
|
3111
|
-
body: z.baseObjectInputType<{
|
|
3112
|
-
userId: ZodString;
|
|
3113
|
-
role: InferRolesFromOption<O>;
|
|
3114
|
-
organizationId: ZodOptional<ZodString>;
|
|
3115
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3116
|
-
userId: ZodString;
|
|
3117
|
-
role: InferRolesFromOption<O>;
|
|
3118
|
-
organizationId: ZodOptional<ZodString>;
|
|
3119
|
-
}>[k_1]; } : never;
|
|
3120
|
-
method: "POST" | undefined;
|
|
3121
|
-
query: Record<string, any> | undefined;
|
|
3122
|
-
params: Record<string, any> | undefined;
|
|
3123
|
-
request: Request | undefined;
|
|
3124
|
-
headers: HeadersInit | undefined;
|
|
3125
|
-
asResponse?: boolean;
|
|
3126
|
-
returnHeaders?: boolean;
|
|
3127
|
-
use?: better_call.Middleware[];
|
|
3128
|
-
path?: string;
|
|
3129
|
-
} extends infer T_6 ? { [K_2_1 in keyof T_6 as undefined extends {
|
|
3130
|
-
body: z.baseObjectInputType<{
|
|
3131
|
-
userId: ZodString;
|
|
3132
|
-
role: InferRolesFromOption<O>;
|
|
3133
|
-
organizationId: ZodOptional<ZodString>;
|
|
3134
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3135
|
-
userId: ZodString;
|
|
3136
|
-
role: InferRolesFromOption<O>;
|
|
3137
|
-
organizationId: ZodOptional<ZodString>;
|
|
3138
|
-
}>[k_1]; } : never;
|
|
3139
|
-
method: "POST" | undefined;
|
|
3140
|
-
query: Record<string, any> | undefined;
|
|
3141
|
-
params: Record<string, any> | undefined;
|
|
3142
|
-
request: Request | undefined;
|
|
3143
|
-
headers: HeadersInit | undefined;
|
|
3144
|
-
asResponse?: boolean;
|
|
3145
|
-
returnHeaders?: boolean;
|
|
3146
|
-
use?: better_call.Middleware[];
|
|
3147
|
-
path?: string;
|
|
3148
|
-
}[K_2_1] ? K_2_1 : never]?: {
|
|
3149
|
-
body: z.baseObjectInputType<{
|
|
3150
|
-
userId: ZodString;
|
|
3151
|
-
role: InferRolesFromOption<O>;
|
|
3152
|
-
organizationId: ZodOptional<ZodString>;
|
|
3153
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3154
|
-
userId: ZodString;
|
|
3155
|
-
role: InferRolesFromOption<O>;
|
|
3156
|
-
organizationId: ZodOptional<ZodString>;
|
|
3157
|
-
}>[k_1]; } : never;
|
|
3158
|
-
method: "POST" | undefined;
|
|
3159
|
-
query: Record<string, any> | undefined;
|
|
3160
|
-
params: Record<string, any> | undefined;
|
|
3161
|
-
request: Request | undefined;
|
|
3162
|
-
headers: HeadersInit | undefined;
|
|
3163
|
-
asResponse?: boolean;
|
|
3164
|
-
returnHeaders?: boolean;
|
|
3165
|
-
use?: better_call.Middleware[];
|
|
3166
|
-
path?: string;
|
|
3167
|
-
}[K_2_1] | undefined; } : never))[K]; } : never>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
3168
|
-
headers: Headers;
|
|
3169
|
-
response: {
|
|
3170
|
-
createdAt: Date;
|
|
3171
|
-
userId: string;
|
|
3172
|
-
organizationId: string;
|
|
3173
|
-
role: string;
|
|
3174
|
-
id?: string | undefined;
|
|
3175
|
-
} | null;
|
|
3176
|
-
} : {
|
|
3177
|
-
createdAt: Date;
|
|
3178
|
-
userId: string;
|
|
3179
|
-
organizationId: string;
|
|
3180
|
-
role: string;
|
|
3181
|
-
id?: string | undefined;
|
|
3182
|
-
} | null>;
|
|
3183
|
-
options: {
|
|
3184
|
-
method: "POST";
|
|
3185
|
-
body: ZodObject<{
|
|
3186
|
-
userId: ZodString;
|
|
3187
|
-
role: InferRolesFromOption<O>;
|
|
3188
|
-
organizationId: ZodOptional<ZodString>;
|
|
3189
|
-
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
3190
|
-
userId: ZodString;
|
|
3191
|
-
role: InferRolesFromOption<O>;
|
|
3192
|
-
organizationId: ZodOptional<ZodString>;
|
|
3193
|
-
}>, any> extends infer T_1 ? { [k_1 in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
3194
|
-
userId: ZodString;
|
|
3195
|
-
role: InferRolesFromOption<O>;
|
|
3196
|
-
organizationId: ZodOptional<ZodString>;
|
|
3197
|
-
}>, any>[k_1]; } : never, z.baseObjectInputType<{
|
|
3198
|
-
userId: ZodString;
|
|
3199
|
-
role: InferRolesFromOption<O>;
|
|
3200
|
-
organizationId: ZodOptional<ZodString>;
|
|
3201
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
3202
|
-
userId: ZodString;
|
|
3203
|
-
role: InferRolesFromOption<O>;
|
|
3204
|
-
organizationId: ZodOptional<ZodString>;
|
|
3205
|
-
}>[k_1]; } : never>;
|
|
3206
|
-
use: ((inputContext: {
|
|
3207
|
-
body?: any;
|
|
3208
|
-
query?: Record<string, any> | undefined;
|
|
3209
|
-
request?: Request | undefined;
|
|
3210
|
-
headers?: Headers | undefined;
|
|
3211
|
-
asResponse?: boolean | undefined;
|
|
3212
|
-
returnHeaders?: boolean | undefined;
|
|
3213
|
-
use?: better_call.Middleware[] | undefined;
|
|
3214
|
-
}) => Promise<{
|
|
3215
|
-
orgOptions: OrganizationOptions;
|
|
3216
|
-
roles: typeof defaultRoles & {
|
|
3217
|
-
[key: string]: Role<{}>;
|
|
3218
|
-
};
|
|
3219
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
3220
|
-
session: Session & {
|
|
3221
|
-
activeOrganizationId?: string;
|
|
3222
|
-
};
|
|
3223
|
-
user: User;
|
|
3224
|
-
}>;
|
|
3225
|
-
}>)[];
|
|
3226
|
-
metadata: {
|
|
3227
|
-
SERVER_ONLY: true;
|
|
3228
|
-
};
|
|
3229
|
-
} & {
|
|
3230
|
-
use: any[];
|
|
3231
|
-
};
|
|
3232
|
-
path: "/organization/add-member";
|
|
3233
|
-
};
|
|
3234
|
-
removeMember: {
|
|
3235
|
-
<Context extends {
|
|
3236
|
-
body: {
|
|
3237
|
-
memberIdOrEmail: string;
|
|
3238
|
-
organizationId?: string | undefined;
|
|
3239
|
-
};
|
|
3240
|
-
method?: "POST" | undefined;
|
|
3241
|
-
query?: Record<string, any> | undefined;
|
|
3242
|
-
params?: Record<string, any> | undefined;
|
|
3243
|
-
request?: Request | undefined;
|
|
3244
|
-
headers?: HeadersInit | undefined;
|
|
3245
|
-
asResponse?: boolean | undefined;
|
|
3246
|
-
returnHeaders?: boolean | undefined;
|
|
3247
|
-
use?: better_call.Middleware[] | undefined;
|
|
3248
|
-
path?: string | undefined;
|
|
3249
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
3250
|
-
headers: Headers;
|
|
3251
|
-
response: {
|
|
3252
|
-
member: {
|
|
3253
|
-
id: string;
|
|
3254
|
-
createdAt: Date;
|
|
3255
|
-
userId: string;
|
|
3256
|
-
organizationId: string;
|
|
3257
|
-
role: string;
|
|
3258
|
-
};
|
|
3259
|
-
} | null;
|
|
3260
|
-
} : {
|
|
3261
|
-
member: {
|
|
3262
|
-
id: string;
|
|
3263
|
-
createdAt: Date;
|
|
3264
|
-
userId: string;
|
|
3265
|
-
organizationId: string;
|
|
3266
|
-
role: string;
|
|
3267
|
-
};
|
|
3268
|
-
} | null>;
|
|
3269
|
-
options: {
|
|
3270
|
-
method: "POST";
|
|
3271
|
-
body: ZodObject<{
|
|
3272
|
-
memberIdOrEmail: ZodString;
|
|
3273
|
-
organizationId: ZodOptional<ZodString>;
|
|
3274
|
-
}, "strip", z.ZodTypeAny, {
|
|
3275
|
-
memberIdOrEmail: string;
|
|
3276
|
-
organizationId?: string | undefined;
|
|
3277
|
-
}, {
|
|
3278
|
-
memberIdOrEmail: string;
|
|
3279
|
-
organizationId?: string | undefined;
|
|
3280
|
-
}>;
|
|
3281
|
-
use: (((inputContext: {
|
|
3282
|
-
body?: any;
|
|
3283
|
-
query?: Record<string, any> | undefined;
|
|
3284
|
-
request?: Request | undefined;
|
|
3285
|
-
headers?: Headers | undefined;
|
|
3286
|
-
asResponse?: boolean | undefined;
|
|
3287
|
-
returnHeaders?: boolean | undefined;
|
|
3288
|
-
use?: better_call.Middleware[] | undefined;
|
|
3289
|
-
}) => Promise<{
|
|
3290
|
-
orgOptions: OrganizationOptions;
|
|
3291
|
-
roles: typeof defaultRoles & {
|
|
3292
|
-
[key: string]: Role<{}>;
|
|
3293
|
-
};
|
|
3294
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
3295
|
-
session: Session & {
|
|
3296
|
-
activeOrganizationId?: string;
|
|
3297
|
-
};
|
|
3298
|
-
user: User;
|
|
3299
|
-
}>;
|
|
3300
|
-
}>) | ((inputContext: {
|
|
3301
|
-
body?: any;
|
|
3302
|
-
query?: Record<string, any> | undefined;
|
|
3303
|
-
request?: Request | undefined;
|
|
3304
|
-
headers?: Headers | undefined;
|
|
3305
|
-
asResponse?: boolean | undefined;
|
|
3306
|
-
returnHeaders?: boolean | undefined;
|
|
3307
|
-
use?: better_call.Middleware[] | undefined;
|
|
3308
|
-
}) => Promise<{
|
|
3309
|
-
session: {
|
|
3310
|
-
session: Session & {
|
|
3311
|
-
activeOrganizationId?: string;
|
|
3312
|
-
};
|
|
3313
|
-
user: User;
|
|
3314
|
-
};
|
|
3315
|
-
}>))[];
|
|
3316
|
-
metadata: {
|
|
3317
|
-
openapi: {
|
|
3318
|
-
description: string;
|
|
3319
|
-
responses: {
|
|
3320
|
-
"200": {
|
|
3321
|
-
description: string;
|
|
3322
|
-
content: {
|
|
3323
|
-
"application/json": {
|
|
3324
|
-
schema: {
|
|
3325
|
-
type: string;
|
|
3326
|
-
properties: {
|
|
3327
|
-
member: {
|
|
3328
|
-
type: string;
|
|
3329
|
-
properties: {
|
|
3330
|
-
id: {
|
|
3331
|
-
type: string;
|
|
3332
|
-
};
|
|
3333
|
-
userId: {
|
|
3334
|
-
type: string;
|
|
3335
|
-
};
|
|
3336
|
-
organizationId: {
|
|
3337
|
-
type: string;
|
|
3338
|
-
};
|
|
3339
|
-
role: {
|
|
3340
|
-
type: string;
|
|
3341
|
-
};
|
|
3342
|
-
};
|
|
3343
|
-
required: string[];
|
|
3344
|
-
};
|
|
3345
|
-
};
|
|
3346
|
-
required: string[];
|
|
3347
|
-
};
|
|
3348
|
-
};
|
|
3349
|
-
};
|
|
3350
|
-
};
|
|
3351
|
-
};
|
|
3352
|
-
};
|
|
3353
|
-
};
|
|
3354
|
-
} & {
|
|
3355
|
-
use: any[];
|
|
3356
|
-
};
|
|
3357
|
-
path: "/organization/remove-member";
|
|
3358
|
-
};
|
|
3359
|
-
updateMemberRole: {
|
|
3360
|
-
<Context extends ({
|
|
3361
|
-
body: z.baseObjectInputType<{
|
|
3362
|
-
role: InferRolesFromOption<O>;
|
|
3363
|
-
memberId: ZodString;
|
|
3364
|
-
organizationId: ZodOptional<ZodString>;
|
|
3365
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3366
|
-
role: InferRolesFromOption<O>;
|
|
3367
|
-
memberId: ZodString;
|
|
3368
|
-
organizationId: ZodOptional<ZodString>;
|
|
3369
|
-
}>[k_2]; } : never;
|
|
3370
|
-
method: "POST" | undefined;
|
|
3371
|
-
query: Record<string, any> | undefined;
|
|
3372
|
-
params: Record<string, any> | undefined;
|
|
3373
|
-
request: Request | undefined;
|
|
3374
|
-
headers: HeadersInit | undefined;
|
|
3375
|
-
asResponse?: boolean;
|
|
3376
|
-
returnHeaders?: boolean;
|
|
3377
|
-
use?: better_call.Middleware[];
|
|
3378
|
-
path?: string;
|
|
3379
|
-
} extends infer T_2 ? { [K_1 in keyof T_2 as {
|
|
3380
|
-
body: z.baseObjectInputType<{
|
|
3381
|
-
role: InferRolesFromOption<O>;
|
|
3382
|
-
memberId: ZodString;
|
|
3383
|
-
organizationId: ZodOptional<ZodString>;
|
|
3384
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3385
|
-
role: InferRolesFromOption<O>;
|
|
3386
|
-
memberId: ZodString;
|
|
3387
|
-
organizationId: ZodOptional<ZodString>;
|
|
3388
|
-
}>[k_2]; } : never;
|
|
3389
|
-
method: "POST" | undefined;
|
|
3390
|
-
query: Record<string, any> | undefined;
|
|
3391
|
-
params: Record<string, any> | undefined;
|
|
3392
|
-
request: Request | undefined;
|
|
3393
|
-
headers: HeadersInit | undefined;
|
|
3394
|
-
asResponse?: boolean;
|
|
3395
|
-
returnHeaders?: boolean;
|
|
3396
|
-
use?: better_call.Middleware[];
|
|
3397
|
-
path?: string;
|
|
3398
|
-
}[K_1] extends never ? never : undefined extends {
|
|
3399
|
-
body: z.baseObjectInputType<{
|
|
3400
|
-
role: InferRolesFromOption<O>;
|
|
3401
|
-
memberId: ZodString;
|
|
3402
|
-
organizationId: ZodOptional<ZodString>;
|
|
3403
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3404
|
-
role: InferRolesFromOption<O>;
|
|
3405
|
-
memberId: ZodString;
|
|
3406
|
-
organizationId: ZodOptional<ZodString>;
|
|
3407
|
-
}>[k_2]; } : never;
|
|
3408
|
-
method: "POST" | undefined;
|
|
3409
|
-
query: Record<string, any> | undefined;
|
|
3410
|
-
params: Record<string, any> | undefined;
|
|
3411
|
-
request: Request | undefined;
|
|
3412
|
-
headers: HeadersInit | undefined;
|
|
3413
|
-
asResponse?: boolean;
|
|
3414
|
-
returnHeaders?: boolean;
|
|
3415
|
-
use?: better_call.Middleware[];
|
|
3416
|
-
path?: string;
|
|
3417
|
-
}[K_1] ? never : K_1]: {
|
|
3418
|
-
body: z.baseObjectInputType<{
|
|
3419
|
-
role: InferRolesFromOption<O>;
|
|
3420
|
-
memberId: ZodString;
|
|
3421
|
-
organizationId: ZodOptional<ZodString>;
|
|
3422
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3423
|
-
role: InferRolesFromOption<O>;
|
|
3424
|
-
memberId: ZodString;
|
|
3425
|
-
organizationId: ZodOptional<ZodString>;
|
|
3426
|
-
}>[k_2]; } : never;
|
|
3427
|
-
method: "POST" | undefined;
|
|
3428
|
-
query: Record<string, any> | undefined;
|
|
3429
|
-
params: Record<string, any> | undefined;
|
|
3430
|
-
request: Request | undefined;
|
|
3431
|
-
headers: HeadersInit | undefined;
|
|
3432
|
-
asResponse?: boolean;
|
|
3433
|
-
returnHeaders?: boolean;
|
|
3434
|
-
use?: better_call.Middleware[];
|
|
3435
|
-
path?: string;
|
|
3436
|
-
}[K_1]; } : never) & ({
|
|
3437
|
-
body: z.baseObjectInputType<{
|
|
3438
|
-
role: InferRolesFromOption<O>;
|
|
3439
|
-
memberId: ZodString;
|
|
3440
|
-
organizationId: ZodOptional<ZodString>;
|
|
3441
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3442
|
-
role: InferRolesFromOption<O>;
|
|
3443
|
-
memberId: ZodString;
|
|
3444
|
-
organizationId: ZodOptional<ZodString>;
|
|
3445
|
-
}>[k_2]; } : never;
|
|
3446
|
-
method: "POST" | undefined;
|
|
3447
|
-
query: Record<string, any> | undefined;
|
|
3448
|
-
params: Record<string, any> | undefined;
|
|
3449
|
-
request: Request | undefined;
|
|
3450
|
-
headers: HeadersInit | undefined;
|
|
3451
|
-
asResponse?: boolean;
|
|
3452
|
-
returnHeaders?: boolean;
|
|
3453
|
-
use?: better_call.Middleware[];
|
|
3454
|
-
path?: string;
|
|
3455
|
-
} extends infer T_4 ? { [K_2 in keyof T_4 as undefined extends {
|
|
3456
|
-
body: z.baseObjectInputType<{
|
|
3457
|
-
role: InferRolesFromOption<O>;
|
|
3458
|
-
memberId: ZodString;
|
|
3459
|
-
organizationId: ZodOptional<ZodString>;
|
|
3460
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3461
|
-
role: InferRolesFromOption<O>;
|
|
3462
|
-
memberId: ZodString;
|
|
3463
|
-
organizationId: ZodOptional<ZodString>;
|
|
3464
|
-
}>[k_2]; } : never;
|
|
3465
|
-
method: "POST" | undefined;
|
|
3466
|
-
query: Record<string, any> | undefined;
|
|
3467
|
-
params: Record<string, any> | undefined;
|
|
3468
|
-
request: Request | undefined;
|
|
3469
|
-
headers: HeadersInit | undefined;
|
|
3470
|
-
asResponse?: boolean;
|
|
3471
|
-
returnHeaders?: boolean;
|
|
3472
|
-
use?: better_call.Middleware[];
|
|
3473
|
-
path?: string;
|
|
3474
|
-
}[K_2] ? K_2 : never]?: {
|
|
3475
|
-
body: z.baseObjectInputType<{
|
|
3476
|
-
role: InferRolesFromOption<O>;
|
|
3477
|
-
memberId: ZodString;
|
|
3478
|
-
organizationId: ZodOptional<ZodString>;
|
|
3479
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3480
|
-
role: InferRolesFromOption<O>;
|
|
3481
|
-
memberId: ZodString;
|
|
3482
|
-
organizationId: ZodOptional<ZodString>;
|
|
3483
|
-
}>[k_2]; } : never;
|
|
3484
|
-
method: "POST" | undefined;
|
|
3485
|
-
query: Record<string, any> | undefined;
|
|
3486
|
-
params: Record<string, any> | undefined;
|
|
3487
|
-
request: Request | undefined;
|
|
3488
|
-
headers: HeadersInit | undefined;
|
|
3489
|
-
asResponse?: boolean;
|
|
3490
|
-
returnHeaders?: boolean;
|
|
3491
|
-
use?: better_call.Middleware[];
|
|
3492
|
-
path?: string;
|
|
3493
|
-
}[K_2] | undefined; } : never) extends infer T_5 ? { [K in keyof T_5]: (({
|
|
3494
|
-
body: z.baseObjectInputType<{
|
|
3495
|
-
role: InferRolesFromOption<O>;
|
|
3496
|
-
memberId: ZodString;
|
|
3497
|
-
organizationId: ZodOptional<ZodString>;
|
|
3498
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3499
|
-
role: InferRolesFromOption<O>;
|
|
3500
|
-
memberId: ZodString;
|
|
3501
|
-
organizationId: ZodOptional<ZodString>;
|
|
3502
|
-
}>[k_2]; } : never;
|
|
3503
|
-
method: "POST" | undefined;
|
|
3504
|
-
query: Record<string, any> | undefined;
|
|
3505
|
-
params: Record<string, any> | undefined;
|
|
3506
|
-
request: Request | undefined;
|
|
3507
|
-
headers: HeadersInit | undefined;
|
|
3508
|
-
asResponse?: boolean;
|
|
3509
|
-
returnHeaders?: boolean;
|
|
3510
|
-
use?: better_call.Middleware[];
|
|
3511
|
-
path?: string;
|
|
3512
|
-
} extends infer T_6 ? { [K_1_1 in keyof T_6 as {
|
|
3513
|
-
body: z.baseObjectInputType<{
|
|
3514
|
-
role: InferRolesFromOption<O>;
|
|
3515
|
-
memberId: ZodString;
|
|
3516
|
-
organizationId: ZodOptional<ZodString>;
|
|
3517
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3518
|
-
role: InferRolesFromOption<O>;
|
|
3519
|
-
memberId: ZodString;
|
|
3520
|
-
organizationId: ZodOptional<ZodString>;
|
|
3521
|
-
}>[k_2]; } : never;
|
|
3522
|
-
method: "POST" | undefined;
|
|
3523
|
-
query: Record<string, any> | undefined;
|
|
3524
|
-
params: Record<string, any> | undefined;
|
|
3525
|
-
request: Request | undefined;
|
|
3526
|
-
headers: HeadersInit | undefined;
|
|
3527
|
-
asResponse?: boolean;
|
|
3528
|
-
returnHeaders?: boolean;
|
|
3529
|
-
use?: better_call.Middleware[];
|
|
3530
|
-
path?: string;
|
|
3531
|
-
}[K_1_1] extends never ? never : undefined extends {
|
|
3532
|
-
body: z.baseObjectInputType<{
|
|
3533
|
-
role: InferRolesFromOption<O>;
|
|
3534
|
-
memberId: ZodString;
|
|
3535
|
-
organizationId: ZodOptional<ZodString>;
|
|
3536
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3537
|
-
role: InferRolesFromOption<O>;
|
|
3538
|
-
memberId: ZodString;
|
|
3539
|
-
organizationId: ZodOptional<ZodString>;
|
|
3540
|
-
}>[k_2]; } : never;
|
|
3541
|
-
method: "POST" | undefined;
|
|
3542
|
-
query: Record<string, any> | undefined;
|
|
3543
|
-
params: Record<string, any> | undefined;
|
|
3544
|
-
request: Request | undefined;
|
|
3545
|
-
headers: HeadersInit | undefined;
|
|
3546
|
-
asResponse?: boolean;
|
|
3547
|
-
returnHeaders?: boolean;
|
|
3548
|
-
use?: better_call.Middleware[];
|
|
3549
|
-
path?: string;
|
|
3550
|
-
}[K_1_1] ? never : K_1_1]: {
|
|
3551
|
-
body: z.baseObjectInputType<{
|
|
3552
|
-
role: InferRolesFromOption<O>;
|
|
3553
|
-
memberId: ZodString;
|
|
3554
|
-
organizationId: ZodOptional<ZodString>;
|
|
3555
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3556
|
-
role: InferRolesFromOption<O>;
|
|
3557
|
-
memberId: ZodString;
|
|
3558
|
-
organizationId: ZodOptional<ZodString>;
|
|
3559
|
-
}>[k_2]; } : never;
|
|
3560
|
-
method: "POST" | undefined;
|
|
3561
|
-
query: Record<string, any> | undefined;
|
|
3562
|
-
params: Record<string, any> | undefined;
|
|
3563
|
-
request: Request | undefined;
|
|
3564
|
-
headers: HeadersInit | undefined;
|
|
3565
|
-
asResponse?: boolean;
|
|
3566
|
-
returnHeaders?: boolean;
|
|
3567
|
-
use?: better_call.Middleware[];
|
|
3568
|
-
path?: string;
|
|
3569
|
-
}[K_1_1]; } : never) & ({
|
|
3570
|
-
body: z.baseObjectInputType<{
|
|
3571
|
-
role: InferRolesFromOption<O>;
|
|
3572
|
-
memberId: ZodString;
|
|
3573
|
-
organizationId: ZodOptional<ZodString>;
|
|
3574
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3575
|
-
role: InferRolesFromOption<O>;
|
|
3576
|
-
memberId: ZodString;
|
|
3577
|
-
organizationId: ZodOptional<ZodString>;
|
|
3578
|
-
}>[k_2]; } : never;
|
|
3579
|
-
method: "POST" | undefined;
|
|
3580
|
-
query: Record<string, any> | undefined;
|
|
3581
|
-
params: Record<string, any> | undefined;
|
|
3582
|
-
request: Request | undefined;
|
|
3583
|
-
headers: HeadersInit | undefined;
|
|
3584
|
-
asResponse?: boolean;
|
|
3585
|
-
returnHeaders?: boolean;
|
|
3586
|
-
use?: better_call.Middleware[];
|
|
3587
|
-
path?: string;
|
|
3588
|
-
} extends infer T_7 ? { [K_2_1 in keyof T_7 as undefined extends {
|
|
3589
|
-
body: z.baseObjectInputType<{
|
|
3590
|
-
role: InferRolesFromOption<O>;
|
|
3591
|
-
memberId: ZodString;
|
|
3592
|
-
organizationId: ZodOptional<ZodString>;
|
|
3593
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3594
|
-
role: InferRolesFromOption<O>;
|
|
3595
|
-
memberId: ZodString;
|
|
3596
|
-
organizationId: ZodOptional<ZodString>;
|
|
3597
|
-
}>[k_2]; } : never;
|
|
3598
|
-
method: "POST" | undefined;
|
|
3599
|
-
query: Record<string, any> | undefined;
|
|
3600
|
-
params: Record<string, any> | undefined;
|
|
3601
|
-
request: Request | undefined;
|
|
3602
|
-
headers: HeadersInit | undefined;
|
|
3603
|
-
asResponse?: boolean;
|
|
3604
|
-
returnHeaders?: boolean;
|
|
3605
|
-
use?: better_call.Middleware[];
|
|
3606
|
-
path?: string;
|
|
3607
|
-
}[K_2_1] ? K_2_1 : never]?: {
|
|
3608
|
-
body: z.baseObjectInputType<{
|
|
3609
|
-
role: InferRolesFromOption<O>;
|
|
3610
|
-
memberId: ZodString;
|
|
3611
|
-
organizationId: ZodOptional<ZodString>;
|
|
3612
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3613
|
-
role: InferRolesFromOption<O>;
|
|
3614
|
-
memberId: ZodString;
|
|
3615
|
-
organizationId: ZodOptional<ZodString>;
|
|
3616
|
-
}>[k_2]; } : never;
|
|
3617
|
-
method: "POST" | undefined;
|
|
3618
|
-
query: Record<string, any> | undefined;
|
|
3619
|
-
params: Record<string, any> | undefined;
|
|
3620
|
-
request: Request | undefined;
|
|
3621
|
-
headers: HeadersInit | undefined;
|
|
3622
|
-
asResponse?: boolean;
|
|
3623
|
-
returnHeaders?: boolean;
|
|
3624
|
-
use?: better_call.Middleware[];
|
|
3625
|
-
path?: string;
|
|
3626
|
-
}[K_2_1] | undefined; } : never))[K]; } : never>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
3627
|
-
headers: Headers;
|
|
3628
|
-
response: {
|
|
3629
|
-
id: string;
|
|
3630
|
-
createdAt: Date;
|
|
3631
|
-
userId: string;
|
|
3632
|
-
organizationId: string;
|
|
3633
|
-
role: string;
|
|
3634
|
-
} | null;
|
|
3635
|
-
} : {
|
|
3636
|
-
id: string;
|
|
3637
|
-
createdAt: Date;
|
|
3638
|
-
userId: string;
|
|
3639
|
-
organizationId: string;
|
|
3640
|
-
role: string;
|
|
3641
|
-
} | null>;
|
|
3642
|
-
options: {
|
|
3643
|
-
method: "POST";
|
|
3644
|
-
body: ZodObject<{
|
|
3645
|
-
role: InferRolesFromOption<O>;
|
|
3646
|
-
memberId: ZodString;
|
|
3647
|
-
organizationId: ZodOptional<ZodString>;
|
|
3648
|
-
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
3649
|
-
role: InferRolesFromOption<O>;
|
|
3650
|
-
memberId: ZodString;
|
|
3651
|
-
organizationId: ZodOptional<ZodString>;
|
|
3652
|
-
}>, any> extends infer T_2 ? { [k_2 in keyof T_2]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
3653
|
-
role: InferRolesFromOption<O>;
|
|
3654
|
-
memberId: ZodString;
|
|
3655
|
-
organizationId: ZodOptional<ZodString>;
|
|
3656
|
-
}>, any>[k_2]; } : never, z.baseObjectInputType<{
|
|
3657
|
-
role: InferRolesFromOption<O>;
|
|
3658
|
-
memberId: ZodString;
|
|
3659
|
-
organizationId: ZodOptional<ZodString>;
|
|
3660
|
-
}> extends infer T_3 ? { [k_2 in keyof T_3]: z.baseObjectInputType<{
|
|
3661
|
-
role: InferRolesFromOption<O>;
|
|
3662
|
-
memberId: ZodString;
|
|
3663
|
-
organizationId: ZodOptional<ZodString>;
|
|
3664
|
-
}>[k_2]; } : never>;
|
|
3665
|
-
use: (((inputContext: {
|
|
3666
|
-
body?: any;
|
|
3667
|
-
query?: Record<string, any> | undefined;
|
|
3668
|
-
request?: Request | undefined;
|
|
3669
|
-
headers?: Headers | undefined;
|
|
3670
|
-
asResponse?: boolean | undefined;
|
|
3671
|
-
returnHeaders?: boolean | undefined;
|
|
3672
|
-
use?: better_call.Middleware[] | undefined;
|
|
3673
|
-
}) => Promise<{
|
|
3674
|
-
orgOptions: OrganizationOptions;
|
|
3675
|
-
roles: typeof defaultRoles & {
|
|
3676
|
-
[key: string]: Role<{}>;
|
|
3677
|
-
};
|
|
3678
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
3679
|
-
session: Session & {
|
|
3680
|
-
activeOrganizationId?: string;
|
|
3681
|
-
};
|
|
3682
|
-
user: User;
|
|
3683
|
-
}>;
|
|
3684
|
-
}>) | ((inputContext: {
|
|
3685
|
-
body?: any;
|
|
3686
|
-
query?: Record<string, any> | undefined;
|
|
3687
|
-
request?: Request | undefined;
|
|
3688
|
-
headers?: Headers | undefined;
|
|
3689
|
-
asResponse?: boolean | undefined;
|
|
3690
|
-
returnHeaders?: boolean | undefined;
|
|
3691
|
-
use?: better_call.Middleware[] | undefined;
|
|
3692
|
-
}) => Promise<{
|
|
3693
|
-
session: {
|
|
3694
|
-
session: Session & {
|
|
3695
|
-
activeOrganizationId?: string;
|
|
3696
|
-
};
|
|
3697
|
-
user: User;
|
|
3698
|
-
};
|
|
3699
|
-
}>))[];
|
|
3700
|
-
metadata: {
|
|
3701
|
-
openapi: {
|
|
3702
|
-
description: string;
|
|
3703
|
-
responses: {
|
|
3704
|
-
"200": {
|
|
3705
|
-
description: string;
|
|
3706
|
-
content: {
|
|
3707
|
-
"application/json": {
|
|
3708
|
-
schema: {
|
|
3709
|
-
type: string;
|
|
3710
|
-
properties: {
|
|
3711
|
-
member: {
|
|
3712
|
-
type: string;
|
|
3713
|
-
properties: {
|
|
3714
|
-
id: {
|
|
3715
|
-
type: string;
|
|
3716
|
-
};
|
|
3717
|
-
userId: {
|
|
3718
|
-
type: string;
|
|
3719
|
-
};
|
|
3720
|
-
organizationId: {
|
|
3721
|
-
type: string;
|
|
3722
|
-
};
|
|
3723
|
-
role: {
|
|
3724
|
-
type: string;
|
|
3725
|
-
};
|
|
3726
|
-
};
|
|
3727
|
-
required: string[];
|
|
3728
|
-
};
|
|
3729
|
-
};
|
|
3730
|
-
required: string[];
|
|
3731
|
-
};
|
|
3732
|
-
};
|
|
3733
|
-
};
|
|
3734
|
-
};
|
|
3735
|
-
};
|
|
3736
|
-
};
|
|
3737
|
-
};
|
|
3738
|
-
} & {
|
|
3739
|
-
use: any[];
|
|
3740
|
-
};
|
|
3741
|
-
path: "/organization/update-member-role";
|
|
3742
|
-
};
|
|
3743
|
-
getActiveMember: {
|
|
3744
|
-
<Context extends {
|
|
3745
|
-
body?: undefined;
|
|
3746
|
-
method?: "GET" | undefined;
|
|
3747
|
-
query?: Record<string, any> | undefined;
|
|
3748
|
-
params?: Record<string, any> | undefined;
|
|
3749
|
-
request?: Request | undefined;
|
|
3750
|
-
headers?: HeadersInit | undefined;
|
|
3751
|
-
asResponse?: boolean | undefined;
|
|
3752
|
-
returnHeaders?: boolean | undefined;
|
|
3753
|
-
use?: better_call.Middleware[] | undefined;
|
|
3754
|
-
path?: string | undefined;
|
|
3755
|
-
}>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
|
|
3756
|
-
headers: Headers;
|
|
3757
|
-
response: {
|
|
3758
|
-
user: {
|
|
3759
|
-
id: string;
|
|
3760
|
-
name: string;
|
|
3761
|
-
email: string;
|
|
3762
|
-
image: string | null | undefined;
|
|
3763
|
-
};
|
|
3764
|
-
id: string;
|
|
3765
|
-
createdAt: Date;
|
|
3766
|
-
userId: string;
|
|
3767
|
-
organizationId: string;
|
|
3768
|
-
role: string;
|
|
3769
|
-
} | null;
|
|
3770
|
-
} : {
|
|
3771
|
-
user: {
|
|
3772
|
-
id: string;
|
|
3773
|
-
name: string;
|
|
3774
|
-
email: string;
|
|
3775
|
-
image: string | null | undefined;
|
|
3776
|
-
};
|
|
3777
|
-
id: string;
|
|
3778
|
-
createdAt: Date;
|
|
3779
|
-
userId: string;
|
|
3780
|
-
organizationId: string;
|
|
3781
|
-
role: string;
|
|
3782
|
-
} | null>;
|
|
3783
|
-
options: {
|
|
3784
|
-
method: "GET";
|
|
3785
|
-
use: (((inputContext: {
|
|
3786
|
-
body?: any;
|
|
3787
|
-
query?: Record<string, any> | undefined;
|
|
3788
|
-
request?: Request | undefined;
|
|
3789
|
-
headers?: Headers | undefined;
|
|
3790
|
-
asResponse?: boolean | undefined;
|
|
3791
|
-
returnHeaders?: boolean | undefined;
|
|
3792
|
-
use?: better_call.Middleware[] | undefined;
|
|
3793
|
-
}) => Promise<{
|
|
3794
|
-
orgOptions: OrganizationOptions;
|
|
3795
|
-
roles: typeof defaultRoles & {
|
|
3796
|
-
[key: string]: Role<{}>;
|
|
3797
|
-
};
|
|
3798
|
-
getSession: (context: GenericEndpointContext) => Promise<{
|
|
3799
|
-
session: Session & {
|
|
3800
|
-
activeOrganizationId?: string;
|
|
3801
|
-
};
|
|
3802
|
-
user: User;
|
|
3803
|
-
}>;
|
|
3804
|
-
}>) | ((inputContext: {
|
|
3805
|
-
body?: any;
|
|
3806
|
-
query?: Record<string, any> | undefined;
|
|
3807
|
-
request?: Request | undefined;
|
|
3808
|
-
headers?: Headers | undefined;
|
|
3809
|
-
asResponse?: boolean | undefined;
|
|
3810
|
-
returnHeaders?: boolean | undefined;
|
|
3811
|
-
use?: better_call.Middleware[] | undefined;
|
|
3812
|
-
}) => Promise<{
|
|
3813
|
-
session: {
|
|
3814
|
-
session: Session & {
|
|
3815
|
-
activeOrganizationId?: string;
|
|
3816
|
-
};
|
|
3817
|
-
user: User;
|
|
3818
|
-
};
|
|
3819
|
-
}>))[];
|
|
3820
|
-
metadata: {
|
|
3821
|
-
openapi: {
|
|
3822
|
-
description: string;
|
|
3823
|
-
responses: {
|
|
3824
|
-
"200": {
|
|
3825
|
-
description: string;
|
|
3826
|
-
content: {
|
|
3827
|
-
"application/json": {
|
|
3828
|
-
schema: {
|
|
3829
|
-
type: string;
|
|
3830
|
-
properties: {
|
|
3831
|
-
id: {
|
|
3832
|
-
type: string;
|
|
3833
|
-
};
|
|
3834
|
-
userId: {
|
|
3835
|
-
type: string;
|
|
3836
|
-
};
|
|
3837
|
-
organizationId: {
|
|
3838
|
-
type: string;
|
|
3839
|
-
};
|
|
3840
|
-
role: {
|
|
3841
|
-
type: string;
|
|
3842
|
-
};
|
|
3843
|
-
};
|
|
3844
|
-
required: string[];
|
|
3845
|
-
};
|
|
3846
|
-
};
|
|
3847
|
-
};
|
|
3848
|
-
};
|
|
3849
|
-
};
|
|
3850
|
-
};
|
|
3851
|
-
};
|
|
3852
|
-
} & {
|
|
3853
|
-
use: any[];
|
|
3854
|
-
};
|
|
3855
|
-
path: "/organization/get-active-member";
|
|
3856
|
-
};
|
|
3857
|
-
};
|
|
3858
|
-
schema: {
|
|
3859
|
-
session: {
|
|
3860
|
-
fields: {
|
|
3861
|
-
activeOrganizationId: {
|
|
3862
|
-
type: "string";
|
|
3863
|
-
required: false;
|
|
3864
|
-
fieldName: string | undefined;
|
|
3865
|
-
};
|
|
3866
|
-
};
|
|
3867
|
-
};
|
|
3868
|
-
organization: {
|
|
3869
|
-
modelName: string | undefined;
|
|
3870
|
-
fields: {
|
|
3871
|
-
name: {
|
|
3872
|
-
type: "string";
|
|
3873
|
-
required: true;
|
|
3874
|
-
sortable: true;
|
|
3875
|
-
fieldName: string | undefined;
|
|
3876
|
-
};
|
|
3877
|
-
slug: {
|
|
3878
|
-
type: "string";
|
|
3879
|
-
unique: true;
|
|
3880
|
-
sortable: true;
|
|
3881
|
-
fieldName: string | undefined;
|
|
3882
|
-
};
|
|
3883
|
-
logo: {
|
|
3884
|
-
type: "string";
|
|
3885
|
-
required: false;
|
|
3886
|
-
fieldName: string | undefined;
|
|
3887
|
-
};
|
|
3888
|
-
createdAt: {
|
|
3889
|
-
type: "date";
|
|
3890
|
-
required: true;
|
|
3891
|
-
fieldName: string | undefined;
|
|
3892
|
-
};
|
|
3893
|
-
metadata: {
|
|
3894
|
-
type: "string";
|
|
3895
|
-
required: false;
|
|
3896
|
-
fieldName: string | undefined;
|
|
3897
|
-
};
|
|
3898
|
-
};
|
|
3899
|
-
};
|
|
3900
|
-
member: {
|
|
3901
|
-
modelName: string | undefined;
|
|
3902
|
-
fields: {
|
|
3903
|
-
organizationId: {
|
|
3904
|
-
type: "string";
|
|
3905
|
-
required: true;
|
|
3906
|
-
references: {
|
|
3907
|
-
model: string;
|
|
3908
|
-
field: string;
|
|
3909
|
-
};
|
|
3910
|
-
fieldName: string | undefined;
|
|
3911
|
-
};
|
|
3912
|
-
userId: {
|
|
3913
|
-
type: "string";
|
|
3914
|
-
required: true;
|
|
3915
|
-
fieldName: string | undefined;
|
|
3916
|
-
references: {
|
|
3917
|
-
model: string;
|
|
3918
|
-
field: string;
|
|
3919
|
-
};
|
|
3920
|
-
};
|
|
3921
|
-
role: {
|
|
3922
|
-
type: "string";
|
|
3923
|
-
required: true;
|
|
3924
|
-
sortable: true;
|
|
3925
|
-
defaultValue: string;
|
|
3926
|
-
fieldName: string | undefined;
|
|
3927
|
-
};
|
|
3928
|
-
createdAt: {
|
|
3929
|
-
type: "date";
|
|
3930
|
-
required: true;
|
|
3931
|
-
fieldName: string | undefined;
|
|
3932
|
-
};
|
|
3933
|
-
};
|
|
3934
|
-
};
|
|
3935
|
-
invitation: {
|
|
3936
|
-
modelName: string | undefined;
|
|
3937
|
-
fields: {
|
|
3938
|
-
organizationId: {
|
|
3939
|
-
type: "string";
|
|
3940
|
-
required: true;
|
|
3941
|
-
references: {
|
|
3942
|
-
model: string;
|
|
3943
|
-
field: string;
|
|
3944
|
-
};
|
|
3945
|
-
fieldName: string | undefined;
|
|
3946
|
-
};
|
|
3947
|
-
email: {
|
|
3948
|
-
type: "string";
|
|
3949
|
-
required: true;
|
|
3950
|
-
sortable: true;
|
|
3951
|
-
fieldName: string | undefined;
|
|
3952
|
-
};
|
|
3953
|
-
role: {
|
|
3954
|
-
type: "string";
|
|
3955
|
-
required: false;
|
|
3956
|
-
sortable: true;
|
|
3957
|
-
fieldName: string | undefined;
|
|
3958
|
-
};
|
|
3959
|
-
status: {
|
|
3960
|
-
type: "string";
|
|
3961
|
-
required: true;
|
|
3962
|
-
sortable: true;
|
|
3963
|
-
defaultValue: string;
|
|
3964
|
-
fieldName: string | undefined;
|
|
3965
|
-
};
|
|
3966
|
-
expiresAt: {
|
|
3967
|
-
type: "date";
|
|
3968
|
-
required: true;
|
|
3969
|
-
fieldName: string | undefined;
|
|
3970
|
-
};
|
|
3971
|
-
inviterId: {
|
|
3972
|
-
type: "string";
|
|
3973
|
-
references: {
|
|
3974
|
-
model: string;
|
|
3975
|
-
field: string;
|
|
3976
|
-
};
|
|
3977
|
-
fieldName: string | undefined;
|
|
3978
|
-
required: true;
|
|
3979
|
-
};
|
|
3980
|
-
};
|
|
3981
|
-
};
|
|
3982
|
-
};
|
|
3983
|
-
$Infer: {
|
|
3984
|
-
Organization: Organization;
|
|
3985
|
-
Invitation: Invitation;
|
|
3986
|
-
Member: Member;
|
|
3987
|
-
ActiveOrganization: Prettify<Organization & {
|
|
3988
|
-
members: Prettify<Member & {
|
|
3989
|
-
user: {
|
|
3990
|
-
id: string;
|
|
3991
|
-
name: string;
|
|
3992
|
-
email: string;
|
|
3993
|
-
image?: string | null;
|
|
3994
|
-
};
|
|
3995
|
-
}>[];
|
|
3996
|
-
invitations: Invitation[];
|
|
3997
|
-
}>;
|
|
3998
|
-
};
|
|
3999
|
-
$ERROR_CODES: {
|
|
4000
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization";
|
|
4001
|
-
readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations";
|
|
4002
|
-
readonly ORGANIZATION_ALREADY_EXISTS: "Organization already exists";
|
|
4003
|
-
readonly ORGANIZATION_NOT_FOUND: "Organization not found";
|
|
4004
|
-
readonly USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: "User is not a member of the organization";
|
|
4005
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: "You are not allowed to update this organization";
|
|
4006
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: "You are not allowed to delete this organization";
|
|
4007
|
-
readonly NO_ACTIVE_ORGANIZATION: "No active organization";
|
|
4008
|
-
readonly USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization";
|
|
4009
|
-
readonly MEMBER_NOT_FOUND: "Member not found";
|
|
4010
|
-
readonly ROLE_NOT_FOUND: "Role not found";
|
|
4011
|
-
readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner";
|
|
4012
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member";
|
|
4013
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization";
|
|
4014
|
-
readonly USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization";
|
|
4015
|
-
readonly INVITATION_NOT_FOUND: "Invitation not found";
|
|
4016
|
-
readonly YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation";
|
|
4017
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation";
|
|
4018
|
-
readonly INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization";
|
|
4019
|
-
readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "you are not allowed to invite user with this role";
|
|
4020
|
-
};
|
|
4021
|
-
};
|
|
4022
|
-
|
|
4023
|
-
export { type Invitation as I, type Member as M, type OrganizationOptions as O, type Organization as a, organization as o };
|