@dialecte/core 0.4.6 → 0.4.7
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/document/query/snapshot/get-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/snapshot.types.d.ts +7 -0
- package/dist/document/query/snapshot/snapshot.types.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{project-wohrish5.js → project-DxIu-3AU.js} +7 -6
- package/dist/test.js +1 -1
- package/dist/xml/build/serialize.d.ts +5 -3
- package/dist/xml/build/serialize.d.ts.map +1 -1
- package/dist/xml/build/serialize.types.d.ts +12 -0
- package/dist/xml/build/serialize.types.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/document/query/snapshot/get-snapshot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAqB,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC7F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAc,MAAM,SAAS,CAAA;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,aAAa,SAAS,iBAAiB,EAAE,MAAM,EAAE;IAClF,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,OAAO,CAAC,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;CAC3C,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM,GAAG,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"get-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/document/query/snapshot/get-snapshot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAqB,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC7F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAc,MAAM,SAAS,CAAA;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,aAAa,SAAS,iBAAiB,EAAE,MAAM,EAAE;IAClF,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,OAAO,CAAC,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;CAC3C,GAAG,OAAO,CAAC,aAAa,GAAG,MAAM,GAAG,cAAc,CAAC,CA4BnD"}
|
|
@@ -42,6 +42,13 @@ export type GetSnapshotOptions<GenericConfig extends AnyDialecteConfig, GenericE
|
|
|
42
42
|
* nested in its file rather than a standalone document.
|
|
43
43
|
*/
|
|
44
44
|
declareNamespaces?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* For `as: 'xml'` / `'both'`: prepend the XML prolog
|
|
47
|
+
* (`<?xml version="1.0" encoding="UTF-8"?>`). Defaults to `true`. Set `false`
|
|
48
|
+
* to emit the serialized element(s) without the declaration, e.g. for an
|
|
49
|
+
* excerpt embedded in another document.
|
|
50
|
+
*/
|
|
51
|
+
includeXmlDeclaration?: boolean;
|
|
45
52
|
};
|
|
46
53
|
export type SnapshotResult = {
|
|
47
54
|
tree: AnyTreeRecord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.types.d.ts","sourceRoot":"","sources":["../../../../src/document/query/snapshot/snapshot.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE7F,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;AAEpD;;;;;;;;;;;;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,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,GAAG;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,EAAE,CAAA;IACjC,MAAM,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,EAAE,CAAA;IACpC,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,aAAa,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,gEAAgE;AAChE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,+EAA+E;IAC/E,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,wEAAwE;IACxE,cAAc,EAAE,gBAAgB,EAAE,CAAA;IAClC,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;CACd,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as L, i as R, it as z, j as B, k as V, l as H, lt as U, m as W, n as G, nt as K, o as q, ot as J, p as Y, q as X, r as Z, rt as Q, s as $, st as ee, t as te, tt as ne, u as re, ut as ie, v as ae, w as oe, x as se, y as ce } from "./project-
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as L, i as R, it as z, j as B, k as V, l as H, lt as U, m as W, n as G, nt as K, o as q, ot as J, p as Y, q as X, r as Z, rt as Q, s as $, st as ee, t as te, tt as ne, u as re, ut as ie, v as ae, w as oe, x as se, y as ce } from "./project-DxIu-3AU.js";
|
|
2
2
|
import { m as le, p as ue } from "./utils-C5_11hqg.js";
|
|
3
3
|
export { V as AnyQuery, i as AnyTransaction, N as BLOBS_SCHEMA, F as BLOB_DATA_SCHEMA, Y as CHANGELOG_SCHEMA, W as DOCUMENTS_SCHEMA, re as DexieStore, oe as Document, le as ERROR_CATALOG, H as InMemoryStore, L as META_SCHEMA, p as ParseSession, te as Project, h as Query, I as TABLE_BLOBS, D as TABLE_BLOB_PREFIX, ae as TABLE_CHANGELOG, ce as TABLE_DOCUMENTS, A as TABLE_META, se as TABLE_RECORD_PREFIX, f as TEMP_IDB_ID_ATTRIBUTE_NAME, a as Transaction, C as applyOmit, x as applyOrder, u as applyUnwrap, ie as bindExtensions, y as blobTableName, R as buildDocumentState, g as buildXmlDocument, S as collectSnapshotRecords, o as downloadFile, q as exportBlob, $ as exportDocument, K as findAncestors, P as findByAttributes, e as findDescendants, v as formatXml, E as getAttribute, _ as getAttributeFullObject, T as getAttributes, w as getAttributesFullObject, z as getChild, Q as getChildren, ee as getRecord, J as getRecords, k as getRecordsByTagName, t as getSnapshot, c as getTree, Z as importDocument, M as indexStagedDeletesByParent, G as initEmptyDocument, m as inspectXml, s as isOmitted, b as isTransactionContext, ne as matchesAttributeFilter, U as overlayAllStaged, d as parseOmit, B as parseXmlFile, O as reconcileDocumentState, r as recordTableName, n as recordsToTree, j as resolveStore, X as shouldStopTraversal, ue as throwDialecteError, l as xmlDocumentToString };
|
|
@@ -1305,8 +1305,9 @@ function Ge(e) {
|
|
|
1305
1305
|
var Ke = "_temp-idb-id";
|
|
1306
1306
|
//#endregion
|
|
1307
1307
|
//#region src/xml/build/serialize.ts
|
|
1308
|
-
function qe(e) {
|
|
1309
|
-
|
|
1308
|
+
function qe(e, t = {}) {
|
|
1309
|
+
let { includeXmlDeclaration: n = !0 } = t, r = new XMLSerializer().serializeToString(e);
|
|
1310
|
+
return Ge(n ? "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + r : r);
|
|
1310
1311
|
}
|
|
1311
1312
|
//#endregion
|
|
1312
1313
|
//#region src/xml/build/download-file.ts
|
|
@@ -2654,14 +2655,14 @@ async function V(e) {
|
|
|
2654
2655
|
depth: o,
|
|
2655
2656
|
includeDeleted: s
|
|
2656
2657
|
});
|
|
2657
|
-
if (u === "xml") return Dt(t, d, n.declareNamespaces);
|
|
2658
|
+
if (u === "xml") return Dt(t, d, n.declareNamespaces, n.includeXmlDeclaration);
|
|
2658
2659
|
let f = Et(t, d, {
|
|
2659
2660
|
omit: c,
|
|
2660
2661
|
unwrap: l
|
|
2661
2662
|
});
|
|
2662
2663
|
return u === "tree" ? f : {
|
|
2663
2664
|
tree: f,
|
|
2664
|
-
xmlString: Dt(t, d, n.declareNamespaces)
|
|
2665
|
+
xmlString: Dt(t, d, n.declareNamespaces, n.includeXmlDeclaration)
|
|
2665
2666
|
};
|
|
2666
2667
|
}
|
|
2667
2668
|
function Et(e, t, n) {
|
|
@@ -2679,13 +2680,13 @@ function Et(e, t, n) {
|
|
|
2679
2680
|
childrenConfig: e.dialecteConfig.children
|
|
2680
2681
|
}), r;
|
|
2681
2682
|
}
|
|
2682
|
-
function Dt(e, t, n) {
|
|
2683
|
+
function Dt(e, t, n, r) {
|
|
2683
2684
|
return qe(Ye({
|
|
2684
2685
|
records: t.liveRecords,
|
|
2685
2686
|
config: e.dialecteConfig,
|
|
2686
2687
|
rootId: t.rootId,
|
|
2687
2688
|
declareNamespaces: n
|
|
2688
|
-
}));
|
|
2689
|
+
}), { includeXmlDeclaration: r });
|
|
2689
2690
|
}
|
|
2690
2691
|
//#endregion
|
|
2691
2692
|
//#region src/document/query/any/any-query.ts
|
package/dist/test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dt as e, t, u as n, z as r } from "./project-
|
|
1
|
+
import { dt as e, t, u as n, z as r } from "./project-DxIu-3AU.js";
|
|
2
2
|
import { DIALECTE_NAMESPACES as i, standardizeRecord as a, toTrackedRecord as o, toTreeRecord as s } from "./helpers.js";
|
|
3
3
|
import { expect as c, it as l } from "vitest";
|
|
4
4
|
//#region src/test/assert-xml/xpath-parser.ts
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { SerializeOptions } from './serialize.types';
|
|
1
2
|
/**
|
|
2
3
|
* Serialize an XMLDocument to a formatted XML string.
|
|
3
4
|
*
|
|
4
|
-
* Adds the XML declaration
|
|
5
|
-
*
|
|
5
|
+
* Adds the XML declaration (unless opted out via
|
|
6
|
+
* {@link SerializeOptions.includeXmlDeclaration}) and runs the deterministic
|
|
7
|
+
* formatter. Shared by file download and transaction snapshots so both produce
|
|
6
8
|
* byte-identical output for the same document.
|
|
7
9
|
*/
|
|
8
|
-
export declare function xmlDocumentToString(xmlDocument: XMLDocument): string;
|
|
10
|
+
export declare function xmlDocumentToString(xmlDocument: XMLDocument, options?: SerializeOptions): string;
|
|
9
11
|
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/xml/build/serialize.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/xml/build/serialize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,gBAAqB,GAC5B,MAAM,CASR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render controls for {@link xmlDocumentToString}.
|
|
3
|
+
*/
|
|
4
|
+
export type SerializeOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Prepend the XML prolog (`<?xml version="1.0" encoding="UTF-8"?>`).
|
|
7
|
+
* Defaults to `true`. Set `false` to emit the serialized element(s) without
|
|
8
|
+
* the declaration, e.g. for an excerpt embedded in another document.
|
|
9
|
+
*/
|
|
10
|
+
includeXmlDeclaration?: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=serialize.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.types.d.ts","sourceRoot":"","sources":["../../../src/xml/build/serialize.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAC/B,CAAA"}
|