@volontariapp/contracts 2.2.0 → 3.0.0-next.20260411094510
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/README.md +35 -0
- package/dist/event/index.d.ts +0 -1
- package/dist/event/index.d.ts.map +1 -1
- package/dist/event/index.js +0 -1
- package/dist/event/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/post/index.d.ts +0 -1
- package/dist/post/index.d.ts.map +1 -1
- package/dist/post/index.js +0 -1
- package/dist/post/index.js.map +1 -1
- package/dist/user/index.d.ts +0 -1
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +0 -1
- package/dist/user/index.js.map +1 -1
- package/package.json +4 -15
- package/dist/event/event.services.d.ts +0 -21
- package/dist/event/event.services.d.ts.map +0 -1
- package/dist/event/event.services.js +0 -17
- package/dist/event/event.services.js.map +0 -1
- package/dist/grpc.helper.d.ts +0 -46
- package/dist/grpc.helper.d.ts.map +0 -1
- package/dist/grpc.helper.js +0 -76
- package/dist/grpc.helper.js.map +0 -1
- package/dist/post/post.services.d.ts +0 -21
- package/dist/post/post.services.d.ts.map +0 -1
- package/dist/post/post.services.js +0 -17
- package/dist/post/post.services.js.map +0 -1
- package/dist/user/user.services.d.ts +0 -21
- package/dist/user/user.services.d.ts.map +0 -1
- package/dist/user/user.services.js +0 -17
- package/dist/user/user.services.js.map +0 -1
- package/proto/volontariapp/common/pagination.proto +0 -16
- package/proto/volontariapp/common/timestamp.proto +0 -11
- package/proto/volontariapp/event/event.command.proto +0 -27
- package/proto/volontariapp/event/event.proto +0 -15
- package/proto/volontariapp/event/event.query.proto +0 -13
- package/proto/volontariapp/event/event.responses.proto +0 -30
- package/proto/volontariapp/event/event.services.proto +0 -16
- package/proto/volontariapp/post/post.command.proto +0 -19
- package/proto/volontariapp/post/post.proto +0 -11
- package/proto/volontariapp/post/post.query.proto +0 -15
- package/proto/volontariapp/post/post.responses.proto +0 -28
- package/proto/volontariapp/post/post.services.proto +0 -17
- package/proto/volontariapp/user/user.command.proto +0 -23
- package/proto/volontariapp/user/user.proto +0 -11
- package/proto/volontariapp/user/user.query.proto +0 -13
- package/proto/volontariapp/user/user.responses.proto +0 -27
- package/proto/volontariapp/user/user.services.proto +0 -15
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @volontariapp/contracts
|
|
2
|
+
|
|
3
|
+
Central repository for all TypeScript interfaces, commands, and queries shared across the Volontariapp ecosystem.
|
|
4
|
+
|
|
5
|
+
## 🚀 Purpose
|
|
6
|
+
|
|
7
|
+
This package is **isomorphic** and **front-end compatible**. It contains pure TypeScript definitions generated from the gRPC `.proto` files, making it suitable for:
|
|
8
|
+
- **Web Applications** (React/Next.js)
|
|
9
|
+
- **Mobile Applications** (React Native/Expo)
|
|
10
|
+
- **Shared Logic** (Pure Node.js)
|
|
11
|
+
- **Microservices** (DTOs and Interfaces)
|
|
12
|
+
|
|
13
|
+
## 📦 Features
|
|
14
|
+
|
|
15
|
+
- **Pure TypeScript**: No dependencies on NestJS or other server-side frameworks.
|
|
16
|
+
- **Auto-generated**: Always in sync with the `proto-registry`.
|
|
17
|
+
- **Lightweight**: Optimized for bundling in browser/mobile environments.
|
|
18
|
+
|
|
19
|
+
## 💻 Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { User, CreateUserCommand } from '@volontariapp/contracts';
|
|
23
|
+
|
|
24
|
+
const newUser: CreateUserCommand = {
|
|
25
|
+
email: 'user@example.com',
|
|
26
|
+
firstName: 'John',
|
|
27
|
+
lastName: 'Doe',
|
|
28
|
+
password: '...',
|
|
29
|
+
role: 'USER'
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 🛠 Maintenance
|
|
34
|
+
|
|
35
|
+
The source code in `src/` is automatically generated by the CI from the `proto-registry`. Do **not** edit files inside `src/` manually.
|
package/dist/event/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/event/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/event/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
package/dist/event/index.js
CHANGED
package/dist/event/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/dist/post/index.d.ts
CHANGED
package/dist/post/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/post/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/post/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/post/index.js
CHANGED
package/dist/post/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/post/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/post/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/user/index.d.ts
CHANGED
package/dist/user/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/user/index.js
CHANGED
package/dist/user/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volontariapp/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.20260411094510",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/Volontariapp/npm-packages.git"
|
|
11
11
|
},
|
|
12
|
-
"description": "",
|
|
12
|
+
"description": "Pure TypeScript interfaces for Volontariapp gRPC contracts (Front-end compatible)",
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"main": "./dist/index.js",
|
|
@@ -19,12 +19,10 @@
|
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
-
"./package.json": "./package.json"
|
|
23
|
-
"./proto/*": "./proto/*"
|
|
22
|
+
"./package.json": "./package.json"
|
|
24
23
|
},
|
|
25
24
|
"files": [
|
|
26
|
-
"dist"
|
|
27
|
-
"proto"
|
|
25
|
+
"dist"
|
|
28
26
|
],
|
|
29
27
|
"engines": {
|
|
30
28
|
"node": ">=24.14.0"
|
|
@@ -38,17 +36,8 @@
|
|
|
38
36
|
"test": "echo \"No tests yet\""
|
|
39
37
|
},
|
|
40
38
|
"devDependencies": {
|
|
41
|
-
"@nestjs/common": "^11.0.1",
|
|
42
|
-
"@nestjs/core": "^11.0.1",
|
|
43
|
-
"@nestjs/microservices": "^11.1.14",
|
|
44
|
-
"reflect-metadata": "^0.2.2",
|
|
45
|
-
"rxjs": "^7.8.2",
|
|
46
39
|
"typescript": "5.7.3"
|
|
47
40
|
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"@nestjs/microservices": "^11.0.0",
|
|
50
|
-
"rxjs": "^7.0.0"
|
|
51
|
-
},
|
|
52
41
|
"dependencies": {
|
|
53
42
|
"@volontariapp/logger": "0.2.0",
|
|
54
43
|
"protobufjs": "7.5.3"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { CreateEventCommand, DeleteEventCommand, UpdateEventCommand } from "./event.command.js";
|
|
3
|
-
import { EventQuery, ListEventsQuery } from "./event.query.js";
|
|
4
|
-
import { CreateEventResponse, DeleteEventResponse, GetEventResponse, ListEventsResponse, UpdateEventResponse } from "./event.responses.js";
|
|
5
|
-
export interface EventServiceClient {
|
|
6
|
-
getEvent(request: EventQuery): Observable<GetEventResponse>;
|
|
7
|
-
listEvents(request: ListEventsQuery): Observable<ListEventsResponse>;
|
|
8
|
-
createEvent(request: CreateEventCommand): Observable<CreateEventResponse>;
|
|
9
|
-
updateEvent(request: UpdateEventCommand): Observable<UpdateEventResponse>;
|
|
10
|
-
deleteEvent(request: DeleteEventCommand): Observable<DeleteEventResponse>;
|
|
11
|
-
}
|
|
12
|
-
export interface EventServiceController {
|
|
13
|
-
getEvent(request: EventQuery): Promise<GetEventResponse> | Observable<GetEventResponse> | GetEventResponse;
|
|
14
|
-
listEvents(request: ListEventsQuery): Promise<ListEventsResponse> | Observable<ListEventsResponse> | ListEventsResponse;
|
|
15
|
-
createEvent(request: CreateEventCommand): Promise<CreateEventResponse> | Observable<CreateEventResponse> | CreateEventResponse;
|
|
16
|
-
updateEvent(request: UpdateEventCommand): Promise<UpdateEventResponse> | Observable<UpdateEventResponse> | UpdateEventResponse;
|
|
17
|
-
deleteEvent(request: DeleteEventCommand): Promise<DeleteEventResponse> | Observable<DeleteEventResponse> | DeleteEventResponse;
|
|
18
|
-
}
|
|
19
|
-
export declare function EventServiceControllerMethods(): (constructor: Function) => void;
|
|
20
|
-
export declare const EVENT_SERVICE_NAME = "EventService";
|
|
21
|
-
//# sourceMappingURL=event.services.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.services.d.ts","sourceRoot":"","sources":["../../src/event/event.services.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACp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amMethod } from "@nestjs/microservices";
|
|
2
|
-
export function EventServiceControllerMethods() {
|
|
3
|
-
return function (constructor) {
|
|
4
|
-
const grpcMethods = ["getEvent", "listEvents", "createEvent", "updateEvent", "deleteEvent"];
|
|
5
|
-
for (const method of grpcMethods) {
|
|
6
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
7
|
-
GrpcMethod("EventService", method)(constructor.prototype[method], method, descriptor);
|
|
8
|
-
}
|
|
9
|
-
const grpcStreamMethods = [];
|
|
10
|
-
for (const method of grpcStreamMethods) {
|
|
11
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
12
|
-
GrpcStreamMethod("EventService", method)(constructor.prototype[method], method, descriptor);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export const EVENT_SERVICE_NAME = "EventService";
|
|
17
|
-
//# sourceMappingURL=event.services.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.services.js","sourceRoot":"","sources":["../../src/event/event.services.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA4CrE,MAAM,UAAU,6BAA6B;IAC3C,OAAO,UAAU,WAAqB;QACpC,MAAM,WAAW,GAAa,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;QACtG,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,cAAc,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACxF,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,cAAc,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC"}
|
package/dist/grpc.helper.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { GrpcOptions } from '@nestjs/microservices';
|
|
2
|
-
export declare enum GRPC_SERVICES {
|
|
3
|
-
USER = "USER",
|
|
4
|
-
POST = "POST",
|
|
5
|
-
EVENT = "EVENT"
|
|
6
|
-
}
|
|
7
|
-
export declare enum USER_GRPC_METHODS {
|
|
8
|
-
GET_USER = "getUser",
|
|
9
|
-
LIST_USERS = "listUsers",
|
|
10
|
-
CREATE_USER = "createUser",
|
|
11
|
-
UPDATE_USER = "updateUser",
|
|
12
|
-
DELETE_USER = "deleteUser"
|
|
13
|
-
}
|
|
14
|
-
export declare enum POST_GRPC_METHODS {
|
|
15
|
-
GET_POST = "getPost",
|
|
16
|
-
LIST_POSTS = "listPosts",
|
|
17
|
-
CREATE_POST = "createPost",
|
|
18
|
-
UPDATE_POST = "updatePost",
|
|
19
|
-
DELETE_POST = "deletePost"
|
|
20
|
-
}
|
|
21
|
-
export declare enum EVENT_GRPC_METHODS {
|
|
22
|
-
GET_EVENT = "getEvent",
|
|
23
|
-
LIST_EVENTS = "listEvents",
|
|
24
|
-
CREATE_EVENT = "createEvent",
|
|
25
|
-
UPDATE_EVENT = "updateEvent",
|
|
26
|
-
DELETE_EVENT = "deleteEvent"
|
|
27
|
-
}
|
|
28
|
-
export declare const GRPC_SERVICES_CONFIG: {
|
|
29
|
-
USER: {
|
|
30
|
-
package: string;
|
|
31
|
-
protoFileName: string;
|
|
32
|
-
domain: string;
|
|
33
|
-
};
|
|
34
|
-
POST: {
|
|
35
|
-
package: string;
|
|
36
|
-
protoFileName: string;
|
|
37
|
-
domain: string;
|
|
38
|
-
};
|
|
39
|
-
EVENT: {
|
|
40
|
-
package: string;
|
|
41
|
-
protoFileName: string;
|
|
42
|
-
domain: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export declare const getGrpcOptions: (service: GRPC_SERVICES, url: string) => GrpcOptions;
|
|
46
|
-
//# sourceMappingURL=grpc.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grpc.helper.d.ts","sourceRoot":"","sources":["../src/grpc.helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASzD,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,iBAAiB;IAC3B,QAAQ,YAAY;IACpB,UAAU,cAAc;IACxB,WAAW,eAAe;IAC1B,WAAW,eAAe;IAC1B,WAAW,eAAe;CAC3B;AAED,oBAAY,iBAAiB;IAC3B,QAAQ,YAAY;IACpB,UAAU,cAAc;IACxB,WAAW,eAAe;IAC1B,WAAW,eAAe;IAC1B,WAAW,eAAe;CAC3B;AAED,oBAAY,kBAAkB;IAC5B,SAAS,aAAa;IACtB,WAAW,eAAe;IAC1B,YAAY,gBAAgB;IAC5B,YAAY,gBAAgB;IAC5B,YAAY,gBAAgB;CAC7B;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;CAgBhC,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,aAAa,OAAO,MAAM,KAAG,WAqBpE,CAAC"}
|
package/dist/grpc.helper.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { join, dirname } from 'path';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import { Transport } from '@nestjs/microservices';
|
|
4
|
-
import { Logger } from '@volontariapp/logger';
|
|
5
|
-
const logger = new Logger({ context: 'GrpcHelper', format: 'json' });
|
|
6
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = dirname(__filename);
|
|
8
|
-
export var GRPC_SERVICES;
|
|
9
|
-
(function (GRPC_SERVICES) {
|
|
10
|
-
GRPC_SERVICES["USER"] = "USER";
|
|
11
|
-
GRPC_SERVICES["POST"] = "POST";
|
|
12
|
-
GRPC_SERVICES["EVENT"] = "EVENT";
|
|
13
|
-
})(GRPC_SERVICES || (GRPC_SERVICES = {}));
|
|
14
|
-
export var USER_GRPC_METHODS;
|
|
15
|
-
(function (USER_GRPC_METHODS) {
|
|
16
|
-
USER_GRPC_METHODS["GET_USER"] = "getUser";
|
|
17
|
-
USER_GRPC_METHODS["LIST_USERS"] = "listUsers";
|
|
18
|
-
USER_GRPC_METHODS["CREATE_USER"] = "createUser";
|
|
19
|
-
USER_GRPC_METHODS["UPDATE_USER"] = "updateUser";
|
|
20
|
-
USER_GRPC_METHODS["DELETE_USER"] = "deleteUser";
|
|
21
|
-
})(USER_GRPC_METHODS || (USER_GRPC_METHODS = {}));
|
|
22
|
-
export var POST_GRPC_METHODS;
|
|
23
|
-
(function (POST_GRPC_METHODS) {
|
|
24
|
-
POST_GRPC_METHODS["GET_POST"] = "getPost";
|
|
25
|
-
POST_GRPC_METHODS["LIST_POSTS"] = "listPosts";
|
|
26
|
-
POST_GRPC_METHODS["CREATE_POST"] = "createPost";
|
|
27
|
-
POST_GRPC_METHODS["UPDATE_POST"] = "updatePost";
|
|
28
|
-
POST_GRPC_METHODS["DELETE_POST"] = "deletePost";
|
|
29
|
-
})(POST_GRPC_METHODS || (POST_GRPC_METHODS = {}));
|
|
30
|
-
export var EVENT_GRPC_METHODS;
|
|
31
|
-
(function (EVENT_GRPC_METHODS) {
|
|
32
|
-
EVENT_GRPC_METHODS["GET_EVENT"] = "getEvent";
|
|
33
|
-
EVENT_GRPC_METHODS["LIST_EVENTS"] = "listEvents";
|
|
34
|
-
EVENT_GRPC_METHODS["CREATE_EVENT"] = "createEvent";
|
|
35
|
-
EVENT_GRPC_METHODS["UPDATE_EVENT"] = "updateEvent";
|
|
36
|
-
EVENT_GRPC_METHODS["DELETE_EVENT"] = "deleteEvent";
|
|
37
|
-
})(EVENT_GRPC_METHODS || (EVENT_GRPC_METHODS = {}));
|
|
38
|
-
export const GRPC_SERVICES_CONFIG = {
|
|
39
|
-
[GRPC_SERVICES.USER]: {
|
|
40
|
-
package: 'volontariapp.user',
|
|
41
|
-
protoFileName: 'user.services.proto',
|
|
42
|
-
domain: 'user',
|
|
43
|
-
},
|
|
44
|
-
[GRPC_SERVICES.POST]: {
|
|
45
|
-
package: 'volontariapp.post',
|
|
46
|
-
protoFileName: 'post.services.proto',
|
|
47
|
-
domain: 'post',
|
|
48
|
-
},
|
|
49
|
-
[GRPC_SERVICES.EVENT]: {
|
|
50
|
-
package: 'volontariapp.event',
|
|
51
|
-
protoFileName: 'event.services.proto',
|
|
52
|
-
domain: 'event',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
export const getGrpcOptions = (service, url) => {
|
|
56
|
-
const config = GRPC_SERVICES_CONFIG[service];
|
|
57
|
-
const protoRoot = join(__dirname, '../proto');
|
|
58
|
-
logger.info(`Generating gRPC options for ${service} at ${url}`);
|
|
59
|
-
return {
|
|
60
|
-
transport: Transport.GRPC,
|
|
61
|
-
options: {
|
|
62
|
-
url,
|
|
63
|
-
package: config.package,
|
|
64
|
-
protoPath: join(protoRoot, `volontariapp/${config.domain}/${config.protoFileName}`),
|
|
65
|
-
loader: {
|
|
66
|
-
keepCase: true,
|
|
67
|
-
longs: String,
|
|
68
|
-
enums: String,
|
|
69
|
-
defaults: true,
|
|
70
|
-
oneofs: true,
|
|
71
|
-
includeDirs: [protoRoot],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=grpc.helper.js.map
|
package/dist/grpc.helper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grpc.helper.js","sourceRoot":"","sources":["../src/grpc.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAErE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,gCAAe,CAAA;AACjB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,yCAAoB,CAAA;IACpB,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAC1B,+CAA0B,CAAA;IAC1B,+CAA0B,CAAA;AAC5B,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,QAM5B;AAED,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,yCAAoB,CAAA;IACpB,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAC1B,+CAA0B,CAAA;IAC1B,+CAA0B,CAAA;AAC5B,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,QAM5B;AAED,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,4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CAAC;aACzB;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { CreatePostCommand, DeletePostCommand, UpdatePostCommand } from "./post.command.js";
|
|
3
|
-
import { ListPostsQuery, PostQuery } from "./post.query.js";
|
|
4
|
-
import { CreatePostResponse, DeletePostResponse, GetPostResponse, ListPostsResponse, UpdatePostResponse } from "./post.responses.js";
|
|
5
|
-
export interface PostServiceClient {
|
|
6
|
-
getPost(request: PostQuery): Observable<GetPostResponse>;
|
|
7
|
-
listPosts(request: ListPostsQuery): Observable<ListPostsResponse>;
|
|
8
|
-
createPost(request: CreatePostCommand): Observable<CreatePostResponse>;
|
|
9
|
-
updatePost(request: UpdatePostCommand): Observable<UpdatePostResponse>;
|
|
10
|
-
deletePost(request: DeletePostCommand): Observable<DeletePostResponse>;
|
|
11
|
-
}
|
|
12
|
-
export interface PostServiceController {
|
|
13
|
-
getPost(request: PostQuery): Promise<GetPostResponse> | Observable<GetPostResponse> | GetPostResponse;
|
|
14
|
-
listPosts(request: ListPostsQuery): Promise<ListPostsResponse> | Observable<ListPostsResponse> | ListPostsResponse;
|
|
15
|
-
createPost(request: CreatePostCommand): Promise<CreatePostResponse> | Observable<CreatePostResponse> | CreatePostResponse;
|
|
16
|
-
updatePost(request: UpdatePostCommand): Promise<UpdatePostResponse> | Observable<UpdatePostResponse> | UpdatePostResponse;
|
|
17
|
-
deletePost(request: DeletePostCommand): Promise<DeletePostResponse> | Observable<DeletePostResponse> | DeletePostResponse;
|
|
18
|
-
}
|
|
19
|
-
export declare function PostServiceControllerMethods(): (constructor: Function) => void;
|
|
20
|
-
export declare const POST_SERVICE_NAME = "PostService";
|
|
21
|
-
//# sourceMappingURL=post.services.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post.services.d.ts","sourceRoot":"","sources":["../../src/post/post.services.ts"],"names":[],"mappings":"AAQA,OAA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OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;CACtF;AAED,wBAAgB,4BAA4B,kBACZ,QAAQ,UAYvC;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
2
|
-
export function PostServiceControllerMethods() {
|
|
3
|
-
return function (constructor) {
|
|
4
|
-
const grpcMethods = ["getPost", "listPosts", "createPost", "updatePost", "deletePost"];
|
|
5
|
-
for (const method of grpcMethods) {
|
|
6
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
7
|
-
GrpcMethod("PostService", method)(constructor.prototype[method], method, descriptor);
|
|
8
|
-
}
|
|
9
|
-
const grpcStreamMethods = [];
|
|
10
|
-
for (const method of grpcStreamMethods) {
|
|
11
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
12
|
-
GrpcStreamMethod("PostService", method)(constructor.prototype[method], method, descriptor);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export const POST_SERVICE_NAME = "PostService";
|
|
17
|
-
//# sourceMappingURL=post.services.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post.services.js","sourceRoot":"","sources":["../../src/post/post.services.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA0CrE,MAAM,UAAU,4BAA4B;IAC1C,OAAO,UAAU,WAAqB;QACpC,MAAM,WAAW,GAAa,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QACjG,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,aAAa,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACvF,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,aAAa,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { CreateUserCommand, DeleteUserCommand, UpdateUserCommand } from "./user.command.js";
|
|
3
|
-
import { ListUsersQuery, UserQuery } from "./user.query.js";
|
|
4
|
-
import { CreateUserResponse, DeleteUserResponse, GetUserResponse, ListUsersResponse, UpdateUserResponse } from "./user.responses.js";
|
|
5
|
-
export interface UserServiceClient {
|
|
6
|
-
getUser(request: UserQuery): Observable<GetUserResponse>;
|
|
7
|
-
listUsers(request: ListUsersQuery): Observable<ListUsersResponse>;
|
|
8
|
-
createUser(request: CreateUserCommand): Observable<CreateUserResponse>;
|
|
9
|
-
updateUser(request: UpdateUserCommand): Observable<UpdateUserResponse>;
|
|
10
|
-
deleteUser(request: DeleteUserCommand): Observable<DeleteUserResponse>;
|
|
11
|
-
}
|
|
12
|
-
export interface UserServiceController {
|
|
13
|
-
getUser(request: UserQuery): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
|
|
14
|
-
listUsers(request: ListUsersQuery): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
|
|
15
|
-
createUser(request: CreateUserCommand): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
16
|
-
updateUser(request: UpdateUserCommand): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
|
|
17
|
-
deleteUser(request: DeleteUserCommand): Promise<DeleteUserResponse> | Observable<DeleteUserResponse> | DeleteUserResponse;
|
|
18
|
-
}
|
|
19
|
-
export declare function UserServiceControllerMethods(): (constructor: Function) => void;
|
|
20
|
-
export declare const USER_SERVICE_NAME = "UserService";
|
|
21
|
-
//# sourceMappingURL=user.services.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.services.d.ts","sourceRoot":"","sources":["../../src/user/user.services.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAEzD,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAElE,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAEvE,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAEvE,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;IAEtG,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;IAEnH,UAAU,CACR,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IAErF,UAAU,CACR,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IAErF,UAAU,CACR,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;CACtF;AAED,wBAAgB,4BAA4B,kBACZ,QAAQ,UAYvC;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
2
|
-
export function UserServiceControllerMethods() {
|
|
3
|
-
return function (constructor) {
|
|
4
|
-
const grpcMethods = ["getUser", "listUsers", "createUser", "updateUser", "deleteUser"];
|
|
5
|
-
for (const method of grpcMethods) {
|
|
6
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
7
|
-
GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
8
|
-
}
|
|
9
|
-
const grpcStreamMethods = [];
|
|
10
|
-
for (const method of grpcStreamMethods) {
|
|
11
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
12
|
-
GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export const USER_SERVICE_NAME = "UserService";
|
|
17
|
-
//# sourceMappingURL=user.services.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.services.js","sourceRoot":"","sources":["../../src/user/user.services.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA0CrE,MAAM,UAAU,4BAA4B;IAC1C,OAAO,UAAU,WAAqB;QACpC,MAAM,WAAW,GAAa,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QACjG,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,aAAa,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACvF,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,aAAa,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.common;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
message PaginationRequest {
|
|
7
|
-
int32 page = 1;
|
|
8
|
-
int32 limit = 2;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
message PaginationResponse {
|
|
12
|
-
int32 total = 1;
|
|
13
|
-
int32 page = 2;
|
|
14
|
-
int32 limit = 3;
|
|
15
|
-
int32 total_pages = 4;
|
|
16
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.event;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/timestamp.proto";
|
|
6
|
-
|
|
7
|
-
message CreateEventCommand {
|
|
8
|
-
string title = 1;
|
|
9
|
-
string description = 2;
|
|
10
|
-
google.protobuf.Timestamp start_date = 3;
|
|
11
|
-
google.protobuf.Timestamp end_date = 4;
|
|
12
|
-
string location = 5;
|
|
13
|
-
string organizer_id = 6;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
message UpdateEventCommand {
|
|
17
|
-
string id = 1;
|
|
18
|
-
optional string title = 2;
|
|
19
|
-
optional string description = 3;
|
|
20
|
-
optional google.protobuf.Timestamp start_date = 4;
|
|
21
|
-
optional google.protobuf.Timestamp end_date = 5;
|
|
22
|
-
optional string location = 6;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
message DeleteEventCommand {
|
|
26
|
-
string id = 1;
|
|
27
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.event;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/timestamp.proto";
|
|
6
|
-
|
|
7
|
-
message Event {
|
|
8
|
-
string id = 1;
|
|
9
|
-
string title = 2;
|
|
10
|
-
string description = 3;
|
|
11
|
-
google.protobuf.Timestamp start_date = 4;
|
|
12
|
-
google.protobuf.Timestamp end_date = 5;
|
|
13
|
-
string location = 6;
|
|
14
|
-
string organizer_id = 7;
|
|
15
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.event;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/common/pagination.proto";
|
|
6
|
-
import "volontariapp/event/event.proto";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
message GetEventResponse {
|
|
12
|
-
Event event = 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message CreateEventResponse {
|
|
16
|
-
Event event = 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message UpdateEventResponse {
|
|
20
|
-
Event event = 1;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
message ListEventsResponse {
|
|
24
|
-
repeated Event events = 1;
|
|
25
|
-
volontariapp.common.PaginationResponse pagination = 2;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
message DeleteEventResponse {
|
|
29
|
-
bool success = 1;
|
|
30
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.event;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/event/event.query.proto";
|
|
6
|
-
import "volontariapp/event/event.command.proto";
|
|
7
|
-
import "volontariapp/event/event.responses.proto";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
service EventService {
|
|
11
|
-
rpc GetEvent (EventQuery) returns (GetEventResponse) {}
|
|
12
|
-
rpc ListEvents (ListEventsQuery) returns (ListEventsResponse) {}
|
|
13
|
-
rpc CreateEvent (CreateEventCommand) returns (CreateEventResponse) {}
|
|
14
|
-
rpc UpdateEvent (UpdateEventCommand) returns (UpdateEventResponse) {}
|
|
15
|
-
rpc DeleteEvent (DeleteEventCommand) returns (DeleteEventResponse) {}
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.post;
|
|
4
|
-
|
|
5
|
-
message CreatePostCommand {
|
|
6
|
-
string author_id = 1;
|
|
7
|
-
string title = 2;
|
|
8
|
-
string content = 3;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
message UpdatePostCommand {
|
|
12
|
-
string id = 1;
|
|
13
|
-
optional string title = 2;
|
|
14
|
-
optional string content = 3;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
message DeletePostCommand {
|
|
18
|
-
string id = 1;
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.post;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/common/pagination.proto";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
message PostQuery {
|
|
9
|
-
string id = 1;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
message ListPostsQuery {
|
|
13
|
-
volontariapp.common.PaginationRequest pagination = 1;
|
|
14
|
-
optional string author_id = 2;
|
|
15
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.post;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/common/pagination.proto";
|
|
6
|
-
import "volontariapp/post/post.proto";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
message GetPostResponse {
|
|
10
|
-
Post post = 1;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
message CreatePostResponse {
|
|
14
|
-
Post post = 1;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
message UpdatePostResponse {
|
|
18
|
-
Post post = 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message ListPostsResponse {
|
|
22
|
-
repeated Post posts = 1;
|
|
23
|
-
volontariapp.common.PaginationResponse pagination = 2;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
message DeletePostResponse {
|
|
27
|
-
bool success = 1;
|
|
28
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.post;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/post/post.query.proto";
|
|
6
|
-
import "volontariapp/post/post.command.proto";
|
|
7
|
-
import "volontariapp/post/post.responses.proto";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
service PostService {
|
|
12
|
-
rpc GetPost (PostQuery) returns (GetPostResponse) {}
|
|
13
|
-
rpc ListPosts (ListPostsQuery) returns (ListPostsResponse) {}
|
|
14
|
-
rpc CreatePost (CreatePostCommand) returns (CreatePostResponse) {}
|
|
15
|
-
rpc UpdatePost (UpdatePostCommand) returns (UpdatePostResponse) {}
|
|
16
|
-
rpc DeletePost (DeletePostCommand) returns (DeletePostResponse) {}
|
|
17
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.user;
|
|
4
|
-
|
|
5
|
-
message CreateUserCommand {
|
|
6
|
-
string email = 1;
|
|
7
|
-
string first_name = 2;
|
|
8
|
-
string last_name = 3;
|
|
9
|
-
string password = 4;
|
|
10
|
-
string role = 5;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
message UpdateUserCommand {
|
|
14
|
-
string id = 1;
|
|
15
|
-
optional string email = 2;
|
|
16
|
-
optional string first_name = 3;
|
|
17
|
-
optional string last_name = 4;
|
|
18
|
-
optional string role = 5;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message DeleteUserCommand {
|
|
22
|
-
string id = 1;
|
|
23
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.user;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/common/pagination.proto";
|
|
6
|
-
import "volontariapp/user/user.proto";
|
|
7
|
-
|
|
8
|
-
message GetUserResponse {
|
|
9
|
-
User user = 1;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
message CreateUserResponse {
|
|
13
|
-
User user = 1;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
message UpdateUserResponse {
|
|
17
|
-
User user = 1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
message ListUsersResponse {
|
|
21
|
-
repeated User users = 1;
|
|
22
|
-
volontariapp.common.PaginationResponse pagination = 2;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
message DeleteUserResponse {
|
|
26
|
-
bool success = 1;
|
|
27
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package volontariapp.user;
|
|
4
|
-
|
|
5
|
-
import "volontariapp/user/user.query.proto";
|
|
6
|
-
import "volontariapp/user/user.command.proto";
|
|
7
|
-
import "volontariapp/user/user.responses.proto";
|
|
8
|
-
|
|
9
|
-
service UserService {
|
|
10
|
-
rpc GetUser (UserQuery) returns (GetUserResponse) {}
|
|
11
|
-
rpc ListUsers (ListUsersQuery) returns (ListUsersResponse) {}
|
|
12
|
-
rpc CreateUser (CreateUserCommand) returns (CreateUserResponse) {}
|
|
13
|
-
rpc UpdateUser (UpdateUserCommand) returns (UpdateUserResponse) {}
|
|
14
|
-
rpc DeleteUser (DeleteUserCommand) returns (DeleteUserResponse) {}
|
|
15
|
-
}
|