@omelhorsite/sdk 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.js +4939 -552
- package/dist/types/client.d.ts +60 -3
- package/dist/types/http.d.ts +444 -19
- package/dist/types/index.d.ts +4 -1
- package/dist/types/resources/account.d.ts +66 -3
- package/dist/types/resources/admin.d.ts +1837 -0
- package/dist/types/resources/auth/index.d.ts +39 -0
- package/dist/types/resources/auth/passkeys.d.ts +652 -0
- package/dist/types/resources/auth/sessions.d.ts +847 -0
- package/dist/types/resources/chests.d.ts +54 -3
- package/dist/types/resources/content.d.ts +2970 -0
- package/dist/types/resources/dynamicQrs.d.ts +39 -3
- package/dist/types/resources/forms.d.ts +176 -35
- package/dist/types/resources/index.d.ts +19 -8
- package/dist/types/resources/ipLookup.d.ts +20 -4
- package/dist/types/resources/jobs.d.ts +62 -21
- package/dist/types/resources/library.d.ts +1435 -0
- package/dist/types/resources/linkTrees.d.ts +142 -30
- package/dist/types/resources/media.d.ts +351 -0
- package/dist/types/resources/movies.d.ts +1186 -0
- package/dist/types/resources/music/artists.d.ts +1066 -0
- package/dist/types/resources/music/imports.d.ts +940 -0
- package/dist/types/resources/music/index.d.ts +61 -0
- package/dist/types/resources/music/playlists.d.ts +1026 -0
- package/dist/types/resources/music/social.d.ts +1132 -0
- package/dist/types/resources/music/songs.d.ts +1183 -0
- package/dist/types/resources/notepads.d.ts +4 -1
- package/dist/types/resources/quotas.d.ts +7 -1
- package/dist/types/resources/realtime.d.ts +855 -0
- package/dist/types/resources/shortLinks.d.ts +45 -4
- package/dist/types/resources/social.d.ts +1330 -0
- package/dist/types/resources/storage/upload.d.ts +158 -11
- package/dist/types/resources/storage.d.ts +88 -22
- package/dist/types/resources/tickets.d.ts +82 -3
- package/dist/types/resources/tools/backgroundRemoval.d.ts +18 -3
- package/dist/types/resources/tools/captions.d.ts +448 -21
- package/dist/types/resources/tools/downloader.d.ts +21 -0
- package/dist/types/resources/tools/index.d.ts +57 -15
- package/dist/types/resources/tools/jumpstyle.d.ts +50 -17
- package/dist/types/resources/tools/transcription.d.ts +35 -13
- package/dist/types/resources/tools/upscale.d.ts +23 -3
- package/dist/types/resources/tools/vocalSeparation.d.ts +30 -13
- package/dist/types/types.d.ts +249 -17
- package/package.json +2 -1
|
@@ -141,11 +141,62 @@ export declare class ChestEntriesNamespace extends Resource {
|
|
|
141
141
|
/**
|
|
142
142
|
* `GET /chest_entries/:id/data` - the entry's bytes.
|
|
143
143
|
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* SENT WITH NO CREDENTIAL, deliberately. `ChestEntriesController` lists
|
|
145
|
+
* `data` in `allow_unauthenticated_access`, and the action itself is three
|
|
146
|
+
* lines: find the entry by id, check that something is attached, redirect.
|
|
147
|
+
* It never looks at the chest name, the chest token, or who is asking. The
|
|
148
|
+
* ENTRY ID IS THE WHOLE CAPABILITY - which is worth knowing for its own sake,
|
|
149
|
+
* and which also means a credential on this request could not possibly change
|
|
150
|
+
* the answer.
|
|
151
|
+
*
|
|
152
|
+
* That matters because sending one breaks the call in a browser. The action
|
|
153
|
+
* answers `302` to `minio.omelhorsite.pt`, and following that hop replaces the
|
|
154
|
+
* request's origin with an opaque one (Fetch standard: a cross-origin
|
|
155
|
+
* redirect of a CORS request whose origin already differs from the current
|
|
156
|
+
* URL's origin), so the store sees `Origin: null` and answers
|
|
157
|
+
* `Access-Control-Allow-Origin: *`. Wildcard plus credentials is illegal, so a
|
|
158
|
+
* client built with `sessionCookie: true` - the production web app - would
|
|
159
|
+
* have the browser reject the bytes with an opaque "Failed to fetch". Asking
|
|
160
|
+
* anonymously sidesteps it: `*` is fine for an uncredentialed request.
|
|
161
|
+
*
|
|
162
|
+
* Two shapes come back and both are handled here. Against MinIO it is the
|
|
163
|
+
* `302`. Against a Disk service (dev, test) presigning raises `ArgumentError`
|
|
164
|
+
* and the controller falls back to `send_data`, so the bytes arrive inline
|
|
165
|
+
* from Rails with a `Content-Disposition`. Either way this returns the bytes.
|
|
166
|
+
*
|
|
167
|
+
* Going around the transport costs the usual thing: no retry, no per-call
|
|
168
|
+
* deadline, only the caller's `signal`. Use {@link downloadUrl} when the
|
|
169
|
+
* destination is an `<a download>` or a media element rather than memory.
|
|
170
|
+
*
|
|
171
|
+
* @throws {OmsApiError} 404 when the entry is unknown, its bytes never
|
|
172
|
+
* landed, or the chest has passed its two-hour expiry and been swept.
|
|
147
173
|
*/
|
|
148
174
|
download(id: Id, options?: RequestOptions): Promise<Blob>;
|
|
175
|
+
/**
|
|
176
|
+
* Absolute URL for an entry's bytes, for an `<a download>`, a `<video>`, or a
|
|
177
|
+
* new tab.
|
|
178
|
+
*
|
|
179
|
+
* Synchronous and credential-free, because the endpoint is: the entry id is
|
|
180
|
+
* the only thing it checks. The frontend's older helper appended a `?token=`
|
|
181
|
+
* here; this deliberately does not, because a session token in a URL that
|
|
182
|
+
* ends up in markup, in a shared link and in an access log buys precisely
|
|
183
|
+
* nothing on a route that never reads it.
|
|
184
|
+
*
|
|
185
|
+
* Treat the URL as a bearer capability all the same. Anyone holding it can
|
|
186
|
+
* pull the file until the chest expires, so it is exactly as shareable as the
|
|
187
|
+
* chest name and no more.
|
|
188
|
+
*
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <a href={oms.chests.entries.downloadUrl(entry.id)} download={entry.name}>
|
|
191
|
+
* {entry.name}
|
|
192
|
+
* </a>
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* A link is also the better answer for a large entry: the browser streams it
|
|
196
|
+
* straight to disk, where {@link download} would buffer the whole file in
|
|
197
|
+
* memory first.
|
|
198
|
+
*/
|
|
199
|
+
downloadUrl(id: Id): string;
|
|
149
200
|
/**
|
|
150
201
|
* `DELETE /chest_entries/:id` - removes an entry and gives its bytes back to
|
|
151
202
|
* the chest's ceiling.
|