geniebox-shared-lib 2.5.11 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-provider.dto.d.ts +29 -0
- package/dist/ai-provider.dto.js +18 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +19 -8
- package/dist/storage.interface.d.ts +90 -0
- package/dist/storage.interface.js +489 -9
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type AIMessageRole = "system" | "user" | "assistant";
|
|
2
|
+
export interface AIMessage {
|
|
3
|
+
role: AIMessageRole;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
export type AIProviderRequestVariant = {
|
|
7
|
+
type: "messages";
|
|
8
|
+
provider: string;
|
|
9
|
+
model: string;
|
|
10
|
+
stream?: boolean;
|
|
11
|
+
systemPrompt?: string;
|
|
12
|
+
messages: AIMessage[];
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
} | {
|
|
15
|
+
type: "input";
|
|
16
|
+
provider: string;
|
|
17
|
+
model: string;
|
|
18
|
+
stream?: boolean;
|
|
19
|
+
systemPrompt?: string;
|
|
20
|
+
input: string;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
export interface AIProviderRequestEnvelope {
|
|
24
|
+
schema: "ai.provider.request@v1";
|
|
25
|
+
request: AIProviderRequestVariant;
|
|
26
|
+
}
|
|
27
|
+
export declare const PROVIDER_REQUEST_SCHEMA = "ai.provider.request@v1";
|
|
28
|
+
export declare function buildProviderRequestEnvelope(request: AIProviderRequestVariant): AIProviderRequestEnvelope;
|
|
29
|
+
export declare function isProviderRequestEnvelope(payload: unknown): payload is AIProviderRequestEnvelope;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROVIDER_REQUEST_SCHEMA = void 0;
|
|
4
|
+
exports.buildProviderRequestEnvelope = buildProviderRequestEnvelope;
|
|
5
|
+
exports.isProviderRequestEnvelope = isProviderRequestEnvelope;
|
|
6
|
+
exports.PROVIDER_REQUEST_SCHEMA = "ai.provider.request@v1";
|
|
7
|
+
function buildProviderRequestEnvelope(request) {
|
|
8
|
+
return {
|
|
9
|
+
schema: exports.PROVIDER_REQUEST_SCHEMA,
|
|
10
|
+
request,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function isProviderRequestEnvelope(payload) {
|
|
14
|
+
return (typeof payload === "object" &&
|
|
15
|
+
payload !== null &&
|
|
16
|
+
payload.schema === exports.PROVIDER_REQUEST_SCHEMA &&
|
|
17
|
+
typeof payload.request?.provider === "string");
|
|
18
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,11 +15,12 @@ export { WorkflowClient } from "./workflow.client";
|
|
|
15
15
|
export { LibraryClient } from "./library.client";
|
|
16
16
|
export { ChatClient } from "./chat.client";
|
|
17
17
|
export { GenerationClient } from "./generation.client";
|
|
18
|
+
export { AIMessageRole, AIMessage, AIProviderRequestVariant, AIProviderRequestEnvelope, PROVIDER_REQUEST_SCHEMA, buildProviderRequestEnvelope, isProviderRequestEnvelope, } from "./ai-provider.dto";
|
|
18
19
|
export { MessageFns as UserMessageFns, protobufPackage as UserProtobufPackage, User, UserPersonal, UserSettings, UserNotificationSettings, UserEmailNotifications, UserPushNotifications, UserInAppNotifications, UserAuthentication, CreateUserRequest, CreateUserPersonal, CreateUserAuthentication, UpdateUserRequest, FindOneRequest, UserResponse, UsersResponse, FindByEmailRequest, FindByPhoneRequest, UpdateUserPersonal, UpdatePasswordRequest, UpdateEmailVerificationRequest, ResetPasswordData, GetEmailVerificationStatusRequest, EmailVerificationStatusResponse, GetUserSettingsRequest, UpdateUserSettingsRequest, CreateUserSettingsRequest, UserSettingsResponse, UserOAuthIdentity, FindOAuthIdentityRequest, CreateOAuthIdentityRequest, UserServiceService as UserService, } from "./user.interface";
|
|
19
20
|
export { MessageFns as AuthMessageFns, protobufPackage as AuthProtobufPackage, LoginCredentials, RegisterCredentials, LogoutRequest, RefreshRequest, AuthResponse, RefreshTokenResponse, RecoverRequest, ResetPasswordRequest, ConfirmEmailRequest, ConfirmEmailByCodeRequest, ConfirmEmailResponse, CheckEmailVerifiedRequest, CheckEmailVerifiedResponse, ResendConfirmationCodeRequest, VerifyResetCodeRequest, LoginWithOAuthRequest, } from "./auth.interface";
|
|
20
21
|
export { MessageFns as EndpointMessageFns, protobufPackage as EndpointProtobufPackage, ENDPOINT_PACKAGE_NAME, ENDPOINT_SERVICE_NAME, Provider as EndpointProvider, Model as EndpointModel, Pricing as EndpointPricing, EndpointConfig, EndpointRequest, ProvidersRequest, ProvidersResponse, ModelsRequest, ModelsResponse, PricingRequest, PricingResponse, ValidateEndpointRequest, ValidateEndpointResponse, CreateEndpointRequest, UpdateEndpointRequest, GetEndpointByIdRequest, ListEndpointsRequest, DeleteEndpointRequest, CreateEndpointResponse, UpdateEndpointResponse, GetEndpointByIdResponse, ListEndpointsResponse, DeleteEndpointResponse, EndpointServiceClient, EndpointServiceController, EndpointServiceService as EndpointService, } from "./endpoint.interface";
|
|
21
22
|
export { MessageFns as OpenAIMessageFns, protobufPackage as OpenAIProtobufPackage, CreateRequest as OpenAICreateRequest, CreateResponse as OpenAICreateResponse, OpenAIServiceService as OpenAIService, } from "./openai.interface";
|
|
22
|
-
export { UploadRequest, UploadResponse, DownloadRequest, DownloadResponse, DeleteRequest, DeleteResponse, StorageServiceService as StorageService, protobufPackage as
|
|
23
|
+
export { FileMetadata, UploadRequest, UploadResponse, DownloadRequest, DownloadResponse, DeleteRequest, DeleteResponse, GetMetadataRequest, GetMetadataResponse, ExistsRequest, ExistsResponse, ListFilesRequest, ListFilesResponse, StorageServiceClient, StorageServiceController, StorageServiceService as StorageService, protobufPackage as StorageProtobufPackage, } from "./storage.interface";
|
|
23
24
|
export { MessageFns as EventMessageFns, protobufPackage as EventProtobufPackage, SubscribeRequest, EventMessage, EmitToUserRequest, BroadcastRequest, EmitResponse, EventServiceService as EventService, } from "./event.interface";
|
|
24
25
|
export { MessageFns as KeysMessageFns, protobufPackage as KeysProtobufPackage, Key, CreateKeyRequest, UpdateKeyRequest, RemoveKeyRequest, GetKeyByIdRequest, KeyResponse, KeysResponse, GetKeysByUserRequest, ValidateKeyRequest, ValidateKeyResponse, GetSystemKeyRequest, KeyServiceService as KeyService, } from "./key.interface";
|
|
25
26
|
export { MessageFns as RequestMessageFns, protobufPackage as RequestProtobufPackage, CreateRequestRequest, CreateRequestResponse, GetRequestStatusRequest, RequestStatusResponse, GetRequestResultRequest, RequestResultResponse, CancelRequestRequest, CancelRequestResponse, StreamRequestRequest, RequestLog, StreamChunk, RequestServiceService as RequestService, } from "./request.interface";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.GenerationService = exports.GenerateImageResponse = exports.GeneratedImage = exports.GenerateImageRequest = exports.MCPToolSchemaResponse = exports.MCPToolSchemaRequest = exports.AgentGenerateResponse = exports.AgentGenerateRequest = exports.WorkflowLLMNodeResponse = exports.WorkflowLLMNodeRequest = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GenerationProtobufPackage = exports.ChatService = exports.DeleteChatExportCommentRequest = exports.AddChatExportCommentRequest = exports.ChatExportCommentsResponse = exports.ChatExportsResponse = exports.ListChatExportsRequest = exports.DeleteChatExportRequest = exports.GetChatExportCommentsRequest = exports.GetChatExportRequest = exports.ExportChatResponse = exports.ExportChatRequest = exports.ChatExportComment = exports.ChatExportSummary = exports.ChatExport = exports.ChatExportMessage = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = void 0;
|
|
3
|
+
exports.FindOAuthIdentityRequest = exports.UserOAuthIdentity = exports.UserSettingsResponse = exports.CreateUserSettingsRequest = exports.UpdateUserSettingsRequest = exports.GetUserSettingsRequest = exports.EmailVerificationStatusResponse = exports.GetEmailVerificationStatusRequest = exports.ResetPasswordData = exports.UpdateEmailVerificationRequest = exports.UpdatePasswordRequest = exports.UpdateUserPersonal = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.UsersResponse = exports.UserResponse = exports.FindOneRequest = exports.UpdateUserRequest = exports.CreateUserAuthentication = exports.CreateUserPersonal = exports.CreateUserRequest = exports.UserAuthentication = exports.UserInAppNotifications = exports.UserPushNotifications = exports.UserEmailNotifications = exports.UserNotificationSettings = exports.UserSettings = exports.UserPersonal = exports.User = exports.UserProtobufPackage = exports.isProviderRequestEnvelope = exports.buildProviderRequestEnvelope = exports.PROVIDER_REQUEST_SCHEMA = exports.GenerationClient = exports.ChatClient = exports.LibraryClient = exports.WorkflowClient = exports.MCPClient = exports.AgentClient = exports.BillingClient = exports.ResponseClient = exports.RequestClient = exports.KeyClient = exports.EventClient = exports.StorageClient = exports.OpenAIClient = exports.EndpointClient = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
|
|
4
|
+
exports.OpenAIService = exports.OpenAICreateResponse = exports.OpenAICreateRequest = exports.OpenAIProtobufPackage = exports.EndpointService = exports.DeleteEndpointResponse = exports.ListEndpointsResponse = exports.GetEndpointByIdResponse = exports.UpdateEndpointResponse = exports.CreateEndpointResponse = exports.DeleteEndpointRequest = exports.ListEndpointsRequest = exports.GetEndpointByIdRequest = exports.UpdateEndpointRequest = exports.CreateEndpointRequest = exports.ValidateEndpointResponse = exports.ValidateEndpointRequest = exports.PricingResponse = exports.PricingRequest = exports.ModelsResponse = exports.ModelsRequest = exports.ProvidersResponse = exports.ProvidersRequest = exports.EndpointRequest = exports.EndpointConfig = exports.EndpointPricing = exports.EndpointModel = exports.EndpointProvider = exports.ENDPOINT_SERVICE_NAME = exports.ENDPOINT_PACKAGE_NAME = exports.EndpointProtobufPackage = exports.LoginWithOAuthRequest = exports.VerifyResetCodeRequest = exports.ResendConfirmationCodeRequest = exports.CheckEmailVerifiedResponse = exports.CheckEmailVerifiedRequest = exports.ConfirmEmailResponse = exports.ConfirmEmailByCodeRequest = exports.ConfirmEmailRequest = exports.ResetPasswordRequest = exports.RecoverRequest = exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.CreateOAuthIdentityRequest = void 0;
|
|
5
|
+
exports.ProcessResponseRequest = exports.ResponseProtobufPackage = exports.RequestService = exports.StreamChunk = exports.RequestLog = exports.StreamRequestRequest = exports.CancelRequestResponse = exports.CancelRequestRequest = exports.RequestResultResponse = exports.GetRequestResultRequest = exports.RequestStatusResponse = exports.GetRequestStatusRequest = exports.CreateRequestResponse = exports.CreateRequestRequest = exports.RequestProtobufPackage = exports.KeyService = exports.GetSystemKeyRequest = exports.ValidateKeyResponse = exports.ValidateKeyRequest = exports.GetKeysByUserRequest = exports.KeysResponse = exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EmitResponse = exports.BroadcastRequest = exports.EmitToUserRequest = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.StorageProtobufPackage = exports.StorageService = exports.ListFilesResponse = exports.ListFilesRequest = exports.ExistsResponse = exports.ExistsRequest = exports.GetMetadataResponse = exports.GetMetadataRequest = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = exports.DownloadRequest = exports.UploadResponse = exports.UploadRequest = exports.FileMetadata = void 0;
|
|
6
|
+
exports.DeleteAgentRequest = exports.ListAgentsRequest = exports.GetAgentRequest = exports.UpdateAgentRequest = exports.CreateAgentRequest = exports.Agent = exports.AgentProtobufPackage = exports.BillingService = exports.ProcessWebhookResponse = exports.ProcessWebhookRequest = exports.GetPaymentsByUserResponse = exports.GetPaymentsByUserRequest = exports.GetPaymentResponse = exports.GetPaymentRequest = exports.CreatePaymentResponse = exports.CreatePaymentRequest = exports.GetUsageByUserResponse = exports.GetUsageByUserRequest = exports.GetUsageByKeyResponse = exports.GetUsageByKeyRequest = exports.GetUsageStatsResponse = exports.GetUsageStatsRequest = exports.RecordUsageResponse = exports.RecordUsageRequest = exports.GetTransactionResponse = exports.GetTransactionRequest = exports.GetTransactionsResponse = exports.GetTransactionsRequest = exports.CreateTransactionResponse = exports.CreateTransactionRequest = exports.DepositResponse = exports.DepositRequest = exports.ChargeResponse = exports.ChargeRequest = exports.GetBalanceResponse = exports.GetBalanceRequest = exports.Payment = exports.UsageStats = exports.Usage = exports.Transaction = exports.Balance = exports.BillingProtobufPackage = exports.ResponseService = exports.ProviderResponse = exports.ProviderError = exports.ProviderChunk = exports.ProviderUsage = exports.StreamUpdate = exports.StreamUpdatesRequest = exports.ProcessResponseResponse = void 0;
|
|
7
|
+
exports.RemoveItemFromArchiveRequest = exports.AddItemToArchiveRequest = exports.ListArchivesRequest = exports.DeleteArchiveRequest = exports.UpdateArchiveRequest = exports.CreateArchiveRequest = exports.ListBookmarksRequest = exports.DeleteBookmarkRequest = exports.CreateBookmarkRequest = exports.ArchiveItem = exports.Archive = exports.Bookmark = exports.LibraryProtobufPackage = exports.McpService = exports.McpServersResponse = exports.McpToolCustomizationsResponse = exports.McpServerCustomizationsResponse = exports.ListToolCustomizationsRequest = exports.ListServerCustomizationsRequest = exports.SetToolCustomizationRequest = exports.SetServerCustomizationRequest = exports.DeleteMcpServerRequest = exports.ListMcpServersRequest = exports.GetMcpServerRequest = exports.UpdateMcpServerRequest = exports.CreateMcpServerRequest = exports.McpOAuthSession = exports.McpToolCustomization = exports.McpServerCustomization = exports.McpServer = exports.McpProtobufPackage = exports.WorkflowService = exports.WorkflowsResponse = exports.DeleteEdgeRequest = exports.CreateEdgeRequest = exports.DeleteNodeRequest = exports.UpdateNodeRequest = exports.CreateNodeRequest = exports.DeleteWorkflowRequest = exports.ListWorkflowsRequest = exports.GetWorkflowRequest = exports.UpdateWorkflowRequest = exports.CreateWorkflowRequest = exports.FullWorkflow = exports.WorkflowEdge = exports.WorkflowNode = exports.Workflow = exports.WorkflowProtobufPackage = exports.AgentService = exports.AgentsResponse = void 0;
|
|
8
|
+
exports.GenerationService = exports.GenerateImageResponse = exports.GeneratedImage = exports.GenerateImageRequest = exports.MCPToolSchemaResponse = exports.MCPToolSchemaRequest = exports.AgentGenerateResponse = exports.AgentGenerateRequest = exports.WorkflowLLMNodeResponse = exports.WorkflowLLMNodeRequest = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GenerationProtobufPackage = exports.ChatService = exports.DeleteChatExportCommentRequest = exports.AddChatExportCommentRequest = exports.ChatExportCommentsResponse = exports.ChatExportsResponse = exports.ListChatExportsRequest = exports.DeleteChatExportRequest = exports.GetChatExportCommentsRequest = exports.GetChatExportRequest = exports.ExportChatResponse = exports.ExportChatRequest = exports.ChatExportComment = exports.ChatExportSummary = exports.ChatExport = exports.ChatExportMessage = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = exports.UpdateChatRequest = exports.CreateChatRequest = exports.ChatMessage = exports.Chat = exports.ChatProtobufPackage = exports.LibraryService = exports.ArchiveItemsResponse = exports.ListArchiveItemsRequest = exports.ArchivesResponse = exports.BookmarksResponse = void 0;
|
|
9
9
|
var shared_module_1 = require("./shared.module");
|
|
10
10
|
Object.defineProperty(exports, "SharedModule", { enumerable: true, get: function () { return shared_module_1.SharedModule; } });
|
|
11
11
|
var user_client_1 = require("./user.client");
|
|
@@ -40,6 +40,10 @@ var chat_client_1 = require("./chat.client");
|
|
|
40
40
|
Object.defineProperty(exports, "ChatClient", { enumerable: true, get: function () { return chat_client_1.ChatClient; } });
|
|
41
41
|
var generation_client_1 = require("./generation.client");
|
|
42
42
|
Object.defineProperty(exports, "GenerationClient", { enumerable: true, get: function () { return generation_client_1.GenerationClient; } });
|
|
43
|
+
var ai_provider_dto_1 = require("./ai-provider.dto");
|
|
44
|
+
Object.defineProperty(exports, "PROVIDER_REQUEST_SCHEMA", { enumerable: true, get: function () { return ai_provider_dto_1.PROVIDER_REQUEST_SCHEMA; } });
|
|
45
|
+
Object.defineProperty(exports, "buildProviderRequestEnvelope", { enumerable: true, get: function () { return ai_provider_dto_1.buildProviderRequestEnvelope; } });
|
|
46
|
+
Object.defineProperty(exports, "isProviderRequestEnvelope", { enumerable: true, get: function () { return ai_provider_dto_1.isProviderRequestEnvelope; } });
|
|
43
47
|
// ============================
|
|
44
48
|
// User exports
|
|
45
49
|
// ============================
|
|
@@ -138,17 +142,24 @@ Object.defineProperty(exports, "OpenAICreateRequest", { enumerable: true, get: f
|
|
|
138
142
|
Object.defineProperty(exports, "OpenAICreateResponse", { enumerable: true, get: function () { return openai_interface_1.CreateResponse; } });
|
|
139
143
|
Object.defineProperty(exports, "OpenAIService", { enumerable: true, get: function () { return openai_interface_1.OpenAIServiceService; } });
|
|
140
144
|
// ============================
|
|
141
|
-
//
|
|
145
|
+
// Storage exports
|
|
142
146
|
// ============================
|
|
143
147
|
var storage_interface_1 = require("./storage.interface");
|
|
148
|
+
Object.defineProperty(exports, "FileMetadata", { enumerable: true, get: function () { return storage_interface_1.FileMetadata; } });
|
|
144
149
|
Object.defineProperty(exports, "UploadRequest", { enumerable: true, get: function () { return storage_interface_1.UploadRequest; } });
|
|
145
150
|
Object.defineProperty(exports, "UploadResponse", { enumerable: true, get: function () { return storage_interface_1.UploadResponse; } });
|
|
146
151
|
Object.defineProperty(exports, "DownloadRequest", { enumerable: true, get: function () { return storage_interface_1.DownloadRequest; } });
|
|
147
152
|
Object.defineProperty(exports, "DownloadResponse", { enumerable: true, get: function () { return storage_interface_1.DownloadResponse; } });
|
|
148
153
|
Object.defineProperty(exports, "DeleteRequest", { enumerable: true, get: function () { return storage_interface_1.DeleteRequest; } });
|
|
149
154
|
Object.defineProperty(exports, "DeleteResponse", { enumerable: true, get: function () { return storage_interface_1.DeleteResponse; } });
|
|
155
|
+
Object.defineProperty(exports, "GetMetadataRequest", { enumerable: true, get: function () { return storage_interface_1.GetMetadataRequest; } });
|
|
156
|
+
Object.defineProperty(exports, "GetMetadataResponse", { enumerable: true, get: function () { return storage_interface_1.GetMetadataResponse; } });
|
|
157
|
+
Object.defineProperty(exports, "ExistsRequest", { enumerable: true, get: function () { return storage_interface_1.ExistsRequest; } });
|
|
158
|
+
Object.defineProperty(exports, "ExistsResponse", { enumerable: true, get: function () { return storage_interface_1.ExistsResponse; } });
|
|
159
|
+
Object.defineProperty(exports, "ListFilesRequest", { enumerable: true, get: function () { return storage_interface_1.ListFilesRequest; } });
|
|
160
|
+
Object.defineProperty(exports, "ListFilesResponse", { enumerable: true, get: function () { return storage_interface_1.ListFilesResponse; } });
|
|
150
161
|
Object.defineProperty(exports, "StorageService", { enumerable: true, get: function () { return storage_interface_1.StorageServiceService; } });
|
|
151
|
-
Object.defineProperty(exports, "
|
|
162
|
+
Object.defineProperty(exports, "StorageProtobufPackage", { enumerable: true, get: function () { return storage_interface_1.protobufPackage; } });
|
|
152
163
|
// ============================
|
|
153
164
|
// Event exports
|
|
154
165
|
// ============================
|
|
@@ -2,9 +2,24 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
2
2
|
import type { handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
export declare const protobufPackage = "storage";
|
|
5
|
+
export interface FileMetadata {
|
|
6
|
+
key: string;
|
|
7
|
+
filename: string;
|
|
8
|
+
contentType: string;
|
|
9
|
+
size: number;
|
|
10
|
+
uploadedAt: string;
|
|
11
|
+
customMetadata: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface FileMetadata_CustomMetadataEntry {
|
|
16
|
+
key: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
5
19
|
export interface UploadRequest {
|
|
6
20
|
filename: string;
|
|
7
21
|
content: Uint8Array;
|
|
22
|
+
contentType: string;
|
|
8
23
|
metadata: {
|
|
9
24
|
[key: string]: string;
|
|
10
25
|
};
|
|
@@ -19,33 +34,78 @@ export interface DownloadRequest {
|
|
|
19
34
|
export interface DeleteRequest {
|
|
20
35
|
fileId: string;
|
|
21
36
|
}
|
|
37
|
+
export interface GetMetadataRequest {
|
|
38
|
+
fileId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ExistsRequest {
|
|
41
|
+
fileId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ListFilesRequest {
|
|
44
|
+
filters: {
|
|
45
|
+
[key: string]: string;
|
|
46
|
+
};
|
|
47
|
+
limit: number;
|
|
48
|
+
offset: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ListFilesRequest_FiltersEntry {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
22
54
|
export interface UploadResponse {
|
|
23
55
|
fileId: string;
|
|
56
|
+
url: string;
|
|
57
|
+
metadata?: FileMetadata | undefined;
|
|
24
58
|
}
|
|
25
59
|
export interface DownloadResponse {
|
|
26
60
|
content: Uint8Array;
|
|
27
61
|
filename: string;
|
|
62
|
+
contentType: string;
|
|
28
63
|
}
|
|
29
64
|
export interface DeleteResponse {
|
|
30
65
|
success: boolean;
|
|
31
66
|
}
|
|
67
|
+
export interface GetMetadataResponse {
|
|
68
|
+
metadata?: FileMetadata | undefined;
|
|
69
|
+
}
|
|
70
|
+
export interface ExistsResponse {
|
|
71
|
+
exists: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface ListFilesResponse {
|
|
74
|
+
files: FileMetadata[];
|
|
75
|
+
total: number;
|
|
76
|
+
}
|
|
32
77
|
export declare const STORAGE_PACKAGE_NAME = "storage";
|
|
78
|
+
export declare const FileMetadata: MessageFns<FileMetadata>;
|
|
79
|
+
export declare const FileMetadata_CustomMetadataEntry: MessageFns<FileMetadata_CustomMetadataEntry>;
|
|
33
80
|
export declare const UploadRequest: MessageFns<UploadRequest>;
|
|
34
81
|
export declare const UploadRequest_MetadataEntry: MessageFns<UploadRequest_MetadataEntry>;
|
|
35
82
|
export declare const DownloadRequest: MessageFns<DownloadRequest>;
|
|
36
83
|
export declare const DeleteRequest: MessageFns<DeleteRequest>;
|
|
84
|
+
export declare const GetMetadataRequest: MessageFns<GetMetadataRequest>;
|
|
85
|
+
export declare const ExistsRequest: MessageFns<ExistsRequest>;
|
|
86
|
+
export declare const ListFilesRequest: MessageFns<ListFilesRequest>;
|
|
87
|
+
export declare const ListFilesRequest_FiltersEntry: MessageFns<ListFilesRequest_FiltersEntry>;
|
|
37
88
|
export declare const UploadResponse: MessageFns<UploadResponse>;
|
|
38
89
|
export declare const DownloadResponse: MessageFns<DownloadResponse>;
|
|
39
90
|
export declare const DeleteResponse: MessageFns<DeleteResponse>;
|
|
91
|
+
export declare const GetMetadataResponse: MessageFns<GetMetadataResponse>;
|
|
92
|
+
export declare const ExistsResponse: MessageFns<ExistsResponse>;
|
|
93
|
+
export declare const ListFilesResponse: MessageFns<ListFilesResponse>;
|
|
40
94
|
export interface StorageServiceClient {
|
|
41
95
|
upload(request: UploadRequest, metadata?: Metadata): Observable<UploadResponse>;
|
|
42
96
|
download(request: DownloadRequest, metadata?: Metadata): Observable<DownloadResponse>;
|
|
43
97
|
delete(request: DeleteRequest, metadata?: Metadata): Observable<DeleteResponse>;
|
|
98
|
+
getMetadata(request: GetMetadataRequest, metadata?: Metadata): Observable<GetMetadataResponse>;
|
|
99
|
+
exists(request: ExistsRequest, metadata?: Metadata): Observable<ExistsResponse>;
|
|
100
|
+
listFiles(request: ListFilesRequest, metadata?: Metadata): Observable<ListFilesResponse>;
|
|
44
101
|
}
|
|
45
102
|
export interface StorageServiceController {
|
|
46
103
|
upload(request: UploadRequest, metadata?: Metadata): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
|
|
47
104
|
download(request: DownloadRequest, metadata?: Metadata): Promise<DownloadResponse> | Observable<DownloadResponse> | DownloadResponse;
|
|
48
105
|
delete(request: DeleteRequest, metadata?: Metadata): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
106
|
+
getMetadata(request: GetMetadataRequest, metadata?: Metadata): Promise<GetMetadataResponse> | Observable<GetMetadataResponse> | GetMetadataResponse;
|
|
107
|
+
exists(request: ExistsRequest, metadata?: Metadata): Promise<ExistsResponse> | Observable<ExistsResponse> | ExistsResponse;
|
|
108
|
+
listFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse> | Observable<ListFilesResponse> | ListFilesResponse;
|
|
49
109
|
}
|
|
50
110
|
export declare function StorageServiceControllerMethods(): (constructor: Function) => void;
|
|
51
111
|
export declare const STORAGE_SERVICE_NAME = "StorageService";
|
|
@@ -78,11 +138,41 @@ export declare const StorageServiceService: {
|
|
|
78
138
|
readonly responseSerialize: (value: DeleteResponse) => Buffer;
|
|
79
139
|
readonly responseDeserialize: (value: Buffer) => DeleteResponse;
|
|
80
140
|
};
|
|
141
|
+
readonly getMetadata: {
|
|
142
|
+
readonly path: "/storage.StorageService/getMetadata";
|
|
143
|
+
readonly requestStream: false;
|
|
144
|
+
readonly responseStream: false;
|
|
145
|
+
readonly requestSerialize: (value: GetMetadataRequest) => Buffer;
|
|
146
|
+
readonly requestDeserialize: (value: Buffer) => GetMetadataRequest;
|
|
147
|
+
readonly responseSerialize: (value: GetMetadataResponse) => Buffer;
|
|
148
|
+
readonly responseDeserialize: (value: Buffer) => GetMetadataResponse;
|
|
149
|
+
};
|
|
150
|
+
readonly exists: {
|
|
151
|
+
readonly path: "/storage.StorageService/exists";
|
|
152
|
+
readonly requestStream: false;
|
|
153
|
+
readonly responseStream: false;
|
|
154
|
+
readonly requestSerialize: (value: ExistsRequest) => Buffer;
|
|
155
|
+
readonly requestDeserialize: (value: Buffer) => ExistsRequest;
|
|
156
|
+
readonly responseSerialize: (value: ExistsResponse) => Buffer;
|
|
157
|
+
readonly responseDeserialize: (value: Buffer) => ExistsResponse;
|
|
158
|
+
};
|
|
159
|
+
readonly listFiles: {
|
|
160
|
+
readonly path: "/storage.StorageService/listFiles";
|
|
161
|
+
readonly requestStream: false;
|
|
162
|
+
readonly responseStream: false;
|
|
163
|
+
readonly requestSerialize: (value: ListFilesRequest) => Buffer;
|
|
164
|
+
readonly requestDeserialize: (value: Buffer) => ListFilesRequest;
|
|
165
|
+
readonly responseSerialize: (value: ListFilesResponse) => Buffer;
|
|
166
|
+
readonly responseDeserialize: (value: Buffer) => ListFilesResponse;
|
|
167
|
+
};
|
|
81
168
|
};
|
|
82
169
|
export interface StorageServiceServer extends UntypedServiceImplementation {
|
|
83
170
|
upload: handleUnaryCall<UploadRequest, UploadResponse>;
|
|
84
171
|
download: handleUnaryCall<DownloadRequest, DownloadResponse>;
|
|
85
172
|
delete: handleUnaryCall<DeleteRequest, DeleteResponse>;
|
|
173
|
+
getMetadata: handleUnaryCall<GetMetadataRequest, GetMetadataResponse>;
|
|
174
|
+
exists: handleUnaryCall<ExistsRequest, ExistsResponse>;
|
|
175
|
+
listFiles: handleUnaryCall<ListFilesRequest, ListFilesResponse>;
|
|
86
176
|
}
|
|
87
177
|
export interface MessageFns<T> {
|
|
88
178
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
@@ -5,15 +5,144 @@
|
|
|
5
5
|
// protoc v5.28.2
|
|
6
6
|
// source: storage.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.StorageServiceService = exports.STORAGE_SERVICE_NAME = exports.DeleteResponse = exports.DownloadResponse = exports.UploadResponse = exports.DeleteRequest = exports.DownloadRequest = exports.UploadRequest_MetadataEntry = exports.UploadRequest = exports.STORAGE_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
8
|
+
exports.StorageServiceService = exports.STORAGE_SERVICE_NAME = exports.ListFilesResponse = exports.ExistsResponse = exports.GetMetadataResponse = exports.DeleteResponse = exports.DownloadResponse = exports.UploadResponse = exports.ListFilesRequest_FiltersEntry = exports.ListFilesRequest = exports.ExistsRequest = exports.GetMetadataRequest = exports.DeleteRequest = exports.DownloadRequest = exports.UploadRequest_MetadataEntry = exports.UploadRequest = exports.FileMetadata_CustomMetadataEntry = exports.FileMetadata = exports.STORAGE_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
9
|
exports.StorageServiceControllerMethods = StorageServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
12
12
|
const microservices_1 = require("@nestjs/microservices");
|
|
13
13
|
exports.protobufPackage = "storage";
|
|
14
14
|
exports.STORAGE_PACKAGE_NAME = "storage";
|
|
15
|
+
function createBaseFileMetadata() {
|
|
16
|
+
return { key: "", filename: "", contentType: "", size: 0, uploadedAt: "", customMetadata: {} };
|
|
17
|
+
}
|
|
18
|
+
exports.FileMetadata = {
|
|
19
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
20
|
+
if (message.key !== "") {
|
|
21
|
+
writer.uint32(10).string(message.key);
|
|
22
|
+
}
|
|
23
|
+
if (message.filename !== "") {
|
|
24
|
+
writer.uint32(18).string(message.filename);
|
|
25
|
+
}
|
|
26
|
+
if (message.contentType !== "") {
|
|
27
|
+
writer.uint32(26).string(message.contentType);
|
|
28
|
+
}
|
|
29
|
+
if (message.size !== 0) {
|
|
30
|
+
writer.uint32(32).int64(message.size);
|
|
31
|
+
}
|
|
32
|
+
if (message.uploadedAt !== "") {
|
|
33
|
+
writer.uint32(42).string(message.uploadedAt);
|
|
34
|
+
}
|
|
35
|
+
Object.entries(message.customMetadata).forEach(([key, value]) => {
|
|
36
|
+
exports.FileMetadata_CustomMetadataEntry.encode({ key: key, value }, writer.uint32(50).fork()).join();
|
|
37
|
+
});
|
|
38
|
+
return writer;
|
|
39
|
+
},
|
|
40
|
+
decode(input, length) {
|
|
41
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
42
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
43
|
+
const message = createBaseFileMetadata();
|
|
44
|
+
while (reader.pos < end) {
|
|
45
|
+
const tag = reader.uint32();
|
|
46
|
+
switch (tag >>> 3) {
|
|
47
|
+
case 1: {
|
|
48
|
+
if (tag !== 10) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
message.key = reader.string();
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
case 2: {
|
|
55
|
+
if (tag !== 18) {
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
message.filename = reader.string();
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
case 3: {
|
|
62
|
+
if (tag !== 26) {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
message.contentType = reader.string();
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
case 4: {
|
|
69
|
+
if (tag !== 32) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
message.size = longToNumber(reader.int64());
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
case 5: {
|
|
76
|
+
if (tag !== 42) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
message.uploadedAt = reader.string();
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
case 6: {
|
|
83
|
+
if (tag !== 50) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
const entry6 = exports.FileMetadata_CustomMetadataEntry.decode(reader, reader.uint32());
|
|
87
|
+
if (entry6.value !== undefined) {
|
|
88
|
+
message.customMetadata[entry6.key] = entry6.value;
|
|
89
|
+
}
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
reader.skip(tag & 7);
|
|
97
|
+
}
|
|
98
|
+
return message;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
function createBaseFileMetadata_CustomMetadataEntry() {
|
|
102
|
+
return { key: "", value: "" };
|
|
103
|
+
}
|
|
104
|
+
exports.FileMetadata_CustomMetadataEntry = {
|
|
105
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
106
|
+
if (message.key !== "") {
|
|
107
|
+
writer.uint32(10).string(message.key);
|
|
108
|
+
}
|
|
109
|
+
if (message.value !== "") {
|
|
110
|
+
writer.uint32(18).string(message.value);
|
|
111
|
+
}
|
|
112
|
+
return writer;
|
|
113
|
+
},
|
|
114
|
+
decode(input, length) {
|
|
115
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
116
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
117
|
+
const message = createBaseFileMetadata_CustomMetadataEntry();
|
|
118
|
+
while (reader.pos < end) {
|
|
119
|
+
const tag = reader.uint32();
|
|
120
|
+
switch (tag >>> 3) {
|
|
121
|
+
case 1: {
|
|
122
|
+
if (tag !== 10) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
message.key = reader.string();
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
case 2: {
|
|
129
|
+
if (tag !== 18) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
message.value = reader.string();
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
reader.skip(tag & 7);
|
|
140
|
+
}
|
|
141
|
+
return message;
|
|
142
|
+
},
|
|
143
|
+
};
|
|
15
144
|
function createBaseUploadRequest() {
|
|
16
|
-
return { filename: "", content: new Uint8Array(0), metadata: {} };
|
|
145
|
+
return { filename: "", content: new Uint8Array(0), contentType: "", metadata: {} };
|
|
17
146
|
}
|
|
18
147
|
exports.UploadRequest = {
|
|
19
148
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -23,8 +152,11 @@ exports.UploadRequest = {
|
|
|
23
152
|
if (message.content.length !== 0) {
|
|
24
153
|
writer.uint32(18).bytes(message.content);
|
|
25
154
|
}
|
|
155
|
+
if (message.contentType !== "") {
|
|
156
|
+
writer.uint32(26).string(message.contentType);
|
|
157
|
+
}
|
|
26
158
|
Object.entries(message.metadata).forEach(([key, value]) => {
|
|
27
|
-
exports.UploadRequest_MetadataEntry.encode({ key: key, value }, writer.uint32(
|
|
159
|
+
exports.UploadRequest_MetadataEntry.encode({ key: key, value }, writer.uint32(34).fork()).join();
|
|
28
160
|
});
|
|
29
161
|
return writer;
|
|
30
162
|
},
|
|
@@ -53,9 +185,16 @@ exports.UploadRequest = {
|
|
|
53
185
|
if (tag !== 26) {
|
|
54
186
|
break;
|
|
55
187
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
188
|
+
message.contentType = reader.string();
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
case 4: {
|
|
192
|
+
if (tag !== 34) {
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
const entry4 = exports.UploadRequest_MetadataEntry.decode(reader, reader.uint32());
|
|
196
|
+
if (entry4.value !== undefined) {
|
|
197
|
+
message.metadata[entry4.key] = entry4.value;
|
|
59
198
|
}
|
|
60
199
|
continue;
|
|
61
200
|
}
|
|
@@ -177,14 +316,185 @@ exports.DeleteRequest = {
|
|
|
177
316
|
return message;
|
|
178
317
|
},
|
|
179
318
|
};
|
|
180
|
-
function
|
|
319
|
+
function createBaseGetMetadataRequest() {
|
|
320
|
+
return { fileId: "" };
|
|
321
|
+
}
|
|
322
|
+
exports.GetMetadataRequest = {
|
|
323
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
324
|
+
if (message.fileId !== "") {
|
|
325
|
+
writer.uint32(10).string(message.fileId);
|
|
326
|
+
}
|
|
327
|
+
return writer;
|
|
328
|
+
},
|
|
329
|
+
decode(input, length) {
|
|
330
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
331
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
332
|
+
const message = createBaseGetMetadataRequest();
|
|
333
|
+
while (reader.pos < end) {
|
|
334
|
+
const tag = reader.uint32();
|
|
335
|
+
switch (tag >>> 3) {
|
|
336
|
+
case 1: {
|
|
337
|
+
if (tag !== 10) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
message.fileId = reader.string();
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
reader.skip(tag & 7);
|
|
348
|
+
}
|
|
349
|
+
return message;
|
|
350
|
+
},
|
|
351
|
+
};
|
|
352
|
+
function createBaseExistsRequest() {
|
|
181
353
|
return { fileId: "" };
|
|
182
354
|
}
|
|
355
|
+
exports.ExistsRequest = {
|
|
356
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
357
|
+
if (message.fileId !== "") {
|
|
358
|
+
writer.uint32(10).string(message.fileId);
|
|
359
|
+
}
|
|
360
|
+
return writer;
|
|
361
|
+
},
|
|
362
|
+
decode(input, length) {
|
|
363
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
364
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
365
|
+
const message = createBaseExistsRequest();
|
|
366
|
+
while (reader.pos < end) {
|
|
367
|
+
const tag = reader.uint32();
|
|
368
|
+
switch (tag >>> 3) {
|
|
369
|
+
case 1: {
|
|
370
|
+
if (tag !== 10) {
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
message.fileId = reader.string();
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
reader.skip(tag & 7);
|
|
381
|
+
}
|
|
382
|
+
return message;
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
function createBaseListFilesRequest() {
|
|
386
|
+
return { filters: {}, limit: 0, offset: 0 };
|
|
387
|
+
}
|
|
388
|
+
exports.ListFilesRequest = {
|
|
389
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
390
|
+
Object.entries(message.filters).forEach(([key, value]) => {
|
|
391
|
+
exports.ListFilesRequest_FiltersEntry.encode({ key: key, value }, writer.uint32(10).fork()).join();
|
|
392
|
+
});
|
|
393
|
+
if (message.limit !== 0) {
|
|
394
|
+
writer.uint32(16).int32(message.limit);
|
|
395
|
+
}
|
|
396
|
+
if (message.offset !== 0) {
|
|
397
|
+
writer.uint32(24).int32(message.offset);
|
|
398
|
+
}
|
|
399
|
+
return writer;
|
|
400
|
+
},
|
|
401
|
+
decode(input, length) {
|
|
402
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
403
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
404
|
+
const message = createBaseListFilesRequest();
|
|
405
|
+
while (reader.pos < end) {
|
|
406
|
+
const tag = reader.uint32();
|
|
407
|
+
switch (tag >>> 3) {
|
|
408
|
+
case 1: {
|
|
409
|
+
if (tag !== 10) {
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
const entry1 = exports.ListFilesRequest_FiltersEntry.decode(reader, reader.uint32());
|
|
413
|
+
if (entry1.value !== undefined) {
|
|
414
|
+
message.filters[entry1.key] = entry1.value;
|
|
415
|
+
}
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
case 2: {
|
|
419
|
+
if (tag !== 16) {
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
message.limit = reader.int32();
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
case 3: {
|
|
426
|
+
if (tag !== 24) {
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
message.offset = reader.int32();
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
reader.skip(tag & 7);
|
|
437
|
+
}
|
|
438
|
+
return message;
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
function createBaseListFilesRequest_FiltersEntry() {
|
|
442
|
+
return { key: "", value: "" };
|
|
443
|
+
}
|
|
444
|
+
exports.ListFilesRequest_FiltersEntry = {
|
|
445
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
446
|
+
if (message.key !== "") {
|
|
447
|
+
writer.uint32(10).string(message.key);
|
|
448
|
+
}
|
|
449
|
+
if (message.value !== "") {
|
|
450
|
+
writer.uint32(18).string(message.value);
|
|
451
|
+
}
|
|
452
|
+
return writer;
|
|
453
|
+
},
|
|
454
|
+
decode(input, length) {
|
|
455
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
456
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
457
|
+
const message = createBaseListFilesRequest_FiltersEntry();
|
|
458
|
+
while (reader.pos < end) {
|
|
459
|
+
const tag = reader.uint32();
|
|
460
|
+
switch (tag >>> 3) {
|
|
461
|
+
case 1: {
|
|
462
|
+
if (tag !== 10) {
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
message.key = reader.string();
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
case 2: {
|
|
469
|
+
if (tag !== 18) {
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
472
|
+
message.value = reader.string();
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
reader.skip(tag & 7);
|
|
480
|
+
}
|
|
481
|
+
return message;
|
|
482
|
+
},
|
|
483
|
+
};
|
|
484
|
+
function createBaseUploadResponse() {
|
|
485
|
+
return { fileId: "", url: "" };
|
|
486
|
+
}
|
|
183
487
|
exports.UploadResponse = {
|
|
184
488
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
185
489
|
if (message.fileId !== "") {
|
|
186
490
|
writer.uint32(10).string(message.fileId);
|
|
187
491
|
}
|
|
492
|
+
if (message.url !== "") {
|
|
493
|
+
writer.uint32(18).string(message.url);
|
|
494
|
+
}
|
|
495
|
+
if (message.metadata !== undefined) {
|
|
496
|
+
exports.FileMetadata.encode(message.metadata, writer.uint32(26).fork()).join();
|
|
497
|
+
}
|
|
188
498
|
return writer;
|
|
189
499
|
},
|
|
190
500
|
decode(input, length) {
|
|
@@ -201,6 +511,20 @@ exports.UploadResponse = {
|
|
|
201
511
|
message.fileId = reader.string();
|
|
202
512
|
continue;
|
|
203
513
|
}
|
|
514
|
+
case 2: {
|
|
515
|
+
if (tag !== 18) {
|
|
516
|
+
break;
|
|
517
|
+
}
|
|
518
|
+
message.url = reader.string();
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
case 3: {
|
|
522
|
+
if (tag !== 26) {
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
message.metadata = exports.FileMetadata.decode(reader, reader.uint32());
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
204
528
|
}
|
|
205
529
|
if ((tag & 7) === 4 || tag === 0) {
|
|
206
530
|
break;
|
|
@@ -211,7 +535,7 @@ exports.UploadResponse = {
|
|
|
211
535
|
},
|
|
212
536
|
};
|
|
213
537
|
function createBaseDownloadResponse() {
|
|
214
|
-
return { content: new Uint8Array(0), filename: "" };
|
|
538
|
+
return { content: new Uint8Array(0), filename: "", contentType: "" };
|
|
215
539
|
}
|
|
216
540
|
exports.DownloadResponse = {
|
|
217
541
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -221,6 +545,9 @@ exports.DownloadResponse = {
|
|
|
221
545
|
if (message.filename !== "") {
|
|
222
546
|
writer.uint32(18).string(message.filename);
|
|
223
547
|
}
|
|
548
|
+
if (message.contentType !== "") {
|
|
549
|
+
writer.uint32(26).string(message.contentType);
|
|
550
|
+
}
|
|
224
551
|
return writer;
|
|
225
552
|
},
|
|
226
553
|
decode(input, length) {
|
|
@@ -244,6 +571,13 @@ exports.DownloadResponse = {
|
|
|
244
571
|
message.filename = reader.string();
|
|
245
572
|
continue;
|
|
246
573
|
}
|
|
574
|
+
case 3: {
|
|
575
|
+
if (tag !== 26) {
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
message.contentType = reader.string();
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
247
581
|
}
|
|
248
582
|
if ((tag & 7) === 4 || tag === 0) {
|
|
249
583
|
break;
|
|
@@ -286,9 +620,118 @@ exports.DeleteResponse = {
|
|
|
286
620
|
return message;
|
|
287
621
|
},
|
|
288
622
|
};
|
|
623
|
+
function createBaseGetMetadataResponse() {
|
|
624
|
+
return {};
|
|
625
|
+
}
|
|
626
|
+
exports.GetMetadataResponse = {
|
|
627
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
628
|
+
if (message.metadata !== undefined) {
|
|
629
|
+
exports.FileMetadata.encode(message.metadata, writer.uint32(10).fork()).join();
|
|
630
|
+
}
|
|
631
|
+
return writer;
|
|
632
|
+
},
|
|
633
|
+
decode(input, length) {
|
|
634
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
635
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
636
|
+
const message = createBaseGetMetadataResponse();
|
|
637
|
+
while (reader.pos < end) {
|
|
638
|
+
const tag = reader.uint32();
|
|
639
|
+
switch (tag >>> 3) {
|
|
640
|
+
case 1: {
|
|
641
|
+
if (tag !== 10) {
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
message.metadata = exports.FileMetadata.decode(reader, reader.uint32());
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
651
|
+
reader.skip(tag & 7);
|
|
652
|
+
}
|
|
653
|
+
return message;
|
|
654
|
+
},
|
|
655
|
+
};
|
|
656
|
+
function createBaseExistsResponse() {
|
|
657
|
+
return { exists: false };
|
|
658
|
+
}
|
|
659
|
+
exports.ExistsResponse = {
|
|
660
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
661
|
+
if (message.exists !== false) {
|
|
662
|
+
writer.uint32(8).bool(message.exists);
|
|
663
|
+
}
|
|
664
|
+
return writer;
|
|
665
|
+
},
|
|
666
|
+
decode(input, length) {
|
|
667
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
668
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
669
|
+
const message = createBaseExistsResponse();
|
|
670
|
+
while (reader.pos < end) {
|
|
671
|
+
const tag = reader.uint32();
|
|
672
|
+
switch (tag >>> 3) {
|
|
673
|
+
case 1: {
|
|
674
|
+
if (tag !== 8) {
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
message.exists = reader.bool();
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
reader.skip(tag & 7);
|
|
685
|
+
}
|
|
686
|
+
return message;
|
|
687
|
+
},
|
|
688
|
+
};
|
|
689
|
+
function createBaseListFilesResponse() {
|
|
690
|
+
return { files: [], total: 0 };
|
|
691
|
+
}
|
|
692
|
+
exports.ListFilesResponse = {
|
|
693
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
694
|
+
for (const v of message.files) {
|
|
695
|
+
exports.FileMetadata.encode(v, writer.uint32(10).fork()).join();
|
|
696
|
+
}
|
|
697
|
+
if (message.total !== 0) {
|
|
698
|
+
writer.uint32(16).int32(message.total);
|
|
699
|
+
}
|
|
700
|
+
return writer;
|
|
701
|
+
},
|
|
702
|
+
decode(input, length) {
|
|
703
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
704
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
705
|
+
const message = createBaseListFilesResponse();
|
|
706
|
+
while (reader.pos < end) {
|
|
707
|
+
const tag = reader.uint32();
|
|
708
|
+
switch (tag >>> 3) {
|
|
709
|
+
case 1: {
|
|
710
|
+
if (tag !== 10) {
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
message.files.push(exports.FileMetadata.decode(reader, reader.uint32()));
|
|
714
|
+
continue;
|
|
715
|
+
}
|
|
716
|
+
case 2: {
|
|
717
|
+
if (tag !== 16) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
message.total = reader.int32();
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
reader.skip(tag & 7);
|
|
728
|
+
}
|
|
729
|
+
return message;
|
|
730
|
+
},
|
|
731
|
+
};
|
|
289
732
|
function StorageServiceControllerMethods() {
|
|
290
733
|
return function (constructor) {
|
|
291
|
-
const grpcMethods = ["upload", "download", "delete"];
|
|
734
|
+
const grpcMethods = ["upload", "download", "delete", "getMetadata", "exists", "listFiles"];
|
|
292
735
|
for (const method of grpcMethods) {
|
|
293
736
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
294
737
|
(0, microservices_1.GrpcMethod)("StorageService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -329,4 +772,41 @@ exports.StorageServiceService = {
|
|
|
329
772
|
responseSerialize: (value) => Buffer.from(exports.DeleteResponse.encode(value).finish()),
|
|
330
773
|
responseDeserialize: (value) => exports.DeleteResponse.decode(value),
|
|
331
774
|
},
|
|
775
|
+
getMetadata: {
|
|
776
|
+
path: "/storage.StorageService/getMetadata",
|
|
777
|
+
requestStream: false,
|
|
778
|
+
responseStream: false,
|
|
779
|
+
requestSerialize: (value) => Buffer.from(exports.GetMetadataRequest.encode(value).finish()),
|
|
780
|
+
requestDeserialize: (value) => exports.GetMetadataRequest.decode(value),
|
|
781
|
+
responseSerialize: (value) => Buffer.from(exports.GetMetadataResponse.encode(value).finish()),
|
|
782
|
+
responseDeserialize: (value) => exports.GetMetadataResponse.decode(value),
|
|
783
|
+
},
|
|
784
|
+
exists: {
|
|
785
|
+
path: "/storage.StorageService/exists",
|
|
786
|
+
requestStream: false,
|
|
787
|
+
responseStream: false,
|
|
788
|
+
requestSerialize: (value) => Buffer.from(exports.ExistsRequest.encode(value).finish()),
|
|
789
|
+
requestDeserialize: (value) => exports.ExistsRequest.decode(value),
|
|
790
|
+
responseSerialize: (value) => Buffer.from(exports.ExistsResponse.encode(value).finish()),
|
|
791
|
+
responseDeserialize: (value) => exports.ExistsResponse.decode(value),
|
|
792
|
+
},
|
|
793
|
+
listFiles: {
|
|
794
|
+
path: "/storage.StorageService/listFiles",
|
|
795
|
+
requestStream: false,
|
|
796
|
+
responseStream: false,
|
|
797
|
+
requestSerialize: (value) => Buffer.from(exports.ListFilesRequest.encode(value).finish()),
|
|
798
|
+
requestDeserialize: (value) => exports.ListFilesRequest.decode(value),
|
|
799
|
+
responseSerialize: (value) => Buffer.from(exports.ListFilesResponse.encode(value).finish()),
|
|
800
|
+
responseDeserialize: (value) => exports.ListFilesResponse.decode(value),
|
|
801
|
+
},
|
|
332
802
|
};
|
|
803
|
+
function longToNumber(int64) {
|
|
804
|
+
const num = globalThis.Number(int64.toString());
|
|
805
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
806
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
807
|
+
}
|
|
808
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
809
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
810
|
+
}
|
|
811
|
+
return num;
|
|
812
|
+
}
|