open-index/open-npm huggingface dataset:
npm package: @figulus/registry-schema
Description: Zod schemas for the Figulus registry metadata
Latest version: 0.1.2

# @figulus/registry-schema

Zod schemas for Figulus registry metadata — namespace declarations, entity metadata (FigSpecs, FigParsers, FigStacks), and JSON Schema validation.

## Installation

```bash
npm install @figulus/registry-schema
```

## Usage

### Validating FigSpec metadata

```ts
import { figSpecMetadataSchema } from '@figulus/registry-schema';

const result = figSpecMetadataSchema.safeParse({
  title: "My FigSpec",
  description: "A development environment for Node.js",
  author: "acme",
  license: "mit",
  variants: [
    {
      blob: { contentHash: "abc123def456" },
      tag: "latest",
    }
  ]
});
```

### Validating FigParser metadata

```ts
import { figParserMetadataSchema } from '@figulus/registry-schema';
import type { FigParserMetadata } from '@figulus/registry-schema';

const result = figParserMetadataSchema.safeParse({
  title: "My Parser",
  author: ["alice", "bob"],
  license: { name: "Proprietary" },
  variants: [
    {
      blob: { contentHash: "deadbeef1234" },
      parsedShape: { type: "object", properties: { key: { type: "string" } } },
    }
  ]
});
```

### Validating namespace metadata

```ts
import { namespaceMetadataSchema } from '@figulus/registry-schema';
import type { NamespaceMetadata } from '@figulus/registry-schema';

const result = namespaceMetadataSchema.safeParse({
  owner: { githubUsername: "acme" },
  editors: [{ githubUsername: "acme" }],
});
```

### JSON Schema validation

```ts
import { JsonSchemaSchema } from '@figulus/registry-schema/json-schema';
import type { JsonSchema } from '@figulus/registry-schema/json-schema';

const schema: JsonSchema = {
  type: "object",
  properties: {
    name: { type: "string" },
  },
  required: ["name"],
};

const result = JsonSchemaSchema.safeParse(schema);
```

## Exports

### From `@figulus/registry-schema`

**Schemas:**
- `namespaceMetadataSchema` — namespace ownership and editor configuration
- `namespaceVerificationsSchema` — namespace verification status array
- `pushLimitOverridesSchema` — per-namespace push rate limit overrides
- `figEntityMetadataBaseSchema` — base schema shared by all entity types
- `figSpecMetadataSchema` — FigSpec entity metadata
- `figParserMetadataSchema` — FigParser entity metadata
- `figStackMetadataSchema` — FigStack entity metadata
- `blobSchema` — content-addressed blob reference
- `variantSchema` — entity variant (blob + optional tag)
- `parserVariantSchema` — parser variant with JSON Schema shape

**Types:**
- `NamespaceMetadata`, `NamespaceVerifications`, `PushLimitOverrides`
- `FigSpecMetadata`, `FigParserMetadata`, `FigStackMetadata`
- `FigEntityMetadata<Type>` — conditional type keyed by entity type
- `EntityType` — `"spec" | "stack" | "parser"`

### From `@figulus/registry-schema/json-schema`

- `JsonSchemaSchema` — recursive JSON Schema Draft-07 validator
- `JsonSchema`, `JsonSchemaObject`, `JsonSchemaTypeName`