@uniformdev/assets 20.77.2-alpha.3.sha-e9420d8e77 → 20.78.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 +1 -16
- package/dist/index.d.ts +1 -16
- package/dist/index.esm.js +8 -18
- package/dist/index.js +9 -21
- package/dist/index.mjs +8 -18
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1933,21 +1933,6 @@ interface ImageFromApi {
|
|
|
1933
1933
|
*/
|
|
1934
1934
|
declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
|
|
1935
1935
|
|
|
1936
|
-
type AssetInputFields = NonNullable<NonNullable<AssetUpsertRequest['asset']>['fields']>;
|
|
1937
|
-
/**
|
|
1938
|
-
* The asset `fields` a write carries. The API assembles `url`, `mediaType`, `size`, `width` and
|
|
1939
|
-
* `height` from the attached file on every read, and the write schema rejects those along with
|
|
1940
|
-
* `custom`, so a write can neither send nor settle them.
|
|
1941
|
-
*
|
|
1942
|
-
* The CLI's asset comparator projects onto this same list, so a push only reports a difference a
|
|
1943
|
-
* push can act on.
|
|
1944
|
-
*/
|
|
1945
|
-
declare const WRITABLE_ASSET_FIELDS: readonly ["title", "description", "file", "focalPoint"];
|
|
1946
|
-
/**
|
|
1947
|
-
* Selects the asset fields a write carries, dropping the ones the API computes from the attached
|
|
1948
|
-
* file. Returns a new object rather than editing the asset it reads.
|
|
1949
|
-
*/
|
|
1950
|
-
declare const selectWritableAssetFields: (fields?: Asset["fields"]) => AssetInputFields;
|
|
1951
1936
|
/**
|
|
1952
1937
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1953
1938
|
* Removes things like author, stats, etc.
|
|
@@ -1957,4 +1942,4 @@ declare function convertAssetToPutAsset(asset: {
|
|
|
1957
1942
|
projectId: string;
|
|
1958
1943
|
}): AssetUpsertRequest;
|
|
1959
1944
|
|
|
1960
|
-
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,
|
|
1945
|
+
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, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
|
package/dist/index.d.ts
CHANGED
|
@@ -1933,21 +1933,6 @@ interface ImageFromApi {
|
|
|
1933
1933
|
*/
|
|
1934
1934
|
declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
|
|
1935
1935
|
|
|
1936
|
-
type AssetInputFields = NonNullable<NonNullable<AssetUpsertRequest['asset']>['fields']>;
|
|
1937
|
-
/**
|
|
1938
|
-
* The asset `fields` a write carries. The API assembles `url`, `mediaType`, `size`, `width` and
|
|
1939
|
-
* `height` from the attached file on every read, and the write schema rejects those along with
|
|
1940
|
-
* `custom`, so a write can neither send nor settle them.
|
|
1941
|
-
*
|
|
1942
|
-
* The CLI's asset comparator projects onto this same list, so a push only reports a difference a
|
|
1943
|
-
* push can act on.
|
|
1944
|
-
*/
|
|
1945
|
-
declare const WRITABLE_ASSET_FIELDS: readonly ["title", "description", "file", "focalPoint"];
|
|
1946
|
-
/**
|
|
1947
|
-
* Selects the asset fields a write carries, dropping the ones the API computes from the attached
|
|
1948
|
-
* file. Returns a new object rather than editing the asset it reads.
|
|
1949
|
-
*/
|
|
1950
|
-
declare const selectWritableAssetFields: (fields?: Asset["fields"]) => AssetInputFields;
|
|
1951
1936
|
/**
|
|
1952
1937
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1953
1938
|
* Removes things like author, stats, etc.
|
|
@@ -1957,4 +1942,4 @@ declare function convertAssetToPutAsset(asset: {
|
|
|
1957
1942
|
projectId: string;
|
|
1958
1943
|
}): AssetUpsertRequest;
|
|
1959
1944
|
|
|
1960
|
-
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,
|
|
1945
|
+
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, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
|
package/dist/index.esm.js
CHANGED
|
@@ -172,21 +172,8 @@ var imageFrom = (asset) => {
|
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
// src/utils/assetConverter.ts
|
|
175
|
-
var WRITABLE_ASSET_FIELDS = [
|
|
176
|
-
"title",
|
|
177
|
-
"description",
|
|
178
|
-
"file",
|
|
179
|
-
"focalPoint"
|
|
180
|
-
];
|
|
181
|
-
var selectProperties = (source, names) => {
|
|
182
|
-
const selected = {};
|
|
183
|
-
for (const name of names) {
|
|
184
|
-
selected[name] = source[name];
|
|
185
|
-
}
|
|
186
|
-
return selected;
|
|
187
|
-
};
|
|
188
|
-
var selectWritableAssetFields = (fields = {}) => selectProperties(fields, WRITABLE_ASSET_FIELDS);
|
|
189
175
|
function convertAssetToPutAsset(asset) {
|
|
176
|
+
var _a, _b, _c, _d;
|
|
190
177
|
return {
|
|
191
178
|
asset: {
|
|
192
179
|
_id: asset.asset._id,
|
|
@@ -194,7 +181,12 @@ function convertAssetToPutAsset(asset) {
|
|
|
194
181
|
_name: asset.asset._name,
|
|
195
182
|
type: asset.asset.type,
|
|
196
183
|
labels: asset.asset.labels,
|
|
197
|
-
fields:
|
|
184
|
+
fields: {
|
|
185
|
+
title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
|
|
186
|
+
description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
|
|
187
|
+
file: (_c = asset.asset.fields) == null ? void 0 : _c.file,
|
|
188
|
+
focalPoint: (_d = asset.asset.fields) == null ? void 0 : _d.focalPoint
|
|
189
|
+
}
|
|
198
190
|
},
|
|
199
191
|
projectId: asset.projectId
|
|
200
192
|
};
|
|
@@ -202,10 +194,8 @@ function convertAssetToPutAsset(asset) {
|
|
|
202
194
|
export {
|
|
203
195
|
AssetClient,
|
|
204
196
|
UncachedAssetClient,
|
|
205
|
-
WRITABLE_ASSET_FIELDS,
|
|
206
197
|
assetDefinitions,
|
|
207
198
|
convertAssetToPutAsset,
|
|
208
199
|
getAssetDefinitionType,
|
|
209
|
-
imageFrom
|
|
210
|
-
selectWritableAssetFields
|
|
200
|
+
imageFrom
|
|
211
201
|
};
|
package/dist/index.js
CHANGED
|
@@ -22,12 +22,10 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AssetClient: () => AssetClient,
|
|
24
24
|
UncachedAssetClient: () => UncachedAssetClient,
|
|
25
|
-
WRITABLE_ASSET_FIELDS: () => WRITABLE_ASSET_FIELDS,
|
|
26
25
|
assetDefinitions: () => assetDefinitions,
|
|
27
26
|
convertAssetToPutAsset: () => convertAssetToPutAsset,
|
|
28
27
|
getAssetDefinitionType: () => getAssetDefinitionType,
|
|
29
|
-
imageFrom: () => imageFrom
|
|
30
|
-
selectWritableAssetFields: () => selectWritableAssetFields
|
|
28
|
+
imageFrom: () => imageFrom
|
|
31
29
|
});
|
|
32
30
|
module.exports = __toCommonJS(index_exports);
|
|
33
31
|
|
|
@@ -205,21 +203,8 @@ var imageFrom = (asset) => {
|
|
|
205
203
|
};
|
|
206
204
|
|
|
207
205
|
// src/utils/assetConverter.ts
|
|
208
|
-
var WRITABLE_ASSET_FIELDS = [
|
|
209
|
-
"title",
|
|
210
|
-
"description",
|
|
211
|
-
"file",
|
|
212
|
-
"focalPoint"
|
|
213
|
-
];
|
|
214
|
-
var selectProperties = (source, names) => {
|
|
215
|
-
const selected = {};
|
|
216
|
-
for (const name of names) {
|
|
217
|
-
selected[name] = source[name];
|
|
218
|
-
}
|
|
219
|
-
return selected;
|
|
220
|
-
};
|
|
221
|
-
var selectWritableAssetFields = (fields = {}) => selectProperties(fields, WRITABLE_ASSET_FIELDS);
|
|
222
206
|
function convertAssetToPutAsset(asset) {
|
|
207
|
+
var _a, _b, _c, _d;
|
|
223
208
|
return {
|
|
224
209
|
asset: {
|
|
225
210
|
_id: asset.asset._id,
|
|
@@ -227,7 +212,12 @@ function convertAssetToPutAsset(asset) {
|
|
|
227
212
|
_name: asset.asset._name,
|
|
228
213
|
type: asset.asset.type,
|
|
229
214
|
labels: asset.asset.labels,
|
|
230
|
-
fields:
|
|
215
|
+
fields: {
|
|
216
|
+
title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
|
|
217
|
+
description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
|
|
218
|
+
file: (_c = asset.asset.fields) == null ? void 0 : _c.file,
|
|
219
|
+
focalPoint: (_d = asset.asset.fields) == null ? void 0 : _d.focalPoint
|
|
220
|
+
}
|
|
231
221
|
},
|
|
232
222
|
projectId: asset.projectId
|
|
233
223
|
};
|
|
@@ -236,10 +226,8 @@ function convertAssetToPutAsset(asset) {
|
|
|
236
226
|
0 && (module.exports = {
|
|
237
227
|
AssetClient,
|
|
238
228
|
UncachedAssetClient,
|
|
239
|
-
WRITABLE_ASSET_FIELDS,
|
|
240
229
|
assetDefinitions,
|
|
241
230
|
convertAssetToPutAsset,
|
|
242
231
|
getAssetDefinitionType,
|
|
243
|
-
imageFrom
|
|
244
|
-
selectWritableAssetFields
|
|
232
|
+
imageFrom
|
|
245
233
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -172,21 +172,8 @@ var imageFrom = (asset) => {
|
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
// src/utils/assetConverter.ts
|
|
175
|
-
var WRITABLE_ASSET_FIELDS = [
|
|
176
|
-
"title",
|
|
177
|
-
"description",
|
|
178
|
-
"file",
|
|
179
|
-
"focalPoint"
|
|
180
|
-
];
|
|
181
|
-
var selectProperties = (source, names) => {
|
|
182
|
-
const selected = {};
|
|
183
|
-
for (const name of names) {
|
|
184
|
-
selected[name] = source[name];
|
|
185
|
-
}
|
|
186
|
-
return selected;
|
|
187
|
-
};
|
|
188
|
-
var selectWritableAssetFields = (fields = {}) => selectProperties(fields, WRITABLE_ASSET_FIELDS);
|
|
189
175
|
function convertAssetToPutAsset(asset) {
|
|
176
|
+
var _a, _b, _c, _d;
|
|
190
177
|
return {
|
|
191
178
|
asset: {
|
|
192
179
|
_id: asset.asset._id,
|
|
@@ -194,7 +181,12 @@ function convertAssetToPutAsset(asset) {
|
|
|
194
181
|
_name: asset.asset._name,
|
|
195
182
|
type: asset.asset.type,
|
|
196
183
|
labels: asset.asset.labels,
|
|
197
|
-
fields:
|
|
184
|
+
fields: {
|
|
185
|
+
title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
|
|
186
|
+
description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
|
|
187
|
+
file: (_c = asset.asset.fields) == null ? void 0 : _c.file,
|
|
188
|
+
focalPoint: (_d = asset.asset.fields) == null ? void 0 : _d.focalPoint
|
|
189
|
+
}
|
|
198
190
|
},
|
|
199
191
|
projectId: asset.projectId
|
|
200
192
|
};
|
|
@@ -202,10 +194,8 @@ function convertAssetToPutAsset(asset) {
|
|
|
202
194
|
export {
|
|
203
195
|
AssetClient,
|
|
204
196
|
UncachedAssetClient,
|
|
205
|
-
WRITABLE_ASSET_FIELDS,
|
|
206
197
|
assetDefinitions,
|
|
207
198
|
convertAssetToPutAsset,
|
|
208
199
|
getAssetDefinitionType,
|
|
209
|
-
imageFrom
|
|
210
|
-
selectWritableAssetFields
|
|
200
|
+
imageFrom
|
|
211
201
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/assets",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.78.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.78.0",
|
|
41
|
+
"@uniformdev/files": "20.78.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"ts-xor": "^1.3.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "22d94ee916bde5e32c96995da69cfe479f87a9c9"
|
|
47
47
|
}
|