Compare commits

..

10 Commits

Author SHA1 Message Date
56331fe4ff feat: backend index diffing 2024-07-22 11:21:05 +00:00
Jovan Krunić
c9e881582f refactor: set production version of the backend 2024-07-19 15:20:06 +02:00
Jovan Krunić
df681de083 feat: show title if available on library account profile
Closes #215
2024-07-19 15:20:06 +02:00
802a7a3fa7 fix: docs generation 2024-07-19 15:20:06 +02:00
Jovan Krunić
343d03e647 feat: library account adjustments
Closes #214
2024-07-19 15:20:06 +02:00
727b92911e fix: list item layout broken 2024-07-19 15:20:06 +02:00
11bc987807 fix: elasticsearch integration spams errors 2024-07-19 15:20:06 +02:00
Rainer Killinger
b8faae5988 docs: update changelogs for release
ci: publish release
2024-06-28 17:39:39 +02:00
67ab1fd613 fix: geo.point has wrong mapping 2024-06-28 17:25:32 +02:00
Rainer Killinger
142079bf0e refactor: set app backend to dev version 2024-06-28 12:02:59 +02:00
37 changed files with 285 additions and 137 deletions

View File

@@ -0,0 +1,5 @@
---
"@openstapps/easy-ast": patch
---
Fixed docs generation

View File

@@ -1,5 +1,11 @@
# @openstapps/backend # @openstapps/backend
## 3.3.1
### Patch Changes
- 67ab1fd6: fix for geo.point mapping
## 3.3.0 ## 3.3.0
### Minor Changes ### Minor Changes

View File

