@dialecte/core 0.5.2 → 0.5.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.
- package/dist/document/document.d.ts +6 -0
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/transaction/before-commit/before-commit.d.ts +9 -0
- package/dist/document/transaction/before-commit/before-commit.d.ts.map +1 -0
- package/dist/document/transaction/before-commit/index.d.ts +2 -0
- package/dist/document/transaction/before-commit/index.d.ts.map +1 -0
- package/dist/document/transaction/main.d.ts +6 -0
- package/dist/document/transaction/main.d.ts.map +1 -1
- package/dist/errors/errors.d.ts +35 -10
- package/dist/errors/errors.d.ts.map +1 -1
- package/dist/errors/types.d.ts +55 -3
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/helpers.js +37 -37
- package/dist/index.js +3 -3
- package/dist/{project-Bd3fSPam.js → project-BdNBOjAX.js} +1801 -1782
- package/dist/test.js +1 -1
- package/dist/types/dialecte-config.d.ts +12 -0
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/dist/utils/invariant.d.ts +6 -2
- package/dist/utils/invariant.d.ts.map +1 -1
- package/dist/{utils-ERge2irW.js → utils-Cgqv3qwv.js} +105 -69
- package/dist/utils.js +1 -1
- package/package.json +1 -1
|
@@ -106,6 +106,12 @@ export declare class Document<GenericConfig extends AnyDialecteConfig, GenericEx
|
|
|
106
106
|
prepare(fn: (tx: Transaction<GenericConfig> & AllExtensions<GenericExtension>) => Promise<void>, options?: {
|
|
107
107
|
label?: string;
|
|
108
108
|
}): Promise<PreparedTransaction<GenericConfig, GenericExtension>>;
|
|
109
|
+
/**
|
|
110
|
+
* What a failed operation throws, kept as the document's last error: a structured error stays
|
|
111
|
+
* what it is — its key, its data — and anything else is reported as unknown, the original kept
|
|
112
|
+
* as its cause.
|
|
113
|
+
*/
|
|
114
|
+
private reportFailure;
|
|
109
115
|
/** Close the store connection */
|
|
110
116
|
close(): void;
|
|
111
117
|
/** Close connection and delete the database entirely */
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AO,CAAC,CAAC,CAAC,EACpF,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1B,OAAO,CAAC,CAAC,CAAC;IA+Cb;;;;;;;;;;;;;;;;;;;OAmBG;IACG,OAAO,CACZ,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACvF,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1B,OAAO,CAAC,mBAAmB,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IAoFhE;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAiBrB,iCAAiC;IACjC,KAAK,IAAI,IAAI;IAIb,wDAAwD;IAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context, Query } from '../..';
|
|
2
|
+
import { AnyDialecteConfig, TransactionHooks } from '../../../types';
|
|
3
|
+
/** Stage what the `beforeCommit` hook returns for the operations staged so far. */
|
|
4
|
+
export declare function stageBeforeCommit<GenericConfig extends AnyDialecteConfig>(params: {
|
|
5
|
+
hooks: TransactionHooks<GenericConfig> | undefined;
|
|
6
|
+
context: Context<GenericConfig>;
|
|
7
|
+
query: Query<GenericConfig>;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=before-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"before-commit.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/before-commit/before-commit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAElE,mFAAmF;AACnF,wBAAsB,iBAAiB,CAAC,aAAa,SAAS,iBAAiB,EAAE,MAAM,EAAE;IACxF,KAAK,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAClD,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/before-commit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -31,6 +31,7 @@ export declare class Transaction<GenericConfig extends AnyDialecteConfig> extend
|
|
|
31
31
|
protected hooks: TransactionHooks<GenericConfig> | undefined;
|
|
32
32
|
protected progressReporter: ProgressReporter;
|
|
33
33
|
private _anyTx?;
|
|
34
|
+
private stagingFinished;
|
|
34
35
|
constructor(store: Store, dialecteConfig: GenericConfig, documentId: string, documentActivity: DocumentState, hooks?: TransactionHooks<GenericConfig>, perf?: Perf, signalStateChange?: (terminal: boolean) => void);
|
|
35
36
|
/** Reachable by extensions via `tx.progress` to report coarse progress. */
|
|
36
37
|
get progress(): ProgressReporter;
|
|
@@ -124,6 +125,11 @@ export declare class Transaction<GenericConfig extends AnyDialecteConfig> extend
|
|
|
124
125
|
* ```
|
|
125
126
|
*/
|
|
126
127
|
deepClone<GenericElement extends ElementsOf<GenericConfig>, GenericChildElement extends ChildrenOf<GenericConfig, GenericElement>>(parentRefOrRecord: RefOrRecord<GenericConfig, GenericElement> | undefined, record: TreeRecord<GenericConfig, GenericChildElement>): Promise<CloneResult<GenericConfig, GenericChildElement>>;
|
|
128
|
+
/**
|
|
129
|
+
* Run the `beforeCommit` hook once, when the transaction's work is done, and stage
|
|
130
|
+
* what it returns. Called by Document.transaction() / prepare() after the callback.
|
|
131
|
+
*/
|
|
132
|
+
finishStaging(): Promise<void>;
|
|
127
133
|
/** Returns a read-only view of staged operations (for prepare/preview) */
|
|
128
134
|
getStagedOperations(): ReadonlyArray<Operation<GenericConfig>>;
|
|
129
135
|
/** Free staged operations from memory */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/document/transaction/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/document/transaction/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAYtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EACX,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW,CAAC,aAA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,mBAAmB,IAAI,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAI9D,yCAAyC;IACzC,qBAAqB,IAAI,IAAI;IAI7B,sCAAsC;IACtC,gBAAgB,IAAI,IAAI;IAIxB;;;;;;OAMG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAU7B"}
|
package/dist/errors/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialecteErrorKey } from './types';
|
|
1
|
+
import { CoreCatalogueCollisions, DialecteError, DialecteErrorCatalogInput, DialecteErrorDefinition, DialecteErrorDefinitions, DialecteErrorKey, KnownDialecteErrorKey, ThrowDialecteErrorParams } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Create a structured error and throw it.
|
|
4
4
|
* When `method` is omitted, the caller's name is extracted from the stack trace.
|
|
@@ -6,16 +6,41 @@ import { DialecteErrorKey } from './types';
|
|
|
6
6
|
* Wraps the DialecteError in a real Error (for stack trace) and sets it as `.cause`
|
|
7
7
|
* so `toDialecteError` can extract it in catch blocks.
|
|
8
8
|
*
|
|
9
|
+
* `key` is a key of the core catalogue, or an error a dialecte declared with `defineErrors`.
|
|
10
|
+
*
|
|
9
11
|
* @example
|
|
10
12
|
* throwDialecteError('ELEMENT_NOT_FOUND', { detail: 'parent not found' })
|
|
11
13
|
*/
|
|
12
|
-
export declare function throwDialecteError(key: DialecteErrorKey, params:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
export declare function throwDialecteError(key: DialecteErrorKey | DialecteErrorDefinition, params: ThrowDialecteErrorParams): never;
|
|
15
|
+
/**
|
|
16
|
+
* Build the Error `throwDialecteError` throws, without throwing it — for a caller that reports an
|
|
17
|
+
* error it caught instead of raising one.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createDialecteError(key: DialecteErrorKey | DialecteErrorDefinition, params: ThrowDialecteErrorParams): Error;
|
|
20
|
+
/**
|
|
21
|
+
* Declare the errors of a dialecte: each entry gets its property name as `key`, so it can be
|
|
22
|
+
* passed wherever a core key is — `throwDialecteError`, `invariant`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const ERRORS = defineErrors({ NAME_TAKEN: { code: 'X1001', message: 'The name is already taken' } })
|
|
26
|
+
* invariant(isFree, { key: ERRORS.NAME_TAKEN, detail: '…', meta: { name } })
|
|
27
|
+
*/
|
|
28
|
+
export declare function defineErrors<const GenericCatalog extends DialecteErrorCatalogInput>(catalog: GenericCatalog & CoreCatalogueCollisions<GenericCatalog>): DialecteErrorDefinitions<GenericCatalog>;
|
|
29
|
+
/**
|
|
30
|
+
* The structured error a caught value carries — thrown by `throwDialecteError` or `invariant` —
|
|
31
|
+
* or nothing when it is any other error or value.
|
|
32
|
+
*/
|
|
33
|
+
export declare function toDialecteError(thrown: unknown): DialecteError | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a structured error is one the caller knows: a key of the core catalogue, or an entry of
|
|
36
|
+
* one of the catalogues named — same key, same code. Its `key` is then narrowed to those keys, so a
|
|
37
|
+
* `switch` on it or a table read with it is checked again.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const error = toDialecteError(thrown)
|
|
41
|
+
* if (error && isKnownDialecteError(error, { catalogues: [MY_ERRORS] })) sentences[error.key]
|
|
42
|
+
*/
|
|
43
|
+
export declare function isKnownDialecteError<const GenericCatalogues extends readonly DialecteErrorDefinitions<DialecteErrorCatalogInput>[]>(error: DialecteError, params: {
|
|
44
|
+
catalogues: GenericCatalogues;
|
|
45
|
+
}): error is DialecteError<KnownDialecteErrorKey<GenericCatalogues>>;
|
|
21
46
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,uBAAuB,EACvB,aAAa,EACb,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,gBAAgB,GAAG,uBAAuB,EAC/C,MAAM,EAAE,wBAAwB,GAC9B,KAAK,CAEP;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,gBAAgB,GAAG,uBAAuB,EAC/C,MAAM,EAAE,wBAAwB,GAC9B,KAAK,CAeP;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,cAAc,SAAS,yBAAyB,EAClF,OAAO,EAAE,cAAc,GAAG,uBAAuB,CAAC,cAAc,CAAC,GAC/D,wBAAwB,CAAC,cAAc,CAAC,CA0B1C;AAID;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAO1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,CAAC,iBAAiB,SAAS,SAAS,wBAAwB,CAAC,yBAAyB,CAAC,EAAE,EAE9F,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE;IAAE,UAAU,EAAE,iBAAiB,CAAA;CAAE,GACvC,KAAK,IAAI,aAAa,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAC,CAKlE"}
|
package/dist/errors/types.d.ts
CHANGED
|
@@ -1,13 +1,44 @@
|
|
|
1
1
|
import { ERROR_CATALOG } from './codes';
|
|
2
2
|
export type DialecteErrorKey = keyof typeof ERROR_CATALOG;
|
|
3
3
|
export type DialecteErrorCode = (typeof ERROR_CATALOG)[DialecteErrorKey]['code'];
|
|
4
|
+
/**
|
|
5
|
+
* An error a dialecte declares beside the core catalogue: its own key, its own code and the
|
|
6
|
+
* default message shown when the consumer has no wording of its own for that key.
|
|
7
|
+
* Build a catalogue of them with `defineErrors`.
|
|
8
|
+
*/
|
|
9
|
+
export type DialecteErrorDefinition<GenericKey extends string = string> = {
|
|
10
|
+
key: GenericKey;
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
/** What a dialecte gives `defineErrors`: one entry per error, named by its key. */
|
|
15
|
+
export type DialecteErrorCatalogInput = Record<string, {
|
|
16
|
+
code: string;
|
|
17
|
+
message: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** What `defineErrors` returns: each entry of the catalogue with its property name as `key`. */
|
|
20
|
+
export type DialecteErrorDefinitions<GenericCatalog extends DialecteErrorCatalogInput> = {
|
|
21
|
+
readonly [GenericKey in keyof GenericCatalog & string]: DialecteErrorDefinition<GenericKey> & GenericCatalog[GenericKey];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The entries of a catalogue that take a key or a code of the core catalogue, each typed `never`:
|
|
25
|
+
* `defineErrors` refuses them at the type-check, on the entry itself.
|
|
26
|
+
*/
|
|
27
|
+
export type CoreCatalogueCollisions<GenericCatalog extends DialecteErrorCatalogInput> = {
|
|
28
|
+
[GenericKey in keyof GenericCatalog as GenericKey extends DialecteErrorKey ? GenericKey : GenericCatalog[GenericKey]['code'] extends DialecteErrorCode ? GenericKey : never]: never;
|
|
29
|
+
};
|
|
4
30
|
/**
|
|
5
31
|
* Structured error — serializable, worker-safe, UI-consumable.
|
|
6
32
|
* Original Error goes in `cause` to preserve stack trace.
|
|
7
33
|
*/
|
|
8
|
-
export type DialecteError = {
|
|
9
|
-
code
|
|
10
|
-
|
|
34
|
+
export type DialecteError<GenericKey extends string = DialecteErrorKey | (string & {})> = {
|
|
35
|
+
/** A code of the core catalogue, or the code of an error a dialecte declared. */
|
|
36
|
+
code: DialecteErrorCode | (string & {});
|
|
37
|
+
/**
|
|
38
|
+
* A key of the core catalogue, or the key of an error a dialecte declared. Narrowed to the keys
|
|
39
|
+
* of the core and of the catalogues named, by `isKnownDialecteError`.
|
|
40
|
+
*/
|
|
41
|
+
key: GenericKey;
|
|
11
42
|
message: string;
|
|
12
43
|
detail: string;
|
|
13
44
|
method: string;
|
|
@@ -15,6 +46,27 @@ export type DialecteError = {
|
|
|
15
46
|
tagName: string;
|
|
16
47
|
id: string;
|
|
17
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* What the error is about, as data: the consumer builds its own wording from it instead of
|
|
51
|
+
* reading it out of `detail`. Serializable values only.
|
|
52
|
+
*/
|
|
53
|
+
meta?: Record<string, unknown>;
|
|
54
|
+
cause?: Error;
|
|
55
|
+
};
|
|
56
|
+
/** What is given with the key when a structured error is raised. */
|
|
57
|
+
export type ThrowDialecteErrorParams = {
|
|
58
|
+
detail: string;
|
|
59
|
+
message?: string;
|
|
60
|
+
ref?: {
|
|
61
|
+
tagName: string;
|
|
62
|
+
id?: string;
|
|
63
|
+
};
|
|
64
|
+
/** What the error is about, as serializable data. */
|
|
65
|
+
meta?: Record<string, unknown>;
|
|
18
66
|
cause?: Error;
|
|
19
67
|
};
|
|
68
|
+
/** The keys of the catalogues `isKnownDialecteError` is given, with the keys of the core. */
|
|
69
|
+
export type KnownDialecteErrorKey<GenericCatalogues extends readonly DialecteErrorDefinitions<DialecteErrorCatalogInput>[]> = DialecteErrorKey | KeysOfCatalogue<GenericCatalogues[number]>;
|
|
70
|
+
type KeysOfCatalogue<GenericCatalogue> = GenericCatalogue extends unknown ? keyof GenericCatalogue & string : never;
|
|
71
|
+
export {};
|
|
20
72
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/errors/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,MAAM,MAAM,gBAAgB,GAAG,MA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1,4 @@
|
|
|
1
|
-
import { c as e, d as t, f as n,
|
|
1
|
+
import { c as e, d as t, f as n, h as r, r as i, s as a, u as o, y as s } from "./utils-Cgqv3qwv.js";
|
|
2
2
|
//#region src/helpers/constant.ts
|
|
3
3
|
var c = "db-id", l = {
|
|
4
4
|
uri: "http://dialecte.dev/XML/DEV",
|
|
@@ -96,30 +96,30 @@ function j(e) {
|
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
98
|
function M(e) {
|
|
99
|
-
let { attribute:
|
|
100
|
-
typeof
|
|
101
|
-
detail: `Unknown namespace '${
|
|
102
|
-
ref: { tagName:
|
|
103
|
-
})) : c =
|
|
104
|
-
let l =
|
|
99
|
+
let { attribute: r, dialecteConfig: i, tagName: o } = e, c;
|
|
100
|
+
typeof r.namespace == "string" ? (c = n(i, r.namespace), c || s("UNKNOWN_NAMESPACE_PREFIX", {
|
|
101
|
+
detail: `Unknown namespace '${r.namespace}' on attribute '${r.name}' — use a registered namespace key or pass a full { name, namespace: { prefix, uri } }.`,
|
|
102
|
+
ref: { tagName: o }
|
|
103
|
+
})) : c = r.namespace;
|
|
104
|
+
let l = r.name.indexOf(":");
|
|
105
105
|
if (!c && l !== -1) {
|
|
106
|
-
let e =
|
|
107
|
-
e !== "xmlns" && (c = t(
|
|
108
|
-
detail: `Unknown namespace prefix '${e}' on attribute '${
|
|
109
|
-
ref: { tagName:
|
|
106
|
+
let e = r.name.slice(0, l);
|
|
107
|
+
e !== "xmlns" && (c = t(i, e), c || s("UNKNOWN_NAMESPACE_PREFIX", {
|
|
108
|
+
detail: `Unknown namespace prefix '${e}' on attribute '${r.name}' — pass it explicitly as { name, namespace: { prefix, uri } }.`,
|
|
109
|
+
ref: { tagName: o }
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
return c && c.prefix && c.prefix !== "xmlns" ? {
|
|
113
|
-
...
|
|
114
|
-
name: `${c.prefix}:${
|
|
113
|
+
...r,
|
|
114
|
+
name: `${c.prefix}:${a(r.name)}`,
|
|
115
115
|
namespace: c
|
|
116
|
-
} : (
|
|
117
|
-
...
|
|
116
|
+
} : (r.namespace, {
|
|
117
|
+
...r,
|
|
118
118
|
namespace: c
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
function N(e) {
|
|
122
|
-
return
|
|
122
|
+
return i(e, { detail: "The record or ref is undefined" }), {
|
|
123
123
|
id: e.id,
|
|
124
124
|
tagName: e.tagName
|
|
125
125
|
};
|
|
@@ -127,24 +127,24 @@ function N(e) {
|
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region src/helpers/standardizing.ts
|
|
129
129
|
function P(e) {
|
|
130
|
-
let { dialecteConfig: t, hooks: n, record:
|
|
131
|
-
tagName:
|
|
130
|
+
let { dialecteConfig: t, hooks: n, record: i } = e, { id: a, tagName: s, attributes: c, namespace: l, value: u } = i, d = i.parent?.tagName, f = a ?? crypto.randomUUID(), p = c ? j({
|
|
131
|
+
tagName: s,
|
|
132
132
|
attributes: c,
|
|
133
133
|
dialecteConfig: t
|
|
134
134
|
}) : [], m = {
|
|
135
135
|
id: f,
|
|
136
|
-
tagName:
|
|
136
|
+
tagName: s,
|
|
137
137
|
attributes: p,
|
|
138
138
|
namespace: l ?? {
|
|
139
139
|
prefix: "prefixNeededForNotSupportedNamespace",
|
|
140
140
|
uri: "uriNeededForNotSupportedNamespace"
|
|
141
141
|
},
|
|
142
142
|
value: u ?? "",
|
|
143
|
-
parent:
|
|
144
|
-
children:
|
|
143
|
+
parent: i.parent ?? null,
|
|
144
|
+
children: i.children ?? []
|
|
145
145
|
}, h = Object.values(t.namespaces).map(({ uri: e }) => e), g = l?.uri != null && !h.includes(l.uri);
|
|
146
|
-
if (!(t.elements.includes(
|
|
147
|
-
let _ =
|
|
146
|
+
if (!(t.elements.includes(s) && !g)) return m;
|
|
147
|
+
let _ = r({
|
|
148
148
|
dialecteConfig: t,
|
|
149
149
|
record: m
|
|
150
150
|
})?.attributes.sequence ?? [], v = p.filter((e) => {
|
|
@@ -158,29 +158,29 @@ function P(e) {
|
|
|
158
158
|
return n;
|
|
159
159
|
}
|
|
160
160
|
return e;
|
|
161
|
-
}), x = d ? t.definition[d]?.children?.details?.[
|
|
161
|
+
}), x = d ? t.definition[d]?.children?.details?.[s]?.namespace : void 0, S = {
|
|
162
162
|
...m,
|
|
163
|
-
namespace: x ?? t.definition[
|
|
164
|
-
attributes:
|
|
163
|
+
namespace: x ?? t.definition[s].namespace,
|
|
164
|
+
attributes: o(b, _)
|
|
165
165
|
};
|
|
166
166
|
return n?.afterStandardizedRecord && (S = n.afterStandardizedRecord({ record: S }), S = {
|
|
167
167
|
...S,
|
|
168
|
-
attributes:
|
|
168
|
+
attributes: o(S.attributes, _)
|
|
169
169
|
}), S;
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region src/helpers/assert-fixed.ts
|
|
173
173
|
function F(t) {
|
|
174
|
-
let { dialecteConfig: n, record:
|
|
175
|
-
for (let t of
|
|
176
|
-
let
|
|
174
|
+
let { dialecteConfig: n, record: r, attributes: i } = t;
|
|
175
|
+
for (let t of i) {
|
|
176
|
+
let i = e({
|
|
177
177
|
dialecteConfig: n,
|
|
178
|
-
record:
|
|
178
|
+
record: r,
|
|
179
179
|
attributeName: t.name
|
|
180
180
|
});
|
|
181
|
-
|
|
182
|
-
detail: `Attribute '${t.name}' on '${
|
|
183
|
-
ref: { tagName:
|
|
181
|
+
i.fixed !== void 0 && t.value !== i.fixed && s("FIXED_VALUE_VIOLATION", {
|
|
182
|
+
detail: `Attribute '${t.name}' on '${r.tagName}' is fixed to '${i.fixed}' but was set to '${String(t.value)}'.`,
|
|
183
|
+
ref: { tagName: r.tagName }
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -188,10 +188,10 @@ function F(t) {
|
|
|
188
188
|
//#region src/helpers/merge-extensions.ts
|
|
189
189
|
function I(e, t, n, r) {
|
|
190
190
|
if (!e || !t) return;
|
|
191
|
-
let
|
|
192
|
-
a
|
|
191
|
+
let a = Object.keys(t).filter((t) => t in e);
|
|
192
|
+
i(a.length === 0, {
|
|
193
193
|
key: "EXTENSION_METHOD_COLLISION",
|
|
194
|
-
detail: `Module "${n}" has conflicting ${r} method(s): ${
|
|
194
|
+
detail: `Module "${n}" has conflicting ${r} method(s): ${a.map((e) => `"${e}"`).join(", ")}`
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
function L(e) {
|
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, 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-
|
|
2
|
-
import { _ as pe,
|
|
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,
|
|
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-BdNBOjAX.js";
|
|
2
|
+
import { _ as pe, b as me, g as he, v as ge, x as _e, y as ve } from "./utils-Cgqv3qwv.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, _e 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, he as createDialecteError, p as createPerf, Q as createStagedOperations, pe as defineErrors, 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, ge as isKnownDialecteError, $ 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, ve as throwDialecteError, me as toDialecteError, v as xmlDocumentToString };
|