@maxim_mazurok/gapi.client.customsearch-v1 0.0.20231127 → 0.0.20231128
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/index.d.ts +538 -1055
- package/package.json +6 -6
- package/readme.md +8 -8
- package/tests.ts +0 -86
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/package.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@maxim_mazurok/gapi.client.customsearch-v1",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.20231128",
|
4
4
|
"description": "TypeScript typings for Custom Search API v1",
|
5
|
+
"repository": {
|
6
|
+
"type": "git",
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
8
|
+
},
|
5
9
|
"license": "MIT",
|
6
10
|
"author": {
|
7
|
-
"email": "maxim@mazurok.com",
|
8
11
|
"name": "Maxim Mazurok",
|
12
|
+
"email": "maxim@mazurok.com",
|
9
13
|
"url": "https://maxim.mazurok.com"
|
10
14
|
},
|
11
|
-
"repository": {
|
12
|
-
"type": "git",
|
13
|
-
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
14
|
-
},
|
15
15
|
"types": "index.d.ts",
|
16
16
|
"dependencies": {
|
17
17
|
"@types/gapi.client": "*",
|
package/readme.md
CHANGED
@@ -25,10 +25,13 @@ gapi.load('client', () => {
|
|
25
25
|
Then load api client wrapper:
|
26
26
|
|
27
27
|
```typescript
|
28
|
-
gapi.client.load(
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
gapi.client.load(
|
29
|
+
'https://customsearch.googleapis.com/$discovery/rest?version=v1',
|
30
|
+
() => {
|
31
|
+
// now we can use:
|
32
|
+
// gapi.client.search
|
33
|
+
}
|
34
|
+
);
|
32
35
|
```
|
33
36
|
|
34
37
|
```typescript
|
@@ -39,14 +42,11 @@ gapi.client.load('customsearch', 'v1', () => {
|
|
39
42
|
});
|
40
43
|
```
|
41
44
|
|
42
|
-
|
43
|
-
|
44
45
|
After that you can use Custom Search API resources: <!-- TODO: make this work for multiple namespaces -->
|
45
46
|
|
46
47
|
```typescript
|
47
|
-
|
48
48
|
/*
|
49
49
|
Returns metadata about the search performed, metadata about the engine used for the search, and the search results.
|
50
50
|
*/
|
51
|
-
await gapi.client.search.cse.list({
|
51
|
+
await gapi.client.search.cse.list({});
|
52
52
|
```
|
package/tests.ts
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
/* This is stub file for gapi.client.customsearch-v1 definition tests */
|
2
|
-
// IMPORTANT
|
3
|
-
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
4
|
-
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
5
|
-
|
6
|
-
// Revision: 20231127
|
7
|
-
|
8
|
-
gapi.load('client', async () => {
|
9
|
-
/** now we can use gapi.client */
|
10
|
-
|
11
|
-
await gapi.client.load('https://customsearch.googleapis.com/$discovery/rest?version=v1');
|
12
|
-
/** now we can use gapi.client.search */
|
13
|
-
|
14
|
-
run();
|
15
|
-
|
16
|
-
async function run() {
|
17
|
-
/** Returns metadata about the search performed, metadata about the engine used for the search, and the search results. */
|
18
|
-
await gapi.client.search.cse.list({
|
19
|
-
c2coff: "Test string",
|
20
|
-
cr: "Test string",
|
21
|
-
cx: "Test string",
|
22
|
-
dateRestrict: "Test string",
|
23
|
-
exactTerms: "Test string",
|
24
|
-
excludeTerms: "Test string",
|
25
|
-
fileType: "Test string",
|
26
|
-
filter: "Test string",
|
27
|
-
gl: "Test string",
|
28
|
-
googlehost: "Test string",
|
29
|
-
highRange: "Test string",
|
30
|
-
hl: "Test string",
|
31
|
-
hq: "Test string",
|
32
|
-
imgColorType: "Test string",
|
33
|
-
imgDominantColor: "Test string",
|
34
|
-
imgSize: "Test string",
|
35
|
-
imgType: "Test string",
|
36
|
-
linkSite: "Test string",
|
37
|
-
lowRange: "Test string",
|
38
|
-
lr: "Test string",
|
39
|
-
num: 42,
|
40
|
-
orTerms: "Test string",
|
41
|
-
q: "Test string",
|
42
|
-
relatedSite: "Test string",
|
43
|
-
rights: "Test string",
|
44
|
-
safe: "Test string",
|
45
|
-
searchType: "Test string",
|
46
|
-
siteSearch: "Test string",
|
47
|
-
siteSearchFilter: "Test string",
|
48
|
-
sort: "Test string",
|
49
|
-
start: 42,
|
50
|
-
});
|
51
|
-
/** Returns metadata about the search performed, metadata about the engine used for the search, and the search results. Uses a small set of url patterns. */
|
52
|
-
await gapi.client.search.cse.siterestrict.list({
|
53
|
-
c2coff: "Test string",
|
54
|
-
cr: "Test string",
|
55
|
-
cx: "Test string",
|
56
|
-
dateRestrict: "Test string",
|
57
|
-
exactTerms: "Test string",
|
58
|
-
excludeTerms: "Test string",
|
59
|
-
fileType: "Test string",
|
60
|
-
filter: "Test string",
|
61
|
-
gl: "Test string",
|
62
|
-
googlehost: "Test string",
|
63
|
-
highRange: "Test string",
|
64
|
-
hl: "Test string",
|
65
|
-
hq: "Test string",
|
66
|
-
imgColorType: "Test string",
|
67
|
-
imgDominantColor: "Test string",
|
68
|
-
imgSize: "Test string",
|
69
|
-
imgType: "Test string",
|
70
|
-
linkSite: "Test string",
|
71
|
-
lowRange: "Test string",
|
72
|
-
lr: "Test string",
|
73
|
-
num: 42,
|
74
|
-
orTerms: "Test string",
|
75
|
-
q: "Test string",
|
76
|
-
relatedSite: "Test string",
|
77
|
-
rights: "Test string",
|
78
|
-
safe: "Test string",
|
79
|
-
searchType: "Test string",
|
80
|
-
siteSearch: "Test string",
|
81
|
-
siteSearchFilter: "Test string",
|
82
|
-
sort: "Test string",
|
83
|
-
start: 42,
|
84
|
-
});
|
85
|
-
}
|
86
|
-
});
|
package/tsconfig.json
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"module": "commonjs",
|
4
|
-
"lib": ["es6", "dom"],
|
5
|
-
"noImplicitAny": true,
|
6
|
-
"noImplicitThis": true,
|
7
|
-
"strictNullChecks": true,
|
8
|
-
"baseUrl": "../",
|
9
|
-
"typeRoots": [
|
10
|
-
"../"
|
11
|
-
],
|
12
|
-
"types": [],
|
13
|
-
"noEmit": true,
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
15
|
-
"strictFunctionTypes": true
|
16
|
-
},
|
17
|
-
"files": ["index.d.ts", "tests.ts"]
|
18
|
-
}
|