Compare commits

...

19 Commits

Author SHA1 Message Date
Rainer Killinger
d912c03eb0 0.65.0 2022-04-04 20:47:19 +02:00
Rainer Killinger
a638f5447b refactor: update dependencies 2022-04-04 20:42:01 +02:00
Rainer Killinger
cecf95aa46 docs: update changelog 2022-03-21 11:05:27 +01:00
Rainer Killinger
6fd8c5adf3 0.64.0 2022-03-21 11:05:25 +01:00
Rainer Killinger
db24b41d99 test: adjust HDS samples to production version 2022-03-21 11:00:11 +01:00
Rainer Killinger
b1fcd22ab2 refactor: update dependencies 2022-03-17 12:44:59 +01:00
Rainer Killinger
268588fb6f docs: update changelog 2022-01-24 14:47:04 +01:00
Rainer Killinger
d3048a12d8 0.63.0 2022-01-24 14:47:02 +01:00
Rainer Killinger
e14993114f fix: add auth object to index route 2022-01-24 14:45:17 +01:00
Rainer Killinger
4237f6ad60 docs: update changelog 2022-01-21 17:15:16 +01:00
Rainer Killinger
e7c1000bc4 0.62.0 2022-01-21 17:15:14 +01:00
Rainer Killinger
e0adb2332e fix: add missing lastPublished to SCCreativeWork 2022-01-21 17:14:16 +01:00
Rainer Killinger
e5696b23e7 docs: update changelog 2022-01-21 15:07:16 +01:00
Rainer Killinger
659d0974f7 0.61.0 2022-01-21 15:07:14 +01:00
Rainer Killinger
e8304eeeb4 refactor: remove unused auth provider properties 2022-01-21 15:06:11 +01:00
Rainer Killinger
dca9d26c66 docs: update changelog 2022-01-21 12:29:55 +01:00
Rainer Killinger
852e0f5373 0.60.0 2022-01-21 12:29:52 +01:00
Rainer Killinger
26dd531d24 refactor: split up SCUserConfiguration type 2022-01-21 12:22:13 +01:00
Rainer Killinger
52bdf93356 docs: update changelog 2022-01-20 14:20:17 +01:00
15 changed files with 500 additions and 401 deletions

View File

