@howells/stow-client 0.2.0 → 0.3.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/dist/index.d.mts CHANGED
@@ -25,11 +25,13 @@
25
25
  * console.log(result.url);
26
26
  * ```
27
27
  */
28
+ /** Error thrown when an SDK request fails. */
28
29
  declare class StowError extends Error {
29
30
  readonly status: number;
30
31
  readonly code?: string;
31
32
  constructor(message: string, status: number, code?: string);
32
33
  }
34
+ /** Configuration for creating a {@link StowClient} instance. */
33
35
  interface StowClientConfig {
34
36
  /**
35
37
  * Your server endpoint that handles presign/confirm requests.
@@ -37,6 +39,7 @@ interface StowClientConfig {
37
39
  */
38
40
  endpoint: string;
39
41
  }
42
+ /** Result returned after a successful upload or dedupe short-circuit. */
40
43
  interface UploadResult {
41
44
  contentType: string;
42
45
  /** True when upload short-circuited to an existing file via dedupe. */
@@ -45,6 +48,7 @@ interface UploadResult {
45
48
  size: number;
46
49
  url: string | null;
47
50
  }
51
+ /** Progress payload emitted during `uploadFile`. */
48
52
  interface UploadProgress {
49
53
  /** Bytes uploaded so far */
50
54
  loaded: number;
@@ -55,6 +59,7 @@ interface UploadProgress {
55
59
  /** Total bytes to upload */
56
60
  total: number;
57
61
  }
62
+ /** Optional behavior for a single upload operation. */
58
63
  interface UploadOptions {
59
64
  /** Custom metadata to attach to the file */
60
65
  metadata?: Record<string, string>;
@@ -63,6 +68,7 @@ interface UploadOptions {
63
68
  /** Optional upload route (server-side configured route/path policy). */
64
69
  route?: string;
65
70
  }
71
+ /** Browser SDK for direct-to-R2 uploads via your server's presign/confirm endpoints. */
66
72
  declare class StowClient {
67
73
  private readonly endpoint;
68
74
  /**
package/dist/index.d.ts CHANGED
@@ -25,11 +25,13 @@
25
25
  * console.log(result.url);
26
26
  * ```
27
27
  */
28
+ /** Error thrown when an SDK request fails. */
28
29
  declare class StowError extends Error {
29
30
  readonly status: number;
30
31
  readonly code?: string;
31
32
  constructor(message: string, status: number, code?: string);
32
33
  }
34
+ /** Configuration for creating a {@link StowClient} instance. */
33
35
  interface StowClientConfig {
34
36
  /**
35
37
  * Your server endpoint that handles presign/confirm requests.
@@ -37,6 +39,7 @@ interface StowClientConfig {
37
39
  */
38
40
  endpoint: string;
39
41
  }
42
+ /** Result returned after a successful upload or dedupe short-circuit. */
40
43
  interface UploadResult {
41
44
  contentType: string;
42
45
  /** True when upload short-circuited to an existing file via dedupe. */
@@ -45,6 +48,7 @@ interface UploadResult {
45
48
  size: number;
46
49
  url: string | null;
47
50
  }
51
+ /** Progress payload emitted during `uploadFile`. */
48
52
  interface UploadProgress {
49
53
  /** Bytes uploaded so far */
50
54
  loaded: number;
@@ -55,6 +59,7 @@ interface UploadProgress {
55
59
  /** Total bytes to upload */
56
60
  total: number;
57
61
  }
62
+ /** Optional behavior for a single upload operation. */
58
63
  interface UploadOptions {
59
64
  /** Custom metadata to attach to the file */
60
65
  metadata?: Record<string, string>;
@@ -63,6 +68,7 @@ interface UploadOptions {
63
68
  /** Optional upload route (server-side configured route/path policy). */
64
69
  route?: string;
65
70
  }
71
+ /** Browser SDK for direct-to-R2 uploads via your server's presign/confirm endpoints. */
66
72
  declare class StowClient {
67
73
  private readonly endpoint;
68
74
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/stow-client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Client-side SDK for Stow file storage",
5
5
  "license": "MIT",
6
6
  "repository": {