diff --git a/generator/gapic-generator-typescript/baselines/kms/src/v1/key_management_service_client.ts.baseline b/generator/gapic-generator-typescript/baselines/kms/src/v1/key_management_service_client.ts.baseline index 5ab7909bf..a40757f7c 100644 --- a/generator/gapic-generator-typescript/baselines/kms/src/v1/key_management_service_client.ts.baseline +++ b/generator/gapic-generator-typescript/baselines/kms/src/v1/key_management_service_client.ts.baseline @@ -3179,7 +3179,7 @@ export class KeyManagementServiceClient { callSettings ) as AsyncIterable; } -/** + /** * Gets the access control policy for a resource. Returns an empty policy * if the resource exists and does not have a policy set. * @@ -3221,8 +3221,7 @@ export class KeyManagementServiceClient { ):Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.getIamPolicy(request, options, callback); } - -/** + /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of * permissions, not a NOT_FOUND error. @@ -3268,8 +3267,7 @@ export class KeyManagementServiceClient { ):Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.setIamPolicy(request, options, callback); } - -/** + /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of * permissions, not a NOT_FOUND error. diff --git a/generator/gapic-generator-typescript/baselines/kms/test/gapic_key_management_service_v1.ts.baseline b/generator/gapic-generator-typescript/baselines/kms/test/gapic_key_management_service_v1.ts.baseline index b0382f4b2..d2c2b0b15 100644 --- a/generator/gapic-generator-typescript/baselines/kms/test/gapic_key_management_service_v1.ts.baseline +++ b/generator/gapic-generator-typescript/baselines/kms/test/gapic_key_management_service_v1.ts.baseline @@ -16,6 +16,8 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** + + import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; diff --git a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_iam.njk b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_iam.njk index 281ad5a33..967f24b83 100644 --- a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_iam.njk +++ b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_iam.njk @@ -5,6 +5,12 @@ IamClient is created for the client in the constructor. [setIamPolicy, getIamPolicy, testIamPermission] methods are created which is calling the corresponding methods from IamClient in google-gax. -#} +{{ getIamPolicy() }} +{{ setIamPolicy() }} +{{ testIamPermissions() }} +{%- endmacro -%} + +{%- macro getIamPolicy() -%} /** * Gets the access control policy for a resource. Returns an empty policy * if the resource exists and does not have a policy set. @@ -47,7 +53,9 @@ ):Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.getIamPolicy(request, options, callback); } +{%- endmacro -%} +{%- macro setIamPolicy() -%} /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of @@ -94,7 +102,9 @@ ):Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.setIamPolicy(request, options, callback); } +{%- endmacro -%} +{%- macro testIamPermissions() -%} /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of diff --git a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_locations.njk b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_locations.njk index 728b057d5..085a3db89 100644 --- a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_locations.njk +++ b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/_locations.njk @@ -6,6 +6,11 @@ [getLocation, listLocations] methods are created which is calling the corresponding methods from LocationsClient in google-gax. Note that since the listLocations method is a paginated method, we default to using listLocationsAsync for ease of use. -#} +{{ getLocation() }} +{{ listLocationsAsync() }} +{%- endmacro -%} + +{%- macro getLocation() -%} /** * Gets information about a location. * @@ -45,7 +50,9 @@ ): Promise { return this.locationsClient.getLocation(request, options, callback); } +{%- endmacro -%} +{%- macro listLocationsAsync() -%} /** * Lists information about the supported locations for this service. Returns an iterable object. * diff --git a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/src/$version/$service_client.ts.njk b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/src/$version/$service_client.ts.njk index da67e250f..7e484ed12 100644 --- a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/src/$version/$service_client.ts.njk +++ b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/src/$version/$service_client.ts.njk @@ -27,11 +27,15 @@ limitations under the License. {% import "../../_namer.njk" as namer -%} {{- namer.initialize(id, service) -}} {%- set autoPopulated = false -%} +{%- set methodNamesStr = "|" %} {%- for method in service.method -%} {%- if method.autoPopulatedFields|length !== 0 %} {%- set autoPopulated = true -%} {%- endif %} + {%- set methodNamesStr = methodNamesStr + method.name.toCamelCase() + "|" -%} {%- endfor -%} +{%- set generateIam = service.IAMPolicyMixin > 0 and ('|getIamPolicy|' not in methodNamesStr or '|setIamPolicy|' not in methodNamesStr or '|testIamPermissions|' not in methodNamesStr) -%} +{%- set generateLocation = service.LocationMixin > 0 and ('|getLocation|' not in methodNamesStr or '|listLocations|' not in methodNamesStr) -%} import {% if (not api.legacyProtoLoad) and (autoPopulated === false) %}type {% endif %}* as gax from 'google-gax'; import type {Callback, CallOptions, Descriptors, ClientOptions {%- if service.longRunning.length > 0 or service.LongRunningOperationsMixin > 0 %}, GrpcClientOptions{%- endif -%} @@ -93,10 +97,10 @@ export class {{ service.name }}Client { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; - {%- if service.IAMPolicyMixin > 0 %} + {%- if generateIam %} iamClient: IamClient; {%- endif %} - {%- if service.LocationMixin > 0 %} + {%- if generateLocation %} locationsClient: LocationsClient; {%- endif -%} {%- if service.pathTemplates.length > 0 %} @@ -222,11 +226,11 @@ export class {{ service.name }}Client { if (servicePath === this._servicePath) { this.auth.defaultScopes = staticMembers.{{ id.get("scopes") }}; } - {%- if service.IAMPolicyMixin > 0 %} + {%- if generateIam %} this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); {% endif %} - {%- if service.LocationMixin > 0 %} + {%- if generateLocation %} this.locationsClient = new this._gaxModule.LocationsClient( this._gaxGrpc, opts @@ -1103,10 +1107,23 @@ export class {{ service.name }}Client { {%- endif %} {%- endfor %} {%- if service.IAMPolicyMixin > 0 %} -{{ iam.iamServiceMethods()}} + {%- if '|getIamPolicy|' not in methodNamesStr %} + {{ iam.getIamPolicy()}} + {%- endif %} + {%- if '|setIamPolicy|' not in methodNamesStr %} + {{ iam.setIamPolicy()}} + {%- endif %} + {%- if '|testIamPermissions|' not in methodNamesStr %} + {{ iam.testIamPermissions()}} + {%- endif %} {% endif -%} {%- if service.LocationMixin > 0 %} -{{ location.locationServiceMethods()}} + {%- if '|getLocation|' not in methodNamesStr %} + {{ location.getLocation() }} + {%- endif %} + {%- if '|listLocations|' not in methodNamesStr %} + {{ location.listLocationsAsync() }} + {%- endif %} {% endif -%} {%- if service.LongRunningOperationsMixin > 0 %} {{ operations.operationsServiceMethods()}} @@ -1165,10 +1182,10 @@ export class {{ service.name }}Client { this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); - {%- if service.IAMPolicyMixin > 0 %} + {%- if generateIam %} this.iamClient.close().catch(err => {throw err}); {%- endif %} - {%- if service.LocationMixin > 0 %} + {%- if generateLocation %} this.locationsClient.close().catch(err => {throw err}); {%- endif %} {%- if service.longRunning.length > 0 or service.LongRunningOperationsMixin > 0 %} diff --git a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/test/gapic_$service_$version.ts.njk b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/test/gapic_$service_$version.ts.njk index cb6018680..d1734c87a 100644 --- a/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/test/gapic_$service_$version.ts.njk +++ b/generator/gapic-generator-typescript/templates/cjs/typescript_gapic/test/gapic_$service_$version.ts.njk @@ -20,6 +20,24 @@ limitations under the License. {{license.license(commonParameters.copyrightYear)}} {% import "../_namer.njk" as namer -%} {{- namer.initialize(id, service) -}} +{%- set methodNamesStr = "|" %} +{%- for method in service.method -%} + {%- set methodNamesStr = methodNamesStr + method.name.toCamelCase() + "|" -%} +{%- endfor -%} +{%- set enableIamTest = false %} +{%- if service.IAMPolicyMixin > 0 %} + {%- if ('|getIamPolicy|' not in methodNamesStr) or ('|setIamPolicy|' not in methodNamesStr) or ('|testIamPermissions|' not in methodNamesStr) %} + {%- set enableIamTest = true %} + {%- endif %} +{%- endif %} + +{%- set enableLocationTest = false %} +{%- if service.LocationMixin > 0 %} + {%- if ('|getLocation|' not in methodNamesStr) or ('|listLocations|' not in methodNamesStr) %} + {%- set enableLocationTest = true %} + {%- endif %} +{%- endif %} + import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; @@ -44,8 +62,8 @@ import {protobuf {%- if service.longRunning.length > 0 or service.LongRunningOperationsMixin > 0 -%} , operationsProtos {%- endif -%} -{%- if service.IAMPolicyMixin > 0 %}, IamProtos{%- endif -%} -{%- if service.LocationMixin > 0 %}, LocationProtos{%- endif -%} +{%- if enableIamTest %}, IamProtos{%- endif -%} +{%- if enableLocationTest %}, LocationProtos{%- endif -%} } from 'google-gax'; {%- if not api.legacyProtoLoad %} @@ -1089,6 +1107,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { {%- if (service.IAMPolicyMixin) > 0 %} {%- set IAMmethods = ['getIamPolicy', 'setIamPolicy', 'testIamPermissions'] %} {%- for method in IAMmethods %} + {%- if ("|" + method + "|") not in methodNamesStr %} describe('{{ method }}', () => { it('invokes {{ method }} without error', async () => { const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client( @@ -1204,10 +1223,12 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { .getCall(0).calledWith(request, expectedOptions, undefined)); }); }); + {%- endif %} {%- endfor %} {%- endif %} {%- if service.LocationMixin > 0 %} {%- set method = 'getLocation' %} + {%- if ("|" + method + "|") not in methodNamesStr %} describe('{{ method }}', () => { it('invokes {{ method }} without error', async () => { const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client( @@ -1314,7 +1335,9 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { .getCall(0).calledWith(request, expectedOptions, undefined)); }); }); + {%- endif %} {%- set method = 'listLocations' %} + {%- if ("|" + method + "|") not in methodNamesStr %} describe('{{ method }}Async', () => { it('uses async iteration with {{method}} without error', async () => { const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client({{- util.initClientOptions(api.rest) -}}); @@ -1395,6 +1418,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { ); }); }); + {%- endif %} {%- endif %} {%- if (service.LongRunningOperationsMixin) > 0 %} {%- set Operationsmethods = ['getOperation', 'cancelOperation', 'deleteOperation'] %} diff --git a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_iam.njk b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_iam.njk index 281ad5a33..967f24b83 100644 --- a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_iam.njk +++ b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_iam.njk @@ -5,6 +5,12 @@ IamClient is created for the client in the constructor. [setIamPolicy, getIamPolicy, testIamPermission] methods are created which is calling the corresponding methods from IamClient in google-gax. -#} +{{ getIamPolicy() }} +{{ setIamPolicy() }} +{{ testIamPermissions() }} +{%- endmacro -%} + +{%- macro getIamPolicy() -%} /** * Gets the access control policy for a resource. Returns an empty policy * if the resource exists and does not have a policy set. @@ -47,7 +53,9 @@ ):Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.getIamPolicy(request, options, callback); } +{%- endmacro -%} +{%- macro setIamPolicy() -%} /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of @@ -94,7 +102,9 @@ ):Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.setIamPolicy(request, options, callback); } +{%- endmacro -%} +{%- macro testIamPermissions() -%} /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of diff --git a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_locations.njk b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_locations.njk index 728b057d5..085a3db89 100644 --- a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_locations.njk +++ b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/_locations.njk @@ -6,6 +6,11 @@ [getLocation, listLocations] methods are created which is calling the corresponding methods from LocationsClient in google-gax. Note that since the listLocations method is a paginated method, we default to using listLocationsAsync for ease of use. -#} +{{ getLocation() }} +{{ listLocationsAsync() }} +{%- endmacro -%} + +{%- macro getLocation() -%} /** * Gets information about a location. * @@ -45,7 +50,9 @@ ): Promise { return this.locationsClient.getLocation(request, options, callback); } +{%- endmacro -%} +{%- macro listLocationsAsync() -%} /** * Lists information about the supported locations for this service. Returns an iterable object. * diff --git a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/src/$version/$service_client.ts.njk b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/src/$version/$service_client.ts.njk index 62d4d28e9..d7aebc929 100644 --- a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/src/$version/$service_client.ts.njk +++ b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/src/$version/$service_client.ts.njk @@ -26,6 +26,12 @@ limitations under the License. {% import "../../../_operations.njk" as operations -%} {% import "../../../_namer.njk" as namer -%} {{- namer.initialize(id, service) -}} +{%- set methodNamesStr = "|" %} +{%- for method in service.method -%} + {%- set methodNamesStr = methodNamesStr + method.name.toCamelCase() + "|" -%} +{%- endfor -%} +{%- set generateIam = service.IAMPolicyMixin > 0 and ('|getIamPolicy|' not in methodNamesStr or '|setIamPolicy|' not in methodNamesStr or '|testIamPermissions|' not in methodNamesStr) -%} +{%- set generateLocation = service.LocationMixin > 0 and ('|getLocation|' not in methodNamesStr or '|listLocations|' not in methodNamesStr) -%} import * as gax from 'google-gax'; import type {Callback, CallOptions, Descriptors, ClientOptions {%- if service.longRunning.length > 0 or service.LongRunningOperationsMixin > 0 %}, GrpcClientOptions{%- endif -%} @@ -99,10 +105,10 @@ export class {{ service.name }}Client { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; - {%- if service.IAMPolicyMixin > 0 %} + {%- if generateIam %} iamClient: IamClient; {%- endif %} - {%- if service.LocationMixin > 0 %} + {%- if generateLocation %} locationsClient: LocationsClient; {%- endif -%} {%- if service.pathTemplates.length > 0 %} @@ -229,11 +235,11 @@ export class {{ service.name }}Client { if (servicePath === this._servicePath) { this.auth.defaultScopes = staticMembers.{{ id.get("scopes") }}; } - {%- if service.IAMPolicyMixin > 0 %} + {%- if generateIam %} this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); {% endif %} - {%- if service.LocationMixin > 0 %} + {%- if generateLocation %} this.locationsClient = new this._gaxModule.LocationsClient( this._gaxGrpc, opts @@ -448,7 +454,6 @@ export class {{ service.name }}Client { // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).{{api.naming.protoPackage}}.{{ service.name }}, this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - {%- set stubMethodsContent %} {%- set stubMethodsJoiner = joiner(', ') -%} {%- for method in service.method -%} @@ -1110,10 +1115,23 @@ export class {{ service.name }}Client { {%- endif %} {%- endfor %} {%- if service.IAMPolicyMixin > 0 %} -{{ iam.iamServiceMethods()}} + {%- if '|getIamPolicy|' not in methodNamesStr %} + {{ iam.getIamPolicy()}} + {%- endif %} + {%- if '|setIamPolicy|' not in methodNamesStr %} + {{ iam.setIamPolicy()}} + {%- endif %} + {%- if '|testIamPermissions|' not in methodNamesStr %} + {{ iam.testIamPermissions()}} + {%- endif %} {% endif -%} {%- if service.LocationMixin > 0 %} -{{ location.locationServiceMethods()}} + {%- if '|getLocation|' not in methodNamesStr %} + {{ location.getLocation() }} + {%- endif %} + {%- if '|listLocations|' not in methodNamesStr %} + {{ location.listLocationsAsync() }} + {%- endif %} {% endif -%} {%- if service.LongRunningOperationsMixin > 0 %} {{ operations.operationsServiceMethods()}} @@ -1172,10 +1190,10 @@ export class {{ service.name }}Client { this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); - {%- if service.IAMPolicyMixin > 0 %} + {%- if generateIam %} this.iamClient.close().catch(err => {throw err}); {%- endif %} - {%- if service.LocationMixin > 0 %} + {%- if generateLocation %} this.locationsClient.close().catch(err => {throw err}); {%- endif %} {%- if service.longRunning.length > 0 or service.LongRunningOperationsMixin > 0 %} diff --git a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/test/gapic_$service_$version.ts.njk b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/test/gapic_$service_$version.ts.njk index 0d723c4e2..251d95ea9 100644 --- a/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/test/gapic_$service_$version.ts.njk +++ b/generator/gapic-generator-typescript/templates/esm/typescript_gapic/esm/test/gapic_$service_$version.ts.njk @@ -20,6 +20,24 @@ limitations under the License. {{license.license(commonParameters.copyrightYear)}} {% import "../../_namer.njk" as namer -%} {{- namer.initialize(id, service) -}} +{%- set methodNamesStr = "|" %} +{%- for method in service.method -%} + {%- set methodNamesStr = methodNamesStr + method.name.toCamelCase() + "|" -%} +{%- endfor -%} +{%- set enableIamTest = false %} +{%- if service.IAMPolicyMixin > 0 %} + {%- if ('|getIamPolicy|' not in methodNamesStr) or ('|setIamPolicy|' not in methodNamesStr) or ('|testIamPermissions|' not in methodNamesStr) %} + {%- set enableIamTest = true %} + {%- endif %} +{%- endif %} + +{%- set enableLocationTest = false %} +{%- if service.LocationMixin > 0 %} + {%- if ('|getLocation|' not in methodNamesStr) or ('|listLocations|' not in methodNamesStr) %} + {%- set enableLocationTest = true %} + {%- endif %} +{%- endif %} + // @ts-ignore import * as protos from '../../protos/protos.js'; import assert from 'assert'; @@ -45,8 +63,8 @@ import {protobuf {%- if service.longRunning.length > 0 or service.LongRunningOperationsMixin > 0 -%} , operationsProtos {%- endif -%} -{%- if service.IAMPolicyMixin > 0 %}, IamProtos{%- endif -%} -{%- if service.LocationMixin > 0 %}, LocationProtos{%- endif -%} +{%- if enableIamTest %}, IamProtos{%- endif -%} +{%- if enableLocationTest %}, LocationProtos{%- endif -%} } from 'google-gax'; {%- if not api.legacyProtoLoad %} import fs from 'fs'; @@ -1095,6 +1113,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { {%- if (service.IAMPolicyMixin) > 0 %} {%- set IAMmethods = ['getIamPolicy', 'setIamPolicy', 'testIamPermissions'] %} {%- for method in IAMmethods %} + {%- if ("|" + method + "|") not in methodNamesStr %} describe('{{ method }}', () => { it('invokes {{ method }} without error', async () => { const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client( @@ -1210,10 +1229,12 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { .getCall(0).calledWith(request, expectedOptions, undefined)); }); }); + {%- endif %} {%- endfor %} {%- endif %} {%- if service.LocationMixin > 0 %} {%- set method = 'getLocation' %} + {%- if ("|" + method + "|") not in methodNamesStr %} describe('{{ method }}', () => { it('invokes {{ method }} without error', async () => { const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client( @@ -1320,7 +1341,9 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { .getCall(0).calledWith(request, expectedOptions, undefined)); }); }); + {%- endif %} {%- set method = 'listLocations' %} + {%- if ("|" + method + "|") not in methodNamesStr %} describe('{{ method }}Async', () => { it('uses async iteration with {{method}} without error', async () => { const client = new {{ service.name.toLowerCase() }}Module.{{ api.naming.version }}.{{ service.name }}Client({{- util.initClientOptions(api.rest) -}}); @@ -1401,6 +1424,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => { ); }); }); + {%- endif %} {%- endif %} {%- if (service.LongRunningOperationsMixin) > 0 %} {%- set Operationsmethods = ['getOperation', 'cancelOperation', 'deleteOperation'] %} diff --git a/generator/gapic-generator-typescript/typescript/src/generator.ts b/generator/gapic-generator-typescript/typescript/src/generator.ts index ac490f404..84a8e8187 100644 --- a/generator/gapic-generator-typescript/typescript/src/generator.ts +++ b/generator/gapic-generator-typescript/typescript/src/generator.ts @@ -19,7 +19,7 @@ import * as yaml from 'js-yaml'; import * as serializer from 'proto3-json-serializer'; import protobuf from 'protobufjs'; import type * as protos from '../../protos/index.js'; -import protoJson from '../../protos/protos.json' assert {type: 'json'}; +import protoJson from '../../protos/protos.json' with {type: 'json'}; import * as url from 'url'; import {API} from './schema/api.js'; import {processTemplates} from './templater.js';