@putdotio/sdk 13.3.0 → 13.3.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 +24 -60
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<p>
|
|
3
|
-
<img src="https://static.put.io/images/putio-boncuk.png" width="72">
|
|
3
|
+
<img src="https://static.put.io/images/putio-boncuk.png" width="72" alt="put.io boncuk">
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
6
|
<h1>putio-sdk-typescript</h1>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
TypeScript SDK for the <a href="https://api.put.io/v2/docs">put.io API</a>
|
|
10
10
|
</p>
|
|
11
11
|
<p>
|
|
12
|
-
Domain-first, schema-validated at the boundary, and
|
|
12
|
+
Domain-first, schema-validated at the boundary, and built on standard Web APIs.
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p>
|
|
@@ -180,53 +180,26 @@ effectClient.files.list(0, { per_page: 20 });
|
|
|
180
180
|
| `createPutioSdkPromiseClient(config)` | React apps, scripts, server handlers, React Query |
|
|
181
181
|
| `createPutioSdkEffectClient()` | Effect-native workflows and service composition |
|
|
182
182
|
|
|
183
|
-
Effect is the canonical typed surface
|
|
183
|
+
Effect is the canonical typed surface; the Promise client adapts it to standard async functions.
|
|
184
184
|
|
|
185
|
-
- Effect client: keeps errors in the Effect error channel with operation-specific typing
|
|
186
|
-
- Promise client: throws tagged SDK error objects such as `PutioOperationError`, `PutioApiError`, and `PutioRateLimitError
|
|
187
|
-
- Promise client: owns a managed Effect runtime; call `await sdk.dispose()` when tearing down a long-lived client
|
|
188
|
-
- Promise client: `files.createUploadFormData(...)` builds upload FormData without a request
|
|
185
|
+
- Effect client: keeps errors in the Effect error channel with operation-specific typing.
|
|
186
|
+
- Promise client: throws tagged SDK error objects such as `PutioOperationError`, `PutioApiError`, and `PutioRateLimitError`.
|
|
187
|
+
- Promise client: owns a managed Effect runtime; call `await sdk.dispose()` when tearing down a long-lived client.
|
|
188
|
+
- Promise client: `files.createUploadFormData(...)` builds upload FormData without a request.
|
|
189
189
|
|
|
190
190
|
Interrupting an Effect during fetch or response-body consumption aborts the underlying
|
|
191
191
|
fetch request, including JSON and binary reads. Successful reads do not abort the
|
|
192
192
|
request.
|
|
193
193
|
|
|
194
|
-
##
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
| `auth` | token validation, login flows, device/OOB helpers, two-factor flows |
|
|
200
|
-
| `config` | app-owned JSON config storage |
|
|
201
|
-
| `downloadLinks` | download-link bundles |
|
|
202
|
-
| `events` | history events and event torrent payloads |
|
|
203
|
-
| `family` | family members and invites |
|
|
204
|
-
| `files` | file listing, search, move/delete/extract, MP4, direct access URLs, upload |
|
|
205
|
-
| `friendInvites` | friend invitation management |
|
|
206
|
-
| `friends` | friend graph and requests |
|
|
207
|
-
| `ifttt` | IFTTT integration endpoints |
|
|
208
|
-
| `oauth` | OAuth app management |
|
|
209
|
-
| `payment` | plans, vouchers, payment flows, payment history |
|
|
210
|
-
| `podcast` | podcast feed links for folders and media types |
|
|
211
|
-
| `rss` | RSS feed management |
|
|
212
|
-
| `sharing` | friend shares, public shares, clone flows |
|
|
213
|
-
| `transfers` | transfer list, add/retry/cancel/clean flows |
|
|
214
|
-
| `trash` | trash listing, restore, delete, empty |
|
|
215
|
-
| `tunnel` | route listing |
|
|
216
|
-
| `utilities` | file URLs, localized errors, and shared formatting helpers |
|
|
217
|
-
| `zips` | zip creation and lookup |
|
|
218
|
-
|
|
219
|
-
## Design Rules
|
|
220
|
-
|
|
221
|
-
- schema-first contracts at every external boundary
|
|
222
|
-
- typed errors are first-class
|
|
223
|
-
- parameter-conditioned responses are modeled explicitly
|
|
224
|
-
- no compatibility namespace shims in the public API
|
|
225
|
-
- fetch-native core with runtime-portable Web APIs
|
|
194
|
+
## Namespaces
|
|
195
|
+
|
|
196
|
+
Both clients expose the namespaces of `sharedOperationTree` in
|
|
197
|
+
[src/core/client.ts](./src/core/client.ts), such as `account`, `files`, `transfers`, and
|
|
198
|
+
`sharing`. Helpers live in the [utilities subpath](#utilities), not on the client.
|
|
226
199
|
|
|
227
200
|
## Runtime Requirements
|
|
228
201
|
|
|
229
|
-
|
|
202
|
+
Host runtimes must provide:
|
|
230
203
|
|
|
231
204
|
- `fetch`
|
|
232
205
|
- `Request`, `Response`, and `Headers`
|
|
@@ -235,11 +208,8 @@ The package is designed around standard Web APIs. Host runtimes should provide:
|
|
|
235
208
|
- `FormData`
|
|
236
209
|
- `btoa` for username/password auth flows such as `auth.login(...)`
|
|
237
210
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
If a target runtime is missing these APIs, provide them with host-level polyfills or adapters instead of patching the SDK surface.
|
|
241
|
-
|
|
242
|
-
CI installs the packed package into external Node, Bun, and bundled Chromium, Firefox, and WebKit consumers on every change.
|
|
211
|
+
Upload flows also need file inputs such as `File` or `Blob`. Fill missing APIs with host-level
|
|
212
|
+
polyfills or adapters instead of patching the SDK surface.
|
|
243
213
|
|
|
244
214
|
## Error Handling
|
|
245
215
|
|
|
@@ -345,12 +315,13 @@ const upload = await sdk.files.upload({
|
|
|
345
315
|
});
|
|
346
316
|
```
|
|
347
317
|
|
|
348
|
-
Upload
|
|
318
|
+
Upload goes to `upload.put.io`, because `api.put.io/v2/files/upload` is only a redirect shim.
|
|
349
319
|
|
|
350
320
|
## Endpoint Coverage
|
|
351
321
|
|
|
352
|
-
The
|
|
353
|
-
|
|
322
|
+
The SDK covers the supported public put.io API surface. It leaves out admin,
|
|
323
|
+
private, and service-to-service routes, browser page and callback routes, and
|
|
324
|
+
aliases of routes it already covers.
|
|
354
325
|
|
|
355
326
|
## File Lookup and Mutations
|
|
356
327
|
|
|
@@ -424,8 +395,8 @@ const { links, token } = await sdk.podcast.getLinks({
|
|
|
424
395
|
});
|
|
425
396
|
```
|
|
426
397
|
|
|
427
|
-
`links` is a partial map keyed by `all`, `audio`, `video`, and `mp4
|
|
428
|
-
|
|
398
|
+
`links` is a partial map keyed by `all`, `audio`, `video`, and `mp4`; check that a requested
|
|
399
|
+
link is present.
|
|
429
400
|
|
|
430
401
|
## TanStack Query
|
|
431
402
|
|
|
@@ -472,16 +443,9 @@ export const useFiles = (parentId: number) =>
|
|
|
472
443
|
|
|
473
444
|
## Docs
|
|
474
445
|
|
|
475
|
-
- [
|
|
476
|
-
- [
|
|
477
|
-
- [
|
|
478
|
-
- [Testing](./docs/testing.md) for local and live verification
|
|
479
|
-
- [Distribution](./docs/distribution.md) for release automation
|
|
480
|
-
- [Security policy](https://github.com/putdotio/.github/blob/main/SECURITY.md) for private vulnerability reports; fixes target the latest published release and `main`
|
|
481
|
-
|
|
482
|
-
## Contributing
|
|
483
|
-
|
|
484
|
-
Contributor setup, validation, and live-test workflow live in [Contributing](./CONTRIBUTING.md).
|
|
446
|
+
- [Releases](https://github.com/putdotio/putio-sdk-typescript/releases): what changed in each version, breaking changes included
|
|
447
|
+
- [Contributing](./CONTRIBUTING.md): setup, checks, and live tests
|
|
448
|
+
- [Security policy](https://github.com/putdotio/.github/blob/main/SECURITY.md): private vulnerability reports
|
|
485
449
|
|
|
486
450
|
## License
|
|
487
451
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putdotio/sdk",
|
|
3
|
-
"version": "13.3.
|
|
3
|
+
"version": "13.3.1",
|
|
4
4
|
"description": "Effect-first TypeScript SDK for the put.io API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"effect",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"verify": "vp check . && vp run lint:package && knip && knip --production --no-gitignore && vp run validate:routes:packed && vp test run --coverage --passWithNoTests"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"effect": "4.0.
|
|
65
|
+
"effect": "4.0.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": ">=24.19.0"
|
|
81
81
|
},
|
|
82
|
-
"packageManager": "pnpm@12.
|
|
82
|
+
"packageManager": "pnpm@12.15.0"
|
|
83
83
|
}
|