@fernir2/saas-kit-cli 0.1.29 → 0.1.31
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/base-repo/app-constants/aliases.cjs.js +1 -1
- package/base-repo/app-constants/aliases.js +1 -1
- package/cli/README.md +56 -336
- package/cli/postcss.config.mjs +1 -0
- package/cli/src/app/globals.css +1 -163
- package/level2/cli/create-saas-kit-app/bin/index.cjs.js +4 -4
- package/level2/cli/create-saas-kit-app/bin/index.js +3 -3
- package/level2/fd-toolbox/api/api-client.cjs.js +1 -1
- package/level2/fd-toolbox/api/api-client.js +1 -1
- package/level2/fd-toolbox/api/api-path-names.cjs.js +2 -2
- package/level2/fd-toolbox/api/api-paths.cjs.js +1 -1
- package/level2/fd-toolbox/api/api-paths.js +1 -1
- package/level2/fd-toolbox/api/base-api.cjs.js +1 -1
- package/level2/fd-toolbox/api/base-api.js +1 -1
- package/level2/fd-toolbox/auth/login-states.cjs.js +1 -1
- package/level2/fd-toolbox/auth/login-states.js +1 -1
- package/level2/fd-toolbox/auth/session-storage.cjs.js +1 -1
- package/level2/fd-toolbox/auth/session-storage.js +1 -1
- package/level2/fd-toolbox/auth/tokens.cjs.js +1 -1
- package/level2/fd-toolbox/auth/tokens.js +1 -1
- package/level2/fd-toolbox/constants/constants.cjs.js +1 -1
- package/level2/fd-toolbox/constants/constants.js +1 -1
- package/level2/fd-toolbox/enums/enums.cjs.js +1 -1
- package/level2/fd-toolbox/enums/enums.js +1 -1
- package/level2/fd-toolbox/errors/error-handler.cjs.js +1 -1
- package/level2/fd-toolbox/errors/error-handler.js +1 -1
- package/level2/fd-toolbox/errors/errors.cjs.js +1 -1
- package/level2/fd-toolbox/errors/errors.js +1 -1
- package/level2/fd-toolbox/errors/problem-details.cjs.js +1 -1
- package/level2/fd-toolbox/errors/problem-details.js +1 -1
- package/level2/fd-toolbox/functions/value-checking-functions.cjs.js +1 -1
- package/level2/fd-toolbox/functions/value-checking-functions.js +1 -1
- package/level2/fd-toolbox/http/url/urls.cjs.js +1 -1
- package/level2/fd-toolbox/http/url/urls.js +1 -1
- package/level2/fd-toolbox/infra/env-config.cjs.js +2 -2
- package/level2/fd-toolbox/infra/env-config.js +2 -2
- package/level2/fd-toolbox/infra/env-functions.cjs.js +1 -1
- package/level2/fd-toolbox/infra/env-functions.js +1 -1
- package/level2/fd-toolbox/infra/env-schema.cjs.js +2 -2
- package/level2/fd-toolbox/infra/env-schema.js +2 -2
- package/level2/fd-toolbox/infra/env-store.cjs.js +1 -1
- package/level2/fd-toolbox/infra/env-store.js +1 -1
- package/level2/fd-toolbox/lib/environments.cjs.js +1 -1
- package/level2/fd-toolbox/lib/environments.js +1 -1
- package/level2/fd-toolbox/lib/utils.cjs.js +1 -1
- package/level2/fd-toolbox/lib/utils.js +1 -1
- package/level2/fd-toolbox/local-storage/local-storage.cjs.js +1 -1
- package/level2/fd-toolbox/local-storage/local-storage.js +1 -1
- package/level2/fd-toolbox/logging/loggers.cjs.js +1 -1
- package/level2/fd-toolbox/logging/loggers.js +1 -1
- package/level2/fd-toolbox/notifications.cjs.js +2 -2
- package/level2/fd-toolbox/notifications.js +2 -2
- package/level2/fd-toolbox/odata/odata-constants.cjs.js +1 -1
- package/level2/fd-toolbox/odata/odata-constants.js +1 -1
- package/level2/fd-toolbox/odata/odatas.cjs.js +1 -1
- package/level2/fd-toolbox/odata/odatas.js +1 -1
- package/level2/fd-toolbox/odata/services/odata-filters.cjs.js +1 -1
- package/level2/fd-toolbox/odata/services/odata-filters.js +1 -1
- package/level2/fd-toolbox/paths/paths-names.cjs.js +2 -2
- package/level2/fd-toolbox/paths/paths-names.js +1 -1
- package/level2/fd-toolbox/routing/login-routers.cjs.js +1 -1
- package/level2/fd-toolbox/routing/login-routers.js +1 -1
- package/level2/fd-toolbox/routing/paths.cjs.js +1 -1
- package/level2/fd-toolbox/routing/paths.js +1 -1
- package/level2/fd-toolbox/strings/strings-constants.cjs.js +1 -1
- package/level2/fd-toolbox/strings/strings-constants.js +1 -1
- package/level2/fd-toolbox/strings/strings.cjs.js +1 -1
- package/level2/fd-toolbox/strings/strings.js +1 -1
- package/level2/fd-toolbox/types/ensure-type.cjs.js +1 -1
- package/level2/fd-toolbox/types/ensure-type.js +1 -1
- package/level2/fd-toolbox-core/core/name-of.cjs.js +1 -1
- package/level2/fd-toolbox-core/core/name-of.js +1 -1
- package/level2/fd-toolbox-core/types/resource-with-id.cjs.js +1 -1
- package/level2/fd-toolbox-core/types/resource-with-id.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const aliasSymbols={'atSign':'@','rootAlias':'@root/'};const typescriptAliases={'@':'./src','@cli':'./packages/level2/cli','@server':'./packages/level2/server','@schemas':'./generated','@npm-commands':'./packages/level2/npm-commands','@root':'.','@enricher':'./packages/level2/enricher','@packages':'./packages','@common':'./packages/level2/common','@meta':'./packages/level2/meta','@fd-toolbox':'./packages/level2/fd-toolbox','@fd-toolbox-core':'./packages/level2/fd-toolbox-core','@fd-component-toolbox':'./packages/level2/fd-component-toolbox','@fd-app-toolbox':'./packages/level2/fd-app-toolbox','@client':'./packages/level2/client'};const modulePathAliases=Object['fromEntries'](Object['entries'](typescriptAliases)['map'](([
|
|
4
|
+
const aliasSymbols={'atSign':'@','rootAlias':'@root/'};const typescriptAliases={'@':'./src','@cli':'./packages/level2/cli','@server':'./packages/level2/server','@schemas':'./generated','@npm-commands':'./packages/level2/npm-commands','@root':'.','@enricher':'./packages/level2/enricher','@packages':'./packages','@common':'./packages/level2/common','@meta':'./packages/level2/meta','@fd-toolbox':'./packages/level2/fd-toolbox','@fd-toolbox-core':'./packages/level2/fd-toolbox-core','@fd-component-toolbox':'./packages/level2/fd-component-toolbox','@fd-app-toolbox':'./packages/level2/fd-app-toolbox','@client':'./packages/level2/client'};const modulePathAliases=Object['fromEntries'](Object['entries'](typescriptAliases)['map'](([_0x10cb80,_0x7a5991])=>[_0x10cb80+'/*',[_0x7a5991+'/*']]));
|
|
5
5
|
|
|
6
6
|
exports.aliasSymbols = aliasSymbols;
|
|
7
7
|
exports.modulePathAliases = modulePathAliases;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
const aliasSymbols={'atSign':'@','rootAlias':'@root/'};const typescriptAliases={'@':'./src','@cli':'./packages/level2/cli','@server':'./packages/level2/server','@schemas':'./generated','@npm-commands':'./packages/level2/npm-commands','@root':'.','@enricher':'./packages/level2/enricher','@packages':'./packages','@common':'./packages/level2/common','@meta':'./packages/level2/meta','@fd-toolbox':'./packages/level2/fd-toolbox','@fd-toolbox-core':'./packages/level2/fd-toolbox-core','@fd-component-toolbox':'./packages/level2/fd-component-toolbox','@fd-app-toolbox':'./packages/level2/fd-app-toolbox','@client':'./packages/level2/client'};const modulePathAliases=Object['fromEntries'](Object['entries'](typescriptAliases)['map'](([
|
|
2
|
+
const aliasSymbols={'atSign':'@','rootAlias':'@root/'};const typescriptAliases={'@':'./src','@cli':'./packages/level2/cli','@server':'./packages/level2/server','@schemas':'./generated','@npm-commands':'./packages/level2/npm-commands','@root':'.','@enricher':'./packages/level2/enricher','@packages':'./packages','@common':'./packages/level2/common','@meta':'./packages/level2/meta','@fd-toolbox':'./packages/level2/fd-toolbox','@fd-toolbox-core':'./packages/level2/fd-toolbox-core','@fd-component-toolbox':'./packages/level2/fd-component-toolbox','@fd-app-toolbox':'./packages/level2/fd-app-toolbox','@client':'./packages/level2/client'};const modulePathAliases=Object['fromEntries'](Object['entries'](typescriptAliases)['map'](([_0x10cb80,_0x7a5991])=>[_0x10cb80+'/*',[_0x7a5991+'/*']]));
|
|
3
3
|
|
|
4
4
|
export { aliasSymbols, modulePathAliases, typescriptAliases };
|
package/cli/README.md
CHANGED
|
@@ -1,381 +1,101 @@
|
|
|
1
|
-
|
|
1
|
+
## Getting started
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Our project documentation is still in development. We have a public release scheduled for September 2025, and the
|
|
5
|
-
documentation will be more complete by then. Please note that the current documentation is not final and more
|
|
6
|
-
information will be added over time.
|
|
7
|
-
:::
|
|
3
|
+
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
Run in the terminal:
|
|
5
|
+
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)!
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
npx create-saas-kit-app
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Find in the root folder file `.env.example`. Copy it and rename to the `.env` file. In this file replace the value of `DATABASE_CONNECTION_STRING` with a suitable one.
|
|
17
|
-
|
|
18
|
-
Then run:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npm install
|
|
22
|
-
# Create tutorial folder
|
|
23
|
-
mkdir -p src/app/tutorial
|
|
24
|
-
# Create file
|
|
25
|
-
touch src/app/tutorial/student.resource.ts
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
In SaaS Kit everything revolves around resources. Resource is an entity in your system, it can be a database
|
|
29
|
-
table or api endpoint or business object. `Order`, `Contact`, `Address` or `User` can be examples of resources.
|
|
30
|
-
They are called resources because of Uniform Resource Locator (Url).
|
|
31
|
-
|
|
32
|
-
Let's create Student resource, add the following code inside `student.resource.ts` file:
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
@resourceMetaId("d4507481-8b33-46e7-9c2e-606daab170cc")
|
|
36
|
-
export class Student extends WorkspaceResource {
|
|
37
|
-
name!: string;
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Resolve import for @[resourceId](/docs/src/functions/resourceId) so you don't have red squiggly lines. Going forward we will assume that you
|
|
42
|
-
are going to resolve imports by yourself.
|
|
43
|
-
|
|
44
|
-
Resource files must end with `.resource.ts` extension and they need to have @[resourceId](/docs/src/functions/resourceId) decorator with
|
|
45
|
-
randomly generated Uuid. Let's start the app:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm start
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
In the future you can choose which command will be used for starting the application:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npm start
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
or
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npm run dev
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
`start` will generate metadata files and seed database every time, and `dev` skips of that and is much faster.
|
|
64
|
-
|
|
65
|
-
After starting the application, verify that the resource was properly created in your PostgreSQL database:
|
|
66
|
-
|
|
67
|
-
1. Connect to your PostgreSQL database using your preferred client (psql, pgAdmin, etc.)
|
|
68
|
-
2. Check that the `student` table was created automatically
|
|
69
|
-
3. Verify the table structure has `name` column
|
|
70
|
-
|
|
71
|
-
Once the database setup is verified, open it in the browser. Click `Sign In`.
|
|
72
|
-
Then go to `/view?resource=Student` page to see Student resource.
|
|
73
|
-
Click on `+` button to add a Student. Fill in all nessesary fields and click `Save` button.
|
|
74
|
-
|
|
75
|
-
### Adding resources to Sidebar
|
|
76
|
-
|
|
77
|
-
To have easier access to resource you can add it to Sidebar.
|
|
78
|
-
|
|
79
|
-
To add Student to Sidebar go to `layout.tsx` where you will find `ClientRoot` component
|
|
80
|
-
and add to the component's `sideBarResources` prop
|
|
81
|
-
with `Student` in it:
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
<ClientRoot sideBarResources={["Student"]}>{children}</ClientRoot>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Resource relations
|
|
88
|
-
|
|
89
|
-
Saas-kit automatically understands relations between resources. For this you just need to follow our code conventions.
|
|
90
|
-
For example:
|
|
91
|
-
|
|
92
|
-
1. Create Teacher resource that you want to connect to Student resource:
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
@resourceMetaId("783cbb56-0ee2-4d78-b7f1-2e139c8738d3")
|
|
96
|
-
export class Teacher extends WorkspaceResource {
|
|
97
|
-
name!: string;
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
2. Add links to each other to create relation between Student and Teacher resources.
|
|
102
|
-
For an one-to-many relation you need to add a `{resource}Id` field to first resource
|
|
103
|
-
and a `{resource}List` field to second resource:
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
export class Student extends WorkspaceResource {
|
|
107
|
-
name!: string;
|
|
108
|
-
|
|
109
|
-
teacherId?: string;
|
|
110
|
-
|
|
111
|
-
teacher?: Teacher;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export class Teacher extends WorkspaceResource {
|
|
115
|
-
name!: string;
|
|
116
|
-
|
|
117
|
-
studentList?: Student[];
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
3. Use `npm start` command to create the relation.
|
|
122
|
-
|
|
123
|
-
Now, going to `view?resource=Student` and looking upwards there appears new filter `Teacher`.
|
|
124
|
-
You can click on it and choose a Teacher to filter Students by.
|
|
125
|
-
If you want to add Teacher column to Student [ResourceList](/docs/src/functions/ResourceList), you can add decorator @[expandDescription](/docs/src/functions/expandDescription) to Student resource:
|
|
7
|
+
## Add your files
|
|
126
8
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
name!: string;
|
|
9
|
+
- [ ] [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
|
|
10
|
+
- [ ] [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:
|
|
130
11
|
|
|
131
|
-
@expandDescription()
|
|
132
|
-
teacherId?: string;
|
|
133
|
-
teacher?: Teacher;
|
|
134
|
-
}
|
|
135
12
|
```
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
const student = await fetchResource<Student>("Student", studentId);
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Use [`fetchResources()`](/docs/src/functions/fetchResources) when you need to fetch a list of resources.
|
|
146
|
-
|
|
147
|
-
```ts
|
|
148
|
-
const students = await fetchResources<Student>("Student");
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Getting resources on backend
|
|
152
|
-
|
|
153
|
-
Function [getResourcesByName](/docs/packages/server/fd/fd-toolbox/db/db/functions/getResourcesByName) gets resources by name from database.
|
|
154
|
-
For Student resource function returns array of Student:
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
const students = await getResourcesByName<Student>("Student");
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Function getResourceById gets a resource by its id and resourceName.
|
|
161
|
-
Function throws an error if resource isn't found.
|
|
162
|
-
If you want to skip the error add `false` as a third parameter:
|
|
163
|
-
|
|
164
|
-
```ts
|
|
165
|
-
const students = await getResourceById<Student>("Student", studentId, false);
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Configure search
|
|
169
|
-
|
|
170
|
-
To enable search functionality for a resource based on specific fields, use the [searchable](packages/docs/content/src/functions/searchable.md) decorator on the properties you want to make searchable.
|
|
171
|
-
You can mark multiple fields within a single resource as searchable.
|
|
172
|
-
|
|
173
|
-
```ts
|
|
174
|
-
class Student {
|
|
175
|
-
@searchable()
|
|
176
|
-
name: string;
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
When the `name` field is marked as searchable, users will be able to find a student by typing their name into the search bar at the top-left corner of the page.
|
|
181
|
-
|
|
182
|
-
## Create role with permission
|
|
183
|
-
|
|
184
|
-
First we create the permission via [configurePermission](/docs/packages/server/functions/configurePermission)
|
|
185
|
-
|
|
186
|
-
```ts
|
|
187
|
-
const studentPermisionId = getNewUuid();
|
|
188
|
-
await configurePermission(studentPermisionId, "EditStudent");
|
|
13
|
+
cd existing_repo
|
|
14
|
+
git remote add origin https://gitlab.com/flexdev/gitlab-spokbee-saas.git
|
|
15
|
+
git branch -M main
|
|
16
|
+
git push -uf origin main
|
|
189
17
|
```
|
|
190
18
|
|
|
191
|
-
|
|
19
|
+
## Integrate with your tools
|
|
192
20
|
|
|
193
|
-
|
|
194
|
-
const studentRoleId = getNewUuid();
|
|
195
|
-
const role: Role = {
|
|
196
|
-
id: studentRoleId,
|
|
197
|
-
name: "ClassPresident",
|
|
198
|
-
level: permissionLevels.ten,
|
|
199
|
-
};
|
|
200
|
-
await upsertRole(role);
|
|
201
|
-
```
|
|
21
|
+
- [ ] [Set up project integrations](https://gitlab.com/flexdev/gitlab-spokbee-saas/-/settings/integrations)
|
|
202
22
|
|
|
203
|
-
|
|
23
|
+
## Collaborate with your team
|
|
204
24
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
])
|
|
209
|
-
|
|
25
|
+
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
26
|
+
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
27
|
+
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
28
|
+
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
29
|
+
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
210
30
|
|
|
211
|
-
##
|
|
212
|
-
|
|
213
|
-
Here are the top 5 most commonly used decorators — check out the documentation to learn more about them:
|
|
214
|
-
|
|
215
|
-
- [expandDescription](docs/src/functions/expandDescription)
|
|
216
|
-
- [accessByUserId](docs/src/functions/accessByUserId)
|
|
217
|
-
- [descriptionProperty](docs/src/functions/descriptionProperty)
|
|
218
|
-
- [notDisplayable](docs/src/functions/notDisplayable)
|
|
219
|
-
- [icon](docs/src/functions/icon)
|
|
220
|
-
|
|
221
|
-
## Seeding data
|
|
222
|
-
|
|
223
|
-
If you want to add additional data that is seeded on the app start you can open file `npm-commands/seed-db/index.ts`. In it, using function [crudCreate](/docs/packages/server/meta/fd-meta/basic-crud/cruds/functions/crudCreate) you can add any resources into your database.
|
|
224
|
-
Function [crudCreate](/docs/packages/server/meta/fd-meta/basic-crud/cruds/functions/crudCreate) accepts [CrudUpdateConfig](docs/packages/server/interfaces/CrudUpdateConfig) parameter and creates a resource.
|
|
225
|
-
|
|
226
|
-
```ts
|
|
227
|
-
async function seed() {
|
|
228
|
-
try {
|
|
229
|
-
await seedDataBase();
|
|
230
|
-
await createTeacher();
|
|
231
|
-
await createStudent();
|
|
232
|
-
logInfo("Database seeded succesfully");
|
|
233
|
-
process.exit(0);
|
|
234
|
-
} catch (err) {
|
|
235
|
-
if (err instanceof Error) console.log("Error seeding database", err);
|
|
236
|
-
|
|
237
|
-
process.exit(1);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
async function createStudent() {
|
|
242
|
-
const studentConfig: CrudUpdateConfig<Student> = {
|
|
243
|
-
resourceName: "Student",
|
|
244
|
-
resource: studentData,
|
|
245
|
-
};
|
|
246
|
-
await crudCreate<Student>(studentConfig);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
async function createTeacher() {
|
|
250
|
-
const teacherConfig: CrudUpdateConfig<Teacher> = {
|
|
251
|
-
resourceName: "Teacher",
|
|
252
|
-
resource: teacherData,
|
|
253
|
-
};
|
|
254
|
-
await crudCreate<Teacher>(teacherConfig);
|
|
255
|
-
}
|
|
256
|
-
```
|
|
31
|
+
## Test and Deploy
|
|
257
32
|
|
|
258
|
-
|
|
33
|
+
Use the built-in continuous integration in GitLab.
|
|
259
34
|
|
|
260
|
-
|
|
35
|
+
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
|
36
|
+
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
37
|
+
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
38
|
+
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
39
|
+
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
261
40
|
|
|
262
|
-
|
|
41
|
+
---
|
|
263
42
|
|
|
264
|
-
|
|
43
|
+
# Editing this README
|
|
265
44
|
|
|
266
|
-
|
|
267
|
-
The first argument specifies which CRUD action you want to verify.
|
|
45
|
+
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.
|
|
268
46
|
|
|
269
|
-
|
|
270
|
-
checkAndNotifyCrudPermission(crudActions.create, uiMeta.resourceMeta, studentData);
|
|
271
|
-
```
|
|
47
|
+
## Suggestions for a good README
|
|
272
48
|
|
|
273
|
-
|
|
49
|
+
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.
|
|
274
50
|
|
|
275
|
-
|
|
51
|
+
## Name
|
|
276
52
|
|
|
277
|
-
|
|
278
|
-
[hasPermissionByPermissionCheckConfig](docs/src/functions/hasPermissionByPermissionCheckConfig) — checks permissions based on a prepared config.
|
|
53
|
+
Choose a self-explaining name for your project.
|
|
279
54
|
|
|
280
|
-
|
|
281
|
-
const permissionConfig = getPermissionCheckConfig(userId, studentMeta, studentData);
|
|
282
|
-
const hasPermission = await hasPermissionByPermissionCheckConfig(permissionConfig);
|
|
283
|
-
console.log(hasPermission) //false
|
|
284
|
-
```
|
|
55
|
+
## Description
|
|
285
56
|
|
|
286
|
-
|
|
57
|
+
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.
|
|
287
58
|
|
|
288
|
-
|
|
289
|
-
const hasPermission = await hasPermissionByUserId("Student", crudActions.create, userId);
|
|
290
|
-
console.log(hasPermission) //false
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
#### Add custom permission checks
|
|
59
|
+
## Badges
|
|
294
60
|
|
|
295
|
-
|
|
61
|
+
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.
|
|
296
62
|
|
|
297
|
-
|
|
298
|
-
const customChecker: ResourcePermissionChecker = async (
|
|
299
|
-
studentData,
|
|
300
|
-
userId,
|
|
301
|
-
crudActions.create
|
|
302
|
-
) => {
|
|
303
|
-
return userId === userIds.timWId;
|
|
304
|
-
};
|
|
63
|
+
## Visuals
|
|
305
64
|
|
|
306
|
-
|
|
307
|
-
@resourceId("d4507481-8b33-46e7-9c2e-606daab170cc")
|
|
308
|
-
export class Student extends WorkspaceResource {...}
|
|
309
|
-
```
|
|
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.
|
|
310
66
|
|
|
311
|
-
|
|
67
|
+
## Installation
|
|
312
68
|
|
|
313
|
-
|
|
69
|
+
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.
|
|
314
70
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
```ts
|
|
318
|
-
await sendNotification(
|
|
319
|
-
studentUserId,
|
|
320
|
-
"New feature available",
|
|
321
|
-
"Check out the new feature in your dashboard"
|
|
322
|
-
);
|
|
323
|
-
```
|
|
71
|
+
## Usage
|
|
324
72
|
|
|
325
|
-
It
|
|
73
|
+
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.
|
|
326
74
|
|
|
327
|
-
|
|
75
|
+
## Support
|
|
328
76
|
|
|
329
|
-
|
|
77
|
+
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.
|
|
330
78
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
- `isExternal = true`
|
|
334
|
-
- `FD_SEND_EMAIL = true` in `.env`
|
|
335
|
-
- register with _SendGrid_ to get and configure `FD_EMAIL_SERVICE_URL` and `FD_SERVICE_KEY` in `.env`
|
|
336
|
-
|
|
337
|
-
```ts
|
|
338
|
-
await sendNotification(
|
|
339
|
-
studentUserId,
|
|
340
|
-
"New feature available",
|
|
341
|
-
"Check out the new feature in your dashboard",
|
|
342
|
-
true
|
|
343
|
-
);
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
Functions for showing simple toast UI notifications:
|
|
347
|
-
|
|
348
|
-
```ts
|
|
349
|
-
notify("Notify message");
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
```ts
|
|
353
|
-
notifySuccess("Notify success message");
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
```ts
|
|
357
|
-
notifyFailure("Notify failure message");
|
|
358
|
-
```
|
|
79
|
+
## Roadmap
|
|
359
80
|
|
|
360
|
-
|
|
361
|
-

|
|
81
|
+
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
362
82
|
|
|
363
|
-
##
|
|
83
|
+
## Contributing
|
|
364
84
|
|
|
365
|
-
|
|
85
|
+
State if you are open to contributions and what your requirements are for accepting them.
|
|
366
86
|
|
|
367
|
-
|
|
87
|
+
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.
|
|
368
88
|
|
|
369
|
-
|
|
89
|
+
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.
|
|
370
90
|
|
|
371
|
-
|
|
91
|
+
## Authors and acknowledgment
|
|
372
92
|
|
|
373
|
-
|
|
93
|
+
Show your appreciation to those who have contributed to the project.
|
|
374
94
|
|
|
375
|
-
|
|
95
|
+
## License
|
|
376
96
|
|
|
377
|
-
|
|
97
|
+
For open source projects, say how it is licensed.
|
|
378
98
|
|
|
379
|
-
|
|
99
|
+
## Project status
|
|
380
100
|
|
|
381
|
-
|
|
101
|
+
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.
|
package/cli/postcss.config.mjs
CHANGED
package/cli/src/app/globals.css
CHANGED
|
@@ -1,163 +1 @@
|
|
|
1
|
-
@import "
|
|
2
|
-
@import "quill/dist/quill.snow.css";
|
|
3
|
-
@import "../../packages/level2/client/styles/rich-text-editor.css";
|
|
4
|
-
|
|
5
|
-
@tailwind base;
|
|
6
|
-
@tailwind components;
|
|
7
|
-
@tailwind utilities;
|
|
8
|
-
|
|
9
|
-
@layer base {
|
|
10
|
-
:root {
|
|
11
|
-
--background: 0 0% 100%;
|
|
12
|
-
--foreground: 222.2 84% 4.9%;
|
|
13
|
-
--card: 0 0% 100%;
|
|
14
|
-
--card-foreground: 222.2 84% 4.9%;
|
|
15
|
-
--popover: 0 0% 100%;
|
|
16
|
-
--popover-foreground: 222.2 84% 4.9%;
|
|
17
|
-
--primary: 222.2 47.4% 11.2%;
|
|
18
|
-
--primary-foreground: 210 40% 98%;
|
|
19
|
-
--secondary: 210 40% 96.1%;
|
|
20
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
21
|
-
--muted: 210 40% 96.1%;
|
|
22
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
23
|
-
--accent: 210 40% 96.1%;
|
|
24
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
25
|
-
--destructive: 0 84.2% 60.2%;
|
|
26
|
-
--destructive-foreground: 210 40% 98%;
|
|
27
|
-
--border: 214.3 31.8% 91.4%;
|
|
28
|
-
--input: 214.3 31.8% 91.4%;
|
|
29
|
-
--ring: 222.2 84% 4.9%;
|
|
30
|
-
--radius: 0.5rem;
|
|
31
|
-
|
|
32
|
-
--chart-1: 12 76% 61%;
|
|
33
|
-
--chart-2: 173 58% 39%;
|
|
34
|
-
--chart-3: 197 37% 24%;
|
|
35
|
-
--chart-4: 43 74% 66%;
|
|
36
|
-
--chart-5: 27 87% 67%;
|
|
37
|
-
|
|
38
|
-
--fd-accent: 190, 100%, 34%; /* accent-600 */
|
|
39
|
-
--fd-accent-light: 172, 100%, 37%; /* accent-100 */
|
|
40
|
-
|
|
41
|
-
--fd-tertiary-50: 216, 33%, 97%;
|
|
42
|
-
--fd-tertiary-200: 206, 35%, 86%;
|
|
43
|
-
--fd-tertiary-600: 206, 38%, 39%;
|
|
44
|
-
--fd-tertiary-700: 208, 38%, 32%;
|
|
45
|
-
--fd-tertiary-900: 208, 31%, 24%;
|
|
46
|
-
--fd-green-accent: 120, 100%, 34%;
|
|
47
|
-
|
|
48
|
-
--fd-shadow: 0, 0%, 0%, 0.25;
|
|
49
|
-
|
|
50
|
-
--fd-toolbar: var(--fd-tertiary-900);
|
|
51
|
-
--fd-toolbar-input: var(--fd-tertiary-700);
|
|
52
|
-
--fd-toolbar-hover: var(--fd-tertiary-700);
|
|
53
|
-
--fd-toolbar-keys: var(--fd-tertiary-200);
|
|
54
|
-
--fd-toolbar-placeholder: var(--fd-tertiary-50);
|
|
55
|
-
--fd-toolbar-shadow: var(--fd-shadow);
|
|
56
|
-
--fd-toolbar-separators: var(--fd-tertiary-600);
|
|
57
|
-
--fd-sidebar-icons: var(--fd-tertiary-50);
|
|
58
|
-
--fd-toolbar-icons: var(--fd-tertiary-50);
|
|
59
|
-
--fd-toolbar-border: var(--fd-tertiary-700);
|
|
60
|
-
--fd-toolbar-button: var(--fd-tertiary-600);
|
|
61
|
-
|
|
62
|
-
--subtle-400: 210, 10%, 65%;
|
|
63
|
-
--subtle-500: 220, 9%, 46%;
|
|
64
|
-
--subtle-700: 220, 20%, 27%;
|
|
65
|
-
|
|
66
|
-
--fd-enum-default-color: 0, 0%, 92%;
|
|
67
|
-
--fd-enum-color-1: 200, 50%, 87%;
|
|
68
|
-
--fd-enum-color-2: 120, 35%, 87%;
|
|
69
|
-
--fd-enum-color-3: 340, 61%, 91%;
|
|
70
|
-
--fd-enum-color-4: 19, 45%, 88%;
|
|
71
|
-
--fd-enum-color-5: 340, 61%, 91%;
|
|
72
|
-
--fd-enum-color-6: 9, 90%, 91%;
|
|
73
|
-
--fd-enum-color-7: 283, 44%, 90%;
|
|
74
|
-
--fd-enum-color-8: 9, 90%, 91%;
|
|
75
|
-
--fd-enum-color-9: 200, 50%, 87%;
|
|
76
|
-
--fd-enum-color-10: 38, 87%, 90%;
|
|
77
|
-
--fd-enum-color-11: 283, 44%, 90%;
|
|
78
|
-
--fd-enum-color-12: 283, 44%, 90%;
|
|
79
|
-
--fd-enum-color-13: 340, 61%, 91%;
|
|
80
|
-
--fd-enum-color-14: 283, 44%, 90%;
|
|
81
|
-
--fd-enum-color-15: 38, 87%, 90%;
|
|
82
|
-
--fd-enum-color-16: 0, 0%, 92%;
|
|
83
|
-
--fd-enum-color-17: 9, 90%, 91%;
|
|
84
|
-
--fd-enum-color-18: 19, 45%, 88%;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.dark {
|
|
88
|
-
--background: 222.2 84% 4.9%;
|
|
89
|
-
--foreground: 210 40% 98%;
|
|
90
|
-
--card: 222.2 84% 4.9%;
|
|
91
|
-
--card-foreground: 210 40% 98%;
|
|
92
|
-
--popover: 222.2 84% 4.9%;
|
|
93
|
-
--popover-foreground: 210 40% 98%;
|
|
94
|
-
--primary: 210 40% 98%;
|
|
95
|
-
--primary-foreground: 222.2 47.4% 11.2%;
|
|
96
|
-
--secondary: 217.2 32.6% 17.5%;
|
|
97
|
-
--secondary-foreground: 210 40% 98%;
|
|
98
|
-
--muted: 217.2 32.6% 17.5%;
|
|
99
|
-
--muted-foreground: 215 20.2% 65.1%;
|
|
100
|
-
--accent: 217.2 32.6% 17.5%;
|
|
101
|
-
--accent-foreground: 210 40% 98%;
|
|
102
|
-
--destructive: 0 62.8% 30.6%;
|
|
103
|
-
--destructive-foreground: 210 40% 98%;
|
|
104
|
-
--border: 217.2 32.6% 17.5%;
|
|
105
|
-
--input: 217.2 32.6% 17.5%;
|
|
106
|
-
--ring: 212.7 26.8% 83.9;
|
|
107
|
-
|
|
108
|
-
--radius: 0.5rem;
|
|
109
|
-
|
|
110
|
-
--fd-accent: 190, 100%, 34%; /* accent-600 */
|
|
111
|
-
--fd-accent-light: 172, 100%, 37%; /* accent-100 */
|
|
112
|
-
|
|
113
|
-
--fd-tertiary-50: 216, 33%, 97%;
|
|
114
|
-
--fd-tertiary-200: 206, 35%, 86%;
|
|
115
|
-
--fd-tertiary-600: 206, 38%, 39%;
|
|
116
|
-
--fd-tertiary-700: 208, 38%, 32%;
|
|
117
|
-
--fd-tertiary-900: 208, 31%, 24%;
|
|
118
|
-
|
|
119
|
-
--fd-shadow: 0, 0%, 0%, 0.25;
|
|
120
|
-
|
|
121
|
-
--fd-toolbar: var(--fd-tertiary-900);
|
|
122
|
-
--fd-toolbar-input: var(--fd-tertiary-700);
|
|
123
|
-
--fd-toolbar-hover: var(--fd-tertiary-700);
|
|
124
|
-
--fd-toolbar-keys: var(--fd-tertiary-200);
|
|
125
|
-
--fd-toolbar-placeholder: var(--fd-tertiary-50);
|
|
126
|
-
--fd-toolbar-shadow: var(--fd-shadow);
|
|
127
|
-
--fd-toolbar-separators: var(--fd-tertiary-600);
|
|
128
|
-
--fd-sidebar-icons: var(--fd-tertiary-50);
|
|
129
|
-
--fd-toolbar-icons: var(--fd-tertiary-50);
|
|
130
|
-
--fd-toolbar-border: var(--fd-tertiary-700);
|
|
131
|
-
--fd-toolbar-button: var(--fd-tertiary-600);
|
|
132
|
-
|
|
133
|
-
--subtle-400: 210, 10%, 65%;
|
|
134
|
-
--subtle-500: 220, 9%, 46%;
|
|
135
|
-
--subtle-700: 220, 20%, 27%;
|
|
136
|
-
|
|
137
|
-
--chart-1: 220 70% 50%;
|
|
138
|
-
--chart-2: 160 60% 45%;
|
|
139
|
-
--chart-3: 30 80% 55%;
|
|
140
|
-
--chart-4: 280 65% 60%;
|
|
141
|
-
--chart-5: 340 75% 55%;
|
|
142
|
-
|
|
143
|
-
--fd-enum-default-color: 0, 0%, 22%;
|
|
144
|
-
--fd-enum-color-1: 219, 43%, 30%;
|
|
145
|
-
--fd-enum-color-2: 152, 37%, 27%;
|
|
146
|
-
--fd-enum-color-3: 328, 37%, 30%;
|
|
147
|
-
--fd-enum-color-4: 27, 63%, 32%;
|
|
148
|
-
--fd-enum-color-5: 328, 37%, 30%;
|
|
149
|
-
--fd-enum-color-6: 10, 40%, 31%;
|
|
150
|
-
--fd-enum-color-7: 268, 38%, 29%;
|
|
151
|
-
--fd-enum-color-8: 10, 40%, 31%;
|
|
152
|
-
--fd-enum-color-9: 219, 43%, 30%;
|
|
153
|
-
--fd-enum-color-10: 37, 56%, 36%;
|
|
154
|
-
--fd-enum-color-11: 268, 38%, 29%;
|
|
155
|
-
--fd-enum-color-12: 268, 38%, 29%;
|
|
156
|
-
--fd-enum-color-13: 328, 37%, 30%;
|
|
157
|
-
--fd-enum-color-14: 268, 38%, 29%;
|
|
158
|
-
--fd-enum-color-15: 37, 56%, 36%;
|
|
159
|
-
--fd-enum-color-16: 0, 0%, 35%;
|
|
160
|
-
--fd-enum-color-17: 10, 40%, 31%;
|
|
161
|
-
--fd-enum-color-18: 27, 63%, 32%;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
1
|
+
@import "@fernir2/saas-kit/styles";
|