@sentry/api 1.0.0 → 1.1.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.
@@ -4,7 +4,10 @@ import {
4
4
  validateResponse
5
5
  } from "@sentry/api/client";
6
6
  async function listClientKeys({ core, origin }, { organizationSlug, projectSlug }, schema) {
7
- const body = await core.requestJson(origin, apiPath`/projects/${organizationSlug}/${projectSlug}/keys/`);
7
+ const body = await core.requestJson(
8
+ origin,
9
+ apiPath`/projects/${organizationSlug}/${projectSlug}/keys/`
10
+ );
8
11
  return validateResponse(schema, body);
9
12
  }
10
13
  async function createClientKey({ core, origin }, {
@@ -12,7 +15,11 @@ async function createClientKey({ core, origin }, {
12
15
  projectSlug,
13
16
  name
14
17
  }, schema) {
15
- const body = await core.requestJson(origin, apiPath`/projects/${organizationSlug}/${projectSlug}/keys/`, { method: "POST", body: JSON.stringify({ name }) });
18
+ const body = await core.requestJson(
19
+ origin,
20
+ apiPath`/projects/${organizationSlug}/${projectSlug}/keys/`,
21
+ { method: "POST", body: JSON.stringify({ name }) }
22
+ );
16
23
  return validateResponse(schema, body);
17
24
  }
18
25
  async function updateClientKey({ core, origin }, {
@@ -26,24 +33,29 @@ async function updateClientKey({ core, origin }, {
26
33
  dynamicSdkLoaderOptions
27
34
  }, schema) {
28
35
  const data = {};
29
- if (name !== undefined) {
36
+ if (name !== void 0) {
30
37
  data.name = name;
31
38
  }
32
- if (isActive !== undefined) {
39
+ if (isActive !== void 0) {
33
40
  data.isActive = isActive;
34
41
  }
35
- if (rateLimit !== undefined) {
42
+ if (rateLimit !== void 0) {
36
43
  data.rateLimit = rateLimit;
37
44
  }
38
- if (browserSdkVersion !== undefined) {
45
+ if (browserSdkVersion !== void 0) {
39
46
  data.browserSdkVersion = browserSdkVersion;
40
47
  }
41
- if (dynamicSdkLoaderOptions !== undefined) {
48
+ if (dynamicSdkLoaderOptions !== void 0) {
42
49
  data.dynamicSdkLoaderOptions = dynamicSdkLoaderOptions;
43
50
  }
44
- const body = await core.requestJson(origin, apiPath`/projects/${organizationSlug}/${projectSlug}/keys/${keyId}/`, { method: "PUT", body: JSON.stringify(data) });
51
+ const body = await core.requestJson(
52
+ origin,
53
+ apiPath`/projects/${organizationSlug}/${projectSlug}/keys/${keyId}/`,
54
+ { method: "PUT", body: JSON.stringify(data) }
55
+ );
45
56
  return validateResponse(schema, body);
46
57
  }
58
+
47
59
  // src/api-client/endpoints/dashboards.ts
48
60
  import {
49
61
  apiPath as apiPath2,
@@ -52,7 +64,7 @@ import {
52
64
  validateResponse as validateResponse2
53
65
  } from "@sentry/api/client";
54
66
  async function listDashboards({ core, origin }, { organizationSlug, query, sortBy, limit = 10, cursor }, schema) {
55
- const params = new URLSearchParams;
67
+ const params = new URLSearchParams();
56
68
  params.set("per_page", String(limit));
57
69
  if (query) {
58
70
  params.set("query", query);
@@ -63,16 +75,23 @@ async function listDashboards({ core, origin }, { organizationSlug, query, sortB
63
75
  if (cursor) {
64
76
  params.set("cursor", cursor);
65
77
  }
66
- const response = await core.request(origin, `${apiPath2`/organizations/${organizationSlug}/dashboards/`}?${params.toString()}`);
78
+ const response = await core.request(
79
+ origin,
80
+ `${apiPath2`/organizations/${organizationSlug}/dashboards/`}?${params.toString()}`
81
+ );
67
82
  return {
68
83
  items: validateResponse2(schema, await readJsonResponse(response)),
69
84
  nextCursor: nextPageCursor(response)
70
85
  };
71
86
  }
72
87
  async function getDashboard({ core, origin }, { organizationSlug, dashboardId }, schema) {
73
- const body = await core.requestJson(origin, apiPath2`/organizations/${organizationSlug}/dashboards/${dashboardId}/`);
88
+ const body = await core.requestJson(
89
+ origin,
90
+ apiPath2`/organizations/${organizationSlug}/dashboards/${dashboardId}/`
91
+ );
74
92
  return validateResponse2(schema, body);
75
93
  }
94
+
76
95
  // src/api-client/endpoints/monitors.ts
77
96
  import {
78
97
  apiPath as apiPath3,
@@ -91,7 +110,7 @@ async function listMonitors({ core, origin }, {
91
110
  query,
92
111
  limit
93
112
  }, schema) {
94
- const params = new URLSearchParams;
113
+ const params = new URLSearchParams();
95
114
  if (projectSlug) {
96
115
  params.append("projectSlug", projectSlug);
97
116
  }
@@ -104,10 +123,13 @@ async function listMonitors({ core, origin }, {
104
123
  if (query) {
105
124
  params.set("query", query);
106
125
  }
107
- if (limit !== undefined) {
126
+ if (limit !== void 0) {
108
127
  params.set("per_page", String(limit));
109
128
  }
110
- const body = await core.requestJson(origin, withQuery(apiPath3`/organizations/${organizationSlug}/monitors/`, params));
129
+ const body = await core.requestJson(
130
+ origin,
131
+ withQuery(apiPath3`/organizations/${organizationSlug}/monitors/`, params)
132
+ );
111
133
  return validateResponse3(schema, body);
112
134
  }
113
135
  function monitorPath({ organizationSlug, projectSlug, monitorSlug }, suffix = "") {
@@ -115,14 +137,17 @@ function monitorPath({ organizationSlug, projectSlug, monitorSlug }, suffix = ""
115
137
  return `${path}${suffix}`;
116
138
  }
117
139
  function environmentQuery(environment) {
118
- const params = new URLSearchParams;
140
+ const params = new URLSearchParams();
119
141
  if (environment) {
120
142
  params.append("environment", environment);
121
143
  }
122
144
  return params;
123
145
  }
124
146
  async function getMonitor({ core, origin }, params, schema) {
125
- const body = await core.requestJson(origin, withQuery(monitorPath(params), environmentQuery(params.environment)));
147
+ const body = await core.requestJson(
148
+ origin,
149
+ withQuery(monitorPath(params), environmentQuery(params.environment))
150
+ );
126
151
  return validateResponse3(schema, body);
127
152
  }
128
153
  async function deleteMonitorEnvironment({ core, origin }, {
@@ -131,11 +156,16 @@ async function deleteMonitorEnvironment({ core, origin }, {
131
156
  monitorSlug,
132
157
  environment
133
158
  }) {
134
- await core.request(origin, apiPath3`/projects/${organizationSlug}/${projectSlug}/monitors/${monitorSlug}/environments/${environment}/`, { method: "DELETE" }, { allowStatuses: [404] });
159
+ await core.request(
160
+ origin,
161
+ apiPath3`/projects/${organizationSlug}/${projectSlug}/monitors/${monitorSlug}/environments/${environment}/`,
162
+ { method: "DELETE" },
163
+ { allowStatuses: [404] }
164
+ );
135
165
  }
136
166
  async function listMonitorCheckIns({ core, origin }, params, schema) {
137
167
  const query = environmentQuery(params.environment);
138
- if (params.limit !== undefined) {
168
+ if (params.limit !== void 0) {
139
169
  query.set("per_page", String(params.limit));
140
170
  }
141
171
  const statsPeriod = defaultStatsPeriod(params);
@@ -143,15 +173,28 @@ async function listMonitorCheckIns({ core, origin }, params, schema) {
143
173
  parseStatsPeriod(statsPeriod);
144
174
  }
145
175
  applyTimeParams(query, statsPeriod, params.start, params.end);
146
- const body = await core.requestJson(origin, withQuery(monitorPath(params, "checkins/"), query));
176
+ const body = await core.requestJson(
177
+ origin,
178
+ withQuery(monitorPath(params, "checkins/"), query)
179
+ );
147
180
  return validateResponse3(schema, body);
148
181
  }
149
182
  async function getMonitorStats({ core, origin }, params, schema) {
150
183
  const query = environmentQuery(params.environment);
151
- applyStatsMixinTimeParams(query, defaultStatsPeriod(params), params.start, params.end, params.rollup);
152
- const body = await core.requestJson(origin, withQuery(monitorPath(params, "stats/"), query));
184
+ applyStatsMixinTimeParams(
185
+ query,
186
+ defaultStatsPeriod(params),
187
+ params.start,
188
+ params.end,
189
+ params.rollup
190
+ );
191
+ const body = await core.requestJson(
192
+ origin,
193
+ withQuery(monitorPath(params, "stats/"), query)
194
+ );
153
195
  return validateResponse3(schema, body);
154
196
  }
197
+
155
198
  // src/api-client/endpoints/organizations.ts
156
199
  import { listOrganizations as listOrganizationsOperation } from "@sentry/api";
157
200
  import {
@@ -165,27 +208,40 @@ async function getAuthenticatedUser({ core, origin }, schema) {
165
208
  }
166
209
  async function listOrganizations({ core, origin }, params, schema) {
167
210
  const client = core.sdkClient(origin, "/organizations/");
168
- return await listPage((perPage, cursor) => listOrganizationsOperation({
169
- client,
170
- query: { per_page: perPage, query: params.query, cursor },
171
- throwOnError: true
172
- }), schema, params.limit ?? 25, params.cursor);
211
+ return await listPage(
212
+ (perPage, cursor) => listOrganizationsOperation({
213
+ client,
214
+ query: { per_page: perPage, query: params.query, cursor },
215
+ throwOnError: true
216
+ }),
217
+ schema,
218
+ params.limit ?? 25,
219
+ params.cursor
220
+ );
173
221
  }
174
222
  async function getOrganization({ core, origin }, params, schema) {
175
- const query = new URLSearchParams;
223
+ const query = new URLSearchParams();
176
224
  if (params.includeFeatureFlags) {
177
225
  query.set("include_feature_flags", "1");
178
226
  }
179
227
  if (params.detailed === false) {
180
228
  query.set("detailed", "0");
181
229
  }
182
- const body = await core.requestJson(origin, withQuery2(apiPath4`/organizations/${params.organizationSlug}/`, query));
230
+ const body = await core.requestJson(
231
+ origin,
232
+ withQuery2(apiPath4`/organizations/${params.organizationSlug}/`, query)
233
+ );
183
234
  return validateResponse4(schema, body);
184
235
  }
185
236
  async function updateAgenticOnboardingStatus({ core, origin }, { organizationSlug, update }, schema) {
186
- const body = await core.requestJson(origin, apiPath4`/organizations/${organizationSlug}/onboarding/agent/status/`, { method: "POST", body: JSON.stringify(update) });
237
+ const body = await core.requestJson(
238
+ origin,
239
+ apiPath4`/organizations/${organizationSlug}/onboarding/agent/status/`,
240
+ { method: "POST", body: JSON.stringify(update) }
241
+ );
187
242
  return validateResponse4(schema, body);
188
243
  }
244
+
189
245
  // src/api-client/endpoints/profiling.ts
190
246
  import {
191
247
  apiPath as apiPath5,
@@ -197,12 +253,18 @@ async function getFlamegraph({ core, origin }, {
197
253
  transactionName,
198
254
  statsPeriod = "7d"
199
255
  }, schema) {
200
- const query = new URLSearchParams;
256
+ const query = new URLSearchParams();
201
257
  query.set("project", projectId.toString());
202
- const escapedTransaction = transactionName.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
203
- query.set("query", `event.type:transaction transaction:"${escapedTransaction}"`);
258
+ const escapedTransaction = transactionName.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
259
+ query.set(
260
+ "query",
261
+ `event.type:transaction transaction:"${escapedTransaction}"`
262
+ );
204
263
  query.set("statsPeriod", statsPeriod);
205
- const body = await core.requestJson(origin, apiPath5`/organizations/${organizationSlug}/profiling/flamegraph/` + `?${query.toString()}`);
264
+ const body = await core.requestJson(
265
+ origin,
266
+ apiPath5`/organizations/${organizationSlug}/profiling/flamegraph/` + `?${query.toString()}`
267
+ );
206
268
  return validateResponse5(schema, body);
207
269
  }
208
270
  async function getTransactionProfile({ core, origin }, {
@@ -210,7 +272,10 @@ async function getTransactionProfile({ core, origin }, {
210
272
  projectSlugOrId,
211
273
  profileId
212
274
  }, schema) {
213
- const body = await core.requestJson(origin, apiPath5`/projects/${organizationSlug}/${projectSlugOrId}/profiling/profiles/${profileId}/`);
275
+ const body = await core.requestJson(
276
+ origin,
277
+ apiPath5`/projects/${organizationSlug}/${projectSlugOrId}/profiling/profiles/${profileId}/`
278
+ );
214
279
  return validateResponse5(schema, body);
215
280
  }
216
281
  async function getProfileChunks({ core, origin }, {
@@ -220,14 +285,18 @@ async function getProfileChunks({ core, origin }, {
220
285
  start,
221
286
  end
222
287
  }, schema) {
223
- const query = new URLSearchParams;
288
+ const query = new URLSearchParams();
224
289
  query.set("profiler_id", profilerId);
225
290
  query.set("project", projectId.toString());
226
291
  query.set("start", start);
227
292
  query.set("end", end);
228
- const body = await core.requestJson(origin, apiPath5`/organizations/${organizationSlug}/profiling/chunks/` + `?${query.toString()}`);
293
+ const body = await core.requestJson(
294
+ origin,
295
+ apiPath5`/organizations/${organizationSlug}/profiling/chunks/` + `?${query.toString()}`
296
+ );
229
297
  return validateResponse5(schema, body);
230
298
  }
299
+
231
300
  // src/api-client/endpoints/projects.ts
232
301
  import { listOrganizationProjects } from "@sentry/api";
233
302
  import {
@@ -241,20 +310,34 @@ import {
241
310
  withQuery as withQuery3
242
311
  } from "@sentry/api/client";
243
312
  async function listProjects({ core, origin }, params, schema) {
244
- const client = core.sdkClient(origin, apiPath6`/organizations/${params.organizationSlug}/projects/`);
245
- return await listPage2((perPage, cursor) => listOrganizationProjects({
246
- client,
247
- path: { organization_id_or_slug: params.organizationSlug },
248
- query: { per_page: perPage, query: params.query, cursor },
249
- throwOnError: true
250
- }), schema, params.limit ?? 25, params.cursor);
313
+ const client = core.sdkClient(
314
+ origin,
315
+ apiPath6`/organizations/${params.organizationSlug}/projects/`
316
+ );
317
+ return await listPage2(
318
+ (perPage, cursor) => listOrganizationProjects({
319
+ client,
320
+ path: { organization_id_or_slug: params.organizationSlug },
321
+ query: { per_page: perPage, query: params.query, cursor },
322
+ throwOnError: true
323
+ }),
324
+ schema,
325
+ params.limit ?? 25,
326
+ params.cursor
327
+ );
251
328
  }
252
329
  async function getProject({ core, origin }, { organizationSlug, projectSlugOrId, collapse }, schema) {
253
- const query = new URLSearchParams;
330
+ const query = new URLSearchParams();
254
331
  if (collapse) {
255
332
  query.set("collapse", collapse);
256
333
  }
257
- const body = await core.requestJson(origin, withQuery3(apiPath6`/projects/${organizationSlug}/${projectSlugOrId}/`, query));
334
+ const body = await core.requestJson(
335
+ origin,
336
+ withQuery3(
337
+ apiPath6`/projects/${organizationSlug}/${projectSlugOrId}/`,
338
+ query
339
+ )
340
+ );
258
341
  return validateResponse6(schema, body);
259
342
  }
260
343
  async function createProject({ core, origin }, { organizationSlug, teamSlug, name, slug, platform }, schema) {
@@ -265,35 +348,49 @@ async function createProject({ core, origin }, { organizationSlug, teamSlug, nam
265
348
  if (platform) {
266
349
  data.platform = platform;
267
350
  }
268
- const body = await core.requestJson(origin, apiPath6`/teams/${organizationSlug}/${teamSlug}/projects/`, { method: "POST", body: JSON.stringify(data) });
351
+ const body = await core.requestJson(
352
+ origin,
353
+ apiPath6`/teams/${organizationSlug}/${teamSlug}/projects/`,
354
+ { method: "POST", body: JSON.stringify(data) }
355
+ );
269
356
  return validateResponse6(schema, body);
270
357
  }
271
358
  async function updateProject({ core, origin }, { organizationSlug, projectSlug, name, slug, platform }, schema) {
272
359
  const data = {};
273
- if (name)
274
- data.name = name;
275
- if (slug)
276
- data.slug = slug;
277
- if (platform)
278
- data.platform = platform;
279
- const body = await core.requestJson(origin, apiPath6`/projects/${organizationSlug}/${projectSlug}/`, { method: "PUT", body: JSON.stringify(data) });
360
+ if (name) data.name = name;
361
+ if (slug) data.slug = slug;
362
+ if (platform) data.platform = platform;
363
+ const body = await core.requestJson(
364
+ origin,
365
+ apiPath6`/projects/${organizationSlug}/${projectSlug}/`,
366
+ { method: "PUT", body: JSON.stringify(data) }
367
+ );
280
368
  return validateResponse6(schema, body);
281
369
  }
282
370
  async function listProjectTeams({ core, origin }, { organizationSlug, projectSlug }, schema) {
283
- const result = await fetchAllPages(async (cursor) => {
284
- const query = new URLSearchParams;
285
- query.set("per_page", "100");
286
- if (cursor) {
287
- query.set("cursor", cursor);
288
- }
289
- const response = await core.request(origin, `${apiPath6`/projects/${organizationSlug}/${projectSlug}/teams/`}?${query.toString()}`);
290
- return {
291
- data: await readJsonResponse2(response),
292
- nextCursor: nextPageCursor2(response) ?? undefined
293
- };
294
- }, (data) => validateResponse6(schema, data), MAX_LIST_PAGES);
371
+ const result = await fetchAllPages(
372
+ async (cursor) => {
373
+ const query = new URLSearchParams();
374
+ query.set("per_page", "100");
375
+ if (cursor) {
376
+ query.set("cursor", cursor);
377
+ }
378
+ const response = await core.request(
379
+ origin,
380
+ `${apiPath6`/projects/${organizationSlug}/${projectSlug}/teams/`}?${query.toString()}`
381
+ );
382
+ return {
383
+ data: await readJsonResponse2(response),
384
+ nextCursor: nextPageCursor2(response) ?? void 0
385
+ };
386
+ },
387
+ (data) => validateResponse6(schema, data),
388
+ MAX_LIST_PAGES
389
+ );
295
390
  if (!result.ok) {
296
- throw new Error(result.reason === "page-cap" ? "API pagination exceeded its page limit" : "API returned a repeated pagination cursor");
391
+ throw new Error(
392
+ result.reason === "page-cap" ? "API pagination exceeded its page limit" : "API returned a repeated pagination cursor"
393
+ );
297
394
  }
298
395
  return result.items;
299
396
  }
@@ -302,15 +399,24 @@ async function addProjectTeam({ core, origin }, {
302
399
  projectSlug,
303
400
  teamSlug
304
401
  }) {
305
- await core.request(origin, apiPath6`/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`, { method: "POST", body: JSON.stringify({}) });
402
+ await core.request(
403
+ origin,
404
+ apiPath6`/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,
405
+ { method: "POST", body: JSON.stringify({}) }
406
+ );
306
407
  }
307
408
  async function removeProjectTeam({ core, origin }, {
308
409
  organizationSlug,
309
410
  projectSlug,
310
411
  teamSlug
311
412
  }) {
312
- await core.request(origin, apiPath6`/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`, { method: "DELETE" });
413
+ await core.request(
414
+ origin,
415
+ apiPath6`/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,
416
+ { method: "DELETE" }
417
+ );
313
418
  }
419
+
314
420
  // src/api-client/endpoints/releases.ts
315
421
  import {
316
422
  apiPath as apiPath7,
@@ -318,11 +424,11 @@ import {
318
424
  withQuery as withQuery4
319
425
  } from "@sentry/api/client";
320
426
  async function listReleases({ core, origin }, { organizationSlug, projectSlug, query, limit }, schema) {
321
- const params = new URLSearchParams;
427
+ const params = new URLSearchParams();
322
428
  if (query) {
323
429
  params.set("query", query);
324
430
  }
325
- if (limit !== undefined) {
431
+ if (limit !== void 0) {
326
432
  params.set("per_page", String(limit));
327
433
  }
328
434
  const path = projectSlug ? apiPath7`/projects/${organizationSlug}/${projectSlug}/releases/` : apiPath7`/organizations/${organizationSlug}/releases/`;
@@ -335,7 +441,7 @@ async function getRelease({ core, origin }, {
335
441
  projectSlugOrId,
336
442
  includeHealth
337
443
  }, schema) {
338
- const params = new URLSearchParams;
444
+ const params = new URLSearchParams();
339
445
  if (includeHealth) {
340
446
  params.set("health", "1");
341
447
  }
@@ -349,11 +455,14 @@ async function listReleaseDeploys({ core, origin }, {
349
455
  projectSlugOrId,
350
456
  limit
351
457
  }, schema) {
352
- const params = new URLSearchParams;
458
+ const params = new URLSearchParams();
353
459
  if (projectSlugOrId) {
354
- params.set(/^\d+$/.test(projectSlugOrId) ? "project" : "projectSlug", projectSlugOrId);
460
+ params.set(
461
+ /^\d+$/.test(projectSlugOrId) ? "project" : "projectSlug",
462
+ projectSlugOrId
463
+ );
355
464
  }
356
- if (limit !== undefined) {
465
+ if (limit !== void 0) {
357
466
  params.set("per_page", String(limit));
358
467
  }
359
468
  const path = apiPath7`/organizations/${organizationSlug}/releases/${releaseVersion}/deploys/`;
@@ -366,8 +475,8 @@ async function listReleaseCommits({ core, origin }, {
366
475
  projectSlugOrId,
367
476
  limit
368
477
  }, schema) {
369
- const params = new URLSearchParams;
370
- if (limit !== undefined) {
478
+ const params = new URLSearchParams();
479
+ if (limit !== void 0) {
371
480
  params.set("per_page", String(limit));
372
481
  }
373
482
  const path = projectSlugOrId ? apiPath7`/projects/${organizationSlug}/${projectSlugOrId}/releases/${releaseVersion}/commits/` : apiPath7`/organizations/${organizationSlug}/releases/${releaseVersion}/commits/`;
@@ -375,9 +484,13 @@ async function listReleaseCommits({ core, origin }, {
375
484
  return validateResponse7(schema, body);
376
485
  }
377
486
  async function getEventCommitters({ core, origin }, { organizationSlug, projectSlug, eventId }, schema) {
378
- const body = await core.requestJson(origin, apiPath7`/projects/${organizationSlug}/${projectSlug}/events/${eventId}/committers/`);
487
+ const body = await core.requestJson(
488
+ origin,
489
+ apiPath7`/projects/${organizationSlug}/${projectSlug}/events/${eventId}/committers/`
490
+ );
379
491
  return validateResponse7(schema, body);
380
492
  }
493
+
381
494
  // src/api-client/endpoints/replays.ts
382
495
  import {
383
496
  apiPath as apiPath8,
@@ -400,11 +513,11 @@ async function searchReplays({ core, origin }, {
400
513
  end,
401
514
  fields
402
515
  }, schema) {
403
- const params = new URLSearchParams;
516
+ const params = new URLSearchParams();
404
517
  if (query) {
405
518
  params.set("query", query);
406
519
  }
407
- if (limit !== undefined) {
520
+ if (limit !== void 0) {
408
521
  params.set("per_page", String(limit));
409
522
  }
410
523
  if (projectId) {
@@ -423,24 +536,33 @@ async function searchReplays({ core, origin }, {
423
536
  params.append("field", field);
424
537
  }
425
538
  applyTimeParams2(params, statsPeriod, start, end);
426
- const body = await core.requestJson(origin, withQuery5(apiPath8`/organizations/${organizationSlug}/replays/`, params));
539
+ const body = await core.requestJson(
540
+ origin,
541
+ withQuery5(apiPath8`/organizations/${organizationSlug}/replays/`, params)
542
+ );
427
543
  return validateResponse8(schema, body);
428
544
  }
429
545
  async function getReplay({ core, origin }, {
430
546
  organizationSlug,
431
547
  replayId
432
548
  }, schema) {
433
- const body = await core.requestJson(origin, apiPath8`/organizations/${organizationSlug}/replays/${replayId}/`);
549
+ const body = await core.requestJson(
550
+ origin,
551
+ apiPath8`/organizations/${organizationSlug}/replays/${replayId}/`
552
+ );
434
553
  return validateResponse8(schema, body);
435
554
  }
436
555
  async function listIssueReplayIds({ core, origin }, { organizationSlug, issueId, dataSource }, schema) {
437
- const params = new URLSearchParams;
556
+ const params = new URLSearchParams();
438
557
  params.set("returnIds", "true");
439
558
  params.set("query", `issue.id:[${String(issueId)}]`);
440
559
  params.set("data_source", dataSource);
441
560
  params.set("statsPeriod", "90d");
442
561
  params.append("project", "-1");
443
- const body = await core.requestJson(origin, apiPath8`/organizations/${organizationSlug}/replay-count/` + `?${params.toString()}`);
562
+ const body = await core.requestJson(
563
+ origin,
564
+ apiPath8`/organizations/${organizationSlug}/replay-count/` + `?${params.toString()}`
565
+ );
444
566
  return validateResponse8(schema, body);
445
567
  }
446
568
  async function visitReplayRecordingSegments({ core, origin }, {
@@ -452,12 +574,16 @@ async function visitReplayRecordingSegments({ core, origin }, {
452
574
  let cursor = null;
453
575
  let segmentsRead = 0;
454
576
  do {
455
- const params = new URLSearchParams;
577
+ const params = new URLSearchParams();
456
578
  params.set("per_page", String(REPLAY_SEGMENTS_PER_PAGE));
457
579
  if (cursor) {
458
580
  params.set("cursor", cursor);
459
581
  }
460
- const response = await core.request(origin, apiPath8`/projects/${organizationSlug}/${projectSlugOrId}/replays/${replayId}/recording-segments/` + `?${params.toString()}`, { method: "GET" });
582
+ const response = await core.request(
583
+ origin,
584
+ apiPath8`/projects/${organizationSlug}/${projectSlugOrId}/replays/${replayId}/recording-segments/` + `?${params.toString()}`,
585
+ { method: "GET" }
586
+ );
461
587
  const page = validateResponse8(pageSchema, await readJsonResponse3(response));
462
588
  for (const segment of page) {
463
589
  if (segmentsRead >= maxSegments) {
@@ -473,6 +599,7 @@ async function visitReplayRecordingSegments({ core, origin }, {
473
599
  } while (cursor);
474
600
  return { segmentsRead, truncated: false };
475
601
  }
602
+
476
603
  // src/api-client/endpoints/repositories.ts
477
604
  import {
478
605
  apiPath as apiPath9,
@@ -483,23 +610,33 @@ import {
483
610
  validateResponse as validateResponse9
484
611
  } from "@sentry/api/client";
485
612
  async function listRepositories({ core, origin }, { organizationSlug, query }, schema) {
486
- const result = await fetchAllPages2(async (cursor) => {
487
- const params = new URLSearchParams;
488
- params.set("per_page", "100");
489
- if (query) {
490
- params.set("query", query);
491
- }
492
- if (cursor) {
493
- params.set("cursor", cursor);
494
- }
495
- const response = await core.request(origin, `${apiPath9`/organizations/${organizationSlug}/repos/`}?${params.toString()}`, { method: "GET" });
496
- return {
497
- data: await readJsonResponse4(response),
498
- nextCursor: nextPageCursor4(response) ?? undefined
499
- };
500
- }, (data) => validateResponse9(schema, data), MAX_LIST_PAGES2);
613
+ const result = await fetchAllPages2(
614
+ async (cursor) => {
615
+ const params = new URLSearchParams();
616
+ params.set("per_page", "100");
617
+ if (query) {
618
+ params.set("query", query);
619
+ }
620
+ if (cursor) {
621
+ params.set("cursor", cursor);
622
+ }
623
+ const response = await core.request(
624
+ origin,
625
+ `${apiPath9`/organizations/${organizationSlug}/repos/`}?${params.toString()}`,
626
+ { method: "GET" }
627
+ );
628
+ return {
629
+ data: await readJsonResponse4(response),
630
+ nextCursor: nextPageCursor4(response) ?? void 0
631
+ };
632
+ },
633
+ (data) => validateResponse9(schema, data),
634
+ MAX_LIST_PAGES2
635
+ );
501
636
  if (!result.ok) {
502
- throw new Error(result.reason === "page-cap" ? "API pagination exceeded its page limit" : "API returned a repeated pagination cursor");
637
+ throw new Error(
638
+ result.reason === "page-cap" ? "API pagination exceeded its page limit" : "API returned a repeated pagination cursor"
639
+ );
503
640
  }
504
641
  return result.items;
505
642
  }
@@ -509,17 +646,22 @@ async function linkProjectRepository({ core, origin }, {
509
646
  repository,
510
647
  provider
511
648
  }, schema) {
512
- const body = await core.requestJson(origin, apiPath9`/organizations/${organizationSlug}/code-mappings/bulk/`, {
513
- method: "POST",
514
- body: JSON.stringify({
515
- project: projectSlug,
516
- repository,
517
- provider,
518
- mappings: [{ stackRoot: "", sourceRoot: "" }]
519
- })
520
- });
649
+ const body = await core.requestJson(
650
+ origin,
651
+ apiPath9`/organizations/${organizationSlug}/code-mappings/bulk/`,
652
+ {
653
+ method: "POST",
654
+ body: JSON.stringify({
655
+ project: projectSlug,
656
+ repository,
657
+ provider,
658
+ mappings: [{ stackRoot: "", sourceRoot: "" }]
659
+ })
660
+ }
661
+ );
521
662
  return validateResponse9(schema, body);
522
663
  }
664
+
523
665
  // src/api-client/endpoints/snapshots.ts
524
666
  import { apiPath as apiPath10, withQuery as withQuery6 } from "@sentry/api/client";
525
667
  async function getSnapshot({ core, origin }, {
@@ -527,18 +669,27 @@ async function getSnapshot({ core, origin }, {
527
669
  snapshotId,
528
670
  compactMetadata = true
529
671
  }) {
530
- const query = new URLSearchParams;
672
+ const query = new URLSearchParams();
531
673
  if (compactMetadata) {
532
674
  query.set("compact_metadata", "true");
533
675
  }
534
- return await core.requestJson(origin, withQuery6(apiPath10`/organizations/${organizationSlug}/preprodartifacts/snapshots/${snapshotId}/`, query));
676
+ return await core.requestJson(
677
+ origin,
678
+ withQuery6(
679
+ apiPath10`/organizations/${organizationSlug}/preprodartifacts/snapshots/${snapshotId}/`,
680
+ query
681
+ )
682
+ );
535
683
  }
536
684
  async function getSnapshotImage({ core, origin }, {
537
685
  organizationSlug,
538
686
  snapshotId,
539
687
  imageIdentifier
540
688
  }) {
541
- return await core.requestJson(origin, apiPath10`/organizations/${organizationSlug}/preprodartifacts/snapshots/${snapshotId}/images/${imageIdentifier}/`);
689
+ return await core.requestJson(
690
+ origin,
691
+ apiPath10`/organizations/${organizationSlug}/preprodartifacts/snapshots/${snapshotId}/images/${imageIdentifier}/`
692
+ );
542
693
  }
543
694
  async function getLatestBaseSnapshot({ core, origin }, {
544
695
  organizationSlug,
@@ -548,18 +699,18 @@ async function getLatestBaseSnapshot({ core, origin }, {
548
699
  projectSlug,
549
700
  compactMetadata = true
550
701
  }) {
551
- const query = new URLSearchParams;
702
+ const query = new URLSearchParams();
552
703
  query.set("app_id", appId);
553
- if (branch)
554
- query.set("branch", branch);
555
- if (project)
556
- query.set("project", project);
557
- if (projectSlug)
558
- query.set("projectSlug", projectSlug);
559
- if (compactMetadata)
560
- query.set("compact_metadata", "true");
561
- return await core.requestJson(origin, apiPath10`/organizations/${organizationSlug}/preprodartifacts/snapshots/latest-base/` + `?${query.toString()}`);
562
- }
704
+ if (branch) query.set("branch", branch);
705
+ if (project) query.set("project", project);
706
+ if (projectSlug) query.set("projectSlug", projectSlug);
707
+ if (compactMetadata) query.set("compact_metadata", "true");
708
+ return await core.requestJson(
709
+ origin,
710
+ apiPath10`/organizations/${organizationSlug}/preprodartifacts/snapshots/latest-base/` + `?${query.toString()}`
711
+ );
712
+ }
713
+
563
714
  // src/api-client/endpoints/teams.ts
564
715
  import { listOrganizationTeams } from "@sentry/api";
565
716
  import {
@@ -568,18 +719,31 @@ import {
568
719
  validateResponse as validateResponse10
569
720
  } from "@sentry/api/client";
570
721
  async function listTeams({ core, origin }, params, schema) {
571
- const client = core.sdkClient(origin, apiPath11`/organizations/${params.organizationSlug}/teams/`);
572
- return await listPage3((perPage, cursor) => listOrganizationTeams({
573
- client,
574
- path: { organization_id_or_slug: params.organizationSlug },
575
- query: { per_page: perPage, query: params.query, cursor },
576
- throwOnError: true
577
- }), schema, params.limit ?? 25, params.cursor);
722
+ const client = core.sdkClient(
723
+ origin,
724
+ apiPath11`/organizations/${params.organizationSlug}/teams/`
725
+ );
726
+ return await listPage3(
727
+ (perPage, cursor) => listOrganizationTeams({
728
+ client,
729
+ path: { organization_id_or_slug: params.organizationSlug },
730
+ query: { per_page: perPage, query: params.query, cursor },
731
+ throwOnError: true
732
+ }),
733
+ schema,
734
+ params.limit ?? 25,
735
+ params.cursor
736
+ );
578
737
  }
579
738
  async function createTeam({ core, origin }, { organizationSlug, name }, schema) {
580
- const body = await core.requestJson(origin, apiPath11`/organizations/${organizationSlug}/teams/`, { method: "POST", body: JSON.stringify({ name }) });
739
+ const body = await core.requestJson(
740
+ origin,
741
+ apiPath11`/organizations/${organizationSlug}/teams/`,
742
+ { method: "POST", body: JSON.stringify({ name }) }
743
+ );
581
744
  return validateResponse10(schema, body);
582
745
  }
746
+
583
747
  // src/api-client/endpoints/traces.ts
584
748
  import {
585
749
  apiPath as apiPath12,
@@ -587,23 +751,30 @@ import {
587
751
  } from "@sentry/api/client";
588
752
  async function getTraceMeta({ core, origin }, { organizationSlug, traceId, statsPeriod = "14d" }, schema) {
589
753
  const query = new URLSearchParams({ statsPeriod });
590
- const body = await core.requestJson(origin, apiPath12`/organizations/${organizationSlug}/trace-meta/${traceId}/` + `?${query.toString()}`);
754
+ const body = await core.requestJson(
755
+ origin,
756
+ apiPath12`/organizations/${organizationSlug}/trace-meta/${traceId}/` + `?${query.toString()}`
757
+ );
591
758
  return validateResponse11(schema, body);
592
759
  }
593
760
  async function getTrace({ core, origin }, {
594
761
  organizationSlug,
595
762
  traceId,
596
- limit = 1000,
763
+ limit = 1e3,
597
764
  project = "-1",
598
765
  statsPeriod = "14d"
599
766
  }, schema) {
600
- const query = new URLSearchParams;
767
+ const query = new URLSearchParams();
601
768
  query.set("limit", String(limit));
602
769
  query.set("project", project);
603
770
  query.set("statsPeriod", statsPeriod);
604
- const body = await core.requestJson(origin, apiPath12`/organizations/${organizationSlug}/trace/${traceId}/` + `?${query.toString()}`);
771
+ const body = await core.requestJson(
772
+ origin,
773
+ apiPath12`/organizations/${organizationSlug}/trace/${traceId}/` + `?${query.toString()}`
774
+ );
605
775
  return validateResponse11(schema, body);
606
776
  }
777
+
607
778
  // src/api-client/endpoints/uptime-monitors.ts
608
779
  import {
609
780
  apiPath as apiPath13,
@@ -621,7 +792,7 @@ async function listUptimeMonitors({ core, origin }, {
621
792
  query,
622
793
  limit
623
794
  }, schema) {
624
- const params = new URLSearchParams;
795
+ const params = new URLSearchParams();
625
796
  if (projectId) {
626
797
  params.append("project", projectId);
627
798
  }
@@ -634,10 +805,13 @@ async function listUptimeMonitors({ core, origin }, {
634
805
  if (query) {
635
806
  params.set("query", query);
636
807
  }
637
- if (limit !== undefined) {
808
+ if (limit !== void 0) {
638
809
  params.set("per_page", String(limit));
639
810
  }
640
- const body = await core.requestJson(origin, withQuery7(apiPath13`/organizations/${organizationSlug}/uptime/`, params));
811
+ const body = await core.requestJson(
812
+ origin,
813
+ withQuery7(apiPath13`/organizations/${organizationSlug}/uptime/`, params)
814
+ );
641
815
  return validateResponse12(schema, body);
642
816
  }
643
817
  function uptimeMonitorPath({
@@ -652,8 +826,8 @@ async function getUptimeMonitor({ core, origin }, params, schema) {
652
826
  return validateResponse12(schema, body);
653
827
  }
654
828
  async function listUptimeMonitorChecks({ core, origin }, params, schema) {
655
- const query = new URLSearchParams;
656
- if (params.limit !== undefined) {
829
+ const query = new URLSearchParams();
830
+ if (params.limit !== void 0) {
657
831
  query.set("per_page", String(params.limit));
658
832
  }
659
833
  const statsPeriod = defaultStatsPeriod2(params);
@@ -661,7 +835,10 @@ async function listUptimeMonitorChecks({ core, origin }, params, schema) {
661
835
  parseStatsPeriod2(statsPeriod);
662
836
  }
663
837
  applyTimeParams3(query, statsPeriod, params.start, params.end);
664
- const body = await core.requestJson(origin, withQuery7(`${uptimeMonitorPath(params)}checks/`, query));
838
+ const body = await core.requestJson(
839
+ origin,
840
+ withQuery7(`${uptimeMonitorPath(params)}checks/`, query)
841
+ );
665
842
  return validateResponse12(schema, body);
666
843
  }
667
844
  var UPTIME_MONITOR_FIELDS = [
@@ -684,7 +861,7 @@ var UPTIME_MONITOR_FIELDS = [
684
861
  function uptimeMonitorBody(fields) {
685
862
  const payload = {};
686
863
  for (const field of UPTIME_MONITOR_FIELDS) {
687
- if (fields[field] !== undefined) {
864
+ if (fields[field] !== void 0) {
688
865
  payload[field] = fields[field];
689
866
  }
690
867
  }
@@ -695,7 +872,11 @@ async function createUptimeMonitor({ core, origin }, {
695
872
  projectSlug,
696
873
  ...fields
697
874
  }, schema) {
698
- const body = await core.requestJson(origin, apiPath13`/projects/${organizationSlug}/${projectSlug}/uptime/`, { method: "POST", body: uptimeMonitorBody(fields) });
875
+ const body = await core.requestJson(
876
+ origin,
877
+ apiPath13`/projects/${organizationSlug}/${projectSlug}/uptime/`,
878
+ { method: "POST", body: uptimeMonitorBody(fields) }
879
+ );
699
880
  return validateResponse12(schema, body);
700
881
  }
701
882
  async function updateUptimeMonitor({ core, origin }, {
@@ -704,59 +885,68 @@ async function updateUptimeMonitor({ core, origin }, {
704
885
  uptimeMonitorId,
705
886
  ...fields
706
887
  }, schema) {
707
- const body = await core.requestJson(origin, uptimeMonitorPath({ organizationSlug, projectSlug, uptimeMonitorId }), { method: "PUT", body: uptimeMonitorBody(fields) });
888
+ const body = await core.requestJson(
889
+ origin,
890
+ uptimeMonitorPath({ organizationSlug, projectSlug, uptimeMonitorId }),
891
+ { method: "PUT", body: uptimeMonitorBody(fields) }
892
+ );
708
893
  return validateResponse12(schema, body);
709
894
  }
710
895
  async function deleteUptimeMonitor({ core, origin }, params) {
711
- await core.request(origin, uptimeMonitorPath(params), { method: "DELETE" }, { allowStatuses: [404] });
896
+ await core.request(
897
+ origin,
898
+ uptimeMonitorPath(params),
899
+ { method: "DELETE" },
900
+ { allowStatuses: [404] }
901
+ );
712
902
  }
713
903
  export {
714
- visitReplayRecordingSegments,
715
- updateUptimeMonitor,
716
- updateProject,
717
- updateClientKey,
718
- updateAgenticOnboardingStatus,
719
- searchReplays,
720
- removeProjectTeam,
721
- listUptimeMonitors,
722
- listUptimeMonitorChecks,
723
- listTeams,
724
- listRepositories,
725
- listReleases,
726
- listReleaseDeploys,
727
- listReleaseCommits,
728
- listProjects,
729
- listProjectTeams,
730
- listOrganizations,
731
- listMonitors,
732
- listMonitorCheckIns,
733
- listIssueReplayIds,
734
- listDashboards,
735
- listClientKeys,
736
- linkProjectRepository,
737
- getUptimeMonitor,
738
- getTransactionProfile,
739
- getTraceMeta,
740
- getTrace,
741
- getSnapshotImage,
742
- getSnapshot,
743
- getReplay,
744
- getRelease,
745
- getProject,
746
- getProfileChunks,
747
- getOrganization,
748
- getMonitorStats,
749
- getMonitor,
750
- getLatestBaseSnapshot,
751
- getFlamegraph,
752
- getEventCommitters,
753
- getDashboard,
754
- getAuthenticatedUser,
755
- deleteUptimeMonitor,
756
- deleteMonitorEnvironment,
757
- createUptimeMonitor,
758
- createTeam,
759
- createProject,
904
+ addProjectTeam,
760
905
  createClientKey,
761
- addProjectTeam
906
+ createProject,
907
+ createTeam,
908
+ createUptimeMonitor,
909
+ deleteMonitorEnvironment,
910
+ deleteUptimeMonitor,
911
+ getAuthenticatedUser,
912
+ getDashboard,
913
+ getEventCommitters,
914
+ getFlamegraph,
915
+ getLatestBaseSnapshot,
916
+ getMonitor,
917
+ getMonitorStats,
918
+ getOrganization,
919
+ getProfileChunks,
920
+ getProject,
921
+ getRelease,
922
+ getReplay,
923
+ getSnapshot,
924
+ getSnapshotImage,
925
+ getTrace,
926
+ getTraceMeta,
927
+ getTransactionProfile,
928
+ getUptimeMonitor,
929
+ linkProjectRepository,
930
+ listClientKeys,
931
+ listDashboards,
932
+ listIssueReplayIds,
933
+ listMonitorCheckIns,
934
+ listMonitors,
935
+ listOrganizations,
936
+ listProjectTeams,
937
+ listProjects,
938
+ listReleaseCommits,
939
+ listReleaseDeploys,
940
+ listReleases,
941
+ listRepositories,
942
+ listTeams,
943
+ listUptimeMonitorChecks,
944
+ listUptimeMonitors,
945
+ removeProjectTeam,
946
+ searchReplays,
947
+ updateAgenticOnboardingStatus,
948
+ updateClientKey,
949
+ updateProject,
950
+ updateUptimeMonitor,
951
+ visitReplayRecordingSegments
762
952
  };