@wise/dynamic-flow-client 3.11.2 → 3.11.3

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/build/main.mjs CHANGED
@@ -7473,12 +7473,7 @@ var mergeChildrenValues = (displayOrder, getComponentValue) => displayOrder.redu
7473
7473
  var objectSchemaToComponent = (schemaMapperProps, mapperProps) => {
7474
7474
  const { uid, localValue, schema, model, validationErrors } = schemaMapperProps;
7475
7475
  const { $id, displayOrder, properties, required } = schema;
7476
- const propertyNames = Object.keys(properties);
7477
- if (displayOrder.length !== propertyNames.length) {
7478
- throw new Error(
7479
- `Object schema ${$id} has ${propertyNames.length} properties but only ${displayOrder.length} are listed in displayOrder`
7480
- );
7481
- }
7476
+ validateDisplayOrder($id, displayOrder, properties, mapperProps.logEvent);
7482
7477
  const componentMap = displayOrder.reduce((acc, propName) => {
7483
7478
  var _a;
7484
7479
  const propSchema = properties[propName];
@@ -7504,6 +7499,28 @@ var objectSchemaToComponent = (schemaMapperProps, mapperProps) => {
7504
7499
  displayOrder
7505
7500
  }));
7506
7501
  };
7502
+ var validateDisplayOrder = ($id, displayOrder, properties, logEvent) => {
7503
+ if (!displayOrder) {
7504
+ const message = `Object schema ${$id} has no displayOrder property.`;
7505
+ logEvent("error", message);
7506
+ throw new Error(message);
7507
+ }
7508
+ const propertyNames = Object.keys(properties);
7509
+ displayOrder.forEach((propName) => {
7510
+ if (!properties[propName]) {
7511
+ const message = `Object schema ${$id} has no property named "${propName}", but it is listed in the displayOrder array.`;
7512
+ logEvent("error", message);
7513
+ throw new Error(message);
7514
+ }
7515
+ });
7516
+ propertyNames.forEach((propName) => {
7517
+ if (!displayOrder.includes(propName)) {
7518
+ const message = `Object schema ${$id} has a "${propName}" property which is missing in the displayOrder array.`;
7519
+ logEvent("error", message);
7520
+ throw new Error(message);
7521
+ }
7522
+ });
7523
+ };
7507
7524
 
7508
7525
  // src/revamp/domain/components/AllOfComponent.ts
7509
7526
  var createAllOfComponent = (allOfProps) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.11.2",
3
+ "version": "3.11.3",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",