@sentry/junior-linear 0.265.0 → 0.266.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/events/issue.d.ts +4 -1
- package/dist/index.js +17 -5
- package/package.json +4 -3
package/dist/events/issue.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type SubscribableResource } from "@sentry/junior-plugin-api";
|
|
2
2
|
export declare const LINEAR_ISSUE_EVENTS: readonly ["issue.created"];
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Exact values that every Linear issue event sets. `issueIdentifier` and
|
|
5
|
+
* `teamKey` are uppercase, the same form as identifiers.
|
|
6
|
+
*/
|
|
4
7
|
export declare const LINEAR_ISSUE_MATCH_FIELDS: Record<string, {
|
|
5
8
|
kind: "boolean" | "number" | "string";
|
|
6
9
|
description: string;
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,15 @@ import {
|
|
|
10
10
|
} from "@sentry/junior-plugin-api";
|
|
11
11
|
var LINEAR_ISSUE_EVENTS = ["issue.created"];
|
|
12
12
|
var LINEAR_ISSUE_MATCH_FIELDS = eventMatchFieldsSchema.parse({
|
|
13
|
+
issueIdentifier: {
|
|
14
|
+
kind: "string",
|
|
15
|
+
description: "uppercase Linear issue identifier, such as SRE-123",
|
|
16
|
+
events: [...LINEAR_ISSUE_EVENTS]
|
|
17
|
+
},
|
|
13
18
|
teamKey: {
|
|
14
19
|
kind: "string",
|
|
15
|
-
description: "Linear team key for the issue, such as SRE"
|
|
20
|
+
description: "uppercase Linear team key for the issue, such as SRE",
|
|
21
|
+
events: [...LINEAR_ISSUE_EVENTS]
|
|
16
22
|
}
|
|
17
23
|
});
|
|
18
24
|
function linearIssueResource(input) {
|
|
@@ -72,6 +78,12 @@ function issueText(issue) {
|
|
|
72
78
|
].filter((part) => part !== void 0);
|
|
73
79
|
return parts.length > 0 ? parts.join("\n") : void 0;
|
|
74
80
|
}
|
|
81
|
+
var issueEventDataSchema = z.object({
|
|
82
|
+
issueId: z.string().min(1),
|
|
83
|
+
issueIdentifier: z.string().min(1).toUpperCase(),
|
|
84
|
+
teamKey: z.string().min(1).toUpperCase(),
|
|
85
|
+
url: z.url()
|
|
86
|
+
}).strict();
|
|
75
87
|
function occurredAtMs(input) {
|
|
76
88
|
const createdAt = input.createdAt ? Date.parse(input.createdAt) : Number.NaN;
|
|
77
89
|
if (Number.isFinite(createdAt)) return createdAt;
|
|
@@ -95,12 +107,12 @@ function normalizeLinearEvents(input) {
|
|
|
95
107
|
eventType,
|
|
96
108
|
occurredAtMs: occurredAtMs(parsed.data),
|
|
97
109
|
trustedSummary: `${issueResource.label} was created.`,
|
|
98
|
-
data: {
|
|
110
|
+
data: issueEventDataSchema.parse({
|
|
99
111
|
issueId: issue.id,
|
|
100
|
-
issueIdentifier:
|
|
101
|
-
teamKey
|
|
112
|
+
issueIdentifier: issue.identifier,
|
|
113
|
+
teamKey,
|
|
102
114
|
url: issue.url
|
|
103
|
-
},
|
|
115
|
+
}),
|
|
104
116
|
untrustedText: issueText(issue)
|
|
105
117
|
};
|
|
106
118
|
return [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-linear",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.266.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"zod": "^4.5.4",
|
|
26
|
-
"@sentry/junior-plugin-api": "0.
|
|
26
|
+
"@sentry/junior-plugin-api": "0.266.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@oxlint/plugins": "1.79.0",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"oxlint": "^1.79.0",
|
|
32
32
|
"tsup": "^8.5.1",
|
|
33
33
|
"typescript": "^7.0.2",
|
|
34
|
-
"vitest": "^4.1.12"
|
|
34
|
+
"vitest": "^4.1.12",
|
|
35
|
+
"@sentry/junior-testing": "0.0.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|