@uln/manage 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +193 -2
- package/dist/index.js +165 -0
- package/dist/rpc.js +0 -0
- package/dist/types/sdk/index.d.ts +39 -0
- package/dist/types/sdk/media-env.d.ts +60 -0
- package/dist/types/sdk/media-types.d.ts +43 -0
- package/dist/types/sdk/media.d.ts +45 -0
- package/dist/types/sdk/rpc.d.ts +1 -0
- package/dist/types/sdk/vite.d.ts +13 -0
- package/dist/types/src/content-api-spec.d.ts +586 -0
- package/dist/types/src/content-types.d.ts +47 -0
- package/dist/types/src/lib/category-order.d.ts +35 -0
- package/dist/types/src/media-origins.d.ts +25 -0
- package/dist/types/src/media-sizes.d.ts +22 -0
- package/dist/types/src/package-report.d.ts +58 -0
- package/dist/types/src/preview-asset.d.ts +52 -0
- package/dist/types/src/public-content.d.ts +52 -0
- package/dist/types/src/rpc-types.d.ts +43 -0
- package/dist/types/src/schema.d.ts +180 -0
- package/dist/vite.js +481 -0
- package/package.json +53 -4
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP content API's contract (OpenAPI 3.1), served at `/api/content/v1/openapi.json`. It describes the shapes in
|
|
3
|
+
* `src/public-content.ts`; `test/content-api.test.ts` checks real responses against it. Like the RPC contract, it only
|
|
4
|
+
* grows: new paths and new optional fields.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CONTENT_API_BASE = "/api/content/v1";
|
|
7
|
+
/** The OpenAPI document, with `server` as its base URL (Manage's own origin). */
|
|
8
|
+
export declare function contentApiSpec(server: string): {
|
|
9
|
+
openapi: string;
|
|
10
|
+
info: {
|
|
11
|
+
title: string;
|
|
12
|
+
version: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
servers: {
|
|
16
|
+
url: string;
|
|
17
|
+
}[];
|
|
18
|
+
security: {
|
|
19
|
+
apiKey: never[];
|
|
20
|
+
}[];
|
|
21
|
+
paths: {
|
|
22
|
+
"/films": {
|
|
23
|
+
get: {
|
|
24
|
+
operationId: string;
|
|
25
|
+
summary: string;
|
|
26
|
+
parameters: {
|
|
27
|
+
name: string;
|
|
28
|
+
in: string;
|
|
29
|
+
required: boolean;
|
|
30
|
+
schema: {
|
|
31
|
+
type: string;
|
|
32
|
+
pattern: string;
|
|
33
|
+
};
|
|
34
|
+
description: string;
|
|
35
|
+
}[];
|
|
36
|
+
responses: {
|
|
37
|
+
"401": {
|
|
38
|
+
description: string;
|
|
39
|
+
content: {
|
|
40
|
+
"application/json": {
|
|
41
|
+
schema: {
|
|
42
|
+
$ref: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
"503": {
|
|
48
|
+
description: string;
|
|
49
|
+
content: {
|
|
50
|
+
"application/json": {
|
|
51
|
+
schema: {
|
|
52
|
+
$ref: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
"400": {
|
|
58
|
+
description: string;
|
|
59
|
+
content: {
|
|
60
|
+
"application/json": {
|
|
61
|
+
schema: {
|
|
62
|
+
$ref: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
"200": {
|
|
68
|
+
description: string;
|
|
69
|
+
content: {
|
|
70
|
+
"application/json": {
|
|
71
|
+
schema: {
|
|
72
|
+
type: string;
|
|
73
|
+
required: string[];
|
|
74
|
+
properties: {
|
|
75
|
+
[x: string]: object;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
"/films/{id}": {
|
|
85
|
+
get: {
|
|
86
|
+
operationId: string;
|
|
87
|
+
summary: string;
|
|
88
|
+
parameters: ({
|
|
89
|
+
name: string;
|
|
90
|
+
in: string;
|
|
91
|
+
required: boolean;
|
|
92
|
+
schema: {
|
|
93
|
+
type: string;
|
|
94
|
+
pattern: string;
|
|
95
|
+
};
|
|
96
|
+
description: string;
|
|
97
|
+
} | {
|
|
98
|
+
name: string;
|
|
99
|
+
in: string;
|
|
100
|
+
required: boolean;
|
|
101
|
+
schema: {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
};
|
|
104
|
+
description: string;
|
|
105
|
+
})[];
|
|
106
|
+
responses: {
|
|
107
|
+
"401": {
|
|
108
|
+
description: string;
|
|
109
|
+
content: {
|
|
110
|
+
"application/json": {
|
|
111
|
+
schema: {
|
|
112
|
+
$ref: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
"503": {
|
|
118
|
+
description: string;
|
|
119
|
+
content: {
|
|
120
|
+
"application/json": {
|
|
121
|
+
schema: {
|
|
122
|
+
$ref: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
"400": {
|
|
128
|
+
description: string;
|
|
129
|
+
content: {
|
|
130
|
+
"application/json": {
|
|
131
|
+
schema: {
|
|
132
|
+
$ref: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
"200": {
|
|
138
|
+
description: string;
|
|
139
|
+
content: {
|
|
140
|
+
"application/json": {
|
|
141
|
+
schema: {
|
|
142
|
+
type: string;
|
|
143
|
+
required: string[];
|
|
144
|
+
properties: {
|
|
145
|
+
[x: string]: object;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
"404": {
|
|
152
|
+
description: string;
|
|
153
|
+
content: {
|
|
154
|
+
"application/json": {
|
|
155
|
+
schema: {
|
|
156
|
+
$ref: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
"/shoots": {
|
|
165
|
+
get: {
|
|
166
|
+
operationId: string;
|
|
167
|
+
summary: string;
|
|
168
|
+
parameters: {
|
|
169
|
+
name: string;
|
|
170
|
+
in: string;
|
|
171
|
+
required: boolean;
|
|
172
|
+
schema: {
|
|
173
|
+
type: string;
|
|
174
|
+
pattern: string;
|
|
175
|
+
};
|
|
176
|
+
description: string;
|
|
177
|
+
}[];
|
|
178
|
+
responses: {
|
|
179
|
+
"401": {
|
|
180
|
+
description: string;
|
|
181
|
+
content: {
|
|
182
|
+
"application/json": {
|
|
183
|
+
schema: {
|
|
184
|
+
$ref: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
"503": {
|
|
190
|
+
description: string;
|
|
191
|
+
content: {
|
|
192
|
+
"application/json": {
|
|
193
|
+
schema: {
|
|
194
|
+
$ref: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
"400": {
|
|
200
|
+
description: string;
|
|
201
|
+
content: {
|
|
202
|
+
"application/json": {
|
|
203
|
+
schema: {
|
|
204
|
+
$ref: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
"200": {
|
|
210
|
+
description: string;
|
|
211
|
+
content: {
|
|
212
|
+
"application/json": {
|
|
213
|
+
schema: {
|
|
214
|
+
type: string;
|
|
215
|
+
required: string[];
|
|
216
|
+
properties: {
|
|
217
|
+
[x: string]: object;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
"/shoots/{id}": {
|
|
227
|
+
get: {
|
|
228
|
+
operationId: string;
|
|
229
|
+
summary: string;
|
|
230
|
+
parameters: ({
|
|
231
|
+
name: string;
|
|
232
|
+
in: string;
|
|
233
|
+
required: boolean;
|
|
234
|
+
schema: {
|
|
235
|
+
type: string;
|
|
236
|
+
pattern: string;
|
|
237
|
+
};
|
|
238
|
+
description: string;
|
|
239
|
+
} | {
|
|
240
|
+
name: string;
|
|
241
|
+
in: string;
|
|
242
|
+
required: boolean;
|
|
243
|
+
schema: {
|
|
244
|
+
readonly type: "string";
|
|
245
|
+
};
|
|
246
|
+
description: string;
|
|
247
|
+
})[];
|
|
248
|
+
responses: {
|
|
249
|
+
"401": {
|
|
250
|
+
description: string;
|
|
251
|
+
content: {
|
|
252
|
+
"application/json": {
|
|
253
|
+
schema: {
|
|
254
|
+
$ref: string;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
"503": {
|
|
260
|
+
description: string;
|
|
261
|
+
content: {
|
|
262
|
+
"application/json": {
|
|
263
|
+
schema: {
|
|
264
|
+
$ref: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
"400": {
|
|
270
|
+
description: string;
|
|
271
|
+
content: {
|
|
272
|
+
"application/json": {
|
|
273
|
+
schema: {
|
|
274
|
+
$ref: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
"200": {
|
|
280
|
+
description: string;
|
|
281
|
+
content: {
|
|
282
|
+
"application/json": {
|
|
283
|
+
schema: {
|
|
284
|
+
type: string;
|
|
285
|
+
required: string[];
|
|
286
|
+
properties: {
|
|
287
|
+
[x: string]: object;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
"404": {
|
|
294
|
+
description: string;
|
|
295
|
+
content: {
|
|
296
|
+
"application/json": {
|
|
297
|
+
schema: {
|
|
298
|
+
$ref: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
"/contacts": {
|
|
307
|
+
get: {
|
|
308
|
+
operationId: string;
|
|
309
|
+
summary: string;
|
|
310
|
+
responses: {
|
|
311
|
+
"401": {
|
|
312
|
+
description: string;
|
|
313
|
+
content: {
|
|
314
|
+
"application/json": {
|
|
315
|
+
schema: {
|
|
316
|
+
$ref: string;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
"503": {
|
|
322
|
+
description: string;
|
|
323
|
+
content: {
|
|
324
|
+
"application/json": {
|
|
325
|
+
schema: {
|
|
326
|
+
$ref: string;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
"200": {
|
|
332
|
+
description: string;
|
|
333
|
+
content: {
|
|
334
|
+
"application/json": {
|
|
335
|
+
schema: {
|
|
336
|
+
type: string;
|
|
337
|
+
required: string[];
|
|
338
|
+
properties: {
|
|
339
|
+
[x: string]: object;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
components: {
|
|
350
|
+
securitySchemes: {
|
|
351
|
+
apiKey: {
|
|
352
|
+
type: string;
|
|
353
|
+
scheme: string;
|
|
354
|
+
description: string;
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
schemas: {
|
|
358
|
+
Film: {
|
|
359
|
+
readonly type: "object";
|
|
360
|
+
readonly description: "A published film: metadata and signed provider URLs, ready to display.";
|
|
361
|
+
readonly required: readonly ["id", "title", "role", "category", "playbackUrl", "posterUrl", "expiresAt"];
|
|
362
|
+
readonly properties: {
|
|
363
|
+
readonly id: {
|
|
364
|
+
readonly type: "string";
|
|
365
|
+
};
|
|
366
|
+
readonly title: {
|
|
367
|
+
readonly type: "string";
|
|
368
|
+
};
|
|
369
|
+
readonly role: {
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
};
|
|
372
|
+
readonly category: {
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
};
|
|
375
|
+
readonly year: {
|
|
376
|
+
readonly type: "string";
|
|
377
|
+
};
|
|
378
|
+
readonly client: {
|
|
379
|
+
readonly type: "string";
|
|
380
|
+
};
|
|
381
|
+
readonly clientUrl: {
|
|
382
|
+
readonly type: "string";
|
|
383
|
+
};
|
|
384
|
+
readonly description: {
|
|
385
|
+
readonly type: "string";
|
|
386
|
+
};
|
|
387
|
+
readonly credits: {
|
|
388
|
+
readonly type: "array";
|
|
389
|
+
readonly items: {
|
|
390
|
+
readonly $ref: "#/components/schemas/Credit";
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
readonly aspectRatio: {
|
|
394
|
+
readonly type: "number";
|
|
395
|
+
readonly description: "Width / height.";
|
|
396
|
+
};
|
|
397
|
+
readonly previewStart: {
|
|
398
|
+
readonly type: "number";
|
|
399
|
+
readonly description: "Film time, in seconds, that the preview clip starts at.";
|
|
400
|
+
};
|
|
401
|
+
readonly previewEnd: {
|
|
402
|
+
readonly type: "number";
|
|
403
|
+
};
|
|
404
|
+
readonly playbackUrl: {
|
|
405
|
+
readonly type: "string";
|
|
406
|
+
readonly format: "uri";
|
|
407
|
+
readonly description: "HLS manifest for the full film.";
|
|
408
|
+
};
|
|
409
|
+
readonly posterUrl: {
|
|
410
|
+
readonly type: "string";
|
|
411
|
+
readonly format: "uri";
|
|
412
|
+
};
|
|
413
|
+
readonly posterVariants: {
|
|
414
|
+
readonly type: "object";
|
|
415
|
+
readonly description: string;
|
|
416
|
+
readonly additionalProperties: {
|
|
417
|
+
readonly type: "string";
|
|
418
|
+
readonly format: "uri";
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
readonly posterSrcset: {
|
|
422
|
+
readonly type: "string";
|
|
423
|
+
readonly description: "`posterVariants` as an `<img srcset>` (`url 640w, url 1280w`), narrowest first.";
|
|
424
|
+
};
|
|
425
|
+
readonly previewUrl: {
|
|
426
|
+
readonly type: "string";
|
|
427
|
+
readonly format: "uri";
|
|
428
|
+
readonly description: "Silent MP4 preview clip, when the film has one.";
|
|
429
|
+
};
|
|
430
|
+
readonly previewPlaybackUrl: {
|
|
431
|
+
readonly type: "string";
|
|
432
|
+
readonly format: "uri";
|
|
433
|
+
readonly description: string;
|
|
434
|
+
};
|
|
435
|
+
readonly previewBytes: {
|
|
436
|
+
readonly type: "integer";
|
|
437
|
+
readonly description: "The preview clip's size in bytes, when known.";
|
|
438
|
+
};
|
|
439
|
+
readonly expiresAt: {
|
|
440
|
+
readonly type: readonly ["integer", "null"];
|
|
441
|
+
readonly description: "Unix milliseconds when the earliest signed URL in this record expires; null when nothing expires. Refresh before then.";
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
Shoot: {
|
|
446
|
+
readonly type: "object";
|
|
447
|
+
readonly description: "A published shoot with its photos in order.";
|
|
448
|
+
readonly required: readonly ["id", "title", "photos"];
|
|
449
|
+
readonly properties: {
|
|
450
|
+
readonly id: {
|
|
451
|
+
readonly type: "string";
|
|
452
|
+
};
|
|
453
|
+
readonly title: {
|
|
454
|
+
readonly type: "string";
|
|
455
|
+
};
|
|
456
|
+
readonly category: {
|
|
457
|
+
readonly type: "string";
|
|
458
|
+
};
|
|
459
|
+
readonly year: {
|
|
460
|
+
readonly type: "string";
|
|
461
|
+
};
|
|
462
|
+
readonly role: {
|
|
463
|
+
readonly type: "string";
|
|
464
|
+
};
|
|
465
|
+
readonly description: {
|
|
466
|
+
readonly type: "string";
|
|
467
|
+
};
|
|
468
|
+
readonly credits: {
|
|
469
|
+
readonly type: "array";
|
|
470
|
+
readonly items: {
|
|
471
|
+
readonly $ref: "#/components/schemas/Credit";
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
readonly tags: {
|
|
475
|
+
readonly type: "array";
|
|
476
|
+
readonly items: {
|
|
477
|
+
readonly type: "string";
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
readonly url: {
|
|
481
|
+
readonly type: "string";
|
|
482
|
+
};
|
|
483
|
+
readonly client: {
|
|
484
|
+
readonly type: "string";
|
|
485
|
+
};
|
|
486
|
+
readonly clientUrl: {
|
|
487
|
+
readonly type: "string";
|
|
488
|
+
};
|
|
489
|
+
readonly photos: {
|
|
490
|
+
readonly type: "array";
|
|
491
|
+
readonly items: {
|
|
492
|
+
readonly $ref: "#/components/schemas/Photo";
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
Photo: {
|
|
498
|
+
readonly type: "object";
|
|
499
|
+
readonly required: readonly ["id", "width", "height", "url", "expiresAt"];
|
|
500
|
+
readonly properties: {
|
|
501
|
+
readonly id: {
|
|
502
|
+
readonly type: "string";
|
|
503
|
+
};
|
|
504
|
+
readonly width: {
|
|
505
|
+
readonly type: "number";
|
|
506
|
+
};
|
|
507
|
+
readonly height: {
|
|
508
|
+
readonly type: "number";
|
|
509
|
+
};
|
|
510
|
+
readonly alt: {
|
|
511
|
+
readonly type: "string";
|
|
512
|
+
};
|
|
513
|
+
readonly url: {
|
|
514
|
+
readonly type: "string";
|
|
515
|
+
readonly format: "uri";
|
|
516
|
+
readonly description: "The photo at its stored size.";
|
|
517
|
+
};
|
|
518
|
+
readonly variants: {
|
|
519
|
+
readonly type: "object";
|
|
520
|
+
readonly description: string;
|
|
521
|
+
readonly additionalProperties: {
|
|
522
|
+
readonly type: "string";
|
|
523
|
+
readonly format: "uri";
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
readonly srcset: {
|
|
527
|
+
readonly type: "string";
|
|
528
|
+
readonly description: string;
|
|
529
|
+
};
|
|
530
|
+
readonly placeholder: {
|
|
531
|
+
readonly type: "string";
|
|
532
|
+
readonly description: string;
|
|
533
|
+
};
|
|
534
|
+
readonly color: {
|
|
535
|
+
readonly type: "string";
|
|
536
|
+
readonly pattern: "^#[0-9a-f]{6}$";
|
|
537
|
+
readonly description: "The photo's average colour as `#rrggbb`, for a solid placeholder. Absent with `placeholder`.";
|
|
538
|
+
};
|
|
539
|
+
readonly expiresAt: {
|
|
540
|
+
readonly type: readonly ["integer", "null"];
|
|
541
|
+
readonly description: "Unix milliseconds when the earliest signed URL in this record expires; null when nothing expires. Refresh before then.";
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
Credit: {
|
|
546
|
+
readonly type: "object";
|
|
547
|
+
readonly required: readonly ["role", "name"];
|
|
548
|
+
readonly properties: {
|
|
549
|
+
readonly role: {
|
|
550
|
+
readonly type: "string";
|
|
551
|
+
};
|
|
552
|
+
readonly name: {
|
|
553
|
+
readonly type: "string";
|
|
554
|
+
};
|
|
555
|
+
readonly url: {
|
|
556
|
+
readonly type: "string";
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
Contact: {
|
|
561
|
+
readonly type: "object";
|
|
562
|
+
readonly required: readonly ["id", "label", "email"];
|
|
563
|
+
readonly properties: {
|
|
564
|
+
readonly id: {
|
|
565
|
+
readonly type: "string";
|
|
566
|
+
};
|
|
567
|
+
readonly label: {
|
|
568
|
+
readonly type: "string";
|
|
569
|
+
};
|
|
570
|
+
readonly email: {
|
|
571
|
+
readonly type: "string";
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
Error: {
|
|
576
|
+
readonly type: "object";
|
|
577
|
+
readonly required: readonly ["error"];
|
|
578
|
+
readonly properties: {
|
|
579
|
+
readonly error: {
|
|
580
|
+
readonly type: "string";
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CategoryIndexGroup, Film, Photo, Shoot } from "./schema.ts";
|
|
2
|
+
/** Direct provider URL. `expiresAt` is Unix milliseconds, or null for an existing public source URL. */
|
|
3
|
+
export interface MediaUrl {
|
|
4
|
+
url: string;
|
|
5
|
+
expiresAt: number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface FilmContent {
|
|
8
|
+
film: Film;
|
|
9
|
+
playback: MediaUrl;
|
|
10
|
+
poster: MediaUrl;
|
|
11
|
+
/** The poster at each width the site asked for, keyed by width. */
|
|
12
|
+
posterVariants?: Record<string, MediaUrl>;
|
|
13
|
+
preview?: MediaUrl;
|
|
14
|
+
/** The preview as an adaptive stream (HLS), when it was made with one. */
|
|
15
|
+
previewPlayback?: MediaUrl;
|
|
16
|
+
}
|
|
17
|
+
/** A photo's blurred preview and colour (`photo_previews`, made by `src/photo-previews.server.ts`). */
|
|
18
|
+
export interface PhotoPreview {
|
|
19
|
+
/** A tiny blurred WebP as a `data:` URL. */
|
|
20
|
+
placeholder: string;
|
|
21
|
+
/** The photo's average colour, `#rrggbb`. */
|
|
22
|
+
color: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PhotoContent {
|
|
25
|
+
photo: Photo;
|
|
26
|
+
image: MediaUrl;
|
|
27
|
+
/** The photo scaled down to each width the site asked for (`MediaSizes.photoWidths`), keyed by width. */
|
|
28
|
+
variants?: Record<string, MediaUrl>;
|
|
29
|
+
/** Its blurred preview and colour, once made (`src/photo-previews.server.ts`). */
|
|
30
|
+
preview?: PhotoPreview;
|
|
31
|
+
}
|
|
32
|
+
export interface ShootContent {
|
|
33
|
+
shoot: Shoot;
|
|
34
|
+
photos: PhotoContent[];
|
|
35
|
+
}
|
|
36
|
+
/** Keep rendering metadata and order intact; delivery URLs are resolved by Manage. */
|
|
37
|
+
export interface FilmsContent {
|
|
38
|
+
films: FilmContent[];
|
|
39
|
+
indexGroups: CategoryIndexGroup[];
|
|
40
|
+
/** Refresh before this time; null when no expiring URLs were issued. */
|
|
41
|
+
expiresAt: number | null;
|
|
42
|
+
}
|
|
43
|
+
export interface StillsContent {
|
|
44
|
+
shoots: ShootContent[];
|
|
45
|
+
indexGroups: CategoryIndexGroup[];
|
|
46
|
+
expiresAt: number | null;
|
|
47
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type CategoryIndexGroup = {
|
|
2
|
+
category: string;
|
|
3
|
+
indices: number[];
|
|
4
|
+
};
|
|
5
|
+
export interface FilmCategory {
|
|
6
|
+
name: string;
|
|
7
|
+
hidden: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Label for category index sections — matches {@link buildIndexGroupsFromCategoryOrderedItems} section headings. */
|
|
10
|
+
export declare function categoryIndexLabel(category: string | undefined): string;
|
|
11
|
+
/**
|
|
12
|
+
* Build sidebar/drawer section metadata from a list already ordered in category blocks
|
|
13
|
+
* (e.g. after {@link groupItemsByCategory}).
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildIndexGroupsFromCategoryOrderedItems<T extends {
|
|
16
|
+
category?: string | undefined;
|
|
17
|
+
}>(items: T[]): CategoryIndexGroup[];
|
|
18
|
+
export declare function groupItemsByCategory<T extends {
|
|
19
|
+
category?: string | undefined;
|
|
20
|
+
}>(items: T[]): T[];
|
|
21
|
+
/** Apply the explicit public category order and omit categories hidden by the site owner. */
|
|
22
|
+
export declare function organizeFilmsByCategory<T extends {
|
|
23
|
+
category: string;
|
|
24
|
+
}>(items: T[], categories: FilmCategory[]): T[];
|
|
25
|
+
/**
|
|
26
|
+
* Films in the blocks the site shows them in: by the category order (hidden categories included, and categories not
|
|
27
|
+
* listed yet last), each block keeping the films' saved order.
|
|
28
|
+
*/
|
|
29
|
+
export declare function groupFilmsByCategoryOrder<T extends {
|
|
30
|
+
category: string;
|
|
31
|
+
}>(items: T[], categories: FilmCategory[]): {
|
|
32
|
+
category: string;
|
|
33
|
+
hidden: boolean;
|
|
34
|
+
items: T[];
|
|
35
|
+
}[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the media Manage hands out is served from, for a site's Content-Security-Policy and preconnects: every video
|
|
3
|
+
* backend Manage may store a film in (Cloudflare Stream, Mux) and the Images account for stills. A site allows these
|
|
4
|
+
* and never needs to know which backend holds which film; the URLs it gets are already signed.
|
|
5
|
+
*
|
|
6
|
+
* Client-safe and part of the SDK (`mediaOrigins()` from `@uln/manage`): only grows. A new backend adds its hosts here,
|
|
7
|
+
* and sites pick them up with the next SDK release.
|
|
8
|
+
*/
|
|
9
|
+
/** Manage's media account: Stream's customer code and the Images account hash (both public). */
|
|
10
|
+
export declare const MANAGE_MEDIA_ACCOUNT: {
|
|
11
|
+
readonly streamCustomerCode: "nuayb0iz1dy4986k";
|
|
12
|
+
readonly imagesAccountHash: "SSUBLwYw6Bk_Rd7fv37_lw";
|
|
13
|
+
};
|
|
14
|
+
export interface MediaOrigins {
|
|
15
|
+
/** Video, HLS playlists and segments: `media-src` (and `connect-src`, since HLS players fetch segments). */
|
|
16
|
+
media: string[];
|
|
17
|
+
/** Posters and photos: `img-src`. */
|
|
18
|
+
images: string[];
|
|
19
|
+
/** The hosts worth a `preconnect`: where a page's first video and poster come from. */
|
|
20
|
+
preconnect: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function mediaOrigins(account?: {
|
|
23
|
+
streamCustomerCode: string;
|
|
24
|
+
imagesAccountHash: string;
|
|
25
|
+
}): MediaOrigins;
|