@@ -1,3 +1,37 @@
# [0.64.0](https://gitlab.com/openstapps/core/compare/v0.63.0...v0.64.0) (2022-03-21)
# [0.63.0](https://gitlab.com/openstapps/core/compare/v0.62.0...v0.63.0) (2022-01-24)
### Bug Fixes
* add auth object to index route ([e149931](https://gitlab.com/openstapps/core/commit/e14993114f0ec370775010eee4ad0d302a0beebb))
# [0.62.0](https://gitlab.com/openstapps/core/compare/v0.61.0...v0.62.0) (2022-01-21)
### Bug Fixes
* add missing lastPublished to SCCreativeWork ([e0adb23](https://gitlab.com/openstapps/core/commit/e0adb2332ec24ce388c4c008b51b7aa941948532))
# [0.61.0](https://gitlab.com/openstapps/core/compare/v0.60.0...v0.61.0) (2022-01-21)
# [0.60.0](https://gitlab.com/openstapps/core/compare/v0.59.0...v0.60.0) (2022-01-21)
# [0.59.0](https://gitlab.com/openstapps/core/compare/v0.58.0...v0.59.0) (2022-01-20)
# [0.58.0](https://gitlab.com/openstapps/core/compare/v0.57.0...v0.58.0) (2022-01-18)

737
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/core",
"version": "0.59.0",
"version": "0.65.0",
"description": "StAppsCore - Generalized model of data",
"keywords": [
"Model",
@@ -45,16 +45,16 @@
"Wieland Schöbl"
],
"dependencies": {
"@openstapps/core-tools": "0.28.0",
"@openstapps/core-tools": "0.30.0",
"@types/geojson": "1.0.6",
"@types/json-patch": "0.0.30",
"@types/json-schema": "7.0.9",
"@types/json-schema": "7.0.11",
"@types/node": "14.18.3",
"fast-clone": "1.5.13",
"fast-deep-equal": "3.1.3",
"http-status-codes": "2.2.0",
"json-patch": "0.7.0",
"json-schema": "0.4.0",
"rfdc": "1.3.0",
"ts-optchain": "0.1.8"
},
"devDependencies": {
@@ -63,21 +63,21 @@
"@openstapps/logger": "0.8.0",
"@testdeck/mocha": "0.2.0",
"@types/chai": "4.3.0",
"@types/lodash": "4.14.178",
"@types/mocha": "9.0.0",
"@types/lodash": "4.14.181",
"@types/mocha": "9.1.0",
"@types/rimraf": "3.0.2",
"chai": "4.3.4",
"chai": "4.3.6",
"conditional-type-checks": "1.0.5",
"conventional-changelog-cli": "2.2.2",
"lodash": "4.17.21",
"mocha": "9.1.4",
"mocha": "9.2.2",
"nyc": "15.1.0",
"rimraf": "3.0.2",
"source-map-support": "0.5.21",
"surge": "0.23.1",
"ts-node": "10.4.0",
"ts-node": "10.7.0",
"tslint": "6.1.3",
"typedoc": "0.21.6",
"typedoc": "0.22.13",
"typescript": "4.3.5"
},
"nyc": {

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCUserConfiguration} from './user';
import {SCUserConfigurationMap} from './user';
/**
* Supported authorization provider types
@@ -47,16 +47,6 @@ export interface SCAuthorizationProviderClient {
*/
clientId: string;
/**
* Authorization provider requires PKCE
*/
pkce: boolean;
/**
* Redirct URL for after finishing authentication
*/
redirect: string;
/**
* Scopes to request
*/
@@ -87,7 +77,7 @@ export interface SCAuthorizationProviderEndpoints {
*
* @see https://www.npmjs.com/package/jsonpath
*/
mapping: { [key in keyof SCUserConfiguration]: string; };
mapping: SCUserConfigurationMap;
/**
* URL to revoke a token

View File

@@ -13,42 +13,50 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCAcademicPriceGroup} from '../things/abstract/thing-that-can-be-offered';
/**
* User configuration keys mapped to string type while including their requiredness
*/
export type SCUserConfigurationMap = { [K in keyof SCUserConfigurationOptional]?: string } & { [K in keyof SCUserConfigurationRequired]: string };
/**
* A user configuration
*/
export interface SCUserConfiguration {
/**
* User's e-mail
*/
email?: string;
/**
* User's family name
*/
familyName?: string;
/**
* User's given name
*/
givenName?: string;
export type SCUserConfiguration = SCUserConfigurationRequired & SCUserConfigurationOptional;
/**
* A user configurations required properties
*/
interface SCUserConfigurationRequired {
/**
* ID given to the user
*/
id: string;
/**
* The complete name of the user combining all the parts of the name into one
*/
name: string;
}
/**
* A user configurations optional properties
*/
interface SCUserConfigurationOptional {
/**
* User's e-mail
*/
email?: string;
/**
* User's family name
*/
familyName?: string;
/**
* User's given name
*/
givenName?: string;
/**
* Role assigned to the user
*/
role: keyof SCAcademicPriceGroup;
role?: string;
/**
* Student ID given to the user
*/

View File

@@ -14,6 +14,7 @@
*/
import {StatusCodes} from 'http-status-codes';
import {SCAppConfiguration} from '../../config/app';
import {SCAuthorizationProvider, SCAuthorizationProviderType} from '../../config/authorization';
import {SCBackendConfiguration} from '../../config/backend';
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
@@ -42,6 +43,11 @@ export interface SCIndexResponse {
*/
app: SCAppConfiguration;
/**
* @see SCAuthorizationProvider
*/
auth: { [key in SCAuthorizationProviderType]?: SCAuthorizationProvider; };
/**
* @see SCBackendConfiguration
*/

View File

@@ -71,6 +71,13 @@ export interface SCCreativeWorkWithoutReferences
*/
keywords?: string[];
/**
* Date (in text form) the creative work was most recently
*
* @keyword
*/
lastPublished?: string;
/**
* Translated fields of the creative work
*/

View File

@@ -12,8 +12,8 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import clone = require('fast-clone');
import equal = require('fast-deep-equal/es6');
import clone = require('rfdc');
import {Defined, TSOCType} from 'ts-optchain';
import {SCLanguageCode} from './general/i18n';
import {isThing} from './guards';
@@ -234,7 +234,7 @@ export class SCThingTranslator {
return cachedInstance as T;
}
}
const translatedInstance = this.translateThingInPlaceDestructively(clone(thing));
const translatedInstance = this.translateThingInPlaceDestructively(clone()(thing));
delete translatedInstance.translations;
this.cache.putObject(translatedInstance);
this.sourceCache.putObject(thing);
@@ -267,7 +267,7 @@ export class SCThingTranslator {
return this.deeptranslate((objTranslatedFromCache as any)[key]);
}
}
const objTranslated = this.translateThingInPlaceDestructively(clone(obj));
const objTranslated = this.translateThingInPlaceDestructively(clone()(obj));
this.cache.putObject(objTranslated);
this.sourceCache.putObject(thing);

View File

@@ -16,13 +16,13 @@
}
],
"firstPublished": "2008",
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB198305427",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB198305427",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB198305427",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
},
"isPartOf": {
"uid": "bc5e5399-a24c-5c01-9c1b-0c8b83272087",

View File

@@ -16,13 +16,13 @@
}
],
"firstPublished": "2002",
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB107025590",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB107025590",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB107025590",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
},
"isPartOf": {
"uid": "f84c1851-042e-542f-ba7a-158b32dfb82f",

View File

@@ -16,6 +16,7 @@
}
],
"firstPublished": "[ca. 1991]",
"lastPublished": "2000 Q1",
"publications": [
{
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
@@ -27,13 +28,13 @@
"name": "VDI"
}
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB022992618",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB022992618",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB022992618",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCBook"

View File

@@ -27,7 +27,7 @@
"name": "Belles Lettres"
}
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB102248788",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB102248788",
"ISBNs": [
"2251760385"
],
@@ -36,7 +36,7 @@
"name": "HeBIS HDS",
"originalId": "HEB102248788",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCBook"

