@meshery/schemas 1.3.108 → 1.3.109
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/cloudApi.d.mts +8624 -4661
- package/dist/cloudApi.d.ts +8624 -4661
- package/dist/cloudApi.js +1 -1
- package/dist/cloudApi.mjs +1 -1
- package/dist/constructs/v1beta3/content_item/ContentItem.d.ts +682 -33
- package/dist/constructs/v1beta3/content_item/ContentItemSchema.js +215 -22
- package/dist/constructs/v1beta3/content_item/ContentItemSchema.mjs +215 -22
- package/dist/constructs/v1beta3/media_asset/MediaAsset.d.ts +2322 -0
- package/dist/constructs/v1beta3/media_asset/MediaAssetSchema.d.ts +2 -0
- package/dist/constructs/v1beta3/media_asset/MediaAssetSchema.js +61 -0
- package/dist/constructs/v1beta3/media_asset/MediaAssetSchema.mjs +61 -0
- package/dist/constructs/v1beta3/mention_alias/MentionAlias.d.ts +678 -0
- package/dist/constructs/v1beta3/mention_alias/MentionAlias.js +1 -0
- package/dist/constructs/v1beta3/mention_alias/MentionAlias.mjs +0 -0
- package/dist/constructs/v1beta3/mention_alias/MentionAliasSchema.d.ts +2 -0
- package/dist/constructs/v1beta3/mention_alias/MentionAliasSchema.js +75 -0
- package/dist/constructs/v1beta3/mention_alias/MentionAliasSchema.mjs +75 -0
- package/dist/constructs/v1beta3/{risk_profile/RiskProfile.d.ts → posture/Posture.d.ts} +7 -7
- package/dist/constructs/v1beta3/posture/Posture.js +1 -0
- package/dist/constructs/v1beta3/posture/Posture.mjs +0 -0
- package/dist/constructs/v1beta3/posture/PostureSchema.d.ts +2 -0
- package/dist/constructs/v1beta3/posture/PostureSchema.js +22 -0
- package/dist/constructs/v1beta3/posture/PostureSchema.mjs +22 -0
- package/dist/constructs/v1beta3/schedule/Schedule.d.ts +41 -41
- package/dist/constructs/v1beta3/schedule/ScheduleSchema.js +23 -23
- package/dist/constructs/v1beta3/schedule/ScheduleSchema.mjs +23 -23
- package/dist/index.d.mts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/constructs/v1beta3/risk_profile/RiskProfileSchema.d.ts +0 -2
- package/dist/constructs/v1beta3/risk_profile/RiskProfileSchema.js +0 -22
- package/dist/constructs/v1beta3/risk_profile/RiskProfileSchema.mjs +0 -22
- /package/dist/constructs/v1beta3/{risk_profile/RiskProfile.js → media_asset/MediaAsset.js} +0 -0
- /package/dist/constructs/v1beta3/{risk_profile/RiskProfile.mjs → media_asset/MediaAsset.mjs} +0 -0
|
@@ -0,0 +1,2322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface paths {
|
|
7
|
+
"/api/media-assets": {
|
|
8
|
+
parameters: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* List media assets
|
|
16
|
+
* @description Returns a paginated list of the live media assets in the
|
|
17
|
+
* organization of the authenticated session, newest first unless
|
|
18
|
+
* `order` names another column (`createdAt`, `expiresAt`, `bytes`).
|
|
19
|
+
* `search` matches `name`, case-insensitively. Deleted assets are
|
|
20
|
+
* never listed; `expired` and `rejected` assets are listed until they
|
|
21
|
+
* are deleted.
|
|
22
|
+
*/
|
|
23
|
+
get: operations["listMediaAssets"];
|
|
24
|
+
put?: never;
|
|
25
|
+
/**
|
|
26
|
+
* Create a media asset and its upload URL
|
|
27
|
+
* @description Records a new `pending` asset from the declared `contentType`,
|
|
28
|
+
* `bytes` and `sha256`, and answers it with a short-lived upload URL.
|
|
29
|
+
* The client sends the file's bytes to `upload.url` with one request
|
|
30
|
+
* using `upload.method` and exactly the `upload.headers`, before
|
|
31
|
+
* `upload.expiresAt`, then calls `completeMediaAsset`. The server
|
|
32
|
+
* derives `kind` from `contentType` and sets `expiresAt` to the end
|
|
33
|
+
* of the upload window.
|
|
34
|
+
* Refused with 400 when `contentType` is not one the provider accepts
|
|
35
|
+
* (`MediaAssetQuota.contentTypes`), when `bytes` exceeds the
|
|
36
|
+
* per-kind limit (`maxImageBytes`, `maxVideoBytes`), when `backend`
|
|
37
|
+
* is one the provider does not serve, when `gdrive` is named without
|
|
38
|
+
* a `connectionId` or `r2` with one, and when `retainUntil` is not in
|
|
39
|
+
* the future or lies beyond `maxRetentionDays` from now. Refused with
|
|
40
|
+
* 409 when the asset would take the organization past `bytesLimit`.
|
|
41
|
+
* A `connectionId` that is not the caller's own live Google Drive
|
|
42
|
+
* connection in the session organization receives 404.
|
|
43
|
+
* Every create is a new asset; nothing is deduplicated by `sha256`. A
|
|
44
|
+
* create that is never completed is reaped when its upload window
|
|
45
|
+
* ends.
|
|
46
|
+
*/
|
|
47
|
+
post: operations["createMediaAsset"];
|
|
48
|
+
delete?: never;
|
|
49
|
+
options?: never;
|
|
50
|
+
head?: never;
|
|
51
|
+
patch?: never;
|
|
52
|
+
trace?: never;
|
|
53
|
+
};
|
|
54
|
+
"/api/media-assets/quota": {
|
|
55
|
+
parameters: {
|
|
56
|
+
query?: never;
|
|
57
|
+
header?: never;
|
|
58
|
+
path?: never;
|
|
59
|
+
cookie?: never;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Get the media asset limits and usage of the organization
|
|
63
|
+
* @description Answers the limits `createMediaAsset` and `updateMediaAsset`
|
|
64
|
+
* enforce in the session organization, and how much of its storage
|
|
65
|
+
* is in use. A client reads it before uploading so it refuses an
|
|
66
|
+
* oversized or unsupported file by name instead of meeting a 400.
|
|
67
|
+
*/
|
|
68
|
+
get: operations["getMediaAssetQuota"];
|
|
69
|
+
put?: never;
|
|
70
|
+
post?: never;
|
|
71
|
+
delete?: never;
|
|
72
|
+
options?: never;
|
|
73
|
+
head?: never;
|
|
74
|
+
patch?: never;
|
|
75
|
+
trace?: never;
|
|
76
|
+
};
|
|
77
|
+
"/api/media-assets/{mediaAssetId}": {
|
|
78
|
+
parameters: {
|
|
79
|
+
query?: never;
|
|
80
|
+
header?: never;
|
|
81
|
+
path?: never;
|
|
82
|
+
cookie?: never;
|
|
83
|
+
};
|
|
84
|
+
/** Get a media asset by ID */
|
|
85
|
+
get: operations["getMediaAsset"];
|
|
86
|
+
/**
|
|
87
|
+
* Change how long a media asset is kept
|
|
88
|
+
* @description Sets `retainUntil`, the only field of an asset that changes after
|
|
89
|
+
* create, for example when the post that uses it is rescheduled. On a
|
|
90
|
+
* `ready` asset `expiresAt` becomes `retainUntil`, so retention can be
|
|
91
|
+
* shortened as well as extended; on a `pending` asset it is recorded
|
|
92
|
+
* and applied when the asset is completed. Refused with 400 when
|
|
93
|
+
* `retainUntil` is not in the future or lies beyond
|
|
94
|
+
* `maxRetentionDays` from now, and with 409 when the asset is
|
|
95
|
+
* `rejected` or `expired`.
|
|
96
|
+
*/
|
|
97
|
+
put: operations["updateMediaAsset"];
|
|
98
|
+
post?: never;
|
|
99
|
+
/**
|
|
100
|
+
* Delete a media asset
|
|
101
|
+
* @description Deletes the asset, whatever its status: from then on it answers 404
|
|
102
|
+
* and no download is minted for it. The stored bytes of an `r2` asset
|
|
103
|
+
* are removed. The file of a `gdrive` asset is the person's and stays
|
|
104
|
+
* in their Drive. Deleting does not check whether a content item
|
|
105
|
+
* still refers to the asset; a content item that does is refused by
|
|
106
|
+
* name when it is posted.
|
|
107
|
+
*/
|
|
108
|
+
delete: operations["deleteMediaAsset"];
|
|
109
|
+
options?: never;
|
|
110
|
+
head?: never;
|
|
111
|
+
patch?: never;
|
|
112
|
+
trace?: never;
|
|
113
|
+
};
|
|
114
|
+
"/api/media-assets/{mediaAssetId}/complete": {
|
|
115
|
+
parameters: {
|
|
116
|
+
query?: never;
|
|
117
|
+
header?: never;
|
|
118
|
+
path?: never;
|
|
119
|
+
cookie?: never;
|
|
120
|
+
};
|
|
121
|
+
get?: never;
|
|
122
|
+
put?: never;
|
|
123
|
+
/**
|
|
124
|
+
* Complete a media asset upload
|
|
125
|
+
* @description Checks the stored bytes of a `pending` asset against its
|
|
126
|
+
* declaration: the size must equal `bytes`, the type sniffed from the
|
|
127
|
+
* bytes must be `contentType` (the extension and any declared header
|
|
128
|
+
* are never trusted), and the SHA-256 must equal `sha256`. On a match
|
|
129
|
+
* the asset becomes `ready`, `completedAt` is set and `expiresAt`
|
|
130
|
+
* moves to the end of its retention. On a mismatch, or when nothing
|
|
131
|
+
* was uploaded, the asset becomes `rejected` with a
|
|
132
|
+
* `rejectionReason`, its stored bytes are removed, and the call is
|
|
133
|
+
* refused with 409; the client creates a new asset to try again.
|
|
134
|
+
* Completing a `ready` asset answers it unchanged, so a retried
|
|
135
|
+
* completion is safe. Completing a `rejected` or `expired` asset is
|
|
136
|
+
* refused with 409.
|
|
137
|
+
*/
|
|
138
|
+
post: operations["completeMediaAsset"];
|
|
139
|
+
delete?: never;
|
|
140
|
+
options?: never;
|
|
141
|
+
head?: never;
|
|
142
|
+
patch?: never;
|
|
143
|
+
trace?: never;
|
|
144
|
+
};
|
|
145
|
+
"/api/media-assets/{mediaAssetId}/download": {
|
|
146
|
+
parameters: {
|
|
147
|
+
query?: never;
|
|
148
|
+
header?: never;
|
|
149
|
+
path?: never;
|
|
150
|
+
cookie?: never;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Get a short-lived download URL for a media asset
|
|
154
|
+
* @description Mints a fresh download URL for a `ready` asset, valid for minutes.
|
|
155
|
+
* Call it just before the file is used and never store the answer: a
|
|
156
|
+
* scheduled post asks for a new URL when it runs. For `r2` the URL is
|
|
157
|
+
* a signed URL on the provider's object storage; for `gdrive` it is a
|
|
158
|
+
* signed `getMediaAssetContent` URL on the provider, which relays the
|
|
159
|
+
* bytes from the person's Drive so that no Google token leaves the
|
|
160
|
+
* provider. A `pending`, `rejected` or `expired` asset is refused
|
|
161
|
+
* with 409. The reader checks the downloaded bytes against `bytes`
|
|
162
|
+
* and `sha256` before using them.
|
|
163
|
+
*/
|
|
164
|
+
get: operations["getMediaAssetDownload"];
|
|
165
|
+
put?: never;
|
|
166
|
+
post?: never;
|
|
167
|
+
delete?: never;
|
|
168
|
+
options?: never;
|
|
169
|
+
head?: never;
|
|
170
|
+
patch?: never;
|
|
171
|
+
trace?: never;
|
|
172
|
+
};
|
|
173
|
+
"/api/media-assets/{mediaAssetId}/content": {
|
|
174
|
+
parameters: {
|
|
175
|
+
query?: never;
|
|
176
|
+
header?: never;
|
|
177
|
+
path?: never;
|
|
178
|
+
cookie?: never;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Download the bytes of a Drive-backed media asset
|
|
182
|
+
* @description Streams the bytes of a `ready` `gdrive` asset from the person's
|
|
183
|
+
* Google Drive. This route is only ever reached through a URL that
|
|
184
|
+
* `getMediaAssetDownload` minted: it takes no session, and the
|
|
185
|
+
* `expires` and `signature` it carries are the whole grant, valid
|
|
186
|
+
* for that one asset until `expires`. The response `Content-Type` is
|
|
187
|
+
* the asset's `contentType`. A missing, altered or lapsed signature
|
|
188
|
+
* is refused with 403; an asset that was deleted, expired or is not
|
|
189
|
+
* `gdrive` since the URL was minted receives 404; a Drive file that
|
|
190
|
+
* was removed, moved out of reach or whose grant was revoked is
|
|
191
|
+
* refused with 502.
|
|
192
|
+
*/
|
|
193
|
+
get: operations["getMediaAssetContent"];
|
|
194
|
+
put?: never;
|
|
195
|
+
post?: never;
|
|
196
|
+
delete?: never;
|
|
197
|
+
options?: never;
|
|
198
|
+
head?: never;
|
|
199
|
+
patch?: never;
|
|
200
|
+
trace?: never;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export type webhooks = Record<string, never>;
|
|
204
|
+
export interface components {
|
|
205
|
+
schemas: {
|
|
206
|
+
/**
|
|
207
|
+
* Media Asset Schema
|
|
208
|
+
* @description Server-returned media asset: one image or video file an organization
|
|
209
|
+
* uploaded so that a content item can post it without a link. A content
|
|
210
|
+
* item refers to an asset by its `id`, never by a URL; a short-lived
|
|
211
|
+
* download URL is minted only when the file is about to be used
|
|
212
|
+
* (`getMediaAssetDownload`) and is never stored.
|
|
213
|
+
* An asset is created `pending` with a short-lived upload URL, becomes
|
|
214
|
+
* `ready` once `completeMediaAsset` has checked the stored bytes against
|
|
215
|
+
* the declared size, type and SHA-256, or `rejected` when they do not
|
|
216
|
+
* match. A `pending` asset that is never completed, and a `ready` asset
|
|
217
|
+
* whose retention ended, read as `expired` from `expiresAt` on: expiry is
|
|
218
|
+
* evaluated when the asset is read, so an asset never reads `pending` or
|
|
219
|
+
* `ready` past its `expiresAt`.
|
|
220
|
+
* No field carries a storage credential, a bucket name, an object key or a
|
|
221
|
+
* signed URL. The bytes live in the backend `backend` names, under a
|
|
222
|
+
* location only the server knows.
|
|
223
|
+
*/
|
|
224
|
+
MediaAsset: {
|
|
225
|
+
/**
|
|
226
|
+
* Format: uuid
|
|
227
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
228
|
+
*/
|
|
229
|
+
id: string;
|
|
230
|
+
/**
|
|
231
|
+
* Format: uuid
|
|
232
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
233
|
+
*/
|
|
234
|
+
organizationId: string;
|
|
235
|
+
/**
|
|
236
|
+
* Format: uuid
|
|
237
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
238
|
+
*/
|
|
239
|
+
createdBy?: string;
|
|
240
|
+
/**
|
|
241
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
242
|
+
* @enum {string}
|
|
243
|
+
*/
|
|
244
|
+
backend: "r2" | "gdrive";
|
|
245
|
+
/**
|
|
246
|
+
* Format: uuid
|
|
247
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
248
|
+
*/
|
|
249
|
+
connectionId?: string;
|
|
250
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
251
|
+
externalId?: string;
|
|
252
|
+
/**
|
|
253
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
254
|
+
* @enum {string}
|
|
255
|
+
*/
|
|
256
|
+
kind: "image" | "video";
|
|
257
|
+
/**
|
|
258
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
259
|
+
* @enum {string}
|
|
260
|
+
*/
|
|
261
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
262
|
+
/**
|
|
263
|
+
* Format: int64
|
|
264
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
265
|
+
*/
|
|
266
|
+
bytes: number;
|
|
267
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
268
|
+
sha256: string;
|
|
269
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
270
|
+
name?: string;
|
|
271
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
272
|
+
locationStripped: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
275
|
+
* @enum {string}
|
|
276
|
+
*/
|
|
277
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
278
|
+
/**
|
|
279
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
280
|
+
* @enum {string}
|
|
281
|
+
*/
|
|
282
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
283
|
+
/**
|
|
284
|
+
* Format: date-time
|
|
285
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
286
|
+
*/
|
|
287
|
+
retainUntil?: string | null;
|
|
288
|
+
/**
|
|
289
|
+
* Format: date-time
|
|
290
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
291
|
+
*/
|
|
292
|
+
completedAt?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* Format: date-time
|
|
295
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
296
|
+
*/
|
|
297
|
+
expiresAt: string;
|
|
298
|
+
/**
|
|
299
|
+
* Format: date-time
|
|
300
|
+
* @description Timestamp of media asset creation.
|
|
301
|
+
*/
|
|
302
|
+
createdAt: string;
|
|
303
|
+
/**
|
|
304
|
+
* Format: date-time
|
|
305
|
+
* @description Timestamp of last media asset modification.
|
|
306
|
+
*/
|
|
307
|
+
updatedAt: string;
|
|
308
|
+
/**
|
|
309
|
+
* Format: date-time
|
|
310
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
311
|
+
*/
|
|
312
|
+
deletedAt?: string | null;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* @description Where the asset's bytes are stored. `r2` is the provider's own private object storage; `gdrive` is the uploading person's Google Drive, reached through their Google Drive connection. A reader never branches on it: `getMediaAssetDownload` answers the same shape for both.
|
|
316
|
+
* @enum {string}
|
|
317
|
+
*/
|
|
318
|
+
MediaAssetBackend: "r2" | "gdrive";
|
|
319
|
+
/**
|
|
320
|
+
* @description Whether the asset is an image or a video. Derived by the server from `contentType`.
|
|
321
|
+
* @enum {string}
|
|
322
|
+
*/
|
|
323
|
+
MediaAssetKind: "image" | "video";
|
|
324
|
+
/**
|
|
325
|
+
* @description Media type of the file, from a closed allowlist. The server sniffs the stored bytes on completion and rejects an upload whose real type differs. A provider may accept fewer types than this list (`MediaAssetQuota.contentTypes`).
|
|
326
|
+
* @enum {string}
|
|
327
|
+
*/
|
|
328
|
+
MediaAssetContentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
329
|
+
/**
|
|
330
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
331
|
+
* @enum {string}
|
|
332
|
+
*/
|
|
333
|
+
MediaAssetStatus: "pending" | "ready" | "rejected" | "expired";
|
|
334
|
+
/**
|
|
335
|
+
* @description Why `completeMediaAsset` rejected the upload: `missing` when no bytes were stored, `size` when their size differs from `bytes`, `type` when the sniffed type differs from `contentType`, `checksum` when their SHA-256 differs from `sha256`. Set only on a `rejected` asset.
|
|
336
|
+
* @enum {string}
|
|
337
|
+
*/
|
|
338
|
+
MediaAssetRejectionReason: "missing" | "size" | "type" | "checksum";
|
|
339
|
+
/**
|
|
340
|
+
* @description Payload for creating a media asset. Contains only client-settable
|
|
341
|
+
* fields; the owning `organizationId` and `createdBy` (from the
|
|
342
|
+
* session), `kind` (derived from `contentType`), `status`,
|
|
343
|
+
* `rejectionReason`, `externalId`, `completedAt`, `expiresAt` and the
|
|
344
|
+
* timestamps are server-owned and not accepted.
|
|
345
|
+
*/
|
|
346
|
+
MediaAssetPayload: {
|
|
347
|
+
/**
|
|
348
|
+
* @description Media type of the file, from a closed allowlist. The server sniffs the stored bytes on completion and rejects an upload whose real type differs. A provider may accept fewer types than this list (`MediaAssetQuota.contentTypes`).
|
|
349
|
+
* @enum {string}
|
|
350
|
+
*/
|
|
351
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
352
|
+
/**
|
|
353
|
+
* Format: int64
|
|
354
|
+
* @description Size of the file in bytes. Must not exceed the quota's limit for its kind.
|
|
355
|
+
*/
|
|
356
|
+
bytes: number;
|
|
357
|
+
/** @description Lowercase hex SHA-256 of the exact bytes that will be uploaded. */
|
|
358
|
+
sha256: string;
|
|
359
|
+
/** @description Display name of the file, typically its original file name. */
|
|
360
|
+
name?: string;
|
|
361
|
+
/** @description Whether the client removed location metadata (EXIF and XMP GPS, maker notes, device serial numbers) from the file before hashing and uploading it. Recorded as sent. */
|
|
362
|
+
locationStripped: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* @description Where to store the file. Omitted, the server stores it in `r2`.
|
|
365
|
+
* @enum {string}
|
|
366
|
+
*/
|
|
367
|
+
backend?: "r2" | "gdrive";
|
|
368
|
+
/**
|
|
369
|
+
* Format: uuid
|
|
370
|
+
* @description The caller's own live Google Drive connection in the session organization. Required when `backend` is `gdrive`, refused otherwise.
|
|
371
|
+
*/
|
|
372
|
+
connectionId?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Format: date-time
|
|
375
|
+
* @description Time the asset must stay downloadable until, for example a little after the post that uses it is scheduled. Omitted, the organization's default retention applies from completion.
|
|
376
|
+
*/
|
|
377
|
+
retainUntil?: string;
|
|
378
|
+
};
|
|
379
|
+
/** @description Payload for changing how long a media asset is kept. Retention is the only field that changes after create. */
|
|
380
|
+
MediaAssetUpdatePayload: {
|
|
381
|
+
/**
|
|
382
|
+
* Format: date-time
|
|
383
|
+
* @description New time the asset must stay downloadable until. Must be in the future and within `maxRetentionDays` from now.
|
|
384
|
+
*/
|
|
385
|
+
retainUntil: string;
|
|
386
|
+
};
|
|
387
|
+
/** @description A short-lived grant to move one file's bytes: send one request with `method` to `url` carrying exactly `headers`, before `expiresAt`. The URL is the only credential, it covers this one file, and it must be treated as a secret: never store it, log it or put it in a content item. */
|
|
388
|
+
MediaAssetTransfer: {
|
|
389
|
+
/**
|
|
390
|
+
* @description HTTP method to use. `PUT` for an upload, `GET` for a download.
|
|
391
|
+
* @enum {string}
|
|
392
|
+
*/
|
|
393
|
+
method: "PUT" | "GET";
|
|
394
|
+
/**
|
|
395
|
+
* Format: uri
|
|
396
|
+
* @description Absolute HTTPS URL to send the request to.
|
|
397
|
+
*/
|
|
398
|
+
url: string;
|
|
399
|
+
/** @description Headers the request must carry, verbatim (for an upload, at least `Content-Type`, and any integrity header the signature binds). Empty when none are needed. Never contains an authorization header. */
|
|
400
|
+
headers: {
|
|
401
|
+
[key: string]: string;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Format: date-time
|
|
405
|
+
* @description Time the URL stops working.
|
|
406
|
+
*/
|
|
407
|
+
expiresAt: string;
|
|
408
|
+
};
|
|
409
|
+
/** @description Answer to `createMediaAsset`: the new `pending` asset and the grant to upload its bytes. */
|
|
410
|
+
MediaAssetUpload: {
|
|
411
|
+
/**
|
|
412
|
+
* Media Asset Schema
|
|
413
|
+
* @description Server-returned media asset: one image or video file an organization
|
|
414
|
+
* uploaded so that a content item can post it without a link. A content
|
|
415
|
+
* item refers to an asset by its `id`, never by a URL; a short-lived
|
|
416
|
+
* download URL is minted only when the file is about to be used
|
|
417
|
+
* (`getMediaAssetDownload`) and is never stored.
|
|
418
|
+
* An asset is created `pending` with a short-lived upload URL, becomes
|
|
419
|
+
* `ready` once `completeMediaAsset` has checked the stored bytes against
|
|
420
|
+
* the declared size, type and SHA-256, or `rejected` when they do not
|
|
421
|
+
* match. A `pending` asset that is never completed, and a `ready` asset
|
|
422
|
+
* whose retention ended, read as `expired` from `expiresAt` on: expiry is
|
|
423
|
+
* evaluated when the asset is read, so an asset never reads `pending` or
|
|
424
|
+
* `ready` past its `expiresAt`.
|
|
425
|
+
* No field carries a storage credential, a bucket name, an object key or a
|
|
426
|
+
* signed URL. The bytes live in the backend `backend` names, under a
|
|
427
|
+
* location only the server knows.
|
|
428
|
+
*/
|
|
429
|
+
mediaAsset: {
|
|
430
|
+
/**
|
|
431
|
+
* Format: uuid
|
|
432
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
433
|
+
*/
|
|
434
|
+
id: string;
|
|
435
|
+
/**
|
|
436
|
+
* Format: uuid
|
|
437
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
438
|
+
*/
|
|
439
|
+
organizationId: string;
|
|
440
|
+
/**
|
|
441
|
+
* Format: uuid
|
|
442
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
443
|
+
*/
|
|
444
|
+
createdBy?: string;
|
|
445
|
+
/**
|
|
446
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
447
|
+
* @enum {string}
|
|
448
|
+
*/
|
|
449
|
+
backend: "r2" | "gdrive";
|
|
450
|
+
/**
|
|
451
|
+
* Format: uuid
|
|
452
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
453
|
+
*/
|
|
454
|
+
connectionId?: string;
|
|
455
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
456
|
+
externalId?: string;
|
|
457
|
+
/**
|
|
458
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
459
|
+
* @enum {string}
|
|
460
|
+
*/
|
|
461
|
+
kind: "image" | "video";
|
|
462
|
+
/**
|
|
463
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
464
|
+
* @enum {string}
|
|
465
|
+
*/
|
|
466
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
467
|
+
/**
|
|
468
|
+
* Format: int64
|
|
469
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
470
|
+
*/
|
|
471
|
+
bytes: number;
|
|
472
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
473
|
+
sha256: string;
|
|
474
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
475
|
+
name?: string;
|
|
476
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
477
|
+
locationStripped: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
480
|
+
* @enum {string}
|
|
481
|
+
*/
|
|
482
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
483
|
+
/**
|
|
484
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
485
|
+
* @enum {string}
|
|
486
|
+
*/
|
|
487
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
488
|
+
/**
|
|
489
|
+
* Format: date-time
|
|
490
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
491
|
+
*/
|
|
492
|
+
retainUntil?: string | null;
|
|
493
|
+
/**
|
|
494
|
+
* Format: date-time
|
|
495
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
496
|
+
*/
|
|
497
|
+
completedAt?: string | null;
|
|
498
|
+
/**
|
|
499
|
+
* Format: date-time
|
|
500
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
501
|
+
*/
|
|
502
|
+
expiresAt: string;
|
|
503
|
+
/**
|
|
504
|
+
* Format: date-time
|
|
505
|
+
* @description Timestamp of media asset creation.
|
|
506
|
+
*/
|
|
507
|
+
createdAt: string;
|
|
508
|
+
/**
|
|
509
|
+
* Format: date-time
|
|
510
|
+
* @description Timestamp of last media asset modification.
|
|
511
|
+
*/
|
|
512
|
+
updatedAt: string;
|
|
513
|
+
/**
|
|
514
|
+
* Format: date-time
|
|
515
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
516
|
+
*/
|
|
517
|
+
deletedAt?: string | null;
|
|
518
|
+
};
|
|
519
|
+
/** @description A short-lived grant to move one file's bytes: send one request with `method` to `url` carrying exactly `headers`, before `expiresAt`. The URL is the only credential, it covers this one file, and it must be treated as a secret: never store it, log it or put it in a content item. */
|
|
520
|
+
upload: {
|
|
521
|
+
/**
|
|
522
|
+
* @description HTTP method to use. `PUT` for an upload, `GET` for a download.
|
|
523
|
+
* @enum {string}
|
|
524
|
+
*/
|
|
525
|
+
method: "PUT" | "GET";
|
|
526
|
+
/**
|
|
527
|
+
* Format: uri
|
|
528
|
+
* @description Absolute HTTPS URL to send the request to.
|
|
529
|
+
*/
|
|
530
|
+
url: string;
|
|
531
|
+
/** @description Headers the request must carry, verbatim (for an upload, at least `Content-Type`, and any integrity header the signature binds). Empty when none are needed. Never contains an authorization header. */
|
|
532
|
+
headers: {
|
|
533
|
+
[key: string]: string;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Format: date-time
|
|
537
|
+
* @description Time the URL stops working.
|
|
538
|
+
*/
|
|
539
|
+
expiresAt: string;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
/** @description The media asset limits of the session organization and its current storage use. */
|
|
543
|
+
MediaAssetQuota: {
|
|
544
|
+
/** @description Backends this provider serves for the organization. A create naming another is refused with 400. */
|
|
545
|
+
backends: ("r2" | "gdrive")[];
|
|
546
|
+
/** @description Content types this provider accepts. */
|
|
547
|
+
contentTypes: ("image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm")[];
|
|
548
|
+
/**
|
|
549
|
+
* Format: int64
|
|
550
|
+
* @description Largest image a create accepts, in bytes.
|
|
551
|
+
*/
|
|
552
|
+
maxImageBytes: number;
|
|
553
|
+
/**
|
|
554
|
+
* Format: int64
|
|
555
|
+
* @description Largest video a create accepts, in bytes.
|
|
556
|
+
*/
|
|
557
|
+
maxVideoBytes: number;
|
|
558
|
+
/** @description How long a `pending` asset waits for its upload and completion before it expires, in seconds. */
|
|
559
|
+
uploadWindowSeconds: number;
|
|
560
|
+
/** @description Days a `ready` asset is kept after completion when no `retainUntil` was set. */
|
|
561
|
+
defaultRetentionDays: number;
|
|
562
|
+
/** @description Furthest `retainUntil` may lie from now, in days. */
|
|
563
|
+
maxRetentionDays: number;
|
|
564
|
+
/**
|
|
565
|
+
* Format: int64
|
|
566
|
+
* @description Total bytes the organization's live `pending` and `ready` assets may hold. Null when the organization has no storage limit.
|
|
567
|
+
*/
|
|
568
|
+
bytesLimit: number | null;
|
|
569
|
+
/**
|
|
570
|
+
* Format: int64
|
|
571
|
+
* @description Total bytes of the organization's live `pending` and `ready` assets. Null when it could not be measured, which must be presented as unknown; a number, including 0, is a measurement.
|
|
572
|
+
*/
|
|
573
|
+
bytesUsed: number | null;
|
|
574
|
+
};
|
|
575
|
+
/** @description Paginated collection of media assets. */
|
|
576
|
+
MediaAssetPage: {
|
|
577
|
+
/** @description Current page number of the result set. */
|
|
578
|
+
page?: number;
|
|
579
|
+
/** @description Number of items per page. */
|
|
580
|
+
pageSize?: number;
|
|
581
|
+
/** @description Total number of items available. */
|
|
582
|
+
totalCount?: number;
|
|
583
|
+
/** @description Media assets included on this page of results. */
|
|
584
|
+
mediaAssets?: {
|
|
585
|
+
/**
|
|
586
|
+
* Format: uuid
|
|
587
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
588
|
+
*/
|
|
589
|
+
id: string;
|
|
590
|
+
/**
|
|
591
|
+
* Format: uuid
|
|
592
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
593
|
+
*/
|
|
594
|
+
organizationId: string;
|
|
595
|
+
/**
|
|
596
|
+
* Format: uuid
|
|
597
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
598
|
+
*/
|
|
599
|
+
createdBy?: string;
|
|
600
|
+
/**
|
|
601
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
602
|
+
* @enum {string}
|
|
603
|
+
*/
|
|
604
|
+
backend: "r2" | "gdrive";
|
|
605
|
+
/**
|
|
606
|
+
* Format: uuid
|
|
607
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
608
|
+
*/
|
|
609
|
+
connectionId?: string;
|
|
610
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
611
|
+
externalId?: string;
|
|
612
|
+
/**
|
|
613
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
614
|
+
* @enum {string}
|
|
615
|
+
*/
|
|
616
|
+
kind: "image" | "video";
|
|
617
|
+
/**
|
|
618
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
619
|
+
* @enum {string}
|
|
620
|
+
*/
|
|
621
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
622
|
+
/**
|
|
623
|
+
* Format: int64
|
|
624
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
625
|
+
*/
|
|
626
|
+
bytes: number;
|
|
627
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
628
|
+
sha256: string;
|
|
629
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
630
|
+
name?: string;
|
|
631
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
632
|
+
locationStripped: boolean;
|
|
633
|
+
/**
|
|
634
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
635
|
+
* @enum {string}
|
|
636
|
+
*/
|
|
637
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
638
|
+
/**
|
|
639
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
640
|
+
* @enum {string}
|
|
641
|
+
*/
|
|
642
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
643
|
+
/**
|
|
644
|
+
* Format: date-time
|
|
645
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
646
|
+
*/
|
|
647
|
+
retainUntil?: string | null;
|
|
648
|
+
/**
|
|
649
|
+
* Format: date-time
|
|
650
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
651
|
+
*/
|
|
652
|
+
completedAt?: string | null;
|
|
653
|
+
/**
|
|
654
|
+
* Format: date-time
|
|
655
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
656
|
+
*/
|
|
657
|
+
expiresAt: string;
|
|
658
|
+
/**
|
|
659
|
+
* Format: date-time
|
|
660
|
+
* @description Timestamp of media asset creation.
|
|
661
|
+
*/
|
|
662
|
+
createdAt: string;
|
|
663
|
+
/**
|
|
664
|
+
* Format: date-time
|
|
665
|
+
* @description Timestamp of last media asset modification.
|
|
666
|
+
*/
|
|
667
|
+
updatedAt: string;
|
|
668
|
+
/**
|
|
669
|
+
* Format: date-time
|
|
670
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
671
|
+
*/
|
|
672
|
+
deletedAt?: string | null;
|
|
673
|
+
}[];
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
responses: {
|
|
677
|
+
/** @description Invalid request body or request param */
|
|
678
|
+
400: {
|
|
679
|
+
headers: {
|
|
680
|
+
[name: string]: unknown;
|
|
681
|
+
};
|
|
682
|
+
content: {
|
|
683
|
+
"text/plain": string;
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
687
|
+
401: {
|
|
688
|
+
headers: {
|
|
689
|
+
[name: string]: unknown;
|
|
690
|
+
};
|
|
691
|
+
content: {
|
|
692
|
+
"text/plain": string;
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
/** @description Forbidden */
|
|
696
|
+
403: {
|
|
697
|
+
headers: {
|
|
698
|
+
[name: string]: unknown;
|
|
699
|
+
};
|
|
700
|
+
content: {
|
|
701
|
+
"text/plain": string;
|
|
702
|
+
};
|
|
703
|
+
};
|
|
704
|
+
/** @description Result not found */
|
|
705
|
+
404: {
|
|
706
|
+
headers: {
|
|
707
|
+
[name: string]: unknown;
|
|
708
|
+
};
|
|
709
|
+
content: {
|
|
710
|
+
"text/plain": string;
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
/** @description Conflict - the asset is not in a status the operation accepts, the uploaded bytes did not match the declared size, type or SHA-256 (or nothing was uploaded), or the asset would take the organization past its storage limit */
|
|
714
|
+
409: {
|
|
715
|
+
headers: {
|
|
716
|
+
[name: string]: unknown;
|
|
717
|
+
};
|
|
718
|
+
content: {
|
|
719
|
+
"text/plain": string;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
/** @description Internal server error */
|
|
723
|
+
500: {
|
|
724
|
+
headers: {
|
|
725
|
+
[name: string]: unknown;
|
|
726
|
+
};
|
|
727
|
+
content: {
|
|
728
|
+
"text/plain": string;
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
732
|
+
MeshkitError429: {
|
|
733
|
+
headers: {
|
|
734
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
735
|
+
"Retry-After": number;
|
|
736
|
+
[name: string]: unknown;
|
|
737
|
+
};
|
|
738
|
+
content: {
|
|
739
|
+
"application/json": {
|
|
740
|
+
/** @description The sentence the caller is shown. */
|
|
741
|
+
error: string;
|
|
742
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
743
|
+
code?: string;
|
|
744
|
+
/**
|
|
745
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
746
|
+
* @enum {string}
|
|
747
|
+
*/
|
|
748
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
749
|
+
/** @description MeshKit's probable causes of the error. */
|
|
750
|
+
probableCause?: string[];
|
|
751
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
752
|
+
suggestedRemediation?: string[];
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
/** @description Bad gateway - an upstream service the operation depends on could not be reached or rejected the request */
|
|
757
|
+
MeshkitError502: {
|
|
758
|
+
headers: {
|
|
759
|
+
[name: string]: unknown;
|
|
760
|
+
};
|
|
761
|
+
content: {
|
|
762
|
+
"application/json": {
|
|
763
|
+
/** @description The sentence the caller is shown. */
|
|
764
|
+
error: string;
|
|
765
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
766
|
+
code?: string;
|
|
767
|
+
/**
|
|
768
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
769
|
+
* @enum {string}
|
|
770
|
+
*/
|
|
771
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
772
|
+
/** @description MeshKit's probable causes of the error. */
|
|
773
|
+
probableCause?: string[];
|
|
774
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
775
|
+
suggestedRemediation?: string[];
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
parameters: {
|
|
781
|
+
/** @description Media asset ID */
|
|
782
|
+
mediaAssetId: string;
|
|
783
|
+
/** @description Get responses by page */
|
|
784
|
+
page: number;
|
|
785
|
+
/** @description Number of items per page. */
|
|
786
|
+
pageSize: number;
|
|
787
|
+
/** @description Get responses that match search param value */
|
|
788
|
+
search: string;
|
|
789
|
+
/** @description Get ordered responses */
|
|
790
|
+
order: string;
|
|
791
|
+
};
|
|
792
|
+
requestBodies: never;
|
|
793
|
+
headers: never;
|
|
794
|
+
pathItems: never;
|
|
795
|
+
}
|
|
796
|
+
export type $defs = Record<string, never>;
|
|
797
|
+
export interface operations {
|
|
798
|
+
listMediaAssets: {
|
|
799
|
+
parameters: {
|
|
800
|
+
query?: {
|
|
801
|
+
/** @description Get responses by page */
|
|
802
|
+
page?: number;
|
|
803
|
+
/** @description Number of items per page. */
|
|
804
|
+
pageSize?: number;
|
|
805
|
+
/** @description Get responses that match search param value */
|
|
806
|
+
search?: string;
|
|
807
|
+
/** @description Get ordered responses */
|
|
808
|
+
order?: string;
|
|
809
|
+
/** @description Filter by status, evaluated at read time (a `ready` asset past `expiresAt` matches `expired`). */
|
|
810
|
+
status?: "pending" | "ready" | "rejected" | "expired";
|
|
811
|
+
};
|
|
812
|
+
header?: never;
|
|
813
|
+
path?: never;
|
|
814
|
+
cookie?: never;
|
|
815
|
+
};
|
|
816
|
+
requestBody?: never;
|
|
817
|
+
responses: {
|
|
818
|
+
/** @description Media asset page */
|
|
819
|
+
200: {
|
|
820
|
+
headers: {
|
|
821
|
+
[name: string]: unknown;
|
|
822
|
+
};
|
|
823
|
+
content: {
|
|
824
|
+
"application/json": {
|
|
825
|
+
/** @description Current page number of the result set. */
|
|
826
|
+
page?: number;
|
|
827
|
+
/** @description Number of items per page. */
|
|
828
|
+
pageSize?: number;
|
|
829
|
+
/** @description Total number of items available. */
|
|
830
|
+
totalCount?: number;
|
|
831
|
+
/** @description Media assets included on this page of results. */
|
|
832
|
+
mediaAssets?: {
|
|
833
|
+
/**
|
|
834
|
+
* Format: uuid
|
|
835
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
836
|
+
*/
|
|
837
|
+
id: string;
|
|
838
|
+
/**
|
|
839
|
+
* Format: uuid
|
|
840
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
841
|
+
*/
|
|
842
|
+
organizationId: string;
|
|
843
|
+
/**
|
|
844
|
+
* Format: uuid
|
|
845
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
846
|
+
*/
|
|
847
|
+
createdBy?: string;
|
|
848
|
+
/**
|
|
849
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
850
|
+
* @enum {string}
|
|
851
|
+
*/
|
|
852
|
+
backend: "r2" | "gdrive";
|
|
853
|
+
/**
|
|
854
|
+
* Format: uuid
|
|
855
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
856
|
+
*/
|
|
857
|
+
connectionId?: string;
|
|
858
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
859
|
+
externalId?: string;
|
|
860
|
+
/**
|
|
861
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
862
|
+
* @enum {string}
|
|
863
|
+
*/
|
|
864
|
+
kind: "image" | "video";
|
|
865
|
+
/**
|
|
866
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
867
|
+
* @enum {string}
|
|
868
|
+
*/
|
|
869
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
870
|
+
/**
|
|
871
|
+
* Format: int64
|
|
872
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
873
|
+
*/
|
|
874
|
+
bytes: number;
|
|
875
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
876
|
+
sha256: string;
|
|
877
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
878
|
+
name?: string;
|
|
879
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
880
|
+
locationStripped: boolean;
|
|
881
|
+
/**
|
|
882
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
883
|
+
* @enum {string}
|
|
884
|
+
*/
|
|
885
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
886
|
+
/**
|
|
887
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
888
|
+
* @enum {string}
|
|
889
|
+
*/
|
|
890
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
891
|
+
/**
|
|
892
|
+
* Format: date-time
|
|
893
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
894
|
+
*/
|
|
895
|
+
retainUntil?: string | null;
|
|
896
|
+
/**
|
|
897
|
+
* Format: date-time
|
|
898
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
899
|
+
*/
|
|
900
|
+
completedAt?: string | null;
|
|
901
|
+
/**
|
|
902
|
+
* Format: date-time
|
|
903
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
904
|
+
*/
|
|
905
|
+
expiresAt: string;
|
|
906
|
+
/**
|
|
907
|
+
* Format: date-time
|
|
908
|
+
* @description Timestamp of media asset creation.
|
|
909
|
+
*/
|
|
910
|
+
createdAt: string;
|
|
911
|
+
/**
|
|
912
|
+
* Format: date-time
|
|
913
|
+
* @description Timestamp of last media asset modification.
|
|
914
|
+
*/
|
|
915
|
+
updatedAt: string;
|
|
916
|
+
/**
|
|
917
|
+
* Format: date-time
|
|
918
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
919
|
+
*/
|
|
920
|
+
deletedAt?: string | null;
|
|
921
|
+
}[];
|
|
922
|
+
};
|
|
923
|
+
};
|
|
924
|
+
};
|
|
925
|
+
/** @description Invalid request body or request param */
|
|
926
|
+
400: {
|
|
927
|
+
headers: {
|
|
928
|
+
[name: string]: unknown;
|
|
929
|
+
};
|
|
930
|
+
content: {
|
|
931
|
+
"text/plain": string;
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
935
|
+
401: {
|
|
936
|
+
headers: {
|
|
937
|
+
[name: string]: unknown;
|
|
938
|
+
};
|
|
939
|
+
content: {
|
|
940
|
+
"text/plain": string;
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
/** @description Forbidden */
|
|
944
|
+
403: {
|
|
945
|
+
headers: {
|
|
946
|
+
[name: string]: unknown;
|
|
947
|
+
};
|
|
948
|
+
content: {
|
|
949
|
+
"text/plain": string;
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
/** @description Result not found */
|
|
953
|
+
404: {
|
|
954
|
+
headers: {
|
|
955
|
+
[name: string]: unknown;
|
|
956
|
+
};
|
|
957
|
+
content: {
|
|
958
|
+
"text/plain": string;
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
962
|
+
429: {
|
|
963
|
+
headers: {
|
|
964
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
965
|
+
"Retry-After": number;
|
|
966
|
+
[name: string]: unknown;
|
|
967
|
+
};
|
|
968
|
+
content: {
|
|
969
|
+
"application/json": {
|
|
970
|
+
/** @description The sentence the caller is shown. */
|
|
971
|
+
error: string;
|
|
972
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
973
|
+
code?: string;
|
|
974
|
+
/**
|
|
975
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
976
|
+
* @enum {string}
|
|
977
|
+
*/
|
|
978
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
979
|
+
/** @description MeshKit's probable causes of the error. */
|
|
980
|
+
probableCause?: string[];
|
|
981
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
982
|
+
suggestedRemediation?: string[];
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
/** @description Internal server error */
|
|
987
|
+
500: {
|
|
988
|
+
headers: {
|
|
989
|
+
[name: string]: unknown;
|
|
990
|
+
};
|
|
991
|
+
content: {
|
|
992
|
+
"text/plain": string;
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
createMediaAsset: {
|
|
998
|
+
parameters: {
|
|
999
|
+
query?: never;
|
|
1000
|
+
header?: never;
|
|
1001
|
+
path?: never;
|
|
1002
|
+
cookie?: never;
|
|
1003
|
+
};
|
|
1004
|
+
requestBody: {
|
|
1005
|
+
content: {
|
|
1006
|
+
"application/json": {
|
|
1007
|
+
/**
|
|
1008
|
+
* @description Media type of the file, from a closed allowlist. The server sniffs the stored bytes on completion and rejects an upload whose real type differs. A provider may accept fewer types than this list (`MediaAssetQuota.contentTypes`).
|
|
1009
|
+
* @enum {string}
|
|
1010
|
+
*/
|
|
1011
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
1012
|
+
/**
|
|
1013
|
+
* Format: int64
|
|
1014
|
+
* @description Size of the file in bytes. Must not exceed the quota's limit for its kind.
|
|
1015
|
+
*/
|
|
1016
|
+
bytes: number;
|
|
1017
|
+
/** @description Lowercase hex SHA-256 of the exact bytes that will be uploaded. */
|
|
1018
|
+
sha256: string;
|
|
1019
|
+
/** @description Display name of the file, typically its original file name. */
|
|
1020
|
+
name?: string;
|
|
1021
|
+
/** @description Whether the client removed location metadata (EXIF and XMP GPS, maker notes, device serial numbers) from the file before hashing and uploading it. Recorded as sent. */
|
|
1022
|
+
locationStripped: boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* @description Where to store the file. Omitted, the server stores it in `r2`.
|
|
1025
|
+
* @enum {string}
|
|
1026
|
+
*/
|
|
1027
|
+
backend?: "r2" | "gdrive";
|
|
1028
|
+
/**
|
|
1029
|
+
* Format: uuid
|
|
1030
|
+
* @description The caller's own live Google Drive connection in the session organization. Required when `backend` is `gdrive`, refused otherwise.
|
|
1031
|
+
*/
|
|
1032
|
+
connectionId?: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* Format: date-time
|
|
1035
|
+
* @description Time the asset must stay downloadable until, for example a little after the post that uses it is scheduled. Omitted, the organization's default retention applies from completion.
|
|
1036
|
+
*/
|
|
1037
|
+
retainUntil?: string;
|
|
1038
|
+
};
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
responses: {
|
|
1042
|
+
/** @description Media asset created */
|
|
1043
|
+
201: {
|
|
1044
|
+
headers: {
|
|
1045
|
+
[name: string]: unknown;
|
|
1046
|
+
};
|
|
1047
|
+
content: {
|
|
1048
|
+
"application/json": {
|
|
1049
|
+
/**
|
|
1050
|
+
* Media Asset Schema
|
|
1051
|
+
* @description Server-returned media asset: one image or video file an organization
|
|
1052
|
+
* uploaded so that a content item can post it without a link. A content
|
|
1053
|
+
* item refers to an asset by its `id`, never by a URL; a short-lived
|
|
1054
|
+
* download URL is minted only when the file is about to be used
|
|
1055
|
+
* (`getMediaAssetDownload`) and is never stored.
|
|
1056
|
+
* An asset is created `pending` with a short-lived upload URL, becomes
|
|
1057
|
+
* `ready` once `completeMediaAsset` has checked the stored bytes against
|
|
1058
|
+
* the declared size, type and SHA-256, or `rejected` when they do not
|
|
1059
|
+
* match. A `pending` asset that is never completed, and a `ready` asset
|
|
1060
|
+
* whose retention ended, read as `expired` from `expiresAt` on: expiry is
|
|
1061
|
+
* evaluated when the asset is read, so an asset never reads `pending` or
|
|
1062
|
+
* `ready` past its `expiresAt`.
|
|
1063
|
+
* No field carries a storage credential, a bucket name, an object key or a
|
|
1064
|
+
* signed URL. The bytes live in the backend `backend` names, under a
|
|
1065
|
+
* location only the server knows.
|
|
1066
|
+
*/
|
|
1067
|
+
mediaAsset: {
|
|
1068
|
+
/**
|
|
1069
|
+
* Format: uuid
|
|
1070
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
1071
|
+
*/
|
|
1072
|
+
id: string;
|
|
1073
|
+
/**
|
|
1074
|
+
* Format: uuid
|
|
1075
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
1076
|
+
*/
|
|
1077
|
+
organizationId: string;
|
|
1078
|
+
/**
|
|
1079
|
+
* Format: uuid
|
|
1080
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
1081
|
+
*/
|
|
1082
|
+
createdBy?: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
1085
|
+
* @enum {string}
|
|
1086
|
+
*/
|
|
1087
|
+
backend: "r2" | "gdrive";
|
|
1088
|
+
/**
|
|
1089
|
+
* Format: uuid
|
|
1090
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
1091
|
+
*/
|
|
1092
|
+
connectionId?: string;
|
|
1093
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
1094
|
+
externalId?: string;
|
|
1095
|
+
/**
|
|
1096
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
1097
|
+
* @enum {string}
|
|
1098
|
+
*/
|
|
1099
|
+
kind: "image" | "video";
|
|
1100
|
+
/**
|
|
1101
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
1102
|
+
* @enum {string}
|
|
1103
|
+
*/
|
|
1104
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
1105
|
+
/**
|
|
1106
|
+
* Format: int64
|
|
1107
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
1108
|
+
*/
|
|
1109
|
+
bytes: number;
|
|
1110
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
1111
|
+
sha256: string;
|
|
1112
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
1113
|
+
name?: string;
|
|
1114
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
1115
|
+
locationStripped: boolean;
|
|
1116
|
+
/**
|
|
1117
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
1118
|
+
* @enum {string}
|
|
1119
|
+
*/
|
|
1120
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
1121
|
+
/**
|
|
1122
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
1123
|
+
* @enum {string}
|
|
1124
|
+
*/
|
|
1125
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
1126
|
+
/**
|
|
1127
|
+
* Format: date-time
|
|
1128
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
1129
|
+
*/
|
|
1130
|
+
retainUntil?: string | null;
|
|
1131
|
+
/**
|
|
1132
|
+
* Format: date-time
|
|
1133
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
1134
|
+
*/
|
|
1135
|
+
completedAt?: string | null;
|
|
1136
|
+
/**
|
|
1137
|
+
* Format: date-time
|
|
1138
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
1139
|
+
*/
|
|
1140
|
+
expiresAt: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Format: date-time
|
|
1143
|
+
* @description Timestamp of media asset creation.
|
|
1144
|
+
*/
|
|
1145
|
+
createdAt: string;
|
|
1146
|
+
/**
|
|
1147
|
+
* Format: date-time
|
|
1148
|
+
* @description Timestamp of last media asset modification.
|
|
1149
|
+
*/
|
|
1150
|
+
updatedAt: string;
|
|
1151
|
+
/**
|
|
1152
|
+
* Format: date-time
|
|
1153
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
1154
|
+
*/
|
|
1155
|
+
deletedAt?: string | null;
|
|
1156
|
+
};
|
|
1157
|
+
/** @description A short-lived grant to move one file's bytes: send one request with `method` to `url` carrying exactly `headers`, before `expiresAt`. The URL is the only credential, it covers this one file, and it must be treated as a secret: never store it, log it or put it in a content item. */
|
|
1158
|
+
upload: {
|
|
1159
|
+
/**
|
|
1160
|
+
* @description HTTP method to use. `PUT` for an upload, `GET` for a download.
|
|
1161
|
+
* @enum {string}
|
|
1162
|
+
*/
|
|
1163
|
+
method: "PUT" | "GET";
|
|
1164
|
+
/**
|
|
1165
|
+
* Format: uri
|
|
1166
|
+
* @description Absolute HTTPS URL to send the request to.
|
|
1167
|
+
*/
|
|
1168
|
+
url: string;
|
|
1169
|
+
/** @description Headers the request must carry, verbatim (for an upload, at least `Content-Type`, and any integrity header the signature binds). Empty when none are needed. Never contains an authorization header. */
|
|
1170
|
+
headers: {
|
|
1171
|
+
[key: string]: string;
|
|
1172
|
+
};
|
|
1173
|
+
/**
|
|
1174
|
+
* Format: date-time
|
|
1175
|
+
* @description Time the URL stops working.
|
|
1176
|
+
*/
|
|
1177
|
+
expiresAt: string;
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
};
|
|
1181
|
+
};
|
|
1182
|
+
/** @description Invalid request body or request param */
|
|
1183
|
+
400: {
|
|
1184
|
+
headers: {
|
|
1185
|
+
[name: string]: unknown;
|
|
1186
|
+
};
|
|
1187
|
+
content: {
|
|
1188
|
+
"text/plain": string;
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1192
|
+
401: {
|
|
1193
|
+
headers: {
|
|
1194
|
+
[name: string]: unknown;
|
|
1195
|
+
};
|
|
1196
|
+
content: {
|
|
1197
|
+
"text/plain": string;
|
|
1198
|
+
};
|
|
1199
|
+
};
|
|
1200
|
+
/** @description Forbidden */
|
|
1201
|
+
403: {
|
|
1202
|
+
headers: {
|
|
1203
|
+
[name: string]: unknown;
|
|
1204
|
+
};
|
|
1205
|
+
content: {
|
|
1206
|
+
"text/plain": string;
|
|
1207
|
+
};
|
|
1208
|
+
};
|
|
1209
|
+
/** @description Result not found */
|
|
1210
|
+
404: {
|
|
1211
|
+
headers: {
|
|
1212
|
+
[name: string]: unknown;
|
|
1213
|
+
};
|
|
1214
|
+
content: {
|
|
1215
|
+
"text/plain": string;
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1218
|
+
/** @description Conflict - the asset is not in a status the operation accepts, the uploaded bytes did not match the declared size, type or SHA-256 (or nothing was uploaded), or the asset would take the organization past its storage limit */
|
|
1219
|
+
409: {
|
|
1220
|
+
headers: {
|
|
1221
|
+
[name: string]: unknown;
|
|
1222
|
+
};
|
|
1223
|
+
content: {
|
|
1224
|
+
"text/plain": string;
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
1228
|
+
429: {
|
|
1229
|
+
headers: {
|
|
1230
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
1231
|
+
"Retry-After": number;
|
|
1232
|
+
[name: string]: unknown;
|
|
1233
|
+
};
|
|
1234
|
+
content: {
|
|
1235
|
+
"application/json": {
|
|
1236
|
+
/** @description The sentence the caller is shown. */
|
|
1237
|
+
error: string;
|
|
1238
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
1239
|
+
code?: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
1242
|
+
* @enum {string}
|
|
1243
|
+
*/
|
|
1244
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
1245
|
+
/** @description MeshKit's probable causes of the error. */
|
|
1246
|
+
probableCause?: string[];
|
|
1247
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
1248
|
+
suggestedRemediation?: string[];
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
/** @description Internal server error */
|
|
1253
|
+
500: {
|
|
1254
|
+
headers: {
|
|
1255
|
+
[name: string]: unknown;
|
|
1256
|
+
};
|
|
1257
|
+
content: {
|
|
1258
|
+
"text/plain": string;
|
|
1259
|
+
};
|
|
1260
|
+
};
|
|
1261
|
+
/** @description Bad gateway - an upstream service the operation depends on could not be reached or rejected the request */
|
|
1262
|
+
502: {
|
|
1263
|
+
headers: {
|
|
1264
|
+
[name: string]: unknown;
|
|
1265
|
+
};
|
|
1266
|
+
content: {
|
|
1267
|
+
"application/json": {
|
|
1268
|
+
/** @description The sentence the caller is shown. */
|
|
1269
|
+
error: string;
|
|
1270
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
1271
|
+
code?: string;
|
|
1272
|
+
/**
|
|
1273
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
1274
|
+
* @enum {string}
|
|
1275
|
+
*/
|
|
1276
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
1277
|
+
/** @description MeshKit's probable causes of the error. */
|
|
1278
|
+
probableCause?: string[];
|
|
1279
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
1280
|
+
suggestedRemediation?: string[];
|
|
1281
|
+
};
|
|
1282
|
+
};
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
};
|
|
1286
|
+
getMediaAssetQuota: {
|
|
1287
|
+
parameters: {
|
|
1288
|
+
query?: never;
|
|
1289
|
+
header?: never;
|
|
1290
|
+
path?: never;
|
|
1291
|
+
cookie?: never;
|
|
1292
|
+
};
|
|
1293
|
+
requestBody?: never;
|
|
1294
|
+
responses: {
|
|
1295
|
+
/** @description Media asset quota */
|
|
1296
|
+
200: {
|
|
1297
|
+
headers: {
|
|
1298
|
+
[name: string]: unknown;
|
|
1299
|
+
};
|
|
1300
|
+
content: {
|
|
1301
|
+
"application/json": {
|
|
1302
|
+
/** @description Backends this provider serves for the organization. A create naming another is refused with 400. */
|
|
1303
|
+
backends: ("r2" | "gdrive")[];
|
|
1304
|
+
/** @description Content types this provider accepts. */
|
|
1305
|
+
contentTypes: ("image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm")[];
|
|
1306
|
+
/**
|
|
1307
|
+
* Format: int64
|
|
1308
|
+
* @description Largest image a create accepts, in bytes.
|
|
1309
|
+
*/
|
|
1310
|
+
maxImageBytes: number;
|
|
1311
|
+
/**
|
|
1312
|
+
* Format: int64
|
|
1313
|
+
* @description Largest video a create accepts, in bytes.
|
|
1314
|
+
*/
|
|
1315
|
+
maxVideoBytes: number;
|
|
1316
|
+
/** @description How long a `pending` asset waits for its upload and completion before it expires, in seconds. */
|
|
1317
|
+
uploadWindowSeconds: number;
|
|
1318
|
+
/** @description Days a `ready` asset is kept after completion when no `retainUntil` was set. */
|
|
1319
|
+
defaultRetentionDays: number;
|
|
1320
|
+
/** @description Furthest `retainUntil` may lie from now, in days. */
|
|
1321
|
+
maxRetentionDays: number;
|
|
1322
|
+
/**
|
|
1323
|
+
* Format: int64
|
|
1324
|
+
* @description Total bytes the organization's live `pending` and `ready` assets may hold. Null when the organization has no storage limit.
|
|
1325
|
+
*/
|
|
1326
|
+
bytesLimit: number | null;
|
|
1327
|
+
/**
|
|
1328
|
+
* Format: int64
|
|
1329
|
+
* @description Total bytes of the organization's live `pending` and `ready` assets. Null when it could not be measured, which must be presented as unknown; a number, including 0, is a measurement.
|
|
1330
|
+
*/
|
|
1331
|
+
bytesUsed: number | null;
|
|
1332
|
+
};
|
|
1333
|
+
};
|
|
1334
|
+
};
|
|
1335
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1336
|
+
401: {
|
|
1337
|
+
headers: {
|
|
1338
|
+
[name: string]: unknown;
|
|
1339
|
+
};
|
|
1340
|
+
content: {
|
|
1341
|
+
"text/plain": string;
|
|
1342
|
+
};
|
|
1343
|
+
};
|
|
1344
|
+
/** @description Forbidden */
|
|
1345
|
+
403: {
|
|
1346
|
+
headers: {
|
|
1347
|
+
[name: string]: unknown;
|
|
1348
|
+
};
|
|
1349
|
+
content: {
|
|
1350
|
+
"text/plain": string;
|
|
1351
|
+
};
|
|
1352
|
+
};
|
|
1353
|
+
/** @description Result not found */
|
|
1354
|
+
404: {
|
|
1355
|
+
headers: {
|
|
1356
|
+
[name: string]: unknown;
|
|
1357
|
+
};
|
|
1358
|
+
content: {
|
|
1359
|
+
"text/plain": string;
|
|
1360
|
+
};
|
|
1361
|
+
};
|
|
1362
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
1363
|
+
429: {
|
|
1364
|
+
headers: {
|
|
1365
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
1366
|
+
"Retry-After": number;
|
|
1367
|
+
[name: string]: unknown;
|
|
1368
|
+
};
|
|
1369
|
+
content: {
|
|
1370
|
+
"application/json": {
|
|
1371
|
+
/** @description The sentence the caller is shown. */
|
|
1372
|
+
error: string;
|
|
1373
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
1374
|
+
code?: string;
|
|
1375
|
+
/**
|
|
1376
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
1377
|
+
* @enum {string}
|
|
1378
|
+
*/
|
|
1379
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
1380
|
+
/** @description MeshKit's probable causes of the error. */
|
|
1381
|
+
probableCause?: string[];
|
|
1382
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
1383
|
+
suggestedRemediation?: string[];
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
};
|
|
1387
|
+
/** @description Internal server error */
|
|
1388
|
+
500: {
|
|
1389
|
+
headers: {
|
|
1390
|
+
[name: string]: unknown;
|
|
1391
|
+
};
|
|
1392
|
+
content: {
|
|
1393
|
+
"text/plain": string;
|
|
1394
|
+
};
|
|
1395
|
+
};
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
getMediaAsset: {
|
|
1399
|
+
parameters: {
|
|
1400
|
+
query?: never;
|
|
1401
|
+
header?: never;
|
|
1402
|
+
path: {
|
|
1403
|
+
/** @description Media asset ID */
|
|
1404
|
+
mediaAssetId: string;
|
|
1405
|
+
};
|
|
1406
|
+
cookie?: never;
|
|
1407
|
+
};
|
|
1408
|
+
requestBody?: never;
|
|
1409
|
+
responses: {
|
|
1410
|
+
/** @description Media asset response */
|
|
1411
|
+
200: {
|
|
1412
|
+
headers: {
|
|
1413
|
+
[name: string]: unknown;
|
|
1414
|
+
};
|
|
1415
|
+
content: {
|
|
1416
|
+
"application/json": {
|
|
1417
|
+
/**
|
|
1418
|
+
* Format: uuid
|
|
1419
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
1420
|
+
*/
|
|
1421
|
+
id: string;
|
|
1422
|
+
/**
|
|
1423
|
+
* Format: uuid
|
|
1424
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
1425
|
+
*/
|
|
1426
|
+
organizationId: string;
|
|
1427
|
+
/**
|
|
1428
|
+
* Format: uuid
|
|
1429
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
1430
|
+
*/
|
|
1431
|
+
createdBy?: string;
|
|
1432
|
+
/**
|
|
1433
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
1434
|
+
* @enum {string}
|
|
1435
|
+
*/
|
|
1436
|
+
backend: "r2" | "gdrive";
|
|
1437
|
+
/**
|
|
1438
|
+
* Format: uuid
|
|
1439
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
1440
|
+
*/
|
|
1441
|
+
connectionId?: string;
|
|
1442
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
1443
|
+
externalId?: string;
|
|
1444
|
+
/**
|
|
1445
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
1446
|
+
* @enum {string}
|
|
1447
|
+
*/
|
|
1448
|
+
kind: "image" | "video";
|
|
1449
|
+
/**
|
|
1450
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
1451
|
+
* @enum {string}
|
|
1452
|
+
*/
|
|
1453
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
1454
|
+
/**
|
|
1455
|
+
* Format: int64
|
|
1456
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
1457
|
+
*/
|
|
1458
|
+
bytes: number;
|
|
1459
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
1460
|
+
sha256: string;
|
|
1461
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
1462
|
+
name?: string;
|
|
1463
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
1464
|
+
locationStripped: boolean;
|
|
1465
|
+
/**
|
|
1466
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
1467
|
+
* @enum {string}
|
|
1468
|
+
*/
|
|
1469
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
1470
|
+
/**
|
|
1471
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
1472
|
+
* @enum {string}
|
|
1473
|
+
*/
|
|
1474
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
1475
|
+
/**
|
|
1476
|
+
* Format: date-time
|
|
1477
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
1478
|
+
*/
|
|
1479
|
+
retainUntil?: string | null;
|
|
1480
|
+
/**
|
|
1481
|
+
* Format: date-time
|
|
1482
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
1483
|
+
*/
|
|
1484
|
+
completedAt?: string | null;
|
|
1485
|
+
/**
|
|
1486
|
+
* Format: date-time
|
|
1487
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
1488
|
+
*/
|
|
1489
|
+
expiresAt: string;
|
|
1490
|
+
/**
|
|
1491
|
+
* Format: date-time
|
|
1492
|
+
* @description Timestamp of media asset creation.
|
|
1493
|
+
*/
|
|
1494
|
+
createdAt: string;
|
|
1495
|
+
/**
|
|
1496
|
+
* Format: date-time
|
|
1497
|
+
* @description Timestamp of last media asset modification.
|
|
1498
|
+
*/
|
|
1499
|
+
updatedAt: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* Format: date-time
|
|
1502
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
1503
|
+
*/
|
|
1504
|
+
deletedAt?: string | null;
|
|
1505
|
+
};
|
|
1506
|
+
};
|
|
1507
|
+
};
|
|
1508
|
+
/** @description Invalid request body or request param */
|
|
1509
|
+
400: {
|
|
1510
|
+
headers: {
|
|
1511
|
+
[name: string]: unknown;
|
|
1512
|
+
};
|
|
1513
|
+
content: {
|
|
1514
|
+
"text/plain": string;
|
|
1515
|
+
};
|
|
1516
|
+
};
|
|
1517
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1518
|
+
401: {
|
|
1519
|
+
headers: {
|
|
1520
|
+
[name: string]: unknown;
|
|
1521
|
+
};
|
|
1522
|
+
content: {
|
|
1523
|
+
"text/plain": string;
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
/** @description Forbidden */
|
|
1527
|
+
403: {
|
|
1528
|
+
headers: {
|
|
1529
|
+
[name: string]: unknown;
|
|
1530
|
+
};
|
|
1531
|
+
content: {
|
|
1532
|
+
"text/plain": string;
|
|
1533
|
+
};
|
|
1534
|
+
};
|
|
1535
|
+
/** @description Result not found */
|
|
1536
|
+
404: {
|
|
1537
|
+
headers: {
|
|
1538
|
+
[name: string]: unknown;
|
|
1539
|
+
};
|
|
1540
|
+
content: {
|
|
1541
|
+
"text/plain": string;
|
|
1542
|
+
};
|
|
1543
|
+
};
|
|
1544
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
1545
|
+
429: {
|
|
1546
|
+
headers: {
|
|
1547
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
1548
|
+
"Retry-After": number;
|
|
1549
|
+
[name: string]: unknown;
|
|
1550
|
+
};
|
|
1551
|
+
content: {
|
|
1552
|
+
"application/json": {
|
|
1553
|
+
/** @description The sentence the caller is shown. */
|
|
1554
|
+
error: string;
|
|
1555
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
1556
|
+
code?: string;
|
|
1557
|
+
/**
|
|
1558
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
1559
|
+
* @enum {string}
|
|
1560
|
+
*/
|
|
1561
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
1562
|
+
/** @description MeshKit's probable causes of the error. */
|
|
1563
|
+
probableCause?: string[];
|
|
1564
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
1565
|
+
suggestedRemediation?: string[];
|
|
1566
|
+
};
|
|
1567
|
+
};
|
|
1568
|
+
};
|
|
1569
|
+
/** @description Internal server error */
|
|
1570
|
+
500: {
|
|
1571
|
+
headers: {
|
|
1572
|
+
[name: string]: unknown;
|
|
1573
|
+
};
|
|
1574
|
+
content: {
|
|
1575
|
+
"text/plain": string;
|
|
1576
|
+
};
|
|
1577
|
+
};
|
|
1578
|
+
};
|
|
1579
|
+
};
|
|
1580
|
+
updateMediaAsset: {
|
|
1581
|
+
parameters: {
|
|
1582
|
+
query?: never;
|
|
1583
|
+
header?: never;
|
|
1584
|
+
path: {
|
|
1585
|
+
/** @description Media asset ID */
|
|
1586
|
+
mediaAssetId: string;
|
|
1587
|
+
};
|
|
1588
|
+
cookie?: never;
|
|
1589
|
+
};
|
|
1590
|
+
requestBody: {
|
|
1591
|
+
content: {
|
|
1592
|
+
"application/json": {
|
|
1593
|
+
/**
|
|
1594
|
+
* Format: date-time
|
|
1595
|
+
* @description New time the asset must stay downloadable until. Must be in the future and within `maxRetentionDays` from now.
|
|
1596
|
+
*/
|
|
1597
|
+
retainUntil: string;
|
|
1598
|
+
};
|
|
1599
|
+
};
|
|
1600
|
+
};
|
|
1601
|
+
responses: {
|
|
1602
|
+
/** @description Media asset updated */
|
|
1603
|
+
200: {
|
|
1604
|
+
headers: {
|
|
1605
|
+
[name: string]: unknown;
|
|
1606
|
+
};
|
|
1607
|
+
content: {
|
|
1608
|
+
"application/json": {
|
|
1609
|
+
/**
|
|
1610
|
+
* Format: uuid
|
|
1611
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
1612
|
+
*/
|
|
1613
|
+
id: string;
|
|
1614
|
+
/**
|
|
1615
|
+
* Format: uuid
|
|
1616
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
1617
|
+
*/
|
|
1618
|
+
organizationId: string;
|
|
1619
|
+
/**
|
|
1620
|
+
* Format: uuid
|
|
1621
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
1622
|
+
*/
|
|
1623
|
+
createdBy?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
1626
|
+
* @enum {string}
|
|
1627
|
+
*/
|
|
1628
|
+
backend: "r2" | "gdrive";
|
|
1629
|
+
/**
|
|
1630
|
+
* Format: uuid
|
|
1631
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
1632
|
+
*/
|
|
1633
|
+
connectionId?: string;
|
|
1634
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
1635
|
+
externalId?: string;
|
|
1636
|
+
/**
|
|
1637
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
1638
|
+
* @enum {string}
|
|
1639
|
+
*/
|
|
1640
|
+
kind: "image" | "video";
|
|
1641
|
+
/**
|
|
1642
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
1643
|
+
* @enum {string}
|
|
1644
|
+
*/
|
|
1645
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
1646
|
+
/**
|
|
1647
|
+
* Format: int64
|
|
1648
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
1649
|
+
*/
|
|
1650
|
+
bytes: number;
|
|
1651
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
1652
|
+
sha256: string;
|
|
1653
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
1654
|
+
name?: string;
|
|
1655
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
1656
|
+
locationStripped: boolean;
|
|
1657
|
+
/**
|
|
1658
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
1659
|
+
* @enum {string}
|
|
1660
|
+
*/
|
|
1661
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
1662
|
+
/**
|
|
1663
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
1664
|
+
* @enum {string}
|
|
1665
|
+
*/
|
|
1666
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
1667
|
+
/**
|
|
1668
|
+
* Format: date-time
|
|
1669
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
1670
|
+
*/
|
|
1671
|
+
retainUntil?: string | null;
|
|
1672
|
+
/**
|
|
1673
|
+
* Format: date-time
|
|
1674
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
1675
|
+
*/
|
|
1676
|
+
completedAt?: string | null;
|
|
1677
|
+
/**
|
|
1678
|
+
* Format: date-time
|
|
1679
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
1680
|
+
*/
|
|
1681
|
+
expiresAt: string;
|
|
1682
|
+
/**
|
|
1683
|
+
* Format: date-time
|
|
1684
|
+
* @description Timestamp of media asset creation.
|
|
1685
|
+
*/
|
|
1686
|
+
createdAt: string;
|
|
1687
|
+
/**
|
|
1688
|
+
* Format: date-time
|
|
1689
|
+
* @description Timestamp of last media asset modification.
|
|
1690
|
+
*/
|
|
1691
|
+
updatedAt: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* Format: date-time
|
|
1694
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
1695
|
+
*/
|
|
1696
|
+
deletedAt?: string | null;
|
|
1697
|
+
};
|
|
1698
|
+
};
|
|
1699
|
+
};
|
|
1700
|
+
/** @description Invalid request body or request param */
|
|
1701
|
+
400: {
|
|
1702
|
+
headers: {
|
|
1703
|
+
[name: string]: unknown;
|
|
1704
|
+
};
|
|
1705
|
+
content: {
|
|
1706
|
+
"text/plain": string;
|
|
1707
|
+
};
|
|
1708
|
+
};
|
|
1709
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1710
|
+
401: {
|
|
1711
|
+
headers: {
|
|
1712
|
+
[name: string]: unknown;
|
|
1713
|
+
};
|
|
1714
|
+
content: {
|
|
1715
|
+
"text/plain": string;
|
|
1716
|
+
};
|
|
1717
|
+
};
|
|
1718
|
+
/** @description Forbidden */
|
|
1719
|
+
403: {
|
|
1720
|
+
headers: {
|
|
1721
|
+
[name: string]: unknown;
|
|
1722
|
+
};
|
|
1723
|
+
content: {
|
|
1724
|
+
"text/plain": string;
|
|
1725
|
+
};
|
|
1726
|
+
};
|
|
1727
|
+
/** @description Result not found */
|
|
1728
|
+
404: {
|
|
1729
|
+
headers: {
|
|
1730
|
+
[name: string]: unknown;
|
|
1731
|
+
};
|
|
1732
|
+
content: {
|
|
1733
|
+
"text/plain": string;
|
|
1734
|
+
};
|
|
1735
|
+
};
|
|
1736
|
+
/** @description Conflict - the asset is not in a status the operation accepts, the uploaded bytes did not match the declared size, type or SHA-256 (or nothing was uploaded), or the asset would take the organization past its storage limit */
|
|
1737
|
+
409: {
|
|
1738
|
+
headers: {
|
|
1739
|
+
[name: string]: unknown;
|
|
1740
|
+
};
|
|
1741
|
+
content: {
|
|
1742
|
+
"text/plain": string;
|
|
1743
|
+
};
|
|
1744
|
+
};
|
|
1745
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
1746
|
+
429: {
|
|
1747
|
+
headers: {
|
|
1748
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
1749
|
+
"Retry-After": number;
|
|
1750
|
+
[name: string]: unknown;
|
|
1751
|
+
};
|
|
1752
|
+
content: {
|
|
1753
|
+
"application/json": {
|
|
1754
|
+
/** @description The sentence the caller is shown. */
|
|
1755
|
+
error: string;
|
|
1756
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
1757
|
+
code?: string;
|
|
1758
|
+
/**
|
|
1759
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
1760
|
+
* @enum {string}
|
|
1761
|
+
*/
|
|
1762
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
1763
|
+
/** @description MeshKit's probable causes of the error. */
|
|
1764
|
+
probableCause?: string[];
|
|
1765
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
1766
|
+
suggestedRemediation?: string[];
|
|
1767
|
+
};
|
|
1768
|
+
};
|
|
1769
|
+
};
|
|
1770
|
+
/** @description Internal server error */
|
|
1771
|
+
500: {
|
|
1772
|
+
headers: {
|
|
1773
|
+
[name: string]: unknown;
|
|
1774
|
+
};
|
|
1775
|
+
content: {
|
|
1776
|
+
"text/plain": string;
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
};
|
|
1780
|
+
};
|
|
1781
|
+
deleteMediaAsset: {
|
|
1782
|
+
parameters: {
|
|
1783
|
+
query?: never;
|
|
1784
|
+
header?: never;
|
|
1785
|
+
path: {
|
|
1786
|
+
/** @description Media asset ID */
|
|
1787
|
+
mediaAssetId: string;
|
|
1788
|
+
};
|
|
1789
|
+
cookie?: never;
|
|
1790
|
+
};
|
|
1791
|
+
requestBody?: never;
|
|
1792
|
+
responses: {
|
|
1793
|
+
/** @description Media asset deleted */
|
|
1794
|
+
204: {
|
|
1795
|
+
headers: {
|
|
1796
|
+
[name: string]: unknown;
|
|
1797
|
+
};
|
|
1798
|
+
content?: never;
|
|
1799
|
+
};
|
|
1800
|
+
/** @description Invalid request body or request param */
|
|
1801
|
+
400: {
|
|
1802
|
+
headers: {
|
|
1803
|
+
[name: string]: unknown;
|
|
1804
|
+
};
|
|
1805
|
+
content: {
|
|
1806
|
+
"text/plain": string;
|
|
1807
|
+
};
|
|
1808
|
+
};
|
|
1809
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1810
|
+
401: {
|
|
1811
|
+
headers: {
|
|
1812
|
+
[name: string]: unknown;
|
|
1813
|
+
};
|
|
1814
|
+
content: {
|
|
1815
|
+
"text/plain": string;
|
|
1816
|
+
};
|
|
1817
|
+
};
|
|
1818
|
+
/** @description Forbidden */
|
|
1819
|
+
403: {
|
|
1820
|
+
headers: {
|
|
1821
|
+
[name: string]: unknown;
|
|
1822
|
+
};
|
|
1823
|
+
content: {
|
|
1824
|
+
"text/plain": string;
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
1827
|
+
/** @description Result not found */
|
|
1828
|
+
404: {
|
|
1829
|
+
headers: {
|
|
1830
|
+
[name: string]: unknown;
|
|
1831
|
+
};
|
|
1832
|
+
content: {
|
|
1833
|
+
"text/plain": string;
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
1837
|
+
429: {
|
|
1838
|
+
headers: {
|
|
1839
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
1840
|
+
"Retry-After": number;
|
|
1841
|
+
[name: string]: unknown;
|
|
1842
|
+
};
|
|
1843
|
+
content: {
|
|
1844
|
+
"application/json": {
|
|
1845
|
+
/** @description The sentence the caller is shown. */
|
|
1846
|
+
error: string;
|
|
1847
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
1848
|
+
code?: string;
|
|
1849
|
+
/**
|
|
1850
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
1851
|
+
* @enum {string}
|
|
1852
|
+
*/
|
|
1853
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
1854
|
+
/** @description MeshKit's probable causes of the error. */
|
|
1855
|
+
probableCause?: string[];
|
|
1856
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
1857
|
+
suggestedRemediation?: string[];
|
|
1858
|
+
};
|
|
1859
|
+
};
|
|
1860
|
+
};
|
|
1861
|
+
/** @description Internal server error */
|
|
1862
|
+
500: {
|
|
1863
|
+
headers: {
|
|
1864
|
+
[name: string]: unknown;
|
|
1865
|
+
};
|
|
1866
|
+
content: {
|
|
1867
|
+
"text/plain": string;
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
};
|
|
1871
|
+
};
|
|
1872
|
+
completeMediaAsset: {
|
|
1873
|
+
parameters: {
|
|
1874
|
+
query?: never;
|
|
1875
|
+
header?: never;
|
|
1876
|
+
path: {
|
|
1877
|
+
/** @description Media asset ID */
|
|
1878
|
+
mediaAssetId: string;
|
|
1879
|
+
};
|
|
1880
|
+
cookie?: never;
|
|
1881
|
+
};
|
|
1882
|
+
requestBody?: never;
|
|
1883
|
+
responses: {
|
|
1884
|
+
/** @description Media asset ready */
|
|
1885
|
+
200: {
|
|
1886
|
+
headers: {
|
|
1887
|
+
[name: string]: unknown;
|
|
1888
|
+
};
|
|
1889
|
+
content: {
|
|
1890
|
+
"application/json": {
|
|
1891
|
+
/**
|
|
1892
|
+
* Format: uuid
|
|
1893
|
+
* @description Server-generated media asset ID. Reveals nothing about the file or where it is stored.
|
|
1894
|
+
*/
|
|
1895
|
+
id: string;
|
|
1896
|
+
/**
|
|
1897
|
+
* Format: uuid
|
|
1898
|
+
* @description Owning organization ID. Derived from the authenticated session, never client-settable.
|
|
1899
|
+
*/
|
|
1900
|
+
organizationId: string;
|
|
1901
|
+
/**
|
|
1902
|
+
* Format: uuid
|
|
1903
|
+
* @description ID of the user whose session created the asset. Derived from the authenticated session, never client-settable. Omitted when that user was later purged.
|
|
1904
|
+
*/
|
|
1905
|
+
createdBy?: string;
|
|
1906
|
+
/**
|
|
1907
|
+
* @description Where the bytes are stored (`r2` or `gdrive`).
|
|
1908
|
+
* @enum {string}
|
|
1909
|
+
*/
|
|
1910
|
+
backend: "r2" | "gdrive";
|
|
1911
|
+
/**
|
|
1912
|
+
* Format: uuid
|
|
1913
|
+
* @description ID of the Google Drive connection (`connections.id`) the file was uploaded through. Set only when `backend` is `gdrive`; omitted for `r2`, and when that connection was later deleted.
|
|
1914
|
+
*/
|
|
1915
|
+
connectionId?: string;
|
|
1916
|
+
/** @description Identifier of the file in the person's own storage: the Google Drive file ID when `backend` is `gdrive`. Server-written once the upload is completed; omitted for `r2`, whose storage location is never on the wire, and while a `gdrive` asset is `pending`. */
|
|
1917
|
+
externalId?: string;
|
|
1918
|
+
/**
|
|
1919
|
+
* @description Image or video, derived by the server from `contentType`.
|
|
1920
|
+
* @enum {string}
|
|
1921
|
+
*/
|
|
1922
|
+
kind: "image" | "video";
|
|
1923
|
+
/**
|
|
1924
|
+
* @description Media type of the file, from the closed allowlist; checked against the sniffed bytes on completion.
|
|
1925
|
+
* @enum {string}
|
|
1926
|
+
*/
|
|
1927
|
+
contentType: "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/heic" | "video/mp4" | "video/quicktime" | "video/webm";
|
|
1928
|
+
/**
|
|
1929
|
+
* Format: int64
|
|
1930
|
+
* @description Size of the file in bytes, as declared at create. `completeMediaAsset` refuses an upload whose stored size differs.
|
|
1931
|
+
*/
|
|
1932
|
+
bytes: number;
|
|
1933
|
+
/** @description Lowercase hex SHA-256 of the file's bytes as uploaded (after any metadata stripping), as declared at create. `completeMediaAsset` refuses an upload whose stored bytes hash differently, and a reader compares the bytes it downloads against it before posting them. */
|
|
1934
|
+
sha256: string;
|
|
1935
|
+
/** @description Display name of the file, typically its original file name. Shown to people only; the type is never inferred from it. */
|
|
1936
|
+
name?: string;
|
|
1937
|
+
/** @description Whether the uploading client removed location metadata (EXIF and XMP GPS, plus maker notes and device serial numbers) from the file before uploading it. Declared by the client and recorded as sent; the server does not inspect the bytes for metadata. `false` records that the bytes may still carry where they were captured, for example a video whose location the client could not remove. */
|
|
1938
|
+
locationStripped: boolean;
|
|
1939
|
+
/**
|
|
1940
|
+
* @description Lifecycle of the asset. `pending` from create until it is completed; `ready` once the stored bytes matched the declaration; `rejected` when they did not (see `rejectionReason`); `expired` once `expiresAt` passed, whether the upload was never completed or the retention of a `ready` asset ended. Evaluated when the asset is read.
|
|
1941
|
+
* @enum {string}
|
|
1942
|
+
*/
|
|
1943
|
+
status: "pending" | "ready" | "rejected" | "expired";
|
|
1944
|
+
/**
|
|
1945
|
+
* @description Why the upload was rejected. Set only on a `rejected` asset.
|
|
1946
|
+
* @enum {string}
|
|
1947
|
+
*/
|
|
1948
|
+
rejectionReason?: "missing" | "size" | "type" | "checksum";
|
|
1949
|
+
/**
|
|
1950
|
+
* Format: date-time
|
|
1951
|
+
* @description Time the client asked the asset to stay downloadable until, from the create payload or the last `updateMediaAsset`. Null when the client never asked, in which case the organization's default retention applies once the asset is completed.
|
|
1952
|
+
*/
|
|
1953
|
+
retainUntil?: string | null;
|
|
1954
|
+
/**
|
|
1955
|
+
* Format: date-time
|
|
1956
|
+
* @description Time `completeMediaAsset` accepted the upload. Null until the asset is `ready`, and on a `rejected` asset.
|
|
1957
|
+
*/
|
|
1958
|
+
completedAt?: string | null;
|
|
1959
|
+
/**
|
|
1960
|
+
* Format: date-time
|
|
1961
|
+
* @description Time the asset stops being usable. Always set by the server. While `pending` it is the end of the upload window (`uploadWindowSeconds` of the quota after creation). Once `ready` it is `retainUntil` when the client set one, otherwise `completedAt` plus the organization's `defaultRetentionDays`. Past it the asset reads `expired`, no download is minted, and the stored bytes of an `r2` asset are removed.
|
|
1962
|
+
*/
|
|
1963
|
+
expiresAt: string;
|
|
1964
|
+
/**
|
|
1965
|
+
* Format: date-time
|
|
1966
|
+
* @description Timestamp of media asset creation.
|
|
1967
|
+
*/
|
|
1968
|
+
createdAt: string;
|
|
1969
|
+
/**
|
|
1970
|
+
* Format: date-time
|
|
1971
|
+
* @description Timestamp of last media asset modification.
|
|
1972
|
+
*/
|
|
1973
|
+
updatedAt: string;
|
|
1974
|
+
/**
|
|
1975
|
+
* Format: date-time
|
|
1976
|
+
* @description Timestamp when the media asset was deleted. A deleted asset is never returned by the API.
|
|
1977
|
+
*/
|
|
1978
|
+
deletedAt?: string | null;
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
/** @description Invalid request body or request param */
|
|
1983
|
+
400: {
|
|
1984
|
+
headers: {
|
|
1985
|
+
[name: string]: unknown;
|
|
1986
|
+
};
|
|
1987
|
+
content: {
|
|
1988
|
+
"text/plain": string;
|
|
1989
|
+
};
|
|
1990
|
+
};
|
|
1991
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1992
|
+
401: {
|
|
1993
|
+
headers: {
|
|
1994
|
+
[name: string]: unknown;
|
|
1995
|
+
};
|
|
1996
|
+
content: {
|
|
1997
|
+
"text/plain": string;
|
|
1998
|
+
};
|
|
1999
|
+
};
|
|
2000
|
+
/** @description Forbidden */
|
|
2001
|
+
403: {
|
|
2002
|
+
headers: {
|
|
2003
|
+
[name: string]: unknown;
|
|
2004
|
+
};
|
|
2005
|
+
content: {
|
|
2006
|
+
"text/plain": string;
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
/** @description Result not found */
|
|
2010
|
+
404: {
|
|
2011
|
+
headers: {
|
|
2012
|
+
[name: string]: unknown;
|
|
2013
|
+
};
|
|
2014
|
+
content: {
|
|
2015
|
+
"text/plain": string;
|
|
2016
|
+
};
|
|
2017
|
+
};
|
|
2018
|
+
/** @description Conflict - the asset is not in a status the operation accepts, the uploaded bytes did not match the declared size, type or SHA-256 (or nothing was uploaded), or the asset would take the organization past its storage limit */
|
|
2019
|
+
409: {
|
|
2020
|
+
headers: {
|
|
2021
|
+
[name: string]: unknown;
|
|
2022
|
+
};
|
|
2023
|
+
content: {
|
|
2024
|
+
"text/plain": string;
|
|
2025
|
+
};
|
|
2026
|
+
};
|
|
2027
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
2028
|
+
429: {
|
|
2029
|
+
headers: {
|
|
2030
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
2031
|
+
"Retry-After": number;
|
|
2032
|
+
[name: string]: unknown;
|
|
2033
|
+
};
|
|
2034
|
+
content: {
|
|
2035
|
+
"application/json": {
|
|
2036
|
+
/** @description The sentence the caller is shown. */
|
|
2037
|
+
error: string;
|
|
2038
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
2039
|
+
code?: string;
|
|
2040
|
+
/**
|
|
2041
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
2042
|
+
* @enum {string}
|
|
2043
|
+
*/
|
|
2044
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
2045
|
+
/** @description MeshKit's probable causes of the error. */
|
|
2046
|
+
probableCause?: string[];
|
|
2047
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
2048
|
+
suggestedRemediation?: string[];
|
|
2049
|
+
};
|
|
2050
|
+
};
|
|
2051
|
+
};
|
|
2052
|
+
/** @description Internal server error */
|
|
2053
|
+
500: {
|
|
2054
|
+
headers: {
|
|
2055
|
+
[name: string]: unknown;
|
|
2056
|
+
};
|
|
2057
|
+
content: {
|
|
2058
|
+
"text/plain": string;
|
|
2059
|
+
};
|
|
2060
|
+
};
|
|
2061
|
+
/** @description Bad gateway - an upstream service the operation depends on could not be reached or rejected the request */
|
|
2062
|
+
502: {
|
|
2063
|
+
headers: {
|
|
2064
|
+
[name: string]: unknown;
|
|
2065
|
+
};
|
|
2066
|
+
content: {
|
|
2067
|
+
"application/json": {
|
|
2068
|
+
/** @description The sentence the caller is shown. */
|
|
2069
|
+
error: string;
|
|
2070
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
2071
|
+
code?: string;
|
|
2072
|
+
/**
|
|
2073
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
2074
|
+
* @enum {string}
|
|
2075
|
+
*/
|
|
2076
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
2077
|
+
/** @description MeshKit's probable causes of the error. */
|
|
2078
|
+
probableCause?: string[];
|
|
2079
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
2080
|
+
suggestedRemediation?: string[];
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
};
|
|
2086
|
+
getMediaAssetDownload: {
|
|
2087
|
+
parameters: {
|
|
2088
|
+
query?: never;
|
|
2089
|
+
header?: never;
|
|
2090
|
+
path: {
|
|
2091
|
+
/** @description Media asset ID */
|
|
2092
|
+
mediaAssetId: string;
|
|
2093
|
+
};
|
|
2094
|
+
cookie?: never;
|
|
2095
|
+
};
|
|
2096
|
+
requestBody?: never;
|
|
2097
|
+
responses: {
|
|
2098
|
+
/** @description Media asset download */
|
|
2099
|
+
200: {
|
|
2100
|
+
headers: {
|
|
2101
|
+
/** @description Always `no-store`; the answer is a grant and must not be cached. */
|
|
2102
|
+
"Cache-Control"?: string;
|
|
2103
|
+
[name: string]: unknown;
|
|
2104
|
+
};
|
|
2105
|
+
content: {
|
|
2106
|
+
"application/json": {
|
|
2107
|
+
/**
|
|
2108
|
+
* @description HTTP method to use. `PUT` for an upload, `GET` for a download.
|
|
2109
|
+
* @enum {string}
|
|
2110
|
+
*/
|
|
2111
|
+
method: "PUT" | "GET";
|
|
2112
|
+
/**
|
|
2113
|
+
* Format: uri
|
|
2114
|
+
* @description Absolute HTTPS URL to send the request to.
|
|
2115
|
+
*/
|
|
2116
|
+
url: string;
|
|
2117
|
+
/** @description Headers the request must carry, verbatim (for an upload, at least `Content-Type`, and any integrity header the signature binds). Empty when none are needed. Never contains an authorization header. */
|
|
2118
|
+
headers: {
|
|
2119
|
+
[key: string]: string;
|
|
2120
|
+
};
|
|
2121
|
+
/**
|
|
2122
|
+
* Format: date-time
|
|
2123
|
+
* @description Time the URL stops working.
|
|
2124
|
+
*/
|
|
2125
|
+
expiresAt: string;
|
|
2126
|
+
};
|
|
2127
|
+
};
|
|
2128
|
+
};
|
|
2129
|
+
/** @description Invalid request body or request param */
|
|
2130
|
+
400: {
|
|
2131
|
+
headers: {
|
|
2132
|
+
[name: string]: unknown;
|
|
2133
|
+
};
|
|
2134
|
+
content: {
|
|
2135
|
+
"text/plain": string;
|
|
2136
|
+
};
|
|
2137
|
+
};
|
|
2138
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
2139
|
+
401: {
|
|
2140
|
+
headers: {
|
|
2141
|
+
[name: string]: unknown;
|
|
2142
|
+
};
|
|
2143
|
+
content: {
|
|
2144
|
+
"text/plain": string;
|
|
2145
|
+
};
|
|
2146
|
+
};
|
|
2147
|
+
/** @description Forbidden */
|
|
2148
|
+
403: {
|
|
2149
|
+
headers: {
|
|
2150
|
+
[name: string]: unknown;
|
|
2151
|
+
};
|
|
2152
|
+
content: {
|
|
2153
|
+
"text/plain": string;
|
|
2154
|
+
};
|
|
2155
|
+
};
|
|
2156
|
+
/** @description Result not found */
|
|
2157
|
+
404: {
|
|
2158
|
+
headers: {
|
|
2159
|
+
[name: string]: unknown;
|
|
2160
|
+
};
|
|
2161
|
+
content: {
|
|
2162
|
+
"text/plain": string;
|
|
2163
|
+
};
|
|
2164
|
+
};
|
|
2165
|
+
/** @description Conflict - the asset is not in a status the operation accepts, the uploaded bytes did not match the declared size, type or SHA-256 (or nothing was uploaded), or the asset would take the organization past its storage limit */
|
|
2166
|
+
409: {
|
|
2167
|
+
headers: {
|
|
2168
|
+
[name: string]: unknown;
|
|
2169
|
+
};
|
|
2170
|
+
content: {
|
|
2171
|
+
"text/plain": string;
|
|
2172
|
+
};
|
|
2173
|
+
};
|
|
2174
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
2175
|
+
429: {
|
|
2176
|
+
headers: {
|
|
2177
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
2178
|
+
"Retry-After": number;
|
|
2179
|
+
[name: string]: unknown;
|
|
2180
|
+
};
|
|
2181
|
+
content: {
|
|
2182
|
+
"application/json": {
|
|
2183
|
+
/** @description The sentence the caller is shown. */
|
|
2184
|
+
error: string;
|
|
2185
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
2186
|
+
code?: string;
|
|
2187
|
+
/**
|
|
2188
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
2189
|
+
* @enum {string}
|
|
2190
|
+
*/
|
|
2191
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
2192
|
+
/** @description MeshKit's probable causes of the error. */
|
|
2193
|
+
probableCause?: string[];
|
|
2194
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
2195
|
+
suggestedRemediation?: string[];
|
|
2196
|
+
};
|
|
2197
|
+
};
|
|
2198
|
+
};
|
|
2199
|
+
/** @description Internal server error */
|
|
2200
|
+
500: {
|
|
2201
|
+
headers: {
|
|
2202
|
+
[name: string]: unknown;
|
|
2203
|
+
};
|
|
2204
|
+
content: {
|
|
2205
|
+
"text/plain": string;
|
|
2206
|
+
};
|
|
2207
|
+
};
|
|
2208
|
+
};
|
|
2209
|
+
};
|
|
2210
|
+
getMediaAssetContent: {
|
|
2211
|
+
parameters: {
|
|
2212
|
+
query: {
|
|
2213
|
+
/** @description Time the grant lapses, in seconds since the Unix epoch. */
|
|
2214
|
+
expires: number;
|
|
2215
|
+
/** @description Server-computed signature over the asset ID and `expires`. Opaque to clients. */
|
|
2216
|
+
signature: string;
|
|
2217
|
+
};
|
|
2218
|
+
header?: never;
|
|
2219
|
+
path: {
|
|
2220
|
+
/** @description Media asset ID */
|
|
2221
|
+
mediaAssetId: string;
|
|
2222
|
+
};
|
|
2223
|
+
cookie?: never;
|
|
2224
|
+
};
|
|
2225
|
+
requestBody?: never;
|
|
2226
|
+
responses: {
|
|
2227
|
+
/** @description Media asset bytes */
|
|
2228
|
+
200: {
|
|
2229
|
+
headers: {
|
|
2230
|
+
[name: string]: unknown;
|
|
2231
|
+
};
|
|
2232
|
+
content: {
|
|
2233
|
+
"application/octet-stream": string;
|
|
2234
|
+
};
|
|
2235
|
+
};
|
|
2236
|
+
/** @description Invalid request body or request param */
|
|
2237
|
+
400: {
|
|
2238
|
+
headers: {
|
|
2239
|
+
[name: string]: unknown;
|
|
2240
|
+
};
|
|
2241
|
+
content: {
|
|
2242
|
+
"text/plain": string;
|
|
2243
|
+
};
|
|
2244
|
+
};
|
|
2245
|
+
/** @description Forbidden */
|
|
2246
|
+
403: {
|
|
2247
|
+
headers: {
|
|
2248
|
+
[name: string]: unknown;
|
|
2249
|
+
};
|
|
2250
|
+
content: {
|
|
2251
|
+
"text/plain": string;
|
|
2252
|
+
};
|
|
2253
|
+
};
|
|
2254
|
+
/** @description Result not found */
|
|
2255
|
+
404: {
|
|
2256
|
+
headers: {
|
|
2257
|
+
[name: string]: unknown;
|
|
2258
|
+
};
|
|
2259
|
+
content: {
|
|
2260
|
+
"text/plain": string;
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
/** @description Too many requests - the caller exceeded the server's per-user request rate for this route family. Wait the number of seconds in `Retry-After` before retrying. */
|
|
2264
|
+
429: {
|
|
2265
|
+
headers: {
|
|
2266
|
+
/** @description Number of seconds the caller must wait before retrying. */
|
|
2267
|
+
"Retry-After": number;
|
|
2268
|
+
[name: string]: unknown;
|
|
2269
|
+
};
|
|
2270
|
+
content: {
|
|
2271
|
+
"application/json": {
|
|
2272
|
+
/** @description The sentence the caller is shown. */
|
|
2273
|
+
error: string;
|
|
2274
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
2275
|
+
code?: string;
|
|
2276
|
+
/**
|
|
2277
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
2278
|
+
* @enum {string}
|
|
2279
|
+
*/
|
|
2280
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
2281
|
+
/** @description MeshKit's probable causes of the error. */
|
|
2282
|
+
probableCause?: string[];
|
|
2283
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
2284
|
+
suggestedRemediation?: string[];
|
|
2285
|
+
};
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
/** @description Internal server error */
|
|
2289
|
+
500: {
|
|
2290
|
+
headers: {
|
|
2291
|
+
[name: string]: unknown;
|
|
2292
|
+
};
|
|
2293
|
+
content: {
|
|
2294
|
+
"text/plain": string;
|
|
2295
|
+
};
|
|
2296
|
+
};
|
|
2297
|
+
/** @description Bad gateway - an upstream service the operation depends on could not be reached or rejected the request */
|
|
2298
|
+
502: {
|
|
2299
|
+
headers: {
|
|
2300
|
+
[name: string]: unknown;
|
|
2301
|
+
};
|
|
2302
|
+
content: {
|
|
2303
|
+
"application/json": {
|
|
2304
|
+
/** @description The sentence the caller is shown. */
|
|
2305
|
+
error: string;
|
|
2306
|
+
/** @description MeshKit error code, a component-scoped identifier allocated by the emitting service (e.g. `<component>-<number>`); it is not a stable part of this contract. Omitted for an error that is not a MeshKit error. */
|
|
2307
|
+
code?: string;
|
|
2308
|
+
/**
|
|
2309
|
+
* @description MeshKit severity name. Omitted when MeshKit reports none.
|
|
2310
|
+
* @enum {string}
|
|
2311
|
+
*/
|
|
2312
|
+
severity?: "emergency" | "alert" | "critical" | "fatal";
|
|
2313
|
+
/** @description MeshKit's probable causes of the error. */
|
|
2314
|
+
probableCause?: string[];
|
|
2315
|
+
/** @description MeshKit's suggested remediations for the error. */
|
|
2316
|
+
suggestedRemediation?: string[];
|
|
2317
|
+
};
|
|
2318
|
+
};
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
};
|
|
2322
|
+
}
|