n8n-nodes-digit 0.1.16 → 0.1.18
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/nodes/DIGIT.node.js +40 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/nodes/DIGIT.node.js
CHANGED
|
@@ -165,8 +165,8 @@ class DIGIT {
|
|
|
165
165
|
const clientId = this.getNodeParameter('clientId', i);
|
|
166
166
|
const accessToken = this.getNodeParameter('accessToken', i);
|
|
167
167
|
const cleanToken = accessToken.replace(/^Bearer\s+/i, '').trim();
|
|
168
|
-
//
|
|
169
|
-
const boundaryUrl =
|
|
168
|
+
// EXACT gateway URL (same as curl)
|
|
169
|
+
const boundaryUrl = `${baseUrl}/boundary/v1`;
|
|
170
170
|
const apiResponse = await this.helpers.httpRequest({
|
|
171
171
|
method: 'GET',
|
|
172
172
|
url: boundaryUrl,
|
|
@@ -180,6 +180,44 @@ class DIGIT {
|
|
|
180
180
|
},
|
|
181
181
|
json: true,
|
|
182
182
|
});
|
|
183
|
+
returnData.push({
|
|
184
|
+
json: apiResponse,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return [returnData];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// ==================================================
|
|
191
|
+
// NOTIFICATION — SEND EMAIL
|
|
192
|
+
// ==================================================
|
|
193
|
+
if (resource === 'notification') {
|
|
194
|
+
const operation = this.getNodeParameter('notificationOperation', 0);
|
|
195
|
+
if (operation === 'notification_send_email') {
|
|
196
|
+
for (let i = 0; i < items.length; i++) {
|
|
197
|
+
const tenantId = this.getNodeParameter('tenantId', i);
|
|
198
|
+
const accessToken = this.getNodeParameter('accessToken', i);
|
|
199
|
+
const cleanToken = accessToken.replace(/^Bearer\s+/i, '').trim();
|
|
200
|
+
let body;
|
|
201
|
+
try {
|
|
202
|
+
body = JSON.parse(this.getNodeParameter('requestBody', i));
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
throw new Error('Invalid JSON in Request Body');
|
|
206
|
+
}
|
|
207
|
+
// Gateway compatible path
|
|
208
|
+
const notificationPath = '/notification/v1/email/send';
|
|
209
|
+
const apiResponse = await this.helpers.httpRequest({
|
|
210
|
+
method: 'POST',
|
|
211
|
+
url: new URL(notificationPath, baseUrl).toString(),
|
|
212
|
+
headers: {
|
|
213
|
+
'X-Tenant-ID': tenantId,
|
|
214
|
+
Authorization: `Bearer ${cleanToken}`,
|
|
215
|
+
'Content-Type': 'application/json',
|
|
216
|
+
},
|
|
217
|
+
body,
|
|
218
|
+
json: true,
|
|
219
|
+
});
|
|
220
|
+
// Prevent circular reference crash
|
|
183
221
|
returnData.push({
|
|
184
222
|
json: JSON.parse(JSON.stringify(apiResponse)),
|
|
185
223
|
});
|
package/dist/package.json
CHANGED