@routevn/creator-model 1.0.0 → 1.0.1
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 +25 -0
package/package.json
CHANGED
package/src/model.js
CHANGED
|
@@ -501,6 +501,7 @@ const validateImageItems = ({ items, path, errorFactory }) => {
|
|
|
501
501
|
"type",
|
|
502
502
|
"name",
|
|
503
503
|
"description",
|
|
504
|
+
"thumbnailFileId",
|
|
504
505
|
"fileId",
|
|
505
506
|
"fileType",
|
|
506
507
|
"fileSize",
|
|
@@ -534,6 +535,16 @@ const validateImageItems = ({ items, path, errorFactory }) => {
|
|
|
534
535
|
}
|
|
535
536
|
|
|
536
537
|
if (item.type === "image") {
|
|
538
|
+
if (
|
|
539
|
+
item.thumbnailFileId !== undefined &&
|
|
540
|
+
!isNonEmptyString(item.thumbnailFileId)
|
|
541
|
+
) {
|
|
542
|
+
return invalidFromErrorFactory(
|
|
543
|
+
errorFactory,
|
|
544
|
+
`${itemPath}.thumbnailFileId must be a non-empty string when provided`,
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
|
|
537
548
|
if (!isNonEmptyString(item.fileId)) {
|
|
538
549
|
return invalidFromErrorFactory(errorFactory, `${itemPath}.fileId must be a non-empty string`);
|
|
539
550
|
}
|
|
@@ -3397,6 +3408,7 @@ const validateImageCreateData = ({ data, errorFactory }) => {
|
|
|
3397
3408
|
"type",
|
|
3398
3409
|
"name",
|
|
3399
3410
|
"description",
|
|
3411
|
+
"thumbnailFileId",
|
|
3400
3412
|
"fileId",
|
|
3401
3413
|
"fileType",
|
|
3402
3414
|
"fileSize",
|
|
@@ -3422,6 +3434,16 @@ const validateImageCreateData = ({ data, errorFactory }) => {
|
|
|
3422
3434
|
}
|
|
3423
3435
|
|
|
3424
3436
|
if (data.type === "image") {
|
|
3437
|
+
if (
|
|
3438
|
+
data.thumbnailFileId !== undefined &&
|
|
3439
|
+
!isNonEmptyString(data.thumbnailFileId)
|
|
3440
|
+
) {
|
|
3441
|
+
return invalidFromErrorFactory(
|
|
3442
|
+
errorFactory,
|
|
3443
|
+
"payload.data.thumbnailFileId must be a non-empty string when provided",
|
|
3444
|
+
);
|
|
3445
|
+
}
|
|
3446
|
+
|
|
3425
3447
|
if (!isNonEmptyString(data.fileId)) {
|
|
3426
3448
|
return invalidFromErrorFactory(errorFactory, "payload.data.fileId must be a non-empty string");
|
|
3427
3449
|
}
|
|
@@ -6863,6 +6885,9 @@ const COMMAND_DEFINITIONS = [
|
|
|
6863
6885
|
|
|
6864
6886
|
if (payload.data.type === "image") {
|
|
6865
6887
|
nextImage.fileId = payload.data.fileId;
|
|
6888
|
+
if (payload.data.thumbnailFileId !== undefined) {
|
|
6889
|
+
nextImage.thumbnailFileId = payload.data.thumbnailFileId;
|
|
6890
|
+
}
|
|
6866
6891
|
if (payload.data.fileType !== undefined) {
|
|
6867
6892
|
nextImage.fileType = payload.data.fileType;
|
|
6868
6893
|
}
|