@@ -1,7 +1,7 @@
{ {
"name": "@openstapps/backend", "name": "@openstapps/backend",
"description": "A reference implementation for a StApps backend", "description": "A reference implementation for a StApps backend",
"version": "3.3.0", "version": "3.3.1",
"private": true, "private": true,
"type": "module", "type": "module",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
@@ -106,6 +106,9 @@
"entry": [ "entry": [
"src/cli.ts" "src/cli.ts"
], ],
"loader": {
".groovy": "text"
},
"sourcemap": true, "sourcemap": true,
"clean": true, "clean": true,
"target": "es2022", "target": "es2022",

View File

@@ -0,0 +1,65 @@
void traverse(def a, def b, ArrayList path, HashMap result) {
if (a instanceof Map && b instanceof Map) {
for (key in a.keySet()) {
path.add(key);
traverse(a.get(key), b.get(key), path, result);
path.remove(path.size() - 1);
}
} else if (a instanceof List && b instanceof List) {
int la = a.size();
int lb = b.size();
int max = la > lb ? la : lb;
for (int i = 0; i < max; i++) {
path.add(i);
if (i < la && i < lb) {
traverse(a[i], b[i], path, result);
} else if (i >= la) {
result.added.add(path.toArray());
} else {
result.removed.add(path.toArray());
}
path.remove(path.size() - 1);
}
} else if (a == null && b != null) {
result.removed.add(path.toArray());
} else if (a != null && b == null) {
result.added.add(path.toArray());
} else if (!a.equals(b)) {
result.changed.add(path.toArray());
}
}
def to;
def from;
for (state in states) {
if (state.index.equals(params.newIndex)) {
to = state.doc;
} else {
from = state.doc;
}
}
HashMap result = [
'added': [],
'removed': [],
'changed': []
];
traverse(to, from, new ArrayList(), result);
if (to == null && from != null) {
result.status = 'removed';
} else if (to != null && from == null) {
result.status = 'added';
} else if (
result.added.size() == 0 &&
result.removed.size() == 0 &&
result.changed.size() == 0
) {
result.status = 'unchanged';
} else {
result.status = 'changed';
}
return result;

View File

@@ -47,6 +47,7 @@ import {
import {noUndefined} from './util/no-undefined.js'; import {noUndefined} from './util/no-undefined.js';
import {retryCatch, RetryOptions} from './util/retry.js'; import {retryCatch, RetryOptions} from './util/retry.js';
import {Feature, Point, Polygon} from 'geojson'; import {Feature, Point, Polygon} from 'geojson';
import indexDiffScript from './diff-index.groovy';
/** /**
* A database interface for elasticsearch * A database interface for elasticsearch
@@ -239,6 +240,42 @@ export class Elasticsearch implements Database {
.then(it => Object.entries(it).map(([name]) => name)) .then(it => Object.entries(it).map(([name]) => name))
.catch(() => [] as string[]); .catch(() => [] as string[]);
if (activeIndices.length <= 1) {
const result = await this.client.transform.previewTransform({
source: {
index: [...activeIndices, index],
query: {match_all: {}},
},
dest: {index: 'compare'},
pivot: {
group_by: {
uid: {terms: {field: 'uid.raw'}},
},
aggregations: {
compare: {
scripted_metric: {
map_script: `
state.index = doc['_index'];
state.doc = params['_source'];`,
combine_script: `
state.index = state.index[0];
return state;
`,
reduce_script: {
source: indexDiffScript,
params: {
newIndex: index,
},
},
},
},
},
},
});
console.log(JSON.stringify(result.preview, null, 2))
}
await this.client.indices.updateAliases({ await this.client.indices.updateAliases({
actions: [ actions: [
{ {

View File

@@ -25,7 +25,7 @@ export function buildDistanceFilter(
): QueryDslSpecificQueryContainer<'geo_distance'> { ): QueryDslSpecificQueryContainer<'geo_distance'> {
const geoObject: QueryDslGeoDistanceQuery = { const geoObject: QueryDslGeoDistanceQuery = {
distance: `${filter.arguments.distance}m`, distance: `${filter.arguments.distance}m`,
[`${filter.arguments.field}.point.coordinates`]: { [`${filter.arguments.field}.point`]: {
lat: filter.arguments.position[1], lat: filter.arguments.position[1],
lon: filter.arguments.position[0], lon: filter.arguments.position[0],
}, },

View File

@@ -25,7 +25,7 @@ export function buildDistanceSort(sort: SCDistanceSort): SortOptions {
mode: 'avg', mode: 'avg',
order: sort.order, order: sort.order,
unit: 'm', unit: 'm',
[`${sort.arguments.field}.point.coordinates`]: { [`${sort.arguments.field}.point`]: {
lat: sort.arguments.position[1], lat: sort.arguments.position[1],
lon: sort.arguments.position[0], lon: sort.arguments.position[0],
}, },

View File

@@ -0,0 +1,26 @@
// initialize the sort value with the maximum
double price = Double.MAX_VALUE;
// if we have any offers
if (params._source.containsKey(params.field)) {
// iterate through all offers
for (offer in params._source[params.field]) {
// if this offer contains a role specific price
if (offer.containsKey('prices') && offer.prices.containsKey(params.universityRole)) {
// if the role specific price is smaller than the cheapest we found
if (offer.prices[params.universityRole] < price) {
// set the role specific price as cheapest for now
price = offer.prices[params.universityRole];
}
} else { // we have no role specific price for our role in this offer
// if the default price of this offer is lower than the cheapest we found
if (offer.price < price) {
// set this price as the cheapest
price = offer.price;
}
}
}
}
// return cheapest price for our role
return price;

View File

@@ -13,7 +13,8 @@
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {SortOptions} from '@elastic/elasticsearch/lib/api/types.js'; import {SortOptions} from '@elastic/elasticsearch/lib/api/types.js';
import {SCPriceSort, SCSportCoursePriceGroup, SCThingsField} from '@openstapps/core'; import {SCPriceSort} from '@openstapps/core';
import priceSortScript from './price-sort.groovy';
/** /**
* Converts a price sort to elasticsearch syntax * Converts a price sort to elasticsearch syntax
@@ -23,47 +24,11 @@ export function buildPriceSort(sort: SCPriceSort): SortOptions {
return { return {
_script: { _script: {
order: sort.order, order: sort.order,
script: buildPriceSortScript(sort.arguments.universityRole, sort.arguments.field), script: {
source: priceSortScript,
params: sort.arguments,
},
type: 'number' as const, type: 'number' as const,
}, },
}; };
} }
/**
* Provides a script for sorting search results by prices
* @param universityRole User group which consumes university services
* @param field Field in which wanted offers with prices are located
*/
export function buildPriceSortScript(
universityRole: keyof SCSportCoursePriceGroup,
field: SCThingsField,
): string {
return `
// initialize the sort value with the maximum
double price = Double.MAX_VALUE;
// if we have any offers
if (params._source.containsKey('${field}')) {
// iterate through all offers
for (offer in params._source.${field}) {
// if this offer contains a role specific price
if (offer.containsKey('prices') && offer.prices.containsKey('${universityRole}')) {
// if the role specific price is smaller than the cheapest we found
if (offer.prices.${universityRole} < price) {
// set the role specific price as cheapest for now
price = offer.prices.${universityRole};
}
} else { // we have no role specific price for our role in this offer
// if the default price of this offer is lower than the cheapest we found
if (offer.price < price) {
// set this price as the cheapest
price = offer.price;
}
}
}
}
// return cheapest price for our role
return price;
`;
}

6
backend/backend/src/types.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
declare module '*.groovy' {
const content: string;
export default content;
}
export {};

View File

@@ -466,7 +466,7 @@ describe('Query', function () {
const expectedFilter: QueryDslSpecificQueryContainer<'geo_distance'> = { const expectedFilter: QueryDslSpecificQueryContainer<'geo_distance'> = {
geo_distance: { geo_distance: {
'distance': '1000m', 'distance': '1000m',
'geo.point.coordinates': { 'geo.point': {
lat: 8.123, lat: 8.123,
lon: 50.123, lon: 50.123,
}, },
@@ -636,7 +636,7 @@ describe('Query', function () {
'mode': 'avg', 'mode': 'avg',
'order': 'desc', 'order': 'desc',
'unit': 'm', 'unit': 'm',
'geo.point.coordinates': { 'geo.point': {
lat: 50.123, lat: 50.123,
lon: 8.123, lon: 8.123,
}, },

0
examples/minimal-connector/app.js Normal file → Executable file
View File

View File

@@ -33,9 +33,9 @@ ion-item {
margin: var(--spacing-sm); margin: var(--spacing-sm);
ion-thumbnail { ion-thumbnail {
--ion-margin: var(--spacing-xs); --size: 36px;
margin-block: auto; margin: 0;
margin-inline: var(--spacing-md); margin-inline: var(--spacing-md);
padding: 0; padding: 0;
} }

View File

@@ -14,7 +14,7 @@
*/ */
import {Component, EventEmitter, Input, Output} from '@angular/core'; import {Component, EventEmitter, Input, Output} from '@angular/core';
import {DocumentAction, PAIADocument, PAIADocumentStatus} from '../../../types'; import {DocumentAction, PAIADocument, PAIADocumentStatus, PAIADocumentVisualStatus} from '../../../types';
import {LibraryAccountService} from '../../library-account.service'; import {LibraryAccountService} from '../../library-account.service';
@Component({ @Component({
@@ -27,12 +27,15 @@ export class PAIAItemComponent {
renewable: boolean; renewable: boolean;
visualStatus?: PAIADocumentVisualStatus;
constructor(private readonly libraryAccountService: LibraryAccountService) {} constructor(private readonly libraryAccountService: LibraryAccountService) {}
@Input() @Input()
set item(value: PAIADocument) { set item(value: PAIADocument) {
this._item = value; this._item = value;
void this.setRenewable(); void this.setRenewable();
this.visualStatus = this.getVisualStatus(Number(this.item.status));
} }
get item(): PAIADocument { get item(): PAIADocument {
@@ -56,4 +59,18 @@ export class PAIAItemComponent {
const isActive = await this.libraryAccountService.isActivePatron(); const isActive = await this.libraryAccountService.isActivePatron();
this.renewable = isActive && Number(this.item.status) === PAIADocumentStatus.Held; this.renewable = isActive && Number(this.item.status) === PAIADocumentStatus.Held;
} }
private getVisualStatus(status: PAIADocumentStatus): PAIADocumentVisualStatus | undefined {
switch (status) {
case PAIADocumentStatus.Ordered: {
return {color: 'warning', status: status, statusText: 'ordered'};
}
case PAIADocumentStatus.Provided: {
return {color: 'success', status: status, statusText: 'ready'};
}
default: {
return undefined;
}
}
}
} }

View File

@@ -14,10 +14,16 @@
--> -->
<ion-item> <ion-item>
<!-- TODO: text not selectable in Chrome, bugfix needed https://github.com/ionic-team/ionic-framework/issues/24956 -->
<ion-label class="ion-text-wrap"> <ion-label class="ion-text-wrap">
@if (item.about) { @if (item.about) {
<h2 class="name">{{ item.about }}</h2> <h2 class="name">
@if (visualStatus) {
<ion-badge [color]="visualStatus.color" slot="start">
{{ 'library.account.pages' + '.' + listName + '.' + visualStatus.statusText | translate }}
</ion-badge>
}
{{ item.about }}
</h2>
} }
@for (property of propertiesToShow; track property) { @for (property of propertiesToShow; track property) {
@if (item[property]) { @if (item[property]) {

View File

@@ -12,3 +12,6 @@
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
ion-badge {
vertical-align: bottom;
}

View File

@@ -35,23 +35,13 @@
@switch (activeSegment) { @switch (activeSegment) {
@case ('orders') { @case ('orders') {
@for (hold of paiaDocuments; track hold) { @for (hold of paiaDocuments; track hold) {
@if (toNumber(hold.status) === paiaDocumentStatus.Provided) { <stapps-paia-item
<stapps-paia-item [item]="hold"
[item]="hold" [propertiesToShow]="['label', 'storage']"
[propertiesToShow]="['label', 'storage']" (documentAction)="onDocumentAction($event)"
(documentAction)="onDocumentAction($event)" listName="holds"
listName="holds" >
> </stapps-paia-item>
</stapps-paia-item>
} @else {
<stapps-paia-item
[item]="hold"
[propertiesToShow]="['label']"
(documentAction)="onDocumentAction($event)"
listName="holds"
>
</stapps-paia-item>
}
} }
} }
@case ('reservations') { @case ('reservations') {

View File

@@ -25,8 +25,6 @@ import {PAIAPatron} from '../../types';
export class ProfilePageComponent { export class ProfilePageComponent {
patron?: PAIAPatron; patron?: PAIAPatron;
propertiesToShow: (keyof PAIAPatron)[] = ['id', 'name', 'email', 'address', 'expires'];
constructor(private readonly libraryAccountService: LibraryAccountService) {} constructor(private readonly libraryAccountService: LibraryAccountService) {}
async ionViewWillEnter(): Promise<void> { async ionViewWillEnter(): Promise<void> {

View File

@@ -26,27 +26,45 @@
<ion-card> <ion-card>
<ion-card-content> <ion-card-content>
<ion-grid> <ion-grid>
@for (property of propertiesToShow; track property) { <ion-row>
@if (patron[property]) { <ion-col> {{ 'library.account.pages.profile.labels.id' | translate }}: </ion-col>
<ion-row> <ion-col>
<ion-col> {{ patron.id }}
{{ 'library.account.pages.profile.labels' + '.' + property | translate }}: </ion-col>
</ion-col> </ion-row>
<ion-col> <ion-row>
@if (!['expires'].includes(property)) { <ion-col> {{ 'library.account.pages.profile.labels.name' | translate }}: </ion-col>
{{ patron[property] }} <ion-col> {{ patron.name_details?.title ?? '' }} {{ patron.name }} </ion-col>
} @else { </ion-row>
@if (isUnlimitedExpiry(patron['expires'])) { @if (patron.email) {
{{ 'library.account.pages.profile.values.unlimited' | translate }} <ion-row>
} @else { <ion-col> {{ 'library.account.pages.profile.labels.email' | translate }}: </ion-col>
{{ 'library.account.pages.profile.values.expires' | translate }}:&nbsp;{{ <ion-col>
patron['expires'] | amDateFormat: 'll' {{ patron.email }}
}} </ion-col>
} </ion-row>
} }
</ion-col> @if (patron.address) {
</ion-row> <ion-row>
} <ion-col> {{ 'library.account.pages.profile.labels.address' | translate }}: </ion-col>
<ion-col>
{{ patron.address }}
</ion-col>
</ion-row>
}
@if (patron.expires) {
<ion-row>
<ion-col> {{ 'library.account.pages.profile.labels.expires' | translate }}: </ion-col>
<ion-col>
@if (isUnlimitedExpiry(patron.expires)) {
{{ 'library.account.pages.profile.values.unlimited' | translate }}
} @else {
{{ 'library.account.pages.profile.values.expires' | translate }}:&nbsp;{{
patron.expires | amDateFormat: 'll'
}}
}
</ion-col>
</ion-row>
} }
</ion-grid> </ion-grid>
</ion-card-content> </ion-card-content>

View File

@@ -22,6 +22,13 @@ export interface PAIAPatron {
status?: PAIAPatronStatus; status?: PAIAPatronStatus;
type?: string; type?: string;
note?: string; note?: string;
// HeBIS specific property (not in PAIA documentation)
name_details?: {
firstname?: string;
lastname?: string;
gender?: string;
title?: string;
};
} }
export enum PAIAPatronStatus { export enum PAIAPatronStatus {
@@ -88,3 +95,9 @@ export interface DocumentAction {
action: 'cancel' | 'renew'; action: 'cancel' | 'renew';
doc: PAIADocument; doc: PAIADocument;
} }
export interface PAIADocumentVisualStatus {
color: 'warning' | 'success';
status: PAIADocumentStatus;
statusText: 'ordered' | 'ready';
}

View File

@@ -336,13 +336,15 @@
"title": "Titel", "title": "Titel",
"about": "Mehr Informationen", "about": "Mehr Informationen",
"label": "Signatur", "label": "Signatur",
"starttime": "Übermittelt am", "starttime": "Vorgemerkt am",
"endtime": "Abzuholen bis", "endtime": "Abzuholen bis",
"storage": "Abholtheke", "storage": "Abholtheke",
"queue": "Position in der Warteschlange" "queue": "Position in der Warteschlange"
}, },
"holds": "Bestellungen", "holds": "Bestellungen",
"reservations": "Vormerkungen" "reservations": "Vormerkungen",
"ordered": "Bestellt",
"ready": "Abholbereit"
}, },
"checked_out": { "checked_out": {
"title": "Deine Ausleihen", "title": "Deine Ausleihen",

View File

@@ -336,13 +336,15 @@
"title": "Title", "title": "Title",
"about": "More information", "about": "More information",
"label": "Shelfmark", "label": "Shelfmark",
"starttime": "Submitted at", "starttime": "Reserved on",
"endtime": "Available for pickup until", "endtime": "Available for pickup until",
"storage": "Pick-up counter", "storage": "Pickup counter",
"queue": "Position in the queue" "queue": "Position in the queue"
}, },
"holds": "orders", "holds": "orders",
"reservations": "reservations" "reservations": "reservations",
"ordered": "Ordered",
"ready": "Ready for pickup"
}, },
"checked_out": { "checked_out": {
"title": "checked out items", "title": "checked out items",

View File

@@ -13,6 +13,7 @@
"deploy": "dotenv -c -- turbo run deploy --concurrency=1", "deploy": "dotenv -c -- turbo run deploy --concurrency=1",
"dev": "dotenv -c -- turbo run dev", "dev": "dotenv -c -- turbo run dev",
"docs": "dotenv -c -- turbo run docs && typedoc && mkdir docs/api && cp packages/core/lib/api-doc.html docs/api/index.html && cp packages/core/lib/openapi.json docs/api/openapi.json && cp -r packages/core/lib/schema docs/api/schema", "docs": "dotenv -c -- turbo run docs && typedoc && mkdir docs/api && cp packages/core/lib/api-doc.html docs/api/index.html && cp packages/core/lib/openapi.json docs/api/openapi.json && cp -r packages/core/lib/schema docs/api/schema",
"docs:serve": "http-server docs -p 8080 -o",
"format": "dotenv -c -- turbo run format", "format": "dotenv -c -- turbo run format",
"format:fix": "dotenv -c -- turbo run format:fix", "format:fix": "dotenv -c -- turbo run format:fix",
"lint": "dotenv -c -- turbo run lint", "lint": "dotenv -c -- turbo run lint",
@@ -34,6 +35,7 @@
"deepmerge": "4.3.1", "deepmerge": "4.3.1",
"dotenv-cli": "7.2.1", "dotenv-cli": "7.2.1",
"glob": "10.3.10", "glob": "10.3.10",
"http-server": "14.1.1",
"junit-report-merger": "6.0.3", "junit-report-merger": "6.0.3",
"prettier": "3.1.1", "prettier": "3.1.1",
"syncpack": "12.3.0", "syncpack": "12.3.0",

View File

@@ -17,10 +17,8 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
import {LightweightDefinitionKind} from '../../src/index.js'; import {LightweightDefinitionKind} from '../../src/index.js';
import {TypeFlags} from 'typescript'; import {TypeFlags} from 'typescript';
// @ts-expect-error unused type
type TestTypeAlias = number | string; type TestTypeAlias = number | string;
// @ts-expect-error unused type
enum TestEnum { enum TestEnum {
Foo, Foo,
Bar, Bar,

View File

@@ -18,13 +18,9 @@ import {LightweightDefinitionKind} from '../../src/index.js';
interface Random {} interface Random {}
// @ts-expect-error unused type
type TestArrayGeneric = Array<string>; type TestArrayGeneric = Array<string>;
// @ts-expect-error unused type
type TestArrayLiteral = number[]; type TestArrayLiteral = number[];
// @ts-expect-error unused type
type TestArrayReferenceGeneric = Array<Random>; type TestArrayReferenceGeneric = Array<Random>;
// @ts-expect-error unused type
type TestArrayReferenceLiteral = Random[]; type TestArrayReferenceLiteral = Random[];
export const testConfig: EasyAstSpecType = { export const testConfig: EasyAstSpecType = {

View File

@@ -16,12 +16,10 @@
import {EasyAstSpecType} from '../easy-ast-spec-type.js'; import {EasyAstSpecType} from '../easy-ast-spec-type.js';
import {LightweightDefinitionKind} from '../../src/index.js'; import {LightweightDefinitionKind} from '../../src/index.js';
// @ts-expect-error unused type
interface TestInterface { interface TestInterface {
foo: number; foo: number;
} }
// @ts-expect-error unused type
class TestClass { class TestClass {
bar: string = 'test'; bar: string = 'test';
} }

View File

@@ -22,10 +22,8 @@ import {LightweightDefinitionKind} from '../../src/index.js';
* Class description * Class description
* *
* More description * More description
*
* @classTag classParameter1 classParameter2 * @classTag classParameter1 classParameter2
*/ */
// @ts-expect-error unused type
interface TestInterface { interface TestInterface {
/** /**
* Property comment * Property comment
@@ -33,7 +31,6 @@ interface TestInterface {
* Property description * Property description
* *
* More description * More description
*
* @propertyTag propertyParameter1 propertyParameter2 * @propertyTag propertyParameter1 propertyParameter2
*/ */
foo: string; foo: string;
@@ -45,10 +42,8 @@ interface TestInterface {
* Class description * Class description
* *
* More description * More description
*
* @classTag classParameter1 classParameter2 * @classTag classParameter1 classParameter2
*/ */
// @ts-expect-error unused type
class TestClass { class TestClass {
/** /**
* Property comment * Property comment
@@ -56,7 +51,6 @@ class TestClass {
* Property description * Property description
* *
* More description * More description
*
* @propertyTag propertyParameter1 propertyParameter2 * @propertyTag propertyParameter1 propertyParameter2
*/ */
foo = 1; foo = 1;
@@ -68,10 +62,8 @@ class TestClass {
* Enum description * Enum description
* *
* More description * More description
*
* @enumTag enumParameter1 * @enumTag enumParameter1
*/ */
// @ts-expect-error unused type
enum TestAlias {} enum TestAlias {}
export const testConfig: EasyAstSpecType = { export const testConfig: EasyAstSpecType = {

View File

@@ -20,7 +20,6 @@ interface Test1<T = number> {
foo: T; foo: T;
} }
// @ts-expect-error unused type
interface Test2 { interface Test2 {
bar: Test1; bar: Test1;
} }

View File

@@ -17,13 +17,11 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
import {LightweightDefinitionKind} from '../../src/index.js'; import {LightweightDefinitionKind} from '../../src/index.js';
import {TypeFlags} from 'typescript'; import {TypeFlags} from 'typescript';
// @ts-expect-error unused type
enum TestAuto { enum TestAuto {
Foo, Foo,
Bar, Bar,
} }
// @ts-expect-error unused type
enum TestSpecified { enum TestSpecified {
YES = 'yes', YES = 'yes',
NO = 'no', NO = 'no',

View File

@@ -18,7 +18,6 @@ import {LightweightDefinitionKind} from '../../src/index.js';
interface $Random {} interface $Random {}
// @ts-expect-error unused type
interface Generics { interface Generics {
baz: Foo<number, $Random>; baz: Foo<number, $Random>;
} }

View File

@@ -18,12 +18,10 @@ import {LightweightDefinitionKind} from '../../src/index.js';
interface $Random {} interface $Random {}
// @ts-expect-error unused
interface IndexSignatureObject { interface IndexSignatureObject {
[key: string]: $Random; [key: string]: $Random;
} }
// @ts-expect-error unused
interface IndexSignaturePrimitive { interface IndexSignaturePrimitive {
[key: string]: number; [key: string]: number;
} }

View File

@@ -26,7 +26,6 @@ interface $BaseInterface2 {
class $BaseClass {} class $BaseClass {}
// @ts-expect-error unused
class InheritingClass extends $BaseClass implements $BaseInterface<number>, $BaseInterface2 { class InheritingClass extends $BaseClass implements $BaseInterface<number>, $BaseInterface2 {
bar: string = ''; bar: string = '';

View File

@@ -16,7 +16,6 @@
import {EasyAstSpecType} from '../easy-ast-spec-type.js'; import {EasyAstSpecType} from '../easy-ast-spec-type.js';
import {LightweightDefinitionKind} from '../../src/index.js'; import {LightweightDefinitionKind} from '../../src/index.js';
// @ts-expect-error unused
interface NestedObject { interface NestedObject {
nested: { nested: {
deeplyNested: { deeplyNested: {

View File

@@ -17,7 +17,6 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
import {LightweightDefinitionKind} from '../../src/index.js'; import {LightweightDefinitionKind} from '../../src/index.js';
import {TypeFlags} from 'typescript'; import {TypeFlags} from 'typescript';
// @ts-expect-error unused
interface Test { interface Test {
number_type: number; number_type: number;
string_type: string; string_type: string;

View File

@@ -16,7 +16,6 @@
import {EasyAstSpecType} from '../easy-ast-spec-type.js'; import {EasyAstSpecType} from '../easy-ast-spec-type.js';
import {LightweightDefinitionKind} from '../../src/index.js'; import {LightweightDefinitionKind} from '../../src/index.js';
// @ts-expect-error unused
interface Foo<T extends Bar<string>> { interface Foo<T extends Bar<string>> {
bar: T; bar: T;
} }

View File

@@ -27,15 +27,7 @@ export const premaps: Record<string, MappingProperty> = {
type: 'geo_shape', type: 'geo_shape',
}, },
'Point': { 'Point': {
properties: { type: 'geo_point',
type: {
type: 'keyword',
},
coordinates: {
type: 'geo_point',
},
},
dynamic: 'strict',
}, },
'Polygon': { 'Polygon': {
type: 'geo_shape', type: 'geo_shape',

30
pnpm-lock.yaml generated
View File

@@ -26,6 +26,9 @@ importers:
glob: glob:
specifier: 10.3.10 specifier: 10.3.10
version: 10.3.10 version: 10.3.10
http-server:
specifier: 14.1.1
version: 14.1.1
junit-report-merger: junit-report-merger:
specifier: 6.0.3 specifier: 6.0.3
version: 6.0.3 version: 6.0.3
@@ -4659,22 +4662,23 @@ packages:
resolution: {integrity: sha512-0QZDBePnb5a+d76zjlMYq96IDf0AOuGP7JHugFUYlYwTC7rZvROuZSpoUsvpUjNH2CzMqWgNLIekIR6EHRMIQA==} resolution: {integrity: sha512-0QZDBePnb5a+d76zjlMYq96IDf0AOuGP7JHugFUYlYwTC7rZvROuZSpoUsvpUjNH2CzMqWgNLIekIR6EHRMIQA==}
engines: {node: '>=14'} engines: {node: '>=14'}
dependencies: dependencies:
'@elastic/transport': 8.3.2 '@elastic/transport': 8.7.0
tslib: 2.4.1 tslib: 2.4.1
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: false dev: false
/@elastic/transport@8.3.2: /@elastic/transport@8.7.0:
resolution: {integrity: sha512-ZiBYRVPj6pwYW99fueyNU4notDf7ZPs7Ix+4T1btIJsKJmeaORIItIfs+0O7KV4vV+DcvyMhkY1FXQx7kQOODw==} resolution: {integrity: sha512-IqXT7a8DZPJtqP2qmX1I2QKmxYyN27kvSW4g6pInESE1SuGwZDp2FxHJ6W2kwmYOJwQdAt+2aWwzXO5jHo9l4A==}
engines: {node: '>=14'} engines: {node: '>=18'}
dependencies: dependencies:
'@opentelemetry/api': 1.9.0
debug: 4.3.4(supports-color@8.1.1) debug: 4.3.4(supports-color@8.1.1)
hpagent: 1.2.0 hpagent: 1.2.0
ms: 2.1.3 ms: 2.1.3
secure-json-parse: 2.7.0 secure-json-parse: 2.7.0
tslib: 2.6.2 tslib: 2.6.2
undici: 5.22.1 undici: 6.19.2
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: false dev: false
@@ -6296,6 +6300,11 @@ packages:
- debug - debug
dev: false dev: false
/@opentelemetry/api@1.9.0:
resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==}
engines: {node: '>=8.0.0'}
dev: false
/@pkgjs/parseargs@0.11.0: /@pkgjs/parseargs@0.11.0:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'} engines: {node: '>=14'}
@@ -8564,6 +8573,7 @@ packages:
engines: {node: '>=10.16.0'} engines: {node: '>=10.16.0'}
dependencies: dependencies:
streamsearch: 1.1.0 streamsearch: 1.1.0
dev: true
/bytes@3.0.0: /bytes@3.0.0:
resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}
@@ -11744,6 +11754,7 @@ packages:
peerDependenciesMeta: peerDependenciesMeta:
debug: debug:
optional: true optional: true
dev: false
/follow-redirects@1.15.6: /follow-redirects@1.15.6:
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
@@ -12648,7 +12659,7 @@ packages:
engines: {node: '>=8.0.0'} engines: {node: '>=8.0.0'}
dependencies: dependencies:
eventemitter3: 4.0.7 eventemitter3: 4.0.7
follow-redirects: 1.15.3 follow-redirects: 1.15.6
requires-port: 1.0.0 requires-port: 1.0.0
transitivePeerDependencies: transitivePeerDependencies:
- debug - debug
@@ -18214,6 +18225,7 @@ packages:
/streamsearch@1.1.0: /streamsearch@1.1.0:
resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==}
engines: {node: '>=10.0.0'} engines: {node: '>=10.0.0'}
dev: true
/streamx@2.15.1: /streamx@2.15.1:
resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==} resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==}
@@ -19481,6 +19493,12 @@ packages:
engines: {node: '>=14.0'} engines: {node: '>=14.0'}
dependencies: dependencies:
busboy: 1.6.0 busboy: 1.6.0
dev: true
/undici@6.19.2:
resolution: {integrity: sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==}
engines: {node: '>=18.17'}
dev: false
/undici@6.7.1: /undici@6.7.1:
resolution: {integrity: sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==} resolution: {integrity: sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==}