@sellout/models 0.0.337 → 0.0.338

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellout/models",
3
- "version": "0.0.337",
3
+ "version": "0.0.338",
4
4
  "description": "Sellout.io models",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@apollo/client": "^3.9.6",
20
20
  "@hapi/joi": "^17.1.1",
21
- "@sellout/utils": "^0.0.337",
21
+ "@sellout/utils": "^0.0.338",
22
22
  "@types/hapi__joi": "^16.0.1",
23
23
  "@types/shortid": "^0.0.29",
24
24
  "@types/zen-observable": "^0.8.7",
@@ -32,5 +32,5 @@
32
32
  "protobufjs": "^6.11.2",
33
33
  "typescript": "^4.9.5"
34
34
  },
35
- "gitHead": "c8d6d91b2528737a2b32cc87e08c9e39bb69299f"
35
+ "gitHead": "20ab75a1331e1df651c3b21d31f594cf6a6454cc"
36
36
  }
@@ -0,0 +1,5 @@
1
+ export enum ContactsScreenEnum {
2
+ ShowContactsOnly = "showContactsOnly",
3
+ ShowCustomersOnly = 'showCustomersOnly',
4
+ ShowContactsAndCustomer = 'showContactsAndCustomer',
5
+ }
@@ -0,0 +1,9 @@
1
+ import {gql} from "@apollo/client";
2
+
3
+ const mutation = gql`
4
+ mutation createContact($contact: [ContactInput!]!) {
5
+ createContact(contact: $contact)
6
+ }
7
+ `;
8
+
9
+ export default mutation;
@@ -0,0 +1,16 @@
1
+ import {gql} from "@apollo/client";
2
+
3
+ const mutation = gql`
4
+ mutation updateContact($contact: UpdateContactInput!) {
5
+ updateContact(contact: $contact) {
6
+ _id
7
+ firstName
8
+ lastName
9
+ orgId
10
+ userId
11
+ email
12
+ }
13
+ }
14
+ `;
15
+
16
+ export default mutation;
@@ -8,6 +8,9 @@ const query = gql`
8
8
  userProfilesAdmin(query: $query, pagination: $pagination) {
9
9
  _id
10
10
  userId
11
+ firstName
12
+ lastName
13
+ email
11
14
  imageUrl
12
15
  user {
13
16
  _id
@@ -0,0 +1,9 @@
1
+ export default interface IContact {
2
+ _id?: string;
3
+ orgId?: string;
4
+ firstName?: string;
5
+ lastName?: string;
6
+ email?: string;
7
+ userId?: string;
8
+ createdAt?: number;
9
+ }
@@ -88,6 +88,7 @@ message UserProfileQuery {
88
88
  string phoneNumber = 6;
89
89
  bool any = 7;
90
90
  string orgId = 8;
91
+ string screenType = 9;
91
92
  }
92
93
 
93
94
  message QueryUserProfilesRequest {
@@ -1,6 +1,7 @@
1
1
  syntax = "proto3";
2
2
 
3
3
  import "error.proto";
4
+ import "user-profile.proto";
4
5
 
5
6
  message User {
6
7
  string _id = 1;
@@ -358,6 +359,63 @@ message DeleteUnverifiedUserResponse {
358
359
  bool deleted = 2;
359
360
  }
360
361
 
362
+ message Contact {
363
+ string _id = 0;
364
+ string firstName = 1;
365
+ string lastName = 2;
366
+ string userId = 3;
367
+ string orgId = 4;
368
+ string email = 5;
369
+ int32 createdAt = 6;
370
+ }
371
+
372
+ message CreateContactRequest {
373
+ string spanContext = 0;
374
+ string orgId = 1;
375
+ repeated Contact contact = 2;
376
+ }
377
+
378
+ message CreateContactResponse {
379
+ StatusCode status = 1;
380
+ repeated Error errors = 2;
381
+ }
382
+
383
+ message ContactsQuery {
384
+ string name = 0;
385
+ string email = 1;
386
+ string userId = 2;
387
+ string orgId = 3;
388
+ }
389
+
390
+ message QueryContactsRequest {
391
+ string spanContext = 1;
392
+ Pagination pagination = 2;
393
+ ContactsQuery query = 3;
394
+ }
395
+
396
+ message QueryContactsResponse {
397
+ StatusCode status = 1;
398
+ repeated Error errors = 2;
399
+ repeated UserProfile contacts = 3;
400
+ }
401
+
402
+ message UpdateContactRequest {
403
+ string spanContext = 0;
404
+ string _id = 1;
405
+ string email = 2;
406
+ string firstName = 3;
407
+ string lastName = 4;
408
+ string userId = 5;
409
+ string orgId = 6;
410
+ bool isNewUser = 7;
411
+ }
412
+
413
+ message UpdateContactResponse {
414
+ StatusCode status = 1;
415
+ repeated Error errors = 2;
416
+ Contact contact = 3;
417
+ }
418
+
361
419
  service UserService {
362
420
  // Create
363
421
  rpc createUser(CreateUserRequest) returns (CreateUserResponse) {}
@@ -394,4 +452,7 @@ service UserService {
394
452
  // Delete
395
453
  rpc deleteUnverifiedUser(DeleteUnverifiedUserRequest) returns (DeleteUnverifiedUserResponse) {}
396
454
  rpc findUserByPhoneNumber(FindUserByEmailRequest) returns (FindUserByEmailResponse) {}
455
+ rpc createContact(CreateContactRequest) returns (CreateContactResponse) {}
456
+ rpc queryContacts(QueryContactsRequest) returns (QueryContactsResponse) {}
457
+ rpc updateContact(UpdateContactRequest) returns (UpdateContactResponse) {}
397
458
  }