@chordcommerce/analytics
Version:
Chord Commerce event tracking
697 lines (696 loc) • 20.5 kB
TypeScript
import { z } from 'zod';
export declare const identifyTraitsSchema: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
address: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
city: z.ZodOptional<z.ZodString>;
country: z.ZodOptional<z.ZodString>;
postalCode: z.ZodOptional<z.ZodString>;
state: z.ZodOptional<z.ZodString>;
street: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
city?: string;
country?: string;
postalCode?: string;
state?: string;
street?: string;
}, {
city?: string;
country?: string;
postalCode?: string;
state?: string;
street?: string;
}>>>;
age: z.ZodOptional<z.ZodNumber>;
avatar: z.ZodOptional<z.ZodString>;
birthday: z.ZodOptional<z.ZodString>;
company: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
industry: z.ZodOptional<z.ZodString>;
employeeCount: z.ZodOptional<z.ZodNumber>;
plan: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name?: string;
id?: string | number;
industry?: string;
employeeCount?: number;
plan?: string;
}, {
name?: string;
id?: string | number;
industry?: string;
employeeCount?: number;
plan?: string;
}>>>;
createdAt: z.ZodOptional<z.ZodString>;
description: z.ZodOptional<z.ZodString>;
email: z.ZodOptional<z.ZodString>;
firstName: z.ZodOptional<z.ZodString>;
gender: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
lastName: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
phone: z.ZodOptional<z.ZodString>;
title: z.ZodOptional<z.ZodString>;
username: z.ZodOptional<z.ZodString>;
website: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
address?: Record<string, any> & {
city?: string;
country?: string;
postalCode?: string;
state?: string;
street?: string;
};
age?: number;
avatar?: string;
birthday?: string;
company?: Record<string, any> & {
name?: string;
id?: string | number;
industry?: string;
employeeCount?: number;
plan?: string;
};
createdAt?: string;
description?: string;
email?: string;
firstName?: string;
gender?: string;
id?: string;
lastName?: string;
name?: string;
phone?: string;
title?: string;
username?: string;
website?: string;
}, {
address?: Record<string, any> & {
city?: string;
country?: string;
postalCode?: string;
state?: string;
street?: string;
};
age?: number;
avatar?: string;
birthday?: string;
company?: Record<string, any> & {
name?: string;
id?: string | number;
industry?: string;
employeeCount?: number;
plan?: string;
};
createdAt?: string;
description?: string;
email?: string;
firstName?: string;
gender?: string;
id?: string;
lastName?: string;
name?: string;
phone?: string;
title?: string;
username?: string;
website?: string;
}>>;
export declare const productSchema: z.ZodObject<{
affiliation: z.ZodOptional<z.ZodString>;
brand: z.ZodOptional<z.ZodString>;
bundle: z.ZodOptional<z.ZodBoolean>;
category: z.ZodOptional<z.ZodString>;
description: z.ZodOptional<z.ZodString>;
image_url: z.ZodOptional<z.ZodString>;
name: z.ZodString;
option_values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
position: z.ZodOptional<z.ZodNumber>;
price: z.ZodNumber;
product_id: z.ZodString;
sku: z.ZodString;
slug: z.ZodOptional<z.ZodString>;
url: z.ZodOptional<z.ZodString>;
variant: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
description?: string;
image_url?: string;
name?: string;
option_values?: string[];
position?: number;
price?: number;
product_id?: string;
sku?: string;
slug?: string;
url?: string;
variant?: string;
}, {
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
description?: string;
image_url?: string;
name?: string;
option_values?: string[];
position?: number;
price?: number;
product_id?: string;
sku?: string;
slug?: string;
url?: string;
variant?: string;
}>;
export declare const lineItemSchema: z.ZodObject<{
description: z.ZodOptional<z.ZodString>;
name: z.ZodString;
product_id: z.ZodString;
affiliation: z.ZodOptional<z.ZodString>;
brand: z.ZodOptional<z.ZodString>;
bundle: z.ZodOptional<z.ZodBoolean>;
category: z.ZodOptional<z.ZodString>;
image_url: z.ZodOptional<z.ZodString>;
option_values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
position: z.ZodOptional<z.ZodNumber>;
price: z.ZodNumber;
sku: z.ZodString;
slug: z.ZodOptional<z.ZodString>;
url: z.ZodOptional<z.ZodString>;
variant: z.ZodOptional<z.ZodString>;
coupon: z.ZodOptional<z.ZodString>;
line_item_id: z.ZodOptional<z.ZodString>;
quantity: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}>;
export declare const orderSchema: z.ZodObject<{
affiliation: z.ZodOptional<z.ZodString>;
campaign_id: z.ZodOptional<z.ZodNumber>;
channel: z.ZodOptional<z.ZodString>;
checkout_type: z.ZodOptional<z.ZodString>;
coupon: z.ZodOptional<z.ZodString>;
currency: z.ZodOptional<z.ZodString>;
discount: z.ZodOptional<z.ZodNumber>;
email: z.ZodOptional<z.ZodString>;
first_name: z.ZodOptional<z.ZodString>;
has_subscription: z.ZodOptional<z.ZodBoolean>;
is_recurring: z.ZodOptional<z.ZodBoolean>;
last_name: z.ZodOptional<z.ZodString>;
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
order_date: z.ZodOptional<z.ZodString>;
order_id: z.ZodOptional<z.ZodString>;
phone: z.ZodOptional<z.ZodString>;
products: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{
description: z.ZodOptional<z.ZodString>;
name: z.ZodString;
product_id: z.ZodString;
affiliation: z.ZodOptional<z.ZodString>;
brand: z.ZodOptional<z.ZodString>;
bundle: z.ZodOptional<z.ZodBoolean>;
category: z.ZodOptional<z.ZodString>;
image_url: z.ZodOptional<z.ZodString>;
option_values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
position: z.ZodOptional<z.ZodNumber>;
price: z.ZodNumber;
sku: z.ZodString;
slug: z.ZodOptional<z.ZodString>;
url: z.ZodOptional<z.ZodString>;
variant: z.ZodOptional<z.ZodString>;
coupon: z.ZodOptional<z.ZodString>;
line_item_id: z.ZodOptional<z.ZodString>;
quantity: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}>, z.ZodObject<{
bundle_size: z.ZodOptional<z.ZodNumber>;
cross_sold_quantity: z.ZodOptional<z.ZodNumber>;
variant_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
bundle_size?: number;
cross_sold_quantity?: number;
variant_metadata?: Record<string, unknown>;
}, {
bundle_size?: number;
cross_sold_quantity?: number;
variant_metadata?: Record<string, unknown>;
}>>, "many">>;
purl_link: z.ZodOptional<z.ZodString>;
referral_identifier_id: z.ZodOptional<z.ZodString>;
revenue: z.ZodOptional<z.ZodNumber>;
shipping: z.ZodOptional<z.ZodNumber>;
shipping_city: z.ZodOptional<z.ZodString>;
shipping_country: z.ZodOptional<z.ZodString>;
shipping_method_details: z.ZodOptional<z.ZodObject<{
shipping_code: z.ZodOptional<z.ZodString>;
shipping_method: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
shipping_code?: string;
shipping_method?: string;
}, {
shipping_code?: string;
shipping_method?: string;
}>>;
shipping_state: z.ZodOptional<z.ZodString>;
shipping_zipcode: z.ZodOptional<z.ZodString>;
tax: z.ZodOptional<z.ZodNumber>;
template_id: z.ZodOptional<z.ZodNumber>;
total: z.ZodOptional<z.ZodNumber>;
tracking_ids: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
affiliation?: string;
campaign_id?: number;
channel?: string;
checkout_type?: string;
coupon?: string;
currency?: string;
discount?: number;
email?: string;
first_name?: string;
has_subscription?: boolean;
is_recurring?: boolean;
last_name?: string;
metadata?: Record<string, unknown>;
order_date?: string;
order_id?: string;
phone?: string;
products?: ({
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
} & {
bundle_size?: number;
cross_sold_quantity?: number;
variant_metadata?: Record<string, unknown>;
})[];
purl_link?: string;
referral_identifier_id?: string;
revenue?: number;
shipping?: number;
shipping_city?: string;
shipping_country?: string;
shipping_method_details?: {
shipping_code?: string;
shipping_method?: string;
};
shipping_state?: string;
shipping_zipcode?: string;
tax?: number;
template_id?: number;
total?: number;
tracking_ids?: Record<string, unknown>;
}, {
affiliation?: string;
campaign_id?: number;
channel?: string;
checkout_type?: string;
coupon?: string;
currency?: string;
discount?: number;
email?: string;
first_name?: string;
has_subscription?: boolean;
is_recurring?: boolean;
last_name?: string;
metadata?: Record<string, unknown>;
order_date?: string;
order_id?: string;
phone?: string;
products?: ({
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
} & {
bundle_size?: number;
cross_sold_quantity?: number;
variant_metadata?: Record<string, unknown>;
})[];
purl_link?: string;
referral_identifier_id?: string;
revenue?: number;
shipping?: number;
shipping_city?: string;
shipping_country?: string;
shipping_method_details?: {
shipping_code?: string;
shipping_method?: string;
};
shipping_state?: string;
shipping_zipcode?: string;
tax?: number;
template_id?: number;
total?: number;
tracking_ids?: Record<string, unknown>;
}>;
export declare const checkoutSchema: z.ZodObject<{
affiliation: z.ZodOptional<z.ZodString>;
checkout_type: z.ZodOptional<z.ZodString>;
coupon: z.ZodOptional<z.ZodString>;
currency: z.ZodOptional<z.ZodString>;
discount: z.ZodOptional<z.ZodNumber>;
order_id: z.ZodOptional<z.ZodString>;
order_name: z.ZodOptional<z.ZodString>;
products: z.ZodArray<z.ZodObject<{
description: z.ZodOptional<z.ZodString>;
name: z.ZodString;
product_id: z.ZodString;
affiliation: z.ZodOptional<z.ZodString>;
brand: z.ZodOptional<z.ZodString>;
bundle: z.ZodOptional<z.ZodBoolean>;
category: z.ZodOptional<z.ZodString>;
image_url: z.ZodOptional<z.ZodString>;
option_values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
position: z.ZodOptional<z.ZodNumber>;
price: z.ZodNumber;
sku: z.ZodString;
slug: z.ZodOptional<z.ZodString>;
url: z.ZodOptional<z.ZodString>;
variant: z.ZodOptional<z.ZodString>;
coupon: z.ZodOptional<z.ZodString>;
line_item_id: z.ZodOptional<z.ZodString>;
quantity: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}>, "many">;
revenue: z.ZodOptional<z.ZodNumber>;
shipping: z.ZodOptional<z.ZodNumber>;
tax: z.ZodOptional<z.ZodNumber>;
value: z.ZodOptional<z.ZodNumber>;
step: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
affiliation?: string;
checkout_type?: string;
coupon?: string;
currency?: string;
discount?: number;
order_id?: string;
order_name?: string;
products?: {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}[];
revenue?: number;
shipping?: number;
tax?: number;
value?: number;
step?: number;
}, {
affiliation?: string;
checkout_type?: string;
coupon?: string;
currency?: string;
discount?: number;
order_id?: string;
order_name?: string;
products?: {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}[];
revenue?: number;
shipping?: number;
tax?: number;
value?: number;
step?: number;
}>;
export declare const cartSchema: z.ZodObject<{
cart_id: z.ZodOptional<z.ZodString>;
currency: z.ZodOptional<z.ZodString>;
products: z.ZodArray<z.ZodObject<{
description: z.ZodOptional<z.ZodString>;
name: z.ZodString;
product_id: z.ZodString;
affiliation: z.ZodOptional<z.ZodString>;
brand: z.ZodOptional<z.ZodString>;
bundle: z.ZodOptional<z.ZodBoolean>;
category: z.ZodOptional<z.ZodString>;
image_url: z.ZodOptional<z.ZodString>;
option_values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
position: z.ZodOptional<z.ZodNumber>;
price: z.ZodNumber;
sku: z.ZodString;
slug: z.ZodOptional<z.ZodString>;
url: z.ZodOptional<z.ZodString>;
variant: z.ZodOptional<z.ZodString>;
coupon: z.ZodOptional<z.ZodString>;
line_item_id: z.ZodOptional<z.ZodString>;
quantity: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}, {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}>, "many">;
value: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
cart_id?: string;
currency?: string;
products?: {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}[];
value?: number;
}, {
cart_id?: string;
currency?: string;
products?: {
description?: string;
name?: string;
product_id?: string;
affiliation?: string;
brand?: string;
bundle?: boolean;
category?: string;
image_url?: string;
option_values?: string[];
position?: number;
price?: number;
sku?: string;
slug?: string;
url?: string;
variant?: string;
coupon?: string;
line_item_id?: string;
quantity?: number;
}[];
value?: number;
}>;