🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

@prisma-next/operations

Package Overview
Dependencies
Maintainers
3
Versions
979
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma-next/operations

Target-neutral operation registry and capability helpers for Prisma Next

Source
npmnpm
Version
0.3.0-dev.135
Version published
Weekly downloads
29K
-41.57%
Maintainers
3
Weekly downloads
 
Created
Source

@prisma-next/operations

Target-neutral operation registry and capability helpers for Prisma Next.

Overview

This package provides target-neutral operation registry types and capability checking utilities. It's part of the core ring and has no dependencies on target-specific packages.

Responsibilities

  • Operation Registry: Core operation registry interface and implementation

    • OperationRegistry: Interface for registering and querying operations
    • createOperationRegistry(): Factory function to create operation registries
    • OperationSignature: Core operation signature type (target-neutral)
    • ArgSpec, ReturnSpec: Type definitions for operation arguments and return values
  • Capability Checking: Target-neutral capability validation

    • hasAllCapabilities(): Checks if all required capabilities are present in a contract

Dependencies

  • Depends on: @prisma-next/plan (for plan error types)
  • Note: This package does not depend on @prisma-next/contract despite being in the same layer. OperationRegistry is used by contract types, but operations package itself has no contract dependencies.
  • Depended on by:
    • @prisma-next/sql-operations (extends with SQL-specific lowering specs)
    • @prisma-next/sql-relational-core (uses for capability checking)
    • @prisma-next/runtime (uses for operation registry creation)

Architecture

flowchart TD
    subgraph "Core Ring"
        OPS[@prisma-next/operations]
    end

    subgraph "Targets Ring"
        SQL_OPS[@prisma-next/sql-operations]
    end

    subgraph "Lanes Ring"
        REL_CORE[@prisma-next/sql-relational-core]
    end

    subgraph "Runtime Ring"
        RT[@prisma-next/runtime]
    end

    OPS --> SQL_OPS
    OPS --> REL_CORE
    OPS --> RT

Usage

Creating an Operation Registry

import { createOperationRegistry, type OperationSignature } from '@prisma-next/operations';

const registry = createOperationRegistry();

const signature: OperationSignature = {
  forTypeId: 'pg/vector@1',
  method: 'cosineDistance',
  args: [{ kind: 'typeId', type: 'pg/vector@1' }],
  returns: { kind: 'builtin', type: 'number' },
};

registry.register(signature);
const operations = registry.byType('pg/vector@1');

Checking Capabilities

import { hasAllCapabilities } from '@prisma-next/operations';

const contractCapabilities = {
  pgvector: {
    'index.ivfflat': true,
  },
};

const hasCapability = hasAllCapabilities(
  ['pgvector.index.ivfflat'],
  contractCapabilities,
);

Package Location

This package is part of the framework domain, core layer, shared plane:

  • Domain: framework (target-agnostic)
  • Layer: core
  • Plane: shared
  • Path: packages/1-framework/1-core/shared/operations
  • [Package Layering](../../../../docs/architecture docs/Package-Layering.md)
  • [ADR 140 - Package Layering & Target-Family Namespacing](../../../../docs/architecture docs/adrs/ADR 140 - Package Layering & Target-Family Namespacing.md)

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts