@unchainedshop/core-delivery 5.0.0-alpha.5 → 5.0.0-alpha.8
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 +10 -63
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,76 +13,23 @@ npm install @unchainedshop/core-delivery
|
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
import { configureDeliveryModule, DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
16
|
+
The platform initializes this module as `platform.unchainedAPI.modules.delivery`. Register a delivery plugin before platform startup; the base preset includes Post delivery.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
```typescript
|
|
19
|
+
import { DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
const { delivery } = platform.unchainedAPI.modules;
|
|
22
|
+
const provider = await delivery.create({
|
|
23
23
|
type: DeliveryProviderType.SHIPPING,
|
|
24
|
-
adapterKey: 'shop.unchained.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// Find providers for a context
|
|
28
|
-
const providers = await deliveryModule.findSupported({
|
|
29
|
-
order: orderObject,
|
|
24
|
+
adapterKey: 'shop.unchained.post',
|
|
25
|
+
configuration: [],
|
|
30
26
|
});
|
|
27
|
+
const providers = await delivery.findProviders({});
|
|
31
28
|
```
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### Module Configuration
|
|
36
|
-
|
|
37
|
-
| Export | Description |
|
|
38
|
-
|--------|-------------|
|
|
39
|
-
| `configureDeliveryModule` | Configure and return the delivery module |
|
|
40
|
-
|
|
41
|
-
### Queries
|
|
42
|
-
|
|
43
|
-
| Method | Description |
|
|
44
|
-
|--------|-------------|
|
|
45
|
-
| `findProvider` | Find provider by ID |
|
|
46
|
-
| `findProviders` | Find providers with filtering |
|
|
47
|
-
| `count` | Count providers |
|
|
48
|
-
| `providerExists` | Check if provider exists |
|
|
49
|
-
| `findSupported` | Find providers supported for context |
|
|
50
|
-
| `findInterface` | Get provider interface definition |
|
|
51
|
-
|
|
52
|
-
### Mutations
|
|
53
|
-
|
|
54
|
-
| Method | Description |
|
|
55
|
-
|--------|-------------|
|
|
56
|
-
| `create` | Create a new delivery provider |
|
|
57
|
-
| `update` | Update provider configuration |
|
|
58
|
-
| `delete` | Soft delete a provider |
|
|
59
|
-
|
|
60
|
-
### Constants
|
|
61
|
-
|
|
62
|
-
| Export | Description |
|
|
63
|
-
|--------|-------------|
|
|
64
|
-
| `DeliveryProviderType` | Provider types (SHIPPING, PICKUP) |
|
|
65
|
-
|
|
66
|
-
### Settings
|
|
67
|
-
|
|
68
|
-
| Export | Description |
|
|
69
|
-
|--------|-------------|
|
|
70
|
-
| `deliverySettings` | Access delivery module settings |
|
|
71
|
-
|
|
72
|
-
### Types
|
|
73
|
-
|
|
74
|
-
| Export | Description |
|
|
75
|
-
|--------|-------------|
|
|
76
|
-
| `DeliveryProvider` | Provider document type |
|
|
77
|
-
| `DeliveryModule` | Module interface type |
|
|
78
|
-
|
|
79
|
-
## Events
|
|
30
|
+
`create` returns the provider document. Provider selection and order fulfillment are coordinated through `unchainedAPI.services.orders` and delivery adapters; the core module manages provider records and settings.
|
|
80
31
|
|
|
81
|
-
|
|
82
|
-
|-------|-------------|
|
|
83
|
-
| `DELIVERY_PROVIDER_CREATE` | Provider created |
|
|
84
|
-
| `DELIVERY_PROVIDER_UPDATE` | Provider updated |
|
|
85
|
-
| `DELIVERY_PROVIDER_REMOVE` | Provider deleted |
|
|
32
|
+
See the [module guide](https://docs.unchained.shop/platform-configuration/modules/delivery), [public exports](src/delivery-index.ts), and [module implementation](src/module/configureDeliveryModule.ts).
|
|
86
33
|
|
|
87
34
|
## License
|
|
88
35
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-delivery",
|
|
3
3
|
"description": "Delivery provider management module for the Unchained Engine",
|
|
4
|
-
"version": "5.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.8",
|
|
5
5
|
"main": "lib/delivery-index.js",
|
|
6
6
|
"types": "lib/delivery-index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unchainedshop/events": "^5.0.0-alpha.
|
|
39
|
-
"@unchainedshop/mongodb": "^5.0.0-alpha.
|
|
40
|
-
"@unchainedshop/utils": "^5.0.0-alpha.
|
|
38
|
+
"@unchainedshop/events": "^5.0.0-alpha.8",
|
|
39
|
+
"@unchainedshop/mongodb": "^5.0.0-alpha.8",
|
|
40
|
+
"@unchainedshop/utils": "^5.0.0-alpha.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^26.2.0",
|