Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f46d8a54cd | |||
| 4f08d09552 | |||
| 4bd61aed70 | |||
| e5ca606e3c | |||
| 2f97b407a2 | |||
| 6f60cb216d | |||
| e68524bc19 | |||
| daad17354d | |||
| c01c1904cf | |||
| 7bb1b22ea6 | |||
| 5d275dd9d5 | |||
| 871ed4fc91 |
@@ -6,19 +6,19 @@ on:
|
||||
- '**'
|
||||
|
||||
env:
|
||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{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}}
|
||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${-{gitea.repository_owner}-}:${-{secrets.GITEA_TOKEN}-}@{{module.githost}}/${-{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 }}
|
||||
image: ${-{ env.IMAGE }-}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Install pnpm and npmci
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @shipzone/npmci
|
||||
pnpm install -g @ship.zone/npmci
|
||||
|
||||
- name: Run npm prepare
|
||||
run: npmci npm prepare
|
||||
@@ -44,11 +44,11 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
test:
|
||||
if: ${{ always() }}
|
||||
if: ${-{ always() }-}
|
||||
needs: security
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
image: ${-{ env.IMAGE }-}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -6,19 +6,19 @@ on:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{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}}
|
||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${-{gitea.repository_owner}-}:${-{secrets.GITEA_TOKEN}-}@{{module.githost}}/${-{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 }}
|
||||
image: ${-{ env.IMAGE }-}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @shipzone/npmci
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Audit production dependencies
|
||||
@@ -42,11 +42,11 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
test:
|
||||
if: ${{ always() }}
|
||||
if: ${-{ always() }-}
|
||||
needs: security
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
image: ${-{ env.IMAGE }-}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @shipzone/npmci
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Test stable
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
image: ${-{ env.IMAGE }-}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @shipzone/npmci
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Release
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
image: ${-{ env.IMAGE }-}
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @shipzone/npmci
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Code quality
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -3,7 +3,6 @@
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
@@ -17,4 +16,8 @@ node_modules/
|
||||
dist/
|
||||
dist_*/
|
||||
|
||||
# custom
|
||||
# AI
|
||||
.claude/
|
||||
.serena/
|
||||
|
||||
#------# custom
|
||||
|
||||
49
changelog.md
49
changelog.md
@@ -1,6 +1,51 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-12-18 - 1.2.0 - feat(tools)
|
||||
add demodata feature, update package metadata, tsconfig paths, CI/workflows, and bump deps
|
||||
|
||||
- Add demodata subpackage (@signature.digital/demodata) and export entry
|
||||
- Introduce tsconfig path aliases for @signature.digital/tools, @signature.digital/demodata, and @signature.digital/interfaces
|
||||
- Update package.json metadata (repository, bugs, homepage), add pnpm overrides, and bump dev/deps (@git.zone/tsbuild, @git.zone/tstest, @tsclass/tsclass)
|
||||
- Rename and configure tspublish.json files to include package names and registries for publishing
|
||||
- Fix interfaces: change IInvolvedParty.contact type to plugins.tsclass.business.TContact
|
||||
- Update tests to use @git.zone/tstest/tapbundle and export tap.start()
|
||||
- Revise CI workflow files to use code.foss.global image, new secret placeholder formatting, and @ship.zone/npmci package name
|
||||
- Rework npmextra.json structure and add release registries and szci config
|
||||
- Update README and changelog content and add minor .gitignore entries for AI tools
|
||||
|
||||
## 2024-12-19 - 1.1.0 - feat(demodata)
|
||||
|
||||
Add demo data feature for contracts
|
||||
|
||||
- Introduced demo contract data for Minijob Employment Contract outlining details for employer and employee roles.
|
||||
- Enhanced package.json with new export entry for demodata.
|
||||
- Implemented new ts_demodata directory with sample contract representation.
|
||||
|
||||
## 2024-12-19 - 1.0.11 - fix(interfaces)
|
||||
|
||||
Fixed import path in ts_interfaces/index.ts
|
||||
|
||||
- Corrected import path for plugins in ts_interfaces/index.ts to prevent module resolution issues.
|
||||
|
||||
## 2024-12-18 - 1.0.10 - fix(test)
|
||||
|
||||
Add initial test for portablecontract
|
||||
|
||||
## 2024-12-18 - 1.0.9 - fix(ts_interfaces)
|
||||
|
||||
Resolved missing exports in plugins.ts
|
||||
|
||||
- Added export statements in ts_interfaces/plugins.ts to resolve module issues.
|
||||
|
||||
## 2024-12-18 - 1.0.8 - fix(core)
|
||||
|
||||
Fixed export paths in package configuration
|
||||
|
||||
- Updated exports paths in package.json for proper module resolution.
|
||||
- Fixed export statement in ts/index.ts to reference the correct path for interface exports.
|
||||
|
||||
## 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.
|
||||
@@ -9,10 +54,11 @@ Corrected misalignment in file structure and package metadata.
|
||||
- Ensured proper build script path in package.json.
|
||||
|
||||
## 2024-12-18 - 1.0.6 - fix(core)
|
||||
|
||||
No code changes detected.
|
||||
|
||||
|
||||
## 2024-12-18 - 1.0.5 - fix(core)
|
||||
|
||||
Corrected package and npm extra configuration to ensure consistent naming.
|
||||
|
||||
- Updated 'name' field in package.json from '@signature.digital/portablecontract' to '@signature.digital/tools'.
|
||||
@@ -20,6 +66,7 @@ Corrected package and npm extra configuration to ensure consistent naming.
|
||||
- Updated 'npmPackagename' in npmextra.json from '@signature.digital/portablecontract' to '@signature.digital/tools'.
|
||||
|
||||
## 2023-11-22 to 2023-11-28 - 1.0.1 to 1.0.4 - core updates
|
||||
|
||||
Fixes and updates in the core component.
|
||||
|
||||
- Updated core module to enhance performance and fix minor bugs in version 1.0.1
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"gitzone": {
|
||||
"@git.zone/cli": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "signature.digital",
|
||||
"gitrepo": "tools",
|
||||
"description": "A TypeScript package providing utility interfaces and classes for digital contract management and integration, leveraging modular design and business context integration.",
|
||||
"description": "A TypeScript package providing utilities for managing digital contracts with modular interfaces and business context integration.",
|
||||
"npmPackagename": "@signature.digital/tools",
|
||||
"license": "MIT",
|
||||
"projectDomain": "signature.digital",
|
||||
@@ -13,19 +13,30 @@
|
||||
"TypeScript",
|
||||
"digital contracts",
|
||||
"contract management",
|
||||
"ESM",
|
||||
"interfaces",
|
||||
"business integration",
|
||||
"modular design",
|
||||
"business integration",
|
||||
"interfaces",
|
||||
"typescript utilities",
|
||||
"contract structures",
|
||||
"interfaces-driven architecture",
|
||||
"contract modeling",
|
||||
"business relationships",
|
||||
"data handling",
|
||||
"TypeScript utilities"
|
||||
"asynchronous loading",
|
||||
"dynamic role assignment",
|
||||
"contract validation",
|
||||
"unit testing"
|
||||
]
|
||||
},
|
||||
"release": {
|
||||
"registries": ["https://verdaccio.lossless.digital"],
|
||||
"accessLevel": "public"
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
"@git.zone/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"
|
||||
},
|
||||
"@ship.zone/szci": {
|
||||
"npmGlobalTools": []
|
||||
}
|
||||
}
|
||||
48
package.json
48
package.json
@@ -1,10 +1,13 @@
|
||||
{
|
||||
"name": "@signature.digital/tools",
|
||||
"version": "1.0.7",
|
||||
"version": "1.2.0",
|
||||
"private": false,
|
||||
"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",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"description": "A TypeScript package providing utilities for managing digital contracts with modular interfaces and business context integration.",
|
||||
"exports": {
|
||||
".": "./ts/index.js",
|
||||
"./interfaces": "./dist_ts_interfaces/index.js",
|
||||
"./demodata": "./dist_ts_demodata/index.js"
|
||||
},
|
||||
"type": "module",
|
||||
"author": "Task Venture Capital GmbH",
|
||||
"license": "MIT",
|
||||
@@ -14,24 +17,23 @@
|
||||
"buildDocs": "(tsdoc)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^2.1.25",
|
||||
"@git.zone/tsbundle": "^2.0.5",
|
||||
"@git.zone/tsrun": "^1.2.46",
|
||||
"@git.zone/tstest": "^1.0.44",
|
||||
"@push.rocks/tapbundle": "^5.0.15",
|
||||
"@types/node": "^20.8.7"
|
||||
"@git.zone/tsbuild": "^2.6.1",
|
||||
"@git.zone/tsbundle": "^2.1.0",
|
||||
"@git.zone/tsrun": "^1.3.3",
|
||||
"@git.zone/tstest": "^1.0.96",
|
||||
"@types/node": "^22.10.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tsclass/tsclass": "^4.0.46"
|
||||
"@tsclass/tsclass": "^9.3.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitlab.com/signature.digital/portablecontract.git"
|
||||
"url": "https://gitlab.com/signature.digital/tools.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/signature.digital/portablecontract/issues"
|
||||
"url": "https://gitlab.com/signature.digital/tools/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/signature.digital/portablecontract#readme",
|
||||
"homepage": "https://gitlab.com/signature.digital/tools#readme",
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
],
|
||||
@@ -51,13 +53,21 @@
|
||||
"TypeScript",
|
||||
"digital contracts",
|
||||
"contract management",
|
||||
"ESM",
|
||||
"interfaces",
|
||||
"business integration",
|
||||
"modular design",
|
||||
"business integration",
|
||||
"interfaces",
|
||||
"typescript utilities",
|
||||
"contract structures",
|
||||
"interfaces-driven architecture",
|
||||
"contract modeling",
|
||||
"business relationships",
|
||||
"data handling",
|
||||
"TypeScript utilities"
|
||||
]
|
||||
"asynchronous loading",
|
||||
"dynamic role assignment",
|
||||
"contract validation",
|
||||
"unit testing"
|
||||
],
|
||||
"pnpm": {
|
||||
"overrides": {}
|
||||
}
|
||||
}
|
||||
|
||||
11816
pnpm-lock.yaml
generated
11816
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
255
readme.md
255
readme.md
@@ -1,171 +1,184 @@
|
||||
# @signature.digital/tools
|
||||
|
||||
A package that defines standard tools for working with contracts.
|
||||
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
|
||||
|
||||
To install `@signature.digital/tools`, you'll use your preferred package manager. Assuming you're using npm, follow the steps below:
|
||||
Install using your preferred package manager:
|
||||
|
||||
```bash
|
||||
# Using pnpm (recommended)
|
||||
pnpm add @signature.digital/tools
|
||||
|
||||
# Using npm
|
||||
npm install @signature.digital/tools
|
||||
```
|
||||
|
||||
Or, if you prefer using Yarn:
|
||||
|
||||
```bash
|
||||
yarn add @signature.digital/tools
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
### Overview
|
||||
This package provides TypeScript interfaces for modeling digital contracts with support for roles, paragraphs, and involved parties.
|
||||
|
||||
`@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 Interfaces
|
||||
|
||||
### 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.
|
||||
The package exports these key interfaces:
|
||||
|
||||
```typescript
|
||||
import { IPortableContract, IRole, IInvolvedParty, IParagraph } from '@signature.digital/tools';
|
||||
import { tsclass } from '@signature.digital/tools';
|
||||
import type {
|
||||
IPortableContract,
|
||||
IRole,
|
||||
IInvolvedParty,
|
||||
IParagraph,
|
||||
} from '@signature.digital/tools';
|
||||
```
|
||||
|
||||
const legalRole: IRole = {
|
||||
id: 'role-001',
|
||||
name: 'Legal Advisor',
|
||||
description: 'Provides legal counsel and insights on contractual obligations.'
|
||||
};
|
||||
### Interface Overview
|
||||
|
||||
const stakeholderRole: IRole = {
|
||||
id: 'role-002',
|
||||
name: 'Stakeholder',
|
||||
description: 'Has a stake in the contract outcomes and implications.'
|
||||
};
|
||||
#### `IPortableContract`
|
||||
|
||||
const legalAdvisorContact: tsclass.business.IContact = {
|
||||
email: 'legal@firm.domain',
|
||||
address: '456 Legal Ave, Lawyersville'
|
||||
};
|
||||
The main contract interface containing:
|
||||
|
||||
const stakeholderContact: tsclass.business.IContact = {
|
||||
email: 'stakeholder@domain.org',
|
||||
address: '789 Stakeholder Loop, Business City'
|
||||
};
|
||||
- `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
|
||||
|
||||
const involvedParties: IInvolvedParty[] = [
|
||||
#### `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[] = [
|
||||
{
|
||||
role: legalRole.name,
|
||||
contact: legalAdvisorContact
|
||||
id: 'employer',
|
||||
name: 'Employer',
|
||||
description: 'The party offering the position.',
|
||||
},
|
||||
{
|
||||
role: stakeholderRole.name,
|
||||
contact: stakeholderContact
|
||||
}
|
||||
id: 'employee',
|
||||
name: 'Employee',
|
||||
description: 'The party accepting the position.',
|
||||
},
|
||||
];
|
||||
|
||||
const introductoryParagraph: IParagraph = {
|
||||
uniqueId: 'para-001',
|
||||
const paragraphs: IParagraph[] = [
|
||||
{
|
||||
uniqueId: '1',
|
||||
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.'
|
||||
};
|
||||
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: 'Digital Service Agreement',
|
||||
context: 'Provides a framework of service delivery between involved entities.',
|
||||
availableRoles: [legalRole, stakeholderRole],
|
||||
involvedParties,
|
||||
title: 'Employment Contract',
|
||||
context: 'Standard employment agreement',
|
||||
availableRoles: roles,
|
||||
involvedParties: [
|
||||
{ role: 'employer', contact: null },
|
||||
{ role: 'employee', contact: null },
|
||||
],
|
||||
priorContracts: [],
|
||||
paragraphs: [introductoryParagraph, commitmentParagraph]
|
||||
paragraphs,
|
||||
};
|
||||
|
||||
console.log(contract);
|
||||
```
|
||||
|
||||
### Validating Contracts
|
||||
### Using Demo Data
|
||||
|
||||
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.
|
||||
The package includes demo data for testing and development:
|
||||
|
||||
```typescript
|
||||
interface IExtendedContract extends IPortableContract {
|
||||
effectiveDate: Date;
|
||||
expirationDate: Date;
|
||||
}
|
||||
import { demoContract } from '@signature.digital/tools/demodata';
|
||||
|
||||
const extendedContract: IExtendedContract = {
|
||||
...contract,
|
||||
effectiveDate: new Date('2023-01-01'),
|
||||
expirationDate: new Date('2025-01-01')
|
||||
};
|
||||
console.log(demoContract.title); // "Minijob Employment Contract"
|
||||
```
|
||||
|
||||
### Handling Prior Contracts
|
||||
### Separate Interface Import
|
||||
|
||||
The `priorContracts` property allows you to model contract inheritance or reference, enabling historical traceability or derivations.
|
||||
You can import just the interfaces without the full package:
|
||||
|
||||
```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);
|
||||
import type { IPortableContract } from '@signature.digital/tools/interfaces';
|
||||
```
|
||||
|
||||
### Integrating Business Features
|
||||
## Module Exports
|
||||
|
||||
The built-in synergy with `@tsclass/tsclass` permits a natural extension to business contact data directly within the contracts.
|
||||
The package provides three entry points:
|
||||
|
||||
```typescript
|
||||
const newInvolvedParty: IInvolvedParty = {
|
||||
role: 'Project Manager',
|
||||
contact: {
|
||||
email: 'manager@domain.com',
|
||||
address: '101 Managerial Blvd, Operationscity'
|
||||
}
|
||||
};
|
||||
| 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 |
|
||||
|
||||
contract.involvedParties.push(newInvolvedParty);
|
||||
```
|
||||
## License and Legal Information
|
||||
|
||||
### Conclusion
|
||||
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
|
||||
|
||||
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
|
||||
**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.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
||||
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||
import * as portablecontract from '../ts/index.js'
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(portablecontract)
|
||||
})
|
||||
|
||||
tap.start()
|
||||
export default tap.start();
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@signature.digital/tools',
|
||||
version: '1.0.7',
|
||||
description: 'A TypeScript package providing utility interfaces and classes for digital contract management and integration, leveraging modular design and business context integration.'
|
||||
version: '1.2.0',
|
||||
description: 'A TypeScript package providing utilities for managing digital contracts with modular interfaces and business context integration.'
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from '../ts_interfaces/index.js';
|
||||
export * from '../dist_ts_interfaces/index.js';
|
||||
@@ -1,3 +1,7 @@
|
||||
// project scope
|
||||
import * as interfaces from '@signature.digital/interfaces';
|
||||
|
||||
// @tsclass scope
|
||||
import * as tsclass from '@tsclass/tsclass';
|
||||
|
||||
export {
|
||||
|
||||
5
ts/tspublish.json
Normal file
5
ts/tspublish.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@signature.digital/tools",
|
||||
"order": 2,
|
||||
"registries": ["useBase"]
|
||||
}
|
||||
49
ts_demodata/democontract.ts
Normal file
49
ts_demodata/democontract.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export const demoContract: plugins.interfaces.IPortableContract = {
|
||||
"title": "Minijob Employment Contract",
|
||||
"context": "This contract is for a Minijob position under German law.",
|
||||
"availableRoles": [
|
||||
{
|
||||
"id": "employer",
|
||||
"name": "Employer",
|
||||
"description": "The party offering the Minijob position."
|
||||
},
|
||||
{
|
||||
"id": "employee",
|
||||
"name": "Employee",
|
||||
"description": "The party accepting the Minijob position."
|
||||
}
|
||||
],
|
||||
"involvedParties": [
|
||||
{
|
||||
"role": "employer",
|
||||
"contact": null
|
||||
},
|
||||
{
|
||||
"role": "employee",
|
||||
"contact": null
|
||||
}
|
||||
],
|
||||
"priorContracts": [],
|
||||
"paragraphs": [
|
||||
{
|
||||
"uniqueId": "1",
|
||||
"parent": null,
|
||||
"title": "Introduction",
|
||||
"content": "This contract outlines the terms of employment for a Minijob position between [Employer Name] and [Employee Name]."
|
||||
},
|
||||
{
|
||||
"uniqueId": "2",
|
||||
"parent": null,
|
||||
"title": "Scope of Work",
|
||||
"content": "The employee will perform the following duties: [List of Duties]."
|
||||
},
|
||||
{
|
||||
"uniqueId": "3",
|
||||
"parent": null,
|
||||
"title": "Compensation",
|
||||
"content": "The employee will be compensated with a monthly salary of [Salary Amount], in accordance with Minijob regulations."
|
||||
}
|
||||
]
|
||||
};
|
||||
1
ts_demodata/index.ts
Normal file
1
ts_demodata/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './democontract.js';
|
||||
5
ts_demodata/plugins.ts
Normal file
5
ts_demodata/plugins.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as interfaces from '@signature.digital/interfaces';
|
||||
|
||||
export {
|
||||
interfaces,
|
||||
}
|
||||
5
ts_demodata/tspublish.json
Normal file
5
ts_demodata/tspublish.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@signature.digital/demodata",
|
||||
"order": 3,
|
||||
"registries": ["useBase"]
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as plugins from '../ts/portablecontract.plugins.js';
|
||||
|
||||
import * as plugins from './plugins.js';
|
||||
export interface IParagraph {
|
||||
uniqueId: string;
|
||||
parent: IParagraph | null;
|
||||
@@ -15,7 +14,7 @@ export interface IRole {
|
||||
|
||||
export interface IInvolvedParty {
|
||||
role: string;
|
||||
contact: plugins.tsclass.business.IContact;
|
||||
contact: plugins.tsclass.business.TContact;
|
||||
}
|
||||
|
||||
export interface IPortableContract {
|
||||
|
||||
5
ts_interfaces/plugins.ts
Normal file
5
ts_interfaces/plugins.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as tsclass from '@tsclass/tsclass';
|
||||
|
||||
export {
|
||||
tsclass
|
||||
}
|
||||
5
ts_interfaces/tspublish.json
Normal file
5
ts_interfaces/tspublish.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@signature.digital/interfaces",
|
||||
"order": 1,
|
||||
"registries": ["useBase"]
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
"verbatimModuleSyntax": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@signature.digital/tools": ["./ts/index.js"],
|
||||
"@signature.digital/demodata": ["./ts_demodata/index.js"],
|
||||
"@signature.digital/interfaces": ["./ts_interfaces/index.js"]
|
||||
}
|
||||
},
|
||||
"exclude": ["dist_*/**/*.d.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user