@mamindom/contracts 1.0.149 → 1.0.152

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.
@@ -1,5 +1,11 @@
1
1
  import { Observable } from "rxjs";
2
2
  export declare const protobufPackage = "auth.v1";
3
+ export interface LogoutRequest {
4
+ refreshToken: string;
5
+ }
6
+ export interface LogoutResponse {
7
+ ok: boolean;
8
+ }
3
9
  export interface SendOtpRequest {
4
10
  identifier: string;
5
11
  type: string;
@@ -41,6 +47,7 @@ export interface AuthServiceClient {
41
47
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
42
48
  login(request: LoginRequest): Observable<AuthResponse>;
43
49
  register(request: RegisterRequest): Observable<AuthResponse>;
50
+ logout(request: LogoutRequest): Observable<LogoutResponse>;
44
51
  }
45
52
  export interface AuthServiceController {
46
53
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
@@ -48,6 +55,7 @@ export interface AuthServiceController {
48
55
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
49
56
  login(request: LoginRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
50
57
  register(request: RegisterRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
58
+ logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
51
59
  }
52
60
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
53
61
  export declare const AUTH_SERVICE_NAME = "AuthService";
package/dist/gen/auth.js CHANGED
@@ -13,7 +13,7 @@ exports.protobufPackage = "auth.v1";
13
13
  exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
14
14
  function AuthServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = ["sendOtp", "verifyOtp", "refresh", "login", "register"];
16
+ const grpcMethods = ["sendOtp", "verifyOtp", "refresh", "login", "register", "logout"];
17
17
  for (const method of grpcMethods) {
18
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
19
  (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -177,7 +177,7 @@ export interface GetFamilyRequest {
177
177
  }
178
178
  export interface GetFamilyResponse {
179
179
  children: Child[];
180
- pregnancyWeek?: number | undefined;
180
+ expectedDeliveryDate?: string | undefined;
181
181
  }
182
182
  export interface AddChildRequest {
183
183
  userId: string;
@@ -206,11 +206,18 @@ export interface GetPregnancyRequest {
206
206
  userId: string;
207
207
  }
208
208
  export interface GetPregnancyResponse {
209
- week?: number | undefined;
209
+ expectedDeliveryDate?: string | undefined;
210
210
  }
211
211
  export interface UpdatePregnancyRequest {
212
212
  userId: string;
213
- week: number;
213
+ expectedDeliveryDate?: string | undefined;
214
+ }
215
+ export interface SetPlanfixContactIdRequest {
216
+ userId: string;
217
+ planfixContactId: string;
218
+ }
219
+ export interface SetPlanfixContactIdResponse {
220
+ ok: boolean;
214
221
  }
215
222
  export interface CartItemVariant {
216
223
  key: string;
@@ -282,6 +289,7 @@ export interface UsersServiceClient {
282
289
  removeChild(request: RemoveChildRequest): Observable<RemoveChildResponse>;
283
290
  getPregnancy(request: GetPregnancyRequest): Observable<GetPregnancyResponse>;
284
291
  updatePregnancy(request: UpdatePregnancyRequest): Observable<GetPregnancyResponse>;
292
+ setPlanfixContactId(request: SetPlanfixContactIdRequest): Observable<SetPlanfixContactIdResponse>;
285
293
  getCart(request: GetCartRequest): Observable<GetCartResponse>;
286
294
  upsertCartItem(request: UpsertCartItemRequest): Observable<GetCartResponse>;
287
295
  removeCartItem(request: RemoveCartItemRequest): Observable<GetCartResponse>;
@@ -312,6 +320,7 @@ export interface UsersServiceController {
312
320
  removeChild(request: RemoveChildRequest): Promise<RemoveChildResponse> | Observable<RemoveChildResponse> | RemoveChildResponse;
313
321
  getPregnancy(request: GetPregnancyRequest): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
314
322
  updatePregnancy(request: UpdatePregnancyRequest): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
323
+ setPlanfixContactId(request: SetPlanfixContactIdRequest): Promise<SetPlanfixContactIdResponse> | Observable<SetPlanfixContactIdResponse> | SetPlanfixContactIdResponse;
315
324
  getCart(request: GetCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
316
325
  upsertCartItem(request: UpsertCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
317
326
  removeCartItem(request: RemoveCartItemRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
package/dist/gen/users.js CHANGED
@@ -50,6 +50,7 @@ function UsersServiceControllerMethods() {
50
50
  "removeChild",
51
51
  "getPregnancy",
52
52
  "updatePregnancy",
53
+ "setPlanfixContactId",
53
54
  "getCart",
54
55
  "upsertCartItem",
55
56
  "removeCartItem",
@@ -9,6 +9,15 @@ service AuthService {
9
9
  rpc Refresh (RefreshRequest) returns (RefreshResponse);
10
10
  rpc Login (LoginRequest) returns (AuthResponse);
11
11
  rpc Register (RegisterRequest) returns (AuthResponse);
12
+ rpc Logout (LogoutRequest) returns (LogoutResponse);
13
+ }
14
+
15
+ message LogoutRequest {
16
+ string refresh_token = 1;
17
+ }
18
+
19
+ message LogoutResponse {
20
+ bool ok = 1;
12
21
  }
13
22
 
14
23
 
@@ -41,6 +41,9 @@ service UsersService {
41
41
  rpc GetPregnancy(GetPregnancyRequest) returns (GetPregnancyResponse);
42
42
  rpc UpdatePregnancy(UpdatePregnancyRequest) returns (GetPregnancyResponse);
43
43
 
44
+
45
+ rpc SetPlanfixContactId(SetPlanfixContactIdRequest) returns (SetPlanfixContactIdResponse);
46
+
44
47
 
45
48
  rpc GetCart(GetCartRequest) returns (GetCartResponse);
46
49
  rpc UpsertCartItem(UpsertCartItemRequest) returns (GetCartResponse);
@@ -268,7 +271,8 @@ message GetFamilyRequest {
268
271
 
269
272
  message GetFamilyResponse {
270
273
  repeated Child children = 1;
271
- optional int32 pregnancy_week = 2;
274
+
275
+ optional string expected_delivery_date = 2;
272
276
  }
273
277
 
274
278
  message AddChildRequest {
@@ -305,12 +309,23 @@ message GetPregnancyRequest {
305
309
  }
306
310
 
307
311
  message GetPregnancyResponse {
308
- optional int32 week = 1;
312
+
313
+ optional string expected_delivery_date = 1;
309
314
  }
310
315
 
311
316
  message UpdatePregnancyRequest {
312
317
  string user_id = 1;
313
- int32 week = 2;
318
+
319
+ optional string expected_delivery_date = 2;
320
+ }
321
+
322
+ message SetPlanfixContactIdRequest {
323
+ string user_id = 1;
324
+ string planfix_contact_id = 2;
325
+ }
326
+
327
+ message SetPlanfixContactIdResponse {
328
+ bool ok = 1;
314
329
  }
315
330
 
316
331
 
package/gen/auth.ts CHANGED
@@ -10,6 +10,14 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth.v1";
12
12
 
13
+ export interface LogoutRequest {
14
+ refreshToken: string;
15
+ }
16
+
17
+ export interface LogoutResponse {
18
+ ok: boolean;
19
+ }
20
+
13
21
  export interface SendOtpRequest {
14
22
  identifier: string;
15
23
  type: string;
@@ -64,6 +72,8 @@ export interface AuthServiceClient {
64
72
  login(request: LoginRequest): Observable<AuthResponse>;
65
73
 
66
74
  register(request: RegisterRequest): Observable<AuthResponse>;
75
+
76
+ logout(request: LogoutRequest): Observable<LogoutResponse>;
67
77
  }
68
78
 
69
79
  export interface AuthServiceController {
@@ -76,11 +86,13 @@ export interface AuthServiceController {
76
86
  login(request: LoginRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
77
87
 
78
88
  register(request: RegisterRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
89
+
90
+ logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
79
91
  }
80
92
 
81
93
  export function AuthServiceControllerMethods() {
82
94
  return function (constructor: Function) {
83
- const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "login", "register"];
95
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "login", "register", "logout"];
84
96
  for (const method of grpcMethods) {
85
97
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
86
98
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/gen/users.ts CHANGED
@@ -226,7 +226,7 @@ export interface GetFamilyRequest {
226
226
 
227
227
  export interface GetFamilyResponse {
228
228
  children: Child[];
229
- pregnancyWeek?: number | undefined;
229
+ expectedDeliveryDate?: string | undefined;
230
230
  }
231
231
 
232
232
  export interface AddChildRequest {
@@ -262,12 +262,21 @@ export interface GetPregnancyRequest {
262
262
  }
263
263
 
264
264
  export interface GetPregnancyResponse {
265
- week?: number | undefined;
265
+ expectedDeliveryDate?: string | undefined;
266
266
  }
267
267
 
268
268
  export interface UpdatePregnancyRequest {
269
269
  userId: string;
270
- week: number;
270
+ expectedDeliveryDate?: string | undefined;
271
+ }
272
+
273
+ export interface SetPlanfixContactIdRequest {
274
+ userId: string;
275
+ planfixContactId: string;
276
+ }
277
+
278
+ export interface SetPlanfixContactIdResponse {
279
+ ok: boolean;
271
280
  }
272
281
 
273
282
  export interface CartItemVariant {
@@ -375,6 +384,8 @@ export interface UsersServiceClient {
375
384
 
376
385
  updatePregnancy(request: UpdatePregnancyRequest): Observable<GetPregnancyResponse>;
377
386
 
387
+ setPlanfixContactId(request: SetPlanfixContactIdRequest): Observable<SetPlanfixContactIdResponse>;
388
+
378
389
  getCart(request: GetCartRequest): Observable<GetCartResponse>;
379
390
 
380
391
  upsertCartItem(request: UpsertCartItemRequest): Observable<GetCartResponse>;
@@ -470,6 +481,10 @@ export interface UsersServiceController {
470
481
  request: UpdatePregnancyRequest,
471
482
  ): Promise<GetPregnancyResponse> | Observable<GetPregnancyResponse> | GetPregnancyResponse;
472
483
 
484
+ setPlanfixContactId(
485
+ request: SetPlanfixContactIdRequest,
486
+ ): Promise<SetPlanfixContactIdResponse> | Observable<SetPlanfixContactIdResponse> | SetPlanfixContactIdResponse;
487
+
473
488
  getCart(request: GetCartRequest): Promise<GetCartResponse> | Observable<GetCartResponse> | GetCartResponse;
474
489
 
475
490
  upsertCartItem(
@@ -514,6 +529,7 @@ export function UsersServiceControllerMethods() {
514
529
  "removeChild",
515
530
  "getPregnancy",
516
531
  "updatePregnancy",
532
+ "setPlanfixContactId",
517
533
  "getCart",
518
534
  "upsertCartItem",
519
535
  "removeCartItem",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.149",
4
+ "version": "1.0.152",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
package/proto/auth.proto CHANGED
@@ -9,6 +9,15 @@ service AuthService {
9
9
  rpc Refresh (RefreshRequest) returns (RefreshResponse);
10
10
  rpc Login (LoginRequest) returns (AuthResponse);
11
11
  rpc Register (RegisterRequest) returns (AuthResponse);
12
+ rpc Logout (LogoutRequest) returns (LogoutResponse);
13
+ }
14
+
15
+ message LogoutRequest {
16
+ string refresh_token = 1;
17
+ }
18
+
19
+ message LogoutResponse {
20
+ bool ok = 1;
12
21
  }
13
22
 
14
23
 
package/proto/users.proto CHANGED
@@ -41,6 +41,9 @@ service UsersService {
41
41
  rpc GetPregnancy(GetPregnancyRequest) returns (GetPregnancyResponse);
42
42
  rpc UpdatePregnancy(UpdatePregnancyRequest) returns (GetPregnancyResponse);
43
43
 
44
+
45
+ rpc SetPlanfixContactId(SetPlanfixContactIdRequest) returns (SetPlanfixContactIdResponse);
46
+
44
47
 
45
48
  rpc GetCart(GetCartRequest) returns (GetCartResponse);
46
49
  rpc UpsertCartItem(UpsertCartItemRequest) returns (GetCartResponse);
@@ -268,7 +271,8 @@ message GetFamilyRequest {
268
271
 
269
272
  message GetFamilyResponse {
270
273
  repeated Child children = 1;
271
- optional int32 pregnancy_week = 2;
274
+
275
+ optional string expected_delivery_date = 2;
272
276
  }
273
277
 
274
278
  message AddChildRequest {
@@ -305,12 +309,23 @@ message GetPregnancyRequest {
305
309
  }
306
310
 
307
311
  message GetPregnancyResponse {
308
- optional int32 week = 1;
312
+
313
+ optional string expected_delivery_date = 1;
309
314
  }
310
315
 
311
316
  message UpdatePregnancyRequest {
312
317
  string user_id = 1;
313
- int32 week = 2;
318
+
319
+ optional string expected_delivery_date = 2;
320
+ }
321
+
322
+ message SetPlanfixContactIdRequest {
323
+ string user_id = 1;
324
+ string planfix_contact_id = 2;
325
+ }
326
+
327
+ message SetPlanfixContactIdResponse {
328
+ bool ok = 1;
314
329
  }
315
330
 
316
331