Compare commits

...

10 Commits

Author SHA1 Message Date
Rainer Killinger
942f04e250 0.66.1 2022-05-27 16:54:06 +02:00
Rainer Killinger
930b574618 refactor: update dependencies 2022-05-27 16:51:08 +02:00
Rainer Killinger
7b88be3a75 refactor: initalize meta classes in translator 2022-05-27 15:21:59 +02:00
Jovan Krunić
5277f7601c docs: update changelog 2022-05-11 13:54:54 +02:00
Jovan Krunić
5241a01b55 0.66.0 2022-05-11 13:54:52 +02:00
484be6a890 feat: add geo filter envelope support 2022-04-28 09:50:44 +02:00
Rainer Killinger
45e0f26391 docs: update changelog 2022-04-04 20:56:06 +02:00
Rainer Killinger
ead47aca19 0.65.1 2022-04-04 20:56:04 +02:00
Rainer Killinger
f9c2414000 docs: adjust typedoc option 'entryPointStrategy' 2022-04-04 20:55:16 +02:00
Rainer Killinger
523de51160 docs: update changelog 2022-04-04 20:47:21 +02:00
5 changed files with 587 additions and 388 deletions

View File

@@ -1,3 +1,20 @@
# [0.66.0](https://gitlab.com/openstapps/core/compare/v0.65.1...v0.66.0) (2022-05-11)
### Features
* add geo filter envelope support ([484be6a](https://gitlab.com/openstapps/core/commit/484be6a890d743601efa5d40d33ea2c619f3126d))
## [0.65.1](https://gitlab.com/openstapps/core/compare/v0.65.0...v0.65.1) (2022-04-04)
# [0.65.0](https://gitlab.com/openstapps/core/compare/v0.64.0...v0.65.0) (2022-04-04)
# [0.64.0](https://gitlab.com/openstapps/core/compare/v0.63.0...v0.64.0) (2022-03-21) # [0.64.0](https://gitlab.com/openstapps/core/compare/v0.63.0...v0.64.0) (2022-03-21)

901
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@openstapps/core", "name": "@openstapps/core",
"version": "0.65.0", "version": "0.66.1",
"description": "StAppsCore - Generalized model of data", "description": "StAppsCore - Generalized model of data",
"keywords": [ "keywords": [
"Model", "Model",
@@ -18,7 +18,7 @@
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'",
"check-configuration": "openstapps-configuration", "check-configuration": "openstapps-configuration",
"compile": "rimraf lib && tsc", "compile": "rimraf lib && tsc",
"documentation": "typedoc --name \"@openstapps/core\" --includeVersion --out docs --readme README.md --listInvalidSymbolLinks src", "documentation": "typedoc --name \"@openstapps/core\" --includeVersion --out docs --readme README.md --listInvalidSymbolLinks --entryPointStrategy expand src",
"pack": "openstapps-core-tools pack", "pack": "openstapps-core-tools pack",
"postversion": "npm run changelog", "postversion": "npm run changelog",
"prepublishOnly": "npm ci && npm run build", "prepublishOnly": "npm ci && npm run build",
@@ -45,11 +45,11 @@
"Wieland Schöbl" "Wieland Schöbl"
], ],
"dependencies": { "dependencies": {
"@openstapps/core-tools": "0.30.0", "@openstapps/core-tools": "0.30.1",
"@types/geojson": "1.0.6", "@types/geojson": "1.0.6",
"@types/json-patch": "0.0.30", "@types/json-patch": "0.0.30",
"@types/json-schema": "7.0.11", "@types/json-schema": "7.0.11",
"@types/node": "14.18.3", "@types/node": "14.18.18",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"http-status-codes": "2.2.0", "http-status-codes": "2.2.0",
"json-patch": "0.7.0", "json-patch": "0.7.0",
@@ -58,26 +58,26 @@
"ts-optchain": "0.1.8" "ts-optchain": "0.1.8"
}, },
"devDependencies": { "devDependencies": {
"@openstapps/configuration": "0.29.0", "@openstapps/configuration": "0.29.1",
"@openstapps/es-mapping-generator": "0.0.4", "@openstapps/es-mapping-generator": "0.1.0",
"@openstapps/logger": "0.8.0", "@openstapps/logger": "0.8.1",
"@testdeck/mocha": "0.2.0", "@testdeck/mocha": "0.2.0",
"@types/chai": "4.3.0", "@types/chai": "4.3.1",
"@types/lodash": "4.14.181", "@types/lodash": "4.14.182",
"@types/mocha": "9.1.0", "@types/mocha": "9.1.1",
"@types/rimraf": "3.0.2", "@types/rimraf": "3.0.2",
"chai": "4.3.6", "chai": "4.3.6",
"conditional-type-checks": "1.0.5", "conditional-type-checks": "1.0.5",
"conventional-changelog-cli": "2.2.2", "conventional-changelog-cli": "2.2.2",
"lodash": "4.17.21", "lodash": "4.17.21",
"mocha": "9.2.2", "mocha": "10.0.0",
"nyc": "15.1.0", "nyc": "15.1.0",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"source-map-support": "0.5.21", "source-map-support": "0.5.21",
"surge": "0.23.1", "surge": "0.23.1",
"ts-node": "10.7.0", "ts-node": "10.8.0",
"tslint": "6.1.3", "tslint": "6.1.3",
"typedoc": "0.22.13", "typedoc": "0.22.15",
"typescript": "4.3.5" "typescript": "4.3.5"
}, },
"nyc": { "nyc": {

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
// tslint:disable-next-line:no-implicit-dependencies // tslint:disable-next-line:no-implicit-dependencies
import {Polygon} from 'geojson'; import {Polygon, Position} from 'geojson';
import {SCThingsField} from '../../../meta'; import {SCThingsField} from '../../../meta';
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter'; import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
@@ -29,6 +29,24 @@ export interface SCGeoFilter extends SCSearchAbstractFilter<SCGeoFilterArguments
type: 'geo'; type: 'geo';
} }
/**
* A rectangular geo shape, representing the top-left and bottom-right corners
*
* This is an extension of the Geojson type
* http://geojson.org/geojson-spec.html
*/
export interface Envelope {
/**
* The top-left and bottom-right corners of the bounding box
*/
coordinates: [Position, Position];
/**
* The type of the geometry
*/
type: 'envelope';
}
/** /**
* Arguments for filter instruction by geo data * Arguments for filter instruction by geo data
*/ */
@@ -41,7 +59,7 @@ export interface SCGeoFilterArguments extends SCSearchAbstractFilterArguments {
/** /**
* Geo data to check up on * Geo data to check up on
*/ */
shape: Polygon; shape: Polygon | Envelope;
/** /**
* Spatial relation between the provided shape and the shape of the field. * Spatial relation between the provided shape and the shape of the field.

View File

@@ -77,6 +77,13 @@ export class SCThingTranslator {
this.sourceCache = new LRUCache(cacheCapacity); this.sourceCache = new LRUCache(cacheCapacity);
this._language = language; this._language = language;
this.metaClasses = SCClasses; this.metaClasses = SCClasses;
// Initalize all meta classes once
if (typeof (this.metaClasses as any)[Object.keys(this.metaClasses)[0]] === 'function') {
for (const metaClass of Object.keys(this.metaClasses)) {
(this.metaClasses as any)[metaClass] = new (SCClasses as any)[metaClass]();
}
}
} }
/** /**
@@ -143,7 +150,7 @@ export class SCThingTranslator {
*/ */
private getMetaClassInstance(thingType: SCThingType): any { private getMetaClassInstance(thingType: SCThingType): any {
if (thingType in this.metaClasses) { if (thingType in this.metaClasses) {
return new (this.metaClasses as any)[thingType](); return this.metaClasses[thingType];
} }
return undefined; return undefined;