@adport/provider-tiktok 0.8.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,4 +1,5 @@
1
- import { AdProvider, ProviderCapabilities, StandardActions, Account, NormalizedQuery, Report, WriteOperation, WriteGuard, WritePreview, WriteResult, AnyToolDefinition, CredentialStore, ProviderModule } from '@adport/core';
1
+ import { MediaResolver, WriteOperation, WriteGuard, WritePreview, WriteResult, AdProvider, ProviderCapabilities, StandardActions, Account, NormalizedQuery, Report, AnyToolDefinition, CredentialStore, ProviderModule } from '@adport/core';
2
+ import { z } from 'zod';
2
3
 
3
4
  interface TikTokCredentials {
4
5
  /** Long-term access token (does not expire; revoked by the advertiser). */
@@ -20,14 +21,1447 @@ declare class TikTokClient {
20
21
  private readonly fetchImpl;
21
22
  readonly baseUrl: string;
22
23
  constructor(credentials: TikTokCredentials, fetchImpl?: typeof fetch);
23
- get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
24
+ get<T>(path: string, params?: Record<string, unknown>, options?: {
25
+ jsonContentType?: boolean;
26
+ }): Promise<T>;
24
27
  post<T>(path: string, body: Record<string, unknown>): Promise<T>;
28
+ postMultipart<T>(path: string, form: FormData): Promise<T>;
29
+ /** Account/file bindings are issued only after this credential accepts the native upload. */
30
+ audienceFileReceipt(value: Record<string, unknown>): string;
31
+ verifyAudienceFileReceipt(receipt: string): unknown;
32
+ private audienceReceiptMac;
25
33
  private send;
26
34
  }
27
35
 
36
+ type Row$3 = Record<string, unknown>;
37
+ type PageInfo = {
38
+ total_page?: number;
39
+ total_number?: number;
40
+ };
41
+ interface Page {
42
+ account_id: string;
43
+ page: number;
44
+ page_size: number;
45
+ }
46
+ interface Plan$d {
47
+ summary: string;
48
+ changes: string[];
49
+ coercions: string[];
50
+ budgetDeltas: WritePreview['budgetDeltas'];
51
+ execute: () => Promise<string[]>;
52
+ }
53
+ /** Contracts checked against TikTok-owned SDK f809c396 and v1.3 OpenAPI files. */
54
+ declare class TikTokCreativeService {
55
+ private readonly client;
56
+ private readonly media;
57
+ constructor(client: TikTokClient, media: MediaResolver);
58
+ read(path: string, input: {
59
+ account_id: string;
60
+ } & Row$3, post?: boolean): Promise<unknown>;
61
+ groups(input: Page & {
62
+ campaign_ids?: string[];
63
+ ad_group_ids?: string[];
64
+ }): Promise<{
65
+ ad_groups: Row$3[];
66
+ page_info: PageInfo | undefined;
67
+ truncated: boolean;
68
+ }>;
69
+ ads(input: Page & {
70
+ ad_group_ids?: string[];
71
+ ad_ids?: string[];
72
+ }): Promise<{
73
+ creatives: {
74
+ id: string;
75
+ provider: string;
76
+ account_id: string;
77
+ name: string;
78
+ type: string;
79
+ headlines: string[];
80
+ descriptions: string[];
81
+ landing_urls: string[];
82
+ media: {
83
+ type: "image" | "video" | "audio";
84
+ url: string;
85
+ alt?: string | undefined;
86
+ poster_url?: string | undefined;
87
+ open_url?: string | undefined;
88
+ }[];
89
+ actions: {
90
+ label: string;
91
+ tool: string;
92
+ arguments: Record<string, unknown>;
93
+ fields: {
94
+ key: string;
95
+ label: string;
96
+ type: "text" | "text_list" | "url_list" | "select";
97
+ value: string | string[];
98
+ options?: {
99
+ label: string;
100
+ value: string;
101
+ }[] | undefined;
102
+ max_length?: number | undefined;
103
+ }[];
104
+ }[];
105
+ status?: string | undefined;
106
+ campaign_id?: string | undefined;
107
+ ad_group_id?: string | undefined;
108
+ }[];
109
+ ads: Row$3[];
110
+ page_info: PageInfo | undefined;
111
+ truncated: boolean;
112
+ }>;
113
+ private owned;
114
+ plan(op: WriteOperation, guard: WriteGuard): Promise<Plan$d>;
115
+ private upload;
116
+ }
117
+
118
+ declare const savedAudienceList: z.ZodObject<{
119
+ account_id: z.ZodString;
120
+ saved_audience_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
+ page: z.ZodDefault<z.ZodNumber>;
122
+ page_size: z.ZodDefault<z.ZodNumber>;
123
+ }, z.core.$strip>;
124
+ type Plan$c = Omit<WritePreview, 'serverValidated'> & {
125
+ execute(): Promise<string[]>;
126
+ };
127
+ /** Wire contracts: TikTok-owned SDK/OpenAPI f809c396, dmp/saved_audience/{list,create,delete}. */
128
+ declare class TikTokAudienceService {
129
+ private readonly client;
130
+ constructor(client: TikTokClient);
131
+ list(raw: z.input<typeof savedAudienceList>): Promise<{
132
+ pagination_note?: string | undefined;
133
+ next_page?: number | undefined;
134
+ saved_audiences: {
135
+ snapshot_hash: string;
136
+ saved_audience_id: string;
137
+ saved_audience_name: string;
138
+ advertiser_id?: string | undefined;
139
+ }[];
140
+ complete: boolean | null;
141
+ truncated: boolean;
142
+ page_info?: {
143
+ [x: string]: unknown;
144
+ page: number;
145
+ page_size: number;
146
+ total_number?: number | undefined;
147
+ total_page?: number | undefined;
148
+ } | undefined;
149
+ }>;
150
+ get(account: string, audienceId: string): Promise<{
151
+ audience: {
152
+ snapshot_hash: string;
153
+ saved_audience_id: string;
154
+ saved_audience_name: string;
155
+ advertiser_id?: string | undefined;
156
+ };
157
+ }>;
158
+ plan(op: WriteOperation): Promise<Plan$c>;
159
+ }
160
+
161
+ type Plan$b = Omit<WritePreview, 'serverValidated'> & {
162
+ execute(): Promise<WriteResult>;
163
+ };
164
+ /** Official SDK f809c396 plus public v1.3 docs, refreshed 2026-11-06. */
165
+ declare class TikTokCustomAudiences {
166
+ private readonly client;
167
+ private readonly media;
168
+ constructor(client: TikTokClient, media: MediaResolver);
169
+ private mediaScope;
170
+ list(value: unknown): Promise<{
171
+ notes: string[];
172
+ pagination_note?: string | undefined;
173
+ next_page?: number | undefined;
174
+ list: {
175
+ audience_id: string;
176
+ name: string;
177
+ audience_type: string;
178
+ is_creator?: boolean | undefined;
179
+ shared?: boolean | undefined;
180
+ is_valid?: boolean | undefined;
181
+ is_expiring?: boolean | undefined;
182
+ expired_time?: string | undefined;
183
+ create_time?: string | undefined;
184
+ calculate_type?: string | null | undefined;
185
+ cover_num?: number | undefined;
186
+ }[];
187
+ page_info: {
188
+ page: number;
189
+ page_size: number;
190
+ total_page?: number | undefined;
191
+ total_number?: number | undefined;
192
+ } | undefined;
193
+ audiences: {
194
+ audience_id: string;
195
+ name: string;
196
+ audience_type: string;
197
+ is_creator?: boolean | undefined;
198
+ shared?: boolean | undefined;
199
+ is_valid?: boolean | undefined;
200
+ is_expiring?: boolean | undefined;
201
+ expired_time?: string | undefined;
202
+ create_time?: string | undefined;
203
+ calculate_type?: string | null | undefined;
204
+ cover_num?: number | undefined;
205
+ }[];
206
+ records: {
207
+ id: string;
208
+ name: string;
209
+ type: string;
210
+ available: boolean | undefined;
211
+ matched_users: number | undefined;
212
+ owner: boolean | undefined;
213
+ shared: boolean | undefined;
214
+ expiring: boolean | undefined;
215
+ }[];
216
+ complete: boolean | null;
217
+ truncated: boolean;
218
+ }>;
219
+ private details;
220
+ get(value: unknown): Promise<{
221
+ audience: {
222
+ native_status_message_present: boolean;
223
+ native_error_reported: boolean;
224
+ snapshot_hash: string;
225
+ audience_id: string;
226
+ name: string;
227
+ type: string;
228
+ owner_id?: string | undefined;
229
+ is_creator?: boolean | undefined;
230
+ shared?: boolean | undefined;
231
+ is_valid?: boolean | undefined;
232
+ is_expiring?: boolean | undefined;
233
+ expired_time?: string | undefined;
234
+ create_time?: string | undefined;
235
+ calculate_type?: string | null | undefined;
236
+ audience_sub_type?: string | undefined;
237
+ rule?: string | null | undefined;
238
+ is_auto_refresh?: boolean | undefined;
239
+ lookalike_spec?: z.core.util.JSONType | undefined;
240
+ cover_num?: number | undefined;
241
+ };
242
+ records: {
243
+ id: string;
244
+ name: string;
245
+ type: string;
246
+ available: boolean | undefined;
247
+ matched_users: number | undefined;
248
+ shared: boolean | undefined;
249
+ owner: boolean | undefined;
250
+ expires: string | undefined;
251
+ native_error_reported: boolean;
252
+ }[];
253
+ notes: string[];
254
+ }>;
255
+ inspect(account: string, ids: string[]): Promise<{
256
+ native_status_message_present: boolean;
257
+ native_error_reported: boolean;
258
+ snapshot_hash: string;
259
+ audience_id: string;
260
+ name: string;
261
+ type: string;
262
+ owner_id?: string | undefined;
263
+ is_creator?: boolean | undefined;
264
+ shared?: boolean | undefined;
265
+ is_valid?: boolean | undefined;
266
+ is_expiring?: boolean | undefined;
267
+ expired_time?: string | undefined;
268
+ create_time?: string | undefined;
269
+ calculate_type?: string | null | undefined;
270
+ audience_sub_type?: string | undefined;
271
+ rule?: string | null | undefined;
272
+ is_auto_refresh?: boolean | undefined;
273
+ lookalike_spec?: z.core.util.JSONType | undefined;
274
+ cover_num?: number | undefined;
275
+ }[]>;
276
+ private uploads;
277
+ private owned;
278
+ plan(op: WriteOperation): Promise<Plan$b>;
279
+ private uploadPlan;
280
+ private createPlan;
281
+ private deletePlan;
282
+ }
283
+
284
+ type Source = {
285
+ id: string;
286
+ name: string;
287
+ eligible: boolean;
288
+ configuration: Record<string, unknown>;
289
+ };
290
+ /** Native advertiser-scoped reads; no account/BC sharing or grant mutation. */
291
+ declare class TikTokAudienceSources {
292
+ private readonly client;
293
+ private readonly requireAdvertiser;
294
+ constructor(client: TikTokClient, requireAdvertiser: (account: string) => Promise<void>);
295
+ private get;
296
+ private account;
297
+ identities(value: unknown): Promise<{
298
+ notes: string[];
299
+ next_page?: number | undefined;
300
+ records: {
301
+ id: string;
302
+ name: string;
303
+ identity_id: string;
304
+ identity_type: string;
305
+ business_center: string | undefined;
306
+ availability: string | undefined;
307
+ }[];
308
+ complete: boolean | null;
309
+ truncated: boolean;
310
+ identity_list: {
311
+ identity_id: string;
312
+ identity_type: string;
313
+ identity_authorized_bc_id?: string | undefined;
314
+ display_name?: string | undefined;
315
+ username?: string | undefined;
316
+ available_status?: string | undefined;
317
+ }[];
318
+ page_info?: {
319
+ page: number;
320
+ page_size: number;
321
+ total_page?: number | undefined;
322
+ total_number?: number | undefined;
323
+ } | undefined;
324
+ }>;
325
+ private identity;
326
+ list(value: unknown): Promise<{
327
+ notes: string[];
328
+ next_cursor?: string | undefined;
329
+ sources: Source[];
330
+ records: {
331
+ id: string;
332
+ name: string;
333
+ type: "APP" | "BUSINESS_ACCOUNT" | "ENGAGEMENT" | "ENGAGEMENT_LIVE_VIDEO" | "ENGAGEMENT_ORGANIC_VIDEO" | "LEAD_GENERATION" | "OFFLINE" | "PIXEL" | "TIKTOK_SHOP";
334
+ eligible: boolean;
335
+ }[];
336
+ complete: boolean | null;
337
+ truncated: boolean;
338
+ }>;
339
+ private unique;
340
+ context(value: unknown): Promise<{
341
+ context_hash: string;
342
+ sources: Source[];
343
+ records: {
344
+ id: string;
345
+ name: string;
346
+ eligible: boolean;
347
+ }[];
348
+ selected_sources_verified: boolean;
349
+ notes: string[];
350
+ }>;
351
+ }
352
+
353
+ type Plan$a = Omit<WritePreview, 'serverValidated'> & {
354
+ execute(): Promise<WriteResult>;
355
+ };
356
+ declare class TikTokAudienceAuthoring {
357
+ private readonly client;
358
+ private readonly audiences;
359
+ private readonly sources;
360
+ constructor(client: TikTokClient, audiences: TikTokCustomAudiences, sources: TikTokAudienceSources);
361
+ context(value: unknown): Promise<{
362
+ context_hash: string;
363
+ sources: {
364
+ id: string;
365
+ name: string;
366
+ eligible: boolean;
367
+ configuration: Record<string, unknown>;
368
+ }[];
369
+ records: {
370
+ id: string;
371
+ name: string;
372
+ eligible: boolean;
373
+ }[];
374
+ selected_sources_verified: boolean;
375
+ notes: string[];
376
+ }>;
377
+ private read;
378
+ private created;
379
+ private receipt;
380
+ plan(op: WriteOperation): Promise<Plan$a>;
381
+ private rulePlan;
382
+ private refreshPlan;
383
+ }
384
+
385
+ declare const pixelList: z.ZodObject<{
386
+ account_id: z.ZodString;
387
+ pixel_id: z.ZodOptional<z.ZodString>;
388
+ code: z.ZodOptional<z.ZodString>;
389
+ name: z.ZodOptional<z.ZodString>;
390
+ order_by: z.ZodOptional<z.ZodEnum<{
391
+ EARLIEST_CREATE: "EARLIEST_CREATE";
392
+ LATEST_CREATE: "LATEST_CREATE";
393
+ }>>;
394
+ filtering: z.ZodOptional<z.ZodObject<{
395
+ available_for_catalog_only: z.ZodBoolean;
396
+ }, z.core.$strict>>;
397
+ page: z.ZodDefault<z.ZodNumber>;
398
+ page_size: z.ZodDefault<z.ZodNumber>;
399
+ }, z.core.$strip>;
400
+ declare const pixelStats: z.ZodObject<{
401
+ account_id: z.ZodString;
402
+ pixel_ids: z.ZodArray<z.ZodString>;
403
+ date_range: z.ZodObject<{
404
+ start_date: z.ZodISODate;
405
+ end_date: z.ZodISODate;
406
+ }, z.core.$strict>;
407
+ }, z.core.$strip>;
408
+ type Plan$9 = Omit<WritePreview, 'serverValidated'> & {
409
+ execute(): Promise<string[]>;
410
+ };
411
+ /** TikTok-owned SDK f809c396: pixel/{list,create,update} and pixel/event/stats. */
412
+ declare class TikTokMeasurementService {
413
+ private readonly client;
414
+ constructor(client: TikTokClient);
415
+ list(raw: z.input<typeof pixelList>): Promise<{
416
+ pagination_note?: string | undefined;
417
+ next_page?: number | undefined;
418
+ pixels: ({
419
+ [x: string]: unknown;
420
+ pixel_id: string;
421
+ pixel_name: string;
422
+ advertiser_id?: string | undefined;
423
+ } & {
424
+ configuration_hash: string;
425
+ })[];
426
+ complete: boolean | null;
427
+ truncated: boolean;
428
+ page_info?: {
429
+ [x: string]: unknown;
430
+ page: number;
431
+ page_size: number;
432
+ total_page?: number | undefined;
433
+ total_number?: number | undefined;
434
+ } | undefined;
435
+ }>;
436
+ get(account: string, pixelId: string): Promise<{
437
+ pixel: {
438
+ [x: string]: unknown;
439
+ pixel_id: string;
440
+ pixel_name: string;
441
+ advertiser_id?: string | undefined;
442
+ } & {
443
+ configuration_hash: string;
444
+ };
445
+ }>;
446
+ stats(raw: z.input<typeof pixelStats>): Promise<{
447
+ pixel_ids: string[];
448
+ date_range: {
449
+ start_date: string;
450
+ end_date: string;
451
+ };
452
+ list: Record<string, unknown>[];
453
+ }>;
454
+ plan(op: WriteOperation): Promise<Plan$9>;
455
+ }
456
+
457
+ declare const automatedRuleList: z.ZodObject<{
458
+ page: z.ZodDefault<z.ZodNumber>;
459
+ page_size: z.ZodDefault<z.ZodNumber>;
460
+ account_id: z.ZodString;
461
+ filtering: z.ZodOptional<z.ZodObject<{
462
+ status: z.ZodOptional<z.ZodEnum<{
463
+ ON: "ON";
464
+ OFF: "OFF";
465
+ DELETED: "DELETED";
466
+ }>>;
467
+ rule_info: z.ZodOptional<z.ZodArray<z.ZodString>>;
468
+ data_dimension: z.ZodOptional<z.ZodEnum<{
469
+ CAMPAIGN: "CAMPAIGN";
470
+ ADGROUP: "ADGROUP";
471
+ AD: "AD";
472
+ }>>;
473
+ }, z.core.$strict>>;
474
+ tzone: z.ZodOptional<z.ZodString>;
475
+ }, z.core.$strict>;
476
+ declare const automatedRuleGet: z.ZodObject<{
477
+ account_id: z.ZodString;
478
+ rule_ids: z.ZodArray<z.ZodString>;
479
+ }, z.core.$strict>;
480
+ declare const automatedRuleResults: z.ZodObject<{
481
+ page: z.ZodDefault<z.ZodNumber>;
482
+ page_size: z.ZodDefault<z.ZodNumber>;
483
+ account_id: z.ZodString;
484
+ lang: z.ZodDefault<z.ZodEnum<{
485
+ EN: "EN";
486
+ ZH: "ZH";
487
+ JA: "JA";
488
+ }>>;
489
+ filtering: z.ZodOptional<z.ZodObject<{
490
+ action: z.ZodOptional<z.ZodEnum<{
491
+ TURN_ON: "TURN_ON";
492
+ TURN_OFF: "TURN_OFF";
493
+ MESSAGE: "MESSAGE";
494
+ DAILY_BUDGET: "DAILY_BUDGET";
495
+ LIFERIME_BUDGET: "LIFERIME_BUDGET";
496
+ BID: "BID";
497
+ }>>;
498
+ time: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
499
+ status: z.ZodOptional<z.ZodEnum<{
500
+ ON: "ON";
501
+ OFF: "OFF";
502
+ DELETED: "DELETED";
503
+ }>>;
504
+ rule_info: z.ZodOptional<z.ZodArray<z.ZodString>>;
505
+ data_dimension: z.ZodOptional<z.ZodEnum<{
506
+ CAMPAIGN: "CAMPAIGN";
507
+ ADGROUP: "ADGROUP";
508
+ AD: "AD";
509
+ }>>;
510
+ }, z.core.$strict>>;
511
+ }, z.core.$strict>;
512
+ declare const automatedRuleResultDetails: z.ZodObject<{
513
+ account_id: z.ZodString;
514
+ lang: z.ZodDefault<z.ZodEnum<{
515
+ EN: "EN";
516
+ ZH: "ZH";
517
+ JA: "JA";
518
+ }>>;
519
+ result_detail: z.ZodArray<z.ZodObject<{
520
+ rule_id: z.ZodString;
521
+ exec_id: z.ZodString;
522
+ }, z.core.$strict>>;
523
+ }, z.core.$strict>;
524
+ type Row$2 = Record<string, unknown>;
525
+ /** Native v1.3 docs and TikTok-owned SDK f809c396, inspected 2026-11-05. */
526
+ declare class TikTokAutomatedRulesService {
527
+ private readonly client;
528
+ constructor(client: TikTokClient);
529
+ private scoped;
530
+ private records;
531
+ private readPage;
532
+ list(raw: z.input<typeof automatedRuleList>): Promise<{
533
+ notes: string[];
534
+ requested_rule_ids?: string[] | undefined;
535
+ unreturned_rule_ids?: string[] | undefined;
536
+ all_requested_ids_returned?: boolean | undefined;
537
+ next_page: number | undefined;
538
+ records: Row$2[];
539
+ complete: boolean | null;
540
+ truncated: boolean;
541
+ rules: {
542
+ [x: string]: unknown;
543
+ rule_id: string;
544
+ name?: string | undefined;
545
+ rule_status?: string | undefined;
546
+ }[];
547
+ page_info?: {
548
+ [x: string]: unknown;
549
+ page: number;
550
+ page_size: number;
551
+ total_page?: number | undefined;
552
+ total_number?: number | undefined;
553
+ } | undefined;
554
+ }>;
555
+ get(raw: z.input<typeof automatedRuleGet>): Promise<{
556
+ notes: string[];
557
+ requested_rule_ids?: string[] | undefined;
558
+ unreturned_rule_ids?: string[] | undefined;
559
+ all_requested_ids_returned?: boolean | undefined;
560
+ next_page: number | undefined;
561
+ records: Row$2[];
562
+ complete: boolean | null;
563
+ truncated: boolean;
564
+ rules: {
565
+ [x: string]: unknown;
566
+ rule_id: string;
567
+ name?: string | undefined;
568
+ rule_status?: string | undefined;
569
+ }[];
570
+ page_info?: {
571
+ [x: string]: unknown;
572
+ page: number;
573
+ page_size: number;
574
+ total_page?: number | undefined;
575
+ total_number?: number | undefined;
576
+ } | undefined;
577
+ }>;
578
+ results(raw: z.input<typeof automatedRuleResults>): Promise<{
579
+ notes: string[];
580
+ requested_rule_ids?: string[] | undefined;
581
+ unreturned_rule_ids?: string[] | undefined;
582
+ all_requested_ids_returned?: boolean | undefined;
583
+ next_page: number | undefined;
584
+ records: Row$2[];
585
+ complete: boolean | null;
586
+ truncated: boolean;
587
+ rules: {
588
+ [x: string]: unknown;
589
+ rule_id: string;
590
+ name?: string | undefined;
591
+ rule_status?: string | undefined;
592
+ }[];
593
+ page_info?: {
594
+ [x: string]: unknown;
595
+ page: number;
596
+ page_size: number;
597
+ total_page?: number | undefined;
598
+ total_number?: number | undefined;
599
+ } | undefined;
600
+ }>;
601
+ details(raw: z.input<typeof automatedRuleResultDetails>): Promise<{
602
+ records: {
603
+ [x: string]: unknown;
604
+ rule_id: string;
605
+ exec_id: string;
606
+ }[];
607
+ complete: null;
608
+ truncated: boolean;
609
+ notes: string[];
610
+ result_details: {
611
+ [x: string]: unknown;
612
+ rule_id: string;
613
+ exec_id: string;
614
+ }[];
615
+ }>;
616
+ }
617
+
618
+ declare const catalogScope: z.ZodObject<{
619
+ accountId: z.ZodString;
620
+ businessId: z.ZodString;
621
+ resourceId: z.ZodString;
622
+ kind: z.ZodEnum<{
623
+ catalog: "catalog";
624
+ catalog_creation: "catalog_creation";
625
+ }>;
626
+ }, z.core.$strict>;
627
+ type TikTokCatalogScope = z.infer<typeof catalogScope>;
628
+ declare const catalogAccessMode: z.ZodEnum<{
629
+ none: "none";
630
+ read: "read";
631
+ write: "write";
632
+ create: "create";
633
+ }>;
634
+ type TikTokCatalogAccessMode = z.infer<typeof catalogAccessMode>;
635
+ interface TikTokCatalogGrant {
636
+ scope: TikTokCatalogScope;
637
+ mode: TikTokCatalogAccessMode;
638
+ revision: number;
639
+ hash: string;
640
+ }
641
+ interface TikTokCatalogAccessStore {
642
+ readonly canManage: boolean;
643
+ readonly canWrite: boolean;
644
+ get(scope: TikTokCatalogScope): Promise<TikTokCatalogGrant>;
645
+ /** Recheck active account/principal scope before native resource access. */
646
+ authorize(scope: TikTokCatalogScope, write: boolean): Promise<TikTokCatalogGrant>;
647
+ list(accountId: string): Promise<TikTokCatalogGrant[]>;
648
+ /** Only the local owner or authenticated dashboard owner/admin may change access. */
649
+ compareAndSet(scope: TikTokCatalogScope, expectedHash: string, mode: TikTokCatalogAccessMode): Promise<TikTokCatalogGrant>;
650
+ /** Internal creation receipt: adopt only a freshly created, independently verified native catalog. */
651
+ adoptCreated?(scope: TikTokCatalogScope, expectedCreationHash: string): Promise<TikTokCatalogGrant>;
652
+ }
653
+ declare function catalogGrant(scope: TikTokCatalogScope, mode?: TikTokCatalogAccessMode, revision?: number): TikTokCatalogGrant;
654
+ declare function catalogScopeKey(scope: TikTokCatalogScope): string;
655
+ declare function requireCatalogAccess(store: TikTokCatalogAccessStore | undefined, scope: TikTokCatalogScope, write?: boolean): Promise<TikTokCatalogGrant>;
656
+ declare const creationScope: (accountId: string, businessId: string) => TikTokCatalogScope;
657
+ declare function requireCatalogCreationAccess(store: TikTokCatalogAccessStore | undefined, scope: TikTokCatalogScope, write?: boolean): Promise<TikTokCatalogGrant>;
658
+ /** Local-owner scope, separate from OAuth secrets. No default Business Center wildcard. */
659
+ declare class FileTikTokCatalogAccessStore implements TikTokCatalogAccessStore {
660
+ private readonly dir;
661
+ readonly canManage = true;
662
+ readonly canWrite = true;
663
+ constructor(dir?: string);
664
+ private file;
665
+ authorize(scope: TikTokCatalogScope, _write: boolean): Promise<TikTokCatalogGrant>;
666
+ get(scope: TikTokCatalogScope): Promise<TikTokCatalogGrant>;
667
+ list(accountId: string): Promise<TikTokCatalogGrant[]>;
668
+ adoptCreated(value: TikTokCatalogScope, expectedCreationHash: string): Promise<TikTokCatalogGrant>;
669
+ compareAndSet(scope: TikTokCatalogScope, expectedHash: string, mode: TikTokCatalogAccessMode): Promise<TikTokCatalogGrant>;
670
+ }
671
+
672
+ declare const catalogInput: z.ZodObject<{
673
+ account_id: z.ZodString;
674
+ bc_id: z.ZodString;
675
+ catalog_id: z.ZodString;
676
+ }, z.core.$strict>;
677
+
678
+ type CatalogSelection = z.infer<typeof catalogInput>;
679
+ type Plan$8 = Omit<WritePreview, 'serverValidated'> & {
680
+ execute(): Promise<string[]>;
681
+ };
682
+ /** Native set lists are unpaged; Adport pages a bounded, snapshot-bound result. */
683
+ declare class TikTokCatalogProductSets {
684
+ private readonly client;
685
+ private readonly authorizeParent;
686
+ private readonly media?;
687
+ constructor(client: Pick<TikTokClient, 'get' | 'post'> & Partial<Pick<TikTokClient, 'postMultipart'>>, authorizeParent: (input: CatalogSelection, write?: boolean) => Promise<{
688
+ configuration_hash: string;
689
+ catalog_type?: string;
690
+ }>, media?: MediaResolver | undefined);
691
+ private request;
692
+ private native;
693
+ list(value: unknown): Promise<{
694
+ notes: string[];
695
+ next_cursor?: string | undefined;
696
+ sets: {
697
+ configuration_hash: string;
698
+ product_set_name: string;
699
+ product_set_id: string;
700
+ catalog_id: string;
701
+ conditions: Record<string, unknown>;
702
+ bc_id?: string | undefined;
703
+ product_count?: number | undefined;
704
+ }[];
705
+ records: {
706
+ conditions: Record<string, unknown>;
707
+ product_count?: number | undefined;
708
+ id: string;
709
+ name: string;
710
+ catalog_id: string;
711
+ }[];
712
+ complete: boolean;
713
+ truncated: boolean;
714
+ }>;
715
+ products(value: unknown): Promise<{
716
+ pagination_note?: string | undefined;
717
+ next_page?: number | undefined;
718
+ records: {
719
+ product_id: string;
720
+ product_name: string;
721
+ catalog_id?: string | undefined;
722
+ product_set_id?: string | undefined;
723
+ bc_id?: string | undefined;
724
+ id: string;
725
+ name: string;
726
+ }[];
727
+ complete: boolean | null;
728
+ truncated: boolean;
729
+ product_set_id: string;
730
+ catalog_id: string;
731
+ product_count: number;
732
+ products: {
733
+ [x: string]: unknown;
734
+ product_id: string;
735
+ product_name: string;
736
+ catalog_id?: string | undefined;
737
+ product_set_id?: string | undefined;
738
+ bc_id?: string | undefined;
739
+ }[];
740
+ page_info?: {
741
+ page: number;
742
+ page_size: number;
743
+ total_number?: number | undefined;
744
+ total_page?: number | undefined;
745
+ } | undefined;
746
+ }>;
747
+ plan(op: WriteOperation): Promise<Plan$8>;
748
+ private uploadPlan;
749
+ private createPlan;
750
+ private conditionsPlan;
751
+ private deletePlan;
752
+ }
753
+
754
+ type Selection$3 = z.infer<typeof catalogInput>;
755
+ type Parent$4 = {
756
+ configuration_hash: string;
757
+ catalog_conf: Record<string, unknown>;
758
+ };
759
+ type Plan$7 = Omit<WritePreview, 'serverValidated'> & {
760
+ execute(): Promise<string[]>;
761
+ };
762
+ /** Business Center catalog feeds. Native lists are unpaged and locally bounded. */
763
+ declare class TikTokCatalogFeeds {
764
+ private readonly client;
765
+ private readonly authorizeParent;
766
+ constructor(client: Pick<TikTokClient, 'get' | 'post'>, authorizeParent: (input: Selection$3, write?: boolean) => Promise<Parent$4>);
767
+ private read;
768
+ private native;
769
+ list(value: unknown): Promise<{
770
+ notes: string[];
771
+ next_cursor?: string | undefined;
772
+ feeds: {
773
+ update_mode: string;
774
+ schedule: {
775
+ timezone: string | null;
776
+ interval_type: "HOURLY" | "DAILY" | "MONTHLY" | null;
777
+ interval_count: number | null;
778
+ day_of_month: number | null;
779
+ hour: number | null;
780
+ minute: number | null;
781
+ };
782
+ number_of_products: number | undefined;
783
+ next_update_time: string | null;
784
+ configuration_hash: string;
785
+ source_fingerprint?: string | undefined;
786
+ feed_id: string;
787
+ feed_name: string;
788
+ status: string;
789
+ feed_type: string;
790
+ region_codes: string[] | undefined;
791
+ override_fields: string[] | undefined;
792
+ source_origin: string;
793
+ source_configured: boolean;
794
+ }[];
795
+ records: {
796
+ id: string;
797
+ name: string;
798
+ status: string;
799
+ type: string;
800
+ frequency: string;
801
+ update_mode: string;
802
+ source: string;
803
+ }[];
804
+ complete: boolean;
805
+ truncated: boolean;
806
+ }>;
807
+ log(value: unknown): Promise<{
808
+ feed_id: string;
809
+ logs: {
810
+ start_time?: string | null | undefined;
811
+ end_time?: string | null | undefined;
812
+ add_count: number;
813
+ error_count: number;
814
+ remove_count: number;
815
+ process_status: "PROCESSING" | "SUCCESS" | "FAILED" | "WAITING";
816
+ update_count: number;
817
+ warn_count: number;
818
+ }[];
819
+ records: {
820
+ id: string;
821
+ name: string;
822
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "WAITING";
823
+ added: number;
824
+ updated: number;
825
+ removed: number;
826
+ errors: number;
827
+ warnings: number;
828
+ completed_at: string | null | undefined;
829
+ }[];
830
+ complete: boolean;
831
+ truncated: boolean;
832
+ history_scope: string;
833
+ more_history_available: null;
834
+ notes: string[];
835
+ }>;
836
+ plan(op: WriteOperation): Promise<Plan$7>;
837
+ }
838
+
839
+ type Selection$2 = z.infer<typeof catalogInput>;
840
+ type Plan$6 = Omit<WritePreview, 'serverValidated'> & {
841
+ execute(): Promise<string[]>;
842
+ };
843
+ /** Native file imports return task IDs. Acceptance never certifies completed ingestion. */
844
+ declare class TikTokCatalogProducts {
845
+ private readonly client;
846
+ private readonly authorizeParent;
847
+ private readonly feeds;
848
+ private readonly media?;
849
+ constructor(client: Pick<TikTokClient, 'get' | 'post'>, authorizeParent: (input: Selection$2, write?: boolean) => Promise<{
850
+ configuration_hash: string;
851
+ catalog_type: string;
852
+ }>, feeds: Pick<TikTokCatalogFeeds, 'list'>, media?: MediaResolver | undefined);
853
+ private request;
854
+ list(value: unknown): Promise<{
855
+ native_access_limit: number;
856
+ native_limit_reached: boolean;
857
+ notes: string[];
858
+ page_info?: {
859
+ page: number;
860
+ page_size: number;
861
+ total_number?: number | undefined;
862
+ total_page?: number | undefined;
863
+ } | undefined;
864
+ next_page?: number | undefined;
865
+ products: {
866
+ product_id: string;
867
+ external_id: string | undefined;
868
+ name: string;
869
+ availability: string | undefined;
870
+ active_status: string | undefined;
871
+ available: boolean | undefined;
872
+ ad_creation_eligible: string | undefined;
873
+ audit_status: string | undefined;
874
+ brand: string | undefined;
875
+ image_url: string | undefined;
876
+ video_url: string | undefined;
877
+ description: string | undefined;
878
+ description_truncated: boolean;
879
+ }[];
880
+ creatives: {
881
+ id: string;
882
+ provider: string;
883
+ account_id: string;
884
+ name: string;
885
+ type: string;
886
+ headlines: string[];
887
+ descriptions: string[];
888
+ landing_urls: string[];
889
+ media: {
890
+ type: "image" | "video" | "audio";
891
+ url: string;
892
+ alt?: string | undefined;
893
+ poster_url?: string | undefined;
894
+ open_url?: string | undefined;
895
+ }[];
896
+ actions: {
897
+ label: string;
898
+ tool: string;
899
+ arguments: Record<string, unknown>;
900
+ fields: {
901
+ key: string;
902
+ label: string;
903
+ type: "text" | "text_list" | "url_list" | "select";
904
+ value: string | string[];
905
+ options?: {
906
+ label: string;
907
+ value: string;
908
+ }[] | undefined;
909
+ max_length?: number | undefined;
910
+ }[];
911
+ }[];
912
+ status?: string | undefined;
913
+ campaign_id?: string | undefined;
914
+ ad_group_id?: string | undefined;
915
+ }[];
916
+ complete: boolean | null;
917
+ truncated: boolean;
918
+ }>;
919
+ private selectedFeed;
920
+ log(value: unknown): Promise<{
921
+ log: {
922
+ diagnostic_fields_truncated: boolean;
923
+ warning_fields?: {
924
+ field: string;
925
+ affected_product_count: number;
926
+ }[] | undefined;
927
+ error_fields?: {
928
+ field: string;
929
+ affected_product_count: number;
930
+ }[] | undefined;
931
+ update_mode_recognized?: boolean | undefined;
932
+ feed_id: string;
933
+ feed_log_id: string;
934
+ process_status: "PROCESSING" | "SUCCESS" | "FAILED" | "WAITING";
935
+ catalog_id?: string | undefined;
936
+ bc_id?: string | undefined;
937
+ update_mode?: number | "REPLACE" | "INCREMENTAL" | "OVERWRITE" | "INCREASE" | undefined;
938
+ add_count?: number | undefined;
939
+ update_count?: number | undefined;
940
+ delete_count?: number | undefined;
941
+ error_count?: number | undefined;
942
+ warn_count?: number | undefined;
943
+ start_time?: string | null | undefined;
944
+ end_time?: string | null | undefined;
945
+ };
946
+ records: {
947
+ id: string;
948
+ name: string;
949
+ status: string;
950
+ added: number | undefined;
951
+ updated: number | undefined;
952
+ removed: number | undefined;
953
+ errors: number | undefined;
954
+ warnings: number | undefined;
955
+ }[];
956
+ processing_complete: boolean;
957
+ complete: boolean;
958
+ truncated: boolean;
959
+ notes: string[];
960
+ }>;
961
+ plan(op: WriteOperation): Promise<Plan$6>;
962
+ }
963
+
964
+ type Row$1 = Record<string, unknown>;
965
+ type Selection$1 = z.infer<typeof catalogInput>;
966
+ type Parent$3 = {
967
+ configuration_hash: string;
968
+ catalog_type: string;
969
+ };
970
+ type Plan$5 = Omit<WritePreview, 'serverValidated'> & {
971
+ execute(): Promise<string[]>;
972
+ };
973
+ /** Fixed native product endpoints; every apply is a single asynchronous submission. */
974
+ declare class TikTokCatalogProductAuthoring {
975
+ private readonly client;
976
+ private readonly authorizeParent;
977
+ private readonly feeds;
978
+ private readonly products;
979
+ private readonly media?;
980
+ constructor(client: Pick<TikTokClient, 'get' | 'post'>, authorizeParent: (selection: Selection$1, write?: boolean) => Promise<Parent$3>, feeds: Pick<TikTokCatalogFeeds, 'list'>, products: Pick<TikTokCatalogProducts, 'log'>, media?: MediaResolver | undefined);
981
+ supports(tool: string): boolean;
982
+ private request;
983
+ private feed;
984
+ schema(value: unknown): Promise<{
985
+ catalog_type: "ECOM" | "HOTEL" | "FLIGHT" | "DESTINATION" | "ENTERTAINMENT" | "AUTO_VEHICLE" | "AUTO_MODEL" | "MINI_SERIES" | "GENERIC" | "ONLINE_TO_OFFLINE";
986
+ operation: "update" | "upload";
987
+ schema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
988
+ identity_fields: readonly string[];
989
+ native_batch_limit: number;
990
+ adport_batch_bytes: number;
991
+ media_assets_schema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
992
+ product_index: z.ZodNumber;
993
+ field: z.ZodEnum<{
994
+ video_url: "video_url";
995
+ image_url: "image_url";
996
+ additional_image_urls: "additional_image_urls";
997
+ }>;
998
+ image_index: z.ZodOptional<z.ZodNumber>;
999
+ media_id: z.ZodString;
1000
+ expected_sha256: z.ZodString;
1001
+ }, z.core.$strict>>;
1002
+ source: string;
1003
+ notes: string[];
1004
+ }>;
1005
+ private mediaProducts;
1006
+ private readSet;
1007
+ context(value: unknown): Promise<{
1008
+ catalog_type: "ECOM" | "HOTEL" | "FLIGHT" | "DESTINATION" | "ENTERTAINMENT" | "AUTO_VEHICLE" | "AUTO_MODEL" | "MINI_SERIES" | "GENERIC" | "ONLINE_TO_OFFLINE";
1009
+ expected_catalog_hash: string;
1010
+ expected_feed_hash: string;
1011
+ products_hash: string;
1012
+ products: {
1013
+ external_identity: Row$1;
1014
+ }[];
1015
+ records: {
1016
+ id: string;
1017
+ name: string;
1018
+ external_identity: Row$1;
1019
+ }[];
1020
+ selection_complete: boolean;
1021
+ truncated: boolean;
1022
+ notes: string[];
1023
+ }>;
1024
+ plan(op: WriteOperation): Promise<Plan$5>;
1025
+ }
1026
+
1027
+ type Scope$1 = z.infer<typeof catalogInput>;
1028
+ type Catalog = {
1029
+ catalog_id: string;
1030
+ catalog_name: string;
1031
+ catalog_type: string;
1032
+ catalog_conf: Record<string, unknown>;
1033
+ bc_info: {
1034
+ bc_id: string;
1035
+ bc_name?: string;
1036
+ };
1037
+ };
1038
+ type Parent$2 = Catalog & {
1039
+ configuration_hash: string;
1040
+ };
1041
+ type Plan$4 = Omit<WritePreview, 'serverValidated'> & {
1042
+ execute(): Promise<string[]>;
1043
+ };
1044
+ /** Create delegation covers only exact new receipts, never existing Business Center catalogs. */
1045
+ declare class TikTokCatalogLifecycle {
1046
+ private readonly client;
1047
+ private readonly store;
1048
+ private readonly parent;
1049
+ private readonly lookup;
1050
+ constructor(client: Pick<TikTokClient, 'get' | 'post'>, store: TikTokCatalogAccessStore | undefined, parent: (scope: Scope$1, write?: boolean) => Promise<Parent$2>, lookup: (scope: Scope$1) => Promise<Catalog | undefined>);
1051
+ availableCountries(bcId: string): Promise<string[]>;
1052
+ context(value: unknown): Promise<{
1053
+ expected_creation_access_hash: string;
1054
+ expected_regions_hash: string;
1055
+ available_region_codes: string[];
1056
+ catalog_types: ("ECOM" | "HOTEL" | "FLIGHT" | "DESTINATION" | "ENTERTAINMENT" | "AUTO_VEHICLE" | "AUTO_MODEL" | "MINI_SERIES" | "GENERIC" | "ONLINE_TO_OFFLINE")[];
1057
+ records: {
1058
+ id: string;
1059
+ name: string;
1060
+ business_center_id: string;
1061
+ access: string;
1062
+ available_region_count: number;
1063
+ }[];
1064
+ complete: boolean;
1065
+ truncated: boolean;
1066
+ notes: string[];
1067
+ }>;
1068
+ plan(op: WriteOperation): Promise<Plan$4>;
1069
+ }
1070
+
1071
+ type Row = Record<string, unknown>;
1072
+ type Selection = z.infer<typeof catalogInput>;
1073
+ type Parent$1 = {
1074
+ configuration_hash: string;
1075
+ catalog_type: string;
1076
+ catalog_conf: Row;
1077
+ can_write: boolean;
1078
+ };
1079
+ type Plan$3 = Omit<WritePreview, 'serverValidated'> & {
1080
+ execute(): Promise<string[]>;
1081
+ };
1082
+ /** Official catalog/video file/log/get/delete contracts refreshed 2026-11-05. */
1083
+ declare class TikTokCatalogVideos {
1084
+ private readonly client;
1085
+ private readonly authorizeParent;
1086
+ private readonly media?;
1087
+ constructor(client: Pick<TikTokClient, 'get' | 'post'>, authorizeParent: (scope: Selection, write?: boolean) => Promise<Parent$1>, media?: MediaResolver | undefined);
1088
+ private parent;
1089
+ private request;
1090
+ private native;
1091
+ list(value: unknown): Promise<{
1092
+ notes: string[];
1093
+ missing_ids?: string[] | undefined;
1094
+ page_info?: {
1095
+ page: number;
1096
+ page_size: number;
1097
+ total_page?: number | undefined;
1098
+ total_number?: number | undefined;
1099
+ } | undefined;
1100
+ next_page?: number | undefined;
1101
+ videos: {
1102
+ preview_url: string | undefined;
1103
+ configuration_hash: string;
1104
+ video_signature?: string | undefined;
1105
+ source: {
1106
+ origin: string;
1107
+ sha256: string;
1108
+ } | undefined;
1109
+ landing_page: {
1110
+ origin: string;
1111
+ sha256: string;
1112
+ } | undefined;
1113
+ metadata_truncated_fields: ("landing_page_url" | "description" | "brand" | "category" | "creator" | "video_type" | "custom_label_0" | "custom_label_1" | "custom_label_2" | "custom_label_3" | "custom_label_4")[];
1114
+ description?: string | null | undefined;
1115
+ brand?: string | null | undefined;
1116
+ category?: string | null | undefined;
1117
+ creator?: string | null | undefined;
1118
+ video_type?: string | null | undefined;
1119
+ custom_label_0?: string | null | undefined;
1120
+ custom_label_1?: string | null | undefined;
1121
+ custom_label_2?: string | null | undefined;
1122
+ custom_label_3?: string | null | undefined;
1123
+ custom_label_4?: string | null | undefined;
1124
+ catalog_video_id: string;
1125
+ video_name: string;
1126
+ sku_id_list: string[] | undefined;
1127
+ status: "SUCCESS" | "FAILED" | "PENDING";
1128
+ active_status: "ACTIVATED" | "DEACTIVATED" | undefined;
1129
+ video_id: string | null | undefined;
1130
+ create_time: string | undefined;
1131
+ }[];
1132
+ creatives: {
1133
+ id: string;
1134
+ provider: string;
1135
+ account_id: string;
1136
+ name: string;
1137
+ type: string;
1138
+ headlines: string[];
1139
+ descriptions: string[];
1140
+ landing_urls: string[];
1141
+ media: {
1142
+ type: "image" | "video" | "audio";
1143
+ url: string;
1144
+ alt?: string | undefined;
1145
+ poster_url?: string | undefined;
1146
+ open_url?: string | undefined;
1147
+ }[];
1148
+ actions: {
1149
+ label: string;
1150
+ tool: string;
1151
+ arguments: Record<string, unknown>;
1152
+ fields: {
1153
+ key: string;
1154
+ label: string;
1155
+ type: "text" | "text_list" | "url_list" | "select";
1156
+ value: string | string[];
1157
+ options?: {
1158
+ label: string;
1159
+ value: string;
1160
+ }[] | undefined;
1161
+ max_length?: number | undefined;
1162
+ }[];
1163
+ }[];
1164
+ status?: string | undefined;
1165
+ campaign_id?: string | undefined;
1166
+ ad_group_id?: string | undefined;
1167
+ }[];
1168
+ complete: boolean | null;
1169
+ truncated: boolean;
1170
+ }>;
1171
+ log(value: unknown): Promise<{
1172
+ log: {
1173
+ diagnostic_fields_truncated: boolean;
1174
+ warning_fields?: {
1175
+ field: string;
1176
+ affected_video_count: number;
1177
+ }[] | undefined;
1178
+ error_fields?: {
1179
+ field: string;
1180
+ affected_video_count: number;
1181
+ }[] | undefined;
1182
+ feed_log_id: string;
1183
+ catalog_id: string;
1184
+ process_status: "PROCESSING" | "SUCCESS" | "FAILED" | "WAITING";
1185
+ bc_id?: string | undefined;
1186
+ feed_id?: string | undefined;
1187
+ add_count?: number | undefined;
1188
+ update_count?: number | undefined;
1189
+ delete_count?: number | undefined;
1190
+ error_count?: number | undefined;
1191
+ warn_count?: number | undefined;
1192
+ start_time?: string | undefined;
1193
+ end_time?: string | undefined;
1194
+ };
1195
+ records: {
1196
+ id: string;
1197
+ name: string;
1198
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "WAITING";
1199
+ added: number | undefined;
1200
+ removed: number | undefined;
1201
+ errors: number | undefined;
1202
+ warnings: number | undefined;
1203
+ }[];
1204
+ processing_complete: boolean;
1205
+ has_item_errors: boolean | null;
1206
+ complete: boolean;
1207
+ truncated: boolean;
1208
+ notes: string[];
1209
+ }>;
1210
+ private source;
1211
+ importContext(value: unknown): Promise<{
1212
+ expected_catalog_hash: string;
1213
+ expected_associations_hash: string;
1214
+ source_media_id: string;
1215
+ source_sha256: string;
1216
+ video_rows: number;
1217
+ unique_skus: number;
1218
+ records: Row[];
1219
+ complete: boolean;
1220
+ truncated: boolean;
1221
+ notes: string[];
1222
+ }>;
1223
+ plan(op: WriteOperation): Promise<Plan$3>;
1224
+ }
1225
+
1226
+ type Scope = z.infer<typeof catalogInput>;
1227
+ type Parent = {
1228
+ configuration_hash: string;
1229
+ can_write: boolean;
1230
+ };
1231
+ type Plan$2 = Omit<WritePreview, 'serverValidated'> & {
1232
+ execute(): Promise<string[]>;
1233
+ };
1234
+ type Member = {
1235
+ type: 'APP' | 'PIXEL';
1236
+ id: string;
1237
+ name: string;
1238
+ };
1239
+ /** Native catalog event-source bindings, not event ingestion. Official contracts refreshed 2026-11-05. */
1240
+ declare class TikTokCatalogEventSources {
1241
+ private readonly client;
1242
+ private readonly parent;
1243
+ constructor(client: Pick<TikTokClient, 'get' | 'post'>, parent: (scope: Scope, write?: boolean) => Promise<Parent>);
1244
+ private get;
1245
+ private bindings;
1246
+ list(value: unknown): Promise<{
1247
+ notes: string[];
1248
+ next_cursor?: string | undefined;
1249
+ event_sources: Member[];
1250
+ records: {
1251
+ id: string;
1252
+ name: string;
1253
+ type: "APP" | "PIXEL";
1254
+ source_id: string;
1255
+ }[];
1256
+ configuration_hash: string;
1257
+ expected_catalog_hash: string;
1258
+ total_in_response: number;
1259
+ complete: boolean;
1260
+ truncated: boolean;
1261
+ }>;
1262
+ apps(value: unknown): Promise<{
1263
+ notes: string[];
1264
+ next_cursor?: string | undefined;
1265
+ apps: {
1266
+ advertiser_id: string;
1267
+ app_id: string;
1268
+ app_name: string;
1269
+ app_platform_id: string;
1270
+ platform?: "ANDROID" | "IOS" | undefined;
1271
+ package_name?: string | undefined;
1272
+ self_attribution_enabled?: boolean | undefined;
1273
+ skan_allowed?: "ALLOWED" | "NOT_ALLOWED" | undefined;
1274
+ advanced_dedicated_campaign_allowed?: boolean | undefined;
1275
+ is_attribution_flex_enable?: boolean | undefined;
1276
+ }[];
1277
+ records: {
1278
+ id: string;
1279
+ name: string;
1280
+ platform: string;
1281
+ app_platform_id: string;
1282
+ skan_allowed: string;
1283
+ }[];
1284
+ total_in_response: number;
1285
+ complete: boolean;
1286
+ truncated: boolean;
1287
+ }>;
1288
+ private selected;
1289
+ private contextFor;
1290
+ context(value: unknown): Promise<{
1291
+ expected_catalog_hash: string;
1292
+ expected_bindings_hash: string;
1293
+ expected_sources_hash: string;
1294
+ purpose: "bind" | "unbind";
1295
+ selected_sources: (Record<string, unknown> & Member)[];
1296
+ records: {
1297
+ id: string;
1298
+ name: string;
1299
+ type: "APP" | "PIXEL";
1300
+ source_id: string;
1301
+ change: string;
1302
+ }[];
1303
+ binding_count: number;
1304
+ complete: boolean;
1305
+ truncated: boolean;
1306
+ notes: string[];
1307
+ }>;
1308
+ plan(op: WriteOperation): Promise<Plan$2>;
1309
+ }
1310
+
1311
+ type Plan$1 = Omit<WritePreview, 'serverValidated'> & {
1312
+ execute(): Promise<string[]>;
1313
+ };
1314
+ /** Account scope and catalog-resource scope are independent authorization checks. */
1315
+ declare class TikTokCatalogService {
1316
+ private readonly client;
1317
+ private readonly store?;
1318
+ readonly productSets: TikTokCatalogProductSets;
1319
+ readonly feeds: TikTokCatalogFeeds;
1320
+ readonly products: TikTokCatalogProducts;
1321
+ readonly productAuthoring: TikTokCatalogProductAuthoring;
1322
+ readonly videos: TikTokCatalogVideos;
1323
+ readonly eventSources: TikTokCatalogEventSources;
1324
+ readonly lifecycle: TikTokCatalogLifecycle;
1325
+ constructor(client: Pick<TikTokClient, 'get' | 'post'> & Partial<Pick<TikTokClient, 'postMultipart'>>, store?: TikTokCatalogAccessStore | undefined, media?: MediaResolver);
1326
+ private manager;
1327
+ private native;
1328
+ access(accountId: string): Promise<{
1329
+ grants: TikTokCatalogGrant[];
1330
+ records: {
1331
+ id: string;
1332
+ name: string;
1333
+ business_center_id: string;
1334
+ access: "none" | "read" | "write" | "create";
1335
+ }[];
1336
+ notes: string[];
1337
+ }>;
1338
+ accessSnapshot(value: unknown): Promise<{
1339
+ grant: TikTokCatalogGrant;
1340
+ records: {
1341
+ id: string;
1342
+ name: string;
1343
+ business_center_id: string;
1344
+ access: "none" | "read" | "write" | "create";
1345
+ }[];
1346
+ }>;
1347
+ get(value: unknown): Promise<{
1348
+ catalog: {
1349
+ configuration_hash: string;
1350
+ catalog_id: string;
1351
+ catalog_name: string;
1352
+ catalog_type: string;
1353
+ bc_info: {
1354
+ [x: string]: unknown;
1355
+ bc_id: string;
1356
+ bc_name?: string | undefined;
1357
+ };
1358
+ catalog_conf: Record<string, unknown>;
1359
+ };
1360
+ records: {
1361
+ id: string;
1362
+ name: string;
1363
+ native_ad_eligibility: {};
1364
+ type: string;
1365
+ business_center: string;
1366
+ currency: {};
1367
+ country: {};
1368
+ }[];
1369
+ }>;
1370
+ plan(op: WriteOperation): Promise<Plan$1>;
1371
+ }
1372
+
1373
+ type Plan = Omit<WritePreview, 'serverValidated'> & {
1374
+ execute(): Promise<WriteResult>;
1375
+ };
1376
+ /** Official SDK f809c396 and current published share/cancel/log/BC-asset docs, checked2026-11-06. */
1377
+ declare class TikTokAudienceSharing {
1378
+ private readonly client;
1379
+ private readonly audiences;
1380
+ private readonly authorizeAccounts;
1381
+ constructor(client: TikTokClient, audiences: TikTokCustomAudiences, authorizeAccounts: (ids: string[]) => Promise<void>);
1382
+ private get;
1383
+ private owned;
1384
+ private log;
1385
+ private logs;
1386
+ private selection;
1387
+ private view;
1388
+ read(value: unknown): Promise<{
1389
+ records: {
1390
+ custom_audience_id: string;
1391
+ shared_advertiser_id: string;
1392
+ shared_advertiser_name: string;
1393
+ status: string;
1394
+ }[];
1395
+ shares: {
1396
+ custom_audience_id: string;
1397
+ shared_advertiser_id: string;
1398
+ shared_advertiser_name: string;
1399
+ status: string;
1400
+ }[];
1401
+ audiences: {
1402
+ id: string;
1403
+ name: string;
1404
+ snapshot_hash: string;
1405
+ }[];
1406
+ other_recipient_count: number;
1407
+ complete: boolean;
1408
+ truncated: boolean;
1409
+ notes: string[];
1410
+ }>;
1411
+ private businessAccounts;
1412
+ private prepare;
1413
+ context(value: unknown): Promise<{
1414
+ context_hash: string;
1415
+ action: "SHARE" | "UNSHARE";
1416
+ bc_id: string;
1417
+ accounts: {
1418
+ asset_id: string;
1419
+ asset_type: "ADVERTISER";
1420
+ asset_name: string;
1421
+ advertiser_role: string;
1422
+ }[];
1423
+ audiences: {
1424
+ native_status_message_present: boolean;
1425
+ native_error_reported: boolean;
1426
+ snapshot_hash: string;
1427
+ audience_id: string;
1428
+ name: string;
1429
+ type: string;
1430
+ owner_id?: string | undefined;
1431
+ is_creator?: boolean | undefined;
1432
+ shared?: boolean | undefined;
1433
+ is_valid?: boolean | undefined;
1434
+ is_expiring?: boolean | undefined;
1435
+ expired_time?: string | undefined;
1436
+ create_time?: string | undefined;
1437
+ calculate_type?: string | null | undefined;
1438
+ audience_sub_type?: string | undefined;
1439
+ rule?: string | null | undefined;
1440
+ is_auto_refresh?: boolean | undefined;
1441
+ lookalike_spec?: z.core.util.JSONType | undefined;
1442
+ cover_num?: number | undefined;
1443
+ }[];
1444
+ existing_pairs: {
1445
+ custom_audience_id: string;
1446
+ shared_advertiser_id: string;
1447
+ shared_advertiser_name: string;
1448
+ status: string;
1449
+ }[];
1450
+ records: {
1451
+ custom_audience_id: string;
1452
+ audience_name: string;
1453
+ recipient_advertiser_id: string;
1454
+ shared: boolean;
1455
+ }[];
1456
+ notes: string[];
1457
+ }>;
1458
+ plan(op: WriteOperation): Promise<Plan>;
1459
+ }
1460
+
28
1461
  /** TikTok budgets are floats in whole account-currency units. */
