Skip to content

Commit 97eb341

Browse files
committed
feat: Implement new REST services and corresponding tests for Mixcore
- Added RelatedAttributeSetRestPortalService for handling related attribute set portal endpoints. - Created MixDatabaseColumnRestService and MixDatabaseDataRestClientService with tests for initialization and data handling. - Developed MixDatabaseDataRestPortalService with methods for data import, export, and migration, including comprehensive tests. - Introduced MixDatabaseDataValueRestService and its initial test structure. - Implemented ModuleDataRestMvcService and ModuleDataService with tests for data fetching and manipulation. - Added FileServicesPortal for file management operations with tests for file retrieval and saving. - Created StoreService for managing store-related API interactions. - Developed ModuleArticleService and ModuleGalleryService for article and gallery management with tests. - Implemented PostRestMvcService for post-related operations with tests. - Added TemplateService for template management with tests for copying templates. - Introduced AuthService for authentication operations with extensive tests for registration, login, and role management. - Created UserServices for user management with tests for profile retrieval and user operations.
1 parent 92af3b1 commit 97eb341

File tree

51 files changed

+138
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+138
-132
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
applyTo: '**'
3+
---
4+
## Mixcore JavaScript SDK: Project Context & Coding Guidelines
5+
6+
This SDK is a modular, domain-driven, platform-oriented TypeScript monorepo. It is organized by business domain, not legacy file structure. All code must be framework-agnostic, well-typed, and suitable for both internal and third-party consumers.
7+
8+
### Directory Structure (Domain-Driven)
9+
10+
```
11+
mixcore/javascript-sdk/
12+
├── packages/
13+
│ ├── user/ # User domain services and API clients
14+
│ │ ├── src/
15+
│ │ └── tests/
16+
│ ├── template/ # Template domain services and API clients
17+
│ │ ├── src/
18+
│ │ └── tests/
19+
│ ├── file/ # File domain services and API clients
20+
│ │ ├── src/
21+
│ │ └── tests/
22+
│ ├── config/ # Configuration domain services
23+
│ │ ├── src/
24+
│ │ └── tests/
25+
│ ├── navigation/ # Navigation domain services
26+
│ │ ├── src/
27+
│ │ └── tests/
28+
│ ├── database/ # Database and attribute services
29+
│ │ ├── src/
30+
│ │ └── tests/
31+
│ ├── shared/ # Shared utilities, helpers, constants
32+
│ │ ├── src/
33+
│ │ └── tests/
34+
│ ├── base/ # Base classes, abstract models, interfaces
35+
│ │ ├── src/
36+
│ │ └── tests/
37+
│ ├── api/ # API bootstrap, core API clients, SDK entrypoint
38+
│ │ ├── src/
39+
│ │ └── tests/
40+
├── tests/ # Cross-package/unit/integration tests
41+
├── README.md
42+
├── package.json
43+
└── nx.json / lerna.json / pnpm-workspace.yaml (if using monorepo tool)
44+
```
45+
46+
### Coding Guidelines
47+
48+
- All code must be TypeScript, framework-agnostic, and have injectable config.
49+
- Organize modules by business domain (User, Template, File, Config, Database, etc.).
50+
- Provide a single SDK bootstrap/config entrypoint (`createMixcoreSdk(config)`).
51+
- Support plugin/adapter architecture and OpenAPI codegen for API clients.
52+
- Enforce advanced TypeScript, test, and documentation standards.
53+
- No SPA/UI dependencies in SDK code.
54+
- All public APIs must be typed, documented, and tested.
55+
- Use OpenAPI codegen for REST clients where possible.
56+
- Provide plugin/adapter interfaces for extensibility.
57+
- Update migration checklists and documentation as you migrate, refactor, and document each module.
58+
59+
### Success Criteria
60+
61+
- All SDK code is TypeScript, framework-agnostic, and well-documented.
62+
- 90%+ test coverage for all core packages.
63+
- All public APIs are typed, documented, and auto-generated from source/OpenAPI.
64+
- SDK is extensible via plugins/adapters.
65+
- Legacy code is fully deprecated in consuming projects.
66+
- CI/CD is green and releases are automated.

