@plugable-io/js 0.0.8 → 0.0.10
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 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,6 +106,30 @@ const response = await client.list({
|
|
|
106
106
|
console.log('Files:', response.files);
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
#### Ordering Results
|
|
110
|
+
|
|
111
|
+
You can order files by `created_at`, `name`, or `byte_size`. The default ordering is `created_at` in descending order (newest first).
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// Order by name (ascending)
|
|
115
|
+
const response = await client.list({
|
|
116
|
+
order_by: 'name',
|
|
117
|
+
order_direction: 'asc'
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Order by file size (descending - largest first)
|
|
121
|
+
const response = await client.list({
|
|
122
|
+
order_by: 'byte_size',
|
|
123
|
+
order_direction: 'desc'
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Order by creation date (ascending - oldest first)
|
|
127
|
+
const response = await client.list({
|
|
128
|
+
order_by: 'created_at',
|
|
129
|
+
order_direction: 'asc'
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
109
133
|
### Finding a File
|
|
110
134
|
|
|
111
135
|
You can find a single file using `find`. This is a convenience method that searches for files and returns the first match. It's useful for finding files by metadata or other criteria.
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -142,7 +142,7 @@ var BucketClient = class {
|
|
|
142
142
|
__publicField(this, "config");
|
|
143
143
|
this.config = config;
|
|
144
144
|
this.client = import_axios.default.create({
|
|
145
|
-
baseURL: config.baseUrl || "
|
|
145
|
+
baseURL: config.baseUrl || "htts://api.plugable.one/v1",
|
|
146
146
|
// Enable axios to respect cache headers
|
|
147
147
|
adapter: "fetch"
|
|
148
148
|
// Use fetch adapter which respects browser cache
|
package/dist/index.mjs
CHANGED
|
@@ -107,7 +107,7 @@ var BucketClient = class {
|
|
|
107
107
|
__publicField(this, "config");
|
|
108
108
|
this.config = config;
|
|
109
109
|
this.client = axios.create({
|
|
110
|
-
baseURL: config.baseUrl || "
|
|
110
|
+
baseURL: config.baseUrl || "htts://api.plugable.one/v1",
|
|
111
111
|
// Enable axios to respect cache headers
|
|
112
112
|
adapter: "fetch"
|
|
113
113
|
// Use fetch adapter which respects browser cache
|