@permguard/permguard 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +145 -0
- package/dist/index.d.mts +190 -0
- package/dist/index.d.ts +190 -0
- package/dist/index.js +4614 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4567 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/azconfig.ts","../src/internal/az/azreq/grpc/v1/generated/proto/v1/pdp.ts","../node_modules/@protobuf-ts/runtime/build/es2015/json-typings.js","../node_modules/@protobuf-ts/runtime/build/es2015/base64.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-format-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/goog-varint.js","../node_modules/@protobuf-ts/runtime/build/es2015/pb-long.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/assert.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/json-format-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/message-type-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/lower-camel-case.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-info.js","../node_modules/@protobuf-ts/runtime/build/es2015/oneof.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-type-check.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-long-convert.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-scalar-default.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-binary-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-binary-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-create.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-merge-partial.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-equals.js","../node_modules/@protobuf-ts/runtime/build/es2015/message-type.js","../src/internal/az/azreq/grpc/v1/generated/google/protobuf/struct.ts","../src/internal/az/azreq/grpc/v1/generated/proto/v1/pdp.client.ts","../src/internal/az/azreq/grpc/v1/pdp_grpc_mapper.ts","../src/internal/az/azreq/grpc/v1/pdp_client.ts","../src/azclient.ts","../src/az/azreq/builder_action.ts","../src/az/azreq/builder_context.ts","../src/az/azreq/builder_evaluation.ts","../src/az/azreq/builder_principal.ts","../src/az/azreq/builder_request_composed.ts","../src/az/azreq/model.ts","../src/az/azreq/builder_subject.ts","../src/az/azreq/builder_resource.ts","../src/az/azreq/builder_request_atomic.ts"],"sourcesContent":["// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Represents the endpoint for the authorization server.\n */\ninterface AZEndpoint {\n endpoint: string;\n port: number;\n}\n\n/**\n * Represents the configuration for the authorization client.\n */\ninterface AZConfig {\n pdpEndpoint?: AZEndpoint;\n}\n\n/**\n * A function type for configuring the AZConfig.\n */\ntype AZOption = (config: AZConfig) => void;\n\n/**\n * Sets the gRPC endpoint for the authorization server.\n * @param endpoint - The endpoint (e.g., \"localhost\").\n * @param port - The port number (e.g., 9094).\n * @returns An AZOption function to configure the AZConfig.\n */\nfunction withEndpoint(endpoint: string, port: number): AZOption {\n return (config: AZConfig) => {\n config.pdpEndpoint = {\n endpoint,\n port,\n };\n };\n}\n\nexport { type AZEndpoint, type AZConfig, type AZOption, withEndpoint };\n","// @generated by protobuf-ts 2.9.4\n// @generated from protobuf file \"proto/v1/pdp.proto\" (package \"policydecisionpoint\", syntax proto3)\n// tslint:disable\n//\n// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n//\nimport { ServiceType } from \"@protobuf-ts/runtime-rpc\";\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\nimport { Struct } from \"../../google/protobuf/struct\";\n/**\n * PolicyStore is the location where policies are maintained.\n *\n * @generated from protobuf message policydecisionpoint.PolicyStore\n */\nexport interface PolicyStore {\n /**\n * @generated from protobuf field: string Kind = 1 [json_name = \"Kind\"];\n */\n kind: string;\n /**\n * @generated from protobuf field: string ID = 2 [json_name = \"ID\"];\n */\n iD: string;\n}\n/**\n * Principal represents the entity making the request.\n *\n * @generated from protobuf message policydecisionpoint.Principal\n */\nexport interface Principal {\n /**\n * @generated from protobuf field: string Type = 1 [json_name = \"Type\"];\n */\n type: string;\n /**\n * @generated from protobuf field: string ID = 2 [json_name = \"ID\"];\n */\n iD: string;\n /**\n * @generated from protobuf field: optional string Source = 3 [json_name = \"Source\"];\n */\n source?: string;\n /**\n * @generated from protobuf field: optional string IdentityToken = 4 [json_name = \"IdentityToken\"];\n */\n identityToken?: string;\n /**\n * @generated from protobuf field: optional string AccessToken = 5 [json_name = \"AccessToken\"];\n */\n accessToken?: string;\n}\n/**\n * Entities represent the entities provided in the context for the authorization decision.\n *\n * @generated from protobuf message policydecisionpoint.Entities\n */\nexport interface Entities {\n /**\n * @generated from protobuf field: string Schema = 1 [json_name = \"Schema\"];\n */\n schema: string;\n /**\n * @generated from protobuf field: repeated google.protobuf.Struct Items = 2 [json_name = \"Items\"];\n */\n items: Struct[];\n}\n/**\n * Subject is the entity on which the authorization decision is made.\n *\n * @generated from protobuf message policydecisionpoint.Subject\n */\nexport interface Subject {\n /**\n * @generated from protobuf field: string Type = 1 [json_name = \"Type\"];\n */\n type: string;\n /**\n * @generated from protobuf field: string ID = 2 [json_name = \"ID\"];\n */\n iD: string;\n /**\n * @generated from protobuf field: optional string Source = 3 [json_name = \"Source\"];\n */\n source?: string;\n /**\n * @generated from protobuf field: optional google.protobuf.Struct Properties = 4 [json_name = \"Properties\"];\n */\n properties?: Struct;\n}\n/**\n * Resource is the entity on which the authorization decision is made.\n *\n * @generated from protobuf message policydecisionpoint.Resource\n */\nexport interface Resource {\n /**\n * @generated from protobuf field: string Type = 1 [json_name = \"Type\"];\n */\n type: string;\n /**\n * @generated from protobuf field: string ID = 2 [json_name = \"ID\"];\n */\n iD: string;\n /**\n * @generated from protobuf field: optional google.protobuf.Struct Properties = 3 [json_name = \"Properties\"];\n */\n properties?: Struct;\n}\n/**\n * Action is the operation on which the authorization decision is made.\n *\n * @generated from protobuf message policydecisionpoint.Action\n */\nexport interface Action {\n /**\n * @generated from protobuf field: string Name = 1 [json_name = \"Name\"];\n */\n name: string;\n /**\n * @generated from protobuf field: optional google.protobuf.Struct Properties = 2 [json_name = \"Properties\"];\n */\n properties?: Struct;\n}\n// AuthorizationCheck Request\n\n/**\n * AuthorizationModelRequest is the input context for making the authorization decision.\n *\n * @generated from protobuf message policydecisionpoint.AuthorizationModelRequest\n */\nexport interface AuthorizationModelRequest {\n /**\n * @generated from protobuf field: int64 ZoneID = 1 [json_name = \"ZoneID\"];\n */\n zoneID: bigint;\n /**\n * @generated from protobuf field: policydecisionpoint.PolicyStore PolicyStore = 2 [json_name = \"PolicyStore\"];\n */\n policyStore?: PolicyStore;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Principal Principal = 3 [json_name = \"Principal\"];\n */\n principal?: Principal;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Entities Entities = 4 [json_name = \"Entities\"];\n */\n entities?: Entities;\n}\n/**\n * EvaluationRequest represents the request to evaluate the authorization decision.\n *\n * @generated from protobuf message policydecisionpoint.EvaluationRequest\n */\nexport interface EvaluationRequest {\n /**\n * @generated from protobuf field: optional string RequestID = 1 [json_name = \"RequestID\"];\n */\n requestID?: string;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Subject Subject = 2 [json_name = \"Subject\"];\n */\n subject?: Subject;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Resource Resource = 3 [json_name = \"Resource\"];\n */\n resource?: Resource;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Action Action = 4 [json_name = \"Action\"];\n */\n action?: Action;\n /**\n * @generated from protobuf field: optional google.protobuf.Struct Context = 5 [json_name = \"Context\"];\n */\n context?: Struct;\n}\n/**\n * AuthorizationCheckRequest represents the request to perform an authorization decision.\n *\n * @generated from protobuf message policydecisionpoint.AuthorizationCheckRequest\n */\nexport interface AuthorizationCheckRequest {\n /**\n * @generated from protobuf field: policydecisionpoint.AuthorizationModelRequest AuthorizationModel = 1 [json_name = \"AuthorizationModel\"];\n */\n authorizationModel?: AuthorizationModelRequest;\n /**\n * @generated from protobuf field: optional string RequestID = 2 [json_name = \"RequestID\"];\n */\n requestID?: string;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Subject Subject = 3 [json_name = \"Subject\"];\n */\n subject?: Subject;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Resource Resource = 4 [json_name = \"Resource\"];\n */\n resource?: Resource;\n /**\n * @generated from protobuf field: optional policydecisionpoint.Action Action = 5 [json_name = \"Action\"];\n */\n action?: Action;\n /**\n * @generated from protobuf field: optional google.protobuf.Struct Context = 6 [json_name = \"Context\"];\n */\n context?: Struct;\n /**\n * @generated from protobuf field: repeated policydecisionpoint.EvaluationRequest Evaluations = 7 [json_name = \"Evaluations\"];\n */\n evaluations: EvaluationRequest[];\n}\n// AuthorizationCheck Response\n\n/**\n * ReasonResponse provides the rationale for the response.\n *\n * @generated from protobuf message policydecisionpoint.ReasonResponse\n */\nexport interface ReasonResponse {\n /**\n * @generated from protobuf field: string Code = 1 [json_name = \"Code\"];\n */\n code: string;\n /**\n * @generated from protobuf field: string Message = 2 [json_name = \"Message\"];\n */\n message: string;\n}\n/**\n * ContextResponse represents the context included in the response.\n *\n * @generated from protobuf message policydecisionpoint.ContextResponse\n */\nexport interface ContextResponse {\n /**\n * @generated from protobuf field: string ID = 1 [json_name = \"ID\"];\n */\n iD: string;\n /**\n * @generated from protobuf field: policydecisionpoint.ReasonResponse ReasonAdmin = 2 [json_name = \"ReasonAdmin\"];\n */\n reasonAdmin?: ReasonResponse;\n /**\n * @generated from protobuf field: policydecisionpoint.ReasonResponse ReasonUser = 3 [json_name = \"ReasonUser\"];\n */\n reasonUser?: ReasonResponse;\n}\n/**\n * EvaluationResponse represents the result of the evaluation process.\n *\n * @generated from protobuf message policydecisionpoint.EvaluationResponse\n */\nexport interface EvaluationResponse {\n /**\n * @generated from protobuf field: bool Decision = 1 [json_name = \"Decision\"];\n */\n decision: boolean;\n /**\n * @generated from protobuf field: optional string RequestID = 2 [json_name = \"RequestID\"];\n */\n requestID?: string;\n /**\n * @generated from protobuf field: optional policydecisionpoint.ContextResponse Context = 3 [json_name = \"Context\"];\n */\n context?: ContextResponse;\n}\n/**\n * AuthorizationCheckResponse represents the outcome of the authorization decision.\n *\n * @generated from protobuf message policydecisionpoint.AuthorizationCheckResponse\n */\nexport interface AuthorizationCheckResponse {\n /**\n * @generated from protobuf field: bool Decision = 1 [json_name = \"Decision\"];\n */\n decision: boolean;\n /**\n * @generated from protobuf field: optional string RequestID = 2 [json_name = \"RequestID\"];\n */\n requestID?: string;\n /**\n * @generated from protobuf field: optional policydecisionpoint.ContextResponse Context = 3 [json_name = \"Context\"];\n */\n context?: ContextResponse;\n /**\n * @generated from protobuf field: repeated policydecisionpoint.EvaluationResponse Evaluations = 4 [json_name = \"Evaluations\"];\n */\n evaluations: EvaluationResponse[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass PolicyStore$Type extends MessageType<PolicyStore> {\n constructor() {\n super(\"policydecisionpoint.PolicyStore\", [\n { no: 1, name: \"Kind\", kind: \"scalar\", jsonName: \"Kind\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"ID\", kind: \"scalar\", jsonName: \"ID\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<PolicyStore>): PolicyStore {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.kind = \"\";\n message.iD = \"\";\n if (value !== undefined)\n reflectionMergePartial<PolicyStore>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyStore): PolicyStore {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Kind = 1 [json_name = \"Kind\"];*/ 1:\n message.kind = reader.string();\n break;\n case /* string ID = 2 [json_name = \"ID\"];*/ 2:\n message.iD = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: PolicyStore, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Kind = 1 [json_name = \"Kind\"]; */\n if (message.kind !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.kind);\n /* string ID = 2 [json_name = \"ID\"]; */\n if (message.iD !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.iD);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.PolicyStore\n */\nexport const PolicyStore = new PolicyStore$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass Principal$Type extends MessageType<Principal> {\n constructor() {\n super(\"policydecisionpoint.Principal\", [\n { no: 1, name: \"Type\", kind: \"scalar\", jsonName: \"Type\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"ID\", kind: \"scalar\", jsonName: \"ID\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"Source\", kind: \"scalar\", jsonName: \"Source\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 4, name: \"IdentityToken\", kind: \"scalar\", jsonName: \"IdentityToken\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 5, name: \"AccessToken\", kind: \"scalar\", jsonName: \"AccessToken\", opt: true, T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<Principal>): Principal {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.type = \"\";\n message.iD = \"\";\n if (value !== undefined)\n reflectionMergePartial<Principal>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Principal): Principal {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Type = 1 [json_name = \"Type\"];*/ 1:\n message.type = reader.string();\n break;\n case /* string ID = 2 [json_name = \"ID\"];*/ 2:\n message.iD = reader.string();\n break;\n case /* optional string Source = 3 [json_name = \"Source\"];*/ 3:\n message.source = reader.string();\n break;\n case /* optional string IdentityToken = 4 [json_name = \"IdentityToken\"];*/ 4:\n message.identityToken = reader.string();\n break;\n case /* optional string AccessToken = 5 [json_name = \"AccessToken\"];*/ 5:\n message.accessToken = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Principal, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Type = 1 [json_name = \"Type\"]; */\n if (message.type !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.type);\n /* string ID = 2 [json_name = \"ID\"]; */\n if (message.iD !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.iD);\n /* optional string Source = 3 [json_name = \"Source\"]; */\n if (message.source !== undefined)\n writer.tag(3, WireType.LengthDelimited).string(message.source);\n /* optional string IdentityToken = 4 [json_name = \"IdentityToken\"]; */\n if (message.identityToken !== undefined)\n writer.tag(4, WireType.LengthDelimited).string(message.identityToken);\n /* optional string AccessToken = 5 [json_name = \"AccessToken\"]; */\n if (message.accessToken !== undefined)\n writer.tag(5, WireType.LengthDelimited).string(message.accessToken);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.Principal\n */\nexport const Principal = new Principal$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass Entities$Type extends MessageType<Entities> {\n constructor() {\n super(\"policydecisionpoint.Entities\", [\n { no: 1, name: \"Schema\", kind: \"scalar\", jsonName: \"Schema\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"Items\", kind: \"message\", jsonName: \"Items\", repeat: 1 /*RepeatType.PACKED*/, T: () => Struct }\n ]);\n }\n create(value?: PartialMessage<Entities>): Entities {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.schema = \"\";\n message.items = [];\n if (value !== undefined)\n reflectionMergePartial<Entities>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Entities): Entities {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Schema = 1 [json_name = \"Schema\"];*/ 1:\n message.schema = reader.string();\n break;\n case /* repeated google.protobuf.Struct Items = 2 [json_name = \"Items\"];*/ 2:\n message.items.push(Struct.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Entities, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Schema = 1 [json_name = \"Schema\"]; */\n if (message.schema !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.schema);\n /* repeated google.protobuf.Struct Items = 2 [json_name = \"Items\"]; */\n for (let i = 0; i < message.items.length; i++)\n Struct.internalBinaryWrite(message.items[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.Entities\n */\nexport const Entities = new Entities$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass Subject$Type extends MessageType<Subject> {\n constructor() {\n super(\"policydecisionpoint.Subject\", [\n { no: 1, name: \"Type\", kind: \"scalar\", jsonName: \"Type\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"ID\", kind: \"scalar\", jsonName: \"ID\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"Source\", kind: \"scalar\", jsonName: \"Source\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 4, name: \"Properties\", kind: \"message\", jsonName: \"Properties\", T: () => Struct }\n ]);\n }\n create(value?: PartialMessage<Subject>): Subject {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.type = \"\";\n message.iD = \"\";\n if (value !== undefined)\n reflectionMergePartial<Subject>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Subject): Subject {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Type = 1 [json_name = \"Type\"];*/ 1:\n message.type = reader.string();\n break;\n case /* string ID = 2 [json_name = \"ID\"];*/ 2:\n message.iD = reader.string();\n break;\n case /* optional string Source = 3 [json_name = \"Source\"];*/ 3:\n message.source = reader.string();\n break;\n case /* optional google.protobuf.Struct Properties = 4 [json_name = \"Properties\"];*/ 4:\n message.properties = Struct.internalBinaryRead(reader, reader.uint32(), options, message.properties);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Subject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Type = 1 [json_name = \"Type\"]; */\n if (message.type !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.type);\n /* string ID = 2 [json_name = \"ID\"]; */\n if (message.iD !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.iD);\n /* optional string Source = 3 [json_name = \"Source\"]; */\n if (message.source !== undefined)\n writer.tag(3, WireType.LengthDelimited).string(message.source);\n /* optional google.protobuf.Struct Properties = 4 [json_name = \"Properties\"]; */\n if (message.properties)\n Struct.internalBinaryWrite(message.properties, writer.tag(4, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.Subject\n */\nexport const Subject = new Subject$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass Resource$Type extends MessageType<Resource> {\n constructor() {\n super(\"policydecisionpoint.Resource\", [\n { no: 1, name: \"Type\", kind: \"scalar\", jsonName: \"Type\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"ID\", kind: \"scalar\", jsonName: \"ID\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"Properties\", kind: \"message\", jsonName: \"Properties\", T: () => Struct }\n ]);\n }\n create(value?: PartialMessage<Resource>): Resource {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.type = \"\";\n message.iD = \"\";\n if (value !== undefined)\n reflectionMergePartial<Resource>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resource): Resource {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Type = 1 [json_name = \"Type\"];*/ 1:\n message.type = reader.string();\n break;\n case /* string ID = 2 [json_name = \"ID\"];*/ 2:\n message.iD = reader.string();\n break;\n case /* optional google.protobuf.Struct Properties = 3 [json_name = \"Properties\"];*/ 3:\n message.properties = Struct.internalBinaryRead(reader, reader.uint32(), options, message.properties);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Resource, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Type = 1 [json_name = \"Type\"]; */\n if (message.type !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.type);\n /* string ID = 2 [json_name = \"ID\"]; */\n if (message.iD !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.iD);\n /* optional google.protobuf.Struct Properties = 3 [json_name = \"Properties\"]; */\n if (message.properties)\n Struct.internalBinaryWrite(message.properties, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.Resource\n */\nexport const Resource = new Resource$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass Action$Type extends MessageType<Action> {\n constructor() {\n super(\"policydecisionpoint.Action\", [\n { no: 1, name: \"Name\", kind: \"scalar\", jsonName: \"Name\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"Properties\", kind: \"message\", jsonName: \"Properties\", T: () => Struct }\n ]);\n }\n create(value?: PartialMessage<Action>): Action {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.name = \"\";\n if (value !== undefined)\n reflectionMergePartial<Action>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Action): Action {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Name = 1 [json_name = \"Name\"];*/ 1:\n message.name = reader.string();\n break;\n case /* optional google.protobuf.Struct Properties = 2 [json_name = \"Properties\"];*/ 2:\n message.properties = Struct.internalBinaryRead(reader, reader.uint32(), options, message.properties);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Action, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Name = 1 [json_name = \"Name\"]; */\n if (message.name !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.name);\n /* optional google.protobuf.Struct Properties = 2 [json_name = \"Properties\"]; */\n if (message.properties)\n Struct.internalBinaryWrite(message.properties, writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.Action\n */\nexport const Action = new Action$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass AuthorizationModelRequest$Type extends MessageType<AuthorizationModelRequest> {\n constructor() {\n super(\"policydecisionpoint.AuthorizationModelRequest\", [\n { no: 1, name: \"ZoneID\", kind: \"scalar\", jsonName: \"ZoneID\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 2, name: \"PolicyStore\", kind: \"message\", jsonName: \"PolicyStore\", T: () => PolicyStore },\n { no: 3, name: \"Principal\", kind: \"message\", jsonName: \"Principal\", T: () => Principal },\n { no: 4, name: \"Entities\", kind: \"message\", jsonName: \"Entities\", T: () => Entities }\n ]);\n }\n create(value?: PartialMessage<AuthorizationModelRequest>): AuthorizationModelRequest {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.zoneID = 0n;\n if (value !== undefined)\n reflectionMergePartial<AuthorizationModelRequest>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AuthorizationModelRequest): AuthorizationModelRequest {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int64 ZoneID = 1 [json_name = \"ZoneID\"];*/ 1:\n message.zoneID = reader.int64().toBigInt();\n break;\n case /* policydecisionpoint.PolicyStore PolicyStore = 2 [json_name = \"PolicyStore\"];*/ 2:\n message.policyStore = PolicyStore.internalBinaryRead(reader, reader.uint32(), options, message.policyStore);\n break;\n case /* optional policydecisionpoint.Principal Principal = 3 [json_name = \"Principal\"];*/ 3:\n message.principal = Principal.internalBinaryRead(reader, reader.uint32(), options, message.principal);\n break;\n case /* optional policydecisionpoint.Entities Entities = 4 [json_name = \"Entities\"];*/ 4:\n message.entities = Entities.internalBinaryRead(reader, reader.uint32(), options, message.entities);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: AuthorizationModelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int64 ZoneID = 1 [json_name = \"ZoneID\"]; */\n if (message.zoneID !== 0n)\n writer.tag(1, WireType.Varint).int64(message.zoneID);\n /* policydecisionpoint.PolicyStore PolicyStore = 2 [json_name = \"PolicyStore\"]; */\n if (message.policyStore)\n PolicyStore.internalBinaryWrite(message.policyStore, writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n /* optional policydecisionpoint.Principal Principal = 3 [json_name = \"Principal\"]; */\n if (message.principal)\n Principal.internalBinaryWrite(message.principal, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n /* optional policydecisionpoint.Entities Entities = 4 [json_name = \"Entities\"]; */\n if (message.entities)\n Entities.internalBinaryWrite(message.entities, writer.tag(4, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.AuthorizationModelRequest\n */\nexport const AuthorizationModelRequest = new AuthorizationModelRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass EvaluationRequest$Type extends MessageType<EvaluationRequest> {\n constructor() {\n super(\"policydecisionpoint.EvaluationRequest\", [\n { no: 1, name: \"RequestID\", kind: \"scalar\", jsonName: \"RequestID\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"Subject\", kind: \"message\", jsonName: \"Subject\", T: () => Subject },\n { no: 3, name: \"Resource\", kind: \"message\", jsonName: \"Resource\", T: () => Resource },\n { no: 4, name: \"Action\", kind: \"message\", jsonName: \"Action\", T: () => Action },\n { no: 5, name: \"Context\", kind: \"message\", jsonName: \"Context\", T: () => Struct }\n ]);\n }\n create(value?: PartialMessage<EvaluationRequest>): EvaluationRequest {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<EvaluationRequest>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EvaluationRequest): EvaluationRequest {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* optional string RequestID = 1 [json_name = \"RequestID\"];*/ 1:\n message.requestID = reader.string();\n break;\n case /* optional policydecisionpoint.Subject Subject = 2 [json_name = \"Subject\"];*/ 2:\n message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject);\n break;\n case /* optional policydecisionpoint.Resource Resource = 3 [json_name = \"Resource\"];*/ 3:\n message.resource = Resource.internalBinaryRead(reader, reader.uint32(), options, message.resource);\n break;\n case /* optional policydecisionpoint.Action Action = 4 [json_name = \"Action\"];*/ 4:\n message.action = Action.internalBinaryRead(reader, reader.uint32(), options, message.action);\n break;\n case /* optional google.protobuf.Struct Context = 5 [json_name = \"Context\"];*/ 5:\n message.context = Struct.internalBinaryRead(reader, reader.uint32(), options, message.context);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: EvaluationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* optional string RequestID = 1 [json_name = \"RequestID\"]; */\n if (message.requestID !== undefined)\n writer.tag(1, WireType.LengthDelimited).string(message.requestID);\n /* optional policydecisionpoint.Subject Subject = 2 [json_name = \"Subject\"]; */\n if (message.subject)\n Subject.internalBinaryWrite(message.subject, writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n /* optional policydecisionpoint.Resource Resource = 3 [json_name = \"Resource\"]; */\n if (message.resource)\n Resource.internalBinaryWrite(message.resource, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n /* optional policydecisionpoint.Action Action = 4 [json_name = \"Action\"]; */\n if (message.action)\n Action.internalBinaryWrite(message.action, writer.tag(4, WireType.LengthDelimited).fork(), options).join();\n /* optional google.protobuf.Struct Context = 5 [json_name = \"Context\"]; */\n if (message.context)\n Struct.internalBinaryWrite(message.context, writer.tag(5, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.EvaluationRequest\n */\nexport const EvaluationRequest = new EvaluationRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass AuthorizationCheckRequest$Type extends MessageType<AuthorizationCheckRequest> {\n constructor() {\n super(\"policydecisionpoint.AuthorizationCheckRequest\", [\n { no: 1, name: \"AuthorizationModel\", kind: \"message\", jsonName: \"AuthorizationModel\", T: () => AuthorizationModelRequest },\n { no: 2, name: \"RequestID\", kind: \"scalar\", jsonName: \"RequestID\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"Subject\", kind: \"message\", jsonName: \"Subject\", T: () => Subject },\n { no: 4, name: \"Resource\", kind: \"message\", jsonName: \"Resource\", T: () => Resource },\n { no: 5, name: \"Action\", kind: \"message\", jsonName: \"Action\", T: () => Action },\n { no: 6, name: \"Context\", kind: \"message\", jsonName: \"Context\", T: () => Struct },\n { no: 7, name: \"Evaluations\", kind: \"message\", jsonName: \"Evaluations\", repeat: 1 /*RepeatType.PACKED*/, T: () => EvaluationRequest }\n ]);\n }\n create(value?: PartialMessage<AuthorizationCheckRequest>): AuthorizationCheckRequest {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.evaluations = [];\n if (value !== undefined)\n reflectionMergePartial<AuthorizationCheckRequest>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AuthorizationCheckRequest): AuthorizationCheckRequest {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* policydecisionpoint.AuthorizationModelRequest AuthorizationModel = 1 [json_name = \"AuthorizationModel\"];*/ 1:\n message.authorizationModel = AuthorizationModelRequest.internalBinaryRead(reader, reader.uint32(), options, message.authorizationModel);\n break;\n case /* optional string RequestID = 2 [json_name = \"RequestID\"];*/ 2:\n message.requestID = reader.string();\n break;\n case /* optional policydecisionpoint.Subject Subject = 3 [json_name = \"Subject\"];*/ 3:\n message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject);\n break;\n case /* optional policydecisionpoint.Resource Resource = 4 [json_name = \"Resource\"];*/ 4:\n message.resource = Resource.internalBinaryRead(reader, reader.uint32(), options, message.resource);\n break;\n case /* optional policydecisionpoint.Action Action = 5 [json_name = \"Action\"];*/ 5:\n message.action = Action.internalBinaryRead(reader, reader.uint32(), options, message.action);\n break;\n case /* optional google.protobuf.Struct Context = 6 [json_name = \"Context\"];*/ 6:\n message.context = Struct.internalBinaryRead(reader, reader.uint32(), options, message.context);\n break;\n case /* repeated policydecisionpoint.EvaluationRequest Evaluations = 7 [json_name = \"Evaluations\"];*/ 7:\n message.evaluations.push(EvaluationRequest.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: AuthorizationCheckRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* policydecisionpoint.AuthorizationModelRequest AuthorizationModel = 1 [json_name = \"AuthorizationModel\"]; */\n if (message.authorizationModel)\n AuthorizationModelRequest.internalBinaryWrite(message.authorizationModel, writer.tag(1, WireType.LengthDelimited).fork(), options).join();\n /* optional string RequestID = 2 [json_name = \"RequestID\"]; */\n if (message.requestID !== undefined)\n writer.tag(2, WireType.LengthDelimited).string(message.requestID);\n /* optional policydecisionpoint.Subject Subject = 3 [json_name = \"Subject\"]; */\n if (message.subject)\n Subject.internalBinaryWrite(message.subject, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n /* optional policydecisionpoint.Resource Resource = 4 [json_name = \"Resource\"]; */\n if (message.resource)\n Resource.internalBinaryWrite(message.resource, writer.tag(4, WireType.LengthDelimited).fork(), options).join();\n /* optional policydecisionpoint.Action Action = 5 [json_name = \"Action\"]; */\n if (message.action)\n Action.internalBinaryWrite(message.action, writer.tag(5, WireType.LengthDelimited).fork(), options).join();\n /* optional google.protobuf.Struct Context = 6 [json_name = \"Context\"]; */\n if (message.context)\n Struct.internalBinaryWrite(message.context, writer.tag(6, WireType.LengthDelimited).fork(), options).join();\n /* repeated policydecisionpoint.EvaluationRequest Evaluations = 7 [json_name = \"Evaluations\"]; */\n for (let i = 0; i < message.evaluations.length; i++)\n EvaluationRequest.internalBinaryWrite(message.evaluations[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.AuthorizationCheckRequest\n */\nexport const AuthorizationCheckRequest = new AuthorizationCheckRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ReasonResponse$Type extends MessageType<ReasonResponse> {\n constructor() {\n super(\"policydecisionpoint.ReasonResponse\", [\n { no: 1, name: \"Code\", kind: \"scalar\", jsonName: \"Code\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"Message\", kind: \"scalar\", jsonName: \"Message\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<ReasonResponse>): ReasonResponse {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.code = \"\";\n message.message = \"\";\n if (value !== undefined)\n reflectionMergePartial<ReasonResponse>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReasonResponse): ReasonResponse {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Code = 1 [json_name = \"Code\"];*/ 1:\n message.code = reader.string();\n break;\n case /* string Message = 2 [json_name = \"Message\"];*/ 2:\n message.message = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: ReasonResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Code = 1 [json_name = \"Code\"]; */\n if (message.code !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.code);\n /* string Message = 2 [json_name = \"Message\"]; */\n if (message.message !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.message);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.ReasonResponse\n */\nexport const ReasonResponse = new ReasonResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ContextResponse$Type extends MessageType<ContextResponse> {\n constructor() {\n super(\"policydecisionpoint.ContextResponse\", [\n { no: 1, name: \"ID\", kind: \"scalar\", jsonName: \"ID\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"ReasonAdmin\", kind: \"message\", jsonName: \"ReasonAdmin\", T: () => ReasonResponse },\n { no: 3, name: \"ReasonUser\", kind: \"message\", jsonName: \"ReasonUser\", T: () => ReasonResponse }\n ]);\n }\n create(value?: PartialMessage<ContextResponse>): ContextResponse {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.iD = \"\";\n if (value !== undefined)\n reflectionMergePartial<ContextResponse>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ContextResponse): ContextResponse {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string ID = 1 [json_name = \"ID\"];*/ 1:\n message.iD = reader.string();\n break;\n case /* policydecisionpoint.ReasonResponse ReasonAdmin = 2 [json_name = \"ReasonAdmin\"];*/ 2:\n message.reasonAdmin = ReasonResponse.internalBinaryRead(reader, reader.uint32(), options, message.reasonAdmin);\n break;\n case /* policydecisionpoint.ReasonResponse ReasonUser = 3 [json_name = \"ReasonUser\"];*/ 3:\n message.reasonUser = ReasonResponse.internalBinaryRead(reader, reader.uint32(), options, message.reasonUser);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: ContextResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string ID = 1 [json_name = \"ID\"]; */\n if (message.iD !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.iD);\n /* policydecisionpoint.ReasonResponse ReasonAdmin = 2 [json_name = \"ReasonAdmin\"]; */\n if (message.reasonAdmin)\n ReasonResponse.internalBinaryWrite(message.reasonAdmin, writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n /* policydecisionpoint.ReasonResponse ReasonUser = 3 [json_name = \"ReasonUser\"]; */\n if (message.reasonUser)\n ReasonResponse.internalBinaryWrite(message.reasonUser, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.ContextResponse\n */\nexport const ContextResponse = new ContextResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass EvaluationResponse$Type extends MessageType<EvaluationResponse> {\n constructor() {\n super(\"policydecisionpoint.EvaluationResponse\", [\n { no: 1, name: \"Decision\", kind: \"scalar\", jsonName: \"Decision\", T: 8 /*ScalarType.BOOL*/ },\n { no: 2, name: \"RequestID\", kind: \"scalar\", jsonName: \"RequestID\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"Context\", kind: \"message\", jsonName: \"Context\", T: () => ContextResponse }\n ]);\n }\n create(value?: PartialMessage<EvaluationResponse>): EvaluationResponse {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.decision = false;\n if (value !== undefined)\n reflectionMergePartial<EvaluationResponse>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EvaluationResponse): EvaluationResponse {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* bool Decision = 1 [json_name = \"Decision\"];*/ 1:\n message.decision = reader.bool();\n break;\n case /* optional string RequestID = 2 [json_name = \"RequestID\"];*/ 2:\n message.requestID = reader.string();\n break;\n case /* optional policydecisionpoint.ContextResponse Context = 3 [json_name = \"Context\"];*/ 3:\n message.context = ContextResponse.internalBinaryRead(reader, reader.uint32(), options, message.context);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: EvaluationResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* bool Decision = 1 [json_name = \"Decision\"]; */\n if (message.decision !== false)\n writer.tag(1, WireType.Varint).bool(message.decision);\n /* optional string RequestID = 2 [json_name = \"RequestID\"]; */\n if (message.requestID !== undefined)\n writer.tag(2, WireType.LengthDelimited).string(message.requestID);\n /* optional policydecisionpoint.ContextResponse Context = 3 [json_name = \"Context\"]; */\n if (message.context)\n ContextResponse.internalBinaryWrite(message.context, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.EvaluationResponse\n */\nexport const EvaluationResponse = new EvaluationResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass AuthorizationCheckResponse$Type extends MessageType<AuthorizationCheckResponse> {\n constructor() {\n super(\"policydecisionpoint.AuthorizationCheckResponse\", [\n { no: 1, name: \"Decision\", kind: \"scalar\", jsonName: \"Decision\", T: 8 /*ScalarType.BOOL*/ },\n { no: 2, name: \"RequestID\", kind: \"scalar\", jsonName: \"RequestID\", opt: true, T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"Context\", kind: \"message\", jsonName: \"Context\", T: () => ContextResponse },\n { no: 4, name: \"Evaluations\", kind: \"message\", jsonName: \"Evaluations\", repeat: 1 /*RepeatType.PACKED*/, T: () => EvaluationResponse }\n ]);\n }\n create(value?: PartialMessage<AuthorizationCheckResponse>): AuthorizationCheckResponse {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.decision = false;\n message.evaluations = [];\n if (value !== undefined)\n reflectionMergePartial<AuthorizationCheckResponse>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AuthorizationCheckResponse): AuthorizationCheckResponse {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* bool Decision = 1 [json_name = \"Decision\"];*/ 1:\n message.decision = reader.bool();\n break;\n case /* optional string RequestID = 2 [json_name = \"RequestID\"];*/ 2:\n message.requestID = reader.string();\n break;\n case /* optional policydecisionpoint.ContextResponse Context = 3 [json_name = \"Context\"];*/ 3:\n message.context = ContextResponse.internalBinaryRead(reader, reader.uint32(), options, message.context);\n break;\n case /* repeated policydecisionpoint.EvaluationResponse Evaluations = 4 [json_name = \"Evaluations\"];*/ 4:\n message.evaluations.push(EvaluationResponse.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: AuthorizationCheckResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* bool Decision = 1 [json_name = \"Decision\"]; */\n if (message.decision !== false)\n writer.tag(1, WireType.Varint).bool(message.decision);\n /* optional string RequestID = 2 [json_name = \"RequestID\"]; */\n if (message.requestID !== undefined)\n writer.tag(2, WireType.LengthDelimited).string(message.requestID);\n /* optional policydecisionpoint.ContextResponse Context = 3 [json_name = \"Context\"]; */\n if (message.context)\n ContextResponse.internalBinaryWrite(message.context, writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n /* repeated policydecisionpoint.EvaluationResponse Evaluations = 4 [json_name = \"Evaluations\"]; */\n for (let i = 0; i < message.evaluations.length; i++)\n EvaluationResponse.internalBinaryWrite(message.evaluations[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message policydecisionpoint.AuthorizationCheckResponse\n */\nexport const AuthorizationCheckResponse = new AuthorizationCheckResponse$Type();\n/**\n * @generated ServiceType for protobuf service policydecisionpoint.V1PDPService\n */\nexport const V1PDPService = new ServiceType(\"policydecisionpoint.V1PDPService\", [\n { name: \"AuthorizationCheck\", options: {}, I: AuthorizationCheckRequest, O: AuthorizationCheckResponse }\n]);\n","/**\n * Get the type of a JSON value.\n * Distinguishes between array, null and object.\n */\nexport function typeofJsonValue(value) {\n let t = typeof value;\n if (t == \"object\") {\n if (Array.isArray(value))\n return \"array\";\n if (value === null)\n return \"null\";\n }\n return t;\n}\n/**\n * Is this a JSON object (instead of an array or null)?\n */\nexport function isJsonObject(value) {\n return value !== null && typeof value == \"object\" && !Array.isArray(value);\n}\n","// lookup table from base64 character to byte\nlet encTable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n// lookup table from base64 character *code* to byte because lookup by number is fast\nlet decTable = [];\nfor (let i = 0; i < encTable.length; i++)\n decTable[encTable[i].charCodeAt(0)] = i;\n// support base64url variants\ndecTable[\"-\".charCodeAt(0)] = encTable.indexOf(\"+\");\ndecTable[\"_\".charCodeAt(0)] = encTable.indexOf(\"/\");\n/**\n * Decodes a base64 string to a byte array.\n *\n * - ignores white-space, including line breaks and tabs\n * - allows inner padding (can decode concatenated base64 strings)\n * - does not require padding\n * - understands base64url encoding:\n * \"-\" instead of \"+\",\n * \"_\" instead of \"/\",\n * no padding\n */\nexport function base64decode(base64Str) {\n // estimate byte size, not accounting for inner padding and whitespace\n let es = base64Str.length * 3 / 4;\n // if (es % 3 !== 0)\n // throw new Error('invalid base64 string');\n if (base64Str[base64Str.length - 2] == '=')\n es -= 2;\n else if (base64Str[base64Str.length - 1] == '=')\n es -= 1;\n let bytes = new Uint8Array(es), bytePos = 0, // position in byte array\n groupPos = 0, // position in base64 group\n b, // current byte\n p = 0 // previous byte\n ;\n for (let i = 0; i < base64Str.length; i++) {\n b = decTable[base64Str.charCodeAt(i)];\n if (b === undefined) {\n // noinspection FallThroughInSwitchStatementJS\n switch (base64Str[i]) {\n case '=':\n groupPos = 0; // reset state when padding found\n case '\\n':\n case '\\r':\n case '\\t':\n case ' ':\n continue; // skip white-space, and padding\n default:\n throw Error(`invalid base64 string.`);\n }\n }\n switch (groupPos) {\n case 0:\n p = b;\n groupPos = 1;\n break;\n case 1:\n bytes[bytePos++] = p << 2 | (b & 48) >> 4;\n p = b;\n groupPos = 2;\n break;\n case 2:\n bytes[bytePos++] = (p & 15) << 4 | (b & 60) >> 2;\n p = b;\n groupPos = 3;\n break;\n case 3:\n bytes[bytePos++] = (p & 3) << 6 | b;\n groupPos = 0;\n break;\n }\n }\n if (groupPos == 1)\n throw Error(`invalid base64 string.`);\n return bytes.subarray(0, bytePos);\n}\n/**\n * Encodes a byte array to a base64 string.\n * Adds padding at the end.\n * Does not insert newlines.\n */\nexport function base64encode(bytes) {\n let base64 = '', groupPos = 0, // position in base64 group\n b, // current byte\n p = 0; // carry over from previous byte\n for (let i = 0; i < bytes.length; i++) {\n b = bytes[i];\n switch (groupPos) {\n case 0:\n base64 += encTable[b >> 2];\n p = (b & 3) << 4;\n groupPos = 1;\n break;\n case 1:\n base64 += encTable[p | b >> 4];\n p = (b & 15) << 2;\n groupPos = 2;\n break;\n case 2:\n base64 += encTable[p | b >> 6];\n base64 += encTable[b & 63];\n groupPos = 0;\n break;\n }\n }\n // padding required?\n if (groupPos) {\n base64 += encTable[p];\n base64 += '=';\n if (groupPos == 1)\n base64 += '=';\n }\n return base64;\n}\n","/**\n * This handler implements the default behaviour for unknown fields.\n * When reading data, unknown fields are stored on the message, in a\n * symbol property.\n * When writing data, the symbol property is queried and unknown fields\n * are serialized into the output again.\n */\nexport var UnknownFieldHandler;\n(function (UnknownFieldHandler) {\n /**\n * The symbol used to store unknown fields for a message.\n * The property must conform to `UnknownFieldContainer`.\n */\n UnknownFieldHandler.symbol = Symbol.for(\"protobuf-ts/unknown\");\n /**\n * Store an unknown field during binary read directly on the message.\n * This method is compatible with `BinaryReadOptions.readUnknownField`.\n */\n UnknownFieldHandler.onRead = (typeName, message, fieldNo, wireType, data) => {\n let container = is(message) ? message[UnknownFieldHandler.symbol] : message[UnknownFieldHandler.symbol] = [];\n container.push({ no: fieldNo, wireType, data });\n };\n /**\n * Write unknown fields stored for the message to the writer.\n * This method is compatible with `BinaryWriteOptions.writeUnknownFields`.\n */\n UnknownFieldHandler.onWrite = (typeName, message, writer) => {\n for (let { no, wireType, data } of UnknownFieldHandler.list(message))\n writer.tag(no, wireType).raw(data);\n };\n /**\n * List unknown fields stored for the message.\n * Note that there may be multiples fields with the same number.\n */\n UnknownFieldHandler.list = (message, fieldNo) => {\n if (is(message)) {\n let all = message[UnknownFieldHandler.symbol];\n return fieldNo ? all.filter(uf => uf.no == fieldNo) : all;\n }\n return [];\n };\n /**\n * Returns the last unknown field by field number.\n */\n UnknownFieldHandler.last = (message, fieldNo) => UnknownFieldHandler.list(message, fieldNo).slice(-1)[0];\n const is = (message) => message && Array.isArray(message[UnknownFieldHandler.symbol]);\n})(UnknownFieldHandler || (UnknownFieldHandler = {}));\n/**\n * Merges binary write or read options. Later values override earlier values.\n */\nexport function mergeBinaryOptions(a, b) {\n return Object.assign(Object.assign({}, a), b);\n}\n/**\n * Protobuf binary format wire types.\n *\n * A wire type provides just enough information to find the length of the\n * following value.\n *\n * See https://developers.google.com/protocol-buffers/docs/encoding#structure\n */\nexport var WireType;\n(function (WireType) {\n /**\n * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum\n */\n WireType[WireType[\"Varint\"] = 0] = \"Varint\";\n /**\n * Used for fixed64, sfixed64, double.\n * Always 8 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit64\"] = 1] = \"Bit64\";\n /**\n * Used for string, bytes, embedded messages, packed repeated fields\n *\n * Only repeated numeric types (types which use the varint, 32-bit,\n * or 64-bit wire types) can be packed. In proto3, such fields are\n * packed by default.\n */\n WireType[WireType[\"LengthDelimited\"] = 2] = \"LengthDelimited\";\n /**\n * Used for groups\n * @deprecated\n */\n WireType[WireType[\"StartGroup\"] = 3] = \"StartGroup\";\n /**\n * Used for groups\n * @deprecated\n */\n WireType[WireType[\"EndGroup\"] = 4] = \"EndGroup\";\n /**\n * Used for fixed32, sfixed32, float.\n * Always 4 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit32\"] = 5] = \"Bit32\";\n})(WireType || (WireType = {}));\n","// Copyright 2008 Google Inc. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Code generated by the Protocol Buffer compiler is owned by the owner\n// of the input file used when generating it. This code is not\n// standalone and requires a support library to be linked with it. This\n// support library is itself covered by the above license.\n/**\n * Read a 64 bit varint as two JS numbers.\n *\n * Returns tuple:\n * [0]: low bits\n * [0]: high bits\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175\n */\nexport function varint64read() {\n let lowBits = 0;\n let highBits = 0;\n for (let shift = 0; shift < 28; shift += 7) {\n let b = this.buf[this.pos++];\n lowBits |= (b & 0x7F) << shift;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n }\n let middleByte = this.buf[this.pos++];\n // last four bits of the first 32 bit number\n lowBits |= (middleByte & 0x0F) << 28;\n // 3 upper bits are part of the next 32 bit number\n highBits = (middleByte & 0x70) >> 4;\n if ((middleByte & 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n for (let shift = 3; shift <= 31; shift += 7) {\n let b = this.buf[this.pos++];\n highBits |= (b & 0x7F) << shift;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n }\n throw new Error('invalid varint');\n}\n/**\n * Write a 64 bit varint, given as two JS numbers, to the given bytes array.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344\n */\nexport function varint64write(lo, hi, bytes) {\n for (let i = 0; i < 28; i = i + 7) {\n const shift = lo >>> i;\n const hasNext = !((shift >>> 7) == 0 && hi == 0);\n const byte = (hasNext ? shift | 0x80 : shift) & 0xFF;\n bytes.push(byte);\n if (!hasNext) {\n return;\n }\n }\n const splitBits = ((lo >>> 28) & 0x0F) | ((hi & 0x07) << 4);\n const hasMoreBits = !((hi >> 3) == 0);\n bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xFF);\n if (!hasMoreBits) {\n return;\n }\n for (let i = 3; i < 31; i = i + 7) {\n const shift = hi >>> i;\n const hasNext = !((shift >>> 7) == 0);\n const byte = (hasNext ? shift | 0x80 : shift) & 0xFF;\n bytes.push(byte);\n if (!hasNext) {\n return;\n }\n }\n bytes.push((hi >>> 31) & 0x01);\n}\n// constants for binary math\nconst TWO_PWR_32_DBL = (1 << 16) * (1 << 16);\n/**\n * Parse decimal string of 64 bit integer value as two JS numbers.\n *\n * Returns tuple:\n * [0]: minus sign?\n * [1]: low bits\n * [2]: high bits\n *\n * Copyright 2008 Google Inc.\n */\nexport function int64fromString(dec) {\n // Check for minus sign.\n let minus = dec[0] == '-';\n if (minus)\n dec = dec.slice(1);\n // Work 6 decimal digits at a time, acting like we're converting base 1e6\n // digits to binary. This is safe to do with floating point math because\n // Number.isSafeInteger(ALL_32_BITS * 1e6) == true.\n const base = 1e6;\n let lowBits = 0;\n let highBits = 0;\n function add1e6digit(begin, end) {\n // Note: Number('') is 0.\n const digit1e6 = Number(dec.slice(begin, end));\n highBits *= base;\n lowBits = lowBits * base + digit1e6;\n // Carry bits from lowBits to highBits\n if (lowBits >= TWO_PWR_32_DBL) {\n highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0);\n lowBits = lowBits % TWO_PWR_32_DBL;\n }\n }\n add1e6digit(-24, -18);\n add1e6digit(-18, -12);\n add1e6digit(-12, -6);\n add1e6digit(-6);\n return [minus, lowBits, highBits];\n}\n/**\n * Format 64 bit integer value (as two JS numbers) to decimal string.\n *\n * Copyright 2008 Google Inc.\n */\nexport function int64toString(bitsLow, bitsHigh) {\n // Skip the expensive conversion if the number is small enough to use the\n // built-in conversions.\n if ((bitsHigh >>> 0) <= 0x1FFFFF) {\n return '' + (TWO_PWR_32_DBL * bitsHigh + (bitsLow >>> 0));\n }\n // What this code is doing is essentially converting the input number from\n // base-2 to base-1e7, which allows us to represent the 64-bit range with\n // only 3 (very large) digits. Those digits are then trivial to convert to\n // a base-10 string.\n // The magic numbers used here are -\n // 2^24 = 16777216 = (1,6777216) in base-1e7.\n // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7.\n // Split 32:32 representation into 16:24:24 representation so our\n // intermediate digits don't overflow.\n let low = bitsLow & 0xFFFFFF;\n let mid = (((bitsLow >>> 24) | (bitsHigh << 8)) >>> 0) & 0xFFFFFF;\n let high = (bitsHigh >> 16) & 0xFFFF;\n // Assemble our three base-1e7 digits, ignoring carries. The maximum\n // value in a digit at this step is representable as a 48-bit integer, which\n // can be stored in a 64-bit floating point number.\n let digitA = low + (mid * 6777216) + (high * 6710656);\n let digitB = mid + (high * 8147497);\n let digitC = (high * 2);\n // Apply carries from A to B and from B to C.\n let base = 10000000;\n if (digitA >= base) {\n digitB += Math.floor(digitA / base);\n digitA %= base;\n }\n if (digitB >= base) {\n digitC += Math.floor(digitB / base);\n digitB %= base;\n }\n // Convert base-1e7 digits to base-10, with optional leading zeroes.\n function decimalFrom1e7(digit1e7, needLeadingZeros) {\n let partial = digit1e7 ? String(digit1e7) : '';\n if (needLeadingZeros) {\n return '0000000'.slice(partial.length) + partial;\n }\n return partial;\n }\n return decimalFrom1e7(digitC, /*needLeadingZeros=*/ 0) +\n decimalFrom1e7(digitB, /*needLeadingZeros=*/ digitC) +\n // If the final 1e7 digit didn't need leading zeros, we would have\n // returned via the trivial code path at the top.\n decimalFrom1e7(digitA, /*needLeadingZeros=*/ 1);\n}\n/**\n * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144\n */\nexport function varint32write(value, bytes) {\n if (value >= 0) {\n // write value as varint 32\n while (value > 0x7f) {\n bytes.push((value & 0x7f) | 0x80);\n value = value >>> 7;\n }\n bytes.push(value);\n }\n else {\n for (let i = 0; i < 9; i++) {\n bytes.push(value & 127 | 128);\n value = value >> 7;\n }\n bytes.push(1);\n }\n}\n/**\n * Read an unsigned 32 bit varint.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220\n */\nexport function varint32read() {\n let b = this.buf[this.pos++];\n let result = b & 0x7F;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b & 0x7F) << 7;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b & 0x7F) << 14;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b & 0x7F) << 21;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n // Extract only last 4 bits\n b = this.buf[this.pos++];\n result |= (b & 0x0F) << 28;\n for (let readBytes = 5; ((b & 0x80) !== 0) && readBytes < 10; readBytes++)\n b = this.buf[this.pos++];\n if ((b & 0x80) != 0)\n throw new Error('invalid varint');\n this.assertBounds();\n // Result can have 32 bits, convert it to unsigned\n return result >>> 0;\n}\n","import { int64fromString, int64toString } from \"./goog-varint\";\nlet BI;\nexport function detectBi() {\n const dv = new DataView(new ArrayBuffer(8));\n const ok = globalThis.BigInt !== undefined\n && typeof dv.getBigInt64 === \"function\"\n && typeof dv.getBigUint64 === \"function\"\n && typeof dv.setBigInt64 === \"function\"\n && typeof dv.setBigUint64 === \"function\";\n BI = ok ? {\n MIN: BigInt(\"-9223372036854775808\"),\n MAX: BigInt(\"9223372036854775807\"),\n UMIN: BigInt(\"0\"),\n UMAX: BigInt(\"18446744073709551615\"),\n C: BigInt,\n V: dv,\n } : undefined;\n}\ndetectBi();\nfunction assertBi(bi) {\n if (!bi)\n throw new Error(\"BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support\");\n}\n// used to validate from(string) input (when bigint is unavailable)\nconst RE_DECIMAL_STR = /^-?[0-9]+$/;\n// constants for binary math\nconst TWO_PWR_32_DBL = 0x100000000;\nconst HALF_2_PWR_32 = 0x080000000;\n// base class for PbLong and PbULong provides shared code\nclass SharedPbLong {\n /**\n * Create a new instance with the given bits.\n */\n constructor(lo, hi) {\n this.lo = lo | 0;\n this.hi = hi | 0;\n }\n /**\n * Is this instance equal to 0?\n */\n isZero() {\n return this.lo == 0 && this.hi == 0;\n }\n /**\n * Convert to a native number.\n */\n toNumber() {\n let result = this.hi * TWO_PWR_32_DBL + (this.lo >>> 0);\n if (!Number.isSafeInteger(result))\n throw new Error(\"cannot convert to safe number\");\n return result;\n }\n}\n/**\n * 64-bit unsigned integer as two 32-bit values.\n * Converts between `string`, `number` and `bigint` representations.\n */\nexport class PbULong extends SharedPbLong {\n /**\n * Create instance from a `string`, `number` or `bigint`.\n */\n static from(value) {\n if (BI)\n // noinspection FallThroughInSwitchStatementJS\n switch (typeof value) {\n case \"string\":\n if (value == \"0\")\n return this.ZERO;\n if (value == \"\")\n throw new Error('string is no integer');\n value = BI.C(value);\n case \"number\":\n if (value === 0)\n return this.ZERO;\n value = BI.C(value);\n case \"bigint\":\n if (!value)\n return this.ZERO;\n if (value < BI.UMIN)\n throw new Error('signed value for ulong');\n if (value > BI.UMAX)\n throw new Error('ulong too large');\n BI.V.setBigUint64(0, value, true);\n return new PbULong(BI.V.getInt32(0, true), BI.V.getInt32(4, true));\n }\n else\n switch (typeof value) {\n case \"string\":\n if (value == \"0\")\n return this.ZERO;\n value = value.trim();\n if (!RE_DECIMAL_STR.test(value))\n throw new Error('string is no integer');\n let [minus, lo, hi] = int64fromString(value);\n if (minus)\n throw new Error('signed value for ulong');\n return new PbULong(lo, hi);\n case \"number\":\n if (value == 0)\n return this.ZERO;\n if (!Number.isSafeInteger(value))\n throw new Error('number is no integer');\n if (value < 0)\n throw new Error('signed value for ulong');\n return new PbULong(value, value / TWO_PWR_32_DBL);\n }\n throw new Error('unknown value ' + typeof value);\n }\n /**\n * Convert to decimal string.\n */\n toString() {\n return BI ? this.toBigInt().toString() : int64toString(this.lo, this.hi);\n }\n /**\n * Convert to native bigint.\n */\n toBigInt() {\n assertBi(BI);\n BI.V.setInt32(0, this.lo, true);\n BI.V.setInt32(4, this.hi, true);\n return BI.V.getBigUint64(0, true);\n }\n}\n/**\n * ulong 0 singleton.\n */\nPbULong.ZERO = new PbULong(0, 0);\n/**\n * 64-bit signed integer as two 32-bit values.\n * Converts between `string`, `number` and `bigint` representations.\n */\nexport class PbLong extends SharedPbLong {\n /**\n * Create instance from a `string`, `number` or `bigint`.\n */\n static from(value) {\n if (BI)\n // noinspection FallThroughInSwitchStatementJS\n switch (typeof value) {\n case \"string\":\n if (value == \"0\")\n return this.ZERO;\n if (value == \"\")\n throw new Error('string is no integer');\n value = BI.C(value);\n case \"number\":\n if (value === 0)\n return this.ZERO;\n value = BI.C(value);\n case \"bigint\":\n if (!value)\n return this.ZERO;\n if (value < BI.MIN)\n throw new Error('signed long too small');\n if (value > BI.MAX)\n throw new Error('signed long too large');\n BI.V.setBigInt64(0, value, true);\n return new PbLong(BI.V.getInt32(0, true), BI.V.getInt32(4, true));\n }\n else\n switch (typeof value) {\n case \"string\":\n if (value == \"0\")\n return this.ZERO;\n value = value.trim();\n if (!RE_DECIMAL_STR.test(value))\n throw new Error('string is no integer');\n let [minus, lo, hi] = int64fromString(value);\n if (minus) {\n if (hi > HALF_2_PWR_32 || (hi == HALF_2_PWR_32 && lo != 0))\n throw new Error('signed long too small');\n }\n else if (hi >= HALF_2_PWR_32)\n throw new Error('signed long too large');\n let pbl = new PbLong(lo, hi);\n return minus ? pbl.negate() : pbl;\n case \"number\":\n if (value == 0)\n return this.ZERO;\n if (!Number.isSafeInteger(value))\n throw new Error('number is no integer');\n return value > 0\n ? new PbLong(value, value / TWO_PWR_32_DBL)\n : new PbLong(-value, -value / TWO_PWR_32_DBL).negate();\n }\n throw new Error('unknown value ' + typeof value);\n }\n /**\n * Do we have a minus sign?\n */\n isNegative() {\n return (this.hi & HALF_2_PWR_32) !== 0;\n }\n /**\n * Negate two's complement.\n * Invert all the bits and add one to the result.\n */\n negate() {\n let hi = ~this.hi, lo = this.lo;\n if (lo)\n lo = ~lo + 1;\n else\n hi += 1;\n return new PbLong(lo, hi);\n }\n /**\n * Convert to decimal string.\n */\n toString() {\n if (BI)\n return this.toBigInt().toString();\n if (this.isNegative()) {\n let n = this.negate();\n return '-' + int64toString(n.lo, n.hi);\n }\n return int64toString(this.lo, this.hi);\n }\n /**\n * Convert to native bigint.\n */\n toBigInt() {\n assertBi(BI);\n BI.V.setInt32(0, this.lo, true);\n BI.V.setInt32(4, this.hi, true);\n return BI.V.getBigInt64(0, true);\n }\n}\n/**\n * long 0 singleton.\n */\nPbLong.ZERO = new PbLong(0, 0);\n","import { WireType } from \"./binary-format-contract\";\nimport { PbLong, PbULong } from \"./pb-long\";\nimport { varint32read, varint64read } from \"./goog-varint\";\nconst defaultsRead = {\n readUnknownField: true,\n readerFactory: bytes => new BinaryReader(bytes),\n};\n/**\n * Make options for reading binary data form partial options.\n */\nexport function binaryReadOptions(options) {\n return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead;\n}\nexport class BinaryReader {\n constructor(buf, textDecoder) {\n this.varint64 = varint64read; // dirty cast for `this`\n /**\n * Read a `uint32` field, an unsigned 32 bit varint.\n */\n this.uint32 = varint32read; // dirty cast for `this` and access to protected `buf`\n this.buf = buf;\n this.len = buf.length;\n this.pos = 0;\n this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);\n this.textDecoder = textDecoder !== null && textDecoder !== void 0 ? textDecoder : new TextDecoder(\"utf-8\", {\n fatal: true,\n ignoreBOM: true,\n });\n }\n /**\n * Reads a tag - field number and wire type.\n */\n tag() {\n let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;\n if (fieldNo <= 0 || wireType < 0 || wireType > 5)\n throw new Error(\"illegal tag: field no \" + fieldNo + \" wire type \" + wireType);\n return [fieldNo, wireType];\n }\n /**\n * Skip one element on the wire and return the skipped data.\n * Supports WireType.StartGroup since v2.0.0-alpha.23.\n */\n skip(wireType) {\n let start = this.pos;\n // noinspection FallThroughInSwitchStatementJS\n switch (wireType) {\n case WireType.Varint:\n while (this.buf[this.pos++] & 0x80) {\n // ignore\n }\n break;\n case WireType.Bit64:\n this.pos += 4;\n case WireType.Bit32:\n this.pos += 4;\n break;\n case WireType.LengthDelimited:\n let len = this.uint32();\n this.pos += len;\n break;\n case WireType.StartGroup:\n // From descriptor.proto: Group type is deprecated, not supported in proto3.\n // But we must still be able to parse and treat as unknown.\n let t;\n while ((t = this.tag()[1]) !== WireType.EndGroup) {\n this.skip(t);\n }\n break;\n default:\n throw new Error(\"cant skip wire type \" + wireType);\n }\n this.assertBounds();\n return this.buf.subarray(start, this.pos);\n }\n /**\n * Throws error if position in byte array is out of range.\n */\n assertBounds() {\n if (this.pos > this.len)\n throw new RangeError(\"premature EOF\");\n }\n /**\n * Read a `int32` field, a signed 32 bit varint.\n */\n int32() {\n return this.uint32() | 0;\n }\n /**\n * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.\n */\n sint32() {\n let zze = this.uint32();\n // decode zigzag\n return (zze >>> 1) ^ -(zze & 1);\n }\n /**\n * Read a `int64` field, a signed 64-bit varint.\n */\n int64() {\n return new PbLong(...this.varint64());\n }\n /**\n * Read a `uint64` field, an unsigned 64-bit varint.\n */\n uint64() {\n return new PbULong(...this.varint64());\n }\n /**\n * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64() {\n let [lo, hi] = this.varint64();\n // decode zig zag\n let s = -(lo & 1);\n lo = ((lo >>> 1 | (hi & 1) << 31) ^ s);\n hi = (hi >>> 1 ^ s);\n return new PbLong(lo, hi);\n }\n /**\n * Read a `bool` field, a variant.\n */\n bool() {\n let [lo, hi] = this.varint64();\n return lo !== 0 || hi !== 0;\n }\n /**\n * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.\n */\n fixed32() {\n return this.view.getUint32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `sfixed32` field, a signed, fixed-length 32-bit integer.\n */\n sfixed32() {\n return this.view.getInt32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.\n */\n fixed64() {\n return new PbULong(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `fixed64` field, a signed, fixed-length 64-bit integer.\n */\n sfixed64() {\n return new PbLong(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `float` field, 32-bit floating point number.\n */\n float() {\n return this.view.getFloat32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `double` field, a 64-bit floating point number.\n */\n double() {\n return this.view.getFloat64((this.pos += 8) - 8, true);\n }\n /**\n * Read a `bytes` field, length-delimited arbitrary data.\n */\n bytes() {\n let len = this.uint32();\n let start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n /**\n * Read a `string` field, length-delimited data converted to UTF-8 text.\n */\n string() {\n return this.textDecoder.decode(this.bytes());\n }\n}\n","/**\n * assert that condition is true or throw error (with message)\n */\nexport function assert(condition, msg) {\n if (!condition) {\n throw new Error(msg);\n }\n}\n/**\n * assert that value cannot exist = type `never`. throw runtime error if it does.\n */\nexport function assertNever(value, msg) {\n throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected object: ' + value);\n}\nconst FLOAT32_MAX = 3.4028234663852886e+38, FLOAT32_MIN = -3.4028234663852886e+38, UINT32_MAX = 0xFFFFFFFF, INT32_MAX = 0X7FFFFFFF, INT32_MIN = -0X80000000;\nexport function assertInt32(arg) {\n if (typeof arg !== \"number\")\n throw new Error('invalid int 32: ' + typeof arg);\n if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN)\n throw new Error('invalid int 32: ' + arg);\n}\nexport function assertUInt32(arg) {\n if (typeof arg !== \"number\")\n throw new Error('invalid uint 32: ' + typeof arg);\n if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0)\n throw new Error('invalid uint 32: ' + arg);\n}\nexport function assertFloat32(arg) {\n if (typeof arg !== \"number\")\n throw new Error('invalid float 32: ' + typeof arg);\n if (!Number.isFinite(arg))\n return;\n if (arg > FLOAT32_MAX || arg < FLOAT32_MIN)\n throw new Error('invalid float 32: ' + arg);\n}\n","import { PbLong, PbULong } from \"./pb-long\";\nimport { varint32write, varint64write } from \"./goog-varint\";\nimport { assertFloat32, assertInt32, assertUInt32 } from \"./assert\";\nconst defaultsWrite = {\n writeUnknownFields: true,\n writerFactory: () => new BinaryWriter(),\n};\n/**\n * Make options for writing binary data form partial options.\n */\nexport function binaryWriteOptions(options) {\n return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite;\n}\nexport class BinaryWriter {\n constructor(textEncoder) {\n /**\n * Previous fork states.\n */\n this.stack = [];\n this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder();\n this.chunks = [];\n this.buf = [];\n }\n /**\n * Return all bytes written and reset this writer.\n */\n finish() {\n this.chunks.push(new Uint8Array(this.buf)); // flush the buffer\n let len = 0;\n for (let i = 0; i < this.chunks.length; i++)\n len += this.chunks[i].length;\n let bytes = new Uint8Array(len);\n let offset = 0;\n for (let i = 0; i < this.chunks.length; i++) {\n bytes.set(this.chunks[i], offset);\n offset += this.chunks[i].length;\n }\n this.chunks = [];\n return bytes;\n }\n /**\n * Start a new fork for length-delimited data like a message\n * or a packed repeated field.\n *\n * Must be joined later with `join()`.\n */\n fork() {\n this.stack.push({ chunks: this.chunks, buf: this.buf });\n this.chunks = [];\n this.buf = [];\n return this;\n }\n /**\n * Join the last fork. Write its length and bytes, then\n * return to the previous state.\n */\n join() {\n // get chunk of fork\n let chunk = this.finish();\n // restore previous state\n let prev = this.stack.pop();\n if (!prev)\n throw new Error('invalid state, fork stack empty');\n this.chunks = prev.chunks;\n this.buf = prev.buf;\n // write length of chunk as varint\n this.uint32(chunk.byteLength);\n return this.raw(chunk);\n }\n /**\n * Writes a tag (field number and wire type).\n *\n * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`.\n *\n * Generated code should compute the tag ahead of time and call `uint32()`.\n */\n tag(fieldNo, type) {\n return this.uint32((fieldNo << 3 | type) >>> 0);\n }\n /**\n * Write a chunk of raw bytes.\n */\n raw(chunk) {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf));\n this.buf = [];\n }\n this.chunks.push(chunk);\n return this;\n }\n /**\n * Write a `uint32` value, an unsigned 32 bit varint.\n */\n uint32(value) {\n assertUInt32(value);\n // write value as varint 32, inlined for speed\n while (value > 0x7f) {\n this.buf.push((value & 0x7f) | 0x80);\n value = value >>> 7;\n }\n this.buf.push(value);\n return this;\n }\n /**\n * Write a `int32` value, a signed 32 bit varint.\n */\n int32(value) {\n assertInt32(value);\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `bool` value, a variant.\n */\n bool(value) {\n this.buf.push(value ? 1 : 0);\n return this;\n }\n /**\n * Write a `bytes` value, length-delimited arbitrary data.\n */\n bytes(value) {\n this.uint32(value.byteLength); // write length of chunk as varint\n return this.raw(value);\n }\n /**\n * Write a `string` value, length-delimited data converted to UTF-8 text.\n */\n string(value) {\n let chunk = this.textEncoder.encode(value);\n this.uint32(chunk.byteLength); // write length of chunk as varint\n return this.raw(chunk);\n }\n /**\n * Write a `float` value, 32-bit floating point number.\n */\n float(value) {\n assertFloat32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setFloat32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `double` value, a 64-bit floating point number.\n */\n double(value) {\n let chunk = new Uint8Array(8);\n new DataView(chunk.buffer).setFloat64(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.\n */\n fixed32(value) {\n assertUInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setUint32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.\n */\n sfixed32(value) {\n assertInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setInt32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.\n */\n sint32(value) {\n assertInt32(value);\n // zigzag encode\n value = ((value << 1) ^ (value >> 31)) >>> 0;\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `fixed64` value, a signed, fixed-length 64-bit integer.\n */\n sfixed64(value) {\n let chunk = new Uint8Array(8);\n let view = new DataView(chunk.buffer);\n let long = PbLong.from(value);\n view.setInt32(0, long.lo, true);\n view.setInt32(4, long.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.\n */\n fixed64(value) {\n let chunk = new Uint8Array(8);\n let view = new DataView(chunk.buffer);\n let long = PbULong.from(value);\n view.setInt32(0, long.lo, true);\n view.setInt32(4, long.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `int64` value, a signed 64-bit varint.\n */\n int64(value) {\n let long = PbLong.from(value);\n varint64write(long.lo, long.hi, this.buf);\n return this;\n }\n /**\n * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64(value) {\n let long = PbLong.from(value), \n // zigzag encode\n sign = long.hi >> 31, lo = (long.lo << 1) ^ sign, hi = ((long.hi << 1) | (long.lo >>> 31)) ^ sign;\n varint64write(lo, hi, this.buf);\n return this;\n }\n /**\n * Write a `uint64` value, an unsigned 64-bit varint.\n */\n uint64(value) {\n let long = PbULong.from(value);\n varint64write(long.lo, long.hi, this.buf);\n return this;\n }\n}\n","const defaultsWrite = {\n emitDefaultValues: false,\n enumAsInteger: false,\n useProtoFieldName: false,\n prettySpaces: 0,\n}, defaultsRead = {\n ignoreUnknownFields: false,\n};\n/**\n * Make options for reading JSON data from partial options.\n */\nexport function jsonReadOptions(options) {\n return options ? Object.assign(Object.assign({}, defaultsRead), options) : defaultsRead;\n}\n/**\n * Make options for writing JSON data from partial options.\n */\nexport function jsonWriteOptions(options) {\n return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite;\n}\n/**\n * Merges JSON write or read options. Later values override earlier values. Type registries are merged.\n */\nexport function mergeJsonOptions(a, b) {\n var _a, _b;\n let c = Object.assign(Object.assign({}, a), b);\n c.typeRegistry = [...((_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : []), ...((_b = b === null || b === void 0 ? void 0 : b.typeRegistry) !== null && _b !== void 0 ? _b : [])];\n return c;\n}\n","/**\n * The symbol used as a key on message objects to store the message type.\n *\n * Note that this is an experimental feature - it is here to stay, but\n * implementation details may change without notice.\n */\nexport const MESSAGE_TYPE = Symbol.for(\"protobuf-ts/message-type\");\n","/**\n * Converts snake_case to lowerCamelCase.\n *\n * Should behave like protoc:\n * https://github.com/protocolbuffers/protobuf/blob/e8ae137c96444ea313485ed1118c5e43b2099cf1/src/google/protobuf/compiler/java/java_helpers.cc#L118\n */\nexport function lowerCamelCase(snakeCase) {\n let capNext = false;\n const sb = [];\n for (let i = 0; i < snakeCase.length; i++) {\n let next = snakeCase.charAt(i);\n if (next == '_') {\n capNext = true;\n }\n else if (/\\d/.test(next)) {\n sb.push(next);\n capNext = true;\n }\n else if (capNext) {\n sb.push(next.toUpperCase());\n capNext = false;\n }\n else if (i == 0) {\n sb.push(next.toLowerCase());\n }\n else {\n sb.push(next);\n }\n }\n return sb.join('');\n}\n","import { lowerCamelCase } from \"./lower-camel-case\";\n/**\n * Scalar value types. This is a subset of field types declared by protobuf\n * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE\n * are omitted, but the numerical values are identical.\n */\nexport var ScalarType;\n(function (ScalarType) {\n // 0 is reserved for errors.\n // Order is weird for historical reasons.\n ScalarType[ScalarType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n ScalarType[ScalarType[\"FLOAT\"] = 2] = \"FLOAT\";\n // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if\n // negative values are likely.\n ScalarType[ScalarType[\"INT64\"] = 3] = \"INT64\";\n ScalarType[ScalarType[\"UINT64\"] = 4] = \"UINT64\";\n // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if\n // negative values are likely.\n ScalarType[ScalarType[\"INT32\"] = 5] = \"INT32\";\n ScalarType[ScalarType[\"FIXED64\"] = 6] = \"FIXED64\";\n ScalarType[ScalarType[\"FIXED32\"] = 7] = \"FIXED32\";\n ScalarType[ScalarType[\"BOOL\"] = 8] = \"BOOL\";\n ScalarType[ScalarType[\"STRING\"] = 9] = \"STRING\";\n // Tag-delimited aggregate.\n // Group type is deprecated and not supported in proto3. However, Proto3\n // implementations should still be able to parse the group wire format and\n // treat group fields as unknown fields.\n // TYPE_GROUP = 10,\n // TYPE_MESSAGE = 11, // Length-delimited aggregate.\n // New in version 2.\n ScalarType[ScalarType[\"BYTES\"] = 12] = \"BYTES\";\n ScalarType[ScalarType[\"UINT32\"] = 13] = \"UINT32\";\n // TYPE_ENUM = 14,\n ScalarType[ScalarType[\"SFIXED32\"] = 15] = \"SFIXED32\";\n ScalarType[ScalarType[\"SFIXED64\"] = 16] = \"SFIXED64\";\n ScalarType[ScalarType[\"SINT32\"] = 17] = \"SINT32\";\n ScalarType[ScalarType[\"SINT64\"] = 18] = \"SINT64\";\n})(ScalarType || (ScalarType = {}));\n/**\n * JavaScript representation of 64 bit integral types. Equivalent to the\n * field option \"jstype\".\n *\n * By default, protobuf-ts represents 64 bit types as `bigint`.\n *\n * You can change the default behaviour by enabling the plugin parameter\n * `long_type_string`, which will represent 64 bit types as `string`.\n *\n * Alternatively, you can change the behaviour for individual fields\n * with the field option \"jstype\":\n *\n * ```protobuf\n * uint64 my_field = 1 [jstype = JS_STRING];\n * uint64 other_field = 2 [jstype = JS_NUMBER];\n * ```\n */\nexport var LongType;\n(function (LongType) {\n /**\n * Use JavaScript `bigint`.\n *\n * Field option `[jstype = JS_NORMAL]`.\n */\n LongType[LongType[\"BIGINT\"] = 0] = \"BIGINT\";\n /**\n * Use JavaScript `string`.\n *\n * Field option `[jstype = JS_STRING]`.\n */\n LongType[LongType[\"STRING\"] = 1] = \"STRING\";\n /**\n * Use JavaScript `number`.\n *\n * Large values will loose precision.\n *\n * Field option `[jstype = JS_NUMBER]`.\n */\n LongType[LongType[\"NUMBER\"] = 2] = \"NUMBER\";\n})(LongType || (LongType = {}));\n/**\n * Protobuf 2.1.0 introduced packed repeated fields.\n * Setting the field option `[packed = true]` enables packing.\n *\n * In proto3, all repeated fields are packed by default.\n * Setting the field option `[packed = false]` disables packing.\n *\n * Packed repeated fields are encoded with a single tag,\n * then a length-delimiter, then the element values.\n *\n * Unpacked repeated fields are encoded with a tag and\n * value for each element.\n *\n * `bytes` and `string` cannot be packed.\n */\nexport var RepeatType;\n(function (RepeatType) {\n /**\n * The field is not repeated.\n */\n RepeatType[RepeatType[\"NO\"] = 0] = \"NO\";\n /**\n * The field is repeated and should be packed.\n * Invalid for `bytes` and `string`, they cannot be packed.\n */\n RepeatType[RepeatType[\"PACKED\"] = 1] = \"PACKED\";\n /**\n * The field is repeated but should not be packed.\n * The only valid repeat type for repeated `bytes` and `string`.\n */\n RepeatType[RepeatType[\"UNPACKED\"] = 2] = \"UNPACKED\";\n})(RepeatType || (RepeatType = {}));\n/**\n * Turns PartialFieldInfo into FieldInfo.\n */\nexport function normalizeFieldInfo(field) {\n var _a, _b, _c, _d;\n field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : lowerCamelCase(field.name);\n field.jsonName = (_b = field.jsonName) !== null && _b !== void 0 ? _b : lowerCamelCase(field.name);\n field.repeat = (_c = field.repeat) !== null && _c !== void 0 ? _c : RepeatType.NO;\n field.opt = (_d = field.opt) !== null && _d !== void 0 ? _d : (field.repeat ? false : field.oneof ? false : field.kind == \"message\");\n return field;\n}\n/**\n * Read custom field options from a generated message type.\n *\n * @deprecated use readFieldOption()\n */\nexport function readFieldOptions(messageType, fieldName, extensionName, extensionType) {\n var _a;\n const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options;\n return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : undefined;\n}\nexport function readFieldOption(messageType, fieldName, extensionName, extensionType) {\n var _a;\n const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options;\n if (!options) {\n return undefined;\n }\n const optionVal = options[extensionName];\n if (optionVal === undefined) {\n return optionVal;\n }\n return extensionType ? extensionType.fromJson(optionVal) : optionVal;\n}\nexport function readMessageOption(messageType, extensionName, extensionType) {\n const options = messageType.options;\n const optionVal = options[extensionName];\n if (optionVal === undefined) {\n return optionVal;\n }\n return extensionType ? extensionType.fromJson(optionVal) : optionVal;\n}\n","/**\n * Is the given value a valid oneof group?\n *\n * We represent protobuf `oneof` as algebraic data types (ADT) in generated\n * code. But when working with messages of unknown type, the ADT does not\n * help us.\n *\n * This type guard checks if the given object adheres to the ADT rules, which\n * are as follows:\n *\n * 1) Must be an object.\n *\n * 2) Must have a \"oneofKind\" discriminator property.\n *\n * 3) If \"oneofKind\" is `undefined`, no member field is selected. The object\n * must not have any other properties.\n *\n * 4) If \"oneofKind\" is a `string`, the member field with this name is\n * selected.\n *\n * 5) If a member field is selected, the object must have a second property\n * with this name. The property must not be `undefined`.\n *\n * 6) No extra properties are allowed. The object has either one property\n * (no selection) or two properties (selection).\n *\n */\nexport function isOneofGroup(any) {\n if (typeof any != 'object' || any === null || !any.hasOwnProperty('oneofKind')) {\n return false;\n }\n switch (typeof any.oneofKind) {\n case \"string\":\n if (any[any.oneofKind] === undefined)\n return false;\n return Object.keys(any).length == 2;\n case \"undefined\":\n return Object.keys(any).length == 1;\n default:\n return false;\n }\n}\n/**\n * Returns the value of the given field in a oneof group.\n */\nexport function getOneofValue(oneof, kind) {\n return oneof[kind];\n}\nexport function setOneofValue(oneof, kind, value) {\n if (oneof.oneofKind !== undefined) {\n delete oneof[oneof.oneofKind];\n }\n oneof.oneofKind = kind;\n if (value !== undefined) {\n oneof[kind] = value;\n }\n}\nexport function setUnknownOneofValue(oneof, kind, value) {\n if (oneof.oneofKind !== undefined) {\n delete oneof[oneof.oneofKind];\n }\n oneof.oneofKind = kind;\n if (value !== undefined && kind !== undefined) {\n oneof[kind] = value;\n }\n}\n/**\n * Removes the selected field in a oneof group.\n *\n * Note that the recommended way to modify a oneof group is to set\n * a new object:\n *\n * ```ts\n * message.result = { oneofKind: undefined };\n * ```\n */\nexport function clearOneofValue(oneof) {\n if (oneof.oneofKind !== undefined) {\n delete oneof[oneof.oneofKind];\n }\n oneof.oneofKind = undefined;\n}\n/**\n * Returns the selected value of the given oneof group.\n *\n * Not that the recommended way to access a oneof group is to check\n * the \"oneofKind\" property and let TypeScript narrow down the union\n * type for you:\n *\n * ```ts\n * if (message.result.oneofKind === \"error\") {\n * message.result.error; // string\n * }\n * ```\n *\n * In the rare case you just need the value, and do not care about\n * which protobuf field is selected, you can use this function\n * for convenience.\n */\nexport function getSelectedOneofValue(oneof) {\n if (oneof.oneofKind === undefined) {\n return undefined;\n }\n return oneof[oneof.oneofKind];\n}\n","import { LongType, ScalarType } from \"./reflection-info\";\nimport { isOneofGroup } from \"./oneof\";\n// noinspection JSMethodCanBeStatic\nexport class ReflectionTypeCheck {\n constructor(info) {\n var _a;\n this.fields = (_a = info.fields) !== null && _a !== void 0 ? _a : [];\n }\n prepare() {\n if (this.data)\n return;\n const req = [], known = [], oneofs = [];\n for (let field of this.fields) {\n if (field.oneof) {\n if (!oneofs.includes(field.oneof)) {\n oneofs.push(field.oneof);\n req.push(field.oneof);\n known.push(field.oneof);\n }\n }\n else {\n known.push(field.localName);\n switch (field.kind) {\n case \"scalar\":\n case \"enum\":\n if (!field.opt || field.repeat)\n req.push(field.localName);\n break;\n case \"message\":\n if (field.repeat)\n req.push(field.localName);\n break;\n case \"map\":\n req.push(field.localName);\n break;\n }\n }\n }\n this.data = { req, known, oneofs: Object.values(oneofs) };\n }\n /**\n * Is the argument a valid message as specified by the\n * reflection information?\n *\n * Checks all field types recursively. The `depth`\n * specifies how deep into the structure the check will be.\n *\n * With a depth of 0, only the presence of fields\n * is checked.\n *\n * With a depth of 1 or more, the field types are checked.\n *\n * With a depth of 2 or more, the members of map, repeated\n * and message fields are checked.\n *\n * Message fields will be checked recursively with depth - 1.\n *\n * The number of map entries / repeated values being checked\n * is < depth.\n */\n is(message, depth, allowExcessProperties = false) {\n if (depth < 0)\n return true;\n if (message === null || message === undefined || typeof message != 'object')\n return false;\n this.prepare();\n let keys = Object.keys(message), data = this.data;\n // if a required field is missing in arg, this cannot be a T\n if (keys.length < data.req.length || data.req.some(n => !keys.includes(n)))\n return false;\n if (!allowExcessProperties) {\n // if the arg contains a key we dont know, this is not a literal T\n if (keys.some(k => !data.known.includes(k)))\n return false;\n }\n // \"With a depth of 0, only the presence and absence of fields is checked.\"\n // \"With a depth of 1 or more, the field types are checked.\"\n if (depth < 1) {\n return true;\n }\n // check oneof group\n for (const name of data.oneofs) {\n const group = message[name];\n if (!isOneofGroup(group))\n return false;\n if (group.oneofKind === undefined)\n continue;\n const field = this.fields.find(f => f.localName === group.oneofKind);\n if (!field)\n return false; // we found no field, but have a kind, something is wrong\n if (!this.field(group[group.oneofKind], field, allowExcessProperties, depth))\n return false;\n }\n // check types\n for (const field of this.fields) {\n if (field.oneof !== undefined)\n continue;\n if (!this.field(message[field.localName], field, allowExcessProperties, depth))\n return false;\n }\n return true;\n }\n field(arg, field, allowExcessProperties, depth) {\n let repeated = field.repeat;\n switch (field.kind) {\n case \"scalar\":\n if (arg === undefined)\n return field.opt;\n if (repeated)\n return this.scalars(arg, field.T, depth, field.L);\n return this.scalar(arg, field.T, field.L);\n case \"enum\":\n if (arg === undefined)\n return field.opt;\n if (repeated)\n return this.scalars(arg, ScalarType.INT32, depth);\n return this.scalar(arg, ScalarType.INT32);\n case \"message\":\n if (arg === undefined)\n return true;\n if (repeated)\n return this.messages(arg, field.T(), allowExcessProperties, depth);\n return this.message(arg, field.T(), allowExcessProperties, depth);\n case \"map\":\n if (typeof arg != 'object' || arg === null)\n return false;\n if (depth < 2)\n return true;\n if (!this.mapKeys(arg, field.K, depth))\n return false;\n switch (field.V.kind) {\n case \"scalar\":\n return this.scalars(Object.values(arg), field.V.T, depth, field.V.L);\n case \"enum\":\n return this.scalars(Object.values(arg), ScalarType.INT32, depth);\n case \"message\":\n return this.messages(Object.values(arg), field.V.T(), allowExcessProperties, depth);\n }\n break;\n }\n return true;\n }\n message(arg, type, allowExcessProperties, depth) {\n if (allowExcessProperties) {\n return type.isAssignable(arg, depth);\n }\n return type.is(arg, depth);\n }\n messages(arg, type, allowExcessProperties, depth) {\n if (!Array.isArray(arg))\n return false;\n if (depth < 2)\n return true;\n if (allowExcessProperties) {\n for (let i = 0; i < arg.length && i < depth; i++)\n if (!type.isAssignable(arg[i], depth - 1))\n return false;\n }\n else {\n for (let i = 0; i < arg.length && i < depth; i++)\n if (!type.is(arg[i], depth - 1))\n return false;\n }\n return true;\n }\n scalar(arg, type, longType) {\n let argType = typeof arg;\n switch (type) {\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n switch (longType) {\n case LongType.BIGINT:\n return argType == \"bigint\";\n case LongType.NUMBER:\n return argType == \"number\" && !isNaN(arg);\n default:\n return argType == \"string\";\n }\n case ScalarType.BOOL:\n return argType == 'boolean';\n case ScalarType.STRING:\n return argType == 'string';\n case ScalarType.BYTES:\n return arg instanceof Uint8Array;\n case ScalarType.DOUBLE:\n case ScalarType.FLOAT:\n return argType == 'number' && !isNaN(arg);\n default:\n // case ScalarType.UINT32:\n // case ScalarType.FIXED32:\n // case ScalarType.INT32:\n // case ScalarType.SINT32:\n // case ScalarType.SFIXED32:\n return argType == 'number' && Number.isInteger(arg);\n }\n }\n scalars(arg, type, depth, longType) {\n if (!Array.isArray(arg))\n return false;\n if (depth < 2)\n return true;\n if (Array.isArray(arg))\n for (let i = 0; i < arg.length && i < depth; i++)\n if (!this.scalar(arg[i], type, longType))\n return false;\n return true;\n }\n mapKeys(map, type, depth) {\n let keys = Object.keys(map);\n switch (type) {\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n case ScalarType.UINT32:\n return this.scalars(keys.slice(0, depth).map(k => parseInt(k)), type, depth);\n case ScalarType.BOOL:\n return this.scalars(keys.slice(0, depth).map(k => k == 'true' ? true : k == 'false' ? false : k), type, depth);\n default:\n return this.scalars(keys, type, depth, LongType.STRING);\n }\n }\n}\n","import { LongType } from \"./reflection-info\";\n/**\n * Utility method to convert a PbLong or PbUlong to a JavaScript\n * representation during runtime.\n *\n * Works with generated field information, `undefined` is equivalent\n * to `STRING`.\n */\nexport function reflectionLongConvert(long, type) {\n switch (type) {\n case LongType.BIGINT:\n return long.toBigInt();\n case LongType.NUMBER:\n return long.toNumber();\n default:\n // case undefined:\n // case LongType.STRING:\n return long.toString();\n }\n}\n","import { isJsonObject, typeofJsonValue } from \"./json-typings\";\nimport { base64decode } from \"./base64\";\nimport { LongType, ScalarType } from \"./reflection-info\";\nimport { PbLong, PbULong } from \"./pb-long\";\nimport { assert, assertFloat32, assertInt32, assertUInt32 } from \"./assert\";\nimport { reflectionLongConvert } from \"./reflection-long-convert\";\n/**\n * Reads proto3 messages in canonical JSON format using reflection information.\n *\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n */\nexport class ReflectionJsonReader {\n constructor(info) {\n this.info = info;\n }\n prepare() {\n var _a;\n if (this.fMap === undefined) {\n this.fMap = {};\n const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : [];\n for (const field of fieldsInput) {\n this.fMap[field.name] = field;\n this.fMap[field.jsonName] = field;\n this.fMap[field.localName] = field;\n }\n }\n }\n // Cannot parse JSON <type of jsonValue> for <type name>#<fieldName>.\n assert(condition, fieldName, jsonValue) {\n if (!condition) {\n let what = typeofJsonValue(jsonValue);\n if (what == \"number\" || what == \"boolean\")\n what = jsonValue.toString();\n throw new Error(`Cannot parse JSON ${what} for ${this.info.typeName}#${fieldName}`);\n }\n }\n /**\n * Reads a message from canonical JSON format into the target message.\n *\n * Repeated fields are appended. Map entries are added, overwriting\n * existing keys.\n *\n * If a message field is already present, it will be merged with the\n * new data.\n */\n read(input, message, options) {\n this.prepare();\n const oneofsHandled = [];\n for (const [jsonKey, jsonValue] of Object.entries(input)) {\n const field = this.fMap[jsonKey];\n if (!field) {\n if (!options.ignoreUnknownFields)\n throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${jsonKey}`);\n continue;\n }\n const localName = field.localName;\n // handle oneof ADT\n let target; // this will be the target for the field value, whether it is member of a oneof or not\n if (field.oneof) {\n if (jsonValue === null && (field.kind !== 'enum' || field.T()[0] !== 'google.protobuf.NullValue')) {\n continue;\n }\n // since json objects are unordered by specification, it is not possible to take the last of multiple oneofs\n if (oneofsHandled.includes(field.oneof))\n throw new Error(`Multiple members of the oneof group \"${field.oneof}\" of ${this.info.typeName} are present in JSON.`);\n oneofsHandled.push(field.oneof);\n target = message[field.oneof] = {\n oneofKind: localName\n };\n }\n else {\n target = message;\n }\n // we have handled oneof above. we just have read the value into `target`.\n if (field.kind == 'map') {\n if (jsonValue === null) {\n continue;\n }\n // check input\n this.assert(isJsonObject(jsonValue), field.name, jsonValue);\n // our target to put map entries into\n const fieldObj = target[localName];\n // read entries\n for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) {\n this.assert(jsonObjValue !== null, field.name + \" map value\", null);\n // read value\n let val;\n switch (field.V.kind) {\n case \"message\":\n val = field.V.T().internalJsonRead(jsonObjValue, options);\n break;\n case \"enum\":\n val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields);\n if (val === false)\n continue;\n break;\n case \"scalar\":\n val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name);\n break;\n }\n this.assert(val !== undefined, field.name + \" map value\", jsonObjValue);\n // read key\n let key = jsonObjKey;\n if (field.K == ScalarType.BOOL)\n key = key == \"true\" ? true : key == \"false\" ? false : key;\n key = this.scalar(key, field.K, LongType.STRING, field.name).toString();\n fieldObj[key] = val;\n }\n }\n else if (field.repeat) {\n if (jsonValue === null)\n continue;\n // check input\n this.assert(Array.isArray(jsonValue), field.name, jsonValue);\n // our target to put array entries into\n const fieldArr = target[localName];\n // read array entries\n for (const jsonItem of jsonValue) {\n this.assert(jsonItem !== null, field.name, null);\n let val;\n switch (field.kind) {\n case \"message\":\n val = field.T().internalJsonRead(jsonItem, options);\n break;\n case \"enum\":\n val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields);\n if (val === false)\n continue;\n break;\n case \"scalar\":\n val = this.scalar(jsonItem, field.T, field.L, field.name);\n break;\n }\n this.assert(val !== undefined, field.name, jsonValue);\n fieldArr.push(val);\n }\n }\n else {\n switch (field.kind) {\n case \"message\":\n if (jsonValue === null && field.T().typeName != 'google.protobuf.Value') {\n this.assert(field.oneof === undefined, field.name + \" (oneof member)\", null);\n continue;\n }\n target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]);\n break;\n case \"enum\":\n if (jsonValue === null)\n continue;\n let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields);\n if (val === false)\n continue;\n target[localName] = val;\n break;\n case \"scalar\":\n if (jsonValue === null)\n continue;\n target[localName] = this.scalar(jsonValue, field.T, field.L, field.name);\n break;\n }\n }\n }\n }\n /**\n * Returns `false` for unrecognized string representations.\n *\n * google.protobuf.NullValue accepts only JSON `null` (or the old `\"NULL_VALUE\"`).\n */\n enum(type, json, fieldName, ignoreUnknownFields) {\n if (type[0] == 'google.protobuf.NullValue')\n assert(json === null || json === \"NULL_VALUE\", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} only accepts null.`);\n if (json === null)\n // we require 0 to be default value for all enums\n return 0;\n switch (typeof json) {\n case \"number\":\n assert(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`);\n return json;\n case \"string\":\n let localEnumName = json;\n if (type[2] && json.substring(0, type[2].length) === type[2])\n // lookup without the shared prefix\n localEnumName = json.substring(type[2].length);\n let enumNumber = type[1][localEnumName];\n if (typeof enumNumber === 'undefined' && ignoreUnknownFields) {\n return false;\n }\n assert(typeof enumNumber == \"number\", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type[0]} has no value for \"${json}\".`);\n return enumNumber;\n }\n assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}\".`);\n }\n scalar(json, type, longType, fieldName) {\n let e;\n try {\n switch (type) {\n // float, double: JSON value will be a number or one of the special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n // Either numbers or strings are accepted. Exponent notation is also accepted.\n case ScalarType.DOUBLE:\n case ScalarType.FLOAT:\n if (json === null)\n return .0;\n if (json === \"NaN\")\n return Number.NaN;\n if (json === \"Infinity\")\n return Number.POSITIVE_INFINITY;\n if (json === \"-Infinity\")\n return Number.NEGATIVE_INFINITY;\n if (json === \"\") {\n e = \"empty string\";\n break;\n }\n if (typeof json == \"string\" && json.trim().length !== json.length) {\n e = \"extra whitespace\";\n break;\n }\n if (typeof json != \"string\" && typeof json != \"number\") {\n break;\n }\n let float = Number(json);\n if (Number.isNaN(float)) {\n e = \"not a number\";\n break;\n }\n if (!Number.isFinite(float)) {\n // infinity and -infinity are handled by string representation above, so this is an error\n e = \"too large or small\";\n break;\n }\n if (type == ScalarType.FLOAT)\n assertFloat32(float);\n return float;\n // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n case ScalarType.UINT32:\n if (json === null)\n return 0;\n let int32;\n if (typeof json == \"number\")\n int32 = json;\n else if (json === \"\")\n e = \"empty string\";\n else if (typeof json == \"string\") {\n if (json.trim().length !== json.length)\n e = \"extra whitespace\";\n else\n int32 = Number(json);\n }\n if (int32 === undefined)\n break;\n if (type == ScalarType.UINT32)\n assertUInt32(int32);\n else\n assertInt32(int32);\n return int32;\n // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted.\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n if (json === null)\n return reflectionLongConvert(PbLong.ZERO, longType);\n if (typeof json != \"number\" && typeof json != \"string\")\n break;\n return reflectionLongConvert(PbLong.from(json), longType);\n case ScalarType.FIXED64:\n case ScalarType.UINT64:\n if (json === null)\n return reflectionLongConvert(PbULong.ZERO, longType);\n if (typeof json != \"number\" && typeof json != \"string\")\n break;\n return reflectionLongConvert(PbULong.from(json), longType);\n // bool:\n case ScalarType.BOOL:\n if (json === null)\n return false;\n if (typeof json !== \"boolean\")\n break;\n return json;\n // string:\n case ScalarType.STRING:\n if (json === null)\n return \"\";\n if (typeof json !== \"string\") {\n e = \"extra whitespace\";\n break;\n }\n try {\n encodeURIComponent(json);\n }\n catch (e) {\n e = \"invalid UTF8\";\n break;\n }\n return json;\n // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.\n // Either standard or URL-safe base64 encoding with/without paddings are accepted.\n case ScalarType.BYTES:\n if (json === null || json === \"\")\n return new Uint8Array(0);\n if (typeof json !== 'string')\n break;\n return base64decode(json);\n }\n }\n catch (error) {\n e = error.message;\n }\n this.assert(false, fieldName + (e ? \" - \" + e : \"\"), json);\n }\n}\n","import { base64encode } from \"./base64\";\nimport { PbLong, PbULong } from \"./pb-long\";\nimport { ScalarType } from \"./reflection-info\";\nimport { assert, assertFloat32, assertInt32, assertUInt32 } from \"./assert\";\n/**\n * Writes proto3 messages in canonical JSON format using reflection\n * information.\n *\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n */\nexport class ReflectionJsonWriter {\n constructor(info) {\n var _a;\n this.fields = (_a = info.fields) !== null && _a !== void 0 ? _a : [];\n }\n /**\n * Converts the message to a JSON object, based on the field descriptors.\n */\n write(message, options) {\n const json = {}, source = message;\n for (const field of this.fields) {\n // field is not part of a oneof, simply write as is\n if (!field.oneof) {\n let jsonValue = this.field(field, source[field.localName], options);\n if (jsonValue !== undefined)\n json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue;\n continue;\n }\n // field is part of a oneof\n const group = source[field.oneof];\n if (group.oneofKind !== field.localName)\n continue; // not selected, skip\n const opt = field.kind == 'scalar' || field.kind == 'enum'\n ? Object.assign(Object.assign({}, options), { emitDefaultValues: true }) : options;\n let jsonValue = this.field(field, group[field.localName], opt);\n assert(jsonValue !== undefined);\n json[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue;\n }\n return json;\n }\n field(field, value, options) {\n let jsonValue = undefined;\n if (field.kind == 'map') {\n assert(typeof value == \"object\" && value !== null);\n const jsonObj = {};\n switch (field.V.kind) {\n case \"scalar\":\n for (const [entryKey, entryValue] of Object.entries(value)) {\n const val = this.scalar(field.V.T, entryValue, field.name, false, true);\n assert(val !== undefined);\n jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key\n }\n break;\n case \"message\":\n const messageType = field.V.T();\n for (const [entryKey, entryValue] of Object.entries(value)) {\n const val = this.message(messageType, entryValue, field.name, options);\n assert(val !== undefined);\n jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key\n }\n break;\n case \"enum\":\n const enumInfo = field.V.T();\n for (const [entryKey, entryValue] of Object.entries(value)) {\n assert(entryValue === undefined || typeof entryValue == 'number');\n const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger);\n assert(val !== undefined);\n jsonObj[entryKey.toString()] = val; // JSON standard allows only (double quoted) string as property key\n }\n break;\n }\n if (options.emitDefaultValues || Object.keys(jsonObj).length > 0)\n jsonValue = jsonObj;\n }\n else if (field.repeat) {\n assert(Array.isArray(value));\n const jsonArr = [];\n switch (field.kind) {\n case \"scalar\":\n for (let i = 0; i < value.length; i++) {\n const val = this.scalar(field.T, value[i], field.name, field.opt, true);\n assert(val !== undefined);\n jsonArr.push(val);\n }\n break;\n case \"enum\":\n const enumInfo = field.T();\n for (let i = 0; i < value.length; i++) {\n assert(value[i] === undefined || typeof value[i] == 'number');\n const val = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger);\n assert(val !== undefined);\n jsonArr.push(val);\n }\n break;\n case \"message\":\n const messageType = field.T();\n for (let i = 0; i < value.length; i++) {\n const val = this.message(messageType, value[i], field.name, options);\n assert(val !== undefined);\n jsonArr.push(val);\n }\n break;\n }\n // add converted array to json output\n if (options.emitDefaultValues || jsonArr.length > 0 || options.emitDefaultValues)\n jsonValue = jsonArr;\n }\n else {\n switch (field.kind) {\n case \"scalar\":\n jsonValue = this.scalar(field.T, value, field.name, field.opt, options.emitDefaultValues);\n break;\n case \"enum\":\n jsonValue = this.enum(field.T(), value, field.name, field.opt, options.emitDefaultValues, options.enumAsInteger);\n break;\n case \"message\":\n jsonValue = this.message(field.T(), value, field.name, options);\n break;\n }\n }\n return jsonValue;\n }\n /**\n * Returns `null` as the default for google.protobuf.NullValue.\n */\n enum(type, value, fieldName, optional, emitDefaultValues, enumAsInteger) {\n if (type[0] == 'google.protobuf.NullValue')\n return !emitDefaultValues && !optional ? undefined : null;\n if (value === undefined) {\n assert(optional);\n return undefined;\n }\n if (value === 0 && !emitDefaultValues && !optional)\n // we require 0 to be default value for all enums\n return undefined;\n assert(typeof value == 'number');\n assert(Number.isInteger(value));\n if (enumAsInteger || !type[1].hasOwnProperty(value))\n // if we don't now the enum value, just return the number\n return value;\n if (type[2])\n // restore the dropped prefix\n return type[2] + type[1][value];\n return type[1][value];\n }\n message(type, value, fieldName, options) {\n if (value === undefined)\n return options.emitDefaultValues ? null : undefined;\n return type.internalJsonWrite(value, options);\n }\n scalar(type, value, fieldName, optional, emitDefaultValues) {\n if (value === undefined) {\n assert(optional);\n return undefined;\n }\n const ed = emitDefaultValues || optional;\n // noinspection FallThroughInSwitchStatementJS\n switch (type) {\n // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.\n case ScalarType.INT32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n if (value === 0)\n return ed ? 0 : undefined;\n assertInt32(value);\n return value;\n case ScalarType.FIXED32:\n case ScalarType.UINT32:\n if (value === 0)\n return ed ? 0 : undefined;\n assertUInt32(value);\n return value;\n // float, double: JSON value will be a number or one of the special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n // Either numbers or strings are accepted. Exponent notation is also accepted.\n case ScalarType.FLOAT:\n assertFloat32(value);\n case ScalarType.DOUBLE:\n if (value === 0)\n return ed ? 0 : undefined;\n assert(typeof value == 'number');\n if (Number.isNaN(value))\n return 'NaN';\n if (value === Number.POSITIVE_INFINITY)\n return 'Infinity';\n if (value === Number.NEGATIVE_INFINITY)\n return '-Infinity';\n return value;\n // string:\n case ScalarType.STRING:\n if (value === \"\")\n return ed ? '' : undefined;\n assert(typeof value == 'string');\n return value;\n // bool:\n case ScalarType.BOOL:\n if (value === false)\n return ed ? false : undefined;\n assert(typeof value == 'boolean');\n return value;\n // JSON value will be a decimal string. Either numbers or strings are accepted.\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n assert(typeof value == 'number' || typeof value == 'string' || typeof value == 'bigint');\n let ulong = PbULong.from(value);\n if (ulong.isZero() && !ed)\n return undefined;\n return ulong.toString();\n // JSON value will be a decimal string. Either numbers or strings are accepted.\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n assert(typeof value == 'number' || typeof value == 'string' || typeof value == 'bigint');\n let long = PbLong.from(value);\n if (long.isZero() && !ed)\n return undefined;\n return long.toString();\n // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.\n // Either standard or URL-safe base64 encoding with/without paddings are accepted.\n case ScalarType.BYTES:\n assert(value instanceof Uint8Array);\n if (!value.byteLength)\n return ed ? \"\" : undefined;\n return base64encode(value);\n }\n }\n}\n","import { LongType, ScalarType } from \"./reflection-info\";\nimport { reflectionLongConvert } from \"./reflection-long-convert\";\nimport { PbLong, PbULong } from \"./pb-long\";\n/**\n * Creates the default value for a scalar type.\n */\nexport function reflectionScalarDefault(type, longType = LongType.STRING) {\n switch (type) {\n case ScalarType.BOOL:\n return false;\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n return reflectionLongConvert(PbULong.ZERO, longType);\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n return reflectionLongConvert(PbLong.ZERO, longType);\n case ScalarType.DOUBLE:\n case ScalarType.FLOAT:\n return 0.0;\n case ScalarType.BYTES:\n return new Uint8Array(0);\n case ScalarType.STRING:\n return \"\";\n default:\n // case ScalarType.INT32:\n // case ScalarType.UINT32:\n // case ScalarType.SINT32:\n // case ScalarType.FIXED32:\n // case ScalarType.SFIXED32:\n return 0;\n }\n}\n","import { UnknownFieldHandler, WireType } from \"./binary-format-contract\";\nimport { LongType, ScalarType } from \"./reflection-info\";\nimport { reflectionLongConvert } from \"./reflection-long-convert\";\nimport { reflectionScalarDefault } from \"./reflection-scalar-default\";\n/**\n * Reads proto3 messages in binary format using reflection information.\n *\n * https://developers.google.com/protocol-buffers/docs/encoding\n */\nexport class ReflectionBinaryReader {\n constructor(info) {\n this.info = info;\n }\n prepare() {\n var _a;\n if (!this.fieldNoToField) {\n const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : [];\n this.fieldNoToField = new Map(fieldsInput.map(field => [field.no, field]));\n }\n }\n /**\n * Reads a message from binary format into the target message.\n *\n * Repeated fields are appended. Map entries are added, overwriting\n * existing keys.\n *\n * If a message field is already present, it will be merged with the\n * new data.\n */\n read(reader, message, options, length) {\n this.prepare();\n const end = length === undefined ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n // read the tag and find the field\n const [fieldNo, wireType] = reader.tag(), field = this.fieldNoToField.get(fieldNo);\n if (!field) {\n let u = options.readUnknownField;\n if (u == \"throw\")\n throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.info.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.info.typeName, message, fieldNo, wireType, d);\n continue;\n }\n // target object for the field we are reading\n let target = message, repeated = field.repeat, localName = field.localName;\n // if field is member of oneof ADT, use ADT as target\n if (field.oneof) {\n target = target[field.oneof];\n // if other oneof member selected, set new ADT\n if (target.oneofKind !== localName)\n target = message[field.oneof] = {\n oneofKind: localName\n };\n }\n // we have handled oneof above, we just have read the value into `target[localName]`\n switch (field.kind) {\n case \"scalar\":\n case \"enum\":\n let T = field.kind == \"enum\" ? ScalarType.INT32 : field.T;\n let L = field.kind == \"scalar\" ? field.L : undefined;\n if (repeated) {\n let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values\n if (wireType == WireType.LengthDelimited && T != ScalarType.STRING && T != ScalarType.BYTES) {\n let e = reader.uint32() + reader.pos;\n while (reader.pos < e)\n arr.push(this.scalar(reader, T, L));\n }\n else\n arr.push(this.scalar(reader, T, L));\n }\n else\n target[localName] = this.scalar(reader, T, L);\n break;\n case \"message\":\n if (repeated) {\n let arr = target[localName]; // safe to assume presence of array, oneof cannot contain repeated values\n let msg = field.T().internalBinaryRead(reader, reader.uint32(), options);\n arr.push(msg);\n }\n else\n target[localName] = field.T().internalBinaryRead(reader, reader.uint32(), options, target[localName]);\n break;\n case \"map\":\n let [mapKey, mapVal] = this.mapEntry(field, reader, options);\n // safe to assume presence of map object, oneof cannot contain repeated values\n target[localName][mapKey] = mapVal;\n break;\n }\n }\n }\n /**\n * Read a map field, expecting key field = 1, value field = 2\n */\n mapEntry(field, reader, options) {\n let length = reader.uint32();\n let end = reader.pos + length;\n let key = undefined; // javascript only allows number or string for object properties\n let val = undefined;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case 1:\n if (field.K == ScalarType.BOOL)\n key = reader.bool().toString();\n else\n // long types are read as string, number types are okay as number\n key = this.scalar(reader, field.K, LongType.STRING);\n break;\n case 2:\n switch (field.V.kind) {\n case \"scalar\":\n val = this.scalar(reader, field.V.T, field.V.L);\n break;\n case \"enum\":\n val = reader.int32();\n break;\n case \"message\":\n val = field.V.T().internalBinaryRead(reader, reader.uint32(), options);\n break;\n }\n break;\n default:\n throw new Error(`Unknown field ${fieldNo} (wire type ${wireType}) in map entry for ${this.info.typeName}#${field.name}`);\n }\n }\n if (key === undefined) {\n let keyRaw = reflectionScalarDefault(field.K);\n key = field.K == ScalarType.BOOL ? keyRaw.toString() : keyRaw;\n }\n if (val === undefined)\n switch (field.V.kind) {\n case \"scalar\":\n val = reflectionScalarDefault(field.V.T, field.V.L);\n break;\n case \"enum\":\n val = 0;\n break;\n case \"message\":\n val = field.V.T().create();\n break;\n }\n return [key, val];\n }\n scalar(reader, type, longType) {\n switch (type) {\n case ScalarType.INT32:\n return reader.int32();\n case ScalarType.STRING:\n return reader.string();\n case ScalarType.BOOL:\n return reader.bool();\n case ScalarType.DOUBLE:\n return reader.double();\n case ScalarType.FLOAT:\n return reader.float();\n case ScalarType.INT64:\n return reflectionLongConvert(reader.int64(), longType);\n case ScalarType.UINT64:\n return reflectionLongConvert(reader.uint64(), longType);\n case ScalarType.FIXED64:\n return reflectionLongConvert(reader.fixed64(), longType);\n case ScalarType.FIXED32:\n return reader.fixed32();\n case ScalarType.BYTES:\n return reader.bytes();\n case ScalarType.UINT32:\n return reader.uint32();\n case ScalarType.SFIXED32:\n return reader.sfixed32();\n case ScalarType.SFIXED64:\n return reflectionLongConvert(reader.sfixed64(), longType);\n case ScalarType.SINT32:\n return reader.sint32();\n case ScalarType.SINT64:\n return reflectionLongConvert(reader.sint64(), longType);\n }\n }\n}\n","import { UnknownFieldHandler, WireType } from \"./binary-format-contract\";\nimport { RepeatType, ScalarType } from \"./reflection-info\";\nimport { assert } from \"./assert\";\nimport { PbLong, PbULong } from \"./pb-long\";\n/**\n * Writes proto3 messages in binary format using reflection information.\n *\n * https://developers.google.com/protocol-buffers/docs/encoding\n */\nexport class ReflectionBinaryWriter {\n constructor(info) {\n this.info = info;\n }\n prepare() {\n if (!this.fields) {\n const fieldsInput = this.info.fields ? this.info.fields.concat() : [];\n this.fields = fieldsInput.sort((a, b) => a.no - b.no);\n }\n }\n /**\n * Writes the message to binary format.\n */\n write(message, writer, options) {\n this.prepare();\n for (const field of this.fields) {\n let value, // this will be our field value, whether it is member of a oneof or not\n emitDefault, // whether we emit the default value (only true for oneof members)\n repeated = field.repeat, localName = field.localName;\n // handle oneof ADT\n if (field.oneof) {\n const group = message[field.oneof];\n if (group.oneofKind !== localName)\n continue; // if field is not selected, skip\n value = group[localName];\n emitDefault = true;\n }\n else {\n value = message[localName];\n emitDefault = false;\n }\n // we have handled oneof above. we just have to honor `emitDefault`.\n switch (field.kind) {\n case \"scalar\":\n case \"enum\":\n let T = field.kind == \"enum\" ? ScalarType.INT32 : field.T;\n if (repeated) {\n assert(Array.isArray(value));\n if (repeated == RepeatType.PACKED)\n this.packed(writer, T, field.no, value);\n else\n for (const item of value)\n this.scalar(writer, T, field.no, item, true);\n }\n else if (value === undefined)\n assert(field.opt);\n else\n this.scalar(writer, T, field.no, value, emitDefault || field.opt);\n break;\n case \"message\":\n if (repeated) {\n assert(Array.isArray(value));\n for (const item of value)\n this.message(writer, options, field.T(), field.no, item);\n }\n else {\n this.message(writer, options, field.T(), field.no, value);\n }\n break;\n case \"map\":\n assert(typeof value == 'object' && value !== null);\n for (const [key, val] of Object.entries(value))\n this.mapEntry(writer, options, field, key, val);\n break;\n }\n }\n let u = options.writeUnknownFields;\n if (u !== false)\n (u === true ? UnknownFieldHandler.onWrite : u)(this.info.typeName, message, writer);\n }\n mapEntry(writer, options, field, key, value) {\n writer.tag(field.no, WireType.LengthDelimited);\n writer.fork();\n // javascript only allows number or string for object properties\n // we convert from our representation to the protobuf type\n let keyValue = key;\n switch (field.K) {\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.UINT32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n keyValue = Number.parseInt(key);\n break;\n case ScalarType.BOOL:\n assert(key == 'true' || key == 'false');\n keyValue = key == 'true';\n break;\n }\n // write key, expecting key field number = 1\n this.scalar(writer, field.K, 1, keyValue, true);\n // write value, expecting value field number = 2\n switch (field.V.kind) {\n case 'scalar':\n this.scalar(writer, field.V.T, 2, value, true);\n break;\n case 'enum':\n this.scalar(writer, ScalarType.INT32, 2, value, true);\n break;\n case 'message':\n this.message(writer, options, field.V.T(), 2, value);\n break;\n }\n writer.join();\n }\n message(writer, options, handler, fieldNo, value) {\n if (value === undefined)\n return;\n handler.internalBinaryWrite(value, writer.tag(fieldNo, WireType.LengthDelimited).fork(), options);\n writer.join();\n }\n /**\n * Write a single scalar value.\n */\n scalar(writer, type, fieldNo, value, emitDefault) {\n let [wireType, method, isDefault] = this.scalarInfo(type, value);\n if (!isDefault || emitDefault) {\n writer.tag(fieldNo, wireType);\n writer[method](value);\n }\n }\n /**\n * Write an array of scalar values in packed format.\n */\n packed(writer, type, fieldNo, value) {\n if (!value.length)\n return;\n assert(type !== ScalarType.BYTES && type !== ScalarType.STRING);\n // write tag\n writer.tag(fieldNo, WireType.LengthDelimited);\n // begin length-delimited\n writer.fork();\n // write values without tags\n let [, method,] = this.scalarInfo(type);\n for (let i = 0; i < value.length; i++)\n writer[method](value[i]);\n // end length delimited\n writer.join();\n }\n /**\n * Get information for writing a scalar value.\n *\n * Returns tuple:\n * [0]: appropriate WireType\n * [1]: name of the appropriate method of IBinaryWriter\n * [2]: whether the given value is a default value\n *\n * If argument `value` is omitted, [2] is always false.\n */\n scalarInfo(type, value) {\n let t = WireType.Varint;\n let m;\n let i = value === undefined;\n let d = value === 0;\n switch (type) {\n case ScalarType.INT32:\n m = \"int32\";\n break;\n case ScalarType.STRING:\n d = i || !value.length;\n t = WireType.LengthDelimited;\n m = \"string\";\n break;\n case ScalarType.BOOL:\n d = value === false;\n m = \"bool\";\n break;\n case ScalarType.UINT32:\n m = \"uint32\";\n break;\n case ScalarType.DOUBLE:\n t = WireType.Bit64;\n m = \"double\";\n break;\n case ScalarType.FLOAT:\n t = WireType.Bit32;\n m = \"float\";\n break;\n case ScalarType.INT64:\n d = i || PbLong.from(value).isZero();\n m = \"int64\";\n break;\n case ScalarType.UINT64:\n d = i || PbULong.from(value).isZero();\n m = \"uint64\";\n break;\n case ScalarType.FIXED64:\n d = i || PbULong.from(value).isZero();\n t = WireType.Bit64;\n m = \"fixed64\";\n break;\n case ScalarType.BYTES:\n d = i || !value.byteLength;\n t = WireType.LengthDelimited;\n m = \"bytes\";\n break;\n case ScalarType.FIXED32:\n t = WireType.Bit32;\n m = \"fixed32\";\n break;\n case ScalarType.SFIXED32:\n t = WireType.Bit32;\n m = \"sfixed32\";\n break;\n case ScalarType.SFIXED64:\n d = i || PbLong.from(value).isZero();\n t = WireType.Bit64;\n m = \"sfixed64\";\n break;\n case ScalarType.SINT32:\n m = \"sint32\";\n break;\n case ScalarType.SINT64:\n d = i || PbLong.from(value).isZero();\n m = \"sint64\";\n break;\n }\n return [t, m, i || d];\n }\n}\n","import { reflectionScalarDefault } from \"./reflection-scalar-default\";\nimport { MESSAGE_TYPE } from './message-type-contract';\n/**\n * Creates an instance of the generic message, using the field\n * information.\n */\nexport function reflectionCreate(type) {\n /**\n * This ternary can be removed in the next major version.\n * The `Object.create()` code path utilizes a new `messagePrototype`\n * property on the `IMessageType` which has this same `MESSAGE_TYPE`\n * non-enumerable property on it. Doing it this way means that we only\n * pay the cost of `Object.defineProperty()` once per `IMessageType`\n * class of once per \"instance\". The falsy code path is only provided\n * for backwards compatibility in cases where the runtime library is\n * updated without also updating the generated code.\n */\n const msg = type.messagePrototype\n ? Object.create(type.messagePrototype)\n : Object.defineProperty({}, MESSAGE_TYPE, { value: type });\n for (let field of type.fields) {\n let name = field.localName;\n if (field.opt)\n continue;\n if (field.oneof)\n msg[field.oneof] = { oneofKind: undefined };\n else if (field.repeat)\n msg[name] = [];\n else\n switch (field.kind) {\n case \"scalar\":\n msg[name] = reflectionScalarDefault(field.T, field.L);\n break;\n case \"enum\":\n // we require 0 to be default value for all enums\n msg[name] = 0;\n break;\n case \"map\":\n msg[name] = {};\n break;\n }\n }\n return msg;\n}\n","/**\n * Copy partial data into the target message.\n *\n * If a singular scalar or enum field is present in the source, it\n * replaces the field in the target.\n *\n * If a singular message field is present in the source, it is merged\n * with the target field by calling mergePartial() of the responsible\n * message type.\n *\n * If a repeated field is present in the source, its values replace\n * all values in the target array, removing extraneous values.\n * Repeated message fields are copied, not merged.\n *\n * If a map field is present in the source, entries are added to the\n * target map, replacing entries with the same key. Entries that only\n * exist in the target remain. Entries with message values are copied,\n * not merged.\n *\n * Note that this function differs from protobuf merge semantics,\n * which appends repeated fields.\n */\nexport function reflectionMergePartial(info, target, source) {\n let fieldValue, // the field value we are working with\n input = source, output; // where we want our field value to go\n for (let field of info.fields) {\n let name = field.localName;\n if (field.oneof) {\n const group = input[field.oneof]; // this is the oneof`s group in the source\n if ((group === null || group === void 0 ? void 0 : group.oneofKind) == undefined) { // the user is free to omit\n continue; // we skip this field, and all other members too\n }\n fieldValue = group[name]; // our value comes from the the oneof group of the source\n output = target[field.oneof]; // and our output is the oneof group of the target\n output.oneofKind = group.oneofKind; // always update discriminator\n if (fieldValue == undefined) {\n delete output[name]; // remove any existing value\n continue; // skip further work on field\n }\n }\n else {\n fieldValue = input[name]; // we are using the source directly\n output = target; // we want our field value to go directly into the target\n if (fieldValue == undefined) {\n continue; // skip further work on field, existing value is used as is\n }\n }\n if (field.repeat)\n output[name].length = fieldValue.length; // resize target array to match source array\n // now we just work with `fieldValue` and `output` to merge the value\n switch (field.kind) {\n case \"scalar\":\n case \"enum\":\n if (field.repeat)\n for (let i = 0; i < fieldValue.length; i++)\n output[name][i] = fieldValue[i]; // not a reference type\n else\n output[name] = fieldValue; // not a reference type\n break;\n case \"message\":\n let T = field.T();\n if (field.repeat)\n for (let i = 0; i < fieldValue.length; i++)\n output[name][i] = T.create(fieldValue[i]);\n else if (output[name] === undefined)\n output[name] = T.create(fieldValue); // nothing to merge with\n else\n T.mergePartial(output[name], fieldValue);\n break;\n case \"map\":\n // Map and repeated fields are simply overwritten, not appended or merged\n switch (field.V.kind) {\n case \"scalar\":\n case \"enum\":\n Object.assign(output[name], fieldValue); // elements are not reference types\n break;\n case \"message\":\n let T = field.V.T();\n for (let k of Object.keys(fieldValue))\n output[name][k] = T.create(fieldValue[k]);\n break;\n }\n break;\n }\n }\n}\n","import { ScalarType } from \"./reflection-info\";\n/**\n * Determines whether two message of the same type have the same field values.\n * Checks for deep equality, traversing repeated fields, oneof groups, maps\n * and messages recursively.\n * Will also return true if both messages are `undefined`.\n */\nexport function reflectionEquals(info, a, b) {\n if (a === b)\n return true;\n if (!a || !b)\n return false;\n for (let field of info.fields) {\n let localName = field.localName;\n let val_a = field.oneof ? a[field.oneof][localName] : a[localName];\n let val_b = field.oneof ? b[field.oneof][localName] : b[localName];\n switch (field.kind) {\n case \"enum\":\n case \"scalar\":\n let t = field.kind == \"enum\" ? ScalarType.INT32 : field.T;\n if (!(field.repeat\n ? repeatedPrimitiveEq(t, val_a, val_b)\n : primitiveEq(t, val_a, val_b)))\n return false;\n break;\n case \"map\":\n if (!(field.V.kind == \"message\"\n ? repeatedMsgEq(field.V.T(), objectValues(val_a), objectValues(val_b))\n : repeatedPrimitiveEq(field.V.kind == \"enum\" ? ScalarType.INT32 : field.V.T, objectValues(val_a), objectValues(val_b))))\n return false;\n break;\n case \"message\":\n let T = field.T();\n if (!(field.repeat\n ? repeatedMsgEq(T, val_a, val_b)\n : T.equals(val_a, val_b)))\n return false;\n break;\n }\n }\n return true;\n}\nconst objectValues = Object.values;\nfunction primitiveEq(type, a, b) {\n if (a === b)\n return true;\n if (type !== ScalarType.BYTES)\n return false;\n let ba = a;\n let bb = b;\n if (ba.length !== bb.length)\n return false;\n for (let i = 0; i < ba.length; i++)\n if (ba[i] != bb[i])\n return false;\n return true;\n}\nfunction repeatedPrimitiveEq(type, a, b) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!primitiveEq(type, a[i], b[i]))\n return false;\n return true;\n}\nfunction repeatedMsgEq(type, a, b) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!type.equals(a[i], b[i]))\n return false;\n return true;\n}\n","import { MESSAGE_TYPE } from \"./message-type-contract\";\nimport { normalizeFieldInfo } from \"./reflection-info\";\nimport { ReflectionTypeCheck } from \"./reflection-type-check\";\nimport { ReflectionJsonReader } from \"./reflection-json-reader\";\nimport { ReflectionJsonWriter } from \"./reflection-json-writer\";\nimport { ReflectionBinaryReader } from \"./reflection-binary-reader\";\nimport { ReflectionBinaryWriter } from \"./reflection-binary-writer\";\nimport { reflectionCreate } from \"./reflection-create\";\nimport { reflectionMergePartial } from \"./reflection-merge-partial\";\nimport { typeofJsonValue } from \"./json-typings\";\nimport { jsonReadOptions, jsonWriteOptions, } from \"./json-format-contract\";\nimport { reflectionEquals } from \"./reflection-equals\";\nimport { binaryWriteOptions } from \"./binary-writer\";\nimport { binaryReadOptions } from \"./binary-reader\";\nconst baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));\n/**\n * This standard message type provides reflection-based\n * operations to work with a message.\n */\nexport class MessageType {\n constructor(name, fields, options) {\n this.defaultCheckDepth = 16;\n this.typeName = name;\n this.fields = fields.map(normalizeFieldInfo);\n this.options = options !== null && options !== void 0 ? options : {};\n this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, baseDescriptors), { [MESSAGE_TYPE]: { value: this } }));\n this.refTypeCheck = new ReflectionTypeCheck(this);\n this.refJsonReader = new ReflectionJsonReader(this);\n this.refJsonWriter = new ReflectionJsonWriter(this);\n this.refBinReader = new ReflectionBinaryReader(this);\n this.refBinWriter = new ReflectionBinaryWriter(this);\n }\n create(value) {\n let message = reflectionCreate(this);\n if (value !== undefined) {\n reflectionMergePartial(this, message, value);\n }\n return message;\n }\n /**\n * Clone the message.\n *\n * Unknown fields are discarded.\n */\n clone(message) {\n let copy = this.create();\n reflectionMergePartial(this, copy, message);\n return copy;\n }\n /**\n * Determines whether two message of the same type have the same field values.\n * Checks for deep equality, traversing repeated fields, oneof groups, maps\n * and messages recursively.\n * Will also return true if both messages are `undefined`.\n */\n equals(a, b) {\n return reflectionEquals(this, a, b);\n }\n /**\n * Is the given value assignable to our message type\n * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?\n */\n is(arg, depth = this.defaultCheckDepth) {\n return this.refTypeCheck.is(arg, depth, false);\n }\n /**\n * Is the given value assignable to our message type,\n * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?\n */\n isAssignable(arg, depth = this.defaultCheckDepth) {\n return this.refTypeCheck.is(arg, depth, true);\n }\n /**\n * Copy partial data into the target message.\n */\n mergePartial(target, source) {\n reflectionMergePartial(this, target, source);\n }\n /**\n * Create a new message from binary format.\n */\n fromBinary(data, options) {\n let opt = binaryReadOptions(options);\n return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt);\n }\n /**\n * Read a new message from a JSON value.\n */\n fromJson(json, options) {\n return this.internalJsonRead(json, jsonReadOptions(options));\n }\n /**\n * Read a new message from a JSON string.\n * This is equivalent to `T.fromJson(JSON.parse(json))`.\n */\n fromJsonString(json, options) {\n let value = JSON.parse(json);\n return this.fromJson(value, options);\n }\n /**\n * Write the message to canonical JSON value.\n */\n toJson(message, options) {\n return this.internalJsonWrite(message, jsonWriteOptions(options));\n }\n /**\n * Convert the message to canonical JSON string.\n * This is equivalent to `JSON.stringify(T.toJson(t))`\n */\n toJsonString(message, options) {\n var _a;\n let value = this.toJson(message, options);\n return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0);\n }\n /**\n * Write the message to binary format.\n */\n toBinary(message, options) {\n let opt = binaryWriteOptions(options);\n return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish();\n }\n /**\n * This is an internal method. If you just want to read a message from\n * JSON, use `fromJson()` or `fromJsonString()`.\n *\n * Reads JSON value and merges the fields into the target\n * according to protobuf rules. If the target is omitted,\n * a new instance is created first.\n */\n internalJsonRead(json, options, target) {\n if (json !== null && typeof json == \"object\" && !Array.isArray(json)) {\n let message = target !== null && target !== void 0 ? target : this.create();\n this.refJsonReader.read(json, message, options);\n return message;\n }\n throw new Error(`Unable to parse message ${this.typeName} from JSON ${typeofJsonValue(json)}.`);\n }\n /**\n * This is an internal method. If you just want to write a message\n * to JSON, use `toJson()` or `toJsonString().\n *\n * Writes JSON value and returns it.\n */\n internalJsonWrite(message, options) {\n return this.refJsonWriter.write(message, options);\n }\n /**\n * This is an internal method. If you just want to write a message\n * in binary format, use `toBinary()`.\n *\n * Serializes the message in binary format and appends it to the given\n * writer. Returns passed writer.\n */\n internalBinaryWrite(message, writer, options) {\n this.refBinWriter.write(message, writer, options);\n return writer;\n }\n /**\n * This is an internal method. If you just want to read a message from\n * binary data, use `fromBinary()`.\n *\n * Reads data from binary format and merges the fields into\n * the target according to protobuf rules. If the target is\n * omitted, a new instance is created first.\n */\n internalBinaryRead(reader, length, options, target) {\n let message = target !== null && target !== void 0 ? target : this.create();\n this.refBinReader.read(reader, message, options, length);\n return message;\n }\n}\n","// @generated by protobuf-ts 2.9.4\n// @generated from protobuf file \"google/protobuf/struct.proto\" (package \"google.protobuf\", syntax proto3)\n// tslint:disable\n//\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc. All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { isJsonObject } from \"@protobuf-ts/runtime\";\nimport { typeofJsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonReadOptions } from \"@protobuf-ts/runtime\";\nimport type { JsonWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { JsonObject } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * `Struct` represents a structured data value, consisting of fields\n * which map to dynamically typed values. In some languages, `Struct`\n * might be supported by a native representation. For example, in\n * scripting languages like JS a struct is represented as an\n * object. The details of that representation are described together\n * with the proto support for the language.\n *\n * The JSON representation for `Struct` is JSON object.\n *\n * @generated from protobuf message google.protobuf.Struct\n */\nexport interface Struct {\n /**\n * Unordered map of dynamically typed values.\n *\n * @generated from protobuf field: map<string, google.protobuf.Value> fields = 1;\n */\n fields: {\n [key: string]: Value;\n };\n}\n/**\n * `Value` represents a dynamically typed value which can be either\n * null, a number, a string, a boolean, a recursive struct value, or a\n * list of values. A producer of value is expected to set one of these\n * variants. Absence of any variant indicates an error.\n *\n * The JSON representation for `Value` is JSON value.\n *\n * @generated from protobuf message google.protobuf.Value\n */\nexport interface Value {\n /**\n * @generated from protobuf oneof: kind\n */\n kind: {\n oneofKind: \"nullValue\";\n /**\n * Represents a null value.\n *\n * @generated from protobuf field: google.protobuf.NullValue null_value = 1;\n */\n nullValue: NullValue;\n } | {\n oneofKind: \"numberValue\";\n /**\n * Represents a double value.\n *\n * @generated from protobuf field: double number_value = 2;\n */\n numberValue: number;\n } | {\n oneofKind: \"stringValue\";\n /**\n * Represents a string value.\n *\n * @generated from protobuf field: string string_value = 3;\n */\n stringValue: string;\n } | {\n oneofKind: \"boolValue\";\n /**\n * Represents a boolean value.\n *\n * @generated from protobuf field: bool bool_value = 4;\n */\n boolValue: boolean;\n } | {\n oneofKind: \"structValue\";\n /**\n * Represents a structured value.\n *\n * @generated from protobuf field: google.protobuf.Struct struct_value = 5;\n */\n structValue: Struct;\n } | {\n oneofKind: \"listValue\";\n /**\n * Represents a repeated `Value`.\n *\n * @generated from protobuf field: google.protobuf.ListValue list_value = 6;\n */\n listValue: ListValue;\n } | {\n oneofKind: undefined;\n };\n}\n/**\n * `ListValue` is a wrapper around a repeated field of values.\n *\n * The JSON representation for `ListValue` is JSON array.\n *\n * @generated from protobuf message google.protobuf.ListValue\n */\nexport interface ListValue {\n /**\n * Repeated field of dynamically typed values.\n *\n * @generated from protobuf field: repeated google.protobuf.Value values = 1;\n */\n values: Value[];\n}\n/**\n * `NullValue` is a singleton enumeration to represent the null value for the\n * `Value` type union.\n *\n * The JSON representation for `NullValue` is JSON `null`.\n *\n * @generated from protobuf enum google.protobuf.NullValue\n */\nexport enum NullValue {\n /**\n * Null value.\n *\n * @generated from protobuf enum value: NULL_VALUE = 0;\n */\n NULL_VALUE = 0\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Struct$Type extends MessageType<Struct> {\n constructor() {\n super(\"google.protobuf.Struct\", [\n { no: 1, name: \"fields\", kind: \"map\", K: 9 /*ScalarType.STRING*/, V: { kind: \"message\", T: () => Value } }\n ]);\n }\n /**\n * Encode `Struct` to JSON object.\n */\n internalJsonWrite(message: Struct, options: JsonWriteOptions): JsonValue {\n let json: JsonObject = {};\n for (let [k, v] of Object.entries(message.fields)) {\n json[k] = Value.toJson(v);\n }\n return json;\n }\n /**\n * Decode `Struct` from JSON object.\n */\n internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Struct): Struct {\n if (!isJsonObject(json))\n throw new globalThis.Error(\"Unable to parse message \" + this.typeName + \" from JSON \" + typeofJsonValue(json) + \".\");\n if (!target)\n target = this.create();\n for (let [k, v] of globalThis.Object.entries(json)) {\n target.fields[k] = Value.fromJson(v);\n }\n return target;\n }\n create(value?: PartialMessage<Struct>): Struct {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.fields = {};\n if (value !== undefined)\n reflectionMergePartial<Struct>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Struct): Struct {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* map<string, google.protobuf.Value> fields */ 1:\n this.binaryReadMap1(message.fields, reader, options);\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n private binaryReadMap1(map: Struct[\"fields\"], reader: IBinaryReader, options: BinaryReadOptions): void {\n let len = reader.uint32(), end = reader.pos + len, key: keyof Struct[\"fields\"] | undefined, val: Struct[\"fields\"][any] | undefined;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case 1:\n key = reader.string();\n break;\n case 2:\n val = Value.internalBinaryRead(reader, reader.uint32(), options);\n break;\n default: throw new globalThis.Error(\"unknown map entry field for field google.protobuf.Struct.fields\");\n }\n }\n map[key ?? \"\"] = val ?? Value.create();\n }\n internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* map<string, google.protobuf.Value> fields = 1; */\n for (let k of globalThis.Object.keys(message.fields)) {\n writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);\n writer.tag(2, WireType.LengthDelimited).fork();\n Value.internalBinaryWrite(message.fields[k], writer, options);\n writer.join().join();\n }\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.protobuf.Struct\n */\nexport const Struct = new Struct$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass Value$Type extends MessageType<Value> {\n constructor() {\n super(\"google.protobuf.Value\", [\n { no: 1, name: \"null_value\", kind: \"enum\", oneof: \"kind\", T: () => [\"google.protobuf.NullValue\", NullValue] },\n { no: 2, name: \"number_value\", kind: \"scalar\", oneof: \"kind\", T: 1 /*ScalarType.DOUBLE*/ },\n { no: 3, name: \"string_value\", kind: \"scalar\", oneof: \"kind\", T: 9 /*ScalarType.STRING*/ },\n { no: 4, name: \"bool_value\", kind: \"scalar\", oneof: \"kind\", T: 8 /*ScalarType.BOOL*/ },\n { no: 5, name: \"struct_value\", kind: \"message\", oneof: \"kind\", T: () => Struct },\n { no: 6, name: \"list_value\", kind: \"message\", oneof: \"kind\", T: () => ListValue }\n ]);\n }\n /**\n * Encode `Value` to JSON value.\n */\n internalJsonWrite(message: Value, options: JsonWriteOptions): JsonValue {\n if (message.kind.oneofKind === undefined)\n throw new globalThis.Error();\n switch (message.kind.oneofKind) {\n case undefined: throw new globalThis.Error();\n case \"boolValue\": return message.kind.boolValue;\n case \"nullValue\": return null;\n case \"numberValue\":\n let numberValue = message.kind.numberValue;\n if (typeof numberValue == \"number\" && !Number.isFinite(numberValue))\n throw new globalThis.Error();\n return numberValue;\n case \"stringValue\": return message.kind.stringValue;\n case \"listValue\":\n let listValueField = this.fields.find(f => f.no === 6);\n if (listValueField?.kind !== \"message\")\n throw new globalThis.Error();\n return listValueField.T().toJson(message.kind.listValue);\n case \"structValue\":\n let structValueField = this.fields.find(f => f.no === 5);\n if (structValueField?.kind !== \"message\")\n throw new globalThis.Error();\n return structValueField.T().toJson(message.kind.structValue);\n }\n }\n /**\n * Decode `Value` from JSON value.\n */\n internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Value): Value {\n if (!target)\n target = this.create();\n switch (typeof json) {\n case \"number\":\n target.kind = { oneofKind: \"numberValue\", numberValue: json };\n break;\n case \"string\":\n target.kind = { oneofKind: \"stringValue\", stringValue: json };\n break;\n case \"boolean\":\n target.kind = { oneofKind: \"boolValue\", boolValue: json };\n break;\n case \"object\":\n if (json === null) {\n target.kind = { oneofKind: \"nullValue\", nullValue: NullValue.NULL_VALUE };\n }\n else if (globalThis.Array.isArray(json)) {\n target.kind = { oneofKind: \"listValue\", listValue: ListValue.fromJson(json) };\n }\n else {\n target.kind = { oneofKind: \"structValue\", structValue: Struct.fromJson(json) };\n }\n break;\n default: throw new globalThis.Error(\"Unable to parse \" + this.typeName + \" from JSON \" + typeofJsonValue(json));\n }\n return target;\n }\n create(value?: PartialMessage<Value>): Value {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.kind = { oneofKind: undefined };\n if (value !== undefined)\n reflectionMergePartial<Value>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* google.protobuf.NullValue null_value */ 1:\n message.kind = {\n oneofKind: \"nullValue\",\n nullValue: reader.int32()\n };\n break;\n case /* double number_value */ 2:\n message.kind = {\n oneofKind: \"numberValue\",\n numberValue: reader.double()\n };\n break;\n case /* string string_value */ 3:\n message.kind = {\n oneofKind: \"stringValue\",\n stringValue: reader.string()\n };\n break;\n case /* bool bool_value */ 4:\n message.kind = {\n oneofKind: \"boolValue\",\n boolValue: reader.bool()\n };\n break;\n case /* google.protobuf.Struct struct_value */ 5:\n message.kind = {\n oneofKind: \"structValue\",\n structValue: Struct.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).structValue)\n };\n break;\n case /* google.protobuf.ListValue list_value */ 6:\n message.kind = {\n oneofKind: \"listValue\",\n listValue: ListValue.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).listValue)\n };\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* google.protobuf.NullValue null_value = 1; */\n if (message.kind.oneofKind === \"nullValue\")\n writer.tag(1, WireType.Varint).int32(message.kind.nullValue);\n /* double number_value = 2; */\n if (message.kind.oneofKind === \"numberValue\")\n writer.tag(2, WireType.Bit64).double(message.kind.numberValue);\n /* string string_value = 3; */\n if (message.kind.oneofKind === \"stringValue\")\n writer.tag(3, WireType.LengthDelimited).string(message.kind.stringValue);\n /* bool bool_value = 4; */\n if (message.kind.oneofKind === \"boolValue\")\n writer.tag(4, WireType.Varint).bool(message.kind.boolValue);\n /* google.protobuf.Struct struct_value = 5; */\n if (message.kind.oneofKind === \"structValue\")\n Struct.internalBinaryWrite(message.kind.structValue, writer.tag(5, WireType.LengthDelimited).fork(), options).join();\n /* google.protobuf.ListValue list_value = 6; */\n if (message.kind.oneofKind === \"listValue\")\n ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(6, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.protobuf.Value\n */\nexport const Value = new Value$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ListValue$Type extends MessageType<ListValue> {\n constructor() {\n super(\"google.protobuf.ListValue\", [\n { no: 1, name: \"values\", kind: \"message\", repeat: 1 /*RepeatType.PACKED*/, T: () => Value }\n ]);\n }\n /**\n * Encode `ListValue` to JSON array.\n */\n internalJsonWrite(message: ListValue, options: JsonWriteOptions): JsonValue {\n return message.values.map(v => Value.toJson(v));\n }\n /**\n * Decode `ListValue` from JSON array.\n */\n internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: ListValue): ListValue {\n if (!globalThis.Array.isArray(json))\n throw new globalThis.Error(\"Unable to parse \" + this.typeName + \" from JSON \" + typeofJsonValue(json));\n if (!target)\n target = this.create();\n let values = json.map(v => Value.fromJson(v));\n target.values.push(...values);\n return target;\n }\n create(value?: PartialMessage<ListValue>): ListValue {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.values = [];\n if (value !== undefined)\n reflectionMergePartial<ListValue>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListValue): ListValue {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* repeated google.protobuf.Value values */ 1:\n message.values.push(Value.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: ListValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* repeated google.protobuf.Value values = 1; */\n for (let i = 0; i < message.values.length; i++)\n Value.internalBinaryWrite(message.values[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.protobuf.ListValue\n */\nexport const ListValue = new ListValue$Type();\n","// @generated by protobuf-ts 2.9.4\n// @generated from protobuf file \"proto/v1/pdp.proto\" (package \"policydecisionpoint\", syntax proto3)\n// tslint:disable\n//\n// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n//\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { V1PDPService } from \"./pdp\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { AuthorizationCheckResponse } from \"./pdp\";\nimport type { AuthorizationCheckRequest } from \"./pdp\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n * V1PDPService\tis the service for the Policy Decision Point.\n *\n * @generated from protobuf service policydecisionpoint.V1PDPService\n */\nexport interface IV1PDPServiceClient {\n /**\n * @generated from protobuf rpc: AuthorizationCheck(policydecisionpoint.AuthorizationCheckRequest) returns (policydecisionpoint.AuthorizationCheckResponse);\n */\n authorizationCheck(input: AuthorizationCheckRequest, options?: RpcOptions): UnaryCall<AuthorizationCheckRequest, AuthorizationCheckResponse>;\n}\n/**\n * V1PDPService\tis the service for the Policy Decision Point.\n *\n * @generated from protobuf service policydecisionpoint.V1PDPService\n */\nexport class V1PDPServiceClient implements IV1PDPServiceClient, ServiceInfo {\n typeName = V1PDPService.typeName;\n methods = V1PDPService.methods;\n options = V1PDPService.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: AuthorizationCheck(policydecisionpoint.AuthorizationCheckRequest) returns (policydecisionpoint.AuthorizationCheckResponse);\n */\n authorizationCheck(input: AuthorizationCheckRequest, options?: RpcOptions): UnaryCall<AuthorizationCheckRequest, AuthorizationCheckResponse> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<AuthorizationCheckRequest, AuthorizationCheckResponse>(\"unary\", this._transport, method, opt, input);\n }\n}\n","import * as pb from \"./generated/google/protobuf/struct\";\nimport * as pdpGRPC from \"./generated/proto/v1/pdp\";\nimport {\n PolicyStore,\n Entities,\n Evaluation,\n AZModel,\n AZRequest,\n Principal,\n Subject,\n Resource,\n Action,\n ReasonResponse,\n ContextResponse,\n EvaluationResponse,\n AZResponse,\n} from \"../../../../../az/azreq/model\";\n\n// Request Mappers\n\n/**\n * Maps the client PolicyStore to the gRPC PolicyStore.\n */\nexport function mapPolicyStoreToGrpcPolicyStore(\n policyStore: PolicyStore\n): pdpGRPC.PolicyStore | null {\n if (!policyStore) return null;\n\n return pdpGRPC.PolicyStore.create({\n kind: policyStore.kind,\n iD: policyStore.id,\n });\n}\n\n/**\n * Maps the client Principal to the gRPC Principal.\n */\nexport function mapPrincipalToGrpcPrincipal(\n principal: Principal\n): pdpGRPC.Principal | null {\n if (!principal) return null;\n\n return pdpGRPC.Principal.create({\n type: principal.type,\n iD: principal.id,\n source: principal.source,\n });\n}\n\n/**\n * Maps the client Entities to the gRPC Entities.\n */\nexport function mapEntitiesToGrpcEntities(\n entities: Entities\n): pdpGRPC.Entities | null {\n if (!entities) return null;\n\n return pdpGRPC.Entities.create({\n schema: entities.schema,\n items: entities.items?.map((item) => pb.Struct.fromJson(item)),\n });\n}\n\n/**\n * Maps the client Subject to the gRPC Subject.\n */\nexport function mapSubjectToGrpcSubject(\n subject: Subject\n): pdpGRPC.Subject | null {\n if (!subject) return null;\n\n return pdpGRPC.Subject.create({\n type: subject.type,\n iD: subject.id,\n source: subject.source,\n properties: subject.properties\n ? pb.Struct.fromJson(subject.properties)\n : undefined,\n });\n}\n\n/**\n * Maps the client Resource to the gRPC Resource.\n */\nexport function mapResourceToGrpcResource(\n resource: Resource\n): pdpGRPC.Resource | null {\n if (!resource) return null;\n\n return pdpGRPC.Resource.create({\n type: resource.type,\n iD: resource.id,\n properties: resource.properties\n ? pb.Struct.fromJson(resource.properties)\n : undefined,\n });\n}\n\n/**\n * Maps the client Action to the gRPC Action.\n */\nexport function mapActionToGrpcAction(action: Action): pdpGRPC.Action | null {\n if (!action) return null;\n\n return pdpGRPC.Action.create({\n name: action.name,\n properties: action.properties\n ? pb.Struct.fromJson(action.properties)\n : undefined,\n });\n}\n\n/**\n * Maps the client Evaluation to the gRPC EvaluationRequest.\n */\nexport function mapEvaluationToGrpcEvaluationRequest(\n evaluation: Evaluation\n): pdpGRPC.EvaluationRequest | null {\n if (!evaluation) return null;\n\n return pdpGRPC.EvaluationRequest.create({\n requestID: evaluation.request_id,\n subject: evaluation.subject\n ? mapSubjectToGrpcSubject(evaluation.subject) ?? undefined\n : undefined,\n resource: evaluation.resource\n ? mapResourceToGrpcResource(evaluation.resource) ?? undefined\n : undefined,\n action: evaluation.action\n ? mapActionToGrpcAction(evaluation.action) ?? undefined\n : undefined,\n context: evaluation.context\n ? pb.Struct.fromJson(evaluation.context)\n : undefined,\n });\n}\n\n/**\n * Maps the client AZModel to the gRPC AuthorizationModelRequest.\n */\nexport function mapAuthZModelToGrpcAuthorizationModelRequest(\n azModel: AZModel\n): pdpGRPC.AuthorizationModelRequest | null {\n if (!azModel) return null;\n\n return pdpGRPC.AuthorizationModelRequest.create({\n zoneID: BigInt(azModel.zone_id),\n policyStore: azModel.policy_store\n ? mapPolicyStoreToGrpcPolicyStore(azModel.policy_store) ?? undefined\n : undefined,\n principal: azModel.principal\n ? mapPrincipalToGrpcPrincipal(azModel.principal) ?? undefined\n : undefined,\n entities: azModel.entities\n ? mapEntitiesToGrpcEntities(azModel.entities) ?? undefined\n : undefined,\n });\n}\n\n/**\n * Maps the client AZRequest to the gRPC AuthorizationCheckRequest.\n */\nexport function mapAZRequestToGrpcAuthorizationCheckRequest(\n azRequest: AZRequest\n): pdpGRPC.AuthorizationCheckRequest {\n return pdpGRPC.AuthorizationCheckRequest.create({\n requestID: azRequest.request_id,\n authorizationModel: azRequest.authorization_model\n ? mapAuthZModelToGrpcAuthorizationModelRequest(\n azRequest.authorization_model\n ) ?? undefined\n : undefined,\n subject: azRequest.subject\n ? mapSubjectToGrpcSubject(azRequest.subject) ?? undefined\n : undefined,\n resource: azRequest.resource\n ? mapResourceToGrpcResource(azRequest.resource) ?? undefined\n : undefined,\n action: azRequest.action\n ? mapActionToGrpcAction(azRequest.action) ?? undefined\n : undefined,\n context: azRequest.context\n ? pb.Struct.fromJson(azRequest.context)\n : undefined,\n evaluations: azRequest.evaluations?.map(\n (evaluation) => mapEvaluationToGrpcEvaluationRequest(evaluation)!\n ),\n });\n}\n\n// Response Mappers\n\n/**\n * Maps the gRPC ReasonResponse to the client ReasonResponse.\n */\nexport function mapGrpcReasonResponseToReasonResponse(\n reasonResponse: pdpGRPC.ReasonResponse\n): ReasonResponse | null {\n if (!reasonResponse) return null;\n\n return {\n Code: reasonResponse.code,\n Message: reasonResponse.message,\n };\n}\n\n/**\n * Maps the gRPC ContextResponse to the client ContextResponse.\n */\nexport function mapGrpcContextResponseToContextResponse(\n contextResponse: pdpGRPC.ContextResponse\n): ContextResponse | null {\n if (!contextResponse) return null;\n\n return {\n ID: contextResponse.iD,\n ReasonAdmin: contextResponse.reasonAdmin\n ? mapGrpcReasonResponseToReasonResponse(contextResponse.reasonAdmin)\n : undefined,\n ReasonUser: contextResponse.reasonUser\n ? mapGrpcReasonResponseToReasonResponse(contextResponse.reasonUser)\n : null,\n };\n}\n\n/**\n * Maps the gRPC EvaluationResponse to the client EvaluationResponse.\n */\nexport function mapGrpcEvaluationResponseToEvaluationResponse(\n evaluationResponse: pdpGRPC.EvaluationResponse\n): EvaluationResponse | null {\n if (!evaluationResponse) return null;\n\n return {\n Decision: evaluationResponse.decision,\n RequestID: evaluationResponse.requestID || \"\",\n Context: evaluationResponse.context\n ? mapGrpcContextResponseToContextResponse(evaluationResponse.context)\n : undefined,\n };\n}\n\n/**\n * Maps the gRPC AuthorizationCheckResponse to the client AZResponse.\n */\nexport function mapGrpcAuthorizationCheckResponseToAZResponse(\n response: pdpGRPC.AuthorizationCheckResponse\n): AZResponse {\n return {\n Decision: response.decision,\n RequestID: response.requestID || \"\",\n Context: response.context\n ? mapGrpcContextResponseToContextResponse(response.context)\n : undefined,\n Evaluations: response.evaluations?.map(\n (evaluation) => mapGrpcEvaluationResponseToEvaluationResponse(evaluation)!\n ),\n };\n}\n","import { V1PDPServiceClient } from \"./generated/proto/v1/pdp.client\";\nimport {\n AuthorizationCheckRequest,\n AuthorizationCheckResponse,\n} from \"./generated/proto/v1/pdp\";\nimport {\n mapAZRequestToGrpcAuthorizationCheckRequest,\n mapGrpcAuthorizationCheckResponseToAZResponse,\n} from \"./pdp_grpc_mapper\";\nimport { AZRequest, AZResponse } from \"../../../../../az/azreq/model\";\nimport { RpcError } from \"@protobuf-ts/runtime-rpc\";\nimport { GrpcTransport } from \"@protobuf-ts/grpc-transport\";\nimport { ChannelCredentials } from \"@grpc/grpc-js\";\n\n/**\n * PDPClient is a client for interacting with the Policy Decision Point (PDP) service.\n */\nexport class PDPClient {\n private client: V1PDPServiceClient;\n\n /**\n * Creates a new PDPClient.\n * @param endpoint - The gRPC server endpoint.\n */\n constructor(endpoint: string) {\n const transport = new GrpcTransport({\n host: endpoint,\n channelCredentials: ChannelCredentials.createInsecure(),\n });\n\n this.client = new V1PDPServiceClient(transport);\n }\n\n /**\n * Checks the authorization request with the PDP service.\n * @param request - The authorization request.\n * @returns A promise that resolves to the authorization response.\n */\n async authorizationCheck(request: AZRequest): Promise<AZResponse> {\n if (!request) {\n throw new Error(\"Invalid request: request cannot be null or undefined\");\n }\n\n // Map the client request to the gRPC request\n const grpcRequest: AuthorizationCheckRequest =\n mapAZRequestToGrpcAuthorizationCheckRequest(request);\n\n try {\n // Make the gRPC call\n const response: AuthorizationCheckResponse =\n await this.client.authorizationCheck(grpcRequest).response;\n return mapGrpcAuthorizationCheckResponseToAZResponse(response);\n } catch (err) {\n if (err instanceof RpcError) {\n throw new Error(`gRPC call failed: ${err.message}`);\n }\n throw err;\n }\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AZRequest, AZResponse } from \"./az/azreq/model\";\nimport { AZConfig, AZOption } from \"./azconfig\";\nimport { PDPClient } from \"./internal/az/azreq/grpc/v1/pdp_client\";\n\n/**\n * AZClient is the client to interact with the authorization server.\n */\nclass AZClient {\n private azConfig: AZConfig;\n\n /**\n * Creates a new AZClient.\n * @param opts - Optional configuration options.\n */\n constructor(...opts: AZOption[]) {\n this.azConfig = {\n pdpEndpoint: {\n endpoint: \"localhost\",\n port: 9094,\n },\n };\n\n // Apply options\n opts.forEach((opt) => opt(this.azConfig));\n }\n\n /**\n * Checks the input authorization request with the authorization server.\n * @param req - The authorization request.\n * @returns A tuple containing:\n * - A boolean indicating the decision (true if authorized, false otherwise).\n * - The full authorization response.\n * - An error, if any.\n */\n async check(req: AZRequest): Promise<{\n decision: boolean;\n response: AZResponse | null;\n error: Error | null;\n }> {\n const target = `${this.azConfig.pdpEndpoint?.endpoint}:${this.azConfig.pdpEndpoint?.port}`;\n\n // Create a PDPClient instance\n const pdpClient = new PDPClient(target);\n\n try {\n const response = await pdpClient.authorizationCheck(req);\n return { decision: response.Decision, response, error: null };\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n\n return { decision: false, response: null, error };\n }\n }\n}\n\nexport { AZClient };\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Action } from \"./model\";\nimport _ from \"lodash\";\n\n/**\n * ActionBuilder is the builder for the Action object.\n */\nexport class ActionBuilder {\n private action: Action;\n\n /**\n * Creates a new ActionBuilder instance.\n * @param name - The name of the action.\n */\n constructor(name: string) {\n this.action = {\n name: name,\n };\n }\n\n /**\n * Sets a property of the action.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The ActionBuilder instance for method chaining.\n */\n withProperty(key: string, value: any): this {\n if (!this.action.properties) {\n this.action.properties = {};\n }\n\n this.action.properties[key] = value;\n return this;\n }\n\n /**\n * Builds the Action object.\n * @returns The constructed Action object.\n */\n build(): Action {\n return _.cloneDeep(this.action);\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport _ from \"lodash\";\n\n/**\n * ContextBuilder is the builder for the Context object.\n */\nexport class ContextBuilder {\n private context: Record<string, any>;\n\n /**\n * Creates a new ContextBuilder instance.\n */\n constructor() {\n this.context = {};\n }\n\n /**\n * Sets a property of the context.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The ContextBuilder instance for method chaining.\n */\n withProperty(key: string, value: any): ContextBuilder {\n if (!this.context) {\n this.context = {};\n }\n\n this.context[key] = value;\n return this;\n }\n\n /**\n * Builds the Context object.\n * @returns The constructed Context object (a map of key-value pairs).\n */\n build(): Record<string, any> {\n // Deep copy the context to avoid mutation issues\n return _.cloneDeep(this.context);\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Action, Evaluation, Resource, Subject } from \"./model\";\nimport _ from \"lodash\";\n\n/**\n * EvaluationBuilder is the builder for the Evaluation object.\n */\nexport class EvaluationBuilder {\n private azEvaluation: Evaluation;\n\n /**\n * Creates a new EvaluationBuilder instance.\n * @param subject - The subject of the evaluation.\n * @param resource - The resource of the evaluation.\n * @param action - The action of the evaluation.\n */\n constructor(subject: Subject, resource: Resource, action: Action) {\n this.azEvaluation = {\n subject: subject,\n resource: resource,\n action: action,\n };\n }\n\n /**\n * Sets the request ID of the evaluation.\n * @param requestID - The request ID.\n * @returns The EvaluationBuilder instance for method chaining.\n */\n withRequestID(requestID: string): EvaluationBuilder {\n this.azEvaluation.request_id = requestID;\n return this;\n }\n\n /**\n * Sets the context of the evaluation.\n * @param context - The context (a map of key-value pairs).\n * @returns The EvaluationBuilder instance for method chaining.\n */\n withContext(context: Record<string, any>): EvaluationBuilder {\n this.azEvaluation.context = context;\n return this;\n }\n\n /**\n * Builds the Evaluation object.\n * @returns The constructed Evaluation object.\n */\n build(): Evaluation {\n return _.cloneDeep(this.azEvaluation);\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Principal } from \"./model\";\nimport _ from \"lodash\";\n\n/**\n * Default principal kind.\n */\nconst PrincipalDefaultKind = \"user\";\n\n/**\n * PrincipalBuilder is the builder for the Principal object.\n */\nexport class PrincipalBuilder {\n private principal: Principal;\n\n /**\n * Creates a new PrincipalBuilder instance.\n * @param id - The ID of the principal.\n */\n constructor(id: string) {\n this.principal = {\n type: PrincipalDefaultKind,\n id: id,\n };\n }\n\n /**\n * Sets the kind of the principal.\n * @param kind - The kind of the principal.\n * @returns The PrincipalBuilder instance for method chaining.\n */\n withKind(kind: string): PrincipalBuilder {\n this.principal.type = kind;\n return this;\n }\n\n /**\n * Sets the source of the principal.\n * @param source - The source of the principal.\n * @returns The PrincipalBuilder instance for method chaining.\n */\n withSource(source: string): PrincipalBuilder {\n this.principal.source = source;\n return this;\n }\n\n /**\n * Builds the Principal object.\n * @returns The constructed Principal object.\n */\n build(): Principal {\n // Return a deep copy of the principal to avoid mutation issues\n return _.cloneDeep(this.principal);\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport _ from \"lodash\";\nimport {\n AZRequest,\n Evaluation,\n Principal,\n Subject,\n Resource,\n Action,\n} from \"./model\";\n\n/**\n * AZRequestBuilder is the builder for the AZRequest object.\n */\nexport class AZRequestBuilder {\n private azRequest: AZRequest;\n\n /**\n * Creates a new AZRequestBuilder instance.\n * @param zoneID - The zone ID.\n * @param ledgerID - The ledger ID.\n */\n constructor(zoneID: number, ledgerID: string) {\n this.azRequest = {\n authorization_model: {\n zone_id: zoneID,\n policy_store: {\n kind: \"ledger\",\n id: ledgerID,\n },\n entities: {\n schema: \"\",\n items: [],\n },\n },\n evaluations: [],\n };\n }\n\n /**\n * Sets the principal of the AZRequest.\n * @param principal - The principal object.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withPrincipal(principal?: Principal): AZRequestBuilder {\n this.azRequest.authorization_model.principal = principal;\n return this;\n }\n\n /**\n * Sets the request ID of the AZRequest.\n * @param requestID - The request ID.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withRequestID(requestID?: string): AZRequestBuilder {\n this.azRequest.request_id = requestID;\n return this;\n }\n\n /**\n * Sets the subject of the AZRequest.\n * @param subject - The subject object.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withSubject(subject: Subject): AZRequestBuilder {\n this.azRequest.subject = subject;\n return this;\n }\n\n /**\n * Sets the resource of the AZRequest.\n * @param resource - The resource object.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withResource(resource: Resource): AZRequestBuilder {\n this.azRequest.resource = resource;\n return this;\n }\n\n /**\n * Sets the action of the AZRequest.\n * @param action - The action object.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withAction(action: Action): AZRequestBuilder {\n this.azRequest.action = action;\n return this;\n }\n\n /**\n * Sets the context of the AZRequest.\n * @param context - The context object (a map of key-value pairs).\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withContext(context: Record<string, any>): AZRequestBuilder {\n this.azRequest.context = context;\n return this;\n }\n\n /**\n * Sets the entities map to the AZRequest.\n * @param schema - The schema of the entities.\n * @param entities - The entities map.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withEntitiesMap(\n schema: string,\n entities: Record<string, any>\n ): AZRequestBuilder {\n this.azRequest.authorization_model.entities.schema = schema;\n this.azRequest.authorization_model.entities.items = [entities];\n return this;\n }\n\n /**\n * Sets the entities items to the AZRequest.\n * @param schema - The schema of the entities.\n * @param entities - The entities items (array of maps).\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withEntitiesItems(\n schema: string,\n entities?: Record<string, any>[]\n ): AZRequestBuilder {\n this.azRequest.authorization_model.entities.schema = schema;\n this.azRequest.authorization_model.entities.items = entities;\n\n if (!this.azRequest.authorization_model.entities.items) {\n this.azRequest.authorization_model.entities.items = [];\n }\n\n return this;\n }\n\n /**\n * Adds an evaluation to the AZRequest.\n * @param evaluation - The evaluation object.\n * @returns The AZRequestBuilder instance for method chaining.\n */\n withEvaluation(evaluation: Evaluation): AZRequestBuilder {\n this.azRequest.evaluations?.push(evaluation);\n return this;\n }\n\n /**\n * Builds the AZRequest object.\n * @returns The constructed AZRequest object.\n */\n build(): AZRequest {\n return _.cloneDeep(this.azRequest);\n }\n}\n","// Copyright 2024 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * PolicyStore represents the Policy Store.\n */\nexport interface PolicyStore {\n kind?: string;\n id?: string;\n}\n\n/**\n * Entities represents the Entities.\n */\nexport interface Entities {\n schema?: string;\n items?: Record<string, any>[];\n}\n\n/**\n * Evaluation is the Evaluation object.\n */\nexport interface Evaluation {\n request_id?: string;\n subject?: Subject;\n resource?: Resource;\n action?: Action;\n context?: Record<string, any>;\n}\n\n/**\n * AuthorizationModel is the Authorization Model.\n */\nexport interface AZModel {\n zone_id: number;\n principal?: Principal;\n policy_store?: PolicyStore;\n entities: Entities;\n}\n\n/**\n * AuthorizationRequest is the Authorization Request object.\n */\nexport interface AZRequest {\n authorization_model: AZModel;\n request_id?: string;\n subject?: Subject;\n resource?: Resource;\n action?: Action;\n context?: Record<string, any>;\n evaluations?: Evaluation[];\n}\n\n/**\n * Principal is the principal object.\n */\nexport interface Principal {\n type?: string;\n id?: string;\n source?: string;\n}\n\n/**\n * Subject is the subject object.\n */\nexport interface Subject {\n type?: string;\n id?: string;\n source?: string;\n properties?: Record<string, any>;\n}\n\n/**\n * Resource is the resource object.\n */\nexport interface Resource {\n type?: string;\n id?: string;\n properties?: Record<string, any>;\n}\n\n/**\n * Action is the action object.\n */\nexport interface Action {\n name?: string;\n properties?: Record<string, any>;\n}\n\n/**\n * ReasonResponse provides the rationale for the response.\n */\nexport interface ReasonResponse {\n Code?: string;\n Message?: string;\n}\n\n/**\n * ContextResponse represents the context included in the response.\n */\nexport interface ContextResponse {\n ID?: string;\n ReasonAdmin?: ReasonResponse | null;\n ReasonUser?: ReasonResponse | null;\n}\n\n/**\n * EvaluationResponse represents the result of the evaluation process.\n */\nexport interface EvaluationResponse {\n RequestID?: string;\n Decision?: boolean;\n Context?: ContextResponse | null;\n}\n\n/**\n * AZResponse represents the outcome of the authorization decision.\n */\nexport interface AZResponse {\n RequestID?: string;\n Decision: boolean;\n Context?: ContextResponse | null;\n Evaluations?: EvaluationResponse[];\n}\n\nexport enum ActorType {\n UserType = \"USER\",\n RoleActorType = \"ROLE-ACTOR\",\n TwinActorType = \"TWIN-ACTOR\",\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Subject, ActorType } from \"./model\";\nimport _ from \"lodash\";\n\n/**\n * Default subject kind.\n */\nconst SubjectDefaultKind = \"user\";\n\n/**\n * SubjectBuilder is the builder for the Subject object.\n */\nexport class SubjectBuilder {\n private subject: Subject;\n\n /**\n * Creates a new SubjectBuilder instance.\n * @param id - The ID of the subject.\n */\n constructor(id: string) {\n this.subject = {\n type: SubjectDefaultKind,\n id: id,\n };\n }\n\n /**\n * Sets the kind of the subject.\n * @param kind - The kind of the subject.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withKind(kind: string): SubjectBuilder {\n this.subject.type = kind;\n return this;\n }\n\n /**\n * Sets the source of the subject.\n * @param source - The source of the subject.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withSource(source: string): SubjectBuilder {\n this.subject.source = source;\n return this;\n }\n\n /**\n * Sets a property of the subject.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withProperty(key: string, value: any): SubjectBuilder {\n if (!this.subject.properties) {\n this.subject.properties = {};\n }\n this.subject.properties[key] = value;\n return this;\n }\n\n /**\n * Sets the type of the subject to UserType.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withUserType(): SubjectBuilder {\n this.subject.type = ActorType.UserType;\n return this;\n }\n\n /**\n * Sets the type of the subject to RoleActorType.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withRoleActorType(): SubjectBuilder {\n this.subject.type = ActorType.RoleActorType;\n return this;\n }\n\n /**\n * Sets the type of the subject to TwinActorType.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withTwinActorType(): SubjectBuilder {\n this.subject.type = ActorType.TwinActorType;\n return this;\n }\n\n /**\n * Sets the type of the subject.\n * @param subType - The type of the subject.\n * @returns The SubjectBuilder instance for method chaining.\n */\n withType(subType: string): SubjectBuilder {\n this.subject.type = subType;\n return this;\n }\n\n /**\n * Builds the Subject object.\n * @returns The constructed Subject object.\n */\n build(): Subject {\n return _.cloneDeep(this.subject);\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Resource } from \"./model\";\nimport _ from \"lodash\";\n\n/**\n * ResourceBuilder is the builder for the Resource object.\n */\nexport class ResourceBuilder {\n private resource: Resource;\n\n /**\n * Creates a new ResourceBuilder instance.\n * @param kind - The kind (type) of the resource.\n */\n constructor(kind: string) {\n this.resource = {\n type: kind,\n };\n }\n\n /**\n * Sets the ID of the resource.\n * @param id - The ID of the resource.\n * @returns The ResourceBuilder instance for method chaining.\n */\n withID(id: string): ResourceBuilder {\n this.resource.id = id;\n return this;\n }\n\n /**\n * Sets a property of the resource.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The ResourceBuilder instance for method chaining.\n */\n withProperty(key: string, value: any): ResourceBuilder {\n if (!this.resource.properties) {\n this.resource.properties = {};\n }\n\n this.resource.properties[key] = value;\n return this;\n }\n\n /**\n * Builds the Resource object.\n * @returns The constructed Resource object.\n */\n build(): Resource {\n return _.cloneDeep(this.resource);\n }\n}\n","// Copyright 2025 Nitro Agility S.r.l.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AZRequestBuilder } from \"./builder_request_composed\";\nimport { SubjectBuilder } from \"./builder_subject\";\nimport { ResourceBuilder } from \"./builder_resource\";\nimport { ActionBuilder } from \"./builder_action\";\nimport { ContextBuilder } from \"./builder_context\";\nimport { Principal, AZRequest, ActorType } from \"./model\";\n\n/**\n * AZAtomicRequestBuilder is the builder for the AZAtomicRequest object.\n */\nexport class AZAtomicRequestBuilder {\n private requestID?: string;\n private principal?: Principal;\n private azSubjectBuilder: SubjectBuilder;\n private azResourceBuilder: ResourceBuilder;\n private azActionBuilder: ActionBuilder;\n private azContextBuilder: ContextBuilder;\n private azRequestBuilder: AZRequestBuilder;\n\n /**\n * Creates a new AZAtomicRequestBuilder instance.\n * @param zoneID - The zone ID.\n * @param ledgerID - The ledger ID.\n * @param subjectID - The subject ID.\n * @param resourceKind - The resource kind.\n * @param actionName - The action name.\n */\n constructor(\n zoneID: number,\n ledgerID: string,\n subjectID: string,\n resourceKind: string,\n actionName: string\n ) {\n this.azRequestBuilder = new AZRequestBuilder(zoneID, ledgerID);\n this.azSubjectBuilder = new SubjectBuilder(subjectID);\n this.azResourceBuilder = new ResourceBuilder(resourceKind);\n this.azActionBuilder = new ActionBuilder(actionName);\n this.azContextBuilder = new ContextBuilder();\n }\n\n /**\n * Sets the entities map to the AZRequest.\n * @param schema - The schema of the entities.\n * @param entities - The entities map.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withEntitiesMap(\n schema: string,\n entities: Record<string, any>\n ): AZAtomicRequestBuilder {\n this.azRequestBuilder.withEntitiesMap(schema, entities);\n return this;\n }\n\n /**\n * Sets the entities items to the AZRequest.\n * @param schema - The schema of the entities.\n * @param entities - The entities items.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withEntitiesItems(\n schema: string,\n entities?: Record<string, any>[]\n ): AZAtomicRequestBuilder {\n this.azRequestBuilder.withEntitiesItems(schema, entities);\n return this;\n }\n\n /**\n * Sets the request ID of the AZRequest.\n * @param requestID - The request ID.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withRequestID(requestID: string): AZAtomicRequestBuilder {\n this.requestID = requestID;\n return this;\n }\n\n /**\n * Sets the principal of the AZRequest.\n * @param principal - The principal.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withPrincipal(principal: Principal): AZAtomicRequestBuilder {\n this.principal = principal;\n return this;\n }\n\n /**\n * Sets the kind of the subject for the AZRequest.\n * @param kind - The subject kind.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectKind(kind: string): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withKind(kind);\n return this;\n }\n\n /**\n * Sets the source of the subject for the AZRequest.\n * @param source - The subject source.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectSource(source: string): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withSource(source);\n return this;\n }\n\n /**\n * Sets a property of the subject for the AZRequest.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectProperty(key: string, value: any): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withProperty(key, value);\n return this;\n }\n\n /**\n * Sets the ID of the resource for the AZRequest.\n * @param id - The resource ID.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withResourceID(id: string): AZAtomicRequestBuilder {\n this.azResourceBuilder.withID(id);\n return this;\n }\n\n /**\n * Sets a property of the resource for the AZRequest.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withResourceProperty(key: string, value: any): AZAtomicRequestBuilder {\n this.azResourceBuilder.withProperty(key, value);\n return this;\n }\n\n /**\n * Sets a property of the action for the AZRequest.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withActionProperty(key: string, value: any): AZAtomicRequestBuilder {\n this.azActionBuilder.withProperty(key, value);\n return this;\n }\n\n /**\n * Sets a property of the context for the AZRequest.\n * @param key - The property key.\n * @param value - The property value.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withContextProperty(key: string, value: any): AZAtomicRequestBuilder {\n this.azContextBuilder.withProperty(key, value);\n return this;\n }\n\n /**\n * Sets the type of the subject to UserType.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectUserType(): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withKind(ActorType.UserType);\n return this;\n }\n\n /**\n * Sets the type of the subject to RoleActorType.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectRoleActorType(): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withKind(ActorType.RoleActorType);\n return this;\n }\n\n /**\n * Sets the type of the subject to TwinActorType.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectTwinActorType(): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withKind(ActorType.TwinActorType);\n return this;\n }\n\n /**\n * Sets the type of the subject.\n * @param kind - The type of the subject.\n * @returns The AZAtomicRequestBuilder instance for method chaining.\n */\n withSubjectType(kind: string): AZAtomicRequestBuilder {\n this.azSubjectBuilder.withKind(kind);\n return this;\n }\n\n /**\n * Builds the AZAtomicRequest object.\n * @returns The constructed AZRequest object.\n */\n build(): AZRequest {\n const subject = this.azSubjectBuilder.build();\n const resource = this.azResourceBuilder.build();\n const action = this.azActionBuilder.build();\n const context = this.azContextBuilder.build();\n\n this.azRequestBuilder\n .withPrincipal(this.principal)\n .withRequestID(this.requestID)\n .withSubject(subject)\n .withResource(resource)\n .withAction(action)\n .withContext(context);\n\n return this.azRequestBuilder.build();\n }\n}\n"],"mappings":";AA0CA,SAAS,aAAa,UAAkB,MAAwB;AAC9D,SAAO,CAAC,WAAqB;AAC3B,WAAO,cAAc;AAAA,MACnB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;;;AC7BA,SAAS,mBAAmB;;;AChBrB,SAAS,gBAAgB,OAAO;AACnC,MAAI,IAAI,OAAO;AACf,MAAI,KAAK,UAAU;AACf,QAAI,MAAM,QAAQ,KAAK;AACnB,aAAO;AACX,QAAI,UAAU;AACV,aAAO;AAAA,EACf;AACA,SAAO;AACX;AAIO,SAAS,aAAa,OAAO;AAChC,SAAO,UAAU,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC7E;;;AClBA,IAAI,WAAW,mEAAmE,MAAM,EAAE;AAE1F,IAAI,WAAW,CAAC;AAChB,SAAS,IAAI,GAAG,IAAI,SAAS,QAAQ;AACjC,WAAS,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC,IAAI;AAE1C,SAAS,IAAI,WAAW,CAAC,CAAC,IAAI,SAAS,QAAQ,GAAG;AAClD,SAAS,IAAI,WAAW,CAAC,CAAC,IAAI,SAAS,QAAQ,GAAG;AAY3C,SAAS,aAAa,WAAW;AAEpC,MAAI,KAAK,UAAU,SAAS,IAAI;AAGhC,MAAI,UAAU,UAAU,SAAS,CAAC,KAAK;AACnC,UAAM;AAAA,WACD,UAAU,UAAU,SAAS,CAAC,KAAK;AACxC,UAAM;AACV,MAAI,QAAQ,IAAI,WAAW,EAAE,GAAG,UAAU,GAC1C,WAAW,GACX,GACA,IAAI;AAEJ,WAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACvC,QAAI,SAAS,UAAU,WAAW,CAAC,CAAC;AACpC,QAAI,MAAM,QAAW;AAEjB,cAAQ,UAAU,CAAC,GAAG;AAAA,QAClB,KAAK;AACD,qBAAW;AAAA;AAAA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AQA,mBAAmB,KAAa,OAAoC;AAClE,SAAK,gBAAgB,aAAa,KAAK,KAAK;AAC5C,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,oBAAoB,KAAa,OAAoC;AACnE,SAAK,iBAAiB,aAAa,KAAK,KAAK;AAC7C,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,sBAA8C;AAC5C,SAAK,iBAAiB,8BAA2B;AACjD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,2BAAmD;AACjD,SAAK,iBAAiB,yCAAgC;AACtD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,2BAAmD;AACjD,SAAK,iBAAiB,yCAAgC;AACtD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgB,MAAsC;AACpD,SAAK,iBAAiB,SAAS,IAAI;AACnC,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QAAmB;AACjB,UAAM,UAAU,KAAK,iBAAiB,MAAM;AAC5C,UAAM,WAAW,KAAK,kBAAkB,MAAM;AAC9C,UAAM,SAAS,KAAK,gBAAgB,MAAM;AAC1C,UAAM,UAAU,KAAK,iBAAiB,MAAM;AAE5C,SAAK,iBACF,cAAc,KAAK,SAAS,EAC5B,cAAc,KAAK,SAAS,EAC5B,YAAY,OAAO,EACnB,aAAa,QAAQ,EACrB,WAAW,MAAM,EACjB,YAAY,OAAO;AAEtB,WAAO,KAAK,iBAAiB,MAAM;AAAA,EACrC;AACF;","names":["UnknownFieldHandler","WireType","TWO_PWR_32_DBL","defaultsWrite","defaultsRead","ScalarType","LongType","RepeatType","e","jsonValue","T","NullValue","_","_","_","_","ActorType","_","_"]}
|