fix(project): Corrected misalignment in file structure and package metadata.

This commit is contained in:
Philipp Kunz 2024-12-18 20:31:19 +01:00
parent 12eba17c7c
commit 2078c6c7c8
7 changed files with 208 additions and 34 deletions

View File

@ -1,5 +1,13 @@
# Changelog # Changelog
## 2024-12-18 - 1.0.7 - fix(project)
Corrected misalignment in file structure and package metadata.
- Updated the file export path in ts/index.ts to correct interface export location.
- Transferred the interfaces from ts/interfaces/index.ts to ts_interfaces/index.ts maintaining consistency in folder structure.
- Synchronized package description and keywords between package.json and npmextra.json.
- Ensured proper build script path in package.json.
## 2024-12-18 - 1.0.6 - fix(core) ## 2024-12-18 - 1.0.6 - fix(core)
No code changes detected. No code changes detected.

View File

@ -5,10 +5,23 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "signature.digital", "gitscope": "signature.digital",
"gitrepo": "tools", "gitrepo": "tools",
"description": "a package that defines standard tools for working with contracts.", "description": "A TypeScript package providing utility interfaces and classes for digital contract management and integration, leveraging modular design and business context integration.",
"npmPackagename": "@signature.digital/tools", "npmPackagename": "@signature.digital/tools",
"license": "MIT", "license": "MIT",
"projectDomain": "signature.digital" "projectDomain": "signature.digital",
"keywords": [
"TypeScript",
"digital contracts",
"contract management",
"ESM",
"interfaces",
"business integration",
"modular design",
"contract modeling",
"business relationships",
"data handling",
"TypeScript utilities"
]
} }
}, },
"npmci": { "npmci": {

View File

@ -2,7 +2,7 @@
"name": "@signature.digital/tools", "name": "@signature.digital/tools",
"version": "1.0.6", "version": "1.0.6",
"private": false, "private": false,
"description": "a package that defines standard tools for working with contracts.", "description": "A TypeScript package providing utility interfaces and classes for digital contract management and integration, leveraging modular design and business context integration.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module", "type": "module",
@ -10,7 +10,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web --allowimplicitany)", "build": "(tsbuild tsfolders --web --allowimplicitany)",
"buildDocs": "(tsdoc)" "buildDocs": "(tsdoc)"
}, },
"devDependencies": { "devDependencies": {
@ -46,5 +46,18 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"keywords": [
"TypeScript",
"digital contracts",
"contract management",
"ESM",
"interfaces",
"business integration",
"modular design",
"contract modeling",
"business relationships",
"data handling",
"TypeScript utilities"
] ]
} }

190
readme.md
View File

