@keystrokehq/sentry 0.0.11 → 0.0.12

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.
Files changed (56) hide show
  1. package/dist/_official/index.d.mts +1 -1
  2. package/dist/_official/index.mjs +1 -1
  3. package/dist/_runtime/index.d.mts +1 -1
  4. package/dist/_runtime/index.mjs +1 -1
  5. package/dist/alerts.d.mts +22 -22
  6. package/dist/alerts.mjs +1 -1
  7. package/dist/connection.d.mts +1 -1
  8. package/dist/connection.mjs +1 -1
  9. package/dist/dashboards.d.mts +10 -10
  10. package/dist/dashboards.mjs +1 -1
  11. package/dist/debug-files.d.mts +6 -6
  12. package/dist/debug-files.mjs +1 -1
  13. package/dist/deploys.d.mts +4 -4
  14. package/dist/deploys.mjs +1 -1
  15. package/dist/discover.d.mts +10 -10
  16. package/dist/discover.mjs +1 -1
  17. package/dist/{endpoint-factory-Cizk4imV.mjs → endpoint-factory-C0WIFmtK.mjs} +1 -2
  18. package/dist/environments.d.mts +6 -6
  19. package/dist/environments.mjs +1 -1
  20. package/dist/events-api.d.mts +14 -14
  21. package/dist/events-api.mjs +1 -1
  22. package/dist/feedback.d.mts +4 -4
  23. package/dist/feedback.mjs +1 -1
  24. package/dist/integration-DCNn_9vz.mjs +356 -0
  25. package/dist/{integration-BaLZqIqf.d.mts → integration-rmp485nJ.d.mts} +2 -3
  26. package/dist/issues.d.mts +36 -36
  27. package/dist/issues.mjs +1 -1
  28. package/dist/members.d.mts +14 -14
  29. package/dist/members.mjs +1 -1
  30. package/dist/monitors.d.mts +44 -44
  31. package/dist/monitors.mjs +1 -1
  32. package/dist/notifications.d.mts +10 -10
  33. package/dist/notifications.mjs +1 -1
  34. package/dist/organizations.d.mts +30 -30
  35. package/dist/organizations.mjs +1 -1
  36. package/dist/project-keys.d.mts +10 -10
  37. package/dist/project-keys.mjs +1 -1
  38. package/dist/projects.d.mts +38 -38
  39. package/dist/projects.mjs +1 -1
  40. package/dist/releases.d.mts +44 -44
  41. package/dist/releases.mjs +1 -1
  42. package/dist/replays.d.mts +18 -18
  43. package/dist/replays.mjs +1 -1
  44. package/dist/schemas.d.mts +6 -6
  45. package/dist/scim.d.mts +22 -22
  46. package/dist/scim.mjs +1 -1
  47. package/dist/teams.d.mts +28 -28
  48. package/dist/teams.mjs +1 -1
  49. package/dist/triggers.d.mts +59 -3
  50. package/dist/triggers.mjs +51 -1
  51. package/dist/user-emails.d.mts +8 -8
  52. package/dist/user-emails.mjs +1 -1
  53. package/dist/webhooks.d.mts +10 -10
  54. package/dist/webhooks.mjs +1 -1
  55. package/package.json +5 -5
  56. package/dist/integration-Q9y2TMhZ.mjs +0 -156
@@ -15,7 +15,7 @@ declare const fetchIssueEventById: _keystrokehq_core0.Operation<z.ZodObject<{
15
15
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
16
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
17
  type: z.ZodOptional<z.ZodString>;
18
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
18
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
19
19
  SENTRY_ACCESS_TOKEN: z.ZodString;
20
20
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
21
21
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -36,7 +36,7 @@ declare const retrieveProjectEventById: _keystrokehq_core0.Operation<z.ZodObject
36
36
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
37
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
38
  type: z.ZodOptional<z.ZodString>;
39
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
39
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
40
40
  SENTRY_ACCESS_TOKEN: z.ZodString;
41
41
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
42
42
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -61,7 +61,7 @@ declare const getProjectEvents: _keystrokehq_core0.Operation<z.ZodObject<{
61
61
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
62
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
63
  type: z.ZodOptional<z.ZodString>;
64
- }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
64
+ }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
65
65
  SENTRY_ACCESS_TOKEN: z.ZodString;
