@sentry/junior-plugin-api 0.187.0 → 0.188.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/context.d.ts +3 -1
- package/dist/index.js +14 -0
- package/dist/schemas.d.ts +61 -0
- package/dist/tasks.d.ts +18 -0
- package/package.json +1 -1
- package/src/context.ts +3 -0
- package/src/schemas.ts +19 -0
package/dist/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ZodTypeAny } from "zod";
|
|
3
|
-
import { destinationSchema, identitySchema, webActorSchema, localActorSchema, platformSchema, actorSchema, slackActorSchema, systemActorSchema, sourceSchema, userSchema } from "./schemas";
|
|
3
|
+
import { destinationSchema, identitySchema, locationSchema, webActorSchema, localActorSchema, platformSchema, actorSchema, slackActorSchema, systemActorSchema, sourceSchema, userSchema } from "./schemas";
|
|
4
4
|
/** Runtime platform name without source or destination coordinates. */
|
|
5
5
|
export type Platform = z.output<typeof platformSchema>;
|
|
6
6
|
export type Actor = z.output<typeof actorSchema>;
|
|
@@ -11,6 +11,8 @@ export type SystemActor = z.output<typeof systemActorSchema>;
|
|
|
11
11
|
export type Identity = z.output<typeof identitySchema>;
|
|
12
12
|
export type User = z.output<typeof userSchema>;
|
|
13
13
|
export type Source = z.output<typeof sourceSchema>;
|
|
14
|
+
/** Validated Location associated with a Conversation. */
|
|
15
|
+
export type Location = z.output<typeof locationSchema>;
|
|
14
16
|
export type SlackSource = Extract<Source, {
|
|
15
17
|
platform: "slack";
|
|
16
18
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -119,6 +119,16 @@ var nonBlankStringSchema = z4.string().refine((value) => value.trim().length > 0
|
|
|
119
119
|
var exactNonBlankStringSchema = nonBlankStringSchema.refine(
|
|
120
120
|
(value) => value === value.trim()
|
|
121
121
|
);
|
|
122
|
+
var locationSchema = z4.object({
|
|
123
|
+
/** Junior-owned stable identity for this location. */
|
|
124
|
+
id: nonBlankStringSchema,
|
|
125
|
+
/** Provider namespace that owns the provider and tenant identifiers. */
|
|
126
|
+
provider: nonBlankStringSchema,
|
|
127
|
+
/** Optional provider-native workspace, account, or tenant scope. */
|
|
128
|
+
tenantId: nonBlankStringSchema.optional(),
|
|
129
|
+
/** Provider-native identifier for the container within its tenant scope. */
|
|
130
|
+
providerId: nonBlankStringSchema
|
|
131
|
+
}).strict();
|
|
122
132
|
var platformSchema = z4.enum(["slack", "local"]);
|
|
123
133
|
var sourceVisibilitySchema = z4.enum(["public", "private"]);
|
|
124
134
|
var destinationVisibilitySchema = z4.enum(["public", "private"]);
|
|
@@ -137,16 +147,19 @@ var destinationSchema = z4.discriminatedUnion("platform", [
|
|
|
137
147
|
localDestinationSchema
|
|
138
148
|
]);
|
|
139
149
|
var slackSourceSchema = slackAddressSchema.extend({
|
|
150
|
+
location: locationSchema.optional(),
|
|
140
151
|
visibility: sourceVisibilitySchema,
|
|
141
152
|
messageTs: nonBlankStringSchema.optional(),
|
|
142
153
|
threadTs: nonBlankStringSchema.optional()
|
|
143
154
|
}).strict();
|
|
144
155
|
var localSourceSchema = z4.object({
|
|
156
|
+
location: locationSchema.optional(),
|
|
145
157
|
platform: z4.literal("local"),
|
|
146
158
|
visibility: z4.literal("private"),
|
|
147
159
|
conversationId: localConversationIdSchema
|
|
148
160
|
}).strict();
|
|
149
161
|
var webSourceSchema = z4.object({
|
|
162
|
+
location: locationSchema.optional(),
|
|
150
163
|
platform: z4.literal("web"),
|
|
151
164
|
visibility: sourceVisibilitySchema,
|
|
152
165
|
// Web can continue any existing conversation id, including Slack roots.
|
|
@@ -1015,6 +1028,7 @@ export {
|
|
|
1015
1028
|
localActorSchema,
|
|
1016
1029
|
localDestinationSchema,
|
|
1017
1030
|
localSourceSchema,
|
|
1031
|
+
locationSchema,
|
|
1018
1032
|
missingToolAnnotationKeys,
|
|
1019
1033
|
nonBlankStringSchema,
|
|
1020
1034
|
normalizeResourceEventIdentifier,
|
package/dist/schemas.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
/** Exact non-blank actor user id that rejects the sentinel "unknown". */
|
|
3
3
|
export declare const actorUserIdSchema: z.ZodString;
|
|
4
4
|
export declare const nonBlankStringSchema: z.ZodString;
|
|
5
|
+
/** One place outside Junior where a Conversation can be delivered. */
|
|
6
|
+
export declare const locationSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
provider: z.ZodString;
|
|
9
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
providerId: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
5
12
|
/** Runtime platform names supported by plugin public contracts. */
|
|
6
13
|
export declare const platformSchema: z.ZodEnum<{
|
|
7
14
|
slack: "slack";
|
|
@@ -42,6 +49,12 @@ export declare const slackSourceSchema: z.ZodObject<{
|
|
|
42
49
|
platform: z.ZodLiteral<"slack">;
|
|
43
50
|
teamId: z.ZodString;
|
|
44
51
|
channelId: z.ZodString;
|
|
52
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
provider: z.ZodString;
|
|
55
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
providerId: z.ZodString;
|
|
57
|
+
}, z.core.$strict>>;
|
|
45
58
|
visibility: z.ZodEnum<{
|
|
46
59
|
public: "public";
|
|
47
60
|
private: "private";
|
|
@@ -51,12 +64,24 @@ export declare const slackSourceSchema: z.ZodObject<{
|
|
|
51
64
|
}, z.core.$strict>;
|
|
52
65
|
/** Runtime-owned local CLI coordinates for the inbound invocation. */
|
|
53
66
|
export declare const localSourceSchema: z.ZodObject<{
|
|
67
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
provider: z.ZodString;
|
|
70
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
providerId: z.ZodString;
|
|
72
|
+
}, z.core.$strict>>;
|
|
54
73
|
platform: z.ZodLiteral<"local">;
|
|
55
74
|
visibility: z.ZodLiteral<"private">;
|
|
56
75
|
conversationId: z.ZodString;
|
|
57
76
|
}, z.core.$strict>;
|
|
58
77
|
/** Runtime-owned dashboard/web coordinates for the inbound invocation. */
|
|
59
78
|
export declare const webSourceSchema: z.ZodObject<{
|
|
79
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
provider: z.ZodString;
|
|
82
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
83
|
+
providerId: z.ZodString;
|
|
84
|
+
}, z.core.$strict>>;
|
|
60
85
|
platform: z.ZodLiteral<"web">;
|
|
61
86
|
visibility: z.ZodEnum<{
|
|
62
87
|
public: "public";
|
|
@@ -69,6 +94,12 @@ export declare const sourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
69
94
|
platform: z.ZodLiteral<"slack">;
|
|
70
95
|
teamId: z.ZodString;
|
|
71
96
|
channelId: z.ZodString;
|
|
97
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
provider: z.ZodString;
|
|
100
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
providerId: z.ZodString;
|
|
102
|
+
}, z.core.$strict>>;
|
|
72
103
|
visibility: z.ZodEnum<{
|
|
73
104
|
public: "public";
|
|
74
105
|
private: "private";
|
|
@@ -76,10 +107,22 @@ export declare const sourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
76
107
|
messageTs: z.ZodOptional<z.ZodString>;
|
|
77
108
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
78
109
|
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
provider: z.ZodString;
|
|
113
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
114
|
+
providerId: z.ZodString;
|
|
115
|
+
}, z.core.$strict>>;
|
|
79
116
|
platform: z.ZodLiteral<"local">;
|
|
80
117
|
visibility: z.ZodLiteral<"private">;
|
|
81
118
|
conversationId: z.ZodString;
|
|
82
119
|
}, z.core.$strict>, z.ZodObject<{
|
|
120
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
provider: z.ZodString;
|
|
123
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
124
|
+
providerId: z.ZodString;
|
|
125
|
+
}, z.core.$strict>>;
|
|
83
126
|
platform: z.ZodLiteral<"web">;
|
|
84
127
|
visibility: z.ZodEnum<{
|
|
85
128
|
public: "public";
|
|
@@ -208,6 +251,12 @@ export declare const dispatchOptionsSchema: z.ZodObject<{
|
|
|
208
251
|
platform: z.ZodLiteral<"slack">;
|
|
209
252
|
teamId: z.ZodString;
|
|
210
253
|
channelId: z.ZodString;
|
|
254
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
id: z.ZodString;
|
|
256
|
+
provider: z.ZodString;
|
|
257
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
258
|
+
providerId: z.ZodString;
|
|
259
|
+
}, z.core.$strict>>;
|
|
211
260
|
visibility: z.ZodEnum<{
|
|
212
261
|
public: "public";
|
|
213
262
|
private: "private";
|
|
@@ -215,10 +264,22 @@ export declare const dispatchOptionsSchema: z.ZodObject<{
|
|
|
215
264
|
messageTs: z.ZodOptional<z.ZodString>;
|
|
216
265
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
217
266
|
}, z.core.$strict>, z.ZodObject<{
|
|
267
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
id: z.ZodString;
|
|
269
|
+
provider: z.ZodString;
|
|
270
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
271
|
+
providerId: z.ZodString;
|
|
272
|
+
}, z.core.$strict>>;
|
|
218
273
|
platform: z.ZodLiteral<"local">;
|
|
219
274
|
visibility: z.ZodLiteral<"private">;
|
|
220
275
|
conversationId: z.ZodString;
|
|
221
276
|
}, z.core.$strict>, z.ZodObject<{
|
|
277
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
id: z.ZodString;
|
|
279
|
+
provider: z.ZodString;
|
|
280
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
281
|
+
providerId: z.ZodString;
|
|
282
|
+
}, z.core.$strict>>;
|
|
222
283
|
platform: z.ZodLiteral<"web">;
|
|
223
284
|
visibility: z.ZodEnum<{
|
|
224
285
|
public: "public";
|
package/dist/tasks.d.ts
CHANGED
|
@@ -152,6 +152,12 @@ export declare const pluginRunContextSchema: z.ZodObject<{
|
|
|
152
152
|
platform: z.ZodLiteral<"slack">;
|
|
153
153
|
teamId: z.ZodString;
|
|
154
154
|
channelId: z.ZodString;
|
|
155
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
provider: z.ZodString;
|
|
158
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
159
|
+
providerId: z.ZodString;
|
|
160
|
+
}, z.core.$strict>>;
|
|
155
161
|
visibility: z.ZodEnum<{
|
|
156
162
|
public: "public";
|
|
157
163
|
private: "private";
|
|
@@ -159,10 +165,22 @@ export declare const pluginRunContextSchema: z.ZodObject<{
|
|
|
159
165
|
messageTs: z.ZodOptional<z.ZodString>;
|
|
160
166
|
threadTs: z.ZodOptional<z.ZodString>;
|
|
161
167
|
}, z.core.$strict>, z.ZodObject<{
|
|
168
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
provider: z.ZodString;
|
|
171
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
172
|
+
providerId: z.ZodString;
|
|
173
|
+
}, z.core.$strict>>;
|
|
162
174
|
platform: z.ZodLiteral<"local">;
|
|
163
175
|
visibility: z.ZodLiteral<"private">;
|
|
164
176
|
conversationId: z.ZodString;
|
|
165
177
|
}, z.core.$strict>, z.ZodObject<{
|
|
178
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
provider: z.ZodString;
|
|
181
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
182
|
+
providerId: z.ZodString;
|
|
183
|
+
}, z.core.$strict>>;
|
|
166
184
|
platform: z.ZodLiteral<"web">;
|
|
167
185
|
visibility: z.ZodEnum<{
|
|
168
186
|
public: "public";
|
package/package.json
CHANGED
package/src/context.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ZodTypeAny } from "zod";
|
|
|
3
3
|
import {
|
|
4
4
|
destinationSchema,
|
|
5
5
|
identitySchema,
|
|
6
|
+
locationSchema,
|
|
6
7
|
webActorSchema,
|
|
7
8
|
localActorSchema,
|
|
8
9
|
platformSchema,
|
|
@@ -23,6 +24,8 @@ export type SystemActor = z.output<typeof systemActorSchema>;
|
|
|
23
24
|
export type Identity = z.output<typeof identitySchema>;
|
|
24
25
|
export type User = z.output<typeof userSchema>;
|
|
25
26
|
export type Source = z.output<typeof sourceSchema>;
|
|
27
|
+
/** Validated Location associated with a Conversation. */
|
|
28
|
+
export type Location = z.output<typeof locationSchema>;
|
|
26
29
|
export type SlackSource = Extract<Source, { platform: "slack" }>;
|
|
27
30
|
export type LocalSource = Extract<Source, { platform: "local" }>;
|
|
28
31
|
export type WebSource = Extract<Source, { platform: "web" }>;
|
package/src/schemas.ts
CHANGED
|
@@ -21,6 +21,22 @@ const exactNonBlankStringSchema = nonBlankStringSchema.refine(
|
|
|
21
21
|
(value) => value === value.trim(),
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
+
/** One place outside Junior where a Conversation can be delivered. */
|
|
25
|
+
// TODO(dcramer): Add the fields Location needs to identify the exact provider
|
|
26
|
+
// Conversation. For Slack, this includes threadTs.
|
|
27
|
+
export const locationSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
/** Junior-owned stable identity for this location. */
|
|
30
|
+
id: nonBlankStringSchema,
|
|
31
|
+
/** Provider namespace that owns the provider and tenant identifiers. */
|
|
32
|
+
provider: nonBlankStringSchema,
|
|
33
|
+
/** Optional provider-native workspace, account, or tenant scope. */
|
|
34
|
+
tenantId: nonBlankStringSchema.optional(),
|
|
35
|
+
/** Provider-native identifier for the container within its tenant scope. */
|
|
36
|
+
providerId: nonBlankStringSchema,
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
|
39
|
+
|
|
24
40
|
/** Runtime platform names supported by plugin public contracts. */
|
|
25
41
|
export const platformSchema = z.enum(["slack", "local"]);
|
|
26
42
|
|
|
@@ -58,6 +74,7 @@ export const destinationSchema = z.discriminatedUnion("platform", [
|
|
|
58
74
|
/** Runtime-owned Slack coordinates for the inbound invocation. */
|
|
59
75
|
export const slackSourceSchema = slackAddressSchema
|
|
60
76
|
.extend({
|
|
77
|
+
location: locationSchema.optional(),
|
|
61
78
|
visibility: sourceVisibilitySchema,
|
|
62
79
|
messageTs: nonBlankStringSchema.optional(),
|
|
63
80
|
threadTs: nonBlankStringSchema.optional(),
|
|
@@ -67,6 +84,7 @@ export const slackSourceSchema = slackAddressSchema
|
|
|
67
84
|
/** Runtime-owned local CLI coordinates for the inbound invocation. */
|
|
68
85
|
export const localSourceSchema = z
|
|
69
86
|
.object({
|
|
87
|
+
location: locationSchema.optional(),
|
|
70
88
|
platform: z.literal("local"),
|
|
71
89
|
visibility: z.literal("private"),
|
|
72
90
|
conversationId: localConversationIdSchema,
|
|
@@ -76,6 +94,7 @@ export const localSourceSchema = z
|
|
|
76
94
|
/** Runtime-owned dashboard/web coordinates for the inbound invocation. */
|
|
77
95
|
export const webSourceSchema = z
|
|
78
96
|
.object({
|
|
97
|
+
location: locationSchema.optional(),
|
|
79
98
|
platform: z.literal("web"),
|
|
80
99
|
visibility: sourceVisibilitySchema,
|
|
81
100
|
// Web can continue any existing conversation id, including Slack roots.
|