empuno 1.1.0 → 1.1.1
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.
- package/empuno.mjs +12 -9
- package/package.json +1 -1
package/empuno.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import os from 'node:os';
|
|
|
21
21
|
import path from 'node:path';
|
|
22
22
|
import crypto from 'node:crypto';
|
|
23
23
|
|
|
24
|
-
const VERSION = '1.1.
|
|
24
|
+
const VERSION = '1.1.1'; // EMPUNO_CLI_VERSION — config/agent_api.php cli_version + package.json ile aynı tutulur
|
|
25
25
|
const NPM_PACKAGE = 'empuno';
|
|
26
26
|
const DEFAULT_URL = 'https://empuno.com';
|
|
27
27
|
const CATALOG_TTL_MS = 10 * 60 * 1000;
|
|
@@ -95,7 +95,7 @@ function resolveAuth(flags) {
|
|
|
95
95
|
|
|
96
96
|
function requireKey(auth) {
|
|
97
97
|
if (!auth.key) {
|
|
98
|
-
throw new UsageError('API anahtarı yok. `empuno login` çalıştırın ya da EMPUNO_API_KEY ortam değişkenini ayarlayın. Anahtar: empuno paneli → Firma Ayarları → API → "Ajan" türünde anahtar.');
|
|
98
|
+
throw new UsageError('API anahtarı yok. `empuno login` çalıştırın ya da EMPUNO_API_KEY ortam değişkenini ayarlayın. Anahtar: empuno paneli → Firma Ayarları → API & Ajan → "Ajan" türünde anahtar.');
|
|
99
99
|
}
|
|
100
100
|
if (!auth.key.startsWith('emp_live_')) {
|
|
101
101
|
throw new UsageError('Geçersiz anahtar biçimi (emp_live_ ile başlamalı).');
|
|
@@ -382,7 +382,7 @@ async function findCommand(auth, name, flags) {
|
|
|
382
382
|
if (cmd) return cmd;
|
|
383
383
|
|
|
384
384
|
if (catalog.access === 'read') {
|
|
385
|
-
const err = new UsageError('bu anahtar salt-okuma ("read") türünde: panel komutlarını çalıştıramaz, yalnız `empuno api …`. Firma Ayarları → API sekmesinden "Ajan" anahtarı oluşturun.');
|
|
385
|
+
const err = new UsageError('bu anahtar salt-okuma ("read") türünde: panel komutlarını çalıştıramaz, yalnız `empuno api …`. Firma Ayarları → API & Ajan sekmesinden "Ajan" anahtarı oluşturun.');
|
|
386
386
|
err.payload = { ok: false, error: 'read_only_key' };
|
|
387
387
|
throw err;
|
|
388
388
|
}
|
|
@@ -394,7 +394,7 @@ async function findCommand(auth, name, flags) {
|
|
|
394
394
|
|
|
395
395
|
if (cmd) {
|
|
396
396
|
const need = cmd.requires_company_admin ? ['company_admin'] : cmd.permissions;
|
|
397
|
-
const err = new UsageError(`"${name}" bu anahtarın kapsamında değil. Gereken yetki: ${need.join(', ') || '—'}. Anahtar kapsamını panelden genişletin (Firma Ayarları → API).`);
|
|
397
|
+
const err = new UsageError(`"${name}" bu anahtarın kapsamında değil. Gereken yetki: ${need.join(', ') || '—'}. Anahtar kapsamını panelden genişletin (Firma Ayarları → API & Ajan).`);
|
|
398
398
|
err.payload = { ok: false, error: 'scope_required', command: name, required: need, hint: 'Kapsamı anahtar sahibi panelden genişletir; kullanıcıya bildirin.' };
|
|
399
399
|
throw err;
|
|
400
400
|
}
|
|
@@ -748,12 +748,18 @@ function printTicket(result) {
|
|
|
748
748
|
|
|
749
749
|
async function cmdTickets(args) {
|
|
750
750
|
const { flags, fields, positional } = args;
|
|
751
|
-
const auth = resolveAuth(flags);
|
|
752
|
-
requireKey(auth);
|
|
753
751
|
const opts = fieldMap(fields);
|
|
754
752
|
const [action = 'list', ...rest] = positional;
|
|
755
753
|
const base = '/api/company/v1/tickets';
|
|
756
754
|
|
|
755
|
+
if (action === 'kinds') {
|
|
756
|
+
print({ kinds: TICKET_KINDS, priorities: ['low', 'normal', 'high'] });
|
|
757
|
+
return 0;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
const auth = resolveAuth(flags);
|
|
761
|
+
requireKey(auth);
|
|
762
|
+
|
|
757
763
|
const send = async (method, urlPath, body = null, query = {}) => {
|
|
758
764
|
const response = await request(auth, method, urlPath, { body, query, dryRun: flags['dry-run'] });
|
|
759
765
|
return response;
|
|
@@ -808,9 +814,6 @@ async function cmdTickets(args) {
|
|
|
808
814
|
print(r.result);
|
|
809
815
|
return r.ok || r.dryRun ? 0 : 1;
|
|
810
816
|
}
|
|
811
|
-
case 'kinds':
|
|
812
|
-
print({ kinds: TICKET_KINDS, priorities: ['low', 'normal', 'high'] });
|
|
813
|
-
return 0;
|
|
814
817
|
default:
|
|
815
818
|
throw new UsageError(`bilinmeyen tickets işlemi "${action}". Kullanım: empuno tickets [list|open|show|reply|close|kinds]`);
|
|
816
819
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "empuno",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "empuno İK platformunun komut satırı: yönetim panelindeki tüm işlemleri (izin, bordro, vardiya, PDKS, zimmet, masraf, işe alım) yapay zekâ ajanlarına ve otomasyonlara açar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|