serpex 2.0.0 → 2.0.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 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,10 +15,10 @@ pnpm add serpex
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
import {
|
|
18
|
+
import { SerpexClient } from 'serpex';
|
|
19
19
|
|
|
20
20
|
// Initialize the client with your API key
|
|
21
|
-
const client = new
|
|
21
|
+
const client = new SerpexClient('your-api-key-here');
|
|
22
22
|
|
|
23
23
|
// Search with Google
|
|
24
24
|
const googleResults = await client.search({
|
|
@@ -40,12 +40,12 @@ console.log(bingResults.results[0].title);
|
|
|
40
40
|
|
|
41
41
|
## API Reference
|
|
42
42
|
|
|
43
|
-
###
|
|
43
|
+
### SerpexClient
|
|
44
44
|
|
|
45
45
|
#### Constructor
|
|
46
46
|
|
|
47
47
|
```typescript
|
|
48
|
-
new
|
|
48
|
+
new SerpexClient(apiKey: string, baseUrl?: string)
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
- `apiKey`: Your API key from the Serpex dashboard
|
|
@@ -163,7 +163,7 @@ interface SearchResponse {
|
|
|
163
163
|
The SDK throws `SerpApiException` for API errors:
|
|
164
164
|
|
|
165
165
|
```typescript
|
|
166
|
-
import {
|
|
166
|
+
import { SerpexClient, SerpApiException } from 'serpex';
|
|
167
167
|
|
|
168
168
|
try {
|
|
169
169
|
const results = await client.search({ q: 'test query' });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SearchResponse, SearchParams, SerpApiException } from './types';
|
|
2
2
|
export { SearchResponse, SearchParams, SerpApiException };
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class SerpexClient {
|
|
4
4
|
private baseUrl;
|
|
5
5
|
private apiKey;
|
|
6
6
|
/**
|
|
7
|
-
* Create a new
|
|
7
|
+
* Create a new SerpexClient instance
|
|
8
8
|
* @param apiKey - Your API key from the Serpex dashboard
|
|
9
9
|
* @param baseUrl - Base URL for the API (optional, defaults to production)
|
|
10
10
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE1D,qBAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE1D,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAiC;IAStE;;OAEG;YACW,WAAW;IA6CzB;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;CA4B5D"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SerpexClient = exports.SerpApiException = void 0;
|
|
4
4
|
const types_1 = require("./types");
|
|
5
5
|
Object.defineProperty(exports, "SerpApiException", { enumerable: true, get: function () { return types_1.SerpApiException; } });
|
|
6
|
-
class
|
|
6
|
+
class SerpexClient {
|
|
7
7
|
/**
|
|
8
|
-
* Create a new
|
|
8
|
+
* Create a new SerpexClient instance
|
|
9
9
|
* @param apiKey - Your API key from the Serpex dashboard
|
|
10
10
|
* @param baseUrl - Base URL for the API (optional, defaults to production)
|
|
11
11
|
*/
|
|
@@ -83,5 +83,5 @@ class SerpApiClient {
|
|
|
83
83
|
return this.makeRequest('/api/search', requestParams);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
exports.
|
|
86
|
+
exports.SerpexClient = SerpexClient;
|
|
87
87
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAIiB;AAEsB,iGAHrC,wBAAgB,OAGqC;AAEvD,MAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAIiB;AAEsB,iGAHrC,wBAAgB,OAGqC;AAEvD,MAAa,YAAY;IAIvB;;;;OAIG;IACH,YAAY,MAAc,EAAE,UAAkB,wBAAwB;QACpE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB;IACrE,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,SAA8B,EAAE;QAC1E,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;QACzC,MAAM,OAAO,GAA2B;YACtC,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;YACxC,cAA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