Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(provider): Implement Kibo Commerce provider #575

Merged
merged 36 commits into from
Dec 15, 2021

Conversation

kibo-kevinwatts
Copy link
Contributor

@kibo-kevinwatts kibo-kevinwatts commented Nov 17, 2021

Demo: https://kibo-commerce-nextjs.vercel.app/

Status

  • CommerceProvider
  • Schema & TS types
  • API Operations - Get all collections
  • API Operations - Get all pages
  • API Operations - Get all products
  • API Operations - Get page
  • API Operations - Get product
  • API Operations - Get Shop Info (categories and vendors working — vendors query still a WIP PR on Reaction)
  • Hook - Add Item
  • Hook - Remove Item
  • Hook - Update Item
  • Hook - Get Cart
  • Auth
  • Customer information
  • Product attributes - Size, Colors
  • Custom checkout
  • Typing
  • Tests

* folder and env setup

* codegen.json headers removed

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* folder and env setup

* codegen.json headers removed

* use-cart code flow updated

* use-cart code flow updated

* Implemented get-cart functionality

* removed unused file

* getAnonymousShopperToken function added

* normalization mapping updated

* PR points resolved

* Anonymous shopper token query added

* getAnonymousShopperToken function added

* Anonymous shopper token query added

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* folder and env setup

* codegen.json headers removed

* icky-175-get-site-info

* PR comments resolved

* update category Id

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* Update README.md

* Initial Commit

* Commited Keys

* GraphQL Changes

* GraphQL Query

* Final Changes

* Changed login.ts

* Made changes in login.ts

* Final Changes

* Refactored login.ts

* SignUp Initial Checkin

* logout Initial

* Customer Account Initial Commit

* Logout - deleted cookie

* Reverted ReadMe and UserNav file

* Final Changes

* Resolved comments

* Resolved comments 1

* Resolved comments 2

* Resolved comments 3

* Resolved comments 4

Co-authored-by: SushantJadhav <Sushant.Jadhav@kibocommerce.com>
* GetProduct Initial Commit

* Passed productCode as Slug to get-product

* Moved currencyCode in Config file
* Initial commit related to getAllPages

* Initial Changes

* Making documentListName configurable

* fixing dynamic page rendering and adding typescript code

Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>
Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>
* GetProduct Initial Commit

* addItemToCart function implemneted

* Add Item to cart functionality implemented