.github/prompts/MIGRATION_MAPPING_THREE.prompt.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ This document provides a detailed mapping and progress tracker for the migration
2626
## 1. Core Migration Steps (Platform & Domain-Driven)
2727
- [x] Monorepo structure created (Lerna/PNPM workspaces)
2828
- [x] TypeScript, Jest, and build tooling configured
29-
- [x] Packages scaffolded: `shared`, `base`, `apis`
29+
- [x] Packages scaffolded: `user`, `template`, `file`, `config`, `navigation`, `database`, `shared`, `base`, `api`
3030
- [x] Initial code audit and mapping
31-
- [ ] Domain-driven package reorganization (User, Template, File, Config, Database, etc.)
31+
- [~] Domain-driven package reorganization (User, Template, File, Config, Database, etc.)
3232
- [ ] SDK bootstrap/config entrypoint (`createMixcoreSdk(config)`) implemented
3333
- [ ] Plugin/adapter interface defined and documented
3434
- [ ] OpenAPI codegen adopted for REST API clients (if OpenAPI specs exist)
@@ -42,77 +42,77 @@ This document provides a detailed mapping and progress tracker for the migration
4242
### User Domain
4343
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
4444
|-------------------------|-----------------------------------------------------|----------|------------|-------------|------|
45-
| user-services | app-client/services/user-services.js | [x] | [x] | [x] | [ ] |
45+
| user-services | .legacy/app-client/services/user-services.js | [x] | [x] | [x] | [ ] |
4646

4747
### Template Domain
4848
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
4949
|-------------------------|-----------------------------------------------------|----------|------------|-------------|------|
50-
| template-service | app-portal/services/template-service.js | [x] | [x] | [x] | [ ] |
50+
| template-service | .legacy/app-portal/services/template-service.js | [x] | [x] | [x] | [ ] |
5151

5252
### File Domain
5353
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
5454
|-------------------------|-----------------------------------------------------|----------|------------|-------------|------|
55-
| file-services | app-shared/services/file-service.js | [x] | [x] | [x] | [ ] |
56-
| file-services (portal) | app-portal/pages/file/file-services.js | [x] | [x] | [x] | [ ] |
55+
| file-services | .legacy/app-shared/services/file-service.js | [x] | [x] | [x] | [ ] |
56+
| file-services (portal) | .legacy/app-portal/pages/file/file-services.js | [x] | [x] | [x] | [ ] |
5757

5858
### Configuration Domain
5959
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
6060
|-------------------------|-----------------------------------------------------|----------|------------|-------------|------|
61-
| configuration-services | app-portal/pages/configuration/configuration-services.js | [x] | [x] | [x] | [ ] |
61+
| configuration-services | .legacy/app-portal/pages/configuration/configuration-services.js | [x] | [x] | [x] | [ ] |
6262

6363
### Navigation Domain
6464
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
6565
|-------------------------|-----------------------------------------------------|----------|------------|-------------|------|
66-
| rest-navigation-service | app-client/services/rest-navigation-service.js | [ ] | [ ] | [ ] | [ ] |
66+
| rest-navigation-service | .legacy/app-client/services/rest-navigation-service.js | [ ] | [ ] | [ ] | [ ] |
6767

