@syncmatters/script-api 1.0.12 → 1.0.14

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.
@@ -1,7 +1,7 @@
1
1
  import API from "../index.js";
2
2
  import { CodedError } from "./coded-error.js";
3
3
  import { FileProvider } from "./utilities/file-provider/file-provider.js";
4
- import { SyncEndpoint, SyncSession } from "./sync.js";
4
+ import { SyncEndpoint } from "./sync.js";
5
5
  export interface Connection {
6
6
  /** org unique connection id */
7
7
  readonly id: string;
@@ -64,10 +64,10 @@ export interface Connection {
64
64
  objectIds?: string[];
65
65
  }): Promise<void>;
66
66
  /**
67
- * Requests the connection prepares for a session that will interact with sync(s)
68
- * @param options session specification.
67
+ * Constructs an endpoint through which sync(s) can interact with this connection.
68
+ * The endpoint has no active session until {@link SyncEndpoint.sessionBegin} is called.
69
69
  */
70
- syncSession?(options: SyncSession): Promise<SyncEndpoint>;
70
+ syncEndpoint?(): Promise<SyncEndpoint>;
71
71
  }
72
72
  export interface Cache {
73
73
  count: {
@@ -22,6 +22,12 @@ export interface XmlParseOptions {
22
22
  * When set, xmlParse streams matching elements; omit for a full-document Promise.
23
23
  */
24
24
  emit?: string[];
25
+ /**
26
+ * XPath subset expressions (same syntax as `emit`) naming elements to prune: a matching
27
+ * element and its whole subtree are dropped before any `emit` matching or recording, so
28
+ * documents padded with unread markup cost neither parse time nor memory. Requires `emit`.
29
+ */
30
+ skip?: string[];
25
31
  }
26
32
  /**
27
33
  * One matched element from a streaming xmlParse({ source, emit }) call.
@@ -17,9 +17,10 @@ export declare function localNameOf(qname: string): string;
17
17
  /**
18
18
  * Compile one XPath-subset expression.
19
19
  * Supported: `//Name`, `/A/B/C`, `A/B` (local names only; prefixes ignored).
20
+ * `label` names the option being compiled so errors point at `emit` or `skip`.
20
21
  */
21
- export declare function compileEmitExpression(raw: string): XmlEmitMatcher;
22
- export declare function compileEmitExpressions(emit: string[]): XmlEmitMatcher[];
22
+ export declare function compileEmitExpression(raw: string, label?: string): XmlEmitMatcher;
23
+ export declare function compileEmitExpressions(expressions: string[], label?: string): XmlEmitMatcher[];
23
24
  /** True if the current element stack (local names) matches the compiled expression. */
24
25
  export declare function matchesEmit(matcher: XmlEmitMatcher, pathLocalNames: string[]): boolean;
25
26
  /** Last path step local name for a matcher (the element that starts a potential match). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncmatters/script-api",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "TypeScript type definitions for the SyncMatters script API (types only - scripts execute on the SyncMatters platform)",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "author": "SyncMatters",
30
30
  "homepage": "https://syncmatters.com",
31
- "typesContentHash": "87bf322ba471ad760d94c31884ed28859fb460b28f3558f876ee88423eda1c92",
31
+ "typesContentHash": "1908da7a9d689fba3b76a80a652493ef9028ab6cebb2e1c08db9f2cc3cb9ffa5",
32
32
  "dependencies": {
33
33
  "@types/node": "*"
34
34
  }