@appliance.sh/sdk 1.9.0 → 1.10.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appliance.sh/sdk",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "SDK for installing, running, and developing applications for the Appliance platform",
5
5
  "repository": "https://github.com/appliance-sh/appliance.sh",
6
6
  "license": "MIT",
@@ -1,20 +1,35 @@
1
1
  import { z } from 'zod';
2
2
  import { portInput } from '../common';
3
3
 
4
+ export enum ApplianceType {
5
+ container = 'container',
6
+ framework = 'framework',
7
+ other = 'other',
8
+ }
9
+
10
+ export enum ApplianceFramework {
11
+ Auto = 'auto',
12
+ Python = 'python',
13
+ Node = 'node',
14
+ Other = 'other',
15
+ }
16
+
17
+ export const applianceTypeSchema = z.enum(ApplianceType);
18
+
4
19
  export const applianceBaseInput = z.object({
5
20
  manifest: z.literal('v1'),
6
21
  name: z.string(),
7
- version: z.string(),
8
- scripts: z.record(z.string(), z.string()),
22
+ version: z.string().optional(),
23
+ scripts: z.record(z.string(), z.string()).optional(),
9
24
  });
10
25
 
11
26
  export const applianceTypeContainerInput = applianceBaseInput.extend({
12
- type: z.literal('container'),
27
+ type: z.literal(applianceTypeSchema.enum.container),
13
28
  port: portInput,
14
29
  });
15
30
 
16
- export const applianceTypeInput = applianceBaseInput.extend({
17
- type: z.literal('framework'),
31
+ export const applianceTypeFrameworkInput = applianceBaseInput.extend({
32
+ type: z.literal(applianceTypeSchema.enum.framework),
18
33
  framework: z.string().optional().default('auto'),
19
34
  port: portInput.optional(),
20
35
  includes: z.array(z.string()).optional(),
@@ -22,10 +37,14 @@ export const applianceTypeInput = applianceBaseInput.extend({
22
37
  });
23
38
 
24
39
  export const applianceTypeOtherInput = applianceBaseInput.extend({
25
- type: z.literal('other'),
40
+ type: z.literal(applianceTypeSchema.enum.other),
26
41
  });
27
42
 
28
- export const applianceInput = z.discriminatedUnion('type', [applianceTypeContainerInput, applianceTypeOtherInput]);
43
+ export const applianceInput = z.discriminatedUnion('type', [
44
+ applianceTypeContainerInput,
45
+ applianceTypeFrameworkInput,
46
+ applianceTypeOtherInput,
47
+ ]);
29
48
 
30
49
  export type ApplianceInput = z.infer<typeof applianceInput>;
31
50
  export type Appliance = z.output<typeof applianceInput>;