@googleapis/safebrowsing 11.0.1 → 12.1.0
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/CHANGELOG.md +29 -0
- package/build/v4.d.ts +361 -0
- package/build/v4.js.map +1 -1
- package/build/v5.d.ts +500 -0
- package/build/v5.js +108 -0
- package/build/v5.js.map +1 -1
- package/package.json +1 -1
- package/v4.ts +361 -0
- package/v5.ts +767 -0
package/package.json
CHANGED
package/v4.ts
CHANGED
|
@@ -578,6 +578,58 @@ export namespace safebrowsing_v4 {
|
|
|
578
578
|
}
|
|
579
579
|
|
|
580
580
|
/**
|
|
581
|
+
* @example
|
|
582
|
+
* ```js
|
|
583
|
+
* // Before running the sample:
|
|
584
|
+
* // - Enable the API at:
|
|
585
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
586
|
+
* // - Login into gcloud by running:
|
|
587
|
+
* // ```sh
|
|
588
|
+
* // $ gcloud auth application-default login
|
|
589
|
+
* // ```
|
|
590
|
+
* // - Install the npm module by running:
|
|
591
|
+
* // ```sh
|
|
592
|
+
* // $ npm install googleapis
|
|
593
|
+
* // ```
|
|
594
|
+
*
|
|
595
|
+
* const {google} = require('googleapis');
|
|
596
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
597
|
+
*
|
|
598
|
+
* async function main() {
|
|
599
|
+
* const auth = new google.auth.GoogleAuth({
|
|
600
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
601
|
+
* scopes: [],
|
|
602
|
+
* });
|
|
603
|
+
*
|
|
604
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
605
|
+
* const authClient = await auth.getClient();
|
|
606
|
+
* google.options({auth: authClient});
|
|
607
|
+
*
|
|
608
|
+
* // Do the magic
|
|
609
|
+
* const res = await safebrowsing.encodedFullHashes.get({
|
|
610
|
+
* // A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API.
|
|
611
|
+
* clientId: 'placeholder-value',
|
|
612
|
+
* // The version of the client implementation.
|
|
613
|
+
* clientVersion: 'placeholder-value',
|
|
614
|
+
* // A serialized FindFullHashesRequest proto.
|
|
615
|
+
* encodedRequest: 'placeholder-value',
|
|
616
|
+
* });
|
|
617
|
+
* console.log(res.data);
|
|
618
|
+
*
|
|
619
|
+
* // Example response
|
|
620
|
+
* // {
|
|
621
|
+
* // "matches": [],
|
|
622
|
+
* // "minimumWaitDuration": "my_minimumWaitDuration",
|
|
623
|
+
* // "negativeCacheDuration": "my_negativeCacheDuration"
|
|
624
|
+
* // }
|
|
625
|
+
* }
|
|
626
|
+
*
|
|
627
|
+
* main().catch(e => {
|
|
628
|
+
* console.error(e);
|
|
629
|
+
* throw e;
|
|
630
|
+
* });
|
|
631
|
+
*
|
|
632
|
+
* ```
|
|
581
633
|
*
|
|
582
634
|
* @param params - Parameters for request
|
|
583
635
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -701,6 +753,57 @@ export namespace safebrowsing_v4 {
|
|
|
701
753
|
}
|
|
702
754
|
|
|
703
755
|
/**
|
|
756
|
+
* @example
|
|
757
|
+
* ```js
|
|
758
|
+
* // Before running the sample:
|
|
759
|
+
* // - Enable the API at:
|
|
760
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
761
|
+
* // - Login into gcloud by running:
|
|
762
|
+
* // ```sh
|
|
763
|
+
* // $ gcloud auth application-default login
|
|
764
|
+
* // ```
|
|
765
|
+
* // - Install the npm module by running:
|
|
766
|
+
* // ```sh
|
|
767
|
+
* // $ npm install googleapis
|
|
768
|
+
* // ```
|
|
769
|
+
*
|
|
770
|
+
* const {google} = require('googleapis');
|
|
771
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
772
|
+
*
|
|
773
|
+
* async function main() {
|
|
774
|
+
* const auth = new google.auth.GoogleAuth({
|
|
775
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
776
|
+
* scopes: [],
|
|
777
|
+
* });
|
|
778
|
+
*
|
|
779
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
780
|
+
* const authClient = await auth.getClient();
|
|
781
|
+
* google.options({auth: authClient});
|
|
782
|
+
*
|
|
783
|
+
* // Do the magic
|
|
784
|
+
* const res = await safebrowsing.encodedUpdates.get({
|
|
785
|
+
* // A client ID that uniquely identifies the client implementation of the Safe Browsing API.
|
|
786
|
+
* clientId: 'placeholder-value',
|
|
787
|
+
* // The version of the client implementation.
|
|
788
|
+
* clientVersion: 'placeholder-value',
|
|
789
|
+
* // A serialized FetchThreatListUpdatesRequest proto.
|
|
790
|
+
* encodedRequest: 'placeholder-value',
|
|
791
|
+
* });
|
|
792
|
+
* console.log(res.data);
|
|
793
|
+
*
|
|
794
|
+
* // Example response
|
|
795
|
+
* // {
|
|
796
|
+
* // "listUpdateResponses": [],
|
|
797
|
+
* // "minimumWaitDuration": "my_minimumWaitDuration"
|
|
798
|
+
* // }
|
|
799
|
+
* }
|
|
800
|
+
*
|
|
801
|
+
* main().catch(e => {
|
|
802
|
+
* console.error(e);
|
|
803
|
+
* throw e;
|
|
804
|
+
* });
|
|
805
|
+
*
|
|
806
|
+
* ```
|
|
704
807
|
*
|
|
705
808
|
* @param params - Parameters for request
|
|
706
809
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -825,6 +928,62 @@ export namespace safebrowsing_v4 {
|
|
|
825
928
|
|
|
826
929
|
/**
|
|
827
930
|
* Finds the full hashes that match the requested hash prefixes.
|
|
931
|
+
* @example
|
|
932
|
+
* ```js
|
|
933
|
+
* // Before running the sample:
|
|
934
|
+
* // - Enable the API at:
|
|
935
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
936
|
+
* // - Login into gcloud by running:
|
|
937
|
+
* // ```sh
|
|
938
|
+
* // $ gcloud auth application-default login
|
|
939
|
+
* // ```
|
|
940
|
+
* // - Install the npm module by running:
|
|
941
|
+
* // ```sh
|
|
942
|
+
* // $ npm install googleapis
|
|
943
|
+
* // ```
|
|
944
|
+
*
|
|
945
|
+
* const {google} = require('googleapis');
|
|
946
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
947
|
+
*
|
|
948
|
+
* async function main() {
|
|
949
|
+
* const auth = new google.auth.GoogleAuth({
|
|
950
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
951
|
+
* scopes: [],
|
|
952
|
+
* });
|
|
953
|
+
*
|
|
954
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
955
|
+
* const authClient = await auth.getClient();
|
|
956
|
+
* google.options({auth: authClient});
|
|
957
|
+
*
|
|
958
|
+
* // Do the magic
|
|
959
|
+
* const res = await safebrowsing.fullHashes.find({
|
|
960
|
+
* // Request body metadata
|
|
961
|
+
* requestBody: {
|
|
962
|
+
* // request body parameters
|
|
963
|
+
* // {
|
|
964
|
+
* // "apiClient": {},
|
|
965
|
+
* // "client": {},
|
|
966
|
+
* // "clientStates": [],
|
|
967
|
+
* // "threatInfo": {}
|
|
968
|
+
* // }
|
|
969
|
+
* },
|
|
970
|
+
* });
|
|
971
|
+
* console.log(res.data);
|
|
972
|
+
*
|
|
973
|
+
* // Example response
|
|
974
|
+
* // {
|
|
975
|
+
* // "matches": [],
|
|
976
|
+
* // "minimumWaitDuration": "my_minimumWaitDuration",
|
|
977
|
+
* // "negativeCacheDuration": "my_negativeCacheDuration"
|
|
978
|
+
* // }
|
|
979
|
+
* }
|
|
980
|
+
*
|
|
981
|
+
* main().catch(e => {
|
|
982
|
+
* console.error(e);
|
|
983
|
+
* throw e;
|
|
984
|
+
* });
|
|
985
|
+
*
|
|
986
|
+
* ```
|
|
828
987
|
*
|
|
829
988
|
* @param params - Parameters for request
|
|
830
989
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -939,6 +1098,60 @@ export namespace safebrowsing_v4 {
|
|
|
939
1098
|
|
|
940
1099
|
/**
|
|
941
1100
|
* Reports a Safe Browsing threat list hit to Google. Only projects with TRUSTED_REPORTER visibility can use this method.
|
|
1101
|
+
* @example
|
|
1102
|
+
* ```js
|
|
1103
|
+
* // Before running the sample:
|
|
1104
|
+
* // - Enable the API at:
|
|
1105
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
1106
|
+
* // - Login into gcloud by running:
|
|
1107
|
+
* // ```sh
|
|
1108
|
+
* // $ gcloud auth application-default login
|
|
1109
|
+
* // ```
|
|
1110
|
+
* // - Install the npm module by running:
|
|
1111
|
+
* // ```sh
|
|
1112
|
+
* // $ npm install googleapis
|
|
1113
|
+
* // ```
|
|
1114
|
+
*
|
|
1115
|
+
* const {google} = require('googleapis');
|
|
1116
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
1117
|
+
*
|
|
1118
|
+
* async function main() {
|
|
1119
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1120
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1121
|
+
* scopes: [],
|
|
1122
|
+
* });
|
|
1123
|
+
*
|
|
1124
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1125
|
+
* const authClient = await auth.getClient();
|
|
1126
|
+
* google.options({auth: authClient});
|
|
1127
|
+
*
|
|
1128
|
+
* // Do the magic
|
|
1129
|
+
* const res = await safebrowsing.threatHits.create({
|
|
1130
|
+
* // Request body metadata
|
|
1131
|
+
* requestBody: {
|
|
1132
|
+
* // request body parameters
|
|
1133
|
+
* // {
|
|
1134
|
+
* // "clientInfo": {},
|
|
1135
|
+
* // "entry": {},
|
|
1136
|
+
* // "platformType": "my_platformType",
|
|
1137
|
+
* // "resources": [],
|
|
1138
|
+
* // "threatType": "my_threatType",
|
|
1139
|
+
* // "userInfo": {}
|
|
1140
|
+
* // }
|
|
1141
|
+
* },
|
|
1142
|
+
* });
|
|
1143
|
+
* console.log(res.data);
|
|
1144
|
+
*
|
|
1145
|
+
* // Example response
|
|
1146
|
+
* // {}
|
|
1147
|
+
* }
|
|
1148
|
+
*
|
|
1149
|
+
* main().catch(e => {
|
|
1150
|
+
* console.error(e);
|
|
1151
|
+
* throw e;
|
|
1152
|
+
* });
|
|
1153
|
+
*
|
|
1154
|
+
* ```
|
|
942
1155
|
*
|
|
943
1156
|
* @param params - Parameters for request
|
|
944
1157
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1042,6 +1255,49 @@ export namespace safebrowsing_v4 {
|
|
|
1042
1255
|
|
|
1043
1256
|
/**
|
|
1044
1257
|
* Lists the Safe Browsing threat lists available for download.
|
|
1258
|
+
* @example
|
|
1259
|
+
* ```js
|
|
1260
|
+
* // Before running the sample:
|
|
1261
|
+
* // - Enable the API at:
|
|
1262
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
1263
|
+
* // - Login into gcloud by running:
|
|
1264
|
+
* // ```sh
|
|
1265
|
+
* // $ gcloud auth application-default login
|
|
1266
|
+
* // ```
|
|
1267
|
+
* // - Install the npm module by running:
|
|
1268
|
+
* // ```sh
|
|
1269
|
+
* // $ npm install googleapis
|
|
1270
|
+
* // ```
|
|
1271
|
+
*
|
|
1272
|
+
* const {google} = require('googleapis');
|
|
1273
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
1274
|
+
*
|
|
1275
|
+
* async function main() {
|
|
1276
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1277
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1278
|
+
* scopes: [],
|
|
1279
|
+
* });
|
|
1280
|
+
*
|
|
1281
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1282
|
+
* const authClient = await auth.getClient();
|
|
1283
|
+
* google.options({auth: authClient});
|
|
1284
|
+
*
|
|
1285
|
+
* // Do the magic
|
|
1286
|
+
* const res = await safebrowsing.threatLists.list({});
|
|
1287
|
+
* console.log(res.data);
|
|
1288
|
+
*
|
|
1289
|
+
* // Example response
|
|
1290
|
+
* // {
|
|
1291
|
+
* // "threatLists": []
|
|
1292
|
+
* // }
|
|
1293
|
+
* }
|
|
1294
|
+
*
|
|
1295
|
+
* main().catch(e => {
|
|
1296
|
+
* console.error(e);
|
|
1297
|
+
* throw e;
|
|
1298
|
+
* });
|
|
1299
|
+
*
|
|
1300
|
+
* ```
|
|
1045
1301
|
*
|
|
1046
1302
|
* @param params - Parameters for request
|
|
1047
1303
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1149,6 +1405,59 @@ export namespace safebrowsing_v4 {
|
|
|
1149
1405
|
|
|
1150
1406
|
/**
|
|
1151
1407
|
* Fetches the most recent threat list updates. A client can request updates for multiple lists at once.
|
|
1408
|
+
* @example
|
|
1409
|
+
* ```js
|
|
1410
|
+
* // Before running the sample:
|
|
1411
|
+
* // - Enable the API at:
|
|
1412
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
1413
|
+
* // - Login into gcloud by running:
|
|
1414
|
+
* // ```sh
|
|
1415
|
+
* // $ gcloud auth application-default login
|
|
1416
|
+
* // ```
|
|
1417
|
+
* // - Install the npm module by running:
|
|
1418
|
+
* // ```sh
|
|
1419
|
+
* // $ npm install googleapis
|
|
1420
|
+
* // ```
|
|
1421
|
+
*
|
|
1422
|
+
* const {google} = require('googleapis');
|
|
1423
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
1424
|
+
*
|
|
1425
|
+
* async function main() {
|
|
1426
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1427
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1428
|
+
* scopes: [],
|
|
1429
|
+
* });
|
|
1430
|
+
*
|
|
1431
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1432
|
+
* const authClient = await auth.getClient();
|
|
1433
|
+
* google.options({auth: authClient});
|
|
1434
|
+
*
|
|
1435
|
+
* // Do the magic
|
|
1436
|
+
* const res = await safebrowsing.threatListUpdates.fetch({
|
|
1437
|
+
* // Request body metadata
|
|
1438
|
+
* requestBody: {
|
|
1439
|
+
* // request body parameters
|
|
1440
|
+
* // {
|
|
1441
|
+
* // "client": {},
|
|
1442
|
+
* // "listUpdateRequests": []
|
|
1443
|
+
* // }
|
|
1444
|
+
* },
|
|
1445
|
+
* });
|
|
1446
|
+
* console.log(res.data);
|
|
1447
|
+
*
|
|
1448
|
+
* // Example response
|
|
1449
|
+
* // {
|
|
1450
|
+
* // "listUpdateResponses": [],
|
|
1451
|
+
* // "minimumWaitDuration": "my_minimumWaitDuration"
|
|
1452
|
+
* // }
|
|
1453
|
+
* }
|
|
1454
|
+
*
|
|
1455
|
+
* main().catch(e => {
|
|
1456
|
+
* console.error(e);
|
|
1457
|
+
* throw e;
|
|
1458
|
+
* });
|
|
1459
|
+
*
|
|
1460
|
+
* ```
|
|
1152
1461
|
*
|
|
1153
1462
|
* @param params - Parameters for request
|
|
1154
1463
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1265,6 +1574,58 @@ export namespace safebrowsing_v4 {
|
|
|
1265
1574
|
|
|
1266
1575
|
/**
|
|
1267
1576
|
* Finds the threat entries that match the Safe Browsing lists.
|
|
1577
|
+
* @example
|
|
1578
|
+
* ```js
|
|
1579
|
+
* // Before running the sample:
|
|
1580
|
+
* // - Enable the API at:
|
|
1581
|
+
* // https://console.developers.google.com/apis/api/safebrowsing.googleapis.com
|
|
1582
|
+
* // - Login into gcloud by running:
|
|
1583
|
+
* // ```sh
|
|
1584
|
+
* // $ gcloud auth application-default login
|
|
1585
|
+
* // ```
|
|
1586
|
+
* // - Install the npm module by running:
|
|
1587
|
+
* // ```sh
|
|
1588
|
+
* // $ npm install googleapis
|
|
1589
|
+
* // ```
|
|
1590
|
+
*
|
|
1591
|
+
* const {google} = require('googleapis');
|
|
1592
|
+
* const safebrowsing = google.safebrowsing('v4');
|
|
1593
|
+
*
|
|
1594
|
+
* async function main() {
|
|
1595
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1596
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1597
|
+
* scopes: [],
|
|
1598
|
+
* });
|
|
1599
|
+
*
|
|
1600
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1601
|
+
* const authClient = await auth.getClient();
|
|
1602
|
+
* google.options({auth: authClient});
|
|
1603
|
+
*
|
|
1604
|
+
* // Do the magic
|
|
1605
|
+
* const res = await safebrowsing.threatMatches.find({
|
|
1606
|
+
* // Request body metadata
|
|
1607
|
+
* requestBody: {
|
|
1608
|
+
* // request body parameters
|
|
1609
|
+
* // {
|
|
1610
|
+
* // "client": {},
|
|
1611
|
+
* // "threatInfo": {}
|
|
1612
|
+
* // }
|
|
1613
|
+
* },
|
|
1614
|
+
* });
|
|
1615
|
+
* console.log(res.data);
|
|
1616
|
+
*
|
|
1617
|
+
* // Example response
|
|
1618
|
+
* // {
|
|
1619
|
+
* // "matches": []
|
|
1620
|
+
* // }
|
|
1621
|
+
* }
|
|
1622
|
+
*
|
|
1623
|
+
* main().catch(e => {
|
|
1624
|
+
* console.error(e);
|
|
1625
|
+
* throw e;
|
|
1626
|
+
* });
|
|
1627
|
+
*
|
|
1628
|
+
* ```
|
|
1268
1629
|
*
|
|
1269
1630
|
* @param params - Parameters for request
|
|
1270
1631
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|