Compare commits

...

16 Commits

Author SHA1 Message Date
e2deb4f7b3 1.0.19 2018-06-09 15:11:38 +02:00
0d48aa8b00 BREAKING CHANGE(scope): change cope 2018-06-09 15:11:37 +02:00
bfc646c308 1.0.18 2017-11-09 12:41:51 +01:00
ab008d16e8 break out address from contact 2017-11-09 12:41:49 +01:00
7f5b86864d 1.0.17 2017-11-09 12:13:29 +01:00
825148442b update Invoice interface 2017-11-09 12:13:27 +01:00
2a18ec1555 1.0.16 2017-11-09 02:20:25 +01:00
c5284ff813 update internal structure 2017-11-09 02:20:21 +01:00
498934237d 1.0.15 2017-11-09 02:17:00 +01:00
ac73badd76 update ci 2017-11-09 02:16:56 +01:00
90698230ae 1.0.14 2017-11-09 02:06:12 +01:00
04f37d5665 update ci 2017-11-09 02:06:08 +01:00
0f26791ee2 1.0.13 2017-11-09 01:46:49 +01:00
34e65462e2 start invoice interface 2017-11-09 01:46:45 +01:00
f55ac65e20 1.0.12 2017-06-11 20:57:32 +02:00
474ce92b88 update structure 2017-06-11 20:57:30 +02:00
24 changed files with 234 additions and 74 deletions

View File

@ -3,66 +3,125 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
- npmci test legacy
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--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:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci command yarn global add npmpage
- npmci command npm install -g npmpage
- npmci command npmpage
tags:
- docker
- notpriv
only:
- tags
artifacts:

View File

