swell-js 5.1.0 → 5.1.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.
- package/dist/api.mjs +11 -3
- package/dist/payment.mjs +1071 -91
- package/dist/swell.cjs +1126 -138
- package/dist/swell.cjs.map +1 -1
- package/dist/swell.umd.min.js +1129 -141
- package/dist/swell.umd.min.js.map +1 -1
- package/package.json +3 -2
- package/types/discount/snake.ts +1 -0
- package/types/index.d.ts +12 -4
- package/types/shipment_rating/snake.ts +1 -1
package/dist/api.mjs
CHANGED
|
@@ -126,7 +126,10 @@ function methods(api, _opt) {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* @template {'snake' | 'camel'} C
|
|
131
|
+
* @typedef {import('../types').InitOptions<C>} InitOptions<C>
|
|
132
|
+
*/
|
|
130
133
|
|
|
131
134
|
/**
|
|
132
135
|
* @template {'snake' | 'camel'} C
|
|
@@ -139,7 +142,7 @@ function methods(api, _opt) {
|
|
|
139
142
|
* @template {'snake' | 'camel'} C
|
|
140
143
|
* @param {string} [initStore] - Store name
|
|
141
144
|
* @param {string} [initKey] - API key
|
|
142
|
-
* @param {InitOptions} [initOptions] - Options
|
|
145
|
+
* @param {InitOptions<C>} [initOptions] - Options
|
|
143
146
|
* @returns {SwellClient<C>} API client
|
|
144
147
|
*/
|
|
145
148
|
function swell(initStore = undefined, initKey, initOptions = {}) {
|
|
@@ -154,10 +157,15 @@ function swell(initStore = undefined, initKey, initOptions = {}) {
|
|
|
154
157
|
const api = {};
|
|
155
158
|
|
|
156
159
|
Object.assign(api, {
|
|
157
|
-
version: '5.1.
|
|
160
|
+
version: '5.1.2',
|
|
158
161
|
options,
|
|
159
162
|
request,
|
|
160
163
|
|
|
164
|
+
/**
|
|
165
|
+
* @param {string} store
|
|
166
|
+
* @param {string} key
|
|
167
|
+
* @param {InitOptions<C>} [opt]
|
|
168
|
+
*/
|
|
161
169
|
init(store, key, opt = {}) {
|
|
162
170
|
options.key = key;
|
|
163
171
|
options.store = store;
|