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.
Files changed (44) hide show
  1. package/README.md +217 -32
  2. package/dist/package.json +6 -3
  3. package/dist/src/graphql/client.d.ts +22 -0
  4. package/dist/src/graphql/client.js +75 -0
  5. package/dist/src/graphql/client.js.map +1 -0
  6. package/dist/src/graphql/generated/index.d.ts +742 -0
  7. package/dist/src/graphql/generated/index.js +347 -0
  8. package/dist/src/graphql/generated/index.js.map +1 -0
  9. package/dist/src/graphql/generated/operations.d.ts +428 -0
  10. package/dist/src/graphql/generated/operations.js +2 -0
  11. package/dist/src/graphql/generated/operations.js.map +1 -0
  12. package/dist/src/graphql/generated/sdk.d.ts +31 -0
  13. package/dist/src/graphql/generated/sdk.js +232 -0
  14. package/dist/src/graphql/generated/sdk.js.map +1 -0
  15. package/dist/src/graphql/generated/types.d.ts +4281 -0
  16. package/dist/src/graphql/generated/types.js +2 -0
  17. package/dist/src/graphql/generated/types.js.map +1 -0
  18. package/dist/src/index.d.ts +53 -8
  19. package/dist/src/index.js +202 -294
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/pods/generated-gpu-types.d.ts +299 -0
  22. package/dist/src/pods/generated-gpu-types.js +148 -0
  23. package/dist/src/pods/generated-gpu-types.js.map +1 -0
  24. package/dist/src/pods/index.d.ts +122 -0
  25. package/dist/src/pods/index.js +242 -0
  26. package/dist/src/pods/index.js.map +1 -0
  27. package/package.json +18 -2
  28. package/schema.gql +161 -0
  29. package/.claude/settings.local.json +0 -15
  30. package/.prettierrc +0 -12
  31. package/CLAUDE.md +0 -48
  32. package/README-dev.md +0 -7
  33. package/examples/basic.js +0 -19
  34. package/examples/cancel.js +0 -27
  35. package/examples/devServerless.js +0 -17
  36. package/examples/errors.js +0 -11
  37. package/examples/health.js +0 -11
  38. package/examples/purge-queue.js +0 -11
  39. package/examples/run.js +0 -27
  40. package/examples/runSync.js +0 -17
  41. package/examples/stream.js +0 -48
  42. package/examples/test.js +0 -74
  43. package/src/index.ts +0 -328
  44. package/tsconfig.json +0 -16
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/graphql/generated/types.ts"],"names":[],"mappings":""}
@@ -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: string;
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
- baseUrl: string;
121
- constructor(apiKey: string, options: SdkOptions);
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';