@sentry/junior-plugin-api 0.237.0 → 0.238.1
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/README.md +11 -2
- package/dist/index.d.ts +27 -4
- package/dist/index.js +21 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,9 +81,18 @@ validated search and cursor input and may return an opaque continuation cursor.
|
|
|
81
81
|
Set `navigation: "primary"` for a top-level dashboard navigation item. The
|
|
82
82
|
default `profile` placement keeps account-oriented pages in the signed-in user
|
|
83
83
|
menu. Junior always renders core System navigation after plugin pages.
|
|
84
|
+
Set `navigation: "admin"` for setup that only Junior admins may use. Core lists
|
|
85
|
+
these pages on the dashboard Admin page and serves them only to admins. Core
|
|
86
|
+
reads the admin role from the user record on every request.
|
|
84
87
|
Records may expose bounded `DELETE` actions inside their own authenticated
|
|
85
|
-
plugin API namespace.
|
|
86
|
-
|
|
88
|
+
plugin API namespace. Records may also expose `GET` actions. The dashboard opens
|
|
89
|
+
them as normal browser links, for example to start an OAuth sign-in. Core owns
|
|
90
|
+
discovery, authentication, user resolution, routing, response validation,
|
|
91
|
+
rendering, confirmation, and query state.
|
|
92
|
+
|
|
93
|
+
Authenticated plugin API routes receive `context.auth.user.isAdmin`. Core sets
|
|
94
|
+
it from the stored user on every request. Admin-only routes must check it on
|
|
95
|
+
the server, because a hidden link does not protect a route.
|
|
87
96
|
|
|
88
97
|
## Durable Work
|
|
89
98
|
|
package/dist/index.d.ts
CHANGED
|
@@ -449,6 +449,7 @@ declare const userSchema: z.ZodObject<{
|
|
|
449
449
|
providerSubjectId: z.ZodString;
|
|
450
450
|
providerTenantId: z.ZodOptional<z.ZodString>;
|
|
451
451
|
}, z.core.$strict>>;
|
|
452
|
+
isAdmin: z.ZodOptional<z.ZodLiteral<true>>;
|
|
452
453
|
}, z.core.$strict>;
|
|
453
454
|
/** Compact destination-visible context explaining what produced a reply. */
|
|
454
455
|
declare const replyAttributionSchema: z.ZodObject<{
|
|
@@ -1044,8 +1045,17 @@ type EventMatchFields = z.output<typeof eventMatchFieldsSchema>;
|
|
|
1044
1045
|
declare function stableEventMatchKey(match: EventMatch | undefined): string;
|
|
1045
1046
|
/** Return whether trusted event data matches one exact match object. */
|
|
1046
1047
|
declare function eventMatches(match: EventMatch | undefined, data: EventData | undefined): boolean;
|
|
1048
|
+
/** The identifier shape of one resource type. */
|
|
1049
|
+
declare const eventIdentifierSchema: z.ZodObject<{
|
|
1050
|
+
format: z.ZodString;
|
|
1051
|
+
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1052
|
+
}, z.core.$strict>;
|
|
1047
1053
|
declare const pluginEventTypeSchema: z.ZodObject<{
|
|
1048
1054
|
type: z.ZodString;
|
|
1055
|
+
identifier: z.ZodOptional<z.ZodObject<{
|
|
1056
|
+
format: z.ZodString;
|
|
1057
|
+
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1058
|
+
}, z.core.$strict>>;
|
|
1049
1059
|
supportedEvents: z.ZodArray<z.ZodString>;
|
|
1050
1060
|
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1051
1061
|
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -1062,6 +1072,10 @@ declare const pluginEventTypeSchema: z.ZodObject<{
|
|
|
1062
1072
|
declare const pluginEventsSchema: z.ZodObject<{
|
|
1063
1073
|
resourceTypes: z.ZodArray<z.ZodObject<{
|
|
1064
1074
|
type: z.ZodString;
|
|
1075
|
+
identifier: z.ZodOptional<z.ZodObject<{
|
|
1076
|
+
format: z.ZodString;
|
|
1077
|
+
pattern: z.ZodCustom<RegExp, RegExp>;
|
|
1078
|
+
}, z.core.$strict>>;
|
|
1065
1079
|
supportedEvents: z.ZodArray<z.ZodString>;
|
|
1066
1080
|
suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1067
1081
|
matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -1715,6 +1729,7 @@ declare const pluginApiRouteRequestContextSchema: z.ZodObject<{
|
|
|
1715
1729
|
user: z.ZodObject<{
|
|
1716
1730
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1717
1731
|
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
1732
|
+
isAdmin: z.ZodBoolean;
|
|
1718
1733
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1719
1734
|
}, z.core.$strict>;
|
|
1720
1735
|
}, z.core.$strict>;
|
|
@@ -2361,7 +2376,10 @@ declare const pluginUserPageContentSchema: z.ZodObject<{
|
|
|
2361
2376
|
confirmation: z.ZodOptional<z.ZodString>;
|
|
2362
2377
|
href: z.ZodString;
|
|
2363
2378
|
label: z.ZodString;
|
|
2364
|
-
method: z.
|
|
2379
|
+
method: z.ZodEnum<{
|
|
2380
|
+
GET: "GET";
|
|
2381
|
+
DELETE: "DELETE";
|
|
2382
|
+
}>;
|
|
2365
2383
|
tone: z.ZodOptional<z.ZodEnum<{
|
|
2366
2384
|
neutral: "neutral";
|
|
2367
2385
|
danger: "danger";
|
|
@@ -2387,6 +2405,7 @@ declare const pluginUserPageLinkSchema: z.ZodObject<{
|
|
|
2387
2405
|
navigation: z.ZodEnum<{
|
|
2388
2406
|
primary: "primary";
|
|
2389
2407
|
profile: "profile";
|
|
2408
|
+
admin: "admin";
|
|
2390
2409
|
}>;
|
|
2391
2410
|
pluginDisplayName: z.ZodString;
|
|
2392
2411
|
pluginName: z.ZodString;
|
|
@@ -2398,6 +2417,7 @@ declare const pluginUserPageLinksSchema: z.ZodArray<z.ZodObject<{
|
|
|
2398
2417
|
navigation: z.ZodEnum<{
|
|
2399
2418
|
primary: "primary";
|
|
2400
2419
|
profile: "profile";
|
|
2420
|
+
admin: "admin";
|
|
2401
2421
|
}>;
|
|
2402
2422
|
pluginDisplayName: z.ZodString;
|
|
2403
2423
|
pluginName: z.ZodString;
|
|
@@ -2427,8 +2447,11 @@ interface PluginUserPageDefinition {
|
|
|
2427
2447
|
description: string;
|
|
2428
2448
|
id: string;
|
|
2429
2449
|
label: string;
|
|
2430
|
-
/**
|
|
2431
|
-
|
|
2450
|
+
/**
|
|
2451
|
+
* Dashboard navigation surface where this page is linked. Junior lists and
|
|
2452
|
+
* serves `admin` pages only to Junior admins.
|
|
2453
|
+
*/
|
|
2454
|
+
navigation?: "primary" | "profile" | "admin";
|
|
2432
2455
|
read(ctx: PluginUserPageContext, input: PluginUserPageInput): Promise<PluginUserPageContent> | PluginUserPageContent;
|
|
2433
2456
|
}
|
|
2434
2457
|
|
|
@@ -2454,4 +2477,4 @@ interface PluginRegistration extends PluginRegistrationInput {
|
|
|
2454
2477
|
/** Define one Junior plugin registration for app and build-time wiring. */
|
|
2455
2478
|
declare function defineJuniorPlugin(plugin: PluginRegistrationInput): PluginRegistration;
|
|
2456
2479
|
|
|
2457
|
-
export { type Actor, type AfterMcpToolHookContext, type AgentInvocationSource, type ApiRouteRegistrationHookContext, type BeforeToolExecuteHookContext, type CodeChangeInput, type CodeChangePublisher, type CodeChangeState, type ConversationAnnotation, type ConversationAnnotationInput, type ConversationEventPresentation, type ConversationSidebarAnnotation, type ConversationSidebarHookContext, type ConversationSidebarResult, type DefinedConversationEvent, type Destination, type DestinationVisibility, type Dispatch, type DispatchOptions, type DispatchResult, EVENT_DATA_MAX_JSON_BYTES, EVENT_DATA_MAX_KEYS, EVENT_GUIDANCE_MAX_LENGTH, EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, EgressAuthRequired, type EgressHookContext, EgressPolicyDenied, type EgressResponseHookContext, type Event, type EventAutomationSource, type EventData, type EventInput, type EventInvocationContext, type EventMatch, type EventMatchFields, type EventPublisher, type EventSource, type FormatMarkdownHookContext, type HeartbeatHookContext, type HeartbeatResult, type Identity, type InvocationContext, type IssueCredentialHookContext, type LocalActor, type LocalDestination, type LocalInvocationContext, type LocalSource, type Location, type ObjectAnnotation, type ObjectFacts, type ObjectIconName, type ObjectTone, type ObjectType, type OperationalReportHookContext, type OwnedObjectAnnotation, type Platform, type PluginAnnotations, type PluginApiRouteRequestContext, type PluginAuthorization, type PluginCliActionCommand, type PluginCliActionContext, type PluginCliActionHandler, type PluginCliCommandDefinition, type PluginCliDefinition, type PluginCliHost, type PluginCliIo, type PluginContext, type PluginConversationAnnotations, type PluginConversationEventCostDay, type PluginConversationEventDefinition, type PluginConversationEventReader, type PluginConversationEventRecord, type PluginConversationEventStats, type PluginConversationEventValue, type PluginConversationEvents, type PluginCredentialActor, type PluginCredentialHeaderTransform, type PluginCredentialLease, type PluginCredentialResult, type PluginCredentialSubject, type PluginCredentials, type PluginDecision, type PluginDispatchSource, type PluginEgress, type PluginEgressRequest, type PluginEgressResponse, type PluginEmbedder, type PluginEnv, type PluginEnvVarDeclaration, type PluginEventToolContext, type PluginEventType, type PluginEvents, type PluginGrant, type PluginGrantAccess, type PluginHooks, type PluginLogger, type PluginManifest, type PluginMcp, type PluginMcpAuthConfig, type PluginMcpAuthorizationPending, type PluginMcpConfig, type PluginMcpContent, type PluginMcpOAuthClientConfig, type PluginMcpToolError, type PluginMcpToolResult, type PluginMcpToolSuccess, type PluginMetadata, type PluginModel, type PluginModelConfig, type PluginNpmRuntimeDependency, type PluginOAuthBearerCredentials, type PluginOAuthConfig, type PluginOperationalBarChartWidget, type PluginOperationalChartCategory, type PluginOperationalChartSeries, type PluginOperationalField, type PluginOperationalMetric, type PluginOperationalRecord, type PluginOperationalRecordSet, type PluginOperationalReport, type PluginOperationalReportContent, type PluginOperationalTone, type PluginProviderAccount, type PluginReadState, type PluginRegistration, type PluginRegistrationInput, type PluginResolvedCredentialUser, type PluginRoute, type PluginRouteApp, type PluginRouteHandler, type PluginRouteMethod, type PluginRunContext, type PluginRunTranscriptEntry, type PluginRunTranscriptProvenance, type PluginRuntimeDependency, type PluginRuntimePostinstallCommand, type PluginSandbox, type PluginState, type PluginStoredTokens, type PluginSystemRuntimeDependency, type PluginSystemRuntimeDependencyFromUrl, type PluginTaskContext, type PluginTaskDefinition, type PluginTasks, type PluginTokenStore, type PluginToolContent, type PluginToolDefinition, type PluginToolExecute, type PluginToolExecuteOptions, PluginToolInputError, type PluginToolOutput, type PluginToolOutputEnvelope, type PluginUserPageContent, type PluginUserPageContext, type PluginUserPageDefinition, type PluginUserPageInput, type PluginUserPageLink, type PluginUserTokenSlot, type PluginWorkspaceToolContext, type ProfileReportHookContext, type PromptContext, type PromptContextContribution, type PromptMessage, REQUIRED_TOOL_ANNOTATION_KEYS, type ReplyAttribution, type RequiredToolAnnotationKey, type ResolveOAuthAccountHookContext, type RouteRegistrationHookContext, type SandboxPrepareHookContext, type ScheduledAutomationSource, type SlackActor, type SlackConversationLink, type SlackConversationLinkHookContext, type SlackDestination, type SlackInvocationContext, type SlackLocation, type SlackSource, type SlackToolRegistrationHookContext, type Source, type SourceVisibility, type SubscribableResource, type SystemActor, type SystemPromptContext, type TaskOutcome, type ToolAnnotations, type ToolApprovalMetadata, type ToolApprovalMode, type ToolExposure, type ToolRegistrationHookContext, type UnfinishedWorkHookContext, type UnfinishedWorkResult, type User, type UserPromptContext, type UserPromptContribution, type WatchResult, type WebActor, type WebInvocationContext, type WebSource, type WorkspaceFinalize, type WorkspacePrepareHookContext, actorSchema, actorUserIdSchema, agentInvocationSourceSchema, codeChangeInputSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventIconSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, conversationSidebarIconSchema, createEventSource, createLocalSource, createSlackSource, createWebSource, defineConversationEvent, defineJuniorPlugin, definePluginTool, definePromptContext, destinationSchema, destinationVisibilitySchema, dispatchOptionsSchema, enforceEgressPolicy, eventAutomationSourceSchema, eventDataSchema, eventInputSchema, eventMatchFieldSchema, eventMatchFieldsSchema, eventMatchSchema, eventMatches, eventSchema, eventSourceSchema, eventTypeSchema, getSourceKey, identitySchema, isPrivateSource, isSlackDestination, localActorSchema, localDestinationSchema, localSourceSchema, locationSchema, missingToolAnnotationKeys, nonBlankStringSchema, normalizeEventIdentifier, objectAnnotationSchema, objectFactFields, objectFactsSchema, objectIconPath, objectIconPaths, objectPresentation, objectTypeSchema, ownedObjectAnnotationSchema, platformSchema, pluginApiRouteRequestContextSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialLeaseSchema, pluginCredentialResultSchema, pluginCredentialSubjectSchema, pluginDispatchSourceSchema, pluginEventTypeSchema, pluginEventsSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginRunContextSchema, pluginRunTranscriptEntrySchema, pluginRunTranscriptProvenanceSchema, pluginStoredTokensSchema, pluginToolContentSchema, pluginToolContinuationSchema, pluginToolOutputSchema, pluginUserPageContentSchema, pluginUserPageCursorSchema, pluginUserPageFilterSchema, pluginUserPageInputSchema, pluginUserPageLinkSchema, pluginUserPageLinksSchema, pluginUserPageQuerySchema, promptContextSchema, promptMessageSchema, replyAttributionSchema, resourceLinkAnnotationSchema, resourceTypeSchema, scheduledAutomationSourceSchema, slackActorSchema, slackDestinationSchema, slackLocationSchema, slackSourceSchema, sourceSchema, sourceVisibilitySchema, stableEventMatchKey, subscribableResourceSchema, systemActorSchema, taskOutcomeSchema, toolApprovalModeSchema, userSchema, watchResultSchema, webActorSchema, webSourceSchema, zodTool };
|
|
2480
|
+
export { type Actor, type AfterMcpToolHookContext, type AgentInvocationSource, type ApiRouteRegistrationHookContext, type BeforeToolExecuteHookContext, type CodeChangeInput, type CodeChangePublisher, type CodeChangeState, type ConversationAnnotation, type ConversationAnnotationInput, type ConversationEventPresentation, type ConversationSidebarAnnotation, type ConversationSidebarHookContext, type ConversationSidebarResult, type DefinedConversationEvent, type Destination, type DestinationVisibility, type Dispatch, type DispatchOptions, type DispatchResult, EVENT_DATA_MAX_JSON_BYTES, EVENT_DATA_MAX_KEYS, EVENT_GUIDANCE_MAX_LENGTH, EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, EgressAuthRequired, type EgressHookContext, EgressPolicyDenied, type EgressResponseHookContext, type Event, type EventAutomationSource, type EventData, type EventInput, type EventInvocationContext, type EventMatch, type EventMatchFields, type EventPublisher, type EventSource, type FormatMarkdownHookContext, type HeartbeatHookContext, type HeartbeatResult, type Identity, type InvocationContext, type IssueCredentialHookContext, type LocalActor, type LocalDestination, type LocalInvocationContext, type LocalSource, type Location, type ObjectAnnotation, type ObjectFacts, type ObjectIconName, type ObjectTone, type ObjectType, type OperationalReportHookContext, type OwnedObjectAnnotation, type Platform, type PluginAnnotations, type PluginApiRouteRequestContext, type PluginAuthorization, type PluginCliActionCommand, type PluginCliActionContext, type PluginCliActionHandler, type PluginCliCommandDefinition, type PluginCliDefinition, type PluginCliHost, type PluginCliIo, type PluginContext, type PluginConversationAnnotations, type PluginConversationEventCostDay, type PluginConversationEventDefinition, type PluginConversationEventReader, type PluginConversationEventRecord, type PluginConversationEventStats, type PluginConversationEventValue, type PluginConversationEvents, type PluginCredentialActor, type PluginCredentialHeaderTransform, type PluginCredentialLease, type PluginCredentialResult, type PluginCredentialSubject, type PluginCredentials, type PluginDecision, type PluginDispatchSource, type PluginEgress, type PluginEgressRequest, type PluginEgressResponse, type PluginEmbedder, type PluginEnv, type PluginEnvVarDeclaration, type PluginEventToolContext, type PluginEventType, type PluginEvents, type PluginGrant, type PluginGrantAccess, type PluginHooks, type PluginLogger, type PluginManifest, type PluginMcp, type PluginMcpAuthConfig, type PluginMcpAuthorizationPending, type PluginMcpConfig, type PluginMcpContent, type PluginMcpOAuthClientConfig, type PluginMcpToolError, type PluginMcpToolResult, type PluginMcpToolSuccess, type PluginMetadata, type PluginModel, type PluginModelConfig, type PluginNpmRuntimeDependency, type PluginOAuthBearerCredentials, type PluginOAuthConfig, type PluginOperationalBarChartWidget, type PluginOperationalChartCategory, type PluginOperationalChartSeries, type PluginOperationalField, type PluginOperationalMetric, type PluginOperationalRecord, type PluginOperationalRecordSet, type PluginOperationalReport, type PluginOperationalReportContent, type PluginOperationalTone, type PluginProviderAccount, type PluginReadState, type PluginRegistration, type PluginRegistrationInput, type PluginResolvedCredentialUser, type PluginRoute, type PluginRouteApp, type PluginRouteHandler, type PluginRouteMethod, type PluginRunContext, type PluginRunTranscriptEntry, type PluginRunTranscriptProvenance, type PluginRuntimeDependency, type PluginRuntimePostinstallCommand, type PluginSandbox, type PluginState, type PluginStoredTokens, type PluginSystemRuntimeDependency, type PluginSystemRuntimeDependencyFromUrl, type PluginTaskContext, type PluginTaskDefinition, type PluginTasks, type PluginTokenStore, type PluginToolContent, type PluginToolDefinition, type PluginToolExecute, type PluginToolExecuteOptions, PluginToolInputError, type PluginToolOutput, type PluginToolOutputEnvelope, type PluginUserPageContent, type PluginUserPageContext, type PluginUserPageDefinition, type PluginUserPageInput, type PluginUserPageLink, type PluginUserTokenSlot, type PluginWorkspaceToolContext, type ProfileReportHookContext, type PromptContext, type PromptContextContribution, type PromptMessage, REQUIRED_TOOL_ANNOTATION_KEYS, type ReplyAttribution, type RequiredToolAnnotationKey, type ResolveOAuthAccountHookContext, type RouteRegistrationHookContext, type SandboxPrepareHookContext, type ScheduledAutomationSource, type SlackActor, type SlackConversationLink, type SlackConversationLinkHookContext, type SlackDestination, type SlackInvocationContext, type SlackLocation, type SlackSource, type SlackToolRegistrationHookContext, type Source, type SourceVisibility, type SubscribableResource, type SystemActor, type SystemPromptContext, type TaskOutcome, type ToolAnnotations, type ToolApprovalMetadata, type ToolApprovalMode, type ToolExposure, type ToolRegistrationHookContext, type UnfinishedWorkHookContext, type UnfinishedWorkResult, type User, type UserPromptContext, type UserPromptContribution, type WatchResult, type WebActor, type WebInvocationContext, type WebSource, type WorkspaceFinalize, type WorkspacePrepareHookContext, actorSchema, actorUserIdSchema, agentInvocationSourceSchema, codeChangeInputSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventIconSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, conversationSidebarIconSchema, createEventSource, createLocalSource, createSlackSource, createWebSource, defineConversationEvent, defineJuniorPlugin, definePluginTool, definePromptContext, destinationSchema, destinationVisibilitySchema, dispatchOptionsSchema, enforceEgressPolicy, eventAutomationSourceSchema, eventDataSchema, eventIdentifierSchema, eventInputSchema, eventMatchFieldSchema, eventMatchFieldsSchema, eventMatchSchema, eventMatches, eventSchema, eventSourceSchema, eventTypeSchema, getSourceKey, identitySchema, isPrivateSource, isSlackDestination, localActorSchema, localDestinationSchema, localSourceSchema, locationSchema, missingToolAnnotationKeys, nonBlankStringSchema, normalizeEventIdentifier, objectAnnotationSchema, objectFactFields, objectFactsSchema, objectIconPath, objectIconPaths, objectPresentation, objectTypeSchema, ownedObjectAnnotationSchema, platformSchema, pluginApiRouteRequestContextSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialLeaseSchema, pluginCredentialResultSchema, pluginCredentialSubjectSchema, pluginDispatchSourceSchema, pluginEventTypeSchema, pluginEventsSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginRunContextSchema, pluginRunTranscriptEntrySchema, pluginRunTranscriptProvenanceSchema, pluginStoredTokensSchema, pluginToolContentSchema, pluginToolContinuationSchema, pluginToolOutputSchema, pluginUserPageContentSchema, pluginUserPageCursorSchema, pluginUserPageFilterSchema, pluginUserPageInputSchema, pluginUserPageLinkSchema, pluginUserPageLinksSchema, pluginUserPageQuerySchema, promptContextSchema, promptMessageSchema, replyAttributionSchema, resourceLinkAnnotationSchema, resourceTypeSchema, scheduledAutomationSourceSchema, slackActorSchema, slackDestinationSchema, slackLocationSchema, slackSourceSchema, sourceSchema, sourceVisibilitySchema, stableEventMatchKey, subscribableResourceSchema, systemActorSchema, taskOutcomeSchema, toolApprovalModeSchema, userSchema, watchResultSchema, webActorSchema, webSourceSchema, zodTool };
|
package/dist/index.js
CHANGED
|
@@ -470,7 +470,9 @@ var userSchema = z7.object({
|
|
|
470
470
|
displayName: nonBlankStringSchema.optional(),
|
|
471
471
|
email: nonBlankStringSchema.max(320),
|
|
472
472
|
id: exactNonBlankStringSchema,
|
|
473
|
-
identities: z7.array(identitySchema).max(100)
|
|
473
|
+
identities: z7.array(identitySchema).max(100),
|
|
474
|
+
/** True only for Junior admins. Missing means not an admin. */
|
|
475
|
+
isAdmin: z7.literal(true).optional()
|
|
474
476
|
}).strict();
|
|
475
477
|
var dispatchMetadataSchema = z7.record(z7.string(), z7.string()).superRefine((metadata, ctx) => {
|
|
476
478
|
const entries = Object.entries(metadata);
|
|
@@ -728,8 +730,15 @@ function eventMatches(match, data) {
|
|
|
728
730
|
}
|
|
729
731
|
return true;
|
|
730
732
|
}
|
|
733
|
+
var eventIdentifierSchema = z9.object({
|
|
734
|
+
/** Shown to the agent, such as "owner/repo#number". */
|
|
735
|
+
format: z9.string().trim().min(1).max(200),
|
|
736
|
+
/** Matches a normalized identifier of this resource type. */
|
|
737
|
+
pattern: z9.instanceof(RegExp)
|
|
738
|
+
}).strict();
|
|
731
739
|
var pluginEventTypeSchema = z9.object({
|
|
732
740
|
type: resourceTypeSchema,
|
|
741
|
+
identifier: eventIdentifierSchema.optional(),
|
|
733
742
|
supportedEvents: z9.array(eventTypeSchema).min(1),
|
|
734
743
|
suggestedEvents: z9.array(eventTypeSchema).optional(),
|
|
735
744
|
matchFields: eventMatchFieldsSchema.optional(),
|
|
@@ -998,6 +1007,8 @@ var pluginApiRouteRequestContextSchema = z12.object({
|
|
|
998
1007
|
user: z12.object({
|
|
999
1008
|
email: z12.string().nullable().optional(),
|
|
1000
1009
|
emailVerified: z12.boolean().optional(),
|
|
1010
|
+
/** Junior-wide admin role, read from the user record on each request. */
|
|
1011
|
+
isAdmin: z12.boolean(),
|
|
1001
1012
|
name: z12.string().nullable().optional()
|
|
1002
1013
|
}).strict()
|
|
1003
1014
|
}).strict(),
|
|
@@ -1179,9 +1190,9 @@ function defineJuniorPlugin(plugin) {
|
|
|
1179
1190
|
`Junior plugin "${name}" user page "${page.id}" requires label and description.`
|
|
1180
1191
|
);
|
|
1181
1192
|
}
|
|
1182
|
-
if (page.navigation !== void 0 && page.navigation !== "primary" && page.navigation !== "profile") {
|
|
1193
|
+
if (page.navigation !== void 0 && page.navigation !== "primary" && page.navigation !== "profile" && page.navigation !== "admin") {
|
|
1183
1194
|
throw new Error(
|
|
1184
|
-
`Junior plugin "${name}" user page "${page.id}" navigation must be "primary" or "
|
|
1195
|
+
`Junior plugin "${name}" user page "${page.id}" navigation must be "primary", "profile", or "admin".`
|
|
1185
1196
|
);
|
|
1186
1197
|
}
|
|
1187
1198
|
if (typeof page.read !== "function") {
|
|
@@ -1201,7 +1212,7 @@ import { z as z14 } from "zod";
|
|
|
1201
1212
|
var userPageIdSchema = nonBlankStringSchema.max(64).regex(/^[a-z][a-z0-9-]*$/);
|
|
1202
1213
|
var userPageLabelSchema = nonBlankStringSchema.max(80);
|
|
1203
1214
|
var userPageDescriptionSchema = nonBlankStringSchema.max(500);
|
|
1204
|
-
var userPageNavigationSchema = z14.enum(["primary", "profile"]);
|
|
1215
|
+
var userPageNavigationSchema = z14.enum(["primary", "profile", "admin"]);
|
|
1205
1216
|
var pluginUserPageMetricSchema = z14.object({
|
|
1206
1217
|
detail: nonBlankStringSchema.max(500).optional(),
|
|
1207
1218
|
label: nonBlankStringSchema.max(80),
|
|
@@ -1216,7 +1227,11 @@ var pluginUserPageActionSchema = z14.object({
|
|
|
1216
1227
|
confirmation: nonBlankStringSchema.max(500).optional(),
|
|
1217
1228
|
href: nonBlankStringSchema.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),
|
|
1218
1229
|
label: nonBlankStringSchema.max(80),
|
|
1219
|
-
|
|
1230
|
+
/**
|
|
1231
|
+
* `DELETE` sends a request and refreshes the page. `GET` opens the plugin
|
|
1232
|
+
* route in the browser, for flows such as an OAuth redirect.
|
|
1233
|
+
*/
|
|
1234
|
+
method: z14.enum(["DELETE", "GET"]),
|
|
1220
1235
|
tone: z14.enum(["danger", "neutral"]).optional()
|
|
1221
1236
|
}).strict();
|
|
1222
1237
|
var pluginUserPageRecordSchema = z14.object({
|
|
@@ -1286,6 +1301,7 @@ export {
|
|
|
1286
1301
|
enforceEgressPolicy,
|
|
1287
1302
|
eventAutomationSourceSchema,
|
|
1288
1303
|
eventDataSchema,
|
|
1304
|
+
eventIdentifierSchema,
|
|
1289
1305
|
eventInputSchema,
|
|
1290
1306
|
eventMatchFieldSchema,
|
|
1291
1307
|
eventMatchFieldsSchema,
|