@alexein/n8n-nodes-alexein 0.3.1 → 0.3.3
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.
|
@@ -154,7 +154,7 @@ exports.operations = [
|
|
|
154
154
|
default: '',
|
|
155
155
|
placeholder: 'e.g. user_42',
|
|
156
156
|
displayOptions: { hide: { operation: ['users'] } },
|
|
157
|
-
description:
|
|
157
|
+
description: 'Your ID for the person whose memory this is, usually an expression from the trigger, such as the Telegram user. Each app user has a memory of their own. Any ID you already have, such as a UUID or an email address: up to 128 characters, ASCII only.',
|
|
158
158
|
},
|
|
159
159
|
];
|
|
160
160
|
const origin = [
|
|
@@ -21,11 +21,11 @@ exports.PAGED = {
|
|
|
21
21
|
};
|
|
22
22
|
const host = (baseUrl) => String(baseUrl !== null && baseUrl !== void 0 ? baseUrl : '').replace(/(?:\/v2)?\/*$/, '');
|
|
23
23
|
exports.host = host;
|
|
24
|
-
const USER_ID = /^[
|
|
24
|
+
const USER_ID = /^[!-~](?:[ -~]{0,126}[!-~])?$/;
|
|
25
25
|
function checkedUser(value) {
|
|
26
26
|
const user = String(value !== null && value !== void 0 ? value : '').trim();
|
|
27
27
|
if (!USER_ID.test(user)) {
|
|
28
|
-
throw new Error(`App User "${user}" is not a usable ID:
|
|
28
|
+
throw new Error(`App User "${user}" is not a usable ID: up to 128 characters, no control characters, ASCII only`);
|
|
29
29
|
}
|
|
30
30
|
return user;
|
|
31
31
|
}
|
|
@@ -182,6 +182,7 @@ function merged(operation, pages) {
|
|
|
182
182
|
const all = pages.flatMap((p) => (Array.isArray(p[key]) ? p[key] : []));
|
|
183
183
|
return { ...pages[0], [key]: all, next: null };
|
|
184
184
|
}
|
|
185
|
+
const BREAK = /\s*[\r\n]\s*/g;
|
|
185
186
|
function context(answer, maxChars) {
|
|
186
187
|
var _a;
|
|
187
188
|
const memories = Array.isArray(answer.memories) ? answer.memories : [];
|
|
@@ -190,7 +191,10 @@ function context(answer, maxChars) {
|
|
|
190
191
|
let out = '';
|
|
191
192
|
for (const memory of memories) {
|
|
192
193
|
const date = memory.type === 'excerpt' && memory.date ? String(memory.date).slice(0, 10) : '';
|
|
193
|
-
const
|
|
194
|
+
const text = String((_a = memory.text) !== null && _a !== void 0 ? _a : '')
|
|
195
|
+
.trim()
|
|
196
|
+
.replace(BREAK, ' ');
|
|
197
|
+
const line = `- ${date ? `${date}: ` : ''}${text}`;
|
|
194
198
|
const grown = `${out || head}${out ? '\n' : ''}${line}`;
|
|
195
199
|
if (grown.length > maxChars)
|
|
196
200
|
break;
|
package/package.json
CHANGED