cloud-ide-lms-model 1.0.66 → 1.0.68
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
CHANGED
|
@@ -1,93 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cloud IDE LMS Model
|
|
2
2
|
|
|
3
|
+
[](https://gitlab.com/lms-schools/cloud-ide-lms-model)
|
|
4
|
+
[](https://gitlab.com/lms-schools/cloud-ide-lms-model)
|
|
3
5
|
|
|
6
|
+
## Description
|
|
7
|
+
This package contains the data models, schemas, and utilities for the Cloud IDE Learning Management System (LMS). It provides a consistent interface for database operations, API routes, and type definitions used throughout the Cloud IDE LMS ecosystem.
|
|
4
8
|
|
|
5
|
-
##
|
|
9
|
+
## Installation
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npm install cloud-ide-lms-model
|
|
13
|
+
```
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
## Project Structure
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
The project is organized into several main directories:
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
|
19
|
+
### Schema (`/src/schema`)
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
cd existing_repo
|
|
18
|
-
git remote add origin https://gitlab.com/lms-schools/cloud-ide-lms-model.git
|
|
19
|
-
git branch -M main
|
|
20
|
-
git push -uf origin main
|
|
21
|
-
```
|
|
21
|
+
Contains database schema definitions for the application.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
- `collection_names.ts`: Defines the collection names used in the database
|
|
24
|
+
- `auth/`: Contains authentication-related schemas
|
|
25
|
+
- `core/`: Contains core system schemas
|
|
26
|
+
- `email/`: Contains email service related schemas
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
[More details about Schema](./src/schema/README.md)
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
### Common Types (`/src/common-types`)
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
31
|
-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
-
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
32
|
+
Contains TypeScript type definitions used throughout the application.
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
- `common.ts`: Basic common types used throughout the system
|
|
35
|
+
- `coreControllerResponse.ts`: Response types for core controllers
|
|
36
|
+
- `jwtPayload.ts`: Type definition for JWT authentication payload
|
|
37
|
+
- `loginControllerResponse.ts`: Response types for login operations
|
|
38
|
+
- `userPermissions.ts`: Types related to user permissions and authorization
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
[More details about Common Types](./src/common-types/README.md)
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
41
|
-
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
42
|
-
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
43
|
-
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
42
|
+
### Models (`/src/model`)
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
Contains the data models that implement business logic.
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
- `auth/`: Authentication-related models
|
|
47
|
+
- `core/`: Core system models
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
[More details about Models](./src/model/README.md)
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
### Routes (`/src/routes`)
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Contains API route definitions.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
- `authRoutes.ts`: Authentication-related routes
|
|
56
|
+
- `controllerRoutes.ts`: General controller route utilities
|
|
57
|
+
- `coreRoutes.ts`: Core application routes
|
|
58
|
+
- `designConfigRoutes.ts`: Routes for design configuration
|
|
59
|
+
- `hostManagerRoutes.ts`: Host management routes
|
|
60
|
+
- `userRoutes.ts`: User management routes
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
62
|
+
[More details about Routes](./src/routes/README.md)
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
64
|
+
### Utilities (`/src/utilities`)
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
66
|
+
Contains utility functions and helper methods.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
68
|
+
- `helpers/`: Helper functions grouped by functionality
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
70
|
+
[More details about Utilities](./src/utilities/README.md)
|
|
72
71
|
|
|
73
|
-
##
|
|
74
|
-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
72
|
+
## Usage Examples
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
74
|
+
### Importing Types
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
```typescript
|
|
77
|
+
import {
|
|
78
|
+
CoreControllerResponse,
|
|
79
|
+
JwtPayload
|
|
80
|
+
} from 'cloud-ide-lms-model';
|
|
81
|
+
|
|
82
|
+
// Use types in your code
|
|
83
|
+
function processResponse(response: CoreControllerResponse) {
|
|
84
|
+
// Implementation
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Using Schemas
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import { SomeSchema } from 'cloud-ide-lms-model';
|
|
92
|
+
|
|
93
|
+
// Use schema for validation or type checking
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Using Models
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { SomeModel } from 'cloud-ide-lms-model';
|
|
100
|
+
|
|
101
|
+
// Example usage
|
|
102
|
+
async function useModel() {
|
|
103
|
+
const result = await SomeModel.findById(id);
|
|
104
|
+
// Process result
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Using Routes
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
import { authRoutes, coreRoutes } from 'cloud-ide-lms-model';
|
|
112
|
+
import express from 'express';
|
|
81
113
|
|
|
82
|
-
|
|
114
|
+
const app = express();
|
|
115
|
+
|
|
116
|
+
// Register routes
|
|
117
|
+
app.use('/auth', authRoutes);
|
|
118
|
+
app.use('/core', coreRoutes);
|
|
119
|
+
```
|
|
83
120
|
|
|
84
|
-
|
|
121
|
+
## Development
|
|
85
122
|
|
|
86
|
-
|
|
87
|
-
|
|
123
|
+
### Building the Project
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm run build
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Testing
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm test
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Contributing
|
|
136
|
+
|
|
137
|
+
1. Fork the repository
|
|
138
|
+
2. Create a feature branch: `git checkout -b feature/my-new-feature`
|
|
139
|
+
3. Commit your changes: `git commit -am 'Add some feature'`
|
|
140
|
+
4. Push to the branch: `git push origin feature/my-new-feature`
|
|
141
|
+
5. Submit a pull request
|
|
88
142
|
|
|
89
143
|
## License
|
|
90
|
-
For open source projects, say how it is licensed.
|
|
91
144
|
|
|
92
|
-
|
|
93
|
-
|
|
145
|
+
This project is licensed under the ISC License - see the LICENSE file for details.
|
|
146
|
+
|
|
147
|
+
## Authors
|
|
148
|
+
|
|
149
|
+
- Ankush Bhure - Initial work and maintenance
|
|
150
|
+
|
|
151
|
+
## Repository
|
|
152
|
+
|
|
153
|
+
The project is hosted on GitLab:
|
|
154
|
+
https://gitlab.com/lms-schools/cloud-ide-lms-model.git
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICoreSype, ICoreSypg, ICoreSypgr, ICoreSyptb, ICoreSytm, ITabs } from "../../schema";
|
|
1
|
+
import { ICoreSype, ICoreSypg, ICoreSypgr, ICoreSyptb, ICoreSytm, ICoreSytmLayout, ITabs } from "../../schema";
|
|
2
2
|
import { controllerResponse } from "../../utilities";
|
|
3
3
|
type IDesignConfigErrorLogger = {
|
|
4
4
|
[key in keyof MDesignConfig]: string;
|
|
@@ -20,6 +20,7 @@ interface designConfigResponseData {
|
|
|
20
20
|
controls?: {
|
|
21
21
|
[key: string]: ICoreSype;
|
|
22
22
|
};
|
|
23
|
+
layout?: ICoreSytmLayout;
|
|
23
24
|
tab?: {
|
|
24
25
|
[key: string]: ICoreTabs;
|
|
25
26
|
};
|
|
@@ -7,7 +7,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
7
7
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.cidePath = exports.stringInterpolation = void 0;
|
|
10
|
+
exports.generateRandomAlphanumericString = exports.cidePath = exports.stringInterpolation = void 0;
|
|
11
11
|
async function stringInterpolation(variables, body, data) {
|
|
12
12
|
/*
|
|
13
13
|
const placeholders = {
|
|
@@ -172,3 +172,14 @@ exports.cidePath = {
|
|
|
172
172
|
return path.join("/");
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
|
+
// Function to generate a random alphanumeric string of a given length
|
|
176
|
+
const generateRandomAlphanumericString = (length) => {
|
|
177
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
178
|
+
let result = '';
|
|
179
|
+
const charactersLength = characters.length;
|
|
180
|
+
for (let i = 0; i < length; i++) {
|
|
181
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
184
|
+
};
|
|
185
|
+
exports.generateRandomAlphanumericString = generateRandomAlphanumericString;
|