@dagger.io/dagger 0.13.7 → 0.14.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.
@@ -1015,20 +1015,6 @@ export class Container extends BaseClient {
1015
1015
  ctx: this._ctx,
1016
1016
  });
1017
1017
  };
1018
- /**
1019
- * Indicate that subsequent operations should be featured more prominently in the UI.
1020
- */
1021
- withFocus = () => {
1022
- return new Container({
1023
- queryTree: [
1024
- ...this._queryTree,
1025
- {
1026
- operation: "withFocus",
1027
- },
1028
- ],
1029
- ctx: this._ctx,
1030
- });
1031
- };
1032
1018
  /**
1033
1019
  * Retrieves this container plus the given label.
1034
1020
  * @param name The name of the label (e.g., "org.opencontainers.artifact.created").
@@ -1455,22 +1441,6 @@ export class Container extends BaseClient {
1455
1441
  ctx: this._ctx,
1456
1442
  });
1457
1443
  };
1458
- /**
1459
- * Indicate that subsequent operations should not be featured more prominently in the UI.
1460
- *
1461
- * This is the initial state of all containers.
1462
- */
1463
- withoutFocus = () => {
1464
- return new Container({
1465
- queryTree: [
1466
- ...this._queryTree,
1467
- {
1468
- operation: "withoutFocus",
1469
- },
1470
- ],
1471
- ctx: this._ctx,
1472
- });
1473
- };
1474
1444
  /**
1475
1445
  * Retrieves this container minus the given environment label.
1476
1446
  * @param name The name of the label to remove (e.g., "org.opencontainers.artifact.created").
@@ -1705,19 +1675,25 @@ export class CurrentModule extends BaseClient {
1705
1675
  };
1706
1676
  }
1707
1677
  /**
1708
- * The Dagger engine configuration and state
1678
+ * A directory.
1709
1679
  */
