@authhero/kysely-adapter 10.53.0 → 10.54.0

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.
@@ -4238,6 +4238,135 @@ declare const hookSchema: z.ZodUnion<[
4238
4238
  }>
4239
4239
  ]>;
4240
4240
  export type Hook = z.infer<typeof hookSchema>;
4241
+ declare const inviteInsertSchema: z.ZodObject<{
4242
+ organization_id: z.ZodString;
4243
+ inviter: z.ZodObject<{
4244
+ name: z.ZodOptional<z.ZodString>;
4245
+ }, "strip", z.ZodTypeAny, {
4246
+ name?: string | undefined;
4247
+ }, {
4248
+ name?: string | undefined;
4249
+ }>;
4250
+ invitee: z.ZodObject<{
4251
+ email: z.ZodOptional<z.ZodString>;
4252
+ }, "strip", z.ZodTypeAny, {
4253
+ email?: string | undefined;
4254
+ }, {
4255
+ email?: string | undefined;
4256
+ }>;
4257
+ invitation_url: z.ZodString;
4258
+ client_id: z.ZodString;
4259
+ connection_id: z.ZodOptional<z.ZodString>;
4260
+ app_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
4261
+ user_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
4262
+ ttl_sec: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
4263
+ roles: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4264
+ send_invitation_email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4265
+ }, "strip", z.ZodTypeAny, {
4266
+ client_id: string;
4267
+ organization_id: string;
4268
+ inviter: {
4269
+ name?: string | undefined;
4270
+ };
4271
+ invitee: {
4272
+ email?: string | undefined;
4273
+ };
4274
+ invitation_url: string;
4275
+ app_metadata?: Record<string, any> | undefined;
4276
+ user_metadata?: Record<string, any> | undefined;
4277
+ connection_id?: string | undefined;
4278
+ ttl_sec?: number | undefined;
4279
+ roles?: string[] | undefined;
4280
+ send_invitation_email?: boolean | undefined;
4281
+ }, {
4282
+ client_id: string;
4283
+ organization_id: string;
4284
+ inviter: {
4285
+ name?: string | undefined;
4286
+ };
4287
+ invitee: {
4288
+ email?: string | undefined;
4289
+ };
4290
+ invitation_url: string;
4291
+ app_metadata?: Record<string, any> | undefined;
4292
+ user_metadata?: Record<string, any> | undefined;
4293
+ connection_id?: string | undefined;
4294
+ ttl_sec?: number | undefined;
4295
+ roles?: string[] | undefined;
4296
+ send_invitation_email?: boolean | undefined;
4297
+ }>;
4298
+ export type InviteInsert = z.infer<typeof inviteInsertSchema>;
4299
+ declare const inviteSchema: z.ZodObject<{
4300
+ id: z.ZodString;
4301
+ created_at: z.ZodString;
4302
+ expires_at: z.ZodString;
4303
+ ticket_id: z.ZodOptional<z.ZodString>;
4304
+ } & {
4305
+ organization_id: z.ZodString;
4306
+ inviter: z.ZodObject<{
4307
+ name: z.ZodOptional<z.ZodString>;
4308
+ }, "strip", z.ZodTypeAny, {
4309
+ name?: string | undefined;
4310
+ }, {
4311
+ name?: string | undefined;
4312
+ }>;
4313
+ invitee: z.ZodObject<{
4314
+ email: z.ZodOptional<z.ZodString>;
4315
+ }, "strip", z.ZodTypeAny, {
4316
+ email?: string | undefined;
4317
+ }, {
4318
+ email?: string | undefined;
4319
+ }>;
4320
+ invitation_url: z.ZodString;
4321
+ client_id: z.ZodString;
4322
+ connection_id: z.ZodOptional<z.ZodString>;
4323
+ app_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
4324
+ user_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
4325
+ ttl_sec: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
4326
+ roles: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4327
+ send_invitation_email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4328
+ }, "strip", z.ZodTypeAny, {
4329
+ created_at: string;
4330
+ client_id: string;
4331
+ id: string;
4332
+ expires_at: string;
4333
+ organization_id: string;
4334
+ inviter: {
4335
+ name?: string | undefined;
4336
+ };
4337
+ invitee: {
4338
+ email?: string | undefined;
4339
+ };
4340
+ invitation_url: string;
4341
+ app_metadata?: Record<string, any> | undefined;
4342
+ user_metadata?: Record<string, any> | undefined;
4343
+ connection_id?: string | undefined;
4344
+ ttl_sec?: number | undefined;
4345
+ roles?: string[] | undefined;
4346
+ send_invitation_email?: boolean | undefined;
4347
+ ticket_id?: string | undefined;
4348
+ }, {
4349
+ created_at: string;
4350
+ client_id: string;
4351
+ id: string;
4352
+ expires_at: string;
4353
+ organization_id: string;
4354
+ inviter: {
4355
+ name?: string | undefined;
4356
+ };
4357
+ invitee: {
4358
+ email?: string | undefined;
4359
+ };
4360
+ invitation_url: string;
4361
+ app_metadata?: Record<string, any> | undefined;
4362
+ user_metadata?: Record<string, any> | undefined;
4363
+ connection_id?: string | undefined;
4364
+ ttl_sec?: number | undefined;
4365
+ roles?: string[] | undefined;
4366
+ send_invitation_email?: boolean | undefined;
4367
+ ticket_id?: string | undefined;
4368
+ }>;
4369
+ export type Invite = z.infer<typeof inviteSchema>;
4241
4370
  export interface ListParams {
4242
4371
  page?: number;
4243
4372
  per_page?: number;
@@ -7488,6 +7617,16 @@ export interface UserOrganizationsAdapter {
7488
7617
  } & Totals>;
7489
7618
  update(tenantId: string, id: string, params: Partial<UserOrganizationInsert>): Promise<boolean>;
7490
7619
  }
