naro-js 0.4.0 → 0.6.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.
@@ -70,8 +70,67 @@ export type ListOptions = {
70
70
  column?: "name" | "created_at" | "updated_at";
71
71
  order?: "asc" | "desc";
72
72
  };
73
+ /**
74
+ * Names below the prefix that start with it, ASCII case ignored; % and _
75
+ * are plain characters. Up to 256 characters. A folder shows when a name
76
+ * under it starts with it. A backend whose Storage was turned on before
77
+ * search came answers INVALID_REQUEST (`details.path` "search"): update
78
+ * it with `naro backend enable`.
79
+ */
80
+ search?: string;
73
81
  };
74
82
  /** `true` downloads under the object's own name, a string under that name. */
75
83
  export type DownloadOption = {
76
84
  download?: boolean | string;
77
85
  };
86
+ /** `createSignedUploadUrl`'s options (Storage 3-1e-2). */
87
+ export type CreateSignedUploadUrlOptions = {
88
+ /** Let the token replace a file of the same name. Default false: a second upload is `OBJECT_EXISTS`. */
89
+ upsert?: boolean;
90
+ };
91
+ /**
92
+ * A signed upload's token (Storage 3-1e-2): `token` for `uploadToSignedUrl`,
93
+ * and `signedUrl` — on the project's URL — where a client without naro-js
94
+ * PUTs the file's bytes with no key. It works for two hours from when it
95
+ * was made.
96
+ */
97
+ export type SignedUploadUrl = {
98
+ signedUrl: string;
99
+ token: string;
100
+ path: string;
101
+ };
102
+ /** What `uploadToSignedUrl` answers: supabase-js's shape. */
103
+ export type SignedUploadResult = {
104
+ path: string;
105
+ fullPath: string;
106
+ };
107
+ /**
108
+ * One path's answer of `createSignedUrls` (Storage 3-1g): supabase-js's
109
+ * shape without its `signedURL` copy. `signedUrl` is null, and `error`
110
+ * says `Object <path> was not found in bucket <bucket>.`, for a file that
111
+ * is not there or that the caller cannot read — the same words for both.
112
+ */
113
+ export type SignedUrlEntry = {
114
+ path: string;
115
+ signedUrl: string | null;
116
+ error: string | null;
117
+ };
118
+ /** `move`'s options (Storage 3-1i): supabase-js's. */
119
+ export type MoveOptions = {
120
+ /**
121
+ * Taken as supabase-js sends it. Objects move within one bucket: another
122
+ * bucket answers `INVALID_REQUEST` (`details.path` "destinationBucket").
123
+ */
124
+ destinationBucket?: string;
125
+ };
126
+ /** `copy`'s options (Storage 3-1i). */
127
+ export type CopyOptions = {
128
+ /** As `MoveOptions`'s: one bucket only. */
129
+ destinationBucket?: string;
130
+ /** Replace an object at the destination. Default false: `OBJECT_EXISTS`. */
131
+ upsert?: boolean;
132
+ };
133
+ /** What `move` answers: supabase-js's words. */
134
+ export type MoveResult = {
135
+ message: string;
136
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naro-js",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Auth, data and files for your Naro project, from the browser or the server.",
5
5
  "type": "module",
6
6
  "sideEffects": false,