@proveanything/smartlinks 1.13.2 → 1.13.3
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/api/asset.js +7 -7
- package/dist/docs/API_SUMMARY.md +1 -1
- package/dist/docs/assets.md +8 -8
- package/dist/openapi.yaml +4 -4
- package/docs/API_SUMMARY.md +1 -1
- package/docs/assets.md +8 -8
- package/openapi.yaml +4 -4
- package/package.json +1 -1
package/dist/api/asset.js
CHANGED
|
@@ -316,7 +316,7 @@ export var asset;
|
|
|
316
316
|
if (typeof options.offset === 'number')
|
|
317
317
|
params.set('offset', String(options.offset));
|
|
318
318
|
const qs = params.toString();
|
|
319
|
-
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/
|
|
319
|
+
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/asset${qs ? `?${qs}` : ''}`;
|
|
320
320
|
return request(path);
|
|
321
321
|
}
|
|
322
322
|
asset.listAdmin = listAdmin;
|
|
@@ -324,7 +324,7 @@ export var asset;
|
|
|
324
324
|
* Get a single asset by ID (admin).
|
|
325
325
|
*/
|
|
326
326
|
async function getAdmin(collectionId, assetId) {
|
|
327
|
-
const path = `/admin/collection/${encodeURIComponent(collectionId)}/
|
|
327
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/asset/${encodeURIComponent(assetId)}`;
|
|
328
328
|
return request(path);
|
|
329
329
|
}
|
|
330
330
|
asset.getAdmin = getAdmin;
|
|
@@ -332,7 +332,7 @@ export var asset;
|
|
|
332
332
|
* Update asset metadata (admin). Use `replaceFile` to swap the file.
|
|
333
333
|
*/
|
|
334
334
|
async function updateAdmin(options) {
|
|
335
|
-
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/
|
|
335
|
+
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/asset/${encodeURIComponent(options.assetId)}`;
|
|
336
336
|
const { collectionId: _c, assetId: _a } = options, body = __rest(options, ["collectionId", "assetId"]);
|
|
337
337
|
return put(path, body);
|
|
338
338
|
}
|
|
@@ -342,7 +342,7 @@ export var asset;
|
|
|
342
342
|
* into `versions[]` on the asset.
|
|
343
343
|
*/
|
|
344
344
|
async function replaceFile(options) {
|
|
345
|
-
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/
|
|
345
|
+
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/asset/${encodeURIComponent(options.assetId)}/replace`;
|
|
346
346
|
const formData = new FormData();
|
|
347
347
|
formData.append('file', options.file);
|
|
348
348
|
if (options.onProgress && typeof window !== 'undefined' && !isProxyEnabled()) {
|
|
@@ -395,7 +395,7 @@ export var asset;
|
|
|
395
395
|
if (typeof options.graceDays === 'number')
|
|
396
396
|
params.set('graceDays', String(options.graceDays));
|
|
397
397
|
const qs = params.toString();
|
|
398
|
-
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/
|
|
398
|
+
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/asset/${encodeURIComponent(options.assetId)}${qs ? `?${qs}` : ''}`;
|
|
399
399
|
return del(path);
|
|
400
400
|
}
|
|
401
401
|
asset.deleteAdmin = deleteAdmin;
|
|
@@ -403,7 +403,7 @@ export var asset;
|
|
|
403
403
|
* Restore a soft-deleted asset (clears `deletedAt`).
|
|
404
404
|
*/
|
|
405
405
|
async function restoreAdmin(collectionId, assetId) {
|
|
406
|
-
const path = `/admin/collection/${encodeURIComponent(collectionId)}/
|
|
406
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/asset/${encodeURIComponent(assetId)}/restore`;
|
|
407
407
|
return post(path, {});
|
|
408
408
|
}
|
|
409
409
|
asset.restoreAdmin = restoreAdmin;
|
|
@@ -411,7 +411,7 @@ export var asset;
|
|
|
411
411
|
* Soft-delete multiple assets in one request.
|
|
412
412
|
*/
|
|
413
413
|
async function bulkDelete(options) {
|
|
414
|
-
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/
|
|
414
|
+
const path = `/admin/collection/${encodeURIComponent(options.collectionId)}/asset/bulk-delete`;
|
|
415
415
|
const body = { assetIds: options.assetIds };
|
|
416
416
|
if (typeof options.graceDays === 'number')
|
|
417
417
|
body.graceDays = options.graceDays;
|
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/docs/assets.md
CHANGED
|
@@ -103,7 +103,7 @@ All admin endpoints require authentication. Base path: `/api/admin/collection/:c
|
|
|
103
103
|
### List assets
|
|
104
104
|
|
|
105
105
|
```
|
|
106
|
-
GET /
|
|
106
|
+
GET /asset
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
| Parameter | Type | Description |
|
|
@@ -140,7 +140,7 @@ const { data, total } = await Api.asset.listAdmin({
|
|
|
140
140
|
### Get asset
|
|
141
141
|
|
|
142
142
|
```
|
|
143
|
-
GET /
|
|
143
|
+
GET /asset/:assetId
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Returns `Asset` or `404`.
|
|
@@ -152,7 +152,7 @@ Returns `Asset` or `404`.
|
|
|
152
152
|
### Upload asset
|
|
153
153
|
|
|
154
154
|
```
|
|
155
|
-
POST /
|
|
155
|
+
POST /asset
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
Use the existing `Api.asset.upload()` method (file) or `Api.asset.uploadFromUrl()` (URL import).
|
|
@@ -162,7 +162,7 @@ Use the existing `Api.asset.upload()` method (file) or `Api.asset.uploadFromUrl(
|
|
|
162
162
|
### Update asset metadata
|
|
163
163
|
|
|
164
164
|
```
|
|
165
|
-
PUT /
|
|
165
|
+
PUT /asset/:assetId
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
Updates metadata only. Use `/replace` to swap the file.
|
|
@@ -182,7 +182,7 @@ await Api.asset.updateAdmin({
|
|
|
182
182
|
### Replace file
|
|
183
183
|
|
|
184
184
|
```
|
|
185
|
-
POST /
|
|
185
|
+
POST /asset/:assetId/replace
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
Replaces the file; the previous URL is snapshotted into `versions[]`.
|
|
@@ -201,7 +201,7 @@ await Api.asset.replaceFile({
|
|
|
201
201
|
### Delete asset (soft)
|
|
202
202
|
|
|
203
203
|
```
|
|
204
|
-
DELETE /
|
|
204
|
+
DELETE /asset/:assetId?graceDays=30
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
Sets `deletedAt` and schedules CDN purge after `graceDays` (default 30). Recoverable until purge.
|
|
@@ -215,7 +215,7 @@ await Api.asset.deleteAdmin({ collectionId: 'my-collection', assetId: 'abc123',
|
|
|
215
215
|
### Restore asset
|
|
216
216
|
|
|
217
217
|
```
|
|
218
|
-
POST /
|
|
218
|
+
POST /asset/:assetId/restore
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
Clears `deletedAt`. Asset becomes active again.
|
|
@@ -229,7 +229,7 @@ await Api.asset.restoreAdmin('my-collection', 'abc123')
|
|
|
229
229
|
### Bulk delete
|
|
230
230
|
|
|
231
231
|
```
|
|
232
|
-
POST /
|
|
232
|
+
POST /asset/bulk-delete
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
```typescript
|
package/dist/openapi.yaml
CHANGED
|
@@ -105,7 +105,7 @@ paths:
|
|
|
105
105
|
application/json:
|
|
106
106
|
schema:
|
|
107
107
|
$ref: "#/components/schemas/CollectionCreateRequest"
|
|
108
|
-
/admin/collection/
|
|
108
|
+
/admin/collection/asset:
|
|
109
109
|
get:
|
|
110
110
|
tags:
|
|
111
111
|
- asset
|
|
@@ -216,7 +216,7 @@ paths:
|
|
|
216
216
|
application/json:
|
|
217
217
|
schema:
|
|
218
218
|
$ref: "#/components/schemas/UpdateAssetOptions"
|
|
219
|
-
/admin/collection/
|
|
219
|
+
/admin/collection/asset/replace:
|
|
220
220
|
post:
|
|
221
221
|
tags:
|
|
222
222
|
- asset
|
|
@@ -1050,7 +1050,7 @@ paths:
|
|
|
1050
1050
|
application/json:
|
|
1051
1051
|
schema:
|
|
1052
1052
|
$ref: "#/components/schemas/ResponsesRequest"
|
|
1053
|
-
/admin/collection/{collectionId}/
|
|
1053
|
+
/admin/collection/{collectionId}/asset/{assetId}:
|
|
1054
1054
|
get:
|
|
1055
1055
|
tags:
|
|
1056
1056
|
- asset
|
|
@@ -1082,7 +1082,7 @@ paths:
|
|
|
1082
1082
|
description: Unauthorized
|
|
1083
1083
|
404:
|
|
1084
1084
|
description: Not found
|
|
1085
|
-
/admin/collection/{collectionId}/
|
|
1085
|
+
/admin/collection/{collectionId}/asset/{assetId}/restore:
|
|
1086
1086
|
post:
|
|
1087
1087
|
tags:
|
|
1088
1088
|
- asset
|
package/docs/API_SUMMARY.md
CHANGED
package/docs/assets.md
CHANGED
|
@@ -103,7 +103,7 @@ All admin endpoints require authentication. Base path: `/api/admin/collection/:c
|
|
|
103
103
|
### List assets
|
|
104
104
|
|
|
105
105
|
```
|
|
106
|
-
GET /
|
|
106
|
+
GET /asset
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
| Parameter | Type | Description |
|
|
@@ -140,7 +140,7 @@ const { data, total } = await Api.asset.listAdmin({
|
|
|
140
140
|
### Get asset
|
|
141
141
|
|
|
142
142
|
```
|
|
143
|
-
GET /
|
|
143
|
+
GET /asset/:assetId
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Returns `Asset` or `404`.
|
|
@@ -152,7 +152,7 @@ Returns `Asset` or `404`.
|
|
|
152
152
|
### Upload asset
|
|
153
153
|
|
|
154
154
|
```
|
|
155
|
-
POST /
|
|
155
|
+
POST /asset
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
Use the existing `Api.asset.upload()` method (file) or `Api.asset.uploadFromUrl()` (URL import).
|
|
@@ -162,7 +162,7 @@ Use the existing `Api.asset.upload()` method (file) or `Api.asset.uploadFromUrl(
|
|
|
162
162
|
### Update asset metadata
|
|
163
163
|
|
|
164
164
|
```
|
|
165
|
-
PUT /
|
|
165
|
+
PUT /asset/:assetId
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
Updates metadata only. Use `/replace` to swap the file.
|
|
@@ -182,7 +182,7 @@ await Api.asset.updateAdmin({
|
|
|
182
182
|
### Replace file
|
|
183
183
|
|
|
184
184
|
```
|
|
185
|
-
POST /
|
|
185
|
+
POST /asset/:assetId/replace
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
Replaces the file; the previous URL is snapshotted into `versions[]`.
|
|
@@ -201,7 +201,7 @@ await Api.asset.replaceFile({
|
|
|
201
201
|
### Delete asset (soft)
|
|
202
202
|
|
|
203
203
|
```
|
|
204
|
-
DELETE /
|
|
204
|
+
DELETE /asset/:assetId?graceDays=30
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
Sets `deletedAt` and schedules CDN purge after `graceDays` (default 30). Recoverable until purge.
|
|
@@ -215,7 +215,7 @@ await Api.asset.deleteAdmin({ collectionId: 'my-collection', assetId: 'abc123',
|
|
|
215
215
|
### Restore asset
|
|
216
216
|
|
|
217
217
|
```
|
|
218
|
-
POST /
|
|
218
|
+
POST /asset/:assetId/restore
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
Clears `deletedAt`. Asset becomes active again.
|
|
@@ -229,7 +229,7 @@ await Api.asset.restoreAdmin('my-collection', 'abc123')
|
|
|
229
229
|
### Bulk delete
|
|
230
230
|
|
|
231
231
|
```
|
|
232
|
-
POST /
|
|
232
|
+
POST /asset/bulk-delete
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
```typescript
|
package/openapi.yaml
CHANGED
|
@@ -105,7 +105,7 @@ paths:
|
|
|
105
105
|
application/json:
|
|
106
106
|
schema:
|
|
107
107
|
$ref: "#/components/schemas/CollectionCreateRequest"
|
|
108
|
-
/admin/collection/
|
|
108
|
+
/admin/collection/asset:
|
|
109
109
|
get:
|
|
110
110
|
tags:
|
|
111
111
|
- asset
|
|
@@ -216,7 +216,7 @@ paths:
|
|
|
216
216
|
application/json:
|
|
217
217
|
schema:
|
|
218
218
|
$ref: "#/components/schemas/UpdateAssetOptions"
|
|
219
|
-
/admin/collection/
|
|
219
|
+
/admin/collection/asset/replace:
|
|
220
220
|
post:
|
|
221
221
|
tags:
|
|
222
222
|
- asset
|
|
@@ -1050,7 +1050,7 @@ paths:
|
|
|
1050
1050
|
application/json:
|
|
1051
1051
|
schema:
|
|
1052
1052
|
$ref: "#/components/schemas/ResponsesRequest"
|
|
1053
|
-
/admin/collection/{collectionId}/
|
|
1053
|
+
/admin/collection/{collectionId}/asset/{assetId}:
|
|
1054
1054
|
get:
|
|
1055
1055
|
tags:
|
|
1056
1056
|
- asset
|
|
@@ -1082,7 +1082,7 @@ paths:
|
|
|
1082
1082
|
description: Unauthorized
|
|
1083
1083
|
404:
|
|
1084
1084
|
description: Not found
|
|
1085
|
-
/admin/collection/{collectionId}/
|
|
1085
|
+
/admin/collection/{collectionId}/asset/{assetId}/restore:
|
|
1086
1086
|
post:
|
|
1087
1087
|
tags:
|
|
1088
1088
|
- asset
|