@zernio/node 0.2.33 → 0.2.35

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.
@@ -84,6 +84,98 @@ export type AccountWithFollowerStats = SocialAccount & {
84
84
  };
85
85
  };
86
86
 
87
+ export type Ad = {
88
+ _id?: string;
89
+ name?: string;
90
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
91
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
92
+ adType?: 'boost' | 'standalone';
93
+ goal?: 'engagement' | 'traffic' | 'awareness' | 'video_views';
94
+ /**
95
+ * True for ads synced from platform ad managers
96
+ */
97
+ isExternal?: boolean;
98
+ budget?: {
99
+ amount?: number;
100
+ type?: 'daily' | 'lifetime';
101
+ } | null;
102
+ metrics?: ((AdMetrics) | null);
103
+ platformAdId?: string;
104
+ platformAdAccountId?: string;
105
+ platformCampaignId?: string;
106
+ platformAdSetId?: string;
107
+ campaignName?: string;
108
+ adSetName?: string;
109
+ /**
110
+ * Platform-specific creative data
111
+ */
112
+ creative?: {
113
+ [key: string]: unknown;
114
+ };
115
+ targeting?: {
116
+ [key: string]: unknown;
117
+ };
118
+ schedule?: {
119
+ startDate?: string;
120
+ endDate?: string;
121
+ } | null;
122
+ rejectionReason?: string;
123
+ createdAt?: string;
124
+ updatedAt?: string;
125
+ };
126
+
127
+ export type platform = 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
128
+
129
+ export type status = 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
130
+
131
+ export type adType = 'boost' | 'standalone';
132
+
133
+ export type goal = 'engagement' | 'traffic' | 'awareness' | 'video_views';
134
+
135
+ export type type = 'daily' | 'lifetime';
136
+
137
+ export type AdCampaign = {
138
+ platformCampaignId?: string;
139
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
140
+ campaignName?: string;
141
+ /**
142
+ * Derived from child ad statuses
143
+ */
144
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
145
+ adCount?: number;
146
+ budget?: {
147
+ amount?: number;
148
+ type?: 'daily' | 'lifetime';
149
+ } | null;
150
+ metrics?: AdMetrics;
151
+ platformAdAccountId?: string;
152
+ accountId?: string;
153
+ profileId?: string;
154
+ earliestAd?: string;
155
+ latestAd?: string;
156
+ };
157
+
158
+ export type AdMetrics = {
159
+ spend?: number;
160
+ impressions?: number;
161
+ reach?: number;
162
+ clicks?: number;
163
+ /**
164
+ * Click-through rate (%)
165
+ */
166
+ ctr?: number;
167
+ /**
168
+ * Cost per click
169
+ */
170
+ cpc?: number;
171
+ /**
172
+ * Cost per 1000 impressions
173
+ */
174
+ cpm?: number;
175
+ engagement?: number;
176
+ lastSyncedAt?: string;
177
+ };
178
+
87
179
  export type AnalyticsListResponse = {
88
180
  overview?: AnalyticsOverview;
89
181
  posts?: Array<{
@@ -194,7 +286,7 @@ export type AnalyticsSinglePostResponse = {
194
286
  /**
195
287
  * Overall post status. "partial" when some platforms published and others failed.
196
288
  */
197
- export type status = 'published' | 'failed' | 'partial';
289
+ export type status2 = 'published' | 'failed' | 'partial';
198
290
 
199
291
  /**
200
292
  * Overall sync state across all platforms
@@ -343,7 +435,7 @@ export type ConnectionLog = {
343
435
  createdAt?: string;
344
436
  };
345
437
 
346
- export type platform = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
438
+ export type platform2 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
347
439
 
348
440
  /**
349
441
  * Type of connection event: connect_success, connect_failed, disconnect, reconnect_success, reconnect_failed
@@ -519,7 +611,7 @@ export type GoogleBusinessPlatformData = {
519
611
  /**
520
612
  * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL
521
613
  */
522
- export type type = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
614
+ export type type2 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
523
615
 
524
616
  export type HashtagCheckResponse = {
525
617
  hashtags?: Array<HashtagInfo>;
@@ -531,7 +623,7 @@ export type HashtagInfo = {
531
623
  postCount?: number;
532
624
  };
533
625
 
534
- export type status2 = 'safe' | 'banned' | 'restricted' | 'unknown';
626
+ export type status3 = 'safe' | 'banned' | 'restricted' | 'unknown';
535
627
 
536
628
  export type InstagramAccountInsightsResponse = {
537
629
  success?: boolean;
@@ -840,7 +932,7 @@ export type MediaItem = {
840
932
  tiktokProcessed?: boolean;
841
933
  };
842
934
 
843
- export type type2 = 'image' | 'video' | 'gif' | 'document';
935
+ export type type3 = 'image' | 'video' | 'gif' | 'document';
844
936
 
845
937
  export type MediaUploadResponse = {
846
938
  files?: Array<UploadedFile>;
@@ -918,7 +1010,7 @@ export type PlatformAnalytics = {
918
1010
  errorMessage?: (string) | null;
919
1011
  };
920
1012
 
921
- export type status3 = 'published' | 'failed';
1013
+ export type status4 = 'published' | 'failed';
922
1014
 
923
1015
  /**
924
1016
  * Sync state of analytics for this platform
@@ -1028,7 +1120,7 @@ export type Post = {
1028
1120
  updatedAt?: string;
1029
1121
  };
1030
1122
 
1031
- export type status4 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1123
+ export type status5 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1032
1124
 
1033
1125
  export type visibility = 'public' | 'private' | 'unlisted';
1034
1126
 
@@ -1144,7 +1236,7 @@ export type PostLog = {
1144
1236
  */
1145
1237
  export type action = 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled';
1146
1238
 
1147
- export type status5 = 'success' | 'failed' | 'pending' | 'skipped';
1239
+ export type status6 = 'success' | 'failed' | 'pending' | 'skipped';
1148
1240
 
1149
1241
  export type PostRetryResponse = {
1150
1242
  message?: string;
@@ -1620,7 +1712,7 @@ export type UploadedFile = {
1620
1712
  mimeType?: string;
1621
1713
  };
1622
1714
 
1623
- export type type3 = 'image' | 'video' | 'document';
1715
+ export type type4 = 'image' | 'video' | 'document';
1624
1716
 
1625
1717
  export type UploadTokenResponse = {
1626
1718
  token?: string;
@@ -1629,7 +1721,7 @@ export type UploadTokenResponse = {
1629
1721
  status?: 'pending' | 'completed' | 'expired';
1630
1722
  };
1631
1723
 
1632
- export type status6 = 'pending' | 'completed' | 'expired';
1724
+ export type status7 = 'pending' | 'completed' | 'expired';
1633
1725
 
1634
1726
  export type UploadTokenStatusResponse = {
1635
1727
  token?: string;
@@ -1768,7 +1860,7 @@ export type WebhookLog = {
1768
1860
 
1769
1861
  export type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'comment.received' | 'webhook.test';
1770
1862
 
1771
- export type status7 = 'success' | 'failed';
1863
+ export type status8 = 'success' | 'failed';
1772
1864
 
1773
1865
  /**
1774
1866
  * Webhook payload for account connected events
@@ -1906,7 +1998,7 @@ export type WebhookPayloadComment = {
1906
1998
 
1907
1999
  export type event4 = 'comment.received';
1908
2000
 
1909
- export type platform2 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2001
+ export type platform3 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
1910
2002
 
1911
2003
  /**
1912
2004
  * Webhook payload for message received events
@@ -2026,11 +2118,11 @@ export type WebhookPayloadMessage = {
2026
2118
 
2027
2119
  export type event5 = 'message.received';
2028
2120
 
2029
- export type platform3 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
2121
+ export type platform4 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
2030
2122
 
2031
2123
  export type direction = 'incoming' | 'outgoing';
2032
2124
 
2033
- export type status8 = 'active' | 'archived';
2125
+ export type status9 = 'active' | 'archived';
2034
2126
 
2035
2127
  /**
2036
2128
  * Webhook payload for post events
@@ -2165,7 +2257,7 @@ export type WhatsAppTemplateButton = {
2165
2257
  navigate_screen?: string;
2166
2258
  };
2167
2259
 
2168
- export type type4 = 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'flow' | 'mpm' | 'catalog';
2260
+ export type type5 = 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'flow' | 'mpm' | 'catalog';
2169
2261
 
2170
2262
  /**
2171
2263
  * Required when type is otp
@@ -10992,4 +11084,565 @@ export type ListCommentAutomationLogsResponse = ({
10992
11084
 
10993
11085
  export type ListCommentAutomationLogsError = ({
10994
11086
  error?: string;
11087
+ });
11088
+
11089
+ export type ListAdsData = {
11090
+ query?: {
11091
+ /**
11092
+ * Social account ID
11093
+ */
11094
+ accountId?: string;
11095
+ /**
11096
+ * Platform campaign ID (filter ads within a campaign)
11097
+ */
11098
+ campaignId?: string;
11099
+ limit?: number;
11100
+ /**
11101
+ * Page number (1-based)
11102
+ */
11103
+ page?: number;
11104
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
11105
+ /**
11106
+ * Profile ID
11107
+ */
11108
+ profileId?: string;
11109
+ /**
11110
+ * zernio = Zernio-created only, all = include external ads
11111
+ */
11112
+ source?: 'zernio' | 'all';
11113
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
11114
+ };
11115
+ };
11116
+
11117
+ export type ListAdsResponse = ({
11118
+ ads?: Array<Ad>;
11119
+ pagination?: Pagination;
11120
+ });
11121
+
11122
+ export type ListAdsError = ({
11123
+ error?: string;
11124
+ } | unknown);
11125
+
11126
+ export type ListAdCampaignsData = {
11127
+ query?: {
11128
+ /**
11129
+ * Social account ID
11130
+ */
11131
+ accountId?: string;
11132
+ /**
11133
+ * Platform ad account ID (e.g. act_123 for Meta)
11134
+ */
11135
+ adAccountId?: string;
11136
+ limit?: number;
11137
+ /**
11138
+ * Page number (1-based)
11139
+ */
11140
+ page?: number;
11141
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
11142
+ /**
11143
+ * Profile ID
11144
+ */
11145
+ profileId?: string;
11146
+ source?: 'zernio' | 'all';
11147
+ /**
11148
+ * Filter by derived campaign status (post-aggregation)
11149
+ */
11150
+ status?: 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
11151
+ };
11152
+ };
11153
+
11154
+ export type ListAdCampaignsResponse = ({
11155
+ campaigns?: Array<AdCampaign>;
11156
+ pagination?: Pagination;
11157
+ });
11158
+
11159
+ export type ListAdCampaignsError = ({
11160
+ error?: string;
11161
+ } | unknown);
11162
+
11163
+ export type UpdateAdCampaignStatusData = {
11164
+ body: {
11165
+ status: 'active' | 'paused';
11166
+ platform: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter';
11167
+ };
11168
+ path: {
11169
+ /**
11170
+ * Platform campaign ID
11171
+ */
11172
+ campaignId: string;
11173
+ };
11174
+ };
11175
+
11176
+ export type UpdateAdCampaignStatusResponse = ({
11177
+ /**
11178
+ * Number of ads updated
11179
+ */
11180
+ updated?: number;
11181
+ /**
11182
+ * Number of ads skipped
11183
+ */
11184
+ skipped?: number;
11185
+ skippedReasons?: Array<(string)>;
11186
+ });
11187
+
11188
+ export type UpdateAdCampaignStatusError = (unknown | {
11189
+ error?: string;
11190
+ });
11191
+
11192
+ export type GetAdData = {
11193
+ path: {
11194
+ adId: string;
11195
+ };
11196
+ };
11197
+
11198
+ export type GetAdResponse = ({
11199
+ ad?: Ad;
11200
+ });
11201
+
11202
+ export type GetAdError = ({
11203
+ error?: string;
11204
+ });
11205
+
11206
+ export type UpdateAdData = {
11207
+ body: {
11208
+ status?: 'active' | 'paused';
11209
+ budget?: {
11210
+ /**
11211
+ * Minimum varies by platform: TikTok=$20, Pinterest=$5, others=$1
11212
+ */
11213
+ amount?: number;
11214
+ type?: 'daily' | 'lifetime';
11215
+ };
11216
+ /**
11217
+ * Meta-only. Targeting updates for other platforms are not supported after creation.
11218
+ */
11219
+ targeting?: {
11220
+ ageMin?: number;
11221
+ ageMax?: number;
11222
+ countries?: Array<(string)>;
11223
+ interests?: Array<(string)>;
11224
+ };
11225
+ name?: string;
11226
+ };
11227
+ path: {
11228
+ adId: string;
11229
+ };
11230
+ };
11231
+
11232
+ export type UpdateAdResponse = ({
11233
+ ad?: Ad;
11234
+ message?: string;
11235
+ });
11236
+
11237
+ export type UpdateAdError = (unknown | {
11238
+ error?: string;
11239
+ });
11240
+
11241
+ export type DeleteAdData = {
11242
+ path: {
11243
+ adId: string;
11244
+ };
11245
+ };
11246
+
11247
+ export type DeleteAdResponse = ({
11248
+ message?: string;
11249
+ });
11250
+
11251
+ export type DeleteAdError = ({
11252
+ error?: string;
11253
+ });
11254
+
11255
+ export type GetAdAnalyticsData = {
11256
+ path: {
11257
+ adId: string;
11258
+ };
11259
+ query?: {
11260
+ /**
11261
+ * Comma-separated breakdown dimensions. Meta: age, gender, country, publisher_platform, device_platform, region. TikTok: gender, age, country_code, platform, ac, language.
11262
+ */
11263
+ breakdowns?: string;
11264
+ };
11265
+ };
11266
+
11267
+ export type GetAdAnalyticsResponse = ({
11268
+ ad?: {
11269
+ id?: string;
11270
+ name?: string;
11271
+ platform?: string;
11272
+ status?: string;
11273
+ };
11274
+ analytics?: {
11275
+ summary?: AdMetrics;
11276
+ daily?: Array<(AdMetrics & {
11277
+ date?: string;
11278
+ })>;
11279
+ breakdowns?: {
11280
+ [key: string]: Array<{
11281
+ [key: string]: unknown;
11282
+ }>;
11283
+ };
11284
+ };
11285
+ });
11286
+
11287
+ export type GetAdAnalyticsError = ({
11288
+ error?: string;
11289
+ } | unknown);
11290
+
11291
+ export type ListAdAccountsData = {
11292
+ query: {
11293
+ /**
11294
+ * Social account ID
11295
+ */
11296
+ accountId: string;
11297
+ };
11298
+ };
11299
+
11300
+ export type ListAdAccountsResponse = ({
11301
+ accounts?: Array<{
11302
+ /**
11303
+ * Platform ad account ID (e.g. act_123)
11304
+ */
11305
+ id?: string;
11306
+ name?: string;
11307
+ currency?: string;
11308
+ status?: string;
11309
+ }>;
11310
+ });
11311
+
11312
+ export type ListAdAccountsError = ({
11313
+ error?: string;
11314
+ } | unknown);
11315
+
11316
+ export type BoostPostData = {
11317
+ body: {
11318
+ /**
11319
+ * Zernio post ID (provide this or platformPostId)
11320
+ */
11321
+ postId?: string;
11322
+ /**
11323
+ * Platform post ID (alternative to postId)
11324
+ */
11325
+ platformPostId?: string;
11326
+ /**
11327
+ * Social account ID
11328
+ */
11329
+ accountId: string;
11330
+ /**
11331
+ * Platform ad account ID
11332
+ */
11333
+ adAccountId: string;
11334
+ name: string;
11335
+ goal: 'engagement' | 'traffic' | 'awareness' | 'video_views';
11336
+ budget: {
11337
+ /**
11338
+ * Minimum varies: TikTok=$20, Pinterest=$5, others=$1
11339
+ */
11340
+ amount: number;
11341
+ type: 'daily' | 'lifetime';
11342
+ };
11343
+ currency?: string;
11344
+ schedule?: {
11345
+ startDate?: string;
11346
+ /**
11347
+ * Required for lifetime budgets
11348
+ */
11349
+ endDate?: string;
11350
+ };
11351
+ targeting?: {
11352
+ ageMin?: number;
11353
+ ageMax?: number;
11354
+ countries?: Array<(string)>;
11355
+ interests?: Array<(string)>;
11356
+ };
11357
+ /**
11358
+ * Max bid cap (Meta only)
11359
+ */
11360
+ bidAmount?: number;
11361
+ /**
11362
+ * Meta only. Tracking specs (pixel, URL tags).
11363
+ */
11364
+ tracking?: {
11365
+ pixelId?: string;
11366
+ urlTags?: string;
11367
+ };
11368
+ /**
11369
+ * Meta only. Required for housing, employment, credit, or political ads.
11370
+ */
11371
+ specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS')>;
11372
+ };
11373
+ };
11374
+
11375
+ export type BoostPostResponse = ({
11376
+ ad?: Ad;
11377
+ message?: string;
11378
+ });
11379
+
11380
+ export type BoostPostError = (unknown | {
11381
+ error?: string;
11382
+ });
11383
+
11384
+ export type CreateStandaloneAdData = {
11385
+ body: {
11386
+ accountId: string;
11387
+ adAccountId: string;
11388
+ name: string;
11389
+ goal: 'engagement' | 'traffic' | 'awareness' | 'video_views';
11390
+ budgetAmount: number;
11391
+ budgetType: 'daily' | 'lifetime';
11392
+ currency?: string;
11393
+ /**
11394
+ * Required for most platforms. Max: Meta=255, Google=30, Pinterest=100
11395
+ */
11396
+ headline?: string;
11397
+ /**
11398
+ * Google Display only
11399
+ */
11400
+ longHeadline?: string;
11401
+ /**
11402
+ * Max: Google=90, Pinterest=500
11403
+ */
11404
+ body: string;
11405
+ /**
11406
+ * Meta only
11407
+ */
11408
+ callToAction?: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
11409
+ linkUrl?: string;
11410
+ /**
11411
+ * Image URL (or video URL for TikTok). Not required for Google Search campaigns.
11412
+ */
11413
+ imageUrl?: string;
11414
+ /**
11415
+ * Google Display only
11416
+ */
11417
+ businessName?: string;
11418
+ /**
11419
+ * Pinterest only. Board ID (auto-creates if not provided).
11420
+ */
11421
+ boardId?: string;
11422
+ countries?: Array<(string)>;
11423
+ ageMin?: number;
11424
+ ageMax?: number;
11425
+ interests?: Array<(string)>;
11426
+ /**
11427
+ * Required for lifetime budgets
11428
+ */
11429
+ endDate?: string;
11430
+ /**
11431
+ * Custom audience ID for targeting
11432
+ */
11433
+ audienceId?: string;
11434
+ /**
11435
+ * Google only
11436
+ */
11437
+ campaignType?: 'display' | 'search';
11438
+ /**
11439
+ * Google Search only
11440
+ */
11441
+ keywords?: Array<(string)>;
11442
+ /**
11443
+ * Google Search RSA only. Extra headlines.
11444
+ */
11445
+ additionalHeadlines?: Array<(string)>;
11446
+ /**
11447
+ * Google Search RSA only. Extra descriptions.
11448
+ */
11449
+ additionalDescriptions?: Array<(string)>;
11450
+ };
11451
+ };
11452
+
11453
+ export type CreateStandaloneAdResponse = ({
11454
+ ad?: Ad;
11455
+ message?: string;
11456
+ });
11457
+
11458
+ export type CreateStandaloneAdError = (unknown | {
11459
+ error?: string;
11460
+ });
11461
+
11462
+ export type SyncExternalAdsResponse = ({
11463
+ success?: boolean;
11464
+ /**
11465
+ * New ads imported
11466
+ */
11467
+ synced?: number;
11468
+ /**
11469
+ * Already-synced ads updated
11470
+ */
11471
+ skipped?: number;
11472
+ /**
11473
+ * Failed ad imports
11474
+ */
11475
+ errors?: number;
11476
+ });
11477
+
11478
+ export type SyncExternalAdsError = ({
11479
+ error?: string;
11480
+ } | unknown);
11481
+
11482
+ export type SearchAdInterestsData = {
11483
+ query: {
11484
+ /**
11485
+ * Social account ID
11486
+ */
11487
+ accountId: string;
11488
+ /**
11489
+ * Search query
11490
+ */
11491
+ q: string;
11492
+ };
11493
+ };
11494
+
11495
+ export type SearchAdInterestsResponse = ({
11496
+ interests?: Array<{
11497
+ id?: string;
11498
+ name?: string;
11499
+ category?: string;
11500
+ }>;
11501
+ });
11502
+
11503
+ export type SearchAdInterestsError = ({
11504
+ error?: string;
11505
+ } | unknown);
11506
+
11507
+ export type ListAdAudiencesData = {
11508
+ query: {
11509
+ /**
11510
+ * Social account ID
11511
+ */
11512
+ accountId: string;
11513
+ /**
11514
+ * Platform ad account ID
11515
+ */
11516
+ adAccountId: string;
11517
+ platform?: 'facebook' | 'instagram' | 'googleads' | 'tiktok' | 'pinterest';
11518
+ };
11519
+ };
11520
+
11521
+ export type ListAdAudiencesResponse = ({
11522
+ audiences?: Array<{
11523
+ id?: (string) | null;
11524
+ platformAudienceId?: string;
11525
+ name?: string;
11526
+ description?: string;
11527
+ type?: 'customer_list' | 'website' | 'lookalike';
11528
+ platform?: string;
11529
+ size?: number;
11530
+ status?: string;
11531
+ }>;
11532
+ });
11533
+
11534
+ export type ListAdAudiencesError = ({
11535
+ error?: string;
11536
+ });
11537
+
11538
+ export type CreateAdAudienceData = {
11539
+ body: {
11540
+ accountId: string;
11541
+ /**
11542
+ * Must start with act_
11543
+ */
11544
+ adAccountId: string;
11545
+ name: string;
11546
+ description?: string;
11547
+ type: 'customer_list' | 'website' | 'lookalike';
11548
+ /**
11549
+ * Required for website audiences
11550
+ */
11551
+ pixelId?: string;
11552
+ /**
11553
+ * Required for website audiences
11554
+ */
11555
+ retentionDays?: number;
11556
+ /**
11557
+ * Required for lookalike audiences
11558
+ */
11559
+ sourceAudienceId?: string;
11560
+ /**
11561
+ * 2-letter code, required for lookalike audiences
11562
+ */
11563
+ country?: string;
11564
+ /**
11565
+ * Required for lookalike audiences
11566
+ */
11567
+ ratio?: number;
11568
+ /**
11569
+ * Pixel event rule for website audiences (optional)
11570
+ */
11571
+ rule?: {
11572
+ [key: string]: unknown;
11573
+ };
11574
+ /**
11575
+ * Data source declaration for GDPR compliance (customer_list only)
11576
+ */
11577
+ customerFileSource?: string;
11578
+ };
11579
+ };
11580
+
11581
+ export type CreateAdAudienceResponse = ({
11582
+ audience?: {
11583
+ [key: string]: unknown;
11584
+ };
11585
+ message?: string;
11586
+ });
11587
+
11588
+ export type CreateAdAudienceError = (unknown | {
11589
+ error?: string;
11590
+ });
11591
+
11592
+ export type GetAdAudienceData = {
11593
+ path: {
11594
+ audienceId: string;
11595
+ };
11596
+ };
11597
+
11598
+ export type GetAdAudienceResponse = ({
11599
+ audience?: {
11600
+ [key: string]: unknown;
11601
+ };
11602
+ /**
11603
+ * Fresh data from Meta API
11604
+ */
11605
+ metaData?: {
11606
+ [key: string]: unknown;
11607
+ } | null;
11608
+ });
11609
+
11610
+ export type GetAdAudienceError = ({
11611
+ error?: string;
11612
+ } | unknown);
11613
+
11614
+ export type DeleteAdAudienceData = {
11615
+ path: {
11616
+ audienceId: string;
11617
+ };
11618
+ };
11619
+
11620
+ export type DeleteAdAudienceResponse = ({
11621
+ message?: string;
11622
+ });
11623
+
11624
+ export type DeleteAdAudienceError = ({
11625
+ error?: string;
11626
+ } | unknown);
11627
+
11628
+ export type AddUsersToAdAudienceData = {
11629
+ body: {
11630
+ users: Array<{
11631
+ email?: string;
11632
+ phone?: string;
11633
+ }>;
11634
+ };
11635
+ path: {
11636
+ audienceId: string;
11637
+ };
11638
+ };
11639
+
11640
+ export type AddUsersToAdAudienceResponse = ({
11641
+ message?: string;
11642
+ numReceived?: number;
11643
+ numInvalid?: number;
11644
+ });
11645
+
11646
+ export type AddUsersToAdAudienceError = (unknown | {
11647
+ error?: string;
10995
11648
  });