185 lines
5.3 KiB
Markdown
185 lines
5.3 KiB
Markdown
# @signature.digital/tools
|
|
|
|
A TypeScript package providing utility interfaces and classes for efficient digital contract management and business context integration with a modular design. 📝
|
|
|
|
## Issue Reporting and Security
|
|
|
|
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
|
|
|
## Install
|
|
|
|
Install using your preferred package manager:
|
|
|
|
```bash
|
|
# Using pnpm (recommended)
|
|
pnpm add @signature.digital/tools
|
|
|
|
# Using npm
|
|
npm install @signature.digital/tools
|
|
```
|
|
|
|
## Usage
|
|
|
|
This package provides TypeScript interfaces for modeling digital contracts with support for roles, paragraphs, and involved parties.
|
|
|
|
### Core Interfaces
|
|
|
|
The package exports these key interfaces:
|
|
|
|
```typescript
|
|
import type {
|
|
IPortableContract,
|
|
IRole,
|
|
IInvolvedParty,
|
|
IParagraph,
|
|
} from '@signature.digital/tools';
|
|
```
|
|
|
|
### Interface Overview
|
|
|
|
#### `IPortableContract`
|
|
|
|
The main contract interface containing:
|
|
|
|
- `title` - Contract title
|
|
- `context` - Description of the contract context
|
|
- `availableRoles` - Array of available roles
|
|
- `involvedParties` - Parties involved with their contacts
|
|
- `priorContracts` - Reference to preceding contracts
|
|
- `paragraphs` - Contract content sections
|
|
|
|
#### `IRole`
|
|
|
|
Defines a role within the contract:
|
|
|
|
```typescript
|
|
interface IRole {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
}
|
|
```
|
|
|
|
#### `IParagraph`
|
|
|
|
Represents a contract section:
|
|
|
|
```typescript
|
|
interface IParagraph {
|
|
uniqueId: string;
|
|
parent: IParagraph | null;
|
|
title: string;
|
|
content: string;
|
|
}
|
|
```
|
|
|
|
#### `IInvolvedParty`
|
|
|
|
Links a role to a contact:
|
|
|
|
```typescript
|
|
interface IInvolvedParty {
|
|
role: string;
|
|
contact: TContact; // from @tsclass/tsclass
|
|
}
|
|
```
|
|
|
|
### Example: Creating a Contract
|
|
|
|
```typescript
|
|
import type {
|
|
IPortableContract,
|
|
IRole,
|
|
IParagraph,
|
|
} from '@signature.digital/tools';
|
|
|
|
const roles: IRole[] = [
|
|
{
|
|
id: 'employer',
|
|
name: 'Employer',
|
|
description: 'The party offering the position.',
|
|
},
|
|
{
|
|
id: 'employee',
|
|
name: 'Employee',
|
|
description: 'The party accepting the position.',
|
|
},
|
|
];
|
|
|
|
const paragraphs: IParagraph[] = [
|
|
{
|
|
uniqueId: '1',
|
|
parent: null,
|
|
title: 'Introduction',
|
|
content: 'This contract outlines the terms of employment.',
|
|
},
|
|
{
|
|
uniqueId: '2',
|
|
parent: null,
|
|
title: 'Scope of Work',
|
|
content: 'The employee will perform the following duties...',
|
|
},
|
|
];
|
|
|
|
const contract: IPortableContract = {
|
|
title: 'Employment Contract',
|
|
context: 'Standard employment agreement',
|
|
availableRoles: roles,
|
|
involvedParties: [
|
|
{ role: 'employer', contact: null },
|
|
{ role: 'employee', contact: null },
|
|
],
|
|
priorContracts: [],
|
|
paragraphs,
|
|
};
|
|
```
|
|
|
|
### Using Demo Data
|
|
|
|
The package includes demo data for testing and development:
|
|
|
|
```typescript
|
|
import { demoContract } from '@signature.digital/tools/demodata';
|
|
|
|
console.log(demoContract.title); // "Minijob Employment Contract"
|
|
```
|
|
|
|
### Separate Interface Import
|
|
|
|
You can import just the interfaces without the full package:
|
|
|
|
```typescript
|
|
import type { IPortableContract } from '@signature.digital/tools/interfaces';
|
|
```
|
|
|
|
## Module Exports
|
|
|
|
The package provides three entry points:
|
|
|
|
| Entry Point | Description |
|
|
| ------------------------------------- | ------------------------------- |
|
|
| `@signature.digital/tools` | Main export with all interfaces |
|
|
| `@signature.digital/tools/interfaces` | Interface definitions only |
|
|
| `@signature.digital/tools/demodata` | Demo contract data |
|
|
|
|
## License and Legal Information
|
|
|
|
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
|
|
|
|
**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 or third parties, 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 or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
|
|
|
### Company Information
|
|
|
|
Task Venture Capital GmbH
|
|
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
|
|
For any legal inquiries or 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.
|