@orchesty/connector-fapi 1.0.1 → 2.0.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 ADDED
@@ -0,0 +1,94 @@
1
+ # Fapi Connector
2
+
3
+ [![npm](https://img.shields.io/npm/v/@orchesty/connector-fapi?color=15ba68)](https://www.npmjs.com/package/@orchesty/connector-fapi)
4
+ [![License](https://img.shields.io/badge/license-Apache--2.0-15ba68)](https://github.com/Orchesty/orchesty-nodejs-connectors/blob/master/LICENSE)
5
+
6
+ An [Orchesty](https://orchesty.io) connector for Fapi, a Czech platform for simple online sales — invoicing, orders, and digital product delivery.
7
+
8
+ ## Application Type
9
+
10
+ **Basic**
11
+
12
+ This connector authenticates using a username and password encoded as HTTP Basic auth (`user:password` Base64-encoded in the `Authorization` header).
13
+
14
+ | Field | Description |
15
+ |---|---|
16
+ | `user` | Your Fapi username |
17
+ | `password` | Your Fapi API password |
18
+
19
+ ## Components
20
+
21
+ | Class | Type | Description |
22
+ |---|---|---|
23
+ | `FapiGetInvoiceConnector` | Connector | Retrieves a single invoice by ID via `GET /invoices/{id}` |
24
+ | `FapiPostInvoiceLabelConnector` | Connector | Assigns labels to an invoice via `POST /invoice-labels/{id}` |
25
+ | `FapiGetItemTemplateListBatch` | Batch | Paginated list of item templates via `GET /item_templates` |
26
+ | `FapiGetLabelListBatch` | Batch | Paginated list of invoice labels via `GET /labels` |
27
+ | `FapiGetProjectListBatch` | Batch | Paginated list of projects via `GET /projects` |
28
+ | `FapiGetShippingMethodListBatch` | Batch | Paginated list of shipping methods via `GET /shipping-methods` |
29
+ | `FapiSubscribeWebhooksBatch` | Batch | Subscribes webhooks by creating connection entries via `POST /connections` |
30
+ | `FapiUnsubscribeWebhooksBatch` | Batch | Unsubscribes webhooks by deleting connection entries via `DELETE /connections/{webhookId}` |
31
+
32
+ ## Setup
33
+
34
+ ### Credentials
35
+
36
+ 1. Log in to your [Fapi](https://www.fapi.cz) account.
37
+ 2. Navigate to **My Account → API Keys**.
38
+ 3. Create a new API key (name it after your integration for easy reference).
39
+ 4. Use your Fapi **username** and the generated **API key as the password** in Orchesty.
40
+
41
+ ### API Documentation
42
+
43
+ Fapi API Reference: [https://web.fapi.cz/api-doc/](https://web.fapi.cz/api-doc/)
44
+
45
+ ## Installation & Usage
46
+
47
+ Install the package:
48
+
49
+ ```bash
50
+ npm install @orchesty/connector-fapi @orchesty/nodejs-sdk
51
+ # or
52
+ pnpm add @orchesty/connector-fapi @orchesty/nodejs-sdk
53
+ ```
54
+
55
+ Register the application and nodes in your Orchesty DI container:
56
+
57
+ ```typescript
58
+ import { container } from '@orchesty/nodejs-sdk';
59
+ import FapiApplication from '@orchesty/connector-fapi/dist/FapiApplication';
60
+ import FapiGetInvoiceConnector from '@orchesty/connector-fapi/dist/Connector/FapiGetInvoiceConnector';
61
+ import FapiPostInvoiceLabelConnector from '@orchesty/connector-fapi/dist/Connector/FapiPostInvoiceLabelConnector';
62
+ import FapiGetItemTemplateListBatch from '@orchesty/connector-fapi/dist/Batch/FapiGetItemTemplateListBatch';
63
+ import FapiGetLabelListBatch from '@orchesty/connector-fapi/dist/Batch/FapiGetLabelListBatch';
64
+ import FapiGetProjectListBatch from '@orchesty/connector-fapi/dist/Batch/FapiGetProjectListBatch';
65
+ import FapiGetShippingMethodListBatch from '@orchesty/connector-fapi/dist/Batch/FapiGetShippingMethodListBatch';
66
+ import FapiSubscribeWebhooksBatch from '@orchesty/connector-fapi/dist/Batch/FapiSubscribeWebhooksBatch';
67
+ import FapiUnsubscribeWebhooksBatch from '@orchesty/connector-fapi/dist/Batch/FapiUnsubscribeWebhooksBatch';
68
+
69
+ const app = new FapiApplication();
70
+ container.setApplication(app);
71
+ container.setNode(new FapiGetInvoiceConnector(), app);
72
+ container.setNode(new FapiPostInvoiceLabelConnector(), app);
73
+ container.setNode(new FapiGetItemTemplateListBatch(), app);
74
+ container.setNode(new FapiGetLabelListBatch(), app);
75
+ container.setNode(new FapiGetProjectListBatch(), app);
76
+ container.setNode(new FapiGetShippingMethodListBatch(), app);
77
+ container.setNode(new FapiSubscribeWebhooksBatch(), app);
78
+ container.setNode(new FapiUnsubscribeWebhooksBatch(), app);
79
+ ```
80
+
81
+ ## License
82
+
83
+ This connector is released under the **Apache License 2.0**. See the [LICENSE](https://github.com/Orchesty/orchesty-nodejs-connectors/blob/master/LICENSE) file for the full license text.
84
+
85
+ ## Contributing
86
+
87
+ Contributions are welcome! This connector is part of the open-source [Orchesty Node.js Connectors](https://github.com/Orchesty/orchesty-nodejs-connectors) monorepo.
88
+
89
+ For guidelines on how to create or update connectors — including project setup, coding conventions, and how to write tests — please refer to the **[Contributing to Connectors](https://orchesty.io/community/contributing-to-connectors)** guide.
90
+
91
+ All contributions should include:
92
+ - Source code in `src/` following the existing connector structure
93
+ - Tests in `src/**/__tests__/` with `input.json`, `mock.json`, and `output.json` fixtures
94
+ - An updated `CHANGELOG.md` entry
@@ -31,6 +31,7 @@ class FapiSubscribeWebhooksBatch extends ABatchNode_1.default {
31
31
  const subscribedWebhooks = await webhookRepository.findMany({
32
32
  users: [applicationInstall.getUser()],
33
33
  apps: [applicationInstall.getName()],
34
+ sdks: [applicationInstall.getSdk()],
34
35
  });
35
36
  const unsubscribedWebhook = webhookSubscriptions.filter(({ event }) => !subscribedWebhooks.find((subscribedWebhook) => subscribedWebhook.getName() === event)).shift();
36
37
  if (!unsubscribedWebhook) {
@@ -52,6 +53,7 @@ class FapiSubscribeWebhooksBatch extends ABatchNode_1.default {
52
53
  .setWebhookId(String(responseDto.getJsonBody().id))
53
54
  .setApplication(applicationInstall.getName())
54
55
  .setUser(applicationInstall.getUser())
56
+ .setSdk(applicationInstall.getSdk())
55
57
  .setTopology(topology)
56
58
  .setNode(node)
57
59
  .setToken(token)
@@ -24,6 +24,7 @@ class FapiUnsubscribeWebhooksBatch extends ABatchNode_1.default {
24
24
  const subscribedWebhook = await webhookRepository.findOne({
25
25
  users: [applicationInstall.getUser()],
26
26
  apps: [applicationInstall.getName()],
27
+ sdks: [applicationInstall.getSdk()],
27
28
  });
28
29
  if (subscribedWebhook) {
29
30
  const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.DELETE, `connections/${subscribedWebhook.getWebhookId()}`);
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-fapi",
3
3
  "description": "",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
@@ -17,10 +17,10 @@
17
17
  "keywords": [],
18
18
  "author": "info@hanaboso.com",
19
19
  "dependencies": {
20
- "@orchesty/nodejs-sdk": "^4.3.6",
21
- "axios": "^1.13.2",
22
- "luxon": "^3.7.2",
23
- "http-status-codes": "^2.3.0"
20
+ "@orchesty/nodejs-sdk": "^5.0.8",
21
+ "axios": "^1.15.2",
22
+ "http-status-codes": "^2.3.0",
23
+ "luxon": "^3.7.2"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/luxon": "^3.7.1"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-fapi",
3
3
  "description": "",
4
- "version": "1.0.1",
4
+ "version": "2.0.0",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
@@ -11,10 +11,10 @@
11
11
  "keywords": [],
12
12
  "author": "info@hanaboso.com",
13
13
  "dependencies": {
14
- "@orchesty/nodejs-sdk": "^4.3.6",
15
- "axios": "^1.13.2",
16
- "luxon": "^3.7.2",
17
- "http-status-codes": "^2.3.0"
14
+ "@orchesty/nodejs-sdk": "^5.0.8",
15
+ "axios": "^1.15.2",
16
+ "http-status-codes": "^2.3.0",
17
+ "luxon": "^3.7.2"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/luxon": "^3.7.1"