@bikefinder/api-client 0.4.0 → 0.6.0

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.
@@ -57,12 +57,71 @@ export const zAdminDenylistRequest = z.object({
57
57
  reason: z.string().max(1000).nullish(),
58
58
  });
59
59
 
60
+ export const zAdminEvidenceAccountsRequest = z.object({
61
+ accountIds: z.array(z.string()).min(1).max(20),
62
+ });
63
+
64
+ export const zAdminEvidenceDomain = z.enum([
65
+ "battery",
66
+ "versions",
67
+ "reporting",
68
+ "configuration",
69
+ "membershipReference",
70
+ "membershipState",
71
+ "commerceReference",
72
+ "plan",
73
+ "availability",
74
+ "bindingCount",
75
+ ]);
76
+
77
+ export const zAdminEvidenceHistoryGroup = z.enum([
78
+ "battery",
79
+ "versions",
80
+ "reporting",
81
+ "diagnostics",
82
+ ]);
83
+
84
+ export const zAdminEvidenceHistorySource = z.enum([
85
+ "data",
86
+ "sanitizedData",
87
+ "bluetooth",
88
+ "audit",
89
+ "commandPackets",
90
+ ]);
91
+
92
+ export const zAdminEvidenceInsuranceRecords = z
93
+ .enum(["contracts", "creationAttempts"])
94
+ .default("contracts");
95
+
96
+ export const zAdminEvidenceLayout = z.enum(["legacy", "shared"]);
97
+
98
+ export const zAdminEvidenceOperationalDomain = z.enum([
99
+ "runtime",
100
+ "firmware",
101
+ "commands",
102
+ "statistics",
103
+ ]);
104
+
105
+ export const zAdminEvidencePageRequest = z.object({
106
+ accountIds: z.array(z.string()).min(1).max(20),
107
+ after: z.string().min(1).max(254).nullish(),
108
+ });
109
+
60
110
  export const zAdminFavoriteRequest = z.object({
61
111
  comment: z.string().max(4000),
62
112
  });
63
113
 
64
114
  export const zAdminGeneration = z.enum(["gen1", "gen2"]);
65
115
 
116
+ export const zAdminInsuranceProvider = z.enum(["cycler", "hepster", "tryg"]);
117
+
118
+ export const zAdminInsuranceEvidenceRequest = z.object({
119
+ accountIds: z.array(z.string()).min(1).max(20),
120
+ provider: zAdminInsuranceProvider,
121
+ records: zAdminEvidenceInsuranceRecords.optional(),
122
+ after: z.string().min(1).max(254).nullish(),
123
+ });
124
+
66
125
  export const zAdminLinkSubscriptionRequest = z.object({
67
126
  subscriptionId: z.string(),
68
127
  });
@@ -106,6 +165,41 @@ export const zAdminNotificationRequest = z.object({
106
165
  log: z.string().max(1000).nullish(),
107
166
  });
108
167
 
168
+ export const zAdminOperationalEvidenceRequest = z.object({
169
+ accountIds: z.array(z.string()).min(1).max(20),
170
+ domain: zAdminEvidenceOperationalDomain,
171
+ });
172
+
173
+ export const zAdminRelationshipKind = z.enum([
174
+ "subscriptionBinding",
175
+ "deviceAccount",
176
+ ]);
177
+
178
+ export const zAdminRelationshipChangeRequest = z.object({
179
+ accountIds: z.array(z.string()).min(1).max(20),
180
+ kind: zAdminRelationshipKind,
181
+ accountId: z.string().min(1).max(128),
182
+ expectedVersion: z.string().regex(/^[a-f0-9]{64}$/),
183
+ subscriptionId: z.string().nullish(),
184
+ allowLastAccountCleanup: z.boolean().optional().default(false),
185
+ });
186
+
187
+ export const zAdminRelationshipRequest = z.object({
188
+ accountIds: z.array(z.string()).min(1).max(20),
189
+ kind: zAdminRelationshipKind,
190
+ });
191
+
192
+ export const zAdminRelationshipVerification = z.object({
193
+ verified: z.boolean(),
194
+ });
195
+
196
+ export const zAdminRelationshipVerificationRequest = z.object({
197
+ kind: zAdminRelationshipKind,
198
+ accountId: z.string().min(1).max(128),
199
+ remainingAccountIds: z.array(z.string()).max(100),
200
+ subscriptionId: z.string().nullish(),
201
+ });
202
+
109
203
  export const zAdminRequestId = z.object({
110
204
  requestId: z
111
205
  .string()
@@ -189,6 +283,55 @@ export const zAdminTimestamp = z.object({
189
283
  }),
190
284
  });
191
285
 