6868
### Database Domain
6969
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
7070
|-------------------------|-----------------------------------------------------|----------|------------|-------------|------|
71-
| mix-database-rest-portal-service | app-shared/services/mix-database/rest-portal-service.js | [x] | [x] | [x] | [ ] |
72-
| mix-database-column-rest-service | app-shared/services/mix-database-column/rest-service.js | [x] | [x] | [x] | [ ] |
73-
| mix-database-data-rest-client-service | app-shared/services/mix-database-data/rest-client-service.js | [x] | [x] | [x] | [ ] |
74-
| mix-database-data-rest-portal-service | app-shared/services/mix-database-data/rest-portal-service.js | [x] | [x] | [x] | [ ] |
75-
| mix-database-data-value-rest-service | app-shared/services/mix-database-data-value/rest-service.js | [x] | [x] | [x] | [ ] |
76-
| module-data-rest-mvc-service | app-shared/services/module-data-service/rest-mvc-service.js | [x] | [x] | [x] | [ ] |
77-
| post-rest-mvc-service | app-shared/services/post-service/rest-mvc-service.js | [ ] | [ ] | [ ] | [ ] |
78-
| post-rest-mvc-service | app-shared/services/post-service/rest-mvc-service.js | [x] | [x] | [x] | [ ] |
79-
| related-attribute-data-rest-form-service | app-shared/services/related-attribute-data/rest-form-service.js | [ ] | [ ] | [ ] | [ ] |
80-
| related-attribute-data-rest-form-service | app-shared/services/related-attribute-data/rest-form-service.js | [x] | [x] | [x] | [ ] |
81-
| related-attribute-data-rest-portal-service | app-shared/services/related-attribute-data/rest-portal-service.js | [ ] | [ ] | [ ] | [ ] |
82-
| related-attribute-data-rest-portal-service | app-shared/services/related-attribute-data/rest-portal-service.js | [x] | [x] | [x] | [ ] |
83-
| related-attribute-set-rest-portal-service | app-shared/services/related-attribute-set/rest-portal-service.js | [ ] | [ ] | [ ] | [ ] |
84-
| related-attribute-set-rest-portal-service | app-shared/services/related-attribute-set/rest-portal-service.js | [x] | [x] | [x] | [ ] |
71+
| mix-database-rest-portal-service | .legacy/app-shared/services/mix-database/rest-portal-service.js | [x] | [x] | [x] | [ ] |
72+
| mix-database-column-rest-service | .legacy/app-shared/services/mix-database-column/rest-service.js | [x] | [x] | [x] | [ ] |
73+
| mix-database-data-rest-client-service | .legacy/app-shared/services/mix-database-data/rest-client-service.js | [x] | [x] | [x] | [ ] |
74+
| mix-database-data-rest-portal-service | .legacy/app-shared/services/mix-database-data/rest-portal-service.js | [x] | [x] | [x] | [ ] |
75+
| mix-database-data-value-rest-service | .legacy/app-shared/services/mix-database-data-value/rest-service.js | [x] | [x] | [x] | [ ] |
76+
| module-data-rest-mvc-service | .legacy/app-shared/services/module-data-service/rest-mvc-service.js | [x] | [x] | [x] | [ ] |
77+
| post-rest-mvc-service | .legacy/app-shared/services/post-service/rest-mvc-service.js | [ ] | [ ] | [ ] | [ ] |
78+
| post-rest-mvc-service | .legacy/app-shared/services/post-service/rest-mvc-service.js | [x] | [x] | [x] | [ ] |
79+
| related-attribute-data-rest-form-service | .legacy/app-shared/services/related-attribute-data/rest-form-service.js | [ ] | [ ] | [ ] | [ ] |
80+
| related-attribute-data-rest-form-service | .legacy/app-shared/services/related-attribute-data/rest-form-service.js | [x] | [x] | [x] | [ ] |
81+
| related-attribute-data-rest-portal-service | .legacy/app-shared/services/related-attribute-data/rest-portal-service.js | [ ] | [ ] | [ ] | [ ] |
82+
| related-attribute-data-rest-portal-service | .legacy/app-shared/services/related-attribute-data/rest-portal-service.js | [x] | [x] | [x] | [ ] |
83+
| related-attribute-set-rest-portal-service | .legacy/app-shared/services/related-attribute-set/rest-portal-service.js | [ ] | [ ] | [ ] | [ ] |
84+
| related-attribute-set-rest-portal-service | .legacy/app-shared/services/related-attribute-set/rest-portal-service.js | [x] | [x] | [x] | [ ] |
8585

