@volontariapp/contracts 0.0.0-20260324142521

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/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@volontariapp/contracts",
3
+ "version": "0.0.0-20260324142521",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "provenance": true
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Volontariapp/npm-packages.git"
11
+ },
12
+ "description": "",
13
+ "license": "UNLICENSED",
14
+ "type": "module",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "proto"
26
+ ],
27
+ "engines": {
28
+ "node": ">=24.14.0"
29
+ },
30
+ "scripts": {
31
+ "build": "yarn fix-esm && tsc -p tsconfig.json",
32
+ "fix-esm": "node scripts/fix-esm.mjs",
33
+ "lint": "eslint src/",
34
+ "dev:sync-proto": "rm -rf proto && ln -s ../../../proto-registry/proto ./proto",
35
+ "test": "echo \"No tests yet\""
36
+ },
37
+ "devDependencies": {
38
+ "@nestjs/common": "^11.0.1",
39
+ "@nestjs/core": "^11.0.1",
40
+ "@nestjs/microservices": "^11.1.14",
41
+ "reflect-metadata": "^0.2.2",
42
+ "rxjs": "^7.8.2",
43
+ "typescript": "5.7.3"
44
+ },
45
+ "peerDependencies": {
46
+ "@nestjs/microservices": "^11.0.0",
47
+ "rxjs": "^7.0.0"
48
+ },
49
+ "dependencies": {
50
+ "protobufjs": "7.5.3"
51
+ }
52
+ }
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.common;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+
7
+
8
+ message DateRange {
9
+ google.protobuf.Timestamp start = 1;
10
+ google.protobuf.Timestamp end = 2;
11
+ }
@@ -0,0 +1,27 @@
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
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,13 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.event;
4
+
5
+ import "volontariapp/common/pagination.proto";
6
+
7
+ message EventQuery {
8
+ string id = 1;
9
+ }
10
+
11
+ message ListEventsQuery {
12
+ volontariapp.common.PaginationRequest pagination = 1;
13
+ }
@@ -0,0 +1,30 @@
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
+ }
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.post;
4
+
5
+
6
+ message Post {
7
+ string id = 1;
8
+ string author_id = 2;
9
+ string title = 3;
10
+ string content = 4;
11
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,23 @@
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
+ }
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.user;
4
+
5
+ message User {
6
+ string id = 1;
7
+ string email = 2;
8
+ string first_name = 3;
9
+ string last_name = 4;
10
+ string role = 5;
11
+ }
@@ -0,0 +1,13 @@
1
+ syntax = "proto3";
2
+
3
+ package volontariapp.user;
4
+
5
+ import "volontariapp/common/pagination.proto";
6
+
7
+ message UserQuery {
8
+ string id = 1;
9
+ }
10
+
11
+ message ListUsersQuery {
12
+ volontariapp.common.PaginationRequest pagination = 1;
13
+ }
@@ -0,0 +1,27 @@
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
+ }
@@ -0,0 +1,15 @@
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
+ }