66
66
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
67
67
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -82,7 +82,7 @@ declare const getProjectEventStats: _keystrokehq_core0.Operation<z.ZodObject<{
82
82
  since: z.ZodOptional<z.ZodString>;
83
83
  until: z.ZodOptional<z.ZodString>;
84
84
  resolution: z.ZodOptional<z.ZodString>;
85
- }, z.core.$strip>, z.ZodArray<z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
85
+ }, z.core.$strip>, z.ZodArray<z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
86
86
  SENTRY_ACCESS_TOKEN: z.ZodString;
87
87
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
88
88
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -110,7 +110,7 @@ declare const retrieveOrganizationEvents: _keystrokehq_core0.Operation<z.ZodObje
110
110
  issuePlatform: "issuePlatform";
111
111
  }>>;
112
112
  orderby: z.ZodOptional<z.ZodString>;
113
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
113
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
114
114
  SENTRY_ACCESS_TOKEN: z.ZodString;
115
115
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
116
116
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -130,7 +130,7 @@ declare const retrieveEventIdForOrganization: _keystrokehq_core0.Operation<z.Zod
130
130
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
131
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
132
  type: z.ZodOptional<z.ZodString>;
133
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
133
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
134
134
  SENTRY_ACCESS_TOKEN: z.ZodString;
135
135
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
136
136
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -145,7 +145,7 @@ declare const retrieveSourceMapDebugEvent: _keystrokehq_core0.Operation<z.ZodObj
145
145
  event_id: z.ZodString;
146
146
  frame_idx: z.ZodOptional<z.ZodNumber>;
147
147
  exception_idx: z.ZodOptional<z.ZodNumber>;
148
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
148
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
149
149
  SENTRY_ACCESS_TOKEN: z.ZodString;
150
150
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
151
151
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -167,7 +167,7 @@ declare const sentryEventOperations: {
167
167
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
168
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
169
  type: z.ZodOptional<z.ZodString>;
170
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
170
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
171
171
  SENTRY_ACCESS_TOKEN: z.ZodString;
172
172
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
173
173
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -188,7 +188,7 @@ declare const sentryEventOperations: {
188
188
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
189
189
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
190
190
  type: z.ZodOptional<z.ZodString>;
191
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
191
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
192
192
  SENTRY_ACCESS_TOKEN: z.ZodString;
193
193
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
194
194
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -213,7 +213,7 @@ declare const sentryEventOperations: {
213
213
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
214
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
215
  type: z.ZodOptional<z.ZodString>;
216
- }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
216
+ }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
217
217
  SENTRY_ACCESS_TOKEN: z.ZodString;
218
218
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
219
219
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -234,7 +234,7 @@ declare const sentryEventOperations: {
234
234
  since: z.ZodOptional<z.ZodString>;
235
235
  until: z.ZodOptional<z.ZodString>;
236
236
  resolution: z.ZodOptional<z.ZodString>;
237
- }, z.core.$strip>, z.ZodArray<z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
237
+ }, z.core.$strip>, z.ZodArray<z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
238
238
  SENTRY_ACCESS_TOKEN: z.ZodString;
239
239
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
240
240
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -262,7 +262,7 @@ declare const sentryEventOperations: {
262
262
  issuePlatform: "issuePlatform";
263
263
  }>>;
264
264
  orderby: z.ZodOptional<z.ZodString>;
265
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
265
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
266
266
  SENTRY_ACCESS_TOKEN: z.ZodString;
