Compare commits

...

64 Commits

Author SHA1 Message Date
c48c6a2d79 4.0.25 2022-10-24 10:10:53 +02:00
25d2bb077e fix(business.IContract): added contract logic 2022-10-24 10:10:52 +02:00
fee1e3cb58 4.0.24 2022-10-15 11:00:11 +02:00
66732c5f81 fix(core): update 2022-10-15 11:00:10 +02:00
62f78f0866 4.0.23 2022-10-15 10:51:42 +02:00
6bb30e4e5b fix(core): update 2022-10-15 10:51:42 +02:00
b0de29a26a 4.0.22 2022-10-15 10:51:25 +02:00
3363a12082 fix(core): update 2022-10-15 10:51:24 +02:00
b63ca0fd23 4.0.21 2022-09-14 09:40:03 +02:00
c95fd41f59 fix(core): update 2022-09-14 09:40:03 +02:00
38e5bd39d9 4.0.20 2022-09-14 08:43:55 +02:00
f978af4b4f fix(core): update 2022-09-14 08:43:54 +02:00
6f35eed240 4.0.19 2022-08-17 17:28:04 +02:00
636177b119 fix(core): update 2022-08-17 17:28:03 +02:00
05bd86a0ce 4.0.18 2022-08-17 15:46:43 +02:00
d4cc9f7843 fix(core): update 2022-08-17 15:46:42 +02:00
45e8460474 4.0.17 2022-06-16 12:25:27 +02:00
15bbb6ee22 fix(core): update 2022-06-16 12:25:26 +02:00
7bf736ec75 4.0.16 2022-06-15 22:37:40 +02:00
a43113860a fix(core): update 2022-06-15 22:37:40 +02:00
76cff5259b 4.0.15 2022-06-15 21:55:57 +02:00
34b49123e1 fix(core): update 2022-06-15 21:55:57 +02:00
ecf1b945b5 4.0.14 2022-06-15 21:29:39 +02:00
dd3182536e fix(core): update 2022-06-15 21:29:39 +02:00
5e8ab7012f 4.0.13 2022-06-15 01:17:47 +02:00
12a0a1402d fix(core): update 2022-06-15 01:17:47 +02:00
79c334da3b 4.0.12 2022-06-15 01:13:52 +02:00
5c71e8c97d fix(core): update 2022-06-15 01:13:51 +02:00
48b01b43ed 4.0.11 2022-06-15 01:11:42 +02:00
97d7b3cb61 fix(core): update 2022-06-15 01:11:41 +02:00
82d080a4f7 4.0.10 2022-06-15 00:44:08 +02:00
0c7875ca0d fix(core): update 2022-06-15 00:44:08 +02:00
e03fe0db7c 4.0.9 2022-06-14 23:09:58 +02:00
aa74f5d2e4 fix(core): update 2022-06-14 23:09:57 +02:00
55d5e89bb8 4.0.8 2022-06-12 19:29:28 +02:00
5838948117 fix(core): update 2022-06-12 19:29:27 +02:00
e5e3562eef 4.0.7 2022-06-11 12:56:39 +02:00
d081dc4b98 fix(core): update 2022-06-11 12:56:39 +02:00
ee9efae18d 4.0.6 2022-06-10 13:38:20 +02:00
df39fcbe37 fix(core): update 2022-06-10 13:38:20 +02:00
4ad0b3745e 4.0.5 2022-06-10 13:35:00 +02:00
7f53cb2f7f fix(core): update 2022-06-10 13:35:00 +02:00
59ca7e6c93 4.0.4 2022-06-10 13:31:18 +02:00
ba0237f9a7 fix(core): update 2022-06-10 13:31:18 +02:00
1609a2b65c 4.0.3 2022-06-05 16:44:48 +02:00
09f1496cf4 fix(core): update 2022-06-05 16:44:48 +02:00
5d96d25176 4.0.2 2022-04-28 14:25:21 +02:00
87a303f7be fix(core): update 2022-04-28 14:25:21 +02:00
34cb1384ea 4.0.1 2022-04-28 12:20:28 +02:00
d672b9973e fix(core): update 2022-04-28 12:20:27 +02:00
d8e1609851 4.0.0 2022-04-28 12:18:27 +02:00
9302766e91 BREAKING CHANGE(core): switch to esm 2022-04-28 12:18:26 +02:00
318e9a2476 3.0.48 2022-01-14 06:12:27 +01:00
7434f8a6a4 fix(core): update 2022-01-14 06:12:27 +01:00
0f23c88a45 3.0.47 2022-01-14 05:59:06 +01:00
9ef38d21d7 fix(core): update 2022-01-14 05:59:05 +01:00
058c8cbfc2 3.0.46 2022-01-14 05:17:56 +01:00
9f1b5df136 fix(core): update 2022-01-14 05:17:55 +01:00
1862444da9 3.0.45 2022-01-14 04:54:35 +01:00
c69b595fd1 fix(core): update 2022-01-14 04:54:35 +01:00
c761c7aeae 3.0.44 2022-01-14 04:50:26 +01:00
bd17b4c94f fix(core): update 2022-01-14 04:50:25 +01:00
a71106dcae 3.0.43 2022-01-14 04:45:56 +01:00
32608912b6 fix(core): update 2022-01-14 04:45:56 +01:00
46 changed files with 4589 additions and 27144 deletions

