Merge pull request #2978 from murgatroid99/grpc-js_orca_server_per_call

grpc-js: Implement ORCA server-side per-call metrics
This commit is contained in:
Michael Lumish 2025-07-23 15:36:51 -07:00 committed by GitHub
commit eaa3f4d2bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
61 changed files with 4080 additions and 10 deletions

@ -1 +1 @@
Subproject commit cb28da3451f158a947dfc45090fe92b07b243bc1
Subproject commit 3a472e524827f72d1ad621c4983dd5af54c46776

View File

@ -0,0 +1,31 @@
/*
* Copyright 2025 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Copy xDS protos that are needed for ORCA into this directory.
*/
const fs = require('fs');
fs.mkdirSync(__dirname + '/proto/protoc-gen-validate/validate', { recursive: true });
fs.mkdirSync(__dirname + '/proto/xds/xds/data/orca/v3', { recursive: true });
fs.mkdirSync(__dirname + '/proto/xds/xds/service/orca/v3', { recursive: true });
fs.copyFileSync(__dirname + '/../grpc-js-xds/deps/protoc-gen-validate/LICENSE', __dirname + '/proto/protoc-gen-validate/LICENSE');
fs.copyFileSync(__dirname + '/../grpc-js-xds/deps/protoc-gen-validate/validate/validate.proto', __dirname + '/proto/protoc-gen-validate/validate/validate.proto');
fs.copyFileSync(__dirname + '/../grpc-js-xds/deps/xds/LICENSE', __dirname + '/proto/xds/LICENSE')
fs.copyFileSync(__dirname + '/../grpc-js-xds/deps/xds/xds/data/orca/v3/orca_load_report.proto', __dirname + '/proto/xds/xds/data/orca/v3/orca_load_report.proto');
fs.copyFileSync(__dirname + '/../grpc-js-xds/deps/xds/xds/service/orca/v3/orca.proto', __dirname + '/proto/xds/xds/service/orca/v3/orca.proto');

View File

