- add iso19139 metadata schema for oai interface

- modified licence file
- npm updates
This commit is contained in:
Arno Kaimbacher 2022-11-16 13:30:56 +01:00
parent b754f02210
commit 15f3572ef9
14 changed files with 2283 additions and 624 deletions

View file

@ -36,7 +36,7 @@ export default class ResumptionToken {
//#region properties
get Key(): string{
get Key(): string {
return this.MetadataPrefix + this.StartPosition + this.TotalIds;
}

View file

@ -15,7 +15,7 @@ export default class TokenWorker {
private cache: RedisClientType;
private ttl: number;
private url: string;
private connected: boolean = false;
private connected = false;
constructor(ttl: number) {
// if (resPath) {
@ -23,7 +23,7 @@ export default class TokenWorker {
// }
// [1] define ttl and create redis connection
this.ttl = ttl;
this.url = process.env.REDIS_URL || "redis://127.0.0.1:6379";
this.url = process.env.REDIS_URL || "redis://127.0.0.1:6379";
// this.cache.on("connect", () => {
// console.log(`Redis connection established`);
@ -66,7 +66,7 @@ export default class TokenWorker {
const result = await this.cache.get(key);
return result !== undefined && result !== null;
}
public async set(token: ResumptionToken) {
let fc = 0;
const uniqueId = dayjs().unix().toString(); // 1548381600;
@ -122,17 +122,17 @@ export default class TokenWorker {
this.connected = false;
}
private checksum(str: string, algorithm?: string, encoding?: string): string {
private checksum(str: string, algorithm?: string): string {
/**
* @type {BinaryToTextEncoding}
*/
const ENCODING_OUT = "hex"; // Initializer type string is not assignable to variable type BinaryToTextEncoding
return crypto
.createHash(algorithm || 'md5')
.update(str, 'utf8')
.digest(ENCODING_OUT)
}
.createHash(algorithm || "md5")
.update(str, "utf8")
.digest(ENCODING_OUT);
}
/**
* Set resumption path where the resumption token files are stored.