@bikefinder/staff-sdk 0.9.1 → 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-EJ6ZAUPX.js → chunk-UBRRR6VL.js} +921 -874
- package/dist/index.d.ts +13715 -6279
- package/dist/index.js +17 -1
- package/dist/schemas.d.ts +13717 -6281
- 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,223 +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 =
|
|
15163
|
-
var firmwareCatalogCapability = "firmware-catalog-
|
|
15203
|
+
import { oc as oc18 } from "@orpc/contract";
|
|
15204
|
+
import { z as z28 } from "zod";
|
|
15205
|
+
var firmwareCatalogFamily = z28.enum(["gen2-lte", "gen2-battery"]);
|
|
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
|
-
|
|
15176
|
-
buildFingerprint: digest.nullable(),
|
|
15177
|
-
size: z27.int().min(1).max(maximumFirmwareUploadBytes),
|
|
15217
|
+
notes: z28.string().trim().min(1).max(2e3),
|
|
15218
|
+
size: z28.int().min(1).max(maximumFirmwareUploadBytes),
|
|
15178
15219
|
sha256: digest
|
|
15179
15220
|
});
|
|
15180
15221
|
var firmwareCatalogPublishInput = firmwareCatalogUploadInput.extend({
|
|
15181
|
-
file:
|
|
15222
|
+
file: z28.file().min(1).max(maximumFirmwareUploadBytes).mime("application/octet-stream")
|
|
15182
15223
|
});
|
|
15183
|
-
var firmwareCatalogRelease =
|
|
15224
|
+
var firmwareCatalogRelease = z28.object({
|
|
15184
15225
|
id: catalogId,
|
|
15185
15226
|
family: firmwareCatalogFamily,
|
|
15186
15227
|
version: catalogFirmwareVersion,
|
|
15187
15228
|
revision: digest,
|
|
15188
|
-
size:
|
|
15229
|
+
size: z28.int().positive(),
|
|
15189
15230
|
sha256: digest,
|
|
15190
|
-
notes:
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
downloadUrl: z27.url({ protocol: /^https$/ }),
|
|
15194
|
-
availableForUpdates: z27.boolean()
|
|
15231
|
+
notes: z28.string(),
|
|
15232
|
+
downloadUrl: z28.url({ protocol: /^https$/ }),
|
|
15233
|
+
availableForUpdates: z28.boolean()
|
|
15195
15234
|
});
|
|
15196
|
-
var firmwareCatalogInput =
|
|
15235
|
+
var firmwareCatalogInput = z28.strictObject({ id: catalogId });
|
|
15197
15236
|
var firmwareCatalogContract = {
|
|
15198
|
-
list:
|
|
15199
|
-
|
|
15237
|
+
list: oc18.meta({ operation: "read" }).errors(firmwareErrors).input(
|
|
15238
|
+
z28.strictObject({
|
|
15200
15239
|
family: firmwareCatalogFamily,
|
|
15201
|
-
limit:
|
|
15202
|
-
after:
|
|
15240
|
+
limit: z28.int().min(1).max(100).default(25),
|
|
15241
|
+
after: z28.string().max(1024).nullable().optional()
|
|
15203
15242
|
})
|
|
15204
15243
|
).output(
|
|
15205
|
-
|
|
15206
|
-
items:
|
|
15207
|
-
nextAfter:
|
|
15244
|
+
z28.object({
|
|
15245
|
+
items: z28.array(firmwareCatalogRelease),
|
|
15246
|
+
nextAfter: z28.string().nullable()
|
|
15208
15247
|
})
|
|
15209
15248
|
),
|
|
15210
|
-
get:
|
|
15211
|
-
publish:
|
|
15212
|
-
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)
|
|
15213
15252
|
};
|
|
15214
15253
|
|
|
15215
15254
|
// ../staff-contracts/src/gcp/maintenance.ts
|
|
15216
|
-
import { oc as
|
|
15217
|
-
import { z as
|
|
15218
|
-
var maintenanceInput =
|
|
15255
|
+
import { oc as oc19 } from "@orpc/contract";
|
|
15256
|
+
import { z as z29 } from "zod";
|
|
15257
|
+
var maintenanceInput = z29.strictObject({
|
|
15219
15258
|
deviceId: documentId,
|
|
15220
15259
|
requestId
|
|
15221
15260
|
});
|
|
15222
15261
|
var denylistInput = maintenanceInput.extend({
|
|
15223
|
-
blacklisted:
|
|
15262
|
+
blacklisted: z29.boolean()
|
|
15224
15263
|
});
|
|
15225
|
-
var maintenanceAccepted =
|
|
15264
|
+
var maintenanceAccepted = z29.object({
|
|
15226
15265
|
deviceId: documentId,
|
|
15227
15266
|
requestId
|
|
15228
15267
|
});
|
|
15229
|
-
var operationExecution =
|
|
15230
|
-
state:
|
|
15231
|
-
attempts:
|
|
15232
|
-
finishedAt:
|
|
15268
|
+
var operationExecution = z29.object({
|
|
15269
|
+
state: z29.string().nullable(),
|
|
15270
|
+
attempts: z29.int().nullable(),
|
|
15271
|
+
finishedAt: z29.iso.datetime().nullable()
|
|
15233
15272
|
});
|
|
15234
|
-
var maintenanceOperation =
|
|
15273
|
+
var maintenanceOperation = z29.object({
|
|
15235
15274
|
...documentFields,
|
|
15236
15275
|
deviceId: documentId,
|
|
15237
|
-
trackerCreatedAt:
|
|
15238
|
-
operation:
|
|
15239
|
-
jobId:
|
|
15240
|
-
requestedBy:
|
|
15241
|
-
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(),
|
|
15242
15281
|
execution: operationExecution.nullable()
|
|
15243
15282
|
});
|
|
15244
15283
|
var maintenanceContract = {
|
|
15245
|
-
clean:
|
|
15246
|
-
setDenylist:
|
|
15247
|
-
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)
|
|
15248
15287
|
};
|
|
15249
15288
|
|
|
15250
15289
|
// ../staff-contracts/src/gcp/sim.ts
|
|
15251
|
-
import { oc as
|
|
15252
|
-
import { z as
|
|
15253
|
-
var simStatus =
|
|
15254
|
-
iccid:
|
|
15255
|
-
found:
|
|
15256
|
-
status:
|
|
15257
|
-
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()
|
|
15258
15297
|
});
|
|
15259
|
-
var simStatusContract =
|
|
15298
|
+
var simStatusContract = oc20.meta({ operation: "read" }).errors(apiErrors).input(trackerInput).output(simStatus);
|
|
15260
15299
|
|
|
15261
15300
|
// ../staff-contracts/src/gcp/legacy-lte.ts
|
|
15262
|
-
import { oc as
|
|
15263
|
-
import { z as
|
|
15264
|
-
var uuid =
|
|
15265
|
-
var legacyLteVersion =
|
|
15266
|
-
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({
|
|
15267
15306
|
cycleId: uuid,
|
|
15268
15307
|
targetVersion: legacyLteVersion,
|
|
15269
|
-
state:
|
|
15270
|
-
expiresAt:
|
|
15308
|
+
state: z31.enum(["queued", "dispatched", "expired"]),
|
|
15309
|
+
expiresAt: z31.iso.datetime().nullable()
|
|
15271
15310
|
});
|
|
15272
|
-
var legacyLteOptions =
|
|
15273
|
-
currentVersion:
|
|
15274
|
-
blockedReason:
|
|
15275
|
-
releases:
|
|
15311
|
+
var legacyLteOptions = z31.object({
|
|
15312
|
+
currentVersion: z31.string().nullable(),
|
|
15313
|
+
blockedReason: z31.string().nullable(),
|
|
15314
|
+
releases: z31.array(firmwareRelease.extend({ version: legacyLteVersion })),
|
|
15276
15315
|
upgrade: legacyLteUpgrade.nullable()
|
|
15277
15316
|
});
|
|
15278
15317
|
var legacyLteQueueInput = trackerInput.extend({
|
|
@@ -15287,61 +15326,61 @@ var legacyLteCancelInput = trackerInput.extend({
|
|
|
15287
15326
|
expectedCycleId: uuid
|
|
15288
15327
|
});
|
|
15289
15328
|
var legacyLteOperationInput = trackerInput.extend({ requestId: uuid });
|
|
15290
|
-
var legacyLteOperation =
|
|
15329
|
+
var legacyLteOperation = z31.object({
|
|
15291
15330
|
requestId: uuid,
|
|
15292
|
-
kind:
|
|
15331
|
+
kind: z31.enum(["queue", "cancel"]),
|
|
15293
15332
|
cycleId: uuid,
|
|
15294
15333
|
fromVersion: legacyLteVersion.nullable(),
|
|
15295
15334
|
targetVersion: legacyLteVersion.nullable(),
|
|
15296
|
-
requestedAt:
|
|
15335
|
+
requestedAt: z31.iso.datetime()
|
|
15297
15336
|
});
|
|
15298
|
-
var procedure2 =
|
|
15337
|
+
var procedure2 = oc21.errors(firmwareErrors);
|
|
15299
15338
|
var legacyLteContract = {
|
|
15300
15339
|
options: procedure2.meta({ operation: "read" }).input(trackerInput).output(legacyLteOptions),
|
|
15301
15340
|
queue: procedure2.input(legacyLteQueueInput).output(
|
|
15302
|
-
|
|
15341
|
+
z31.object({
|
|
15303
15342
|
cycleId: uuid,
|
|
15304
15343
|
fromVersion: legacyLteVersion,
|
|
15305
15344
|
targetVersion: legacyLteVersion
|
|
15306
15345
|
})
|
|
15307
15346
|
),
|
|
15308
|
-
cancel: procedure2.input(legacyLteCancelInput).output(
|
|
15347
|
+
cancel: procedure2.input(legacyLteCancelInput).output(z31.object({ cycleId: uuid })),
|
|
15309
15348
|
operation: procedure2.meta({ operation: "read" }).input(legacyLteOperationInput).output(legacyLteOperation)
|
|
15310
15349
|
};
|
|
15311
15350
|
|
|
15312
15351
|
// ../staff-contracts/src/schemas.ts
|
|
15313
|
-
import { z as
|
|
15314
|
-
var staffTrackerSummary =
|
|
15352
|
+
import { z as z32 } from "zod";
|
|
15353
|
+
var staffTrackerSummary = z32.object({
|
|
15315
15354
|
...trackerSummaryFields,
|
|
15316
|
-
hardware:
|
|
15317
|
-
imei:
|
|
15318
|
-
iccid:
|
|
15319
|
-
imsi:
|
|
15320
|
-
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()
|
|
15321
15360
|
}).nullable(),
|
|
15322
|
-
backend:
|
|
15361
|
+
backend: z32.string().nullable()
|
|
15323
15362
|
});
|
|
15324
|
-
var staffTrackerPage =
|
|
15325
|
-
items:
|
|
15326
|
-
nextAfter:
|
|
15363
|
+
var staffTrackerPage = z32.object({
|
|
15364
|
+
items: z32.array(staffTrackerSummary),
|
|
15365
|
+
nextAfter: z32.string().nullable()
|
|
15327
15366
|
});
|
|
15328
|
-
var staffTracker =
|
|
15367
|
+
var staffTracker = z32.object({
|
|
15329
15368
|
...trackerFields,
|
|
15330
15369
|
hardware: staffTrackerSummary.shape.hardware,
|
|
15331
15370
|
backend: staffTrackerSummary.shape.backend,
|
|
15332
|
-
configuration:
|
|
15333
|
-
movementAlerts:
|
|
15334
|
-
isBlacklisted:
|
|
15371
|
+
configuration: z32.object({
|
|
15372
|
+
movementAlerts: z32.boolean().nullable(),
|
|
15373
|
+
isBlacklisted: z32.boolean().nullable()
|
|
15335
15374
|
}).nullable()
|
|
15336
15375
|
});
|
|
15337
15376
|
|
|
15338
15377
|
// ../staff-contracts/src/gcp/diagnostics.ts
|
|
15339
|
-
import { oc as
|
|
15340
|
-
import { z as
|
|
15341
|
-
var number =
|
|
15342
|
-
var integer =
|
|
15343
|
-
var text2 =
|
|
15344
|
-
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();
|
|
15345
15384
|
var trackerBatteryDiagnostics = trackerBattery.extend({
|
|
15346
15385
|
temp: number,
|
|
15347
15386
|
voltage: number,
|
|
@@ -15358,8 +15397,8 @@ var trackerBatteryDiagnostics = trackerBattery.extend({
|
|
|
15358
15397
|
chargerChipStatus: text2,
|
|
15359
15398
|
chargerFaultStatus: text2
|
|
15360
15399
|
});
|
|
15361
|
-
var coordinates =
|
|
15362
|
-
var reportCell =
|
|
15400
|
+
var coordinates = z33.object({ latitude: number, longitude: number });
|
|
15401
|
+
var reportCell = z33.object({
|
|
15363
15402
|
mcc: integer,
|
|
15364
15403
|
mnc: integer,
|
|
15365
15404
|
lac: integer,
|
|
@@ -15373,14 +15412,14 @@ var reportCell = z32.object({
|
|
|
15373
15412
|
timeToConnect: number,
|
|
15374
15413
|
networkType: text2,
|
|
15375
15414
|
get nCells() {
|
|
15376
|
-
return
|
|
15415
|
+
return z33.array(reportCell).nullable();
|
|
15377
15416
|
},
|
|
15378
15417
|
get gciCells() {
|
|
15379
|
-
return
|
|
15418
|
+
return z33.array(reportCell).nullable();
|
|
15380
15419
|
}
|
|
15381
15420
|
});
|
|
15382
|
-
var trackerLatestReport =
|
|
15383
|
-
timestamp:
|
|
15421
|
+
var trackerLatestReport = z33.object({
|
|
15422
|
+
timestamp: z33.iso.datetime().nullable(),
|
|
15384
15423
|
type: text2,
|
|
15385
15424
|
mode: text2,
|
|
15386
15425
|
stage: text2,
|
|
@@ -15427,13 +15466,13 @@ var trackerLatestReport = z32.object({
|
|
|
15427
15466
|
gnssMaxSatsInView: integer
|
|
15428
15467
|
}).nullable(),
|
|
15429
15468
|
geoPoint: coordinates.nullable(),
|
|
15430
|
-
cells:
|
|
15431
|
-
wifi:
|
|
15432
|
-
bleDevs:
|
|
15433
|
-
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()
|
|
15434
15473
|
});
|
|
15435
|
-
var operationStatistics =
|
|
15436
|
-
var trackerStatistics =
|
|
15474
|
+
var operationStatistics = z33.object({ count: integer, successCount: integer, failCount: integer }).nullable();
|
|
15475
|
+
var trackerStatistics = z33.object({
|
|
15437
15476
|
count: integer,
|
|
15438
15477
|
resets: integer,
|
|
15439
15478
|
failedWifi: integer,
|
|
@@ -15449,7 +15488,7 @@ var trackerStatistics = z32.object({
|
|
|
15449
15488
|
averageCellSignalStrength: number,
|
|
15450
15489
|
averageSatsInView: number,
|
|
15451
15490
|
averageGnssFixSnr: number,
|
|
15452
|
-
averageGnssMaxSnr:
|
|
15491
|
+
averageGnssMaxSnr: z33.object({ value: number, count: integer }).nullable(),
|
|
15453
15492
|
oad: operationStatistics,
|
|
15454
15493
|
factoryReset: operationStatistics,
|
|
15455
15494
|
INI: integer,
|
|
@@ -15463,36 +15502,36 @@ var trackerStatistics = z32.object({
|
|
|
15463
15502
|
DEFAULT: integer,
|
|
15464
15503
|
SMT: integer
|
|
15465
15504
|
});
|
|
15466
|
-
var staffTrackerDiagnostics =
|
|
15505
|
+
var staffTrackerDiagnostics = z33.object({
|
|
15467
15506
|
...documentFields,
|
|
15468
15507
|
batteryDiagnostics: trackerBatteryDiagnostics.nullable(),
|
|
15469
15508
|
latestReport: trackerLatestReport.nullable(),
|
|
15470
15509
|
statistics: trackerStatistics.nullable()
|
|
15471
15510
|
});
|
|
15472
|
-
var procedure3 =
|
|
15511
|
+
var procedure3 = oc22.meta({ operation: "read" }).errors(apiErrors).input(trackerInput);
|
|
15473
15512
|
var diagnosticsContract = {
|
|
15474
15513
|
get: procedure3.output(staffTrackerDiagnostics),
|
|
15475
15514
|
watch: procedure3.output(eventIterator6(staffTrackerDiagnostics))
|
|
15476
15515
|
};
|
|
15477
15516
|
|
|
15478
15517
|
// ../staff-contracts/src/gcp/audit.ts
|
|
15479
|
-
import { oc as
|
|
15480
|
-
import { z as
|
|
15481
|
-
var text3 =
|
|
15482
|
-
var integer2 =
|
|
15483
|
-
var time =
|
|
15484
|
-
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();
|
|
15485
15524
|
var envelope = {
|
|
15486
15525
|
timestamp: time,
|
|
15487
|
-
value:
|
|
15488
|
-
requestedBy:
|
|
15526
|
+
value: z34.boolean().optional(),
|
|
15527
|
+
requestedBy: z34.string().optional()
|
|
15489
15528
|
};
|
|
15490
|
-
var unsupported =
|
|
15529
|
+
var unsupported = z34.object({
|
|
15491
15530
|
...envelope,
|
|
15492
|
-
kind:
|
|
15531
|
+
kind: z34.literal("unsupported"),
|
|
15493
15532
|
type: text3
|
|
15494
15533
|
});
|
|
15495
|
-
var bike =
|
|
15534
|
+
var bike = z34.object({
|
|
15496
15535
|
nickname: text3,
|
|
15497
15536
|
brand: text3,
|
|
15498
15537
|
type: text3,
|
|
@@ -15504,20 +15543,20 @@ var bike = z33.object({
|
|
|
15504
15543
|
receiptImage: text3,
|
|
15505
15544
|
receiptImageThumb: text3
|
|
15506
15545
|
}).partial();
|
|
15507
|
-
var member =
|
|
15508
|
-
active:
|
|
15546
|
+
var member = z34.object({
|
|
15547
|
+
active: z34.boolean().nullable(),
|
|
15509
15548
|
addedBy: text3,
|
|
15510
15549
|
displayName: text3,
|
|
15511
15550
|
description: text3,
|
|
15512
15551
|
listIndex: integer2,
|
|
15513
15552
|
timestamp: time
|
|
15514
15553
|
}).partial();
|
|
15515
|
-
var members =
|
|
15516
|
-
var pin =
|
|
15517
|
-
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({
|
|
15518
15557
|
...envelope,
|
|
15519
|
-
kind:
|
|
15520
|
-
type:
|
|
15558
|
+
kind: z34.literal("textChange"),
|
|
15559
|
+
type: z34.enum([
|
|
15521
15560
|
"mode",
|
|
15522
15561
|
"status",
|
|
15523
15562
|
"tiFirmware",
|
|
@@ -15531,45 +15570,45 @@ var textChange = z33.object({
|
|
|
15531
15570
|
old: text3,
|
|
15532
15571
|
new: text3
|
|
15533
15572
|
});
|
|
15534
|
-
var buildChange =
|
|
15573
|
+
var buildChange = z34.object({
|
|
15535
15574
|
...envelope,
|
|
15536
|
-
kind:
|
|
15537
|
-
type:
|
|
15575
|
+
kind: z34.literal("buildChange"),
|
|
15576
|
+
type: z34.literal("buildNumber"),
|
|
15538
15577
|
old: scalar,
|
|
15539
15578
|
new: scalar
|
|
15540
15579
|
});
|
|
15541
|
-
var countChange =
|
|
15580
|
+
var countChange = z34.object({
|
|
15542
15581
|
...envelope,
|
|
15543
|
-
kind:
|
|
15544
|
-
type:
|
|
15582
|
+
kind: z34.literal("countChange"),
|
|
15583
|
+
type: z34.literal("userCount"),
|
|
15545
15584
|
old: integer2,
|
|
15546
15585
|
new: integer2
|
|
15547
15586
|
});
|
|
15548
|
-
var booleanChange =
|
|
15587
|
+
var booleanChange = z34.object({
|
|
15549
15588
|
...envelope,
|
|
15550
|
-
kind:
|
|
15551
|
-
type:
|
|
15552
|
-
old:
|
|
15553
|
-
new:
|
|
15589
|
+
kind: z34.literal("booleanChange"),
|
|
15590
|
+
type: z34.literal("isBlacklisted"),
|
|
15591
|
+
old: z34.boolean().nullable(),
|
|
15592
|
+
new: z34.boolean().nullable()
|
|
15554
15593
|
});
|
|
15555
|
-
var pinChange =
|
|
15594
|
+
var pinChange = z34.object({
|
|
15556
15595
|
...envelope,
|
|
15557
|
-
kind:
|
|
15558
|
-
type:
|
|
15596
|
+
kind: z34.literal("pinChange"),
|
|
15597
|
+
type: z34.literal("blePin"),
|
|
15559
15598
|
old: pin,
|
|
15560
15599
|
new: pin
|
|
15561
15600
|
});
|
|
15562
|
-
var bikeChange =
|
|
15601
|
+
var bikeChange = z34.object({
|
|
15563
15602
|
...envelope,
|
|
15564
|
-
kind:
|
|
15565
|
-
type:
|
|
15603
|
+
kind: z34.literal("bikeChange"),
|
|
15604
|
+
type: z34.literal("bikeInfo"),
|
|
15566
15605
|
old: bike.nullable(),
|
|
15567
15606
|
new: bike.nullable()
|
|
15568
15607
|
});
|
|
15569
|
-
var membersChange =
|
|
15608
|
+
var membersChange = z34.object({
|
|
15570
15609
|
...envelope,
|
|
15571
|
-
kind:
|
|
15572
|
-
type:
|
|
15610
|
+
kind: z34.literal("membersChange"),
|
|
15611
|
+
type: z34.enum(["users", "fleetUsers"]),
|
|
15573
15612
|
old: members,
|
|
15574
15613
|
new: members
|
|
15575
15614
|
});
|
|
@@ -15582,20 +15621,20 @@ var changes = [
|
|
|
15582
15621
|
bikeChange,
|
|
15583
15622
|
membersChange
|
|
15584
15623
|
];
|
|
15585
|
-
var nestedChange =
|
|
15586
|
-
var operation =
|
|
15624
|
+
var nestedChange = z34.discriminatedUnion("kind", [...changes, unsupported]);
|
|
15625
|
+
var operation = z34.object({
|
|
15587
15626
|
type: text3,
|
|
15588
15627
|
timestamp: time,
|
|
15589
|
-
what:
|
|
15590
|
-
|
|
15591
|
-
|
|
15592
|
-
|
|
15593
|
-
|
|
15594
|
-
|
|
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") })
|
|
15595
15634
|
]),
|
|
15596
|
-
doc:
|
|
15635
|
+
doc: z34.object({ id: text3, type: text3, fleetId: text3 }).nullable()
|
|
15597
15636
|
});
|
|
15598
|
-
var diagnostic =
|
|
15637
|
+
var diagnostic = z34.object({
|
|
15599
15638
|
code: text3,
|
|
15600
15639
|
stage: text3,
|
|
15601
15640
|
classification: text3,
|
|
@@ -15607,33 +15646,33 @@ var diagnostic = z33.object({
|
|
|
15607
15646
|
providerStage: text3,
|
|
15608
15647
|
providerState: text3,
|
|
15609
15648
|
responseCode: scalar,
|
|
15610
|
-
outcomeUnknown:
|
|
15649
|
+
outcomeUnknown: z34.boolean().nullable(),
|
|
15611
15650
|
correlationId: text3
|
|
15612
15651
|
});
|
|
15613
|
-
var auditEvent =
|
|
15652
|
+
var auditEvent = z34.discriminatedUnion("kind", [
|
|
15614
15653
|
...changes,
|
|
15615
|
-
|
|
15654
|
+
z34.object({
|
|
15616
15655
|
...envelope,
|
|
15617
|
-
kind:
|
|
15618
|
-
type:
|
|
15656
|
+
kind: z34.literal("message"),
|
|
15657
|
+
type: z34.enum(["info", "error"]),
|
|
15619
15658
|
message: text3,
|
|
15620
15659
|
operationId: text3
|
|
15621
15660
|
}),
|
|
15622
|
-
|
|
15661
|
+
z34.object({
|
|
15623
15662
|
...envelope,
|
|
15624
|
-
kind:
|
|
15625
|
-
type:
|
|
15663
|
+
kind: z34.literal("note"),
|
|
15664
|
+
type: z34.literal("blacklist"),
|
|
15626
15665
|
note: text3
|
|
15627
15666
|
}),
|
|
15628
|
-
|
|
15667
|
+
z34.object({
|
|
15629
15668
|
...envelope,
|
|
15630
|
-
kind:
|
|
15631
|
-
type:
|
|
15669
|
+
kind: z34.literal("action"),
|
|
15670
|
+
type: z34.enum(["clean", "factoryReset", "isBlacklisted"])
|
|
15632
15671
|
}),
|
|
15633
|
-
|
|
15672
|
+
z34.object({
|
|
15634
15673
|
...envelope,
|
|
15635
|
-
kind:
|
|
15636
|
-
type:
|
|
15674
|
+
kind: z34.literal("failure"),
|
|
15675
|
+
type: z34.literal("effectFailure"),
|
|
15637
15676
|
schemaVersion: integer2,
|
|
15638
15677
|
source: text3,
|
|
15639
15678
|
producer: text3,
|
|
@@ -15646,96 +15685,96 @@ var auditEvent = z33.discriminatedUnion("kind", [
|
|
|
15646
15685
|
deviceCreatedAt: time,
|
|
15647
15686
|
diagnostic: diagnostic.nullable()
|
|
15648
15687
|
}),
|
|
15649
|
-
|
|
15688
|
+
z34.object({
|
|
15650
15689
|
...envelope,
|
|
15651
|
-
kind:
|
|
15652
|
-
type:
|
|
15690
|
+
kind: z34.literal("operations"),
|
|
15691
|
+
type: z34.enum(["read", "google.firestore.document.update"]),
|
|
15653
15692
|
old: integer2,
|
|
15654
15693
|
new: integer2,
|
|
15655
15694
|
uid: text3,
|
|
15656
15695
|
logType: text3,
|
|
15657
15696
|
startTimestamp: time,
|
|
15658
15697
|
lastOperation: operation.nullable(),
|
|
15659
|
-
operations:
|
|
15698
|
+
operations: z34.array(operation).nullable()
|
|
15660
15699
|
}),
|
|
15661
15700
|
unsupported
|
|
15662
15701
|
]);
|
|
15663
|
-
var auditEntry =
|
|
15702
|
+
var auditEntry = z34.object({
|
|
15664
15703
|
...documentFields,
|
|
15665
15704
|
event: auditEvent,
|
|
15666
|
-
readIssues:
|
|
15667
|
-
|
|
15668
|
-
path:
|
|
15669
|
-
code:
|
|
15705
|
+
readIssues: z34.array(
|
|
15706
|
+
z34.object({
|
|
15707
|
+
path: z34.string(),
|
|
15708
|
+
code: z34.enum(["unsupported_stored_event_type", "invalid_stored_value"])
|
|
15670
15709
|
})
|
|
15671
15710
|
)
|
|
15672
15711
|
});
|
|
15673
|
-
var auditPage =
|
|
15674
|
-
items:
|
|
15712
|
+
var auditPage = z34.object({
|
|
15713
|
+
items: z34.array(auditEntry),
|
|
15675
15714
|
nextAfter: historyCursor.nullable()
|
|
15676
15715
|
});
|
|
15677
|
-
var auditContract =
|
|
15716
|
+
var auditContract = oc23.meta({ operation: "read" }).errors(apiErrors).input(historyInput).output(auditPage);
|
|
15678
15717
|
|
|
15679
15718
|
// ../staff-contracts/src/subscriptions.ts
|
|
15680
|
-
import { oc as
|
|
15681
|
-
import { z as
|
|
15719
|
+
import { oc as oc24 } from "@orpc/contract";
|
|
15720
|
+
import { z as z35 } from "zod";
|
|
15682
15721
|
var staffSubscription = subscription.extend({
|
|
15683
|
-
email:
|
|
15684
|
-
commerceId:
|
|
15685
|
-
sku:
|
|
15722
|
+
email: z35.string().nullable(),
|
|
15723
|
+
commerceId: z35.int().nullable(),
|
|
15724
|
+
sku: z35.string().nullable()
|
|
15686
15725
|
});
|
|
15687
|
-
var staffSubscriptionPageInput =
|
|
15726
|
+
var staffSubscriptionPageInput = z35.strictObject({
|
|
15688
15727
|
...pageFields,
|
|
15689
15728
|
accountId: documentId.optional(),
|
|
15690
|
-
commerceId:
|
|
15691
|
-
businessEmail:
|
|
15692
|
-
businessOnly:
|
|
15729
|
+
commerceId: z35.int().positive().optional(),
|
|
15730
|
+
businessEmail: z35.email().max(320).optional(),
|
|
15731
|
+
businessOnly: z35.boolean().default(false)
|
|
15693
15732
|
}).prefault({});
|
|
15694
|
-
var staffSubscriptionPage =
|
|
15695
|
-
items:
|
|
15696
|
-
nextAfter:
|
|
15733
|
+
var staffSubscriptionPage = z35.object({
|
|
15734
|
+
items: z35.array(staffSubscription),
|
|
15735
|
+
nextAfter: z35.string().nullable()
|
|
15697
15736
|
});
|
|
15698
15737
|
var staffSubscriptionContract = {
|
|
15699
|
-
get:
|
|
15700
|
-
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)
|
|
15701
15740
|
};
|
|
15702
15741
|
|
|
15703
15742
|
// ../staff-contracts/src/trackers.ts
|
|
15704
|
-
import { z as
|
|
15705
|
-
var exactValue =
|
|
15743
|
+
import { z as z36 } from "zod";
|
|
15744
|
+
var exactValue = z36.string().min(1).max(128).refine(
|
|
15706
15745
|
(value) => value.trim().length > 0 && !/\p{Cc}/u.test(value),
|
|
15707
15746
|
"Use one exact tracker filter."
|
|
15708
15747
|
);
|
|
15709
|
-
var staffTrackerFilter =
|
|
15710
|
-
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
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 })
|
|
15715
15754
|
]);
|
|
15716
|
-
var staffTrackerPageInput =
|
|
15755
|
+
var staffTrackerPageInput = z36.strictObject({
|
|
15717
15756
|
...pageFields,
|
|
15718
15757
|
filter: staffTrackerFilter.optional()
|
|
15719
15758
|
}).prefault({});
|
|
15720
15759
|
|
|
15721
15760
|
// ../staff-contracts/src/operations.ts
|
|
15722
|
-
import { oc as
|
|
15723
|
-
import { z as
|
|
15761
|
+
import { oc as oc25 } from "@orpc/contract";
|
|
15762
|
+
import { z as z38 } from "zod";
|
|
15724
15763
|
|
|
15725
15764
|
// ../staff-contracts/src/support.ts
|
|
15726
|
-
import { z as
|
|
15727
|
-
var providerId =
|
|
15765
|
+
import { z as z37 } from "zod";
|
|
15766
|
+
var providerId = z37.int().positive();
|
|
15728
15767
|
var supportPageFields = {
|
|
15729
|
-
page:
|
|
15730
|
-
limit:
|
|
15768
|
+
page: z37.int().min(1).max(300).default(1),
|
|
15769
|
+
limit: z37.int().min(1).max(100).default(20)
|
|
15731
15770
|
};
|
|
15732
|
-
var supportTag =
|
|
15771
|
+
var supportTag = z37.string().min(1).max(32).refine(
|
|
15733
15772
|
(value) => value.trim() === value && !/[\p{Cc}]/u.test(value),
|
|
15734
15773
|
"Use an exact tag without control characters."
|
|
15735
15774
|
);
|
|
15736
|
-
var supportEmail =
|
|
15737
|
-
var supportVersion =
|
|
15738
|
-
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"));
|
|
15739
15778
|
var supportReviewFields = {
|
|
15740
15779
|
requestId,
|
|
15741
15780
|
recipient: supportEmail,
|
|
@@ -15744,111 +15783,111 @@ var supportReviewFields = {
|
|
|
15744
15783
|
};
|
|
15745
15784
|
|
|
15746
15785
|
// ../staff-contracts/src/operations.ts
|
|
15747
|
-
var supportOperation =
|
|
15786
|
+
var supportOperation = z38.object({
|
|
15748
15787
|
requestId,
|
|
15749
|
-
kind:
|
|
15750
|
-
status:
|
|
15751
|
-
resource:
|
|
15788
|
+
kind: z38.string().min(1),
|
|
15789
|
+
status: z38.enum(["dispatching", "succeeded", "uncertain", "rejected"]),
|
|
15790
|
+
resource: z38.string().min(1),
|
|
15752
15791
|
providerId: providerId.nullable(),
|
|
15753
|
-
summary:
|
|
15754
|
-
createdAt:
|
|
15755
|
-
updatedAt:
|
|
15792
|
+
summary: z38.string(),
|
|
15793
|
+
createdAt: z38.iso.datetime(),
|
|
15794
|
+
updatedAt: z38.iso.datetime()
|
|
15756
15795
|
});
|
|
15757
|
-
var supportOperationInput =
|
|
15796
|
+
var supportOperationInput = z38.strictObject({ requestId });
|
|
15758
15797
|
var supportOperationContract = {
|
|
15759
|
-
get:
|
|
15798
|
+
get: oc25.meta({ operation: "read" }).errors(supportErrors).input(supportOperationInput).output(supportOperation)
|
|
15760
15799
|
};
|
|
15761
15800
|
|
|
15762
15801
|
// ../staff-contracts/src/commerce.ts
|
|
15763
|
-
import { oc as
|
|
15764
|
-
import { z as
|
|
15765
|
-
var moneyAmount =
|
|
15766
|
-
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({
|
|
15767
15806
|
id: providerId,
|
|
15768
|
-
name:
|
|
15769
|
-
productId:
|
|
15770
|
-
variationId:
|
|
15771
|
-
quantity:
|
|
15807
|
+
name: z39.string(),
|
|
15808
|
+
productId: z39.int().nonnegative(),
|
|
15809
|
+
variationId: z39.int().nonnegative(),
|
|
15810
|
+
quantity: z39.number(),
|
|
15772
15811
|
subtotal: moneyAmount,
|
|
15773
15812
|
subtotalTax: moneyAmount,
|
|
15774
15813
|
total: moneyAmount,
|
|
15775
15814
|
totalTax: moneyAmount,
|
|
15776
|
-
sku:
|
|
15815
|
+
sku: z39.string().nullable()
|
|
15777
15816
|
});
|
|
15778
|
-
var commerceOrder =
|
|
15817
|
+
var commerceOrder = z39.object({
|
|
15779
15818
|
id: providerId,
|
|
15780
|
-
number:
|
|
15781
|
-
status:
|
|
15819
|
+
number: z39.string(),
|
|
15820
|
+
status: z39.string(),
|
|
15782
15821
|
billingEmail: supportEmail,
|
|
15783
|
-
customerId:
|
|
15784
|
-
currency:
|
|
15822
|
+
customerId: z39.int().nonnegative(),
|
|
15823
|
+
currency: z39.string(),
|
|
15785
15824
|
total: moneyAmount,
|
|
15786
15825
|
totalTax: moneyAmount,
|
|
15787
15826
|
shippingTotal: moneyAmount,
|
|
15788
15827
|
discountTotal: moneyAmount,
|
|
15789
|
-
paymentMethod:
|
|
15790
|
-
transactionId:
|
|
15791
|
-
paidAtGmt:
|
|
15792
|
-
modifiedAtGmt:
|
|
15793
|
-
lines:
|
|
15794
|
-
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 })),
|
|
15795
15834
|
version: supportVersion,
|
|
15796
|
-
adminUrl:
|
|
15835
|
+
adminUrl: z39.url().nullable()
|
|
15797
15836
|
});
|
|
15798
|
-
var commerceSubscription =
|
|
15837
|
+
var commerceSubscription = z39.object({
|
|
15799
15838
|
id: providerId,
|
|
15800
|
-
status:
|
|
15839
|
+
status: z39.string(),
|
|
15801
15840
|
billingEmail: supportEmail,
|
|
15802
|
-
customerId:
|
|
15803
|
-
parentOrderId:
|
|
15804
|
-
currency:
|
|
15841
|
+
customerId: z39.int().nonnegative(),
|
|
15842
|
+
parentOrderId: z39.int().nonnegative(),
|
|
15843
|
+
currency: z39.string(),
|
|
15805
15844
|
total: moneyAmount,
|
|
15806
|
-
paymentMethod:
|
|
15807
|
-
manualRenewal:
|
|
15808
|
-
billingPeriod:
|
|
15809
|
-
billingInterval:
|
|
15810
|
-
nextPaymentAtGmt:
|
|
15811
|
-
retryAtGmt:
|
|
15812
|
-
endsAtGmt:
|
|
15813
|
-
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),
|
|
15814
15853
|
version: supportVersion,
|
|
15815
|
-
adminUrl:
|
|
15854
|
+
adminUrl: z39.url().nullable()
|
|
15816
15855
|
});
|
|
15817
|
-
var commerceNote =
|
|
15856
|
+
var commerceNote = z39.object({
|
|
15818
15857
|
id: providerId,
|
|
15819
|
-
text:
|
|
15820
|
-
author:
|
|
15821
|
-
customerNote:
|
|
15822
|
-
createdAtGmt:
|
|
15858
|
+
text: z39.string(),
|
|
15859
|
+
author: z39.string().nullable(),
|
|
15860
|
+
customerNote: z39.boolean(),
|
|
15861
|
+
createdAtGmt: z39.string()
|
|
15823
15862
|
});
|
|
15824
|
-
var commerceRefund =
|
|
15863
|
+
var commerceRefund = z39.object({
|
|
15825
15864
|
id: providerId,
|
|
15826
15865
|
amount: moneyAmount,
|
|
15827
|
-
reason:
|
|
15828
|
-
processorRefunded:
|
|
15866
|
+
reason: z39.string(),
|
|
15867
|
+
processorRefunded: z39.boolean()
|
|
15829
15868
|
});
|
|
15830
|
-
var refundCapacity =
|
|
15869
|
+
var refundCapacity = z39.object({
|
|
15831
15870
|
orderId: providerId,
|
|
15832
|
-
currency:
|
|
15871
|
+
currency: z39.string(),
|
|
15833
15872
|
remainingAmount: moneyAmount,
|
|
15834
|
-
priceDecimals:
|
|
15835
|
-
paymentMethod:
|
|
15836
|
-
processorSupportsRefunds:
|
|
15837
|
-
refundIds:
|
|
15873
|
+
priceDecimals: z39.int().min(0).max(6),
|
|
15874
|
+
paymentMethod: z39.string(),
|
|
15875
|
+
processorSupportsRefunds: z39.boolean(),
|
|
15876
|
+
refundIds: z39.array(providerId),
|
|
15838
15877
|
version: supportVersion
|
|
15839
15878
|
});
|
|
15840
|
-
var commerceRefundReview =
|
|
15879
|
+
var commerceRefundReview = z39.object({
|
|
15841
15880
|
capacity: refundCapacity,
|
|
15842
|
-
refunds:
|
|
15881
|
+
refunds: z39.array(commerceRefund)
|
|
15843
15882
|
});
|
|
15844
|
-
var commerceRelationships =
|
|
15845
|
-
resource:
|
|
15883
|
+
var commerceRelationships = z39.object({
|
|
15884
|
+
resource: z39.enum(["order", "subscription"]),
|
|
15846
15885
|
id: providerId,
|
|
15847
|
-
items:
|
|
15848
|
-
|
|
15886
|
+
items: z39.array(
|
|
15887
|
+
z39.object({ id: providerId, orderType: z39.string().nullable() })
|
|
15849
15888
|
)
|
|
15850
15889
|
});
|
|
15851
|
-
var commerceQuery =
|
|
15890
|
+
var commerceQuery = z39.strictObject({
|
|
15852
15891
|
...supportPageFields,
|
|
15853
15892
|
email: supportEmail.optional(),
|
|
15854
15893
|
search: supportText(200).optional()
|
|
@@ -15856,35 +15895,35 @@ var commerceQuery = z38.strictObject({
|
|
|
15856
15895
|
(input) => input.email === void 0 || input.search === void 0,
|
|
15857
15896
|
"Use exact billing email or a discovery search, never both."
|
|
15858
15897
|
).prefault({});
|
|
15859
|
-
var commerceId =
|
|
15898
|
+
var commerceId = z39.strictObject({ id: providerId });
|
|
15860
15899
|
var commerceNotesInput = commerceId.extend(supportPageFields);
|
|
15861
|
-
var page2 = (item) =>
|
|
15862
|
-
items:
|
|
15863
|
-
nextPage:
|
|
15864
|
-
truncated:
|
|
15900
|
+
var page2 = (item) => z39.object({
|
|
15901
|
+
items: z39.array(item),
|
|
15902
|
+
nextPage: z39.int().positive().nullable(),
|
|
15903
|
+
truncated: z39.boolean()
|
|
15865
15904
|
});
|
|
15866
|
-
var read =
|
|
15905
|
+
var read = oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceId);
|
|
15867
15906
|
var commerceContract = {
|
|
15868
15907
|
orders: {
|
|
15869
15908
|
get: read.output(commerceOrder),
|
|
15870
|
-
list:
|
|
15871
|
-
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)),
|
|
15872
15911
|
relationships: read.output(commerceRelationships),
|
|
15873
15912
|
refundReview: read.output(commerceRefundReview),
|
|
15874
|
-
refund:
|
|
15913
|
+
refund: oc26.meta({ operation: "read" }).errors(supportErrors).input(commerceId.extend({ refundId: providerId })).output(commerceRefund)
|
|
15875
15914
|
},
|
|
15876
15915
|
subscriptions: {
|
|
15877
15916
|
get: read.output(commerceSubscription),
|
|
15878
|
-
list:
|
|
15879
|
-
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)),
|
|
15880
15919
|
relationships: read.output(commerceRelationships)
|
|
15881
15920
|
}
|
|
15882
15921
|
};
|
|
15883
15922
|
|
|
15884
15923
|
// ../staff-contracts/src/billing.ts
|
|
15885
|
-
import { oc as
|
|
15886
|
-
import { z as
|
|
15887
|
-
var billingReview =
|
|
15924
|
+
import { oc as oc27 } from "@orpc/contract";
|
|
15925
|
+
import { z as z40 } from "zod";
|
|
15926
|
+
var billingReview = z40.strictObject({
|
|
15888
15927
|
requestId,
|
|
15889
15928
|
ticketId: providerId,
|
|
15890
15929
|
recipient: supportEmail,
|
|
@@ -15892,53 +15931,53 @@ var billingReview = z39.strictObject({
|
|
|
15892
15931
|
resourceVersion: supportVersion,
|
|
15893
15932
|
summary: supportText(2e3)
|
|
15894
15933
|
});
|
|
15895
|
-
var reviewedResource =
|
|
15934
|
+
var reviewedResource = z40.strictObject({
|
|
15896
15935
|
id: providerId,
|
|
15897
15936
|
review: billingReview
|
|
15898
15937
|
});
|
|
15899
15938
|
var orderStatusChange = reviewedResource.extend({
|
|
15900
|
-
status:
|
|
15939
|
+
status: z40.string().regex(/^[A-Za-z0-9_-]{1,100}$/).refine((value) => !value.startsWith("wc-"))
|
|
15901
15940
|
});
|
|
15902
15941
|
var subscriptionCancellation = reviewedResource.extend({
|
|
15903
|
-
mode:
|
|
15942
|
+
mode: z40.enum(["endOfTerm", "immediate"])
|
|
15904
15943
|
});
|
|
15905
15944
|
var subscriptionCustomerChange = reviewedResource.extend({
|
|
15906
15945
|
email: supportEmail
|
|
15907
15946
|
});
|
|
15908
15947
|
var subscriptionPaymentChange = reviewedResource.extend({
|
|
15909
|
-
nextPaymentAt:
|
|
15948
|
+
nextPaymentAt: z40.iso.datetime({ offset: true }).refine((value) => {
|
|
15910
15949
|
const fraction = value.match(/\.(\d+)/)?.[1];
|
|
15911
15950
|
return !fraction || /^0+$/.test(fraction);
|
|
15912
15951
|
}, "Use a whole-second payment date.").transform((value) => new Date(value).toISOString())
|
|
15913
15952
|
});
|
|
15914
15953
|
var orderRefund = reviewedResource.extend({
|
|
15915
15954
|
amount: moneyAmount,
|
|
15916
|
-
currency:
|
|
15955
|
+
currency: z40.string().min(1).max(12),
|
|
15917
15956
|
reason: supportText(500)
|
|
15918
15957
|
});
|
|
15919
15958
|
var billingContract = {
|
|
15920
|
-
orderStatus:
|
|
15921
|
-
subscriptionCancel:
|
|
15922
|
-
subscriptionCustomer:
|
|
15923
|
-
subscriptionPayment:
|
|
15924
|
-
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)
|
|
15925
15964
|
};
|
|
15926
15965
|
|
|
15927
15966
|
// ../staff-contracts/src/knowledge.ts
|
|
15928
|
-
import { oc as
|
|
15929
|
-
import { z as
|
|
15930
|
-
var supportPolicy =
|
|
15931
|
-
version:
|
|
15932
|
-
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),
|
|
15933
15972
|
sha256: supportVersion,
|
|
15934
|
-
manualUrl:
|
|
15973
|
+
manualUrl: z41.url()
|
|
15935
15974
|
});
|
|
15936
|
-
var supportArticle =
|
|
15975
|
+
var supportArticle = z41.object({
|
|
15937
15976
|
id: providerId,
|
|
15938
|
-
title:
|
|
15939
|
-
text:
|
|
15940
|
-
url:
|
|
15941
|
-
modifiedAt:
|
|
15977
|
+
title: z41.string(),
|
|
15978
|
+
text: z41.string(),
|
|
15979
|
+
url: z41.url().nullable(),
|
|
15980
|
+
modifiedAt: z41.iso.datetime()
|
|
15942
15981
|
});
|
|
15943
15982
|
var articleCandidate = supportArticle.pick({
|
|
15944
15983
|
id: true,
|
|
@@ -15946,130 +15985,130 @@ var articleCandidate = supportArticle.pick({
|
|
|
15946
15985
|
url: true
|
|
15947
15986
|
});
|
|
15948
15987
|
var knowledgeContract = {
|
|
15949
|
-
policy:
|
|
15950
|
-
article:
|
|
15951
|
-
search:
|
|
15952
|
-
|
|
15953
|
-
items:
|
|
15954
|
-
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)
|
|
15955
15994
|
})
|
|
15956
15995
|
)
|
|
15957
15996
|
};
|
|
15958
15997
|
|
|
15959
15998
|
// ../staff-contracts/src/logins.ts
|
|
15960
|
-
import { oc as
|
|
15961
|
-
import { z as
|
|
15962
|
-
var loginEvent =
|
|
15963
|
-
id:
|
|
15964
|
-
type:
|
|
15965
|
-
description:
|
|
15966
|
-
clientId:
|
|
15967
|
-
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(),
|
|
15968
16007
|
email: supportEmail,
|
|
15969
|
-
observedAt:
|
|
16008
|
+
observedAt: z42.iso.datetime()
|
|
15970
16009
|
});
|
|
15971
|
-
var loginQuery =
|
|
16010
|
+
var loginQuery = z42.strictObject({
|
|
15972
16011
|
email: supportEmail,
|
|
15973
|
-
from:
|
|
15974
|
-
until:
|
|
15975
|
-
page:
|
|
15976
|
-
});
|
|
15977
|
-
var loginContract =
|
|
15978
|
-
|
|
15979
|
-
items:
|
|
15980
|
-
nextPage:
|
|
15981
|
-
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()
|
|
15982
16021
|
})
|
|
15983
16022
|
);
|
|
15984
16023
|
|
|
15985
16024
|
// ../staff-contracts/src/tickets.ts
|
|
15986
|
-
import { oc as
|
|
15987
|
-
import { z as
|
|
16025
|
+
import { oc as oc30 } from "@orpc/contract";
|
|
16026
|
+
import { z as z43 } from "zod";
|
|
15988
16027
|
var ticketAttachmentDownload = downloadReference.extend({
|
|
15989
16028
|
sha256: supportVersion
|
|
15990
16029
|
});
|
|
15991
|
-
var ticketAttachment =
|
|
16030
|
+
var ticketAttachment = z43.object({
|
|
15992
16031
|
id: providerId,
|
|
15993
|
-
name:
|
|
15994
|
-
contentType:
|
|
15995
|
-
size:
|
|
16032
|
+
name: z43.string(),
|
|
16033
|
+
contentType: z43.string(),
|
|
16034
|
+
size: z43.int().nonnegative()
|
|
15996
16035
|
});
|
|
15997
|
-
var ticketSummary =
|
|
16036
|
+
var ticketSummary = z43.object({
|
|
15998
16037
|
id: providerId,
|
|
15999
|
-
subject:
|
|
16000
|
-
status:
|
|
16001
|
-
priority:
|
|
16038
|
+
subject: z43.string(),
|
|
16039
|
+
status: z43.int().positive(),
|
|
16040
|
+
priority: z43.int(),
|
|
16002
16041
|
requesterId: providerId,
|
|
16003
|
-
groupId:
|
|
16004
|
-
agentId:
|
|
16005
|
-
tags:
|
|
16006
|
-
updatedAt:
|
|
16042
|
+
groupId: z43.int().nullable(),
|
|
16043
|
+
agentId: z43.int().nullable(),
|
|
16044
|
+
tags: z43.array(z43.string()),
|
|
16045
|
+
updatedAt: z43.iso.datetime()
|
|
16007
16046
|
});
|
|
16008
|
-
var ticketMessage =
|
|
16047
|
+
var ticketMessage = z43.object({
|
|
16009
16048
|
id: providerId,
|
|
16010
|
-
agentId:
|
|
16011
|
-
incoming:
|
|
16012
|
-
private:
|
|
16013
|
-
text:
|
|
16014
|
-
createdAt:
|
|
16015
|
-
to:
|
|
16016
|
-
cc:
|
|
16017
|
-
bcc:
|
|
16018
|
-
attachments:
|
|
16019
|
-
});
|
|
16020
|
-
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({
|
|
16021
16060
|
ticket: ticketSummary,
|
|
16022
16061
|
requesterEmail: supportEmail,
|
|
16023
|
-
description:
|
|
16024
|
-
attachments:
|
|
16025
|
-
messages:
|
|
16026
|
-
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}$/)
|
|
16027
16066
|
});
|
|
16028
|
-
var ticketInput =
|
|
16029
|
-
var ticketQuery =
|
|
16067
|
+
var ticketInput = z43.strictObject({ id: providerId });
|
|
16068
|
+
var ticketQuery = z43.strictObject({
|
|
16030
16069
|
...supportPageFields,
|
|
16031
16070
|
email: supportEmail.optional(),
|
|
16032
|
-
updatedSince:
|
|
16033
|
-
order:
|
|
16034
|
-
statuses:
|
|
16035
|
-
excludeTags:
|
|
16036
|
-
groupId:
|
|
16037
|
-
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()
|
|
16038
16077
|
}).prefault({});
|
|
16039
|
-
var ticketPage =
|
|
16040
|
-
items:
|
|
16041
|
-
nextPage:
|
|
16042
|
-
truncated:
|
|
16078
|
+
var ticketPage = z43.object({
|
|
16079
|
+
items: z43.array(ticketSummary),
|
|
16080
|
+
nextPage: z43.int().positive().nullable(),
|
|
16081
|
+
truncated: z43.boolean()
|
|
16043
16082
|
});
|
|
16044
|
-
var ticketClosure =
|
|
16083
|
+
var ticketClosure = z43.strictObject({
|
|
16045
16084
|
id: providerId,
|
|
16046
16085
|
...supportReviewFields
|
|
16047
16086
|
});
|
|
16048
16087
|
var ticketReply = ticketClosure.extend({ text: supportText(8e3) });
|
|
16049
16088
|
var ticketTagChange = ticketClosure.extend({
|
|
16050
|
-
add:
|
|
16051
|
-
remove:
|
|
16089
|
+
add: z43.array(supportTag).max(40),
|
|
16090
|
+
remove: z43.array(supportTag).max(40)
|
|
16052
16091
|
}).refine(({ add, remove }) => {
|
|
16053
16092
|
const all = [...add, ...remove];
|
|
16054
16093
|
return all.length > 0 && all.length <= 40 && new Set(all).size === all.length;
|
|
16055
16094
|
}, "Supply distinct, nonoverlapping tag additions and removals.");
|
|
16056
16095
|
var ticketContract = {
|
|
16057
|
-
attachment:
|
|
16058
|
-
reply:
|
|
16059
|
-
close:
|
|
16060
|
-
tags:
|
|
16061
|
-
list:
|
|
16062
|
-
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)
|
|
16063
16102
|
};
|
|
16064
16103
|
|
|
16065
16104
|
// ../staff-contracts/src/index.ts
|
|
16066
|
-
import { eventIterator as eventIterator7, oc as
|
|
16067
|
-
import { z as
|
|
16105
|
+
import { eventIterator as eventIterator7, oc as oc32 } from "@orpc/contract";
|
|
16106
|
+
import { z as z44 } from "zod";
|
|
16068
16107
|
|
|
16069
16108
|
// ../staff-contracts/src/aws/inventory.ts
|
|
16070
|
-
import { oc as
|
|
16109
|
+
import { oc as oc31 } from "@orpc/contract";
|
|
16071
16110
|
var inventoryContract = {
|
|
16072
|
-
resolve:
|
|
16111
|
+
resolve: oc31.meta({ operation: "read" }).errors(apiErrors).input(deviceLookupInput).output(deviceRegistration.strip())
|
|
16073
16112
|
};
|
|
16074
16113
|
|
|
16075
16114
|
// ../staff-contracts/src/aws/index.ts
|
|
@@ -16096,16 +16135,16 @@ var gcpContract = {
|
|
|
16096
16135
|
};
|
|
16097
16136
|
|
|
16098
16137
|
// ../staff-contracts/src/index.ts
|
|
16099
|
-
var procedure4 =
|
|
16138
|
+
var procedure4 = oc32.errors(apiErrors).input(trackerInput);
|
|
16100
16139
|
var trackerContract = {
|
|
16101
16140
|
subscription: subscriptionAllocationContract,
|
|
16102
16141
|
photos: trackerPhotoContract,
|
|
16103
16142
|
...trackerChangeContract,
|
|
16104
16143
|
members: {
|
|
16105
16144
|
...trackerChangeContract.members,
|
|
16106
|
-
add:
|
|
16145
|
+
add: oc32.errors(apiErrors).input(trackerMemberAddInput).output(z44.void())
|
|
16107
16146
|
},
|
|
16108
|
-
list:
|
|
16147
|
+
list: oc32.meta({ operation: "read" }).errors(apiErrors).input(staffTrackerPageInput).output(staffTrackerPage),
|
|
16109
16148
|
get: procedure4.meta({ operation: "read" }).output(staffTracker),
|
|
16110
16149
|
watch: procedure4.meta({ operation: "read" }).output(eventIterator7(staffTracker))
|
|
16111
16150
|
};
|
|
@@ -16134,6 +16173,14 @@ export {
|
|
|
16134
16173
|
trackerSummary,
|
|
16135
16174
|
trackerPage,
|
|
16136
16175
|
tracker,
|
|
16176
|
+
erasureSelection,
|
|
16177
|
+
erasureReference,
|
|
16178
|
+
erasurePolicy,
|
|
16179
|
+
erasureReview,
|
|
16180
|
+
erasureSubmission,
|
|
16181
|
+
erasureSystems,
|
|
16182
|
+
erasureOperation,
|
|
16183
|
+
erasureContract,
|
|
16137
16184
|
staffAccountInput,
|
|
16138
16185
|
staffAccountEmail,
|
|
16139
16186
|
staffAccountContract,
|