wsp-ms-core 1.1.14 → 1.1.16
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/dist/index.cjs +19 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,9 +103,13 @@ var ValueObject = class {
|
|
|
103
103
|
|
|
104
104
|
// src/domain/value-objects/DateTime.ts
|
|
105
105
|
var _DateTime = class _DateTime extends ValueObject {
|
|
106
|
-
constructor(value) {
|
|
106
|
+
constructor(value, strictUTC = true) {
|
|
107
107
|
super(value);
|
|
108
|
-
|
|
108
|
+
if (strictUTC) {
|
|
109
|
+
this._dt = import_luxon.DateTime.fromFormat(value, _DateTime.DEFAULT_FORMAT, { zone: "utc" });
|
|
110
|
+
} else {
|
|
111
|
+
this._dt = import_luxon.DateTime.fromFormat(value, _DateTime.DEFAULT_FORMAT);
|
|
112
|
+
}
|
|
109
113
|
}
|
|
110
114
|
static fromLuxon(dt) {
|
|
111
115
|
return new _DateTime(_DateTime.toUtcFormat(dt));
|
|
@@ -242,6 +246,18 @@ var _DateTime = class _DateTime extends ValueObject {
|
|
|
242
246
|
value: this.value
|
|
243
247
|
};
|
|
244
248
|
}
|
|
249
|
+
setTimeZone(timeZone, options) {
|
|
250
|
+
let dt;
|
|
251
|
+
if (options) {
|
|
252
|
+
dt = this._dt.setZone(timeZone, options);
|
|
253
|
+
} else {
|
|
254
|
+
dt = this._dt.setZone(timeZone);
|
|
255
|
+
}
|
|
256
|
+
if (!dt.isValid) {
|
|
257
|
+
throw new Error("Invalid date");
|
|
258
|
+
}
|
|
259
|
+
return new _DateTime(dt.toFormat(_DateTime.DEFAULT_FORMAT), false);
|
|
260
|
+
}
|
|
245
261
|
formatInTimezone(timezone) {
|
|
246
262
|
const zoned = this._dt.setZone(timezone);
|
|
247
263
|
if (!zoned.isValid) {
|
|
@@ -2048,7 +2064,7 @@ var InboxMysqlRepository = class {
|
|
|
2048
2064
|
}
|
|
2049
2065
|
async listPending(limit) {
|
|
2050
2066
|
const result = await this.connection.query(
|
|
2051
|
-
`SELECT * FROM events_inbox WHERE status IN ('PENDING','FAILED') AND events_inbox.processed_at IS NULL LIMIT ${limit}`,
|
|
2067
|
+
`SELECT * FROM events_inbox WHERE status IN ('PENDING','FAILED') AND events_inbox.processed_at IS NULL ORDER BY created_at DESC LIMIT ${limit}`,
|
|
2052
2068
|
[]
|
|
2053
2069
|
);
|
|
2054
2070
|
return result.length > 0 ? result.map((r) => InboxRecord.reconstitute(r)) : [];
|