update version
This commit is contained in:
@@ -80,7 +80,8 @@ async function build() {
|
|||||||
|
|
||||||
console.log("🎉 Build complete!");
|
console.log("🎉 Build complete!");
|
||||||
}
|
}
|
||||||
|
const version = execSync('npm view lodash version').toString().trim();
|
||||||
execSync("cd src && npm version patch", { stdio: 'inherit' })
|
console.log("🚀 Version:", version);
|
||||||
|
execSync("cd src && npm version ", { stdio: 'inherit' })
|
||||||
build()
|
build()
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ async function loadOpenAPI(): Promise<OpenAPI> {
|
|||||||
|
|
||||||
// convert operation to value
|
// convert operation to value
|
||||||
function operationValue(tag: string, operationId: string) {
|
function operationValue(tag: string, operationId: string) {
|
||||||
return `${safe(tag)}_${safe(operationId)}`;
|
return _.snakeCase(`${safe(tag)}_${safe(operationId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// build properties for dropdown + dynamic inputs
|
// build properties for dropdown + dynamic inputs
|
||||||
@@ -55,7 +55,7 @@ function buildPropertiesBlock(ops: Array<any>) {
|
|||||||
options: [
|
options: [
|
||||||
${options.join(',\n ')}
|
${options.join(',\n ')}
|
||||||
],
|
],
|
||||||
default: '${operationValue(ops[0].tag, ops[0].operationId)}',
|
default: '${operationValue(ops[0].tag, ops[0].operationId).replace(/_/g, ' ')}',
|
||||||
description: 'Pilih endpoint yang akan dipanggil'
|
description: 'Pilih endpoint yang akan dipanggil'
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -328,6 +328,10 @@ function packageText({ name, className }: { name: string, className: string }) {
|
|||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
|
|
||||||
|
await fs.rm('src', { recursive: true }).catch(() => { })
|
||||||
|
await fs.mkdir('src/credentials', { recursive: true })
|
||||||
|
await fs.mkdir('src/nodes', { recursive: true })
|
||||||
|
|
||||||
console.log('💡 Loading OpenAPI...');
|
console.log('💡 Loading OpenAPI...');
|
||||||
const api = await loadOpenAPI();
|
const api = await loadOpenAPI();
|
||||||
|
|
||||||
|
|||||||
26
bin/version_update.ts
Normal file
26
bin/version_update.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { execSync } from "node:child_process";
|
||||||
|
const NAMESPACE = process.env.NAMESPACE
|
||||||
|
|
||||||
|
if (!NAMESPACE) {
|
||||||
|
throw new Error('NAMESPACE is required')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. Ambil versi remote dari npm
|
||||||
|
const remoteVersion = execSync(`npm view n8n-nodes-${NAMESPACE} version`)
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
console.log("🔍 Remote version:", remoteVersion);
|
||||||
|
|
||||||
|
// 2. Pecah versi → major.minor.patch
|
||||||
|
const [major, minor, patch] = remoteVersion.split(".").map(Number);
|
||||||
|
|
||||||
|
// 3. Generate versi baru: remote + 1 patch
|
||||||
|
const newLocalVersion = `${major}.${minor}.${patch + 1}`;
|
||||||
|
|
||||||
|
console.log("⬆️ New local version:", newLocalVersion);
|
||||||
|
|
||||||
|
// 4. Update package.json di folder src
|
||||||
|
execSync(`cd src && npm version ${newLocalVersion} --allow-all --force`, {
|
||||||
|
stdio: "inherit",
|
||||||
|
});
|
||||||
@@ -5,9 +5,11 @@
|
|||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"init": "bun bin/init.ts",
|
"init": "bun bin/init.ts",
|
||||||
"generate": "bun bin/generate.ts",
|
|
||||||
"build": "bun bin/build.ts",
|
"build": "bun bin/build.ts",
|
||||||
"publish": "bun bin/publish.ts"
|
"generate": "bun bin/generate.ts",
|
||||||
|
"generate:build": "bun bin/generate.ts && bun bin/build.ts",
|
||||||
|
"version:update": "bun bin/version_update.ts",
|
||||||
|
"publish": "git add -A && git commit -m 'update version' && bun run version:update && bun run build && bun bin/publish.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
# n8n-nodes-wajs
|
|
||||||
|
|
||||||
Node n8n kustom untuk berinteraksi dengan API wajs. Ini adalah node universal yang memungkinkan Anda mengakses berbagai endpoint API wajs untuk mengelola apikey, WhatsApp, webhook, chatflow, dan lainnya.
|
|
||||||
|
|
||||||
## Instalasi
|
|
||||||
|
|
||||||
Untuk menginstal node ini di n8n Anda:
|
|
||||||
|
|
||||||
1. Buka instalasi n8n Anda.
|
|
||||||
2. Pergi ke **Settings > Community Nodes**.
|
|
||||||
3. Klik **Install a community node**.
|
|
||||||
4. Masukkan `n8n-nodes-wajs` dan klik **Install**.
|
|
||||||
|
|
||||||
n8n akan menginstal node, dan setelah itu Anda dapat menggunakannya dalam workflow Anda.
|
|
||||||
|
|
||||||
## Konfigurasi
|
|
||||||
|
|
||||||
Sebelum menggunakan node, Anda perlu mengkonfigurasi kredensial.
|
|
||||||
|
|
||||||
1. Di n8n, pergi ke **Credentials** dan klik **Add credential**.
|
|
||||||
2. Cari **wajs (Bearer Token)** dan pilih.
|
|
||||||
3. Isi detail berikut:
|
|
||||||
- **Base URL**: URL dasar API wajs Anda (misalnya, `https://api.example.com`).
|
|
||||||
- **Bearer Token**: Token API Anda.
|
|
||||||
|
|
||||||
## Operasi yang Tersedia
|
|
||||||
|
|
||||||
Node ini menyediakan berbagai operasi yang dapat dipilih. Berikut adalah daftar operasi yang dikelompokkan berdasarkan kategori:
|
|
||||||
|
|
||||||
### API Key
|
|
||||||
|
|
||||||
- `apikey_postApiApikeyCreate`: Membuat API key baru.
|
|
||||||
- `apikey_getApiApikeyList`: Mendapatkan daftar API key.
|
|
||||||
- `apikey_deleteApiApikeyDelete`: Menghapus API key.
|
|
||||||
|
|
||||||
### WhatsApp
|
|
||||||
|
|
||||||
- `WhatsApp_postApiWaStart`: Memulai sesi WhatsApp.
|
|
||||||
- `WhatsApp_getApiWaQr`: Mendapatkan kode QR untuk login.
|
|
||||||
- `WhatsApp_getApiWaReady`: Memeriksa apakah sesi siap.
|
|
||||||
- `WhatsApp_postApiWaRestart`: Memulai ulang sesi.
|
|
||||||
- `WhatsApp_postApiWaForce_start`: Memaksa memulai sesi.
|
|
||||||
- `WhatsApp_postApiWaStop`: Menghentikan sesi.
|
|
||||||
- `WhatsApp_getApiWaState`: Mendapatkan status sesi.
|
|
||||||
- `WhatsApp_postApiWaSend_text`: Mengirim pesan teks.
|
|
||||||
- `WhatsApp_postApiWaSend_media`: Mengirim pesan media.
|
|
||||||
|
|
||||||
### Webhook
|
|
||||||
|
|
||||||
- `Webhook_postApiWebhookCreate`: Membuat webhook.
|
|
||||||
- `Webhook_getApiWebhookList`: Mendapatkan daftar webhook.
|
|
||||||
- `Webhook_getApiWebhookFindById`: Mencari webhook berdasarkan ID.
|
|
||||||
- `Webhook_deleteApiWebhookRemoveById`: Menghapus webhook berdasarkan ID.
|
|
||||||
- `Webhook_putApiWebhookUpdateById`: Memperbarui webhook berdasarkan ID.
|
|
||||||
|
|
||||||
### Chatflows
|
|
||||||
|
|
||||||
- `chatflows_getApiChatflowsSync`: Sinkronisasi chatflow.
|
|
||||||
- `chatflows_getApiChatflowsFind`: Mencari chatflow.
|
|
||||||
- `chatflows_getApiChatflowsDefault`: Mendapatkan chatflow default.
|
|
||||||
- `chatflows_putApiChatflowsDefault`: Mengatur chatflow default.
|
|
||||||
- `chatflows_postApiChatflowsQuery`: Mengirim query ke chatflow.
|
|
||||||
- `chatflows_putApiChatflowsFlow_active`: Mengaktifkan/menonaktifkan flow.
|
|
||||||
- `chatflows_getApiChatflowsUrl_token`: Mendapatkan URL dan token flow.
|
|
||||||
- `chatflows_putApiChatflowsUrl_token`: Memperbarui URL dan token flow.
|
|
||||||
|
|
||||||
### Autentikasi
|
|
||||||
|
|
||||||
- `auth_postAuthLogin`: Login ke akun.
|
|
||||||
- `auth_deleteAuthLogout`: Logout dari akun.
|
|
||||||
|
|
||||||
### WhatsApp Hook
|
|
||||||
|
|
||||||
- `WhatsApp_Hook_getWa_hookHook`: Verifikasi webhook.
|
|
||||||
- `WhatsApp_Hook_postWa_hookHook`: Menerima pesan WhatsApp.
|
|
||||||
- `WhatsApp_Hook_getWa_hookList`: Mendapatkan daftar hook.
|
|
||||||
- `WhatsApp_Hook_postWa_hookReset`: Mereset hook.
|
|
||||||
|
|
||||||
### Logs
|
|
||||||
|
|
||||||
- `logs_getLogsShow`: Menampilkan log.
|
|
||||||
- `logs_postLogsClear`: Membersihkan log.
|
|
||||||
|
|
||||||
## Lisensi
|
|
||||||
|
|
||||||
[ISC](LICENSE)
|
|
||||||
28
src/credentials/WajsCredentials.credentials.ts
Normal file
28
src/credentials/WajsCredentials.credentials.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { ICredentialType, INodeProperties } from "n8n-workflow";
|
||||||
|
|
||||||
|
export class WajsCredentials implements ICredentialType {
|
||||||
|
name = "wajs";
|
||||||
|
displayName = "wajs (Bearer Token)";
|
||||||
|
|
||||||
|
properties: INodeProperties[] = [
|
||||||
|
{
|
||||||
|
displayName: "Base URL",
|
||||||
|
name: "baseUrl",
|
||||||
|
type: "string",
|
||||||
|
default: "",
|
||||||
|
placeholder: "https://api.example.com",
|
||||||
|
description: "Masukkan URL dasar API tanpa garis miring di akhir",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: "Bearer Token",
|
||||||
|
name: "token",
|
||||||
|
type: "string",
|
||||||
|
default: "",
|
||||||
|
typeOptions: { password: true },
|
||||||
|
description:
|
||||||
|
"Masukkan token autentikasi Bearer (tanpa 'Bearer ' di depannya)",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
1433
src/nodes/Wajs.node.ts
Normal file
1433
src/nodes/Wajs.node.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "n8n-nodes-wajs",
|
"name": "n8n-nodes-wajs",
|
||||||
"version": "1.1.10",
|
"version": "1.1.12",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"n8n",
|
"n8n",
|
||||||
"n8n-nodes"
|
"n8n-nodes"
|
||||||
|
|||||||
Reference in New Issue
Block a user