@uniformdev/assets 20.77.2-alpha.3.sha-e9420d8e77 → 20.79.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 +23 -16
- package/dist/index.d.ts +23 -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
|
@@ -386,6 +386,11 @@ interface components$1 {
|
|
|
386
386
|
_patternDataResources?: {
|
|
387
387
|
[key: string]: components$1["schemas"]["DataResourceDefinition"];
|
|
388
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Query-string opt-ins coming from a pattern resolved for this component.
|
|
391
|
+
* Means nothing for PUTs; it will be ignored
|
|
392
|
+
*/
|
|
393
|
+
_patternOptedInQueryStrings?: string[];
|
|
389
394
|
_patternError?: components$1["schemas"]["PatternError"];
|
|
390
395
|
/**
|
|
391
396
|
* Defines patch overrides to component IDs that live in the composition.
|
|
@@ -459,6 +464,11 @@ interface components$1 {
|
|
|
459
464
|
_patternDataResources?: {
|
|
460
465
|
[key: string]: components$1["schemas"]["DataResourceDefinition"];
|
|
461
466
|
};
|
|
467
|
+
/**
|
|
468
|
+
* Query-string opt-ins coming from a pattern resolved for this component.
|
|
469
|
+
* Means nothing for PUTs; it will be ignored
|
|
470
|
+
*/
|
|
471
|
+
_patternOptedInQueryStrings?: string[];
|
|
462
472
|
_dataResources?: components$1["schemas"]["DataResourceDefinitions"];
|
|
463
473
|
_patternError?: components$1["schemas"]["PatternError"];
|
|
464
474
|
/**
|
|
@@ -493,6 +503,12 @@ interface components$1 {
|
|
|
493
503
|
_overridability?: components$1["schemas"]["ComponentOverridability"];
|
|
494
504
|
/** Array of locales which have data defined on the composition. If empty, the current default locale implicitly has data */
|
|
495
505
|
_locales?: string[];
|
|
506
|
+
/**
|
|
507
|
+
* Names of opt-in global query strings surfaced in the Canvas editor for this composition or pattern.
|
|
508
|
+
* Opt-ins coming from a resolved pattern move to _patternOptedInQueryStrings, so this always
|
|
509
|
+
* holds only what was authored here. Omitted whenever overrides are resolved.
|
|
510
|
+
*/
|
|
511
|
+
_optedInQueryStrings?: string[];
|
|
496
512
|
};
|
|
497
513
|
/**
|
|
498
514
|
* Defines how to override a specific component.
|
|
@@ -960,6 +976,12 @@ interface components$1 {
|
|
|
960
976
|
value?: string;
|
|
961
977
|
/** Help text for authors who might be setting up a preview value for this query string */
|
|
962
978
|
helpText?: string;
|
|
979
|
+
/**
|
|
980
|
+
* Controls whether a global query string is always shown in Canvas or must be opted into.
|
|
981
|
+
* This property is ignored on node-level query strings. When omitted, the query string is always shown.
|
|
982
|
+
|
|
983
|
+
*/
|
|
984
|
+
editorVisibility?: "opt-in";
|
|
963
985
|
/** Configuration for providing a list of allowed values for this query string */
|
|
964
986
|
optionsSource?: {
|
|
965
987
|
/**
|
|
@@ -1933,21 +1955,6 @@ interface ImageFromApi {
|
|
|
1933
1955
|
*/
|
|
1934
1956
|
declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
|
|
1935
1957
|
|
|
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
1958
|
/**
|
|
1952
1959
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1953
1960
|
* Removes things like author, stats, etc.
|
|
@@ -1957,4 +1964,4 @@ declare function convertAssetToPutAsset(asset: {
|
|
|
1957
1964
|
projectId: string;
|
|
1958
1965
|
}): AssetUpsertRequest;
|
|
1959
1966
|
|
|
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,
|
|
1967
|
+
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
|
@@ -386,6 +386,11 @@ interface components$1 {
|
|
|
386
386
|
_patternDataResources?: {
|
|
387
387
|
[key: string]: components$1["schemas"]["DataResourceDefinition"];
|
|
388
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Query-string opt-ins coming from a pattern resolved for this component.
|
|
391
|
+
* Means nothing for PUTs; it will be ignored
|
|
392
|
+
*/
|
|
393
|
+
_patternOptedInQueryStrings?: string[];
|
|
389
394
|
_patternError?: components$1["schemas"]["PatternError"];
|
|
390
395
|
/**
|
|
391
396
|
* Defines patch overrides to component IDs that live in the composition.
|
|
@@ -459,6 +464,11 @@ interface components$1 {
|
|
|
459
464
|
_patternDataResources?: {
|
|
460
465
|
[key: string]: components$1["schemas"]["DataResourceDefinition"];
|
|
461
466
|
};
|
|
467
|
+
/**
|
|
468
|
+
* Query-string opt-ins coming from a pattern resolved for this component.
|
|
469
|
+
* Means nothing for PUTs; it will be ignored
|
|
470
|
+
*/
|
|
471
|
+
_patternOptedInQueryStrings?: string[];
|
|
462
472
|
_dataResources?: components$1["schemas"]["DataResourceDefinitions"];
|
|
463
473
|
_patternError?: components$1["schemas"]["PatternError"];
|
|
464
474
|
/**
|
|
@@ -493,6 +503,12 @@ interface components$1 {
|
|
|
493
503
|
_overridability?: components$1["schemas"]["ComponentOverridability"];
|
|
494
504
|
/** Array of locales which have data defined on the composition. If empty, the current default locale implicitly has data */
|
|
495
505
|
_locales?: string[];
|
|
506
|
+
/**
|
|
507
|
+
* Names of opt-in global query strings surfaced in the Canvas editor for this composition or pattern.
|
|
508
|
+
* Opt-ins coming from a resolved pattern move to _patternOptedInQueryStrings, so this always
|
|
509
|
+
* holds only what was authored here. Omitted whenever overrides are resolved.
|
|
510
|
+
*/
|
|
511
|
+
_optedInQueryStrings?: string[];
|
|
496
512
|
};
|
|
497
513
|
/**
|
|
498
514
|
* Defines how to override a specific component.
|
|
@@ -960,6 +976,12 @@ interface components$1 {
|
|
|
960
976
|
value?: string;
|
|
961
977
|
/** Help text for authors who might be setting up a preview value for this query string */
|
|
962
978
|
helpText?: string;
|
|
979
|
+
/**
|
|
980
|
+
* Controls whether a global query string is always shown in Canvas or must be opted into.
|
|
981
|
+
* This property is ignored on node-level query strings. When omitted, the query string is always shown.
|
|
982
|
+
|
|
983
|
+
*/
|
|
984
|
+
editorVisibility?: "opt-in";
|
|
963
985
|
/** Configuration for providing a list of allowed values for this query string */
|
|
964
986
|
optionsSource?: {
|
|
965
987
|
/**
|
|
@@ -1933,21 +1955,6 @@ interface ImageFromApi {
|
|
|
1933
1955
|
*/
|
|
1934
1956
|
declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
|
|
1935
1957
|
|
|
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
1958
|
/**
|
|
1952
1959
|
* Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
|
|
1953
1960
|
* Removes things like author, stats, etc.
|
|
@@ -1957,4 +1964,4 @@ declare function convertAssetToPutAsset(asset: {
|
|
|
1957
1964
|
projectId: string;
|
|
1958
1965
|
}): AssetUpsertRequest;
|
|
1959
1966
|
|
|
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,
|
|
1967
|
+
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.79.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.79.0",
|
|
41
|
+
"@uniformdev/files": "20.79.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"ts-xor": "^1.3.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "f419f94df6de01601261042943593cabfd739357"
|
|
47
47
|
}
|