runpod-sdk 1.1.0 → 1.1.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/.claude/settings.local.json +15 -0
- package/CLAUDE.md +48 -0
- package/dist/package.json +3 -3
- package/package.json +3 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(gh repo view:*)",
|
|
5
|
+
"Bash(gh pr list:*)",
|
|
6
|
+
"Bash(gh issue list:*)",
|
|
7
|
+
"Bash(gh issue view:*)",
|
|
8
|
+
"Bash(npm view:*)",
|
|
9
|
+
"Bash(gh pr view:*)",
|
|
10
|
+
"Bash(git pull:*)",
|
|
11
|
+
"Bash(yarn build)"
|
|
12
|
+
],
|
|
13
|
+
"deny": []
|
|
14
|
+
}
|
|
15
|
+
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Build Commands
|
|
6
|
+
|
|
7
|
+
- `yarn build` or `npm run build` - Compile TypeScript to JavaScript in `/dist`
|
|
8
|
+
- `tsc` - Direct TypeScript compilation
|
|
9
|
+
|
|
10
|
+
## Architecture Overview
|
|
11
|
+
|
|
12
|
+
This is a JavaScript/TypeScript SDK for RunPod's serverless API. The entire SDK is contained in a single file (`src/index.ts`) with a class-based architecture:
|
|
13
|
+
|
|
14
|
+
### Core Classes
|
|
15
|
+
- `RunpodSdk` - Main SDK class, initialized with API key and optional config
|
|
16
|
+
- `Endpoint` - Represents a serverless endpoint, provides methods for job management
|
|
17
|
+
|
|
18
|
+
### Key Concepts
|
|
19
|
+
- **Serverless Endpoints**: Remote compute resources identified by endpoint IDs
|
|
20
|
+
- **Jobs/Requests**: Tasks submitted to endpoints with input payloads
|
|
21
|
+
- **Execution Policies**: Configuration for timeouts and priority (`ExecutionPolicy` type)
|
|
22
|
+
- **Streaming**: Some endpoints support yielding multiple results via async generators
|
|
23
|
+
|
|
24
|
+
### API Patterns
|
|
25
|
+
- All endpoint methods accept optional `timeout` parameter (milliseconds)
|
|
26
|
+
- Functions are curried using Ramda for partial application
|
|
27
|
+
- Two execution modes: async (`run`) and sync with polling (`runSync`)
|
|
28
|
+
- Status checking via polling with `/status` and `/status-sync` endpoints
|
|
29
|
+
|
|
30
|
+
### HTTP Client
|
|
31
|
+
Uses `xior` (axios-like) for HTTP requests with custom error handling and user agent.
|
|
32
|
+
|
|
33
|
+
## Environment Configuration
|
|
34
|
+
|
|
35
|
+
The SDK supports two base URLs:
|
|
36
|
+
- Production: `https://api.runpod.ai/v2` (default)
|
|
37
|
+
- Development: `https://dev-api.runpod.ai/v2`
|
|
38
|
+
|
|
39
|
+
Configure via `SdkOptions.baseUrl` when initializing the SDK.
|
|
40
|
+
|
|
41
|
+
## Publishing
|
|
42
|
+
|
|
43
|
+
From README-dev.md:
|
|
44
|
+
```bash
|
|
45
|
+
yarn build # Required before publishing to refresh TypeScript definitions
|
|
46
|
+
npm login
|
|
47
|
+
npm publish
|
|
48
|
+
```
|
package/dist/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "runpod-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "JavaScript SDK for Runpod",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"author": "Runpod",
|
|
9
9
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "runpod-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "JavaScript SDK for Runpod",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"author": "Runpod",
|
|
9
9
|
"dependencies": {
|