@appliance.sh/sdk 1.7.0 → 1.9.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 +3 -3
- package/src/common.ts +3 -0
- package/src/index.ts +2 -0
- package/src/models/appliance.ts +10 -0
- package/src/models/deployment.ts +7 -0
- package/src/result.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appliance.sh/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.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",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
"require": "./dist/cjs/index.js",
|
|
12
12
|
"import": "./dist/esm/index.js",
|
|
13
|
-
"types": "./dist/types"
|
|
13
|
+
"types": "./dist/types/index.d.ts"
|
|
14
14
|
},
|
|
15
15
|
"types": "./dist/types",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "tsc --module commonjs --outDir dist/cjs && tsc --moduleResolution
|
|
17
|
+
"build": "tsc --module commonjs --outDir dist/cjs && tsc --moduleResolution nodenext --module NodeNext --outDir dist/esm && npm run postbuild && npm link",
|
|
18
18
|
"clean": "rm -rf ./dist/",
|
|
19
19
|
"dev:setup": "npm link",
|
|
20
20
|
"postbuild": "npx ts-node scripts/postbuild.ts",
|
package/src/common.ts
ADDED
package/src/index.ts
CHANGED
package/src/models/appliance.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { portInput } from '../common';
|
|
2
3
|
|
|
3
4
|
export const applianceBaseInput = z.object({
|
|
4
5
|
manifest: z.literal('v1'),
|
|
@@ -9,6 +10,15 @@ export const applianceBaseInput = z.object({
|
|
|
9
10
|
|
|
10
11
|
export const applianceTypeContainerInput = applianceBaseInput.extend({
|
|
11
12
|
type: z.literal('container'),
|
|
13
|
+
port: portInput,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const applianceTypeInput = applianceBaseInput.extend({
|
|
17
|
+
type: z.literal('framework'),
|
|
18
|
+
framework: z.string().optional().default('auto'),
|
|
19
|
+
port: portInput.optional(),
|
|
20
|
+
includes: z.array(z.string()).optional(),
|
|
21
|
+
excludes: z.array(z.string()).optional(),
|
|
12
22
|
});
|
|
13
23
|
|
|
14
24
|
export const applianceTypeOtherInput = applianceBaseInput.extend({
|
package/src/result.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type Result<T> = ResultSuccess<T> | ResultError<T>;
|
|
2
|
+
export type ResultSuccess<T> = { success: true; data: T; error?: never };
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
export type ResultError<T> = { success: false; data?: never; error: Error };
|