@volontariapp/contracts-nest 3.1.16 → 3.1.17

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/storage/index.d.ts +6 -0
  3. package/dist/storage/index.d.ts.map +1 -0
  4. package/dist/storage/index.js +6 -0
  5. package/dist/storage/index.js.map +1 -0
  6. package/dist/storage/storage.command.d.ts +16 -0
  7. package/dist/storage/storage.command.d.ts.map +1 -0
  8. package/dist/storage/storage.command.js +2 -0
  9. package/dist/storage/storage.command.js.map +1 -0
  10. package/dist/storage/storage.d.ts +31 -0
  11. package/dist/storage/storage.d.ts.map +1 -0
  12. package/dist/storage/storage.js +19 -0
  13. package/dist/storage/storage.js.map +1 -0
  14. package/dist/storage/storage.query.d.ts +4 -0
  15. package/dist/storage/storage.query.d.ts.map +1 -0
  16. package/dist/storage/storage.query.js +2 -0
  17. package/dist/storage/storage.query.js.map +1 -0
  18. package/dist/storage/storage.responses.d.ts +18 -0
  19. package/dist/storage/storage.responses.d.ts.map +1 -0
  20. package/dist/storage/storage.responses.js +2 -0
  21. package/dist/storage/storage.responses.js.map +1 -0
  22. package/dist/storage/storage.services.d.ts +19 -0
  23. package/dist/storage/storage.services.d.ts.map +1 -0
  24. package/dist/storage/storage.services.js +19 -0
  25. package/dist/storage/storage.services.js.map +1 -0
  26. package/package.json +1 -1
  27. package/proto/volontariapp/storage/storage.command.proto +22 -0
  28. package/proto/volontariapp/storage/storage.proto +35 -0
  29. package/proto/volontariapp/storage/storage.query.proto +7 -0
  30. package/proto/volontariapp/storage/storage.responses.proto +25 -0
  31. package/proto/volontariapp/storage/storage.services.proto +14 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated proto typings update for both pure contracts and NestJS integration.