@ -1,13 +1,16 @@
# tsclass
common classes for TypeScript
## Availabililty
[![npm](https://tsclass.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tsclass)
[![git](https://tsclass.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/tsclass/tsclass)
[![git](https://tsclass.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/tsclass/tsclass)
[![docs](https://tsclass.gitlab.io/assets/repo-button-docs.svg)](https://tsclass.gitlab.io/tsclass/)
## Status for master
[![build status](https://GitLab.com/tsclass/tsclass/badges/master/build.svg)](https://GitLab.com/tsclass/tsclass/commits/master)
[![coverage report](https://GitLab.com/tsclass/tsclass/badges/master/coverage.svg)](https://GitLab.com/tsclass/tsclass/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/tsclass.svg)](https://www.npmjs.com/package/tsclass)
@ -19,39 +22,41 @@ common classes for TypeScript
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## 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'
import { IInvoice } from 'tsclass';
class myOwnInvoice implements IInvoice {
constructor(){
super() // you need to call super() in the constructor
}
constructor() {
super(); // you need to call super() in the constructor
}
}
```
### Time/Date
* Date
* Time
- Date
- Time
### Publications/Websites/Blogs
* Article
* Author
- Article
- Author
### Finance
* Invoice
- Invoice
> 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.
> 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.html)
[![repo-footer](https://tsclass.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

8
dist/business/address.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
export interface IAddress {
name?: string;
streetName: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
}

3
dist/business/address.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2J1c2luZXNzL2FkZHJlc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

13
dist/business/contact.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import { IAddress } from '../index';
export declare type TContactSalutation = 'Mr' | 'Ms' | 'Mrs';
export declare type TContactType = 'person' | 'company';
export declare type TContactTitle = 'Doctor' | 'Professor';
export interface IContact {
salutation?: TContactSalutation;
type: TContactType;
title: TContactTitle;
name: string;
address: IAddress;
vatId?: string;
accountNumber?: string;
}

3
dist/business/contact.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2J1c2luZXNzL2NvbnRhY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

View File

@ -1,2 +1,14 @@
export interface IInvoice {
import { IContact } from '../index';
export declare type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
export interface IInvoiceItem {
name: string;
unitType: string;
quantity: number;
vatPercentage: number;
}
export interface IInvoice {
billedBy: IContact;
billedTo: IContact;
status: TInvoiceStatus;
items: IInvoiceItem[];
}

1
dist/cloud/dns.d.ts vendored
View File

@ -0,0 +1 @@
export declare type TDnsRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';

2
dist/cloud/dns.js vendored
View File

@ -1 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvY2xvdWQvZG5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==

7
dist/index.d.ts vendored
View File

@ -1,6 +1,9 @@
export * from './business/address';
export * from './business/company';
export * from './business/contact';
export * from './business/invoice';
export * from './cloud/dns';
export * from './content/article';
export * from './content/author';
export * from './business/company';
export * from './general/date';
export * from './business/invoice';
export * from './general/time';

View File

@ -1,7 +1,8 @@
{
"npmci": {
"globalNpmTools": [
"npmGlobalTools": [
"npmts"
]
],
"npmAccessLevel": "public"
}
}

5
package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "tsclass",
"version": "1.0.19",
"lockfileVersion": 1
}

View File

@ -1,11 +1,13 @@
{
"name": "tsclass",
"version": "1.0.11",
"version": "1.0.19",
"private": false,
"description": "common classes for TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts --notest)"
"test": "(npmts --notest)",
"build": "echo \"Not needed for now\""
},
"repository": {
"type": "git",
@ -20,5 +22,6 @@
"bugs": {
"url": "https://github.com/tsclass/tsclass/issues"
},
"homepage": "https://github.com/tsclass/tsclass#readme"
"homepage": "https://github.com/tsclass/tsclass#readme",
"dependencies": {}
}

8
ts/business/address.ts Normal file
View File

@ -0,0 +1,8 @@
export interface IAddress {
name?: string;
streetName: string;
houseNumber: string;
postalCode: string;
city: string;
country: string;
}

View File

@ -1,16 +1,17 @@
import { IDate } from '../index'
import { IContact } from '../index';
import { IDate } from '../index';
/**
* describes a company's lifecycle state
*/
export type TCompanyStatus = 'planed' | 'founding' | 'active' | 'liquidation' | 'closed'
export type TCompanyStatus = 'planed' | 'founding' | 'active' | 'liquidation' | 'closed';
/**
* describes a company
*/
export interface ICompany {
name: string
foundedDate: IDate
closedDate: IDate
status: TCompanyStatus
name: string;
foundedDate: IDate;
closedDate: IDate;
status: TCompanyStatus;
}

24
ts/business/contact.ts Normal file
View File

@ -0,0 +1,24 @@
import { IAddress } from '../index';
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;
address: IAddress;
// =========
// financial
// =========
vatId?: string;
accountNumber?: string;
}

View File

@ -1,3 +1,17 @@
export interface IInvoice {
import { IContact } from '../index';
export type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
export interface IInvoiceItem {
name: string;
unitType: string;
quantity: number;
vatPercentage: number;
}
export interface IInvoice {
billedBy: IContact;
billedTo: IContact;
status: TInvoiceStatus;
items: IInvoiceItem[];
}

View File

@ -1 +1 @@
export type TRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF'
export type TDnsRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';

View File

@ -1,23 +1,23 @@
import { IAuthor } from '../index'
import { IAuthor } from '../index';
export interface IArticle {
/**
* the title of an article
*/
title: string
title: string;
/**
* the Author of an article
*/
author: IAuthor
author: IAuthor;
/**
* the content of an article
*/
content: string
content: string;
/**
* the tags of an article
*/
tags: string[]
tags: string[];
}

View File

@ -1,25 +1,24 @@
import { IDate } from '../index'
import { IArticle } from '../index'
import { IDate } from '../index';
import { IArticle } from '../index';
export interface IAuthor {
/**
* the first name of an author
*/
firstName: string
firstName: string;
/**
* the surname of an author
*/
surName: string
surName: string;
/**
* the birthday of an author
*/
birthday: IDate
birthday: IDate;
/**
* articles of an author
*/
articles: IArticle[]
articles: IArticle[];
}

View File

@ -1,5 +1,5 @@
export interface IDate {
day: number
month: number
year: number
day: number;
month: number;
year: number;
}

View File

@ -1,3 +1 @@
export interface ITime {
}
export interface ITime {}

View File

@ -1,14 +1,16 @@
// Business
export * from './business/company'
export * from './business/invoice'
export * from './business/address';
export * from './business/company';
export * from './business/contact';
export * from './business/invoice';
// Cloud
export * from './cloud/dns'
export * from './cloud/dns';
// Content
export * from './content/article'
export * from './content/author'
export * from './content/article';
export * from './content/author';
// General
export * from './general/date'
export * from './general/time'
export * from './general/date';
export * from './general/time';

View File

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1