@uniformdev/assets 20.8.2-alpha.31 → 20.9.1-alpha.16

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 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: {
@@ -218,6 +219,27 @@ interface components$1 {
218
219
  * @description ID of the workflow that instances of this content type will use by default. When not set, no workflow is attached
219
220
  */
220
221
  workflowId?: string;
222
+ /** @description Configurations for previewing an entry on a consuming pattern or composition. */
223
+ previewConfigurations?: components$1["schemas"]["ContentTypePreviewConfiguration"][];
224
+ };
225
+ /** @description Defines a configuration for previewing an entry on a consuming pattern or composition. */
226
+ ContentTypePreviewConfiguration: {
227
+ /**
228
+ * @description The type of preview configuration
229
+ * @enum {string}
230
+ */
231
+ type: "pattern" | "project-map";
232
+ /** @description Display label for the preview configuration */
233
+ label: string;
234
+ /**
235
+ * Format: uuid
236
+ * @description Target preview entity ID (project map node ID or pattern ID)
237
+ */
238
+ id: string;
239
+ /** @description Optional mapping of dynamic input names to their values */
240
+ dynamicInputs?: {
241
+ [key: string]: string;
242
+ };
221
243
  };
222
244
  /** @description Defines an editable parameter on a component */
223
245
  ComponentParameter: {
@@ -1157,6 +1179,14 @@ interface components {
1157
1179
  /** @constant */
1158
1180
  type: "number";
1159
1181
  };
1182
+ focalPoint?: {
1183
+ value: {
1184
+ x: number;
1185
+ y: number;
1186
+ };
1187
+ /** @constant */
1188
+ type: "focalPoint";
1189
+ };
1160
1190
  /** @description Asset field values */
1161
1191
  custom?: {
1162
1192
  [key: string]: components["schemas"]["ComponentParameter"];
@@ -1192,6 +1222,14 @@ interface components {
1192
1222
  /** @constant */
1193
1223
  type: "file";
1194
1224
  };
1225
+ focalPoint?: {
1226
+ value: {
1227
+ x: number;
1228
+ y: number;
1229
+ };
1230
+ /** @constant */
1231
+ type: "focalPoint";
1232
+ };
1195
1233
  };
1196
1234
  _dataResources?: components["schemas"]["DataResourceDefinitions"];
1197
1235
  };
@@ -1497,33 +1535,31 @@ type AssetParamValueItem = {
1497
1535
  };
1498
1536
  /**
1499
1537
  * The width of the original asset
1500
- *
1501
- * Should resolve to a number but might
1502
- * be a string with a pointer reference
1503
1538
  */
1504
1539
  width?: {
1505
1540
  type: 'number';
1506
- value: number | string | undefined;
1541
+ value: number | undefined;
1507
1542
  };
1508
1543
  /**
1509
1544
  * The height of the original asset
1510
- *
1511
- * Should resolve to a number but might
1512
- * be a string with a pointer reference
1513
1545
  */
1514
1546
  height?: {
1515
1547
  type: 'number';
1516
- value: number | string | undefined;
1548
+ value: number | undefined;
1517
1549
  };
1518
1550
  /**
1519
1551
  * 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
1552
  */
1524
1553
  size?: {
1525
1554
  type: 'number';
1526
- value: number | string | undefined;
1555
+ value: number | undefined;
1556
+ };
1557
+ focalPoint?: {
1558
+ type: 'focalPoint';
1559
+ value: {
1560
+ x: number;
1561
+ y: number;
1562
+ } | undefined;
1527
1563
  };
1528
1564
  /**
1529
1565
  * Any key/value properties which the source
@@ -1566,10 +1602,32 @@ type AssetDefinition = {
1566
1602
  };
1567
1603
  declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
1568
1604
 
1605
+ type ImageDeliveryParams = XOR<{
1606
+ format: 'original';
1607
+ }, {
1608
+ width?: number;
1609
+ height?: number;
1610
+ /**
1611
+ * scale-down - resize the image to fit within the given dimensions, but never larger than the original size, while maintaining the aspect ratio
1612
+ * contain - resize the image to fit within the given dimensions, including possibly enlarging the image, while maintaining the aspect ratio
1613
+ * cover - resize the image to fully cover the given dimensions, cropping as needed
1614
+ *
1615
+ * "cover" additionally supports specifying a focal point via the "focal" parameter
1616
+ */
1617
+ fit?: 'scale-down' | 'contain' | 'cover';
1618
+ }, {
1619
+ width?: number;
1620
+ height?: number;
1621
+ /** cover - resize the image to fully cover the given dimensions, cropping as needed */
1622
+ fit: 'cover';
1623
+ /** "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 */
1624
+ focal: 'auto' | 'center' | string;
1625
+ }>;
1626
+
1569
1627
  /**
1570
1628
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
1571
1629
  * Removes things like author, stats, etc.
1572
1630
  */
1573
1631
  declare function convertAssetToPutAsset(asset: AssetGetResponseSingle): AssetUpsertRequest;
