@blaxel/core 0.2.65-dev.77 → 0.2.65-preview.79

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.
@@ -26,12 +26,16 @@ function getCredentials() {
26
26
  const config = fs.readFileSync(path.join(homeDir, ".blaxel/config.yaml"), "utf8");
27
27
  const configJson = yaml.parse(config);
28
28
  const workspaceName = env.BL_WORKSPACE || configJson.context.workspace;
29
- const credentials = configJson.workspaces.find((wk) => wk.name === workspaceName)?.credentials;
30
- if (!credentials) {
29
+ const workspace = configJson.workspaces.find((wk) => wk.name === workspaceName);
30
+ // Set BL_ENV from config.yaml workspace if not already set via env vars
31
+ if (!env.BL_ENV && workspace?.env) {
32
+ process.env.BL_ENV = workspace.env;
33
+ }
34
+ if (!workspace?.credentials) {
31
35
  return null;
32
36
  }
33
- credentials.workspace = workspaceName;
34
- return credentials;
37
+ workspace.credentials.workspace = workspaceName;
38
+ return workspace.credentials;
35
39
  }
36
40
  catch {
37
41
  // If any error (e.g., running in browser), just return null
@@ -219,6 +219,38 @@ export const verifyCustomDomain = (options) => {
219
219
  ...options
220
220
  });
221
221
  };
