UNPKG

n8n-nodes-sahabat-xpert

Version:

n8n community node for Sahabat Xpert - Multi-platform business automation with Bizapp integration

149 lines (148 loc) 5.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SahabatXpertCredentials = void 0; class SahabatXpertCredentials { constructor() { this.name = 'sahabatXpertCredentials'; this.displayName = 'Sahabat Xpert Credentials'; this.documentationUrl = 'https://docs.sahabatxpert.my/n8n-integration'; this.properties = [ { displayName: 'Service Type', name: 'serviceType', type: 'options', options: [ { name: 'Bizapp E-commerce', value: 'bizapp', description: 'Bizapp e-commerce API integration', }, { name: 'Payment Gateway', value: 'payment', description: 'Payment processing services', }, { name: 'Shipping API', value: 'shipping', description: 'Shipping and logistics services', }, { name: 'CRM System', value: 'crm', description: 'Customer relationship management', }, ], default: 'bizapp', required: true, description: 'Select the service type for authentication', }, { displayName: 'Bizapp Secret Key', name: 'bizappSecretKey', type: 'string', typeOptions: { password: true, }, default: '', required: true, description: 'The secret key for Bizapp API authentication', displayOptions: { show: { serviceType: ['bizapp'], }, }, }, { displayName: 'Payment API Key', name: 'paymentApiKey', type: 'string', typeOptions: { password: true, }, default: '', required: true, description: 'API key for payment gateway authentication', displayOptions: { show: { serviceType: ['payment'], }, }, }, { displayName: 'Payment API Secret', name: 'paymentApiSecret', type: 'string', typeOptions: { password: true, }, default: '', description: 'API secret for payment gateway (optional)', displayOptions: { show: { serviceType: ['payment'], }, }, }, { displayName: 'Shipping API Token', name: 'shippingToken', type: 'string', typeOptions: { password: true, }, default: '', required: true, description: 'Access token for shipping API authentication', displayOptions: { show: { serviceType: ['shipping'], }, }, }, { displayName: 'CRM Access Token', name: 'crmToken', type: 'string', typeOptions: { password: true, }, default: '', required: true, description: 'Access token for CRM system authentication', displayOptions: { show: { serviceType: ['crm'], }, }, }, { displayName: 'CRM Base URL', name: 'crmBaseUrl', type: 'string', default: '', placeholder: 'https://your-crm-domain.com', description: 'Base URL for your CRM system (optional)', displayOptions: { show: { serviceType: ['crm'], }, }, }, ]; this.authenticate = { type: 'generic', properties: {}, }; this.test = { request: { baseURL: '={{$credentials.serviceType === "bizapp" ? "https://woo.bizapp.my" : "https://api.example.com"}}', url: '={{$credentials.serviceType === "bizapp" ? "/v2/getproductlist/" + ($credentials.bizappSecretKey.startsWith("-") ? $credentials.bizappSecretKey : "-" + $credentials.bizappSecretKey) : "/test"}}', method: 'GET', timeout: 10000, ignoreHttpStatusErrors: true, }, }; } } exports.SahabatXpertCredentials = SahabatXpertCredentials;