cloud-ide-lms-model 1.0.67 → 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
- # cloud-ide-lms-model
1
+ # Cloud IDE LMS Model
2
2
 
3
+ [![Version](https://img.shields.io/badge/version-1.0.67-blue.svg)](https://gitlab.com/lms-schools/cloud-ide-lms-model)
4
+ [![License](https://img.shields.io/badge/license-ISC-green.svg)](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
- ## Getting started
9
+ ## Installation
6
10
 
7
- To make it easy for you to get started with GitLab, here's a list of recommended next steps.
11
+ ```bash
12
+ npm install cloud-ide-lms-model
13
+ ```
8
14
 
9
- Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
15
+ ## Project Structure
10
16
 
11
- ## Add your files
17
+ The project is organized into several main directories:
12
18
 
13
- - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
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
- ## Integrate with your tools
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
- - [ ] [Set up project integrations](https://gitlab.com/lms-schools/cloud-ide-lms-model/-/settings/integrations)
28
+ [More details about Schema](./src/schema/README.md)
26
29
 
27
- ## Collaborate with your team
30
+ ### Common Types (`/src/common-types`)
28
31
 
29
- - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
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
- ## Test and Deploy
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
- Use the built-in continuous integration in GitLab.
40
+ [More details about Common Types](./src/common-types/README.md)
38
41
 
39
- - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
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
- # Editing this README
46
+ - `auth/`: Authentication-related models
47
+ - `core/`: Core system models
48
48
 
49
- When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
49
+ [More details about Models](./src/model/README.md)
50
50
 
51
- ## Suggestions for a good README
51
+ ### Routes (`/src/routes`)
52
52
 
53
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
53
+ Contains API route definitions.
54
54
 
55
- ## Name
56
- Choose a self-explaining name for your project.
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
- ## Description
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
- ## Badges
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
- ## Visuals
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
- ## Installation
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
- ## Usage
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
- ## Support
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
- ## Roadmap
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
- ## Contributing
80
- State if you are open to contributions and what your requirements are for accepting them.
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
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
114
+ const app = express();
115
+
116
+ // Register routes
117
+ app.use('/auth', authRoutes);
118
+ app.use('/core', coreRoutes);
119
+ ```
83
120
 
84
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
121
+ ## Development
85
122
 
86
- ## Authors and acknowledgment
87
- Show your appreciation to those who have contributed to the project.
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
- ## Project status
93
- If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
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
@@ -4,3 +4,4 @@ export declare function stringInterpolation(variables: {
4
4
  export declare const cidePath: {
5
5
  join: (path: string[]) => string;
6
6
  };
7
+ export declare const generateRandomAlphanumericString: (length: number) => string;
@@ -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;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "typescript": "^5.4.2"
6
6
  },
7
7
  "name": "cloud-ide-lms-model",
8
- "version": "1.0.67",
8
+ "version": "1.0.68",
9
9
  "description": "Package for Model management of Cloud IDEsys LMS",
10
10
  "main": "lib/index.js",
11
11
  "types": "lib/index.d.ts",