@ -57,23 +57,25 @@
"compile": "tsc -p .",
"format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts",
"lint": "eslint src/*.ts test/*.ts",
"prepare": "npm run generate-types && npm run generate-test-types && npm run compile",
"prepare": "npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",
"test": "gulp test",
"check": "npm run lint",
"fix": "eslint --fix src/*.ts test/*.ts",
"pretest": "npm run generate-types && npm run generate-test-types && npm run compile",
"posttest": "npm run check && madge -c ./build/src",
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto",
"generate-test-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto",
"generate-test-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto",
"copy-protos": "node ./copy-protos"
},
"dependencies": {
"@grpc/proto-loader": "^0.7.13",
"@grpc/proto-loader": "^0.8.0",
"@js-sdsl/ordered-map": "^4.4.2"
},
"files": [
"src/**/*.ts",
"build/src/**/*.{js,d.ts,js.map}",
"proto/*.proto",
"proto/**/*.proto",
"proto/**/LICENSE",
"LICENSE",
"deps/envoy-api/envoy/api/v2/**/*.proto",
"deps/envoy-api/envoy/config/**/*.proto",

View File

@ -65,6 +65,7 @@ export interface ChannelOptions {
'grpc.lb.ring_hash.ring_size_cap'?: number;
'grpc-node.retry_max_attempts_limit'?: number;
'grpc-node.flow_control_window'?: number;
'grpc.server_call_metric_recording'?: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
@ -103,6 +104,7 @@ export const recognizedOptions = {
'grpc.lb.ring_hash.ring_size_cap': true,
'grpc-node.retry_max_attempts_limit': true,
'grpc-node.flow_control_window': true,
'grpc.server_call_metric_recording': true
};
export function channelOptionsEqual(

View File

@ -0,0 +1,59 @@
// Original file: null
import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from '../../google/protobuf/FieldDescriptorProto';
import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from '../../google/protobuf/DescriptorProto';
import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from '../../google/protobuf/EnumDescriptorProto';
import type { MessageOptions as _google_protobuf_MessageOptions, MessageOptions__Output as _google_protobuf_MessageOptions__Output } from '../../google/protobuf/MessageOptions';
import type { OneofDescriptorProto as _google_protobuf_OneofDescriptorProto, OneofDescriptorProto__Output as _google_protobuf_OneofDescriptorProto__Output } from '../../google/protobuf/OneofDescriptorProto';
import type { SymbolVisibility as _google_protobuf_SymbolVisibility, SymbolVisibility__Output as _google_protobuf_SymbolVisibility__Output } from '../../google/protobuf/SymbolVisibility';
import type { ExtensionRangeOptions as _google_protobuf_ExtensionRangeOptions, ExtensionRangeOptions__Output as _google_protobuf_ExtensionRangeOptions__Output } from '../../google/protobuf/ExtensionRangeOptions';
export interface _google_protobuf_DescriptorProto_ExtensionRange {
'start'?: (number);
'end'?: (number);
'options'?: (_google_protobuf_ExtensionRangeOptions | null);
}
export interface _google_protobuf_DescriptorProto_ExtensionRange__Output {
'start': (number);
'end': (number);
'options': (_google_protobuf_ExtensionRangeOptions__Output | null);
}
export interface _google_protobuf_DescriptorProto_ReservedRange {
'start'?: (number);
'end'?: (number);
}
export interface _google_protobuf_DescriptorProto_ReservedRange__Output {
'start': (number);
'end': (number);
}
export interface DescriptorProto {
'name'?: (string);
'field'?: (_google_protobuf_FieldDescriptorProto)[];
'nestedType'?: (_google_protobuf_DescriptorProto)[];
'enumType'?: (_google_protobuf_EnumDescriptorProto)[];
'extensionRange'?: (_google_protobuf_DescriptorProto_ExtensionRange)[];
'extension'?: (_google_protobuf_FieldDescriptorProto)[];
'options'?: (_google_protobuf_MessageOptions | null);
'oneofDecl'?: (_google_protobuf_OneofDescriptorProto)[];
'reservedRange'?: (_google_protobuf_DescriptorProto_ReservedRange)[];
'reservedName'?: (string)[];
'visibility'?: (_google_protobuf_SymbolVisibility);
}
export interface DescriptorProto__Output {
'name': (string);
'field': (_google_protobuf_FieldDescriptorProto__Output)[];
'nestedType': (_google_protobuf_DescriptorProto__Output)[];
'enumType': (_google_protobuf_EnumDescriptorProto__Output)[];
'extensionRange': (_google_protobuf_DescriptorProto_ExtensionRange__Output)[];
'extension': (_google_protobuf_FieldDescriptorProto__Output)[];
'options': (_google_protobuf_MessageOptions__Output | null);
'oneofDecl': (_google_protobuf_OneofDescriptorProto__Output)[];
'reservedRange': (_google_protobuf_DescriptorProto_ReservedRange__Output)[];
'reservedName': (string)[];
'visibility': (_google_protobuf_SymbolVisibility__Output);
}

View File

@ -0,0 +1,44 @@
// Original file: null
export const Edition = {
EDITION_UNKNOWN: 'EDITION_UNKNOWN',
EDITION_LEGACY: 'EDITION_LEGACY',
EDITION_PROTO2: 'EDITION_PROTO2',
EDITION_PROTO3: 'EDITION_PROTO3',
EDITION_2023: 'EDITION_2023',
EDITION_2024: 'EDITION_2024',
EDITION_1_TEST_ONLY: 'EDITION_1_TEST_ONLY',
EDITION_2_TEST_ONLY: 'EDITION_2_TEST_ONLY',
EDITION_99997_TEST_ONLY: 'EDITION_99997_TEST_ONLY',
EDITION_99998_TEST_ONLY: 'EDITION_99998_TEST_ONLY',
EDITION_99999_TEST_ONLY: 'EDITION_99999_TEST_ONLY',
EDITION_MAX: 'EDITION_MAX',
} as const;
export type Edition =
| 'EDITION_UNKNOWN'
| 0
| 'EDITION_LEGACY'
| 900
| 'EDITION_PROTO2'
| 998
| 'EDITION_PROTO3'
| 999
| 'EDITION_2023'
| 1000
| 'EDITION_2024'
| 1001
| 'EDITION_1_TEST_ONLY'
| 1
| 'EDITION_2_TEST_ONLY'
| 2
| 'EDITION_99997_TEST_ONLY'
| 99997
| 'EDITION_99998_TEST_ONLY'
| 99998
| 'EDITION_99999_TEST_ONLY'
| 99999
| 'EDITION_MAX'
| 2147483647
export type Edition__Output = typeof Edition[keyof typeof Edition]

View File

@ -0,0 +1,33 @@
// Original file: null
import type { EnumValueDescriptorProto as _google_protobuf_EnumValueDescriptorProto, EnumValueDescriptorProto__Output as _google_protobuf_EnumValueDescriptorProto__Output } from '../../google/protobuf/EnumValueDescriptorProto';
import type { EnumOptions as _google_protobuf_EnumOptions, EnumOptions__Output as _google_protobuf_EnumOptions__Output } from '../../google/protobuf/EnumOptions';
import type { SymbolVisibility as _google_protobuf_SymbolVisibility, SymbolVisibility__Output as _google_protobuf_SymbolVisibility__Output } from '../../google/protobuf/SymbolVisibility';
export interface _google_protobuf_EnumDescriptorProto_EnumReservedRange {
'start'?: (number);
'end'?: (number);
}
export interface _google_protobuf_EnumDescriptorProto_EnumReservedRange__Output {
'start': (number);
'end': (number);
}
export interface EnumDescriptorProto {
'name'?: (string);
'value'?: (_google_protobuf_EnumValueDescriptorProto)[];
'options'?: (_google_protobuf_EnumOptions | null);
'reservedRange'?: (_google_protobuf_EnumDescriptorProto_EnumReservedRange)[];
'reservedName'?: (string)[];
'visibility'?: (_google_protobuf_SymbolVisibility);
}
export interface EnumDescriptorProto__Output {
'name': (string);
'value': (_google_protobuf_EnumValueDescriptorProto__Output)[];
'options': (_google_protobuf_EnumOptions__Output | null);
'reservedRange': (_google_protobuf_EnumDescriptorProto_EnumReservedRange__Output)[];
'reservedName': (string)[];
'visibility': (_google_protobuf_SymbolVisibility__Output);
}

View File

@ -0,0 +1,26 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
export interface EnumOptions {
'allowAlias'?: (boolean);
'deprecated'?: (boolean);
/**
* @deprecated
*/
'deprecatedLegacyJsonFieldConflicts'?: (boolean);
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
}
export interface EnumOptions__Output {
'allowAlias': (boolean);
'deprecated': (boolean);
/**
* @deprecated
*/
'deprecatedLegacyJsonFieldConflicts': (boolean);
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
}

View File

@ -0,0 +1,15 @@
// Original file: null
import type { EnumValueOptions as _google_protobuf_EnumValueOptions, EnumValueOptions__Output as _google_protobuf_EnumValueOptions__Output } from '../../google/protobuf/EnumValueOptions';
export interface EnumValueDescriptorProto {
'name'?: (string);
'number'?: (number);
'options'?: (_google_protobuf_EnumValueOptions | null);
}
export interface EnumValueDescriptorProto__Output {
'name': (string);
'number': (number);
'options': (_google_protobuf_EnumValueOptions__Output | null);
}

View File

@ -0,0 +1,21 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { _google_protobuf_FieldOptions_FeatureSupport, _google_protobuf_FieldOptions_FeatureSupport__Output } from '../../google/protobuf/FieldOptions';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
export interface EnumValueOptions {
'deprecated'?: (boolean);
'features'?: (_google_protobuf_FeatureSet | null);
'debugRedact'?: (boolean);
'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
}
export interface EnumValueOptions__Output {
'deprecated': (boolean);
'features': (_google_protobuf_FeatureSet__Output | null);
'debugRedact': (boolean);
'featureSupport': (_google_protobuf_FieldOptions_FeatureSupport__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
}

View File

@ -0,0 +1,49 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
export interface _google_protobuf_ExtensionRangeOptions_Declaration {
'number'?: (number);
'fullName'?: (string);
'type'?: (string);
'reserved'?: (boolean);
'repeated'?: (boolean);
}
export interface _google_protobuf_ExtensionRangeOptions_Declaration__Output {
'number': (number);
'fullName': (string);
'type': (string);
'reserved': (boolean);
'repeated': (boolean);
}
// Original file: null
export const _google_protobuf_ExtensionRangeOptions_VerificationState = {
DECLARATION: 'DECLARATION',
UNVERIFIED: 'UNVERIFIED',
} as const;
export type _google_protobuf_ExtensionRangeOptions_VerificationState =
| 'DECLARATION'
| 0
| 'UNVERIFIED'
| 1
export type _google_protobuf_ExtensionRangeOptions_VerificationState__Output = typeof _google_protobuf_ExtensionRangeOptions_VerificationState[keyof typeof _google_protobuf_ExtensionRangeOptions_VerificationState]
export interface ExtensionRangeOptions {
'declaration'?: (_google_protobuf_ExtensionRangeOptions_Declaration)[];
'verification'?: (_google_protobuf_ExtensionRangeOptions_VerificationState);
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
}
export interface ExtensionRangeOptions__Output {
'declaration': (_google_protobuf_ExtensionRangeOptions_Declaration__Output)[];
'verification': (_google_protobuf_ExtensionRangeOptions_VerificationState__Output);
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
}

View File

@ -0,0 +1,183 @@
// Original file: null
// Original file: null
export const _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility = {
DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN',
EXPORT_ALL: 'EXPORT_ALL',
EXPORT_TOP_LEVEL: 'EXPORT_TOP_LEVEL',
LOCAL_ALL: 'LOCAL_ALL',
STRICT: 'STRICT',
} as const;
export type _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility =
| 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN'
| 0
| 'EXPORT_ALL'
| 1
| 'EXPORT_TOP_LEVEL'
| 2
| 'LOCAL_ALL'
| 3
| 'STRICT'
| 4
export type _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility__Output = typeof _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility[keyof typeof _google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility]
// Original file: null
export const _google_protobuf_FeatureSet_EnforceNamingStyle = {
ENFORCE_NAMING_STYLE_UNKNOWN: 'ENFORCE_NAMING_STYLE_UNKNOWN',
STYLE2024: 'STYLE2024',
STYLE_LEGACY: 'STYLE_LEGACY',
} as const;
export type _google_protobuf_FeatureSet_EnforceNamingStyle =
| 'ENFORCE_NAMING_STYLE_UNKNOWN'
| 0
| 'STYLE2024'
| 1
| 'STYLE_LEGACY'
| 2
export type _google_protobuf_FeatureSet_EnforceNamingStyle__Output = typeof _google_protobuf_FeatureSet_EnforceNamingStyle[keyof typeof _google_protobuf_FeatureSet_EnforceNamingStyle]
// Original file: null
export const _google_protobuf_FeatureSet_EnumType = {
ENUM_TYPE_UNKNOWN: 'ENUM_TYPE_UNKNOWN',
OPEN: 'OPEN',
CLOSED: 'CLOSED',
} as const;
export type _google_protobuf_FeatureSet_EnumType =
| 'ENUM_TYPE_UNKNOWN'
| 0
| 'OPEN'
| 1
| 'CLOSED'
| 2
export type _google_protobuf_FeatureSet_EnumType__Output = typeof _google_protobuf_FeatureSet_EnumType[keyof typeof _google_protobuf_FeatureSet_EnumType]
// Original file: null
export const _google_protobuf_FeatureSet_FieldPresence = {
FIELD_PRESENCE_UNKNOWN: 'FIELD_PRESENCE_UNKNOWN',
EXPLICIT: 'EXPLICIT',
IMPLICIT: 'IMPLICIT',
LEGACY_REQUIRED: 'LEGACY_REQUIRED',
} as const;
export type _google_protobuf_FeatureSet_FieldPresence =
| 'FIELD_PRESENCE_UNKNOWN'
| 0
| 'EXPLICIT'
| 1
| 'IMPLICIT'
| 2
| 'LEGACY_REQUIRED'
| 3
export type _google_protobuf_FeatureSet_FieldPresence__Output = typeof _google_protobuf_FeatureSet_FieldPresence[keyof typeof _google_protobuf_FeatureSet_FieldPresence]
// Original file: null
export const _google_protobuf_FeatureSet_JsonFormat = {
JSON_FORMAT_UNKNOWN: 'JSON_FORMAT_UNKNOWN',
ALLOW: 'ALLOW',
LEGACY_BEST_EFFORT: 'LEGACY_BEST_EFFORT',
} as const;
export type _google_protobuf_FeatureSet_JsonFormat =
| 'JSON_FORMAT_UNKNOWN'
| 0
| 'ALLOW'
| 1
| 'LEGACY_BEST_EFFORT'
| 2
export type _google_protobuf_FeatureSet_JsonFormat__Output = typeof _google_protobuf_FeatureSet_JsonFormat[keyof typeof _google_protobuf_FeatureSet_JsonFormat]
// Original file: null
export const _google_protobuf_FeatureSet_MessageEncoding = {
MESSAGE_ENCODING_UNKNOWN: 'MESSAGE_ENCODING_UNKNOWN',
LENGTH_PREFIXED: 'LENGTH_PREFIXED',
DELIMITED: 'DELIMITED',
} as const;
export type _google_protobuf_FeatureSet_MessageEncoding =
| 'MESSAGE_ENCODING_UNKNOWN'
| 0
| 'LENGTH_PREFIXED'
| 1
| 'DELIMITED'
| 2
export type _google_protobuf_FeatureSet_MessageEncoding__Output = typeof _google_protobuf_FeatureSet_MessageEncoding[keyof typeof _google_protobuf_FeatureSet_MessageEncoding]
// Original file: null
export const _google_protobuf_FeatureSet_RepeatedFieldEncoding = {
REPEATED_FIELD_ENCODING_UNKNOWN: 'REPEATED_FIELD_ENCODING_UNKNOWN',
PACKED: 'PACKED',
EXPANDED: 'EXPANDED',
} as const;
export type _google_protobuf_FeatureSet_RepeatedFieldEncoding =
| 'REPEATED_FIELD_ENCODING_UNKNOWN'
| 0
| 'PACKED'
| 1
| 'EXPANDED'
| 2
export type _google_protobuf_FeatureSet_RepeatedFieldEncoding__Output = typeof _google_protobuf_FeatureSet_RepeatedFieldEncoding[keyof typeof _google_protobuf_FeatureSet_RepeatedFieldEncoding]
// Original file: null
export const _google_protobuf_FeatureSet_Utf8Validation = {
UTF8_VALIDATION_UNKNOWN: 'UTF8_VALIDATION_UNKNOWN',
VERIFY: 'VERIFY',
NONE: 'NONE',
} as const;
export type _google_protobuf_FeatureSet_Utf8Validation =
| 'UTF8_VALIDATION_UNKNOWN'
| 0
| 'VERIFY'
| 2
| 'NONE'
| 3
export type _google_protobuf_FeatureSet_Utf8Validation__Output = typeof _google_protobuf_FeatureSet_Utf8Validation[keyof typeof _google_protobuf_FeatureSet_Utf8Validation]
export interface _google_protobuf_FeatureSet_VisibilityFeature {
}
export interface _google_protobuf_FeatureSet_VisibilityFeature__Output {
}
export interface FeatureSet {
'fieldPresence'?: (_google_protobuf_FeatureSet_FieldPresence);
'enumType'?: (_google_protobuf_FeatureSet_EnumType);
'repeatedFieldEncoding'?: (_google_protobuf_FeatureSet_RepeatedFieldEncoding);
'utf8Validation'?: (_google_protobuf_FeatureSet_Utf8Validation);
'messageEncoding'?: (_google_protobuf_FeatureSet_MessageEncoding);
'jsonFormat'?: (_google_protobuf_FeatureSet_JsonFormat);
'enforceNamingStyle'?: (_google_protobuf_FeatureSet_EnforceNamingStyle);
'defaultSymbolVisibility'?: (_google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility);
}
export interface FeatureSet__Output {
'fieldPresence': (_google_protobuf_FeatureSet_FieldPresence__Output);
'enumType': (_google_protobuf_FeatureSet_EnumType__Output);
'repeatedFieldEncoding': (_google_protobuf_FeatureSet_RepeatedFieldEncoding__Output);
'utf8Validation': (_google_protobuf_FeatureSet_Utf8Validation__Output);
'messageEncoding': (_google_protobuf_FeatureSet_MessageEncoding__Output);
'jsonFormat': (_google_protobuf_FeatureSet_JsonFormat__Output);
'enforceNamingStyle': (_google_protobuf_FeatureSet_EnforceNamingStyle__Output);
'defaultSymbolVisibility': (_google_protobuf_FeatureSet_VisibilityFeature_DefaultSymbolVisibility__Output);
}

View File

@ -0,0 +1,28 @@
// Original file: null
import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from '../../google/protobuf/Edition';
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
export interface _google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault {
'edition'?: (_google_protobuf_Edition);
'overridableFeatures'?: (_google_protobuf_FeatureSet | null);
'fixedFeatures'?: (_google_protobuf_FeatureSet | null);
}
export interface _google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__Output {
'edition': (_google_protobuf_Edition__Output);
'overridableFeatures': (_google_protobuf_FeatureSet__Output | null);
'fixedFeatures': (_google_protobuf_FeatureSet__Output | null);
}
export interface FeatureSetDefaults {
'defaults'?: (_google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault)[];
'minimumEdition'?: (_google_protobuf_Edition);
'maximumEdition'?: (_google_protobuf_Edition);
}
export interface FeatureSetDefaults__Output {
'defaults': (_google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault__Output)[];
'minimumEdition': (_google_protobuf_Edition__Output);
'maximumEdition': (_google_protobuf_Edition__Output);
}

View File

@ -0,0 +1,112 @@
// Original file: null
import type { FieldOptions as _google_protobuf_FieldOptions, FieldOptions__Output as _google_protobuf_FieldOptions__Output } from '../../google/protobuf/FieldOptions';
// Original file: null
export const _google_protobuf_FieldDescriptorProto_Label = {
LABEL_OPTIONAL: 'LABEL_OPTIONAL',
LABEL_REPEATED: 'LABEL_REPEATED',
LABEL_REQUIRED: 'LABEL_REQUIRED',
} as const;
export type _google_protobuf_FieldDescriptorProto_Label =
| 'LABEL_OPTIONAL'
| 1
| 'LABEL_REPEATED'
| 3
| 'LABEL_REQUIRED'
| 2
export type _google_protobuf_FieldDescriptorProto_Label__Output = typeof _google_protobuf_FieldDescriptorProto_Label[keyof typeof _google_protobuf_FieldDescriptorProto_Label]
// Original file: null
export const _google_protobuf_FieldDescriptorProto_Type = {
TYPE_DOUBLE: 'TYPE_DOUBLE',
TYPE_FLOAT: 'TYPE_FLOAT',
TYPE_INT64: 'TYPE_INT64',
TYPE_UINT64: 'TYPE_UINT64',
TYPE_INT32: 'TYPE_INT32',
TYPE_FIXED64: 'TYPE_FIXED64',
TYPE_FIXED32: 'TYPE_FIXED32',
TYPE_BOOL: 'TYPE_BOOL',
TYPE_STRING: 'TYPE_STRING',
TYPE_GROUP: 'TYPE_GROUP',
TYPE_MESSAGE: 'TYPE_MESSAGE',
TYPE_BYTES: 'TYPE_BYTES',
TYPE_UINT32: 'TYPE_UINT32',
TYPE_ENUM: 'TYPE_ENUM',
TYPE_SFIXED32: 'TYPE_SFIXED32',
TYPE_SFIXED64: 'TYPE_SFIXED64',
TYPE_SINT32: 'TYPE_SINT32',
TYPE_SINT64: 'TYPE_SINT64',
} as const;
export type _google_protobuf_FieldDescriptorProto_Type =
| 'TYPE_DOUBLE'
| 1
| 'TYPE_FLOAT'
| 2
| 'TYPE_INT64'
| 3
| 'TYPE_UINT64'
| 4
| 'TYPE_INT32'
| 5
| 'TYPE_FIXED64'
| 6
| 'TYPE_FIXED32'
| 7
| 'TYPE_BOOL'
| 8
| 'TYPE_STRING'
| 9
| 'TYPE_GROUP'
| 10
| 'TYPE_MESSAGE'
| 11
| 'TYPE_BYTES'
| 12
| 'TYPE_UINT32'
| 13
| 'TYPE_ENUM'
| 14
| 'TYPE_SFIXED32'
| 15
| 'TYPE_SFIXED64'
| 16
| 'TYPE_SINT32'
| 17
| 'TYPE_SINT64'
| 18
export type _google_protobuf_FieldDescriptorProto_Type__Output = typeof _google_protobuf_FieldDescriptorProto_Type[keyof typeof _google_protobuf_FieldDescriptorProto_Type]
export interface FieldDescriptorProto {
'name'?: (string);
'extendee'?: (string);
'number'?: (number);
'label'?: (_google_protobuf_FieldDescriptorProto_Label);
'type'?: (_google_protobuf_FieldDescriptorProto_Type);
'typeName'?: (string);
'defaultValue'?: (string);
'options'?: (_google_protobuf_FieldOptions | null);
'oneofIndex'?: (number);
'jsonName'?: (string);
'proto3Optional'?: (boolean);
}
export interface FieldDescriptorProto__Output {
'name': (string);
'extendee': (string);
'number': (number);
'label': (_google_protobuf_FieldDescriptorProto_Label__Output);
'type': (_google_protobuf_FieldDescriptorProto_Type__Output);
'typeName': (string);
'defaultValue': (string);
'options': (_google_protobuf_FieldOptions__Output | null);
'oneofIndex': (number);
'jsonName': (string);
'proto3Optional': (boolean);
}

View File

@ -0,0 +1,165 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from '../../validate/FieldRules';
import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from '../../google/protobuf/Edition';
// Original file: null
export const _google_protobuf_FieldOptions_CType = {
STRING: 'STRING',
CORD: 'CORD',
STRING_PIECE: 'STRING_PIECE',
} as const;
export type _google_protobuf_FieldOptions_CType =
| 'STRING'
| 0
| 'CORD'
| 1
| 'STRING_PIECE'
| 2
export type _google_protobuf_FieldOptions_CType__Output = typeof _google_protobuf_FieldOptions_CType[keyof typeof _google_protobuf_FieldOptions_CType]
export interface _google_protobuf_FieldOptions_EditionDefault {
'edition'?: (_google_protobuf_Edition);
'value'?: (string);
}
export interface _google_protobuf_FieldOptions_EditionDefault__Output {
'edition': (_google_protobuf_Edition__Output);
'value': (string);
}
export interface _google_protobuf_FieldOptions_FeatureSupport {
'editionIntroduced'?: (_google_protobuf_Edition);
'editionDeprecated'?: (_google_protobuf_Edition);
'deprecationWarning'?: (string);
'editionRemoved'?: (_google_protobuf_Edition);
}
export interface _google_protobuf_FieldOptions_FeatureSupport__Output {
'editionIntroduced': (_google_protobuf_Edition__Output);
'editionDeprecated': (_google_protobuf_Edition__Output);
'deprecationWarning': (string);
'editionRemoved': (_google_protobuf_Edition__Output);
}
// Original file: null
export const _google_protobuf_FieldOptions_JSType = {
JS_NORMAL: 'JS_NORMAL',
JS_STRING: 'JS_STRING',
JS_NUMBER: 'JS_NUMBER',
} as const;
export type _google_protobuf_FieldOptions_JSType =
| 'JS_NORMAL'
| 0
| 'JS_STRING'
| 1
| 'JS_NUMBER'
| 2
export type _google_protobuf_FieldOptions_JSType__Output = typeof _google_protobuf_FieldOptions_JSType[keyof typeof _google_protobuf_FieldOptions_JSType]
// Original file: null
export const _google_protobuf_FieldOptions_OptionRetention = {
RETENTION_UNKNOWN: 'RETENTION_UNKNOWN',
RETENTION_RUNTIME: 'RETENTION_RUNTIME',
RETENTION_SOURCE: 'RETENTION_SOURCE',
} as const;
export type _google_protobuf_FieldOptions_OptionRetention =
| 'RETENTION_UNKNOWN'
| 0
| 'RETENTION_RUNTIME'
| 1
| 'RETENTION_SOURCE'
| 2
export type _google_protobuf_FieldOptions_OptionRetention__Output = typeof _google_protobuf_FieldOptions_OptionRetention[keyof typeof _google_protobuf_FieldOptions_OptionRetention]
// Original file: null
export const _google_protobuf_FieldOptions_OptionTargetType = {
TARGET_TYPE_UNKNOWN: 'TARGET_TYPE_UNKNOWN',
TARGET_TYPE_FILE: 'TARGET_TYPE_FILE',
TARGET_TYPE_EXTENSION_RANGE: 'TARGET_TYPE_EXTENSION_RANGE',
TARGET_TYPE_MESSAGE: 'TARGET_TYPE_MESSAGE',
TARGET_TYPE_FIELD: 'TARGET_TYPE_FIELD',
TARGET_TYPE_ONEOF: 'TARGET_TYPE_ONEOF',
TARGET_TYPE_ENUM: 'TARGET_TYPE_ENUM',
TARGET_TYPE_ENUM_ENTRY: 'TARGET_TYPE_ENUM_ENTRY',
TARGET_TYPE_SERVICE: 'TARGET_TYPE_SERVICE',
TARGET_TYPE_METHOD: 'TARGET_TYPE_METHOD',
} as const;
export type _google_protobuf_FieldOptions_OptionTargetType =
| 'TARGET_TYPE_UNKNOWN'
| 0
| 'TARGET_TYPE_FILE'
| 1
| 'TARGET_TYPE_EXTENSION_RANGE'
| 2
| 'TARGET_TYPE_MESSAGE'
| 3
| 'TARGET_TYPE_FIELD'
| 4
| 'TARGET_TYPE_ONEOF'
| 5
| 'TARGET_TYPE_ENUM'
| 6
| 'TARGET_TYPE_ENUM_ENTRY'
| 7
| 'TARGET_TYPE_SERVICE'
| 8
| 'TARGET_TYPE_METHOD'
| 9
export type _google_protobuf_FieldOptions_OptionTargetType__Output = typeof _google_protobuf_FieldOptions_OptionTargetType[keyof typeof _google_protobuf_FieldOptions_OptionTargetType]
export interface FieldOptions {
'ctype'?: (_google_protobuf_FieldOptions_CType);
'packed'?: (boolean);
'deprecated'?: (boolean);
'lazy'?: (boolean);
'jstype'?: (_google_protobuf_FieldOptions_JSType);
/**
* @deprecated
*/
'weak'?: (boolean);
'unverifiedLazy'?: (boolean);
'debugRedact'?: (boolean);
'retention'?: (_google_protobuf_FieldOptions_OptionRetention);
'targets'?: (_google_protobuf_FieldOptions_OptionTargetType)[];
'editionDefaults'?: (_google_protobuf_FieldOptions_EditionDefault)[];
'features'?: (_google_protobuf_FeatureSet | null);
'featureSupport'?: (_google_protobuf_FieldOptions_FeatureSupport | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
'.validate.rules'?: (_validate_FieldRules | null);
}
export interface FieldOptions__Output {
'ctype': (_google_protobuf_FieldOptions_CType__Output);
'packed': (boolean);
'deprecated': (boolean);
'lazy': (boolean);
'jstype': (_google_protobuf_FieldOptions_JSType__Output);
/**
* @deprecated
*/
'weak': (boolean);
'unverifiedLazy': (boolean);
'debugRedact': (boolean);
'retention': (_google_protobuf_FieldOptions_OptionRetention__Output);
'targets': (_google_protobuf_FieldOptions_OptionTargetType__Output)[];
'editionDefaults': (_google_protobuf_FieldOptions_EditionDefault__Output)[];
'features': (_google_protobuf_FeatureSet__Output | null);
'featureSupport': (_google_protobuf_FieldOptions_FeatureSupport__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
'.validate.rules': (_validate_FieldRules__Output | null);
}

View File

@ -0,0 +1,43 @@
// Original file: null
import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from '../../google/protobuf/DescriptorProto';
import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from '../../google/protobuf/EnumDescriptorProto';
import type { ServiceDescriptorProto as _google_protobuf_ServiceDescriptorProto, ServiceDescriptorProto__Output as _google_protobuf_ServiceDescriptorProto__Output } from '../../google/protobuf/ServiceDescriptorProto';
import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from '../../google/protobuf/FieldDescriptorProto';
import type { FileOptions as _google_protobuf_FileOptions, FileOptions__Output as _google_protobuf_FileOptions__Output } from '../../google/protobuf/FileOptions';
import type { SourceCodeInfo as _google_protobuf_SourceCodeInfo, SourceCodeInfo__Output as _google_protobuf_SourceCodeInfo__Output } from '../../google/protobuf/SourceCodeInfo';
import type { Edition as _google_protobuf_Edition, Edition__Output as _google_protobuf_Edition__Output } from '../../google/protobuf/Edition';
export interface FileDescriptorProto {
'name'?: (string);
'package'?: (string);
'dependency'?: (string)[];
'messageType'?: (_google_protobuf_DescriptorProto)[];
'enumType'?: (_google_protobuf_EnumDescriptorProto)[];
'service'?: (_google_protobuf_ServiceDescriptorProto)[];
'extension'?: (_google_protobuf_FieldDescriptorProto)[];
'options'?: (_google_protobuf_FileOptions | null);
'sourceCodeInfo'?: (_google_protobuf_SourceCodeInfo | null);
'publicDependency'?: (number)[];
'weakDependency'?: (number)[];
'syntax'?: (string);
'edition'?: (_google_protobuf_Edition);
'optionDependency'?: (string)[];
}
export interface FileDescriptorProto__Output {
'name': (string);
'package': (string);
'dependency': (string)[];
'messageType': (_google_protobuf_DescriptorProto__Output)[];
'enumType': (_google_protobuf_EnumDescriptorProto__Output)[];
'service': (_google_protobuf_ServiceDescriptorProto__Output)[];
'extension': (_google_protobuf_FieldDescriptorProto__Output)[];
'options': (_google_protobuf_FileOptions__Output | null);
'sourceCodeInfo': (_google_protobuf_SourceCodeInfo__Output | null);
'publicDependency': (number)[];
'weakDependency': (number)[];
'syntax': (string);
'edition': (_google_protobuf_Edition__Output);
'optionDependency': (string)[];
}

View File

@ -0,0 +1,11 @@
// Original file: null
import type { FileDescriptorProto as _google_protobuf_FileDescriptorProto, FileDescriptorProto__Output as _google_protobuf_FileDescriptorProto__Output } from '../../google/protobuf/FileDescriptorProto';
export interface FileDescriptorSet {
'file'?: (_google_protobuf_FileDescriptorProto)[];
}
export interface FileDescriptorSet__Output {
'file': (_google_protobuf_FileDescriptorProto__Output)[];
}

View File

@ -0,0 +1,76 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
// Original file: null
export const _google_protobuf_FileOptions_OptimizeMode = {
SPEED: 'SPEED',
CODE_SIZE: 'CODE_SIZE',
LITE_RUNTIME: 'LITE_RUNTIME',
} as const;
export type _google_protobuf_FileOptions_OptimizeMode =
| 'SPEED'
| 1
| 'CODE_SIZE'
| 2
| 'LITE_RUNTIME'
| 3
export type _google_protobuf_FileOptions_OptimizeMode__Output = typeof _google_protobuf_FileOptions_OptimizeMode[keyof typeof _google_protobuf_FileOptions_OptimizeMode]
export interface FileOptions {
'javaPackage'?: (string);
'javaOuterClassname'?: (string);
'optimizeFor'?: (_google_protobuf_FileOptions_OptimizeMode);
'javaMultipleFiles'?: (boolean);
'goPackage'?: (string);
'ccGenericServices'?: (boolean);
'javaGenericServices'?: (boolean);
'pyGenericServices'?: (boolean);
/**
* @deprecated
*/
'javaGenerateEqualsAndHash'?: (boolean);
'deprecated'?: (boolean);
'javaStringCheckUtf8'?: (boolean);
'ccEnableArenas'?: (boolean);
'objcClassPrefix'?: (string);
'csharpNamespace'?: (string);
'swiftPrefix'?: (string);
'phpClassPrefix'?: (string);
'phpNamespace'?: (string);
'phpMetadataNamespace'?: (string);
'rubyPackage'?: (string);
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
}
export interface FileOptions__Output {
'javaPackage': (string);
'javaOuterClassname': (string);
'optimizeFor': (_google_protobuf_FileOptions_OptimizeMode__Output);
'javaMultipleFiles': (boolean);
'goPackage': (string);
'ccGenericServices': (boolean);
'javaGenericServices': (boolean);
'pyGenericServices': (boolean);
/**
* @deprecated
*/
'javaGenerateEqualsAndHash': (boolean);
'deprecated': (boolean);
'javaStringCheckUtf8': (boolean);
'ccEnableArenas': (boolean);
'objcClassPrefix': (string);
'csharpNamespace': (string);
'swiftPrefix': (string);
'phpClassPrefix': (string);
'phpNamespace': (string);
'phpMetadataNamespace': (string);
'rubyPackage': (string);
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
}

View File

@ -0,0 +1,44 @@
// Original file: null
export interface _google_protobuf_GeneratedCodeInfo_Annotation {
'path'?: (number)[];
'sourceFile'?: (string);
'begin'?: (number);
'end'?: (number);
'semantic'?: (_google_protobuf_GeneratedCodeInfo_Annotation_Semantic);
}
export interface _google_protobuf_GeneratedCodeInfo_Annotation__Output {
'path': (number)[];
'sourceFile': (string);
'begin': (number);
'end': (number);
'semantic': (_google_protobuf_GeneratedCodeInfo_Annotation_Semantic__Output);
}
// Original file: null
export const _google_protobuf_GeneratedCodeInfo_Annotation_Semantic = {
NONE: 'NONE',
SET: 'SET',
ALIAS: 'ALIAS',
} as const;
export type _google_protobuf_GeneratedCodeInfo_Annotation_Semantic =
| 'NONE'
| 0
| 'SET'
| 1
| 'ALIAS'
| 2
export type _google_protobuf_GeneratedCodeInfo_Annotation_Semantic__Output = typeof _google_protobuf_GeneratedCodeInfo_Annotation_Semantic[keyof typeof _google_protobuf_GeneratedCodeInfo_Annotation_Semantic]
export interface GeneratedCodeInfo {
'annotation'?: (_google_protobuf_GeneratedCodeInfo_Annotation)[];
}
export interface GeneratedCodeInfo__Output {
'annotation': (_google_protobuf_GeneratedCodeInfo_Annotation__Output)[];
}

View File

@ -0,0 +1,32 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
export interface MessageOptions {
'messageSetWireFormat'?: (boolean);
'noStandardDescriptorAccessor'?: (boolean);
'deprecated'?: (boolean);
'mapEntry'?: (boolean);
/**
* @deprecated
*/
'deprecatedLegacyJsonFieldConflicts'?: (boolean);
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
'.validate.disabled'?: (boolean);
}
export interface MessageOptions__Output {
'messageSetWireFormat': (boolean);
'noStandardDescriptorAccessor': (boolean);
'deprecated': (boolean);
'mapEntry': (boolean);
/**
* @deprecated
*/
'deprecatedLegacyJsonFieldConflicts': (boolean);
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
'.validate.disabled': (boolean);
}

View File

@ -0,0 +1,21 @@
// Original file: null
import type { MethodOptions as _google_protobuf_MethodOptions, MethodOptions__Output as _google_protobuf_MethodOptions__Output } from '../../google/protobuf/MethodOptions';
export interface MethodDescriptorProto {
'name'?: (string);
'inputType'?: (string);
'outputType'?: (string);
'options'?: (_google_protobuf_MethodOptions | null);
'clientStreaming'?: (boolean);
'serverStreaming'?: (boolean);
}
export interface MethodDescriptorProto__Output {
'name': (string);
'inputType': (string);
'outputType': (string);
'options': (_google_protobuf_MethodOptions__Output | null);
'clientStreaming': (boolean);
'serverStreaming': (boolean);
}

View File

@ -0,0 +1,36 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
// Original file: null
export const _google_protobuf_MethodOptions_IdempotencyLevel = {
IDEMPOTENCY_UNKNOWN: 'IDEMPOTENCY_UNKNOWN',
NO_SIDE_EFFECTS: 'NO_SIDE_EFFECTS',
IDEMPOTENT: 'IDEMPOTENT',
} as const;
export type _google_protobuf_MethodOptions_IdempotencyLevel =
| 'IDEMPOTENCY_UNKNOWN'
| 0
| 'NO_SIDE_EFFECTS'
| 1
| 'IDEMPOTENT'
| 2
export type _google_protobuf_MethodOptions_IdempotencyLevel__Output = typeof _google_protobuf_MethodOptions_IdempotencyLevel[keyof typeof _google_protobuf_MethodOptions_IdempotencyLevel]
export interface MethodOptions {
'deprecated'?: (boolean);
'idempotencyLevel'?: (_google_protobuf_MethodOptions_IdempotencyLevel);
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
}
export interface MethodOptions__Output {
'deprecated': (boolean);
'idempotencyLevel': (_google_protobuf_MethodOptions_IdempotencyLevel__Output);
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
}

View File

@ -0,0 +1,13 @@
// Original file: null
import type { OneofOptions as _google_protobuf_OneofOptions, OneofOptions__Output as _google_protobuf_OneofOptions__Output } from '../../google/protobuf/OneofOptions';
export interface OneofDescriptorProto {
'name'?: (string);
'options'?: (_google_protobuf_OneofOptions | null);
}
export interface OneofDescriptorProto__Output {
'name': (string);
'options': (_google_protobuf_OneofOptions__Output | null);
}

View File

@ -0,0 +1,16 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
export interface OneofOptions {
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
'.validate.required'?: (boolean);
}
export interface OneofOptions__Output {
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
'.validate.required': (boolean);
}

View File

@ -0,0 +1,16 @@
// Original file: null
import type { MethodDescriptorProto as _google_protobuf_MethodDescriptorProto, MethodDescriptorProto__Output as _google_protobuf_MethodDescriptorProto__Output } from '../../google/protobuf/MethodDescriptorProto';
import type { ServiceOptions as _google_protobuf_ServiceOptions, ServiceOptions__Output as _google_protobuf_ServiceOptions__Output } from '../../google/protobuf/ServiceOptions';
export interface ServiceDescriptorProto {
'name'?: (string);
'method'?: (_google_protobuf_MethodDescriptorProto)[];
'options'?: (_google_protobuf_ServiceOptions | null);
}
export interface ServiceDescriptorProto__Output {
'name': (string);
'method': (_google_protobuf_MethodDescriptorProto__Output)[];
'options': (_google_protobuf_ServiceOptions__Output | null);
}

View File

@ -0,0 +1,16 @@
// Original file: null
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from '../../google/protobuf/FeatureSet';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from '../../google/protobuf/UninterpretedOption';
export interface ServiceOptions {
'deprecated'?: (boolean);
'features'?: (_google_protobuf_FeatureSet | null);
'uninterpretedOption'?: (_google_protobuf_UninterpretedOption)[];
}
export interface ServiceOptions__Output {
'deprecated': (boolean);
'features': (_google_protobuf_FeatureSet__Output | null);
'uninterpretedOption': (_google_protobuf_UninterpretedOption__Output)[];
}

View File

@ -0,0 +1,26 @@
// Original file: null
export interface _google_protobuf_SourceCodeInfo_Location {
'path'?: (number)[];
'span'?: (number)[];
'leadingComments'?: (string);
'trailingComments'?: (string);
'leadingDetachedComments'?: (string)[];
}
export interface _google_protobuf_SourceCodeInfo_Location__Output {
'path': (number)[];
'span': (number)[];
'leadingComments': (string);
'trailingComments': (string);
'leadingDetachedComments': (string)[];
}
export interface SourceCodeInfo {
'location'?: (_google_protobuf_SourceCodeInfo_Location)[];
}
export interface SourceCodeInfo__Output {
'location': (_google_protobuf_SourceCodeInfo_Location__Output)[];
}

View File

@ -0,0 +1,17 @@
// Original file: null
export const SymbolVisibility = {
VISIBILITY_UNSET: 'VISIBILITY_UNSET',
VISIBILITY_LOCAL: 'VISIBILITY_LOCAL',
VISIBILITY_EXPORT: 'VISIBILITY_EXPORT',
} as const;
export type SymbolVisibility =
| 'VISIBILITY_UNSET'
| 0
| 'VISIBILITY_LOCAL'
| 1
| 'VISIBILITY_EXPORT'
| 2
export type SymbolVisibility__Output = typeof SymbolVisibility[keyof typeof SymbolVisibility]

View File

@ -0,0 +1,33 @@
// Original file: null
import type { Long } from '@grpc/proto-loader';
export interface _google_protobuf_UninterpretedOption_NamePart {
'namePart'?: (string);
'isExtension'?: (boolean);
}
export interface _google_protobuf_UninterpretedOption_NamePart__Output {
'namePart': (string);
'isExtension': (boolean);
}
export interface UninterpretedOption {
'name'?: (_google_protobuf_UninterpretedOption_NamePart)[];
'identifierValue'?: (string);
'positiveIntValue'?: (number | string | Long);
'negativeIntValue'?: (number | string | Long);
'doubleValue'?: (number | string);
'stringValue'?: (Buffer | Uint8Array | string);
'aggregateValue'?: (string);
}
export interface UninterpretedOption__Output {
'name': (_google_protobuf_UninterpretedOption_NamePart__Output)[];
'identifierValue': (string);
'positiveIntValue': (string);
'negativeIntValue': (string);
'doubleValue': (number);
'stringValue': (Buffer);
'aggregateValue': (string);
}

View File

@ -0,0 +1,146 @@
import type * as grpc from '../index';
import type { EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader';
import type { DescriptorProto as _google_protobuf_DescriptorProto, DescriptorProto__Output as _google_protobuf_DescriptorProto__Output } from './google/protobuf/DescriptorProto';
import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from './google/protobuf/Duration';
import type { EnumDescriptorProto as _google_protobuf_EnumDescriptorProto, EnumDescriptorProto__Output as _google_protobuf_EnumDescriptorProto__Output } from './google/protobuf/EnumDescriptorProto';
import type { EnumOptions as _google_protobuf_EnumOptions, EnumOptions__Output as _google_protobuf_EnumOptions__Output } from './google/protobuf/EnumOptions';
import type { EnumValueDescriptorProto as _google_protobuf_EnumValueDescriptorProto, EnumValueDescriptorProto__Output as _google_protobuf_EnumValueDescriptorProto__Output } from './google/protobuf/EnumValueDescriptorProto';
import type { EnumValueOptions as _google_protobuf_EnumValueOptions, EnumValueOptions__Output as _google_protobuf_EnumValueOptions__Output } from './google/protobuf/EnumValueOptions';
import type { ExtensionRangeOptions as _google_protobuf_ExtensionRangeOptions, ExtensionRangeOptions__Output as _google_protobuf_ExtensionRangeOptions__Output } from './google/protobuf/ExtensionRangeOptions';
import type { FeatureSet as _google_protobuf_FeatureSet, FeatureSet__Output as _google_protobuf_FeatureSet__Output } from './google/protobuf/FeatureSet';
import type { FeatureSetDefaults as _google_protobuf_FeatureSetDefaults, FeatureSetDefaults__Output as _google_protobuf_FeatureSetDefaults__Output } from './google/protobuf/FeatureSetDefaults';
import type { FieldDescriptorProto as _google_protobuf_FieldDescriptorProto, FieldDescriptorProto__Output as _google_protobuf_FieldDescriptorProto__Output } from './google/protobuf/FieldDescriptorProto';
import type { FieldOptions as _google_protobuf_FieldOptions, FieldOptions__Output as _google_protobuf_FieldOptions__Output } from './google/protobuf/FieldOptions';
import type { FileDescriptorProto as _google_protobuf_FileDescriptorProto, FileDescriptorProto__Output as _google_protobuf_FileDescriptorProto__Output } from './google/protobuf/FileDescriptorProto';
import type { FileDescriptorSet as _google_protobuf_FileDescriptorSet, FileDescriptorSet__Output as _google_protobuf_FileDescriptorSet__Output } from './google/protobuf/FileDescriptorSet';
import type { FileOptions as _google_protobuf_FileOptions, FileOptions__Output as _google_protobuf_FileOptions__Output } from './google/protobuf/FileOptions';
import type { GeneratedCodeInfo as _google_protobuf_GeneratedCodeInfo, GeneratedCodeInfo__Output as _google_protobuf_GeneratedCodeInfo__Output } from './google/protobuf/GeneratedCodeInfo';
import type { MessageOptions as _google_protobuf_MessageOptions, MessageOptions__Output as _google_protobuf_MessageOptions__Output } from './google/protobuf/MessageOptions';
import type { MethodDescriptorProto as _google_protobuf_MethodDescriptorProto, MethodDescriptorProto__Output as _google_protobuf_MethodDescriptorProto__Output } from './google/protobuf/MethodDescriptorProto';
import type { MethodOptions as _google_protobuf_MethodOptions, MethodOptions__Output as _google_protobuf_MethodOptions__Output } from './google/protobuf/MethodOptions';
import type { OneofDescriptorProto as _google_protobuf_OneofDescriptorProto, OneofDescriptorProto__Output as _google_protobuf_OneofDescriptorProto__Output } from './google/protobuf/OneofDescriptorProto';
import type { OneofOptions as _google_protobuf_OneofOptions, OneofOptions__Output as _google_protobuf_OneofOptions__Output } from './google/protobuf/OneofOptions';
import type { ServiceDescriptorProto as _google_protobuf_ServiceDescriptorProto, ServiceDescriptorProto__Output as _google_protobuf_ServiceDescriptorProto__Output } from './google/protobuf/ServiceDescriptorProto';
import type { ServiceOptions as _google_protobuf_ServiceOptions, ServiceOptions__Output as _google_protobuf_ServiceOptions__Output } from './google/protobuf/ServiceOptions';
import type { SourceCodeInfo as _google_protobuf_SourceCodeInfo, SourceCodeInfo__Output as _google_protobuf_SourceCodeInfo__Output } from './google/protobuf/SourceCodeInfo';
import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from './google/protobuf/Timestamp';
import type { UninterpretedOption as _google_protobuf_UninterpretedOption, UninterpretedOption__Output as _google_protobuf_UninterpretedOption__Output } from './google/protobuf/UninterpretedOption';
import type { AnyRules as _validate_AnyRules, AnyRules__Output as _validate_AnyRules__Output } from './validate/AnyRules';
import type { BoolRules as _validate_BoolRules, BoolRules__Output as _validate_BoolRules__Output } from './validate/BoolRules';
import type { BytesRules as _validate_BytesRules, BytesRules__Output as _validate_BytesRules__Output } from './validate/BytesRules';
import type { DoubleRules as _validate_DoubleRules, DoubleRules__Output as _validate_DoubleRules__Output } from './validate/DoubleRules';
import type { DurationRules as _validate_DurationRules, DurationRules__Output as _validate_DurationRules__Output } from './validate/DurationRules';
import type { EnumRules as _validate_EnumRules, EnumRules__Output as _validate_EnumRules__Output } from './validate/EnumRules';
import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from './validate/FieldRules';
import type { Fixed32Rules as _validate_Fixed32Rules, Fixed32Rules__Output as _validate_Fixed32Rules__Output } from './validate/Fixed32Rules';
import type { Fixed64Rules as _validate_Fixed64Rules, Fixed64Rules__Output as _validate_Fixed64Rules__Output } from './validate/Fixed64Rules';
import type { FloatRules as _validate_FloatRules, FloatRules__Output as _validate_FloatRules__Output } from './validate/FloatRules';
import type { Int32Rules as _validate_Int32Rules, Int32Rules__Output as _validate_Int32Rules__Output } from './validate/Int32Rules';
import type { Int64Rules as _validate_Int64Rules, Int64Rules__Output as _validate_Int64Rules__Output } from './validate/Int64Rules';
import type { MapRules as _validate_MapRules, MapRules__Output as _validate_MapRules__Output } from './validate/MapRules';
import type { MessageRules as _validate_MessageRules, MessageRules__Output as _validate_MessageRules__Output } from './validate/MessageRules';
import type { RepeatedRules as _validate_RepeatedRules, RepeatedRules__Output as _validate_RepeatedRules__Output } from './validate/RepeatedRules';
import type { SFixed32Rules as _validate_SFixed32Rules, SFixed32Rules__Output as _validate_SFixed32Rules__Output } from './validate/SFixed32Rules';
import type { SFixed64Rules as _validate_SFixed64Rules, SFixed64Rules__Output as _validate_SFixed64Rules__Output } from './validate/SFixed64Rules';
import type { SInt32Rules as _validate_SInt32Rules, SInt32Rules__Output as _validate_SInt32Rules__Output } from './validate/SInt32Rules';
import type { SInt64Rules as _validate_SInt64Rules, SInt64Rules__Output as _validate_SInt64Rules__Output } from './validate/SInt64Rules';
import type { StringRules as _validate_StringRules, StringRules__Output as _validate_StringRules__Output } from './validate/StringRules';
import type { TimestampRules as _validate_TimestampRules, TimestampRules__Output as _validate_TimestampRules__Output } from './validate/TimestampRules';
import type { UInt32Rules as _validate_UInt32Rules, UInt32Rules__Output as _validate_UInt32Rules__Output } from './validate/UInt32Rules';
import type { UInt64Rules as _validate_UInt64Rules, UInt64Rules__Output as _validate_UInt64Rules__Output } from './validate/UInt64Rules';
import type { OrcaLoadReport as _xds_data_orca_v3_OrcaLoadReport, OrcaLoadReport__Output as _xds_data_orca_v3_OrcaLoadReport__Output } from './xds/data/orca/v3/OrcaLoadReport';
import type { OpenRcaServiceClient as _xds_service_orca_v3_OpenRcaServiceClient, OpenRcaServiceDefinition as _xds_service_orca_v3_OpenRcaServiceDefinition } from './xds/service/orca/v3/OpenRcaService';
import type { OrcaLoadReportRequest as _xds_service_orca_v3_OrcaLoadReportRequest, OrcaLoadReportRequest__Output as _xds_service_orca_v3_OrcaLoadReportRequest__Output } from './xds/service/orca/v3/OrcaLoadReportRequest';
type SubtypeConstructor<Constructor extends new (...args: any) => any, Subtype> = {
new(...args: ConstructorParameters<Constructor>): Subtype;
};
export interface ProtoGrpcType {
google: {
protobuf: {
DescriptorProto: MessageTypeDefinition<_google_protobuf_DescriptorProto, _google_protobuf_DescriptorProto__Output>
Duration: MessageTypeDefinition<_google_protobuf_Duration, _google_protobuf_Duration__Output>
Edition: EnumTypeDefinition
EnumDescriptorProto: MessageTypeDefinition<_google_protobuf_EnumDescriptorProto, _google_protobuf_EnumDescriptorProto__Output>
EnumOptions: MessageTypeDefinition<_google_protobuf_EnumOptions, _google_protobuf_EnumOptions__Output>
EnumValueDescriptorProto: MessageTypeDefinition<_google_protobuf_EnumValueDescriptorProto, _google_protobuf_EnumValueDescriptorProto__Output>
EnumValueOptions: MessageTypeDefinition<_google_protobuf_EnumValueOptions, _google_protobuf_EnumValueOptions__Output>
ExtensionRangeOptions: MessageTypeDefinition<_google_protobuf_ExtensionRangeOptions, _google_protobuf_ExtensionRangeOptions__Output>
FeatureSet: MessageTypeDefinition<_google_protobuf_FeatureSet, _google_protobuf_FeatureSet__Output>
FeatureSetDefaults: MessageTypeDefinition<_google_protobuf_FeatureSetDefaults, _google_protobuf_FeatureSetDefaults__Output>
FieldDescriptorProto: MessageTypeDefinition<_google_protobuf_FieldDescriptorProto, _google_protobuf_FieldDescriptorProto__Output>
FieldOptions: MessageTypeDefinition<_google_protobuf_FieldOptions, _google_protobuf_FieldOptions__Output>
FileDescriptorProto: MessageTypeDefinition<_google_protobuf_FileDescriptorProto, _google_protobuf_FileDescriptorProto__Output>
FileDescriptorSet: MessageTypeDefinition<_google_protobuf_FileDescriptorSet, _google_protobuf_FileDescriptorSet__Output>
FileOptions: MessageTypeDefinition<_google_protobuf_FileOptions, _google_protobuf_FileOptions__Output>
GeneratedCodeInfo: MessageTypeDefinition<_google_protobuf_GeneratedCodeInfo, _google_protobuf_GeneratedCodeInfo__Output>
MessageOptions: MessageTypeDefinition<_google_protobuf_MessageOptions, _google_protobuf_MessageOptions__Output>
MethodDescriptorProto: MessageTypeDefinition<_google_protobuf_MethodDescriptorProto, _google_protobuf_MethodDescriptorProto__Output>
MethodOptions: MessageTypeDefinition<_google_protobuf_MethodOptions, _google_protobuf_MethodOptions__Output>
OneofDescriptorProto: MessageTypeDefinition<_google_protobuf_OneofDescriptorProto, _google_protobuf_OneofDescriptorProto__Output>
OneofOptions: MessageTypeDefinition<_google_protobuf_OneofOptions, _google_protobuf_OneofOptions__Output>
ServiceDescriptorProto: MessageTypeDefinition<_google_protobuf_ServiceDescriptorProto, _google_protobuf_ServiceDescriptorProto__Output>
ServiceOptions: MessageTypeDefinition<_google_protobuf_ServiceOptions, _google_protobuf_ServiceOptions__Output>
SourceCodeInfo: MessageTypeDefinition<_google_protobuf_SourceCodeInfo, _google_protobuf_SourceCodeInfo__Output>
SymbolVisibility: EnumTypeDefinition
Timestamp: MessageTypeDefinition<_google_protobuf_Timestamp, _google_protobuf_Timestamp__Output>
UninterpretedOption: MessageTypeDefinition<_google_protobuf_UninterpretedOption, _google_protobuf_UninterpretedOption__Output>
}
}
validate: {
AnyRules: MessageTypeDefinition<_validate_AnyRules, _validate_AnyRules__Output>
BoolRules: MessageTypeDefinition<_validate_BoolRules, _validate_BoolRules__Output>
BytesRules: MessageTypeDefinition<_validate_BytesRules, _validate_BytesRules__Output>
DoubleRules: MessageTypeDefinition<_validate_DoubleRules, _validate_DoubleRules__Output>
DurationRules: MessageTypeDefinition<_validate_DurationRules, _validate_DurationRules__Output>
EnumRules: MessageTypeDefinition<_validate_EnumRules, _validate_EnumRules__Output>
FieldRules: MessageTypeDefinition<_validate_FieldRules, _validate_FieldRules__Output>
Fixed32Rules: MessageTypeDefinition<_validate_Fixed32Rules, _validate_Fixed32Rules__Output>
Fixed64Rules: MessageTypeDefinition<_validate_Fixed64Rules, _validate_Fixed64Rules__Output>
FloatRules: MessageTypeDefinition<_validate_FloatRules, _validate_FloatRules__Output>
Int32Rules: MessageTypeDefinition<_validate_Int32Rules, _validate_Int32Rules__Output>
Int64Rules: MessageTypeDefinition<_validate_Int64Rules, _validate_Int64Rules__Output>
KnownRegex: EnumTypeDefinition
MapRules: MessageTypeDefinition<_validate_MapRules, _validate_MapRules__Output>
MessageRules: MessageTypeDefinition<_validate_MessageRules, _validate_MessageRules__Output>
RepeatedRules: MessageTypeDefinition<_validate_RepeatedRules, _validate_RepeatedRules__Output>
SFixed32Rules: MessageTypeDefinition<_validate_SFixed32Rules, _validate_SFixed32Rules__Output>
SFixed64Rules: MessageTypeDefinition<_validate_SFixed64Rules, _validate_SFixed64Rules__Output>
SInt32Rules: MessageTypeDefinition<_validate_SInt32Rules, _validate_SInt32Rules__Output>
SInt64Rules: MessageTypeDefinition<_validate_SInt64Rules, _validate_SInt64Rules__Output>
StringRules: MessageTypeDefinition<_validate_StringRules, _validate_StringRules__Output>
TimestampRules: MessageTypeDefinition<_validate_TimestampRules, _validate_TimestampRules__Output>
UInt32Rules: MessageTypeDefinition<_validate_UInt32Rules, _validate_UInt32Rules__Output>
UInt64Rules: MessageTypeDefinition<_validate_UInt64Rules, _validate_UInt64Rules__Output>
}
xds: {
data: {
orca: {
v3: {
OrcaLoadReport: MessageTypeDefinition<_xds_data_orca_v3_OrcaLoadReport, _xds_data_orca_v3_OrcaLoadReport__Output>
}
}
}
service: {
orca: {
v3: {
/**
* Out-of-band (OOB) load reporting service for the additional load reporting
* agent that does not sit in the request path. Reports are periodically sampled
* with sufficient frequency to provide temporal association with requests.
* OOB reporting compensates the limitation of in-band reporting in revealing
* costs for backends that do not provide a steady stream of telemetry such as
* long running stream operations and zero QPS services. This is a server
* streaming service, client needs to terminate current RPC and initiate
* a new call to change backend reporting frequency.
*/
OpenRcaService: SubtypeConstructor<typeof grpc.Client, _xds_service_orca_v3_OpenRcaServiceClient> & { service: _xds_service_orca_v3_OpenRcaServiceDefinition }
OrcaLoadReportRequest: MessageTypeDefinition<_xds_service_orca_v3_OrcaLoadReportRequest, _xds_service_orca_v3_OrcaLoadReportRequest__Output>
}
}
}
}
}

View File

@ -0,0 +1,44 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* AnyRules describe constraints applied exclusively to the
* `google.protobuf.Any` well-known type
*/
export interface AnyRules {
/**
* Required specifies that this field must be set
*/
'required'?: (boolean);
/**
* In specifies that this field's `type_url` must be equal to one of the
* specified values.
*/
'in'?: (string)[];
/**
* NotIn specifies that this field's `type_url` must not be equal to any of
* the specified values.
*/
'not_in'?: (string)[];
}
/**
* AnyRules describe constraints applied exclusively to the
* `google.protobuf.Any` well-known type
*/
export interface AnyRules__Output {
/**
* Required specifies that this field must be set
*/
'required': (boolean);
/**
* In specifies that this field's `type_url` must be equal to one of the
* specified values.
*/
'in': (string)[];
/**
* NotIn specifies that this field's `type_url` must not be equal to any of
* the specified values.
*/
'not_in': (string)[];
}

View File

@ -0,0 +1,22 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* BoolRules describes the constraints applied to `bool` values
*/
export interface BoolRules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (boolean);
}
/**
* BoolRules describes the constraints applied to `bool` values
*/
export interface BoolRules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (boolean);
}

View File

@ -0,0 +1,153 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Long } from '@grpc/proto-loader';
/**
* BytesRules describe the constraints applied to `bytes` values
*/
export interface BytesRules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (Buffer | Uint8Array | string);
/**
* MinLen specifies that this field must be the specified number of bytes
* at a minimum
*/
'min_len'?: (number | string | Long);
/**
* MaxLen specifies that this field must be the specified number of bytes
* at a maximum
*/
'max_len'?: (number | string | Long);
/**
* Pattern specifes that this field must match against the specified
* regular expression (RE2 syntax). The included expression should elide
* any delimiters.
*/
'pattern'?: (string);
/**
* Prefix specifies that this field must have the specified bytes at the
* beginning of the string.
*/
'prefix'?: (Buffer | Uint8Array | string);
/**
* Suffix specifies that this field must have the specified bytes at the
* end of the string.
*/
'suffix'?: (Buffer | Uint8Array | string);
/**
* Contains specifies that this field must have the specified bytes
* anywhere in the string.
*/
'contains'?: (Buffer | Uint8Array | string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (Buffer | Uint8Array | string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (Buffer | Uint8Array | string)[];
/**
* Ip specifies that the field must be a valid IP (v4 or v6) address in
* byte format
*/
'ip'?: (boolean);
/**
* Ipv4 specifies that the field must be a valid IPv4 address in byte
* format
*/
'ipv4'?: (boolean);
/**
* Ipv6 specifies that the field must be a valid IPv6 address in byte
* format
*/
'ipv6'?: (boolean);
/**
* Len specifies that this field must be the specified number of bytes
*/
'len'?: (number | string | Long);
/**
* WellKnown rules provide advanced constraints against common byte
* patterns
*/
'well_known'?: "ip"|"ipv4"|"ipv6";
}
/**
* BytesRules describe the constraints applied to `bytes` values
*/
export interface BytesRules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (Buffer);
/**
* MinLen specifies that this field must be the specified number of bytes
* at a minimum
*/
'min_len': (string);
/**
* MaxLen specifies that this field must be the specified number of bytes
* at a maximum
*/
'max_len': (string);
/**
* Pattern specifes that this field must match against the specified
* regular expression (RE2 syntax). The included expression should elide
* any delimiters.
*/
'pattern': (string);
/**
* Prefix specifies that this field must have the specified bytes at the
* beginning of the string.
*/
'prefix': (Buffer);
/**
* Suffix specifies that this field must have the specified bytes at the
* end of the string.
*/
'suffix': (Buffer);
/**
* Contains specifies that this field must have the specified bytes
* anywhere in the string.
*/
'contains': (Buffer);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (Buffer)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (Buffer)[];
/**
* Ip specifies that the field must be a valid IP (v4 or v6) address in
* byte format
*/
'ip'?: (boolean);
/**
* Ipv4 specifies that the field must be a valid IPv4 address in byte
* format
*/
'ipv4'?: (boolean);
/**
* Ipv6 specifies that the field must be a valid IPv6 address in byte
* format
*/
'ipv6'?: (boolean);
/**
* Len specifies that this field must be the specified number of bytes
*/
'len': (string);
/**
* WellKnown rules provide advanced constraints against common byte
* patterns
*/
'well_known'?: "ip"|"ipv4"|"ipv6";
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* DoubleRules describes the constraints applied to `double` values
*/
export interface DoubleRules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string)[];
}
/**
* DoubleRules describes the constraints applied to `double` values
*/
export interface DoubleRules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,93 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../google/protobuf/Duration';
/**
* DurationRules describe the constraints applied exclusively to the
* `google.protobuf.Duration` well-known type
*/
export interface DurationRules {
/**
* Required specifies that this field must be set
*/
'required'?: (boolean);
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (_google_protobuf_Duration | null);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (_google_protobuf_Duration | null);
/**
* Lt specifies that this field must be less than the specified value,
* inclusive
*/
'lte'?: (_google_protobuf_Duration | null);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive
*/
'gt'?: (_google_protobuf_Duration | null);
/**
* Gte specifies that this field must be greater than the specified value,
* inclusive
*/
'gte'?: (_google_protobuf_Duration | null);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (_google_protobuf_Duration)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (_google_protobuf_Duration)[];
}
/**
* DurationRules describe the constraints applied exclusively to the
* `google.protobuf.Duration` well-known type
*/
export interface DurationRules__Output {
/**
* Required specifies that this field must be set
*/
'required': (boolean);
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (_google_protobuf_Duration__Output | null);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (_google_protobuf_Duration__Output | null);
/**
* Lt specifies that this field must be less than the specified value,
* inclusive
*/
'lte': (_google_protobuf_Duration__Output | null);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive
*/
'gt': (_google_protobuf_Duration__Output | null);
/**
* Gte specifies that this field must be greater than the specified value,
* inclusive
*/
'gte': (_google_protobuf_Duration__Output | null);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (_google_protobuf_Duration__Output)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (_google_protobuf_Duration__Output)[];
}

View File

@ -0,0 +1,52 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* EnumRules describe the constraints applied to enum values
*/
export interface EnumRules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number);
/**
* DefinedOnly specifies that this field must be only one of the defined
* values for this enum, failing on any undefined value.
*/
'defined_only'?: (boolean);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number)[];
}
/**
* EnumRules describe the constraints applied to enum values
*/
export interface EnumRules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* DefinedOnly specifies that this field must be only one of the defined
* values for this enum, failing on any undefined value.
*/
'defined_only': (boolean);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,102 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { FloatRules as _validate_FloatRules, FloatRules__Output as _validate_FloatRules__Output } from '../validate/FloatRules';
import type { DoubleRules as _validate_DoubleRules, DoubleRules__Output as _validate_DoubleRules__Output } from '../validate/DoubleRules';
import type { Int32Rules as _validate_Int32Rules, Int32Rules__Output as _validate_Int32Rules__Output } from '../validate/Int32Rules';
import type { Int64Rules as _validate_Int64Rules, Int64Rules__Output as _validate_Int64Rules__Output } from '../validate/Int64Rules';
import type { UInt32Rules as _validate_UInt32Rules, UInt32Rules__Output as _validate_UInt32Rules__Output } from '../validate/UInt32Rules';
import type { UInt64Rules as _validate_UInt64Rules, UInt64Rules__Output as _validate_UInt64Rules__Output } from '../validate/UInt64Rules';
import type { SInt32Rules as _validate_SInt32Rules, SInt32Rules__Output as _validate_SInt32Rules__Output } from '../validate/SInt32Rules';
import type { SInt64Rules as _validate_SInt64Rules, SInt64Rules__Output as _validate_SInt64Rules__Output } from '../validate/SInt64Rules';
import type { Fixed32Rules as _validate_Fixed32Rules, Fixed32Rules__Output as _validate_Fixed32Rules__Output } from '../validate/Fixed32Rules';
import type { Fixed64Rules as _validate_Fixed64Rules, Fixed64Rules__Output as _validate_Fixed64Rules__Output } from '../validate/Fixed64Rules';
import type { SFixed32Rules as _validate_SFixed32Rules, SFixed32Rules__Output as _validate_SFixed32Rules__Output } from '../validate/SFixed32Rules';
import type { SFixed64Rules as _validate_SFixed64Rules, SFixed64Rules__Output as _validate_SFixed64Rules__Output } from '../validate/SFixed64Rules';
import type { BoolRules as _validate_BoolRules, BoolRules__Output as _validate_BoolRules__Output } from '../validate/BoolRules';
import type { StringRules as _validate_StringRules, StringRules__Output as _validate_StringRules__Output } from '../validate/StringRules';
import type { BytesRules as _validate_BytesRules, BytesRules__Output as _validate_BytesRules__Output } from '../validate/BytesRules';
import type { EnumRules as _validate_EnumRules, EnumRules__Output as _validate_EnumRules__Output } from '../validate/EnumRules';
import type { MessageRules as _validate_MessageRules, MessageRules__Output as _validate_MessageRules__Output } from '../validate/MessageRules';
import type { RepeatedRules as _validate_RepeatedRules, RepeatedRules__Output as _validate_RepeatedRules__Output } from '../validate/RepeatedRules';
import type { MapRules as _validate_MapRules, MapRules__Output as _validate_MapRules__Output } from '../validate/MapRules';
import type { AnyRules as _validate_AnyRules, AnyRules__Output as _validate_AnyRules__Output } from '../validate/AnyRules';
import type { DurationRules as _validate_DurationRules, DurationRules__Output as _validate_DurationRules__Output } from '../validate/DurationRules';
import type { TimestampRules as _validate_TimestampRules, TimestampRules__Output as _validate_TimestampRules__Output } from '../validate/TimestampRules';
/**
* FieldRules encapsulates the rules for each type of field. Depending on the
* field, the correct set should be used to ensure proper validations.
*/
export interface FieldRules {
/**
* Scalar Field Types
*/
'float'?: (_validate_FloatRules | null);
'double'?: (_validate_DoubleRules | null);
'int32'?: (_validate_Int32Rules | null);
'int64'?: (_validate_Int64Rules | null);
'uint32'?: (_validate_UInt32Rules | null);
'uint64'?: (_validate_UInt64Rules | null);
'sint32'?: (_validate_SInt32Rules | null);
'sint64'?: (_validate_SInt64Rules | null);
'fixed32'?: (_validate_Fixed32Rules | null);
'fixed64'?: (_validate_Fixed64Rules | null);
'sfixed32'?: (_validate_SFixed32Rules | null);
'sfixed64'?: (_validate_SFixed64Rules | null);
'bool'?: (_validate_BoolRules | null);
'string'?: (_validate_StringRules | null);
'bytes'?: (_validate_BytesRules | null);
/**
* Complex Field Types
*/
'enum'?: (_validate_EnumRules | null);
'message'?: (_validate_MessageRules | null);
'repeated'?: (_validate_RepeatedRules | null);
'map'?: (_validate_MapRules | null);
/**
* Well-Known Field Types
*/
'any'?: (_validate_AnyRules | null);
'duration'?: (_validate_DurationRules | null);
'timestamp'?: (_validate_TimestampRules | null);
'type'?: "float"|"double"|"int32"|"int64"|"uint32"|"uint64"|"sint32"|"sint64"|"fixed32"|"fixed64"|"sfixed32"|"sfixed64"|"bool"|"string"|"bytes"|"enum"|"repeated"|"map"|"any"|"duration"|"timestamp";
}
/**
* FieldRules encapsulates the rules for each type of field. Depending on the
* field, the correct set should be used to ensure proper validations.
*/
export interface FieldRules__Output {
/**
* Scalar Field Types
*/
'float'?: (_validate_FloatRules__Output | null);
'double'?: (_validate_DoubleRules__Output | null);
'int32'?: (_validate_Int32Rules__Output | null);
'int64'?: (_validate_Int64Rules__Output | null);
'uint32'?: (_validate_UInt32Rules__Output | null);
'uint64'?: (_validate_UInt64Rules__Output | null);
'sint32'?: (_validate_SInt32Rules__Output | null);
'sint64'?: (_validate_SInt64Rules__Output | null);
'fixed32'?: (_validate_Fixed32Rules__Output | null);
'fixed64'?: (_validate_Fixed64Rules__Output | null);
'sfixed32'?: (_validate_SFixed32Rules__Output | null);
'sfixed64'?: (_validate_SFixed64Rules__Output | null);
'bool'?: (_validate_BoolRules__Output | null);
'string'?: (_validate_StringRules__Output | null);
'bytes'?: (_validate_BytesRules__Output | null);
/**
* Complex Field Types
*/
'enum'?: (_validate_EnumRules__Output | null);
'message': (_validate_MessageRules__Output | null);
'repeated'?: (_validate_RepeatedRules__Output | null);
'map'?: (_validate_MapRules__Output | null);
/**
* Well-Known Field Types
*/
'any'?: (_validate_AnyRules__Output | null);
'duration'?: (_validate_DurationRules__Output | null);
'timestamp'?: (_validate_TimestampRules__Output | null);
'type'?: "float"|"double"|"int32"|"int64"|"uint32"|"uint64"|"sint32"|"sint64"|"fixed32"|"fixed64"|"sfixed32"|"sfixed64"|"bool"|"string"|"bytes"|"enum"|"repeated"|"map"|"any"|"duration"|"timestamp";
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* Fixed32Rules describes the constraints applied to `fixed32` values
*/
export interface Fixed32Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number)[];
}
/**
* Fixed32Rules describes the constraints applied to `fixed32` values
*/
export interface Fixed32Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,87 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Long } from '@grpc/proto-loader';
/**
* Fixed64Rules describes the constraints applied to `fixed64` values
*/
export interface Fixed64Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string | Long);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string | Long);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string | Long);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string | Long);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string | Long);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string | Long)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string | Long)[];
}
/**
* Fixed64Rules describes the constraints applied to `fixed64` values
*/
export interface Fixed64Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (string)[];
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* FloatRules describes the constraints applied to `float` values
*/
export interface FloatRules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string)[];
}
/**
* FloatRules describes the constraints applied to `float` values
*/
export interface FloatRules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* Int32Rules describes the constraints applied to `int32` values
*/
export interface Int32Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number)[];
}
/**
* Int32Rules describes the constraints applied to `int32` values
*/
export interface Int32Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,87 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Long } from '@grpc/proto-loader';
/**
* Int64Rules describes the constraints applied to `int64` values
*/
export interface Int64Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string | Long);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string | Long);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string | Long);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string | Long);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string | Long);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string | Long)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string | Long)[];
}
/**
* Int64Rules describes the constraints applied to `int64` values
*/
export interface Int64Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (string)[];
}

