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 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 apiInfo = await client.apiInfo.retrieve();
30
+ const response = await client.upload.prepare({ file_name: 'example.jpg' });
31
31
 
32
- console.log(apiInfo.docs);
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 apiInfo: Filejar.APIInfoRetrieveResponse = await client.apiInfo.retrieve();
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 apiInfo = await client.apiInfo.retrieve().catch(async (err) => {
62
- if (err instanceof Filejar.APIError) {
63
- console.log(err.status); // 400
64
- console.log(err.name); // BadRequestError
65
- console.log(err.headers); // {server: 'nginx', ...}
66
- } else {
67
- throw err;
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.apiInfo.retrieve({
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.apiInfo.retrieve({
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.apiInfo.retrieve().asResponse();
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: apiInfo, response: raw } = await client.apiInfo.retrieve().withResponse();
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(apiInfo.docs);
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.apiInfo.retrieve({
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/Filejar/node/issues) with questions, bugs, or suggestions.
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
@@ -20,7 +20,7 @@ declare const environments: {
20
20
  type Environment = keyof typeof environments;
21
21
  export interface ClientOptions {
22
22
  /**
23
- * WorkOS API key for authentication
23
+ * Filejar API key for authentication
24
24
  */
25
25
  apiKey?: string | undefined;
26
26
  /**
package/client.d.ts CHANGED
@@ -20,7 +20,7 @@ declare const environments: {
20
20
  type Environment = keyof typeof environments;
21
21
  export interface ClientOptions {
22
22
  /**
23
- * WorkOS API key for authentication
23
+ * Filejar API key for authentication
24
24
  */
25
25
  apiKey?: string | undefined;
26
26
  /**
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "filejar",
3
- "version": "0.3.1",
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:Filejar/node",
9
+ "repository": "github:filejar/node",
10
10
  "license": "Apache-2.0",
11
11
  "files": [
12
12
  "**/*"
package/src/client.ts CHANGED
@@ -46,7 +46,7 @@ type Environment = keyof typeof environments;
46
46
 
47
47
  export interface ClientOptions {
48
48
  /**
49
- * WorkOS API key for authentication
49
+ * Filejar API key for authentication
50
50
  */
51
51
  apiKey?: string | undefined;
52
52
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.3.1'; // x-release-please-version
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.3.1";
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.3.1";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.3.1'; // x-release-please-version
4
+ exports.VERSION = '0.4.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.1'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map