@eagleeye-solutions/integration-events-common
Version:
Eagle Eye CDP connector common functionality
827 lines (826 loc) • 23.5 kB
TypeScript
import { z } from 'zod';
export declare const InternalMessageTypeSchema: z.ZodEnum<["cdp-inbound-event", "cdp-outbound-event", "ee-air-inbound-event", "ee-air-outbound-event"]>;
export type InternalMessageType = z.infer<typeof InternalMessageTypeSchema>;
export declare const InternalMessageSchema: z.ZodObject<{
type: z.ZodEnum<["cdp-inbound-event", "cdp-outbound-event", "ee-air-inbound-event", "ee-air-outbound-event"]>;
connectorConfig: z.ZodObject<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, z.ZodTypeAny, "passthrough">>;
payload: z.ZodUnknown;
}, "strip", z.ZodTypeAny, {
type: "cdp-inbound-event" | "cdp-outbound-event" | "ee-air-inbound-event" | "ee-air-outbound-event";
connectorConfig: {
unit_id: string;
credentials: {
clientId: string;
secret: string;
};
connection_url: string;
platform: {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
};
domains: {
wallet: string;
resources: string;
pos: string;
};
} & {
[k: string]: unknown;
};
payload?: unknown;
}, {
type: "cdp-inbound-event" | "cdp-outbound-event" | "ee-air-inbound-event" | "ee-air-outbound-event";
connectorConfig: {
unit_id: string;
credentials: {
clientId: string;
secret: string;
};
connection_url: string;
platform: {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
};
domains: {
wallet: string;
resources: string;
pos: string;
};
} & {
[k: string]: unknown;
};
payload?: unknown;
}>;
export type InternalMessage = z.infer<typeof InternalMessageSchema>;
export declare const CdpOutboundEventPayloadSchema: z.ZodObject<{
type: z.ZodLiteral<"services/trigger">;
body: z.ZodObject<{
identityValue: z.ZodString;
walletTransaction: z.ZodObject<{
reference: z.ZodString;
}, "strip", z.ZodTypeAny, {
reference: string;
}, {
reference: string;
}>;
triggers: z.ZodArray<z.ZodObject<{
reference: z.ZodString;
}, "strip", z.ZodTypeAny, {
reference: string;
}, {
reference: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
}, {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
}>;
}, "strip", z.ZodTypeAny, {
type: "services/trigger";
body: {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
};
}, {
type: "services/trigger";
body: {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
};
}>;
export declare const CdpOutboundEventSchema: z.ZodObject<z.objectUtil.extendShape<{
type: z.ZodEnum<["cdp-inbound-event", "cdp-outbound-event", "ee-air-inbound-event", "ee-air-outbound-event"]>;
connectorConfig: z.ZodObject<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, z.ZodTypeAny, "passthrough">>;
payload: z.ZodUnknown;
}, {
type: z.ZodLiteral<"cdp-outbound-event">;
payload: z.ZodObject<{
type: z.ZodLiteral<"services/trigger">;
body: z.ZodObject<{
identityValue: z.ZodString;
walletTransaction: z.ZodObject<{
reference: z.ZodString;
}, "strip", z.ZodTypeAny, {
reference: string;
}, {
reference: string;
}>;
triggers: z.ZodArray<z.ZodObject<{
reference: z.ZodString;
}, "strip", z.ZodTypeAny, {
reference: string;
}, {
reference: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
}, {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
}>;
}, "strip", z.ZodTypeAny, {
type: "services/trigger";
body: {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
};
}, {
type: "services/trigger";
body: {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
};
}>;
}>, "strip", z.ZodTypeAny, {
type: "cdp-outbound-event";
connectorConfig: {
unit_id: string;
credentials: {
clientId: string;
secret: string;
};
connection_url: string;
platform: {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
};
domains: {
wallet: string;
resources: string;
pos: string;
};
} & {
[k: string]: unknown;
};
payload: {
type: "services/trigger";
body: {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
};
};
}, {
type: "cdp-outbound-event";
connectorConfig: {
unit_id: string;
credentials: {
clientId: string;
secret: string;
};
connection_url: string;
platform: {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
};
domains: {
wallet: string;
resources: string;
pos: string;
};
} & {
[k: string]: unknown;
};
payload: {
type: "services/trigger";
body: {
identityValue: string;
walletTransaction: {
reference: string;
};
triggers: {
reference: string;
}[];
};
};
}>;
export type CdpOutboundEvent = z.infer<typeof CdpOutboundEventSchema>;
export declare const EeAirInboundEventPayloadSchema: z.ZodObject<{
url: z.ZodString;
method: z.ZodEnum<["POST", "PUT", "PATCH"]>;
headers: z.ZodRecord<z.ZodString, z.ZodString>;
body: z.ZodString;
}, "strip", z.ZodTypeAny, {
body: string;
url: string;
method: "POST" | "PUT" | "PATCH";
headers: Record<string, string>;
}, {
body: string;
url: string;
method: "POST" | "PUT" | "PATCH";
headers: Record<string, string>;
}>;
export declare const EeAirInboundEventSchema: z.ZodObject<z.objectUtil.extendShape<{
type: z.ZodEnum<["cdp-inbound-event", "cdp-outbound-event", "ee-air-inbound-event", "ee-air-outbound-event"]>;
connectorConfig: z.ZodObject<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
unit_id: z.ZodString;
credentials: z.ZodObject<{
clientId: z.ZodString;
secret: z.ZodString;
}, "strip", z.ZodTypeAny, {
clientId: string;
secret: string;
}, {
clientId: string;
secret: string;
}>;
connection_url: z.ZodString;
platform: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
slug: z.ZodString;
config: z.ZodNullable<z.ZodAny>;
description: z.ZodString;
created_at: z.ZodString;
updated_at: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}, {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
}>;
domains: z.ZodObject<{
wallet: z.ZodString;
resources: z.ZodString;
pos: z.ZodString;
}, "strip", z.ZodTypeAny, {
wallet: string;
resources: string;
pos: string;
}, {
wallet: string;
resources: string;
pos: string;
}>;
}, z.ZodTypeAny, "passthrough">>;
payload: z.ZodUnknown;
}, {
type: z.ZodLiteral<"ee-air-inbound-event">;
payload: z.ZodObject<{
url: z.ZodString;
method: z.ZodEnum<["POST", "PUT", "PATCH"]>;
headers: z.ZodRecord<z.ZodString, z.ZodString>;
body: z.ZodString;
}, "strip", z.ZodTypeAny, {
body: string;
url: string;
method: "POST" | "PUT" | "PATCH";
headers: Record<string, string>;
}, {
body: string;
url: string;
method: "POST" | "PUT" | "PATCH";
headers: Record<string, string>;
}>;
}>, "strip", z.ZodTypeAny, {
type: "ee-air-inbound-event";
connectorConfig: {
unit_id: string;
credentials: {
clientId: string;
secret: string;
};
connection_url: string;
platform: {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
};
domains: {
wallet: string;
resources: string;
pos: string;
};
} & {
[k: string]: unknown;
};
payload: {
body: string;
url: string;
method: "POST" | "PUT" | "PATCH";
headers: Record<string, string>;
};
}, {
type: "ee-air-inbound-event";
connectorConfig: {
unit_id: string;
credentials: {
clientId: string;
secret: string;
};
connection_url: string;
platform: {
id: string;
name: string;
slug: string;
description: string;
created_at: string;
updated_at: string;
config?: any;
};
domains: {
wallet: string;
resources: string;
pos: string;
};
} & {
[k: string]: unknown;
};
payload: {
body: string;
url: string;
method: "POST" | "PUT" | "PATCH";
headers: Record<string, string>;
};
}>;
export type EeAirInboundEvent = z.infer<typeof EeAirInboundEventSchema>;