Skip to content

Commit e512fab

Browse files
committed
moved dto's out of server folder.
1 parent ed50dc2 commit e512fab

16 files changed

+21
-153
lines changed

src/lib/dtos/register-email.dto.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
import { z } from 'zod';
22

3-
/* -------------------------------------------------------------------------- */
4-
/* DTO */
5-
/* -------------------------------------------------------------------------- */
6-
/* -------------------------------------------------------------------------- */
7-
/* ---------------------------------- About --------------------------------- */
8-
/*
9-
Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
10-
They are used to validate data and ensure that the correct data is being passed
11-
to the correct methods.
12-
*/
13-
/* ---------------------------------- Notes --------------------------------- */
14-
/*
15-
DTO's are pretty flexible. You can use them anywhere you want in this application to
16-
validate or shape data. They are especially useful in API routes and services to
17-
ensure that the correct data is being passed around.
18-
*/
19-
/* -------------------------------------------------------------------------- */
20-
213
export const registerEmailDto = z.object({
224
email: z.string().email()
235
});

src/lib/dtos/signin-email.dto.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
import { z } from 'zod';
22

3-
/* -------------------------------------------------------------------------- */
4-
/* DTO */
5-
/* -------------------------------------------------------------------------- */
6-
/* -------------------------------------------------------------------------- */
7-
/* ---------------------------------- About --------------------------------- */
8-
/*
9-
Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
10-
They are used to validate data and ensure that the correct data is being passed
11-
to the correct methods.
12-
*/
13-
/* ---------------------------------- Notes --------------------------------- */
14-
/*
15-
DTO's are pretty flexible. You can use them anywhere you want in this application to
16-
validate or shape data. They are especially useful in API routes and services to
17-
ensure that the correct data is being passed around.
18-
*/
19-
/* -------------------------------------------------------------------------- */
20-
213
export const signInEmailDto = z.object({
224
email: z.string().email(),
235
token: z.string()

src/lib/dtos/update-email.dto.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
import { z } from 'zod';
22

3-
/* -------------------------------------------------------------------------- */
4-
/* DTO */
5-
/* -------------------------------------------------------------------------- */
6-
/* -------------------------------------------------------------------------- */
7-
/* ---------------------------------- About --------------------------------- */
8-
/*
9-
Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
10-
They are used to validate data and ensure that the correct data is being passed
11-
to the correct methods.
12-
*/
13-
/* ---------------------------------- Notes --------------------------------- */
14-
/*
15-
DTO's are pretty flexible. You can use them anywhere you want in this application to
16-
validate or shape data. They are especially useful in API routes and services to
17-
ensure that the correct data is being passed around.
18-
*/
19-
/* -------------------------------------------------------------------------- */
20-
213
export const updateEmailDto = z.object({
224
email: z.string().email()
235
});

src/lib/dtos/verify-email.dto.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
import { z } from 'zod';
22

3-
/* -------------------------------------------------------------------------- */
4-
/* DTO */
5-
/* -------------------------------------------------------------------------- */
6-
/* -------------------------------------------------------------------------- */
7-
/* ---------------------------------- About --------------------------------- */
8-
/*
9-
Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
10-
They are used to validate data and ensure that the correct data is being passed
11-
to the correct methods.
12-
*/
13-
/* ---------------------------------- Notes --------------------------------- */
14-
/*
15-
DTO's are pretty flexible. You can use them anywhere you want in this application to
16-
validate or shape data. They are especially useful in API routes and services to
17-
ensure that the correct data is being passed around.
18-
*/
19-
/* -------------------------------------------------------------------------- */
20-
213
export const verifyEmailDto = z.object({
224
token: z.string()
235
});

src/lib/server/api/common/inferfaces/controller.interface.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/lib/server/api/common/inferfaces/email.interface.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
export interface Email {
52
subject(): string
63
html(): string;

src/lib/server/api/controllers/iam.controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { inject, injectable } from 'tsyringe';
44
import { zValidator } from '@hono/zod-validator';
55
import { IamService } from '../services/iam.service';
66
import { LuciaProvider } from '../providers/lucia.provider';
7-
import { signInEmailDto } from '../../../dtos/signin-email.dto';
8-
import { updateEmailDto } from '../../../dtos/update-email.dto';
9-
import { verifyEmailDto } from '../../../dtos/verify-email.dto';
10-
import { registerEmailDto } from '../../../dtos/register-email.dto';
117
import { limiter } from '../middlewares/rate-limiter.middlware';
128
import { requireAuth } from '../middlewares/auth.middleware';
139
import { Controler } from '../common/classes/controller.class';
10+
import { registerEmailDto } from '$lib/dtos/register-email.dto';
11+
import { signInEmailDto } from '$lib/dtos/signin-email.dto';
12+
import { updateEmailDto } from '$lib/dtos/update-email.dto';
13+
import { verifyEmailDto } from '$lib/dtos/verify-email.dto';
1414

1515
@injectable()
1616
export class IamController extends Controler {

src/lib/server/api/dtos/register-email.dto.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/lib/server/api/dtos/signin-email.dto.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/lib/server/api/dtos/update-email.dto.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)