open-index/open-npm huggingface dataset:
npm package: @sonat-aws-tools/lamda-logger-ts
Description: A wrapper class for logging aws lambda events
Author: iconspiracy
Latest version: 1.1.7

# SonatLogger

The `SonatLogger` class extends the AWS Lambda Powertools Logger to provide enhanced logging capabilities for your AWS Lambda functions. It includes additional configuration options and custom log formatters.

> [!NOTE] > **This package is a work in progress**. The purpose of this package is to be able to create a logger instance and configure it with one single command. Huge shoutout to the team behind AWS Lambda Powertools Logger for their great work with their package `@aws-lambda-powertools/logger`.

## Installation

`npm install @sonat-aws-tools/lamda-logger-ts`

## Usage

```Typescript
import { SonatLogger } from '@sonat-aws-tools/lamda-logger-ts';

const logger = new SonatLogger({
  serviceName: 'MyService',
  environment: 'production',
  timeZone: 'UTC',
  formatter: 'detailed',
  metricNamespace: 'MyServiceMetrics',
  logLevelThreshold: 'info',
  logEvents: true,
  loggerSampleRate: '0.1',
});

logger.info('This is an info log');
```

> [!TIP]
> To be able to set the formatter and environment params you need to use the enums by importing the SonatLoggerParams.

```Typescript
import { SonatLogger, SonatLoggerParams } from "@sonat-aws-tools/lamda-logger-ts";
```

## Configuration Options

- **serviceName**: The name of the service using the logger.
- **environment**: The environment in which the logger is running (e.g., ‘dev’, ‘prod’).
- **timeZone**: The time zone to be used for logging timestamps.
- **formatter**: The log formatter to be used. Options are ‘compact’ or ‘detailed’.
- **metricNamespace**: The namespace for metrics.
- **logLevelThreshold**: The threshold for log levels (e.g., ‘info’, ‘error’).
- **logEvents**: Whether to log events.
- **loggerSampleRate**: The sample rate for logging.

## Example

```Typescript
const logger = new SonatLogger({
  serviceName: 'MyService',
  environment: 'development',
  timeZone: 'UTC',
  formatter: 'compact',
  metricNamespace: 'MyServiceMetrics',
  logLevelThreshold: 'debug',
  logEvents: false,
  loggerSampleRate: '1.0',
});

logger.debug('This is a debug log');
```

## Methods

- **getPackageVersion**: Retrieves the package version and name from `package.json`.
- **setEnvironmentValiablesForLogger**: Sets environment variables for the logger based on the provided options.
npm package: @sonate/schemas
Description: Shared schema definitions for SONATE platform (JSON Schema + TypeScript)
Author: SONATE
Latest version: 2.0.1

# @sonate/schemas

[![npm version](https://img.shields.io/npm/v/@sonate/schemas.svg)](https://www.npmjs.com/package/@sonate/schemas)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Shared schema definitions for SONATE Trust Receipts — JSON Schema validation + TypeScript types.

## Install

```bash
npm install @sonate/schemas
```

## Usage

### Validate a receipt

```typescript
import { receiptValidator } from '@sonate/schemas';

const result = receiptValidator.validateJSON(receipt);
if (result.valid) {
  console.log('Receipt is valid');
} else {
  console.error('Validation errors:', result.errors);
}
```

### TypeScript types

```typescript
import type {
  TrustReceipt,
  AIInteraction,
  DigitalSignature,
  HashChain,
  CreateReceiptInput,
  VerificationResult,
} from '@sonate/schemas';
```

## What's Included

- **JSON Schema** (`receipt.schema.json`) — V2 Trust Receipt schema with AJV validation
- **TypeScript interfaces** — `TrustReceipt`, `AIInteraction`, `Telemetry`, `PolicyState`, etc.
- **Validator** — Runtime validation using AJV with detailed error reporting

## Receipt Structure (V2)

A Trust Receipt contains:

| Field | Description |
|-------|-------------|
| `id` | SHA-256 hash of canonical content |
| `version` | Schema version (`"2.0.0"`) |
| `timestamp` | ISO 8601 timestamp |
| `agent_did` | DID of the AI agent |
| `human_did` | DID of the human user |
| `interaction` | Prompt/response data (raw or hashed) |
| `chain` | Hash chain for immutability |
| `signature` | Ed25519 cryptographic signature |

### Privacy-by-Default

The `interaction` object supports both raw content and content hashing:

```typescript
// Hashes only (privacy-preserving, default)
interaction: {
  prompt_hash: "a1b2c3...",
  response_hash: "d4e5f6...",
  model: "gpt-4"
}

// Raw content (opt-in)
interaction: {
  prompt: "What is quantum computing?",
  response: "Quantum computing uses...",
  prompt_hash: "a1b2c3...",
  response_hash: "d4e5f6...",
  model: "gpt-4"
}
```

## Related Packages

- [`@sonate/trust-receipts`](https://www.npmjs.com/package/@sonate/trust-receipts) — Generate signed receipts
- [`@sonate/verify-sdk`](https://www.npmjs.com/package/@sonate/verify-sdk) — Verify receipts (browser + Node.js)

## License

MIT