Compare commits

...

84 Commits

Author SHA1 Message Date
d87b50fb45 7.1.1 2025-03-20 19:25:56 +00:00
4f72f484d0 fix(finance): Add optional date property to the IInvoice interface 2025-03-20 19:25:56 +00:00
7931d458c5 7.1.0 2025-03-20 18:56:35 +00:00
d5b21e6567 feat(ts/finance/invoice): Add electronicAddress field to IInvoice for circular xinvoice support 2025-03-20 18:56:35 +00:00
1ccafa8c87 7.0.0 2025-03-20 18:53:49 +00:00
850d56df8b BREAKING CHANGE(business/address): Remove eAddress property from IAddress interface 2025-03-20 18:53:49 +00:00
dead451ab0 6.1.2 2025-03-20 17:52:17 +00:00
d7855494a7 fix(business/address): Improve documentation comments for address interface properties 2025-03-20 17:52:17 +00:00
0a12915c7e 6.1.1 2025-03-20 17:44:10 +00:00
9a942cafa5 fix(finance): Add clarifying comment for the buyerReference field in the invoice interface 2025-03-20 17:44:10 +00:00
0292b4fef4 6.1.0 2025-03-20 17:34:56 +00:00
2d9d2a5a47 feat(business/address): Add optional countryCode and coordinates properties to IAddress interface 2025-03-20 17:34:56 +00:00
079e315b23 6.0.1 2025-03-19 14:17:43 +00:00
caf3e4766f fix(business): Remove exports for company and person modules from the business index 2025-03-19 14:17:43 +00:00
50b5630aed 6.0.0 2025-03-19 14:16:55 +00:00
a8776be6b8 BREAKING CHANGE(TContact): new structure around TContact that combines functionality of previous interfaces like ICompany and IPerson 2025-03-19 14:16:55 +00:00
4e173d4dd4 Merge pull request 'feat: add registration info and refactor contact' (#1) from feat/add-registration-info into master
Reviewed-on: #1
2025-03-19 14:08:30 +00:00
edcbdea31f chore: fix typo 2025-03-18 16:49:51 +00:00
6072974bda feat: add registration info and refactor contact 2025-03-17 19:15:08 +00:00
8883bf181e 5.0.0 2025-03-11 12:07:33 +00:00
cd09a70232 BREAKING CHANGE(network): Update reverse proxy configuration to support multiple destination IPs and ports 2025-03-11 12:07:33 +00:00
e6811c75fc 4.4.4 2025-03-10 15:20:24 +00:00
e0ba9c6cef fix(business): Fixes typo in ILetter interface 2025-03-10 15:20:24 +00:00
90c56c6d4f 4.4.3 2025-03-07 14:21:32 +00:00
91caa9a747 fix(network): Fix destinationPort type for IReverseProxyConfig 2025-03-07 14:21:32 +00:00
115250edab 4.4.2 2025-03-07 14:20:18 +00:00
1127b8961f fix(dependencies): Updated package dependencies for improved stability and performance. 2025-03-07 14:20:18 +00:00
cc15835c8e 4.4.1 2025-03-07 14:18:42 +00:00
300ac01629 fix(business): Fix missing letterData property in ILetter interface. 2025-03-07 14:18:42 +00:00
a9a2f94f7e 4.4.0 2025-01-11 19:01:53 +01:00
5e8473d16b feat(website): Add ILinkBlock interface for managing groups of links 2025-01-11 19:01:53 +01:00
6366b4f990 4.3.0 2025-01-10 22:05:27 +01:00
a3e147f946 feat(website): Added new ILink interface to the website module. 2025-01-10 22:05:26 +01:00
1c6fc3666d 4.2.0 2024-12-11 12:53:04 +01:00
891b0f0f10 feat(dependencies): Update dependencies and enhance code documentation 2024-12-11 12:53:04 +01:00
96a31cbc71 4.1.2 2024-07-26 22:23:23 +02:00
450139682f fix(finance): Updated IInvoice interface to support various currencies. 2024-07-26 22:23:23 +02:00
741b361f4b 4.1.1 2024-07-26 22:20:19 +02:00
cabd160fb2 fix(finance): Fix IInvoice interface to correctly include the currency field 2024-07-26 22:20:18 +02:00
12a9e231ae 4.1.0 2024-07-26 16:51:34 +02:00
f9c7f90d73 feat(finance): Added notes field to IInvoice interface 2024-07-26 16:51:33 +02:00
6095e0ea5c 4.0.65 2024-07-24 15:16:28 +02:00
63b2bd59a2 fix(finance): Added type property to IInvoice interface 2024-07-24 15:16:27 +02:00
c4d13e6f8a 4.0.64 2024-07-18 21:01:09 +02:00
f6bda9a20c fix(business): Add relationship field to contact interface 2024-07-18 21:01:08 +02:00
4f1947d38a 4.0.63 2024-06-28 18:56:02 +02:00
c59ad68771 fix(saas): Refactor IProduct to separate IProductFeature interface 2024-06-28 18:56:01 +02:00
4d0af19155 4.0.62 2024-06-24 21:22:32 +02:00
d06b82faaa fix(dependencies): Updated dependencies to latest versions 2024-06-24 21:22:31 +02:00
c319415c76 4.0.61 2024-06-24 21:21:39 +02:00
75177cc097 fix(dependencies): Update dependencies to latest versions 2024-06-24 21:21:38 +02:00
85c4caa861 4.0.60 2024-06-19 18:27:24 +02:00
85ae355e2c fix(core): update 2024-06-19 18:27:23 +02:00
09ea75ed5b 4.0.59 2024-06-17 14:56:50 +02:00
58b3fbb03e fix(core): update 2024-06-17 14:56:49 +02:00
89698b30f6 4.0.58 2024-06-15 18:10:01 +02:00
09eaa7ff3b fix(core): update 2024-06-15 18:10:00 +02:00
806f28849f 4.0.57 2024-06-15 18:08:36 +02:00
dd4ff90b3b fix(core): update 2024-06-15 18:08:35 +02:00
cede9eaebf 4.0.56 2024-06-15 18:00:07 +02:00
a25425f0ac fix(core): update 2024-06-15 18:00:07 +02:00
54ad67c93e 4.0.55 2024-06-08 19:10:47 +02:00
dba7193605 fix(core): update 2024-06-08 19:10:46 +02:00
3cd02b61b3 4.0.54 2024-04-17 19:17:11 +02:00
f7fb032f4d fix(core): update 2024-04-17 19:17:10 +02:00
2cef38c54b 4.0.53 2024-04-17 19:16:04 +02:00
26cec00b4e fix(core): update 2024-04-17 19:16:04 +02:00
faa173b034 update documentation 2024-04-16 18:40:54 +02:00
e13236e10f 4.0.52 2024-02-17 20:54:54 +01:00
18d52a9018 fix(core): update 2024-02-17 20:54:53 +01:00
582b269d63 4.0.51 2024-02-13 01:08:22 +01:00
6293db82fd fix(core): update 2024-02-13 01:08:21 +01:00
eda528b6d9 4.0.50 2024-02-10 04:34:23 +01:00
4e52240ae7 fix(core): update 2024-02-10 04:34:22 +01:00
61b6835b31 4.0.49 2024-02-10 04:22:55 +01:00
48c65d726b fix(core): update 2024-02-10 04:22:54 +01:00
8b61ec02a2 4.0.48 2024-02-09 16:39:37 +01:00
90c3a9b3b4 fix(core): update 2024-02-09 16:39:37 +01:00
f25fb72924 4.0.47 2023-10-15 12:26:47 +02:00
995f7772ef fix(core): update 2023-10-15 12:26:46 +02:00
60a528aad4 4.0.46 2023-10-15 12:26:02 +02:00
310d60a84e fix(core): update 2023-10-15 12:26:01 +02:00
5fd5fc501f 4.0.45 2023-10-13 17:37:28 +02:00
bf79856f67 fix(core): update 2023-10-13 17:37:27 +02:00
34 changed files with 9279 additions and 4291 deletions

View File

@ -1,128 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- 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 command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install stable
- npmci npm install
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

306
changelog.md Normal file
View File

@ -0,0 +1,306 @@
# Changelog
## 2025-03-20 - 7.1.1 - fix(finance)
Add optional date property to the IInvoice interface
- Introduced an optional 'date' field with explanatory comments to capture the invoice date if not provided from the encompassing letter
## 2025-03-20 - 7.1.0 - feat(ts/finance/invoice)
Add electronicAddress field to IInvoice for circular xinvoice support
- Introduce optional electronicAddress property with scheme and value
- Enhance documentation for buyer reference in invoice interface
## 2025-03-20 - 7.0.0 - BREAKING CHANGE(business/address)
Remove eAddress property from IAddress interface
- Removed eAddress field that allowed storage of electronic contact means (phone, email, peppolId)
## 2025-03-20 - 6.1.2 - fix(business/address)
Improve documentation comments for address interface properties
- Added detailed comments for the 'coordinates' property to explain its usage
- Added detailed comments for the 'eAddress' property to describe the storage of electronic contact information
## 2025-03-20 - 6.1.1 - fix(finance)
Add clarifying comment for the buyerReference field in the invoice interface
- Document buyerReference as an optional field to help buyers identify the invoice
## 2025-03-20 - 6.1.0 - feat(business/address)
Add optional countryCode and coordinates properties to IAddress interface
- Extend address interface with an optional countryCode property
- Add optional coordinates object with lat and lng for geographic metadata
## 2025-03-19 - 6.0.1 - fix(business)
Remove exports for 'company' and 'person' modules from the business index
- Removed export statement for './company.js' in ts/business/index.ts
- Removed export statement for './person.js' in ts/business/index.ts
## 2025-03-19 - 6.0.0 - BREAKING CHANGE(TContact)
Reaffirm project metadata and documentation consistency
- Verified commitinfo data, package.json, and README content for correctness
- No functional code changes were introduced
## 2025-03-11 - 5.0.0 - BREAKING CHANGE(network)
Update reverse proxy configuration to support multiple destination IPs and ports
- Replaced 'destinationIp' and 'destinationPort' with 'destinationIps' (array) and 'destinationPorts' (array) to enable multiple destinations
## 2025-03-10 - 4.4.4 - fix(business)
Fixes typo in ILetter interface
- Removed unused property 'letterData' from ILetter content structure.
## 2025-03-07 - 4.4.3 - fix(network)
Fix destinationPort type for IReverseProxyConfig
- Corrected the type of destinationPort in IReverseProxyConfig from 'string' to 'number'.
## 2025-03-07 - 4.4.2 - fix(dependencies)
Updated package dependencies for improved stability and performance.
- Updated 'type-fest' dependency to version ^4.37.0.
- Updated '@git.zone/tsbuild' to version ^2.2.6.
- Updated '@git.zone/tstest' to version ^1.0.96.
- Updated '@push.rocks/tapbundle' to ^5.5.6.
- Updated '@types/node' to ^22.13.9.
## 2025-03-07 - 4.4.1 - fix(business)
Fix missing letterData property in ILetter interface.
- Added missing letterData property to the content structure of the ILetter interface.
- Ensured consistency and completeness of ILetter interface for proper data handling of letter components.
## 2025-01-11 - 4.4.0 - feat(website)
Add ILinkBlock interface for managing groups of links
- Introduced a new interface ILinkBlock in ts/website/linkblock.ts for managing grouped links.
- Exported ILinkBlock from ts/website/index.ts to make it available for external usage.
## 2025-01-10 - 4.3.0 - feat(website)
Added new ILink interface to the website module.
- Introduced ILink interface with properties like url, text, description, icon, and target.
- Updated ts/website/index.ts to export the new link interface.
## 2024-12-11 - 4.2.0 - feat(dependencies)
Update dependencies and enhance code documentation
- Updated 'type-fest' dependency from ^4.20.1 to ^4.30.0 for improved type definitions.
- Updated development dependencies for better development experience.
- Enhanced code documentation for the ICommitInfo interface with detailed JSDoc comments.
## 2024-07-26 - 4.1.2 - fix(finance)
Updated IInvoice interface to support various currencies.
- Changed the 'currency' field in the IInvoice interface from fixed 'EUR' to type TCurrency.
## 2024-07-26 - 4.1.1 - fix(finance)
Fix IInvoice interface to correctly include the currency field
- Corrected the IInvoice interface definition in `ts/finance/invoice.ts`
- Moved `position` field to the top of the IInvoiceItem interface
## 2024-07-26 - 4.1.0 - feat(finance)
Added notes field to IInvoice interface
- Expanded IInvoice interface to include notes field allowing additional notes for invoices.
## 2024-07-24 - 4.0.65 - fix(finance)
Added 'type' property to IInvoice interface
- Added 'type' property to the IInvoice interface in the finance domain.
- This property indicates whether the invoice is a 'creditnote' or 'debitnote'.
## 2024-07-18 - 4.0.64 - fix(business)
Add relationship field to contact interface
- Added 'relationship' field to the IContact interface in ts/business/contact.ts
## 2024-06-28 - 4.0.63 - fix(saas)
Refactor IProduct to separate IProductFeature interface
- Updated @types/node from 20.14.8 to 20.14.9
- Refactored IProduct's features property to a standalone IProductFeature interface in saas/product.ts
## 2024-06-24 - 4.0.62 - fix(dependencies)
Updated dependencies to latest versions
- Updated 'dependencies > type-fest' to version ^4.20.1
- Updated 'devDependencies > @git.zone/tsbuild' to version ^2.1.82
- Updated 'devDependencies > @git.zone/tsrun' to version ^1.2.49
- Updated 'devDependencies > @git.zone/tstest' to version ^1.0.90
- Updated 'devDependencies > @push.rocks/tapbundle' to version ^5.0.23
- Updated 'devDependencies > @types/node' to version ^20.14.8
## 2024-06-24 - 4.0.61 - fix(dependencies)
Update dependencies to latest versions
- Updated 'dependencies > type-fest' to version ^4.20.1
- Updated 'devDependencies > @git.zone/tsbuild' to version ^2.1.82
- Updated 'devDependencies > @git.zone/tsrun' to version ^1.2.49
- Updated 'devDependencies > @git.zone/tstest' to version ^1.0.90
- Updated 'devDependencies > @push.rocks/tapbundle' to version ^5.0.23
- Updated 'devDependencies > @types/node' to version ^20.14.8
## 2024-06-19 - 4.0.59 - core
Fixes and updates to core functionalities.
- Multiple updates and fixes applied to the core codebase
## 2024-06-17 - 4.0.59 to 4.0.56 - core
Routine updates and fixes to the core.
- Multiple core updates and fixes
## 2024-06-08 - 4.0.54 - core
Core fixes applied.
- Various fixes in the core functionality
## 2024-04-17 - 4.0.53 - core
Core functionality updated with fixes.
- Updates and fixes to core features
## 2024-04-16 - 4.0.52 - documentation
Documentation update.
- Documentation improved and updated
## 2024-02-17 - 4.0.51 - core
Fixes for core applied.
- Multiple core fixes implemented
## 2024-02-10 - 4.0.48 - core
Routine core updates and fixes.
- Several updates and fixes for core functionality
## 2023-10-15 - 4.0.46 - core
Core updates.
- Core functionalities updated and fixes applied
## 2023-10-13 - 4.0.44 - core
Routine fixes for core functionalities.
- Various updates to core functionalities
## 2023-09-13 - 4.0.43 - core
Core updates and fixes.
- Several core updates and fixes
## 2023-05-08 - 4.0.41 - core
Core updates.
- Core functionalities updated
## 2023-05-06 - 4.0.39 - core
Core updates and fixes.
- Multiple core updates and fixes
## 2023-04-19 - 4.0.37 - core
Routine core updates.
- Core fixes and updates applied
## 2023-04-05 - 4.0.35 - core
Core functionalities updated.
- Core functionalities updated and fixes applied
## 2023-03-14 - 4.0.33 - core
Routine core fixes and updates.
- Core functionalities updated
## 2023-03-09 - 4.0.32 - core
Routine maintenance for core.
- Core updates and fixes
## 2023-02-15 - 4.0.31 - core
Core updates applied.
- Fixes and updates to core functionalities
## 2023-02-06 - 4.0.30 - core
Routine fixes.
- Multiple core updates and fixes
## 2023-01-12 - 4.0.29 - core
Core updates applied.
- Fixes and updates to core functionalities
## 2022-11-20 - 4.0.27 - core
Routine core fixes.
- Core functionalities updated and fixed
## 2022-10-31 - 4.0.26 - core
Routine maintenance and fixes.
- Core functionalities updated
## 2022-10-24 - 4.0.24 - business.IContract
Added business logic for contracts.
- Added IContract logic to business module
## 2022-09-14 - 4.0.21 - core
Routine core updates and fixes.
- Core functionalities updated and fixed
## 2022-08-17 - 4.0.18 - core
Routine maintenance for core.
- Core functionalities updated and fixes applied
## 2022-06-16 - 4.0.17 - core
Routine fixes.
- Core functionalities updated
## 2022-04-28 - 4.0.0 - core
Major update with significant core changes.
- Switch to ESM format
- Multiple core functionalities updated and fixed

View File

@ -6,12 +6,30 @@
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"githost": "code.foss.global",
"gitscope": "tsclass",
"gitrepo": "tsclass",
"description": "common classes for TypeScript",
"description": "Provides TypeScript definitions for various business, financial, networking, content, and other common classes.",
"npmPackagename": "@tsclass/tsclass",
"license": "MIT"
"license": "MIT",
"keywords": [
"TypeScript",
"Classes",
"Interfaces",
"Code Quality",
"Networking",
"Business",
"Finance",
"Content Management",
"Containerization",
"Database",
"Event Management",
"Authentication",
"Web Development"
]
}
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

