@highstate/library 0.1.2 → 0.2.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.
- package/package.json +11 -6
- package/dist/index.d.ts +0 -137
- package/dist/index.mjs +0 -220
package/package.json
CHANGED
@@ -1,25 +1,30 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/library",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.0",
|
4
4
|
"type": "module",
|
5
5
|
"module": "dist/index.mjs",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"files": [
|
8
8
|
"dist"
|
9
9
|
],
|
10
|
+
"exports": {
|
11
|
+
".": {
|
12
|
+
"default": "./dist/index.mjs",
|
13
|
+
"types": "./dist/index.d.ts"
|
14
|
+
}
|
15
|
+
},
|
10
16
|
"publishConfig": {
|
11
17
|
"access": "public"
|
12
18
|
},
|
13
19
|
"scripts": {
|
14
|
-
"build": "pkgroll"
|
15
|
-
"dev": "pkgroll --watch"
|
20
|
+
"build": "pkgroll --clean-dist"
|
16
21
|
},
|
17
22
|
"dependencies": {
|
18
|
-
"@highstate/contract": "^0.
|
19
|
-
"
|
23
|
+
"@highstate/contract": "^0.2.0",
|
24
|
+
"@sinclair/typebox": "^0.34.11"
|
20
25
|
},
|
21
26
|
"devDependencies": {
|
22
27
|
"pkgroll": "^2.5.1"
|
23
28
|
},
|
24
|
-
"gitHead": "
|
29
|
+
"gitHead": "41f789ef9d6da623923812bba9783c216605495d"
|
25
30
|
}
|
package/dist/index.d.ts
DELETED
@@ -1,137 +0,0 @@
|
|
1
|
-
import * as _highstate_contract from '@highstate/contract';
|
2
|
-
import { z } from 'zod';
|
3
|
-
|
4
|
-
declare const clusterType: z.ZodObject<{
|
5
|
-
type: z.ZodLiteral<"proxmox.cluster">;
|
6
|
-
endpoint: z.ZodString;
|
7
|
-
insecure: z.ZodOptional<z.ZodBoolean>;
|
8
|
-
nodeName: z.ZodString;
|
9
|
-
username: z.ZodOptional<z.ZodString>;
|
10
|
-
password: z.ZodOptional<z.ZodString>;
|
11
|
-
apiToken: z.ZodOptional<z.ZodString>;
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
13
|
-
type: "proxmox.cluster";
|
14
|
-
endpoint: string;
|
15
|
-
nodeName: string;
|
16
|
-
username?: string | undefined;
|
17
|
-
password?: string | undefined;
|
18
|
-
insecure?: boolean | undefined;
|
19
|
-
apiToken?: string | undefined;
|
20
|
-
}, {
|
21
|
-
type: "proxmox.cluster";
|
22
|
-
endpoint: string;
|
23
|
-
nodeName: string;
|
24
|
-
username?: string | undefined;
|
25
|
-
password?: string | undefined;
|
26
|
-
insecure?: boolean | undefined;
|
27
|
-
apiToken?: string | undefined;
|
28
|
-
}>;
|
29
|
-
declare const imageType: z.ZodObject<{
|
30
|
-
type: z.ZodLiteral<"proxmox.image">;
|
31
|
-
id: z.ZodString;
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
33
|
-
type: "proxmox.image";
|
34
|
-
id: string;
|
35
|
-
}, {
|
36
|
-
type: "proxmox.image";
|
37
|
-
id: string;
|
38
|
-
}>;
|
39
|
-
declare const connection: _highstate_contract.Component<{
|
40
|
-
endpoint: string;
|
41
|
-
nodeName: string;
|
42
|
-
username?: string | undefined;
|
43
|
-
}, {
|
44
|
-
password?: string | undefined;
|
45
|
-
apiToken?: string | undefined;
|
46
|
-
}, {}, {
|
47
|
-
proxmoxCluster: {
|
48
|
-
type: "proxmox.cluster";
|
49
|
-
endpoint: string;
|
50
|
-
nodeName: string;
|
51
|
-
username?: string | undefined;
|
52
|
-
password?: string | undefined;
|
53
|
-
insecure?: boolean | undefined;
|
54
|
-
apiToken?: string | undefined;
|
55
|
-
};
|
56
|
-
}>;
|
57
|
-
declare const image: _highstate_contract.Component<{
|
58
|
-
url: string;
|
59
|
-
}, Record<string, string | undefined>, {
|
60
|
-
proxmoxCluster: {
|
61
|
-
type: "proxmox.cluster";
|
62
|
-
endpoint: string;
|
63
|
-
nodeName: string;
|
64
|
-
username?: string | undefined;
|
65
|
-
password?: string | undefined;
|
66
|
-
insecure?: boolean | undefined;
|
67
|
-
apiToken?: string | undefined;
|
68
|
-
};
|
69
|
-
}, {
|
70
|
-
image: {
|
71
|
-
type: "proxmox.image";
|
72
|
-
id: string;
|
73
|
-
};
|
74
|
-
}>;
|
75
|
-
declare const existingImage: _highstate_contract.Component<{
|
76
|
-
imageId: string;
|
77
|
-
}, {}, {}, {
|
78
|
-
image: {
|
79
|
-
type: "proxmox.image";
|
80
|
-
id: string;
|
81
|
-
};
|
82
|
-
}>;
|
83
|
-
declare const virtualMachine: _highstate_contract.Component<{
|
84
|
-
nodeName?: string | undefined;
|
85
|
-
cores?: number | undefined;
|
86
|
-
sockets?: number | undefined;
|
87
|
-
memory?: number | undefined;
|
88
|
-
ipv4?: string | undefined;
|
89
|
-
ipv4Gateway?: string | undefined;
|
90
|
-
dns?: string[] | undefined;
|
91
|
-
datastoreId?: string | undefined;
|
92
|
-
diskSize?: number | undefined;
|
93
|
-
bridge?: string | undefined;
|
94
|
-
}, Record<string, string | undefined>, {
|
95
|
-
proxmoxCluster: {
|
96
|
-
type: "proxmox.cluster";
|
97
|
-
endpoint: string;
|
98
|
-
nodeName: string;
|
99
|
-
username?: string | undefined;
|
100
|
-
password?: string | undefined;
|
101
|
-
insecure?: boolean | undefined;
|
102
|
-
apiToken?: string | undefined;
|
103
|
-
};
|
104
|
-
image: {
|
105
|
-
type: "proxmox.image";
|
106
|
-
id: string;
|
107
|
-
};
|
108
|
-
sshPublicKey?: {
|
109
|
-
type: "ssh.key";
|
110
|
-
publicKey: string;
|
111
|
-
} | undefined;
|
112
|
-
}, {
|
113
|
-
server: {
|
114
|
-
type: "server";
|
115
|
-
endpoint: string;
|
116
|
-
sshCredentials?: {
|
117
|
-
type: "server.sshCredentials";
|
118
|
-
endpoint?: string | undefined;
|
119
|
-
port?: number | undefined;
|
120
|
-
username?: string | undefined;
|
121
|
-
password?: string | undefined;
|
122
|
-
privateKey?: string | undefined;
|
123
|
-
} | undefined;
|
124
|
-
};
|
125
|
-
}>;
|
126
|
-
|
127
|
-
declare const proxmox_clusterType: typeof clusterType;
|
128
|
-
declare const proxmox_connection: typeof connection;
|
129
|
-
declare const proxmox_existingImage: typeof existingImage;
|
130
|
-
declare const proxmox_image: typeof image;
|
131
|
-
declare const proxmox_imageType: typeof imageType;
|
132
|
-
declare const proxmox_virtualMachine: typeof virtualMachine;
|
133
|
-
declare namespace proxmox {
|
134
|
-
export { proxmox_clusterType as clusterType, proxmox_connection as connection, proxmox_existingImage as existingImage, proxmox_image as image, proxmox_imageType as imageType, proxmox_virtualMachine as virtualMachine };
|
135
|
-
}
|
136
|
-
|
137
|
-
export { proxmox };
|
package/dist/index.mjs
DELETED
@@ -1,220 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { defineComponent as defineComponent$1, defineUnit } from '@highstate/contract';
|
3
|
-
import { defineComponent } from '@highstate/contract/component';
|
4
|
-
|
5
|
-
const serverSshCredentialsType = z.object({
|
6
|
-
type: z.literal("server.sshCredentials"),
|
7
|
-
endpoint: z.string().optional(),
|
8
|
-
port: z.number().optional(),
|
9
|
-
username: z.string().optional(),
|
10
|
-
password: z.string().optional(),
|
11
|
-
privateKey: z.string().optional()
|
12
|
-
});
|
13
|
-
const serverType = z.object({
|
14
|
-
type: z.literal("server"),
|
15
|
-
endpoint: z.string(),
|
16
|
-
sshCredentials: serverSshCredentialsType.optional()
|
17
|
-
});
|
18
|
-
|
19
|
-
const sshKeyPairType = z.object({
|
20
|
-
type: z.literal("ssh.key"),
|
21
|
-
privateKey: z.string(),
|
22
|
-
publicKey: z.string()
|
23
|
-
});
|
24
|
-
const sshPublicKeyType = z.object({
|
25
|
-
type: z.literal("ssh.key"),
|
26
|
-
publicKey: z.string()
|
27
|
-
});
|
28
|
-
defineComponent({
|
29
|
-
type: "ssh.key_pair",
|
30
|
-
meta: {
|
31
|
-
displayName: "SSH Key Pair",
|
32
|
-
description: "The private and public SSH key pair.",
|
33
|
-
category: "SSH",
|
34
|
-
primaryIcon: "charm:key",
|
35
|
-
primaryIconColor: "#ffffff",
|
36
|
-
secondaryIcon: "mdi:lock",
|
37
|
-
secondaryIconColor: "#ffffff"
|
38
|
-
},
|
39
|
-
secrets: z.object({
|
40
|
-
privateKey: z.string()
|
41
|
-
}),
|
42
|
-
outputs: z.object({
|
43
|
-
sshKeyPair: sshKeyPairType,
|
44
|
-
sshPublicKey: sshPublicKeyType
|
45
|
-
}),
|
46
|
-
create({ secrets }) {
|
47
|
-
return {
|
48
|
-
sshKeyPair: {
|
49
|
-
type: "ssh.key"
|
50
|
-
}
|
51
|
-
};
|
52
|
-
}
|
53
|
-
});
|
54
|
-
defineComponent({
|
55
|
-
type: "ssh.public_key",
|
56
|
-
meta: {
|
57
|
-
displayName: "SSH Public Key",
|
58
|
-
description: "Only the public SSH key.",
|
59
|
-
category: "SSH",
|
60
|
-
primaryIcon: "charm:key",
|
61
|
-
primaryIconColor: "#ffffff",
|
62
|
-
secondaryIcon: "mdi:public",
|
63
|
-
secondaryIconColor: "#ffffff"
|
64
|
-
},
|
65
|
-
args: z.object({
|
66
|
-
publicKey: z.string()
|
67
|
-
}),
|
68
|
-
outputs: z.object({
|
69
|
-
sshPublicKey: sshPublicKeyType
|
70
|
-
}),
|
71
|
-
create({ args }) {
|
72
|
-
return {
|
73
|
-
sshPublicKey: {
|
74
|
-
type: "ssh.key",
|
75
|
-
publicKey: args.publicKey
|
76
|
-
}
|
77
|
-
};
|
78
|
-
}
|
79
|
-
});
|
80
|
-
|
81
|
-
const clusterType = z.object({
|
82
|
-
type: z.literal("proxmox.cluster"),
|
83
|
-
endpoint: z.string(),
|
84
|
-
insecure: z.boolean().optional(),
|
85
|
-
nodeName: z.string(),
|
86
|
-
username: z.string().optional(),
|
87
|
-
password: z.string().optional(),
|
88
|
-
apiToken: z.string().optional()
|
89
|
-
});
|
90
|
-
const imageType = z.object({
|
91
|
-
type: z.literal("proxmox.image"),
|
92
|
-
id: z.string()
|
93
|
-
});
|
94
|
-
const connection = defineComponent$1({
|
95
|
-
type: "proxmox.connection",
|
96
|
-
meta: {
|
97
|
-
displayName: "Proxmox Connection",
|
98
|
-
description: "The connection to an existing Proxmox cluster.",
|
99
|
-
category: "Proxmox",
|
100
|
-
color: "#373b3e",
|
101
|
-
primaryIcon: "simple-icons:proxmox",
|
102
|
-
primaryIconColor: "#e56901",
|
103
|
-
secondaryIcon: "codicon:vm"
|
104
|
-
},
|
105
|
-
args: z.object({
|
106
|
-
endpoint: z.string(),
|
107
|
-
nodeName: z.string(),
|
108
|
-
username: z.string().optional()
|
109
|
-
}),
|
110
|
-
secrets: z.object({
|
111
|
-
password: z.string().optional(),
|
112
|
-
apiToken: z.string().optional()
|
113
|
-
}),
|
114
|
-
outputs: z.object({
|
115
|
-
proxmoxCluster: clusterType
|
116
|
-
}),
|
117
|
-
create({ args, secrets }) {
|
118
|
-
return {
|
119
|
-
proxmoxCluster: {
|
120
|
-
type: "proxmox.cluster",
|
121
|
-
nodeName: args.nodeName,
|
122
|
-
endpoint: args.endpoint,
|
123
|
-
username: args.username,
|
124
|
-
password: secrets.password,
|
125
|
-
apiToken: secrets.apiToken
|
126
|
-
}
|
127
|
-
};
|
128
|
-
}
|
129
|
-
});
|
130
|
-
const image = defineUnit({
|
131
|
-
type: "proxmox.image",
|
132
|
-
meta: {
|
133
|
-
displayName: "Proxmox Image",
|
134
|
-
description: "The image to upload to a Proxmox cluster.",
|
135
|
-
category: "Proxmox",
|
136
|
-
color: "#373b3e",
|
137
|
-
primaryIcon: "simple-icons:proxmox",
|
138
|
-
primaryIconColor: "#e56901",
|
139
|
-
secondaryIcon: "mage:compact-disk-fill"
|
140
|
-
},
|
141
|
-
args: z.object({
|
142
|
-
url: z.string()
|
143
|
-
}),
|
144
|
-
inputs: z.object({
|
145
|
-
proxmoxCluster: clusterType
|
146
|
-
}),
|
147
|
-
outputs: z.object({
|
148
|
-
image: imageType
|
149
|
-
})
|
150
|
-
});
|
151
|
-
const existingImage = defineComponent$1({
|
152
|
-
type: "proxmox.existing_image",
|
153
|
-
meta: {
|
154
|
-
displayName: "Proxmox Existing Image",
|
155
|
-
description: "The existing image on a Proxmox cluster.",
|
156
|
-
category: "Proxmox",
|
157
|
-
color: "#373b3e",
|
158
|
-
primaryIcon: "simple-icons:proxmox",
|
159
|
-
primaryIconColor: "#e56901",
|
160
|
-
secondaryIcon: "mage:compact-disk-fill"
|
161
|
-
},
|
162
|
-
args: z.object({
|
163
|
-
imageId: z.string()
|
164
|
-
}),
|
165
|
-
outputs: z.object({
|
166
|
-
image: imageType
|
167
|
-
}),
|
168
|
-
create({ args }) {
|
169
|
-
return {
|
170
|
-
image: {
|
171
|
-
type: "proxmox.image",
|
172
|
-
id: args.imageId
|
173
|
-
}
|
174
|
-
};
|
175
|
-
}
|
176
|
-
});
|
177
|
-
const virtualMachine = defineUnit({
|
178
|
-
type: "proxmox.virtual_machine",
|
179
|
-
meta: {
|
180
|
-
displayName: "Proxmox Virtual Machine",
|
181
|
-
description: "The virtual machine on a Proxmox cluster.",
|
182
|
-
category: "Proxmox",
|
183
|
-
color: "#373b3e",
|
184
|
-
primaryIcon: "simple-icons:proxmox",
|
185
|
-
primaryIconColor: "#e56901",
|
186
|
-
secondaryIcon: "codicon:vm"
|
187
|
-
},
|
188
|
-
args: z.object({
|
189
|
-
nodeName: z.string().optional(),
|
190
|
-
cores: z.number().optional(),
|
191
|
-
sockets: z.number().optional(),
|
192
|
-
memory: z.number().optional(),
|
193
|
-
ipv4: z.string().optional(),
|
194
|
-
ipv4Gateway: z.string().optional(),
|
195
|
-
dns: z.array(z.string()).optional(),
|
196
|
-
datastoreId: z.string().optional(),
|
197
|
-
diskSize: z.number().optional(),
|
198
|
-
bridge: z.string().optional()
|
199
|
-
}),
|
200
|
-
inputs: z.object({
|
201
|
-
proxmoxCluster: clusterType,
|
202
|
-
image: imageType,
|
203
|
-
sshPublicKey: sshPublicKeyType.optional()
|
204
|
-
}),
|
205
|
-
outputs: z.object({
|
206
|
-
server: serverType
|
207
|
-
})
|
208
|
-
});
|
209
|
-
|
210
|
-
var proxmox = /*#__PURE__*/Object.freeze({
|
211
|
-
__proto__: null,
|
212
|
-
clusterType: clusterType,
|
213
|
-
connection: connection,
|
214
|
-
existingImage: existingImage,
|
215
|
-
image: image,
|
216
|
-
imageType: imageType,
|
217
|
-
virtualMachine: virtualMachine
|
218
|
-
});
|
219
|
-
|
220
|
-
export { proxmox };
|