View File

@@ -22,13 +22,13 @@
"ISSNs": [
"0024-6085"
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB046847146",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB046847146",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB046847146",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCPeriodical"

View File

@@ -19,13 +19,13 @@
"name": "Frankfurter Allg. Zeitung"
}
],
"sameAs": "https://hds2test.hebis.de/ubffm/Record/HEB048624853",
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB048624853",
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "HeBIS HDS",
"originalId": "HEB048624853",
"type": "remote",
"url": "https://hds2.hebis.de/ubffm/"
"url": "https://ubffm.hds.hebis.de"
}
},
"schema": "SCPeriodical"

View File

@@ -13,7 +13,7 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {expect} from 'chai';
import clone = require('fast-clone');
import clone from 'rfdc';
import {slow, suite, test, timeout} from '@testdeck/mocha';
import {SCThingOriginType, SCThingType, SCThingRemoteOrigin} from '../src/things/abstract/thing';
import {SCBuildingWithoutReferences} from '../src/things/building';
@@ -264,7 +264,7 @@ export class TranslationSpecInplace {
@test
public reaccessWithChangedSourceOmitsLRUCache() {
const translatorDE = new SCThingTranslator('de');
const dishCopy = clone(dish);
const dishCopy = clone()(dish);
const translatedDish = translatorDE.translatedAccess(dish);
const distructivelyTranslatedDish = translatorDE.translate(dish);
@@ -330,7 +330,7 @@ export class MetaTranslationSpec {
@test
public thingWithoutMetaClass() {
const dishCopy = clone(dish);
const dishCopy = clone()(dish);
const typeNonExistant = eval("(x) => x + 'typeNonExistant';");
// this will assign a non existant SCThingType to dishCopy
dishCopy.type = typeNonExistant();