@valbuild/server 0.72.4 → 0.73.1
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/README.md +1 -2
- package/dist/declarations/src/ValFSHost.d.ts +1 -0
- package/dist/declarations/src/createFixPatch.d.ts +10 -2
- package/dist/declarations/src/getSettings.d.ts +34 -0
- package/dist/declarations/src/index.d.ts +3 -0
- package/dist/declarations/src/patch/ts/syntax.d.ts +3 -0
- package/dist/declarations/src/personalAccessTokens.d.ts +10 -0
- package/dist/declarations/src/uploadRemoteFile.d.ts +25 -0
- package/dist/valbuild-server.cjs.dev.js +1016 -101
- package/dist/valbuild-server.cjs.prod.js +1016 -101
- package/dist/valbuild-server.esm.js +1012 -103
- package/package.json +4 -4
package/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
/// <reference types="node" />
|
3
3
|
import ts from "typescript";
|
4
4
|
import { ValFS } from "./ValFS.js";
|
5
|
+
import { Buffer } from "buffer";
|
5
6
|
/**
|
6
7
|
* An implementation of methods in the various ts.*Host interfaces
|
7
8
|
* that uses ValFS to resolve modules and read/write files.
|
@@ -1,8 +1,16 @@
|
|
1
|
-
import { SourcePath, ValidationError } from "@valbuild/core";
|
1
|
+
import { FileMetadata, ImageMetadata, SerializedSchema, Source, SourcePath, ValidationError } from "@valbuild/core";
|
2
2
|
import { Patch } from "@valbuild/core/patch";
|
3
3
|
export declare function createFixPatch(config: {
|
4
4
|
projectRoot: string;
|
5
|
-
|
5
|
+
remoteHost: string;
|
6
|
+
}, apply: boolean, sourcePath: SourcePath, validationError: ValidationError, remoteFiles: {
|
7
|
+
[sourcePath: SourcePath]: {
|
8
|
+
ref: string;
|
9
|
+
metadata?: Record<string, unknown>;
|
10
|
+
};
|
11
|
+
}, moduleSource?: Source, moduleSchema?: SerializedSchema): Promise<{
|
6
12
|
patch: Patch;
|
7
13
|
remainingErrors: ValidationError[];
|
8
14
|
} | undefined>;
|
15
|
+
export declare function getImageMetadata(projectRoot: string, validationError: ValidationError): Promise<ImageMetadata>;
|
16
|
+
export declare function getFileMetadata(projectRoot: string, validationError: ValidationError): Promise<FileMetadata>;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { z } from "zod";
|
2
|
+
declare const SettingsSchema: z.ZodObject<{
|
3
|
+
publicProjectId: z.ZodString;
|
4
|
+
remoteFileBuckets: z.ZodArray<z.ZodObject<{
|
5
|
+
bucket: z.ZodString;
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
7
|
+
bucket: string;
|
8
|
+
}, {
|
9
|
+
bucket: string;
|
10
|
+
}>, "many">;
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
12
|
+
publicProjectId: string;
|
13
|
+
remoteFileBuckets: {
|
14
|
+
bucket: string;
|
15
|
+
}[];
|
16
|
+
}, {
|
17
|
+
publicProjectId: string;
|
18
|
+
remoteFileBuckets: {
|
19
|
+
bucket: string;
|
20
|
+
}[];
|
21
|
+
}>;
|
22
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
23
|
+
export declare function getSettings(projectName: string, auth: {
|
24
|
+
pat: string;
|
25
|
+
} | {
|
26
|
+
apiKey: string;
|
27
|
+
}): Promise<{
|
28
|
+
success: true;
|
29
|
+
data: Settings;
|
30
|
+
} | {
|
31
|
+
success: false;
|
32
|
+
message: string;
|
33
|
+
}>;
|
34
|
+
export {};
|
@@ -12,3 +12,6 @@ export { formatSyntaxErrorTree } from "./patch/ts/syntax.js";
|
|
12
12
|
export { createFixPatch } from "./createFixPatch.js";
|
13
13
|
export * from "./jwt.js";
|
14
14
|
export type { ValServer } from "./ValServer.js";
|
15
|
+
export { getSettings } from "./getSettings.js";
|
16
|
+
export { getPersonalAccessTokenPath, parsePersonalAccessTokenFile, } from "./personalAccessTokens.js";
|
17
|
+
export { uploadRemoteFile } from "./uploadRemoteFile.js";
|
@@ -39,10 +39,13 @@ export declare function evaluateExpression(value: ts.Expression): result.Result<
|
|
39
39
|
export declare function findObjectPropertyAssignment(value: ts.ObjectLiteralExpression, key: string): result.Result<LiteralPropertyAssignment | undefined, ValSyntaxErrorTree>;
|
40
40
|
export declare function isValFileMethodCall(node: ts.Expression): node is ts.CallExpression;
|
41
41
|
export declare function isValImageMethodCall(node: ts.Expression): node is ts.CallExpression;
|
42
|
+
export declare function isValRemoteMethodCall(node: ts.Expression): node is ts.CallExpression;
|
42
43
|
export declare function findValFileNodeArg(node: ts.CallExpression): result.Result<ts.StringLiteral, ValSyntaxErrorTree>;
|
44
|
+
export declare function findValRemoteNodeArg(node: ts.CallExpression): result.Result<ts.StringLiteral, ValSyntaxErrorTree>;
|
43
45
|
export declare function findValImageNodeArg(node: ts.CallExpression): result.Result<ts.StringLiteral, ValSyntaxErrorTree>;
|
44
46
|
export declare function findValFileMetadataArg(node: ts.CallExpression): result.Result<ts.ObjectLiteralExpression | undefined, ValSyntaxErrorTree>;
|
45
47
|
export declare function findValImageMetadataArg(node: ts.CallExpression): result.Result<ts.ObjectLiteralExpression | undefined, ValSyntaxErrorTree>;
|
48
|
+
export declare function findValRemoteMetadataArg(node: ts.CallExpression): result.Result<ts.ObjectLiteralExpression | undefined, ValSyntaxErrorTree>;
|
46
49
|
/**
|
47
50
|
* Given a list of expressions, validates that all the expressions are not
|
48
51
|
* spread elements. In other words, it ensures that the expressions are the
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
/// <reference types="node" />
|
3
|
+
import { SerializedFileSchema, SerializedImageSchema } from "@valbuild/core";
|
4
|
+
export declare function uploadRemoteFile(remoteHost: string, fileBuffer: Buffer, publicProjectId: string, bucket: string, filePath: `public/val/${string}`, schema: SerializedImageSchema | SerializedFileSchema, metadata: Record<string, unknown> | undefined, auth: {
|
5
|
+
pat: string;
|
6
|
+
} | {
|
7
|
+
apiKey: string;
|
8
|
+
}): Promise<{
|
9
|
+
success: true;
|
10
|
+
ref: string;
|
11
|
+
} | {
|
12
|
+
success: false;
|
13
|
+
error: string;
|
14
|
+
}>;
|
15
|
+
export declare function uploadRemoteRef(fileBuffer: Buffer, ref: string, auth: {
|
16
|
+
pat: string;
|
17
|
+
} | {
|
18
|
+
apiKey: string;
|
19
|
+
}): Promise<{
|
20
|
+
success: true;
|
21
|
+
ref: string;
|
22
|
+
} | {
|
23
|
+
success: false;
|
24
|
+
error: string;
|
25
|
+
}>;
|