View File

@ -0,0 +1,38 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* WellKnownRegex contain some well-known patterns.
*/
export const KnownRegex = {
UNKNOWN: 'UNKNOWN',
/**
* HTTP header name as defined by RFC 7230.
*/
HTTP_HEADER_NAME: 'HTTP_HEADER_NAME',
/**
* HTTP header value as defined by RFC 7230.
*/
HTTP_HEADER_VALUE: 'HTTP_HEADER_VALUE',
} as const;
/**
* WellKnownRegex contain some well-known patterns.
*/
export type KnownRegex =
| 'UNKNOWN'
| 0
/**
* HTTP header name as defined by RFC 7230.
*/
| 'HTTP_HEADER_NAME'
| 1
/**
* HTTP header value as defined by RFC 7230.
*/
| 'HTTP_HEADER_VALUE'
| 2
/**
* WellKnownRegex contain some well-known patterns.
*/
export type KnownRegex__Output = typeof KnownRegex[keyof typeof KnownRegex]

View File

@ -0,0 +1,66 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from '../validate/FieldRules';
import type { Long } from '@grpc/proto-loader';
/**
* MapRules describe the constraints applied to `map` values
*/
export interface MapRules {
/**
* MinPairs specifies that this field must have the specified number of
* KVs at a minimum
*/
'min_pairs'?: (number | string | Long);
/**
* MaxPairs specifies that this field must have the specified number of
* KVs at a maximum
*/
'max_pairs'?: (number | string | Long);
/**
* NoSparse specifies values in this field cannot be unset. This only
* applies to map's with message value types.
*/
'no_sparse'?: (boolean);
/**
* Keys specifies the constraints to be applied to each key in the field.
*/
'keys'?: (_validate_FieldRules | null);
/**
* Values specifies the constraints to be applied to the value of each key
* in the field. Message values will still have their validations evaluated
* unless skip is specified here.
*/
'values'?: (_validate_FieldRules | null);
}
/**
* MapRules describe the constraints applied to `map` values
*/
export interface MapRules__Output {
/**
* MinPairs specifies that this field must have the specified number of
* KVs at a minimum
*/
'min_pairs': (string);
/**
* MaxPairs specifies that this field must have the specified number of
* KVs at a maximum
*/
'max_pairs': (string);
/**
* NoSparse specifies values in this field cannot be unset. This only
* applies to map's with message value types.
*/
'no_sparse': (boolean);
/**
* Keys specifies the constraints to be applied to each key in the field.
*/
'keys': (_validate_FieldRules__Output | null);
/**
* Values specifies the constraints to be applied to the value of each key
* in the field. Message values will still have their validations evaluated
* unless skip is specified here.
*/
'values': (_validate_FieldRules__Output | null);
}

