@trillboards/api-client 3.1.15 → 3.2.1

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.
@@ -1,3 +1,3 @@
1
- export { generatedTypes } from './chunk-X2AIWEHJ.mjs';
1
+ export { generatedTypes } from './chunk-JLSS2URG.mjs';
2
2
  //# sourceMappingURL=generated.mjs.map
3
3
  //# sourceMappingURL=generated.mjs.map
package/dist/index.d.mts CHANGED
@@ -1,12 +1,13 @@
1
- import { Screen, PartnerDeviceRegistrationInput, DisplaySettingsResponse, DisplaySettingsInput, Device, PartnerDeviceBatchRegistrationInput, Impression, AnalyticsData, EarningsData, ErrorEntry, Webhook, FleetCommand, AudienceData, BillingInfo, CreatePartnerSensingRouteRequest, SensingRoute, UpdatePartnerSensingRouteRequest, createCreativeFeedbackExperimentOperation, configureCreativeFeedbackBrandOperation, importCreativeFeedbackCreativeOperation, getCreativeFeedbackExperimentOperation, registerCreativeFeedbackVariantsOperation, updateCreativeFeedbackPolicyOperation, getCreativeFeedbackRewardsOperation, generateCreativeFeedbackCreativeOperation, reviewCreativeFeedbackCreativeOperation, stopCreativeFeedbackExperimentOperation, WebhookEvent } from './generated.mjs';
1
+ import { Screen, PartnerDeviceRegistrationInput, DisplaySettingsResponse, DisplaySettingsInput, Device, PartnerDeviceBatchRegistrationInput, Impression, AnalyticsData, EarningsData, ErrorEntry, Webhook, FleetCommand, AudienceData, dataApiListScreensOperation, dataApiScreenAudienceHistoryOperation, dataApiScreenAudienceLiveOperation, dataApiQueryDslOperation, dataApiStreamOperation, setupBillingOperation, createCreditCheckoutOperation, purchaseCreditsOperation, getBillingUsageSummaryOperation, BillingInfo, CreatePartnerSensingRouteRequest, SensingRoute, UpdatePartnerSensingRouteRequest, createCreativeFeedbackExperimentOperation, configureCreativeFeedbackBrandOperation, importCreativeFeedbackCreativeOperation, getCreativeFeedbackExperimentOperation, registerCreativeFeedbackVariantsOperation, updateCreativeFeedbackPolicyOperation, getCreativeFeedbackRewardsOperation, generateCreativeFeedbackCreativeOperation, reviewCreativeFeedbackCreativeOperation, stopCreativeFeedbackExperimentOperation, Mcp_get_products_Args, Mcp_list_accounts_Args, Mcp_sync_accounts_Args, Mcp_create_media_buy_Args, Mcp_get_media_buys_Args, Mcp_update_media_buy_Args, Mcp_get_media_buy_delivery_Args, Mcp_sync_creatives_Args, Mcp_discover_inventory_Args, WebhookEvent } from './generated.mjs';
2
2
  export { BleScanResultData, ContentFitSettings, CreativeRewardsReadyEvent, DeviceCapabilityPayload, FeedbackBrand, FeedbackBrandRequest, FeedbackCreateRequest, FeedbackExperiment, FeedbackGenerateRequest, FeedbackGeneratedCreative, FeedbackImportRequest, FeedbackPolicyRequest, FeedbackRegisterVariantsRequest, FeedbackReviewRequest, FeedbackRewardQuery, FeedbackRewardRow, FeedbackRewards, FeedbackStopRequest, GeneratedOperationName, GeneratedSchemaName, HttpProbeResult, MdnsNetworkDevice, PartnerAdDeliveryProfile, PartnerDeviceHeartbeatBody, PartnerHeartbeatMeasurementMetadata, PartnerHeartbeatQueryData, PartnerHeartbeatQueryResponse, PartnerHeartbeatRequest, PartnerHeartbeatResponse, PartnerSafeHeartbeatTelemetry, SsdpDeviceInfo, WifiEnvironmentSnapshot, WifiScanResult, generatedTypes, getDeviceHeartbeatOperation, heartbeatOperation } from './generated.mjs';
3
+ import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
3
4
 
4
5
  /**
5
6
  * Non-wire type definitions for the Trillboards API Client SDK.
6
7
  *
7
8
  * This file is DELIBERATELY narrow. Every type that has an on-the-wire peer in
8
9
  * the OpenAPI contract lives in `./generated` (emitted from
9
- * trillboard-api/docs/openapi/merged/partner-api.json via `npm run generate`)
10
+ * native partner/data OpenAPI and mounted MCP schemas via `npm run generate`)
10
11
  * and is re-exported from `./index`. What remains here is the set of types that
11
12
  * CANNOT be generated from the spec and are the SDK's own hand-crafted surface:
12
13
  *
@@ -150,7 +151,7 @@ interface SensingThresholdCrossedEvent {
150
151
  /**
151
152
  * Internal HTTP client for the Trillboards API.
152
153
  *
153
- * Uses native fetch (Node 18+). Zero runtime dependencies.
154
+ * Uses native fetch (Node 18+) for JSON requests and cancelable live streams.
154
155
  * Sends standard headers: Authorization, Content-Type, User-Agent, X-Trillboards-Client.
155
156
  */
