n8n-nodes-nashir 0.4.0 → 0.5.0
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/README.md +10 -0
- package/dist/nodes/NashirContact/NashirContact.node.d.ts.map +1 -1
- package/dist/nodes/NashirContact/NashirContact.node.js +33 -0
- package/dist/nodes/NashirContact/NashirContact.node.js.map +1 -1
- package/nodes/NashirContact/NashirContact.node.ts +41 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ n8n-nodes-nashir
|
|
|
34
34
|
|-----------|-------------|
|
|
35
35
|
| Get Contact | Fetch contact details by phone number |
|
|
36
36
|
| **Update Contact Tags** | Add tags to a contact (idempotent, comma-separated) |
|
|
37
|
+
| **Get Conversation History** | Fetch recent messages by sender id for AI agent context (cross-platform: FB / IG / WhatsApp) |
|
|
37
38
|
|
|
38
39
|
### Nashir Facebook
|
|
39
40
|
|
|
@@ -99,6 +100,15 @@ This workflow fetches the last 10 messages for an inbound WhatsApp number and pa
|
|
|
99
100
|
|
|
100
101
|
## Changelog
|
|
101
102
|
|
|
103
|
+
### 0.5.0 — Apr 2026
|
|
104
|
+
|
|
105
|
+
**New operation: Get Conversation History on `Nashir Contact`**
|
|
106
|
+
|
|
107
|
+
- **Get Conversation History** on `Nashir Contact` — fetch the last N messages exchanged with a sender across any platform (FB Messenger, IG Direct, FB/IG comments, WhatsApp). Returns chronological `{ role, content, created_at }` rows ready to inject into an AI agent prompt.
|
|
108
|
+
- Inputs: `senderId` (required — the platform-specific sender id from the inbound webhook payload) and `limit` (default 20, max 50).
|
|
109
|
+
- Backed by `GET /api/v1/conversations/by-sender/:sender_id?limit=N` on nashir.ai.
|
|
110
|
+
- Used by the v2 AI Auto Reply template to replace the n8n `memoryBufferWindow` step — history is now persisted server-side in `inbox_messages` and shared across workflow executions.
|
|
111
|
+
|
|
102
112
|
### 0.4.0 — Apr 2026
|
|
103
113
|
|
|
104
114
|
**New operation: Delete Comment (Facebook + Instagram)**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NashirContact.node.d.ts","sourceRoot":"","sources":["../../../nodes/NashirContact/NashirContact.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAItB,qBAAa,aAAc,YAAW,SAAS;IAC9C,WAAW,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"NashirContact.node.d.ts","sourceRoot":"","sources":["../../../nodes/NashirContact/NashirContact.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAItB,qBAAa,aAAc,YAAW,SAAS;IAC9C,WAAW,EAAE,oBAAoB,CA+E/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAmDvE"}
|
|
@@ -25,6 +25,11 @@ class NashirContact {
|
|
|
25
25
|
options: [
|
|
26
26
|
{ name: 'Get Contact', value: 'getContact', action: 'Get contact details' },
|
|
27
27
|
{ name: 'Update Contact Tags', value: 'updateTags', action: 'Add tags to a contact' },
|
|
28
|
+
{
|
|
29
|
+
name: 'Get Conversation History',
|
|
30
|
+
value: 'getConversationHistory',
|
|
31
|
+
action: 'Fetch recent messages with a contact for AI agent context',
|
|
32
|
+
},
|
|
28
33
|
],
|
|
29
34
|
default: 'getContact',
|
|
30
35
|
},
|
|
@@ -50,6 +55,29 @@ class NashirContact {
|
|
|
50
55
|
description: 'Comma-separated list of tags to apply to the contact (idempotent)',
|
|
51
56
|
displayOptions: { show: { operation: ['updateTags'] } },
|
|
52
57
|
},
|
|
58
|
+
// ── Get Conversation History fields ──────────────────────────────────────
|
|
59
|
+
// Cross-platform: senderId is whatever Meta / WhatsApp sent in the inbound
|
|
60
|
+
// webhook payload (FB/IG numeric user id, WA phone, etc.). The backend
|
|
61
|
+
// scopes the query to this team's rows automatically.
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Sender ID',
|
|
64
|
+
name: 'senderId',
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: '',
|
|
67
|
+
required: true,
|
|
68
|
+
placeholder: '={{ $json.body.sender_id }}',
|
|
69
|
+
description: 'Platform-specific sender id from the inbound webhook (FB/IG user id or WhatsApp phone). Used as the lookup key in inbox_messages.',
|
|
70
|
+
displayOptions: { show: { operation: ['getConversationHistory'] } },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Limit',
|
|
74
|
+
name: 'limit',
|
|
75
|
+
type: 'number',
|
|
76
|
+
typeOptions: { minValue: 1, maxValue: 50 },
|
|
77
|
+
default: 20,
|
|
78
|
+
description: 'How many recent messages to return (oldest → newest). Capped at 50 server-side.',
|
|
79
|
+
displayOptions: { show: { operation: ['getConversationHistory'] } },
|
|
80
|
+
},
|
|
53
81
|
],
|
|
54
82
|
};
|
|
55
83
|
}
|
|
@@ -73,6 +101,11 @@ class NashirContact {
|
|
|
73
101
|
.filter(Boolean);
|
|
74
102
|
responseData = await (0, api_1.nashirApiRequest)(this, 'POST', `/contacts/${phone}/tags`, { tags });
|
|
75
103
|
}
|
|
104
|
+
else if (operation === 'getConversationHistory') {
|
|
105
|
+
const senderId = encodeURIComponent(this.getNodeParameter('senderId', i));
|
|
106
|
+
const limit = this.getNodeParameter('limit', i, 20);
|
|
107
|
+
responseData = await (0, api_1.nashirApiRequest)(this, 'GET', `/conversations/by-sender/${senderId}`, undefined, { limit });
|
|
108
|
+
}
|
|
76
109
|
else {
|
|
77
110
|
throw new Error(`Unknown operation: ${operation}`);
|
|
78
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NashirContact.node.js","sourceRoot":"","sources":["../../../nodes/NashirContact/NashirContact.node.ts"],"names":[],"mappings":";;;AAQA,uCAAiD;AAEjD,MAAa,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AAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAEnE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC9E,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AArID,sCAqIC"}
|
|
@@ -30,6 +30,11 @@ export class NashirContact implements INodeType {
|
|
|
30
30
|
options: [
|
|
31
31
|
{ name: 'Get Contact', value: 'getContact', action: 'Get contact details' },
|
|
32
32
|
{ name: 'Update Contact Tags', value: 'updateTags', action: 'Add tags to a contact' },
|
|
33
|
+
{
|
|
34
|
+
name: 'Get Conversation History',
|
|
35
|
+
value: 'getConversationHistory',
|
|
36
|
+
action: 'Fetch recent messages with a contact for AI agent context',
|
|
37
|
+
},
|
|
33
38
|
],
|
|
34
39
|
default: 'getContact',
|
|
35
40
|
},
|
|
@@ -57,6 +62,31 @@ export class NashirContact implements INodeType {
|
|
|
57
62
|
description: 'Comma-separated list of tags to apply to the contact (idempotent)',
|
|
58
63
|
displayOptions: { show: { operation: ['updateTags'] } },
|
|
59
64
|
},
|
|
65
|
+
|
|
66
|
+
// ── Get Conversation History fields ──────────────────────────────────────
|
|
67
|
+
// Cross-platform: senderId is whatever Meta / WhatsApp sent in the inbound
|
|
68
|
+
// webhook payload (FB/IG numeric user id, WA phone, etc.). The backend
|
|
69
|
+
// scopes the query to this team's rows automatically.
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Sender ID',
|
|
72
|
+
name: 'senderId',
|
|
73
|
+
type: 'string',
|
|
74
|
+
default: '',
|
|
75
|
+
required: true,
|
|
76
|
+
placeholder: '={{ $json.body.sender_id }}',
|
|
77
|
+
description:
|
|
78
|
+
'Platform-specific sender id from the inbound webhook (FB/IG user id or WhatsApp phone). Used as the lookup key in inbox_messages.',
|
|
79
|
+
displayOptions: { show: { operation: ['getConversationHistory'] } },
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Limit',
|
|
83
|
+
name: 'limit',
|
|
84
|
+
type: 'number',
|
|
85
|
+
typeOptions: { minValue: 1, maxValue: 50 },
|
|
86
|
+
default: 20,
|
|
87
|
+
description: 'How many recent messages to return (oldest → newest). Capped at 50 server-side.',
|
|
88
|
+
displayOptions: { show: { operation: ['getConversationHistory'] } },
|
|
89
|
+
},
|
|
60
90
|
],
|
|
61
91
|
};
|
|
62
92
|
|
|
@@ -82,6 +112,17 @@ export class NashirContact implements INodeType {
|
|
|
82
112
|
.filter(Boolean);
|
|
83
113
|
responseData = await nashirApiRequest(this, 'POST', `/contacts/${phone}/tags`, { tags });
|
|
84
114
|
|
|
115
|
+
} else if (operation === 'getConversationHistory') {
|
|
116
|
+
const senderId = encodeURIComponent(this.getNodeParameter('senderId', i) as string);
|
|
117
|
+
const limit = this.getNodeParameter('limit', i, 20) as number;
|
|
118
|
+
responseData = await nashirApiRequest(
|
|
119
|
+
this,
|
|
120
|
+
'GET',
|
|
121
|
+
`/conversations/by-sender/${senderId}`,
|
|
122
|
+
undefined,
|
|
123
|
+
{ limit },
|
|
124
|
+
);
|
|
125
|
+
|
|
85
126
|
} else {
|
|
86
127
|
throw new Error(`Unknown operation: ${operation}`);
|
|
87
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-nashir",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "n8n community nodes for nashir.ai — publish to Facebook, Instagram, TikTok, LinkedIn, YouTube, WhatsApp and Telegram, plus AI conversation management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|