Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryansinha16 committed Nov 18, 2024
1 parent bae7869 commit cea5684
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
12 changes: 4 additions & 8 deletions packages/channel-google/src/channel-google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { logger } from '@repo/logger';
import { type Request as ExpressRequest, type Response as ExpressResponse } from 'express';
import {
type AdAccountIntegration,
type AdWithAdAccount,
authEndpoint,
type ChannelAd,
type ChannelCreative,
Expand Down Expand Up @@ -268,6 +267,8 @@ class Google implements ChannelInterface {
ad_group_ad.ad.id,
ad_group_ad.ad.name,
ad_group_ad.ad.video_responsive_ad.call_to_actions,
ad_group_ad.ad.video_responsive_ad.videos,
ad_group_ad.ad.video_responsive_ad.descriptions,
ad_group.id,
ad_group.name,
Expand Down Expand Up @@ -354,9 +355,9 @@ class Google implements ChannelInterface {
externalId: c.asset.id,
adAccountId: dbAccount.id,
name: c.asset.resourceName,
body: el.adGroupAd.ad.videoResponsiveAd?.descriptions[0].text,
body: el.adGroupAd.ad.videoResponsiveAd?.descriptions?.[0].text,
title: el.video.title,
callToActionType: el.adGroupAd.ad.videoResponsiveAd?.callToActions[0].text,
callToActionType: el.adGroupAd.ad.videoResponsiveAd?.callToActions?.[0].text,
imageUrl: c.asset.youtubeVideoAsset?.youtubeVideoId,
}));

Expand All @@ -373,7 +374,6 @@ class Google implements ChannelInterface {
ads,
new Map<string, string>(),
creatives,
new Map<string, string>(),
[],
);
} catch (err) {
Expand Down Expand Up @@ -531,10 +531,6 @@ class Google implements ChannelInterface {
return Promise.reject(new AError('Not Implemented'));
}

async saveCreatives(_integration: Integration, _groupByAdAccount: Map<string, AdWithAdAccount[]>): Promise<void> {
return Promise.reject(new AError('Not Implemented'));
}

async processReport(
_adAccount: AdAccountIntegration,
_taskId: string,
Expand Down
36 changes: 14 additions & 22 deletions packages/channel-google/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,25 @@ const videoSchema = z.object({
});

const videoResponsiveAdSchema = z.object({
headlines: z.array(
z.object({
text: z.string(),
}),
),
longHeadlines: z.array(
z.object({
text: z.string(),
}),
),
descriptions: z.array(
z.object({
text: z.string(),
}),
),
callToActions: z.array(
z.object({
text: z.string(),
}),
),
descriptions: z
.array(
z.object({
text: z.string(),
}),
)
.optional(),
callToActions: z
.array(
z.object({
text: z.string(),
}),
)
.optional(),
videos: z.array(
z.object({
asset: z.string(),
}),
),
breadcrumb1: z.string().optional(), // Optional field
breadcrumb2: z.string().optional(), // Potentially optional for future cases
});

const youtubeAdSchema = z.object({
Expand Down

0 comments on commit cea5684

Please sign in to comment.