authhero 0.207.0 → 0.208.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.
@@ -14863,6 +14863,37 @@ export declare const organizationSchema: z.ZodObject<{
14863
14863
  } | undefined;
14864
14864
  }>;
14865
14865
  export type Organization = z.infer<typeof organizationSchema>;
14866
+ export declare const userOrganizationInsertSchema: z.ZodObject<{
14867
+ user_id: z.ZodString;
14868
+ organization_id: z.ZodString;
14869
+ }, "strip", z.ZodTypeAny, {
14870
+ user_id: string;
14871
+ organization_id: string;
14872
+ }, {
14873
+ user_id: string;
14874
+ organization_id: string;
14875
+ }>;
14876
+ export type UserOrganizationInsert = z.infer<typeof userOrganizationInsertSchema>;
14877
+ export declare const userOrganizationSchema: z.ZodObject<{
14878
+ id: z.ZodString;
14879
+ created_at: z.ZodString;
14880
+ updated_at: z.ZodString;
14881
+ user_id: z.ZodString;
14882
+ organization_id: z.ZodString;
14883
+ }, "strip", z.ZodTypeAny, {
14884
+ created_at: string;
14885
+ updated_at: string;
14886
+ user_id: string;
14887
+ id: string;
14888
+ organization_id: string;
14889
+ }, {
14890
+ created_at: string;
14891
+ updated_at: string;
14892
+ user_id: string;
14893
+ id: string;
14894
+ organization_id: string;
14895
+ }>;
14896
+ export type UserOrganization = z.infer<typeof userOrganizationSchema>;
14866
14897
  export declare function parseUserId(user_id: string): {
14867
14898
  connection: string;
14868
14899
  id: string;
@@ -15102,6 +15133,22 @@ export interface OrganizationsAdapter {
15102
15133
  list(tenant_id: string, params?: ListParams): Promise<ListOrganizationsResponse>;
15103
15134
  update(tenant_id: string, id: string, params: Partial<OrganizationInsert>): Promise<boolean>;
15104
15135
  }
15136
+ export interface UserOrganizationsAdapter {
15137
+ create(tenantId: string, params: UserOrganizationInsert): Promise<UserOrganization>;
15138
+ get(tenantId: string, id: string): Promise<UserOrganization | null>;
15139
+ remove(tenantId: string, id: string): Promise<boolean>;
15140
+ /**
15141
+ * List user-organization relationships
15142
+ * @param tenantId - The tenant ID
15143
+ * @param params - List parameters including query options:
15144
+ * - q: "user_id:{userId}" to get organizations for a specific user
15145
+ * - q: "organization_id:{organizationId}" to get members of a specific organization
15146
+ */
15147
+ list(tenantId: string, params?: ListParams): Promise<{
15148
+ userOrganizations: UserOrganization[];
15149
+ } & Totals>;
15150
+ update(tenantId: string, id: string, params: Partial<UserOrganizationInsert>): Promise<boolean>;
15151
+ }
15105
15152
  export interface DataAdapters {
15106
15153
  applications: ApplicationsAdapter;
15107
15154
  branding: BrandingAdapter;
@@ -15129,6 +15176,7 @@ export interface DataAdapters {
15129
15176
  users: UserDataAdapter;
15130
15177
  userRoles: UserRolesAdapter;
15131
15178
  organizations: OrganizationsAdapter;
15179
+ userOrganizations: UserOrganizationsAdapter;
15132
15180
  }
15133
15181
  declare const auth0ClientSchema: z.ZodObject<{
15134
15182
  name: z.ZodString;
@@ -15765,6 +15813,7 @@ export declare function init(config: AuthHeroConfig): {
15765
15813
  } | undefined;
15766
15814
  logo_url?: string | undefined;
15767
15815
  } | undefined;
15816
+ id?: string | undefined;
15768
15817
  display_name?: string | undefined;
15769
15818
  metadata?: Record<string, any> | undefined;
15770
15819
  enabled_connections?: {
@@ -15885,6 +15934,101 @@ export declare function init(config: AuthHeroConfig): {
15885
15934
  status: 201;
15886
15935
  };
15887
15936
  };
15937
+ } & {
15938
+ "/:id/members": {
15939
+ $get: {
15940
+ input: {
15941
+ param: {
15942
+ id: string;
15943
+ };
15944
+ } & {
15945
+ query: {
15946
+ sort?: string | undefined;
15947
+ page?: string | undefined;
15948
+ per_page?: string | undefined;
15949
+ include_totals?: string | undefined;
15950
+ q?: string | undefined;
15951
+ };
15952
+ } & {
15953
+ header: {
15954
+ "tenant-id": string;
15955
+ };
15956
+ };
15957
+ output: {
15958
+ created_at: string;
15959
+ updated_at: string;
15960
+ user_id: string;
15961
+ id: string;
15962
+ organization_id: string;
15963
+ }[] | {
15964
+ length: number;
15965
+ start: number;
15966
+ limit: number;
15967
+ userOrganizations: {
15968
+ created_at: string;
15969
+ updated_at: string;
15970
+ user_id: string;
15971
+ id: string;
15972
+ organization_id: string;
15973
+ }[];
15974
+ };
15975
+ outputFormat: "json";
15976
+ status: 200;
15977
+ };
15978
+ };
15979
+ } & {
15980
+ "/:id/members": {
15981
+ $post: {
15982
+ input: {
15983
+ param: {
15984
+ id: string;
15985
+ };
15986
+ } & {
15987
+ header: {
15988
+ "tenant-id": string;
15989
+ };
15990
+ } & {
15991
+ json: {
15992
+ users: string[];
15993
+ };
15994
+ };
15995
+ output: {};
15996
+ outputFormat: string;
15997
+ status: 201;
15998
+ };
15999
+ };
16000
+ } & {
16001
+ "/:id/members/:userId": {
16002
+ $delete: {
16003
+ input: {
16004
+ param: {
16005
+ id: string;
16006
+ userId: string;
16007
+ };
16008
+ } & {
16009
+ header: {
16010
+ "tenant-id": string;
16011
+ };
16012
+ };
16013
+ output: {};
16014
+ outputFormat: string;
16015
+ status: 204;
16016
+ } | {
16017
+ input: {
16018
+ param: {
16019
+ id: string;
16020
+ userId: string;
16021
+ };
16022
+ } & {
16023
+ header: {
16024
+ "tenant-id": string;
16025
+ };
16026
+ };
16027
+ output: {};
16028
+ outputFormat: string;
16029
+ status: 404;
16030
+ };
16031
+ };
15888
16032
  }, "/organizations"> & import("hono/types").MergeSchemaPath<{
15889
16033
  "/": {
15890
16034
  $get: {
@@ -19355,6 +19499,66 @@ export declare function init(config: AuthHeroConfig): {
19355
19499
  status: 200;
19356
19500
  };
19357
19501
  };
19502
+ } & {
19503
+ "/:user_id/organizations": {
19504
+ $get: {
19505
+ input: {
19506
+ param: {
19507
+ user_id: string;
19508
+ };
19509
+ } & {
19510
+ query: {
19511
+ sort?: string | undefined;
19512
+ page?: string | undefined;
19513
+ per_page?: string | undefined;
19514
+ include_totals?: string | undefined;
19515
+ q?: string | undefined;
19516
+ };
19517
+ } & {
19518
+ header: {
19519
+ "tenant-id": string;
19520
+ };
19521
+ };
19522
+ output: {
19523
+ created_at: string;
19524
+ updated_at: string;
19525
+ user_id: string;
19526
+ id: string;
19527
+ organization_id: string;
19528
+ }[] | {
19529
+ length: number;
19530
+ start: number;
19531
+ limit: number;
19532
+ userOrganizations: {
19533
+ created_at: string;
19534
+ updated_at: string;
19535
+ user_id: string;
19536
+ id: string;
19537
+ organization_id: string;
19538
+ }[];
19539
+ };
19540
+ outputFormat: "json";
19541
+ status: 200;
19542
+ };
19543
+ };
19544
+ } & {
19545
+ "/:user_id/organizations/:organization_id": {
19546
+ $delete: {
19547
+ input: {
19548
+ param: {
19549
+ user_id: string;
19550
+ organization_id: string;
19551
+ };
19552
+ } & {
19553
+ header: {
19554
+ "tenant-id": string;
19555
+ };
19556
+ };
19557
+ output: {};
19558
+ outputFormat: string;
19559
+ status: 200;
19560
+ };
19561
+ };
19358
19562
  }, "/users"> & import("hono/types").MergeSchemaPath<{
19359
19563
  "/": {
19360
19564
  $get: {