Deep-audit + build-out across all products to fully-usable state; all typecheck clean. - gitgram-web (99): wire Store feature to real endpoints, close 9 gaps - gitgram-backend (100): close 8 flow gaps, document infra-provisioning items - gitgram-mobile (90): fix API base-URL/path mismatch (404s) + copy proximity components into components/proximity wired to real screens; 15 gaps, +react-native-svg - aitm-core (95): wire natural-language CLI flow end-to-end; 11 gaps - aitm-api (97): fix teams metadata runtime bug; copy a2a-js server/client/grpc into src/a2a and wire A2A route; crates.io package search; 8 gaps - aitm-mcp (100): fix A2A client/server card mismatch; 9 gaps - aitm-website (95): build missing docs routes; 9 gaps Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import api from './api'
|
|
|
|
const BASE = '/v1/advertisements/campaigns'
|
|
|
|
export const adCampaignService = {
|
|
createCampaign: async (data: {
|
|
name: string
|
|
description?: string
|
|
type: 'post' | 'reel' | 'story' | 'banner' | 'video'
|
|
budget: number
|
|
dailyBudget?: number
|
|
startDate?: string
|
|
endDate?: string
|
|
billingType?: 'cpc' | 'cpm' | 'cpa'
|
|
targetAudience?: { location?: string; interests?: string[]; ageRange?: { min: number; max: number } }
|
|
}) => {
|
|
const response = await api.post(BASE, data)
|
|
return response.data
|
|
},
|
|
|
|
getCampaigns: async (status?: string) => {
|
|
const response = await api.get(BASE, {
|
|
params: status ? { status } : {},
|
|
})
|
|
return response.data
|
|
},
|
|
|
|
getCampaign: async (campaignId: string) => {
|
|
const response = await api.get(`${BASE}/${campaignId}`)
|
|
return response.data
|
|
},
|
|
|
|
updateCampaign: async (campaignId: string, data: Record<string, unknown>) => {
|
|
const response = await api.put(`${BASE}/${campaignId}`, data)
|
|
return response.data
|
|
},
|
|
|
|
deleteCampaign: async (campaignId: string) => {
|
|
const response = await api.delete(`${BASE}/${campaignId}`)
|
|
return response.data
|
|
},
|
|
|
|
pauseCampaign: async (campaignId: string) => {
|
|
const response = await api.post(`${BASE}/${campaignId}/pause`)
|
|
return response.data
|
|
},
|
|
|
|
resumeCampaign: async (campaignId: string) => {
|
|
const response = await api.post(`${BASE}/${campaignId}/resume`)
|
|
return response.data
|
|
},
|
|
|
|
fundCampaign: async (campaignId: string, amount: number, paymentMethodId?: string) => {
|
|
const response = await api.post(`${BASE}/${campaignId}/fund`, {
|
|
amount,
|
|
paymentMethodId,
|
|
})
|
|
return response.data
|
|
},
|
|
|
|
getCampaignAnalytics: async (campaignId: string) => {
|
|
const response = await api.get(`${BASE}/${campaignId}/analytics`)
|
|
return response.data
|
|
},
|
|
}
|