@techspokes/typescript-wsdl-client 1.2.0 → 1.4.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/README.md +13 -0
- package/dist/checkedPipeline.d.ts +73 -2
- package/dist/checkedPipeline.js +118 -8
- package/dist/checkedPlanning.d.ts +5 -2
- package/dist/checkedPlanning.js +30 -5
- package/dist/checkedResponseInspection.d.ts +100 -0
- package/dist/checkedResponseInspection.js +499 -0
- package/dist/cli.js +55 -1
- package/dist/client/checkedDirectRuntime.d.ts +19 -1
- package/dist/client/checkedDirectRuntime.js +27 -2
- package/dist/client/directClientRuntime.d.ts +25 -1
- package/dist/client/directClientRuntime.js +23 -5
- package/dist/client/directClientVersion.d.ts +4 -0
- package/dist/client/directClientVersion.js +4 -0
- package/dist/client/generateDirectClient.js +14 -9
- package/dist/compiler/componentRecordProjection.d.ts +1 -0
- package/dist/compiler/componentRecordProjection.js +15 -4
- package/dist/compiler/directCodec.js +4 -12
- package/dist/compiler/directOperation.d.ts +2 -1
- package/dist/compiler/directOperation.js +27 -11
- package/dist/compiler/directSoap.d.ts +87 -12
- package/dist/compiler/directSoap.js +316 -94
- package/dist/compiler/directSoapSource.js +3 -2
- package/dist/compiler/directSourceCapsule.js +12 -3
- package/dist/compiler/soapHeaders.d.ts +10 -4
- package/dist/compiler/soapHeaders.js +28 -9
- package/dist/compiler/sourceCorrections.d.ts +118 -0
- package/dist/compiler/sourceCorrections.js +794 -0
- package/dist/gateway/generateCheckedGateway.js +27 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/util/readBoundedFile.d.ts +9 -0
- package/dist/util/readBoundedFile.js +36 -0
- package/dist/util/xmlBytes.d.ts +9 -0
- package/dist/util/xmlBytes.js +24 -0
- package/docs/api-reference.md +28 -1
- package/docs/checked-gateway.md +52 -0
- package/docs/checked-generation.md +4 -4
- package/docs/cli-reference.md +16 -1
- package/docs/migration.md +20 -0
- package/docs/start-here.md +1 -1
- package/docs/supported-patterns.md +6 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** SOAP
|
|
1
|
+
/** SOAP response-header clauses for the component transport's default ultimate-receiver role. */
|
|
2
2
|
import type { ExpandedName, SyntaxElement } from '../loader/orderedSyntax.js';
|
|
3
3
|
export type ComponentSoapHeaderResult = Readonly<{
|
|
4
4
|
kind: 'ignored-optional-headers';
|
|
@@ -9,8 +9,14 @@ export type ComponentSoapHeaderResult = Readonly<{
|
|
|
9
9
|
}>;
|
|
10
10
|
/** Assess borrowed parsed Header syntax without claiming unknown block semantics.
|
|
11
11
|
* @remarks SOAP 1.1 sections 4.2 through 4.2.3 require qualified block names and define absent mustUnderstand
|
|
12
|
-
* as 0.
|
|
13
|
-
*
|
|
12
|
+
* as 0. SOAP 1.2 additionally defines boolean lexicals and role/relay attributes. Only immediate block
|
|
13
|
+
* attributes govern processing. Unknown mandatory blocks targeted at this receiver remain unsupported.
|
|
14
|
+
* @param header Parsed Header in the selected envelope namespace.
|
|
15
|
+
* @param check Invocation-owned cancellation and work accounting.
|
|
16
|
+
* @param version Selected SOAP binding version; omission retains SOAP 1.1 compatibility.
|
|
17
|
+
* @returns Unprocessed block names or an explicit protocol/capability refusal.
|
|
18
|
+
* @throws Propagates caller cancellation and resource exceptions from check.
|
|
14
19
|
* @see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/
|
|
20
|
+
* @see https://www.w3.org/TR/soap12-part1/#soapheadblock
|
|
15
21
|
*/
|
|
16
|
-
export declare function assessComponentSoapHeader(header: SyntaxElement, check: () => void): ComponentSoapHeaderResult;
|
|
22
|
+
export declare function assessComponentSoapHeader(header: SyntaxElement, check: () => void, version?: '1.1' | '1.2'): ComponentSoapHeaderResult;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
const SOAP = 'http://schemas.xmlsoap.org/soap/envelope/';
|
|
2
2
|
/** Assess borrowed parsed Header syntax without claiming unknown block semantics.
|
|
3
3
|
* @remarks SOAP 1.1 sections 4.2 through 4.2.3 require qualified block names and define absent mustUnderstand
|
|
4
|
-
* as 0.
|
|
5
|
-
*
|
|
4
|
+
* as 0. SOAP 1.2 additionally defines boolean lexicals and role/relay attributes. Only immediate block
|
|
5
|
+
* attributes govern processing. Unknown mandatory blocks targeted at this receiver remain unsupported.
|
|
6
|
+
* @param header Parsed Header in the selected envelope namespace.
|
|
7
|
+
* @param check Invocation-owned cancellation and work accounting.
|
|
8
|
+
* @param version Selected SOAP binding version; omission retains SOAP 1.1 compatibility.
|
|
9
|
+
* @returns Unprocessed block names or an explicit protocol/capability refusal.
|
|
10
|
+
* @throws Propagates caller cancellation and resource exceptions from check.
|
|
6
11
|
* @see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/
|
|
12
|
+
* @see https://www.w3.org/TR/soap12-part1/#soapheadblock
|
|
7
13
|
*/
|
|
8
|
-
export function assessComponentSoapHeader(header, check) {
|
|
14
|
+
export function assessComponentSoapHeader(header, check, version = '1.1') {
|
|
9
15
|
check();
|
|
10
|
-
|
|
16
|
+
const namespace = version === '1.2' ? 'http://www.w3.org/2003/05/soap-envelope' : SOAP;
|
|
17
|
+
if (header.name.namespace !== namespace || header.name.local !== 'Header' || header.attributes.length)
|
|
11
18
|
return Object.freeze({ kind: 'protocol', rule: 'SOAP Header shape' });
|
|
12
19
|
const headers = [];
|
|
13
20
|
for (const child of header.children) {
|
|
@@ -20,21 +27,33 @@ export function assessComponentSoapHeader(header, check) {
|
|
|
20
27
|
if (!child.name.namespace)
|
|
21
28
|
return Object.freeze({ kind: 'protocol', rule: 'SOAP header block namespace required' });
|
|
22
29
|
let mandatory = false;
|
|
30
|
+
let targeted = true;
|
|
23
31
|
for (const attribute of child.attributes) {
|
|
24
32
|
check();
|
|
25
|
-
if (attribute.name.namespace !==
|
|
33
|
+
if (attribute.name.namespace !== namespace)
|
|
26
34
|
continue;
|
|
35
|
+
if (version === '1.2' && attribute.name.local === 'role') {
|
|
36
|
+
if (!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(attribute.value))
|
|
37
|
+
return Object.freeze({ kind: 'protocol', rule: 'SOAP role URI' });
|
|
38
|
+
targeted = [namespace + '/role/next', namespace + '/role/ultimateReceiver'].includes(attribute.value);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (version === '1.2' && attribute.name.local === 'relay') {
|
|
42
|
+
if (!['true', 'false', '1', '0'].includes(attribute.value))
|
|
43
|
+
return Object.freeze({ kind: 'protocol', rule: 'SOAP relay boolean' });
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
27
46
|
if (attribute.name.local === 'actor')
|
|
28
47
|
return Object.freeze({ kind: 'unsupported', rule: 'SOAP actor header capability required' });
|
|
29
48
|
if (attribute.name.local === 'mustUnderstand') {
|
|
30
|
-
if (
|
|
31
|
-
return Object.freeze({ kind: 'protocol', rule:
|
|
32
|
-
mandatory = attribute.value === '1';
|
|
49
|
+
if (!(version === '1.2' ? ['true', 'false', '1', '0'] : ['0', '1']).includes(attribute.value))
|
|
50
|
+
return Object.freeze({ kind: 'protocol', rule: `SOAP ${version} mustUnderstand value` });
|
|
51
|
+
mandatory = attribute.value === '1' || attribute.value === 'true';
|
|
33
52
|
}
|
|
34
53
|
else if (attribute.name.local !== 'encodingStyle')
|
|
35
54
|
return Object.freeze({ kind: 'unsupported', rule: 'unknown SOAP header attribute' });
|
|
36
55
|
}
|
|
37
|
-
if (mandatory)
|
|
56
|
+
if (mandatory && targeted)
|
|
38
57
|
return Object.freeze({ kind: 'unsupported', rule: 'incoming mandatory SOAP header' });
|
|
39
58
|
headers.push(Object.freeze({ ...child.name }));
|
|
40
59
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { SchemaInput } from "../loader/schemaInput.js";
|
|
2
|
+
import type { OfflineSchemaResource } from "../loader/schemaResources.js";
|
|
3
|
+
import type { GraphNode, NodeId } from "./canonicalGraph.js";
|
|
4
|
+
export type SourceCorrectionSelector = Readonly<{
|
|
5
|
+
id: NodeId;
|
|
6
|
+
uri: string;
|
|
7
|
+
digest: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type SourceCorrectionInventoryNode = Readonly<{
|
|
10
|
+
id: NodeId;
|
|
11
|
+
kind: GraphNode["kind"];
|
|
12
|
+
role: string;
|
|
13
|
+
namespace: string;
|
|
14
|
+
name?: Readonly<{
|
|
15
|
+
namespace: string;
|
|
16
|
+
local: string;
|
|
17
|
+
}>;
|
|
18
|
+
syntaxName: Readonly<{
|
|
19
|
+
namespace: string;
|
|
20
|
+
local: string;
|
|
21
|
+
}>;
|
|
22
|
+
uri: string;
|
|
23
|
+
digest: string;
|
|
24
|
+
path: string;
|
|
25
|
+
start: number;
|
|
26
|
+
end: number;
|
|
27
|
+
attributes: readonly Readonly<{
|
|
28
|
+
name: string;
|
|
29
|
+
namespace: string;
|
|
30
|
+
lexicalName: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}>[];
|
|
33
|
+
occurs?: Readonly<{
|
|
34
|
+
min: string;
|
|
35
|
+
max: string | "unbounded";
|
|
36
|
+
}>;
|
|
37
|
+
wildcard?: Readonly<{
|
|
38
|
+
namespace: string;
|
|
39
|
+
processContents: string;
|
|
40
|
+
}>;
|
|
41
|
+
children?: readonly NodeId[];
|
|
42
|
+
parent?: NodeId;
|
|
43
|
+
chameleon: boolean;
|
|
44
|
+
ambiguousContext: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
export type SourceCorrectionInventory = Readonly<{
|
|
47
|
+
version: 1;
|
|
48
|
+
resources: readonly Readonly<{
|
|
49
|
+
uri: string;
|
|
50
|
+
digest: string;
|
|
51
|
+
byteLength: number;
|
|
52
|
+
}>[];
|
|
53
|
+
nodes: readonly SourceCorrectionInventoryNode[];
|
|
54
|
+
}>;
|
|
55
|
+
type OccursCorrection = Readonly<{
|
|
56
|
+
kind: "set-occurs";
|
|
57
|
+
target: SourceCorrectionSelector;
|
|
58
|
+
min: string;
|
|
59
|
+
max: string | "unbounded";
|
|
60
|
+
}>;
|
|
61
|
+
type WildcardCorrection = Readonly<{
|
|
62
|
+
kind: "set-wildcard-namespaces";
|
|
63
|
+
target: SourceCorrectionSelector;
|
|
64
|
+
namespaces: readonly string[];
|
|
65
|
+
}>;
|
|
66
|
+
type InsertPosition = "append" | Readonly<{
|
|
67
|
+
kind: "before" | "after";
|
|
68
|
+
target: SourceCorrectionSelector;
|
|
69
|
+
}>;
|
|
70
|
+
type InsertElement = Readonly<{
|
|
71
|
+
kind: "declaration";
|
|
72
|
+
name: string;
|
|
73
|
+
type: Readonly<{
|
|
74
|
+
namespace: string;
|
|
75
|
+
local: string;
|
|
76
|
+
}>;
|
|
77
|
+
min: string;
|
|
78
|
+
max: string | "unbounded";
|
|
79
|
+
} | {
|
|
80
|
+
kind: "reference";
|
|
81
|
+
target: SourceCorrectionSelector;
|
|
82
|
+
min: string;
|
|
83
|
+
max: string | "unbounded";
|
|
84
|
+
}>;
|
|
85
|
+
type InsertCorrection = Readonly<{
|
|
86
|
+
kind: "insert-element";
|
|
87
|
+
target: SourceCorrectionSelector;
|
|
88
|
+
position: InsertPosition;
|
|
89
|
+
element: InsertElement;
|
|
90
|
+
}>;
|
|
91
|
+
type Correction = OccursCorrection | WildcardCorrection | InsertCorrection;
|
|
92
|
+
export type SourceCorrectionProvenance = Readonly<{
|
|
93
|
+
version: 1;
|
|
94
|
+
canonicalRecipeDigest: string;
|
|
95
|
+
resources: readonly Readonly<{
|
|
96
|
+
uri: string;
|
|
97
|
+
originalDigest: string;
|
|
98
|
+
effectiveDigest: string;
|
|
99
|
+
changed: boolean;
|
|
100
|
+
}>[];
|
|
101
|
+
corrections: readonly Readonly<{
|
|
102
|
+
kind: Correction["kind"];
|
|
103
|
+
target: SourceCorrectionSelector;
|
|
104
|
+
}>[];
|
|
105
|
+
}>;
|
|
106
|
+
export type PreparedCorrectedSourceInputs = Readonly<{
|
|
107
|
+
inventory: SourceCorrectionInventory;
|
|
108
|
+
resources: ReadonlyMap<string, OfflineSchemaResource>;
|
|
109
|
+
provenance: SourceCorrectionProvenance;
|
|
110
|
+
}>;
|
|
111
|
+
export declare class SourceCorrectionError extends Error {
|
|
112
|
+
readonly category: "invalid-recipe" | "stale-source" | "ambiguous-target" | "unsupported-target" | "resource-limit" | "cancelled";
|
|
113
|
+
constructor(category: "invalid-recipe" | "stale-source" | "ambiguous-target" | "unsupported-target" | "resource-limit" | "cancelled", message: string);
|
|
114
|
+
}
|
|
115
|
+
export declare function inspectSourceCorrectionInventory(inputs: readonly SchemaInput[], signal?: AbortSignal): SourceCorrectionInventory;
|
|
116
|
+
/** Validate and apply a versioned correction recipe to an authenticated source union. */
|
|
117
|
+
export declare function prepareCorrectedSourceInputs(inputs: readonly SchemaInput[], recipeValue: unknown, signal?: AbortSignal): PreparedCorrectedSourceInputs;
|
|
118
|
+
export {};
|