Skip to content

Commit 6d9bcc4

Browse files
sararobcopybara-github
authored andcommitted
chore: Add initial system tests for JS AE module and update lint checks
PiperOrigin-RevId: 895312578
1 parent 9df74eb commit 6d9bcc4

24 files changed

Lines changed: 172 additions & 91 deletions

.eslintignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
**/node_modules
22
build/
33
docs/
4-
test/spec/
54
src/genai/
6-
test/genai/
5+
test/
6+
system_test/
7+
sdk_schema_test/
8+
src/**/test/

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
**/node_modules
22
build/
33
docs/
4-
src/genai/
5-
test/genai/
4+
test/
5+
system_test/
6+
sdk_schema_test/
7+
src/**/test/

package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"test:test": "jasmine build/test/*.js --reporter=test/spec/reporter.js",
2424
"test:src": "jasmine build/src/functions/test/*.js build/src/models/test/*.js --reporter=test/spec/reporter.js",
2525
"test:system": "jasmine build/system_test/*.js --reporter=test/spec/reporter.js",
26-
"lint": "gts lint",
26+
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint src/genai --no-ignore --config src/genai/eslint.config.mjs",
27+
"format": "prettier 'src/genai/**/*.ts' 'src/genai/**/*.mjs' --write",
2728
"clean-js-files": "find . -type f -name \"*.js\" -exec rm -f {} +",
2829
"clean-js-map-files": "find . -type f -name \"*.js.map\" -exec rm -f {} +",
2930
"postpack": "if [ \"${CLEAN}\" ]; then npm run clean-after-pack; fi",
@@ -36,21 +37,26 @@
3637
"posttest": "npm run lint"
3738
},
3839
"dependencies": {
39-
"google-auth-library": "^9.1.0",
40-
"@google/genai": "^1.45.0"
40+
"@google/genai": "^1.45.0",
41+
"google-auth-library": "^9.1.0"
4142
},
4243
"devDependencies": {
44+
"@eslint/js": "9.20.0",
4345
"@types/jasmine": "^5.1.2",
4446
"@types/node": "^20.9.0",
47+
"eslint": "8.57.0",
4548
"gts": "^5.2.0",
4649
"jasmine": "^5.1.0",
4750
"jasmine-reporters": "^2.4.0",
4851
"jsdoc": "^4.0.0",
4952
"jsdoc-fresh": "^3.0.0",
5053
"jsdoc-region-tag": "^3.0.0",
5154
"linkinator": "^4.0.0",
52-
"typescript": "~5.2.0",
53-
"nyc": "^15.1.0"
55+
"nyc": "^15.1.0",
56+
"prettier": "3.3.3",
57+
"prettier-plugin-organize-imports": "^4.1.0",
58+
"typescript": "~5.4.0",
59+
"typescript-eslint": "8.24.1"
5460
},
5561
"files": [
5662
"build/src",

src/genai/.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Ignore autogenerated files:
2+
agentengines.ts
3+
_internal_types.ts
4+
sessionevents.ts
5+
sessions.ts
6+
types/**
7+
types.ts
8+
converters/**
9+
# Ignore built files:
10+
dist/**

src/genai/.prettierrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth" : 80,
3+
"tabWidth" : 2,
4+
"useTabs" : false,
5+
"semi" : true,
6+
"singleQuote" : true,
7+
"quoteProps" : "preserve",
8+
"bracketSpacing" : false,
9+
"trailingComma" : "all",
10+
"arrowParens" : "always",
11+
"embeddedLanguageFormatting" : "off",
12+
"bracketSameLine" : true,
13+
"singleAttributePerLine" : false,
14+
"htmlWhitespaceSensitivity" : "strict",
15+
"plugins": ["prettier-plugin-organize-imports"],
16+
}

src/genai/_internal_types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@
55
*/
66

77
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
8-
9-
import * as types from './types.js';

src/genai/agentengines.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@
66

77
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
88

9-
import * as genaiTypes from '@google/genai';
10-
import {PagedItem, Pager} from '@google/genai';
119
import * as common from '@google/genai/vertex_internal';
12-
import {
13-
ApiClient,
14-
BaseModule,
15-
NodeAuth,
16-
NodeDownloader,
17-
NodeUploader,
18-
} from '@google/genai/vertex_internal';
10+
import {ApiClient, BaseModule} from '@google/genai/vertex_internal';
1911
import * as converters from './converters/_agentengines_converters.js';
2012
import {Memories} from './memories.js';
2113
import {Sandboxes} from './sandboxes.js';

src/genai/client.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
21
/**
32
* @license
43
* Copyright 2026 Google LLC
54
* SPDX-License-Identifier: Apache-2.0
65
*/
7-
import {ApiClient, NodeAuth, NodeDownloader, NodeUploader} from '@google/genai/vertex_internal';
6+
import {ApiClient, NodeAuth, NodeDownloader, NodeUploader,} from '@google/genai/vertex_internal';
87

98
import {AgentEngines} from './agentengines';
10-
import {Sessions} from './sessions';
119

1210
export const SDK_VERSION = '1.10.4'; // x-release-please-version
1311

@@ -20,8 +18,9 @@ export class Client {
2018
constructor(
2119
options: {project?: string; location?: string; apiEndpoint?: string;}) {
2220
const auth = new NodeAuth({
23-
googleAuthOptions:
24-
{scopes: ['https://www.googleapis.com/auth/cloud-platform']}
21+
googleAuthOptions: {
22+
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
23+
},
2524
});
2625

2726
const uploader = new NodeUploader();
@@ -36,10 +35,9 @@ export class Client {
3635
vertexai: true,
3736
httpOptions: options.apiEndpoint ? {baseUrl: options.apiEndpoint} :
3837
undefined,
39-
userAgentExtra: `vertex-genai-modules/${SDK_VERSION}`
38+
userAgentExtra: `vertex-genai-modules/${SDK_VERSION}`,
4039
});
4140

42-
4341
this._agentEnginesInternal = new AgentEngines(this.apiClient);
4442
}
4543

@@ -49,7 +47,8 @@ export class Client {
4947
public get agentEnginesInternal(): AgentEngines {
5048
if (!agentEnginesInternalWarned) {
5149
console.warn(
52-
'The agentEnginesInternal implementation is experimental, and may change in future versions.');
50+
'The agentEnginesInternal implementation is experimental, and may change in future versions.',
51+
);
5352
agentEnginesInternalWarned = true;
5453
}
5554
return this._agentEnginesInternal;

src/genai/converters/_agentengines_converters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
88

9-
import type * as genaiTypes from '@google/genai';
109
import * as common from '@google/genai/vertex_internal';
1110
import * as types from '../types.js';
1211

src/genai/converters/_memories_converters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
88

9-
import type * as genaiTypes from '@google/genai';
109
import * as common from '@google/genai/vertex_internal';
1110
import * as types from '../types.js';
1211

0 commit comments

Comments
 (0)