@microsoft/webiq 0.1.4 → 0.1.5

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 CHANGED
@@ -140,9 +140,11 @@ const results = await client.videos.search(query, {
140
140
  ### Browse
141
141
 
142
142
  ```typescript
143
+ import { BrowseContentFormat, BrowseLiveCrawl } from '@microsoft/webiq';
144
+
143
145
  const page = await client.browse.fetch(url, {
144
146
  maxLength: 10000, // 1-500000
145
- liveCrawl: 'fallback', // "none" (default) | "fallback" | "force"
147
+ liveCrawl: BrowseLiveCrawl.FALLBACK, // NONE (default), FALLBACK, FORCE
146
148
  includeWebLinks: true,
147
149
  includeImageLinks: true,
148
150
  renderDynamicPages: false,
@@ -173,7 +175,7 @@ const results = await client.images.search(query, {
173
175
  Given a query, classic search will search and retrieve content from webpages, images, videos, news, weather, sports, etc.
174
176
 
175
177
  ```typescript
176
- import { ContentFormat, SafeSearchMode } from '@microsoft/webiq';
178
+ import { ContentFormat, SafeSearch } from '@microsoft/webiq';
177
179
 
178
180
  const response = await client.classic.search(query, {
179
181
  maxAnswerTypes: 6, // 1-6, default 6
@@ -185,7 +187,7 @@ const response = await client.classic.search(query, {
185
187
  contentFormat: ContentFormat.HTML,
186
188
  freshness: 'month', // day, week, month, year, or date range
187
189
  responseFilter: ['webResults', 'newsResults'], // Answer types to include
188
- safeSearch: SafeSearchMode.MODERATE, // OFF, MODERATE, STRICT
190
+ safeSearch: SafeSearch.STRICT, // OFF, STRICT
189
191
  });
190
192
  // response.querySignals → {originalQuery, normalizedQuery, isDefensive, isAdult, isNav, isFresh}
191
193
  // response.traceId → string
package/dist/index.d.mts CHANGED
@@ -692,6 +692,12 @@ declare enum BrowseContentFormat {
692
692
  MARKDOWN = "markdown"
693
693
  }
694
694
 
695
+ declare enum BrowseLiveCrawl {
696
+ NONE = "none",
697
+ FALLBACK = "fallback",
698
+ FORCE = "force"
699
+ }
700
+
695
701
  type BrowseResponse = {
696
702
  /**
697
703
  * The URL of the web page.
@@ -739,8 +745,8 @@ interface BrowseParams {
739
745
  url: string;
740
746
  /** Max characters in content (1-500000, default 10000). */
741
747
  maxLength?: number;
742
- /** Crawl behavior ('none', 'fallback', or 'force', default 'none'). */
743
- liveCrawl?: 'none' | 'fallback' | 'force';
748
+ /** Crawl behavior: use BrowseLiveCrawl.NONE, .FALLBACK, or .FORCE. */
749
+ liveCrawl?: BrowseLiveCrawl;
744
750
  /** Include outbound hyperlinks (default false). */
745
751
  includeWebLinks?: boolean;
746
752
  /** Enable JS rendering for dynamic content (default false). */
@@ -776,12 +782,6 @@ declare class BrowseResource {
776
782
  fetch(url: string, options?: BrowseFetchOptions): Promise<BrowseResponse>;
777
783
  }
778
784
 
779
- declare enum SafeSearchMode {
780
- OFF = "off",
781
- MODERATE = "moderate",
782
- STRICT = "strict"
783
- }
784
-
785
785
  type QuerySignals = {
786
786
  /**
787
787
  * The original user query as received by the system.
@@ -854,8 +854,8 @@ interface ClassicSearchParams {
854
854
  freshness?: string;
855
855
  /** List of answer types to include in response. */
856
856
  responseFilter?: string[];
857
- /** Safe search mode: use SafeSearchMode.OFF, .MODERATE, or .STRICT. */
858
- safeSearch?: SafeSearchMode;
857
+ /** Safe search mode: use SafeSearch.OFF or .STRICT. */
858
+ safeSearch?: SafeSearch;
859
859
  /** Per-request timeout in milliseconds (overrides client default). */
860
860
  timeout?: number;
861
861
  /** Caller-provided cancellation signal (see `WebSearchParams.signal`). */
@@ -1135,6 +1135,12 @@ declare class PermissionDeniedError extends APIStatusError {
1135
1135
  });
1136
1136
  }
1137
1137
 
1138
+ declare enum SafeSearchMode {
1139
+ OFF = "off",
1140
+ MODERATE = "moderate",
1141
+ STRICT = "strict"
1142
+ }
1143
+
1138
1144
  /**
1139
1145
  * HTTP transport implementation.
1140
1146
  */
@@ -1177,4 +1183,4 @@ declare class HttpTransport implements Transport {
1177
1183
  close(): Promise<void>;
1178
1184
  }
1179
1185
 
1180
- 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 };
1186
+ export { APIConnectionError, APIStatusError, ApiKeyAuth, type AuthProvider, AuthenticationError, BrowseContentFormat, type BrowseFetchOptions, BrowseLiveCrawl, 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
@@ -692,6 +692,12 @@ declare enum BrowseContentFormat {
692
692
  MARKDOWN = "markdown"
693
693
  }
694
694
 
695
+ declare enum BrowseLiveCrawl {
696
+ NONE = "none",
697
+ FALLBACK = "fallback",
698
+ FORCE = "force"
699
+ }
700
+
695
701
  type BrowseResponse = {
696
702
  /**
697
703
  * The URL of the web page.
@@ -739,8 +745,8 @@ interface BrowseParams {
739
745
  url: string;
740
746
  /** Max characters in content (1-500000, default 10000). */
741
747
  maxLength?: number;
742
- /** Crawl behavior ('none', 'fallback', or 'force', default 'none'). */
743
- liveCrawl?: 'none' | 'fallback' | 'force';
748
+ /** Crawl behavior: use BrowseLiveCrawl.NONE, .FALLBACK, or .FORCE. */
749
+ liveCrawl?: BrowseLiveCrawl;
744
750
  /** Include outbound hyperlinks (default false). */
745
751
  includeWebLinks?: boolean;
746
752
  /** Enable JS rendering for dynamic content (default false). */
@@ -776,12 +782,6 @@ declare class BrowseResource {
776
782
  fetch(url: string, options?: BrowseFetchOptions): Promise<BrowseResponse>;
777
783
  }
778
784
 
779
- declare enum SafeSearchMode {
780
- OFF = "off",
781
- MODERATE = "moderate",
782
- STRICT = "strict"
783
- }
784
-
785
785
  type QuerySignals = {
786
786
  /**
787
787
  * The original user query as received by the system.
@@ -854,8 +854,8 @@ interface ClassicSearchParams {
854
854
  freshness?: string;
855
855
  /** List of answer types to include in response. */
856
856
  responseFilter?: string[];
857
- /** Safe search mode: use SafeSearchMode.OFF, .MODERATE, or .STRICT. */
858
- safeSearch?: SafeSearchMode;
857
+ /** Safe search mode: use SafeSearch.OFF or .STRICT. */
858
+ safeSearch?: SafeSearch;
859
859
  /** Per-request timeout in milliseconds (overrides client default). */
860
860
  timeout?: number;
861
861
  /** Caller-provided cancellation signal (see `WebSearchParams.signal`). */
@@ -1135,6 +1135,12 @@ declare class PermissionDeniedError extends APIStatusError {
1135
1135
  });
1136
1136
  }
1137
1137
 
1138
+ declare enum SafeSearchMode {
1139
+ OFF = "off",
1140
+ MODERATE = "moderate",
1141
+ STRICT = "strict"
1142
+ }
1143
+
1138
1144
  /**
1139
1145
  * HTTP transport implementation.
1140
1146
  */
@@ -1177,4 +1183,4 @@ declare class HttpTransport implements Transport {
1177
1183
  close(): Promise<void>;
1178
1184
  }
1179
1185
 
1180
- 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 };
1186
+ export { APIConnectionError, APIStatusError, ApiKeyAuth, type AuthProvider, AuthenticationError, BrowseContentFormat, type BrowseFetchOptions, BrowseLiveCrawl, 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
@@ -729,6 +729,14 @@ var BrowseContentFormat = /* @__PURE__ */ ((BrowseContentFormat2) => {
729
729
  return BrowseContentFormat2;
730
730
  })(BrowseContentFormat || {});
731
731
 
732
+ // src/generated-otc/models/BrowseLiveCrawl.ts
733
+ var BrowseLiveCrawl = /* @__PURE__ */ ((BrowseLiveCrawl2) => {
734
+ BrowseLiveCrawl2["NONE"] = "none";
735
+ BrowseLiveCrawl2["FALLBACK"] = "fallback";
736
+ BrowseLiveCrawl2["FORCE"] = "force";
737
+ return BrowseLiveCrawl2;
738
+ })(BrowseLiveCrawl || {});
739
+
732
740
  // src/generated-otc/models/ContentFormat.ts
733
741
  var ContentFormat = /* @__PURE__ */ ((ContentFormat2) => {
734
742
  ContentFormat2["PASSAGE"] = "passage";
@@ -807,6 +815,7 @@ exports.APIStatusError = APIStatusError;
807
815
  exports.ApiKeyAuth = ApiKeyAuth;
808
816
  exports.AuthenticationError = AuthenticationError;
809
817
  exports.BrowseContentFormat = BrowseContentFormat;
818
+ exports.BrowseLiveCrawl = BrowseLiveCrawl;
810
819
  exports.BrowseResource = BrowseResource;
811
820
  exports.ClassicResource = ClassicResource;
812
821
  exports.ContentFormat = ContentFormat;
package/dist/index.mjs CHANGED
@@ -727,6 +727,14 @@ var BrowseContentFormat = /* @__PURE__ */ ((BrowseContentFormat2) => {
727
727
  return BrowseContentFormat2;
728
728
  })(BrowseContentFormat || {});
729
729
 
730
+ // src/generated-otc/models/BrowseLiveCrawl.ts
731
+ var BrowseLiveCrawl = /* @__PURE__ */ ((BrowseLiveCrawl2) => {
732
+ BrowseLiveCrawl2["NONE"] = "none";
733
+ BrowseLiveCrawl2["FALLBACK"] = "fallback";
734
+ BrowseLiveCrawl2["FORCE"] = "force";
735
+ return BrowseLiveCrawl2;
736
+ })(BrowseLiveCrawl || {});
737
+
730
738
  // src/generated-otc/models/ContentFormat.ts
731
739
  var ContentFormat = /* @__PURE__ */ ((ContentFormat2) => {
732
740
  ContentFormat2["PASSAGE"] = "passage";
@@ -800,4 +808,4 @@ var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
800
808
  return ImageSize2;
801
809
  })(ImageSize || {});
802
810
 
803
- 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 };
811
+ export { APIConnectionError, APIStatusError, ApiKeyAuth, AuthenticationError, BrowseContentFormat, BrowseLiveCrawl, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/webiq",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Web IQ API TypeScript SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",