@shizuoka-its/core 2.0.0-rc.0 → 2.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/README.md +7 -5
- package/dist/domain/aggregates/event/Event.d.ts +2 -0
- package/dist/domain/aggregates/event/Event.js +6 -0
- package/dist/domain/aggregates/event/Exhibit.d.ts +5 -0
- package/dist/domain/aggregates/event/Exhibit.js +15 -0
- package/dist/domain/aggregates/event/LightningTalk.d.ts +3 -0
- package/dist/domain/aggregates/event/LightningTalk.js +9 -0
- package/dist/domain/aggregates/member/DiscordAccount.d.ts +4 -2
- package/dist/domain/aggregates/member/DiscordAccount.js +6 -0
- package/dist/domain/aggregates/member/Member.d.ts +6 -1
- package/dist/domain/aggregates/member/Member.js +18 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# @shizuoka-its/core
|
|
2
|
-
|
|
2
|
+
静岡大学ITソルーション室(ITS)で使用する共通のデータベースアクセス層とビジネスロジックを提供するTypeScriptライブラリです。
|
|
3
3
|
|
|
4
4
|
## インストール
|
|
5
5
|
```bash
|
|
@@ -7,15 +7,17 @@ npm install @shizuoka-its/core
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## 利用例
|
|
10
|
-
|
|
10
|
+
メンバー情報表示
|
|
11
11
|
```ts
|
|
12
12
|
import { createMemberUseCases, type Member } from "@shizuoka-its/core";
|
|
13
13
|
|
|
14
14
|
const memberUseCases = createMemberUseCases();
|
|
15
15
|
|
|
16
16
|
// メンバー情報の取得
|
|
17
|
-
const
|
|
17
|
+
const result = await memberUseCases.getMemberByEmail
|
|
18
18
|
.execute({ email: "example@shizuoka.ac.jp" });
|
|
19
|
+
|
|
20
|
+
console.log(result.member);
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
## アーキテクチャ
|
|
@@ -127,5 +129,5 @@ npx prisma studio
|
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
## コントリビューター
|
|
130
|
-
@KinjiKawaguchi
|
|
131
|
-
@KikyoNanakusa
|
|
132
|
+
- @KinjiKawaguchi
|
|
133
|
+
- @KikyoNanakusa
|
|
@@ -10,6 +10,11 @@ export declare class Exhibit {
|
|
|
10
10
|
private memberIds;
|
|
11
11
|
static createWithLightningTalk(id: string, name: string, lt: LightningTalk, description?: string, markdownContent?: string, url?: Url): Exhibit;
|
|
12
12
|
constructor(id: string, name: string, description?: string | undefined, markdownContent?: string | undefined, url?: Url | undefined);
|
|
13
|
+
getName(): string;
|
|
14
|
+
getDescription(): string | undefined;
|
|
15
|
+
getMarkdownContent(): string | undefined;
|
|
16
|
+
getUrl(): Url | undefined;
|
|
17
|
+
getLightningTalk(): LightningTalk | undefined;
|
|
13
18
|
getMemberIds(): string[];
|
|
14
19
|
changeName(newName: string): void;
|
|
15
20
|
changeDescription(newDescription: string): void;
|
|
@@ -21,6 +21,21 @@ class Exhibit {
|
|
|
21
21
|
this.url = url;
|
|
22
22
|
this.memberIds = new Set();
|
|
23
23
|
}
|
|
24
|
+
getName() {
|
|
25
|
+
return this.name;
|
|
26
|
+
}
|
|
27
|
+
getDescription() {
|
|
28
|
+
return this.description;
|
|
29
|
+
}
|
|
30
|
+
getMarkdownContent() {
|
|
31
|
+
return this.markdownContent;
|
|
32
|
+
}
|
|
33
|
+
getUrl() {
|
|
34
|
+
return this.url;
|
|
35
|
+
}
|
|
36
|
+
getLightningTalk() {
|
|
37
|
+
return this.lightningTalk;
|
|
38
|
+
}
|
|
24
39
|
getMemberIds() {
|
|
25
40
|
return Array.from(this.memberIds);
|
|
26
41
|
}
|
|
@@ -5,6 +5,9 @@ export declare class LightningTalk {
|
|
|
5
5
|
private durationMinutes;
|
|
6
6
|
private slideUrl?;
|
|
7
7
|
constructor(exhibitId: string, startTime: Date, durationMinutes: LightningTalkDuration, slideUrl?: Url | undefined);
|
|
8
|
+
getStartTime(): Date;
|
|
9
|
+
getDurationMinutes(): LightningTalkDuration;
|
|
10
|
+
getSlideUrl(): Url | undefined;
|
|
8
11
|
changeSlideUrl(newSlideUrl: Url): void;
|
|
9
12
|
changeDuration(newDuration: LightningTalkDuration): void;
|
|
10
13
|
changeStartTime(newStartTime: Date): void;
|
|
@@ -8,6 +8,15 @@ class LightningTalk {
|
|
|
8
8
|
this.durationMinutes = durationMinutes;
|
|
9
9
|
this.slideUrl = slideUrl;
|
|
10
10
|
}
|
|
11
|
+
getStartTime() {
|
|
12
|
+
return this.startTime;
|
|
13
|
+
}
|
|
14
|
+
getDurationMinutes() {
|
|
15
|
+
return this.durationMinutes;
|
|
16
|
+
}
|
|
17
|
+
getSlideUrl() {
|
|
18
|
+
return this.slideUrl;
|
|
19
|
+
}
|
|
11
20
|
changeSlideUrl(newSlideUrl) {
|
|
12
21
|
this.slideUrl = newSlideUrl;
|
|
13
22
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export declare class DiscordAccount {
|
|
2
2
|
readonly id: string;
|
|
3
|
-
nickName
|
|
4
|
-
memberId
|
|
3
|
+
private nickName;
|
|
4
|
+
private memberId;
|
|
5
5
|
constructor(id: string, // Discord ID
|
|
6
6
|
nickName: string, memberId: string);
|
|
7
|
+
getNickName(): string;
|
|
8
|
+
getMemberId(): string;
|
|
7
9
|
setNickName(newNickName: string): void;
|
|
8
10
|
toSnapshot(): {
|
|
9
11
|
id: string;
|
|
@@ -11,6 +11,12 @@ export declare class Member {
|
|
|
11
11
|
private personalEmail?;
|
|
12
12
|
private discordAccounts;
|
|
13
13
|
constructor(id: string, name: string, studentId: string, department: Department, email: UniversityEmail, personalEmail?: Email | undefined);
|
|
14
|
+
getName(): string;
|
|
15
|
+
getStudentId(): string;
|
|
16
|
+
getDepartment(): Department;
|
|
17
|
+
getEmail(): UniversityEmail;
|
|
18
|
+
getPersonalEmail(): Email | undefined;
|
|
19
|
+
getDiscordAccounts(): DiscordAccount[];
|
|
14
20
|
setName(newName: string): void;
|
|
15
21
|
setStudentId(newStudentId: string): void;
|
|
16
22
|
setDepartment(newDepartment: Department): void;
|
|
@@ -18,7 +24,6 @@ export declare class Member {
|
|
|
18
24
|
setPersonalEmail(newPersonalEmail?: Email): void;
|
|
19
25
|
addDiscordAccount(discordAccount: DiscordAccount): void;
|
|
20
26
|
removeDiscordAccount(discordAccountId: string): void;
|
|
21
|
-
getDiscordAccounts(): DiscordAccount[];
|
|
22
27
|
getDiscordAccountById(discordAccountId: string): DiscordAccount | undefined;
|
|
23
28
|
getDiscordAccountOrThrow(discordAccountId: string): DiscordAccount;
|
|
24
29
|
setDiscordAccountNickName(discordAccountId: string, newNickName: string): void;
|
|
@@ -12,6 +12,24 @@ class Member {
|
|
|
12
12
|
this.personalEmail = personalEmail;
|
|
13
13
|
this.discordAccounts = [];
|
|
14
14
|
}
|
|
15
|
+
getName() {
|
|
16
|
+
return this.name;
|
|
17
|
+
}
|
|
18
|
+
getStudentId() {
|
|
19
|
+
return this.studentId;
|
|
20
|
+
}
|
|
21
|
+
getDepartment() {
|
|
22
|
+
return this.department;
|
|
23
|
+
}
|
|
24
|
+
getEmail() {
|
|
25
|
+
return this.email;
|
|
26
|
+
}
|
|
27
|
+
getPersonalEmail() {
|
|
28
|
+
return this.personalEmail;
|
|
29
|
+
}
|
|
30
|
+
getDiscordAccounts() {
|
|
31
|
+
return this.discordAccounts;
|
|
32
|
+
}
|
|
15
33
|
setName(newName) {
|
|
16
34
|
this.name = newName;
|
|
17
35
|
}
|
|
@@ -37,9 +55,6 @@ class Member {
|
|
|
37
55
|
this.getDiscordAccountOrThrow(discordAccountId);
|
|
38
56
|
this.discordAccounts = this.discordAccounts.filter((account) => account.id !== discordAccountId);
|
|
39
57
|
}
|
|
40
|
-
getDiscordAccounts() {
|
|
41
|
-
return this.discordAccounts;
|
|
42
|
-
}
|
|
43
58
|
getDiscordAccountById(discordAccountId) {
|
|
44
59
|
return this.discordAccounts.find((account) => account.id === discordAccountId);
|
|
45
60
|
}
|