UNPKG

@pfantato/printful-ts

Version:

Typescript SDK to integrate with Printful

70 lines (69 loc) 2.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Shipment = exports.ShipmentItem = exports.EstimatedDelivery = exports.TrackingEvent = exports.DepartureAddress = exports.DeliveryStatus = exports.ShipmentStatus = void 0; const zod_1 = require("zod"); const common_1 = require("@printful-ts/schemas/common"); exports.ShipmentStatus = zod_1.z.enum([ 'pending', 'onhold', 'canceled', 'packaged', 'shipped', 'returned', 'outstock', ]); exports.DeliveryStatus = zod_1.z.enum([ 'unknown', 'delivered', 'pre_transit', 'in_transit', 'out_for_delivery', 'available_for_pickup', 'return_to_sender', 'failure', 'canceled', ]); exports.DepartureAddress = zod_1.z.object({ country_name: zod_1.z.string(), country_code: zod_1.z.string(), state_code: zod_1.z.string().nullable(), }); exports.TrackingEvent = zod_1.z.object({ triggered_at: zod_1.z.string().datetime(), description: zod_1.z.string(), }); exports.EstimatedDelivery = zod_1.z.object({ from_date: zod_1.z.string().datetime(), to_date: zod_1.z.string().datetime(), calculated_at: zod_1.z.string().datetime(), }); exports.ShipmentItem = zod_1.z.object({ id: zod_1.z.number(), order_item_id: zod_1.z.number(), order_item_external_id: zod_1.z.string().nullable(), order_item_name: zod_1.z.string().nullable(), quantity: zod_1.z.number(), _links: zod_1.z.object({ order_item: zod_1.z.object({ href: zod_1.z.string(), }), }), }); exports.Shipment = zod_1.z.object({ id: zod_1.z.number(), order_id: zod_1.z.number(), carrier: zod_1.z.string().nullable(), shipment_status: exports.ShipmentStatus, shipped_at: zod_1.z.string().datetime().nullable(), delivery_status: exports.DeliveryStatus, delivery_at: zod_1.z.string().datetime().nullable(), departure_addess: exports.DepartureAddress, is_reshipment: zod_1.z.boolean(), tracking_url: zod_1.z.string().url().nullable(), tracking_events: zod_1.z.array(exports.TrackingEvent), shipment_items: zod_1.z.array(exports.ShipmentItem), _links: zod_1.z.object({ self: common_1.HateoasLink, order: common_1.HateoasLink, }), });