@media-quest/builder 0.0.34 → 0.0.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@media-quest/builder",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "Builder library for Media-quest schemas",
5
5
  "main": "dist/public-api.js",
6
6
  "types": "dist/public-api.d.js",
@@ -24,6 +24,6 @@
24
24
  "dts": true
25
25
  },
26
26
  "peerDependencies": {
27
- "@media-quest/engine": "0.0.34"
27
+ "@media-quest/engine": "0.0.35"
28
28
  }
29
29
  }
@@ -1,98 +1,98 @@
1
- import type { BuilderOptionDto } from "./Builder-option";
2
- import { BuilderOption } from "./Builder-option";
3
- import { BuilderObject } from "./BuilderObject";
4
- import { QuestionID } from "./primitives/ID";
5
-
6
- export type BuilderQuestionType =
7
- | "select-one"
8
- | "select-many"
9
- | "text"
10
- | "time"
11
- | "textarea"
12
- | "date"
13
- | "numeric-range"
14
- | "duration";
15
-
16
- export interface BuilderQuestionDto {
17
- readonly id: QuestionID;
18
- _type: BuilderQuestionType;
19
- text: string;
20
- options: ReadonlyArray<BuilderOptionDto>;
21
- prefix: string;
22
- }
23
-
24
- export class BuilderQuestion extends BuilderObject<"builder-question", BuilderQuestionDto> {
25
- readonly objectType = "builder-question";
26
- id: QuestionID;
27
- type: BuilderQuestionType;
28
- questionText = "";
29
- options: BuilderOption[] = [];
30
- prefix = "";
31
-
32
- static create = (type: BuilderQuestionType) => {
33
- const id = QuestionID.create();
34
-
35
- return new BuilderQuestion({
36
- id,
37
- _type: type,
38
- text: "",
39
- options: [],
40
- prefix: "",
41
- });
42
- };
43
-
44
- public static fromJson(dto: BuilderQuestionDto): BuilderQuestion {
45
- const question = new BuilderQuestion(dto);
46
- return question;
47
- }
48
-
49
- private constructor(dto: BuilderQuestionDto) {
50
- super(dto);
51
- this.id = QuestionID.validateOrCreate(dto.id);
52
- this.type = dto._type;
53
- this.questionText = dto.text;
54
- this.prefix = dto.prefix;
55
- this.options = dto.options.map((o) => BuilderOption.fromJson(o));
56
- }
57
-
58
- addOption(label: string, value: number, atIndex = -1) {
59
- const option = BuilderOption.create(value, label);
60
- if (atIndex >= 0 && atIndex < this.options.length) {
61
- this.options.splice(atIndex, 0, option);
62
- } else {
63
- this.options.push(option);
64
- }
65
- return option;
66
- }
67
-
68
- deleteOption(option: BuilderOption): boolean {
69
- const filtered = this.options.filter((o) => o.id !== option.id);
70
- const didDelete = filtered.length === this.options.length - 1;
71
- this.options = filtered;
72
- return didDelete;
73
- }
74
-
75
- toJson() {
76
- const optionsJson = this.options.map((o) => o.toJson());
77
- const dto: BuilderQuestionDto = {
78
- id: this.id,
79
- prefix: this.prefix,
80
- _type: this.type,
81
- text: this.questionText,
82
- options: optionsJson,
83
- };
84
- return dto;
85
- }
86
-
87
- clone(): BuilderQuestionDto {
88
- const cloneId = QuestionID.create();
89
- const dto = this.toJson();
90
- const optionsClone = this.options.map((o) => o.clone());
91
- const clonedDto: BuilderQuestionDto = {
92
- ...dto,
93
- id: cloneId,
94
- options: optionsClone,
95
- };
96
- return clonedDto;
97
- }
98
- }
1
+ import type { BuilderOptionDto } from "./Builder-option";
2
+ import { BuilderOption } from "./Builder-option";
3
+ import { BuilderObject } from "./BuilderObject";
4
+ import { QuestionID } from "./primitives/ID";
5
+
6
+ export type BuilderQuestionType =
7
+ | "select-one"
8
+ | "select-many"
9
+ | "text"
10
+ | "time"
11
+ | "textarea"
12
+ | "date"
13
+ | "numeric-range"
14
+ | "duration";
15
+
16
+ export interface BuilderQuestionDto {
17
+ readonly id: QuestionID;
18
+ _type: BuilderQuestionType;
19
+ text: string;
20
+ options: ReadonlyArray<BuilderOptionDto>;
21
+ prefix: string;
22
+ }
23
+
24
+ export class BuilderQuestion extends BuilderObject<"builder-question", BuilderQuestionDto> {
25
+ readonly objectType = "builder-question";
26
+ id: QuestionID;
27
+ type: BuilderQuestionType;
28
+ questionText = "";
29
+ options: BuilderOption[] = [];
30
+ prefix = "";
31
+
32
+ static create = (type: BuilderQuestionType) => {
33
+ const id = QuestionID.create();
34
+
35
+ return new BuilderQuestion({
36
+ id,
37
+ _type: type,
38
+ text: "",
39
+ options: [],
40
+ prefix: "",
41
+ });
42
+ };
43
+
44
+ public static fromJson(dto: BuilderQuestionDto): BuilderQuestion {
45
+ const question = new BuilderQuestion(dto);
46
+ return question;
47
+ }
48
+
49
+ private constructor(dto: BuilderQuestionDto) {
50
+ super(dto);
51
+ this.id = QuestionID.validateOrCreate(dto.id);
52
+ this.type = dto._type;
53
+ this.questionText = dto.text;
54
+ this.prefix = dto.prefix;
55
+ this.options = dto.options.map((o) => BuilderOption.fromJson(o));
56
+ }
57
+
58
+ addOption(label: string, value: number, atIndex = -1) {
59
+ const option = BuilderOption.create(value, label);
60
+ if (atIndex >= 0 && atIndex < this.options.length) {
61
+ this.options.splice(atIndex, 0, option);
62
+ } else {
63
+ this.options.push(option);
64
+ }
65
+ return option;
66
+ }
67
+
68
+ deleteOption(option: BuilderOption): boolean {
69
+ const filtered = this.options.filter((o) => o.id !== option.id);
70
+ const didDelete = filtered.length === this.options.length - 1;
71
+ this.options = filtered;
72
+ return didDelete;
73
+ }
74
+
75
+ toJson() {
76
+ const optionsJson = this.options.map((o) => o.toJson());
77
+ const dto: BuilderQuestionDto = {
78
+ id: this.id,
79
+ prefix: this.prefix,
80
+ _type: this.type,
81
+ text: this.questionText,
82
+ options: optionsJson,
83
+ };
84
+ return dto;
85
+ }
86
+
87
+ clone(): BuilderQuestionDto {
88
+ const cloneId = QuestionID.create();
89
+ const dto = this.toJson();
90
+ const optionsClone = this.options.map((o) => o.clone());
91
+ const clonedDto: BuilderQuestionDto = {
92
+ ...dto,
93
+ id: cloneId,
94
+ options: optionsClone,
95
+ };
96
+ return clonedDto;
97
+ }
98
+ }
@@ -0,0 +1,155 @@
1
+ import { BuilderSchema } from "./Builder-schema";
2
+ import { OptionID, PageID, QuestionID, SchemaID, SumScoreVariableID } from "./primitives/ID";
3
+ import { SchemaPrefixValue } from "./primitives/schema-prefix";
4
+ import { BuilderSchemaDto } from "./Builder-schema-dto";
5
+ import { PagePrefix } from "./primitives/page-prefix";
6
+ import { BuilderPageDto } from "./page/Builder-page";
7
+ import { Options } from "tsup";
8
+ import { AudioFile, ImageFile, VideoFile } from "./media-files";
9
+
10
+ const SCHEMA_ID = "schema_id" as SchemaID;
11
+ const SCHEMA_PREFIX_A = "schema_prefix_a" as SchemaPrefixValue;
12
+ let s1 = BuilderSchema.create(SCHEMA_ID, "test-name", SCHEMA_PREFIX_A);
13
+
14
+ const createPage = (options: {
15
+ pageNumber: number;
16
+ audioUrl: string;
17
+ mainMedia: { type: "image" | "video"; url: string; id: string };
18
+ }): BuilderPageDto => {
19
+ const { pageNumber, audioUrl, mainMedia } = options;
20
+
21
+ const audioId = "audio" + pageNumber + "_id";
22
+
23
+ let media: BuilderPageDto["mainMedia"] = undefined;
24
+ if (mainMedia.type === "image") {
25
+ media = {
26
+ kind: "main-image",
27
+ file: {
28
+ kind: "image-file",
29
+ id: mainMedia.id,
30
+ downloadUrl: mainMedia.url,
31
+ name: "video",
32
+ size: 1000,
33
+ type: "video",
34
+ originalFileName: "",
35
+ },
36
+ overlay: false,
37
+ };
38
+ }
39
+ if (mainMedia.type === "video") {
40
+ media = {
41
+ kind: "main-video",
42
+ file: {
43
+ kind: "video-file",
44
+ id: mainMedia.id,
45
+ downloadUrl: mainMedia.url,
46
+ duration: 2,
47
+ name: "video",
48
+ size: 1000,
49
+ type: "video",
50
+ originalFileName: "",
51
+ },
52
+ controls: false,
53
+ volume: 1,
54
+ mode: "optional",
55
+ preDelay: 0,
56
+ };
57
+ }
58
+ return {
59
+ id: ("p" + pageNumber) as PageID,
60
+ _type: "question",
61
+ mainMedia: media,
62
+ prefix: PagePrefix.fromStringOrThrow("p" + pageNumber),
63
+ mainText: {
64
+ text: "test",
65
+ audioFile: {
66
+ kind: "audio-file",
67
+ id: audioId,
68
+ name: audioId + " beskrivelse",
69
+ downloadUrl: audioUrl,
70
+ duration: 2,
71
+ originalFileName: "",
72
+ size: 1000,
73
+ relativePath: "asd",
74
+ },
75
+ autoplay: false,
76
+ autoplayDelay: 0,
77
+ },
78
+ defaultQuestion: {
79
+ id: "q1" as QuestionID,
80
+ _type: "select-one",
81
+ prefix: "1",
82
+ text: "test",
83
+ options: [],
84
+ },
85
+ includedInSumScores: [],
86
+ autoplaySequence: [],
87
+ // id: "p1",
88
+ // _type: "question",
89
+ nextButton: { label: "", id: "ja" as OptionID, value: 1 },
90
+ tags: [],
91
+ };
92
+ };
93
+ describe("BuilderSchemaDto utilities works", () => {
94
+ test("Can override media-urls", () => {
95
+ const page1 = createPage({
96
+ pageNumber: 1,
97
+ audioUrl: "audio1_url",
98
+ mainMedia: { type: "image", url: "image1_url", id: "image1_id" },
99
+ });
100
+
101
+ const page2 = createPage({
102
+ pageNumber: 2,
103
+ audioUrl: "audio2_url",
104
+ mainMedia: { type: "video", url: "video2_url", id: "video2_id" },
105
+ });
106
+ const page3 = createPage({
107
+ pageNumber: 3,
108
+ audioUrl: "audio3_url",
109
+ mainMedia: { type: "video", url: "video3_url", id: "video3_id" },
110
+ });
111
+
112
+ expect(page1.mainMedia?.file.downloadUrl).toBe("image1_url");
113
+ expect(page1.mainText.audioFile && page1.mainText.audioFile.downloadUrl).toBe("audio1_url");
114
+ expect(page2.mainMedia?.file.downloadUrl).toBe("video2_url");
115
+ expect(page2.mainText.audioFile && page2.mainText.audioFile.downloadUrl).toBe("audio2_url");
116
+ expect(page3.mainMedia?.file.downloadUrl).toBe("video3_url");
117
+ expect(page3.mainText.audioFile && page3.mainText.audioFile.downloadUrl).toBe("audio3_url");
118
+ const dto: BuilderSchemaDto = {
119
+ id: SCHEMA_ID,
120
+ prefix: SCHEMA_PREFIX_A,
121
+ mainImage: false,
122
+ backgroundColor: "#FFFFFF",
123
+ name: "test-name",
124
+ pages: [page1, page2, page3],
125
+ baseHeight: 100,
126
+ baseWidth: 100,
127
+ rules: [],
128
+ tags: [],
129
+ };
130
+
131
+ const newDto = BuilderSchemaDto.overrideAllMediaUrls(dto, {
132
+ videoFilesBaseUrl: "base_url/video_folder",
133
+ audioFilesBaseUrl: "base_url/audio_folder",
134
+ imageFilesBaseUrl: "base_url/image_folder",
135
+ });
136
+
137
+ const pages = newDto.pages;
138
+ const page1Media = pages[0].mainMedia;
139
+ const page1Audio = pages[0].mainText.audioFile as AudioFile;
140
+ const page2Media = pages[1].mainMedia;
141
+ const page2Audio = pages[1].mainText.audioFile as AudioFile;
142
+ const page3Media = pages[2].mainMedia;
143
+ const page3Audio = pages[2].mainText.audioFile as AudioFile;
144
+
145
+ expect(page1Media?.file.downloadUrl).toBe("base_url/image_folder/image1_id");
146
+ expect(page1Media?.file.kind).toBe("image-file");
147
+ expect(page1Audio.downloadUrl).toBe("base_url/audio_folder/audio1_id");
148
+ expect(page2Media?.file.downloadUrl).toBe("base_url/video_folder/video2_id");
149
+ expect(page2Media?.file.kind).toBe("video-file");
150
+ expect(page2Audio.downloadUrl).toBe("base_url/audio_folder/audio2_id");
151
+ expect(page3Media?.file.downloadUrl).toBe("base_url/video_folder/video3_id");
152
+ expect(page3Media?.file.kind).toBe("video-file");
153
+ expect(page3Audio.downloadUrl).toBe("base_url/audio_folder/audio3_id");
154
+ });
155
+ });
@@ -0,0 +1,77 @@
1
+ import { SchemaID } from "./primitives/ID";
2
+ import { SchemaPrefixValue } from "./primitives/schema-prefix";
3
+ import { ImageFile } from "./media-files";
4
+ import type { BuilderPageDto } from "./page/Builder-page";
5
+ import { CodebookPredefinedVariable } from "./code-book/codebook-variable";
6
+ import { SumScoreVariableDto } from "./sum-score/sum-score-variable";
7
+ import type { BuilderRuleDto } from "./rulebuilder";
8
+ import type { BuilderTagDto } from "./tag/BuilderTag";
9
+
10
+ const setUrl = <T extends { downloadUrl: string }>(dto: T, newUrl: string): T => {
11
+ return { ...dto, downloadUrl: newUrl };
12
+ };
13
+
14
+ export interface BuilderSchemaDto {
15
+ readonly id: SchemaID;
16
+ readonly prefix: SchemaPrefixValue;
17
+ readonly mainImage: ImageFile | false;
18
+ readonly backgroundColor: string;
19
+ readonly name: string;
20
+ readonly pages: ReadonlyArray<BuilderPageDto>;
21
+ readonly baseHeight: number;
22
+ readonly baseWidth: number;
23
+ readonly predefinedVariables?: Array<CodebookPredefinedVariable>;
24
+ readonly sumScoreVariables?: ReadonlyArray<SumScoreVariableDto>;
25
+ readonly rules: ReadonlyArray<BuilderRuleDto>;
26
+ readonly tags: ReadonlyArray<BuilderTagDto>;
27
+ }
28
+
29
+ const blockAutoplayVideo = (dto: BuilderPageDto): BuilderPageDto => {
30
+ if (dto.mainMedia && dto.mainMedia.kind === "main-video") {
31
+ dto.mainMedia.mode = "optional";
32
+ }
33
+ return dto;
34
+ };
35
+
36
+ const overrideVideoUrl = (dto: BuilderPageDto, baseUrl: string): BuilderPageDto => {
37
+ if (dto.mainMedia && dto.mainMedia.kind === "main-video") {
38
+ dto.mainMedia.file.downloadUrl = [baseUrl, dto.mainMedia.file.id].join("/");
39
+ }
40
+ return dto;
41
+ };
42
+ const overrideImageUrl = (dto: BuilderPageDto, baseUrl: string): BuilderPageDto => {
43
+ if (dto.mainMedia && dto.mainMedia.kind === "main-image") {
44
+ dto.mainMedia.file.downloadUrl = [baseUrl, dto.mainMedia.file.id].join("/");
45
+ }
46
+ return dto;
47
+ };
48
+ const overrideAudioUrl = (dto: BuilderPageDto, baseUrl: string): BuilderPageDto => {
49
+ if (dto.mainText.audioFile) {
50
+ dto.mainText.audioFile.downloadUrl = [baseUrl, dto.mainText.audioFile.id].join("/");
51
+ }
52
+ return dto;
53
+ };
54
+
55
+ const overrideAllMediaUrls = (
56
+ schema: BuilderSchemaDto,
57
+ options: {
58
+ videoFilesBaseUrl: string;
59
+ audioFilesBaseUrl: string;
60
+ imageFilesBaseUrl: string;
61
+ },
62
+ ): BuilderSchemaDto => {
63
+ // const videoFolder = [options.baseUrl, options.videoFileFolder].join("/");
64
+ // const audioFolder = [options.baseUrl, options.audioFileFolder].join("/");
65
+ // const imageFolder = [options.baseUrl, options.imageFileFolder].join("/");
66
+ const pages = schema.pages.map((page) => {
67
+ page = overrideVideoUrl(page, options.videoFilesBaseUrl);
68
+ page = overrideImageUrl(page, options.imageFilesBaseUrl);
69
+ page = overrideAudioUrl(page, options.audioFilesBaseUrl);
70
+ return page;
71
+ });
72
+ return { ...schema, pages };
73
+ };
74
+ export const BuilderSchemaDto = {
75
+ blockAutoplayVideo,
76
+ overrideAllMediaUrls,
77
+ };
@@ -1,4 +1,3 @@
1
- import type { BuilderSchemaDto } from "./Builder-schema";
2
1
  import { BuilderSchema } from "./Builder-schema";
