@bikefinder/api-client 0.4.0 → 0.5.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,6 +57,38 @@ 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
+
60
92
  export const zAdminFavoriteRequest = z.object({
61
93
  comment: z.string().max(4000),
62
94
  });
@@ -106,6 +138,36 @@ export const zAdminNotificationRequest = z.object({
106
138
  log: z.string().max(1000).nullish(),
107
139
  });
108
140
 
141
+ export const zAdminRelationshipKind = z.enum([
142
+ "subscriptionBinding",
143
+ "deviceAccount",
144
+ ]);
145
+
146
+ export const zAdminRelationshipChangeRequest = z.object({
147
+ accountIds: z.array(z.string()).min(1).max(20),
148
+ kind: zAdminRelationshipKind,
149
+ accountId: z.string().min(1).max(128),
150
+ expectedVersion: z.string().regex(/^[a-f0-9]{64}$/),
151
+ subscriptionId: z.string().nullish(),
152
+ allowLastAccountCleanup: z.boolean().optional().default(false),
153
+ });
154
+
155
+ export const zAdminRelationshipRequest = z.object({
156
+ accountIds: z.array(z.string()).min(1).max(20),
157
+ kind: zAdminRelationshipKind,
158
+ });
159
+
160
+ export const zAdminRelationshipVerification = z.object({
161
+ verified: z.boolean(),
162
+ });
163
+
164
+ export const zAdminRelationshipVerificationRequest = z.object({
165
+ kind: zAdminRelationshipKind,
166
+ accountId: z.string().min(1).max(128),
167
+ remainingAccountIds: z.array(z.string()).max(100),
168
+ subscriptionId: z.string().nullish(),
169
+ });
170
+
109
171
  export const zAdminRequestId = z.object({
110
172
  requestId: z
111
173
  .string()
@@ -189,6 +251,36 @@ export const zAdminTimestamp = z.object({
189
251
  }),
190
252
  });
191
253
 
