@the_ro_show/agent-ads-sdk 0.10.0 → 0.13.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.js CHANGED
@@ -529,7 +529,12 @@ var AttentionMarketClient = class {
529
529
  }
530
530
  },
531
531
  context,
532
- user_intent: params.userMessage
532
+ user_intent: params.userMessage,
533
+ // Developer controls (Phase 1: Quality & Brand Safety)
534
+ ...params.minQualityScore !== void 0 && { minQualityScore: params.minQualityScore },
535
+ ...params.allowedCategories && { allowedCategories: params.allowedCategories },
536
+ ...params.blockedCategories && { blockedCategories: params.blockedCategories },
537
+ ...params.blockedAdvertisers && { blockedAdvertisers: params.blockedAdvertisers }
533
538
  };
534
539
  const response = await this.decideRaw(request, options);
535
540
  if (response.status === "no_fill" || response.units.length === 0) {
@@ -1156,6 +1161,55 @@ var AttentionMarketClient = class {
1156
1161
  { body: params }
1157
1162
  );
1158
1163
  }
1164
+ /**
1165
+ * Get IAB Content Taxonomy categories.
1166
+ *
1167
+ * Returns the complete IAB Content Taxonomy 3.0 (704 categories across 38 top-level categories).
1168
+ * Supports filtering by tier level, parent category, or search term.
1169
+ *
1170
+ * Use this to discover available categories for `allowedCategories` and `blockedCategories` parameters.
1171
+ *
1172
+ * @param params - Optional filters (tier, parent_id, search)
1173
+ * @returns The IAB Content Taxonomy with categories
1174
+ *
1175
+ * @example Get all Tier 1 categories (38 top-level categories)
1176
+ * ```typescript
1177
+ * const tier1 = await client.getCategories({ tier: 1 });
1178
+ * console.log(`${tier1.total} top-level categories`);
1179
+ * tier1.categories.forEach(cat => console.log(`${cat.id}: ${cat.name}`));
1180
+ * ```
1181
+ *
1182
+ * @example Get all subcategories of "Automotive" (ID: 1)
1183
+ * ```typescript
1184
+ * const automotiveCategories = await client.getCategories({ parent_id: 1 });
1185
+ * console.log(`Found ${automotiveCategories.total} automotive subcategories`);
1186
+ * ```
1187
+ *
1188
+ * @example Search for insurance-related categories
1189
+ * ```typescript
1190
+ * const insuranceCategories = await client.getCategories({ search: 'insurance' });
1191
+ * insuranceCategories.categories.forEach(cat => {
1192
+ * console.log(`${cat.id}: ${cat.full_path}`);
1193
+ * });
1194
+ * ```
1195
+ */
1196
+ async getCategories(params) {
1197
+ const queryParams = new URLSearchParams();
1198
+ if (params?.tier) {
1199
+ queryParams.append("tier", params.tier.toString());
1200
+ }
1201
+ if (params?.parent_id) {
1202
+ queryParams.append("parent_id", params.parent_id.toString());
1203
+ }
1204
+ if (params?.search) {
1205
+ queryParams.append("search", params.search);
1206
+ }
1207
+ const url = `/v1/categories${queryParams.toString() ? "?" + queryParams.toString() : ""}`;
1208
+ return await this.http.request(
1209
+ "GET",
1210
+ url
1211
+ );
1212
+ }
1159
1213
  };
1160
1214
 
1161
1215
  // src/mock-client.ts