@sortsys/v2-client 0.1.0 → 0.1.2
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/dist/index.d.ts +431 -1431
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
4
4
|
import { Request as Request$1, Response as Response$1 } from 'express-serve-static-core';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
5
6
|
|
|
6
7
|
declare const ROLES: readonly [
|
|
7
8
|
":admin",
|
|
@@ -32,6 +33,9 @@ declare const ROLES: readonly [
|
|
|
32
33
|
"view:productVendors",
|
|
33
34
|
"manage:productVendors",
|
|
34
35
|
"delete:productVendors",
|
|
36
|
+
"view:contacts",
|
|
37
|
+
"manage:contacts",
|
|
38
|
+
"delete:contacts",
|
|
35
39
|
"view:productPriceRecords",
|
|
36
40
|
"manage:productPriceRecords",
|
|
37
41
|
"delete:productPriceRecords",
|
|
@@ -255,1414 +259,6 @@ export type TrpcContext = {
|
|
|
255
259
|
authResult?: auth.AuthResult;
|
|
256
260
|
adminFor?: "+all" | string;
|
|
257
261
|
};
|
|
258
|
-
export type HandlerDefinition<PathT extends string, RouterT extends AnyRouter, TestsT extends readonly (() => void)[] | undefined = undefined> = {
|
|
259
|
-
path: PathT;
|
|
260
|
-
router: RouterT;
|
|
261
|
-
tests?: TestsT;
|
|
262
|
-
};
|
|
263
|
-
declare const HANDLERS: readonly [
|
|
264
|
-
HandlerDefinition<"auth", import("@trpc/server").TRPCBuiltRouter<{
|
|
265
|
-
ctx: TrpcContext;
|
|
266
|
-
meta: object;
|
|
267
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
268
|
-
message: string;
|
|
269
|
-
data: {
|
|
270
|
-
httpCode: error.http.StatusCodeCode;
|
|
271
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
272
|
-
httpStatus: number;
|
|
273
|
-
path?: string;
|
|
274
|
-
stack?: string;
|
|
275
|
-
};
|
|
276
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
277
|
-
};
|
|
278
|
-
transformer: true;
|
|
279
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
280
|
-
login: import("@trpc/server").TRPCMutationProcedure<{
|
|
281
|
-
input: {
|
|
282
|
-
tenant: string;
|
|
283
|
-
username: string;
|
|
284
|
-
password: string;
|
|
285
|
-
};
|
|
286
|
-
output: {
|
|
287
|
-
token: string;
|
|
288
|
-
};
|
|
289
|
-
meta: object;
|
|
290
|
-
}>;
|
|
291
|
-
logout: import("@trpc/server").TRPCMutationProcedure<{
|
|
292
|
-
input: void;
|
|
293
|
-
output: {
|
|
294
|
-
success: true;
|
|
295
|
-
};
|
|
296
|
-
meta: object;
|
|
297
|
-
}>;
|
|
298
|
-
check: import("@trpc/server").TRPCQueryProcedure<{
|
|
299
|
-
input: void;
|
|
300
|
-
output: {
|
|
301
|
-
success: true;
|
|
302
|
-
};
|
|
303
|
-
meta: object;
|
|
304
|
-
}>;
|
|
305
|
-
sessionInfo: import("@trpc/server").TRPCQueryProcedure<{
|
|
306
|
-
input: void;
|
|
307
|
-
output: {
|
|
308
|
-
user: {
|
|
309
|
-
id: string;
|
|
310
|
-
username: string;
|
|
311
|
-
salutation: string | null;
|
|
312
|
-
firstName: string;
|
|
313
|
-
lastName: string | null;
|
|
314
|
-
contractType: "internal" | "external" | "subcontractor";
|
|
315
|
-
phone: string | null;
|
|
316
|
-
email: string | null;
|
|
317
|
-
};
|
|
318
|
-
session: {
|
|
319
|
-
id: string;
|
|
320
|
-
inetAddr: string | null;
|
|
321
|
-
userAgent: string | null;
|
|
322
|
-
createdAt: Date;
|
|
323
|
-
expiresAt: Date;
|
|
324
|
-
};
|
|
325
|
-
roles: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
|
|
326
|
-
};
|
|
327
|
-
meta: object;
|
|
328
|
-
}>;
|
|
329
|
-
setPassword: import("@trpc/server").TRPCMutationProcedure<{
|
|
330
|
-
input: {
|
|
331
|
-
username: string;
|
|
332
|
-
password: string;
|
|
333
|
-
};
|
|
334
|
-
output: {
|
|
335
|
-
success: true;
|
|
336
|
-
};
|
|
337
|
-
meta: object;
|
|
338
|
-
}>;
|
|
339
|
-
}>>, readonly [
|
|
340
|
-
() => void,
|
|
341
|
-
() => void,
|
|
342
|
-
() => void,
|
|
343
|
-
() => void
|
|
344
|
-
]>,
|
|
345
|
-
HandlerDefinition<"admin", import("@trpc/server").TRPCBuiltRouter<{
|
|
346
|
-
ctx: TrpcContext;
|
|
347
|
-
meta: object;
|
|
348
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
349
|
-
message: string;
|
|
350
|
-
data: {
|
|
351
|
-
httpCode: error.http.StatusCodeCode;
|
|
352
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
353
|
-
httpStatus: number;
|
|
354
|
-
path?: string;
|
|
355
|
-
stack?: string;
|
|
356
|
-
};
|
|
357
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
358
|
-
};
|
|
359
|
-
transformer: true;
|
|
360
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
361
|
-
login: import("@trpc/server").TRPCMutationProcedure<{
|
|
362
|
-
input: {
|
|
363
|
-
password: string;
|
|
364
|
-
tenant?: string | null | undefined;
|
|
365
|
-
};
|
|
366
|
-
output: {
|
|
367
|
-
token: string;
|
|
368
|
-
};
|
|
369
|
-
meta: object;
|
|
370
|
-
}>;
|
|
371
|
-
tenants: import("@trpc/server").TRPCBuiltRouter<{
|
|
372
|
-
ctx: TrpcContext;
|
|
373
|
-
meta: object;
|
|
374
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
375
|
-
message: string;
|
|
376
|
-
data: {
|
|
377
|
-
httpCode: error.http.StatusCodeCode;
|
|
378
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
379
|
-
httpStatus: number;
|
|
380
|
-
path?: string;
|
|
381
|
-
stack?: string;
|
|
382
|
-
};
|
|
383
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
384
|
-
};
|
|
385
|
-
transformer: true;
|
|
386
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
387
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
388
|
-
input: void;
|
|
389
|
-
output: {
|
|
390
|
-
name: string;
|
|
391
|
-
locked_at: Date | null;
|
|
392
|
-
deleted_at: Date | null;
|
|
393
|
-
deactivated_at: Date | null;
|
|
394
|
-
connection_details: {
|
|
395
|
-
postgresDSN?: string | null | undefined;
|
|
396
|
-
};
|
|
397
|
-
contact_details: {
|
|
398
|
-
email: string;
|
|
399
|
-
companyName?: string | null | undefined;
|
|
400
|
-
address?: {
|
|
401
|
-
city?: string | null | undefined;
|
|
402
|
-
zip?: string | null | undefined;
|
|
403
|
-
country?: string | null | undefined;
|
|
404
|
-
streetAddress?: string | null | undefined;
|
|
405
|
-
} | null | undefined;
|
|
406
|
-
};
|
|
407
|
-
options: {
|
|
408
|
-
sso: {
|
|
409
|
-
"ms-entra-id": {
|
|
410
|
-
enabled: boolean;
|
|
411
|
-
importUserUsername: boolean;
|
|
412
|
-
importUserName: boolean;
|
|
413
|
-
importUserEmail: boolean;
|
|
414
|
-
tenantId?: string | null | undefined;
|
|
415
|
-
clientId?: string | null | undefined;
|
|
416
|
-
objectId?: string | null | undefined;
|
|
417
|
-
};
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
}[];
|
|
421
|
-
meta: object;
|
|
422
|
-
}>;
|
|
423
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
424
|
-
input: {
|
|
425
|
-
name: string;
|
|
426
|
-
contact_details: {
|
|
427
|
-
email: string;
|
|
428
|
-
companyName?: string | null | undefined;
|
|
429
|
-
address?: {
|
|
430
|
-
city?: string | null | undefined;
|
|
431
|
-
zip?: string | null | undefined;
|
|
432
|
-
country?: string | null | undefined;
|
|
433
|
-
streetAddress?: string | null | undefined;
|
|
434
|
-
} | null | undefined;
|
|
435
|
-
};
|
|
436
|
-
options?: {
|
|
437
|
-
sso: {
|
|
438
|
-
"ms-entra-id": {
|
|
439
|
-
enabled: boolean;
|
|
440
|
-
importUserUsername: boolean;
|
|
441
|
-
importUserName: boolean;
|
|
442
|
-
importUserEmail: boolean;
|
|
443
|
-
tenantId?: string | null | undefined;
|
|
444
|
-
clientId?: string | null | undefined;
|
|
445
|
-
objectId?: string | null | undefined;
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
} | undefined;
|
|
449
|
-
connection_details?: {
|
|
450
|
-
postgresDSN?: string | null | undefined;
|
|
451
|
-
} | undefined;
|
|
452
|
-
};
|
|
453
|
-
output: {
|
|
454
|
-
adminPassword: string;
|
|
455
|
-
};
|
|
456
|
-
meta: object;
|
|
457
|
-
}>;
|
|
458
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
459
|
-
input: {
|
|
460
|
-
name: string;
|
|
461
|
-
};
|
|
462
|
-
output: {
|
|
463
|
-
name: string;
|
|
464
|
-
locked_at: Date | null;
|
|
465
|
-
deleted_at: Date | null;
|
|
466
|
-
deactivated_at: Date | null;
|
|
467
|
-
connection_details: {
|
|
468
|
-
postgresDSN?: string | null | undefined;
|
|
469
|
-
};
|
|
470
|
-
contact_details: {
|
|
471
|
-
email: string;
|
|
472
|
-
companyName?: string | null | undefined;
|
|
473
|
-
address?: {
|
|
474
|
-
city?: string | null | undefined;
|
|
475
|
-
zip?: string | null | undefined;
|
|
476
|
-
country?: string | null | undefined;
|
|
477
|
-
streetAddress?: string | null | undefined;
|
|
478
|
-
} | null | undefined;
|
|
479
|
-
};
|
|
480
|
-
options: {
|
|
481
|
-
sso: {
|
|
482
|
-
"ms-entra-id": {
|
|
483
|
-
enabled: boolean;
|
|
484
|
-
importUserUsername: boolean;
|
|
485
|
-
importUserName: boolean;
|
|
486
|
-
importUserEmail: boolean;
|
|
487
|
-
tenantId?: string | null | undefined;
|
|
488
|
-
clientId?: string | null | undefined;
|
|
489
|
-
objectId?: string | null | undefined;
|
|
490
|
-
};
|
|
491
|
-
};
|
|
492
|
-
};
|
|
493
|
-
};
|
|
494
|
-
meta: object;
|
|
495
|
-
}>;
|
|
496
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
497
|
-
input: {
|
|
498
|
-
name: string;
|
|
499
|
-
data: {
|
|
500
|
-
contact_details?: {
|
|
501
|
-
email: string;
|
|
502
|
-
companyName?: string | null | undefined;
|
|
503
|
-
address?: {
|
|
504
|
-
city?: string | null | undefined;
|
|
505
|
-
zip?: string | null | undefined;
|
|
506
|
-
country?: string | null | undefined;
|
|
507
|
-
streetAddress?: string | null | undefined;
|
|
508
|
-
} | null | undefined;
|
|
509
|
-
} | undefined;
|
|
510
|
-
connection_details?: {
|
|
511
|
-
postgresDSN?: string | null | undefined;
|
|
512
|
-
} | undefined;
|
|
513
|
-
options?: {
|
|
514
|
-
sso: {
|
|
515
|
-
"ms-entra-id": {
|
|
516
|
-
enabled: boolean;
|
|
517
|
-
importUserUsername: boolean;
|
|
518
|
-
importUserName: boolean;
|
|
519
|
-
importUserEmail: boolean;
|
|
520
|
-
tenantId?: string | null | undefined;
|
|
521
|
-
clientId?: string | null | undefined;
|
|
522
|
-
objectId?: string | null | undefined;
|
|
523
|
-
};
|
|
524
|
-
};
|
|
525
|
-
} | undefined;
|
|
526
|
-
};
|
|
527
|
-
};
|
|
528
|
-
output: {
|
|
529
|
-
success: true;
|
|
530
|
-
};
|
|
531
|
-
meta: object;
|
|
532
|
-
}>;
|
|
533
|
-
activate: import("@trpc/server").TRPCMutationProcedure<{
|
|
534
|
-
input: {
|
|
535
|
-
name: string;
|
|
536
|
-
};
|
|
537
|
-
output: {
|
|
538
|
-
success: true;
|
|
539
|
-
};
|
|
540
|
-
meta: object;
|
|
541
|
-
}>;
|
|
542
|
-
deactivate: import("@trpc/server").TRPCMutationProcedure<{
|
|
543
|
-
input: {
|
|
544
|
-
name: string;
|
|
545
|
-
};
|
|
546
|
-
output: {
|
|
547
|
-
success: true;
|
|
548
|
-
};
|
|
549
|
-
meta: object;
|
|
550
|
-
}>;
|
|
551
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
552
|
-
input: {
|
|
553
|
-
name: string;
|
|
554
|
-
};
|
|
555
|
-
output: {
|
|
556
|
-
success: true;
|
|
557
|
-
};
|
|
558
|
-
meta: object;
|
|
559
|
-
}>;
|
|
560
|
-
deleteForever: import("@trpc/server").TRPCMutationProcedure<{
|
|
561
|
-
input: {
|
|
562
|
-
name: string;
|
|
563
|
-
};
|
|
564
|
-
output: {
|
|
565
|
-
success: true;
|
|
566
|
-
};
|
|
567
|
-
meta: object;
|
|
568
|
-
}>;
|
|
569
|
-
lock: import("@trpc/server").TRPCMutationProcedure<{
|
|
570
|
-
input: {
|
|
571
|
-
name: string;
|
|
572
|
-
};
|
|
573
|
-
output: {
|
|
574
|
-
success: true;
|
|
575
|
-
};
|
|
576
|
-
meta: object;
|
|
577
|
-
}>;
|
|
578
|
-
unlock: import("@trpc/server").TRPCMutationProcedure<{
|
|
579
|
-
input: {
|
|
580
|
-
name: string;
|
|
581
|
-
};
|
|
582
|
-
output: {
|
|
583
|
-
success: true;
|
|
584
|
-
};
|
|
585
|
-
meta: object;
|
|
586
|
-
}>;
|
|
587
|
-
undelete: import("@trpc/server").TRPCMutationProcedure<{
|
|
588
|
-
input: {
|
|
589
|
-
name: string;
|
|
590
|
-
};
|
|
591
|
-
output: {
|
|
592
|
-
success: true;
|
|
593
|
-
};
|
|
594
|
-
meta: object;
|
|
595
|
-
}>;
|
|
596
|
-
}>>;
|
|
597
|
-
}>>, readonly [
|
|
598
|
-
() => void,
|
|
599
|
-
() => void,
|
|
600
|
-
() => void,
|
|
601
|
-
() => void,
|
|
602
|
-
() => void,
|
|
603
|
-
() => void,
|
|
604
|
-
() => void,
|
|
605
|
-
() => void,
|
|
606
|
-
() => void,
|
|
607
|
-
() => void,
|
|
608
|
-
() => void,
|
|
609
|
-
() => void
|
|
610
|
-
]>,
|
|
611
|
-
HandlerDefinition<"customers", import("@trpc/server").TRPCBuiltRouter<{
|
|
612
|
-
ctx: TrpcContext;
|
|
613
|
-
meta: object;
|
|
614
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
615
|
-
message: string;
|
|
616
|
-
data: {
|
|
617
|
-
httpCode: error.http.StatusCodeCode;
|
|
618
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
619
|
-
httpStatus: number;
|
|
620
|
-
path?: string;
|
|
621
|
-
stack?: string;
|
|
622
|
-
};
|
|
623
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
624
|
-
};
|
|
625
|
-
transformer: true;
|
|
626
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
627
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
628
|
-
input: {
|
|
629
|
-
search?: string | null | undefined;
|
|
630
|
-
};
|
|
631
|
-
output: {
|
|
632
|
-
id: string;
|
|
633
|
-
salutation: string | null;
|
|
634
|
-
name: string;
|
|
635
|
-
address: {
|
|
636
|
-
city: string;
|
|
637
|
-
streetAddress: string;
|
|
638
|
-
country?: string | null | undefined;
|
|
639
|
-
zip?: string | null | undefined;
|
|
640
|
-
} | null;
|
|
641
|
-
createdAt: Date;
|
|
642
|
-
modifiedAt: Date;
|
|
643
|
-
}[];
|
|
644
|
-
meta: object;
|
|
645
|
-
}>;
|
|
646
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
647
|
-
input: {
|
|
648
|
-
id: string;
|
|
649
|
-
};
|
|
650
|
-
output: {
|
|
651
|
-
id: string;
|
|
652
|
-
salutation: string | null;
|
|
653
|
-
name: string;
|
|
654
|
-
address: {
|
|
655
|
-
city: string;
|
|
656
|
-
streetAddress: string;
|
|
657
|
-
country?: string | null | undefined;
|
|
658
|
-
zip?: string | null | undefined;
|
|
659
|
-
} | null;
|
|
660
|
-
createdAt: Date;
|
|
661
|
-
modifiedAt: Date;
|
|
662
|
-
};
|
|
663
|
-
meta: object;
|
|
664
|
-
}>;
|
|
665
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
666
|
-
input: {
|
|
667
|
-
name: string;
|
|
668
|
-
salutation?: string | null | undefined;
|
|
669
|
-
address?: {
|
|
670
|
-
city: string;
|
|
671
|
-
streetAddress: string;
|
|
672
|
-
country?: string | null | undefined;
|
|
673
|
-
zip?: string | null | undefined;
|
|
674
|
-
} | null | undefined;
|
|
675
|
-
};
|
|
676
|
-
output: {
|
|
677
|
-
id: string;
|
|
678
|
-
};
|
|
679
|
-
meta: object;
|
|
680
|
-
}>;
|
|
681
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
682
|
-
input: {
|
|
683
|
-
id: string;
|
|
684
|
-
data: {
|
|
685
|
-
salutation?: string | null | undefined;
|
|
686
|
-
name?: string | undefined;
|
|
687
|
-
address?: {
|
|
688
|
-
city: string;
|
|
689
|
-
streetAddress: string;
|
|
690
|
-
country?: string | null | undefined;
|
|
691
|
-
zip?: string | null | undefined;
|
|
692
|
-
} | null | undefined;
|
|
693
|
-
};
|
|
694
|
-
};
|
|
695
|
-
output: {
|
|
696
|
-
success: true;
|
|
697
|
-
};
|
|
698
|
-
meta: object;
|
|
699
|
-
}>;
|
|
700
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
701
|
-
input: {
|
|
702
|
-
id: string;
|
|
703
|
-
};
|
|
704
|
-
output: {
|
|
705
|
-
success: true;
|
|
706
|
-
};
|
|
707
|
-
meta: object;
|
|
708
|
-
}>;
|
|
709
|
-
}>>, readonly [
|
|
710
|
-
() => void,
|
|
711
|
-
() => void,
|
|
712
|
-
() => void,
|
|
713
|
-
() => void,
|
|
714
|
-
() => void
|
|
715
|
-
]>,
|
|
716
|
-
HandlerDefinition<"projects", import("@trpc/server").TRPCBuiltRouter<{
|
|
717
|
-
ctx: TrpcContext;
|
|
718
|
-
meta: object;
|
|
719
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
720
|
-
message: string;
|
|
721
|
-
data: {
|
|
722
|
-
httpCode: error.http.StatusCodeCode;
|
|
723
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
724
|
-
httpStatus: number;
|
|
725
|
-
path?: string;
|
|
726
|
-
stack?: string;
|
|
727
|
-
};
|
|
728
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
729
|
-
};
|
|
730
|
-
transformer: true;
|
|
731
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
732
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
733
|
-
input: {
|
|
734
|
-
search?: string | null | undefined;
|
|
735
|
-
finished?: boolean | null | undefined;
|
|
736
|
-
};
|
|
737
|
-
output: {
|
|
738
|
-
id: string;
|
|
739
|
-
title: string;
|
|
740
|
-
address: {
|
|
741
|
-
city: string;
|
|
742
|
-
streetAddress: string;
|
|
743
|
-
country?: string | null | undefined;
|
|
744
|
-
zip?: string | null | undefined;
|
|
745
|
-
} | null;
|
|
746
|
-
customerId: string | null;
|
|
747
|
-
createdAt: Date;
|
|
748
|
-
modifiedAt: Date;
|
|
749
|
-
finishedAt: Date | null;
|
|
750
|
-
}[];
|
|
751
|
-
meta: object;
|
|
752
|
-
}>;
|
|
753
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
754
|
-
input: {
|
|
755
|
-
id: string;
|
|
756
|
-
};
|
|
757
|
-
output: {
|
|
758
|
-
id: string;
|
|
759
|
-
title: string;
|
|
760
|
-
address: {
|
|
761
|
-
city: string;
|
|
762
|
-
streetAddress: string;
|
|
763
|
-
country?: string | null | undefined;
|
|
764
|
-
zip?: string | null | undefined;
|
|
765
|
-
} | null;
|
|
766
|
-
customerId: string | null;
|
|
767
|
-
createdAt: Date;
|
|
768
|
-
modifiedAt: Date;
|
|
769
|
-
finishedAt: Date | null;
|
|
770
|
-
};
|
|
771
|
-
meta: object;
|
|
772
|
-
}>;
|
|
773
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
774
|
-
input: {
|
|
775
|
-
title: string;
|
|
776
|
-
address?: {
|
|
777
|
-
city: string;
|
|
778
|
-
streetAddress: string;
|
|
779
|
-
country?: string | null | undefined;
|
|
780
|
-
zip?: string | null | undefined;
|
|
781
|
-
} | null | undefined;
|
|
782
|
-
customerId?: string | null | undefined;
|
|
783
|
-
};
|
|
784
|
-
output: {
|
|
785
|
-
id: string;
|
|
786
|
-
};
|
|
787
|
-
meta: object;
|
|
788
|
-
}>;
|
|
789
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
790
|
-
input: {
|
|
791
|
-
id: string;
|
|
792
|
-
data: {
|
|
793
|
-
title?: string | undefined;
|
|
794
|
-
address?: {
|
|
795
|
-
city: string;
|
|
796
|
-
streetAddress: string;
|
|
797
|
-
country?: string | null | undefined;
|
|
798
|
-
zip?: string | null | undefined;
|
|
799
|
-
} | null | undefined;
|
|
800
|
-
customerId?: string | null | undefined;
|
|
801
|
-
};
|
|
802
|
-
};
|
|
803
|
-
output: {
|
|
804
|
-
success: true;
|
|
805
|
-
};
|
|
806
|
-
meta: object;
|
|
807
|
-
}>;
|
|
808
|
-
finish: import("@trpc/server").TRPCMutationProcedure<{
|
|
809
|
-
input: {
|
|
810
|
-
id: string;
|
|
811
|
-
};
|
|
812
|
-
output: {
|
|
813
|
-
success: true;
|
|
814
|
-
};
|
|
815
|
-
meta: object;
|
|
816
|
-
}>;
|
|
817
|
-
resume: import("@trpc/server").TRPCMutationProcedure<{
|
|
818
|
-
input: {
|
|
819
|
-
id: string;
|
|
820
|
-
};
|
|
821
|
-
output: {
|
|
822
|
-
success: true;
|
|
823
|
-
};
|
|
824
|
-
meta: object;
|
|
825
|
-
}>;
|
|
826
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
827
|
-
input: {
|
|
828
|
-
id: string;
|
|
829
|
-
};
|
|
830
|
-
output: {
|
|
831
|
-
success: true;
|
|
832
|
-
};
|
|
833
|
-
meta: object;
|
|
834
|
-
}>;
|
|
835
|
-
deployments: import("@trpc/server").TRPCBuiltRouter<{
|
|
836
|
-
ctx: TrpcContext;
|
|
837
|
-
meta: object;
|
|
838
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
839
|
-
message: string;
|
|
840
|
-
data: {
|
|
841
|
-
httpCode: error.http.StatusCodeCode;
|
|
842
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
843
|
-
httpStatus: number;
|
|
844
|
-
path?: string;
|
|
845
|
-
stack?: string;
|
|
846
|
-
};
|
|
847
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
848
|
-
};
|
|
849
|
-
transformer: true;
|
|
850
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
851
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
852
|
-
input: {
|
|
853
|
-
projectId?: string | null | undefined;
|
|
854
|
-
userId?: string | null | undefined;
|
|
855
|
-
active?: boolean | null | undefined;
|
|
856
|
-
fromAfter?: unknown;
|
|
857
|
-
fromBefore?: unknown;
|
|
858
|
-
toAfter?: unknown;
|
|
859
|
-
toBefore?: unknown;
|
|
860
|
-
limit?: number | undefined;
|
|
861
|
-
offset?: number | undefined;
|
|
862
|
-
};
|
|
863
|
-
output: {
|
|
864
|
-
id: string;
|
|
865
|
-
projectId: string;
|
|
866
|
-
userId: string;
|
|
867
|
-
from: Date;
|
|
868
|
-
to: Date;
|
|
869
|
-
note: string | null;
|
|
870
|
-
createdAt: Date;
|
|
871
|
-
}[];
|
|
872
|
-
meta: object;
|
|
873
|
-
}>;
|
|
874
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
875
|
-
input: {
|
|
876
|
-
projectId: string;
|
|
877
|
-
userId: string;
|
|
878
|
-
from: unknown;
|
|
879
|
-
to: unknown;
|
|
880
|
-
note?: string | null | undefined;
|
|
881
|
-
};
|
|
882
|
-
output: {
|
|
883
|
-
id: string;
|
|
884
|
-
};
|
|
885
|
-
meta: object;
|
|
886
|
-
}>;
|
|
887
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
888
|
-
input: {
|
|
889
|
-
id: string;
|
|
890
|
-
data: {
|
|
891
|
-
projectId?: string | null | undefined;
|
|
892
|
-
userId?: string | null | undefined;
|
|
893
|
-
from?: unknown;
|
|
894
|
-
to?: unknown;
|
|
895
|
-
note?: string | null | undefined;
|
|
896
|
-
};
|
|
897
|
-
};
|
|
898
|
-
output: {
|
|
899
|
-
success: true;
|
|
900
|
-
};
|
|
901
|
-
meta: object;
|
|
902
|
-
}>;
|
|
903
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
904
|
-
input: {
|
|
905
|
-
id: string;
|
|
906
|
-
};
|
|
907
|
-
output: {
|
|
908
|
-
success: true;
|
|
909
|
-
};
|
|
910
|
-
meta: object;
|
|
911
|
-
}>;
|
|
912
|
-
}>>;
|
|
913
|
-
}>>, readonly [
|
|
914
|
-
() => void,
|
|
915
|
-
() => void,
|
|
916
|
-
() => void,
|
|
917
|
-
() => void,
|
|
918
|
-
() => void,
|
|
919
|
-
() => void,
|
|
920
|
-
() => void,
|
|
921
|
-
() => void,
|
|
922
|
-
() => void,
|
|
923
|
-
() => void,
|
|
924
|
-
() => void
|
|
925
|
-
]>,
|
|
926
|
-
HandlerDefinition<"products", import("@trpc/server").TRPCBuiltRouter<{
|
|
927
|
-
ctx: TrpcContext;
|
|
928
|
-
meta: object;
|
|
929
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
930
|
-
message: string;
|
|
931
|
-
data: {
|
|
932
|
-
httpCode: error.http.StatusCodeCode;
|
|
933
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
934
|
-
httpStatus: number;
|
|
935
|
-
path?: string;
|
|
936
|
-
stack?: string;
|
|
937
|
-
};
|
|
938
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
939
|
-
};
|
|
940
|
-
transformer: true;
|
|
941
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
942
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
943
|
-
input: {
|
|
944
|
-
category?: string | null | undefined;
|
|
945
|
-
search?: string | null | undefined;
|
|
946
|
-
};
|
|
947
|
-
output: {
|
|
948
|
-
id: string;
|
|
949
|
-
customId: number;
|
|
950
|
-
name: string;
|
|
951
|
-
description: string | null;
|
|
952
|
-
brand: string | null;
|
|
953
|
-
baseUnit: string;
|
|
954
|
-
otherUnits: Record<string, number>;
|
|
955
|
-
categories: string[];
|
|
956
|
-
}[];
|
|
957
|
-
meta: object;
|
|
958
|
-
}>;
|
|
959
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
960
|
-
input: {
|
|
961
|
-
id: string;
|
|
962
|
-
};
|
|
963
|
-
output: {
|
|
964
|
-
id: string;
|
|
965
|
-
customId: number;
|
|
966
|
-
name: string;
|
|
967
|
-
description: string | null;
|
|
968
|
-
brand: string | null;
|
|
969
|
-
baseUnit: string;
|
|
970
|
-
otherUnits: Record<string, number>;
|
|
971
|
-
categories: string[];
|
|
972
|
-
};
|
|
973
|
-
meta: object;
|
|
974
|
-
}>;
|
|
975
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
976
|
-
input: {
|
|
977
|
-
customId: number;
|
|
978
|
-
name: string;
|
|
979
|
-
baseUnit: string;
|
|
980
|
-
brand?: string | null | undefined;
|
|
981
|
-
description?: string | null | undefined;
|
|
982
|
-
otherUnits?: Record<string, number> | undefined;
|
|
983
|
-
};
|
|
984
|
-
output: {
|
|
985
|
-
id: string;
|
|
986
|
-
};
|
|
987
|
-
meta: object;
|
|
988
|
-
}>;
|
|
989
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
990
|
-
input: {
|
|
991
|
-
id: string;
|
|
992
|
-
data: {
|
|
993
|
-
customId?: number | undefined;
|
|
994
|
-
name?: string | undefined;
|
|
995
|
-
brand?: string | null | undefined;
|
|
996
|
-
description?: string | null | undefined;
|
|
997
|
-
baseUnit?: string | undefined;
|
|
998
|
-
otherUnits?: Record<string, number> | undefined;
|
|
999
|
-
};
|
|
1000
|
-
};
|
|
1001
|
-
output: {
|
|
1002
|
-
success: true;
|
|
1003
|
-
};
|
|
1004
|
-
meta: object;
|
|
1005
|
-
}>;
|
|
1006
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1007
|
-
input: {
|
|
1008
|
-
id: string;
|
|
1009
|
-
};
|
|
1010
|
-
output: {
|
|
1011
|
-
success: true;
|
|
1012
|
-
};
|
|
1013
|
-
meta: object;
|
|
1014
|
-
}>;
|
|
1015
|
-
categories: import("@trpc/server").TRPCBuiltRouter<{
|
|
1016
|
-
ctx: TrpcContext;
|
|
1017
|
-
meta: object;
|
|
1018
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1019
|
-
message: string;
|
|
1020
|
-
data: {
|
|
1021
|
-
httpCode: error.http.StatusCodeCode;
|
|
1022
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1023
|
-
httpStatus: number;
|
|
1024
|
-
path?: string;
|
|
1025
|
-
stack?: string;
|
|
1026
|
-
};
|
|
1027
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1028
|
-
};
|
|
1029
|
-
transformer: true;
|
|
1030
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1031
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1032
|
-
input: void;
|
|
1033
|
-
output: string[];
|
|
1034
|
-
meta: object;
|
|
1035
|
-
}>;
|
|
1036
|
-
tag: import("@trpc/server").TRPCMutationProcedure<{
|
|
1037
|
-
input: {
|
|
1038
|
-
id: string;
|
|
1039
|
-
category: string;
|
|
1040
|
-
};
|
|
1041
|
-
output: {
|
|
1042
|
-
success: true;
|
|
1043
|
-
};
|
|
1044
|
-
meta: object;
|
|
1045
|
-
}>;
|
|
1046
|
-
untag: import("@trpc/server").TRPCMutationProcedure<{
|
|
1047
|
-
input: {
|
|
1048
|
-
id: string;
|
|
1049
|
-
category: string;
|
|
1050
|
-
};
|
|
1051
|
-
output: {
|
|
1052
|
-
success: true;
|
|
1053
|
-
};
|
|
1054
|
-
meta: object;
|
|
1055
|
-
}>;
|
|
1056
|
-
}>>;
|
|
1057
|
-
units: import("@trpc/server").TRPCBuiltRouter<{
|
|
1058
|
-
ctx: TrpcContext;
|
|
1059
|
-
meta: object;
|
|
1060
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1061
|
-
message: string;
|
|
1062
|
-
data: {
|
|
1063
|
-
httpCode: error.http.StatusCodeCode;
|
|
1064
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1065
|
-
httpStatus: number;
|
|
1066
|
-
path?: string;
|
|
1067
|
-
stack?: string;
|
|
1068
|
-
};
|
|
1069
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1070
|
-
};
|
|
1071
|
-
transformer: true;
|
|
1072
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1073
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1074
|
-
input: void;
|
|
1075
|
-
output: string[];
|
|
1076
|
-
meta: object;
|
|
1077
|
-
}>;
|
|
1078
|
-
}>>;
|
|
1079
|
-
vendors: import("@trpc/server").TRPCBuiltRouter<{
|
|
1080
|
-
ctx: TrpcContext;
|
|
1081
|
-
meta: object;
|
|
1082
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1083
|
-
message: string;
|
|
1084
|
-
data: {
|
|
1085
|
-
httpCode: error.http.StatusCodeCode;
|
|
1086
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1087
|
-
httpStatus: number;
|
|
1088
|
-
path?: string;
|
|
1089
|
-
stack?: string;
|
|
1090
|
-
};
|
|
1091
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1092
|
-
};
|
|
1093
|
-
transformer: true;
|
|
1094
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1095
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1096
|
-
input: {
|
|
1097
|
-
search?: string | null | undefined;
|
|
1098
|
-
};
|
|
1099
|
-
output: {
|
|
1100
|
-
id: string;
|
|
1101
|
-
name: string;
|
|
1102
|
-
description: string | null;
|
|
1103
|
-
createdAt: Date;
|
|
1104
|
-
modifiedAt: Date;
|
|
1105
|
-
}[];
|
|
1106
|
-
meta: object;
|
|
1107
|
-
}>;
|
|
1108
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
1109
|
-
input: {
|
|
1110
|
-
id: string;
|
|
1111
|
-
};
|
|
1112
|
-
output: {
|
|
1113
|
-
id: string;
|
|
1114
|
-
name: string;
|
|
1115
|
-
description: string | null;
|
|
1116
|
-
createdAt: Date;
|
|
1117
|
-
modifiedAt: Date;
|
|
1118
|
-
};
|
|
1119
|
-
meta: object;
|
|
1120
|
-
}>;
|
|
1121
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1122
|
-
input: {
|
|
1123
|
-
name: string;
|
|
1124
|
-
description?: string | null | undefined;
|
|
1125
|
-
};
|
|
1126
|
-
output: {
|
|
1127
|
-
id: string;
|
|
1128
|
-
};
|
|
1129
|
-
meta: object;
|
|
1130
|
-
}>;
|
|
1131
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
1132
|
-
input: {
|
|
1133
|
-
id: string;
|
|
1134
|
-
data: {
|
|
1135
|
-
name?: string | undefined;
|
|
1136
|
-
description?: string | null | undefined;
|
|
1137
|
-
};
|
|
1138
|
-
};
|
|
1139
|
-
output: {
|
|
1140
|
-
success: true;
|
|
1141
|
-
};
|
|
1142
|
-
meta: object;
|
|
1143
|
-
}>;
|
|
1144
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1145
|
-
input: {
|
|
1146
|
-
id: string;
|
|
1147
|
-
};
|
|
1148
|
-
output: {
|
|
1149
|
-
success: true;
|
|
1150
|
-
};
|
|
1151
|
-
meta: object;
|
|
1152
|
-
}>;
|
|
1153
|
-
}>>;
|
|
1154
|
-
priceRecords: import("@trpc/server").TRPCBuiltRouter<{
|
|
1155
|
-
ctx: TrpcContext;
|
|
1156
|
-
meta: object;
|
|
1157
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1158
|
-
message: string;
|
|
1159
|
-
data: {
|
|
1160
|
-
httpCode: error.http.StatusCodeCode;
|
|
1161
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1162
|
-
httpStatus: number;
|
|
1163
|
-
path?: string;
|
|
1164
|
-
stack?: string;
|
|
1165
|
-
};
|
|
1166
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1167
|
-
};
|
|
1168
|
-
transformer: true;
|
|
1169
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1170
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1171
|
-
input: {
|
|
1172
|
-
productId?: string | null | undefined;
|
|
1173
|
-
vendorId?: string | null | undefined;
|
|
1174
|
-
isRealPurchase?: boolean | null | undefined;
|
|
1175
|
-
};
|
|
1176
|
-
output: {
|
|
1177
|
-
id: string;
|
|
1178
|
-
productId: string;
|
|
1179
|
-
vendorId: string | null;
|
|
1180
|
-
timestamp: Date;
|
|
1181
|
-
price: number;
|
|
1182
|
-
isRealPurchase: boolean;
|
|
1183
|
-
comment: string | null;
|
|
1184
|
-
}[];
|
|
1185
|
-
meta: object;
|
|
1186
|
-
}>;
|
|
1187
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1188
|
-
input: {
|
|
1189
|
-
productId: string;
|
|
1190
|
-
price: number;
|
|
1191
|
-
isRealPurchase: boolean;
|
|
1192
|
-
vendorId?: string | null | undefined;
|
|
1193
|
-
comment?: string | null | undefined;
|
|
1194
|
-
};
|
|
1195
|
-
output: {
|
|
1196
|
-
id: string;
|
|
1197
|
-
};
|
|
1198
|
-
meta: object;
|
|
1199
|
-
}>;
|
|
1200
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
1201
|
-
input: {
|
|
1202
|
-
id: string;
|
|
1203
|
-
data: {
|
|
1204
|
-
productId?: string | undefined;
|
|
1205
|
-
vendorId?: string | null | undefined;
|
|
1206
|
-
price?: number | undefined;
|
|
1207
|
-
isRealPurchase?: boolean | undefined;
|
|
1208
|
-
comment?: string | null | undefined;
|
|
1209
|
-
};
|
|
1210
|
-
};
|
|
1211
|
-
output: {
|
|
1212
|
-
success: true;
|
|
1213
|
-
};
|
|
1214
|
-
meta: object;
|
|
1215
|
-
}>;
|
|
1216
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1217
|
-
input: {
|
|
1218
|
-
id: string;
|
|
1219
|
-
};
|
|
1220
|
-
output: {
|
|
1221
|
-
success: true;
|
|
1222
|
-
};
|
|
1223
|
-
meta: object;
|
|
1224
|
-
}>;
|
|
1225
|
-
}>>;
|
|
1226
|
-
deliveryNotes: import("@trpc/server").TRPCBuiltRouter<{
|
|
1227
|
-
ctx: TrpcContext;
|
|
1228
|
-
meta: object;
|
|
1229
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1230
|
-
message: string;
|
|
1231
|
-
data: {
|
|
1232
|
-
httpCode: error.http.StatusCodeCode;
|
|
1233
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1234
|
-
httpStatus: number;
|
|
1235
|
-
path?: string;
|
|
1236
|
-
stack?: string;
|
|
1237
|
-
};
|
|
1238
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1239
|
-
};
|
|
1240
|
-
transformer: true;
|
|
1241
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1242
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1243
|
-
input: {
|
|
1244
|
-
projectId?: string | null | undefined;
|
|
1245
|
-
createdByUserId?: string | null | undefined;
|
|
1246
|
-
};
|
|
1247
|
-
output: {
|
|
1248
|
-
id: string;
|
|
1249
|
-
projectId: string;
|
|
1250
|
-
comment: string | null;
|
|
1251
|
-
createdByUserId: string | null;
|
|
1252
|
-
records: {
|
|
1253
|
-
id: string;
|
|
1254
|
-
noteId: string;
|
|
1255
|
-
productId: string;
|
|
1256
|
-
quantity: number;
|
|
1257
|
-
comment: string | null;
|
|
1258
|
-
}[];
|
|
1259
|
-
}[];
|
|
1260
|
-
meta: object;
|
|
1261
|
-
}>;
|
|
1262
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1263
|
-
input: {
|
|
1264
|
-
projectId: string;
|
|
1265
|
-
records: {
|
|
1266
|
-
productId: string;
|
|
1267
|
-
quantity: number;
|
|
1268
|
-
comment?: string | null | undefined;
|
|
1269
|
-
}[];
|
|
1270
|
-
comment?: string | null | undefined;
|
|
1271
|
-
};
|
|
1272
|
-
output: {
|
|
1273
|
-
id: string;
|
|
1274
|
-
};
|
|
1275
|
-
meta: object;
|
|
1276
|
-
}>;
|
|
1277
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
1278
|
-
input: {
|
|
1279
|
-
id: string;
|
|
1280
|
-
};
|
|
1281
|
-
output: {
|
|
1282
|
-
id: string;
|
|
1283
|
-
projectId: string;
|
|
1284
|
-
comment: string | null;
|
|
1285
|
-
createdByUserId: string | null;
|
|
1286
|
-
records: {
|
|
1287
|
-
id: string;
|
|
1288
|
-
noteId: string;
|
|
1289
|
-
productId: string;
|
|
1290
|
-
quantity: number;
|
|
1291
|
-
comment: string | null;
|
|
1292
|
-
}[];
|
|
1293
|
-
};
|
|
1294
|
-
meta: object;
|
|
1295
|
-
}>;
|
|
1296
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1297
|
-
input: {
|
|
1298
|
-
id: string;
|
|
1299
|
-
};
|
|
1300
|
-
output: {
|
|
1301
|
-
success: true;
|
|
1302
|
-
};
|
|
1303
|
-
meta: object;
|
|
1304
|
-
}>;
|
|
1305
|
-
}>>;
|
|
1306
|
-
suggestNextCustomId: import("@trpc/server").TRPCQueryProcedure<{
|
|
1307
|
-
input: void;
|
|
1308
|
-
output: number;
|
|
1309
|
-
meta: object;
|
|
1310
|
-
}>;
|
|
1311
|
-
}>>, (() => void)[]>,
|
|
1312
|
-
HandlerDefinition<"users", import("@trpc/server").TRPCBuiltRouter<{
|
|
1313
|
-
ctx: TrpcContext;
|
|
1314
|
-
meta: object;
|
|
1315
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1316
|
-
message: string;
|
|
1317
|
-
data: {
|
|
1318
|
-
httpCode: error.http.StatusCodeCode;
|
|
1319
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1320
|
-
httpStatus: number;
|
|
1321
|
-
path?: string;
|
|
1322
|
-
stack?: string;
|
|
1323
|
-
};
|
|
1324
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1325
|
-
};
|
|
1326
|
-
transformer: true;
|
|
1327
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1328
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1329
|
-
input: {
|
|
1330
|
-
search?: string | null | undefined;
|
|
1331
|
-
deactivated?: boolean | undefined;
|
|
1332
|
-
};
|
|
1333
|
-
output: {
|
|
1334
|
-
id: string;
|
|
1335
|
-
salutation: string | null;
|
|
1336
|
-
firstName: string;
|
|
1337
|
-
lastName: string | null;
|
|
1338
|
-
username: string;
|
|
1339
|
-
email: string | null;
|
|
1340
|
-
phone: string | null;
|
|
1341
|
-
createdAt: Date;
|
|
1342
|
-
modifiedAt: Date;
|
|
1343
|
-
deactivatedAt: Date | null;
|
|
1344
|
-
}[];
|
|
1345
|
-
meta: object;
|
|
1346
|
-
}>;
|
|
1347
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
1348
|
-
input: {
|
|
1349
|
-
id: string;
|
|
1350
|
-
};
|
|
1351
|
-
output: {
|
|
1352
|
-
id: string;
|
|
1353
|
-
salutation: string | null;
|
|
1354
|
-
firstName: string;
|
|
1355
|
-
lastName: string | null;
|
|
1356
|
-
username: string;
|
|
1357
|
-
email: string | null;
|
|
1358
|
-
phone: string | null;
|
|
1359
|
-
createdAt: Date;
|
|
1360
|
-
modifiedAt: Date;
|
|
1361
|
-
deactivatedAt: Date | null;
|
|
1362
|
-
};
|
|
1363
|
-
meta: object;
|
|
1364
|
-
}>;
|
|
1365
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1366
|
-
input: {
|
|
1367
|
-
username: string;
|
|
1368
|
-
firstName: string;
|
|
1369
|
-
lastName?: string | null | undefined;
|
|
1370
|
-
email?: string | null | undefined;
|
|
1371
|
-
phone?: string | null | undefined;
|
|
1372
|
-
contractType?: "internal" | "external" | "subcontractor" | undefined;
|
|
1373
|
-
};
|
|
1374
|
-
output: {
|
|
1375
|
-
id: string;
|
|
1376
|
-
};
|
|
1377
|
-
meta: object;
|
|
1378
|
-
}>;
|
|
1379
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
1380
|
-
input: {
|
|
1381
|
-
id: string;
|
|
1382
|
-
data: {
|
|
1383
|
-
username?: string | undefined;
|
|
1384
|
-
firstName?: string | undefined;
|
|
1385
|
-
lastName?: string | null | undefined;
|
|
1386
|
-
email?: string | null | undefined;
|
|
1387
|
-
phone?: string | null | undefined;
|
|
1388
|
-
contractType?: "internal" | "external" | "subcontractor" | null | undefined;
|
|
1389
|
-
};
|
|
1390
|
-
};
|
|
1391
|
-
output: {
|
|
1392
|
-
success: true;
|
|
1393
|
-
};
|
|
1394
|
-
meta: object;
|
|
1395
|
-
}>;
|
|
1396
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1397
|
-
input: {
|
|
1398
|
-
id: string;
|
|
1399
|
-
};
|
|
1400
|
-
output: {
|
|
1401
|
-
success: true;
|
|
1402
|
-
};
|
|
1403
|
-
meta: object;
|
|
1404
|
-
}>;
|
|
1405
|
-
activate: import("@trpc/server").TRPCMutationProcedure<{
|
|
1406
|
-
input: {
|
|
1407
|
-
id: string;
|
|
1408
|
-
};
|
|
1409
|
-
output: {
|
|
1410
|
-
success: true;
|
|
1411
|
-
};
|
|
1412
|
-
meta: object;
|
|
1413
|
-
}>;
|
|
1414
|
-
deactivate: import("@trpc/server").TRPCMutationProcedure<{
|
|
1415
|
-
input: {
|
|
1416
|
-
id: string;
|
|
1417
|
-
};
|
|
1418
|
-
output: {
|
|
1419
|
-
success: true;
|
|
1420
|
-
};
|
|
1421
|
-
meta: object;
|
|
1422
|
-
}>;
|
|
1423
|
-
roles: import("@trpc/server").TRPCQueryProcedure<{
|
|
1424
|
-
input: void;
|
|
1425
|
-
output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
|
|
1426
|
-
meta: object;
|
|
1427
|
-
}>;
|
|
1428
|
-
setRoles: import("@trpc/server").TRPCMutationProcedure<{
|
|
1429
|
-
input: {
|
|
1430
|
-
userId: string;
|
|
1431
|
-
assignments: Record<":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers", boolean | null | undefined>;
|
|
1432
|
-
};
|
|
1433
|
-
output: {
|
|
1434
|
-
success: true;
|
|
1435
|
-
};
|
|
1436
|
-
meta: object;
|
|
1437
|
-
}>;
|
|
1438
|
-
}>>, (() => void)[]>,
|
|
1439
|
-
HandlerDefinition<"tools", import("@trpc/server").TRPCBuiltRouter<{
|
|
1440
|
-
ctx: TrpcContext;
|
|
1441
|
-
meta: object;
|
|
1442
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1443
|
-
message: string;
|
|
1444
|
-
data: {
|
|
1445
|
-
httpCode: error.http.StatusCodeCode;
|
|
1446
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1447
|
-
httpStatus: number;
|
|
1448
|
-
path?: string;
|
|
1449
|
-
stack?: string;
|
|
1450
|
-
};
|
|
1451
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1452
|
-
};
|
|
1453
|
-
transformer: true;
|
|
1454
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1455
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1456
|
-
input: {
|
|
1457
|
-
search?: string | null | undefined;
|
|
1458
|
-
status?: "lost" | "broken" | "available" | "unavailable" | null | undefined;
|
|
1459
|
-
brand?: string | null | undefined;
|
|
1460
|
-
category?: string | null | undefined;
|
|
1461
|
-
};
|
|
1462
|
-
output: {
|
|
1463
|
-
id: string;
|
|
1464
|
-
customId: number;
|
|
1465
|
-
brand: string;
|
|
1466
|
-
category: string;
|
|
1467
|
-
label: string | null;
|
|
1468
|
-
status: "lost" | "broken" | null;
|
|
1469
|
-
available: boolean;
|
|
1470
|
-
createdAt: Date;
|
|
1471
|
-
modifiedAt: Date;
|
|
1472
|
-
archivedSince: Date | null;
|
|
1473
|
-
}[];
|
|
1474
|
-
meta: object;
|
|
1475
|
-
}>;
|
|
1476
|
-
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
1477
|
-
input: {
|
|
1478
|
-
id: string;
|
|
1479
|
-
};
|
|
1480
|
-
output: {
|
|
1481
|
-
id: string;
|
|
1482
|
-
customId: number;
|
|
1483
|
-
brand: string;
|
|
1484
|
-
category: string;
|
|
1485
|
-
label: string | null;
|
|
1486
|
-
status: "lost" | "broken" | null;
|
|
1487
|
-
available: boolean;
|
|
1488
|
-
createdAt: Date;
|
|
1489
|
-
modifiedAt: Date;
|
|
1490
|
-
archivedSince: Date | null;
|
|
1491
|
-
};
|
|
1492
|
-
meta: object;
|
|
1493
|
-
}>;
|
|
1494
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1495
|
-
input: {
|
|
1496
|
-
customId: number;
|
|
1497
|
-
brand: string;
|
|
1498
|
-
category: string;
|
|
1499
|
-
label: string | null;
|
|
1500
|
-
status: "lost" | "broken" | null;
|
|
1501
|
-
};
|
|
1502
|
-
output: {
|
|
1503
|
-
id: string;
|
|
1504
|
-
};
|
|
1505
|
-
meta: object;
|
|
1506
|
-
}>;
|
|
1507
|
-
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
1508
|
-
input: {
|
|
1509
|
-
id: string;
|
|
1510
|
-
data: {
|
|
1511
|
-
brand?: string | null | undefined;
|
|
1512
|
-
category?: string | null | undefined;
|
|
1513
|
-
label?: string | null | undefined;
|
|
1514
|
-
};
|
|
1515
|
-
};
|
|
1516
|
-
output: {
|
|
1517
|
-
success: true;
|
|
1518
|
-
};
|
|
1519
|
-
meta: object;
|
|
1520
|
-
}>;
|
|
1521
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1522
|
-
input: {
|
|
1523
|
-
id: string;
|
|
1524
|
-
};
|
|
1525
|
-
output: {
|
|
1526
|
-
success: true;
|
|
1527
|
-
};
|
|
1528
|
-
meta: object;
|
|
1529
|
-
}>;
|
|
1530
|
-
track: import("@trpc/server").TRPCMutationProcedure<{
|
|
1531
|
-
input: {
|
|
1532
|
-
id: string;
|
|
1533
|
-
data: {
|
|
1534
|
-
projectId?: string | null | undefined;
|
|
1535
|
-
responsibleUserId?: string | null | undefined;
|
|
1536
|
-
deadlineAt?: unknown;
|
|
1537
|
-
comment?: string | null | undefined;
|
|
1538
|
-
};
|
|
1539
|
-
};
|
|
1540
|
-
output: {
|
|
1541
|
-
trackingId: string;
|
|
1542
|
-
};
|
|
1543
|
-
meta: object;
|
|
1544
|
-
}>;
|
|
1545
|
-
untrack: import("@trpc/server").TRPCMutationProcedure<{
|
|
1546
|
-
input: {
|
|
1547
|
-
id: string;
|
|
1548
|
-
};
|
|
1549
|
-
output: {
|
|
1550
|
-
success: true;
|
|
1551
|
-
};
|
|
1552
|
-
meta: object;
|
|
1553
|
-
}>;
|
|
1554
|
-
trackings: import("@trpc/server").TRPCBuiltRouter<{
|
|
1555
|
-
ctx: TrpcContext;
|
|
1556
|
-
meta: object;
|
|
1557
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1558
|
-
message: string;
|
|
1559
|
-
data: {
|
|
1560
|
-
httpCode: error.http.StatusCodeCode;
|
|
1561
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1562
|
-
httpStatus: number;
|
|
1563
|
-
path?: string;
|
|
1564
|
-
stack?: string;
|
|
1565
|
-
};
|
|
1566
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1567
|
-
};
|
|
1568
|
-
transformer: true;
|
|
1569
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1570
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1571
|
-
input: {
|
|
1572
|
-
finished?: boolean | null | undefined;
|
|
1573
|
-
toolId?: string | null | undefined;
|
|
1574
|
-
projectId?: string | null | undefined;
|
|
1575
|
-
responsibleUserId?: string | null | undefined;
|
|
1576
|
-
startedByUserId?: string | null | undefined;
|
|
1577
|
-
endedByUserId?: string | null | undefined;
|
|
1578
|
-
startedBefore?: unknown;
|
|
1579
|
-
startedAfter?: unknown;
|
|
1580
|
-
endedBefore?: unknown;
|
|
1581
|
-
endedAfter?: unknown;
|
|
1582
|
-
limit?: number | undefined;
|
|
1583
|
-
offset?: number | undefined;
|
|
1584
|
-
};
|
|
1585
|
-
output: {
|
|
1586
|
-
id: string;
|
|
1587
|
-
toolId: string;
|
|
1588
|
-
projectId: string | null;
|
|
1589
|
-
responsibleUserId: string | null;
|
|
1590
|
-
startedByUserId: string | null;
|
|
1591
|
-
endedByUserId: string | null;
|
|
1592
|
-
startedAt: Date;
|
|
1593
|
-
endedAt: Date | null;
|
|
1594
|
-
}[];
|
|
1595
|
-
meta: object;
|
|
1596
|
-
}>;
|
|
1597
|
-
}>>;
|
|
1598
|
-
inventories: import("@trpc/server").TRPCBuiltRouter<{
|
|
1599
|
-
ctx: TrpcContext;
|
|
1600
|
-
meta: object;
|
|
1601
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1602
|
-
message: string;
|
|
1603
|
-
data: {
|
|
1604
|
-
httpCode: error.http.StatusCodeCode;
|
|
1605
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1606
|
-
httpStatus: number;
|
|
1607
|
-
path?: string;
|
|
1608
|
-
stack?: string;
|
|
1609
|
-
};
|
|
1610
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1611
|
-
};
|
|
1612
|
-
transformer: true;
|
|
1613
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1614
|
-
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1615
|
-
input: {
|
|
1616
|
-
toolId?: string | null | undefined;
|
|
1617
|
-
};
|
|
1618
|
-
output: {
|
|
1619
|
-
id: string;
|
|
1620
|
-
toolId: string;
|
|
1621
|
-
comment: string | null;
|
|
1622
|
-
createdAt: Date;
|
|
1623
|
-
}[];
|
|
1624
|
-
meta: object;
|
|
1625
|
-
}>;
|
|
1626
|
-
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1627
|
-
input: {
|
|
1628
|
-
toolId: string;
|
|
1629
|
-
comment?: string | null | undefined;
|
|
1630
|
-
};
|
|
1631
|
-
output: {
|
|
1632
|
-
id: string;
|
|
1633
|
-
};
|
|
1634
|
-
meta: object;
|
|
1635
|
-
}>;
|
|
1636
|
-
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1637
|
-
input: {
|
|
1638
|
-
id: string;
|
|
1639
|
-
};
|
|
1640
|
-
output: {
|
|
1641
|
-
success: true;
|
|
1642
|
-
};
|
|
1643
|
-
meta: object;
|
|
1644
|
-
}>;
|
|
1645
|
-
}>>;
|
|
1646
|
-
categories: import("@trpc/server").TRPCQueryProcedure<{
|
|
1647
|
-
input: void;
|
|
1648
|
-
output: string[];
|
|
1649
|
-
meta: object;
|
|
1650
|
-
}>;
|
|
1651
|
-
brands: import("@trpc/server").TRPCQueryProcedure<{
|
|
1652
|
-
input: void;
|
|
1653
|
-
output: string[];
|
|
1654
|
-
meta: object;
|
|
1655
|
-
}>;
|
|
1656
|
-
suggestNextCustomId: import("@trpc/server").TRPCQueryProcedure<{
|
|
1657
|
-
input: void;
|
|
1658
|
-
output: number;
|
|
1659
|
-
meta: object;
|
|
1660
|
-
}>;
|
|
1661
|
-
}>>, (() => void)[]>
|
|
1662
|
-
];
|
|
1663
|
-
export type HandlerMap = {
|
|
1664
|
-
[Handler in (typeof HANDLERS)[number] as Handler["path"]]: Handler["router"];
|
|
1665
|
-
};
|
|
1666
262
|
declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
1667
263
|
ctx: TrpcContext;
|
|
1668
264
|
meta: object;
|
|
@@ -1678,24 +274,12 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1678
274
|
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1679
275
|
};
|
|
1680
276
|
transformer: true;
|
|
1681
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<HandlerMap>>;
|
|
1682
|
-
export type AppRouter = typeof appRouter;
|
|
1683
|
-
export declare function createClient(endpoint: string): import("@trpc/client").TRPCClient<import("@trpc/server").TRPCBuiltRouter<{
|
|
1684
|
-
ctx: TrpcContext;
|
|
1685
|
-
meta: object;
|
|
1686
|
-
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1687
|
-
message: string;
|
|
1688
|
-
data: {
|
|
1689
|
-
httpCode: error.http.StatusCodeCode;
|
|
1690
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1691
|
-
httpStatus: number;
|
|
1692
|
-
path?: string;
|
|
1693
|
-
stack?: string;
|
|
1694
|
-
};
|
|
1695
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1696
|
-
};
|
|
1697
|
-
transformer: true;
|
|
1698
277
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
278
|
+
ping: import("@trpc/server").TRPCQueryProcedure<{
|
|
279
|
+
input: void;
|
|
280
|
+
output: string;
|
|
281
|
+
meta: object;
|
|
282
|
+
}>;
|
|
1699
283
|
auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
1700
284
|
ctx: TrpcContext;
|
|
1701
285
|
meta: object;
|
|
@@ -1757,7 +341,7 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
1757
341
|
createdAt: Date;
|
|
1758
342
|
expiresAt: Date;
|
|
1759
343
|
};
|
|
1760
|
-
roles: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
|
|
344
|
+
roles: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
|
|
1761
345
|
};
|
|
1762
346
|
meta: object;
|
|
1763
347
|
}>;
|
|
@@ -2123,6 +707,64 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2123
707
|
};
|
|
2124
708
|
meta: object;
|
|
2125
709
|
}>;
|
|
710
|
+
contacts: import("@trpc/server").TRPCBuiltRouter<{
|
|
711
|
+
ctx: TrpcContext;
|
|
712
|
+
meta: object;
|
|
713
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
714
|
+
message: string;
|
|
715
|
+
data: {
|
|
716
|
+
httpCode: error.http.StatusCodeCode;
|
|
717
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
718
|
+
httpStatus: number;
|
|
719
|
+
path?: string;
|
|
720
|
+
stack?: string;
|
|
721
|
+
};
|
|
722
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
723
|
+
};
|
|
724
|
+
transformer: true;
|
|
725
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
726
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
727
|
+
input: {
|
|
728
|
+
customerId: string;
|
|
729
|
+
};
|
|
730
|
+
output: {
|
|
731
|
+
id: string;
|
|
732
|
+
firstName: string;
|
|
733
|
+
lastName: string | null;
|
|
734
|
+
phoneNumbers: {
|
|
735
|
+
number: string;
|
|
736
|
+
name?: string | null | undefined;
|
|
737
|
+
}[];
|
|
738
|
+
emailAddresses: {
|
|
739
|
+
email: string;
|
|
740
|
+
name?: string | null | undefined;
|
|
741
|
+
}[];
|
|
742
|
+
createdAt: Date;
|
|
743
|
+
modifiedAt: Date;
|
|
744
|
+
}[];
|
|
745
|
+
meta: object;
|
|
746
|
+
}>;
|
|
747
|
+
add: import("@trpc/server").TRPCMutationProcedure<{
|
|
748
|
+
input: {
|
|
749
|
+
customerId: string;
|
|
750
|
+
contactId: string;
|
|
751
|
+
};
|
|
752
|
+
output: {
|
|
753
|
+
success: true;
|
|
754
|
+
};
|
|
755
|
+
meta: object;
|
|
756
|
+
}>;
|
|
757
|
+
remove: import("@trpc/server").TRPCMutationProcedure<{
|
|
758
|
+
input: {
|
|
759
|
+
customerId: string;
|
|
760
|
+
contactId: string;
|
|
761
|
+
};
|
|
762
|
+
output: {
|
|
763
|
+
success: true;
|
|
764
|
+
};
|
|
765
|
+
meta: object;
|
|
766
|
+
}>;
|
|
767
|
+
}>>;
|
|
2126
768
|
}>>;
|
|
2127
769
|
projects: import("@trpc/server").TRPCBuiltRouter<{
|
|
2128
770
|
ctx: TrpcContext;
|
|
@@ -2321,6 +963,171 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2321
963
|
meta: object;
|
|
2322
964
|
}>;
|
|
2323
965
|
}>>;
|
|
966
|
+
contacts: import("@trpc/server").TRPCBuiltRouter<{
|
|
967
|
+
ctx: TrpcContext;
|
|
968
|
+
meta: object;
|
|
969
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
970
|
+
message: string;
|
|
971
|
+
data: {
|
|
972
|
+
httpCode: error.http.StatusCodeCode;
|
|
973
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
974
|
+
httpStatus: number;
|
|
975
|
+
path?: string;
|
|
976
|
+
stack?: string;
|
|
977
|
+
};
|
|
978
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
979
|
+
};
|
|
980
|
+
transformer: true;
|
|
981
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
982
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
983
|
+
input: {
|
|
984
|
+
projectId: string;
|
|
985
|
+
};
|
|
986
|
+
output: {
|
|
987
|
+
id: string;
|
|
988
|
+
firstName: string;
|
|
989
|
+
lastName: string | null;
|
|
990
|
+
phoneNumbers: {
|
|
991
|
+
number: string;
|
|
992
|
+
name?: string | null | undefined;
|
|
993
|
+
}[];
|
|
994
|
+
emailAddresses: {
|
|
995
|
+
email: string;
|
|
996
|
+
name?: string | null | undefined;
|
|
997
|
+
}[];
|
|
998
|
+
createdAt: Date;
|
|
999
|
+
modifiedAt: Date;
|
|
1000
|
+
}[];
|
|
1001
|
+
meta: object;
|
|
1002
|
+
}>;
|
|
1003
|
+
add: import("@trpc/server").TRPCMutationProcedure<{
|
|
1004
|
+
input: {
|
|
1005
|
+
projectId: string;
|
|
1006
|
+
contactId: string;
|
|
1007
|
+
};
|
|
1008
|
+
output: {
|
|
1009
|
+
success: true;
|
|
1010
|
+
};
|
|
1011
|
+
meta: object;
|
|
1012
|
+
}>;
|
|
1013
|
+
remove: import("@trpc/server").TRPCMutationProcedure<{
|
|
1014
|
+
input: {
|
|
1015
|
+
projectId: string;
|
|
1016
|
+
contactId: string;
|
|
1017
|
+
};
|
|
1018
|
+
output: {
|
|
1019
|
+
success: true;
|
|
1020
|
+
};
|
|
1021
|
+
meta: object;
|
|
1022
|
+
}>;
|
|
1023
|
+
}>>;
|
|
1024
|
+
}>>;
|
|
1025
|
+
contacts: import("@trpc/server").TRPCBuiltRouter<{
|
|
1026
|
+
ctx: TrpcContext;
|
|
1027
|
+
meta: object;
|
|
1028
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1029
|
+
message: string;
|
|
1030
|
+
data: {
|
|
1031
|
+
httpCode: error.http.StatusCodeCode;
|
|
1032
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1033
|
+
httpStatus: number;
|
|
1034
|
+
path?: string;
|
|
1035
|
+
stack?: string;
|
|
1036
|
+
};
|
|
1037
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1038
|
+
};
|
|
1039
|
+
transformer: true;
|
|
1040
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1041
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1042
|
+
input: {
|
|
1043
|
+
search?: string | null | undefined;
|
|
1044
|
+
};
|
|
1045
|
+
output: {
|
|
1046
|
+
id: string;
|
|
1047
|
+
firstName: string;
|
|
1048
|
+
lastName: string | null;
|
|
1049
|
+
phoneNumbers: {
|
|
1050
|
+
number: string;
|
|
1051
|
+
name?: string | null | undefined;
|
|
1052
|
+
}[];
|
|
1053
|
+
emailAddresses: {
|
|
1054
|
+
email: string;
|
|
1055
|
+
name?: string | null | undefined;
|
|
1056
|
+
}[];
|
|
1057
|
+
createdAt: Date;
|
|
1058
|
+
modifiedAt: Date;
|
|
1059
|
+
}[];
|
|
1060
|
+
meta: object;
|
|
1061
|
+
}>;
|
|
1062
|
+
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
1063
|
+
input: {
|
|
1064
|
+
id: string;
|
|
1065
|
+
};
|
|
1066
|
+
output: {
|
|
1067
|
+
id: string;
|
|
1068
|
+
firstName: string;
|
|
1069
|
+
lastName: string | null;
|
|
1070
|
+
phoneNumbers: {
|
|
1071
|
+
number: string;
|
|
1072
|
+
name?: string | null | undefined;
|
|
1073
|
+
}[];
|
|
1074
|
+
emailAddresses: {
|
|
1075
|
+
email: string;
|
|
1076
|
+
name?: string | null | undefined;
|
|
1077
|
+
}[];
|
|
1078
|
+
createdAt: Date;
|
|
1079
|
+
modifiedAt: Date;
|
|
1080
|
+
};
|
|
1081
|
+
meta: object;
|
|
1082
|
+
}>;
|
|
1083
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
1084
|
+
input: {
|
|
1085
|
+
firstName: string;
|
|
1086
|
+
lastName?: string | null | undefined;
|
|
1087
|
+
phoneNumbers?: {
|
|
1088
|
+
number: string;
|
|
1089
|
+
name?: string | null | undefined;
|
|
1090
|
+
}[] | undefined;
|
|
1091
|
+
emailAddresses?: {
|
|
1092
|
+
email: string;
|
|
1093
|
+
name?: string | null | undefined;
|
|
1094
|
+
}[] | undefined;
|
|
1095
|
+
};
|
|
1096
|
+
output: {
|
|
1097
|
+
id: string;
|
|
1098
|
+
};
|
|
1099
|
+
meta: object;
|
|
1100
|
+
}>;
|
|
1101
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
1102
|
+
input: {
|
|
1103
|
+
id: string;
|
|
1104
|
+
data: {
|
|
1105
|
+
firstName?: string | undefined;
|
|
1106
|
+
lastName?: string | null | undefined;
|
|
1107
|
+
phoneNumbers?: {
|
|
1108
|
+
number: string;
|
|
1109
|
+
name?: string | null | undefined;
|
|
1110
|
+
}[] | undefined;
|
|
1111
|
+
emailAddresses?: {
|
|
1112
|
+
email: string;
|
|
1113
|
+
name?: string | null | undefined;
|
|
1114
|
+
}[] | undefined;
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
output: {
|
|
1118
|
+
success: true;
|
|
1119
|
+
};
|
|
1120
|
+
meta: object;
|
|
1121
|
+
}>;
|
|
1122
|
+
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
1123
|
+
input: {
|
|
1124
|
+
id: string;
|
|
1125
|
+
};
|
|
1126
|
+
output: {
|
|
1127
|
+
success: true;
|
|
1128
|
+
};
|
|
1129
|
+
meta: object;
|
|
1130
|
+
}>;
|
|
2324
1131
|
}>>;
|
|
2325
1132
|
products: import("@trpc/server").TRPCBuiltRouter<{
|
|
2326
1133
|
ctx: TrpcContext;
|
|
@@ -2727,7 +1534,8 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2727
1534
|
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
2728
1535
|
input: {
|
|
2729
1536
|
search?: string | null | undefined;
|
|
2730
|
-
deactivated?: boolean | undefined;
|
|
1537
|
+
deactivated?: boolean | null | undefined;
|
|
1538
|
+
includeArchived?: boolean | undefined;
|
|
2731
1539
|
};
|
|
2732
1540
|
output: {
|
|
2733
1541
|
id: string;
|
|
@@ -2740,6 +1548,7 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2740
1548
|
createdAt: Date;
|
|
2741
1549
|
modifiedAt: Date;
|
|
2742
1550
|
deactivatedAt: Date | null;
|
|
1551
|
+
archivedAt: Date | null;
|
|
2743
1552
|
}[];
|
|
2744
1553
|
meta: object;
|
|
2745
1554
|
}>;
|
|
@@ -2758,6 +1567,7 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2758
1567
|
createdAt: Date;
|
|
2759
1568
|
modifiedAt: Date;
|
|
2760
1569
|
deactivatedAt: Date | null;
|
|
1570
|
+
archivedAt: Date | null;
|
|
2761
1571
|
};
|
|
2762
1572
|
meta: object;
|
|
2763
1573
|
}>;
|
|
@@ -2801,6 +1611,24 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2801
1611
|
};
|
|
2802
1612
|
meta: object;
|
|
2803
1613
|
}>;
|
|
1614
|
+
archive: import("@trpc/server").TRPCMutationProcedure<{
|
|
1615
|
+
input: {
|
|
1616
|
+
id: string;
|
|
1617
|
+
};
|
|
1618
|
+
output: {
|
|
1619
|
+
success: true;
|
|
1620
|
+
};
|
|
1621
|
+
meta: object;
|
|
1622
|
+
}>;
|
|
1623
|
+
unarchive: import("@trpc/server").TRPCMutationProcedure<{
|
|
1624
|
+
input: {
|
|
1625
|
+
id: string;
|
|
1626
|
+
};
|
|
1627
|
+
output: {
|
|
1628
|
+
success: true;
|
|
1629
|
+
};
|
|
1630
|
+
meta: object;
|
|
1631
|
+
}>;
|
|
2804
1632
|
activate: import("@trpc/server").TRPCMutationProcedure<{
|
|
2805
1633
|
input: {
|
|
2806
1634
|
id: string;
|
|
@@ -2821,13 +1649,13 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2821
1649
|
}>;
|
|
2822
1650
|
roles: import("@trpc/server").TRPCQueryProcedure<{
|
|
2823
1651
|
input: void;
|
|
2824
|
-
output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
|
|
1652
|
+
output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
|
|
2825
1653
|
meta: object;
|
|
2826
1654
|
}>;
|
|
2827
1655
|
setRoles: import("@trpc/server").TRPCMutationProcedure<{
|
|
2828
1656
|
input: {
|
|
2829
1657
|
userId: string;
|
|
2830
|
-
assignments: Record<":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers", boolean | null | undefined>;
|
|
1658
|
+
assignments: Record<":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers", boolean | null | undefined>;
|
|
2831
1659
|
};
|
|
2832
1660
|
output: {
|
|
2833
1661
|
success: true;
|
|
@@ -2993,6 +1821,78 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
2993
1821
|
}[];
|
|
2994
1822
|
meta: object;
|
|
2995
1823
|
}>;
|
|
1824
|
+
requests: import("@trpc/server").TRPCBuiltRouter<{
|
|
1825
|
+
ctx: TrpcContext;
|
|
1826
|
+
meta: object;
|
|
1827
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape | {
|
|
1828
|
+
message: string;
|
|
1829
|
+
data: {
|
|
1830
|
+
httpCode: error.http.StatusCodeCode;
|
|
1831
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1832
|
+
httpStatus: number;
|
|
1833
|
+
path?: string;
|
|
1834
|
+
stack?: string;
|
|
1835
|
+
};
|
|
1836
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1837
|
+
};
|
|
1838
|
+
transformer: true;
|
|
1839
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1840
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
1841
|
+
input: {
|
|
1842
|
+
toolId?: string | null | undefined;
|
|
1843
|
+
status?: "open" | "accepted" | "denied" | null | undefined;
|
|
1844
|
+
createdByUserId?: string | null | undefined;
|
|
1845
|
+
transferToUserId?: string | null | undefined;
|
|
1846
|
+
projectId?: string | null | undefined;
|
|
1847
|
+
limit?: number | undefined;
|
|
1848
|
+
offset?: number | undefined;
|
|
1849
|
+
};
|
|
1850
|
+
output: {
|
|
1851
|
+
id: string;
|
|
1852
|
+
toolTrackingId: string;
|
|
1853
|
+
toolId: string;
|
|
1854
|
+
transferToUserId: string;
|
|
1855
|
+
createdByUserId: string;
|
|
1856
|
+
projectId: string | null;
|
|
1857
|
+
status: "open" | "accepted" | "denied";
|
|
1858
|
+
notes: string | null;
|
|
1859
|
+
createdAt: Date;
|
|
1860
|
+
responsibleUserId: string | null;
|
|
1861
|
+
}[];
|
|
1862
|
+
meta: object;
|
|
1863
|
+
}>;
|
|
1864
|
+
request: import("@trpc/server").TRPCMutationProcedure<{
|
|
1865
|
+
input: {
|
|
1866
|
+
toolTrackingId: string;
|
|
1867
|
+
transferToUserId?: string | null | undefined;
|
|
1868
|
+
projectId?: string | null | undefined;
|
|
1869
|
+
notes?: string | null | undefined;
|
|
1870
|
+
};
|
|
1871
|
+
output: {
|
|
1872
|
+
id: string;
|
|
1873
|
+
};
|
|
1874
|
+
meta: object;
|
|
1875
|
+
}>;
|
|
1876
|
+
accept: import("@trpc/server").TRPCMutationProcedure<{
|
|
1877
|
+
input: {
|
|
1878
|
+
id: string;
|
|
1879
|
+
projectId?: string | null | undefined;
|
|
1880
|
+
};
|
|
1881
|
+
output: {
|
|
1882
|
+
success: true;
|
|
1883
|
+
};
|
|
1884
|
+
meta: object;
|
|
1885
|
+
}>;
|
|
1886
|
+
deny: import("@trpc/server").TRPCMutationProcedure<{
|
|
1887
|
+
input: {
|
|
1888
|
+
id: string;
|
|
1889
|
+
};
|
|
1890
|
+
output: {
|
|
1891
|
+
success: true;
|
|
1892
|
+
};
|
|
1893
|
+
meta: object;
|
|
1894
|
+
}>;
|
|
1895
|
+
}>>;
|
|
2996
1896
|
}>>;
|
|
2997
1897
|
inventories: import("@trpc/server").TRPCBuiltRouter<{
|
|
2998
1898
|
ctx: TrpcContext;
|
|
@@ -3058,6 +1958,106 @@ export declare function createClient(endpoint: string): import("@trpc/client").T
|
|
|
3058
1958
|
meta: object;
|
|
3059
1959
|
}>;
|
|
3060
1960
|
}>>;
|
|
3061
|
-
}
|
|
1961
|
+
}>>;
|
|
1962
|
+
export type AppRouter = typeof appRouter;
|
|
1963
|
+
interface Cache$1 {
|
|
1964
|
+
getBytes(key: string): Promise<Uint8Array | null>;
|
|
1965
|
+
setBytes(key: string, bytes: Uint8Array): Promise<void>;
|
|
1966
|
+
delete(key: string): Promise<void>;
|
|
1967
|
+
clear(): Promise<void>;
|
|
1968
|
+
keys(): Promise<Set<string>>;
|
|
1969
|
+
}
|
|
1970
|
+
/**
|
|
1971
|
+
* Streaming/caching modes consistent with your REST client.
|
|
1972
|
+
*/
|
|
1973
|
+
export type CacheMode = "cache-first" | "cache-only" | "network-first" | "network-only";
|
|
1974
|
+
export type MyTRPCClient = TRPCClient<AppRouter>;
|
|
1975
|
+
export type PathValue<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? PathValue<T[K], Rest> : never : P extends keyof T ? T[P] : never;
|
|
1976
|
+
export type Join<P extends string, K extends string> = P extends "" ? K : `${P}.${K}`;
|
|
1977
|
+
export type IsFn<T> = T extends (...args: any[]) => any ? true : false;
|
|
1978
|
+
export type TRPCPaths<TClient, Method extends string, P extends string = ""> = TClient extends object ? (Method extends keyof TClient ? IsFn<TClient[Method]> extends true ? P : {
|
|
1979
|
+
[K in Extract<keyof TClient, string>]: TRPCPaths<TClient[K], Method, Join<P, K>>;
|
|
1980
|
+
}[Extract<keyof TClient, string>] : {
|
|
1981
|
+
[K in Extract<keyof TClient, string>]: TRPCPaths<TClient[K], Method, Join<P, K>>;
|
|
1982
|
+
}[Extract<keyof TClient, string>]) : never;
|
|
1983
|
+
export type TRPCQueryPaths<TClient> = TRPCPaths<TClient, "query">;
|
|
1984
|
+
export type TRPCMutatePaths<TClient> = TRPCPaths<TClient, "mutate">;
|
|
1985
|
+
export type QueryPaths = TRPCQueryPaths<MyTRPCClient>;
|
|
1986
|
+
export type MutatePaths = TRPCMutatePaths<MyTRPCClient>;
|
|
1987
|
+
export type AnyFn = (...args: any[]) => any;
|
|
1988
|
+
export type FirstParam<F> = F extends AnyFn ? Parameters<F> extends [
|
|
1989
|
+
infer A,
|
|
1990
|
+
...any[]
|
|
1991
|
+
] ? A : void : never;
|
|
1992
|
+
export type RetType<F> = F extends AnyFn ? ReturnType<F> : never;
|
|
1993
|
+
export interface Client {
|
|
1994
|
+
/**
|
|
1995
|
+
* Convenient wrapper for query execution. This wrapper automatically handles:
|
|
1996
|
+
* - different fetch strategies (`cache-first`, `cache-only`, `network-first`, `network-only`)
|
|
1997
|
+
* ("first" refers to trying that specific source of information first, then the other)
|
|
1998
|
+
* - request deduplication (equal network requests that fall within a short shared time window
|
|
1999
|
+
* are deduplicated, i.e. executed once and share the result)
|
|
2000
|
+
*/
|
|
2001
|
+
query<PathT extends QueryPaths, QueryResolverT = PathValue<MyTRPCClient, `${PathT}.query`>>(path: PathT, input: FirstParam<QueryResolverT>, opts?: {
|
|
2002
|
+
strategy?: CacheMode;
|
|
2003
|
+
}): Promise<[
|
|
2004
|
+
Awaited<RetType<QueryResolverT>> | null,
|
|
2005
|
+
TRPCClientError<any> | null
|
|
2006
|
+
]>;
|
|
2007
|
+
streamQuery<PathT extends QueryPaths, QueryResolverT = PathValue<MyTRPCClient, `${PathT}.query`>>(path: PathT, input: FirstParam<QueryResolverT>, opts?: {
|
|
2008
|
+
strategy?: CacheMode;
|
|
2009
|
+
}): Observable<[
|
|
2010
|
+
Awaited<RetType<QueryResolverT>> | null,
|
|
2011
|
+
TRPCClientError<any> | null
|
|
2012
|
+
]>;
|
|
2013
|
+
mutate<PathT extends MutatePaths, QueryResolverT = PathValue<MyTRPCClient, `${PathT}.mutate`>>(path: PathT, input: FirstParam<QueryResolverT>, opts?: {}): Promise<[
|
|
2014
|
+
Awaited<RetType<QueryResolverT>>,
|
|
2015
|
+
null
|
|
2016
|
+
] | [
|
|
2017
|
+
null,
|
|
2018
|
+
Error
|
|
2019
|
+
]>;
|
|
2020
|
+
/**
|
|
2021
|
+
* invalidate the cache given a quer ypath or cache key
|
|
2022
|
+
* (invalidates multiple elements, recurse up)
|
|
2023
|
+
*/
|
|
2024
|
+
invalidate(pathOrKey: string): Promise<void>;
|
|
2025
|
+
/**
|
|
2026
|
+
* login the client. Behind the scenes, this retreives a token from the endpoint
|
|
2027
|
+
* and the clients stores that token in memory for further usage. It is send on
|
|
2028
|
+
* subsequent requests, until logout() is called. In browsers, the token is also
|
|
2029
|
+
* stored in `localStorage`, so that it can be restored using `restoreSession()`.
|
|
2030
|
+
*/
|
|
2031
|
+
login(input: FirstParam<PathValue<MyTRPCClient, "auth.login.mutate">>): Promise<void>;
|
|
2032
|
+
/**
|
|
2033
|
+
* logout the client. If a token is currently stored in memory (meaning that either
|
|
2034
|
+
* the client has logged in or the session has been restored), the server is informed
|
|
2035
|
+
* to invalidate the session associated with the currently stored token. Also, the
|
|
2036
|
+
* used cache cleared and the token is removed from memory (and from `localStorage`
|
|
2037
|
+
* in the browser).
|
|
2038
|
+
*/
|
|
2039
|
+
logout(): Promise<void>;
|
|
2040
|
+
/**
|
|
2041
|
+
* Listen to auth state changes
|
|
2042
|
+
* @returns Unsubscribe function
|
|
2043
|
+
*/
|
|
2044
|
+
listenAuthState(listener: (props: {
|
|
2045
|
+
loggedIn: boolean;
|
|
2046
|
+
}) => void): (() => void);
|
|
2047
|
+
restoreSession(): Promise<void>;
|
|
2048
|
+
clearCache(): Promise<void>;
|
|
2049
|
+
}
|
|
2050
|
+
/**
|
|
2051
|
+
* Usage:
|
|
2052
|
+
* ```ts
|
|
2053
|
+
* const client = createClient(endpoint);
|
|
2054
|
+
* client.trpc.tools.list.query(...)
|
|
2055
|
+
* client.streamQuery(client.trpc.tools.list, input, "cache-first").subscribe(...)
|
|
2056
|
+
* await client.trpc.tools.create.mutate(...) // auto invalidates tools.* etc.
|
|
2057
|
+
* ```
|
|
2058
|
+
*/
|
|
2059
|
+
export declare function createClient(endpoint: string, opts?: {
|
|
2060
|
+
cache?: Cache$1;
|
|
2061
|
+
}): Client;
|
|
3062
2062
|
|
|
3063
2063
|
export {};
|