Skip to content

Commit 82a20f8

Browse files
authored
ci(recaptcha): migrate CI (#4008)
1 parent 4353569 commit 82a20f8

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/config/nodejs-dev.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
"mediatranslation",
192192
"monitoring/prometheus",
193193
"monitoring/snippets",
194+
"recaptcha_enterprise/snippets",
194195
"retail",
195196
"routeoptimization/snippets",
196197
"run/hello-broken",

.github/config/nodejs-prod.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"functions/v2/imagemagick", // (untested) Error: A bucket name is needed to use Cloud Storage.
9696
"healthcare/fhir", // Error: Cannot find module 'whatwg-url'
9797
"iam/deny", // PERMISSION_DENIED: Permission iam.googleapis.com/denypolicies.create denied on resource cloudresourcemanager.googleapis.com/projects/long-door-651
98-
"recaptcha_enterprise/snippets", // Cannot use import statement outside a module
9998
"run/idp-sql", // (untested) Error: Invalid contents in the credentials file
10099
"storagetransfer", // CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
101100
"video-intelligence", // PERMISSION_DENIED: The caller does not have permission

recaptcha_enterprise/snippets/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"main": "quickstart.js",
55
"license": "Apache-2.0",
66
"author": "Google LLC",
7+
"type": "module",
78
"engines": {
89
"node": ">=16.0.0"
910
},

recaptcha_enterprise/snippets/passwordLeakAssessment.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ const [projectId, username, password] = args;
2929

3030
// [START recaptcha_enterprise_password_leak_verification]
3131

32-
const {
33-
RecaptchaEnterpriseServiceClient,
34-
} = require('@google-cloud/recaptcha-enterprise');
35-
const {PasswordCheckVerification} = require('recaptcha-password-check-helpers');
32+
import {RecaptchaEnterpriseServiceClient} from '@google-cloud/recaptcha-enterprise';
33+
import {PasswordCheckVerification} from 'recaptcha-password-check-helpers';
3634

3735
// TODO(developer): Uncomment and set the following variables
3836
// Google Cloud Project ID.
@@ -168,3 +166,4 @@ checkPasswordLeak(projectId, username, password).catch(err => {
168166
process.exitCode = 1;
169167
});
170168
// [END recaptcha_enterprise_password_leak_verification]
169+
module.exports = checkPasswordLeak

recaptcha_enterprise/snippets/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"strict": true,
55
"noImplicitAny": false,
66
"esModuleInterop": true,
7-
"moduleResolution": "node"
7+
"moduleResolution": "node",
8+
"module": "ESNext"
89
}
910
}

0 commit comments

Comments
 (0)