8686
### Shared/Core Domain
8787
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
8888
|-------------------------------|------------------------------------------------------------------|----------|------------|-------------|------|
89-
| common-services | app-shared/services/common-services.js | [x] | [x] | [x] | [ ] |
90-
| crypto-services | app-shared/services/crypto-services.js | [x] | [x] | [x] | [ ] |
91-
| gpay-services | app-shared/services/gpay-services.js | [x] | [x] | [x] | [ ] |
92-
| translator-services | app-shared/services/translator-services.js | [x] | [x] | [x] | [ ] |
93-
| global-settings-services | app-shared/services/global-settings-services.js | [x] | [x] | [x] | [ ] |
94-
| theme-services | app-shared/services/theme-services.js | [x] | [x] | [x] | [ ] |
95-
| store-services | app-shared/services/store-services.js | [x] | [x] | [x] | [ ] |
96-
| shared-module-data-services | app-shared/components/module-data/shared-module-data-services.js | [x] | [x] | [x] | [ ] |
97-
| modal-nav-metas-service | app-portal/components/modal-nav-metas/script.js | [x] | [x] | [x] | [ ] |
98-
| shared global.js | app-portal/shared/global.js | [x] | [x] | [x] | [ ] |
89+
| common-services | .legacy/app-shared/services/common-services.js | [x] | [x] | [x] | [ ] |
90+
| crypto-services | .legacy/app-shared/services/crypto-services.js | [x] | [x] | [x] | [ ] |
91+
| gpay-services | .legacy/app-shared/services/gpay-services.js | [x] | [x] | [x] | [ ] |
92+
| translator-services | .legacy/app-shared/services/translator-services.js | [x] | [x] | [x] | [ ] |
93+
| global-settings-services | .legacy/app-shared/services/global-settings-services.js | [x] | [x] | [x] | [ ] |
94+
| theme-services | .legacy/app-shared/services/theme-services.js | [x] | [x] | [x] | [ ] |
95+
| store-services | .legacy/app-shared/services/store-services.js | [x] | [x] | [x] | [ ] |
96+
| shared-module-data-services | .legacy/app-shared/components/module-data/shared-module-data-services.js | [x] | [x] | [x] | [ ] |
97+
| modal-nav-metas-service | .legacy/app-portal/components/modal-nav-metas/script.js | [x] | [x] | [x] | [ ] |
98+
| shared global.js | .legacy/app-portal/shared/global.js | [x] | [x] | [x] | [ ] |
9999

100100
### Base Abstractions
101101
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
102102
|--------------------|-----------------------------------------------|----------|------------|-------------|------|
103-
| base-service | app-shared/services/base-service.js | [x] | [x] | [x] | [ ] |
104-
| base-rest-service | app-shared/services/base-rest-service.js | [x] | [x] | [x] | [ ] |
103+
| base-service | .legacy/app-shared/services/base-service.js | [x] | [x] | [x] | [ ] |
104+
| base-rest-service | .legacy/app-shared/services/base-rest-service.js | [x] | [x] | [x] | [ ] |
105105

106106
### API Clients
107107
| Module | Legacy Path | Migrated | Refactored | Unit Tested | Docs |
108108
|--------------------------|-----------------------------------------------------|----------|------------|-------------|------|
109-
| api-services | app-shared/services/api-services.js | [x] | [x] | [x] | [ ] |
110-
| auth-services | app-shared/services/auth-services.js | [x] | [x] | [x] | [ ] |
111-
| module-article-services | app-portal/pages/module-post/module-article-services.js | [x] | [x] | [x] | [ ] |
112-
| module-data-services | app-portal/pages/module-data/module-data-services.js | [x] | [x] | [x] | [ ] |
113-
| module-gallery-services | app-portal/pages/module-gallery/module-gallery-services.js | [x] | [x] | [x] | [ ] |
114-
| theme-services (API) | app-shared/services/theme-services.js | [x] | [x] | [x] | [ ] |
115-
| store-services (API) | app-shared/services/store-services.js | [x] | [x] | [x] | [ ] |
109+
| api-services | .legacy/app-shared/services/api-services.js | [x] | [x] | [x] | [ ] |
110+
| auth-services | .legacy/app-shared/services/auth-services.js | [x] | [x] | [x] | [ ] |
111+
| module-article-services | .legacy/app-portal/pages/module-post/module-article-services.js | [x] | [x] | [x] | [ ] |
112+
| module-data-services | .legacy/app-portal/pages/module-data/module-data-services.js | [x] | [x] | [x] | [ ] |
113+
| module-gallery-services | .legacy/app-portal/pages/module-gallery/module-gallery-services.js | [x] | [x] | [x] | [ ] |
114+
| theme-services (API) | .legacy/app-shared/services/theme-services.js | [x] | [x] | [x] | [ ] |
115+
| store-services (API) | .legacy/app-shared/services/store-services.js | [x] | [x] | [x] | [ ] |
116116

