@unchainedshop/core-warehousing 5.0.0-alpha.5 → 5.0.0-alpha.7

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.
Files changed (2) hide show
  1. package/README.md +10 -68
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -13,81 +13,23 @@ npm install @unchainedshop/core-warehousing
13
13
 
14
14
  ## Usage
15
15
 
16
- ```typescript
17
- import { configureWarehousingModule, WarehousingProviderType } from '@unchainedshop/core-warehousing';
16
+ The platform initializes this module as `platform.unchainedAPI.modules.warehousing`. Register a warehousing plugin before platform startup; the base preset includes the Store adapter.
18
17
 
19
- const warehousingModule = await configureWarehousingModule({ db });
18
+ ```typescript
19
+ import { WarehousingProviderType } from '@unchainedshop/core-warehousing';
20
20
 
21
- // Create a warehousing provider
22
- const providerId = await warehousingModule.create({
21
+ const { warehousing } = platform.unchainedAPI.modules;
22
+ const provider = await warehousing.create({
23
23
  type: WarehousingProviderType.PHYSICAL,
24
- adapterKey: 'shop.unchained.warehousing.inventory',
24
+ adapterKey: 'shop.unchained.warehousing.store',
25
+ configuration: [],
25
26
  });
26
-
27
- // Find providers
28
- const providers = await warehousingModule.findProviders({});
27
+ const tokens = await warehousing.findTokensForUser({ userId: 'user-123' });
29
28
  ```
30
29
 
31
- ## API Overview
32
-
33
- ### Module Configuration
34
-
35
- | Export | Description |
36
- |--------|-------------|
37
- | `configureWarehousingModule` | Configure and return the warehousing module |
38
-
39
- ### Queries
40
-
41
- | Method | Description |
42
- |--------|-------------|
43
- | `findProvider` | Find provider by ID |
44
- | `findProviders` | Find providers with filtering |
45
- | `count` | Count providers |
46
- | `providerExists` | Check if provider exists |
47
- | `findSupported` | Find providers for product context |
48
- | `findInterface` | Get provider interface definition |
49
-
50
- ### Mutations
51
-
52
- | Method | Description |
53
- |--------|-------------|
54
- | `create` | Create a new warehousing provider |
55
- | `update` | Update provider configuration |
56
- | `delete` | Soft delete a provider |
57
-
58
- ### Token Surrogates
59
-
60
- For tokenized products (NFTs):
61
-
62
- | Method | Description |
63
- |--------|-------------|
64
- | `findTokenSurrogate` | Find token surrogate |
65
- | `createTokenSurrogate` | Create token surrogate |
66
- | `updateTokenSurrogate` | Update token surrogate |
67
- | `deleteTokenSurrogate` | Delete token surrogate |
68
- | `invalidateTokenSurrogates` | Invalidate surrogates for product |
69
-
70
- ### Constants
71
-
72
- | Export | Description |
73
- |--------|-------------|
74
- | `WarehousingProviderType` | Provider types (PHYSICAL, VIRTUAL) |
75
-
76
- ### Types
77
-
78
- | Export | Description |
79
- |--------|-------------|
80
- | `WarehousingProvider` | Provider document type |
81
- | `TokenSurrogate` | Token surrogate document type |
82
- | `WarehousingModule` | Module interface type |
83
-
84
- ## Events
30
+ Provider records and tokens live in this module. Registered warehousing adapters implement stock and availability; `unchainedAPI.services.products` exposes inventory and dispatch simulations, and `unchainedAPI.services.warehousing` provides token helpers.
85
31
 
86
- | Event | Description |
87
- |-------|-------------|
88
- | `WAREHOUSING_PROVIDER_CREATE` | Provider created |
89
- | `WAREHOUSING_PROVIDER_UPDATE` | Provider updated |
90
- | `WAREHOUSING_PROVIDER_REMOVE` | Provider deleted |
32
+ See the [module guide](https://docs.unchained.shop/platform-configuration/modules/warehousing), [public exports](src/warehousing-index.ts), and [module implementation](src/module/configureWarehousingModule.ts).
91
33
 
92
34
  ## License
93
35
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-warehousing",
3
3
  "description": "Inventory and stock management module for the Unchained Engine",
4
- "version": "5.0.0-alpha.5",
4
+ "version": "5.0.0-alpha.7",
5
5
  "main": "lib/warehousing-index.js",
6
6
  "types": "lib/warehousing-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.5",
39
- "@unchainedshop/mongodb": "^5.0.0-alpha.5",
40
- "@unchainedshop/utils": "^5.0.0-alpha.5"
38
+ "@unchainedshop/events": "^5.0.0-alpha.7",
39
+ "@unchainedshop/mongodb": "^5.0.0-alpha.7",
40
+ "@unchainedshop/utils": "^5.0.0-alpha.7"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^26.2.0",