@authhero/adapter-interfaces 4.2.1 → 4.4.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.
- package/LICENSE +1 -1
- package/dist/adapter-interfaces.cjs +1 -1
- package/dist/adapter-interfaces.d.ts +184 -6
- package/dist/adapter-interfaces.mjs +358 -311
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/adapters/ScimConfigurations.d.ts +7 -0
- package/dist/types/adapters/ScimExternalIds.d.ts +7 -0
- package/dist/types/adapters/ScimTokens.d.ts +9 -0
- package/dist/types/adapters/UserRoles.d.ts +13 -0
- package/dist/types/adapters/index.d.ts +16 -0
- package/dist/types/types/AuditEvent.d.ts +3 -0
- package/dist/types/types/Connection.d.ts +4 -4
- package/dist/types/types/Forms.d.ts +16 -0
- package/dist/types/types/PromptSetting.d.ts +1 -0
- package/dist/types/types/ScimConfiguration.d.ts +30 -0
- package/dist/types/types/ScimExternalId.d.ts +21 -0
- package/dist/types/types/ScimToken.d.ts +19 -0
- package/dist/types/types/User.d.ts +3 -0
- package/dist/types/types/auth0/UserResponse.d.ts +1 -0
- package/dist/types/types/codeHookApiShapes.d.ts +37 -0
- package/dist/types/types/index.d.ts +4 -0
- package/package.json +2 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ScimConfiguration, ScimConfigurationInsert } from "../types/ScimConfiguration";
|
|
2
|
+
export interface ScimConfigurationsAdapter {
|
|
3
|
+
create: (tenant_id: string, configuration: ScimConfigurationInsert) => Promise<ScimConfiguration>;
|
|
4
|
+
get: (tenant_id: string, connection_id: string) => Promise<ScimConfiguration | null>;
|
|
5
|
+
update: (tenant_id: string, connection_id: string, configuration: Partial<ScimConfigurationInsert>) => Promise<boolean>;
|
|
6
|
+
remove: (tenant_id: string, connection_id: string) => Promise<boolean>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ScimExternalId, ScimExternalIdInsert } from "../types/ScimExternalId";
|
|
2
|
+
export interface ScimExternalIdsAdapter {
|
|
3
|
+
create: (tenant_id: string, externalId: ScimExternalIdInsert) => Promise<ScimExternalId>;
|
|
4
|
+
getByExternalId: (tenant_id: string, connection_id: string, external_id: string) => Promise<ScimExternalId | null>;
|
|
5
|
+
getByUserId: (tenant_id: string, connection_id: string, user_id: string) => Promise<ScimExternalId | null>;
|
|
6
|
+
remove: (tenant_id: string, connection_id: string, user_id: string) => Promise<boolean>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScimToken, ScimTokenInsert } from "../types/ScimToken";
|
|
2
|
+
export interface ScimTokensAdapter {
|
|
3
|
+
create: (tenant_id: string, token: ScimTokenInsert) => Promise<ScimToken>;
|
|
4
|
+
get: (tenant_id: string, token_id: string) => Promise<ScimToken | null>;
|
|
5
|
+
getByHash: (tenant_id: string, token_hash: string) => Promise<ScimToken | null>;
|
|
6
|
+
listByConnection: (tenant_id: string, connection_id: string) => Promise<ScimToken[]>;
|
|
7
|
+
markUsed: (tenant_id: string, token_id: string, last_used_at: string) => Promise<boolean>;
|
|
8
|
+
remove: (tenant_id: string, token_id: string) => Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -21,6 +21,19 @@ export interface ListRoleUsersResponse {
|
|
|
21
21
|
next?: string;
|
|
22
22
|
}
|
|
23
23
|
export interface UserRolesAdapter {
|
|
24
|
+
/**
|
|
25
|
+
* List the roles assigned to a user, returned as a flat array.
|
|
26
|
+
*
|
|
27
|
+
* `organizationId` selects the scope and adapters MUST honor it exactly:
|
|
28
|
+
* - `undefined` — roles across every organization scope (no filter)
|
|
29
|
+
* - `""` — global / tenant-level roles only
|
|
30
|
+
* - `"<id>"` — that organization's roles only
|
|
31
|
+
*
|
|
32
|
+
* The empty-string case is load-bearing: callers pass `""` to read a user's
|
|
33
|
+
* global roles (e.g. the org-membership `admin:organizations` bypass), so an
|
|
34
|
+
* adapter that treats `""` as "all scopes" leaks org-scoped roles into global
|
|
35
|
+
* lookups (see #1198).
|
|
36
|
+
*/
|
|
24
37
|
list(tenantId: string, userId: string, params?: ListParams, organizationId?: string): Promise<Role[]>;
|
|
25
38
|
/**
|
|
26
39
|
* List the distinct users assigned to a role, across all organization
|
|
@@ -25,6 +25,9 @@ import { ThemesAdapter } from "./Themes";
|
|
|
25
25
|
import { LoginSessionsAdapter } from "./LoginSessions";
|
|
26
26
|
import { PromptSettingsAdapter } from "./PromptSettings";
|
|
27
27
|
import { ProxyRoutesAdapter } from "./ProxyRoutes";
|
|
28
|
+
import { ScimConfigurationsAdapter } from "./ScimConfigurations";
|
|
29
|
+
import { ScimTokensAdapter } from "./ScimTokens";
|
|
30
|
+
import { ScimExternalIdsAdapter } from "./ScimExternalIds";
|
|
28
31
|
import { EmailProvidersAdapter } from "./EmailProviders";
|
|
29
32
|
import { EmailTemplatesAdapter } from "./EmailTemplates";
|
|
30
33
|
import { RefreshTokensAdapter } from "./RefreshTokens";
|
|
@@ -102,6 +105,16 @@ export interface DataAdapters {
|
|
|
102
105
|
* directly from the database or by calling this management API.
|
|
103
106
|
*/
|
|
104
107
|
proxyRoutes?: ProxyRoutesAdapter;
|
|
108
|
+
/**
|
|
109
|
+
* Optional SCIM 2.0 inbound-provisioning adapters (issue #1191). When all
|
|
110
|
+
* three are set, AuthHero exposes the SCIM configuration management API and
|
|
111
|
+
* (Phase 2) the `/scim/v2` provisioning endpoints. `scimConfigurations`
|
|
112
|
+
* holds one config per connection, `scimTokens` the hashed bearer tokens,
|
|
113
|
+
* and `scimExternalIds` the IdP `externalId` → `user_id` lookup table.
|
|
114
|
+
*/
|
|
115
|
+
scimConfigurations?: ScimConfigurationsAdapter;
|
|
116
|
+
scimTokens?: ScimTokensAdapter;
|
|
117
|
+
scimExternalIds?: ScimExternalIdsAdapter;
|
|
105
118
|
refreshTokens: RefreshTokensAdapter;
|
|
106
119
|
resourceServers: ResourceServersAdapter;
|
|
107
120
|
rolePermissions: RolePermissionsAdapter;
|
|
@@ -260,6 +273,9 @@ export * from "./Logs";
|
|
|
260
273
|
export * from "./Passwords";
|
|
261
274
|
export * from "./PromptSettings";
|
|
262
275
|
export * from "./ProxyRoutes";
|
|
276
|
+
export * from "./ScimConfigurations";
|
|
277
|
+
export * from "./ScimTokens";
|
|
278
|
+
export * from "./ScimExternalIds";
|
|
263
279
|
export * from "./ResourceServers";
|
|
264
280
|
export * from "./Roles";
|
|
265
281
|
export * from "./Sessions";
|
|
@@ -41,6 +41,7 @@ export declare const requestContextSchema: z.ZodObject<{
|
|
|
41
41
|
ip: z.ZodString;
|
|
42
42
|
user_agent: z.ZodOptional<z.ZodString>;
|
|
43
43
|
correlation_id: z.ZodOptional<z.ZodString>;
|
|
44
|
+
redirect_uri: z.ZodOptional<z.ZodString>;
|
|
44
45
|
}, z.core.$strip>;
|
|
45
46
|
export type RequestContext = z.infer<typeof requestContextSchema>;
|
|
46
47
|
export declare const responseContextSchema: z.ZodObject<{
|
|
@@ -105,6 +106,7 @@ export declare const auditEventInsertSchema: z.ZodObject<{
|
|
|
105
106
|
ip: z.ZodString;
|
|
106
107
|
user_agent: z.ZodOptional<z.ZodString>;
|
|
107
108
|
correlation_id: z.ZodOptional<z.ZodString>;
|
|
109
|
+
redirect_uri: z.ZodOptional<z.ZodString>;
|
|
108
110
|
}, z.core.$strip>;
|
|
109
111
|
response: z.ZodOptional<z.ZodObject<{
|
|
110
112
|
status_code: z.ZodNumber;
|
|
@@ -179,6 +181,7 @@ export declare const auditEventSchema: z.ZodObject<{
|
|
|
179
181
|
ip: z.ZodString;
|
|
180
182
|
user_agent: z.ZodOptional<z.ZodString>;
|
|
181
183
|
correlation_id: z.ZodOptional<z.ZodString>;
|
|
184
|
+
redirect_uri: z.ZodOptional<z.ZodString>;
|
|
182
185
|
}, z.core.$strip>;
|
|
183
186
|
response: z.ZodOptional<z.ZodObject<{
|
|
184
187
|
status_code: z.ZodNumber;
|
|
@@ -298,8 +298,8 @@ export declare const connectionInsertSchema: z.ZodObject<{
|
|
|
298
298
|
}>>;
|
|
299
299
|
}, z.core.$strip>>>;
|
|
300
300
|
enabled_clients: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
301
|
-
response_type: z.ZodOptional<z.
|
|
302
|
-
response_mode: z.ZodOptional<z.
|
|
301
|
+
response_type: z.ZodOptional<z.ZodEnum<typeof AuthorizationResponseType>>;
|
|
302
|
+
response_mode: z.ZodOptional<z.ZodEnum<typeof AuthorizationResponseMode>>;
|
|
303
303
|
is_domain_connection: z.ZodOptional<z.ZodBoolean>;
|
|
304
304
|
show_as_button: z.ZodOptional<z.ZodBoolean>;
|
|
305
305
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -460,8 +460,8 @@ export declare const connectionSchema: z.ZodObject<{
|
|
|
460
460
|
}>>;
|
|
461
461
|
}, z.core.$strip>>>;
|
|
462
462
|
enabled_clients: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
463
|
-
response_type: z.ZodOptional<z.
|
|
464
|
-
response_mode: z.ZodOptional<z.
|
|
463
|
+
response_type: z.ZodOptional<z.ZodEnum<typeof AuthorizationResponseType>>;
|
|
464
|
+
response_mode: z.ZodOptional<z.ZodEnum<typeof AuthorizationResponseMode>>;
|
|
465
465
|
is_domain_connection: z.ZodOptional<z.ZodBoolean>;
|
|
466
466
|
show_as_button: z.ZodOptional<z.ZodBoolean>;
|
|
467
467
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -516,6 +516,8 @@ declare const socialField: z.ZodObject<{
|
|
|
516
516
|
display_name: z.ZodOptional<z.ZodString>;
|
|
517
517
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
518
518
|
href: z.ZodOptional<z.ZodString>;
|
|
519
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
520
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
519
521
|
}, z.core.$strip>>>;
|
|
520
522
|
}, z.core.$strip>>;
|
|
521
523
|
}, z.core.$strip>;
|
|
@@ -1151,6 +1153,8 @@ export declare const fieldComponentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
1151
1153
|
display_name: z.ZodOptional<z.ZodString>;
|
|
1152
1154
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
1153
1155
|
href: z.ZodOptional<z.ZodString>;
|
|
1156
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
1157
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
1154
1158
|
}, z.core.$strip>>>;
|
|
1155
1159
|
}, z.core.$strip>>;
|
|
1156
1160
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1750,6 +1754,8 @@ export declare const formNodeComponentDefinition: z.ZodUnion<readonly [z.ZodDisc
|
|
|
1750
1754
|
display_name: z.ZodOptional<z.ZodString>;
|
|
1751
1755
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
1752
1756
|
href: z.ZodOptional<z.ZodString>;
|
|
1757
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
1758
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
1753
1759
|
}, z.core.$strip>>>;
|
|
1754
1760
|
}, z.core.$strip>>;
|
|
1755
1761
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -2440,6 +2446,8 @@ declare const stepNodeSchema: z.ZodObject<{
|
|
|
2440
2446
|
display_name: z.ZodOptional<z.ZodString>;
|
|
2441
2447
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
2442
2448
|
href: z.ZodOptional<z.ZodString>;
|
|
2449
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
2450
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
2443
2451
|
}, z.core.$strip>>>;
|
|
2444
2452
|
}, z.core.$strip>>;
|
|
2445
2453
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -3077,6 +3085,8 @@ export declare const formNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3077
3085
|
display_name: z.ZodOptional<z.ZodString>;
|
|
3078
3086
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
3079
3087
|
href: z.ZodOptional<z.ZodString>;
|
|
3088
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
3089
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
3080
3090
|
}, z.core.$strip>>>;
|
|
3081
3091
|
}, z.core.$strip>>;
|
|
3082
3092
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -3732,6 +3742,8 @@ export declare const formInsertSchema: z.ZodObject<{
|
|
|
3732
3742
|
display_name: z.ZodOptional<z.ZodString>;
|
|
3733
3743
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
3734
3744
|
href: z.ZodOptional<z.ZodString>;
|
|
3745
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
3746
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
3735
3747
|
}, z.core.$strip>>>;
|
|
3736
3748
|
}, z.core.$strip>>;
|
|
3737
3749
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -4419,6 +4431,8 @@ export declare const formSchema: z.ZodObject<{
|
|
|
4419
4431
|
display_name: z.ZodOptional<z.ZodString>;
|
|
4420
4432
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
4421
4433
|
href: z.ZodOptional<z.ZodString>;
|
|
4434
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
4435
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
4422
4436
|
}, z.core.$strip>>>;
|
|
4423
4437
|
}, z.core.$strip>>;
|
|
4424
4438
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -5097,6 +5111,8 @@ export declare const uiScreenSchema: z.ZodObject<{
|
|
|
5097
5111
|
display_name: z.ZodOptional<z.ZodString>;
|
|
5098
5112
|
icon_url: z.ZodOptional<z.ZodString>;
|
|
5099
5113
|
href: z.ZodOptional<z.ZodString>;
|
|
5114
|
+
last_used: z.ZodOptional<z.ZodBoolean>;
|
|
5115
|
+
last_used_label: z.ZodOptional<z.ZodString>;
|
|
5100
5116
|
}, z.core.$strip>>>;
|
|
5101
5117
|
}, z.core.$strip>>;
|
|
5102
5118
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -6,6 +6,7 @@ export declare const promptSettingSchema: z.ZodObject<{
|
|
|
6
6
|
}>>;
|
|
7
7
|
identifier_first: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
password_first: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
show_last_used_connection: z.ZodDefault<z.ZodBoolean>;
|
|
9
10
|
webauthn_platform_first_factor: z.ZodBoolean;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
export type PromptSetting = z.infer<typeof promptSettingSchema>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
/**
|
|
3
|
+
* One attribute-mapping entry translating a SCIM resource attribute to an
|
|
4
|
+
* AuthHero user field. Mirrors Auth0's SCIM `mapping` shape (`{ scim, auth0 }`).
|
|
5
|
+
*/
|
|
6
|
+
export declare const scimMappingEntrySchema: z.ZodObject<{
|
|
7
|
+
scim: z.ZodString;
|
|
8
|
+
auth0: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type ScimMappingEntry = z.infer<typeof scimMappingEntrySchema>;
|
|
11
|
+
export declare const scimConfigurationInsertSchema: z.ZodObject<{
|
|
12
|
+
connection_id: z.ZodString;
|
|
13
|
+
user_id_attribute: z.ZodDefault<z.ZodString>;
|
|
14
|
+
mapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
15
|
+
scim: z.ZodString;
|
|
16
|
+
auth0: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type ScimConfigurationInsert = z.infer<typeof scimConfigurationInsertSchema>;
|
|
20
|
+
export declare const scimConfigurationSchema: z.ZodObject<{
|
|
21
|
+
created_at: z.ZodString;
|
|
22
|
+
updated_at: z.ZodString;
|
|
23
|
+
connection_id: z.ZodString;
|
|
24
|
+
user_id_attribute: z.ZodDefault<z.ZodString>;
|
|
25
|
+
mapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
26
|
+
scim: z.ZodString;
|
|
27
|
+
auth0: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type ScimConfiguration = z.infer<typeof scimConfigurationSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
/**
|
|
3
|
+
* Maps an IdP-assigned SCIM `externalId` to an AuthHero `user_id`, scoped to a
|
|
4
|
+
* connection. Kept out of the shared user schema so the (per-connection) SCIM
|
|
5
|
+
* concern stays isolated and a linked user can carry external ids from more
|
|
6
|
+
* than one SCIM connection. IdPs look users up by `externalId eq "…"` before
|
|
7
|
+
* creating, so this must be queryable by (connection_id, external_id).
|
|
8
|
+
*/
|
|
9
|
+
export declare const scimExternalIdInsertSchema: z.ZodObject<{
|
|
10
|
+
connection_id: z.ZodString;
|
|
11
|
+
external_id: z.ZodString;
|
|
12
|
+
user_id: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type ScimExternalIdInsert = z.infer<typeof scimExternalIdInsertSchema>;
|
|
15
|
+
export declare const scimExternalIdSchema: z.ZodObject<{
|
|
16
|
+
created_at: z.ZodString;
|
|
17
|
+
connection_id: z.ZodString;
|
|
18
|
+
external_id: z.ZodString;
|
|
19
|
+
user_id: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type ScimExternalId = z.infer<typeof scimExternalIdSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const scimTokenInsertSchema: z.ZodObject<{
|
|
3
|
+
token_id: z.ZodString;
|
|
4
|
+
connection_id: z.ZodString;
|
|
5
|
+
token_hash: z.ZodString;
|
|
6
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
7
|
+
valid_until: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type ScimTokenInsert = z.infer<typeof scimTokenInsertSchema>;
|
|
10
|
+
export declare const scimTokenSchema: z.ZodObject<{
|
|
11
|
+
created_at: z.ZodString;
|
|
12
|
+
last_used_at: z.ZodOptional<z.ZodString>;
|
|
13
|
+
token_id: z.ZodString;
|
|
14
|
+
connection_id: z.ZodString;
|
|
15
|
+
token_hash: z.ZodString;
|
|
16
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
17
|
+
valid_until: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type ScimToken = z.infer<typeof scimTokenSchema>;
|
|
@@ -79,6 +79,7 @@ export declare const userInsertSchema: z.ZodObject<{
|
|
|
79
79
|
provider: z.ZodOptional<z.ZodString>;
|
|
80
80
|
connection: z.ZodString;
|
|
81
81
|
is_social: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
blocked: z.ZodOptional<z.ZodBoolean>;
|
|
82
83
|
registration_completed_at: z.ZodOptional<z.ZodString>;
|
|
83
84
|
password: z.ZodOptional<z.ZodObject<{
|
|
84
85
|
hash: z.ZodString;
|
|
@@ -120,6 +121,7 @@ export declare const userSchema: z.ZodObject<{
|
|
|
120
121
|
verify_email: z.ZodOptional<z.ZodBoolean>;
|
|
121
122
|
last_ip: z.ZodOptional<z.ZodString>;
|
|
122
123
|
last_login: z.ZodOptional<z.ZodString>;
|
|
124
|
+
blocked: z.ZodOptional<z.ZodBoolean>;
|
|
123
125
|
registration_completed_at: z.ZodOptional<z.ZodString>;
|
|
124
126
|
created_at: z.ZodString;
|
|
125
127
|
updated_at: z.ZodString;
|
|
@@ -194,6 +196,7 @@ export declare const auth0UserResponseSchema: z.ZodObject<{
|
|
|
194
196
|
last_ip: z.ZodOptional<z.ZodString>;
|
|
195
197
|
last_login: z.ZodOptional<z.ZodString>;
|
|
196
198
|
is_social: z.ZodBoolean;
|
|
199
|
+
blocked: z.ZodOptional<z.ZodBoolean>;
|
|
197
200
|
login_count: z.ZodDefault<z.ZodNumber>;
|
|
198
201
|
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
199
202
|
connection: z.ZodString;
|
|
@@ -6,6 +6,7 @@ export interface PostUsersBody extends BaseUser {
|
|
|
6
6
|
username?: string;
|
|
7
7
|
connection?: string;
|
|
8
8
|
email_verified?: boolean;
|
|
9
|
+
blocked?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const userResponseSchema: z.ZodObject<{
|
|
11
12
|
email: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-trigger allowlist of namespaced API methods exposed to user-authored
|
|
3
|
+
* code hooks. Each entry maps a trigger id to `{ namespace: [method, ...] }`.
|
|
4
|
+
*
|
|
5
|
+
* Code hooks run in an isolate with a **recording** `api` proxy: user code calls
|
|
6
|
+
* `api.<namespace>.<method>(...)`, the call is captured as
|
|
7
|
+
* `{ method: "<namespace>.<method>", args }`, and the host replays it against
|
|
8
|
+
* the real API objects after the isolate returns. This shape is what the proxy
|
|
9
|
+
* is built from, so it is the single source of truth for *which* verbs a trigger
|
|
10
|
+
* exposes.
|
|
11
|
+
*
|
|
12
|
+
* It lives here (not in an executor) because both executors need an identical
|
|
13
|
+
* copy: the local `LocalCodeExecutor` builds the proxy in-process, and the
|
|
14
|
+
* Cloudflare `WorkerLoaderCodeExecutor` serializes this object into the
|
|
15
|
+
* generated worker script. Duplicating it risked the two drifting; importing
|
|
16
|
+
* this const keeps them byte-identical by construction.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TRIGGER_API_SHAPES: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
|
|
19
|
+
/**
|
|
20
|
+
* A single candidate primary the built-in email-based linking policy would
|
|
21
|
+
* consider, pre-resolved into a `post-user-login` code-hook event as
|
|
22
|
+
* `event.link_candidates`. Code hooks have no return channel and no data
|
|
23
|
+
* adapter, so link targets must be pushed *into* the event rather than looked
|
|
24
|
+
* up from user code. The shape is intentionally minimal and JSON-serializable.
|
|
25
|
+
*/
|
|
26
|
+
export interface LinkCandidate {
|
|
27
|
+
user_id: string;
|
|
28
|
+
email: string;
|
|
29
|
+
email_verified: boolean;
|
|
30
|
+
provider: string;
|
|
31
|
+
connection: string;
|
|
32
|
+
created_at: string;
|
|
33
|
+
/** No `linked_to` set — this user is itself a primary. */
|
|
34
|
+
is_primary: boolean;
|
|
35
|
+
/** The candidate the built-in "oldest account wins" policy would pick. */
|
|
36
|
+
is_oldest: boolean;
|
|
37
|
+
}
|
|
@@ -37,6 +37,9 @@ export * from "./User";
|
|
|
37
37
|
export * from "./Theme";
|
|
38
38
|
export * from "./PromptSetting";
|
|
39
39
|
export * from "./ProxyRoute";
|
|
40
|
+
export * from "./ScimConfiguration";
|
|
41
|
+
export * from "./ScimToken";
|
|
42
|
+
export * from "./ScimExternalId";
|
|
40
43
|
export * from "./EmailProvider";
|
|
41
44
|
export * from "./EmailTemplate";
|
|
42
45
|
export * from "./RefreshTokens";
|
|
@@ -58,3 +61,4 @@ export * from "./CustomText";
|
|
|
58
61
|
export * from "./Strategy";
|
|
59
62
|
export * from "./AuthenticationMethod";
|
|
60
63
|
export * from "./ImportMetadata";
|
|
64
|
+
export * from "./codeHookApiShapes";
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/markusahlstrand/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "4.
|
|
14
|
+
"version": "4.4.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"nanoid": "^5.1.11"
|
|
46
46
|
},
|
|
47
|
+
"license": "MIT",
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "vite build && tsc -p tsconfig.types.json && rollup -c rollup.dts.config.mjs"
|
|
49
50
|
}
|