Files
npm-core-sdk/go-ape.ts
2025-12-09 11:20:34 +00:00

201 lines
10 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @generated from protobuf file "go-ape.proto" (package "api", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
/**
* @generated from protobuf message api.GoAPEGenerateRequest
*/
export interface GoAPEGenerateRequest {
/**
* @generated from protobuf field: string Namespace = 1
*/
Namespace: string;
/**
* @generated from protobuf field: string TemplateName = 2
*/
TemplateName: string;
/**
* @generated from protobuf field: string LanguageCode = 3
*/
LanguageCode: string;
/**
* @generated from protobuf field: string DataJSON = 4
*/
DataJSON: string;
/**
* @generated from protobuf field: api.GoAPEGenerateType OutputFormat = 5
*/
OutputFormat: GoAPEGenerateType;
}
// =====================
// ===== Responses =====
// =====================
/**
* @generated from protobuf message api.GoAPEGenerateResult
*/
export interface GoAPEGenerateResult {
/**
* @generated from protobuf field: bytes Result = 1
*/
Result: Uint8Array;
}
// =====================
// ===== Requests ======
// =====================
/**
* @generated from protobuf enum api.GoAPEGenerateType
*/
export enum GoAPEGenerateType {
/**
* @generated from protobuf enum value: GO_APE_GENERATE_TYPE_TEXT = 0;
*/
GO_APE_GENERATE_TYPE_TEXT = 0,
/**
* @generated from protobuf enum value: GO_APE_GENERATE_TYPE_PDF = 1;
*/
GO_APE_GENERATE_TYPE_PDF = 1
}
// @generated message type with reflection information, may provide speed optimized methods
class GoAPEGenerateRequest$Type extends MessageType<GoAPEGenerateRequest> {
constructor() {
super("api.GoAPEGenerateRequest", [
{ no: 1, name: "Namespace", kind: "scalar", localName: "Namespace", jsonName: "Namespace", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Namespace" } } },
{ no: 2, name: "TemplateName", kind: "scalar", localName: "TemplateName", jsonName: "TemplateName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Template name" } } },
{ no: 3, name: "LanguageCode", kind: "scalar", localName: "LanguageCode", jsonName: "LanguageCode", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "<a href='https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes'>ISO 639 code</a> message language", example: "\"en\"" } } },
{ no: 4, name: "DataJSON", kind: "scalar", localName: "DataJSON", jsonName: "DataJSON", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "JSON data to be passed to the template" } } },
{ no: 5, name: "OutputFormat", kind: "enum", localName: "OutputFormat", jsonName: "OutputFormat", T: () => ["api.GoAPEGenerateType", GoAPEGenerateType], options: { "validate.rules": { enum: { definedOnly: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Output format" } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["TemplateName", "DataJSON", "OutputFormat"] } } });
}
create(value?: PartialMessage<GoAPEGenerateRequest>): GoAPEGenerateRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.Namespace = "";
message.TemplateName = "";
message.LanguageCode = "";
message.DataJSON = "";
message.OutputFormat = 0;
if (value !== undefined)
reflectionMergePartial<GoAPEGenerateRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GoAPEGenerateRequest): GoAPEGenerateRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string Namespace */ 1:
message.Namespace = reader.string();
break;
case /* string TemplateName */ 2:
message.TemplateName = reader.string();
break;
case /* string LanguageCode */ 3:
message.LanguageCode = reader.string();
break;
case /* string DataJSON */ 4:
message.DataJSON = reader.string();
break;
case /* api.GoAPEGenerateType OutputFormat */ 5:
message.OutputFormat = reader.int32();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: GoAPEGenerateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string Namespace = 1; */
if (message.Namespace !== "")
writer.tag(1, WireType.LengthDelimited).string(message.Namespace);
/* string TemplateName = 2; */
if (message.TemplateName !== "")
writer.tag(2, WireType.LengthDelimited).string(message.TemplateName);
/* string LanguageCode = 3; */
if (message.LanguageCode !== "")
writer.tag(3, WireType.LengthDelimited).string(message.LanguageCode);
/* string DataJSON = 4; */
if (message.DataJSON !== "")
writer.tag(4, WireType.LengthDelimited).string(message.DataJSON);
/* api.GoAPEGenerateType OutputFormat = 5; */
if (message.OutputFormat !== 0)
writer.tag(5, WireType.Varint).int32(message.OutputFormat);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.GoAPEGenerateRequest
*/
export const GoAPEGenerateRequest = new GoAPEGenerateRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GoAPEGenerateResult$Type extends MessageType<GoAPEGenerateResult> {
constructor() {
super("api.GoAPEGenerateResult", [
{ no: 1, name: "Result", kind: "scalar", localName: "Result", jsonName: "Result", T: 12 /*ScalarType.BYTES*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Result" } } }
]);
}
create(value?: PartialMessage<GoAPEGenerateResult>): GoAPEGenerateResult {
const message = globalThis.Object.create((this.messagePrototype!));
message.Result = new Uint8Array(0);
if (value !== undefined)
reflectionMergePartial<GoAPEGenerateResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GoAPEGenerateResult): GoAPEGenerateResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* bytes Result */ 1:
message.Result = reader.bytes();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: GoAPEGenerateResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* bytes Result = 1; */
if (message.Result.length)
writer.tag(1, WireType.LengthDelimited).bytes(message.Result);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.GoAPEGenerateResult
*/
export const GoAPEGenerateResult = new GoAPEGenerateResult$Type();
/**
* @generated ServiceType for protobuf service api.GoAPEService
*/
export const GoAPEService = new ServiceType("api.GoAPEService", [
{ name: "Generate", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Go APE"], description: "Generates a desired output from a template" }, "api.rscType": "Platform", "api.roles": "Platform.GoAPE", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GoAPEGenerateRequest, O: GoAPEGenerateResult }
], { "api.k8sService": "go-ape" });