View File

@ -0,0 +1,34 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* MessageRules describe the constraints applied to embedded message values.
* For message-type fields, validation is performed recursively.
*/
export interface MessageRules {
/**
* Skip specifies that the validation rules of this field should not be
* evaluated
*/
'skip'?: (boolean);
/**
* Required specifies that this field must be set
*/
'required'?: (boolean);
}
/**
* MessageRules describe the constraints applied to embedded message values.
* For message-type fields, validation is performed recursively.
*/
export interface MessageRules__Output {
/**
* Skip specifies that the validation rules of this field should not be
* evaluated
*/
'skip': (boolean);
/**
* Required specifies that this field must be set
*/
'required': (boolean);
}

View File

@ -0,0 +1,60 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { FieldRules as _validate_FieldRules, FieldRules__Output as _validate_FieldRules__Output } from '../validate/FieldRules';
import type { Long } from '@grpc/proto-loader';
/**
* RepeatedRules describe the constraints applied to `repeated` values
*/
export interface RepeatedRules {
/**
* MinItems specifies that this field must have the specified number of
* items at a minimum
*/
'min_items'?: (number | string | Long);
/**
* MaxItems specifies that this field must have the specified number of
* items at a maximum
*/
'max_items'?: (number | string | Long);
/**
* Unique specifies that all elements in this field must be unique. This
* contraint is only applicable to scalar and enum types (messages are not
* supported).
*/
'unique'?: (boolean);
/**
* Items specifies the contraints to be applied to each item in the field.
* Repeated message fields will still execute validation against each item
* unless skip is specified here.
*/
'items'?: (_validate_FieldRules | null);
}
/**
* RepeatedRules describe the constraints applied to `repeated` values
*/
export interface RepeatedRules__Output {
/**
* MinItems specifies that this field must have the specified number of
* items at a minimum
*/
'min_items': (string);
/**
* MaxItems specifies that this field must have the specified number of
* items at a maximum
*/
'max_items': (string);
/**
* Unique specifies that all elements in this field must be unique. This
* contraint is only applicable to scalar and enum types (messages are not
* supported).
*/
'unique': (boolean);
/**
* Items specifies the contraints to be applied to each item in the field.
* Repeated message fields will still execute validation against each item
* unless skip is specified here.
*/
'items': (_validate_FieldRules__Output | null);
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* SFixed32Rules describes the constraints applied to `sfixed32` values
*/
export interface SFixed32Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number)[];
}
/**
* SFixed32Rules describes the constraints applied to `sfixed32` values
*/
export interface SFixed32Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,87 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Long } from '@grpc/proto-loader';
/**
* SFixed64Rules describes the constraints applied to `sfixed64` values
*/
export interface SFixed64Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string | Long);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string | Long);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string | Long);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string | Long);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string | Long);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string | Long)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string | Long)[];
}
/**
* SFixed64Rules describes the constraints applied to `sfixed64` values
*/
export interface SFixed64Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (string)[];
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* SInt32Rules describes the constraints applied to `sint32` values
*/
export interface SInt32Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number)[];
}
/**
* SInt32Rules describes the constraints applied to `sint32` values
*/
export interface SInt32Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,87 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Long } from '@grpc/proto-loader';
/**
* SInt64Rules describes the constraints applied to `sint64` values
*/
export interface SInt64Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string | Long);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string | Long);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string | Long);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string | Long);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string | Long);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string | Long)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string | Long)[];
}
/**
* SInt64Rules describes the constraints applied to `sint64` values
*/
export interface SInt64Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (string)[];
}

