chore: update Angular cache and TypeScript build info files

This commit is contained in:
2025-09-22 14:45:16 -04:00
parent 4eb339eb22
commit d78afda4cd
47 changed files with 5480 additions and 3995 deletions
+7 -3
View File
@@ -10,18 +10,22 @@
* @property {string=} type
*/
/** @type {{ id: 'yt', label: string, search: (q: string, opts: { limit: number, page?: number }) => Promise<Suggestion[]> }} */
/** @type {{ id: 'yt', label: string, search: (q: string, opts: { limit: number, page?: number, sort?: 'relevance'|'date'|'views' }) => Promise<Suggestion[]> }} */
const handler = {
id: 'yt',
label: 'YouTube',
async search(q, opts) {
const { limit = 10 } = opts;
const { limit = 10, sort = 'relevance' } = opts || {};
try {
const API_KEY = process.env.YOUTUBE_API_KEY;
if (!API_KEY) {
throw new Error('YOUTUBE_API_KEY not configured');
}
let order = 'relevance';
if (sort === 'date') order = 'date';
else if (sort === 'views') order = 'viewCount';
const response = await fetch(
`https://www.googleapis.com/youtube/v3/search?` +
new URLSearchParams({
@@ -30,7 +34,7 @@ const handler = {
type: 'video',
maxResults: Math.min(limit, 50).toString(),
key: API_KEY,
order: 'relevance'
order
})
);