222
+ /**
223
+ * Get enabled features for workspace
224
+ * Returns only the feature flags that are currently enabled for the specified workspace. Disabled features are not included to prevent information leakage.
225
+ */
226
+ export const getWorkspaceFeatures = (options) => {
227
+ return (options?.client ?? _heyApiClient).get({
228
+ security: [
229
+ {
230
+ scheme: 'bearer',
231
+ type: 'http'
232
+ }
233
+ ],
234
+ url: '/features',
235
+ ...options
236
+ });
237
+ };
238
+ /**
239
+ * Retrieve feature flag evaluation for workspace
240
+ * Evaluates a specific feature flag for the workspace with full details including variant and payload. Useful for testing and debugging feature flag targeting.
241
+ */
242
+ export const testFeatureFlag = (options) => {
243
+ return (options.client ?? _heyApiClient).get({
244
+ security: [
245
+ {
246
+ scheme: 'bearer',
247
+ type: 'http'
248
+ }
249
+ ],
250
+ url: '/features/{featureKey}',
251
+ ...options
252
+ });
253
+ };
222
254
  /**
223
255
  * List all MCP servers
224
256
  * Returns all MCP server functions deployed in the workspace. Each function includes its deployment status, transport protocol (websocket or http-stream), and endpoint URL.
@@ -1631,6 +1663,198 @@ export const updateVolume = (options) => {
1631
1663
  }
1632
1664
  });
1633
1665
  };
1666
+ /**
1667
+ * List all VPCs in the workspace
1668
+ */
1669
+ export const listVpcs = (options) => {
1670
+ return (options?.client ?? _heyApiClient).get({
1671
+ security: [
1672
+ {
1673
+ scheme: 'bearer',
1674
+ type: 'http'
1675
+ }
1676
+ ],
1677
+ url: '/vpcs',
1678
+ ...options
1679
+ });
1680
+ };
1681
+ /**
1682
+ * Create a VPC for the workspace
1683
+ */
1684
+ export const createVpc = (options) => {
1685
+ return (options.client ?? _heyApiClient).post({
1686
+ security: [
1687
+ {
1688
+ scheme: 'bearer',
1689
+ type: 'http'
1690
+ }
1691
+ ],
1692
+ url: '/vpcs',
1693
+ ...options,
1694
+ headers: {
1695
+ 'Content-Type': 'application/json',
1696
+ ...options?.headers
1697
+ }
1698
+ });
1699
+ };
1700
+ /**
1701
+ * Delete a VPC
1702
+ */
1703
+ export const deleteVpc = (options) => {
1704
+ return (options.client ?? _heyApiClient).delete({
1705
+ security: [
1706
+ {
1707
+ scheme: 'bearer',
1708
+ type: 'http'
1709
+ }
1710
+ ],
1711
+ url: '/vpcs/{vpcName}',
1712
+ ...options
1713
+ });
1714
+ };
1715
+ /**
1716
+ * Get a VPC by name
1717
+ */
1718
+ export const getVpc = (options) => {
1719
+ return (options.client ?? _heyApiClient).get({
1720
+ security: [
1721
+ {
1722
+ scheme: 'bearer',
1723
+ type: 'http'
1724
+ }
1725
+ ],
1726
+ url: '/vpcs/{vpcName}',
1727
+ ...options
1728
+ });
1729
+ };
1730
+ /**
1731
+ * List egress gateways in a VPC
1732
+ */
1733
+ export const listEgressGateways = (options) => {
1734
+ return (options.client ?? _heyApiClient).get({
1735
+ security: [
1736
+ {
1737
+ scheme: 'bearer',
1738
+ type: 'http'
1739
+ }
1740
+ ],
1741
+ url: '/vpcs/{vpcName}/egressgateways',
1742
+ ...options
1743
+ });
1744
+ };
1745
+ /**
1746
+ * Create an egress gateway in a VPC
1747
+ */
1748
+ export const createEgressGateway = (options) => {
1749
+ return (options.client ?? _heyApiClient).post({
1750
+ security: [
1751
+ {
1752
+ scheme: 'bearer',
1753
+ type: 'http'
1754
+ }
1755
+ ],
1756
+ url: '/vpcs/{vpcName}/egressgateways',
1757
+ ...options,
1758
+ headers: {
1759
+ 'Content-Type': 'application/json',
1760
+ ...options?.headers
1761
+ }
1762
+ });
1763
+ };
1764
+ /**
1765
+ * Delete an egress gateway
1766
+ */
1767
+ export const deleteEgressGateway = (options) => {
1768
+ return (options.client ?? _heyApiClient).delete({
1769
+ security: [
1770
+ {
1771
+ scheme: 'bearer',
1772
+ type: 'http'
1773
+ }
1774
+ ],
1775
+ url: '/vpcs/{vpcName}/egressgateways/{gatewayName}',
1776
+ ...options
1777
+ });
1778
+ };
1779
+ /**
1780
+ * Get an egress gateway by name
1781
+ */
1782
+ export const getEgressGateway = (options) => {
1783
+ return (options.client ?? _heyApiClient).get({
1784
+ security: [
1785
+ {
1786
+ scheme: 'bearer',
1787
+ type: 'http'
1788
+ }
1789
+ ],
1790
+ url: '/vpcs/{vpcName}/egressgateways/{gatewayName}',
1791
+ ...options
1792
+ });
1793
+ };
1794
+ /**
1795
+ * List egress IPs in a gateway
1796
+ */
1797
+ export const listEgressIps = (options) => {
1798
+ return (options.client ?? _heyApiClient).get({
1799
+ security: [
1800
+ {
1801
+ scheme: 'bearer',
1802
+ type: 'http'
1803
+ }
1804
+ ],
1805
+ url: '/vpcs/{vpcName}/egressgateways/{gatewayName}/ips',
1806
+ ...options
1807
+ });
1808
+ };
1809
+ /**
1810
+ * Allocate a new egress IP from the gateway
1811
+ */
1812
+ export const createEgressIp = (options) => {
1813
+ return (options.client ?? _heyApiClient).post({
1814
+ security: [
1815
+ {
1816
+ scheme: 'bearer',
1817
+ type: 'http'
1818
+ }
1819
+ ],
1820
+ url: '/vpcs/{vpcName}/egressgateways/{gatewayName}/ips',
1821
+ ...options,
1822
+ headers: {
1823
+ 'Content-Type': 'application/json',
1824
+ ...options?.headers
1825
+ }
1826
+ });
1827
+ };
1828
+ /**
1829
+ * Delete an egress IP
1830
+ */
1831
+ export const deleteEgressIp = (options) => {
1832
+ return (options.client ?? _heyApiClient).delete({
1833
+ security: [
1834
+ {
1835
+ scheme: 'bearer',
1836
+ type: 'http'
1837
+ }
1838
+ ],
1839
+ url: '/vpcs/{vpcName}/egressgateways/{gatewayName}/ips/{ipName}',
1840
+ ...options
1841
+ });
1842
+ };
1843
+ /**
1844
+ * Get an egress IP by name
1845
+ */
1846
+ export const getEgressIp = (options) => {
1847
+ return (options.client ?? _heyApiClient).get({
1848
+ security: [
1849
+ {
1850
+ scheme: 'bearer',
1851
+ type: 'http'
1852
+ }
1853
+ ],
1854
+ url: '/vpcs/{vpcName}/egressgateways/{gatewayName}/ips/{ipName}',
1855
+ ...options
1856
+ });
1857
+ };
1634
1858
  /**
1635
1859
  * List accessible workspaces
1636
1860
  * Returns all workspaces the authenticated user has access to. Each workspace is a separate tenant with its own resources, team members, and billing.
@@ -3,8 +3,8 @@ import { authentication } from "../authentication/index.js";
3
3
  import { env } from "../common/env.js";
4
4
  import { fs, os, path } from "../common/node.js";
5
5
  // Build info - these placeholders are replaced at build time by build:replace-imports
6
- const BUILD_VERSION = "0.2.65-dev.77";
7
- const BUILD_COMMIT = "e860c9b3329ead5a36f8b3b0a31cd428e3fc513b";
6
+ const BUILD_VERSION = "0.2.65-preview.79";
7
+ const BUILD_COMMIT = "e6609ebb27c34442448dbd1f8eca8bd7b90f6981";
8
8
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
9
9
  // Cache for config.yaml tracking value
10
10
  let configTrackingValue = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.65-dev.77",
3
+ "version": "0.2.65-preview.79",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",