@pokash/n8n-nodes-ksef 1.10.2 → 1.10.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.
@@ -1,7 +1,8 @@
1
- import { ICredentialType, INodeProperties } from 'n8n-workflow';
1
+ import { ICredentialType, INodeProperties, ICredentialTestRequest } from 'n8n-workflow';
2
2
  export declare class KsefApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
5
  documentationUrl: string;
6
+ test: ICredentialTestRequest;
6
7
  properties: INodeProperties[];
7
8
  }
@@ -6,6 +6,30 @@ class KsefApi {
6
6
  this.name = 'ksefApi';
7
7
  this.displayName = 'KSeF API';
8
8
  this.documentationUrl = 'https://ksef.mf.gov.pl/';
9
+ // Test credential by validating license
10
+ this.test = {
11
+ request: {
12
+ baseURL: 'https://license.pokash.cloud/api/v1',
13
+ url: '/validate',
14
+ method: 'POST',
15
+ body: {
16
+ licenseKey: '={{$credentials.licenseKey}}',
17
+ nip: '={{$credentials.nip}}',
18
+ product: 'n8n-nodes-ksef',
19
+ version: '1.10.0'
20
+ },
21
+ },
22
+ rules: [
23
+ {
24
+ type: 'responseSuccessBody',
25
+ properties: {
26
+ key: 'valid',
27
+ value: true,
28
+ message: 'License validation failed. Check your license key and NIP.',
29
+ },
30
+ },
31
+ ],
32
+ };
9
33
  this.properties = [
10
34
  {
11
35
  displayName: 'License Key',