@machine0/sdk 0.1.0 → 0.1.1

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/types.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * INPUT types stay closed unions (the server validates them).
8
8
  */
9
9
  export type Open<T extends string> = T | (string & {});
10
- export type MachineStatus = "DESTROYED" | "CREATING" | "RUNNING" | "STARTING" | "STOPPING" | "STOPPED" | "RESTARTING" | "ERRORED" | "SUSPENDING" | "SUSPENDED" | "UNAVAILABLE";
10
+ export type MachineStatus = "DESTROYED" | "CREATING" | "RUNNING" | "STARTING" | "STOPPING" | "STOPPED" | "RESTARTING" | "ERRORED" | "SUSPENDING" | "SUSPENDED" | "UNAVAILABLE" | "ORDERED";
11
11
  export type MachineSize = "small" | "medium" | "large" | "xl" | "xxl" | "large-nvme" | "xl-nvme" | "xxl-nvme" | "xl-premium" | "xxl-premium" | "xxxl" | "4xl" | "5xl" | "6xl" | "gpu-4000ada-1" | "gpu-l40s-1" | "gpu-6000ada-1" | "gpu-mi300x-1" | "gpu-h100-1" | "gpu-h200-1" | "gpu-mi300x-8" | "gpu-h100-8" | "gpu-h200-8";
12
12
  export type MachineRegion = "us-east" | "us-west" | "uk" | "eu" | "asia";
13
13
  export type Distribution = "ubuntu" | "nixos";
@@ -35,6 +35,12 @@ export interface Machine {
35
35
  totalCost: number | null;
36
36
  pricePerHour: number | null;
37
37
  metricsEnabled: boolean;
38
+ /**
39
+ * Standing-order deadline (`machine0 order`): set while the machine is an
40
+ * ORDERED (or expired) order, cleared once the order fills. Null for
41
+ * machines created directly.
42
+ */
43
+ orderExpiresAt: string | null;
38
44
  }
39
45
  /**
40
46
  * Machine as returned by `machines.create`. The create path responds from
@@ -77,6 +83,8 @@ export interface MachineDetail {
77
83
  pricePerHour: number | null;
78
84
  mountPaths: string[];
79
85
  statusExplanation: string | null;
86
+ /** See {@link Machine.orderExpiresAt}. */
87
+ orderExpiresAt: string | null;
80
88
  }
81
89
  export interface DiskMount {
82
90
  diskName: string;
@@ -181,9 +189,9 @@ export interface SshKeyCreated extends SshKeyWithFile {
181
189
  export interface SshKeyCreatedManaged extends SshKeyWithFile {
182
190
  privateKey: string;
183
191
  }
184
- export declare const MACHINE_KEYS: readonly ["id", "name", "url", "status", "ip", "size", "region", "provider", "createdAt", "firstStartedAt", "destroyedAt", "image", "distribution", "ageMinutes", "totalCost", "pricePerHour", "metricsEnabled"];
185
- export declare const MACHINE_CREATED_KEYS: readonly ["id", "name", "url", "status", "ip", "size", "region", "provider", "createdAt", "firstStartedAt", "destroyedAt", "ageMinutes", "totalCost", "pricePerHour", "metricsEnabled"];
186
- export declare const MACHINE_DETAIL_KEYS: readonly ["id", "name", "url", "status", "ip", "size", "vcpu", "ram", "disk", "region", "provider", "createdAt", "firstStartedAt", "image", "imageVersion", "defaultSSHUsername", "sshClientInitialCommand", "metricsEnabled", "distribution", "key", "ageMinutes", "totalCost", "pricePerHour", "mountPaths", "statusExplanation"];
192
+ export declare const MACHINE_KEYS: readonly ["id", "name", "url", "status", "ip", "size", "region", "provider", "createdAt", "firstStartedAt", "destroyedAt", "image", "distribution", "ageMinutes", "totalCost", "pricePerHour", "metricsEnabled", "orderExpiresAt"];
193
+ export declare const MACHINE_CREATED_KEYS: readonly ["id", "name", "url", "status", "ip", "size", "region", "provider", "createdAt", "firstStartedAt", "destroyedAt", "ageMinutes", "totalCost", "pricePerHour", "metricsEnabled", "orderExpiresAt"];
194
+ export declare const MACHINE_DETAIL_KEYS: readonly ["id", "name", "url", "status", "ip", "size", "vcpu", "ram", "disk", "region", "provider", "createdAt", "firstStartedAt", "image", "imageVersion", "defaultSSHUsername", "sshClientInitialCommand", "metricsEnabled", "distribution", "key", "ageMinutes", "totalCost", "pricePerHour", "mountPaths", "statusExplanation", "orderExpiresAt"];
187
195
  export declare const IMAGE_KEYS: readonly ["id", "name", "description", "distribution", "type", "status", "provider", "sizeGb", "minDiskGb", "regions", "gpuOnly", "createdAt", "updatedAt", "ageMinutes", "totalCost", "pricePerHour"];
188
196
  export declare const IMAGE_DETAIL_KEYS: readonly ["id", "name", "description", "distribution", "type", "status", "provider", "sizeGb", "minDiskGb", "regions", "gpuOnly", "createdAt", "updatedAt", "ageMinutes", "totalCost", "pricePerHour", "versionSnapshotStorageCost"];
189
197
  export declare const SSH_KEY_KEYS: readonly ["id", "name", "type", "publicKey", "isDefault", "createdAt"];
package/dist/types.js CHANGED
@@ -35,6 +35,7 @@ export const MACHINE_KEYS = [
35
35
  "totalCost",
36
36
  "pricePerHour",
37
37
  "metricsEnabled",
38
+ "orderExpiresAt",
38
39
  ];
39
40
  export const MACHINE_CREATED_KEYS = [
40
41
  "id",
@@ -52,6 +53,7 @@ export const MACHINE_CREATED_KEYS = [
52
53
  "totalCost",
53
54
  "pricePerHour",
54
55
  "metricsEnabled",
56
+ "orderExpiresAt",
55
57
  ];
56
58
  export const MACHINE_DETAIL_KEYS = [
57
59
  "id",
@@ -79,6 +81,7 @@ export const MACHINE_DETAIL_KEYS = [
79
81
  "pricePerHour",
80
82
  "mountPaths",
81
83
  "statusExplanation",
84
+ "orderExpiresAt",
82
85
  ];
83
86
  export const IMAGE_KEYS = [
84
87
  "id",
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.0";
1
+ export declare const SDK_VERSION = "0.1.1";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Must match the "version" field in package.json — version.test.ts enforces
2
2
  // the sync, and the deploy-sdk workflow compares this constant (imported from
3
3
  // the built dist under plain Node) against package.json before publishing.
4
- export const SDK_VERSION = "0.1.0";
4
+ export const SDK_VERSION = "0.1.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machine0/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Typed Node.js/TypeScript SDK for the machine0 API. Zero dependencies, fetch-based.",
5
5
  "homepage": "https://machine0.io",
6
6
  "author": "Barnaby Malet <barnaby@machine0.io>",