@sellout/models 0.0.50 → 0.0.53

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.
Files changed (41) hide show
  1. package/.dist/graphql/fragments/event.fragment.d.ts +1 -0
  2. package/.dist/graphql/fragments/event.fragment.js +35 -9
  3. package/.dist/graphql/fragments/event.fragment.js.map +1 -1
  4. package/.dist/graphql/mutations/createEvent.mutation.js +15 -2
  5. package/.dist/graphql/mutations/createEvent.mutation.js.map +1 -1
  6. package/.dist/graphql/mutations/updateEvent.mutation.js +8 -2
  7. package/.dist/graphql/mutations/updateEvent.mutation.js.map +1 -1
  8. package/.dist/graphql/queries/event.query.js +3 -1
  9. package/.dist/graphql/queries/event.query.js.map +1 -1
  10. package/.dist/graphql/queries/profile.query.d.ts +2 -0
  11. package/.dist/graphql/queries/profile.query.js +90 -0
  12. package/.dist/graphql/queries/profile.query.js.map +1 -0
  13. package/.dist/graphql/queries/roles.query.d.ts +2 -0
  14. package/.dist/graphql/queries/roles.query.js +32 -0
  15. package/.dist/graphql/queries/roles.query.js.map +1 -0
  16. package/.dist/interfaces/ISecondaryEmail.d.ts +4 -0
  17. package/.dist/interfaces/ISecondaryEmail.js +3 -0
  18. package/.dist/interfaces/ISecondaryEmail.js.map +1 -0
  19. package/.dist/interfaces/IUser.d.ts +1 -0
  20. package/.dist/schemas/Event.d.ts +20 -0
  21. package/.dist/schemas/Event.js +25 -5
  22. package/.dist/schemas/Event.js.map +1 -1
  23. package/.dist/schemas/SecondaryEmail.d.ts +12 -0
  24. package/.dist/schemas/SecondaryEmail.js +14 -0
  25. package/.dist/schemas/SecondaryEmail.js.map +1 -0
  26. package/.dist/schemas/User.d.ts +4 -0
  27. package/.dist/schemas/User.js +4 -0
  28. package/.dist/schemas/User.js.map +1 -1
  29. package/.dist/sellout-proto.js +4194 -693
  30. package/package.json +5 -5
  31. package/src/graphql/fragments/event.fragment.ts +36 -9
  32. package/src/graphql/mutations/createEvent.mutation.ts +16 -3
  33. package/src/graphql/mutations/updateEvent.mutation.ts +8 -2
  34. package/src/graphql/queries/event.query.ts +3 -1
  35. package/src/graphql/queries/profile.query.ts +86 -0
  36. package/src/graphql/queries/roles.query.ts +28 -0
  37. package/src/interfaces/IUser.ts +1 -0
  38. package/src/proto/event.proto +1 -0
  39. package/src/proto/user.proto +83 -0
  40. package/src/schemas/Event.ts +25 -5
  41. package/src/schemas/User.ts +4 -0
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sellout/models",
3
- "version": "0.0.50",
3
+ "version": "0.0.53",
4
4
  "description": "Sellout.io models",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "prepare": "npm run build",
8
8
  "build": "tsc --project . && npm run build:pb",
9
9
  "build:pb": "pbjs -t static-module -w commonjs -o ./.dist/sellout-proto.js src/proto/*.proto",
10
- "start": "nodemon --watch src -e json,js,ts -x \"npm run build\""
10
+ "start": "nodemon --watch src -e json,js,ts,proto -x \"npm run build\""
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -16,8 +16,8 @@
16
16
  "author": "samheutmaker@gmail.com",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@sellout/service": "^0.0.50",
20
- "@sellout/utils": "^0.0.50",
19
+ "@sellout/service": "^0.0.53",
20
+ "@sellout/utils": "^0.0.53",
21
21
  "@types/shortid": "0.0.29",
22
22
  "graphql": "^14.6.0",
23
23
  "graphql-tag": "^2.10.3",
@@ -29,5 +29,5 @@
29
29
  "protobufjs": "~6.8.8",
30
30
  "typescript": "^3.8.3"
31
31
  },
