@deepraxis/sdk 0.1.1-dev.75f07a9 → 0.1.1-dev.77dc43d
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 +45 -1
- package/dist/core/binary-operations.d.ts +3 -0
- package/dist/core/binary-operations.js +14 -0
- package/dist/core/transport.js +8 -4
- package/dist/generated/binary-operations.gen.d.ts +3 -0
- package/dist/generated/binary-operations.gen.js +14 -0
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +69 -13
- package/dist/generated/sdk.gen.js +164 -12
- package/dist/generated/types.gen.d.ts +2823 -108
- package/dist/helpers/application-publish.js +16 -2
- package/dist/helpers/browser-connect-error.d.ts +28 -0
- package/dist/helpers/browser-connect-error.js +74 -0
- package/dist/helpers/browser-connect.js +5 -33
- package/dist/operations.generated.js +363 -19
- package/dist/resources.generated.d.ts +718 -147
- package/dist/resources.generated.js +23 -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`. 854 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
|
|
|
@@ -106,6 +106,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
106
106
|
|---|---|---|---|---|
|
|
107
107
|
| list | GET | `/agent/v1/computers/{computer_id}/files` | no | no |
|
|
108
108
|
| retrieveContent | GET | `/agent/v1/computers/{computer_id}/files/content` | no | no |
|
|
109
|
+
| retrievePreview | GET | `/agent/v1/computers/{computer_id}/files/preview` | no | no |
|
|
109
110
|
|
|
110
111
|
### agent.computers.files.convert
|
|
111
112
|
|
|
@@ -220,6 +221,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
220
221
|
| send | POST | `/agent/v1/sessions/{session_id}/events` | no | no |
|
|
221
222
|
| stream | GET | `/agent/v1/sessions/{session_id}/events/stream` | always | no |
|
|
222
223
|
|
|
224
|
+
### agent.sessions.name
|
|
225
|
+
|
|
226
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
227
|
+
|---|---|---|---|---|
|
|
228
|
+
| create | POST | `/agent/v1/sessions/{session_id}/name` | no | no |
|
|
229
|
+
|
|
223
230
|
### agent.sessions.requests
|
|
224
231
|
|
|
225
232
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -1203,6 +1210,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
1203
1210
|
|
|
1204
1211
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
1205
1212
|
|---|---|---|---|---|
|
|
1213
|
+
| close | POST | `/devops/v1/pull-requests/{id}:close` | no | no |
|
|
1206
1214
|
| merge | POST | `/devops/v1/pull-requests/{id}:merge` | no | no |
|
|
1207
1215
|
| recordVerdict | POST | `/devops/v1/pull-requests/{id}:recordVerdict` | no | no |
|
|
1208
1216
|
| rerunGate | POST | `/devops/v1/pull-requests/{id}:rerunGate` | no | no |
|
|
@@ -1563,6 +1571,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
1563
1571
|
| list | GET | `/media/v1/libraries/{library_id}/understandings` | no | yes |
|
|
1564
1572
|
| retrieveFailureSummary | GET | `/media/v1/libraries/{library_id}/understandings/failure_summary` | no | no |
|
|
1565
1573
|
|
|
1574
|
+
### media.libraries.voices
|
|
1575
|
+
|
|
1576
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1577
|
+
|---|---|---|---|---|
|
|
1578
|
+
| create | POST | `/media/v1/libraries/{library_id}/voices` | no | no |
|
|
1579
|
+
|
|
1580
|
+
### media.libraries.voices.designs
|
|
1581
|
+
|
|
1582
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
1583
|
+
|---|---|---|---|---|
|
|
1584
|
+
| create | POST | `/media/v1/libraries/{library_id}/voices/designs` | no | no |
|
|
1585
|
+
|
|
1566
1586
|
### media.speech
|
|
1567
1587
|
|
|
1568
1588
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -2021,6 +2041,30 @@ Multipart request bodies expand plain objects into bracketed fields (for example
|
|
|
2021
2041
|
|---|---|---|---|---|
|
|
2022
2042
|
| retrieve | GET | `/registry/v1/packages/{package_id}` | no | no |
|
|
2023
2043
|
|
|
2044
|
+
### registry.packages.git
|
|
2045
|
+
|
|
2046
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
2047
|
+
|---|---|---|---|---|
|
|
2048
|
+
| retrieveLog | GET | `/registry/v1/packages/{package_id}/git/log` | no | no |
|
|
2049
|
+
|
|
2050
|
+
### registry.packages.git.commits
|
|
2051
|
+
|
|
2052
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
2053
|
+
|---|---|---|---|---|
|
|
2054
|
+
| retrieve | GET | `/registry/v1/packages/{package_id}/git/commits/{sha}` | no | no |
|
|
2055
|
+
|
|
2056
|
+
### registry.packages.git.files
|
|
2057
|
+
|
|
2058
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
2059
|
+
|---|---|---|---|---|
|
|
2060
|
+
| retrieve | GET | `/registry/v1/packages/{package_id}/git/files/{path}` | no | no |
|
|
2061
|
+
|
|
2062
|
+
### registry.packages.git.trees
|
|
2063
|
+
|
|
2064
|
+
| Method | HTTP | Path | Streaming | Pagination |
|
|
2065
|
+
|---|---|---|---|---|
|
|
2066
|
+
| retrieve | GET | `/registry/v1/packages/{package_id}/git/trees/{sha}` | no | no |
|
|
2067
|
+
|
|
2024
2068
|
### registry.packages.installations
|
|
2025
2069
|
|
|
2026
2070
|
| Method | HTTP | Path | Streaming | Pagination |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as sdk from "../generated/sdk.gen.js";
|
|
2
|
+
import { binaryOperations } from "../generated/binary-operations.gen.js";
|
|
3
|
+
/**
|
|
4
|
+
* The generated SDK operations whose success response the OpenAPI declares as binary bytes
|
|
5
|
+
* (generated from the spec into `binary-operations.gen.ts`). Resolved by function identity, so
|
|
6
|
+
* wrapping, renaming or minification cannot change the answer.
|
|
7
|
+
*/
|
|
8
|
+
const binary = new Set(binaryOperations
|
|
9
|
+
.map(name => sdk[name])
|
|
10
|
+
.filter((operation) => typeof operation === 'function'));
|
|
11
|
+
/** Whether this operation's 200 response is the declared bytes of the resource, not a JSON body. */
|
|
12
|
+
export function isBinaryOperation(operation) {
|
|
13
|
+
return binary.has(operation);
|
|
14
|
+
}
|
package/dist/core/transport.js
CHANGED
|
@@ -3,6 +3,7 @@ import { PraxisError, PraxisTimeoutError } from "./errors.js";
|
|
|
3
3
|
import { abortable, fetchWithRetry } from "./retry.js";
|
|
4
4
|
import { parseSSE } from "./sse.js";
|
|
5
5
|
import { resolveDefaultCredentials } from "./credentials.js";
|
|
6
|
+
import { isBinaryOperation } from "./binary-operations.js";
|
|
6
7
|
/** Our own per-call keys, beyond what the generated hey-api client accepts. */
|
|
7
8
|
const SDK_OPTION_KEYS = ['timeoutMs', 'maxRetries', 'stream', 'lastEventId'];
|
|
8
9
|
/** Every key of the generated client's per-call RequestOptions (request parts, fetch/RequestInit, serializers,
|
|
@@ -55,7 +56,7 @@ export class Transport {
|
|
|
55
56
|
if (!Number.isSafeInteger(retries) || retries < 0)
|
|
56
57
|
throw new RangeError('maxRetries must be a non-negative integer');
|
|
57
58
|
}
|
|
58
|
-
scope(options, streaming) {
|
|
59
|
+
scope(operation, options, streaming) {
|
|
59
60
|
assertKnownOptions(options);
|
|
60
61
|
const timeoutMs = options.timeoutMs ?? Math.max(this.config.timeoutMs, serverDeadlineMs(options));
|
|
61
62
|
const maxRetries = options.maxRetries ?? this.config.maxRetries;
|
|
@@ -98,7 +99,10 @@ export class Transport {
|
|
|
98
99
|
}
|
|
99
100
|
return {
|
|
100
101
|
signal,
|
|
101
|
-
|
|
102
|
+
// A binary operation is parsed as a Blob whatever the server says in Content-Type: the runtime
|
|
103
|
+
// value must match the declared `Blob | File`, and JSON bytes must survive as bytes.
|
|
104
|
+
options: { ...options, headers: Object.fromEntries(headers), client, signal, throwOnError: true, responseStyle: 'fields',
|
|
105
|
+
...(streaming ? { parseAs: 'stream' } : isBinaryOperation(operation) ? { parseAs: 'blob' } : {}) },
|
|
102
106
|
close() { clearTimeout(timer); external?.removeEventListener('abort', abort); },
|
|
103
107
|
};
|
|
104
108
|
}
|
|
@@ -107,7 +111,7 @@ export class Transport {
|
|
|
107
111
|
}
|
|
108
112
|
/** Internal helper access to response metadata, with the same request policy. */
|
|
109
113
|
async requestWithResponse(operation, options = {}) {
|
|
110
|
-
const scope = this.scope(options, false);
|
|
114
|
+
const scope = this.scope(operation, options, false);
|
|
111
115
|
try {
|
|
112
116
|
const result = await abortable(operation(scope.options), scope.signal);
|
|
113
117
|
return { data: result.data, response: result.response };
|
|
@@ -117,7 +121,7 @@ export class Transport {
|
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
async *stream(operation, options = {}) {
|
|
120
|
-
const scope = this.scope(options, true);
|
|
124
|
+
const scope = this.scope(operation, options, true);
|
|
121
125
|
try {
|
|
122
126
|
const result = await abortable(operation(scope.options), scope.signal);
|
|
123
127
|
if (!result.response.headers.get('content-type')?.split(';')[0]?.trim().toLowerCase().includes('text/event-stream')) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by scripts/resources.ts. DO NOT EDIT.
|
|
2
|
+
/** Exported SDK operations whose 2xx response the OpenAPI declares as binary bytes: the core
|
|
3
|
+
* transport resolves them to a Blob whatever the response Content-Type says. */
|
|
4
|
+
export const binaryOperations = [
|
|
5
|
+
'browserGetSessionFrame',
|
|
6
|
+
'computersFilesContent',
|
|
7
|
+
'createAudioSpeech',
|
|
8
|
+
'downloadVideoContent',
|
|
9
|
+
'fileRetrieveFileContent',
|
|
10
|
+
'registryGitFilesRetrieve',
|
|
11
|
+
'registryPackagesVersionsArchive',
|
|
12
|
+
'registryPackagesVersionsFilesRetrieve',
|
|
13
|
+
'skillsVersionsDownload',
|
|
14
|
+
];
|