@uniformdev/assets 20.84.0 → 20.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.esm.js +16 -4
- package/dist/index.js +11 -3
- package/dist/index.mjs +16 -4
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1907,6 +1907,9 @@ type AssetDefinition = {
|
|
|
1907
1907
|
namePlural: string;
|
|
1908
1908
|
};
|
|
1909
1909
|
declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
|
|
1910
|
+
/** The supported media types that belong to each asset definition type. */
|
|
1911
|
+
declare const assetDefinitionMimeTypes: Record<AssetDefinitionType, string[]>;
|
|
1912
|
+
/** Resolves the asset definition type for a media type. Unrecognized media types resolve to `other`. */
|
|
1910
1913
|
declare const getAssetDefinitionType: (mimeType: string) => AssetDefinitionType;
|
|
1911
1914
|
|
|
1912
1915
|
/**
|
|
@@ -1991,4 +1994,4 @@ declare function convertAssetToPutAsset(asset: {
|
|
|
1991
1994
|
projectId: string;
|
|
1992
1995
|
}): AssetUpsertRequest;
|
|
1993
1996
|
|
|
1994
|
-
export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, WRITABLE_ASSET_FIELDS, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom, selectWritableAssetFields };
|
|
1997
|
+
export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, WRITABLE_ASSET_FIELDS, assetDefinitionMimeTypes, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom, selectWritableAssetFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -1907,6 +1907,9 @@ type AssetDefinition = {
|
|
|
1907
1907
|
namePlural: string;
|
|
1908
1908
|
};
|
|
1909
1909
|
declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
|
|
1910
|
+
/** The supported media types that belong to each asset definition type. */
|
|
1911
|
+
declare const assetDefinitionMimeTypes: Record<AssetDefinitionType, string[]>;
|
|
1912
|
+
/** Resolves the asset definition type for a media type. Unrecognized media types resolve to `other`. */
|
|
1910
1913
|
declare const getAssetDefinitionType: (mimeType: string) => AssetDefinitionType;
|
|
1911
1914
|
|
|
1912
1915
|
/**
|
|
@@ -1991,4 +1994,4 @@ declare function convertAssetToPutAsset(asset: {
|
|
|
1991
1994
|
projectId: string;
|
|
1992
1995
|
}): AssetUpsertRequest;
|
|
1993
1996
|
|
|
1994
|
-
export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, WRITABLE_ASSET_FIELDS, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom, selectWritableAssetFields };
|
|
1997
|
+
export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, WRITABLE_ASSET_FIELDS, assetDefinitionMimeTypes, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom, selectWritableAssetFields };
|
package/dist/index.esm.js
CHANGED
|
@@ -64,7 +64,12 @@ var UncachedAssetClient = class extends AssetClient {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// src/definitions.ts
|
|
67
|
-
import {
|
|
67
|
+
import {
|
|
68
|
+
FILE_MIME_TYPES_AUDIO,
|
|
69
|
+
FILE_MIME_TYPES_IMAGE,
|
|
70
|
+
FILE_MIME_TYPES_OTHER,
|
|
71
|
+
FILE_MIME_TYPES_VIDEO
|
|
72
|
+
} from "@uniformdev/files";
|
|
68
73
|
var assetDefinitions = {
|
|
69
74
|
image: {
|
|
70
75
|
id: "image",
|
|
@@ -87,14 +92,20 @@ var assetDefinitions = {
|
|
|
87
92
|
namePlural: "Other Assets"
|
|
88
93
|
}
|
|
89
94
|
};
|
|
95
|
+
var assetDefinitionMimeTypes = {
|
|
96
|
+
image: FILE_MIME_TYPES_IMAGE,
|
|
97
|
+
video: FILE_MIME_TYPES_VIDEO,
|
|
98
|
+
audio: FILE_MIME_TYPES_AUDIO,
|
|
99
|
+
other: FILE_MIME_TYPES_OTHER
|
|
100
|
+
};
|
|
90
101
|
var getAssetDefinitionType = (mimeType) => {
|
|
91
|
-
if (
|
|
102
|
+
if (assetDefinitionMimeTypes.image.includes(mimeType)) {
|
|
92
103
|
return assetDefinitions.image.id;
|
|
93
104
|
}
|
|
94
|
-
if (
|
|
105
|
+
if (assetDefinitionMimeTypes.video.includes(mimeType)) {
|
|
95
106
|
return assetDefinitions.video.id;
|
|
96
107
|
}
|
|
97
|
-
if (
|
|
108
|
+
if (assetDefinitionMimeTypes.audio.includes(mimeType)) {
|
|
98
109
|
return assetDefinitions.audio.id;
|
|
99
110
|
}
|
|
100
111
|
return assetDefinitions.other.id;
|
|
@@ -203,6 +214,7 @@ export {
|
|
|
203
214
|
AssetClient,
|
|
204
215
|
UncachedAssetClient,
|
|
205
216
|
WRITABLE_ASSET_FIELDS,
|
|
217
|
+
assetDefinitionMimeTypes,
|
|
206
218
|
assetDefinitions,
|
|
207
219
|
convertAssetToPutAsset,
|
|
208
220
|
getAssetDefinitionType,
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(index_exports, {
|
|
|
23
23
|
AssetClient: () => AssetClient,
|
|
24
24
|
UncachedAssetClient: () => UncachedAssetClient,
|
|
25
25
|
WRITABLE_ASSET_FIELDS: () => WRITABLE_ASSET_FIELDS,
|
|
26
|
+
assetDefinitionMimeTypes: () => assetDefinitionMimeTypes,
|
|
26
27
|
assetDefinitions: () => assetDefinitions,
|
|
27
28
|
convertAssetToPutAsset: () => convertAssetToPutAsset,
|
|
28
29
|
getAssetDefinitionType: () => getAssetDefinitionType,
|
|
@@ -120,14 +121,20 @@ var assetDefinitions = {
|
|
|
120
121
|
namePlural: "Other Assets"
|
|
121
122
|
}
|
|
122
123
|
};
|
|
124
|
+
var assetDefinitionMimeTypes = {
|
|
125
|
+
image: import_files.FILE_MIME_TYPES_IMAGE,
|
|
126
|
+
video: import_files.FILE_MIME_TYPES_VIDEO,
|
|
127
|
+
audio: import_files.FILE_MIME_TYPES_AUDIO,
|
|
128
|
+
other: import_files.FILE_MIME_TYPES_OTHER
|
|
129
|
+
};
|
|
123
130
|
var getAssetDefinitionType = (mimeType) => {
|
|
124
|
-
if (
|
|
131
|
+
if (assetDefinitionMimeTypes.image.includes(mimeType)) {
|
|
125
132
|
return assetDefinitions.image.id;
|
|
126
133
|
}
|
|
127
|
-
if (
|
|
134
|
+
if (assetDefinitionMimeTypes.video.includes(mimeType)) {
|
|
128
135
|
return assetDefinitions.video.id;
|
|
129
136
|
}
|
|
130
|
-
if (
|
|
137
|
+
if (assetDefinitionMimeTypes.audio.includes(mimeType)) {
|
|
131
138
|
return assetDefinitions.audio.id;
|
|
132
139
|
}
|
|
133
140
|
return assetDefinitions.other.id;
|
|
@@ -237,6 +244,7 @@ function convertAssetToPutAsset(asset) {
|
|
|
237
244
|
AssetClient,
|
|
238
245
|
UncachedAssetClient,
|
|
239
246
|
WRITABLE_ASSET_FIELDS,
|
|
247
|
+
assetDefinitionMimeTypes,
|
|
240
248
|
assetDefinitions,
|
|
241
249
|
convertAssetToPutAsset,
|
|
242
250
|
getAssetDefinitionType,
|
package/dist/index.mjs
CHANGED
|
@@ -64,7 +64,12 @@ var UncachedAssetClient = class extends AssetClient {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// src/definitions.ts
|
|
67
|
-
import {
|
|
67
|
+
import {
|
|
68
|
+
FILE_MIME_TYPES_AUDIO,
|
|
69
|
+
FILE_MIME_TYPES_IMAGE,
|
|
70
|
+
FILE_MIME_TYPES_OTHER,
|
|
71
|
+
FILE_MIME_TYPES_VIDEO
|
|
72
|
+
} from "@uniformdev/files";
|
|
68
73
|
var assetDefinitions = {
|
|
69
74
|
image: {
|
|
70
75
|
id: "image",
|
|
@@ -87,14 +92,20 @@ var assetDefinitions = {
|
|
|
87
92
|
namePlural: "Other Assets"
|
|
88
93
|
}
|
|
89
94
|
};
|
|
95
|
+
var assetDefinitionMimeTypes = {
|
|
96
|
+
image: FILE_MIME_TYPES_IMAGE,
|
|
97
|
+
video: FILE_MIME_TYPES_VIDEO,
|
|
98
|
+
audio: FILE_MIME_TYPES_AUDIO,
|
|
99
|
+
other: FILE_MIME_TYPES_OTHER
|
|
100
|
+
};
|
|
90
101
|
var getAssetDefinitionType = (mimeType) => {
|
|
91
|
-
if (
|
|
102
|
+
if (assetDefinitionMimeTypes.image.includes(mimeType)) {
|
|
92
103
|
return assetDefinitions.image.id;
|
|
93
104
|
}
|
|
94
|
-
if (
|
|
105
|
+
if (assetDefinitionMimeTypes.video.includes(mimeType)) {
|
|
95
106
|
return assetDefinitions.video.id;
|
|
96
107
|
}
|
|
97
|
-
if (
|
|
108
|
+
if (assetDefinitionMimeTypes.audio.includes(mimeType)) {
|
|
98
109
|
return assetDefinitions.audio.id;
|
|
99
110
|
}
|
|
100
111
|
return assetDefinitions.other.id;
|
|
@@ -203,6 +214,7 @@ export {
|
|
|
203
214
|
AssetClient,
|
|
204
215
|
UncachedAssetClient,
|
|
205
216
|
WRITABLE_ASSET_FIELDS,
|
|
217
|
+
assetDefinitionMimeTypes,
|
|
206
218
|
assetDefinitions,
|
|
207
219
|
convertAssetToPutAsset,
|
|
208
220
|
getAssetDefinitionType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/assets",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.85.0",
|
|
4
4
|
"description": "Uniform Assets",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@uniformdev/context": "20.
|
|
41
|
-
"@uniformdev/files": "20.
|
|
40
|
+
"@uniformdev/context": "20.85.0",
|
|
41
|
+
"@uniformdev/files": "20.85.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"ts-xor": "^1.3.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "d737937b6257796c7abb91f7083103d9a8b79b37"
|
|
47
47
|
}
|