3
2
  import { BuilderPage } from "./page/Builder-page";
4
3
  import type { BuilderTagDto } from "./tag/BuilderTag";
@@ -8,6 +7,7 @@ import { SchemaPrefix } from "./primitives/schema-prefix";
8
7
 
9
8
  import { SumScoreVariableDto } from "./sum-score/sum-score-variable";
10
9
  import { OptionID, PageID, QuestionID, SchemaID, SumScoreVariableID } from "./primitives/ID";
10
+ import { BuilderSchemaDto } from "./Builder-schema-dto";
11
11
 
12
12
  const tag1: BuilderTagDto = BuilderTag.create("tag1", "This tag is defined in schemaDto1").toJson();
13
13
 
@@ -1,7 +1,6 @@
1
- import type { BuilderPageDto, BuilderPageType } from "./page/Builder-page";
1
+ import type { BuilderPageType } from "./page/Builder-page";
2
2
  import { BuilderPage } from "./page/Builder-page";
3
3
  import type {
4
- BuilderRuleDto,
5
4
  ExcludeByPageAction,
6
5
  ExcludeByTagAction,
7
6
  JumpToPageAction,
@@ -9,12 +8,10 @@ import type {
9
8
  } from "./rulebuilder";
10
9
  import { BuilderRule, RuleInput } from "./rulebuilder";
11
10
  import type { RuleQuestionVariable } from "./rulebuilder/RuleVariable";
12
- import type { BuilderTagDto } from "./tag/BuilderTag";
13
11
  import { BuilderTag } from "./tag/BuilderTag";
14
12
  import { DefaultThemeCompiler } from "./theme/default-theme-compiler";
15
13
  import { ImageFile } from "./media-files";
16
14
  import { DUtil } from "@media-quest/engine";
17
- import { PagePrefix } from "./primitives/page-prefix";
18
15
  import { SchemaPrefix, SchemaPrefixValue } from "./primitives/schema-prefix";
19
16
  import { CodeBook } from "./code-book/codebook";
20
17
  import { CodebookPredefinedVariable } from "./code-book/codebook-variable";
@@ -26,24 +23,12 @@ import { PageID, SchemaID, SumScoreVariableID } from "./primitives/ID";
26
23
  import { SumScoreVariableCollection } from "./sum-score/sum-score-variable-collection";
27
24
  import { TagCollection } from "./tag/Tag-Collection";
28
25
  import { BuilderPageCollection } from "./page/Builder-page-collection";
26
+ import { BuilderMainVideoDto } from "./BuilderMainVideoDto";
27
+ import { BuilderMainImageDto } from "./BuilderMainImageDto";
28
+ import { BuilderSchemaDto } from "./Builder-schema-dto";
29
29
 
30
30
  const U = DUtil;
31
31
 
32
- export interface BuilderSchemaDto {
33
- readonly id: SchemaID;
34
- readonly prefix: SchemaPrefixValue;
35
- readonly mainImage: ImageFile | false;
36
- readonly backgroundColor: string;
37
- readonly name: string;
38
- readonly pages: ReadonlyArray<BuilderPageDto>;
39
- readonly baseHeight: number;
40
- readonly baseWidth: number;
41
- readonly predefinedVariables?: Array<CodebookPredefinedVariable>;
42
- readonly sumScoreVariables?: ReadonlyArray<SumScoreVariableDto>;
43
- readonly rules: ReadonlyArray<BuilderRuleDto>;
44
- readonly tags: ReadonlyArray<BuilderTagDto>;
45
- }
46
-
47
32
  export class BuilderSchema {
48
33
  readonly prefix: SchemaPrefix;
49
34
  public readonly compiler = new DefaultThemeCompiler();
@@ -271,12 +256,16 @@ export class BuilderSchema {
271
256
  }
272
257
 
273
258
  compile(
274
- options: CompilerOption = { blockAutoplayQuestion: false, blockAutoplayVideo: false },
259
+ options: CompilerOption = {
260
+ blockAutoplayQuestion: false,
261
+ blockAutoplayVideo: false,
262
+ mediaAssets: null,
263
+ },
275
264
  ): CompilerOutput {
276
265
  // const moduleDto = this.toJson();
277
- const builderSchema = BuilderSchema.fromJson(this.toJson());
266
+ let builderSchema = BuilderSchema.fromJson(this.toJson());
278
267
 
279
- // Overriding the
268
+ // Override with compiler options.
280
269
  builderSchema._pageCollection.pages.forEach((p) => {
281
270
  if (options.blockAutoplayQuestion) {
282
271
  p.mainText.autoplay = false;
@@ -288,8 +277,16 @@ export class BuilderSchema {
288
277
  }
289
278
  }
290
279
  });
291
- const moduleDto = builderSchema.toJson();
292
- // const imp = new DefaultThemeCompiler();
280
+
281
+ let moduleDto = builderSchema.toJson();
282
+ if (options.mediaAssets) {
283
+ const { videoFilesBaseUrl, audioFilesBaseUrl, imageFilesBaseUrl } = options.mediaAssets;
284
+ moduleDto = BuilderSchemaDto.overrideAllMediaUrls(moduleDto, {
285
+ videoFilesBaseUrl,
286
+ audioFilesBaseUrl,
287
+ imageFilesBaseUrl,
288
+ });
289
+ }
293
290
 
294
291
  const codebook = CodeBook.fromSchema(moduleDto);
295
292
  const schema = this.compiler.compile(moduleDto);
@@ -1,14 +1,20 @@
1
- import { SchemaDto } from "@media-quest/engine";
2
- import { Codebook } from "./code-book/codebook";
3
- import { SchemaConfig } from "./schema-config";
4
-
5
- export interface CompilerOutput {
6
- schema: SchemaDto;
7
- codebook: Codebook;
8
- schemaConfig: SchemaConfig;
9
- }
10
-
11
- export interface CompilerOption {
12
- blockAutoplayQuestion: boolean;
13
- blockAutoplayVideo: boolean;
14
- }
1
+ import { SchemaDto } from "@media-quest/engine";
2
+ import { Codebook } from "./code-book/codebook";
3
+ import { SchemaConfig } from "./schema-config";
4
+
5
+ export interface CompilerOutput {
6
+ schema: SchemaDto;
7
+ codebook: Codebook;
8
+ schemaConfig: SchemaConfig;
9
+ }
10
+
11
+ export interface CompilerOption {
12
+ blockAutoplayQuestion: boolean;
13
+ blockAutoplayVideo: boolean;
14
+ mediaAssets: {
15
+ audioFilesBaseUrl: string;
16
+ videoFilesBaseUrl: string;
17
+ imageFilesBaseUrl: string;
18
+ fileNameStrategy: "id" | "newFileName" | "originalFileName" | "relativePath";
19
+ } | null;
20
+ }
@@ -1,7 +1,7 @@
1
1
  import { BuilderPageDto } from "../page/Builder-page";
2
- import { BuilderSchemaDto } from "../Builder-schema";
3
2
  import { CodeBookQuestionVariable, CodebookPredefinedVariable } from "./codebook-variable";
4
3
  import { SumScoreVariableDto } from "../sum-score/sum-score-variable";
4
+ import { BuilderSchemaDto } from "../Builder-schema-dto";
5
5
 
6
6
  export interface Codebook {
7
7
  readonly predefinedVariables: ReadonlyArray<CodebookPredefinedVariable>;
@@ -1,28 +1,32 @@
1
- export interface AudioFile {
2
- readonly kind: "audio-file";
3
- readonly id: string;
4
- readonly downloadUrl: string;
5
- readonly duration: number;
6
- readonly originalFileName: string;
7
- readonly name: string;
8
- readonly size: number;
9
- }
10
-
11
- export interface VideoFile {
12
- readonly kind: "video-file";
13
- readonly id: string;
14
- readonly downloadUrl: string;
15
- readonly duration: number;
16
- readonly name: string;
17
- readonly size: number;
18
- readonly type: string;
19
- readonly originalFileName: string;
20
- }
21
- export interface ImageFile {
22
- readonly kind: "image-file";
23
- readonly id: string;
24
- readonly downloadUrl: string;
25
- readonly name: string;
26
- readonly size: number;
27
- readonly type: string;
28
- }
1
+ export interface AudioFile {
2
+ readonly kind: "audio-file";
3
+ readonly id: string;
4
+ downloadUrl: string;
5
+ readonly duration: number;
6
+ readonly originalFileName: string;
7
+ readonly name: string;
8
+ readonly size: number;
9
+ readonly relativePath?: string;
10
+ }
11
+
12
+ export interface VideoFile {
13
+ readonly kind: "video-file";
14
+ readonly id: string;
15
+ downloadUrl: string;
16
+ readonly duration: number;
17
+ readonly name: string;
18
+ readonly size: number;
19
+ readonly type: string;
20
+ readonly originalFileName: string;
21
+ readonly relativePath?: string;
22
+ }
23
+ export interface ImageFile {
24
+ readonly kind: "image-file";
25
+ readonly id: string;
26
+ downloadUrl: string;
27
+ readonly name: string;
28
+ readonly size: number;
29
+ readonly type: string;
30
+ readonly originalFileName?: string;
31
+ readonly relativePath?: string;
32
+ }
package/src/public-api.ts CHANGED
@@ -5,7 +5,7 @@ export {
5
5
  BuilderQuestion,
6
6
  type BuilderQuestionType,
7
7
  } from "./Builder-question";
8
- export { BuilderSchema, type BuilderSchemaDto } from "./Builder-schema";
8
+ export { BuilderSchema } from "./Builder-schema";
9
9
  export { BuilderText, type BuilderTextDto } from "./Builder-text";
10
10
  export { type BuilderMainImageDto } from "./BuilderMainImageDto";
11
11
  export { BuilderMainText, type BuilderMainTextDto } from "./BuilderMainText";
@@ -27,3 +27,4 @@ export { SumScoreVariableDto, SumScoreVariable } from "./sum-score/sum-score-var
27
27
  export { SumScoreAnswer } from "./sum-score/sum-score-answer";
28
28
  export { TagCollection } from "./tag/Tag-Collection";
29
29
  export * from "./theme/Default-theme";
30
+ export { BuilderSchemaDto } from "./Builder-schema-dto";