@trillboards/api-client 3.5.1 → 3.5.2
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.mts +15 -8
- package/dist/index.d.ts +15 -8
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -915,13 +915,13 @@ interface AdvertiserOptions {
|
|
|
915
915
|
}
|
|
916
916
|
type AdvertiserOperationId = keyof AdvertiserOperations;
|
|
917
917
|
type Operation$1<K extends AdvertiserOperationId> = AdvertiserOperations[K];
|
|
918
|
-
type Part<Name extends string, Value> = {} extends Value ? {
|
|
918
|
+
type Part$1<Name extends string, Value> = {} extends Value ? {
|
|
919
919
|
[P in Name]?: Value;
|
|
920
920
|
} : {
|
|
921
921
|
[P in Name]: Value;
|
|
922
922
|
};
|
|
923
923
|
type Body<K extends AdvertiserOperationId> = Operation$1<K>['request'] | ((typeof advertiserRoutes)[K]['contentType'] extends 'multipart/form-data' ? FormData : never);
|
|
924
|
-
type AdvertiserRequest<K extends AdvertiserOperationId> = Part<'params', Operation$1<K>['params']> & Part<'query', Operation$1<K>['query']> & Part<'headers', NonNullable<Operation$1<K>['headers']>> & ([Body<K>] extends [never] ? {
|
|
924
|
+
type AdvertiserRequest<K extends AdvertiserOperationId> = Part$1<'params', Operation$1<K>['params']> & Part$1<'query', Operation$1<K>['query']> & Part$1<'headers', NonNullable<Operation$1<K>['headers']>> & ([Body<K>] extends [never] ? {
|
|
925
925
|
body?: never;
|
|
926
926
|
} : NonNullable<Operation$1<K>['requestRequired']> extends true ? {
|
|
927
927
|
body: Body<K>;
|
|
@@ -1190,7 +1190,7 @@ declare const Webhooks: {
|
|
|
1190
1190
|
* fails the PR when they differ, and the publish lane's tests (publish-api-client.yml)
|
|
1191
1191
|
* refuse the release.
|
|
1192
1192
|
*/
|
|
1193
|
-
declare const VERSION = "3.5.
|
|
1193
|
+
declare const VERSION = "3.5.2";
|
|
1194
1194
|
|
|
1195
1195
|
interface DspClientOptions {
|
|
1196
1196
|
/** The existing platform API key linked to the DSP seat. Omit only for onboarding. */
|
|
@@ -1199,16 +1199,23 @@ interface DspClientOptions {
|
|
|
1199
1199
|
version?: string;
|
|
1200
1200
|
}
|
|
1201
1201
|
type Operation = keyof DspOperations;
|
|
1202
|
-
type
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1202
|
+
type Part<Name extends string, Value> = {} extends Value ? {
|
|
1203
|
+
[P in Name]?: Value;
|
|
1204
|
+
} : {
|
|
1205
|
+
[P in Name]: Value;
|
|
1206
1206
|
};
|
|
1207
|
+
type DspInput<K extends Operation> = Part<'params', DspOperations[K]['params']> & Part<'query', DspOperations[K]['query']> & ([DspOperations[K]['request']] extends [never] ? {
|
|
1208
|
+
body?: never;
|
|
1209
|
+
} : NonNullable<DspOperations[K]['requestRequired']> extends true ? {
|
|
1210
|
+
body: DspOperations[K]['request'];
|
|
1211
|
+
} : {
|
|
1212
|
+
body?: DspOperations[K]['request'];
|
|
1213
|
+
});
|
|
1207
1214
|
/** Typed transport over the mounted DSP operations; native owners handle each action. */
|
|
1208
1215
|
declare class DspClient {
|
|
1209
1216
|
private readonly http;
|
|
1210
1217
|
constructor(options?: DspClientOptions);
|
|
1211
|
-
execute<K extends Operation>(operation: K, input?: DspInput<K>): Promise<DspOperations[K]['response']>;
|
|
1218
|
+
execute<K extends Operation>(operation: K, ...args: {} extends DspInput<K> ? [input?: DspInput<K>] : [input: DspInput<K>]): Promise<DspOperations[K]['response']>;
|
|
1212
1219
|
}
|
|
1213
1220
|
|
|
1214
1221
|
export { ADCP_WEBHOOK_SIGNING_TAG, ADVERTISER_BUYING_RESOURCE, type AdcpJwk, AdvertiserBuyingClient, type AdvertiserBuyingOptions, AdvertiserClient, type AdvertiserOperationId, AdvertiserOperations, type AdvertiserOptions, type AdvertiserRequest, type AdvertiserResponse, AnalyticsClient, AnalyticsData, type ApiErrorType, AudienceClient, AudienceData, BillingClient, BillingInfo, type BillingOperationOptions, type BuyerWriteOptions, type ClientOptions, type ConstructEventOptions, type ContentFitMode, CreatePartnerSensingRouteRequest, CreativeExperimentsClient, DataClient, type DataStreamEvent, Device, DevicesClient, DisplaySettingsInput, DisplaySettingsResponse, DspClient, type DspClientOptions, type DspInput, DspOperations, 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, ReactiveClient, 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, advertiserRoutes, constructEvent, constructEventLegacy, createCreditCheckoutOperation, dataApiListScreensOperation, dataApiQueryDslOperation, dataApiScreenAudienceHistoryOperation, dataApiScreenAudienceLiveOperation, dataApiStreamOperation, getBillingUsageSummaryOperation, parseSignatureHeader, purchaseCreditsOperation, retryWithBackoff, setupBillingOperation, verifyAdcpWebhook };
|
package/dist/index.d.ts
CHANGED
|
@@ -915,13 +915,13 @@ interface AdvertiserOptions {
|
|
|
915
915
|
}
|
|
916
916
|
type AdvertiserOperationId = keyof AdvertiserOperations;
|
|
917
917
|
type Operation$1<K extends AdvertiserOperationId> = AdvertiserOperations[K];
|
|
918
|
-
type Part<Name extends string, Value> = {} extends Value ? {
|
|
918
|
+
type Part$1<Name extends string, Value> = {} extends Value ? {
|
|
919
919
|
[P in Name]?: Value;
|
|
920
920
|
} : {
|
|
921
921
|
[P in Name]: Value;
|
|
922
922
|
};
|
|
923
923
|
type Body<K extends AdvertiserOperationId> = Operation$1<K>['request'] | ((typeof advertiserRoutes)[K]['contentType'] extends 'multipart/form-data' ? FormData : never);
|
|
924
|
-
type AdvertiserRequest<K extends AdvertiserOperationId> = Part<'params', Operation$1<K>['params']> & Part<'query', Operation$1<K>['query']> & Part<'headers', NonNullable<Operation$1<K>['headers']>> & ([Body<K>] extends [never] ? {
|
|
924
|
+
type AdvertiserRequest<K extends AdvertiserOperationId> = Part$1<'params', Operation$1<K>['params']> & Part$1<'query', Operation$1<K>['query']> & Part$1<'headers', NonNullable<Operation$1<K>['headers']>> & ([Body<K>] extends [never] ? {
|
|
925
925
|
body?: never;
|
|
926
926
|
} : NonNullable<Operation$1<K>['requestRequired']> extends true ? {
|
|
927
927
|
body: Body<K>;
|
|
@@ -1190,7 +1190,7 @@ declare const Webhooks: {
|
|
|
1190
1190
|
* fails the PR when they differ, and the publish lane's tests (publish-api-client.yml)
|
|
1191
1191
|
* refuse the release.
|
|
1192
1192
|
*/
|
|
1193
|
-
declare const VERSION = "3.5.
|
|
1193
|
+
declare const VERSION = "3.5.2";
|
|
1194
1194
|
|
|
1195
1195
|
interface DspClientOptions {
|
|
1196
1196
|
/** The existing platform API key linked to the DSP seat. Omit only for onboarding. */
|
|
@@ -1199,16 +1199,23 @@ interface DspClientOptions {
|
|
|
1199
1199
|
version?: string;
|
|
1200
1200
|
}
|
|
1201
1201
|
type Operation = keyof DspOperations;
|
|
1202
|
-
type
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1202
|
+
type Part<Name extends string, Value> = {} extends Value ? {
|
|
1203
|
+
[P in Name]?: Value;
|
|
1204
|
+
} : {
|
|
1205
|
+
[P in Name]: Value;
|
|
1206
1206
|
};
|
|
1207
|
+
type DspInput<K extends Operation> = Part<'params', DspOperations[K]['params']> & Part<'query', DspOperations[K]['query']> & ([DspOperations[K]['request']] extends [never] ? {
|
|
1208
|
+
body?: never;
|
|
1209
|
+
} : NonNullable<DspOperations[K]['requestRequired']> extends true ? {
|
|
1210
|
+
body: DspOperations[K]['request'];
|
|
1211
|
+
} : {
|
|
1212
|
+
body?: DspOperations[K]['request'];
|
|
1213
|
+
});
|
|
1207
1214
|
/** Typed transport over the mounted DSP operations; native owners handle each action. */
|
|
1208
1215
|
declare class DspClient {
|
|
1209
1216
|
private readonly http;
|
|
1210
1217
|
constructor(options?: DspClientOptions);
|
|
1211
|
-
execute<K extends Operation>(operation: K, input?: DspInput<K>): Promise<DspOperations[K]['response']>;
|
|
1218
|
+
execute<K extends Operation>(operation: K, ...args: {} extends DspInput<K> ? [input?: DspInput<K>] : [input: DspInput<K>]): Promise<DspOperations[K]['response']>;
|
|
1212
1219
|
}
|
|
1213
1220
|
|
|
1214
1221
|
export { ADCP_WEBHOOK_SIGNING_TAG, ADVERTISER_BUYING_RESOURCE, type AdcpJwk, AdvertiserBuyingClient, type AdvertiserBuyingOptions, AdvertiserClient, type AdvertiserOperationId, AdvertiserOperations, type AdvertiserOptions, type AdvertiserRequest, type AdvertiserResponse, AnalyticsClient, AnalyticsData, type ApiErrorType, AudienceClient, AudienceData, BillingClient, BillingInfo, type BillingOperationOptions, type BuyerWriteOptions, type ClientOptions, type ConstructEventOptions, type ContentFitMode, CreatePartnerSensingRouteRequest, CreativeExperimentsClient, DataClient, type DataStreamEvent, Device, DevicesClient, DisplaySettingsInput, DisplaySettingsResponse, DspClient, type DspClientOptions, type DspInput, DspOperations, 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, ReactiveClient, 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, advertiserRoutes, constructEvent, constructEventLegacy, createCreditCheckoutOperation, dataApiListScreensOperation, dataApiQueryDslOperation, dataApiScreenAudienceHistoryOperation, dataApiScreenAudienceLiveOperation, dataApiStreamOperation, getBillingUsageSummaryOperation, parseSignatureHeader, purchaseCreditsOperation, retryWithBackoff, setupBillingOperation, verifyAdcpWebhook };
|
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ var TrillboardsError = class _TrillboardsError extends Error {
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
// src/version.ts
|
|
89
|
-
var VERSION = "3.5.
|
|
89
|
+
var VERSION = "3.5.2";
|
|
90
90
|
|
|
91
91
|
// src/http.ts
|
|
92
92
|
var PUBLIC_PATHS = ["/v1/errors", "/v1/changelog", "/api/discover", "/v1/health"];
|
|
@@ -1263,7 +1263,8 @@ var DspClient = class {
|
|
|
1263
1263
|
baseUrl: (options.baseUrl ?? "https://api.trillboards.com").replace(/\/+$/, "")
|
|
1264
1264
|
});
|
|
1265
1265
|
}
|
|
1266
|
-
execute(operation,
|
|
1266
|
+
execute(operation, ...args) {
|
|
1267
|
+
const input = args[0] === void 0 ? {} : args[0];
|
|
1267
1268
|
const route = dspRoutes[operation];
|
|
1268
1269
|
const path2 = route.path.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
1269
1270
|
const value = input.params?.[name];
|