@eeplatform/basic-edu 1.0.0
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/workflows/main.yml +17 -0
- package/.github/workflows/publish.yml +39 -0
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.js +1405 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1384 -0
- package/dist/index.mjs.map +1 -0
- package/dist/public/handlebars/forget-password.hbs +14 -0
- package/dist/public/handlebars/member-invite.hbs +17 -0
- package/dist/public/handlebars/sign-up.hbs +14 -0
- package/dist/public/handlebars/user-invite.hbs +13 -0
- package/package.json +31 -0
- package/tsconfig.json +108 -0
- package/tsup.config.ts +10 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
+
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
+
|
|
7
|
+
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "public",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- "**"
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-node@v4
|
|
13
|
+
with:
|
|
14
|
+
node-version: 20.x
|
|
15
|
+
cache: "yarn"
|
|
16
|
+
- run: yarn install --frozen-lockfile
|
|
17
|
+
- run: yarn lint && yarn build
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
on:
|
|
3
|
+
workflow_run:
|
|
4
|
+
workflows: [CI]
|
|
5
|
+
branches: [main]
|
|
6
|
+
types: [completed]
|
|
7
|
+
|
|
8
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
pull-requests: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
publish:
|
|
16
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: 20.x
|
|
24
|
+
cache: "yarn" # Use yarn for caching
|
|
25
|
+
cache-dependency-path: yarn.lock # Cache Yarn lockfile
|
|
26
|
+
|
|
27
|
+
- run: yarn install --immutable # Install dependencies with immutable lockfile
|
|
28
|
+
|
|
29
|
+
- name: Create .npmrc for publishing
|
|
30
|
+
run: |
|
|
31
|
+
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' > ~/.npmrc
|
|
32
|
+
|
|
33
|
+
- name: Create Release Pull Request or Publish
|
|
34
|
+
id: changesets
|
|
35
|
+
uses: changesets/action@v1
|
|
36
|
+
with:
|
|
37
|
+
publish: yarn release # Use yarn for publishing
|
|
38
|
+
env:
|
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/CHANGELOG.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { ObjectId, ClientSession } from 'mongodb';
|
|
3
|
+
import { Request, Response, NextFunction } from 'express';
|
|
4
|
+
|
|
5
|
+
type TRegion = {
|
|
6
|
+
_id?: ObjectId;
|
|
7
|
+
name?: string;
|
|
8
|
+
director?: ObjectId;
|
|
9
|
+
directorName?: string;
|
|
10
|
+
createdAt?: string;
|
|
11
|
+
updatedAt?: string;
|
|
12
|
+
deletedAt?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const schemaRegion: Joi.ObjectSchema<any>;
|
|
15
|
+
declare function modelRegion(value: TRegion): TRegion;
|
|
16
|
+
|
|
17
|
+
declare function useRegionRepo(): {
|
|
18
|
+
createIndexes: () => Promise<void>;
|
|
19
|
+
add: (value: TRegion, session?: ClientSession) => Promise<ObjectId>;
|
|
20
|
+
getAll: ({ search, page, limit, sort, status, }?: {
|
|
21
|
+
search?: string | undefined;
|
|
22
|
+
page?: number | undefined;
|
|
23
|
+
limit?: number | undefined;
|
|
24
|
+
sort?: {} | undefined;
|
|
25
|
+
status?: string | undefined;
|
|
26
|
+
}) => Promise<Record<string, any>>;
|
|
27
|
+
getById: (_id: string | ObjectId) => Promise<TRegion>;
|
|
28
|
+
updateFieldById: ({ _id, field, value }?: {
|
|
29
|
+
_id: string | ObjectId;
|
|
30
|
+
field: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}, session?: ClientSession) => Promise<string>;
|
|
33
|
+
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
34
|
+
getByName: (name: string) => Promise<TRegion>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
declare function useRegionController(): {
|
|
38
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
39
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
40
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
41
|
+
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
42
|
+
updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
43
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type TDivision = {
|
|
47
|
+
_id?: ObjectId;
|
|
48
|
+
name?: string;
|
|
49
|
+
region?: ObjectId;
|
|
50
|
+
regionName?: string;
|
|
51
|
+
superintendent?: ObjectId;
|
|
52
|
+
superintendentName?: string;
|
|
53
|
+
createdAt?: string;
|
|
54
|
+
updatedAt?: string;
|
|
55
|
+
deletedAt?: string;
|
|
56
|
+
};
|
|
57
|
+
declare const schemaDivision: Joi.ObjectSchema<any>;
|
|
58
|
+
declare function modelDivision(value: TDivision): TDivision;
|
|
59
|
+
|
|
60
|
+
declare function useDivisionRepo(): {
|
|
61
|
+
createIndexes: () => Promise<void>;
|
|
62
|
+
add: (value: TDivision, session?: ClientSession) => Promise<ObjectId>;
|
|
63
|
+
getAll: ({ search, page, limit, sort, status, }?: {
|
|
64
|
+
search?: string | undefined;
|
|
65
|
+
page?: number | undefined;
|
|
66
|
+
limit?: number | undefined;
|
|
67
|
+
sort?: {} | undefined;
|
|
68
|
+
status?: string | undefined;
|
|
69
|
+
}) => Promise<Record<string, any>>;
|
|
70
|
+
getById: (_id: string | ObjectId) => Promise<TDivision>;
|
|
71
|
+
updateFieldById: ({ _id, field, value }?: {
|
|
72
|
+
_id: string | ObjectId;
|
|
73
|
+
field: string;
|
|
74
|
+
value: string;
|
|
75
|
+
}, session?: ClientSession) => Promise<string>;
|
|
76
|
+
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
77
|
+
getByName: (name: string) => Promise<TDivision>;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
declare function useDivisionController(): {
|
|
81
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
82
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
83
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
84
|
+
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
85
|
+
updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
86
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type TSchool = {
|
|
90
|
+
_id?: ObjectId;
|
|
91
|
+
name?: string;
|
|
92
|
+
region?: ObjectId;
|
|
93
|
+
regionName?: string;
|
|
94
|
+
division?: ObjectId;
|
|
95
|
+
divisionName?: string;
|
|
96
|
+
principal?: ObjectId;
|
|
97
|
+
principalName?: string;
|
|
98
|
+
createdAt?: string;
|
|
99
|
+
updatedAt?: string;
|
|
100
|
+
deletedAt?: string;
|
|
101
|
+
};
|
|
102
|
+
declare const schemaSchool: Joi.ObjectSchema<any>;
|
|
103
|
+
declare function modelSchool(value: TSchool): TSchool;
|
|
104
|
+
|
|
105
|
+
declare function useSchoolRepo(): {
|
|
106
|
+
createIndexes: () => Promise<void>;
|
|
107
|
+
add: (value: TSchool, session?: ClientSession) => Promise<ObjectId>;
|
|
108
|
+
getAll: ({ search, page, limit, sort, status, }?: {
|
|
109
|
+
search?: string | undefined;
|
|
110
|
+
page?: number | undefined;
|
|
111
|
+
limit?: number | undefined;
|
|
112
|
+
sort?: {} | undefined;
|
|
113
|
+
status?: string | undefined;
|
|
114
|
+
}) => Promise<Record<string, any>>;
|
|
115
|
+
getById: (_id: string | ObjectId) => Promise<TSchool>;
|
|
116
|
+
updateFieldById: ({ _id, field, value }?: {
|
|
117
|
+
_id: string | ObjectId;
|
|
118
|
+
field: string;
|
|
119
|
+
value: string;
|
|
120
|
+
}, session?: ClientSession) => Promise<string>;
|
|
121
|
+
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
122
|
+
getByName: (name: string) => Promise<TSchool>;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare function useSchoolController(): {
|
|
126
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
127
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
128
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
129
|
+
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
130
|
+
updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
131
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { TDivision, TRegion, TSchool, modelDivision, modelRegion, modelSchool, schemaDivision, schemaRegion, schemaSchool, useDivisionController, useDivisionRepo, useRegionController, useRegionRepo, useSchoolController, useSchoolRepo };
|