117117
---
118118

.github/prompts/MIGRATION_PROGRESS.prompt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ This document tracks the migration of all shared, base, and API modules from the
1818
## 1. Core Migration Steps (Platform & Domain-Driven)
1919
- [x] Monorepo structure created (Lerna/PNPM workspaces)
2020
- [x] TypeScript, Jest, and build tooling configured
21-
- [x] Packages scaffolded: `shared`, `base`, `apis`
21+
- [x] Packages scaffolded: `user`, `template`, `file`, `config`, `navigation`, `database`, `shared`, `base`, `api`
2222
- [x] Initial code audit and mapping
23-
- [ ] Domain-driven package reorganization (User, Template, File, Config, Database, etc.)
23+
- [~] Domain-driven package reorganization (User, Template, File, Config, Database, etc.)
2424
- [ ] SDK bootstrap/config entrypoint (`createMixcoreSdk(config)`) implemented
2525
- [ ] Plugin/adapter interface defined and documented
2626
- [ ] OpenAPI codegen adopted for REST API clients (if OpenAPI specs exist)

.github/prompts/MIGRATION_SPEC.prompt.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,37 @@ Extract all "shared", "base", and "apis" JavaScript/TypeScript code from `@mixco
1717
```
1818
mixcore/javascript-sdk/
1919
├── packages/
20-
│ ├── shared/ # Utilities, helpers, constants
21-
│ ├── base/ # Base classes, abstract models, interfaces
22-
│ └── apis/ # API clients, endpoint wrappers, schema types
23-
├── tests/ # Cross-package/unit/integration tests
20+
│ ├── user/ # User domain services and API clients
21+
│ │ ├── src/
22+
│ │ └── tests/
23+
│ ├── template/ # Template domain services and API clients
24+
│ │ ├── src/
25+
│ │ └── tests/
26+
│ ├── file/ # File domain services and API clients
27+
│ │ ├── src/
28+
│ │ └── tests/
29+
│ ├── config/ # Configuration domain services
30+
│ │ ├── src/
31+
│ │ └── tests/
32+
│ ├── navigation/ # Navigation domain services
33+
│ │ ├── src/
34+
│ │ └── tests/
35+
│ ├── database/ # Database and attribute services
36+
│ │ ├── src/
37+
│ │ └── tests/
38+
│ ├── shared/ # Shared utilities, helpers, constants
39+
│ │ ├── src/
40+
│ │ └── tests/
41+
│ ├── base/ # Base classes, abstract models, interfaces
42+
│ │ ├── src/
43+
│ │ └── tests/
44+
│ ├── api/ # API bootstrap, core API clients, SDK entrypoint
45+
│ │ ├── src/
46+
│ │ └── tests/
47+
├── tests/ # Cross-package/unit/integration tests
2448
├── README.md
2549
├── package.json
26-
└── nx.json / lerna.json (if using monorepo tool)
50+
└── nx.json / lerna.json / pnpm-workspace.yaml (if using monorepo tool)
2751
```
2852
- Prefer TypeScript for new code; convert JS to TS where feasible.
2953

0 commit comments

Comments
 (0)