@pfantato/printful-ts
Version:
Typescript SDK to integrate with Printful
74 lines (73 loc) • 2.67 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StoreStatistics = exports.CostsByVariantValue = exports.CostsByProductValue = exports.CostsByAmountValue = exports.RelativeCosts = exports.SalesAndCostsSummaryValue = exports.SalesAndCostsValue = exports.ReportType = void 0;
const zod_1 = require("zod");
const price_schema_1 = require("./price.schema");
exports.ReportType = zod_1.z.enum([
'sales_and_costs',
'profit',
'average_fulfillment_type',
'costs_by_amount',
'costs_by_product',
'costs_by_variant',
'printful_costs',
'sales_and_costs_summary',
'total_paid_orders',
]);
exports.SalesAndCostsValue = zod_1.z.object({
date: zod_1.z.string().date(),
sales: zod_1.z.string(),
fulfillment: zod_1.z.string(),
profit: zod_1.z.string(),
sales_discount: zod_1.z.string(),
fulfillment_discount: zod_1.z.string(),
sales_shipping: zod_1.z.string(),
fulfillment_shipping: zod_1.z.string(),
});
exports.SalesAndCostsSummaryValue = zod_1.z.object({
date: zod_1.z.string().date(),
order_count: zod_1.z.number(),
costs: zod_1.z.string(),
profit: zod_1.z.string(),
});
exports.RelativeCosts = zod_1.z.object({
value: zod_1.z.string(),
relative_difference: zod_1.z.string().nullable(),
});
exports.CostsByAmountValue = zod_1.z.object({
date: zod_1.z.string().date(),
product_amount: zod_1.z.string(),
digitization: zod_1.z.string(),
branding: zod_1.z.string(),
vat: zod_1.z.string(),
sales_tax: zod_1.z.string(),
shipping: zod_1.z.string(),
discount: zod_1.z.string(),
total: zod_1.z.string(),
});
exports.CostsByProductValue = zod_1.z.object({
product_id: zod_1.z.number(),
product_name: zod_1.z.string(),
fulfillment: zod_1.z.string(),
sales: zod_1.z.string(),
quantity: zod_1.z.number(),
});
exports.CostsByVariantValue = exports.CostsByProductValue.omit({
product_name: true,
}).extend({
variant_id: zod_1.z.number(),
variant_name: zod_1.z.string(),
});
exports.StoreStatistics = zod_1.z.object({
store_id: zod_1.z.number(),
currency: price_schema_1.Currency,
sales_and_costs: zod_1.z.array(exports.SalesAndCostsValue),
sales_and_costs_summary: zod_1.z.array(exports.SalesAndCostsSummaryValue),
printful_costs: exports.RelativeCosts,
profit: exports.RelativeCosts,
total_paid_orders: exports.RelativeCosts,
costs_by_amount: zod_1.z.array(exports.CostsByAmountValue),
costs_by_product: zod_1.z.array(exports.CostsByProductValue),
costs_by_variant: zod_1.z.array(exports.CostsByVariantValue),
average_fulfillment_time: exports.RelativeCosts,
});