@rustrak/client 0.19.0 → 0.19.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 +13 -0
- package/dist/generated/sdk.gen.cjs +196 -0
- package/dist/generated/sdk.gen.cjs.map +1 -1
- package/dist/generated/sdk.gen.d.cts +13 -1
- package/dist/generated/sdk.gen.d.cts.map +1 -1
- package/dist/generated/sdk.gen.d.mts +13 -1
- package/dist/generated/sdk.gen.d.mts.map +1 -1
- package/dist/generated/sdk.gen.mjs +197 -2
- package/dist/generated/sdk.gen.mjs.map +1 -1
- package/dist/generated/types.gen.d.cts +236 -0
- package/dist/generated/types.gen.d.cts.map +1 -1
- package/dist/generated/types.gen.d.mts +236 -0
- package/dist/generated/types.gen.d.mts.map +1 -1
- package/dist/generated/zod.gen.cjs +197 -0
- package/dist/generated/zod.gen.cjs.map +1 -1
- package/dist/generated/zod.gen.mjs +172 -1
- package/dist/generated/zod.gen.mjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -409,6 +409,19 @@ Every method, grouped as it hangs off the client (`client.issues.list(...)`).
|
|
|
409
409
|
|---|---|---|
|
|
410
410
|
| `schedules.preview({ body })` | `POST /api/schedules/preview` | Validates a schedule and lists its next five runs from now, so no client ever parses a crontab itself. |
|
|
411
411
|
|
|
412
|
+
### Sentry API
|
|
413
|
+
|
|
414
|
+
| Method | Endpoint | Description |
|
|
415
|
+
|---|---|---|
|
|
416
|
+
| `sentry.getIssue({ path })` | `GET /api/0/issues/{issue_id}/` | One issue with its releases and its 24h and 30d series (Sentry's `GroupDetailsEndpoint`). |
|
|
417
|
+
| `sentry.getLatestEvent({ path })` | `GET /api/0/issues/{issue_id}/events/latest/` | The issue's most recent event (Sentry's `GroupEventDetailsEndpoint`, `issues/endpoints/group_event_details.py`). |
|
|
418
|
+
| `sentry.listIssues({ path, query? })` | `GET /api/0/projects/{org_slug}/{project_slug}/issues/` | A project's issues, filtered by `query`, sorted by `sort` and paginated by `cursor` (Sentry's `ProjectGroupIndexEndpoint`, `issues/endpoints/project_group_index.py`). |
|
|
419
|
+
| `sentry.listOrganizations()` | `GET /api/0/organizations/` | The organizations the token belongs to (Sentry's `OrganizationIndexEndpoint`): always the one synthetic org. |
|
|
420
|
+
| `sentry.listProjects({ query? })` | `GET /api/0/projects/` | The projects the token can see, newest first (Sentry's `ProjectIndexEndpoint`, `core/endpoints/project_index.py`). |
|
|
421
|
+
| `sentry.listRepos({ path })` | `GET /api/0/organizations/{org_slug}/repos/` | The code repositories connected to the organization (Sentry's `OrganizationRepositoriesEndpoint`). |
|
|
422
|
+
| `sentry.openIssue({ path })` | `GET /{org_slug}/{project_slug}/issues/{issue_id}` | The issue page GitLab's "View in Sentry" opens: Sentry redirects this legacy path to the issue (`static/app/router/routes.tsx`), Rustrak to its dashboard. |
|
|
423
|
+
| `sentry.updateIssue({ path, body })` | `PUT /api/0/issues/{issue_id}/` | Sets an issue's status and returns the issue (Sentry's `GroupDetailsEndpoint.put`). |
|
|
424
|
+
|
|
412
425
|
### Sessions
|
|
413
426
|
|
|
414
427
|
| Method | Endpoint | Description |
|
|
@@ -23,6 +23,197 @@ var HeyApiRegistry = class {
|
|
|
23
23
|
this.instances.set(key ?? this.defaultKey, value);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
+
var Sentry = class extends HeyApiClient {
|
|
27
|
+
/**
|
|
28
|
+
* GET /api/0/issues/{issue_id}/
|
|
29
|
+
*
|
|
30
|
+
* One issue with its releases and its 24h and 30d series (Sentry's
|
|
31
|
+
* `GroupDetailsEndpoint`). Also served under `/groups/` and the
|
|
32
|
+
* organization-scoped paths, as Sentry does.
|
|
33
|
+
*/
|
|
34
|
+
getIssue(options) {
|
|
35
|
+
return (options.client ?? this.client).get({
|
|
36
|
+
requestValidator: async (data) => await zod.object({
|
|
37
|
+
body: zod.never().optional(),
|
|
38
|
+
path: require_zod_gen.zSentryGetIssuePath,
|
|
39
|
+
query: zod.never().optional()
|
|
40
|
+
}).parseAsync(data),
|
|
41
|
+
responseValidator: async (data) => await require_zod_gen.zSentryGetIssueResponse.parseAsync(data),
|
|
42
|
+
security: [{
|
|
43
|
+
scheme: "bearer",
|
|
44
|
+
type: "http"
|
|
45
|
+
}],
|
|
46
|
+
url: "/api/0/issues/{issue_id}/",
|
|
47
|
+
...options
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* PUT /api/0/issues/{issue_id}/
|
|
52
|
+
*
|
|
53
|
+
* Sets an issue's status and returns the issue (Sentry's
|
|
54
|
+
* `GroupDetailsEndpoint.put`). The change goes through Rustrak's own
|
|
55
|
+
* issue update, so it is recorded and mirrored like any other.
|
|
56
|
+
*/
|
|
57
|
+
updateIssue(options) {
|
|
58
|
+
return (options.client ?? this.client).put({
|
|
59
|
+
requestValidator: async (data) => await zod.object({
|
|
60
|
+
body: require_zod_gen.zSentryUpdateIssueBody,
|
|
61
|
+
path: require_zod_gen.zSentryUpdateIssuePath,
|
|
62
|
+
query: zod.never().optional()
|
|
63
|
+
}).parseAsync(data),
|
|
64
|
+
responseValidator: async (data) => await require_zod_gen.zSentryUpdateIssueResponse.parseAsync(data),
|
|
65
|
+
security: [{
|
|
66
|
+
scheme: "bearer",
|
|
67
|
+
type: "http"
|
|
68
|
+
}],
|
|
69
|
+
url: "/api/0/issues/{issue_id}/",
|
|
70
|
+
...options,
|
|
71
|
+
headers: {
|
|
72
|
+
"Content-Type": "application/json",
|
|
73
|
+
...options.headers
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* GET /api/0/issues/{issue_id}/events/latest/
|
|
79
|
+
*
|
|
80
|
+
* The issue's most recent event (Sentry's `GroupEventDetailsEndpoint`,
|
|
81
|
+
* `issues/endpoints/group_event_details.py`).
|
|
82
|
+
*/
|
|
83
|
+
getLatestEvent(options) {
|
|
84
|
+
return (options.client ?? this.client).get({
|
|
85
|
+
requestValidator: async (data) => await zod.object({
|
|
86
|
+
body: zod.never().optional(),
|
|
87
|
+
path: require_zod_gen.zSentryGetLatestEventPath,
|
|
88
|
+
query: zod.never().optional()
|
|
89
|
+
}).parseAsync(data),
|
|
90
|
+
responseValidator: async (data) => await require_zod_gen.zSentryGetLatestEventResponse.parseAsync(data),
|
|
91
|
+
security: [{
|
|
92
|
+
scheme: "bearer",
|
|
93
|
+
type: "http"
|
|
94
|
+
}],
|
|
95
|
+
url: "/api/0/issues/{issue_id}/events/latest/",
|
|
96
|
+
...options
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* GET /api/0/organizations/
|
|
101
|
+
*
|
|
102
|
+
* The organizations the token belongs to (Sentry's
|
|
103
|
+
* `OrganizationIndexEndpoint`): always the one synthetic org.
|
|
104
|
+
*/
|
|
105
|
+
listOrganizations(options) {
|
|
106
|
+
return (options?.client ?? this.client).get({
|
|
107
|
+
requestValidator: async (data) => await zod.object({
|
|
108
|
+
body: zod.never().optional(),
|
|
109
|
+
path: zod.never().optional(),
|
|
110
|
+
query: zod.never().optional()
|
|
111
|
+
}).parseAsync(data),
|
|
112
|
+
responseValidator: async (data) => await require_zod_gen.zSentryListOrganizationsResponse.parseAsync(data),
|
|
113
|
+
security: [{
|
|
114
|
+
scheme: "bearer",
|
|
115
|
+
type: "http"
|
|
116
|
+
}],
|
|
117
|
+
url: "/api/0/organizations/",
|
|
118
|
+
...options
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* GET /api/0/organizations/{org_slug}/repos/
|
|
123
|
+
*
|
|
124
|
+
* The code repositories connected to the organization (Sentry's
|
|
125
|
+
* `OrganizationRepositoriesEndpoint`). Rustrak connects none through
|
|
126
|
+
* Sentry's integrations, so the list is always empty.
|
|
127
|
+
*/
|
|
128
|
+
listRepos(options) {
|
|
129
|
+
return (options.client ?? this.client).get({
|
|
130
|
+
requestValidator: async (data) => await zod.object({
|
|
131
|
+
body: zod.never().optional(),
|
|
132
|
+
path: require_zod_gen.zSentryListReposPath,
|
|
133
|
+
query: zod.never().optional()
|
|
134
|
+
}).parseAsync(data),
|
|
135
|
+
responseValidator: async (data) => await require_zod_gen.zSentryListReposResponse.parseAsync(data),
|
|
136
|
+
security: [{
|
|
137
|
+
scheme: "bearer",
|
|
138
|
+
type: "http"
|
|
139
|
+
}],
|
|
140
|
+
url: "/api/0/organizations/{org_slug}/repos/",
|
|
141
|
+
...options
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* GET /api/0/projects/
|
|
146
|
+
*
|
|
147
|
+
* The projects the token can see, newest first (Sentry's
|
|
148
|
+
* `ProjectIndexEndpoint`, `core/endpoints/project_index.py`).
|
|
149
|
+
*/
|
|
150
|
+
listProjects(options) {
|
|
151
|
+
return (options?.client ?? this.client).get({
|
|
152
|
+
requestValidator: async (data) => await zod.object({
|
|
153
|
+
body: zod.never().optional(),
|
|
154
|
+
path: zod.never().optional(),
|
|
155
|
+
query: require_zod_gen.zSentryListProjectsQuery.optional()
|
|
156
|
+
}).parseAsync(data),
|
|
157
|
+
responseValidator: async (data) => await require_zod_gen.zSentryListProjectsResponse.parseAsync(data),
|
|
158
|
+
security: [{
|
|
159
|
+
scheme: "bearer",
|
|
160
|
+
type: "http"
|
|
161
|
+
}],
|
|
162
|
+
url: "/api/0/projects/",
|
|
163
|
+
...options
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* GET /api/0/projects/{org_slug}/{project_slug}/issues/
|
|
168
|
+
*
|
|
169
|
+
* A project's issues, filtered by `query`, sorted by `sort` and paginated
|
|
170
|
+
* by `cursor` (Sentry's `ProjectGroupIndexEndpoint`,
|
|
171
|
+
* `issues/endpoints/project_group_index.py`).
|
|
172
|
+
*/
|
|
173
|
+
listIssues(options) {
|
|
174
|
+
return (options.client ?? this.client).get({
|
|
175
|
+
requestValidator: async (data) => await zod.object({
|
|
176
|
+
body: zod.never().optional(),
|
|
177
|
+
path: require_zod_gen.zSentryListIssuesPath,
|
|
178
|
+
query: require_zod_gen.zSentryListIssuesQuery.optional()
|
|
179
|
+
}).parseAsync(data),
|
|
180
|
+
responseValidator: async (data) => await require_zod_gen.zSentryListIssuesResponse.parseAsync(data),
|
|
181
|
+
security: [{
|
|
182
|
+
scheme: "bearer",
|
|
183
|
+
type: "http"
|
|
184
|
+
}],
|
|
185
|
+
url: "/api/0/projects/{org_slug}/{project_slug}/issues/",
|
|
186
|
+
...options
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* GET /{org_slug}/{project_slug}/issues/{issue_id}/
|
|
191
|
+
*
|
|
192
|
+
* The issue page GitLab's "View in Sentry" opens: Sentry redirects this
|
|
193
|
+
* legacy path to the issue (`static/app/router/routes.tsx`), Rustrak to its
|
|
194
|
+
* dashboard. A visitor who is not signed in goes to the login page instead,
|
|
195
|
+
* so a stranger learns nothing about which issues exist.
|
|
196
|
+
*/
|
|
197
|
+
openIssue(options) {
|
|
198
|
+
return (options.client ?? this.client).get({
|
|
199
|
+
requestValidator: async (data) => await zod.object({
|
|
200
|
+
body: zod.never().optional(),
|
|
201
|
+
path: require_zod_gen.zSentryOpenIssuePath,
|
|
202
|
+
query: zod.never().optional()
|
|
203
|
+
}).parseAsync(data),
|
|
204
|
+
security: [{
|
|
205
|
+
in: "cookie",
|
|
206
|
+
name: "session",
|
|
207
|
+
type: "apiKey"
|
|
208
|
+
}, {
|
|
209
|
+
scheme: "bearer",
|
|
210
|
+
type: "http"
|
|
211
|
+
}],
|
|
212
|
+
url: "/{org_slug}/{project_slug}/issues/{issue_id}",
|
|
213
|
+
...options
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
};
|
|
26
217
|
var SourceMaps = class extends HeyApiClient {
|
|
27
218
|
/**
|
|
28
219
|
* GET /api/0/organizations/{org_slug}/
|
|
@@ -3001,6 +3192,10 @@ var Rustrak = class Rustrak extends HeyApiClient {
|
|
|
3001
3192
|
super(args);
|
|
3002
3193
|
Rustrak.__registry.set(this, args?.key);
|
|
3003
3194
|
}
|
|
3195
|
+
_sentry;
|
|
3196
|
+
get sentry() {
|
|
3197
|
+
return this._sentry ??= new Sentry({ client: this.client });
|
|
3198
|
+
}
|
|
3004
3199
|
_sourceMaps;
|
|
3005
3200
|
get sourceMaps() {
|
|
3006
3201
|
return this._sourceMaps ??= new SourceMaps({ client: this.client });
|
|
@@ -3124,6 +3319,7 @@ exports.Projects = Projects;
|
|
|
3124
3319
|
exports.Releases = Releases;
|
|
3125
3320
|
exports.Rustrak = Rustrak;
|
|
3126
3321
|
exports.Schedules = Schedules;
|
|
3322
|
+
exports.Sentry = Sentry;
|
|
3127
3323
|
exports.Sessions = Sessions;
|
|
3128
3324
|
exports.Settings = Settings;
|
|
3129
3325
|
exports.SourceMaps = SourceMaps;
|