@sentry/junior-dashboard 0.256.0 → 0.258.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/index.d.ts CHANGED
@@ -1,61 +1,55 @@
1
- import { Hono } from 'hono';
2
- import { ConversationWorkQueue, JuniorApiVariables } from '@sentry/junior/api';
3
- import { User, PluginRouteMethod, PluginRouteApp } from '@sentry/junior-plugin-api';
4
- import { z } from 'zod';
5
-
1
+ import { Hono } from "hono";
2
+ import { ConversationWorkQueue, JuniorApiVariables } from "@sentry/junior/api";
3
+ import { PluginRouteApp, PluginRouteMethod, User } from "@sentry/junior-plugin-api";
4
+ import { z } from "zod";
6
5
  /** Sanitized sign-in session. It never carries Junior roles. */
7
6
  declare const dashboardSessionSchema: z.ZodObject<{
8
- user: z.ZodObject<{
9
- email: z.ZodString;
10
- emailVerified: z.ZodOptional<z.ZodBoolean>;
11
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
- }, z.core.$strict>;
7
+ user: z.ZodObject<{
8
+ email: z.ZodString;
9
+ emailVerified: z.ZodOptional<z.ZodBoolean>;
10
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ }, z.core.$strict>;
13
12
  }, z.core.$strict>;
14
13
  type DashboardSession = z.infer<typeof dashboardSessionSchema>;
15
-
14
+ /** Google sign-in session that core owns. */
16
15
  interface DashboardAuth {
17
- handler(request: Request): Promise<Response>;
18
- getSession(request: Request): Promise<DashboardSession | null>;
19
- signInWithGoogle(request: Request, callbackURL: string): Promise<Response>;
16
+ handler(request: Request): Promise<Response>;
17
+ getSession(request: Request): Promise<DashboardSession | null>;
18
+ signInWithGoogle(request: Request, callbackURL: string): Promise<Response>;
20
19
  }
21
-
22
20
  /** One host route that runs after dashboard user authentication. */
23
21
  type AuthenticatedRoute = {
24
- handler(request: Request, user: User): Promise<Response> | Response;
25
- method?: PluginRouteMethod | readonly PluginRouteMethod[];
26
- path: string;
22
+ handler(request: Request, user: User): Promise<Response> | Response;
23
+ method?: PluginRouteMethod | readonly PluginRouteMethod[];
24
+ path: string;
27
25
  };
28
-
29
26
  interface JuniorDashboardOptions {
30
- agentName?: string;
31
- basePath?: string;
32
- baseURL?: string;
33
- authPath?: string;
34
- authRequired?: boolean;
35
- allowedGoogleDomains?: string[];
36
- allowedEmails?: string[];
37
- sessionMaxAgeSeconds?: number;
38
- trustedOrigins?: string[];
39
- auth?: DashboardAuth;
40
- componentGallery?: boolean;
41
- mockConversations?: boolean;
27
+ agentName?: string;
28
+ basePath?: string;
29
+ baseURL?: string;
30
+ authPath?: string;
31
+ authRequired?: boolean;
32
+ auth?: DashboardAuth;
33
+ componentGallery?: boolean;
34
+ mockConversations?: boolean;
42
35
  }
43
36
  interface DashboardRuntimeOptions extends JuniorDashboardOptions {
44
- authenticatedRoutes?: readonly AuthenticatedRoute[];
45
- /** The queue `createApp()` uses, so web input reaches the same worker. */
46
- conversationWorkQueue?: ConversationWorkQueue;
47
- pluginRoutes?: DashboardPluginRoute[];
37
+ /** The app's `allowedDomains`, from core. Auth requires at least one. */
38
+ allowedDomains?: string[];
39
+ authenticatedRoutes?: readonly AuthenticatedRoute[];
40
+ /** The queue `createApp()` uses, so web input reaches the same worker. */
41
+ conversationWorkQueue?: ConversationWorkQueue;
42
+ pluginRoutes?: DashboardPluginRoute[];
48
43
  }
49
44
  interface DashboardPluginRoute {
50
- app: PluginRouteApp;
51
- pluginName: string;
45
+ app: PluginRouteApp;
46
+ pluginName: string;
52
47
  }
53
48
  type Variables = JuniorApiVariables & {
54
- authSession: DashboardSession;
49
+ authSession: DashboardSession;
55
50
  };
56
51
  /** Create the authenticated dashboard Hono app mounted by Nitro. */
57
- declare function createDashboardApp(rawOptions: DashboardRuntimeOptions): Hono<{
58
- Variables: Variables;
52
+ export declare function createDashboardApp(rawOptions: DashboardRuntimeOptions): Hono<{
53
+ Variables: Variables;
59
54
  }>;
60
-
61
- export { type JuniorDashboardOptions, createDashboardApp };
55
+ export type { JuniorDashboardOptions };