authhero 0.208.0 → 0.209.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.
@@ -14392,14 +14392,17 @@ export declare const userPermissionInsertSchema: z.ZodObject<{
14392
14392
  user_id: z.ZodString;
14393
14393
  resource_server_identifier: z.ZodString;
14394
14394
  permission_name: z.ZodString;
14395
+ organization_id: z.ZodOptional<z.ZodString>;
14395
14396
  }, "strip", z.ZodTypeAny, {
14396
14397
  user_id: string;
14397
14398
  resource_server_identifier: string;
14398
14399
  permission_name: string;
14400
+ organization_id?: string | undefined;
14399
14401
  }, {
14400
14402
  user_id: string;
14401
14403
  resource_server_identifier: string;
14402
14404
  permission_name: string;
14405
+ organization_id?: string | undefined;
14403
14406
  }>;
14404
14407
  export type UserPermissionInsert = z.infer<typeof userPermissionInsertSchema>;
14405
14408
  export declare const userPermissionSchema: z.ZodObject<{
@@ -14408,18 +14411,21 @@ export declare const userPermissionSchema: z.ZodObject<{
14408
14411
  user_id: z.ZodString;
14409
14412
  resource_server_identifier: z.ZodString;
14410
14413
  permission_name: z.ZodString;
14414
+ organization_id: z.ZodOptional<z.ZodString>;
14411
14415
  }, "strip", z.ZodTypeAny, {
14412
14416
  user_id: string;
14413
14417
  tenant_id: string;
14414
14418
  resource_server_identifier: string;
14415
14419
  permission_name: string;
14416
14420
  created_at?: string | undefined;
14421
+ organization_id?: string | undefined;
14417
14422
  }, {
14418
14423
  user_id: string;
14419
14424
  tenant_id: string;
14420
14425
  resource_server_identifier: string;
14421
14426
  permission_name: string;
14422
14427
  created_at?: string | undefined;
14428
+ organization_id?: string | undefined;
14423
14429
  }>;
14424
14430
  export type UserPermission = z.infer<typeof userPermissionSchema>;
14425
14431
  export declare const userPermissionListSchema: z.ZodArray<z.ZodObject<{
@@ -14428,18 +14434,21 @@ export declare const userPermissionListSchema: z.ZodArray<z.ZodObject<{
14428
14434
  user_id: z.ZodString;
14429
14435
  resource_server_identifier: z.ZodString;
14430
14436
  permission_name: z.ZodString;
14437
+ organization_id: z.ZodOptional<z.ZodString>;
14431
14438
  }, "strip", z.ZodTypeAny, {
14432
14439
  user_id: string;
14433
14440
  tenant_id: string;
14434
14441
  resource_server_identifier: string;
14435
14442
  permission_name: string;
14436
14443
  created_at?: string | undefined;
14444
+ organization_id?: string | undefined;
14437
14445
  }, {
14438
14446
  user_id: string;
14439
14447
  tenant_id: string;
14440
14448
  resource_server_identifier: string;
14441
14449
  permission_name: string;
14442
14450
  created_at?: string | undefined;
14451
+ organization_id?: string | undefined;
14443
14452
  }>, "many">;
14444
14453
  export type UserPermissionList = z.infer<typeof userPermissionListSchema>;
14445
14454
  export declare const userPermissionWithDetailsSchema: z.ZodObject<{
@@ -14449,6 +14458,7 @@ export declare const userPermissionWithDetailsSchema: z.ZodObject<{
14449
14458
  permission_name: z.ZodString;
14450
14459
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14451
14460
  created_at: z.ZodOptional<z.ZodString>;
14461
+ organization_id: z.ZodOptional<z.ZodString>;
14452
14462
  }, "strip", z.ZodTypeAny, {
14453
14463
  user_id: string;
14454
14464
  resource_server_identifier: string;
@@ -14456,6 +14466,7 @@ export declare const userPermissionWithDetailsSchema: z.ZodObject<{
14456
14466
  resource_server_name: string;
14457
14467
  description?: string | null | undefined;
14458
14468
  created_at?: string | undefined;
14469
+ organization_id?: string | undefined;
14459
14470
  }, {
14460
14471
  user_id: string;
14461
14472
  resource_server_identifier: string;
@@ -14463,6 +14474,7 @@ export declare const userPermissionWithDetailsSchema: z.ZodObject<{
14463
14474
  resource_server_name: string;
14464
14475
  description?: string | null | undefined;
14465
14476
  created_at?: string | undefined;
14477
+ organization_id?: string | undefined;
14466
14478
  }>;
14467
14479
  export type UserPermissionWithDetails = z.infer<typeof userPermissionWithDetailsSchema>;
14468
14480
  export declare const userPermissionWithDetailsListSchema: z.ZodArray<z.ZodObject<{
@@ -14472,6 +14484,7 @@ export declare const userPermissionWithDetailsListSchema: z.ZodArray<z.ZodObject
14472
14484
  permission_name: z.ZodString;
14473
14485
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14474
14486
  created_at: z.ZodOptional<z.ZodString>;
14487
+ organization_id: z.ZodOptional<z.ZodString>;
14475
14488
  }, "strip", z.ZodTypeAny, {
14476
14489
  user_id: string;
14477
14490
  resource_server_identifier: string;
@@ -14479,6 +14492,7 @@ export declare const userPermissionWithDetailsListSchema: z.ZodArray<z.ZodObject
14479
14492
  resource_server_name: string;
14480
14493
  description?: string | null | undefined;
14481
14494
  created_at?: string | undefined;
14495
+ organization_id?: string | undefined;
14482
14496
  }, {
14483
14497
  user_id: string;
14484
14498
  resource_server_identifier: string;
@@ -14486,8 +14500,63 @@ export declare const userPermissionWithDetailsListSchema: z.ZodArray<z.ZodObject
14486
14500
  resource_server_name: string;
14487
14501
  description?: string | null | undefined;
14488
14502
  created_at?: string | undefined;
14503
+ organization_id?: string | undefined;
14489
14504
  }>, "many">;
14490
14505
  export type UserPermissionWithDetailsList = z.infer<typeof userPermissionWithDetailsListSchema>;
14506
+ export declare const userRoleInsertSchema: z.ZodObject<{
14507
+ user_id: z.ZodString;
14508
+ role_id: z.ZodString;
14509
+ organization_id: z.ZodOptional<z.ZodString>;
14510
+ }, "strip", z.ZodTypeAny, {
14511
+ user_id: string;
14512
+ role_id: string;
14513
+ organization_id?: string | undefined;
14514
+ }, {
14515
+ user_id: string;
14516
+ role_id: string;
14517
+ organization_id?: string | undefined;
14518
+ }>;
14519
+ export type UserRoleInsert = z.infer<typeof userRoleInsertSchema>;
14520
+ export declare const userRoleSchema: z.ZodObject<{
14521
+ tenant_id: z.ZodString;
14522
+ created_at: z.ZodOptional<z.ZodString>;
14523
+ user_id: z.ZodString;
14524
+ role_id: z.ZodString;
14525
+ organization_id: z.ZodOptional<z.ZodString>;
14526
+ }, "strip", z.ZodTypeAny, {
14527
+ user_id: string;
14528
+ tenant_id: string;
14529
+ role_id: string;
14530
+ created_at?: string | undefined;
14531
+ organization_id?: string | undefined;
14532
+ }, {
14533
+ user_id: string;
14534
+ tenant_id: string;
14535
+ role_id: string;
14536
+ created_at?: string | undefined;
14537
+ organization_id?: string | undefined;
14538
+ }>;
14539
+ export type UserRole = z.infer<typeof userRoleSchema>;
14540
+ export declare const userRoleListSchema: z.ZodArray<z.ZodObject<{
14541
+ tenant_id: z.ZodString;
14542
+ created_at: z.ZodOptional<z.ZodString>;
14543
+ user_id: z.ZodString;
14544
+ role_id: z.ZodString;
14545
+ organization_id: z.ZodOptional<z.ZodString>;
14546
+ }, "strip", z.ZodTypeAny, {
14547
+ user_id: string;
14548
+ tenant_id: string;
14549
+ role_id: string;
14550
+ created_at?: string | undefined;
14551
+ organization_id?: string | undefined;
14552
+ }, {
14553
+ user_id: string;
14554
+ tenant_id: string;
14555
+ role_id: string;
14556
+ created_at?: string | undefined;
14557
+ organization_id?: string | undefined;
14558
+ }>, "many">;
14559
+ export type UserRoleList = z.infer<typeof userRoleListSchema>;
14491
14560
  export declare const roleInsertSchema: z.ZodObject<{
14492
14561
  name: z.ZodString;
14493
14562
  description: z.ZodOptional<z.ZodString>;
@@ -15098,9 +15167,9 @@ export interface RolePermissionsAdapter {
15098
15167
  list(tenant_id: string, role_id: string, params?: ListParams): Promise<RolePermissionWithDetailsList>;
15099
15168
  }
15100
15169
  export interface UserPermissionsAdapter {
15101
- assign(tenant_id: string, user_id: string, permissions: UserPermissionInsert[]): Promise<boolean>;
15102
- remove(tenant_id: string, user_id: string, permissions: Pick<UserPermissionInsert, "resource_server_identifier" | "permission_name">[]): Promise<boolean>;
15103
- list(tenant_id: string, user_id: string, params?: ListParams): Promise<UserPermissionWithDetailsList>;
15170
+ create(tenant_id: string, user_id: string, permission: UserPermissionInsert, organization_id?: string): Promise<boolean>;
15171
+ remove(tenant_id: string, user_id: string, permission: Pick<UserPermissionInsert, "resource_server_identifier" | "permission_name">, organization_id?: string): Promise<boolean>;
15172
+ list(tenant_id: string, user_id: string, params?: ListParams, organization_id?: string): Promise<UserPermissionWithDetailsList>;
15104
15173
  }
15105
15174
  export interface ListRolesResponse extends Totals {
15106
15175
  roles: Role[];
@@ -15119,9 +15188,9 @@ export interface ListUserRolesResponse {
15119
15188
  length: number;
15120
15189
  }
15121
15190
  export interface UserRolesAdapter {
15122
- list(tenantId: string, userId: string, params?: ListParams): Promise<Role[]>;
15123
- assign(tenantId: string, userId: string, roles: string[]): Promise<boolean>;
15124
- remove(tenantId: string, userId: string, roles: string[]): Promise<boolean>;
15191
+ list(tenantId: string, userId: string, params?: ListParams, organizationId?: string): Promise<Role[]>;
15192
+ create(tenantId: string, userId: string, roleId: string, organizationId?: string): Promise<boolean>;
15193
+ remove(tenantId: string, userId: string, roleId: string, organizationId?: string): Promise<boolean>;
15125
15194
  }
15126
15195
  export interface ListOrganizationsResponse extends Totals {
15127
15196
  organizations: Organization[];
@@ -15147,6 +15216,13 @@ export interface UserOrganizationsAdapter {
15147
15216
  list(tenantId: string, params?: ListParams): Promise<{
15148
15217
  userOrganizations: UserOrganization[];
15149
15218
  } & Totals>;
15219
+ /**
15220
+ * List organizations for a specific user (Auth0 compatible API)
15221
+ * Returns full organization objects instead of user-organization relationships
15222
+ */
15223
+ listUserOrganizations(tenantId: string, userId: string, params?: ListParams): Promise<{
15224
+ organizations: Organization[];
15225
+ } & Totals>;
15150
15226
  update(tenantId: string, id: string, params: Partial<UserOrganizationInsert>): Promise<boolean>;
15151
15227
  }
15152
15228
  export interface DataAdapters {
@@ -15955,22 +16031,25 @@ export declare function init(config: AuthHeroConfig): {
15955
16031
  };
15956
16032
  };
15957
16033
  output: {
15958
- created_at: string;
15959
- updated_at: string;
15960
16034
  user_id: string;
15961
- id: string;
15962
- organization_id: string;
16035
+ roles: {}[];
16036
+ email?: string | undefined;
15963
16037
  }[] | {
15964
- length: number;
15965
16038
  start: number;
15966
16039
  limit: number;
15967
- userOrganizations: {
15968
- created_at: string;
15969
- updated_at: string;
16040
+ total: number;
16041
+ members: {
15970
16042
  user_id: string;
15971
- id: string;
15972
- organization_id: string;
16043
+ roles: {}[];
16044
+ email?: string | undefined;
15973
16045
  }[];
16046
+ } | {
16047
+ members: {
16048
+ user_id: string;
16049
+ roles: {}[];
16050
+ email?: string | undefined;
16051
+ }[];
16052
+ next?: string | undefined;
15974
16053
  };
15975
16054
  outputFormat: "json";
15976
16055
  status: 200;
@@ -15998,35 +16077,131 @@ export declare function init(config: AuthHeroConfig): {
15998
16077
  };
15999
16078
  };
16000
16079
  } & {
16001
- "/:id/members/:userId": {
16080
+ "/:id/members": {
16002
16081
  $delete: {
16003
16082
  input: {
16004
16083
  param: {
16005
16084
  id: string;
16006
- userId: string;
16007
16085
  };
16008
16086
  } & {
16009
16087
  header: {
16010
16088
  "tenant-id": string;
16011
16089
  };
16090
+ } & {
16091
+ json: {
16092
+ users: string[];
16093
+ };
16012
16094
  };
16013
16095
  output: {};
16014
16096
  outputFormat: string;
16015
- status: 204;
16016
- } | {
16097
+ status: 200;
16098
+ };
16099
+ };
16100
+ } & {
16101
+ "/:id/members/:user_id/roles": {
16102
+ $get: {
16103
+ input: {
16104
+ param: {
16105
+ user_id: string;
16106
+ id: string;
16107
+ };
16108
+ } & {
16109
+ query: {
16110
+ sort?: string | undefined;
16111
+ page?: string | undefined;
16112
+ per_page?: string | undefined;
16113
+ include_totals?: string | undefined;
16114
+ q?: string | undefined;
16115
+ };
16116
+ } & {
16117
+ header: {
16118
+ "tenant-id": string;
16119
+ };
16120
+ };
16121
+ output: {
16122
+ name: string;
16123
+ id: string;
16124
+ description?: string | undefined | undefined;
16125
+ created_at?: string | undefined | undefined;
16126
+ updated_at?: string | undefined | undefined;
16127
+ }[];
16128
+ outputFormat: "json";
16129
+ status: 200;
16130
+ };
16131
+ };
16132
+ } & {
16133
+ "/:id/members/:user_id/roles": {
16134
+ $post: {
16017
16135
  input: {
16018
16136
  param: {
16137
+ user_id: string;
16019
16138
  id: string;
16020
- userId: string;
16021
16139
  };
16022
16140
  } & {
16023
16141
  header: {
16024
16142
  "tenant-id": string;
16025
16143
  };
16144
+ } & {
16145
+ json: {
16146
+ roles: string[];
16147
+ };
16026
16148
  };
16027
16149
  output: {};
16028
16150
  outputFormat: string;
16029
- status: 404;
16151
+ status: 201;
16152
+ };
16153
+ };
16154
+ } & {
16155
+ "/:id/members/:user_id/roles": {
16156
+ $delete: {
16157
+ input: {
16158
+ param: {
16159
+ user_id: string;
16160
+ id: string;
16161
+ };
16162
+ } & {
16163
+ header: {
16164
+ "tenant-id": string;
16165
+ };
16166
+ } & {
16167
+ json: {
16168
+ roles: string[];
16169
+ };
16170
+ };
16171
+ output: {};
16172
+ outputFormat: string;
16173
+ status: 200;
16174
+ };
16175
+ };
16176
+ } & {
16177
+ "/:id/roles": {
16178
+ $get: {
16179
+ input: {
16180
+ param: {
16181
+ id: string;
16182
+ };
16183
+ } & {
16184
+ query: {
16185
+ sort?: string | undefined;
16186
+ page?: string | undefined;
16187
+ per_page?: string | undefined;
16188
+ include_totals?: string | undefined;
16189
+ q?: string | undefined;
16190
+ };
16191
+ } & {
16192
+ header: {
16193
+ "tenant-id": string;
16194
+ };
16195
+ };
16196
+ output: {
16197
+ name: string;
16198
+ id: string;
16199
+ description?: string | undefined | undefined;
16200
+ created_at?: string | undefined | undefined;
16201
+ updated_at?: string | undefined | undefined;
16202
+ }[];
16203
+ outputFormat: "json";
16204
+ status: 200;
16030
16205
  };
16031
16206
  };
16032
16207
  }, "/organizations"> & import("hono/types").MergeSchemaPath<{
@@ -19381,6 +19556,7 @@ export declare function init(config: AuthHeroConfig): {
19381
19556
  resource_server_name: string;
19382
19557
  description?: string | null | undefined | undefined;
19383
19558
  created_at?: string | undefined | undefined;
19559
+ organization_id?: string | undefined | undefined;
19384
19560
  }[];
19385
19561
  outputFormat: "json";
19386
19562
  status: 200;
@@ -19522,19 +19698,65 @@ export declare function init(config: AuthHeroConfig): {
19522
19698
  output: {
19523
19699
  created_at: string;
19524
19700
  updated_at: string;
19525
- user_id: string;
19701
+ name: string;
19526
19702
  id: string;
19527
- organization_id: string;
19703
+ display_name?: string | undefined | undefined;
19704
+ branding?: {
19705
+ colors?: {
19706
+ primary?: string | undefined | undefined;
19707
+ page_background?: string | undefined | undefined;
19708
+ } | undefined;
19709
+ logo_url?: string | undefined | undefined;
19710
+ } | undefined;
19711
+ metadata?: {
19712
+ [x: string]: any;
19713
+ } | undefined;
19714
+ enabled_connections?: {
19715
+ connection_id: string;
19716
+ assign_membership_on_login: boolean;
19717
+ show_as_button: boolean;
19718
+ is_signup_enabled: boolean;
19719
+ }[] | undefined;
19720
+ token_quota?: {
19721
+ client_credentials?: {
19722
+ enforce: boolean;
19723
+ per_day: number;
19724
+ per_hour: number;
19725
+ } | undefined;
19726
+ } | undefined;
19528
19727
  }[] | {
19529
19728
  length: number;
19530
19729
  start: number;
19531
19730
  limit: number;
19532
- userOrganizations: {
19731
+ organizations: {
19533
19732
  created_at: string;
19534
19733
  updated_at: string;
19535
- user_id: string;
19734
+ name: string;
19536
19735
  id: string;
19537
- organization_id: string;
19736
+ display_name?: string | undefined | undefined;
19737
+ branding?: {
19738
+ colors?: {
19739
+ primary?: string | undefined | undefined;
19740
+ page_background?: string | undefined | undefined;
19741
+ } | undefined;
19742
+ logo_url?: string | undefined | undefined;
19743
+ } | undefined;
19744
+ metadata?: {
19745
+ [x: string]: any;
19746
+ } | undefined;
19747
+ enabled_connections?: {
19748
+ connection_id: string;
19749
+ assign_membership_on_login: boolean;
19750
+ show_as_button: boolean;
19751
+ is_signup_enabled: boolean;
19752
+ }[] | undefined;
19753
+ token_quota?: {
19754
+ client_credentials?: {
19755
+ enforce: boolean;
19756
+ per_day: number;
19757
+ per_hour: number;
19758
+ } | undefined;
19759
+ } | undefined;
19538
19760
  }[];
19539
19761
  };
19540
19762
  outputFormat: "json";