@rustrak/client 0.21.0 → 0.22.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/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  <a href="https://bundlephobia.com/package/@rustrak/client">
16
16
  <img src="https://img.shields.io/bundlephobia/minzip/@rustrak/client?style=flat-square&label=bundle" alt="bundle size" />
17
17
  </a>
18
- <a href="https://github.com/rustrak/rustrak/blob/main/LICENSE">
18
+ <a href="https://github.com/rustrak/rustrak/blob/main/packages/client/LICENSE">
19
19
  <img src="https://img.shields.io/npm/l/@rustrak/client?style=flat-square" alt="license" />
20
20
  </a>
21
21
  <a href="https://github.com/rustrak/rustrak/actions/workflows/ci.yml">
@@ -230,6 +230,8 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
230
230
 
231
231
  | Method | Endpoint | Description |
232
232
  |---|---|---|
233
+ | `agents.conversation({ path })` | `GET /api/projects/{project_id}/agents/conversations/{conversation_id}` | Returns every AI span of a conversation's turns, oldest first, with its input and output. |
234
+ | `agents.conversations({ path, query? })` | `GET /api/projects/{project_id}/agents/conversations` | Lists conversations -- traces sharing a `gen_ai.conversation.id` -- the most recently active first. |
233
235
  | `agents.duration({ path, query? })` | `GET /api/projects/{project_id}/agents/duration` | Time-bucketed avg/p95 duration for `agent`/`ai_client` spans. |
234
236
  | `agents.environments({ path })` | `GET /api/projects/{project_id}/agents/environments` | The options the environment filter offers, read from the data rather than hardcoded — an installation may name its environments anything. |
235
237
  | `agents.modelsCalls({ path, query? })` | `GET /api/projects/{project_id}/agents/models/calls` | Top models by LLM call count (`gen_ai.operation.type:ai_client`). |
@@ -260,6 +262,7 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
260
262
  | `alertRules.create({ path, body })` | `POST /api/projects/{project_id}/alert-rules` | |
261
263
  | `alertRules.delete({ path })` | `DELETE /api/projects/{project_id}/alert-rules/{rule_id}` | |
262
264
  | `alertRules.get({ path })` | `GET /api/projects/{project_id}/alert-rules/{rule_id}` | |
265
+ | `alertRules.historyByDay({ path, query? })` | `GET /api/projects/{project_id}/alert-history/daily` | Count a project's alert deliveries per day, by outcome. |
263
266
  | `alertRules.list({ path })` | `GET /api/projects/{project_id}/alert-rules` | |
264
267
  | `alertRules.listHistory({ path, query? })` | `GET /api/projects/{project_id}/alert-history` | |
265
268
  | `alertRules.update({ path, body })` | `PATCH /api/projects/{project_id}/alert-rules/{rule_id}` | |
@@ -358,7 +361,9 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
358
361
 
359
362
  | Method | Endpoint | Description |
360
363
  |---|---|---|
361
- | `logs.list({ path, query? })` | `GET /api/projects/{project_id}/logs` | Lists logs for a project with offset-based pagination (newest first by log timestamp), optionally filtered by level/trace_id. |
364
+ | `logs.get({ path })` | `GET /api/projects/{project_id}/logs/{log_id}` | Returns one of a project's logs, wherever it falls in the list. |
365
+ | `logs.list({ path, query? })` | `GET /api/projects/{project_id}/logs` | Lists logs for a project with offset-based pagination (newest first by log timestamp), optionally filtered by level, trace id, message and window. |
366
+ | `logs.volume({ path, query? })` | `GET /api/projects/{project_id}/logs/volume` | Counts a project's logs per level over time, with the list's filters. |
362
367
 
363
368
  ### Members
364
369
 
@@ -377,6 +382,7 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
377
382
  | `monitors.get({ path })` | `GET /api/projects/{project_id}/monitors/{slug}` | |
378
383
  | `monitors.list({ path })` | `GET /api/projects/{project_id}/monitors` | |
379
384
  | `monitors.listCheckins({ path, query? })` | `GET /api/projects/{project_id}/monitors/{slug}/checkins` | |
385
+ | `monitors.stats({ path, query? })` | `GET /api/projects/{project_id}/monitor-stats` | Counts the check-ins of a project's monitors by status over a window, bucket by bucket. |
380
386
  | `monitors.update({ path, body })` | `PUT /api/projects/{project_id}/monitors/{slug}` | |
381
387
 
382
388
  ### OAuth
@@ -405,6 +411,8 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
405
411
  |---|---|---|
406
412
  | `releases.create({ path, body })` | `POST /api/0/projects/{org_slug}/{project_slug}/releases/` | Sentry-compatible release creation. |
407
413
  | `releases.finalize({ path, body })` | `PUT /api/0/projects/{org_slug}/{project_slug}/releases/{version}/` | Generic partial update (`ref`, `url`, `dateReleased`). |
414
+ | `releases.get({ path, query? })` | `GET /api/projects/{project_id}/releases/{release}` | Gets one release with its events, new issues, environments and session health. |
415
+ | `releases.list({ path, query? })` | `GET /api/projects/{project_id}/releases` | Lists a project's releases, newest first, with the events, new issues, environments and session health of each. |
408
416
  | `releases.newIssues({ path, query? })` | `GET /api/projects/{project_id}/releases/{release}/new-issues` | |
409
417
 
410
418
  ### Schedules
@@ -446,6 +454,8 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
446
454
 
447
455
  | Method | Endpoint | Description |
448
456
  |---|---|---|
457
+ | `debugFiles.assemble({ path, body })` | `POST /api/0/projects/{org_slug}/{project_slug}/files/difs/assemble/` | Assemble uploaded chunks into debug information files (ProGuard mappings, JVM source bundles). |
458
+ | `debugFiles.upload({ path, body })` | `POST /api/0/projects/{org_slug}/{project_slug}/files/dsyms/` | Upload a zip of debug information files (the path `sentry-cli upload-proguard` takes). |
449
459
  | `sourceMaps.artifactBundleAssemble({ path, body })` | `POST /api/0/organizations/{org_slug}/artifactbundle/assemble/` | |
450
460
  | `sourceMaps.chunkUpload({ path, body })` | `POST /api/0/organizations/{org_slug}/chunk-upload/` | |
451
461
  | `sourceMaps.chunkUploadCapability({ path })` | `GET /api/0/organizations/{org_slug}/chunk-upload/` | |
@@ -515,7 +525,8 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
515
525
  | `transactions.get({ path })` | `GET /api/projects/{project_id}/transactions/{transaction_id}` | Returns a single transaction with its full Sentry payload (spans, contexts, measurements, tags) for the performance detail view. |
516
526
  | `transactions.getSpans({ path })` | `GET /api/projects/{project_id}/transactions/{transaction_id}/spans` | Returns the indexed spans extracted from a transaction, ordered for the waterfall view (by start_timestamp ascending). |
517
527
  | `transactions.getStatGroup({ path, query })` | `GET /api/projects/{project_id}/transactions/stats/group` | Returns the aggregate stats for a single transaction group — a direct lookup so the summary header works regardless of how many groups the project has. |
518
- | `transactions.getStats({ path, query? })` | `GET /api/projects/{project_id}/transactions/stats` | Returns paginated aggregate performance stats (count, p50/p95/p99 latency, failure rate) grouped by transaction name + op, most frequent first. |
528
+ | `transactions.getStatGroupTimeseries({ path, query })` | `GET /api/projects/{project_id}/transactions/stats/group/timeseries` | Returns one endpoint's trend over the window, every bucket present: how often it ran and failed, and its p50 and p95. |
529
+ | `transactions.getStats({ path, query? })` | `GET /api/projects/{project_id}/transactions/stats` | Returns paginated aggregate performance stats (count, time spent, p50/p95/p99 latency, failure rate) grouped by transaction name + op, the most time spent first unless `sort` asks otherwise. |
519
530
  | `transactions.list({ path, query? })` | `GET /api/projects/{project_id}/transactions` | Lists transactions for a project with offset-based pagination (newest first). |
