@singularsystems/neo-core 1.3.6 → 1.3.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Neo core changelog
2
2
 
3
+ ## Version 1.3.8 (28 Jan 2026)
4
+
5
+ - DateUtils
6
+ - Renamed `ITimeSpan` to `ITimeValues`. `DateUtils.difference` now returns `TimeSpan`. See breaking changes.
7
+ - FileOptions
8
+ - Added `capture` property to file options.
9
+
10
+ ## Version 1.3.7 (24 Nov 2025)
11
+
12
+ - Deserialiser
13
+ - Fixed plain arrays not deserialising when marked with `ChildList` attribute (again).
14
+
3
15
  ## Version 1.3.6 (18 Nov 2025)
4
16
 
5
17
  - Deserialiser
@@ -214,6 +214,9 @@ var FileManagerBase = /** @class */ (function () {
214
214
  else {
215
215
  props.accept = "";
216
216
  }
217
+ if (this.options.capture) {
218
+ props.capture = this.options.capture;
219
+ }
217
220
  return props;
218
221
  };
219
222
  FileManagerBase.prototype.afterUpload = function (response) {
@@ -9,6 +9,8 @@ export interface IBaseFileManagerOptions {
9
9
  allowedExtensions?: string[];
10
10
  /** Accept type. E.g. image/* */
11
11
  accept?: string;
12
+ /** Specify the preferred camera to use for capturing media. */
13
+ capture?: "user" | "environment";
12
14
  /** True if you want to allow new files to be selected once a file is already uploading. */
13
15
  allowConcurrent?: boolean;
14
16
  /**
@@ -188,7 +188,7 @@ var Deserialiser = /** @class */ (function () {
188
188
  }
189
189
  else {
190
190
  if (fromValue instanceof Array && !propertyInfo.assignOnDeserialise) {
191
- if (!to[key] || !(to[key] instanceof Array) || to[key].canDeserialise) {
191
+ if (!to[key] || !(to[key] instanceof Array) || propertyInfo.itemConstructorOptions || to[key].canDeserialise) {
192
192
  // Deserialise into full list / array.
193
193
  if (!to[key] && propertyInfo.relationType === RelationType.ChildList) {
194
194
  // If the property is null, assume it is an array, not a list.
@@ -1,6 +1,6 @@
1
1
  import { IPropertyInstance } from "../Model/PropertyInstance";
2
2
  import { TimeZoneFormat } from "../Misc";
3
- import { ITimeSpan, TimeSpan } from "./TimeSpan";
3
+ import { ITimeValues, TimeSpan } from "./TimeSpan";
4
4
  export default class DateUtils {
5
5
  static defaultFormatString: string;
6
6
  static defaultFormatStringWithTime: string;
@@ -44,7 +44,7 @@ export default class DateUtils {
44
44
  * Returns a new date, with the timespan components added to it.
45
45
  * Use negative numbers to subtract.
46
46
  */
47
- static add(date: Date, timeSpan: Partial<ITimeSpan>): Date;
47
+ static add(date: Date, timeSpan: Partial<ITimeValues>): Date;
48
48
  /**
49
49
  * Gets the difference between 2 dates.
50
50
  */
@@ -223,7 +223,7 @@ var DateUtils = /** @class */ (function () {
223
223
  var compareDate = new Date();
224
224
  compareDate.setFullYear(endDate.getFullYear() - startDate.getFullYear(), endDate.getMonth() - startDate.getMonth(), endDate.getDate() - startDate.getDate());
225
225
  compareDate.setHours(endDate.getHours() - startDate.getHours(), endDate.getMinutes() - startDate.getMinutes(), endDate.getSeconds() - startDate.getSeconds(), endDate.getMilliseconds() - startDate.getMilliseconds());
226
- return new TimeSpan(compareDate.getFullYear(), compareDate.getMonth(), compareDate.getDate(), compareDate.getHours(), compareDate.getMinutes(), compareDate.getSeconds(), compareDate.getMilliseconds(), endDate.getTime() - startDate.getTime());
226
+ return new TimeSpan(compareDate.getHours(), compareDate.getMinutes(), compareDate.getSeconds(), compareDate.getMilliseconds(), endDate.getTime() - startDate.getTime());
227
227
  };
228
228
  DateUtils.defaultFormatString = "dd MMM yyyy";
229
229
  DateUtils.defaultFormatStringWithTime = "dd MMM yyyy HH:mm";
@@ -1,4 +1,4 @@
1
- export interface ITimeSpan {
1
+ export interface ITimeValues {
2
2
  years: number;
3
3
  months: number;
4
4
  days: number;
@@ -7,18 +7,16 @@ export interface ITimeSpan {
7
7
  seconds: number;
8
8
  milliseconds: number;
9
9
  }
10
- export declare class TimeSpan implements ITimeSpan {
11
- readonly years: number;
12
- readonly months: number;
13
- readonly days: number;
10
+ export declare class TimeSpan {
14
11
  readonly hours: number;
15
12
  readonly minutes: number;
16
13
  readonly seconds: number;
17
14
  readonly milliseconds: number;
18
15
  readonly totalMilliseconds: number;
19
- constructor(years: number, months: number, days: number, hours: number, minutes: number, seconds: number, milliseconds: number, totalMilliseconds: number);
16
+ constructor(hours: number, minutes: number, seconds: number, milliseconds: number, totalMilliseconds: number);
20
17
  get totalSeconds(): number;
21
18
  get totalMinutes(): number;
22
19
  get totalHours(): number;
20
+ get days(): number;
23
21
  get totalDays(): number;
24
22
  }
@@ -3,10 +3,7 @@ var msPerMinute = msPerSecond * 60;
3
3
  var msPerHour = msPerMinute * 60;
4
4
  var msPerDay = msPerHour * 24;
5
5
  var TimeSpan = /** @class */ (function () {
6
- function TimeSpan(years, months, days, hours, minutes, seconds, milliseconds, totalMilliseconds) {
7
- this.years = years;
8
- this.months = months;
9
- this.days = days;
6
+ function TimeSpan(hours, minutes, seconds, milliseconds, totalMilliseconds) {
10
7
  this.hours = hours;
11
8
  this.minutes = minutes;
12
9
  this.seconds = seconds;
@@ -34,6 +31,13 @@ var TimeSpan = /** @class */ (function () {
34
31
  enumerable: false,
35
32
  configurable: true
36
33
  });
34
+ Object.defineProperty(TimeSpan.prototype, "days", {
35
+ get: function () {
36
+ return this.totalDays;
37
+ },
38
+ enumerable: false,
39
+ configurable: true
40
+ });
37
41
  Object.defineProperty(TimeSpan.prototype, "totalDays", {
38
42
  get: function () {
39
43
  return Math.floor(this.totalMilliseconds / msPerDay);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-core",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Core functionality for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",