@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appliance.sh/sdk",
3
- "version": "1.7.0",
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 node --module es2022 --outDir dist/esm && npm run postbuild && npm link",
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
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+
3
+ export const portInput = z.number().int().gt(0).lt(65536);
package/src/index.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './models/appliance';
2
2
  export * from './version';
3
+ export * from './result';
4
+ export type * from './result';
@@ -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({
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+
3
+ export const deployment = z.object({
4
+ name: z.string(),
5
+ projectId: z.string(),
6
+ deploymentId: z.string(),
7
+ });
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 };