@theholocron/holocron-plugin-sentry 5.0.0-alpha.276 → 5.0.0-alpha.278
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.mts +2 -1
- package/dist/index.mjs +32 -0
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthError, EnsureRelayInput, EnsureRelayResult, Errors, PluginToken, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
1
|
+
import { AuthError, EnsureRelayInput, EnsureRelayResult, Errors, InspectRelayInput, PluginToken, RelayState, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
2
2
|
import { SentryClient, SentryClientOptions, createSentryClient } from "@theholocron/sentry-client";
|
|
3
3
|
export declare const resolveToken: import("@theholocron/cli").TokenResolver;
|
|
4
4
|
/**
|
|
@@ -30,6 +30,7 @@ export declare class SentryErrors implements Errors {
|
|
|
30
30
|
/** The client for the relay, made with the Comlink token (see `resolveRelayToken`). */
|
|
31
31
|
relayClient?: () => SentryClient);
|
|
32
32
|
ensureRelay(input: EnsureRelayInput): Promise<EnsureRelayResult>;
|
|
33
|
+
inspectRelay(input: InspectRelayInput): Promise<RelayState>;
|
|
33
34
|
describe(): Promise<{
|
|
34
35
|
provider: string;
|
|
35
36
|
envKeys: string[];
|
package/dist/index.mjs
CHANGED
|
@@ -234,6 +234,35 @@ async function ensureSentryRelay(client, org, input) {
|
|
|
234
234
|
...clientSecret ? { clientSecret } : {}
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Read the integration and the alert rule back, changing nothing. The integration's signing secret is not read: the
|
|
239
|
+
* list answer is used as it is and `get`, which returns the secret, is never called.
|
|
240
|
+
*/
|
|
241
|
+
async function inspectSentryRelay(client, org, input) {
|
|
242
|
+
const apps = await client.sentryApps.list(org);
|
|
243
|
+
const projects = await client.projects.list(org);
|
|
244
|
+
const detectors = await client.workflows.detectors(org);
|
|
245
|
+
const workflows = await client.workflows.list(org);
|
|
246
|
+
const app = apps.find((a) => a.name === input.name);
|
|
247
|
+
const rule = workflows.find((w) => w.name === input.rule.name);
|
|
248
|
+
return {
|
|
249
|
+
...app ? { integration: {
|
|
250
|
+
webhookUrl: app.webhookUrl,
|
|
251
|
+
alertAction: app.isAlertable
|
|
252
|
+
} } : {},
|
|
253
|
+
rules: rule ? input.projects.flatMap((slug) => {
|
|
254
|
+
const project = projects.find((p) => p.slug === slug);
|
|
255
|
+
const detector = project && detectors.find((d) => d.projectId === project.id && d.type === "issue_stream");
|
|
256
|
+
if (!detector || !rule.detectorIds.includes(detector.id)) return [];
|
|
257
|
+
const sends = app !== void 0 && rule.actionFilters.some((f) => f.actions.some((a) => sendsThrough(a, app.slug)));
|
|
258
|
+
return [{
|
|
259
|
+
project: slug,
|
|
260
|
+
enabled: rule.enabled,
|
|
261
|
+
sends
|
|
262
|
+
}];
|
|
263
|
+
}) : []
|
|
264
|
+
};
|
|
265
|
+
}
|
|
237
266
|
// src/capabilities/errors.ts
|
|
238
267
|
var SentryErrors = class {
|
|
239
268
|
client;
|
|
@@ -249,6 +278,9 @@ var SentryErrors = class {
|
|
|
249
278
|
async ensureRelay(input) {
|
|
250
279
|
return ensureSentryRelay(this.relayClient(), this.requireOrg(), input);
|
|
251
280
|
}
|
|
281
|
+
async inspectRelay(input) {
|
|
282
|
+
return inspectSentryRelay(this.relayClient(), this.requireOrg(), input);
|
|
283
|
+
}
|
|
252
284
|
async describe() {
|
|
253
285
|
return {
|
|
254
286
|
provider: "sentry",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-sentry",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.278",
|
|
4
4
|
"description": "Holocron plugin for Sentry. Implements the errors capability against Sentry's management API — project provisioning and DSN retrieval.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"errors",
|
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
"tsx": "4.23.15",
|
|
42
42
|
"typescript": "^5.9.3",
|
|
43
43
|
"vitest": "^5.0.5",
|
|
44
|
-
"@theholocron/
|
|
45
|
-
"@theholocron/
|
|
44
|
+
"@theholocron/cli": "5.0.0-alpha.278",
|
|
45
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.4",
|
|
46
|
+
"@theholocron/misc-utils": "^1.16.1-alpha.3",
|
|
47
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.4",
|
|
46
48
|
"@theholocron/http-client": "^1.58.0-alpha.3",
|
|
47
|
-
"@theholocron/
|
|
48
|
-
"@theholocron/
|
|
49
|
-
"@theholocron/sentry-client": "^1.58.0-alpha.3"
|
|
50
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.3",
|
|
51
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.3"
|
|
49
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.4",
|
|
50
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.4",
|
|
51
|
+
"@theholocron/sentry-client": "^1.58.0-alpha.3"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@theholocron/misc-utils": "^1.16.0",
|
|
55
55
|
"@theholocron/sentry-client": "^1.56.0",
|
|
56
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
56
|
+
"@theholocron/cli": "5.0.0-alpha.278"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@theholocron/sentry-client": {}
|