286
+ export const zAdminEvidenceCursor = z.object({
287
+ timestamp: zAdminTimestamp,
288
+ id: z.string().min(1).max(254),
289
+ });
290
+
291
+ export const zAdminEvidenceDocument = z.object({
292
+ id: z.string(),
293
+ path: z.string(),
294
+ exists: z.boolean(),
295
+ fields: zAdminSupportValue.nullable(),
296
+ updatedAt: zAdminTimestamp.nullable(),
297
+ createdAt: zAdminTimestamp.nullable(),
298
+ readAt: zAdminTimestamp,
299
+ });
300
+
301
+ export const zAdminEvidenceHistoryRequest = z.object({
302
+ accountId: z.string().min(1).max(128),
303
+ source: zAdminEvidenceHistorySource,
304
+ from: z.iso.datetime({ offset: true }),
305
+ to: z.iso.datetime({ offset: true }),
306
+ after: zAdminEvidenceCursor.nullish(),
307
+ fields: z.array(zAdminEvidenceHistoryGroup).min(1).max(4).nullish(),
308
+ });
309
+
310
+ export const zAdminEvidenceSnapshot = z.object({
311
+ documents: z.array(zAdminEvidenceDocument),
312
+ relatedDocuments: z.array(zAdminEvidenceDocument),
313
+ readAt: zAdminTimestamp,
314
+ });
315
+
316
+ export const zAdminEvidencePage = z.object({
317
+ snapshot: zAdminEvidenceSnapshot,
318
+ nextAfter: z.string().nullable(),
319
+ scannedRecordCount: z
320
+ .int()
321
+ .min(-2147483648, {
322
+ error: "Invalid value: Expected int32 to be >= -2147483648",
323
+ })
324
+ .max(2147483647, {
325
+ error: "Invalid value: Expected int32 to be <= 2147483647",
326
+ }),
327
+ });
328
+
329
+ export const zAdminOperationalEvidence = z.object({
330
+ domain: zAdminEvidenceOperationalDomain,
331
+ layout: zAdminEvidenceLayout,
332
+ snapshot: zAdminEvidenceSnapshot,
333
+ });
334
+
192
335
  export const zAdminTrackerCommand = z.enum([
193
336
  "changeEncryptionKey",
194
337
  "changeRareConfigs",
@@ -212,6 +355,12 @@ export const zAdminTrackerCommandResult = z.object({
212
355
  jobIds: z.array(z.string()),
213
356
  });
214
357
 
358
+ export const zAdminTrackerFactsRequest = z.object({
359
+ target: z.string().min(1).max(254),
360
+ accountIds: z.array(z.string()).min(1).max(20),
361
+ domain: zAdminEvidenceDomain,
362
+ });
363
+
215
364
  export const zCommandSuccess = z.object({
216
365
  success: z.boolean(),
217
366
  });
@@ -275,6 +424,198 @@ export const zProblemDetails = z.object({
275
424
  errors: z.record(z.string(), z.array(z.string())).optional(),
276
425
  });
277
426
 
427
+ export const zAdminQueryTrackerOperationalEvidenceBody =
428
+ zAdminOperationalEvidenceRequest;
429
+
430
+ export const zAdminQueryTrackerOperationalEvidencePath = z.object({
431
+ trackerId: z
432
+ .string()
433
+ .length(32)
434
+ .regex(/^[a-f0-9]{32}$/),
435
+ });
436
+
437
+ /**
438
+ * OK
439
+ */
440
+ export const zAdminQueryTrackerOperationalEvidenceResponse =
441
+ zAdminOperationalEvidence;
442
+
443
+ export const zAdminQueryTrackerJobEvidenceBody = zAdminEvidencePageRequest;
444
+
445
+ export const zAdminQueryTrackerJobEvidencePath = z.object({
446
+ trackerId: z
447
+ .string()
448
+ .length(32)
449
+ .regex(/^[a-f0-9]{32}$/),
450
+ });
451
+
452
+ /**
453
+ * OK
454
+ */
455
+ export const zAdminQueryTrackerJobEvidenceResponse = zAdminEvidencePage;
456
+
457
+ export const zAdminQuerySubscriptionInsuranceEvidenceBody =
458
+ zAdminInsuranceEvidenceRequest;
459
+
460
+ export const zAdminQuerySubscriptionInsuranceEvidencePath = z.object({
461
+ subscriptionId: z.string(),
462
+ });
463
+
464
+ /**
465
+ * OK
466
+ */
467
+ export const zAdminQuerySubscriptionInsuranceEvidenceResponse =
468
+ zAdminEvidencePage;
469
+
470
+ export const zAdminListAccountTrackerEvidencePath = z.object({
471
+ accountId: z.string(),
472
+ });
473
+
474
+ export const zAdminListAccountTrackerEvidenceQuery = z.object({
475
+ after: z.string().optional(),
476
+ });
477
+
478
+ /**
479
+ * OK
480
+ */
481
+ export const zAdminListAccountTrackerEvidenceResponse = zAdminEvidenceSnapshot;
482
+
483
+ export const zAdminListAccountSubscriptionEvidencePath = z.object({
484
+ accountId: z.string(),
485
+ });
486
+
487
+ export const zAdminListAccountSubscriptionEvidenceQuery = z.object({
488
+ after: z.string().optional(),
489
+ });
490
+
491
+ /**
492
+ * OK
493
+ */
494
+ export const zAdminListAccountSubscriptionEvidenceResponse =
495
+ zAdminEvidenceSnapshot;
496
+
497
+ export const zAdminQueryTrackerFactEvidenceBody = zAdminTrackerFactsRequest;
498
+
499
+ /**
500
+ * OK
501
+ */
502
+ export const zAdminQueryTrackerFactEvidenceResponse = zAdminEvidenceSnapshot;
503
+
504
+ export const zAdminGetSubscriptionFactEvidencePath = z.object({
505
+ subscriptionId: z.string(),
506
+ });
507
+
508
+ export const zAdminGetSubscriptionFactEvidenceQuery = z.object({
509
+ domain: z.enum([
510
+ "battery",
511
+ "versions",
512
+ "reporting",
513
+ "configuration",
514
+ "membershipReference",
515
+ "membershipState",
516
+ "commerceReference",
517
+ "plan",
518
+ "availability",
519
+ "bindingCount",
520
+ ]),
521
+ });
522
+
523
+ /**
524
+ * OK
525
+ */
526
+ export const zAdminGetSubscriptionFactEvidenceResponse = zAdminEvidenceSnapshot;
527
+
528
+ export const zAdminQueryTrackerSubscriptionEvidenceBody =
529
+ zAdminEvidenceAccountsRequest;
530
+
531
+ export const zAdminQueryTrackerSubscriptionEvidencePath = z.object({
532
+ trackerId: z
533
+ .string()
534
+ .length(32)
535
+ .regex(/^[a-f0-9]{32}$/),
536
+ });
537
+
538
+ /**
539
+ * OK
540
+ */
541
+ export const zAdminQueryTrackerSubscriptionEvidenceResponse =
542
+ zAdminEvidenceSnapshot;
543
+
544
+ export const zAdminQueryCommerceBindingEvidenceBody =
545
+ zAdminEvidenceAccountsRequest;
546
+
547
+ export const zAdminQueryCommerceBindingEvidencePath = z.object({
548
+ wooId: z.int().gte(-9007199254740991).lte(9007199254740991),
549
+ });
550
+
551
+ /**
552
+ * OK
553
+ */
554
+ export const zAdminQueryCommerceBindingEvidenceResponse =
555
+ zAdminEvidenceSnapshot;
556
+
557
+ export const zAdminQueryTrackerHistoryEvidenceBody =
558
+ zAdminEvidenceHistoryRequest;
559
+
560
+ export const zAdminQueryTrackerHistoryEvidencePath = z.object({
561
+ trackerId: z
562
+ .string()
563
+ .length(32)
564
+ .regex(/^[a-f0-9]{32}$/),
565
+ });
566
+
567
+ /**
568
+ * OK
569
+ */
570
+ export const zAdminQueryTrackerHistoryEvidenceResponse = zAdminEvidenceSnapshot;
571
+
572
+ export const zAdminQueryTrackerRelationshipEvidenceBody =
573
+ zAdminRelationshipRequest;
574
+
575
+ export const zAdminQueryTrackerRelationshipEvidencePath = z.object({
576
+ trackerId: z
577
+ .string()
578
+ .length(32)
579
+ .regex(/^[a-f0-9]{32}$/),
580
+ });
581
+
582
+ /**
583
+ * OK
584
+ */
585
+ export const zAdminQueryTrackerRelationshipEvidenceResponse =
586
+ zAdminEvidenceSnapshot;
587
+
588
+ export const zAdminChangeTrackerRelationshipBody =
589
+ zAdminRelationshipChangeRequest;
590
+
591
+ export const zAdminChangeTrackerRelationshipPath = z.object({
592
+ trackerId: z
593
+ .string()
594
+ .length(32)
595
+ .regex(/^[a-f0-9]{32}$/),
596
+ });
597
+
598
+ /**
599
+ * OK
600
+ */
601
+ export const zAdminChangeTrackerRelationshipResponse = zCommandSuccess;
602
+
603
+ export const zAdminVerifyTrackerRelationshipBody =
604
+ zAdminRelationshipVerificationRequest;
605
+
606
+ export const zAdminVerifyTrackerRelationshipPath = z.object({
607
+ trackerId: z
608
+ .string()
609
+ .length(32)
610
+ .regex(/^[a-f0-9]{32}$/),
611
+ });
612
+
613
+ /**
614
+ * OK
615
+ */
616
+ export const zAdminVerifyTrackerRelationshipResponse =
617
+ zAdminRelationshipVerification;
618
+
278
619
  /**
279
620
  * OK
280
621
  */