authhero 0.291.2 → 0.293.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/dist/authhero.cjs +37 -36
- package/dist/authhero.d.ts +60 -2
- package/dist/authhero.mjs +2098 -2078
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/dist/authhero.d.ts
CHANGED
|
@@ -8277,7 +8277,7 @@ export declare const brandingSchema: z.ZodObject<{
|
|
|
8277
8277
|
} | undefined;
|
|
8278
8278
|
}>;
|
|
8279
8279
|
export type Branding = z.infer<typeof brandingSchema>;
|
|
8280
|
-
declare const
|
|
8280
|
+
export declare const legacyClientSchema: z.ZodObject<{
|
|
8281
8281
|
tenant: z.ZodObject<{
|
|
8282
8282
|
id: z.ZodString;
|
|
8283
8283
|
audience: z.ZodString;
|
|
@@ -9322,7 +9322,7 @@ declare const LegacyClientSchema: z.ZodObject<{
|
|
|
9322
9322
|
par_request_expiry?: number | undefined;
|
|
9323
9323
|
token_quota?: Record<string, any> | undefined;
|
|
9324
9324
|
}>;
|
|
9325
|
-
export type LegacyClient = z.infer<typeof
|
|
9325
|
+
export type LegacyClient = z.infer<typeof legacyClientSchema>;
|
|
9326
9326
|
export declare const codeTypeSchema: z.ZodEnum<[
|
|
9327
9327
|
"password_reset",
|
|
9328
9328
|
"email_verification",
|
|
@@ -19188,6 +19188,64 @@ export declare function createInMemoryCache(config?: InMemoryCacheConfig): Cache
|
|
|
19188
19188
|
*/
|
|
19189
19189
|
export declare function withMainTenantFallback(baseAdapters: DataAdapters, config: MainTenantAdapterConfig): DataAdapters;
|
|
19190
19190
|
export declare function waitUntil(ctx: Context, promise: Promise<unknown>): void;
|
|
19191
|
+
export interface SeedOptions {
|
|
19192
|
+
/**
|
|
19193
|
+
* The admin user's email address
|
|
19194
|
+
*/
|
|
19195
|
+
adminEmail: string;
|
|
19196
|
+
/**
|
|
19197
|
+
* The admin user's password (will be hashed with bcrypt)
|
|
19198
|
+
*/
|
|
19199
|
+
adminPassword: string;
|
|
19200
|
+
/**
|
|
19201
|
+
* The tenant ID to create (defaults to "default")
|
|
19202
|
+
*/
|
|
19203
|
+
tenantId?: string;
|
|
19204
|
+
/**
|
|
19205
|
+
* The tenant name (defaults to "Default Tenant")
|
|
19206
|
+
*/
|
|
19207
|
+
tenantName?: string;
|
|
19208
|
+
/**
|
|
19209
|
+
* The audience URL for the tenant
|
|
19210
|
+
*/
|
|
19211
|
+
audience?: string;
|
|
19212
|
+
/**
|
|
19213
|
+
* The default client ID (defaults to "default")
|
|
19214
|
+
*/
|
|
19215
|
+
clientId?: string;
|
|
19216
|
+
/**
|
|
19217
|
+
* Callback URLs for the default client
|
|
19218
|
+
*/
|
|
19219
|
+
callbacks?: string[];
|
|
19220
|
+
/**
|
|
19221
|
+
* Whether to log progress (defaults to true)
|
|
19222
|
+
*/
|
|
19223
|
+
debug?: boolean;
|
|
19224
|
+
}
|
|
19225
|
+
export interface SeedResult {
|
|
19226
|
+
tenantId: string;
|
|
19227
|
+
userId: string;
|
|
19228
|
+
email: string;
|
|
19229
|
+
clientId: string;
|
|
19230
|
+
}
|
|
19231
|
+
/**
|
|
19232
|
+
* Seed the AuthHero database with initial data.
|
|
19233
|
+
* Creates a default tenant, admin user, password connection, and default client.
|
|
19234
|
+
*
|
|
19235
|
+
* @example
|
|
19236
|
+
* ```ts
|
|
19237
|
+
* import { seed } from "authhero";
|
|
19238
|
+
* import createAdapters from "@authhero/kysely-adapter";
|
|
19239
|
+
*
|
|
19240
|
+
* const adapters = createAdapters(db);
|
|
19241
|
+
*
|
|
19242
|
+
* await seed(adapters, {
|
|
19243
|
+
* adminEmail: "admin@example.com",
|
|
19244
|
+
* adminPassword: "secretpassword",
|
|
19245
|
+
* });
|
|
19246
|
+
* ```
|
|
19247
|
+
*/
|
|
19248
|
+
export declare function seed(adapters: DataAdapters, options: SeedOptions): Promise<SeedResult>;
|
|
19191
19249
|
export declare function init(config: AuthHeroConfig): {
|
|
19192
19250
|
app: OpenAPIHono<{
|
|
19193
19251
|
Bindings: Bindings;
|