267
267
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
268
268
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -282,7 +282,7 @@ declare const sentryEventOperations: {
282
282
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
283
  platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
284
  type: z.ZodOptional<z.ZodString>;
285
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
285
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
286
286
  SENTRY_ACCESS_TOKEN: z.ZodString;
287
287
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
288
288
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -297,7 +297,7 @@ declare const sentryEventOperations: {
297
297
  event_id: z.ZodString;
298
298
  frame_idx: z.ZodOptional<z.ZodNumber>;
299
299
  exception_idx: z.ZodOptional<z.ZodNumber>;
300
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
300
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
301
301
  SENTRY_ACCESS_TOKEN: z.ZodString;
302
302
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
303
303
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -1,5 +1,5 @@
1
1
  import { orgIssueScopeInputSchema, orgProjectScopeInputSchema, orgScopeInputSchema, sentryEventSchema, sentryIdSchema, sentryJsonArraySchema, sentryJsonObjectSchema, sentryListInputSchema } from "./schemas.mjs";
2
- import { t as defineSentryEndpoint } from "./endpoint-factory-Cizk4imV.mjs";
2
+ import { t as defineSentryEndpoint } from "./endpoint-factory-C0WIFmtK.mjs";
3
3
  import { t as SENTRY_SCOPE } from "./scopes-RRU0vt-a.mjs";
4
4
  import { z } from "zod";
5
5
 
@@ -16,7 +16,7 @@ declare const retrieveUserFeedbackForProject: _keystrokehq_core0.Operation<z.Zod
16
16
  email: z.ZodOptional<z.ZodString>;
17
17
  comments: z.ZodOptional<z.ZodString>;
18
18
  dateCreated: z.ZodOptional<z.ZodISODateTime>;
19
- }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
19
+ }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
20
20
  SENTRY_ACCESS_TOKEN: z.ZodString;
21
21
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
22
22
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -39,7 +39,7 @@ declare const submitProjectUserFeedback: _keystrokehq_core0.Operation<z.ZodObjec
39
39
  email: z.ZodOptional<z.ZodString>;
40
40
  comments: z.ZodOptional<z.ZodString>;
41
41
  dateCreated: z.ZodOptional<z.ZodISODateTime>;
42
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
42
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
43
43
  SENTRY_ACCESS_TOKEN: z.ZodString;
44
44
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
45
45
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -62,7 +62,7 @@ declare const sentryFeedbackOperations: {
62
62
  email: z.ZodOptional<z.ZodString>;
63
63
  comments: z.ZodOptional<z.ZodString>;
64
64
  dateCreated: z.ZodOptional<z.ZodISODateTime>;
65
- }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
65
+ }, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
66
66
  SENTRY_ACCESS_TOKEN: z.ZodString;
