You've already forked npm-core-sdk
Latest generation
This commit is contained in:
150
attachmentV2.ts
150
attachmentV2.ts
@@ -14,6 +14,8 @@ import { MessageType } from "@protobuf-ts/runtime";
|
||||
import { ResponseHeader } from "./shared";
|
||||
import { EntityType } from "./shared";
|
||||
import { RequestProjectHeader } from "./shared";
|
||||
import { FileDataRequest } from "./shared";
|
||||
import { FileDataResponse } from "./shared";
|
||||
import { AttachmentTypeResponseHeader } from "./shared";
|
||||
import { RequestAttachmentTypeHeader } from "./shared";
|
||||
import { AttachmentType } from "./shared";
|
||||
@@ -60,36 +62,6 @@ export interface Attachment {
|
||||
*/
|
||||
WebURI: string;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.FileDataRequest
|
||||
*/
|
||||
export interface FileDataRequest {
|
||||
/**
|
||||
* @generated from protobuf field: string Name = 1
|
||||
*/
|
||||
Name: string;
|
||||
/**
|
||||
* @generated from protobuf field: bytes Content = 2
|
||||
*/
|
||||
Content: Uint8Array;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.FileDataResponse
|
||||
*/
|
||||
export interface FileDataResponse {
|
||||
/**
|
||||
* @generated from protobuf field: string Name = 1
|
||||
*/
|
||||
Name: string;
|
||||
/**
|
||||
* @generated from protobuf field: string ContentType = 2
|
||||
*/
|
||||
ContentType: string;
|
||||
/**
|
||||
* @generated from protobuf field: bytes Content = 3
|
||||
*/
|
||||
Content: Uint8Array;
|
||||
}
|
||||
// ========== REQUESTS & RESPONSE MESSAGES ==========
|
||||
|
||||
/**
|
||||
@@ -438,124 +410,6 @@ class Attachment$Type extends MessageType<Attachment> {
|
||||
*/
|
||||
export const Attachment = new Attachment$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class FileDataRequest$Type extends MessageType<FileDataRequest> {
|
||||
constructor() {
|
||||
super("api.FileDataRequest", [
|
||||
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "Content", kind: "scalar", localName: "Content", jsonName: "Content", T: 12 /*ScalarType.BYTES*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<FileDataRequest>): FileDataRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Name = "";
|
||||
message.Content = new Uint8Array(0);
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<FileDataRequest>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDataRequest): FileDataRequest {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string Name */ 1:
|
||||
message.Name = reader.string();
|
||||
break;
|
||||
case /* bytes Content */ 2:
|
||||
message.Content = 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: FileDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string Name = 1; */
|
||||
if (message.Name !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
||||
/* bytes Content = 2; */
|
||||
if (message.Content.length)
|
||||
writer.tag(2, WireType.LengthDelimited).bytes(message.Content);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.FileDataRequest
|
||||
*/
|
||||
export const FileDataRequest = new FileDataRequest$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class FileDataResponse$Type extends MessageType<FileDataResponse> {
|
||||
constructor() {
|
||||
super("api.FileDataResponse", [
|
||||
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 2, name: "ContentType", kind: "scalar", localName: "ContentType", jsonName: "ContentType", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 3, name: "Content", kind: "scalar", localName: "Content", jsonName: "Content", T: 12 /*ScalarType.BYTES*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<FileDataResponse>): FileDataResponse {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Name = "";
|
||||
message.ContentType = "";
|
||||
message.Content = new Uint8Array(0);
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<FileDataResponse>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDataResponse): FileDataResponse {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string Name */ 1:
|
||||
message.Name = reader.string();
|
||||
break;
|
||||
case /* string ContentType */ 2:
|
||||
message.ContentType = reader.string();
|
||||
break;
|
||||
case /* bytes Content */ 3:
|
||||
message.Content = 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: FileDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string Name = 1; */
|
||||
if (message.Name !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
||||
/* string ContentType = 2; */
|
||||
if (message.ContentType !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.ContentType);
|
||||
/* bytes Content = 3; */
|
||||
if (message.Content.length)
|
||||
writer.tag(3, WireType.LengthDelimited).bytes(message.Content);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.FileDataResponse
|
||||
*/
|
||||
export const FileDataResponse = new FileDataResponse$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class DownloadAttachmentV2Request$Type extends MessageType<DownloadAttachmentV2Request> {
|
||||
constructor() {
|
||||
super("api.DownloadAttachmentV2Request", [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@reflex-platform/npm-core-sdk",
|
||||
"version": "1.11.0-SNAPSHOT-250623100149",
|
||||
"version": "1.11.0-SNAPSHOT-250624135303",
|
||||
"description": "npm libs from core model proto files",
|
||||
"homepage": "",
|
||||
"main": "index.ts",
|
||||
|
||||
151
shared.ts
151
shared.ts
@@ -1957,6 +1957,39 @@ export interface LabelByLanguage {
|
||||
*/
|
||||
LanguageCodeISO6391: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Standard structure, for request to upload file
|
||||
*
|
||||
* @generated from protobuf message api.FileDataRequest
|
||||
*/
|
||||
export interface FileDataRequest {
|
||||
/**
|
||||
* @generated from protobuf field: string Name = 1
|
||||
*/
|
||||
Name: string;
|
||||
/**
|
||||
* @generated from protobuf field: bytes Content = 2
|
||||
*/
|
||||
Content: Uint8Array;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.FileDataResponse
|
||||
*/
|
||||
export interface FileDataResponse {
|
||||
/**
|
||||
* @generated from protobuf field: string Name = 1
|
||||
*/
|
||||
Name: string;
|
||||
/**
|
||||
* @generated from protobuf field: string ContentType = 2
|
||||
*/
|
||||
ContentType: string;
|
||||
/**
|
||||
* @generated from protobuf field: bytes Content = 3
|
||||
*/
|
||||
Content: Uint8Array;
|
||||
}
|
||||
/**
|
||||
* List all data set in the model
|
||||
*
|
||||
@@ -8217,3 +8250,121 @@ class LabelByLanguage$Type extends MessageType<LabelByLanguage> {
|
||||
* @generated MessageType for protobuf message api.LabelByLanguage
|
||||
*/
|
||||
export const LabelByLanguage = new LabelByLanguage$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class FileDataRequest$Type extends MessageType<FileDataRequest> {
|
||||
constructor() {
|
||||
super("api.FileDataRequest", [
|
||||
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "Content", kind: "scalar", localName: "Content", jsonName: "Content", T: 12 /*ScalarType.BYTES*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<FileDataRequest>): FileDataRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Name = "";
|
||||
message.Content = new Uint8Array(0);
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<FileDataRequest>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDataRequest): FileDataRequest {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string Name */ 1:
|
||||
message.Name = reader.string();
|
||||
break;
|
||||
case /* bytes Content */ 2:
|
||||
message.Content = 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: FileDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string Name = 1; */
|
||||
if (message.Name !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
||||
/* bytes Content = 2; */
|
||||
if (message.Content.length)
|
||||
writer.tag(2, WireType.LengthDelimited).bytes(message.Content);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.FileDataRequest
|
||||
*/
|
||||
export const FileDataRequest = new FileDataRequest$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class FileDataResponse$Type extends MessageType<FileDataResponse> {
|
||||
constructor() {
|
||||
super("api.FileDataResponse", [
|
||||
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 2, name: "ContentType", kind: "scalar", localName: "ContentType", jsonName: "ContentType", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 3, name: "Content", kind: "scalar", localName: "Content", jsonName: "Content", T: 12 /*ScalarType.BYTES*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<FileDataResponse>): FileDataResponse {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Name = "";
|
||||
message.ContentType = "";
|
||||
message.Content = new Uint8Array(0);
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<FileDataResponse>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDataResponse): FileDataResponse {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string Name */ 1:
|
||||
message.Name = reader.string();
|
||||
break;
|
||||
case /* string ContentType */ 2:
|
||||
message.ContentType = reader.string();
|
||||
break;
|
||||
case /* bytes Content */ 3:
|
||||
message.Content = 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: FileDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string Name = 1; */
|
||||
if (message.Name !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
||||
/* string ContentType = 2; */
|
||||
if (message.ContentType !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.ContentType);
|
||||
/* bytes Content = 3; */
|
||||
if (message.Content.length)
|
||||
writer.tag(3, WireType.LengthDelimited).bytes(message.Content);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.FileDataResponse
|
||||
*/
|
||||
export const FileDataResponse = new FileDataResponse$Type();
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
||||
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
||||
import { TinyURLService } from "./tiny-url";
|
||||
import type { HttpBody } from "./google/api/httpbody";
|
||||
import type { DownloadFileRequest } from "./tiny-url";
|
||||
import type { GetLongURLResult } from "./tiny-url";
|
||||
import type { GetLongURLRequest } from "./tiny-url";
|
||||
import type { GetPartnerAppTinyURLResult } from "./tiny-url";
|
||||
import type { GetPartnerAppTinyURLRequest } from "./tiny-url";
|
||||
import type { GetSiteTinyURLResult } from "./tiny-url";
|
||||
import type { GetSiteTinyURLRequest } from "./tiny-url";
|
||||
import type { DeletePartnerAppTinyURLResponse } from "./tiny-url";
|
||||
import type { DeletePartnerAppTinyURLRequest } from "./tiny-url";
|
||||
import type { DeleteSiteTinyURLResponse } from "./tiny-url";
|
||||
@@ -27,13 +27,6 @@ import type { ShortenSiteURLResult } from "./tiny-url";
|
||||
import type { ShortenSiteURLRequest } from "./tiny-url";
|
||||
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
||||
// TODOs :
|
||||
// - Parler avec Vincent de la compilation
|
||||
// - Un endpoint sans rscType
|
||||
// - TTL enum
|
||||
// - Gestion UMA sans interceptor
|
||||
// - k8sService
|
||||
|
||||
// ============ SERVICE DESCRIPTION ============
|
||||
|
||||
/**
|
||||
@@ -73,21 +66,14 @@ export interface ITinyURLServiceClient {
|
||||
*/
|
||||
deletePartnerAppTinyURL(input: DeletePartnerAppTinyURLRequest, options?: RpcOptions): UnaryCall<DeletePartnerAppTinyURLRequest, DeletePartnerAppTinyURLResponse>;
|
||||
/**
|
||||
* @generated from protobuf rpc: GetLongURL
|
||||
* @generated from protobuf rpc: GetSiteTinyURL
|
||||
*/
|
||||
getLongURL(input: GetLongURLRequest, options?: RpcOptions): UnaryCall<GetLongURLRequest, GetLongURLResult>;
|
||||
getSiteTinyURL(input: GetSiteTinyURLRequest, options?: RpcOptions): UnaryCall<GetSiteTinyURLRequest, GetSiteTinyURLResult>;
|
||||
/**
|
||||
* @generated from protobuf rpc: DownloadFile
|
||||
* @generated from protobuf rpc: GetPartnerAppTinyURL
|
||||
*/
|
||||
downloadFile(input: DownloadFileRequest, options?: RpcOptions): UnaryCall<DownloadFileRequest, HttpBody>;
|
||||
getPartnerAppTinyURL(input: GetPartnerAppTinyURLRequest, options?: RpcOptions): UnaryCall<GetPartnerAppTinyURLRequest, GetPartnerAppTinyURLResult>;
|
||||
}
|
||||
// TODOs :
|
||||
// - Parler avec Vincent de la compilation
|
||||
// - Un endpoint sans rscType
|
||||
// - TTL enum
|
||||
// - Gestion UMA sans interceptor
|
||||
// - k8sService
|
||||
|
||||
// ============ SERVICE DESCRIPTION ============
|
||||
|
||||
/**
|
||||
@@ -156,17 +142,17 @@ export class TinyURLServiceClient implements ITinyURLServiceClient, ServiceInfo
|
||||
return stackIntercept<DeletePartnerAppTinyURLRequest, DeletePartnerAppTinyURLResponse>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf rpc: GetLongURL
|
||||
* @generated from protobuf rpc: GetSiteTinyURL
|
||||
*/
|
||||
getLongURL(input: GetLongURLRequest, options?: RpcOptions): UnaryCall<GetLongURLRequest, GetLongURLResult> {
|
||||
getSiteTinyURL(input: GetSiteTinyURLRequest, options?: RpcOptions): UnaryCall<GetSiteTinyURLRequest, GetSiteTinyURLResult> {
|
||||
const method = this.methods[8], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<GetLongURLRequest, GetLongURLResult>("unary", this._transport, method, opt, input);
|
||||
return stackIntercept<GetSiteTinyURLRequest, GetSiteTinyURLResult>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf rpc: DownloadFile
|
||||
* @generated from protobuf rpc: GetPartnerAppTinyURL
|
||||
*/
|
||||
downloadFile(input: DownloadFileRequest, options?: RpcOptions): UnaryCall<DownloadFileRequest, HttpBody> {
|
||||
getPartnerAppTinyURL(input: GetPartnerAppTinyURLRequest, options?: RpcOptions): UnaryCall<GetPartnerAppTinyURLRequest, GetPartnerAppTinyURLResult> {
|
||||
const method = this.methods[9], opt = this._transport.mergeOptions(options);
|
||||
return stackIntercept<DownloadFileRequest, HttpBody>("unary", this._transport, method, opt, input);
|
||||
return stackIntercept<GetPartnerAppTinyURLRequest, GetPartnerAppTinyURLResult>("unary", this._transport, method, opt, input);
|
||||
}
|
||||
}
|
||||
|
||||
615
tiny-url.ts
615
tiny-url.ts
@@ -1,7 +1,6 @@
|
||||
// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
|
||||
// @generated from protobuf file "tiny-url.proto" (package "api", syntax proto3)
|
||||
// tslint:disable
|
||||
import { HttpBody } from "./google/api/httpbody";
|
||||
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
||||
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||
@@ -12,6 +11,8 @@ 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 { FileDataResponse } from "./shared";
|
||||
import { FileDataRequest } from "./shared";
|
||||
import { RequestPartnerAppHeader } from "./shared";
|
||||
import { RequestSiteHeader } from "./shared";
|
||||
import { ResourceType } from "./shared";
|
||||
@@ -32,6 +33,19 @@ export interface FileMetadata {
|
||||
*/
|
||||
Size: bigint;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.TinyURLData
|
||||
*/
|
||||
export interface TinyURLData {
|
||||
/**
|
||||
* @generated from protobuf field: string LongURL = 1
|
||||
*/
|
||||
LongURL: string;
|
||||
/**
|
||||
* @generated from protobuf field: api.FileMetadata File = 2
|
||||
*/
|
||||
File?: FileMetadata;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.TinyURL
|
||||
*/
|
||||
@@ -41,23 +55,13 @@ export interface TinyURL {
|
||||
*/
|
||||
ID: string;
|
||||
/**
|
||||
* @generated from protobuf oneof: Type
|
||||
* @generated from protobuf field: api.TinyURLKind Kind = 2
|
||||
*/
|
||||
Type: {
|
||||
oneofKind: "LongURL";
|
||||
/**
|
||||
* @generated from protobuf field: string LongURL = 2
|
||||
*/
|
||||
LongURL: string;
|
||||
} | {
|
||||
oneofKind: "File";
|
||||
/**
|
||||
* @generated from protobuf field: api.FileMetadata File = 3
|
||||
*/
|
||||
File: FileMetadata;
|
||||
} | {
|
||||
oneofKind: undefined;
|
||||
};
|
||||
Kind: TinyURLKind;
|
||||
/**
|
||||
* @generated from protobuf field: api.TinyURLData Data = 3
|
||||
*/
|
||||
Data?: TinyURLData;
|
||||
/**
|
||||
* @generated from protobuf field: string URL = 4
|
||||
*/
|
||||
@@ -71,9 +75,9 @@ export interface TinyURL {
|
||||
*/
|
||||
ResourceRefID: string;
|
||||
/**
|
||||
* @generated from protobuf field: api.TimeToLive TimeToLive = 7
|
||||
* @generated from protobuf field: int64 TimeToLive = 7
|
||||
*/
|
||||
TimeToLive: TimeToLive;
|
||||
TimeToLive: bigint;
|
||||
/**
|
||||
* @generated from protobuf field: string CreatedAt = 8
|
||||
*/
|
||||
@@ -87,19 +91,6 @@ export interface TinyURL {
|
||||
*/
|
||||
IsOnce: boolean;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.FileRequest
|
||||
*/
|
||||
export interface FileRequest {
|
||||
/**
|
||||
* @generated from protobuf field: string Name = 1
|
||||
*/
|
||||
Name: string;
|
||||
/**
|
||||
* @generated from protobuf field: bytes Content = 3
|
||||
*/
|
||||
Content: Uint8Array;
|
||||
}
|
||||
// ========== REQUESTS & RESPONSE MESSAGES ==========
|
||||
|
||||
/**
|
||||
@@ -115,9 +106,9 @@ export interface ShortenSiteURLRequest {
|
||||
*/
|
||||
URL: string;
|
||||
/**
|
||||
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
||||
* @generated from protobuf field: int64 TimeToLive = 3
|
||||
*/
|
||||
TimeToLive: TimeToLive;
|
||||
TimeToLive: bigint;
|
||||
/**
|
||||
* @generated from protobuf field: bool isPublic = 4
|
||||
*/
|
||||
@@ -149,9 +140,9 @@ export interface ShortenPartnerAppURLRequest {
|
||||
*/
|
||||
URL: string;
|
||||
/**
|
||||
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
||||
* @generated from protobuf field: int64 TimeToLive = 3
|
||||
*/
|
||||
TimeToLive: TimeToLive;
|
||||
TimeToLive: bigint;
|
||||
/**
|
||||
* @generated from protobuf field: bool isPublic = 4
|
||||
*/
|
||||
@@ -179,13 +170,13 @@ export interface UploadSiteFileRequest {
|
||||
*/
|
||||
Header?: RequestSiteHeader;
|
||||
/**
|
||||
* @generated from protobuf field: api.FileRequest FileData = 2
|
||||
* @generated from protobuf field: api.FileDataRequest FileData = 2
|
||||
*/
|
||||
FileData?: FileRequest;
|
||||
FileData?: FileDataRequest;
|
||||
/**
|
||||
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
||||
* @generated from protobuf field: int64 TimeToLive = 3
|
||||
*/
|
||||
TimeToLive: TimeToLive;
|
||||
TimeToLive: bigint;
|
||||
/**
|
||||
* @generated from protobuf field: bool isPublic = 4
|
||||
*/
|
||||
@@ -213,13 +204,13 @@ export interface UploadPartnerAppFileRequest {
|
||||
*/
|
||||
Header?: RequestPartnerAppHeader;
|
||||
/**
|
||||
* @generated from protobuf field: api.FileRequest FileData = 2
|
||||
* @generated from protobuf field: api.FileDataRequest FileData = 2
|
||||
*/
|
||||
FileData?: FileRequest;
|
||||
FileData?: FileDataRequest;
|
||||
/**
|
||||
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
||||
* @generated from protobuf field: int64 TimeToLive = 3
|
||||
*/
|
||||
TimeToLive: TimeToLive;
|
||||
TimeToLive: bigint;
|
||||
/**
|
||||
* @generated from protobuf field: bool isPublic = 4
|
||||
*/
|
||||
@@ -311,78 +302,83 @@ export interface DeletePartnerAppTinyURLRequest {
|
||||
export interface DeletePartnerAppTinyURLResponse {
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.GetLongURLRequest
|
||||
* @generated from protobuf message api.GetSiteTinyURLRequest
|
||||
*/
|
||||
export interface GetLongURLRequest {
|
||||
export interface GetSiteTinyURLRequest {
|
||||
/**
|
||||
* @generated from protobuf field: string ID = 1
|
||||
* @generated from protobuf field: api.RequestSiteHeader Header = 1
|
||||
*/
|
||||
Header?: RequestSiteHeader;
|
||||
/**
|
||||
* @generated from protobuf field: string ID = 2
|
||||
*/
|
||||
ID: string;
|
||||
/**
|
||||
* @generated from protobuf field: string Token = 2
|
||||
*/
|
||||
Token: string;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.GetLongURLResult
|
||||
* @generated from protobuf message api.GetSiteTinyURLResult
|
||||
*/
|
||||
export interface GetLongURLResult {
|
||||
export interface GetSiteTinyURLResult {
|
||||
/**
|
||||
* @generated from protobuf field: api.TinyURL TinyURL = 1
|
||||
* @generated from protobuf field: api.TinyURLKind Kind = 1
|
||||
*/
|
||||
TinyURL?: TinyURL;
|
||||
Kind: TinyURLKind;
|
||||
/**
|
||||
* @generated from protobuf field: api.FileDataResponse File = 2
|
||||
*/
|
||||
File?: FileDataResponse;
|
||||
/**
|
||||
* @generated from protobuf field: string LongURL = 3
|
||||
*/
|
||||
LongURL: string;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.DownloadFileRequest
|
||||
* @generated from protobuf message api.GetPartnerAppTinyURLRequest
|
||||
*/
|
||||
export interface DownloadFileRequest {
|
||||
export interface GetPartnerAppTinyURLRequest {
|
||||
/**
|
||||
* @generated from protobuf field: string ID = 1
|
||||
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
|
||||
*/
|
||||
Header?: RequestPartnerAppHeader;
|
||||
/**
|
||||
* @generated from protobuf field: string ID = 2
|
||||
*/
|
||||
ID: string;
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.GetPartnerAppTinyURLResult
|
||||
*/
|
||||
export interface GetPartnerAppTinyURLResult {
|
||||
/**
|
||||
* @generated from protobuf field: string Token = 2
|
||||
* @generated from protobuf field: api.TinyURLKind Kind = 1
|
||||
*/
|
||||
Token: string;
|
||||
Kind: TinyURLKind;
|
||||
/**
|
||||
* @generated from protobuf field: api.FileDataResponse File = 2
|
||||
*/
|
||||
File?: FileDataResponse;
|
||||
/**
|
||||
* @generated from protobuf field: string LongURL = 3
|
||||
*/
|
||||
LongURL: string;
|
||||
}
|
||||
// ========== MODEL MESSAGES ==========
|
||||
|
||||
/**
|
||||
* @generated from protobuf enum api.TimeToLive
|
||||
* @generated from protobuf enum api.TinyURLKind
|
||||
*/
|
||||
export enum TimeToLive {
|
||||
export enum TinyURLKind {
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_UNKNOWN = 0;
|
||||
* @generated from protobuf enum value: TINYURL_KIND_UNKNOWN = 0;
|
||||
*/
|
||||
TIME_TO_LIVE_UNKNOWN = 0,
|
||||
TINYURL_KIND_UNKNOWN = 0,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_1DAY = 1;
|
||||
* @generated from protobuf enum value: TINYURL_KIND_FILE = 1;
|
||||
*/
|
||||
TIME_TO_LIVE_1DAY = 1,
|
||||
TINYURL_KIND_FILE = 1,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_2DAYS = 2;
|
||||
* @generated from protobuf enum value: TINYURL_KIND_URL = 2;
|
||||
*/
|
||||
TIME_TO_LIVE_2DAYS = 2,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_4DAYS = 3;
|
||||
*/
|
||||
TIME_TO_LIVE_4DAYS = 3,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_1WEEK = 4;
|
||||
*/
|
||||
TIME_TO_LIVE_1WEEK = 4,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_2WEEKS = 5;
|
||||
*/
|
||||
TIME_TO_LIVE_2WEEKS = 5,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_1MONTH = 6;
|
||||
*/
|
||||
TIME_TO_LIVE_1MONTH = 6,
|
||||
/**
|
||||
* @generated from protobuf enum value: TIME_TO_LIVE_INFINITE = 7;
|
||||
*/
|
||||
TIME_TO_LIVE_INFINITE = 7
|
||||
TINYURL_KIND_URL = 2
|
||||
}
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class FileMetadata$Type extends MessageType<FileMetadata> {
|
||||
@@ -448,16 +444,70 @@ class FileMetadata$Type extends MessageType<FileMetadata> {
|
||||
*/
|
||||
export const FileMetadata = new FileMetadata$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class TinyURLData$Type extends MessageType<TinyURLData> {
|
||||
constructor() {
|
||||
super("api.TinyURLData", [
|
||||
{ no: 1, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "File", kind: "message", localName: "File", jsonName: "File", T: () => FileMetadata }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<TinyURLData>): TinyURLData {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.LongURL = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<TinyURLData>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TinyURLData): TinyURLData {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string LongURL */ 1:
|
||||
message.LongURL = reader.string();
|
||||
break;
|
||||
case /* api.FileMetadata File */ 2:
|
||||
message.File = FileMetadata.internalBinaryRead(reader, reader.uint32(), options, message.File);
|
||||
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: TinyURLData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string LongURL = 1; */
|
||||
if (message.LongURL !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.LongURL);
|
||||
/* api.FileMetadata File = 2; */
|
||||
if (message.File)
|
||||
FileMetadata.internalBinaryWrite(message.File, writer.tag(2, 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.TinyURLData
|
||||
*/
|
||||
export const TinyURLData = new TinyURLData$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class TinyURL$Type extends MessageType<TinyURL> {
|
||||
constructor() {
|
||||
super("api.TinyURL", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", oneof: "Type", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 3, name: "File", kind: "message", localName: "File", jsonName: "File", oneof: "Type", T: () => FileMetadata },
|
||||
{ no: 4, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "Kind", kind: "enum", localName: "Kind", jsonName: "Kind", T: () => ["api.TinyURLKind", TinyURLKind], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 3, name: "Data", kind: "message", localName: "Data", jsonName: "Data", T: () => TinyURLData, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 4, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Shortened URL used to retrieve the original data (URL or file)." } } },
|
||||
{ no: 5, name: "ResourceType", kind: "enum", localName: "ResourceType", jsonName: "ResourceType", T: () => ["api.ResourceType", ResourceType], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 6, name: "ResourceRefID", kind: "scalar", localName: "ResourceRefID", jsonName: "ResourceRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 7, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 7, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
|
||||
{ no: 8, name: "CreatedAt", kind: "scalar", localName: "CreatedAt", jsonName: "CreatedAt", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { dateIso8601: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in <a href='https://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format" } } },
|
||||
{ no: 9, name: "IsPublic", kind: "scalar", localName: "IsPublic", jsonName: "IsPublic", T: 8 /*ScalarType.BOOL*/ },
|
||||
{ no: 10, name: "IsOnce", kind: "scalar", localName: "IsOnce", jsonName: "IsOnce", T: 8 /*ScalarType.BOOL*/ }
|
||||
@@ -466,11 +516,11 @@ class TinyURL$Type extends MessageType<TinyURL> {
|
||||
create(value?: PartialMessage<TinyURL>): TinyURL {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.ID = "";
|
||||
message.Type = { oneofKind: undefined };
|
||||
message.Kind = 0;
|
||||
message.URL = "";
|
||||
message.ResourceType = 0;
|
||||
message.ResourceRefID = "";
|
||||
message.TimeToLive = 0;
|
||||
message.TimeToLive = 0n;
|
||||
message.CreatedAt = "";
|
||||
message.IsPublic = false;
|
||||
message.IsOnce = false;
|
||||
@@ -486,17 +536,11 @@ class TinyURL$Type extends MessageType<TinyURL> {
|
||||
case /* string ID */ 1:
|
||||
message.ID = reader.string();
|
||||
break;
|
||||
case /* string LongURL */ 2:
|
||||
message.Type = {
|
||||
oneofKind: "LongURL",
|
||||
LongURL: reader.string()
|
||||
};
|
||||
case /* api.TinyURLKind Kind */ 2:
|
||||
message.Kind = reader.int32();
|
||||
break;
|
||||
case /* api.FileMetadata File */ 3:
|
||||
message.Type = {
|
||||
oneofKind: "File",
|
||||
File: FileMetadata.internalBinaryRead(reader, reader.uint32(), options, (message.Type as any).File)
|
||||
};
|
||||
case /* api.TinyURLData Data */ 3:
|
||||
message.Data = TinyURLData.internalBinaryRead(reader, reader.uint32(), options, message.Data);
|
||||
break;
|
||||
case /* string URL */ 4:
|
||||
message.URL = reader.string();
|
||||
@@ -507,8 +551,8 @@ class TinyURL$Type extends MessageType<TinyURL> {
|
||||
case /* string ResourceRefID */ 6:
|
||||
message.ResourceRefID = reader.string();
|
||||
break;
|
||||
case /* api.TimeToLive TimeToLive */ 7:
|
||||
message.TimeToLive = reader.int32();
|
||||
case /* int64 TimeToLive */ 7:
|
||||
message.TimeToLive = reader.int64().toBigInt();
|
||||
break;
|
||||
case /* string CreatedAt */ 8:
|
||||
message.CreatedAt = reader.string();
|
||||
@@ -534,12 +578,12 @@ class TinyURL$Type extends MessageType<TinyURL> {
|
||||
/* string ID = 1; */
|
||||
if (message.ID !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
||||
/* string LongURL = 2; */
|
||||
if (message.Type.oneofKind === "LongURL")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.Type.LongURL);
|
||||
/* api.FileMetadata File = 3; */
|
||||
if (message.Type.oneofKind === "File")
|
||||
FileMetadata.internalBinaryWrite(message.Type.File, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
||||
/* api.TinyURLKind Kind = 2; */
|
||||
if (message.Kind !== 0)
|
||||
writer.tag(2, WireType.Varint).int32(message.Kind);
|
||||
/* api.TinyURLData Data = 3; */
|
||||
if (message.Data)
|
||||
TinyURLData.internalBinaryWrite(message.Data, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
||||
/* string URL = 4; */
|
||||
if (message.URL !== "")
|
||||
writer.tag(4, WireType.LengthDelimited).string(message.URL);
|
||||
@@ -549,9 +593,9 @@ class TinyURL$Type extends MessageType<TinyURL> {
|
||||
/* string ResourceRefID = 6; */
|
||||
if (message.ResourceRefID !== "")
|
||||
writer.tag(6, WireType.LengthDelimited).string(message.ResourceRefID);
|
||||
/* api.TimeToLive TimeToLive = 7; */
|
||||
if (message.TimeToLive !== 0)
|
||||
writer.tag(7, WireType.Varint).int32(message.TimeToLive);
|
||||
/* int64 TimeToLive = 7; */
|
||||
if (message.TimeToLive !== 0n)
|
||||
writer.tag(7, WireType.Varint).int64(message.TimeToLive);
|
||||
/* string CreatedAt = 8; */
|
||||
if (message.CreatedAt !== "")
|
||||
writer.tag(8, WireType.LengthDelimited).string(message.CreatedAt);
|
||||
@@ -572,67 +616,12 @@ class TinyURL$Type extends MessageType<TinyURL> {
|
||||
*/
|
||||
export const TinyURL = new TinyURL$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class FileRequest$Type extends MessageType<FileRequest> {
|
||||
constructor() {
|
||||
super("api.FileRequest", [
|
||||
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 3, name: "Content", kind: "scalar", localName: "Content", jsonName: "Content", T: 12 /*ScalarType.BYTES*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Content"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<FileRequest>): FileRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Name = "";
|
||||
message.Content = new Uint8Array(0);
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<FileRequest>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileRequest): FileRequest {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string Name */ 1:
|
||||
message.Name = reader.string();
|
||||
break;
|
||||
case /* bytes Content */ 3:
|
||||
message.Content = 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: FileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string Name = 1; */
|
||||
if (message.Name !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
||||
/* bytes Content = 3; */
|
||||
if (message.Content.length)
|
||||
writer.tag(3, WireType.LengthDelimited).bytes(message.Content);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.FileRequest
|
||||
*/
|
||||
export const FileRequest = new FileRequest$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class ShortenSiteURLRequest$Type extends MessageType<ShortenSiteURLRequest> {
|
||||
constructor() {
|
||||
super("api.ShortenSiteURLRequest", [
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
|
||||
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "URL", "TimeToLive"] } } });
|
||||
@@ -640,7 +629,7 @@ class ShortenSiteURLRequest$Type extends MessageType<ShortenSiteURLRequest> {
|
||||
create(value?: PartialMessage<ShortenSiteURLRequest>): ShortenSiteURLRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.URL = "";
|
||||
message.TimeToLive = 0;
|
||||
message.TimeToLive = 0n;
|
||||
message.isPublic = false;
|
||||
message.isOnce = false;
|
||||
if (value !== undefined)
|
||||
@@ -658,8 +647,8 @@ class ShortenSiteURLRequest$Type extends MessageType<ShortenSiteURLRequest> {
|
||||
case /* string URL */ 2:
|
||||
message.URL = reader.string();
|
||||
break;
|
||||
case /* api.TimeToLive TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int32();
|
||||
case /* int64 TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int64().toBigInt();
|
||||
break;
|
||||
case /* bool isPublic */ 4:
|
||||
message.isPublic = reader.bool();
|
||||
@@ -685,9 +674,9 @@ class ShortenSiteURLRequest$Type extends MessageType<ShortenSiteURLRequest> {
|
||||
/* string URL = 2; */
|
||||
if (message.URL !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.URL);
|
||||
/* api.TimeToLive TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0)
|
||||
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
||||
/* int64 TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0n)
|
||||
writer.tag(3, WireType.Varint).int64(message.TimeToLive);
|
||||
/* bool isPublic = 4; */
|
||||
if (message.isPublic !== false)
|
||||
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
||||
@@ -756,7 +745,7 @@ class ShortenPartnerAppURLRequest$Type extends MessageType<ShortenPartnerAppURLR
|
||||
super("api.ShortenPartnerAppURLRequest", [
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
|
||||
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "URL", "TimeToLive"] } } });
|
||||
@@ -764,7 +753,7 @@ class ShortenPartnerAppURLRequest$Type extends MessageType<ShortenPartnerAppURLR
|
||||
create(value?: PartialMessage<ShortenPartnerAppURLRequest>): ShortenPartnerAppURLRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.URL = "";
|
||||
message.TimeToLive = 0;
|
||||
message.TimeToLive = 0n;
|
||||
message.isPublic = false;
|
||||
message.isOnce = false;
|
||||
if (value !== undefined)
|
||||
@@ -782,8 +771,8 @@ class ShortenPartnerAppURLRequest$Type extends MessageType<ShortenPartnerAppURLR
|
||||
case /* string URL */ 2:
|
||||
message.URL = reader.string();
|
||||
break;
|
||||
case /* api.TimeToLive TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int32();
|
||||
case /* int64 TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int64().toBigInt();
|
||||
break;
|
||||
case /* bool isPublic */ 4:
|
||||
message.isPublic = reader.bool();
|
||||
@@ -809,9 +798,9 @@ class ShortenPartnerAppURLRequest$Type extends MessageType<ShortenPartnerAppURLR
|
||||
/* string URL = 2; */
|
||||
if (message.URL !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.URL);
|
||||
/* api.TimeToLive TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0)
|
||||
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
||||
/* int64 TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0n)
|
||||
writer.tag(3, WireType.Varint).int64(message.TimeToLive);
|
||||
/* bool isPublic = 4; */
|
||||
if (message.isPublic !== false)
|
||||
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
||||
@@ -879,15 +868,15 @@ class UploadSiteFileRequest$Type extends MessageType<UploadSiteFileRequest> {
|
||||
constructor() {
|
||||
super("api.UploadSiteFileRequest", [
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "FileData", kind: "message", localName: "FileData", jsonName: "FileData", T: () => FileRequest, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 2, name: "FileData", kind: "message", localName: "FileData", jsonName: "FileData", T: () => FileDataRequest, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
|
||||
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "FileData", "TimeToLive"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<UploadSiteFileRequest>): UploadSiteFileRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.TimeToLive = 0;
|
||||
message.TimeToLive = 0n;
|
||||
message.isPublic = false;
|
||||
message.isOnce = false;
|
||||
if (value !== undefined)
|
||||
@@ -902,11 +891,11 @@ class UploadSiteFileRequest$Type extends MessageType<UploadSiteFileRequest> {
|
||||
case /* api.RequestSiteHeader Header */ 1:
|
||||
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
||||
break;
|
||||
case /* api.FileRequest FileData */ 2:
|
||||
message.FileData = FileRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
|
||||
case /* api.FileDataRequest FileData */ 2:
|
||||
message.FileData = FileDataRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
|
||||
break;
|
||||
case /* api.TimeToLive TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int32();
|
||||
case /* int64 TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int64().toBigInt();
|
||||
break;
|
||||
case /* bool isPublic */ 4:
|
||||
message.isPublic = reader.bool();
|
||||
@@ -929,12 +918,12 @@ class UploadSiteFileRequest$Type extends MessageType<UploadSiteFileRequest> {
|
||||
/* api.RequestSiteHeader Header = 1; */
|
||||
if (message.Header)
|
||||
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||
/* api.FileRequest FileData = 2; */
|
||||
/* api.FileDataRequest FileData = 2; */
|
||||
if (message.FileData)
|
||||
FileRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
/* api.TimeToLive TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0)
|
||||
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
||||
FileDataRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
/* int64 TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0n)
|
||||
writer.tag(3, WireType.Varint).int64(message.TimeToLive);
|
||||
/* bool isPublic = 4; */
|
||||
if (message.isPublic !== false)
|
||||
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
||||
@@ -1002,15 +991,15 @@ class UploadPartnerAppFileRequest$Type extends MessageType<UploadPartnerAppFileR
|
||||
constructor() {
|
||||
super("api.UploadPartnerAppFileRequest", [
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "FileData", kind: "message", localName: "FileData", jsonName: "FileData", T: () => FileRequest, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 2, name: "FileData", kind: "message", localName: "FileData", jsonName: "FileData", T: () => FileDataRequest, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 3, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
|
||||
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "FileData", "TimeToLive"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<UploadPartnerAppFileRequest>): UploadPartnerAppFileRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.TimeToLive = 0;
|
||||
message.TimeToLive = 0n;
|
||||
message.isPublic = false;
|
||||
message.isOnce = false;
|
||||
if (value !== undefined)
|
||||
@@ -1025,11 +1014,11 @@ class UploadPartnerAppFileRequest$Type extends MessageType<UploadPartnerAppFileR
|
||||
case /* api.RequestPartnerAppHeader Header */ 1:
|
||||
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
||||
break;
|
||||
case /* api.FileRequest FileData */ 2:
|
||||
message.FileData = FileRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
|
||||
case /* api.FileDataRequest FileData */ 2:
|
||||
message.FileData = FileDataRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
|
||||
break;
|
||||
case /* api.TimeToLive TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int32();
|
||||
case /* int64 TimeToLive */ 3:
|
||||
message.TimeToLive = reader.int64().toBigInt();
|
||||
break;
|
||||
case /* bool isPublic */ 4:
|
||||
message.isPublic = reader.bool();
|
||||
@@ -1052,12 +1041,12 @@ class UploadPartnerAppFileRequest$Type extends MessageType<UploadPartnerAppFileR
|
||||
/* api.RequestPartnerAppHeader Header = 1; */
|
||||
if (message.Header)
|
||||
RequestPartnerAppHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||
/* api.FileRequest FileData = 2; */
|
||||
/* api.FileDataRequest FileData = 2; */
|
||||
if (message.FileData)
|
||||
FileRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
/* api.TimeToLive TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0)
|
||||
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
||||
FileDataRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
/* int64 TimeToLive = 3; */
|
||||
if (message.TimeToLive !== 0n)
|
||||
writer.tag(3, WireType.Varint).int64(message.TimeToLive);
|
||||
/* bool isPublic = 4; */
|
||||
if (message.isPublic !== false)
|
||||
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
||||
@@ -1491,32 +1480,31 @@ class DeletePartnerAppTinyURLResponse$Type extends MessageType<DeletePartnerAppT
|
||||
*/
|
||||
export const DeletePartnerAppTinyURLResponse = new DeletePartnerAppTinyURLResponse$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class GetLongURLRequest$Type extends MessageType<GetLongURLRequest> {
|
||||
class GetSiteTinyURLRequest$Type extends MessageType<GetSiteTinyURLRequest> {
|
||||
constructor() {
|
||||
super("api.GetLongURLRequest", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 2, name: "Token", kind: "scalar", localName: "Token", jsonName: "Token", T: 9 /*ScalarType.STRING*/ }
|
||||
]);
|
||||
super("api.GetSiteTinyURLRequest", [
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<GetLongURLRequest>): GetLongURLRequest {
|
||||
create(value?: PartialMessage<GetSiteTinyURLRequest>): GetSiteTinyURLRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.ID = "";
|
||||
message.Token = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<GetLongURLRequest>(this, message, value);
|
||||
reflectionMergePartial<GetSiteTinyURLRequest>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLongURLRequest): GetLongURLRequest {
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetSiteTinyURLRequest): GetSiteTinyURLRequest {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string ID */ 1:
|
||||
case /* api.RequestSiteHeader Header */ 1:
|
||||
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
||||
break;
|
||||
case /* string ID */ 2:
|
||||
message.ID = reader.string();
|
||||
break;
|
||||
case /* string Token */ 2:
|
||||
message.Token = reader.string();
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
@@ -1528,13 +1516,13 @@ class GetLongURLRequest$Type extends MessageType<GetLongURLRequest> {
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: GetLongURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string ID = 1; */
|
||||
internalBinaryWrite(message: GetSiteTinyURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* api.RequestSiteHeader Header = 1; */
|
||||
if (message.Header)
|
||||
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||
/* string ID = 2; */
|
||||
if (message.ID !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
||||
/* string Token = 2; */
|
||||
if (message.Token !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.Token);
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.ID);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
@@ -1542,29 +1530,39 @@ class GetLongURLRequest$Type extends MessageType<GetLongURLRequest> {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.GetLongURLRequest
|
||||
* @generated MessageType for protobuf message api.GetSiteTinyURLRequest
|
||||
*/
|
||||
export const GetLongURLRequest = new GetLongURLRequest$Type();
|
||||
export const GetSiteTinyURLRequest = new GetSiteTinyURLRequest$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class GetLongURLResult$Type extends MessageType<GetLongURLResult> {
|
||||
class GetSiteTinyURLResult$Type extends MessageType<GetSiteTinyURLResult> {
|
||||
constructor() {
|
||||
super("api.GetLongURLResult", [
|
||||
{ no: 1, name: "TinyURL", kind: "message", localName: "TinyURL", jsonName: "TinyURL", T: () => TinyURL }
|
||||
super("api.GetSiteTinyURLResult", [
|
||||
{ no: 1, name: "Kind", kind: "enum", localName: "Kind", jsonName: "Kind", T: () => ["api.TinyURLKind", TinyURLKind] },
|
||||
{ no: 2, name: "File", kind: "message", localName: "File", jsonName: "File", T: () => FileDataResponse },
|
||||
{ no: 3, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", T: 9 /*ScalarType.STRING*/ }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<GetLongURLResult>): GetLongURLResult {
|
||||
create(value?: PartialMessage<GetSiteTinyURLResult>): GetSiteTinyURLResult {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Kind = 0;
|
||||
message.LongURL = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<GetLongURLResult>(this, message, value);
|
||||
reflectionMergePartial<GetSiteTinyURLResult>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLongURLResult): GetLongURLResult {
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetSiteTinyURLResult): GetSiteTinyURLResult {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* api.TinyURL TinyURL */ 1:
|
||||
message.TinyURL = TinyURL.internalBinaryRead(reader, reader.uint32(), options, message.TinyURL);
|
||||
case /* api.TinyURLKind Kind */ 1:
|
||||
message.Kind = reader.int32();
|
||||
break;
|
||||
case /* api.FileDataResponse File */ 2:
|
||||
message.File = FileDataResponse.internalBinaryRead(reader, reader.uint32(), options, message.File);
|
||||
break;
|
||||
case /* string LongURL */ 3:
|
||||
message.LongURL = reader.string();
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
@@ -1577,10 +1575,16 @@ class GetLongURLResult$Type extends MessageType<GetLongURLResult> {
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: GetLongURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* api.TinyURL TinyURL = 1; */
|
||||
if (message.TinyURL)
|
||||
TinyURL.internalBinaryWrite(message.TinyURL, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
||||
internalBinaryWrite(message: GetSiteTinyURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* api.TinyURLKind Kind = 1; */
|
||||
if (message.Kind !== 0)
|
||||
writer.tag(1, WireType.Varint).int32(message.Kind);
|
||||
/* api.FileDataResponse File = 2; */
|
||||
if (message.File)
|
||||
FileDataResponse.internalBinaryWrite(message.File, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
/* string LongURL = 3; */
|
||||
if (message.LongURL !== "")
|
||||
writer.tag(3, WireType.LengthDelimited).string(message.LongURL);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
@@ -1588,35 +1592,34 @@ class GetLongURLResult$Type extends MessageType<GetLongURLResult> {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.GetLongURLResult
|
||||
* @generated MessageType for protobuf message api.GetSiteTinyURLResult
|
||||
*/
|
||||
export const GetLongURLResult = new GetLongURLResult$Type();
|
||||
export const GetSiteTinyURLResult = new GetSiteTinyURLResult$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class DownloadFileRequest$Type extends MessageType<DownloadFileRequest> {
|
||||
class GetPartnerAppTinyURLRequest$Type extends MessageType<GetPartnerAppTinyURLRequest> {
|
||||
constructor() {
|
||||
super("api.DownloadFileRequest", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 2, name: "Token", kind: "scalar", localName: "Token", jsonName: "Token", T: 9 /*ScalarType.STRING*/ }
|
||||
]);
|
||||
super("api.GetPartnerAppTinyURLRequest", [
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<DownloadFileRequest>): DownloadFileRequest {
|
||||
create(value?: PartialMessage<GetPartnerAppTinyURLRequest>): GetPartnerAppTinyURLRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.ID = "";
|
||||
message.Token = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<DownloadFileRequest>(this, message, value);
|
||||
reflectionMergePartial<GetPartnerAppTinyURLRequest>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadFileRequest): DownloadFileRequest {
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetPartnerAppTinyURLRequest): GetPartnerAppTinyURLRequest {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string ID */ 1:
|
||||
message.ID = reader.string();
|
||||
case /* api.RequestPartnerAppHeader Header */ 1:
|
||||
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
||||
break;
|
||||
case /* string Token */ 2:
|
||||
message.Token = reader.string();
|
||||
case /* string ID */ 2:
|
||||
message.ID = reader.string();
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
@@ -1629,13 +1632,13 @@ class DownloadFileRequest$Type extends MessageType<DownloadFileRequest> {
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: DownloadFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string ID = 1; */
|
||||
internalBinaryWrite(message: GetPartnerAppTinyURLRequest, 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 ID = 2; */
|
||||
if (message.ID !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
||||
/* string Token = 2; */
|
||||
if (message.Token !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.Token);
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.ID);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
@@ -1643,21 +1646,83 @@ class DownloadFileRequest$Type extends MessageType<DownloadFileRequest> {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.DownloadFileRequest
|
||||
* @generated MessageType for protobuf message api.GetPartnerAppTinyURLRequest
|
||||
*/
|
||||
export const DownloadFileRequest = new DownloadFileRequest$Type();
|
||||
export const GetPartnerAppTinyURLRequest = new GetPartnerAppTinyURLRequest$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class GetPartnerAppTinyURLResult$Type extends MessageType<GetPartnerAppTinyURLResult> {
|
||||
constructor() {
|
||||
super("api.GetPartnerAppTinyURLResult", [
|
||||
{ no: 1, name: "Kind", kind: "enum", localName: "Kind", jsonName: "Kind", T: () => ["api.TinyURLKind", TinyURLKind] },
|
||||
{ no: 2, name: "File", kind: "message", localName: "File", jsonName: "File", T: () => FileDataResponse },
|
||||
{ no: 3, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", T: 9 /*ScalarType.STRING*/ }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<GetPartnerAppTinyURLResult>): GetPartnerAppTinyURLResult {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.Kind = 0;
|
||||
message.LongURL = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<GetPartnerAppTinyURLResult>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetPartnerAppTinyURLResult): GetPartnerAppTinyURLResult {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* api.TinyURLKind Kind */ 1:
|
||||
message.Kind = reader.int32();
|
||||
break;
|
||||
case /* api.FileDataResponse File */ 2:
|
||||
message.File = FileDataResponse.internalBinaryRead(reader, reader.uint32(), options, message.File);
|
||||
break;
|
||||
case /* string LongURL */ 3:
|
||||
message.LongURL = 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: GetPartnerAppTinyURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* api.TinyURLKind Kind = 1; */
|
||||
if (message.Kind !== 0)
|
||||
writer.tag(1, WireType.Varint).int32(message.Kind);
|
||||
/* api.FileDataResponse File = 2; */
|
||||
if (message.File)
|
||||
FileDataResponse.internalBinaryWrite(message.File, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
||||
/* string LongURL = 3; */
|
||||
if (message.LongURL !== "")
|
||||
writer.tag(3, WireType.LengthDelimited).string(message.LongURL);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.GetPartnerAppTinyURLResult
|
||||
*/
|
||||
export const GetPartnerAppTinyURLResult = new GetPartnerAppTinyURLResult$Type();
|
||||
/**
|
||||
* @generated ServiceType for protobuf service api.TinyURLService
|
||||
*/
|
||||
export const TinyURLService = new ServiceType("api.TinyURLService", [
|
||||
{ name: "ShortenSiteURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Generates a short alias for a given URL linked to a site." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ShortenSiteURL", body: "*" } }, I: ShortenSiteURLRequest, O: ShortenSiteURLResult },
|
||||
{ name: "ShortenPartnerAppURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Generates a short alias for a given URL linked to a partnerApp." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ShortenPartnerAppURL", body: "*" } }, I: ShortenPartnerAppURLRequest, O: ShortenPartnerAppURLResult },
|
||||
{ name: "UploadSiteFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Uploads a file linked to a specific site resource. Generates a short URL to download the file" }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UploadSiteFileRequest, O: UploadSiteFileResponse },
|
||||
{ name: "UploadPartnerAppFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Uploads a file linked to a specific partnerApp resource. Generates a short URL to download the file" }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UploadPartnerAppFileRequest, O: UploadPartnerAppFileResponse },
|
||||
{ name: "ListSiteTinyURLs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "List all the tiny URLs linked to a specific site resource." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ListSiteTinyURLs", body: "*" } }, I: ListSiteTinyURLsRequest, O: ListSiteTinyURLsResponse },
|
||||
{ name: "ListPartnerAppTinyURLs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "List all the tiny URLs linked to a specific partnerApp resource." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ListPartnerAppTinyURLs", body: "*" } }, I: ListPartnerAppTinyURLsRequest, O: ListPartnerAppTinyURLsResponse },
|
||||
{ name: "DeleteSiteTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete a tiny URL linked to a specific site resource." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/DeleteSiteTinyURL", body: "*" } }, I: DeleteSiteTinyURLRequest, O: DeleteSiteTinyURLResponse },
|
||||
{ name: "DeletePartnerAppTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete a tiny URL linked to a specific partnerApp resource." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/DeletePartnerAppTinyURL", body: "*" } }, I: DeletePartnerAppTinyURLRequest, O: DeletePartnerAppTinyURLResponse },
|
||||
{ name: "GetLongURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Redirect to the original long URL." }, "api.rscType": "", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { get: "/t/{ID}" } }, I: GetLongURLRequest, O: GetLongURLResult },
|
||||
{ name: "DownloadFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Downloads a previously uploaded file using its unique URL. Can be embedded in HTML, for example: <img src=\"https://t.reflex-platform.com/p/UUID?token=...\">" }, "api.rscType": "", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { get: "/p/{ID}" } }, I: DownloadFileRequest, O: HttpBody }
|
||||
]);
|
||||
{ name: "ShortenSiteURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Generates a short alias for a given URL linked to a site." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: ShortenSiteURLRequest, O: ShortenSiteURLResult },
|
||||
{ name: "ShortenPartnerAppURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Generates a short alias for a given URL linked to a partnerApp." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: ShortenPartnerAppURLRequest, O: ShortenPartnerAppURLResult },
|
||||
{ name: "UploadSiteFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Uploads a file linked to a specific site resource. Generates a short URL to download the file. <br>Must be called using a multipart form-data content type request. <br> Example of curl request : curl -X POST https://$REFLEXPLATFORM_REST_URL/api.TinyURLService/UploadSiteFile -H Authorization: $TOKEN -F File=\"@path/to/my/file/to/upload\" -F SiteID=mySiteID -F TimeToLive=-1 -F IsPublic=false -F IsOnce=false" }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UploadSiteFileRequest, O: UploadSiteFileResponse },
|
||||
{ name: "UploadPartnerAppFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Uploads a file linked to a specific partnerApp resource. Generates a short URL to download the file. <br>Must be called using a multipart form-data content type request. <br> Example of curl request : curl -X POST https://$REFLEXPLATFORM_REST_URL/api.TinyURLService/UploadPartnerAppFile -H Authorization: $TOKEN -F File=\"@path/to/my/file/to/upload\" -F PartnerAppID=myPartnerAppID -F TimeToLive=-1 -F IsPublic=false -F IsOnce=false" }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UploadPartnerAppFileRequest, O: UploadPartnerAppFileResponse },
|
||||
{ name: "ListSiteTinyURLs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "List all the tiny URLs linked to a specific site resource." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: ListSiteTinyURLsRequest, O: ListSiteTinyURLsResponse },
|
||||
{ name: "ListPartnerAppTinyURLs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "List all the tiny URLs linked to a specific partnerApp resource." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: ListPartnerAppTinyURLsRequest, O: ListPartnerAppTinyURLsResponse },
|
||||
{ name: "DeleteSiteTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete a tiny URL linked to a specific site resource." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteSiteTinyURLRequest, O: DeleteSiteTinyURLResponse },
|
||||
{ name: "DeletePartnerAppTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete a tiny URL linked to a specific partnerApp resource." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: DeletePartnerAppTinyURLRequest, O: DeletePartnerAppTinyURLResponse },
|
||||
{ name: "GetSiteTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Get a tiny URL linked to a specific site resource. Can be a link or a file." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetSiteTinyURLRequest, O: GetSiteTinyURLResult },
|
||||
{ name: "GetPartnerAppTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Get a tiny URL linked to a specific partner app resource. Can be a link or a file." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetPartnerAppTinyURLRequest, O: GetPartnerAppTinyURLResult }
|
||||
], { "api.k8sService": "tiny-url-server" });
|
||||
|
||||
Reference in New Issue
Block a user