-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ew-1009: added all required DTOs for uc usage
- Loading branch information
Showing
25 changed files
with
1,334 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions
18
...mon-cartridge/common-cartridge-client/card-client/dto/card-response-elements-inner.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,18 @@ | ||
import { CollaborativeTextEditorElementResponseDto } from './collaborative-text-editor-element-response.dto'; | ||
import { DeletedElementResponseDto } from './deleted-element-response.dto'; | ||
import { DrawingElementResponseDto } from './drawing-element-response.dto'; | ||
import { ExternalToolElementResponseDto } from './external-tool-element-response.dto'; | ||
import { FileElementResponseDto } from './file-element-response.dto'; | ||
import { LinkElementResponseDto } from './link-element-response.dto'; | ||
import { RichTextElementResponseDto } from './rich-text-element-response.dto'; | ||
import { SubmissionContainerElementResponseDto } from './submission-container-element-response.dto'; | ||
|
||
export type CardResponseElementsInnerDto = | ||
| CollaborativeTextEditorElementResponseDto | ||
| DeletedElementResponseDto | ||
| DrawingElementResponseDto | ||
| ExternalToolElementResponseDto | ||
| FileElementResponseDto | ||
| LinkElementResponseDto | ||
| RichTextElementResponseDto | ||
| SubmissionContainerElementResponseDto; |
33 changes: 33 additions & 0 deletions
33
...src/modules/common-cartridge/common-cartridge-client/card-client/dto/card-response.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,33 @@ | ||
import { CardResponseElementsInnerDto } from './card-response-elements-inner.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
import { VisibilitySettingsResponseDto } from './visibility-settings-response.dto'; | ||
|
||
export class CardResponseDto { | ||
id: string; | ||
|
||
title?: string; | ||
|
||
height: number; | ||
|
||
elements: Array<CardResponseElementsInnerDto>; | ||
|
||
visibilitySettings: VisibilitySettingsResponseDto; | ||
|
||
timeStamps: TimestampResponseDto; | ||
|
||
constructor( | ||
id: string, | ||
title: string, | ||
height: number, | ||
elements: Array<CardResponseElementsInnerDto>, | ||
visibilitySettings: VisibilitySettingsResponseDto, | ||
timeStamps: TimestampResponseDto | ||
) { | ||
this.id = id; | ||
this.title = title; | ||
this.height = height; | ||
this.elements = elements; | ||
this.visibilitySettings = visibilitySettings; | ||
this.timeStamps = timeStamps; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...common-cartridge-client/card-client/dto/collaborative-text-editor-element-response.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,19 @@ | ||
import { ContentElementType } from '../cards-api-client'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class CollaborativeTextEditorElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
content: object; | ||
|
||
constructor(id: string, type: ContentElementType, timestamps: TimestampResponseDto, content: object) { | ||
this.id = id; | ||
this.type = type; | ||
this.timestamps = timestamps; | ||
this.content = content; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...s/common-cartridge/common-cartridge-client/card-client/dto/deleted-element-content.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,15 @@ | ||
import { ContentElementType } from '../enums/content-element-type.enum'; | ||
|
||
export class DeletedElementContentDto { | ||
title: string; | ||
|
||
deletedElementType: ContentElementType; | ||
|
||
description: string; | ||
|
||
constructor(title: string, deletedElementType: ContentElementType, description: string) { | ||
this.title = title; | ||
this.deletedElementType = deletedElementType; | ||
this.description = description; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
.../common-cartridge/common-cartridge-client/card-client/dto/deleted-element-response.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,25 @@ | ||
import { ContentElementType } from '../cards-api-client'; | ||
import { DeletedElementContentDto } from './deleted-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class DeletedElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
content: DeletedElementContentDto; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
constructor( | ||
id: string, | ||
type: ContentElementType, | ||
content: DeletedElementContentDto, | ||
timestamps: TimestampResponseDto | ||
) { | ||
this.id = id; | ||
this.type = type; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...s/common-cartridge/common-cartridge-client/card-client/dto/drawing-element-content.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,7 @@ | ||
export class DrawingElementContentDto { | ||
descritpion: string; | ||
|
||
constructor(descritpion: string) { | ||
this.descritpion = descritpion; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
.../common-cartridge/common-cartridge-client/card-client/dto/drawing-element-response.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,25 @@ | ||
import { ContentElementType } from '../enums/content-element-type.enum'; | ||
import { DrawingElementContentDto } from './drawing-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class DrawingElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
content: DrawingElementContentDto; | ||
|
||
constructor( | ||
id: string, | ||
type: ContentElementType, | ||
timestamps: TimestampResponseDto, | ||
content: DrawingElementContentDto | ||
) { | ||
this.id = id; | ||
this.type = type; | ||
this.timestamps = timestamps; | ||
this.content = content; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...on-cartridge/common-cartridge-client/card-client/dto/external-tool-element-content.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,7 @@ | ||
export class ExternalToolElementContentDto { | ||
contentExternalToolId: string | null; | ||
|
||
constructor(contentExternalToolId: string | null) { | ||
this.contentExternalToolId = contentExternalToolId; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...n-cartridge/common-cartridge-client/card-client/dto/external-tool-element-response.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,25 @@ | ||
import { ContentElementType } from '../enums/content-element-type.enum'; | ||
import { ExternalToolElementContentDto } from './external-tool-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class ExternalToolElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
content: ExternalToolElementContentDto; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
constructor( | ||
id: string, | ||
type: ContentElementType, | ||
content: ExternalToolElementContentDto, | ||
timestamps: TimestampResponseDto | ||
) { | ||
this.id = id; | ||
this.type = type; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ules/common-cartridge/common-cartridge-client/card-client/dto/file-element-content.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 class FileElementContentDto { | ||
caption: string; | ||
|
||
alternativeText: string; | ||
|
||
constructor(caption: string, alternativeText: string) { | ||
this.caption = caption; | ||
this.alternativeText = alternativeText; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...les/common-cartridge/common-cartridge-client/card-client/dto/file-element-response.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,20 @@ | ||
import { ContentElementType } from '../enums/content-element-type.enum'; | ||
import { FileElementContentDto } from './file-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class FileElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
content: FileElementContentDto; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
constructor(id: string, type: ContentElementType, content: FileElementContentDto, timestamps: TimestampResponseDto) { | ||
this.id = id; | ||
this.type = type; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...ules/common-cartridge/common-cartridge-client/card-client/dto/link-element-content.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,16 @@ | ||
export class LinkElementContentDto { | ||
url: string; | ||
|
||
title: string; | ||
|
||
description?: string; | ||
|
||
imageUrl?: string; | ||
|
||
constructor(url: string, title: string, description: string, imageUrl: string) { | ||
this.url = url; | ||
this.title = title; | ||
this.description = description; | ||
this.imageUrl = imageUrl; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...les/common-cartridge/common-cartridge-client/card-client/dto/link-element-response.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,20 @@ | ||
import { ContentElementType } from '../enums/content-element-type.enum'; | ||
import { LinkElementContentDto } from './link-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class LinkElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
content: LinkElementContentDto; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
constructor(id: string, type: ContentElementType, content: LinkElementContentDto, timestamps: TimestampResponseDto) { | ||
this.id = id; | ||
this.type = type; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...common-cartridge/common-cartridge-client/card-client/dto/rich-text-element-content.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 class RichTextElementContentDto { | ||
text: string; | ||
|
||
inputFormat: string; | ||
|
||
constructor(text: string, inputFormat: string) { | ||
this.text = text; | ||
this.inputFormat = inputFormat; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ommon-cartridge/common-cartridge-client/card-client/dto/rich-text-element-response.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,25 @@ | ||
import { ContentElementType } from '../enums/content-element-type.enum'; | ||
import { RichTextElementContentDto } from './rich-text-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class RichTextElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
content: RichTextElementContentDto; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
constructor( | ||
id: string, | ||
type: ContentElementType, | ||
content: RichTextElementContentDto, | ||
timestamps: TimestampResponseDto | ||
) { | ||
this.id = id; | ||
this.type = type; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ridge/common-cartridge-client/card-client/dto/submission-container-element-content.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,7 @@ | ||
export class SubmissionContainerElementContentDto { | ||
dueDate: string; | ||
|
||
constructor(dueDate: string) { | ||
this.dueDate = dueDate; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...idge/common-cartridge-client/card-client/dto/submission-container-element-response.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,25 @@ | ||
import { ContentElementType } from '../cards-api-client'; | ||
import { SubmissionContainerElementContentDto } from './submission-container-element-content.dto'; | ||
import { TimestampResponseDto } from './timestamp-response.dto'; | ||
|
||
export class SubmissionContainerElementResponseDto { | ||
id: string; | ||
|
||
type: ContentElementType; | ||
|
||
content: SubmissionContainerElementContentDto; | ||
|
||
timestamps: TimestampResponseDto; | ||
|
||
constructor( | ||
id: string, | ||
type: ContentElementType, | ||
content: SubmissionContainerElementContentDto, | ||
timestamps: TimestampResponseDto | ||
) { | ||
this.id = id; | ||
this.type = type; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...odules/common-cartridge/common-cartridge-client/card-client/dto/timestamp-response.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,13 @@ | ||
export class TimestampResponseDto { | ||
lastUpdatedAt: string; | ||
|
||
createdAt: string; | ||
|
||
deletedAt: string; | ||
|
||
constructor(lastUpdatedAt: string, createdAt: string, deletedAt: string) { | ||
this.lastUpdatedAt = lastUpdatedAt; | ||
this.createdAt = createdAt; | ||
this.deletedAt = deletedAt; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...mon-cartridge/common-cartridge-client/card-client/dto/visibility-settings-response.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,7 @@ | ||
export class VisibilitySettingsResponseDto { | ||
publishedAt: string; | ||
|
||
constructor(publishedAt: string) { | ||
this.publishedAt = publishedAt; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...s/common-cartridge/common-cartridge-client/card-client/enums/content-element-type.enum.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 enum ContentElementType { | ||
FILE = 'file', | ||
DRAWING = 'drawing', | ||
LINK = 'link', | ||
RICH_TEXT = 'richText', | ||
SUBMISSION_CONTAINER = 'submissionContainer', | ||
EXTERNAL_TOOL = 'externalTool', | ||
COLLABORATIVE_TEXT_EDITOR = 'collaborativeTextEditor', | ||
DELETED = 'deleted', | ||
} |
17 changes: 17 additions & 0 deletions
17
...dules/common-cartridge/common-cartridge-client/card-client/mapper/card-response.mapper.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,17 @@ | ||
import { CardResponse } from '../cards-api-client'; | ||
import { CardResponseDto } from '../dto/card-response.dto'; | ||
|
||
export class CardResponseMapper { | ||
public static mapToCardResponseDto(cardResponse: CardResponse) { | ||
return new CardResponseDto( | ||
cardResponse.id, | ||
cardResponse.title!, | ||
cardResponse.height, | ||
cardResponse.elements, | ||
cardResponse.visibilitySettings, | ||
cardResponse.timestamps | ||
); | ||
} | ||
|
||
private static mapTo | ||
} |
Oops, something went wrong.