520
531
 
521
532
  <!-- api:end -->
@@ -537,4 +548,4 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
537
548
 
538
549
  ## License
539
550
 
540
- [GPL-3.0](https://github.com/rustrak/rustrak/blob/main/LICENSE)
551
+ [MIT](LICENSE)
@@ -344,6 +344,63 @@ var SourceMaps = class extends HeyApiClient {
344
344
  });
345
345
  }
346
346
  };
347
+ var DebugFiles = class extends HeyApiClient {
348
+ /**
349
+ * Assemble uploaded chunks into debug information files (ProGuard mappings, JVM source bundles).
350
+ *
351
+ * Sentry's `DifAssembleEndpoint`: the body maps each file's SHA-1 to its
352
+ * name, chunks and optional debug ID, and the answer maps it to its state.
353
+ */
354
+ assemble(options) {
355
+ return (options.client ?? this.client).post({
356
+ requestValidator: async (data) => await zod.object({
357
+ body: require_zod_gen.zDebugFilesAssembleBody,
358
+ path: require_zod_gen.zDebugFilesAssemblePath,
359
+ query: zod.never().optional()
360
+ }).parseAsync(data),
361
+ responseValidator: async (data) => await require_zod_gen.zDebugFilesAssembleResponse.parseAsync(data),
362
+ security: [{
363
+ scheme: "bearer",
364
+ type: "http"
365
+ }],
366
+ url: "/api/0/projects/{org_slug}/{project_slug}/files/difs/assemble/",
367
+ ...options,
368
+ headers: {
369
+ "Content-Type": "application/json",
370
+ ...options.headers
371
+ }
372
+ });
373
+ }
374
+ /**
375
+ * Upload a zip of debug information files (the path `sentry-cli upload-proguard` takes).
376
+ *
377
+ * Sentry's `DebugFilesEndpoint.post` processes the zip in the request.
378
+ * Here each file goes through the assembly worker instead, the same as a
379
+ * chunked upload, because building a ProGuard cache can take gigabytes.
380
+ * Only ProGuard mappings are recognised; other entries are skipped.
381
+ */
382
+ upload(options) {
383
+ return (options.client ?? this.client).post({
384
+ ...require_bodySerializer_gen.formDataBodySerializer,
385
+ requestValidator: async (data) => await zod.object({
386
+ body: require_zod_gen.zDebugFilesUploadBody,
387
+ path: require_zod_gen.zDebugFilesUploadPath,
388
+ query: zod.never().optional()
389
+ }).parseAsync(data),
390
+ responseValidator: async (data) => await require_zod_gen.zDebugFilesUploadResponse.parseAsync(data),
391
+ security: [{
392
+ scheme: "bearer",
393
+ type: "http"
394
+ }],
395
+ url: "/api/0/projects/{org_slug}/{project_slug}/files/dsyms/",
396
+ ...options,
397
+ headers: {
398
+ "Content-Type": null,
399
+ ...options.headers
400
+ }
401
+ });
402
+ }
403
+ };
347
404
  var Releases = class extends HeyApiClient {
348
405
  /**
349
406
  * POST /api/0/projects/{org_slug}/{project_slug}/releases/
@@ -405,6 +462,46 @@ var Releases = class extends HeyApiClient {
405
462
  });
406
463
  }
407
464
  /**
465
+ * Lists a project's releases, newest first, with the events, new issues,
466
+ * environments and session health of each.
467
+ */
468
+ list(options) {
469
+ return (options.client ?? this.client).get({
470
+ requestValidator: async (data) => await zod.object({
471
+ body: zod.never().optional(),
472
+ path: require_zod_gen.zReleasesListPath,
473
+ query: require_zod_gen.zReleasesListQuery.optional()
474
+ }).parseAsync(data),
475
+ responseValidator: async (data) => await require_zod_gen.zReleasesListResponse.parseAsync(data),
476
+ security: [{
477
+ scheme: "bearer",
478
+ type: "http"
479
+ }],
480
+ url: "/api/projects/{project_id}/releases",
481
+ ...options
482
+ });
483
+ }
484
+ /**
485
+ * Gets one release with its events, new issues, environments and session
486
+ * health.
487
+ */
488
+ get(options) {
489
+ return (options.client ?? this.client).get({
490
+ requestValidator: async (data) => await zod.object({
491
+ body: zod.never().optional(),
492
+ path: require_zod_gen.zReleasesGetPath,
493
+ query: require_zod_gen.zReleasesGetQuery.optional()
494
+ }).parseAsync(data),
495
+ responseValidator: async (data) => await require_zod_gen.zReleasesGetResponse.parseAsync(data),
496
+ security: [{
497
+ scheme: "bearer",
498
+ type: "http"
499
+ }],
500
+ url: "/api/projects/{project_id}/releases/{release}",
501
+ ...options
502
+ });
503
+ }
504
+ /**
408
505
  * GET /api/projects/{project_id}/releases/{release}/new-issues
409
506
  */
410
507
  newIssues(options) {
@@ -1189,6 +1286,46 @@ var Projects = class extends HeyApiClient {
1189
1286
  }
1190
1287
  };
1191
1288
  var Agents = class extends HeyApiClient {
1289
+ /**
1290
+ * GET /api/projects/{project_id}/agents/conversations
1291
+ * Lists conversations -- traces sharing a `gen_ai.conversation.id` -- the most recently active first.
1292
+ */
1293
+ conversations(options) {
1294
+ return (options.client ?? this.client).get({
1295
+ requestValidator: async (data) => await zod.object({
1296
+ body: zod.never().optional(),
1297
+ path: require_zod_gen.zAgentsConversationsPath,
1298
+ query: require_zod_gen.zAgentsConversationsQuery.optional()
1299
+ }).parseAsync(data),
1300
+ responseValidator: async (data) => await require_zod_gen.zAgentsConversationsResponse.parseAsync(data),
1301
+ security: [{
1302
+ scheme: "bearer",
1303
+ type: "http"
1304
+ }],
1305
+ url: "/api/projects/{project_id}/agents/conversations",
1306
+ ...options
1307
+ });
1308
+ }
1309
+ /**
1310
+ * GET /api/projects/{project_id}/agents/conversations/{conversation_id}
1311
+ * Returns every AI span of a conversation's turns, oldest first, with its input and output.
1312
+ */
1313
+ conversation(options) {
1314
+ return (options.client ?? this.client).get({
1315
+ requestValidator: async (data) => await zod.object({
1316
+ body: zod.never().optional(),
1317
+ path: require_zod_gen.zAgentsConversationPath,
1318
+ query: zod.never().optional()
1319
+ }).parseAsync(data),
1320
+ responseValidator: async (data) => await require_zod_gen.zAgentsConversationResponse.parseAsync(data),
1321
+ security: [{
1322
+ scheme: "bearer",
1323
+ type: "http"
1324
+ }],
1325
+ url: "/api/projects/{project_id}/agents/conversations/{conversation_id}",
1326
+ ...options
1327
+ });
1328
+ }
1192
1329
  /**
1193
1330
  * GET /api/projects/{project_id}/agents/duration
1194
1331
  * Time-bucketed avg/p95 duration for `agent`/`ai_client` spans.
@@ -1412,6 +1549,25 @@ var AlertRules = class extends HeyApiClient {
1412
1549
  });
1413
1550
  }
1414
1551
  /**
1552
+ * Count a project's alert deliveries per day, by outcome.
1553
+ */
1554
+ historyByDay(options) {
1555
+ return (options.client ?? this.client).get({
1556
+ requestValidator: async (data) => await zod.object({
1557
+ body: zod.never().optional(),
1558
+ path: require_zod_gen.zAlertRulesHistoryByDayPath,
1559
+ query: require_zod_gen.zAlertRulesHistoryByDayQuery.optional()
1560
+ }).parseAsync(data),
1561
+ responseValidator: async (data) => await require_zod_gen.zAlertRulesHistoryByDayResponse.parseAsync(data),
1562
+ security: [{
1563
+ scheme: "bearer",
1564
+ type: "http"
1565
+ }],
1566
+ url: "/api/projects/{project_id}/alert-history/daily",
1567
+ ...options
1568
+ });
1569
+ }
1570
+ /**
1415
1571
  * GET /api/projects/{project_id}/alert-rules
1416
1572
  */
1417
1573
  list(options) {
@@ -2066,7 +2222,7 @@ var Logs = class extends HeyApiClient {
2066
2222
  /**
2067
2223
  * GET /api/projects/{project_id}/logs
2068
2224
  * Lists logs for a project with offset-based pagination (newest first by
2069
- * log timestamp), optionally filtered by level/trace_id.
2225
+ * log timestamp), optionally filtered by level, trace id, message and window.
2070
2226
  */
2071
2227
  list(options) {
2072
2228
  return (options.client ?? this.client).get({
@@ -2084,6 +2240,46 @@ var Logs = class extends HeyApiClient {
2084
2240
  ...options
2085
2241
  });
2086
2242
  }
2243
+ /**
2244
+ * GET /api/projects/{project_id}/logs/volume
2245
+ * Counts a project's logs per level over time, with the list's filters.
2246
+ */
2247
+ volume(options) {
2248
+ return (options.client ?? this.client).get({
2249
+ requestValidator: async (data) => await zod.object({
2250
+ body: zod.never().optional(),
2251
+ path: require_zod_gen.zLogsVolumePath,
2252
+ query: require_zod_gen.zLogsVolumeQuery.optional()
2253
+ }).parseAsync(data),
2254
+ responseValidator: async (data) => await require_zod_gen.zLogsVolumeResponse.parseAsync(data),
2255
+ security: [{
2256
+ scheme: "bearer",
2257
+ type: "http"
2258
+ }],
2259
+ url: "/api/projects/{project_id}/logs/volume",
2260
+ ...options
2261
+ });
2262
+ }
2263
+ /**
2264
+ * GET /api/projects/{project_id}/logs/{log_id}
2265
+ * Returns one of a project's logs, wherever it falls in the list.
2266
+ */
2267
+ get(options) {
2268
+ return (options.client ?? this.client).get({
2269
+ requestValidator: async (data) => await zod.object({
2270
+ body: zod.never().optional(),
2271
+ path: require_zod_gen.zLogsGetPath,
2272
+ query: zod.never().optional()
2273
+ }).parseAsync(data),
2274
+ responseValidator: async (data) => await require_zod_gen.zLogsGetResponse.parseAsync(data),
2275
+ security: [{
2276
+ scheme: "bearer",
2277
+ type: "http"
2278
+ }],
2279
+ url: "/api/projects/{project_id}/logs/{log_id}",
2280
+ ...options
2281
+ });
2282
+ }
2087
2283
  };
2088
2284
  var Members = class extends HeyApiClient {
2089
2285
  /**
@@ -2149,6 +2345,26 @@ var Members = class extends HeyApiClient {
2149
2345
  }
2150
2346
  };
2151
2347
  var Monitors = class extends HeyApiClient {
2348
+ /**
2349
+ * GET /api/projects/{project_id}/monitor-stats
2350
+ * Counts the check-ins of a project's monitors by status over a window, bucket by bucket.
2351
+ */
2352
+ stats(options) {
2353
+ return (options.client ?? this.client).get({
2354
+ requestValidator: async (data) => await zod.object({
2355
+ body: zod.never().optional(),
2356
+ path: require_zod_gen.zMonitorsStatsPath,
2357
+ query: require_zod_gen.zMonitorsStatsQuery.optional()
2358
+ }).parseAsync(data),
2359
+ responseValidator: async (data) => await require_zod_gen.zMonitorsStatsResponse.parseAsync(data),
2360
+ security: [{
2361
+ scheme: "bearer",
2362
+ type: "http"
2363
+ }],
2364
+ url: "/api/projects/{project_id}/monitor-stats",
2365
+ ...options
2366
+ });
2367
+ }
2152
2368
  /**
2153
2369
  * GET /api/projects/{project_id}/monitors
2154
2370
  */
@@ -2402,8 +2618,9 @@ var Transactions = class extends HeyApiClient {
2402
2618
  }
2403
2619
  /**
2404
2620
  * GET /api/projects/{project_id}/transactions/stats
2405
- * Returns paginated aggregate performance stats (count, p50/p95/p99 latency,
2406
- * failure rate) grouped by transaction name + op, most frequent first.
2621
+ * Returns paginated aggregate performance stats (count, time spent, p50/p95/p99
2622
+ * latency, failure rate) grouped by transaction name + op, the most time spent
2623
+ * first unless `sort` asks otherwise.
2407
2624
  */
2408
2625
  getStats(options) {
2409
2626
  return (options.client ?? this.client).get({
@@ -2443,6 +2660,28 @@ var Transactions = class extends HeyApiClient {
2443
2660
  });
2444
2661
  }
2445
2662
  /**
2663
+ * Returns one endpoint's trend over the window, every bucket present:
2664
+ * how often it ran and failed, and its p50 and p95. Without a window, back
2665
+ * to its oldest call and never less than the last 24 hours, which is also
2666
+ * what an endpoint with no calls gets.
2667
+ */
2668
+ getStatGroupTimeseries(options) {
2669
+ return (options.client ?? this.client).get({
2670
+ requestValidator: async (data) => await zod.object({
2671
+ body: zod.never().optional(),
2672
+ path: require_zod_gen.zTransactionsGetStatGroupTimeseriesPath,
2673
+ query: require_zod_gen.zTransactionsGetStatGroupTimeseriesQuery
2674
+ }).parseAsync(data),
2675
+ responseValidator: async (data) => await require_zod_gen.zTransactionsGetStatGroupTimeseriesResponse.parseAsync(data),
2676
+ security: [{
2677
+ scheme: "bearer",
2678
+ type: "http"
2679
+ }],
2680
+ url: "/api/projects/{project_id}/transactions/stats/group/timeseries",
2681
+ ...options
2682
+ });
2683
+ }
2684
+ /**
2446
2685
  * GET /api/projects/{project_id}/transactions/{transaction_id}
2447
2686
  * Returns a single transaction with its full Sentry payload (spans, contexts,
2448
2687
  * measurements, tags) for the performance detail view.
@@ -3355,6 +3594,10 @@ var Rustrak = class Rustrak extends HeyApiClient {
3355
3594
  get sourceMaps() {
3356
3595
  return this._sourceMaps ??= new SourceMaps({ client: this.client });
3357
3596
  }
3597
+ _debugFiles;
3598
+ get debugFiles() {
3599
+ return this._debugFiles ??= new DebugFiles({ client: this.client });
3600
+ }
3358
3601
  _releases;
3359
3602
  get releases() {
3360
3603
  return this._releases ??= new Releases({ client: this.client });
@@ -3469,6 +3712,7 @@ exports.Agents = Agents;
3469
3712
  exports.AlertChannels = AlertChannels;
3470
3713
  exports.AlertRules = AlertRules;
3471
3714
  exports.Auth = Auth;
3715
+ exports.DebugFiles = DebugFiles;
3472
3716
  exports.Environments = Environments;
3473
3717
  exports.Events = Events;
3474
3718
  exports.Feedback = Feedback;