* fix: added functionality to handle duplicate sku, ean, upc, and barcodes on product variants * handle unique variant values * save * clear ignored keys in redis * fixed plugin to handle duplicates and use last build time to make queries more effective * v1.1.1-canary.0 * removed console log * v1.1.1-canary.1 * reduce amounts of calls to shopify api * v1.1.1-canary.2 * added README and support for SmartCollections * v1.1.1-canary.4 * v1.1.1-canary.5 * v1.1.1-canary.5 * fix dropped products in smart collections * cleanup Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
43 lines
940 B
JavaScript
43 lines
940 B
JavaScript
import { DataType } from "@shopify/shopify-api"
|
|
import { BaseService } from "medusa-interfaces"
|
|
import { createClient } from "../utils/create-client"
|
|
import { pager } from "../utils/pager"
|
|
|
|
class ShopifyClientService extends BaseService {
|
|
// eslint-disable-next-line no-empty-pattern
|
|
constructor({}, options) {
|
|
super()
|
|
|
|
this.options = options
|
|
|
|
/** @private @const {ShopifyRestClient} */
|
|
this.client_ = createClient(this.options)
|
|
}
|
|
|
|
get(params) {
|
|
return this.client_.get(params)
|
|
}
|
|
|
|
async list(path, extraHeaders = null, extraQuery = {}) {
|
|
return await pager(this.client_, path, extraHeaders, extraQuery)
|
|
}
|
|
|
|
delete(params) {
|
|
return this.client_.delete(params)
|
|
}
|
|
|
|
post(params) {
|
|
return this.client_.post({
|
|
path: params.path,
|
|
body: params.body,
|
|
type: DataType.JSON,
|
|
})
|
|
}
|
|
|
|
put(params) {
|
|
return this.client_.post(params)
|
|
}
|
|
}
|
|
|
|
export default ShopifyClientService
|