n8n-nodes-syncmate 1.0.23 → 1.1.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.
@@ -22,39 +22,9 @@ class WhatsAuto {
22
22
  {
23
23
  name: 'assistroTokenApi',
24
24
  required: true,
25
- displayOptions: {
26
- show: {
27
- authentication: ['jwt'],
28
- },
29
- },
30
- },
31
- {
32
- name: 'assistroOAuth2Api',
33
- required: true,
34
- displayOptions: {
35
- show: {
36
- authentication: ['oAuth2'],
37
- },
38
- },
39
25
  },
40
26
  ],
41
27
  properties: [
42
- {
43
- displayName: 'Authentication',
44
- name: 'authentication',
45
- type: 'options',
46
- options: [
47
- {
48
- name: 'API Token (JWT)',
49
- value: 'jwt',
50
- },
51
- {
52
- name: 'OAuth2',
53
- value: 'oAuth2',
54
- },
55
- ],
56
- default: 'jwt',
57
- },
58
28
  {
59
29
  displayName: 'Resource',
60
30
  name: 'resource',
@@ -230,7 +200,6 @@ class WhatsAuto {
230
200
  var _a;
231
201
  const items = this.getInputData();
232
202
  const returnData = [];
233
- const authMethod = this.getNodeParameter('authentication', 0);
234
203
  for (let i = 0; i < items.length; i++) {
235
204
  try {
236
205
  const operation = this.getNodeParameter('operation', i);
@@ -289,13 +258,7 @@ class WhatsAuto {
289
258
  }],
290
259
  };
291
260
  }
292
- let endpointUri = '';
293
- if (authMethod === 'oAuth2') {
294
- endpointUri = 'https://app.assistro.co/api/v1/wapushplus/singlePass/message';
295
- }
296
- else {
297
- endpointUri = 'https://app.assistro.co/api/v1/wapushplus/single/message';
298
- }
261
+ const endpointUri = 'https://app.assistro.co/api/v1/wapushplus/single/message';
299
262
  const requestOptions = {
300
263
  method: 'POST',
301
264
  url: endpointUri,
@@ -307,14 +270,9 @@ class WhatsAuto {
307
270
  json: true,
308
271
  };
309
272
  let response;
310
- if (authMethod === 'oAuth2') {
311
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'assistroOAuth2Api', requestOptions);
312
- }
313
- else {
314
- const credentials = await this.getCredentials('assistroTokenApi');
315
- requestOptions.headers['Authorization'] = `Bearer ${credentials.accessToken}`;
316
- response = await this.helpers.httpRequest(requestOptions);
317
- }
273
+ const credentials = await this.getCredentials('assistroTokenApi');
274
+ requestOptions.headers['Authorization'] = `Bearer ${credentials.accessToken}`;
275
+ response = await this.helpers.httpRequest(requestOptions);
318
276
  returnData.push({
319
277
  json: response,
320
278
  pairedItem: { item: i },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-syncmate",
3
- "version": "1.0.23",
3
+ "version": "1.1.0",
4
4
  "description": "Send WhatsApp messages or media using SyncMate Assistro API.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -44,7 +44,7 @@
44
44
  "dist/nodes/WhatsAuto/WhatsAuto.node.js"
45
45
  ],
46
46
  "credentials": [
47
- "dist/credentials/AssistroOAuth2Api.credentials.js"
47
+ "dist/credentials/AssistroTokenApi.credentials.js"
48
48
  ]
49
49
  },
50
50
  "devDependencies": {
@@ -1,8 +0,0 @@
1
- import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
- export declare class AssistroOAuth2Api implements ICredentialType {
3
- name: string;
4
- extends: string[];
5
- displayName: string;
6
- documentationUrl: string;
7
- properties: INodeProperties[];
8
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AssistroOAuth2Api = void 0;
4
- class AssistroOAuth2Api {
5
- constructor() {
6
- this.name = 'assistroOAuth2Api';
7
- this.extends = ['oAuth2Api'];
8
- this.displayName = 'Assistro OAuth2 API';
9
- this.documentationUrl = 'https://docs.assistro.co/oauth';
10
- this.properties = [
11
- {
12
- displayName: 'Grant Type',
13
- name: 'grantType',
14
- type: 'hidden',
15
- default: 'authorizationCode',
16
- },
17
- {
18
- displayName: 'Authorization URL',
19
- name: 'authUrl',
20
- type: 'hidden',
21
- default: 'https://app.assistro.co/oauth/authorize',
22
- required: true,
23
- },
24
- {
25
- displayName: 'Access Token URL',
26
- name: 'accessTokenUrl',
27
- type: 'hidden',
28
- default: 'https://app.assistro.co/oauth/token',
29
- required: true,
30
- },
31
- {
32
- displayName: 'Client ID',
33
- name: 'clientId',
34
- type: 'hidden',
35
- default: '7',
36
- required: true,
37
- },
38
- {
39
- displayName: 'Client Secret',
40
- name: 'clientSecret',
41
- type: 'hidden',
42
- typeOptions: { password: true },
43
- default: 'Hu7Q7ruHo9tOp2MEmBvBA45bn5atNESD7naEURHw',
44
- required: true,
45
- },
46
- {
47
- displayName: 'Scope',
48
- name: 'scope',
49
- type: 'hidden',
50
- default: 'all',
51
- },
52
- {
53
- displayName: 'Auth URI Query Parameters',
54
- name: 'authQueryParameters',
55
- type: 'hidden',
56
- default: 'integration_name=n8n',
57
- },
58
- {
59
- displayName: 'Authentication',
60
- name: 'authentication',
61
- type: 'hidden',
62
- default: 'header',
63
- },
64
- ];
65
- }
66
- }
67
- exports.AssistroOAuth2Api = AssistroOAuth2Api;