@sentry/junior-plugin-api 0.238.1 → 0.240.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/README.md +2 -1
- package/dist/index.d.ts +39 -3
- package/dist/index.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,8 @@ reports, and other typed hook surfaces exported by this package.
|
|
|
66
66
|
one subject user on a person profile. Core owns viewer authorization,
|
|
67
67
|
collection, sanitization, and browser rendering.
|
|
68
68
|
- Tool hooks may resolve the active Actor's Identity and User through
|
|
69
|
-
`ctx.users.resolveActor()
|
|
69
|
+
`ctx.users.resolveActor()`, and the Actor's timezone through
|
|
70
|
+
`ctx.users.resolveTimezone()`.
|
|
70
71
|
- Authenticated API route hooks receive `ctx.users.resolve(email)` for lazy
|
|
71
72
|
User lookup. Routes that do not need User data do not query identity storage.
|
|
72
73
|
- User page readers receive the signed-in `User`. Plugins return limited data.
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ declare const objectAnnotationSchema: z.ZodObject<{
|
|
|
20
20
|
code_change: "code_change";
|
|
21
21
|
task: "task";
|
|
22
22
|
deployment: "deployment";
|
|
23
|
+
calendar_event: "calendar_event";
|
|
23
24
|
automation: "automation";
|
|
24
25
|
item: "item";
|
|
25
26
|
}>;
|
|
@@ -65,6 +66,10 @@ declare const objectAnnotationSchema: z.ZodObject<{
|
|
|
65
66
|
environment: z.ZodOptional<z.ZodString>;
|
|
66
67
|
revision: z.ZodOptional<z.ZodString>;
|
|
67
68
|
branch: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
71
|
+
when: z.ZodOptional<z.ZodString>;
|
|
72
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
73
|
}, z.core.$strict>], "type">>;
|
|
69
74
|
}, z.core.$strict>;
|
|
70
75
|
type ObjectAnnotation = z.output<typeof objectAnnotationSchema>;
|
|
@@ -77,6 +82,7 @@ declare const ownedObjectAnnotationSchema: z.ZodObject<{
|
|
|
77
82
|
code_change: "code_change";
|
|
78
83
|
task: "task";
|
|
79
84
|
deployment: "deployment";
|
|
85
|
+
calendar_event: "calendar_event";
|
|
80
86
|
automation: "automation";
|
|
81
87
|
item: "item";
|
|
82
88
|
}>;
|
|
@@ -122,6 +128,10 @@ declare const ownedObjectAnnotationSchema: z.ZodObject<{
|
|
|
122
128
|
environment: z.ZodOptional<z.ZodString>;
|
|
123
129
|
revision: z.ZodOptional<z.ZodString>;
|
|
124
130
|
branch: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
133
|
+
when: z.ZodOptional<z.ZodString>;
|
|
134
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
135
|
}, z.core.$strict>], "type">>;
|
|
126
136
|
plugin: z.ZodString;
|
|
127
137
|
}, z.core.$strict>;
|
|
@@ -132,11 +142,12 @@ declare const objectTypeSchema: z.ZodEnum<{
|
|
|
132
142
|
code_change: "code_change";
|
|
133
143
|
task: "task";
|
|
134
144
|
deployment: "deployment";
|
|
145
|
+
calendar_event: "calendar_event";
|
|
135
146
|
automation: "automation";
|
|
136
147
|
item: "item";
|
|
137
148
|
}>;
|
|
138
149
|
type ObjectType = z.output<typeof objectTypeSchema>;
|
|
139
|
-
declare const objectIconNames: readonly ["issue-opened", "issue-closed", "git-pull-request", "git-pull-request-draft", "git-pull-request-closed", "git-merge", "workflow", "rocket", "package"];
|
|
150
|
+
declare const objectIconNames: readonly ["issue-opened", "issue-closed", "git-pull-request", "git-pull-request-draft", "git-pull-request-closed", "git-merge", "workflow", "rocket", "calendar", "package"];
|
|
140
151
|
type ObjectIconName = (typeof objectIconNames)[number];
|
|
141
152
|
type ObjectTone = "neutral" | "success" | "danger" | "warning" | "info" | "accent";
|
|
142
153
|
/** Resolve identity and state without replacing the type icon with a warning. */
|
|
@@ -164,6 +175,7 @@ declare const objectIconPaths: {
|
|
|
164
175
|
"git-merge": string[];
|
|
165
176
|
workflow: string[];
|
|
166
177
|
rocket: string[];
|
|
178
|
+
calendar: string[];
|
|
167
179
|
package: string[];
|
|
168
180
|
};
|
|
169
181
|
|
|
@@ -202,6 +214,10 @@ declare const objectFactsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
202
214
|
environment: z.ZodOptional<z.ZodString>;
|
|
203
215
|
revision: z.ZodOptional<z.ZodString>;
|
|
204
216
|
branch: z.ZodOptional<z.ZodString>;
|
|
217
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
218
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
219
|
+
when: z.ZodOptional<z.ZodString>;
|
|
220
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
205
221
|
}, z.core.$strict>], "type">;
|
|
206
222
|
type ObjectFacts = z.output<typeof objectFactsSchema>;
|
|
207
223
|
type ObjectField = {
|
|
@@ -654,6 +670,7 @@ declare const resourceLinkAnnotationSchema: z.ZodObject<{
|
|
|
654
670
|
code_change: "code_change";
|
|
655
671
|
task: "task";
|
|
656
672
|
deployment: "deployment";
|
|
673
|
+
calendar_event: "calendar_event";
|
|
657
674
|
automation: "automation";
|
|
658
675
|
item: "item";
|
|
659
676
|
}>>;
|
|
@@ -676,6 +693,7 @@ declare const conversationAnnotationInputSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
676
693
|
code_change: "code_change";
|
|
677
694
|
task: "task";
|
|
678
695
|
deployment: "deployment";
|
|
696
|
+
calendar_event: "calendar_event";
|
|
679
697
|
automation: "automation";
|
|
680
698
|
item: "item";
|
|
681
699
|
}>>;
|
|
@@ -698,6 +716,7 @@ declare const conversationAnnotationInputSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
698
716
|
code_change: "code_change";
|
|
699
717
|
task: "task";
|
|
700
718
|
deployment: "deployment";
|
|
719
|
+
calendar_event: "calendar_event";
|
|
701
720
|
automation: "automation";
|
|
702
721
|
item: "item";
|
|
703
722
|
}>;
|
|
@@ -743,6 +762,10 @@ declare const conversationAnnotationInputSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
743
762
|
environment: z.ZodOptional<z.ZodString>;
|
|
744
763
|
revision: z.ZodOptional<z.ZodString>;
|
|
745
764
|
branch: z.ZodOptional<z.ZodString>;
|
|
765
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
766
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
767
|
+
when: z.ZodOptional<z.ZodString>;
|
|
768
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
746
769
|
}, z.core.$strict>], "type">>;
|
|
747
770
|
}, z.core.$strict>], "kind">;
|
|
748
771
|
type ConversationAnnotationInput = z.output<typeof conversationAnnotationInputSchema>;
|
|
@@ -780,6 +803,7 @@ declare const conversationSidebarAnnotationSchema: z.ZodObject<{
|
|
|
780
803
|
code_change: "code_change";
|
|
781
804
|
task: "task";
|
|
782
805
|
deployment: "deployment";
|
|
806
|
+
calendar_event: "calendar_event";
|
|
783
807
|
automation: "automation";
|
|
784
808
|
item: "item";
|
|
785
809
|
}>>;
|
|
@@ -837,13 +861,13 @@ interface CodeChangePublisher {
|
|
|
837
861
|
|
|
838
862
|
declare const conversationEventIconSchema: z.ZodEnum<{
|
|
839
863
|
check: "check";
|
|
864
|
+
calendar: "calendar";
|
|
840
865
|
warning: "warning";
|
|
841
866
|
info: "info";
|
|
842
867
|
key: "key";
|
|
843
868
|
link: "link";
|
|
844
869
|
activity: "activity";
|
|
845
870
|
brain: "brain";
|
|
846
|
-
calendar: "calendar";
|
|
847
871
|
database: "database";
|
|
848
872
|
sparkles: "sparkles";
|
|
849
873
|
}>;
|
|
@@ -857,13 +881,13 @@ declare const conversationEventPresentationSchema: z.ZodObject<{
|
|
|
857
881
|
}, z.core.$strict>>>;
|
|
858
882
|
icon: z.ZodOptional<z.ZodEnum<{
|
|
859
883
|
check: "check";
|
|
884
|
+
calendar: "calendar";
|
|
860
885
|
warning: "warning";
|
|
861
886
|
info: "info";
|
|
862
887
|
key: "key";
|
|
863
888
|
link: "link";
|
|
864
889
|
activity: "activity";
|
|
865
890
|
brain: "brain";
|
|
866
|
-
calendar: "calendar";
|
|
867
891
|
database: "database";
|
|
868
892
|
sparkles: "sparkles";
|
|
869
893
|
}>>;
|
|
@@ -1116,6 +1140,7 @@ declare const eventInputSchema: z.ZodObject<{
|
|
|
1116
1140
|
code_change: "code_change";
|
|
1117
1141
|
task: "task";
|
|
1118
1142
|
deployment: "deployment";
|
|
1143
|
+
calendar_event: "calendar_event";
|
|
1119
1144
|
automation: "automation";
|
|
1120
1145
|
item: "item";
|
|
1121
1146
|
}>>;
|
|
@@ -1135,6 +1160,7 @@ declare const eventSchema: z.ZodObject<{
|
|
|
1135
1160
|
code_change: "code_change";
|
|
1136
1161
|
task: "task";
|
|
1137
1162
|
deployment: "deployment";
|
|
1163
|
+
calendar_event: "calendar_event";
|
|
1138
1164
|
automation: "automation";
|
|
1139
1165
|
item: "item";
|
|
1140
1166
|
}>>;
|
|
@@ -1937,6 +1963,7 @@ declare const pluginToolOutputSchema: z.ZodObject<{
|
|
|
1937
1963
|
code_change: "code_change";
|
|
1938
1964
|
task: "task";
|
|
1939
1965
|
deployment: "deployment";
|
|
1966
|
+
calendar_event: "calendar_event";
|
|
1940
1967
|
automation: "automation";
|
|
1941
1968
|
item: "item";
|
|
1942
1969
|
}>;
|
|
@@ -1982,6 +2009,10 @@ declare const pluginToolOutputSchema: z.ZodObject<{
|
|
|
1982
2009
|
environment: z.ZodOptional<z.ZodString>;
|
|
1983
2010
|
revision: z.ZodOptional<z.ZodString>;
|
|
1984
2011
|
branch: z.ZodOptional<z.ZodString>;
|
|
2012
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2013
|
+
type: z.ZodLiteral<"calendar_event">;
|
|
2014
|
+
when: z.ZodOptional<z.ZodString>;
|
|
2015
|
+
attendees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1985
2016
|
}, z.core.$strict>], "type">>;
|
|
1986
2017
|
}, z.core.$strict>>>;
|
|
1987
2018
|
target: z.ZodOptional<z.ZodString>;
|
|
@@ -2141,6 +2172,11 @@ interface BaseToolRegistrationHookContext extends PluginContext {
|
|
|
2141
2172
|
identity: Identity;
|
|
2142
2173
|
user?: User;
|
|
2143
2174
|
} | undefined>;
|
|
2175
|
+
/**
|
|
2176
|
+
* Resolve the current actor's IANA timezone. Uses their profile when
|
|
2177
|
+
* Junior knows it, else the install default. Always returns a timezone.
|
|
2178
|
+
*/
|
|
2179
|
+
resolveTimezone(): Promise<string>;
|
|
2144
2180
|
};
|
|
2145
2181
|
userText?: string;
|
|
2146
2182
|
workspaces: PluginWorkspaceToolContext;
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,12 @@ var objectFactsSchema = z.discriminatedUnion("type", [
|
|
|
37
37
|
environment: text.optional(),
|
|
38
38
|
revision: text.optional(),
|
|
39
39
|
branch: text.optional()
|
|
40
|
+
}),
|
|
41
|
+
// Calendar events: the owner formats the time for the requester's time zone.
|
|
42
|
+
z.strictObject({
|
|
43
|
+
type: z.literal("calendar_event"),
|
|
44
|
+
when: text.optional(),
|
|
45
|
+
attendees: z.array(text).max(5).optional()
|
|
40
46
|
})
|
|
41
47
|
]);
|
|
42
48
|
function objectFactFields(facts) {
|
|
@@ -69,6 +75,10 @@ function objectFactFields(facts) {
|
|
|
69
75
|
add("revision", "Revision", facts.revision);
|
|
70
76
|
add("branch", "Branch", facts.branch);
|
|
71
77
|
break;
|
|
78
|
+
case "calendar_event":
|
|
79
|
+
add("when", "When", facts.when);
|
|
80
|
+
add("attendees", "Attendees", list(facts.attendees));
|
|
81
|
+
break;
|
|
72
82
|
}
|
|
73
83
|
return fields.slice(0, 4);
|
|
74
84
|
}
|
|
@@ -80,6 +90,7 @@ var objectTypeSchema = z2.enum([
|
|
|
80
90
|
"code_change",
|
|
81
91
|
"automation",
|
|
82
92
|
"deployment",
|
|
93
|
+
"calendar_event",
|
|
83
94
|
"item"
|
|
84
95
|
]);
|
|
85
96
|
var objectTypeLabels = {
|
|
@@ -87,6 +98,7 @@ var objectTypeLabels = {
|
|
|
87
98
|
code_change: "Code change",
|
|
88
99
|
automation: "Automation",
|
|
89
100
|
deployment: "Deployment",
|
|
101
|
+
calendar_event: "Calendar event",
|
|
90
102
|
item: "Item"
|
|
91
103
|
};
|
|
92
104
|
function objectPresentation(object) {
|
|
@@ -97,6 +109,7 @@ function objectPresentation(object) {
|
|
|
97
109
|
code_change: "git-pull-request",
|
|
98
110
|
automation: "workflow",
|
|
99
111
|
deployment: "rocket",
|
|
112
|
+
calendar_event: "calendar",
|
|
100
113
|
item: "package"
|
|
101
114
|
}[type];
|
|
102
115
|
let tone = type === "automation" ? "info" : "neutral";
|
|
@@ -183,6 +196,9 @@ var objectIconPaths = {
|
|
|
183
196
|
rocket: [
|
|
184
197
|
"M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"
|
|
185
198
|
],
|
|
199
|
+
calendar: [
|
|
200
|
+
"M4.75 0a.75.75 0 0 1 .75.75V2h5V.75a.75.75 0 0 1 1.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 0 1 4.75 0ZM2.5 7.5v6.75c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25V7.5Zm10.75-4H2.75a.25.25 0 0 0-.25.25V6h11V3.75a.25.25 0 0 0-.25-.25Z"
|
|
201
|
+
],
|
|
186
202
|
package: [
|
|
187
203
|
"m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"
|
|
188
204
|
]
|