View File

@ -0,0 +1,288 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { KnownRegex as _validate_KnownRegex, KnownRegex__Output as _validate_KnownRegex__Output } from '../validate/KnownRegex';
import type { Long } from '@grpc/proto-loader';
/**
* StringRules describe the constraints applied to `string` values
*/
export interface StringRules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (string);
/**
* MinLen specifies that this field must be the specified number of
* characters (Unicode code points) at a minimum. Note that the number of
* characters may differ from the number of bytes in the string.
*/
'min_len'?: (number | string | Long);
/**
* MaxLen specifies that this field must be the specified number of
* characters (Unicode code points) at a maximum. Note that the number of
* characters may differ from the number of bytes in the string.
*/
'max_len'?: (number | string | Long);
/**
* MinBytes specifies that this field must be the specified number of bytes
* at a minimum
*/
'min_bytes'?: (number | string | Long);
/**
* MaxBytes specifies that this field must be the specified number of bytes
* at a maximum
*/
'max_bytes'?: (number | string | Long);
/**
* Pattern specifes that this field must match against the specified
* regular expression (RE2 syntax). The included expression should elide
* any delimiters.
*/
'pattern'?: (string);
/**
* Prefix specifies that this field must have the specified substring at
* the beginning of the string.
*/
'prefix'?: (string);
/**
* Suffix specifies that this field must have the specified substring at
* the end of the string.
*/
'suffix'?: (string);
/**
* Contains specifies that this field must have the specified substring
* anywhere in the string.
*/
'contains'?: (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (string)[];
/**
* Email specifies that the field must be a valid email address as
* defined by RFC 5322
*/
'email'?: (boolean);
/**
* Hostname specifies that the field must be a valid hostname as
* defined by RFC 1034. This constraint does not support
* internationalized domain names (IDNs).
*/
'hostname'?: (boolean);
/**
* Ip specifies that the field must be a valid IP (v4 or v6) address.
* Valid IPv6 addresses should not include surrounding square brackets.
*/
'ip'?: (boolean);
/**
* Ipv4 specifies that the field must be a valid IPv4 address.
*/
'ipv4'?: (boolean);
/**
* Ipv6 specifies that the field must be a valid IPv6 address. Valid
* IPv6 addresses should not include surrounding square brackets.
*/
'ipv6'?: (boolean);
/**
* Uri specifies that the field must be a valid, absolute URI as defined
* by RFC 3986
*/
'uri'?: (boolean);
/**
* UriRef specifies that the field must be a valid URI as defined by RFC
* 3986 and may be relative or absolute.
*/
'uri_ref'?: (boolean);
/**
* Len specifies that this field must be the specified number of
* characters (Unicode code points). Note that the number of
* characters may differ from the number of bytes in the string.
*/
'len'?: (number | string | Long);
/**
* LenBytes specifies that this field must be the specified number of bytes
* at a minimum
*/
'len_bytes'?: (number | string | Long);
/**
* Address specifies that the field must be either a valid hostname as
* defined by RFC 1034 (which does not support internationalized domain
* names or IDNs), or it can be a valid IP (v4 or v6).
*/
'address'?: (boolean);
/**
* Uuid specifies that the field must be a valid UUID as defined by
* RFC 4122
*/
'uuid'?: (boolean);
/**
* NotContains specifies that this field cannot have the specified substring
* anywhere in the string.
*/
'not_contains'?: (string);
/**
* WellKnownRegex specifies a common well known pattern defined as a regex.
*/
'well_known_regex'?: (_validate_KnownRegex);
/**
* This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable
* strict header validation.
* By default, this is true, and HTTP header validations are RFC-compliant.
* Setting to false will enable a looser validations that only disallows
* \r\n\0 characters, which can be used to bypass header matching rules.
*/
'strict'?: (boolean);
/**
* WellKnown rules provide advanced constraints against common string
* patterns
*/
'well_known'?: "email"|"hostname"|"ip"|"ipv4"|"ipv6"|"uri"|"uri_ref"|"address"|"uuid"|"well_known_regex";
}
/**
* StringRules describe the constraints applied to `string` values
*/
export interface StringRules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (string);
/**
* MinLen specifies that this field must be the specified number of
* characters (Unicode code points) at a minimum. Note that the number of
* characters may differ from the number of bytes in the string.
*/
'min_len': (string);
/**
* MaxLen specifies that this field must be the specified number of
* characters (Unicode code points) at a maximum. Note that the number of
* characters may differ from the number of bytes in the string.
*/
'max_len': (string);
/**
* MinBytes specifies that this field must be the specified number of bytes
* at a minimum
*/
'min_bytes': (string);
/**
* MaxBytes specifies that this field must be the specified number of bytes
* at a maximum
*/
'max_bytes': (string);
/**
* Pattern specifes that this field must match against the specified
* regular expression (RE2 syntax). The included expression should elide
* any delimiters.
*/
'pattern': (string);
/**
* Prefix specifies that this field must have the specified substring at
* the beginning of the string.
*/
'prefix': (string);
/**
* Suffix specifies that this field must have the specified substring at
* the end of the string.
*/
'suffix': (string);
/**
* Contains specifies that this field must have the specified substring
* anywhere in the string.
*/
'contains': (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (string)[];
/**
* Email specifies that the field must be a valid email address as
* defined by RFC 5322
*/
'email'?: (boolean);
/**
* Hostname specifies that the field must be a valid hostname as
* defined by RFC 1034. This constraint does not support
* internationalized domain names (IDNs).
*/
'hostname'?: (boolean);
/**
* Ip specifies that the field must be a valid IP (v4 or v6) address.
* Valid IPv6 addresses should not include surrounding square brackets.
*/
'ip'?: (boolean);
/**
* Ipv4 specifies that the field must be a valid IPv4 address.
*/
'ipv4'?: (boolean);
/**
* Ipv6 specifies that the field must be a valid IPv6 address. Valid
* IPv6 addresses should not include surrounding square brackets.
*/
'ipv6'?: (boolean);
/**
* Uri specifies that the field must be a valid, absolute URI as defined
* by RFC 3986
*/
'uri'?: (boolean);
/**
* UriRef specifies that the field must be a valid URI as defined by RFC
* 3986 and may be relative or absolute.
*/
'uri_ref'?: (boolean);
/**
* Len specifies that this field must be the specified number of
* characters (Unicode code points). Note that the number of
* characters may differ from the number of bytes in the string.
*/
'len': (string);
/**
* LenBytes specifies that this field must be the specified number of bytes
* at a minimum
*/
'len_bytes': (string);
/**
* Address specifies that the field must be either a valid hostname as
* defined by RFC 1034 (which does not support internationalized domain
* names or IDNs), or it can be a valid IP (v4 or v6).
*/
'address'?: (boolean);
/**
* Uuid specifies that the field must be a valid UUID as defined by
* RFC 4122
*/
'uuid'?: (boolean);
/**
* NotContains specifies that this field cannot have the specified substring
* anywhere in the string.
*/
'not_contains': (string);
/**
* WellKnownRegex specifies a common well known pattern defined as a regex.
*/
'well_known_regex'?: (_validate_KnownRegex__Output);
/**
* This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable
* strict header validation.
* By default, this is true, and HTTP header validations are RFC-compliant.
* Setting to false will enable a looser validations that only disallows
* \r\n\0 characters, which can be used to bypass header matching rules.
*/
'strict': (boolean);
/**
* WellKnown rules provide advanced constraints against common string
* patterns
*/
'well_known'?: "email"|"hostname"|"ip"|"ipv4"|"ipv6"|"uri"|"uri_ref"|"address"|"uuid"|"well_known_regex";
}