67
67
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
68
68
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
@@ -85,7 +85,7 @@ declare const sentryFeedbackOperations: {
85
85
  email: z.ZodOptional<z.ZodString>;
86
86
  comments: z.ZodOptional<z.ZodString>;
87
87
  dateCreated: z.ZodOptional<z.ZodISODateTime>;
88
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
88
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
89
89
  SENTRY_ACCESS_TOKEN: z.ZodString;
90
90
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
91
91
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
package/dist/feedback.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { orgProjectScopeInputSchema, sentryFeedbackSchema, sentryIdSchema, sentryListInputSchema } from "./schemas.mjs";
2
- import { t as defineSentryEndpoint } from "./endpoint-factory-Cizk4imV.mjs";
2
+ import { t as defineSentryEndpoint } from "./endpoint-factory-C0WIFmtK.mjs";
3
3
  import { t as SENTRY_SCOPE } from "./scopes-RRU0vt-a.mjs";
4
4
  import { z } from "zod";
5
5
 
@@ -0,0 +1,356 @@
1
+ import { SENTRY_DEFAULT_BASE_URL } from "./client.mjs";
2
+ import { CredentialSet, Operation } from "@keystrokehq/core";
3
+ import { z } from "zod";
4
+
5
+ //#region ../../packages/integration-authoring/dist/official/runtime.mjs
6
+ const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
7
+ function getRegistry() {
8
+ const globalStore = globalThis;
9
+ if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
10
+ return globalStore[REGISTRY_KEY];
11
+ }
12
+ function registerOfficialOperation(operation, metadata) {
13
+ getRegistry().set(operation, Object.freeze({ ...metadata }));
14
+ }
15
+
16
+ //#endregion
17
+ //#region ../../packages/integration-authoring/dist/official/index.mjs
18
+ const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
19
+ function officialCredentialSetId(id) {
20
+ return `${OFFICIAL_CREDENTIAL_SET_ID_PREFIX}${id}`;
21
+ }
22
+ function stripOfficialCredentialSetIdPrefix(id) {
23
+ return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
24
+ }
25
+ /**
26
+ * Creates a factory for Keystroke-official integration operations.
27
+ *
28
+ * It keeps the same flat `run(input, credentials)` ergonomics as the generic
29
+ * operation factory, while registering official metadata for builder/runtime
30
+ * operation metadata.
31
+ */
32
+ function createOfficialOperationFactory(credentialSet) {
33
+ const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
34
+ return (config) => {
35
+ const wrappedRun = async (input, ctx) => {
36
+ const creds = ctx.credentials[credentialSet.id];
37
+ return config.run(input, creds);
38
+ };
39
+ const operation = new Operation({
40
+ id: config.id,
41
+ name: config.name,
42
+ description: config.description,
43
+ input: config.input,
44
+ output: config.output,
45
+ credentialSets: [credentialSet],
46
+ ...config.tags !== void 0 ? { tags: config.tags } : {},
47
+ ...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
48
+ ...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
49
+ ...config.retries !== void 0 ? { retries: config.retries } : {},
50
+ ...config.timeout !== void 0 ? { timeout: config.timeout } : {},
51
+ ...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
52
+ run: wrappedRun
53
+ });
54
+ registerOfficialOperation(operation, { integrationId });
55
+ return operation;
56
+ };
57
+ }
58
+ /**
59
+ * Creates an official integration bundle from a single config object.
60
+ *
61
+ * - Creates the public `CredentialSet` internally.
62
+ * - Accepts optional `internal` fields for Keystroke-owned platform credentials.
63
+ */
64
+ function defineOfficialIntegration(config) {
65
+ const internalCredentialSets = config.internal ?? {};
66
+ const allInternalCredentialSets = [
67
+ ...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
68
+ ...internalCredentialSets.providerAppVariants ?? [],
69
+ ...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
70
+ ...internalCredentialSets.other ?? []
71
+ ];
72
+ const credentialSet = new CredentialSet({
73
+ id: config.id,
74
+ name: config.name,
75
+ description: config.description,
76
+ auth: config.auth,
77
+ ...config.connections ? { connections: config.connections } : {},
78
+ ...config.proxy ? { proxy: config.proxy } : {},
79
+ ...config.needsRawSecret === true ? { needsRawSecret: true } : {}
80
+ });
81
+ return Object.freeze({
82
+ integration: {
83
+ id: config.id,
84
+ name: config.name,
85
+ ...config.description !== void 0 ? { description: config.description } : {},
86
+ auth: config.auth,
87
+ ...config.proxy ? { proxy: config.proxy } : {},
88
+ ...config.needsRawSecret === true ? { needsRawSecret: true } : {},
89
+ ...config.connections ? { connections: config.connections } : {}
90
+ },
91
+ credentialSet,
92
+ internalCredentialSets,
93
+ allInternalCredentialSets
94
+ });
95
+ }
96
+
97
+ //#endregion
98
+ //#region src/_official/provider-app.ts
99
+ /**
100
+ * Internal Keystroke-owned Sentry app credentials.
101
+ *
102
+ * For Sentry, `clientSecret` doubles as the webhook signing secret per
103
+ * <https://docs.sentry.io/organization/integrations/integration-platform/webhooks/>,
104
+ * so `webhookSecret` is kept as a discrete field for symmetry with other
105
+ * integrations even though in practice platforms will populate both from the
106
+ * same Sentry-issued value.
107
+ */
108
+ const sentryAppCredentialSet = new CredentialSet({
109
+ id: officialCredentialSetId("sentry-app"),
110
+ exposure: "platform-only",
111
+ name: "Sentry App",
112
+ auth: z.object({
113
+ clientId: z.string(),
114
+ clientSecret: z.string(),
115
+ webhookSecret: z.string()
116
+ })
117
+ });
118
+ const sentryOfficialProviderSeed = {
119
+ provider: "sentry",
120
+ appRef: "sentry-official",
121
+ displayName: "Sentry Platform",
122
+ credentialSetName: "Keystroke Sentry Platform App",
123
+ envShape: {
124
+ KEYSTROKE_OFFICIAL_SENTRY_CLIENT_ID: z.string().optional(),
125
+ KEYSTROKE_OFFICIAL_SENTRY_CLIENT_SECRET: z.string().optional(),
126
+ KEYSTROKE_OFFICIAL_SENTRY_WEBHOOK_SECRET: z.string().optional()
127
+ },
128
+ requiredEnvKeys: [
129
+ "KEYSTROKE_OFFICIAL_SENTRY_CLIENT_ID",
130
+ "KEYSTROKE_OFFICIAL_SENTRY_CLIENT_SECRET",
131
+ "KEYSTROKE_OFFICIAL_SENTRY_WEBHOOK_SECRET"
132
+ ],
133
+ externalAppIdEnvKey: "KEYSTROKE_OFFICIAL_SENTRY_CLIENT_ID",
134
+ buildCredentials: (env) => ({
135
+ clientId: env.KEYSTROKE_OFFICIAL_SENTRY_CLIENT_ID,
136
+ clientSecret: env.KEYSTROKE_OFFICIAL_SENTRY_CLIENT_SECRET,
137
+ webhookSecret: env.KEYSTROKE_OFFICIAL_SENTRY_WEBHOOK_SECRET
138
+ })
139
+ };
140
+
141
+ //#endregion
142
+ //#region ../../packages/credential-connection/dist/defaults-YE9AvLIc.mjs
143
+ /**
144
+ * Shared OAuth 2.0 token-response plumbing.
145
+ *
146
+ * `parseOAuthTokenResponse` handles the two common wire formats (JSON and
147
+ * form-urlencoded, the latter used by GitHub unless you explicitly ask for
148
+ * JSON). `normalizeOAuthTokens` pulls the standard fields out of the parsed
149
+ * body in both the flat form and Slack's nested `authed_user.access_token`
150
+ * form. These helpers are exposed so integration authors overriding
151
+ * `exchangeCode` / `refreshToken` do not have to re-implement them.
152
+ */
153
+ var TokenExchangeError = class extends Error {
154
+ httpStatus;
155
+ constructor(httpStatus) {
156
+ super(`Token exchange failed: HTTP ${httpStatus}`);
157
+ this.name = "TokenExchangeError";
158
+ this.httpStatus = httpStatus;
159
+ }
160
+ };
161
+ async function parseOAuthTokenResponse(response) {
162
+ const contentType = response.headers.get("content-type")?.toLowerCase() ?? "";
163
+ if (contentType.includes("application/json")) return await response.json();
164
+ const text = await response.text();
165
+ if (!text.trim()) return {};
166
+ if (contentType.includes("application/x-www-form-urlencoded") || text.includes("=")) {
167
+ const params = new URLSearchParams(text);
168
+ return Object.fromEntries(params.entries());
169
+ }
170
+ throw new Error(`Unsupported OAuth token response content type: ${contentType || "unknown"}`);
171
+ }
172
+ function normalizeOAuthTokens(tokenData) {
173
+ const authedUser = tokenData.authed_user;
174
+ const rawAccessToken = tokenData.access_token ?? authedUser?.access_token;
175
+ const rawRefreshToken = tokenData.refresh_token;
176
+ const rawExpiresIn = tokenData.expires_in;
177
+ const rawInstanceUrl = tokenData.instance_url;
178
+ return {
179
+ accessToken: typeof rawAccessToken === "string" ? rawAccessToken : void 0,
180
+ refreshToken: typeof rawRefreshToken === "string" ? rawRefreshToken : void 0,
181
+ expiresIn: typeof rawExpiresIn === "number" ? rawExpiresIn : typeof rawExpiresIn === "string" ? Number(rawExpiresIn) || void 0 : void 0,
182
+ instanceUrl: typeof rawInstanceUrl === "string" ? rawInstanceUrl : void 0
183
+ };
184
+ }
185
+ function buildAuthUrl(ctx) {
186
+ const { oauthClient, redirectUri, state, connection } = ctx;
187
+ const scopes = ctx.requestedScopes ?? connection.scopes;
188
+ const url = new URL(connection.authUrl);
189
+ url.searchParams.set("client_id", oauthClient.clientId);
190
+ url.searchParams.set("scope", scopes.join(" "));
191
+ url.searchParams.set("redirect_uri", redirectUri);
192
+ url.searchParams.set("state", state);
193
+ url.searchParams.set("response_type", "code");
194
+ return url.toString();
195
+ }
196
+ async function exchangeToken(params) {
197
+ const response = await fetch(params.tokenUrl, {
198
+ method: "POST",
199
+ headers: {
200
+ Accept: "application/json",
201
+ "Content-Type": "application/x-www-form-urlencoded"
202
+ },
203
+ body: params.body
204
+ });
205
+ if (!response.ok) throw new TokenExchangeError(response.status);
206
+ const raw = await parseOAuthTokenResponse(response);
207
+ const { accessToken, refreshToken, expiresIn, instanceUrl } = normalizeOAuthTokens(raw);
208
+ if (!accessToken) throw new Error("No access token in response");
209
+ return {
210
+ accessToken,
211
+ refreshToken,
212
+ expiresIn,
213
+ instanceUrl,
214
+ raw
215
+ };
216
+ }
217
+ async function exchangeCode(ctx) {
218
+ const { oauthClient, code, redirectUri, connection } = ctx;
219
+ if (!code) throw new Error("Missing authorization code");
220
+ return exchangeToken({
221
+ tokenUrl: connection.tokenUrl,
222
+ body: new URLSearchParams({
223
+ code,
224
+ client_id: oauthClient.clientId,
225
+ client_secret: oauthClient.clientSecret,
226
+ redirect_uri: redirectUri,
227
+ grant_type: "authorization_code"
228
+ })
229
+ });
230
+ }
231
+ async function refreshToken(ctx) {
232
+ const { oauthClient, refreshToken, connection } = ctx;
233
+ return exchangeToken({
234
+ tokenUrl: connection.tokenUrl,
235
+ body: new URLSearchParams({
236
+ grant_type: "refresh_token",
237
+ refresh_token: refreshToken,
238
+ client_id: oauthClient.clientId,
239
+ client_secret: oauthClient.clientSecret
240
+ })
241
+ });
242
+ }
243
+ const oauthDefaults = {
244
+ buildAuthUrl,
245
+ exchangeCode,
246
+ exchangeToken,
247
+ refreshToken
248
+ };
249
+
250
+ //#endregion
251
+ //#region src/oauth-connection.ts
252
+ const SENTRY_OAUTH_SCOPES = [
253
+ "org:read",
254
+ "project:read",
255
+ "project:write",
256
+ "project:admin",
257
+ "team:read",
258
+ "team:write",
259
+ "team:admin",
260
+ "member:read",
261
+ "member:write",
262
+ "event:read",
263
+ "event:admin",
264
+ "alerts:read",
265
+ "alerts:write",
266
+ "release:admin"
267
+ ];
268
+ const sentryOAuthConnection = {
269
+ kind: "oauth",
270
+ tokenType: "refreshable",
271
+ authUrl: "https://sentry.io/oauth/authorize/",
272
+ tokenUrl: "https://sentry.io/oauth/token/",
273
+ revokeUrl: null,
274
+ scopes: [...SENTRY_OAUTH_SCOPES],
275
+ vault: { accessToken: "SENTRY_ACCESS_TOKEN" },
276
+ async exchangeCode(ctx) {
277
+ const result = await oauthDefaults.exchangeCode(ctx);
278
+ const orgResponse = await fetch(`${SENTRY_DEFAULT_BASE_URL}/api/0/organizations/`, {
279
+ method: "GET",
280
+ headers: {
281
+ Authorization: `Bearer ${result.accessToken}`,
282
+ Accept: "application/json"
283
+ }
284
+ });
285
+ let firstOrg = null;
286
+ if (orgResponse.ok) {
287
+ const orgs = await orgResponse.json();
288
+ if (Array.isArray(orgs) && orgs.length > 0 && isOrganizationProbe(orgs[0])) firstOrg = orgs[0];
289
+ }
290
+ result.raw._sentryOrganization = firstOrg;
291
+ result.raw._sentryUser = pickUser(result.raw);
292
+ result.raw._sentryScopes = typeof result.raw.scope === "string" ? result.raw.scope : void 0;
293
+ return result;
294
+ },
295
+ extractInstallationInfo({ tokenResult }) {
296
+ const org = tokenResult.raw._sentryOrganization;
297
+ const user = tokenResult.raw._sentryUser;
298
+ const metadata = {};
299
+ if (org?.name) metadata.organizationName = org.name;
300
+ if (org?.slug) metadata.organizationSlug = org.slug;
301
+ const regionUrl = org?.links?.regionUrl;
302
+ if (regionUrl) metadata.regionUrl = regionUrl;
303
+ if (user?.name) metadata.userName = user.name;
304
+ if (user?.email) metadata.userEmail = user.email;
305
+ return {
306
+ externalInstallationId: org?.slug,
307
+ externalWorkspaceId: org?.id,
308
+ externalBotUserId: user?.id,
309
+ metadata
310
+ };
311
+ }
312
+ };
313
+ function isOrganizationProbe(value) {
314
+ return typeof value === "object" && value !== null;
315
+ }
316
+ function pickUser(raw) {
317
+ const user = raw.user;
318
+ if (user == null || typeof user !== "object") return null;
319
+ const u = user;
320
+ return {
321
+ id: typeof u.id === "string" ? u.id : void 0,
322
+ name: typeof u.name === "string" ? u.name : void 0,
323
+ email: typeof u.email === "string" ? u.email : void 0
324
+ };
325
+ }
326
+
327
+ //#endregion
328
+ //#region src/integration.ts
329
+ const sentryAuthSchema = z.object({
330
+ SENTRY_ACCESS_TOKEN: z.string().min(1),
331
+ SENTRY_REGION_URL: z.string().url().optional(),
332
+ SENTRY_ORG_SLUG: z.string().min(1).optional()
333
+ });
334
+ const sentryOfficialIntegration = {
335
+ id: "sentry",
336
+ name: "Sentry",
337
+ description: "Sentry — issue lifecycle, release tracking, alerts, monitors, replays, feedback, and integration-platform webhook triggers",
338
+ auth: sentryAuthSchema,
339
+ proxy: { hosts: [
340
+ "sentry.io",
341
+ "us.sentry.io",
342
+ "de.sentry.io"
343
+ ] },
344
+ connections: [{
345
+ id: "oauth",
346
+ ...sentryOAuthConnection
347
+ }]
348
+ };
349
+ const sentryBundle = defineOfficialIntegration({
350
+ ...sentryOfficialIntegration,
351
+ internal: { providerApp: sentryAppCredentialSet }
352
+ });
353
+ const sentry = sentryBundle.credentialSet;
354
+
355
+ //#endregion
356
+ export { sentryOfficialProviderSeed as a, sentryAppCredentialSet as i, sentryBundle as n, createOfficialOperationFactory as o, sentryOfficialIntegration as r, sentry as t };
@@ -1,5 +1,4 @@
1
1
  import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
3
2
  import { z } from "zod";
4
3
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
5
4
  import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
@@ -39,12 +38,12 @@ declare const sentryOfficialIntegration: {
39
38
  id: string;
40
39
  }[];
41
40
  };
42
- declare const sentryBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"sentry", z.ZodObject<{
41
+ declare const sentryBundle: undefined<"sentry", z.ZodObject<{
43
42
  SENTRY_ACCESS_TOKEN: z.ZodString;
44
43
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
45
44
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;
46
45
  }, z.core.$strip>>;
47
- declare const sentry: _keystrokehq_core0.CredentialSet<"keystroke:sentry", z.ZodObject<{
46
+ declare const sentry: _keystrokehq_core0.CredentialSet<"sentry", z.ZodObject<{
48
47
  SENTRY_ACCESS_TOKEN: z.ZodString;
49
48
  SENTRY_REGION_URL: z.ZodOptional<z.ZodString>;
50
49
  SENTRY_ORG_SLUG: z.ZodOptional<z.ZodString>;