@upon-ai/sdk 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +59 -2
- package/dist/client.d.ts +11 -0
- package/dist/client.js +194 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +13 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +82 -0
- package/dist/metadata.d.ts +1936 -0
- package/dist/metadata.js +2142 -0
- package/dist/schema.d.ts +4887 -0
- package/dist/schema.js +1 -0
- package/dist/types.d.ts +52 -0
- package/dist/types.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +41 -4
package/dist/schema.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { operations } from './schema.js';
|
|
2
|
+
export type OperationId = keyof operations;
|
|
3
|
+
type Params<O> = O extends {
|
|
4
|
+
parameters: infer P;
|
|
5
|
+
} ? {
|
|
6
|
+
[K in keyof P as K extends 'path' | 'query' ? P[K] extends undefined ? never : K : never]: P[K];
|
|
7
|
+
} : {};
|
|
8
|
+
type Content<B> = B extends {
|
|
9
|
+
content: infer C;
|
|
10
|
+
} ? C extends {
|
|
11
|
+
'multipart/form-data': unknown;
|
|
12
|
+
} ? FormData : C[keyof C] : never;
|
|
13
|
+
type Body<O> = O extends {
|
|
14
|
+
requestBody: infer B;
|
|
15
|
+
} ? {
|
|
16
|
+
body: Content<B>;
|
|
17
|
+
} : O extends {
|
|
18
|
+
requestBody?: infer B;
|
|
19
|
+
} ? [Exclude<B, undefined>] extends [never] ? {} : {
|
|
20
|
+
body?: Content<Exclude<B, undefined>>;
|
|
21
|
+
} : {};
|
|
22
|
+
export type OperationInput<K extends OperationId> = Params<operations[K]> & Body<operations[K]>;
|
|
23
|
+
type Success<R> = {
|
|
24
|
+
[S in keyof R]: `${S & (string | number)}` extends `2${string}` ? R[S] extends {
|
|
25
|
+
content: infer C;
|
|
26
|
+
} ? C extends {
|
|
27
|
+
'application/json': infer J;
|
|
28
|
+
} ? J : C extends undefined ? void : Blob : void : never;
|
|
29
|
+
}[keyof R];
|
|
30
|
+
export type OperationOutput<K extends OperationId> = operations[K] extends {
|
|
31
|
+
responses: infer R;
|
|
32
|
+
} ? Success<R> : unknown;
|
|
33
|
+
export interface RequestOptions {
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ClientOptions {
|
|
38
|
+
apiKey: string | (() => string | Promise<string>);
|
|
39
|
+
baseUrl?: string;
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
maxRetries?: number;
|
|
42
|
+
fetch?: typeof globalThis.fetch;
|
|
43
|
+
}
|
|
44
|
+
export interface PaginationOptions<K extends OperationId, T> {
|
|
45
|
+
operation: K;
|
|
46
|
+
input: OperationInput<K>;
|
|
47
|
+
items: (page: OperationOutput<K>) => readonly T[];
|
|
48
|
+
next: (page: OperationOutput<K>, previous: OperationInput<K>) => OperationInput<K> | undefined;
|
|
49
|
+
maxPages?: number;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const publicContractSha256 = "2dde3cce47c07123e8f88de2f6553c1ce527467ab364d0600e4a919fe2873654";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const publicContractSha256 = '2dde3cce47c07123e8f88de2f6553c1ce527467ab364d0600e4a919fe2873654';
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upon-ai/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed customer API client for UponAI",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.14"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"author": "UponAI",
|
|
29
|
+
"homepage": "https://docs.uponai.com",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"uponai",
|
|
32
|
+
"api",
|
|
33
|
+
"sdk"
|
|
34
|
+
],
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/andrewcallsandy/uponai-developer-tools.git",
|
|
38
|
+
"directory": "packages/sdk"
|
|
39
|
+
},
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/andrewcallsandy/uponai-developer-tools/issues"
|
|
42
|
+
}
|
|
43
|
+
}
|