wsp-ms-core 1.1.17 → 1.1.19
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 +13 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +9 -6
package/dist/index.cjs
CHANGED
|
@@ -265,15 +265,25 @@ var _DateTime = class _DateTime extends ValueObject {
|
|
|
265
265
|
}
|
|
266
266
|
return zoned.toFormat(_DateTime.DEFAULT_FORMAT);
|
|
267
267
|
}
|
|
268
|
-
static create(input) {
|
|
269
|
-
if (input === void 0) {
|
|
268
|
+
static create(input, format = _DateTime.FORMAT) {
|
|
269
|
+
if (input === void 0 || input === null) {
|
|
270
270
|
return new _DateTime(_DateTime.toUtcFormat(import_luxon.DateTime.now()));
|
|
271
271
|
}
|
|
272
|
+
if (input instanceof import_luxon.DateTime) {
|
|
273
|
+
return new _DateTime(_DateTime.toUtcFormat(input));
|
|
274
|
+
}
|
|
275
|
+
if (input instanceof Date) {
|
|
276
|
+
return new _DateTime(_DateTime.toUtcFormat(import_luxon.DateTime.fromJSDate(input, { zone: "utc" })));
|
|
277
|
+
}
|
|
272
278
|
if (typeof input === "number") {
|
|
273
279
|
return new _DateTime(
|
|
274
280
|
_DateTime.toUtcFormat(import_luxon.DateTime.fromMillis(input, { zone: "utc" }))
|
|
275
281
|
);
|
|
276
282
|
}
|
|
283
|
+
const fromDefault = import_luxon.DateTime.fromFormat(input, _DateTime.DEFAULT_FORMAT, { zone: "utc" });
|
|
284
|
+
if (fromDefault.isValid) {
|
|
285
|
+
return new _DateTime(input);
|
|
286
|
+
}
|
|
277
287
|
const iso = import_luxon.DateTime.fromISO(input, { zone: "utc" });
|
|
278
288
|
if (iso.isValid) {
|
|
279
289
|
return new _DateTime(_DateTime.toUtcFormat(iso));
|
|
@@ -2064,7 +2074,7 @@ var InboxMysqlRepository = class {
|
|
|
2064
2074
|
}
|
|
2065
2075
|
async listPending(limit) {
|
|
2066
2076
|
const result = await this.connection.query(
|
|
2067
|
-
`SELECT * FROM events_inbox WHERE status IN ('PENDING','FAILED') AND events_inbox.processed_at IS NULL ORDER BY id
|
|
2077
|
+
`SELECT * FROM events_inbox WHERE status IN ('PENDING','FAILED') AND events_inbox.processed_at IS NULL ORDER BY id ASC LIMIT ${limit}`,
|
|
2068
2078
|
[]
|
|
2069
2079
|
);
|
|
2070
2080
|
return result.length > 0 ? result.map((r) => InboxRecord.reconstitute(r)) : [];
|