runpod-sdk 1.1.1 → 1.2.0-beta.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 +217 -32
- package/dist/package.json +6 -3
- package/dist/src/graphql/client.d.ts +22 -0
- package/dist/src/graphql/client.js +75 -0
- package/dist/src/graphql/client.js.map +1 -0
- package/dist/src/graphql/generated/index.d.ts +742 -0
- package/dist/src/graphql/generated/index.js +347 -0
- package/dist/src/graphql/generated/index.js.map +1 -0
- package/dist/src/graphql/generated/operations.d.ts +428 -0
- package/dist/src/graphql/generated/operations.js +2 -0
- package/dist/src/graphql/generated/operations.js.map +1 -0
- package/dist/src/graphql/generated/sdk.d.ts +31 -0
- package/dist/src/graphql/generated/sdk.js +232 -0
- package/dist/src/graphql/generated/sdk.js.map +1 -0
- package/dist/src/graphql/generated/types.d.ts +4281 -0
- package/dist/src/graphql/generated/types.js +2 -0
- package/dist/src/graphql/generated/types.js.map +1 -0
- package/dist/src/index.d.ts +53 -8
- package/dist/src/index.js +202 -294
- package/dist/src/index.js.map +1 -1
- package/dist/src/pods/generated-gpu-types.d.ts +299 -0
- package/dist/src/pods/generated-gpu-types.js +148 -0
- package/dist/src/pods/generated-gpu-types.js.map +1 -0
- package/dist/src/pods/index.d.ts +122 -0
- package/dist/src/pods/index.js +242 -0
- package/dist/src/pods/index.js.map +1 -0
- package/package.json +18 -2
- package/schema.gql +161 -0
- package/.claude/settings.local.json +0 -15
- package/.prettierrc +0 -12
- package/CLAUDE.md +0 -48
- package/README-dev.md +0 -7
- package/examples/basic.js +0 -19
- package/examples/cancel.js +0 -27
- package/examples/devServerless.js +0 -17
- package/examples/errors.js +0 -11
- package/examples/health.js +0 -11
- package/examples/purge-queue.js +0 -11
- package/examples/run.js +0 -27
- package/examples/runSync.js +0 -17
- package/examples/stream.js +0 -48
- package/examples/test.js +0 -74
- package/src/index.ts +0 -328
- package/tsconfig.json +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/graphql/generated/types.ts"],"names":[],"mappings":""}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PodManager } from './pods/index.js';
|
|
1
2
|
export type ExecutionPolicy = {
|
|
2
3
|
executionTimeout?: number;
|
|
3
4
|
lowPriority?: boolean;
|
|
@@ -61,11 +62,14 @@ export type PurgeQueueOutput = {
|
|
|
61
62
|
status: string;
|
|
62
63
|
};
|
|
63
64
|
export type SdkOptions = {
|
|
64
|
-
baseUrl
|
|
65
|
+
baseUrl?: string;
|
|
66
|
+
graphqlUrl?: string;
|
|
67
|
+
timeout?: number;
|
|
68
|
+
retries?: number;
|
|
65
69
|
};
|
|
66
70
|
export declare const runpodServerlessBaseUrlProd = "https://api.runpod.ai/v2";
|
|
67
71
|
export declare const runpodServerlessBaseUrlDev = "https://dev-api.runpod.ai/v2";
|
|
68
|
-
export declare const runSync: import("ts-toolbelt/out/Function/Curry").Curry<(baseUrl: string, apiKey: string, endpointId: string, request: EndpointInputPayload, timeout?: number) => Promise<{
|
|
72
|
+
export declare const runSync: import("ts-toolbelt/out/Function/Curry.js").Curry<(baseUrl: string, apiKey: string, endpointId: string, request: EndpointInputPayload, timeout?: number) => Promise<{
|
|
69
73
|
started: boolean;
|
|
70
74
|
completed: boolean;
|
|
71
75
|
delayTime?: number | undefined;
|
|
@@ -96,11 +100,11 @@ export declare const runSync: import("ts-toolbelt/out/Function/Curry").Curry<(ba
|
|
|
96
100
|
executionTime: number;
|
|
97
101
|
delayTime: number;
|
|
98
102
|
}>>;
|
|
99
|
-
export declare const run: import("ts-toolbelt/out/Function/Curry").Curry<(baseUrl: string, apiKey: string, endpointId: string, request: EndpointInputPayload, timeout?: number) => Promise<any>>;
|
|
100
|
-
export declare const status: import("ts-toolbelt/out/Function/Curry").Curry<(baseUrl: string, apiKey: string, endpointId: string, requestId: string, timeout?: number) => Promise<any>>;
|
|
103
|
+
export declare const run: import("ts-toolbelt/out/Function/Curry.js").Curry<(baseUrl: string, apiKey: string, endpointId: string, request: EndpointInputPayload, timeout?: number) => Promise<any>>;
|
|
104
|
+
export declare const status: import("ts-toolbelt/out/Function/Curry.js").Curry<(baseUrl: string, apiKey: string, endpointId: string, requestId: string, timeout?: number) => Promise<any>>;
|
|
101
105
|
export declare function stream(baseUrl: string, apiKey: string, endpointId: string, requestId: string, timeout?: number): AsyncGenerator<any, void, unknown>;
|
|
102
|
-
export declare const health: import("ts-toolbelt/out/Function/Curry").Curry<(baseUrl: string, apiKey: string, endpointId: string, timeout?: number) => Promise<any>>;
|
|
103
|
-
export declare const purgeQueue: import("ts-toolbelt/out/Function/Curry").Curry<(baseUrl: string, apiKey: string, endpointId: string, timeout?: number) => Promise<any>>;
|
|
106
|
+
export declare const health: import("ts-toolbelt/out/Function/Curry.js").Curry<(baseUrl: string, apiKey: string, endpointId: string, timeout?: number) => Promise<any>>;
|
|
107
|
+
export declare const purgeQueue: import("ts-toolbelt/out/Function/Curry.js").Curry<(baseUrl: string, apiKey: string, endpointId: string, timeout?: number) => Promise<any>>;
|
|
104
108
|
declare class Endpoint {
|
|
105
109
|
endpointId: string;
|
|
106
110
|
baseUrl: string;
|
|
@@ -117,9 +121,50 @@ declare class Endpoint {
|
|
|
117
121
|
}
|
|
118
122
|
declare class RunpodSdk {
|
|
119
123
|
private apiKey;
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
private options;
|
|
125
|
+
private graphqlClient;
|
|
126
|
+
private _pods?;
|
|
127
|
+
constructor(apiKey: string, options?: SdkOptions);
|
|
128
|
+
/**
|
|
129
|
+
* Get serverless endpoint instance (existing functionality)
|
|
130
|
+
*/
|
|
122
131
|
endpoint(endpointId: string): Endpoint | null;
|
|
132
|
+
/**
|
|
133
|
+
* Pod management API
|
|
134
|
+
*/
|
|
135
|
+
get pods(): PodManager;
|
|
136
|
+
/**
|
|
137
|
+
* Get current user profile and usage information
|
|
138
|
+
*/
|
|
139
|
+
getProfile(): Promise<{
|
|
140
|
+
id?: string | null | undefined;
|
|
141
|
+
email?: string | null | undefined;
|
|
142
|
+
machineQuota?: number | null | undefined;
|
|
143
|
+
currentSpendPerHr?: number | null | undefined;
|
|
144
|
+
spendLimit?: number | null | undefined;
|
|
145
|
+
referralEarned?: number | null | undefined;
|
|
146
|
+
} | null | undefined>;
|
|
147
|
+
/**
|
|
148
|
+
* List available GPU types
|
|
149
|
+
*/
|
|
150
|
+
listGpuTypes(): Promise<{
|
|
151
|
+
id: string;
|
|
152
|
+
displayName: string;
|
|
153
|
+
memoryInGb: number;
|
|
154
|
+
secureCloud: boolean;
|
|
155
|
+
communityCloud: boolean;
|
|
156
|
+
}[]>;
|
|
157
|
+
/**
|
|
158
|
+
* Update API key for both REST and GraphQL clients
|
|
159
|
+
*/
|
|
160
|
+
updateApiKey(apiKey: string): void;
|
|
161
|
+
/**
|
|
162
|
+
* Switch between production and development environments
|
|
163
|
+
*/
|
|
164
|
+
setEnvironment(env: 'production' | 'development'): void;
|
|
123
165
|
}
|
|
124
166
|
declare const _default: (apiKey: string, options?: SdkOptions) => RunpodSdk;
|
|
125
167
|
export default _default;
|
|
168
|
+
export { RunpodSdk, PodManager };
|
|
169
|
+
export type { Pod, PodConfig, PodFilters, GpuType, GpuTypeId } from './pods/index.js';
|
|
170
|
+
export { GpuTypes, getGpuDisplayName } from './pods/index.js';
|