Skip to content

Commit

Permalink
feat(still image): introduce ReadStillImageExternalFileValue
Browse files Browse the repository at this point in the history
  • Loading branch information
domsteinbach committed Jun 18, 2024
1 parent ad67f50 commit ae730a3
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 48 deletions.
17 changes: 9 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,13 @@ export { ReadBooleanValue } from "./models/v2/resources/values/read/read-boolean
export { ReadColorValue } from "./models/v2/resources/values/read/read-color-value";
export { ReadDateValue, KnoraDate, KnoraPeriod, Precision } from "./models/v2/resources/values/read/read-date-value";
export { ReadDecimalValue } from "./models/v2/resources/values/read/read-decimal-value";
export {
export {
ReadFileValue,
ReadAudioFileValue,
ReadDocumentFileValue,
ReadMovingImageFileValue,
ReadStillImageFileValue,
ReadStillImageExternalFileValue,
ReadArchiveFileValue,
ReadTextFileValue
} from "./models/v2/resources/values/read/read-file-value";
Expand All @@ -182,9 +183,9 @@ export { ReadIntervalValue } from "./models/v2/resources/values/read/read-interv
export { ReadLinkValue } from "./models/v2/resources/values/read/read-link-value";
export { ReadListValue } from "./models/v2/resources/values/read/read-list-value";
export {
ReadTextValue,
ReadTextValueAsString,
ReadTextValueAsHtml,
ReadTextValue,
ReadTextValueAsString,
ReadTextValueAsHtml,
ReadTextValueAsXml
} from "./models/v2/resources/values/read/read-text-value";
export { ReadUriValue } from "./models/v2/resources/values/read/read-uri-value";
Expand All @@ -197,7 +198,7 @@ export { UpdateBooleanValue } from "./models/v2/resources/values/update/update-b
export { UpdateColorValue } from "./models/v2/resources/values/update/update-color-value";
export { UpdateDateValue } from "./models/v2/resources/values/update/update-date-value";
export { UpdateDecimalValue } from "./models/v2/resources/values/update/update-decimal-value";
export {
export {
UpdateFileValue,
UpdateAudioFileValue,
UpdateDocumentFileValue,
Expand All @@ -211,7 +212,7 @@ export { UpdateIntValue } from "./models/v2/resources/values/update/update-int-v
export { UpdateIntervalValue } from "./models/v2/resources/values/update/update-interval-value";
export { UpdateLinkValue } from "./models/v2/resources/values/update/update-link-value";
export { UpdateListValue } from "./models/v2/resources/values/update/update-list-value";
export {
export {
UpdateTextValueAsString,
UpdateTextValueAsXml,
UpdateTextValueAsHtml
Expand All @@ -225,7 +226,7 @@ export { CreateBooleanValue } from "./models/v2/resources/values/create/create-b
export { CreateColorValue } from "./models/v2/resources/values/create/create-color-value";
export { CreateDateValue } from "./models/v2/resources/values/create/create-date-value";
export { CreateDecimalValue } from "./models/v2/resources/values/create/create-decimal-value";
export {
export {
CreateFileValue,
CreateAudioFileValue,
CreateDocumentFileValue,
Expand All @@ -239,7 +240,7 @@ export { CreateIntValue } from "./models/v2/resources/values/create/create-int-v
export { CreateIntervalValue } from "./models/v2/resources/values/create/create-interval-value";
export { CreateLinkValue } from "./models/v2/resources/values/create/create-link-value";
export { CreateListValue } from "./models/v2/resources/values/create/create-list-value";
export {
export {
CreateTextValueAsString,
CreateTextValueAsXml
} from "./models/v2/resources/values/create/create-text-value";
Expand Down
2 changes: 2 additions & 0 deletions src/models/v2/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class Constants {
static DDDFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "DDDFileValue";
static DocumentFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "DocumentFileValue";
static StillImageFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "StillImageFileValue";
static StillImageExternalFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "StillImageExternalFileValue";
static MovingImageFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "MovingImageFileValue";
static TextFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "TextFileValue";
static ArchiveFileValue = Constants.KnoraApiV2 + Constants.HashDelimiter + "ArchiveFileValue";
Expand Down Expand Up @@ -128,6 +129,7 @@ export class Constants {
static StillImageFileValueHasDimX = Constants.KnoraApiV2 + Constants.HashDelimiter + "stillImageFileValueHasDimX";
static StillImageFileValueHasDimY = Constants.KnoraApiV2 + Constants.HashDelimiter + "stillImageFileValueHasDimY";
static StillImageFileValueHasIIIFBaseUrl = Constants.KnoraApiV2 + Constants.HashDelimiter + "stillImageFileValueHasIIIFBaseUrl";
static StillImageFileValueHasExternalUrl = Constants.KnoraApiV2 + Constants.HashDelimiter + "stillImageFileValueHasExternalUrl";
static AudioFileValueHasDuration = Constants.KnoraApiV2 + Constants.HashDelimiter + "audioFileValueHasDuration";
static MovingImageFileValueHasDimX = Constants.KnoraApiV2 + Constants.HashDelimiter + "movingImageFileValueHasDimX";
static MovingImageFileValueHasDimY = Constants.KnoraApiV2 + Constants.HashDelimiter + "movingImageFileValueHasDimY";
Expand Down
9 changes: 9 additions & 0 deletions src/models/v2/resources/ResourcesConversionUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ReadAudioFileValue,
ReadDocumentFileValue,
ReadMovingImageFileValue,
ReadStillImageExternalFileValue,
ReadStillImageFileValue,
ReadTextFileValue
} from "./values/read/read-file-value";
Expand Down Expand Up @@ -459,6 +460,14 @@ export namespace ResourcesConversionUtil {
break;
}

case Constants.StillImageExternalFileValue: {
const extStillImageVal = handleSimpleValue(valueJsonld, ReadStillImageExternalFileValue, jsonConvert);
value = extStillImageVal.pipe(map((val: ReadStillImageExternalFileValue) => {
return val;
}));
break;
}

case Constants.ArchiveFileValue: {
const archiveVal = handleSimpleValue(valueJsonld, ReadArchiveFileValue, jsonConvert);
value = archiveVal.pipe(map((val: ReadArchiveFileValue) => {
Expand Down
16 changes: 14 additions & 2 deletions src/models/v2/resources/values/create/create-file-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ export class CreateStillImageFileValue extends CreateFileValue {

}

/**
* @category Model V2
*/
@JsonObject("CreateStillImageExternalFileValue")
export class CreateStillImageExternalFileValue extends CreateFileValue {

constructor() {
super(Constants.StillImageExternalFileValue);
}

}

/**
* @category Model V2
*/
Expand All @@ -77,9 +89,9 @@ export class CreateTextFileValue extends CreateFileValue {
*/
@JsonObject("CreateArchiveFileValue")
export class CreateArchiveFileValue extends CreateFileValue {

constructor() {
super(Constants.ArchiveFileValue);
}

}
15 changes: 15 additions & 0 deletions src/models/v2/resources/values/read/read-file-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ export class ReadStillImageFileValue extends ReadFileValue {

}

/**
* @category Model V2
*/
@JsonObject("ReadStillImageExternalFileValue")
export class ReadStillImageExternalFileValue extends ReadFileValue {

@JsonProperty(Constants.StillImageFileValueHasIIIFBaseUrl, UriConverter)
iiifBaseUrl: string = "";

@JsonProperty(Constants.StillImageFileValueHasExternalUrl, UriConverter)
externalUrl: string = "";

}


/**
* @category Model V2
*/
Expand Down
17 changes: 15 additions & 2 deletions src/models/v2/resources/values/update/update-file-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ export class UpdateStillImageFileValue extends UpdateFileValue {

}

/**
* @category Model V2
*/
@JsonObject("UpdateStillImageExternalFileValue")
export class UpdateExternalStillImageFileValue extends UpdateFileValue {

constructor() {
super(Constants.StillImageExternalFileValue);
}

}


/**
* @category Model V2
*/
Expand All @@ -79,9 +92,9 @@ export class UpdateTextFileValue extends UpdateFileValue {
*/
@JsonObject("UpdateArchiveFileValue")
export class UpdateArchiveFileValue extends UpdateFileValue {

constructor() {
super(Constants.ArchiveFileValue);
}

}
37 changes: 1 addition & 36 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,36 +1 @@
{
"compilerOptions": {
"declaration": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"lib": [
"es6",
"dom"
],
"module": "es6",
"removeComments": false,
"target": "es5",
"resolveJsonModule": true,
"moduleResolution": "node",
"sourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"outDir": "build"
},
"exclude": [
"build",
"coverage",
"dist",
"node_modules",
"test",
"**/*.spec.ts",
"test-framework"
],
"files": [
"index.ts"
],
"include": [
"src/**/*.ts"
]
}
{"compilerOptions":{"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"lib":["es6","dom"],"module":"es6","removeComments":false,"target":"es5","resolveJsonModule":true,"moduleResolution":"node","sourceMap":true,"strictNullChecks":true,"noImplicitAny":true,"outDir":"build"},"exclude":["build","coverage"],"files":["index.ts"],"include":["src/**/*.ts"]}

0 comments on commit ae730a3

Please sign in to comment.