mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
[WIP] Node.js provider for the API (#252)
* 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 (#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>
This commit is contained in:
@@ -13,6 +13,16 @@ directive @accessRestricted(
|
||||
reason: String = null
|
||||
) on FIELD_DEFINITION | OBJECT
|
||||
|
||||
"""
|
||||
Contextualize data.
|
||||
"""
|
||||
directive @inContext(
|
||||
"""
|
||||
The country code for context.
|
||||
"""
|
||||
country: CountryCode!
|
||||
) on QUERY | MUTATION
|
||||
|
||||
"""
|
||||
A version of the API.
|
||||
"""
|
||||
@@ -28,7 +38,7 @@ type ApiVersion {
|
||||
handle: String!
|
||||
|
||||
"""
|
||||
Whether the version is supported by Shopify.
|
||||
Whether the version is actively supported by Shopify. Supported API versions are guaranteed to be stable. Unsupported API versions include unstable, release candidate, and end-of-life versions that are marked as unsupported. For more information, refer to [Versioning](https://shopify.dev/concepts/about-apis/versioning).
|
||||
"""
|
||||
supported: Boolean!
|
||||
}
|
||||
@@ -547,32 +557,32 @@ Card brand, such as Visa or Mastercard, which can be used for payments.
|
||||
"""
|
||||
enum CardBrand {
|
||||
"""
|
||||
Visa
|
||||
Visa.
|
||||
"""
|
||||
VISA
|
||||
|
||||
"""
|
||||
Mastercard
|
||||
Mastercard.
|
||||
"""
|
||||
MASTERCARD
|
||||
|
||||
"""
|
||||
Discover
|
||||
Discover.
|
||||
"""
|
||||
DISCOVER
|
||||
|
||||
"""
|
||||
American Express
|
||||
American Express.
|
||||
"""
|
||||
AMERICAN_EXPRESS
|
||||
|
||||
"""
|
||||
Diners Club
|
||||
Diners Club.
|
||||
"""
|
||||
DINERS_CLUB
|
||||
|
||||
"""
|
||||
JCB
|
||||
JCB.
|
||||
"""
|
||||
JCB
|
||||
}
|
||||
@@ -2142,6 +2152,11 @@ enum CountryCode {
|
||||
"""
|
||||
AW
|
||||
|
||||
"""
|
||||
Ascension Island.
|
||||
"""
|
||||
AC
|
||||
|
||||
"""
|
||||
Australia.
|
||||
"""
|
||||
@@ -3187,6 +3202,11 @@ enum CountryCode {
|
||||
"""
|
||||
TT
|
||||
|
||||
"""
|
||||
Tristan da Cunha.
|
||||
"""
|
||||
TA
|
||||
|
||||
"""
|
||||
Tunisia.
|
||||
"""
|
||||
@@ -3354,7 +3374,7 @@ input CreditCardPaymentInput {
|
||||
amount: Money!
|
||||
|
||||
"""
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
|
||||
"""
|
||||
idempotencyKey: String!
|
||||
|
||||
@@ -3385,7 +3405,7 @@ input CreditCardPaymentInputV2 {
|
||||
paymentAmount: MoneyInput!
|
||||
|
||||
"""
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
|
||||
"""
|
||||
idempotencyKey: String!
|
||||
|
||||
@@ -3529,16 +3549,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
BIF
|
||||
|
||||
"""
|
||||
Belarusian Ruble (BYN).
|
||||
"""
|
||||
BYN
|
||||
|
||||
"""
|
||||
Belarusian Ruble (BYR).
|
||||
"""
|
||||
BYR
|
||||
|
||||
"""
|
||||
Belize Dollar (BZD).
|
||||
"""
|
||||
@@ -3654,11 +3664,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
DKK
|
||||
|
||||
"""
|
||||
Djiboutian Franc (DJF).
|
||||
"""
|
||||
DJF
|
||||
|
||||
"""
|
||||
Dominican Peso (DOP).
|
||||
"""
|
||||
@@ -3674,21 +3679,11 @@ enum CurrencyCode {
|
||||
"""
|
||||
EGP
|
||||
|
||||
"""
|
||||
Eritrean Nakfa (ERN).
|
||||
"""
|
||||
ERN
|
||||
|
||||
"""
|
||||
Ethiopian Birr (ETB).
|
||||
"""
|
||||
ETB
|
||||
|
||||
"""
|
||||
Falkland Islands Pounds (FKP).
|
||||
"""
|
||||
FKP
|
||||
|
||||
"""
|
||||
CFP Franc (XPF).
|
||||
"""
|
||||
@@ -3699,11 +3694,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
FJD
|
||||
|
||||
"""
|
||||
Gibraltar Pounds (GIP).
|
||||
"""
|
||||
GIP
|
||||
|
||||
"""
|
||||
Gambian Dalasi (GMD).
|
||||
"""
|
||||
@@ -3729,11 +3719,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
GEL
|
||||
|
||||
"""
|
||||
Guinean Franc (GNF).
|
||||
"""
|
||||
GNF
|
||||
|
||||
"""
|
||||
Haitian Gourde (HTG).
|
||||
"""
|
||||
@@ -3774,11 +3759,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
ILS
|
||||
|
||||
"""
|
||||
Iranian Rial (IRR).
|
||||
"""
|
||||
IRR
|
||||
|
||||
"""
|
||||
Iraqi Dinar (IQD).
|
||||
"""
|
||||
@@ -3814,11 +3794,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
KES
|
||||
|
||||
"""
|
||||
Kiribati Dollar (KID).
|
||||
"""
|
||||
KID
|
||||
|
||||
"""
|
||||
Kuwaiti Dinar (KWD).
|
||||
"""
|
||||
@@ -3854,11 +3829,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
LRD
|
||||
|
||||
"""
|
||||
Libyan Dinar (LYD).
|
||||
"""
|
||||
LYD
|
||||
|
||||
"""
|
||||
Lithuanian Litai (LTL).
|
||||
"""
|
||||
@@ -3889,11 +3859,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
MVR
|
||||
|
||||
"""
|
||||
Mauritanian Ouguiya (MRU).
|
||||
"""
|
||||
MRU
|
||||
|
||||
"""
|
||||
Mexican Pesos (MXN).
|
||||
"""
|
||||
@@ -4029,11 +3994,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
WST
|
||||
|
||||
"""
|
||||
Saint Helena Pounds (SHP).
|
||||
"""
|
||||
SHP
|
||||
|
||||
"""
|
||||
Saudi Riyal (SAR).
|
||||
"""
|
||||
@@ -4054,11 +4014,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
SCR
|
||||
|
||||
"""
|
||||
Sierra Leonean Leone (SLL).
|
||||
"""
|
||||
SLL
|
||||
|
||||
"""
|
||||
Singapore Dollars (SGD).
|
||||
"""
|
||||
@@ -4069,11 +4024,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
SDG
|
||||
|
||||
"""
|
||||
Somali Shilling (SOS).
|
||||
"""
|
||||
SOS
|
||||
|
||||
"""
|
||||
Syrian Pound (SYP).
|
||||
"""
|
||||
@@ -4134,21 +4084,11 @@ enum CurrencyCode {
|
||||
"""
|
||||
THB
|
||||
|
||||
"""
|
||||
Tajikistani Somoni (TJS).
|
||||
"""
|
||||
TJS
|
||||
|
||||
"""
|
||||
Tanzanian Shilling (TZS).
|
||||
"""
|
||||
TZS
|
||||
|
||||
"""
|
||||
Tongan Pa'anga (TOP).
|
||||
"""
|
||||
TOP
|
||||
|
||||
"""
|
||||
Trinidad and Tobago Dollars (TTD).
|
||||
"""
|
||||
@@ -4199,16 +4139,6 @@ enum CurrencyCode {
|
||||
"""
|
||||
VUV
|
||||
|
||||
"""
|
||||
Venezuelan Bolivares (VEF).
|
||||
"""
|
||||
VEF
|
||||
|
||||
"""
|
||||
Venezuelan Bolivares (VES).
|
||||
"""
|
||||
VES
|
||||
|
||||
"""
|
||||
Vietnamese đồng (VND).
|
||||
"""
|
||||
@@ -4228,6 +4158,96 @@ enum CurrencyCode {
|
||||
Zambian Kwacha (ZMW).
|
||||
"""
|
||||
ZMW
|
||||
|
||||
"""
|
||||
Belarusian Ruble (BYN).
|
||||
"""
|
||||
BYN
|
||||
|
||||
"""
|
||||
Belarusian Ruble (BYR).
|
||||
"""
|
||||
BYR
|
||||
|
||||
"""
|
||||
Djiboutian Franc (DJF).
|
||||
"""
|
||||
DJF
|
||||
|
||||
"""
|
||||
Eritrean Nakfa (ERN).
|
||||
"""
|
||||
ERN
|
||||
|
||||
"""
|
||||
Falkland Islands Pounds (FKP).
|
||||
"""
|
||||
FKP
|
||||
|
||||
"""
|
||||
Gibraltar Pounds (GIP).
|
||||
"""
|
||||
GIP
|
||||
|
||||
"""
|
||||
Guinean Franc (GNF).
|
||||
"""
|
||||
GNF
|
||||
|
||||
"""
|
||||
Iranian Rial (IRR).
|
||||
"""
|
||||
IRR
|
||||
|
||||
"""
|
||||
Kiribati Dollar (KID).
|
||||
"""
|
||||
KID
|
||||
|
||||
"""
|
||||
Libyan Dinar (LYD).
|
||||
"""
|
||||
LYD
|
||||
|
||||
"""
|
||||
Mauritanian Ouguiya (MRU).
|
||||
"""
|
||||
MRU
|
||||
|
||||
"""
|
||||
Sierra Leonean Leone (SLL).
|
||||
"""
|
||||
SLL
|
||||
|
||||
"""
|
||||
Saint Helena Pounds (SHP).
|
||||
"""
|
||||
SHP
|
||||
|
||||
"""
|
||||
Somali Shilling (SOS).
|
||||
"""
|
||||
SOS
|
||||
|
||||
"""
|
||||
Tajikistani Somoni (TJS).
|
||||
"""
|
||||
TJS
|
||||
|
||||
"""
|
||||
Tongan Pa'anga (TOP).
|
||||
"""
|
||||
TOP
|
||||
|
||||
"""
|
||||
Venezuelan Bolivares (VEF).
|
||||
"""
|
||||
VEF
|
||||
|
||||
"""
|
||||
Venezuelan Bolivares (VES).
|
||||
"""
|
||||
VES
|
||||
}
|
||||
|
||||
"""
|
||||
@@ -7355,6 +7375,8 @@ type Payment implements Node {
|
||||
|
||||
"""
|
||||
A client-side generated token to identify a payment and perform idempotent operations.
|
||||
For more information, refer to
|
||||
[Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
|
||||
"""
|
||||
idempotencyKey: String
|
||||
|
||||
@@ -8589,12 +8611,20 @@ type QueryRoot {
|
||||
"""
|
||||
customerAccessToken: String!
|
||||
): Customer
|
||||
|
||||
"""
|
||||
Returns a specific node by ID.
|
||||
"""
|
||||
node(
|
||||
"""
|
||||
The ID of the Node to return.
|
||||
"""
|
||||
id: ID!
|
||||
): Node
|
||||
|
||||
"""
|
||||
Returns the list of nodes with the given IDs.
|
||||
"""
|
||||
nodes(
|
||||
"""
|
||||
The IDs of the Nodes to return.
|
||||
@@ -9246,7 +9276,7 @@ input TokenizedPaymentInput {
|
||||
amount: Money!
|
||||
|
||||
"""
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
|
||||
"""
|
||||
idempotencyKey: String!
|
||||
|
||||
@@ -9287,7 +9317,7 @@ input TokenizedPaymentInputV2 {
|
||||
paymentAmount: MoneyInput!
|
||||
|
||||
"""
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
|
||||
"""
|
||||
idempotencyKey: String!
|
||||
|
||||
@@ -9328,7 +9358,7 @@ input TokenizedPaymentInputV3 {
|
||||
paymentAmount: MoneyInput!
|
||||
|
||||
"""
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
|
||||
A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
|
||||
"""
|
||||
idempotencyKey: String!
|
||||
|
||||
@@ -9393,18 +9423,59 @@ type Transaction {
|
||||
test: Boolean!
|
||||
}
|
||||
|
||||
"""
|
||||
The different kinds of order transactions.
|
||||
"""
|
||||
enum TransactionKind {
|
||||
"""
|
||||
An authorization and capture performed together in a single step.
|
||||
"""
|
||||
SALE
|
||||
|
||||
"""
|
||||
A transfer of the money that was reserved during the authorization stage.
|
||||
"""
|
||||
CAPTURE
|
||||
|
||||
"""
|
||||
An amount reserved against the cardholder's funding source.
|
||||
Money does not change hands until the authorization is captured.
|
||||
"""
|
||||
AUTHORIZATION
|
||||
|
||||
"""
|
||||
An authorization for a payment taken with an EMV credit card reader.
|
||||
"""
|
||||
EMV_AUTHORIZATION
|
||||
|
||||
"""
|
||||
Money returned to the customer when they have paid too much.
|
||||
"""
|
||||
CHANGE
|
||||
}
|
||||
|
||||
"""
|
||||
Transaction statuses describe the status of a transaction.
|
||||
"""
|
||||
enum TransactionStatus {
|
||||
"""
|
||||
The transaction is pending.
|
||||
"""
|
||||
PENDING
|
||||
|
||||
"""
|
||||
The transaction succeeded.
|
||||
"""
|
||||
SUCCESS
|
||||
|
||||
"""
|
||||
The transaction failed.
|
||||
"""
|
||||
FAILURE
|
||||
|
||||
"""
|
||||
There was an error while processing the transaction.
|
||||
"""
|
||||
ERROR
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user