@joshuanode/n8n-nodes-datto-backup 0.1.0-beta.6 → 0.1.0-beta.8

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.
@@ -0,0 +1,3 @@
1
+ import type { ICredentialDataDecryptedObject, ICredentialTestFunctions, INodeCredentialTestResult } from 'n8n-workflow';
2
+ export declare function testDattoCredentials(this: ICredentialTestFunctions, credential: ICredentialDataDecryptedObject): Promise<INodeCredentialTestResult>;
3
+ //# sourceMappingURL=CredentialTester.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialTester.d.ts","sourceRoot":"","sources":["../../credentials/CredentialTester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,cAAc,CAAC;AAEtB,wBAAsB,oBAAoB,CACzC,IAAI,EAAE,wBAAwB,EAC9B,UAAU,EAAE,8BAA8B,GACxC,OAAO,CAAC,yBAAyB,CAAC,CA8BpC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testDattoCredentials = testDattoCredentials;
4
+ async function testDattoCredentials(credential) {
5
+ const publicKey = credential.publicKey.trim();
6
+ const secretKey = credential.secretKey.trim();
7
+ const authHeader = `Basic ${Buffer.from(`${publicKey}:${secretKey}`).toString('base64')}`;
8
+ try {
9
+ await this.helpers.request({
10
+ method: 'GET',
11
+ url: 'https://api.datto.com/v1/bcdr/device',
12
+ qs: {
13
+ _page: 1,
14
+ _perPage: 1,
15
+ },
16
+ headers: {
17
+ Authorization: authHeader,
18
+ },
19
+ json: true,
20
+ });
21
+ return {
22
+ status: 'OK',
23
+ message: 'Connection successful!',
24
+ };
25
+ }
26
+ catch (error) {
27
+ return {
28
+ status: 'Error',
29
+ message: `Connection failed: ${error.message}`,
30
+ };
31
+ }
32
+ }
33
+ //# sourceMappingURL=CredentialTester.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialTester.js","sourceRoot":"","sources":["../../credentials/CredentialTester.ts"],"names":[],"mappings":";;AAMA,oDAiCC;AAjCM,KAAK,UAAU,oBAAoB,CAEzC,UAA0C;IAE1C,MAAM,SAAS,GAAI,UAAU,CAAC,SAAoB,CAAC,IAAI,EAAE,CAAC;IAC1D,MAAM,SAAS,GAAI,UAAU,CAAC,SAAoB,CAAC,IAAI,EAAE,CAAC;IAE1D,MAAM,UAAU,GAAG,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IAE1F,IAAI,CAAC;QACJ,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAC1B,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,sCAAsC;YAC3C,EAAE,EAAE;gBACH,KAAK,EAAE,CAAC;gBACR,QAAQ,EAAE,CAAC;aACX;YACD,OAAO,EAAE;gBACR,aAAa,EAAE,UAAU;aACzB;YACD,IAAI,EAAE,IAAI;SACV,CAAC,CAAC;QAEH,OAAO;YACN,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,wBAAwB;SACjC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO;YACN,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,sBAAuB,KAAe,CAAC,OAAO,EAAE;SACzD,CAAC;IACH,CAAC;AACF,CAAC"}
@@ -1,15 +1,28 @@
1
- import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
1
+ import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ import { testDattoCredentials } from './CredentialTester';
2
3
  export declare class DattoBackupApi implements ICredentialType {
3
4
  name: string;
4
5
  displayName: string;
5
6
  documentationUrl: string;
6
- extends: string[];
7
7
  icon: {
8
8
  readonly light: "file:../nodes/DattoBackup/dattobackup.svg";
9
9
  readonly dark: "file:../nodes/DattoBackup/dattobackup.svg";
10
10
  };
11
11
  properties: INodeProperties[];
12
- authenticate: IAuthenticateGeneric;
13
- test: ICredentialTestRequest;
12
+ test: {
13
+ request: {
14
+ baseURL: string;
15
+ url: string;
16
+ method: "GET";
17
+ qs: {
18
+ _page: number;
19
+ _perPage: number;
20
+ };
21
+ };
22
+ };
23
+ testedBy: {
24
+ credentialType: string;
25
+ testRequest: typeof testDattoCredentials;
26
+ };
14
27
  }
15
28
  //# sourceMappingURL=DattoBackupApi.credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DattoBackupApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/DattoBackupApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,cAAe,YAAW,eAAe;IACrD,IAAI,SAAoB;IAExB,WAAW,SAAsB;IAEjC,gBAAgB,SAAqD;IAErE,OAAO,WAAqB;IAE5B,IAAI;;;MAGO;IAEX,UAAU,EAAE,eAAe,EAAE,CAoB3B;IAEF,YAAY,EAAE,oBAAoB,CAQhC;IAEF,IAAI,EAAE,sBAAsB,CAU1B;CACF"}