View File

@ -0,0 +1,106 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../google/protobuf/Timestamp';
import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../google/protobuf/Duration';
/**
* TimestampRules describe the constraints applied exclusively to the
* `google.protobuf.Timestamp` well-known type
*/
export interface TimestampRules {
/**
* Required specifies that this field must be set
*/
'required'?: (boolean);
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (_google_protobuf_Timestamp | null);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (_google_protobuf_Timestamp | null);
/**
* Lte specifies that this field must be less than the specified value,
* inclusive
*/
'lte'?: (_google_protobuf_Timestamp | null);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive
*/
'gt'?: (_google_protobuf_Timestamp | null);
/**
* Gte specifies that this field must be greater than the specified value,
* inclusive
*/
'gte'?: (_google_protobuf_Timestamp | null);
/**
* LtNow specifies that this must be less than the current time. LtNow
* can only be used with the Within rule.
*/
'lt_now'?: (boolean);
/**
* GtNow specifies that this must be greater than the current time. GtNow
* can only be used with the Within rule.
*/
'gt_now'?: (boolean);
/**
* Within specifies that this field must be within this duration of the
* current time. This constraint can be used alone or with the LtNow and
* GtNow rules.
*/
'within'?: (_google_protobuf_Duration | null);
}
/**
* TimestampRules describe the constraints applied exclusively to the
* `google.protobuf.Timestamp` well-known type
*/
export interface TimestampRules__Output {
/**
* Required specifies that this field must be set
*/
'required': (boolean);
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (_google_protobuf_Timestamp__Output | null);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (_google_protobuf_Timestamp__Output | null);
/**
* Lte specifies that this field must be less than the specified value,
* inclusive
*/
'lte': (_google_protobuf_Timestamp__Output | null);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive
*/
'gt': (_google_protobuf_Timestamp__Output | null);
/**
* Gte specifies that this field must be greater than the specified value,
* inclusive
*/
'gte': (_google_protobuf_Timestamp__Output | null);
/**
* LtNow specifies that this must be less than the current time. LtNow
* can only be used with the Within rule.
*/
'lt_now': (boolean);
/**
* GtNow specifies that this must be greater than the current time. GtNow
* can only be used with the Within rule.
*/
'gt_now': (boolean);
/**
* Within specifies that this field must be within this duration of the
* current time. This constraint can be used alone or with the LtNow and
* GtNow rules.
*/
'within': (_google_protobuf_Duration__Output | null);
}

