authhero 0.207.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>;
@@ -14863,6 +14932,37 @@ export declare const organizationSchema: z.ZodObject<{
14863
14932
  } | undefined;
14864
14933
  }>;
14865
14934
  export type Organization = z.infer<typeof organizationSchema>;
14935
+ export declare const userOrganizationInsertSchema: z.ZodObject<{
14936
+ user_id: z.ZodString;
14937
+ organization_id: z.ZodString;
14938
+ }, "strip", z.ZodTypeAny, {
14939
+ user_id: string;
14940
+ organization_id: string;
14941
+ }, {
14942
+ user_id: string;
14943
+ organization_id: string;
14944
+ }>;
14945
+ export type UserOrganizationInsert = z.infer<typeof userOrganizationInsertSchema>;
14946
+ export declare const userOrganizationSchema: z.ZodObject<{
14947
+ id: z.ZodString;
14948
+ created_at: z.ZodString;
14949
+ updated_at: z.ZodString;
14950
+ user_id: z.ZodString;
14951
+ organization_id: z.ZodString;
14952
+ }, "strip", z.ZodTypeAny, {
14953
+ created_at: string;
14954
+ updated_at: string;
14955
+ user_id: string;
14956
+ id: string;
14957
+ organization_id: string;
14958
+ }, {
14959
+ created_at: string;
14960
+ updated_at: string;
14961
+ user_id: string;
14962
+ id: string;
14963
+ organization_id: string;
14964
+ }>;
14965
+ export type UserOrganization = z.infer<typeof userOrganizationSchema>;
14866
14966
  export declare function parseUserId(user_id: string): {
14867
14967
  connection: string;
14868
14968
  id: string;
@@ -15067,9 +15167,9 @@ export interface RolePermissionsAdapter {
15067
15167
  list(tenant_id: string, role_id: string, params?: ListParams): Promise<RolePermissionWithDetailsList>;
15068
15168
  }
15069
15169
  export interface UserPermissionsAdapter {
15070
- assign(tenant_id: string, user_id: string, permissions: UserPermissionInsert[]): Promise<boolean>;
15071
- remove(tenant_id: string, user_id: string, permissions: Pick<UserPermissionInsert, "resource_server_identifier" | "permission_name">[]): Promise<boolean>;
15072
- 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>;
15073
15173
  }
15074
15174
  export interface ListRolesResponse extends Totals {
15075
15175
  roles: Role[];
@@ -15088,9 +15188,9 @@ export interface ListUserRolesResponse {
15088
15188
  length: number;
15089
15189
  }
15090
15190
  export interface UserRolesAdapter {
15091
- list(tenantId: string, userId: string, params?: ListParams): Promise<Role[]>;
15092
- assign(tenantId: string, userId: string, roles: string[]): Promise<boolean>;
15093
- 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>;
15094
15194
  }
15095
15195
  export interface ListOrganizationsResponse extends Totals {
15096
15196
  organizations: Organization[];
@@ -15102,6 +15202,29 @@ export interface OrganizationsAdapter {
15102
15202
  list(tenant_id: string, params?: ListParams): Promise<ListOrganizationsResponse>;
15103
15203
  update(tenant_id: string, id: string, params: Partial<OrganizationInsert>): Promise<boolean>;
15104
15204
  }
15205
+ export interface UserOrganizationsAdapter {
15206
+ create(tenantId: string, params: UserOrganizationInsert): Promise<UserOrganization>;
15207
+ get(tenantId: string, id: string): Promise<UserOrganization | null>;
15208
+ remove(tenantId: string, id: string): Promise<boolean>;
15209
+ /**
15210
+ * List user-organization relationships
15211
+ * @param tenantId - The tenant ID
15212
+ * @param params - List parameters including query options:
15213
+ * - q: "user_id:{userId}" to get organizations for a specific user
15214
+ * - q: "organization_id:{organizationId}" to get members of a specific organization
15215
+ */
15216
+ list(tenantId: string, params?: ListParams): Promise<{
15217
+ userOrganizations: UserOrganization[];
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>;
15226
+ update(tenantId: string, id: string, params: Partial<UserOrganizationInsert>): Promise<boolean>;
15227
+ }
15105
15228
  export interface DataAdapters {
15106
15229
  applications: ApplicationsAdapter;
15107
15230
  branding: BrandingAdapter;
@@ -15129,6 +15252,7 @@ export interface DataAdapters {
15129
15252
  users: UserDataAdapter;
15130
15253
  userRoles: UserRolesAdapter;
15131
15254
  organizations: OrganizationsAdapter;
15255
+ userOrganizations: UserOrganizationsAdapter;
15132
15256
  }
15133
15257
  declare const auth0ClientSchema: z.ZodObject<{
15134
15258
  name: z.ZodString;
@@ -15765,6 +15889,7 @@ export declare function init(config: AuthHeroConfig): {
15765
15889
  } | undefined;
15766
15890
  logo_url?: string | undefined;
15767
15891
  } | undefined;
15892
+ id?: string | undefined;
15768
15893
  display_name?: string | undefined;
15769
15894
  metadata?: Record<string, any> | undefined;
15770
15895
  enabled_connections?: {
@@ -15885,6 +16010,200 @@ export declare function init(config: AuthHeroConfig): {
15885
16010
  status: 201;
15886
16011
  };
15887
16012
  };
16013
+ } & {
16014
+ "/:id/members": {
16015
+ $get: {
16016
+ input: {
16017
+ param: {
16018
+ id: string;
16019
+ };
16020
+ } & {
16021
+ query: {
16022
+ sort?: string | undefined;
16023
+ page?: string | undefined;
16024
+ per_page?: string | undefined;
16025
+ include_totals?: string | undefined;
16026
+ q?: string | undefined;
16027
+ };
16028
+ } & {
16029
+ header: {
16030
+ "tenant-id": string;
16031
+ };
16032
+ };
16033
+ output: {
16034
+ user_id: string;
16035
+ roles: {}[];
16036
+ email?: string | undefined;
16037
+ }[] | {
16038
+ start: number;
16039
+ limit: number;
16040
+ total: number;
16041
+ members: {
16042
+ user_id: string;
16043
+ roles: {}[];
16044
+ email?: string | undefined;
16045
+ }[];
16046
+ } | {
16047
+ members: {
16048
+ user_id: string;
16049
+ roles: {}[];
16050
+ email?: string | undefined;
16051
+ }[];
16052
+ next?: string | undefined;
16053
+ };
16054
+ outputFormat: "json";
16055
+ status: 200;
16056
+ };
16057
+ };
16058
+ } & {
16059
+ "/:id/members": {
16060
+ $post: {
16061
+ input: {
16062
+ param: {
16063
+ id: string;
16064
+ };
16065
+ } & {
16066
+ header: {
16067
+ "tenant-id": string;
16068
+ };
16069
+ } & {
16070
+ json: {
16071
+ users: string[];
16072
+ };
16073
+ };
16074
+ output: {};
16075
+ outputFormat: string;
16076
+ status: 201;
16077
+ };
16078
+ };
16079
+ } & {
16080
+ "/:id/members": {
16081
+ $delete: {
16082
+ input: {
16083
+ param: {
16084
+ id: string;
16085
+ };
16086
+ } & {
16087
+ header: {
16088
+ "tenant-id": string;
16089
+ };
16090
+ } & {
16091
+ json: {
16092
+ users: string[];
16093
+ };
16094
+ };
16095
+ output: {};
16096
+ outputFormat: string;
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: {
16135
+ input: {
16136
+ param: {
16137
+ user_id: string;
16138
+ id: string;
16139
+ };
16140
+ } & {
16141
+ header: {
16142
+ "tenant-id": string;
16143
+ };
16144
+ } & {
16145
+ json: {
16146
+ roles: string[];
16147
+ };
16148
+ };
16149
+ output: {};
16150
+ outputFormat: string;
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;
16205
+ };
16206
+ };
15888
16207
  }, "/organizations"> & import("hono/types").MergeSchemaPath<{
15889
16208
  "/": {
15890
16209
  $get: {
@@ -19237,6 +19556,7 @@ export declare function init(config: AuthHeroConfig): {
19237
19556
  resource_server_name: string;
19238
19557
  description?: string | null | undefined | undefined;
19239
19558
  created_at?: string | undefined | undefined;
19559
+ organization_id?: string | undefined | undefined;
19240
19560
  }[];
19241
19561
  outputFormat: "json";
19242
19562
  status: 200;
@@ -19355,6 +19675,112 @@ export declare function init(config: AuthHeroConfig): {
19355
19675
  status: 200;
19356
19676
  };
19357
19677
  };
19678
+ } & {
19679
+ "/:user_id/organizations": {
19680
+ $get: {
19681
+ input: {
19682
+ param: {
19683
+ user_id: string;
19684
+ };
19685
+ } & {
19686
+ query: {
19687
+ sort?: string | undefined;
19688
+ page?: string | undefined;
19689
+ per_page?: string | undefined;
19690
+ include_totals?: string | undefined;
19691
+ q?: string | undefined;
19692
+ };
19693
+ } & {
19694
+ header: {
19695
+ "tenant-id": string;
19696
+ };
19697
+ };
19698
+ output: {
19699
+ created_at: string;
19700
+ updated_at: string;
19701
+ name: string;
19702
+ 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;
19727
+ }[] | {
19728
+ length: number;
19729
+ start: number;
19730
+ limit: number;
19731
+ organizations: {
19732
+ created_at: string;
19733
+ updated_at: string;
19734
+ name: string;
19735
+ 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;
19760
+ }[];
19761
+ };
19762
+ outputFormat: "json";
19763
+ status: 200;
19764
+ };
19765
+ };
19766
+ } & {
19767
+ "/:user_id/organizations/:organization_id": {
19768
+ $delete: {
19769
+ input: {
19770
+ param: {
19771
+ user_id: string;
19772
+ organization_id: string;
19773
+ };
19774
+ } & {
19775
+ header: {
19776
+ "tenant-id": string;
19777
+ };
19778
+ };
19779
+ output: {};
19780
+ outputFormat: string;
19781
+ status: 200;
19782
+ };
19783
+ };
19358
19784
  }, "/users"> & import("hono/types").MergeSchemaPath<{
19359
19785
  "/": {
19360
19786
  $get: {