Compare commits

..

26 Commits

Author SHA1 Message Date
254eafc007 9.2.0
Some checks failed
Default (tags) / security (push) Successful in 39s
Default (tags) / test (push) Successful in 44s
Default (tags) / release (push) Failing after 34s
Default (tags) / metadata (push) Successful in 44s
2025-05-05 10:14:08 +00:00
12f183e8f2 feat(descriptors): Add new descriptors module with Cloudflare and LetterExpress interfaces and documentation 2025-05-05 10:14:08 +00:00
f93daa90ae 9.1.0
Some checks failed
Default (tags) / security (push) Successful in 42s
Default (tags) / test (push) Successful in 43s
Default (tags) / release (push) Failing after 33s
Default (tags) / metadata (push) Successful in 46s
2025-04-29 14:07:38 +00:00
dfae08f3b1 feat(network): Add DNS convenience interface to support ACME DNS-01 challenge management in the network module. 2025-04-29 14:07:38 +00:00
7b419d4ed6 9.0.0
Some checks failed
Default (tags) / security (push) Successful in 37s
Default (tags) / test (push) Successful in 45s
Default (tags) / release (push) Failing after 33s
Default (tags) / metadata (push) Successful in 43s
2025-04-16 13:33:18 +00:00
5d342bc43f BREAKING CHANGE(finance): refactor: migrate invoice APIs to unified accounting document types 2025-04-16 13:33:17 +00:00
9717989831 8.2.1
Some checks failed
Default (tags) / security (push) Successful in 40s
Default (tags) / test (push) Successful in 45s
Default (tags) / release (push) Failing after 32s
Default (tags) / metadata (push) Successful in 44s
2025-04-12 15:32:53 +00:00
8cfaad2071 fix(business/job): Refactor job interface to support expanded employment details and improve type safety 2025-04-12 15:32:53 +00:00
339c41c259 8.2.0 2025-04-04 13:06:21 +00:00
bf6b323df5 feat(finance/payment): Add optional description field to payment option info. 2025-04-04 13:06:21 +00:00
41e4dad65c 8.1.1 2025-03-26 17:00:01 +00:00
572454e54f fix(business/letter): Remove extraneous inline comment from TLetter type union in business/letter.ts 2025-03-26 17:00:01 +00:00
82b0325d7c 8.1.0 2025-03-26 16:54:00 +00:00
12cddd99e0 feat(business/letter): Extend TLetter to include invoice support and update dependency versions 2025-03-26 16:54:00 +00:00
1f798fc578 8.0.4 2025-03-25 11:14:26 +00:00
29f27d1a0c fix(license/business-letter): Remove legacy commented-out code from letter module 2025-03-25 11:14:26 +00:00
edb7690eb8 8.0.3 2025-03-24 10:30:57 +00:00
1a54bf5979 fix(ci): Add Gitea workflow files for CI/CD, update repository URLs, and standardize formatting 2025-03-24 10:30:57 +00:00
5dd087c16a Merge pull request 'fix: move invoice type into explicit property' (#4) from fix/move-invoice-type into master
Reviewed-on: #4
2025-03-24 10:28:16 +00:00
4a79416d02 fix: move invoice type into explicit property 2025-03-24 10:23:53 +00:00
5bb38bc983 8.0.2 2025-03-24 09:59:42 +00:00
d2149daca9 fix(commitinfo): Company State amendment 2025-03-24 09:59:42 +00:00
5520ff6390 Merge pull request 'fix: move company status fields in different types' (#3) from fix/add-company-states into master
Reviewed-on: #3
2025-03-24 09:58:30 +00:00
1c44e6a8f8 fix: move company status fields in different types 2025-03-24 09:55:32 +00:00
170163ec73 8.0.1 2025-03-24 08:11:36 +00:00
76a47f737f fix(documentation): Improve documentation clarity and update package metadata 2025-03-24 08:11:36 +00:00
29 changed files with 841 additions and 252 deletions

View File

@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

3
.gitignore vendored
View File

@ -3,7 +3,6 @@
# artifacts
coverage/
public/
pages/
# installs
node_modules/
@ -17,4 +16,4 @@ node_modules/
dist/
dist_*/
# custom
#------# custom

View File

@ -1,5 +1,77 @@
# Changelog
## 2025-05-05 - 9.2.0 - feat(descriptors)
Add new descriptors module with Cloudflare and LetterExpress interfaces and documentation
- Introduced new descriptors interfaces (ICloudflareDescriptor and ILetterExpressDescriptor) in ts/descriptors/index.ts
- Added descriptors readme to document their purpose
- Integrated descriptors into the main module export in ts/index.ts
## 2025-04-29 - 9.1.0 - feat(network)
Add DNS convenience interface to support ACME DNS-01 challenge management in the network module.
- Added IConvenientDnsProvider interface in ts/network/dnsconvenience.ts
- Updated ts/network/index.ts to export the DNS convenience interface
## 2025-04-16 - 9.0.0 - BREAKING CHANGE(finance)
refactor: migrate invoice APIs to unified accounting document types
- Introduced new accounting document types in ts/finance/accountingdoc.ts to standardize invoice, credit note, debit note, and self-billed invoice representations
- Updated ts/finance/index.ts to export the new accounting document module
- Removed the legacy ts/finance/invoice.ts module
## 2025-04-12 - 8.2.1 - fix(business/job)
Refactor job interface to support expanded employment details and improve type safety
- Changed exported IJob from a class to an interface
- Removed obsolete properties (monthlyTotal, currency)
- Added new types for contract, work location, experience level, and job status
- Introduced detailed fields: url, location, postedDate, salary, contractType, skillTags, qualificationTags, languages, and history
## 2025-04-04 - 8.2.0 - feat(finance/payment)
Add optional 'description' field to payment option info.
- Enhanced the IPaymentOptionInfo interface in ts/finance/payment.ts by adding an optional 'description' property for improved context.
## 2025-03-26 - 8.1.1 - fix(business/letter)
Remove extraneous inline comment from TLetter type union in business/letter.ts
- Clean up redundant comment to improve code clarity
- Maintain consistency in type definitions
## 2025-03-26 - 8.1.0 - feat(business/letter)
Extend TLetter to include invoice support and update dependency versions
- Bump type-fest to ^4.38.0 and @types/node to ^22.13.13 in package.json
- Modify TLetter type in ts/business/letter.ts to support finance.TInvoice alongside simple letters
## 2025-03-25 - 8.0.4 - fix(license/business-letter)
Remove legacy commented-out code from letter module and update copyright header
- Removed unused commented block in ts/business/letter.ts
- Updated copyright header in license file
## 2025-03-24 - 8.0.3 - fix(ci)
Add Gitea workflow files for CI/CD, update repository URLs, and standardize formatting
- Added .gitea/workflows/default_nottags.yaml and default_tags.yaml to manage CI for tagged and non-tagged pushes
- Updated package.json repository, homepage, and bugs URLs to reflect the new code.foss.global location
- Modified .gitignore custom section comment for clarity
- Standardized code formatting and string quoting across various source files
- Enhanced tsconfig.json by adding baseUrl and paths settings
## 2025-03-24 - 8.0.2 - fix(commitinfo)
Refresh autogenerated commit info and internal metadata for version consistency
- No functional changes were made
- Updated internal commit metadata to reflect the current project state
## 2025-03-24 - 8.0.1 - fix(documentation)
Improve documentation clarity and update package metadata
- Correct author field in package.json to 'Task Venture Capital GmbH'
- Enhance readme.md with comprehensive usage examples and detailed type structure for better guidance
## 2025-03-24 - 8.0.0 - BREAKING CHANGE(tsclass)
Trigger patch release with no code changes

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016
Copyright (c) 2016 Task Venture Capital GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
{
"name": "@tsclass/tsclass",
"version": "8.0.0",
"version": "9.2.0",
"private": false,
"description": "Provides TypeScript definitions for various business, financial, networking, content, and other common classes.",
"main": "dist_ts/index.js",
@ -13,7 +13,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/tsclass/tsclass.git"
"url": "https://code.foss.global/tsclass/tsclass.git"
},
"keywords": [
"TypeScript",
@ -30,21 +30,21 @@
"Authentication",
"Web Development"
],
"author": "Lossless GmbH",
"author": "Task Venture Capital GmbH",
"license": "MIT",
"bugs": {
"url": "https://github.com/tsclass/tsclass/issues"
"url": "https://code.foss.global/tsclass/tsclass/issues"
},
"homepage": "https://github.com/tsclass/tsclass#readme",
"homepage": "https://code.foss.global/tsclass/tsclass#readme",
"dependencies": {
"type-fest": "^4.37.0"
"type-fest": "^4.38.0"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.3.2",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.96",
"@push.rocks/tapbundle": "^5.6.0",
"@types/node": "^22.13.11"
"@types/node": "^22.13.13"
},
"files": [
"ts/**/*",
@ -60,5 +60,8 @@
],
"browserslist": [
"last 1 chrome versions"
]
],
"pnpm": {
"overrides": {}
}
}

84
pnpm-lock.yaml generated
View File

@ -9,8 +9,8 @@ importers:
.:
dependencies:
type-fest:
specifier: ^4.37.0
version: 4.37.0
specifier: ^4.38.0
version: 4.38.0
devDependencies:
'@git.zone/tsbuild':
specifier: ^2.3.2
@ -25,8 +25,8 @@ importers:
specifier: ^5.6.0
version: 5.6.0(@aws-sdk/credential-providers@3.772.0)(socks@2.8.4)
'@types/node':
specifier: ^22.13.11
version: 22.13.11
specifier: ^22.13.13
version: 22.13.13
packages:
@ -1430,8 +1430,8 @@ packages:
'@types/node-forge@1.3.11':
resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==}
'@types/node@22.13.11':
resolution: {integrity: sha512-iEUCUJoU0i3VnrCmgoWCXttklWcvoCIx4jzcP22fioIVSdTmjgoEvmAO/QPw6TcS9k5FrNgn4w7q5lGOd1CT5g==}
'@types/node@22.13.13':
resolution: {integrity: sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==}
'@types/parse5@6.0.3':
resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==}
@ -4119,8 +4119,8 @@ packages:
resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
engines: {node: '>=12.20'}
type-fest@4.37.0:
resolution: {integrity: sha512-S/5/0kFftkq27FPNye0XM1e2NsnoD/3FS+pBmbjmmtLT6I+i344KoOf7pvXreaFsDamWeaJX55nczA1m5PsBDg==}
type-fest@4.38.0:
resolution: {integrity: sha512-2dBz5D5ycHIoliLYLi0Q2V7KRaDlH0uWIvmk7TYlAg5slqwiPv1ezJdZm1QEM0xgk29oYWMCbIG7E6gHpvChlg==}
engines: {node: '>=16'}
type-is@1.6.18:
@ -5315,7 +5315,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/yargs': 17.0.33
chalk: 4.1.2
@ -6673,22 +6673,22 @@ snapshots:
'@tsclass/tsclass@4.4.0':
dependencies:
type-fest: 4.37.0
type-fest: 4.38.0
'@tsclass/tsclass@4.4.4':
dependencies:
type-fest: 4.37.0
type-fest: 4.38.0
'@types/accepts@1.3.7':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/babel__code-frame@7.0.6': {}
'@types/body-parser@1.19.5':
dependencies:
'@types/connect': 3.4.38
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/buffer-json@2.0.3': {}
@ -6704,17 +6704,17 @@ snapshots:
'@types/clean-css@4.2.11':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
source-map: 0.6.1
'@types/co-body@6.1.3':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/qs': 6.9.18
'@types/connect@3.4.38':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/content-disposition@0.5.8': {}
@ -6727,11 +6727,11 @@ snapshots:
'@types/connect': 3.4.38
'@types/express': 5.0.1
'@types/keygrip': 1.0.6
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/cors@2.8.17':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/debounce@1.2.4': {}
@ -6745,14 +6745,14 @@ snapshots:
'@types/express-serve-static-core@4.19.6':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/qs': 6.9.18
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
'@types/express-serve-static-core@5.0.6':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/qs': 6.9.18
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
@ -6783,30 +6783,30 @@ snapshots:
'@types/from2@2.3.5':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/fs-extra@11.0.4':
dependencies:
'@types/jsonfile': 6.1.4
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/fs-extra@9.0.13':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/glob@7.2.0':
dependencies:
'@types/minimatch': 5.1.2
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/glob@8.1.0':
dependencies:
'@types/minimatch': 5.1.2
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/gunzip-maybe@1.4.2':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/hast@3.0.4':
dependencies:
@ -6840,7 +6840,7 @@ snapshots:
'@types/jsonfile@6.1.4':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/keygrip@1.0.6': {}
@ -6857,7 +6857,7 @@ snapshots:
'@types/http-errors': 2.0.4
'@types/keygrip': 1.0.6
'@types/koa-compose': 3.2.8
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/mdast@4.0.4':
dependencies:
@ -6875,9 +6875,9 @@ snapshots:
'@types/node-forge@1.3.11':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/node@22.13.11':
'@types/node@22.13.13':
dependencies:
undici-types: 6.20.0
@ -6895,19 +6895,19 @@ snapshots:
'@types/s3rver@3.7.4':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/semver@7.5.8': {}
'@types/send@0.17.4':
dependencies:
'@types/mime': 1.3.5
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/serve-static@1.15.7':
dependencies:
'@types/http-errors': 2.0.4
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/send': 0.17.4
'@types/sinon-chai@3.2.12':
@ -6927,11 +6927,11 @@ snapshots:
'@types/tar-stream@2.2.3':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/through2@2.0.41':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/triple-beam@1.3.5': {}
@ -6955,18 +6955,18 @@ snapshots:
'@types/whatwg-url@8.2.2':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/webidl-conversions': 7.0.3
'@types/which@3.0.4': {}
'@types/ws@7.4.7':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/ws@8.18.0':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
'@types/yargs-parser@21.0.3': {}
@ -6976,7 +6976,7 @@ snapshots:
'@types/yauzl@2.10.3':
dependencies:
'@types/node': 22.13.11
'@types/node': 22.13.13
optional: true
'@ungap/structured-clone@1.3.0': {}
@ -7616,7 +7616,7 @@ snapshots:
dependencies:
'@types/cookie': 0.4.1
'@types/cors': 2.8.17
'@types/node': 22.13.11
'@types/node': 22.13.13
accepts: 1.3.8
base64id: 2.0.0
cookie: 0.4.2
@ -8445,7 +8445,7 @@ snapshots:
jest-util@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.13.11
'@types/node': 22.13.13
chalk: 4.1.2
ci-info: 3.9.0
graceful-fs: 4.2.11
@ -10034,7 +10034,7 @@ snapshots:
type-fest@2.19.0: {}
type-fest@4.37.0: {}
type-fest@4.38.0: {}
type-is@1.6.18:
dependencies:

