@miteradar/contracts 1.3.1 → 1.7.1

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.
@@ -0,0 +1,2 @@
1
+ export declare const BITE_IMPORT_MAX_BYTES: number;
2
+ export declare const BITE_IMPORT_MAX_ROWS = 10000;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BITE_IMPORT_MAX_ROWS = exports.BITE_IMPORT_MAX_BYTES = void 0;
4
+ exports.BITE_IMPORT_MAX_BYTES = 3 * 1024 * 1024;
5
+ exports.BITE_IMPORT_MAX_ROWS = 10_000;
@@ -1,5 +1,7 @@
1
1
  import { Observable } from "rxjs";
2
+ import { Timestamp } from "./google/protobuf/timestamp";
2
3
  export declare const protobufPackage = "auth.v1";
4
+ export declare const protobufFileName = "auth.proto";
3
5
  export declare enum Role {
4
6
  ADMIN = 0,
5
7
  MODERATOR = 1,
@@ -9,7 +11,10 @@ export declare enum Role {
9
11
  export interface RegisterRequest {
10
12
  login: string;
11
13
  password: string;
12
- role: Role;
14
+ }
15
+ export interface RegisterResponse {
16
+ id: string;
17
+ login: string;
13
18
  }
14
19
  export interface LoginRequest {
15
20
  login: string;
@@ -29,19 +34,65 @@ export interface GetAccountResponse {
29
34
  id: string;
30
35
  login: string;
31
36
  role: Role;
37
+ isVerified: boolean;
38
+ }
39
+ export interface UserItem {
40
+ id: string;
41
+ login: string;
42
+ role: Role;
43
+ isVerified: boolean;
44
+ createdAt: Timestamp | undefined;
45
+ }
46
+ export interface ListUsersRequest {
47
+ search?: string | undefined;
48
+ role?: Role | undefined;
49
+ isVerified?: boolean | undefined;
50
+ page?: number | undefined;
51
+ pageSize?: number | undefined;
52
+ }
53
+ export interface ListUsersResponse {
54
+ items: UserItem[];
55
+ total: number;
56
+ page: number;
57
+ pageSize: number;
58
+ }
59
+ export interface CreateUserRequest {
60
+ login: string;
61
+ password: string;
62
+ role: Role;
63
+ }
64
+ export interface UpdateUserRequest {
65
+ id: string;
66
+ role?: Role | undefined;
67
+ isVerified?: boolean | undefined;
68
+ password?: string | undefined;
69
+ }
70
+ export interface DeleteUserRequest {
71
+ id: string;
72
+ }
73
+ export interface DeleteUserResponse {
74
+ success: boolean;
32
75
  }
33
76
  export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
34
77
  export interface AuthServiceClient {
35
78
  login(request: LoginRequest): Observable<TokensResponse>;
36
- register(request: RegisterRequest): Observable<TokensResponse>;
79
+ register(request: RegisterRequest): Observable<RegisterResponse>;
37
80
  refresh(request: RefreshRequest): Observable<TokensResponse>;
38
81
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
82
+ listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
83
+ createUser(request: CreateUserRequest): Observable<UserItem>;
84
+ updateUser(request: UpdateUserRequest): Observable<UserItem>;
85
+ deleteUser(request: DeleteUserRequest): Observable<DeleteUserResponse>;
39
86
  }
40
87
  export interface AuthServiceController {
41
88
  login(request: LoginRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
42
- register(request: RegisterRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
89
+ register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
43
90
  refresh(request: RefreshRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
44
91
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
92
+ listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
93
+ createUser(request: CreateUserRequest): Promise<UserItem> | Observable<UserItem> | UserItem;
94
+ updateUser(request: UpdateUserRequest): Promise<UserItem> | Observable<UserItem> | UserItem;
95
+ deleteUser(request: DeleteUserRequest): Promise<DeleteUserResponse> | Observable<DeleteUserResponse> | DeleteUserResponse;
45
96
  }
46
97
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
47
98
  export declare const AUTH_SERVICE_NAME = "AuthService";
package/dist/gen/auth.js CHANGED
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.12.4
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.Role = exports.protobufPackage = void 0;
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.Role = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
12
  exports.protobufPackage = "auth.v1";
13
+ exports.protobufFileName = "auth.proto";
13
14
  var Role;
14
15
  (function (Role) {
15
16
  Role[Role["ADMIN"] = 0] = "ADMIN";
@@ -20,7 +21,16 @@ var Role;
20
21
  exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
21
22
  function AuthServiceControllerMethods() {
22
23
  return function (constructor) {
23
- const grpcMethods = ["login", "register", "refresh", "getAccount"];
24
+ const grpcMethods = [
25
+ "login",
26
+ "register",
27
+ "refresh",
28
+ "getAccount",
29
+ "listUsers",
30
+ "createUser",
31
+ "updateUser",
32
+ "deleteUser",
33
+ ];
24
34
  for (const method of grpcMethods) {
25
35
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
26
36
  (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -1,6 +1,29 @@
1
1
  import { Observable } from "rxjs";
2
2
  import { Timestamp } from "./google/protobuf/timestamp";
3
3
  export declare const protobufPackage = "bites.v1";
4
+ export declare const protobufFileName = "bite.proto";
5
+ export declare enum Infections {
6
+ TBE = 0,
7
+ BORRELIOSIS = 1,
8
+ EHRLICHIOSIS = 2,
9
+ ANAPLASMOSIS = 3,
10
+ RICKETTSIOSIS = 4,
11
+ RELAPSING_FEVER = 5,
12
+ UNRECOGNIZED = -1
13
+ }
14
+ export declare enum TestResults {
15
+ NOT_TESTED = 0,
16
+ NEGATIVE = 1,
17
+ POSITIVE = 2,
18
+ UNRECOGNIZED = -1
19
+ }
20
+ export declare enum ReferenceKinds {
21
+ DISTRICT = 0,
22
+ PLACE = 1,
23
+ MATERIAL = 2,
24
+ MITE = 3,
25
+ UNRECOGNIZED = -1
26
+ }
4
27
  export declare enum HumanGenders {
5
28
  HUMAN_FEMALE = 0,
6
29
  HUMAN_MALE = 1,
@@ -14,9 +37,23 @@ export declare enum MiteGenders {
14
37
  LARVA = 4,
15
38
  UNRECOGNIZED = -1
16
39
  }
40
+ export interface ImportBitesRequest {
41
+ file: Uint8Array;
42
+ }
43
+ export interface BiteImportError {
44
+ row: number;
45
+ message: string;
46
+ }
47
+ export interface ImportBitesResponse {
48
+ total: number;
49
+ imported: number;
50
+ skipped: number;
51
+ failed: number;
52
+ errors: BiteImportError[];
53
+ }
17
54
  export interface CreateBiteRequest {
18
55
  externalId?: string | undefined;
19
- code: string;
56
+ code?: string | undefined;
20
57
  requestDate: Timestamp | undefined;
21
58
  biteDate?: Timestamp | undefined;
22
59
  circumstances?: string | undefined;
@@ -57,6 +94,11 @@ export interface ListBitesRequest {
57
94
  requestDateTo?: Timestamp | undefined;
58
95
  districtId?: string | undefined;
59
96
  isVerified?: boolean | undefined;
97
+ placeSearch?: string | undefined;
98
+ materialId?: string | undefined;
99
+ miteId?: string | undefined;
100
+ testResult?: TestResults | undefined;
101
+ infection?: Infections | undefined;
60
102
  }
61
103
  export interface UpdateBiteRequest {
62
104
  id: string;
@@ -112,7 +154,13 @@ export interface GetBitesGeoDataRequest {
112
154
  longitudeTo?: number | undefined;
113
155
  latitudeFrom?: number | undefined;
114
156
  latitudeTo?: number | undefined;
115
- zoom?: number | undefined;
157
+ requestDateFrom?: Timestamp | undefined;
158
+ requestDateTo?: Timestamp | undefined;
159
+ districtId?: string | undefined;
160
+ materialId?: string | undefined;
161
+ miteId?: string | undefined;
162
+ testResult?: TestResults | undefined;
163
+ infection?: Infections | undefined;
116
164
  }
117
165
  export interface GetBitesGeoDataResponse {
118
166
  bites: BiteGeoData[];
@@ -123,6 +171,24 @@ export interface BiteGeoData {
123
171
  latitude: number;
124
172
  count: number;
125
173
  }
174
+ export interface GetPlaceSummaryRequest {
175
+ placeId: string;
176
+ }
177
+ export interface GetPlaceSummaryResponse {
178
+ placeId: string;
179
+ count: number;
180
+ district?: string | undefined;
181
+ place?: string | undefined;
182
+ lastBiteDate?: Timestamp | undefined;
183
+ material?: string | undefined;
184
+ mite?: string | undefined;
185
+ testResult: TestResults;
186
+ }
187
+ export interface ListPlaceBitesRequest {
188
+ placeId: string;
189
+ page?: number | undefined;
190
+ pageSize?: number | undefined;
191
+ }
126
192
  export interface ListReferencesRequest {
127
193
  search?: string | undefined;
128
194
  }
@@ -133,10 +199,43 @@ export interface Reference {
133
199
  id: string;
134
200
  name: string;
135
201
  }
202
+ export interface ReferenceItem {
203
+ id: string;
204
+ name: string;
205
+ bitesCount: number;
206
+ }
207
+ export interface ListReferencePageRequest {
208
+ kind: ReferenceKinds;
209
+ search?: string | undefined;
210
+ page?: number | undefined;
211
+ pageSize?: number | undefined;
212
+ }
213
+ export interface ListReferencePageResponse {
214
+ items: ReferenceItem[];
215
+ total: number;
216
+ page: number;
217
+ pageSize: number;
218
+ }
219
+ export interface CreateReferenceRequest {
220
+ kind: ReferenceKinds;
221
+ name: string;
222
+ }
223
+ export interface UpdateReferenceRequest {
224
+ kind: ReferenceKinds;
225
+ id: string;
226
+ name: string;
227
+ }
228
+ export interface DeleteReferenceRequest {
229
+ kind: ReferenceKinds;
230
+ id: string;
231
+ }
232
+ export interface DeleteReferenceResponse {
233
+ success: boolean;
234
+ }
136
235
  export interface Bite {
137
236
  id: string;
138
237
  externalId?: string | undefined;
139
- code: string;
238
+ code?: string | undefined;
140
239
  requestDate: Timestamp | undefined;
141
240
  biteDate?: Timestamp | undefined;
142
241
  circumstances?: string | undefined;
@@ -171,28 +270,42 @@ export interface Bite {
171
270
  }
172
271
  export declare const BITES_V1_PACKAGE_NAME = "bites.v1";
173
272
  export interface BiteServiceClient {
273
+ importBites(request: ImportBitesRequest): Observable<ImportBitesResponse>;
174
274
  createBite(request: CreateBiteRequest): Observable<BiteResponse>;
175
275
  getBite(request: GetBiteRequest): Observable<BiteResponse>;
176
276
  listBites(request: ListBitesRequest): Observable<ListBitesResponse>;
177
277
  updateBite(request: UpdateBiteRequest): Observable<BiteResponse>;
178
278
  deleteBite(request: DeleteBiteRequest): Observable<DeleteBiteResponse>;
179
279
  getBitesGeoData(request: GetBitesGeoDataRequest): Observable<GetBitesGeoDataResponse>;
280
+ getPlaceSummary(request: GetPlaceSummaryRequest): Observable<GetPlaceSummaryResponse>;
281
+ listPlaceBites(request: ListPlaceBitesRequest): Observable<ListBitesResponse>;
180
282
  listDistricts(request: ListReferencesRequest): Observable<ListReferencesResponse>;
181
283
  listPlaces(request: ListReferencesRequest): Observable<ListReferencesResponse>;
182
284
  listMaterials(request: ListReferencesRequest): Observable<ListReferencesResponse>;
183
285
  listMites(request: ListReferencesRequest): Observable<ListReferencesResponse>;
286
+ listReferencePage(request: ListReferencePageRequest): Observable<ListReferencePageResponse>;
287
+ createReference(request: CreateReferenceRequest): Observable<ReferenceItem>;
288
+ updateReference(request: UpdateReferenceRequest): Observable<ReferenceItem>;
289
+ deleteReference(request: DeleteReferenceRequest): Observable<DeleteReferenceResponse>;
184
290
  }
185
291
  export interface BiteServiceController {
292
+ importBites(request: ImportBitesRequest): Promise<ImportBitesResponse> | Observable<ImportBitesResponse> | ImportBitesResponse;
186
293
  createBite(request: CreateBiteRequest): Promise<BiteResponse> | Observable<BiteResponse> | BiteResponse;
187
294
  getBite(request: GetBiteRequest): Promise<BiteResponse> | Observable<BiteResponse> | BiteResponse;
188
295
  listBites(request: ListBitesRequest): Promise<ListBitesResponse> | Observable<ListBitesResponse> | ListBitesResponse;
189
296
  updateBite(request: UpdateBiteRequest): Promise<BiteResponse> | Observable<BiteResponse> | BiteResponse;
190
297
  deleteBite(request: DeleteBiteRequest): Promise<DeleteBiteResponse> | Observable<DeleteBiteResponse> | DeleteBiteResponse;
191
298
  getBitesGeoData(request: GetBitesGeoDataRequest): Promise<GetBitesGeoDataResponse> | Observable<GetBitesGeoDataResponse> | GetBitesGeoDataResponse;
299
+ getPlaceSummary(request: GetPlaceSummaryRequest): Promise<GetPlaceSummaryResponse> | Observable<GetPlaceSummaryResponse> | GetPlaceSummaryResponse;
300
+ listPlaceBites(request: ListPlaceBitesRequest): Promise<ListBitesResponse> | Observable<ListBitesResponse> | ListBitesResponse;
192
301
  listDistricts(request: ListReferencesRequest): Promise<ListReferencesResponse> | Observable<ListReferencesResponse> | ListReferencesResponse;
193
302
  listPlaces(request: ListReferencesRequest): Promise<ListReferencesResponse> | Observable<ListReferencesResponse> | ListReferencesResponse;
194
303
  listMaterials(request: ListReferencesRequest): Promise<ListReferencesResponse> | Observable<ListReferencesResponse> | ListReferencesResponse;
195
304
  listMites(request: ListReferencesRequest): Promise<ListReferencesResponse> | Observable<ListReferencesResponse> | ListReferencesResponse;
305
+ listReferencePage(request: ListReferencePageRequest): Promise<ListReferencePageResponse> | Observable<ListReferencePageResponse> | ListReferencePageResponse;
306
+ createReference(request: CreateReferenceRequest): Promise<ReferenceItem> | Observable<ReferenceItem> | ReferenceItem;
307
+ updateReference(request: UpdateReferenceRequest): Promise<ReferenceItem> | Observable<ReferenceItem> | ReferenceItem;
308
+ deleteReference(request: DeleteReferenceRequest): Promise<DeleteReferenceResponse> | Observable<DeleteReferenceResponse> | DeleteReferenceResponse;
196
309
  }
197
310
  export declare function BiteServiceControllerMethods(): (constructor: Function) => void;
198
311
  export declare const BITE_SERVICE_NAME = "BiteService";
package/dist/gen/bite.js CHANGED
@@ -1,15 +1,41 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.12.4
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: bite.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.BITE_SERVICE_NAME = exports.BITES_V1_PACKAGE_NAME = exports.MiteGenders = exports.HumanGenders = exports.protobufPackage = void 0;
8
+ exports.BITE_SERVICE_NAME = exports.BITES_V1_PACKAGE_NAME = exports.MiteGenders = exports.HumanGenders = exports.ReferenceKinds = exports.TestResults = exports.Infections = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  exports.BiteServiceControllerMethods = BiteServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
12
  exports.protobufPackage = "bites.v1";
13
+ exports.protobufFileName = "bite.proto";
14
+ var Infections;
15
+ (function (Infections) {
16
+ Infections[Infections["TBE"] = 0] = "TBE";
17
+ Infections[Infections["BORRELIOSIS"] = 1] = "BORRELIOSIS";
18
+ Infections[Infections["EHRLICHIOSIS"] = 2] = "EHRLICHIOSIS";
19
+ Infections[Infections["ANAPLASMOSIS"] = 3] = "ANAPLASMOSIS";
20
+ Infections[Infections["RICKETTSIOSIS"] = 4] = "RICKETTSIOSIS";
21
+ Infections[Infections["RELAPSING_FEVER"] = 5] = "RELAPSING_FEVER";
22
+ Infections[Infections["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
23
+ })(Infections || (exports.Infections = Infections = {}));
24
+ var TestResults;
25
+ (function (TestResults) {
26
+ TestResults[TestResults["NOT_TESTED"] = 0] = "NOT_TESTED";
27
+ TestResults[TestResults["NEGATIVE"] = 1] = "NEGATIVE";
28
+ TestResults[TestResults["POSITIVE"] = 2] = "POSITIVE";
29
+ TestResults[TestResults["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
30
+ })(TestResults || (exports.TestResults = TestResults = {}));
31
+ var ReferenceKinds;
32
+ (function (ReferenceKinds) {
33
+ ReferenceKinds[ReferenceKinds["DISTRICT"] = 0] = "DISTRICT";
34
+ ReferenceKinds[ReferenceKinds["PLACE"] = 1] = "PLACE";
35
+ ReferenceKinds[ReferenceKinds["MATERIAL"] = 2] = "MATERIAL";
36
+ ReferenceKinds[ReferenceKinds["MITE"] = 3] = "MITE";
37
+ ReferenceKinds[ReferenceKinds["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
38
+ })(ReferenceKinds || (exports.ReferenceKinds = ReferenceKinds = {}));
13
39
  var HumanGenders;
14
40
  (function (HumanGenders) {
15
41
  HumanGenders[HumanGenders["HUMAN_FEMALE"] = 0] = "HUMAN_FEMALE";
@@ -29,16 +55,23 @@ exports.BITES_V1_PACKAGE_NAME = "bites.v1";
29
55
  function BiteServiceControllerMethods() {
30
56
  return function (constructor) {
31
57
  const grpcMethods = [
58
+ "importBites",
32
59
  "createBite",
33
60
  "getBite",
34
61
  "listBites",
35
62
  "updateBite",
36
63
  "deleteBite",
37
64
  "getBitesGeoData",
65
+ "getPlaceSummary",
66
+ "listPlaceBites",
38
67
  "listDistricts",
39
68
  "listPlaces",
40
69
  "listMaterials",
41
70
  "listMites",
71
+ "listReferencePage",
72
+ "createReference",
73
+ "updateReference",
74
+ "deleteReference",
42
75
  ];
43
76
  for (const method of grpcMethods) {
44
77
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -1,4 +1,5 @@
1
1
  export declare const protobufPackage = "google.protobuf";
2
+ export declare const protobufFileName = "google/protobuf/timestamp.proto";
2
3
  /**
3
4
  * A Timestamp represents a point in time independent of any time zone or local
4
5
  * calendar, encoded as a count of seconds and fractions of seconds at
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.12.4
4
+ // protoc-gen-ts_proto v2.18.3
5
5
  // protoc v3.21.12
6
6
  // source: google/protobuf/timestamp.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  exports.protobufPackage = "google.protobuf";
11
+ exports.protobufFileName = "google/protobuf/timestamp.proto";
11
12
  exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -1,4 +1,5 @@
1
- export * from './auth';
1
+ export { AUTH_SERVICE_NAME, AUTH_V1_PACKAGE_NAME, AuthServiceControllerMethods, Role } from './auth';
2
+ export type { AuthServiceClient, AuthServiceController, CreateUserRequest, DeleteUserRequest, DeleteUserResponse, GetAccountRequest, GetAccountResponse, ListUsersRequest, ListUsersResponse, LoginRequest, RefreshRequest, RegisterRequest, RegisterResponse, TokensResponse, UpdateUserRequest, UserItem } from './auth';
2
3
  export * from './bite';
3
- export * from './google/protobuf/timestamp';
4
- export { protobufPackage } from './bite';
4
+ export { GOOGLE_PROTOBUF_PACKAGE_NAME } from './google/protobuf/timestamp';
5
+ export type { Timestamp } from './google/protobuf/timestamp';
package/dist/gen/index.js CHANGED
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.protobufPackage = void 0;
18
- __exportStar(require("./auth"), exports);
17
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.Role = exports.AuthServiceControllerMethods = exports.AUTH_V1_PACKAGE_NAME = exports.AUTH_SERVICE_NAME = void 0;
18
+ var auth_1 = require("./auth");
19
+ Object.defineProperty(exports, "AUTH_SERVICE_NAME", { enumerable: true, get: function () { return auth_1.AUTH_SERVICE_NAME; } });
20
+ Object.defineProperty(exports, "AUTH_V1_PACKAGE_NAME", { enumerable: true, get: function () { return auth_1.AUTH_V1_PACKAGE_NAME; } });
21
+ Object.defineProperty(exports, "AuthServiceControllerMethods", { enumerable: true, get: function () { return auth_1.AuthServiceControllerMethods; } });
22
+ Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return auth_1.Role; } });
19
23
  __exportStar(require("./bite"), exports);
20
- __exportStar(require("./google/protobuf/timestamp"), exports);
21
- // одноимённые константы есть в каждом сгенерированном модуле —
22
- // явный реэкспорт снимает неоднозначность star-экспортов при сборке деклараций
23
- var bite_1 = require("./bite");
24
- Object.defineProperty(exports, "protobufPackage", { enumerable: true, get: function () { return bite_1.protobufPackage; } });
24
+ var timestamp_1 = require("./google/protobuf/timestamp");
25
+ Object.defineProperty(exports, "GOOGLE_PROTOBUF_PACKAGE_NAME", { enumerable: true, get: function () { return timestamp_1.GOOGLE_PROTOBUF_PACKAGE_NAME; } });
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './proto';
2
2
  export * from './gen';
3
+ export * from './bite-import';
package/dist/index.js CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./proto"), exports);
18
18
  __exportStar(require("./gen"), exports);
19
+ __exportStar(require("./bite-import"), exports);
@@ -2,17 +2,30 @@ syntax = "proto3";
2
2
 
3
3
  package auth.v1;
4
4
 
5
+ import "google/protobuf/timestamp.proto";
6
+
5
7
  service AuthService {
6
8
  rpc Login(LoginRequest) returns(TokensResponse);
7
- rpc Register(RegisterRequest) returns(TokensResponse);
9
+ rpc Register(RegisterRequest) returns(RegisterResponse);
8
10
  rpc Refresh(RefreshRequest) returns(TokensResponse);
9
11
  rpc GetAccount(GetAccountRequest) returns(GetAccountResponse);
12
+
13
+ rpc ListUsers(ListUsersRequest) returns(ListUsersResponse);
14
+ rpc CreateUser(CreateUserRequest) returns(UserItem);
15
+ rpc UpdateUser(UpdateUserRequest) returns(UserItem);
16
+ rpc DeleteUser(DeleteUserRequest) returns(DeleteUserResponse);
10
17
  }
11
18
 
12
19
  message RegisterRequest {
13
20
  string login = 1;
14
21
  string password = 2;
15
- Role role = 3;
22
+
23
+ reserved 3;
24
+ }
25
+
26
+ message RegisterResponse {
27
+ string id = 1;
28
+ string login = 2;
16
29
  }
17
30
 
18
31
  message LoginRequest {
@@ -37,10 +50,58 @@ message GetAccountResponse {
37
50
  string id = 1;
38
51
  string login = 2;
39
52
  Role role = 3;
53
+ bool is_verified = 4;
40
54
  }
41
55
 
42
56
  enum Role {
43
57
  ADMIN = 0;
44
58
  MODERATOR = 1;
45
59
  USER = 2;
46
- }
60
+ }
61
+
62
+ message UserItem {
63
+ string id = 1;
64
+ string login = 2;
65
+ Role role = 3;
66
+
67
+ bool is_verified = 4;
68
+ google.protobuf.Timestamp created_at = 5;
69
+ }
70
+
71
+ message ListUsersRequest {
72
+
73
+ optional string search = 1;
74
+ optional Role role = 2;
75
+ optional bool is_verified = 3;
76
+ optional int32 page = 4;
77
+ optional int32 page_size = 5;
78
+ }
79
+
80
+ message ListUsersResponse {
81
+ repeated UserItem items = 1;
82
+ int32 total = 2;
83
+ int32 page = 3;
84
+ int32 page_size = 4;
85
+ }
86
+
87
+ message CreateUserRequest {
88
+ string login = 1;
89
+ string password = 2;
90
+ Role role = 3;
91
+ }
92
+
93
+ message UpdateUserRequest {
94
+ string id = 1;
95
+ optional Role role = 2;
96
+ optional bool is_verified = 3;
97
+
98
+ optional string password = 4;
99
+ }
100
+
101
+ message DeleteUserRequest {
102
+ string id = 1;
103
+ }
104
+
105
+ message DeleteUserResponse {
106
+ bool success = 1;
107
+ }
@@ -5,22 +5,47 @@ package bites.v1;
5
5
  import "google/protobuf/timestamp.proto";
6
6
 
7
7
  service BiteService {
8
+ rpc ImportBites(ImportBitesRequest) returns (ImportBitesResponse);
8
9
  rpc CreateBite(CreateBiteRequest) returns (BiteResponse);
9
10
  rpc GetBite(GetBiteRequest) returns (BiteResponse);
10
11
  rpc ListBites(ListBitesRequest) returns (ListBitesResponse);
11
12
  rpc UpdateBite(UpdateBiteRequest) returns (BiteResponse);
12
13
  rpc DeleteBite(DeleteBiteRequest) returns (DeleteBiteResponse);
13
14
  rpc GetBitesGeoData(GetBitesGeoDataRequest) returns (GetBitesGeoDataResponse);
15
+ rpc GetPlaceSummary(GetPlaceSummaryRequest) returns (GetPlaceSummaryResponse);
16
+ rpc ListPlaceBites(ListPlaceBitesRequest) returns (ListBitesResponse);
14
17
 
15
18
  rpc ListDistricts(ListReferencesRequest) returns (ListReferencesResponse);
16
19
  rpc ListPlaces(ListReferencesRequest) returns (ListReferencesResponse);
17
20
  rpc ListMaterials(ListReferencesRequest) returns (ListReferencesResponse);
18
21
  rpc ListMites(ListReferencesRequest) returns (ListReferencesResponse);
22
+
23
+ rpc ListReferencePage(ListReferencePageRequest) returns (ListReferencePageResponse);
24
+ rpc CreateReference(CreateReferenceRequest) returns (ReferenceItem);
25
+ rpc UpdateReference(UpdateReferenceRequest) returns (ReferenceItem);
26
+ rpc DeleteReference(DeleteReferenceRequest) returns (DeleteReferenceResponse);
27
+ }
28
+
29
+ message ImportBitesRequest {
30
+ bytes file = 1;
31
+ }
32
+
33
+ message BiteImportError {
34
+ uint32 row = 1;
35
+ string message = 2;
36
+ }
37
+
38
+ message ImportBitesResponse {
39
+ uint32 total = 1;
40
+ uint32 imported = 2;
41
+ uint32 skipped = 3;
42
+ uint32 failed = 4;
43
+ repeated BiteImportError errors = 5;
19
44
  }
20
45
 
21
46
  message CreateBiteRequest {
22
47
  optional string external_id = 1;
23
- string code = 2;
48
+ optional string code = 2;
24
49
  google.protobuf.Timestamp request_date = 3;
25
50
  optional google.protobuf.Timestamp bite_date = 4;
26
51
  optional string circumstances = 5;
@@ -63,6 +88,13 @@ message ListBitesRequest {
63
88
  optional google.protobuf.Timestamp request_date_to = 4;
64
89
  optional string district_id = 5;
65
90
  optional bool is_verified = 6;
91
+
92
+ optional string place_search = 7;
93
+ optional string material_id = 8;
94
+ optional string mite_id = 9;
95
+
96
+ optional TestResults test_result = 10;
97
+ optional Infections infection = 11;
66
98
  }
67
99
 
68
100
  message UpdateBiteRequest {
@@ -130,7 +162,14 @@ message GetBitesGeoDataRequest {
130
162
  optional double longitude_to = 3;
131
163
  optional double latitude_from = 4;
132
164
  optional double latitude_to = 5;
133
- optional double zoom = 6;
165
+ optional google.protobuf.Timestamp request_date_from = 6;
166
+ optional google.protobuf.Timestamp request_date_to = 7;
167
+ optional string district_id = 8;
168
+ optional string material_id = 9;
169
+ optional string mite_id = 10;
170
+
171
+ optional TestResults test_result = 11;
172
+ optional Infections infection = 12;
134
173
  }
135
174
 
136
175
  message GetBitesGeoDataResponse {
@@ -144,6 +183,42 @@ message BiteGeoData {
144
183
  uint32 count = 4;
145
184
  }
146
185
 
186
+ message GetPlaceSummaryRequest {
187
+ string place_id = 1;
188
+ }
189
+
190
+ message GetPlaceSummaryResponse {
191
+ string place_id = 1;
192
+ uint32 count = 2;
193
+ optional string district = 3;
194
+ optional string place = 4;
195
+ optional google.protobuf.Timestamp last_bite_date = 5;
196
+ optional string material = 6;
197
+ optional string mite = 7;
198
+ TestResults test_result = 8;
199
+ }
200
+
201
+ message ListPlaceBitesRequest {
202
+ string place_id = 1;
203
+ optional int32 page = 2;
204
+ optional int32 page_size = 3;
205
+ }
206
+
207
+ enum Infections {
208
+ TBE = 0;
209
+ BORRELIOSIS = 1;
210
+ EHRLICHIOSIS = 2;
211
+ ANAPLASMOSIS = 3;
212
+ RICKETTSIOSIS = 4;
213
+ RELAPSING_FEVER = 5;
214
+ }
215
+
216
+ enum TestResults {
217
+ NOT_TESTED = 0;
218
+ NEGATIVE = 1;
219
+ POSITIVE = 2;
220
+ }
221
+
147
222
  message ListReferencesRequest {
148
223
  optional string search = 1;
149
224
  }
@@ -157,10 +232,59 @@ message Reference {
157
232
  string name = 2;
158
233
  }
159
234
 
235
+ enum ReferenceKinds {
236
+ DISTRICT = 0;
237
+ PLACE = 1;
238
+ MATERIAL = 2;
239
+ MITE = 3;
240
+ }
241
+
242
+ message ReferenceItem {
243
+ string id = 1;
244
+ string name = 2;
245
+
246
+ int32 bites_count = 3;
247
+ }
248
+
249
+ message ListReferencePageRequest {
250
+ ReferenceKinds kind = 1;
251
+
252
+ optional string search = 2;
253
+ optional int32 page = 3;
254
+ optional int32 page_size = 4;
255
+ }
256
+
257
+ message ListReferencePageResponse {
258
+ repeated ReferenceItem items = 1;
259
+ int32 total = 2;
260
+ int32 page = 3;
261
+ int32 page_size = 4;
262
+ }
263
+
264
+ message CreateReferenceRequest {
265
+ ReferenceKinds kind = 1;
266
+ string name = 2;
267
+ }
268
+
269
+ message UpdateReferenceRequest {
270
+ ReferenceKinds kind = 1;
271
+ string id = 2;
272
+ string name = 3;
273
+ }
274
+
275
+ message DeleteReferenceRequest {
276
+ ReferenceKinds kind = 1;
277
+ string id = 2;
278
+ }
279
+
280
+ message DeleteReferenceResponse {
281
+ bool success = 1;
282
+ }
283
+
160
284
  message Bite {
161
285
  string id = 1;
162
286
  optional string external_id = 2;
163
- string code = 3;
287
+ optional string code = 3;
164
288
  google.protobuf.Timestamp request_date = 4;
165
289
  optional google.protobuf.Timestamp bite_date = 5;
166
290
  optional string circumstances = 6;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miteradar/contracts",
3
- "version": "1.3.1",
3
+ "version": "1.7.1",
4
4
  "description": "Protobuf definitions and generated ts types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",