1710
- export class DaggerEngine extends BaseClient {
1680
+ export class Directory extends BaseClient {
1711
1681
  _id = undefined;
1682
+ _digest = undefined;
1683
+ _export = undefined;
1684
+ _sync = undefined;
1712
1685
  /**
1713
1686
  * Constructor is used for internal usage only, do not create object from it.
1714
1687
  */
1715
- constructor(parent, _id) {
1688
+ constructor(parent, _id, _digest, _export, _sync) {
1716
1689
  super(parent);
1717
1690
  this._id = _id;
1691
+ this._digest = _digest;
1692
+ this._export = _export;
1693
+ this._sync = _sync;
1718
1694
  }
1719
1695
  /**
1720
- * A unique identifier for this DaggerEngine.
1696
+ * A unique identifier for this Directory.
1721
1697
  */
1722
1698
  id = async () => {
1723
1699
  if (this._id) {
@@ -1732,362 +1708,377 @@ export class DaggerEngine extends BaseClient {
1732
1708
  return response;
1733
1709
  };
1734
1710
  /**
1735
- * The local (on-disk) cache for the Dagger engine
1711
+ * Load the directory as a Dagger module
1712
+ * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
1713
+ *
1714
+ * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
1715
+ *
1716
+ * If not set, the module source code is loaded from the root of the directory.
1717
+ * @param opts.engineVersion The engine version to upgrade to.
1736
1718
  */
1737
- localCache = () => {
1738
- return new DaggerEngineCache({
1719
+ asModule = (opts) => {
1720
+ return new Module_({
1739
1721
  queryTree: [
1740
1722
  ...this._queryTree,
1741
1723
  {
1742
- operation: "localCache",
1724
+ operation: "asModule",
1725
+ args: { ...opts },
1743
1726
  },
1744
1727
  ],
1745
1728
  ctx: this._ctx,
1746
1729
  });
1747
1730
  };
1748
- }
1749
- /**
1750
- * A cache storage for the Dagger engine
1751
- */
1752
- export class DaggerEngineCache extends BaseClient {
1753
- _id = undefined;
1754
- _keepBytes = undefined;
1755
- _maxUsedSpace = undefined;
1756
- _minFreeSpace = undefined;
1757
- _prune = undefined;
1758
- _reservedSpace = undefined;
1759
1731
  /**
1760
- * Constructor is used for internal usage only, do not create object from it.
1732
+ * Gets the difference between this directory and an another directory.
1733
+ * @param other Identifier of the directory to compare.
1761
1734
  */
1762
- constructor(parent, _id, _keepBytes, _maxUsedSpace, _minFreeSpace, _prune, _reservedSpace) {
1763
- super(parent);
1764
- this._id = _id;
1765
- this._keepBytes = _keepBytes;
1766
- this._maxUsedSpace = _maxUsedSpace;
1767
- this._minFreeSpace = _minFreeSpace;
1768
- this._prune = _prune;
1769
- this._reservedSpace = _reservedSpace;
1770
- }
1735
+ diff = (other) => {
1736
+ return new Directory({
1737
+ queryTree: [
1738
+ ...this._queryTree,
1739
+ {
1740
+ operation: "diff",
1741
+ args: { other },
1742
+ },
1743
+ ],
1744
+ ctx: this._ctx,
1745
+ });
1746
+ };
1771
1747
  /**
1772
- * A unique identifier for this DaggerEngineCache.
1748
+ * Return the directory's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
1773
1749
  */
1774
- id = async () => {
1775
- if (this._id) {
1776
- return this._id;
1750
+ digest = async () => {
1751
+ if (this._digest) {
1752
+ return this._digest;
1777
1753
  }
1778
1754
  const response = await computeQuery([
1779
1755
  ...this._queryTree,
1780
1756
  {
1781
- operation: "id",
1757
+ operation: "digest",
1782
1758
  },
1783
1759
  ], await this._ctx.connection());
1784
1760
  return response;
1785
1761
  };
1786
1762
  /**
1787
- * The current set of entries in the cache
1763
+ * Retrieves a directory at the given path.
1764
+ * @param path Location of the directory to retrieve (e.g., "/src").
1788
1765
  */
1789
- entrySet = () => {
1790
- return new DaggerEngineCacheEntrySet({
1766
+ directory = (path) => {
1767
+ return new Directory({
1791
1768
  queryTree: [
1792
1769
  ...this._queryTree,
1793
1770
  {
1794
- operation: "entrySet",
1771
+ operation: "directory",
1772
+ args: { path },
1795
1773
  },
1796
1774
  ],
1797
1775
  ctx: this._ctx,
1798
1776
  });
1799
1777
  };
1800
1778
  /**
1801
- * The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
1802
- * @deprecated Use minFreeSpace instead.
1779
+ * Builds a new Docker container from this directory.
1780
+ * @param opts.platform The platform to build.
1781
+ * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
1782
+ * @param opts.target Target build stage to build.
1783
+ * @param opts.buildArgs Build arguments to use in the build.
1784
+ * @param opts.secrets Secrets to pass to the build.
1785
+ *
1786
+ * They will be mounted at /run/secrets/[secret-name].
1803
1787
  */
1804
- keepBytes = async () => {
1805
- if (this._keepBytes) {
1806
- return this._keepBytes;
1807
- }
1808
- const response = await computeQuery([
1809
- ...this._queryTree,
1810
- {
1811
- operation: "keepBytes",
1812
- },
1813
- ], await this._ctx.connection());
1814
- return response;
1788
+ dockerBuild = (opts) => {
1789
+ return new Container({
1790
+ queryTree: [
1791
+ ...this._queryTree,
1792
+ {
1793
+ operation: "dockerBuild",
1794
+ args: { ...opts },
1795
+ },
1796
+ ],
1797
+ ctx: this._ctx,
1798
+ });
1815
1799
  };
1816
1800
  /**
1817
- * The maximum bytes to keep in the cache without pruning.
1801
+ * Returns a list of files and directories at the given path.
1802
+ * @param opts.path Location of the directory to look at (e.g., "/src").
1818
1803
  */
1819
- maxUsedSpace = async () => {
1820
- if (this._maxUsedSpace) {
1821
- return this._maxUsedSpace;
1822
- }
1804
+ entries = async (opts) => {
1823
1805
  const response = await computeQuery([
1824
1806
  ...this._queryTree,
1825
1807
  {
1826
- operation: "maxUsedSpace",
1808
+ operation: "entries",
1809
+ args: { ...opts },
1827
1810
  },
1828
1811
  ], await this._ctx.connection());
1829
1812
  return response;
1830
1813
  };
1831
1814
  /**
1832
- * The target amount of free disk space the garbage collector will attempt to leave.
1815
+ * Writes the contents of the directory to a path on the host.
1816
+ * @param path Location of the copied directory (e.g., "logs/").
1817
+ * @param opts.wipe If true, then the host directory will be wiped clean before exporting so that it exactly matches the directory being exported; this means it will delete any files on the host that aren't in the exported dir. If false (the default), the contents of the directory will be merged with any existing contents of the host directory, leaving any existing files on the host that aren't in the exported directory alone.
1833
1818
  */
1834
- minFreeSpace = async () => {
1835
- if (this._minFreeSpace) {
1836
- return this._minFreeSpace;
1819
+ export = async (path, opts) => {
1820
+ if (this._export) {
1821
+ return this._export;
1837
1822
  }
1838
1823
  const response = await computeQuery([
1839
1824
  ...this._queryTree,
1840
1825
  {
1841
- operation: "minFreeSpace",
1826
+ operation: "export",
1827
+ args: { path, ...opts },
1842
1828
  },
1843
1829
  ], await this._ctx.connection());
1844
1830
  return response;
1845
1831
  };
1846
1832
  /**
1847
- * Prune the cache of releaseable entries
1833
+ * Retrieves a file at the given path.
1834
+ * @param path Location of the file to retrieve (e.g., "README.md").
1848
1835
  */
1849
- prune = async () => {
1850
- if (this._prune) {
1851
- return;
1852
- }
1853
- await computeQuery([
1854
- ...this._queryTree,
1855
- {
1856
- operation: "prune",
1857
- },
1858
- ], await this._ctx.connection());
1859
- };
1860
- reservedSpace = async () => {
1861
- if (this._reservedSpace) {
1862
- return this._reservedSpace;
1863
- }
1864
- const response = await computeQuery([
1865
- ...this._queryTree,
1866
- {
1867
- operation: "reservedSpace",
1868
- },
1869
- ], await this._ctx.connection());
1870
- return response;
1836
+ file = (path) => {
1837
+ return new File({
1838
+ queryTree: [
1839
+ ...this._queryTree,
1840
+ {
1841
+ operation: "file",
1842
+ args: { path },
1843
+ },
1844
+ ],
1845
+ ctx: this._ctx,
1846
+ });
1871
1847
  };
1872
- }
1873
- /**
1874
- * An individual cache entry in a cache entry set
1875
- */
1876
- export class DaggerEngineCacheEntry extends BaseClient {
1877
- _id = undefined;
1878
- _activelyUsed = undefined;
1879
- _createdTimeUnixNano = undefined;
1880
- _description = undefined;
1881
- _diskSpaceBytes = undefined;
1882
- _mostRecentUseTimeUnixNano = undefined;
1883
- /**
1884
- * Constructor is used for internal usage only, do not create object from it.
1885
- */
1886
- constructor(parent, _id, _activelyUsed, _createdTimeUnixNano, _description, _diskSpaceBytes, _mostRecentUseTimeUnixNano) {
1887
- super(parent);
1888
- this._id = _id;
1889
- this._activelyUsed = _activelyUsed;
1890
- this._createdTimeUnixNano = _createdTimeUnixNano;
1891
- this._description = _description;
1892
- this._diskSpaceBytes = _diskSpaceBytes;
1893
- this._mostRecentUseTimeUnixNano = _mostRecentUseTimeUnixNano;
1894
- }
1895
1848
  /**
1896
- * A unique identifier for this DaggerEngineCacheEntry.
1849
+ * Returns a list of files and directories that matche the given pattern.
1850
+ * @param pattern Pattern to match (e.g., "*.md").
1897
1851
  */
1898
- id = async () => {
1899
- if (this._id) {
1900
- return this._id;
1901
- }
1852
+ glob = async (pattern) => {
1902
1853
  const response = await computeQuery([
1903
1854
  ...this._queryTree,
1904
1855
  {
1905
- operation: "id",
1856
+ operation: "glob",
1857
+ args: { pattern },
1906
1858
  },
1907
1859
  ], await this._ctx.connection());
1908
1860
  return response;
1909
1861
  };
1910
1862
  /**
1911
- * Whether the cache entry is actively being used.
1863
+ * Force evaluation in the engine.
1912
1864
  */
1913
- activelyUsed = async () => {
1914
- if (this._activelyUsed) {
1915
- return this._activelyUsed;
1916
- }
1865
+ sync = async () => {
1917
1866
  const response = await computeQuery([
1918
1867
  ...this._queryTree,
1919
1868
  {
1920
- operation: "activelyUsed",
1869
+ operation: "sync",
1921
1870
  },
1922
1871
  ], await this._ctx.connection());
1923
- return response;
1872
+ return new Directory({
1873
+ queryTree: [
1874
+ {
1875
+ operation: "loadDirectoryFromID",
1876
+ args: { id: response },
1877
+ },
1878
+ ],
1879
+ ctx: this._ctx,
1880
+ });
1924
1881
  };
1925
1882
  /**
1926
- * The time the cache entry was created, in Unix nanoseconds.
1883
+ * Opens an interactive terminal in new container with this directory mounted inside.
1884
+ * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
1885
+ * @param opts.experimentalPrivilegedNesting Provides Dagger access to the executed command.
1886
+ *
1887
+ * Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
1888
+ * @param opts.insecureRootCapabilities Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
1889
+ * @param opts.container If set, override the default container used for the terminal.
1927
1890
  */
1928
- createdTimeUnixNano = async () => {
1929
- if (this._createdTimeUnixNano) {
1930
- return this._createdTimeUnixNano;
1931
- }
1932
- const response = await computeQuery([
1933
- ...this._queryTree,
1934
- {
1935
- operation: "createdTimeUnixNano",
1936
- },
1937
- ], await this._ctx.connection());
1938
- return response;
1891
+ terminal = (opts) => {
1892
+ return new Directory({
1893
+ queryTree: [
1894
+ ...this._queryTree,
1895
+ {
1896
+ operation: "terminal",
1897
+ args: { ...opts },
1898
+ },
1899
+ ],
1900
+ ctx: this._ctx,
1901
+ });
1939
1902
  };
1940
1903
  /**
1941
- * The description of the cache entry.
1904
+ * Retrieves this directory plus a directory written at the given path.
1905
+ * @param path Location of the written directory (e.g., "/src/").
1906
+ * @param directory Identifier of the directory to copy.
1907
+ * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
1908
+ * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
1942
1909
  */
1943
- description = async () => {
1944
- if (this._description) {
1945
- return this._description;
1946
- }
1947
- const response = await computeQuery([
1948
- ...this._queryTree,
1949
- {
1950
- operation: "description",
1951
- },
1952
- ], await this._ctx.connection());
1953
- return response;
1910
+ withDirectory = (path, directory, opts) => {
1911
+ return new Directory({
1912
+ queryTree: [
1913
+ ...this._queryTree,
1914
+ {
1915
+ operation: "withDirectory",
1916
+ args: { path, directory, ...opts },
1917
+ },
1918
+ ],
1919
+ ctx: this._ctx,
1920
+ });
1954
1921
  };
1955
1922
  /**
1956
- * The disk space used by the cache entry.
1923
+ * Retrieves this directory plus the contents of the given file copied to the given path.
1924
+ * @param path Location of the copied file (e.g., "/file.txt").
1925
+ * @param source Identifier of the file to copy.
1926
+ * @param opts.permissions Permission given to the copied file (e.g., 0600).
1957
1927
  */
1958
- diskSpaceBytes = async () => {
1959
- if (this._diskSpaceBytes) {
1960
- return this._diskSpaceBytes;
1961
- }
1962
- const response = await computeQuery([
1963
- ...this._queryTree,
1964
- {
1965
- operation: "diskSpaceBytes",
1966
- },
1967
- ], await this._ctx.connection());
1968
- return response;
1928
+ withFile = (path, source, opts) => {
1929
+ return new Directory({
1930
+ queryTree: [
1931
+ ...this._queryTree,
1932
+ {
1933
+ operation: "withFile",
1934
+ args: { path, source, ...opts },
1935
+ },
1936
+ ],
1937
+ ctx: this._ctx,
1938
+ });
1969
1939
  };
1970
1940
  /**
1971
- * The most recent time the cache entry was used, in Unix nanoseconds.
1941
+ * Retrieves this directory plus the contents of the given files copied to the given path.
1942
+ * @param path Location where copied files should be placed (e.g., "/src").
1943
+ * @param sources Identifiers of the files to copy.
1944
+ * @param opts.permissions Permission given to the copied files (e.g., 0600).
1972
1945
  */
1973
- mostRecentUseTimeUnixNano = async () => {
1974
- if (this._mostRecentUseTimeUnixNano) {
1975
- return this._mostRecentUseTimeUnixNano;
1976
- }
1977
- const response = await computeQuery([
1978
- ...this._queryTree,
1979
- {
1980
- operation: "mostRecentUseTimeUnixNano",
1981
- },
1982
- ], await this._ctx.connection());
1983
- return response;
1946
+ withFiles = (path, sources, opts) => {
1947
+ return new Directory({
1948
+ queryTree: [
1949
+ ...this._queryTree,
1950
+ {
1951
+ operation: "withFiles",
1952
+ args: { path, sources, ...opts },
1953
+ },
1954
+ ],
1955
+ ctx: this._ctx,
1956
+ });
1984
1957
  };
1985
- }
1986
- /**
1987
- * A set of cache entries returned by a query to a cache
1988
- */
1989
- export class DaggerEngineCacheEntrySet extends BaseClient {
1990
- _id = undefined;
1991
- _diskSpaceBytes = undefined;
1992
- _entryCount = undefined;
1993
1958
  /**
1994
- * Constructor is used for internal usage only, do not create object from it.
1959
+ * Retrieves this directory plus a new directory created at the given path.
1960
+ * @param path Location of the directory created (e.g., "/logs").
1961
+ * @param opts.permissions Permission granted to the created directory (e.g., 0777).
1995
1962
  */
1996
- constructor(parent, _id, _diskSpaceBytes, _entryCount) {
1997
- super(parent);
1998
- this._id = _id;
1999
- this._diskSpaceBytes = _diskSpaceBytes;
2000
- this._entryCount = _entryCount;
2001
- }
1963
+ withNewDirectory = (path, opts) => {
1964
+ return new Directory({
1965
+ queryTree: [
1966
+ ...this._queryTree,
1967
+ {
1968
+ operation: "withNewDirectory",
1969
+ args: { path, ...opts },
1970
+ },
1971
+ ],
1972
+ ctx: this._ctx,
1973
+ });
1974
+ };
2002
1975
  /**
2003
- * A unique identifier for this DaggerEngineCacheEntrySet.
1976
+ * Retrieves this directory plus a new file written at the given path.
1977
+ * @param path Location of the written file (e.g., "/file.txt").
1978
+ * @param contents Content of the written file (e.g., "Hello world!").
1979
+ * @param opts.permissions Permission given to the copied file (e.g., 0600).
2004
1980
  */
2005
- id = async () => {
2006
- if (this._id) {
2007
- return this._id;
2008
- }
2009
- const response = await computeQuery([
2010
- ...this._queryTree,
2011
- {
2012
- operation: "id",
2013
- },
2014
- ], await this._ctx.connection());
2015
- return response;
1981
+ withNewFile = (path, contents, opts) => {
1982
+ return new Directory({
1983
+ queryTree: [
1984
+ ...this._queryTree,
1985
+ {
1986
+ operation: "withNewFile",
1987
+ args: { path, contents, ...opts },
1988
+ },
1989
+ ],
1990
+ ctx: this._ctx,
1991
+ });
2016
1992
  };
2017
1993
  /**
2018
- * The total disk space used by the cache entries in this set.
1994
+ * Retrieves this directory with all file/dir timestamps set to the given time.
1995
+ * @param timestamp Timestamp to set dir/files in.
1996
+ *
1997
+ * Formatted in seconds following Unix epoch (e.g., 1672531199).
2019
1998
  */
2020
- diskSpaceBytes = async () => {
2021
- if (this._diskSpaceBytes) {
2022
- return this._diskSpaceBytes;
2023
- }
2024
- const response = await computeQuery([
2025
- ...this._queryTree,
2026
- {
2027
- operation: "diskSpaceBytes",
2028
- },
2029
- ], await this._ctx.connection());
2030
- return response;
1999
+ withTimestamps = (timestamp) => {
2000
+ return new Directory({
2001
+ queryTree: [
2002
+ ...this._queryTree,
2003
+ {
2004
+ operation: "withTimestamps",
2005
+ args: { timestamp },
2006
+ },
2007
+ ],
2008
+ ctx: this._ctx,
2009
+ });
2031
2010
  };
2032
2011
  /**
2033
- * The list of individual cache entries in the set
2012
+ * Retrieves this directory with the directory at the given path removed.
2013
+ * @param path Location of the directory to remove (e.g., ".github/").
2034
2014
  */
2035
- entries = async () => {
2036
- const response = await computeQuery([
2037
- ...this._queryTree,
2038
- {
2039
- operation: "entries",
2040
- },
2041
- {
2042
- operation: "id",
2043
- },
2044
- ], await this._ctx.connection());
2045
- return response.map((r) => new DaggerEngineCacheEntry({
2015
+ withoutDirectory = (path) => {
2016
+ return new Directory({
2046
2017
  queryTree: [
2018
+ ...this._queryTree,
2047
2019
  {
2048
- operation: "loadDaggerEngineCacheEntryFromID",
2049
- args: { id: r.id },
2020
+ operation: "withoutDirectory",
2021
+ args: { path },
2050
2022
  },
2051
2023
  ],
2052
2024
  ctx: this._ctx,
2053
- }, r.id));
2025
+ });
2054
2026
  };
2055
2027
  /**
2056
- * The number of cache entries in this set.
2028
+ * Retrieves this directory with the file at the given path removed.
2029
+ * @param path Location of the file to remove (e.g., "/file.txt").
2057
2030
  */
2058
- entryCount = async () => {
2059
- if (this._entryCount) {
2060
- return this._entryCount;
2061
- }
2062
- const response = await computeQuery([
2063
- ...this._queryTree,
2064
- {
2065
- operation: "entryCount",
2066
- },
2067
- ], await this._ctx.connection());
2068
- return response;
2031
+ withoutFile = (path) => {
2032
+ return new Directory({
2033
+ queryTree: [
2034
+ ...this._queryTree,
2035
+ {
2036
+ operation: "withoutFile",
2037
+ args: { path },
2038
+ },
2039
+ ],
2040
+ ctx: this._ctx,
2041
+ });
2042
+ };
2043
+ /**
2044
+ * Retrieves this directory with the files at the given paths removed.
2045
+ * @param paths Location of the file to remove (e.g., ["/file.txt"]).
2046
+ */
2047
+ withoutFiles = (paths) => {
2048
+ return new Directory({
2049
+ queryTree: [
2050
+ ...this._queryTree,
2051
+ {
2052
+ operation: "withoutFiles",
2053
+ args: { paths },
2054
+ },
2055
+ ],
2056
+ ctx: this._ctx,
2057
+ });
2058
+ };
2059
+ /**
2060
+ * Call the provided function with current Directory.
2061
+ *
2062
+ * This is useful for reusability and readability by not breaking the calling chain.
2063
+ */
2064
+ with = (arg) => {
2065
+ return arg(this);
2069
2066
  };
2070
2067
  }
2071
2068
  /**
2072
- * A directory.
2069
+ * The Dagger engine configuration and state
2073
2070
  */
2074
- export class Directory extends BaseClient {
2071
+ export class Engine extends BaseClient {
2075
2072
  _id = undefined;
2076
- _digest = undefined;
2077
- _export = undefined;
2078
- _sync = undefined;
2079
2073
  /**
2080
2074
  * Constructor is used for internal usage only, do not create object from it.
2081
2075
  */
2082
- constructor(parent, _id, _digest, _export, _sync) {
2076
+ constructor(parent, _id) {
2083
2077
  super(parent);
2084
2078
  this._id = _id;
2085
- this._digest = _digest;
2086
- this._export = _export;
2087
- this._sync = _sync;
2088
2079
  }
2089
2080
  /**
2090
- * A unique identifier for this Directory.
2081
+ * A unique identifier for this Engine.
2091
2082
  */
2092
2083
  id = async () => {
2093
2084
  if (this._id) {
@@ -2102,361 +2093,340 @@ export class Directory extends BaseClient {
2102
2093
  return response;
2103
2094
  };
2104
2095
  /**
2105
- * Load the directory as a Dagger module
2106
- * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
2107
- *
2108
- * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
2109
- *
2110
- * If not set, the module source code is loaded from the root of the directory.
2111
- * @param opts.engineVersion The engine version to upgrade to.
2096
+ * The local (on-disk) cache for the Dagger engine
2112
2097
  */
2113
- asModule = (opts) => {
2114
- return new Module_({
2098
+ localCache = () => {
2099
+ return new EngineCache({
2115
2100
  queryTree: [
2116
2101
  ...this._queryTree,
2117
2102
  {
2118
- operation: "asModule",
2119
- args: { ...opts },
2103
+ operation: "localCache",
2120
2104
  },
2121
2105
  ],
2122
2106
  ctx: this._ctx,
2123
2107
  });
2124
2108
  };
2109
+ }
2110
+ /**
2111
+ * A cache storage for the Dagger engine
2112
+ */
2113
+ export class EngineCache extends BaseClient {
2114
+ _id = undefined;
2115
+ _keepBytes = undefined;
2116
+ _maxUsedSpace = undefined;
2117
+ _minFreeSpace = undefined;
2118
+ _prune = undefined;
2119
+ _reservedSpace = undefined;
2125
2120
  /**
2126
- * Gets the difference between this directory and an another directory.
2127
- * @param other Identifier of the directory to compare.
2121
+ * Constructor is used for internal usage only, do not create object from it.
2128
2122
  */
2129
- diff = (other) => {
2130
- return new Directory({
2131
- queryTree: [
2132
- ...this._queryTree,
2133
- {
2134
- operation: "diff",
2135
- args: { other },
2136
- },
2137
- ],
2138
- ctx: this._ctx,
2139
- });
2140
- };
2123
+ constructor(parent, _id, _keepBytes, _maxUsedSpace, _minFreeSpace, _prune, _reservedSpace) {
2124
+ super(parent);
2125
+ this._id = _id;
2126
+ this._keepBytes = _keepBytes;
2127
+ this._maxUsedSpace = _maxUsedSpace;
2128
+ this._minFreeSpace = _minFreeSpace;
2129
+ this._prune = _prune;
2130
+ this._reservedSpace = _reservedSpace;
2131
+ }
2141
2132
  /**
2142
- * Return the directory's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
2133
+ * A unique identifier for this EngineCache.
2143
2134
  */
2144
- digest = async () => {
2145
- if (this._digest) {
2146
- return this._digest;
2135
+ id = async () => {
2136
+ if (this._id) {
2137
+ return this._id;
2147
2138
  }
2148
2139
  const response = await computeQuery([
2149
2140
  ...this._queryTree,
2150
2141
  {
2151
- operation: "digest",
2142
+ operation: "id",
2152
2143
  },
2153
2144
  ], await this._ctx.connection());
2154
2145
  return response;
2155
2146
  };
2156
2147
  /**
2157
- * Retrieves a directory at the given path.
2158
- * @param path Location of the directory to retrieve (e.g., "/src").
2148
+ * The current set of entries in the cache
2159
2149
  */
2160
- directory = (path) => {
2161
- return new Directory({
2150
+ entrySet = () => {
2151
+ return new EngineCacheEntrySet({
2162
2152
  queryTree: [
2163
2153
  ...this._queryTree,
2164
2154
  {
2165
- operation: "directory",
2166
- args: { path },
2155
+ operation: "entrySet",
2167
2156
  },
2168
2157
  ],
2169
2158
  ctx: this._ctx,
2170
2159
  });
2171
2160
  };
2172
2161
  /**
2173
- * Builds a new Docker container from this directory.
2174
- * @param opts.platform The platform to build.
2175
- * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
2176
- * @param opts.target Target build stage to build.
2177
- * @param opts.buildArgs Build arguments to use in the build.
2178
- * @param opts.secrets Secrets to pass to the build.
2179
- *
2180
- * They will be mounted at /run/secrets/[secret-name].
2162
+ * The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
2163
+ * @deprecated Use minFreeSpace instead.
2181
2164
  */
2182
- dockerBuild = (opts) => {
2183
- return new Container({
2184
- queryTree: [
2185
- ...this._queryTree,
2186
- {
2187
- operation: "dockerBuild",
2188
- args: { ...opts },
2189
- },
2190
- ],
2191
- ctx: this._ctx,
2192
- });
2165
+ keepBytes = async () => {
2166
+ if (this._keepBytes) {
2167
+ return this._keepBytes;
2168
+ }
2169
+ const response = await computeQuery([
2170
+ ...this._queryTree,
2171
+ {
2172
+ operation: "keepBytes",
2173
+ },
2174
+ ], await this._ctx.connection());
2175
+ return response;
2193
2176
  };
2194
2177
  /**
2195
- * Returns a list of files and directories at the given path.
2196
- * @param opts.path Location of the directory to look at (e.g., "/src").
2178
+ * The maximum bytes to keep in the cache without pruning.
2197
2179
  */
2198
- entries = async (opts) => {
2180
+ maxUsedSpace = async () => {
2181
+ if (this._maxUsedSpace) {
2182
+ return this._maxUsedSpace;
2183
+ }
2199
2184
  const response = await computeQuery([
2200
2185
  ...this._queryTree,
2201
2186
  {
2202
- operation: "entries",
2203
- args: { ...opts },
2187
+ operation: "maxUsedSpace",
2204
2188
  },
2205
2189
  ], await this._ctx.connection());
2206
2190
  return response;
2207
2191
  };
2208
2192
  /**
2209
- * Writes the contents of the directory to a path on the host.
2210
- * @param path Location of the copied directory (e.g., "logs/").
2211
- * @param opts.wipe If true, then the host directory will be wiped clean before exporting so that it exactly matches the directory being exported; this means it will delete any files on the host that aren't in the exported dir. If false (the default), the contents of the directory will be merged with any existing contents of the host directory, leaving any existing files on the host that aren't in the exported directory alone.
2193
+ * The target amount of free disk space the garbage collector will attempt to leave.
2212
2194
  */
2213
- export = async (path, opts) => {
2214
- if (this._export) {
2215
- return this._export;
2195
+ minFreeSpace = async () => {
2196
+ if (this._minFreeSpace) {
2197
+ return this._minFreeSpace;
2216
2198
  }
2217
2199
  const response = await computeQuery([
2218
2200
  ...this._queryTree,
2219
2201
  {
2220
- operation: "export",
2221
- args: { path, ...opts },
2202
+ operation: "minFreeSpace",
2222
2203
  },
2223
2204
  ], await this._ctx.connection());
2224
2205
  return response;
2225
2206
  };
2226
2207
  /**
2227
- * Retrieves a file at the given path.
2228
- * @param path Location of the file to retrieve (e.g., "README.md").
2208
+ * Prune the cache of releaseable entries
2229
2209
  */
2230
- file = (path) => {
2231
- return new File({
2232
- queryTree: [
2233
- ...this._queryTree,
2234
- {
2235
- operation: "file",
2236
- args: { path },
2237
- },
2238
- ],
2239
- ctx: this._ctx,
2240
- });
2210
+ prune = async () => {
2211
+ if (this._prune) {
2212
+ return;
2213
+ }
2214
+ await computeQuery([
2215
+ ...this._queryTree,
2216
+ {
2217
+ operation: "prune",
2218
+ },
2219
+ ], await this._ctx.connection());
2241
2220
  };
2242
- /**
2243
- * Returns a list of files and directories that matche the given pattern.
2244
- * @param pattern Pattern to match (e.g., "*.md").
2245
- */
2246
- glob = async (pattern) => {
2221
+ reservedSpace = async () => {
2222
+ if (this._reservedSpace) {
2223
+ return this._reservedSpace;
2224
+ }
2247
2225
  const response = await computeQuery([
2248
2226
  ...this._queryTree,
2249
2227
  {
2250
- operation: "glob",
2251
- args: { pattern },
2228
+ operation: "reservedSpace",
2252
2229
  },
2253
2230
  ], await this._ctx.connection());
2254
2231
  return response;
2255
2232
  };
2233
+ }
2234
+ /**
2235
+ * An individual cache entry in a cache entry set
2236
+ */
2237
+ export class EngineCacheEntry extends BaseClient {
2238
+ _id = undefined;
2239
+ _activelyUsed = undefined;
2240
+ _createdTimeUnixNano = undefined;
2241
+ _description = undefined;
2242
+ _diskSpaceBytes = undefined;
2243
+ _mostRecentUseTimeUnixNano = undefined;
2256
2244
  /**
2257
- * Force evaluation in the engine.
2245
+ * Constructor is used for internal usage only, do not create object from it.
2258
2246
  */
2259
- sync = async () => {
2247
+ constructor(parent, _id, _activelyUsed, _createdTimeUnixNano, _description, _diskSpaceBytes, _mostRecentUseTimeUnixNano) {
2248
+ super(parent);
2249
+ this._id = _id;
2250
+ this._activelyUsed = _activelyUsed;
2251
+ this._createdTimeUnixNano = _createdTimeUnixNano;
2252
+ this._description = _description;
2253
+ this._diskSpaceBytes = _diskSpaceBytes;
2254
+ this._mostRecentUseTimeUnixNano = _mostRecentUseTimeUnixNano;
2255
+ }
2256
+ /**
2257
+ * A unique identifier for this EngineCacheEntry.
2258
+ */
2259
+ id = async () => {
2260
+ if (this._id) {
2261
+ return this._id;
2262
+ }
2260
2263
  const response = await computeQuery([
2261
2264
  ...this._queryTree,
2262
2265
  {
2263
- operation: "sync",
2266
+ operation: "id",
2264
2267
  },
2265
2268
  ], await this._ctx.connection());
2266
- return new Directory({
2267
- queryTree: [
2268
- {
2269
- operation: "loadDirectoryFromID",
2270
- args: { id: response },
2271
- },
2272
- ],
2273
- ctx: this._ctx,
2274
- });
2275
- };
2276
- /**
2277
- * Opens an interactive terminal in new container with this directory mounted inside.
2278
- * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
2279
- * @param opts.experimentalPrivilegedNesting Provides Dagger access to the executed command.
2280
- *
2281
- * Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
2282
- * @param opts.insecureRootCapabilities Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
2283
- * @param opts.container If set, override the default container used for the terminal.
2284
- */
2285
- terminal = (opts) => {
2286
- return new Directory({
2287
- queryTree: [
2288
- ...this._queryTree,
2289
- {
2290
- operation: "terminal",
2291
- args: { ...opts },
2292
- },
2293
- ],
2294
- ctx: this._ctx,
2295
- });
2269
+ return response;
2296
2270
  };
2297
2271
  /**
2298
- * Retrieves this directory plus a directory written at the given path.
2299
- * @param path Location of the written directory (e.g., "/src/").
2300
- * @param directory Identifier of the directory to copy.
2301
- * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
2302
- * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
2272
+ * Whether the cache entry is actively being used.
2303
2273
  */
2304
- withDirectory = (path, directory, opts) => {
2305
- return new Directory({
2306
- queryTree: [
2307
- ...this._queryTree,
2308
- {
2309
- operation: "withDirectory",
2310
- args: { path, directory, ...opts },
2311
- },
2312
- ],
2313
- ctx: this._ctx,
2314
- });
2274
+ activelyUsed = async () => {
2275
+ if (this._activelyUsed) {
2276
+ return this._activelyUsed;
2277
+ }
2278
+ const response = await computeQuery([
2279
+ ...this._queryTree,
2280
+ {
2281
+ operation: "activelyUsed",
2282
+ },
2283
+ ], await this._ctx.connection());
2284
+ return response;
2315
2285
  };
2316
2286
  /**
2317
- * Retrieves this directory plus the contents of the given file copied to the given path.
2318
- * @param path Location of the copied file (e.g., "/file.txt").
2319
- * @param source Identifier of the file to copy.
2320
- * @param opts.permissions Permission given to the copied file (e.g., 0600).
2287
+ * The time the cache entry was created, in Unix nanoseconds.
2321
2288
  */
2322
- withFile = (path, source, opts) => {
2323
- return new Directory({
2324
- queryTree: [
2325
- ...this._queryTree,
2326
- {
2327
- operation: "withFile",
2328
- args: { path, source, ...opts },
2329
- },
2330
- ],
2331
- ctx: this._ctx,
2332
- });
2289
+ createdTimeUnixNano = async () => {
2290
+ if (this._createdTimeUnixNano) {
2291
+ return this._createdTimeUnixNano;
2292
+ }
2293
+ const response = await computeQuery([
2294
+ ...this._queryTree,
2295
+ {
2296
+ operation: "createdTimeUnixNano",
2297
+ },
2298
+ ], await this._ctx.connection());
2299
+ return response;
2333
2300
  };
2334
2301
  /**
2335
- * Retrieves this directory plus the contents of the given files copied to the given path.
2336
- * @param path Location where copied files should be placed (e.g., "/src").
2337
- * @param sources Identifiers of the files to copy.
2338
- * @param opts.permissions Permission given to the copied files (e.g., 0600).
2302
+ * The description of the cache entry.
2339
2303
  */
2340
- withFiles = (path, sources, opts) => {
2341
- return new Directory({
2342
- queryTree: [
2343
- ...this._queryTree,
2344
- {
2345
- operation: "withFiles",
2346
- args: { path, sources, ...opts },
2347
- },
2348
- ],
2349
- ctx: this._ctx,
2350
- });
2304
+ description = async () => {
2305
+ if (this._description) {
2306
+ return this._description;
2307
+ }
2308
+ const response = await computeQuery([
2309
+ ...this._queryTree,
2310
+ {
2311
+ operation: "description",
2312
+ },
2313
+ ], await this._ctx.connection());
2314
+ return response;
2351
2315
  };
2352
2316
  /**
2353
- * Retrieves this directory plus a new directory created at the given path.
2354
- * @param path Location of the directory created (e.g., "/logs").
2355
- * @param opts.permissions Permission granted to the created directory (e.g., 0777).
2317
+ * The disk space used by the cache entry.
2356
2318
  */
2357
- withNewDirectory = (path, opts) => {
2358
- return new Directory({
2359
- queryTree: [
2360
- ...this._queryTree,
2361
- {
2362
- operation: "withNewDirectory",
2363
- args: { path, ...opts },
2364
- },
2365
- ],
2366
- ctx: this._ctx,
2367
- });
2319
+ diskSpaceBytes = async () => {
2320
+ if (this._diskSpaceBytes) {
2321
+ return this._diskSpaceBytes;
2322
+ }
2323
+ const response = await computeQuery([
2324
+ ...this._queryTree,
2325
+ {
2326
+ operation: "diskSpaceBytes",
2327
+ },
2328
+ ], await this._ctx.connection());
2329
+ return response;
2368
2330
  };
2369
2331
  /**
2370
- * Retrieves this directory plus a new file written at the given path.
2371
- * @param path Location of the written file (e.g., "/file.txt").
2372
- * @param contents Content of the written file (e.g., "Hello world!").
2373
- * @param opts.permissions Permission given to the copied file (e.g., 0600).
2332
+ * The most recent time the cache entry was used, in Unix nanoseconds.
2374
2333
  */
2375
- withNewFile = (path, contents, opts) => {
2376
- return new Directory({
2377
- queryTree: [
2378
- ...this._queryTree,
2379
- {
2380
- operation: "withNewFile",
2381
- args: { path, contents, ...opts },
2382
- },
2383
- ],
2384
- ctx: this._ctx,
2385
- });
2334
+ mostRecentUseTimeUnixNano = async () => {
2335
+ if (this._mostRecentUseTimeUnixNano) {
2336
+ return this._mostRecentUseTimeUnixNano;
2337
+ }
2338
+ const response = await computeQuery([
2339
+ ...this._queryTree,
2340
+ {
2341
+ operation: "mostRecentUseTimeUnixNano",
2342
+ },
2343
+ ], await this._ctx.connection());
2344
+ return response;
2386
2345
  };
2346
+ }
2347
+ /**
2348
+ * A set of cache entries returned by a query to a cache
2349
+ */
2350
+ export class EngineCacheEntrySet extends BaseClient {
2351
+ _id = undefined;
2352
+ _diskSpaceBytes = undefined;
2353
+ _entryCount = undefined;
2387
2354
  /**
2388
- * Retrieves this directory with all file/dir timestamps set to the given time.
2389
- * @param timestamp Timestamp to set dir/files in.
2390
- *
2391
- * Formatted in seconds following Unix epoch (e.g., 1672531199).
2355
+ * Constructor is used for internal usage only, do not create object from it.
2392
2356
  */
2393
- withTimestamps = (timestamp) => {
2394
- return new Directory({
2395
- queryTree: [
2396
- ...this._queryTree,
2397
- {
2398
- operation: "withTimestamps",
2399
- args: { timestamp },
2400
- },
2401
- ],
2402
- ctx: this._ctx,
2403
- });
2404
- };
2357
+ constructor(parent, _id, _diskSpaceBytes, _entryCount) {
2358
+ super(parent);
2359
+ this._id = _id;
2360
+ this._diskSpaceBytes = _diskSpaceBytes;
2361
+ this._entryCount = _entryCount;
2362
+ }
2405
2363
  /**
2406
- * Retrieves this directory with the directory at the given path removed.
2407
- * @param path Location of the directory to remove (e.g., ".github/").
2364
+ * A unique identifier for this EngineCacheEntrySet.
2408
2365
  */
2409
- withoutDirectory = (path) => {
2410
- return new Directory({
2411
- queryTree: [
2412
- ...this._queryTree,
2413
- {
2414
- operation: "withoutDirectory",
2415
- args: { path },
2416
- },
2417
- ],
2418
- ctx: this._ctx,
2419
- });
2366
+ id = async () => {
2367
+ if (this._id) {
2368
+ return this._id;
2369
+ }
2370
+ const response = await computeQuery([
2371
+ ...this._queryTree,
2372
+ {
2373
+ operation: "id",
2374
+ },
2375
+ ], await this._ctx.connection());
2376
+ return response;
2420
2377
  };
2421
2378
  /**
2422
- * Retrieves this directory with the file at the given path removed.
2423
- * @param path Location of the file to remove (e.g., "/file.txt").
2379
+ * The total disk space used by the cache entries in this set.
2424
2380
  */
2425
- withoutFile = (path) => {
2426
- return new Directory({
2427
- queryTree: [
2428
- ...this._queryTree,
2429
- {
2430
- operation: "withoutFile",
2431
- args: { path },
2432
- },
2433
- ],
2434
- ctx: this._ctx,
2435
- });
2381
+ diskSpaceBytes = async () => {
2382
+ if (this._diskSpaceBytes) {
2383
+ return this._diskSpaceBytes;
2384
+ }
2385
+ const response = await computeQuery([
2386
+ ...this._queryTree,
2387
+ {
2388
+ operation: "diskSpaceBytes",
2389
+ },
2390
+ ], await this._ctx.connection());
2391
+ return response;
2436
2392
  };
2437
2393
  /**
2438
- * Retrieves this directory with the files at the given paths removed.
2439
- * @param paths Location of the file to remove (e.g., ["/file.txt"]).
2394
+ * The list of individual cache entries in the set
2440
2395
  */
2441
- withoutFiles = (paths) => {
2442
- return new Directory({
2396
+ entries = async () => {
2397
+ const response = await computeQuery([
2398
+ ...this._queryTree,
2399
+ {
2400
+ operation: "entries",
2401
+ },
2402
+ {
2403
+ operation: "id",
2404
+ },
2405
+ ], await this._ctx.connection());
2406
+ return response.map((r) => new EngineCacheEntry({
2443
2407
  queryTree: [
2444
- ...this._queryTree,
2445
2408
  {
2446
- operation: "withoutFiles",
2447
- args: { paths },
2409
+ operation: "loadEngineCacheEntryFromID",
2410
+ args: { id: r.id },
2448
2411
  },
2449
2412
  ],
2450
2413
  ctx: this._ctx,
2451
- });
2414
+ }, r.id));
2452
2415
  };
2453
2416
  /**
2454
- * Call the provided function with current Directory.
2455
- *
2456
- * This is useful for reusability and readability by not breaking the calling chain.
2417
+ * The number of cache entries in this set.
2457
2418
  */
2458
- with = (arg) => {
2459
- return arg(this);
2419
+ entryCount = async () => {
2420
+ if (this._entryCount) {
2421
+ return this._entryCount;
2422
+ }
2423
+ const response = await computeQuery([
2424
+ ...this._queryTree,
2425
+ {
2426
+ operation: "entryCount",
2427
+ },
2428
+ ], await this._ctx.connection());
2429
+ return response;
2460
2430
  };
2461
2431
  }
2462
2432
  /**
@@ -5843,20 +5813,6 @@ export class Client extends BaseClient {
5843
5813
  ctx: this._ctx,
5844
5814
  }, r.id));
5845
5815
  };
5846
- /**
5847
- * The Dagger engine container configuration and state
5848
- */
5849
- daggerEngine = () => {
5850
- return new DaggerEngine({
5851
- queryTree: [
5852
- ...this._queryTree,
5853
- {
5854
- operation: "daggerEngine",
5855
- },
5856
- ],
5857
- ctx: this._ctx,
5858
- });
5859
- };
5860
5816
  /**
5861
5817
  * The default platform of the engine.
5862
5818
  */
@@ -5883,6 +5839,20 @@ export class Client extends BaseClient {
5883
5839
  ctx: this._ctx,
5884
5840
  });
5885
5841
  };
5842
+ /**
5843
+ * The Dagger engine container configuration and state
5844
+ */
5845
+ engine = () => {
5846
+ return new Engine({
5847
+ queryTree: [
5848
+ ...this._queryTree,
5849
+ {
5850
+ operation: "engine",
5851
+ },
5852
+ ],
5853
+ ctx: this._ctx,
5854
+ });
5855
+ };
5886
5856
  /**
5887
5857
  * Creates a function.
5888
5858
  * @param name Name of the function, in its original format from the implementation language.
@@ -6016,14 +5986,14 @@ export class Client extends BaseClient {
6016
5986
  });
6017
5987
  };
6018
5988
  /**
6019
- * Load a DaggerEngineCacheEntry from its ID.
5989
+ * Load a Directory from its ID.
6020
5990
  */
6021
- loadDaggerEngineCacheEntryFromID = (id) => {
6022
- return new DaggerEngineCacheEntry({
5991
+ loadDirectoryFromID = (id) => {
5992
+ return new Directory({
6023
5993
  queryTree: [
6024
5994
  ...this._queryTree,
6025
5995
  {
6026
- operation: "loadDaggerEngineCacheEntryFromID",
5996
+ operation: "loadDirectoryFromID",
6027
5997
  args: { id },
6028
5998
  },
6029
5999
  ],
@@ -6031,14 +6001,14 @@ export class Client extends BaseClient {
6031
6001
  });
6032
6002
  };
6033
6003
  /**
6034
- * Load a DaggerEngineCacheEntrySet from its ID.
6004
+ * Load a EngineCacheEntry from its ID.
6035
6005
  */
6036
- loadDaggerEngineCacheEntrySetFromID = (id) => {
6037
- return new DaggerEngineCacheEntrySet({
6006
+ loadEngineCacheEntryFromID = (id) => {
6007
+ return new EngineCacheEntry({
6038
6008
  queryTree: [
6039
6009
  ...this._queryTree,
6040
6010
  {
6041
- operation: "loadDaggerEngineCacheEntrySetFromID",
6011
+ operation: "loadEngineCacheEntryFromID",
6042
6012
  args: { id },
6043
6013
  },
6044
6014
  ],
@@ -6046,14 +6016,14 @@ export class Client extends BaseClient {
6046
6016
  });
6047
6017
  };
6048
6018
  /**
6049
- * Load a DaggerEngineCache from its ID.
6019
+ * Load a EngineCacheEntrySet from its ID.
6050
6020
  */
6051
- loadDaggerEngineCacheFromID = (id) => {
6052
- return new DaggerEngineCache({
6021
+ loadEngineCacheEntrySetFromID = (id) => {
6022
+ return new EngineCacheEntrySet({
6053
6023
  queryTree: [
6054
6024
  ...this._queryTree,
6055
6025
  {
6056
- operation: "loadDaggerEngineCacheFromID",
6026
+ operation: "loadEngineCacheEntrySetFromID",
6057
6027
  args: { id },
6058
6028
  },
6059
6029
  ],
@@ -6061,14 +6031,14 @@ export class Client extends BaseClient {
6061
6031
  });
6062
6032
  };
6063
6033
  /**
6064
- * Load a DaggerEngine from its ID.
6034
+ * Load a EngineCache from its ID.
6065
6035
  */
6066
- loadDaggerEngineFromID = (id) => {
6067
- return new DaggerEngine({
6036
+ loadEngineCacheFromID = (id) => {
6037
+ return new EngineCache({
6068
6038
  queryTree: [
6069
6039
  ...this._queryTree,
6070
6040
  {
6071
- operation: "loadDaggerEngineFromID",
6041
+ operation: "loadEngineCacheFromID",
6072
6042
  args: { id },
6073
6043
  },
6074
6044
  ],
@@ -6076,14 +6046,14 @@ export class Client extends BaseClient {
6076
6046
  });
6077
6047
  };
6078
6048
  /**
6079
- * Load a Directory from its ID.
6049
+ * Load a Engine from its ID.
6080
6050
  */
6081
- loadDirectoryFromID = (id) => {
6082
- return new Directory({
6051
+ loadEngineFromID = (id) => {
6052
+ return new Engine({
6083
6053
  queryTree: [
6084
6054
  ...this._queryTree,
6085
6055
  {
6086
- operation: "loadDirectoryFromID",
6056
+ operation: "loadEngineFromID",
6087
6057
  args: { id },
6088
6058
  },
6089
6059
  ],