@sentry/api 0.115.0 → 0.116.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 +39 -16
- package/dist/types.gen.d.ts +12 -2
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sentry/api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official, auto-generated TypeScript client for Sentry's public REST API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@sentry/api)
|
|
6
|
+
[](./LICENSE.md)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
8
|
+
## Install
|
|
10
9
|
|
|
11
10
|
```bash
|
|
12
11
|
npm install @sentry/api
|
|
@@ -14,22 +13,46 @@ npm install @sentry/api
|
|
|
14
13
|
|
|
15
14
|
## Usage
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
Pass `baseUrl` and an auth header to each call:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { listYourOrganizations } from "@sentry/api";
|
|
20
|
+
|
|
21
|
+
const { data, error } = await listYourOrganizations({
|
|
22
|
+
baseUrl: "https://sentry.io",
|
|
23
|
+
headers: { Authorization: `Bearer ${process.env.SENTRY_AUTH_TOKEN}` },
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (error) throw error;
|
|
27
|
+
console.log(data);
|
|
19
28
|
```
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
Auth tokens and base URLs (including self-hosted and region URLs) are documented at https://docs.sentry.io/api/auth/.
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
## Pagination
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
# Install dependencies
|
|
27
|
-
bun install
|
|
34
|
+
Sentry uses cursor-based pagination via `Link` headers. Use `paginateAll` to collect all pages:
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
```ts
|
|
37
|
+
import { paginateAll, listAnOrganization_sProjects } from "@sentry/api";
|
|
38
|
+
|
|
39
|
+
const projects = await paginateAll(
|
|
40
|
+
(cursor) => listAnOrganization_sProjects({
|
|
41
|
+
baseUrl: "https://sentry.io",
|
|
42
|
+
headers: { Authorization: `Bearer ${process.env.SENTRY_AUTH_TOKEN}` },
|
|
43
|
+
path: { organization_id_or_slug: "my-org" },
|
|
44
|
+
query: { cursor },
|
|
45
|
+
}),
|
|
46
|
+
"listAnOrganization_sProjects",
|
|
47
|
+
);
|
|
31
48
|
```
|
|
32
49
|
|
|
50
|
+
`unwrapPaginatedResult` and `parseSentryLinkHeader` are also exported for manual pagination.
|
|
51
|
+
|
|
52
|
+
## Schema source
|
|
53
|
+
|
|
54
|
+
The OpenAPI schema is synced from [`getsentry/sentry`](https://github.com/getsentry/sentry/tree/master/api-docs). Schema fixes belong there; build/tooling changes belong here.
|
|
55
|
+
|
|
33
56
|
## License
|
|
34
57
|
|
|
35
|
-
FSL-1.1-Apache-2.0. See [LICENSE.md](LICENSE.md)
|
|
58
|
+
FSL-1.1-Apache-2.0. See [LICENSE.md](LICENSE.md).
|
package/dist/types.gen.d.ts
CHANGED
|
@@ -20699,7 +20699,12 @@ export type ResolveAShortIdData = {
|
|
|
20699
20699
|
*/
|
|
20700
20700
|
issue_id: string;
|
|
20701
20701
|
};
|
|
20702
|
-
query?:
|
|
20702
|
+
query?: {
|
|
20703
|
+
/**
|
|
20704
|
+
* Fields to remove from the response to improve query performance.
|
|
20705
|
+
*/
|
|
20706
|
+
collapse?: Array<'base' | 'filtered' | 'lifetime' | 'stats' | 'unhandled'>;
|
|
20707
|
+
};
|
|
20703
20708
|
url: '/api/0/organizations/{organization_id_or_slug}/shortids/{issue_id}/';
|
|
20704
20709
|
};
|
|
20705
20710
|
export type ResolveAShortIdErrors = {
|
|
@@ -30739,7 +30744,12 @@ export type RetrieveAnIssueData = {
|
|
|
30739
30744
|
*/
|
|
30740
30745
|
issue_id: string;
|
|
30741
30746
|
};
|
|
30742
|
-
query?:
|
|
30747
|
+
query?: {
|
|
30748
|
+
/**
|
|
30749
|
+
* Fields to remove from the response to improve query performance.
|
|
30750
|
+
*/
|
|
30751
|
+
collapse?: Array<'stats' | 'lifetime' | 'base' | 'unhandled' | 'filtered'>;
|
|
30752
|
+
};
|
|
30743
30753
|
url: '/api/0/organizations/{organization_id_or_slug}/issues/{issue_id}/';
|
|
30744
30754
|
};
|
|
30745
30755
|
export type RetrieveAnIssueErrors = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/api",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.116.0",
|
|
4
|
+
"description": "Official auto-generated TypeScript client for the Sentry public REST API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sentry",
|
|
7
|
+
"sentry-api",
|
|
8
|
+
"openapi",
|
|
9
|
+
"typescript",
|
|
10
|
+
"api-client"
|
|
11
|
+
],
|
|
5
12
|
"license": "FSL-1.1-Apache-2.0",
|
|
6
13
|
"type": "module",
|
|
7
14
|
"module": "dist/index.js",
|