filejar 0.3.1 → 0.4.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/CHANGELOG.md +9 -0
- package/README.md +26 -19
- package/client.d.mts +1 -1
- package/client.d.ts +1 -1
- package/package.json +2 -2
- package/src/client.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 (2026-01-02)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.3.1...v0.4.0](https://github.com/filejar/node/compare/v0.3.1...v0.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([2a0470b](https://github.com/filejar/node/commit/2a0470bc251e7ff33048598a4d0f6b1a6a123ac8))
|
|
10
|
+
* **api:** manual updates ([dfba033](https://github.com/filejar/node/commit/dfba033f1d4e4aa8a548898d70af9e5c40c153fc))
|
|
11
|
+
|
|
3
12
|
## 0.3.1 (2026-01-02)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.3.0...v0.3.1](https://github.com/Filejar/node/compare/v0.3.0...v0.3.1)
|
package/README.md
CHANGED
|
@@ -27,9 +27,9 @@ const client = new Filejar({
|
|
|
27
27
|
environment: 'local', // defaults to 'production'
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const response = await client.upload.prepare({ file_name: 'example.jpg' });
|
|
31
31
|
|
|
32
|
-
console.log(
|
|
32
|
+
console.log(response.upload_id);
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Request & Response types
|
|
@@ -45,7 +45,8 @@ const client = new Filejar({
|
|
|
45
45
|
environment: 'local', // defaults to 'production'
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
const
|
|
48
|
+
const params: Filejar.UploadAcknowledgeParams = { upload_id: '41b293b2-b086-4e26-b3ab-5870f369a525' };
|
|
49
|
+
const response: Filejar.UploadAcknowledgeResponse = await client.upload.acknowledge(params);
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -58,15 +59,17 @@ a subclass of `APIError` will be thrown:
|
|
|
58
59
|
|
|
59
60
|
<!-- prettier-ignore -->
|
|
60
61
|
```ts
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
const response = await client.upload
|
|
63
|
+
.acknowledge({ upload_id: '41b293b2-b086-4e26-b3ab-5870f369a525' })
|
|
64
|
+
.catch(async (err) => {
|
|
65
|
+
if (err instanceof Filejar.APIError) {
|
|
66
|
+
console.log(err.status); // 400
|
|
67
|
+
console.log(err.name); // BadRequestError
|
|
68
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
69
|
+
} else {
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
70
73
|
```
|
|
71
74
|
|
|
72
75
|
Error codes are as follows:
|
|
@@ -98,7 +101,7 @@ const client = new Filejar({
|
|
|
98
101
|
});
|
|
99
102
|
|
|
100
103
|
// Or, configure per-request:
|
|
101
|
-
await client.
|
|
104
|
+
await client.upload.acknowledge({ upload_id: '41b293b2-b086-4e26-b3ab-5870f369a525' }, {
|
|
102
105
|
maxRetries: 5,
|
|
103
106
|
});
|
|
104
107
|
```
|
|
@@ -115,7 +118,7 @@ const client = new Filejar({
|
|
|
115
118
|
});
|
|
116
119
|
|
|
117
120
|
// Override per-request:
|
|
118
|
-
await client.
|
|
121
|
+
await client.upload.acknowledge({ upload_id: '41b293b2-b086-4e26-b3ab-5870f369a525' }, {
|
|
119
122
|
timeout: 5 * 1000,
|
|
120
123
|
});
|
|
121
124
|
```
|
|
@@ -138,13 +141,17 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
138
141
|
```ts
|
|
139
142
|
const client = new Filejar();
|
|
140
143
|
|
|
141
|
-
const response = await client.
|
|
144
|
+
const response = await client.upload
|
|
145
|
+
.acknowledge({ upload_id: '41b293b2-b086-4e26-b3ab-5870f369a525' })
|
|
146
|
+
.asResponse();
|
|
142
147
|
console.log(response.headers.get('X-My-Header'));
|
|
143
148
|
console.log(response.statusText); // access the underlying Response object
|
|
144
149
|
|
|
145
|
-
const { data:
|
|
150
|
+
const { data: response, response: raw } = await client.upload
|
|
151
|
+
.acknowledge({ upload_id: '41b293b2-b086-4e26-b3ab-5870f369a525' })
|
|
152
|
+
.withResponse();
|
|
146
153
|
console.log(raw.headers.get('X-My-Header'));
|
|
147
|
-
console.log(
|
|
154
|
+
console.log(response.acknowledged_at);
|
|
148
155
|
```
|
|
149
156
|
|
|
150
157
|
### Logging
|
|
@@ -224,7 +231,7 @@ parameter. This library doesn't validate at runtime that the request matches the
|
|
|
224
231
|
send will be sent as-is.
|
|
225
232
|
|
|
226
233
|
```ts
|
|
227
|
-
client.
|
|
234
|
+
client.upload.prepare({
|
|
228
235
|
// ...
|
|
229
236
|
// @ts-expect-error baz is not yet public
|
|
230
237
|
baz: 'undocumented option',
|
|
@@ -334,7 +341,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
|
|
|
334
341
|
|
|
335
342
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
336
343
|
|
|
337
|
-
We are keen for your feedback; please open an [issue](https://www.github.com/
|
|
344
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/filejar/node/issues) with questions, bugs, or suggestions.
|
|
338
345
|
|
|
339
346
|
## Requirements
|
|
340
347
|
|
package/client.d.mts
CHANGED
package/client.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filejar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The official TypeScript library for the Filejar API",
|
|
5
5
|
"author": "Filejar <>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"type": "commonjs",
|
|
9
|
-
"repository": "github:
|
|
9
|
+
"repository": "github:filejar/node",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"files": [
|
|
12
12
|
"**/*"
|
package/src/client.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|