@foxy.io/sdk 2.0.0-beta.1 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +4 -4
  2. package/dist/cdn/FoxySDKCustomer.js +3 -3
  3. package/dist/cjs/backend/API.js +2 -2
  4. package/dist/cjs/backend/createSSOURL.js +1 -1
  5. package/dist/cjs/core/API/AuthError.js +1 -1
  6. package/dist/cjs/core/API/Node.js +11 -11
  7. package/dist/cjs/core/Nucleon/machine.js +1 -0
  8. package/dist/cjs/core/Rumour/Rumour.js +4 -1
  9. package/dist/esm/backend/API.js +2 -2
  10. package/dist/esm/backend/createSSOURL.js +1 -1
  11. package/dist/esm/core/API/AuthError.js +1 -1
  12. package/dist/esm/core/API/Node.js +11 -11
  13. package/dist/esm/core/Nucleon/machine.js +1 -0
  14. package/dist/esm/core/Rumour/Rumour.js +4 -1
  15. package/dist/types/backend/API.d.ts +2 -2
  16. package/dist/types/backend/Graph/applied_coupon_code.d.ts +2 -2
  17. package/dist/types/backend/Graph/applied_tax.d.ts +2 -2
  18. package/dist/types/backend/Graph/attribute.d.ts +2 -2
  19. package/dist/types/backend/Graph/billing_address.d.ts +2 -2
  20. package/dist/types/backend/Graph/cart.d.ts +2 -2
  21. package/dist/types/backend/Graph/cart_include_template.d.ts +2 -2
  22. package/dist/types/backend/Graph/cart_template.d.ts +2 -2
  23. package/dist/types/backend/Graph/checkout_template.d.ts +2 -2
  24. package/dist/types/backend/Graph/client.d.ts +2 -2
  25. package/dist/types/backend/Graph/coupon.d.ts +4 -4
  26. package/dist/types/backend/Graph/coupon_code.d.ts +2 -2
  27. package/dist/types/backend/Graph/coupon_code_transaction.d.ts +2 -2
  28. package/dist/types/backend/Graph/coupon_codes.d.ts +9 -0
  29. package/dist/types/backend/Graph/coupon_detail.d.ts +2 -2
  30. package/dist/types/backend/Graph/coupon_item_category.d.ts +2 -2
  31. package/dist/types/backend/Graph/custom_field.d.ts +2 -2
  32. package/dist/types/backend/Graph/customer.d.ts +2 -2
  33. package/dist/types/backend/Graph/customer_address.d.ts +4 -4
  34. package/dist/types/backend/Graph/customer_portal_settings.d.ts +2 -2
  35. package/dist/types/backend/Graph/default_payment_method.d.ts +7 -7
  36. package/dist/types/backend/Graph/discount.d.ts +2 -2
  37. package/dist/types/backend/Graph/discount_detail.d.ts +2 -2
  38. package/dist/types/backend/Graph/downloadable.d.ts +2 -2
  39. package/dist/types/backend/Graph/downloadable_purchase.d.ts +2 -2
  40. package/dist/types/backend/Graph/email_template.d.ts +2 -2
  41. package/dist/types/backend/Graph/error_entry.d.ts +2 -2
  42. package/dist/types/backend/Graph/fraud_protection.d.ts +2 -2
  43. package/dist/types/backend/Graph/generate_codes.d.ts +2 -0
  44. package/dist/types/backend/Graph/gift_card.d.ts +42 -0
  45. package/dist/types/backend/Graph/gift_card_code.d.ts +35 -0
  46. package/dist/types/backend/Graph/gift_card_code_logs.d.ts +10 -0
  47. package/dist/types/backend/Graph/gift_card_codes.d.ts +21 -0
  48. package/dist/types/backend/Graph/gift_card_item_categories.d.ts +10 -0
  49. package/dist/types/backend/Graph/gift_card_item_category.d.ts +30 -0
  50. package/dist/types/backend/Graph/gift_cards.d.ts +10 -0
  51. package/dist/types/backend/Graph/hosted_payment_gateways_helper.d.ts +56 -0
  52. package/dist/types/backend/Graph/integration.d.ts +10 -10
  53. package/dist/types/backend/Graph/item.d.ts +2 -2
  54. package/dist/types/backend/Graph/item_category.d.ts +2 -2
  55. package/dist/types/backend/Graph/item_option.d.ts +2 -2
  56. package/dist/types/backend/Graph/language_override.d.ts +2 -2
  57. package/dist/types/backend/Graph/language_strings.d.ts +1 -5
  58. package/dist/types/backend/Graph/native_integration.d.ts +2 -2
  59. package/dist/types/backend/Graph/payment.d.ts +5 -5
  60. package/dist/types/backend/Graph/payment_gateway.d.ts +2 -2
  61. package/dist/types/backend/Graph/payment_gateways_helper.d.ts +56 -0
  62. package/dist/types/backend/Graph/payment_method_expiring.d.ts +2 -2
  63. package/dist/types/backend/Graph/payment_method_set.d.ts +2 -2
  64. package/dist/types/backend/Graph/payment_method_set_fraud_protection.d.ts +2 -2
  65. package/dist/types/backend/Graph/payment_method_set_hosted_payment_gateway.d.ts +2 -2
  66. package/dist/types/backend/Graph/property_helpers.d.ts +4 -4
  67. package/dist/types/backend/Graph/receipt_template.d.ts +2 -2
  68. package/dist/types/backend/Graph/regions.d.ts +0 -2
  69. package/dist/types/backend/Graph/shipment.d.ts +2 -2
  70. package/dist/types/backend/Graph/shipping_container.d.ts +2 -2
  71. package/dist/types/backend/Graph/shipping_drop_type.d.ts +2 -2
  72. package/dist/types/backend/Graph/shipping_method.d.ts +2 -2
  73. package/dist/types/backend/Graph/shipping_service.d.ts +2 -2
  74. package/dist/types/backend/Graph/store.d.ts +5 -2
  75. package/dist/types/backend/Graph/store_shipping_method.d.ts +2 -2
  76. package/dist/types/backend/Graph/store_shipping_service.d.ts +2 -2
  77. package/dist/types/backend/Graph/store_version.d.ts +21 -3
  78. package/dist/types/backend/Graph/subscription.d.ts +2 -2
  79. package/dist/types/backend/Graph/subscription_settings.d.ts +2 -2
  80. package/dist/types/backend/Graph/tax.d.ts +2 -2
  81. package/dist/types/backend/Graph/tax_item_category.d.ts +2 -2
  82. package/dist/types/backend/Graph/template_config.d.ts +2 -2
  83. package/dist/types/backend/Graph/template_set.d.ts +2 -2
  84. package/dist/types/backend/Graph/transaction.d.ts +2 -2
  85. package/dist/types/backend/Graph/transaction_log.d.ts +1 -1
  86. package/dist/types/backend/Graph/user.d.ts +2 -2
  87. package/dist/types/backend/Graph/user_access.d.ts +2 -2
  88. package/dist/types/backend/Rels.d.ts +9 -0
  89. package/dist/types/backend/createSSOURL.d.ts +5 -3
  90. package/dist/types/core/Nucleon/types.d.ts +2 -1
  91. package/dist/types/core/Resource/Link.d.ts +1 -1
  92. package/dist/types/core/Rumour/Rumour.d.ts +1 -0
  93. package/dist/types/customer/Graph/attribute.d.ts +2 -2
  94. package/dist/types/customer/Graph/customer_address.d.ts +4 -4
  95. package/dist/types/customer/Graph/customer_portal_settings.d.ts +2 -2
  96. package/dist/types/customer/Graph/default_payment_method.d.ts +7 -7
  97. package/dist/types/customer/Graph/index.d.ts +2 -2
  98. package/dist/types/customer/Graph/item.d.ts +2 -2
  99. package/dist/types/customer/Graph/subscription.d.ts +2 -2
  100. package/dist/types/customer/Graph/transaction.d.ts +2 -2
  101. package/dist/types/customer/Graph/transaction_template.d.ts +2 -2
  102. package/package.json +1 -1
