0.63.2 • Published 8 months ago

@arrirpc/typebox-adapter v0.63.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

NOTICE:

Currently not in development. Doesn't work with latest Arri version or Typescript version. I may resurrect this down the road if I have time. Although I probably will want to rethink the proper way to approach supporting different validation libraries (i.e. TypeBox, Zod, etc)

Arri Typebox Adapter

Let's you reuse your Typebox schemas with Arri-RPC

Installation

npm install @arrirpc/typebox-adapter

pnpm install @arrirpc/typebox-adapter

Usage

Simply wrap your typebox schemas with typeboxAdapter() to use them with arrirpc. Additionally metadata such as $id and description will be converted over.

// updateUser.rpc.ts
import { defineRpc } from "@arrirpc/server";
import { typeboxAdapter } from "@arrripc/typebox-adapter";
import { Type } from "typebox";

const User = Type.Object(
    {
        id: Type.String(),
        name: Type.String(),
    },
    {
        $id: "User",
    },
);

export default defineRpc({
    params: typeboxAdapter(User),
    response: typeboxAdapter(User),
    handler({ params }) {
        // typebox keys are now available
        console.log(params.id);
        return params;
    },
});
0.63.2

8 months ago

0.63.0

8 months ago

0.62.0

9 months ago

0.63.1

8 months ago

0.61.1

9 months ago

0.60.3

10 months ago

0.60.2

10 months ago

0.61.0

10 months ago

0.60.1

10 months ago

0.57.4

11 months ago

0.57.5

11 months ago

0.59.0

10 months ago

0.58.1

10 months ago

0.57.2

11 months ago

0.57.3

11 months ago

0.57.0

11 months ago

0.58.0

11 months ago

0.55.0

11 months ago

0.53.2

12 months ago

0.57.8

11 months ago

0.57.6

11 months ago

0.53.0

12 months ago

0.51.2

1 year ago

0.54.0

12 months ago

0.53.1

12 months ago

0.51.0

1 year ago

0.51.1

1 year ago

0.50.0

1 year ago

0.49.1

1 year ago

0.48.2

1 year ago

0.45.6

1 year ago

0.48.0

1 year ago

0.49.0

1 year ago

0.48.1

1 year ago

0.46.0

1 year ago

0.47.0

1 year ago

0.45.7

1 year ago

0.45.5

1 year ago

0.45.3

1 year ago

0.45.4

1 year ago

0.45.2

1 year ago

0.45.1

1 year ago

0.45.0

1 year ago