@bprotsyk/aso-core 2.1.43 → 2.1.45
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.
|
@@ -71,17 +71,22 @@ async function createStreamForMatchingCampaigns(streamPayloads, campaignRegExp,
|
|
|
71
71
|
// Process each stream payload
|
|
72
72
|
for (const { payload, offerId } of streamPayloads) {
|
|
73
73
|
const identicalStream = streams.find(stream => stream.name.includes(offerId));
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
try {
|
|
75
|
+
if (identicalStream) {
|
|
76
|
+
await http_1.default.put(`streams/${identicalStream.id}`, {
|
|
77
|
+
campaign_id: matchingCampaign.id,
|
|
78
|
+
...payload
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
await http_1.default.post('streams', {
|
|
83
|
+
campaign_id: matchingCampaign.id,
|
|
84
|
+
...payload
|
|
85
|
+
});
|
|
86
|
+
}
|
|
79
87
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
campaign_id: matchingCampaign.id,
|
|
83
|
-
...payload
|
|
84
|
-
});
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error(`Error updating stream ${offerId} (${payload.name}) in campaign ${matchingCampaign.id} (${matchingCampaign.name}):`, error);
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
}
|
package/package.json
CHANGED
|
@@ -94,16 +94,20 @@ async function createStreamForMatchingCampaigns(streamPayloads: { payload: any,
|
|
|
94
94
|
for (const { payload, offerId } of streamPayloads) {
|
|
95
95
|
const identicalStream = streams.find(stream => stream.name.includes(offerId));
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
try {
|
|
98
|
+
if (identicalStream) {
|
|
99
|
+
await keitaroApi.put(`streams/${identicalStream.id}`, {
|
|
100
|
+
campaign_id: matchingCampaign.id,
|
|
101
|
+
...payload
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
await keitaroApi.post('streams', {
|
|
105
|
+
campaign_id: matchingCampaign.id,
|
|
106
|
+
...payload
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(`Error updating stream ${offerId} (${payload.name}) in campaign ${matchingCampaign.id} (${matchingCampaign.name}):`, error);
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
}
|