View File

@ -12,40 +12,36 @@ stages:
- release
- metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
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
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags:
- lossless
- docker
allow_failure: true
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 --only=dev
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
@ -56,7 +52,6 @@ auditDevDependencies:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
@ -67,7 +62,6 @@ testStable:
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
@ -96,10 +90,9 @@ codequality:
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
@ -119,11 +112,9 @@ trigger:
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"type": "node-terminal"
}
]
}

View File

View File

@ -9,7 +9,7 @@
"githost": "gitlab.com",
"gitscope": "tsclass",
"gitrepo": "tsclass",
"shortDescription": "common classes for TypeScript",
"description": "common classes for TypeScript",
"npmPackagename": "@tsclass/tsclass",
"license": "MIT"
}

27005
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,15 @@
{
"name": "@tsclass/tsclass",
"version": "3.0.42",
"version": "4.0.25",
"private": false,
"description": "common classes for TypeScript",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": {
"test": "tstest test/",
"build": "(tsbuild --web)"
"build": "(tsbuild --web)",
"buildDocs": "tsdoc"
},
"repository": {
"type": "git",
@ -24,15 +26,14 @@
},
"homepage": "https://github.com/tsclass/tsclass#readme",
"dependencies": {
"type-fest": "^2.8.0"
"type-fest": "^3.1.0"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.28",
"@gitzone/tsrun": "^1.2.18",
"@gitzone/tstest": "^1.0.60",
"@pushrocks/tapbundle": "^3.2.15",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
"@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.37",
"@gitzone/tstest": "^1.0.73",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.11.0"
},
"files": [
"ts/**/*",

4321
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
import { tap, expect } from '@pushrocks/tapbundle';
import * as tsclass from '../ts/index';
import * as tsclass from '../ts/index.js';
tap.test('should assign a correct type', async () => {
let contact: tsclass.business.IContact;

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@tsclass/tsclass',
version: '4.0.25',
description: 'common classes for TypeScript'
}

View File

@ -1 +1,2 @@
export * from './claim';
export * from './claim.js';
export * from './processedclaim.js';

View File

@ -1,4 +1,4 @@
import { IClaim } from './claim';
import { IClaim } from './claim.js';
export interface IProcessedClaim {
originalJWT: string;

View File

@ -1,4 +1,4 @@
import { business, general } from '..';
import { business, general } from '../index.js';
/**
* describes a company's lifecycle state

View File

@ -1,4 +1,5 @@
import { business } from '..';
import { finance } from '../index.js';
import { business } from '../index.js';
export type TContactSalutation = 'Mr' | 'Ms' | 'Mrs';
@ -33,5 +34,5 @@ export interface IContact {
// financial
// =========
vatId?: string;
bankAccountNumber?: string;
sepaConnection?: finance.ISepaConnection;
}

20
ts/business/contract.ts Normal file
View File

@ -0,0 +1,20 @@
import * as database from '../database/index.js';
import { IPerson } from "./person.js";
export interface IContract {
parties: {
signingOrder: number;
referencedAs: string;
person: IPerson;
role: 'signer' | 'cc';
signature: {
given: boolean;
timestamp?: number;
location?: string;
ip?: string;
verifications?: [];
}
}[],
contractTextMarkdown: string;
actions: database.IObjectAction[];
}

View File

@ -1,5 +1,6 @@
export * from './address';
export * from './company';
export * from './contact';
export * from './letter';
export * from './person';
export * from './address.js';
export * from './company.js';
export * from './contact.js';
export * from './letter.js';
export * from './pdf.js';
export * from './person.js';

View File

@ -1,18 +1,27 @@
import * as business from './';
import * as finance from '../finance';
import * as business from './index.js';
import * as finance from '../finance/index.js';
import * as database from '../database/index.js';
import type { TypedArray } from 'type-fest';
export interface ILetter {
incidenceId: string;
type: 'invoice' | 'notice' | 'warning' | 'verification' | 'contract';
date: number;
from: business.IAddress;
to: business.IAddress;
from: business.IContact;
to: business.IContact;
legalContact: business.IContact;
logoUrl: string;
accentColor: string;
subject: string;
text: string[];
invoice?: finance.IInvoice;
contractRef: string;
timesheetRef: string;
pdfAttachments: Uint8Array[];
legalContact: business.IContact;
accentColor?: string;
needsCoverSheet: boolean;
invoiceData?: finance.IInvoice;
contractData?: {
id: string;
contractDate: number;
};
timesheetData: string;
pdf?: business.IPdf;
pdfAttachments: business.IPdf[];
language: string;
}
objectActions: database.IObjectAction[];
}

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

@ -0,0 +1,8 @@
export interface IPdf {
name: string;
id: string;
metadata: {
textExtraction: string;
};
buffer: ArrayBufferLike;
}

View File

@ -1,6 +1,12 @@
import { IContact } from "./contact.js";
export interface IPerson {
title: string;
name: string;
surname: string;
sex: 'male' | 'female' | 'queer';
sex: 'male' | 'female' | 'queer';
legalProxyFor?: {
type: 'self' | 'other';
contact: IContact;
}
}

5
ts/code/commitinfo.ts Normal file
View File

@ -0,0 +1,5 @@
export interface ICommitInfo {
name: string;
version: string;
description: string;
}

1
ts/code/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './commitinfo.js';

View File

@ -1,2 +1,2 @@
export * from './container';
export * from './volumemount';
export * from './container.js';
export * from './volumemount.js';

View File

@ -1,11 +1,17 @@
import { content } from '..';
import { content } from '../index.js';
/**
* a general content article:
* * can be news
* * can be a productdescription,
* * can be anything that has text with a title
*/
export interface IArticle<T = any> {
/**
* the main url of an article
*/
url?: string;
/**
* the mainimage of the article
*/

View File

@ -1,5 +1,8 @@
import { general, content } from '..';
import { general, content } from '../index.js';
/**
* answers the question "Who wrote that?"
*/
export interface IAuthor {
/**
* the first name of an author

View File

@ -0,0 +1,10 @@
import { IArticle } from './article.js';
/**
* a set of articles that together form a body of documentation
*/
export interface IDocumentationSet {
id: string;
creationTimestamp: number;
articles: IArticle[];
}

View File

@ -1,2 +1,3 @@
export * from './article';
export * from './author';
export * from './article.js';
export * from './author.js';
export * from './documentationset.js';

3
ts/database/index.ts Normal file
View File

@ -0,0 +1,3 @@
export * from './mongodescriptor.js';
export * from './objectaction.js';
export * from './wrappeddata.js';

View File

@ -0,0 +1,25 @@
/**
* contains the complete info for how to connect to a mongodb database.
*/
export interface IMongoDescriptor {
/**
* the URL to connect to
*/
mongoDbUrl: string;
/**
* the db to use for the project
*/
mongoDbName?: string;
/**
* a username to use to connect to the database
*/
mongoDbUser?: string;
/**
* an optional password that will be replace <PASSWORD> in the connection string
*/
mongoDbPass?: string;
}

View File

@ -0,0 +1,8 @@
export interface IObjectAction {
timestamp: number;
name: string;
userId: string;
data: any;
message: string;
privateMessage: string;
}

View File

@ -0,0 +1,3 @@
export interface IWrappedData<T> {
data: T;
}

View File

@ -1,5 +1,5 @@
/**
* a constract event describes any kind of sale
* a contract event describes any kind of sale
*/
export interface IEvent_Contract {
contractId: string;

View File

@ -1,6 +1,6 @@
export * from './contractevent';
export * from './moneyevent';
export * from './releaseevent';
export * from './requestevent';
export * from './sessionevent';
export * from './userevent';
export * from './contractevent.js';
export * from './moneyevent.js';
export * from './releaseevent.js';
export * from './requestevent.js';
export * from './sessionevent.js';
export * from './userevent.js';

View File

@ -1,4 +1,4 @@
import { finance } from '../';
import { finance } from '../index.js';
export interface ICheckingAccount {
name: string;

View File

@ -1,4 +1,4 @@
import { business } from '../';
import { business } from '../index.js';
export interface IExpenseItem {
description: string;

View File

@ -1,5 +1,6 @@
export * from './checkingaccount';
export * from './currency';
export * from './expense';
export * from './invoice';
export * from './transaction';
export * from './checkingaccount.js';
export * from './currency.js';
export * from './expense.js';
export * from './invoice.js';
export * from './payment.js';
export * from './transaction.js';

View File

@ -1,4 +1,4 @@
import { business } from '..';
import { business, finance } from '../index.js';
export type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
@ -13,6 +13,7 @@ export interface IInvoiceItem {
}
export interface IInvoice {
id: string;
billedBy: business.IContact;
billedTo: business.IContact;
status: TInvoiceStatus;
@ -22,6 +23,8 @@ export interface IInvoice {
to: number;
};
deliveryDate?: number;
dueInDays: number;
reverseCharge: boolean;
printResult?: {
pdfBufferString: string;
totalNet: number;
@ -29,6 +32,7 @@ export interface IInvoice {
vatGroups: {
percentage: number;
items: IInvoiceItem[];
}
};
};
paymentOptions?: finance.IPaymentOptionInfo;
}

14
ts/finance/payment.ts Normal file
View File

@ -0,0 +1,14 @@
export interface ISepaConnection {
institution?: string;
iban: string;
bic: string;
}
export interface IPayPalConnection {
email: string;
}
export interface IPaymentOptionInfo {
sepaConnection: ISepaConnection;
payPal: IPayPalConnection;
}

View File

@ -1,2 +1,2 @@
export * from './date';
export * from './time';
export * from './date.js';
export * from './time.js';

View File

@ -1,25 +1,34 @@
// Business
import * as business from './business';
import * as business from './business/index.js';
// Code
import * as code from './code/index.js';
// Container
import * as container from './container';
import * as container from './container/index.js';
// Database
import * as database from './database/index.js';
// Finance
import * as finance from './finance';
import * as finance from './finance/index.js';
// Content
import * as content from './content';
import * as content from './content/index.js';
// General
import * as general from './general';
import * as general from './general/index.js';
// Network
import * as network from './network';
import * as network from './network/index.js';
// SaaS
import * as saas from './saas';
import * as saas from './saas/index.js';
export { business, container, finance, content, general, network, saas };
// Website
import * as website from './website/index.js';
export { business, container, code, database, finance, content, general, network, saas, website };
import type * as typeFest from 'type-fest';

10
ts/network/device.ts Normal file
View File

@ -0,0 +1,10 @@
export interface IDevice {
id: string;
resolutionWidth?: number;
resolutionHeight?: number;
dpi?: number;
manufacturer?: string;
name?: string;
ipv4?: string;
ipv6?: string;
}

View File

@ -1,6 +1,7 @@
export * from './cert';
export * from './dns';
export * from './dnschallenge';
export * from './networknode';
export * from './request';
export * from './reverseproxy';
export * from './cert.js';
export * from './device.js';
export * from './dns.js';
export * from './dnschallenge.js';
export * from './networknode.js';
export * from './request.js';
export * from './reverseproxy.js';

View File

@ -1,2 +1,2 @@
export * from './subscriptionplan';
export * from './product';
export * from './subscriptionplan.js';
export * from './product.js';

View File

@ -1,4 +1,4 @@
import { IProduct } from './product';
import { IProduct } from './product.js';
export interface ISubscriptionPlan {
name: string;

1
ts/website/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './menuitem.js';

4
ts/website/menuitem.ts Normal file
View File

@ -0,0 +1,4 @@
export interface IMenuItem {
name: string;
action: <T = any>() => void | Promise<T>;
}

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}

View File

@ -1,17 +0,0 @@
{
"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"
}