swell-js 4.2.6 → 5.0.0

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 (110) hide show
  1. package/dist/api.mjs +14 -5
  2. package/dist/swell.cjs +14 -5
  3. package/dist/swell.cjs.map +1 -1
  4. package/dist/swell.umd.min.js +14 -5
  5. package/dist/swell.umd.min.js.map +1 -1
  6. package/package.json +3 -2
  7. package/types/account/camel.ts +26 -0
  8. package/types/account/index.ts +26 -0
  9. package/types/account/{snake.d.ts → snake.ts} +8 -10
  10. package/types/attribute/camel.ts +15 -0
  11. package/types/attribute/index.ts +8 -0
  12. package/types/attribute/{snake.d.ts → snake.ts} +3 -4
  13. package/types/billing/camel.ts +39 -0
  14. package/types/billing/index.ts +21 -0
  15. package/types/billing/{snake.d.ts → snake.ts} +9 -18
  16. package/types/card/camel.ts +28 -0
  17. package/types/card/index.ts +26 -0
  18. package/types/card/{snake.d.ts → snake.ts} +6 -6
  19. package/types/cart/camel.ts +95 -0
  20. package/types/cart/index.ts +45 -0
  21. package/types/cart/{snake.d.ts → snake.ts} +20 -31
  22. package/types/category/camel.ts +21 -0
  23. package/types/category/index.ts +8 -0
  24. package/types/category/{snake.d.ts → snake.ts} +3 -5
  25. package/types/content/camel.ts +6 -0
  26. package/types/content/index.ts +8 -0
  27. package/types/content/{snake.d.ts → snake.ts} +3 -5
  28. package/types/coupon/camel.ts +15 -0
  29. package/types/coupon/index.ts +2 -0
  30. package/types/coupon/{snake.d.ts → snake.ts} +3 -3
  31. package/types/currency/camel.ts +14 -0
  32. package/types/currency/index.ts +34 -0
  33. package/types/currency/{snake.d.ts → snake.ts} +3 -3
  34. package/types/discount/camel.ts +32 -0
  35. package/types/discount/index.ts +7 -0
  36. package/types/discount/{snake.d.ts → snake.ts} +7 -9
  37. package/types/giftcard/camel.ts +30 -0
  38. package/types/giftcard/index.ts +2 -0
  39. package/types/giftcard/{snake.d.ts → snake.ts} +7 -9
  40. package/types/index.d.ts +407 -405
  41. package/types/invoice/camel.ts +37 -0
  42. package/types/invoice/index.ts +8 -0
  43. package/types/invoice/{snake.d.ts → snake.ts} +11 -11
  44. package/types/order/camel.ts +79 -0
  45. package/types/order/index.ts +32 -0
  46. package/types/order/{snake.d.ts → snake.ts} +18 -26
  47. package/types/payment/camel.ts +58 -0
  48. package/types/payment/index.ts +79 -0
  49. package/types/payment/{snake.d.ts → snake.ts} +16 -21
  50. package/types/product/camel.ts +86 -0
  51. package/types/product/index.ts +72 -0
  52. package/types/product/{snake.d.ts → snake.ts} +12 -23
  53. package/types/promotion/camel.ts +28 -0
  54. package/types/promotion/index.ts +2 -0
  55. package/types/promotion/{snake.d.ts → snake.ts} +6 -8
  56. package/types/purchase_link/camel.ts +21 -0
  57. package/types/purchase_link/index.ts +2 -0
  58. package/types/purchase_link/{snake.d.ts → snake.ts} +6 -6
  59. package/types/refund/camel.ts +19 -0
  60. package/types/refund/index.ts +2 -0
  61. package/types/refund/{snake.d.ts → snake.ts} +5 -5
  62. package/types/shipment_rating/camel.ts +15 -0
  63. package/types/shipment_rating/index.ts +2 -0
  64. package/types/shipment_rating/{snake.d.ts → snake.ts} +2 -4
  65. package/types/subscription/camel.ts +61 -0
  66. package/types/subscription/index.ts +28 -0
  67. package/types/subscription/{snake.d.ts → snake.ts} +14 -20
  68. package/types/utils.ts +10 -0
  69. package/types/account/camel.d.ts +0 -8
  70. package/types/account/index.d.ts +0 -9
  71. package/types/attribute/camel.d.ts +0 -4
  72. package/types/attribute/index.d.ts +0 -4
  73. package/types/billing/camel.d.ts +0 -25
  74. package/types/billing/index.d.ts +0 -38
  75. package/types/card/camel.d.ts +0 -9
  76. package/types/card/index.d.ts +0 -9
  77. package/types/cart/camel.d.ts +0 -32
  78. package/types/cart/index.d.ts +0 -46
  79. package/types/category/camel.d.ts +0 -4
  80. package/types/category/index.d.ts +0 -4
  81. package/types/content/camel.d.ts +0 -5
  82. package/types/content/index.d.ts +0 -8
  83. package/types/coupon/camel.d.ts +0 -4
  84. package/types/coupon/index.d.ts +0 -4
  85. package/types/currency/camel.d.ts +0 -15
  86. package/types/currency/index.d.ts +0 -21
  87. package/types/discount/camel.d.ts +0 -15
  88. package/types/discount/index.d.ts +0 -18
  89. package/types/giftcard/camel.d.ts +0 -6
  90. package/types/giftcard/index.d.ts +0 -5
  91. package/types/invoice/camel.d.ts +0 -4
  92. package/types/invoice/index.d.ts +0 -4
  93. package/types/order/camel.d.ts +0 -15
  94. package/types/order/index.d.ts +0 -20
  95. package/types/payment/camel.d.ts +0 -35
  96. package/types/payment/index.d.ts +0 -51
  97. package/types/product/camel.d.ts +0 -24
  98. package/types/product/index.d.ts +0 -49
  99. package/types/promotion/camel.d.ts +0 -7
  100. package/types/promotion/index.d.ts +0 -8
  101. package/types/purchase_link/camel.d.ts +0 -4
  102. package/types/purchase_link/index.d.ts +0 -4
  103. package/types/refund/camel.d.ts +0 -4
  104. package/types/refund/index.d.ts +0 -4
  105. package/types/shipment_rating/camel.d.ts +0 -7
  106. package/types/shipment_rating/index.d.ts +0 -10
  107. package/types/subscription/camel.d.ts +0 -15
  108. package/types/subscription/index.d.ts +0 -21
  109. /package/types/locale/{index.d.ts → index.ts} +0 -0
  110. /package/types/settings/{index.d.ts → index.ts} +0 -0