8
+
3
9
  ## 3.1.16
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,6 @@
1
+ export * from './storage.js';
2
+ export * from './storage.query.js';
3
+ export * from './storage.command.js';
4
+ export * from './storage.services.js';
5
+ export * from './storage.responses.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './storage.js';
2
+ export * from './storage.query.js';
3
+ export * from './storage.command.js';
4
+ export * from './storage.services.js';
5
+ export * from './storage.responses.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { EntityType } from "./storage.js";
2
+ export interface GenerateUploadUrlCommand {
3
+ mimeType: string;
4
+ sizeBytes: number;
5
+ entityType: EntityType;
6
+ isPublic: boolean;
7
+ }
8
+ export interface ConfirmFileAttachmentCommand {
9
+ fileIds: string[];
10
+ entityType: EntityType;
11
+ entityId: string;
12
+ }
13
+ export interface DeleteFileCommand {
14
+ fileId: string;
15
+ }
16
+ //# sourceMappingURL=storage.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.command.d.ts","sourceRoot":"","sources":["../../src/storage/storage.command.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=storage.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.command.js","sourceRoot":"","sources":["../../src/storage/storage.command.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ import { Timestamp } from "../google/protobuf/timestamp.js";
2
+ export declare enum FileStatus {
3
+ FILE_STATUS_UNSPECIFIED = 0,
4
+ FILE_STATUS_PENDING = 1,
5
+ FILE_STATUS_ATTACHED = 2,
6
+ FILE_STATUS_ORPHANED = 3,
7
+ FILE_STATUS_DELETED = 4,
8
+ UNRECOGNIZED = -1
9
+ }
10
+ export declare enum EntityType {
11
+ ENTITY_TYPE_UNSPECIFIED = 0,
12
+ ENTITY_TYPE_POST = 1,
13
+ ENTITY_TYPE_USER_AVATAR = 2,
14
+ ENTITY_TYPE_BADGE_ICON = 3,
15
+ ENTITY_TYPE_EVENT_COVER = 4,
16
+ UNRECOGNIZED = -1
17
+ }
18
+ export interface FileMetadata {
19
+ id: string;
20
+ ownerId: string;
21
+ objectKey: string;
22
+ mimeType: string;
23
+ status: FileStatus;
24
+ entityType?: EntityType | undefined;
25
+ entityId?: string | undefined;
26
+ isPublic: boolean;
27
+ uploadExpiresAt: Timestamp | undefined;
28
+ createdAt: Timestamp | undefined;
29
+ updatedAt: Timestamp | undefined;
30
+ }
31
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/storage/storage.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,oBAAY,UAAU;IACpB,uBAAuB,IAAI;IAC3B,mBAAmB,IAAI;IACvB,oBAAoB,IAAI;IACxB,oBAAoB,IAAI;IACxB,mBAAmB,IAAI;IACvB,YAAY,KAAK;CAClB;AAED,oBAAY,UAAU;IACpB,uBAAuB,IAAI;IAC3B,gBAAgB,IAAI;IACpB,uBAAuB,IAAI;IAC3B,sBAAsB,IAAI;IAC1B,uBAAuB,IAAI;IAC3B,YAAY,KAAK;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,SAAS,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC"}
@@ -0,0 +1,19 @@
1
+ export var FileStatus;
2
+ (function (FileStatus) {
3
+ FileStatus[FileStatus["FILE_STATUS_UNSPECIFIED"] = 0] = "FILE_STATUS_UNSPECIFIED";
4
+ FileStatus[FileStatus["FILE_STATUS_PENDING"] = 1] = "FILE_STATUS_PENDING";
5
+ FileStatus[FileStatus["FILE_STATUS_ATTACHED"] = 2] = "FILE_STATUS_ATTACHED";
6
+ FileStatus[FileStatus["FILE_STATUS_ORPHANED"] = 3] = "FILE_STATUS_ORPHANED";
7
+ FileStatus[FileStatus["FILE_STATUS_DELETED"] = 4] = "FILE_STATUS_DELETED";
8
+ FileStatus[FileStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
9
+ })(FileStatus || (FileStatus = {}));
10
+ export var EntityType;
11
+ (function (EntityType) {
12
+ EntityType[EntityType["ENTITY_TYPE_UNSPECIFIED"] = 0] = "ENTITY_TYPE_UNSPECIFIED";
13
+ EntityType[EntityType["ENTITY_TYPE_POST"] = 1] = "ENTITY_TYPE_POST";
14
+ EntityType[EntityType["ENTITY_TYPE_USER_AVATAR"] = 2] = "ENTITY_TYPE_USER_AVATAR";
15
+ EntityType[EntityType["ENTITY_TYPE_BADGE_ICON"] = 3] = "ENTITY_TYPE_BADGE_ICON";
16
+ EntityType[EntityType["ENTITY_TYPE_EVENT_COVER"] = 4] = "ENTITY_TYPE_EVENT_COVER";
17
+ EntityType[EntityType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
+ })(EntityType || (EntityType = {}));
19
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/storage/storage.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,iFAA2B,CAAA;IAC3B,yEAAuB,CAAA;IACvB,2EAAwB,CAAA;IACxB,2EAAwB,CAAA;IACxB,yEAAuB,CAAA;IACvB,4DAAiB,CAAA;AACnB,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB;AAED,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,iFAA2B,CAAA;IAC3B,mEAAoB,CAAA;IACpB,iFAA2B,CAAA;IAC3B,+EAA0B,CAAA;IAC1B,iFAA2B,CAAA;IAC3B,4DAAiB,CAAA;AACnB,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB"}
@@ -0,0 +1,4 @@
1
+ export interface GetFileMetadataQuery {
2
+ fileId: string;
3
+ }
4
+ //# sourceMappingURL=storage.query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.query.d.ts","sourceRoot":"","sources":["../../src/storage/storage.query.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=storage.query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.query.js","sourceRoot":"","sources":["../../src/storage/storage.query.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { Timestamp } from "../google/protobuf/timestamp.js";
2
+ import { FileMetadata } from "./storage.js";
3
+ export interface GenerateUploadUrlResponse {
4
+ fileId: string;
5
+ uploadUrl: string;
6
+ expiresAt: Timestamp | undefined;
7
+ }
8
+ export interface ConfirmFileAttachmentResponse {
9
+ success: boolean;
10
+ updatedCount: number;
11
+ }
12
+ export interface DeleteFileResponse {
13
+ success: boolean;
14
+ }
15
+ export interface FileMetadataResponse {
16
+ file: FileMetadata | undefined;
17
+ }
18
+ //# sourceMappingURL=storage.responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.responses.d.ts","sourceRoot":"","sources":["../../src/storage/storage.responses.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;CAChC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=storage.responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.responses.js","sourceRoot":"","sources":["../../src/storage/storage.responses.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { Observable } from "rxjs";
2
+ import { ConfirmFileAttachmentCommand, DeleteFileCommand, GenerateUploadUrlCommand } from "./storage.command.js";
3
+ import { GetFileMetadataQuery } from "./storage.query.js";
4
+ import { ConfirmFileAttachmentResponse, DeleteFileResponse, FileMetadataResponse, GenerateUploadUrlResponse } from "./storage.responses.js";
5
+ export interface StorageServiceClient {
6
+ generateUploadUrl(request: GenerateUploadUrlCommand): Observable<GenerateUploadUrlResponse>;
7
+ confirmFileAttachment(request: ConfirmFileAttachmentCommand): Observable<ConfirmFileAttachmentResponse>;
8
+ deleteFile(request: DeleteFileCommand): Observable<DeleteFileResponse>;
9
+ getFileMetadata(request: GetFileMetadataQuery): Observable<FileMetadataResponse>;
10
+ }
11
+ export interface StorageServiceController {
12
+ generateUploadUrl(request: GenerateUploadUrlCommand): Promise<GenerateUploadUrlResponse> | Observable<GenerateUploadUrlResponse> | GenerateUploadUrlResponse;
13
+ confirmFileAttachment(request: ConfirmFileAttachmentCommand): Promise<ConfirmFileAttachmentResponse> | Observable<ConfirmFileAttachmentResponse> | ConfirmFileAttachmentResponse;
14
+ deleteFile(request: DeleteFileCommand): Promise<DeleteFileResponse> | Observable<DeleteFileResponse> | DeleteFileResponse;
15
+ getFileMetadata(request: GetFileMetadataQuery): Promise<FileMetadataResponse> | Observable<FileMetadataResponse> | FileMetadataResponse;
16
+ }
17
+ export declare function StorageServiceControllerMethods(): (constructor: Function) => void;
18
+ export declare const STORAGE_SERVICE_NAME = "StorageService";
19
+ //# sourceMappingURL=storage.services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.services.d.ts","sourceRoot":"","sources":["../../src/storage/storage.services.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACjH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAE5F,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAC;IAExG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAEvE,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;CAClF;AAED,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,CACf,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC,GAAG,UAAU,CAAC,yBAAyB,CAAC,GAAG,yBAAyB,CAAC;IAE1G,qBAAqB,CACnB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,6BAA6B,CAAC,GAAG,UAAU,CAAC,6BAA6B,CAAC,GAAG,6BAA6B,CAAC;IAEtH,UAAU,CACR,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IAErF,eAAe,CACb,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,GAAG,UAAU,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC;CAC5F;AAED,wBAAgB,+BAA+B,kBACf,QAAQ,UAcvC;AAED,eAAO,MAAM,oBAAoB,mBAAmB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
2
+ export function StorageServiceControllerMethods() {
3
+ return function (constructor) {
4
+ const grpcMethods = ["generateUploadUrl", "confirmFileAttachment", "deleteFile", "getFileMetadata"];
5
+ for (const method of grpcMethods) {
6
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
7
+ GrpcMethod("StorageService", method)(constructor.prototype[method], method, descriptor);
8
+ Object.defineProperty(constructor.prototype, method, descriptor);
9
+ }
10
+ const grpcStreamMethods = [];
11
+ for (const method of grpcStreamMethods) {
12
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
13
+ GrpcStreamMethod("StorageService", method)(constructor.prototype[method], method, descriptor);
14
+ Object.defineProperty(constructor.prototype, method, descriptor);
15
+ }
16
+ };
17
+ }
18
+ export const STORAGE_SERVICE_NAME = "StorageService";
19
+ //# sourceMappingURL=storage.services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.services.js","sourceRoot":"","sources":["../../src/storage/storage.services.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAuCrE,MAAM,UAAU,+BAA+B;IAC7C,OAAO,UAAU,WAAqB;QACpC,MAAM,WAAW,GAAa,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;QAC9G,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;YACjC,MAAM,UAAU,GAAQ,OAAO,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACxF,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YACxF,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,iBAAiB,GAAa,EAAE,CAAC;QACvC,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;YACvC,MAAM,UAAU,GAAQ,OAAO,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACxF,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAC9F,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volontariapp/contracts-nest",
3
- "version": "3.1.16",
3
+ "version": "3.1.17",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -0,0 +1,22 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.storage;
4
+
5
+ import "volontariapp/storage/storage.proto";
6
+
7
+ message GenerateUploadUrlCommand {
8
+ string mime_type = 1;
9
+ int64 size_bytes = 2;
10
+ EntityType entity_type = 3;
11
+ bool is_public = 4;
12
+ }
13
+
14
+ message ConfirmFileAttachmentCommand {
15
+ repeated string file_ids = 1;
16
+ EntityType entity_type = 2;
17
+ string entity_id = 3;
18
+ }
19
+
20
+ message DeleteFileCommand {
21
+ string file_id = 1;
22
+ }
@@ -0,0 +1,35 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.storage;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+
7
+ enum FileStatus {
8
+ FILE_STATUS_UNSPECIFIED = 0;
9
+ FILE_STATUS_PENDING = 1;
10
+ FILE_STATUS_ATTACHED = 2;
11
+ FILE_STATUS_ORPHANED = 3;
12
+ FILE_STATUS_DELETED = 4;
13
+ }
14
+
15
+ enum EntityType {
16
+ ENTITY_TYPE_UNSPECIFIED = 0;
17
+ ENTITY_TYPE_POST = 1;
18
+ ENTITY_TYPE_USER_AVATAR = 2;
19
+ ENTITY_TYPE_BADGE_ICON = 3;
20
+ ENTITY_TYPE_EVENT_COVER = 4;
21
+ }
22
+
23
+ message FileMetadata {
24
+ string id = 1;
25
+ string owner_id = 2;
26
+ string object_key = 3;
27
+ string mime_type = 4;
28
+ FileStatus status = 5;
29
+ optional EntityType entity_type = 6;
30
+ optional string entity_id = 7;
31
+ bool is_public = 8;
32
+ google.protobuf.Timestamp upload_expires_at = 9;
33
+ google.protobuf.Timestamp created_at = 10;
34
+ google.protobuf.Timestamp updated_at = 11;
35
+ }
@@ -0,0 +1,7 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.storage;
4
+
5
+ message GetFileMetadataQuery {
6
+ string file_id = 1;
7
+ }
@@ -0,0 +1,25 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.storage;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+ import "volontariapp/storage/storage.proto";
7
+
8
+ message GenerateUploadUrlResponse {
9
+ string file_id = 1;
10
+ string upload_url = 2;
11
+ google.protobuf.Timestamp expires_at = 3;
12
+ }
13
+
14
+ message ConfirmFileAttachmentResponse {
15
+ bool success = 1;
16
+ int32 updated_count = 2;
17
+ }
18
+
19
+ message DeleteFileResponse {
20
+ bool success = 1;
21
+ }
22
+
23
+ message FileMetadataResponse {
24
+ FileMetadata file = 1;
25
+ }
@@ -0,0 +1,14 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.storage;
4
+
5
+ import "volontariapp/storage/storage.command.proto";
6
+ import "volontariapp/storage/storage.query.proto";
7
+ import "volontariapp/storage/storage.responses.proto";
8
+
9
+ service StorageService {
10
+ rpc GenerateUploadUrl (GenerateUploadUrlCommand) returns (GenerateUploadUrlResponse) {}
11
+ rpc ConfirmFileAttachment (ConfirmFileAttachmentCommand) returns (ConfirmFileAttachmentResponse) {}
12
+ rpc DeleteFile (DeleteFileCommand) returns (DeleteFileResponse) {}
13
+ rpc GetFileMetadata (GetFileMetadataQuery) returns (FileMetadataResponse) {}
14
+ }