UNPKG

commerce-kit

Version:

1,456 lines (1,455 loc) 257 kB
type JSONContent = Record<string, unknown>; type APIProductsBrowseResult = Omit<{ data: (({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle" | "set"; slug: string; status: "published" | "draft" | "hidden" | null; flags: unknown; storeId: string; summary: string | null; content: JSONContent | null; images: string[]; badge: unknown; bundleDiscountPercentage: string | null; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; stripeTaxCode: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; storeId: string; description: JSONContent | null; position: string; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; longDescription: JSONContent | null; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; filter: { type: "manual"; } | { type: "dynamicPrice"; min?: number | null | undefined; max?: number | null | undefined; }; storeId: string; description: JSONContent | null; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; tr: { locale: string; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; prices: { createdAt: string; updatedAt: string; currency: string; storeId: string; price: string; calculatedPrice: string | null; variantId: string; }[]; }[]; subscriptionPlanProducts: { createdAt: string; updatedAt: string; position: number; productId: string; subscriptionPlanId: string; subscriptionPlan: { id: string; name: string; createdAt: string; updatedAt: string; interval: number; active: boolean; storeId: string; description: string | null; position: number; cadence: "month" | "week"; discountPercent: number; benefits: string | null; }; }[]; } & { variants: ({ id: string; price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle" | "set"; slug: string; status: "published" | "draft" | "hidden" | null; flags: unknown; storeId: string; summary: string | null; content: JSONContent | null; images: string[]; badge: unknown; bundleDiscountPercentage: string | null; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; stripeTaxCode: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; storeId: string; description: JSONContent | null; position: string; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; longDescription: JSONContent | null; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; filter: { type: "manual"; } | { type: "dynamicPrice"; min?: number | null | undefined; max?: number | null | undefined; }; storeId: string; description: JSONContent | null; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; tr: { locale: string; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; prices: { createdAt: string; updatedAt: string; currency: string; storeId: string; price: string; calculatedPrice: string | null; variantId: string; }[]; }[]; subscriptionPlanProducts: { createdAt: string; updatedAt: string; position: number; productId: string; subscriptionPlanId: string; subscriptionPlan: { id: string; name: string; createdAt: string; updatedAt: string; interval: number; active: boolean; storeId: string; description: string | null; position: number; cadence: "month" | "week"; discountPercent: number; benefits: string | null; }; }[]; } & { variants: ({ id: string; price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle" | "set"; slug: string; status: "published" | "draft" | "hidden" | null; flags: unknown; storeId: string; summary: string | null; content: JSONContent | null; images: string[]; badge: unknown; bundleDiscountPercentage: string | null; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; stripeTaxCode: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; storeId: string; description: JSONContent | null; position: string; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; longDescription: JSONContent | null; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; filter: { type: "manual"; } | { type: "dynamicPrice"; min?: number | null | undefined; max?: number | null | undefined; }; storeId: string; description: JSONContent | null; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; tr: { locale: string; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; prices: { createdAt: string; updatedAt: string; currency: string; storeId: string; price: string; calculatedPrice: string | null; variantId: string; }[]; }[]; subscriptionPlanProducts: { createdAt: string; updatedAt: string; position: number; productId: string; subscriptionPlanId: string; subscriptionPlan: { id: string; name: string; createdAt: string; updatedAt: string; interval: number; active: boolean; storeId: string; description: string | null; position: number; cadence: "month" | "week"; discountPercent: number; benefits: string | null; }; }[]; } & { variants: ({ id: string; price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle" | "set"; slug: string; status: "published" | "draft" | "hidden" | null; flags: unknown; storeId: string; summary: string | null; content: JSONContent | null; images: string[]; badge: unknown; bundleDiscountPercentage: string | null; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; stripeTaxCode: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; storeId: string; description: JSONContent | null; position: string; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; longDescription: JSONContent | null; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; filter: { type: "manual"; } | { type: "dynamicPrice"; min?: number | null | undefined; max?: number | null | undefined; }; storeId: string; description: JSONContent | null; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; tr: { locale: string; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; prices: { createdAt: string; updatedAt: string; currency: string; storeId: string; price: string; calculatedPrice: string | null; variantId: string; }[]; }[]; subscriptionPlanProducts: { createdAt: string; updatedAt: string; position: number; productId: string; subscriptionPlanId: string; subscriptionPlan: { id: string; name: string; createdAt: string; updatedAt: string; interval: number; active: boolean; storeId: string; description: string | null; position: number; cadence: "month" | "week"; discountPercent: number; benefits: string | null; }; }[]; } & { variants: ({ id: string; price: string; } & { prePromotionPrice: undefined; price: string; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle" | "set"; slug: string; status: "published" | "draft" | "hidden" | null; flags: unknown; storeId: string; summary: string | null; content: JSONContent | null; images: string[]; badge: unknown; bundleDiscountPercentage: string | null; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; stripeTaxCode: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; storeId: string; description: JSONContent | null; position: string; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; longDescription: JSONContent | null; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; filter: { type: "manual"; } | { type: "dynamicPrice"; min?: number | null | undefined; max?: number | null | undefined; }; storeId: string; description: JSONContent | null; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; tr: { locale: string; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; prices: { createdAt: string; updatedAt: string; currency: string; storeId: string; price: string; calculatedPrice: string | null; variantId: string; }[]; }[]; subscriptionPlanProducts: { createdAt: string; updatedAt: string; position: number; productId: string; subscriptionPlanId: string; subscriptionPlan: { id: string; name: string; createdAt: string; updatedAt: string; interval: number; active: boolean; storeId: string; description: string | null; position: number; cadence: "month" | "week"; discountPercent: number; benefits: string | null; }; }[]; } & { variants: ({ id: string; price: string; } & { prePromotionPrice: string | null; })[]; }))[]; meta: { count: number; countPublished: number; countDraft: number; countHidden: number; nextCursor: string | undefined; }; }, "data"> & { data: Array<{ data: (({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle" | "set"; slug: string; status: "published" | "draft" | "hidden" | null; flags: unknown; storeId: string; summary: string | null; content: JSONContent | null; images: string[]; badge: unknown; bundleDiscountPercentage: string | null; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; stripeTaxCode: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; storeId: string; description: JSONContent | null; position: string; seo: { title?: string | null | undefined; description?: string | null | undefined; canonical?: string | null | undefined; } | null; longDescription: JSONContent | null; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; slug: string; active: boolean; filter: { type: "manual"; } | { type: "dynamicPrice"; min?: number | null | undefined; max?: number | null | undefined; }; storeId: string; description: JSONContent | null; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; label: string | null; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; tr: { locale: string; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; prices: { createdAt: string; updatedAt: string; currency: string; storeId: string; price: string; calculatedPrice: string | null; variantId: string; }[]; }[]; subscriptionPlanProducts: { createdAt: string; updatedAt: string; position: number; productId: string; subscriptionPlanId: string; subscriptionPlan: { id: string; name: string; createdAt: string; updatedAt: string; interval: number;