@bytebrand/export-cars 1.26.2 → 1.26.3
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/services/images.service.js +7 -1
- package/dist/services/images.service.js.map +1 -1
- package/dist/services/user.service.d.ts +1 -0
- package/dist/services/user.service.js +8 -0
- package/dist/services/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/services/images.service.ts +13 -2
- package/src/services/user.service.ts +13 -0
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import { ConfigService } from './config.service';
|
|
|
13
13
|
import { UserService } from './user.service';
|
|
14
14
|
import { isNotEmptyArray } from '../utils';
|
|
15
15
|
import { Config } from '../configs/config';
|
|
16
|
-
import { ImageSize, ImageType } from '../enums';
|
|
16
|
+
import { ExportType, ImageSize, ImageType } from '../enums';
|
|
17
17
|
|
|
18
18
|
@Injectable()
|
|
19
19
|
export class ImagesService {
|
|
@@ -179,7 +179,18 @@ export class ImagesService {
|
|
|
179
179
|
const imageUrl = this.configService.config.marketingImageUrl;
|
|
180
180
|
|
|
181
181
|
const transformedImages = this.transformImagesArrayIntoObject(images);
|
|
182
|
-
|
|
182
|
+
// fbMarketingImageId is a hardcoded per-environment id in config.ts and has drifted from
|
|
183
|
+
// the real meta_aia config at least once (dev's id pointed at a stale, never-populated "fb"
|
|
184
|
+
// channel) — the FB feed resolves its config by channelCode instead of trusting that id.
|
|
185
|
+
const config = this.configService.config.exportType === ExportType.FB
|
|
186
|
+
? await this.userService.getMarketingImageConfigByChannelCode('meta_aia')
|
|
187
|
+
: await this.userService.getMarketingImageConfig(this.configService.config.marketingImageConfigId);
|
|
188
|
+
|
|
189
|
+
if (!config) {
|
|
190
|
+
console.log('getMarketingImages: no marketing image config found (channelCode meta_aia missing?)');
|
|
191
|
+
return ignoreDefImages ? [] : [...this.DEFAULT_IMAGES];
|
|
192
|
+
}
|
|
193
|
+
|
|
183
194
|
const marketingImageConfigs = config.marketingImages.map(i => ({ marketingImageCodes: i.imageCodes }));
|
|
184
195
|
|
|
185
196
|
const imageWithUrls: Partial<ImboImageResponseInterface & { url: string }>[] = [];
|
|
@@ -67,4 +67,17 @@ export class UserService {
|
|
|
67
67
|
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
|
+
|
|
71
|
+
// The per-environment fbMarketingImageId config.ts hardcodes doesn't reliably point at the
|
|
72
|
+
// meta_aia channel (dev's id 8 turned out to be a stale, never-populated "fb" channel) —
|
|
73
|
+
// resolve by channelCode instead of trusting a fixed id.
|
|
74
|
+
async getMarketingImageConfigByChannelCode(channelCode: string): Promise<MarketingImageConfigInterface | null> {
|
|
75
|
+
const configs = await this.getMarketingImageConfigs();
|
|
76
|
+
const match = configs.find(config => config.channelCode === channelCode);
|
|
77
|
+
if (!match) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return this.getMarketingImageConfig(match.id);
|
|
82
|
+
}
|
|
70
83
|
}
|