Files
npm-core-sdk/nats-api.ts
2025-11-03 09:38:37 +00:00

863 lines
45 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @generated from protobuf file "nats-api.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";
import { RequestPartnerAppHeader } from "./shared";
import { RequestProjectHeader } from "./shared";
import { NatsCredentials } from "./shared";
/**
* @generated from protobuf message api.CreateProjectAccountRequest
*/
export interface CreateProjectAccountRequest {
/**
* @generated from protobuf field: string ProjectID = 1
*/
ProjectID: string;
/**
* @generated from protobuf field: string OrganisationID = 2
*/
OrganisationID: string;
}
/**
* @generated from protobuf message api.CreateProjectAccountResult
*/
export interface CreateProjectAccountResult {
/**
* @generated from protobuf field: api.NatsCredentials Credentials = 1
*/
Credentials?: NatsCredentials;
}
/**
* @generated from protobuf message api.CreatePartnerAppUserRequest
*/
export interface CreatePartnerAppUserRequest {
/**
* @generated from protobuf field: string ProjectID = 1
*/
ProjectID: string;
/**
* @generated from protobuf field: string PartnerAppID = 2
*/
PartnerAppID: string;
}
/**
* @generated from protobuf message api.CreatePartnerAppUserResult
*/
export interface CreatePartnerAppUserResult {
/**
* @generated from protobuf field: api.NatsCredentials Credentials = 1
*/
Credentials?: NatsCredentials;
/**
* @generated from protobuf field: string NatsRootSubject = 2
*/
NatsRootSubject: string;
}
/**
* @generated from protobuf message api.DeleteProjectAccountRequest
*/
export interface DeleteProjectAccountRequest {
/**
* @generated from protobuf field: string ProjectID = 1
*/
ProjectID: string;
}
/**
* @generated from protobuf message api.DeleteProjectAccountResult
*/
export interface DeleteProjectAccountResult {
}
/**
* @generated from protobuf message api.DeletePartnerAppUserRequest
*/
export interface DeletePartnerAppUserRequest {
/**
* @generated from protobuf field: string ProjectID = 1
*/
ProjectID: string;
/**
* @generated from protobuf field: string PartnerAppID = 2
*/
PartnerAppID: string;
}
/**
* @generated from protobuf message api.DeletePartnerAppUserResult
*/
export interface DeletePartnerAppUserResult {
}
/**
* @generated from protobuf message api.RenewPartnerAppUserCredentialsRequest
*/
export interface RenewPartnerAppUserCredentialsRequest {
/**
* @generated from protobuf field: api.RequestProjectHeader Header = 1
*/
Header?: RequestProjectHeader;
/**
* @generated from protobuf field: string PartnerAppID = 2
*/
PartnerAppID: string;
}
/**
* @generated from protobuf message api.RenewPartnerAppUserCredentialsResult
*/
export interface RenewPartnerAppUserCredentialsResult {
/**
* @generated from protobuf field: api.NatsCredentials Credentials = 1
*/
Credentials?: NatsCredentials;
}
/**
* @generated from protobuf message api.RenewProjectAccountCredentialsRequest
*/
export interface RenewProjectAccountCredentialsRequest {
/**
* @generated from protobuf field: api.RequestProjectHeader Header = 1
*/
Header?: RequestProjectHeader;
}
/**
* @generated from protobuf message api.RenewProjectAccountCredentialsResult
*/
export interface RenewProjectAccountCredentialsResult {
/**
* @generated from protobuf field: api.NatsCredentials Credentials = 1
*/
Credentials?: NatsCredentials;
}
/**
* @generated from protobuf message api.PushMessageRequest
*/
export interface PushMessageRequest {
/**
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
*/
Header?: RequestPartnerAppHeader;
/**
* @generated from protobuf field: string JWT = 2
*/
JWT: string;
/**
* @generated from protobuf field: string SubjectSuffix = 3
*/
SubjectSuffix: string;
/**
* @generated from protobuf field: string Payload = 4
*/
Payload: string;
}
/**
* @generated from protobuf message api.PushMessageResult
*/
export interface PushMessageResult {
}
// @generated message type with reflection information, may provide speed optimized methods
class CreateProjectAccountRequest$Type extends MessageType<CreateProjectAccountRequest> {
constructor() {
super("api.CreateProjectAccountRequest", [
{ no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 2, name: "OrganisationID", kind: "scalar", localName: "OrganisationID", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
]);
}
create(value?: PartialMessage<CreateProjectAccountRequest>): CreateProjectAccountRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ProjectID = "";
message.OrganisationID = "";
if (value !== undefined)
reflectionMergePartial<CreateProjectAccountRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateProjectAccountRequest): CreateProjectAccountRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string ProjectID */ 1:
message.ProjectID = reader.string();
break;
case /* string OrganisationID */ 2:
message.OrganisationID = reader.string();
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: CreateProjectAccountRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string ProjectID = 1; */
if (message.ProjectID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.ProjectID);
/* string OrganisationID = 2; */
if (message.OrganisationID !== "")
writer.tag(2, WireType.LengthDelimited).string(message.OrganisationID);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.CreateProjectAccountRequest
*/
export const CreateProjectAccountRequest = new CreateProjectAccountRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateProjectAccountResult$Type extends MessageType<CreateProjectAccountResult> {
constructor() {
super("api.CreateProjectAccountResult", [
{ no: 1, name: "Credentials", kind: "message", localName: "Credentials", jsonName: "Credentials", T: () => NatsCredentials }
]);
}
create(value?: PartialMessage<CreateProjectAccountResult>): CreateProjectAccountResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<CreateProjectAccountResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateProjectAccountResult): CreateProjectAccountResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.NatsCredentials Credentials */ 1:
message.Credentials = NatsCredentials.internalBinaryRead(reader, reader.uint32(), options, message.Credentials);
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: CreateProjectAccountResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.NatsCredentials Credentials = 1; */
if (message.Credentials)
NatsCredentials.internalBinaryWrite(message.Credentials, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.CreateProjectAccountResult
*/
export const CreateProjectAccountResult = new CreateProjectAccountResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreatePartnerAppUserRequest$Type extends MessageType<CreatePartnerAppUserRequest> {
constructor() {
super("api.CreatePartnerAppUserRequest", [
{ no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 2, name: "PartnerAppID", kind: "scalar", localName: "PartnerAppID", jsonName: "PartnerAppID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
]);
}
create(value?: PartialMessage<CreatePartnerAppUserRequest>): CreatePartnerAppUserRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ProjectID = "";
message.PartnerAppID = "";
if (value !== undefined)
reflectionMergePartial<CreatePartnerAppUserRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreatePartnerAppUserRequest): CreatePartnerAppUserRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string ProjectID */ 1:
message.ProjectID = reader.string();
break;
case /* string PartnerAppID */ 2:
message.PartnerAppID = reader.string();
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: CreatePartnerAppUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string ProjectID = 1; */
if (message.ProjectID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.ProjectID);
/* string PartnerAppID = 2; */
if (message.PartnerAppID !== "")
writer.tag(2, WireType.LengthDelimited).string(message.PartnerAppID);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.CreatePartnerAppUserRequest
*/
export const CreatePartnerAppUserRequest = new CreatePartnerAppUserRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreatePartnerAppUserResult$Type extends MessageType<CreatePartnerAppUserResult> {
constructor() {
super("api.CreatePartnerAppUserResult", [
{ no: 1, name: "Credentials", kind: "message", localName: "Credentials", jsonName: "Credentials", T: () => NatsCredentials },
{ no: 2, name: "NatsRootSubject", kind: "scalar", localName: "NatsRootSubject", jsonName: "NatsRootSubject", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<CreatePartnerAppUserResult>): CreatePartnerAppUserResult {
const message = globalThis.Object.create((this.messagePrototype!));
message.NatsRootSubject = "";
if (value !== undefined)
reflectionMergePartial<CreatePartnerAppUserResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreatePartnerAppUserResult): CreatePartnerAppUserResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.NatsCredentials Credentials */ 1:
message.Credentials = NatsCredentials.internalBinaryRead(reader, reader.uint32(), options, message.Credentials);
break;
case /* string NatsRootSubject */ 2:
message.NatsRootSubject = reader.string();
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: CreatePartnerAppUserResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.NatsCredentials Credentials = 1; */
if (message.Credentials)
NatsCredentials.internalBinaryWrite(message.Credentials, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* string NatsRootSubject = 2; */
if (message.NatsRootSubject !== "")
writer.tag(2, WireType.LengthDelimited).string(message.NatsRootSubject);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.CreatePartnerAppUserResult
*/
export const CreatePartnerAppUserResult = new CreatePartnerAppUserResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteProjectAccountRequest$Type extends MessageType<DeleteProjectAccountRequest> {
constructor() {
super("api.DeleteProjectAccountRequest", [
{ no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
]);
}
create(value?: PartialMessage<DeleteProjectAccountRequest>): DeleteProjectAccountRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ProjectID = "";
if (value !== undefined)
reflectionMergePartial<DeleteProjectAccountRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteProjectAccountRequest): DeleteProjectAccountRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string ProjectID */ 1:
message.ProjectID = reader.string();
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: DeleteProjectAccountRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string ProjectID = 1; */
if (message.ProjectID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.ProjectID);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.DeleteProjectAccountRequest
*/
export const DeleteProjectAccountRequest = new DeleteProjectAccountRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteProjectAccountResult$Type extends MessageType<DeleteProjectAccountResult> {
constructor() {
super("api.DeleteProjectAccountResult", []);
}
create(value?: PartialMessage<DeleteProjectAccountResult>): DeleteProjectAccountResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<DeleteProjectAccountResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteProjectAccountResult): DeleteProjectAccountResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
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: DeleteProjectAccountResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.DeleteProjectAccountResult
*/
export const DeleteProjectAccountResult = new DeleteProjectAccountResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeletePartnerAppUserRequest$Type extends MessageType<DeletePartnerAppUserRequest> {
constructor() {
super("api.DeletePartnerAppUserRequest", [
{ no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 2, name: "PartnerAppID", kind: "scalar", localName: "PartnerAppID", jsonName: "PartnerAppID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
]);
}
create(value?: PartialMessage<DeletePartnerAppUserRequest>): DeletePartnerAppUserRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ProjectID = "";
message.PartnerAppID = "";
if (value !== undefined)
reflectionMergePartial<DeletePartnerAppUserRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePartnerAppUserRequest): DeletePartnerAppUserRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string ProjectID */ 1:
message.ProjectID = reader.string();
break;
case /* string PartnerAppID */ 2:
message.PartnerAppID = reader.string();
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: DeletePartnerAppUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string ProjectID = 1; */
if (message.ProjectID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.ProjectID);
/* string PartnerAppID = 2; */
if (message.PartnerAppID !== "")
writer.tag(2, WireType.LengthDelimited).string(message.PartnerAppID);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.DeletePartnerAppUserRequest
*/
export const DeletePartnerAppUserRequest = new DeletePartnerAppUserRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeletePartnerAppUserResult$Type extends MessageType<DeletePartnerAppUserResult> {
constructor() {
super("api.DeletePartnerAppUserResult", []);
}
create(value?: PartialMessage<DeletePartnerAppUserResult>): DeletePartnerAppUserResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<DeletePartnerAppUserResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePartnerAppUserResult): DeletePartnerAppUserResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
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: DeletePartnerAppUserResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.DeletePartnerAppUserResult
*/
export const DeletePartnerAppUserResult = new DeletePartnerAppUserResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RenewPartnerAppUserCredentialsRequest$Type extends MessageType<RenewPartnerAppUserCredentialsRequest> {
constructor() {
super("api.RenewPartnerAppUserCredentialsRequest", [
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
{ no: 2, name: "PartnerAppID", kind: "scalar", localName: "PartnerAppID", jsonName: "PartnerAppID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
}
create(value?: PartialMessage<RenewPartnerAppUserCredentialsRequest>): RenewPartnerAppUserCredentialsRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.PartnerAppID = "";
if (value !== undefined)
reflectionMergePartial<RenewPartnerAppUserCredentialsRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RenewPartnerAppUserCredentialsRequest): RenewPartnerAppUserCredentialsRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.RequestProjectHeader Header */ 1:
message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
break;
case /* string PartnerAppID */ 2:
message.PartnerAppID = reader.string();
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: RenewPartnerAppUserCredentialsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.RequestProjectHeader Header = 1; */
if (message.Header)
RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* string PartnerAppID = 2; */
if (message.PartnerAppID !== "")
writer.tag(2, WireType.LengthDelimited).string(message.PartnerAppID);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.RenewPartnerAppUserCredentialsRequest
*/
export const RenewPartnerAppUserCredentialsRequest = new RenewPartnerAppUserCredentialsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RenewPartnerAppUserCredentialsResult$Type extends MessageType<RenewPartnerAppUserCredentialsResult> {
constructor() {
super("api.RenewPartnerAppUserCredentialsResult", [
{ no: 1, name: "Credentials", kind: "message", localName: "Credentials", jsonName: "Credentials", T: () => NatsCredentials }
]);
}
create(value?: PartialMessage<RenewPartnerAppUserCredentialsResult>): RenewPartnerAppUserCredentialsResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<RenewPartnerAppUserCredentialsResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RenewPartnerAppUserCredentialsResult): RenewPartnerAppUserCredentialsResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.NatsCredentials Credentials */ 1:
message.Credentials = NatsCredentials.internalBinaryRead(reader, reader.uint32(), options, message.Credentials);
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: RenewPartnerAppUserCredentialsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.NatsCredentials Credentials = 1; */
if (message.Credentials)
NatsCredentials.internalBinaryWrite(message.Credentials, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.RenewPartnerAppUserCredentialsResult
*/
export const RenewPartnerAppUserCredentialsResult = new RenewPartnerAppUserCredentialsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RenewProjectAccountCredentialsRequest$Type extends MessageType<RenewProjectAccountCredentialsRequest> {
constructor() {
super("api.RenewProjectAccountCredentialsRequest", [
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
}
create(value?: PartialMessage<RenewProjectAccountCredentialsRequest>): RenewProjectAccountCredentialsRequest {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<RenewProjectAccountCredentialsRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RenewProjectAccountCredentialsRequest): RenewProjectAccountCredentialsRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.RequestProjectHeader Header */ 1:
message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
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: RenewProjectAccountCredentialsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.RequestProjectHeader Header = 1; */
if (message.Header)
RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.RenewProjectAccountCredentialsRequest
*/
export const RenewProjectAccountCredentialsRequest = new RenewProjectAccountCredentialsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RenewProjectAccountCredentialsResult$Type extends MessageType<RenewProjectAccountCredentialsResult> {
constructor() {
super("api.RenewProjectAccountCredentialsResult", [
{ no: 1, name: "Credentials", kind: "message", localName: "Credentials", jsonName: "Credentials", T: () => NatsCredentials }
]);
}
create(value?: PartialMessage<RenewProjectAccountCredentialsResult>): RenewProjectAccountCredentialsResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<RenewProjectAccountCredentialsResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RenewProjectAccountCredentialsResult): RenewProjectAccountCredentialsResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.NatsCredentials Credentials */ 1:
message.Credentials = NatsCredentials.internalBinaryRead(reader, reader.uint32(), options, message.Credentials);
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: RenewProjectAccountCredentialsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.NatsCredentials Credentials = 1; */
if (message.Credentials)
NatsCredentials.internalBinaryWrite(message.Credentials, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.RenewProjectAccountCredentialsResult
*/
export const RenewProjectAccountCredentialsResult = new RenewProjectAccountCredentialsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PushMessageRequest$Type extends MessageType<PushMessageRequest> {
constructor() {
super("api.PushMessageRequest", [
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
{ no: 2, name: "JWT", kind: "scalar", localName: "JWT", jsonName: "JWT", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The JWT holding the PartnerApp identity to which parent subject the message will be pushed. It is a signed JWT issued by Reflex Platform upon PartnerApp creation. The PartnerApp from the JWT must be the same as the one in the Header field meaning you cannot push a message for a PartnerApp different than the one you're allowed to." }, "validate.rules": { string: { minLen: "1" } } } },
{ no: 3, name: "SubjectSuffix", kind: "scalar", localName: "SubjectSuffix", jsonName: "SubjectSuffix", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The subject suffix to which the message will be pushed. The subject will be composed of the parent subject of the PartnerApp (from the JWT) and this suffix." }, "validate.rules": { string: { minLen: "1" } } } },
{ no: 4, name: "Payload", kind: "scalar", localName: "Payload", jsonName: "Payload", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The message payload." }, "validate.rules": { string: { minLen: "1" } } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "JWT", "Subject"] } } });
}
create(value?: PartialMessage<PushMessageRequest>): PushMessageRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.JWT = "";
message.SubjectSuffix = "";
message.Payload = "";
if (value !== undefined)
reflectionMergePartial<PushMessageRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PushMessageRequest): PushMessageRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.RequestPartnerAppHeader Header */ 1:
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
break;
case /* string JWT */ 2:
message.JWT = reader.string();
break;
case /* string SubjectSuffix */ 3:
message.SubjectSuffix = reader.string();
break;
case /* string Payload */ 4:
message.Payload = reader.string();
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: PushMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.RequestPartnerAppHeader Header = 1; */
if (message.Header)
RequestPartnerAppHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* string JWT = 2; */
if (message.JWT !== "")
writer.tag(2, WireType.LengthDelimited).string(message.JWT);
/* string SubjectSuffix = 3; */
if (message.SubjectSuffix !== "")
writer.tag(3, WireType.LengthDelimited).string(message.SubjectSuffix);
/* string Payload = 4; */
if (message.Payload !== "")
writer.tag(4, WireType.LengthDelimited).string(message.Payload);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.PushMessageRequest
*/
export const PushMessageRequest = new PushMessageRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PushMessageResult$Type extends MessageType<PushMessageResult> {
constructor() {
super("api.PushMessageResult", []);
}
create(value?: PartialMessage<PushMessageResult>): PushMessageResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<PushMessageResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PushMessageResult): PushMessageResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
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: PushMessageResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.PushMessageResult
*/
export const PushMessageResult = new PushMessageResult$Type();
/**
* @generated ServiceType for protobuf service api.NatsService
*/
export const NatsService = new ServiceType("api.NatsService", [
{ name: "CreateProjectAccount", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Create an account and an user in NATS" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Nats", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CreateProjectAccountRequest, O: CreateProjectAccountResult },
{ name: "DeleteProjectAccount", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Delete a NATS account and its users" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Nats", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: DeleteProjectAccountRequest, O: DeleteProjectAccountResult },
{ name: "CreatePartnerAppUser", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Create an user in NATS under its associated account" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Nats", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CreatePartnerAppUserRequest, O: CreatePartnerAppUserResult },
{ name: "DeletePartnerAppUser", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Delete a NATS user" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Nats", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: DeletePartnerAppUserRequest, O: DeletePartnerAppUserResult },
{ name: "RenewProjectAccountCredentials", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Renew (revoke + create) NATS Credentials for an account" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: RenewProjectAccountCredentialsRequest, O: RenewProjectAccountCredentialsResult },
{ name: "RenewPartnerAppUserCredentials", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Renew (revoke + create) NATS Credentials for a user" }, "api.rscType": "Project", "api.roles": "Platform.Project-Nats", "google.api.method_visibility": { restriction: "SDK" } }, I: RenewPartnerAppUserCredentialsRequest, O: RenewPartnerAppUserCredentialsResult },
{ name: "PushMessage", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin NATS"], description: "Push a message to a NATS subject" }, "api.rscType": "PartnerApp", "api.roles": "Platform.PartnerApp-Nats", "google.api.method_visibility": { restriction: "SDK" } }, I: PushMessageRequest, O: PushMessageResult }
], { "api.k8sService": "nats-api" });