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

358 lines
16 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @generated from protobuf file "base.proto" (package "api", syntax proto3)
// tslint:disable
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.AdminAddress
*/
export interface AdminAddress {
/**
* @generated from protobuf field: string City = 1
*/
City: string;
/**
* Country Code in <a href='https://en.wikipedia.org/wiki/ISO_3166-1'>ISO_3166-1</a> format
*
* @generated from protobuf field: string CountryCode = 2
*/
CountryCode: string;
/**
* @generated from protobuf field: api.AdminGeographicalCoordinates GeographicalCoordinates = 3
*/
GeographicalCoordinates?: AdminGeographicalCoordinates;
/**
* @generated from protobuf field: string Name = 4
*/
Name: string;
/**
* @generated from protobuf field: string POBoxNumber = 5
*/
POBoxNumber: string;
/**
* @generated from protobuf field: string PostalCode = 6
*/
PostalCode: string;
/**
* @generated from protobuf field: string ProvinceCode = 7
*/
ProvinceCode: string;
/**
* @generated from protobuf field: string State = 8
*/
State: string;
/**
* @generated from protobuf field: string StreetAddressOne = 9
*/
StreetAddressOne: string;
/**
* @generated from protobuf field: string StreetAddressTwo = 10
*/
StreetAddressTwo: string;
/**
* @generated from protobuf field: string StreetAddressThree = 11
*/
StreetAddressThree: string;
/**
* @generated from protobuf field: string PlusCode = 12
*/
PlusCode: string;
}
/**
*
* Geographical coordinates information
*
* @generated from protobuf message api.AdminGeographicalCoordinates
*/
export interface AdminGeographicalCoordinates {
/**
* @generated from protobuf field: string Latitude = 1
*/
Latitude: string;
/**
* @generated from protobuf field: string Longitude = 2
*/
Longitude: string;
}
/**
* @generated from protobuf message api.Paging
*/
export interface Paging {
/**
* @generated from protobuf field: int32 Limit = 1
*/
Limit: number;
/**
* @generated from protobuf field: int32 Offset = 2
*/
Offset: number;
}
/**
* @generated from protobuf enum api.ProjectType
*/
export enum ProjectType {
/**
* @generated from protobuf enum value: PROJECT_TYPE_UNKNOWN = 0;
*/
PROJECT_TYPE_UNKNOWN = 0,
/**
* @generated from protobuf enum value: PROJECT_TYPE_ACTIVITY = 1;
*/
PROJECT_TYPE_ACTIVITY = 1,
/**
* @generated from protobuf enum value: PROJECT_TYPE_SITE = 2;
*/
PROJECT_TYPE_SITE = 2
}
// @generated message type with reflection information, may provide speed optimized methods
class AdminAddress$Type extends MessageType<AdminAddress> {
constructor() {
super("api.AdminAddress", [
{ no: 1, name: "City", kind: "scalar", localName: "City", jsonName: "City", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "CountryCode", kind: "scalar", localName: "CountryCode", jsonName: "CountryCode", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { countryCodeIso3166: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Country Code in <a href='https://en.wikipedia.org/wiki/ISO_3166-1'>ISO_3166-1</a> format", example: "[\"FR\", \"FRA\", \"250\"]" } } },
{ no: 3, name: "GeographicalCoordinates", kind: "message", localName: "GeographicalCoordinates", jsonName: "GeographicalCoordinates", T: () => AdminGeographicalCoordinates },
{ no: 4, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "POBoxNumber", kind: "scalar", localName: "POBoxNumber", jsonName: "POBoxNumber", T: 9 /*ScalarType.STRING*/ },
{ no: 6, name: "PostalCode", kind: "scalar", localName: "PostalCode", jsonName: "PostalCode", T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: "ProvinceCode", kind: "scalar", localName: "ProvinceCode", jsonName: "ProvinceCode", T: 9 /*ScalarType.STRING*/ },
{ no: 8, name: "State", kind: "scalar", localName: "State", jsonName: "State", T: 9 /*ScalarType.STRING*/ },
{ no: 9, name: "StreetAddressOne", kind: "scalar", localName: "StreetAddressOne", jsonName: "StreetAddressOne", T: 9 /*ScalarType.STRING*/ },
{ no: 10, name: "StreetAddressTwo", kind: "scalar", localName: "StreetAddressTwo", jsonName: "StreetAddressTwo", T: 9 /*ScalarType.STRING*/ },
{ no: 11, name: "StreetAddressThree", kind: "scalar", localName: "StreetAddressThree", jsonName: "StreetAddressThree", T: 9 /*ScalarType.STRING*/ },
{ no: 12, name: "PlusCode", kind: "scalar", localName: "PlusCode", jsonName: "PlusCode", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<AdminAddress>): AdminAddress {
const message = globalThis.Object.create((this.messagePrototype!));
message.City = "";
message.CountryCode = "";
message.Name = "";
message.POBoxNumber = "";
message.PostalCode = "";
message.ProvinceCode = "";
message.State = "";
message.StreetAddressOne = "";
message.StreetAddressTwo = "";
message.StreetAddressThree = "";
message.PlusCode = "";
if (value !== undefined)
reflectionMergePartial<AdminAddress>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AdminAddress): AdminAddress {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string City */ 1:
message.City = reader.string();
break;
case /* string CountryCode */ 2:
message.CountryCode = reader.string();
break;
case /* api.AdminGeographicalCoordinates GeographicalCoordinates */ 3:
message.GeographicalCoordinates = AdminGeographicalCoordinates.internalBinaryRead(reader, reader.uint32(), options, message.GeographicalCoordinates);
break;
case /* string Name */ 4:
message.Name = reader.string();
break;
case /* string POBoxNumber */ 5:
message.POBoxNumber = reader.string();
break;
case /* string PostalCode */ 6:
message.PostalCode = reader.string();
break;
case /* string ProvinceCode */ 7:
message.ProvinceCode = reader.string();
break;
case /* string State */ 8:
message.State = reader.string();
break;
case /* string StreetAddressOne */ 9:
message.StreetAddressOne = reader.string();
break;
case /* string StreetAddressTwo */ 10:
message.StreetAddressTwo = reader.string();
break;
case /* string StreetAddressThree */ 11:
message.StreetAddressThree = reader.string();
break;
case /* string PlusCode */ 12:
message.PlusCode = 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: AdminAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string City = 1; */
if (message.City !== "")
writer.tag(1, WireType.LengthDelimited).string(message.City);
/* string CountryCode = 2; */
if (message.CountryCode !== "")
writer.tag(2, WireType.LengthDelimited).string(message.CountryCode);
/* api.AdminGeographicalCoordinates GeographicalCoordinates = 3; */
if (message.GeographicalCoordinates)
AdminGeographicalCoordinates.internalBinaryWrite(message.GeographicalCoordinates, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
/* string Name = 4; */
if (message.Name !== "")
writer.tag(4, WireType.LengthDelimited).string(message.Name);
/* string POBoxNumber = 5; */
if (message.POBoxNumber !== "")
writer.tag(5, WireType.LengthDelimited).string(message.POBoxNumber);
/* string PostalCode = 6; */
if (message.PostalCode !== "")
writer.tag(6, WireType.LengthDelimited).string(message.PostalCode);
/* string ProvinceCode = 7; */
if (message.ProvinceCode !== "")
writer.tag(7, WireType.LengthDelimited).string(message.ProvinceCode);
/* string State = 8; */
if (message.State !== "")
writer.tag(8, WireType.LengthDelimited).string(message.State);
/* string StreetAddressOne = 9; */
if (message.StreetAddressOne !== "")
writer.tag(9, WireType.LengthDelimited).string(message.StreetAddressOne);
/* string StreetAddressTwo = 10; */
if (message.StreetAddressTwo !== "")
writer.tag(10, WireType.LengthDelimited).string(message.StreetAddressTwo);
/* string StreetAddressThree = 11; */
if (message.StreetAddressThree !== "")
writer.tag(11, WireType.LengthDelimited).string(message.StreetAddressThree);
/* string PlusCode = 12; */
if (message.PlusCode !== "")
writer.tag(12, WireType.LengthDelimited).string(message.PlusCode);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.AdminAddress
*/
export const AdminAddress = new AdminAddress$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AdminGeographicalCoordinates$Type extends MessageType<AdminGeographicalCoordinates> {
constructor() {
super("api.AdminGeographicalCoordinates", [
{ no: 1, name: "Latitude", kind: "scalar", localName: "Latitude", jsonName: "Latitude", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "Longitude", kind: "scalar", localName: "Longitude", jsonName: "Longitude", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<AdminGeographicalCoordinates>): AdminGeographicalCoordinates {
const message = globalThis.Object.create((this.messagePrototype!));
message.Latitude = "";
message.Longitude = "";
if (value !== undefined)
reflectionMergePartial<AdminGeographicalCoordinates>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AdminGeographicalCoordinates): AdminGeographicalCoordinates {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string Latitude */ 1:
message.Latitude = reader.string();
break;
case /* string Longitude */ 2:
message.Longitude = 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: AdminGeographicalCoordinates, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string Latitude = 1; */
if (message.Latitude !== "")
writer.tag(1, WireType.LengthDelimited).string(message.Latitude);
/* string Longitude = 2; */
if (message.Longitude !== "")
writer.tag(2, WireType.LengthDelimited).string(message.Longitude);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.AdminGeographicalCoordinates
*/
export const AdminGeographicalCoordinates = new AdminGeographicalCoordinates$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Paging$Type extends MessageType<Paging> {
constructor() {
super("api.Paging", [
{ no: 1, name: "Limit", kind: "scalar", localName: "Limit", jsonName: "Limit", T: 5 /*ScalarType.INT32*/ },
{ no: 2, name: "Offset", kind: "scalar", localName: "Offset", jsonName: "Offset", T: 5 /*ScalarType.INT32*/ }
]);
}
create(value?: PartialMessage<Paging>): Paging {
const message = globalThis.Object.create((this.messagePrototype!));
message.Limit = 0;
message.Offset = 0;
if (value !== undefined)
reflectionMergePartial<Paging>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Paging): Paging {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* int32 Limit */ 1:
message.Limit = reader.int32();
break;
case /* int32 Offset */ 2:
message.Offset = 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: Paging, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* int32 Limit = 1; */
if (message.Limit !== 0)
writer.tag(1, WireType.Varint).int32(message.Limit);
/* int32 Offset = 2; */
if (message.Offset !== 0)
writer.tag(2, WireType.Varint).int32(message.Offset);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.Paging
*/
export const Paging = new Paging$Type();