1
+ {"version":3,"file":"DattoBackupApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/DattoBackupApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,qBAAa,cAAe,YAAW,eAAe;IACrD,IAAI,SAAoB;IAExB,WAAW,SAAsB;IAEjC,gBAAgB,SAAqD;IAErE,IAAI;;;MAGO;IAEX,UAAU,EAAE,eAAe,EAAE,CAoB3B;IAEF,IAAI;;;;;;;;;;MAUF;IAGF,QAAQ;;;MAGN;CACF"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DattoBackupApi = void 0;
4
+ const CredentialTester_1 = require("./CredentialTester");
4
5
  class DattoBackupApi {
5
6
  name = 'dattoBackupApi';
6
7
  displayName = 'Datto Backup API';
7
8
  documentationUrl = 'https://portal.dattobackup.com/integrations/api';
8
- extends = ['httpBasicAuth'];
9
9
  icon = {
10
10
  light: 'file:../nodes/DattoBackup/dattobackup.svg',
11
11
  dark: 'file:../nodes/DattoBackup/dattobackup.svg',
@@ -13,7 +13,7 @@ class DattoBackupApi {
13
13
  properties = [
14
14
  {
15
15
  displayName: 'Public API Key',
16
- name: 'user',
16
+ name: 'publicKey',
17
17
  type: 'string',
18
18
  default: '',
19
19
  required: true,
@@ -21,7 +21,7 @@ class DattoBackupApi {
21
21
  },
22
22
  {
23
23
  displayName: 'Secret API Key',
24
- name: 'password',
24
+ name: 'secretKey',
25
25
  type: 'string',
26
26
  typeOptions: {
27
27
  password: true,
@@ -31,14 +31,6 @@ class DattoBackupApi {
31
31
  description: 'The Secret API Key from Datto Partner Portal (Admin > Integrations > API Keys)',
32
32
  },
33
33
  ];
34
- authenticate = {
35
- type: 'generic',
36
- properties: {
37
- headers: {
38
- Authorization: '={{`Basic ${Buffer.from($credentials.user + ":" + $credentials.password).toString("base64")}`}}',
39
- },
40
- },
41
- };
42
34
  test = {
43
35
  request: {
44
36
  baseURL: 'https://api.datto.com/v1',
@@ -50,6 +42,11 @@ class DattoBackupApi {
50
42
  },
51
43
  },
52
44
  };
45
+ // Custom credential tester that runs in full Node.js context
46
+ testedBy = {
47
+ credentialType: 'dattoBackupApi',
48
+ testRequest: CredentialTester_1.testDattoCredentials,
49
+ };
53
50
  }
54
51
  exports.DattoBackupApi = DattoBackupApi;
55
52
  //# sourceMappingURL=DattoBackupApi.credentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DattoBackupApi.credentials.js","sourceRoot":"","sources":["../../credentials/DattoBackupApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,cAAc;IAC1B,IAAI,GAAG,gBAAgB,CAAC;IAExB,WAAW,GAAG,kBAAkB,CAAC;IAEjC,gBAAgB,GAAG,iDAAiD,CAAC;IAErE,OAAO,GAAG,CAAC,eAAe,CAAC,CAAC;IAE5B,IAAI,GAAG;QACN,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,2CAA2C;KACxC,CAAC;IAEX,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gFAAgF;SAC7F;QACD;YACC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gFAAgF;SAC7F;KACD,CAAC;IAEF,YAAY,GAAyB;QACpC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE;YACX,OAAO,EAAE;gBACR,aAAa,EACZ,iGAAiG;aAClG;SACD;KACD,CAAC;IAEF,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,OAAO,EAAE,0BAA0B;YACnC,GAAG,EAAE,cAAc;YACnB,MAAM,EAAE,KAAK;YACb,EAAE,EAAE;gBACH,KAAK,EAAE,CAAC;gBACR,QAAQ,EAAE,CAAC;aACX;SACD;KACD,CAAC;CACF;AAzDD,wCAyDC"}
1
+ {"version":3,"file":"DattoBackupApi.credentials.js","sourceRoot":"","sources":["../../credentials/DattoBackupApi.credentials.ts"],"names":[],"mappings":";;;AAKA,yDAA0D;AAE1D,MAAa,cAAc;IAC1B,IAAI,GAAG,gBAAgB,CAAC;IAExB,WAAW,GAAG,kBAAkB,CAAC;IAEjC,gBAAgB,GAAG,iDAAiD,CAAC;IAErE,IAAI,GAAG;QACN,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,2CAA2C;KACxC,CAAC;IAEX,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gFAAgF;SAC7F;QACD;YACC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gFAAgF;SAC7F;KACD,CAAC;IAEF,IAAI,GAAG;QACN,OAAO,EAAE;YACR,OAAO,EAAE,0BAA0B;YACnC,GAAG,EAAE,cAAc;YACnB,MAAM,EAAE,KAAc;YACtB,EAAE,EAAE;gBACH,KAAK,EAAE,CAAC;gBACR,QAAQ,EAAE,CAAC;aACX;SACD;KACD,CAAC;IAEF,6DAA6D;IAC7D,QAAQ,GAAG;QACV,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,uCAAoB;KACjC,CAAC;CACF;AAnDD,wCAmDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshuanode/n8n-nodes-datto-backup",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.8",
4
4
  "description": "n8n community node for Datto BCDR (Backup, Continuity & Disaster Recovery) API",
5
5
  "license": "MIT",
6
6
  "keywords": [