better-auth 1.2.0-beta.5 → 1.2.0-beta.8

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