View File

@ -0,0 +1,86 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
/**
* UInt32Rules describes the constraints applied to `uint32` values
*/
export interface UInt32Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number)[];
}
/**
* UInt32Rules describes the constraints applied to `uint32` values
*/
export interface UInt32Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (number);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (number);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (number);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (number);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (number);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (number)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (number)[];
}

View File

@ -0,0 +1,87 @@
// Original file: proto/protoc-gen-validate/validate/validate.proto
import type { Long } from '@grpc/proto-loader';
/**
* UInt64Rules describes the constraints applied to `uint64` values
*/
export interface UInt64Rules {
/**
* Const specifies that this field must be exactly the specified value
*/
'const'?: (number | string | Long);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt'?: (number | string | Long);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte'?: (number | string | Long);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt'?: (number | string | Long);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte'?: (number | string | Long);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in'?: (number | string | Long)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in'?: (number | string | Long)[];
}
/**
* UInt64Rules describes the constraints applied to `uint64` values
*/
export interface UInt64Rules__Output {
/**
* Const specifies that this field must be exactly the specified value
*/
'const': (string);
/**
* Lt specifies that this field must be less than the specified value,
* exclusive
*/
'lt': (string);
/**
* Lte specifies that this field must be less than or equal to the
* specified value, inclusive
*/
'lte': (string);
/**
* Gt specifies that this field must be greater than the specified value,
* exclusive. If the value of Gt is larger than a specified Lt or Lte, the
* range is reversed.
*/
'gt': (string);
/**
* Gte specifies that this field must be greater than or equal to the
* specified value, inclusive. If the value of Gte is larger than a
* specified Lt or Lte, the range is reversed.
*/
'gte': (string);
/**
* In specifies that this field must be equal to one of the specified
* values
*/
'in': (string)[];
/**
* NotIn specifies that this field cannot be equal to one of the specified
* values
*/
'not_in': (string)[];
}

View File

@ -0,0 +1,113 @@
// Original file: proto/xds/xds/data/orca/v3/orca_load_report.proto
import type { Long } from '@grpc/proto-loader';
export interface OrcaLoadReport {
/**
* CPU utilization expressed as a fraction of available CPU resources. This
* should be derived from the latest sample or measurement. The value may be
* larger than 1.0 when the usage exceeds the reporter dependent notion of
* soft limits.
*/
'cpu_utilization'?: (number | string);
/**
* Memory utilization expressed as a fraction of available memory
* resources. This should be derived from the latest sample or measurement.
*/
'mem_utilization'?: (number | string);
/**
* Total RPS being served by an endpoint. This should cover all services that an endpoint is
* responsible for.
* Deprecated -- use ``rps_fractional`` field instead.
* @deprecated
*/
'rps'?: (number | string | Long);
/**
* Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of
* storage) associated with the request.
*/
'request_cost'?: ({[key: string]: number | string});
/**
* Resource utilization values. Each value is expressed as a fraction of total resources
* available, derived from the latest sample or measurement.
*/
'utilization'?: ({[key: string]: number | string});
/**
* Total RPS being served by an endpoint. This should cover all services that an endpoint is
* responsible for.
*/
'rps_fractional'?: (number | string);
/**
* Total EPS (errors/second) being served by an endpoint. This should cover
* all services that an endpoint is responsible for.
*/
'eps'?: (number | string);
/**
* Application specific opaque metrics.
*/
'named_metrics'?: ({[key: string]: number | string});
/**
* Application specific utilization expressed as a fraction of available
* resources. For example, an application may report the max of CPU and memory
* utilization for better load balancing if it is both CPU and memory bound.
* This should be derived from the latest sample or measurement.
* The value may be larger than 1.0 when the usage exceeds the reporter
* dependent notion of soft limits.
*/
'application_utilization'?: (number | string);
}
export interface OrcaLoadReport__Output {
/**
* CPU utilization expressed as a fraction of available CPU resources. This
* should be derived from the latest sample or measurement. The value may be
* larger than 1.0 when the usage exceeds the reporter dependent notion of
* soft limits.
*/
'cpu_utilization': (number);
/**
* Memory utilization expressed as a fraction of available memory
* resources. This should be derived from the latest sample or measurement.
*/
'mem_utilization': (number);
/**
* Total RPS being served by an endpoint. This should cover all services that an endpoint is
* responsible for.
* Deprecated -- use ``rps_fractional`` field instead.
* @deprecated
*/
'rps': (string);
/**
* Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of
* storage) associated with the request.
*/
'request_cost': ({[key: string]: number});
/**
* Resource utilization values. Each value is expressed as a fraction of total resources
* available, derived from the latest sample or measurement.
*/
'utilization': ({[key: string]: number});
/**
* Total RPS being served by an endpoint. This should cover all services that an endpoint is
* responsible for.
*/
'rps_fractional': (number);
/**
* Total EPS (errors/second) being served by an endpoint. This should cover
* all services that an endpoint is responsible for.
*/
'eps': (number);
/**
* Application specific opaque metrics.
*/
'named_metrics': ({[key: string]: number});
/**
* Application specific utilization expressed as a fraction of available
* resources. For example, an application may report the max of CPU and memory
* utilization for better load balancing if it is both CPU and memory bound.
* This should be derived from the latest sample or measurement.
* The value may be larger than 1.0 when the usage exceeds the reporter
* dependent notion of soft limits.
*/
'application_utilization': (number);
}

View File