32
- "gitHead": "6888751c5d7908a61606cbc6b2b0144d74872f81"
32
+ "gitHead": "6d686366208dad8fc1228f43870290f6bd335694"
33
33
  }
@@ -13,6 +13,7 @@ interface EventFragments {
13
13
  exchange: object;
14
14
  metrics: object;
15
15
  webFlowEntity: object;
16
+ artists: object;
16
17
  }
17
18
 
18
19
  interface EventFragment {
@@ -33,6 +34,7 @@ const Event: EventFragment = {
33
34
  exchange: {},
34
35
  metrics: {},
35
36
  webFlowEntity: {},
37
+ artists: {},
36
38
  }
37
39
  };
38
40
 
@@ -91,6 +93,7 @@ Event.fragments = {
91
93
  purchaseLimit
92
94
  performanceIds
93
95
  visible
96
+ description
94
97
  tiers {
95
98
  _id
96
99
  name
@@ -137,7 +140,7 @@ Event.fragments = {
137
140
  code
138
141
  type
139
142
  totalQty
140
- remainingQty
143
+ remainingQty
141
144
  ticketTypeIds
142
145
  upgradeIds
143
146
  active
@@ -151,7 +154,7 @@ Event.fragments = {
151
154
  label
152
155
  type
153
156
  minLength
154
- maxLength
157
+ maxLength
155
158
  minValue
156
159
  maxValue
157
160
  required
@@ -181,6 +184,30 @@ Event.fragments = {
181
184
  }
182
185
  }
183
186
  `,
187
+ artists: gql`
188
+ fragment Artists on Event {
189
+ artists {
190
+ _id
191
+ name
192
+ genres
193
+ socialAccounts {
194
+ _id
195
+ platform
196
+ link
197
+ }
198
+ pressKits {
199
+ _id
200
+ title
201
+ description
202
+ posterImageUrls
203
+ links {
204
+ platform
205
+ link
206
+ }
207
+ }
208
+ }
209
+ }
210
+ `,
184
211
  exchange: gql`
185
212
  fragment TicketExchange on Event {
186
213
  exchange {
@@ -214,16 +241,16 @@ Event.fragments = {
214
241
  webFlowEntityId
215
242
  slug
216
243
  webFlowSite {
217
- name
218
- webFlowId
219
- enabled
220
- previewUrl
221
- domains {
244
+ name
245
+ webFlowId
246
+ enabled
247
+ previewUrl
248
+ domains {
222
249
  name
223
250
  lastPublishedAt
224
251
  }
225
- createdAt
226
- updatedAt
252
+ createdAt
253
+ updatedAt
227
254
  }
228
255
  }
229
256
  }
@@ -20,6 +20,14 @@ const mutation = gql`
20
20
  seatingChartKey
21
21
  age
22
22
  sendQRCode
23
+ hasOrders
24
+ venue {
25
+ name
26
+ address {
27
+ state
28
+ city
29
+ }
30
+ }
23
31
  ...EventSchedule
24
32
  ...Location
25
33
  ...Performances
@@ -30,9 +38,12 @@ const mutation = gql`
30
38
  ...EventCustomFields
31
39
  ...TicketExchange
32
40
  ...Fees
41
+ ...Artists
42
+ ...Metrics
43
+ ...WebFlowEntity
33
44
  }
34
45
  }
35
-
46
+
36
47
  ${Event.fragments.schedule}
37
48
  ${Event.fragments.location}
38
49
  ${Event.fragments.performances}
@@ -43,7 +54,9 @@ const mutation = gql`
43
54
  ${Event.fragments.customFields}
44
55
  ${Event.fragments.exchange}
45
56
  ${Event.fragments.fees}
46
-
57
+ ${Event.fragments.artists}
58
+ ${Event.fragments.metrics}
59
+ ${Event.fragments.webFlowEntity}
47
60
  `;
48
61
 
49
- export default mutation
62
+ export default mutation;
@@ -19,6 +19,7 @@ const mutation = gql`
19
19
  seatingChartKey
20
20
  age
21
21
  sendQRCode
22
+ hasOrders
22
23
  venue {
23
24
  name
24
25
  address {
@@ -36,9 +37,12 @@ const mutation = gql`
36
37
  ...EventCustomFields
37
38
  ...TicketExchange
38
39
  ...Fees
40
+ ...Artists
41
+ ...Metrics
42
+ ...WebFlowEntity
39
43
  }
40
44
  }
41
-
45
+
42
46
  ${Event.fragments.schedule}
43
47
  ${Event.fragments.location}
44
48
  ${Event.fragments.performances}
@@ -49,7 +53,9 @@ const mutation = gql`
49
53
  ${Event.fragments.customFields}
50
54
  ${Event.fragments.exchange}
51
55
  ${Event.fragments.fees}
52
-
56
+ ${Event.fragments.artists}
57
+ ${Event.fragments.metrics}
58
+ ${Event.fragments.webFlowEntity}
53
59
  `;
54
60
 
55
61
  export default mutation;
@@ -37,11 +37,12 @@ const query = gql`
37
37
  ...EventCustomFields
38
38
  ...TicketExchange
39
39
  ...Fees
40
+ ...Artists
40
41
  ...Metrics
41
42
  ...WebFlowEntity
42
43
  }
43
44
  }
44
-
45
+
45
46
  ${Event.fragments.schedule}
46
47
  ${Event.fragments.location}
47
48
  ${Event.fragments.performances}
@@ -52,6 +53,7 @@ const query = gql`
52
53
  ${Event.fragments.customFields}
53
54
  ${Event.fragments.exchange}
54
55
  ${Event.fragments.fees}
56
+ ${Event.fragments.artists}
55
57
  ${Event.fragments.metrics}
56
58
  ${Event.fragments.webFlowEntity}
57
59
  `;
@@ -0,0 +1,86 @@
1
+ import gql from "graphql-tag";
2
+
3
+ const query = gql`
4
+ query organization {
5
+ user {
6
+ _id
7
+ firstName
8
+ lastName
9
+ email
10
+ emailVerifiedAt
11
+ phoneNumber
12
+ phoneNumberVerifiedAt
13
+ orgContextId
14
+ phoneNumberWaitingForVerify
15
+ emailWaitingForVerify
16
+ preferredLogin
17
+ secondaryEmails
18
+ userProfile {
19
+ imageUrl
20
+ }
21
+ }
22
+ userProfile {
23
+ userId
24
+ firstName
25
+ lastName
26
+ email
27
+ phoneNumber
28
+ authyId
29
+ stripeCustomerId
30
+ imageUrl
31
+ address {
32
+ address1
33
+ address2
34
+ city
35
+ state
36
+ zip
37
+ country
38
+ phone
39
+ }
40
+ }
41
+ organization {
42
+ _id
43
+ userId
44
+ createdAt
45
+ authyId
46
+ stripeId
47
+ stripeConnectAccount {
48
+ name
49
+ country
50
+ email
51
+ payoutsEnabled
52
+ stripeAccountId
53
+ }
54
+ seating {
55
+ publicKey
56
+ secretKey
57
+ designerKey
58
+ }
59
+ orgName
60
+ orgUrls
61
+ orgLogoUrl
62
+ orgColorHex
63
+ bio
64
+ email
65
+ phoneNumber
66
+ address {
67
+ address1
68
+ address2
69
+ city
70
+ state
71
+ zip
72
+ country
73
+ phone
74
+ }
75
+ facebookPixelId
76
+ googleAnalyticsId
77
+ }
78
+ platformSettings {
79
+ stripeClientId
80
+ stripeRedirectUrl
81
+ webFlowSiteId
82
+ }
83
+ }
84
+ `;
85
+
86
+ export default query;
@@ -0,0 +1,28 @@
1
+ import gql from "graphql-tag";
2
+
3
+ const query = gql`
4
+ query roles($query: QueryInput, $pagination: PaginationInput) {
5
+ roles(query: $query, pagination: $pagination) {
6
+ _id
7
+ userId
8
+ userEmail
9
+ user {
10
+ _id
11
+ firstName
12
+ lastName
13
+ email
14
+ userProfile {
15
+ imageUrl
16
+ authyId
17
+ }
18
+ }
19
+ orgId
20
+ role
21
+ createdAt
22
+ createdBy
23
+ acceptedAt
24
+ }
25
+ }
26
+ `;
27
+
28
+ export default query;
@@ -26,4 +26,5 @@ export default interface IUser {
26
26
  preferredLogin?: LoginTypes;
27
27
  authAttempts?: number;
28
28
  authTimeOut?: number;
29
+ secondaryEmails?: string[];
29
30
  }
@@ -67,6 +67,7 @@ message TicketType {
67
67
  repeated string performanceIds = 6;
68
68
  repeated TicketTier tiers = 7;
69
69
  bool visible = 8;
70
+ string description = 9;
70
71
  }
71
72
 
72
73
  message TicketTier {
@@ -24,6 +24,7 @@ message User {
24
24
  string phoneVerifyCode = 19;
25
25
  int32 authTimeOut = 20;
26
26
  int32 authAttempts = 21;
27
+ repeated string secondaryEmails = 22;
27
28
  }
28
29
 
29
30
  // Create User
@@ -167,6 +168,18 @@ message ResetUserPasswordResponse {
167
168
  repeated Error errors = 2;
168
169
  }
169
170
 
171
+ message ResetUserPasswordInAppRequest {
172
+ string spanContext = 1;
173
+ string userId = 2;
174
+ string oldPassword = 3;
175
+ string newPassword = 4;
176
+ }
177
+
178
+ message ResetUserPasswordInAppResponse {
179
+ StatusCode status = 1;
180
+ repeated Error errors = 2;
181
+ }
182
+
170
183
  // update user password - for when user only has phone login and wants to add password
171
184
  message SetUserPasswordRequest {
172
185
  string spanContext = 0;
@@ -204,6 +217,69 @@ message FindUserByEmailResponse {
204
217
  User user = 3;
205
218
  }
206
219
 
220
+ message AddSecondaryEmailRequest {
221
+ string spanContext = 1;
222
+ string email = 2;
223
+ string userId = 3;
224
+ }
225
+
226
+ // Secondary email
227
+ message AddSecondaryEmailResponse {
228
+ StatusCode status = 1;
229
+ repeated Error errors = 2;
230
+ User user = 3;
231
+ }
232
+
233
+ message UpdateSecondaryEmailRequest {
234
+ string spanContext = 1;
235
+ string email = 2;
236
+ string userId = 3;
237
+ }
238
+
239
+ message UpdateSecondaryEmailResponse {
240
+ StatusCode status = 1;
241
+ repeated Error errors = 2;
242
+ User user = 3;
243
+ }
244
+
245
+ message DeleteSecondaryEmailRequest {
246
+ string spanContext = 1;
247
+ string email = 2;
248
+ string userId = 3;
249
+ }
250
+
251
+ message DeleteSecondaryEmailResponse {
252
+ StatusCode status = 1;
253
+ repeated Error errors = 2;
254
+ User user = 3;
255
+ }
256
+
257
+ message MakeSecondaryEmailPrimaryRequest {
258
+ string spanContext = 1;
259
+ string email = 2;
260
+ string userId = 3;
261
+ }
262
+
263
+ message MakeSecondaryEmailPrimaryResponse {
264
+ StatusCode status = 1;
265
+ repeated Error errors = 2;
266
+ User user = 3;
267
+ }
268
+
269
+ message UpdateBasicUserInfoRequest {
270
+ string spanContext = 1;
271
+ string userId = 2;
272
+ string firstName = 3;
273
+ string lastName = 4;
274
+ string imageUrl = 5;
275
+ }
276
+
277
+ message UpdateBasicUserInfoResponse {
278
+ StatusCode status = 1;
279
+ repeated Error errors = 2;
280
+ User user = 3;
281
+ }
282
+
207
283
  // Update User Phone and Email
208
284
 
209
285
  message UpdateUserPhoneNumberRequest {
@@ -278,10 +354,17 @@ service UserService {
278
354
  rpc findUserById(FindUserByIdRequest) returns (FindUserByIdResponse) {}
279
355
  rpc findUserByEmail(FindUserByEmailRequest) returns (FindUserByEmailResponse) {}
280
356
  // Update
357
+ rpc updateBasicUserInfo(UpdateBasicUserInfoRequest) returns (UpdateBasicUserInfoResponse) {}
281
358
  rpc updateUserPhoneNumber(UpdateUserPhoneNumberRequest) returns (UpdateUserPhoneNumberResponse) {}
282
359
  rpc updateUserEmail(UpdateUserEmailRequest) returns (UpdateUserEmailResponse) {}
283
360
  rpc updateUserPreferredLogin(UpdateUserPreferredLoginRequest) returns (UpdateUserPreferredLoginResponse) {}
284
361
  rpc setUserPassword(SetUserPasswordRequest) returns (SetUserPasswordResponse) {}
362
+ rpc resetUserPasswordInApp(ResetUserPasswordInAppRequest) returns (ResetUserPasswordInAppResponse) {}
363
+ // Secondary Email
364
+ rpc addSecondaryEmail(AddSecondaryEmailRequest) returns (AddSecondaryEmailResponse) {}
365
+ rpc updateSecondaryEmail(UpdateSecondaryEmailRequest) returns (UpdateSecondaryEmailResponse) {}
366
+ rpc deleteSecondaryEmail(DeleteSecondaryEmailRequest) returns (DeleteSecondaryEmailResponse) {}
367
+ rpc makeSecondaryEmailPrimary(MakeSecondaryEmailPrimaryRequest) returns (MakeSecondaryEmailPrimaryResponse) {}
285
368
  // Delete
286
369
  rpc deleteUnverifiedUser(DeleteUnverifiedUserRequest) returns (DeleteUnverifiedUserResponse) {}
287
370
  }
@@ -131,6 +131,10 @@ const EventSchedule = {
131
131
  };
132
132
 
133
133
  const EventUpgrade = {
134
+ _id: {
135
+ type: String,
136
+ default: shortid.generate,
137
+ },
134
138
  name: {
135
139
  type: String,
136
140
  required: true,
@@ -161,7 +165,7 @@ const EventUpgrade = {
161
165
  {
162
166
  type: String,
163
167
  required: true,
164
- }
168
+ },
165
169
  ],
166
170
  imageUrl: {
167
171
  type: String,
@@ -190,6 +194,10 @@ export const PerformanceSchedule = {
190
194
  };
191
195
 
192
196
  const Performance = {
197
+ _id: {
198
+ type: String,
199
+ default: shortid.generate,
200
+ },
193
201
  name: {
194
202
  type: String,
195
203
  required: false,
@@ -198,13 +206,13 @@ const Performance = {
198
206
  {
199
207
  type: String,
200
208
  required: false,
201
- }
209
+ },
202
210
  ],
203
211
  openingArtistIds: [
204
212
  {
205
213
  type: String,
206
214
  requird: false,
207
- }
215
+ },
208
216
  ],
209
217
  venueId: {
210
218
  type: String,
@@ -246,6 +254,10 @@ const TicketExchange = {
246
254
  };
247
255
 
248
256
  const TicketHold = {
257
+ _id: {
258
+ type: String,
259
+ default: shortid.generate,
260
+ },
249
261
  name: {
250
262
  type: String,
251
263
  required: true,
@@ -261,6 +273,10 @@ const TicketHold = {
261
273
  };
262
274
 
263
275
  const TicketTier = {
276
+ _id: {
277
+ type: String,
278
+ default: shortid.generate,
279
+ },
264
280
  name: {
265
281
  type: String,
266
282
  required: true,
@@ -288,6 +304,10 @@ const TicketTier = {
288
304
  };
289
305
 
290
306
  const TicketType = {
307
+ _id: {
308
+ type: String,
309
+ default: shortid.generate,
310
+ },
291
311
  name: {
292
312
  type: String,
293
313
  required: true,
@@ -315,9 +335,9 @@ const TicketType = {
315
335
  type: String,
316
336
  required: false,
317
337
  default: [],
318
- }
338
+ },
319
339
  ],
320
- tiers: [TicketTier]
340
+ tiers: [TicketTier],
321
341
  };
322
342
 
323
343
 
@@ -10,6 +10,10 @@ export default {
10
10
  type: String,
11
11
  required: true,
12
12
  },
13
+ secondaryEmails: {
14
+ type: [String],
15
+ required: false,
16
+ },
13
17
  passwordHash: {
14
18
  type: String,
15
19
  required: false,