mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-07-31 09:07:25 +02:00
* add serverId and workerId * adjust id format * fix logger init / test * update implementation
13 lines
366 B
TypeScript
13 lines
366 B
TypeScript
import { customAlphabet } from 'nanoid';
|
|
import type { N8nInstanceType } from '@/Interfaces';
|
|
|
|
const nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 16);
|
|
|
|
export function generateNanoId() {
|
|
return nanoid();
|
|
}
|
|
|
|
export function generateHostInstanceId(instanceType: N8nInstanceType) {
|
|
return `${instanceType}-${nanoid()}`;
|
|
}
|