@unchainedshop/core-languages 5.0.0-alpha.4 → 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 +8 -58
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -13,69 +13,19 @@ npm install @unchainedshop/core-languages
13
13
 
14
14
  ## Usage
15
15
 
16
- ```typescript
17
- import { configureLanguagesModule } from '@unchainedshop/core-languages';
18
-
19
- const languagesModule = await configureLanguagesModule({ db });
16
+ The platform initializes this module as `platform.unchainedAPI.modules.languages`.
20
17
 
21
- // Create a language
22
- const languageId = await languagesModule.create({
23
- isoCode: 'en',
24
- });
25
-
26
- // Find languages
27
- const languages = await languagesModule.findLanguages({ includeInactive: false });
18
+ ```typescript
19
+ const { languages } = platform.unchainedAPI.modules;
28
20
 
29
- // Check if language is base language
30
- const isBase = languagesModule.isBase(language);
21
+ const languageId = await languages.create({ isoCode: 'en', isActive: true });
22
+ const language = await languages.findLanguage({ languageId });
23
+ const activeLanguages = await languages.findLanguages({ includeInactive: false });
31
24
  ```
32
25
 
33
- ## API Overview
34
-
35
- ### Module Configuration
36
-
37
- | Export | Description |
38
- |--------|-------------|
39
- | `configureLanguagesModule` | Configure and return the languages module |
40
-
41
- ### Queries
42
-
43
- | Method | Description |
44
- |--------|-------------|
45
- | `findLanguage` | Find language by ID or ISO code |
46
- | `findLanguages` | Find languages with filtering, sorting, and pagination |
47
- | `count` | Count languages matching query |
48
- | `languageExists` | Check if a language exists |
49
-
50
- ### Mutations
51
-
52
- | Method | Description |
53
- |--------|-------------|
54
- | `create` | Create a new language |
55
- | `update` | Update an existing language |
56
- | `delete` | Soft delete a language |
57
-
58
- ### Helper Methods
59
-
60
- | Method | Description |
61
- |--------|-------------|
62
- | `isBase` | Check if language is the base/system language |
63
-
64
- ### Types
65
-
66
- | Export | Description |
67
- |--------|-------------|
68
- | `Language` | Language document type |
69
- | `LanguageQuery` | Query parameters type |
70
- | `LanguagesModule` | Module interface type |
71
-
72
- ## Events
26
+ `create` returns a language ID. Product and assortment translations are managed by their respective modules.
73
27
 
74
- | Event | Description |
75
- |-------|-------------|
76
- | `LANGUAGE_CREATE` | Emitted when a language is created |
77
- | `LANGUAGE_UPDATE` | Emitted when a language is updated |
78
- | `LANGUAGE_REMOVE` | Emitted when a language is removed |
28
+ See the [module guide](https://docs.unchained.shop/platform-configuration/modules/languages), [public exports](src/languages-index.ts), and [module implementation](src/module/configureLanguagesModule.ts).
79
29
 
80
30
  ## License
81
31
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-languages",
3
3
  "description": "Language management module for the Unchained Engine",
4
- "version": "5.0.0-alpha.4",
4
+ "version": "5.0.0-alpha.7",
5
5
  "main": "lib/languages-index.js",
6
6
  "types": "lib/languages-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.1",
39
- "@unchainedshop/mongodb": "^5.0.0-alpha.1",
40
- "@unchainedshop/utils": "^5.0.0-alpha.1"
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",