@opencode-ai/sdk 0.1.0-alpha.9 → 0.3.101
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/{internal/utils.d.mts.map → dist/gen/client/client.d.ts} +2 -1
- package/dist/gen/client/client.js +145 -0
- package/dist/gen/client/index.d.ts +7 -0
- package/dist/gen/client/index.js +4 -0
- package/dist/gen/client/types.d.ts +119 -0
- package/dist/gen/client/types.js +0 -0
- package/dist/gen/client/utils.d.ts +45 -0
- package/dist/gen/client/utils.js +284 -0
- package/dist/gen/client.gen.d.ts +12 -0
- package/dist/gen/client.gen.js +5 -0
- package/dist/gen/core/auth.d.ts +18 -0
- package/dist/gen/core/auth.js +13 -0
- package/dist/gen/core/bodySerializer.d.ts +17 -0
- package/dist/gen/core/bodySerializer.js +53 -0
- package/dist/gen/core/params.d.ts +33 -0
- package/dist/gen/core/params.js +87 -0
- package/dist/gen/core/pathSerializer.d.ts +33 -0
- package/dist/gen/core/pathSerializer.js +113 -0
- package/dist/gen/core/types.d.ts +78 -0
- package/dist/gen/core/types.js +0 -0
- package/dist/gen/sdk.gen.d.ts +149 -0
- package/dist/gen/sdk.gen.js +291 -0
- package/dist/gen/types.gen.d.ts +1308 -0
- package/dist/gen/types.gen.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/package.json +12 -134
- package/CHANGELOG.md +0 -80
- package/LICENSE +0 -201
- package/README.md +0 -352
- package/api-promise.d.mts +0 -2
- package/api-promise.d.mts.map +0 -1
- package/api-promise.d.ts +0 -2
- package/api-promise.d.ts.map +0 -1
- package/api-promise.js +0 -6
- package/api-promise.js.map +0 -1
- package/api-promise.mjs +0 -2
- package/api-promise.mjs.map +0 -1
- package/client.d.mts +0 -185
- package/client.d.mts.map +0 -1
- package/client.d.ts +0 -185
- package/client.d.ts.map +0 -1
- package/client.js +0 -459
- package/client.js.map +0 -1
- package/client.mjs +0 -455
- package/client.mjs.map +0 -1
- package/core/api-promise.d.mts +0 -46
- package/core/api-promise.d.mts.map +0 -1
- package/core/api-promise.d.ts +0 -46
- package/core/api-promise.d.ts.map +0 -1
- package/core/api-promise.js +0 -74
- package/core/api-promise.js.map +0 -1
- package/core/api-promise.mjs +0 -70
- package/core/api-promise.mjs.map +0 -1
- package/core/error.d.mts +0 -46
- package/core/error.d.mts.map +0 -1
- package/core/error.d.ts +0 -46
- package/core/error.d.ts.map +0 -1
- package/core/error.js +0 -113
- package/core/error.js.map +0 -1
- package/core/error.mjs +0 -97
- package/core/error.mjs.map +0 -1
- package/core/resource.d.mts +0 -6
- package/core/resource.d.mts.map +0 -1
- package/core/resource.d.ts +0 -6
- package/core/resource.d.ts.map +0 -1
- package/core/resource.js +0 -11
- package/core/resource.js.map +0 -1
- package/core/resource.mjs +0 -7
- package/core/resource.mjs.map +0 -1
- package/core/uploads.d.mts +0 -3
- package/core/uploads.d.mts.map +0 -1
- package/core/uploads.d.ts +0 -3
- package/core/uploads.d.ts.map +0 -1
- package/core/uploads.js +0 -6
- package/core/uploads.js.map +0 -1
- package/core/uploads.mjs +0 -2
- package/core/uploads.mjs.map +0 -1
- package/error.d.mts +0 -2
- package/error.d.mts.map +0 -1
- package/error.d.ts +0 -2
- package/error.d.ts.map +0 -1
- package/error.js +0 -6
- package/error.js.map +0 -1
- package/error.mjs +0 -2
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -6
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -6
- package/index.d.ts.map +0 -1
- package/index.js +0 -30
- package/index.js.map +0 -1
- package/index.mjs +0 -7
- package/index.mjs.map +0 -1
- package/internal/builtin-types.d.mts +0 -73
- package/internal/builtin-types.d.mts.map +0 -1
- package/internal/builtin-types.d.ts +0 -73
- package/internal/builtin-types.d.ts.map +0 -1
- package/internal/builtin-types.js +0 -4
- package/internal/builtin-types.js.map +0 -1
- package/internal/builtin-types.mjs +0 -3
- package/internal/builtin-types.mjs.map +0 -1
- package/internal/detect-platform.d.mts +0 -15
- package/internal/detect-platform.d.mts.map +0 -1
- package/internal/detect-platform.d.ts +0 -15
- package/internal/detect-platform.d.ts.map +0 -1
- package/internal/detect-platform.js +0 -162
- package/internal/detect-platform.js.map +0 -1
- package/internal/detect-platform.mjs +0 -157
- package/internal/detect-platform.mjs.map +0 -1
- package/internal/errors.d.mts +0 -3
- package/internal/errors.d.mts.map +0 -1
- package/internal/errors.d.ts +0 -3
- package/internal/errors.d.ts.map +0 -1
- package/internal/errors.js +0 -41
- package/internal/errors.js.map +0 -1
- package/internal/errors.mjs +0 -36
- package/internal/errors.mjs.map +0 -1
- package/internal/headers.d.mts +0 -20
- package/internal/headers.d.mts.map +0 -1
- package/internal/headers.d.ts +0 -20
- package/internal/headers.d.ts.map +0 -1
- package/internal/headers.js +0 -79
- package/internal/headers.js.map +0 -1
- package/internal/headers.mjs +0 -74
- package/internal/headers.mjs.map +0 -1
- package/internal/parse.d.mts +0 -12
- package/internal/parse.d.mts.map +0 -1
- package/internal/parse.d.ts +0 -12
- package/internal/parse.d.ts.map +0 -1
- package/internal/parse.js +0 -35
- package/internal/parse.js.map +0 -1
- package/internal/parse.mjs +0 -32
- package/internal/parse.mjs.map +0 -1
- package/internal/request-options.d.mts +0 -33
- package/internal/request-options.d.mts.map +0 -1
- package/internal/request-options.d.ts +0 -33
- package/internal/request-options.d.ts.map +0 -1
- package/internal/request-options.js +0 -14
- package/internal/request-options.js.map +0 -1
- package/internal/request-options.mjs +0 -10
- package/internal/request-options.mjs.map +0 -1
- package/internal/shim-types.d.mts +0 -17
- package/internal/shim-types.d.mts.map +0 -1
- package/internal/shim-types.d.ts +0 -17
- package/internal/shim-types.d.ts.map +0 -1
- package/internal/shim-types.js +0 -4
- package/internal/shim-types.js.map +0 -1
- package/internal/shim-types.mjs +0 -3
- package/internal/shim-types.mjs.map +0 -1
- package/internal/shims.d.mts +0 -20
- package/internal/shims.d.mts.map +0 -1
- package/internal/shims.d.ts +0 -20
- package/internal/shims.d.ts.map +0 -1
- package/internal/shims.js +0 -92
- package/internal/shims.js.map +0 -1
- package/internal/shims.mjs +0 -85
- package/internal/shims.mjs.map +0 -1
- package/internal/to-file.d.mts +0 -45
- package/internal/to-file.d.mts.map +0 -1
- package/internal/to-file.d.ts +0 -45
- package/internal/to-file.d.ts.map +0 -1
- package/internal/to-file.js +0 -91
- package/internal/to-file.js.map +0 -1
- package/internal/to-file.mjs +0 -88
- package/internal/to-file.mjs.map +0 -1
- package/internal/tslib.js +0 -81
- package/internal/tslib.mjs +0 -17
- package/internal/types.d.mts +0 -69
- package/internal/types.d.mts.map +0 -1
- package/internal/types.d.ts +0 -69
- package/internal/types.d.ts.map +0 -1
- package/internal/types.js +0 -4
- package/internal/types.js.map +0 -1
- package/internal/types.mjs +0 -3
- package/internal/types.mjs.map +0 -1
- package/internal/uploads.d.mts +0 -42
- package/internal/uploads.d.mts.map +0 -1
- package/internal/uploads.d.ts +0 -42
- package/internal/uploads.d.ts.map +0 -1
- package/internal/uploads.js +0 -141
- package/internal/uploads.js.map +0 -1
- package/internal/uploads.mjs +0 -131
- package/internal/uploads.mjs.map +0 -1
- package/internal/utils/base64.d.mts +0 -3
- package/internal/utils/base64.d.mts.map +0 -1
- package/internal/utils/base64.d.ts +0 -3
- package/internal/utils/base64.d.ts.map +0 -1
- package/internal/utils/base64.js +0 -38
- package/internal/utils/base64.js.map +0 -1
- package/internal/utils/base64.mjs +0 -33
- package/internal/utils/base64.mjs.map +0 -1
- package/internal/utils/bytes.d.mts +0 -4
- package/internal/utils/bytes.d.mts.map +0 -1
- package/internal/utils/bytes.d.ts +0 -4
- package/internal/utils/bytes.d.ts.map +0 -1
- package/internal/utils/bytes.js +0 -31
- package/internal/utils/bytes.js.map +0 -1
- package/internal/utils/bytes.mjs +0 -26
- package/internal/utils/bytes.mjs.map +0 -1
- package/internal/utils/env.d.mts +0 -9
- package/internal/utils/env.d.mts.map +0 -1
- package/internal/utils/env.d.ts +0 -9
- package/internal/utils/env.d.ts.map +0 -1
- package/internal/utils/env.js +0 -22
- package/internal/utils/env.js.map +0 -1
- package/internal/utils/env.mjs +0 -18
- package/internal/utils/env.mjs.map +0 -1
- package/internal/utils/log.d.mts +0 -37
- package/internal/utils/log.d.mts.map +0 -1
- package/internal/utils/log.d.ts +0 -37
- package/internal/utils/log.d.ts.map +0 -1
- package/internal/utils/log.js +0 -85
- package/internal/utils/log.js.map +0 -1
- package/internal/utils/log.mjs +0 -79
- package/internal/utils/log.mjs.map +0 -1
- package/internal/utils/path.d.mts +0 -15
- package/internal/utils/path.d.mts.map +0 -1
- package/internal/utils/path.d.ts +0 -15
- package/internal/utils/path.d.ts.map +0 -1
- package/internal/utils/path.js +0 -58
- package/internal/utils/path.js.map +0 -1
- package/internal/utils/path.mjs +0 -53
- package/internal/utils/path.mjs.map +0 -1
- package/internal/utils/sleep.d.mts +0 -2
- package/internal/utils/sleep.d.mts.map +0 -1
- package/internal/utils/sleep.d.ts +0 -2
- package/internal/utils/sleep.d.ts.map +0 -1
- package/internal/utils/sleep.js +0 -7
- package/internal/utils/sleep.js.map +0 -1
- package/internal/utils/sleep.mjs +0 -3
- package/internal/utils/sleep.mjs.map +0 -1
- package/internal/utils/uuid.d.mts +0 -5
- package/internal/utils/uuid.d.mts.map +0 -1
- package/internal/utils/uuid.d.ts +0 -5
- package/internal/utils/uuid.d.ts.map +0 -1
- package/internal/utils/uuid.js +0 -19
- package/internal/utils/uuid.js.map +0 -1
- package/internal/utils/uuid.mjs +0 -15
- package/internal/utils/uuid.mjs.map +0 -1
- package/internal/utils/values.d.mts +0 -18
- package/internal/utils/values.d.mts.map +0 -1
- package/internal/utils/values.d.ts +0 -18
- package/internal/utils/values.d.ts.map +0 -1
- package/internal/utils/values.js +0 -112
- package/internal/utils/values.js.map +0 -1
- package/internal/utils/values.mjs +0 -94
- package/internal/utils/values.mjs.map +0 -1
- package/internal/utils.d.mts +0 -7
- package/internal/utils.d.ts +0 -7
- package/internal/utils.d.ts.map +0 -1
- package/internal/utils.js +0 -11
- package/internal/utils.js.map +0 -1
- package/internal/utils.mjs +0 -8
- package/internal/utils.mjs.map +0 -1
- package/resource.d.mts +0 -2
- package/resource.d.mts.map +0 -1
- package/resource.d.ts +0 -2
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -6
- package/resource.js.map +0 -1
- package/resource.mjs +0 -2
- package/resource.mjs.map +0 -1
- package/resources/app.d.mts +0 -38
- package/resources/app.d.mts.map +0 -1
- package/resources/app.d.ts +0 -38
- package/resources/app.d.ts.map +0 -1
- package/resources/app.js +0 -21
- package/resources/app.js.map +0 -1
- package/resources/app.mjs +0 -17
- package/resources/app.mjs.map +0 -1
- package/resources/config.d.mts +0 -304
- package/resources/config.d.mts.map +0 -1
- package/resources/config.d.ts +0 -304
- package/resources/config.d.ts.map +0 -1
- package/resources/config.js +0 -21
- package/resources/config.js.map +0 -1
- package/resources/config.mjs +0 -17
- package/resources/config.mjs.map +0 -1
- package/resources/event.d.mts +0 -120
- package/resources/event.d.mts.map +0 -1
- package/resources/event.d.ts +0 -120
- package/resources/event.d.ts.map +0 -1
- package/resources/event.js +0 -15
- package/resources/event.js.map +0 -1
- package/resources/event.mjs +0 -11
- package/resources/event.mjs.map +0 -1
- package/resources/file.d.mts +0 -17
- package/resources/file.d.mts.map +0 -1
- package/resources/file.d.ts +0 -17
- package/resources/file.d.ts.map +0 -1
- package/resources/file.js +0 -15
- package/resources/file.js.map +0 -1
- package/resources/file.mjs +0 -11
- package/resources/file.mjs.map +0 -1
- package/resources/index.d.mts +0 -7
- package/resources/index.d.mts.map +0 -1
- package/resources/index.d.ts +0 -7
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -17
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -8
- package/resources/index.mjs.map +0 -1
- package/resources/session.d.mts +0 -207
- package/resources/session.d.mts.map +0 -1
- package/resources/session.d.ts +0 -207
- package/resources/session.d.ts.map +0 -1
- package/resources/session.js +0 -70
- package/resources/session.js.map +0 -1
- package/resources/session.mjs +0 -66
- package/resources/session.mjs.map +0 -1
- package/resources/shared.d.mts +0 -20
- package/resources/shared.d.mts.map +0 -1
- package/resources/shared.d.ts +0 -20
- package/resources/shared.d.ts.map +0 -1
- package/resources/shared.js +0 -4
- package/resources/shared.js.map +0 -1
- package/resources/shared.mjs +0 -3
- package/resources/shared.mjs.map +0 -1
- package/resources.d.mts +0 -2
- package/resources.d.mts.map +0 -1
- package/resources.d.ts +0 -2
- package/resources.d.ts.map +0 -1
- package/resources.js +0 -5
- package/resources.js.map +0 -1
- package/resources.mjs +0 -2
- package/resources.mjs.map +0 -1
- package/src/api-promise.ts +0 -2
- package/src/client.ts +0 -783
- package/src/core/README.md +0 -3
- package/src/core/api-promise.ts +0 -92
- package/src/core/error.ts +0 -130
- package/src/core/resource.ts +0 -11
- package/src/core/uploads.ts +0 -2
- package/src/error.ts +0 -2
- package/src/index.ts +0 -22
- package/src/internal/README.md +0 -3
- package/src/internal/builtin-types.ts +0 -93
- package/src/internal/detect-platform.ts +0 -196
- package/src/internal/errors.ts +0 -33
- package/src/internal/headers.ts +0 -97
- package/src/internal/parse.ts +0 -50
- package/src/internal/request-options.ts +0 -38
- package/src/internal/shim-types.ts +0 -26
- package/src/internal/shims.ts +0 -107
- package/src/internal/to-file.ts +0 -154
- package/src/internal/types.ts +0 -95
- package/src/internal/uploads.ts +0 -187
- package/src/internal/utils/base64.ts +0 -40
- package/src/internal/utils/bytes.ts +0 -32
- package/src/internal/utils/env.ts +0 -18
- package/src/internal/utils/log.ts +0 -126
- package/src/internal/utils/path.ts +0 -63
- package/src/internal/utils/sleep.ts +0 -3
- package/src/internal/utils/uuid.ts +0 -17
- package/src/internal/utils/values.ts +0 -105
- package/src/internal/utils.ts +0 -8
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -2
- package/src/resources/app.ts +0 -59
- package/src/resources/config.ts +0 -390
- package/src/resources/event.ts +0 -171
- package/src/resources/file.ts +0 -24
- package/src/resources/index.ts +0 -40
- package/src/resources/session.ts +0 -355
- package/src/resources/shared.ts +0 -27
- package/src/resources.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -2
- package/src/version.ts +0 -1
- package/uploads.d.mts +0 -2
- package/uploads.d.mts.map +0 -1
- package/uploads.d.ts +0 -2
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -6
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -2
- package/uploads.mjs.map +0 -1
- package/version.d.mts +0 -2
- package/version.d.mts.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer';
|
|
2
|
+
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
3
|
+
export type BodySerializer = (body: any) => any;
|
|
4
|
+
export interface QuerySerializerOptions {
|
|
5
|
+
allowReserved?: boolean;
|
|
6
|
+
array?: SerializerOptions<ArrayStyle>;
|
|
7
|
+
object?: SerializerOptions<ObjectStyle>;
|
|
8
|
+
}
|
|
9
|
+
export declare const formDataBodySerializer: {
|
|
10
|
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => FormData;
|
|
11
|
+
};
|
|
12
|
+
export declare const jsonBodySerializer: {
|
|
13
|
+
bodySerializer: <T>(body: T) => string;
|
|
14
|
+
};
|
|
15
|
+
export declare const urlSearchParamsBodySerializer: {
|
|
16
|
+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const serializeFormDataPair = (data, key, value) => {
|
|
2
|
+
if (typeof value === 'string' || value instanceof Blob) {
|
|
3
|
+
data.append(key, value);
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
data.append(key, JSON.stringify(value));
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const serializeUrlSearchParamsPair = (data, key, value) => {
|
|
10
|
+
if (typeof value === 'string') {
|
|
11
|
+
data.append(key, value);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
data.append(key, JSON.stringify(value));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export const formDataBodySerializer = {
|
|
18
|
+
bodySerializer: (body) => {
|
|
19
|
+
const data = new FormData();
|
|
20
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
21
|
+
if (value === undefined || value === null) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (Array.isArray(value)) {
|
|
25
|
+
value.forEach((v) => serializeFormDataPair(data, key, v));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
serializeFormDataPair(data, key, value);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return data;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const jsonBodySerializer = {
|
|
35
|
+
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === 'bigint' ? value.toString() : value),
|
|
36
|
+
};
|
|
37
|
+
export const urlSearchParamsBodySerializer = {
|
|
38
|
+
bodySerializer: (body) => {
|
|
39
|
+
const data = new URLSearchParams();
|
|
40
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
41
|
+
if (value === undefined || value === null) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (Array.isArray(value)) {
|
|
45
|
+
value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
serializeUrlSearchParamsPair(data, key, value);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return data.toString();
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type Slot = 'body' | 'headers' | 'path' | 'query';
|
|
2
|
+
export type Field = {
|
|
3
|
+
in: Exclude<Slot, 'body'>;
|
|
4
|
+
/**
|
|
5
|
+
* Field name. This is the name we want the user to see and use.
|
|
6
|
+
*/
|
|
7
|
+
key: string;
|
|
8
|
+
/**
|
|
9
|
+
* Field mapped name. This is the name we want to use in the request.
|
|
10
|
+
* If omitted, we use the same value as `key`.
|
|
11
|
+
*/
|
|
12
|
+
map?: string;
|
|
13
|
+
} | {
|
|
14
|
+
in: Extract<Slot, 'body'>;
|
|
15
|
+
/**
|
|
16
|
+
* Key isn't required for bodies.
|
|
17
|
+
*/
|
|
18
|
+
key?: string;
|
|
19
|
+
map?: string;
|
|
20
|
+
};
|
|
21
|
+
export interface Fields {
|
|
22
|
+
allowExtra?: Partial<Record<Slot, boolean>>;
|
|
23
|
+
args?: ReadonlyArray<Field>;
|
|
24
|
+
}
|
|
25
|
+
export type FieldsConfig = ReadonlyArray<Field | Fields>;
|
|
26
|
+
interface Params {
|
|
27
|
+
body: unknown;
|
|
28
|
+
headers: Record<string, unknown>;
|
|
29
|
+
path: Record<string, unknown>;
|
|
30
|
+
query: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export declare const buildClientParams: (args: ReadonlyArray<unknown>, fields: FieldsConfig) => Params;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const extraPrefixesMap = {
|
|
2
|
+
$body_: 'body',
|
|
3
|
+
$headers_: 'headers',
|
|
4
|
+
$path_: 'path',
|
|
5
|
+
$query_: 'query',
|
|
6
|
+
};
|
|
7
|
+
const extraPrefixes = Object.entries(extraPrefixesMap);
|
|
8
|
+
const buildKeyMap = (fields, map) => {
|
|
9
|
+
if (!map) {
|
|
10
|
+
map = new Map();
|
|
11
|
+
}
|
|
12
|
+
for (const config of fields) {
|
|
13
|
+
if ('in' in config) {
|
|
14
|
+
if (config.key) {
|
|
15
|
+
map.set(config.key, {
|
|
16
|
+
in: config.in,
|
|
17
|
+
map: config.map,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else if (config.args) {
|
|
22
|
+
buildKeyMap(config.args, map);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return map;
|
|
26
|
+
};
|
|
27
|
+
const stripEmptySlots = (params) => {
|
|
28
|
+
for (const [slot, value] of Object.entries(params)) {
|
|
29
|
+
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
30
|
+
delete params[slot];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const buildClientParams = (args, fields) => {
|
|
35
|
+
const params = {
|
|
36
|
+
body: {},
|
|
37
|
+
headers: {},
|
|
38
|
+
path: {},
|
|
39
|
+
query: {},
|
|
40
|
+
};
|
|
41
|
+
const map = buildKeyMap(fields);
|
|
42
|
+
let config;
|
|
43
|
+
for (const [index, arg] of args.entries()) {
|
|
44
|
+
if (fields[index]) {
|
|
45
|
+
config = fields[index];
|
|
46
|
+
}
|
|
47
|
+
if (!config) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if ('in' in config) {
|
|
51
|
+
if (config.key) {
|
|
52
|
+
const field = map.get(config.key);
|
|
53
|
+
const name = field.map || config.key;
|
|
54
|
+
params[field.in][name] = arg;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
params.body = arg;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
for (const [key, value] of Object.entries(arg ?? {})) {
|
|
62
|
+
const field = map.get(key);
|
|
63
|
+
if (field) {
|
|
64
|
+
const name = field.map || key;
|
|
65
|
+
params[field.in][name] = value;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
|
69
|
+
if (extra) {
|
|
70
|
+
const [prefix, slot] = extra;
|
|
71
|
+
params[slot][key.slice(prefix.length)] = value;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) {
|
|
75
|
+
if (allowed) {
|
|
76
|
+
params[slot][key] = value;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
stripEmptySlots(params);
|
|
86
|
+
return params;
|
|
87
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {
|
|
2
|
+
}
|
|
3
|
+
interface SerializePrimitiveOptions {
|
|
4
|
+
allowReserved?: boolean;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SerializerOptions<T> {
|
|
8
|
+
/**
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
explode: boolean;
|
|
12
|
+
style: T;
|
|
13
|
+
}
|
|
14
|
+
export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
15
|
+
export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
|
|
16
|
+
type MatrixStyle = 'label' | 'matrix' | 'simple';
|
|
17
|
+
export type ObjectStyle = 'form' | 'deepObject';
|
|
18
|
+
type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
|
|
19
|
+
interface SerializePrimitiveParam extends SerializePrimitiveOptions {
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "." | ";" | "," | "&";
|
|
23
|
+
export declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => "," | "|" | "%20";
|
|
24
|
+
export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "." | ";" | "," | "&";
|
|
25
|
+
export declare const serializeArrayParam: ({ allowReserved, explode, name, style, value, }: SerializeOptions<ArraySeparatorStyle> & {
|
|
26
|
+
value: unknown[];
|
|
27
|
+
}) => string;
|
|
28
|
+
export declare const serializePrimitiveParam: ({ allowReserved, name, value, }: SerializePrimitiveParam) => string;
|
|
29
|
+
export declare const serializeObjectParam: ({ allowReserved, explode, name, style, value, valueOnly, }: SerializeOptions<ObjectSeparatorStyle> & {
|
|
30
|
+
value: Record<string, unknown> | Date;
|
|
31
|
+
valueOnly?: boolean;
|
|
32
|
+
}) => string;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export const separatorArrayExplode = (style) => {
|
|
2
|
+
switch (style) {
|
|
3
|
+
case 'label':
|
|
4
|
+
return '.';
|
|
5
|
+
case 'matrix':
|
|
6
|
+
return ';';
|
|
7
|
+
case 'simple':
|
|
8
|
+
return ',';
|
|
9
|
+
default:
|
|
10
|
+
return '&';
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const separatorArrayNoExplode = (style) => {
|
|
14
|
+
switch (style) {
|
|
15
|
+
case 'form':
|
|
16
|
+
return ',';
|
|
17
|
+
case 'pipeDelimited':
|
|
18
|
+
return '|';
|
|
19
|
+
case 'spaceDelimited':
|
|
20
|
+
return '%20';
|
|
21
|
+
default:
|
|
22
|
+
return ',';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export const separatorObjectExplode = (style) => {
|
|
26
|
+
switch (style) {
|
|
27
|
+
case 'label':
|
|
28
|
+
return '.';
|
|
29
|
+
case 'matrix':
|
|
30
|
+
return ';';
|
|
31
|
+
case 'simple':
|
|
32
|
+
return ',';
|
|
33
|
+
default:
|
|
34
|
+
return '&';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export const serializeArrayParam = ({ allowReserved, explode, name, style, value, }) => {
|
|
38
|
+
if (!explode) {
|
|
39
|
+
const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
40
|
+
switch (style) {
|
|
41
|
+
case 'label':
|
|
42
|
+
return `.${joinedValues}`;
|
|
43
|
+
case 'matrix':
|
|
44
|
+
return `;${name}=${joinedValues}`;
|
|
45
|
+
case 'simple':
|
|
46
|
+
return joinedValues;
|
|
47
|
+
default:
|
|
48
|
+
return `${name}=${joinedValues}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const separator = separatorArrayExplode(style);
|
|
52
|
+
const joinedValues = value
|
|
53
|
+
.map((v) => {
|
|
54
|
+
if (style === 'label' || style === 'simple') {
|
|
55
|
+
return allowReserved ? v : encodeURIComponent(v);
|
|
56
|
+
}
|
|
57
|
+
return serializePrimitiveParam({
|
|
58
|
+
allowReserved,
|
|
59
|
+
name,
|
|
60
|
+
value: v,
|
|
61
|
+
});
|
|
62
|
+
})
|
|
63
|
+
.join(separator);
|
|
64
|
+
return style === 'label' || style === 'matrix'
|
|
65
|
+
? separator + joinedValues
|
|
66
|
+
: joinedValues;
|
|
67
|
+
};
|
|
68
|
+
export const serializePrimitiveParam = ({ allowReserved, name, value, }) => {
|
|
69
|
+
if (value === undefined || value === null) {
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
if (typeof value === 'object') {
|
|
73
|
+
throw new Error('Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.');
|
|
74
|
+
}
|
|
75
|
+
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
76
|
+
};
|
|
77
|
+
export const serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly, }) => {
|
|
78
|
+
if (value instanceof Date) {
|
|
79
|
+
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
80
|
+
}
|
|
81
|
+
if (style !== 'deepObject' && !explode) {
|
|
82
|
+
let values = [];
|
|
83
|
+
Object.entries(value).forEach(([key, v]) => {
|
|
84
|
+
values = [
|
|
85
|
+
...values,
|
|
86
|
+
key,
|
|
87
|
+
allowReserved ? v : encodeURIComponent(v),
|
|
88
|
+
];
|
|
89
|
+
});
|
|
90
|
+
const joinedValues = values.join(',');
|
|
91
|
+
switch (style) {
|
|
92
|
+
case 'form':
|
|
93
|
+
return `${name}=${joinedValues}`;
|
|
94
|
+
case 'label':
|
|
95
|
+
return `.${joinedValues}`;
|
|
96
|
+
case 'matrix':
|
|
97
|
+
return `;${name}=${joinedValues}`;
|
|
98
|
+
default:
|
|
99
|
+
return joinedValues;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const separator = separatorObjectExplode(style);
|
|
103
|
+
const joinedValues = Object.entries(value)
|
|
104
|
+
.map(([key, v]) => serializePrimitiveParam({
|
|
105
|
+
allowReserved,
|
|
106
|
+
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
|
107
|
+
value: v,
|
|
108
|
+
}))
|
|
109
|
+
.join(separator);
|
|
110
|
+
return style === 'label' || style === 'matrix'
|
|
111
|
+
? separator + joinedValues
|
|
112
|
+
: joinedValues;
|
|
113
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Auth, AuthToken } from './auth';
|
|
2
|
+
import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer';
|
|
3
|
+
export interface Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
|
|
4
|
+
/**
|
|
5
|
+
* Returns the final request URL.
|
|
6
|
+
*/
|
|
7
|
+
buildUrl: BuildUrlFn;
|
|
8
|
+
connect: MethodFn;
|
|
9
|
+
delete: MethodFn;
|
|
10
|
+
get: MethodFn;
|
|
11
|
+
getConfig: () => Config;
|
|
12
|
+
head: MethodFn;
|
|
13
|
+
options: MethodFn;
|
|
14
|
+
patch: MethodFn;
|
|
15
|
+
post: MethodFn;
|
|
16
|
+
put: MethodFn;
|
|
17
|
+
request: RequestFn;
|
|
18
|
+
setConfig: (config: Config) => Config;
|
|
19
|
+
trace: MethodFn;
|
|
20
|
+
}
|
|
21
|
+
export interface Config {
|
|
22
|
+
/**
|
|
23
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
24
|
+
* added to the request payload as defined by its `security` array.
|
|
25
|
+
*/
|
|
26
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
27
|
+
/**
|
|
28
|
+
* A function for serializing request body parameter. By default,
|
|
29
|
+
* {@link JSON.stringify()} will be used.
|
|
30
|
+
*/
|
|
31
|
+
bodySerializer?: BodySerializer | null;
|
|
32
|
+
/**
|
|
33
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
34
|
+
* `Headers` object with.
|
|
35
|
+
*
|
|
36
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
37
|
+
*/
|
|
38
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* The request method.
|
|
41
|
+
*
|
|
42
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
43
|
+
*/
|
|
44
|
+
method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
45
|
+
/**
|
|
46
|
+
* A function for serializing request query parameters. By default, arrays
|
|
47
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
48
|
+
* style, and reserved characters are percent-encoded.
|
|
49
|
+
*
|
|
50
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
51
|
+
* API function is used.
|
|
52
|
+
*
|
|
53
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
54
|
+
*/
|
|
55
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
56
|
+
/**
|
|
57
|
+
* A function validating request data. This is useful if you want to ensure
|
|
58
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
59
|
+
* the server.
|
|
60
|
+
*/
|
|
61
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
62
|
+
/**
|
|
63
|
+
* A function transforming response data before it's returned. This is useful
|
|
64
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
65
|
+
*/
|
|
66
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* A function validating response data. This is useful if you want to ensure
|
|
69
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
70
|
+
* the transformers and returned to the user.
|
|
71
|
+
*/
|
|
72
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
73
|
+
}
|
|
74
|
+
type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never] ? true : [T] extends [never | undefined] ? [undefined] extends [T] ? false : true : false;
|
|
75
|
+
export type OmitNever<T extends Record<string, unknown>> = {
|
|
76
|
+
[K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
|
|
77
|
+
};
|
|
78
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Options as ClientOptions, TDataShape, Client } from './client';
|
|
2
|
+
import type { EventSubscribeData, EventSubscribeResponses, AppGetData, AppGetResponses, AppInitData, AppInitResponses, ConfigGetData, ConfigGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionDeleteData, SessionDeleteResponses, SessionInitData, SessionInitResponses, SessionAbortData, SessionAbortResponses, SessionUnshareData, SessionUnshareResponses, SessionShareData, SessionShareResponses, SessionSummarizeData, SessionSummarizeResponses, SessionMessagesData, SessionMessagesResponses, SessionChatData, SessionChatResponses, SessionRevertData, SessionRevertResponses, SessionUnrevertData, SessionUnrevertResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppModesData, AppModesResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiOpenHelpData, TuiOpenHelpResponses } from './types.gen';
|
|
3
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
|
+
/**
|
|
5
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
6
|
+
* individual options. This might be also useful if you want to implement a
|
|
7
|
+
* custom client.
|
|
8
|
+
*/
|
|
9
|
+
client?: Client;
|
|
10
|
+
/**
|
|
11
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
12
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
13
|
+
*/
|
|
14
|
+
meta?: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
declare class _HeyApiClient {
|
|
17
|
+
protected _client: Client;
|
|
18
|
+
constructor(args?: {
|
|
19
|
+
client?: Client;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
declare class Event extends _HeyApiClient {
|
|
23
|
+
/**
|
|
24
|
+
* Get events
|
|
25
|
+
*/
|
|
26
|
+
subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>): import("./client").RequestResult<EventSubscribeResponses, unknown, ThrowOnError, "fields">;
|
|
27
|
+
}
|
|
28
|
+
declare class App extends _HeyApiClient {
|
|
29
|
+
/**
|
|
30
|
+
* Get app info
|
|
31
|
+
*/
|
|
32
|
+
get<ThrowOnError extends boolean = false>(options?: Options<AppGetData, ThrowOnError>): import("./client").RequestResult<AppGetResponses, unknown, ThrowOnError, "fields">;
|
|
33
|
+
/**
|
|
34
|
+
* Initialize the app
|
|
35
|
+
*/
|
|
36
|
+
init<ThrowOnError extends boolean = false>(options?: Options<AppInitData, ThrowOnError>): import("./client").RequestResult<AppInitResponses, unknown, ThrowOnError, "fields">;
|
|
37
|
+
/**
|
|
38
|
+
* Write a log entry to the server logs
|
|
39
|
+
*/
|
|
40
|
+
log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>): import("./client").RequestResult<AppLogResponses, unknown, ThrowOnError, "fields">;
|
|
41
|
+
/**
|
|
42
|
+
* List all modes
|
|
43
|
+
*/
|
|
44
|
+
modes<ThrowOnError extends boolean = false>(options?: Options<AppModesData, ThrowOnError>): import("./client").RequestResult<AppModesResponses, unknown, ThrowOnError, "fields">;
|
|
45
|
+
}
|
|
46
|
+
declare class Config extends _HeyApiClient {
|
|
47
|
+
/**
|
|
48
|
+
* Get config info
|
|
49
|
+
*/
|
|
50
|
+
get<ThrowOnError extends boolean = false>(options?: Options<ConfigGetData, ThrowOnError>): import("./client").RequestResult<ConfigGetResponses, unknown, ThrowOnError, "fields">;
|
|
51
|
+
/**
|
|
52
|
+
* List all providers
|
|
53
|
+
*/
|
|
54
|
+
providers<ThrowOnError extends boolean = false>(options?: Options<ConfigProvidersData, ThrowOnError>): import("./client").RequestResult<ConfigProvidersResponses, unknown, ThrowOnError, "fields">;
|
|
55
|
+
}
|
|
56
|
+
declare class Session extends _HeyApiClient {
|
|
57
|
+
/**
|
|
58
|
+
* List all sessions
|
|
59
|
+
*/
|
|
60
|
+
list<ThrowOnError extends boolean = false>(options?: Options<SessionListData, ThrowOnError>): import("./client").RequestResult<SessionListResponses, unknown, ThrowOnError, "fields">;
|
|
61
|
+
/**
|
|
62
|
+
* Create a new session
|
|
63
|
+
*/
|
|
64
|
+
create<ThrowOnError extends boolean = false>(options?: Options<SessionCreateData, ThrowOnError>): import("./client").RequestResult<SessionCreateResponses, SessionCreateErrors, ThrowOnError, "fields">;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a session and all its data
|
|
67
|
+
*/
|
|
68
|
+
delete<ThrowOnError extends boolean = false>(options: Options<SessionDeleteData, ThrowOnError>): import("./client").RequestResult<SessionDeleteResponses, unknown, ThrowOnError, "fields">;
|
|
69
|
+
/**
|
|
70
|
+
* Analyze the app and create an AGENTS.md file
|
|
71
|
+
*/
|
|
72
|
+
init<ThrowOnError extends boolean = false>(options: Options<SessionInitData, ThrowOnError>): import("./client").RequestResult<SessionInitResponses, unknown, ThrowOnError, "fields">;
|
|
73
|
+
/**
|
|
74
|
+
* Abort a session
|
|
75
|
+
*/
|
|
76
|
+
abort<ThrowOnError extends boolean = false>(options: Options<SessionAbortData, ThrowOnError>): import("./client").RequestResult<SessionAbortResponses, unknown, ThrowOnError, "fields">;
|
|
77
|
+
/**
|
|
78
|
+
* Unshare the session
|
|
79
|
+
*/
|
|
80
|
+
unshare<ThrowOnError extends boolean = false>(options: Options<SessionUnshareData, ThrowOnError>): import("./client").RequestResult<SessionUnshareResponses, unknown, ThrowOnError, "fields">;
|
|
81
|
+
/**
|
|
82
|
+
* Share a session
|
|
83
|
+
*/
|
|
84
|
+
share<ThrowOnError extends boolean = false>(options: Options<SessionShareData, ThrowOnError>): import("./client").RequestResult<SessionShareResponses, unknown, ThrowOnError, "fields">;
|
|
85
|
+
/**
|
|
86
|
+
* Summarize the session
|
|
87
|
+
*/
|
|
88
|
+
summarize<ThrowOnError extends boolean = false>(options: Options<SessionSummarizeData, ThrowOnError>): import("./client").RequestResult<SessionSummarizeResponses, unknown, ThrowOnError, "fields">;
|
|
89
|
+
/**
|
|
90
|
+
* List messages for a session
|
|
91
|
+
*/
|
|
92
|
+
messages<ThrowOnError extends boolean = false>(options: Options<SessionMessagesData, ThrowOnError>): import("./client").RequestResult<SessionMessagesResponses, unknown, ThrowOnError, "fields">;
|
|
93
|
+
/**
|
|
94
|
+
* Create and send a new message to a session
|
|
95
|
+
*/
|
|
96
|
+
chat<ThrowOnError extends boolean = false>(options: Options<SessionChatData, ThrowOnError>): import("./client").RequestResult<SessionChatResponses, unknown, ThrowOnError, "fields">;
|
|
97
|
+
/**
|
|
98
|
+
* Revert a message
|
|
99
|
+
*/
|
|
100
|
+
revert<ThrowOnError extends boolean = false>(options: Options<SessionRevertData, ThrowOnError>): import("./client").RequestResult<SessionRevertResponses, unknown, ThrowOnError, "fields">;
|
|
101
|
+
/**
|
|
102
|
+
* Restore all reverted messages
|
|
103
|
+
*/
|
|
104
|
+
unrevert<ThrowOnError extends boolean = false>(options: Options<SessionUnrevertData, ThrowOnError>): import("./client").RequestResult<SessionUnrevertResponses, unknown, ThrowOnError, "fields">;
|
|
105
|
+
}
|
|
106
|
+
declare class Find extends _HeyApiClient {
|
|
107
|
+
/**
|
|
108
|
+
* Find text in files
|
|
109
|
+
*/
|
|
110
|
+
text<ThrowOnError extends boolean = false>(options: Options<FindTextData, ThrowOnError>): import("./client").RequestResult<FindTextResponses, unknown, ThrowOnError, "fields">;
|
|
111
|
+
/**
|
|
112
|
+
* Find files
|
|
113
|
+
*/
|
|
114
|
+
files<ThrowOnError extends boolean = false>(options: Options<FindFilesData, ThrowOnError>): import("./client").RequestResult<FindFilesResponses, unknown, ThrowOnError, "fields">;
|
|
115
|
+
/**
|
|
116
|
+
* Find workspace symbols
|
|
117
|
+
*/
|
|
118
|
+
symbols<ThrowOnError extends boolean = false>(options: Options<FindSymbolsData, ThrowOnError>): import("./client").RequestResult<FindSymbolsResponses, unknown, ThrowOnError, "fields">;
|
|
119
|
+
}
|
|
120
|
+
declare class File extends _HeyApiClient {
|
|
121
|
+
/**
|
|
122
|
+
* Read a file
|
|
123
|
+
*/
|
|
124
|
+
read<ThrowOnError extends boolean = false>(options: Options<FileReadData, ThrowOnError>): import("./client").RequestResult<FileReadResponses, unknown, ThrowOnError, "fields">;
|
|
125
|
+
/**
|
|
126
|
+
* Get file status
|
|
127
|
+
*/
|
|
128
|
+
status<ThrowOnError extends boolean = false>(options?: Options<FileStatusData, ThrowOnError>): import("./client").RequestResult<FileStatusResponses, unknown, ThrowOnError, "fields">;
|
|
129
|
+
}
|
|
130
|
+
declare class Tui extends _HeyApiClient {
|
|
131
|
+
/**
|
|
132
|
+
* Append prompt to the TUI
|
|
133
|
+
*/
|
|
134
|
+
appendPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiAppendPromptData, ThrowOnError>): import("./client").RequestResult<TuiAppendPromptResponses, unknown, ThrowOnError, "fields">;
|
|
135
|
+
/**
|
|
136
|
+
* Open the help dialog
|
|
137
|
+
*/
|
|
138
|
+
openHelp<ThrowOnError extends boolean = false>(options?: Options<TuiOpenHelpData, ThrowOnError>): import("./client").RequestResult<TuiOpenHelpResponses, unknown, ThrowOnError, "fields">;
|
|
139
|
+
}
|
|
140
|
+
export declare class OpencodeClient extends _HeyApiClient {
|
|
141
|
+
event: Event;
|
|
142
|
+
app: App;
|
|
143
|
+
config: Config;
|
|
144
|
+
session: Session;
|
|
145
|
+
find: Find;
|
|
146
|
+
file: File;
|
|
147
|
+
tui: Tui;
|
|
148
|
+
}
|
|
149
|
+
export {};
|