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

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "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": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.44", "@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.11.1", "@types/node": "^14.11.10",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartpromise": "^3.0.6", "@apiglobal/typedrequest-interfaces": "^1.0.15",
"idb": "^5.0.6" "@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": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
@ -38,4 +42,4 @@
"npmextra.json", "npmextra.json",
"readme.md" "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 // pushrocks scope
import * as lik from '@pushrocks/lik';
import * as smartjson from '@pushrocks/smartjson';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrx from '@pushrocks/smartrx';
export { export { lik, smartjson, smartpromise, smartrx };
smartpromise
}; // apiglobal scope
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
export { typedrequestInterfaces };
// thirdparty scope // thirdparty scope
import * as idb from 'idb'; import * as idb from 'idb';