@ -0,0 +1,43 @@
// Original file: proto/xds/xds/service/orca/v3/orca.proto
import type * as grpc from '../../../../../index'
import type { MethodDefinition } from '@grpc/proto-loader'
import type { OrcaLoadReport as _xds_data_orca_v3_OrcaLoadReport, OrcaLoadReport__Output as _xds_data_orca_v3_OrcaLoadReport__Output } from '../../../../xds/data/orca/v3/OrcaLoadReport';
import type { OrcaLoadReportRequest as _xds_service_orca_v3_OrcaLoadReportRequest, OrcaLoadReportRequest__Output as _xds_service_orca_v3_OrcaLoadReportRequest__Output } from '../../../../xds/service/orca/v3/OrcaLoadReportRequest';
/**
* Out-of-band (OOB) load reporting service for the additional load reporting
* agent that does not sit in the request path. Reports are periodically sampled
* with sufficient frequency to provide temporal association with requests.
* OOB reporting compensates the limitation of in-band reporting in revealing
* costs for backends that do not provide a steady stream of telemetry such as
* long running stream operations and zero QPS services. This is a server
* streaming service, client needs to terminate current RPC and initiate
* a new call to change backend reporting frequency.
*/
export interface OpenRcaServiceClient extends grpc.Client {
StreamCoreMetrics(argument: _xds_service_orca_v3_OrcaLoadReportRequest, metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream<_xds_data_orca_v3_OrcaLoadReport__Output>;
StreamCoreMetrics(argument: _xds_service_orca_v3_OrcaLoadReportRequest, options?: grpc.CallOptions): grpc.ClientReadableStream<_xds_data_orca_v3_OrcaLoadReport__Output>;
streamCoreMetrics(argument: _xds_service_orca_v3_OrcaLoadReportRequest, metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream<_xds_data_orca_v3_OrcaLoadReport__Output>;
streamCoreMetrics(argument: _xds_service_orca_v3_OrcaLoadReportRequest, options?: grpc.CallOptions): grpc.ClientReadableStream<_xds_data_orca_v3_OrcaLoadReport__Output>;
}
/**
* Out-of-band (OOB) load reporting service for the additional load reporting
* agent that does not sit in the request path. Reports are periodically sampled
* with sufficient frequency to provide temporal association with requests.
* OOB reporting compensates the limitation of in-band reporting in revealing
* costs for backends that do not provide a steady stream of telemetry such as
* long running stream operations and zero QPS services. This is a server
* streaming service, client needs to terminate current RPC and initiate
* a new call to change backend reporting frequency.
*/
export interface OpenRcaServiceHandlers extends grpc.UntypedServiceImplementation {
StreamCoreMetrics: grpc.handleServerStreamingCall<_xds_service_orca_v3_OrcaLoadReportRequest__Output, _xds_data_orca_v3_OrcaLoadReport>;
}
export interface OpenRcaServiceDefinition extends grpc.ServiceDefinition {
StreamCoreMetrics: MethodDefinition<_xds_service_orca_v3_OrcaLoadReportRequest, _xds_data_orca_v3_OrcaLoadReport, _xds_service_orca_v3_OrcaLoadReportRequest__Output, _xds_data_orca_v3_OrcaLoadReport__Output>
}

View File

@ -0,0 +1,29 @@
// Original file: proto/xds/xds/service/orca/v3/orca.proto
import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration';
export interface OrcaLoadReportRequest {
/**
* Interval for generating Open RCA core metric responses.
*/
'report_interval'?: (_google_protobuf_Duration | null);
/**
* Request costs to collect. If this is empty, all known requests costs tracked by
* the load reporting agent will be returned. This provides an opportunity for
* the client to selectively obtain a subset of tracked costs.
*/
'request_cost_names'?: (string)[];
}
export interface OrcaLoadReportRequest__Output {
/**
* Interval for generating Open RCA core metric responses.
*/
'report_interval': (_google_protobuf_Duration__Output | null);
/**
* Request costs to collect. If this is empty, all known requests costs tracked by
* the load reporting agent will be returned. This provides an opportunity for
* the client to selectively obtain a subset of tracked costs.
*/
'request_cost_names': (string)[];
}

View File

@ -0,0 +1,133 @@
/*
* Copyright 2025 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { OrcaLoadReport } from "./generated/xds/data/orca/v3/OrcaLoadReport";
import type { loadSync } from '@grpc/proto-loader';
import { ProtoGrpcType as OrcaProtoGrpcType } from "./generated/orca";
import { loadPackageDefinition } from "./make-client";
const loadedOrcaProto: OrcaProtoGrpcType | null = null;
function loadOrcaProto(): OrcaProtoGrpcType {
if (loadedOrcaProto) {
return loadedOrcaProto;
}
/* The purpose of this complexity is to avoid loading @grpc/proto-loader at
* runtime for users who will not use/enable ORCA. */
const loaderLoadSync = require('@grpc/proto-loader')
.loadSync as typeof loadSync;
const loadedProto = loaderLoadSync('xds/service/orca/v3/orca.proto', {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
includeDirs: [
`${__dirname}/../../proto/xds`,
`${__dirname}/../../proto/protoc-gen-validate`
],
});
return loadPackageDefinition(loadedProto) as unknown as OrcaProtoGrpcType;
}
/**
* ORCA metrics recorder for a single request
*/
export class PerRequestMetricsRecorder {
private message: OrcaLoadReport = {};
/**
* Records a request cost metric measurement for the call.
* @param name
* @param value
*/
recordRequestCostMetric(name: string, value: number) {
if (!this.message.request_cost) {
this.message.request_cost = {};
}
this.message.request_cost[name] = value;
}
/**
* Records a request cost metric measurement for the call.
* @param name
* @param value
*/
recordUtilizationMetric(name: string, value: number) {
if (!this.message.utilization) {
this.message.utilization = {};
}
this.message.utilization[name] = value;
}
/**
* Records an opaque named metric measurement for the call.
* @param name
* @param value
*/
recordNamedMetric(name: string, value: number) {
if (!this.message.named_metrics) {
this.message.named_metrics = {};
}
this.message.named_metrics[name] = value;
}
/**
* Records the CPU utilization metric measurement for the call.
* @param value
*/
recordCPUUtilizationMetric(value: number) {
this.message.cpu_utilization = value;
}
/**
* Records the memory utilization metric measurement for the call.
* @param value
*/
recordMemoryUtilizationMetric(value: number) {
this.message.mem_utilization = value;
}
/**
* Records the memory utilization metric measurement for the call.
* @param value
*/
recordApplicationUtilizationMetric(value: number) {
this.message.application_utilization = value;
}
/**
* Records the queries per second measurement.
* @param value
*/
recordQpsMetric(value: number) {
this.message.rps_fractional = value;
}
/**
* Records the errors per second measurement.
* @param value
*/
recordEpsMetric(value: number) {
this.message.eps = value;
}
serialize(): Buffer {
const orcaProto = loadOrcaProto();
return orcaProto.xds.data.orca.v3.OrcaLoadReport.serialize(this.message);
}
}

View File

@ -26,6 +26,7 @@ import type { StatusObject, PartialStatusObject } from './call-interface';
import type { Deadline } from './deadline';
import type { ServerInterceptingCallInterface } from './server-interceptors';
import { AuthContext } from './auth-context';
import { PerRequestMetricsRecorder } from './orca';
export type ServerStatusResponse = Partial<StatusObject>;
@ -40,6 +41,7 @@ export type ServerSurfaceCall = {
getPath(): string;
getHost(): string;
getAuthContext(): AuthContext;
getMetricsRecorder(): PerRequestMetricsRecorder;
} & EventEmitter;
export type ServerUnaryCall<RequestType, ResponseType> = ServerSurfaceCall & {
@ -120,6 +122,10 @@ export class ServerUnaryCallImpl<RequestType, ResponseType>
getAuthContext(): AuthContext {
return this.call.getAuthContext();
}
getMetricsRecorder(): PerRequestMetricsRecorder {
return this.call.getMetricsRecorder();
}
}
export class ServerReadableStreamImpl<RequestType, ResponseType>
@ -164,6 +170,10 @@ export class ServerReadableStreamImpl<RequestType, ResponseType>
getAuthContext(): AuthContext {
return this.call.getAuthContext();
}
getMetricsRecorder(): PerRequestMetricsRecorder {
return this.call.getMetricsRecorder();
}
}
export class ServerWritableStreamImpl<RequestType, ResponseType>
@ -217,6 +227,10 @@ export class ServerWritableStreamImpl<RequestType, ResponseType>
return this.call.getAuthContext();
}
getMetricsRecorder(): PerRequestMetricsRecorder {
return this.call.getMetricsRecorder();
}
_write(
chunk: ResponseType,
encoding: string,
@ -294,6 +308,10 @@ export class ServerDuplexStreamImpl<RequestType, ResponseType>
return this.call.getAuthContext();
}
getMetricsRecorder(): PerRequestMetricsRecorder {
return this.call.getMetricsRecorder();
}
_read(size: number) {
this.call.startRead();
}

View File

@ -35,6 +35,7 @@ import { CallEventTracker } from './transport';
import * as logging from './logging';
import { AuthContext } from './auth-context';
import { TLSSocket } from 'tls';
import { PerRequestMetricsRecorder } from './orca';
const TRACER_NAME = 'server_call';
@ -349,6 +350,12 @@ export interface ServerInterceptingCallInterface {
* Return information about the connection used to make the call.
*/
getConnectionInfo(): ConnectionInfo;
/**
* Get the metrics recorder for this call. Metrics will not be sent unless
* the server was constructed with the `grpc.server_call_metric_recording`
* option.
*/
getMetricsRecorder(): PerRequestMetricsRecorder;
}
export class ServerInterceptingCall implements ServerInterceptingCallInterface {
@ -463,6 +470,9 @@ export class ServerInterceptingCall implements ServerInterceptingCallInterface {
getConnectionInfo(): ConnectionInfo {
return this.nextCall.getConnectionInfo();
}
getMetricsRecorder(): PerRequestMetricsRecorder {
return this.nextCall.getMetricsRecorder();
}
}
export interface ServerInterceptor {
@ -481,6 +491,7 @@ const GRPC_ENCODING_HEADER = 'grpc-encoding';
const GRPC_MESSAGE_HEADER = 'grpc-message';
const GRPC_STATUS_HEADER = 'grpc-status';
const GRPC_TIMEOUT_HEADER = 'grpc-timeout';
const GRPC_METRICS_HEADER = 'endpoint-load-metrics-bin';
const DEADLINE_REGEX = /(\d{1,8})\s*([HMSmun])/;
const deadlineUnitsToMs: DeadlineUnitIndexSignature = {
H: 3600000,
@ -534,6 +545,8 @@ export class BaseServerInterceptingCall
private streamEnded = false;
private host: string;
private connectionInfo: ConnectionInfo;
private metricsRecorder = new PerRequestMetricsRecorder();
private shouldSendMetrics: boolean;
constructor(
private readonly stream: http2.ServerHttp2Stream,
@ -629,6 +642,7 @@ export class BaseServerInterceptingCall
remoteAddress: socket?.remoteAddress,
remotePort: socket?.remotePort
};
this.shouldSendMetrics = !!options['grpc.server_call_metric_recording'];
}
private handleTimeoutHeader(timeoutHeader: string) {
@ -932,6 +946,11 @@ export class BaseServerInterceptingCall
status.details
);
const statusMetadata = status.metadata?.clone() ?? new Metadata();
if (this.shouldSendMetrics) {
statusMetadata.set(GRPC_METRICS_HEADER, this.metricsRecorder.serialize());
}
if (this.metadataSent) {
if (!this.wantTrailers) {
this.wantTrailers = true;
@ -941,10 +960,10 @@ export class BaseServerInterceptingCall
this.callEventTracker.onStreamEnd(true);
this.callEventTracker.onCallEnd(status);
}
const trailersToSend = {
const trailersToSend: http2.OutgoingHttpHeaders = {
[GRPC_STATUS_HEADER]: status.code,
[GRPC_MESSAGE_HEADER]: encodeURI(status.details),
...status.metadata?.toHttp2Headers(),
...statusMetadata.toHttp2Headers(),
};
this.stream.sendTrailers(trailersToSend);
@ -961,11 +980,11 @@ export class BaseServerInterceptingCall
this.callEventTracker.onCallEnd(status);
}
// Trailers-only response
const trailersToSend = {
const trailersToSend: http2.OutgoingHttpHeaders = {
[GRPC_STATUS_HEADER]: status.code,
[GRPC_MESSAGE_HEADER]: encodeURI(status.details),
...defaultResponseHeaders,
...status.metadata?.toHttp2Headers(),
...statusMetadata.toHttp2Headers(),
};
this.stream.respond(trailersToSend, { endStream: true });
this.notifyOnCancel();
@ -1017,6 +1036,9 @@ export class BaseServerInterceptingCall
getConnectionInfo(): ConnectionInfo {
return this.connectionInfo;
}
getMetricsRecorder(): PerRequestMetricsRecorder {
return this.metricsRecorder;
}
}
export function getServerInterceptingCall(

View File

@ -0,0 +1,301 @@
/*
* Copyright 2025 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import * as assert from 'assert';
import * as path from 'path';
import * as grpc from '../src';
import { ServiceClient } from '../src/make-client';
import { assert2, loadProtoFile } from './common';
import { ProtoGrpcType as OrcaProtoGrpcType } from "../src/generated/orca";
import { PerRequestMetricsRecorder } from '../src/orca';
import { loadSync } from '@grpc/proto-loader';
const GRPC_METRICS_HEADER = 'endpoint-load-metrics-bin';
const protoFile = path.join(__dirname, 'fixtures', 'echo_service.proto');
const EchoService = loadProtoFile(protoFile)
.EchoService as grpc.ServiceClientConstructor;
const loadedProto = loadSync('xds/service/orca/v3/orca.proto', {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
includeDirs: [
`${__dirname}/../../proto/xds`,
`${__dirname}/../../proto/protoc-gen-validate`
],
});
const orcaProto = grpc.loadPackageDefinition(loadedProto) as unknown as OrcaProtoGrpcType;
let setMetrics: (metricsRecorder: PerRequestMetricsRecorder) => void = () => {};
const serviceImpl = {
echo: (
call: grpc.ServerUnaryCall<any, any>,
callback: grpc.sendUnaryData<any>
) => {
setMetrics?.(call.getMetricsRecorder());
callback(null, call.request);
},
};
describe('ORCA', () => {
let server: grpc.Server;
let client: ServiceClient;
afterEach(() => {
setMetrics = () => {}
});
describe('server-side per-call metrics', () => {
describe('not enabled', () => {
before(done => {
server = new grpc.Server();
server.addService(EchoService.service, serviceImpl);
server.bindAsync(
'localhost:0',
grpc.ServerCredentials.createInsecure(),
(error, port) => {
if (error) {
done(error);
return;
}
client = new EchoService(
`localhost:${port}`,
grpc.credentials.createInsecure()
);
done();
}
);
});
after(done => {
client.close();
server.tryShutdown(done);
});
it('Should not include the metadata entry', done => {
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.deepStrictEqual(status.metadata.get(GRPC_METRICS_HEADER), []);
}));
assert2.afterMustCallsSatisfied(done);
});
});
describe('enabled', () => {
before(done => {
server = new grpc.Server({ 'grpc.server_call_metric_recording': 1 });
server.addService(EchoService.service, serviceImpl);
server.bindAsync(
'localhost:0',
grpc.ServerCredentials.createInsecure(),
(error, port) => {
if (error) {
done(error);
return;
}
client = new EchoService(
`localhost:${port}`,
grpc.credentials.createInsecure()
);
done();
}
);
});
after(done => {
client.close();
server.tryShutdown(done);
});
it('Should include the metadata entry', done => {
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send request cost metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordRequestCostMetric('test', 1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.request_cost, {test: 1});
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send utilization metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordUtilizationMetric('test', 1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.utilization, {test: 1});
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send named metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordNamedMetric('test', 1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.named_metrics, {test: 1});
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send CPU utilization metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordCPUUtilizationMetric(1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.cpu_utilization, 1);
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send CPU utilization metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordMemoryUtilizationMetric(1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.mem_utilization, 1);
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send application utilization metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordApplicationUtilizationMetric(1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.application_utilization, 1);
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send QPS metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordQpsMetric(1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.rps_fractional, 1);
}));
assert2.afterMustCallsSatisfied(done);
});
it('Should send EPS metrics', done => {
setMetrics = (metricsRecorder) => {
metricsRecorder.recordEpsMetric(1);
}
const call: grpc.ClientUnaryCall = client.echo(
{ value: 'test value', value2: 3 },
assert2.mustCall((error: grpc.ServiceError, response: any) => {
assert.ifError(error);
assert.deepStrictEqual(response, { value: 'test value', value2: 3 });
})
);
call.on('status', assert2.mustCall((status) => {
assert.strictEqual(status.metadata.get(GRPC_METRICS_HEADER).length, 1);
const loadReport = orcaProto.xds.data.orca.v3.OrcaLoadReport.deserialize(status.metadata.get(GRPC_METRICS_HEADER)[0]);
assert.deepStrictEqual(loadReport.eps, 1);
}));
assert2.afterMustCallsSatisfied(done);
});
});
});
});