From 48668c27df8146ba3dff6c0f7b2594f16cbd0972 Mon Sep 17 00:00:00 2001
From: ChinmayeeMestry
Date: Wed, 24 Apr 2024 13:50:44 +0530
Subject: [PATCH 1/2] removed unwanted files and added env.template file
---
.env.template | 28 +
.gitignore | 3 +-
contentstack-app/.eslintignore | 5 -
contentstack-app/.eslintrc.js | 18 -
contentstack-app/.gitignore | 1 -
contentstack-app/.graphqlrc.yml | 1 -
contentstack-app/CHANGELOG.md | 213 --
contentstack-app/README.md | 40 -
contentstack-app/app/components/Aside.tsx | 47 -
contentstack-app/app/components/Cart.tsx | 340 ---
contentstack-app/app/components/Footer.tsx | 112 -
contentstack-app/app/components/Header.tsx | 186 --
contentstack-app/app/components/Layout.tsx | 108 -
contentstack-app/app/components/Search.tsx | 475 ----
contentstack-app/app/entry.client.tsx | 12 -
contentstack-app/app/entry.server.tsx | 41 -
contentstack-app/app/root.tsx | 280 ---
contentstack-app/app/styles/app.css | 472 ----
contentstack-app/app/styles/reset.css | 129 --
contentstack-app/app/utils.ts | 46 -
contentstack-app/package.json | 45 -
contentstack-app/public/favicon.svg | 28 -
contentstack-app/remix.config.js | 19 -
contentstack-app/remix.env.d.ts | 50 -
contentstack-app/server.ts | 256 ---
contentstack-app/storefrontapi.generated.d.ts | 1930 -----------------
contentstack-app/tsconfig.json | 23 -
27 files changed, 29 insertions(+), 4879 deletions(-)
create mode 100644 .env.template
delete mode 100644 contentstack-app/.eslintignore
delete mode 100644 contentstack-app/.eslintrc.js
delete mode 100644 contentstack-app/.gitignore
delete mode 100644 contentstack-app/.graphqlrc.yml
delete mode 100644 contentstack-app/CHANGELOG.md
delete mode 100644 contentstack-app/README.md
delete mode 100644 contentstack-app/app/components/Aside.tsx
delete mode 100644 contentstack-app/app/components/Cart.tsx
delete mode 100644 contentstack-app/app/components/Footer.tsx
delete mode 100644 contentstack-app/app/components/Header.tsx
delete mode 100644 contentstack-app/app/components/Layout.tsx
delete mode 100644 contentstack-app/app/components/Search.tsx
delete mode 100644 contentstack-app/app/entry.client.tsx
delete mode 100644 contentstack-app/app/entry.server.tsx
delete mode 100644 contentstack-app/app/root.tsx
delete mode 100644 contentstack-app/app/styles/app.css
delete mode 100644 contentstack-app/app/styles/reset.css
delete mode 100644 contentstack-app/app/utils.ts
delete mode 100644 contentstack-app/package.json
delete mode 100644 contentstack-app/public/favicon.svg
delete mode 100644 contentstack-app/remix.config.js
delete mode 100644 contentstack-app/remix.env.d.ts
delete mode 100644 contentstack-app/server.ts
delete mode 100644 contentstack-app/storefrontapi.generated.d.ts
delete mode 100644 contentstack-app/tsconfig.json
diff --git a/.env.template b/.env.template
new file mode 100644
index 0000000..60c6650
--- /dev/null
+++ b/.env.template
@@ -0,0 +1,28 @@
+# These variables are only available locally in MiniOxygen
+# https://shopify.dev/docs/custom-storefronts/hydrogen/environment-variables
+
+## Shopify Environment Variables
+# A secret used to sign session cookies.
+SESSION_SECRET="foobar"
+# The public access token for the Storefront API.
+PUBLIC_STOREFRONT_API_TOKEN=""
+# The private access token for the Storefront API.
+PRIVATE_STOREFRONT_API_TOKEN=""
+# The id of the store used to communicate with the Storefront API.
+PUBLIC_STOREFRONT_ID=""
+# The client id of the public customer account used to communicate with the Storefront API.
+PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID=""
+# The url of the public customer account used to communicate with the Storefront API.
+PUBLIC_CUSTOMER_ACCOUNT_API_URL=""
+# The domain of the store used to communicate with the Storefront API.
+PUBLIC_STORE_DOMAIN=""
+
+## Contentstack Environment Variables
+# Stack API key
+CONTENTSTACK_API_KEY=""
+# Delivery token for the Stack
+CONTENTSTACK_DELIVERY_TOKEN=""
+# Environment name
+CONTENTSTACK_ENVIRONMENT=""
+# Region name
+CONTENTSTACK_REGION=""
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 0081f9e..b38f8d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,4 @@
/.mf
.env
.shopify
-/node_modules
-/README 2.md
\ No newline at end of file
+/node_modules
\ No newline at end of file
diff --git a/contentstack-app/.eslintignore b/contentstack-app/.eslintignore
deleted file mode 100644
index a362bca..0000000
--- a/contentstack-app/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build
-node_modules
-bin
-*.d.ts
-dist
diff --git a/contentstack-app/.eslintrc.js b/contentstack-app/.eslintrc.js
deleted file mode 100644
index 57a969e..0000000
--- a/contentstack-app/.eslintrc.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * @type {import("@types/eslint").Linter.BaseConfig}
- */
-module.exports = {
- extends: [
- '@remix-run/eslint-config',
- 'plugin:hydrogen/recommended',
- 'plugin:hydrogen/typescript',
- ],
- rules: {
- '@typescript-eslint/ban-ts-comment': 'off',
- '@typescript-eslint/naming-convention': 'off',
- 'hydrogen/prefer-image-component': 'off',
- 'no-useless-escape': 'off',
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
- 'no-case-declarations': 'off',
- },
-};
diff --git a/contentstack-app/.gitignore b/contentstack-app/.gitignore
deleted file mode 100644
index ad5f2ca..0000000
--- a/contentstack-app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.shopify
diff --git a/contentstack-app/.graphqlrc.yml b/contentstack-app/.graphqlrc.yml
deleted file mode 100644
index bd38d07..0000000
--- a/contentstack-app/.graphqlrc.yml
+++ /dev/null
@@ -1 +0,0 @@
-schema: node_modules/@shopify/hydrogen-react/storefront.schema.json
diff --git a/contentstack-app/CHANGELOG.md b/contentstack-app/CHANGELOG.md
deleted file mode 100644
index 491e666..0000000
--- a/contentstack-app/CHANGELOG.md
+++ /dev/null
@@ -1,213 +0,0 @@
-# skeleton
-
-## 1.0.1
-
-### Patch Changes
-
-- Sync up environment variable names across all example & type files. ([#1542](https://github.com/Shopify/hydrogen/pull/1542)) by [@michenly](https://github.com/michenly)
-
-- Remove error boundary from robots.txt file in the Skeleton template ([#1492](https://github.com/Shopify/hydrogen/pull/1492)) by [@andrewcohen](https://github.com/andrewcohen)
-
-- Use the worker runtime by default when running the `dev` or `preview` commands. ([#1525](https://github.com/Shopify/hydrogen/pull/1525)) by [@frandiox](https://github.com/frandiox)
-
- Enable it in your project by adding the `--worker` flag to your package.json scripts:
-
- ```diff
- "scripts": {
- "build": "shopify hydrogen build",
- - "dev": "shopify hydrogen dev --codegen",
- + "dev": "shopify hydrogen dev --worker --codegen",
- - "preview": "npm run build && shopify hydrogen preview",
- + "preview": "npm run build && shopify hydrogen preview --worker",
- ...
- }
- ```
-
-- Update to the latest version of `@shopify/oxygen-workers-types`. ([#1494](https://github.com/Shopify/hydrogen/pull/1494)) by [@frandiox](https://github.com/frandiox)
-
- In TypeScript projects, when updating to the latest `@shopify/remix-oxygen` adapter release, you should also update to the latest version of `@shopify/oxygen-workers-types`:
-
- ```diff
- "devDependencies": {
- "@remix-run/dev": "2.1.0",
- "@remix-run/eslint-config": "2.1.0",
- - "@shopify/oxygen-workers-types": "^3.17.3",
- + "@shopify/oxygen-workers-types": "^4.0.0",
- "@shopify/prettier-config": "^1.1.2",
- ...
- },
- ```
-
-- Update internal dependencies for bug resolution. ([#1496](https://github.com/Shopify/hydrogen/pull/1496)) by [@vincentezw](https://github.com/vincentezw)
-
- Update your `@shopify/cli` dependency to avoid duplicated sub-dependencies:
-
- ```diff
- "dependencies": {
- - "@shopify/cli": "3.50.2",
- + "@shopify/cli": "3.51.0",
- }
- ```
-
-- Update all Node.js dependencies to version 18. (Not a breaking change, since Node.js 18 is already required by Remix v2.) ([#1543](https://github.com/Shopify/hydrogen/pull/1543)) by [@michenly](https://github.com/michenly)
-
-- 🐛 fix undefined menu error ([#1533](https://github.com/Shopify/hydrogen/pull/1533)) by [@michenly](https://github.com/michenly)
-
-- Add `@remix-run/server-runtime` dependency. ([#1489](https://github.com/Shopify/hydrogen/pull/1489)) by [@frandiox](https://github.com/frandiox)
-
- Since Remix is now a peer dependency of `@shopify/remix-oxygen`, you need to add `@remix-run/server-runtime` to your dependencies, with the same version as the rest of your Remix dependencies.
-
- ```diff
- "dependencies": {
- "@remix-run/react": "2.1.0"
- + "@remix-run/server-runtime": "2.1.0"
- ...
- }
- ```
-
-- Updated dependencies [[`b2a350a7`](https://github.com/Shopify/hydrogen/commit/b2a350a754ea2d29bc267c260dc298a02f8f4470), [`9b4f4534`](https://github.com/Shopify/hydrogen/commit/9b4f453407338874bd8f1a1f619b607670e021d0), [`74ea1dba`](https://github.com/Shopify/hydrogen/commit/74ea1dba9af37a146882df7ed9674be5659862b5), [`2be9ce82`](https://github.com/Shopify/hydrogen/commit/2be9ce82fd4a5121f1772bbb7349e96ed530e84e), [`a9b8bcde`](https://github.com/Shopify/hydrogen/commit/a9b8bcde96c22cedef7d87631d429199810b4a7a), [`bca112ed`](https://github.com/Shopify/hydrogen/commit/bca112ed7db49e533fe49898b663fa0dd318e6ba), [`848c6260`](https://github.com/Shopify/hydrogen/commit/848c6260a2db3a9cb0c86351f0f7128f61e028f0), [`d53b4ed7`](https://github.com/Shopify/hydrogen/commit/d53b4ed752eb0530622a666ea7dcf4b40239cafa), [`961fd8c6`](https://github.com/Shopify/hydrogen/commit/961fd8c630727784f77b9f693d2e8ff8601969fc), [`2bff9fc7`](https://github.com/Shopify/hydrogen/commit/2bff9fc75916fa95f9a9279d069408fb7a33755c), [`c8e8f6fd`](https://github.com/Shopify/hydrogen/commit/c8e8f6fd233e52cf5570b1904af710d6b907aae5), [`8fce70de`](https://github.com/Shopify/hydrogen/commit/8fce70de32bd61ee86a6d895ac43cc1f78f1bf49), [`f90e4d47`](https://github.com/Shopify/hydrogen/commit/f90e4d4713c6c1fc1e921a7ecd08e95fe5da1744), [`e8cc49fe`](https://github.com/Shopify/hydrogen/commit/e8cc49feff18f5ee72d5f6965ff2094addc23466)]:
- - @shopify/cli-hydrogen@6.1.0
- - @shopify/remix-oxygen@2.0.2
- - @shopify/hydrogen@2023.10.3
-
-## 1.0.0
-
-### Major Changes
-
-- The Storefront API 2023-10 now returns menu item URLs that include the `primaryDomainUrl`, instead of defaulting to the Shopify store ID URL (example.myshopify.com). The skeleton template requires changes to check for the `primaryDomainUrl`: by [@blittle](https://github.com/blittle)
-
- 1. Update the `HeaderMenu` component to accept a `primaryDomainUrl` and include
- it in the internal url check
-
- ```diff
- // app/components/Header.tsx
-
- + import type {HeaderQuery} from 'storefrontapi.generated';
-
- export function HeaderMenu({
- menu,
- + primaryDomainUrl,
- viewport,
- }: {
- menu: HeaderProps['header']['menu'];
- + primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
- viewport: Viewport;
- }) {
-
- // ...code
-
- // if the url is internal, we strip the domain
- const url =
- item.url.includes('myshopify.com') ||
- item.url.includes(publicStoreDomain) ||
- + item.url.includes(primaryDomainUrl)
- ? new URL(item.url).pathname
- : item.url;
-
- // ...code
-
- }
- ```
-
- 2. Update the `FooterMenu` component to accept a `primaryDomainUrl` prop and include
- it in the internal url check
-
- ```diff
- // app/components/Footer.tsx
-
- - import type {FooterQuery} from 'storefrontapi.generated';
- + import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated';
-
- function FooterMenu({
- menu,
- + primaryDomainUrl,
- }: {
- menu: FooterQuery['menu'];
- + primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
- }) {
- // code...
-
- // if the url is internal, we strip the domain
- const url =
- item.url.includes('myshopify.com') ||
- item.url.includes(publicStoreDomain) ||
- + item.url.includes(primaryDomainUrl)
- ? new URL(item.url).pathname
- : item.url;
-
- // ...code
-
- );
- }
- ```
-
- 3. Update the `Footer` component to accept a `shop` prop
-
- ```diff
- export function Footer({
- menu,
- + shop,
- }: FooterQuery & {shop: HeaderQuery['shop']}) {
- return (
-
- );
- }
- ```
-
- 4. Update `Layout.tsx` to pass the `shop` prop
-
- ```diff
- export function Layout({
- cart,
- children = null,
- footer,
- header,
- isLoggedIn,
- }: LayoutProps) {
- return (
- <>
-
-
-
-
- {children}
-
-
- - {(footer) => }
- + {(footer) => }
-
-
- >
- );
- }
- ```
-
-### Patch Changes
-
-- If you are calling `useMatches()` in different places of your app to access the data returned by the root loader, you may want to update it to the following pattern to enhance types: ([#1289](https://github.com/Shopify/hydrogen/pull/1289)) by [@frandiox](https://github.com/frandiox)
-
- ```ts
- // root.tsx
-
- import {useMatches} from '@remix-run/react';
- import {type SerializeFrom} from '@shopify/remix-oxygen';
-
- export const useRootLoaderData = () => {
- const [root] = useMatches();
- return root?.data as SerializeFrom;
- };
-
- export function loader(context) {
- // ...
- }
- ```
-
- This way, you can import `useRootLoaderData()` anywhere in your app and get the correct type for the data returned by the root loader.
-
-- Updated dependencies [[`81400439`](https://github.com/Shopify/hydrogen/commit/814004397c1d17ef0a53a425ed28a42cf67765cf), [`a6f397b6`](https://github.com/Shopify/hydrogen/commit/a6f397b64dc6a0d856cb7961731ee1f86bf80292), [`3464ec04`](https://github.com/Shopify/hydrogen/commit/3464ec04a084e1ceb30ee19874dc1b9171ce2b34), [`7fc088e2`](https://github.com/Shopify/hydrogen/commit/7fc088e21bea47840788cb7c60f873ce1f253128), [`867e0b03`](https://github.com/Shopify/hydrogen/commit/867e0b033fc9eb04b7250baea97d8fd49d26ccca), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3), [`f24e3424`](https://github.com/Shopify/hydrogen/commit/f24e3424c8e2b363b181b71fcbd3e45f696fdd3f), [`66a48573`](https://github.com/Shopify/hydrogen/commit/66a4857387148b6a104df5783314c74aca8aada0), [`0ae7cbe2`](https://github.com/Shopify/hydrogen/commit/0ae7cbe280d8351126e11dc13f35d7277d9b2d86), [`8198c1be`](https://github.com/Shopify/hydrogen/commit/8198c1befdfafb39fbcc88d71f91d21eae252973), [`ad45656c`](https://github.com/Shopify/hydrogen/commit/ad45656c5f663cc1a60eab5daab4da1dfd0e6cc3)]:
- - @shopify/hydrogen@2023.10.0
- - @shopify/remix-oxygen@2.0.0
- - @shopify/cli-hydrogen@6.0.0
diff --git a/contentstack-app/README.md b/contentstack-app/README.md
deleted file mode 100644
index dd59013..0000000
--- a/contentstack-app/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Hydrogen template: Skeleton
-
-Hydrogen is Shopify’s stack for headless commerce. Hydrogen is designed to dovetail with [Remix](https://remix.run/), Shopify’s full stack web framework. This template contains a **minimal setup** of components, queries and tooling to get started with Hydrogen.
-
-[Check out Hydrogen docs](https://shopify.dev/custom-storefronts/hydrogen)
-[Get familiar with Remix](https://remix.run/docs/en/v1)
-
-## What's included
-
-- Remix
-- Hydrogen
-- Oxygen
-- Shopify CLI
-- ESLint
-- Prettier
-- GraphQL generator
-- TypeScript and JavaScript flavors
-- Minimal setup of components and routes
-
-## Getting started
-
-**Requirements:**
-
-- Node.js version 16.14.0 or higher
-
-```bash
-npm create @shopify/hydrogen@latest
-```
-
-## Building for production
-
-```bash
-npm run build
-```
-
-## Local development
-
-```bash
-npm run dev
-```
diff --git a/contentstack-app/app/components/Aside.tsx b/contentstack-app/app/components/Aside.tsx
deleted file mode 100644
index f486f19..0000000
--- a/contentstack-app/app/components/Aside.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * A side bar component with Overlay that works without JavaScript.
- * @example
- * ```jsx
- *
- * ```
- */
-export function Aside({
- children,
- heading,
- id = 'aside',
-}: {
- children?: React.ReactNode;
- heading: React.ReactNode;
- id?: string;
-}) {
- return (
-
-
- );
-}
-
-function CloseAside() {
- return (
- /* eslint-disable-next-line jsx-a11y/anchor-is-valid */
- history.go(-1)}>
- ×
-
- );
-}
diff --git a/contentstack-app/app/components/Cart.tsx b/contentstack-app/app/components/Cart.tsx
deleted file mode 100644
index e5c48cc..0000000
--- a/contentstack-app/app/components/Cart.tsx
+++ /dev/null
@@ -1,340 +0,0 @@
-import {CartForm, Image, Money} from '@shopify/hydrogen';
-import type {CartLineUpdateInput} from '@shopify/hydrogen/storefront-api-types';
-import {Link} from '@remix-run/react';
-import type {CartApiQueryFragment} from 'storefrontapi.generated';
-import {useVariantUrl} from '~/utils';
-
-type CartLine = CartApiQueryFragment['lines']['nodes'][0];
-
-type CartMainProps = {
- cart: CartApiQueryFragment | null;
- layout: 'page' | 'aside';
-};
-
-export function CartMain({layout, cart}: CartMainProps) {
- const linesCount = Boolean(cart?.lines?.nodes?.length || 0);
- const withDiscount =
- cart &&
- Boolean(cart.discountCodes.filter((code) => code.applicable).length);
- const className = `cart-main ${withDiscount ? 'with-discount' : ''}`;
-
- return (
-
-
-
-
- );
-}
-
-function CartDetails({layout, cart}: CartMainProps) {
- const cartHasItems = !!cart && cart.totalQuantity > 0;
-
- return (
-
-
- {cartHasItems && (
-
-
-
-
- )}
-
- );
-}
-
-function CartLines({
- lines,
- layout,
-}: {
- layout: CartMainProps['layout'];
- lines: CartApiQueryFragment['lines'] | undefined;
-}) {
- if (!lines) return null;
-
- return (
-
-
- {lines.nodes.map((line) => (
-
- ))}
-
-
- );
-}
-
-function CartLineItem({
- layout,
- line,
-}: {
- layout: CartMainProps['layout'];
- line: CartLine;
-}) {
- const {id, merchandise} = line;
- const {product, title, image, selectedOptions} = merchandise;
- const lineItemUrl = useVariantUrl(product.handle, selectedOptions);
-
- return (
-
- {image && (
-
- )}
-
-
-
{
- if (layout === 'aside') {
- // close the drawer
- window.location.href = lineItemUrl;
- }
- }}
- >
-
- {product.title}
-
-
-
-
- {selectedOptions.map((option) => (
- -
-
- {option.name}: {option.value}
-
-
- ))}
-
-
-
-
- );
-}
-
-function CartCheckoutActions({checkoutUrl}: {checkoutUrl: string}) {
- if (!checkoutUrl) return null;
-
- return (
-
- );
-}
-
-export function CartSummary({
- cost,
- layout,
- children = null,
-}: {
- children?: React.ReactNode;
- cost: CartApiQueryFragment['cost'];
- layout: CartMainProps['layout'];
-}) {
- const className =
- layout === 'page' ? 'cart-summary-page' : 'cart-summary-aside';
-
- return (
-
-
Totals
-
- - Subtotal
- -
- {cost?.subtotalAmount?.amount ? (
-
- ) : (
- '-'
- )}
-
-
- {children}
-
- );
-}
-
-function CartLineRemoveButton({lineIds}: {lineIds: string[]}) {
- return (
-
-
-
- );
-}
-
-function CartLineQuantity({line}: {line: CartLine}) {
- if (!line || typeof line?.quantity === 'undefined') return null;
- const {id: lineId, quantity} = line;
- const prevQuantity = Number(Math.max(0, quantity - 1).toFixed(0));
- const nextQuantity = Number((quantity + 1).toFixed(0));
-
- return (
-
- Quantity: {quantity}
-
-
-
-
-
-
-
-
-
-
- );
-}
-
-function CartLinePrice({
- line,
- priceType = 'regular',
- ...passthroughProps
-}: {
- line: CartLine;
- priceType?: 'regular' | 'compareAt';
- [key: string]: any;
-}) {
- if (!line?.cost?.amountPerQuantity || !line?.cost?.totalAmount) return null;
-
- const moneyV2 =
- priceType === 'regular'
- ? line.cost.totalAmount
- : line.cost.compareAtAmountPerQuantity;
-
- if (moneyV2 == null) {
- return null;
- }
-
- return (
-
-
-
- );
-}
-
-export function CartEmpty({
- hidden = false,
- layout = 'aside',
-}: {
- hidden: boolean;
- layout?: CartMainProps['layout'];
-}) {
- return (
-
-
-
- Looks like you haven’t added anything yet, let’s get you
- started!
-
-
-
{
- if (layout === 'aside') {
- window.location.href = '/collections';
- }
- }}
- >
- Continue shopping →
-
-
- );
-}
-
-function CartDiscounts({
- discountCodes,
-}: {
- discountCodes: CartApiQueryFragment['discountCodes'];
-}) {
- const codes: string[] =
- discountCodes
- ?.filter((discount) => discount.applicable)
- ?.map(({code}) => code) || [];
-
- return (
-
- {/* Have existing discount, display it with a remove option */}
-
-
-
- Discount(s)
-
-
- {codes?.join(', ')}
-
-
-
-
-
-
-
- {/* Show an input to apply a discount */}
-
-
-
-
-
-
-
-
- );
-}
-
-function UpdateDiscountForm({
- discountCodes,
- children,
-}: {
- discountCodes?: string[];
- children: React.ReactNode;
-}) {
- return (
-
- {children}
-
- );
-}
-
-function CartLineUpdateButton({
- children,
- lines,
-}: {
- children: React.ReactNode;
- lines: CartLineUpdateInput[];
-}) {
- return (
-
- {children}
-
- );
-}
diff --git a/contentstack-app/app/components/Footer.tsx b/contentstack-app/app/components/Footer.tsx
deleted file mode 100644
index 332b63a..0000000
--- a/contentstack-app/app/components/Footer.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import {NavLink} from '@remix-run/react';
-import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated';
-import {useRootLoaderData} from '~/root';
-
-export function Footer({
- menu,
- shop,
-}: FooterQuery & {shop: HeaderQuery['shop']}) {
- return (
-
- );
-}
-
-function FooterMenu({
- menu,
- primaryDomainUrl,
-}: {
- menu: FooterQuery['menu'];
- primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
-}) {
- const {publicStoreDomain} = useRootLoaderData();
-
- return (
-
- );
-}
-
-const FALLBACK_FOOTER_MENU = {
- id: 'gid://shopify/Menu/199655620664',
- items: [
- {
- id: 'gid://shopify/MenuItem/461633060920',
- resourceId: 'gid://shopify/ShopPolicy/23358046264',
- tags: [],
- title: 'Privacy Policy',
- type: 'SHOP_POLICY',
- url: '/policies/privacy-policy',
- items: [],
- },
- {
- id: 'gid://shopify/MenuItem/461633093688',
- resourceId: 'gid://shopify/ShopPolicy/23358013496',
- tags: [],
- title: 'Refund Policy',
- type: 'SHOP_POLICY',
- url: '/policies/refund-policy',
- items: [],
- },
- {
- id: 'gid://shopify/MenuItem/461633126456',
- resourceId: 'gid://shopify/ShopPolicy/23358111800',
- tags: [],
- title: 'Shipping Policy',
- type: 'SHOP_POLICY',
- url: '/policies/shipping-policy',
- items: [],
- },
- {
- id: 'gid://shopify/MenuItem/461633159224',
- resourceId: 'gid://shopify/ShopPolicy/23358079032',
- tags: [],
- title: 'Terms of Service',
- type: 'SHOP_POLICY',
- url: '/policies/terms-of-service',
- items: [],
- },
- ],
-};
-
-function activeLinkStyle({
- isActive,
- isPending,
-}: {
- isActive: boolean;
- isPending: boolean;
-}) {
- return {
- fontWeight: isActive ? 'bold' : undefined,
- color: isPending ? 'grey' : 'white',
- };
-}
diff --git a/contentstack-app/app/components/Header.tsx b/contentstack-app/app/components/Header.tsx
deleted file mode 100644
index efdc723..0000000
--- a/contentstack-app/app/components/Header.tsx
+++ /dev/null
@@ -1,186 +0,0 @@
-import {Await, NavLink} from '@remix-run/react';
-import {Suspense} from 'react';
-import type {HeaderQuery} from 'storefrontapi.generated';
-import type {LayoutProps} from './Layout';
-import {useRootLoaderData} from '~/root';
-
-type HeaderProps = Pick;
-
-type Viewport = 'desktop' | 'mobile';
-
-export function Header({header, isLoggedIn, cart}: HeaderProps) {
- const {shop, menu} = header;
- return (
-
- );
-}
-
-export function HeaderMenu({
- menu,
- primaryDomainUrl,
- viewport,
-}: {
- menu: HeaderProps['header']['menu'];
- primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
- viewport: Viewport;
-}) {
- const {publicStoreDomain} = useRootLoaderData();
- const className = `header-menu-${viewport}`;
-
- function closeAside(event: React.MouseEvent) {
- if (viewport === 'mobile') {
- event.preventDefault();
- window.location.href = event.currentTarget.href;
- }
- }
-
- return (
-
- );
-}
-
-function HeaderCtas({
- isLoggedIn,
- cart,
-}: Pick) {
- return (
-
- );
-}
-
-function HeaderMenuMobileToggle() {
- return (
-
- ☰
-
- );
-}
-
-function SearchToggle() {
- return Search;
-}
-
-function CartBadge({count}: {count: number}) {
- return Cart {count};
-}
-
-function CartToggle({cart}: Pick) {
- return (
- }>
-
- {(cart) => {
- if (!cart) return ;
- return ;
- }}
-
-
- );
-}
-
-const FALLBACK_HEADER_MENU = {
- id: 'gid://shopify/Menu/199655587896',
- items: [
- {
- id: 'gid://shopify/MenuItem/461609500728',
- resourceId: null,
- tags: [],
- title: 'Collections',
- type: 'HTTP',
- url: '/collections',
- items: [],
- },
- {
- id: 'gid://shopify/MenuItem/461609533496',
- resourceId: null,
- tags: [],
- title: 'Blog',
- type: 'HTTP',
- url: '/blogs/journal',
- items: [],
- },
- {
- id: 'gid://shopify/MenuItem/461609566264',
- resourceId: null,
- tags: [],
- title: 'Policies',
- type: 'HTTP',
- url: '/policies',
- items: [],
- },
- {
- id: 'gid://shopify/MenuItem/461609599032',
- resourceId: 'gid://shopify/Page/92591030328',
- tags: [],
- title: 'About',
- type: 'PAGE',
- url: '/pages/about',
- items: [],
- },
- ],
-};
-
-function activeLinkStyle({
- isActive,
- isPending,
-}: {
- isActive: boolean;
- isPending: boolean;
-}) {
- return {
- fontWeight: isActive ? 'bold' : undefined,
- color: isPending ? 'grey' : 'black',
- };
-}
diff --git a/contentstack-app/app/components/Layout.tsx b/contentstack-app/app/components/Layout.tsx
deleted file mode 100644
index 856ca51..0000000
--- a/contentstack-app/app/components/Layout.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import {Await} from '@remix-run/react';
-import {Suspense} from 'react';
-import type {
- CartApiQueryFragment,
- FooterQuery,
- HeaderQuery,
-} from 'storefrontapi.generated';
-import {Aside} from '~/components/Aside';
-import {Footer} from '~/components/Footer';
-import {Header, HeaderMenu} from '~/components/Header';
-import {CartMain} from '~/components/Cart';
-import {
- PredictiveSearchForm,
- PredictiveSearchResults,
-} from '~/components/Search';
-
-export type LayoutProps = {
- cart: Promise;
- children?: React.ReactNode;
- footer: Promise;
- header: HeaderQuery;
- isLoggedIn: boolean;
-};
-
-export function Layout({
- cart,
- children = null,
- footer,
- header,
- isLoggedIn,
-}: LayoutProps) {
- return (
- <>
-
-
-
- {header && }
- {children}
-
-
- {(footer) => }
-
-
- >
- );
-}
-
-function CartAside({cart}: {cart: LayoutProps['cart']}) {
- return (
-
}>
-
- {(cart) => {
- return ;
- }}
-
-
-
- );
-}
-
-function SearchAside() {
- return (
-
- );
-}
-
-function MobileMenuAside({
- menu,
- shop,
-}: {
- menu: HeaderQuery['menu'];
- shop: HeaderQuery['shop'];
-}) {
- return (
- menu &&
- shop?.primaryDomain?.url && (
-
- )
- );
-}
diff --git a/contentstack-app/app/components/Search.tsx b/contentstack-app/app/components/Search.tsx
deleted file mode 100644
index b058a9e..0000000
--- a/contentstack-app/app/components/Search.tsx
+++ /dev/null
@@ -1,475 +0,0 @@
-import {
- Link,
- Form,
- useParams,
- useFetcher,
- useFetchers,
- type FormProps,
-} from '@remix-run/react';
-import {Image, Money, Pagination} from '@shopify/hydrogen';
-import React, {useRef, useEffect} from 'react';
-import parse from 'html-react-parser';
-
-import type {
- PredictiveProductFragment,
- PredictiveCollectionFragment,
- PredictiveArticleFragment,
- SearchQuery,
-} from 'storefrontapi.generated';
-
-type PredicticeSearchResultItemImage =
- | PredictiveCollectionFragment['image']
- | PredictiveArticleFragment['image']
- | PredictiveProductFragment['variants']['nodes'][0]['image'];
-
-type PredictiveSearchResultItemPrice =
- | PredictiveProductFragment['variants']['nodes'][0]['price'];
-
-export type NormalizedPredictiveSearchResultItem = {
- __typename: string | undefined;
- handle: string;
- id: string;
- image?: PredicticeSearchResultItemImage;
- price?: PredictiveSearchResultItemPrice;
- styledTitle?: string;
- title: string;
- url: string;
-};
-
-export type NormalizedPredictiveSearchResults = Array<
- | {type: 'queries'; items: Array}
- | {type: 'products'; items: Array}
- | {type: 'collections'; items: Array}
- | {type: 'pages'; items: Array}
- | {type: 'articles'; items: Array}
->;
-
-export type NormalizedPredictiveSearch = {
- results: NormalizedPredictiveSearchResults;
- totalResults: number;
-};
-
-type FetchSearchResultsReturn = {
- searchResults: {
- results: SearchQuery | null;
- totalResults: number;
- };
- searchTerm: string;
-};
-
-export const NO_PREDICTIVE_SEARCH_RESULTS: NormalizedPredictiveSearchResults = [
- {type: 'queries', items: []},
- {type: 'products', items: []},
- {type: 'collections', items: []},
- {type: 'pages', items: []},
- {type: 'articles', items: []},
-];
-
-export function SearchForm({searchTerm}: {searchTerm: string}) {
- const inputRef = useRef(null);
-
- // focus the input when cmd+k is pressed
- useEffect(() => {
- function handleKeyDown(event: KeyboardEvent) {
- if (event.key === 'k' && event.metaKey) {
- event.preventDefault();
- inputRef.current?.focus();
- }
-
- if (event.key === 'Escape') {
- inputRef.current?.blur();
- }
- }
-
- document.addEventListener('keydown', handleKeyDown);
-
- return () => {
- document.removeEventListener('keydown', handleKeyDown);
- };
- }, []);
-
- return (
-
- );
-}
-
-export function SearchResults({
- results,
-}: Pick) {
- if (!results) {
- return null;
- }
- const keys = Object.keys(results) as Array;
- return (
-
- {results &&
- keys.map((type) => {
- const resourceResults = results[type];
-
- if (resourceResults.nodes[0]?.__typename === 'Page') {
- const pageResults = resourceResults as SearchQuery['pages'];
- return resourceResults.nodes.length ? (
-
- ) : null;
- }
-
- if (resourceResults.nodes[0]?.__typename === 'Product') {
- const productResults = resourceResults as SearchQuery['products'];
- return resourceResults.nodes.length ? (
-
- ) : null;
- }
-
- if (resourceResults.nodes[0]?.__typename === 'Article') {
- const articleResults = resourceResults as SearchQuery['articles'];
- return resourceResults.nodes.length ? (
-
- ) : null;
- }
-
- return null;
- })}
-
- );
-}
-
-function SearchResultsProductsGrid({products}: Pick) {
- return (
-
-
Products
-
- {({nodes, isLoading, NextLink, PreviousLink}) => {
- const itemsMarkup = nodes.map((product) => (
-
-
- {product.title}
-
-
- ));
- return (
-
-
-
- {isLoading ? 'Loading...' : ↑ Load previous}
-
-
-
- {itemsMarkup}
-
-
-
-
- {isLoading ? 'Loading...' : Load more ↓}
-
-
-
- );
- }}
-
-
-
- );
-}
-
-function SearchResultPageGrid({pages}: Pick) {
- return (
-
-
Pages
-
- {pages?.nodes?.map((page) => (
-
-
- {page.title}
-
-
- ))}
-
-
-
- );
-}
-
-function SearchResultArticleGrid({articles}: Pick) {
- return (
-
-
Articles
-
- {articles?.nodes?.map((article) => (
-
-
- {article.title}
-
-
- ))}
-
-
-
- );
-}
-
-export function NoSearchResults() {
- return No results, try a different search.
;
-}
-
-type ChildrenRenderProps = {
- fetchResults: (event: React.ChangeEvent) => void;
- fetcher: ReturnType>;
- inputRef: React.MutableRefObject;
-};
-
-type SearchFromProps = {
- action?: FormProps['action'];
- method?: FormProps['method'];
- className?: string;
- children: (passedProps: ChildrenRenderProps) => React.ReactNode;
- [key: string]: unknown;
-};
-
-/**
- * Search form component that posts search requests to the `/search` route
- **/
-export function PredictiveSearchForm({
- action,
- children,
- className = 'predictive-search-form',
- method = 'POST',
- ...props
-}: SearchFromProps) {
- const params = useParams();
- const fetcher = useFetcher();
- const inputRef = useRef(null);
-
- function fetchResults(event: React.ChangeEvent) {
- const searchAction = action ?? '/api/predictive-search';
- const localizedAction = params.locale
- ? `/${params.locale}${searchAction}`
- : searchAction;
- const newSearchTerm = event.target.value || '';
- fetcher.submit(
- {q: newSearchTerm, limit: '6'},
- {method, action: localizedAction},
- );
- }
-
- // ensure the passed input has a type of search, because SearchResults
- // will select the element based on the input
- useEffect(() => {
- inputRef?.current?.setAttribute('type', 'search');
- }, []);
-
- return (
- {
- event.preventDefault();
- event.stopPropagation();
- if (!inputRef?.current || inputRef.current.value === '') {
- return;
- }
- inputRef.current.blur();
- }}
- >
- {children({fetchResults, inputRef, fetcher})}
-
- );
-}
-
-export function PredictiveSearchResults() {
- const {results, totalResults, searchInputRef, searchTerm} =
- usePredictiveSearch();
-
- function goToSearchResult(event: React.MouseEvent) {
- if (!searchInputRef.current) return;
- searchInputRef.current.blur();
- searchInputRef.current.value = '';
- // close the aside
- window.location.href = event.currentTarget.href;
- }
-
- if (!totalResults) {
- return ;
- }
- return (
-
-
- {results.map(({type, items}) => (
-
- ))}
-
- {/* view all results /search?q=term */}
- {searchTerm.current && (
-
-
- View all results for {searchTerm.current}
- →
-
-
- )}
-
- );
-}
-
-function NoPredictiveSearchResults({
- searchTerm,
-}: {
- searchTerm: React.MutableRefObject;
-}) {
- if (!searchTerm.current) {
- return null;
- }
- return (
-
- No results found for {searchTerm.current}
-
- );
-}
-
-type SearchResultTypeProps = {
- goToSearchResult: (event: React.MouseEvent) => void;
- items: NormalizedPredictiveSearchResultItem[];
- searchTerm: UseSearchReturn['searchTerm'];
- type: NormalizedPredictiveSearchResults[number]['type'];
-};
-
-function PredictiveSearchResult({
- goToSearchResult,
- items,
- searchTerm,
- type,
-}: SearchResultTypeProps) {
- const isSuggestions = type === 'queries';
- const categoryUrl = `/search?q=${
- searchTerm.current
- }&type=${pluralToSingularSearchType(type)}`;
-
- return (
-
-
-
{isSuggestions ? 'Suggestions' : type}
-
-
- {items.map((item: NormalizedPredictiveSearchResultItem) => (
-
- ))}
-
-
- );
-}
-
-type SearchResultItemProps = Pick & {
- item: NormalizedPredictiveSearchResultItem;
-};
-
-function SearchResultItem({goToSearchResult, item}: SearchResultItemProps) {
- return (
-
-
- {item.image?.url && (
-
- )}
-
- {item.styledTitle ? (
-
{parse(item.styledTitle)}
- ) : (
-
{item.title}
- )}
- {item?.price && (
-
-
-
- )}
-
-
-
- );
-}
-
-type UseSearchReturn = NormalizedPredictiveSearch & {
- searchInputRef: React.MutableRefObject;
- searchTerm: React.MutableRefObject;
-};
-
-function usePredictiveSearch(): UseSearchReturn {
- const fetchers = useFetchers();
- const searchTerm = useRef('');
- const searchInputRef = useRef(null);
- const searchFetcher = fetchers.find((fetcher) => fetcher.data?.searchResults);
-
- if (searchFetcher?.state === 'loading') {
- searchTerm.current = (searchFetcher.formData?.get('q') || '') as string;
- }
-
- const search = (searchFetcher?.data?.searchResults || {
- results: NO_PREDICTIVE_SEARCH_RESULTS,
- totalResults: 0,
- }) as NormalizedPredictiveSearch;
-
- // capture the search input element as a ref
- useEffect(() => {
- if (searchInputRef.current) return;
- searchInputRef.current = document.querySelector('input[type="search"]');
- }, []);
-
- return {...search, searchInputRef, searchTerm};
-}
-
-/**
- * Converts a plural search type to a singular search type
- *
- * @example
- * ```js
- * pluralToSingularSearchType('articles'); // => 'ARTICLE'
- * pluralToSingularSearchType(['articles', 'products']); // => 'ARTICLE,PRODUCT'
- * ```
- */
-function pluralToSingularSearchType(
- type:
- | NormalizedPredictiveSearchResults[number]['type']
- | Array,
-) {
- const plural = {
- articles: 'ARTICLE',
- collections: 'COLLECTION',
- pages: 'PAGE',
- products: 'PRODUCT',
- queries: 'QUERY',
- };
-
- if (typeof type === 'string') {
- return plural[type];
- }
-
- return type.map((t) => plural[t]).join(',');
-}
diff --git a/contentstack-app/app/entry.client.tsx b/contentstack-app/app/entry.client.tsx
deleted file mode 100644
index ba957c4..0000000
--- a/contentstack-app/app/entry.client.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {RemixBrowser} from '@remix-run/react';
-import {startTransition, StrictMode} from 'react';
-import {hydrateRoot} from 'react-dom/client';
-
-startTransition(() => {
- hydrateRoot(
- document,
-
-
- ,
- );
-});
diff --git a/contentstack-app/app/entry.server.tsx b/contentstack-app/app/entry.server.tsx
deleted file mode 100644
index a645a41..0000000
--- a/contentstack-app/app/entry.server.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import type {EntryContext} from '@shopify/remix-oxygen';
-import {RemixServer} from '@remix-run/react';
-import isbot from 'isbot';
-import {renderToReadableStream} from 'react-dom/server';
-import {createContentSecurityPolicy} from '@shopify/hydrogen';
-
-export default async function handleRequest(
- request: Request,
- responseStatusCode: number,
- responseHeaders: Headers,
- remixContext: EntryContext,
-) {
- const {nonce, header, NonceProvider} = createContentSecurityPolicy();
-
- const body = await renderToReadableStream(
-
-
- ,
- {
- nonce,
- signal: request.signal,
- onError(error) {
- // eslint-disable-next-line no-console
- console.error(error);
- responseStatusCode = 500;
- },
- },
- );
-
- if (isbot(request.headers.get('user-agent'))) {
- await body.allReady;
- }
-
- responseHeaders.set('Content-Type', 'text/html');
- responseHeaders.set('Content-Security-Policy', header);
-
- return new Response(body, {
- headers: responseHeaders,
- status: responseStatusCode,
- });
-}
diff --git a/contentstack-app/app/root.tsx b/contentstack-app/app/root.tsx
deleted file mode 100644
index a16dc2f..0000000
--- a/contentstack-app/app/root.tsx
+++ /dev/null
@@ -1,280 +0,0 @@
-import {useNonce} from '@shopify/hydrogen';
-import {
- defer,
- type SerializeFrom,
- type LoaderFunctionArgs,
-} from '@shopify/remix-oxygen';
-import {
- Links,
- Meta,
- Outlet,
- Scripts,
- LiveReload,
- useMatches,
- useRouteError,
- useLoaderData,
- ScrollRestoration,
- isRouteErrorResponse,
- type ShouldRevalidateFunction,
-} from '@remix-run/react';
-import type {CustomerAccessToken} from '@shopify/hydrogen/storefront-api-types';
-import favicon from '../public/favicon.svg';
-import resetStyles from './styles/reset.css';
-import appStyles from './styles/app.css';
-import {Layout} from '~/components/Layout';
-
-/**
- * This is important to avoid re-fetching root queries on sub-navigations
- */
-export const shouldRevalidate: ShouldRevalidateFunction = ({
- formMethod,
- currentUrl,
- nextUrl,
-}) => {
- // revalidate when a mutation is performed e.g add to cart, login...
- if (formMethod && formMethod !== 'GET') {
- return true;
- }
-
- // revalidate when manually revalidating via useRevalidator
- if (currentUrl.toString() === nextUrl.toString()) {
- return true;
- }
-
- return false;
-};
-
-export function links() {
- return [
- {rel: 'stylesheet', href: resetStyles},
- {rel: 'stylesheet', href: appStyles},
- {
- rel: 'preconnect',
- href: 'https://cdn.shopify.com',
- },
- {
- rel: 'preconnect',
- href: 'https://shop.app',
- },
- {rel: 'icon', type: 'image/svg+xml', href: favicon},
- ];
-}
-
-export const useRootLoaderData = () => {
- const [root] = useMatches();
- return root?.data as SerializeFrom;
-};
-
-export async function loader({context}: LoaderFunctionArgs) {
- const {storefront, session, cart} = context;
- const customerAccessToken = await session.get('customerAccessToken');
- const publicStoreDomain = context.env.PUBLIC_STORE_DOMAIN;
-
- // validate the customer access token is valid
- const {isLoggedIn, headers} = await validateCustomerAccessToken(
- session,
- customerAccessToken,
- );
-
- // defer the cart query by not awaiting it
- const cartPromise = cart.get();
-
- // defer the footer query (below the fold)
- const footerPromise = storefront.query(FOOTER_QUERY, {
- cache: storefront.CacheLong(),
- variables: {
- footerMenuHandle: 'footer', // Adjust to your footer menu handle
- },
- });
-
- // await the header query (above the fold)
- const headerPromise = storefront.query(HEADER_QUERY, {
- cache: storefront.CacheLong(),
- variables: {
- headerMenuHandle: 'main-menu', // Adjust to your header menu handle
- },
- });
-
- return defer(
- {
- cart: cartPromise,
- footer: footerPromise,
- header: await headerPromise,
- isLoggedIn,
- publicStoreDomain,
- },
- {headers},
- );
-}
-
-export default function App() {
- const nonce = useNonce();
- const data = useLoaderData();
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
-
-export function ErrorBoundary() {
- const error = useRouteError();
- const rootData = useRootLoaderData();
- const nonce = useNonce();
- let errorMessage = 'Unknown error';
- let errorStatus = 500;
-
- if (isRouteErrorResponse(error)) {
- errorMessage = error?.data?.message ?? error.data;
- errorStatus = error.status;
- } else if (error instanceof Error) {
- errorMessage = error.message;
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
-
Oops
-
{errorStatus}
- {errorMessage && (
-
- )}
-
-
-
-
-
-
-
- );
-}
-
-/**
- * Validates the customer access token and returns a boolean and headers
- * @see https://shopify.dev/docs/api/storefront/latest/objects/CustomerAccessToken
- *
- * @example
- * ```js
- * const {isLoggedIn, headers} = await validateCustomerAccessToken(
- * customerAccessToken,
- * session,
- * );
- * ```
- */
-async function validateCustomerAccessToken(
- session: LoaderFunctionArgs['context']['session'],
- customerAccessToken?: CustomerAccessToken,
-) {
- let isLoggedIn = false;
- const headers = new Headers();
- if (!customerAccessToken?.accessToken || !customerAccessToken?.expiresAt) {
- return {isLoggedIn, headers};
- }
-
- const expiresAt = new Date(customerAccessToken.expiresAt).getTime();
- const dateNow = Date.now();
- const customerAccessTokenExpired = expiresAt < dateNow;
-
- if (customerAccessTokenExpired) {
- session.unset('customerAccessToken');
- headers.append('Set-Cookie', await session.commit());
- } else {
- isLoggedIn = true;
- }
-
- return {isLoggedIn, headers};
-}
-
-const MENU_FRAGMENT = `#graphql
- fragment MenuItem on MenuItem {
- id
- resourceId
- tags
- title
- type
- url
- }
- fragment ChildMenuItem on MenuItem {
- ...MenuItem
- }
- fragment ParentMenuItem on MenuItem {
- ...MenuItem
- items {
- ...ChildMenuItem
- }
- }
- fragment Menu on Menu {
- id
- items {
- ...ParentMenuItem
- }
- }
-` as const;
-
-const HEADER_QUERY = `#graphql
- fragment Shop on Shop {
- id
- name
- description
- primaryDomain {
- url
- }
- brand {
- logo {
- image {
- url
- }
- }
- }
- }
- query Header(
- $country: CountryCode
- $headerMenuHandle: String!
- $language: LanguageCode
- ) @inContext(language: $language, country: $country) {
- shop {
- ...Shop
- }
- menu(handle: $headerMenuHandle) {
- ...Menu
- }
- }
- ${MENU_FRAGMENT}
-` as const;
-
-const FOOTER_QUERY = `#graphql
- query Footer(
- $country: CountryCode
- $footerMenuHandle: String!
- $language: LanguageCode
- ) @inContext(language: $language, country: $country) {
- menu(handle: $footerMenuHandle) {
- ...Menu
- }
- }
- ${MENU_FRAGMENT}
-` as const;
diff --git a/contentstack-app/app/styles/app.css b/contentstack-app/app/styles/app.css
deleted file mode 100644
index 38057eb..0000000
--- a/contentstack-app/app/styles/app.css
+++ /dev/null
@@ -1,472 +0,0 @@
-:root {
- --aside-width: 400px;
- --cart-aside-summary-height-with-discount: 300px;
- --cart-aside-summary-height: 250px;
- --grid-item-width: 355px;
- --header-height: 74px;
- --color-dark: #000;
- --color-light: #fff;
-}
-
-img {
- border-radius: 4px;
-}
-
-/*
-* --------------------------------------------------
-* components/Aside
-* --------------------------------------------------
-*/
-aside {
- background: var(--color-light);
- box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
- height: 100vh;
- max-width: var(--aside-width);
- min-width: var(--aside-width);
- position: fixed;
- right: calc(-1 * var(--aside-width));
- transition: transform 200ms ease-in-out;
-}
-
-aside header {
- align-items: center;
- border-bottom: 1px solid var(--color-dark);
- display: flex;
- height: var(--header-height);
- justify-content: space-between;
- padding: 0 20px;
-}
-
-aside header h3 {
- margin: 0;
-}
-
-aside header .close {
- font-weight: bold;
- opacity: 0.8;
- text-decoration: none;
- transition: all 200ms;
- width: 20px;
-}
-
-aside header .close:hover {
- opacity: 1;
-}
-
-aside header h2 {
- margin-bottom: 0.6rem;
- margin-top: 0;
-}
-
-aside main {
- margin: 1rem;
-}
-
-aside p {
- margin: 0 0 0.25rem;
-}
-
-aside p:last-child {
- margin: 0;
-}
-
-aside li {
- margin-bottom: 0.125rem;
-}
-
-.overlay {
- background: rgba(0, 0, 0, 0.2);
- bottom: 0;
- left: 0;
- opacity: 0;
- pointer-events: none;
- position: fixed;
- right: 0;
- top: 0;
- transition: opacity 400ms ease-in-out;
- transition: opacity 400ms;
- visibility: hidden;
- z-index: 10;
-}
-
-.overlay .close-outside {
- background: transparent;
- border: none;
- color: transparent;
- height: 100%;
- left: 0;
- position: absolute;
- top: 0;
- width: calc(100% - var(--aside-width));
-}
-
-.overlay .light {
- background: rgba(255, 255, 255, 0.5);
-}
-
-.overlay .cancel {
- cursor: default;
- height: 100%;
- position: absolute;
- width: 100%;
-}
-
-.overlay:target {
- opacity: 1;
- pointer-events: auto;
- visibility: visible;
-}
-/* reveal aside */
-.overlay:target aside {
- transform: translateX(calc(var(--aside-width) * -1));
-}
-
-/*
-* --------------------------------------------------
-* components/Header
-* --------------------------------------------------
-*/
-.header {
- align-items: center;
- background: #fff;
- display: flex;
- height: var(--header-height);
- padding: 0 1rem;
- position: sticky;
- top: 0;
- z-index: 1;
-}
-
-.header-menu-mobile-toggle {
- @media (min-width: 48em) {
- display: none;
- }
-}
-
-.header-menu-mobile {
- display: flex;
- flex-direction: column;
- grid-gap: 1rem;
-}
-
-.header-menu-desktop {
- display: none;
- grid-gap: 1rem;
- @media (min-width: 45em) {
- display: flex;
- grid-gap: 1rem;
- margin-left: 3rem;
- }
-}
-
-.header-menu-item {
- cursor: pointer;
-}
-
-.header-ctas {
- align-items: center;
- display: flex;
- grid-gap: 1rem;
- margin-left: auto;
-}
-
-/*
-* --------------------------------------------------
-* components/Footer
-* --------------------------------------------------
-*/
-.footer {
- background: var(--color-dark);
- margin-top: auto;
-}
-
-.footer-menu-missing {
- display: inline-block;
- margin: 1rem;
-}
-
-.footer-menu {
- align-items: center;
- display: flex;
- grid-gap: 1rem;
- padding: 1rem;
-}
-
-.footer-menu a {
- color: var(--color-light);
-}
-
-/*
-* --------------------------------------------------
-* components/Cart
-* --------------------------------------------------
-*/
-.cart-main {
- height: 100%;
- max-height: calc(100vh - var(--cart-aside-summary-height));
- overflow-y: auto;
- width: auto;
-}
-
-.cart-main.with-discount {
- max-height: calc(100vh - var(--cart-aside-summary-height-with-discount));
-}
-
-.cart-line {
- display: flex;
- padding: 0.75rem 0;
-}
-
-.cart-line img {
- height: 100%;
- display: block;
- margin-right: 0.75rem;
-}
-
-.cart-summary-page {
- position: relative;
-}
-
-.cart-summary-aside {
- background: white;
- border-top: 1px solid var(--color-dark);
- bottom: 0;
- padding-top: 0.75rem;
- position: absolute;
- width: calc(var(--aside-width) - 40px);
-}
-
-.cart-line-quantiy {
- display: flex;
-}
-
-.cart-discount {
- align-items: center;
- display: flex;
- margin-top: 0.25rem;
-}
-
-.cart-subtotal {
- align-items: center;
- display: flex;
-}
-/*
-* --------------------------------------------------
-* components/Search
-* --------------------------------------------------
-*/
-.predictive-search {
- height: calc(100vh - var(--header-height) - 40px);
- overflow-y: auto;
-}
-
-.predictive-search-form {
- background: var(--color-light);
- position: sticky;
- top: 0;
-}
-
-.predictive-search-result {
- margin-bottom: 2rem;
-}
-
-.predictive-search-result h5 {
- text-transform: uppercase;
-}
-
-.predictive-search-result-item {
- margin-bottom: 0.5rem;
-}
-
-.predictive-search-result-item a {
- align-items: center;
- display: flex;
-}
-
-.predictive-search-result-item a img {
- margin-right: 0.75rem;
- height: 100%;
-}
-
-.search-result {
- margin-bottom: 1.5rem;
-}
-
-.search-results-item {
- margin-bottom: 0.5rem;
-}
-
-/*
-* --------------------------------------------------
-* routes/__index
-* --------------------------------------------------
-*/
-.featured-collection {
- display: block;
- margin-bottom: 2rem;
- position: relative;
-}
-
-.featured-collection-image {
- aspect-ratio: 1 / 1;
- @media (min-width: 45em) {
- aspect-ratio: 16 / 9;
- }
-}
-
-.featured-collection img {
- height: auto;
- max-height: 100%;
- object-fit: cover;
-}
-
-.recommended-products-grid {
- display: grid;
- grid-gap: 1.5rem;
- grid-template-columns: repeat(2, 1fr);
- @media (min-width: 45em) {
- grid-template-columns: repeat(4, 1fr);
- }
-}
-
-.recommended-product img {
- height: auto;
-}
-
-/*
-* --------------------------------------------------
-* routes/collections._index.tsx
-* --------------------------------------------------
-*/
-.collections-grid {
- display: grid;
- grid-gap: 1.5rem;
- grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
- margin-bottom: 2rem;
-}
-
-.collection-item img {
- height: auto;
-}
-
-/*
-* --------------------------------------------------
-* routes/collections.$handle.tsx
-* --------------------------------------------------
-*/
-.collection-description {
- margin-bottom: 1rem;
- max-width: 95%;
- @media (min-width: 45em) {
- max-width: 600px;
- }
-}
-
-.products-grid {
- display: grid;
- grid-gap: 1.5rem;
- grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
- margin-bottom: 2rem;
-}
-
-.product-item img {
- height: auto;
- width: 100%;
-}
-
-/*
-* --------------------------------------------------
-* routes/products.$handle.tsx
-* --------------------------------------------------
-*/
-.product {
- display: grid;
- @media (min-width: 45em) {
- grid-template-columns: 1fr 1fr;
- grid-gap: 4rem;
- }
-}
-
-.product h1 {
- margin-top: 0;
-}
-
-.product-images {
- display: grid;
- grid-gap: 1rem;
-}
-
-.product-image img {
- height: auto;
- width: 100%;
-}
-
-.product-main {
- align-self: start;
- position: sticky;
- top: 6rem;
-}
-
-.product-price-on-sale {
- display: flex;
- grid-gap: 0.5rem;
-}
-
-.product-price-on-sale s {
- opacity: 0.5;
-}
-
-.product-options-grid {
- display: flex;
- flex-wrap: wrap;
- grid-gap: 0.75rem;
-}
-
-.product-options-item {
- padding: 0.25rem 0.5rem;
-}
-
-/*
-* --------------------------------------------------
-* routes/blog._index.tsx
-* --------------------------------------------------
-*/
-.blog-grid {
- display: grid;
- grid-gap: 1.5rem;
- grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
- margin-bottom: 2rem;
-}
-
-.blog-article-image {
- aspect-ratio: 3/2;
- display: block;
-}
-
-.blog-article-image img {
- height: 100%;
-}
-
-/*
-* --------------------------------------------------
-* routes/blog.$articlehandle.tsx
-* --------------------------------------------------
-*/
-.article img {
- height: auto;
- width: 100%;
-}
-
-/*
-* --------------------------------------------------
-* routes/account
-* --------------------------------------------------
-*/
-.account-profile-marketing {
- display: flex;
- align-items: center;
-}
-
-.account-logout {
- display: inline-block;
-}
diff --git a/contentstack-app/app/styles/reset.css b/contentstack-app/app/styles/reset.css
deleted file mode 100644
index 451a9a5..0000000
--- a/contentstack-app/app/styles/reset.css
+++ /dev/null
@@ -1,129 +0,0 @@
-body {
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
- Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
- margin: 0;
- padding: 0;
-}
-
-h1,
-h2,
-p {
- margin: 0;
- padding: 0;
-}
-
-h1 {
- font-size: 1.6rem;
- font-weight: 700;
- line-height: 1.4;
- margin-bottom: 2rem;
- margin-top: 2rem;
-}
-
-h2 {
- font-size: 1.2rem;
- font-weight: 700;
- line-height: 1.4;
- margin-bottom: 1rem;
-}
-
-h4 {
- margin-top: 0.5rem;
- margin-bottom: 0.5rem;
-}
-
-h5 {
- margin-bottom: 1rem;
- margin-top: 0.5rem;
-}
-
-p {
- font-size: 1rem;
- line-height: 1.4;
-}
-
-a {
- color: #000;
- text-decoration: none;
-}
-
-a:hover {
- text-decoration: underline;
- cursor: pointer;
-}
-
-hr {
- border-bottom: none;
- border-top: 1px solid #000;
- margin: 0;
-}
-
-pre {
- white-space: pre-wrap;
-}
-
-body {
- display: flex;
- flex-direction: column;
- min-height: 100vh;
-}
-
-body > main {
- margin: 0 1rem 1rem 1rem;
-}
-
-section {
- padding: 1rem 0;
- @media (min-width: 768px) {
- padding: 2rem 0;
- }
-}
-
-fieldset {
- display: flex;
- flex-direction: column;
- margin-bottom: 0.5rem;
- padding: 1rem;
-}
-
-form {
- max-width: 100%;
- @media (min-width: 768px) {
- max-width: 400px;
- }
-}
-
-input {
- border-radius: 4px;
- border: 1px solid #000;
- font-size: 1rem;
- margin-bottom: 0.5rem;
- margin-top: 0.25rem;
- padding: 0.5rem;
-}
-
-legend {
- font-weight: 600;
- margin-bottom: 0.5rem;
-}
-
-ul {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-li {
- margin-bottom: 0.5rem;
-}
-
-dl {
- margin: 0.5rem 0;
-}
-
-code {
- background: #ddd;
- border-radius: 4px;
- font-family: monospace;
- padding: 0.25rem;
-}
diff --git a/contentstack-app/app/utils.ts b/contentstack-app/app/utils.ts
deleted file mode 100644
index ffea0a7..0000000
--- a/contentstack-app/app/utils.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import {useLocation} from '@remix-run/react';
-import type {SelectedOption} from '@shopify/hydrogen/storefront-api-types';
-import {useMemo} from 'react';
-
-export function useVariantUrl(
- handle: string,
- selectedOptions: SelectedOption[],
-) {
- const {pathname} = useLocation();
-
- return useMemo(() => {
- return getVariantUrl({
- handle,
- pathname,
- searchParams: new URLSearchParams(),
- selectedOptions,
- });
- }, [handle, selectedOptions, pathname]);
-}
-
-export function getVariantUrl({
- handle,
- pathname,
- searchParams,
- selectedOptions,
-}: {
- handle: string;
- pathname: string;
- searchParams: URLSearchParams;
- selectedOptions: SelectedOption[];
-}) {
- const match = /(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(pathname);
- const isLocalePathname = match && match.length > 0;
-
- const path = isLocalePathname
- ? `${match![0]}products/${handle}`
- : `/products/${handle}`;
-
- selectedOptions.forEach((option) => {
- searchParams.set(option.name, option.value);
- });
-
- const searchString = searchParams.toString();
-
- return path + (searchString ? '?' + searchParams.toString() : '');
-}
diff --git a/contentstack-app/package.json b/contentstack-app/package.json
deleted file mode 100644
index ebf8a17..0000000
--- a/contentstack-app/package.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "name": "contentstack-app",
- "private": true,
- "sideEffects": false,
- "version": "1.0.1",
- "scripts": {
- "build": "shopify hydrogen build",
- "dev": "shopify hydrogen dev --worker --codegen",
- "preview": "npm run build && shopify hydrogen preview --worker",
- "lint": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx .",
- "typecheck": "tsc --noEmit",
- "codegen": "shopify hydrogen codegen"
- },
- "prettier": "@shopify/prettier-config",
- "dependencies": {
- "@remix-run/react": "2.1.0",
- "@remix-run/server-runtime": "2.1.0",
- "@shopify/cli": "3.51.0",
- "@shopify/cli-hydrogen": "^6.1.0",
- "@shopify/hydrogen": "~2023.10.3",
- "@shopify/remix-oxygen": "^2.0.2",
- "graphql": "^16.6.0",
- "graphql-tag": "^2.12.6",
- "isbot": "^3.6.6",
- "react": "^18.2.0",
- "react-dom": "^18.2.0"
- },
- "devDependencies": {
- "@remix-run/dev": "2.1.0",
- "@remix-run/eslint-config": "2.1.0",
- "@shopify/oxygen-workers-types": "^4.0.0",
- "@shopify/prettier-config": "^1.1.2",
- "@total-typescript/ts-reset": "^0.4.2",
- "@types/eslint": "^8.4.10",
- "@types/react": "^18.2.22",
- "@types/react-dom": "^18.2.7",
- "eslint": "^8.20.0",
- "eslint-plugin-hydrogen": "0.12.2",
- "prettier": "^2.8.4",
- "typescript": "^5.2.2"
- },
- "engines": {
- "node": ">=18.0.0"
- }
-}
diff --git a/contentstack-app/public/favicon.svg b/contentstack-app/public/favicon.svg
deleted file mode 100644
index f6c6497..0000000
--- a/contentstack-app/public/favicon.svg
+++ /dev/null
@@ -1,28 +0,0 @@
-
diff --git a/contentstack-app/remix.config.js b/contentstack-app/remix.config.js
deleted file mode 100644
index bfb46bf..0000000
--- a/contentstack-app/remix.config.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
- appDirectory: 'app',
- ignoredRouteFiles: ['**/.*'],
- watchPaths: ['./public', './.env'],
- server: './server.ts',
- /**
- * The following settings are required to deploy Hydrogen apps to Oxygen:
- */
- publicPath: (process.env.HYDROGEN_ASSET_BASE_URL ?? '/') + 'build/',
- assetsBuildDirectory: 'dist/client/build',
- serverBuildPath: 'dist/worker/index.js',
- serverMainFields: ['browser', 'module', 'main'],
- serverConditions: ['worker', process.env.NODE_ENV],
- serverDependenciesToBundle: 'all',
- serverModuleFormat: 'esm',
- serverPlatform: 'neutral',
- serverMinify: process.env.NODE_ENV === 'production',
-};
diff --git a/contentstack-app/remix.env.d.ts b/contentstack-app/remix.env.d.ts
deleted file mode 100644
index 1ceb45a..0000000
--- a/contentstack-app/remix.env.d.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-///
-///
-///
-
-// Enhance TypeScript's built-in typings.
-import '@total-typescript/ts-reset';
-
-import type {Storefront, HydrogenCart} from '@shopify/hydrogen';
-import type {CustomerAccessToken} from '@shopify/hydrogen/storefront-api-types';
-import type {HydrogenSession} from './server';
-
-declare global {
- /**
- * A global `process` object is only available during build to access NODE_ENV.
- */
- const process: {env: {NODE_ENV: 'production' | 'development'}};
-
- /**
- * Declare expected Env parameter in fetch handler.
- */
- interface Env {
- SESSION_SECRET: string;
- PUBLIC_STOREFRONT_API_TOKEN: string;
- PRIVATE_STOREFRONT_API_TOKEN: string;
- PUBLIC_STORE_DOMAIN: string;
- PUBLIC_STOREFRONT_ID: string;
- PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID: string;
- PUBLIC_CUSTOMER_ACCOUNT_API_URL: string;
- }
-}
-
-declare module '@shopify/remix-oxygen' {
- /**
- * Declare local additions to the Remix loader context.
- */
- export interface AppLoadContext {
- env: Env;
- cart: HydrogenCart;
- storefront: Storefront;
- session: HydrogenSession;
- waitUntil: ExecutionContext['waitUntil'];
- }
-
- /**
- * Declare the data we expect to access via `context.session`.
- */
- export interface SessionData {
- customerAccessToken: CustomerAccessToken;
- }
-}
diff --git a/contentstack-app/server.ts b/contentstack-app/server.ts
deleted file mode 100644
index 7561489..0000000
--- a/contentstack-app/server.ts
+++ /dev/null
@@ -1,256 +0,0 @@
-// Virtual entry point for the app
-import * as remixBuild from '@remix-run/dev/server-build';
-import {
- cartGetIdDefault,
- cartSetIdDefault,
- createCartHandler,
- createStorefrontClient,
- storefrontRedirect,
-} from '@shopify/hydrogen';
-import {
- createRequestHandler,
- getStorefrontHeaders,
- createCookieSessionStorage,
- type SessionStorage,
- type Session,
-} from '@shopify/remix-oxygen';
-
-/**
- * Export a fetch handler in module format.
- */
-export default {
- async fetch(
- request: Request,
- env: Env,
- executionContext: ExecutionContext,
- ): Promise {
- try {
- /**
- * Open a cache instance in the worker and a custom session instance.
- */
- if (!env?.SESSION_SECRET) {
- throw new Error('SESSION_SECRET environment variable is not set');
- }
-
- const waitUntil = executionContext.waitUntil.bind(executionContext);
- const [cache, session] = await Promise.all([
- caches.open('hydrogen'),
- HydrogenSession.init(request, [env.SESSION_SECRET]),
- ]);
-
- /**
- * Create Hydrogen's Storefront client.
- */
- const {storefront} = createStorefrontClient({
- cache,
- waitUntil,
- i18n: {language: 'EN', country: 'US'},
- publicStorefrontToken: env.PUBLIC_STOREFRONT_API_TOKEN,
- privateStorefrontToken: env.PRIVATE_STOREFRONT_API_TOKEN,
- storeDomain: env.PUBLIC_STORE_DOMAIN,
- storefrontId: env.PUBLIC_STOREFRONT_ID,
- storefrontHeaders: getStorefrontHeaders(request),
- });
-
- /*
- * Create a cart handler that will be used to
- * create and update the cart in the session.
- */
- const cart = createCartHandler({
- storefront,
- getCartId: cartGetIdDefault(request.headers),
- setCartId: cartSetIdDefault(),
- cartQueryFragment: CART_QUERY_FRAGMENT,
- });
-
- /**
- * Create a Remix request handler and pass
- * Hydrogen's Storefront client to the loader context.
- */
- const handleRequest = createRequestHandler({
- build: remixBuild,
- mode: process.env.NODE_ENV,
- getLoadContext: () => ({session, storefront, cart, env, waitUntil}),
- });
-
- const response = await handleRequest(request);
-
- if (response.status === 404) {
- /**
- * Check for redirects only when there's a 404 from the app.
- * If the redirect doesn't exist, then `storefrontRedirect`
- * will pass through the 404 response.
- */
- return storefrontRedirect({request, response, storefront});
- }
-
- return response;
- } catch (error) {
- // eslint-disable-next-line no-console
- console.error(error);
- return new Response('An unexpected error occurred', {status: 500});
- }
- },
-};
-
-/**
- * This is a custom session implementation for your Hydrogen shop.
- * Feel free to customize it to your needs, add helper methods, or
- * swap out the cookie-based implementation with something else!
- */
-export class HydrogenSession {
- #sessionStorage;
- #session;
-
- constructor(sessionStorage: SessionStorage, session: Session) {
- this.#sessionStorage = sessionStorage;
- this.#session = session;
- }
-
- static async init(request: Request, secrets: string[]) {
- const storage = createCookieSessionStorage({
- cookie: {
- name: 'session',
- httpOnly: true,
- path: '/',
- sameSite: 'lax',
- secrets,
- },
- });
-
- const session = await storage.getSession(request.headers.get('Cookie'));
-
- return new this(storage, session);
- }
-
- get has() {
- return this.#session.has;
- }
-
- get get() {
- return this.#session.get;
- }
-
- get flash() {
- return this.#session.flash;
- }
-
- get unset() {
- return this.#session.unset;
- }
-
- get set() {
- return this.#session.set;
- }
-
- destroy() {
- return this.#sessionStorage.destroySession(this.#session);
- }
-
- commit() {
- return this.#sessionStorage.commitSession(this.#session);
- }
-}
-
-// NOTE: https://shopify.dev/docs/api/storefront/latest/queries/cart
-const CART_QUERY_FRAGMENT = `#graphql
- fragment Money on MoneyV2 {
- currencyCode
- amount
- }
- fragment CartLine on CartLine {
- id
- quantity
- attributes {
- key
- value
- }
- cost {
- totalAmount {
- ...Money
- }
- amountPerQuantity {
- ...Money
- }
- compareAtAmountPerQuantity {
- ...Money
- }
- }
- merchandise {
- ... on ProductVariant {
- id
- availableForSale
- compareAtPrice {
- ...Money
- }
- price {
- ...Money
- }
- requiresShipping
- title
- image {
- id
- url
- altText
- width
- height
-
- }
- product {
- handle
- title
- id
- }
- selectedOptions {
- name
- value
- }
- }
- }
- }
- fragment CartApiQuery on Cart {
- id
- checkoutUrl
- totalQuantity
- buyerIdentity {
- countryCode
- customer {
- id
- email
- firstName
- lastName
- displayName
- }
- email
- phone
- }
- lines(first: $numCartLines) {
- nodes {
- ...CartLine
- }
- }
- cost {
- subtotalAmount {
- ...Money
- }
- totalAmount {
- ...Money
- }
- totalDutyAmount {
- ...Money
- }
- totalTaxAmount {
- ...Money
- }
- }
- note
- attributes {
- key
- value
- }
- discountCodes {
- code
- applicable
- }
- }
-` as const;
diff --git a/contentstack-app/storefrontapi.generated.d.ts b/contentstack-app/storefrontapi.generated.d.ts
deleted file mode 100644
index eb09926..0000000
--- a/contentstack-app/storefrontapi.generated.d.ts
+++ /dev/null
@@ -1,1930 +0,0 @@
-/* eslint-disable eslint-comments/disable-enable-pair */
-/* eslint-disable eslint-comments/no-unlimited-disable */
-/* eslint-disable */
-import * as StorefrontAPI from '@shopify/hydrogen/storefront-api-types';
-
-export type MenuItemFragment = Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
->;
-
-export type ChildMenuItemFragment = Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
->;
-
-export type ParentMenuItemFragment = Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
-> & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- >
- >;
-};
-
-export type MenuFragment = Pick & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- > & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- >
- >;
- }
- >;
-};
-
-export type ShopFragment = Pick<
- StorefrontAPI.Shop,
- 'id' | 'name' | 'description'
-> & {
- primaryDomain: Pick;
- brand?: StorefrontAPI.Maybe<{
- logo?: StorefrontAPI.Maybe<{
- image?: StorefrontAPI.Maybe>;
- }>;
- }>;
-};
-
-export type HeaderQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- headerMenuHandle: StorefrontAPI.Scalars['String']['input'];
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type HeaderQuery = {
- shop: Pick & {
- primaryDomain: Pick;
- brand?: StorefrontAPI.Maybe<{
- logo?: StorefrontAPI.Maybe<{
- image?: StorefrontAPI.Maybe>;
- }>;
- }>;
- };
- menu?: StorefrontAPI.Maybe<
- Pick & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- > & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- >
- >;
- }
- >;
- }
- >;
-};
-
-export type FooterQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- footerMenuHandle: StorefrontAPI.Scalars['String']['input'];
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type FooterQuery = {
- menu?: StorefrontAPI.Maybe<
- Pick & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- > & {
- items: Array<
- Pick<
- StorefrontAPI.MenuItem,
- 'id' | 'resourceId' | 'tags' | 'title' | 'type' | 'url'
- >
- >;
- }
- >;
- }
- >;
-};
-
-export type StoreRobotsQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type StoreRobotsQuery = {shop: Pick};
-
-export type SitemapQueryVariables = StorefrontAPI.Exact<{
- urlLimits?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type SitemapQuery = {
- products: {
- nodes: Array<
- Pick<
- StorefrontAPI.Product,
- 'updatedAt' | 'handle' | 'onlineStoreUrl' | 'title'
- > & {
- featuredImage?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- };
- collections: {
- nodes: Array<
- Pick
- >;
- };
- pages: {
- nodes: Array<
- Pick
- >;
- };
-};
-
-export type FeaturedCollectionFragment = Pick<
- StorefrontAPI.Collection,
- 'id' | 'title' | 'handle'
-> & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
-};
-
-export type FeaturedCollectionQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type FeaturedCollectionQuery = {
- collections: {
- nodes: Array<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- }
- >;
- };
-};
-
-export type RecommendedProductFragment = Pick<
- StorefrontAPI.Product,
- 'id' | 'title' | 'handle'
-> & {
- priceRange: {
- minVariantPrice: Pick;
- };
- images: {
- nodes: Array<
- Pick
- >;
- };
-};
-
-export type RecommendedProductsQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type RecommendedProductsQuery = {
- products: {
- nodes: Array<
- Pick & {
- priceRange: {
- minVariantPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- };
- images: {
- nodes: Array<
- Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- };
- }
- >;
- };
-};
-
-export type CustomerAddressUpdateMutationVariables = StorefrontAPI.Exact<{
- address: StorefrontAPI.MailingAddressInput;
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- id: StorefrontAPI.Scalars['ID']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerAddressUpdateMutation = {
- customerAddressUpdate?: StorefrontAPI.Maybe<{
- customerAddress?: StorefrontAPI.Maybe<
- Pick
- >;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type CustomerAddressDeleteMutationVariables = StorefrontAPI.Exact<{
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- id: StorefrontAPI.Scalars['ID']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerAddressDeleteMutation = {
- customerAddressDelete?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.CustomerAddressDeletePayload,
- 'deletedCustomerAddressId'
- > & {
- customerUserErrors: Array<
- Pick
- >;
- }
- >;
-};
-
-export type CustomerDefaultAddressUpdateMutationVariables =
- StorefrontAPI.Exact<{
- addressId: StorefrontAPI.Scalars['ID']['input'];
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- }>;
-
-export type CustomerDefaultAddressUpdateMutation = {
- customerDefaultAddressUpdate?: StorefrontAPI.Maybe<{
- customer?: StorefrontAPI.Maybe<{
- defaultAddress?: StorefrontAPI.Maybe<
- Pick
- >;
- }>;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type CustomerAddressCreateMutationVariables = StorefrontAPI.Exact<{
- address: StorefrontAPI.MailingAddressInput;
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerAddressCreateMutation = {
- customerAddressCreate?: StorefrontAPI.Maybe<{
- customerAddress?: StorefrontAPI.Maybe<
- Pick
- >;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type OrderMoneyFragment = Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
->;
-
-export type AddressFullFragment = Pick<
- StorefrontAPI.MailingAddress,
- | 'address1'
- | 'address2'
- | 'city'
- | 'company'
- | 'country'
- | 'countryCodeV2'
- | 'firstName'
- | 'formatted'
- | 'id'
- | 'lastName'
- | 'name'
- | 'phone'
- | 'province'
- | 'provinceCode'
- | 'zip'
->;
-
-export type DiscountApplicationFragment = {
- value:
- | ({__typename: 'MoneyV2'} & Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >)
- | ({__typename: 'PricingPercentageValue'} & Pick<
- StorefrontAPI.PricingPercentageValue,
- 'percentage'
- >);
-};
-
-export type OrderLineProductVariantFragment = Pick<
- StorefrontAPI.ProductVariant,
- 'id' | 'sku' | 'title'
-> & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- price: Pick;
- product: Pick;
-};
-
-export type OrderLineItemFullFragment = Pick<
- StorefrontAPI.OrderLineItem,
- 'title' | 'quantity'
-> & {
- discountAllocations: Array<{
- allocatedAmount: Pick;
- discountApplication: {
- value:
- | ({__typename: 'MoneyV2'} & Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >)
- | ({__typename: 'PricingPercentageValue'} & Pick<
- StorefrontAPI.PricingPercentageValue,
- 'percentage'
- >);
- };
- }>;
- originalTotalPrice: Pick;
- discountedTotalPrice: Pick;
- variant?: StorefrontAPI.Maybe<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- price: Pick;
- product: Pick;
- }
- >;
-};
-
-export type OrderFragment = Pick<
- StorefrontAPI.Order,
- | 'id'
- | 'name'
- | 'orderNumber'
- | 'statusUrl'
- | 'processedAt'
- | 'fulfillmentStatus'
-> & {
- totalTaxV2?: StorefrontAPI.Maybe<
- Pick
- >;
- totalPriceV2: Pick;
- subtotalPriceV2?: StorefrontAPI.Maybe<
- Pick
- >;
- shippingAddress?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.MailingAddress,
- | 'address1'
- | 'address2'
- | 'city'
- | 'company'
- | 'country'
- | 'countryCodeV2'
- | 'firstName'
- | 'formatted'
- | 'id'
- | 'lastName'
- | 'name'
- | 'phone'
- | 'province'
- | 'provinceCode'
- | 'zip'
- >
- >;
- discountApplications: {
- nodes: Array<{
- value:
- | ({__typename: 'MoneyV2'} & Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >)
- | ({__typename: 'PricingPercentageValue'} & Pick<
- StorefrontAPI.PricingPercentageValue,
- 'percentage'
- >);
- }>;
- };
- lineItems: {
- nodes: Array<
- Pick & {
- discountAllocations: Array<{
- allocatedAmount: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- discountApplication: {
- value:
- | ({__typename: 'MoneyV2'} & Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >)
- | ({__typename: 'PricingPercentageValue'} & Pick<
- StorefrontAPI.PricingPercentageValue,
- 'percentage'
- >);
- };
- }>;
- originalTotalPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- discountedTotalPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- variant?: StorefrontAPI.Maybe<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'altText' | 'height' | 'url' | 'id' | 'width'
- >
- >;
- price: Pick;
- product: Pick;
- }
- >;
- }
- >;
- };
-};
-
-export type OrderQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- orderId: StorefrontAPI.Scalars['ID']['input'];
-}>;
-
-export type OrderQuery = {
- order?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Order,
- | 'id'
- | 'name'
- | 'orderNumber'
- | 'statusUrl'
- | 'processedAt'
- | 'fulfillmentStatus'
- > & {
- totalTaxV2?: StorefrontAPI.Maybe<
- Pick
- >;
- totalPriceV2: Pick;
- subtotalPriceV2?: StorefrontAPI.Maybe<
- Pick
- >;
- shippingAddress?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.MailingAddress,
- | 'address1'
- | 'address2'
- | 'city'
- | 'company'
- | 'country'
- | 'countryCodeV2'
- | 'firstName'
- | 'formatted'
- | 'id'
- | 'lastName'
- | 'name'
- | 'phone'
- | 'province'
- | 'provinceCode'
- | 'zip'
- >
- >;
- discountApplications: {
- nodes: Array<{
- value:
- | ({__typename: 'MoneyV2'} & Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >)
- | ({__typename: 'PricingPercentageValue'} & Pick<
- StorefrontAPI.PricingPercentageValue,
- 'percentage'
- >);
- }>;
- };
- lineItems: {
- nodes: Array<
- Pick & {
- discountAllocations: Array<{
- allocatedAmount: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- discountApplication: {
- value:
- | ({__typename: 'MoneyV2'} & Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >)
- | ({__typename: 'PricingPercentageValue'} & Pick<
- StorefrontAPI.PricingPercentageValue,
- 'percentage'
- >);
- };
- }>;
- originalTotalPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- discountedTotalPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- variant?: StorefrontAPI.Maybe<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'altText' | 'height' | 'url' | 'id' | 'width'
- >
- >;
- price: Pick;
- product: Pick;
- }
- >;
- }
- >;
- };
- }
- >;
-};
-
-export type OrderItemFragment = Pick<
- StorefrontAPI.Order,
- | 'financialStatus'
- | 'fulfillmentStatus'
- | 'id'
- | 'orderNumber'
- | 'customerUrl'
- | 'statusUrl'
- | 'processedAt'
-> & {
- currentTotalPrice: Pick;
- lineItems: {
- nodes: Array<
- Pick & {
- variant?: StorefrontAPI.Maybe<{
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- }>;
- }
- >;
- };
-};
-
-export type CustomerOrdersFragment = Pick<
- StorefrontAPI.Customer,
- 'numberOfOrders'
-> & {
- orders: {
- nodes: Array<
- Pick<
- StorefrontAPI.Order,
- | 'financialStatus'
- | 'fulfillmentStatus'
- | 'id'
- | 'orderNumber'
- | 'customerUrl'
- | 'statusUrl'
- | 'processedAt'
- > & {
- currentTotalPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- lineItems: {
- nodes: Array<
- Pick & {
- variant?: StorefrontAPI.Maybe<{
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'url' | 'altText' | 'height' | 'width'
- >
- >;
- }>;
- }
- >;
- };
- }
- >;
- pageInfo: Pick<
- StorefrontAPI.PageInfo,
- 'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
- >;
- };
-};
-
-export type CustomerOrdersQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- endCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
- first?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- last?: StorefrontAPI.InputMaybe;
- startCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
-}>;
-
-export type CustomerOrdersQuery = {
- customer?: StorefrontAPI.Maybe<
- Pick & {
- orders: {
- nodes: Array<
- Pick<
- StorefrontAPI.Order,
- | 'financialStatus'
- | 'fulfillmentStatus'
- | 'id'
- | 'orderNumber'
- | 'customerUrl'
- | 'statusUrl'
- | 'processedAt'
- > & {
- currentTotalPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- lineItems: {
- nodes: Array<
- Pick & {
- variant?: StorefrontAPI.Maybe<{
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'url' | 'altText' | 'height' | 'width'
- >
- >;
- }>;
- }
- >;
- };
- }
- >;
- pageInfo: Pick<
- StorefrontAPI.PageInfo,
- 'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
- >;
- };
- }
- >;
-};
-
-export type CustomerUpdateMutationVariables = StorefrontAPI.Exact<{
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- customer: StorefrontAPI.CustomerUpdateInput;
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerUpdateMutation = {
- customerUpdate?: StorefrontAPI.Maybe<{
- customer?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Customer,
- 'acceptsMarketing' | 'email' | 'firstName' | 'id' | 'lastName' | 'phone'
- >
- >;
- customerAccessToken?: StorefrontAPI.Maybe<
- Pick
- >;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type CustomerFragment = Pick<
- StorefrontAPI.Customer,
- | 'acceptsMarketing'
- | 'email'
- | 'firstName'
- | 'lastName'
- | 'numberOfOrders'
- | 'phone'
-> & {
- addresses: {
- nodes: Array<
- Pick<
- StorefrontAPI.MailingAddress,
- | 'id'
- | 'formatted'
- | 'firstName'
- | 'lastName'
- | 'company'
- | 'address1'
- | 'address2'
- | 'country'
- | 'province'
- | 'city'
- | 'zip'
- | 'phone'
- >
- >;
- };
- defaultAddress?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.MailingAddress,
- | 'id'
- | 'formatted'
- | 'firstName'
- | 'lastName'
- | 'company'
- | 'address1'
- | 'address2'
- | 'country'
- | 'province'
- | 'city'
- | 'zip'
- | 'phone'
- >
- >;
-};
-
-export type AddressFragment = Pick<
- StorefrontAPI.MailingAddress,
- | 'id'
- | 'formatted'
- | 'firstName'
- | 'lastName'
- | 'company'
- | 'address1'
- | 'address2'
- | 'country'
- | 'province'
- | 'city'
- | 'zip'
- | 'phone'
->;
-
-export type CustomerQueryVariables = StorefrontAPI.Exact<{
- customerAccessToken: StorefrontAPI.Scalars['String']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerQuery = {
- customer?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Customer,
- | 'acceptsMarketing'
- | 'email'
- | 'firstName'
- | 'lastName'
- | 'numberOfOrders'
- | 'phone'
- > & {
- addresses: {
- nodes: Array<
- Pick<
- StorefrontAPI.MailingAddress,
- | 'id'
- | 'formatted'
- | 'firstName'
- | 'lastName'
- | 'company'
- | 'address1'
- | 'address2'
- | 'country'
- | 'province'
- | 'city'
- | 'zip'
- | 'phone'
- >
- >;
- };
- defaultAddress?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.MailingAddress,
- | 'id'
- | 'formatted'
- | 'firstName'
- | 'lastName'
- | 'company'
- | 'address1'
- | 'address2'
- | 'country'
- | 'province'
- | 'city'
- | 'zip'
- | 'phone'
- >
- >;
- }
- >;
-};
-
-export type CustomerActivateMutationVariables = StorefrontAPI.Exact<{
- id: StorefrontAPI.Scalars['ID']['input'];
- input: StorefrontAPI.CustomerActivateInput;
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerActivateMutation = {
- customerActivate?: StorefrontAPI.Maybe<{
- customerAccessToken?: StorefrontAPI.Maybe<
- Pick
- >;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type LoginMutationVariables = StorefrontAPI.Exact<{
- input: StorefrontAPI.CustomerAccessTokenCreateInput;
-}>;
-
-export type LoginMutation = {
- customerAccessTokenCreate?: StorefrontAPI.Maybe<{
- customerUserErrors: Array<
- Pick
- >;
- customerAccessToken?: StorefrontAPI.Maybe<
- Pick
- >;
- }>;
-};
-
-export type CustomerRecoverMutationVariables = StorefrontAPI.Exact<{
- email: StorefrontAPI.Scalars['String']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerRecoverMutation = {
- customerRecover?: StorefrontAPI.Maybe<{
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type CustomerCreateMutationVariables = StorefrontAPI.Exact<{
- input: StorefrontAPI.CustomerCreateInput;
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerCreateMutation = {
- customerCreate?: StorefrontAPI.Maybe<{
- customer?: StorefrontAPI.Maybe>;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type RegisterLoginMutationVariables = StorefrontAPI.Exact<{
- input: StorefrontAPI.CustomerAccessTokenCreateInput;
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type RegisterLoginMutation = {
- customerAccessTokenCreate?: StorefrontAPI.Maybe<{
- customerUserErrors: Array<
- Pick
- >;
- customerAccessToken?: StorefrontAPI.Maybe<
- Pick
- >;
- }>;
-};
-
-export type CustomerResetMutationVariables = StorefrontAPI.Exact<{
- id: StorefrontAPI.Scalars['ID']['input'];
- input: StorefrontAPI.CustomerResetInput;
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type CustomerResetMutation = {
- customerReset?: StorefrontAPI.Maybe<{
- customerAccessToken?: StorefrontAPI.Maybe<
- Pick
- >;
- customerUserErrors: Array<
- Pick
- >;
- }>;
-};
-
-export type PredictiveArticleFragment = {__typename: 'Article'} & Pick<
- StorefrontAPI.Article,
- 'id' | 'title' | 'handle' | 'trackingParameters'
-> & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- };
-
-export type PredictiveCollectionFragment = {__typename: 'Collection'} & Pick<
- StorefrontAPI.Collection,
- 'id' | 'title' | 'handle' | 'trackingParameters'
-> & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- };
-
-export type PredictivePageFragment = {__typename: 'Page'} & Pick<
- StorefrontAPI.Page,
- 'id' | 'title' | 'handle' | 'trackingParameters'
->;
-
-export type PredictiveProductFragment = {__typename: 'Product'} & Pick<
- StorefrontAPI.Product,
- 'id' | 'title' | 'handle' | 'trackingParameters'
-> & {
- variants: {
- nodes: Array<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- price: Pick;
- }
- >;
- };
- };
-
-export type PredictiveQueryFragment = {
- __typename: 'SearchQuerySuggestion';
-} & Pick<
- StorefrontAPI.SearchQuerySuggestion,
- 'text' | 'styledText' | 'trackingParameters'
->;
-
-export type PredictiveSearchQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- limit: StorefrontAPI.Scalars['Int']['input'];
- limitScope: StorefrontAPI.PredictiveSearchLimitScope;
- searchTerm: StorefrontAPI.Scalars['String']['input'];
- types?: StorefrontAPI.InputMaybe<
- | Array
- | StorefrontAPI.PredictiveSearchType
- >;
-}>;
-
-export type PredictiveSearchQuery = {
- predictiveSearch?: StorefrontAPI.Maybe<{
- articles: Array<
- {__typename: 'Article'} & Pick<
- StorefrontAPI.Article,
- 'id' | 'title' | 'handle' | 'trackingParameters'
- > & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- collections: Array<
- {__typename: 'Collection'} & Pick<
- StorefrontAPI.Collection,
- 'id' | 'title' | 'handle' | 'trackingParameters'
- > & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- pages: Array<
- {__typename: 'Page'} & Pick<
- StorefrontAPI.Page,
- 'id' | 'title' | 'handle' | 'trackingParameters'
- >
- >;
- products: Array<
- {__typename: 'Product'} & Pick<
- StorefrontAPI.Product,
- 'id' | 'title' | 'handle' | 'trackingParameters'
- > & {
- variants: {
- nodes: Array<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- }
- >;
- };
- }
- >;
- queries: Array<
- {__typename: 'SearchQuerySuggestion'} & Pick<
- StorefrontAPI.SearchQuerySuggestion,
- 'text' | 'styledText' | 'trackingParameters'
- >
- >;
- }>;
-};
-
-export type ArticleQueryVariables = StorefrontAPI.Exact<{
- articleHandle: StorefrontAPI.Scalars['String']['input'];
- blogHandle: StorefrontAPI.Scalars['String']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type ArticleQuery = {
- blog?: StorefrontAPI.Maybe<{
- articleByHandle?: StorefrontAPI.Maybe<
- Pick & {
- author?: StorefrontAPI.Maybe>;
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'id' | 'altText' | 'url' | 'width' | 'height'
- >
- >;
- seo?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- }>;
-};
-
-export type BlogQueryVariables = StorefrontAPI.Exact<{
- language?: StorefrontAPI.InputMaybe;
- blogHandle: StorefrontAPI.Scalars['String']['input'];
- first?: StorefrontAPI.InputMaybe;
- last?: StorefrontAPI.InputMaybe;
- startCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
- endCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
-}>;
-
-export type BlogQuery = {
- blog?: StorefrontAPI.Maybe<
- Pick & {
- seo?: StorefrontAPI.Maybe<
- Pick
- >;
- articles: {
- nodes: Array<
- Pick<
- StorefrontAPI.Article,
- 'contentHtml' | 'handle' | 'id' | 'publishedAt' | 'title'
- > & {
- author?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'id' | 'altText' | 'url' | 'width' | 'height'
- >
- >;
- blog: Pick;
- }
- >;
- pageInfo: Pick<
- StorefrontAPI.PageInfo,
- 'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
- >;
- };
- }
- >;
-};
-
-export type ArticleItemFragment = Pick<
- StorefrontAPI.Article,
- 'contentHtml' | 'handle' | 'id' | 'publishedAt' | 'title'
-> & {
- author?: StorefrontAPI.Maybe>;
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- blog: Pick;
-};
-
-export type BlogsQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- endCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
- first?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- last?: StorefrontAPI.InputMaybe;
- startCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
-}>;
-
-export type BlogsQuery = {
- blogs: {
- pageInfo: Pick<
- StorefrontAPI.PageInfo,
- 'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'
- >;
- nodes: Array<
- Pick & {
- seo?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- };
-};
-
-export type MoneyProductItemFragment = Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
->;
-
-export type ProductItemFragment = Pick<
- StorefrontAPI.Product,
- 'id' | 'handle' | 'title'
-> & {
- featuredImage?: StorefrontAPI.Maybe<
- Pick
- >;
- priceRange: {
- minVariantPrice: Pick;
- maxVariantPrice: Pick;
- };
- variants: {
- nodes: Array<{
- selectedOptions: Array<
- Pick
- >;
- }>;
- };
-};
-
-export type CollectionQueryVariables = StorefrontAPI.Exact<{
- handle: StorefrontAPI.Scalars['String']['input'];
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- first?: StorefrontAPI.InputMaybe;
- last?: StorefrontAPI.InputMaybe;
- startCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
- endCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
-}>;
-
-export type CollectionQuery = {
- collection?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Collection,
- 'id' | 'handle' | 'title' | 'description'
- > & {
- products: {
- nodes: Array<
- Pick & {
- featuredImage?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'id' | 'altText' | 'url' | 'width' | 'height'
- >
- >;
- priceRange: {
- minVariantPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- maxVariantPrice: Pick<
- StorefrontAPI.MoneyV2,
- 'amount' | 'currencyCode'
- >;
- };
- variants: {
- nodes: Array<{
- selectedOptions: Array<
- Pick
- >;
- }>;
- };
- }
- >;
- pageInfo: Pick<
- StorefrontAPI.PageInfo,
- 'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
- >;
- };
- }
- >;
-};
-
-export type CollectionFragment = Pick<
- StorefrontAPI.Collection,
- 'id' | 'title' | 'handle'
-> & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
-};
-
-export type StoreCollectionsQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- endCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
- first?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- last?: StorefrontAPI.InputMaybe;
- startCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
-}>;
-
-export type StoreCollectionsQuery = {
- collections: {
- nodes: Array<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- }
- >;
- pageInfo: Pick<
- StorefrontAPI.PageInfo,
- 'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'
- >;
- };
-};
-
-export type PageQueryVariables = StorefrontAPI.Exact<{
- language?: StorefrontAPI.InputMaybe;
- country?: StorefrontAPI.InputMaybe;
- handle: StorefrontAPI.Scalars['String']['input'];
-}>;
-
-export type PageQuery = {
- page?: StorefrontAPI.Maybe<
- Pick & {
- seo?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
-};
-
-export type PolicyFragment = Pick<
- StorefrontAPI.ShopPolicy,
- 'body' | 'handle' | 'id' | 'title' | 'url'
->;
-
-export type PolicyQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- privacyPolicy: StorefrontAPI.Scalars['Boolean']['input'];
- refundPolicy: StorefrontAPI.Scalars['Boolean']['input'];
- shippingPolicy: StorefrontAPI.Scalars['Boolean']['input'];
- termsOfService: StorefrontAPI.Scalars['Boolean']['input'];
-}>;
-
-export type PolicyQuery = {
- shop: {
- privacyPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- shippingPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- termsOfService?: StorefrontAPI.Maybe<
- Pick
- >;
- refundPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- };
-};
-
-export type PolicyItemFragment = Pick<
- StorefrontAPI.ShopPolicy,
- 'id' | 'title' | 'handle'
->;
-
-export type PoliciesQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
-}>;
-
-export type PoliciesQuery = {
- shop: {
- privacyPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- shippingPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- termsOfService?: StorefrontAPI.Maybe<
- Pick
- >;
- refundPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- subscriptionPolicy?: StorefrontAPI.Maybe<
- Pick
- >;
- };
-};
-
-export type ProductVariantFragment = Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
-> & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array>;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
-};
-
-export type ProductFragment = Pick<
- StorefrontAPI.Product,
- 'id' | 'title' | 'vendor' | 'handle' | 'descriptionHtml' | 'description'
-> & {
- options: Array>;
- selectedVariant?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
- > & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array<
- Pick
- >;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- variants: {
- nodes: Array<
- Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
- > & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array<
- Pick
- >;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- };
- seo: Pick;
-};
-
-export type ProductQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- handle: StorefrontAPI.Scalars['String']['input'];
- language?: StorefrontAPI.InputMaybe;
- selectedOptions:
- | Array
- | StorefrontAPI.SelectedOptionInput;
-}>;
-
-export type ProductQuery = {
- product?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.Product,
- 'id' | 'title' | 'vendor' | 'handle' | 'descriptionHtml' | 'description'
- > & {
- options: Array>;
- selectedVariant?: StorefrontAPI.Maybe<
- Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
- > & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array<
- Pick
- >;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- variants: {
- nodes: Array<
- Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
- > & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array<
- Pick
- >;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- };
- seo: Pick;
- }
- >;
-};
-
-export type ProductVariantsFragment = {
- variants: {
- nodes: Array<
- Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
- > & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array<
- Pick
- >;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- };
-};
-
-export type ProductVariantsQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- language?: StorefrontAPI.InputMaybe;
- handle: StorefrontAPI.Scalars['String']['input'];
-}>;
-
-export type ProductVariantsQuery = {
- product?: StorefrontAPI.Maybe<{
- variants: {
- nodes: Array<
- Pick<
- StorefrontAPI.ProductVariant,
- 'availableForSale' | 'id' | 'sku' | 'title'
- > & {
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- image?: StorefrontAPI.Maybe<
- {__typename: 'Image'} & Pick<
- StorefrontAPI.Image,
- 'id' | 'url' | 'altText' | 'width' | 'height'
- >
- >;
- price: Pick;
- product: Pick;
- selectedOptions: Array<
- Pick
- >;
- unitPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- }
- >;
- };
- }>;
-};
-
-export type SearchProductFragment = {__typename: 'Product'} & Pick<
- StorefrontAPI.Product,
- 'handle' | 'id' | 'publishedAt' | 'title' | 'trackingParameters' | 'vendor'
-> & {
- variants: {
- nodes: Array<
- Pick & {
- image?: StorefrontAPI.Maybe<
- Pick
- >;
- price: Pick;
- compareAtPrice?: StorefrontAPI.Maybe<
- Pick
- >;
- selectedOptions: Array<
- Pick
- >;
- product: Pick;
- }
- >;
- };
- };
-
-export type SearchPageFragment = {__typename: 'Page'} & Pick<
- StorefrontAPI.Page,
- 'handle' | 'id' | 'title' | 'trackingParameters'
->;
-
-export type SearchArticleFragment = {__typename: 'Article'} & Pick<
- StorefrontAPI.Article,
- 'handle' | 'id' | 'title' | 'trackingParameters'
->;
-
-export type SearchQueryVariables = StorefrontAPI.Exact<{
- country?: StorefrontAPI.InputMaybe;
- endCursor?: StorefrontAPI.InputMaybe<
- StorefrontAPI.Scalars['String']['input']
- >;
- first?: StorefrontAPI.InputMaybe