open-index/open-npm huggingface dataset:
npm package: @nexload-sdk/orpc-client
Description: A minimal, high-performance factory for creating optimized oRPC clients, designed for persistent, low-latency, server-to-server communication in cloud-native architectures.
Latest version: 2.0.0

# @nexload-sdk/orpc-client

Minimal wrapper around oRPC client creation for server-side usage.

## Install

```bash
pnpm add @nexload-sdk/orpc-client
```

## Export

- default export: `ORPCClient` class

## Quick Start

```ts
import ORPCClient from "@nexload-sdk/orpc-client";
import type { AppRouter } from "./contract";

const factory = new ORPCClient<AppRouter>("http://localhost:3000");
const client = factory.createClient();
```

## Behavior

`ORPCClient`:

- reads env values using `@nexload-sdk/env`
- merges `@nexload-sdk/env/presets` node preset with `PAYLOAD_API_URL`
- builds default headers for RPC requests:
  - `Content-Type`
  - `Accept`
  - `Accept-Encoding`
  - `User-Agent`
  - `X-Service`
  - `X-Communication`

## Environment Variables

- `PAYLOAD_API_URL`: optional override for the constructor URL
- `NODE_ENV`
- `SERVICE_NAME`
- `LOG_LEVEL` (through logger)

## API

### `new ORPCClient(defaultApiUrl?)`

Creates a client factory instance.

### `createClient(options?)`

Returns a typed `ContractRouterClient<TRouter>` using `@orpc/client` + fetch `RPCLink`.

## Notes

- This package currently uses oRPC's fetch link directly.
npm package: @nexload-sdk/payload-fields
Description: A collection of powerful, production-ready, and beautifully designed fields for Payload CMS, including an advanced date picker, automatic slug generator, and a feature-rich Lexical editor.
Latest version: 2.0.0

# @nexload-sdk/payload-fields

Reusable Payload CMS field helpers and admin components (date + slug) plus a preconfigured Lexical editor.

## Install

```bash
pnpm add @nexload-sdk/payload-fields
```

## Exports

Root exports:

- `editor` (Lexical editor preset)
- `dateField`
- `slugField`
- slug/date helper exports (`formatDate`, `formatSlug`, `formatSlugHook`)

Subpath exports (used by Payload admin component paths):

- `@nexload-sdk/payload-fields/date`
- `@nexload-sdk/payload-fields/date/date-picker`
- `@nexload-sdk/payload-fields/date/date-cell`
- `@nexload-sdk/payload-fields/slug`
- `@nexload-sdk/payload-fields/slug/slug-field`

## `editor`

Preconfigured `lexicalEditor(...)` instance with features including:

- headings (`h1`-`h4`)
- fixed toolbar
- horizontal rule
- upload
- table (experimental)
- relationship feature (`products`, `articles`)

Usage:

```ts
import { editor } from "@nexload-sdk/payload-fields";

{
  name: "content",
  type: "richText",
  editor
}
```

## `dateField(overrides?)`

Returns `[DateField]` configured for Payload admin sidebar, with:

- custom field component (`DatePicker`)
- custom cell component (`DateCell`)
- Persian/Jalali formatting helpers

```ts
import { dateField } from "@nexload-sdk/payload-fields";

fields: [
  ...dateField()
];
```

## `slugField(fieldToUse?, overrides?)`

Returns `[TextField, CheckboxField]` for a slug and lock toggle.

- auto-formats slug values
- includes `beforeValidate` hook
- uses custom admin UI component with lock/unlock + generate action

```ts
import { slugField } from "@nexload-sdk/payload-fields";

fields: [
  { name: "title", type: "text", required: true },
  ...slugField("title")
];
```

## Notes

- Admin components are React client components and intended for Payload admin usage.
- Styles are bundled from package submodules (`date/index.scss`, `slug/index.scss`).
npm package: @nexload-sdk/payload-hooks
Description: Effortless, type-safe logging for Payload CMS collection operations.
Latest version: 2.0.0

# @nexload-sdk/payload-hooks

Small Payload CMS hook helpers built on top of `@nexload-sdk/logger`.

## Install

```bash
pnpm add @nexload-sdk/payload-hooks
```

## Exports

- `logOperation(hookType)`

## Quick Start

```ts
import { logOperation } from "@nexload-sdk/payload-hooks";

export const Posts = {
  slug: "posts",
  hooks: {
    beforeChange: [logOperation("beforeChange")],
    afterChange: [logOperation("afterChange")],
    afterDelete: [logOperation("afterDelete")],
    afterRead: [logOperation("afterRead")]
  }
};
```

## Supported Hook Types

- `beforeChange`
- `afterChange`
- `afterDelete`
- `afterRead`

## Behavior

The returned hook logs the collection slug/name and hook type using `@nexload-sdk/logger`, then returns:

- `args.data` when present
- `args.doc` when present
- `null` otherwise