@toshicloud/sdk 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -4
- package/dist/client.d.ts +72 -4
- package/dist/client.js +16 -2
- package/dist/gen/toshi/workspace/v1/connections_pb.d.ts +164 -29
- package/dist/gen/toshi/workspace/v1/connections_pb.js +39 -23
- package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +16 -2
- package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +27 -1
- package/dist/gen/toshi/workspace/v1/workloads_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +352 -4
- package/dist/gen/toshi/workspace/v1/workspace_pb.js +157 -51
- package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +289 -4
- package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +70 -50
- package/dist/retry.js +5 -0
- package/dist/test/alarms.d.ts +29 -0
- package/dist/test/alarms.js +144 -0
- package/dist/test/fake.js +31 -0
- package/dist/test/index.d.ts +12 -2
- package/dist/test/index.js +12 -2
- package/dist/test/procedures.js +5 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -432,6 +432,274 @@ export type GetWorkspaceStatementResponseJson = {
|
|
|
432
432
|
export declare const GetWorkspaceStatementResponseSchema: GenMessage<GetWorkspaceStatementResponse, {
|
|
433
433
|
jsonType: GetWorkspaceStatementResponseJson;
|
|
434
434
|
}>;
|
|
435
|
+
/**
|
|
436
|
+
* @generated from message toshi.workspace.v1.GetWorkspaceUpcomingInvoiceRequest
|
|
437
|
+
*/
|
|
438
|
+
export type GetWorkspaceUpcomingInvoiceRequest = Message<"toshi.workspace.v1.GetWorkspaceUpcomingInvoiceRequest"> & {};
|
|
439
|
+
/**
|
|
440
|
+
* @generated from message toshi.workspace.v1.GetWorkspaceUpcomingInvoiceRequest
|
|
441
|
+
*/
|
|
442
|
+
export type GetWorkspaceUpcomingInvoiceRequestJson = {};
|
|
443
|
+
/**
|
|
444
|
+
* Describes the message toshi.workspace.v1.GetWorkspaceUpcomingInvoiceRequest.
|
|
445
|
+
* Use `create(GetWorkspaceUpcomingInvoiceRequestSchema)` to create a new message.
|
|
446
|
+
*/
|
|
447
|
+
export declare const GetWorkspaceUpcomingInvoiceRequestSchema: GenMessage<GetWorkspaceUpcomingInvoiceRequest, {
|
|
448
|
+
jsonType: GetWorkspaceUpcomingInvoiceRequestJson;
|
|
449
|
+
}>;
|
|
450
|
+
/**
|
|
451
|
+
* @generated from message toshi.workspace.v1.GetWorkspaceUpcomingInvoiceResponse
|
|
452
|
+
*/
|
|
453
|
+
export type GetWorkspaceUpcomingInvoiceResponse = Message<"toshi.workspace.v1.GetWorkspaceUpcomingInvoiceResponse"> & {
|
|
454
|
+
/**
|
|
455
|
+
* The billing provider's preview of the next invoice.
|
|
456
|
+
*
|
|
457
|
+
* @generated from field: toshi.workspace.v1.UpcomingInvoice invoice = 1;
|
|
458
|
+
*/
|
|
459
|
+
invoice?: UpcomingInvoice | undefined;
|
|
460
|
+
/**
|
|
461
|
+
* The current UTC month's cost per project, highest cost so far first.
|
|
462
|
+
* The row with an empty project_id holds what no project accounts for.
|
|
463
|
+
*
|
|
464
|
+
* @generated from field: repeated toshi.workspace.v1.ProjectCost projects = 2;
|
|
465
|
+
*/
|
|
466
|
+
projects: ProjectCost[];
|
|
467
|
+
/**
|
|
468
|
+
* The sums of the projects' month_so_far_cents and estimated_month_cents.
|
|
469
|
+
* month_so_far_cents equals the current month's statement estimated_cents.
|
|
470
|
+
*
|
|
471
|
+
* @generated from field: int64 month_so_far_cents = 3;
|
|
472
|
+
*/
|
|
473
|
+
monthSoFarCents: bigint;
|
|
474
|
+
/**
|
|
475
|
+
* @generated from field: int64 estimated_month_cents = 4;
|
|
476
|
+
*/
|
|
477
|
+
estimatedMonthCents: bigint;
|
|
478
|
+
/**
|
|
479
|
+
* The currency of the project costs, as the statement gives it; empty
|
|
480
|
+
* while no price is known.
|
|
481
|
+
*
|
|
482
|
+
* @generated from field: string currency = 5;
|
|
483
|
+
*/
|
|
484
|
+
currency: string;
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* @generated from message toshi.workspace.v1.GetWorkspaceUpcomingInvoiceResponse
|
|
488
|
+
*/
|
|
489
|
+
export type GetWorkspaceUpcomingInvoiceResponseJson = {
|
|
490
|
+
/**
|
|
491
|
+
* The billing provider's preview of the next invoice.
|
|
492
|
+
*
|
|
493
|
+
* @generated from field: toshi.workspace.v1.UpcomingInvoice invoice = 1;
|
|
494
|
+
*/
|
|
495
|
+
invoice?: UpcomingInvoiceJson;
|
|
496
|
+
/**
|
|
497
|
+
* The current UTC month's cost per project, highest cost so far first.
|
|
498
|
+
* The row with an empty project_id holds what no project accounts for.
|
|
499
|
+
*
|
|
500
|
+
* @generated from field: repeated toshi.workspace.v1.ProjectCost projects = 2;
|
|
501
|
+
*/
|
|
502
|
+
projects?: ProjectCostJson[];
|
|
503
|
+
/**
|
|
504
|
+
* The sums of the projects' month_so_far_cents and estimated_month_cents.
|
|
505
|
+
* month_so_far_cents equals the current month's statement estimated_cents.
|
|
506
|
+
*
|
|
507
|
+
* @generated from field: int64 month_so_far_cents = 3;
|
|
508
|
+
*/
|
|
509
|
+
monthSoFarCents?: string;
|
|
510
|
+
/**
|
|
511
|
+
* @generated from field: int64 estimated_month_cents = 4;
|
|
512
|
+
*/
|
|
513
|
+
estimatedMonthCents?: string;
|
|
514
|
+
/**
|
|
515
|
+
* The currency of the project costs, as the statement gives it; empty
|
|
516
|
+
* while no price is known.
|
|
517
|
+
*
|
|
518
|
+
* @generated from field: string currency = 5;
|
|
519
|
+
*/
|
|
520
|
+
currency?: string;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Describes the message toshi.workspace.v1.GetWorkspaceUpcomingInvoiceResponse.
|
|
524
|
+
* Use `create(GetWorkspaceUpcomingInvoiceResponseSchema)` to create a new message.
|
|
525
|
+
*/
|
|
526
|
+
export declare const GetWorkspaceUpcomingInvoiceResponseSchema: GenMessage<GetWorkspaceUpcomingInvoiceResponse, {
|
|
527
|
+
jsonType: GetWorkspaceUpcomingInvoiceResponseJson;
|
|
528
|
+
}>;
|
|
529
|
+
/**
|
|
530
|
+
* UpcomingInvoice is the billing provider's preview of a workspace's next
|
|
531
|
+
* invoice.
|
|
532
|
+
*
|
|
533
|
+
* @generated from message toshi.workspace.v1.UpcomingInvoice
|
|
534
|
+
*/
|
|
535
|
+
export type UpcomingInvoice = Message<"toshi.workspace.v1.UpcomingInvoice"> & {
|
|
536
|
+
/**
|
|
537
|
+
* The amount due, in the currency's minor unit, after the customer
|
|
538
|
+
* balance (such as a starter credit) is applied.
|
|
539
|
+
*
|
|
540
|
+
* @generated from field: int64 amount_cents = 1;
|
|
541
|
+
*/
|
|
542
|
+
amountCents: bigint;
|
|
543
|
+
/**
|
|
544
|
+
* The ISO currency code in lower case, such as "usd".
|
|
545
|
+
*
|
|
546
|
+
* @generated from field: string currency = 2;
|
|
547
|
+
*/
|
|
548
|
+
currency: string;
|
|
549
|
+
/**
|
|
550
|
+
* The period the invoice covers.
|
|
551
|
+
*
|
|
552
|
+
* @generated from field: google.protobuf.Timestamp period_start = 3;
|
|
553
|
+
*/
|
|
554
|
+
periodStart?: Timestamp | undefined;
|
|
555
|
+
/**
|
|
556
|
+
* @generated from field: google.protobuf.Timestamp period_end = 4;
|
|
557
|
+
*/
|
|
558
|
+
periodEnd?: Timestamp | undefined;
|
|
559
|
+
/**
|
|
560
|
+
* When the usage behind this answer was read. Meter events reach the
|
|
561
|
+
* provider asynchronously, so the preview may not yet include usage
|
|
562
|
+
* read at this time.
|
|
563
|
+
*
|
|
564
|
+
* @generated from field: google.protobuf.Timestamp meters_read_at = 5;
|
|
565
|
+
*/
|
|
566
|
+
metersReadAt?: Timestamp | undefined;
|
|
567
|
+
/**
|
|
568
|
+
* False when the workspace has no billing customer, or the provider has
|
|
569
|
+
* no upcoming invoice for it: the other fields are then empty.
|
|
570
|
+
*
|
|
571
|
+
* @generated from field: bool available = 6;
|
|
572
|
+
*/
|
|
573
|
+
available: boolean;
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* UpcomingInvoice is the billing provider's preview of a workspace's next
|
|
577
|
+
* invoice.
|
|
578
|
+
*
|
|
579
|
+
* @generated from message toshi.workspace.v1.UpcomingInvoice
|
|
580
|
+
*/
|
|
581
|
+
export type UpcomingInvoiceJson = {
|
|
582
|
+
/**
|
|
583
|
+
* The amount due, in the currency's minor unit, after the customer
|
|
584
|
+
* balance (such as a starter credit) is applied.
|
|
585
|
+
*
|
|
586
|
+
* @generated from field: int64 amount_cents = 1;
|
|
587
|
+
*/
|
|
588
|
+
amountCents?: string;
|
|
589
|
+
/**
|
|
590
|
+
* The ISO currency code in lower case, such as "usd".
|
|
591
|
+
*
|
|
592
|
+
* @generated from field: string currency = 2;
|
|
593
|
+
*/
|
|
594
|
+
currency?: string;
|
|
595
|
+
/**
|
|
596
|
+
* The period the invoice covers.
|
|
597
|
+
*
|
|
598
|
+
* @generated from field: google.protobuf.Timestamp period_start = 3;
|
|
599
|
+
*/
|
|
600
|
+
periodStart?: TimestampJson;
|
|
601
|
+
/**
|
|
602
|
+
* @generated from field: google.protobuf.Timestamp period_end = 4;
|
|
603
|
+
*/
|
|
604
|
+
periodEnd?: TimestampJson;
|
|
605
|
+
/**
|
|
606
|
+
* When the usage behind this answer was read. Meter events reach the
|
|
607
|
+
* provider asynchronously, so the preview may not yet include usage
|
|
608
|
+
* read at this time.
|
|
609
|
+
*
|
|
610
|
+
* @generated from field: google.protobuf.Timestamp meters_read_at = 5;
|
|
611
|
+
*/
|
|
612
|
+
metersReadAt?: TimestampJson;
|
|
613
|
+
/**
|
|
614
|
+
* False when the workspace has no billing customer, or the provider has
|
|
615
|
+
* no upcoming invoice for it: the other fields are then empty.
|
|
616
|
+
*
|
|
617
|
+
* @generated from field: bool available = 6;
|
|
618
|
+
*/
|
|
619
|
+
available?: boolean;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Describes the message toshi.workspace.v1.UpcomingInvoice.
|
|
623
|
+
* Use `create(UpcomingInvoiceSchema)` to create a new message.
|
|
624
|
+
*/
|
|
625
|
+
export declare const UpcomingInvoiceSchema: GenMessage<UpcomingInvoice, {
|
|
626
|
+
jsonType: UpcomingInvoiceJson;
|
|
627
|
+
}>;
|
|
628
|
+
/**
|
|
629
|
+
* ProjectCost is one project's cost in the current UTC month.
|
|
630
|
+
*
|
|
631
|
+
* @generated from message toshi.workspace.v1.ProjectCost
|
|
632
|
+
*/
|
|
633
|
+
export type ProjectCost = Message<"toshi.workspace.v1.ProjectCost"> & {
|
|
634
|
+
/**
|
|
635
|
+
* The project's id and name. An empty project_id is the cost no project
|
|
636
|
+
* accounts for: the own-host fee, storage, desktop seats, and minutes of
|
|
637
|
+
* jobs with no project, a deleted project, or that history retention
|
|
638
|
+
* already removed.
|
|
639
|
+
*
|
|
640
|
+
* @generated from field: string project_id = 1;
|
|
641
|
+
*/
|
|
642
|
+
projectId: string;
|
|
643
|
+
/**
|
|
644
|
+
* @generated from field: string project_name = 2;
|
|
645
|
+
*/
|
|
646
|
+
projectName: string;
|
|
647
|
+
/**
|
|
648
|
+
* The cost of the month so far, in the currency's minor unit.
|
|
649
|
+
*
|
|
650
|
+
* @generated from field: int64 month_so_far_cents = 3;
|
|
651
|
+
*/
|
|
652
|
+
monthSoFarCents: bigint;
|
|
653
|
+
/**
|
|
654
|
+
* month_so_far_cents carried in a straight line to the month's end: so
|
|
655
|
+
* far times the month's length over the time elapsed. Desktop seats are
|
|
656
|
+
* a whole-month charge and are not carried forward.
|
|
657
|
+
*
|
|
658
|
+
* @generated from field: int64 estimated_month_cents = 4;
|
|
659
|
+
*/
|
|
660
|
+
estimatedMonthCents: bigint;
|
|
661
|
+
};
|
|
662
|
+
/**
|
|
663
|
+
* ProjectCost is one project's cost in the current UTC month.
|
|
664
|
+
*
|
|
665
|
+
* @generated from message toshi.workspace.v1.ProjectCost
|
|
666
|
+
*/
|
|
667
|
+
export type ProjectCostJson = {
|
|
668
|
+
/**
|
|
669
|
+
* The project's id and name. An empty project_id is the cost no project
|
|
670
|
+
* accounts for: the own-host fee, storage, desktop seats, and minutes of
|
|
671
|
+
* jobs with no project, a deleted project, or that history retention
|
|
672
|
+
* already removed.
|
|
673
|
+
*
|
|
674
|
+
* @generated from field: string project_id = 1;
|
|
675
|
+
*/
|
|
676
|
+
projectId?: string;
|
|
677
|
+
/**
|
|
678
|
+
* @generated from field: string project_name = 2;
|
|
679
|
+
*/
|
|
680
|
+
projectName?: string;
|
|
681
|
+
/**
|
|
682
|
+
* The cost of the month so far, in the currency's minor unit.
|
|
683
|
+
*
|
|
684
|
+
* @generated from field: int64 month_so_far_cents = 3;
|
|
685
|
+
*/
|
|
686
|
+
monthSoFarCents?: string;
|
|
687
|
+
/**
|
|
688
|
+
* month_so_far_cents carried in a straight line to the month's end: so
|
|
689
|
+
* far times the month's length over the time elapsed. Desktop seats are
|
|
690
|
+
* a whole-month charge and are not carried forward.
|
|
691
|
+
*
|
|
692
|
+
* @generated from field: int64 estimated_month_cents = 4;
|
|
693
|
+
*/
|
|
694
|
+
estimatedMonthCents?: string;
|
|
695
|
+
};
|
|
696
|
+
/**
|
|
697
|
+
* Describes the message toshi.workspace.v1.ProjectCost.
|
|
698
|
+
* Use `create(ProjectCostSchema)` to create a new message.
|
|
699
|
+
*/
|
|
700
|
+
export declare const ProjectCostSchema: GenMessage<ProjectCost, {
|
|
701
|
+
jsonType: ProjectCostJson;
|
|
702
|
+
}>;
|
|
435
703
|
/**
|
|
436
704
|
* Seat is one assignment of a desktop seat to a person.
|
|
437
705
|
*
|
|
@@ -3782,8 +4050,8 @@ export declare const StorageSchema: GenMessage<Storage, {
|
|
|
3782
4050
|
jsonType: StorageJson;
|
|
3783
4051
|
}>;
|
|
3784
4052
|
/**
|
|
3785
|
-
* StoredKind is one kind of stored data in a month:
|
|
3786
|
-
*
|
|
4053
|
+
* StoredKind is one kind of stored data in a month: images, volume_versions,
|
|
4054
|
+
* artifacts, recordings or held_disks.
|
|
3787
4055
|
*
|
|
3788
4056
|
* @generated from message toshi.workspace.v1.StoredKind
|
|
3789
4057
|
*/
|
|
@@ -3806,8 +4074,8 @@ export type StoredKind = Message<"toshi.workspace.v1.StoredKind"> & {
|
|
|
3806
4074
|
gbHours: number;
|
|
3807
4075
|
};
|
|
3808
4076
|
/**
|
|
3809
|
-
* StoredKind is one kind of stored data in a month:
|
|
3810
|
-
*
|
|
4077
|
+
* StoredKind is one kind of stored data in a month: images, volume_versions,
|
|
4078
|
+
* artifacts, recordings or held_disks.
|
|
3811
4079
|
*
|
|
3812
4080
|
* @generated from message toshi.workspace.v1.StoredKind
|
|
3813
4081
|
*/
|
|
@@ -5075,6 +5343,23 @@ export declare const WorkspaceService: GenService<{
|
|
|
5075
5343
|
input: typeof GetWorkspaceStatementRequestSchema;
|
|
5076
5344
|
output: typeof GetWorkspaceStatementResponseSchema;
|
|
5077
5345
|
};
|
|
5346
|
+
/**
|
|
5347
|
+
* GetWorkspaceUpcomingInvoice returns the billing provider's preview of
|
|
5348
|
+
* the workspace's next invoice, and the current UTC month's cost so far
|
|
5349
|
+
* per project with a straight-line estimate to the month's end. The cost
|
|
5350
|
+
* comes from the same usage and prices as GetWorkspaceStatement, and the
|
|
5351
|
+
* projects' cost so far sums to its estimated_cents. Meter events reach
|
|
5352
|
+
* the provider asynchronously, so the preview can lag the usage; the
|
|
5353
|
+
* invoice is what is billed, and no estimate here changes it. A workspace
|
|
5354
|
+
* with no billing customer gets a preview with available false.
|
|
5355
|
+
*
|
|
5356
|
+
* @generated from rpc toshi.workspace.v1.WorkspaceService.GetWorkspaceUpcomingInvoice
|
|
5357
|
+
*/
|
|
5358
|
+
getWorkspaceUpcomingInvoice: {
|
|
5359
|
+
methodKind: "unary";
|
|
5360
|
+
input: typeof GetWorkspaceUpcomingInvoiceRequestSchema;
|
|
5361
|
+
output: typeof GetWorkspaceUpcomingInvoiceResponseSchema;
|
|
5362
|
+
};
|
|
5078
5363
|
/**
|
|
5079
5364
|
* ListSeats returns the desktop seats the workspace held in one UTC
|
|
5080
5365
|
* month, oldest assigned first: the seats live at some time in it,
|