@adport/provider-x 0.7.0 → 0.9.0

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Account, AdProvider, StandardActions, WriteOperation, WriteGuard, WritePreview, WriteResult, NormalizedQuery, Report, AnyToolDefinition, CredentialStore, ProviderModule } from '@adport/core';
2
+ import { Account, WritePreview, WriteOperation, WriteGuard, Creative, MediaResolver, WriteResult, AdProvider, StandardActions, NormalizedQuery, Report, AnyToolDefinition, CredentialStore, ProviderModule } from '@adport/core';
3
3
 
4
4
  declare const X_ADS_API_BASE = "https://ads-api.x.com/12/";
5
5
  interface XAdsCredentials {
@@ -9,13 +9,18 @@ interface XAdsCredentials {
9
9
  accessTokenSecret: string;
10
10
  }
11
11
  type XParams = Record<string, string | number | boolean>;
12
- type XMethod = 'GET' | 'POST' | 'PUT';
12
+ type XMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
13
13
  declare class XAdsClient {
14
14
  private readonly fetchImpl;
15
15
  private readonly signer;
16
16
  private readonly token;
17
+ private readonly receiptKey;
17
18
  constructor(credentials: XAdsCredentials, fetchImpl?: typeof fetch);
18
- request<T>(method: XMethod, path: string, schema: z.ZodType<T>, params?: XParams): Promise<T>;
19
+ request<T>(method: XMethod, path: string, schema: z.ZodType<T>, params?: XParams, jsonBody?: unknown): Promise<T>;
20
+ mediaRequest<T>(method: 'GET' | 'POST', path: string, schema: z.ZodType<T>, params?: XParams, jsonBody?: unknown): Promise<T>;
21
+ resourceReceipt(value: Record<string, unknown>): string;
22
+ verifyResourceReceipt(receipt: string): unknown;
23
+ private send;
19
24
  list<T extends {
20
25
  id: string;
21
26
  }>(path: string, item: z.ZodType<T>, params?: XParams): Promise<T[]>;
@@ -76,8 +81,9 @@ declare class XAdsEntities {
76
81
  deleted: boolean;
77
82
  }>;
78
83
  listLineItems(accountId: string): Promise<{
84
+ [x: string]: unknown;
79
85
  id: string;
80
- name: string;
86
+ name: string | null;
81
87
  campaign_id: string;
82
88
  currency: string;
83
89
  entity_status: string;
@@ -85,7 +91,37 @@ declare class XAdsEntities {
85
91
  placements: string[];
86
92
  product_type: string;
87
93
  objective: string;
94
+ bid_strategy?: string | undefined;
95
+ bid_amount_local_micro?: number | null | undefined;
96
+ daily_budget_amount_local_micro?: number | null | undefined;
97
+ total_budget_amount_local_micro?: number | null | undefined;
98
+ start_time?: string | null | undefined;
99
+ end_time?: string | null | undefined;
88
100
  }[]>;
101
+ getLineItem(accountId: string, resourceId: string): Promise<{
102
+ [x: string]: unknown;
103
+ id: string;
104
+ name: string | null;
105
+ campaign_id: string;
106
+ currency: string;
107
+ entity_status: string;
108
+ deleted: boolean;
109
+ placements: string[];
110
+ product_type: string;
111
+ objective: string;
112
+ bid_strategy?: string | undefined;
113
+ bid_amount_local_micro?: number | null | undefined;
114
+ daily_budget_amount_local_micro?: number | null | undefined;
115
+ total_budget_amount_local_micro?: number | null | undefined;
116
+ start_time?: string | null | undefined;
117
+ end_time?: string | null | undefined;
118
+ }>;
119
+ lineItemPlacements(): Promise<{
120
+ data: {
121
+ product_type: string;
122
+ placements: string[][];
123
+ }[];
124
+ }>;
89
125
  listPromotedTweets(accountId: string): Promise<{
90
126
  id: string;
91
127
  line_item_id: string;
@@ -120,11 +156,12 @@ declare const statsSchema: z.ZodObject<{
120
156
  billed_charge_local_micro: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNullable<z.ZodNumber>>>>;
121
157
  impressions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNullable<z.ZodNumber>>>>;
122
158
  url_clicks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNullable<z.ZodNumber>>>>;
123
- }, z.core.$strip>;
159
+ }, z.core.$catchall<z.ZodJSONSchema>>;
124
160
  }, z.core.$strip>>;
125
161
  }, z.core.$strip>>;
126
162
  request: z.ZodObject<{
127
163
  params: z.ZodObject<{
164
+ account_id: z.ZodOptional<z.ZodString>;
128
165
  start_time: z.ZodString;
129
166
  end_time: z.ZodString;
130
167
  entity: z.ZodString;
@@ -149,16 +186,2473 @@ declare class XAdsAnalytics {
149
186
  private download;
150
187
  }
151
188
 
189
+ declare const optionsInput: z.ZodObject<{
190
+ account_id: z.ZodString;
191
+ dimension: z.ZodEnum<{
192
+ app_store_categories: "app_store_categories";
193
+ conversations: "conversations";
194
+ devices: "devices";
195
+ events: "events";
196
+ interests: "interests";
197
+ languages: "languages";
198
+ locations: "locations";
199
+ network_operators: "network_operators";
200
+ platform_versions: "platform_versions";
201
+ platforms: "platforms";
202
+ tv_markets: "tv_markets";
203
+ tv_shows: "tv_shows";
204
+ }>;
205
+ count: z.ZodDefault<z.ZodNumber>;
206
+ cursor: z.ZodOptional<z.ZodString>;
207
+ q: z.ZodOptional<z.ZodString>;
208
+ os_type: z.ZodOptional<z.ZodEnum<{
209
+ ANDROID: "ANDROID";
210
+ IOS: "IOS";
211
+ }>>;
212
+ country_code: z.ZodOptional<z.ZodString>;
213
+ country_codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
+ location_type: z.ZodOptional<z.ZodEnum<{
215
+ COUNTRIES: "COUNTRIES";
216
+ REGIONS: "REGIONS";
217
+ METROS: "METROS";
218
+ CITIES: "CITIES";
219
+ POSTAL_CODES: "POSTAL_CODES";
220
+ }>>;
221
+ conversation_type: z.ZodOptional<z.ZodString>;
222
+ event_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
223
+ CONFERENCE: "CONFERENCE";
224
+ HOLIDAY: "HOLIDAY";
225
+ MUSIC_AND_ENTERTAINMENT: "MUSIC_AND_ENTERTAINMENT";
226
+ OTHER: "OTHER";
227
+ POLITICS: "POLITICS";
228
+ RECURRING: "RECURRING";
229
+ SPORTS: "SPORTS";
230
+ }>>>;
231
+ start_time: z.ZodOptional<z.ZodISODateTime>;
232
+ end_time: z.ZodOptional<z.ZodISODateTime>;
233
+ locale: z.ZodOptional<z.ZodString>;
234
+ lang: z.ZodOptional<z.ZodString>;
235
+ }, z.core.$strip>;
236
+ declare const criteriaInput: z.ZodObject<{
237
+ account_id: z.ZodString;
238
+ line_item_ids: z.ZodArray<z.ZodString>;
239
+ count: z.ZodDefault<z.ZodNumber>;
240
+ cursor: z.ZodOptional<z.ZodString>;
241
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
242
+ }, z.core.$strip>;
243
+
244
+ interface XWritePlan extends Omit<WritePreview, 'serverValidated'> {
245
+ execute: () => Promise<string[]>;
246
+ }
247
+
248
+ declare class XTargetingService {
249
+ private readonly entities;
250
+ constructor(entities: XAdsEntities);
251
+ options(value: z.input<typeof optionsInput>): Promise<{
252
+ warning?: string | undefined;
253
+ next_cursor?: string | undefined;
254
+ items: Record<string, unknown>[];
255
+ truncated: boolean;
256
+ }>;
257
+ criteria(value: z.input<typeof criteriaInput>): Promise<{
258
+ next_cursor?: string | undefined;
259
+ items: {
260
+ [x: string]: unknown;
261
+ id: string;
262
+ line_item_id: string;
263
+ targeting_type: string;
264
+ targeting_value: string;
265
+ deleted: boolean;
266
+ operator_type?: string | undefined;
267
+ }[];
268
+ truncated: boolean;
269
+ }>;
270
+ owned(account: string, resource: string): Promise<{
271
+ [x: string]: unknown;
272
+ id: string;
273
+ line_item_id: string;
274
+ targeting_type: string;
275
+ targeting_value: string;
276
+ deleted: boolean;
277
+ operator_type?: string | undefined;
278
+ }>;
279
+ private current;
280
+ private available;
281
+ private source;
282
+ private finalState;
283
+ private batch;
284
+ plan(op: WriteOperation, _guard: WriteGuard): Promise<XWritePlan>;
285
+ }
286
+
287
+ declare const draftList: z.ZodObject<{
288
+ account_id: z.ZodString;
289
+ count: z.ZodDefault<z.ZodNumber>;
290
+ cursor: z.ZodOptional<z.ZodString>;
291
+ user_id: z.ZodOptional<z.ZodString>;
292
+ include_media: z.ZodDefault<z.ZodBoolean>;
293
+ }, z.core.$strip>;
294
+ declare const libraryList: z.ZodObject<{
295
+ account_id: z.ZodString;
296
+ count: z.ZodDefault<z.ZodNumber>;
297
+ cursor: z.ZodOptional<z.ZodString>;
298
+ media_type: z.ZodOptional<z.ZodEnum<{
299
+ IMAGE: "IMAGE";
300
+ GIF: "GIF";
301
+ VIDEO: "VIDEO";
302
+ }>>;
303
+ q: z.ZodOptional<z.ZodString>;
304
+ }, z.core.$strip>;
305
+
306
+ declare const librarySchema: z.ZodObject<{
307
+ media_key: z.ZodString;
308
+ media_type: z.ZodEnum<{
309
+ IMAGE: "IMAGE";
310
+ GIF: "GIF";
311
+ VIDEO: "VIDEO";
312
+ }>;
313
+ media_status: z.ZodString;
314
+ deleted: z.ZodBoolean;
315
+ }, z.core.$loose>;
316
+ type Media = z.infer<typeof librarySchema>;
317
+ declare class XCreativeService {
318
+ private readonly entities;
319
+ constructor(entities: XAdsEntities);
320
+ users(account: string, requireComplete?: boolean): Promise<{
321
+ [x: string]: unknown;
322
+ id: string;
323
+ user_id: string;
324
+ promotable_user_type: string;
325
+ deleted: boolean;
326
+ }[]>;
327
+ access(account: string): Promise<{
328
+ user_id: string;
329
+ permissions: string[];
330
+ }>;
331
+ verifyComposer(account: string, user: string): Promise<{
332
+ user_id: string;
333
+ permissions: string[];
334
+ }>;
335
+ draft(account: string, resource: string): Promise<{
336
+ [x: string]: unknown;
337
+ id: string;
338
+ user_id: string;
339
+ text: string;
340
+ name: string | null;
341
+ nullcast: boolean;
342
+ card_uri: string | null;
343
+ media_keys: string[];
344
+ status?: string | undefined;
345
+ }>;
346
+ media(account: string, resource: string): Promise<{
347
+ [x: string]: unknown;
348
+ media_key: string;
349
+ media_type: "IMAGE" | "GIF" | "VIDEO";
350
+ media_status: string;
351
+ deleted: boolean;
352
+ }>;
353
+ cards(account: string, values: string[], withDeleted?: boolean): Promise<{
354
+ items: {
355
+ [x: string]: unknown;
356
+ id: string;
357
+ card_uri: string;
358
+ deleted: boolean;
359
+ card_type: string;
360
+ }[];
361
+ missing: string[];
362
+ }>;
363
+ verifyAttachments(account: string, keys: string[], card?: string | null): Promise<{
364
+ media: {
365
+ [x: string]: unknown;
366
+ media_key: string;
367
+ media_type: "IMAGE" | "GIF" | "VIDEO";
368
+ media_status: string;
369
+ deleted: boolean;
370
+ }[];
371
+ cards: {
372
+ [x: string]: unknown;
373
+ id: string;
374
+ card_uri: string;
375
+ deleted: boolean;
376
+ card_type: string;
377
+ }[];
378
+ }>;
379
+ private page;
380
+ visual(value: Media): Creative['media'];
381
+ library(value: z.input<typeof libraryList>): Promise<{
382
+ next_cursor?: string | undefined;
383
+ truncated: boolean;
384
+ items: {
385
+ [x: string]: unknown;
386
+ media_key: string;
387
+ media_type: "IMAGE" | "GIF" | "VIDEO";
388
+ media_status: string;
389
+ deleted: boolean;
390
+ }[];
391
+ creatives: {
392
+ id: string;
393
+ provider: string;
394
+ account_id: string;
395
+ name: string;
396
+ type: string;
397
+ headlines: string[];
398
+ descriptions: string[];
399
+ landing_urls: string[];
400
+ media: {
401
+ type: "image" | "video" | "audio";
402
+ url: string;
403
+ alt?: string | undefined;
404
+ poster_url?: string | undefined;
405
+ open_url?: string | undefined;
406
+ }[];
407
+ actions: {
408
+ label: string;
409
+ tool: string;
410
+ arguments: Record<string, unknown>;
411
+ fields: {
412
+ key: string;
413
+ label: string;
414
+ type: "text" | "text_list" | "url_list" | "select";
415
+ value: string | string[];
416
+ options?: {
417
+ label: string;
418
+ value: string;
419
+ }[] | undefined;
420
+ max_length?: number | undefined;
421
+ }[];
422
+ }[];
423
+ status?: string | undefined;
424
+ campaign_id?: string | undefined;
425
+ ad_group_id?: string | undefined;
426
+ }[];
427
+ }>;
428
+ drafts(value: z.input<typeof draftList>): Promise<{
429
+ next_cursor?: string | undefined;
430
+ truncated: boolean;
431
+ items: {
432
+ [x: string]: unknown;
433
+ id: string;
434
+ user_id: string;
435
+ text: string;
436
+ name: string | null;
437
+ nullcast: boolean;
438
+ card_uri: string | null;
439
+ media_keys: string[];
440
+ status?: string | undefined;
441
+ }[];
442
+ creatives: {
443
+ id: string;
444
+ provider: string;
445
+ account_id: string;
446
+ name: string;
447
+ type: string;
448
+ headlines: string[];
449
+ descriptions: string[];
450
+ landing_urls: string[];
451
+ media: {
452
+ type: "image" | "video" | "audio";
453
+ url: string;
454
+ alt?: string | undefined;
455
+ poster_url?: string | undefined;
456
+ open_url?: string | undefined;
457
+ }[];
458
+ actions: {
459
+ label: string;
460
+ tool: string;
461
+ arguments: Record<string, unknown>;
462
+ fields: {
463
+ key: string;
464
+ label: string;
465
+ type: "text" | "text_list" | "url_list" | "select";
466
+ value: string | string[];
467
+ options?: {
468
+ label: string;
469
+ value: string;
470
+ }[] | undefined;
471
+ max_length?: number | undefined;
472
+ }[];
473
+ }[];
474
+ status?: string | undefined;
475
+ campaign_id?: string | undefined;
476
+ ad_group_id?: string | undefined;
477
+ }[];
478
+ warnings: string[];
479
+ }>;
480
+ plan(op: WriteOperation, _guard: WriteGuard): Promise<XWritePlan>;
481
+ }
482
+
483
+ interface MediaPlan extends Omit<WritePreview, 'serverValidated'> {
484
+ execute(): Promise<WriteResult>;
485
+ }
486
+ declare class XMediaService {
487
+ private readonly provider;
488
+ private readonly media;
489
+ constructor(provider: XAdsProvider, media?: MediaResolver);
490
+ private receipt;
491
+ private author;
492
+ private checked;
493
+ private nativeStatus;
494
+ status(account: string, value: string): Promise<{
495
+ native: {
496
+ [x: string]: unknown;
497
+ id: string;
498
+ media_key?: string | undefined;
499
+ expires_after_secs?: number | undefined;
500
+ size?: number | undefined;
501
+ processing_info?: {
502
+ [x: string]: unknown;
503
+ state: "pending" | "in_progress" | "succeeded" | "failed";
504
+ check_after_secs?: number | undefined;
505
+ progress_percent?: number | undefined;
506
+ } | undefined;
507
+ };
508
+ bound: {
509
+ expires_at: number;
510
+ media_key?: string | undefined;
511
+ kind: "media_upload_v1";
512
+ account_id: string;
513
+ user_id: string;
514
+ media_id: string;
515
+ media_type: "IMAGE" | "GIF" | "VIDEO";
516
+ sha256: string;
517
+ byte_length: number;
518
+ finalized: boolean;
519
+ };
520
+ state: "pending" | "in_progress" | "succeeded" | "failed";
521
+ resource_receipt: string;
522
+ }>;
523
+ plan(op: WriteOperation): Promise<MediaPlan>;
524
+ }
525
+
526
+ declare const listCards: z.ZodObject<{
527
+ account_id: z.ZodString;
528
+ count: z.ZodDefault<z.ZodNumber>;
529
+ cursor: z.ZodOptional<z.ZodString>;
530
+ card_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
531
+ IMAGE_APP: "IMAGE_APP";
532
+ IMAGE_CAROUSEL_APP: "IMAGE_CAROUSEL_APP";
533
+ IMAGE_CAROUSEL_WEBSITE: "IMAGE_CAROUSEL_WEBSITE";
534
+ IMAGE_MULTI_DEST_CAROUSEL_WEBSITE: "IMAGE_MULTI_DEST_CAROUSEL_WEBSITE";
535
+ IMAGE_WEBSITE: "IMAGE_WEBSITE";
536
+ MIXED_MEDIA_MULTI_DEST_CAROUSEL_WEBSITE: "MIXED_MEDIA_MULTI_DEST_CAROUSEL_WEBSITE";
537
+ MIXED_MEDIA_SINGLE_DEST_CAROUSEL_APP: "MIXED_MEDIA_SINGLE_DEST_CAROUSEL_APP";
538
+ MIXED_MEDIA_SINGLE_DEST_CAROUSEL_WEBSITE: "MIXED_MEDIA_SINGLE_DEST_CAROUSEL_WEBSITE";
539
+ VIDEO_APP: "VIDEO_APP";
540
+ VIDEO_CAROUSEL_APP: "VIDEO_CAROUSEL_APP";
541
+ VIDEO_CAROUSEL_WEBSITE: "VIDEO_CAROUSEL_WEBSITE";
542
+ VIDEO_MULTI_DEST_CAROUSEL_WEBSITE: "VIDEO_MULTI_DEST_CAROUSEL_WEBSITE";
543
+ VIDEO_WEBSITE: "VIDEO_WEBSITE";
544
+ }>>>;
545
+ card_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
546
+ card_uris: z.ZodOptional<z.ZodArray<z.ZodString>>;
547
+ q: z.ZodOptional<z.ZodString>;
548
+ include_legacy_cards: z.ZodDefault<z.ZodBoolean>;
549
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
550
+ include_media: z.ZodDefault<z.ZodBoolean>;
551
+ }, z.core.$strip>;
552
+
553
+ declare class XCardService {
554
+ private readonly entities;
555
+ private readonly creatives;
556
+ constructor(entities: XAdsEntities, creatives: XCreativeService);
557
+ private hash;
558
+ private decorate;
559
+ private owned;
560
+ get(account: string, id: string, withDeleted?: boolean): Promise<{
561
+ configuration_hash: string;
562
+ id: string;
563
+ card_uri: string;
564
+ card_type: string;
565
+ deleted: boolean;
566
+ name?: string | null | undefined;
567
+ components?: unknown[] | null | undefined;
568
+ slides?: unknown[][] | null | undefined;
569
+ }>;
570
+ private keys;
571
+ private supportedLayout;
572
+ private mediaFor;
573
+ private cardType;
574
+ private copyLayout;
575
+ private actions;
576
+ list(value: z.input<typeof listCards>): Promise<{
577
+ next_cursor?: string | undefined;
578
+ items: {
579
+ configuration_hash: string;
580
+ id: string;
581
+ card_uri: string;
582
+ card_type: string;
583
+ deleted: boolean;
584
+ name?: string | null | undefined;
585
+ components?: unknown[] | null | undefined;
586
+ slides?: unknown[][] | null | undefined;
587
+ }[];
588
+ creatives: {
589
+ id: string;
590
+ provider: string;
591
+ account_id: string;
592
+ name: string;
593
+ type: string;
594
+ headlines: string[];
595
+ descriptions: string[];
596
+ landing_urls: string[];
597
+ media: {
598
+ type: "image" | "video" | "audio";
599
+ url: string;
600
+ alt?: string | undefined;
601
+ poster_url?: string | undefined;
602
+ open_url?: string | undefined;
603
+ }[];
604
+ actions: {
605
+ label: string;
606
+ tool: string;
607
+ arguments: Record<string, unknown>;
608
+ fields: {
609
+ key: string;
610
+ label: string;
611
+ type: "text" | "text_list" | "url_list" | "select";
612
+ value: string | string[];
613
+ options?: {
614
+ label: string;
615
+ value: string;
616
+ }[] | undefined;
617
+ max_length?: number | undefined;
618
+ }[];
619
+ }[];
620
+ status?: string | undefined;
621
+ campaign_id?: string | undefined;
622
+ ad_group_id?: string | undefined;
623
+ }[];
624
+ warnings: string[];
625
+ truncated: boolean;
626
+ }>;
627
+ private layoutFields;
628
+ plan(op: WriteOperation): Promise<XWritePlan>;
629
+ }
630
+
631
+ declare const audienceList: z.ZodObject<{
632
+ permission_scope: z.ZodDefault<z.ZodEnum<{
633
+ OWNER: "OWNER";
634
+ SHARED: "SHARED";
635
+ }>>;
636
+ custom_audience_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
637
+ q: z.ZodOptional<z.ZodString>;
638
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
639
+ cursor: z.ZodOptional<z.ZodString>;
640
+ count: z.ZodDefault<z.ZodNumber>;
641
+ with_total_count: z.ZodDefault<z.ZodBoolean>;
642
+ account_id: z.ZodString;
643
+ }, z.core.$strict>;
644
+ declare const audienceGet: z.ZodObject<{
645
+ account_id: z.ZodString;
646
+ custom_audience_id: z.ZodString;
647
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
648
+ }, z.core.$strict>;
649
+ declare const audiencePermissions: z.ZodObject<{
650
+ granted_account_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
651
+ custom_audience_permission_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
652
+ cursor: z.ZodOptional<z.ZodString>;
653
+ count: z.ZodDefault<z.ZodNumber>;
654
+ with_total_count: z.ZodDefault<z.ZodBoolean>;
655
+ account_id: z.ZodString;
656
+ custom_audience_id: z.ZodString;
657
+ }, z.core.$strict>;
658
+
659
+ type Row = Record<string, unknown>;
660
+ type Plan$6 = Omit<WritePreview, 'serverValidated'> & {
661
+ execute(): Promise<WriteResult>;
662
+ };
663
+ /** X-owned v12 audience reference at 4e8f626, inspected 2026-11-05. */
664
+ declare class XAudienceService {
665
+ private readonly entities;
666
+ constructor(entities: XAdsEntities);
667
+ private base;
668
+ private scope;
669
+ private owned;
670
+ private page;
671
+ private pageParams;
672
+ private record;
673
+ list(raw: z.input<typeof audienceList>): Promise<{
674
+ data: {
675
+ configuration_hash: string;
676
+ id: string;
677
+ name: string;
678
+ description: string | null;
679
+ audience_type: string;
680
+ deleted: boolean;
681
+ permission_level: string;
682
+ owner_account_id?: string | undefined;
683
+ is_owner?: boolean | undefined;
684
+ targetable?: boolean | undefined;
685
+ audience_size?: number | null | undefined;
686
+ partner_source?: string | undefined;
687
+ }[];
688
+ records: Row[];
689
+ notes: string[];
690
+ complete: boolean | null;
691
+ truncated: boolean;
692
+ next_cursor: string | undefined;
693
+ total_count?: number | undefined;
694
+ request?: {
695
+ params?: Record<string, unknown> | undefined;
696
+ } | undefined;
697
+ }>;
698
+ get(raw: z.input<typeof audienceGet>): Promise<{
699
+ audience: {
700
+ configuration_hash: string;
701
+ id: string;
702
+ name: string;
703
+ description: string | null;
704
+ audience_type: string;
705
+ deleted: boolean;
706
+ permission_level: string;
707
+ owner_account_id?: string | undefined;
708
+ is_owner?: boolean | undefined;
709
+ targetable?: boolean | undefined;
710
+ audience_size?: number | null | undefined;
711
+ partner_source?: string | undefined;
712
+ };
713
+ records: Row[];
714
+ }>;
715
+ permissions(raw: z.input<typeof audiencePermissions>): Promise<{
716
+ records: {
717
+ [x: string]: unknown;
718
+ id: string;
719
+ custom_audience_id: string;
720
+ granted_account_id: string;
721
+ permission_level: string;
722
+ deleted: boolean;
723
+ }[];
724
+ complete: boolean | null;
725
+ truncated: boolean;
726
+ next_cursor: string | undefined;
727
+ data: {
728
+ [x: string]: unknown;
729
+ id: string;
730
+ custom_audience_id: string;
731
+ granted_account_id: string;
732
+ permission_level: string;
733
+ deleted: boolean;
734
+ }[];
735
+ total_count?: number | undefined;
736
+ request?: {
737
+ params?: Record<string, unknown> | undefined;
738
+ } | undefined;
739
+ }>;
740
+ private collect;
741
+ usage(account: string, resource: string): Promise<{
742
+ audience: {
743
+ configuration_hash: string;
744
+ id: string;
745
+ name: string;
746
+ description: string | null;
747
+ audience_type: string;
748
+ deleted: boolean;
749
+ permission_level: string;
750
+ owner_account_id?: string | undefined;
751
+ is_owner?: boolean | undefined;
752
+ targetable?: boolean | undefined;
753
+ audience_size?: number | null | undefined;
754
+ partner_source?: string | undefined;
755
+ };
756
+ references: {
757
+ id: string;
758
+ servable: boolean;
759
+ name?: string | null | undefined;
760
+ campaign_id: string;
761
+ }[];
762
+ criteria: {
763
+ [x: string]: unknown;
764
+ id: string;
765
+ line_item_id: string;
766
+ targeting_type: string;
767
+ targeting_value: string;
768
+ deleted: boolean;
769
+ operator_type?: string | undefined;
770
+ }[];
771
+ permissions: {
772
+ [x: string]: unknown;
773
+ id: string;
774
+ custom_audience_id: string;
775
+ granted_account_id: string;
776
+ permission_level: string;
777
+ deleted: boolean;
778
+ }[];
779
+ complete: boolean;
780
+ usage_hash: string;
781
+ records: {
782
+ id: string;
783
+ name: string;
784
+ targeted_groups: number;
785
+ direct_criteria: number;
786
+ sharing_grants: number;
787
+ }[];
788
+ notes: string[];
789
+ }>;
790
+ plan(op: WriteOperation): Promise<Plan$6>;
791
+ }
792
+
793
+ type Plan$5 = Omit<WritePreview, 'serverValidated'> & {
794
+ execute(): Promise<WriteResult>;
795
+ };
796
+ /** Provider-owned v12 tracking/app references and MCP route map, commit 4e8f626. */
797
+ declare class XMeasurementService {
798
+ private readonly entities;
799
+ private readonly analytics;
800
+ constructor(entities: XAdsEntities, analytics: XAdsAnalytics);
801
+ private base;
802
+ private scope;
803
+ private rowScope;
804
+ private page;
805
+ private get;
806
+ listWeb(value: unknown): Promise<{
807
+ data: ({
808
+ [x: string]: unknown;
809
+ id: string;
810
+ name: string;
811
+ type: string;
812
+ deleted: boolean;
813
+ } & {
814
+ configuration_hash: string;
815
+ })[];
816
+ records: {
817
+ view_through_window_days?: {} | null | undefined;
818
+ click_window_days?: {} | null | undefined;
819
+ id: string;
820
+ name: string;
821
+ type: string;
822
+ status: {};
823
+ }[];
824
+ warnings?: string[] | undefined;
825
+ complete: boolean | null;
826
+ next_cursor?: string | null | undefined;
827
+ total_count?: number | undefined;
828
+ request?: {
829
+ params?: Record<string, unknown> | undefined;
830
+ } | undefined;
831
+ }>;
832
+ getWeb(value: unknown): Promise<{
833
+ data: {
834
+ [x: string]: unknown;
835
+ id: string;
836
+ name: string;
837
+ type: string;
838
+ deleted: boolean;
839
+ } & {
840
+ configuration_hash: string;
841
+ };
842
+ records: ({
843
+ [x: string]: unknown;
844
+ id: string;
845
+ name: string;
846
+ type: string;
847
+ deleted: boolean;
848
+ } & {
849
+ configuration_hash: string;
850
+ })[];
851
+ notes: string[];
852
+ request?: {
853
+ params?: Record<string, unknown> | undefined;
854
+ } | undefined;
855
+ }>;
856
+ listApp(value: unknown): Promise<{
857
+ records: {
858
+ id: string;
859
+ name: string;
860
+ status: {};
861
+ os_type: string;
862
+ post_view_window_days: number;
863
+ post_engagement_window_days: number;
864
+ }[];
865
+ warnings?: string[] | undefined;
866
+ complete: boolean | null;
867
+ data: {
868
+ [x: string]: unknown;
869
+ id: string;
870
+ app_store_identifier: string;
871
+ os_type: string;
872
+ conversion_type: string;
873
+ post_view_attribution_window: number;
874
+ post_engagement_attribution_window: number;
875
+ deleted: boolean;
876
+ }[];
877
+ next_cursor?: string | null | undefined;
878
+ total_count?: number | undefined;
879
+ request?: {
880
+ params?: Record<string, unknown> | undefined;
881
+ } | undefined;
882
+ }>;
883
+ getApp(value: unknown): Promise<{
884
+ records: {
885
+ [x: string]: unknown;
886
+ id: string;
887
+ app_store_identifier: string;
888
+ os_type: string;
889
+ conversion_type: string;
890
+ post_view_attribution_window: number;
891
+ post_engagement_attribution_window: number;
892
+ deleted: boolean;
893
+ }[];
894
+ data: {
895
+ [x: string]: unknown;
896
+ id: string;
897
+ app_store_identifier: string;
898
+ os_type: string;
899
+ conversion_type: string;
900
+ post_view_attribution_window: number;
901
+ post_engagement_attribution_window: number;
902
+ deleted: boolean;
903
+ };
904
+ request?: {
905
+ params?: Record<string, unknown> | undefined;
906
+ } | undefined;
907
+ }>;
908
+ private pageParams;
909
+ listTracking(value: unknown): Promise<{
910
+ data: {
911
+ configuration_hash: string;
912
+ id: string;
913
+ line_item_id: string;
914
+ tracking_tag_type: string;
915
+ tracking_tag_url: string;
916
+ deleted: boolean;
917
+ }[];
918
+ records: {
919
+ id: string;
920
+ name: string;
921
+ status: string;
922
+ line_item_id: string;
923
+ tracking_url: string;
924
+ }[];
925
+ warnings?: string[] | undefined;
926
+ complete: boolean | null;
927
+ next_cursor?: string | null | undefined;
928
+ total_count?: number | undefined;
929
+ request?: {
930
+ params?: Record<string, unknown> | undefined;
931
+ } | undefined;
932
+ }>;
933
+ private selectedParents;
934
+ getTracking(value: unknown): Promise<{
935
+ data: {
936
+ configuration_hash: string;
937
+ id: string;
938
+ line_item_id: string;
939
+ tracking_tag_type: string;
940
+ tracking_tag_url: string;
941
+ deleted: boolean;
942
+ };
943
+ records: {
944
+ id: string;
945
+ name: string;
946
+ status: string;
947
+ line_item_id: string;
948
+ tracking_url: string;
949
+ }[];
950
+ request?: {
951
+ params?: Record<string, unknown> | undefined;
952
+ } | undefined;
953
+ }>;
954
+ private trackingRecord;
955
+ plan(op: WriteOperation): Promise<Plan$5>;
956
+ conversions(value: unknown): Promise<{
957
+ data: {
958
+ id_data: {
959
+ metrics: {
960
+ [k: string]: string | number | boolean | z.core.util.JSONType[] | {
961
+ [key: string]: z.core.util.JSONType;
962
+ } | null;
963
+ };
964
+ segment: null;
965
+ }[];
966
+ id: string;
967
+ }[];
968
+ records: {
969
+ id: string;
970
+ name: string;
971
+ metric_group: "WEB_CONVERSION" | "MOBILE_CONVERSION";
972
+ placement: "ALL_ON_TWITTER" | "SPOTLIGHT" | "TREND";
973
+ native_metrics: {
974
+ [k: string]: string | number | boolean | z.core.util.JSONType[] | {
975
+ [key: string]: z.core.util.JSONType;
976
+ } | null;
977
+ };
978
+ }[];
979
+ normalized: boolean;
980
+ placement: "ALL_ON_TWITTER" | "SPOTLIGHT" | "TREND";
981
+ metric_group: "WEB_CONVERSION" | "MOBILE_CONVERSION";
982
+ notes: string[];
983
+ data_type: "stats";
984
+ time_series_length: 1;
985
+ request: {
986
+ params: {
987
+ start_time: string;
988
+ end_time: string;
989
+ entity: string;
990
+ entity_ids: string[];
991
+ placement: string;
992
+ granularity: "TOTAL";
993
+ metric_groups: string[];
994
+ account_id?: string | undefined;
995
+ };
996
+ };
997
+ }>;
998
+ }
999
+
1000
+ declare const postFields: z.ZodObject<{
1001
+ as_user_id: z.ZodString;
1002
+ text: z.ZodOptional<z.ZodString>;
1003
+ name: z.ZodOptional<z.ZodString>;
1004
+ media_keys: z.ZodOptional<z.ZodArray<z.ZodString>>;
1005
+ card_uri: z.ZodOptional<z.ZodString>;
1006
+ conversation_settings: z.ZodDefault<z.ZodEnum<{
1007
+ EVERYONE: "EVERYONE";
1008
+ FOLLOWING: "FOLLOWING";
1009
+ MENTIONED_USERS: "MENTIONED_USERS";
1010
+ }>>;
1011
+ video_cta: z.ZodOptional<z.ZodEnum<{
1012
+ VISIT_SITE: "VISIT_SITE";
1013
+ WATCH_NOW: "WATCH_NOW";
1014
+ }>>;
1015
+ video_cta_value: z.ZodOptional<z.ZodURL>;
1016
+ video_title: z.ZodOptional<z.ZodString>;
1017
+ video_description: z.ZodOptional<z.ZodString>;
1018
+ }, z.core.$strict>;
1019
+ declare const postList: z.ZodObject<{
1020
+ account_id: z.ZodString;
1021
+ user_id: z.ZodString;
1022
+ timeline_type: z.ZodDefault<z.ZodEnum<{
1023
+ NULLCAST: "NULLCAST";
1024
+ ORGANIC: "ORGANIC";
1025
+ ALL: "ALL";
1026
+ }>>;
1027
+ include_mentions_and_replies: z.ZodDefault<z.ZodBoolean>;
1028
+ name: z.ZodOptional<z.ZodString>;
1029
+ count: z.ZodDefault<z.ZodNumber>;
1030
+ cursor: z.ZodOptional<z.ZodString>;
1031
+ }, z.core.$strict>;
1032
+ declare const promotionSelection: z.ZodObject<{
1033
+ line_item_id: z.ZodString;
1034
+ user_id: z.ZodString;
1035
+ tweet_ids: z.ZodArray<z.ZodString>;
1036
+ }, z.core.$strict>;
1037
+ declare const promotionList: z.ZodObject<{
1038
+ account_id: z.ZodString;
1039
+ line_item_id: z.ZodString;
1040
+ user_id: z.ZodOptional<z.ZodString>;
1041
+ count: z.ZodDefault<z.ZodNumber>;
1042
+ cursor: z.ZodOptional<z.ZodString>;
1043
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
1044
+ }, z.core.$strict>;
1045
+
1046
+ interface Plan$4 extends Omit<WritePreview, 'serverValidated'> {
1047
+ execute(): Promise<string[] | WriteResult>;
1048
+ }
1049
+ /** Official xdevplatform/docs creatives a9226e10 and campaign-management570f918c, checked2026-11-06. */
1050
+ declare class XPostService {
1051
+ private readonly entities;
1052
+ private readonly creatives;
1053
+ constructor(entities: XAdsEntities, creatives: XCreativeService);
1054
+ private base;
1055
+ private author;
1056
+ private paging;
1057
+ private postPage;
1058
+ private exactPosts;
1059
+ get(account: string, user: string, id: string): Promise<{
1060
+ snapshot_hash: string;
1061
+ id_str: string;
1062
+ user: {
1063
+ id_str: string;
1064
+ };
1065
+ name: string | null;
1066
+ full_text: string;
1067
+ nullcast: boolean;
1068
+ tweet_type: "PUBLISHED";
1069
+ conversation_settings?: string | undefined;
1070
+ truncated?: boolean | undefined;
1071
+ entities?: {
1072
+ urls?: {
1073
+ url: string;
1074
+ expanded_url?: string | undefined;
1075
+ display_url?: string | undefined;
1076
+ indices?: number[] | undefined;
1077
+ }[] | undefined;
1078
+ media?: {
1079
+ id_str: string;
1080
+ type: string;
1081
+ media_key?: string | undefined;
1082
+ media_url_https?: string | undefined;
1083
+ url?: string | undefined;
1084
+ expanded_url?: string | undefined;
1085
+ video_info?: {
1086
+ variants: {
1087
+ content_type: string;
1088
+ url: string;
1089
+ bitrate?: number | undefined;
1090
+ }[];
1091
+ } | undefined;
1092
+ }[] | undefined;
1093
+ } | undefined;
1094
+ extended_entities?: {
1095
+ media: {
1096
+ id_str: string;
1097
+ type: string;
1098
+ media_key?: string | undefined;
1099
+ media_url_https?: string | undefined;
1100
+ url?: string | undefined;
1101
+ expanded_url?: string | undefined;
1102
+ video_info?: {
1103
+ variants: {
1104
+ content_type: string;
1105
+ url: string;
1106
+ bitrate?: number | undefined;
1107
+ }[];
1108
+ } | undefined;
1109
+ }[];
1110
+ } | undefined;
1111
+ }>;
1112
+ private visual;
1113
+ private creative;
1114
+ list(raw: z.input<typeof postList>): Promise<{
1115
+ warnings: string[];
1116
+ notes?: string[] | undefined;
1117
+ next_cursor?: string | undefined;
1118
+ truncated: boolean;
1119
+ items: {
1120
+ snapshot_hash: string;
1121
+ id_str: string;
1122
+ user: {
1123
+ id_str: string;
1124
+ };
1125
+ name: string | null;
1126
+ full_text: string;
1127
+ nullcast: boolean;
1128
+ tweet_type: "PUBLISHED";
1129
+ conversation_settings?: string | undefined;
1130
+ truncated?: boolean | undefined;
1131
+ entities?: {
1132
+ urls?: {
1133
+ url: string;
1134
+ expanded_url?: string | undefined;
1135
+ display_url?: string | undefined;
1136
+ indices?: number[] | undefined;
1137
+ }[] | undefined;
1138
+ media?: {
1139
+ id_str: string;
1140
+ type: string;
1141
+ media_key?: string | undefined;
1142
+ media_url_https?: string | undefined;
1143
+ url?: string | undefined;
1144
+ expanded_url?: string | undefined;
1145
+ video_info?: {
1146
+ variants: {
1147
+ content_type: string;
1148
+ url: string;
1149
+ bitrate?: number | undefined;
1150
+ }[];
1151
+ } | undefined;
1152
+ }[] | undefined;
1153
+ } | undefined;
1154
+ extended_entities?: {
1155
+ media: {
1156
+ id_str: string;
1157
+ type: string;
1158
+ media_key?: string | undefined;
1159
+ media_url_https?: string | undefined;
1160
+ url?: string | undefined;
1161
+ expanded_url?: string | undefined;
1162
+ video_info?: {
1163
+ variants: {
1164
+ content_type: string;
1165
+ url: string;
1166
+ bitrate?: number | undefined;
1167
+ }[];
1168
+ } | undefined;
1169
+ }[];
1170
+ } | undefined;
1171
+ }[];
1172
+ creatives: {
1173
+ id: string;
1174
+ provider: string;
1175
+ account_id: string;
1176
+ name: string;
1177
+ type: string;
1178
+ headlines: string[];
1179
+ descriptions: string[];
1180
+ landing_urls: string[];
1181
+ media: {
1182
+ type: "image" | "video" | "audio";
1183
+ url: string;
1184
+ alt?: string | undefined;
1185
+ poster_url?: string | undefined;
1186
+ open_url?: string | undefined;
1187
+ }[];
1188
+ actions: {
1189
+ label: string;
1190
+ tool: string;
1191
+ arguments: Record<string, unknown>;
1192
+ fields: {
1193
+ key: string;
1194
+ label: string;
1195
+ type: "text" | "text_list" | "url_list" | "select";
1196
+ value: string | string[];
1197
+ options?: {
1198
+ label: string;
1199
+ value: string;
1200
+ }[] | undefined;
1201
+ max_length?: number | undefined;
1202
+ }[];
1203
+ }[];
1204
+ status?: string | undefined;
1205
+ campaign_id?: string | undefined;
1206
+ ad_group_id?: string | undefined;
1207
+ }[];
1208
+ }>;
1209
+ creationContext(account: string, raw: z.input<typeof postFields>): Promise<{
1210
+ context_hash: string;
1211
+ notes: string[];
1212
+ account_id: string;
1213
+ request: {
1214
+ as_user_id: string;
1215
+ conversation_settings: "EVERYONE" | "FOLLOWING" | "MENTIONED_USERS";
1216
+ text?: string | undefined;
1217
+ name?: string | undefined;
1218
+ media_keys?: string[] | undefined;
1219
+ card_uri?: string | undefined;
1220
+ video_cta?: "VISIT_SITE" | "WATCH_NOW" | undefined;
1221
+ video_cta_value?: string | undefined;
1222
+ video_title?: string | undefined;
1223
+ video_description?: string | undefined;
1224
+ };
1225
+ actor: {
1226
+ user_id: string;
1227
+ permissions: string[];
1228
+ };
1229
+ sources: {
1230
+ media: {
1231
+ [k: string]: unknown;
1232
+ }[];
1233
+ cards: {
1234
+ [k: string]: unknown;
1235
+ }[];
1236
+ };
1237
+ }>;
1238
+ parents(account: string, lineId: string): Promise<{
1239
+ line: {
1240
+ [x: string]: unknown;
1241
+ id: string;
1242
+ name: string | null;
1243
+ campaign_id: string;
1244
+ currency: string;
1245
+ entity_status: string;
1246
+ deleted: boolean;
1247
+ placements: string[];
1248
+ product_type: string;
1249
+ objective: string;
1250
+ bid_strategy?: string | undefined;
1251
+ bid_amount_local_micro?: number | null | undefined;
1252
+ daily_budget_amount_local_micro?: number | null | undefined;
1253
+ total_budget_amount_local_micro?: number | null | undefined;
1254
+ start_time?: string | null | undefined;
1255
+ end_time?: string | null | undefined;
1256
+ };
1257
+ campaign: {
1258
+ id: string;
1259
+ name: string;
1260
+ currency: string;
1261
+ funding_instrument_id: string;
1262
+ entity_status: string;
1263
+ deleted: boolean;
1264
+ budget_optimization: string;
1265
+ daily_budget_amount_local_micro: number | null;
1266
+ total_budget_amount_local_micro: number | null;
1267
+ };
1268
+ snapshot: {
1269
+ line: {
1270
+ [k: string]: unknown;
1271
+ };
1272
+ campaign: {
1273
+ id: string;
1274
+ name: string;
1275
+ currency: string;
1276
+ funding_instrument_id: string;
1277
+ entity_status: string;
1278
+ deleted: boolean;
1279
+ budget_optimization: string;
1280
+ daily_budget_amount_local_micro: number | null;
1281
+ total_budget_amount_local_micro: number | null;
1282
+ };
1283
+ };
1284
+ }>;
1285
+ private scopedPromotion;
1286
+ private promotionPage;
1287
+ private existing;
1288
+ private promotionHash;
1289
+ getPromotion(account: string, id: string): Promise<{
1290
+ context_hash: string;
1291
+ parent: {
1292
+ line: {
1293
+ [k: string]: unknown;
1294
+ };
1295
+ campaign: {
1296
+ id: string;
1297
+ name: string;
1298
+ currency: string;
1299
+ funding_instrument_id: string;
1300
+ entity_status: string;
1301
+ deleted: boolean;
1302
+ budget_optimization: string;
1303
+ daily_budget_amount_local_micro: number | null;
1304
+ total_budget_amount_local_micro: number | null;
1305
+ };
1306
+ };
1307
+ id: string;
1308
+ line_item_id: string;
1309
+ tweet_id: string;
1310
+ entity_status: string;
1311
+ deleted: boolean;
1312
+ account_id?: string | undefined;
1313
+ approval_status?: string | undefined;
1314
+ }>;
1315
+ promotionContext(account: string, raw: z.input<typeof promotionSelection>): Promise<{
1316
+ context_hash: string;
1317
+ notes: string[];
1318
+ account_id: string;
1319
+ request: {
1320
+ line_item_id: string;
1321
+ user_id: string;
1322
+ tweet_ids: string[];
1323
+ };
1324
+ parent: {
1325
+ line: {
1326
+ [k: string]: unknown;
1327
+ };
1328
+ campaign: {
1329
+ id: string;
1330
+ name: string;
1331
+ currency: string;
1332
+ funding_instrument_id: string;
1333
+ entity_status: string;
1334
+ deleted: boolean;
1335
+ budget_optimization: string;
1336
+ daily_budget_amount_local_micro: number | null;
1337
+ total_budget_amount_local_micro: number | null;
1338
+ };
1339
+ };
1340
+ posts: {
1341
+ id_str: string;
1342
+ user: {
1343
+ id_str: string;
1344
+ };
1345
+ name: string | null;
1346
+ full_text: string;
1347
+ nullcast: boolean;
1348
+ tweet_type: "PUBLISHED";
1349
+ conversation_settings?: string | undefined;
1350
+ truncated?: boolean | undefined;
1351
+ entities?: {
1352
+ urls?: {
1353
+ url: string;
1354
+ expanded_url?: string | undefined;
1355
+ display_url?: string | undefined;
1356
+ indices?: number[] | undefined;
1357
+ }[] | undefined;
1358
+ media?: {
1359
+ id_str: string;
1360
+ type: string;
1361
+ media_key?: string | undefined;
1362
+ media_url_https?: string | undefined;
1363
+ url?: string | undefined;
1364
+ expanded_url?: string | undefined;
1365
+ video_info?: {
1366
+ variants: {
1367
+ content_type: string;
1368
+ url: string;
1369
+ bitrate?: number | undefined;
1370
+ }[];
1371
+ } | undefined;
1372
+ }[] | undefined;
1373
+ } | undefined;
1374
+ extended_entities?: {
1375
+ media: {
1376
+ id_str: string;
1377
+ type: string;
1378
+ media_key?: string | undefined;
1379
+ media_url_https?: string | undefined;
1380
+ url?: string | undefined;
1381
+ expanded_url?: string | undefined;
1382
+ video_info?: {
1383
+ variants: {
1384
+ content_type: string;
1385
+ url: string;
1386
+ bitrate?: number | undefined;
1387
+ }[];
1388
+ } | undefined;
1389
+ }[];
1390
+ } | undefined;
1391
+ }[];
1392
+ existing: {
1393
+ id: string;
1394
+ line_item_id: string;
1395
+ tweet_id: string;
1396
+ entity_status: string;
1397
+ deleted: boolean;
1398
+ account_id?: string | undefined;
1399
+ approval_status?: string | undefined;
1400
+ }[];
1401
+ }>;
1402
+ private repostAuthors;
1403
+ private repostState;
1404
+ repostContext(account: string, raw: z.input<typeof promotionSelection>): Promise<{
1405
+ context_hash: string;
1406
+ creatives: {
1407
+ id: string;
1408
+ provider: string;
1409
+ account_id: string;
1410
+ name: string;
1411
+ type: string;
1412
+ headlines: string[];
1413
+ descriptions: string[];
1414
+ landing_urls: string[];
1415
+ media: {
1416
+ type: "image" | "video" | "audio";
1417
+ url: string;
1418
+ alt?: string | undefined;
1419
+ poster_url?: string | undefined;
1420
+ open_url?: string | undefined;
1421
+ }[];
1422
+ actions: {
1423
+ label: string;
1424
+ tool: string;
1425
+ arguments: Record<string, unknown>;
1426
+ fields: {
1427
+ key: string;
1428
+ label: string;
1429
+ type: "text" | "text_list" | "url_list" | "select";
1430
+ value: string | string[];
1431
+ options?: {
1432
+ label: string;
1433
+ value: string;
1434
+ }[] | undefined;
1435
+ max_length?: number | undefined;
1436
+ }[];
1437
+ }[];
1438
+ status?: string | undefined;
1439
+ campaign_id?: string | undefined;
1440
+ ad_group_id?: string | undefined;
1441
+ }[];
1442
+ truncated: boolean;
1443
+ notes: string[];
1444
+ parent: {
1445
+ line: {
1446
+ [k: string]: unknown;
1447
+ };
1448
+ campaign: {
1449
+ id: string;
1450
+ name: string;
1451
+ currency: string;
1452
+ funding_instrument_id: string;
1453
+ entity_status: string;
1454
+ deleted: boolean;
1455
+ budget_optimization: string;
1456
+ daily_budget_amount_local_micro: number | null;
1457
+ total_budget_amount_local_micro: number | null;
1458
+ };
1459
+ };
1460
+ posts: {
1461
+ id_str: string;
1462
+ user: {
1463
+ id_str: string;
1464
+ };
1465
+ name: string | null;
1466
+ full_text: string;
1467
+ nullcast: boolean;
1468
+ tweet_type: "PUBLISHED";
1469
+ conversation_settings?: string | undefined;
1470
+ truncated?: boolean | undefined;
1471
+ entities?: {
1472
+ urls?: {
1473
+ url: string;
1474
+ expanded_url?: string | undefined;
1475
+ display_url?: string | undefined;
1476
+ indices?: number[] | undefined;
1477
+ }[] | undefined;
1478
+ media?: {
1479
+ id_str: string;
1480
+ type: string;
1481
+ media_key?: string | undefined;
1482
+ media_url_https?: string | undefined;
1483
+ url?: string | undefined;
1484
+ expanded_url?: string | undefined;
1485
+ video_info?: {
1486
+ variants: {
1487
+ content_type: string;
1488
+ url: string;
1489
+ bitrate?: number | undefined;
1490
+ }[];
1491
+ } | undefined;
1492
+ }[] | undefined;
1493
+ } | undefined;
1494
+ extended_entities?: {
1495
+ media: {
1496
+ id_str: string;
1497
+ type: string;
1498
+ media_key?: string | undefined;
1499
+ media_url_https?: string | undefined;
1500
+ url?: string | undefined;
1501
+ expanded_url?: string | undefined;
1502
+ video_info?: {
1503
+ variants: {
1504
+ content_type: string;
1505
+ url: string;
1506
+ bitrate?: number | undefined;
1507
+ }[];
1508
+ } | undefined;
1509
+ }[];
1510
+ } | undefined;
1511
+ }[];
1512
+ existing: {
1513
+ id: string;
1514
+ line_item_id: string;
1515
+ tweet_id: string;
1516
+ entity_status: string;
1517
+ deleted: boolean;
1518
+ account_id?: string | undefined;
1519
+ approval_status?: string | undefined;
1520
+ }[];
1521
+ source_author: {
1522
+ [k: string]: unknown;
1523
+ };
1524
+ receiving_author: {
1525
+ [k: string]: unknown;
1526
+ };
1527
+ account_id: string;
1528
+ request: {
1529
+ line_item_id: string;
1530
+ user_id: string;
1531
+ tweet_ids: string[];
1532
+ };
1533
+ }>;
1534
+ promotions(raw: z.input<typeof promotionList>): Promise<{
1535
+ notes?: string[] | undefined;
1536
+ next_cursor?: string | undefined;
1537
+ truncated: boolean;
1538
+ items: {
1539
+ context_hash: string;
1540
+ id: string;
1541
+ line_item_id: string;
1542
+ tweet_id: string;
1543
+ entity_status: string;
1544
+ deleted: boolean;
1545
+ account_id?: string | undefined;
1546
+ approval_status?: string | undefined;
1547
+ }[];
1548
+ parent: {
1549
+ line: {
1550
+ [k: string]: unknown;
1551
+ };
1552
+ campaign: {
1553
+ id: string;
1554
+ name: string;
1555
+ currency: string;
1556
+ funding_instrument_id: string;
1557
+ entity_status: string;
1558
+ deleted: boolean;
1559
+ budget_optimization: string;
1560
+ daily_budget_amount_local_micro: number | null;
1561
+ total_budget_amount_local_micro: number | null;
1562
+ };
1563
+ };
1564
+ creatives: {
1565
+ id: string;
1566
+ provider: string;
1567
+ account_id: string;
1568
+ name: string;
1569
+ type: string;
1570
+ headlines: string[];
1571
+ descriptions: string[];
1572
+ landing_urls: string[];
1573
+ media: {
1574
+ type: "image" | "video" | "audio";
1575
+ url: string;
1576
+ alt?: string | undefined;
1577
+ poster_url?: string | undefined;
1578
+ open_url?: string | undefined;
1579
+ }[];
1580
+ actions: {
1581
+ label: string;
1582
+ tool: string;
1583
+ arguments: Record<string, unknown>;
1584
+ fields: {
1585
+ key: string;
1586
+ label: string;
1587
+ type: "text" | "text_list" | "url_list" | "select";
1588
+ value: string | string[];
1589
+ options?: {
1590
+ label: string;
1591
+ value: string;
1592
+ }[] | undefined;
1593
+ max_length?: number | undefined;
1594
+ }[];
1595
+ }[];
1596
+ status?: string | undefined;
1597
+ campaign_id?: string | undefined;
1598
+ ad_group_id?: string | undefined;
1599
+ }[];
1600
+ warnings: string[];
1601
+ }>;
1602
+ private unconfirmed;
1603
+ plan(op: WriteOperation, guard: WriteGuard): Promise<Plan$4>;
1604
+ }
1605
+
1606
+ declare const scheduledFields: z.ZodObject<{
1607
+ as_user_id: z.ZodString;
1608
+ scheduled_at: z.ZodISODateTime;
1609
+ text: z.ZodOptional<z.ZodString>;
1610
+ name: z.ZodOptional<z.ZodString>;
1611
+ media_keys: z.ZodOptional<z.ZodArray<z.ZodString>>;
1612
+ card_uri: z.ZodOptional<z.ZodString>;
1613
+ }, z.core.$strict>;
1614
+ declare const scheduledList: z.ZodObject<{
1615
+ account_id: z.ZodString;
1616
+ user_id: z.ZodString;
1617
+ count: z.ZodDefault<z.ZodNumber>;
1618
+ cursor: z.ZodOptional<z.ZodString>;
1619
+ include_media: z.ZodDefault<z.ZodBoolean>;
1620
+ }, z.core.$strict>;
1621
+ declare const scheduledPromotionList: z.ZodObject<{
1622
+ account_id: z.ZodString;
1623
+ line_item_id: z.ZodString;
1624
+ count: z.ZodDefault<z.ZodNumber>;
1625
+ cursor: z.ZodOptional<z.ZodString>;
1626
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
1627
+ }, z.core.$strict>;
1628
+ declare const scheduledPromotionSelection: z.ZodObject<{
1629
+ user_id: z.ZodString;
1630
+ line_item_id: z.ZodString;
1631
+ scheduled_tweet_id: z.ZodString;
1632
+ }, z.core.$strict>;
1633
+
1634
+ interface Plan$3 extends Omit<WritePreview, 'serverValidated'> {
1635
+ execute(): Promise<string[] | WriteResult>;
1636
+ }
1637
+ /** Official xdevplatform/docs creatives a9226e10 and campaign-management570f918c, checked2026-11-06. */
1638
+ declare class XScheduledService {
1639
+ private readonly entities;
1640
+ private readonly creatives;
1641
+ private readonly posts;
1642
+ constructor(entities: XAdsEntities, creatives: XCreativeService, posts: XPostService);
1643
+ private base;
1644
+ private author;
1645
+ private scoped;
1646
+ private paging;
1647
+ private raw;
1648
+ private promotionPage;
1649
+ private associations;
1650
+ get(account: string, user: string, id: string): Promise<{
1651
+ associations: {
1652
+ id: string;
1653
+ line_item_id: string;
1654
+ scheduled_tweet_id: string;
1655
+ tweet_id: string | null;
1656
+ deleted: boolean;
1657
+ account_id?: string | undefined;
1658
+ }[];
1659
+ snapshot_hash: string;
1660
+ id: string;
1661
+ user_id: string;
1662
+ name: string | null;
1663
+ text: string;
1664
+ scheduled_status: string;
1665
+ nullcast: boolean;
1666
+ scheduled_at: string;
1667
+ card_uri: string | null;
1668
+ media_keys: string[];
1669
+ tweet_id: string | null;
1670
+ account_id?: string | undefined;
1671
+ completed_at?: string | null | undefined;
1672
+ }>;
1673
+ private mutable;
1674
+ private schedule;
1675
+ private visualMedia;
1676
+ list(value: z.input<typeof scheduledList>): Promise<{
1677
+ notes: string[];
1678
+ next_cursor?: string | undefined;
1679
+ truncated: boolean;
1680
+ account_id: string;
1681
+ items: {
1682
+ id: string;
1683
+ user_id: string;
1684
+ name: string | null;
1685
+ text: string;
1686
+ scheduled_status: string;
1687
+ nullcast: boolean;
1688
+ scheduled_at: string;
1689
+ card_uri: string | null;
1690
+ media_keys: string[];
1691
+ tweet_id: string | null;
1692
+ account_id?: string | undefined;
1693
+ completed_at?: string | null | undefined;
1694
+ }[];
1695
+ creatives: {
1696
+ id: string;
1697
+ provider: string;
1698
+ account_id: string;
1699
+ name: string;
1700
+ type: string;
1701
+ headlines: string[];
1702
+ descriptions: string[];
1703
+ landing_urls: string[];
1704
+ media: {
1705
+ type: "image" | "video" | "audio";
1706
+ url: string;
1707
+ alt?: string | undefined;
1708
+ poster_url?: string | undefined;
1709
+ open_url?: string | undefined;
1710
+ }[];
1711
+ actions: {
1712
+ label: string;
1713
+ tool: string;
1714
+ arguments: Record<string, unknown>;
1715
+ fields: {
1716
+ key: string;
1717
+ label: string;
1718
+ type: "text" | "text_list" | "url_list" | "select";
1719
+ value: string | string[];
1720
+ options?: {
1721
+ label: string;
1722
+ value: string;
1723
+ }[] | undefined;
1724
+ max_length?: number | undefined;
1725
+ }[];
1726
+ }[];
1727
+ status?: string | undefined;
1728
+ campaign_id?: string | undefined;
1729
+ ad_group_id?: string | undefined;
1730
+ }[];
1731
+ }>;
1732
+ creationContext(account: string, value: z.input<typeof scheduledFields>): Promise<{
1733
+ context_hash: string;
1734
+ request: {
1735
+ as_user_id: string;
1736
+ scheduled_at: string;
1737
+ text?: string | undefined;
1738
+ name?: string | undefined;
1739
+ media_keys?: string[] | undefined;
1740
+ card_uri?: string | undefined;
1741
+ };
1742
+ nullcast: boolean;
1743
+ ad_association_created: boolean;
1744
+ notes: string[];
1745
+ }>;
1746
+ promotions(value: z.input<typeof scheduledPromotionList>): Promise<{
1747
+ notes?: string[] | undefined;
1748
+ next_cursor?: string | undefined;
1749
+ truncated: boolean;
1750
+ account_id: string;
1751
+ line_item_id: string;
1752
+ items: {
1753
+ id: string;
1754
+ line_item_id: string;
1755
+ scheduled_tweet_id: string;
1756
+ tweet_id: string | null;
1757
+ deleted: boolean;
1758
+ account_id?: string | undefined;
1759
+ }[];
1760
+ records: {
1761
+ id: string;
1762
+ line_item_id: string;
1763
+ scheduled_tweet_id: string;
1764
+ tweet_id: string | null;
1765
+ deleted: boolean;
1766
+ account_id?: string | undefined;
1767
+ }[];
1768
+ }>;
1769
+ getPromotion(account: string, id: string): Promise<{
1770
+ source: {
1771
+ id: string;
1772
+ user_id: string;
1773
+ name: string | null;
1774
+ text: string;
1775
+ scheduled_status: string;
1776
+ nullcast: boolean;
1777
+ scheduled_at: string;
1778
+ card_uri: string | null;
1779
+ media_keys: string[];
1780
+ tweet_id: string | null;
1781
+ account_id?: string | undefined;
1782
+ completed_at?: string | null | undefined;
1783
+ } | null;
1784
+ parent: {
1785
+ line: {
1786
+ [k: string]: unknown;
1787
+ };
1788
+ campaign: {
1789
+ id: string;
1790
+ name: string;
1791
+ currency: string;
1792
+ funding_instrument_id: string;
1793
+ entity_status: string;
1794
+ deleted: boolean;
1795
+ budget_optimization: string;
1796
+ daily_budget_amount_local_micro: number | null;
1797
+ total_budget_amount_local_micro: number | null;
1798
+ };
1799
+ };
1800
+ context_hash: string;
1801
+ id: string;
1802
+ line_item_id: string;
1803
+ scheduled_tweet_id: string;
1804
+ tweet_id: string | null;
1805
+ deleted: boolean;
1806
+ account_id?: string | undefined;
1807
+ }>;
1808
+ promotionContext(account: string, value: z.input<typeof scheduledPromotionSelection>): Promise<{
1809
+ context_hash: string;
1810
+ post: {
1811
+ associations: {
1812
+ id: string;
1813
+ line_item_id: string;
1814
+ scheduled_tweet_id: string;
1815
+ tweet_id: string | null;
1816
+ deleted: boolean;
1817
+ account_id?: string | undefined;
1818
+ }[];
1819
+ snapshot_hash: string;
1820
+ id: string;
1821
+ user_id: string;
1822
+ name: string | null;
1823
+ text: string;
1824
+ scheduled_status: string;
1825
+ nullcast: boolean;
1826
+ scheduled_at: string;
1827
+ card_uri: string | null;
1828
+ media_keys: string[];
1829
+ tweet_id: string | null;
1830
+ account_id?: string | undefined;
1831
+ completed_at?: string | null | undefined;
1832
+ };
1833
+ parent: {
1834
+ line: {
1835
+ [k: string]: unknown;
1836
+ };
1837
+ campaign: {
1838
+ id: string;
1839
+ name: string;
1840
+ currency: string;
1841
+ funding_instrument_id: string;
1842
+ entity_status: string;
1843
+ deleted: boolean;
1844
+ budget_optimization: string;
1845
+ daily_budget_amount_local_micro: number | null;
1846
+ total_budget_amount_local_micro: number | null;
1847
+ };
1848
+ };
1849
+ existing: {
1850
+ id: string;
1851
+ line_item_id: string;
1852
+ scheduled_tweet_id: string;
1853
+ tweet_id: string | null;
1854
+ deleted: boolean;
1855
+ account_id?: string | undefined;
1856
+ }[];
1857
+ notes: string[];
1858
+ }>;
1859
+ private unconfirmed;
1860
+ plan(op: WriteOperation, guard: WriteGuard): Promise<Plan$3>;
1861
+ }
1862
+
1863
+ declare const accountMediaList: z.ZodObject<{
1864
+ creative_types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1865
+ PREROLL: "PREROLL";
1866
+ BANNER: "BANNER";
1867
+ BANNER_TABLET: "BANNER_TABLET";
1868
+ INTERSTITIAL: "INTERSTITIAL";
1869
+ INTERSTITIAL_LANDSCAPE: "INTERSTITIAL_LANDSCAPE";
1870
+ INTERSTITIAL_LANDSCAPE_TABLET: "INTERSTITIAL_LANDSCAPE_TABLET";
1871
+ INTERSTITIAL_TABLET: "INTERSTITIAL_TABLET";
1872
+ MEDIUM_RECTANGLE: "MEDIUM_RECTANGLE";
1873
+ VAST_PREROLL: "VAST_PREROLL";
1874
+ }>>>;
1875
+ count: z.ZodDefault<z.ZodNumber>;
1876
+ cursor: z.ZodOptional<z.ZodString>;
1877
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
1878
+ account_id: z.ZodString;
1879
+ }, z.core.$strict>;
1880
+ declare const directMediaList: z.ZodObject<{
1881
+ include_media: z.ZodDefault<z.ZodBoolean>;
1882
+ count: z.ZodDefault<z.ZodNumber>;
1883
+ cursor: z.ZodOptional<z.ZodString>;
1884
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
1885
+ account_id: z.ZodString;
1886
+ line_item_id: z.ZodString;
1887
+ }, z.core.$strict>;
1888
+ declare const nativeAccountMedia: z.ZodObject<{
1889
+ id: z.ZodString;
1890
+ creative_type: z.ZodString;
1891
+ video_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1892
+ media_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1893
+ deleted: z.ZodBoolean;
1894
+ account_id: z.ZodOptional<z.ZodString>;
1895
+ }, z.core.$loose>;
1896
+ declare const directMediaSelection: z.ZodObject<{
1897
+ line_item_id: z.ZodString;
1898
+ account_media_id: z.ZodString;
1899
+ landing_url: z.ZodOptional<z.ZodString>;
1900
+ }, z.core.$strict>;
1901
+
1902
+ type Asset = z.infer<typeof nativeAccountMedia>;
1903
+ type Plan$2 = Omit<WritePreview, 'serverValidated'> & {
1904
+ execute(): Promise<string[]>;
1905
+ };
1906
+ /** Official X v12 account_media/media_creatives contracts refreshed2026-11-06. */
1907
+ declare class XDirectMediaService {
1908
+ private readonly entities;
1909
+ private readonly posts;
1910
+ constructor(entities: XAdsEntities, posts: XPostService);
1911
+ private base;
1912
+ private scope;
1913
+ private paging;
1914
+ private visual;
1915
+ assetCard(account: string, asset: Asset): Creative;
1916
+ getAsset(account: string, id: string): Promise<{
1917
+ configuration_hash: string;
1918
+ id: string;
1919
+ creative_type: string;
1920
+ deleted: boolean;
1921
+ video_id?: string | null | undefined;
1922
+ media_url?: string | null | undefined;
1923
+ account_id?: string | undefined;
1924
+ }>;
1925
+ assets(raw: z.input<typeof accountMediaList>): Promise<{
1926
+ notes: string[];
1927
+ next_cursor?: string | undefined;
1928
+ truncated: boolean;
1929
+ items: {
1930
+ [x: string]: unknown;
1931
+ id: string;
1932
+ creative_type: string;
1933
+ deleted: boolean;
1934
+ video_id?: string | null | undefined;
1935
+ media_url?: string | null | undefined;
1936
+ account_id?: string | undefined;
1937
+ }[];
1938
+ creatives: {
1939
+ id: string;
1940
+ provider: string;
1941
+ account_id: string;
1942
+ name: string;
1943
+ type: string;
1944
+ headlines: string[];
1945
+ descriptions: string[];
1946
+ landing_urls: string[];
1947
+ media: {
1948
+ type: "image" | "video" | "audio";
1949
+ url: string;
1950
+ alt?: string | undefined;
1951
+ poster_url?: string | undefined;
1952
+ open_url?: string | undefined;
1953
+ }[];
1954
+ actions: {
1955
+ label: string;
1956
+ tool: string;
1957
+ arguments: Record<string, unknown>;
1958
+ fields: {
1959
+ key: string;
1960
+ label: string;
1961
+ type: "text" | "text_list" | "url_list" | "select";
1962
+ value: string | string[];
1963
+ options?: {
1964
+ label: string;
1965
+ value: string;
1966
+ }[] | undefined;
1967
+ max_length?: number | undefined;
1968
+ }[];
1969
+ }[];
1970
+ status?: string | undefined;
1971
+ campaign_id?: string | undefined;
1972
+ ad_group_id?: string | undefined;
1973
+ }[];
1974
+ }>;
1975
+ private page;
1976
+ private existing;
1977
+ private associationHash;
1978
+ get(account: string, id: string): Promise<{
1979
+ parent: {
1980
+ line: {
1981
+ [k: string]: unknown;
1982
+ };
1983
+ campaign: {
1984
+ id: string;
1985
+ name: string;
1986
+ currency: string;
1987
+ funding_instrument_id: string;
1988
+ entity_status: string;
1989
+ deleted: boolean;
1990
+ budget_optimization: string;
1991
+ daily_budget_amount_local_micro: number | null;
1992
+ total_budget_amount_local_micro: number | null;
1993
+ };
1994
+ };
1995
+ context_hash: string;
1996
+ id: string;
1997
+ line_item_id: string;
1998
+ account_media_id: string;
1999
+ entity_status: string;
2000
+ deleted: boolean;
2001
+ creative_type: string;
2002
+ landing_url?: string | null | undefined;
2003
+ approval_status?: string | undefined;
2004
+ account_id?: string | undefined;
2005
+ }>;
2006
+ context(account: string, raw: z.input<typeof directMediaSelection>): Promise<{
2007
+ context_hash: string;
2008
+ creatives: {
2009
+ id: string;
2010
+ provider: string;
2011
+ account_id: string;
2012
+ name: string;
2013
+ type: string;
2014
+ headlines: string[];
2015
+ descriptions: string[];
2016
+ landing_urls: string[];
2017
+ media: {
2018
+ type: "image" | "video" | "audio";
2019
+ url: string;
2020
+ alt?: string | undefined;
2021
+ poster_url?: string | undefined;
2022
+ open_url?: string | undefined;
2023
+ }[];
2024
+ actions: {
2025
+ label: string;
2026
+ tool: string;
2027
+ arguments: Record<string, unknown>;
2028
+ fields: {
2029
+ key: string;
2030
+ label: string;
2031
+ type: "text" | "text_list" | "url_list" | "select";
2032
+ value: string | string[];
2033
+ options?: {
2034
+ label: string;
2035
+ value: string;
2036
+ }[] | undefined;
2037
+ max_length?: number | undefined;
2038
+ }[];
2039
+ }[];
2040
+ status?: string | undefined;
2041
+ campaign_id?: string | undefined;
2042
+ ad_group_id?: string | undefined;
2043
+ }[];
2044
+ truncated: boolean;
2045
+ notes: string[];
2046
+ account_id: string;
2047
+ request: {
2048
+ line_item_id: string;
2049
+ account_media_id: string;
2050
+ landing_url?: string | undefined;
2051
+ };
2052
+ source: {
2053
+ [k: string]: unknown;
2054
+ };
2055
+ parent: {
2056
+ line: {
2057
+ [k: string]: unknown;
2058
+ };
2059
+ campaign: {
2060
+ id: string;
2061
+ name: string;
2062
+ currency: string;
2063
+ funding_instrument_id: string;
2064
+ entity_status: string;
2065
+ deleted: boolean;
2066
+ budget_optimization: string;
2067
+ daily_budget_amount_local_micro: number | null;
2068
+ total_budget_amount_local_micro: number | null;
2069
+ };
2070
+ };
2071
+ existing: {
2072
+ id: string;
2073
+ line_item_id: string;
2074
+ account_media_id: string;
2075
+ creative_type: string;
2076
+ landing_url: string | null;
2077
+ entity_status: string;
2078
+ deleted: boolean;
2079
+ }[];
2080
+ }>;
2081
+ list(raw: z.input<typeof directMediaList>): Promise<{
2082
+ notes: string[];
2083
+ next_cursor?: string | undefined;
2084
+ truncated: boolean;
2085
+ items: {
2086
+ context_hash: string;
2087
+ id: string;
2088
+ line_item_id: string;
2089
+ account_media_id: string;
2090
+ entity_status: string;
2091
+ deleted: boolean;
2092
+ creative_type: string;
2093
+ landing_url?: string | null | undefined;
2094
+ approval_status?: string | undefined;
2095
+ account_id?: string | undefined;
2096
+ }[];
2097
+ parent: {
2098
+ line: {
2099
+ [k: string]: unknown;
2100
+ };
2101
+ campaign: {
2102
+ id: string;
2103
+ name: string;
2104
+ currency: string;
2105
+ funding_instrument_id: string;
2106
+ entity_status: string;
2107
+ deleted: boolean;
2108
+ budget_optimization: string;
2109
+ daily_budget_amount_local_micro: number | null;
2110
+ total_budget_amount_local_micro: number | null;
2111
+ };
2112
+ };
2113
+ creatives: {
2114
+ id: string;
2115
+ provider: string;
2116
+ account_id: string;
2117
+ name: string;
2118
+ type: string;
2119
+ headlines: string[];
2120
+ descriptions: string[];
2121
+ landing_urls: string[];
2122
+ media: {
2123
+ type: "image" | "video" | "audio";
2124
+ url: string;
2125
+ alt?: string | undefined;
2126
+ poster_url?: string | undefined;
2127
+ open_url?: string | undefined;
2128
+ }[];
2129
+ actions: {
2130
+ label: string;
2131
+ tool: string;
2132
+ arguments: Record<string, unknown>;
2133
+ fields: {
2134
+ key: string;
2135
+ label: string;
2136
+ type: "text" | "text_list" | "url_list" | "select";
2137
+ value: string | string[];
2138
+ options?: {
2139
+ label: string;
2140
+ value: string;
2141
+ }[] | undefined;
2142
+ max_length?: number | undefined;
2143
+ }[];
2144
+ }[];
2145
+ status?: string | undefined;
2146
+ campaign_id?: string | undefined;
2147
+ ad_group_id?: string | undefined;
2148
+ }[];
2149
+ warnings: string[];
2150
+ }>;
2151
+ private unconfirmed;
2152
+ plan(op: WriteOperation, guard: WriteGuard): Promise<Plan$2>;
2153
+ }
2154
+
2155
+ declare const prerollCtaList: z.ZodObject<{
2156
+ account_id: z.ZodString;
2157
+ line_item_id: z.ZodOptional<z.ZodString>;
2158
+ count: z.ZodDefault<z.ZodNumber>;
2159
+ cursor: z.ZodOptional<z.ZodString>;
2160
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
2161
+ }, z.core.$strict>;
2162
+ declare const prerollCtaSelection: z.ZodObject<{
2163
+ line_item_id: z.ZodString;
2164
+ call_to_action: z.ZodEnum<{
2165
+ SHOP: "SHOP";
2166
+ VISIT_SITE: "VISIT_SITE";
2167
+ WATCH_NOW: "WATCH_NOW";
2168
+ GO_TO: "GO_TO";
2169
+ SEE_MORE: "SEE_MORE";
2170
+ }>;
2171
+ call_to_action_url: z.ZodString;
2172
+ }, z.core.$strict>;
2173
+
2174
+ type Plan$1 = Omit<WritePreview, 'serverValidated'> & {
2175
+ execute(): Promise<string[]>;
2176
+ };
2177
+ /** Official X v12 preroll CTA GET/POST/PUT/DELETE contract refreshed2026-11-06. */
2178
+ declare class XPrerollCtaService {
2179
+ private readonly entities;
2180
+ private readonly posts;
2181
+ constructor(entities: XAdsEntities, posts: XPostService);
2182
+ private base;
2183
+ private scope;
2184
+ private paging;
2185
+ private page;
2186
+ private inventory;
2187
+ private contextHash;
2188
+ private card;
2189
+ private canAuthor;
2190
+ private eligible;
2191
+ context(account: string, raw: z.input<typeof prerollCtaSelection>): Promise<{
2192
+ context_hash: string;
2193
+ cta_options: {
2194
+ value: "SHOP" | "VISIT_SITE" | "WATCH_NOW" | "GO_TO" | "SEE_MORE";
2195
+ label: string;
2196
+ }[];
2197
+ notes: string[];
2198
+ account_id: string;
2199
+ request: {
2200
+ line_item_id: string;
2201
+ call_to_action: "SHOP" | "VISIT_SITE" | "WATCH_NOW" | "GO_TO" | "SEE_MORE";
2202
+ call_to_action_url: string;
2203
+ };
2204
+ parent: {
2205
+ line: {
2206
+ [k: string]: unknown;
2207
+ };
2208
+ campaign: {
2209
+ id: string;
2210
+ name: string;
2211
+ currency: string;
2212
+ funding_instrument_id: string;
2213
+ entity_status: string;
2214
+ deleted: boolean;
2215
+ budget_optimization: string;
2216
+ daily_budget_amount_local_micro: number | null;
2217
+ total_budget_amount_local_micro: number | null;
2218
+ };
2219
+ };
2220
+ active_ctas: {
2221
+ id: string;
2222
+ line_item_id: string;
2223
+ call_to_action: string;
2224
+ call_to_action_url: string;
2225
+ deleted: boolean;
2226
+ }[];
2227
+ }>;
2228
+ get(account: string, id: string): Promise<{
2229
+ parent: {
2230
+ line: {
2231
+ [k: string]: unknown;
2232
+ };
2233
+ campaign: {
2234
+ id: string;
2235
+ name: string;
2236
+ currency: string;
2237
+ funding_instrument_id: string;
2238
+ entity_status: string;
2239
+ deleted: boolean;
2240
+ budget_optimization: string;
2241
+ daily_budget_amount_local_micro: number | null;
2242
+ total_budget_amount_local_micro: number | null;
2243
+ };
2244
+ };
2245
+ active_ctas: {
2246
+ id: string;
2247
+ line_item_id: string;
2248
+ call_to_action: string;
2249
+ call_to_action_url: string;
2250
+ deleted: boolean;
2251
+ }[];
2252
+ context_hash: string;
2253
+ creatives: {
2254
+ id: string;
2255
+ provider: string;
2256
+ account_id: string;
2257
+ name: string;
2258
+ type: string;
2259
+ headlines: string[];
2260
+ descriptions: string[];
2261
+ landing_urls: string[];
2262
+ media: {
2263
+ type: "image" | "video" | "audio";
2264
+ url: string;
2265
+ alt?: string | undefined;
2266
+ poster_url?: string | undefined;
2267
+ open_url?: string | undefined;
2268
+ }[];
2269
+ actions: {
2270
+ label: string;
2271
+ tool: string;
2272
+ arguments: Record<string, unknown>;
2273
+ fields: {
2274
+ key: string;
2275
+ label: string;
2276
+ type: "text" | "text_list" | "url_list" | "select";
2277
+ value: string | string[];
2278
+ options?: {
2279
+ label: string;
2280
+ value: string;
2281
+ }[] | undefined;
2282
+ max_length?: number | undefined;
2283
+ }[];
2284
+ }[];
2285
+ status?: string | undefined;
2286
+ campaign_id?: string | undefined;
2287
+ ad_group_id?: string | undefined;
2288
+ }[];
2289
+ truncated: boolean;
2290
+ notes: string[];
2291
+ id: string;
2292
+ line_item_id: string;
2293
+ call_to_action: string;
2294
+ call_to_action_url: string;
2295
+ deleted: boolean;
2296
+ account_id?: string | undefined;
2297
+ }>;
2298
+ list(raw: z.input<typeof prerollCtaList>): Promise<{
2299
+ notes: string[];
2300
+ next_cursor?: string | undefined;
2301
+ truncated: boolean;
2302
+ creatives: {
2303
+ id: string;
2304
+ provider: string;
2305
+ account_id: string;
2306
+ name: string;
2307
+ type: string;
2308
+ headlines: string[];
2309
+ descriptions: string[];
2310
+ landing_urls: string[];
2311
+ media: {
2312
+ type: "image" | "video" | "audio";
2313
+ url: string;
2314
+ alt?: string | undefined;
2315
+ poster_url?: string | undefined;
2316
+ open_url?: string | undefined;
2317
+ }[];
2318
+ actions: {
2319
+ label: string;
2320
+ tool: string;
2321
+ arguments: Record<string, unknown>;
2322
+ fields: {
2323
+ key: string;
2324
+ label: string;
2325
+ type: "text" | "text_list" | "url_list" | "select";
2326
+ value: string | string[];
2327
+ options?: {
2328
+ label: string;
2329
+ value: string;
2330
+ }[] | undefined;
2331
+ max_length?: number | undefined;
2332
+ }[];
2333
+ }[];
2334
+ status?: string | undefined;
2335
+ campaign_id?: string | undefined;
2336
+ ad_group_id?: string | undefined;
2337
+ }[];
2338
+ warnings: string[];
2339
+ parent?: {
2340
+ line: {
2341
+ [k: string]: unknown;
2342
+ };
2343
+ campaign: {
2344
+ id: string;
2345
+ name: string;
2346
+ currency: string;
2347
+ funding_instrument_id: string;
2348
+ entity_status: string;
2349
+ deleted: boolean;
2350
+ budget_optimization: string;
2351
+ daily_budget_amount_local_micro: number | null;
2352
+ total_budget_amount_local_micro: number | null;
2353
+ };
2354
+ } | undefined;
2355
+ items: {
2356
+ context_hash?: string | undefined;
2357
+ id: string;
2358
+ line_item_id: string;
2359
+ call_to_action: string;
2360
+ call_to_action_url: string;
2361
+ deleted: boolean;
2362
+ account_id?: string | undefined;
2363
+ }[];
2364
+ }>;
2365
+ private unconfirmed;
2366
+ plan(op: WriteOperation, guard: WriteGuard): Promise<Plan$1>;
2367
+ }
2368
+
2369
+ /** Native v12 Account Media DELETE and account-wide media_creatives GET, refreshed2026-11-06. */
2370
+ declare class XAccountMediaService {
2371
+ private readonly entities;
2372
+ private readonly media;
2373
+ constructor(entities: XAdsEntities, media: XDirectMediaService);
2374
+ private references;
2375
+ private context;
2376
+ usage(account: string, id: string, options?: {
2377
+ reference_offset?: number;
2378
+ reference_limit?: number;
2379
+ expected_context_hash?: string;
2380
+ }): Promise<{
2381
+ next_reference_offset?: number | undefined;
2382
+ references: {
2383
+ id: string;
2384
+ line_item_id: string;
2385
+ account_media_id: string;
2386
+ creative_type: string;
2387
+ landing_url: string | null;
2388
+ entity_status: string;
2389
+ deleted: boolean;
2390
+ }[];
2391
+ reference_total: number;
2392
+ reference_offset: number;
2393
+ usage_complete: boolean;
2394
+ references_truncated: boolean;
2395
+ asset: {
2396
+ configuration_hash: string;
2397
+ id: string;
2398
+ creative_type: string;
2399
+ deleted: boolean;
2400
+ video_id?: string | null | undefined;
2401
+ media_url?: string | null | undefined;
2402
+ account_id?: string | undefined;
2403
+ };
2404
+ non_deleted_references: number;
2405
+ can_delete: boolean;
2406
+ context_hash: string;
2407
+ scanned_associations: number;
2408
+ truncated: boolean;
2409
+ creatives: {
2410
+ id: string;
2411
+ provider: string;
2412
+ account_id: string;
2413
+ name: string;
2414
+ type: string;
2415
+ headlines: string[];
2416
+ descriptions: string[];
2417
+ landing_urls: string[];
2418
+ media: {
2419
+ type: "image" | "video" | "audio";
2420
+ url: string;
2421
+ alt?: string | undefined;
2422
+ poster_url?: string | undefined;
2423
+ open_url?: string | undefined;
2424
+ }[];
2425
+ actions: {
2426
+ label: string;
2427
+ tool: string;
2428
+ arguments: Record<string, unknown>;
2429
+ fields: {
2430
+ key: string;
2431
+ label: string;
2432
+ type: "text" | "text_list" | "url_list" | "select";
2433
+ value: string | string[];
2434
+ options?: {
2435
+ label: string;
2436
+ value: string;
2437
+ }[] | undefined;
2438
+ max_length?: number | undefined;
2439
+ }[];
2440
+ }[];
2441
+ status?: string | undefined;
2442
+ campaign_id?: string | undefined;
2443
+ ad_group_id?: string | undefined;
2444
+ }[];
2445
+ notes: string[];
2446
+ }>;
2447
+ plan(op: WriteOperation): Promise<Omit<WritePreview, 'serverValidated'> & {
2448
+ execute(): Promise<string[]>;
2449
+ }>;
2450
+ }
2451
+
2452
+ declare const promotedAccountList: z.ZodObject<{
2453
+ account_id: z.ZodString;
2454
+ line_item_id: z.ZodString;
2455
+ count: z.ZodDefault<z.ZodNumber>;
2456
+ cursor: z.ZodOptional<z.ZodString>;
2457
+ with_deleted: z.ZodDefault<z.ZodBoolean>;
2458
+ }, z.core.$strict>;
2459
+ declare const promotedAccountSelection: z.ZodObject<{
2460
+ line_item_id: z.ZodString;
2461
+ user_id: z.ZodString;
2462
+ }, z.core.$strict>;
2463
+
2464
+ type Plan = Omit<WritePreview, 'serverValidated'> & {
2465
+ execute(): Promise<string[]>;
2466
+ };
2467
+ /** Official X v12 promoted_accounts reference, docs09e643bc, checked2026-11-06. */
2468
+ declare class XPromotedAccountService {
2469
+ private readonly entities;
2470
+ private readonly creatives;
2471
+ private readonly posts;
2472
+ constructor(entities: XAdsEntities, creatives: XCreativeService, posts: XPostService);
2473
+ private base;
2474
+ private scope;
2475
+ private paging;
2476
+ private page;
2477
+ private existing;
2478
+ private associationHash;
2479
+ get(account: string, id: string): Promise<{
2480
+ parent: {
2481
+ line: {
2482
+ [k: string]: unknown;
2483
+ };
2484
+ campaign: {
2485
+ id: string;
2486
+ name: string;
2487
+ currency: string;
2488
+ funding_instrument_id: string;
2489
+ entity_status: string;
2490
+ deleted: boolean;
2491
+ budget_optimization: string;
2492
+ daily_budget_amount_local_micro: number | null;
2493
+ total_budget_amount_local_micro: number | null;
2494
+ };
2495
+ };
2496
+ context_hash: string;
2497
+ id: string;
2498
+ line_item_id: string;
2499
+ entity_status: string;
2500
+ deleted: boolean;
2501
+ user_id: string;
2502
+ account_id?: string | undefined;
2503
+ approval_status?: string | undefined;
2504
+ }>;
2505
+ private card;
2506
+ list(raw: z.input<typeof promotedAccountList>): Promise<{
2507
+ warnings: string[];
2508
+ notes?: string[] | undefined;
2509
+ next_cursor?: string | undefined;
2510
+ truncated: boolean;
2511
+ items: {
2512
+ context_hash: string;
2513
+ id: string;
2514
+ line_item_id: string;
2515
+ entity_status: string;
2516
+ deleted: boolean;
2517
+ user_id: string;
2518
+ account_id?: string | undefined;
2519
+ approval_status?: string | undefined;
2520
+ }[];
2521
+ parent: {
2522
+ line: {
2523
+ [k: string]: unknown;
2524
+ };
2525
+ campaign: {
2526
+ id: string;
2527
+ name: string;
2528
+ currency: string;
2529
+ funding_instrument_id: string;
2530
+ entity_status: string;
2531
+ deleted: boolean;
2532
+ budget_optimization: string;
2533
+ daily_budget_amount_local_micro: number | null;
2534
+ total_budget_amount_local_micro: number | null;
2535
+ };
2536
+ };
2537
+ creatives: {
2538
+ id: string;
2539
+ provider: string;
2540
+ account_id: string;
2541
+ name: string;
2542
+ type: string;
2543
+ headlines: string[];
2544
+ descriptions: string[];
2545
+ landing_urls: string[];
2546
+ media: {
2547
+ type: "image" | "video" | "audio";
2548
+ url: string;
2549
+ alt?: string | undefined;
2550
+ poster_url?: string | undefined;
2551
+ open_url?: string | undefined;
2552
+ }[];
2553
+ actions: {
2554
+ label: string;
2555
+ tool: string;
2556
+ arguments: Record<string, unknown>;
2557
+ fields: {
2558
+ key: string;
2559
+ label: string;
2560
+ type: "text" | "text_list" | "url_list" | "select";
2561
+ value: string | string[];
2562
+ options?: {
2563
+ label: string;
2564
+ value: string;
2565
+ }[] | undefined;
2566
+ max_length?: number | undefined;
2567
+ }[];
2568
+ }[];
2569
+ status?: string | undefined;
2570
+ campaign_id?: string | undefined;
2571
+ ad_group_id?: string | undefined;
2572
+ }[];
2573
+ }>;
2574
+ context(account: string, raw: z.input<typeof promotedAccountSelection>): Promise<{
2575
+ context_hash: string;
2576
+ creatives: {
2577
+ id: string;
2578
+ provider: string;
2579
+ account_id: string;
2580
+ campaign_id: string;
2581
+ ad_group_id: string;
2582
+ name: string;
2583
+ type: string;
2584
+ status: string;
2585
+ headlines: never[];
2586
+ descriptions: never[];
2587
+ landing_urls: string[];
2588
+ media: never[];
2589
+ actions: never[];
2590
+ }[];
2591
+ truncated: boolean;
2592
+ notes: string[];
2593
+ account_id: string;
2594
+ request: {
2595
+ line_item_id: string;
2596
+ user_id: string;
2597
+ };
2598
+ user: {
2599
+ id: string;
2600
+ user_id: string;
2601
+ promotable_user_type: string;
2602
+ deleted: boolean;
2603
+ };
2604
+ parent: {
2605
+ line: {
2606
+ [k: string]: unknown;
2607
+ };
2608
+ campaign: {
2609
+ id: string;
2610
+ name: string;
2611
+ currency: string;
2612
+ funding_instrument_id: string;
2613
+ entity_status: string;
2614
+ deleted: boolean;
2615
+ budget_optimization: string;
2616
+ daily_budget_amount_local_micro: number | null;
2617
+ total_budget_amount_local_micro: number | null;
2618
+ };
2619
+ };
2620
+ existing: {
2621
+ id: string;
2622
+ line_item_id: string;
2623
+ user_id: string;
2624
+ entity_status: string;
2625
+ deleted: boolean;
2626
+ }[];
2627
+ }>;
2628
+ private unconfirmed;
2629
+ plan(op: WriteOperation, guard: WriteGuard): Promise<Plan>;
2630
+ }
2631
+
152
2632
  declare class XAdsProvider extends XAdsEntities implements AdProvider {
153
2633
  readonly id = "x";
154
2634
  private readonly analytics;
155
- constructor(client: XAdsClient, analytics?: XAdsAnalytics);
2635
+ private readonly management;
2636
+ readonly targeting: XTargetingService;
2637
+ readonly creatives: XCreativeService;
2638
+ readonly mediaUploads: XMediaService;
2639
+ readonly cards: XCardService;
2640
+ readonly audiences: XAudienceService;
2641
+ readonly measurement: XMeasurementService;
2642
+ readonly posts: XPostService;
2643
+ readonly scheduled: XScheduledService;
2644
+ readonly directMedia: XDirectMediaService;
2645
+ readonly prerollCtas: XPrerollCtaService;
2646
+ readonly accountMedia: XAccountMediaService;
2647
+ readonly promotedAccounts: XPromotedAccountService;
2648
+ constructor(client: XAdsClient, analytics?: XAdsAnalytics, media?: MediaResolver);
156
2649
  capabilities(): {
157
2650
  serverDryRun: boolean;
158
2651
  };
159
2652
  standardActions(): StandardActions;
160
2653
  previewWrite(op: WriteOperation, guard: WriteGuard): Promise<WritePreview>;
161
2654
  applyWrite(op: WriteOperation, guard: WriteGuard): Promise<WriteResult>;
2655
+ private writePlan;
162
2656
  report(query: NormalizedQuery): Promise<Report>;
163
2657
  private reportEntities;
164
2658
  }