@uniformdev/assets 20.8.2-alpha.31 → 20.9.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 +50 -13
- package/dist/index.d.ts +50 -13
- package/dist/index.esm.js +3 -2
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +6 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiClient, ClientOptions } from '@uniformdev/context/api';
|
|
2
|
+
import { XOR } from 'ts-xor';
|
|
2
3
|
|
|
3
4
|
interface components$1 {
|
|
4
5
|
schemas: {
|
|
@@ -1157,6 +1158,14 @@ interface components {
|
|
|
1157
1158
|
/** @constant */
|
|
1158
1159
|
type: "number";
|
|
1159
1160
|
};
|
|
1161
|
+
focalPoint?: {
|
|
1162
|
+
value: {
|
|
1163
|
+
x: number;
|
|
1164
|
+
y: number;
|
|
1165
|
+
};
|
|
1166
|
+
/** @constant */
|
|
1167
|
+
type: "focalPoint";
|
|
1168
|
+
};
|
|
1160
1169
|
/** @description Asset field values */
|
|
1161
1170
|
custom?: {
|
|
1162
1171
|
[key: string]: components["schemas"]["ComponentParameter"];
|
|
@@ -1192,6 +1201,14 @@ interface components {
|
|
|
1192
1201
|
/** @constant */
|
|
1193
1202
|
type: "file";
|
|
1194
1203
|
};
|
|
1204
|
+
focalPoint?: {
|
|
1205
|
+
value: {
|
|
1206
|
+
x: number;
|
|
1207
|
+
y: number;
|
|
1208
|
+
};
|
|
1209
|
+
/** @constant */
|
|
1210
|
+
type: "focalPoint";
|
|
1211
|
+
};
|
|
1195
1212
|
};
|
|
1196
1213
|
_dataResources?: components["schemas"]["DataResourceDefinitions"];
|
|
1197
1214
|
};
|
|
@@ -1497,33 +1514,31 @@ type AssetParamValueItem = {
|
|
|
1497
1514
|
};
|
|
1498
1515
|
/**
|
|
1499
1516
|
* The width of the original asset
|
|
1500
|
-
*
|
|
1501
|
-
* Should resolve to a number but might
|
|
1502
|
-
* be a string with a pointer reference
|
|
1503
1517
|
*/
|
|
1504
1518
|
width?: {
|
|
1505
1519
|
type: 'number';
|
|
1506
|
-
value: number |
|
|
1520
|
+
value: number | undefined;
|
|
1507
1521
|
};
|
|
1508
1522
|
/**
|
|
1509
1523
|
* The height of the original asset
|
|
1510
|
-
*
|
|
1511
|
-
* Should resolve to a number but might
|
|
1512
|
-
* be a string with a pointer reference
|
|
1513
1524
|
*/
|
|
1514
1525
|
height?: {
|
|
1515
1526
|
type: 'number';
|
|
1516
|
-
value: number |
|
|
1527
|
+
value: number | undefined;
|
|
1517
1528
|
};
|
|
1518
1529
|
/**
|
|
1519
1530
|
* The size in bytes of the original asset
|
|
1520
|
-
*
|
|
1521
|
-
* Should resolve to a number but might
|
|
1522
|
-
* be a string with a pointer reference
|
|
1523
1531
|
*/
|
|
1524
1532
|
size?: {
|
|
1525
1533
|
type: 'number';
|
|
1526
|
-
value: number |
|
|
1534
|
+
value: number | undefined;
|
|
1535
|
+
};
|
|
1536
|
+
focalPoint?: {
|
|
1537
|
+
type: 'focalPoint';
|
|
1538
|
+
value: {
|
|
1539
|
+
x: number;
|
|
1540
|
+
y: number;
|
|
1541
|
+
} | undefined;
|
|
1527
1542
|
};
|
|
1528
1543
|
/**
|
|
1529
1544
|
* Any key/value properties which the source
|
|
@@ -1566,10 +1581,32 @@ type AssetDefinition = {
|
|
|
1566
1581
|
};
|
|
1567
1582
|
declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
|
|
1568
1583
|
|
|
1584
|
+
type ImageDeliveryParams = XOR<{
|
|
1585
|
+
format: 'original';
|
|
1586
|
+
}, {
|
|
1587
|
+
width?: number;
|
|
1588
|
+
height?: number;
|
|
1589
|
+
/**
|
|
1590
|
+
* scale-down - resize the image to fit within the given dimensions, but never larger than the original size, while maintaining the aspect ratio
|
|
1591
|
+
* contain - resize the image to fit within the given dimensions, including possibly enlarging the image, while maintaining the aspect ratio
|
|
1592
|
+
* cover - resize the image to fully cover the given dimensions, cropping as needed
|
|
1593
|
+
*
|
|
1594
|
+
* "cover" additionally supports specifying a focal point via the "focal" parameter
|
|
1595
|
+
*/
|
|
1596
|
+
fit?: 'scale-down' | 'contain' | 'cover';
|
|
1597
|
+
}, {
|
|
1598
|
+
width?: number;
|
|
1599
|
+
height?: number;
|
|
1600
|
+
/** cover - resize the image to fully cover the given dimensions, cropping as needed */
|
|
1601
|
+
fit: 'cover';
|
|
1602
|
+
/** "string" is in format NxM - N and M are numbers between 0.00 and 1.00, N representing the x-axis and M representing the y-axis */
|
|
1603
|
+
focal: 'auto' | 'center' | string;
|
|
1604
|
+
}>;
|
|
1605
|
+
|
|
1569
1606
|
/**
|
|
1570
1607
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1571
1608
|
* Removes things like author, stats, etc.
|
|
1572
1609
|
*/
|
|
1573
1610
|
declare function convertAssetToPutAsset(asset: AssetGetResponseSingle): AssetUpsertRequest;
|
|
1574
1611
|
|
|
1575
|
-
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, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset };
|
|
1612
|
+
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, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiClient, ClientOptions } from '@uniformdev/context/api';
|
|
2
|
+
import { XOR } from 'ts-xor';
|
|
2
3
|
|
|
3
4
|
interface components$1 {
|
|
4
5
|
schemas: {
|
|
@@ -1157,6 +1158,14 @@ interface components {
|
|
|
1157
1158
|
/** @constant */
|
|
1158
1159
|
type: "number";
|
|
1159
1160
|
};
|
|
1161
|
+
focalPoint?: {
|
|
1162
|
+
value: {
|
|
1163
|
+
x: number;
|
|
1164
|
+
y: number;
|
|
1165
|
+
};
|
|
1166
|
+
/** @constant */
|
|
1167
|
+
type: "focalPoint";
|
|
1168
|
+
};
|
|
1160
1169
|
/** @description Asset field values */
|
|
1161
1170
|
custom?: {
|
|
1162
1171
|
[key: string]: components["schemas"]["ComponentParameter"];
|
|
@@ -1192,6 +1201,14 @@ interface components {
|
|
|
1192
1201
|
/** @constant */
|
|
1193
1202
|
type: "file";
|
|
1194
1203
|
};
|
|
1204
|
+
focalPoint?: {
|
|
1205
|
+
value: {
|
|
1206
|
+
x: number;
|
|
1207
|
+
y: number;
|
|
1208
|
+
};
|
|
1209
|
+
/** @constant */
|
|
1210
|
+
type: "focalPoint";
|
|
1211
|
+
};
|
|
1195
1212
|
};
|
|
1196
1213
|
_dataResources?: components["schemas"]["DataResourceDefinitions"];
|
|
1197
1214
|
};
|
|
@@ -1497,33 +1514,31 @@ type AssetParamValueItem = {
|
|
|
1497
1514
|
};
|
|
1498
1515
|
/**
|
|
1499
1516
|
* The width of the original asset
|
|
1500
|
-
*
|
|
1501
|
-
* Should resolve to a number but might
|
|
1502
|
-
* be a string with a pointer reference
|
|
1503
1517
|
*/
|
|
1504
1518
|
width?: {
|
|
1505
1519
|
type: 'number';
|
|
1506
|
-
value: number |
|
|
1520
|
+
value: number | undefined;
|
|
1507
1521
|
};
|
|
1508
1522
|
/**
|
|
1509
1523
|
* The height of the original asset
|
|
1510
|
-
*
|
|
1511
|
-
* Should resolve to a number but might
|
|
1512
|
-
* be a string with a pointer reference
|
|
1513
1524
|
*/
|
|
1514
1525
|
height?: {
|
|
1515
1526
|
type: 'number';
|
|
1516
|
-
value: number |
|
|
1527
|
+
value: number | undefined;
|
|
1517
1528
|
};
|
|
1518
1529
|
/**
|
|
1519
1530
|
* The size in bytes of the original asset
|
|
1520
|
-
*
|
|
1521
|
-
* Should resolve to a number but might
|
|
1522
|
-
* be a string with a pointer reference
|
|
1523
1531
|
*/
|
|
1524
1532
|
size?: {
|
|
1525
1533
|
type: 'number';
|
|
1526
|
-
value: number |
|
|
1534
|
+
value: number | undefined;
|
|
1535
|
+
};
|
|
1536
|
+
focalPoint?: {
|
|
1537
|
+
type: 'focalPoint';
|
|
1538
|
+
value: {
|
|
1539
|
+
x: number;
|
|
1540
|
+
y: number;
|
|
1541
|
+
} | undefined;
|
|
1527
1542
|
};
|
|
1528
1543
|
/**
|
|
1529
1544
|
* Any key/value properties which the source
|
|
@@ -1566,10 +1581,32 @@ type AssetDefinition = {
|
|
|
1566
1581
|
};
|
|
1567
1582
|
declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
|
|
1568
1583
|
|
|
1584
|
+
type ImageDeliveryParams = XOR<{
|
|
1585
|
+
format: 'original';
|
|
1586
|
+
}, {
|
|
1587
|
+
width?: number;
|
|
1588
|
+
height?: number;
|
|
1589
|
+
/**
|
|
1590
|
+
* scale-down - resize the image to fit within the given dimensions, but never larger than the original size, while maintaining the aspect ratio
|
|
1591
|
+
* contain - resize the image to fit within the given dimensions, including possibly enlarging the image, while maintaining the aspect ratio
|
|
1592
|
+
* cover - resize the image to fully cover the given dimensions, cropping as needed
|
|
1593
|
+
*
|
|
1594
|
+
* "cover" additionally supports specifying a focal point via the "focal" parameter
|
|
1595
|
+
*/
|
|
1596
|
+
fit?: 'scale-down' | 'contain' | 'cover';
|
|
1597
|
+
}, {
|
|
1598
|
+
width?: number;
|
|
1599
|
+
height?: number;
|
|
1600
|
+
/** cover - resize the image to fully cover the given dimensions, cropping as needed */
|
|
1601
|
+
fit: 'cover';
|
|
1602
|
+
/** "string" is in format NxM - N and M are numbers between 0.00 and 1.00, N representing the x-axis and M representing the y-axis */
|
|
1603
|
+
focal: 'auto' | 'center' | string;
|
|
1604
|
+
}>;
|
|
1605
|
+
|
|
1569
1606
|
/**
|
|
1570
1607
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1571
1608
|
* Removes things like author, stats, etc.
|
|
1572
1609
|
*/
|
|
1573
1610
|
declare function convertAssetToPutAsset(asset: AssetGetResponseSingle): AssetUpsertRequest;
|
|
1574
1611
|
|
|
1575
|
-
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, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset };
|
|
1612
|
+
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, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset };
|
package/dist/index.esm.js
CHANGED
|
@@ -64,7 +64,7 @@ var assetDefinitions = {
|
|
|
64
64
|
|
|
65
65
|
// src/utils/assetConverter.ts
|
|
66
66
|
function convertAssetToPutAsset(asset) {
|
|
67
|
-
var _a, _b, _c;
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
68
|
return {
|
|
69
69
|
asset: {
|
|
70
70
|
_id: asset.asset._id,
|
|
@@ -74,7 +74,8 @@ function convertAssetToPutAsset(asset) {
|
|
|
74
74
|
fields: {
|
|
75
75
|
title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
|
|
76
76
|
description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
|
|
77
|
-
file: (_c = asset.asset.fields) == null ? void 0 : _c.file
|
|
77
|
+
file: (_c = asset.asset.fields) == null ? void 0 : _c.file,
|
|
78
|
+
focalPoint: (_d = asset.asset.fields) == null ? void 0 : _d.focalPoint
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
81
|
projectId: asset.projectId
|
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ var assetDefinitions = {
|
|
|
93
93
|
|
|
94
94
|
// src/utils/assetConverter.ts
|
|
95
95
|
function convertAssetToPutAsset(asset) {
|
|
96
|
-
var _a, _b, _c;
|
|
96
|
+
var _a, _b, _c, _d;
|
|
97
97
|
return {
|
|
98
98
|
asset: {
|
|
99
99
|
_id: asset.asset._id,
|
|
@@ -103,7 +103,8 @@ function convertAssetToPutAsset(asset) {
|
|
|
103
103
|
fields: {
|
|
104
104
|
title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
|
|
105
105
|
description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
|
|
106
|
-
file: (_c = asset.asset.fields) == null ? void 0 : _c.file
|
|
106
|
+
file: (_c = asset.asset.fields) == null ? void 0 : _c.file,
|
|
107
|
+
focalPoint: (_d = asset.asset.fields) == null ? void 0 : _d.focalPoint
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
110
|
projectId: asset.projectId
|
package/dist/index.mjs
CHANGED
|
@@ -64,7 +64,7 @@ var assetDefinitions = {
|
|
|
64
64
|
|
|
65
65
|
// src/utils/assetConverter.ts
|
|
66
66
|
function convertAssetToPutAsset(asset) {
|
|
67
|
-
var _a, _b, _c;
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
68
|
return {
|
|
69
69
|
asset: {
|
|
70
70
|
_id: asset.asset._id,
|
|
@@ -74,7 +74,8 @@ function convertAssetToPutAsset(asset) {
|
|
|
74
74
|
fields: {
|
|
75
75
|
title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
|
|
76
76
|
description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
|
|
77
|
-
file: (_c = asset.asset.fields) == null ? void 0 : _c.file
|
|
77
|
+
file: (_c = asset.asset.fields) == null ? void 0 : _c.file,
|
|
78
|
+
focalPoint: (_d = asset.asset.fields) == null ? void 0 : _d.focalPoint
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
81
|
projectId: asset.projectId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/assets",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.9.0",
|
|
4
4
|
"description": "Uniform Assets",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,10 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@uniformdev/context": "20.
|
|
39
|
+
"@uniformdev/context": "20.9.0"
|
|
40
40
|
},
|
|
41
|
-
"
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"ts-xor": "^1.3.0"
|
|
43
|
+
},
|
|
44
|
+
"gitHead": "47e2e9af8e7e56d2c524c6057920fe6a9480a4a9"
|
|
42
45
|
}
|