29
1462
  declare const UNITS_TO_MICROS = 1000000;
30
1463
  interface TikTokCampaign {
1464
+ advertiser_id?: string;
31
1465
  campaign_id: string;
32
1466
  campaign_name: string;
33
1467
  operation_status: 'ENABLE' | 'DISABLE';
@@ -40,10 +1474,19 @@ declare class TikTokAdsProvider implements AdProvider {
40
1474
  private readonly client;
41
1475
  private readonly app;
42
1476
  readonly id = "tiktok";
1477
+ readonly creatives: TikTokCreativeService;
1478
+ readonly audiences: TikTokAudienceService;
1479
+ readonly customAudiences: TikTokCustomAudiences;
1480
+ readonly audienceSources: TikTokAudienceSources;
1481
+ readonly audienceAuthoring: TikTokAudienceAuthoring;
1482
+ readonly audienceSharing: TikTokAudienceSharing;
1483
+ readonly measurement: TikTokMeasurementService;
1484
+ readonly automatedRules: TikTokAutomatedRulesService;
1485
+ readonly catalogs: TikTokCatalogService;
43
1486
  constructor(client: TikTokClient, app: {
44
1487
  appId: string;
45
1488
  secret: string;
46
- });
1489
+ }, media?: MediaResolver, catalogAccess?: TikTokCatalogAccessStore);
47
1490
  capabilities(): ProviderCapabilities;