package/dist/api.mjs CHANGED
@@ -126,12 +126,21 @@ function methods(api, _opt) {
126
126
  };
127
127
  }
128
128
 
129
+ /** @typedef {import('../types').InitOptions} InitOptions */
130
+
131
+ /**
132
+ * @template {'snake' | 'camel'} C
133
+ * @typedef {import('../types').SwellClient<C>} SwellClient<C>
134
+ */
135
+
129
136
  /**
130
137
  * Swell API client
131
- * @param {string} initStore - Store name
132
- * @param {string} initKey - API key
133
- * @param {InitOptions} initOptions - Options
134
- * @returns {SwellClient} API client
138
+ *
139
+ * @template {'snake' | 'camel'} C
140
+ * @param {string} [initStore] - Store name
141
+ * @param {string} [initKey] - API key
142
+ * @param {InitOptions} [initOptions] - Options
143
+ * @returns {SwellClient<C>} API client
135
144
  */
136
145
  function swell(initStore = undefined, initKey, initOptions = {}) {
137
146
  const options = {
@@ -145,7 +154,7 @@ function swell(initStore = undefined, initKey, initOptions = {}) {
145
154
  const api = {};
146
155
 
147
156
  Object.assign(api, {
148
- version: '4.2.6',
157
+ version: '5.0.0',
149
158
  options,
150
159
  request,
151
160
 
package/dist/swell.cjs CHANGED
@@ -10161,12 +10161,21 @@ function methods(api, _opt) {
10161
10161
  };
10162
10162
  }
10163
10163
 
10164
+ /** @typedef {import('../types').InitOptions} InitOptions */
10165
+
10166
+ /**
10167
+ * @template {'snake' | 'camel'} C
10168
+ * @typedef {import('../types').SwellClient<C>} SwellClient<C>
10169
+ */
10170
+
10164
10171
  /**
10165
10172
  * Swell API client
10166
- * @param {string} initStore - Store name
10167
- * @param {string} initKey - API key
10168
- * @param {InitOptions} initOptions - Options
10169
- * @returns {SwellClient} API client
10173
+ *
10174
+ * @template {'snake' | 'camel'} C
10175
+ * @param {string} [initStore] - Store name
10176
+ * @param {string} [initKey] - API key
10177
+ * @param {InitOptions} [initOptions] - Options
10178
+ * @returns {SwellClient<C>} API client
10170
10179
  */
10171
10180
  function swell(initStore = undefined, initKey, initOptions = {}) {
10172
10181
  const options = {
@@ -10180,7 +10189,7 @@ function swell(initStore = undefined, initKey, initOptions = {}) {
10180
10189
  const api = {};
10181
10190
 
10182
10191
  Object.assign(api, {
10183
- version: '4.2.6',
10192
+ version: '5.0.0',
10184
10193
  options,
10185
10194
  request,
10186
10195