@sellout/models 0.0.49 → 0.0.51

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 +89 -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/IEventUpgrade.d.ts +6 -0
  17. package/.dist/interfaces/IEventUpgrade.js +7 -0
  18. package/.dist/interfaces/IEventUpgrade.js.map +1 -1
  19. package/.dist/schemas/Event.d.ts +20 -0
  20. package/.dist/schemas/Event.js +25 -5
  21. package/.dist/schemas/Event.js.map +1 -1
  22. package/.dist/schemas/Organization.d.ts +55 -35
  23. package/.dist/schemas/Organization.js +2 -37
  24. package/.dist/schemas/Organization.js.map +1 -1
  25. package/.dist/schemas/User.d.ts +4 -0
  26. package/.dist/schemas/User.js +4 -0
  27. package/.dist/schemas/User.js.map +1 -1
  28. package/.dist/sellout-proto.js +1379 -146
  29. package/package.json +5 -5
  30. package/src/graphql/fragments/event.fragment.ts +36 -9
  31. package/src/graphql/mutations/createEvent.mutation.ts +16 -3
  32. package/src/graphql/mutations/updateEvent.mutation.ts +8 -2
  33. package/src/graphql/queries/event.query.ts +3 -1
  34. package/src/graphql/queries/profile.query.ts +85 -0
  35. package/src/graphql/queries/roles.query.ts +28 -0
  36. package/src/interfaces/IEventUpgrade.ts +7 -0
  37. package/src/proto/event.proto +1 -0
  38. package/src/proto/user.proto +30 -0
  39. package/src/schemas/Event.ts +25 -5
  40. package/src/schemas/Organization.ts +2 -37
  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.49",
3
+ "version": "0.0.51",
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.49",
20
- "@sellout/utils": "^0.0.49",
19
+ "@sellout/service": "^0.0.51",
20
+ "@sellout/utils": "^0.0.51",
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": "a3c36fdda55e0f9f3fe2c062ce206511034002fd"
32
+ "gitHead": "536c0d73b584f85b6c493fa529f9a55515181e5d"
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,85 @@
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
+ userProfile {
18
+ imageUrl
19
+ }
20
+ }
21
+ userProfile {
22
+ userId
23
+ firstName
24
+ lastName
25
+ email
26
+ phoneNumber
27
+ authyId
28
+ stripeCustomerId
29
+ imageUrl
30
+ address {
31
+ address1
32
+ address2
33
+ city
34
+ state
35
+ zip
36
+ country
37
+ phone
38
+ }
39
+ }
40
+ organization {
41
+ _id
42
+ userId
43
+ createdAt
44
+ authyId
45
+ stripeId
46
+ stripeConnectAccount {
47
+ name
48
+ country
49
+ email
50
+ payoutsEnabled
51
+ stripeAccountId
52
+ }
53
+ seating {
54
+ publicKey
55
+ secretKey
56
+ designerKey
57
+ }
58
+ orgName
59
+ orgUrls
60
+ orgLogoUrl
61
+ orgColorHex
62
+ bio
63
+ email
64
+ phoneNumber
65
+ address {
66
+ address1
67
+ address2
68
+ city
69
+ state
70
+ zip
71
+ country
72
+ phone
73
+ }
74
+ facebookPixelId
75
+ googleAnalyticsId
76
+ }
77
+ platformSettings {
78
+ stripeClientId
79
+ stripeRedirectUrl
80
+ webFlowSiteId
81
+ }
82
+ }
83
+ `;
84
+
85
+ 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;
@@ -1,3 +1,8 @@
1
+ export enum UpgradeTypeComplimentaryWithEnum {
2
+ Order = 'Order',
3
+ Ticket = 'Ticket',
4
+ };
5
+
1
6
  export default interface IEventUpgrade {
2
7
  _id?: string;
3
8
  name: string;
@@ -6,6 +11,8 @@ export default interface IEventUpgrade {
6
11
  remainingQty: number;
7
12
  purchaseLimit: number;
8
13
  complimentary: boolean;
14
+ complimentaryWith: UpgradeTypeComplimentaryWithEnum;
15
+ complimentaryQty: number;
9
16
  ticketTypeIds: string[];
10
17
  imageUrl: string;
11
18
  description: string;
@@ -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,21 @@ message FindUserByEmailResponse {
204
217
  User user = 3;
205
218
  }
206
219
 
220
+
221
+ message UpdateBasicUserInfoRequest {
222
+ string spanContext = 1;
223
+ string userId = 2;
224
+ string firstName = 3;
225
+ string lastName = 4;
226
+ string imageUrl = 5;
227
+ }
228
+
229
+ message UpdateBasicUserInfoResponse {
230
+ StatusCode status = 1;
231
+ repeated Error errors = 2;
232
+ User user = 3;
233
+ }
234
+
207
235
  // Update User Phone and Email
208
236
 
209
237
  message UpdateUserPhoneNumberRequest {
@@ -278,10 +306,12 @@ service UserService {
278
306
  rpc findUserById(FindUserByIdRequest) returns (FindUserByIdResponse) {}
279
307
  rpc findUserByEmail(FindUserByEmailRequest) returns (FindUserByEmailResponse) {}
280
308
  // Update
309
+ rpc updateBasicUserInfo(UpdateBasicUserInfoRequest) returns (UpdateBasicUserInfoResponse) {}
281
310
  rpc updateUserPhoneNumber(UpdateUserPhoneNumberRequest) returns (UpdateUserPhoneNumberResponse) {}
282
311
  rpc updateUserEmail(UpdateUserEmailRequest) returns (UpdateUserEmailResponse) {}
283
312
  rpc updateUserPreferredLogin(UpdateUserPreferredLoginRequest) returns (UpdateUserPreferredLoginResponse) {}
284
313
  rpc setUserPassword(SetUserPasswordRequest) returns (SetUserPasswordResponse) {}
314
+ rpc resetUserPasswordInApp(ResetUserPasswordInAppRequest) returns (ResetUserPasswordInAppResponse) {}
285
315
  // Delete
286
316
  rpc deleteUnverifiedUser(DeleteUnverifiedUserRequest) returns (DeleteUnverifiedUserResponse) {}
287
317
  }
@@ -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
 
@@ -1,4 +1,5 @@
1
1
  import shortid from 'shortid';
2
+ import Address from './Address';
2
3
 
3
4
  export default {
4
5
  _id: {
@@ -33,43 +34,6 @@ export default {
33
34
  required: false,
34
35
  default: null,
35
36
  }],
36
- address: {
37
- address1: {
38
- type: String,
39
- required: false,
40
- default: null,
41
- },
42
- address2: {
43
- type: String,
44
- required: false,
45
- default: null,
46
- },
47
- city: {
48
- type: String,
49
- required: false,
50
- default: null,
51
- },
52
- state: {
53
- type: String,
54
- required: false,
55
- default: null,
56
- },
57
- zip: {
58
- type: String,
59
- required: false,
60
- default: null,
61
- },
62
- country: {
63
- type: String,
64
- required: false,
65
- default: null,
66
- },
67
- phone: {
68
- type: String,
69
- required: false,
70
- default: null,
71
- },
72
- },
73
37
  orgLogoUrl: {
74
38
  type: String,
75
39
  required: false,
@@ -105,4 +69,5 @@ export default {
105
69
  required: false,
106
70
  default: null,
107
71
  },
72
+ address: Address,
108
73
  };
@@ -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,