@dialecte/core 0.4.17 → 0.5.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/dist/document/query/any/any-query.d.ts +3 -1
- package/dist/document/query/any/any-query.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attributes.d.ts.map +1 -1
- package/dist/document/query/get/definition/get-definition.d.ts +12 -0
- package/dist/document/query/get/definition/get-definition.d.ts.map +1 -0
- package/dist/document/query/get/definition/index.d.ts +2 -0
- package/dist/document/query/get/definition/index.d.ts.map +1 -0
- package/dist/document/query/get/index.d.ts +1 -0
- package/dist/document/query/get/index.d.ts.map +1 -1
- package/dist/document/query/main.d.ts +15 -1
- package/dist/document/query/main.d.ts.map +1 -1
- package/dist/document/transaction/create/create.types.d.ts +7 -7
- package/dist/document/transaction/create/create.types.d.ts.map +1 -1
- package/dist/document/transaction/delete/delete.d.ts.map +1 -1
- package/dist/helpers/assert-fixed.d.ts +7 -6
- package/dist/helpers/assert-fixed.d.ts.map +1 -1
- package/dist/helpers/standardizing.d.ts.map +1 -1
- package/dist/helpers.js +75 -72
- package/dist/index.js +3 -3
- package/dist/{project-nvZv2ie8.js → project-iCKfhRzr.js} +2012 -1974
- package/dist/test/config.d.ts +668 -326
- package/dist/test/config.d.ts.map +1 -1
- package/dist/test/generated/constants.generated.d.ts +151 -31
- package/dist/test/generated/constants.generated.d.ts.map +1 -1
- package/dist/test/generated/definition.generated.d.ts +523 -295
- package/dist/test/generated/definition.generated.d.ts.map +1 -1
- package/dist/test/generated/types.generated.d.ts +118 -0
- package/dist/test/generated/types.generated.d.ts.map +1 -1
- package/dist/test/run-test-cases.d.ts +668 -326
- package/dist/test/run-test-cases.d.ts.map +1 -1
- package/dist/test/test-record.d.ts +5346 -2610
- package/dist/test/test-record.d.ts.map +1 -1
- package/dist/test.js +986 -474
- package/dist/types/definition.d.ts +45 -3
- package/dist/types/definition.d.ts.map +1 -1
- package/dist/types/dialecte-config.d.ts +34 -7
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/dist/utils/attribute-rules.d.ts +5 -4
- package/dist/utils/attribute-rules.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/resolve-definition.d.ts +15 -0
- package/dist/utils/resolve-definition.d.ts.map +1 -0
- package/dist/{utils-BiEx1x59.js → utils-ERge2irW.js} +70 -46
- package/dist/utils.js +2 -2
- package/dist/xml/build/build-xml-document.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import { Context } from '../../types';
|
|
|
2
2
|
import { GetTreeParams } from '../get';
|
|
3
3
|
import { GetSnapshotOptions, SnapshotResult } from '../snapshot';
|
|
4
4
|
import { AnyRef, AnyRefOrRecord } from '../..';
|
|
5
|
-
import { AnyAttribute, AnyDialecteConfig, AnyTrackedRecord, AnyTreeRecord, ElementsOf } from '../../../types';
|
|
5
|
+
import { AnyAttribute, AnyDialecteConfig, AnyTrackedRecord, AnyTreeRecord, ElementsOf, ElementDefinition } from '../../../types';
|
|
6
6
|
import { AttributeDefaults } from '../../../utils';
|
|
7
7
|
/**
|
|
8
8
|
* Untyped query namespace - bypasses ElementsOf/ChildrenOf constraints.
|
|
@@ -15,6 +15,8 @@ export declare class AnyQuery<GenericConfig extends AnyDialecteConfig> {
|
|
|
15
15
|
protected dialecteConfig: GenericConfig;
|
|
16
16
|
constructor(getContext: () => Context<GenericConfig>, dialecteConfig: GenericConfig);
|
|
17
17
|
getRecord(ref: AnyRef): Promise<AnyTrackedRecord | undefined>;
|
|
18
|
+
/** The definition of the element in its context: as declared under its parent when the schema declares the tag differently there. */
|
|
19
|
+
getDefinition(ref: AnyRefOrRecord): Promise<ElementDefinition | undefined>;
|
|
18
20
|
getRecords(refs: AnyRef[]): Promise<(AnyTrackedRecord | undefined)[]>;
|
|
19
21
|
getChild(parent: AnyRefOrRecord, tagName: string): Promise<AnyTrackedRecord | undefined>;
|
|
20
22
|
getChildren(parent: AnyRefOrRecord, tagName: string): Promise<AnyTrackedRecord[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-query.d.ts","sourceRoot":"","sources":["../../../../src/document/query/any/any-query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAyB,MAAM,YAAY,CAAA;AAC/E,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;GAKG;AACH,qBAAa,QAAQ,CAAC,aAAa,SAAS,iBAAiB;IAE3D,SAAS,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC;IAClD,SAAS,CAAC,cAAc,EAAE,aAAa;gBAD7B,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,EACxC,cAAc,EAAE,aAAa;IAGlC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"any-query.d.ts","sourceRoot":"","sources":["../../../../src/document/query/any/any-query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAyB,MAAM,YAAY,CAAA;AAC/E,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E,EAAE,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,cAAc,CAAC;IAUpB,eAAe,CACpB,WAAW,EAAE,cAAc,GAAG,SAAS,GACrC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAUxC,aAAa,CAAC,WAAW,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAQnF,gBAAgB,CAAC,MAAM,EAAE;QAC9B,OAAO,EAAE,MAAM,CAAA;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;KAC7C,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAO/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-attributes.d.ts","sourceRoot":"","sources":["../../../../../src/document/query/get/attribute/get-attributes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-attributes.d.ts","sourceRoot":"","sources":["../../../../../src/document/query/get/attribute/get-attributes.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,EACV,qBAAqB,EACrB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAsB,aAAa,CAClC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAChD,gBAAgB,SAAS,qBAAqB,CAAC,aAAa,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE;IACT,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,GAAG,EAAE,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC5B,GAAG,OAAO,CAAC,uBAAuB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAsClE;AAED;;;;;;;;;;GAUG;AAEH,wBAAsB,uBAAuB,CAC5C,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAChD,gBAAgB,SAAS,qBAAqB,CAAC,aAAa,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE;IACT,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,GAAG,EAAE,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IACvC,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC5B,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA6B9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context, RefOrRecord } from '../../..';
|
|
2
|
+
import { AnyDialecteConfig, ElementDefinition, ElementsOf } from '../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* The definition of an element in its context. The record is fetched (staged → cache → store),
|
|
5
|
+
* so the parent is always known and a homonym reads as declared under it. `undefined` when the
|
|
6
|
+
* ref points at no record, or at a tag the dialecte does not know.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDefinition<GenericConfig extends AnyDialecteConfig, GenericElement extends ElementsOf<GenericConfig>>(params: {
|
|
9
|
+
context: Context<GenericConfig>;
|
|
10
|
+
ref: RefOrRecord<GenericConfig, GenericElement>;
|
|
11
|
+
}): Promise<ElementDefinition | undefined>;
|
|
12
|
+
//# sourceMappingURL=get-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-definition.d.ts","sourceRoot":"","sources":["../../../../../src/document/query/get/definition/get-definition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE/E;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;CAC/C,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAKzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/document/query/get/definition/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/document/query/get/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/document/query/get/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { RefOrRecord } from '..';
|
|
|
7
7
|
import { Perf } from '../../perf';
|
|
8
8
|
import { DocumentRecord } from '../../project';
|
|
9
9
|
import { Store } from '../../store';
|
|
10
|
-
import { AnyDialecteConfig, AnyTreeRecord, AttributesOf, DefaultAttributesValueObjectOf, DescendantsOf,
|
|
10
|
+
import { AnyDialecteConfig, AnyTreeRecord, AttributesOf, ChildrenOf, DefaultAttributesValueObjectOf, DescendantsOf, ElementDefinition, ElementsOf, FullAttributeObjectOf, NamespacedAttributesValueObjectOf, NamespaceKeysUsedByElement, RootElementOf, TrackedRecord, TreeRecord } from '../../types';
|
|
11
11
|
import { AttributeDefaults } from '../../utils';
|
|
12
12
|
/**
|
|
13
13
|
* Query — query-only access to a dialecte's store.
|
|
@@ -74,6 +74,20 @@ export declare class Query<GenericConfig extends AnyDialecteConfig> {
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
getRecord<GenericElement extends ElementsOf<GenericConfig>>(refOrRecord: RefOrRecord<GenericConfig, GenericElement> | undefined): Promise<TrackedRecord<GenericConfig, GenericElement> | undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* The definition of an element in its context: as declared under its parent when the schema
|
|
79
|
+
* declares the tag differently there, else the tag-level definition.
|
|
80
|
+
*
|
|
81
|
+
* @param refOrRecord - The element to describe; its record is fetched, so its parent is known.
|
|
82
|
+
* @returns The `ElementDefinition`, or `undefined` when nothing is found.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const definition = await query.getDefinition(p)
|
|
87
|
+
* definition?.attributes.details.type?.facets?.enumeration // as declared under p's parent
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
getDefinition<GenericElement extends ElementsOf<GenericConfig>>(refOrRecord: RefOrRecord<GenericConfig, GenericElement> | undefined): Promise<ElementDefinition | undefined>;
|
|
77
91
|
/**
|
|
78
92
|
* Get multiple records in a single call.
|
|
79
93
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/document/query/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAgBhC,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EACX,oBAAoB,EACpB,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,qBAAqB,EACrB,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK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AiB,CAAA;KAAE,GAC7E,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC;;;;;;;;;;OAUG;IACG,aAAa,CAAC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EACnE,WAAW,EAAE,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,SAAS,EACnE,MAAM,EAAE;QAAE,UAAU,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAA;KAAE,GACxD,OAAO,CAAC,qBAAqB,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAC;IAclE;;;;;;;;;;;;;OAaG;IACG,gBAAgB,CAAC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE;QAChF,OAAO,EAAE,cAAc,CAAA;QACvB,UAAU,EAAE,gBAAgB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;KAC3D,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAC;CAG3D"}
|
|
@@ -29,21 +29,21 @@ export type AuthoredAttributeObjectOf<GenericConfig extends AnyDialecteConfig, G
|
|
|
29
29
|
* for **default-namespace (standard) attributes**; any namespaced attribute is
|
|
30
30
|
* authored via the full-object array form (see `AuthoredAttributeObjectOf`).
|
|
31
31
|
*/
|
|
32
|
-
export type ChildAttributesOf<GenericConfig extends AnyDialecteConfig, GenericChildElement extends ElementsOf<GenericConfig
|
|
32
|
+
export type ChildAttributesOf<GenericConfig extends AnyDialecteConfig, GenericChildElement extends ElementsOf<GenericConfig>, GenericParent extends ElementsOf<GenericConfig> = never> = DefaultAttributesValueObjectOf<GenericConfig, GenericChildElement, GenericParent> | AuthoredAttributeObjectOf<GenericConfig, GenericChildElement>[];
|
|
33
33
|
/**
|
|
34
|
-
* `attributes` is optional when the child element has no required attributes
|
|
35
|
-
*
|
|
34
|
+
* `attributes` is optional when the child element has no required attributes and required as
|
|
35
|
+
* soon as it declares at least one - as declared under the parent it is added to.
|
|
36
36
|
*/
|
|
37
|
-
type AddChildAttributesParams<GenericConfig extends AnyDialecteConfig,
|
|
38
|
-
attributes?: ChildAttributesOf<GenericConfig, GenericChildElement>;
|
|
37
|
+
type AddChildAttributesParams<GenericConfig extends AnyDialecteConfig, GenericParent extends ElementsOf<GenericConfig>, GenericChildElement extends ChildrenOf<GenericConfig, GenericParent>> = {} extends AttributesValueObjectOf<GenericConfig, GenericChildElement, GenericParent> ? {
|
|
38
|
+
attributes?: ChildAttributesOf<GenericConfig, GenericChildElement, GenericParent>;
|
|
39
39
|
} : {
|
|
40
|
-
attributes: ChildAttributesOf<GenericConfig, GenericChildElement>;
|
|
40
|
+
attributes: ChildAttributesOf<GenericConfig, GenericChildElement, GenericParent>;
|
|
41
41
|
};
|
|
42
42
|
export type AddChildParams<GenericConfig extends AnyDialecteConfig, GenericElement extends ElementsOf<GenericConfig>, GenericChildElement extends ChildrenOf<GenericConfig, GenericElement>> = {
|
|
43
43
|
id?: `${string}-${string}-${string}-${string}-${string}`;
|
|
44
44
|
tagName: GenericChildElement;
|
|
45
45
|
namespace?: Namespace;
|
|
46
46
|
value?: string;
|
|
47
|
-
} & AddChildAttributesParams<GenericConfig, GenericChildElement>;
|
|
47
|
+
} & AddChildAttributesParams<GenericConfig, GenericElement, GenericChildElement>;
|
|
48
48
|
export {};
|
|
49
49
|
//# sourceMappingURL=create.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.types.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/create/create.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,0BAA0B,EAC1B,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,CACpC,aAAa,SAAS,iBAAiB,EACvC,mBAAmB,SAAS,UAAU,CAAC,aAAa,CAAC,IAEnD;IACA,IAAI,EAAE,uBAAuB,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACpB,GACD;KACC,mBAAmB,IAAI,0BAA0B,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAAG;QACxF,IAAI,EACD,8BAA8B,CAAC,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,GACvF,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,mBAAmB,CAAA;KAC9B;CACA,CAAC,0BAA0B,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC,GACjE;IACA,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,SAAS,CAAA;CACnB,CAAA;AAEJ;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAC5B,aAAa,SAAS,iBAAiB,EACvC,mBAAmB,SAAS,UAAU,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"create.types.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/create/create.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,0BAA0B,EAC1B,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,CACpC,aAAa,SAAS,iBAAiB,EACvC,mBAAmB,SAAS,UAAU,CAAC,aAAa,CAAC,IAEnD;IACA,IAAI,EAAE,uBAAuB,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,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B,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAChD,mBAAmB,SAAS,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,IAClE;IACH,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;IACxD,OAAO,EAAE,mBAAmB,CAAA;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,wBAAwB,CAAC,aAAa,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/delete/delete.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,SAAS,EAET,SAAS,EACT,gBAAgB,EAChB,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,wBAAsB,WAAW,CAChC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,KAAK,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACvC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3B,GAAG,EAAE,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;CACvC,GAAG,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/delete/delete.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,SAAS,EAET,SAAS,EACT,gBAAgB,EAChB,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,wBAAsB,WAAW,CAChC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,KAAK,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACvC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3B,GAAG,EAAE,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;CACvC,GAAG,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,CAkD9E"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { AnyAttribute, AnyDialecteConfig } from '../types';
|
|
1
|
+
import { AnyAttribute, AnyDialecteConfig, AnyRawRecord } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Reject a write whose authored value differs from an attribute's schema `fixed`
|
|
4
|
-
* value (XSD `fixed`). Runs on the WRITE path
|
|
5
|
-
* `update`) — never on import, so an existing document
|
|
6
|
-
* fixed value can still be loaded. Attributes are matched by
|
|
7
|
-
* name (`prefix:local`), so pass the array produced by
|
|
4
|
+
* value (XSD `fixed`), as declared under the record's parent. Runs on the WRITE path
|
|
5
|
+
* only (`addChild`/`ensureChild`/`update`) — never on import, so an existing document
|
|
6
|
+
* that already violates a fixed value can still be loaded. Attributes are matched by
|
|
7
|
+
* their canonical stored name (`prefix:local`), so pass the array produced by
|
|
8
|
+
* `toFullAttributeArray`.
|
|
8
9
|
*/
|
|
9
10
|
export declare function assertNoFixedViolation(params: {
|
|
10
11
|
dialecteConfig: AnyDialecteConfig;
|
|
11
|
-
|
|
12
|
+
record: Pick<AnyRawRecord, 'tagName' | 'parent'>;
|
|
12
13
|
attributes: readonly AnyAttribute[];
|
|
13
14
|
}): void;
|
|
14
15
|
//# sourceMappingURL=assert-fixed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert-fixed.d.ts","sourceRoot":"","sources":["../../src/helpers/assert-fixed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"assert-fixed.d.ts","sourceRoot":"","sources":["../../src/helpers/assert-fixed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE5E;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC9C,cAAc,EAAE,iBAAiB,CAAA;IACjC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAA;IAChD,UAAU,EAAE,SAAS,YAAY,EAAE,CAAA;CACnC,GAAG,IAAI,CAaP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardizing.d.ts","sourceRoot":"","sources":["../../src/helpers/standardizing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standardizing.d.ts","sourceRoot":"","sources":["../../src/helpers/standardizing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACX,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,MAAM,SAAS,CAAA;AAEhB,wBAAgB,iBAAiB,CAChC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,cAAc,EAAE,aAAa,CAAA;IAC7B,KAAK,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACvC,MAAM,EAAE;QACP,OAAO,EAAE,cAAc,CAAA;QACvB,UAAU,CAAC,EACR,OAAO,CAAC,uBAAuB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,GAC/D,gBAAgB,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAA;KACpD,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;CACzE,GAAG,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC,CAwG3C"}
|
package/dist/helpers.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { c as e, d as t, f as n,
|
|
1
|
+
import { c as e, d as t, f as n, g as r, h as i, r as a, s as o, u as s } from "./utils-ERge2irW.js";
|
|
2
2
|
//#region src/helpers/constant.ts
|
|
3
|
-
var
|
|
3
|
+
var c = "db-id", l = {
|
|
4
4
|
uri: "http://dialecte.dev/XML/DEV",
|
|
5
5
|
prefix: "dev"
|
|
6
|
-
},
|
|
6
|
+
}, u = `${l.prefix}:${c}`, d = {
|
|
7
7
|
uri: "http://www.w3.org/2001/XMLSchema-instance",
|
|
8
8
|
prefix: "xsi"
|
|
9
|
-
},
|
|
10
|
-
dev:
|
|
11
|
-
xsi:
|
|
12
|
-
},
|
|
9
|
+
}, f = `xmlns:${d.prefix}="${d.uri}"`, p = {
|
|
10
|
+
dev: l,
|
|
11
|
+
xsi: d
|
|
12
|
+
}, m = [
|
|
13
13
|
"id",
|
|
14
14
|
"tagName",
|
|
15
15
|
"namespace",
|
|
@@ -17,26 +17,23 @@ var s = "db-id", c = {
|
|
|
17
17
|
"children",
|
|
18
18
|
"parent",
|
|
19
19
|
"value"
|
|
20
|
-
],
|
|
21
|
-
function
|
|
20
|
+
], h = [...m, "status"], g = [...h, "tree"];
|
|
21
|
+
function _(e, t) {
|
|
22
22
|
if (typeof e != "object" || !e) return !1;
|
|
23
23
|
let n = Object.keys(e);
|
|
24
24
|
return t.every((t) => t in e) && n.every((e) => t.includes(e)) && n.length === t.length;
|
|
25
25
|
}
|
|
26
|
-
function _(e) {
|
|
27
|
-
return Array.isArray(e);
|
|
28
|
-
}
|
|
29
26
|
function v(e) {
|
|
30
|
-
return
|
|
27
|
+
return Array.isArray(e);
|
|
31
28
|
}
|
|
32
29
|
function y(e) {
|
|
33
|
-
return
|
|
30
|
+
return _(e, m);
|
|
34
31
|
}
|
|
35
32
|
function b(e) {
|
|
36
|
-
return
|
|
33
|
+
return _(e, h);
|
|
37
34
|
}
|
|
38
|
-
function x(e
|
|
39
|
-
return e
|
|
35
|
+
function x(e) {
|
|
36
|
+
return _(e, g);
|
|
40
37
|
}
|
|
41
38
|
function S(e, t) {
|
|
42
39
|
return e.tagName === t;
|
|
@@ -45,14 +42,17 @@ function C(e, t) {
|
|
|
45
42
|
return e.tagName === t;
|
|
46
43
|
}
|
|
47
44
|
function w(e, t) {
|
|
48
|
-
return t
|
|
45
|
+
return e.tagName === t;
|
|
49
46
|
}
|
|
50
47
|
function T(e, t) {
|
|
48
|
+
return t.elements.includes(e);
|
|
49
|
+
}
|
|
50
|
+
function E(e, t) {
|
|
51
51
|
return e.attributes.some((e) => e.name === t);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/helpers/converter.ts
|
|
55
|
-
function
|
|
55
|
+
function D(e) {
|
|
56
56
|
return {
|
|
57
57
|
id: e.id,
|
|
58
58
|
tagName: e.tagName,
|
|
@@ -63,140 +63,143 @@ function E(e) {
|
|
|
63
63
|
children: e.children
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function O(e) {
|
|
67
67
|
return e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function k(e) {
|
|
70
70
|
let { record: t, status: n } = e, r = n ?? ("status" in t ? t.status : "unchanged");
|
|
71
71
|
return {
|
|
72
|
-
...
|
|
72
|
+
...D(t),
|
|
73
73
|
status: r
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function A(e) {
|
|
77
77
|
let { record: t, status: n, tree: r } = e, i = r ?? ("tree" in t ? t.tree : []);
|
|
78
78
|
return {
|
|
79
|
-
...
|
|
79
|
+
...k({
|
|
80
80
|
record: t,
|
|
81
81
|
status: n
|
|
82
82
|
}),
|
|
83
83
|
tree: i
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function j(e) {
|
|
87
87
|
let { dialecteConfig: t, tagName: n, attributes: r } = e;
|
|
88
88
|
return (Array.isArray(r) ? r : Object.entries(r).map(([e, r]) => ({
|
|
89
89
|
name: e,
|
|
90
90
|
value: r,
|
|
91
91
|
namespace: t.definition[n]?.attributes.details[e]?.namespace || void 0
|
|
92
|
-
}))).map((e) =>
|
|
92
|
+
}))).map((e) => M({
|
|
93
93
|
attribute: e,
|
|
94
94
|
dialecteConfig: t,
|
|
95
95
|
tagName: n
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
let { attribute: i, dialecteConfig:
|
|
100
|
-
typeof i.namespace == "string" ? (c = n(
|
|
98
|
+
function M(e) {
|
|
99
|
+
let { attribute: i, dialecteConfig: a, tagName: s } = e, c;
|
|
100
|
+
typeof i.namespace == "string" ? (c = n(a, i.namespace), c || r("UNKNOWN_NAMESPACE_PREFIX", {
|
|
101
101
|
detail: `Unknown namespace '${i.namespace}' on attribute '${i.name}' — use a registered namespace key or pass a full { name, namespace: { prefix, uri } }.`,
|
|
102
102
|
ref: { tagName: s }
|
|
103
103
|
})) : c = i.namespace;
|
|
104
104
|
let l = i.name.indexOf(":");
|
|
105
105
|
if (!c && l !== -1) {
|
|
106
106
|
let e = i.name.slice(0, l);
|
|
107
|
-
e !== "xmlns" && (c = t(
|
|
107
|
+
e !== "xmlns" && (c = t(a, e), c || r("UNKNOWN_NAMESPACE_PREFIX", {
|
|
108
108
|
detail: `Unknown namespace prefix '${e}' on attribute '${i.name}' — pass it explicitly as { name, namespace: { prefix, uri } }.`,
|
|
109
109
|
ref: { tagName: s }
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
return c && c.prefix && c.prefix !== "xmlns" ? {
|
|
113
113
|
...i,
|
|
114
|
-
name: `${c.prefix}:${
|
|
114
|
+
name: `${c.prefix}:${o(i.name)}`,
|
|
115
115
|
namespace: c
|
|
116
116
|
} : (i.namespace, {
|
|
117
117
|
...i,
|
|
118
118
|
namespace: c
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
121
|
+
function N(e) {
|
|
122
|
+
return a(e, { detail: "The record or ref is undefined" }), {
|
|
123
123
|
id: e.id,
|
|
124
124
|
tagName: e.tagName
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region src/helpers/standardizing.ts
|
|
129
|
-
function
|
|
130
|
-
let { dialecteConfig: t, hooks: n, record: r } = e, { id:
|
|
131
|
-
tagName:
|
|
132
|
-
attributes:
|
|
129
|
+
function P(e) {
|
|
130
|
+
let { dialecteConfig: t, hooks: n, record: r } = e, { id: a, tagName: o, attributes: c, namespace: l, value: u } = r, d = r.parent?.tagName, f = a ?? crypto.randomUUID(), p = c ? j({
|
|
131
|
+
tagName: o,
|
|
132
|
+
attributes: c,
|
|
133
133
|
dialecteConfig: t
|
|
134
|
-
}) : [],
|
|
135
|
-
id:
|
|
136
|
-
tagName:
|
|
137
|
-
attributes:
|
|
138
|
-
namespace:
|
|
134
|
+
}) : [], m = {
|
|
135
|
+
id: f,
|
|
136
|
+
tagName: o,
|
|
137
|
+
attributes: p,
|
|
138
|
+
namespace: l ?? {
|
|
139
139
|
prefix: "prefixNeededForNotSupportedNamespace",
|
|
140
140
|
uri: "uriNeededForNotSupportedNamespace"
|
|
141
141
|
},
|
|
142
|
-
value:
|
|
142
|
+
value: u ?? "",
|
|
143
143
|
parent: r.parent ?? null,
|
|
144
144
|
children: r.children ?? []
|
|
145
|
-
},
|
|
146
|
-
if (!(t.elements.includes(
|
|
147
|
-
let
|
|
148
|
-
|
|
145
|
+
}, h = Object.values(t.namespaces).map(({ uri: e }) => e), g = l?.uri != null && !h.includes(l.uri);
|
|
146
|
+
if (!(t.elements.includes(o) && !g)) return m;
|
|
147
|
+
let _ = i({
|
|
148
|
+
dialecteConfig: t,
|
|
149
|
+
record: m
|
|
150
|
+
})?.attributes.sequence ?? [], v = p.filter((e) => {
|
|
151
|
+
let t = _.includes(e.name), n = "namespace" in e && e.namespace != null;
|
|
149
152
|
if (!t && !n) return !1;
|
|
150
153
|
let r = e.value === void 0 || e.value === null || e.value === "";
|
|
151
154
|
return !(t && r);
|
|
152
|
-
}),
|
|
153
|
-
if ("namespace" in e && e.namespace?.uri ===
|
|
155
|
+
}), y = t.namespaces.default.uri, b = v.map((e) => {
|
|
156
|
+
if ("namespace" in e && e.namespace?.uri === y) {
|
|
154
157
|
let { namespace: t, ...n } = e;
|
|
155
158
|
return n;
|
|
156
159
|
}
|
|
157
160
|
return e;
|
|
158
|
-
}),
|
|
159
|
-
...
|
|
160
|
-
namespace:
|
|
161
|
-
attributes:
|
|
161
|
+
}), x = d ? t.definition[d]?.children?.details?.[o]?.namespace : void 0, S = {
|
|
162
|
+
...m,
|
|
163
|
+
namespace: x ?? t.definition[o].namespace,
|
|
164
|
+
attributes: s(b, _)
|
|
162
165
|
};
|
|
163
|
-
return n?.afterStandardizedRecord && (
|
|
164
|
-
...
|
|
165
|
-
attributes:
|
|
166
|
-
}),
|
|
166
|
+
return n?.afterStandardizedRecord && (S = n.afterStandardizedRecord({ record: S }), S = {
|
|
167
|
+
...S,
|
|
168
|
+
attributes: s(S.attributes, _)
|
|
169
|
+
}), S;
|
|
167
170
|
}
|
|
168
171
|
//#endregion
|
|
169
172
|
//#region src/helpers/assert-fixed.ts
|
|
170
|
-
function
|
|
171
|
-
let { dialecteConfig: n,
|
|
173
|
+
function F(t) {
|
|
174
|
+
let { dialecteConfig: n, record: i, attributes: a } = t;
|
|
172
175
|
for (let t of a) {
|
|
173
176
|
let a = e({
|
|
174
177
|
dialecteConfig: n,
|
|
175
|
-
|
|
178
|
+
record: i,
|
|
176
179
|
attributeName: t.name
|
|
177
180
|
});
|
|
178
181
|
a.fixed !== void 0 && t.value !== a.fixed && r("FIXED_VALUE_VIOLATION", {
|
|
179
|
-
detail: `Attribute '${t.name}' on '${i}' is fixed to '${a.fixed}' but was set to '${String(t.value)}'.`,
|
|
180
|
-
ref: { tagName: i }
|
|
182
|
+
detail: `Attribute '${t.name}' on '${i.tagName}' is fixed to '${a.fixed}' but was set to '${String(t.value)}'.`,
|
|
183
|
+
ref: { tagName: i.tagName }
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
187
|
//#endregion
|
|
185
188
|
//#region src/helpers/merge-extensions.ts
|
|
186
|
-
function
|
|
189
|
+
function I(e, t, n, r) {
|
|
187
190
|
if (!e || !t) return;
|
|
188
|
-
let
|
|
189
|
-
i
|
|
191
|
+
let i = Object.keys(t).filter((t) => t in e);
|
|
192
|
+
a(i.length === 0, {
|
|
190
193
|
key: "EXTENSION_METHOD_COLLISION",
|
|
191
|
-
detail: `Module "${n}" has conflicting ${r} method(s): ${
|
|
194
|
+
detail: `Module "${n}" has conflicting ${r} method(s): ${i.map((e) => `"${e}"`).join(", ")}`
|
|
192
195
|
});
|
|
193
196
|
}
|
|
194
|
-
function
|
|
197
|
+
function L(e) {
|
|
195
198
|
let t = {}, n = {}, r = [...Object.entries(e.base ?? {}), ...Object.entries(e.custom ?? {})];
|
|
196
|
-
for (let [e, i] of r) i.query && (
|
|
199
|
+
for (let [e, i] of r) i.query && (I(t[e], i.query, e, "query"), t[e] = {
|
|
197
200
|
...t[e],
|
|
198
201
|
...i.query
|
|
199
|
-
}), i.transaction && (
|
|
202
|
+
}), i.transaction && (I(n[e], i.transaction, e, "transaction"), n[e] = {
|
|
200
203
|
...n[e],
|
|
201
204
|
...i.transaction
|
|
202
205
|
});
|
|
@@ -207,15 +210,15 @@ function I(e) {
|
|
|
207
210
|
}
|
|
208
211
|
//#endregion
|
|
209
212
|
//#region src/helpers/strip-attributes.ts
|
|
210
|
-
function
|
|
213
|
+
function R(e, t) {
|
|
211
214
|
let n = new Set(t), r = {
|
|
212
215
|
...e,
|
|
213
216
|
attributes: e.attributes.filter((e) => !n.has(e.name))
|
|
214
217
|
};
|
|
215
218
|
return "tree" in e ? {
|
|
216
219
|
...r,
|
|
217
|
-
tree: e.tree.map((e) =>
|
|
220
|
+
tree: e.tree.map((e) => R(e, t))
|
|
218
221
|
} : r;
|
|
219
222
|
}
|
|
220
223
|
//#endregion
|
|
221
|
-
export {
|
|
224
|
+
export { u as CUSTOM_RECORD_ID_ATTRIBUTE, c as CUSTOM_RECORD_ID_ATTRIBUTE_NAME, l as DIALECTE_DEV_NAMESPACE, p as DIALECTE_NAMESPACES, f as XMLNS_XSI_NAMESPACE, d as XSI_NAMESPACE, F as assertNoFixedViolation, E as isAttributeOf, C as isChildOf, T as isElementOf, v as isFullAttributeArray, w as isParentOf, y as isRawRecord, S as isRecordOf, b as isTrackedRecord, x as isTreeRecord, L as mergeExtensions, P as standardizeRecord, R as stripAttributes, j as toFullAttributeArray, D as toRawRecord, N as toRef, k as toTrackedRecord, A as toTreeRecord, O as widen };
|
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, W as S, X as C, Y as w, Z as T, _ as E, a as D, at as O, b as k, c as A, ct as j, d as M, dt as N, et as P, f as F, ft as I, g as L, h as R,
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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, W as S, X as C, Y as w, Z as T, _ as E, a as D, at as O, b as k, c as A, ct as j, d as M, dt as N, et as P, f as F, ft as I, g as L, h as R, ht as z, i as B, it as V, j as H, k as U, l as W, lt as G, m as K, n as q, nt as J, o as Y, ot as X, p as Z, pt as Q, q as $, r as ee, rt as te, s as ne, st as re, t as ie, tt as ae, u as oe, ut as se, v as ce, w as le, x as ue, y as de, z as fe } from "./project-iCKfhRzr.js";
|
|
2
|
+
import { _ as pe, g as me } from "./utils-ERge2irW.js";
|
|
3
|
+
export { U as AnyQuery, i as AnyTransaction, M as BLOBS_SCHEMA, F as BLOB_DATA_SCHEMA, Z as CHANGELOG_SCHEMA, K as DOCUMENTS_SCHEMA, oe as DexieStore, le as Document, pe as ERROR_CATALOG, W as InMemoryStore, R as META_SCHEMA, m as NOOP_PERF, g as ParseSession, ie as Project, h as Query, L as TABLE_BLOBS, E as TABLE_BLOB_PREFIX, ce as TABLE_CHANGELOG, de as TABLE_DOCUMENTS, k as TABLE_META, ue as TABLE_RECORD_PREFIX, fe as TEMP_IDB_ID_ATTRIBUTE_NAME, a as Transaction, d as applyOmit, s as applyOrder, C as applyUnwrap, z as bindExtensions, y as blobTableName, B as buildDocumentState, l as buildXmlDocument, x as collectSnapshotRecords, p as createPerf, Q as createStagedOperations, f as downloadFile, Y as exportBlob, ne as exportDocument, O as findAncestors, te as findByAttributes, J as findDescendants, n as formatXml, P as getAttribute, ae as getAttributeFullObject, _ as getAttributes, e as getAttributesFullObject, re as getChild, X as getChildren, T as getDefinition, se as getRecord, G as getRecords, j as getRecordsByTagName, t as getSnapshot, S as getTree, ee as importDocument, N as indexStagedDeletesByParent, q as initEmptyDocument, o as inspectXml, $ as isOmitted, b as isTransactionContext, V as matchesAttributeFilter, I as overlayAllStaged, u as parseOmit, H as parseXmlFile, D as reconcileDocumentState, r as recordTableName, c as recordsToTree, A as resolveStore, w as shouldStopTraversal, me as throwDialecteError, v as xmlDocumentToString };
|