48
1491
  standardActions(): StandardActions;
49
1492
  listAccounts(): Promise<Account[]>;
@@ -77,7 +1520,11 @@ declare class TikTokAdsProvider implements AdProvider {
77
1520
  private secret;
78
1521
  }
79
1522
 
80
- declare function tiktokTools(provider: TikTokAdsProvider): AnyToolDefinition[];
1523
+ declare function tiktokTools(provider: TikTokAdsProvider, options?: {
1524
+ catalogAccessManagement?: boolean;
1525
+ }): AnyToolDefinition[];
1526
+
1527
+ declare function tiktokCatalogTools(provider: Pick<TikTokAdsProvider, 'catalogs'>, accessManagement?: boolean): AnyToolDefinition[];
81
1528
 
82
1529
  declare function resolveTikTokCredentials(store: CredentialStore): Promise<(TikTokCredentials & {
83
1530
  appId: string;
@@ -85,4 +1532,4 @@ declare function resolveTikTokCredentials(store: CredentialStore): Promise<(TikT
85
1532
  }) | undefined>;
86
1533
  declare function createTikTokModule(store: CredentialStore): Promise<ProviderModule | undefined>;
87
1534
 
88
- export { TIKTOK_API_VERSION, TikTokAdsProvider, TikTokClient, type TikTokCredentials, UNITS_TO_MICROS, createTikTokModule, resolveTikTokCredentials, tiktokTools };
1535
+ export { FileTikTokCatalogAccessStore, TIKTOK_API_VERSION, TikTokAdsProvider, type TikTokCatalogAccessMode, type TikTokCatalogAccessStore, type TikTokCatalogGrant, type TikTokCatalogScope, TikTokCatalogService, TikTokClient, type TikTokCredentials, UNITS_TO_MICROS, catalogGrant, catalogScope, catalogScopeKey, createTikTokModule, creationScope, requireCatalogAccess, requireCatalogCreationAccess, resolveTikTokCredentials, tiktokCatalogTools, tiktokTools };