View File

@ -1,8 +1,8 @@
{
"name": "@tsclass/tsclass",
"version": "4.0.44",
"version": "7.1.1",
"private": false,
"description": "common classes for TypeScript",
"description": "Provides TypeScript definitions for various business, financial, networking, content, and other common classes.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
@ -17,7 +17,18 @@
},
"keywords": [
"TypeScript",
"Classes"
"Classes",
"Interfaces",
"Code Quality",
"Networking",
"Business",
"Finance",
"Content Management",
"Containerization",
"Database",
"Event Management",
"Authentication",
"Web Development"
],
"author": "Lossless GmbH",
"license": "MIT",
@ -26,14 +37,14 @@
},
"homepage": "https://github.com/tsclass/tsclass#readme",
"dependencies": {
"type-fest": "^4.3.1"
"type-fest": "^4.37.0"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.1.70",
"@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.81",
"@push.rocks/tapbundle": "^5.0.15",
"@types/node": "^20.6.0"
"@git.zone/tsbuild": "^2.2.6",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.96",
"@push.rocks/tapbundle": "^5.5.6",
"@types/node": "^22.13.9"
},
"files": [
"ts/**/*",

12594
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

164
readme.md
View File

@ -1,68 +1,144 @@
# @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/)
## Install
## Status for master
To install `@tsclass/tsclass`, run the following command in your project directory:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/tsclass/tsclass/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/tsclass/tsclass/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@tsclass/tsclass)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/tsclass/tsclass)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@tsclass/tsclass)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@tsclass/tsclass)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@tsclass/tsclass)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
```bash
npm install @tsclass/tsclass
```
This will add `@tsclass/tsclass` to your project's dependencies.
## Usage
Use TypeScript for best in class instellisense.
`@tsclass/tsclass` offers a comprehensive TypeScript library that provides common classes and interfaces for various domains, including business, finance, content, networking, and more. The package utilizes ESM syntax and is intended for use with TypeScript for optimal developer experience.
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.
### Getting Started
```javascript
import { IInvoice } from 'tsclass';
First, ensure that you are using ES Modules in your TypeScript project by having `"type": "module"` in your `package.json`, and install the package as described above.
class myOwnInvoice implements IInvoice {
constructor() {
super(); // you need to call super() in the constructor
}
}
### Importing Classes and Interfaces
You can import classes and interfaces from `@tsclass/tsclass` as follows:
```typescript
import { business, finance, content } from '@tsclass/tsclass';
```
### Time/Date
### Business Domain
- Date
- Time
The business domain includes classes for managing contacts, companies, and projects. Here is how you can work with a company and contact classes:
### Publications/Websites/Blogs
```typescript
import { business } from '@tsclass/tsclass';
- Article
- Author
const companyContact: business.TContact = {
type: 'company',
name: 'Example Company',
address: {
streetName: 'Main St',
houseNumber: '123',
postalCode: '12345',
city: 'Example City',
country: 'Exland'
},
description: 'An example company for demonstration purposes.',
email: 'contact@example.com'
};
### Finance
const exampleCompany: business.TCompany = {
name: 'Example Company',
foundedDate: {
day: 1,
month: 1,
year: 2020
},
status: 'active',
contact: companyContact
};
```
- Invoice
### Finance Domain
> The modules in bold letters exist as own modules and can be used seperately
The finance domain provides interfaces for working with invoices, transactions, and payment information. Heres how you can define an invoice:
## Contribution
```typescript
import { finance } from '@tsclass/tsclass';
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). :)
const exampleInvoice: finance.IInvoice = {
id: 'INV12345',
billedBy: companyContact,
billedTo: companyContact, // In a real scenario, this should be a different contact.
status: 'draft',
items: [
{
name: 'Product 1',
unitType: 'Item',
unitQuantity: 2,
unitNetPrice: 50,
vatPercentage: 20,
currency: 'EUR'
}
],
dueInDays: 30,
reverseCharge: false
};
```
For further information read the linked docs at the top of this readme.
### Network Domain
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
Networking interfaces, such as those for managing SSH keys or network nodes, are available under the `network` namespace:
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
```typescript
import { network } from '@tsclass/tsclass';
const sshKey: network.ISshKey = {
keyName: 'example-ssh-key',
public: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...'
// Private key is typically kept secret and not included in source code
};
```
### Storage Domain
Interfaces for storage management, such as S3 descriptors, can be found under the `storage` namespace:
```typescript
import { storage } from '@tsclass/tsclass';
const s3Descriptor: storage.IS3Descriptor = {
endpoint: 's3.example.com',
accessKey: 'AKIAIOSFODNN7EXAMPLE',
accessSecret: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
useSsl: true
};
```
### Content and More
`@tsclass/tsclass` also provides classes for the content domain (e.g., articles, authors) and many other utilities across different fields. The examples above only scratch the surface of what `@tsclass/tsclass` offers. Depending on your project's needs, explore other domains and interfaces provided by the library.
Remember, while `@tsclass/tsclass` aims to streamline the TypeScript development process by providing ready-to-use classes and interfaces, it is crucial to adapt these examples to your specific project requirements, ensuring that all aspects, such as security (especially for networking and storage operations), are adequately handled.
For a deeper look into all available classes and interfaces, refer to the TypeScript definitions in the package. This will also give you insight into additional functionalities such as content management, events, authentication, and more detailed use cases within each domain.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

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

View File

@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@tsclass/tsclass',
version: '4.0.44',
description: 'common classes for TypeScript'
version: '7.1.1',
description: 'Provides TypeScript definitions for various business, financial, networking, content, and other common classes.'
}

View File

@ -5,4 +5,13 @@ export interface IAddress {
postalCode: string;
city: string;
country: string;
countryCode?: string;
/**
* allows storage of coordinates for this address
* useful for countries where addresses are not unique
*/
coordinates?: {
lat: number;
lng: number;
};
}

View File

@ -1,20 +0,0 @@
import { business, general } from '../index.js';
/**
* describes a company's lifecycle state
*/
export type TCompanyStatus = 'planed' | 'founding' | 'active' | 'liquidation' | 'closed';
/**
* describes a company
*/
export interface ICompany {
name: string;
slogan?: string;
description?: string;
logoLink?: string;
foundedDate: general.IDate;
closedDate: general.IDate;
status: business.TCompanyStatus;
contact: business.IContact;
}

View File

@ -1,38 +1,60 @@
import { finance } from '../index.js';
import { business } from '../index.js';
import { finance, general } from "../index.js";
import { business } from "../index.js";
export type TContactSalutation = 'Mr' | 'Ms' | 'Mrs';
export type TSocialLinks = {
type: "facebook" | "twitter" | "linkedin" | string;
url: string;
};
export type TContactType = 'person' | 'company';
export type TRegistrationDetails = {
vatId: string;
registrationId: string;
registrationName: string;
};
export type TContactTitle = 'Doctor' | 'Professor';
export interface IContact {
// =======
// general
// =======
salutation?: TContactSalutation;
type: TContactType;
title?: TContactTitle;
type TContactEnvelope<TYPE extends string, FIELDS> = {
type: TYPE;
name: string;
surname?: string;
legalEntity?: string;
address: business.IAddress;
description: string;
legalEntity?: string;
customerNumber?: string;
relationship?: "customer" | "supplier" | "partner" | "employee" | "other";
email?: string;
logoUrl?: string;
website?: string;
facebookUrl?: string;
twitterUrl?: string;
phone?: string;
fax?: string;
// =========
// financial
// =========
vatId?: string;
logoUrl?: string;
website?: string;
socials?: TSocialLinks[];
sepaConnection?: finance.ISepaConnection;
}
} & FIELDS;
export type TPerson = TContactEnvelope<
"person",
{
surname: string;
salutation: "Mr" | "Ms" | "Mrs";
sex: "male" | "female" | "other";
title: "Doctor" | "Professor";
registrationDetails?: TRegistrationDetails;
legalProxyFor?: {
type: "self" | "other";
contact?: TContact;
};
}
>;
export type TCompany = TContactEnvelope<
"company",
{
registrationDetails: TRegistrationDetails;
foundedDate: general.IDate;
closedDate: general.IDate;
status: "planned" | "founding" | "active" | "liquidation" | "closed";
}
>;
export type TContact = TPerson | TCompany;

View File

@ -1,12 +1,12 @@
import * as database from '../database/index.js';
import { type IPerson } from './person.js';
import * as database from "../database/index.js";
import type { TPerson } from "./index.js";
export interface IContract {
parties: {
signingOrder: number;
referencedAs: string;
person: IPerson;
role: 'signer' | 'cc';
person: TPerson;
role: "signer" | "cc";
signature: {
given: boolean;
timestamp?: number;

View File

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

View File

@ -1,18 +1,17 @@
import * as finance from '../finance/index.js';
import { type ICompany } from './company.js';
import { type IContact } from './contact.js';
import * as finance from "../finance/index.js";
import { type TContact } from "./contact.js";
export class IJob {
type: 'contract' | 'employment';
type: "contract" | "employment";
techTags?: string[];
qualificationTags?: string[];
languages?: {
name: string;
level: 'basic' | 'intermediate' | 'advanced' | 'native';
level: "basic" | "intermediate" | "advanced" | "native";
}[];
name: string;
description: string;
monthlyTotal: number;
currency: finance.TCurrency;
from: ICompany;
contact: IContact;
}
from: TContact;
contact: TContact;
}

View File

@ -1,13 +1,20 @@
import * as business from './index.js';
import * as finance from '../finance/index.js';
import * as database from '../database/index.js';
import * as business from "./index.js";
import * as finance from "../finance/index.js";
import * as database from "../database/index.js";
export interface ILetter {
versionInfo: {
type: "draft" | "final";
/**
* should follow semVer
*/
version: string;
};
incidenceId: string;
type: 'invoice' | 'notice' | 'warning' | 'verification' | 'contract';
type: "invoice" | "notice" | "warning" | "verification" | "contract";
date: number;
from: business.IContact;
to: business.IContact;
legalContact: business.IContact;
from: business.TContact;
to: business.TContact;
legalContact: business.TContact;
logoUrl: string;
subject: string;
accentColor?: string;
@ -20,7 +27,7 @@ export interface ILetter {
contractDate: number;
};
timesheetData: string;
}
};
pdf?: business.IPdf;
pdfAttachments: business.IPdf[];
language: string;

View File

@ -4,5 +4,5 @@ export interface IPdf {
metadata: {
textExtraction: string;
};
buffer: ArrayBufferLike;
buffer: Uint8Array;
}

View File

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

View File

@ -1,5 +1,20 @@
export interface ICommitInfo {
/**
* the name of the project
*/
name: string;
/**
* the current version of the project
*/
version: string;
/**
* the description of the project
*/
description: string;
/**
* the changelog of the project
*/
changelog?: string[];
}

View File

@ -13,5 +13,5 @@ export interface IVoucher {
date: Date;
description: string;
expenseItems: IExpenseItem[];
contactRef: business.IContact;
contactRef: business.TContact;
}

View File

@ -1,21 +1,39 @@
import { business, finance } from '../index.js';
import type { TCurrency } from './currency.js';
export type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
export interface IInvoiceItem {
position: number;
name: string;
articleNumber?: string;
unitType: string;
unitQuantity: number;
unitNetPrice: number;
vatPercentage: number;
currency: 'EUR';
}
export interface IInvoice {
id: string;
billedBy: business.IContact;
billedTo: business.IContact;
/**
* am optional date
* if not set, the date is likely coming from the encompasing letter
*/
date?: number;
billedBy: business.TContact;
billedTo: business.TContact;
/**
* buyer reference is an optional field, that helps the buyer to identify the invoice
*/
buyerReference?: string;
/**
* also a kind of reference, esspecially needed for circular xinvoice support.
*/
electronicAddress?: {
scheme: string;
value: string;
};
type: 'creditnote' | 'debitnote';
status: TInvoiceStatus;
items: IInvoiceItem[];
periodOfPerformance?: {
@ -34,5 +52,7 @@ export interface IInvoice {
items: IInvoiceItem[];
};
};
notes: string[];
paymentOptions?: finance.IPaymentOptionInfo;
currency: TCurrency;
}

View File

@ -25,10 +25,13 @@ import * as network from './network/index.js';
// SaaS
import * as saas from './saas/index.js';
// Storage
import * as storage from './storage/index.js';
// Website
import * as website from './website/index.js';
export { business, container, code, database, finance, content, general, network, saas, website };
export { business, container, code, database, finance, content, general, network, saas, storage, website };
import type * as typeFest from 'type-fest';
import * as typeFestOwn from './typefest.own.js';

View File

@ -1,16 +1,24 @@
export type TDnsRecordType =
| 'A'
| 'AAAA'
| 'CNAME'
| 'LOC'
| 'PTR'
| 'MX'
| 'NAPTR'
| 'NS'
| 'SOA'
| 'SPF'
| 'SRV'
| 'TXT';
| "A"
| "AAAA"
| "CNAME"
| "LOC"
| "PTR"
| "MX"
| "NAPTR"
| "NS"
| "SRV"
| "TXT"
| "CAA"
| "CERT"
| "DNSKEY"
| "DS"
| "HTTPS"
| "SMIMEA"
| "SSHFP"
| "SVCB"
| "TLSA"
| "URI";
export interface IDnsRecord {
name: string;

View File

@ -4,6 +4,8 @@ export * from './device.js';
export * from './dns.js';
export * from './dnschallenge.js';
export * from './domaindelegation.js';
export * from './jwt.js';
export * from './networknode.js';
export * from './request.js';
export * from './reverseproxy.js';
export * from './ssh.js';

4
ts/network/jwt.ts Normal file
View File

@ -0,0 +1,4 @@
export interface IJwtKeypair {
privatePem: string;
publicPem: string;
}

View File

@ -1,6 +1,6 @@
export interface IReverseProxyConfig {
destinationIp: string;
destinationPort: string;
destinationIps: string[];
destinationPorts: number[];
hostName: string;
privateKey: string;
publicKey: string;

5
ts/network/ssh.ts Normal file
View File

@ -0,0 +1,5 @@
export interface ISshKey {
keyName: string;
public: string;
private?: string;
}

View File

@ -1,14 +1,22 @@
import { type ICompany } from "../business/company.js";
import type { TCompany } from "../business/contact.js";
export interface IProduct {
name: string;
slogan: string;
description: string;
os: 'web-based',
category: 'Business Application',
os: "web-based";
category: "Business Application";
offers: any[];
features: IProductFeature[];
landingPage: string;
appLink: string;
logoLink: string;
publisher?: ICompany;
}
publisher?: TCompany;
}
export interface IProductFeature {
heading: string;
description: string;
linkText: string;
linkUrl: string;
}

16
ts/storage/index.ts Normal file
View File

@ -0,0 +1,16 @@
export interface IS3Descriptor {
endpoint: string;
port?: number | string;
useSsl?: boolean;
accessKey: string;
accessSecret: string;
/**
* may be used to preselect a certain bucket
*/
bucketName?: string;
/**
* may be used to preselect a certain directory
*/
directoryPath?: string;
region?: string;
}

View File

@ -1,5 +1,8 @@
type SecondArgument<T> = T extends (arg1: any, arg2: infer P, ...args: any[]) => any ? P : never;
type ValueType<T> = T extends { [key: string]: infer U } ? U : never;
export type {
SecondArgument,
ValueType
}

View File

@ -1 +1,3 @@
export * from './link.js';
export * from './menuitem.js';
export * from './linkblock.js';

7
ts/website/link.ts Normal file
View File

@ -0,0 +1,7 @@
export interface ILink {
url: string;
text?: string;
description?: string;
icon?: string;
target?: '_blank' | '_self' | '_parent' | '_top';
}

6
ts/website/linkblock.ts Normal file
View File

@ -0,0 +1,6 @@
import type { ILink } from './link.js';
export interface ILinkBlock {
title: string;
links: ILink[];
}

View File

@ -3,8 +3,8 @@
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},