* ICKY-166-getProducts-and-getProduct (vercel#6)

* GetProduct Initial Commit

* Passed productCode as Slug to get-product

* Moved currencyCode in Config file

* Icky 173 (vercel#9)

* Initial commit related to getAllPages

* Initial Changes

* Making documentListName configurable

* fixing dynamic page rendering and adding typescript code

Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>
Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>

* addItemToCart function implemneted

Conflicts resolved

* Add Item to cart functionality implemented

* booleans removed from query

* cart size option enabled

* updated addItem for with and without variants products

Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>
Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
Co-authored-by: kibo-sushant <89385472+kibo-sushant@users.noreply.github.com>
Co-authored-by: kibo-kevinwatts <85258296+kibo-kevinwatts@users.noreply.github.com>
Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>
* addItemToCart function implemneted

Conflicts resolved

* Add Item to cart functionality implemented

* remove Item from cart implemented

* removed unused code

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* update cart quantity implemented

* add item to cart bug fixed

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* changes in product-search-vars

* remove unwanted boolean
* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* changes in product-search-vars

* remove unwanted boolean

* initial commit

* updated Provider

* usewishlist/getwishlist

* changes in provider.ts

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* usewishlist/getwishlist

* updated Provider

* changes in provider.ts

* normalize wishlistitem

* changes in get-customer-account

* remove unwanted code

* resolve empty wishlist case

* resolve pr comments

Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>
Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* usewishlist/getwishlist

* changes in provider.ts

* changes in get-customer-account

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* usewishlist/getwishlist

* changes in provider.ts

* remove unwanted code

* initial commit

* resolve pr comments

* changes in add-item

* remove wishlist fragment

* remove item from wishlist

* changes in normalize.ts

* changes in additemtowishlist mutation

* resove pr comments
* Kibo API authentication helper handling oauth token generation / refresh and making auth ticket available to process via next server runtime config

* Update .env template with placeholder for Kibo Auth Url
* remove Item from cart implemented

* update cart quantity implemented

* removed unused code

* ICKY 176 and 263 implemented

* ICKY 263 removed

* PR points resolved

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
* ICKY-263

* resolve pr comments

* resolve pr comments for customer typescript
@kibo-kevinwatts
Copy link
Contributor Author

Hey @goncy!

  • Yes! Setup an environment you can use. Here is a quick one time secret to the .env / creds you can use to run locally.
  • We have a checkout API and plan on integrating with the new customCheckout features

Thanks!

Copy link

@GuiBibeau GuiBibeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this submission! I left a few comments but nothing major.

@@ -0,0 +1,22 @@
// export default function noopApi(...args: any[]): void {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment still needed? We should remove to avoid future confusion if not

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1,24 @@
import { GetAPISchema, createEndpoint } from '@commerce/api'
import wishlistEndpoint from '@commerce/api/endpoints/wishlist'
// import type { WishlistSchema } from '../../../types/wishlist'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably should remove this commented code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1,62 @@
// import type { Wishlist } from '@commerce/types/wishlist'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same things for commented code here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link

@GuiBibeau GuiBibeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for address my mini comments!

@goncy
Copy link
Contributor

goncy commented Dec 9, 2021

Hey @kibo-kevinwatts we are almost ready, I modified the description of the PR, can you please update on what is done and missing just to have a record, not all points are required. I will do a final review today 🙌

@goncy
Copy link
Contributor

goncy commented Dec 10, 2021

Hey @kibo-kevinwatts ! I have finished the review and we are almost ready to merge, can you send me an email to goncy@vercel.com so we can own credentials for setting up the deploy on our side? Thanks

@kibo-kevinwatts
Copy link
Contributor Author

@goncy Updated the PR description.
I'm not sure what the API Operations - Get all collections is, but if you let me know we can implement it when we add the Checkout and Customer address/card features.
I also did not see it on the list of tasks above, but we implemented the wishlist hooks as well

Thanks again for the quick review! I emailed you the creds.

Copy link
Contributor

@goncy goncy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kibo-kevinwatts ! I was trying all other deploys and I found out that you are importing from framework in some files, I left a comment in every file to replace framework alias imports with relative paths to avoid breaking other providers, just let me know!

framework/kibocommerce/api/endpoints/cart/add-item.ts Outdated Show resolved Hide resolved
framework/kibocommerce/api/endpoints/cart/get-cart.ts Outdated Show resolved Hide resolved
framework/kibocommerce/api/endpoints/cart/remove-item.ts Outdated Show resolved Hide resolved
framework/kibocommerce/api/endpoints/cart/update-item.ts Outdated Show resolved Hide resolved
framework/kibocommerce/api/endpoints/customer/customer.ts Outdated Show resolved Hide resolved
framework/kibocommerce/api/endpoints/wishlist/add-item.ts Outdated Show resolved Hide resolved
framework/kibocommerce/api/utils/cookie-handler.ts Outdated Show resolved Hide resolved
framework/kibocommerce/lib/normalize.ts Outdated Show resolved Hide resolved
@kibo-kevinwatts
Copy link
Contributor Author

@goncy Replaced the alias paths with relative paths

@goncy
Copy link
Contributor

goncy commented Dec 14, 2021

@goncy Replaced the alias paths with relative paths

Excelent! Can you please resolve the conflicts so I can merge it?

@kibo-kevinwatts
Copy link
Contributor Author

@goncy Fixed!

@goncy goncy merged commit 9a4772c into vercel:main Dec 15, 2021
@goncy
Copy link
Contributor

goncy commented Dec 15, 2021

Congrats @kibo-kevinwatts ! And thanks for everything 🙌

loan-laux pushed a commit to TrellisCommerce/next-commerce-bigcommerce that referenced this pull request May 11, 2023
* Icky 161 folder and env setup (vercel#1)

* folder and env setup

* codegen.json headers removed

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* Feature/icky 194 (vercel#5)

* folder and env setup

* codegen.json headers removed

* use-cart code flow updated

* use-cart code flow updated

* Implemented get-cart functionality

* removed unused file

* getAnonymousShopperToken function added

* normalization mapping updated

* PR points resolved

* Anonymous shopper token query added

* getAnonymousShopperToken function added

* Anonymous shopper token query added

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* Icky 175 (vercel#3)

* folder and env setup

* codegen.json headers removed

* icky-175-get-site-info

* PR comments resolved

* update category Id

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* Icky-169-LogIn (vercel#4)

* Update README.md

* Initial Commit

* Commited Keys

* GraphQL Changes

* GraphQL Query

* Final Changes

* Changed login.ts

* Made changes in login.ts

* Final Changes

* Refactored login.ts

* SignUp Initial Checkin

* logout Initial

* Customer Account Initial Commit

* Logout - deleted cookie

* Reverted ReadMe and UserNav file

* Final Changes

* Resolved comments

* Resolved comments 1

* Resolved comments 2

* Resolved comments 3

* Resolved comments 4

Co-authored-by: SushantJadhav <Sushant.Jadhav@kibocommerce.com>

* ICKY-166-getProducts-and-getProduct (vercel#6)

* GetProduct Initial Commit

* Passed productCode as Slug to get-product

* Moved currencyCode in Config file

* Icky 173 (vercel#9)

* Initial commit related to getAllPages

* Initial Changes

* Making documentListName configurable

* fixing dynamic page rendering and adding typescript code

Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>
Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>

* Feature/icky 176 (vercel#8)

* GetProduct Initial Commit

* addItemToCart function implemneted

* Add Item to cart functionality implemented

* ICKY-166-getProducts-and-getProduct (vercel#6)

* GetProduct Initial Commit

* Passed productCode as Slug to get-product

* Moved currencyCode in Config file

* Icky 173 (vercel#9)

* Initial commit related to getAllPages

* Initial Changes

* Making documentListName configurable

* fixing dynamic page rendering and adding typescript code

Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>
Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>

* addItemToCart function implemneted

Conflicts resolved

* Add Item to cart functionality implemented

* booleans removed from query

* cart size option enabled

* updated addItem for with and without variants products

Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>
Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
Co-authored-by: kibo-sushant <89385472+kibo-sushant@users.noreply.github.com>
Co-authored-by: kibo-kevinwatts <85258296+kibo-kevinwatts@users.noreply.github.com>
Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>

* Removed types from schema.d.ts (vercel#11)

* Final Changes (vercel#16)

* Icky 177 (vercel#13)

* addItemToCart function implemneted

Conflicts resolved

* Add Item to cart functionality implemented

* remove Item from cart implemented

* removed unused code

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* Icky 178 - Update Cart Quantity implemented (vercel#14)

* update cart quantity implemented

* add item to cart bug fixed

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* Icky 182 (vercel#12)

* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* changes in product-search-vars

* remove unwanted boolean

* Feature/icky 179 (vercel#17)

* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* remove extra spaces

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* changes in product-search-vars

* remove unwanted boolean

* initial commit

* updated Provider

* usewishlist/getwishlist

* changes in provider.ts

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* usewishlist/getwishlist

* updated Provider

* changes in provider.ts

* normalize wishlistitem

* changes in get-customer-account

* remove unwanted code

* resolve empty wishlist case

* resolve pr comments

Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>

* token encoding and decoding fixed (vercel#19)

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* Feature/icky- 180 & 181 (vercel#20)

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* usewishlist/getwishlist

* changes in provider.ts

* changes in get-customer-account

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* initial commit

* useSearch hook

* revert pages and component changes

* remove extra spacing in search.tsx

* changes in catalog/products and product-search-vars

* usewishlist/getwishlist

* changes in provider.ts

* remove unwanted code

* initial commit

* resolve pr comments

* changes in add-item

* remove wishlist fragment

* remove item from wishlist

* changes in normalize.ts

* changes in additemtowishlist mutation

* resove pr comments

* Feature/icky 291 (vercel#22)

* Kibo API authentication helper handling oauth token generation / refresh and making auth ticket available to process via next server runtime config

* Update .env template with placeholder for Kibo Auth Url

* resolve ICKY-275 (vercel#24)

* Fix/icky 276 (vercel#21)

* remove Item from cart implemented

* update cart quantity implemented

* removed unused code

* ICKY 176 and 263 implemented

* ICKY 263 removed

* PR points resolved

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>

* ICKY-263 (vercel#23)

* ICKY-263

* resolve pr comments

* resolve pr comments for customer typescript

* docs: update kibo commerce readme with env details (vercel#26)

* resolve icky-264 (vercel#25)

* chore: remove extra field from .env.template

* chore: remove extra .vscode launch json file

* chore: cleanup test message from kibocommerce fork

* chore(docs): remove extra field from .env template and .env related docs

* chore: remove test data json file

* chore: delete yarn.lock

* refactor: remove unused fetch from kibo config, remove unused CommerceProvider

* refactor: rename queries and util modules for consistency

* chore: add checkout related api noop handlers and hooks

* chore: revert modified core files

* chore(config): add kibo production sandbox cdn to image domains config

* fix: page normalizer and query for static pages

* chore: remove commented code and unnecessary imports

* fix(module paths): switch framework alias for relative path

Co-authored-by: kibo-chandradeeptalaha <89371824+kibo-chandradeeptalaha@users.noreply.github.com>
Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
Co-authored-by: kibo-geetanshuchhabra <89399259+kibo-geetanshuchhabra@users.noreply.github.com>
Co-authored-by: kibo-sushant <89385472+kibo-sushant@users.noreply.github.com>
Co-authored-by: SushantJadhav <Sushant.Jadhav@kibocommerce.com>
Co-authored-by: amolnadagonde <amol.nadagonde@kibocommerce.com>
Co-authored-by: kibo-sushant <sushant.jadhav@blueconchtech.com>
Co-authored-by: kibo-amolnadagonde <75060520+kibo-amolnadagonde@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants