@the_ro_show/agent-ads-sdk 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -198,31 +198,6 @@ function createImpressionEvent(params) {
198
198
  }
199
199
  return event;
200
200
  }
201
- function createClickEvent(params) {
202
- const event = {
203
- event_id: generateUUID(),
204
- occurred_at: params.occurred_at ?? generateTimestamp(),
205
- agent_id: params.agent_id,
206
- request_id: params.request_id,
207
- decision_id: params.decision_id,
208
- unit_id: params.unit_id,
209
- event_type: "click",
210
- tracking_token: params.tracking_token
211
- };
212
- if (params.metadata !== void 0) {
213
- event.metadata = {
214
- ...params.metadata,
215
- href: params.href,
216
- click_context: params.click_context
217
- };
218
- } else {
219
- event.metadata = {
220
- href: params.href,
221
- click_context: params.click_context
222
- };
223
- }
224
- return event;
225
- }
226
201
  var HTML_ESCAPES = {
227
202
  "&": "&",
228
203
  "<": "&lt;",
@@ -848,52 +823,6 @@ var AttentionMarketClient = class {
848
823
  const event = createImpressionEvent(params);
849
824
  return await this.track(event);
850
825
  }
851
- /**
852
- * Convenience method to track a click event.
853
- * Creates a click event using createClickEvent() and calls track().
854
- */
855
- async trackClick(params) {
856
- const event = createClickEvent(params);
857
- return await this.track(event);
858
- }
859
- /**
860
- * Ultra-simple method to track a click from an ad returned by decideFromContext().
861
- * Automatically extracts all required fields from the ad object.
862
- *
863
- * @param ad - The ad object returned by decideFromContext()
864
- * @param options - Just click_context (what you showed the user)
865
- *
866
- * @example
867
- * ```typescript
868
- * const ad = await client.decideFromContext({ userMessage: "I need car insurance" });
869
- * if (ad) {
870
- * await client.trackClickFromAd(ad, {
871
- * click_context: "Progressive: Get 20% off - Compare quotes"
872
- * });
873
- * }
874
- * ```
875
- */
876
- async trackClickFromAd(ad, options) {
877
- if (!this.agentId) {
878
- throw new Error("agentId is required for trackClickFromAd(). Set it in the constructor.");
879
- }
880
- const trackParams = {
881
- agent_id: this.agentId,
882
- request_id: ad.request_id,
883
- decision_id: ad.decision_id,
884
- unit_id: ad._ad.unit_id,
885
- tracking_token: ad.tracking_token,
886
- href: ad.click_url,
887
- click_context: options.click_context
888
- };
889
- if (options.metadata) {
890
- trackParams.metadata = options.metadata;
891
- }
892
- if (options.occurred_at) {
893
- trackParams.occurred_at = options.occurred_at;
894
- }
895
- return await this.trackClick(trackParams);
896
- }
897
826
  /**
898
827
  * Send feedback on an ad's performance to earn conversion-validated bonuses.
899
828
  *
@@ -2007,7 +1936,6 @@ export {
2007
1936
  NetworkError,
2008
1937
  TimeoutError,
2009
1938
  buildTaxonomy,
2010
- createClickEvent,
2011
1939
  createImpressionEvent,
2012
1940
  createOpportunity,
2013
1941
  detectIntent,