tpmkms_4wp 9.3.0-beta.50 → 9.3.0-beta.51
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/common/dateTimeSelectors.instance.json +42 -5
- package/common/dateTimeSelectors.js +11 -9
- package/common/dateTimeSelectors.test.json +5966 -0
- package/common/dates.instance.json +110 -7
- package/common/dates.js +72 -13
- package/common/dates.test.json +2064 -53
- package/common/dialogues.js +3 -3
- package/common/fastfood.instance.json +154 -594
- package/common/helpers/dateTimeSelectors.js +32 -17
- package/common/helpers/dialogues.js +10 -3
- package/common/helpers/properties.js +2 -2
- package/common/helpers.js +36 -28
- package/common/hierarchy.js +9 -9
- package/common/meta.js +2 -2
- package/common/people.instance.json +36 -0
- package/common/properties.js +4 -4
- package/common/reminders.instance.json +1 -1
- package/common/reminders.js +4 -4
- package/common/reminders.test.json +4949 -0
- package/common/reports.instance.json +1 -1
- package/common/temperature.instance.json +112 -0
- package/common/time.js +2 -2
- package/package.json +2 -2
@@ -3,13 +3,14 @@
|
|
3
3
|
{
|
4
4
|
"operators": [
|
5
5
|
"([dateTimeSelector] (onDate) (atTime))",
|
6
|
-
"((day_dates/*) [dayOfMonth|of] (month_dates/*))"
|
6
|
+
"((day_dates/*) [dayOfMonth|of] (month_dates/*))",
|
7
|
+
"((day_dates/*) [dayAfterDate|after] (afterDateValue_dates/*))"
|
7
8
|
],
|
8
9
|
"bridges": [
|
9
10
|
{
|
10
11
|
"id": "dayOfMonth",
|
11
12
|
"after": [
|
12
|
-
"
|
13
|
+
"article"
|
13
14
|
],
|
14
15
|
"isA": [
|
15
16
|
"onDateValue_dates"
|
@@ -20,6 +21,21 @@
|
|
20
21
|
],
|
21
22
|
"bridge": "{ ...next(operator), day: before[0], month: after[0], operator: operator, interpolate: '${day} ${operator} ${month}' }"
|
22
23
|
},
|
24
|
+
{
|
25
|
+
"id": "dayAfterDate",
|
26
|
+
"after": [
|
27
|
+
"article",
|
28
|
+
"monthDayYear_dates"
|
29
|
+
],
|
30
|
+
"isA": [
|
31
|
+
"onDateValue_dates"
|
32
|
+
],
|
33
|
+
"before": [
|
34
|
+
"verb",
|
35
|
+
"afterDate_dates"
|
36
|
+
],
|
37
|
+
"bridge": "{ ...next(operator), day: before[0], after: after[0], operator: operator, interpolate: '${day} ${operator} ${after}' }"
|
38
|
+
},
|
23
39
|
{
|
24
40
|
"id": "dateTimeSelector",
|
25
41
|
"after": [
|
@@ -38,9 +54,13 @@
|
|
38
54
|
}
|
39
55
|
],
|
40
56
|
"semantics": [
|
57
|
+
{
|
58
|
+
"match": "({context, isA}) => context.evaluate && onOrIs('dayAfterDate', context)",
|
59
|
+
"apply": "async ({context, isProcess, isTest, kms, isA, e}) => {\n try {\n const now = kms.time.api.now()\n const date = afterOrIs('dayAfterDate', context)\n const afterISO = (await e(date.after)).evalue\n const day_ordinal = date.day.day_ordinal\n const ordinal = date.day.ordinal.value\n context.evalue = dateTimeSelectors_helpers.getNthWeekdayAfterDate(afterISO, day_ordinal, ordinal)\n } catch ( e ) {\n context.evalue = `Implement instatiate for this type of date. See the dateTimeSelectors KM ${where()}. ${e}`\n }\n }"
|
60
|
+
},
|
41
61
|
{
|
42
62
|
"match": "({context, isA}) => context.evaluate && onOrIs('dayOfMonth', context)",
|
43
|
-
"apply": "({context, isProcess, isTest, kms, isA}) => {\n try {\n const now = kms.time.api.now()\n const date = onOrIs('dayOfMonth', context)\n
|
63
|
+
"apply": "({context, isProcess, isTest, kms, isA}) => {\n try {\n const now = kms.time.api.now()\n const date = onOrIs('dayOfMonth', context)\n context.evalue = dateTimeSelectors_helpers.getNthDayOfMonth(removeDatesSuffix(date.day.value), date.day.ordinal.value || 1, removeDatesSuffix(date.month.value), now)\n } catch ( e ) {\n context.evalue = `Implement instatiate for this type of date. See the dateTimeSelectors KM ${where()}. ${e}`\n }\n }"
|
44
64
|
},
|
45
65
|
{
|
46
66
|
"match": "({context, isA}) => {\n if (!context.evaluate) {\n return false\n }\n if (isA(context.marker, 'onDateValue_dates')) {\n return true\n }\n if (isA(context.marker, 'dateTimeSelector')) {\n return true\n }\n }",
|
@@ -60,13 +80,14 @@
|
|
60
80
|
"extraConfig": true,
|
61
81
|
"operators": [
|
62
82
|
"([dateTimeSelector] (onDate) (atTime))",
|
63
|
-
"((day_dates/*) [dayOfMonth|of] (month_dates/*))"
|
83
|
+
"((day_dates/*) [dayOfMonth|of] (month_dates/*))",
|
84
|
+
"((day_dates/*) [dayAfterDate|after] (afterDateValue_dates/*))"
|
64
85
|
],
|
65
86
|
"bridges": [
|
66
87
|
{
|
67
88
|
"id": "dayOfMonth",
|
68
89
|
"after": [
|
69
|
-
"
|
90
|
+
"article"
|
70
91
|
],
|
71
92
|
"isA": [
|
72
93
|
"onDateValue_dates"
|
@@ -77,6 +98,21 @@
|
|
77
98
|
],
|
78
99
|
"bridge": "{ ...next(operator), day: before[0], month: after[0], operator: operator, interpolate: '${day} ${operator} ${month}' }"
|
79
100
|
},
|
101
|
+
{
|
102
|
+
"id": "dayAfterDate",
|
103
|
+
"after": [
|
104
|
+
"article",
|
105
|
+
"monthDayYear_dates"
|
106
|
+
],
|
107
|
+
"isA": [
|
108
|
+
"onDateValue_dates"
|
109
|
+
],
|
110
|
+
"before": [
|
111
|
+
"verb",
|
112
|
+
"afterDate_dates"
|
113
|
+
],
|
114
|
+
"bridge": "{ ...next(operator), day: before[0], after: after[0], operator: operator, interpolate: '${day} ${operator} ${after}' }"
|
115
|
+
},
|
80
116
|
{
|
81
117
|
"id": "dateTimeSelector",
|
82
118
|
"after": [
|
@@ -95,6 +131,7 @@
|
|
95
131
|
}
|
96
132
|
],
|
97
133
|
"semantics": [
|
134
|
+
{},
|
98
135
|
{},
|
99
136
|
{}
|
100
137
|
],
|
@@ -52,7 +52,7 @@ function afterOrIs(marker, context) {
|
|
52
52
|
if (context.marker === marker) {
|
53
53
|
return context
|
54
54
|
}
|
55
|
-
if (context.marker === '
|
55
|
+
if (context.marker === 'onDate_dates' && context.date?.marker == marker) {
|
56
56
|
return context.date
|
57
57
|
}
|
58
58
|
}
|
@@ -76,7 +76,7 @@ const template = {
|
|
76
76
|
{
|
77
77
|
id: 'dayAfterDate',
|
78
78
|
after: ['article', 'monthDayYear_dates'],
|
79
|
-
isA: ['
|
79
|
+
isA: ['onDateValue_dates'],
|
80
80
|
before: ['verb', 'afterDate_dates'],
|
81
81
|
bridge: "{ ...next(operator), day: before[0], after: after[0], operator: operator, interpolate: '${day} ${operator} ${after}' }",
|
82
82
|
},
|
@@ -92,12 +92,14 @@ const template = {
|
|
92
92
|
semantics: [
|
93
93
|
{
|
94
94
|
match: ({context, isA}) => context.evaluate && onOrIs('dayAfterDate', context),
|
95
|
-
apply: ({context, isProcess, isTest, kms, isA}) => {
|
95
|
+
apply: async ({context, isProcess, isTest, kms, isA, e}) => {
|
96
96
|
try {
|
97
97
|
const now = kms.time.api.now()
|
98
|
-
|
99
|
-
const
|
100
|
-
|
98
|
+
const date = afterOrIs('dayAfterDate', context)
|
99
|
+
const afterISO = (await e(date.after)).evalue
|
100
|
+
const day_ordinal = date.day.day_ordinal
|
101
|
+
const ordinal = date.day.ordinal.value
|
102
|
+
context.evalue = dateTimeSelectors_helpers.getNthWeekdayAfterDate(afterISO, day_ordinal, ordinal)
|
101
103
|
} catch ( e ) {
|
102
104
|
context.evalue = `Implement instatiate for this type of date. See the dateTimeSelectors KM ${where()}. ${e}`
|
103
105
|
}
|
@@ -153,9 +155,9 @@ knowledgeModule( {
|
|
153
155
|
'date', 'time', 'response',
|
154
156
|
{
|
155
157
|
value: {
|
156
|
-
date: 'defaults',
|
157
|
-
time: 'defaults',
|
158
|
-
evalue: 'defaults'
|
158
|
+
date: { variable: 'defaults' },
|
159
|
+
time: { variable: 'defaults' },
|
160
|
+
evalue: { variable: 'defaults' },
|
159
161
|
},
|
160
162
|
}
|
161
163
|
]),
|