254
+ export const zAdminEvidenceCursor = z.object({
255
+ timestamp: zAdminTimestamp,
256
+ id: z.string().min(1).max(254),
257
+ });
258
+
259
+ export const zAdminEvidenceDocument = z.object({
260
+ id: z.string(),
261
+ path: z.string(),
262
+ exists: z.boolean(),
263
+ fields: zAdminSupportValue.nullable(),
264
+ updatedAt: zAdminTimestamp.nullable(),
265
+ createdAt: zAdminTimestamp.nullable(),
266
+ readAt: zAdminTimestamp,
267
+ });
268
+
269
+ export const zAdminEvidenceHistoryRequest = z.object({
270
+ accountId: z.string().min(1).max(128),
271
+ source: zAdminEvidenceHistorySource,
272
+ from: z.iso.datetime({ offset: true }),
273
+ to: z.iso.datetime({ offset: true }),
274
+ after: zAdminEvidenceCursor.nullish(),
275
+ fields: z.array(zAdminEvidenceHistoryGroup).min(1).max(4).nullish(),
276
+ });
277
+
278
+ export const zAdminEvidenceSnapshot = z.object({
279
+ documents: z.array(zAdminEvidenceDocument),
280
+ relatedDocuments: z.array(zAdminEvidenceDocument),
281
+ readAt: zAdminTimestamp,
282
+ });
283
+
192
284
  export const zAdminTrackerCommand = z.enum([
193
285
  "changeEncryptionKey",
194
286
  "changeRareConfigs",
@@ -212,6 +304,12 @@ export const zAdminTrackerCommandResult = z.object({
212
304
  jobIds: z.array(z.string()),
213
305
  });
214
306
 
307
+ export const zAdminTrackerFactsRequest = z.object({
308
+ target: z.string().min(1).max(254),
309
+ accountIds: z.array(z.string()).min(1).max(20),
310
+ domain: zAdminEvidenceDomain,
311
+ });
312
+
215
313
  export const zCommandSuccess = z.object({
216
314
  success: z.boolean(),
217
315
  });
@@ -275,6 +373,155 @@ export const zProblemDetails = z.object({
275
373
  errors: z.record(z.string(), z.array(z.string())).optional(),
276
374
  });
277
375
 
376
+ export const zAdminListAccountTrackerEvidencePath = z.object({
377
+ accountId: z.string(),
378
+ });
379
+
380
+ export const zAdminListAccountTrackerEvidenceQuery = z.object({
381
+ after: z.string().optional(),
382
+ });
383
+
384
+ /**
385
+ * OK
386
+ */
387
+ export const zAdminListAccountTrackerEvidenceResponse = zAdminEvidenceSnapshot;
388
+
389
+ export const zAdminListAccountSubscriptionEvidencePath = z.object({
390
+ accountId: z.string(),
391
+ });
392
+
393
+ export const zAdminListAccountSubscriptionEvidenceQuery = z.object({
394
+ after: z.string().optional(),
395
+ });
396
+
397
+ /**
398
+ * OK
399
+ */
400
+ export const zAdminListAccountSubscriptionEvidenceResponse =
401
+ zAdminEvidenceSnapshot;
402
+
403
+ export const zAdminQueryTrackerFactEvidenceBody = zAdminTrackerFactsRequest;
404
+
405
+ /**
406
+ * OK
407
+ */
408
+ export const zAdminQueryTrackerFactEvidenceResponse = zAdminEvidenceSnapshot;
409
+
410
+ export const zAdminGetSubscriptionFactEvidencePath = z.object({
411
+ subscriptionId: z.string(),
412
+ });
413
+
414
+ export const zAdminGetSubscriptionFactEvidenceQuery = z.object({
415
+ domain: z.enum([
416
+ "battery",
417
+ "versions",
418
+ "reporting",
419
+ "configuration",
420
+ "membershipReference",
421
+ "membershipState",
422
+ "commerceReference",
423
+ "plan",
424
+ "availability",
425
+ "bindingCount",
426
+ ]),
427
+ });
428
+
429
+ /**
430
+ * OK
431
+ */
432
+ export const zAdminGetSubscriptionFactEvidenceResponse = zAdminEvidenceSnapshot;
433
+
434
+ export const zAdminQueryTrackerSubscriptionEvidenceBody =
435
+ zAdminEvidenceAccountsRequest;
436
+
437
+ export const zAdminQueryTrackerSubscriptionEvidencePath = z.object({
438
+ trackerId: z
439
+ .string()
440
+ .length(32)
441
+ .regex(/^[a-f0-9]{32}$/),
442
+ });
443
+
444
+ /**
445
+ * OK
446
+ */
447
+ export const zAdminQueryTrackerSubscriptionEvidenceResponse =
448
+ zAdminEvidenceSnapshot;
449
+
450
+ export const zAdminQueryCommerceBindingEvidenceBody =
451
+ zAdminEvidenceAccountsRequest;
452
+
453
+ export const zAdminQueryCommerceBindingEvidencePath = z.object({
454
+ wooId: z.int().gte(-9007199254740991).lte(9007199254740991),
455
+ });
456
+
457
+ /**
458
+ * OK
459
+ */
460
+ export const zAdminQueryCommerceBindingEvidenceResponse =
461
+ zAdminEvidenceSnapshot;
462
+
463
+ export const zAdminQueryTrackerHistoryEvidenceBody =
464
+ zAdminEvidenceHistoryRequest;
465
+
466
+ export const zAdminQueryTrackerHistoryEvidencePath = z.object({
467
+ trackerId: z
468
+ .string()
469
+ .length(32)
470
+ .regex(/^[a-f0-9]{32}$/),
471
+ });
472
+
473
+ /**
474
+ * OK
475
+ */
476
+ export const zAdminQueryTrackerHistoryEvidenceResponse = zAdminEvidenceSnapshot;
477
+
478
+ export const zAdminQueryTrackerRelationshipEvidenceBody =
479
+ zAdminRelationshipRequest;
480
+
481
+ export const zAdminQueryTrackerRelationshipEvidencePath = z.object({
482
+ trackerId: z
483
+ .string()
484
+ .length(32)
485
+ .regex(/^[a-f0-9]{32}$/),
486
+ });
487
+
488
+ /**
489
+ * OK
490
+ */
491
+ export const zAdminQueryTrackerRelationshipEvidenceResponse =
492
+ zAdminEvidenceSnapshot;
493
+
494
+ export const zAdminChangeTrackerRelationshipBody =
495
+ zAdminRelationshipChangeRequest;
496
+
497
+ export const zAdminChangeTrackerRelationshipPath = z.object({
498
+ trackerId: z
499
+ .string()
500
+ .length(32)
501
+ .regex(/^[a-f0-9]{32}$/),
502
+ });
503
+
504
+ /**
505
+ * OK
506
+ */
507
+ export const zAdminChangeTrackerRelationshipResponse = zCommandSuccess;
508
+
509
+ export const zAdminVerifyTrackerRelationshipBody =
510
+ zAdminRelationshipVerificationRequest;
511
+
512
+ export const zAdminVerifyTrackerRelationshipPath = z.object({
513
+ trackerId: z
514
+ .string()
515
+ .length(32)
516
+ .regex(/^[a-f0-9]{32}$/),
517
+ });
518
+
519
+ /**
520
+ * OK
521
+ */
522
+ export const zAdminVerifyTrackerRelationshipResponse =
523
+ zAdminRelationshipVerification;
524
+
278
525
  /**
279
526
  * OK
280
527
  */