-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: iverly <github@iverly.net>
- Loading branch information
Showing
21 changed files
with
226 additions
and
5 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"id": 1, | ||
"name": "notes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
export * from './lib/id-token'; | ||
|
||
// Generated by prisma | ||
export * from './lib/generated/classes/note/dto/index'; | ||
export * from './lib/generated/classes/note/entities/index'; |
Empty file.
5 changes: 5 additions & 0 deletions
5
packages/types/src/lib/generated/classes/note/dto/connect-note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
export class ConnectNoteDto { | ||
id: string; | ||
} | ||
|
30 changes: 30 additions & 0 deletions
30
packages/types/src/lib/generated/classes/note/dto/create-note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
import {Type} from 'class-transformer' | ||
import {IsNotEmpty,IsString,Length} from 'class-validator' | ||
import {ApiProperty,getSchemaPath} from '@nestjs/swagger' | ||
|
||
|
||
|
||
|
||
export class CreateNoteDto { | ||
@ApiProperty({ | ||
description: `The note title`, | ||
example: `My note`, | ||
maxLength: 40, | ||
minLength: 3, | ||
}) | ||
@IsNotEmpty() | ||
@IsString() | ||
@Length(3, 40) | ||
title: string; | ||
@ApiProperty({ | ||
description: `The note body`, | ||
example: `This is my note`, | ||
maxLength: 200, | ||
minLength: 3, | ||
}) | ||
@IsNotEmpty() | ||
@IsString() | ||
@Length(3, 200) | ||
body: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
export * from './connect-note.dto'; | ||
export * from './create-note.dto'; | ||
export * from './update-note.dto'; | ||
export * from './note.dto'; |
31 changes: 31 additions & 0 deletions
31
packages/types/src/lib/generated/classes/note/dto/note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
import {ApiProperty} from '@nestjs/swagger' | ||
|
||
|
||
export class NoteDto { | ||
@ApiProperty({ | ||
description: `The note id`, | ||
example: `b1774d2f-05f7-4ea4-b427-0d808bdca583`, | ||
}) | ||
id: string ; | ||
@ApiProperty({ | ||
description: `The note title`, | ||
example: `My note`, | ||
maxLength: 40, | ||
minLength: 3, | ||
}) | ||
title: string ; | ||
@ApiProperty({ | ||
description: `The note body`, | ||
example: `This is my note`, | ||
maxLength: 200, | ||
minLength: 3, | ||
}) | ||
body: string ; | ||
@ApiProperty({ | ||
description: `When the project was created`, | ||
type: `string`, | ||
format: `date-time`, | ||
}) | ||
createdAt: Date ; | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/types/src/lib/generated/classes/note/dto/update-note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
import {Type} from 'class-transformer' | ||
import {IsOptional,IsString,Length} from 'class-validator' | ||
import {ApiProperty} from '@nestjs/swagger' | ||
|
||
|
||
|
||
|
||
export class UpdateNoteDto { | ||
@ApiProperty({ | ||
description: `The note title`, | ||
example: `My note`, | ||
maxLength: 40, | ||
minLength: 3, | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
@Length(3, 40) | ||
title?: string; | ||
@ApiProperty({ | ||
description: `The note body`, | ||
example: `This is my note`, | ||
maxLength: 200, | ||
minLength: 3, | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
@Length(3, 200) | ||
body?: string; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/types/src/lib/generated/classes/note/entities/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
export * from './note.entity'; |
31 changes: 31 additions & 0 deletions
31
packages/types/src/lib/generated/classes/note/entities/note.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
import {ApiProperty} from '@nestjs/swagger' | ||
|
||
|
||
export class Note { | ||
@ApiProperty({ | ||
description: `The note id`, | ||
example: `b1774d2f-05f7-4ea4-b427-0d808bdca583`, | ||
}) | ||
id: string ; | ||
@ApiProperty({ | ||
description: `The note title`, | ||
example: `My note`, | ||
maxLength: 40, | ||
minLength: 3, | ||
}) | ||
title: string ; | ||
@ApiProperty({ | ||
description: `The note body`, | ||
example: `This is my note`, | ||
maxLength: 200, | ||
minLength: 3, | ||
}) | ||
body: string ; | ||
@ApiProperty({ | ||
description: `When the project was created`, | ||
type: `string`, | ||
format: `date-time`, | ||
}) | ||
createdAt: Date ; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/types/src/lib/generated/interfaces/note/dto/connect-note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
export interface IConnectNoteAttributes { | ||
id: string; | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
packages/types/src/lib/generated/interfaces/note/dto/create-note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
export interface ICreateNoteAttributes { | ||
title: string; | ||
body: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/types/src/lib/generated/interfaces/note/dto/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
export * from './connect-note.dto'; | ||
export * from './create-note.dto'; | ||
export * from './update-note.dto'; | ||
export * from './note.dto'; |
10 changes: 10 additions & 0 deletions
10
packages/types/src/lib/generated/interfaces/note/dto/note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
|
||
|
||
export interface NoteAttributes { | ||
id: string ; | ||
title: string ; | ||
body: string ; | ||
createdAt: Date ; | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/types/src/lib/generated/interfaces/note/dto/update-note.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
export interface IUpdateNoteAttributes { | ||
title?: string; | ||
body?: string; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/types/src/lib/generated/interfaces/note/entities/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
export * from './note.entity'; |
10 changes: 10 additions & 0 deletions
10
packages/types/src/lib/generated/interfaces/note/entities/note.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
|
||
|
||
export interface INote { | ||
id: string ; | ||
title: string ; | ||
body: string ; | ||
createdAt: Date ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- CreateTable | ||
CREATE TABLE "notes" ( | ||
"id" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"body" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "notes_pkey" PRIMARY KEY ("id") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" | ||
provider = "postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters