Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
254eafc007 | |||
12f183e8f2 | |||
f93daa90ae | |||
dfae08f3b1 | |||
7b419d4ed6 | |||
5d342bc43f | |||
9717989831 | |||
8cfaad2071 | |||
339c41c259 | |||
bf6b323df5 |
33
changelog.md
33
changelog.md
@ -1,5 +1,38 @@
|
||||
# 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
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tsclass/tsclass",
|
||||
"version": "8.1.1",
|
||||
"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",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@tsclass/tsclass',
|
||||
version: '8.1.1',
|
||||
version: '9.2.0',
|
||||
description: 'Provides TypeScript definitions for various business, financial, networking, content, and other common classes.'
|
||||
}
|
||||
|
@ -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[];
|
||||
}
|
10
ts/descriptors/index.ts
Normal file
10
ts/descriptors/index.ts
Normal 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
4
ts/descriptors/readme.md
Normal 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
206
ts/finance/accountingdoc.ts
Normal 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;
|
@ -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';
|
||||
|
@ -1,65 +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;
|
||||
invoiceType: TYPE;
|
||||
status: TInvoiceStatus;
|
||||
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 {}
|
@ -9,6 +9,7 @@ export interface IPayPalConnection {
|
||||
}
|
||||
|
||||
export interface IPaymentOptionInfo {
|
||||
description?: string;
|
||||
sepaConnection: ISepaConnection;
|
||||
payPal: IPayPalConnection;
|
||||
}
|
||||
|
@ -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';
|
||||
|
||||
@ -36,6 +39,7 @@ export {
|
||||
container,
|
||||
code,
|
||||
database,
|
||||
descriptors,
|
||||
finance,
|
||||
content,
|
||||
general,
|
||||
|
20
ts/network/dnsconvenience.ts
Normal file
20
ts/network/dnsconvenience.ts
Normal 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>;
|
||||
};
|
||||
}
|
@ -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';
|
||||
|
Reference in New Issue
Block a user