Commit b760ffcd authored by Hanadi's avatar Hanadi
Browse files

Initial Commit

parents
{
"name": "ogc3dcontainerentitiesmodel",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@rollup/pluginutils": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
"picomatch": "^2.2.2"
}
},
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true
},
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
"dev": true
},
"estree-walker": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
"dev": true
},
"find-cache-dir": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
"integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
"pkg-dir": "^4.1.0"
}
},
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"dev": true,
"optional": true
},
"graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
"dev": true,
"requires": {
"semver": "^6.0.0"
}
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
},
"p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true
},
"pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"dev": true,
"requires": {
"find-up": "^4.0.0"
}
},
"resolve": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
}
},
"rollup": {
"version": "2.35.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz",
"integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
}
},
"rollup-plugin-typescript2": {
"version": "0.29.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.29.0.tgz",
"integrity": "sha512-YytahBSZCIjn/elFugEGQR5qTsVhxhUwGZIsA9TmrSsC88qroGo65O5HZP/TTArH2dm0vUmYWhKchhwi2wL9bw==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.1.0",
"find-cache-dir": "^3.3.1",
"fs-extra": "8.1.0",
"resolve": "1.17.0",
"tslib": "2.0.1"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
},
"tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==",
"dev": true
},
"typescript": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz",
"integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg=="
},
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
}
}
}
{
"name": "ogc3dcontainerentitiesmodel",
"version": "1.0.4",
"description": "This project is a TypeScript Library for the entities used in the OGC 3D container (AKA GeoVolume API)",
"main": "lib/index.js",
"module": "lib/index.esm.js",
"scripts": {
"build": "rollup -c",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://gitlab.com/hanadiEbrahim/ogc3dcontainerentitiesmodel.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/hanadiEbrahim/ogc3dcontainerentitiesmodel/issues"
},
"homepage": "https://gitlab.com/hanadiEbrahim/ogc3dcontainerentitiesmodel#readme",
"dependencies": {
"typescript": "^4.1.3"
},
"devDependencies": {
"rollup": "^2.35.1",
"rollup-plugin-typescript2": "^0.29.0"
},
"files": [
"lib",
"package.json"
]
}
import typescript from 'rollup-plugin-typescript2'
export default [
{
input: './src/index.ts',
output: {
file: './lib/index.esm.js',
format: 'esm',
},
plugins: [typescript()],
},
{
input: './src/index.ts',
output: {
file: './lib/index.js',
format: 'cjs',
},
plugins: [typescript()],
},
]
\ No newline at end of file
export class BoundingVolume {
box?: number[];
region?: number[];
sphere?: number[];
static fromJson(jsonObj: any) {
const boundingVolume = new BoundingVolume();
boundingVolume.box = jsonObj["box"];
boundingVolume.region = jsonObj["region"];
boundingVolume.sphere = jsonObj["sphere"];
return boundingVolume;
}
}
\ No newline at end of file
import {_3DContainer} from "./_3DContainer";
import {Link} from "./Link";
export class Collections {
links?: Link[];
collections?: _3DContainer[];
static fromJson(jsonObj: any): Collections {
const collections = new Collections();
collections.links = jsonObj["links"]?.map(Link.fromJson);
collections.collections = jsonObj["collections"]?.map(_3DContainer.fromJson);
return collections;
}
}
\ No newline at end of file
import {validateRequiredFields} from "./Helpers";
export class Conformance {
conformsTo!: string[];
static fromJson(jsonObj: any): Conformance {
validateRequiredFields(jsonObj, ["conformsTo"], Conformance.name);
let conformance = new Conformance();
conformance.conformsTo = jsonObj["conformsTo"];
return conformance;
}
}
\ No newline at end of file
import {ExceptionCode} from "./ExceptionCode";
export class Exception extends Error {
code!: ExceptionCode;
description?: string;
name = "OGC_Exception";
constructor(code: ExceptionCode, description: string | undefined) {
super(description);
this.code = code;
this.description = description;
}
}
\ No newline at end of file
export enum ExceptionCode {
MISSING_REQUIRED_FIELD = "MISSING_REQUIRED_FIELD"
}
\ No newline at end of file
import {SpatialExtent} from "./SpatialExtent";
import {TemporalExtent} from "./TemporalExtent";
import {validateRequiredFields} from "./Helpers";
export class Extent {
spatial!: SpatialExtent;
temporal?: TemporalExtent;
static fromJson(jsonObj: any): Extent {
validateRequiredFields(jsonObj, ["spatial"], Extent.name);
const extent = new Extent();
extent.spatial = SpatialExtent.fromJson(jsonObj["spatial"]);
if (jsonObj.hasOwnProperty("temporal"))
extent.temporal = TemporalExtent.fromJson(jsonObj["temporal"]);
return extent;
}
}
\ No newline at end of file
import {Exception} from "./Exception";
import {ExceptionCode} from "./ExceptionCode";
export function validateRequiredFields(obj: any, fields: string[], className?: string) {
fields.forEach(field => {
if (!obj.hasOwnProperty(field))
throw new Exception(
ExceptionCode.MISSING_REQUIRED_FIELD,
`Missing field ${field}` + (className ? ` from ${className}` : '')
)
})
}
\ No newline at end of file
import {Link} from "./Link";
import {validateRequiredFields} from "./Helpers";
export class LandingPage {
title?: string;
description?: string;
links!: Link[];
static fromJson(jsonObj: any): LandingPage {
validateRequiredFields(jsonObj, ["links"], LandingPage.name);
let landingPage = new LandingPage();
landingPage.title = jsonObj["title"];
landingPage.description = jsonObj["description"];
landingPage.links = jsonObj["links"].map(Link.fromJson);
return landingPage;
}
// TODO from html
}
\ No newline at end of file
import {RelationshipLink} from "./RelationshipLink";
import {Type} from "./Type";
import {validateRequiredFields} from "./Helpers";
export class Link {
title?: string;
href!: string;
rel!: RelationshipLink;
type?: Type;
hreflang?: string;
static fromJson(jsonObj: any): Link {
validateRequiredFields(jsonObj, ["href", "rel"], Link.name);
let link = new Link();
link.href = jsonObj["href"];
link.rel = jsonObj["rel"];
if ("title" in jsonObj)
link.title = jsonObj["title"];
if ("type" in jsonObj)
link.type = jsonObj["type"];
if ("hreflang" in jsonObj)
link.hreflang = jsonObj["hreflang"];
return link;
}
}
\ No newline at end of file
export enum RelationshipLink {
affinemap,
alternate,
collection,
conformance,
data,
dataset,
describedBy,
distribution,
item,
items,
original,
parent,
root,
scheme,
self,
service,
'service-desc'
}
\ No newline at end of file
import {Link} from "./Link"
export class Root{
links! : Link[];
}
\ No newline at end of file
import {validateRequiredFields} from "./Helpers";
export class SpatialExtent {
crs?: string[];
bbox!: number[];
static fromJson(jsonObj: any) {
validateRequiredFields(jsonObj, ["bbox"], SpatialExtent.name);
const spatialExtent = new SpatialExtent();
spatialExtent.crs = jsonObj["crs"];
spatialExtent.bbox = jsonObj["bbox"];
return spatialExtent;
}
}
\ No newline at end of file
export class TemporalExtent {
trs?: string[];
interval?: string[];
static fromJson(jsonObj: any): TemporalExtent {
const temporalExtent = new TemporalExtent();
temporalExtent.trs = jsonObj["trs"];
temporalExtent.interval = jsonObj["interval"];
return temporalExtent;
}
}
\ No newline at end of file
export type Type = "application/json" | "application/json-3dtiles" | "application/json-i3s" | "text/html";
\ No newline at end of file
import {Extent} from "./Extent";
import {BoundingVolume} from "./BoundingVolume";
import {Link} from "./Link";
import {validateRequiredFields} from "./Helpers";
export class _3DContainer {
id!: string;
title?: string;
description?: string;
collectionType?: string;
itemType?: string;
extent!: Extent;
contentExtent?: BoundingVolume;
crs?: string[];
links!: Link[];
children?: _3DContainer[];
content?: Link[];
static fromJson(jsonObj: any): _3DContainer {
validateRequiredFields(jsonObj, ["id", "extent", "links"], _3DContainer.name);
const container = new _3DContainer();
container.id = jsonObj["id"];
container.title = jsonObj["title"];
container.description = jsonObj["description"];
container.collectionType = jsonObj["collectionType"];
container.itemType = jsonObj["itemType"];
container.extent = Extent.fromJson(jsonObj["extent"]);
if (jsonObj.hasOwnProperty("contentExtent"))
container.contentExtent = BoundingVolume.fromJson(jsonObj["contentExtent"]);
container.crs = jsonObj["crs"];
container.links = jsonObj["links"].map(Link.fromJson);
container.children = jsonObj["children"]?.map(_3DContainer.fromJson);
container.content = jsonObj["content"].map(Link.fromJson);
return container;
}
}
\ No newline at end of file
import {_3DContainer} from "./_3DContainer";
import {BoundingVolume} from "./BoundingVolume";
import {Collections} from "./Collections";
import {Conformance} from "./Conformance";
import {Extent} from "./Extent";
import {LandingPage} from "./LandingPage";
import {Link} from "./Link";
import {RelationshipLink} from "./RelationshipLink";
import {Root} from "./Root";
import {SpatialExtent} from "./SpatialExtent";
import {TemporalExtent} from "./TemporalExtent";
import type {Type} from "./Type";
import {ExceptionCode} from "./ExceptionCode";
import {Exception} from "./Exception";
export {
_3DContainer,
BoundingVolume,
Collections,
Conformance,
Extent,
LandingPage,
Link,
RelationshipLink,
Root,
SpatialExtent,
TemporalExtent,
Type,
ExceptionCode,
Exception
}
\ No newline at end of file
{
"compilerOptions": {
"outDir": "lib",
"target": "es5",
"module": "esnext",
"lib": ["es2015"],
"sourceMap": true,
"strict": true,
"strictFunctionTypes": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"declaration": true,
"esModuleInterop": true
},
"include": ["src"],
"exclude": ["node_modules", "lib", "**/*.test.ts"]
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment