@zgeoff/imp-client 0.26.2 → 0.27.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/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { RPCLink } from "@orpc/client/fetch";
3
3
  import * as z from "zod";
4
4
  //#endregion
5
5
  //#region src/check-server.ts
6
- const CLIENT_VERSION = "0.26.2";
6
+ const CLIENT_VERSION = "0.27.0";
7
7
  async function checkServer(rpc) {
8
8
  const info = await rpc.system.info();
9
9
  return {
@@ -501,8 +501,15 @@ const ResourceKindSchema = z.enum([
501
501
  ]);
502
502
  const ResourceDataSchema = z.object({
503
503
  kind: ResourceKindSchema,
504
- name: z.string()
504
+ name: z.string(),
505
+ reason: z.enum(["binding_changed"]).optional()
505
506
  });
507
+ const ForbiddenReasonSchema = z.enum([
508
+ "imp_out_of_scope",
509
+ "not_grantable",
510
+ "scope"
511
+ ]);
512
+ const ForbiddenDataSchema = z.object({ reason: ForbiddenReasonSchema });
506
513
  const ProtectedImpSchema = z.object({
507
514
  name: NameSchema,
508
515
  ramMib: z.int().nonnegative(),
@@ -518,7 +525,10 @@ const IMP_ERRORS = defineErrors({
518
525
  message: "Already exists",
519
526
  data: ResourceDataSchema
520
527
  },
521
- FORBIDDEN: { message: "Not allowed" },
528
+ FORBIDDEN: {
529
+ message: "Not allowed",
530
+ data: ForbiddenDataSchema.optional()
531
+ },
522
532
  PRECONDITION_FAILED: { message: "Not possible on this host" },
523
533
  RAM_BUDGET_EXCEEDED: {
524
534
  message: "Not enough RAM budget, even after sleeping idle imps",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/imp-client",
3
- "version": "0.26.2",
3
+ "version": "0.27.0",
4
4
  "description": "Typed client for impd, the imp host daemon: imps, checkpoints, images and exec",
5
5
  "license": "MIT",
6
6
  "repository": {