UNPKG

n8n-nodes-lhdn-einvoice

Version:

n8n node untuk integrasi dengan LHDN e-Invoice API Malaysia

112 lines (111 loc) 3.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LhdnEInvoiceApi = void 0; class LhdnEInvoiceApi { constructor() { this.name = 'lhdnEInvoiceApi'; this.displayName = 'LHDN e-Invoice API'; this.documentationUrl = 'https://sdk.myinvois.hasil.gov.my/'; this.properties = [ { displayName: 'Environment', name: 'environment', type: 'options', options: [ { name: 'Sandbox', value: 'sandbox', }, { name: 'Production', value: 'production', }, ], default: 'sandbox', description: 'Environment untuk API LHDN e-Invoice', }, { displayName: 'Client ID', name: 'clientId', type: 'string', default: '', required: true, description: 'Client ID untuk API LHDN e-Invoice', }, { displayName: 'Client Secret', name: 'clientSecret', type: 'string', typeOptions: { password: true, }, default: '', required: true, description: 'Client Secret untuk API LHDN e-Invoice', }, { displayName: 'X.509 Certificate', name: 'x509Certificate', type: 'string', typeOptions: { rows: 10, }, default: '', required: true, description: 'X.509 Certificate dalam format PEM', }, { displayName: 'Private Key', name: 'privateKey', type: 'string', typeOptions: { password: true, rows: 10, }, default: '', required: true, description: 'Private Key dalam format PEM', }, { displayName: 'X.509 Subject Name', name: 'x509SubjectName', type: 'string', default: '', required: true, description: 'X.509 Subject Name dari certificate', }, { displayName: 'X.509 Issuer Name', name: 'x509IssuerName', type: 'string', default: '', required: true, description: 'X.509 Issuer Name dari certificate', }, { displayName: 'X.509 Serial Number', name: 'x509SerialNumber', type: 'string', default: '', required: true, description: 'X.509 Serial Number dari certificate', }, ]; this.authenticate = { type: 'generic', properties: { headers: { 'Content-Type': 'application/json', }, }, }; this.test = { request: { baseURL: '={{$credentials.environment === "production" ? "https://api.myinvois.hasil.gov.my" : "https://preprod-api.myinvois.hasil.gov.my"}}', url: '/connect/token', method: 'POST', }, }; } } exports.LhdnEInvoiceApi = LhdnEInvoiceApi;