@lizard-build/sdk 0.1.63 → 0.1.65

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.mts CHANGED
@@ -1010,7 +1010,8 @@ type SnapshotScope = 'user' | 'workspace' | 'project';
1010
1010
  interface SnapshotOpts {
1011
1011
  /** Warm copies to keep ready (container sandboxes only; ignored for Firecracker, whose snapshots restore from disk). */
1012
1012
  poolSize?: number;
1013
- /** Where it may be restored. Default `'user'`: any of your projects and workspaces. */
1013
+ /** Where it may be restored. Default `'user'`: any of your projects and workspaces; with a key
1014
+ * limited to a workspace or project, only what the key covers (a wider scope is narrowed). */
1014
1015
  scope?: SnapshotScope;
1015
1016
  }
1016
1017
  /**
@@ -1465,6 +1466,25 @@ interface Workspace {
1465
1466
  plan?: string;
1466
1467
  createdAt?: number | string;
1467
1468
  }
1469
+ /**
1470
+ * Resale prices: each resource's price as a multiple of Lizard's (1-100). API keys scoped
1471
+ * to the workspace see prices and costs multiplied by these; the owner's bill does not change.
1472
+ */
1473
+ interface ResaleMultipliers {
1474
+ cpu: number;
1475
+ memory: number;
1476
+ /** Volumes. */
1477
+ storage: number;
1478
+ egress: number;
1479
+ objectStorage: number;
1480
+ /** Sized sandboxes' flat price. */
1481
+ sandbox: number;
1482
+ }
1483
+ interface ResalePricing {
1484
+ /** False when every multiplier is 1: scoped keys see Lizard's prices. */
1485
+ enabled: boolean;
1486
+ multipliers: ResaleMultipliers;
1487
+ }
1468
1488
  interface CreateWorkspaceOpts {
1469
1489
  name: string;
1470
1490
  }
