@routevn/creator-model 1.3.7 → 1.4.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/package.json +1 -1
- package/src/model.js +320 -19
package/package.json
CHANGED
package/src/model.js
CHANGED
|
@@ -249,7 +249,7 @@ const LAYOUT_ELEMENT_BASE_TYPES = [
|
|
|
249
249
|
"container-ref-confirm-dialog-ok",
|
|
250
250
|
"container-ref-confirm-dialog-cancel",
|
|
251
251
|
];
|
|
252
|
-
export const SCHEMA_VERSION =
|
|
252
|
+
export const SCHEMA_VERSION = 4;
|
|
253
253
|
const LAYOUT_CONTAINER_ELEMENT_TYPES = [
|
|
254
254
|
"folder",
|
|
255
255
|
"container",
|
|
@@ -2313,6 +2313,9 @@ const validateTransformItems = ({ items, path, errorFactory }) => {
|
|
|
2313
2313
|
"anchorX",
|
|
2314
2314
|
"anchorY",
|
|
2315
2315
|
"rotation",
|
|
2316
|
+
"thumbnailFileId",
|
|
2317
|
+
"previewFileId",
|
|
2318
|
+
"preview",
|
|
2316
2319
|
],
|
|
2317
2320
|
path: itemPath,
|
|
2318
2321
|
errorFactory,
|
|
@@ -2351,6 +2354,27 @@ const validateTransformItems = ({ items, path, errorFactory }) => {
|
|
|
2351
2354
|
}
|
|
2352
2355
|
|
|
2353
2356
|
if (item.type === "transform") {
|
|
2357
|
+
for (const fieldName of ["thumbnailFileId", "previewFileId"]) {
|
|
2358
|
+
const fileId = item[fieldName];
|
|
2359
|
+
if (fileId !== undefined && !isNonEmptyString(fileId)) {
|
|
2360
|
+
return invalidFromErrorFactory(
|
|
2361
|
+
errorFactory,
|
|
2362
|
+
`${itemPath}.${fieldName} must be a non-empty string when provided`,
|
|
2363
|
+
);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
{
|
|
2368
|
+
const result = validateTransformPreviewObject({
|
|
2369
|
+
value: item.preview,
|
|
2370
|
+
path: `${itemPath}.preview`,
|
|
2371
|
+
errorFactory,
|
|
2372
|
+
});
|
|
2373
|
+
if (result?.valid === false) {
|
|
2374
|
+
return result;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2354
2378
|
{
|
|
2355
2379
|
const result = validateOptionalUniqueIdArray({
|
|
2356
2380
|
value: item.tagIds,
|
|
@@ -2646,15 +2670,13 @@ const validateVariableEnumMetadata = ({
|
|
|
2646
2670
|
const validateVariableItems = ({ items, path, errorFactory }) => {
|
|
2647
2671
|
for (const [itemId, item] of Object.entries(items)) {
|
|
2648
2672
|
const itemPath = `${path}.${itemId}`;
|
|
2649
|
-
const
|
|
2673
|
+
const itemType = item?.type;
|
|
2674
|
+
const variableType = item?.variableType;
|
|
2650
2675
|
|
|
2651
|
-
if (
|
|
2652
|
-
variableType !== "folder" &&
|
|
2653
|
-
!VARIABLE_TYPE_KEYS.includes(variableType)
|
|
2654
|
-
) {
|
|
2676
|
+
if (itemType !== "folder" && itemType !== "variable") {
|
|
2655
2677
|
return invalidFromErrorFactory(
|
|
2656
2678
|
errorFactory,
|
|
2657
|
-
`${itemPath}.type must be 'folder'
|
|
2679
|
+
`${itemPath}.type must be 'folder' or 'variable'`,
|
|
2658
2680
|
);
|
|
2659
2681
|
}
|
|
2660
2682
|
|
|
@@ -2662,11 +2684,12 @@ const validateVariableItems = ({ items, path, errorFactory }) => {
|
|
|
2662
2684
|
const result = validateAllowedKeys({
|
|
2663
2685
|
value: item,
|
|
2664
2686
|
allowedKeys:
|
|
2665
|
-
|
|
2687
|
+
itemType === "folder"
|
|
2666
2688
|
? ["id", "type", "name", "description"]
|
|
2667
2689
|
: [
|
|
2668
2690
|
"id",
|
|
2669
2691
|
"type",
|
|
2692
|
+
"variableType",
|
|
2670
2693
|
"name",
|
|
2671
2694
|
"description",
|
|
2672
2695
|
"tagIds",
|
|
@@ -2712,7 +2735,14 @@ const validateVariableItems = ({ items, path, errorFactory }) => {
|
|
|
2712
2735
|
);
|
|
2713
2736
|
}
|
|
2714
2737
|
|
|
2715
|
-
if (
|
|
2738
|
+
if (itemType === "variable") {
|
|
2739
|
+
if (!VARIABLE_TYPE_KEYS.includes(variableType)) {
|
|
2740
|
+
return invalidFromErrorFactory(
|
|
2741
|
+
errorFactory,
|
|
2742
|
+
`${itemPath}.variableType must be 'string', 'number', or 'boolean'`,
|
|
2743
|
+
);
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2716
2746
|
{
|
|
2717
2747
|
const result = validateOptionalUniqueIdArray({
|
|
2718
2748
|
value: item.tagIds,
|
|
@@ -4398,7 +4428,7 @@ const applyVariableEnumMetadata = ({ item, data }) => {
|
|
|
4398
4428
|
}
|
|
4399
4429
|
|
|
4400
4430
|
const enumEnabled =
|
|
4401
|
-
item.
|
|
4431
|
+
item.variableType === "string" &&
|
|
4402
4432
|
data.isEnum !== false &&
|
|
4403
4433
|
(data.isEnum === true ||
|
|
4404
4434
|
data.enumValues !== undefined ||
|
|
@@ -4714,6 +4744,78 @@ const validatePreviewObject = ({ value, path, errorFactory }) => {
|
|
|
4714
4744
|
return VALID_RESULT;
|
|
4715
4745
|
};
|
|
4716
4746
|
|
|
4747
|
+
const validateTransformPreviewSlot = ({ value, path, errorFactory }) => {
|
|
4748
|
+
if (value === undefined) {
|
|
4749
|
+
return VALID_RESULT;
|
|
4750
|
+
}
|
|
4751
|
+
|
|
4752
|
+
if (!isPlainObject(value)) {
|
|
4753
|
+
return invalidFromErrorFactory(
|
|
4754
|
+
errorFactory,
|
|
4755
|
+
`${path} must be an object when provided`,
|
|
4756
|
+
);
|
|
4757
|
+
}
|
|
4758
|
+
|
|
4759
|
+
{
|
|
4760
|
+
const result = validateAllowedKeys({
|
|
4761
|
+
value,
|
|
4762
|
+
allowedKeys: ["imageId"],
|
|
4763
|
+
path,
|
|
4764
|
+
errorFactory,
|
|
4765
|
+
});
|
|
4766
|
+
if (result?.valid === false) {
|
|
4767
|
+
return result;
|
|
4768
|
+
}
|
|
4769
|
+
}
|
|
4770
|
+
|
|
4771
|
+
if (value.imageId !== undefined && !isNonEmptyString(value.imageId)) {
|
|
4772
|
+
return invalidFromErrorFactory(
|
|
4773
|
+
errorFactory,
|
|
4774
|
+
`${path}.imageId must be a non-empty string when provided`,
|
|
4775
|
+
);
|
|
4776
|
+
}
|
|
4777
|
+
|
|
4778
|
+
return VALID_RESULT;
|
|
4779
|
+
};
|
|
4780
|
+
|
|
4781
|
+
const validateTransformPreviewObject = ({ value, path, errorFactory }) => {
|
|
4782
|
+
if (value === undefined) {
|
|
4783
|
+
return VALID_RESULT;
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4786
|
+
if (!isPlainObject(value)) {
|
|
4787
|
+
return invalidFromErrorFactory(
|
|
4788
|
+
errorFactory,
|
|
4789
|
+
`${path} must be an object when provided`,
|
|
4790
|
+
);
|
|
4791
|
+
}
|
|
4792
|
+
|
|
4793
|
+
{
|
|
4794
|
+
const result = validateAllowedKeys({
|
|
4795
|
+
value,
|
|
4796
|
+
allowedKeys: ["background", "target"],
|
|
4797
|
+
path,
|
|
4798
|
+
errorFactory,
|
|
4799
|
+
});
|
|
4800
|
+
if (result?.valid === false) {
|
|
4801
|
+
return result;
|
|
4802
|
+
}
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4805
|
+
for (const key of ["background", "target"]) {
|
|
4806
|
+
const result = validateTransformPreviewSlot({
|
|
4807
|
+
value: value[key],
|
|
4808
|
+
path: `${path}.${key}`,
|
|
4809
|
+
errorFactory,
|
|
4810
|
+
});
|
|
4811
|
+
if (result?.valid === false) {
|
|
4812
|
+
return result;
|
|
4813
|
+
}
|
|
4814
|
+
}
|
|
4815
|
+
|
|
4816
|
+
return VALID_RESULT;
|
|
4817
|
+
};
|
|
4818
|
+
|
|
4717
4819
|
const validateLayoutItems = ({ items, path, errorFactory }) => {
|
|
4718
4820
|
for (const [itemId, item] of Object.entries(items)) {
|
|
4719
4821
|
const itemPath = `${path}.${itemId}`;
|
|
@@ -5892,6 +5994,38 @@ const validateAnimationMaskImageReferences = ({
|
|
|
5892
5994
|
return VALID_RESULT;
|
|
5893
5995
|
};
|
|
5894
5996
|
|
|
5997
|
+
const validateTransformPreviewImageReferences = ({
|
|
5998
|
+
state,
|
|
5999
|
+
preview,
|
|
6000
|
+
path,
|
|
6001
|
+
details = {},
|
|
6002
|
+
errorFactory = createPreconditionValidationError,
|
|
6003
|
+
}) => {
|
|
6004
|
+
if (!isPlainObject(preview)) {
|
|
6005
|
+
return VALID_RESULT;
|
|
6006
|
+
}
|
|
6007
|
+
|
|
6008
|
+
for (const slotKey of ["background", "target"]) {
|
|
6009
|
+
const imageId = preview[slotKey]?.imageId;
|
|
6010
|
+
const result = validateImageReference({
|
|
6011
|
+
state,
|
|
6012
|
+
imageId,
|
|
6013
|
+
path: `${path}.${slotKey}.imageId`,
|
|
6014
|
+
details: {
|
|
6015
|
+
...details,
|
|
6016
|
+
slot: slotKey,
|
|
6017
|
+
imageId,
|
|
6018
|
+
},
|
|
6019
|
+
errorFactory,
|
|
6020
|
+
});
|
|
6021
|
+
if (!result.valid) {
|
|
6022
|
+
return result;
|
|
6023
|
+
}
|
|
6024
|
+
}
|
|
6025
|
+
|
|
6026
|
+
return VALID_RESULT;
|
|
6027
|
+
};
|
|
6028
|
+
|
|
5895
6029
|
export const assertInvariants = ({ state }) => {
|
|
5896
6030
|
if (!isPlainObject(state)) {
|
|
5897
6031
|
return invalidInvariant("state must be an object");
|
|
@@ -6401,6 +6535,42 @@ export const assertInvariants = ({ state }) => {
|
|
|
6401
6535
|
continue;
|
|
6402
6536
|
}
|
|
6403
6537
|
|
|
6538
|
+
for (const fieldName of ["thumbnailFileId", "previewFileId"]) {
|
|
6539
|
+
const fileId = transform[fieldName];
|
|
6540
|
+
if (fileId === undefined) {
|
|
6541
|
+
continue;
|
|
6542
|
+
}
|
|
6543
|
+
|
|
6544
|
+
const fileResult = validateFileReference({
|
|
6545
|
+
state,
|
|
6546
|
+
fileId,
|
|
6547
|
+
path: `transform.${fieldName}`,
|
|
6548
|
+
details: {
|
|
6549
|
+
transformId,
|
|
6550
|
+
[fieldName]: fileId,
|
|
6551
|
+
},
|
|
6552
|
+
errorFactory: createInvariantValidationError,
|
|
6553
|
+
});
|
|
6554
|
+
if (!fileResult.valid) {
|
|
6555
|
+
return fileResult;
|
|
6556
|
+
}
|
|
6557
|
+
}
|
|
6558
|
+
|
|
6559
|
+
{
|
|
6560
|
+
const previewResult = validateTransformPreviewImageReferences({
|
|
6561
|
+
state,
|
|
6562
|
+
preview: transform.preview,
|
|
6563
|
+
path: "transform.preview",
|
|
6564
|
+
details: {
|
|
6565
|
+
transformId,
|
|
6566
|
+
},
|
|
6567
|
+
errorFactory: createInvariantValidationError,
|
|
6568
|
+
});
|
|
6569
|
+
if (!previewResult.valid) {
|
|
6570
|
+
return previewResult;
|
|
6571
|
+
}
|
|
6572
|
+
}
|
|
6573
|
+
|
|
6404
6574
|
{
|
|
6405
6575
|
const result = validateTagIdsAgainstScope({
|
|
6406
6576
|
state,
|
|
@@ -8973,6 +9143,9 @@ const validateTransformCreateData = ({ data, errorFactory }) => {
|
|
|
8973
9143
|
"anchorX",
|
|
8974
9144
|
"anchorY",
|
|
8975
9145
|
"rotation",
|
|
9146
|
+
"thumbnailFileId",
|
|
9147
|
+
"previewFileId",
|
|
9148
|
+
"preview",
|
|
8976
9149
|
],
|
|
8977
9150
|
path: "payload.data",
|
|
8978
9151
|
errorFactory,
|
|
@@ -8997,6 +9170,27 @@ const validateTransformCreateData = ({ data, errorFactory }) => {
|
|
|
8997
9170
|
}
|
|
8998
9171
|
|
|
8999
9172
|
if (data.type === "transform") {
|
|
9173
|
+
for (const fieldName of ["thumbnailFileId", "previewFileId"]) {
|
|
9174
|
+
const fileId = data[fieldName];
|
|
9175
|
+
if (fileId !== undefined && !isNonEmptyString(fileId)) {
|
|
9176
|
+
return invalidFromErrorFactory(
|
|
9177
|
+
errorFactory,
|
|
9178
|
+
`payload.data.${fieldName} must be a non-empty string when provided`,
|
|
9179
|
+
);
|
|
9180
|
+
}
|
|
9181
|
+
}
|
|
9182
|
+
|
|
9183
|
+
{
|
|
9184
|
+
const result = validateTransformPreviewObject({
|
|
9185
|
+
value: data.preview,
|
|
9186
|
+
path: "payload.data.preview",
|
|
9187
|
+
errorFactory,
|
|
9188
|
+
});
|
|
9189
|
+
if (result?.valid === false) {
|
|
9190
|
+
return result;
|
|
9191
|
+
}
|
|
9192
|
+
}
|
|
9193
|
+
|
|
9000
9194
|
{
|
|
9001
9195
|
const result = validateOptionalUniqueIdArray({
|
|
9002
9196
|
value: data.tagIds,
|
|
@@ -9267,6 +9461,9 @@ const validateTransformUpdateData = ({ data, errorFactory }) => {
|
|
|
9267
9461
|
"anchorX",
|
|
9268
9462
|
"anchorY",
|
|
9269
9463
|
"rotation",
|
|
9464
|
+
"thumbnailFileId",
|
|
9465
|
+
"previewFileId",
|
|
9466
|
+
"preview",
|
|
9270
9467
|
],
|
|
9271
9468
|
path: "payload.data",
|
|
9272
9469
|
errorFactory,
|
|
@@ -9297,6 +9494,27 @@ const validateTransformUpdateData = ({ data, errorFactory }) => {
|
|
|
9297
9494
|
);
|
|
9298
9495
|
}
|
|
9299
9496
|
|
|
9497
|
+
for (const fieldName of ["thumbnailFileId", "previewFileId"]) {
|
|
9498
|
+
const fileId = data[fieldName];
|
|
9499
|
+
if (fileId !== undefined && !isNonEmptyString(fileId)) {
|
|
9500
|
+
return invalidFromErrorFactory(
|
|
9501
|
+
errorFactory,
|
|
9502
|
+
`payload.data.${fieldName} must be a non-empty string when provided`,
|
|
9503
|
+
);
|
|
9504
|
+
}
|
|
9505
|
+
}
|
|
9506
|
+
|
|
9507
|
+
{
|
|
9508
|
+
const result = validateTransformPreviewObject({
|
|
9509
|
+
value: data.preview,
|
|
9510
|
+
path: "payload.data.preview",
|
|
9511
|
+
errorFactory,
|
|
9512
|
+
});
|
|
9513
|
+
if (result?.valid === false) {
|
|
9514
|
+
return result;
|
|
9515
|
+
}
|
|
9516
|
+
}
|
|
9517
|
+
|
|
9300
9518
|
{
|
|
9301
9519
|
const result = validateOptionalUniqueIdArray({
|
|
9302
9520
|
value: data.tagIds,
|
|
@@ -9334,10 +9552,10 @@ const validateVariableCreateData = ({ data, errorFactory }) => {
|
|
|
9334
9552
|
);
|
|
9335
9553
|
}
|
|
9336
9554
|
|
|
9337
|
-
if (data.type !== "folder" &&
|
|
9555
|
+
if (data.type !== "folder" && data.type !== "variable") {
|
|
9338
9556
|
return invalidFromErrorFactory(
|
|
9339
9557
|
errorFactory,
|
|
9340
|
-
"payload.data.type must be 'folder'
|
|
9558
|
+
"payload.data.type must be 'folder' or 'variable'",
|
|
9341
9559
|
);
|
|
9342
9560
|
}
|
|
9343
9561
|
|
|
@@ -9349,6 +9567,7 @@ const validateVariableCreateData = ({ data, errorFactory }) => {
|
|
|
9349
9567
|
? ["type", "name", "description"]
|
|
9350
9568
|
: [
|
|
9351
9569
|
"type",
|
|
9570
|
+
"variableType",
|
|
9352
9571
|
"name",
|
|
9353
9572
|
"description",
|
|
9354
9573
|
"tagIds",
|
|
@@ -9380,7 +9599,14 @@ const validateVariableCreateData = ({ data, errorFactory }) => {
|
|
|
9380
9599
|
);
|
|
9381
9600
|
}
|
|
9382
9601
|
|
|
9383
|
-
if (data.type
|
|
9602
|
+
if (data.type === "variable") {
|
|
9603
|
+
if (!VARIABLE_TYPE_KEYS.includes(data.variableType)) {
|
|
9604
|
+
return invalidFromErrorFactory(
|
|
9605
|
+
errorFactory,
|
|
9606
|
+
"payload.data.variableType must be 'string', 'number', or 'boolean'",
|
|
9607
|
+
);
|
|
9608
|
+
}
|
|
9609
|
+
|
|
9384
9610
|
{
|
|
9385
9611
|
const result = validateOptionalUniqueIdArray({
|
|
9386
9612
|
value: data.tagIds,
|
|
@@ -9396,7 +9622,7 @@ const validateVariableCreateData = ({ data, errorFactory }) => {
|
|
|
9396
9622
|
{
|
|
9397
9623
|
const result = validateVariableEnumMetadata({
|
|
9398
9624
|
data,
|
|
9399
|
-
variableType: data.
|
|
9625
|
+
variableType: data.variableType,
|
|
9400
9626
|
path: "payload.data",
|
|
9401
9627
|
errorFactory,
|
|
9402
9628
|
});
|
|
@@ -9415,7 +9641,7 @@ const validateVariableCreateData = ({ data, errorFactory }) => {
|
|
|
9415
9641
|
{
|
|
9416
9642
|
const result = validateVariableTypedValue({
|
|
9417
9643
|
value: data.default,
|
|
9418
|
-
variableType: data.
|
|
9644
|
+
variableType: data.variableType,
|
|
9419
9645
|
path: "payload.data.default",
|
|
9420
9646
|
errorFactory,
|
|
9421
9647
|
});
|
|
@@ -9426,7 +9652,7 @@ const validateVariableCreateData = ({ data, errorFactory }) => {
|
|
|
9426
9652
|
{
|
|
9427
9653
|
const result = validateVariableTypedValue({
|
|
9428
9654
|
value: data.value,
|
|
9429
|
-
variableType: data.
|
|
9655
|
+
variableType: data.variableType,
|
|
9430
9656
|
path: "payload.data.value",
|
|
9431
9657
|
errorFactory,
|
|
9432
9658
|
});
|
|
@@ -11610,6 +11836,24 @@ const findReferencedFileUsage = ({ state, fileId }) => {
|
|
|
11610
11836
|
}
|
|
11611
11837
|
}
|
|
11612
11838
|
|
|
11839
|
+
for (const [transformId, transform] of Object.entries(
|
|
11840
|
+
state.transforms.items,
|
|
11841
|
+
)) {
|
|
11842
|
+
if (transform.type !== "transform") {
|
|
11843
|
+
continue;
|
|
11844
|
+
}
|
|
11845
|
+
|
|
11846
|
+
for (const fieldName of ["thumbnailFileId", "previewFileId"]) {
|
|
11847
|
+
if (transform[fieldName] === fileId) {
|
|
11848
|
+
return {
|
|
11849
|
+
kind: "transform",
|
|
11850
|
+
field: fieldName,
|
|
11851
|
+
ownerId: transformId,
|
|
11852
|
+
};
|
|
11853
|
+
}
|
|
11854
|
+
}
|
|
11855
|
+
}
|
|
11856
|
+
|
|
11613
11857
|
for (const [characterId, character] of Object.entries(
|
|
11614
11858
|
state.characters.items,
|
|
11615
11859
|
)) {
|
|
@@ -15911,6 +16155,15 @@ const COMMAND_DEFINITIONS = [
|
|
|
15911
16155
|
target: item,
|
|
15912
16156
|
tagIds: payload.data.tagIds,
|
|
15913
16157
|
});
|
|
16158
|
+
if (payload.data.thumbnailFileId !== undefined) {
|
|
16159
|
+
item.thumbnailFileId = payload.data.thumbnailFileId;
|
|
16160
|
+
}
|
|
16161
|
+
if (payload.data.previewFileId !== undefined) {
|
|
16162
|
+
item.previewFileId = payload.data.previewFileId;
|
|
16163
|
+
}
|
|
16164
|
+
if (payload.data.preview !== undefined) {
|
|
16165
|
+
item.preview = structuredClone(payload.data.preview);
|
|
16166
|
+
}
|
|
15914
16167
|
|
|
15915
16168
|
return item;
|
|
15916
16169
|
},
|
|
@@ -15924,6 +16177,30 @@ const COMMAND_DEFINITIONS = [
|
|
|
15924
16177
|
return;
|
|
15925
16178
|
}
|
|
15926
16179
|
|
|
16180
|
+
const fileResult = validateReferencedFilesInData({
|
|
16181
|
+
state,
|
|
16182
|
+
data: payload.data,
|
|
16183
|
+
fields: ["thumbnailFileId", "previewFileId"],
|
|
16184
|
+
details: {
|
|
16185
|
+
transformId: payload.transformId,
|
|
16186
|
+
},
|
|
16187
|
+
});
|
|
16188
|
+
if (!fileResult.valid) {
|
|
16189
|
+
return fileResult;
|
|
16190
|
+
}
|
|
16191
|
+
|
|
16192
|
+
const previewResult = validateTransformPreviewImageReferences({
|
|
16193
|
+
state,
|
|
16194
|
+
preview: payload.data.preview,
|
|
16195
|
+
path: "payload.data.preview",
|
|
16196
|
+
details: {
|
|
16197
|
+
transformId: payload.transformId,
|
|
16198
|
+
},
|
|
16199
|
+
});
|
|
16200
|
+
if (!previewResult.valid) {
|
|
16201
|
+
return previewResult;
|
|
16202
|
+
}
|
|
16203
|
+
|
|
15927
16204
|
return validateTagIdsAgainstScope({
|
|
15928
16205
|
state,
|
|
15929
16206
|
tagIds: payload.data.tagIds,
|
|
@@ -15947,6 +16224,30 @@ const COMMAND_DEFINITIONS = [
|
|
|
15947
16224
|
}
|
|
15948
16225
|
|
|
15949
16226
|
if (currentItem.type === "transform") {
|
|
16227
|
+
const fileResult = validateReferencedFilesInData({
|
|
16228
|
+
state,
|
|
16229
|
+
data: payload.data,
|
|
16230
|
+
fields: ["thumbnailFileId", "previewFileId"],
|
|
16231
|
+
details: {
|
|
16232
|
+
transformId: payload.transformId,
|
|
16233
|
+
},
|
|
16234
|
+
});
|
|
16235
|
+
if (!fileResult.valid) {
|
|
16236
|
+
return fileResult;
|
|
16237
|
+
}
|
|
16238
|
+
|
|
16239
|
+
const previewResult = validateTransformPreviewImageReferences({
|
|
16240
|
+
state,
|
|
16241
|
+
preview: payload.data.preview,
|
|
16242
|
+
path: "payload.data.preview",
|
|
16243
|
+
details: {
|
|
16244
|
+
transformId: payload.transformId,
|
|
16245
|
+
},
|
|
16246
|
+
});
|
|
16247
|
+
if (!previewResult.valid) {
|
|
16248
|
+
return previewResult;
|
|
16249
|
+
}
|
|
16250
|
+
|
|
15950
16251
|
return validateTagIdsAgainstScope({
|
|
15951
16252
|
state,
|
|
15952
16253
|
tagIds: payload.data.tagIds,
|
|
@@ -16013,7 +16314,7 @@ const COMMAND_DEFINITIONS = [
|
|
|
16013
16314
|
}
|
|
16014
16315
|
|
|
16015
16316
|
if (
|
|
16016
|
-
currentItem.
|
|
16317
|
+
currentItem.variableType !== "string" &&
|
|
16017
16318
|
(payload.data.isEnum !== undefined ||
|
|
16018
16319
|
payload.data.enumValues !== undefined)
|
|
16019
16320
|
) {
|
|
@@ -16042,7 +16343,7 @@ const COMMAND_DEFINITIONS = [
|
|
|
16042
16343
|
{
|
|
16043
16344
|
const result = validateVariableTypedValue({
|
|
16044
16345
|
value: payload.data.default,
|
|
16045
|
-
variableType: currentItem.
|
|
16346
|
+
variableType: currentItem.variableType,
|
|
16046
16347
|
path: "payload.data.default",
|
|
16047
16348
|
errorFactory: createPreconditionValidationError,
|
|
16048
16349
|
});
|
|
@@ -16056,7 +16357,7 @@ const COMMAND_DEFINITIONS = [
|
|
|
16056
16357
|
{
|
|
16057
16358
|
const result = validateVariableTypedValue({
|
|
16058
16359
|
value: payload.data.value,
|
|
16059
|
-
variableType: currentItem.
|
|
16360
|
+
variableType: currentItem.variableType,
|
|
16060
16361
|
path: "payload.data.value",
|
|
16061
16362
|
errorFactory: createPreconditionValidationError,
|
|
16062
16363
|
});
|