@wabot-dev/framework 0.5.10 → 0.5.11
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/src/addon/chat-controller/socket/SocketChannel.js +3 -4
- package/dist/src/index.d.ts +4 -4
- package/dist/src/node_modules/cron-parser/dist/CronDate.js +12 -12
- package/dist/src/node_modules/cron-parser/dist/CronExpression.js +10 -10
- package/dist/src/node_modules/cron-parser/dist/fields/index.js +12 -12
- package/dist/src/node_modules/cron-parser/dist/index.js +12 -12
- package/dist/src/node_modules/luxon/build/node/luxon.js +1 -1
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@ import { runSocketControllers } from '../../../feature/socket-controller/runSock
|
|
|
9
9
|
import { Socket } from 'socket.io';
|
|
10
10
|
import { SocketChannelConfig } from './SocketChannelConfig.js';
|
|
11
11
|
import '../../../core/validation/metadata/ValidationMetadataStore.js';
|
|
12
|
+
import { isOptional } from '../../../core/validation/metadata/@isOptional.js';
|
|
12
13
|
import { isNotEmpty } from '../../../core/validation/validators/is-not-empty/@isNotEmpty.js';
|
|
13
14
|
import { isString } from '../../../core/validation/validators/is-string/@isString.js';
|
|
14
15
|
import { Auth } from '../../../core/auth/Auth.js';
|
|
@@ -27,11 +28,13 @@ __decorate([
|
|
|
27
28
|
__decorate([
|
|
28
29
|
isString(),
|
|
29
30
|
isNotEmpty(),
|
|
31
|
+
isOptional(),
|
|
30
32
|
__metadata("design:type", String)
|
|
31
33
|
], SocketChannelReceivedMessage.prototype, "senderName", void 0);
|
|
32
34
|
__decorate([
|
|
33
35
|
isString(),
|
|
34
36
|
isNotEmpty(),
|
|
37
|
+
isOptional(),
|
|
35
38
|
__metadata("design:type", String)
|
|
36
39
|
], SocketChannelReceivedMessage.prototype, "text", void 0);
|
|
37
40
|
let SocketChannel = class SocketChannel {
|
|
@@ -54,10 +57,6 @@ let SocketChannel = class SocketChannel {
|
|
|
54
57
|
async onMessage(message, socket) {
|
|
55
58
|
if (!channel.callBack)
|
|
56
59
|
return;
|
|
57
|
-
const trimmedInput = message.text.trim();
|
|
58
|
-
if (!trimmedInput) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
60
|
const chatConnection = {
|
|
62
61
|
id: message.chatId,
|
|
63
62
|
chatType: 'PRIVATE',
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1648,13 +1648,13 @@ interface ISocketChannelMessage extends ISocketReceivedMessage {
|
|
|
1648
1648
|
|
|
1649
1649
|
interface ISocketChannelReceivedMessage {
|
|
1650
1650
|
chatId: string;
|
|
1651
|
-
senderName
|
|
1652
|
-
text
|
|
1651
|
+
senderName?: string;
|
|
1652
|
+
text?: string;
|
|
1653
1653
|
}
|
|
1654
1654
|
declare class SocketChannelReceivedMessage implements ISocketChannelReceivedMessage {
|
|
1655
1655
|
chatId: string;
|
|
1656
|
-
senderName
|
|
1657
|
-
text
|
|
1656
|
+
senderName?: string;
|
|
1657
|
+
text?: string;
|
|
1658
1658
|
}
|
|
1659
1659
|
declare class SocketChannel implements IChatChannel {
|
|
1660
1660
|
private config;
|
|
@@ -6,9 +6,9 @@ var hasRequiredCronDate;
|
|
|
6
6
|
function requireCronDate () {
|
|
7
7
|
if (hasRequiredCronDate) return CronDate;
|
|
8
8
|
hasRequiredCronDate = 1;
|
|
9
|
-
(function (exports) {
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.CronDate = exports.DAYS_IN_MONTH = exports.DateMathOp = exports.TimeUnit = void 0;
|
|
9
|
+
(function (exports$1) {
|
|
10
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
11
|
+
exports$1.CronDate = exports$1.DAYS_IN_MONTH = exports$1.DateMathOp = exports$1.TimeUnit = void 0;
|
|
12
12
|
const luxon_1 = /*@__PURE__*/ requireLuxon();
|
|
13
13
|
var TimeUnit;
|
|
14
14
|
(function (TimeUnit) {
|
|
@@ -18,13 +18,13 @@ function requireCronDate () {
|
|
|
18
18
|
TimeUnit["Day"] = "Day";
|
|
19
19
|
TimeUnit["Month"] = "Month";
|
|
20
20
|
TimeUnit["Year"] = "Year";
|
|
21
|
-
})(TimeUnit || (exports.TimeUnit = TimeUnit = {}));
|
|
21
|
+
})(TimeUnit || (exports$1.TimeUnit = TimeUnit = {}));
|
|
22
22
|
var DateMathOp;
|
|
23
23
|
(function (DateMathOp) {
|
|
24
24
|
DateMathOp["Add"] = "Add";
|
|
25
25
|
DateMathOp["Subtract"] = "Subtract";
|
|
26
|
-
})(DateMathOp || (exports.DateMathOp = DateMathOp = {}));
|
|
27
|
-
exports.DAYS_IN_MONTH = Object.freeze([31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]);
|
|
26
|
+
})(DateMathOp || (exports$1.DateMathOp = DateMathOp = {}));
|
|
27
|
+
exports$1.DAYS_IN_MONTH = Object.freeze([31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]);
|
|
28
28
|
/**
|
|
29
29
|
* CronDate class that wraps the Luxon DateTime object to provide
|
|
30
30
|
* a consistent API for working with dates and times in the context of cron.
|
|
@@ -443,10 +443,10 @@ function requireCronDate () {
|
|
|
443
443
|
// Special handling for February in leap years
|
|
444
444
|
if (month === 2) {
|
|
445
445
|
const isLeap = CronDate.#isLeapYear(this.#date.year);
|
|
446
|
-
return day === exports.DAYS_IN_MONTH[month - 1] - (isLeap ? 0 : 1);
|
|
446
|
+
return day === exports$1.DAYS_IN_MONTH[month - 1] - (isLeap ? 0 : 1);
|
|
447
447
|
}
|
|
448
448
|
// For other months, check against the static map
|
|
449
|
-
return day === exports.DAYS_IN_MONTH[month - 1];
|
|
449
|
+
return day === exports$1.DAYS_IN_MONTH[month - 1];
|
|
450
450
|
}
|
|
451
451
|
/**
|
|
452
452
|
* Returns true if the day is the last weekday of the month.
|
|
@@ -458,10 +458,10 @@ function requireCronDate () {
|
|
|
458
458
|
let lastDay;
|
|
459
459
|
if (month === 2) {
|
|
460
460
|
// Special handling for February
|
|
461
|
-
lastDay = exports.DAYS_IN_MONTH[month - 1] - (CronDate.#isLeapYear(this.#date.year) ? 0 : 1);
|
|
461
|
+
lastDay = exports$1.DAYS_IN_MONTH[month - 1] - (CronDate.#isLeapYear(this.#date.year) ? 0 : 1);
|
|
462
462
|
}
|
|
463
463
|
else {
|
|
464
|
-
lastDay = exports.DAYS_IN_MONTH[month - 1];
|
|
464
|
+
lastDay = exports$1.DAYS_IN_MONTH[month - 1];
|
|
465
465
|
}
|
|
466
466
|
// Check if the current day is within 7 days of the end of the month
|
|
467
467
|
return day > lastDay - 7;
|
|
@@ -501,8 +501,8 @@ function requireCronDate () {
|
|
|
501
501
|
return this.#date.toUTC();
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
exports.CronDate = CronDate;
|
|
505
|
-
exports.default = CronDate;
|
|
504
|
+
exports$1.CronDate = CronDate;
|
|
505
|
+
exports$1.default = CronDate;
|
|
506
506
|
} (CronDate));
|
|
507
507
|
return CronDate;
|
|
508
508
|
}
|
|
@@ -6,18 +6,18 @@ var hasRequiredCronExpression;
|
|
|
6
6
|
function requireCronExpression () {
|
|
7
7
|
if (hasRequiredCronExpression) return CronExpression;
|
|
8
8
|
hasRequiredCronExpression = 1;
|
|
9
|
-
(function (exports) {
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.CronExpression = exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE = exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE = void 0;
|
|
9
|
+
(function (exports$1) {
|
|
10
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
11
|
+
exports$1.CronExpression = exports$1.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE = exports$1.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE = void 0;
|
|
12
12
|
const CronDate_1 = requireCronDate();
|
|
13
13
|
/**
|
|
14
14
|
* Error message for when the current date is outside the specified time span.
|
|
15
15
|
*/
|
|
16
|
-
exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE = 'Out of the time span range';
|
|
16
|
+
exports$1.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE = 'Out of the time span range';
|
|
17
17
|
/**
|
|
18
18
|
* Error message for when the loop limit is exceeded during iteration.
|
|
19
19
|
*/
|
|
20
|
-
exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE = 'Invalid expression, loop limit exceeded';
|
|
20
|
+
exports$1.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE = 'Invalid expression, loop limit exceeded';
|
|
21
21
|
/**
|
|
22
22
|
* Cron iteration loop safety limit
|
|
23
23
|
*/
|
|
@@ -334,10 +334,10 @@ function requireCronExpression () {
|
|
|
334
334
|
}
|
|
335
335
|
const currentTime = currentDate.getTime();
|
|
336
336
|
if (this.#startDate && currentTime < this.#startDate.getTime()) {
|
|
337
|
-
throw new Error(exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);
|
|
337
|
+
throw new Error(exports$1.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);
|
|
338
338
|
}
|
|
339
339
|
if (this.#endDate && currentTime > this.#endDate.getTime()) {
|
|
340
|
-
throw new Error(exports.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);
|
|
340
|
+
throw new Error(exports$1.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
@@ -387,7 +387,7 @@ function requireCronExpression () {
|
|
|
387
387
|
}
|
|
388
388
|
/* istanbul ignore next - should be impossible under normal use to trigger the branch */
|
|
389
389
|
if (stepCount > LOOP_LIMIT) {
|
|
390
|
-
throw new Error(exports.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);
|
|
390
|
+
throw new Error(exports$1.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);
|
|
391
391
|
}
|
|
392
392
|
if (currentDate.getMilliseconds() !== 0) {
|
|
393
393
|
currentDate.setMilliseconds(0);
|
|
@@ -411,8 +411,8 @@ function requireCronExpression () {
|
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
exports.CronExpression = CronExpression;
|
|
415
|
-
exports.default = CronExpression;
|
|
414
|
+
exports$1.CronExpression = CronExpression;
|
|
415
|
+
exports$1.default = CronExpression;
|
|
416
416
|
} (CronExpression));
|
|
417
417
|
return CronExpression;
|
|
418
418
|
}
|
|
@@ -13,7 +13,7 @@ var hasRequiredFields;
|
|
|
13
13
|
function requireFields () {
|
|
14
14
|
if (hasRequiredFields) return fields;
|
|
15
15
|
hasRequiredFields = 1;
|
|
16
|
-
(function (exports) {
|
|
16
|
+
(function (exports$1) {
|
|
17
17
|
var __createBinding = (fields && fields.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
18
|
if (k2 === undefined) k2 = k;
|
|
19
19
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -25,18 +25,18 @@ function requireFields () {
|
|
|
25
25
|
if (k2 === undefined) k2 = k;
|
|
26
26
|
o[k2] = m[k];
|
|
27
27
|
}));
|
|
28
|
-
var __exportStar = (fields && fields.__exportStar) || function(m, exports) {
|
|
29
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
|
+
var __exportStar = (fields && fields.__exportStar) || function(m, exports$1) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
30
30
|
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
__exportStar(requireTypes(), exports);
|
|
33
|
-
__exportStar(requireCronDayOfMonth(), exports);
|
|
34
|
-
__exportStar(requireCronDayOfWeek(), exports);
|
|
35
|
-
__exportStar(requireCronField(), exports);
|
|
36
|
-
__exportStar(requireCronHour(), exports);
|
|
37
|
-
__exportStar(requireCronMinute(), exports);
|
|
38
|
-
__exportStar(requireCronMonth(), exports);
|
|
39
|
-
__exportStar(requireCronSecond(), exports);
|
|
31
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
32
|
+
__exportStar(requireTypes(), exports$1);
|
|
33
|
+
__exportStar(requireCronDayOfMonth(), exports$1);
|
|
34
|
+
__exportStar(requireCronDayOfWeek(), exports$1);
|
|
35
|
+
__exportStar(requireCronField(), exports$1);
|
|
36
|
+
__exportStar(requireCronHour(), exports$1);
|
|
37
|
+
__exportStar(requireCronMinute(), exports$1);
|
|
38
|
+
__exportStar(requireCronMonth(), exports$1);
|
|
39
|
+
__exportStar(requireCronSecond(), exports$1);
|
|
40
40
|
} (fields));
|
|
41
41
|
return fields;
|
|
42
42
|
}
|
|
@@ -11,7 +11,7 @@ var hasRequiredDist;
|
|
|
11
11
|
function requireDist () {
|
|
12
12
|
if (hasRequiredDist) return dist;
|
|
13
13
|
hasRequiredDist = 1;
|
|
14
|
-
(function (exports) {
|
|
14
|
+
(function (exports$1) {
|
|
15
15
|
var __createBinding = (dist && dist.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
16
|
if (k2 === undefined) k2 = k;
|
|
17
17
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -23,25 +23,25 @@ function requireDist () {
|
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
24
|
o[k2] = m[k];
|
|
25
25
|
}));
|
|
26
|
-
var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
|
|
27
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
var __exportStar = (dist && dist.__exportStar) || function(m, exports$1) {
|
|
27
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
28
28
|
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.CronFileParser = exports.CronExpressionParser = exports.CronExpression = exports.CronFieldCollection = exports.CronDate = void 0;
|
|
29
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
30
|
+
exports$1.CronFileParser = exports$1.CronExpressionParser = exports$1.CronExpression = exports$1.CronFieldCollection = exports$1.CronDate = void 0;
|
|
31
31
|
/* istanbul ignore file */
|
|
32
32
|
const CronExpressionParser_1 = requireCronExpressionParser();
|
|
33
33
|
var CronDate_1 = requireCronDate();
|
|
34
|
-
Object.defineProperty(exports, "CronDate", { enumerable: true, get: function () { return CronDate_1.CronDate; } });
|
|
34
|
+
Object.defineProperty(exports$1, "CronDate", { enumerable: true, get: function () { return CronDate_1.CronDate; } });
|
|
35
35
|
var CronFieldCollection_1 = requireCronFieldCollection();
|
|
36
|
-
Object.defineProperty(exports, "CronFieldCollection", { enumerable: true, get: function () { return CronFieldCollection_1.CronFieldCollection; } });
|
|
36
|
+
Object.defineProperty(exports$1, "CronFieldCollection", { enumerable: true, get: function () { return CronFieldCollection_1.CronFieldCollection; } });
|
|
37
37
|
var CronExpression_1 = requireCronExpression();
|
|
38
|
-
Object.defineProperty(exports, "CronExpression", { enumerable: true, get: function () { return CronExpression_1.CronExpression; } });
|
|
38
|
+
Object.defineProperty(exports$1, "CronExpression", { enumerable: true, get: function () { return CronExpression_1.CronExpression; } });
|
|
39
39
|
var CronExpressionParser_2 = requireCronExpressionParser();
|
|
40
|
-
Object.defineProperty(exports, "CronExpressionParser", { enumerable: true, get: function () { return CronExpressionParser_2.CronExpressionParser; } });
|
|
40
|
+
Object.defineProperty(exports$1, "CronExpressionParser", { enumerable: true, get: function () { return CronExpressionParser_2.CronExpressionParser; } });
|
|
41
41
|
var CronFileParser_1 = requireCronFileParser();
|
|
42
|
-
Object.defineProperty(exports, "CronFileParser", { enumerable: true, get: function () { return CronFileParser_1.CronFileParser; } });
|
|
43
|
-
__exportStar(requireFields(), exports);
|
|
44
|
-
exports.default = CronExpressionParser_1.CronExpressionParser;
|
|
42
|
+
Object.defineProperty(exports$1, "CronFileParser", { enumerable: true, get: function () { return CronFileParser_1.CronFileParser; } });
|
|
43
|
+
__exportStar(requireFields(), exports$1);
|
|
44
|
+
exports$1.default = CronExpressionParser_1.CronExpressionParser;
|
|
45
45
|
} (dist));
|
|
46
46
|
return dist;
|
|
47
47
|
}
|
|
@@ -5924,7 +5924,7 @@ function requireLuxon () {
|
|
|
5924
5924
|
static fromMillis(milliseconds, options = {}) {
|
|
5925
5925
|
if (!isNumber(milliseconds)) {
|
|
5926
5926
|
throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`);
|
|
5927
|
-
} else if (milliseconds < -
|
|
5927
|
+
} else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
|
|
5928
5928
|
// this isn't perfect because we can still end up out of range because of additional shifting, but it's a start
|
|
5929
5929
|
return DateTime.invalid("Timestamp out of range");
|
|
5930
5930
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wabot-dev/framework",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "Framework for IA Chat Bots",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
34
34
|
"@rollup/plugin-typescript": "12.1.2",
|
|
35
35
|
"prettier": "^3.5.3",
|
|
36
|
-
"rollup": "4.
|
|
36
|
+
"rollup": "^4.60.0",
|
|
37
37
|
"tsup": "^8.4.0",
|
|
38
38
|
"typescript": "5.8.3"
|
|
39
39
|
},
|