@microsoft/webiq 0.1.0 → 0.1.1
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 +5 -1
- package/dist/index.d.mts +76 -12
- package/dist/index.d.ts +76 -12
- package/package.json +64 -62
package/README.md
CHANGED
|
@@ -62,6 +62,10 @@ await client.close();
|
|
|
62
62
|
|
|
63
63
|
## Authentication
|
|
64
64
|
|
|
65
|
+
### API Key
|
|
66
|
+
|
|
67
|
+
Get an API key at [webiq.microsoft.ai](https://webiq.microsoft.ai).
|
|
68
|
+
|
|
65
69
|
```typescript
|
|
66
70
|
import { WebIQClient } from '@microsoft/webiq';
|
|
67
71
|
|
|
@@ -110,7 +114,7 @@ const results = await client.news.search(query, {
|
|
|
110
114
|
contentFormat: ContentFormat.TEXT,
|
|
111
115
|
maxLength: 10000,
|
|
112
116
|
});
|
|
113
|
-
// results.newsResults → [{title, url, content,
|
|
117
|
+
// results.newsResults → [{title, url, content, source, lastUpdatedAt, thumbnail, isAdult}]
|
|
114
118
|
```
|
|
115
119
|
|
|
116
120
|
### Video Search
|
package/dist/index.d.mts
CHANGED
|
@@ -113,6 +113,14 @@ type WebResult = {
|
|
|
113
113
|
* Indicates whether the result includes adult content.
|
|
114
114
|
*/
|
|
115
115
|
isAdult?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
118
|
+
*/
|
|
119
|
+
clickUrl?: string | null;
|
|
120
|
+
/**
|
|
121
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
122
|
+
*/
|
|
123
|
+
instrumentationSuffix?: string | null;
|
|
116
124
|
};
|
|
117
125
|
|
|
118
126
|
type WebResponse = {
|
|
@@ -120,6 +128,14 @@ type WebResponse = {
|
|
|
120
128
|
* List of web page results.
|
|
121
129
|
*/
|
|
122
130
|
webResults?: Array<WebResult> | null;
|
|
131
|
+
/**
|
|
132
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
133
|
+
*/
|
|
134
|
+
instrumentationClickBase?: string | null;
|
|
135
|
+
/**
|
|
136
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
137
|
+
*/
|
|
138
|
+
instrumentationCitationBase?: string | null;
|
|
123
139
|
/**
|
|
124
140
|
* Trace ID for debugging and tracking.
|
|
125
141
|
*/
|
|
@@ -205,10 +221,6 @@ type NewsItem = {
|
|
|
205
221
|
* The detailed content of the news.
|
|
206
222
|
*/
|
|
207
223
|
content?: string | null;
|
|
208
|
-
/**
|
|
209
|
-
* A snippet from the news content.
|
|
210
|
-
*/
|
|
211
|
-
snippet?: string | null;
|
|
212
224
|
thumbnail?: NewsThumbnail;
|
|
213
225
|
/**
|
|
214
226
|
* The last updated date of the news, in UTC ISO8601 format.
|
|
@@ -222,6 +234,14 @@ type NewsItem = {
|
|
|
222
234
|
* Indicates if the content is adult content.
|
|
223
235
|
*/
|
|
224
236
|
isAdult?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
239
|
+
*/
|
|
240
|
+
clickUrl?: string | null;
|
|
241
|
+
/**
|
|
242
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
243
|
+
*/
|
|
244
|
+
instrumentationSuffix?: string | null;
|
|
225
245
|
};
|
|
226
246
|
|
|
227
247
|
type NewsResponse = {
|
|
@@ -229,6 +249,14 @@ type NewsResponse = {
|
|
|
229
249
|
* List of news article results.
|
|
230
250
|
*/
|
|
231
251
|
newsResults?: Array<NewsItem> | null;
|
|
252
|
+
/**
|
|
253
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
254
|
+
*/
|
|
255
|
+
instrumentationClickBase?: string | null;
|
|
256
|
+
/**
|
|
257
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
258
|
+
*/
|
|
259
|
+
instrumentationCitationBase?: string | null;
|
|
232
260
|
/**
|
|
233
261
|
* Trace ID for debugging and tracking.
|
|
234
262
|
*/
|
|
@@ -420,6 +448,14 @@ type VideoItem = {
|
|
|
420
448
|
* Indicates whether the result includes adult content.
|
|
421
449
|
*/
|
|
422
450
|
isAdult?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
453
|
+
*/
|
|
454
|
+
clickUrl?: string | null;
|
|
455
|
+
/**
|
|
456
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
457
|
+
*/
|
|
458
|
+
instrumentationSuffix?: string | null;
|
|
423
459
|
};
|
|
424
460
|
|
|
425
461
|
type VideosResponse = {
|
|
@@ -431,6 +467,14 @@ type VideosResponse = {
|
|
|
431
467
|
* List of playlist results.
|
|
432
468
|
*/
|
|
433
469
|
playlists?: Array<PlaylistItem> | null;
|
|
470
|
+
/**
|
|
471
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
472
|
+
*/
|
|
473
|
+
instrumentationClickBase?: string | null;
|
|
474
|
+
/**
|
|
475
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
476
|
+
*/
|
|
477
|
+
instrumentationCitationBase?: string | null;
|
|
434
478
|
/**
|
|
435
479
|
* Trace ID for debugging and tracking.
|
|
436
480
|
*/
|
|
@@ -543,6 +587,14 @@ type ImageItem = {
|
|
|
543
587
|
* Indicates whether the content is adult content.
|
|
544
588
|
*/
|
|
545
589
|
isAdult?: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
592
|
+
*/
|
|
593
|
+
clickUrl?: string | null;
|
|
594
|
+
/**
|
|
595
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
596
|
+
*/
|
|
597
|
+
instrumentationSuffix?: string | null;
|
|
546
598
|
};
|
|
547
599
|
|
|
548
600
|
type ImagesResponse = {
|
|
@@ -550,6 +602,14 @@ type ImagesResponse = {
|
|
|
550
602
|
* List of image results.
|
|
551
603
|
*/
|
|
552
604
|
imageResults?: Array<ImageItem> | null;
|
|
605
|
+
/**
|
|
606
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
607
|
+
*/
|
|
608
|
+
instrumentationClickBase?: string | null;
|
|
609
|
+
/**
|
|
610
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
611
|
+
*/
|
|
612
|
+
instrumentationCitationBase?: string | null;
|
|
553
613
|
/**
|
|
554
614
|
* Trace ID for debugging and tracking.
|
|
555
615
|
*/
|
|
@@ -736,16 +796,20 @@ type QuerySignals = {
|
|
|
736
796
|
isFresh?: boolean | null;
|
|
737
797
|
};
|
|
738
798
|
|
|
739
|
-
/**
|
|
740
|
-
* Response for the classic search endpoint. The spec defines this as an
|
|
741
|
-
* open object (additionalProperties: {}) — keep the typed fields the spec
|
|
742
|
-
* lists but allow arbitrary extra keys (webResults, imageResults, etc.)
|
|
743
|
-
* so callers can read what the server actually returns.
|
|
744
|
-
*/
|
|
745
799
|
type SearchClassicResponse = {
|
|
746
800
|
querySignals?: QuerySignals;
|
|
747
|
-
/**
|
|
748
|
-
|
|
801
|
+
/**
|
|
802
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
803
|
+
*/
|
|
804
|
+
instrumentationClickBase?: string | null;
|
|
805
|
+
/**
|
|
806
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
807
|
+
*/
|
|
808
|
+
instrumentationCitationBase?: string | null;
|
|
809
|
+
/**
|
|
810
|
+
* Trace ID for debugging and tracking.
|
|
811
|
+
*/
|
|
812
|
+
traceId?: string | null;
|
|
749
813
|
[key: string]: any;
|
|
750
814
|
};
|
|
751
815
|
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,14 @@ type WebResult = {
|
|
|
113
113
|
* Indicates whether the result includes adult content.
|
|
114
114
|
*/
|
|
115
115
|
isAdult?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
118
|
+
*/
|
|
119
|
+
clickUrl?: string | null;
|
|
120
|
+
/**
|
|
121
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
122
|
+
*/
|
|
123
|
+
instrumentationSuffix?: string | null;
|
|
116
124
|
};
|
|
117
125
|
|
|
118
126
|
type WebResponse = {
|
|
@@ -120,6 +128,14 @@ type WebResponse = {
|
|
|
120
128
|
* List of web page results.
|
|
121
129
|
*/
|
|
122
130
|
webResults?: Array<WebResult> | null;
|
|
131
|
+
/**
|
|
132
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
133
|
+
*/
|
|
134
|
+
instrumentationClickBase?: string | null;
|
|
135
|
+
/**
|
|
136
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
137
|
+
*/
|
|
138
|
+
instrumentationCitationBase?: string | null;
|
|
123
139
|
/**
|
|
124
140
|
* Trace ID for debugging and tracking.
|
|
125
141
|
*/
|
|
@@ -205,10 +221,6 @@ type NewsItem = {
|
|
|
205
221
|
* The detailed content of the news.
|
|
206
222
|
*/
|
|
207
223
|
content?: string | null;
|
|
208
|
-
/**
|
|
209
|
-
* A snippet from the news content.
|
|
210
|
-
*/
|
|
211
|
-
snippet?: string | null;
|
|
212
224
|
thumbnail?: NewsThumbnail;
|
|
213
225
|
/**
|
|
214
226
|
* The last updated date of the news, in UTC ISO8601 format.
|
|
@@ -222,6 +234,14 @@ type NewsItem = {
|
|
|
222
234
|
* Indicates if the content is adult content.
|
|
223
235
|
*/
|
|
224
236
|
isAdult?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
239
|
+
*/
|
|
240
|
+
clickUrl?: string | null;
|
|
241
|
+
/**
|
|
242
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
243
|
+
*/
|
|
244
|
+
instrumentationSuffix?: string | null;
|
|
225
245
|
};
|
|
226
246
|
|
|
227
247
|
type NewsResponse = {
|
|
@@ -229,6 +249,14 @@ type NewsResponse = {
|
|
|
229
249
|
* List of news article results.
|
|
230
250
|
*/
|
|
231
251
|
newsResults?: Array<NewsItem> | null;
|
|
252
|
+
/**
|
|
253
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
254
|
+
*/
|
|
255
|
+
instrumentationClickBase?: string | null;
|
|
256
|
+
/**
|
|
257
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
258
|
+
*/
|
|
259
|
+
instrumentationCitationBase?: string | null;
|
|
232
260
|
/**
|
|
233
261
|
* Trace ID for debugging and tracking.
|
|
234
262
|
*/
|
|
@@ -420,6 +448,14 @@ type VideoItem = {
|
|
|
420
448
|
* Indicates whether the result includes adult content.
|
|
421
449
|
*/
|
|
422
450
|
isAdult?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
453
|
+
*/
|
|
454
|
+
clickUrl?: string | null;
|
|
455
|
+
/**
|
|
456
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
457
|
+
*/
|
|
458
|
+
instrumentationSuffix?: string | null;
|
|
423
459
|
};
|
|
424
460
|
|
|
425
461
|
type VideosResponse = {
|
|
@@ -431,6 +467,14 @@ type VideosResponse = {
|
|
|
431
467
|
* List of playlist results.
|
|
432
468
|
*/
|
|
433
469
|
playlists?: Array<PlaylistItem> | null;
|
|
470
|
+
/**
|
|
471
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
472
|
+
*/
|
|
473
|
+
instrumentationClickBase?: string | null;
|
|
474
|
+
/**
|
|
475
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
476
|
+
*/
|
|
477
|
+
instrumentationCitationBase?: string | null;
|
|
434
478
|
/**
|
|
435
479
|
* Trace ID for debugging and tracking.
|
|
436
480
|
*/
|
|
@@ -543,6 +587,14 @@ type ImageItem = {
|
|
|
543
587
|
* Indicates whether the content is adult content.
|
|
544
588
|
*/
|
|
545
589
|
isAdult?: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
592
|
+
*/
|
|
593
|
+
clickUrl?: string | null;
|
|
594
|
+
/**
|
|
595
|
+
* Suffix to append to the instrumentation ping URL base for this result item.
|
|
596
|
+
*/
|
|
597
|
+
instrumentationSuffix?: string | null;
|
|
546
598
|
};
|
|
547
599
|
|
|
548
600
|
type ImagesResponse = {
|
|
@@ -550,6 +602,14 @@ type ImagesResponse = {
|
|
|
550
602
|
* List of image results.
|
|
551
603
|
*/
|
|
552
604
|
imageResults?: Array<ImageItem> | null;
|
|
605
|
+
/**
|
|
606
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
607
|
+
*/
|
|
608
|
+
instrumentationClickBase?: string | null;
|
|
609
|
+
/**
|
|
610
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
611
|
+
*/
|
|
612
|
+
instrumentationCitationBase?: string | null;
|
|
553
613
|
/**
|
|
554
614
|
* Trace ID for debugging and tracking.
|
|
555
615
|
*/
|
|
@@ -736,16 +796,20 @@ type QuerySignals = {
|
|
|
736
796
|
isFresh?: boolean | null;
|
|
737
797
|
};
|
|
738
798
|
|
|
739
|
-
/**
|
|
740
|
-
* Response for the classic search endpoint. The spec defines this as an
|
|
741
|
-
* open object (additionalProperties: {}) — keep the typed fields the spec
|
|
742
|
-
* lists but allow arbitrary extra keys (webResults, imageResults, etc.)
|
|
743
|
-
* so callers can read what the server actually returns.
|
|
744
|
-
*/
|
|
745
799
|
type SearchClassicResponse = {
|
|
746
800
|
querySignals?: QuerySignals;
|
|
747
|
-
/**
|
|
748
|
-
|
|
801
|
+
/**
|
|
802
|
+
* Base URL for click ping requests. Append an instrumentationSuffix value from a result item to form the full ping URL.
|
|
803
|
+
*/
|
|
804
|
+
instrumentationClickBase?: string | null;
|
|
805
|
+
/**
|
|
806
|
+
* Base URL for LLM log ping requests. Append a DATA payload to form the full ping URL.
|
|
807
|
+
*/
|
|
808
|
+
instrumentationCitationBase?: string | null;
|
|
809
|
+
/**
|
|
810
|
+
* Trace ID for debugging and tracking.
|
|
811
|
+
*/
|
|
812
|
+
traceId?: string | null;
|
|
749
813
|
[key: string]: any;
|
|
750
814
|
};
|
|
751
815
|
|
package/package.json
CHANGED
|
@@ -1,65 +1,67 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"README.md"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsup",
|
|
21
|
-
"dev": "tsup --watch",
|
|
22
|
-
"lint": "eslint src --ext .ts",
|
|
23
|
-
"lint:fix": "eslint src --ext .ts --fix",
|
|
24
|
-
"format": "prettier --write \"src/**/*.ts\" \"*.md\" \"*.json\" --ignore-path ../../.prettierignore",
|
|
25
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"*.md\" \"*.json\" --ignore-path ../../.prettierignore",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"test": "vitest run",
|
|
28
|
-
"test:watch": "vitest",
|
|
29
|
-
"clean": "rimraf dist"
|
|
30
|
-
},
|
|
31
|
-
"keywords": [
|
|
32
|
-
"webiq",
|
|
33
|
-
"webiq sdk"
|
|
34
|
-
],
|
|
35
|
-
"author": "Microsoft <webiqsdk@microsoft.com>",
|
|
36
|
-
"license": "MIT",
|
|
37
|
-
"engines": {
|
|
38
|
-
"node": ">=22",
|
|
39
|
-
"npm": ">=10"
|
|
40
|
-
},
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"access": "public"
|
|
43
|
-
},
|
|
44
|
-
"sideEffects": false,
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@azure/identity": ">=4.13.1",
|
|
47
|
-
"@types/node": "^20.10.0",
|
|
48
|
-
"eslint": "^8.56.0",
|
|
49
|
-
"openapi-typescript-codegen": "^0.30.0",
|
|
50
|
-
"prettier": "^3.5.3",
|
|
51
|
-
"rimraf": "^6.0.0",
|
|
52
|
-
"tsup": "^8.0.0",
|
|
53
|
-
"tsx": "^4.21.0",
|
|
54
|
-
"typescript": "^5.3.0",
|
|
55
|
-
"vitest": "^4.0.18"
|
|
56
|
-
},
|
|
57
|
-
"peerDependencies": {
|
|
58
|
-
"@azure/identity": ">=4.13.1"
|
|
59
|
-
},
|
|
60
|
-
"peerDependenciesMeta": {
|
|
61
|
-
"@azure/identity": {
|
|
62
|
-
"optional": true
|
|
63
|
-
}
|
|
2
|
+
"name": "@microsoft/webiq",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Web IQ API TypeScript SDK",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
64
13
|
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup",
|
|
21
|
+
"dev": "tsup --watch",
|
|
22
|
+
"lint": "eslint src --ext .ts",
|
|
23
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
24
|
+
"format": "prettier --write \"src/**/*.ts\" \"*.md\" \"*.json\" --ignore-path ../../.prettierignore",
|
|
25
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"*.md\" \"*.json\" --ignore-path ../../.prettierignore",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:watch": "vitest",
|
|
29
|
+
"clean": "rimraf dist"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"webiq",
|
|
33
|
+
"webiq sdk"
|
|
34
|
+
],
|
|
35
|
+
"author": "Microsoft <webiqsdk@microsoft.com>",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22",
|
|
39
|
+
"npm": ">=10"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@azure/identity": ">=4.13.1",
|
|
47
|
+
"@types/js-yaml": "^4.0.9",
|
|
48
|
+
"@types/node": "^20.10.0",
|
|
49
|
+
"eslint": "^8.56.0",
|
|
50
|
+
"js-yaml": "^5.2.0",
|
|
51
|
+
"openapi-typescript-codegen": "^0.30.0",
|
|
52
|
+
"prettier": "^3.5.3",
|
|
53
|
+
"rimraf": "^6.0.0",
|
|
54
|
+
"tsup": "^8.0.0",
|
|
55
|
+
"tsx": "^4.21.0",
|
|
56
|
+
"typescript": "^5.3.0",
|
|
57
|
+
"vitest": "^4.0.18"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"@azure/identity": ">=4.13.1"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"@azure/identity": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
65
67
|
}
|