@sentry/api 0.115.0 → 0.115.1
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/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/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/api",
|
|
3
|
-
"version": "0.115.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.115.1",
|
|
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",
|