@edifice.io/collect-client-rest-rn 1.0.1 → 1.0.2-develop.0.20260622074628
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/clients/collection.client.d.ts +7 -2
- package/clients/collection.client.js +55 -2
- package/clients/collection.client.js.map +1 -1
- package/clients/submission.client.d.ts +4 -1
- package/clients/submission.client.js +10 -0
- package/clients/submission.client.js.map +1 -1
- package/dtos/attachment.dto.d.ts +2 -20
- package/dtos/attachment.dto.js +11 -81
- package/dtos/attachment.dto.js.map +1 -1
- package/dtos/collection.dto.d.ts +20 -3
- package/dtos/collection.dto.js +148 -16
- package/dtos/collection.dto.js.map +1 -1
- package/dtos/submission.dto.d.ts +1 -2
- package/dtos/submission.dto.js +1 -13
- package/dtos/submission.dto.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.browser.tsbuildinfo +1 -1
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ApiClientOptions, BaseApiClient, RequestOptions } from "@edifice.io/rest-client-base";
|
|
2
|
-
import { CollectionDto, CreateCollectionDto, SearchCollectionDto, SearchCollectionResponseDto, SearchCollectionStudentViewDto, SearchCollectionToSubmitDto, UpdateCollectionDto, UpdateCollectionSharingDto } from "../dtos";
|
|
2
|
+
import { CountCollectionsByStatusDto, CountStudentSubmissionsByStatusDto, CollectionDto, CreateCollectionDto, FileUploadsDto, SearchCollectionDto, SearchCollectionResponseDto, SearchCollectionStudentViewDto, SearchCollectionToSubmitDto, UpdateCollectionDto, UpdateCollectionSharingDto } from "../dtos";
|
|
3
3
|
export declare class CollectionClient extends BaseApiClient {
|
|
4
4
|
constructor(options?: ApiClientOptions);
|
|
5
5
|
getCollections(query?: SearchCollectionDto, options?: RequestOptions): Promise<SearchCollectionResponseDto>;
|
|
6
6
|
getCollectionsToSubmit(query?: SearchCollectionToSubmitDto, options?: RequestOptions): Promise<SearchCollectionStudentViewDto>;
|
|
7
7
|
getCollection(id: number, options?: RequestOptions): Promise<CollectionDto>;
|
|
8
|
-
createCollection(data: CreateCollectionDto, options?: RequestOptions): Promise<CollectionDto>;
|
|
8
|
+
createCollection(data: CreateCollectionDto, options?: RequestOptions, uploadDto?: FileUploadsDto): Promise<CollectionDto>;
|
|
9
9
|
updateCollection(id: number, data: UpdateCollectionDto, options?: RequestOptions): Promise<CollectionDto>;
|
|
10
10
|
updateCollectionSharings(id: number, data: UpdateCollectionSharingDto, options?: RequestOptions): Promise<CollectionDto>;
|
|
11
11
|
deleteCollection(id: number, options?: RequestOptions): Promise<boolean>;
|
|
12
12
|
refreshRecipients(id: number, options?: RequestOptions): Promise<CollectionDto>;
|
|
13
|
+
addAttachments(id: number, uploadDto: FileUploadsDto, options?: RequestOptions): Promise<CollectionDto>;
|
|
14
|
+
downloadAttachment(id: number, fileId: number, downloadFile?: boolean, options?: RequestOptions): Promise<ReadableStream>;
|
|
15
|
+
removeAttachments(id: number, attachmentIds: number[], options?: RequestOptions): Promise<CollectionDto>;
|
|
16
|
+
getCollectionsCount(query: SearchCollectionDto, options?: RequestOptions): Promise<CountCollectionsByStatusDto>;
|
|
17
|
+
getCollectionsToSubmitCount(query: SearchCollectionToSubmitDto, options?: RequestOptions): Promise<CountStudentSubmissionsByStatusDto>;
|
|
13
18
|
}
|
|
@@ -7,6 +7,12 @@ export class CollectionClient extends BaseApiClient {
|
|
|
7
7
|
const queryParams = new URLSearchParams();
|
|
8
8
|
if (query?.search)
|
|
9
9
|
queryParams.append("search", query.search);
|
|
10
|
+
if (query?.ids?.length) {
|
|
11
|
+
query.ids.forEach((id) => queryParams.append("ids", id.toString()));
|
|
12
|
+
}
|
|
13
|
+
if (query?.fields?.length) {
|
|
14
|
+
query.fields.forEach((field) => queryParams.append("fields", field));
|
|
15
|
+
}
|
|
10
16
|
if (query?.sortBy)
|
|
11
17
|
queryParams.append("sortBy", query.sortBy);
|
|
12
18
|
if (query?.sortDirection)
|
|
@@ -19,6 +25,9 @@ export class CollectionClient extends BaseApiClient {
|
|
|
19
25
|
}
|
|
20
26
|
async getCollectionsToSubmit(query, options) {
|
|
21
27
|
const queryParams = new URLSearchParams();
|
|
28
|
+
if (query?.ids?.length) {
|
|
29
|
+
query.ids.forEach((id) => queryParams.append("ids", id.toString()));
|
|
30
|
+
}
|
|
22
31
|
if (query?.filter)
|
|
23
32
|
queryParams.append("filter", query.filter);
|
|
24
33
|
if (query?.search)
|
|
@@ -36,8 +45,14 @@ export class CollectionClient extends BaseApiClient {
|
|
|
36
45
|
async getCollection(id, options) {
|
|
37
46
|
return this.get(`/collections/${id}`, undefined, options);
|
|
38
47
|
}
|
|
39
|
-
async createCollection(data, options) {
|
|
40
|
-
|
|
48
|
+
async createCollection(data, options, uploadDto) {
|
|
49
|
+
const created = await this.post("/collections", data, undefined, options);
|
|
50
|
+
if (uploadDto) {
|
|
51
|
+
if (uploadDto.files.length > 0) {
|
|
52
|
+
return this.addAttachments(created.id, uploadDto, options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return created;
|
|
41
56
|
}
|
|
42
57
|
async updateCollection(id, data, options) {
|
|
43
58
|
return this.put(`/collections/${id}`, data, undefined, options);
|
|
@@ -51,5 +66,43 @@ export class CollectionClient extends BaseApiClient {
|
|
|
51
66
|
async refreshRecipients(id, options) {
|
|
52
67
|
return this.patch(`/collections/${id}/refreshRecipients`, {}, undefined, options);
|
|
53
68
|
}
|
|
69
|
+
async addAttachments(id, uploadDto, options) {
|
|
70
|
+
return this.post(`/collections/${id}/attachments`, uploadDto, undefined, options);
|
|
71
|
+
}
|
|
72
|
+
async downloadAttachment(id, fileId, downloadFile = true, options) {
|
|
73
|
+
return this.get(`/collections/${id}/attachments/${fileId}?download=${downloadFile}`, undefined, options);
|
|
74
|
+
}
|
|
75
|
+
async removeAttachments(id, attachmentIds, options) {
|
|
76
|
+
const idsString = attachmentIds.toString();
|
|
77
|
+
return this.delete(`/collections/${id}/attachments?ids=${idsString}`, undefined, options);
|
|
78
|
+
}
|
|
79
|
+
async getCollectionsCount(query, options) {
|
|
80
|
+
const queryParams = new URLSearchParams();
|
|
81
|
+
if (query.ids?.length) {
|
|
82
|
+
query.ids.forEach((id) => queryParams.append("ids", id.toString()));
|
|
83
|
+
}
|
|
84
|
+
if (query.search)
|
|
85
|
+
queryParams.append("search", query.search);
|
|
86
|
+
if (query.sortBy)
|
|
87
|
+
queryParams.append("sortBy", query.sortBy);
|
|
88
|
+
if (query.sortDirection)
|
|
89
|
+
queryParams.append("sortDirection", query.sortDirection);
|
|
90
|
+
return this.get("/collections/count", queryParams, options);
|
|
91
|
+
}
|
|
92
|
+
async getCollectionsToSubmitCount(query, options) {
|
|
93
|
+
const queryParams = new URLSearchParams();
|
|
94
|
+
if (query.ids?.length) {
|
|
95
|
+
query.ids.forEach((id) => queryParams.append("ids", id.toString()));
|
|
96
|
+
}
|
|
97
|
+
if (query.filter)
|
|
98
|
+
queryParams.append("filter", query.filter);
|
|
99
|
+
if (query.search)
|
|
100
|
+
queryParams.append("search", query.search);
|
|
101
|
+
if (query.sortBy)
|
|
102
|
+
queryParams.append("sortBy", query.sortBy);
|
|
103
|
+
if (query.sortDirection)
|
|
104
|
+
queryParams.append("sortDirection", query.sortDirection);
|
|
105
|
+
return this.get("/collections/submissions/count", queryParams, options);
|
|
106
|
+
}
|
|
54
107
|
}
|
|
55
108
|
//# sourceMappingURL=collection.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.client.js","sourceRoot":"","sources":["../../../src/clients/collection.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,GAEd,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"collection.client.js","sourceRoot":"","sources":["../../../src/clients/collection.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,GAEd,MAAM,8BAA8B,CAAC;AA+BtC,MAAM,OAAO,gBAAiB,SAAQ,aAAa;IACjD,YAAY,UAA4B,EAAE;QACxC,KAAK,CAAC,OAAO,CAAC,CA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EAAE,CAAC;QAC1C,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;YACtB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,KAAK,CAAC,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7D,IAAI,KAAK,CAAC,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7D,IAAI,KAAK,CAAC,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7D,IAAI,KAAK,CAAC,aAAa;YACrB,WAAW,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,GAAG,CACb,gCAAgC,EAChC,WAAW,EACX,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClientOptions, BaseApiClient, RequestOptions } from "@edifice.io/rest-client-base";
|
|
2
|
-
import { CreateSubmissionDto, SearchSubmissionDto, SearchSubmissionResponseDto, SubmissionDto, UpdateSubmissionStatusDto } from "../dtos";
|
|
2
|
+
import { CreateSubmissionDto, FileUploadsDto, SearchSubmissionDto, SearchSubmissionResponseDto, SubmissionDto, UpdateSubmissionStatusDto } from "../dtos";
|
|
3
3
|
export declare class SubmissionClient extends BaseApiClient {
|
|
4
4
|
constructor(options?: ApiClientOptions);
|
|
5
5
|
getSubmissions(collectionId: number, query?: SearchSubmissionDto, options?: RequestOptions): Promise<SearchSubmissionResponseDto>;
|
|
@@ -7,4 +7,7 @@ export declare class SubmissionClient extends BaseApiClient {
|
|
|
7
7
|
updateSubmission(collectionId: number, submissionId: number, data: CreateSubmissionDto, options?: RequestOptions): Promise<SubmissionDto>;
|
|
8
8
|
updateSubmissionStatus(collectionId: number, submissionId: number, data: UpdateSubmissionStatusDto, options?: RequestOptions): Promise<SubmissionDto>;
|
|
9
9
|
downloadSubmissionsZip(collectionId: number, options?: RequestOptions): Promise<Blob>;
|
|
10
|
+
addAttachments(collectionId: number, submissionId: number, uploadDto: FileUploadsDto, options?: RequestOptions): Promise<SubmissionDto>;
|
|
11
|
+
downloadAttachment(collectionId: number, submissionId: number, fileId: number, downloadFile?: boolean, options?: RequestOptions): Promise<ReadableStream>;
|
|
12
|
+
removeAttachments(collectionId: number, submissionId: number, attachmentIds: number[], options?: RequestOptions): Promise<SubmissionDto>;
|
|
10
13
|
}
|
|
@@ -29,5 +29,15 @@ export class SubmissionClient extends BaseApiClient {
|
|
|
29
29
|
async downloadSubmissionsZip(collectionId, options) {
|
|
30
30
|
return this.get(`/collections/${collectionId}/submissions/download/zip`, undefined, { ...options });
|
|
31
31
|
}
|
|
32
|
+
async addAttachments(collectionId, submissionId, uploadDto, options) {
|
|
33
|
+
return this.post(`/collections/${collectionId}/submissions/${submissionId}/attachments`, uploadDto, undefined, options);
|
|
34
|
+
}
|
|
35
|
+
async downloadAttachment(collectionId, submissionId, fileId, downloadFile = true, options) {
|
|
36
|
+
return this.get(`/collections/${collectionId}/submissions/${submissionId}/attachments/${fileId}?download=${downloadFile}`, undefined, options);
|
|
37
|
+
}
|
|
38
|
+
async removeAttachments(collectionId, submissionId, attachmentIds, options) {
|
|
39
|
+
const idsString = attachmentIds.toString();
|
|
40
|
+
return this.delete(`/collections/${collectionId}/submissions/${submissionId}/attachments?ids=${idsString}`, undefined, options);
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
43
|
//# sourceMappingURL=submission.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submission.client.js","sourceRoot":"","sources":["../../../src/clients/submission.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,GAEd,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"submission.client.js","sourceRoot":"","sources":["../../../src/clients/submission.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,GAEd,MAAM,8BAA8B,CAAC;AA0BtC,MAAM,OAAO,gBAAiB,SAAQ,aAAa;IACjD,YAAY,UAA4B,EAAE;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAKD,KAAK,CAAC,cAAc,CAClB,YAAoB,EACpB,KAA2B,EAC3B,OAAwB;QAExB,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAE1C,IAAI,KAAK,EAAE,IAAI;YAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnE,IAAI,KAAK,EAAE,IAAI;YAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnE,IAAI,KAAK,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,KAAK,EAAE,aAAa;YACtB,WAAW,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QAC3D,IAAI,KAAK,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAE9D,OAAO,IAAI,CAAC,GAAG,CACb,gBAAgB,YAAY,cAAc,EAC1C,WAAW,EACX,OAAO,CACR,CAAC;IACJ,CAAC;IAKD,KAAK,CAAC,aAAa,CACjB,YAAoB,EACpB,YAAoB,EACpB,OAAwB;QAExB,OAAO,IAAI,CAAC,GAAG,CACb,gBAAgB,YAAY,gBAAgB,YAAY,EAAE,EA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I,CAAC,MAAM,CAChB,gBAAgB,YAAY,gBAAgB,YAAY,oBAAoB,SAAS,EAAE,EACvF,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
package/dtos/attachment.dto.d.ts
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
export declare const MediaType: {
|
|
2
|
-
readonly AUDIO: "audio";
|
|
3
|
-
readonly VIDEO: "video";
|
|
4
|
-
readonly IMAGE: "image";
|
|
5
|
-
readonly ATTACHMENT: "attachment";
|
|
6
|
-
readonly EMBEDDER: "embedder";
|
|
7
|
-
readonly HYPERLINK: "hyperlink";
|
|
8
|
-
readonly STUDIO: "studio";
|
|
9
|
-
};
|
|
10
|
-
export type MediaType = (typeof MediaType)[keyof typeof MediaType];
|
|
11
|
-
export declare class CreateAttachmentDto {
|
|
12
|
-
name: string;
|
|
13
|
-
type: MediaType;
|
|
14
|
-
mimeType: string;
|
|
15
|
-
uri: string;
|
|
16
|
-
application?: string;
|
|
17
|
-
}
|
|
18
1
|
export declare class AttachmentDto {
|
|
19
2
|
id: number;
|
|
20
3
|
name: string;
|
|
21
|
-
|
|
22
|
-
uri: string;
|
|
4
|
+
createdAt: Date;
|
|
23
5
|
mimeType: string;
|
|
24
|
-
|
|
6
|
+
size?: string;
|
|
25
7
|
}
|
package/dtos/attachment.dto.js
CHANGED
|
@@ -8,76 +8,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { ApiProperty } from "@edifice.io/rest-client-base/react-native";
|
|
11
|
-
import { IsString, IsNotEmpty, IsEnum } from "class-validator";
|
|
12
|
-
export const MediaType = {
|
|
13
|
-
AUDIO: "audio",
|
|
14
|
-
VIDEO: "video",
|
|
15
|
-
IMAGE: "image",
|
|
16
|
-
ATTACHMENT: "attachment",
|
|
17
|
-
EMBEDDER: "embedder",
|
|
18
|
-
HYPERLINK: "hyperlink",
|
|
19
|
-
STUDIO: "studio",
|
|
20
|
-
};
|
|
21
|
-
export class CreateAttachmentDto {
|
|
22
|
-
name;
|
|
23
|
-
type;
|
|
24
|
-
mimeType;
|
|
25
|
-
uri;
|
|
26
|
-
application;
|
|
27
|
-
}
|
|
28
|
-
__decorate([
|
|
29
|
-
ApiProperty({
|
|
30
|
-
description: "Attachment name",
|
|
31
|
-
example: "foobar",
|
|
32
|
-
}),
|
|
33
|
-
IsString(),
|
|
34
|
-
IsNotEmpty(),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], CreateAttachmentDto.prototype, "name", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
ApiProperty({
|
|
39
|
-
enum: MediaType,
|
|
40
|
-
description: "Type of the attachment",
|
|
41
|
-
example: "hyperlink",
|
|
42
|
-
}),
|
|
43
|
-
IsEnum(MediaType),
|
|
44
|
-
__metadata("design:type", String)
|
|
45
|
-
], CreateAttachmentDto.prototype, "type", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
ApiProperty({
|
|
48
|
-
description: "MIME type",
|
|
49
|
-
example: "text/html",
|
|
50
|
-
}),
|
|
51
|
-
IsString(),
|
|
52
|
-
IsNotEmpty(),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], CreateAttachmentDto.prototype, "mimeType", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
ApiProperty({
|
|
57
|
-
description: "Link to the attached resource",
|
|
58
|
-
example: "https://duckduckgo.com",
|
|
59
|
-
}),
|
|
60
|
-
IsString(),
|
|
61
|
-
IsNotEmpty(),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], CreateAttachmentDto.prototype, "uri", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
ApiProperty({
|
|
66
|
-
required: false,
|
|
67
|
-
description: "Name of the ENT application, if the attachment is an ENT resource",
|
|
68
|
-
example: "mindmap",
|
|
69
|
-
}),
|
|
70
|
-
IsString(),
|
|
71
|
-
IsNotEmpty(),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], CreateAttachmentDto.prototype, "application", void 0);
|
|
74
11
|
export class AttachmentDto {
|
|
75
12
|
id;
|
|
76
13
|
name;
|
|
77
|
-
|
|
78
|
-
uri;
|
|
14
|
+
createdAt;
|
|
79
15
|
mimeType;
|
|
80
|
-
|
|
16
|
+
size;
|
|
81
17
|
}
|
|
82
18
|
__decorate([
|
|
83
19
|
ApiProperty({
|
|
@@ -95,19 +31,13 @@ __decorate([
|
|
|
95
31
|
], AttachmentDto.prototype, "name", void 0);
|
|
96
32
|
__decorate([
|
|
97
33
|
ApiProperty({
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
__metadata("design:type", String)
|
|
103
|
-
], AttachmentDto.prototype, "type", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
ApiProperty({
|
|
106
|
-
description: "Link to the attached resource. Can be external link or ENT application",
|
|
107
|
-
example: "/mindmap#/view/ff10e4bd-6231-4ca5-929c-7ece25ad6e8a",
|
|
34
|
+
type: String,
|
|
35
|
+
format: "date-time",
|
|
36
|
+
description: "Creation time (UTC)",
|
|
37
|
+
example: "2026-01-15T12:03:20Z",
|
|
108
38
|
}),
|
|
109
|
-
__metadata("design:type",
|
|
110
|
-
], AttachmentDto.prototype, "
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], AttachmentDto.prototype, "createdAt", void 0);
|
|
111
41
|
__decorate([
|
|
112
42
|
ApiProperty({
|
|
113
43
|
description: "MIME type",
|
|
@@ -118,9 +48,9 @@ __decorate([
|
|
|
118
48
|
__decorate([
|
|
119
49
|
ApiProperty({
|
|
120
50
|
required: false,
|
|
121
|
-
description: "
|
|
122
|
-
example: "
|
|
51
|
+
description: "Human-readable file size",
|
|
52
|
+
example: "103kB",
|
|
123
53
|
}),
|
|
124
54
|
__metadata("design:type", String)
|
|
125
|
-
], AttachmentDto.prototype, "
|
|
55
|
+
], AttachmentDto.prototype, "size", void 0);
|
|
126
56
|
//# sourceMappingURL=attachment.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.dto.js","sourceRoot":"","sources":["../../../src/dtos/attachment.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"attachment.dto.js","sourceRoot":"","sources":["../../../src/dtos/attachment.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,OAAO,aAAa;IAKxB,EAAE,CAAS;IAMX,IAAI,CAAS;IAQb,SAAS,CAAO;IAMhB,QAAQ,CAAS;IAOjB,IAAI,CAAU;CACf;AA5BC;IAJC,WAAW,CAAC;QACX,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,EAAE;KACZ,CAAC;;yCACS;AAMX;IAJC,WAAW,CAAC;QACX,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,QAAQ;KAClB,CAAC;;2CACW;AAQb;IANC,WAAW,CAAC;QACX,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,sBAAsB;KAChC,CAAC;8BACS,IAAI;gDAAC;AAMhB;IAJC,WAAW,CAAC;QACX,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,WAAW;KACrB,CAAC;;+CACe;AAOjB;IALC,WAAW,CAAC;QACX,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,OAAO;KACjB,CAAC;;2CACY"}
|
package/dtos/collection.dto.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { AttachmentDto
|
|
1
|
+
import { AttachmentDto } from "./attachment.dto";
|
|
2
2
|
import { CreateSharingDto, DeleteSharingDto, SharingDto } from "./sharing.dto";
|
|
3
3
|
import { UserDto } from "./user.dto";
|
|
4
4
|
import { PageMetadataDto, PaginationQueryDto, SortDirection } from "./base.dto";
|
|
5
|
+
import { File } from "@nest-lab/fastify-multer";
|
|
5
6
|
import { SubmissionStatus } from "./submission.dto";
|
|
7
|
+
export type CollectionFields = "status";
|
|
6
8
|
export declare enum CollectionStatus {
|
|
7
9
|
SUBMITTED = "submitted",
|
|
8
10
|
TO_SUBMIT = "toSubmit"
|
|
@@ -11,17 +13,20 @@ export declare enum CollectionSortField {
|
|
|
11
13
|
CREATION_DATE = "creationDate",
|
|
12
14
|
MODIFICATION_DATE = "modificationDate",
|
|
13
15
|
DEADLINE = "deadline",
|
|
14
|
-
NAME = "name"
|
|
16
|
+
NAME = "name",
|
|
17
|
+
CONTRIB_PERCENT = "contribPercent"
|
|
15
18
|
}
|
|
16
19
|
export declare class UpdateCollectionDto {
|
|
17
20
|
name: string;
|
|
18
21
|
content: string;
|
|
19
22
|
deadline: Date;
|
|
20
|
-
attachments: CreateAttachmentDto[];
|
|
21
23
|
}
|
|
22
24
|
export declare class CreateCollectionDto extends UpdateCollectionDto {
|
|
23
25
|
sharings: CreateSharingDto[];
|
|
24
26
|
}
|
|
27
|
+
export declare class FileUploadsDto {
|
|
28
|
+
files: File[];
|
|
29
|
+
}
|
|
25
30
|
export declare class UpdateCollectionSharingDto {
|
|
26
31
|
deleteSharings: DeleteSharingDto[];
|
|
27
32
|
newSharings: CreateSharingDto[];
|
|
@@ -39,17 +44,29 @@ export declare class CollectionDto {
|
|
|
39
44
|
contribCount: number;
|
|
40
45
|
attachments?: AttachmentDto[];
|
|
41
46
|
sharings?: SharingDto[];
|
|
47
|
+
mySubmissionStatus?: SubmissionStatus;
|
|
42
48
|
}
|
|
43
49
|
export declare class SearchCollectionDto extends PaginationQueryDto {
|
|
44
50
|
search?: string;
|
|
51
|
+
ids?: number[];
|
|
52
|
+
fields?: CollectionFields[];
|
|
45
53
|
sortBy?: CollectionSortField;
|
|
46
54
|
sortDirection?: SortDirection;
|
|
55
|
+
includeExpired?: boolean;
|
|
47
56
|
}
|
|
48
57
|
export declare class SearchCollectionToSubmitDto extends PaginationQueryDto {
|
|
49
58
|
filter?: CollectionStatus;
|
|
50
59
|
search?: string;
|
|
60
|
+
ids?: number[];
|
|
51
61
|
sortBy?: CollectionSortField;
|
|
52
62
|
sortDirection?: SortDirection;
|
|
63
|
+
includeExpired?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare class CountCollectionsByStatusDto {
|
|
66
|
+
total: number;
|
|
67
|
+
}
|
|
68
|
+
export declare class CountStudentSubmissionsByStatusDto {
|
|
69
|
+
pending: number;
|
|
53
70
|
}
|
|
54
71
|
export declare class SearchCollectionResponseDto {
|
|
55
72
|
items: CollectionDto[];
|
package/dtos/collection.dto.js
CHANGED
|
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsNotEmpty, IsOptional, IsDate, IsArray, IsEnum, } from "class-validator";
|
|
11
|
-
import {
|
|
10
|
+
import { IsString, IsNotEmpty, IsOptional, IsDate, IsArray, IsEnum, IsInt, IsBoolean, } from "class-validator";
|
|
11
|
+
import { Transform } from "class-transformer";
|
|
12
12
|
import { CreateSharingDto, DeleteSharingDto } from "./sharing.dto";
|
|
13
13
|
import { UserDto } from "./user.dto";
|
|
14
14
|
import { PageMetadataDto, PaginationQueryDto, SortDirection } from "./base.dto";
|
|
@@ -26,12 +26,12 @@ export var CollectionSortField;
|
|
|
26
26
|
CollectionSortField["MODIFICATION_DATE"] = "modificationDate";
|
|
27
27
|
CollectionSortField["DEADLINE"] = "deadline";
|
|
28
28
|
CollectionSortField["NAME"] = "name";
|
|
29
|
+
CollectionSortField["CONTRIB_PERCENT"] = "contribPercent";
|
|
29
30
|
})(CollectionSortField || (CollectionSortField = {}));
|
|
30
31
|
export class UpdateCollectionDto {
|
|
31
32
|
name;
|
|
32
33
|
content;
|
|
33
34
|
deadline;
|
|
34
|
-
attachments;
|
|
35
35
|
}
|
|
36
36
|
__decorate([
|
|
37
37
|
ApiProperty({
|
|
@@ -60,15 +60,6 @@ __decorate([
|
|
|
60
60
|
IsDate(),
|
|
61
61
|
__metadata("design:type", Date)
|
|
62
62
|
], UpdateCollectionDto.prototype, "deadline", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
ApiProperty({
|
|
65
|
-
type: [CreateAttachmentDto],
|
|
66
|
-
description: "List of attached media",
|
|
67
|
-
}),
|
|
68
|
-
IsArray(),
|
|
69
|
-
Type(() => CreateAttachmentDto),
|
|
70
|
-
__metadata("design:type", Array)
|
|
71
|
-
], UpdateCollectionDto.prototype, "attachments", void 0);
|
|
72
63
|
export class CreateCollectionDto extends UpdateCollectionDto {
|
|
73
64
|
sharings;
|
|
74
65
|
}
|
|
@@ -81,6 +72,19 @@ __decorate([
|
|
|
81
72
|
Type(() => CreateSharingDto),
|
|
82
73
|
__metadata("design:type", Array)
|
|
83
74
|
], CreateCollectionDto.prototype, "sharings", void 0);
|
|
75
|
+
export class FileUploadsDto {
|
|
76
|
+
files;
|
|
77
|
+
}
|
|
78
|
+
__decorate([
|
|
79
|
+
ApiProperty({
|
|
80
|
+
type: "array",
|
|
81
|
+
items: { type: "string", format: "binary" },
|
|
82
|
+
description: "List of file attachments",
|
|
83
|
+
}),
|
|
84
|
+
IsArray(),
|
|
85
|
+
Type(() => File),
|
|
86
|
+
__metadata("design:type", Array)
|
|
87
|
+
], FileUploadsDto.prototype, "files", void 0);
|
|
84
88
|
export class UpdateCollectionSharingDto {
|
|
85
89
|
deleteSharings;
|
|
86
90
|
newSharings;
|
|
@@ -116,6 +120,7 @@ export class CollectionDto {
|
|
|
116
120
|
contribCount;
|
|
117
121
|
attachments;
|
|
118
122
|
sharings;
|
|
123
|
+
mySubmissionStatus;
|
|
119
124
|
}
|
|
120
125
|
__decorate([
|
|
121
126
|
ApiProperty({
|
|
@@ -179,15 +184,15 @@ __decorate([
|
|
|
179
184
|
], CollectionDto.prototype, "content", void 0);
|
|
180
185
|
__decorate([
|
|
181
186
|
ApiProperty({
|
|
182
|
-
description: "
|
|
183
|
-
example:
|
|
187
|
+
description: "Total number of requested submissions",
|
|
188
|
+
example: 30,
|
|
184
189
|
}),
|
|
185
190
|
__metadata("design:type", Number)
|
|
186
191
|
], CollectionDto.prototype, "submissionCount", void 0);
|
|
187
192
|
__decorate([
|
|
188
193
|
ApiProperty({
|
|
189
|
-
description: "Number of
|
|
190
|
-
example:
|
|
194
|
+
description: "Number of submissions that were submitted",
|
|
195
|
+
example: 7,
|
|
191
196
|
}),
|
|
192
197
|
__metadata("design:type", Number)
|
|
193
198
|
], CollectionDto.prototype, "contribCount", void 0);
|
|
@@ -203,10 +208,22 @@ __decorate([
|
|
|
203
208
|
}),
|
|
204
209
|
__metadata("design:type", Array)
|
|
205
210
|
], CollectionDto.prototype, "sharings", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
ApiProperty({
|
|
213
|
+
required: false,
|
|
214
|
+
description: "Submission status of the calling user for this collection",
|
|
215
|
+
enum: SubmissionStatus,
|
|
216
|
+
example: SubmissionStatus.SUBMITTED,
|
|
217
|
+
}),
|
|
218
|
+
__metadata("design:type", String)
|
|
219
|
+
], CollectionDto.prototype, "mySubmissionStatus", void 0);
|
|
206
220
|
export class SearchCollectionDto extends PaginationQueryDto {
|
|
207
221
|
search;
|
|
222
|
+
ids;
|
|
223
|
+
fields;
|
|
208
224
|
sortBy;
|
|
209
225
|
sortDirection;
|
|
226
|
+
includeExpired;
|
|
210
227
|
}
|
|
211
228
|
__decorate([
|
|
212
229
|
ApiProperty({
|
|
@@ -218,6 +235,45 @@ __decorate([
|
|
|
218
235
|
IsOptional(),
|
|
219
236
|
__metadata("design:type", String)
|
|
220
237
|
], SearchCollectionDto.prototype, "search", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
ApiProperty({
|
|
240
|
+
required: false,
|
|
241
|
+
description: "Filter by collection IDs",
|
|
242
|
+
isArray: true,
|
|
243
|
+
type: Number,
|
|
244
|
+
example: [1, 2, 3],
|
|
245
|
+
}),
|
|
246
|
+
IsOptional(),
|
|
247
|
+
IsArray(),
|
|
248
|
+
IsInt({ each: true }),
|
|
249
|
+
Transform(({ value }) => {
|
|
250
|
+
if (Array.isArray(value))
|
|
251
|
+
return value.map(Number);
|
|
252
|
+
if (typeof value === "string")
|
|
253
|
+
return [Number(value)];
|
|
254
|
+
return value;
|
|
255
|
+
}),
|
|
256
|
+
__metadata("design:type", Array)
|
|
257
|
+
], SearchCollectionDto.prototype, "ids", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
ApiProperty({
|
|
260
|
+
required: false,
|
|
261
|
+
description: "Additional fields to include in the response",
|
|
262
|
+
isArray: true,
|
|
263
|
+
enum: ["status"],
|
|
264
|
+
example: ["status"],
|
|
265
|
+
}),
|
|
266
|
+
IsOptional(),
|
|
267
|
+
IsArray(),
|
|
268
|
+
Transform(({ value }) => {
|
|
269
|
+
if (Array.isArray(value))
|
|
270
|
+
return value;
|
|
271
|
+
if (typeof value === "string")
|
|
272
|
+
return [value];
|
|
273
|
+
return value;
|
|
274
|
+
}),
|
|
275
|
+
__metadata("design:type", Array)
|
|
276
|
+
], SearchCollectionDto.prototype, "fields", void 0);
|
|
221
277
|
__decorate([
|
|
222
278
|
ApiProperty({
|
|
223
279
|
required: false,
|
|
@@ -240,11 +296,30 @@ __decorate([
|
|
|
240
296
|
IsEnum(SortDirection),
|
|
241
297
|
__metadata("design:type", String)
|
|
242
298
|
], SearchCollectionDto.prototype, "sortDirection", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
ApiProperty({
|
|
301
|
+
required: false,
|
|
302
|
+
description: "Include expired collections (deadline passed)",
|
|
303
|
+
example: false,
|
|
304
|
+
}),
|
|
305
|
+
IsOptional(),
|
|
306
|
+
IsBoolean(),
|
|
307
|
+
Transform(({ value }) => {
|
|
308
|
+
if (value === "true")
|
|
309
|
+
return true;
|
|
310
|
+
if (value === "false")
|
|
311
|
+
return false;
|
|
312
|
+
return value;
|
|
313
|
+
}),
|
|
314
|
+
__metadata("design:type", Boolean)
|
|
315
|
+
], SearchCollectionDto.prototype, "includeExpired", void 0);
|
|
243
316
|
export class SearchCollectionToSubmitDto extends PaginationQueryDto {
|
|
244
317
|
filter;
|
|
245
318
|
search;
|
|
319
|
+
ids;
|
|
246
320
|
sortBy;
|
|
247
321
|
sortDirection;
|
|
322
|
+
includeExpired;
|
|
248
323
|
}
|
|
249
324
|
__decorate([
|
|
250
325
|
ApiProperty({
|
|
@@ -267,6 +342,26 @@ __decorate([
|
|
|
267
342
|
IsOptional(),
|
|
268
343
|
__metadata("design:type", String)
|
|
269
344
|
], SearchCollectionToSubmitDto.prototype, "search", void 0);
|
|
345
|
+
__decorate([
|
|
346
|
+
ApiProperty({
|
|
347
|
+
required: false,
|
|
348
|
+
description: "Filter by collection IDs",
|
|
349
|
+
isArray: true,
|
|
350
|
+
type: Number,
|
|
351
|
+
example: [1, 2, 3],
|
|
352
|
+
}),
|
|
353
|
+
IsOptional(),
|
|
354
|
+
IsArray(),
|
|
355
|
+
IsInt({ each: true }),
|
|
356
|
+
Transform(({ value }) => {
|
|
357
|
+
if (Array.isArray(value))
|
|
358
|
+
return value.map(Number);
|
|
359
|
+
if (typeof value === "string")
|
|
360
|
+
return [Number(value)];
|
|
361
|
+
return value;
|
|
362
|
+
}),
|
|
363
|
+
__metadata("design:type", Array)
|
|
364
|
+
], SearchCollectionToSubmitDto.prototype, "ids", void 0);
|
|
270
365
|
__decorate([
|
|
271
366
|
ApiProperty({
|
|
272
367
|
required: false,
|
|
@@ -289,6 +384,43 @@ __decorate([
|
|
|
289
384
|
IsEnum(SortDirection),
|
|
290
385
|
__metadata("design:type", String)
|
|
291
386
|
], SearchCollectionToSubmitDto.prototype, "sortDirection", void 0);
|
|
387
|
+
__decorate([
|
|
388
|
+
ApiProperty({
|
|
389
|
+
required: false,
|
|
390
|
+
description: "Include expired collections (deadline passed)",
|
|
391
|
+
example: false,
|
|
392
|
+
}),
|
|
393
|
+
IsOptional(),
|
|
394
|
+
IsBoolean(),
|
|
395
|
+
Transform(({ value }) => {
|
|
396
|
+
if (value === "true")
|
|
397
|
+
return true;
|
|
398
|
+
if (value === "false")
|
|
399
|
+
return false;
|
|
400
|
+
return value;
|
|
401
|
+
}),
|
|
402
|
+
__metadata("design:type", Boolean)
|
|
403
|
+
], SearchCollectionToSubmitDto.prototype, "includeExpired", void 0);
|
|
404
|
+
export class CountCollectionsByStatusDto {
|
|
405
|
+
total;
|
|
406
|
+
}
|
|
407
|
+
__decorate([
|
|
408
|
+
ApiProperty({
|
|
409
|
+
description: "Total number of matching collections",
|
|
410
|
+
example: 4,
|
|
411
|
+
}),
|
|
412
|
+
__metadata("design:type", Number)
|
|
413
|
+
], CountCollectionsByStatusDto.prototype, "total", void 0);
|
|
414
|
+
export class CountStudentSubmissionsByStatusDto {
|
|
415
|
+
pending;
|
|
416
|
+
}
|
|
417
|
+
__decorate([
|
|
418
|
+
ApiProperty({
|
|
419
|
+
description: "Number of submissions pending submission",
|
|
420
|
+
example: 5,
|
|
421
|
+
}),
|
|
422
|
+
__metadata("design:type", Number)
|
|
423
|
+
], CountStudentSubmissionsByStatusDto.prototype, "pending", void 0);
|
|
292
424
|
export class SearchCollectionResponseDto {
|
|
293
425
|
items;
|
|
294
426
|
meta;
|