@zerotal/media 1.7.4 → 1.7.5
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/api-surface.md +0 -48
- package/package.json +4 -4
package/api-surface.md
CHANGED
|
@@ -16,12 +16,6 @@ class BunImageDriver = {
|
|
|
16
16
|
readonly supportsCrop: true
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
class ConversionRunner = {
|
|
20
|
-
new (driver: ImageDriver, config: MediaConfigShape): ConversionRunner
|
|
21
|
-
run: (media: MediaItem, conversions: ConversionMap) => Promise<{ generated: string[]; failed: Array<{ name: string; reason: string; }>;}>
|
|
22
|
-
runResponsive: (media: MediaItem, widths: number[]) => Promise<ResponsiveImageSet | null>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
19
|
class DefaultPathGenerator = {
|
|
26
20
|
new (prefix?: string): DefaultPathGenerator
|
|
27
21
|
forConversions: (media: MediaItem) => string
|
|
@@ -284,42 +278,12 @@ const MediaFake = { all(owner: { id: number | string; construct
|
|
|
284
278
|
|
|
285
279
|
const MediaLibrary = MediaManager
|
|
286
280
|
|
|
287
|
-
const mediaSchemaConcern = ConcernDescriptor
|
|
288
|
-
|
|
289
|
-
function applyRetentionRules = (modelType: string, modelId: number | string, collection: string, definition: CollectionDefinition, justAdded: MediaItem) => Promise<void>
|
|
290
|
-
|
|
291
|
-
function collectionNames = (host: CollectionHost) => string[]
|
|
292
|
-
|
|
293
|
-
function defaultDiskName = () => string
|
|
294
|
-
|
|
295
|
-
function diskFor = (name?: string | null) => StorageDriver
|
|
296
|
-
|
|
297
|
-
function dispatchConversions = (mediaId: number, conversions: string[]) => Promise<void>
|
|
298
|
-
|
|
299
|
-
function fromDisk = (path: string, disk?: string) => SourceResolver
|
|
300
|
-
|
|
301
|
-
function fromPath = (path: string) => SourceResolver
|
|
302
|
-
|
|
303
|
-
function fromUrl = (url: string, maxBytes: number) => SourceResolver
|
|
304
|
-
|
|
305
|
-
function fromValue = (source: MediaSource, fileName?: string) => SourceResolver
|
|
306
|
-
|
|
307
|
-
function hasCollection = (host: CollectionHost, name: string) => boolean
|
|
308
|
-
|
|
309
281
|
function isConvertible = (mimeType: string | null | undefined) => boolean
|
|
310
282
|
|
|
311
|
-
function isQueueAvailable = () => boolean
|
|
312
|
-
|
|
313
283
|
function Media = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): MediaModel; prototype: Media<any>.MediaModel; mediaCollections: MediaCollections;} & TBase
|
|
314
284
|
|
|
315
285
|
function MediaConfig = (options?: Partial<MediaConfigShape>) => MediaConfigShape
|
|
316
286
|
|
|
317
|
-
function mediaDefaults = () => MediaConfigShape
|
|
318
|
-
|
|
319
|
-
function pathGenerator = () => PathGenerator
|
|
320
|
-
|
|
321
|
-
function resolveCollection = (host: CollectionHost, name: string) => CollectionDefinition
|
|
322
|
-
|
|
323
287
|
function setPathGenerator = (generator: PathGenerator) => void
|
|
324
288
|
|
|
325
289
|
interface CleanReport = {
|
|
@@ -341,11 +305,6 @@ interface CollectionDefinition = {
|
|
|
341
305
|
single?: boolean
|
|
342
306
|
}
|
|
343
307
|
|
|
344
|
-
interface CollectionHost = {
|
|
345
|
-
mediaCollections?: MediaCollections
|
|
346
|
-
name: string
|
|
347
|
-
}
|
|
348
|
-
|
|
349
308
|
interface ConversionDefinition = {
|
|
350
309
|
allowEnlargement?: boolean
|
|
351
310
|
fit?: ConversionFit
|
|
@@ -433,11 +392,6 @@ interface PendingMediaMeta = {
|
|
|
433
392
|
order?: number
|
|
434
393
|
}
|
|
435
394
|
|
|
436
|
-
interface ResolvedSource = {
|
|
437
|
-
bytes: Uint8Array<ArrayBufferLike>
|
|
438
|
-
originalName: string
|
|
439
|
-
}
|
|
440
|
-
|
|
441
395
|
interface ResponsiveImage = {
|
|
442
396
|
fileName: string
|
|
443
397
|
height: number
|
|
@@ -461,8 +415,6 @@ type MediaSource = UploadedFile | File | Blob | Uint8Array | ArrayBuffer
|
|
|
461
415
|
|
|
462
416
|
type SafeConversionFormat = 'jpeg' | 'png' | 'webp'
|
|
463
417
|
|
|
464
|
-
type SourceResolver = () => Promise<ResolvedSource>
|
|
465
|
-
|
|
466
418
|
## ./commands `(./src/commands/index.ts)`
|
|
467
419
|
|
|
468
420
|
class MediaCleanCommand = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/media",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"typecheck": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zerotal/core": "1.7.
|
|
36
|
-
"@zerotal/orm": "1.7.
|
|
35
|
+
"@zerotal/core": "1.7.5",
|
|
36
|
+
"@zerotal/orm": "1.7.5"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@zerotal/queue": "^1.0.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@zerotal/queue": "1.7.
|
|
51
|
+
"@zerotal/queue": "1.7.5",
|
|
52
52
|
"sharp": "^0.34.0",
|
|
53
53
|
"typescript": "^5.8.0"
|
|
54
54
|
},
|