open-index/open-npm huggingface dataset:
npm package: @omnysecurity/cognite-codegen
Description: Core TypeScript code generation library for Cognite Data Fusion data models
Author: Omny Security
Latest version: 0.3.0

# @omnysecurity/cognite-codegen

Core TypeScript code generation library for Cognite Data Fusion data models.

## Overview

This package provides the core functionality for generating TypeScript types and utilities from Cognite Data Fusion (CDF) data models. It takes CDF data model definitions and generates strongly-typed TypeScript interfaces, types, and helper constants.

## Usage

```typescript
import { generate } from '@omnysecurity/cognite-codegen';

const output = generate({
	dataModel: myDataModel,
	views: myViews,
});

// Write the generated TypeScript code to a file
await writeFile('generated-types.ts', output.fileContent);
```

## Features

- Generates TypeScript types from CDF data model views
- Supports all CDF property types (text, number, boolean, dates, enums, direct references, etc.)
- Creates type-safe schema definitions
- Handles view inheritance and relationships
- Generates utility constants for runtime usage

## API

### `generate(options: GenerateFileOptions)`

Generates TypeScript code from a CDF data model.

**Parameters:**

- `options.dataModel`: The CDF DataModel object
- `options.views`: Array of ViewDefinition objects from the data model

**Returns:**

- `fileName`: Suggested filename for the generated code
- `fileContent`: The generated TypeScript code as a string
npm package: @omnysecurity/cognite-codegen-cli
Description: Command-line interface for Cognite Data Fusion TypeScript code generation
Author: Omny Security
Latest version: 0.3.0

# @omnysecurity/cognite-codegen-cli

Command-line interface for generating TypeScript types from Cognite Data Fusion data models.

## Installation

**Note:** This package is currently private. You need to build from source and use `node .` to run the CLI.

## Usage

```bash
npx @omnysecurity/cognite-codegen-cli --help
```

## Options

- `--cluster, -c`: CDF Cluster URL (default: https://westeurope-1.cognitedata.com)
- `--project, -p`: CDF Project name (**required**)
- `--space, -s`: CDF Model Space (**required**)
- `--model, -m`: CDF Data model externalId (**required**)
- `--version, -v`: CDF Data model version (**required**)
- `--token, -t`: CDF Access token (**required**)
- `--output, -o`: Output file path (default: auto-generated based on model name)

## Examples

Generate types for a specific data model (using default cluster):

```bash
node . \
  --cluster https://api.cognitedata.com \
  --project acme \
  --space acme_models \
  --model acme_domain \
  --version 1 \
  --token "<access token>"
```

## Authentication

The CLI uses CDF token-based authentication. You need to provide a valid CDF access token using the `--token` parameter.

To obtain a CDF token:

1. Log into your Cognite Data Fusion UI
2. Open browser developer tools (F12)
3. Go to Network tab and make any request
4. Look for the `Authorization` header in the request
5. Copy the token value (without "Bearer " prefix)
npm package: @omnysecurity/cognite-helpers
Description: Enhanced TypeScript support for Cognite Data Fusion APIs
Author: Omny Security
Latest version: 0.3.2

# @omnysecurity/cognite-helpers

Enhanced TypeScript support for Cognite Data Fusion APIs

## Overview

This package provides the core functionality for generating TypeScript types and utilities from Cognite Data Fusion (CDF) data models. It takes CDF data model definitions and generates strongly-typed TypeScript interfaces, types, and helper constants.

## Usage

```typescript
import { createHelpers, Filter } from '@omnysecurity/cognite-helpers';
import { __Schema, VIEW_DEFINITIONS } from 'data_models/dm_example@2';

const helpers = new createHelpers<__Schema>(VIEW_DEFINITIONS);
const f = new Filter(helpers);

// Use helpers and filter instance to query data with ease
const instances = await client.instances.list({
	sources: [helpers.getView('MyView').asSource()],
	filter: f.and(
		f.instance.equals('node', 'space', 'jam'),
		f.equals('MyView', 'someProperty', 49)
	),
});

// Extract data from response
const listOfProperties = instances.map(helpers.getView('MyView').getProps);
```

## Features

- Utilities to build queries
- Utilities to parse query results

## API

See typescript types for up-to-date API.