@orchesty/connector-upgates 1.0.1 → 2.0.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/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Upgates Connector
2
+
3
+ [![npm](https://img.shields.io/npm/v/@orchesty/connector-upgates?color=15ba68)](https://www.npmjs.com/package/@orchesty/connector-upgates)
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 Upgates, a Czech e-commerce platform for creating and managing online stores.
7
+
8
+ ## Application Type
9
+
10
+ **Basic**
11
+
12
+ This connector authenticates using HTTP Basic auth (Login + API Key, Base64-encoded). The store URL is configurable per instance.
13
+
14
+ | Field | Description |
15
+ |---|---|
16
+ | `user` | Your Upgates login username |
17
+ | `password` | Your Upgates API key |
18
+ | `upgatesUrl` | Your Upgates store URL (e.g. `https://my-store.upgates.com`) |
19
+
20
+ ## Components
21
+
22
+ | Class | Type | Description |
23
+ |---|---|---|
24
+ | `UpgatesGetOrderStates` | Connector | Retrieves available order states via `GET /api/v2/orders/states` |
25
+ | `UpgatesGetPayments` | Connector | Retrieves payment methods via `GET /api/v2/payments` |
26
+ | `UpgatesGetProductParameters` | Connector | Fetches product parameters via `GET /api/v2/products/parameters/` |
27
+ | `UpgatesGetShipments` | Connector | Retrieves shipment methods via `GET /api/v2/shipments` |
28
+ | `UpgatesUpdateOrder` | Connector | Updates one or more orders via `PUT /api/v2/orders` |
29
+ | `UpgatesUpdateStock` | Connector | Updates stock quantities for products via `PUT /api/v2/products` |
30
+ | `UpgatesDeleteWebhooks` | Connector | Deletes all registered webhooks via `DELETE /api/v2/webhooks?ids={ids}` |
31
+ | `UpgatesCreateWebhooks` | Batch | Registers webhook subscriptions via `POST /api/v2/webhooks` |
32
+ | `UpgatesGetOrders` | Batch | Paginates through orders via `GET /api/v2/orders`; supports date-cursor filtering |
33
+ | `UpgatesGetProducts` | Batch | Paginates through products via `GET /api/v2/products`; supports date-cursor filtering |
34
+
35
+ ## Setup
36
+
37
+ ### Credentials
38
+
39
+ 1. Log in to your [Upgates](https://www.upgates.com/) admin panel.
40
+ 2. Navigate to **Settings → API** and note your **API key**.
41
+ 3. In Orchesty, open the Upgates application settings and fill in your login username, API key, and store URL.
42
+
43
+ ### API Documentation
44
+
45
+ Upgates API: [https://api.upgates.com/](https://api.upgates.com/)
46
+
47
+ ## Installation & Usage
48
+
49
+ Install the package:
50
+
51
+ ```bash
52
+ npm install @orchesty/connector-upgates @orchesty/nodejs-sdk
53
+ # or
54
+ pnpm add @orchesty/connector-upgates @orchesty/nodejs-sdk
55
+ ```
56
+
57
+ Register the application and nodes in your Orchesty DI container:
58
+
59
+ ```typescript
60
+ import { container } from '@orchesty/nodejs-sdk';
61
+ import UpgatesApplication from '@orchesty/connector-upgates/dist/UpgatesApplication';
62
+ import UpgatesGetOrderStates from '@orchesty/connector-upgates/dist/Connector/UpgatesGetOrderStates';
63
+ import UpgatesUpdateOrder from '@orchesty/connector-upgates/dist/Connector/UpgatesUpdateOrder';
64
+ import UpgatesUpdateStock from '@orchesty/connector-upgates/dist/Connector/UpgatesUpdateStock';
65
+ import UpgatesDeleteWebhooks from '@orchesty/connector-upgates/dist/Connector/UpgatesDeleteWebhooks';
66
+ import UpgatesCreateWebhooks from '@orchesty/connector-upgates/dist/Batch/UpgatesCreateWebhooks';
67
+ import UpgatesGetOrders from '@orchesty/connector-upgates/dist/Batch/UpgatesGetOrders';
68
+ import UpgatesGetProducts from '@orchesty/connector-upgates/dist/Batch/UpgatesGetProducts';
69
+
70
+ const app = new UpgatesApplication();
71
+ container.setApplication(app);
72
+ container.setNode(new UpgatesGetOrderStates(), app);
73
+ container.setNode(new UpgatesUpdateOrder(), app);
74
+ container.setNode(new UpgatesUpdateStock(), app);
75
+ container.setNode(new UpgatesDeleteWebhooks(), app);
76
+ container.setNode(new UpgatesCreateWebhooks(), app);
77
+ container.setNode(new UpgatesGetOrders(), app);
78
+ container.setNode(new UpgatesGetProducts(), app);
79
+ // ... register remaining connectors similarly
80
+ ```
81
+
82
+ ## License
83
+
84
+ 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.
85
+
86
+ ## Contributing
87
+
88
+ Contributions are welcome! This connector is part of the open-source [Orchesty Node.js Connectors](https://github.com/Orchesty/orchesty-nodejs-connectors) monorepo.
89
+
90
+ 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.
91
+
92
+ All contributions should include:
93
+ - Source code in `src/` following the existing connector structure
94
+ - Tests in `src/**/__tests__/` with `input.json`, `mock.json`, and `output.json` fixtures
95
+ - An updated `CHANGELOG.md` entry
@@ -37,6 +37,7 @@ class UpgatesCreateWebhooks extends ABatchNode_1.default {
37
37
  await repo.insert(new Webhook_1.default()
38
38
  .setWebhookId(respBody.webhook.id.toString())
39
39
  .setUser(appInstall.getUser())
40
+ .setSdk(appInstall.getSdk())
40
41
  .setNode(webhooks[webhookIndex].getNode())
41
42
  .setToken(token)
42
43
  .setApplication(app.getName())
@@ -25,7 +25,11 @@ class UpgatesDeleteWebhooks extends AConnector_1.default {
25
25
  appInstall = await this.getApplicationInstallFromProcess(dto, null, false);
26
26
  }
27
27
  const repo = this.getDbClient().getRepository(Webhook_1.default);
28
- const webhooks = (await repo.findMany({ users: [appInstall.getUser()], apps: [app.getName()] }))
28
+ const webhooks = (await repo.findMany({
29
+ users: [appInstall.getUser()],
30
+ apps: [app.getName()],
31
+ sdks: [appInstall.getSdk()],
32
+ }))
29
33
  .filter((item) => !item.getUnsubscribeFailed());
30
34
  const webhooksIds = [];
31
35
  webhooks.forEach((webhook) => {
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-upgates",
3
3
  "description": "",
4
- "version": "1.0.0",
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",
@@ -17,12 +17,12 @@
17
17
  "keywords": [],
18
18
  "author": "info@hanaboso.com",
19
19
  "dependencies": {
20
- "@orchesty/nodejs-sdk": "^4.3.6",
20
+ "@orchesty/nodejs-sdk": "^5.0.13",
21
21
  "http-status-codes": "^2.3.0",
22
22
  "luxon": "^3.7.2"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/luxon": "^3.7.1"
25
+ "@types/luxon": "^3.7.3"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=24"
package/package.json CHANGED
@@ -1,22 +1,25 @@
1
1
  {
2
2
  "name": "@orchesty/connector-upgates",
3
3
  "description": "",
4
- "version": "1.0.1",
4
+ "version": "2.0.1",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
- "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Orchesty/orchesty-nodejs-connectors"
10
+ },
8
11
  "files": [
9
12
  "dist"
10
13
  ],
11
14
  "keywords": [],
12
15
  "author": "info@hanaboso.com",
13
16
  "dependencies": {
14
- "@orchesty/nodejs-sdk": "^4.3.6",
17
+ "@orchesty/nodejs-sdk": "^5.0.13",
15
18
  "http-status-codes": "^2.3.0",
16
19
  "luxon": "^3.7.2"
17
20
  },
18
21
  "devDependencies": {
19
- "@types/luxon": "^3.7.1"
22
+ "@types/luxon": "^3.7.3"
20
23
  },
21
24
  "engines": {
22
25
  "node": ">=24"