@ -1,31 +1,171 @@
# @signature.digital/portablecontract # @signature.digital/tools
a package that defines standard tools for working with contracts.
## Availabililty and Links A package that defines standard tools for working with contracts.
* [npmjs.org (npm package)](https://www.npmjs.com/package/@signature.digital/portablecontract)
* [gitlab.com (source)](https://gitlab.com/signature.digital/portablecontract)
* [github.com (source mirror)](https://github.com/signature.digital/portablecontract)
* [docs (typedoc)](https://signature.digital.gitlab.io/portablecontract/)
## Status for master ## Install
Status Category | Status Badge To install `@signature.digital/tools`, you'll use your preferred package manager. Assuming you're using npm, follow the steps below:
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/signature.digital/portablecontract/badges/master/pipeline.svg)](https://lossless.cloud) ```bash
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/signature.digital/portablecontract/badges/master/coverage.svg)](https://lossless.cloud) npm install @signature.digital/tools
npm | [![npm downloads per month](https://badgen.net/npm/dy/@signature.digital/portablecontract)](https://lossless.cloud) ```
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/signature.digital/portablecontract)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) Or, if you prefer using Yarn:
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) ```bash
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@signature.digital/portablecontract)](https://lossless.cloud) yarn add @signature.digital/tools
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@signature.digital/portablecontract)](https://lossless.cloud) ```
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@signature.digital/portablecontract)](https://lossless.cloud)
Make sure that you have Node.js installed on your system to use this package. The module is distributed as an ECMAScript Module (ESM), so you'll need a strategy for dealing with ESM in your project if you're using commonjs modules. As usual, ensure that your TypeScript configuration (`tsconfig.json`) has `"module": "ESNext"` or similar settings that support ESM.
## Usage ## Usage
Use TypeScript for best in class intellisense
For further information read the linked docs at the top of this readme.
## Legal ### Overview
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) `@signature.digital/tools` provides a set of interfaces and classes that serve as general utilities for working with contracts digitalization, management, and integration. With a focus on adaptability and ease of use in TypeScript projects, its toolset leverages types, interfaces, and utilities from the `@tsclass/tsclass` package to enhance contract structures. This package aims to facilitate the definition and handling of contractual data, enabling the modeling of business relationships and agreements as TypeScript objects.
### Core Concepts
Before diving into the various tools provided by this package, let's establish a few foundational concepts:
1. **Interface Driven Design:**
The module uses TypeScript interfaces as blueprints for structuring custom contract models. Interfaces such as `IPortableContract`, `IParagraph`, `IRole`, and `IInvolvedParty` are integral to the way data is defined and manipulated.
2. **Modularity:**
This package allows developers to segment responsibilities and logic by modularizing contract components into roles, paragraphs, parties, and related structures.
3. **Business Context Integration:**
Through integration with `@tsclass/tsclass`, the module facilitates the inclusion of business-related metadata into contracts, aligning with typical business use cases such as defining involved parties and their roles.
### Usage Scenarios
#### Defining a Contract
A `IPortableContract` is at the heart of this package. It encapsulates crucial details about a contract such as title, context, roles, parties involved, prior related contracts, and structured paragraphs or sections.
```typescript
import { IPortableContract, IRole, IInvolvedParty, IParagraph } from '@signature.digital/tools';
import { tsclass } from '@signature.digital/tools';
const legalRole: IRole = {
id: 'role-001',
name: 'Legal Advisor',
description: 'Provides legal counsel and insights on contractual obligations.'
};
const stakeholderRole: IRole = {
id: 'role-002',
name: 'Stakeholder',
description: 'Has a stake in the contract outcomes and implications.'
};
const legalAdvisorContact: tsclass.business.IContact = {
email: 'legal@firm.domain',
address: '456 Legal Ave, Lawyersville'
};
const stakeholderContact: tsclass.business.IContact = {
email: 'stakeholder@domain.org',
address: '789 Stakeholder Loop, Business City'
};
const involvedParties: IInvolvedParty[] = [
{
role: legalRole.name,
contact: legalAdvisorContact
},
{
role: stakeholderRole.name,
contact: stakeholderContact
}
];
const introductoryParagraph: IParagraph = {
uniqueId: 'para-001',
parent: null,
title: 'Introduction',
content: 'This section provides an introduction to the contract, detailing its purpose and significance.'
};
const commitmentParagraph: IParagraph = {
uniqueId: 'para-002',
parent: introductoryParagraph,
title: 'Commitments',
content: 'Describes the commitments of the involved parties.'
};
const contract: IPortableContract = {
title: 'Digital Service Agreement',
context: 'Provides a framework of service delivery between involved entities.',
availableRoles: [legalRole, stakeholderRole],
involvedParties,
priorContracts: [],
paragraphs: [introductoryParagraph, commitmentParagraph]
};
console.log(contract);
```
### Validating Contracts
Regarding validation, this package utilizes `@tsclass/tsclass` to enhance the consistency and robustness of contact data handling. While not embedding specific validation methods, this encourages the integration of validation strategies that developers can extend or implement themselves.
### Extending the Interfaces
Developers are encouraged to extend the interfaces to accommodate additional requirements.
```typescript
interface IExtendedContract extends IPortableContract {
effectiveDate: Date;
expirationDate: Date;
}
const extendedContract: IExtendedContract = {
...contract,
effectiveDate: new Date('2023-01-01'),
expirationDate: new Date('2025-01-01')
};
```
### Handling Prior Contracts
The `priorContracts` property allows you to model contract inheritance or reference, enabling historical traceability or derivations.
```typescript
const previousContract: IPortableContract = {
title: 'Precedent Service Agreement',
context: 'Sets a precedent for the current agreement.',
availableRoles: [legalRole, stakeholderRole],
involvedParties,
priorContracts: [],
paragraphs: []
};
const referencedContract: IPortableContract = {
...contract,
priorContracts: [previousContract]
};
console.log(referencedContract);
```
### Integrating Business Features
The built-in synergy with `@tsclass/tsclass` permits a natural extension to business contact data directly within the contracts.
```typescript
const newInvolvedParty: IInvolvedParty = {
role: 'Project Manager',
contact: {
email: 'manager@domain.com',
address: '101 Managerial Blvd, Operationscity'
}
};
contract.involvedParties.push(newInvolvedParty);
```
### Conclusion
The `@signature.digital/tools` package is designed to provide the essential scaffolding necessary to build intricate, business-oriented contract models while ensuring TypeScript's static type safety. Its major strength lies in its extensibility and the clarity it brings to contract structures, making modeling, data management, and integration straightforward for any digital contract-centric application. Adopt these tools to facilitate the standardized crafting of contract-based solutions across your enterprise applications.
undefined

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@signature.digital/tools', name: '@signature.digital/tools',
version: '1.0.6', version: '1.0.7',
description: 'a package that defines standard tools for working with contracts.' description: 'A TypeScript package providing utility interfaces and classes for digital contract management and integration, leveraging modular design and business context integration.'
} }

View File

@ -1 +1 @@
export * from './interfaces/index.js'; export * from '../ts_interfaces/index.js';

View File

@ -1,4 +1,4 @@
import * as plugins from '../portablecontract.plugins.js'; import * as plugins from '../ts/portablecontract.plugins.js';
export interface IParagraph { export interface IParagraph {
uniqueId: string; uniqueId: string;