@routevn/creator-model 1.2.2 → 1.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/model.js +34 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routevn/creator-model",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/model.js CHANGED
@@ -1203,6 +1203,7 @@ const validateVideoItems = ({ items, path, errorFactory }) => {
1203
1203
  "thumbnailFileId",
1204
1204
  "fileType",
1205
1205
  "fileSize",
1206
+ "duration",
1206
1207
  "width",
1207
1208
  "height",
1208
1209
  ],
@@ -1271,6 +1272,13 @@ const validateVideoItems = ({ items, path, errorFactory }) => {
1271
1272
  );
1272
1273
  }
1273
1274
 
1275
+ if (item.duration !== undefined && !isFiniteNumber(item.duration)) {
1276
+ return invalidFromErrorFactory(
1277
+ errorFactory,
1278
+ `${itemPath}.duration must be a finite number`,
1279
+ );
1280
+ }
1281
+
1274
1282
  if (item.width !== undefined && !isFiniteNumber(item.width)) {
1275
1283
  return invalidFromErrorFactory(
1276
1284
  errorFactory,
@@ -2925,7 +2933,8 @@ const validateLayoutElementData = ({
2925
2933
  "clickTextStyleId",
2926
2934
  "conditionalOverrides",
2927
2935
  "direction",
2928
- "gap",
2936
+ "gapX",
2937
+ "gapY",
2929
2938
  "containerType",
2930
2939
  "scroll",
2931
2940
  "hover",
@@ -2991,7 +3000,8 @@ const validateLayoutElementData = ({
2991
3000
  "scaleY",
2992
3001
  "rotation",
2993
3002
  "displaySpeed",
2994
- "gap",
3003
+ "gapX",
3004
+ "gapY",
2995
3005
  "min",
2996
3006
  "max",
2997
3007
  "step",
@@ -3462,7 +3472,8 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
3462
3472
  "clickTextStyleId",
3463
3473
  "conditionalOverrides",
3464
3474
  "direction",
3465
- "gap",
3475
+ "gapX",
3476
+ "gapY",
3466
3477
  "containerType",
3467
3478
  "scroll",
3468
3479
  "hover",
@@ -6530,6 +6541,7 @@ const validateVideoCreateData = ({ data, errorFactory }) => {
6530
6541
  "thumbnailFileId",
6531
6542
  "fileType",
6532
6543
  "fileSize",
6544
+ "duration",
6533
6545
  "width",
6534
6546
  "height",
6535
6547
  ],
@@ -6584,6 +6596,13 @@ const validateVideoCreateData = ({ data, errorFactory }) => {
6584
6596
  );
6585
6597
  }
6586
6598
 
6599
+ if (data.duration !== undefined && !isFiniteNumber(data.duration)) {
6600
+ return invalidFromErrorFactory(
6601
+ errorFactory,
6602
+ "payload.data.duration must be a finite number",
6603
+ );
6604
+ }
6605
+
6587
6606
  if (data.width !== undefined && !isFiniteNumber(data.width)) {
6588
6607
  return invalidFromErrorFactory(
6589
6608
  errorFactory,
@@ -6611,6 +6630,7 @@ const validateVideoUpdateData = ({ data, errorFactory }) => {
6611
6630
  "thumbnailFileId",
6612
6631
  "fileType",
6613
6632
  "fileSize",
6633
+ "duration",
6614
6634
  "width",
6615
6635
  "height",
6616
6636
  ],
@@ -6674,6 +6694,13 @@ const validateVideoUpdateData = ({ data, errorFactory }) => {
6674
6694
  );
6675
6695
  }
6676
6696
 
6697
+ if (data.duration !== undefined && !isFiniteNumber(data.duration)) {
6698
+ return invalidFromErrorFactory(
6699
+ errorFactory,
6700
+ "payload.data.duration must be a finite number",
6701
+ );
6702
+ }
6703
+
6677
6704
  if (data.width !== undefined && !isFiniteNumber(data.width)) {
6678
6705
  return invalidFromErrorFactory(
6679
6706
  errorFactory,
@@ -11865,6 +11892,9 @@ const COMMAND_DEFINITIONS = [
11865
11892
  if (payload.data.fileSize !== undefined) {
11866
11893
  nextVideo.fileSize = payload.data.fileSize;
11867
11894
  }
11895
+ if (payload.data.duration !== undefined) {
11896
+ nextVideo.duration = payload.data.duration;
11897
+ }
11868
11898
  if (payload.data.width !== undefined) {
11869
11899
  nextVideo.width = payload.data.width;
11870
11900
  }
@@ -11933,6 +11963,7 @@ const COMMAND_DEFINITIONS = [
11933
11963
  payload.data.thumbnailFileId !== undefined ||
11934
11964
  payload.data.fileType !== undefined ||
11935
11965
  payload.data.fileSize !== undefined ||
11966
+ payload.data.duration !== undefined ||
11936
11967
  payload.data.width !== undefined ||
11937
11968
  payload.data.height !== undefined)
11938
11969
  ) {