@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/README.md +182 -26
- package/dist/index.d.mts +125 -13
- package/dist/index.d.ts +125 -13
- package/dist/index.js +55 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -480,7 +480,12 @@ var AttentionMarketClient = class {
|
|
|
480
480
|
}
|
|
481
481
|
},
|
|
482
482
|
context,
|
|
483
|
-
user_intent: params.userMessage
|
|
483
|
+
user_intent: params.userMessage,
|
|
484
|
+
// Developer controls (Phase 1: Quality & Brand Safety)
|
|
485
|
+
...params.minQualityScore !== void 0 && { minQualityScore: params.minQualityScore },
|
|
486
|
+
...params.allowedCategories && { allowedCategories: params.allowedCategories },
|
|
487
|
+
...params.blockedCategories && { blockedCategories: params.blockedCategories },
|
|
488
|
+
...params.blockedAdvertisers && { blockedAdvertisers: params.blockedAdvertisers }
|
|
484
489
|
};
|
|
485
490
|
const response = await this.decideRaw(request, options);
|
|
486
491
|
if (response.status === "no_fill" || response.units.length === 0) {
|
|
@@ -1107,6 +1112,55 @@ var AttentionMarketClient = class {
|
|
|
1107
1112
|
{ body: params }
|
|
1108
1113
|
);
|
|
1109
1114
|
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Get IAB Content Taxonomy categories.
|
|
1117
|
+
*
|
|
1118
|
+
* Returns the complete IAB Content Taxonomy 3.0 (704 categories across 38 top-level categories).
|
|
1119
|
+
* Supports filtering by tier level, parent category, or search term.
|
|
1120
|
+
*
|
|
1121
|
+
* Use this to discover available categories for `allowedCategories` and `blockedCategories` parameters.
|
|
1122
|
+
*
|
|
1123
|
+
* @param params - Optional filters (tier, parent_id, search)
|
|
1124
|
+
* @returns The IAB Content Taxonomy with categories
|
|
1125
|
+
*
|
|
1126
|
+
* @example Get all Tier 1 categories (38 top-level categories)
|
|
1127
|
+
* ```typescript
|
|
1128
|
+
* const tier1 = await client.getCategories({ tier: 1 });
|
|
1129
|
+
* console.log(`${tier1.total} top-level categories`);
|
|
1130
|
+
* tier1.categories.forEach(cat => console.log(`${cat.id}: ${cat.name}`));
|
|
1131
|
+
* ```
|
|
1132
|
+
*
|
|
1133
|
+
* @example Get all subcategories of "Automotive" (ID: 1)
|
|
1134
|
+
* ```typescript
|
|
1135
|
+
* const automotiveCategories = await client.getCategories({ parent_id: 1 });
|
|
1136
|
+
* console.log(`Found ${automotiveCategories.total} automotive subcategories`);
|
|
1137
|
+
* ```
|
|
1138
|
+
*
|
|
1139
|
+
* @example Search for insurance-related categories
|
|
1140
|
+
* ```typescript
|
|
1141
|
+
* const insuranceCategories = await client.getCategories({ search: 'insurance' });
|
|
1142
|
+
* insuranceCategories.categories.forEach(cat => {
|
|
1143
|
+
* console.log(`${cat.id}: ${cat.full_path}`);
|
|
1144
|
+
* });
|
|
1145
|
+
* ```
|
|
1146
|
+
*/
|
|
1147
|
+
async getCategories(params) {
|
|
1148
|
+
const queryParams = new URLSearchParams();
|
|
1149
|
+
if (params?.tier) {
|
|
1150
|
+
queryParams.append("tier", params.tier.toString());
|
|
1151
|
+
}
|
|
1152
|
+
if (params?.parent_id) {
|
|
1153
|
+
queryParams.append("parent_id", params.parent_id.toString());
|
|
1154
|
+
}
|
|
1155
|
+
if (params?.search) {
|
|
1156
|
+
queryParams.append("search", params.search);
|
|
1157
|
+
}
|
|
1158
|
+
const url = `/v1/categories${queryParams.toString() ? "?" + queryParams.toString() : ""}`;
|
|
1159
|
+
return await this.http.request(
|
|
1160
|
+
"GET",
|
|
1161
|
+
url
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1110
1164
|
};
|
|
1111
1165
|
|
|
1112
1166
|
// src/mock-client.ts
|