@valbuild/core 0.75.4 → 0.76.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/dist/declarations/src/patch/index.d.ts +1 -1
- package/dist/declarations/src/patch/operation.d.ts +18 -19
- package/dist/{index-b1932ca0.cjs.dev.js → index-895564f9.cjs.dev.js} +1 -1
- package/dist/{index-1c1fec05.esm.js → index-ba3bd117.esm.js} +1 -1
- package/dist/{index-b141017e.cjs.prod.js → index-ee3d5938.cjs.prod.js} +1 -1
- package/dist/valbuild-core.cjs.dev.js +1 -1
- package/dist/valbuild-core.cjs.prod.js +1 -1
- package/dist/valbuild-core.esm.js +1 -1
- package/package.json +1 -1
- package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
- package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
- package/patch/dist/valbuild-core-patch.esm.js +2 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
export { JSONOps } from "./json.js";
|
2
|
-
export { type OperationJSON, type Operation } from "./operation.js";
|
2
|
+
export { type OperationJSON, type Operation, type FileOperation, } from "./operation.js";
|
3
3
|
export { parsePatch, parseJSONPointer, formatJSONPointer } from "./parse.js";
|
4
4
|
export { type JSONValue, type Ops, PatchError, type ReadonlyJSONValue, } from "./ops.js";
|
5
5
|
export { type PatchJSON, type Patch, applyPatch, type PatchBlock, type ParentRef, } from "./patch.js";
|
@@ -1,5 +1,20 @@
|
|
1
1
|
import { array } from "../fp/index.js";
|
2
2
|
import type { JSONValue } from "./ops.js";
|
3
|
+
type FileOperationBase<PathType> = {
|
4
|
+
op: "file";
|
5
|
+
metadata?: JSONValue;
|
6
|
+
/** path of the top-most element where the schema of the element points to */
|
7
|
+
path: PathType;
|
8
|
+
/** unless remote: file path relative to project (starts with /public, e.g. /public/example.png), for remote: the whole remote ref */
|
9
|
+
filePath: string;
|
10
|
+
/** files can be nested within an object (for richtext), in order to find the actual file element this path can be used (we use this to add the patch_id on files) */
|
11
|
+
nestedFilePath?: string[];
|
12
|
+
value: JSONValue;
|
13
|
+
/** true if this is a remote file */
|
14
|
+
remote: boolean;
|
15
|
+
};
|
16
|
+
type FileOperationJSON = FileOperationBase<string>;
|
17
|
+
export type FileOperation = FileOperationBase<string[]>;
|
3
18
|
/**
|
4
19
|
* Raw JSON patch operation.
|
5
20
|
*/
|
@@ -26,13 +41,7 @@ export type OperationJSON = {
|
|
26
41
|
op: "test";
|
27
42
|
path: string;
|
28
43
|
value: JSONValue;
|
29
|
-
} |
|
30
|
-
op: "file";
|
31
|
-
path: string;
|
32
|
-
filePath: string;
|
33
|
-
value: JSONValue;
|
34
|
-
remote: boolean;
|
35
|
-
};
|
44
|
+
} | FileOperationJSON;
|
36
45
|
/**
|
37
46
|
* Parsed form of JSON patch operation.
|
38
47
|
*/
|
@@ -62,15 +71,5 @@ export type Operation = {
|
|
62
71
|
op: "test";
|
63
72
|
path: string[];
|
64
73
|
value: JSONValue;
|
65
|
-
} |
|
66
|
-
|
67
|
-
/** path of the top-most element where the schema of the element points to */
|
68
|
-
path: string[];
|
69
|
-
/** file path relative to project (starts with /public, e.g. /public/example.png) */
|
70
|
-
filePath: string;
|
71
|
-
/** files can be nested within an object (for richtext), in order to find the actual file element this path can be used (we use this to add the patch_id on files) */
|
72
|
-
nestedFilePath?: string[];
|
73
|
-
value: JSONValue;
|
74
|
-
/** true if this is a remote file */
|
75
|
-
remote: boolean;
|
76
|
-
};
|
74
|
+
} | FileOperation;
|
75
|
+
export {};
|
@@ -3083,7 +3083,7 @@ function convertRemoteSource(src) {
|
|
3083
3083
|
var splitRemoteRefDataRes = splitRemoteRef(src[FILE_REF_PROP]);
|
3084
3084
|
if (splitRemoteRefDataRes.status === "success") {
|
3085
3085
|
return {
|
3086
|
-
url: "/api/val/files/" + splitRemoteRefDataRes.filePath + "?patch_id=".concat(src["patch_id"], "&remote=true"),
|
3086
|
+
url: "/api/val/files/" + splitRemoteRefDataRes.filePath + "?patch_id=".concat(src["patch_id"], "&remote=true&ref=").concat(encodeURIComponent(src[FILE_REF_PROP])),
|
3087
3087
|
metadata: src.metadata
|
3088
3088
|
};
|
3089
3089
|
} else {
|
@@ -3081,7 +3081,7 @@ function convertRemoteSource(src) {
|
|
3081
3081
|
var splitRemoteRefDataRes = splitRemoteRef(src[FILE_REF_PROP]);
|
3082
3082
|
if (splitRemoteRefDataRes.status === "success") {
|
3083
3083
|
return {
|
3084
|
-
url: "/api/val/files/" + splitRemoteRefDataRes.filePath + "?patch_id=".concat(src["patch_id"], "&remote=true"),
|
3084
|
+
url: "/api/val/files/" + splitRemoteRefDataRes.filePath + "?patch_id=".concat(src["patch_id"], "&remote=true&ref=").concat(encodeURIComponent(src[FILE_REF_PROP])),
|
3085
3085
|
metadata: src.metadata
|
3086
3086
|
};
|
3087
3087
|
} else {
|
@@ -3083,7 +3083,7 @@ function convertRemoteSource(src) {
|
|
3083
3083
|
var splitRemoteRefDataRes = splitRemoteRef(src[FILE_REF_PROP]);
|
3084
3084
|
if (splitRemoteRefDataRes.status === "success") {
|
3085
3085
|
return {
|
3086
|
-
url: "/api/val/files/" + splitRemoteRefDataRes.filePath + "?patch_id=".concat(src["patch_id"], "&remote=true"),
|
3086
|
+
url: "/api/val/files/" + splitRemoteRefDataRes.filePath + "?patch_id=".concat(src["patch_id"], "&remote=true&ref=").concat(encodeURIComponent(src[FILE_REF_PROP])),
|
3087
3087
|
metadata: src.metadata
|
3088
3088
|
};
|
3089
3089
|
} else {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { A as ArraySchema, B as BooleanSchema, e as DEFAULT_APP_HOST, D as DEFAULT_CONTENT_HOST, f as DEFAULT_VAL_REMOTE_HOST, o as DateSchema, F as FATAL_ERROR_TYPES, g as FILE_REF_PROP, h as FILE_REF_SUBTYPE_TAG, n as FileSchema, G as GenericSelector, l as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, p as RichTextSchema, S as Schema, k as StringSchema, U as UnionSchema, V as VAL_EXTENSION, j as derefPatch, q as deserializeSchema, i as initVal, m as modules } from './index-
|
1
|
+
export { A as ArraySchema, B as BooleanSchema, e as DEFAULT_APP_HOST, D as DEFAULT_CONTENT_HOST, f as DEFAULT_VAL_REMOTE_HOST, o as DateSchema, F as FATAL_ERROR_TYPES, g as FILE_REF_PROP, h as FILE_REF_SUBTYPE_TAG, n as FileSchema, G as GenericSelector, l as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, p as RichTextSchema, S as Schema, k as StringSchema, U as UnionSchema, V as VAL_EXTENSION, j as derefPatch, q as deserializeSchema, i as initVal, m as modules } from './index-ba3bd117.esm.js';
|
2
2
|
import './result-daff1cae.esm.js';
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
5
|
+
var dist_valbuildCore = require('../../dist/index-895564f9.cjs.dev.js');
|
6
6
|
var result = require('../../dist/result-bb1f436e.cjs.dev.js');
|
7
7
|
var util = require('../../dist/util-b213092b.cjs.dev.js');
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
5
|
+
var dist_valbuildCore = require('../../dist/index-ee3d5938.cjs.prod.js');
|
6
6
|
var result = require('../../dist/result-787e35f6.cjs.prod.js');
|
7
7
|
var util = require('../../dist/util-030d8a1f.cjs.prod.js');
|
8
8
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-
|
2
|
-
export { P as PatchError } from '../../dist/index-
|
1
|
+
import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-ba3bd117.esm.js';
|
2
|
+
export { P as PatchError } from '../../dist/index-ba3bd117.esm.js';
|
3
3
|
import { f as isNonEmpty, e as err, o as ok, m as map, g as flatMap, i as isErr, h as flatMapReduce, j as filterOrElse, k as mapErr, l as map$1, n as all, p as flatten, q as allT } from '../../dist/result-daff1cae.esm.js';
|
4
4
|
import { p as pipe } from '../../dist/util-18613e99.esm.js';
|
5
5
|
|