n8n-nodes-gereft 0.1.1 → 0.2.0

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/README.md CHANGED
@@ -1,70 +1,60 @@
1
1
  # n8n-nodes-gereft
2
2
 
3
- نود n8n برای API گرفت. فیلدها به‌صورت خودکار از روی Swagger بک‌اند (`/docs/swagger.json`) با کتابخانه‌ی
4
- [`@devlikeapro/n8n-openapi-node`](https://github.com/devlikeapro/n8n-openapi-node) ساخته می‌شوند.
3
+ An [n8n](https://n8n.io) community node for the Gereft API.
5
4
 
6
- - هر **tag** در Swagger یک **Resource** است و هر endpoint یک **Operation**.
7
- - فیلدهای اجباری (path و query/body اجباری) مستقیم نمایش داده می‌شوند. همه‌ی فیلدهای اختیاری در
8
- **Additional Fields** هستند و فقط فیلدهایی ارسال می‌شوند که کاربر اضافه کرده است. این کار جلوی پاک شدن داده
9
- در endpointهای update با مقدارهای پیش‌فرض (`''`، `0`، `true`) را می‌گیرد.
10
- - آبجکت‌ها و آرایه‌های تو در توی body یک فیلد JSON هستند.
11
- - endpointهای `multipart` (مثل `POST /media/upload`) پشتیبانی نمی‌شوند و برای آن‌ها از نود HTTP Request استفاده کنید.
5
+ The node is generated from Gereft's OpenAPI spec, so it covers the whole API: each API section (Invoice, Note, Rfq, …)
6
+ is a **Resource**, and each endpoint is an **Operation**. Required parameters are shown directly. Optional ones are
7
+ under **Additional Fields**, and only the fields you add there are sent. Nested objects and arrays in a request body
8
+ are entered as JSON.
12
9
 
13
- ## دستورها
10
+ The node can also be used as a tool by n8n's AI Agent.
14
11
 
15
- ```bash
16
- pnpm install
17
- pnpm update # دریافت اسپک از api.gereft.com + build
18
- pnpm build # فقط build از openapi/gereft.json موجود
19
- node scripts/fetch-spec.mjs ../backend/dist/public/swagger.json # اسپک از بک‌اند لوکال
20
- pnpm e2e # تست end-to-end داخل n8n واقعی (Docker) با mock server
21
- ```
12
+ ## Installation
22
13
 
23
- کدام tagها وارد نود شوند در `spec.config.json` تعیین می‌شود (`includeTags` خالی یعنی همه، به‌جز `excludeTags`).
14
+ ### From the n8n UI (recommended)
24
15
 
25
- بعد از هر تغییر API در بک‌اند: `pnpm update`، نسخه را در `package.json` بالا ببرید و دوباره نصب کنید.
16
+ 1. In n8n, open **Settings → Community Nodes**.
17
+ 2. Click **Install**, enter `n8n-nodes-gereft`, accept the risk notice, and click **Install**.
18
+ 3. The **Gereft** node now appears in the node panel.
26
19
 
27
- ## نصب روی n8n (self-hosted / Docker)
20
+ To update, open **Settings → Community Nodes** and click **Update** on the package.
28
21
 
29
- **روش ۱: پوشه‌ی custom (ساده‌ترین)**
30
- پوشه‌ی `dist` را در کانتینر n8n در `/home/node/.n8n/custom/n8n-nodes-gereft` قرار دهید (یا mount کنید) و n8n را
31
- ری‌استارت کنید:
22
+ > Community nodes are only available on self-hosted n8n. The n8n server needs access to `registry.npmjs.org`. If it
23
+ > doesn't have that access, use the manual install below.
32
24
 
33
- ```yaml
34
- services:
35
- n8n:
36
- volumes:
37
- - ./n8n-nodes-gereft/dist:/home/node/.n8n/custom/n8n-nodes-gereft:ro
38
- ```
25
+ ### Manual install (offline / no npm access)
39
26
 
40
- **روش ۲: پکیج npm**
41
- پکیج روی npm منتشر شده است: در n8n به Settings → Community Nodes → Install بروید و `n8n-nodes-gereft` را وارد کنید.
42
- (در Docker باید `N8N_COMMUNITY_PACKAGES_ENABLED` فعال باشد، که پیش‌فرض فعال است.)
27
+ 1. Download the package on a machine with internet access:
28
+ ```bash
29
+ npm pack n8n-nodes-gereft
30
+ ```
31
+ 2. Copy the `.tgz` file into the n8n container and install it:
32
+ ```bash
33
+ docker cp n8n-nodes-gereft-<version>.tgz <n8n-container>:/tmp/
34
+ docker exec -u node <n8n-container> sh -c \
35
+ 'mkdir -p ~/.n8n/nodes && cd ~/.n8n/nodes && npm install /tmp/n8n-nodes-gereft-<version>.tgz'
36
+ ```
37
+ 3. Restart n8n: `docker restart <n8n-container>`.
43
38
 
44
- بدون اینترنت: `pnpm pack` یک فایل `.tgz` می‌سازد. آن را داخل کانتینر در `~/.n8n/nodes` با `npm install <file>.tgz` نصب کنید.
39
+ ## Credentials
45
40
 
46
- انتشار نسخه‌ی جدید: `pnpm release` (نسخه‌ی patch را بالا می‌برد، build می‌کند و منتشر می‌کند). برای `minor`/`major`:
47
- `pnpm release minor`. با `--dry-run` فقط چک می‌کند و چیزی منتشر نمی‌شود. اگر publish شکست بخورد نسخه برمی‌گردد.
41
+ Create a credential of type **Gereft API**:
48
42
 
49
- > نوع نود در روش ۱ `CUSTOM.gereft` و در روش ۲ `n8n-nodes-gereft.gereft` است. workflowها بین این دو روش جابه‌جا نمی‌شوند،
50
- > پس از اول یکی را انتخاب کنید.
43
+ | Field | Value |
44
+ |----------------|------------------------------------------------|
45
+ | Base URL | `https://api.gereft.com` (default) |
46
+ | Authentication | **API Key** or **Bearer Token (JWT)** |
51
47
 
52
- ## Credential
48
+ - **API Key**: a server API key. It has full access, but requests are not tied to a user. Endpoints that depend on the
49
+ current user (for example `/auth/me` or "my" lists) won't work with it.
50
+ - **Bearer Token (JWT)**: a Gereft user's token. Requests run as that user, with that user's permissions. The token
51
+ expires and then has to be replaced.
53
52
 
54
- در n8n یک credential از نوع **Gereft API** بسازید:
53
+ ## Limitations
55
54
 
56
- | فیلد | توضیح |
57
- |---|---|
58
- | Base URL | پیش‌فرض `https://api.gereft.com` |
59
- | Authentication | `API Key` یا `Bearer Token (JWT)` |
55
+ - File uploads (`multipart/form-data` endpoints such as `POST /media/upload`) aren't supported. Use n8n's
56
+ **HTTP Request** node for those.
60
57
 
61
- - **API Key**: هدر `x-api-key` برابر با `API_KEY` بک‌اند. هر دو guard (Auth و Roles) را دور می‌زند، پس دسترسی کامل
62
- دارد، ولی **`req.user` ست نمی‌شود**. endpointهایی که به کاربر جاری نیاز دارند (`/auth/me`، `createdBy`، «درخواست‌های من»
63
- و …) با این روش درست کار نمی‌کنند.
64
- - **Bearer Token**: JWT یک کاربر گرفت، با همان سطح دسترسی آن کاربر. توکن منقضی می‌شود.
58
+ ## License
65
59
 
66
- دکمه‌ی Test credential در حالت API Key درخواست `GET /config` و در حالت Bearer درخواست `GET /auth/me` می‌زند.
67
-
68
- ## Tool برای AI Agent
69
-
70
- نود `usableAsTool` است و می‌توان آن را مستقیم به AI Agent در n8n وصل کرد.
60
+ [MIT](LICENSE)