package/README.md CHANGED
@@ -40,13 +40,13 @@ const api = new FoxySDK.Backend.API({
40
40
  });
41
41
  ```
42
42
 
43
- This will create a hAPI version 1 client connecting to `https://api.foxycart.com/` with the given credentials, using in-memory storage for access token and URL resolution, logging errors, warnings and informational messages to console. You can customize each one of these defaults in constructor params and you'll see similar options for Customer API as well.
43
+ This will create a hAPI version 1 client connecting to `https://api.foxy.io/` with the given credentials, using in-memory storage for access token and URL resolution, logging errors, warnings and informational messages to console. You can customize each one of these defaults in constructor params and you'll see similar options for Customer API as well.
44
44
 
45
45
  Regardless of the API type you're working with, you'll see the same methods on each node: `.follow()`, `.get()`, `.put()`, `.post()`, `.patch()` and `.delete()`. Here's how you can use them in 3 steps:
46
46
 
47
47
  ### 1. Find a node
48
48
 
49
- To access a hAPI endpoint, you don't type in a URL – instead you traverse the API graph via links until you reach your target. For example, to see your transactions, you need to load the bookmark URL (`https://api.foxycart.com/`), load your store at `bookmark._links['fx:store'].href` and only then get to the transactions at `store._links['fx:transactions'].href`. With our SDK this lengthy process becomes a one-liner:
49
+ To access a hAPI endpoint, you don't type in a URL – instead you traverse the API graph via links until you reach your target. For example, to see your transactions, you need to load the bookmark URL (`https://api.foxy.io/`), load your store at `bookmark._links['fx:store'].href` and only then get to the transactions at `store._links['fx:transactions'].href`. With our SDK this lengthy process becomes a one-liner:
50
50
 
51
51
  ```js
52
52
  const transactionsNode = api.follow('fx:store').follow('fx:transactions');
@@ -70,11 +70,11 @@ The method we've just called returns a Promise (hence the use of the `await` key
70
70
  const transactions = await transactionsResponse.json();
71
71
  ```
72
72
 
73
- Done! Now you have the API response with the same schema as in the [docs](https://api.foxycart.com/) at your disposal. And yes, we have type definitions for it too, meaning that you'll get type checking with TypeScript and rich autosuggestions with inline docs in every editor that supports them. But what if we could go even further?
73
+ Done! Now you have the API response with the same schema as in the [docs](https://api.foxy.io/) at your disposal. And yes, we have type definitions for it too, meaning that you'll get type checking with TypeScript and rich autosuggestions with inline docs in every editor that supports them. But what if we could go even further?
74
74
 
75
75
  ### 3. Making complex queries
76
76
 
77
- Quite often you'll need to fetch a specific set of items, maybe apply some filters, skip a few entries, speed things up by requesting a partial resource – and you can do that with hAPI using query parameters from our [cheatsheet](https://api.foxycart.com/docs/cheat-sheet). Our SDK provides convenient shortcuts for these parameters in the `.get()` method (all optional):
77
+ Quite often you'll need to fetch a specific set of items, maybe apply some filters, skip a few entries, speed things up by requesting a partial resource – and you can do that with hAPI using query parameters from our [cheatsheet](https://api.foxy.io/docs/cheat-sheet). Our SDK provides convenient shortcuts for these parameters in the `.get()` method (all optional):
78
78
 
79
79
  ```js
80
80
  const transactionsResponse = await transactionsNode.get({