@lcas58/esmi-api-types 1.0.28 → 1.0.29

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.
@@ -20,18 +20,18 @@ export declare const list: {
20
20
  radius: number;
21
21
  limit: number;
22
22
  offset: number;
23
+ sportId?: string | undefined;
23
24
  city?: string | undefined;
24
25
  state?: string | undefined;
25
- sportId?: string | undefined;
26
26
  latitude?: number | undefined;
27
27
  longitude?: number | undefined;
28
28
  source?: "external" | "community" | undefined;
29
29
  from?: Date | undefined;
30
30
  to?: Date | undefined;
31
31
  }, {
32
+ sportId?: string | undefined;
32
33
  city?: string | undefined;
33
34
  state?: string | undefined;
34
- sportId?: string | undefined;
35
35
  latitude?: number | undefined;
36
36
  longitude?: number | undefined;
37
37
  source?: "external" | "community" | undefined;
@@ -109,6 +109,7 @@ export declare const list: {
109
109
  groupId: z.ZodNullable<z.ZodString>;
110
110
  createdByUserId: z.ZodNullable<z.ZodString>;
111
111
  createdAt: z.ZodDate;
112
+ description: z.ZodNullable<z.ZodString>;
112
113
  }, {
113
114
  sport: z.ZodNullable<z.ZodObject<{
114
115
  id: z.ZodString;
@@ -134,17 +135,17 @@ export declare const list: {
134
135
  }, "strip", z.ZodTypeAny, {
135
136
  id: string;
136
137
  name: string;
138
+ formattedAddress: string;
137
139
  city: string | null;
138
140
  state: string | null;
139
- formattedAddress: string;
140
141
  latitude: number | null;
141
142
  longitude: number | null;
142
143
  }, {
143
144
  id: string;
144
145
  name: string;
146
+ formattedAddress: string;
145
147
  city: string | null;
146
148
  state: string | null;
147
- formattedAddress: string;
148
149
  latitude: number | null;
149
150
  longitude: number | null;
150
151
  }>>;
@@ -201,23 +202,24 @@ export declare const list: {
201
202
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
202
203
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
203
204
  id: string;
205
+ description: string | null;
204
206
  title: string;
205
- sportId: string;
206
207
  createdAt: Date;
207
208
  sport: {
208
209
  id: string;
209
210
  name: string;
210
211
  icon: string | null;
211
212
  } | null;
213
+ sportId: string;
212
214
  startsAt: Date;
213
215
  endsAt: Date | null;
214
216
  timezone: string;
215
217
  location: {
216
218
  id: string;
217
219
  name: string;
220
+ formattedAddress: string;
218
221
  city: string | null;
219
222
  state: string | null;
220
- formattedAddress: string;
221
223
  latitude: number | null;
222
224
  longitude: number | null;
223
225
  } | null;
@@ -264,23 +266,24 @@ export declare const list: {
264
266
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
265
267
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
266
268
  id: string;
269
+ description: string | null;
267
270
  title: string;
268
- sportId: string;
269
271
  createdAt: Date;
270
272
  sport: {
271
273
  id: string;
272
274
  name: string;
273
275
  icon: string | null;
274
276
  } | null;
277
+ sportId: string;
275
278
  startsAt: Date;
276
279
  endsAt: Date | null;
277
280
  timezone: string;
278
281
  location: {
279
282
  id: string;
280
283
  name: string;
284
+ formattedAddress: string;
281
285
  city: string | null;
282
286
  state: string | null;
283
- formattedAddress: string;
284
287
  latitude: number | null;
285
288
  longitude: number | null;
286
289
  } | null;
@@ -389,6 +392,7 @@ export declare const getOne: {
389
392
  groupId: z.ZodNullable<z.ZodString>;
390
393
  createdByUserId: z.ZodNullable<z.ZodString>;
391
394
  createdAt: z.ZodDate;
395
+ description: z.ZodNullable<z.ZodString>;
392
396
  }, {
393
397
  sport: z.ZodNullable<z.ZodObject<{
394
398
  id: z.ZodString;
@@ -414,17 +418,17 @@ export declare const getOne: {
414
418
  }, "strip", z.ZodTypeAny, {
415
419
  id: string;
416
420
  name: string;
421
+ formattedAddress: string;
417
422
  city: string | null;
418
423
  state: string | null;
419
- formattedAddress: string;
420
424
  latitude: number | null;
421
425
  longitude: number | null;
422
426
  }, {
423
427
  id: string;
424
428
  name: string;
429
+ formattedAddress: string;
425
430
  city: string | null;
426
431
  state: string | null;
427
- formattedAddress: string;
428
432
  latitude: number | null;
429
433
  longitude: number | null;
430
434
  }>>;
@@ -481,23 +485,24 @@ export declare const getOne: {
481
485
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
482
486
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
483
487
  id: string;
488
+ description: string | null;
484
489
  title: string;
485
- sportId: string;
486
490
  createdAt: Date;
487
491
  sport: {
488
492
  id: string;
489
493
  name: string;
490
494
  icon: string | null;
491
495
  } | null;
496
+ sportId: string;
492
497
  startsAt: Date;
493
498
  endsAt: Date | null;
494
499
  timezone: string;
495
500
  location: {
496
501
  id: string;
497
502
  name: string;
503
+ formattedAddress: string;
498
504
  city: string | null;
499
505
  state: string | null;
500
- formattedAddress: string;
501
506
  latitude: number | null;
502
507
  longitude: number | null;
503
508
  } | null;
@@ -544,23 +549,24 @@ export declare const getOne: {
544
549
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
545
550
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
546
551
  id: string;
552
+ description: string | null;
547
553
  title: string;
548
- sportId: string;
549
554
  createdAt: Date;
550
555
  sport: {
551
556
  id: string;
552
557
  name: string;
553
558
  icon: string | null;
554
559
  } | null;
560
+ sportId: string;
555
561
  startsAt: Date;
556
562
  endsAt: Date | null;
557
563
  timezone: string;
558
564
  location: {
559
565
  id: string;
560
566
  name: string;
567
+ formattedAddress: string;
561
568
  city: string | null;
562
569
  state: string | null;
563
- formattedAddress: string;
564
570
  latitude: number | null;
565
571
  longitude: number | null;
566
572
  } | null;
@@ -611,16 +617,16 @@ export declare const discoverRequestSchema: z.ZodObject<{
611
617
  to: z.ZodOptional<z.ZodString>;
612
618
  refresh: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
613
619
  }, "strip", z.ZodTypeAny, {
620
+ sportId: string;
614
621
  city: string;
615
622
  state: string;
616
- sportId: string;
617
623
  refresh: boolean;
618
624
  from?: string | undefined;
619
625
  to?: string | undefined;
620
626
  }, {
627
+ sportId: string;
621
628
  city: string;
622
629
  state: string;
623
- sportId: string;
624
630
  from?: string | undefined;
625
631
  to?: string | undefined;
626
632
  refresh?: boolean | undefined;
@@ -643,16 +649,16 @@ export declare const discover: {
643
649
  to: z.ZodOptional<z.ZodString>;
644
650
  refresh: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
645
651
  }, "strip", z.ZodTypeAny, {
652
+ sportId: string;
646
653
  city: string;
647
654
  state: string;
648
- sportId: string;
649
655
  refresh: boolean;
650
656
  from?: string | undefined;
651
657
  to?: string | undefined;
652
658
  }, {
659
+ sportId: string;
653
660
  city: string;
654
661
  state: string;
655
- sportId: string;
656
662
  from?: string | undefined;
657
663
  to?: string | undefined;
658
664
  refresh?: boolean | undefined;
@@ -729,6 +735,7 @@ export declare const discover: {
729
735
  groupId: z.ZodNullable<z.ZodString>;
730
736
  createdByUserId: z.ZodNullable<z.ZodString>;
731
737
  createdAt: z.ZodDate;
738
+ description: z.ZodNullable<z.ZodString>;
732
739
  }, {
733
740
  sport: z.ZodNullable<z.ZodObject<{
734
741
  id: z.ZodString;
@@ -754,17 +761,17 @@ export declare const discover: {
754
761
  }, "strip", z.ZodTypeAny, {
755
762
  id: string;
756
763
  name: string;
764
+ formattedAddress: string;
757
765
  city: string | null;
758
766
  state: string | null;
759
- formattedAddress: string;
760
767
  latitude: number | null;
761
768
  longitude: number | null;
762
769
  }, {
763
770
  id: string;
764
771
  name: string;
772
+ formattedAddress: string;
765
773
  city: string | null;
766
774
  state: string | null;
767
- formattedAddress: string;
768
775
  latitude: number | null;
769
776
  longitude: number | null;
770
777
  }>>;
@@ -821,23 +828,24 @@ export declare const discover: {
821
828
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
822
829
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
823
830
  id: string;
831
+ description: string | null;
824
832
  title: string;
825
- sportId: string;
826
833
  createdAt: Date;
827
834
  sport: {
828
835
  id: string;
829
836
  name: string;
830
837
  icon: string | null;
831
838
  } | null;
839
+ sportId: string;
832
840
  startsAt: Date;
833
841
  endsAt: Date | null;
834
842
  timezone: string;
835
843
  location: {
836
844
  id: string;
837
845
  name: string;
846
+ formattedAddress: string;
838
847
  city: string | null;
839
848
  state: string | null;
840
- formattedAddress: string;
841
849
  latitude: number | null;
842
850
  longitude: number | null;
843
851
  } | null;
@@ -884,23 +892,24 @@ export declare const discover: {
884
892
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
885
893
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
886
894
  id: string;
895
+ description: string | null;
887
896
  title: string;
888
- sportId: string;
889
897
  createdAt: Date;
890
898
  sport: {
891
899
  id: string;
892
900
  name: string;
893
901
  icon: string | null;
894
902
  } | null;
903
+ sportId: string;
895
904
  startsAt: Date;
896
905
  endsAt: Date | null;
897
906
  timezone: string;
898
907
  location: {
899
908
  id: string;
900
909
  name: string;
910
+ formattedAddress: string;
901
911
  city: string | null;
902
912
  state: string | null;
903
- formattedAddress: string;
904
913
  latitude: number | null;
905
914
  longitude: number | null;
906
915
  } | null;
@@ -961,16 +970,16 @@ export declare const discoverExternal: {
961
970
  to: z.ZodOptional<z.ZodString>;
962
971
  refresh: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
963
972
  }, "strip", z.ZodTypeAny, {
973
+ sportId: string;
964
974
  city: string;
965
975
  state: string;
966
- sportId: string;
967
976
  refresh: boolean;
968
977
  from?: string | undefined;
969
978
  to?: string | undefined;
970
979
  }, {
980
+ sportId: string;
971
981
  city: string;
972
982
  state: string;
973
- sportId: string;
974
983
  from?: string | undefined;
975
984
  to?: string | undefined;
976
985
  refresh?: boolean | undefined;
@@ -1100,8 +1109,6 @@ export declare const saveExternal: {
1100
1109
  city: z.ZodString;
1101
1110
  state: z.ZodString;
1102
1111
  }, "strip", z.ZodTypeAny, {
1103
- city: string;
1104
- state: string;
1105
1112
  events: {
1106
1113
  url: string;
1107
1114
  id: string;
@@ -1116,9 +1123,9 @@ export declare const saveExternal: {
1116
1123
  description?: string | undefined;
1117
1124
  endsAt?: string | undefined;
1118
1125
  }[];
1119
- }, {
1120
1126
  city: string;
1121
1127
  state: string;
1128
+ }, {
1122
1129
  events: {
1123
1130
  url: string;
1124
1131
  id: string;
@@ -1133,6 +1140,8 @@ export declare const saveExternal: {
1133
1140
  description?: string | undefined;
1134
1141
  endsAt?: string | undefined;
1135
1142
  }[];
1143
+ city: string;
1144
+ state: string;
1136
1145
  }>;
1137
1146
  };
1138
1147
  };
@@ -1206,6 +1215,7 @@ export declare const saveExternal: {
1206
1215
  groupId: z.ZodNullable<z.ZodString>;
1207
1216
  createdByUserId: z.ZodNullable<z.ZodString>;
1208
1217
  createdAt: z.ZodDate;
1218
+ description: z.ZodNullable<z.ZodString>;
1209
1219
  }, {
1210
1220
  sport: z.ZodNullable<z.ZodObject<{
1211
1221
  id: z.ZodString;
@@ -1231,17 +1241,17 @@ export declare const saveExternal: {
1231
1241
  }, "strip", z.ZodTypeAny, {
1232
1242
  id: string;
1233
1243
  name: string;
1244
+ formattedAddress: string;
1234
1245
  city: string | null;
1235
1246
  state: string | null;
1236
- formattedAddress: string;
1237
1247
  latitude: number | null;
1238
1248
  longitude: number | null;
1239
1249
  }, {
1240
1250
  id: string;
1241
1251
  name: string;
1252
+ formattedAddress: string;
1242
1253
  city: string | null;
1243
1254
  state: string | null;
1244
- formattedAddress: string;
1245
1255
  latitude: number | null;
1246
1256
  longitude: number | null;
1247
1257
  }>>;
@@ -1298,23 +1308,24 @@ export declare const saveExternal: {
1298
1308
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
1299
1309
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
1300
1310
  id: string;
1311
+ description: string | null;
1301
1312
  title: string;
1302
- sportId: string;
1303
1313
  createdAt: Date;
1304
1314
  sport: {
1305
1315
  id: string;
1306
1316
  name: string;
1307
1317
  icon: string | null;
1308
1318
  } | null;
1319
+ sportId: string;
1309
1320
  startsAt: Date;
1310
1321
  endsAt: Date | null;
1311
1322
  timezone: string;
1312
1323
  location: {
1313
1324
  id: string;
1314
1325
  name: string;
1326
+ formattedAddress: string;
1315
1327
  city: string | null;
1316
1328
  state: string | null;
1317
- formattedAddress: string;
1318
1329
  latitude: number | null;
1319
1330
  longitude: number | null;
1320
1331
  } | null;
@@ -1361,23 +1372,24 @@ export declare const saveExternal: {
1361
1372
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
1362
1373
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
1363
1374
  id: string;
1375
+ description: string | null;
1364
1376
  title: string;
1365
- sportId: string;
1366
1377
  createdAt: Date;
1367
1378
  sport: {
1368
1379
  id: string;
1369
1380
  name: string;
1370
1381
  icon: string | null;
1371
1382
  } | null;
1383
+ sportId: string;
1372
1384
  startsAt: Date;
1373
1385
  endsAt: Date | null;
1374
1386
  timezone: string;
1375
1387
  location: {
1376
1388
  id: string;
1377
1389
  name: string;
1390
+ formattedAddress: string;
1378
1391
  city: string | null;
1379
1392
  state: string | null;
1380
- formattedAddress: string;
1381
1393
  latitude: number | null;
1382
1394
  longitude: number | null;
1383
1395
  } | null;
@@ -1439,9 +1451,9 @@ export declare const chatRequestSchema: z.ZodObject<{
1439
1451
  enableWebSearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1440
1452
  }, "strip", z.ZodTypeAny, {
1441
1453
  message: string;
1454
+ sportId: string;
1442
1455
  city: string;
1443
1456
  state: string;
1444
- sportId: string;
1445
1457
  sportName: string;
1446
1458
  enableWebSearch: boolean;
1447
1459
  history?: {
@@ -1450,9 +1462,9 @@ export declare const chatRequestSchema: z.ZodObject<{
1450
1462
  }[] | undefined;
1451
1463
  }, {
1452
1464
  message: string;
1465
+ sportId: string;
1453
1466
  city: string;
1454
1467
  state: string;
1455
- sportId: string;
1456
1468
  sportName: string;
1457
1469
  history?: {
1458
1470
  content: string;
@@ -1564,9 +1576,9 @@ export declare const chat: {
1564
1576
  enableWebSearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1565
1577
  }, "strip", z.ZodTypeAny, {
1566
1578
  message: string;
1579
+ sportId: string;
1567
1580
  city: string;
1568
1581
  state: string;
1569
- sportId: string;
1570
1582
  sportName: string;
1571
1583
  enableWebSearch: boolean;
1572
1584
  history?: {
@@ -1575,9 +1587,9 @@ export declare const chat: {
1575
1587
  }[] | undefined;
1576
1588
  }, {
1577
1589
  message: string;
1590
+ sportId: string;
1578
1591
  city: string;
1579
1592
  state: string;
1580
- sportId: string;
1581
1593
  sportName: string;
1582
1594
  history?: {
1583
1595
  content: string;
@@ -62,6 +62,7 @@ export declare const eventWithRelationsSchema: z.ZodObject<z.objectUtil.extendSh
62
62
  groupId: z.ZodNullable<z.ZodString>;
63
63
  createdByUserId: z.ZodNullable<z.ZodString>;
64
64
  createdAt: z.ZodDate;
65
+ description: z.ZodNullable<z.ZodString>;
65
66
  }, {
66
67
  sport: z.ZodNullable<z.ZodObject<{
67
68
  id: z.ZodString;
@@ -87,17 +88,17 @@ export declare const eventWithRelationsSchema: z.ZodObject<z.objectUtil.extendSh
87
88
  }, "strip", z.ZodTypeAny, {
88
89
  id: string;
89
90
  name: string;
91
+ formattedAddress: string;
90
92
  city: string | null;
91
93
  state: string | null;
92
- formattedAddress: string;
93
94
  latitude: number | null;
94
95
  longitude: number | null;
95
96
  }, {
96
97
  id: string;
97
98
  name: string;
99
+ formattedAddress: string;
98
100
  city: string | null;
99
101
  state: string | null;
100
- formattedAddress: string;
101
102
  latitude: number | null;
102
103
  longitude: number | null;
103
104
  }>>;
@@ -154,23 +155,24 @@ export declare const eventWithRelationsSchema: z.ZodObject<z.objectUtil.extendSh
154
155
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
155
156
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
156
157
  id: string;
158
+ description: string | null;
157
159
  title: string;
158
- sportId: string;
159
160
  createdAt: Date;
160
161
  sport: {
161
162
  id: string;
162
163
  name: string;
163
164
  icon: string | null;
164
165
  } | null;
166
+ sportId: string;
165
167
  startsAt: Date;
166
168
  endsAt: Date | null;
167
169
  timezone: string;
168
170
  location: {
169
171
  id: string;
170
172
  name: string;
173
+ formattedAddress: string;
171
174
  city: string | null;
172
175
  state: string | null;
173
- formattedAddress: string;
174
176
  latitude: number | null;
175
177
  longitude: number | null;
176
178
  } | null;
@@ -217,23 +219,24 @@ export declare const eventWithRelationsSchema: z.ZodObject<z.objectUtil.extendSh
217
219
  [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
218
220
  } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
219
221
  id: string;
222
+ description: string | null;
220
223
  title: string;
221
- sportId: string;
222
224
  createdAt: Date;
223
225
  sport: {
224
226
  id: string;
225
227
  name: string;
226
228
  icon: string | null;
227
229
  } | null;
230
+ sportId: string;
228
231
  startsAt: Date;
229
232
  endsAt: Date | null;
230
233
  timezone: string;
231
234
  location: {
232
235
  id: string;
233
236
  name: string;
237
+ formattedAddress: string;
234
238
  city: string | null;
235
239
  state: string | null;
236
- formattedAddress: string;
237
240
  latitude: number | null;
238
241
  longitude: number | null;
239
242
  } | null;
@@ -270,18 +273,18 @@ export declare const listEventsQuerySchema: z.ZodObject<{
270
273
  radius: number;
271
274
  limit: number;
272
275
  offset: number;
276
+ sportId?: string | undefined;
273
277
  city?: string | undefined;
274
278
  state?: string | undefined;
275
- sportId?: string | undefined;
276
279
  latitude?: number | undefined;
277
280
  longitude?: number | undefined;
278
281
  source?: "external" | "community" | undefined;
279
282
  from?: Date | undefined;
280
283
  to?: Date | undefined;
281
284
  }, {
285
+ sportId?: string | undefined;
282
286
  city?: string | undefined;
283
287
  state?: string | undefined;
284
- sportId?: string | undefined;
285
288
  latitude?: number | undefined;
286
289
  longitude?: number | undefined;
287
290
  source?: "external" | "community" | undefined;
@@ -14,7 +14,7 @@ function slugify(name) {
14
14
  export const list = async (c) => {
15
15
  const { db } = createDb(c.env);
16
16
  const query = c.req.valid("query");
17
- const { sportId, source, search } = query;
17
+ const { sportId, platform, search } = query;
18
18
  const limit = query.limit ?? 20;
19
19
  const offset = query.offset ?? 0;
20
20
  const city = query.city?.trim();
@@ -23,8 +23,8 @@ export const list = async (c) => {
23
23
  if (sportId) {
24
24
  whereConditions.push(eq(group.sportId, sportId));
25
25
  }
26
- if (source) {
27
- whereConditions.push(eq(group.source, source));
26
+ if (platform) {
27
+ whereConditions.push(eq(group.platform, platform));
28
28
  }
29
29
  if (city) {
30
30
  whereConditions.push(ilike(group.city, city));
@@ -145,7 +145,6 @@ export const create = async (c) => {
145
145
  name: body.name,
146
146
  slug,
147
147
  description: body.description,
148
- source: "internal",
149
148
  sportId: body.sportId,
150
149
  city: body.city,
151
150
  state: body.state,
@@ -178,7 +177,7 @@ export const update = async (c) => {
178
177
  if (!existing) {
179
178
  return c.json({ message: HttpStatusPhrases.NOT_FOUND }, HttpStatusCodes.NOT_FOUND);
180
179
  }
181
- if (existing.source === "external") {
180
+ if (existing.platform) {
182
181
  return c.json({ message: "Cannot update external groups" }, HttpStatusCodes.UNAUTHORIZED);
183
182
  }
184
183
  if (existing.createdByUserId !== user.id) {