Compare commits
131 Commits
Author | SHA1 | Date | |
---|---|---|---|
390ee5edb7 | |||
35341c49ab | |||
ba42658ee9 | |||
68687c2bca | |||
2b76f54408 | |||
64561ab878 | |||
8bb8574da7 | |||
6a5ecfcb19 | |||
9a1c79c5de | |||
1da9d73e5a | |||
75173b1b37 | |||
e826047b9c | |||
dd39b5d2ce | |||
ab24929c6c | |||
5da0b73a9d | |||
73e10fc59b | |||
a2e8b41042 | |||
a0ff9427cb | |||
e37485adbd | |||
e1592f322c | |||
6604a58885 | |||
312b6d0e67 | |||
3565360610 | |||
f71b131d8d | |||
a1638ff3fd | |||
6b56a605fa | |||
2042e3c08a | |||
ac15227a94 | |||
85adcbdba4 | |||
0ed11287eb | |||
6b88e2632c | |||
d017888b3c | |||
7ad6e75fb0 | |||
50f8dffe97 | |||
716228fcd3 | |||
a0c97dea45 | |||
784bc6d956 | |||
8aac756af2 | |||
63d4561980 | |||
8befdba50a | |||
24a0fb1a8a | |||
b4ac1242e4 | |||
fb26eec4c6 | |||
3912ed3167 | |||
0dd921675e | |||
343b81ac39 | |||
f848b2ae7c | |||
8558addaad | |||
99bcfcd44c | |||
78df7e07e0 | |||
a03b54e5a1 | |||
d27647009f | |||
fe2d5269c3 | |||
cc19c6c215 | |||
6e8c1f7aff | |||
63d1e0f65a | |||
f296ce24aa | |||
b38b691458 | |||
64d8a0b0f8 | |||
594c2cfe40 | |||
ac94cb1630 | |||
ddea031bbe | |||
6132076aed | |||
a5bd50850e | |||
8df838935c | |||
504dbdea1f | |||
c8d2095942 | |||
96f525ef0b | |||
7eb2ce7fe3 | |||
d67dc9ab44 | |||
c193fd4c59 | |||
65d87fdefb | |||
4a54935521 | |||
e10a45a4d0 | |||
074f6bfd1e | |||
6a1fafeab7 | |||
b019cf48b5 | |||
1db0a7adec | |||
1901c57a1d | |||
5723ddd059 | |||
5b67ad1c1c | |||
0044ab7b7e | |||
e40c6b60d1 | |||
af427347d9 | |||
952103c64e | |||
65ba20253c | |||
73e90165a4 | |||
bc16d5e8ea | |||
7bb964603c | |||
a8ee64eb54 | |||
f75d0f9378 | |||
e9293ec31e | |||
b04155e4f1 | |||
bc8534d382 | |||
a2a1d61671 | |||
a580ba53dd | |||
e194e2a3b6 | |||
0c2ded6288 | |||
6742e3ca73 | |||
e2deb4f7b3 | |||
0d48aa8b00 | |||
bfc646c308 | |||
ab008d16e8 | |||
7f5b86864d | |||
825148442b | |||
2a18ec1555 | |||
c5284ff813 | |||
498934237d | |||
ac73badd76 | |||
90698230ae | |||
04f37d5665 | |||
0f26791ee2 | |||
34e65462e2 | |||
f55ac65e20 | |||
474ce92b88 | |||
de95e03699 | |||
1e4adeede6 | |||
ca67505870 | |||
18eabb11af | |||
3572dc6574 | |||
0d815f0414 | |||
d6c361750d | |||
d877aed78b | |||
ac7848a462 | |||
76037fba47 | |||
36a7347a3d | |||
d748505b8a | |||
def1a8add3 | |||
1f75449985 | |||
d2380c2192 | |||
1e3fd5830d |
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,4 +1,22 @@
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
pages/
|
||||
public/
|
||||
node_modules/
|
||||
pages/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_web/
|
||||
dist_serve/
|
||||
dist_ts_web/
|
||||
|
||||
# custom
|
107
.gitlab-ci.yml
107
.gitlab-ci.yml
@ -1,59 +1,126 @@
|
||||
image: hosttoday/ht-docker-node:npmts
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- test
|
||||
- release
|
||||
- trigger
|
||||
- pages
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
testLEGACY:
|
||||
stage: test
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci test legacy
|
||||
- npmci git mirror
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
allow_failure: true
|
||||
- notpriv
|
||||
|
||||
testLTS:
|
||||
snyk:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test lts
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
|
||||
testSTABLE:
|
||||
- priv
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test stable
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci publish
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: trigger
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmpage
|
||||
stage: pages
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npmpage --host gitlab
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
allow_failure: true
|
||||
|
47
README.md
47
README.md
@ -1,47 +0,0 @@
|
||||
# tsclass
|
||||
common classes for TypeScript.
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/tsclass)
|
||||
[](https://gitlab.com/tsclass/tsclass)
|
||||
[](https://github.com/tsclass/tsclass)
|
||||
[](https://tsclass.gitlab.io/tsclass/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||
[](https://david-dm.org/tsclass/tsclass)
|
||||
[](https://www.bithound.io/github/tsclass/tsclass/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/tsclass/tsclass)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
tsclass exposes many commonly used objects as interface to implement (-> extends keyword) by individual implementations.
|
||||
They come complete with best in class intellisense and are easy to require.
|
||||
|
||||
```javascript
|
||||
import { IInvoice } from 'tsclass'
|
||||
|
||||
class myOwnInvoice implements IInvoice {
|
||||
constructor(){
|
||||
super() // you need to call super() in the constructor
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Time/Date
|
||||
* Date
|
||||
* Time
|
||||
|
||||
### Publications/Websites/Blogs
|
||||
* Article
|
||||
* Author
|
||||
|
||||
### Finance
|
||||
* Invoice
|
||||
|
||||
|
||||
> The modules in bold letters exist as own modules and can be used seperately
|
19
dist/article.d.ts
vendored
19
dist/article.d.ts
vendored
@ -1,19 +0,0 @@
|
||||
import { IAuthor } from './author';
|
||||
export interface IArticle {
|
||||
/**
|
||||
* the title of an article
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* the Author of an article
|
||||
*/
|
||||
author: IAuthor;
|
||||
/**
|
||||
* the content of an article
|
||||
*/
|
||||
content: string;
|
||||
/**
|
||||
* the tags of an article
|
||||
*/
|
||||
tags: string[];
|
||||
}
|
2
dist/article.js
vendored
2
dist/article.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJ0aWNsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2FydGljbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
20
dist/author.d.ts
vendored
20
dist/author.d.ts
vendored
@ -1,20 +0,0 @@
|
||||
import { IDate } from './date';
|
||||
import { IArticle } from './article';
|
||||
export interface IAuthor {
|
||||
/**
|
||||
* the first name of an author
|
||||
*/
|
||||
firstName: string;
|
||||
/**
|
||||
* the surname of an author
|
||||
*/
|
||||
surName: string;
|
||||
/**
|
||||
* the birthday of an author
|
||||
*/
|
||||
birthday: IDate;
|
||||
/**
|
||||
* articles of an author
|
||||
*/
|
||||
articles: IArticle[];
|
||||
}
|
2
dist/author.js
vendored
2
dist/author.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvYXV0aG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
5
dist/date.d.ts
vendored
5
dist/date.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export interface IDate {
|
||||
day: number;
|
||||
month: number;
|
||||
year: number;
|
||||
}
|
2
dist/date.js
vendored
2
dist/date.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2RhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
5
dist/index.d.ts
vendored
5
dist/index.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export * from './article';
|
||||
export * from './author';
|
||||
export * from './date';
|
||||
export * from './invoice';
|
||||
export * from './time';
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
2
dist/invoice.d.ts
vendored
2
dist/invoice.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export interface IInvoice {
|
||||
}
|
2
dist/invoice.js
vendored
2
dist/invoice.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52b2ljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2ludm9pY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
2
dist/time.d.ts
vendored
2
dist/time.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export interface ITime {
|
||||
}
|
2
dist/time.js
vendored
2
dist/time.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3RpbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
16
npmextra.json
Normal file
16
npmextra.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "tsclass",
|
||||
"gitrepo": "tsclass",
|
||||
"shortDescription": "common classes for TypeScript",
|
||||
"npmPackagename": "@tsclass/tsclass",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
3372
package-lock.json
generated
Normal file
3372
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
30
package.json
30
package.json
@ -1,11 +1,13 @@
|
||||
{
|
||||
"name": "tsclass",
|
||||
"version": "1.0.4",
|
||||
"name": "@tsclass/tsclass",
|
||||
"version": "3.0.4",
|
||||
"private": false,
|
||||
"description": "common classes for TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
"test": "tstest test/",
|
||||
"build": "tsbuild"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -21,7 +23,25 @@
|
||||
"url": "https://github.com/tsclass/tsclass/issues"
|
||||
},
|
||||
"homepage": "https://github.com/tsclass/tsclass#readme",
|
||||
"dependencies": {
|
||||
"@pushrocks/tapbundle": "^3.0.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npmts": "^5.1.5"
|
||||
}
|
||||
"@gitzone/tsbuild": "^2.1.17",
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@gitzone/tstest": "^1.0.27",
|
||||
"tslint": "^5.20.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_web/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
}
|
||||
|
62
readme.md
Normal file
62
readme.md
Normal file
@ -0,0 +1,62 @@
|
||||
# @tsclass/tsclass
|
||||
common classes for TypeScript
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@tsclass/tsclass)
|
||||
* [gitlab.com (source)](https://gitlab.com/tsclass/tsclass)
|
||||
* [github.com (source mirror)](https://github.com/tsclass/tsclass)
|
||||
* [docs (typedoc)](https://tsclass.gitlab.io/tsclass/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||
[](https://www.npmjs.com/package/@tsclass/tsclass)
|
||||
[](https://snyk.io/test/npm/@tsclass/tsclass)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
tsclass exposes many commonly used objects as interface to implement (-> extends keyword) by individual implementations.
|
||||
They come complete with best in class intellisense and are easy to require.
|
||||
|
||||
```javascript
|
||||
import { IInvoice } from 'tsclass';
|
||||
|
||||
class myOwnInvoice implements IInvoice {
|
||||
constructor() {
|
||||
super(); // you need to call super() in the constructor
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Time/Date
|
||||
|
||||
- Date
|
||||
- Time
|
||||
|
||||
### Publications/Websites/Blogs
|
||||
|
||||
- Article
|
||||
- Author
|
||||
|
||||
### Finance
|
||||
|
||||
- Invoice
|
||||
|
||||
> The modules in bold letters exist as own modules and can be used seperately
|
||||
|
||||
|
||||
## Contribution
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
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.business.IContact;
|
||||
});
|
||||
|
||||
tap.start();
|
@ -1,23 +0,0 @@
|
||||
import { IAuthor } from './author'
|
||||
|
||||
export interface IArticle {
|
||||
/**
|
||||
* the title of an article
|
||||
*/
|
||||
title: string
|
||||
|
||||
/**
|
||||
* the Author of an article
|
||||
*/
|
||||
author: IAuthor
|
||||
|
||||
/**
|
||||
* the content of an article
|
||||
*/
|
||||
content: string
|
||||
|
||||
/**
|
||||
* the tags of an article
|
||||
*/
|
||||
tags: string[]
|
||||
}
|
25
ts/author.ts
25
ts/author.ts
@ -1,25 +0,0 @@
|
||||
import { IDate } from './date'
|
||||
import { IArticle } from './article'
|
||||
|
||||
export interface IAuthor {
|
||||
|
||||
/**
|
||||
* the first name of an author
|
||||
*/
|
||||
firstName: string
|
||||
|
||||
/**
|
||||
* the surname of an author
|
||||
*/
|
||||
surName: string
|
||||
|
||||
/**
|
||||
* the birthday of an author
|
||||
*/
|
||||
birthday: IDate
|
||||
|
||||
/**
|
||||
* articles of an author
|
||||
*/
|
||||
articles: IArticle[]
|
||||
}
|
8
ts/business/address.ts
Normal file
8
ts/business/address.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export interface IAddress {
|
||||
name?: string;
|
||||
streetName: string;
|
||||
houseNumber: string;
|
||||
postalCode: string;
|
||||
city: string;
|
||||
country: string;
|
||||
}
|
17
ts/business/company.ts
Normal file
17
ts/business/company.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { business, general } from '..';
|
||||
|
||||
/**
|
||||
* describes a company's lifecycle state
|
||||
*/
|
||||
export type TCompanyStatus = 'planed' | 'founding' | 'active' | 'liquidation' | 'closed';
|
||||
|
||||
/**
|
||||
* describes a company
|
||||
*/
|
||||
export interface ICompany {
|
||||
name: string;
|
||||
foundedDate: general.IDate;
|
||||
closedDate: general.IDate;
|
||||
status: business.TCompanyStatus;
|
||||
contact: business.IContact;
|
||||
}
|
32
ts/business/contact.ts
Normal file
32
ts/business/contact.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import { business } from '..';
|
||||
|
||||
export type TContactSalutation = 'Mr' | 'Ms' | 'Mrs';
|
||||
|
||||
export type TContactType = 'person' | 'company';
|
||||
|
||||
export type TContactTitle = 'Doctor' | 'Professor';
|
||||
|
||||
export interface IContact {
|
||||
// =======
|
||||
// general
|
||||
// =======
|
||||
salutation?: TContactSalutation;
|
||||
type: TContactType;
|
||||
title?: TContactTitle;
|
||||
name: string;
|
||||
surname?: string;
|
||||
legalEntity?: string;
|
||||
address: business.IAddress;
|
||||
description: string;
|
||||
customerNumber?: string;
|
||||
|
||||
email?: string;
|
||||
phone?: string;
|
||||
fax?: string;
|
||||
|
||||
// =========
|
||||
// financial
|
||||
// =========
|
||||
vatId?: string;
|
||||
bankAccountNumber?: string;
|
||||
}
|
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';
|
||||
}
|
23
ts/content/article.ts
Normal file
23
ts/content/article.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { content } from '..';
|
||||
|
||||
export interface IArticle {
|
||||
/**
|
||||
* the title of an article
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* the Author of an article
|
||||
*/
|
||||
author: content.IAuthor;
|
||||
|
||||
/**
|
||||
* the content of an article
|
||||
*/
|
||||
content: string;
|
||||
|
||||
/**
|
||||
* the tags of an article
|
||||
*/
|
||||
tags: string[];
|
||||
}
|
23
ts/content/author.ts
Normal file
23
ts/content/author.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { general, content } from '..';
|
||||
|
||||
export interface IAuthor {
|
||||
/**
|
||||
* the first name of an author
|
||||
*/
|
||||
firstName: string;
|
||||
|
||||
/**
|
||||
* the surname of an author
|
||||
*/
|
||||
surName: string;
|
||||
|
||||
/**
|
||||
* the birthday of an author
|
||||
*/
|
||||
birthday: general.IDate;
|
||||
|
||||
/**
|
||||
* articles of an author
|
||||
*/
|
||||
articles: content.IArticle[];
|
||||
}
|
2
ts/content/index.ts
Normal file
2
ts/content/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './article';
|
||||
export * from './author';
|
@ -1,5 +0,0 @@
|
||||
export interface IDate {
|
||||
day: number
|
||||
month: number
|
||||
year: number
|
||||
}
|
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 {}
|
7
ts/finance/checkingaccount.ts
Normal file
7
ts/finance/checkingaccount.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { finance } from '../';
|
||||
|
||||
export interface ICheckingAccount {
|
||||
name: string;
|
||||
currency: finance.TCurrency;
|
||||
transactions: finance.ITransaction[];
|
||||
}
|
172
ts/finance/currency.ts
Normal file
172
ts/finance/currency.ts
Normal file
@ -0,0 +1,172 @@
|
||||
export type TCurrency =
|
||||
| 'AED'
|
||||
| 'AFN'
|
||||
| 'ALL'
|
||||
| 'AMD'
|
||||
| 'ANG'
|
||||
| 'AOA'
|
||||
| 'ARS'
|
||||
| 'AUD'
|
||||
| 'AWG'
|
||||
| 'AZN'
|
||||
| 'BAM'
|
||||
| 'BBD'
|
||||
| 'BDT'
|
||||
| 'BGN'
|
||||
| 'BHD'
|
||||
| 'BIF'
|
||||
| 'BMD'
|
||||
| 'BND'
|
||||
| 'BOB'
|
||||
| 'BRL'
|
||||
| 'BSD'
|
||||
| 'BTC'
|
||||
| 'BTN'
|
||||
| 'BWP'
|
||||
| 'BYR'
|
||||
| 'BZD'
|
||||
| 'CAD'
|
||||
| 'CDF'
|
||||
| 'CHF'
|
||||
| 'CLF'
|
||||
| 'CLP'
|
||||
| 'CNY'
|
||||
| 'COP'
|
||||
| 'CRC'
|
||||
| 'CUC'
|
||||
| 'CUP'
|
||||
| 'CVE'
|
||||
| 'CZK'
|
||||
| 'DJF'
|
||||
| 'DKK'
|
||||
| 'DOP'
|
||||
| 'DZD'
|
||||
| 'EEK'
|
||||
| 'EGP'
|
||||
| 'ERN'
|
||||
| 'ETB'
|
||||
| 'EUR'
|
||||
| 'FJD'
|
||||
| 'FKP'
|
||||
| 'GBP'
|
||||
| 'GEL'
|
||||
| 'GGP'
|
||||
| 'GHS'
|
||||
| 'GIP'
|
||||
| 'GMD'
|
||||
| 'GNF'
|
||||
| 'GTQ'
|
||||
| 'GYD'
|
||||
| 'HKD'
|
||||
| 'HNL'
|
||||
| 'HRK'
|
||||
| 'HTG'
|
||||
| 'HUF'
|
||||
| 'IDR'
|
||||
| 'ILS'
|
||||
| 'IMP'
|
||||
| 'INR'
|
||||
| 'IQD'
|
||||
| 'IRR'
|
||||
| 'ISK'
|
||||
| 'JEP'
|
||||
| 'JMD'
|
||||
| 'JOD'
|
||||
| 'JPY'
|
||||
| 'KES'
|
||||
| 'KGS'
|
||||
| 'KHR'
|
||||
| 'KMF'
|
||||
| 'KPW'
|
||||
| 'KRW'
|
||||
| 'KWD'
|
||||
| 'KYD'
|
||||
| 'KZT'
|
||||
| 'LAK'
|
||||
| 'LBP'
|
||||
| 'LKR'
|
||||
| 'LRD'
|
||||
| 'LSL'
|
||||
| 'LTL'
|
||||
| 'LVL'
|
||||
| 'LYD'
|
||||
| 'MAD'
|
||||
| 'MDL'
|
||||
| 'MGA'
|
||||
| 'MKD'
|
||||
| 'MMK'
|
||||
| 'MNT'
|
||||
| 'MOP'
|
||||
| 'MRO'
|
||||
| 'MTL'
|
||||
| 'MUR'
|
||||
| 'MVR'
|
||||
| 'MWK'
|
||||
| 'MXN'
|
||||
| 'MYR'
|
||||
| 'MZN'
|
||||
| 'NAD'
|
||||
| 'NGN'
|
||||
| 'NIO'
|
||||
| 'NOK'
|
||||
| 'NPR'
|
||||
| 'NZD'
|
||||
| 'OMR'
|
||||
| 'PAB'
|
||||
| 'PEN'
|
||||
| 'PGK'
|
||||
| 'PHP'
|
||||
| 'PKR'
|
||||
| 'PLN'
|
||||
| 'PYG'
|
||||
| 'QAR'
|
||||
| 'RON'
|
||||
| 'RSD'
|
||||
| 'RUB'
|
||||
| 'RWF'
|
||||
| 'SAR'
|
||||
| 'SBD'
|
||||
| 'SCR'
|
||||
| 'SDG'
|
||||
| 'SEK'
|
||||
| 'SGD'
|
||||
| 'SHP'
|
||||
| 'SLL'
|
||||
| 'SOS'
|
||||
| 'SRD'
|
||||
| 'STD'
|
||||
| 'SVC'
|
||||
| 'SYP'
|
||||
| 'SZL'
|
||||
| 'THB'
|
||||
| 'TJS'
|
||||
| 'TMT'
|
||||
| 'TND'
|
||||
| 'TOP'
|
||||
| 'TRY'
|
||||
| 'TTD'
|
||||
| 'TWD'
|
||||
| 'TZS'
|
||||
| 'UAH'
|
||||
| 'UGX'
|
||||
| 'USD'
|
||||
| 'UYU'
|
||||
| 'UZS'
|
||||
| 'VEF'
|
||||
| 'VND'
|
||||
| 'VUV'
|
||||
| 'WST'
|
||||
| 'XAF'
|
||||
| 'XAG'
|
||||
| 'XAU'
|
||||
| 'XCD'
|
||||
| 'XDR'
|
||||
| 'XOF'
|
||||
| 'XPD'
|
||||
| 'XPF'
|
||||
| 'XPT'
|
||||
| 'YER'
|
||||
| 'ZAR'
|
||||
| 'ZMK'
|
||||
| 'ZMW'
|
||||
| 'ZWL';
|
17
ts/finance/expense.ts
Normal file
17
ts/finance/expense.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { business } from '../';
|
||||
|
||||
export interface IExpenseItem {
|
||||
description: string;
|
||||
asset?: boolean;
|
||||
accountingType?: any;
|
||||
amount: number;
|
||||
taxPercentage: number;
|
||||
}
|
||||
|
||||
export interface IVoucher {
|
||||
voucherFile?: any;
|
||||
date: Date;
|
||||
description: string;
|
||||
expenseItems: IExpenseItem[];
|
||||
contactRef: business.IContact;
|
||||
}
|
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';
|
17
ts/finance/invoice.ts
Normal file
17
ts/finance/invoice.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { business } from '..';
|
||||
|
||||
export type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
|
||||
|
||||
export interface IInvoiceItem {
|
||||
name: string;
|
||||
unitType: string;
|
||||
quantity: number;
|
||||
vatPercentage: number;
|
||||
}
|
||||
|
||||
export interface IInvoice {
|
||||
billedBy: business.IContact;
|
||||
billedTo: business.IContact;
|
||||
status: TInvoiceStatus;
|
||||
items: IInvoiceItem[];
|
||||
}
|
8
ts/finance/transaction.ts
Normal file
8
ts/finance/transaction.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export interface ITransaction {
|
||||
id?: string;
|
||||
accountId?: string;
|
||||
amount: number;
|
||||
date: Date;
|
||||
description: string;
|
||||
name: string;
|
||||
}
|
5
ts/general/date.ts
Normal file
5
ts/general/date.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export interface IDate {
|
||||
day: number;
|
||||
month: number;
|
||||
year: number;
|
||||
}
|
2
ts/general/index.ts
Normal file
2
ts/general/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './date';
|
||||
export * from './time';
|
1
ts/general/time.ts
Normal file
1
ts/general/time.ts
Normal file
@ -0,0 +1 @@
|
||||
export interface ITime {}
|
21
ts/index.ts
21
ts/index.ts
@ -1,5 +1,16 @@
|
||||
export * from './article'
|
||||
export * from './author'
|
||||
export * from './date'
|
||||
export * from './invoice'
|
||||
export * from './time'
|
||||
// Business
|
||||
import * as business from './business';
|
||||
|
||||
// Finance
|
||||
import * as finance from './finance';
|
||||
|
||||
// Content
|
||||
import * as content from './content';
|
||||
|
||||
// General
|
||||
import * as general from './general';
|
||||
|
||||
// Network
|
||||
import * as network from './network';
|
||||
|
||||
export { business, finance, content, general, network };
|
||||
|
@ -1,3 +0,0 @@
|
||||
export interface IInvoice {
|
||||
|
||||
}
|
9
ts/network/cert.ts
Normal file
9
ts/network/cert.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export interface ICert {
|
||||
id: string;
|
||||
domainName: string;
|
||||
created: number;
|
||||
validUntil: number;
|
||||
privateKey: string;
|
||||
publicKey: string;
|
||||
csr: string;
|
||||
}
|
1
ts/network/dns.ts
Normal file
1
ts/network/dns.ts
Normal file
@ -0,0 +1 @@
|
||||
export type TDnsRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';
|
4
ts/network/dnschallenge.ts
Normal file
4
ts/network/dnschallenge.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface IDnsChallenge {
|
||||
hostName: string;
|
||||
challenge: string;
|
||||
}
|
5
ts/network/index.ts
Normal file
5
ts/network/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './cert';
|
||||
export * from './dns';
|
||||
export * from './dnschallenge';
|
||||
export * from './networknode';
|
||||
export * from './reverseproxy';
|
6
ts/network/networknode.ts
Normal file
6
ts/network/networknode.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export interface INetworkNode {
|
||||
name: string;
|
||||
ipv4: string;
|
||||
ipv6: string;
|
||||
securityLevel: 'private' | 'public' | 'confidential';
|
||||
}
|
12
ts/network/reverseproxy.ts
Normal file
12
ts/network/reverseproxy.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export interface IReverseProxyConfig {
|
||||
destinationIp: string;
|
||||
destinationPort: string;
|
||||
hostName: string;
|
||||
privateKey: string;
|
||||
publicKey: string;
|
||||
authentication?: {
|
||||
type: 'Basic';
|
||||
user: string;
|
||||
pass: string;
|
||||
};
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
export interface ITime {
|
||||
|
||||
}
|
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