@dynamic-entity/server 2.4.0 → 2.5.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/express.mjs CHANGED
@@ -803,6 +803,7 @@ async function runImport(options) {
803
803
  const result = applyMapping(rows, plan, config, {
804
804
  lang: options.lang,
805
805
  decimal,
806
+ dateOrder: options.dateOrder,
806
807
  rules: options.rules,
807
808
  lookups: options.lookups,
808
809
  firstRowNumber: firstRow
@@ -1059,6 +1060,9 @@ function createImportRouter(options) {
1059
1060
  rowCount: preview.rowCount,
1060
1061
  arrayBound: preview.arrayBound,
1061
1062
  ...preview.delimiter ? { delimiter: preview.delimiter } : {},
1063
+ // The order every import through this router is read in, so the client reads its
1064
+ // sample the same way and can refuse to commit when it was told another.
1065
+ ...options.dateOrder ? { dateOrder: options.dateOrder } : {},
1062
1066
  engineVersion: CORE_VERSION
1063
1067
  };
1064
1068
  response.json(body);
@@ -1096,6 +1100,7 @@ function createImportRouter(options) {
1096
1100
  config,
1097
1101
  rules: routerOptions.rules && ownValue(routerOptions.rules, entity),
1098
1102
  lookups: routerOptions.lookups,
1103
+ dateOrder: routerOptions.dateOrder,
1099
1104
  lang: language(request),
1100
1105
  limits: resolved,
1101
1106
  onBatch: write && ((records, info) => write(records, info, entity, config))