Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
a2e8b41042 | |||
a0ff9427cb | |||
e37485adbd | |||
e1592f322c | |||
6604a58885 | |||
312b6d0e67 | |||
3565360610 | |||
f71b131d8d | |||
a1638ff3fd | |||
6b56a605fa | |||
2042e3c08a | |||
ac15227a94 | |||
85adcbdba4 | |||
0ed11287eb | |||
6b88e2632c | |||
d017888b3c | |||
7ad6e75fb0 | |||
50f8dffe97 | |||
716228fcd3 | |||
a0c97dea45 | |||
784bc6d956 | |||
8aac756af2 | |||
63d4561980 | |||
8befdba50a |
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,4 +1,22 @@
|
|||||||
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
pages/
|
|
||||||
public/
|
public/
|
||||||
node_modules/
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
|
# custom
|
@ -1,5 +1,5 @@
|
|||||||
# gitzone standard
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
@ -26,6 +26,7 @@ mirror:
|
|||||||
snyk:
|
snyk:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
- npmci command npm install -g snyk
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command snyk test
|
||||||
@ -36,38 +37,29 @@ snyk:
|
|||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install lts
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
testSTABLE:
|
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
testBuild:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
@ -86,19 +78,12 @@ release:
|
|||||||
# ====================
|
# ====================
|
||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
script:
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
- npmci command npm install -g tslint typescript
|
||||||
- docker run
|
- npmci npm prepare
|
||||||
--env SOURCE_CODE="$PWD"
|
- npmci npm install
|
||||||
--volume "$PWD":/code
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
|
||||||
artifacts:
|
|
||||||
paths: [codeclimate.json]
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- priv
|
- priv
|
||||||
@ -114,12 +99,15 @@ trigger:
|
|||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-dbase:npmci
|
||||||
|
services:
|
||||||
|
- docker:stable-dind
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g typedoc typescript
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
@ -130,13 +118,3 @@ pages:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
windowsCompatibility:
|
|
||||||
image: stefanscherer/node-windows:10-build-tools
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npm install & npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- windows
|
|
||||||
allow_failure: true
|
|
||||||
|
37
README.md
37
README.md
@ -1,25 +1,20 @@
|
|||||||
# tsclass
|
# @tsclass/tsclass
|
||||||
|
|
||||||
common classes for TypeScript
|
common classes for TypeScript
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@tsclass/tsclass)
|
||||||
[](https://www.npmjs.com/package/tsclass)
|
* [gitlab.com (source)](https://gitlab.com/tsclass/tsclass)
|
||||||
[](https://GitLab.com/tsclass/tsclass)
|
* [github.com (source mirror)](https://github.com/tsclass/tsclass)
|
||||||
[](https://github.com/tsclass/tsclass)
|
* [docs (typedoc)](https://tsclass.gitlab.io/tsclass/)
|
||||||
[](https://tsclass.gitlab.io/tsclass/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||||
[](https://GitLab.com/tsclass/tsclass/commits/master)
|
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||||
[](https://GitLab.com/tsclass/tsclass/commits/master)
|
[](https://www.npmjs.com/package/@tsclass/tsclass)
|
||||||
[](https://www.npmjs.com/package/tsclass)
|
[](https://snyk.io/test/npm/@tsclass/tsclass)
|
||||||
[](https://david-dm.org/tsclass/tsclass)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/tsclass/tsclass/master/dependencies/npm)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/tsclass/tsclass)
|
[](https://prettier.io/)
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -54,9 +49,9 @@ class myOwnInvoice implements IInvoice {
|
|||||||
|
|
||||||
> The modules in bold letters exist as own modules and can be used seperately
|
> The modules in bold letters exist as own modules and can be used seperately
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[](https://push.rocks)
|
[](https://maintainedby.lossless.com)
|
||||||
|
@ -2,5 +2,15 @@
|
|||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "tsclass",
|
||||||
|
"gitrepo": "tsclass",
|
||||||
|
"shortDescription": "common classes for TypeScript",
|
||||||
|
"npmPackagename": "@tsclass/tsclass",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
3223
package-lock.json
generated
3223
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@tsclass/tsclass",
|
"name": "@tsclass/tsclass",
|
||||||
"version": "1.0.49",
|
"version": "2.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "common classes for TypeScript",
|
"description": "common classes for TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "tsrun test/test.ts",
|
"test": "tstest test/",
|
||||||
"build": "tsbuild"
|
"build": "tsbuild"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -23,9 +23,25 @@
|
|||||||
"url": "https://github.com/tsclass/tsclass/issues"
|
"url": "https://github.com/tsclass/tsclass/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/tsclass/tsclass#readme",
|
"homepage": "https://github.com/tsclass/tsclass#readme",
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"@pushrocks/tapbundle": "^3.0.13"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.21",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@gitzone/tsrun": "^1.1.9"
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
}
|
"@gitzone/tstest": "^1.0.26",
|
||||||
|
"tslint": "^5.19.0",
|
||||||
|
"tslint-config-prettier": "^1.18.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/*",
|
||||||
|
"ts_web/*",
|
||||||
|
"dist/*",
|
||||||
|
"dist_web/*",
|
||||||
|
"dist_ts_web/*",
|
||||||
|
"assets/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
9
test/test.node.ts
Normal file
9
test/test.node.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { tap, expect } from '@pushrocks/tapbundle';
|
||||||
|
|
||||||
|
import * as tsclass from '../ts/index';
|
||||||
|
|
||||||
|
tap.test('should assign a correct type', async () => {
|
||||||
|
let contact: tsclass.IContact;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
@ -1,3 +0,0 @@
|
|||||||
import * as tsclass from '../ts/index';
|
|
||||||
|
|
||||||
let contact: tsclass.IContact;
|
|
@ -14,4 +14,5 @@ export interface ICompany {
|
|||||||
foundedDate: IDate;
|
foundedDate: IDate;
|
||||||
closedDate: IDate;
|
closedDate: IDate;
|
||||||
status: TCompanyStatus;
|
status: TCompanyStatus;
|
||||||
|
contact: IContact;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ export interface IContact {
|
|||||||
|
|
||||||
email?: string;
|
email?: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
fax?: string;
|
||||||
|
|
||||||
// =========
|
// =========
|
||||||
// financial
|
// financial
|
||||||
|
4
ts/business/index.ts
Normal file
4
ts/business/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from './address';
|
||||||
|
export * from './company';
|
||||||
|
export * from './contact';
|
||||||
|
export * from './person';
|
6
ts/business/person.ts
Normal file
6
ts/business/person.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface IPerson {
|
||||||
|
title: string;
|
||||||
|
name: string;
|
||||||
|
surname: string;
|
||||||
|
sex: 'male' | 'female' | 'queer';
|
||||||
|
}
|
2
ts/content/index.ts
Normal file
2
ts/content/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './article';
|
||||||
|
export * from './author';
|
10
ts/events/contractevent.ts
Normal file
10
ts/events/contractevent.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* a constract event describes any kind of sale
|
||||||
|
*/
|
||||||
|
export interface IEvent_Contract {
|
||||||
|
contractId: string;
|
||||||
|
date: number;
|
||||||
|
enddate: number;
|
||||||
|
product: string;
|
||||||
|
type: 'single purchase' | 'subscription' | 'canceled';
|
||||||
|
}
|
6
ts/events/index.ts
Normal file
6
ts/events/index.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export * from './contractevent';
|
||||||
|
export * from './moneyevent';
|
||||||
|
export * from './releaseevent';
|
||||||
|
export * from './requestevent';
|
||||||
|
export * from './sessionevent';
|
||||||
|
export * from './userevent';
|
6
ts/events/moneyevent.ts
Normal file
6
ts/events/moneyevent.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface IEvent_Money {
|
||||||
|
transferId: string;
|
||||||
|
valueInEuro: number;
|
||||||
|
channel: 'sepa' | 'creditcard' | 'paypal' | 'cardano';
|
||||||
|
direction: 'internal' | 'outgoing' | 'incoming';
|
||||||
|
}
|
6
ts/events/releaseevent.ts
Normal file
6
ts/events/releaseevent.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface IEvent_Release {
|
||||||
|
releaseType: 'Apple App Store' | 'Google Play' | 'npm package' | 'dockerimage';
|
||||||
|
dockerImageUrl: string;
|
||||||
|
npmPackageUrl: string;
|
||||||
|
appleAppStoreIdentifier: string;
|
||||||
|
}
|
5
ts/events/requestevent.ts
Normal file
5
ts/events/requestevent.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface IEvent_Request {
|
||||||
|
httpMethod: string;
|
||||||
|
httpRoute: string;
|
||||||
|
durationToResponse: number;
|
||||||
|
}
|
4
ts/events/sessionevent.ts
Normal file
4
ts/events/sessionevent.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface IEvent_Session {
|
||||||
|
userID: string;
|
||||||
|
sessionType: 'new' | 'reactivated';
|
||||||
|
}
|
1
ts/events/userevent.ts
Normal file
1
ts/events/userevent.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export interface IEvent_User {}
|
@ -2,18 +2,17 @@ import { IInvoice } from './invoice';
|
|||||||
import { IContact } from '../business/contact';
|
import { IContact } from '../business/contact';
|
||||||
|
|
||||||
export interface IExpenseItem {
|
export interface IExpenseItem {
|
||||||
description: string,
|
description: string;
|
||||||
asset?: boolean,
|
asset?: boolean;
|
||||||
accountingType?: string,
|
accountingType?: any;
|
||||||
amount: number;
|
amount: number;
|
||||||
taxPercentage: number;
|
taxPercentage: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IExpense {
|
export interface IVoucher {
|
||||||
voucherFile?: any;
|
voucherFile?: any;
|
||||||
date: Date;
|
date: Date;
|
||||||
description: string;
|
description: string;
|
||||||
expenseItems: IExpenseItem[];
|
expenseItems: IExpenseItem[];
|
||||||
contactRef: IContact;
|
contactRef: IContact;
|
||||||
accountRef: string;
|
|
||||||
}
|
}
|
||||||
|
5
ts/finance/index.ts
Normal file
5
ts/finance/index.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export * from './checkingaccount';
|
||||||
|
export * from './currency';
|
||||||
|
export * from './expense';
|
||||||
|
export * from './invoice';
|
||||||
|
export * from './transaction';
|
@ -1,7 +1,8 @@
|
|||||||
export interface ITransaction {
|
export interface ITransaction {
|
||||||
id?: string;
|
id?: string;
|
||||||
accountId?: string;
|
accountId?: string;
|
||||||
description: string;
|
|
||||||
amount: number;
|
amount: number;
|
||||||
date: Date;
|
date: Date;
|
||||||
|
description: string;
|
||||||
|
name: string;
|
||||||
}
|
}
|
||||||
|
2
ts/general/index.ts
Normal file
2
ts/general/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './date';
|
||||||
|
export * from './time';
|
29
ts/index.ts
29
ts/index.ts
@ -1,22 +1,21 @@
|
|||||||
// Business
|
// Business
|
||||||
export * from './business/address';
|
import * as business from './business';
|
||||||
export * from './business/company';
|
export * from './business';
|
||||||
export * from './business/contact';
|
|
||||||
|
|
||||||
// Finance
|
// Finance
|
||||||
export * from './finance/checkingaccount';
|
import * as finance from './finance';
|
||||||
export * from './finance/currency';
|
export * from './finance';
|
||||||
export * from './finance/expense';
|
|
||||||
export * from './finance/invoice';
|
|
||||||
export * from './finance/transaction';
|
|
||||||
|
|
||||||
// Cloud
|
|
||||||
export * from './cloud/dns';
|
|
||||||
|
|
||||||
// Content
|
// Content
|
||||||
export * from './content/article';
|
import * as content from './content';
|
||||||
export * from './content/author';
|
export * from './content';
|
||||||
|
|
||||||
// General
|
// General
|
||||||
export * from './general/date';
|
import * as general from './general';
|
||||||
export * from './general/time';
|
export * from './general';
|
||||||
|
|
||||||
|
// Network
|
||||||
|
import * as network from './network';
|
||||||
|
export * from './network';
|
||||||
|
|
||||||
|
export { business, finance, content, general, network };
|
||||||
|
2
ts/network/index.ts
Normal file
2
ts/network/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './reverseproxy';
|
||||||
|
export * from './dns';
|
7
ts/network/reverseproxy.ts
Normal file
7
ts/network/reverseproxy.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface IReverseProxyConfig {
|
||||||
|
destinationIp: string;
|
||||||
|
destinationPort: string;
|
||||||
|
hostName: string;
|
||||||
|
privateKey: string;
|
||||||
|
publicKey: string;
|
||||||
|
}
|
16
tslint.json
16
tslint.json
@ -1,3 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint-config-standard"
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
|
"rules": {
|
||||||
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user