@dagger.io/dagger 0.11.9 → 0.12.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/api/client.gen.d.ts +387 -69
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +804 -96
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +1 -2
- package/dist/entrypoint/invoke.d.ts.map +1 -1
- package/dist/entrypoint/invoke.js +7 -3
- package/dist/entrypoint/load.d.ts +3 -2
- package/dist/entrypoint/load.d.ts.map +1 -1
- package/dist/entrypoint/load.js +9 -1
- package/dist/entrypoint/register.d.ts.map +1 -1
- package/dist/entrypoint/register.js +40 -10
- package/dist/introspector/decorators/decorators.d.ts +5 -1
- package/dist/introspector/decorators/decorators.d.ts.map +1 -1
- package/dist/introspector/decorators/decorators.js +4 -0
- package/dist/introspector/registry/registry.d.ts +8 -2
- package/dist/introspector/registry/registry.d.ts.map +1 -1
- package/dist/introspector/registry/registry.js +11 -1
- package/dist/introspector/scanner/abtractions/argument.d.ts +23 -2
- package/dist/introspector/scanner/abtractions/argument.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/argument.js +71 -38
- package/dist/introspector/scanner/abtractions/constructor.d.ts +3 -2
- package/dist/introspector/scanner/abtractions/constructor.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/constructor.js +17 -19
- package/dist/introspector/scanner/abtractions/enum.d.ts +33 -0
- package/dist/introspector/scanner/abtractions/enum.d.ts.map +1 -0
- package/dist/introspector/scanner/abtractions/enum.js +73 -0
- package/dist/introspector/scanner/abtractions/enumValue.d.ts +24 -0
- package/dist/introspector/scanner/abtractions/enumValue.d.ts.map +1 -0
- package/dist/introspector/scanner/abtractions/enumValue.js +51 -0
- package/dist/introspector/scanner/abtractions/method.d.ts +19 -3
- package/dist/introspector/scanner/abtractions/method.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/method.js +61 -33
- package/dist/introspector/scanner/abtractions/module.d.ts +12 -4
- package/dist/introspector/scanner/abtractions/module.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/module.js +58 -14
- package/dist/introspector/scanner/abtractions/object.d.ts +17 -2
- package/dist/introspector/scanner/abtractions/object.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/object.js +57 -33
- package/dist/introspector/scanner/abtractions/property.d.ts +11 -2
- package/dist/introspector/scanner/abtractions/property.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/property.js +49 -30
- package/dist/introspector/scanner/abtractions/typeToTypedef.d.ts +8 -0
- package/dist/introspector/scanner/abtractions/typeToTypedef.d.ts.map +1 -0
- package/dist/introspector/scanner/abtractions/typeToTypedef.js +76 -0
- package/dist/introspector/scanner/scan.d.ts +0 -12
- package/dist/introspector/scanner/scan.d.ts.map +1 -1
- package/dist/introspector/scanner/typeDefs.d.ts +8 -53
- package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.d.ts +1 -1
- package/dist/introspector/scanner/utils.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.js +15 -7
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/package.json +1 -1
package/dist/api/client.gen.js
CHANGED
|
@@ -82,6 +82,12 @@ export var TypeDefKind;
|
|
|
82
82
|
* A boolean value.
|
|
83
83
|
*/
|
|
84
84
|
TypeDefKind["BooleanKind"] = "BOOLEAN_KIND";
|
|
85
|
+
/**
|
|
86
|
+
* A GraphQL enum type and its values
|
|
87
|
+
*
|
|
88
|
+
* Always paired with an EnumTypeDef.
|
|
89
|
+
*/
|
|
90
|
+
TypeDefKind["EnumKind"] = "ENUM_KIND";
|
|
85
91
|
/**
|
|
86
92
|
* A graphql input type, used only when representing the core API via TypeDefs.
|
|
87
93
|
*/
|
|
@@ -391,8 +397,6 @@ export class Container extends BaseClient {
|
|
|
391
397
|
/**
|
|
392
398
|
* Writes the container as an OCI tarball to the destination file path on the host.
|
|
393
399
|
*
|
|
394
|
-
* Return true on success.
|
|
395
|
-
*
|
|
396
400
|
* It can also export platform variants.
|
|
397
401
|
* @param path Host's destination path (e.g., "./tarball").
|
|
398
402
|
*
|
|
@@ -692,16 +696,24 @@ export class Container extends BaseClient {
|
|
|
692
696
|
* It doesn't run the default command if no exec has been set.
|
|
693
697
|
*/
|
|
694
698
|
sync = async () => {
|
|
695
|
-
await computeQuery([
|
|
699
|
+
const response = await computeQuery([
|
|
696
700
|
...this._queryTree,
|
|
697
701
|
{
|
|
698
702
|
operation: "sync",
|
|
699
703
|
},
|
|
700
704
|
], await this._ctx.connection());
|
|
701
|
-
return
|
|
705
|
+
return new Container({
|
|
706
|
+
queryTree: [
|
|
707
|
+
{
|
|
708
|
+
operation: "loadContainerFromID",
|
|
709
|
+
args: { id: response },
|
|
710
|
+
},
|
|
711
|
+
],
|
|
712
|
+
ctx: this._ctx,
|
|
713
|
+
});
|
|
702
714
|
};
|
|
703
715
|
/**
|
|
704
|
-
*
|
|
716
|
+
* Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
|
|
705
717
|
* @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
|
|
706
718
|
* @param opts.experimentalPrivilegedNesting Provides Dagger access to the executed command.
|
|
707
719
|
*
|
|
@@ -709,7 +721,7 @@ export class Container extends BaseClient {
|
|
|
709
721
|
* @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.
|
|
710
722
|
*/
|
|
711
723
|
terminal = (opts) => {
|
|
712
|
-
return new
|
|
724
|
+
return new Container({
|
|
713
725
|
queryTree: [
|
|
714
726
|
...this._queryTree,
|
|
715
727
|
{
|
|
@@ -835,7 +847,8 @@ export class Container extends BaseClient {
|
|
|
835
847
|
* @param args Command to run instead of the container's default command (e.g., ["run", "main.go"]).
|
|
836
848
|
*
|
|
837
849
|
* If empty, the container's default command is used.
|
|
838
|
-
* @param opts.skipEntrypoint
|
|
850
|
+
* @param opts.skipEntrypoint DEPRECATED: For true this can be removed. For false, use `useEntrypoint` instead.
|
|
851
|
+
* @param opts.useEntrypoint If the container has an entrypoint, prepend it to the args.
|
|
839
852
|
* @param opts.stdin Content to write to the command's standard input before closing (e.g., "Hello world").
|
|
840
853
|
* @param opts.redirectStdout Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
|
|
841
854
|
* @param opts.redirectStderr Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
|
|
@@ -1078,7 +1091,7 @@ export class Container extends BaseClient {
|
|
|
1078
1091
|
/**
|
|
1079
1092
|
* Retrieves this container plus a new file written at the given path.
|
|
1080
1093
|
* @param path Location of the written file (e.g., "/tmp/file.txt").
|
|
1081
|
-
* @param
|
|
1094
|
+
* @param contents Content of the file to write (e.g., "Hello world!").
|
|
1082
1095
|
* @param opts.permissions Permission given to the written file (e.g., 0600).
|
|
1083
1096
|
* @param opts.owner A user:group to set for the file.
|
|
1084
1097
|
*
|
|
@@ -1086,13 +1099,13 @@ export class Container extends BaseClient {
|
|
|
1086
1099
|
*
|
|
1087
1100
|
* If the group is omitted, it defaults to the same as the user.
|
|
1088
1101
|
*/
|
|
1089
|
-
withNewFile = (path, opts) => {
|
|
1102
|
+
withNewFile = (path, contents, opts) => {
|
|
1090
1103
|
return new Container({
|
|
1091
1104
|
queryTree: [
|
|
1092
1105
|
...this._queryTree,
|
|
1093
1106
|
{
|
|
1094
1107
|
operation: "withNewFile",
|
|
1095
|
-
args: { path, ...opts },
|
|
1108
|
+
args: { path, contents, ...opts },
|
|
1096
1109
|
},
|
|
1097
1110
|
],
|
|
1098
1111
|
ctx: this._ctx,
|
|
@@ -1573,6 +1586,321 @@ export class CurrentModule extends BaseClient {
|
|
|
1573
1586
|
});
|
|
1574
1587
|
};
|
|
1575
1588
|
}
|
|
1589
|
+
/**
|
|
1590
|
+
* The Dagger engine configuration and state
|
|
1591
|
+
*/
|
|
1592
|
+
export class DaggerEngine extends BaseClient {
|
|
1593
|
+
_id = undefined;
|
|
1594
|
+
/**
|
|
1595
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1596
|
+
*/
|
|
1597
|
+
constructor(parent, _id) {
|
|
1598
|
+
super(parent);
|
|
1599
|
+
this._id = _id;
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* A unique identifier for this DaggerEngine.
|
|
1603
|
+
*/
|
|
1604
|
+
id = async () => {
|
|
1605
|
+
if (this._id) {
|
|
1606
|
+
return this._id;
|
|
1607
|
+
}
|
|
1608
|
+
const response = await computeQuery([
|
|
1609
|
+
...this._queryTree,
|
|
1610
|
+
{
|
|
1611
|
+
operation: "id",
|
|
1612
|
+
},
|
|
1613
|
+
], await this._ctx.connection());
|
|
1614
|
+
return response;
|
|
1615
|
+
};
|
|
1616
|
+
/**
|
|
1617
|
+
* The local (on-disk) cache for the Dagger engine
|
|
1618
|
+
*/
|
|
1619
|
+
localCache = () => {
|
|
1620
|
+
return new DaggerEngineCache({
|
|
1621
|
+
queryTree: [
|
|
1622
|
+
...this._queryTree,
|
|
1623
|
+
{
|
|
1624
|
+
operation: "localCache",
|
|
1625
|
+
},
|
|
1626
|
+
],
|
|
1627
|
+
ctx: this._ctx,
|
|
1628
|
+
});
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* A cache storage for the Dagger engine
|
|
1633
|
+
*/
|
|
1634
|
+
export class DaggerEngineCache extends BaseClient {
|
|
1635
|
+
_id = undefined;
|
|
1636
|
+
_keepBytes = undefined;
|
|
1637
|
+
_prune = undefined;
|
|
1638
|
+
/**
|
|
1639
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1640
|
+
*/
|
|
1641
|
+
constructor(parent, _id, _keepBytes, _prune) {
|
|
1642
|
+
super(parent);
|
|
1643
|
+
this._id = _id;
|
|
1644
|
+
this._keepBytes = _keepBytes;
|
|
1645
|
+
this._prune = _prune;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* A unique identifier for this DaggerEngineCache.
|
|
1649
|
+
*/
|
|
1650
|
+
id = async () => {
|
|
1651
|
+
if (this._id) {
|
|
1652
|
+
return this._id;
|
|
1653
|
+
}
|
|
1654
|
+
const response = await computeQuery([
|
|
1655
|
+
...this._queryTree,
|
|
1656
|
+
{
|
|
1657
|
+
operation: "id",
|
|
1658
|
+
},
|
|
1659
|
+
], await this._ctx.connection());
|
|
1660
|
+
return response;
|
|
1661
|
+
};
|
|
1662
|
+
/**
|
|
1663
|
+
* The current set of entries in the cache
|
|
1664
|
+
*/
|
|
1665
|
+
entrySet = () => {
|
|
1666
|
+
return new DaggerEngineCacheEntrySet({
|
|
1667
|
+
queryTree: [
|
|
1668
|
+
...this._queryTree,
|
|
1669
|
+
{
|
|
1670
|
+
operation: "entrySet",
|
|
1671
|
+
},
|
|
1672
|
+
],
|
|
1673
|
+
ctx: this._ctx,
|
|
1674
|
+
});
|
|
1675
|
+
};
|
|
1676
|
+
/**
|
|
1677
|
+
* The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
|
|
1678
|
+
*/
|
|
1679
|
+
keepBytes = async () => {
|
|
1680
|
+
if (this._keepBytes) {
|
|
1681
|
+
return this._keepBytes;
|
|
1682
|
+
}
|
|
1683
|
+
const response = await computeQuery([
|
|
1684
|
+
...this._queryTree,
|
|
1685
|
+
{
|
|
1686
|
+
operation: "keepBytes",
|
|
1687
|
+
},
|
|
1688
|
+
], await this._ctx.connection());
|
|
1689
|
+
return response;
|
|
1690
|
+
};
|
|
1691
|
+
/**
|
|
1692
|
+
* Prune the cache of releaseable entries
|
|
1693
|
+
*/
|
|
1694
|
+
prune = async () => {
|
|
1695
|
+
if (this._prune) {
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
await computeQuery([
|
|
1699
|
+
...this._queryTree,
|
|
1700
|
+
{
|
|
1701
|
+
operation: "prune",
|
|
1702
|
+
},
|
|
1703
|
+
], await this._ctx.connection());
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* An individual cache entry in a cache entry set
|
|
1708
|
+
*/
|
|
1709
|
+
export class DaggerEngineCacheEntry extends BaseClient {
|
|
1710
|
+
_id = undefined;
|
|
1711
|
+
_activelyUsed = undefined;
|
|
1712
|
+
_createdTimeUnixNano = undefined;
|
|
1713
|
+
_description = undefined;
|
|
1714
|
+
_diskSpaceBytes = undefined;
|
|
1715
|
+
_mostRecentUseTimeUnixNano = undefined;
|
|
1716
|
+
/**
|
|
1717
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1718
|
+
*/
|
|
1719
|
+
constructor(parent, _id, _activelyUsed, _createdTimeUnixNano, _description, _diskSpaceBytes, _mostRecentUseTimeUnixNano) {
|
|
1720
|
+
super(parent);
|
|
1721
|
+
this._id = _id;
|
|
1722
|
+
this._activelyUsed = _activelyUsed;
|
|
1723
|
+
this._createdTimeUnixNano = _createdTimeUnixNano;
|
|
1724
|
+
this._description = _description;
|
|
1725
|
+
this._diskSpaceBytes = _diskSpaceBytes;
|
|
1726
|
+
this._mostRecentUseTimeUnixNano = _mostRecentUseTimeUnixNano;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* A unique identifier for this DaggerEngineCacheEntry.
|
|
1730
|
+
*/
|
|
1731
|
+
id = async () => {
|
|
1732
|
+
if (this._id) {
|
|
1733
|
+
return this._id;
|
|
1734
|
+
}
|
|
1735
|
+
const response = await computeQuery([
|
|
1736
|
+
...this._queryTree,
|
|
1737
|
+
{
|
|
1738
|
+
operation: "id",
|
|
1739
|
+
},
|
|
1740
|
+
], await this._ctx.connection());
|
|
1741
|
+
return response;
|
|
1742
|
+
};
|
|
1743
|
+
/**
|
|
1744
|
+
* Whether the cache entry is actively being used.
|
|
1745
|
+
*/
|
|
1746
|
+
activelyUsed = async () => {
|
|
1747
|
+
if (this._activelyUsed) {
|
|
1748
|
+
return this._activelyUsed;
|
|
1749
|
+
}
|
|
1750
|
+
const response = await computeQuery([
|
|
1751
|
+
...this._queryTree,
|
|
1752
|
+
{
|
|
1753
|
+
operation: "activelyUsed",
|
|
1754
|
+
},
|
|
1755
|
+
], await this._ctx.connection());
|
|
1756
|
+
return response;
|
|
1757
|
+
};
|
|
1758
|
+
/**
|
|
1759
|
+
* The time the cache entry was created, in Unix nanoseconds.
|
|
1760
|
+
*/
|
|
1761
|
+
createdTimeUnixNano = async () => {
|
|
1762
|
+
if (this._createdTimeUnixNano) {
|
|
1763
|
+
return this._createdTimeUnixNano;
|
|
1764
|
+
}
|
|
1765
|
+
const response = await computeQuery([
|
|
1766
|
+
...this._queryTree,
|
|
1767
|
+
{
|
|
1768
|
+
operation: "createdTimeUnixNano",
|
|
1769
|
+
},
|
|
1770
|
+
], await this._ctx.connection());
|
|
1771
|
+
return response;
|
|
1772
|
+
};
|
|
1773
|
+
/**
|
|
1774
|
+
* The description of the cache entry.
|
|
1775
|
+
*/
|
|
1776
|
+
description = async () => {
|
|
1777
|
+
if (this._description) {
|
|
1778
|
+
return this._description;
|
|
1779
|
+
}
|
|
1780
|
+
const response = await computeQuery([
|
|
1781
|
+
...this._queryTree,
|
|
1782
|
+
{
|
|
1783
|
+
operation: "description",
|
|
1784
|
+
},
|
|
1785
|
+
], await this._ctx.connection());
|
|
1786
|
+
return response;
|
|
1787
|
+
};
|
|
1788
|
+
/**
|
|
1789
|
+
* The disk space used by the cache entry.
|
|
1790
|
+
*/
|
|
1791
|
+
diskSpaceBytes = async () => {
|
|
1792
|
+
if (this._diskSpaceBytes) {
|
|
1793
|
+
return this._diskSpaceBytes;
|
|
1794
|
+
}
|
|
1795
|
+
const response = await computeQuery([
|
|
1796
|
+
...this._queryTree,
|
|
1797
|
+
{
|
|
1798
|
+
operation: "diskSpaceBytes",
|
|
1799
|
+
},
|
|
1800
|
+
], await this._ctx.connection());
|
|
1801
|
+
return response;
|
|
1802
|
+
};
|
|
1803
|
+
/**
|
|
1804
|
+
* The most recent time the cache entry was used, in Unix nanoseconds.
|
|
1805
|
+
*/
|
|
1806
|
+
mostRecentUseTimeUnixNano = async () => {
|
|
1807
|
+
if (this._mostRecentUseTimeUnixNano) {
|
|
1808
|
+
return this._mostRecentUseTimeUnixNano;
|
|
1809
|
+
}
|
|
1810
|
+
const response = await computeQuery([
|
|
1811
|
+
...this._queryTree,
|
|
1812
|
+
{
|
|
1813
|
+
operation: "mostRecentUseTimeUnixNano",
|
|
1814
|
+
},
|
|
1815
|
+
], await this._ctx.connection());
|
|
1816
|
+
return response;
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* A set of cache entries returned by a query to a cache
|
|
1821
|
+
*/
|
|
1822
|
+
export class DaggerEngineCacheEntrySet extends BaseClient {
|
|
1823
|
+
_id = undefined;
|
|
1824
|
+
_diskSpaceBytes = undefined;
|
|
1825
|
+
_entryCount = undefined;
|
|
1826
|
+
/**
|
|
1827
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1828
|
+
*/
|
|
1829
|
+
constructor(parent, _id, _diskSpaceBytes, _entryCount) {
|
|
1830
|
+
super(parent);
|
|
1831
|
+
this._id = _id;
|
|
1832
|
+
this._diskSpaceBytes = _diskSpaceBytes;
|
|
1833
|
+
this._entryCount = _entryCount;
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* A unique identifier for this DaggerEngineCacheEntrySet.
|
|
1837
|
+
*/
|
|
1838
|
+
id = async () => {
|
|
1839
|
+
if (this._id) {
|
|
1840
|
+
return this._id;
|
|
1841
|
+
}
|
|
1842
|
+
const response = await computeQuery([
|
|
1843
|
+
...this._queryTree,
|
|
1844
|
+
{
|
|
1845
|
+
operation: "id",
|
|
1846
|
+
},
|
|
1847
|
+
], await this._ctx.connection());
|
|
1848
|
+
return response;
|
|
1849
|
+
};
|
|
1850
|
+
/**
|
|
1851
|
+
* The total disk space used by the cache entries in this set.
|
|
1852
|
+
*/
|
|
1853
|
+
diskSpaceBytes = async () => {
|
|
1854
|
+
if (this._diskSpaceBytes) {
|
|
1855
|
+
return this._diskSpaceBytes;
|
|
1856
|
+
}
|
|
1857
|
+
const response = await computeQuery([
|
|
1858
|
+
...this._queryTree,
|
|
1859
|
+
{
|
|
1860
|
+
operation: "diskSpaceBytes",
|
|
1861
|
+
},
|
|
1862
|
+
], await this._ctx.connection());
|
|
1863
|
+
return response;
|
|
1864
|
+
};
|
|
1865
|
+
/**
|
|
1866
|
+
* The list of individual cache entries in the set
|
|
1867
|
+
*/
|
|
1868
|
+
entries = async () => {
|
|
1869
|
+
const response = await computeQuery([
|
|
1870
|
+
...this._queryTree,
|
|
1871
|
+
{
|
|
1872
|
+
operation: "entries",
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
operation: "id",
|
|
1876
|
+
},
|
|
1877
|
+
], await this._ctx.connection());
|
|
1878
|
+
return response.map((r) => new DaggerEngineCacheEntry({
|
|
1879
|
+
queryTree: [
|
|
1880
|
+
{
|
|
1881
|
+
operation: "loadDaggerEngineCacheEntryFromID",
|
|
1882
|
+
args: { id: r.id },
|
|
1883
|
+
},
|
|
1884
|
+
],
|
|
1885
|
+
ctx: this._ctx,
|
|
1886
|
+
}, r.id));
|
|
1887
|
+
};
|
|
1888
|
+
/**
|
|
1889
|
+
* The number of cache entries in this set.
|
|
1890
|
+
*/
|
|
1891
|
+
entryCount = async () => {
|
|
1892
|
+
if (this._entryCount) {
|
|
1893
|
+
return this._entryCount;
|
|
1894
|
+
}
|
|
1895
|
+
const response = await computeQuery([
|
|
1896
|
+
...this._queryTree,
|
|
1897
|
+
{
|
|
1898
|
+
operation: "entryCount",
|
|
1899
|
+
},
|
|
1900
|
+
], await this._ctx.connection());
|
|
1901
|
+
return response;
|
|
1902
|
+
};
|
|
1903
|
+
}
|
|
1576
1904
|
/**
|
|
1577
1905
|
* A directory.
|
|
1578
1906
|
*/
|
|
@@ -1611,6 +1939,7 @@ export class Directory extends BaseClient {
|
|
|
1611
1939
|
* 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.
|
|
1612
1940
|
*
|
|
1613
1941
|
* If not set, the module source code is loaded from the root of the directory.
|
|
1942
|
+
* @param opts.engineVersion The engine version to upgrade to.
|
|
1614
1943
|
*/
|
|
1615
1944
|
asModule = (opts) => {
|
|
1616
1945
|
return new Module_({
|
|
@@ -1762,13 +2091,42 @@ export class Directory extends BaseClient {
|
|
|
1762
2091
|
* Force evaluation in the engine.
|
|
1763
2092
|
*/
|
|
1764
2093
|
sync = async () => {
|
|
1765
|
-
await computeQuery([
|
|
2094
|
+
const response = await computeQuery([
|
|
1766
2095
|
...this._queryTree,
|
|
1767
2096
|
{
|
|
1768
2097
|
operation: "sync",
|
|
1769
2098
|
},
|
|
1770
2099
|
], await this._ctx.connection());
|
|
1771
|
-
return
|
|
2100
|
+
return new Directory({
|
|
2101
|
+
queryTree: [
|
|
2102
|
+
{
|
|
2103
|
+
operation: "loadDirectoryFromID",
|
|
2104
|
+
args: { id: response },
|
|
2105
|
+
},
|
|
2106
|
+
],
|
|
2107
|
+
ctx: this._ctx,
|
|
2108
|
+
});
|
|
2109
|
+
};
|
|
2110
|
+
/**
|
|
2111
|
+
* Opens an interactive terminal in new container with this directory mounted inside.
|
|
2112
|
+
* @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
|
|
2113
|
+
* @param opts.experimentalPrivilegedNesting Provides Dagger access to the executed command.
|
|
2114
|
+
*
|
|
2115
|
+
* 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.
|
|
2116
|
+
* @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.
|
|
2117
|
+
* @param opts.container If set, override the default container used for the terminal.
|
|
2118
|
+
*/
|
|
2119
|
+
terminal = (opts) => {
|
|
2120
|
+
return new Directory({
|
|
2121
|
+
queryTree: [
|
|
2122
|
+
...this._queryTree,
|
|
2123
|
+
{
|
|
2124
|
+
operation: "terminal",
|
|
2125
|
+
args: { ...opts },
|
|
2126
|
+
},
|
|
2127
|
+
],
|
|
2128
|
+
ctx: this._ctx,
|
|
2129
|
+
});
|
|
1772
2130
|
};
|
|
1773
2131
|
/**
|
|
1774
2132
|
* Retrieves this directory plus a directory written at the given path.
|
|
@@ -1919,6 +2277,170 @@ export class Directory extends BaseClient {
|
|
|
1919
2277
|
return arg(this);
|
|
1920
2278
|
};
|
|
1921
2279
|
}
|
|
2280
|
+
/**
|
|
2281
|
+
* A definition of a custom enum defined in a Module.
|
|
2282
|
+
*/
|
|
2283
|
+
export class EnumTypeDef extends BaseClient {
|
|
2284
|
+
_id = undefined;
|
|
2285
|
+
_description = undefined;
|
|
2286
|
+
_name = undefined;
|
|
2287
|
+
_sourceModuleName = undefined;
|
|
2288
|
+
/**
|
|
2289
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2290
|
+
*/
|
|
2291
|
+
constructor(parent, _id, _description, _name, _sourceModuleName) {
|
|
2292
|
+
super(parent);
|
|
2293
|
+
this._id = _id;
|
|
2294
|
+
this._description = _description;
|
|
2295
|
+
this._name = _name;
|
|
2296
|
+
this._sourceModuleName = _sourceModuleName;
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* A unique identifier for this EnumTypeDef.
|
|
2300
|
+
*/
|
|
2301
|
+
id = async () => {
|
|
2302
|
+
if (this._id) {
|
|
2303
|
+
return this._id;
|
|
2304
|
+
}
|
|
2305
|
+
const response = await computeQuery([
|
|
2306
|
+
...this._queryTree,
|
|
2307
|
+
{
|
|
2308
|
+
operation: "id",
|
|
2309
|
+
},
|
|
2310
|
+
], await this._ctx.connection());
|
|
2311
|
+
return response;
|
|
2312
|
+
};
|
|
2313
|
+
/**
|
|
2314
|
+
* A doc string for the enum, if any.
|
|
2315
|
+
*/
|
|
2316
|
+
description = async () => {
|
|
2317
|
+
if (this._description) {
|
|
2318
|
+
return this._description;
|
|
2319
|
+
}
|
|
2320
|
+
const response = await computeQuery([
|
|
2321
|
+
...this._queryTree,
|
|
2322
|
+
{
|
|
2323
|
+
operation: "description",
|
|
2324
|
+
},
|
|
2325
|
+
], await this._ctx.connection());
|
|
2326
|
+
return response;
|
|
2327
|
+
};
|
|
2328
|
+
/**
|
|
2329
|
+
* The name of the enum.
|
|
2330
|
+
*/
|
|
2331
|
+
name = async () => {
|
|
2332
|
+
if (this._name) {
|
|
2333
|
+
return this._name;
|
|
2334
|
+
}
|
|
2335
|
+
const response = await computeQuery([
|
|
2336
|
+
...this._queryTree,
|
|
2337
|
+
{
|
|
2338
|
+
operation: "name",
|
|
2339
|
+
},
|
|
2340
|
+
], await this._ctx.connection());
|
|
2341
|
+
return response;
|
|
2342
|
+
};
|
|
2343
|
+
/**
|
|
2344
|
+
* If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise.
|
|
2345
|
+
*/
|
|
2346
|
+
sourceModuleName = async () => {
|
|
2347
|
+
if (this._sourceModuleName) {
|
|
2348
|
+
return this._sourceModuleName;
|
|
2349
|
+
}
|
|
2350
|
+
const response = await computeQuery([
|
|
2351
|
+
...this._queryTree,
|
|
2352
|
+
{
|
|
2353
|
+
operation: "sourceModuleName",
|
|
2354
|
+
},
|
|
2355
|
+
], await this._ctx.connection());
|
|
2356
|
+
return response;
|
|
2357
|
+
};
|
|
2358
|
+
/**
|
|
2359
|
+
* The values of the enum.
|
|
2360
|
+
*/
|
|
2361
|
+
values = async () => {
|
|
2362
|
+
const response = await computeQuery([
|
|
2363
|
+
...this._queryTree,
|
|
2364
|
+
{
|
|
2365
|
+
operation: "values",
|
|
2366
|
+
},
|
|
2367
|
+
{
|
|
2368
|
+
operation: "id",
|
|
2369
|
+
},
|
|
2370
|
+
], await this._ctx.connection());
|
|
2371
|
+
return response.map((r) => new EnumValueTypeDef({
|
|
2372
|
+
queryTree: [
|
|
2373
|
+
{
|
|
2374
|
+
operation: "loadEnumValueTypeDefFromID",
|
|
2375
|
+
args: { id: r.id },
|
|
2376
|
+
},
|
|
2377
|
+
],
|
|
2378
|
+
ctx: this._ctx,
|
|
2379
|
+
}, r.id));
|
|
2380
|
+
};
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* A definition of a value in a custom enum defined in a Module.
|
|
2384
|
+
*/
|
|
2385
|
+
export class EnumValueTypeDef extends BaseClient {
|
|
2386
|
+
_id = undefined;
|
|
2387
|
+
_description = undefined;
|
|
2388
|
+
_name = undefined;
|
|
2389
|
+
/**
|
|
2390
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2391
|
+
*/
|
|
2392
|
+
constructor(parent, _id, _description, _name) {
|
|
2393
|
+
super(parent);
|
|
2394
|
+
this._id = _id;
|
|
2395
|
+
this._description = _description;
|
|
2396
|
+
this._name = _name;
|
|
2397
|
+
}
|
|
2398
|
+
/**
|
|
2399
|
+
* A unique identifier for this EnumValueTypeDef.
|
|
2400
|
+
*/
|
|
2401
|
+
id = async () => {
|
|
2402
|
+
if (this._id) {
|
|
2403
|
+
return this._id;
|
|
2404
|
+
}
|
|
2405
|
+
const response = await computeQuery([
|
|
2406
|
+
...this._queryTree,
|
|
2407
|
+
{
|
|
2408
|
+
operation: "id",
|
|
2409
|
+
},
|
|
2410
|
+
], await this._ctx.connection());
|
|
2411
|
+
return response;
|
|
2412
|
+
};
|
|
2413
|
+
/**
|
|
2414
|
+
* A doc string for the enum value, if any.
|
|
2415
|
+
*/
|
|
2416
|
+
description = async () => {
|
|
2417
|
+
if (this._description) {
|
|
2418
|
+
return this._description;
|
|
2419
|
+
}
|
|
2420
|
+
const response = await computeQuery([
|
|
2421
|
+
...this._queryTree,
|
|
2422
|
+
{
|
|
2423
|
+
operation: "description",
|
|
2424
|
+
},
|
|
2425
|
+
], await this._ctx.connection());
|
|
2426
|
+
return response;
|
|
2427
|
+
};
|
|
2428
|
+
/**
|
|
2429
|
+
* The name of the enum value.
|
|
2430
|
+
*/
|
|
2431
|
+
name = async () => {
|
|
2432
|
+
if (this._name) {
|
|
2433
|
+
return this._name;
|
|
2434
|
+
}
|
|
2435
|
+
const response = await computeQuery([
|
|
2436
|
+
...this._queryTree,
|
|
2437
|
+
{
|
|
2438
|
+
operation: "name",
|
|
2439
|
+
},
|
|
2440
|
+
], await this._ctx.connection());
|
|
2441
|
+
return response;
|
|
2442
|
+
};
|
|
2443
|
+
}
|
|
1922
2444
|
/**
|
|
1923
2445
|
* An environment variable name and value.
|
|
1924
2446
|
*/
|
|
@@ -2163,13 +2685,21 @@ export class File extends BaseClient {
|
|
|
2163
2685
|
* Force evaluation in the engine.
|
|
2164
2686
|
*/
|
|
2165
2687
|
sync = async () => {
|
|
2166
|
-
await computeQuery([
|
|
2688
|
+
const response = await computeQuery([
|
|
2167
2689
|
...this._queryTree,
|
|
2168
2690
|
{
|
|
2169
2691
|
operation: "sync",
|
|
2170
2692
|
},
|
|
2171
2693
|
], await this._ctx.connection());
|
|
2172
|
-
return
|
|
2694
|
+
return new File({
|
|
2695
|
+
queryTree: [
|
|
2696
|
+
{
|
|
2697
|
+
operation: "loadFileFromID",
|
|
2698
|
+
args: { id: response },
|
|
2699
|
+
},
|
|
2700
|
+
],
|
|
2701
|
+
ctx: this._ctx,
|
|
2702
|
+
});
|
|
2173
2703
|
};
|
|
2174
2704
|
/**
|
|
2175
2705
|
* Retrieves this file with its name set to the given name.
|
|
@@ -2562,16 +3092,15 @@ export class FunctionCall extends BaseClient {
|
|
|
2562
3092
|
*/
|
|
2563
3093
|
returnValue = async (value) => {
|
|
2564
3094
|
if (this._returnValue) {
|
|
2565
|
-
return
|
|
3095
|
+
return;
|
|
2566
3096
|
}
|
|
2567
|
-
|
|
3097
|
+
await computeQuery([
|
|
2568
3098
|
...this._queryTree,
|
|
2569
3099
|
{
|
|
2570
3100
|
operation: "returnValue",
|
|
2571
3101
|
args: { value },
|
|
2572
3102
|
},
|
|
2573
3103
|
], await this._ctx.connection());
|
|
2574
|
-
return response;
|
|
2575
3104
|
};
|
|
2576
3105
|
}
|
|
2577
3106
|
/**
|
|
@@ -2930,16 +3459,13 @@ export class GitRef extends BaseClient {
|
|
|
2930
3459
|
};
|
|
2931
3460
|
/**
|
|
2932
3461
|
* The filesystem tree at this ref.
|
|
2933
|
-
* @param opts.sshKnownHosts DEPRECATED: This option should be passed to `git` instead.
|
|
2934
|
-
* @param opts.sshAuthSocket DEPRECATED: This option should be passed to `git` instead.
|
|
2935
3462
|
*/
|
|
2936
|
-
tree = (
|
|
3463
|
+
tree = () => {
|
|
2937
3464
|
return new Directory({
|
|
2938
3465
|
queryTree: [
|
|
2939
3466
|
...this._queryTree,
|
|
2940
3467
|
{
|
|
2941
3468
|
operation: "tree",
|
|
2942
|
-
args: { ...opts },
|
|
2943
3469
|
},
|
|
2944
3470
|
],
|
|
2945
3471
|
ctx: this._ctx,
|
|
@@ -3051,6 +3577,20 @@ export class GitRepository extends BaseClient {
|
|
|
3051
3577
|
ctx: this._ctx,
|
|
3052
3578
|
});
|
|
3053
3579
|
};
|
|
3580
|
+
/**
|
|
3581
|
+
* tags that match any of the given glob patterns.
|
|
3582
|
+
* @param opts.patterns Glob patterns (e.g., "refs/tags/v*").
|
|
3583
|
+
*/
|
|
3584
|
+
tags = async (opts) => {
|
|
3585
|
+
const response = await computeQuery([
|
|
3586
|
+
...this._queryTree,
|
|
3587
|
+
{
|
|
3588
|
+
operation: "tags",
|
|
3589
|
+
args: { ...opts },
|
|
3590
|
+
},
|
|
3591
|
+
], await this._ctx.connection());
|
|
3592
|
+
return response;
|
|
3593
|
+
};
|
|
3054
3594
|
/**
|
|
3055
3595
|
* Header to authenticate the remote with.
|
|
3056
3596
|
* @param header Secret used to populate the Authorization HTTP header
|
|
@@ -3668,6 +4208,29 @@ export class Module_ extends BaseClient {
|
|
|
3668
4208
|
], await this._ctx.connection());
|
|
3669
4209
|
return response;
|
|
3670
4210
|
};
|
|
4211
|
+
/**
|
|
4212
|
+
* Enumerations served by this module.
|
|
4213
|
+
*/
|
|
4214
|
+
enums = async () => {
|
|
4215
|
+
const response = await computeQuery([
|
|
4216
|
+
...this._queryTree,
|
|
4217
|
+
{
|
|
4218
|
+
operation: "enums",
|
|
4219
|
+
},
|
|
4220
|
+
{
|
|
4221
|
+
operation: "id",
|
|
4222
|
+
},
|
|
4223
|
+
], await this._ctx.connection());
|
|
4224
|
+
return response.map((r) => new TypeDef({
|
|
4225
|
+
queryTree: [
|
|
4226
|
+
{
|
|
4227
|
+
operation: "loadTypeDefFromID",
|
|
4228
|
+
args: { id: r.id },
|
|
4229
|
+
},
|
|
4230
|
+
],
|
|
4231
|
+
ctx: this._ctx,
|
|
4232
|
+
}, r.id));
|
|
4233
|
+
};
|
|
3671
4234
|
/**
|
|
3672
4235
|
* The generated files and directories made on top of the module source's context directory.
|
|
3673
4236
|
*/
|
|
@@ -3807,15 +4370,14 @@ export class Module_ extends BaseClient {
|
|
|
3807
4370
|
*/
|
|
3808
4371
|
serve = async () => {
|
|
3809
4372
|
if (this._serve) {
|
|
3810
|
-
return
|
|
4373
|
+
return;
|
|
3811
4374
|
}
|
|
3812
|
-
|
|
4375
|
+
await computeQuery([
|
|
3813
4376
|
...this._queryTree,
|
|
3814
4377
|
{
|
|
3815
4378
|
operation: "serve",
|
|
3816
4379
|
},
|
|
3817
4380
|
], await this._ctx.connection());
|
|
3818
|
-
return response;
|
|
3819
4381
|
};
|
|
3820
4382
|
/**
|
|
3821
4383
|
* The source for the module.
|
|
@@ -3847,6 +4409,23 @@ export class Module_ extends BaseClient {
|
|
|
3847
4409
|
ctx: this._ctx,
|
|
3848
4410
|
});
|
|
3849
4411
|
};
|
|
4412
|
+
/**
|
|
4413
|
+
* This module plus the given Enum type and associated values
|
|
4414
|
+
*/
|
|
4415
|
+
withEnum = (enum_) => {
|
|
4416
|
+
return new Module_({
|
|
4417
|
+
queryTree: [
|
|
4418
|
+
...this._queryTree,
|
|
4419
|
+
{
|
|
4420
|
+
operation: "withEnum",
|
|
4421
|
+
args: {
|
|
4422
|
+
enum: enum_,
|
|
4423
|
+
},
|
|
4424
|
+
},
|
|
4425
|
+
],
|
|
4426
|
+
ctx: this._ctx,
|
|
4427
|
+
});
|
|
4428
|
+
};
|
|
3850
4429
|
/**
|
|
3851
4430
|
* This module plus the given Interface type and associated functions
|
|
3852
4431
|
*/
|
|
@@ -3880,14 +4459,15 @@ export class Module_ extends BaseClient {
|
|
|
3880
4459
|
/**
|
|
3881
4460
|
* Retrieves the module with basic configuration loaded if present.
|
|
3882
4461
|
* @param source The module source to initialize from.
|
|
4462
|
+
* @param opts.engineVersion The engine version to upgrade to.
|
|
3883
4463
|
*/
|
|
3884
|
-
withSource = (source) => {
|
|
4464
|
+
withSource = (source, opts) => {
|
|
3885
4465
|
return new Module_({
|
|
3886
4466
|
queryTree: [
|
|
3887
4467
|
...this._queryTree,
|
|
3888
4468
|
{
|
|
3889
4469
|
operation: "withSource",
|
|
3890
|
-
args: { source },
|
|
4470
|
+
args: { source, ...opts },
|
|
3891
4471
|
},
|
|
3892
4472
|
],
|
|
3893
4473
|
ctx: this._ctx,
|
|
@@ -4034,13 +4614,15 @@ export class ModuleSource extends BaseClient {
|
|
|
4034
4614
|
};
|
|
4035
4615
|
/**
|
|
4036
4616
|
* Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
|
|
4617
|
+
* @param opts.engineVersion The engine version to upgrade to.
|
|
4037
4618
|
*/
|
|
4038
|
-
asModule = () => {
|
|
4619
|
+
asModule = (opts) => {
|
|
4039
4620
|
return new Module_({
|
|
4040
4621
|
queryTree: [
|
|
4041
4622
|
...this._queryTree,
|
|
4042
4623
|
{
|
|
4043
4624
|
operation: "asModule",
|
|
4625
|
+
args: { ...opts },
|
|
4044
4626
|
},
|
|
4045
4627
|
],
|
|
4046
4628
|
ctx: this._ctx,
|
|
@@ -4707,15 +5289,13 @@ export class Port extends BaseClient {
|
|
|
4707
5289
|
* The root of the DAG.
|
|
4708
5290
|
*/
|
|
4709
5291
|
export class Client extends BaseClient {
|
|
4710
|
-
_checkVersionCompatibility = undefined;
|
|
4711
5292
|
_defaultPlatform = undefined;
|
|
4712
5293
|
_version = undefined;
|
|
4713
5294
|
/**
|
|
4714
5295
|
* Constructor is used for internal usage only, do not create object from it.
|
|
4715
5296
|
*/
|
|
4716
|
-
constructor(parent,
|
|
5297
|
+
constructor(parent, _defaultPlatform, _version) {
|
|
4717
5298
|
super(parent);
|
|
4718
|
-
this._checkVersionCompatibility = _checkVersionCompatibility;
|
|
4719
5299
|
this._defaultPlatform = _defaultPlatform;
|
|
4720
5300
|
this._version = _version;
|
|
4721
5301
|
}
|
|
@@ -4776,25 +5356,10 @@ export class Client extends BaseClient {
|
|
|
4776
5356
|
ctx: this._ctx,
|
|
4777
5357
|
});
|
|
4778
5358
|
};
|
|
4779
|
-
/**
|
|
4780
|
-
* Checks if the current Dagger Engine is compatible with an SDK's required version.
|
|
4781
|
-
* @param version Version required by the SDK.
|
|
4782
|
-
*/
|
|
4783
|
-
checkVersionCompatibility = async (version) => {
|
|
4784
|
-
const response = await computeQuery([
|
|
4785
|
-
...this._queryTree,
|
|
4786
|
-
{
|
|
4787
|
-
operation: "checkVersionCompatibility",
|
|
4788
|
-
args: { version },
|
|
4789
|
-
},
|
|
4790
|
-
], await this._ctx.connection());
|
|
4791
|
-
return response;
|
|
4792
|
-
};
|
|
4793
5359
|
/**
|
|
4794
5360
|
* Creates a scratch container.
|
|
4795
5361
|
*
|
|
4796
5362
|
* Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
|
|
4797
|
-
* @param opts.id DEPRECATED: Use `loadContainerFromID` instead.
|
|
4798
5363
|
* @param opts.platform Platform to initialize the container with.
|
|
4799
5364
|
*/
|
|
4800
5365
|
container = (opts) => {
|
|
@@ -4862,6 +5427,20 @@ export class Client extends BaseClient {
|
|
|
4862
5427
|
ctx: this._ctx,
|
|
4863
5428
|
}, r.id));
|
|
4864
5429
|
};
|
|
5430
|
+
/**
|
|
5431
|
+
* The Dagger engine container configuration and state
|
|
5432
|
+
*/
|
|
5433
|
+
daggerEngine = () => {
|
|
5434
|
+
return new DaggerEngine({
|
|
5435
|
+
queryTree: [
|
|
5436
|
+
...this._queryTree,
|
|
5437
|
+
{
|
|
5438
|
+
operation: "daggerEngine",
|
|
5439
|
+
},
|
|
5440
|
+
],
|
|
5441
|
+
ctx: this._ctx,
|
|
5442
|
+
});
|
|
5443
|
+
};
|
|
4865
5444
|
/**
|
|
4866
5445
|
* The default platform of the engine.
|
|
4867
5446
|
*/
|
|
@@ -4876,30 +5455,13 @@ export class Client extends BaseClient {
|
|
|
4876
5455
|
};
|
|
4877
5456
|
/**
|
|
4878
5457
|
* Creates an empty directory.
|
|
4879
|
-
* @param opts.id DEPRECATED: Use `loadDirectoryFromID` instead.
|
|
4880
5458
|
*/
|
|
4881
|
-
directory = (
|
|
5459
|
+
directory = () => {
|
|
4882
5460
|
return new Directory({
|
|
4883
5461
|
queryTree: [
|
|
4884
5462
|
...this._queryTree,
|
|
4885
5463
|
{
|
|
4886
5464
|
operation: "directory",
|
|
4887
|
-
args: { ...opts },
|
|
4888
|
-
},
|
|
4889
|
-
],
|
|
4890
|
-
ctx: this._ctx,
|
|
4891
|
-
});
|
|
4892
|
-
};
|
|
4893
|
-
/**
|
|
4894
|
-
* @deprecated Use loadFileFromID instead.
|
|
4895
|
-
*/
|
|
4896
|
-
file = (id) => {
|
|
4897
|
-
return new File({
|
|
4898
|
-
queryTree: [
|
|
4899
|
-
...this._queryTree,
|
|
4900
|
-
{
|
|
4901
|
-
operation: "file",
|
|
4902
|
-
args: { id },
|
|
4903
5465
|
},
|
|
4904
5466
|
],
|
|
4905
5467
|
ctx: this._ctx,
|
|
@@ -5037,6 +5599,66 @@ export class Client extends BaseClient {
|
|
|
5037
5599
|
ctx: this._ctx,
|
|
5038
5600
|
});
|
|
5039
5601
|
};
|
|
5602
|
+
/**
|
|
5603
|
+
* Load a DaggerEngineCacheEntry from its ID.
|
|
5604
|
+
*/
|
|
5605
|
+
loadDaggerEngineCacheEntryFromID = (id) => {
|
|
5606
|
+
return new DaggerEngineCacheEntry({
|
|
5607
|
+
queryTree: [
|
|
5608
|
+
...this._queryTree,
|
|
5609
|
+
{
|
|
5610
|
+
operation: "loadDaggerEngineCacheEntryFromID",
|
|
5611
|
+
args: { id },
|
|
5612
|
+
},
|
|
5613
|
+
],
|
|
5614
|
+
ctx: this._ctx,
|
|
5615
|
+
});
|
|
5616
|
+
};
|
|
5617
|
+
/**
|
|
5618
|
+
* Load a DaggerEngineCacheEntrySet from its ID.
|
|
5619
|
+
*/
|
|
5620
|
+
loadDaggerEngineCacheEntrySetFromID = (id) => {
|
|
5621
|
+
return new DaggerEngineCacheEntrySet({
|
|
5622
|
+
queryTree: [
|
|
5623
|
+
...this._queryTree,
|
|
5624
|
+
{
|
|
5625
|
+
operation: "loadDaggerEngineCacheEntrySetFromID",
|
|
5626
|
+
args: { id },
|
|
5627
|
+
},
|
|
5628
|
+
],
|
|
5629
|
+
ctx: this._ctx,
|
|
5630
|
+
});
|
|
5631
|
+
};
|
|
5632
|
+
/**
|
|
5633
|
+
* Load a DaggerEngineCache from its ID.
|
|
5634
|
+
*/
|
|
5635
|
+
loadDaggerEngineCacheFromID = (id) => {
|
|
5636
|
+
return new DaggerEngineCache({
|
|
5637
|
+
queryTree: [
|
|
5638
|
+
...this._queryTree,
|
|
5639
|
+
{
|
|
5640
|
+
operation: "loadDaggerEngineCacheFromID",
|
|
5641
|
+
args: { id },
|
|
5642
|
+
},
|
|
5643
|
+
],
|
|
5644
|
+
ctx: this._ctx,
|
|
5645
|
+
});
|
|
5646
|
+
};
|
|
5647
|
+
/**
|
|
5648
|
+
* Load a DaggerEngine from its ID.
|
|
5649
|
+
*/
|
|
5650
|
+
loadDaggerEngineFromID = (id) => {
|
|
5651
|
+
return new DaggerEngine({
|
|
5652
|
+
queryTree: [
|
|
5653
|
+
...this._queryTree,
|
|
5654
|
+
{
|
|
5655
|
+
operation: "loadDaggerEngineFromID",
|
|
5656
|
+
args: { id },
|
|
5657
|
+
},
|
|
5658
|
+
],
|
|
5659
|
+
ctx: this._ctx,
|
|
5660
|
+
});
|
|
5661
|
+
};
|
|
5040
5662
|
/**
|
|
5041
5663
|
* Load a Directory from its ID.
|
|
5042
5664
|
*/
|
|
@@ -5052,6 +5674,36 @@ export class Client extends BaseClient {
|
|
|
5052
5674
|
ctx: this._ctx,
|
|
5053
5675
|
});
|
|
5054
5676
|
};
|
|
5677
|
+
/**
|
|
5678
|
+
* Load a EnumTypeDef from its ID.
|
|
5679
|
+
*/
|
|
5680
|
+
loadEnumTypeDefFromID = (id) => {
|
|
5681
|
+
return new EnumTypeDef({
|
|
5682
|
+
queryTree: [
|
|
5683
|
+
...this._queryTree,
|
|
5684
|
+
{
|
|
5685
|
+
operation: "loadEnumTypeDefFromID",
|
|
5686
|
+
args: { id },
|
|
5687
|
+
},
|
|
5688
|
+
],
|
|
5689
|
+
ctx: this._ctx,
|
|
5690
|
+
});
|
|
5691
|
+
};
|
|
5692
|
+
/**
|
|
5693
|
+
* Load a EnumValueTypeDef from its ID.
|
|
5694
|
+
*/
|
|
5695
|
+
loadEnumValueTypeDefFromID = (id) => {
|
|
5696
|
+
return new EnumValueTypeDef({
|
|
5697
|
+
queryTree: [
|
|
5698
|
+
...this._queryTree,
|
|
5699
|
+
{
|
|
5700
|
+
operation: "loadEnumValueTypeDefFromID",
|
|
5701
|
+
args: { id },
|
|
5702
|
+
},
|
|
5703
|
+
],
|
|
5704
|
+
ctx: this._ctx,
|
|
5705
|
+
});
|
|
5706
|
+
};
|
|
5055
5707
|
/**
|
|
5056
5708
|
* Load a EnvVariable from its ID.
|
|
5057
5709
|
*/
|
|
@@ -5587,22 +6239,6 @@ export class Client extends BaseClient {
|
|
|
5587
6239
|
ctx: this._ctx,
|
|
5588
6240
|
});
|
|
5589
6241
|
};
|
|
5590
|
-
/**
|
|
5591
|
-
* Loads a socket by its ID.
|
|
5592
|
-
* @deprecated Use loadSocketFromID instead.
|
|
5593
|
-
*/
|
|
5594
|
-
socket = (id) => {
|
|
5595
|
-
return new Socket({
|
|
5596
|
-
queryTree: [
|
|
5597
|
-
...this._queryTree,
|
|
5598
|
-
{
|
|
5599
|
-
operation: "socket",
|
|
5600
|
-
args: { id },
|
|
5601
|
-
},
|
|
5602
|
-
],
|
|
5603
|
-
ctx: this._ctx,
|
|
5604
|
-
});
|
|
5605
|
-
};
|
|
5606
6242
|
/**
|
|
5607
6243
|
* Create a new TypeDef.
|
|
5608
6244
|
*/
|
|
@@ -5882,27 +6518,43 @@ export class Service extends BaseClient {
|
|
|
5882
6518
|
* Services bound to a Container do not need to be manually started.
|
|
5883
6519
|
*/
|
|
5884
6520
|
start = async () => {
|
|
5885
|
-
await computeQuery([
|
|
6521
|
+
const response = await computeQuery([
|
|
5886
6522
|
...this._queryTree,
|
|
5887
6523
|
{
|
|
5888
6524
|
operation: "start",
|
|
5889
6525
|
},
|
|
5890
6526
|
], await this._ctx.connection());
|
|
5891
|
-
return
|
|
6527
|
+
return new Service({
|
|
6528
|
+
queryTree: [
|
|
6529
|
+
{
|
|
6530
|
+
operation: "loadServiceFromID",
|
|
6531
|
+
args: { id: response },
|
|
6532
|
+
},
|
|
6533
|
+
],
|
|
6534
|
+
ctx: this._ctx,
|
|
6535
|
+
});
|
|
5892
6536
|
};
|
|
5893
6537
|
/**
|
|
5894
6538
|
* Stop the service.
|
|
5895
6539
|
* @param opts.kill Immediately kill the service without waiting for a graceful exit
|
|
5896
6540
|
*/
|
|
5897
6541
|
stop = async (opts) => {
|
|
5898
|
-
await computeQuery([
|
|
6542
|
+
const response = await computeQuery([
|
|
5899
6543
|
...this._queryTree,
|
|
5900
6544
|
{
|
|
5901
6545
|
operation: "stop",
|
|
5902
6546
|
args: { ...opts },
|
|
5903
6547
|
},
|
|
5904
6548
|
], await this._ctx.connection());
|
|
5905
|
-
return
|
|
6549
|
+
return new Service({
|
|
6550
|
+
queryTree: [
|
|
6551
|
+
{
|
|
6552
|
+
operation: "loadServiceFromID",
|
|
6553
|
+
args: { id: response },
|
|
6554
|
+
},
|
|
6555
|
+
],
|
|
6556
|
+
ctx: this._ctx,
|
|
6557
|
+
});
|
|
5906
6558
|
};
|
|
5907
6559
|
/**
|
|
5908
6560
|
* Creates a tunnel that forwards traffic from the caller's network to this service.
|
|
@@ -5913,16 +6565,15 @@ export class Service extends BaseClient {
|
|
|
5913
6565
|
*/
|
|
5914
6566
|
up = async (opts) => {
|
|
5915
6567
|
if (this._up) {
|
|
5916
|
-
return
|
|
6568
|
+
return;
|
|
5917
6569
|
}
|
|
5918
|
-
|
|
6570
|
+
await computeQuery([
|
|
5919
6571
|
...this._queryTree,
|
|
5920
6572
|
{
|
|
5921
6573
|
operation: "up",
|
|
5922
6574
|
args: { ...opts },
|
|
5923
6575
|
},
|
|
5924
6576
|
], await this._ctx.connection());
|
|
5925
|
-
return response;
|
|
5926
6577
|
};
|
|
5927
6578
|
}
|
|
5928
6579
|
/**
|
|
@@ -5958,14 +6609,14 @@ export class Socket extends BaseClient {
|
|
|
5958
6609
|
*/
|
|
5959
6610
|
export class Terminal extends BaseClient {
|
|
5960
6611
|
_id = undefined;
|
|
5961
|
-
|
|
6612
|
+
_sync = undefined;
|
|
5962
6613
|
/**
|
|
5963
6614
|
* Constructor is used for internal usage only, do not create object from it.
|
|
5964
6615
|
*/
|
|
5965
|
-
constructor(parent, _id,
|
|
6616
|
+
constructor(parent, _id, _sync) {
|
|
5966
6617
|
super(parent);
|
|
5967
6618
|
this._id = _id;
|
|
5968
|
-
this.
|
|
6619
|
+
this._sync = _sync;
|
|
5969
6620
|
}
|
|
5970
6621
|
/**
|
|
5971
6622
|
* A unique identifier for this Terminal.
|
|
@@ -5983,19 +6634,26 @@ export class Terminal extends BaseClient {
|
|
|
5983
6634
|
return response;
|
|
5984
6635
|
};
|
|
5985
6636
|
/**
|
|
5986
|
-
*
|
|
6637
|
+
* Forces evaluation of the pipeline in the engine.
|
|
6638
|
+
*
|
|
6639
|
+
* It doesn't run the default command if no exec has been set.
|
|
5987
6640
|
*/
|
|
5988
|
-
|
|
5989
|
-
if (this._websocketEndpoint) {
|
|
5990
|
-
return this._websocketEndpoint;
|
|
5991
|
-
}
|
|
6641
|
+
sync = async () => {
|
|
5992
6642
|
const response = await computeQuery([
|
|
5993
6643
|
...this._queryTree,
|
|
5994
6644
|
{
|
|
5995
|
-
operation: "
|
|
6645
|
+
operation: "sync",
|
|
5996
6646
|
},
|
|
5997
6647
|
], await this._ctx.connection());
|
|
5998
|
-
return
|
|
6648
|
+
return new Terminal({
|
|
6649
|
+
queryTree: [
|
|
6650
|
+
{
|
|
6651
|
+
operation: "loadTerminalFromID",
|
|
6652
|
+
args: { id: response },
|
|
6653
|
+
},
|
|
6654
|
+
],
|
|
6655
|
+
ctx: this._ctx,
|
|
6656
|
+
});
|
|
5999
6657
|
};
|
|
6000
6658
|
}
|
|
6001
6659
|
/**
|
|
@@ -6029,6 +6687,20 @@ export class TypeDef extends BaseClient {
|
|
|
6029
6687
|
], await this._ctx.connection());
|
|
6030
6688
|
return response;
|
|
6031
6689
|
};
|
|
6690
|
+
/**
|
|
6691
|
+
* If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
|
|
6692
|
+
*/
|
|
6693
|
+
asEnum = () => {
|
|
6694
|
+
return new EnumTypeDef({
|
|
6695
|
+
queryTree: [
|
|
6696
|
+
...this._queryTree,
|
|
6697
|
+
{
|
|
6698
|
+
operation: "asEnum",
|
|
6699
|
+
},
|
|
6700
|
+
],
|
|
6701
|
+
ctx: this._ctx,
|
|
6702
|
+
});
|
|
6703
|
+
};
|
|
6032
6704
|
/**
|
|
6033
6705
|
* If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
|
|
6034
6706
|
*/
|
|
@@ -6146,6 +6818,42 @@ export class TypeDef extends BaseClient {
|
|
|
6146
6818
|
ctx: this._ctx,
|
|
6147
6819
|
});
|
|
6148
6820
|
};
|
|
6821
|
+
/**
|
|
6822
|
+
* Returns a TypeDef of kind Enum with the provided name.
|
|
6823
|
+
*
|
|
6824
|
+
* Note that an enum's values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.
|
|
6825
|
+
* @param name The name of the enum
|
|
6826
|
+
* @param opts.description A doc string for the enum, if any
|
|
6827
|
+
*/
|
|
6828
|
+
withEnum = (name, opts) => {
|
|
6829
|
+
return new TypeDef({
|
|
6830
|
+
queryTree: [
|
|
6831
|
+
...this._queryTree,
|
|
6832
|
+
{
|
|
6833
|
+
operation: "withEnum",
|
|
6834
|
+
args: { name, ...opts },
|
|
6835
|
+
},
|
|
6836
|
+
],
|
|
6837
|
+
ctx: this._ctx,
|
|
6838
|
+
});
|
|
6839
|
+
};
|
|
6840
|
+
/**
|
|
6841
|
+
* Adds a static value for an Enum TypeDef, failing if the type is not an enum.
|
|
6842
|
+
* @param value The name of the value in the enum
|
|
6843
|
+
* @param opts.description A doc string for the value, if any
|
|
6844
|
+
*/
|
|
6845
|
+
withEnumValue = (value, opts) => {
|
|
6846
|
+
return new TypeDef({
|
|
6847
|
+
queryTree: [
|
|
6848
|
+
...this._queryTree,
|
|
6849
|
+
{
|
|
6850
|
+
operation: "withEnumValue",
|
|
6851
|
+
args: { value, ...opts },
|
|
6852
|
+
},
|
|
6853
|
+
],
|
|
6854
|
+
ctx: this._ctx,
|
|
6855
|
+
});
|
|
6856
|
+
};
|
|
6149
6857
|
/**
|
|
6150
6858
|
* Adds a static field for an Object TypeDef, failing if the type is not an object.
|
|
6151
6859
|
* @param name The name of the field in the object
|