156
157
 
@@ -189,6 +190,12 @@ declare class HttpClient {
189
190
  private readonly config;
190
191
  constructor(config: HttpClientConfig);
191
192
  request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
193
+ private requestResponse;
194
+ private readJson;
195
+ /** Open one authenticated live tail. The native endpoint has no replay cursor. */
196
+ openStream(path: string, options?: RequestOptions & {
197
+ signal?: AbortSignal;
198
+ }): Promise<Response>;
192
199
  get<T>(path: string, opts?: {
193
200
  params?: Record<string, unknown>;
194
201
  }): Promise<T>;
@@ -518,11 +525,18 @@ declare class AudienceClient {
518
525
  }>;
519
526
  }
520
527
 
521
- /**
522
- * DataClient — data export and venue intelligence.
523
- *
524
- * Base path: /v1/partner
525
- */
528
+ /** The SSE frame and its decoded JSON payload; in-band error events remain events. */
529
+ interface DataStreamEvent {
530
+ event: string;
531
+ data: unknown;
532
+ id?: string;
533
+ retry?: number;
534
+ }
535
+ interface StreamOptions {
536
+ signal?: AbortSignal;
537
+ }
538
+
539
+ /** Native data access through the existing authenticated transport. */
526
540
 
527
541
  declare class DataClient {
528
542
  private readonly http;
@@ -539,6 +553,12 @@ declare class DataClient {
539
553
  success: boolean;
540
554
  data: Record<string, unknown>;
541
555
  }>;
556
+ listScreens(query?: dataApiListScreensOperation['query']): Promise<dataApiListScreensOperation['response']>;
557
+ getHistory(screenId: string, query?: dataApiScreenAudienceHistoryOperation['query']): Promise<dataApiScreenAudienceHistoryOperation['response']>;
558
+ getAudience(screenId: string): Promise<dataApiScreenAudienceLiveOperation['response']>;
559
+ query(body: dataApiQueryDslOperation['request']): Promise<dataApiQueryDslOperation['response']>;
560
+ /** One live tail; reconnect explicitly and recover history through bounded reads. */
561
+ stream(query?: dataApiStreamOperation['query'], options?: StreamOptions): AsyncIterable<DataStreamEvent>;
542
562
  }
543
563
 
544
564
  /**
@@ -547,9 +567,18 @@ declare class DataClient {
547
567
  * Base path: /v1/partner
548
568
  */
549
569
 
