@maxim_mazurok/gapi.client.recaptchaenterprise-v1 0.0.20220806

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 ADDED
@@ -0,0 +1,839 @@
1
+ /* Type definitions for non-npm package reCAPTCHA Enterprise API v1 0.0 */
2
+ // Project: https://cloud.google.com/recaptcha-enterprise/
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+ // TypeScript Version: 2.8
8
+
9
+ // IMPORTANT
10
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
+ // Generated from: https://recaptchaenterprise.googleapis.com/$discovery/rest?version=v1
13
+ // Revision: 20220806
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load reCAPTCHA Enterprise API v1 */
19
+ function load(urlOrObject: "https://recaptchaenterprise.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "recaptchaenterprise", version: "v1"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "recaptchaenterprise", version: "v1", callback: () => any): void;
24
+
25
+ namespace recaptchaenterprise {
26
+ interface GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment {
27
+ /** Labels for this request. */
28
+ labels?: string[];
29
+ }
30
+ interface GoogleCloudRecaptchaenterpriseV1AndroidKeySettings {
31
+ /** If set to true, allowed_package_names are not enforced. */
32
+ allowAllPackageNames?: boolean;
33
+ /** Android package names of apps allowed to use the key. Example: 'com.companyname.appname' */
34
+ allowedPackageNames?: string[];
35
+ }
36
+ interface GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest {
37
+ /**
38
+ * Optional. The annotation that will be assigned to the Event. This field can be left empty to provide reasons that apply to an event without concluding whether the event is
39
+ * legitimate or fraudulent.
40
+ */
41
+ annotation?: string;
42
+ /**
43
+ * Optional. Unique stable hashed user identifier to apply to the assessment. This is an alternative to setting the hashed_account_id in CreateAssessment, for example when the account
44
+ * identifier is not yet known in the initial request. It is recommended that the identifier is hashed using hmac-sha256 with stable secret.
45
+ */
46
+ hashedAccountId?: string;
47
+ /** Optional. Optional reasons for the annotation that will be assigned to the Event. */
48
+ reasons?: string[];
49
+ }
50
+ // tslint:disable-next-line:no-empty-interface
51
+ interface GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse {
52
+ }
53
+ interface GoogleCloudRecaptchaenterpriseV1Assessment {
54
+ /** Assessment returned by account defender when a hashed_account_id is provided. */
55
+ accountDefenderAssessment?: GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment;
56
+ /** The event being assessed. */
57
+ event?: GoogleCloudRecaptchaenterpriseV1Event;
58
+ /** Output only. The resource name for the Assessment in the format "projects/{project}/assessments/{assessment}". */
59
+ name?: string;
60
+ /** The private password leak verification field contains the parameters that are used to to check for leaks privately without sharing user credentials. */
61
+ privatePasswordLeakVerification?: GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification;
62
+ /** Output only. The risk analysis result for the event being assessed. */
63
+ riskAnalysis?: GoogleCloudRecaptchaenterpriseV1RiskAnalysis;
64
+ /** Output only. Properties of the provided event token. */
65
+ tokenProperties?: GoogleCloudRecaptchaenterpriseV1TokenProperties;
66
+ }
67
+ interface GoogleCloudRecaptchaenterpriseV1ChallengeMetrics {
68
+ /** Count of submitted challenge solutions that were incorrect or otherwise deemed suspicious such that a subsequent challenge was triggered. */
69
+ failedCount?: string;
70
+ /** Count of nocaptchas (successful verification without a challenge) issued. */
71
+ nocaptchaCount?: string;
72
+ /** Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent to a count of pageloads for pages that include reCAPTCHA. */
73
+ pageloadCount?: string;
74
+ /** Count of nocaptchas (successful verification without a challenge) plus submitted challenge solutions that were correct and resulted in verification. */
75
+ passedCount?: string;
76
+ }
77
+ interface GoogleCloudRecaptchaenterpriseV1Event {
78
+ /**
79
+ * Optional. The expected action for this type of event. This should be the same action provided at token generation time on client-side platforms already integrated with recaptcha
80
+ * enterprise.
81
+ */
82
+ expectedAction?: string;
83
+ /** Optional. Unique stable hashed user identifier for the request. The identifier must be hashed using hmac-sha256 with stable secret. */
84
+ hashedAccountId?: string;
85
+ /** Optional. The site key that was used to invoke reCAPTCHA on your site and generate the token. */
86
+ siteKey?: string;
87
+ /** Optional. The user response token provided by the reCAPTCHA client-side integration on your site. */
88
+ token?: string;
89
+ /** Optional. The user agent present in the request from the user's device related to this event. */
90
+ userAgent?: string;
91
+ /** Optional. The IP address in the request from the user's device related to this event. */
92
+ userIpAddress?: string;
93
+ }
94
+ interface GoogleCloudRecaptchaenterpriseV1IOSKeySettings {
95
+ /** If set to true, allowed_bundle_ids are not enforced. */
96
+ allowAllBundleIds?: boolean;
97
+ /** iOS bundle ids of apps allowed to use the key. Example: 'com.companyname.productname.appname' */
98
+ allowedBundleIds?: string[];
99
+ }
100
+ interface GoogleCloudRecaptchaenterpriseV1Key {
101
+ /** Settings for keys that can be used by Android apps. */
102
+ androidSettings?: GoogleCloudRecaptchaenterpriseV1AndroidKeySettings;
103
+ /** The timestamp corresponding to the creation of this Key. */
104
+ createTime?: string;
105
+ /** Human-readable display name of this key. Modifiable by user. */
106
+ displayName?: string;
107
+ /** Settings for keys that can be used by iOS apps. */
108
+ iosSettings?: GoogleCloudRecaptchaenterpriseV1IOSKeySettings;
109
+ /** See Creating and managing labels. */
110
+ labels?: { [P in string]: string };
111
+ /** The resource name for the Key in the format "projects/{project}/keys/{key}". */
112
+ name?: string;
113
+ /** Options for user acceptance testing. */
114
+ testingOptions?: GoogleCloudRecaptchaenterpriseV1TestingOptions;
115
+ /** Settings for WAF */
116
+ wafSettings?: GoogleCloudRecaptchaenterpriseV1WafSettings;
117
+ /** Settings for keys that can be used by websites. */
118
+ webSettings?: GoogleCloudRecaptchaenterpriseV1WebKeySettings;
119
+ }
120
+ interface GoogleCloudRecaptchaenterpriseV1ListKeysResponse {
121
+ /** Key details. */
122
+ keys?: GoogleCloudRecaptchaenterpriseV1Key[];
123
+ /** Token to retrieve the next page of results. It is set to empty if no keys remain in results. */
124
+ nextPageToken?: string;
125
+ }
126
+ interface GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupMembershipsResponse {
127
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
128
+ nextPageToken?: string;
129
+ /** The memberships listed by the query. */
130
+ relatedAccountGroupMemberships?: GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership[];
131
+ }
132
+ interface GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupsResponse {
133
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
134
+ nextPageToken?: string;
135
+ /** The groups of related accounts listed by the query. */
136
+ relatedAccountGroups?: GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup[];
137
+ }
138
+ interface GoogleCloudRecaptchaenterpriseV1Metrics {
139
+ /** Metrics will be continuous and in order by dates, and in the granularity of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have challenge-based data. */
140
+ challengeMetrics?: GoogleCloudRecaptchaenterpriseV1ChallengeMetrics[];
141
+ /** Output only. The name of the metrics, in the format "projects/{project}/keys/{key}/metrics". */
142
+ name?: string;
143
+ /** Metrics will be continuous and in order by dates, and in the granularity of day. All Key types should have score-based data. */
144
+ scoreMetrics?: GoogleCloudRecaptchaenterpriseV1ScoreMetrics[];
145
+ /** Inclusive start time aligned to a day (UTC). */
146
+ startTime?: string;
147
+ }
148
+ // tslint:disable-next-line:no-empty-interface
149
+ interface GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest {
150
+ }
151
+ interface GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification {
152
+ /**
153
+ * Output only. List of prefixes of the encrypted potential password leaks that matched the given parameters. They must be compared with the client-side decryption prefix of
154
+ * `reencrypted_user_credentials_hash`
155
+ */
156
+ encryptedLeakMatchPrefixes?: string[];
157
+ /** Optional. Encrypted Scrypt hash of the canonicalized username+password. It is re-encrypted by the server and returned through `reencrypted_user_credentials_hash`. */
158
+ encryptedUserCredentialsHash?: string;
159
+ /** Optional. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It is used to look up password leaks associated with that hash prefix. */
160
+ lookupHashPrefix?: string;
161
+ /** Output only. Corresponds to the re-encryption of the `encrypted_user_credentials_hash` field. It is used to match potential password leaks within `encrypted_leak_match_prefixes`. */
162
+ reencryptedUserCredentialsHash?: string;
163
+ }
164
+ interface GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup {
165
+ /** Required. The resource name for the related account group in the format `projects/{project}/relatedaccountgroups/{related_account_group}`. */
166
+ name?: string;
167
+ }
168
+ interface GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership {
169
+ /** The unique stable hashed user identifier of the member. The identifier corresponds to a `hashed_account_id` provided in a previous `CreateAssessment` or `AnnotateAssessment` call. */
170
+ hashedAccountId?: string;
171
+ /** Required. The resource name for this membership in the format `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. */
172
+ name?: string;
173
+ }
174
+ interface GoogleCloudRecaptchaenterpriseV1RetrieveLegacySecretKeyResponse {
175
+ /**
176
+ * The secret key (also known as shared secret) authorizes communication between your application backend and the reCAPTCHA Enterprise server to create an assessment. The secret key
177
+ * needs to be kept safe for security purposes.
178
+ */
179
+ legacySecretKey?: string;
180
+ }
181
+ interface GoogleCloudRecaptchaenterpriseV1RiskAnalysis {
182
+ /** Reasons contributing to the risk analysis verdict. */
183
+ reasons?: string[];
184
+ /** Legitimate event score from 0.0 to 1.0. (1.0 means very likely legitimate traffic while 0.0 means very likely non-legitimate traffic). */
185
+ score?: number;
186
+ }
187
+ interface GoogleCloudRecaptchaenterpriseV1ScoreDistribution {
188
+ /** Map key is score value multiplied by 100. The scores are discrete values between [0, 1]. The maximum number of buckets is on order of a few dozen, but typically much lower (ie. 10). */
189
+ scoreBuckets?: { [P in string]: string };
190
+ }
191
+ interface GoogleCloudRecaptchaenterpriseV1ScoreMetrics {
192
+ /** Action-based metrics. The map key is the action name which specified by the site owners at time of the "execute" client-side call. Populated only for SCORE keys. */
193
+ actionMetrics?: { [P in string]: GoogleCloudRecaptchaenterpriseV1ScoreDistribution };
194
+ /** Aggregated score metrics for all traffic. */
195
+ overallMetrics?: GoogleCloudRecaptchaenterpriseV1ScoreDistribution;
196
+ }
197
+ interface GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsRequest {
198
+ /**
199
+ * Optional. The unique stable hashed user identifier we should search connections to. The identifier should correspond to a `hashed_account_id` provided in a previous
200
+ * `CreateAssessment` or `AnnotateAssessment` call.
201
+ */
202
+ hashedAccountId?: string;
203
+ /**
204
+ * Optional. The maximum number of groups to return. The service might return fewer than this value. If unspecified, at most 50 groups are returned. The maximum value is 1000; values
205
+ * above 1000 are coerced to 1000.
206
+ */
207
+ pageSize?: number;
208
+ /**
209
+ * Optional. A page token, received from a previous `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the subsequent page. When paginating, all other parameters
210
+ * provided to `SearchRelatedAccountGroupMemberships` must match the call that provided the page token.
211
+ */
212
+ pageToken?: string;
213
+ }
214
+ interface GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsResponse {
215
+ /** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
216
+ nextPageToken?: string;
217
+ /** The queried memberships. */
218
+ relatedAccountGroupMemberships?: GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership[];
219
+ }
220
+ interface GoogleCloudRecaptchaenterpriseV1TestingOptions {
221
+ /** For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests for this site will return nocaptcha if NOCAPTCHA, or an unsolvable challenge if CHALLENGE. */
222
+ testingChallenge?: string;
223
+ /** All assessments for this Key will return this score. Must be between 0 (likely not legitimate) and 1 (likely legitimate) inclusive. */
224
+ testingScore?: number;
225
+ }
226
+ interface GoogleCloudRecaptchaenterpriseV1TokenProperties {
227
+ /** Action name provided at token generation. */
228
+ action?: string;
229
+ /** The timestamp corresponding to the generation of the token. */
230
+ createTime?: string;
231
+ /** The hostname of the page on which the token was generated. */
232
+ hostname?: string;
233
+ /** Reason associated with the response when valid = false. */
234
+ invalidReason?: string;
235
+ /**
236
+ * Whether the provided user response token is valid. When valid = false, the reason could be specified in invalid_reason or it could also be due to a user failing to solve a challenge
237
+ * or a sitekey mismatch (i.e the sitekey used to generate the token was different than the one specified in the assessment).
238
+ */
239
+ valid?: boolean;
240
+ }
241
+ interface GoogleCloudRecaptchaenterpriseV1WafSettings {
242
+ /** Required. The WAF feature for which this key is enabled. */
243
+ wafFeature?: string;
244
+ /** Required. The WAF service that uses this key. */
245
+ wafService?: string;
246
+ }
247
+ interface GoogleCloudRecaptchaenterpriseV1WebKeySettings {
248
+ /** If set to true, it means allowed_domains will not be enforced. */
249
+ allowAllDomains?: boolean;
250
+ /** If set to true, the key can be used on AMP (Accelerated Mobile Pages) websites. This is supported only for the SCORE integration type. */
251
+ allowAmpTraffic?: boolean;
252
+ /**
253
+ * Domains or subdomains of websites allowed to use the key. All subdomains of an allowed domain are automatically allowed. A valid domain requires a host and must not include any
254
+ * path, port, query or fragment. Examples: 'example.com' or 'subdomain.example.com'
255
+ */
256
+ allowedDomains?: string[];
257
+ /** Settings for the frequency and difficulty at which this key triggers captcha challenges. This should only be specified for IntegrationTypes CHECKBOX and INVISIBLE. */
258
+ challengeSecurityPreference?: string;
259
+ /** Required. Describes how this key is integrated with the website. */
260
+ integrationType?: string;
261
+ }
262
+ // tslint:disable-next-line:no-empty-interface
263
+ interface GoogleProtobufEmpty {
264
+ }
265
+ interface AssessmentsResource {
266
+ /** Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent. */
267
+ annotate(request: {
268
+ /** V1 error format. */
269
+ "$.xgafv"?: string;
270
+ /** OAuth access token. */
271
+ access_token?: string;
272
+ /** Data format for response. */
273
+ alt?: string;
274
+ /** JSONP */
275
+ callback?: string;
276
+ /** Selector specifying which fields to include in a partial response. */
277
+ fields?: string;
278
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
279
+ key?: string;
280
+ /** Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}". */
281
+ name: string;
282
+ /** OAuth 2.0 token for the current user. */
283
+ oauth_token?: string;
284
+ /** Returns response with indentations and line breaks. */
285
+ prettyPrint?: boolean;
286
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
287
+ quotaUser?: string;
288
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
289
+ upload_protocol?: string;
290
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
291
+ uploadType?: string;
292
+ /** Request body */
293
+ resource: GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest;
294
+ }): Request<{}>;
295
+ annotate(request: {
296
+ /** V1 error format. */
297
+ "$.xgafv"?: string;
298
+ /** OAuth access token. */
299
+ access_token?: string;
300
+ /** Data format for response. */
301
+ alt?: string;
302
+ /** JSONP */
303
+ callback?: string;
304
+ /** Selector specifying which fields to include in a partial response. */
305
+ fields?: string;
306
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
307
+ key?: string;
308
+ /** Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}". */
309
+ name: string;
310
+ /** OAuth 2.0 token for the current user. */
311
+ oauth_token?: string;
312
+ /** Returns response with indentations and line breaks. */
313
+ prettyPrint?: boolean;
314
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
315
+ quotaUser?: string;
316
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
317
+ upload_protocol?: string;
318
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
319
+ uploadType?: string;
320
+ },
321
+ body: GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest): Request<{}>;
322
+ /** Creates an Assessment of the likelihood an event is legitimate. */
323
+ create(request: {
324
+ /** V1 error format. */
325
+ "$.xgafv"?: string;
326
+ /** OAuth access token. */
327
+ access_token?: string;
328
+ /** Data format for response. */
329
+ alt?: string;
330
+ /** JSONP */
331
+ callback?: string;
332
+ /** Selector specifying which fields to include in a partial response. */
333
+ fields?: string;
334
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
335
+ key?: string;
336
+ /** OAuth 2.0 token for the current user. */
337
+ oauth_token?: string;
338
+ /** Required. The name of the project in which the assessment will be created, in the format "projects/{project}". */
339
+ parent: string;
340
+ /** Returns response with indentations and line breaks. */
341
+ prettyPrint?: boolean;
342
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
343
+ quotaUser?: string;
344
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
345
+ upload_protocol?: string;
346
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
347
+ uploadType?: string;
348
+ /** Request body */
349
+ resource: GoogleCloudRecaptchaenterpriseV1Assessment;
350
+ }): Request<GoogleCloudRecaptchaenterpriseV1Assessment>;
351
+ create(request: {
352
+ /** V1 error format. */
353
+ "$.xgafv"?: string;
354
+ /** OAuth access token. */
355
+ access_token?: string;
356
+ /** Data format for response. */
357
+ alt?: string;
358
+ /** JSONP */
359
+ callback?: string;
360
+ /** Selector specifying which fields to include in a partial response. */
361
+ fields?: string;
362
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
363
+ key?: string;
364
+ /** OAuth 2.0 token for the current user. */
365
+ oauth_token?: string;
366
+ /** Required. The name of the project in which the assessment will be created, in the format "projects/{project}". */
367
+ parent: string;
368
+ /** Returns response with indentations and line breaks. */
369
+ prettyPrint?: boolean;
370
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
371
+ quotaUser?: string;
372
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
373
+ upload_protocol?: string;
374
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
375
+ uploadType?: string;
376
+ },
377
+ body: GoogleCloudRecaptchaenterpriseV1Assessment): Request<GoogleCloudRecaptchaenterpriseV1Assessment>;
378
+ }
379
+ interface KeysResource {
380
+ /** Creates a new reCAPTCHA Enterprise key. */
381
+ create(request: {
382
+ /** V1 error format. */
383
+ "$.xgafv"?: string;
384
+ /** OAuth access token. */
385
+ access_token?: string;
386
+ /** Data format for response. */
387
+ alt?: string;
388
+ /** JSONP */
389
+ callback?: string;
390
+ /** Selector specifying which fields to include in a partial response. */
391
+ fields?: string;
392
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
393
+ key?: string;
394
+ /** OAuth 2.0 token for the current user. */
395
+ oauth_token?: string;
396
+ /** Required. The name of the project in which the key will be created, in the format "projects/{project}". */
397
+ parent: string;
398
+ /** Returns response with indentations and line breaks. */
399
+ prettyPrint?: boolean;
400
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
401
+ quotaUser?: string;
402
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
403
+ upload_protocol?: string;
404
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
405
+ uploadType?: string;
406
+ /** Request body */
407
+ resource: GoogleCloudRecaptchaenterpriseV1Key;
408
+ }): Request<GoogleCloudRecaptchaenterpriseV1Key>;
409
+ create(request: {
410
+ /** V1 error format. */
411
+ "$.xgafv"?: string;
412
+ /** OAuth access token. */
413
+ access_token?: string;
414
+ /** Data format for response. */
415
+ alt?: string;
416
+ /** JSONP */
417
+ callback?: string;
418
+ /** Selector specifying which fields to include in a partial response. */
419
+ fields?: string;
420
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
421
+ key?: string;
422
+ /** OAuth 2.0 token for the current user. */
423
+ oauth_token?: string;
424
+ /** Required. The name of the project in which the key will be created, in the format "projects/{project}". */
425
+ parent: string;
426
+ /** Returns response with indentations and line breaks. */
427
+ prettyPrint?: boolean;
428
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
429
+ quotaUser?: string;
430
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
431
+ upload_protocol?: string;
432
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
433
+ uploadType?: string;
434
+ },
435
+ body: GoogleCloudRecaptchaenterpriseV1Key): Request<GoogleCloudRecaptchaenterpriseV1Key>;
436
+ /** Deletes the specified key. */
437
+ delete(request?: {
438
+ /** V1 error format. */
439
+ "$.xgafv"?: string;
440
+ /** OAuth access token. */
441
+ access_token?: string;
442
+ /** Data format for response. */
443
+ alt?: string;
444
+ /** JSONP */
445
+ callback?: string;
446
+ /** Selector specifying which fields to include in a partial response. */
447
+ fields?: string;
448
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
449
+ key?: string;
450
+ /** Required. The name of the key to be deleted, in the format "projects/{project}/keys/{key}". */
451
+ name: string;
452
+ /** OAuth 2.0 token for the current user. */
453
+ oauth_token?: string;
454
+ /** Returns response with indentations and line breaks. */
455
+ prettyPrint?: boolean;
456
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
457
+ quotaUser?: string;
458
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
459
+ upload_protocol?: string;
460
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
461
+ uploadType?: string;
462
+ }): Request<{}>;
463
+ /** Returns the specified key. */
464
+ get(request?: {
465
+ /** V1 error format. */
466
+ "$.xgafv"?: string;
467
+ /** OAuth access token. */
468
+ access_token?: string;
469
+ /** Data format for response. */
470
+ alt?: string;
471
+ /** JSONP */
472
+ callback?: string;
473
+ /** Selector specifying which fields to include in a partial response. */
474
+ fields?: string;
475
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
476
+ key?: string;
477
+ /** Required. The name of the requested key, in the format "projects/{project}/keys/{key}". */
478
+ name: string;
479
+ /** OAuth 2.0 token for the current user. */
480
+ oauth_token?: string;
481
+ /** Returns response with indentations and line breaks. */
482
+ prettyPrint?: boolean;
483
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
484
+ quotaUser?: string;
485
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
486
+ upload_protocol?: string;
487
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
488
+ uploadType?: string;
489
+ }): Request<GoogleCloudRecaptchaenterpriseV1Key>;
490
+ /** Get some aggregated metrics for a Key. This data can be used to build dashboards. */
491
+ getMetrics(request?: {
492
+ /** V1 error format. */
493
+ "$.xgafv"?: string;
494
+ /** OAuth access token. */
495
+ access_token?: string;
496
+ /** Data format for response. */
497
+ alt?: string;
498
+ /** JSONP */
499
+ callback?: string;
500
+ /** Selector specifying which fields to include in a partial response. */
501
+ fields?: string;
502
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
503
+ key?: string;
504
+ /** Required. The name of the requested metrics, in the format "projects/{project}/keys/{key}/metrics". */
505
+ name: string;
506
+ /** OAuth 2.0 token for the current user. */
507
+ oauth_token?: string;
508
+ /** Returns response with indentations and line breaks. */
509
+ prettyPrint?: boolean;
510
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
511
+ quotaUser?: string;
512
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
513
+ upload_protocol?: string;
514
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
515
+ uploadType?: string;
516
+ }): Request<GoogleCloudRecaptchaenterpriseV1Metrics>;
517
+ /** Returns the list of all keys that belong to a project. */
518
+ list(request?: {
519
+ /** V1 error format. */
520
+ "$.xgafv"?: string;
521
+ /** OAuth access token. */
522
+ access_token?: string;
523
+ /** Data format for response. */
524
+ alt?: string;
525
+ /** JSONP */
526
+ callback?: string;
527
+ /** Selector specifying which fields to include in a partial response. */
528
+ fields?: string;
529
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
530
+ key?: string;
531
+ /** OAuth 2.0 token for the current user. */
532
+ oauth_token?: string;
533
+ /** Optional. The maximum number of keys to return. Default is 10. Max limit is 1000. */
534
+ pageSize?: number;
535
+ /** Optional. The next_page_token value returned from a previous. ListKeysRequest, if any. */
536
+ pageToken?: string;
537
+ /** Required. The name of the project that contains the keys that will be listed, in the format "projects/{project}". */
538
+ parent: string;
539
+ /** Returns response with indentations and line breaks. */
540
+ prettyPrint?: boolean;
541
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
542
+ quotaUser?: string;
543
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
544
+ upload_protocol?: string;
545
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
546
+ uploadType?: string;
547
+ }): Request<GoogleCloudRecaptchaenterpriseV1ListKeysResponse>;
548
+ /**
549
+ * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment
550
+ * calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.
551
+ */
552
+ migrate(request: {
553
+ /** V1 error format. */
554
+ "$.xgafv"?: string;
555
+ /** OAuth access token. */
556
+ access_token?: string;
557
+ /** Data format for response. */
558
+ alt?: string;
559
+ /** JSONP */
560
+ callback?: string;
561
+ /** Selector specifying which fields to include in a partial response. */
562
+ fields?: string;
563
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
564
+ key?: string;
565
+ /** Required. The name of the key to be migrated, in the format "projects/{project}/keys/{key}". */
566
+ name: string;
567
+ /** OAuth 2.0 token for the current user. */
568
+ oauth_token?: string;
569
+ /** Returns response with indentations and line breaks. */
570
+ prettyPrint?: boolean;
571
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
572
+ quotaUser?: string;
573
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
574
+ upload_protocol?: string;
575
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
576
+ uploadType?: string;
577
+ /** Request body */
578
+ resource: GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest;
579
+ }): Request<GoogleCloudRecaptchaenterpriseV1Key>;
580
+ migrate(request: {
581
+ /** V1 error format. */
582
+ "$.xgafv"?: string;
583
+ /** OAuth access token. */
584
+ access_token?: string;
585
+ /** Data format for response. */
586
+ alt?: string;
587
+ /** JSONP */
588
+ callback?: string;
589
+ /** Selector specifying which fields to include in a partial response. */
590
+ fields?: string;
591
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
592
+ key?: string;
593
+ /** Required. The name of the key to be migrated, in the format "projects/{project}/keys/{key}". */
594
+ name: string;
595
+ /** OAuth 2.0 token for the current user. */
596
+ oauth_token?: string;
597
+ /** Returns response with indentations and line breaks. */
598
+ prettyPrint?: boolean;
599
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
600
+ quotaUser?: string;
601
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
602
+ upload_protocol?: string;
603
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
604
+ uploadType?: string;
605
+ },
606
+ body: GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest): Request<GoogleCloudRecaptchaenterpriseV1Key>;
607
+ /** Updates the specified key. */
608
+ patch(request: {
609
+ /** V1 error format. */
610
+ "$.xgafv"?: string;
611
+ /** OAuth access token. */
612
+ access_token?: string;
613
+ /** Data format for response. */
614
+ alt?: string;
615
+ /** JSONP */
616
+ callback?: string;
617
+ /** Selector specifying which fields to include in a partial response. */
618
+ fields?: string;
619
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
620
+ key?: string;
621
+ /** The resource name for the Key in the format "projects/{project}/keys/{key}". */
622
+ name: string;
623
+ /** OAuth 2.0 token for the current user. */
624
+ oauth_token?: string;
625
+ /** Returns response with indentations and line breaks. */
626
+ prettyPrint?: boolean;
627
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
628
+ quotaUser?: string;
629
+ /** Optional. The mask to control which fields of the key get updated. If the mask is not present, all fields will be updated. */
630
+ updateMask?: string;
631
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
632
+ upload_protocol?: string;
633
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
634
+ uploadType?: string;
635
+ /** Request body */
636
+ resource: GoogleCloudRecaptchaenterpriseV1Key;
637
+ }): Request<GoogleCloudRecaptchaenterpriseV1Key>;
638
+ patch(request: {
639
+ /** V1 error format. */
640
+ "$.xgafv"?: string;
641
+ /** OAuth access token. */
642
+ access_token?: string;
643
+ /** Data format for response. */
644
+ alt?: string;
645
+ /** JSONP */
646
+ callback?: string;
647
+ /** Selector specifying which fields to include in a partial response. */
648
+ fields?: string;
649
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
650
+ key?: string;
651
+ /** The resource name for the Key in the format "projects/{project}/keys/{key}". */
652
+ name: string;
653
+ /** OAuth 2.0 token for the current user. */
654
+ oauth_token?: string;
655
+ /** Returns response with indentations and line breaks. */
656
+ prettyPrint?: boolean;
657
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
658
+ quotaUser?: string;
659
+ /** Optional. The mask to control which fields of the key get updated. If the mask is not present, all fields will be updated. */
660
+ updateMask?: string;
661
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
662
+ upload_protocol?: string;
663
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
664
+ uploadType?: string;
665
+ },
666
+ body: GoogleCloudRecaptchaenterpriseV1Key): Request<GoogleCloudRecaptchaenterpriseV1Key>;
667
+ /** Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA. */
668
+ retrieveLegacySecretKey(request?: {
669
+ /** V1 error format. */
670
+ "$.xgafv"?: string;
671
+ /** OAuth access token. */
672
+ access_token?: string;
673
+ /** Data format for response. */
674
+ alt?: string;
675
+ /** JSONP */
676
+ callback?: string;
677
+ /** Selector specifying which fields to include in a partial response. */
678
+ fields?: string;
679
+ /** Required. The public key name linked to the requested secret key in the format "projects/{project}/keys/{key}". */
680
+ key: string;
681
+ /** OAuth 2.0 token for the current user. */
682
+ oauth_token?: string;
683
+ /** Returns response with indentations and line breaks. */
684
+ prettyPrint?: boolean;
685
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
686
+ quotaUser?: string;
687
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
688
+ upload_protocol?: string;
689
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
690
+ uploadType?: string;
691
+ }): Request<GoogleCloudRecaptchaenterpriseV1RetrieveLegacySecretKeyResponse>;
692
+ }
693
+ interface RelatedaccountgroupmembershipsResource {
694
+ /** Search group memberships related to a given account. */
695
+ search(request: {
696
+ /** V1 error format. */
697
+ "$.xgafv"?: string;
698
+ /** OAuth access token. */
699
+ access_token?: string;
700
+ /** Data format for response. */
701
+ alt?: string;
702
+ /** JSONP */
703
+ callback?: string;
704
+ /** Selector specifying which fields to include in a partial response. */
705
+ fields?: string;
706
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
707
+ key?: string;
708
+ /** OAuth 2.0 token for the current user. */
709
+ oauth_token?: string;
710
+ /** Returns response with indentations and line breaks. */
711
+ prettyPrint?: boolean;
712
+ /** Required. The name of the project to search related account group memberships from. Specify the project name in the following format: "projects/{project}". */
713
+ project: string;
714
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
715
+ quotaUser?: string;
716
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
717
+ upload_protocol?: string;
718
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
719
+ uploadType?: string;
720
+ /** Request body */
721
+ resource: GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsRequest;
722
+ }): Request<GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsResponse>;
723
+ search(request: {
724
+ /** V1 error format. */
725
+ "$.xgafv"?: string;
726
+ /** OAuth access token. */
727
+ access_token?: string;
728
+ /** Data format for response. */
729
+ alt?: string;
730
+ /** JSONP */
731
+ callback?: string;
732
+ /** Selector specifying which fields to include in a partial response. */
733
+ fields?: string;
734
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
735
+ key?: string;
736
+ /** OAuth 2.0 token for the current user. */
737
+ oauth_token?: string;
738
+ /** Returns response with indentations and line breaks. */
739
+ prettyPrint?: boolean;
740
+ /** Required. The name of the project to search related account group memberships from. Specify the project name in the following format: "projects/{project}". */
741
+ project: string;
742
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
743
+ quotaUser?: string;
744
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
745
+ upload_protocol?: string;
746
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
747
+ uploadType?: string;
748
+ },
749
+ body: GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsRequest): Request<GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsResponse>;
750
+ }
751
+ interface MembershipsResource {
752
+ /** Get memberships in a group of related accounts. */
753
+ list(request?: {
754
+ /** V1 error format. */
755
+ "$.xgafv"?: string;
756
+ /** OAuth access token. */
757
+ access_token?: string;
758
+ /** Data format for response. */
759
+ alt?: string;
760
+ /** JSONP */
761
+ callback?: string;
762
+ /** Selector specifying which fields to include in a partial response. */
763
+ fields?: string;
764
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
765
+ key?: string;
766
+ /** OAuth 2.0 token for the current user. */
767
+ oauth_token?: string;
768
+ /**
769
+ * Optional. The maximum number of accounts to return. The service might return fewer than this value. If unspecified, at most 50 accounts are returned. The maximum value is 1000;
770
+ * values above 1000 are coerced to 1000.
771
+ */
772
+ pageSize?: number;
773
+ /**
774
+ * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` call. When paginating, all other parameters provided to
775
+ * `ListRelatedAccountGroupMemberships` must match the call that provided the page token.
776
+ */
777
+ pageToken?: string;
778
+ /** Required. The resource name for the related account group in the format `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. */
779
+ parent: string;
780
+ /** Returns response with indentations and line breaks. */
781
+ prettyPrint?: boolean;
782
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
783
+ quotaUser?: string;
784
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
785
+ upload_protocol?: string;
786
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
787
+ uploadType?: string;
788
+ }): Request<GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupMembershipsResponse>;
789
+ }
790
+ interface RelatedaccountgroupsResource {
791
+ /** List groups of related accounts. */
792
+ list(request?: {
793
+ /** V1 error format. */
794
+ "$.xgafv"?: string;
795
+ /** OAuth access token. */
796
+ access_token?: string;
797
+ /** Data format for response. */
798
+ alt?: string;
799
+ /** JSONP */
800
+ callback?: string;
801
+ /** Selector specifying which fields to include in a partial response. */
802
+ fields?: string;
803
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
804
+ key?: string;
805
+ /** OAuth 2.0 token for the current user. */
806
+ oauth_token?: string;
807
+ /**
808
+ * Optional. The maximum number of groups to return. The service might return fewer than this value. If unspecified, at most 50 groups are returned. The maximum value is 1000;
809
+ * values above 1000 are coerced to 1000.
810
+ */
811
+ pageSize?: number;
812
+ /**
813
+ * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to
814
+ * `ListRelatedAccountGroups` must match the call that provided the page token.
815
+ */
816
+ pageToken?: string;
817
+ /** Required. The name of the project to list related account groups from, in the format "projects/{project}". */
818
+ parent: string;
819
+ /** Returns response with indentations and line breaks. */
820
+ prettyPrint?: boolean;
821
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
822
+ quotaUser?: string;
823
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
824
+ upload_protocol?: string;
825
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
826
+ uploadType?: string;
827
+ }): Request<GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupsResponse>;
828
+ memberships: MembershipsResource;
829
+ }
830
+ interface ProjectsResource {
831
+ assessments: AssessmentsResource;
832
+ keys: KeysResource;
833
+ relatedaccountgroupmemberships: RelatedaccountgroupmembershipsResource;
834
+ relatedaccountgroups: RelatedaccountgroupsResource;
835
+ }
836
+
837
+ const projects: ProjectsResource;
838
+ }
839
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.recaptchaenterprise-v1",
3
+ "version": "0.0.20220806",
4
+ "description": "TypeScript typings for reCAPTCHA Enterprise API v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,68 @@
1
+ # TypeScript typings for reCAPTCHA Enterprise API v1
2
+
3
+
4
+ For detailed description please check [documentation](https://cloud.google.com/recaptcha-enterprise/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for reCAPTCHA Enterprise API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.recaptchaenterprise-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://recaptchaenterprise.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.recaptchaenterprise
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('recaptchaenterprise', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.recaptchaenterprise
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
49
+ 'https://www.googleapis.com/auth/cloud-platform',
50
+ ],
51
+ immediate = true;
52
+ // ...
53
+
54
+ gapi.auth.authorize(
55
+ { client_id: client_id, scope: scope, immediate: immediate },
56
+ authResult => {
57
+ if (authResult && !authResult.error) {
58
+ /* handle successful authorization */
59
+ } else {
60
+ /* handle authorization error */
61
+ }
62
+ });
63
+ ```
64
+
65
+ After that you can use reCAPTCHA Enterprise API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+ ```
package/tests.ts ADDED
@@ -0,0 +1,214 @@
1
+ /* This is stub file for gapi.client.recaptchaenterprise-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: 20220806
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://recaptchaenterprise.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.recaptchaenterprise */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
19
+ 'https://www.googleapis.com/auth/cloud-platform',
20
+ ];
21
+ const immediate = false;
22
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
23
+ if (authResult && !authResult.error) {
24
+ /** handle successful authorization */
25
+ run();
26
+ } else {
27
+ /** handle authorization error */
28
+ }
29
+ });
30
+
31
+ async function run() {
32
+ /** Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent. */
33
+ await gapi.client.recaptchaenterprise.projects.assessments.annotate({
34
+ name: "Test string",
35
+ }, {
36
+ annotation: "Test string",
37
+ hashedAccountId: "Test string",
38
+ reasons: [
39
+ "Test string"
40
+ ],
41
+ });
42
+ /** Creates an Assessment of the likelihood an event is legitimate. */
43
+ await gapi.client.recaptchaenterprise.projects.assessments.create({
44
+ parent: "Test string",
45
+ }, {
46
+ accountDefenderAssessment: {
47
+ labels: [
48
+ "Test string"
49
+ ],
50
+ },
51
+ event: {
52
+ expectedAction: "Test string",
53
+ hashedAccountId: "Test string",
54
+ siteKey: "Test string",
55
+ token: "Test string",
56
+ userAgent: "Test string",
57
+ userIpAddress: "Test string",
58
+ },
59
+ name: "Test string",
60
+ privatePasswordLeakVerification: {
61
+ encryptedLeakMatchPrefixes: [
62
+ "Test string"
63
+ ],
64
+ encryptedUserCredentialsHash: "Test string",
65
+ lookupHashPrefix: "Test string",
66
+ reencryptedUserCredentialsHash: "Test string",
67
+ },
68
+ riskAnalysis: {
69
+ reasons: [
70
+ "Test string"
71
+ ],
72
+ score: 42,
73
+ },
74
+ tokenProperties: {
75
+ action: "Test string",
76
+ createTime: "Test string",
77
+ hostname: "Test string",
78
+ invalidReason: "Test string",
79
+ valid: true,
80
+ },
81
+ });
82
+ /** Creates a new reCAPTCHA Enterprise key. */
83
+ await gapi.client.recaptchaenterprise.projects.keys.create({
84
+ parent: "Test string",
85
+ }, {
86
+ androidSettings: {
87
+ allowAllPackageNames: true,
88
+ allowedPackageNames: [
89
+ "Test string"
90
+ ],
91
+ },
92
+ createTime: "Test string",
93
+ displayName: "Test string",
94
+ iosSettings: {
95
+ allowAllBundleIds: true,
96
+ allowedBundleIds: [
97
+ "Test string"
98
+ ],
99
+ },
100
+ labels: {
101
+ A: "Test string"
102
+ },
103
+ name: "Test string",
104
+ testingOptions: {
105
+ testingChallenge: "Test string",
106
+ testingScore: 42,
107
+ },
108
+ wafSettings: {
109
+ wafFeature: "Test string",
110
+ wafService: "Test string",
111
+ },
112
+ webSettings: {
113
+ allowAllDomains: true,
114
+ allowAmpTraffic: true,
115
+ allowedDomains: [
116
+ "Test string"
117
+ ],
118
+ challengeSecurityPreference: "Test string",
119
+ integrationType: "Test string",
120
+ },
121
+ });
122
+ /** Deletes the specified key. */
123
+ await gapi.client.recaptchaenterprise.projects.keys.delete({
124
+ name: "Test string",
125
+ });
126
+ /** Returns the specified key. */
127
+ await gapi.client.recaptchaenterprise.projects.keys.get({
128
+ name: "Test string",
129
+ });
130
+ /** Get some aggregated metrics for a Key. This data can be used to build dashboards. */
131
+ await gapi.client.recaptchaenterprise.projects.keys.getMetrics({
132
+ name: "Test string",
133
+ });
134
+ /** Returns the list of all keys that belong to a project. */
135
+ await gapi.client.recaptchaenterprise.projects.keys.list({
136
+ pageSize: 42,
137
+ pageToken: "Test string",
138
+ parent: "Test string",
139
+ });
140
+ /**
141
+ * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls.
142
+ * You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.
143
+ */
144
+ await gapi.client.recaptchaenterprise.projects.keys.migrate({
145
+ name: "Test string",
146
+ }, {
147
+ });
148
+ /** Updates the specified key. */
149
+ await gapi.client.recaptchaenterprise.projects.keys.patch({
150
+ name: "Test string",
151
+ updateMask: "Test string",
152
+ }, {
153
+ androidSettings: {
154
+ allowAllPackageNames: true,
155
+ allowedPackageNames: [
156
+ "Test string"
157
+ ],
158
+ },
159
+ createTime: "Test string",
160
+ displayName: "Test string",
161
+ iosSettings: {
162
+ allowAllBundleIds: true,
163
+ allowedBundleIds: [
164
+ "Test string"
165
+ ],
166
+ },
167
+ labels: {
168
+ A: "Test string"
169
+ },
170
+ name: "Test string",
171
+ testingOptions: {
172
+ testingChallenge: "Test string",
173
+ testingScore: 42,
174
+ },
175
+ wafSettings: {
176
+ wafFeature: "Test string",
177
+ wafService: "Test string",
178
+ },
179
+ webSettings: {
180
+ allowAllDomains: true,
181
+ allowAmpTraffic: true,
182
+ allowedDomains: [
183
+ "Test string"
184
+ ],
185
+ challengeSecurityPreference: "Test string",
186
+ integrationType: "Test string",
187
+ },
188
+ });
189
+ /** Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA. */
190
+ await gapi.client.recaptchaenterprise.projects.keys.retrieveLegacySecretKey({
191
+ key: "Test string",
192
+ });
193
+ /** Search group memberships related to a given account. */
194
+ await gapi.client.recaptchaenterprise.projects.relatedaccountgroupmemberships.search({
195
+ project: "Test string",
196
+ }, {
197
+ hashedAccountId: "Test string",
198
+ pageSize: 42,
199
+ pageToken: "Test string",
200
+ });
201
+ /** List groups of related accounts. */
202
+ await gapi.client.recaptchaenterprise.projects.relatedaccountgroups.list({
203
+ pageSize: 42,
204
+ pageToken: "Test string",
205
+ parent: "Test string",
206
+ });
207
+ /** Get memberships in a group of related accounts. */
208
+ await gapi.client.recaptchaenterprise.projects.relatedaccountgroups.memberships.list({
209
+ pageSize: 42,
210
+ pageToken: "Test string",
211
+ parent: "Test string",
212
+ });
213
+ }
214
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
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
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }