@adviverse/mcp 0.1.1 → 0.1.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.
Files changed (3) hide show
  1. package/dist/http.js +561 -136
  2. package/dist/index.js +561 -136
  3. package/package.json +2 -2
package/dist/http.js CHANGED
@@ -31,11 +31,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  mod
32
32
  ));
33
33
 
34
- // ../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.15_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
34
+ // ../../node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
35
35
  import path from "path";
36
36
  import { fileURLToPath } from "url";
37
37
  var init_esm_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.15_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -14411,6 +14411,16 @@ var AuthResource = class extends Resource {
14411
14411
  resetPassword(token, password) {
14412
14412
  return this.c.request("POST", "/v1/auth/reset-password", { body: { token, password } });
14413
14413
  }
14414
+ /**
14415
+ * Set or change the signed-in account's password. Omit `currentPassword` when
14416
+ * the account is SSO-only (setting a password for the first time so email+password
14417
+ * login also works); it's required when changing an existing password.
14418
+ */
14419
+ setPassword(newPassword, currentPassword) {
14420
+ return this.c.request("POST", "/v1/auth/password", {
14421
+ body: { newPassword, ...currentPassword ? { currentPassword } : {} }
14422
+ });
14423
+ }
14414
14424
  login(body) {
14415
14425
  return this.c.request("POST", "/v1/auth/login", { body });
14416
14426
  }
@@ -14481,6 +14491,10 @@ var ReportingResource = class extends Resource {
14481
14491
  publisherPlacements(query) {
14482
14492
  return this.c.request("GET", "/v1/reporting/publisher/placements", { query });
14483
14493
  }
14494
+ /** Anti-adblock: impressions recovered from adblock visitors (first-party serving). */
14495
+ antiAdblock(query) {
14496
+ return this.c.request("GET", "/v1/reporting/publisher/anti-adblock", { query });
14497
+ }
14484
14498
  advertiser(query) {
14485
14499
  return this.c.request("GET", "/v1/reporting/advertiser", { query });
14486
14500
  }
@@ -14498,7 +14512,13 @@ var ReportingResource = class extends Resource {
14498
14512
  reach(query) {
14499
14513
  return this.c.request("GET", "/v1/reporting/reach", { query });
14500
14514
  }
14501
- /** OS / browser / deal breakdown (bdim=os|browser|deal) — dropped by the rollup. */
14515
+ /**
14516
+ * Breakdown over a dimension the hourly rollup drops
14517
+ * (bdim=os|browser|deal|page|page_url|app|property). 'page' groups by site
14518
+ * (host), 'page_url' by individual page (host+path), 'app' by in-app/in-game
14519
+ * app id, 'property' by owning property (app/site). Rows carry impressions,
14520
+ * clicks, ctr, revenue (publisher earnings or advertiser spend) and ecpm.
14521
+ */
14502
14522
  breakdown(query) {
14503
14523
  return this.c.request("GET", "/v1/reporting/breakdown", { query });
14504
14524
  }
@@ -14574,6 +14594,23 @@ var ReportingResource = class extends Resource {
14574
14594
  viewability(query) {
14575
14595
  return this.c.request("GET", "/v1/reporting/viewability", { query });
14576
14596
  }
14597
+ /** Video completion: the funnel (starts → quartiles → completes) and completion
14598
+ * rate / VTR, plus a per-placement (publisher) or per-campaign (advertiser)
14599
+ * breakdown. Returns { funnel, breakdown }. */
14600
+ video(query) {
14601
+ return this.c.request("GET", "/v1/reporting/video", { query });
14602
+ }
14603
+ /** Affiliate sub-id funnel: impressions → clicks → conversions per sub-id, with
14604
+ * CTR / CVR / revenue / payout. `sub` picks which of sub1..sub5 to group by
14605
+ * (default sub1). Conversions populate on advertiser scope only. */
14606
+ affiliate(query) {
14607
+ return this.c.request("GET", "/v1/reporting/affiliate", { query });
14608
+ }
14609
+ /** Per-card carousel click attribution: clicks per card of each carousel
14610
+ * creative, with the card's title/price. Advertiser-scoped. */
14611
+ carousel(query) {
14612
+ return this.c.request("GET", "/v1/reporting/carousel", { query });
14613
+ }
14577
14614
  /** List saved report configurations. */
14578
14615
  saved() {
14579
14616
  return this.c.request("GET", "/v1/reporting/saved");
@@ -14656,9 +14693,29 @@ var WebhooksResource = class extends Resource {
14656
14693
  create(body) {
14657
14694
  return this.c.request("POST", "/v1/webhooks", { body });
14658
14695
  }
14696
+ /** Update an endpoint's URL, subscribed events, and/or active (pause) flag. */
14697
+ update(id, body) {
14698
+ return this.c.request("PATCH", `/v1/webhooks/${encodeURIComponent(id)}`, { body });
14699
+ }
14659
14700
  delete(id) {
14660
14701
  return this.c.request("DELETE", `/v1/webhooks/${encodeURIComponent(id)}`);
14661
14702
  }
14703
+ /** Roll the signing secret (old one stops verifying immediately). */
14704
+ rotateSecret(id) {
14705
+ return this.c.request("POST", `/v1/webhooks/${encodeURIComponent(id)}/rotate-secret`);
14706
+ }
14707
+ /** Fire a synthetic `ping` event to verify the endpoint. */
14708
+ ping(id) {
14709
+ return this.c.request("POST", `/v1/webhooks/${encodeURIComponent(id)}/ping`);
14710
+ }
14711
+ /** Recent delivery attempts for one subscription (newest first). */
14712
+ deliveries(id, query) {
14713
+ return this.c.request("GET", `/v1/webhooks/${encodeURIComponent(id)}/deliveries`, { query });
14714
+ }
14715
+ /** Manually re-send a past delivery's payload. */
14716
+ redeliver(deliveryId) {
14717
+ return this.c.request("POST", `/v1/webhooks/deliveries/${encodeURIComponent(deliveryId)}/redeliver`);
14718
+ }
14662
14719
  };
14663
14720
  var KeysResource = class extends Resource {
14664
14721
  constructor(c) {
@@ -14747,6 +14804,186 @@ var StatsResource = class extends Resource {
14747
14804
  return this.c.request("GET", "/v1/stats");
14748
14805
  }
14749
14806
  };
14807
+ var TeamResource = class extends Resource {
14808
+ constructor(c) {
14809
+ super(c);
14810
+ }
14811
+ /** Every seat under the account, with each member's role + pixel grants. */
14812
+ list() {
14813
+ return this.c.request("GET", "/v1/advertiser/team");
14814
+ }
14815
+ /**
14816
+ * Invite a team member. `role` 'admin' grants full account access; 'manager'
14817
+ * and 'analyst' are confined to the assigned `pixelIds` (managers can write,
14818
+ * analysts are read-only). `allPixels: true` grants every pixel.
14819
+ */
14820
+ invite(body) {
14821
+ return this.c.request("POST", "/v1/advertiser/team", { body });
14822
+ }
14823
+ /** Change a member's role, pixel grants, name, or status ('active'|'disabled'). */
14824
+ update(id, body) {
14825
+ return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}`, { body });
14826
+ }
14827
+ /** Re-send a pending member's invitation email. */
14828
+ resendInvite(id) {
14829
+ return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}/resend`);
14830
+ }
14831
+ /** Remove a seat entirely (revokes their sessions). */
14832
+ remove(id) {
14833
+ return this.c.request("DELETE", `/v1/advertiser/team/${encodeURIComponent(id)}`);
14834
+ }
14835
+ };
14836
+ var ClientsResource = class extends Resource {
14837
+ constructor(c) {
14838
+ super(c);
14839
+ }
14840
+ /** List the agency's clients (with tagged-campaign counts). */
14841
+ list() {
14842
+ return this.c.request("GET", "/v1/advertiser/clients");
14843
+ }
14844
+ get(id) {
14845
+ return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
14846
+ }
14847
+ create(body) {
14848
+ return this.c.request("POST", "/v1/advertiser/clients", { body });
14849
+ }
14850
+ update(id, body) {
14851
+ return this.c.request("POST", `/v1/advertiser/clients/${encodeURIComponent(id)}`, { body });
14852
+ }
14853
+ remove(id) {
14854
+ return this.c.request("DELETE", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
14855
+ }
14856
+ /** Campaigns owned by the account with their current client tag. */
14857
+ campaigns() {
14858
+ return this.c.request("GET", "/v1/advertiser/clients/campaigns");
14859
+ }
14860
+ /** Tag (or untag with clientId=null) a campaign to a client so its spend rolls up. */
14861
+ tagCampaign(campaignId, clientId) {
14862
+ return this.c.request("POST", "/v1/advertiser/clients/tag", { body: { campaignId, clientId } });
14863
+ }
14864
+ /** Spend + delivery for a client over a period (defaults to last 30d). */
14865
+ spend(id, from, to) {
14866
+ return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}/spend`, { query: { ...from ? { from } : {}, ...to ? { to } : {} } });
14867
+ }
14868
+ };
14869
+ var InvoicesResource = class extends Resource {
14870
+ constructor(c) {
14871
+ super(c);
14872
+ }
14873
+ list(clientId) {
14874
+ return this.c.request("GET", "/v1/advertiser/invoices", { query: clientId ? { clientId } : void 0 });
14875
+ }
14876
+ get(id) {
14877
+ return this.c.request("GET", `/v1/advertiser/invoices/${encodeURIComponent(id)}`);
14878
+ }
14879
+ /**
14880
+ * Create a draft invoice. With a period, auto-adds the client's tagged-campaign
14881
+ * spend as a line, plus an optional markupPct agency fee. Extra manual items
14882
+ * may be supplied.
14883
+ */
14884
+ create(body) {
14885
+ return this.c.request("POST", "/v1/advertiser/invoices", { body });
14886
+ }
14887
+ addItem(id, item) {
14888
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items`, { body: item });
14889
+ }
14890
+ removeItem(id, itemId) {
14891
+ return this.c.request("DELETE", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items/${encodeURIComponent(itemId)}`);
14892
+ }
14893
+ /** Send the invoice: mints a public pay link + emails the client. Returns it with `payLink`. */
14894
+ send(id) {
14895
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/send`);
14896
+ }
14897
+ /** Record an offline/out-of-band payment. */
14898
+ markPaid(id) {
14899
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/mark-paid`);
14900
+ }
14901
+ void(id) {
14902
+ return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/void`);
14903
+ }
14904
+ };
14905
+ var TransfersResource = class extends Resource {
14906
+ constructor(c) {
14907
+ super(c);
14908
+ }
14909
+ /** Initiate a transfer of one of your pixels (and its audiences) to an email. */
14910
+ initiate(pixelId, email2) {
14911
+ return this.c.request("POST", "/v1/advertiser/transfers", { body: { pixelId, email: email2 } });
14912
+ }
14913
+ /** Outgoing transfers you've initiated. */
14914
+ list() {
14915
+ return this.c.request("GET", "/v1/advertiser/transfers");
14916
+ }
14917
+ cancel(id) {
14918
+ return this.c.request("POST", `/v1/advertiser/transfers/${encodeURIComponent(id)}/cancel`);
14919
+ }
14920
+ /** Preview an incoming transfer by its token (the recipient must be logged in). */
14921
+ info(token) {
14922
+ return this.c.request("GET", "/v1/transfers/info", { query: { token } });
14923
+ }
14924
+ /** Accept an incoming transfer — the pixel + its audiences move to YOUR account. */
14925
+ accept(token) {
14926
+ return this.c.request("POST", "/v1/transfers/accept", { body: { token } });
14927
+ }
14928
+ };
14929
+ var TerminalResource = class extends Resource {
14930
+ constructor(c) {
14931
+ super(c);
14932
+ }
14933
+ /**
14934
+ * Fetch one rotated terminal ad from YOUR OWN campaigns. Auth precedence:
14935
+ * `token` (public ts_… — safe to ship) → the client's `x-api-key` (secret).
14936
+ */
14937
+ serve(opts = {}) {
14938
+ return this.c.request("GET", "/terminal/serve", {
14939
+ baseUrl: this.c.servingBaseUrl,
14940
+ query: { token: opts.token, campaignId: opts.campaignId, uid: opts.uid }
14941
+ });
14942
+ }
14943
+ /** Mint a PUBLIC serve token (ts_…) — non-secret, serve-only, safe to embed in
14944
+ * a distributed client. Optionally pin it to one terminal campaign, and/or arm
14945
+ * adaptive mode-switching (`switch`) so the engine rotates each install between
14946
+ * your ads and the marketplace based on engagement. */
14947
+ createToken(body = {}) {
14948
+ return this.c.request("POST", "/v1/advertiser/terminal-tokens", { body });
14949
+ }
14950
+ listTokens() {
14951
+ return this.c.request("GET", "/v1/advertiser/terminal-tokens");
14952
+ }
14953
+ /** Arm / update / disable a token's mode-switching policy in place (same ts_
14954
+ * value keeps working). Pass an empty object (or all-zero policy) to disable. */
14955
+ setTokenPolicy(id, policy) {
14956
+ return this.c.request("PATCH", `/v1/advertiser/terminal-tokens/${encodeURIComponent(id)}/switch`, { body: policy });
14957
+ }
14958
+ /** Rotate a token's value (old value stops working immediately). */
14959
+ rotateToken(id) {
14960
+ return this.c.request("POST", `/v1/advertiser/terminal-tokens/${encodeURIComponent(id)}/rotate`);
14961
+ }
14962
+ revokeToken(id) {
14963
+ return this.c.request("DELETE", `/v1/advertiser/terminal-tokens/${encodeURIComponent(id)}`);
14964
+ }
14965
+ };
14966
+ var CampaignGroupsResource = class extends Resource {
14967
+ constructor(c) {
14968
+ super(c);
14969
+ }
14970
+ /** Groups with their ad sets nested + a per-group spend rollup. */
14971
+ list() {
14972
+ return this.c.request("GET", "/v1/advertiser/campaign-groups");
14973
+ }
14974
+ get(id) {
14975
+ return this.c.request("GET", `/v1/advertiser/campaign-groups/${encodeURIComponent(id)}`);
14976
+ }
14977
+ create(body) {
14978
+ return this.c.request("POST", "/v1/advertiser/campaign-groups", { body });
14979
+ }
14980
+ update(id, body) {
14981
+ return this.c.request("PATCH", `/v1/advertiser/campaign-groups/${encodeURIComponent(id)}`, { body });
14982
+ }
14983
+ remove(id) {
14984
+ return this.c.request("DELETE", `/v1/advertiser/campaign-groups/${encodeURIComponent(id)}`);
14985
+ }
14986
+ };
14750
14987
  var CampaignsResource = class extends Resource {
14751
14988
  constructor(c) {
14752
14989
  super(c);
@@ -14763,6 +15000,11 @@ var CampaignsResource = class extends Resource {
14763
15000
  update(id, body) {
14764
15001
  return this.c.request("PATCH", `/v1/advertiser/campaigns/${encodeURIComponent(id)}`, { body });
14765
15002
  }
15003
+ /** Soft-delete a campaign: stops serving + removes it from the list. Past
15004
+ * spend/stats stay for reporting. */
15005
+ remove(id) {
15006
+ return this.c.request("DELETE", `/v1/advertiser/campaigns/${encodeURIComponent(id)}`);
15007
+ }
14766
15008
  submit(id) {
14767
15009
  return this.c.request("POST", `/v1/advertiser/campaigns/${encodeURIComponent(id)}/submit`);
14768
15010
  }
@@ -14845,6 +15087,15 @@ var CreativesResource = class extends Resource {
14845
15087
  if (fields2) for (const [k, v] of Object.entries(fields2)) form.append(k, v);
14846
15088
  return this.c.request("POST", "/v1/advertiser/creatives/upload", { form });
14847
15089
  }
15090
+ /** Uploads a PLAYABLE (interactive HTML5) as a ZIP bundle. The server validates
15091
+ * it, injects the sandbox runtime into its index.html, and hosts it on the CDN.
15092
+ * Returns { assetUrl, type:'html5', … } to pass to create() as a full-screen
15093
+ * (interstitial/rewarded) creative. `zip` is a Blob/File of the .zip. */
15094
+ uploadPlayable(zip, filename = "playable.zip") {
15095
+ const form = new FormData();
15096
+ form.append("file", zip, filename);
15097
+ return this.c.request("POST", "/v1/advertiser/creatives/playable", { form });
15098
+ }
14848
15099
  delete(id) {
14849
15100
  return this.c.request("DELETE", `/v1/advertiser/creatives/${encodeURIComponent(id)}`);
14850
15101
  }
@@ -15095,128 +15346,6 @@ var PixelResource = class extends Resource {
15095
15346
  return this.c.request("GET", "/v1/advertiser/pixel/traits", { query: { user, ...pixelId ? { pixelId } : {} } });
15096
15347
  }
15097
15348
  };
15098
- var TeamResource = class extends Resource {
15099
- constructor(c) {
15100
- super(c);
15101
- }
15102
- /** Every seat under the account, with each member's role + pixel grants. */
15103
- list() {
15104
- return this.c.request("GET", "/v1/advertiser/team");
15105
- }
15106
- /**
15107
- * Invite a team member. `role` 'admin' grants full account access; 'manager'
15108
- * and 'analyst' are confined to the assigned `pixelIds` (managers can write,
15109
- * analysts are read-only). `allPixels: true` grants every pixel.
15110
- */
15111
- invite(body) {
15112
- return this.c.request("POST", "/v1/advertiser/team", { body });
15113
- }
15114
- /** Change a member's role, pixel grants, name, or status ('active'|'disabled'). */
15115
- update(id, body) {
15116
- return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}`, { body });
15117
- }
15118
- /** Re-send a pending member's invitation email. */
15119
- resendInvite(id) {
15120
- return this.c.request("POST", `/v1/advertiser/team/${encodeURIComponent(id)}/resend`);
15121
- }
15122
- /** Remove a seat entirely (revokes their sessions). */
15123
- remove(id) {
15124
- return this.c.request("DELETE", `/v1/advertiser/team/${encodeURIComponent(id)}`);
15125
- }
15126
- };
15127
- var ClientsResource = class extends Resource {
15128
- constructor(c) {
15129
- super(c);
15130
- }
15131
- /** List the agency's clients (with tagged-campaign counts). */
15132
- list() {
15133
- return this.c.request("GET", "/v1/advertiser/clients");
15134
- }
15135
- get(id) {
15136
- return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
15137
- }
15138
- create(body) {
15139
- return this.c.request("POST", "/v1/advertiser/clients", { body });
15140
- }
15141
- update(id, body) {
15142
- return this.c.request("POST", `/v1/advertiser/clients/${encodeURIComponent(id)}`, { body });
15143
- }
15144
- remove(id) {
15145
- return this.c.request("DELETE", `/v1/advertiser/clients/${encodeURIComponent(id)}`);
15146
- }
15147
- /** Campaigns owned by the account with their current client tag. */
15148
- campaigns() {
15149
- return this.c.request("GET", "/v1/advertiser/clients/campaigns");
15150
- }
15151
- /** Tag (or untag with clientId=null) a campaign to a client so its spend rolls up. */
15152
- tagCampaign(campaignId, clientId) {
15153
- return this.c.request("POST", "/v1/advertiser/clients/tag", { body: { campaignId, clientId } });
15154
- }
15155
- /** Spend + delivery for a client over a period (defaults to last 30d). */
15156
- spend(id, from, to) {
15157
- return this.c.request("GET", `/v1/advertiser/clients/${encodeURIComponent(id)}/spend`, { query: { ...from ? { from } : {}, ...to ? { to } : {} } });
15158
- }
15159
- };
15160
- var InvoicesResource = class extends Resource {
15161
- constructor(c) {
15162
- super(c);
15163
- }
15164
- list(clientId) {
15165
- return this.c.request("GET", "/v1/advertiser/invoices", { query: clientId ? { clientId } : void 0 });
15166
- }
15167
- get(id) {
15168
- return this.c.request("GET", `/v1/advertiser/invoices/${encodeURIComponent(id)}`);
15169
- }
15170
- /**
15171
- * Create a draft invoice. With a period, auto-adds the client's tagged-campaign
15172
- * spend as a line, plus an optional markupPct agency fee. Extra manual items
15173
- * may be supplied.
15174
- */
15175
- create(body) {
15176
- return this.c.request("POST", "/v1/advertiser/invoices", { body });
15177
- }
15178
- addItem(id, item) {
15179
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items`, { body: item });
15180
- }
15181
- removeItem(id, itemId) {
15182
- return this.c.request("DELETE", `/v1/advertiser/invoices/${encodeURIComponent(id)}/items/${encodeURIComponent(itemId)}`);
15183
- }
15184
- /** Send the invoice: mints a public pay link + emails the client. Returns it with `payLink`. */
15185
- send(id) {
15186
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/send`);
15187
- }
15188
- /** Record an offline/out-of-band payment. */
15189
- markPaid(id) {
15190
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/mark-paid`);
15191
- }
15192
- void(id) {
15193
- return this.c.request("POST", `/v1/advertiser/invoices/${encodeURIComponent(id)}/void`);
15194
- }
15195
- };
15196
- var TransfersResource = class extends Resource {
15197
- constructor(c) {
15198
- super(c);
15199
- }
15200
- /** Initiate a transfer of one of your pixels (and its audiences) to an email. */
15201
- initiate(pixelId, email2) {
15202
- return this.c.request("POST", "/v1/advertiser/transfers", { body: { pixelId, email: email2 } });
15203
- }
15204
- /** Outgoing transfers you've initiated. */
15205
- list() {
15206
- return this.c.request("GET", "/v1/advertiser/transfers");
15207
- }
15208
- cancel(id) {
15209
- return this.c.request("POST", `/v1/advertiser/transfers/${encodeURIComponent(id)}/cancel`);
15210
- }
15211
- /** Preview an incoming transfer by its token (the recipient must be logged in). */
15212
- info(token) {
15213
- return this.c.request("GET", "/v1/transfers/info", { query: { token } });
15214
- }
15215
- /** Accept an incoming transfer — the pixel + its audiences move to YOUR account. */
15216
- accept(token) {
15217
- return this.c.request("POST", "/v1/transfers/accept", { body: { token } });
15218
- }
15219
- };
15220
15349
  var FeedsResource = class extends Resource {
15221
15350
  constructor(c) {
15222
15351
  super(c);
@@ -15311,6 +15440,10 @@ var AutomationResource = class extends Resource {
15311
15440
  deleteRule(id) {
15312
15441
  return this.c.request("DELETE", `/v1/automation/rules/${encodeURIComponent(id)}`);
15313
15442
  }
15443
+ /** Enable or disable a rule (pause it without deleting). */
15444
+ setRuleEnabled(id, enabled) {
15445
+ return this.c.request("PATCH", `/v1/automation/rules/${encodeURIComponent(id)}`, { body: { enabled } });
15446
+ }
15314
15447
  /** Recent automated budget-reallocation actions. */
15315
15448
  optimizerLog(limit) {
15316
15449
  return this.c.request("GET", "/v1/optimizer/log", { query: { limit } });
@@ -15360,6 +15493,18 @@ var PropertiesResource = class extends Resource {
15360
15493
  verify(id) {
15361
15494
  return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/verify`);
15362
15495
  }
15496
+ /** Set/clear the property's first-party ad-serving domain (anti-adblock). Pass
15497
+ * null/undefined to remove. Returns the CNAME target to point the domain at. */
15498
+ setServingDomain(id, domain) {
15499
+ return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/serving-domain`, { body: { domain } });
15500
+ }
15501
+ /** Verify the custom serving domain CNAMEs to our edge (proves control + routes). */
15502
+ verifyServingDomain(id) {
15503
+ return this.c.request("POST", `/v1/publisher/properties/${encodeURIComponent(id)}/serving-domain/verify`);
15504
+ }
15505
+ removeServingDomain(id) {
15506
+ return this.c.request("DELETE", `/v1/publisher/properties/${encodeURIComponent(id)}/serving-domain`);
15507
+ }
15363
15508
  domainConnect(id) {
15364
15509
  return this.c.request(
15365
15510
  "POST",
@@ -15429,11 +15574,19 @@ var ConsentResource = class extends Resource {
15429
15574
  constructor(c) {
15430
15575
  super(c);
15431
15576
  }
15432
- /** Get this publisher's consent config (defaults when none saved). */
15433
- getConfig() {
15434
- return this.c.request("GET", "/v1/publisher/consent-config");
15577
+ /**
15578
+ * Get consent config. Consent is scoped per PROPERTY (domain) — pass a
15579
+ * propertyId to read that property's config (falling back to the account-wide
15580
+ * default). Omit it to read the account-wide default directly.
15581
+ */
15582
+ getConfig(propertyId) {
15583
+ const q = propertyId ? `?propertyId=${encodeURIComponent(propertyId)}` : "";
15584
+ return this.c.request("GET", `/v1/publisher/consent-config${q}`);
15435
15585
  }
15436
- /** Save the CMP framework + default-consent + snippet behavior. */
15586
+ /**
15587
+ * Save the CMP framework + default-consent + snippet behavior for a property
15588
+ * (set `propertyId` in the body). Omit `propertyId` to save the account default.
15589
+ */
15437
15590
  saveConfig(body) {
15438
15591
  return this.c.request("POST", "/v1/publisher/consent-config", { body });
15439
15592
  }
@@ -15656,10 +15809,235 @@ var BlogResource = class extends Resource {
15656
15809
  return this.c.request("DELETE", `/v1/admin/blog/${encodeURIComponent(id)}`);
15657
15810
  }
15658
15811
  };
15812
+ var MarketplaceCatalogResource = class extends Resource {
15813
+ constructor(c) {
15814
+ super(c);
15815
+ }
15816
+ /** Bulk upsert catalog items (create or update by `external_id`). */
15817
+ upsert(items) {
15818
+ const body = { items };
15819
+ return this.c.request("POST", "/v1/advertiser/marketplace-catalog", { body });
15820
+ }
15821
+ /** The catalog items the account has uploaded. */
15822
+ list() {
15823
+ return this.c.request("GET", "/v1/advertiser/marketplace-catalog");
15824
+ }
15825
+ /**
15826
+ * Register (or update) a hosted catalog feed URL that we re-fetch on a schedule
15827
+ * (SSRF-guarded pull → the same upsert path). Re-registering the same URL updates
15828
+ * its interval and re-activates it.
15829
+ */
15830
+ registerFeed(input) {
15831
+ return this.c.request("POST", "/v1/advertiser/catalog-feeds", { body: input });
15832
+ }
15833
+ /** The scheduled catalog feeds the account has registered. */
15834
+ listFeeds() {
15835
+ return this.c.request("GET", "/v1/advertiser/catalog-feeds");
15836
+ }
15837
+ /** Remove a registered feed (stops its scheduled refresh). */
15838
+ removeFeed(id) {
15839
+ return this.c.request("DELETE", `/v1/advertiser/catalog-feeds/${encodeURIComponent(id)}`);
15840
+ }
15841
+ };
15842
+ var PromoteCampaignsResource = class extends Resource {
15843
+ constructor(c) {
15844
+ super(c);
15845
+ }
15846
+ create(body) {
15847
+ return this.c.request("POST", "/v1/advertiser/promote-campaigns", { body });
15848
+ }
15849
+ list() {
15850
+ return this.c.request("GET", "/v1/advertiser/promote-campaigns");
15851
+ }
15852
+ /** Submit a promote campaign for review. */
15853
+ submit(id) {
15854
+ return this.c.request("POST", `/v1/advertiser/promote-campaigns/${encodeURIComponent(id)}/submit`);
15855
+ }
15856
+ /** Set a promote campaign's status (e.g. active, paused). */
15857
+ setStatus(id, status) {
15858
+ return this.c.request("POST", `/v1/advertiser/promote-campaigns/${encodeURIComponent(id)}/status`, {
15859
+ body: { status }
15860
+ });
15861
+ }
15862
+ };
15863
+ var ConversionsResource = class extends Resource {
15864
+ constructor(c) {
15865
+ super(c);
15866
+ }
15867
+ /**
15868
+ * Report an attributed purchase (advertiser postback / S2S). `clickId` is the
15869
+ * ad click id (adclid); `orderId` is the marketplace order id (dedup key);
15870
+ * `orderValue` is the gross order amount (sent as `order_value`). Optional
15871
+ * `value` overrides the billable value, `eventId` gives at-most-once
15872
+ * ingestion, and `campaignId` hints attribution when the click id can't
15873
+ * resolve one on its own.
15874
+ */
15875
+ purchase(req) {
15876
+ const { orderValue, ...rest } = req;
15877
+ return this.c.request("POST", "/v1/track/conversion", {
15878
+ body: { ...rest, order_value: orderValue }
15879
+ });
15880
+ }
15881
+ /** Report a refund / chargeback for a previously reported order — reverses
15882
+ * its settlement with a compensating ledger entry. */
15883
+ refund(req) {
15884
+ return this.c.request("POST", "/v1/track/refund", { body: req });
15885
+ }
15886
+ };
15887
+ var CurrenciesResource = class extends Resource {
15888
+ constructor(c) {
15889
+ super(c);
15890
+ }
15891
+ /** List all registered tokens/currencies and their USD rates. */
15892
+ list() {
15893
+ return this.c.request("GET", "/v1/finance/currencies");
15894
+ }
15895
+ /** Register or update the caller's token and its USD rate (or live feed). */
15896
+ register(req) {
15897
+ return this.c.request("POST", "/v1/finance/currencies", { body: req });
15898
+ }
15899
+ };
15900
+ var DoohResource = class extends Resource {
15901
+ constructor(c) {
15902
+ super(c);
15903
+ }
15904
+ /** Claim a pending screen by the code it is displaying (attaches venue + activates). */
15905
+ claimScreen(req) {
15906
+ return this.c.request("POST", "/v1/dooh/screens/claim", { body: req });
15907
+ }
15908
+ /** The caller's screen fleet, each with a live online flag. */
15909
+ listScreens() {
15910
+ return this.c.request("GET", "/v1/dooh/screens");
15911
+ }
15912
+ getScreen(id) {
15913
+ return this.c.request("GET", `/v1/dooh/screens/${encodeURIComponent(id)}`);
15914
+ }
15915
+ updateScreen(id, req) {
15916
+ return this.c.request("PATCH", `/v1/dooh/screens/${encodeURIComponent(id)}`, { body: req });
15917
+ }
15918
+ setScreenStatus(id, status) {
15919
+ return this.c.request("POST", `/v1/dooh/screens/${encodeURIComponent(id)}/status`, { body: { status } });
15920
+ }
15921
+ /** Publisher proof-of-play earnings report. */
15922
+ plays(params) {
15923
+ return this.c.request("GET", "/v1/dooh/plays", { query: params });
15924
+ }
15925
+ /** Advertiser proof-of-play VERIFICATION report (prove ads ran on real screens). */
15926
+ advertiserPlays(params) {
15927
+ return this.c.request("GET", "/v1/advertiser/dooh/plays", { query: params });
15928
+ }
15929
+ };
15930
+ var MetaverseResource = class extends Resource {
15931
+ constructor(c) {
15932
+ super(c);
15933
+ }
15934
+ /** Onboard a world integration (returns the signing secret ONCE). */
15935
+ createWorld(req) {
15936
+ return this.c.request("POST", "/v1/metaverse/worlds", { body: req });
15937
+ }
15938
+ listWorlds() {
15939
+ return this.c.request("GET", "/v1/metaverse/worlds");
15940
+ }
15941
+ /** Claim a pending surface by the code it is displaying (activates serving). */
15942
+ claimSurface(req) {
15943
+ return this.c.request("POST", "/v1/metaverse/surfaces/claim", { body: req });
15944
+ }
15945
+ listSurfaces() {
15946
+ return this.c.request("GET", "/v1/metaverse/surfaces");
15947
+ }
15948
+ getSurface(id) {
15949
+ return this.c.request("GET", `/v1/metaverse/surfaces/${encodeURIComponent(id)}`);
15950
+ }
15951
+ updateSurface(id, req) {
15952
+ return this.c.request("PATCH", `/v1/metaverse/surfaces/${encodeURIComponent(id)}`, { body: req });
15953
+ }
15954
+ setSurfaceStatus(id, status) {
15955
+ return this.c.request("POST", `/v1/metaverse/surfaces/${encodeURIComponent(id)}/status`, { body: { status } });
15956
+ }
15957
+ /** Publisher proof-of-view earnings report. */
15958
+ views(params) {
15959
+ return this.c.request("GET", "/v1/metaverse/views", { query: params });
15960
+ }
15961
+ /** Advertiser proof-of-view VERIFICATION report (real avatars, dwell, completions). */
15962
+ advertiserViews(params) {
15963
+ return this.c.request("GET", "/v1/advertiser/metaverse/views", { query: params });
15964
+ }
15965
+ /** ADMIN: latest automatic trust-score snapshot per world (CPA-only ⇄ CPM tiering). */
15966
+ adminTrustScores() {
15967
+ return this.c.request("GET", "/v1/admin/metaverse/trust-scores");
15968
+ }
15969
+ };
15970
+ var PortalTemplatesResource = class extends Resource {
15971
+ constructor(c) {
15972
+ super(c);
15973
+ }
15974
+ /** The template catalog (each with its schema-driven `fields`). */
15975
+ listTemplates() {
15976
+ return this.c.request("GET", "/v1/portal/templates");
15977
+ }
15978
+ /**
15979
+ * Store a portal config and get back `{ id, url }`. The `url` is the hosted
15980
+ * template with the config id baked in — pass it as an `html5` creative's
15981
+ * `assetUrl` (and the config's landing URL as `landingUrl`) to make a normal
15982
+ * creative attachable to a metaverse portal-surface campaign.
15983
+ */
15984
+ createConfig(req) {
15985
+ return this.c.request("POST", "/v1/portal/configs", { body: req });
15986
+ }
15987
+ };
15988
+ var RewardsResource = class extends Resource {
15989
+ constructor(c) {
15990
+ super(c);
15991
+ }
15992
+ /** Fund (or top up) a campaign's reward pool — escrows `amount` from your balance. */
15993
+ fundPool(req) {
15994
+ return this.c.request("POST", "/v1/rewards/pools", { body: req });
15995
+ }
15996
+ /**
15997
+ * Create an ADVERTISER-CUSTODIED, on-chain-in-the-creative reward pool. No escrow:
15998
+ * your own dApp/contract in the portal pays the user on-chain. Returns the pool
15999
+ * plus the one-time `voucher_secret` your contract/backend uses to verify the
16000
+ * eligibility voucher Adviverse issues on each verified completion before paying.
16001
+ */
16002
+ createOnchainPool(req) {
16003
+ return this.c.request("POST", "/v1/rewards/pools/onchain", { body: req });
16004
+ }
16005
+ /** Fetch a campaign's on-chain reward voucher secret (verify vouchers with it). */
16006
+ voucherSecret(campaignId) {
16007
+ return this.c.request("GET", `/v1/rewards/pools/${encodeURIComponent(campaignId)}/voucher-secret`);
16008
+ }
16009
+ /** List your reward pools. */
16010
+ listPools() {
16011
+ return this.c.request("GET", "/v1/rewards/pools");
16012
+ }
16013
+ /** Get one campaign's reward pool. */
16014
+ getPool(campaignId) {
16015
+ return this.c.request("GET", `/v1/rewards/pools/${encodeURIComponent(campaignId)}`);
16016
+ }
16017
+ /** Pause / resume a reward pool. */
16018
+ setPoolStatus(campaignId, status) {
16019
+ return this.c.request("POST", `/v1/rewards/pools/${encodeURIComponent(campaignId)}/status`, {
16020
+ body: { status }
16021
+ });
16022
+ }
16023
+ /** Reward-payout report: completions, amounts paid, per-campaign + per-payout rows. */
16024
+ report(params) {
16025
+ return this.c.request("GET", "/v1/rewards/report", { query: params });
16026
+ }
16027
+ /**
16028
+ * Point a metaverse world's reward-payout webhook at your endpoint. Adviverse
16029
+ * POSTs a signed `{ completion_id, campaign_id, user_ref, wallet, amount, token,
16030
+ * ts, sig }` per verified completion; you fulfil the end-user's on-chain payout.
16031
+ */
16032
+ setWorldWebhook(worldId, url) {
16033
+ return this.c.request("POST", "/v1/rewards/world-webhook", { body: { worldId, url } });
16034
+ }
16035
+ };
15659
16036
  var AdNetClient = class {
15660
16037
  constructor(opts) {
15661
16038
  if (!opts?.baseUrl) throw new Error("AdNetClient: baseUrl is required");
15662
16039
  this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
16040
+ this.servingBaseUrl = (opts.servingBaseUrl ?? "https://serve.adviverse.com").replace(/\/+$/, "");
15663
16041
  this.token = opts.token;
15664
16042
  this.apiKey = opts.apiKey;
15665
16043
  this.timeoutMs = opts.timeoutMs ?? 3e4;
@@ -15670,6 +16048,8 @@ var AdNetClient = class {
15670
16048
  this.fetchImpl = f.bind(globalThis);
15671
16049
  this.auth = new AuthResource(this);
15672
16050
  this.campaigns = new CampaignsResource(this);
16051
+ this.terminal = new TerminalResource(this);
16052
+ this.campaignGroups = new CampaignGroupsResource(this);
15673
16053
  this.creatives = new CreativesResource(this);
15674
16054
  this.properties = new PropertiesResource(this);
15675
16055
  this.placements = new PlacementsResource(this);
@@ -15706,6 +16086,14 @@ var AdNetClient = class {
15706
16086
  this.guides = new GuidesResource(this);
15707
16087
  this.blog = new BlogResource(this);
15708
16088
  this.stats = new StatsResource(this);
16089
+ this.marketplaceCatalog = new MarketplaceCatalogResource(this);
16090
+ this.promoteCampaigns = new PromoteCampaignsResource(this);
16091
+ this.conversions = new ConversionsResource(this);
16092
+ this.currencies = new CurrenciesResource(this);
16093
+ this.dooh = new DoohResource(this);
16094
+ this.metaverse = new MetaverseResource(this);
16095
+ this.portalTemplates = new PortalTemplatesResource(this);
16096
+ this.rewards = new RewardsResource(this);
15709
16097
  }
15710
16098
  /** Sets (or clears) the bearer session token used for subsequent requests. */
15711
16099
  setToken(token) {
@@ -15725,7 +16113,7 @@ var AdNetClient = class {
15725
16113
  }
15726
16114
  /** Low-level request. Most callers should use the typed resource methods. */
15727
16115
  async request(method, path2, opts = {}) {
15728
- const url = new URL(this.baseUrl + path2);
16116
+ const url = new URL((opts.baseUrl ?? this.baseUrl) + path2);
15729
16117
  if (opts.query) {
15730
16118
  for (const [k, v] of Object.entries(opts.query)) {
15731
16119
  if (v !== void 0) url.searchParams.set(k, String(v));
@@ -24000,21 +24388,38 @@ function createServer(client) {
24000
24388
  tool("get_campaign", "Get one campaign by id.", { id: external_exports.string() }, (a) => client.campaigns.get(a.id));
24001
24389
  tool("create_campaign", "Create a campaign. `fields` follows the API CreateCampaign body (name, format, pricingModel, bidAmount, budgetDaily, \u2026). Optional `utm` object ({enabled,source,medium,campaign,content,term}) tags the landing URL for the advertiser's own analytics; omit for the default (enabled, auto values).", { fields, idempotencyKey: idem }, (a) => client.campaigns.create(a.fields, a.idempotencyKey));
24002
24390
  tool("update_campaign", "Update a campaign (partial fields).", { id: external_exports.string(), fields }, (a) => client.campaigns.update(a.id, a.fields));
24391
+ tool("delete_campaign", "Delete a campaign (soft-delete): stops serving and removes it from the list; past spend/stats stay in reporting.", { id: external_exports.string() }, (a) => client.campaigns.remove(a.id));
24003
24392
  tool("submit_campaign", "Submit a campaign for review.", { id: external_exports.string() }, (a) => client.campaigns.submit(a.id));
24004
24393
  tool("set_campaign_status", "Set a campaign status (e.g. active, paused).", { id: external_exports.string(), status: external_exports.string() }, (a) => client.campaigns.setStatus(a.id, a.status));
24394
+ tool("upsert_marketplace_catalog", "Bulk upsert marketplace catalog items (create or update by external_id). fields.items = [{ external_id, title, description?, image_url?, price?, currency?, landing_url?, brand?, category?, keywords?: string[], availability? }]. These SKUs become eligible to be promoted as sponsored products in search.", { items: external_exports.array(fields) }, (a) => client.marketplaceCatalog.upsert(a.items));
24395
+ tool("list_marketplace_catalog", "List the marketplace catalog items the account has uploaded.", {}, () => client.marketplaceCatalog.list());
24396
+ tool("create_promote_campaign", 'Create a seller "promote products" campaign (sponsored products). fields (camelCase): { name, pricingModel: cpc|cpa, bidAmount (max CPC, or the flat CPA rate \u2014 required unless cpaMode=percent), cpaMode?: flat|percent (CPA basis), cpaPercent? (fraction of order value billed per checkout when cpaMode=percent, 0\u20131 e.g. 0.15=15%), minOrderValue? (anti-fraud floor; checkouts below it never bill), budgetDaily?, budgetTotal?, pacing?, currency?, itemSelector ({item_ids:[]} | {keywords:[]} | {all:true}), targeting? }.', { fields }, (a) => client.promoteCampaigns.create(a.fields));
24397
+ tool("list_promote_campaigns", "List the account's promote-products campaigns.", {}, () => client.promoteCampaigns.list());
24398
+ tool("submit_promote_campaign", "Submit a promote-products campaign for review.", { id: external_exports.string() }, (a) => client.promoteCampaigns.submit(a.id));
24399
+ tool("set_promote_campaign_status", "Set a promote-products campaign status (e.g. active, paused).", { id: external_exports.string(), status: external_exports.string() }, (a) => client.promoteCampaigns.setStatus(a.id, a.status));
24400
+ tool("report_conversion", "Report an attributed purchase (advertiser postback / S2S) for per-checkout (CPA) settlement. clickId = the ad click id (adclid) captured on the landing page; orderId = the marketplace order id (dedup key); orderValue = gross order amount (sent as order_value). Optional: value (billable-value override), eventId (at-most-once ingestion), campaignId (attribution hint). A verified, deduped Purchase debits the advertiser (CPA) and credits the publisher (rev-share).", { clickId: external_exports.string(), orderId: external_exports.string(), orderValue: external_exports.number(), value: external_exports.number().optional(), eventId: external_exports.string().optional(), campaignId: external_exports.string().optional() }, (a) => client.conversions.purchase({ clickId: a.clickId, orderId: a.orderId, orderValue: a.orderValue, value: a.value, eventId: a.eventId, campaignId: a.campaignId }));
24401
+ tool("report_refund", "Report a refund / chargeback for a previously reported order \u2014 reverses its CPA settlement with a compensating (append-only) ledger entry. orderId = the marketplace order id to reverse; advertiserId optionally scopes the reversal.", { orderId: external_exports.string(), advertiserId: external_exports.string().optional() }, (a) => client.conversions.refund({ orderId: a.orderId, advertiserId: a.advertiserId }));
24005
24402
  tool("list_creatives", "List the advertiser's whole creative library.", {}, () => client.creatives.list());
24006
24403
  tool("list_campaign_creatives", "List creatives serving a campaign (authored + attached).", { campaignId: external_exports.string() }, (a) => client.creatives.listForCampaign(a.campaignId));
24007
24404
  tool("get_creative", "Get one creative by id.", { id: external_exports.string() }, (a) => client.creatives.get(a.id));
24008
- tool("create_creative", "Create a creative (full Studio parity \u2014 camelCase fields). fields: { type: image|native|popunder_url|push|html5|video, landingUrl, assetUrl?, title?, description?, iconUrl?, mainImageUrl?, cta?, brandName?, starRating?(0-5), width?, height?, weight?, campaignId? (omit for library-only) }. Use upload to host an asset, then add DCO variants via add_creative_component / set_creative_dco.", { fields }, (a) => client.creatives.create(a.fields));
24009
- tool("update_creative", "Update a creative's content (camelCase fields: assetUrl, landingUrl, title, description, iconUrl, mainImageUrl, cta, brandName, starRating, width, height, weight). type & campaignId are fixed at creation.", { id: external_exports.string(), fields }, (a) => client.creatives.update(a.id, a.fields));
24405
+ tool("create_creative", "Create a creative (full Studio parity \u2014 camelCase fields). fields: { type: image|native|popunder_url|push|html5|video|audio, landingUrl, assetUrl?, title?, description?, iconUrl?, mainImageUrl?, cta?, brandName?, starRating?(0-5), width?, height?, weight?, campaignId? (omit for library-only), duration?(sec 1-600), skipOffsetSec?(0-600, >0 = skippable), vpaidUrl?(https), companions?[{width,height,staticUrl(https),staticMime?,clickUrl?}] (max 5), vastTagUrl?(https third-party VAST tag; video/audio only) }. A video creative needs assetUrl OR vastTagUrl \u2014 with only vastTagUrl it serves as a VAST Wrapper around your own ad server's tag (duration is probed from the tag when omitted). type html5 = a playable (interactive HTML5) \u2014 host the ZIP via POST /v1/advertiser/creatives/playable first (returns assetUrl), then create with type html5 + that assetUrl on a full-screen/interstitial placement. Use upload to host a static asset, then add DCO variants via add_creative_component / set_creative_dco.", { fields }, (a) => client.creatives.create(a.fields));
24406
+ tool("update_creative", "Update a creative's content (camelCase fields: assetUrl, landingUrl, title, description, iconUrl, mainImageUrl, cta, brandName, starRating, width, height, weight, carouselItems, duration, skipOffsetSec, vpaidUrl, companions, vastTagUrl (null clears)). Changing assetUrl/landing/text/vastTagUrl/vpaidUrl/companions re-enters moderation. type & campaignId are fixed at creation.", { id: external_exports.string(), fields }, (a) => client.creatives.update(a.id, a.fields));
24010
24407
  tool("delete_creative", "Delete a creative.", { id: external_exports.string() }, (a) => client.creatives.delete(a.id));
24011
24408
  tool("attach_creative", "Attach a library creative to a campaign (optional rotation weight).", { id: external_exports.string(), campaignId: external_exports.string(), weight: external_exports.number().optional() }, (a) => client.creatives.attach(a.id, a.campaignId, a.weight));
24012
24409
  tool("detach_creative", "Detach a library creative from a campaign.", { id: external_exports.string(), campaignId: external_exports.string() }, (a) => client.creatives.detach(a.id, a.campaignId));
24013
24410
  tool("creative_campaigns", "List campaigns a library creative is attached to.", { id: external_exports.string() }, (a) => client.creatives.campaigns(a.id));
24411
+ tool("serve_terminal_ad", "Fetch ONE rotated terminal (CLI status-line) ad from YOUR OWN active terminal campaigns. Auth: a public `token` (ts_\u2026) if given, else this key. Rotation/eligibility/frequency capping applied server-side. Optional campaignId narrows to one campaign; uid is a stable per-install id. Returns { text, cta, url, impression_url, ... } or {} on no-fill.", { token: external_exports.string().optional(), campaignId: external_exports.string().optional(), uid: external_exports.string().optional() }, (a) => client.terminal.serve({ token: a.token, campaignId: a.campaignId, uid: a.uid }));
24412
+ tool("create_terminal_token", "Mint a PUBLIC terminal serve token (ts_\u2026) \u2014 a non-secret, serve-only credential SAFE to embed in a distributed CLI/desktop app. Optionally pin it to one terminal campaign, and/or arm adaptive mode-switching (`switch`) so the engine flips each install from YOUR ads to the marketplace after it engages. Returns { id, token, ... }.", { name: external_exports.string().optional(), campaignId: external_exports.string().optional(), switch: external_exports.object({ flipAfter: external_exports.number().int().min(0).optional(), flipOnClick: external_exports.boolean().optional(), fallbackTag: external_exports.string().optional() }).optional() }, (a) => client.terminal.createToken({ name: a.name, campaignId: a.campaignId, switch: a.switch }));
24413
+ tool("list_terminal_tokens", "List your public terminal serve tokens (includes each token's switch policy).", {}, () => client.terminal.listTokens());
24414
+ tool("set_terminal_token_policy", "Arm / update / disable a terminal serve token's adaptive mode-switching policy IN PLACE (the ts_ value keeps working). `flipAfter` flips an install to the marketplace after N self-network impressions; `flipOnClick` flips once it clicks your ad; `fallbackTag` (tk_\u2026, one of your own placements) is served post-flip (omit = flip to no ad). Needs a campaign-pinned token. Pass all-zero/empty to disable.", { id: external_exports.string(), flipAfter: external_exports.number().int().min(0).optional(), flipOnClick: external_exports.boolean().optional(), fallbackTag: external_exports.string().optional() }, (a) => client.terminal.setTokenPolicy(a.id, { flipAfter: a.flipAfter, flipOnClick: a.flipOnClick, fallbackTag: a.fallbackTag }));
24415
+ tool("rotate_terminal_token", "Rotate a terminal serve token by id (its old value stops working immediately). Returns the new token. The switch policy is preserved.", { id: external_exports.string() }, (a) => client.terminal.rotateToken(a.id));
24416
+ tool("revoke_terminal_token", "Revoke (delete) a terminal serve token by id.", { id: external_exports.string() }, (a) => client.terminal.revokeToken(a.id));
24014
24417
  tool("list_properties", "List publisher properties (sites, CLIs, apps).", page, (a) => client.properties.list(a));
24015
24418
  tool("create_property", "Register a property. fields: { kind: website|cli|mobile_app|ctv, domain, name?, verificationMethod? }.", { fields, idempotencyKey: idem }, (a) => client.properties.create(a.fields, a.idempotencyKey));
24016
24419
  tool("update_property", "Update a property. fields: { name?, domain?, category?, verificationMethod? }. Changing the domain resets verification.", { id: external_exports.string(), fields }, (a) => client.properties.update(a.id, a.fields));
24017
24420
  tool("verify_property", "Trigger ownership verification for a property.", { id: external_exports.string() }, (a) => client.properties.verify(a.id));
24421
+ tool("set_serving_domain", "Set a first-party ad-serving domain on a property (anti-adblock). The publisher CNAMEs this host to our edge; returns the CNAME target. Pass domain:null to remove.", { id: external_exports.string(), domain: external_exports.string().nullable() }, (a) => client.properties.setServingDomain(a.id, a.domain));
24422
+ tool("verify_serving_domain", "Verify a property custom serving domain CNAMEs to our edge (routes traffic + proves control). On success the tag serves first-party.", { id: external_exports.string() }, (a) => client.properties.verifyServingDomain(a.id));
24018
24423
  tool("list_placements", "List ad placements.", page, (a) => client.placements.list(a));
24019
24424
  tool("create_placement", "Create a placement. fields: { propertyId, name, format, floorCpm, \u2026 }.", { fields, idempotencyKey: idem }, (a) => client.placements.create(a.fields, a.idempotencyKey));
24020
24425
  tool("get_placement_tag", "Get the ad tag / install code for a placement.", { id: external_exports.string() }, (a) => client.placements.tag(a.id));
@@ -24022,11 +24427,12 @@ function createServer(client) {
24022
24427
  tool("disable_placement_signing", "Disable signed-tag enforcement on a placement.", { id: external_exports.string() }, (a) => client.placements.disableSigning(a.id));
24023
24428
  tool("list_combo_presets", "List the static combo / layout presets (each bundles several ad units: standard_combo, leaderboard_pop, social_push, sticky_interstitial, full_monetization).", {}, () => client.placements.comboPresets());
24024
24429
  tool("create_combo", "Provision several ad units as placements on a property at once and get ONE combined embed snippet back (paste once before </body>). Provide EITHER a preset (presetKey) OR a custom set of units [{format,label?,width?,height?}]. fields: { presetKey?, units?, namePrefix?, floorCpm?, revShare?, auctionType?, passbackUrl?, houseOnly?, houseShare?, houseBackfill?, floorFallback? }.", { propertyId: external_exports.string(), fields }, (a) => client.placements.createCombo(a.propertyId, a.fields));
24025
- tool("get_balance", "Get the account balance (available / held).", {}, () => client.finance.balance());
24430
+ tool("get_balance", "Get the account balance (available / held). The balance currency may be a tenant's own platform-token code (not an ISO code).", {}, () => client.finance.balance());
24026
24431
  tool("list_ledger", "List ledger entries.", { limit: external_exports.number().optional(), offset: external_exports.number().optional() }, (a) => client.finance.ledger({ limit: a.limit, offset: a.offset }));
24027
24432
  tool("advertiser_report", "Advertiser spend/performance report.", reportQuery, (a) => client.reporting.advertiser(a));
24028
24433
  tool("publisher_report", "Publisher revenue/delivery report.", reportQuery, (a) => client.reporting.publisher(a));
24029
24434
  tool("publisher_placements_report", "Per-placement publisher rollup: impressions, clicks, CTR, revenue, RPM, eCPM, fill rate and viewable rate.", reportQuery, (a) => client.reporting.publisherPlacements(a));
24435
+ tool("anti_adblock_report", "Anti-adblock: impressions recovered from visitors running an adblocker (served first-party), with daily series + recovered %.", reportQuery, (a) => client.reporting.antiAdblock(a));
24030
24436
  const dealRole = external_exports.enum(["advertiser", "publisher"]).optional().describe("Which side to view: deals where the account is the publisher (seller) or advertiser (buyer). Omit for the account default.");
24031
24437
  tool("list_deals", "List private marketplace deals.", { ...page, role: dealRole }, (a) => client.deals.list(a));
24032
24438
  tool(
@@ -24242,11 +24648,25 @@ function createServer(client) {
24242
24648
  tool("issue_invoice", "Issue a draft invoice (admin).", { id: external_exports.string() }, (a) => client.billing.issueInvoice(a.id));
24243
24649
  tool("pay_invoice", "Pay an invoice (advertiser own; admin any).", { id: external_exports.string() }, (a) => client.billing.payInvoice(a.id));
24244
24650
  tool("void_invoice", "Void an invoice (admin).", { id: external_exports.string() }, (a) => client.billing.voidInvoice(a.id));
24245
- tool("deposit_funds", "Request a deposit / account top-up. fields: { amount, provider?: stripe|paypal|crypto|mock, currency? }.", { fields }, (a) => client.finance.deposit(a.fields));
24651
+ tool("deposit_funds", "Request a deposit / account top-up. fields: { amount, provider?: stripe|card|paypal|crypto|wire|paxum|mock, currency? }. card=Stripe card checkout; wire/paxum are instruction-based \u2014 the response carries where to send funds + a reference, and the balance is credited once receipt is confirmed. Accounts on a tenant network transact in that tenant's own platform token: currency is the token code and amount is denominated in it.", { fields }, (a) => client.finance.deposit(a.fields));
24246
24652
  tool("list_deposits", "List deposit history.", {}, () => client.finance.deposits());
24247
- tool("request_payout", "Request a publisher payout. fields: { amount, method: paypal|crypto, destination? }.", { fields }, (a) => client.finance.requestPayout(a.fields));
24653
+ tool("request_payout", "Request a publisher payout. fields: { amount, method: crypto|paxum|wire, destination? }. crypto\u2192OxaPay, paxum\u2192Paxum wallet email (destination.email), wire\u2192bank transfer (destination bank fields; settled once ops confirms it was sent).", { fields }, (a) => client.finance.requestPayout(a.fields));
24248
24654
  tool("list_payouts", "List payout history.", {}, () => client.finance.payouts());
24249
24655
  tool("get_tax_form", "Get the saved payout tax form (W-9 / W-8BEN).", {}, () => client.finance.taxForm());
24656
+ tool("list_currencies", "List all registered platform tokens / currencies and their USD rates. Feed-backed tokens also show their live price-feed URL (rate_url), the JSON dot-path (rate_json_path), and last_rate_at (when the feed last synced usd_micro).", {}, () => client.currencies.list());
24657
+ tool("register_currency", "Register or update YOUR tenant's own token and its USD rate. Provide EITHER a static `usdMicro` (micro-USD per unit, 1_000_000 = $1.00) OR a live `rateUrl` \u2014 a price API returning the token's USD price, polled to keep the rate current \u2014 with an optional `rateJsonPath` dot-path to the numeric price in the response (e.g. 'price' or 'data.usd'; empty = the body is the bare number or a { price: ... }). A code owned by another account cannot be overwritten.", { code: external_exports.string(), name: external_exports.string(), usdMicro: external_exports.number().optional(), rateUrl: external_exports.string().optional(), rateJsonPath: external_exports.string().optional() }, (a) => client.currencies.register({ code: a.code, name: a.name, usdMicro: a.usdMicro, rateUrl: a.rateUrl, rateJsonPath: a.rateJsonPath }));
24658
+ tool("list_dooh_screens", "List the account's DOOH screens (physical screens running the Adviverse player), each with venue, resolution, loop length, status, and a live `online` flag derived from the screen's heartbeat.", {}, () => client.dooh.listScreens());
24659
+ tool("dooh_proof_of_play_report", 'Proof-of-play report over a date range (default last 30 days). scope="advertiser" verifies YOUR ads actually ran on real screens (what creative/campaign played, on which screen/venue, when, duration, completed, spend, screenshots if present); scope="publisher" is your screen-fleet earnings. Returns { summary, rows }.', { scope: external_exports.enum(["advertiser", "publisher"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => a.scope === "publisher" ? client.dooh.plays({ from: a.from, to: a.to }) : client.dooh.advertiserPlays({ from: a.from, to: a.to }));
24660
+ tool("create_metaverse_world", "Onboard a metaverse world integration. Returns a signing_secret ONCE \u2014 the world's server signs proofs of view with it (attestation). fields: { name, networkId? (the tenant network these surfaces belong to) }.", { fields }, (a) => client.metaverse.createWorld(a.fields));
24661
+ tool("list_metaverse_surfaces", "List the account's metaverse ad surfaces (screens/posters/portals placed in shops), each with venue, status, and a live `online` flag.", {}, () => client.metaverse.listSurfaces());
24662
+ tool("metaverse_proof_of_view_report", 'Proof-of-view report over a date range (default last 30 days). scope="advertiser" verifies YOUR ads were actually seen by real avatars (dwell, distance, portal completions, spend); scope="publisher" is your surface earnings. Returns { summary, rows }.', { scope: external_exports.enum(["advertiser", "publisher"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => a.scope === "publisher" ? client.metaverse.views({ from: a.from, to: a.to }) : client.metaverse.advertiserViews({ from: a.from, to: a.to }));
24663
+ tool("metaverse_trust_scores", "ADMIN: the automatic world TRUST-SCORING snapshot. Each world's last-7-day proof-of-view traffic is scored 0..1 (attested-identity rate, IVT valid rate, unique-user ratio, dwell plausibility); clean high-volume worlds are auto-promoted from CPA-only ('unverified') to CPM ('trusted'), degraded ones demoted. Returns per-world { current_tier, auto_tier, score, views_7d, valid_rate, attested_rate, unique_user_ratio, dwell_cv, factors }.", {}, () => client.metaverse.adminTrustScores());
24664
+ tool("list_portal_templates", "List the prebuilt HTML5 portal experience templates an advertiser can configure WITHOUT authoring a bundle (e.g. product-showcase, spin-to-win, 360-viewer). Each returns { key, name, description, fields:[{ key, label, type, required? }] } \u2014 the `fields` define that template's config shape.", {}, () => client.portalTemplates.listTemplates());
24665
+ tool("create_portal_experience", "Create a configured portal experience from a template. fields: { template (a key from list_portal_templates), config (the template's fields, e.g. { title, productImage, ctaUrl, bgColor }) }. Returns { id, url } \u2014 the hosted template URL. Pass that url as an `html5` creative's assetUrl (via create_creative) and the config's ctaUrl as landingUrl to make a normal creative attachable to a metaverse PORTAL surface campaign.", { fields }, (a) => client.portalTemplates.createConfig(a.fields));
24666
+ tool("fund_reward_pool", "Fund (or top up) a metaverse portal/experience campaign's REWARD POOL. Each VERIFIED completion pays the end-user a crypto reward \u2014 TENANT-CUSTODIED (Adviverse escrows your money + emits a signed payout webhook; the metaverse operator fulfils the on-chain payout in its own coin). fields (camelCase): { campaignId, perCompletion (fixed reward per completion), amount (escrowed now from your balance), token? (reward denomination; defaults to your account currency), perUserDailyCap?, perWalletDailyCap? }. Escrow reduces your available balance; insufficient funds is refused.", { fields }, (a) => client.rewards.fundPool(a.fields));
24667
+ tool("create_onchain_reward_pool", "Create an ADVERTISER-CUSTODIED, on-chain-in-the-creative reward pool. Your OWN dApp/contract inside the portal experience pays the end-user on-chain in a coin YOU choose (BTC/ETH/USDC/\u2026); Adviverse never touches the crypto \u2014 it only verifies each completion (attested real user + per-user/per-wallet daily caps + no replay) and hands the creative a single-use signed ELIGIBILITY VOUCHER your contract verifies before paying. NO escrow / no funding. fields (camelCase): { campaignId, perCompletion (display amount; real amount enforced by your contract), token (coin symbol), chain? (e.g. bitcoin/ethereum/base), perUserDailyCap?, perWalletDailyCap? }. Returns the pool plus a one-time `voucher_secret` \u2014 embed it in your contract/backend to verify vouchers.", { fields }, (a) => client.rewards.createOnchainPool(a.fields));
24668
+ tool("reward_voucher_secret", "Fetch a campaign's on-chain reward VOUCHER SECRET (the HMAC key your contract/backend uses to verify the eligibility voucher Adviverse issues on each verified completion). Applies to on-chain reward pools only. fields: { campaignId }.", { campaignId: external_exports.string() }, (a) => client.rewards.voucherSecret(a.campaignId));
24669
+ tool("reward_report", "Reward-payout report over a date range (default last 30 days): completions, amount paid, distinct recipients, sent/pending/failed webhook counts (tenant-custodied) + attributed/tx-confirmed on-chain counts (advertiser-custodied), a per-campaign breakdown, your pools (funded/spent/mode), and per-payout rows (incl. tx_hash for on-chain payouts).", { from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.rewards.report({ from: a.from, to: a.to }));
24250
24670
  tool("submit_tax_form", "Submit/update the payout tax form. fields: { formType: w9|w8ben, legalName, taxId, address, country, certified, taxClassification? }.", { fields }, (a) => client.finance.submitTaxForm(a.fields));
24251
24671
  tool("run_export", "Export analytics to a warehouse format. fields: { dataset: events|conversions|spend, from, to, format?: ndjson|csv }.", { fields }, (a) => client.exports.run(a.fields));
24252
24672
  tool("list_exports", "List export jobs.", {}, () => client.exports.list());
@@ -24256,6 +24676,7 @@ function createServer(client) {
24256
24676
  tool("list_automation_rules", "List automation rules.", {}, () => client.automation.rules());
24257
24677
  tool("create_automation_rule", "Create an automation rule. fields: { name?, scope?: campaign|all, targetId?, metric?: cpa|ctr|spend|conversions|fill_rate, operator?: gt|lt, threshold?, windowHours?, action?: pause|resume|notify|adjust_bid, actionValue?, enabled? }.", { fields }, (a) => client.automation.createRule(a.fields));
24258
24678
  tool("delete_automation_rule", "Delete an automation rule.", { id: external_exports.string() }, (a) => client.automation.deleteRule(a.id));
24679
+ tool("set_automation_rule_enabled", "Enable or disable an automation rule (pause it without deleting).", { id: external_exports.string(), enabled: external_exports.boolean() }, (a) => client.automation.setRuleEnabled(a.id, a.enabled));
24259
24680
  tool("optimizer_log", "Recent automated budget-reallocation actions.", { limit: external_exports.number().optional() }, (a) => client.automation.optimizerLog(a.limit));
24260
24681
  tool("list_alerts", "List anomaly/optimizer alerts.", {}, () => client.automation.alerts());
24261
24682
  tool("ack_alert", "Acknowledge (mark read) an alert.", { id: external_exports.string() }, (a) => client.automation.ackAlert(a.id));
@@ -24271,7 +24692,7 @@ function createServer(client) {
24271
24692
  tool("get_app_ads_txt", "An app's generated app-ads.txt content.", { id: external_exports.string() }, (a) => client.apps.appAdsTxt(a.id));
24272
24693
  tool("report_ivt", "Invalid-traffic breakdown.", reportQuery, (a) => client.reporting.ivt(a));
24273
24694
  tool("report_reach", "Reach & frequency (unique users): total reach, average frequency, a frequency-distribution histogram (impressions per user), and daily unique reach.", reportQuery, (a) => client.reporting.reach(a));
24274
- tool("report_breakdown", "Impressions/clicks/CTR broken down by a dimension the hourly rollup drops: bdim = 'os' | 'browser' | 'deal' (PMP) | 'page' (page host). Defaults to os.", { ...reportQuery, bdim: external_exports.enum(["os", "browser", "deal", "page"]).optional().describe("os | browser | deal | page") }, (a) => client.reporting.breakdown(a));
24695
+ tool("report_breakdown", "Impressions/clicks/CTR/revenue/eCPM broken down by a dimension the hourly rollup drops: bdim = 'os' | 'browser' | 'deal' (PMP) | 'page' (site, by host) | 'page_url' (individual page, host+path \u2014 earnings per page) | 'app' (in-app/in-game app id \u2014 earnings per app) | 'property' (owning property) | 'region' | 'make'/'model' (device) | 'sub1'..'sub5' (affiliate sub-ids). revenue is publisher earnings or advertiser spend depending on the account. Defaults to os.", { ...reportQuery, bdim: external_exports.enum(["os", "browser", "deal", "page", "page_url", "app", "property", "region", "make", "model", "sub1", "sub2", "sub3", "sub4", "sub5"]).optional().describe("os | browser | deal | page | page_url | app | property") }, (a) => client.reporting.breakdown(a));
24275
24696
  tool("report_creatives", "Per-creative performance for the advertiser: impressions, clicks, CTR, conversions, CVR per creative, plus a daily-CTR fatigue series for the top creative.", reportQuery, (a) => client.reporting.creatives(a));
24276
24697
  tool("report_roas", "Advertiser ROAS / conversion-value daily trend: spend, conversions, conversion value, and ROAS (value/spend) per day.", reportQuery, (a) => client.reporting.roas(a));
24277
24698
  tool("report_time_to_click", "Time-to-click engagement latency: average, median, and a distribution histogram (<1s / 1-3s / 3-10s / 10-30s / 30s+).", reportQuery, (a) => client.reporting.timeToClick(a));
@@ -24292,6 +24713,9 @@ function createServer(client) {
24292
24713
  tool("report_closed_loop", "Closed-loop full-funnel attribution for house campaigns.", reportQuery, (a) => client.reporting.closedLoop(a));
24293
24714
  tool("report_personal_network", "Personal Network (house ads) infra fees + delivery.", reportQuery, (a) => client.reporting.personalNetwork(a));
24294
24715
  tool("report_viewability", "Viewability metrics grouped by placement or campaign.", { groupBy: external_exports.enum(["placement", "campaign"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.viewability(a));
24716
+ tool("report_video", "Video completion analytics from quartile tracking: a funnel (starts \u2192 firstQuartile \u2192 midpoint \u2192 thirdQuartile \u2192 completes) with completionRate (completes\xF7starts), per-quartile retention, skips/skipRate and VAST error counts, plus a breakdown by placement (publisher) or campaign (advertiser). Returns { funnel, breakdown }.", { from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.video(a));
24717
+ tool("report_affiliate", "Affiliate sub-id performance: the FULL funnel per sub-id \u2014 impressions \u2192 clicks \u2192 conversions with CTR, CVR, revenue and payout. `sub` groups by sub1..sub5 (default sub1). Conversions/payout/CVR populate on advertiser scope (conversions carry no publisher_id).", { sub: external_exports.enum(["sub1", "sub2", "sub3", "sub4", "sub5"]).optional(), from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.affiliate(a));
24718
+ tool("report_carousel", "Per-card carousel click attribution: clicks per card (0-based index) of each carousel creative, with the card title/price. Advertiser-scoped.", { from: external_exports.string().optional(), to: external_exports.string().optional() }, (a) => client.reporting.carousel(a));
24295
24719
  tool("list_saved_reports", "List saved report configs.", {}, () => client.reporting.saved());
24296
24720
  tool("save_report", "Save a report configuration. fields: { name?, config? }.", { fields }, (a) => client.reporting.saveSaved(a.fields));
24297
24721
  tool("delete_saved_report", "Delete a saved report.", { id: external_exports.string() }, (a) => client.reporting.deleteSaved(a.id));
@@ -24365,6 +24789,7 @@ function createServer(client) {
24365
24789
  tool("save_onboarding_profile", "Save the onboarding profile. fields: { goal?, name?, company?, country?, currency?, timezone?, marketingOptIn? }.", { fields }, (a) => client.account.saveOnboardingProfile(a.fields));
24366
24790
  tool("list_connections", "List linked social-login providers.", {}, () => client.auth.connections());
24367
24791
  tool("disconnect_provider", "Disconnect a linked social-login provider.", { provider: external_exports.string() }, (a) => client.auth.disconnect(a.provider));
24792
+ tool("set_password", "Set or change the account password. Omit currentPassword when the account is SSO-only (setting a password for the first time so email+password login also works); required when changing an existing password.", { newPassword: external_exports.string(), currentPassword: external_exports.string().optional() }, (a) => client.auth.setPassword(a.newPassword, a.currentPassword));
24368
24793
  tool("list_referrals", "Referral program overview.", {}, () => client.referrals.list());
24369
24794
  tool("list_regions", "List active edge regions.", {}, () => client.regions.list());
24370
24795
  tool("nearest_region", "Resolve the nearest region for a country/geo.", { country: external_exports.string().optional(), lat: external_exports.number().optional(), lng: external_exports.number().optional() }, (a) => client.regions.nearest(a));