open-index/open-npm huggingface dataset:
npm package: @s1seven/schema-tools-certificate-model
Description: Tool to create class / instances specific to a schema
Author: getlarge
Latest version: 0.3.17

# Schema-tools-certificate-model

[![npm][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/@s1seven/schema-tools-certificate-model.svg?style=flat
[npm-url]: https://npmjs.org/package/@s1seven/schema-tools-certificate-model

The `certificate-model` module provides a class using template pattern to generate a class / instances based a given JSON schema.

## Install

```bash
npm install @s1seven/schema-tools-certificate-model
```

## Examples

The example uses the `CertificateModel` class in a function using `process.argv`.

First argument is the schema type, and the second argument is the version of the schema that should be loaded to create a classe extending `CertificateModel`.

```bash
node ./examples/certificate-model.js en10168-schemas v0.0.2
```

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build certificate-model` to build the library.

## Running unit tests

Run `nx test certificate-model` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-certificate-summary
Description: build certificate summary from common general properties
Author: getlarge
Latest version: 0.3.11

# `@s1seven/certificate-summary`

Build certificate summary by retrieving general common properties such as:

| Field              | CoA                                         |                EN10168                | E-CoC                                                  |
| ------------------ | ------------------------------------------- | :-----------------------------------: | ------------------------------------------------------ |
| CertificateNumber  | Id                                          |       CommercialTransaction.A03       | Id                                                     |
| SellerName         | Parties.Manufacturer.Name                   | CommercialTransaction.A01.CompanyName | EcocData.Data.Parties[].PartyName (based on PartyRole) |
| BuyerName          | Parties.Customer.Name                       | CommercialTransaction.A06.CompanyName | EcocData.Data.Parties[].PartyName (based on PartyRole) |
| ProductDescription | Product.Name                                |        ProductDescription.B01         | ?                                                      |
| DeliveryNumber     | BusinessTransaction.Delivery.(Number or Id) |       CommercialTransaction.A98       | BusinessRef.StandardReferences[].DeliveryNote          |
| DeliveryPosition   | BusinessTransaction.Delivery.Position       |                   ?                   | ?                                                      |
| OrderNumber        | BusinessTransaction.Order.(Number or Id)    |       CommercialTransaction.A07       | BusinessRef.StandardReferences[].OrderNo               |
| OrderPosition      | BusinessTransaction.Order.Position          |       CommercialTransaction.A97       | BusinessRef.StandardReferences[].OrderPosition         |

## Usage

```

```

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build certificate-summary` to build the library.

## Running unit tests

Run `nx test certificate-summary` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-extract-emails
Description: Tool to extract certificates emails
Author: getlarge
Latest version: 0.4.12

# Schema-tools-extract-emails

[![npm][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/@s1seven/schema-tools-extract-emails.svg?style=flat
[npm-url]: https://npmjs.org/package/@s1seven/schema-tools-extract-emails

This repository contains tools to extract emails from certificate(s).

## Install

```bash
npm install @s1seven/schema-tools-extract-emails
```

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build extract-emails` to build the library.

## Running unit tests

Run `nx test extract-emails` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-generate-html
Description: Tool to generate html from certificates
Author: getlarge
Latest version: 0.4.14

# Schema-tools-generate-html

[![npm][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/@s1seven/schema-tools-generate-html.svg?style=flat
[npm-url]: https://npmjs.org/package/@s1seven/schema-tools-generate-html

The `generate-html` module uses [handlebars] to generate HTML string using a JSON schema.

## Install

```bash
npm install @s1seven/schema-tools-generate-html
```

### Examples

The example wrap the `generateHtml` module in a function using `process.argv`.

First argument is the certificate path to generate from.

```bash
node ./example.js ../../fixtures/EN10168/v0.0.2/valid_en10168_test.json
```

[handlebars]: https://www.npmjs.com/package/handlebars

### Using partials

`generateHtml` has been updated to include support for handlebars partials.
A `partialsMap` can be passed in as a property on `GenerateHtmlOptions`.

For an example, look at the following example taken from `example_partial.js`.

```javascript
const html = await generateHtml(certificatePath, {
  translations,
  templatePath,
  templateType: 'hbs',
  partialsMap: {
    inspection: templatePartialPath,
  },
});
```

Any partials passed in will be retrieved and compiled. If no `partialsMap` is passed in, `getPartials` will attempt to use the `ref` URL to see if there is a `partials-map.json` file present.
Example:
If the following URL is present on a certificate:
`https://schemas.s1seven.com/en10168-schemas/v0.3.0/schema.json`
`getPartials` will check to see if the file `https://schemas.s1seven.com/en10168-schemas/v0.3.0/partials-map.json` exists. If not, it will fail silently and continue to generate the html file without partials. This is to maintain compatability with schemas that do not use partials.

## Debugging

Error logging has been implemented in `getPartials`. To see the errors, run your command with the environment variable `DEBUG=schema-tools-generate-html`.
npm package: @s1seven/schema-tools-generate-interfaces
Description: Tool to generate TS interfaces from schema
Author: getlarge
Latest version: 0.0.45

# Schema-tools-generate-interfaces

[![npm][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/@s1seven/schema-tools-generate-interfaces.svg?style=flat
[npm-url]: https://npmjs.org/package/@s1seven/schema-tools-generate-interfaces

The `generate-interfaces` module is using [json-schema-to-typescript] to generate TS interfaces and types using a JSON / OpenAPI schema.

## Install

```bash
npm install @s1seven/schema-tools-generate-interfaces
```

### Examples

The example wrap the `generate` module in a function using `process.argv`.

First argument is the schema url to generate from, the second argument is the filepath where interfaces will be saved.

```bash
node ./examples/generate-interfaces.js https://schemas.s1seven.com/en10168-schemas/v0.0.2/schema.json ./certificate.ts
```

[json-schema-to-typescript]: https://www.npmjs.com/package/json-schema-to-typescript

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build generate-interfaces` to build the library.

## Running unit tests

Run `nx test generate-interfaces` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-generate-pdf-template-helpers
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.4.19

# generate-pdf-template-helpers

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build generate-pdf-template-helpers` to build the library.

## Running unit tests

Run `nx test generate-pdf-template-helpers` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-types
Description: Types used in @s1seven/schema-tools packages
Author: getlarge
Latest version: 0.5.13

# Schema-tools-types

This repository contains tools to used by schema-tools packages.

## Install

```bash
npm install @s1seven/schema-tools-types
```

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build types` to build the library.

## Running unit tests

Run `nx test types` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-utils
Description: Utils used in @s1seven/schema-tools packages
Author: getlarge
Latest version: 0.2.16

# Schema-tools-utils

[![npm][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/@s1seven/schema-tools-utils.svg?style=flat
[npm-url]: https://npmjs.org/package/@s1seven/schema-tools-utils

This repository contains tools to used by schema-tools packages.

## Install

```bash
npm install @s1seven/schema-tools-utils
```

## Debugging

Error logging has been implemented in `getTranslations`. To see the errors, run your command with the environment variable `DEBUG=schema-tools-utils`.

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build utils` to build the library.

## Running unit tests

Run `nx test utils` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-validate
Description: Tool to validate certificates
Author: getlarge
Latest version: 0.3.16

# Schema-tools-validate

[![npm][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/@s1seven/schema-tools-validate.svg?style=flat
[npm-url]: https://npmjs.org/package/@s1seven/schema-tools-validate

This repository contains tools to validate certificate(s).

The `validate` module is using [AJV] to validate your certificate(s), it takes as input a certificate path | url | object | object[] from which the `RefSchemaUrl` property will be resolved to fetch dependencies located `https://schemas.s1seven.com/` such as schema reference, translations, templates ...

## Install

```bash
npm install @s1seven/schema-tools-validate
```

### Examples

The example wrap the `validate` module in a function using `process.argv`.

The first argument is the folder path were resides your certificates to validate.

```bash
node ./examples/validate.js ./fixtures/en10168
```

[ajv]: https://www.npmjs.com/package/ajv
[json-schema-to-typescript]: https://www.npmjs.com/package/json-schema-to-typescript

## Debugging

Error logging has been implemented in `loadLocalCertificates`. To see the errors, run your command with the environment variable `DEBUG=schema-tools-validate`.

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build validate` to build the library.

## Running unit tests

Run `nx test validate` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @s1seven/schema-tools-versioning
Description: Tool to help versioning schema repositories
Author: getlarge
Latest version: 0.6.12

# `versioning`

The `SchemaRepositoryVersion` class is used to update schemas and fixtures in schema repostories.

It can be required and invoked as follows:

```javascript
const { SchemaRepositoryVersion } = require('@s1seven/schema-tools-versioning');

const defaultServerUrl = 'https://schemas.s1seven.com/en10168-schemas';
const schemaFilePaths = [{ filePath: 'schema.json', properties: [{ path: '$id', value: 'schema.json' }] }]; // the value will be passed to buildRefSchemaUrl when setting $id

const updater = new SchemaRepositoryVersion(
  defaultServerUrl,
  schemaFilePaths,
  version, // new version number to be applied
  translationsObject,
  extraTranslationsObject,
  'schema.json', // this value is used as the default value by buildRefSchemaUrl, for example, by updateJsonFixturesVersion
);
```

`SchemaRepositoryVersion` contains several methods, such as `updateSchemasVersion` which updates the `$id` in the schemas in the repository on which it is used.
The `updateJsonFixturesVersion` method updates the `RefSchemaUrl` in the sample certificates in `test/fixtures`.

## Patials support

`updateHtmlFixturesVersion` has been updated to support partials. A `partialsMap` can be passed in as the fourth argument as you can see in the following example:
`await updater.updateHtmlFixturesVersion(certificatePattern, htmlTemplatePath, {}, partialsMap);`

For more information on using partials, look at https://github.com/s1seven/schema-tools/blob/main/packages/generate-html/README.md#using-partials

## Usage

```
const versioning = require('versioning');

// TODO: DEMONSTRATE API
```

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build versioning` to build the library.

## Running unit tests

Run `nx test versioning` to execute the unit tests via [Jest](https://jestjs.io).