10 Commits

Author SHA1 Message Date
d53bc96947 1.0.7
Some checks failed
Default (tags) / security (push) Failing after 12s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-12-18 20:31:19 +01:00
2078c6c7c8 fix(project): Corrected misalignment in file structure and package metadata. 2024-12-18 20:31:19 +01:00
12eba17c7c 1.0.6
Some checks failed
Default (tags) / security (push) Failing after 15s
Default (tags) / test (push) Failing after 14s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-12-18 20:29:09 +01:00
033024951d fix(core): No code changes detected. 2024-12-18 20:29:09 +01:00
213c52fccc 1.0.5
Some checks failed
Default (tags) / security (push) Failing after 15s
Default (tags) / test (push) Failing after 13s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-12-18 20:28:10 +01:00
d9989c903c fix(core): Corrected package and npm extra configuration to ensure consistent naming. 2024-12-18 20:28:10 +01:00
aa7b37f797 1.0.4
Some checks failed
Default (tags) / security (push) Failing after 15s
Default (tags) / test (push) Failing after 14s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2023-11-28 13:36:28 +01:00
f7f4ce99ed fix(core): update 2023-11-28 13:36:28 +01:00
dcfa53e40c 1.0.3
Some checks failed
Default (tags) / security (push) Failing after 17s
Default (tags) / test (push) Failing after 15s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2023-11-27 18:10:06 +01:00
38fefa42c6 fix(core): update 2023-11-27 18:10:05 +01:00
8 changed files with 233 additions and 41 deletions

28
changelog.md Normal file
View File

@ -0,0 +1,28 @@
# 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)
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'.
- Updated 'gitrepo' in npmextra.json from 'portablecontract' to 'tools'.
- 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
- Subsequent updates to core module for improved stability in version 1.0.2
- Applied additional fixes and improvements in version 1.0.3
- Finalized core updates in version 1.0.4

View File

@ -4,11 +4,24 @@
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "signature.digital", "gitscope": "signature.digital",
"gitrepo": "portablecontract", "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/portablecontract", "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

@ -1,8 +1,8 @@
{ {
"name": "@signature.digital/portablecontract", "name": "@signature.digital/tools",
"version": "1.0.2", "version": "1.0.7",
"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"
] ]
} }

0
readme.hints.md Normal file
View File

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

@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @push.rocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@signature.digital/portablecontract', name: '@signature.digital/tools',
version: '1.0.2', 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,3 +1 @@
import * as plugins from './portablecontract.plugins.js'; export * from '../ts_interfaces/index.js';
export let demoExport = 'Hi there! :) This is an exported string';

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;