1574
1632
 
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 };
1633
+ 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: {
@@ -218,6 +219,27 @@ interface components$1 {
218
219
  * @description ID of the workflow that instances of this content type will use by default. When not set, no workflow is attached
219
220
  */
220
221
  workflowId?: string;
222
+ /** @description Configurations for previewing an entry on a consuming pattern or composition. */
223
+ previewConfigurations?: components$1["schemas"]["ContentTypePreviewConfiguration"][];
224
+ };
225
+ /** @description Defines a configuration for previewing an entry on a consuming pattern or composition. */
226
+ ContentTypePreviewConfiguration: {
227
+ /**
228
+ * @description The type of preview configuration
229
+ * @enum {string}
230
+ */
231
+ type: "pattern" | "project-map";
232
+ /** @description Display label for the preview configuration */
233
+ label: string;
234
+ /**
235
+ * Format: uuid
236
+ * @description Target preview entity ID (project map node ID or pattern ID)
237
+ */
238
+ id: string;
239
+ /** @description Optional mapping of dynamic input names to their values */
240
+ dynamicInputs?: {
241
+ [key: string]: string;
242
+ };
221
243
  };
222
244
  /** @description Defines an editable parameter on a component */
223
245
  ComponentParameter: {
@@ -1157,6 +1179,14 @@ interface components {
1157
1179
  /** @constant */
1158
1180
  type: "number";
1159
1181
  };
1182
+ focalPoint?: {
1183
+ value: {
1184
+ x: number;
1185
+ y: number;
1186
+ };
1187
+ /** @constant */
1188
+ type: "focalPoint";
1189
+ };
1160
1190
  /** @description Asset field values */
1161
1191
  custom?: {
1162
1192
  [key: string]: components["schemas"]["ComponentParameter"];
@@ -1192,6 +1222,14 @@ interface components {
1192
1222
  /** @constant */
1193
1223
  type: "file";
1194
1224
  };
1225
+ focalPoint?: {
1226
+ value: {
1227
+ x: number;
1228
+ y: number;
1229
+ };
1230
+ /** @constant */
1231
+ type: "focalPoint";
1232
+ };
1195
1233
  };
1196
1234
  _dataResources?: components["schemas"]["DataResourceDefinitions"];
1197
1235
  };
@@ -1497,33 +1535,31 @@ type AssetParamValueItem = {
1497
1535
  };
1498
1536
  /**
1499
1537
  * The width of the original asset
1500
- *
1501
- * Should resolve to a number but might
1502
- * be a string with a pointer reference
1503
1538
  */
1504
1539
  width?: {
1505
1540
  type: 'number';
1506
- value: number | string | undefined;
1541
+ value: number | undefined;
1507
1542
  };
1508
1543
  /**
1509
1544
  * The height of the original asset
1510
- *
1511
- * Should resolve to a number but might
1512
- * be a string with a pointer reference
1513
1545
  */
1514
1546
  height?: {
1515
1547
  type: 'number';
1516
- value: number | string | undefined;
1548
+ value: number | undefined;
1517
1549
  };
1518
1550
  /**
1519
1551
  * 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
1552
  */
1524
1553
  size?: {
1525
1554
  type: 'number';
1526
- value: number | string | undefined;
1555
+ value: number | undefined;
1556
+ };
1557
+ focalPoint?: {
1558
+ type: 'focalPoint';
1559
+ value: {
1560
+ x: number;
1561
+ y: number;
1562
+ } | undefined;
1527
1563
  };
1528
1564
  /**
1529
1565
  * Any key/value properties which the source
@@ -1566,10 +1602,32 @@ type AssetDefinition = {
1566
1602
  };
1567
1603
  declare const assetDefinitions: Record<AssetDefinitionType, AssetDefinition>;
1568
1604
 
1605
+ type ImageDeliveryParams = XOR<{
1606
+ format: 'original';
1607
+ }, {
1608
+ width?: number;
1609
+ height?: number;
1610
+ /**
1611
+ * scale-down - resize the image to fit within the given dimensions, but never larger than the original size, while maintaining the aspect ratio
1612
+ * contain - resize the image to fit within the given dimensions, including possibly enlarging the image, while maintaining the aspect ratio
1613
+ * cover - resize the image to fully cover the given dimensions, cropping as needed
1614
+ *
1615
+ * "cover" additionally supports specifying a focal point via the "focal" parameter
1616
+ */
1617
+ fit?: 'scale-down' | 'contain' | 'cover';
1618
+ }, {
1619
+ width?: number;
1620
+ height?: number;
1621
+ /** cover - resize the image to fully cover the given dimensions, cropping as needed */
1622
+ fit: 'cover';
1623
+ /** "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 */
1624
+ focal: 'auto' | 'center' | string;
1625
+ }>;
1626
+
1569
1627
  /**
1570
1628
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
1571
1629
  * Removes things like author, stats, etc.
1572
1630
  */
1573
1631
  declare function convertAssetToPutAsset(asset: AssetGetResponseSingle): AssetUpsertRequest;
1574
1632
 
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 };
1633
+ 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.8.2-alpha.31+dc19eea5f9",
3
+ "version": "20.9.1-alpha.16+5d93781920",
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.8.2-alpha.31+dc19eea5f9"
39
+ "@uniformdev/context": "20.9.1-alpha.16+5d93781920"
40
40
  },
41
- "gitHead": "dc19eea5f979ff3b4526db1dd75a2e1e0f4f43f7"
41
+ "devDependencies": {
42
+ "ts-xor": "^1.3.0"
43
+ },
44
+ "gitHead": "5d937819205e0fe171a5b51f2e204cddc910cbf3"
42
45
  }