Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chronark/zod-bird

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chronark/zod-bird - npm Package Compare versions

Comparing version 0.3.1-canary.0 to 0.3.1-canary.1

12

dist/index.d.ts

@@ -87,6 +87,6 @@ import { z } from 'zod';

}>;
buildIngestEndpoint<TEvent extends Record<string, unknown>>(req: {
buildIngestEndpoint<TOutput extends Record<string, unknown>, TInput = TOutput>(req: {
datasource: string;
event: z.ZodSchema<TEvent, any, any>;
}): (events: TEvent | TEvent[]) => Promise<z.infer<typeof eventIngestReponseData>>;
event: z.ZodSchema<TOutput, z.ZodTypeDef, TInput>;
}): (events: TInput | TInput[]) => Promise<z.infer<typeof eventIngestReponseData>>;
}

@@ -113,8 +113,8 @@

}>;
buildIngestEndpoint<TEvent extends Record<string, unknown>>(req: {
buildIngestEndpoint<TOutput extends Record<string, unknown>, TInput = TOutput>(req: {
datasource: string;
event: z.ZodSchema<TEvent, any, any>;
}): (events: TEvent | TEvent[]) => Promise<z.infer<typeof eventIngestReponseData>>;
event: z.ZodSchema<TOutput, z.ZodTypeDef, TInput>;
}): (events: TInput | TInput[]) => Promise<z.infer<typeof eventIngestReponseData>>;
}
export { NoopTinybird, Tinybird };
{
"name": "@chronark/zod-bird",
"version": "0.3.1-canary.0",
"version": "0.3.1-canary.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -83,8 +83,8 @@ import { type PipeErrorResponse, eventIngestReponseData, pipeResponseWithoutData } from "./util";

public buildIngestEndpoint<TEvent extends Record<string, unknown>,>(req: {
public buildIngestEndpoint<TOutput extends Record<string, unknown>, TInput = TOutput>(req: {
datasource: string;
event: z.ZodSchema<TEvent, any, any>;
}): (events: TEvent | TEvent[]) => Promise<z.infer<typeof eventIngestReponseData>> {
return async (events: TEvent | TEvent[]) => {
let validatedEvents: typeof events | undefined = undefined;
event: z.ZodSchema<TOutput, z.ZodTypeDef, TInput>;
}): (events: TInput | TInput[]) => Promise<z.infer<typeof eventIngestReponseData>> {
return async (events: TInput | TInput[]) => {
let validatedEvents: TOutput | TOutput[] | undefined = undefined;
if (req.event) {

@@ -91,0 +91,0 @@ const v = Array.isArray(events)

@@ -86,2 +86,12 @@ /**

export const publishTransformedEvents = tb.buildIngestEndpoint({
datasource: "events__v1",
event: z.object({
actor: z
.object({ id: z.string(), name: z.string() })
.transform((val) => JSON.stringify(val)),
}),
});
// await publishEvents([{ id: "1" }, { id: "2" }])
// await publishTransformedEvents({ actor: { id: "1", name: "John" } });

@@ -55,8 +55,8 @@ import { z } from "zod";

public buildIngestEndpoint<TEvent extends Record<string, unknown>,>(req: {
public buildIngestEndpoint<TOutput extends Record<string, unknown>, TInput = TOutput>(req: {
datasource: string;
event: z.ZodSchema<TEvent, any, any>;
}): (events: TEvent | TEvent[]) => Promise<z.infer<typeof eventIngestReponseData>> {
return async (events: TEvent | TEvent[]) => {
let validatedEvents: typeof events | undefined = undefined;
event: z.ZodSchema<TOutput, z.ZodTypeDef, TInput>;
}): (events: TInput | TInput[]) => Promise<z.infer<typeof eventIngestReponseData>> {
return async (events: TInput | TInput[]) => {
let validatedEvents: TOutput | TOutput[] | undefined = undefined;
if (req.event) {

@@ -63,0 +63,0 @@ const v = req.event.safeParse(events);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc