@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.30 to 1.0.31
@@ -7,3 +7,3 @@ "use strict"; | ||
this.onInstall = async (data) => { | ||
const { trackingScriptUrl: src, platformData: { shopName, accessToken, }, webhooks: { createOrder: createOrderEndpoint, updateShop: updateShopEndpoint = 'https://matt-local-api.ngrok.io/protect/executor?action=UPDATE_SHOP', }, } = data; | ||
const { trackingScriptUrl: src, platformData: { shopName, accessToken, }, webhooks: { createOrder: createOrderEndpoint, updateShop: updateShopEndpoint, updateOrderStatus: orderStatusUpdateEndpoint, uninstall: uninstallEndpoint, }, } = data; | ||
const client = new Shopify({ shopName, accessToken }); | ||
@@ -35,2 +35,10 @@ const webhookList = await client.webhook.list(); | ||
}); | ||
const orderStatusUpdate = await client.webhook.create({ | ||
topic: 'orders/updated', | ||
address: orderStatusUpdateEndpoint, | ||
}); | ||
const uninstall = await client.webhook.create({ | ||
topic: 'app/uninstalled', | ||
address: uninstallEndpoint, | ||
}); | ||
return { | ||
@@ -48,2 +56,4 @@ scripts: { | ||
shopUpdate, | ||
orderStatusUpdate, | ||
uninstall, | ||
}, | ||
@@ -50,0 +60,0 @@ }, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ns8_switchboard_interfaces_1 = require("ns8-switchboard-interfaces"); | ||
class ShopifyUninstallSwitch { | ||
async uninstall(switchContext) { | ||
console.log('ShopifyUninstallSwitch.uninstall()', switchContext); | ||
console.log('ShopifyUninstallSwitch', JSON.stringify(ns8_switchboard_interfaces_1.SwitchContext)); | ||
return {}; | ||
@@ -7,0 +8,0 @@ } |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.30", | ||
"version": "1.0.31", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16326
205