@microsoft/webiq 0.1.1 → 0.1.2
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 +4 -1
- package/dist/index.d.mts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +18 -0
- package/dist/index.mjs +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,8 +99,11 @@ const results = await client.web.search(query, {
|
|
|
99
99
|
location: 'lat:40.7;long:-74.0', // Optional
|
|
100
100
|
contentFormat: ContentFormat.HTML, // PASSAGE, TEXT, HTML, MARKDOWN
|
|
101
101
|
maxLength: 10000, // 1-500000
|
|
102
|
+
customSearchConfigId: 'my-config', // Optional custom search config
|
|
103
|
+
includeDomains: ['example.com'], // Optional allowlist (max 250)
|
|
104
|
+
excludeDomains: ['spam.example'], // Optional blocklist (max 250)
|
|
102
105
|
});
|
|
103
|
-
// results.webResults → [{title, url, content, lastUpdatedAt, crawledAt, language, isAdult}]
|
|
106
|
+
// results.webResults → [{title, url, content, lastUpdatedAt, crawledAt, language, isAdult, contentTier}]
|
|
104
107
|
```
|
|
105
108
|
|
|
106
109
|
### News Search
|
package/dist/index.d.mts
CHANGED
|
@@ -84,6 +84,12 @@ declare enum ContentFormat {
|
|
|
84
84
|
MARKDOWN = "markdown"
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
declare enum ContentTier {
|
|
88
|
+
STANDARD = "standard",
|
|
89
|
+
ENTITLED = "entitled",
|
|
90
|
+
PREMIUM = "premium"
|
|
91
|
+
}
|
|
92
|
+
|
|
87
93
|
type WebResult = {
|
|
88
94
|
/**
|
|
89
95
|
* The title of the webpage.
|
|
@@ -113,6 +119,7 @@ type WebResult = {
|
|
|
113
119
|
* Indicates whether the result includes adult content.
|
|
114
120
|
*/
|
|
115
121
|
isAdult?: boolean;
|
|
122
|
+
contentTier?: ContentTier;
|
|
116
123
|
/**
|
|
117
124
|
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
118
125
|
*/
|
|
@@ -164,6 +171,18 @@ interface WebSearchParams {
|
|
|
164
171
|
contentFormat?: ContentFormat;
|
|
165
172
|
/** Max characters in content (1-500000, default 10000). */
|
|
166
173
|
maxLength?: number;
|
|
174
|
+
/** Custom search configuration ID (configure at https://www.customsearch.ai/). */
|
|
175
|
+
customSearchConfigId?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Domains to include in results (max 250). For allow-lists longer than ~20
|
|
178
|
+
* domains, use `customSearchConfigId` instead.
|
|
179
|
+
*/
|
|
180
|
+
includeDomains?: string[];
|
|
181
|
+
/**
|
|
182
|
+
* Domains to exclude from results (max 250). For deny-lists longer than ~20
|
|
183
|
+
* domains, use `customSearchConfigId` instead.
|
|
184
|
+
*/
|
|
185
|
+
excludeDomains?: string[];
|
|
167
186
|
/** Per-request timeout in milliseconds (overrides client default). */
|
|
168
187
|
timeout?: number;
|
|
169
188
|
/**
|
|
@@ -1164,4 +1183,4 @@ declare class HttpTransport implements Transport {
|
|
|
1164
1183
|
close(): Promise<void>;
|
|
1165
1184
|
}
|
|
1166
1185
|
|
|
1167
|
-
export { APIConnectionError, APIStatusError, ApiKeyAuth, type AuthProvider, AuthenticationError, BrowseContentFormat, type BrowseFetchOptions, type BrowseParams, BrowseResource, type BrowseResponse, ClassicResource, type ClassicSearchOptions, type ClassicSearchParams, ContentFormat, DEFAULT_SCOPE, DEFAULT_TIMEOUT, EntraIDAuth, type FetchFunction, HttpTransport, type HttpTransportOptions, ImageAspectRatio, ImageColor, type ImageItem, type ImageSearchOptions, ImageSize, ImagesResource, type ImagesResponse, type ImagesSearchParams, type NewsItem, NewsResource, type NewsResponse, type NewsSearchOptions, type NewsSearchParams, type NewsThumbnail, PermissionDeniedError, type PlaylistItem, type PlaylistVideo, type QuerySignals, RateLimitError, RetryPolicy, type RetryPolicyOptions, SafeSearch, SafeSearchMode, type SearchClassicResponse, type TelemetryEvent, type TelemetryHook, type TokenCredential, type Transport, type TransportRequestOptions, VideoDuration, type VideoItem, type VideoMoment, VideoResolution, type VideoSearchOptions, VideosResource, type VideosResponse, type VideosSearchParams, WebIQClient, type WebIQClientOptions, WebIQError, WebResource, type WebResponse, type WebResult, type WebSearchOptions, type WebSearchParams, createAuth, createClient, createTelemetryEvent, safeCall };
|
|
1186
|
+
export { APIConnectionError, APIStatusError, ApiKeyAuth, type AuthProvider, AuthenticationError, BrowseContentFormat, type BrowseFetchOptions, type BrowseParams, BrowseResource, type BrowseResponse, ClassicResource, type ClassicSearchOptions, type ClassicSearchParams, ContentFormat, ContentTier, DEFAULT_SCOPE, DEFAULT_TIMEOUT, EntraIDAuth, type FetchFunction, HttpTransport, type HttpTransportOptions, ImageAspectRatio, ImageColor, type ImageItem, type ImageSearchOptions, ImageSize, ImagesResource, type ImagesResponse, type ImagesSearchParams, type NewsItem, NewsResource, type NewsResponse, type NewsSearchOptions, type NewsSearchParams, type NewsThumbnail, PermissionDeniedError, type PlaylistItem, type PlaylistVideo, type QuerySignals, RateLimitError, RetryPolicy, type RetryPolicyOptions, SafeSearch, SafeSearchMode, type SearchClassicResponse, type TelemetryEvent, type TelemetryHook, type TokenCredential, type Transport, type TransportRequestOptions, VideoDuration, type VideoItem, type VideoMoment, VideoResolution, type VideoSearchOptions, VideosResource, type VideosResponse, type VideosSearchParams, WebIQClient, type WebIQClientOptions, WebIQError, WebResource, type WebResponse, type WebResult, type WebSearchOptions, type WebSearchParams, createAuth, createClient, createTelemetryEvent, safeCall };
|
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,12 @@ declare enum ContentFormat {
|
|
|
84
84
|
MARKDOWN = "markdown"
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
declare enum ContentTier {
|
|
88
|
+
STANDARD = "standard",
|
|
89
|
+
ENTITLED = "entitled",
|
|
90
|
+
PREMIUM = "premium"
|
|
91
|
+
}
|
|
92
|
+
|
|
87
93
|
type WebResult = {
|
|
88
94
|
/**
|
|
89
95
|
* The title of the webpage.
|
|
@@ -113,6 +119,7 @@ type WebResult = {
|
|
|
113
119
|
* Indicates whether the result includes adult content.
|
|
114
120
|
*/
|
|
115
121
|
isAdult?: boolean;
|
|
122
|
+
contentTier?: ContentTier;
|
|
116
123
|
/**
|
|
117
124
|
* Redirect URL that proxies through Bing. Only present when redirect is enabled.
|
|
118
125
|
*/
|
|
@@ -164,6 +171,18 @@ interface WebSearchParams {
|
|
|
164
171
|
contentFormat?: ContentFormat;
|
|
165
172
|
/** Max characters in content (1-500000, default 10000). */
|
|
166
173
|
maxLength?: number;
|
|
174
|
+
/** Custom search configuration ID (configure at https://www.customsearch.ai/). */
|
|
175
|
+
customSearchConfigId?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Domains to include in results (max 250). For allow-lists longer than ~20
|
|
178
|
+
* domains, use `customSearchConfigId` instead.
|
|
179
|
+
*/
|
|
180
|
+
includeDomains?: string[];
|
|
181
|
+
/**
|
|
182
|
+
* Domains to exclude from results (max 250). For deny-lists longer than ~20
|
|
183
|
+
* domains, use `customSearchConfigId` instead.
|
|
184
|
+
*/
|
|
185
|
+
excludeDomains?: string[];
|
|
167
186
|
/** Per-request timeout in milliseconds (overrides client default). */
|
|
168
187
|
timeout?: number;
|
|
169
188
|
/**
|
|
@@ -1164,4 +1183,4 @@ declare class HttpTransport implements Transport {
|
|
|
1164
1183
|
close(): Promise<void>;
|
|
1165
1184
|
}
|
|
1166
1185
|
|
|
1167
|
-
export { APIConnectionError, APIStatusError, ApiKeyAuth, type AuthProvider, AuthenticationError, BrowseContentFormat, type BrowseFetchOptions, type BrowseParams, BrowseResource, type BrowseResponse, ClassicResource, type ClassicSearchOptions, type ClassicSearchParams, ContentFormat, DEFAULT_SCOPE, DEFAULT_TIMEOUT, EntraIDAuth, type FetchFunction, HttpTransport, type HttpTransportOptions, ImageAspectRatio, ImageColor, type ImageItem, type ImageSearchOptions, ImageSize, ImagesResource, type ImagesResponse, type ImagesSearchParams, type NewsItem, NewsResource, type NewsResponse, type NewsSearchOptions, type NewsSearchParams, type NewsThumbnail, PermissionDeniedError, type PlaylistItem, type PlaylistVideo, type QuerySignals, RateLimitError, RetryPolicy, type RetryPolicyOptions, SafeSearch, SafeSearchMode, type SearchClassicResponse, type TelemetryEvent, type TelemetryHook, type TokenCredential, type Transport, type TransportRequestOptions, VideoDuration, type VideoItem, type VideoMoment, VideoResolution, type VideoSearchOptions, VideosResource, type VideosResponse, type VideosSearchParams, WebIQClient, type WebIQClientOptions, WebIQError, WebResource, type WebResponse, type WebResult, type WebSearchOptions, type WebSearchParams, createAuth, createClient, createTelemetryEvent, safeCall };
|
|
1186
|
+
export { APIConnectionError, APIStatusError, ApiKeyAuth, type AuthProvider, AuthenticationError, BrowseContentFormat, type BrowseFetchOptions, type BrowseParams, BrowseResource, type BrowseResponse, ClassicResource, type ClassicSearchOptions, type ClassicSearchParams, ContentFormat, ContentTier, DEFAULT_SCOPE, DEFAULT_TIMEOUT, EntraIDAuth, type FetchFunction, HttpTransport, type HttpTransportOptions, ImageAspectRatio, ImageColor, type ImageItem, type ImageSearchOptions, ImageSize, ImagesResource, type ImagesResponse, type ImagesSearchParams, type NewsItem, NewsResource, type NewsResponse, type NewsSearchOptions, type NewsSearchParams, type NewsThumbnail, PermissionDeniedError, type PlaylistItem, type PlaylistVideo, type QuerySignals, RateLimitError, RetryPolicy, type RetryPolicyOptions, SafeSearch, SafeSearchMode, type SearchClassicResponse, type TelemetryEvent, type TelemetryHook, type TokenCredential, type Transport, type TransportRequestOptions, VideoDuration, type VideoItem, type VideoMoment, VideoResolution, type VideoSearchOptions, VideosResource, type VideosResponse, type VideosSearchParams, WebIQClient, type WebIQClientOptions, WebIQError, WebResource, type WebResponse, type WebResult, type WebSearchOptions, type WebSearchParams, createAuth, createClient, createTelemetryEvent, safeCall };
|
package/dist/index.js
CHANGED
|
@@ -84,6 +84,15 @@ var WebResource = class {
|
|
|
84
84
|
if (options?.maxLength !== void 0) {
|
|
85
85
|
payload.maxLength = options.maxLength;
|
|
86
86
|
}
|
|
87
|
+
if (options?.customSearchConfigId !== void 0) {
|
|
88
|
+
payload.customSearchConfigId = options.customSearchConfigId;
|
|
89
|
+
}
|
|
90
|
+
if (options?.includeDomains !== void 0) {
|
|
91
|
+
payload.includeDomains = options.includeDomains;
|
|
92
|
+
}
|
|
93
|
+
if (options?.excludeDomains !== void 0) {
|
|
94
|
+
payload.excludeDomains = options.excludeDomains;
|
|
95
|
+
}
|
|
87
96
|
const result = await this.transport.request({
|
|
88
97
|
method: "POST",
|
|
89
98
|
path: "/search/web",
|
|
@@ -735,6 +744,14 @@ var ContentFormat = /* @__PURE__ */ ((ContentFormat2) => {
|
|
|
735
744
|
return ContentFormat2;
|
|
736
745
|
})(ContentFormat || {});
|
|
737
746
|
|
|
747
|
+
// src/generated-otc/models/ContentTier.ts
|
|
748
|
+
var ContentTier = /* @__PURE__ */ ((ContentTier2) => {
|
|
749
|
+
ContentTier2["STANDARD"] = "standard";
|
|
750
|
+
ContentTier2["ENTITLED"] = "entitled";
|
|
751
|
+
ContentTier2["PREMIUM"] = "premium";
|
|
752
|
+
return ContentTier2;
|
|
753
|
+
})(ContentTier || {});
|
|
754
|
+
|
|
738
755
|
// src/generated-otc/models/SafeSearch.ts
|
|
739
756
|
var SafeSearch = /* @__PURE__ */ ((SafeSearch2) => {
|
|
740
757
|
SafeSearch2["OFF"] = "off";
|
|
@@ -799,6 +816,7 @@ exports.BrowseContentFormat = BrowseContentFormat;
|
|
|
799
816
|
exports.BrowseResource = BrowseResource;
|
|
800
817
|
exports.ClassicResource = ClassicResource;
|
|
801
818
|
exports.ContentFormat = ContentFormat;
|
|
819
|
+
exports.ContentTier = ContentTier;
|
|
802
820
|
exports.DEFAULT_SCOPE = DEFAULT_SCOPE;
|
|
803
821
|
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
|
|
804
822
|
exports.EntraIDAuth = EntraIDAuth;
|
package/dist/index.mjs
CHANGED
|
@@ -82,6 +82,15 @@ var WebResource = class {
|
|
|
82
82
|
if (options?.maxLength !== void 0) {
|
|
83
83
|
payload.maxLength = options.maxLength;
|
|
84
84
|
}
|
|
85
|
+
if (options?.customSearchConfigId !== void 0) {
|
|
86
|
+
payload.customSearchConfigId = options.customSearchConfigId;
|
|
87
|
+
}
|
|
88
|
+
if (options?.includeDomains !== void 0) {
|
|
89
|
+
payload.includeDomains = options.includeDomains;
|
|
90
|
+
}
|
|
91
|
+
if (options?.excludeDomains !== void 0) {
|
|
92
|
+
payload.excludeDomains = options.excludeDomains;
|
|
93
|
+
}
|
|
85
94
|
const result = await this.transport.request({
|
|
86
95
|
method: "POST",
|
|
87
96
|
path: "/search/web",
|
|
@@ -733,6 +742,14 @@ var ContentFormat = /* @__PURE__ */ ((ContentFormat2) => {
|
|
|
733
742
|
return ContentFormat2;
|
|
734
743
|
})(ContentFormat || {});
|
|
735
744
|
|
|
745
|
+
// src/generated-otc/models/ContentTier.ts
|
|
746
|
+
var ContentTier = /* @__PURE__ */ ((ContentTier2) => {
|
|
747
|
+
ContentTier2["STANDARD"] = "standard";
|
|
748
|
+
ContentTier2["ENTITLED"] = "entitled";
|
|
749
|
+
ContentTier2["PREMIUM"] = "premium";
|
|
750
|
+
return ContentTier2;
|
|
751
|
+
})(ContentTier || {});
|
|
752
|
+
|
|
736
753
|
// src/generated-otc/models/SafeSearch.ts
|
|
737
754
|
var SafeSearch = /* @__PURE__ */ ((SafeSearch2) => {
|
|
738
755
|
SafeSearch2["OFF"] = "off";
|
|
@@ -789,4 +806,4 @@ var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
|
|
|
789
806
|
return ImageSize2;
|
|
790
807
|
})(ImageSize || {});
|
|
791
808
|
|
|
792
|
-
export { APIConnectionError, APIStatusError, ApiKeyAuth, AuthenticationError, BrowseContentFormat, BrowseResource, ClassicResource, ContentFormat, DEFAULT_SCOPE, DEFAULT_TIMEOUT, EntraIDAuth, HttpTransport, ImageAspectRatio, ImageColor, ImageSize, ImagesResource, NewsResource, PermissionDeniedError, RateLimitError, RetryPolicy, SafeSearch, SafeSearchMode, VideoDuration, VideoResolution, VideosResource, WebIQClient, WebIQError, WebResource, createAuth, createClient, createTelemetryEvent, safeCall };
|
|
809
|
+
export { APIConnectionError, APIStatusError, ApiKeyAuth, AuthenticationError, BrowseContentFormat, BrowseResource, ClassicResource, ContentFormat, ContentTier, DEFAULT_SCOPE, DEFAULT_TIMEOUT, EntraIDAuth, HttpTransport, ImageAspectRatio, ImageColor, ImageSize, ImagesResource, NewsResource, PermissionDeniedError, RateLimitError, RetryPolicy, SafeSearch, SafeSearchMode, VideoDuration, VideoResolution, VideosResource, WebIQClient, WebIQError, WebResource, createAuth, createClient, createTelemetryEvent, safeCall };
|