@@ -1510,6 +1530,26 @@ declare class WorkspacesAPI {
1510
1530
  pause(id: string): Promise<PauseResult>;
1511
1531
  /** Resume what was paused in a workspace (owner only; not what a billing freeze paused). */
1512
1532
  resume(id: string): Promise<PauseResult>;
1533
+ /**
1534
+ * The workspace's resale prices (owner only, key with no scopes).
1535
+ *
1536
+ * A scoped key gets HTTP 403 with `code: 'ACCOUNT_SCOPE_REQUIRED'`: the keys that see these
1537
+ * prices can neither read nor change them.
1538
+ */
1539
+ getResalePricing(id: string): Promise<ResalePricing>;
1540
+ /**
1541
+ * Set the workspace's resale prices (owner only, key with no scopes). Replaces them all:
1542
+ * a resource left out is 1. Every API key scoped to the workspace, or to one of its
1543
+ * projects, then sees each price and cost multiplied (sandbox `pricePerHour`, `metrics`
1544
+ * costs, billing summaries). Display only: what Lizard bills you is unchanged.
1545
+ *
1546
+ * ```ts
1547
+ * await lizard.workspaces.setResalePricing(ws.id, { cpu: 4, memory: 4, sandbox: 4 })
1548
+ * ```
1549
+ */
1550
+ setResalePricing(id: string, multipliers: Partial<ResaleMultipliers>): Promise<ResalePricing>;
1551
+ /** Turn resale prices off: scoped keys see Lizard's prices again (owner only). */
1552
+ clearResalePricing(id: string): Promise<ResalePricing>;
1513
1553
  /**
1514
1554
  * Delete a workspace.
1515
1555
  *
@@ -2344,4 +2384,4 @@ declare class LizardCLI {
2344
2384
  }): Promise<CLIResult>;
2345
2385
  }
2346
2386
 
2347
- export { type Account, type Addon, type AddonType, AddonsAPI, type ApiKey, type ApiKeyScope, ApiKeysAPI, AuthenticationError, type Balance, BillingAPI, type CLIOptions, type CLIResult, type CheckoutSession, type ClickOpts, type CodeContext, CodeSandbox, ConfigApplyError, type ConfigResult, ConflictError, type ConnectionOpts, type CostMetrics, type CreateAddonOpts, type CreateApiKeyOpts, type CreateContextOpts, type CreateProjectOpts, type CreateServiceOpts, type CreateVolumeOpts, type CreateWorkspaceOpts, type CreatedApiKey, type DeployEvent, DeployHandle, Desktop, type DesktopInfo, type DesktopStartOpts, type DomainInfo, type DomainStatus, DomainsAPI, Execution, ExecutionError, type ExposedPort, type FileInfo, type ForkResult, type FsEvent, type FsOpts, GitHubAPI, type ListTransactionsOpts, Lizard, LizardCLI, LizardError, type LizardOpts, type LogLine, type MetricPoint, type MetricRange, MetricsAPI, type MouseButton, NotFoundError, PaymentRequiredError, type Plan, PlatformClient, type ProcessInfo, type ProcessOpts, type ProcessResult, type ProcessSignal, type Project, type ProjectConfig, type ProjectCost, ProjectsAPI, type PromoRedemption, type RawMetrics, type Region, RegionsAPI, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, type SandboxSnapshot, type ScaleOpts, type ScrollDirection, type Secret, SecretsAPI, type Service, type ServiceMetrics, type ServiceUpdate, ServicesAPI, type SetSecretOpts, type SnapshotOpts, type SnapshotScope, type SnapshotWaitOpts, type StartCheckoutOpts, type StartProNowResult, StorageAPI, type StreamEvent, type Subscription, type SubscriptionStatus, TimeoutError, type Transaction, type TransactionPage, Volume, type VolumeInfo, type Workspace, WorkspacesAPI, resolveProjectId };
2387
+ export { type Account, type Addon, type AddonType, AddonsAPI, type ApiKey, type ApiKeyScope, ApiKeysAPI, AuthenticationError, type Balance, BillingAPI, type CLIOptions, type CLIResult, type CheckoutSession, type ClickOpts, type CodeContext, CodeSandbox, ConfigApplyError, type ConfigResult, ConflictError, type ConnectionOpts, type CostMetrics, type CreateAddonOpts, type CreateApiKeyOpts, type CreateContextOpts, type CreateProjectOpts, type CreateServiceOpts, type CreateVolumeOpts, type CreateWorkspaceOpts, type CreatedApiKey, type DeployEvent, DeployHandle, Desktop, type DesktopInfo, type DesktopStartOpts, type DomainInfo, type DomainStatus, DomainsAPI, Execution, ExecutionError, type ExposedPort, type FileInfo, type ForkResult, type FsEvent, type FsOpts, GitHubAPI, type ListTransactionsOpts, Lizard, LizardCLI, LizardError, type LizardOpts, type LogLine, type MetricPoint, type MetricRange, MetricsAPI, type MouseButton, NotFoundError, PaymentRequiredError, type Plan, PlatformClient, type ProcessInfo, type ProcessOpts, type ProcessResult, type ProcessSignal, type Project, type ProjectConfig, type ProjectCost, ProjectsAPI, type PromoRedemption, type RawMetrics, type Region, RegionsAPI, type ResaleMultipliers, type ResalePricing, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, type SandboxSnapshot, type ScaleOpts, type ScrollDirection, type Secret, SecretsAPI, type Service, type ServiceMetrics, type ServiceUpdate, ServicesAPI, type SetSecretOpts, type SnapshotOpts, type SnapshotScope, type SnapshotWaitOpts, type StartCheckoutOpts, type StartProNowResult, StorageAPI, type StreamEvent, type Subscription, type SubscriptionStatus, TimeoutError, type Transaction, type TransactionPage, Volume, type VolumeInfo, type Workspace, WorkspacesAPI, resolveProjectId };
package/dist/index.d.ts CHANGED
@@ -1010,7 +1010,8 @@ type SnapshotScope = 'user' | 'workspace' | 'project';
1010
1010
  interface SnapshotOpts {
1011
1011
  /** Warm copies to keep ready (container sandboxes only; ignored for Firecracker, whose snapshots restore from disk). */
1012
1012
  poolSize?: number;
1013
- /** Where it may be restored. Default `'user'`: any of your projects and workspaces. */
1013
+ /** Where it may be restored. Default `'user'`: any of your projects and workspaces; with a key
1014
+ * limited to a workspace or project, only what the key covers (a wider scope is narrowed). */
1014
1015
  scope?: SnapshotScope;
1015
1016
  }
