@valbuild/server 0.60.2 → 0.60.4

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.
@@ -43,11 +43,14 @@ export declare class LocalValServer extends ValServer {
43
43
  private badRequest;
44
44
  protected ensureRemoteFSInitialized(): Promise<result.Result<undefined, ValServerError>>;
45
45
  protected getModule(moduleId: ModuleId): Promise<SerializedModuleContent>;
46
- protected execCommit(patches: [PatchId, ModuleId, Patch][]): Promise<Record<ModuleId, {
47
- patches: {
48
- applied: PatchId[];
49
- };
50
- }>>;
46
+ protected execCommit(patches: [PatchId, ModuleId, Patch][]): Promise<{
47
+ status: 200;
48
+ json: Record<ModuleId, {
49
+ patches: {
50
+ applied: PatchId[];
51
+ };
52
+ }>;
53
+ } | ValServerError>;
51
54
  authorize(): Promise<ValServerRedirectResult<VAL_STATE_COOKIE>>;
52
55
  callback(): Promise<ValServerRedirectResult<VAL_STATE_COOKIE | VAL_SESSION_COOKIE | VAL_ENABLE_COOKIE_NAME>>;
53
56
  logout(): Promise<ValServerResult<VAL_STATE_COOKIE | VAL_SESSION_COOKIE>>;
@@ -2,6 +2,7 @@
2
2
  import { ApiCommitResponse, ApiGetPatchResponse, ApiPostPatchResponse, ApiPostValidationErrorResponse, ApiTreeResponse, ApiDeletePatchResponse, ApiPostValidationResponse } from "@valbuild/core";
3
3
  import { VAL_ENABLE_COOKIE_NAME, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, ValCookies, ValServerError, ValServerJsonResult, ValServerRedirectResult, ValServerResult, ValSession } from "@valbuild/shared/internal";
4
4
  import { result } from "@valbuild/core/fp";
5
+ import { Operation } from "@valbuild/core/patch";
5
6
  import { Patch } from "./patch/validation.js";
6
7
  import { ModuleId, PatchId } from "@valbuild/core";
7
8
  import { SerializedModuleContent } from "./SerializedModuleContent.js";
@@ -58,11 +59,14 @@ export declare abstract class ValServer implements IValServer {
58
59
  * */
59
60
  protected abstract ensureRemoteFSInitialized(errorMessageType: string, cookies: ValCookies<VAL_SESSION_COOKIE>): Promise<result.Result<undefined, ValServerError>>;
60
61
  protected abstract getModule(moduleId: ModuleId): Promise<SerializedModuleContent>;
61
- protected abstract execCommit(patches: [PatchId, ModuleId, Patch][], cookies: ValCookies<VAL_SESSION_COOKIE>): Promise<Record<ModuleId, {
62
- patches: {
63
- applied: PatchId[];
64
- };
65
- }>>;
62
+ protected abstract execCommit(patches: [PatchId, ModuleId, Patch][], cookies: ValCookies<VAL_SESSION_COOKIE>): Promise<{
63
+ status: 200;
64
+ json: Record<ModuleId, {
65
+ patches: {
66
+ applied: PatchId[];
67
+ };
68
+ }>;
69
+ } | ValServerError>;
66
70
  abstract getFiles(filePath: string, query: {
67
71
  sha256?: string;
68
72
  }, cookies: ValCookies<VAL_SESSION_COOKIE>): Promise<ValServerResult<never, ReadableStream<Uint8Array>>>;
@@ -140,3 +144,11 @@ export interface IValServer {
140
144
  }, cookies: ValCookies<VAL_SESSION_COOKIE>): Promise<ValServerResult<never, ReadableStream<Uint8Array>>>;
141
145
  }
142
146
  export declare function guessMimeTypeFromPath(filePath: string): string | null;
147
+ export declare function isCachedPatchFileOp(op: Operation): op is {
148
+ op: "file";
149
+ path: string[];
150
+ filePath: string;
151
+ value: {
152
+ sha256: string;
153
+ };
154
+ };