Skip to content

Commit 61f4f9b

Browse files
wanlin31copybara-github
authored andcommitted
chore: Include the files.ts and pagers.ts explicitly in the bundle build process.
PiperOrigin-RevId: 741247814
1 parent e7fe9ce commit 61f4f9b

File tree

8 files changed

+142
-10
lines changed

8 files changed

+142
-10
lines changed

api-report/genai-node.api.md

+45-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export class Caches extends BaseModule {
5757
delete(params: types.DeleteCachedContentParameters): Promise<types.DeleteCachedContentResponse>;
5858
get(params: types.GetCachedContentParameters): Promise<types.CachedContent>;
5959
// Warning: (ae-forgotten-export) The symbol "types" needs to be exported by the entry point index.d.ts
60-
// Warning: (ae-forgotten-export) The symbol "Pager" needs to be exported by the entry point index.d.ts
6160
list: (params?: types.ListCachedContentsParameters) => Promise<Pager<types.CachedContent>>;
6261
update(params: types.UpdateCachedContentParameters): Promise<types.CachedContent>;
6362
}
@@ -388,6 +387,16 @@ export interface FileData {
388387
mimeType?: string;
389388
}
390389

390+
// @public (undocumented)
391+
export class Files extends BaseModule {
392+
constructor(apiClient: ApiClient);
393+
delete(params: types.DeleteFileParameters): Promise<types.DeleteFileResponse>;
394+
get(params: types.GetFileParameters): Promise<types.File>;
395+
list: (params?: types.ListFilesParameters) => Promise<Pager<types.File>>;
396+
// Warning: (ae-forgotten-export) The symbol "common" needs to be exported by the entry point index.d.ts
397+
upload(params: common.UploadFileParameters): Promise<types.File>;
398+
}
399+
391400
// @public (undocumented)
392401
export enum FileSource {
393402
// (undocumented)
@@ -719,8 +728,6 @@ export class GoogleGenAI {
719728
readonly caches: Caches;
720729
// (undocumented)
721730
readonly chats: Chats;
722-
// Warning: (ae-forgotten-export) The symbol "Files" needs to be exported by the entry point index.d.ts
723-
//
724731
// (undocumented)
725732
readonly files: Files;
726733
// (undocumented)
@@ -1190,6 +1197,41 @@ export enum Outcome {
11901197
OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED"
11911198
}
11921199

1200+
// @public
1201+
export enum PagedItem {
1202+
// (undocumented)
1203+
PAGED_ITEM_BATCH_JOBS = "batchJobs",
1204+
// (undocumented)
1205+
PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
1206+
// (undocumented)
1207+
PAGED_ITEM_FILES = "files",
1208+
// (undocumented)
1209+
PAGED_ITEM_MODELS = "models",
1210+
// (undocumented)
1211+
PAGED_ITEM_TUNING_JOBS = "tuningJobs"
1212+
}
1213+
1214+
// @public
1215+
export class Pager<T> implements AsyncIterable<T> {
1216+
[Symbol.asyncIterator](): AsyncIterator<T>;
1217+
constructor(name: PagedItem, request: (params: PagedItemConfig) => Promise<PagedItemResponse<T>>, response: PagedItemResponse<T>, params: PagedItemConfig);
1218+
getItem(index: number): T;
1219+
hasNextPage(): boolean;
1220+
// (undocumented)
1221+
protected idxInternal: number;
1222+
get name(): PagedItem;
1223+
nextPage(): Promise<T[]>;
1224+
get page(): T[];
1225+
get pageLength(): number;
1226+
get pageSize(): number;
1227+
get params(): PagedItemConfig;
1228+
// Warning: (ae-forgotten-export) The symbol "PagedItemConfig" needs to be exported by the entry point index.d.ts
1229+
// Warning: (ae-forgotten-export) The symbol "PagedItemResponse" needs to be exported by the entry point index.d.ts
1230+
//
1231+
// (undocumented)
1232+
protected requestInternal: (params: PagedItemConfig) => Promise<PagedItemResponse<T>>;
1233+
}
1234+
11931235
// @public
11941236
export interface Part {
11951237
codeExecutionResult?: CodeExecutionResult;

api-report/genai-web.api.md

+45-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export class Caches extends BaseModule {
5757
delete(params: types.DeleteCachedContentParameters): Promise<types.DeleteCachedContentResponse>;
5858
get(params: types.GetCachedContentParameters): Promise<types.CachedContent>;
5959
// Warning: (ae-forgotten-export) The symbol "types" needs to be exported by the entry point index.d.ts
60-
// Warning: (ae-forgotten-export) The symbol "Pager" needs to be exported by the entry point index.d.ts
6160
list: (params?: types.ListCachedContentsParameters) => Promise<Pager<types.CachedContent>>;
6261
update(params: types.UpdateCachedContentParameters): Promise<types.CachedContent>;
6362
}
@@ -388,6 +387,16 @@ export interface FileData {
388387
mimeType?: string;
389388
}
390389

390+
// @public (undocumented)
391+
export class Files extends BaseModule {
392+
constructor(apiClient: ApiClient);
393+
delete(params: types.DeleteFileParameters): Promise<types.DeleteFileResponse>;
394+
get(params: types.GetFileParameters): Promise<types.File>;
395+
list: (params?: types.ListFilesParameters) => Promise<Pager<types.File>>;
396+
// Warning: (ae-forgotten-export) The symbol "common" needs to be exported by the entry point index.d.ts
397+
upload(params: common.UploadFileParameters): Promise<types.File>;
398+
}
399+
391400
// @public (undocumented)
392401
export enum FileSource {
393402
// (undocumented)
@@ -719,8 +728,6 @@ export class GoogleGenAI {
719728
readonly caches: Caches;
720729
// (undocumented)
721730
readonly chats: Chats;
722-
// Warning: (ae-forgotten-export) The symbol "Files" needs to be exported by the entry point index.d.ts
723-
//
724731
// (undocumented)
725732
readonly files: Files;
726733
// (undocumented)
@@ -1190,6 +1197,41 @@ export enum Outcome {
11901197
OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED"
11911198
}
11921199

1200+
// @public
1201+
export enum PagedItem {
1202+
// (undocumented)
1203+
PAGED_ITEM_BATCH_JOBS = "batchJobs",
1204+
// (undocumented)
1205+
PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
1206+
// (undocumented)
1207+
PAGED_ITEM_FILES = "files",
1208+
// (undocumented)
1209+
PAGED_ITEM_MODELS = "models",
1210+
// (undocumented)
1211+
PAGED_ITEM_TUNING_JOBS = "tuningJobs"
1212+
}
1213+
1214+
// @public
1215+
export class Pager<T> implements AsyncIterable<T> {
1216+
[Symbol.asyncIterator](): AsyncIterator<T>;
1217+
constructor(name: PagedItem, request: (params: PagedItemConfig) => Promise<PagedItemResponse<T>>, response: PagedItemResponse<T>, params: PagedItemConfig);
1218+
getItem(index: number): T;
1219+
hasNextPage(): boolean;
1220+
// (undocumented)
1221+
protected idxInternal: number;
1222+
get name(): PagedItem;
1223+
nextPage(): Promise<T[]>;
1224+
get page(): T[];
1225+
get pageLength(): number;
1226+
get pageSize(): number;
1227+
get params(): PagedItemConfig;
1228+
// Warning: (ae-forgotten-export) The symbol "PagedItemConfig" needs to be exported by the entry point index.d.ts
1229+
// Warning: (ae-forgotten-export) The symbol "PagedItemResponse" needs to be exported by the entry point index.d.ts
1230+
//
1231+
// (undocumented)
1232+
protected requestInternal: (params: PagedItemConfig) => Promise<PagedItemResponse<T>>;
1233+
}
1234+
11931235
// @public
11941236
export interface Part {
11951237
codeExecutionResult?: CodeExecutionResult;

api-report/genai.api.md

+45-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export class Caches extends BaseModule {
5757
delete(params: types.DeleteCachedContentParameters): Promise<types.DeleteCachedContentResponse>;
5858
get(params: types.GetCachedContentParameters): Promise<types.CachedContent>;
5959
// Warning: (ae-forgotten-export) The symbol "types" needs to be exported by the entry point index.d.ts
60-
// Warning: (ae-forgotten-export) The symbol "Pager" needs to be exported by the entry point index.d.ts
6160
list: (params?: types.ListCachedContentsParameters) => Promise<Pager<types.CachedContent>>;
6261
update(params: types.UpdateCachedContentParameters): Promise<types.CachedContent>;
6362
}
@@ -388,6 +387,16 @@ export interface FileData {
388387
mimeType?: string;
389388
}
390389

390+
// @public (undocumented)
391+
export class Files extends BaseModule {
392+
constructor(apiClient: ApiClient);
393+
delete(params: types.DeleteFileParameters): Promise<types.DeleteFileResponse>;
394+
get(params: types.GetFileParameters): Promise<types.File>;
395+
list: (params?: types.ListFilesParameters) => Promise<Pager<types.File>>;
396+
// Warning: (ae-forgotten-export) The symbol "common" needs to be exported by the entry point index.d.ts
397+
upload(params: common.UploadFileParameters): Promise<types.File>;
398+
}
399+
391400
// @public (undocumented)
392401
export enum FileSource {
393402
// (undocumented)
@@ -719,8 +728,6 @@ export class GoogleGenAI {
719728
readonly caches: Caches;
720729
// (undocumented)
721730
readonly chats: Chats;
722-
// Warning: (ae-forgotten-export) The symbol "Files" needs to be exported by the entry point index.d.ts
723-
//
724731
// (undocumented)
725732
readonly files: Files;
726733
// (undocumented)
@@ -1190,6 +1197,41 @@ export enum Outcome {
11901197
OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED"
11911198
}
11921199

1200+
// @public
1201+
export enum PagedItem {
1202+
// (undocumented)
1203+
PAGED_ITEM_BATCH_JOBS = "batchJobs",
1204+
// (undocumented)
1205+
PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
1206+
// (undocumented)
1207+
PAGED_ITEM_FILES = "files",
1208+
// (undocumented)
1209+
PAGED_ITEM_MODELS = "models",
1210+
// (undocumented)
1211+
PAGED_ITEM_TUNING_JOBS = "tuningJobs"
1212+
}
1213+
1214+
// @public
1215+
export class Pager<T> implements AsyncIterable<T> {
1216+
[Symbol.asyncIterator](): AsyncIterator<T>;
1217+
constructor(name: PagedItem, request: (params: PagedItemConfig) => Promise<PagedItemResponse<T>>, response: PagedItemResponse<T>, params: PagedItemConfig);
1218+
getItem(index: number): T;
1219+
hasNextPage(): boolean;
1220+
// (undocumented)
1221+
protected idxInternal: number;
1222+
get name(): PagedItem;
1223+
nextPage(): Promise<T[]>;
1224+
get page(): T[];
1225+
get pageLength(): number;
1226+
get pageSize(): number;
1227+
get params(): PagedItemConfig;
1228+
// Warning: (ae-forgotten-export) The symbol "PagedItemConfig" needs to be exported by the entry point index.d.ts
1229+
// Warning: (ae-forgotten-export) The symbol "PagedItemResponse" needs to be exported by the entry point index.d.ts
1230+
//
1231+
// (undocumented)
1232+
protected requestInternal: (params: PagedItemConfig) => Promise<PagedItemResponse<T>>;
1233+
}
1234+
11931235
// @public
11941236
export interface Part {
11951237
codeExecutionResult?: CodeExecutionResult;

src/_common.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {UploadFileConfig} from './types';
88

99
export class BaseModule {}
1010

11+
// TODO (b/406332263): Move this to a place where it can be linked for doc.
1112
/** Parameters for the upload file method. */
1213
export interface UploadFileParameters {
1314
/** The string path to the file to be uploaded or a Blob object. */

src/files.ts

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export class Files extends BaseModule {
7171
*
7272
* @param params - Optional parameters specified in the
7373
* `common.UploadFileParameters` interface.
74-
* Optional @see {@link common.UploadFileParameters}
7574
* @return A promise that resolves to a `types.File` object.
7675
* @throws An error if called on a Vertex AI client.
7776
* @throws An error if the `mimeType` is not provided and can not be inferred,

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
export * from './caches';
88
export * from './chats';
99
export {GoogleGenAI, GoogleGenAIOptions} from './client';
10+
export {Files} from './files';
1011
export * from './live';
1112
export {Models} from './models';
13+
export {PagedItem, Pager} from './pagers';
1214
export * from './types';

src/node/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
export * from '../caches';
88
export * from '../chats';
99
export {GoogleGenAIOptions} from '../client';
10+
export {Files} from '../files';
1011
export * from '../live';
1112
export {Models} from '../models';
13+
export {PagedItem, Pager} from '../pagers';
1214
export * from '../types';
1315
export * from './node_client';

src/web/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
export * from '../caches';
88
export * from '../chats';
99
export {GoogleGenAIOptions} from '../client';
10+
export {Files} from '../files';
1011
export * from '../live';
1112
export {Models} from '../models';
13+
export {PagedItem, Pager} from '../pagers';
1214
export * from '../types';
1315
export * from './web_client';

0 commit comments

Comments
 (0)