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

[WIP] Node.js provider for the API #252

Merged
merged 85 commits into from
Jun 1, 2021
Merged

[WIP] Node.js provider for the API #252

merged 85 commits into from
Jun 1, 2021

Conversation

lfades
Copy link
Member

@lfades lfades commented Mar 30, 2021

Fixes #224

This PR refactors the way the Node.js API of commerce and the UI interact with each other. In general it does the following:

  • API endpoints now share the same path, independent of the provider, and the endpoint now lives in the core, with each provider now adding handlers for that endpoint.
  • API operations now live under a common commerce object, instead of being independently imported, they're still independent, but this way it feels more like a Node.js API
  • Commerce core types now properly include the types for everything, previously we had different types for API endpoints, API operations and UI hooks, now they all come from the same place, this also makes our types less complicated and tricky to use

Next steps: testing and updating the other providers to follow this new structure, BigCommerce is 100% right now.

@vercel
Copy link

vercel bot commented Mar 30, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

commerce – ./

🔍 Inspect: https://vercel.com/vercel/commerce/51JNt5PHHCueR88AntNvyQ181Hw7
✅ Preview: Failed

[Deployment for 601ec01 failed]

commerce-shopify – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-shopify/67yUfotZ1jTR7W7pCVbgYqCSH6Ju
✅ Preview: https://commerce-shopify-git-nodejs-provider-vercel-solutions-vtest314.vercel.app

commerce-bigcommerce – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-bigcommerce/9EnPEYbQojku348wjgXGMZZ7b5XR
✅ Preview: https://commerce-bigco-git-nodejs-provider-vercel-solutions-v-a7934d.vercel.app

commerceads32322asdsaasd – ./

🔍 Inspect: https://vercel.com/uncurated-tests/commerceads32322asdsaasd/4fazBg521jbag35cRiazosXwDqkj
✅ Preview: Failed

[Deployment for cf9b341 failed]

commerce-swell – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-swell/G3tNFfUHa9wK8V3sErdmtJEE6biM
✅ Preview: Failed

[Deployment for 9f2c076 failed]

commerce-vendure – ./

🔍 Inspect: https://vercel.com/vercel-solutions-vtest314/commerce-vendure/3x95N4Xp7QEpgBXftXdnfcfY2Nup
✅ Preview: Failed

[Deployment for 9f2c076 failed]

@lfades lfades merged commit a98c95d into master Jun 1, 2021
@lfades lfades deleted the nodejs-provider branch June 1, 2021 08:18
@zaiste zaiste mentioned this pull request Jun 5, 2021
@kennyadsl kennyadsl mentioned this pull request Jun 16, 2022
7 tasks
loan-laux pushed a commit to TrellisCommerce/next-commerce-bigcommerce that referenced this pull request May 11, 2023
* Adding multiple initial files

* Updated the default cart endpoint

* Fixes

* Updated CommerceAPI class for better usage

* Adding more migration changes

* Taking multiple steps into better API types

* Adding more experimental types

* Removed many testing types

* Adding types, fixes and other updates

* Updated commerce types

* Updated types for hooks now using the API

* Updated mutation types

* Simplified cart types for the provider

* Updated cart hooks

* Remove normalizers from the hooks

* Updated cart endpoint

* Removed cart handlers

* bug fixes

* Improve quantity input behavior in cart item

* Removed endpoints folder

* Making progress on api operations

* Moved method

* Moved types

* Changed the way ops are created

* Added customer endpoint

* Login endpoint

* Added logout endpoint

* Add missing logout files

* Added signup endpoint

* Removed customers old endpoints

* Moved endpoints to nested folder

* Removed old customer endpoint builders

* Updated login operation

* Updated login operation

* Added getAllPages operation

* Renamed endpoint operations to handlers

* Changed import

* Renamed operations to handlers in usage

* Moved getAllPages everywhere

* Moved getPage

* Updated getPage usage

* Moved getSiteInfo

* Added def types for product

* Updated type

* moved products catalog endpoint

* removed old catalog endpoint

* Moved wishlist

* Removed commerce.endpoint

* Replaced references to commerce.endpoint

* Updated catalog products

* Moved checkout api

* Added the get customer wishlist operation

* Removed old wishlist stuff

* Added getAllProductPaths operation

* updated reference to operation

* Moved getAllProducts

* Updated getProduct operation

* Removed old getConfig and references

* Removed is-allowed-method from BC

* Updated types for auth hooks

* Updated useCustomer and core types

* Updated useData and util hooks

* Updated useSearch hook

* Updated types for useWishlist

* Added index for types

* Fixes

* Updated urls to the API

* Renamed fetchInput to fetcherInput

* Updated fetch type

* Fixes in search hook

* Updated Shopify Provider Structure (vercel#340)

* Add codegen, update fragments & schemas

* Update checkout-create.ts

* Update checkout-create.ts

* Update README.md

* Update product mutations & queries

* Uptate customer fetch types

* Update schemas

* Start updates

* Moved Page, AllPages & Site Info

* Moved product, all products (paths)

* Add translations, update operations & fixes

* Update api endpoints, types & fixes

* Add api checkout endpoint

* Updates

* Fixes

* Update commerce.config.json

Co-authored-by: B <curciobelen@gmail.com>

* Added category type and normalizer

* updated init script to exclude other providers

* Excluded swell and venture temporarily

* Fix category & color normalization

* Fixed category normalizer in shopify

* Don't use getSlug for category on /search

* Update colors.ts

Co-authored-by: cond0r <pinte_catalin@yahoo.com>
Co-authored-by: B <curciobelen@gmail.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.

Unify the Node.js API for providers
3 participants