@deepraxis/sdk 0.1.0-dev.d939e0f → 0.1.0-dev.ec3814e
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/METHODS.md +216 -1
- package/dist/core/client.d.ts +9 -1
- package/dist/core/client.js +6 -0
- package/dist/core/transport.d.ts +5 -0
- package/dist/core/transport.js +6 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +470 -40
- package/dist/generated/sdk.gen.js +1369 -75
- package/dist/generated/types.gen.d.ts +18945 -10882
- package/dist/helpers/application-publish.d.ts +24 -4
- package/dist/helpers/application-publish.js +53 -3
- package/dist/helpers/database-count.d.ts +17 -0
- package/dist/helpers/database-count.js +11 -0
- package/dist/helpers/file-upload.d.ts +24 -0
- package/dist/helpers/file-upload.js +113 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/operations.generated.d.ts +1891 -50
- package/dist/operations.generated.js +2481 -180
- package/dist/resources.generated.d.ts +1303 -122
- package/dist/resources.generated.js +135 -0
- package/package.json +1 -1
package/METHODS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SDK methods
|
|
2
2
|
|
|
3
|
-
Generated by `bun run generate`.
|
|
3
|
+
Generated by `bun run generate`. 426 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
|
|
4
4
|
|
|
5
5
|
`always` returns an AsyncIterable; `optional` streams with `{ stream: true }`; `yes` pagination returns a Page. Only `{ data, next_cursor }` + `cursor` query contracts are automatically paginated.
|
|
6
6
|
|
|
@@ -18,12 +18,33 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
18
18
|
| retrieve | GET | `/agent/v1/agents/{agent_id}` | no | no |
|
|
19
19
|
| update | POST | `/agent/v1/agents/{agent_id}` | no | no |
|
|
20
20
|
|
|
21
|
+
### agent.agents.customers.auth.accessTokens
|
|
22
|
+
|
|
23
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| create | POST | `/agent/v1/agents/{agent_id}/customers/auth/access_tokens` | no | no |
|
|
26
|
+
| deleteCurrent | DELETE | `/agent/v1/agents/{agent_id}/customers/auth/access_tokens/current` | no | no |
|
|
27
|
+
|
|
28
|
+
### agent.agents.customers.auth.accessTokens.renew
|
|
29
|
+
|
|
30
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
31
|
+
|---|---|---|---|---|
|
|
32
|
+
| create | POST | `/agent/v1/agents/{agent_id}/customers/auth/access_tokens/renew` | no | no |
|
|
33
|
+
|
|
34
|
+
### agent.agents.customers.auth.grantCodes
|
|
35
|
+
|
|
36
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
37
|
+
|---|---|---|---|---|
|
|
38
|
+
| create | POST | `/agent/v1/agents/{agent_id}/customers/auth/grant_codes` | no | no |
|
|
39
|
+
|
|
21
40
|
### agent.agents.endUsers
|
|
22
41
|
|
|
23
42
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
24
43
|
|---|---|---|---|---|
|
|
44
|
+
| delete | DELETE | `/agent/v1/agents/{agent_id}/end_users/{external_user_id}` | no | no |
|
|
25
45
|
| list | GET | `/agent/v1/agents/{agent_id}/end_users` | no | no |
|
|
26
46
|
| retrieve | GET | `/agent/v1/agents/{agent_id}/end_users/{external_user_id}` | no | no |
|
|
47
|
+
| retrieveDeletion | GET | `/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion` | no | no |
|
|
27
48
|
|
|
28
49
|
### agent.agents.endUsers.block
|
|
29
50
|
|
|
@@ -43,10 +64,17 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
43
64
|
|---|---|---|---|---|
|
|
44
65
|
| create | POST | `/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock` | no | no |
|
|
45
66
|
|
|
67
|
+
### agent.agents.unarchive
|
|
68
|
+
|
|
69
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
70
|
+
|---|---|---|---|---|
|
|
71
|
+
| create | POST | `/agent/v1/agents/{agent_id}/unarchive` | no | no |
|
|
72
|
+
|
|
46
73
|
### agent.agents.versions
|
|
47
74
|
|
|
48
75
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
49
76
|
|---|---|---|---|---|
|
|
77
|
+
| apply | POST | `/agent/v1/agents/{agent_id}/versions/{version}/apply` | no | no |
|
|
50
78
|
| list | GET | `/agent/v1/agents/{agent_id}/versions` | no | no |
|
|
51
79
|
|
|
52
80
|
### agent.computers
|
|
@@ -74,6 +102,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
74
102
|
| list | GET | `/agent/v1/computers/{computer_id}/files` | no | no |
|
|
75
103
|
| retrieveContent | GET | `/agent/v1/computers/{computer_id}/files/content` | no | no |
|
|
76
104
|
|
|
105
|
+
### agent.computers.leases
|
|
106
|
+
|
|
107
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
108
|
+
|---|---|---|---|---|
|
|
109
|
+
| delete | DELETE | `/agent/v1/computers/{computer_id}/leases/{lease_id}` | no | no |
|
|
110
|
+
|
|
111
|
+
### agent.computers.leases.renew
|
|
112
|
+
|
|
113
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
114
|
+
|---|---|---|---|---|
|
|
115
|
+
| create | POST | `/agent/v1/computers/{computer_id}/leases/{lease_id}/renew` | no | no |
|
|
116
|
+
|
|
77
117
|
### agent.deploymentRuns
|
|
78
118
|
|
|
79
119
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -104,6 +144,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
104
144
|
|---|---|---|---|---|
|
|
105
145
|
| create | POST | `/agent/v1/deployments/{deployment_id}/unpause` | no | no |
|
|
106
146
|
|
|
147
|
+
### agent.embed
|
|
148
|
+
|
|
149
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
150
|
+
|---|---|---|---|---|
|
|
151
|
+
| retrieveAppearance | GET | `/agent/v1/embed/appearance` | no | no |
|
|
152
|
+
|
|
153
|
+
### agent.embed.exchange
|
|
154
|
+
|
|
155
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
156
|
+
|---|---|---|---|---|
|
|
157
|
+
| create | POST | `/agent/v1/embed/exchange` | no | no |
|
|
158
|
+
|
|
107
159
|
### agent.embedTokens
|
|
108
160
|
|
|
109
161
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -111,6 +163,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
111
163
|
| create | POST | `/agent/v1/embed_tokens` | no | no |
|
|
112
164
|
| list | GET | `/agent/v1/embed_tokens` | no | no |
|
|
113
165
|
|
|
166
|
+
### agent.embedTokens.anonymous
|
|
167
|
+
|
|
168
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
169
|
+
|---|---|---|---|---|
|
|
170
|
+
| create | POST | `/agent/v1/embed_tokens/anonymous` | no | no |
|
|
171
|
+
|
|
114
172
|
### agent.embedTokens.revoke
|
|
115
173
|
|
|
116
174
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -134,6 +192,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
134
192
|
| archive | POST | `/agent/v1/sessions/{session_id}/archive` | no | no |
|
|
135
193
|
| compact | POST | `/agent/v1/sessions/{session_id}/compact` | no | no |
|
|
136
194
|
| create | POST | `/agent/v1/sessions` | no | no |
|
|
195
|
+
| delete | DELETE | `/agent/v1/sessions/{session_id}` | no | no |
|
|
137
196
|
| fork | POST | `/agent/v1/sessions/{session_id}/fork` | no | no |
|
|
138
197
|
| list | GET | `/agent/v1/sessions` | no | no |
|
|
139
198
|
| retrieve | GET | `/agent/v1/sessions/{session_id}` | no | no |
|
|
@@ -199,6 +258,25 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
199
258
|
|---|---|---|---|---|
|
|
200
259
|
| list | GET | `/agent/v1/sessions/{session_id}/threads/{thread_id}/events` | no | no |
|
|
201
260
|
|
|
261
|
+
### agent.skills
|
|
262
|
+
|
|
263
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
264
|
+
|---|---|---|---|---|
|
|
265
|
+
| create | POST | `/agent/v1/skills` | no | no |
|
|
266
|
+
| delete | DELETE | `/agent/v1/skills/{skill_id}` | no | no |
|
|
267
|
+
| list | GET | `/agent/v1/skills` | no | no |
|
|
268
|
+
| retrieve | GET | `/agent/v1/skills/{skill_id}` | no | no |
|
|
269
|
+
|
|
270
|
+
### agent.skills.versions
|
|
271
|
+
|
|
272
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
273
|
+
|---|---|---|---|---|
|
|
274
|
+
| create | POST | `/agent/v1/skills/{skill_id}/versions` | no | no |
|
|
275
|
+
| delete | DELETE | `/agent/v1/skills/{skill_id}/versions/{version}` | no | no |
|
|
276
|
+
| list | GET | `/agent/v1/skills/{skill_id}/versions` | no | no |
|
|
277
|
+
| retrieve | GET | `/agent/v1/skills/{skill_id}/versions/{version}` | no | no |
|
|
278
|
+
| retrieveContent | GET | `/agent/v1/skills/{skill_id}/versions/{version}/content` | no | no |
|
|
279
|
+
|
|
202
280
|
### agent.toolsets
|
|
203
281
|
|
|
204
282
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -281,6 +359,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
281
359
|
| list | GET | `/application/v1/workers/{worker_id}/versions` | no | yes |
|
|
282
360
|
| retrieve | GET | `/application/v1/workers/{worker_id}/versions/{version_id}` | no | no |
|
|
283
361
|
|
|
362
|
+
### application.workers.versions.assets
|
|
363
|
+
|
|
364
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
365
|
+
|---|---|---|---|---|
|
|
366
|
+
| retrieveManifest | GET | `/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest` | no | no |
|
|
367
|
+
|
|
284
368
|
## automation
|
|
285
369
|
|
|
286
370
|
### automation.actions
|
|
@@ -580,6 +664,20 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
580
664
|
| retrieve | GET | `/file/v1/files/{file_id}` | no | no |
|
|
581
665
|
| retrieveContent | GET | `/file/v1/files/{file_id}/content` | no | no |
|
|
582
666
|
|
|
667
|
+
### file.uploads
|
|
668
|
+
|
|
669
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
670
|
+
|---|---|---|---|---|
|
|
671
|
+
| cancel | POST | `/file/v1/uploads/{upload_id}/cancel` | no | no |
|
|
672
|
+
| complete | POST | `/file/v1/uploads/{upload_id}/complete` | no | no |
|
|
673
|
+
| create | POST | `/file/v1/uploads` | no | no |
|
|
674
|
+
|
|
675
|
+
### file.uploads.parts
|
|
676
|
+
|
|
677
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
678
|
+
|---|---|---|---|---|
|
|
679
|
+
| create | POST | `/file/v1/uploads/{upload_id}/parts` | no | no |
|
|
680
|
+
|
|
583
681
|
## knowledge
|
|
584
682
|
|
|
585
683
|
### knowledge.vectorStores
|
|
@@ -1048,6 +1146,123 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
1048
1146
|
|---|---|---|---|---|
|
|
1049
1147
|
| create | POST | `/search/v1/search` | no | no |
|
|
1050
1148
|
|
|
1149
|
+
## ticket
|
|
1150
|
+
|
|
1151
|
+
### ticket.activity
|
|
1152
|
+
|
|
1153
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1154
|
+
|---|---|---|---|---|
|
|
1155
|
+
| retrieve | GET | `/ticket/v1/activity` | no | no |
|
|
1156
|
+
|
|
1157
|
+
### ticket.comments
|
|
1158
|
+
|
|
1159
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1160
|
+
|---|---|---|---|---|
|
|
1161
|
+
| delete | DELETE | `/ticket/v1/comments/{id}` | no | no |
|
|
1162
|
+
| retrieve | GET | `/ticket/v1/comments/{id}` | no | no |
|
|
1163
|
+
| update | PATCH | `/ticket/v1/comments/{id}` | no | no |
|
|
1164
|
+
|
|
1165
|
+
### ticket.comments.reactions
|
|
1166
|
+
|
|
1167
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1168
|
+
|---|---|---|---|---|
|
|
1169
|
+
| create | POST | `/ticket/v1/comments/{id}/reactions` | no | no |
|
|
1170
|
+
| delete | DELETE | `/ticket/v1/comments/{id}/reactions/{content}` | no | no |
|
|
1171
|
+
| list | GET | `/ticket/v1/comments/{id}/reactions` | no | no |
|
|
1172
|
+
|
|
1173
|
+
### ticket.labels
|
|
1174
|
+
|
|
1175
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1176
|
+
|---|---|---|---|---|
|
|
1177
|
+
| create | POST | `/ticket/v1/labels` | no | no |
|
|
1178
|
+
| delete | DELETE | `/ticket/v1/labels/{name}` | no | no |
|
|
1179
|
+
| list | GET | `/ticket/v1/labels` | no | no |
|
|
1180
|
+
| update | PATCH | `/ticket/v1/labels/{name}` | no | no |
|
|
1181
|
+
|
|
1182
|
+
### ticket.milestones
|
|
1183
|
+
|
|
1184
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1185
|
+
|---|---|---|---|---|
|
|
1186
|
+
| create | POST | `/ticket/v1/milestones` | no | no |
|
|
1187
|
+
| delete | DELETE | `/ticket/v1/milestones/{number}` | no | no |
|
|
1188
|
+
| list | GET | `/ticket/v1/milestones` | no | no |
|
|
1189
|
+
| retrieve | GET | `/ticket/v1/milestones/{number}` | no | no |
|
|
1190
|
+
| update | PATCH | `/ticket/v1/milestones/{number}` | no | no |
|
|
1191
|
+
|
|
1192
|
+
### ticket.repositories
|
|
1193
|
+
|
|
1194
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1195
|
+
|---|---|---|---|---|
|
|
1196
|
+
| list | GET | `/ticket/v1/repositories` | no | no |
|
|
1197
|
+
|
|
1198
|
+
### ticket.tickets
|
|
1199
|
+
|
|
1200
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1201
|
+
|---|---|---|---|---|
|
|
1202
|
+
| create | POST | `/ticket/v1/tickets` | no | no |
|
|
1203
|
+
| deleteLock | DELETE | `/ticket/v1/tickets/{number}/lock` | no | no |
|
|
1204
|
+
| list | GET | `/ticket/v1/tickets` | no | no |
|
|
1205
|
+
| retrieve | GET | `/ticket/v1/tickets/{number}` | no | no |
|
|
1206
|
+
| update | PATCH | `/ticket/v1/tickets/{number}` | no | no |
|
|
1207
|
+
| updateLock | PUT | `/ticket/v1/tickets/{number}/lock` | no | no |
|
|
1208
|
+
|
|
1209
|
+
### ticket.tickets.comments
|
|
1210
|
+
|
|
1211
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1212
|
+
|---|---|---|---|---|
|
|
1213
|
+
| create | POST | `/ticket/v1/tickets/{number}/comments` | no | no |
|
|
1214
|
+
| list | GET | `/ticket/v1/tickets/{number}/comments` | no | no |
|
|
1215
|
+
|
|
1216
|
+
### ticket.tickets.dependencies
|
|
1217
|
+
|
|
1218
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1219
|
+
|---|---|---|---|---|
|
|
1220
|
+
| retrieveBlockedBy | GET | `/ticket/v1/tickets/{number}/dependencies/blocked_by` | no | no |
|
|
1221
|
+
| retrieveBlocking | GET | `/ticket/v1/tickets/{number}/dependencies/blocking` | no | no |
|
|
1222
|
+
|
|
1223
|
+
### ticket.tickets.dependencies.blockedBy
|
|
1224
|
+
|
|
1225
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1226
|
+
|---|---|---|---|---|
|
|
1227
|
+
| create | POST | `/ticket/v1/tickets/{number}/dependencies/blocked_by` | no | no |
|
|
1228
|
+
| delete | DELETE | `/ticket/v1/tickets/{number}/dependencies/blocked_by/{n}` | no | no |
|
|
1229
|
+
|
|
1230
|
+
### ticket.tickets.events
|
|
1231
|
+
|
|
1232
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1233
|
+
|---|---|---|---|---|
|
|
1234
|
+
| list | GET | `/ticket/v1/tickets/{number}/events` | no | no |
|
|
1235
|
+
|
|
1236
|
+
### ticket.tickets.reactions
|
|
1237
|
+
|
|
1238
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1239
|
+
|---|---|---|---|---|
|
|
1240
|
+
| create | POST | `/ticket/v1/tickets/{number}/reactions` | no | no |
|
|
1241
|
+
| delete | DELETE | `/ticket/v1/tickets/{number}/reactions/{content}` | no | no |
|
|
1242
|
+
| list | GET | `/ticket/v1/tickets/{number}/reactions` | no | no |
|
|
1243
|
+
|
|
1244
|
+
### ticket.tickets.relations
|
|
1245
|
+
|
|
1246
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1247
|
+
|---|---|---|---|---|
|
|
1248
|
+
| create | POST | `/ticket/v1/tickets/{number}/relations` | no | no |
|
|
1249
|
+
| delete | DELETE | `/ticket/v1/tickets/{number}/relations/{n}` | no | no |
|
|
1250
|
+
| list | GET | `/ticket/v1/tickets/{number}/relations` | no | no |
|
|
1251
|
+
|
|
1252
|
+
### ticket.tickets.subTickets
|
|
1253
|
+
|
|
1254
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1255
|
+
|---|---|---|---|---|
|
|
1256
|
+
| create | POST | `/ticket/v1/tickets/{number}/sub_tickets` | no | no |
|
|
1257
|
+
| delete | DELETE | `/ticket/v1/tickets/{number}/sub_tickets/{child}` | no | no |
|
|
1258
|
+
| list | GET | `/ticket/v1/tickets/{number}/sub_tickets` | no | no |
|
|
1259
|
+
|
|
1260
|
+
### ticket.types
|
|
1261
|
+
|
|
1262
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1263
|
+
|---|---|---|---|---|
|
|
1264
|
+
| list | GET | `/ticket/v1/types` | no | no |
|
|
1265
|
+
|
|
1051
1266
|
## vault
|
|
1052
1267
|
|
|
1053
1268
|
### vault.authorizations
|
package/dist/core/client.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { type UploadFileOptions, type UploadedFile } from '../helpers/file-upload.js';
|
|
1
2
|
import { resourceFactories } from '../resources.generated.js';
|
|
2
3
|
import { type PraxisOptions } from './transport.js';
|
|
3
4
|
import { type PublishInput, type PublishResult } from '../helpers/application-publish.js';
|
|
5
|
+
import { type CountInput, type CountResult } from '../helpers/database-count.js';
|
|
4
6
|
type Resources = {
|
|
5
7
|
readonly [K in keyof typeof resourceFactories]: ReturnType<(typeof resourceFactories)[K]>;
|
|
6
8
|
};
|
|
7
|
-
export interface Praxis extends Omit<Resources, 'application'> {
|
|
9
|
+
export interface Praxis extends Omit<Resources, 'application' | 'database' | 'file'> {
|
|
10
|
+
readonly file: Resources['file'] & {
|
|
11
|
+
uploadFile(file: Blob | File, options: UploadFileOptions): Promise<UploadedFile>;
|
|
12
|
+
};
|
|
13
|
+
readonly database: Resources['database'] & {
|
|
14
|
+
count(input: CountInput): Promise<CountResult>;
|
|
15
|
+
};
|
|
8
16
|
readonly application: Resources['application'] & {
|
|
9
17
|
publish(input: PublishInput): Promise<PublishResult>;
|
|
10
18
|
};
|
package/dist/core/client.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import { uploadFile } from "../helpers/file-upload.js";
|
|
1
2
|
import { resourceFactories } from "../resources.generated.js";
|
|
2
3
|
import { Transport } from "./transport.js";
|
|
3
4
|
import { publish } from "../helpers/application-publish.js";
|
|
5
|
+
import { count } from "../helpers/database-count.js";
|
|
4
6
|
export class Praxis {
|
|
5
7
|
constructor(options) {
|
|
6
8
|
const transport = new Transport(options);
|
|
7
9
|
for (const [name, create] of Object.entries(resourceFactories)) {
|
|
8
10
|
const resource = create(transport);
|
|
9
11
|
// Assemble before sealing the resource property; never replace a readonly SDK resource.
|
|
12
|
+
if (name === 'file')
|
|
13
|
+
Object.assign(resource, { uploadFile: (file, options) => uploadFile(this, file, options) });
|
|
14
|
+
if (name === 'database')
|
|
15
|
+
Object.assign(resource, { count: (input) => count(transport, input) });
|
|
10
16
|
if (name === 'application')
|
|
11
17
|
Object.assign(resource, { publish: (input) => publish(this, input) });
|
|
12
18
|
Object.defineProperty(this, name, { value: resource, enumerable: true });
|
package/dist/core/transport.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare class Transport {
|
|
|
31
31
|
private validate;
|
|
32
32
|
private scope;
|
|
33
33
|
request<R>(operation: Operation, options?: InternalOptions): Promise<R>;
|
|
34
|
+
/** Internal helper access to response metadata, with the same request policy. */
|
|
35
|
+
requestWithResponse<R>(operation: Operation, options?: InternalOptions): Promise<{
|
|
36
|
+
data: R;
|
|
37
|
+
response: Response;
|
|
38
|
+
}>;
|
|
34
39
|
stream<E extends SSEEvent = SSEEvent>(operation: Operation, options?: InternalOptions): AsyncGenerator<E>;
|
|
35
40
|
}
|
|
36
41
|
export {};
|
package/dist/core/transport.js
CHANGED
|
@@ -92,9 +92,14 @@ export class Transport {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
async request(operation, options = {}) {
|
|
95
|
+
return (await this.requestWithResponse(operation, options)).data;
|
|
96
|
+
}
|
|
97
|
+
/** Internal helper access to response metadata, with the same request policy. */
|
|
98
|
+
async requestWithResponse(operation, options = {}) {
|
|
95
99
|
const scope = this.scope(options, false);
|
|
96
100
|
try {
|
|
97
|
-
|
|
101
|
+
const result = await abortable(operation(scope.options), scope.signal);
|
|
102
|
+
return { data: result.data, response: result.response };
|
|
98
103
|
}
|
|
99
104
|
finally {
|
|
100
105
|
scope.close();
|