7620
+ export interface ListInvitesResponse extends Totals {
7621
+ invites: Invite[];
7622
+ }
7623
+ export interface InvitesAdapter {
7624
+ create(tenant_id: string, params: InviteInsert): Promise<Invite>;
7625
+ get(tenant_id: string, id: string): Promise<Invite | null>;
7626
+ remove(tenant_id: string, id: string): Promise<boolean>;
7627
+ list(tenant_id: string, params?: ListParams): Promise<ListInvitesResponse>;
7628
+ update(tenant_id: string, id: string, params: Partial<InviteInsert>): Promise<boolean>;
7629
+ }
7491
7630
  export interface DataAdapters {
7492
7631
  branding: BrandingAdapter;
7493
7632
  cache?: CacheAdapter;
@@ -7500,6 +7639,7 @@ export interface DataAdapters {
7500
7639
  emailProviders: EmailProvidersAdapter;
7501
7640
  forms: FormsAdapter;
7502
7641
  hooks: HooksAdapter;
7642
+ invites: InvitesAdapter;
7503
7643
  keys: KeysAdapter;
7504
7644
  loginSessions: LoginSessionsAdapter;
7505
7645
  logs: LogsDataAdapter;
@@ -8475,6 +8615,58 @@ declare const sqlUserOrganizationSchema: z.ZodObject<{
8475
8615
  id: string;
8476
8616
  organization_id: string;
8477
8617
  }>;
8618
+ declare const sqlInviteSchema: z.ZodObject<{
8619
+ id: z.ZodString;
8620
+ tenant_id: z.ZodString;
8621
+ organization_id: z.ZodString;
8622
+ inviter: z.ZodString;
8623
+ invitee: z.ZodString;
8624
+ client_id: z.ZodString;
8625
+ connection_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
8626
+ invitation_url: z.ZodString;
8627
+ created_at: z.ZodString;
8628
+ expires_at: z.ZodString;
8629
+ app_metadata: z.ZodDefault<z.ZodOptional<z.ZodString>>;
8630
+ user_metadata: z.ZodDefault<z.ZodOptional<z.ZodString>>;
8631
+ roles: z.ZodDefault<z.ZodOptional<z.ZodString>>;
8632
+ ticket_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
8633
+ ttl_sec: z.ZodOptional<z.ZodNumber>;
8634
+ send_invitation_email: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
8635
+ }, "strip", z.ZodTypeAny, {
8636
+ tenant_id: string;
8637
+ app_metadata: string;
8638
+ user_metadata: string;
8639
+ created_at: string;
8640
+ id: string;
8641
+ expires_at: string;
8642
+ client_id: string;
8643
+ organization_id: string;
8644
+ inviter: string;
8645
+ invitee: string;
8646
+ invitation_url: string;
8647
+ roles: string;
8648
+ send_invitation_email: number;
8649
+ connection_id?: string | null | undefined;
8650
+ ticket_id?: string | null | undefined;
8651
+ ttl_sec?: number | undefined;
8652
+ }, {
8653
+ tenant_id: string;
8654
+ created_at: string;
8655
+ id: string;
8656
+ expires_at: string;
8657
+ client_id: string;
8658
+ organization_id: string;
8659
+ inviter: string;
8660
+ invitee: string;
8661
+ invitation_url: string;
8662
+ app_metadata?: string | undefined;
8663
+ user_metadata?: string | undefined;
8664
+ connection_id?: string | null | undefined;
8665
+ roles?: string | undefined;
8666
+ ticket_id?: string | null | undefined;
8667
+ ttl_sec?: number | undefined;
8668
+ send_invitation_email?: number | undefined;
8669
+ }>;
8478
8670
  declare const sqlClientSchema: z.ZodObject<{
8479
8671
  tenant_id: z.ZodString;
8480
8672
  global: z.ZodNumber;
@@ -8703,6 +8895,7 @@ export interface Database {
8703
8895
  roles: z.infer<typeof sqlRoleSchema>;
8704
8896
  organizations: z.infer<typeof sqlOrganizationSchema>;
8705
8897
  user_organizations: z.infer<typeof sqlUserOrganizationSchema>;
8898
+ invites: z.infer<typeof sqlInviteSchema>;
8706
8899
  }
8707
8900
  export declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
8708
8901
  export declare function migrateDown(db: Kysely<Database>): Promise<void>;