@things-factory/integration-sellercraft 4.2.7 → 4.2.10
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-server/constants/order-status-mapping.js +5 -1
- package/dist-server/constants/order-status-mapping.js.map +1 -1
- package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js +5 -2
- package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js.map +1 -1
- package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js +10 -3
- package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js.map +1 -1
- package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js +0 -15
- package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js.map +1 -1
- package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js +1 -1
- package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js.map +1 -1
- package/dist-server/routers/sellercraft-router.js +136 -88
- package/dist-server/routers/sellercraft-router.js.map +1 -1
- package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js +273 -237
- package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js.map +1 -1
- package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js +19 -1
- package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js.map +1 -1
- package/dist-server/service/marketplace-channel/marketplace-channel.js +5 -0
- package/dist-server/service/marketplace-channel/marketplace-channel.js.map +1 -1
- package/package.json +3 -3
- package/server/constants/order-status-mapping.ts +5 -0
- package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.ts +6 -2
- package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.ts +10 -3
- package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.ts +0 -16
- package/server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.ts +1 -1
- package/server/routers/sellercraft-router.ts +131 -91
- package/server/service/marketplace-channel/marketplace-channel-order-mutation.ts +325 -286
- package/server/service/marketplace-channel/marketplace-channel-product-mutation.ts +20 -1
- package/server/service/marketplace-channel/marketplace-channel.ts +4 -0
@@ -14,7 +14,7 @@ export class MarketplaceChannelProductMutation {
|
|
14
14
|
const sellercraftChannelIntegrationConfig = config.get('sellercraftChannelIntegrationConfig', {})
|
15
15
|
const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig
|
16
16
|
|
17
|
-
const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find()
|
17
|
+
const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find({ where: { isActive: true } })
|
18
18
|
|
19
19
|
for (var i = 0; i < channels.length; i++) {
|
20
20
|
var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channels[i].channelId
|
@@ -164,6 +164,25 @@ export class MarketplaceChannelProductMutation {
|
|
164
164
|
}
|
165
165
|
})
|
166
166
|
|
167
|
+
if (store.platform == 'magento') {
|
168
|
+
let newList = []
|
169
|
+
for (let np of mappedProducts) {
|
170
|
+
if (np.productId == np.variations[0].variationId) {
|
171
|
+
let vars = mappedProducts
|
172
|
+
.filter(e => e.productId == np.productId)
|
173
|
+
.map(e => {
|
174
|
+
return e.variations[0]
|
175
|
+
})
|
176
|
+
np.variations = vars
|
177
|
+
if (np.variations.length > 1) {
|
178
|
+
np.variations = np.variations.filter(v => v.variationId != np.productId)
|
179
|
+
}
|
180
|
+
newList.push(np)
|
181
|
+
}
|
182
|
+
}
|
183
|
+
mappedProducts = newList
|
184
|
+
}
|
185
|
+
|
167
186
|
try {
|
168
187
|
mappedCategories = mappedCategories.map(category => {
|
169
188
|
if (mappedCategories.filter(e => e.parent == category.categoryId).length > 0) {
|