@uniformdev/assets 20.63.0 → 20.63.1-alpha.17
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 +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.esm.js +14 -0
- package/dist/index.js +15 -0
- package/dist/index.mjs +14 -0
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -969,12 +969,20 @@ interface paths {
|
|
|
969
969
|
* This is a list query parameter, and cannot be used with any primary query parameters
|
|
970
970
|
* */
|
|
971
971
|
keyword?: components["parameters"]["keyword"];
|
|
972
|
+
/**
|
|
973
|
+
* @deprecated
|
|
974
|
+
* @description BETA: Semantic search using vector similarity to find assets by meaning.
|
|
975
|
+
* Use this for "images of mountains" style queries.
|
|
976
|
+
* Requires AI credits.
|
|
977
|
+
*
|
|
978
|
+
*/
|
|
979
|
+
searchSemantic?: components["parameters"]["searchSemantic"];
|
|
972
980
|
/** @description Max number of records to return */
|
|
973
981
|
limit?: components["parameters"]["limit"];
|
|
974
982
|
/** @description Number of records to skip */
|
|
975
983
|
offset?: components["parameters"]["offset"];
|
|
976
984
|
/** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
|
|
977
|
-
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
|
|
985
|
+
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC, relevance_DESC (when searching).
|
|
978
986
|
* */
|
|
979
987
|
orderBy?: components["parameters"]["orderBy"];
|
|
980
988
|
/**
|
|
@@ -1547,8 +1555,16 @@ interface components {
|
|
|
1547
1555
|
* This is a list query parameter, and cannot be used with any primary query parameters
|
|
1548
1556
|
* */
|
|
1549
1557
|
keyword: string;
|
|
1558
|
+
/**
|
|
1559
|
+
* @deprecated
|
|
1560
|
+
* @description BETA: Semantic search using vector similarity to find assets by meaning.
|
|
1561
|
+
* Use this for "images of mountains" style queries.
|
|
1562
|
+
* Requires AI credits.
|
|
1563
|
+
*
|
|
1564
|
+
*/
|
|
1565
|
+
searchSemantic: string;
|
|
1550
1566
|
/** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
|
|
1551
|
-
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
|
|
1567
|
+
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC, relevance_DESC (when searching).
|
|
1552
1568
|
* */
|
|
1553
1569
|
orderBy: string[];
|
|
1554
1570
|
/**
|
|
@@ -1706,6 +1722,7 @@ type AssetDefinition = {
|
|
|
1706
1722
|
namePlural: string;
|
|
1707
1723
|
};
|
|
1708
1724
|
declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
|
|
1725
|
+
declare const getAssetDefinitionType: (mimeType: string) => AssetDefinitionType;
|
|
1709
1726
|
|
|
1710
1727
|
/**
|
|
1711
1728
|
* A union type of possible query parameters for the image delivery API.
|
|
@@ -1763,6 +1780,9 @@ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
|
|
|
1763
1780
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1764
1781
|
* Removes things like author, stats, etc.
|
|
1765
1782
|
*/
|
|
1766
|
-
declare function convertAssetToPutAsset(asset:
|
|
1783
|
+
declare function convertAssetToPutAsset(asset: {
|
|
1784
|
+
asset: Pick<AssetGetResponseSingle['asset'], '_id' | '_dataResources' | '_name' | 'type' | 'labels' | 'fields'>;
|
|
1785
|
+
projectId: string;
|
|
1786
|
+
}): AssetUpsertRequest;
|
|
1767
1787
|
|
|
1768
|
-
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 ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, imageFrom };
|
|
1788
|
+
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 ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
|
package/dist/index.d.ts
CHANGED
|
@@ -969,12 +969,20 @@ interface paths {
|
|
|
969
969
|
* This is a list query parameter, and cannot be used with any primary query parameters
|
|
970
970
|
* */
|
|
971
971
|
keyword?: components["parameters"]["keyword"];
|
|
972
|
+
/**
|
|
973
|
+
* @deprecated
|
|
974
|
+
* @description BETA: Semantic search using vector similarity to find assets by meaning.
|
|
975
|
+
* Use this for "images of mountains" style queries.
|
|
976
|
+
* Requires AI credits.
|
|
977
|
+
*
|
|
978
|
+
*/
|
|
979
|
+
searchSemantic?: components["parameters"]["searchSemantic"];
|
|
972
980
|
/** @description Max number of records to return */
|
|
973
981
|
limit?: components["parameters"]["limit"];
|
|
974
982
|
/** @description Number of records to skip */
|
|
975
983
|
offset?: components["parameters"]["offset"];
|
|
976
984
|
/** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
|
|
977
|
-
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
|
|
985
|
+
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC, relevance_DESC (when searching).
|
|
978
986
|
* */
|
|
979
987
|
orderBy?: components["parameters"]["orderBy"];
|
|
980
988
|
/**
|
|
@@ -1547,8 +1555,16 @@ interface components {
|
|
|
1547
1555
|
* This is a list query parameter, and cannot be used with any primary query parameters
|
|
1548
1556
|
* */
|
|
1549
1557
|
keyword: string;
|
|
1558
|
+
/**
|
|
1559
|
+
* @deprecated
|
|
1560
|
+
* @description BETA: Semantic search using vector similarity to find assets by meaning.
|
|
1561
|
+
* Use this for "images of mountains" style queries.
|
|
1562
|
+
* Requires AI credits.
|
|
1563
|
+
*
|
|
1564
|
+
*/
|
|
1565
|
+
searchSemantic: string;
|
|
1550
1566
|
/** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
|
|
1551
|
-
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
|
|
1567
|
+
* Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC, relevance_DESC (when searching).
|
|
1552
1568
|
* */
|
|
1553
1569
|
orderBy: string[];
|
|
1554
1570
|
/**
|
|
@@ -1706,6 +1722,7 @@ type AssetDefinition = {
|
|
|
1706
1722
|
namePlural: string;
|
|
1707
1723
|
};
|
|
1708
1724
|
declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
|
|
1725
|
+
declare const getAssetDefinitionType: (mimeType: string) => AssetDefinitionType;
|
|
1709
1726
|
|
|
1710
1727
|
/**
|
|
1711
1728
|
* A union type of possible query parameters for the image delivery API.
|
|
@@ -1763,6 +1780,9 @@ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
|
|
|
1763
1780
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1764
1781
|
* Removes things like author, stats, etc.
|
|
1765
1782
|
*/
|
|
1766
|
-
declare function convertAssetToPutAsset(asset:
|
|
1783
|
+
declare function convertAssetToPutAsset(asset: {
|
|
1784
|
+
asset: Pick<AssetGetResponseSingle['asset'], '_id' | '_dataResources' | '_name' | 'type' | 'labels' | 'fields'>;
|
|
1785
|
+
projectId: string;
|
|
1786
|
+
}): AssetUpsertRequest;
|
|
1767
1787
|
|
|
1768
|
-
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 ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, imageFrom };
|
|
1788
|
+
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 ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
|
package/dist/index.esm.js
CHANGED
|
@@ -42,6 +42,7 @@ var UncachedAssetClient = class extends AssetClient {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
// src/definitions.ts
|
|
45
|
+
import { FILE_MIME_TYPES_AUDIO, FILE_MIME_TYPES_IMAGE, FILE_MIME_TYPES_VIDEO } from "@uniformdev/files";
|
|
45
46
|
var assetDefinitions = {
|
|
46
47
|
image: {
|
|
47
48
|
id: "image",
|
|
@@ -64,6 +65,18 @@ var assetDefinitions = {
|
|
|
64
65
|
namePlural: "Other Assets"
|
|
65
66
|
}
|
|
66
67
|
};
|
|
68
|
+
var getAssetDefinitionType = (mimeType) => {
|
|
69
|
+
if (FILE_MIME_TYPES_IMAGE.includes(mimeType)) {
|
|
70
|
+
return assetDefinitions.image.id;
|
|
71
|
+
}
|
|
72
|
+
if (FILE_MIME_TYPES_VIDEO.includes(mimeType)) {
|
|
73
|
+
return assetDefinitions.video.id;
|
|
74
|
+
}
|
|
75
|
+
if (FILE_MIME_TYPES_AUDIO.includes(mimeType)) {
|
|
76
|
+
return assetDefinitions.audio.id;
|
|
77
|
+
}
|
|
78
|
+
return assetDefinitions.other.id;
|
|
79
|
+
};
|
|
67
80
|
|
|
68
81
|
// src/imageDelivery.ts
|
|
69
82
|
var isUniformImageUrl = (imageUrl) => {
|
|
@@ -161,5 +174,6 @@ export {
|
|
|
161
174
|
UncachedAssetClient,
|
|
162
175
|
assetDefinitions,
|
|
163
176
|
convertAssetToPutAsset,
|
|
177
|
+
getAssetDefinitionType,
|
|
164
178
|
imageFrom
|
|
165
179
|
};
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(src_exports, {
|
|
|
24
24
|
UncachedAssetClient: () => UncachedAssetClient,
|
|
25
25
|
assetDefinitions: () => assetDefinitions,
|
|
26
26
|
convertAssetToPutAsset: () => convertAssetToPutAsset,
|
|
27
|
+
getAssetDefinitionType: () => getAssetDefinitionType,
|
|
27
28
|
imageFrom: () => imageFrom
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -72,6 +73,7 @@ var UncachedAssetClient = class extends AssetClient {
|
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
// src/definitions.ts
|
|
76
|
+
var import_files = require("@uniformdev/files");
|
|
75
77
|
var assetDefinitions = {
|
|
76
78
|
image: {
|
|
77
79
|
id: "image",
|
|
@@ -94,6 +96,18 @@ var assetDefinitions = {
|
|
|
94
96
|
namePlural: "Other Assets"
|
|
95
97
|
}
|
|
96
98
|
};
|
|
99
|
+
var getAssetDefinitionType = (mimeType) => {
|
|
100
|
+
if (import_files.FILE_MIME_TYPES_IMAGE.includes(mimeType)) {
|
|
101
|
+
return assetDefinitions.image.id;
|
|
102
|
+
}
|
|
103
|
+
if (import_files.FILE_MIME_TYPES_VIDEO.includes(mimeType)) {
|
|
104
|
+
return assetDefinitions.video.id;
|
|
105
|
+
}
|
|
106
|
+
if (import_files.FILE_MIME_TYPES_AUDIO.includes(mimeType)) {
|
|
107
|
+
return assetDefinitions.audio.id;
|
|
108
|
+
}
|
|
109
|
+
return assetDefinitions.other.id;
|
|
110
|
+
};
|
|
97
111
|
|
|
98
112
|
// src/imageDelivery.ts
|
|
99
113
|
var isUniformImageUrl = (imageUrl) => {
|
|
@@ -192,5 +206,6 @@ function convertAssetToPutAsset(asset) {
|
|
|
192
206
|
UncachedAssetClient,
|
|
193
207
|
assetDefinitions,
|
|
194
208
|
convertAssetToPutAsset,
|
|
209
|
+
getAssetDefinitionType,
|
|
195
210
|
imageFrom
|
|
196
211
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -42,6 +42,7 @@ var UncachedAssetClient = class extends AssetClient {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
// src/definitions.ts
|
|
45
|
+
import { FILE_MIME_TYPES_AUDIO, FILE_MIME_TYPES_IMAGE, FILE_MIME_TYPES_VIDEO } from "@uniformdev/files";
|
|
45
46
|
var assetDefinitions = {
|
|
46
47
|
image: {
|
|
47
48
|
id: "image",
|
|
@@ -64,6 +65,18 @@ var assetDefinitions = {
|
|
|
64
65
|
namePlural: "Other Assets"
|
|
65
66
|
}
|
|
66
67
|
};
|
|
68
|
+
var getAssetDefinitionType = (mimeType) => {
|
|
69
|
+
if (FILE_MIME_TYPES_IMAGE.includes(mimeType)) {
|
|
70
|
+
return assetDefinitions.image.id;
|
|
71
|
+
}
|
|
72
|
+
if (FILE_MIME_TYPES_VIDEO.includes(mimeType)) {
|
|
73
|
+
return assetDefinitions.video.id;
|
|
74
|
+
}
|
|
75
|
+
if (FILE_MIME_TYPES_AUDIO.includes(mimeType)) {
|
|
76
|
+
return assetDefinitions.audio.id;
|
|
77
|
+
}
|
|
78
|
+
return assetDefinitions.other.id;
|
|
79
|
+
};
|
|
67
80
|
|
|
68
81
|
// src/imageDelivery.ts
|
|
69
82
|
var isUniformImageUrl = (imageUrl) => {
|
|
@@ -161,5 +174,6 @@ export {
|
|
|
161
174
|
UncachedAssetClient,
|
|
162
175
|
assetDefinitions,
|
|
163
176
|
convertAssetToPutAsset,
|
|
177
|
+
getAssetDefinitionType,
|
|
164
178
|
imageFrom
|
|
165
179
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/assets",
|
|
3
|
-
"version": "20.63.
|
|
3
|
+
"version": "20.63.1-alpha.17+cd7eca3818",
|
|
4
4
|
"description": "Uniform Assets",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@uniformdev/context": "20.63.
|
|
38
|
+
"@uniformdev/context": "20.63.1-alpha.17+cd7eca3818",
|
|
39
|
+
"@uniformdev/files": "20.63.1-alpha.17+cd7eca3818"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"ts-xor": "^1.3.0"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "cd7eca38189533a6ba5899bf872b72e1331c4aa3"
|
|
44
45
|
}
|