148
readme.md
View File

@ -1,40 +1,77 @@
# @tsclass/tsclass
common classes for TypeScript
## Install
A comprehensive TypeScript library providing well-structured type definitions for various domains including business, finance, networking, content management, and more.
To install `@tsclass/tsclass`, run the following command in your project directory:
## Installation
```bash
npm install @tsclass/tsclass
```
This will add `@tsclass/tsclass` to your project's dependencies.
## Overview
## Usage
This library offers a rich collection of TypeScript interfaces and types designed to provide consistent structures for common business and development needs. It's organized into domain-specific modules to maintain clarity and separation of concerns.
`@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.
## Type Structure
### Getting Started
### Authentication
- **IClaim**: Authentication claims with user and role data
- **IProcessedClaim**: Processed JWT claims with verification status
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.
### Business
- **TDocumentEnvelope**: Base type for all document types
- **IAddress**: Physical/postal address structure
- **TContact**: Person and company contact information
- **TContractEnvelope**: Various contract types (Employment, NDA, Service, Lease)
- **TLetterEnvelope**: Letter document types
- **IPdf**: PDF document with metadata
### Importing Classes and Interfaces
### Finance
- **TCurrency**: Currency representation
- **TInvoiceEnvelope**: Invoice document structure
- **TInvoiceItem**: Line items for invoices
- **IPaymentOptionInfo**: Banking and payment method details
You can import classes and interfaces from `@tsclass/tsclass` as follows:
### Network
- **INetworkNode**: Network device representation
- **ICert**: Certificate management
- **IJWT**: JWT token structure
- **IDnsChallenge**: DNS verification challenges
```typescript
import { business, finance, content } from '@tsclass/tsclass';
```
### Container
- **IContainer**: Container configuration
- **IVolumeMount**: Volume mount specification
### Business Domain
### Database
- **IMongoDescriptor**: MongoDB connection details
- **IObjectAction**: Document lifecycle tracking
The business domain includes classes for managing contacts, companies, and projects. Here is how you can work with a company and contact classes:
### Content
- **IArticle**: Content article structure
- **IAuthor**: Content author metadata
- **IDocumentationSet**: Documentation collections
### Code
- **ICommitInfo**: Code commit information
- **IStatusObject**: Status tracking object
### Website
- **ILink**: Website link structure
- **ILinkBlock**: Link collection
- **IMenuItem**: Navigation menu items
### SaaS
- **IProduct**: SaaS product definition
- **ISubscriptionPlan**: Subscription plan details
## Usage Examples
### Business Contact
```typescript
import { business } from '@tsclass/tsclass';
const companyContact: business.TContact = {
const companyContact: business.TCompany = {
type: 'company',
name: 'Example Company',
address: {
@ -44,86 +81,59 @@ const companyContact: business.TContact = {
city: 'Example City',
country: 'Exland'
},
description: 'An example company for demonstration purposes.',
email: 'contact@example.com'
};
const exampleCompany: business.TCompany = {
name: 'Example Company',
email: 'contact@example.com',
foundedDate: {
day: 1,
month: 1,
year: 2020
},
status: 'active',
contact: companyContact
status: 'active'
};
```
### Finance Domain
The finance domain provides interfaces for working with invoices, transactions, and payment information. Heres how you can define an invoice:
### Invoice
```typescript
import { finance } from '@tsclass/tsclass';
import { finance, business } from '@tsclass/tsclass';
const exampleInvoice: finance.IInvoice = {
id: 'INV12345',
billedBy: companyContact,
billedTo: companyContact, // In a real scenario, this should be a different contact.
status: 'draft',
const invoice: finance.TInvoiceEnvelope = {
id: 'INV-2023-001',
status: 'invoice',
issueDate: {
day: 15,
month: 3,
year: 2023
},
items: [
{
name: 'Product 1',
unitType: 'Item',
unitQuantity: 2,
unitNetPrice: 50,
name: 'Consulting Services',
unitType: 'hour',
unitQuantity: 10,
unitNetPrice: 150,
vatPercentage: 20,
currency: 'EUR'
}
],
dueInDays: 30,
reverseCharge: false
billedBy: { /* company details */ },
billedTo: { /* client details */ }
};
```
### Network Domain
Networking interfaces, such as those for managing SSH keys or network nodes, are available under the `network` namespace:
### Network Certificate
```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
const certificate: network.ICert = {
domain: 'example.com',
validFrom: { day: 1, month: 1, year: 2023 },
validTo: { day: 1, month: 1, year: 2024 },
issuer: 'Let\'s Encrypt',
certificateBody: '-----BEGIN CERTIFICATE-----\n...'
};
```
### 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.
@ -141,4 +151,4 @@ 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.
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,6 +3,6 @@
*/
export const commitinfo = {
name: '@tsclass/tsclass',
version: '8.0.0',
version: '9.2.0',
description: 'Provides TypeScript definitions for various business, financial, networking, content, and other common classes.'
}

View File

@ -47,14 +47,38 @@ export type TPerson = TContactEnvelope<
};
}
>;
type TCompanyInCreation = {
status: "planned" | "founding";
};
type TCompanyActive = {
status: "active";
foundedDate: general.IDate;
};
type TCompanyInLiquidation = {
status: "liquidation";
foundedDate: general.IDate;
liquidationDate: general.IDate;
};
type TCompanyClosed = {
status: "closed";
foundedDate: general.IDate;
liquidationDate: general.IDate;
closedDate: general.IDate;
};
type TCompanyStatus =
| TCompanyInCreation
| TCompanyActive
| TCompanyInLiquidation
| TCompanyClosed;
export type TCompany = TContactEnvelope<
"company",
{
registrationDetails: TRegistrationDetails;
foundedDate: general.IDate;
closedDate: general.IDate;
status: "planned" | "founding" | "active" | "liquidation" | "closed";
}
{ registrationDetails: TRegistrationDetails } & TCompanyStatus
>;
export type TContact = TPerson | TCompany;

View File

@ -1,17 +1,124 @@
import * as finance from "../finance/index.js";
import { type TContact } from "./contact.js";
export class IJob {
type: "contract" | "employment";
techTags?: string[];
qualificationTags?: string[];
languages?: {
name: string;
level: "basic" | "intermediate" | "advanced" | "native";
}[];
/**
* Represents the type of employment contract
*/
export type TContractType =
| 'full-time'
| 'part-time'
| 'contract'
| 'freelance'
| 'internship'
| 'apprenticeship'
| 'volunteer'
| 'temporary'
| 'seasonal';
/**
* Represents the work location arrangement
*/
export type TWorkLocationType =
| 'on-site'
| 'hybrid'
| 'remote';
/**
* Represents the experience level required for the job
*/
export type TExperienceLevel =
| 'entry'
| 'mid'
| 'senior'
| 'executive';
/**
* Represents the status of a job posting
*/
export type TJobStatus =
| 'active'
| 'closed'
| 'expired'
| 'filled'
| 'archived';
/**
* Language proficiency levels
*/
export type TLanguageProficiency =
| 'basic'
| 'intermediate'
| 'advanced'
| 'native';
/**
* Represents a language requirement with name and proficiency level
*/
export interface ILanguageRequirement {
name: string;
description: string;
monthlyTotal: number;
currency: finance.TCurrency;
from: TContact;
contact: TContact;
level: TLanguageProficiency;
}
/**
* Represents salary information with structure if needed
*/
export interface ISalaryInfo {
min?: number;
max?: number;
currency?: finance.TCurrency;
period?: 'hourly' | 'daily' | 'weekly' | 'monthly' | 'annually';
}
/**
* Represents a record in the job history
*/
export interface IJobHistory {
timestamp: string;
source: string;
category?: string;
action?: string;
details?: string;
}
/**
* Universal Job Interface representing a job posting
*/
export interface IJob {
// Core job information
id: string;
title: string;
company: string;
description: string;
url: string;
// Location information
location: string;
locationType?: TWorkLocationType;
// Dates
postedDate?: string;
// Compensation
salary?: ISalaryInfo;
// Classification
contractType?: TContractType;
category?: string;
experienceLevel?: TExperienceLevel;
// Skills and requirements
skillTags?: string[];
qualificationTags?: string[];
languages?: ILanguageRequirement[];
// Contact information
from?: TContact;
contact?: TContact;
// Metadata
source: string;
status: TJobStatus;
firstScrapedAt: string;
lastScrapedAt: string;
history: IJobHistory[];
}

View File

@ -51,15 +51,4 @@ export type TLetterEnvelope<TYPE extends string, FIELDS> = business.TDocumentEnv
export type TLetterSimple = TLetterEnvelope<"simple", {}>;
export type TLetter = TLetterSimple;
// type: "invoice" | "notice" | "warning" | "verification" | "contract";
/* content: {
textData: string[];
invoiceData?: finance.IInvoice;
contractData?: {
id: string;
contractDate: number;
};
timesheetData: string;
}; */
export type TLetter = TLetterSimple | finance.TInvoice

10
ts/descriptors/index.ts Normal file
View File

@ -0,0 +1,10 @@
export type { IMongoDescriptor } from '../database/index.js';
export interface ICloudflareDescriptor {
authToken: string;
};
export interface ILetterExpressDescriptor {
email: string,
apiToken: string,
}

4
ts/descriptors/readme.md Normal file
View File

@ -0,0 +1,4 @@
# Decriptors
Descriptors describe something common. In the context of tsclass we specifically use it as a term to describe connection info.
Most of the descriptors here are aliases.

206
ts/finance/accountingdoc.ts Normal file
View File

@ -0,0 +1,206 @@
import { business, finance } from '../index.js';
import type { TCurrency } from './currency.js';
/**
* Status of an accounting document
*
* draft: Document is in preparation (Entwurf)
* issued: Document has been issued/sent (Ausgestellt)
* paid: Document has been paid (Bezahlt)
* canceled: Document has been canceled (Storniert)
* refunded: Payment has been refunded (Erstattet)
*/
export type TAccountingDocStatus = 'draft' | 'issued' | 'paid' | 'canceled' | 'refunded';
/**
* Type of accounting document
*
* invoice: Standard invoice (Rechnung)
* creditnote: Credit note (Gutschrift als Rechnungskorrektur)
* debitnote: Debit note (Lastschrift/Belastungsanzeige)
* self-billed-invoice: Self-billed invoice (Gutschrift im Gutschriftverfahren)
*/
export type TAccountingDocType = 'invoice' | 'creditnote' | 'debitnote' | 'self-billed-invoice';
/**
* Item in an accounting document
* (Position in einer Rechnung/Gutschrift/Lastschrift)
*/
export type TAccountingDocItem = {
position: number;
name: string;
articleNumber?: string;
unitType: string;
unitQuantity: number;
unitNetPrice: number;
vatPercentage: number;
};
/**
* Reference to a related document
* (Referenz zu einem zugehörigen Dokument)
*/
export type TRelatedDocument = {
/**
* Type of relationship
* (Art der Beziehung)
*/
relationType: 'corrects' | 'replaces' | 'references';
/**
* ID of the related document
* (ID des zugehörigen Dokuments)
*/
documentId: string;
/**
* Issue date of the related document
* (Ausstellungsdatum des zugehörigen Dokuments)
*/
issueDate?: number;
};
/**
* Base type for all accounting documents (Basis-Typ für alle Buchungsdokumente)
*/
export type TAccountingDocEnvelope<
TYPE extends TAccountingDocType,
FIELDS,
> = business.TLetterEnvelope<
'accounting-doc',
{
/**
* Unique identifier of the accounting document
* (Eindeutige Kennung des Buchungsdokuments)
*/
accountingDocId: string;
/**
* Type of accounting document
* (Art des Buchungsdokuments)
*/
accountingDocType: TYPE;
/**
* Current status of the accounting document
* (Aktueller Status des Buchungsdokuments)
*/
accountingDocStatus: TAccountingDocStatus;
/**
* Line items of the accounting document
* (Positionen des Buchungsdokuments)
*/
items: TAccountingDocItem[];
/**
* Period of performance/service delivery
* (Leistungszeitraum)
*/
periodOfPerformance?: {
from: number;
to: number;
};
/**
* Date of delivery or service completion
* (Lieferdatum oder Leistungsdatum)
*/
deliveryDate?: number;
/**
* Payment due in days after issue
* (Zahlungsfrist in Tagen)
*/
dueInDays: number;
/**
* Whether reverse charge applies (VAT liability shifted to recipient)
* (Steuerschuldnerschaft des Leistungsempfängers)
*/
reverseCharge: boolean;
/**
* Reference provided by the buyer to identify the document
* (Referenz des Käufers zur Identifizierung des Dokuments)
*/
buyerReference?: string;
/**
* Electronic address information, needed for CII/XRechnung support
* (Elektronische Adressinformationen, benötigt für CII/XRechnung)
*/
electronicAddress?: {
scheme: string;
value: string;
};
/**
* References to related documents (e.g., an invoice referenced by a credit note)
* (Referenzen zu zugehörigen Dokumenten)
*/
relatedDocuments?: TRelatedDocument[];
/**
* Result of document printing/generation
* (Ergebnis der Dokumentenerstellung)
*/
printResult?: {
pdfBufferString: string;
totalNet: number;
totalGross: number;
vatGroups: {
percentage: number;
items: TAccountingDocItem[];
}[];
};
/**
* Additional notes or comments
* (Zusätzliche Anmerkungen oder Kommentare)
*/
notes: string[];
/**
* Payment options information
* (Zahlungsoptionen)
*/
paymentOptions?: finance.IPaymentOptionInfo;
/**
* Currency used in the document
* (Verwendete Währung)
*/
currency: TCurrency;
} & FIELDS
>;
/**
* Credit Note - document reducing amount owed
* (Gutschrift - Dokument zur Minderung einer Forderung)
*/
export type TCreditNote = TAccountingDocEnvelope<'creditnote', {}>;
/**
* Debit Note - document increasing amount owed
* (Lastschrift/Belastungsanzeige - Dokument zur Erhöhung einer Forderung)
*/
export type TDebitNote = TAccountingDocEnvelope<'debitnote', {}>;
/**
* Standard Invoice
* (Standardrechnung)
*/
export type TInvoice = TAccountingDocEnvelope<'invoice', {}>;
/**
* Self-billed Invoice - invoice created by the buyer
* (Gutschrift im Gutschriftverfahren - vom Käufer erstellte Rechnung)
*/
export type TSelfBilledInvoice = TAccountingDocEnvelope<'self-billed-invoice', {}>;
/**
* Union type for all accounting document types
* (Vereinigungstyp für alle Buchungsdokumentarten)
*/
export type TAccountingDoc = TCreditNote | TDebitNote | TInvoice | TSelfBilledInvoice;

View File

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

View File

@ -1,62 +0,0 @@
import { business, finance } from '../index.js';
import type { TCurrency } from './currency.js';
export type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
export type TInvoiceItem = {
position: number;
name: string;
articleNumber?: string;
unitType: string;
unitQuantity: number;
unitNetPrice: number;
vatPercentage: number;
}
export type TInvoiceEnvelope<TYPE extends 'creditnote' | 'debitnote', FIELDS> = business.TLetterEnvelope<
'invoice',
{
invoiceId: string;
status: TInvoiceStatus;
type: TYPE;
items: TInvoiceItem[];
periodOfPerformance?: {
from: number;
to: number;
};
deliveryDate?: number;
dueInDays: number;
reverseCharge: boolean;
/**
* 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;
};
printResult?: {
pdfBufferString: string;
totalNet: number;
totalGross: number;
vatGroups: {
percentage: number;
items: TInvoiceItem[];
};
};
notes: string[];
paymentOptions?: finance.IPaymentOptionInfo;
currency: TCurrency;
} & FIELDS
>;
export type TCreditNote = TInvoiceEnvelope<'creditnote', {}>;
export type TDebitNote = TInvoiceEnvelope<'debitnote', {}>;
export type TInvoice = TCreditNote | TDebitNote;
// Legacy type for backward compatibility
export interface IInvoiceItem extends TInvoiceItem {}

View File

@ -9,6 +9,7 @@ export interface IPayPalConnection {
}
export interface IPaymentOptionInfo {
description?: string;
sepaConnection: ISepaConnection;
payPal: IPayPalConnection;
}

View File

@ -10,6 +10,9 @@ import * as container from './container/index.js';
// Database
import * as database from './database/index.js';
// Descriptors
import * as descriptors from './descriptors/index.js';
// Finance
import * as finance from './finance/index.js';
@ -31,7 +34,20 @@ 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, storage, website };
export {
business,
container,
code,
database,
descriptors,
finance,
content,
general,
network,
saas,
storage,
website,
};
import type * as typeFest from 'type-fest';
import * as typeFestOwn from './typefest.own.js';

View File

@ -1,4 +1,4 @@
import { type ICert } from "./cert.js";
import { type ICert } from './cert.js';
export class ICnameDescriptor {
/**
@ -26,4 +26,4 @@ export class ICnameDescriptor {
* the ssl certificate
*/
sslCertificate?: ICert;
};
}

View File

@ -1,24 +1,24 @@
export type TDnsRecordType =
| "A"
| "AAAA"
| "CNAME"
| "LOC"
| "PTR"
| "MX"
| "NAPTR"
| "NS"
| "SRV"
| "TXT"
| "CAA"
| "CERT"
| "DNSKEY"
| "DS"
| "HTTPS"
| "SMIMEA"
| "SSHFP"
| "SVCB"
| "TLSA"
| "URI";
| '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

@ -0,0 +1,20 @@
import type { IDnsChallenge } from './dnschallenge.js'
export interface IConvenientDnsProvider {
convenience: {
/**
* Create the TXT record for an ACME DNS-01 challenge.
*/
acmeSetDnsChallenge(dnsChallengeArg: IDnsChallenge): Promise<void>;
/**
* Remove the TXT record for an ACME DNS-01 challenge.
*/
acmeRemoveDnsChallenge(dnsChallengeArg: IDnsChallenge): Promise<void>;
/**
* Check whether this DNS provider can serve the given domain.
*/
isDomainSupported(domain: string): Promise<boolean>;
};
}

View File

@ -3,6 +3,7 @@ export * from './cname.js';
export * from './device.js';
export * from './dns.js';
export * from './dnschallenge.js';
export * from './dnsconvenience.js';
export * from './domaindelegation.js';
export * from './jwt.js';
export * from './networknode.js';

View File

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

View File

@ -2,4 +2,4 @@ export interface ISshKey {
keyName: string;
public: string;
private?: string;
}
}

View File

@ -1,11 +1,11 @@
import type { TCompany } from "../business/contact.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;

View File

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

View File

@ -4,4 +4,4 @@ export interface ILink {
description?: string;
icon?: string;
target?: '_blank' | '_self' | '_parent' | '_top';
}
}

View File

@ -6,9 +6,11 @@
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
"verbatimModuleSyntax": true,
"baseUrl": ".",
"paths": {}
},
"exclude": [
"dist_*/**/*.d.ts"
]
}
}