From 2078c6c7c8f15e3d0534c50ed2475158ee5c36a2 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 18 Dec 2024 20:31:19 +0100 Subject: [PATCH] fix(project): Corrected misalignment in file structure and package metadata. --- changelog.md | 8 + npmextra.json | 17 +- package.json | 19 ++- readme.md | 190 +++++++++++++++++++--- ts/00_commitinfo_data.ts | 4 +- ts/index.ts | 2 +- {ts/interfaces => ts_interfaces}/index.ts | 2 +- 7 files changed, 208 insertions(+), 34 deletions(-) rename {ts/interfaces => ts_interfaces}/index.ts (88%) diff --git a/changelog.md b/changelog.md index 53215f3..f2dd6a5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # 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. diff --git a/npmextra.json b/npmextra.json index 601c969..ee0179e 100644 --- a/npmextra.json +++ b/npmextra.json @@ -5,10 +5,23 @@ "githost": "gitlab.com", "gitscope": "signature.digital", "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", "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": { diff --git a/package.json b/package.json index f09c05e..7477694 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@signature.digital/tools", "version": "1.0.6", "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", "typings": "dist_ts/index.d.ts", "type": "module", @@ -10,7 +10,7 @@ "license": "MIT", "scripts": { "test": "(tstest test/ --web)", - "build": "(tsbuild --web --allowimplicitany)", + "build": "(tsbuild tsfolders --web --allowimplicitany)", "buildDocs": "(tsdoc)" }, "devDependencies": { @@ -46,5 +46,18 @@ "cli.js", "npmextra.json", "readme.md" + ], + "keywords": [ + "TypeScript", + "digital contracts", + "contract management", + "ESM", + "interfaces", + "business integration", + "modular design", + "contract modeling", + "business relationships", + "data handling", + "TypeScript utilities" ] -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index f88bc89..b9c92e8 100644 --- a/readme.md +++ b/readme.md @@ -1,31 +1,171 @@ -# @signature.digital/portablecontract -a package that defines standard tools for working with contracts. +# @signature.digital/tools -## Availabililty and Links -* [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/) +A package that defines standard tools for working with contracts. -## Status for master +## Install -Status Category | Status Badge --- | -- -GitLab Pipelines | [![pipeline status](https://gitlab.com/signature.digital/portablecontract/badges/master/pipeline.svg)](https://lossless.cloud) -GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/signature.digital/portablecontract/badges/master/coverage.svg)](https://lossless.cloud) -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) -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) -PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@signature.digital/portablecontract)](https://lossless.cloud) -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) +To install `@signature.digital/tools`, you'll use your preferred package manager. Assuming you're using npm, follow the steps below: + +```bash +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 -Use TypeScript for best in class intellisense -For further information read the linked docs at the top of this readme. -## Legal -> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc) -| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) +### Overview + +`@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 \ No newline at end of file diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 0595b41..7818e8d 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@signature.digital/tools', - version: '1.0.6', - description: 'a package that defines standard tools for working with contracts.' + 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.' } diff --git a/ts/index.ts b/ts/index.ts index 8739a35..5f6ca1e 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1 +1 @@ -export * from './interfaces/index.js'; \ No newline at end of file +export * from '../ts_interfaces/index.js'; \ No newline at end of file diff --git a/ts/interfaces/index.ts b/ts_interfaces/index.ts similarity index 88% rename from ts/interfaces/index.ts rename to ts_interfaces/index.ts index 30a6391..e9fdcf8 100644 --- a/ts/interfaces/index.ts +++ b/ts_interfaces/index.ts @@ -1,4 +1,4 @@ -import * as plugins from '../portablecontract.plugins.js'; +import * as plugins from '../ts/portablecontract.plugins.js'; export interface IParagraph { uniqueId: string;