grpc-loader: update interfaces & add new test

This commit is contained in:
hiepthai 2022-10-27 07:59:26 +07:00 committed by Christopher Fenn
parent d335428458
commit 4c185fa2e6
3 changed files with 9 additions and 12 deletions

View File

@ -116,9 +116,9 @@ export interface EnumTypeDefinition extends ProtobufTypeDefinition {
}
export enum IdempotencyLevel {
IDEMPOTENCY_UNKNOWN = 0,
NO_SIDE_EFFECTS = 1,
IDEMPOTENT = 2
IDEMPOTENCY_UNKNOWN = 'IDEMPOTENCY_UNKNOWN',
NO_SIDE_EFFECTS = 'NO_SIDE_EFFECTS',
IDEMPOTENT = 'IDEMPOTENT'
}
export interface NamePart {
@ -136,16 +136,11 @@ export interface UninterpretedOption {
aggregate_value?: string;
}
export interface CustomHttpPattern {
kind?: string;
path?: string;
}
export interface MethodOptions {
deprecated?: (boolean|null);
idempotency_level?: (IdempotencyLevel|keyof typeof IdempotencyLevel|null);
uninterpreted_option?: (UninterpretedOption[]|null);
[k: string]: unknown
deprecated?: boolean;
idempotency_level?: IdempotencyLevel|keyof typeof IdempotencyLevel;
uninterpreted_option?: UninterpretedOption;
[k: string]: unknown;
}
export interface MethodDefinition<RequestType, ResponseType, OutputRequestType=RequestType, OutputResponseType=ResponseType> {

View File

@ -160,5 +160,6 @@ describe('Descriptor types', () => {
},
'(google.api.method_signature)': 'bar'
})
assert(service.HelloWithoutOptions.options === undefined)
})
});

View File

@ -34,4 +34,5 @@ service Hello {
};
option (google.api.method_signature) = 'bar';
}
rpc HelloWithoutOptions (Empty) returns (Empty) {}
}