570
+ /** Reuse the same key only for the exact same financial request. */
571
+ interface BillingOperationOptions {
572
+ idempotencyKey: string;
573
+ }
550
574
  declare class BillingClient {
551
575
  private readonly http;
552
576
  constructor(http: HttpClient);
577
+ setup(body: setupBillingOperation['request']): Promise<setupBillingOperation['response']>;
578
+ createCreditCheckout(body: createCreditCheckoutOperation['request'], options: BillingOperationOptions): Promise<createCreditCheckoutOperation['response']>;
579
+ purchaseCredits(body: purchaseCreditsOperation['request'], options: BillingOperationOptions): Promise<purchaseCreditsOperation['response']>;
580
+ /** Read the committed shared credit ledger after Stripe payment completes. */
581
+ getUsageSummary(): Promise<getBillingUsageSummaryOperation['response']>;
553
582
  /** Get current billing info (plan, credits, usage). */
554
583
  get(): Promise<{
555
584
  success: boolean;
@@ -637,6 +666,153 @@ declare class CreativeExperimentsClient {
637
666
  stop(id: string, body: stopCreativeFeedbackExperimentOperation['request']): Promise<stopCreativeFeedbackExperimentOperation['response']>;
638
667
  }
639
668
 
669
+ /** Native MCP errors retain their complete result, including structured receipts. */
670
+ declare class McpToolError extends Error {
671
+ readonly tool: string;
672
+ readonly result: CallToolResult;
673
+ readonly name = "McpToolError";
674
+ constructor(tool: string, result: CallToolResult);
675
+ }
676
+ interface MediaPagination {
677
+ has_more: boolean;
678
+ cursor?: string;
679
+ total_count?: number;
680
+ }
681
+ interface MediaProduct extends Record<string, unknown> {
682
+ product_id: string;
683
+ name?: string;
684
+ pricing_options: Array<{
685
+ pricing_option_id: string;
686
+ fixed_price?: number;
687
+ floor_price?: number;
688
+ currency?: string;
689
+ [key: string]: unknown;
690
+ }>;
691
+ }
692
+ interface MediaFunding extends Record<string, unknown> {
693
+ status: string;
694
+ required_cents?: number | string;
695
+ available_cents?: number | string;
696
+ drawn_cents?: number | string;
697
+ }
698
+ interface MediaPackage extends Record<string, unknown> {
699
+ package_id: string;
700
+ product_id?: string;
701
+ }
702
+ /** Selected native response fields; the complete extensible payload is preserved. */
703
+ interface MediaBuy extends Record<string, unknown> {
704
+ media_buy_id: string;
705
+ packages: MediaPackage[];
706
+ revision: number;
707
+ media_buy_status?: string;
708
+ status?: string;
709
+ funding?: MediaFunding;
710
+ }
711
+ interface MediaProductsResponse extends Record<string, unknown> {
712
+ products: MediaProduct[];
713
+ pagination?: MediaPagination;
714
+ }
715
+ interface MediaBuysResponse extends Record<string, unknown> {
716
+ media_buys: MediaBuy[];
717
+ pagination: MediaPagination;
718
+ }
719
+ interface MediaAccountsResponse extends Record<string, unknown> {
720
+ accounts: Array<{
721
+ account_id: string;
722
+ status: string;
723
+ [key: string]: unknown;
724
+ }>;
725
+ pagination?: MediaPagination;
726
+ }
727
+ interface MediaNativeError extends Record<string, unknown> {
728
+ code: string;
729
+ message: string;
730
+ }
731
+ interface MediaBuyUpdateResponse extends Record<string, unknown> {
732
+ media_buy_id: string;
733
+ revision: number;
734
+ media_buy_status: string;
735
+ sandbox: boolean;
736
+ affected_packages?: MediaPackage[];
737
+ applied: Record<string, unknown>;
738
+ unsupported: string[];
739
+ placements_updated: number;
740
+ placement_count: number;
741
+ }
742
+ interface MediaDeliveryResponse extends Record<string, unknown> {
743
+ media_buy_id: string;
744
+ impressions: number;
745
+ reach_screens: number;
746
+ contracted_spend_usd: number;
747
+ sandbox: boolean;
748
+ pacing: {
749
+ goal_impressions: number;
750
+ delivered: number;
751
+ delivery_rate: number;
752
+ };
753
+ dimensions_honoured: string[];
754
+ dimensions_unsupported: string[];
755
+ }
756
+ interface MediaCreativeSyncResponse extends Record<string, unknown> {
757
+ media_buy_id: string | null;
758
+ advertisement_id: string | null;
759
+ sandbox: boolean;
760
+ creatives: Array<{
761
+ creative_id: string;
762
+ action: string;
763
+ status?: string;
764
+ errors?: MediaNativeError[];
765
+ [key: string]: unknown;
766
+ }>;
767
+ validation_results: Array<Record<string, unknown>>;
768
+ approved_count: number;
769
+ rejected_count: number;
770
+ placements_activated: number;
771
+ servable: boolean;
772
+ funding?: MediaFunding;
773
+ moderation?: Record<string, unknown>;
774
+ validated_against: {
775
+ catalogue_generated_at: string;
776
+ stale: boolean;
777
+ };
778
+ }
779
+ interface MediaAccountsSyncResponse extends Record<string, unknown> {
780
+ dry_run: boolean;
781
+ accounts: Array<{
782
+ account_id: string | null;
783
+ action: string;
784
+ status?: string;
785
+ errors?: MediaNativeError[];
786
+ [key: string]: unknown;
787
+ }>;
788
+ }
789
+ declare class MediaBuysClient {
790
+ private readonly config;
791
+ private client?;
792
+ private transport?;
793
+ private connecting?;
794
+ constructor(config: HttpClientConfig);
795
+ private connection;
796
+ private call;
797
+ getProducts(args?: Mcp_get_products_Args): Promise<MediaProductsResponse>;
798
+ listAccounts(args?: Mcp_list_accounts_Args): Promise<MediaAccountsResponse>;
799
+ syncAccounts(args: Mcp_sync_accounts_Args): Promise<MediaAccountsSyncResponse>;
800
+ create(args: Mcp_create_media_buy_Args): Promise<MediaBuy>;
801
+ list(args?: Mcp_get_media_buys_Args): Promise<MediaBuysResponse>;
802
+ update(args: Mcp_update_media_buy_Args): Promise<MediaBuyUpdateResponse>;
803
+ getDelivery(args: Mcp_get_media_buy_delivery_Args): Promise<MediaDeliveryResponse>;
804
+ syncCreatives(args: Mcp_sync_creatives_Args): Promise<MediaCreativeSyncResponse>;
805
+ discoverInventory(args?: Mcp_discover_inventory_Args): Promise<{
806
+ success: boolean;
807
+ data: {
808
+ screens: Array<Record<string, unknown>>;
809
+ [key: string]: unknown;
810
+ };
811
+ }>;
812
+ /** Release MCP streams and terminate an optional server session. */
813
+ close(): Promise<void>;
814
+ }
815
+
640
816
  /**
641
817
  * TrillboardsClient — main entry point for the Trillboards Partner API SDK.
642
818
  *
@@ -661,6 +837,7 @@ declare class TrillboardsClient {
661
837
  readonly billing: BillingClient;
662
838
  readonly routes: RoutesClient;
663
839
  readonly creativeExperiments: CreativeExperimentsClient;
840
+ readonly mediaBuys: MediaBuysClient;
664
841
  /** The underlying HTTP client (exposed for advanced use cases). */
665
842
  readonly _http: HttpClient;
666
843
  constructor(options: ClientOptions);
@@ -913,6 +1090,6 @@ declare const Webhooks: {
913
1090
  * SDK version constant. Sent in User-Agent and X-Trillboards-Client headers.
914
1091
  * Keep in sync with package.json version.
915
1092
  */
916
- declare const VERSION = "3.1.15";
1093
+ declare const VERSION = "3.2.1";
917
1094
 
918
- export { ADCP_WEBHOOK_SIGNING_TAG, type AdcpJwk, AnalyticsClient, AnalyticsData, type ApiErrorType, AudienceClient, AudienceData, BillingClient, BillingInfo, type ClientOptions, type ConstructEventOptions, type ContentFitMode, CreatePartnerSensingRouteRequest, CreativeExperimentsClient, DataClient, Device, DevicesClient, DisplaySettingsInput, DisplaySettingsResponse, EarningsClient, EarningsData, type ErrorDetail, ErrorEntry, type ErrorResponseBody, ErrorsClient, FleetClient, FleetCommand, Impression, ImpressionsClient, type ListResponse, type ParsedSignatureHeader, PartnerDeviceBatchRegistrationInput, PartnerDeviceRegistrationInput, type RequestOptions, type RetryOptions, type RouteAction, type RouteChannel, type RouteCondition, type RouteConditionOp, type RouteDigest, type RouteDigestSummary, type RouteWebhookEvent, RoutesClient, Screen, ScreensClient, SensingRoute, type SensingThresholdCrossedEvent, TrillboardsClient, TrillboardsError, type TrillboardsErrorOptions, UpdatePartnerSensingRouteRequest, VERSION, type VerifyAdcpWebhookOptions, Webhook, WebhookEvent, type WebhookHeaders, Webhooks, WebhooksClient, constructEvent, constructEventLegacy, parseSignatureHeader, retryWithBackoff, verifyAdcpWebhook };
1095
+ export { ADCP_WEBHOOK_SIGNING_TAG, type AdcpJwk, AnalyticsClient, AnalyticsData, type ApiErrorType, AudienceClient, AudienceData, BillingClient, BillingInfo, type BillingOperationOptions, type ClientOptions, type ConstructEventOptions, type ContentFitMode, CreatePartnerSensingRouteRequest, CreativeExperimentsClient, DataClient, type DataStreamEvent, Device, DevicesClient, DisplaySettingsInput, DisplaySettingsResponse, EarningsClient, EarningsData, type ErrorDetail, ErrorEntry, type ErrorResponseBody, ErrorsClient, FleetClient, FleetCommand, Impression, ImpressionsClient, type ListResponse, McpToolError, Mcp_create_media_buy_Args, Mcp_discover_inventory_Args, Mcp_get_media_buy_delivery_Args, Mcp_get_media_buys_Args, Mcp_get_products_Args, Mcp_list_accounts_Args, Mcp_sync_accounts_Args, Mcp_sync_creatives_Args, Mcp_update_media_buy_Args, type MediaAccountsResponse, type MediaAccountsSyncResponse, type MediaBuy, type MediaBuyUpdateResponse, MediaBuysClient, type MediaBuysResponse, type MediaCreativeSyncResponse, type MediaDeliveryResponse, type MediaFunding, type MediaNativeError, type MediaPackage, type MediaPagination, type MediaProduct, type MediaProductsResponse, type ParsedSignatureHeader, PartnerDeviceBatchRegistrationInput, PartnerDeviceRegistrationInput, type RequestOptions, type RetryOptions, type RouteAction, type RouteChannel, type RouteCondition, type RouteConditionOp, type RouteDigest, type RouteDigestSummary, type RouteWebhookEvent, RoutesClient, Screen, ScreensClient, SensingRoute, type SensingThresholdCrossedEvent, type StreamOptions, TrillboardsClient, TrillboardsError, type TrillboardsErrorOptions, UpdatePartnerSensingRouteRequest, VERSION, type VerifyAdcpWebhookOptions, Webhook, WebhookEvent, type WebhookHeaders, Webhooks, WebhooksClient, constructEvent, constructEventLegacy, createCreditCheckoutOperation, dataApiListScreensOperation, dataApiQueryDslOperation, dataApiScreenAudienceHistoryOperation, dataApiScreenAudienceLiveOperation, dataApiStreamOperation, getBillingUsageSummaryOperation, parseSignatureHeader, purchaseCreditsOperation, retryWithBackoff, setupBillingOperation, verifyAdcpWebhook };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { Screen, PartnerDeviceRegistrationInput, DisplaySettingsResponse, DisplaySettingsInput, Device, PartnerDeviceBatchRegistrationInput, Impression, AnalyticsData, EarningsData, ErrorEntry, Webhook, FleetCommand, AudienceData, BillingInfo, CreatePartnerSensingRouteRequest, SensingRoute, UpdatePartnerSensingRouteRequest, createCreativeFeedbackExperimentOperation, configureCreativeFeedbackBrandOperation, importCreativeFeedbackCreativeOperation, getCreativeFeedbackExperimentOperation, registerCreativeFeedbackVariantsOperation, updateCreativeFeedbackPolicyOperation, getCreativeFeedbackRewardsOperation, generateCreativeFeedbackCreativeOperation, reviewCreativeFeedbackCreativeOperation, stopCreativeFeedbackExperimentOperation, WebhookEvent } from './generated.js';
1
+ import { Screen, PartnerDeviceRegistrationInput, DisplaySettingsResponse, DisplaySettingsInput, Device, PartnerDeviceBatchRegistrationInput, Impression, AnalyticsData, EarningsData, ErrorEntry, Webhook, FleetCommand, AudienceData, dataApiListScreensOperation, dataApiScreenAudienceHistoryOperation, dataApiScreenAudienceLiveOperation, dataApiQueryDslOperation, dataApiStreamOperation, setupBillingOperation, createCreditCheckoutOperation, purchaseCreditsOperation, getBillingUsageSummaryOperation, BillingInfo, CreatePartnerSensingRouteRequest, SensingRoute, UpdatePartnerSensingRouteRequest, createCreativeFeedbackExperimentOperation, configureCreativeFeedbackBrandOperation, importCreativeFeedbackCreativeOperation, getCreativeFeedbackExperimentOperation, registerCreativeFeedbackVariantsOperation, updateCreativeFeedbackPolicyOperation, getCreativeFeedbackRewardsOperation, generateCreativeFeedbackCreativeOperation, reviewCreativeFeedbackCreativeOperation, stopCreativeFeedbackExperimentOperation, Mcp_get_products_Args, Mcp_list_accounts_Args, Mcp_sync_accounts_Args, Mcp_create_media_buy_Args, Mcp_get_media_buys_Args, Mcp_update_media_buy_Args, Mcp_get_media_buy_delivery_Args, Mcp_sync_creatives_Args, Mcp_discover_inventory_Args, WebhookEvent } from './generated.js';
2
2
  export { BleScanResultData, ContentFitSettings, CreativeRewardsReadyEvent, DeviceCapabilityPayload, FeedbackBrand, FeedbackBrandRequest, FeedbackCreateRequest, FeedbackExperiment, FeedbackGenerateRequest, FeedbackGeneratedCreative, FeedbackImportRequest, FeedbackPolicyRequest, FeedbackRegisterVariantsRequest, FeedbackReviewRequest, FeedbackRewardQuery, FeedbackRewardRow, FeedbackRewards, FeedbackStopRequest, GeneratedOperationName, GeneratedSchemaName, HttpProbeResult, MdnsNetworkDevice, PartnerAdDeliveryProfile, PartnerDeviceHeartbeatBody, PartnerHeartbeatMeasurementMetadata, PartnerHeartbeatQueryData, PartnerHeartbeatQueryResponse, PartnerHeartbeatRequest, PartnerHeartbeatResponse, PartnerSafeHeartbeatTelemetry, SsdpDeviceInfo, WifiEnvironmentSnapshot, WifiScanResult, generatedTypes, getDeviceHeartbeatOperation, heartbeatOperation } from './generated.js';
3
+ import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
3
4
 
4
5
  /**
5
6
  * Non-wire type definitions for the Trillboards API Client SDK.
6
7
  *
7
8
  * This file is DELIBERATELY narrow. Every type that has an on-the-wire peer in
8
9
  * the OpenAPI contract lives in `./generated` (emitted from
9
- * trillboard-api/docs/openapi/merged/partner-api.json via `npm run generate`)
10
+ * native partner/data OpenAPI and mounted MCP schemas via `npm run generate`)
10
11
  * and is re-exported from `./index`. What remains here is the set of types that
11
12
  * CANNOT be generated from the spec and are the SDK's own hand-crafted surface:
12
13
  *
@@ -150,7 +151,7 @@ interface SensingThresholdCrossedEvent {
150
151
  /**
151
152
  * Internal HTTP client for the Trillboards API.
152
153
  *
153
- * Uses native fetch (Node 18+). Zero runtime dependencies.
154
+ * Uses native fetch (Node 18+) for JSON requests and cancelable live streams.
154
155
  * Sends standard headers: Authorization, Content-Type, User-Agent, X-Trillboards-Client.
155
156
  */
156
157
 
@@ -189,6 +190,12 @@ declare class HttpClient {
189
190
  private readonly config;
190
191
  constructor(config: HttpClientConfig);
191
192
  request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
193
+ private requestResponse;
194
+ private readJson;
195
+ /** Open one authenticated live tail. The native endpoint has no replay cursor. */
196
+ openStream(path: string, options?: RequestOptions & {
197
+ signal?: AbortSignal;
198
+ }): Promise<Response>;
192
199
  get<T>(path: string, opts?: {
193
200
  params?: Record<string, unknown>;
194
201
  }): Promise<T>;
@@ -518,11 +525,18 @@ declare class AudienceClient {
518
525
  }>;
519
526
  }
520
527
 
521
- /**
522
- * DataClient — data export and venue intelligence.
523
- *
524
- * Base path: /v1/partner
525
- */
528
+ /** The SSE frame and its decoded JSON payload; in-band error events remain events. */
529
+ interface DataStreamEvent {
530
+ event: string;
531
+ data: unknown;
532
+ id?: string;
533
+ retry?: number;
534
+ }
535
+ interface StreamOptions {
536
+ signal?: AbortSignal;
537
+ }
538
+
539
+ /** Native data access through the existing authenticated transport. */
526
540
 
527
541
  declare class DataClient {
528
542
  private readonly http;
@@ -539,6 +553,12 @@ declare class DataClient {
539
553
  success: boolean;
540
554
  data: Record<string, unknown>;
541
555
  }>;
556
+ listScreens(query?: dataApiListScreensOperation['query']): Promise<dataApiListScreensOperation['response']>;
557
+ getHistory(screenId: string, query?: dataApiScreenAudienceHistoryOperation['query']): Promise<dataApiScreenAudienceHistoryOperation['response']>;
558
+ getAudience(screenId: string): Promise<dataApiScreenAudienceLiveOperation['response']>;
559
+ query(body: dataApiQueryDslOperation['request']): Promise<dataApiQueryDslOperation['response']>;
560
+ /** One live tail; reconnect explicitly and recover history through bounded reads. */
561
+ stream(query?: dataApiStreamOperation['query'], options?: StreamOptions): AsyncIterable<DataStreamEvent>;
542
562
  }
543
563
 
544
564
  /**
@@ -547,9 +567,18 @@ declare class DataClient {
547
567
  * Base path: /v1/partner
548
568
  */
549
569
 
570
+ /** Reuse the same key only for the exact same financial request. */
571
+ interface BillingOperationOptions {
572
+ idempotencyKey: string;
573
+ }
550
574
  declare class BillingClient {
551
575
  private readonly http;
552
576
  constructor(http: HttpClient);
577
+ setup(body: setupBillingOperation['request']): Promise<setupBillingOperation['response']>;
578
+ createCreditCheckout(body: createCreditCheckoutOperation['request'], options: BillingOperationOptions): Promise<createCreditCheckoutOperation['response']>;
579
+ purchaseCredits(body: purchaseCreditsOperation['request'], options: BillingOperationOptions): Promise<purchaseCreditsOperation['response']>;
580
+ /** Read the committed shared credit ledger after Stripe payment completes. */
581
+ getUsageSummary(): Promise<getBillingUsageSummaryOperation['response']>;
553
582
  /** Get current billing info (plan, credits, usage). */
554
583
  get(): Promise<{
555
584
  success: boolean;
@@ -637,6 +666,153 @@ declare class CreativeExperimentsClient {
637
666
  stop(id: string, body: stopCreativeFeedbackExperimentOperation['request']): Promise<stopCreativeFeedbackExperimentOperation['response']>;
638
667
  }
639
668
 
669
+ /** Native MCP errors retain their complete result, including structured receipts. */
670
+ declare class McpToolError extends Error {
671
+ readonly tool: string;
672
+ readonly result: CallToolResult;
673
+ readonly name = "McpToolError";
674
+ constructor(tool: string, result: CallToolResult);
675
+ }
676
+ interface MediaPagination {
677
+ has_more: boolean;
678
+ cursor?: string;
679
+ total_count?: number;
680
+ }
681
+ interface MediaProduct extends Record<string, unknown> {
682
+ product_id: string;
683
+ name?: string;
684
+ pricing_options: Array<{
685
+ pricing_option_id: string;
686
+ fixed_price?: number;
687
+ floor_price?: number;
688
+ currency?: string;
689
+ [key: string]: unknown;
690
+ }>;
691
+ }
692
+ interface MediaFunding extends Record<string, unknown> {
693
+ status: string;
694
+ required_cents?: number | string;
695
+ available_cents?: number | string;
696
+ drawn_cents?: number | string;
697
+ }
698
+ interface MediaPackage extends Record<string, unknown> {
699
+ package_id: string;
700
+ product_id?: string;
701
+ }
702
+ /** Selected native response fields; the complete extensible payload is preserved. */
703
+ interface MediaBuy extends Record<string, unknown> {
704
+ media_buy_id: string;
705
+ packages: MediaPackage[];
706
+ revision: number;
707
+ media_buy_status?: string;
708
+ status?: string;
709
+ funding?: MediaFunding;
710
+ }
711
+ interface MediaProductsResponse extends Record<string, unknown> {
712
+ products: MediaProduct[];
713
+ pagination?: MediaPagination;
714
+ }
715
+ interface MediaBuysResponse extends Record<string, unknown> {
716
+ media_buys: MediaBuy[];
717
+ pagination: MediaPagination;
718
+ }
719
+ interface MediaAccountsResponse extends Record<string, unknown> {
720
+ accounts: Array<{
721
+ account_id: string;
722
+ status: string;
723
+ [key: string]: unknown;
724
+ }>;
725
+ pagination?: MediaPagination;
726
+ }
727
+ interface MediaNativeError extends Record<string, unknown> {
728
+ code: string;
729
+ message: string;
730
+ }
731
+ interface MediaBuyUpdateResponse extends Record<string, unknown> {
732
+ media_buy_id: string;
733
+ revision: number;
734
+ media_buy_status: string;
735
+ sandbox: boolean;
736
+ affected_packages?: MediaPackage[];
737
+ applied: Record<string, unknown>;
738
+ unsupported: string[];
739
+ placements_updated: number;
740
+ placement_count: number;
741
+ }
742
+ interface MediaDeliveryResponse extends Record<string, unknown> {
743
+ media_buy_id: string;
744
+ impressions: number;
745
+ reach_screens: number;
746
+ contracted_spend_usd: number;
747
+ sandbox: boolean;
748
+ pacing: {
749
+ goal_impressions: number;
750
+ delivered: number;
751
+ delivery_rate: number;
752
+ };
753
+ dimensions_honoured: string[];
754
+ dimensions_unsupported: string[];
755
+ }
756
+ interface MediaCreativeSyncResponse extends Record<string, unknown> {
757
+ media_buy_id: string | null;
758
+ advertisement_id: string | null;
759
+ sandbox: boolean;
760
+ creatives: Array<{
761
+ creative_id: string;
762
+ action: string;
763
+ status?: string;
764
+ errors?: MediaNativeError[];
765
+ [key: string]: unknown;
766
+ }>;
767
+ validation_results: Array<Record<string, unknown>>;
768
+ approved_count: number;
769
+ rejected_count: number;
770
+ placements_activated: number;
771
+ servable: boolean;
772
+ funding?: MediaFunding;
773
+ moderation?: Record<string, unknown>;
774
+ validated_against: {
775
+ catalogue_generated_at: string;
776
+ stale: boolean;
777
+ };
778
+ }
779
+ interface MediaAccountsSyncResponse extends Record<string, unknown> {
780
+ dry_run: boolean;
781
+ accounts: Array<{
782
+ account_id: string | null;
783
+ action: string;
784
+ status?: string;
785
+ errors?: MediaNativeError[];
786
+ [key: string]: unknown;
787
+ }>;
788
+ }
789
+ declare class MediaBuysClient {
790
+ private readonly config;
791
+ private client?;
792
+ private transport?;
793
+ private connecting?;
794
+ constructor(config: HttpClientConfig);
795
+ private connection;
796
+ private call;
797
+ getProducts(args?: Mcp_get_products_Args): Promise<MediaProductsResponse>;
798
+ listAccounts(args?: Mcp_list_accounts_Args): Promise<MediaAccountsResponse>;
799
+ syncAccounts(args: Mcp_sync_accounts_Args): Promise<MediaAccountsSyncResponse>;
800
+ create(args: Mcp_create_media_buy_Args): Promise<MediaBuy>;
801
+ list(args?: Mcp_get_media_buys_Args): Promise<MediaBuysResponse>;
802
+ update(args: Mcp_update_media_buy_Args): Promise<MediaBuyUpdateResponse>;
803
+ getDelivery(args: Mcp_get_media_buy_delivery_Args): Promise<MediaDeliveryResponse>;
804
+ syncCreatives(args: Mcp_sync_creatives_Args): Promise<MediaCreativeSyncResponse>;
805
+ discoverInventory(args?: Mcp_discover_inventory_Args): Promise<{
806
+ success: boolean;
807
+ data: {
808
+ screens: Array<Record<string, unknown>>;
809
+ [key: string]: unknown;
810
+ };
811
+ }>;
812
+ /** Release MCP streams and terminate an optional server session. */
813
+ close(): Promise<void>;
814
+ }
815
+
640
816
  /**
641
817
  * TrillboardsClient — main entry point for the Trillboards Partner API SDK.
642
818
  *
@@ -661,6 +837,7 @@ declare class TrillboardsClient {
661
837
  readonly billing: BillingClient;
662
838
  readonly routes: RoutesClient;
663
839
  readonly creativeExperiments: CreativeExperimentsClient;
840
+ readonly mediaBuys: MediaBuysClient;
664
841
  /** The underlying HTTP client (exposed for advanced use cases). */
665
842
  readonly _http: HttpClient;
666
843
  constructor(options: ClientOptions);
@@ -913,6 +1090,6 @@ declare const Webhooks: {
913
1090
  * SDK version constant. Sent in User-Agent and X-Trillboards-Client headers.
914
1091
  * Keep in sync with package.json version.
915
1092
  */
916
- declare const VERSION = "3.1.15";
1093
+ declare const VERSION = "3.2.1";
917
1094
 
918
- export { ADCP_WEBHOOK_SIGNING_TAG, type AdcpJwk, AnalyticsClient, AnalyticsData, type ApiErrorType, AudienceClient, AudienceData, BillingClient, BillingInfo, type ClientOptions, type ConstructEventOptions, type ContentFitMode, CreatePartnerSensingRouteRequest, CreativeExperimentsClient, DataClient, Device, DevicesClient, DisplaySettingsInput, DisplaySettingsResponse, EarningsClient, EarningsData, type ErrorDetail, ErrorEntry, type ErrorResponseBody, ErrorsClient, FleetClient, FleetCommand, Impression, ImpressionsClient, type ListResponse, type ParsedSignatureHeader, PartnerDeviceBatchRegistrationInput, PartnerDeviceRegistrationInput, type RequestOptions, type RetryOptions, type RouteAction, type RouteChannel, type RouteCondition, type RouteConditionOp, type RouteDigest, type RouteDigestSummary, type RouteWebhookEvent, RoutesClient, Screen, ScreensClient, SensingRoute, type SensingThresholdCrossedEvent, TrillboardsClient, TrillboardsError, type TrillboardsErrorOptions, UpdatePartnerSensingRouteRequest, VERSION, type VerifyAdcpWebhookOptions, Webhook, WebhookEvent, type WebhookHeaders, Webhooks, WebhooksClient, constructEvent, constructEventLegacy, parseSignatureHeader, retryWithBackoff, verifyAdcpWebhook };
1095
+ export { ADCP_WEBHOOK_SIGNING_TAG, type AdcpJwk, AnalyticsClient, AnalyticsData, type ApiErrorType, AudienceClient, AudienceData, BillingClient, BillingInfo, type BillingOperationOptions, type ClientOptions, type ConstructEventOptions, type ContentFitMode, CreatePartnerSensingRouteRequest, CreativeExperimentsClient, DataClient, type DataStreamEvent, Device, DevicesClient, DisplaySettingsInput, DisplaySettingsResponse, EarningsClient, EarningsData, type ErrorDetail, ErrorEntry, type ErrorResponseBody, ErrorsClient, FleetClient, FleetCommand, Impression, ImpressionsClient, type ListResponse, McpToolError, Mcp_create_media_buy_Args, Mcp_discover_inventory_Args, Mcp_get_media_buy_delivery_Args, Mcp_get_media_buys_Args, Mcp_get_products_Args, Mcp_list_accounts_Args, Mcp_sync_accounts_Args, Mcp_sync_creatives_Args, Mcp_update_media_buy_Args, type MediaAccountsResponse, type MediaAccountsSyncResponse, type MediaBuy, type MediaBuyUpdateResponse, MediaBuysClient, type MediaBuysResponse, type MediaCreativeSyncResponse, type MediaDeliveryResponse, type MediaFunding, type MediaNativeError, type MediaPackage, type MediaPagination, type MediaProduct, type MediaProductsResponse, type ParsedSignatureHeader, PartnerDeviceBatchRegistrationInput, PartnerDeviceRegistrationInput, type RequestOptions, type RetryOptions, type RouteAction, type RouteChannel, type RouteCondition, type RouteConditionOp, type RouteDigest, type RouteDigestSummary, type RouteWebhookEvent, RoutesClient, Screen, ScreensClient, SensingRoute, type SensingThresholdCrossedEvent, type StreamOptions, TrillboardsClient, TrillboardsError, type TrillboardsErrorOptions, UpdatePartnerSensingRouteRequest, VERSION, type VerifyAdcpWebhookOptions, Webhook, WebhookEvent, type WebhookHeaders, Webhooks, WebhooksClient, constructEvent, constructEventLegacy, createCreditCheckoutOperation, dataApiListScreensOperation, dataApiQueryDslOperation, dataApiScreenAudienceHistoryOperation, dataApiScreenAudienceLiveOperation, dataApiStreamOperation, getBillingUsageSummaryOperation, parseSignatureHeader, purchaseCreditsOperation, retryWithBackoff, setupBillingOperation, verifyAdcpWebhook };