UNPKG

bitsnap-checkout

Version:

This is Bitsnap Checkout React library for easy integration with any website which is using React framework

102 lines (101 loc) 3.69 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/models.ts var models_exports = {}; __export(models_exports, { BitsnapModels: () => BitsnapModels }); module.exports = __toCommonJS(models_exports); var z = __toESM(require("zod")); var BitsnapModels; ((BitsnapModels2) => { BitsnapModels2.BaselinkerFieldsSchema = z.object({ storageID: z.string().optional() }); BitsnapModels2.MetadataSchema = z.record(z.string(), z.any()); BitsnapModels2.VariantSchema = z.object({ id: z.string(), name: z.string(), price: z.number(), currency: z.string(), metadata: BitsnapModels2.MetadataSchema.optional(), images: z.array(z.string()), availableQuantity: z.number() }); BitsnapModels2.AdditionalSchema = z.object({ sku: z.string().optional(), baselinkerFields: BitsnapModels2.BaselinkerFieldsSchema.optional() }); BitsnapModels2.ItemSchema = z.object({ id: z.string(), ownerID: z.string().optional(), name: z.string(), description: z.union([z.string(), z.null()]).optional(), createdAt: z.number().optional(), updatedAt: z.number().optional(), price: z.number(), currency: z.string(), metadata: BitsnapModels2.MetadataSchema.optional(), image_url: z.string(), images: z.array(z.string()), isDeliverable: z.boolean().optional(), availableQuantity: z.number().optional(), additional: BitsnapModels2.AdditionalSchema.optional(), variants: z.array(BitsnapModels2.VariantSchema).optional() }); BitsnapModels2.DataSchema = z.object({ success: z.boolean(), result: z.array(BitsnapModels2.ItemSchema), totalCount: z.number() }); BitsnapModels2.ProductsResultResultSchema = z.object({ data: BitsnapModels2.DataSchema }); BitsnapModels2.ProductsResultElementSchema = z.array( z.object({ result: BitsnapModels2.ProductsResultResultSchema }) ); BitsnapModels2.ProductResultSchema = z.array( z.object({ result: z.object({ data: z.object({ success: z.boolean(), message: z.string().optional(), result: BitsnapModels2.ItemSchema.optional() }) }) }) ); })(BitsnapModels || (BitsnapModels = {})); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { BitsnapModels }); //# sourceMappingURL=models.js.map