diff --git a/package-lock.json b/package-lock.json index 054b26c..daef400 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@map-colonies/mc-model-types", - "version": "6.1.0", + "version": "7.3.3", "license": "MIT", "dependencies": { "@types/geojson": "^7946.0.7", diff --git a/package.json b/package.json index 128f0d9..de04cfc 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "scripts": { "clean": "rimraf *.tgz Schema", "release": "standard-version -t mc-model-types@", - "build": "tsc --project tsconfig.build.json", + "build": "tsc --project tsconfig.build.json", "copy:yaml": "copyfiles -u 1 \"./src/yaml/**/*.yaml\" ./Schema", "copy": "npm run copy:yaml", "prepack": "npm run build && npm run copy", diff --git a/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts b/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts index d27ea39..5b3b1d0 100644 --- a/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts +++ b/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts @@ -17,6 +17,8 @@ export interface IFieldConfigInfo { isManuallyEditable?: boolean; // is field might be edited after creation isFilterable?: boolean; // is field might participate in filter/search params isSortable?: boolean; // is field might participate in sorting + isRequired?: boolean; // is field mandatory + isAutoGenerated?: boolean; // is field auto-generated } export interface IPropFieldConfigInfo extends IFieldConfigInfo { diff --git a/src/models/layerMetadata/layer3DMetadata.ts b/src/models/layerMetadata/layer3DMetadata.ts index b818b2d..49e162e 100644 --- a/src/models/layerMetadata/layer3DMetadata.ts +++ b/src/models/layerMetadata/layer3DMetadata.ts @@ -87,6 +87,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { @fieldConfig({ category: FieldCategory.GENERAL, isManuallyEditable: true, + isRequired: true, }) //#endregion public classification: string | undefined = undefined; @@ -112,6 +113,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { @fieldConfig({ category: FieldCategory.MAIN, isManuallyEditable: true, + isRequired: true, }) //#endregion public productName: string | undefined = undefined; @@ -165,6 +167,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GEO_INFO, + isRequired: true, }) //#endregion public srsId: string | undefined = undefined; @@ -192,6 +195,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GENERAL, + isRequired: true, }) //#endregion public producerName: string | undefined = undefined; @@ -292,6 +296,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GENERAL, + isRequired: true, }) //#endregion public sourceDateStart: Date | undefined = undefined; @@ -317,6 +322,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GENERAL, + isRequired: true, }) //#endregion public sourceDateEnd: Date | undefined = undefined; @@ -342,6 +348,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GEO_INFO, + isRequired: true, }) //#endregion public accuracyCE90: number | undefined = undefined; @@ -371,6 +378,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { @fieldConfig({ category: FieldCategory.GENERAL, isManuallyEditable: true, + isRequired: true, }) //#endregion public sensorType: SensorType[] | undefined = undefined; @@ -397,6 +405,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GENERAL, + isRequired: true, }) //#endregion public region: string | undefined = undefined; @@ -477,6 +486,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.MAIN, + isRequired: true, }) //#endregion public version: string | undefined = undefined; @@ -653,9 +663,11 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GEO_INFO, + isRequired: true, }) //#endregion public accuracyLE90: number | undefined = undefined; + //#endregion // //#region 3D: accuracySE90 // @pycsw({ diff --git a/src/models/layerMetadata/layerMetadata.ts b/src/models/layerMetadata/layerMetadata.ts index 9aeffcd..9ff6c16 100644 --- a/src/models/layerMetadata/layerMetadata.ts +++ b/src/models/layerMetadata/layerMetadata.ts @@ -112,6 +112,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { @fieldConfig({ category: FieldCategory.MAIN, isManuallyEditable: true, + isRequired: true, }) //#endregion public productName: string | undefined = undefined; diff --git a/src/models/layerMetadata/pycsw3DCatalogRecord.ts b/src/models/layerMetadata/pycsw3DCatalogRecord.ts index 3884942..92e6bd6 100644 --- a/src/models/layerMetadata/pycsw3DCatalogRecord.ts +++ b/src/models/layerMetadata/pycsw3DCatalogRecord.ts @@ -4,12 +4,12 @@ import { IOrmCatalog } from '../common/interfaces/ormCatalog.interface'; import { graphql } from '../common/decorators/graphQL/graphql.decorator'; import { graphqlClass } from '../common/decorators/graphQL/classGraphql.decorator'; import { FieldCategory, fieldConfig, getFieldConfig, IPropFieldConfigInfo } from '../common/decorators/fieldConfig/fieldConfig.decorator'; -import { Link } from './link'; import { catalogDB, getCatalogDBMapping } from './decorators/property/catalogDB.decorator'; import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTypes.decorator'; import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator'; import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator'; import { Layer3DMetadata, IPropPYCSWMapping } from './layer3DMetadata'; +import { Link } from './link'; @catalogDBEntity({ table: 'records', @@ -37,6 +37,7 @@ export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreM @graphql() @fieldConfig({ category: FieldCategory.MAIN, + isAutoGenerated: true, }) //#endregion public id: string | undefined = 'UNKNOWN'; @@ -227,6 +228,11 @@ export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreM @graphql({ nullable: true, }) + @fieldConfig({ + category: FieldCategory.GENERAL, + complexType: TsTypes.LINKS, + isAutoGenerated: true, + }) //#endregion public links: Link[] | undefined = undefined; diff --git a/src/models/layerMetadata/pycswLayerCatalogRecord.ts b/src/models/layerMetadata/pycswLayerCatalogRecord.ts index 8db42af..cf36700 100644 --- a/src/models/layerMetadata/pycswLayerCatalogRecord.ts +++ b/src/models/layerMetadata/pycswLayerCatalogRecord.ts @@ -39,6 +39,7 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore @graphql() @fieldConfig({ category: FieldCategory.MAIN, + isAutoGenerated: true, }) //#endregion public id: string | undefined = undefined; @@ -220,6 +221,7 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore @fieldConfig({ category: FieldCategory.GENERAL, complexType: TsTypes.LINKS, + isAutoGenerated: true, }) //#endregion public links: Link[] | undefined = undefined;