1016
1017
  /**
@@ -1465,6 +1466,25 @@ interface Workspace {
1465
1466
  plan?: string;
1466
1467
  createdAt?: number | string;
1467
1468
  }
1469
+ /**
1470
+ * Resale prices: each resource's price as a multiple of Lizard's (1-100). API keys scoped
1471
+ * to the workspace see prices and costs multiplied by these; the owner's bill does not change.
1472
+ */
1473
+ interface ResaleMultipliers {
1474
+ cpu: number;
1475
+ memory: number;
1476
+ /** Volumes. */
1477
+ storage: number;
1478
+ egress: number;
1479
+ objectStorage: number;
1480
+ /** Sized sandboxes' flat price. */
1481
+ sandbox: number;
1482
+ }
1483
+ interface ResalePricing {
1484
+ /** False when every multiplier is 1: scoped keys see Lizard's prices. */
1485
+ enabled: boolean;
1486
+ multipliers: ResaleMultipliers;
1487
+ }
1468
1488
  interface CreateWorkspaceOpts {
1469
1489
  name: string;
1470
1490
  }
@@ -1510,6 +1530,26 @@ declare class WorkspacesAPI {
1510
1530
  pause(id: string): Promise<PauseResult>;
1511
1531
  /** Resume what was paused in a workspace (owner only; not what a billing freeze paused). */
1512
1532
  resume(id: string): Promise<PauseResult>;
1533
+ /**
1534
+ * The workspace's resale prices (owner only, key with no scopes).
1535
+ *
1536
+ * A scoped key gets HTTP 403 with `code: 'ACCOUNT_SCOPE_REQUIRED'`: the keys that see these
1537
+ * prices can neither read nor change them.
1538
+ */
1539
+ getResalePricing(id: string): Promise<ResalePricing>;
1540
+ /**
1541
+ * Set the workspace's resale prices (owner only, key with no scopes). Replaces them all:
1542
+ * a resource left out is 1. Every API key scoped to the workspace, or to one of its
1543
+ * projects, then sees each price and cost multiplied (sandbox `pricePerHour`, `metrics`
1544
+ * costs, billing summaries). Display only: what Lizard bills you is unchanged.
1545
+ *
1546
+ * ```ts
1547
+ * await lizard.workspaces.setResalePricing(ws.id, { cpu: 4, memory: 4, sandbox: 4 })
1548
+ * ```
1549
+ */
1550
+ setResalePricing(id: string, multipliers: Partial<ResaleMultipliers>): Promise<ResalePricing>;
1551
+ /** Turn resale prices off: scoped keys see Lizard's prices again (owner only). */
1552
+ clearResalePricing(id: string): Promise<ResalePricing>;
1513
1553
  /**
1514
1554
  * Delete a workspace.
1515
1555
  *
@@ -2344,4 +2384,4 @@ declare class LizardCLI {
2344
2384
  }): Promise<CLIResult>;
2345
2385
  }
2346
2386
 
2347
- export { type Account, type Addon, type AddonType, AddonsAPI, type ApiKey, type ApiKeyScope, ApiKeysAPI, AuthenticationError, type Balance, BillingAPI, type CLIOptions, type CLIResult, type CheckoutSession, type ClickOpts, type CodeContext, CodeSandbox, ConfigApplyError, type ConfigResult, ConflictError, type ConnectionOpts, type CostMetrics, type CreateAddonOpts, type CreateApiKeyOpts, type CreateContextOpts, type CreateProjectOpts, type CreateServiceOpts, type CreateVolumeOpts, type CreateWorkspaceOpts, type CreatedApiKey, type DeployEvent, DeployHandle, Desktop, type DesktopInfo, type DesktopStartOpts, type DomainInfo, type DomainStatus, DomainsAPI, Execution, ExecutionError, type ExposedPort, type FileInfo, type ForkResult, type FsEvent, type FsOpts, GitHubAPI, type ListTransactionsOpts, Lizard, LizardCLI, LizardError, type LizardOpts, type LogLine, type MetricPoint, type MetricRange, MetricsAPI, type MouseButton, NotFoundError, PaymentRequiredError, type Plan, PlatformClient, type ProcessInfo, type ProcessOpts, type ProcessResult, type ProcessSignal, type Project, type ProjectConfig, type ProjectCost, ProjectsAPI, type PromoRedemption, type RawMetrics, type Region, RegionsAPI, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, type SandboxSnapshot, type ScaleOpts, type ScrollDirection, type Secret, SecretsAPI, type Service, type ServiceMetrics, type ServiceUpdate, ServicesAPI, type SetSecretOpts, type SnapshotOpts, type SnapshotScope, type SnapshotWaitOpts, type StartCheckoutOpts, type StartProNowResult, StorageAPI, type StreamEvent, type Subscription, type SubscriptionStatus, TimeoutError, type Transaction, type TransactionPage, Volume, type VolumeInfo, type Workspace, WorkspacesAPI, resolveProjectId };
2387
+ export { type Account, type Addon, type AddonType, AddonsAPI, type ApiKey, type ApiKeyScope, ApiKeysAPI, AuthenticationError, type Balance, BillingAPI, type CLIOptions, type CLIResult, type CheckoutSession, type ClickOpts, type CodeContext, CodeSandbox, ConfigApplyError, type ConfigResult, ConflictError, type ConnectionOpts, type CostMetrics, type CreateAddonOpts, type CreateApiKeyOpts, type CreateContextOpts, type CreateProjectOpts, type CreateServiceOpts, type CreateVolumeOpts, type CreateWorkspaceOpts, type CreatedApiKey, type DeployEvent, DeployHandle, Desktop, type DesktopInfo, type DesktopStartOpts, type DomainInfo, type DomainStatus, DomainsAPI, Execution, ExecutionError, type ExposedPort, type FileInfo, type ForkResult, type FsEvent, type FsOpts, GitHubAPI, type ListTransactionsOpts, Lizard, LizardCLI, LizardError, type LizardOpts, type LogLine, type MetricPoint, type MetricRange, MetricsAPI, type MouseButton, NotFoundError, PaymentRequiredError, type Plan, PlatformClient, type ProcessInfo, type ProcessOpts, type ProcessResult, type ProcessSignal, type Project, type ProjectConfig, type ProjectCost, ProjectsAPI, type PromoRedemption, type RawMetrics, type Region, RegionsAPI, type ResaleMultipliers, type ResalePricing, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, type SandboxSnapshot, type ScaleOpts, type ScrollDirection, type Secret, SecretsAPI, type Service, type ServiceMetrics, type ServiceUpdate, ServicesAPI, type SetSecretOpts, type SnapshotOpts, type SnapshotScope, type SnapshotWaitOpts, type StartCheckoutOpts, type StartProNowResult, StorageAPI, type StreamEvent, type Subscription, type SubscriptionStatus, TimeoutError, type Transaction, type TransactionPage, Volume, type VolumeInfo, type Workspace, WorkspacesAPI, resolveProjectId };
package/dist/index.js CHANGED
@@ -1726,6 +1726,32 @@ var WorkspacesAPI = class {
1726
1726
  resume(id) {
1727
1727
  return this.client.post(`/api/workspaces/${id}/resume`, {});
1728
1728
  }
1729
+ /**
1730
+ * The workspace's resale prices (owner only, key with no scopes).
1731
+ *
1732
+ * A scoped key gets HTTP 403 with `code: 'ACCOUNT_SCOPE_REQUIRED'`: the keys that see these
1733
+ * prices can neither read nor change them.
1734
+ */
1735
+ getResalePricing(id) {
1736
+ return this.client.get(`/api/workspaces/${id}/resale-pricing`);
1737
+ }
1738
+ /**
1739
+ * Set the workspace's resale prices (owner only, key with no scopes). Replaces them all:
1740
+ * a resource left out is 1. Every API key scoped to the workspace, or to one of its
1741
+ * projects, then sees each price and cost multiplied (sandbox `pricePerHour`, `metrics`
1742
+ * costs, billing summaries). Display only: what Lizard bills you is unchanged.
1743
+ *
1744
+ * ```ts
1745
+ * await lizard.workspaces.setResalePricing(ws.id, { cpu: 4, memory: 4, sandbox: 4 })
1746
+ * ```
1747
+ */
1748
+ setResalePricing(id, multipliers) {
1749
+ return this.client.put(`/api/workspaces/${id}/resale-pricing`, multipliers);
1750
+ }
1751
+ /** Turn resale prices off: scoped keys see Lizard's prices again (owner only). */
1752
+ clearResalePricing(id) {
1753
+ return this.client.put(`/api/workspaces/${id}/resale-pricing`, {});
1754
+ }
1729
1755
  /**
1730
1756
  * Delete a workspace.
1731
1757
  *
package/dist/index.mjs CHANGED
@@ -1673,6 +1673,32 @@ var WorkspacesAPI = class {
1673
1673
  resume(id) {
1674
1674
  return this.client.post(`/api/workspaces/${id}/resume`, {});
1675
1675
  }
1676
+ /**
1677
+ * The workspace's resale prices (owner only, key with no scopes).
1678
+ *
1679
+ * A scoped key gets HTTP 403 with `code: 'ACCOUNT_SCOPE_REQUIRED'`: the keys that see these
1680
+ * prices can neither read nor change them.
1681
+ */
1682
+ getResalePricing(id) {
1683
+ return this.client.get(`/api/workspaces/${id}/resale-pricing`);
1684
+ }
1685
+ /**
1686
+ * Set the workspace's resale prices (owner only, key with no scopes). Replaces them all:
1687
+ * a resource left out is 1. Every API key scoped to the workspace, or to one of its
1688
+ * projects, then sees each price and cost multiplied (sandbox `pricePerHour`, `metrics`
1689
+ * costs, billing summaries). Display only: what Lizard bills you is unchanged.
1690
+ *
1691
+ * ```ts
1692
+ * await lizard.workspaces.setResalePricing(ws.id, { cpu: 4, memory: 4, sandbox: 4 })
1693
+ * ```
1694
+ */
1695
+ setResalePricing(id, multipliers) {
1696
+ return this.client.put(`/api/workspaces/${id}/resale-pricing`, multipliers);
1697
+ }
1698
+ /** Turn resale prices off: scoped keys see Lizard's prices again (owner only). */
1699
+ clearResalePricing(id) {
1700
+ return this.client.put(`/api/workspaces/${id}/resale-pricing`, {});
1701
+ }
1676
1702
  /**
1677
1703
  * Delete a workspace.
1678
1704
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/sdk",
3
- "version": "0.1.63",
3
+ "version": "0.1.65",
4
4
  "description": "TypeScript SDK for Lizard: Firecracker microVM sandboxes, code execution and cloud apps.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",