fix(core): update

This commit is contained in:
Philipp Kunz 2020-10-17 16:38:22 +00:00
parent 00964a7db1
commit 115d461d29
6 changed files with 720 additions and 791 deletions

View File

@ -19,23 +19,35 @@ mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
audit:
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
- npmci command npm audit --audit-level=high --only=dev
tags:
- lossless
- docker
- notpriv
allow_failure: true
# ====================
# test stage
@ -50,9 +62,7 @@ testStable:
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- priv
testBuild:
stage: test
@ -63,9 +73,7 @@ testBuild:
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
@ -85,6 +93,8 @@ release:
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare

View File

@ -15,7 +15,7 @@
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm"]
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}

1414
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,15 +13,19 @@
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.44",
"@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.11.1",
"@types/node": "^14.11.10",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@pushrocks/smartpromise": "^3.0.6",
"idb": "^5.0.6"
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"@pushrocks/lik": "^4.0.17",
"@pushrocks/smartjson": "^4.0.5",
"@pushrocks/smartpromise": "^3.1.3",
"@pushrocks/smartrx": "^2.0.19",
"idb": "^5.0.7"
},
"browserslist": [
"last 1 chrome versions"
@ -38,4 +42,4 @@
"npmextra.json",
"readme.md"
]
}
}

View File

@ -0,0 +1,43 @@
import { WebStore } from './webstore.classes.webstore';
import * as plugins from './webstore.plugins';
/**
* a cache that can be used to store and retrieve typedrequests
*/
export class TypedrequestCache {
private webstore = new WebStore<plugins.typedrequestInterfaces.ITypedRequest>({
dbName: 'trStore',
storeName: 'trStore',
});
private buildKey(requestArg: plugins.typedrequestInterfaces.ITypedRequest) {
return plugins.smartjson.stringify({
method: requestArg.method,
request: requestArg.request,
});
}
/**
* stores by request
* @param typedrequestarg
*/
public async setByRequest(
typedrequestArg: plugins.typedrequestInterfaces.ITypedRequest
): Promise<void> {
if (!typedrequestArg.response) {
throw new Error('You cannot store requests without a response present');
}
await this.webstore.set(this.buildKey(typedrequestArg), typedrequestArg);
}
/**
* get by full tyoedrequest by partial typedrequest
* @param typedrequestarg
*/
public async getByRequest(
typedrequestArg: plugins.typedrequestInterfaces.ITypedRequest
): Promise<plugins.typedrequestInterfaces.ITypedRequest> {
const result = await this.webstore.get(this.buildKey(typedrequestArg));
return result;
}
}

View File

@ -1,9 +1,15 @@
// pushrocks scope
import * as lik from '@pushrocks/lik';
import * as smartjson from '@pushrocks/smartjson';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrx from '@pushrocks/smartrx';
export {
smartpromise
};
export { lik, smartjson, smartpromise, smartrx };
// apiglobal scope
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
export { typedrequestInterfaces };
// thirdparty scope
import * as idb from 'idb';