@lizard-build/sdk 0.1.63 → 0.1.64

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
@@ -1465,6 +1465,25 @@ interface Workspace {
1465
1465
  plan?: string;
1466
1466
  createdAt?: number | string;
1467
1467
  }
1468
+ /**
1469
+ * Resale prices: each resource's price as a multiple of Lizard's (1-100). API keys scoped
1470
+ * to the workspace see prices and costs multiplied by these; the owner's bill does not change.
1471
+ */
1472
+ interface ResaleMultipliers {
1473
+ cpu: number;
1474
+ memory: number;
1475
+ /** Volumes. */
1476
+ storage: number;
1477
+ egress: number;
1478
+ objectStorage: number;
1479
+ /** Sized sandboxes' flat price. */
1480
+ sandbox: number;
1481
+ }
1482
+ interface ResalePricing {
1483
+ /** False when every multiplier is 1: scoped keys see Lizard's prices. */
1484
+ enabled: boolean;
1485
+ multipliers: ResaleMultipliers;
1486
+ }
1468
1487
  interface CreateWorkspaceOpts {
1469
1488
  name: string;
1470
1489
  }
@@ -1510,6 +1529,26 @@ declare class WorkspacesAPI {
1510
1529
  pause(id: string): Promise<PauseResult>;
1511
1530
  /** Resume what was paused in a workspace (owner only; not what a billing freeze paused). */
1512
1531
  resume(id: string): Promise<PauseResult>;
1532
+ /**
1533
+ * The workspace's resale prices (owner only, key with no scopes).
1534
+ *
1535
+ * A scoped key gets HTTP 403 with `code: 'ACCOUNT_SCOPE_REQUIRED'`: the keys that see these
1536
+ * prices can neither read nor change them.
1537
+ */
1538
+ getResalePricing(id: string): Promise<ResalePricing>;
1539
+ /**
1540
+ * Set the workspace's resale prices (owner only, key with no scopes). Replaces them all:
1541
+ * a resource left out is 1. Every API key scoped to the workspace, or to one of its
1542
+ * projects, then sees each price and cost multiplied (sandbox `pricePerHour`, `metrics`
1543
+ * costs, billing summaries). Display only: what Lizard bills you is unchanged.
1544
+ *
1545
+ * ```ts
1546
+ * await lizard.workspaces.setResalePricing(ws.id, { cpu: 4, memory: 4, sandbox: 4 })
1547
+ * ```
1548
+ */
1549
+ setResalePricing(id: string, multipliers: Partial<ResaleMultipliers>): Promise<ResalePricing>;
1550
+ /** Turn resale prices off: scoped keys see Lizard's prices again (owner only). */
1551
+ clearResalePricing(id: string): Promise<ResalePricing>;
1513
1552
  /**
1514
1553
  * Delete a workspace.
1515
1554
  *
@@ -2344,4 +2383,4 @@ declare class LizardCLI {
2344
2383
  }): Promise<CLIResult>;
2345
2384
  }
2346
2385
 
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 };
2386
+ 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
@@ -1465,6 +1465,25 @@ interface Workspace {
1465
1465
  plan?: string;
1466
1466
  createdAt?: number | string;
1467
1467
  }
1468
+ /**
1469
+ * Resale prices: each resource's price as a multiple of Lizard's (1-100). API keys scoped
1470
+ * to the workspace see prices and costs multiplied by these; the owner's bill does not change.
1471
+ */
1472
+ interface ResaleMultipliers {
1473
+ cpu: number;
1474
+ memory: number;
1475
+ /** Volumes. */
1476
+ storage: number;
1477
+ egress: number;
1478
+ objectStorage: number;
1479
+ /** Sized sandboxes' flat price. */
1480
+ sandbox: number;
1481
+ }
1482
+ interface ResalePricing {
1483
+ /** False when every multiplier is 1: scoped keys see Lizard's prices. */
1484
+ enabled: boolean;
1485
+ multipliers: ResaleMultipliers;
1486
+ }
1468
1487
  interface CreateWorkspaceOpts {
1469
1488
  name: string;
1470
1489
  }
@@ -1510,6 +1529,26 @@ declare class WorkspacesAPI {
1510
1529
  pause(id: string): Promise<PauseResult>;
1511
1530
  /** Resume what was paused in a workspace (owner only; not what a billing freeze paused). */
1512
1531
  resume(id: string): Promise<PauseResult>;
1532
+ /**
1533
+ * The workspace's resale prices (owner only, key with no scopes).
1534
+ *
1535
+ * A scoped key gets HTTP 403 with `code: 'ACCOUNT_SCOPE_REQUIRED'`: the keys that see these
1536
+ * prices can neither read nor change them.
1537
+ */
1538
+ getResalePricing(id: string): Promise<ResalePricing>;
1539
+ /**
1540
+ * Set the workspace's resale prices (owner only, key with no scopes). Replaces them all:
1541
+ * a resource left out is 1. Every API key scoped to the workspace, or to one of its
1542
+ * projects, then sees each price and cost multiplied (sandbox `pricePerHour`, `metrics`
1543
+ * costs, billing summaries). Display only: what Lizard bills you is unchanged.
1544
+ *
1545
+ * ```ts
1546
+ * await lizard.workspaces.setResalePricing(ws.id, { cpu: 4, memory: 4, sandbox: 4 })
1547
+ * ```
1548
+ */
1549
+ setResalePricing(id: string, multipliers: Partial<ResaleMultipliers>): Promise<ResalePricing>;
1550
+ /** Turn resale prices off: scoped keys see Lizard's prices again (owner only). */
1551
+ clearResalePricing(id: string): Promise<ResalePricing>;
1513
1552
  /**
1514
1553
  * Delete a workspace.
1515
1554
  *
@@ -2344,4 +2383,4 @@ declare class LizardCLI {
2344
2383
  }): Promise<CLIResult>;
2345
2384
  }
2346
2385
 
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 };
2386
+ 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.64",
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",