@highstate/timeweb 0.9.15 → 0.9.18
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/connection/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
import { timeweb } from '@highstate/library';
|
2
|
+
import { forUnit } from '@highstate/pulumi';
|
3
|
+
|
1
4
|
// src/connection/index.ts
|
2
|
-
import { timeweb } from "@highstate/library";
|
3
|
-
import { forUnit } from "@highstate/pulumi";
|
4
5
|
var { name, secrets, outputs } = forUnit(timeweb.connection);
|
5
6
|
var connection_default = outputs({
|
6
7
|
connection: {
|
@@ -8,7 +9,7 @@ var connection_default = outputs({
|
|
8
9
|
apiToken: secrets.apiToken
|
9
10
|
}
|
10
11
|
});
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
export { connection_default as default };
|
14
|
+
//# sourceMappingURL=index.js.map
|
14
15
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/connection/index.ts"],"sourcesContent":["import { timeweb } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\n\nconst { name, secrets, outputs } = forUnit(timeweb.connection)\n\nexport default outputs({\n connection: {\n name,\n apiToken: secrets.apiToken,\n },\n})\n"]
|
1
|
+
{"version":3,"sources":["../../src/connection/index.ts"],"names":[],"mappings":";;;;AAGA,IAAM,EAAE,IAAA,EAAM,OAAA,EAAS,SAAQ,GAAI,OAAA,CAAQ,QAAQ,UAAU,CAAA;AAE7D,IAAO,qBAAQ,OAAA,CAAQ;AAAA,EACrB,UAAA,EAAY;AAAA,IACV,IAAA;AAAA,IACA,UAAU,OAAA,CAAQ;AAAA;AAEtB,CAAC","file":"index.js","sourcesContent":["import { timeweb } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\n\nconst { name, secrets, outputs } = forUnit(timeweb.connection)\n\nexport default outputs({\n connection: {\n name,\n apiToken: secrets.apiToken,\n },\n})\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"sourceHashes": {
|
3
|
-
"./dist/connection/index.js":
|
4
|
-
"./dist/virtual-machine/index.js":
|
3
|
+
"./dist/connection/index.js": 2081631216,
|
4
|
+
"./dist/virtual-machine/index.js": 114751294
|
5
5
|
}
|
6
6
|
}
|
@@ -1,15 +1,10 @@
|
|
1
|
+
import { Provider, SshKey, FloatingIp, Server } from '@highstate/timeweb-sdk';
|
2
|
+
import { timeweb } from '@highstate/library';
|
3
|
+
import { forUnit, getResourceComment, toPromise, interpolate } from '@highstate/pulumi';
|
4
|
+
import { getOrCreateSshKeyPair, parseL3Endpoint, createServerEntity, createSshTerminal, l3EndpointToString } from '@highstate/common';
|
5
|
+
import { local } from '@pulumi/command';
|
6
|
+
|
1
7
|
// src/virtual-machine/index.ts
|
2
|
-
import { Provider, SshKey, FloatingIp, Server as TimewebServer } from "@highstate/timeweb-sdk";
|
3
|
-
import { timeweb } from "@highstate/library";
|
4
|
-
import { forUnit, getResourceComment, interpolate, toPromise } from "@highstate/pulumi";
|
5
|
-
import {
|
6
|
-
createServerEntity,
|
7
|
-
createSshTerminal,
|
8
|
-
getOrCreateSshKeyPair,
|
9
|
-
l3EndpointToString,
|
10
|
-
parseL3Endpoint
|
11
|
-
} from "@highstate/common";
|
12
|
-
import { local } from "@pulumi/command";
|
13
8
|
var { name, args, inputs, secrets, outputs } = forUnit(timeweb.virtualMachine);
|
14
9
|
var provider = new Provider(name, { token: inputs.connection.apiToken });
|
15
10
|
var keyPair = getOrCreateSshKeyPair(inputs, secrets);
|
@@ -30,7 +25,7 @@ var floatingIp = new FloatingIp(
|
|
30
25
|
},
|
31
26
|
{ provider }
|
32
27
|
);
|
33
|
-
new
|
28
|
+
new Server(
|
34
29
|
name,
|
35
30
|
{
|
36
31
|
name,
|
@@ -54,7 +49,7 @@ var server = availabilityCommand.stdout.apply(
|
|
54
49
|
);
|
55
50
|
var virtual_machine_default = outputs({
|
56
51
|
server,
|
57
|
-
$
|
52
|
+
$statusFields: {
|
58
53
|
hostname: {
|
59
54
|
value: server.hostname
|
60
55
|
},
|
@@ -64,7 +59,7 @@ var virtual_machine_default = outputs({
|
|
64
59
|
},
|
65
60
|
$terminals: [createSshTerminal(server.ssh)]
|
66
61
|
});
|
67
|
-
|
68
|
-
|
69
|
-
|
62
|
+
|
63
|
+
export { virtual_machine_default as default };
|
64
|
+
//# sourceMappingURL=index.js.map
|
70
65
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/virtual-machine/index.ts"],"sourcesContent":["import { Provider, SshKey, FloatingIp, Server as TimewebServer } from \"@highstate/timeweb-sdk\"\nimport { timeweb } from \"@highstate/library\"\nimport { forUnit, getResourceComment, interpolate, toPromise } from \"@highstate/pulumi\"\nimport {\n createServerEntity,\n createSshTerminal,\n getOrCreateSshKeyPair,\n l3EndpointToString,\n parseL3Endpoint,\n} from \"@highstate/common\"\nimport { local } from \"@pulumi/command\"\n\nconst { name, args, inputs, secrets, outputs } = forUnit(timeweb.virtualMachine)\n\nconst provider = new Provider(name, { token: inputs.connection.apiToken })\n\nconst keyPair = getOrCreateSshKeyPair(inputs, secrets)\n\nconst sshKey = new SshKey(\n name,\n {\n name,\n body: keyPair.publicKey,\n },\n { provider },\n)\n\nconst floatingIp = new FloatingIp(\n name,\n {\n comment: getResourceComment(),\n availabilityZone: args.availabilityZone,\n ddosGuard: false,\n },\n { provider },\n)\n\nnew TimewebServer(\n name,\n {\n name,\n comment: getResourceComment(),\n availabilityZone: args.availabilityZone,\n floatingIpId: floatingIp.id,\n presetId: args.presetId,\n osId: args.osId,\n isRootPasswordRequired: false,\n sshKeysIds: [sshKey.sshKeyId.apply(Number)],\n },\n { provider },\n)\n\nconst serverIp = await toPromise(floatingIp.ip)\nconst endpoint = parseL3Endpoint(serverIp)\n\nconst availabilityCommand = new local.Command(\"check-availability\", {\n create: interpolate`while ! ping -c 1 ${floatingIp.ip}; do echo \"Waiting for server to be available...\"; sleep 5; done`,\n})\n\nconst server = availabilityCommand.stdout.apply(() =>\n createServerEntity(name, endpoint, 22, \"root\", undefined, keyPair.privateKey),\n)\n\nexport default outputs({\n server,\n\n $
|
1
|
+
{"version":3,"sources":["../../src/virtual-machine/index.ts"],"names":["TimewebServer"],"mappings":";;;;;;;AAYA,IAAM,EAAE,MAAM,IAAA,EAAM,MAAA,EAAQ,SAAS,OAAA,EAAQ,GAAI,OAAA,CAAQ,OAAA,CAAQ,cAAc,CAAA;AAE/E,IAAM,QAAA,GAAW,IAAI,QAAA,CAAS,IAAA,EAAM,EAAE,KAAA,EAAO,MAAA,CAAO,UAAA,CAAW,QAAA,EAAU,CAAA;AAEzE,IAAM,OAAA,GAAU,qBAAA,CAAsB,MAAA,EAAQ,OAAO,CAAA;AAErD,IAAM,SAAS,IAAI,MAAA;AAAA,EACjB,IAAA;AAAA,EACA;AAAA,IACE,IAAA;AAAA,IACA,MAAM,OAAA,CAAQ;AAAA,GAChB;AAAA,EACA,EAAE,QAAA;AACJ,CAAA;AAEA,IAAM,aAAa,IAAI,UAAA;AAAA,EACrB,IAAA;AAAA,EACA;AAAA,IACE,SAAS,kBAAA,EAAmB;AAAA,IAC5B,kBAAkB,IAAA,CAAK,gBAAA;AAAA,IACvB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAE,QAAA;AACJ,CAAA;AAEA,IAAIA,MAAA;AAAA,EACF,IAAA;AAAA,EACA;AAAA,IACE,IAAA;AAAA,IACA,SAAS,kBAAA,EAAmB;AAAA,IAC5B,kBAAkB,IAAA,CAAK,gBAAA;AAAA,IACvB,cAAc,UAAA,CAAW,EAAA;AAAA,IACzB,UAAU,IAAA,CAAK,QAAA;AAAA,IACf,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,sBAAA,EAAwB,KAAA;AAAA,IACxB,YAAY,CAAC,MAAA,CAAO,QAAA,CAAS,KAAA,CAAM,MAAM,CAAC;AAAA,GAC5C;AAAA,EACA,EAAE,QAAA;AACJ,CAAA;AAEA,IAAM,QAAA,GAAW,MAAM,SAAA,CAAU,UAAA,CAAW,EAAE,CAAA;AAC9C,IAAM,QAAA,GAAW,gBAAgB,QAAQ,CAAA;AAEzC,IAAM,mBAAA,GAAsB,IAAI,KAAA,CAAM,OAAA,CAAQ,oBAAA,EAAsB;AAAA,EAClE,MAAA,EAAQ,WAAA,CAAA,kBAAA,EAAgC,UAAA,CAAW,EAAE,CAAA,gEAAA;AACvD,CAAC,CAAA;AAED,IAAM,MAAA,GAAS,oBAAoB,MAAA,CAAO,KAAA;AAAA,EAAM,MAC9C,mBAAmB,IAAA,EAAM,QAAA,EAAU,IAAI,MAAA,EAAQ,MAAA,EAAW,QAAQ,UAAU;AAC9E,CAAA;AAEA,IAAO,0BAAQ,OAAA,CAAQ;AAAA,EACrB,MAAA;AAAA,EAEA,aAAA,EAAe;AAAA,IACb,QAAA,EAAU;AAAA,MACR,OAAO,MAAA,CAAO;AAAA,KAChB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,CAAC,kBAAA,CAAmB,QAAQ,CAAC;AAAA;AACtC,GACF;AAAA,EAEA,UAAA,EAAY,CAAC,iBAAA,CAAkB,MAAA,CAAO,GAAG,CAAC;AAC5C,CAAC","file":"index.js","sourcesContent":["import { Provider, SshKey, FloatingIp, Server as TimewebServer } from \"@highstate/timeweb-sdk\"\nimport { timeweb } from \"@highstate/library\"\nimport { forUnit, getResourceComment, interpolate, toPromise } from \"@highstate/pulumi\"\nimport {\n createServerEntity,\n createSshTerminal,\n getOrCreateSshKeyPair,\n l3EndpointToString,\n parseL3Endpoint,\n} from \"@highstate/common\"\nimport { local } from \"@pulumi/command\"\n\nconst { name, args, inputs, secrets, outputs } = forUnit(timeweb.virtualMachine)\n\nconst provider = new Provider(name, { token: inputs.connection.apiToken })\n\nconst keyPair = getOrCreateSshKeyPair(inputs, secrets)\n\nconst sshKey = new SshKey(\n name,\n {\n name,\n body: keyPair.publicKey,\n },\n { provider },\n)\n\nconst floatingIp = new FloatingIp(\n name,\n {\n comment: getResourceComment(),\n availabilityZone: args.availabilityZone,\n ddosGuard: false,\n },\n { provider },\n)\n\nnew TimewebServer(\n name,\n {\n name,\n comment: getResourceComment(),\n availabilityZone: args.availabilityZone,\n floatingIpId: floatingIp.id,\n presetId: args.presetId,\n osId: args.osId,\n isRootPasswordRequired: false,\n sshKeysIds: [sshKey.sshKeyId.apply(Number)],\n },\n { provider },\n)\n\nconst serverIp = await toPromise(floatingIp.ip)\nconst endpoint = parseL3Endpoint(serverIp)\n\nconst availabilityCommand = new local.Command(\"check-availability\", {\n create: interpolate`while ! ping -c 1 ${floatingIp.ip}; do echo \"Waiting for server to be available...\"; sleep 5; done`,\n})\n\nconst server = availabilityCommand.stdout.apply(() =>\n createServerEntity(name, endpoint, 22, \"root\", undefined, keyPair.privateKey),\n)\n\nexport default outputs({\n server,\n\n $statusFields: {\n hostname: {\n value: server.hostname,\n },\n endpoints: {\n value: [l3EndpointToString(endpoint)],\n },\n },\n\n $terminals: [createSshTerminal(server.ssh)],\n})\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/timeweb",
|
3
|
-
"version": "0.9.
|
3
|
+
"version": "0.9.18",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -16,16 +16,16 @@
|
|
16
16
|
"build": "highstate build"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"@highstate/common": "^0.9.
|
20
|
-
"@highstate/k8s": "^0.9.
|
21
|
-
"@highstate/library": "^0.9.
|
22
|
-
"@highstate/pulumi": "^0.9.
|
23
|
-
"@highstate/timeweb-sdk": "^0.9.
|
19
|
+
"@highstate/common": "^0.9.18",
|
20
|
+
"@highstate/k8s": "^0.9.18",
|
21
|
+
"@highstate/library": "^0.9.18",
|
22
|
+
"@highstate/pulumi": "^0.9.18",
|
23
|
+
"@highstate/timeweb-sdk": "^0.9.18",
|
24
24
|
"@pulumi/command": "^1.0.2",
|
25
|
-
"@pulumi/pulumi": "^3.
|
25
|
+
"@pulumi/pulumi": "^3.184.0"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
|
-
"@highstate/cli": "^0.9.
|
28
|
+
"@highstate/cli": "^0.9.18"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "9ebcd7da56b00b8ca08bf52cc8438f527338cd64"
|
31
31
|
}
|