@bikefinder/staff-sdk 0.10.0 → 0.11.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.
- package/README.md +7 -0
- package/dist/{chunk-OMGUXPBA.js → chunk-UBRRR6VL.js} +920 -869
- package/dist/index.d.ts +13714 -6262
- package/dist/index.js +17 -1
- package/dist/schemas.d.ts +13716 -6264
- package/dist/schemas.js +17 -1
- package/package.json +1 -1
|
@@ -243,107 +243,149 @@ var tracker = z2.object({
|
|
|
243
243
|
})
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
+
// ../staff-contracts/src/erasure.ts
|
|
247
|
+
import { oc } from "@orpc/contract";
|
|
248
|
+
import { z as z3 } from "zod";
|
|
249
|
+
var erasureSelection = z3.strictObject({ accountId: documentId });
|
|
250
|
+
var erasureReference = z3.strictObject({ requestId });
|
|
251
|
+
var erasurePolicy = "anonymize-financial-records-cancel-subscriptions-preserve-shared-trackers-v1";
|
|
252
|
+
var erasureReview = z3.strictObject({
|
|
253
|
+
accountId: documentId,
|
|
254
|
+
email: z3.email(),
|
|
255
|
+
emails: z3.array(z3.email()).min(1),
|
|
256
|
+
accountIds: z3.array(documentId).min(1),
|
|
257
|
+
exclusiveTrackers: z3.array(documentId),
|
|
258
|
+
sharedTrackers: z3.array(documentId),
|
|
259
|
+
policy: z3.literal(erasurePolicy),
|
|
260
|
+
version: z3.string().regex(/^[a-f0-9]{64}$/)
|
|
261
|
+
});
|
|
262
|
+
var erasureSubmission = erasureReference.extend({
|
|
263
|
+
accountId: documentId,
|
|
264
|
+
reviewVersion: z3.string().regex(/^[a-f0-9]{64}$/),
|
|
265
|
+
confirmation: z3.literal("ERASE CUSTOMER")
|
|
266
|
+
});
|
|
267
|
+
var erasureSystems = ["access", "commerce", "support", "firebase", "aws", "auth0"];
|
|
268
|
+
var erasureOperation = z3.strictObject({
|
|
269
|
+
requestId,
|
|
270
|
+
state: z3.enum(["running", "blocked", "completed"]),
|
|
271
|
+
policy: z3.literal(erasurePolicy),
|
|
272
|
+
systems: z3.array(z3.strictObject({
|
|
273
|
+
system: z3.enum(erasureSystems),
|
|
274
|
+
state: z3.enum(["pending", "completed", "blocked"]),
|
|
275
|
+
code: z3.string().nullable()
|
|
276
|
+
})),
|
|
277
|
+
createdAt: z3.iso.datetime(),
|
|
278
|
+
updatedAt: z3.iso.datetime(),
|
|
279
|
+
cleanupAfter: z3.iso.datetime().nullable()
|
|
280
|
+
});
|
|
281
|
+
var erasureContract = {
|
|
282
|
+
review: oc.meta({ operation: "read" }).errors(apiErrors).input(erasureSelection).output(erasureReview),
|
|
283
|
+
submit: oc.errors(apiErrors).input(erasureSubmission).output(erasureOperation),
|
|
284
|
+
get: oc.meta({ operation: "read" }).errors(apiErrors).input(erasureReference).output(erasureOperation),
|
|
285
|
+
retry: oc.errors(apiErrors).input(erasureReference).output(erasureOperation)
|
|
286
|
+
};
|
|
287
|
+
|
|
246
288
|
// ../staff-contracts/src/accounts.ts
|
|
247
|
-
import { oc as
|
|
248
|
-
import { z as
|
|
289
|
+
import { oc as oc10 } from "@orpc/contract";
|
|
290
|
+
import { z as z12 } from "zod";
|
|
249
291
|
|
|
250
292
|
// ../common-contracts/src/accounts.ts
|
|
251
|
-
import { oc as
|
|
252
|
-
import { z as
|
|
293
|
+
import { oc as oc4, eventIterator } from "@orpc/contract";
|
|
294
|
+
import { z as z6 } from "zod";
|
|
253
295
|
|
|
254
296
|
// ../common-contracts/src/push.ts
|
|
255
|
-
import { oc } from "@orpc/contract";
|
|
256
|
-
import { z as
|
|
257
|
-
var pushToken =
|
|
297
|
+
import { oc as oc2 } from "@orpc/contract";
|
|
298
|
+
import { z as z4 } from "zod";
|
|
299
|
+
var pushToken = z4.string().min(1).max(4096).refine(
|
|
258
300
|
(value) => value.trim().length > 0 && !/\p{Cc}/u.test(value) && !/^__.*__$/u.test(value) && // Tokens are literal Firestore field segments. Leave room for the parent and leaf paths.
|
|
259
301
|
new TextEncoder().encode(value.replace(/[\\`]/g, "\\$&")).length <= 1400,
|
|
260
302
|
"Use a valid push token that fits a literal field path."
|
|
261
303
|
);
|
|
262
|
-
var pushRegistrationInput =
|
|
304
|
+
var pushRegistrationInput = z4.strictObject({
|
|
263
305
|
installationId: requestId,
|
|
264
306
|
token: pushToken.nullable(),
|
|
265
|
-
platform:
|
|
266
|
-
permission:
|
|
267
|
-
replaceTokens:
|
|
307
|
+
platform: z4.enum(["android", "ios"]),
|
|
308
|
+
permission: z4.enum(["granted", "provisional", "denied", "not_determined"]),
|
|
309
|
+
replaceTokens: z4.array(pushToken).default([])
|
|
268
310
|
});
|
|
269
|
-
var pushRemovalInput =
|
|
311
|
+
var pushRemovalInput = z4.strictObject({ installationId: requestId });
|
|
270
312
|
var pushContract = {
|
|
271
|
-
register:
|
|
272
|
-
unregister:
|
|
313
|
+
register: oc2.errors(apiErrors).input(pushRegistrationInput).output(z4.void()),
|
|
314
|
+
unregister: oc2.errors(apiErrors).input(pushRemovalInput).output(z4.void())
|
|
273
315
|
};
|
|
274
316
|
|
|
275
317
|
// ../common-contracts/src/inbox.ts
|
|
276
|
-
import { oc as
|
|
277
|
-
import { z as
|
|
278
|
-
var notificationSource =
|
|
279
|
-
kind:
|
|
318
|
+
import { oc as oc3 } from "@orpc/contract";
|
|
319
|
+
import { z as z5 } from "zod";
|
|
320
|
+
var notificationSource = z5.object({
|
|
321
|
+
kind: z5.enum(["account", "subscription"]),
|
|
280
322
|
id: documentId
|
|
281
323
|
});
|
|
282
|
-
var inboxCursor =
|
|
324
|
+
var inboxCursor = z5.object({
|
|
283
325
|
...timeCursorFields,
|
|
284
326
|
source: notificationSource
|
|
285
327
|
});
|
|
286
|
-
var inboxPageInput =
|
|
328
|
+
var inboxPageInput = z5.strictObject({
|
|
287
329
|
limit: pageFields.limit,
|
|
288
330
|
after: inboxCursor.strict().extend({ source: notificationSource.strict() }).optional()
|
|
289
331
|
}).prefault({});
|
|
290
|
-
var notification =
|
|
332
|
+
var notification = z5.object({
|
|
291
333
|
id: documentId,
|
|
292
334
|
source: notificationSource,
|
|
293
|
-
type:
|
|
294
|
-
title:
|
|
295
|
-
body:
|
|
296
|
-
trackerId:
|
|
297
|
-
subscriptionId:
|
|
298
|
-
createdAt:
|
|
299
|
-
});
|
|
300
|
-
var inboxPage =
|
|
301
|
-
items:
|
|
335
|
+
type: z5.string().nullable(),
|
|
336
|
+
title: z5.string().nullable(),
|
|
337
|
+
body: z5.string().nullable(),
|
|
338
|
+
trackerId: z5.string().nullable(),
|
|
339
|
+
subscriptionId: z5.string().nullable(),
|
|
340
|
+
createdAt: z5.iso.datetime()
|
|
341
|
+
});
|
|
342
|
+
var inboxPage = z5.object({
|
|
343
|
+
items: z5.array(notification),
|
|
302
344
|
nextAfter: inboxCursor.nullable()
|
|
303
345
|
});
|
|
304
346
|
var inboxContract = {
|
|
305
|
-
list:
|
|
347
|
+
list: oc3.meta({ operation: "read" }).errors(inboxErrors).input(inboxPageInput).output(inboxPage)
|
|
306
348
|
};
|
|
307
349
|
|
|
308
350
|
// ../common-contracts/src/accounts.ts
|
|
309
|
-
var directoryProfile =
|
|
310
|
-
id:
|
|
311
|
-
email:
|
|
312
|
-
emailVerified:
|
|
313
|
-
name:
|
|
314
|
-
picture:
|
|
315
|
-
blocked:
|
|
316
|
-
});
|
|
317
|
-
var unit =
|
|
318
|
-
var mapStyle =
|
|
319
|
-
var accountPreferences =
|
|
320
|
-
alarm:
|
|
321
|
-
timeSensitive:
|
|
322
|
-
notifications:
|
|
323
|
-
language:
|
|
351
|
+
var directoryProfile = z6.object({
|
|
352
|
+
id: z6.string().min(1),
|
|
353
|
+
email: z6.string().nullable(),
|
|
354
|
+
emailVerified: z6.boolean().nullable(),
|
|
355
|
+
name: z6.string().nullable(),
|
|
356
|
+
picture: z6.string().nullable(),
|
|
357
|
+
blocked: z6.boolean().nullable()
|
|
358
|
+
});
|
|
359
|
+
var unit = z6.enum(["metric", "imperial"]);
|
|
360
|
+
var mapStyle = z6.enum(["minimal", "satellite"]);
|
|
361
|
+
var accountPreferences = z6.object({
|
|
362
|
+
alarm: z6.boolean(),
|
|
363
|
+
timeSensitive: z6.boolean(),
|
|
364
|
+
notifications: z6.boolean(),
|
|
365
|
+
language: z6.string().nullable(),
|
|
324
366
|
unit,
|
|
325
367
|
mapStyle
|
|
326
368
|
});
|
|
327
|
-
var account =
|
|
369
|
+
var account = z6.object({
|
|
328
370
|
...documentFields,
|
|
329
|
-
name:
|
|
330
|
-
email:
|
|
331
|
-
picture:
|
|
332
|
-
registeredAt:
|
|
371
|
+
name: z6.string().nullable(),
|
|
372
|
+
email: z6.string().nullable(),
|
|
373
|
+
picture: z6.string().nullable(),
|
|
374
|
+
registeredAt: z6.iso.datetime().nullable(),
|
|
333
375
|
preferences: accountPreferences,
|
|
334
|
-
readIssues:
|
|
376
|
+
readIssues: z6.array(readIssue)
|
|
335
377
|
});
|
|
336
|
-
var language =
|
|
378
|
+
var language = z6.string().min(2).max(64).refine((value) => {
|
|
337
379
|
try {
|
|
338
380
|
return Intl.getCanonicalLocales(value).length === 1;
|
|
339
381
|
} catch {
|
|
340
382
|
return false;
|
|
341
383
|
}
|
|
342
384
|
}, "Use a valid language tag.");
|
|
343
|
-
var accountPreferencePatch =
|
|
344
|
-
alarm:
|
|
345
|
-
timeSensitive:
|
|
346
|
-
notifications:
|
|
385
|
+
var accountPreferencePatch = z6.strictObject({
|
|
386
|
+
alarm: z6.boolean().optional(),
|
|
387
|
+
timeSensitive: z6.boolean().optional(),
|
|
388
|
+
notifications: z6.boolean().optional(),
|
|
347
389
|
language: language.nullable().optional(),
|
|
348
390
|
unit: unit.optional(),
|
|
349
391
|
mapStyle: mapStyle.optional()
|
|
@@ -354,123 +396,123 @@ var accountPreferencePatch = z5.strictObject({
|
|
|
354
396
|
var accountContract = {
|
|
355
397
|
inbox: inboxContract,
|
|
356
398
|
push: pushContract,
|
|
357
|
-
profile:
|
|
358
|
-
get:
|
|
359
|
-
watch:
|
|
360
|
-
initialize:
|
|
399
|
+
profile: oc4.meta({ operation: "read" }).errors(directoryErrors).input(z6.void()).output(directoryProfile),
|
|
400
|
+
get: oc4.meta({ operation: "read" }).errors(directoryErrors).input(z6.void()).output(account),
|
|
401
|
+
watch: oc4.meta({ operation: "read" }).errors(directoryErrors).input(z6.void()).output(eventIterator(account)),
|
|
402
|
+
initialize: oc4.errors(directoryErrors).input(z6.void()).output(z6.void()),
|
|
361
403
|
preferences: {
|
|
362
|
-
update:
|
|
404
|
+
update: oc4.errors(directoryErrors).input(accountPreferencePatch).output(z6.void())
|
|
363
405
|
}
|
|
364
406
|
};
|
|
365
407
|
|
|
366
408
|
// ../common-contracts/src/photos.ts
|
|
367
|
-
import { oc as
|
|
368
|
-
import { z as
|
|
369
|
-
var photoInput =
|
|
409
|
+
import { oc as oc5 } from "@orpc/contract";
|
|
410
|
+
import { z as z7 } from "zod";
|
|
411
|
+
var photoInput = z7.strictObject({
|
|
370
412
|
deviceId: documentId,
|
|
371
413
|
photoId: documentId
|
|
372
414
|
});
|
|
373
|
-
var photoPageInput =
|
|
415
|
+
var photoPageInput = z7.strictObject({
|
|
374
416
|
deviceId: documentId,
|
|
375
417
|
...pageFields
|
|
376
418
|
});
|
|
377
419
|
var photoDownloadInput = photoInput.extend({
|
|
378
|
-
variant:
|
|
420
|
+
variant: z7.enum(["original", "thumbnail"]).default("original")
|
|
379
421
|
});
|
|
380
|
-
var photo =
|
|
422
|
+
var photo = z7.object({
|
|
381
423
|
...documentFields,
|
|
382
|
-
kind:
|
|
383
|
-
width:
|
|
384
|
-
height:
|
|
385
|
-
sizeBytes:
|
|
386
|
-
isVertical:
|
|
387
|
-
contentType:
|
|
388
|
-
capturedAt:
|
|
389
|
-
});
|
|
390
|
-
var photoPage =
|
|
391
|
-
items:
|
|
424
|
+
kind: z7.string().nullable(),
|
|
425
|
+
width: z7.int().nullable(),
|
|
426
|
+
height: z7.int().nullable(),
|
|
427
|
+
sizeBytes: z7.int().nullable(),
|
|
428
|
+
isVertical: z7.boolean().nullable(),
|
|
429
|
+
contentType: z7.string().nullable(),
|
|
430
|
+
capturedAt: z7.iso.datetime().nullable()
|
|
431
|
+
});
|
|
432
|
+
var photoPage = z7.object({
|
|
433
|
+
items: z7.array(photo),
|
|
392
434
|
nextAfter: documentId.nullable()
|
|
393
435
|
});
|
|
394
|
-
var downloadReference =
|
|
395
|
-
url:
|
|
396
|
-
expiresAt:
|
|
397
|
-
contentType:
|
|
398
|
-
name:
|
|
436
|
+
var downloadReference = z7.object({
|
|
437
|
+
url: z7.url({ protocol: /^https$/ }),
|
|
438
|
+
expiresAt: z7.iso.datetime(),
|
|
439
|
+
contentType: z7.string(),
|
|
440
|
+
name: z7.string()
|
|
399
441
|
});
|
|
400
442
|
var trackerPhotoContract = {
|
|
401
|
-
list:
|
|
402
|
-
download:
|
|
403
|
-
delete:
|
|
443
|
+
list: oc5.meta({ operation: "read" }).errors(apiErrors).input(photoPageInput).output(photoPage),
|
|
444
|
+
download: oc5.meta({ operation: "read" }).errors(apiErrors).input(photoDownloadInput).output(downloadReference),
|
|
445
|
+
delete: oc5.errors(apiErrors).input(photoInput).output(z7.void())
|
|
404
446
|
};
|
|
405
447
|
|
|
406
448
|
// ../common-contracts/src/subscriptions.ts
|
|
407
|
-
import { oc as
|
|
408
|
-
import { z as
|
|
409
|
-
var subscription =
|
|
449
|
+
import { oc as oc6, eventIterator as eventIterator2 } from "@orpc/contract";
|
|
450
|
+
import { z as z8 } from "zod";
|
|
451
|
+
var subscription = z8.object({
|
|
410
452
|
...documentFields,
|
|
411
|
-
accountId:
|
|
412
|
-
name:
|
|
413
|
-
quantity:
|
|
414
|
-
available:
|
|
415
|
-
trackers:
|
|
416
|
-
|
|
417
|
-
trackerId:
|
|
418
|
-
addedAt:
|
|
453
|
+
accountId: z8.string().nullable(),
|
|
454
|
+
name: z8.string().nullable(),
|
|
455
|
+
quantity: z8.int().nullable(),
|
|
456
|
+
available: z8.int().nullable(),
|
|
457
|
+
trackers: z8.array(
|
|
458
|
+
z8.object({
|
|
459
|
+
trackerId: z8.string(),
|
|
460
|
+
addedAt: z8.iso.datetime().nullable()
|
|
419
461
|
})
|
|
420
462
|
),
|
|
421
|
-
active:
|
|
422
|
-
status:
|
|
423
|
-
endsAt:
|
|
424
|
-
nextPaymentAt:
|
|
425
|
-
managementUrl:
|
|
426
|
-
country:
|
|
427
|
-
demo:
|
|
428
|
-
type:
|
|
429
|
-
deleted:
|
|
430
|
-
});
|
|
431
|
-
var subscriptionPage =
|
|
432
|
-
items:
|
|
433
|
-
nextAfter:
|
|
463
|
+
active: z8.boolean().nullable(),
|
|
464
|
+
status: z8.string().nullable(),
|
|
465
|
+
endsAt: z8.iso.datetime().nullable(),
|
|
466
|
+
nextPaymentAt: z8.iso.datetime().nullable(),
|
|
467
|
+
managementUrl: z8.string().nullable(),
|
|
468
|
+
country: z8.string().nullable(),
|
|
469
|
+
demo: z8.boolean().nullable(),
|
|
470
|
+
type: z8.string().nullable(),
|
|
471
|
+
deleted: z8.boolean()
|
|
472
|
+
});
|
|
473
|
+
var subscriptionPage = z8.object({
|
|
474
|
+
items: z8.array(subscription),
|
|
475
|
+
nextAfter: z8.string().nullable()
|
|
434
476
|
});
|
|
435
477
|
var subscriptionContract = {
|
|
436
|
-
get:
|
|
437
|
-
list:
|
|
438
|
-
watch:
|
|
478
|
+
get: oc6.meta({ operation: "read" }).errors(subscriptionErrors).input(subscriptionInput).output(subscription),
|
|
479
|
+
list: oc6.meta({ operation: "read" }).errors(subscriptionErrors).input(pageInput).output(subscriptionPage),
|
|
480
|
+
watch: oc6.meta({ operation: "read" }).errors(subscriptionErrors).input(pageInput).output(eventIterator2(subscriptionPage))
|
|
439
481
|
};
|
|
440
|
-
var subscriptionAllocationInput =
|
|
482
|
+
var subscriptionAllocationInput = z8.strictObject({
|
|
441
483
|
deviceId: documentId,
|
|
442
484
|
subscriptionId: documentId.nullable(),
|
|
443
485
|
expectedSubscriptionId: documentId.nullable()
|
|
444
486
|
});
|
|
445
487
|
var subscriptionAllocationContract = {
|
|
446
|
-
change:
|
|
488
|
+
change: oc6.errors(subscriptionErrors).input(subscriptionAllocationInput).output(z8.void())
|
|
447
489
|
};
|
|
448
490
|
|
|
449
491
|
// ../common-contracts/src/realtime.ts
|
|
450
|
-
import { oc as
|
|
451
|
-
import { z as
|
|
452
|
-
var realtimeTicket =
|
|
453
|
-
ticket:
|
|
454
|
-
expiresAt:
|
|
455
|
-
webSocketUrl:
|
|
492
|
+
import { oc as oc7 } from "@orpc/contract";
|
|
493
|
+
import { z as z9 } from "zod";
|
|
494
|
+
var realtimeTicket = z9.object({
|
|
495
|
+
ticket: z9.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
496
|
+
expiresAt: z9.iso.datetime(),
|
|
497
|
+
webSocketUrl: z9.url({ protocol: /^wss?$/ })
|
|
456
498
|
});
|
|
457
499
|
var realtimeContract = {
|
|
458
|
-
ticket:
|
|
500
|
+
ticket: oc7.errors(apiErrors).input(z9.void()).output(realtimeTicket)
|
|
459
501
|
};
|
|
460
502
|
|
|
461
503
|
// ../common-contracts/src/tracker-changes.ts
|
|
462
|
-
import { z as
|
|
504
|
+
import { z as z10 } from "zod";
|
|
463
505
|
import Decimal from "decimal.js";
|
|
464
|
-
import { oc as
|
|
465
|
-
var text =
|
|
466
|
-
var price =
|
|
467
|
-
|
|
506
|
+
import { oc as oc8 } from "@orpc/contract";
|
|
507
|
+
var text = z10.string().max(200).regex(/^[^\p{Cc}]*$/u);
|
|
508
|
+
var price = z10.string().max(200).regex(/^(?:\d+(?:\.\d{0,2})?|\.\d{1,2})$/).pipe(
|
|
509
|
+
z10.string().refine(
|
|
468
510
|
(value) => new Decimal(value).lte("90071992547409"),
|
|
469
511
|
"The price is too large."
|
|
470
512
|
)
|
|
471
513
|
).transform((value) => new Decimal(value).toFixed(2));
|
|
472
|
-
var url =
|
|
473
|
-
var bikeChanges =
|
|
514
|
+
var url = z10.string().max(2048).regex(/^[^\p{Cc}]*$/u).pipe(z10.url({ protocol: /^https?$/ }).or(z10.literal("")));
|
|
515
|
+
var bikeChanges = z10.strictObject({
|
|
474
516
|
name: text.nullable().optional(),
|
|
475
517
|
brand: text.nullable().optional(),
|
|
476
518
|
type: text.nullable().optional(),
|
|
@@ -478,97 +520,98 @@ var bikeChanges = z9.strictObject({
|
|
|
478
520
|
frameNumber: text.nullable().optional(),
|
|
479
521
|
url: url.nullable().optional(),
|
|
480
522
|
marketPrice: price.nullable().optional(),
|
|
481
|
-
marketPriceCurrency:
|
|
523
|
+
marketPriceCurrency: z10.enum(["NOK", "SEK", "DKK", "EUR", "GBP", "USD"]).nullable().optional()
|
|
482
524
|
}).refine(
|
|
483
525
|
(changes2) => Object.values(changes2).some((value) => value !== void 0),
|
|
484
526
|
"Supply at least one changed bike field."
|
|
485
527
|
);
|
|
486
|
-
var bikeEditInput =
|
|
528
|
+
var bikeEditInput = z10.strictObject({
|
|
487
529
|
deviceId: documentId,
|
|
488
|
-
expectedRevision:
|
|
530
|
+
expectedRevision: z10.string().regex(/^[a-f0-9]{64}$/),
|
|
489
531
|
changes: bikeChanges
|
|
490
532
|
});
|
|
491
|
-
var membershipName =
|
|
492
|
-
var trackerClaimInput =
|
|
533
|
+
var membershipName = z10.string().min(1).max(100).regex(/^[^\p{Cc}]+$/u).refine((value) => value.trim().length > 0, "Supply a display name.");
|
|
534
|
+
var trackerClaimInput = z10.strictObject({
|
|
493
535
|
deviceId: documentId,
|
|
494
536
|
displayName: membershipName
|
|
495
537
|
});
|
|
496
|
-
var trackerMemberInput =
|
|
538
|
+
var trackerMemberInput = z10.strictObject({
|
|
497
539
|
deviceId: documentId,
|
|
498
540
|
memberId: documentId
|
|
499
541
|
});
|
|
500
542
|
var trackerMemberAddInput = trackerMemberInput.extend({
|
|
501
543
|
displayName: membershipName
|
|
502
544
|
});
|
|
503
|
-
var trackerMovementAlertsInput =
|
|
545
|
+
var trackerMovementAlertsInput = z10.strictObject({
|
|
504
546
|
deviceId: documentId,
|
|
505
|
-
enabled:
|
|
547
|
+
enabled: z10.boolean()
|
|
506
548
|
});
|
|
507
549
|
var trackerChangeContract = {
|
|
508
|
-
bike: { edit:
|
|
550
|
+
bike: { edit: oc8.errors(apiErrors).input(bikeEditInput).output(z10.void()) },
|
|
509
551
|
movementAlerts: {
|
|
510
|
-
set:
|
|
552
|
+
set: oc8.errors(apiErrors).input(trackerMovementAlertsInput).output(z10.void())
|
|
511
553
|
},
|
|
512
554
|
members: {
|
|
513
|
-
remove:
|
|
555
|
+
remove: oc8.errors(apiErrors).input(trackerMemberInput).output(z10.void())
|
|
514
556
|
}
|
|
515
557
|
};
|
|
516
558
|
|
|
517
559
|
// ../common-contracts/src/gcp/history.ts
|
|
518
|
-
import { oc as
|
|
519
|
-
import { z as
|
|
520
|
-
var historyCursor =
|
|
560
|
+
import { oc as oc9 } from "@orpc/contract";
|
|
561
|
+
import { z as z11 } from "zod";
|
|
562
|
+
var historyCursor = z11.object({
|
|
521
563
|
...timeCursorFields,
|
|
522
|
-
scope:
|
|
564
|
+
scope: z11.string().regex(/^[a-f0-9]{64}$/)
|
|
523
565
|
});
|
|
524
|
-
var historyInput =
|
|
566
|
+
var historyInput = z11.strictObject({
|
|
525
567
|
deviceId: documentId,
|
|
526
|
-
from:
|
|
527
|
-
until:
|
|
568
|
+
from: z11.iso.datetime(),
|
|
569
|
+
until: z11.iso.datetime(),
|
|
528
570
|
limit: pageFields.limit,
|
|
529
571
|
after: historyCursor.strict().optional()
|
|
530
572
|
});
|
|
531
|
-
var historyEntry =
|
|
573
|
+
var historyEntry = z11.object({
|
|
532
574
|
...documentFields,
|
|
533
|
-
type:
|
|
534
|
-
observedAt:
|
|
535
|
-
latitude:
|
|
536
|
-
longitude:
|
|
537
|
-
accuracy:
|
|
538
|
-
speed:
|
|
539
|
-
altitude:
|
|
540
|
-
heading:
|
|
541
|
-
source:
|
|
542
|
-
battery:
|
|
543
|
-
level:
|
|
544
|
-
isCharging:
|
|
545
|
-
source:
|
|
546
|
-
observedAt:
|
|
575
|
+
type: z11.string().nullable(),
|
|
576
|
+
observedAt: z11.iso.datetime().nullable(),
|
|
577
|
+
latitude: z11.number().nullable(),
|
|
578
|
+
longitude: z11.number().nullable(),
|
|
579
|
+
accuracy: z11.number().nullable(),
|
|
580
|
+
speed: z11.number().nullable(),
|
|
581
|
+
altitude: z11.number().nullable(),
|
|
582
|
+
heading: z11.number().nullable(),
|
|
583
|
+
source: z11.string().nullable(),
|
|
584
|
+
battery: z11.object({
|
|
585
|
+
level: z11.int().nullable(),
|
|
586
|
+
isCharging: z11.boolean().nullable(),
|
|
587
|
+
source: z11.string().nullable(),
|
|
588
|
+
observedAt: z11.iso.datetime().nullable()
|
|
547
589
|
}).nullable()
|
|
548
590
|
});
|
|
549
|
-
var historyPage =
|
|
550
|
-
items:
|
|
591
|
+
var historyPage = z11.object({
|
|
592
|
+
items: z11.array(historyEntry),
|
|
551
593
|
nextAfter: historyCursor.nullable()
|
|
552
594
|
});
|
|
553
|
-
var historyContract =
|
|
595
|
+
var historyContract = oc9.meta({ operation: "read" }).errors(apiErrors).input(historyInput).output(historyPage);
|
|
554
596
|
|
|
555
597
|
// ../staff-contracts/src/accounts.ts
|
|
556
|
-
var staffAccountInput =
|
|
557
|
-
var staffAccountEmail =
|
|
558
|
-
var staffAccount =
|
|
598
|
+
var staffAccountInput = z12.strictObject({ accountId: documentId });
|
|
599
|
+
var staffAccountEmail = z12.strictObject({ email: z12.email().max(254) });
|
|
600
|
+
var staffAccount = z12.object({
|
|
559
601
|
profile: directoryProfile.nullable(),
|
|
560
602
|
account: account.nullable()
|
|
561
603
|
});
|
|
562
604
|
var staffAccountContract = {
|
|
563
|
-
|
|
564
|
-
|
|
605
|
+
erasure: erasureContract,
|
|
606
|
+
get: oc10.meta({ operation: "read" }).errors(directoryErrors).input(staffAccountInput).output(staffAccount),
|
|
607
|
+
findEmail: oc10.meta({ operation: "read" }).errors(directoryErrors).input(staffAccountEmail).output(z12.array(directoryProfile))
|
|
565
608
|
};
|
|
566
609
|
|
|
567
610
|
// ../staff-contracts/src/aws/devices.ts
|
|
568
|
-
import { z as
|
|
611
|
+
import { z as z14 } from "zod";
|
|
569
612
|
|
|
570
613
|
// ../../../connectivity/packages/identity-contracts/index.ts
|
|
571
|
-
import { z as
|
|
614
|
+
import { z as z13 } from "zod";
|
|
572
615
|
var alphabet = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
573
616
|
function isDeviceSerial(value) {
|
|
574
617
|
if (!/^T[1-9][0-9A-HJKMNP-TV-Z]{6}$/.test(value)) return false;
|
|
@@ -582,21 +625,21 @@ function isDeviceSerial(value) {
|
|
|
582
625
|
}
|
|
583
626
|
return value[7] === alphabet[crc];
|
|
584
627
|
}
|
|
585
|
-
var deviceSerial =
|
|
586
|
-
var deviceId =
|
|
587
|
-
var identityIdentifier =
|
|
588
|
-
var deviceRegistration =
|
|
628
|
+
var deviceSerial = z13.string().refine(isDeviceSerial, "Use an exact canonical device serial.");
|
|
629
|
+
var deviceId = z13.string().regex(/^[a-f0-9]{32}$/);
|
|
630
|
+
var identityIdentifier = z13.union([deviceId, deviceSerial]);
|
|
631
|
+
var deviceRegistration = z13.strictObject({
|
|
589
632
|
serialNumber: deviceSerial,
|
|
590
633
|
deviceId,
|
|
591
|
-
hardwareGeneration:
|
|
634
|
+
hardwareGeneration: z13.int().min(1).max(9)
|
|
592
635
|
}).refine(
|
|
593
636
|
(value) => value.hardwareGeneration === Number(value.serialNumber[1]),
|
|
594
637
|
"The serial and hardware generation must match."
|
|
595
638
|
);
|
|
596
|
-
var resolveDeviceIdentity =
|
|
639
|
+
var resolveDeviceIdentity = z13.strictObject({
|
|
597
640
|
identifier: identityIdentifier
|
|
598
641
|
});
|
|
599
|
-
var wireRegistration =
|
|
642
|
+
var wireRegistration = z13.strictObject({
|
|
600
643
|
SerialNumber: deviceRegistration.shape.serialNumber,
|
|
601
644
|
DeviceId: deviceRegistration.shape.deviceId,
|
|
602
645
|
HardwareGeneration: deviceRegistration.shape.hardwareGeneration
|
|
@@ -605,27 +648,27 @@ var wireRegistration = z12.strictObject({
|
|
|
605
648
|
deviceId: value.DeviceId,
|
|
606
649
|
hardwareGeneration: value.HardwareGeneration
|
|
607
650
|
})).pipe(deviceRegistration);
|
|
608
|
-
var identityResolution =
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
Status:
|
|
612
|
-
Identity:
|
|
651
|
+
var identityResolution = z13.discriminatedUnion("Status", [
|
|
652
|
+
z13.strictObject({ Status: z13.literal("found"), Identity: wireRegistration }),
|
|
653
|
+
z13.strictObject({
|
|
654
|
+
Status: z13.enum(["missing", "inconsistent", "invalid", "unavailable"]),
|
|
655
|
+
Identity: z13.null().optional()
|
|
613
656
|
})
|
|
614
657
|
]).transform(
|
|
615
658
|
(value) => value.Status === "found" ? { status: value.Status, identity: value.Identity } : { status: value.Status, identity: null }
|
|
616
659
|
);
|
|
617
660
|
|
|
618
661
|
// ../staff-contracts/src/aws/devices.ts
|
|
619
|
-
var deviceInput =
|
|
620
|
-
var deviceLookupInput =
|
|
662
|
+
var deviceInput = z14.strictObject({ serialNumber: deviceSerial });
|
|
663
|
+
var deviceLookupInput = z14.union([
|
|
621
664
|
deviceInput,
|
|
622
|
-
|
|
665
|
+
z14.strictObject({ deviceId })
|
|
623
666
|
]);
|
|
624
667
|
|
|
625
668
|
// ../../../nucleus/packages/protocol/observations.ts
|
|
626
669
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
627
670
|
import addFormats from "ajv-formats";
|
|
628
|
-
import { z as
|
|
671
|
+
import { z as z15 } from "zod";
|
|
629
672
|
|
|
630
673
|
// ../../../nucleus/packages/protocol/Model/observations.schema.json
|
|
631
674
|
var observations_schema_default = {
|
|
@@ -11863,18 +11906,18 @@ var observations_schema_default = {
|
|
|
11863
11906
|
};
|
|
11864
11907
|
|
|
11865
11908
|
// ../../../nucleus/packages/protocol/observations.ts
|
|
11866
|
-
var batteryModuleId =
|
|
11909
|
+
var batteryModuleId = z15.string().regex(new RegExp(observations_schema_default.$defs.ModuleSubject.pattern));
|
|
11867
11910
|
var key = "bikefinder-observations";
|
|
11868
11911
|
var ajv = addFormats(
|
|
11869
11912
|
new Ajv2020({ strict: false, strictNumbers: true, discriminator: true })
|
|
11870
11913
|
).addSchema(observations_schema_default, key);
|
|
11871
11914
|
var reading = { $ref: `${key}#/$defs/Observation` };
|
|
11872
11915
|
var series = { $ref: `${key}#/$defs/ObservationSeries` };
|
|
11873
|
-
var observation =
|
|
11916
|
+
var observation = z15.custom((value) => {
|
|
11874
11917
|
const validate = ajv.compile(reading);
|
|
11875
11918
|
return validate(value) && isDeviceSerial(value.serialNumber);
|
|
11876
11919
|
}, "Invalid typed observation.");
|
|
11877
|
-
var observationSeries =
|
|
11920
|
+
var observationSeries = z15.custom(
|
|
11878
11921
|
(value) => ajv.compile(series)(value),
|
|
11879
11922
|
"Invalid observation series."
|
|
11880
11923
|
);
|
|
@@ -11886,7 +11929,7 @@ var reader = addFormats(
|
|
|
11886
11929
|
removeAdditional: true
|
|
11887
11930
|
})
|
|
11888
11931
|
).addSchema(observations_schema_default, key);
|
|
11889
|
-
var observationResponse =
|
|
11932
|
+
var observationResponse = z15.unknown().transform((input, context) => {
|
|
11890
11933
|
const value = structuredClone(input);
|
|
11891
11934
|
const validate = reader.compile(reading);
|
|
11892
11935
|
if (!validate(value) || !isDeviceSerial(value.serialNumber)) {
|
|
@@ -11894,11 +11937,11 @@ var observationResponse = z14.unknown().transform((input, context) => {
|
|
|
11894
11937
|
code: "custom",
|
|
11895
11938
|
message: "Invalid typed observation."
|
|
11896
11939
|
});
|
|
11897
|
-
return
|
|
11940
|
+
return z15.NEVER;
|
|
11898
11941
|
}
|
|
11899
11942
|
return value;
|
|
11900
11943
|
});
|
|
11901
|
-
var observationSeriesResponse =
|
|
11944
|
+
var observationSeriesResponse = z15.unknown().transform((input, context) => {
|
|
11902
11945
|
const value = structuredClone(input);
|
|
11903
11946
|
const validate = reader.compile(series);
|
|
11904
11947
|
if (!validate(value)) {
|
|
@@ -11906,13 +11949,13 @@ var observationSeriesResponse = z14.unknown().transform((input, context) => {
|
|
|
11906
11949
|
code: "custom",
|
|
11907
11950
|
message: "Invalid observation series."
|
|
11908
11951
|
});
|
|
11909
|
-
return
|
|
11952
|
+
return z15.NEVER;
|
|
11910
11953
|
}
|
|
11911
11954
|
return value;
|
|
11912
11955
|
});
|
|
11913
11956
|
|
|
11914
11957
|
// ../../../chronicle/packages/contracts/queries.ts
|
|
11915
|
-
import { z as
|
|
11958
|
+
import { z as z16 } from "zod";
|
|
11916
11959
|
|
|
11917
11960
|
// ../../../nucleus/packages/protocol/Model/observation-metadata.gen.ts
|
|
11918
11961
|
var observationDefinitions = [
|
|
@@ -14055,213 +14098,213 @@ var observationDefinitions = [
|
|
|
14055
14098
|
];
|
|
14056
14099
|
|
|
14057
14100
|
// ../../../chronicle/packages/contracts/queries.ts
|
|
14058
|
-
var observationName =
|
|
14101
|
+
var observationName = z16.enum(
|
|
14059
14102
|
observationDefinitions.map((value) => value.name)
|
|
14060
14103
|
);
|
|
14061
|
-
var observationId =
|
|
14062
|
-
var observationFilter =
|
|
14104
|
+
var observationId = z16.string().regex(/^[a-f0-9]{32}$/).refine((value) => value !== "0".repeat(32));
|
|
14105
|
+
var observationFilter = z16.strictObject({
|
|
14063
14106
|
type: observationName,
|
|
14064
|
-
subject:
|
|
14107
|
+
subject: z16.string().nullable().default(null)
|
|
14065
14108
|
}).refine(
|
|
14066
14109
|
(value) => value.subject === null || observationSeries.safeParse(value).success,
|
|
14067
14110
|
"Invalid observation subject."
|
|
14068
14111
|
);
|
|
14069
14112
|
var page = {
|
|
14070
|
-
limit:
|
|
14071
|
-
cursor:
|
|
14113
|
+
limit: z16.int().min(1).max(1e3).default(50),
|
|
14114
|
+
cursor: z16.string().min(1).max(16384).nullable().default(null)
|
|
14072
14115
|
};
|
|
14073
|
-
var rangeQuery =
|
|
14116
|
+
var rangeQuery = z16.strictObject({
|
|
14074
14117
|
serialNumber: deviceSerial,
|
|
14075
|
-
from:
|
|
14076
|
-
until:
|
|
14118
|
+
from: z16.iso.datetime({ offset: true }),
|
|
14119
|
+
until: z16.iso.datetime({ offset: true }),
|
|
14077
14120
|
filter: observationFilter.nullable().default(null),
|
|
14078
14121
|
...page,
|
|
14079
|
-
descending:
|
|
14080
|
-
includeItemCursors:
|
|
14122
|
+
descending: z16.boolean().default(false),
|
|
14123
|
+
includeItemCursors: z16.boolean().default(false)
|
|
14081
14124
|
});
|
|
14082
|
-
var commandQuery =
|
|
14125
|
+
var commandQuery = z16.strictObject({
|
|
14083
14126
|
serialNumber: deviceSerial,
|
|
14084
|
-
requestId:
|
|
14127
|
+
requestId: z16.int().min(1).max(4294967295),
|
|
14085
14128
|
...page
|
|
14086
14129
|
});
|
|
14087
14130
|
|
|
14088
14131
|
// ../staff-contracts/src/aws/observations.ts
|
|
14089
|
-
import { oc as
|
|
14090
|
-
import { z as
|
|
14091
|
-
var observationReadInput =
|
|
14132
|
+
import { oc as oc11, eventIterator as eventIterator3 } from "@orpc/contract";
|
|
14133
|
+
import { z as z17 } from "zod";
|
|
14134
|
+
var observationReadInput = z17.strictObject({
|
|
14092
14135
|
serialNumber: deviceSerial,
|
|
14093
14136
|
observationId
|
|
14094
14137
|
});
|
|
14095
|
-
var observationHistoryInput =
|
|
14138
|
+
var observationHistoryInput = z17.strictObject({
|
|
14096
14139
|
serialNumber: deviceSerial,
|
|
14097
|
-
from:
|
|
14098
|
-
until:
|
|
14140
|
+
from: z17.iso.datetime(),
|
|
14141
|
+
until: z17.iso.datetime(),
|
|
14099
14142
|
filter: observationFilter.nullable().optional(),
|
|
14100
14143
|
limit: pageFields.limit,
|
|
14101
|
-
after:
|
|
14144
|
+
after: z17.string().min(1).max(16384).optional()
|
|
14102
14145
|
});
|
|
14103
|
-
var observationSelectionInput =
|
|
14146
|
+
var observationSelectionInput = z17.strictObject({
|
|
14104
14147
|
serialNumber: deviceSerial,
|
|
14105
|
-
series:
|
|
14148
|
+
series: z17.array(observationSeries).min(1)
|
|
14106
14149
|
});
|
|
14107
|
-
var observationEventsInput =
|
|
14150
|
+
var observationEventsInput = z17.strictObject({
|
|
14108
14151
|
serialNumber: deviceSerial
|
|
14109
14152
|
});
|
|
14110
|
-
var observationPage =
|
|
14111
|
-
items:
|
|
14112
|
-
nextAfter:
|
|
14153
|
+
var observationPage = z17.object({
|
|
14154
|
+
items: z17.array(observationResponse),
|
|
14155
|
+
nextAfter: z17.string().nullable()
|
|
14113
14156
|
});
|
|
14114
|
-
var currentObservation =
|
|
14157
|
+
var currentObservation = z17.object({
|
|
14115
14158
|
series: observationSeriesResponse,
|
|
14116
14159
|
observation: observationResponse.nullable()
|
|
14117
14160
|
});
|
|
14118
14161
|
var staffObservationContract = {
|
|
14119
|
-
events:
|
|
14120
|
-
watch:
|
|
14121
|
-
get:
|
|
14122
|
-
history:
|
|
14123
|
-
current:
|
|
14162
|
+
events: oc11.meta({ operation: "read" }).errors(apiErrors).input(observationEventsInput).output(eventIterator3(observationResponse)),
|
|
14163
|
+
watch: oc11.meta({ operation: "read" }).errors(apiErrors).input(observationSelectionInput).output(eventIterator3(z17.array(currentObservation))),
|
|
14164
|
+
get: oc11.meta({ operation: "read" }).errors(apiErrors).input(observationReadInput).output(observationResponse),
|
|
14165
|
+
history: oc11.meta({ operation: "read" }).errors(apiErrors).input(observationHistoryInput).output(observationPage),
|
|
14166
|
+
current: oc11.meta({ operation: "read" }).errors(apiErrors).input(observationSelectionInput).output(z17.array(currentObservation))
|
|
14124
14167
|
};
|
|
14125
14168
|
|
|
14126
14169
|
// ../../../connectivity/packages/configuration-contracts/Model/zod.gen.ts
|
|
14127
|
-
import * as
|
|
14128
|
-
var zDeviceSettings =
|
|
14129
|
-
batteryIntervalSeconds:
|
|
14130
|
-
accTapSensitivity:
|
|
14131
|
-
accOdrRate:
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
|
|
14170
|
+
import * as z18 from "zod";
|
|
14171
|
+
var zDeviceSettings = z18.object({
|
|
14172
|
+
batteryIntervalSeconds: z18.int().gte(1).lte(86400).optional(),
|
|
14173
|
+
accTapSensitivity: z18.int().gte(1).lte(4095).optional(),
|
|
14174
|
+
accOdrRate: z18.union([
|
|
14175
|
+
z18.literal(0),
|
|
14176
|
+
z18.literal(1),
|
|
14177
|
+
z18.literal(2),
|
|
14178
|
+
z18.literal(3),
|
|
14179
|
+
z18.literal(4),
|
|
14180
|
+
z18.literal(8),
|
|
14181
|
+
z18.literal(9),
|
|
14182
|
+
z18.literal(10),
|
|
14183
|
+
z18.literal(11)
|
|
14141
14184
|
]).optional(),
|
|
14142
|
-
accSamplingRate:
|
|
14143
|
-
accMovementCount:
|
|
14144
|
-
chargingInputCurrentLimit:
|
|
14145
|
-
ltePowerDiagnostics:
|
|
14146
|
-
modemMemoryDiagnostics:
|
|
14147
|
-
trackingDiagnostics:
|
|
14148
|
-
modemTrace:
|
|
14149
|
-
mqttSessionExpirySeconds:
|
|
14150
|
-
shadowReconcileSeconds:
|
|
14151
|
-
mqttKeepAliveSeconds:
|
|
14152
|
-
chargingMode:
|
|
14153
|
-
networkRetryBaseSeconds:
|
|
14154
|
-
networkRetryMaxSeconds:
|
|
14155
|
-
networkConfigurationCooldownSeconds:
|
|
14156
|
-
shadowRetryBaseSeconds:
|
|
14157
|
-
shadowRetryMaxSeconds:
|
|
14158
|
-
automaticTelemetryEnabled:
|
|
14159
|
-
telemetryOutboxMaxBytes:
|
|
14160
|
-
fuelGaugeIdlePowerSavingEnabled:
|
|
14161
|
-
chargingSequentialBalanceIntervalSeconds:
|
|
14162
|
-
chargingSequentialBalanceGapPercent:
|
|
14163
|
-
chargingMaxModules:
|
|
14164
|
-
chargingTotalInputLimitMilliamps:
|
|
14165
|
-
i2cIdlePowerSavingEnabled:
|
|
14166
|
-
bleAdvertisingEnabled:
|
|
14167
|
-
bleAdvertisingRequiresExternalPower:
|
|
14168
|
-
bleAdvertisingIntervalUnits:
|
|
14169
|
-
reportIntervalOnExternalPowerSeconds:
|
|
14170
|
-
movementCooldownSeconds:
|
|
14171
|
-
gnssSearchTimeoutSeconds:
|
|
14172
|
-
edrxCycleMilliseconds:
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14185
|
+
accSamplingRate: z18.int().gte(0).lte(7).optional(),
|
|
14186
|
+
accMovementCount: z18.int().gte(1).lte(255).optional(),
|
|
14187
|
+
chargingInputCurrentLimit: z18.int().gte(0).lte(3).optional(),
|
|
14188
|
+
ltePowerDiagnostics: z18.boolean().optional(),
|
|
14189
|
+
modemMemoryDiagnostics: z18.boolean().optional(),
|
|
14190
|
+
trackingDiagnostics: z18.boolean().optional(),
|
|
14191
|
+
modemTrace: z18.boolean().optional(),
|
|
14192
|
+
mqttSessionExpirySeconds: z18.int().gte(60).lte(604800).optional(),
|
|
14193
|
+
shadowReconcileSeconds: z18.int().gte(0).lte(2592e3).optional(),
|
|
14194
|
+
mqttKeepAliveSeconds: z18.int().gte(30).lte(1200).optional(),
|
|
14195
|
+
chargingMode: z18.int().gte(0).lte(2).optional(),
|
|
14196
|
+
networkRetryBaseSeconds: z18.int().gte(10).lte(3600).optional(),
|
|
14197
|
+
networkRetryMaxSeconds: z18.int().gte(10).lte(86400).optional(),
|
|
14198
|
+
networkConfigurationCooldownSeconds: z18.int().gte(60).lte(21600).optional(),
|
|
14199
|
+
shadowRetryBaseSeconds: z18.int().gte(5).lte(3600).optional(),
|
|
14200
|
+
shadowRetryMaxSeconds: z18.int().gte(60).lte(86400).optional(),
|
|
14201
|
+
automaticTelemetryEnabled: z18.boolean().optional(),
|
|
14202
|
+
telemetryOutboxMaxBytes: z18.int().gte(256).lte(32768).optional(),
|
|
14203
|
+
fuelGaugeIdlePowerSavingEnabled: z18.boolean().optional(),
|
|
14204
|
+
chargingSequentialBalanceIntervalSeconds: z18.int().gte(60).lte(3600).optional(),
|
|
14205
|
+
chargingSequentialBalanceGapPercent: z18.int().gte(1).lte(25).optional(),
|
|
14206
|
+
chargingMaxModules: z18.int().gte(1).lte(8).optional(),
|
|
14207
|
+
chargingTotalInputLimitMilliamps: z18.int().gte(100).lte(3200).optional(),
|
|
14208
|
+
i2cIdlePowerSavingEnabled: z18.boolean().optional(),
|
|
14209
|
+
bleAdvertisingEnabled: z18.boolean().optional(),
|
|
14210
|
+
bleAdvertisingRequiresExternalPower: z18.boolean().optional(),
|
|
14211
|
+
bleAdvertisingIntervalUnits: z18.int().gte(32).lte(16384).optional(),
|
|
14212
|
+
reportIntervalOnExternalPowerSeconds: z18.int().gte(0).lte(86400).optional(),
|
|
14213
|
+
movementCooldownSeconds: z18.int().gte(0).lte(86400).optional(),
|
|
14214
|
+
gnssSearchTimeoutSeconds: z18.int().gte(1).lte(3600).optional(),
|
|
14215
|
+
edrxCycleMilliseconds: z18.union([
|
|
14216
|
+
z18.literal(0),
|
|
14217
|
+
z18.literal(20480),
|
|
14218
|
+
z18.literal(40960),
|
|
14219
|
+
z18.literal(81920),
|
|
14220
|
+
z18.literal(163840),
|
|
14221
|
+
z18.literal(327680),
|
|
14222
|
+
z18.literal(655360),
|
|
14223
|
+
z18.literal(1310720),
|
|
14224
|
+
z18.literal(2621440)
|
|
14182
14225
|
]).optional(),
|
|
14183
|
-
automaticDiagnosticsPower:
|
|
14184
|
-
chargingTerminationCurrentMa:
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14226
|
+
automaticDiagnosticsPower: z18.enum(["any", "external"]).optional(),
|
|
14227
|
+
chargingTerminationCurrentMa: z18.union([
|
|
14228
|
+
z18.literal(18),
|
|
14229
|
+
z18.literal(37),
|
|
14230
|
+
z18.literal(55)
|
|
14188
14231
|
]).optional(),
|
|
14189
|
-
chargingRechargeDropMv:
|
|
14190
|
-
chargingRegulationVoltageMv:
|
|
14191
|
-
chargingTemperatureColdStopC:
|
|
14192
|
-
chargingTemperatureColdLimitC:
|
|
14193
|
-
chargingTemperatureColdLimitRecoveryC:
|
|
14194
|
-
chargingTemperatureWarmLimitC:
|
|
14195
|
-
chargingTemperatureHotStopC:
|
|
14196
|
-
chargingTemperatureColdStopRecoveryC:
|
|
14197
|
-
chargingTemperatureWarmLimitRecoveryC:
|
|
14198
|
-
chargingTemperatureHotStopRecoveryC:
|
|
14199
|
-
chargingLeaseSeconds:
|
|
14200
|
-
wifiTimeoutSeconds:
|
|
14201
|
-
wifiScanActiveMinMs:
|
|
14202
|
-
wifiScanActiveMaxMs:
|
|
14203
|
-
wifiScanPassiveMs:
|
|
14204
|
-
wifiScanChannelMask:
|
|
14205
|
-
wifiScanBudgetMs:
|
|
14206
|
-
wifiScanType:
|
|
14207
|
-
chargingStatusMaxAgeSeconds:
|
|
14208
|
-
reportIntervalOnBatterySeconds:
|
|
14232
|
+
chargingRechargeDropMv: z18.int().gte(80).lte(200).optional(),
|
|
14233
|
+
chargingRegulationVoltageMv: z18.int().gte(3500).lte(4440).optional(),
|
|
14234
|
+
chargingTemperatureColdStopC: z18.int().gte(0).lte(44).optional(),
|
|
14235
|
+
chargingTemperatureColdLimitC: z18.int().gte(0).lte(44).optional(),
|
|
14236
|
+
chargingTemperatureColdLimitRecoveryC: z18.int().gte(1).lte(45).optional(),
|
|
14237
|
+
chargingTemperatureWarmLimitC: z18.int().gte(1).lte(45).optional(),
|
|
14238
|
+
chargingTemperatureHotStopC: z18.int().gte(1).lte(45).optional(),
|
|
14239
|
+
chargingTemperatureColdStopRecoveryC: z18.int().gte(1).lte(45).optional(),
|
|
14240
|
+
chargingTemperatureWarmLimitRecoveryC: z18.int().gte(0).lte(44).optional(),
|
|
14241
|
+
chargingTemperatureHotStopRecoveryC: z18.int().gte(0).lte(44).optional(),
|
|
14242
|
+
chargingLeaseSeconds: z18.int().gte(1).lte(4294967295).optional(),
|
|
14243
|
+
wifiTimeoutSeconds: z18.int().gte(1).lte(120).optional(),
|
|
14244
|
+
wifiScanActiveMinMs: z18.int().gte(1).lte(1500).optional(),
|
|
14245
|
+
wifiScanActiveMaxMs: z18.int().gte(1).lte(1500).optional(),
|
|
14246
|
+
wifiScanPassiveMs: z18.int().gte(1).lte(1500).optional(),
|
|
14247
|
+
wifiScanChannelMask: z18.int().gte(0).lte(16383).optional(),
|
|
14248
|
+
wifiScanBudgetMs: z18.int().gte(100).lte(6e4).optional(),
|
|
14249
|
+
wifiScanType: z18.enum(["active", "passive"]).optional(),
|
|
14250
|
+
chargingStatusMaxAgeSeconds: z18.int().gte(30).lte(86400).optional(),
|
|
14251
|
+
reportIntervalOnBatterySeconds: z18.int().gte(0).lte(86400).optional()
|
|
14209
14252
|
}).strict();
|
|
14210
14253
|
|
|
14211
14254
|
// ../../../connectivity/packages/configuration-contracts/index.ts
|
|
14212
|
-
import { z as
|
|
14213
|
-
var shadowVersion =
|
|
14214
|
-
var configurationApplicationState =
|
|
14255
|
+
import { z as z19 } from "zod";
|
|
14256
|
+
var shadowVersion = z19.int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
14257
|
+
var configurationApplicationState = z19.enum([
|
|
14215
14258
|
"applied",
|
|
14216
14259
|
"pending",
|
|
14217
14260
|
"rejected"
|
|
14218
14261
|
]);
|
|
14219
|
-
var settingsApplicationStatus =
|
|
14262
|
+
var settingsApplicationStatus = z19.strictObject({
|
|
14220
14263
|
state: configurationApplicationState,
|
|
14221
14264
|
appliedShadowVersion: shadowVersion,
|
|
14222
14265
|
desiredShadowVersion: shadowVersion,
|
|
14223
|
-
error:
|
|
14266
|
+
error: z19.int32()
|
|
14224
14267
|
});
|
|
14225
|
-
var connectionApplicationStatus =
|
|
14268
|
+
var connectionApplicationStatus = z19.strictObject({
|
|
14226
14269
|
state: configurationApplicationState,
|
|
14227
|
-
appliedRevision:
|
|
14228
|
-
candidateRevision:
|
|
14229
|
-
rejectedRevision:
|
|
14230
|
-
error:
|
|
14270
|
+
appliedRevision: z19.uint32(),
|
|
14271
|
+
candidateRevision: z19.uint32(),
|
|
14272
|
+
rejectedRevision: z19.uint32(),
|
|
14273
|
+
error: z19.int32()
|
|
14231
14274
|
});
|
|
14232
14275
|
|
|
14233
14276
|
// ../staff-contracts/src/aws/settings.ts
|
|
14234
|
-
import { oc as
|
|
14235
|
-
import { z as
|
|
14236
|
-
var settingsCapabilities =
|
|
14237
|
-
modemTrace:
|
|
14238
|
-
gnssVisibilityDetection:
|
|
14239
|
-
lteRai:
|
|
14240
|
-
ltePowerDiagnostics:
|
|
14241
|
-
modemMemoryDiagnostics:
|
|
14242
|
-
trackingDiagnostics:
|
|
14243
|
-
diagnosticCommands:
|
|
14244
|
-
});
|
|
14245
|
-
var settingsReadIssue =
|
|
14246
|
-
path:
|
|
14247
|
-
code:
|
|
14248
|
-
});
|
|
14249
|
-
var settingsSnapshot =
|
|
14277
|
+
import { oc as oc12, eventIterator as eventIterator4 } from "@orpc/contract";
|
|
14278
|
+
import { z as z20 } from "zod";
|
|
14279
|
+
var settingsCapabilities = z20.object({
|
|
14280
|
+
modemTrace: z20.boolean().optional(),
|
|
14281
|
+
gnssVisibilityDetection: z20.boolean().optional(),
|
|
14282
|
+
lteRai: z20.boolean().optional(),
|
|
14283
|
+
ltePowerDiagnostics: z20.boolean().optional(),
|
|
14284
|
+
modemMemoryDiagnostics: z20.boolean().optional(),
|
|
14285
|
+
trackingDiagnostics: z20.boolean().optional(),
|
|
14286
|
+
diagnosticCommands: z20.boolean().optional()
|
|
14287
|
+
});
|
|
14288
|
+
var settingsReadIssue = z20.object({
|
|
14289
|
+
path: z20.string(),
|
|
14290
|
+
code: z20.enum(["invalid_stored_value", "unknown_setting"])
|
|
14291
|
+
});
|
|
14292
|
+
var settingsSnapshot = z20.object({
|
|
14250
14293
|
version: shadowVersion,
|
|
14251
|
-
exists:
|
|
14294
|
+
exists: z20.boolean(),
|
|
14252
14295
|
desired: zDeviceSettings.strip(),
|
|
14253
14296
|
reported: zDeviceSettings.strip(),
|
|
14254
|
-
application:
|
|
14297
|
+
application: z20.object({
|
|
14255
14298
|
settings: settingsApplicationStatus.strip().nullable(),
|
|
14256
14299
|
connection: connectionApplicationStatus.strip().nullable()
|
|
14257
14300
|
}),
|
|
14258
14301
|
capabilities: settingsCapabilities.nullable(),
|
|
14259
|
-
schemaVersion:
|
|
14302
|
+
schemaVersion: z20.uint32().nullable(),
|
|
14260
14303
|
completeVersion: shadowVersion.nullable(),
|
|
14261
|
-
readIssues:
|
|
14304
|
+
readIssues: z20.array(settingsReadIssue)
|
|
14262
14305
|
});
|
|
14263
|
-
var settingsReadInput =
|
|
14264
|
-
var settingsUpdateInput =
|
|
14306
|
+
var settingsReadInput = z20.strictObject({ serialNumber: deviceSerial });
|
|
14307
|
+
var settingsUpdateInput = z20.strictObject({
|
|
14265
14308
|
serialNumber: deviceSerial,
|
|
14266
14309
|
expectedVersion: shadowVersion.min(1),
|
|
14267
14310
|
settings: zDeviceSettings.refine(
|
|
@@ -14276,9 +14319,9 @@ var settingsErrors = {
|
|
|
14276
14319
|
shadow_changed: { ...apiErrors.conflict, status: 412 }
|
|
14277
14320
|
};
|
|
14278
14321
|
var staffSettingsContract = {
|
|
14279
|
-
watch:
|
|
14280
|
-
get:
|
|
14281
|
-
update:
|
|
14322
|
+
watch: oc12.meta({ operation: "read" }).errors(settingsErrors).input(settingsReadInput).output(eventIterator4(settingsSnapshot)),
|
|
14323
|
+
get: oc12.meta({ operation: "read" }).errors(settingsErrors).input(settingsReadInput).output(settingsSnapshot),
|
|
14324
|
+
update: oc12.errors(settingsErrors).input(settingsUpdateInput).output(settingsSnapshot)
|
|
14282
14325
|
};
|
|
14283
14326
|
|
|
14284
14327
|
// ../../../commander/packages/contracts/Model/commands-metadata.gen.ts
|
|
@@ -14766,62 +14809,62 @@ var commandDefinitions = [
|
|
|
14766
14809
|
var commandNames = ["status", "reconcileSettings", "requestObservations", "sample", "cancel", "reboot", "identify", "streamObservations", "selfTest", "updateBattery", "switchEnvironment", "clearEnvironment", "listEnvironments", "runBatteryCheck", "enableDiagnostics"];
|
|
14767
14810
|
|
|
14768
14811
|
// ../../../commander/packages/contracts/commands.ts
|
|
14769
|
-
import { z as
|
|
14812
|
+
import { z as z22 } from "zod";
|
|
14770
14813
|
import { fromJson } from "@bufbuild/protobuf";
|
|
14771
14814
|
import { TimestampSchema } from "@bufbuild/protobuf/wkt";
|
|
14772
14815
|
|
|
14773
14816
|
// ../../../commander/packages/contracts/Model/zod.gen.ts
|
|
14774
|
-
import * as
|
|
14775
|
-
var zCommandResponseValue =
|
|
14776
|
-
protocolVersion:
|
|
14777
|
-
certificateId:
|
|
14778
|
-
requestId:
|
|
14779
|
-
commandId:
|
|
14780
|
-
result:
|
|
14781
|
-
unavailableObservations:
|
|
14817
|
+
import * as z21 from "zod";
|
|
14818
|
+
var zCommandResponseValue = z21.object({
|
|
14819
|
+
protocolVersion: z21.int().gte(1).lte(1),
|
|
14820
|
+
certificateId: z21.string().min(1).max(64).regex(/^[0-9a-f]{64}$/),
|
|
14821
|
+
requestId: z21.int().gte(1).lte(4294967295),
|
|
14822
|
+
commandId: z21.int().gte(0).lte(4294967295),
|
|
14823
|
+
result: z21.int().gte(-2147483648).lte(0),
|
|
14824
|
+
unavailableObservations: z21.array(z21.string().min(1).max(80).regex(/^[ -~]*$/)).max(32)
|
|
14782
14825
|
}).strict();
|
|
14783
|
-
var zGnssAcquisitionOptions =
|
|
14784
|
-
assistance:
|
|
14785
|
-
powerMode:
|
|
14826
|
+
var zGnssAcquisitionOptions = z21.object({
|
|
14827
|
+
assistance: z21.boolean().optional().default(true),
|
|
14828
|
+
powerMode: z21.enum([
|
|
14786
14829
|
"disabled",
|
|
14787
14830
|
"performance",
|
|
14788
14831
|
"power"
|
|
14789
14832
|
]).optional().default("disabled"),
|
|
14790
|
-
priorityMode:
|
|
14791
|
-
lowAccuracy:
|
|
14792
|
-
targetAccuracyMeters:
|
|
14793
|
-
consecutiveFixes:
|
|
14794
|
-
visibilityEnabled:
|
|
14795
|
-
visibilityExecutionSeconds:
|
|
14796
|
-
visibilityMinSatellites:
|
|
14833
|
+
priorityMode: z21.boolean().optional().default(false),
|
|
14834
|
+
lowAccuracy: z21.boolean().optional().default(false),
|
|
14835
|
+
targetAccuracyMeters: z21.int().gte(0).lte(1e4).optional().default(0),
|
|
14836
|
+
consecutiveFixes: z21.int().gte(1).lte(10).optional().default(1),
|
|
14837
|
+
visibilityEnabled: z21.boolean().optional().default(true),
|
|
14838
|
+
visibilityExecutionSeconds: z21.int().gte(10).lte(120).optional().default(60),
|
|
14839
|
+
visibilityMinSatellites: z21.int().gte(1).lte(12).optional().default(3)
|
|
14797
14840
|
}).strict();
|
|
14798
|
-
var zCellAcquisitionOptions =
|
|
14799
|
-
mode:
|
|
14841
|
+
var zCellAcquisitionOptions = z21.object({
|
|
14842
|
+
mode: z21.enum([
|
|
14800
14843
|
"serving",
|
|
14801
14844
|
"gci",
|
|
14802
14845
|
"neighbors"
|
|
14803
14846
|
]).optional().default("serving"),
|
|
14804
|
-
gciCount:
|
|
14847
|
+
gciCount: z21.int().gte(0).lte(5).optional().default(0)
|
|
14805
14848
|
}).strict();
|
|
14806
|
-
var zWifiAcquisitionOptions =
|
|
14807
|
-
scanType:
|
|
14808
|
-
activeMinMs:
|
|
14809
|
-
activeMaxMs:
|
|
14810
|
-
passiveMs:
|
|
14811
|
-
channelMask:
|
|
14812
|
-
budgetMs:
|
|
14849
|
+
var zWifiAcquisitionOptions = z21.object({
|
|
14850
|
+
scanType: z21.enum(["active", "passive"]).optional().default("active"),
|
|
14851
|
+
activeMinMs: z21.int().gte(1).lte(1500).optional().default(190),
|
|
14852
|
+
activeMaxMs: z21.int().gte(1).lte(1500).optional().default(200),
|
|
14853
|
+
passiveMs: z21.int().gte(1).lte(1500).optional().default(1200),
|
|
14854
|
+
channelMask: z21.int().gte(0).lte(16383).optional().default(0),
|
|
14855
|
+
budgetMs: z21.int().gte(100).lte(6e4).optional().default(1e4)
|
|
14813
14856
|
}).strict();
|
|
14814
|
-
var zAcquisitionOptions =
|
|
14857
|
+
var zAcquisitionOptions = z21.object({
|
|
14815
14858
|
gnss: zGnssAcquisitionOptions.nullish(),
|
|
14816
14859
|
cell: zCellAcquisitionOptions.nullish(),
|
|
14817
14860
|
wifi: zWifiAcquisitionOptions.nullish()
|
|
14818
14861
|
}).strict();
|
|
14819
14862
|
|
|
14820
14863
|
// ../../../commander/packages/contracts/commands.ts
|
|
14821
|
-
var commandName =
|
|
14822
|
-
var commandRequestId =
|
|
14823
|
-
var commandIdempotencyKey =
|
|
14824
|
-
var commandCursor =
|
|
14864
|
+
var commandName = z22.enum(commandNames);
|
|
14865
|
+
var commandRequestId = z22.uint32().min(1);
|
|
14866
|
+
var commandIdempotencyKey = z22.guid().refine((value) => value !== "00000000-0000-0000-0000-000000000000").toLowerCase();
|
|
14867
|
+
var commandCursor = z22.string().min(1).max(4096);
|
|
14825
14868
|
var acquisitionOptions = zAcquisitionOptions.superRefine(
|
|
14826
14869
|
(value, context) => {
|
|
14827
14870
|
if (value.cell && (value.cell.mode === "gci" ? value.cell.gciCount < 2 : value.cell.gciCount !== 0))
|
|
@@ -14854,26 +14897,26 @@ var commandResponseValue = zCommandResponseValue.refine(
|
|
|
14854
14897
|
(value) => new Set(value.unavailableObservations).size === value.unavailableObservations.length && value.unavailableObservations.every((name) => metricNames.has(name)),
|
|
14855
14898
|
"Use distinct requestable observation names."
|
|
14856
14899
|
);
|
|
14857
|
-
var commandResponseReceipt =
|
|
14858
|
-
id:
|
|
14859
|
-
receivedAt:
|
|
14900
|
+
var commandResponseReceipt = z22.strictObject({
|
|
14901
|
+
id: z22.string().regex(/^[0-9a-f]{32}$/).refine((value) => value !== "0".repeat(32)),
|
|
14902
|
+
receivedAt: z22.iso.datetime({ offset: true }),
|
|
14860
14903
|
value: commandResponseValue
|
|
14861
14904
|
});
|
|
14862
|
-
var batteryArtifact =
|
|
14905
|
+
var batteryArtifact = z22.strictObject({
|
|
14863
14906
|
moduleId: batteryModuleId,
|
|
14864
|
-
version:
|
|
14907
|
+
version: z22.string().refine((value) => {
|
|
14865
14908
|
if (!/^\d+\.\d+\.\d+(?:\.\d+)?$/.test(value)) return false;
|
|
14866
14909
|
const parts = value.split(".").map(Number);
|
|
14867
14910
|
return parts[0] >= 1 && parts[0] <= 254 && parts.every((part) => part <= 255);
|
|
14868
14911
|
}),
|
|
14869
|
-
sha256:
|
|
14870
|
-
imageBytes:
|
|
14912
|
+
sha256: z22.string().regex(/^[0-9a-f]{64}$/),
|
|
14913
|
+
imageBytes: z22.int32().positive()
|
|
14871
14914
|
});
|
|
14872
14915
|
var selectionFields = {
|
|
14873
14916
|
command: commandName,
|
|
14874
|
-
arguments:
|
|
14875
|
-
metrics:
|
|
14876
|
-
enrollmentUrl:
|
|
14917
|
+
arguments: z22.array(z22.uint32()).max(6),
|
|
14918
|
+
metrics: z22.array(z22.int().min(0).max(65535)).min(1).max(32).nullable(),
|
|
14919
|
+
enrollmentUrl: z22.string().nullable(),
|
|
14877
14920
|
acquisitionOptions: acquisitionOptions.nullable()
|
|
14878
14921
|
};
|
|
14879
14922
|
var definitions = commandDefinitions;
|
|
@@ -14923,14 +14966,14 @@ function validSelection(value, allowBattery = false) {
|
|
|
14923
14966
|
const selected = (value.acquisitionOptions.wifi ? 2 : 0) | (value.acquisitionOptions.gnss ? 4 : 0) | (value.acquisitionOptions.cell ? 8 : 0);
|
|
14924
14967
|
return (selected & ~sources) === 0;
|
|
14925
14968
|
}
|
|
14926
|
-
var intent =
|
|
14969
|
+
var intent = z22.strictObject({
|
|
14927
14970
|
idempotencyKey: commandIdempotencyKey,
|
|
14928
14971
|
expectedDeviceId: deviceId,
|
|
14929
14972
|
...selectionFields,
|
|
14930
14973
|
metrics: selectionFields.metrics.default(null),
|
|
14931
14974
|
enrollmentUrl: selectionFields.enrollmentUrl.default(null),
|
|
14932
14975
|
acquisitionOptions: selectionFields.acquisitionOptions.default(null),
|
|
14933
|
-
confirmed:
|
|
14976
|
+
confirmed: z22.boolean().default(false)
|
|
14934
14977
|
});
|
|
14935
14978
|
var commandIntent = intent.refine(
|
|
14936
14979
|
(value) => validSelection(value),
|
|
@@ -14940,7 +14983,7 @@ var commandReservation = intent.refine(
|
|
|
14940
14983
|
(value) => validSelection(value, true),
|
|
14941
14984
|
"Invalid command arguments or selection."
|
|
14942
14985
|
);
|
|
14943
|
-
var timestamp =
|
|
14986
|
+
var timestamp = z22.iso.datetime({ offset: true }).refine((value) => {
|
|
14944
14987
|
try {
|
|
14945
14988
|
fromJson(TimestampSchema, value);
|
|
14946
14989
|
return true;
|
|
@@ -14956,18 +14999,18 @@ function before(left, right) {
|
|
|
14956
14999
|
return true;
|
|
14957
15000
|
}
|
|
14958
15001
|
}
|
|
14959
|
-
var trackerCommand =
|
|
15002
|
+
var trackerCommand = z22.strictObject({
|
|
14960
15003
|
serialNumber: deviceSerial,
|
|
14961
15004
|
requestId: commandRequestId,
|
|
14962
15005
|
idempotencyKey: commandIdempotencyKey,
|
|
14963
15006
|
...selectionFields,
|
|
14964
|
-
requestedBy:
|
|
15007
|
+
requestedBy: z22.string().refine((value) => value.trim().length > 0),
|
|
14965
15008
|
requestedAt: timestamp,
|
|
14966
15009
|
publishedAt: timestamp.nullable(),
|
|
14967
15010
|
deviceId,
|
|
14968
|
-
commandId:
|
|
14969
|
-
execution:
|
|
14970
|
-
executionVersion:
|
|
15011
|
+
commandId: z22.uint32(),
|
|
15012
|
+
execution: z22.strictObject({ completed: commandResponseReceipt.nullable() }).nullable(),
|
|
15013
|
+
executionVersion: z22.int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
14971
15014
|
batteryUpdate: batteryArtifact.nullable()
|
|
14972
15015
|
}).superRefine((value, context) => {
|
|
14973
15016
|
const definition = byName.get(value.command);
|
|
@@ -14978,50 +15021,50 @@ var trackerCommand = z21.strictObject({
|
|
|
14978
15021
|
message: "Invalid command identity, selection or execution evidence."
|
|
14979
15022
|
});
|
|
14980
15023
|
});
|
|
14981
|
-
var commandReadIssue =
|
|
15024
|
+
var commandReadIssue = z22.strictObject({
|
|
14982
15025
|
requestId: commandRequestId.nullable(),
|
|
14983
|
-
code:
|
|
15026
|
+
code: z22.literal("command_unreadable")
|
|
14984
15027
|
});
|
|
14985
|
-
var commandPage =
|
|
14986
|
-
items:
|
|
15028
|
+
var commandPage = z22.strictObject({
|
|
15029
|
+
items: z22.array(trackerCommand),
|
|
14987
15030
|
nextCursor: commandCursor.nullable(),
|
|
14988
|
-
readIssues:
|
|
15031
|
+
readIssues: z22.array(commandReadIssue).nullable()
|
|
14989
15032
|
});
|
|
14990
15033
|
|
|
14991
15034
|
// ../staff-contracts/src/aws/commands.ts
|
|
14992
|
-
import { oc as
|
|
14993
|
-
import { z as
|
|
15035
|
+
import { oc as oc13, eventIterator as eventIterator5 } from "@orpc/contract";
|
|
15036
|
+
import { z as z23 } from "zod";
|
|
14994
15037
|
var trackerCommand2 = trackerCommand.safeExtend({
|
|
14995
15038
|
acquisitionOptions: acquisitionOptions.safeExtend({
|
|
14996
15039
|
gnss: zGnssAcquisitionOptions.strip().nullish(),
|
|
14997
15040
|
cell: zCellAcquisitionOptions.strip().nullish(),
|
|
14998
15041
|
wifi: zWifiAcquisitionOptions.strip().nullish()
|
|
14999
15042
|
}).strip().nullable(),
|
|
15000
|
-
execution:
|
|
15043
|
+
execution: z23.object({
|
|
15001
15044
|
completed: commandResponseReceipt.extend({ value: commandResponseValue.strip() }).strip().nullable()
|
|
15002
15045
|
}).nullable(),
|
|
15003
15046
|
batteryUpdate: batteryArtifact.strip().nullable()
|
|
15004
15047
|
}).strip();
|
|
15005
|
-
var commandReadInput =
|
|
15048
|
+
var commandReadInput = z23.strictObject({
|
|
15006
15049
|
serialNumber: deviceSerial,
|
|
15007
15050
|
requestId: commandRequestId
|
|
15008
15051
|
});
|
|
15009
|
-
var commandEventsInput =
|
|
15052
|
+
var commandEventsInput = z23.strictObject({
|
|
15010
15053
|
serialNumber: deviceSerial
|
|
15011
15054
|
});
|
|
15012
|
-
var commandUpdate =
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
status:
|
|
15055
|
+
var commandUpdate = z23.discriminatedUnion("status", [
|
|
15056
|
+
z23.object({ status: z23.literal("available"), command: trackerCommand2 }),
|
|
15057
|
+
z23.object({
|
|
15058
|
+
status: z23.literal("unavailable"),
|
|
15016
15059
|
requestId: commandRequestId,
|
|
15017
|
-
reason:
|
|
15060
|
+
reason: z23.enum(["not_found", "command_unreadable"])
|
|
15018
15061
|
})
|
|
15019
15062
|
]);
|
|
15020
|
-
var commandOperationInput =
|
|
15063
|
+
var commandOperationInput = z23.strictObject({
|
|
15021
15064
|
serialNumber: deviceSerial,
|
|
15022
15065
|
idempotencyKey: commandIdempotencyKey
|
|
15023
15066
|
});
|
|
15024
|
-
var commandListInput =
|
|
15067
|
+
var commandListInput = z23.strictObject({
|
|
15025
15068
|
serialNumber: deviceSerial,
|
|
15026
15069
|
limit: pageFields.limit,
|
|
15027
15070
|
after: commandCursor.optional()
|
|
@@ -15031,12 +15074,12 @@ var commandSubmitInput = commandIntent.safeExtend({
|
|
|
15031
15074
|
});
|
|
15032
15075
|
var commandObservationInput = commandOperationInput.extend({
|
|
15033
15076
|
limit: pageFields.limit,
|
|
15034
|
-
after:
|
|
15077
|
+
after: z23.string().min(1).max(16384).optional()
|
|
15035
15078
|
});
|
|
15036
|
-
var commandPage2 =
|
|
15037
|
-
items:
|
|
15079
|
+
var commandPage2 = z23.object({
|
|
15080
|
+
items: z23.array(trackerCommand2),
|
|
15038
15081
|
nextAfter: commandCursor.nullable(),
|
|
15039
|
-
readIssues:
|
|
15082
|
+
readIssues: z23.array(commandReadIssue.strip())
|
|
15040
15083
|
});
|
|
15041
15084
|
var commandErrors = {
|
|
15042
15085
|
...apiErrors,
|
|
@@ -15044,7 +15087,7 @@ var commandErrors = {
|
|
|
15044
15087
|
command_expired: { ...apiErrors.conflict },
|
|
15045
15088
|
command_unreadable: { ...apiErrors.stored_data_invalid }
|
|
15046
15089
|
};
|
|
15047
|
-
var procedure =
|
|
15090
|
+
var procedure = oc13.errors(commandErrors);
|
|
15048
15091
|
var staffCommandContract = {
|
|
15049
15092
|
watch: procedure.meta({ operation: "read" }).input(commandReadInput).output(eventIterator5(commandUpdate)),
|
|
15050
15093
|
events: procedure.meta({ operation: "read" }).input(commandEventsInput).output(eventIterator5(trackerCommand2)),
|
|
@@ -15056,219 +15099,219 @@ var staffCommandContract = {
|
|
|
15056
15099
|
};
|
|
15057
15100
|
|
|
15058
15101
|
// ../staff-contracts/src/aws/connectivity.ts
|
|
15059
|
-
import { oc as
|
|
15060
|
-
import { z as
|
|
15061
|
-
var connectivityInput =
|
|
15062
|
-
var deviceConnectivity =
|
|
15063
|
-
connected:
|
|
15064
|
-
checkedAt:
|
|
15102
|
+
import { oc as oc14 } from "@orpc/contract";
|
|
15103
|
+
import { z as z24 } from "zod";
|
|
15104
|
+
var connectivityInput = z24.strictObject({ serialNumber: deviceSerial });
|
|
15105
|
+
var deviceConnectivity = z24.object({
|
|
15106
|
+
connected: z24.boolean(),
|
|
15107
|
+
checkedAt: z24.iso.datetime()
|
|
15065
15108
|
});
|
|
15066
|
-
var staffConnectivityContract =
|
|
15109
|
+
var staffConnectivityContract = oc14.meta({ operation: "read" }).errors({
|
|
15067
15110
|
...apiErrors,
|
|
15068
15111
|
connectivity_unavailable: { ...apiErrors.service_unavailable }
|
|
15069
15112
|
}).input(connectivityInput).output(deviceConnectivity);
|
|
15070
15113
|
|
|
15071
15114
|
// ../staff-contracts/src/aws/firmware.ts
|
|
15072
|
-
import { oc as
|
|
15073
|
-
import { z as
|
|
15074
|
-
var firmwareChip =
|
|
15075
|
-
var firmwareRelease =
|
|
15076
|
-
id:
|
|
15115
|
+
import { oc as oc15 } from "@orpc/contract";
|
|
15116
|
+
import { z as z25 } from "zod";
|
|
15117
|
+
var firmwareChip = z25.enum(["nrf", "esp", "modem"]);
|
|
15118
|
+
var firmwareRelease = z25.object({
|
|
15119
|
+
id: z25.string().regex(/^[a-f0-9]{64}$/),
|
|
15077
15120
|
chip: firmwareChip,
|
|
15078
|
-
targetVersion:
|
|
15079
|
-
size:
|
|
15080
|
-
sha256:
|
|
15081
|
-
notes:
|
|
15082
|
-
});
|
|
15083
|
-
var firmwareExecution =
|
|
15084
|
-
status:
|
|
15085
|
-
version:
|
|
15086
|
-
executionNumber:
|
|
15087
|
-
});
|
|
15088
|
-
var firmwareReceipt =
|
|
15089
|
-
serialNumber:
|
|
15121
|
+
targetVersion: z25.string(),
|
|
15122
|
+
size: z25.int().min(1).max(4294967295),
|
|
15123
|
+
sha256: z25.string().regex(/^[a-f0-9]{64}$/),
|
|
15124
|
+
notes: z25.string().nullable()
|
|
15125
|
+
});
|
|
15126
|
+
var firmwareExecution = z25.object({
|
|
15127
|
+
status: z25.string().min(1),
|
|
15128
|
+
version: z25.int().positive().nullable(),
|
|
15129
|
+
executionNumber: z25.int().positive().nullable()
|
|
15130
|
+
});
|
|
15131
|
+
var firmwareReceipt = z25.object({
|
|
15132
|
+
serialNumber: z25.string(),
|
|
15090
15133
|
requestId,
|
|
15091
|
-
releaseId:
|
|
15134
|
+
releaseId: z25.string().regex(/^[a-f0-9]{64}$/),
|
|
15092
15135
|
chip: firmwareChip,
|
|
15093
|
-
targetVersion:
|
|
15094
|
-
requestedBy:
|
|
15095
|
-
requestedAt:
|
|
15096
|
-
jobAcceptedAt:
|
|
15136
|
+
targetVersion: z25.string(),
|
|
15137
|
+
requestedBy: z25.string(),
|
|
15138
|
+
requestedAt: z25.iso.datetime(),
|
|
15139
|
+
jobAcceptedAt: z25.iso.datetime().nullable(),
|
|
15097
15140
|
execution: firmwareExecution,
|
|
15098
|
-
expiresAt:
|
|
15099
|
-
attemptLimit:
|
|
15100
|
-
jobId:
|
|
15141
|
+
expiresAt: z25.iso.datetime().nullable(),
|
|
15142
|
+
attemptLimit: z25.int().positive().nullable(),
|
|
15143
|
+
jobId: z25.string()
|
|
15101
15144
|
});
|
|
15102
15145
|
var firmwareSubmitInput = deviceInput.extend({
|
|
15103
15146
|
requestId,
|
|
15104
15147
|
expectedDeviceId: deviceId,
|
|
15105
|
-
releaseId:
|
|
15148
|
+
releaseId: z25.string().regex(/^[a-f0-9]{64}$/)
|
|
15106
15149
|
});
|
|
15107
15150
|
var firmwareOperationInput = deviceInput.extend({
|
|
15108
15151
|
updateId: requestId
|
|
15109
15152
|
});
|
|
15110
15153
|
var firmwareCancellationInput = firmwareOperationInput.extend({
|
|
15111
15154
|
requestId,
|
|
15112
|
-
expectedExecutionVersion:
|
|
15155
|
+
expectedExecutionVersion: z25.int().positive()
|
|
15113
15156
|
});
|
|
15114
15157
|
var staffFirmwareContract = {
|
|
15115
|
-
releases:
|
|
15116
|
-
active:
|
|
15117
|
-
get:
|
|
15118
|
-
submit:
|
|
15119
|
-
cancel:
|
|
15158
|
+
releases: oc15.meta({ operation: "read" }).errors(firmwareErrors).input(deviceInput).output(z25.array(firmwareRelease)),
|
|
15159
|
+
active: oc15.meta({ operation: "read" }).errors(firmwareErrors).input(deviceInput).output(z25.array(firmwareReceipt)),
|
|
15160
|
+
get: oc15.meta({ operation: "read" }).errors(firmwareErrors).input(firmwareOperationInput).output(firmwareReceipt),
|
|
15161
|
+
submit: oc15.errors(firmwareErrors).input(firmwareSubmitInput).output(firmwareReceipt),
|
|
15162
|
+
cancel: oc15.errors(firmwareErrors).input(firmwareCancellationInput).output(firmwareReceipt)
|
|
15120
15163
|
};
|
|
15121
15164
|
|
|
15122
15165
|
// ../staff-contracts/src/aws/battery-firmware.ts
|
|
15123
|
-
import { oc as
|
|
15124
|
-
import { z as
|
|
15166
|
+
import { oc as oc16 } from "@orpc/contract";
|
|
15167
|
+
import { z as z26 } from "zod";
|
|
15125
15168
|
var batteryFirmwareInput = deviceInput.extend({
|
|
15126
15169
|
idempotencyKey: commandIdempotencyKey,
|
|
15127
15170
|
expectedDeviceId: deviceId,
|
|
15128
15171
|
moduleId: batteryArtifact.shape.moduleId,
|
|
15129
15172
|
targetVersion: batteryArtifact.shape.version,
|
|
15130
15173
|
expectedBatteryInventoryObservationId: observationId,
|
|
15131
|
-
file:
|
|
15174
|
+
file: z26.file().min(1).max(32768).mime("application/octet-stream")
|
|
15132
15175
|
});
|
|
15133
|
-
var batteryFirmwareContract =
|
|
15176
|
+
var batteryFirmwareContract = oc16.errors(commandErrors).input(batteryFirmwareInput).output(trackerCommand2);
|
|
15134
15177
|
|
|
15135
15178
|
// ../staff-contracts/src/favorites.ts
|
|
15136
|
-
import { oc as
|
|
15137
|
-
import { z as
|
|
15138
|
-
var favorite =
|
|
15179
|
+
import { oc as oc17 } from "@orpc/contract";
|
|
15180
|
+
import { z as z27 } from "zod";
|
|
15181
|
+
var favorite = z27.object({
|
|
15139
15182
|
id: documentId,
|
|
15140
|
-
trackerId:
|
|
15141
|
-
comment:
|
|
15142
|
-
addedAt:
|
|
15183
|
+
trackerId: z27.string().nullable(),
|
|
15184
|
+
comment: z27.string().nullable(),
|
|
15185
|
+
addedAt: z27.iso.datetime()
|
|
15143
15186
|
});
|
|
15144
|
-
var favoritePage =
|
|
15145
|
-
items:
|
|
15146
|
-
nextAfter:
|
|
15187
|
+
var favoritePage = z27.object({
|
|
15188
|
+
items: z27.array(favorite),
|
|
15189
|
+
nextAfter: z27.object(timeCursorFields).nullable()
|
|
15147
15190
|
});
|
|
15148
|
-
var favoriteWrite =
|
|
15191
|
+
var favoriteWrite = z27.strictObject({
|
|
15149
15192
|
deviceId: documentId,
|
|
15150
|
-
comment:
|
|
15193
|
+
comment: z27.string().max(4e3)
|
|
15151
15194
|
});
|
|
15152
|
-
var favoriteInput =
|
|
15195
|
+
var favoriteInput = z27.strictObject({ deviceId: documentId });
|
|
15153
15196
|
var favoriteContract = {
|
|
15154
|
-
list:
|
|
15155
|
-
save:
|
|
15156
|
-
remove:
|
|
15197
|
+
list: oc17.meta({ operation: "read" }).errors(apiErrors).input(timePageInput).output(favoritePage),
|
|
15198
|
+
save: oc17.errors(apiErrors).input(favoriteWrite).output(z27.void()),
|
|
15199
|
+
remove: oc17.errors(apiErrors).input(favoriteInput).output(z27.void())
|
|
15157
15200
|
};
|
|
15158
15201
|
|
|
15159
15202
|
// ../staff-contracts/src/firmware-catalog.ts
|
|
15160
|
-
import { oc as
|
|
15161
|
-
import { z as
|
|
15162
|
-
var firmwareCatalogFamily =
|
|
15203
|
+
import { oc as oc18 } from "@orpc/contract";
|
|
15204
|
+
import { z as z28 } from "zod";
|
|
15205
|
+
var firmwareCatalogFamily = z28.enum(["gen2-lte", "gen2-battery"]);
|
|
15163
15206
|
var firmwareCatalogCapability = "firmware-catalog-v2";
|
|
15164
15207
|
var maximumFirmwareUploadBytes = 1024 * 1024;
|
|
15165
|
-
var catalogFirmwareVersion =
|
|
15208
|
+
var catalogFirmwareVersion = z28.string().max(15).regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?$/).refine(
|
|
15166
15209
|
(value) => value.split(".").every((part) => Number(part) <= 255),
|
|
15167
15210
|
"Use version components from 0 to 255."
|
|
15168
15211
|
);
|
|
15169
|
-
var digest =
|
|
15170
|
-
var catalogId =
|
|
15171
|
-
var firmwareCatalogUploadInput =
|
|
15212
|
+
var digest = z28.string().regex(/^[a-f0-9]{64}$/);
|
|
15213
|
+
var catalogId = z28.string().regex(/^[A-Za-z0-9_.-]{1,100}$/);
|
|
15214
|
+
var firmwareCatalogUploadInput = z28.strictObject({
|
|
15172
15215
|
family: firmwareCatalogFamily,
|
|
15173
15216
|
version: catalogFirmwareVersion,
|
|
15174
|
-
notes:
|
|
15175
|
-
size:
|
|
15217
|
+
notes: z28.string().trim().min(1).max(2e3),
|
|
15218
|
+
size: z28.int().min(1).max(maximumFirmwareUploadBytes),
|
|
15176
15219
|
sha256: digest
|
|
15177
15220
|
});
|
|
15178
15221
|
var firmwareCatalogPublishInput = firmwareCatalogUploadInput.extend({
|
|
15179
|
-
file:
|
|
15222
|
+
file: z28.file().min(1).max(maximumFirmwareUploadBytes).mime("application/octet-stream")
|
|
15180
15223
|
});
|
|
15181
|
-
var firmwareCatalogRelease =
|
|
15224
|
+
var firmwareCatalogRelease = z28.object({
|
|
15182
15225
|
id: catalogId,
|
|
15183
15226
|
family: firmwareCatalogFamily,
|
|
15184
15227
|
version: catalogFirmwareVersion,
|
|
15185
15228
|
revision: digest,
|
|
15186
|
-
size:
|
|
15229
|
+
size: z28.int().positive(),
|
|
15187
15230
|
sha256: digest,
|
|
15188
|
-
notes:
|
|
15189
|
-
downloadUrl:
|
|
15190
|
-
availableForUpdates:
|
|
15231
|
+
notes: z28.string(),
|
|
15232
|
+
downloadUrl: z28.url({ protocol: /^https$/ }),
|
|
15233
|
+
availableForUpdates: z28.boolean()
|
|
15191
15234
|
});
|
|
15192
|
-
var firmwareCatalogInput =
|
|
15235
|
+
var firmwareCatalogInput = z28.strictObject({ id: catalogId });
|
|
15193
15236
|
var firmwareCatalogContract = {
|
|
15194
|
-
list:
|
|
15195
|
-
|
|
15237
|
+
list: oc18.meta({ operation: "read" }).errors(firmwareErrors).input(
|
|
15238
|
+
z28.strictObject({
|
|
15196
15239
|
family: firmwareCatalogFamily,
|
|
15197
|
-
limit:
|
|
15198
|
-
after:
|
|
15240
|
+
limit: z28.int().min(1).max(100).default(25),
|
|
15241
|
+
after: z28.string().max(1024).nullable().optional()
|
|
15199
15242
|
})
|
|
15200
15243
|
).output(
|
|
15201
|
-
|
|
15202
|
-
items:
|
|
15203
|
-
nextAfter:
|
|
15244
|
+
z28.object({
|
|
15245
|
+
items: z28.array(firmwareCatalogRelease),
|
|
15246
|
+
nextAfter: z28.string().nullable()
|
|
15204
15247
|
})
|
|
15205
15248
|
),
|
|
15206
|
-
get:
|
|
15207
|
-
publish:
|
|
15208
|
-
enable:
|
|
15249
|
+
get: oc18.meta({ operation: "read" }).errors(firmwareErrors).input(firmwareCatalogInput).output(firmwareCatalogRelease),
|
|
15250
|
+
publish: oc18.errors(firmwareErrors).input(firmwareCatalogPublishInput).output(firmwareCatalogRelease),
|
|
15251
|
+
enable: oc18.errors(firmwareErrors).input(firmwareCatalogInput.extend({ revision: digest })).output(firmwareCatalogRelease)
|
|
15209
15252
|
};
|
|
15210
15253
|
|
|
15211
15254
|
// ../staff-contracts/src/gcp/maintenance.ts
|
|
15212
|
-
import { oc as
|
|
15213
|
-
import { z as
|
|
15214
|
-
var maintenanceInput =
|
|
15255
|
+
import { oc as oc19 } from "@orpc/contract";
|
|
15256
|
+
import { z as z29 } from "zod";
|
|
15257
|
+
var maintenanceInput = z29.strictObject({
|
|
15215
15258
|
deviceId: documentId,
|
|
15216
15259
|
requestId
|
|
15217
15260
|
});
|
|
15218
15261
|
var denylistInput = maintenanceInput.extend({
|
|
15219
|
-
blacklisted:
|
|
15262
|
+
blacklisted: z29.boolean()
|
|
15220
15263
|
});
|
|
15221
|
-
var maintenanceAccepted =
|
|
15264
|
+
var maintenanceAccepted = z29.object({
|
|
15222
15265
|
deviceId: documentId,
|
|
15223
15266
|
requestId
|
|
15224
15267
|
});
|
|
15225
|
-
var operationExecution =
|
|
15226
|
-
state:
|
|
15227
|
-
attempts:
|
|
15228
|
-
finishedAt:
|
|
15268
|
+
var operationExecution = z29.object({
|
|
15269
|
+
state: z29.string().nullable(),
|
|
15270
|
+
attempts: z29.int().nullable(),
|
|
15271
|
+
finishedAt: z29.iso.datetime().nullable()
|
|
15229
15272
|
});
|
|
15230
|
-
var maintenanceOperation =
|
|
15273
|
+
var maintenanceOperation = z29.object({
|
|
15231
15274
|
...documentFields,
|
|
15232
15275
|
deviceId: documentId,
|
|
15233
|
-
trackerCreatedAt:
|
|
15234
|
-
operation:
|
|
15235
|
-
jobId:
|
|
15236
|
-
requestedBy:
|
|
15237
|
-
acceptedAt:
|
|
15276
|
+
trackerCreatedAt: z29.iso.datetime(),
|
|
15277
|
+
operation: z29.enum(["clean", "denylist"]),
|
|
15278
|
+
jobId: z29.string().regex(/^[a-f0-9]{64}$/).nullable(),
|
|
15279
|
+
requestedBy: z29.string().nullable(),
|
|
15280
|
+
acceptedAt: z29.iso.datetime().nullable(),
|
|
15238
15281
|
execution: operationExecution.nullable()
|
|
15239
15282
|
});
|
|
15240
15283
|
var maintenanceContract = {
|
|
15241
|
-
clean:
|
|
15242
|
-
setDenylist:
|
|
15243
|
-
get:
|
|
15284
|
+
clean: oc19.errors(apiErrors).input(maintenanceInput).output(maintenanceAccepted),
|
|
15285
|
+
setDenylist: oc19.errors(apiErrors).input(denylistInput).output(maintenanceAccepted),
|
|
15286
|
+
get: oc19.meta({ operation: "read" }).errors(apiErrors).input(maintenanceInput).output(maintenanceOperation)
|
|
15244
15287
|
};
|
|
15245
15288
|
|
|
15246
15289
|
// ../staff-contracts/src/gcp/sim.ts
|
|
15247
|
-
import { oc as
|
|
15248
|
-
import { z as
|
|
15249
|
-
var simStatus =
|
|
15250
|
-
iccid:
|
|
15251
|
-
found:
|
|
15252
|
-
status:
|
|
15253
|
-
checkedAt:
|
|
15290
|
+
import { oc as oc20 } from "@orpc/contract";
|
|
15291
|
+
import { z as z30 } from "zod";
|
|
15292
|
+
var simStatus = z30.object({
|
|
15293
|
+
iccid: z30.string().regex(/^[0-9]{18,22}$/),
|
|
15294
|
+
found: z30.boolean(),
|
|
15295
|
+
status: z30.string().nullable(),
|
|
15296
|
+
checkedAt: z30.iso.datetime()
|
|
15254
15297
|
});
|
|
15255
|
-
var simStatusContract =
|
|
15298
|
+
var simStatusContract = oc20.meta({ operation: "read" }).errors(apiErrors).input(trackerInput).output(simStatus);
|
|
15256
15299
|
|
|
15257
15300
|
// ../staff-contracts/src/gcp/legacy-lte.ts
|
|
15258
|
-
import { oc as
|
|
15259
|
-
import { z as
|
|
15260
|
-
var uuid =
|
|
15261
|
-
var legacyLteVersion =
|
|
15262
|
-
var legacyLteUpgrade =
|
|
15301
|
+
import { oc as oc21 } from "@orpc/contract";
|
|
15302
|
+
import { z as z31 } from "zod";
|
|
15303
|
+
var uuid = z31.uuidv4().toLowerCase();
|
|
15304
|
+
var legacyLteVersion = z31.string().max(15).regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/).refine((value) => value.split(".").every((part) => Number(part) <= 255));
|
|
15305
|
+
var legacyLteUpgrade = z31.object({
|
|
15263
15306
|
cycleId: uuid,
|
|
15264
15307
|
targetVersion: legacyLteVersion,
|
|
15265
|
-
state:
|
|
15266
|
-
expiresAt:
|
|
15308
|
+
state: z31.enum(["queued", "dispatched", "expired"]),
|
|
15309
|
+
expiresAt: z31.iso.datetime().nullable()
|
|
15267
15310
|
});
|
|
15268
|
-
var legacyLteOptions =
|
|
15269
|
-
currentVersion:
|
|
15270
|
-
blockedReason:
|
|
15271
|
-
releases:
|
|
15311
|
+
var legacyLteOptions = z31.object({
|
|
15312
|
+
currentVersion: z31.string().nullable(),
|
|
15313
|
+
blockedReason: z31.string().nullable(),
|
|
15314
|
+
releases: z31.array(firmwareRelease.extend({ version: legacyLteVersion })),
|
|
15272
15315
|
upgrade: legacyLteUpgrade.nullable()
|
|
15273
15316
|
});
|
|
15274
15317
|
var legacyLteQueueInput = trackerInput.extend({
|
|
@@ -15283,61 +15326,61 @@ var legacyLteCancelInput = trackerInput.extend({
|
|
|
15283
15326
|
expectedCycleId: uuid
|
|
15284
15327
|
});
|
|
15285
15328
|
var legacyLteOperationInput = trackerInput.extend({ requestId: uuid });
|
|
15286
|
-
var legacyLteOperation =
|
|
15329
|
+
var legacyLteOperation = z31.object({
|
|
15287
15330
|
requestId: uuid,
|
|
15288
|
-
kind:
|
|
15331
|
+
kind: z31.enum(["queue", "cancel"]),
|
|
15289
15332
|
cycleId: uuid,
|
|
15290
15333
|
fromVersion: legacyLteVersion.nullable(),
|
|
15291
15334
|
targetVersion: legacyLteVersion.nullable(),
|
|
15292
|
-
requestedAt:
|
|
15335
|
+
requestedAt: z31.iso.datetime()
|
|
15293
15336
|
});
|
|
15294
|
-
var procedure2 =
|
|
15337
|
+
var procedure2 = oc21.errors(firmwareErrors);
|
|
15295
15338
|
var legacyLteContract = {
|
|
15296
15339
|
options: procedure2.meta({ operation: "read" }).input(trackerInput).output(legacyLteOptions),
|
|
15297
15340
|
queue: procedure2.input(legacyLteQueueInput).output(
|
|
15298
|
-
|
|
15341
|
+
z31.object({
|
|
15299
15342
|
cycleId: uuid,
|
|
15300
15343
|
fromVersion: legacyLteVersion,
|
|
15301
15344
|
targetVersion: legacyLteVersion
|
|
15302
15345
|
})
|
|
15303
15346
|
),
|
|
15304
|
-
cancel: procedure2.input(legacyLteCancelInput).output(
|
|
15347
|
+
cancel: procedure2.input(legacyLteCancelInput).output(z31.object({ cycleId: uuid })),
|
|
15305
15348
|
operation: procedure2.meta({ operation: "read" }).input(legacyLteOperationInput).output(legacyLteOperation)
|
|
15306
15349
|
};
|
|
15307
15350
|
|
|
15308
15351
|
// ../staff-contracts/src/schemas.ts
|
|
15309
|
-
import { z as
|
|
15310
|
-
var staffTrackerSummary =
|
|
15352
|
+
import { z as z32 } from "zod";
|
|
15353
|
+
var staffTrackerSummary = z32.object({
|
|
15311
15354
|
...trackerSummaryFields,
|
|
15312
|
-
hardware:
|
|
15313
|
-
imei:
|
|
15314
|
-
iccid:
|
|
15315
|
-
imsi:
|
|
15316
|
-
serialNumber:
|
|
15355
|
+
hardware: z32.object({
|
|
15356
|
+
imei: z32.string().nullable(),
|
|
15357
|
+
iccid: z32.string().nullable(),
|
|
15358
|
+
imsi: z32.string().nullable(),
|
|
15359
|
+
serialNumber: z32.string().nullable()
|
|
15317
15360
|
}).nullable(),
|
|
15318
|
-
backend:
|
|
15361
|
+
backend: z32.string().nullable()
|
|
15319
15362
|
});
|
|
15320
|
-
var staffTrackerPage =
|
|
15321
|
-
items:
|
|
15322
|
-
nextAfter:
|
|
15363
|
+
var staffTrackerPage = z32.object({
|
|
15364
|
+
items: z32.array(staffTrackerSummary),
|
|
15365
|
+
nextAfter: z32.string().nullable()
|
|
15323
15366
|
});
|
|
15324
|
-
var staffTracker =
|
|
15367
|
+
var staffTracker = z32.object({
|
|
15325
15368
|
...trackerFields,
|
|
15326
15369
|
hardware: staffTrackerSummary.shape.hardware,
|
|
15327
15370
|
backend: staffTrackerSummary.shape.backend,
|
|
15328
|
-
configuration:
|
|
15329
|
-
movementAlerts:
|
|
15330
|
-
isBlacklisted:
|
|
15371
|
+
configuration: z32.object({
|
|
15372
|
+
movementAlerts: z32.boolean().nullable(),
|
|
15373
|
+
isBlacklisted: z32.boolean().nullable()
|
|
15331
15374
|
}).nullable()
|
|
15332
15375
|
});
|
|
15333
15376
|
|
|
15334
15377
|
// ../staff-contracts/src/gcp/diagnostics.ts
|
|
15335
|
-
import { oc as
|
|
15336
|
-
import { z as
|
|
15337
|
-
var number =
|
|
15338
|
-
var integer =
|
|
15339
|
-
var text2 =
|
|
15340
|
-
var boolean3 =
|
|
15378
|
+
import { oc as oc22, eventIterator as eventIterator6 } from "@orpc/contract";
|
|
15379
|
+
import { z as z33 } from "zod";
|
|
15380
|
+
var number = z33.number().nullable();
|
|
15381
|
+
var integer = z33.int().nullable();
|
|
15382
|
+
var text2 = z33.string().nullable();
|
|
15383
|
+
var boolean3 = z33.boolean().nullable();
|
|
15341
15384
|
var trackerBatteryDiagnostics = trackerBattery.extend({
|
|
15342
15385
|
temp: number,
|
|
15343
15386
|
voltage: number,
|
|
@@ -15354,8 +15397,8 @@ var trackerBatteryDiagnostics = trackerBattery.extend({
|
|
|
15354
15397
|
chargerChipStatus: text2,
|
|
15355
15398
|
chargerFaultStatus: text2
|
|
15356
15399
|
});
|
|
15357
|
-
var coordinates =
|
|
15358
|
-
var reportCell =
|
|
15400
|
+
var coordinates = z33.object({ latitude: number, longitude: number });
|
|
15401
|
+
var reportCell = z33.object({
|
|
15359
15402
|
mcc: integer,
|
|
15360
15403
|
mnc: integer,
|
|
15361
15404
|
lac: integer,
|
|
@@ -15369,14 +15412,14 @@ var reportCell = z32.object({
|
|
|
15369
15412
|
timeToConnect: number,
|
|
15370
15413
|
networkType: text2,
|
|
15371
15414
|
get nCells() {
|
|
15372
|
-
return
|
|
15415
|
+
return z33.array(reportCell).nullable();
|
|
15373
15416
|
},
|
|
15374
15417
|
get gciCells() {
|
|
15375
|
-
return
|
|
15418
|
+
return z33.array(reportCell).nullable();
|
|
15376
15419
|
}
|
|
15377
15420
|
});
|
|
15378
|
-
var trackerLatestReport =
|
|
15379
|
-
timestamp:
|
|
15421
|
+
var trackerLatestReport = z33.object({
|
|
15422
|
+
timestamp: z33.iso.datetime().nullable(),
|
|
15380
15423
|
type: text2,
|
|
15381
15424
|
mode: text2,
|
|
15382
15425
|
stage: text2,
|
|
@@ -15423,13 +15466,13 @@ var trackerLatestReport = z32.object({
|
|
|
15423
15466
|
gnssMaxSatsInView: integer
|
|
15424
15467
|
}).nullable(),
|
|
15425
15468
|
geoPoint: coordinates.nullable(),
|
|
15426
|
-
cells:
|
|
15427
|
-
wifi:
|
|
15428
|
-
bleDevs:
|
|
15429
|
-
errorLogs:
|
|
15469
|
+
cells: z33.array(reportCell).nullable(),
|
|
15470
|
+
wifi: z33.array(z33.object({ mac: text2, rssi: number, channel: integer })).nullable(),
|
|
15471
|
+
bleDevs: z33.array(z33.object({ mac: text2, rssi: number, companyId: integer })).nullable(),
|
|
15472
|
+
errorLogs: z33.array(z33.object({ code: text2, numErrors: integer })).nullable()
|
|
15430
15473
|
});
|
|
15431
|
-
var operationStatistics =
|
|
15432
|
-
var trackerStatistics =
|
|
15474
|
+
var operationStatistics = z33.object({ count: integer, successCount: integer, failCount: integer }).nullable();
|
|
15475
|
+
var trackerStatistics = z33.object({
|
|
15433
15476
|
count: integer,
|
|
15434
15477
|
resets: integer,
|
|
15435
15478
|
failedWifi: integer,
|
|
@@ -15445,7 +15488,7 @@ var trackerStatistics = z32.object({
|
|
|
15445
15488
|
averageCellSignalStrength: number,
|
|
15446
15489
|
averageSatsInView: number,
|
|
15447
15490
|
averageGnssFixSnr: number,
|
|
15448
|
-
averageGnssMaxSnr:
|
|
15491
|
+
averageGnssMaxSnr: z33.object({ value: number, count: integer }).nullable(),
|
|
15449
15492
|
oad: operationStatistics,
|
|
15450
15493
|
factoryReset: operationStatistics,
|
|
15451
15494
|
INI: integer,
|
|
@@ -15459,36 +15502,36 @@ var trackerStatistics = z32.object({
|
|
|
15459
15502
|
DEFAULT: integer,
|
|
15460
15503
|
SMT: integer
|
|
15461
15504
|
});
|
|
15462
|
-
var staffTrackerDiagnostics =
|
|
15505
|
+
var staffTrackerDiagnostics = z33.object({
|
|
15463
15506
|
...documentFields,
|
|
15464
15507
|
batteryDiagnostics: trackerBatteryDiagnostics.nullable(),
|
|
15465
15508
|
latestReport: trackerLatestReport.nullable(),
|
|
15466
15509
|
statistics: trackerStatistics.nullable()
|
|
15467
15510
|
});
|
|
15468
|
-
var procedure3 =
|
|
15511
|
+
var procedure3 = oc22.meta({ operation: "read" }).errors(apiErrors).input(trackerInput);
|
|
15469
15512
|
var diagnosticsContract = {
|
|
15470
15513
|
get: procedure3.output(staffTrackerDiagnostics),
|
|
15471
15514
|
watch: procedure3.output(eventIterator6(staffTrackerDiagnostics))
|
|
15472
15515
|
};
|
|
15473
15516
|
|
|
15474
15517
|
// ../staff-contracts/src/gcp/audit.ts
|
|
15475
|
-
import { oc as
|
|
15476
|
-
import { z as
|
|
15477
|
-
var text3 =
|
|
15478
|
-
var integer2 =
|
|
15479
|
-
var time =
|
|
15480
|
-
var scalar =
|
|
15518
|
+
import { oc as oc23 } from "@orpc/contract";
|
|
15519
|
+
import { z as z34 } from "zod";
|
|
15520
|
+
var text3 = z34.string().nullable();
|
|
15521
|
+
var integer2 = z34.int().nullable();
|
|
15522
|
+
var time = z34.iso.datetime().nullable();
|
|
15523
|
+
var scalar = z34.union([z34.string(), z34.number()]).nullable();
|
|
15481
15524
|
var envelope = {
|
|
15482
15525
|
timestamp: time,
|
|
15483
|
-
value:
|
|
15484
|
-
requestedBy:
|
|
15526
|
+
value: z34.boolean().optional(),
|
|
15527
|
+
requestedBy: z34.string().optional()
|
|
15485
15528
|
};
|
|
15486
|
-
var unsupported =
|
|
15529
|
+
var unsupported = z34.object({
|
|
15487
15530
|
...envelope,
|
|
15488
|
-
kind:
|
|
15531
|
+
kind: z34.literal("unsupported"),
|
|
15489
15532
|
type: text3
|
|
15490
15533
|
});
|
|
15491
|
-
var bike =
|
|
15534
|
+
var bike = z34.object({
|
|
15492
15535
|
nickname: text3,
|
|
15493
15536
|
brand: text3,
|
|
15494
15537
|
type: text3,
|
|
@@ -15500,20 +15543,20 @@ var bike = z33.object({
|
|
|
15500
15543
|
receiptImage: text3,
|
|
15501
15544
|
receiptImageThumb: text3
|
|
15502
15545
|
}).partial();
|
|
15503
|
-
var member =
|
|
15504
|
-
active:
|
|
15546
|
+
var member = z34.object({
|
|
15547
|
+
active: z34.boolean().nullable(),
|
|
15505
15548
|
addedBy: text3,
|
|
15506
15549
|
displayName: text3,
|
|
15507
15550
|
description: text3,
|
|
15508
15551
|
listIndex: integer2,
|
|
15509
15552
|
timestamp: time
|
|
15510
15553
|
}).partial();
|
|
15511
|
-
var members =
|
|
15512
|
-
var pin =
|
|
15513
|
-
var textChange =
|
|
15554
|
+
var members = z34.record(z34.string(), member.nullable()).nullable();
|
|
15555
|
+
var pin = z34.array(z34.int().min(0).max(255)).nullable();
|
|
15556
|
+
var textChange = z34.object({
|
|
15514
15557
|
...envelope,
|
|
15515
|
-
kind:
|
|
15516
|
-
type:
|
|
15558
|
+
kind: z34.literal("textChange"),
|
|
15559
|
+
type: z34.enum([
|
|
15517
15560
|
"mode",
|
|
15518
15561
|
"status",
|
|
15519
15562
|
"tiFirmware",
|
|
@@ -15527,45 +15570,45 @@ var textChange = z33.object({
|
|
|
15527
15570
|
old: text3,
|
|
15528
15571
|
new: text3
|
|
15529
15572
|
});
|
|
15530
|
-
var buildChange =
|
|
15573
|
+
var buildChange = z34.object({
|
|
15531
15574
|
...envelope,
|
|
15532
|
-
kind:
|
|
15533
|
-
type:
|
|
15575
|
+
kind: z34.literal("buildChange"),
|
|
15576
|
+
type: z34.literal("buildNumber"),
|
|
15534
15577
|
old: scalar,
|
|
15535
15578
|
new: scalar
|
|
15536
15579
|
});
|
|
15537
|
-
var countChange =
|
|
15580
|
+
var countChange = z34.object({
|
|
15538
15581
|
...envelope,
|
|
15539
|
-
kind:
|
|
15540
|
-
type:
|
|
15582
|
+
kind: z34.literal("countChange"),
|
|
15583
|
+
type: z34.literal("userCount"),
|
|
15541
15584
|
old: integer2,
|
|
15542
15585
|
new: integer2
|
|
15543
15586
|
});
|
|
15544
|
-
var booleanChange =
|
|
15587
|
+
var booleanChange = z34.object({
|
|
15545
15588
|
...envelope,
|
|
15546
|
-
kind:
|
|
15547
|
-
type:
|
|
15548
|
-
old:
|
|
15549
|
-
new:
|
|
15589
|
+
kind: z34.literal("booleanChange"),
|
|
15590
|
+
type: z34.literal("isBlacklisted"),
|
|
15591
|
+
old: z34.boolean().nullable(),
|
|
15592
|
+
new: z34.boolean().nullable()
|
|
15550
15593
|
});
|
|
15551
|
-
var pinChange =
|
|
15594
|
+
var pinChange = z34.object({
|
|
15552
15595
|
...envelope,
|
|
15553
|
-
kind:
|
|
15554
|
-
type:
|
|
15596
|
+
kind: z34.literal("pinChange"),
|
|
15597
|
+
type: z34.literal("blePin"),
|
|
15555
15598
|
old: pin,
|
|
15556
15599
|
new: pin
|
|
15557
15600
|
});
|
|
15558
|
-
var bikeChange =
|
|
15601
|
+
var bikeChange = z34.object({
|
|
15559
15602
|
...envelope,
|
|
15560
|
-
kind:
|
|
15561
|
-
type:
|
|
15603
|
+
kind: z34.literal("bikeChange"),
|
|
15604
|
+
type: z34.literal("bikeInfo"),
|
|
15562
15605
|
old: bike.nullable(),
|
|
15563
15606
|
new: bike.nullable()
|
|
15564
15607
|
});
|
|
15565
|
-
var membersChange =
|
|
15608
|
+
var membersChange = z34.object({
|
|
15566
15609
|
...envelope,
|
|
15567
|
-
kind:
|
|
15568
|
-
type:
|
|
15610
|
+
kind: z34.literal("membersChange"),
|
|
15611
|
+
type: z34.enum(["users", "fleetUsers"]),
|
|
15569
15612
|
old: members,
|
|
15570
15613
|
new: members
|
|
15571
15614
|
});
|
|
@@ -15578,20 +15621,20 @@ var changes = [
|
|
|
15578
15621
|
bikeChange,
|
|
15579
15622
|
membersChange
|
|
15580
15623
|
];
|
|
15581
|
-
var nestedChange =
|
|
15582
|
-
var operation =
|
|
15624
|
+
var nestedChange = z34.discriminatedUnion("kind", [...changes, unsupported]);
|
|
15625
|
+
var operation = z34.object({
|
|
15583
15626
|
type: text3,
|
|
15584
15627
|
timestamp: time,
|
|
15585
|
-
what:
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15628
|
+
what: z34.discriminatedUnion("kind", [
|
|
15629
|
+
z34.object({ kind: z34.literal("text"), value: z34.string() }),
|
|
15630
|
+
z34.object({ kind: z34.literal("change"), value: nestedChange }),
|
|
15631
|
+
z34.object({ kind: z34.literal("null") }),
|
|
15632
|
+
z34.object({ kind: z34.literal("missing") }),
|
|
15633
|
+
z34.object({ kind: z34.literal("invalid") })
|
|
15591
15634
|
]),
|
|
15592
|
-
doc:
|
|
15635
|
+
doc: z34.object({ id: text3, type: text3, fleetId: text3 }).nullable()
|
|
15593
15636
|
});
|
|
15594
|
-
var diagnostic =
|
|
15637
|
+
var diagnostic = z34.object({
|
|
15595
15638
|
code: text3,
|
|
15596
15639
|
stage: text3,
|
|
15597
15640
|
classification: text3,
|
|
@@ -15603,33 +15646,33 @@ var diagnostic = z33.object({
|
|
|
15603
15646
|
providerStage: text3,
|
|
15604
15647
|
providerState: text3,
|
|
15605
15648
|
responseCode: scalar,
|
|
15606
|
-
outcomeUnknown:
|
|
15649
|
+
outcomeUnknown: z34.boolean().nullable(),
|
|
15607
15650
|
correlationId: text3
|
|
15608
15651
|
});
|
|
15609
|
-
var auditEvent =
|
|
15652
|
+
var auditEvent = z34.discriminatedUnion("kind", [
|
|
15610
15653
|
...changes,
|
|
15611
|
-
|
|
15654
|
+
z34.object({
|
|
15612
15655
|
...envelope,
|
|
15613
|
-
kind:
|
|
15614
|
-
type:
|
|
15656
|
+
kind: z34.literal("message"),
|
|
15657
|
+
type: z34.enum(["info", "error"]),
|
|
15615
15658
|
message: text3,
|
|
15616
15659
|
operationId: text3
|
|
15617
15660
|
}),
|
|
15618
|
-
|
|
15661
|
+
z34.object({
|
|
15619
15662
|
...envelope,
|
|
15620
|
-
kind:
|
|
15621
|
-
type:
|
|
15663
|
+
kind: z34.literal("note"),
|
|
15664
|
+
type: z34.literal("blacklist"),
|
|
15622
15665
|
note: text3
|
|
15623
15666
|
}),
|
|
15624
|
-
|
|
15667
|
+
z34.object({
|
|
15625
15668
|
...envelope,
|
|
15626
|
-
kind:
|
|
15627
|
-
type:
|
|
15669
|
+
kind: z34.literal("action"),
|
|
15670
|
+
type: z34.enum(["clean", "factoryReset", "isBlacklisted"])
|
|
15628
15671
|
}),
|
|
15629
|
-
|
|
15672
|
+
z34.object({
|
|
15630
15673
|
...envelope,
|
|
15631
|
-
kind:
|
|
15632
|
-
type:
|
|
15674
|
+
kind: z34.literal("failure"),
|
|
15675
|
+
type: z34.literal("effectFailure"),
|
|
15633
15676
|
schemaVersion: integer2,
|
|
15634
15677
|
source: text3,
|
|
15635
15678
|
producer: text3,
|
|
@@ -15642,96 +15685,96 @@ var auditEvent = z33.discriminatedUnion("kind", [
|
|
|
15642
15685
|
deviceCreatedAt: time,
|
|
15643
15686
|
diagnostic: diagnostic.nullable()
|
|
15644
15687
|
}),
|
|
15645
|
-
|
|
15688
|
+
z34.object({
|
|
15646
15689
|
...envelope,
|
|
15647
|
-
kind:
|
|
15648
|
-
type:
|
|
15690
|
+
kind: z34.literal("operations"),
|
|
15691
|
+
type: z34.enum(["read", "google.firestore.document.update"]),
|
|
15649
15692
|
old: integer2,
|
|
15650
15693
|
new: integer2,
|
|
15651
15694
|
uid: text3,
|
|
15652
15695
|
logType: text3,
|
|
15653
15696
|
startTimestamp: time,
|
|
15654
15697
|
lastOperation: operation.nullable(),
|
|
15655
|
-
operations:
|
|
15698
|
+
operations: z34.array(operation).nullable()
|
|
15656
15699
|
}),
|
|
15657
15700
|
unsupported
|
|
15658
15701
|
]);
|
|
15659
|
-
var auditEntry =
|
|
15702
|
+
var auditEntry = z34.object({
|
|
15660
15703
|
...documentFields,
|
|
15661
15704
|
event: auditEvent,
|
|
15662
|
-
readIssues:
|
|
15663
|
-
|
|
15664
|
-
path:
|
|
15665
|
-
code:
|
|
15705
|
+
readIssues: z34.array(
|
|
15706
|
+
z34.object({
|
|
15707
|
+
path: z34.string(),
|
|
15708
|
+
code: z34.enum(["unsupported_stored_event_type", "invalid_stored_value"])
|
|
15666
15709
|
})
|
|
15667
15710
|
)
|
|
15668
15711
|
});
|
|
15669
|
-
var auditPage =
|
|
15670
|
-
items:
|
|
15712
|
+
var auditPage = z34.object({
|
|
15713
|
+
items: z34.array(auditEntry),
|
|
15671
15714
|
nextAfter: historyCursor.nullable()
|
|
15672
15715
|
});
|
|
15673
|
-
var auditContract =
|
|
15716
|
+
var auditContract = oc23.meta({ operation: "read" }).errors(apiErrors).input(historyInput).output(auditPage);
|
|
15674
15717
|
|
|
15675
15718
|
// ../staff-contracts/src/subscriptions.ts
|
|
15676
|
-
import { oc as
|
|
15677
|
-
import { z as
|
|
15719
|
+
import { oc as oc24 } from "@orpc/contract";
|
|
15720
|
+
import { z as z35 } from "zod";
|
|
15678
15721
|
var staffSubscription = subscription.extend({
|
|
15679
|
-
email:
|
|
15680
|
-
commerceId:
|
|
15681
|
-
sku:
|
|
15722
|
+
email: z35.string().nullable(),
|
|
15723
|
+
commerceId: z35.int().nullable(),
|
|
15724
|
+
sku: z35.string().nullable()
|
|
15682
15725
|
});
|
|
15683
|
-
var staffSubscriptionPageInput =
|
|
15726
|
+
var staffSubscriptionPageInput = z35.strictObject({
|
|
15684
15727
|
...pageFields,
|
|
15685
15728
|
accountId: documentId.optional(),
|
|
15686
|
-
commerceId:
|
|
15687
|
-
businessEmail:
|
|
15688
|
-
businessOnly:
|
|
15729
|
+
commerceId: z35.int().positive().optional(),
|
|
15730
|
+
businessEmail: z35.email().max(320).optional(),
|
|
15731
|
+
businessOnly: z35.boolean().default(false)
|
|
15689
15732
|
}).prefault({});
|
|
15690
|
-
var staffSubscriptionPage =
|
|
15691
|
-
items:
|
|
15692
|
-
nextAfter:
|
|
15733
|
+
var staffSubscriptionPage = z35.object({
|
|
15734
|
+
items: z35.array(staffSubscription),
|
|
15735
|
+
nextAfter: z35.string().nullable()
|
|
15693
15736
|
});
|
|
15694
15737
|
var staffSubscriptionContract = {
|
|
15695
|
-
get:
|
|
15696
|
-
list:
|
|
15738
|
+
get: oc24.meta({ operation: "read" }).errors(apiErrors).input(subscriptionInput).output(staffSubscription),
|
|
15739
|
+
list: oc24.meta({ operation: "read" }).errors(apiErrors).input(staffSubscriptionPageInput).output(staffSubscriptionPage)
|
|
15697
15740
|
};
|
|
15698
15741
|
|
|
15699
15742
|
// ../staff-contracts/src/trackers.ts
|
|
15700
|
-
import { z as
|
|
15701
|
-
var exactValue =
|
|
15743
|
+
import { z as z36 } from "zod";
|
|
15744
|
+
var exactValue = z36.string().min(1).max(128).refine(
|
|
15702
15745
|
(value) => value.trim().length > 0 && !/\p{Cc}/u.test(value),
|
|
15703
15746
|
"Use one exact tracker filter."
|
|
15704
15747
|
);
|
|
15705
|
-
var staffTrackerFilter =
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15710
|
-
|
|
15748
|
+
var staffTrackerFilter = z36.discriminatedUnion("by", [
|
|
15749
|
+
z36.strictObject({ by: z36.literal("serialNumber"), value: exactValue }),
|
|
15750
|
+
z36.strictObject({ by: z36.literal("imei"), value: exactValue }),
|
|
15751
|
+
z36.strictObject({ by: z36.literal("iccid"), value: exactValue }),
|
|
15752
|
+
z36.strictObject({ by: z36.literal("accountId"), value: documentId }),
|
|
15753
|
+
z36.strictObject({ by: z36.literal("subscriptionId"), value: documentId })
|
|
15711
15754
|
]);
|
|
15712
|
-
var staffTrackerPageInput =
|
|
15755
|
+
var staffTrackerPageInput = z36.strictObject({
|
|
15713
15756
|
...pageFields,
|
|
15714
15757
|
filter: staffTrackerFilter.optional()
|
|
15715
15758
|
}).prefault({});
|
|
15716
15759
|
|
|
15717
15760
|
// ../staff-contracts/src/operations.ts
|
|
15718
|
-
import { oc as
|
|
15719
|
-
import { z as
|
|
15761
|
+
import { oc as oc25 } from "@orpc/contract";
|
|
15762
|
+
import { z as z38 } from "zod";
|
|
15720
15763
|
|
|
15721
15764
|
// ../staff-contracts/src/support.ts
|
|
15722
|
-
import { z as
|
|
15723
|
-
var providerId =
|
|
15765
|
+
import { z as z37 } from "zod";
|
|
15766
|
+
var providerId = z37.int().positive();
|
|
15724
15767
|
var supportPageFields = {
|
|
15725
|
-
page:
|
|
15726
|
-
limit:
|
|
15768
|
+
page: z37.int().min(1).max(300).default(1),
|
|
15769
|
+
limit: z37.int().min(1).max(100).default(20)
|
|
15727
15770
|
};
|
|
15728
|
-
var supportTag =
|
|
15771
|
+
var supportTag = z37.string().min(1).max(32).refine(
|
|
15729
15772
|
(value) => value.trim() === value && !/[\p{Cc}]/u.test(value),
|
|
15730
15773
|
"Use an exact tag without control characters."
|
|
15731
15774
|
);
|
|
15732
|
-
var supportEmail =
|
|
15733
|
-
var supportVersion =
|
|
15734
|
-
var supportText = (max) =>
|
|
15775
|
+
var supportEmail = z37.email().max(254).refine((value) => value.trim() === value);
|
|
15776
|
+
var supportVersion = z37.string().regex(/^[a-f0-9]{64}$/);
|
|
15777
|
+
var supportText = (max) => z37.string().min(1).max(max).refine((value) => value.trim().length > 0 && !value.includes("\0"));
|
|
15735
15778
|
var supportReviewFields = {
|
|
15736
15779
|
requestId,
|
|
15737
15780
|
recipient: supportEmail,
|
|
@@ -15740,111 +15783,111 @@ var supportReviewFields = {
|
|
|
15740
15783
|
};
|
|
15741
15784
|
|
|
15742
15785
|
// ../staff-contracts/src/operations.ts
|
|
15743
|
-
var supportOperation =
|
|
15786
|
+
var supportOperation = z38.object({
|
|
15744
15787
|
requestId,
|
|
15745
|
-
kind:
|
|
15746
|
-
status:
|
|
15747
|
-
resource:
|
|
15788
|
+
kind: z38.string().min(1),
|
|
15789
|
+
status: z38.enum(["dispatching", "succeeded", "uncertain", "rejected"]),
|
|
15790
|
+
resource: z38.string().min(1),
|
|
15748
15791
|
providerId: providerId.nullable(),
|
|
15749
|
-
summary:
|
|
15750
|
-
createdAt:
|
|
15751
|
-
updatedAt:
|
|
15792
|
+
summary: z38.string(),
|
|
15793
|
+
createdAt: z38.iso.datetime(),
|
|
15794
|
+
updatedAt: z38.iso.datetime()
|
|
15752
15795
|
});
|
|
15753
|
-
var supportOperationInput =
|
|
15796
|
+
var supportOperationInput = z38.strictObject({ requestId });
|
|
15754
15797
|
var supportOperationContract = {
|
|
15755
|
-
get:
|
|
15798
|
+
get: oc25.meta({ operation: "read" }).errors(supportErrors).input(supportOperationInput).output(supportOperation)
|
|
15756
15799
|
};
|
|
15757
15800
|
|
|
15758
15801
|
// ../staff-contracts/src/commerce.ts
|
|
15759
|
-
import { oc as
|
|
15760
|
-
import { z as
|
|
15761
|
-
var moneyAmount =
|
|
15762
|
-
var commerceLine =
|
|
15802
|
+
import { oc as oc26 } from "@orpc/contract";
|
|
15803
|
+
import { z as z39 } from "zod";
|
|
15804
|
+
var moneyAmount = z39.string().regex(/^-?\d{1,12}(?:\.\d{1,6})?$/);
|
|
15805
|
+
var commerceLine = z39.object({
|
|
15763
15806
|
id: providerId,
|
|
15764
|
-
name:
|
|
15765
|
-
productId:
|
|
15766
|
-
variationId:
|
|
15767
|
-
quantity:
|
|
15807
|
+
name: z39.string(),
|
|
15808
|
+
productId: z39.int().nonnegative(),
|
|
15809
|
+
variationId: z39.int().nonnegative(),
|
|
15810
|
+
quantity: z39.number(),
|
|
15768
15811
|
subtotal: moneyAmount,
|
|
15769
15812
|
subtotalTax: moneyAmount,
|
|
15770
15813
|
total: moneyAmount,
|
|
15771
15814
|
totalTax: moneyAmount,
|
|
15772
|
-
sku:
|
|
15815
|
+
sku: z39.string().nullable()
|
|
15773
15816
|
});
|
|
15774
|
-
var commerceOrder =
|
|
15817
|
+
var commerceOrder = z39.object({
|
|
15775
15818
|
id: providerId,
|
|
15776
|
-
number:
|
|
15777
|
-
status:
|
|
15819
|
+
number: z39.string(),
|
|
15820
|
+
status: z39.string(),
|
|
15778
15821
|
billingEmail: supportEmail,
|
|
15779
|
-
customerId:
|
|
15780
|
-
currency:
|
|
15822
|
+
customerId: z39.int().nonnegative(),
|
|
15823
|
+
currency: z39.string(),
|
|
15781
15824
|
total: moneyAmount,
|
|
15782
15825
|
totalTax: moneyAmount,
|
|
15783
15826
|
shippingTotal: moneyAmount,
|
|
15784
15827
|
discountTotal: moneyAmount,
|
|
15785
|
-
paymentMethod:
|
|
15786
|
-
transactionId:
|
|
15787
|
-
paidAtGmt:
|
|
15788
|
-
modifiedAtGmt:
|
|
15789
|
-
lines:
|
|
15790
|
-
refunds:
|
|
15828
|
+
paymentMethod: z39.string(),
|
|
15829
|
+
transactionId: z39.string().nullable(),
|
|
15830
|
+
paidAtGmt: z39.string().nullable(),
|
|
15831
|
+
modifiedAtGmt: z39.string(),
|
|
15832
|
+
lines: z39.array(commerceLine),
|
|
15833
|
+
refunds: z39.array(z39.object({ id: providerId, total: moneyAmount })),
|
|
15791
15834
|
version: supportVersion,
|
|
15792
|
-
adminUrl:
|
|
15835
|
+
adminUrl: z39.url().nullable()
|
|
15793
15836
|
});
|
|
15794
|
-
var commerceSubscription =
|
|
15837
|
+
var commerceSubscription = z39.object({
|
|
15795
15838
|
id: providerId,
|
|
15796
|
-
status:
|
|
15839
|
+
status: z39.string(),
|
|
15797
15840
|
billingEmail: supportEmail,
|
|
15798
|
-
customerId:
|
|
15799
|
-
parentOrderId:
|
|
15800
|
-
currency:
|
|
15841
|
+
customerId: z39.int().nonnegative(),
|
|
15842
|
+
parentOrderId: z39.int().nonnegative(),
|
|
15843
|
+
currency: z39.string(),
|
|
15801
15844
|
total: moneyAmount,
|
|
15802
|
-
paymentMethod:
|
|
15803
|
-
manualRenewal:
|
|
15804
|
-
billingPeriod:
|
|
15805
|
-
billingInterval:
|
|
15806
|
-
nextPaymentAtGmt:
|
|
15807
|
-
retryAtGmt:
|
|
15808
|
-
endsAtGmt:
|
|
15809
|
-
lines:
|
|
15845
|
+
paymentMethod: z39.string(),
|
|
15846
|
+
manualRenewal: z39.boolean(),
|
|
15847
|
+
billingPeriod: z39.string(),
|
|
15848
|
+
billingInterval: z39.int().positive(),
|
|
15849
|
+
nextPaymentAtGmt: z39.string().nullable(),
|
|
15850
|
+
retryAtGmt: z39.string().nullable(),
|
|
15851
|
+
endsAtGmt: z39.string().nullable(),
|
|
15852
|
+
lines: z39.array(commerceLine),
|
|
15810
15853
|
version: supportVersion,
|
|
15811
|
-
adminUrl:
|
|
15854
|
+
adminUrl: z39.url().nullable()
|
|
15812
15855
|
});
|
|
15813
|
-
var commerceNote =
|
|
15856
|
+
var commerceNote = z39.object({
|
|
15814
15857
|
id: providerId,
|
|
15815
|
-
text:
|
|
15816
|
-
author:
|
|
15817
|
-
customerNote:
|
|
15818
|
-
createdAtGmt:
|
|
15858
|
+
text: z39.string(),
|
|
15859
|
+
author: z39.string().nullable(),
|
|
15860
|
+
customerNote: z39.boolean(),
|
|
15861
|
+
createdAtGmt: z39.string()
|
|
15819
15862
|
});
|
|
15820
|
-
var commerceRefund =
|
|
15863
|
+
var commerceRefund = z39.object({
|
|
15821
15864
|
id: providerId,
|
|
15822
15865
|
amount: moneyAmount,
|
|
15823
|
-
reason:
|
|
15824
|
-
processorRefunded:
|
|
15866
|
+
reason: z39.string(),
|
|
15867
|
+
processorRefunded: z39.boolean()
|
|
15825
15868
|
});
|
|
15826
|
-
var refundCapacity =
|
|
15869
|
+
var refundCapacity = z39.object({
|
|
15827
15870
|
orderId: providerId,
|
|
15828
|
-
currency:
|
|
15871
|
+
currency: z39.string(),
|
|
15829
15872
|
remainingAmount: moneyAmount,
|
|
15830
|
-
priceDecimals:
|
|
15831
|
-
paymentMethod:
|
|
15832
|
-
processorSupportsRefunds:
|
|
15833
|
-
refundIds:
|
|
15873
|
+
priceDecimals: z39.int().min(0).max(6),
|
|
15874
|
+
paymentMethod: z39.string(),
|
|
15875
|
+
processorSupportsRefunds: z39.boolean(),
|
|
15876
|
+
refundIds: z39.array(providerId),
|
|
15834
15877
|
version: supportVersion
|
|
15835
15878
|
});
|
|
15836
|
-
var commerceRefundReview =
|
|
15879
|
+
var commerceRefundReview = z39.object({
|
|
15837
15880
|
capacity: refundCapacity,
|
|
15838
|
-
refunds:
|
|
15881
|
+
refunds: z39.array(commerceRefund)
|
|
15839
15882
|
});
|
|
15840
|
-
var commerceRelationships =
|
|
15841
|
-
resource:
|
|
15883
|
+
var commerceRelationships = z39.object({
|
|
15884
|
+
resource: z39.enum(["order", "subscription"]),
|
|
15842
15885
|
id: providerId,
|
|
15843
|
-
items:
|
|
15844
|
-
|
|
15886
|
+
items: z39.array(
|
|
15887
|
+
z39.object({ id: providerId, orderType: z39.string().nullable() })
|
|
15845
15888
|
)
|
|
15846
15889
|
});
|
|
15847
|
-
var commerceQuery =
|
|
15890
|
+
var commerceQuery = z39.strictObject({
|
|
15848
15891
|
...supportPageFields,
|
|
15849
15892
|
email: supportEmail.optional(),
|
|
15850
15893
|
search: supportText(200).optional()
|
|
@@ -15852,35 +15895,35 @@ var commerceQuery = z38.strictObject({
|
|
|
15852
15895
|
(input) => input.email === void 0 || input.search === void 0,
|
|
15853
15896
|
"Use exact billing email or a discovery search, never both."
|
|
15854
15897
|
).prefault({});
|
|
15855
|
-
var commerceId =
|
|
15898
|
+
var commerceId = z39.strictObject({ id: providerId });
|
|
15856
15899
|
var commerceNotesInput = commerceId.extend(supportPageFields);
|
|
15857
|
-
var page2 = (item) =>
|
|
15858
|
-
items:
|
|
15859
|
-
nextPage:
|
|
15860
|
-
truncated:
|
|
15900
|
+
var page2 = (item) => z39.object({
|
|
15901
|
+
items: z39.array(item),
|
|
15902
|
+
nextPage: z39.int().positive().nullable(),
|
|
15903
|
+
truncated: z39.boolean()
|
|
15861
15904
|
});
|
|
15862
|
-
var read =
|
|
15905
|
+
var read = oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceId);
|
|
15863
15906
|
var commerceContract = {
|
|
15864
15907
|
orders: {
|
|
15865
15908
|
get: read.output(commerceOrder),
|
|
15866
|
-
list:
|
|
15867
|
-
notes:
|
|
15909
|
+
list: oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceQuery).output(page2(commerceOrder)),
|
|
15910
|
+
notes: oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceNotesInput).output(page2(commerceNote)),
|
|
15868
15911
|
relationships: read.output(commerceRelationships),
|
|
15869
15912
|
refundReview: read.output(commerceRefundReview),
|
|
15870
|
-
refund:
|
|
15913
|
+
refund: oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceId.extend({ refundId: providerId })).output(commerceRefund)
|
|
15871
15914
|
},
|
|
15872
15915
|
subscriptions: {
|
|
15873
15916
|
get: read.output(commerceSubscription),
|
|
15874
|
-
list:
|
|
15875
|
-
notes:
|
|
15917
|
+
list: oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceQuery).output(page2(commerceSubscription)),
|
|
15918
|
+
notes: oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceNotesInput).output(page2(commerceNote)),
|
|
15876
15919
|
relationships: read.output(commerceRelationships)
|
|
15877
15920
|
}
|
|
15878
15921
|
};
|
|
15879
15922
|
|
|
15880
15923
|
// ../staff-contracts/src/billing.ts
|
|
15881
|
-
import { oc as
|
|
15882
|
-
import { z as
|
|
15883
|
-
var billingReview =
|
|
15924
|
+
import { oc as oc27 } from "@orpc/contract";
|
|
15925
|
+
import { z as z40 } from "zod";
|
|
15926
|
+
var billingReview = z40.strictObject({
|
|
15884
15927
|
requestId,
|
|
15885
15928
|
ticketId: providerId,
|
|
15886
15929
|
recipient: supportEmail,
|
|
@@ -15888,53 +15931,53 @@ var billingReview = z39.strictObject({
|
|
|
15888
15931
|
resourceVersion: supportVersion,
|
|
15889
15932
|
summary: supportText(2e3)
|
|
15890
15933
|
});
|
|
15891
|
-
var reviewedResource =
|
|
15934
|
+
var reviewedResource = z40.strictObject({
|
|
15892
15935
|
id: providerId,
|
|
15893
15936
|
review: billingReview
|
|
15894
15937
|
});
|
|
15895
15938
|
var orderStatusChange = reviewedResource.extend({
|
|
15896
|
-
status:
|
|
15939
|
+
status: z40.string().regex(/^[A-Za-z0-9_-]{1,100}$/).refine((value) => !value.startsWith("wc-"))
|
|
15897
15940
|
});
|
|
15898
15941
|
var subscriptionCancellation = reviewedResource.extend({
|
|
15899
|
-
mode:
|
|
15942
|
+
mode: z40.enum(["endOfTerm", "immediate"])
|
|
15900
15943
|
});
|
|
15901
15944
|
var subscriptionCustomerChange = reviewedResource.extend({
|
|
15902
15945
|
email: supportEmail
|
|
15903
15946
|
});
|
|
15904
15947
|
var subscriptionPaymentChange = reviewedResource.extend({
|
|
15905
|
-
nextPaymentAt:
|
|
15948
|
+
nextPaymentAt: z40.iso.datetime({ offset: true }).refine((value) => {
|
|
15906
15949
|
const fraction = value.match(/\.(\d+)/)?.[1];
|
|
15907
15950
|
return !fraction || /^0+$/.test(fraction);
|
|
15908
15951
|
}, "Use a whole-second payment date.").transform((value) => new Date(value).toISOString())
|
|
15909
15952
|
});
|
|
15910
15953
|
var orderRefund = reviewedResource.extend({
|
|
15911
15954
|
amount: moneyAmount,
|
|
15912
|
-
currency:
|
|
15955
|
+
currency: z40.string().min(1).max(12),
|
|
15913
15956
|
reason: supportText(500)
|
|
15914
15957
|
});
|
|
15915
15958
|
var billingContract = {
|
|
15916
|
-
orderStatus:
|
|
15917
|
-
subscriptionCancel:
|
|
15918
|
-
subscriptionCustomer:
|
|
15919
|
-
subscriptionPayment:
|
|
15920
|
-
refund:
|
|
15959
|
+
orderStatus: oc27.errors(supportErrors).input(orderStatusChange).output(supportOperation),
|
|
15960
|
+
subscriptionCancel: oc27.errors(supportErrors).input(subscriptionCancellation).output(supportOperation),
|
|
15961
|
+
subscriptionCustomer: oc27.errors(supportErrors).input(subscriptionCustomerChange).output(supportOperation),
|
|
15962
|
+
subscriptionPayment: oc27.errors(supportErrors).input(subscriptionPaymentChange).output(supportOperation),
|
|
15963
|
+
refund: oc27.errors(supportErrors).input(orderRefund).output(supportOperation)
|
|
15921
15964
|
};
|
|
15922
15965
|
|
|
15923
15966
|
// ../staff-contracts/src/knowledge.ts
|
|
15924
|
-
import { oc as
|
|
15925
|
-
import { z as
|
|
15926
|
-
var supportPolicy =
|
|
15927
|
-
version:
|
|
15928
|
-
markdown:
|
|
15967
|
+
import { oc as oc28 } from "@orpc/contract";
|
|
15968
|
+
import { z as z41 } from "zod";
|
|
15969
|
+
var supportPolicy = z41.object({
|
|
15970
|
+
version: z41.literal(3),
|
|
15971
|
+
markdown: z41.string().min(1),
|
|
15929
15972
|
sha256: supportVersion,
|
|
15930
|
-
manualUrl:
|
|
15973
|
+
manualUrl: z41.url()
|
|
15931
15974
|
});
|
|
15932
|
-
var supportArticle =
|
|
15975
|
+
var supportArticle = z41.object({
|
|
15933
15976
|
id: providerId,
|
|
15934
|
-
title:
|
|
15935
|
-
text:
|
|
15936
|
-
url:
|
|
15937
|
-
modifiedAt:
|
|
15977
|
+
title: z41.string(),
|
|
15978
|
+
text: z41.string(),
|
|
15979
|
+
url: z41.url().nullable(),
|
|
15980
|
+
modifiedAt: z41.iso.datetime()
|
|
15938
15981
|
});
|
|
15939
15982
|
var articleCandidate = supportArticle.pick({
|
|
15940
15983
|
id: true,
|
|
@@ -15942,130 +15985,130 @@ var articleCandidate = supportArticle.pick({
|
|
|
15942
15985
|
url: true
|
|
15943
15986
|
});
|
|
15944
15987
|
var knowledgeContract = {
|
|
15945
|
-
policy:
|
|
15946
|
-
article:
|
|
15947
|
-
search:
|
|
15948
|
-
|
|
15949
|
-
items:
|
|
15950
|
-
isExhaustive:
|
|
15988
|
+
policy: oc28.meta({ operation: "read" }).errors(supportErrors).output(supportPolicy),
|
|
15989
|
+
article: oc28.meta({ operation: "read" }).errors(supportErrors).input(z41.strictObject({ id: providerId })).output(supportArticle),
|
|
15990
|
+
search: oc28.meta({ operation: "read" }).errors(supportErrors).input(z41.strictObject({ search: supportText(120) })).output(
|
|
15991
|
+
z41.object({
|
|
15992
|
+
items: z41.array(articleCandidate).max(5),
|
|
15993
|
+
isExhaustive: z41.literal(false)
|
|
15951
15994
|
})
|
|
15952
15995
|
)
|
|
15953
15996
|
};
|
|
15954
15997
|
|
|
15955
15998
|
// ../staff-contracts/src/logins.ts
|
|
15956
|
-
import { oc as
|
|
15957
|
-
import { z as
|
|
15958
|
-
var loginEvent =
|
|
15959
|
-
id:
|
|
15960
|
-
type:
|
|
15961
|
-
description:
|
|
15962
|
-
clientId:
|
|
15963
|
-
accountId:
|
|
15999
|
+
import { oc as oc29 } from "@orpc/contract";
|
|
16000
|
+
import { z as z42 } from "zod";
|
|
16001
|
+
var loginEvent = z42.object({
|
|
16002
|
+
id: z42.string().min(1),
|
|
16003
|
+
type: z42.enum(["s", "f", "cs", "cls", "fepotpft"]),
|
|
16004
|
+
description: z42.string().nullable(),
|
|
16005
|
+
clientId: z42.string().nullable(),
|
|
16006
|
+
accountId: z42.string().nullable(),
|
|
15964
16007
|
email: supportEmail,
|
|
15965
|
-
observedAt:
|
|
16008
|
+
observedAt: z42.iso.datetime()
|
|
15966
16009
|
});
|
|
15967
|
-
var loginQuery =
|
|
16010
|
+
var loginQuery = z42.strictObject({
|
|
15968
16011
|
email: supportEmail,
|
|
15969
|
-
from:
|
|
15970
|
-
until:
|
|
15971
|
-
page:
|
|
15972
|
-
});
|
|
15973
|
-
var loginContract =
|
|
15974
|
-
|
|
15975
|
-
items:
|
|
15976
|
-
nextPage:
|
|
15977
|
-
truncated:
|
|
16012
|
+
from: z42.iso.datetime(),
|
|
16013
|
+
until: z42.iso.datetime(),
|
|
16014
|
+
page: z42.int().min(1).max(50).default(1)
|
|
16015
|
+
});
|
|
16016
|
+
var loginContract = oc29.meta({ operation: "read" }).errors(supportErrors).input(loginQuery).output(
|
|
16017
|
+
z42.object({
|
|
16018
|
+
items: z42.array(loginEvent).max(20),
|
|
16019
|
+
nextPage: z42.int().positive().nullable(),
|
|
16020
|
+
truncated: z42.boolean()
|
|
15978
16021
|
})
|
|
15979
16022
|
);
|
|
15980
16023
|
|
|
15981
16024
|
// ../staff-contracts/src/tickets.ts
|
|
15982
|
-
import { oc as
|
|
15983
|
-
import { z as
|
|
16025
|
+
import { oc as oc30 } from "@orpc/contract";
|
|
16026
|
+
import { z as z43 } from "zod";
|
|
15984
16027
|
var ticketAttachmentDownload = downloadReference.extend({
|
|
15985
16028
|
sha256: supportVersion
|
|
15986
16029
|
});
|
|
15987
|
-
var ticketAttachment =
|
|
16030
|
+
var ticketAttachment = z43.object({
|
|
15988
16031
|
id: providerId,
|
|
15989
|
-
name:
|
|
15990
|
-
contentType:
|
|
15991
|
-
size:
|
|
16032
|
+
name: z43.string(),
|
|
16033
|
+
contentType: z43.string(),
|
|
16034
|
+
size: z43.int().nonnegative()
|
|
15992
16035
|
});
|
|
15993
|
-
var ticketSummary =
|
|
16036
|
+
var ticketSummary = z43.object({
|
|
15994
16037
|
id: providerId,
|
|
15995
|
-
subject:
|
|
15996
|
-
status:
|
|
15997
|
-
priority:
|
|
16038
|
+
subject: z43.string(),
|
|
16039
|
+
status: z43.int().positive(),
|
|
16040
|
+
priority: z43.int(),
|
|
15998
16041
|
requesterId: providerId,
|
|
15999
|
-
groupId:
|
|
16000
|
-
agentId:
|
|
16001
|
-
tags:
|
|
16002
|
-
updatedAt:
|
|
16042
|
+
groupId: z43.int().nullable(),
|
|
16043
|
+
agentId: z43.int().nullable(),
|
|
16044
|
+
tags: z43.array(z43.string()),
|
|
16045
|
+
updatedAt: z43.iso.datetime()
|
|
16003
16046
|
});
|
|
16004
|
-
var ticketMessage =
|
|
16047
|
+
var ticketMessage = z43.object({
|
|
16005
16048
|
id: providerId,
|
|
16006
|
-
agentId:
|
|
16007
|
-
incoming:
|
|
16008
|
-
private:
|
|
16009
|
-
text:
|
|
16010
|
-
createdAt:
|
|
16011
|
-
to:
|
|
16012
|
-
cc:
|
|
16013
|
-
bcc:
|
|
16014
|
-
attachments:
|
|
16015
|
-
});
|
|
16016
|
-
var ticketContext =
|
|
16049
|
+
agentId: z43.int().nullable(),
|
|
16050
|
+
incoming: z43.boolean(),
|
|
16051
|
+
private: z43.boolean(),
|
|
16052
|
+
text: z43.string().nullable(),
|
|
16053
|
+
createdAt: z43.iso.datetime(),
|
|
16054
|
+
to: z43.array(z43.string()),
|
|
16055
|
+
cc: z43.array(z43.string()),
|
|
16056
|
+
bcc: z43.array(z43.string()),
|
|
16057
|
+
attachments: z43.array(ticketAttachment)
|
|
16058
|
+
});
|
|
16059
|
+
var ticketContext = z43.object({
|
|
16017
16060
|
ticket: ticketSummary,
|
|
16018
16061
|
requesterEmail: supportEmail,
|
|
16019
|
-
description:
|
|
16020
|
-
attachments:
|
|
16021
|
-
messages:
|
|
16022
|
-
version:
|
|
16062
|
+
description: z43.string().nullable(),
|
|
16063
|
+
attachments: z43.array(ticketAttachment),
|
|
16064
|
+
messages: z43.array(ticketMessage),
|
|
16065
|
+
version: z43.string().regex(/^[a-f0-9]{64}$/)
|
|
16023
16066
|
});
|
|
16024
|
-
var ticketInput =
|
|
16025
|
-
var ticketQuery =
|
|
16067
|
+
var ticketInput = z43.strictObject({ id: providerId });
|
|
16068
|
+
var ticketQuery = z43.strictObject({
|
|
16026
16069
|
...supportPageFields,
|
|
16027
16070
|
email: supportEmail.optional(),
|
|
16028
|
-
updatedSince:
|
|
16029
|
-
order:
|
|
16030
|
-
statuses:
|
|
16031
|
-
excludeTags:
|
|
16032
|
-
groupId:
|
|
16033
|
-
agentId:
|
|
16071
|
+
updatedSince: z43.iso.datetime().optional(),
|
|
16072
|
+
order: z43.enum(["newest", "oldest", "recentlyUpdated", "leastRecentlyUpdated"]).default("newest"),
|
|
16073
|
+
statuses: z43.array(z43.int().positive()).max(20).optional(),
|
|
16074
|
+
excludeTags: z43.array(supportTag).max(40).refine((tags) => new Set(tags).size === tags.length).optional(),
|
|
16075
|
+
groupId: z43.int().nonnegative().optional(),
|
|
16076
|
+
agentId: z43.int().nonnegative().optional()
|
|
16034
16077
|
}).prefault({});
|
|
16035
|
-
var ticketPage =
|
|
16036
|
-
items:
|
|
16037
|
-
nextPage:
|
|
16038
|
-
truncated:
|
|
16078
|
+
var ticketPage = z43.object({
|
|
16079
|
+
items: z43.array(ticketSummary),
|
|
16080
|
+
nextPage: z43.int().positive().nullable(),
|
|
16081
|
+
truncated: z43.boolean()
|
|
16039
16082
|
});
|
|
16040
|
-
var ticketClosure =
|
|
16083
|
+
var ticketClosure = z43.strictObject({
|
|
16041
16084
|
id: providerId,
|
|
16042
16085
|
...supportReviewFields
|
|
16043
16086
|
});
|
|
16044
16087
|
var ticketReply = ticketClosure.extend({ text: supportText(8e3) });
|
|
16045
16088
|
var ticketTagChange = ticketClosure.extend({
|
|
16046
|
-
add:
|
|
16047
|
-
remove:
|
|
16089
|
+
add: z43.array(supportTag).max(40),
|
|
16090
|
+
remove: z43.array(supportTag).max(40)
|
|
16048
16091
|
}).refine(({ add, remove }) => {
|
|
16049
16092
|
const all = [...add, ...remove];
|
|
16050
16093
|
return all.length > 0 && all.length <= 40 && new Set(all).size === all.length;
|
|
16051
16094
|
}, "Supply distinct, nonoverlapping tag additions and removals.");
|
|
16052
16095
|
var ticketContract = {
|
|
16053
|
-
attachment:
|
|
16054
|
-
reply:
|
|
16055
|
-
close:
|
|
16056
|
-
tags:
|
|
16057
|
-
list:
|
|
16058
|
-
get:
|
|
16096
|
+
attachment: oc30.meta({ operation: "read" }).errors(supportErrors).input(ticketInput.extend({ attachmentId: providerId })).output(ticketAttachmentDownload),
|
|
16097
|
+
reply: oc30.errors(supportErrors).input(ticketReply).output(supportOperation),
|
|
16098
|
+
close: oc30.errors(supportErrors).input(ticketClosure).output(supportOperation),
|
|
16099
|
+
tags: oc30.errors(supportErrors).input(ticketTagChange).output(supportOperation),
|
|
16100
|
+
list: oc30.meta({ operation: "read" }).errors(supportErrors).input(ticketQuery).output(ticketPage),
|
|
16101
|
+
get: oc30.meta({ operation: "read" }).errors(supportErrors).input(ticketInput).output(ticketContext)
|
|
16059
16102
|
};
|
|
16060
16103
|
|
|
16061
16104
|
// ../staff-contracts/src/index.ts
|
|
16062
|
-
import { eventIterator as eventIterator7, oc as
|
|
16063
|
-
import { z as
|
|
16105
|
+
import { eventIterator as eventIterator7, oc as oc32 } from "@orpc/contract";
|
|
16106
|
+
import { z as z44 } from "zod";
|
|
16064
16107
|
|
|
16065
16108
|
// ../staff-contracts/src/aws/inventory.ts
|
|
16066
|
-
import { oc as
|
|
16109
|
+
import { oc as oc31 } from "@orpc/contract";
|
|
16067
16110
|
var inventoryContract = {
|
|
16068
|
-
resolve:
|
|
16111
|
+
resolve: oc31.meta({ operation: "read" }).errors(apiErrors).input(deviceLookupInput).output(deviceRegistration.strip())
|
|
16069
16112
|
};
|
|
16070
16113
|
|
|
16071
16114
|
// ../staff-contracts/src/aws/index.ts
|
|
@@ -16092,16 +16135,16 @@ var gcpContract = {
|
|
|
16092
16135
|
};
|
|
16093
16136
|
|
|
16094
16137
|
// ../staff-contracts/src/index.ts
|
|
16095
|
-
var procedure4 =
|
|
16138
|
+
var procedure4 = oc32.errors(apiErrors).input(trackerInput);
|
|
16096
16139
|
var trackerContract = {
|
|
16097
16140
|
subscription: subscriptionAllocationContract,
|
|
16098
16141
|
photos: trackerPhotoContract,
|
|
16099
16142
|
...trackerChangeContract,
|
|
16100
16143
|
members: {
|
|
16101
16144
|
...trackerChangeContract.members,
|
|
16102
|
-
add:
|
|
16145
|
+
add: oc32.errors(apiErrors).input(trackerMemberAddInput).output(z44.void())
|
|
16103
16146
|
},
|
|
16104
|
-
list:
|
|
16147
|
+
list: oc32.meta({ operation: "read" }).errors(apiErrors).input(staffTrackerPageInput).output(staffTrackerPage),
|
|
16105
16148
|
get: procedure4.meta({ operation: "read" }).output(staffTracker),
|
|
16106
16149
|
watch: procedure4.meta({ operation: "read" }).output(eventIterator7(staffTracker))
|
|
16107
16150
|
};
|
|
@@ -16130,6 +16173,14 @@ export {
|
|
|
16130
16173
|
trackerSummary,
|
|
16131
16174
|
trackerPage,
|
|
16132
16175
|
tracker,
|
|
16176
|
+
erasureSelection,
|
|
16177
|
+
erasureReference,
|
|
16178
|
+
erasurePolicy,
|
|
16179
|
+
erasureReview,
|
|
16180
|
+
erasureSubmission,
|
|
16181
|
+
erasureSystems,
|
|
16182
|
+
erasureOperation,
|
|
16183
|
+
erasureContract,
|
|
16133
16184
|
staffAccountInput,
|
|
16134
16185
|
staffAccountEmail,
|
|
16135
16186
|
staffAccountContract,
|