@techspokes/typescript-wsdl-client 0.35.0 → 0.39.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/dist/app/generateApp.js +3 -3
- package/dist/client/generateTypes.d.ts.map +1 -1
- package/dist/client/generateTypes.js +20 -0
- package/dist/compiler/schemaCompiler.d.ts +2 -0
- package/dist/compiler/schemaCompiler.d.ts.map +1 -1
- package/dist/compiler/schemaCompiler.js +19 -6
- package/dist/compiler/shapeResolver.js +4 -0
- package/dist/gateway/generators.d.ts.map +1 -1
- package/dist/gateway/generators.js +8 -2
- package/dist/openapi/generateSchemas.d.ts.map +1 -1
- package/dist/openapi/generateSchemas.js +10 -2
- package/dist/openapi/security.d.ts +1 -1
- package/dist/openapi/security.d.ts.map +1 -1
- package/dist/openapi/security.js +1 -1
- package/dist/test/mockData.d.ts +5 -0
- package/dist/test/mockData.d.ts.map +1 -1
- package/dist/test/mockData.js +12 -2
- package/dist/util/attributeWildcards.d.ts +16 -0
- package/dist/util/attributeWildcards.d.ts.map +1 -0
- package/dist/util/attributeWildcards.js +14 -0
- package/docs/file-naming-and-path-organization.md +1 -1
- package/docs/releases/README.md +1 -0
- package/docs/releases/v0.36.0.md +32 -0
- package/docs/releases/v0.37.0.md +33 -0
- package/docs/releases/v0.38.0.md +35 -0
- package/docs/releases/v0.39.0.md +35 -0
- package/docs/roadmap/README.md +11 -6
- package/docs/roadmap/v1.0-capability-conformance-framework.md +2 -2
- package/docs/roadmap/v1.0-contract-audit.md +2 -2
- package/docs/roadmap/v1.0-release-candidate-gates.md +5 -2
- package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +6 -5
- package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +932 -0
- package/docs/supported-patterns.md +9 -6
- package/package.json +9 -5
package/dist/app/generateApp.js
CHANGED
|
@@ -525,14 +525,14 @@ function generatePackageJson(appDir, force) {
|
|
|
525
525
|
dev: "tsx watch server.ts",
|
|
526
526
|
},
|
|
527
527
|
dependencies: {
|
|
528
|
-
fastify: "^5.
|
|
528
|
+
fastify: "^5.9.0",
|
|
529
529
|
"fastify-plugin": "^6.0.0",
|
|
530
530
|
saxes: "^6.0.0",
|
|
531
531
|
soap: "^1.9.3",
|
|
532
532
|
},
|
|
533
533
|
devDependencies: {
|
|
534
|
-
"@types/node": "^26.0
|
|
535
|
-
tsx: "^4.
|
|
534
|
+
"@types/node": "^26.1.0",
|
|
535
|
+
tsx: "^4.23.0",
|
|
536
536
|
typescript: "^6.0.3",
|
|
537
537
|
},
|
|
538
538
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/client/generateTypes.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAC,eAAe,EAA0D,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/client/generateTypes.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAC,eAAe,EAA0D,MAAM,+BAA+B,CAAC;AAI5H;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QAsSvE"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import fs from "node:fs";
|
|
16
16
|
import { error } from "../util/cli.js";
|
|
17
|
+
import { hasAttributeWildcards, wildcardAttributeBagName } from "../util/attributeWildcards.js";
|
|
17
18
|
/**
|
|
18
19
|
* Generates TypeScript interfaces and type aliases from a compiled WSDL catalog
|
|
19
20
|
*
|
|
@@ -65,6 +66,7 @@ export function generateTypes(outFile, compiled) {
|
|
|
65
66
|
const isValidIdent = (name) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name);
|
|
66
67
|
const emitPropName = (name) => (isValidIdent(name) ? name : JSON.stringify(name));
|
|
67
68
|
const isChoiceUnionMode = compiled.options.choice === "union";
|
|
69
|
+
const wildcardBagName = wildcardAttributeBagName(compiled.options);
|
|
68
70
|
const elementType = (e) => {
|
|
69
71
|
const isArray = e.max === "unbounded" || (e.max > 1);
|
|
70
72
|
return `${e.tsType}${isArray ? "[]" : ""}`;
|
|
@@ -123,6 +125,15 @@ export function generateTypes(outFile, compiled) {
|
|
|
123
125
|
}
|
|
124
126
|
lines.push(`${indent}${emitPropName(a.name)}${opt}: ${a.tsType};`);
|
|
125
127
|
};
|
|
128
|
+
const emitWildcardAttributeBagProperty = (indent) => {
|
|
129
|
+
const annObj = {
|
|
130
|
+
kind: "attributeWildcard",
|
|
131
|
+
type: "xs:anyAttribute",
|
|
132
|
+
};
|
|
133
|
+
lines.push("");
|
|
134
|
+
lines.push(`${indent}/** @xsd ${JSON.stringify(annObj)} */`);
|
|
135
|
+
lines.push(`${indent}${emitPropName(wildcardBagName)}?: Record<string, string>;`);
|
|
136
|
+
};
|
|
126
137
|
const isSyntheticAliasSelfWrapper = (t) => {
|
|
127
138
|
const elems = t.elems || [];
|
|
128
139
|
return aliasNames.has(t.name) &&
|
|
@@ -171,6 +182,9 @@ export function generateTypes(outFile, compiled) {
|
|
|
171
182
|
}
|
|
172
183
|
// Prepare lists: for complexContent extension use only local additions
|
|
173
184
|
const attrsToEmit = complexBase ? (t.localAttrs || []) : (t.attrs || []);
|
|
185
|
+
const wildcardCarrier = complexBase
|
|
186
|
+
? { attributeWildcards: t.localAttributeWildcards }
|
|
187
|
+
: { attributeWildcards: t.attributeWildcards };
|
|
174
188
|
// Elements list similar
|
|
175
189
|
let elementsToEmit = complexBase ? (t.localElems || []) : (t.elems || []);
|
|
176
190
|
// SimpleContent extension special handling drops synthetic $value
|
|
@@ -205,6 +219,9 @@ export function generateTypes(outFile, compiled) {
|
|
|
205
219
|
for (const a of attrsToEmit) {
|
|
206
220
|
emitAttributeProperty(" ", a);
|
|
207
221
|
}
|
|
222
|
+
if (hasAttributeWildcards(wildcardCarrier)) {
|
|
223
|
+
emitWildcardAttributeBagProperty(" ");
|
|
224
|
+
}
|
|
208
225
|
if (0 < baseElements.length) {
|
|
209
226
|
lines.push("");
|
|
210
227
|
lines.push(" /**");
|
|
@@ -266,6 +283,9 @@ export function generateTypes(outFile, compiled) {
|
|
|
266
283
|
for (const a of attrsToEmit) {
|
|
267
284
|
emitAttributeProperty(" ", a);
|
|
268
285
|
}
|
|
286
|
+
if (hasAttributeWildcards(wildcardCarrier)) {
|
|
287
|
+
emitWildcardAttributeBagProperty(" ");
|
|
288
|
+
}
|
|
269
289
|
//
|
|
270
290
|
// Elements — with JSDoc on every element
|
|
271
291
|
//
|
|
@@ -71,6 +71,7 @@ export type CompiledChoiceGroup = {
|
|
|
71
71
|
* @property {string} [base] - Base type name for extension/inheritance
|
|
72
72
|
* @property {Array<Object>} [localAttrs] - Attributes added in extension (not inherited)
|
|
73
73
|
* @property {Array<Object>} [localElems] - Elements added in extension (not inherited)
|
|
74
|
+
* @property {Array<Object>} [localAttributeWildcards] - Attribute wildcards added in extension
|
|
74
75
|
* @property {Array<Object>} [wildcards] - xs:any wildcard particles retained on the type
|
|
75
76
|
* @property {Array<Object>} [attributeWildcards] - xs:anyAttribute wildcards retained on the type
|
|
76
77
|
*/
|
|
@@ -114,6 +115,7 @@ export type CompiledType = {
|
|
|
114
115
|
}>;
|
|
115
116
|
wildcards?: CompiledWildcard[];
|
|
116
117
|
attributeWildcards?: CompiledAttributeWildcard[];
|
|
118
|
+
localAttributeWildcards?: CompiledAttributeWildcard[];
|
|
117
119
|
choiceGroups?: CompiledChoiceGroup[];
|
|
118
120
|
localChoiceGroups?: CompiledChoiceGroup[];
|
|
119
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaCompiler.d.ts","sourceRoot":"","sources":["../../src/compiler/schemaCompiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,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AAC;IACF,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC,CAAC;AAqPF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,eAAe,EACxB,YAAY,CAAC,EAAE,YAAY,GAC1B,eAAe,CA8hCjB"}
|
|
@@ -433,6 +433,22 @@ export function compileCatalog(cat, options, streamConfig) {
|
|
|
433
433
|
}
|
|
434
434
|
return merged;
|
|
435
435
|
};
|
|
436
|
+
const mergeJsonUnique = (into, list) => {
|
|
437
|
+
if (list.length === 0)
|
|
438
|
+
return into;
|
|
439
|
+
const merged = into ? [...into] : [];
|
|
440
|
+
const seen = new Set(merged.map((w) => JSON.stringify(w)));
|
|
441
|
+
for (const w of list) {
|
|
442
|
+
const key = JSON.stringify(w);
|
|
443
|
+
if (!seen.has(key)) {
|
|
444
|
+
seen.add(key);
|
|
445
|
+
merged.push(w);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return merged;
|
|
449
|
+
};
|
|
450
|
+
const mergeWildcards = (into, list) => mergeJsonUnique(into, list);
|
|
451
|
+
const mergeAttributeWildcards = (into, list) => mergeJsonUnique(into, list);
|
|
436
452
|
const collectAttributes = (node) => {
|
|
437
453
|
const out = [];
|
|
438
454
|
const attrs = getChildrenWithLocalName(node, "attribute");
|
|
@@ -655,12 +671,8 @@ export function compileCatalog(cat, options, streamConfig) {
|
|
|
655
671
|
const newChoiceGroups = collectChoiceGroups(outName, cnode);
|
|
656
672
|
mergeAttrs(present.attrs, newAttrs);
|
|
657
673
|
mergeElems(present.elems, newElems);
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
if (newAttributeWildcards.length > 0) {
|
|
662
|
-
present.attributeWildcards = [...(present.attributeWildcards ?? []), ...newAttributeWildcards];
|
|
663
|
-
}
|
|
674
|
+
present.wildcards = mergeWildcards(present.wildcards, newWildcards);
|
|
675
|
+
present.attributeWildcards = mergeAttributeWildcards(present.attributeWildcards, newAttributeWildcards);
|
|
664
676
|
const mergedChoiceGroups = mergeChoiceGroups(present.choiceGroups, newChoiceGroups);
|
|
665
677
|
if (mergedChoiceGroups && mergedChoiceGroups.length > 0) {
|
|
666
678
|
present.choiceGroups = mergedChoiceGroups;
|
|
@@ -721,6 +733,7 @@ export function compileCatalog(cat, options, streamConfig) {
|
|
|
721
733
|
localElems,
|
|
722
734
|
...(localWildcards.length > 0 ? { wildcards: localWildcards } : {}),
|
|
723
735
|
...(attributeWildcards.length > 0 ? { attributeWildcards } : {}),
|
|
736
|
+
...(localAttributeWildcards.length > 0 ? { localAttributeWildcards } : {}),
|
|
724
737
|
...(choiceGroups.length > 0 ? { choiceGroups } : {}),
|
|
725
738
|
...(localChoiceGroups.length > 0 ? { localChoiceGroups } : {}),
|
|
726
739
|
};
|
|
@@ -255,6 +255,10 @@ function canonicalizeType(t) {
|
|
|
255
255
|
namespace: w.namespace ?? null,
|
|
256
256
|
processContents: w.processContents ?? null,
|
|
257
257
|
})),
|
|
258
|
+
localAttributeWildcards: (t.localAttributeWildcards ?? []).map((w) => ({
|
|
259
|
+
namespace: w.namespace ?? null,
|
|
260
|
+
processContents: w.processContents ?? null,
|
|
261
|
+
})),
|
|
258
262
|
choiceGroups: (t.choiceGroups ?? []).map((g) => ({
|
|
259
263
|
name: g.name,
|
|
260
264
|
min: g.min,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../src/gateway/generators.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,UAAU,EAAE,KAAK,eAAe,EAAyE,MAAM,cAAc,CAAC;AAG3I;;;;;;;;;;;;;;;GAeG;AACH,wB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,EACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,iBAAiB,EAAE,EAC/B,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAChC,IAAI,CA6DN;AA4BD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,GAAG,EACb,IAAI,CAAC,EAAE;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAC,GAC5B,IAAI,CAiQN;AA6ED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAChC,IAAI,CAuFN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAChC,IAAI,CA6BN;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,iBAAiB,EAAE,EAC/B,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EACjC,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI,CA6HN"}
|
|
@@ -405,6 +405,10 @@ export function emitRuntimeModule(outDir, versionSlug, serviceSlug, catalog, opt
|
|
|
405
405
|
const childTypes = catalog.meta?.childType || {};
|
|
406
406
|
// Only emit if there are actual wrapper types to unwrap
|
|
407
407
|
if (Object.keys(arrayWrappers).length > 0) {
|
|
408
|
+
const childrenTypesJsonLines = JSON.stringify(childTypes, null, 2)
|
|
409
|
+
.split("\n")
|
|
410
|
+
.map((line) => ` ${JSON.stringify(line)}`)
|
|
411
|
+
.join(",\n");
|
|
408
412
|
unwrapSection = `
|
|
409
413
|
/**
|
|
410
414
|
* ArrayOf* wrapper type → inner element property name.
|
|
@@ -416,7 +420,9 @@ const ARRAY_WRAPPERS: Record<string, string> = ${JSON.stringify(arrayWrappers, n
|
|
|
416
420
|
/**
|
|
417
421
|
* Type name → { propertyName: propertyTypeName } for recursive unwrapping.
|
|
418
422
|
*/
|
|
419
|
-
const CHILDREN_TYPES: Record<string, Record<string, string>> =
|
|
423
|
+
const CHILDREN_TYPES: Record<string, Record<string, string>> = JSON.parse([
|
|
424
|
+
${childrenTypesJsonLines}
|
|
425
|
+
].join("\\n")) as Record<string, Record<string, string>>;
|
|
420
426
|
|
|
421
427
|
function isSafeObjectKey(key: string): boolean {
|
|
422
428
|
return key !== "__proto__" && key !== "constructor" && key !== "prototype";
|
|
@@ -512,7 +518,7 @@ export type ResponseEnvelope<T> = SuccessEnvelope<T> | ErrorEnvelope;
|
|
|
512
518
|
* @param message - Optional success message
|
|
513
519
|
* @returns Success envelope wrapping the data
|
|
514
520
|
*/
|
|
515
|
-
export function buildSuccessEnvelope<T>(data: T, message?: string):
|
|
521
|
+
export function buildSuccessEnvelope<T>(data: T, message?: string): ResponseEnvelope<T> {
|
|
516
522
|
return {
|
|
517
523
|
status: "SUCCESS",
|
|
518
524
|
message: message ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSchemas.d.ts","sourceRoot":"","sources":["../../src/openapi/generateSchemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAgB,eAAe,EAAe,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"generateSchemas.d.ts","sourceRoot":"","sources":["../../src/openapi/generateSchemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAgB,eAAe,EAAe,MAAM,+BAA+B,CAAC;AAGhG;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AA+PpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,sBAAsB,GAAG,iBAAiB,CA6D1G"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasAttributeWildcards, wildcardAttributeBagName, wildcardAttributeBagSchema } from "../util/attributeWildcards.js";
|
|
1
2
|
function isLiteralUnion(ts) {
|
|
2
3
|
// very naive: split by | and ensure each trimmed starts and ends with quotes
|
|
3
4
|
const parts = ts.split("|").map(p => p.trim()).filter(Boolean);
|
|
@@ -99,7 +100,7 @@ function isSyntheticAliasSelfWrapper(t, aliasNames) {
|
|
|
99
100
|
const e = t.elems[0];
|
|
100
101
|
return e.name === "$value" && e.tsType === t.name;
|
|
101
102
|
}
|
|
102
|
-
function buildComplexSchema(t, closed, knownTypeNames, aliasNames, flattenWrappers, choiceUnionMode) {
|
|
103
|
+
function buildComplexSchema(t, closed, knownTypeNames, aliasNames, flattenWrappers, choiceUnionMode, attributesKey) {
|
|
103
104
|
// Use knownTypeNames/aliasNames to validate $ref targets so we surface
|
|
104
105
|
// compiler issues early instead of emitting dangling references in OpenAPI output.
|
|
105
106
|
function refOrPrimitive(ts) {
|
|
@@ -156,6 +157,12 @@ function buildComplexSchema(t, closed, knownTypeNames, aliasNames, flattenWrappe
|
|
|
156
157
|
if (a.use === "required")
|
|
157
158
|
required.push(a.name);
|
|
158
159
|
}
|
|
160
|
+
const wildcardCarrier = t.base
|
|
161
|
+
? { attributeWildcards: t.localAttributeWildcards }
|
|
162
|
+
: { attributeWildcards: t.attributeWildcards };
|
|
163
|
+
if (hasAttributeWildcards(wildcardCarrier)) {
|
|
164
|
+
properties[attributesKey] = wildcardAttributeBagSchema();
|
|
165
|
+
}
|
|
159
166
|
// elements
|
|
160
167
|
for (const e of t.elems) {
|
|
161
168
|
const baseSchema = refOrPrimitive(e.tsType);
|
|
@@ -258,6 +265,7 @@ export function generateSchemas(compiled, opts) {
|
|
|
258
265
|
const schemas = {};
|
|
259
266
|
const typeNames = new Set(compiled.types.map(t => t.name));
|
|
260
267
|
const aliasNames = new Set(compiled.aliases.map(a => a.name));
|
|
268
|
+
const attributesKey = wildcardAttributeBagName(compiled.options);
|
|
261
269
|
// Build alias schemas first so complex types can reference them
|
|
262
270
|
for (const a of compiled.aliases) {
|
|
263
271
|
schemas[a.name] = buildAliasSchema(a);
|
|
@@ -266,7 +274,7 @@ export function generateSchemas(compiled, opts) {
|
|
|
266
274
|
if (isSyntheticAliasSelfWrapper(t, aliasNames)) {
|
|
267
275
|
continue;
|
|
268
276
|
}
|
|
269
|
-
schemas[t.name] = buildComplexSchema(t, closed, typeNames, aliasNames, flattenWrappers, compiled.options.choice === "union");
|
|
277
|
+
schemas[t.name] = buildComplexSchema(t, closed, typeNames, aliasNames, flattenWrappers, compiled.options.choice === "union", attributesKey);
|
|
270
278
|
}
|
|
271
279
|
if (opts.pruneUnusedSchemas) {
|
|
272
280
|
// Root references: operation type names when available, falling back to element local names.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { buildSecurity, loadSecurityConfigFile as loadSecurityConfig,
|
|
1
|
+
export { buildSecurity, loadSecurityConfigFile as loadSecurityConfig, } from "../util/securityConfig.js";
|
|
2
2
|
//# sourceMappingURL=security.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/openapi/security.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,sBAAsB,IAAI,kBAAkB,
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/openapi/security.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,sBAAsB,IAAI,kBAAkB,GAC7C,MAAM,2BAA2B,CAAC"}
|
package/dist/openapi/security.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { buildSecurity, loadSecurityConfigFile as loadSecurityConfig,
|
|
1
|
+
export { buildSecurity, loadSecurityConfigFile as loadSecurityConfig, } from "../util/securityConfig.js";
|
package/dist/test/mockData.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface MockDataOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
export interface CatalogForMocks {
|
|
11
11
|
options?: {
|
|
12
|
+
attributesKey?: string;
|
|
12
13
|
choice?: "all-optional" | "union";
|
|
13
14
|
};
|
|
14
15
|
meta?: {
|
|
@@ -41,6 +42,10 @@ export interface CatalogForMocks {
|
|
|
41
42
|
name: string;
|
|
42
43
|
max: number | "unbounded";
|
|
43
44
|
}>;
|
|
45
|
+
attributeWildcards?: Array<{
|
|
46
|
+
namespace?: string;
|
|
47
|
+
processContents?: "lax" | "strict" | "skip";
|
|
48
|
+
}>;
|
|
44
49
|
choiceGroups?: Array<{
|
|
45
50
|
name: string;
|
|
46
51
|
min: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockData.d.ts","sourceRoot":"","sources":["../../src/test/mockData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockData.d.ts","sourceRoot":"","sources":["../../src/test/mockData.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE;QACR,aAAa,CAAC,EAAE,MAAM,CAAC;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Ae,EACxB,IAAI,CAAC,EAAE,uBAAuB,GAC7B,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,CA+BtD"}
|
package/dist/test/mockData.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* Pure logic — no I/O or side effects.
|
|
9
9
|
*/
|
|
10
10
|
import { detectArrayWrappers, flattenMockPayload } from "../util/catalogMeta.js";
|
|
11
|
+
import { hasAttributeWildcards, wildcardAttributeBagName } from "../util/attributeWildcards.js";
|
|
11
12
|
/**
|
|
12
13
|
* Generates a mock primitive value based on the TypeScript type and property name.
|
|
13
14
|
* Uses contextual defaults based on common property names.
|
|
@@ -93,14 +94,15 @@ export function generateMockData(typeName, catalog, opts, visited, depth) {
|
|
|
93
94
|
}
|
|
94
95
|
const childTypes = catalog.meta?.childType?.[typeName];
|
|
95
96
|
const attrTypes = catalog.meta?.attrType?.[typeName];
|
|
96
|
-
|
|
97
|
+
const typeMeta = catalog.types?.find((t) => t.name === typeName);
|
|
98
|
+
const hasWildcardAttributes = hasAttributeWildcards(typeMeta);
|
|
99
|
+
if ((!childTypes || Object.keys(childTypes).length === 0) && !attrTypes && !hasWildcardAttributes) {
|
|
97
100
|
return {};
|
|
98
101
|
}
|
|
99
102
|
const propMeta = catalog.meta?.propMeta?.[typeName] ?? {};
|
|
100
103
|
const newVisited = new Set(currentVisited);
|
|
101
104
|
newVisited.add(typeName);
|
|
102
105
|
const result = {};
|
|
103
|
-
const typeMeta = catalog.types?.find((t) => t.name === typeName);
|
|
104
106
|
const choiceGroups = catalog.options?.choice === "union" ? (typeMeta?.choiceGroups ?? []) : [];
|
|
105
107
|
const choiceBranchNames = new Set(choiceGroups.flatMap((group) => group.branches.map((branch) => branch.name)));
|
|
106
108
|
const selectedChoiceBranchNames = new Set(choiceGroups
|
|
@@ -143,6 +145,14 @@ export function generateMockData(typeName, catalog, opts, visited, depth) {
|
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
147
|
}
|
|
148
|
+
if (hasWildcardAttributes) {
|
|
149
|
+
const attributesKey = wildcardAttributeBagName(catalog.options);
|
|
150
|
+
if (!(attributesKey in result)) {
|
|
151
|
+
result[attributesKey] = {
|
|
152
|
+
"extra:trace": "sample",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
146
156
|
return result;
|
|
147
157
|
}
|
|
148
158
|
function generateOperationPayload(typeName, catalog) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DEFAULT_ATTRIBUTE_BAG_KEY = "$attributes";
|
|
2
|
+
export interface AttributeWildcardCarrier {
|
|
3
|
+
attributeWildcards?: readonly unknown[];
|
|
4
|
+
}
|
|
5
|
+
export interface AttributeWildcardOptions {
|
|
6
|
+
attributesKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function hasAttributeWildcards(value: AttributeWildcardCarrier | undefined): boolean;
|
|
9
|
+
export declare function wildcardAttributeBagName(options: AttributeWildcardOptions | undefined): string;
|
|
10
|
+
export declare function wildcardAttributeBagSchema(): {
|
|
11
|
+
type: "object";
|
|
12
|
+
additionalProperties: {
|
|
13
|
+
type: "string";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=attributeWildcards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributeWildcards.d.ts","sourceRoot":"","sources":["../../src/util/attributeWildcards.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,wBAAwB,GAAG,SAAS,GAAG,OAAO,CAE1F;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,SAAS,GAAG,MAAM,CAG9F;AAED,wBAAgB,0BAA0B,IAAI;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,oBAAoB,EAAE;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAC,CAAA;CAAC,CAKrG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const DEFAULT_ATTRIBUTE_BAG_KEY = "$attributes";
|
|
2
|
+
export function hasAttributeWildcards(value) {
|
|
3
|
+
return Array.isArray(value?.attributeWildcards) && value.attributeWildcards.length > 0;
|
|
4
|
+
}
|
|
5
|
+
export function wildcardAttributeBagName(options) {
|
|
6
|
+
const configured = options?.attributesKey?.trim();
|
|
7
|
+
return configured && configured.length > 0 ? configured : DEFAULT_ATTRIBUTE_BAG_KEY;
|
|
8
|
+
}
|
|
9
|
+
export function wildcardAttributeBagSchema() {
|
|
10
|
+
return {
|
|
11
|
+
type: "object",
|
|
12
|
+
additionalProperties: { type: "string" },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -65,7 +65,7 @@ File names state the exact purpose and content of the artifact. They should rema
|
|
|
65
65
|
- Use lowercase kebab-case.
|
|
66
66
|
- Use general-to-specific segment order.
|
|
67
67
|
- Put the broad feature classifier first.
|
|
68
|
-
- Put variable-like qualifiers
|
|
68
|
+
- Put variable-like qualifiers on the right side.
|
|
69
69
|
- Keep recognized standards terms when they identify the feature.
|
|
70
70
|
- Avoid filler words such as `service`, `sample`, `fixture`, and `test`.
|
|
71
71
|
- Use the file extension to identify format, not the basename.
|
package/docs/releases/README.md
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# TypeScript WSDL Client v0.36.0
|
|
2
|
+
|
|
3
|
+
## Wildcard Attribute Contracts
|
|
4
|
+
|
|
5
|
+
This release promotes `xs:anyAttribute` from metadata-only partial support to generated contract support.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Generated TypeScript, OpenAPI, gateway, app, and generated-test artifacts now represent wildcard XML attributes through a configured attribute bag. Known XML attributes still remain flattened as peer properties, while unknown wildcard attributes stay in the bag to avoid collisions with child elements or known attributes.
|
|
10
|
+
|
|
11
|
+
## Highlights
|
|
12
|
+
|
|
13
|
+
- `xs:anyAttribute` emits an optional attribute bag named by the configured attributes key, defaulting to `$attributes`.
|
|
14
|
+
- OpenAPI schemas describe wildcard attribute bags as objects with string values.
|
|
15
|
+
- Generated gateway and generated-test evidence now exercise the modeled wildcard attribute bag.
|
|
16
|
+
- GitHub push and PR CI now runs faster hosted checks while local release preflight remains the full release gate.
|
|
17
|
+
- Roadmap and support documentation now reflect the `0.35.0` baseline and the `xs:anyAttribute` pre-1.0 slice.
|
|
18
|
+
|
|
19
|
+
## Upgrade Notes
|
|
20
|
+
|
|
21
|
+
No special upgrade steps.
|
|
22
|
+
|
|
23
|
+
## Validation
|
|
24
|
+
|
|
25
|
+
- CI passed.
|
|
26
|
+
- NPM package contents were validated.
|
|
27
|
+
- Agent skill artifact was validated and packaged.
|
|
28
|
+
- Release preflight passed against the target tag.
|
|
29
|
+
|
|
30
|
+
## Notes
|
|
31
|
+
|
|
32
|
+
Release tag: `v0.36.0`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# TypeScript WSDL Client v0.37.0
|
|
2
|
+
|
|
3
|
+
## Faster Release Publishing
|
|
4
|
+
|
|
5
|
+
This release keeps the full release gate before tagging and makes the post-release package workflow more focused.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Publishing from an already validated release tag no longer reruns the full CI, conformance, and smoke pipeline inside the package workflow. The workflow now performs the publish-specific checks needed before npm and GitHub Packages publication: build, typecheck, agent skill validation, and package contents validation.
|
|
10
|
+
|
|
11
|
+
Release preflight now also verifies that the publish workflow stays targeted. This keeps the release safety boundary explicit: run full CI and conformance before pushing the tag, then run package-specific validation from the immutable tag before publishing.
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Adds `npm run release:publish-check` for targeted post-release package validation.
|
|
16
|
+
- Updates the package publishing workflow to use the targeted publish check.
|
|
17
|
+
- Adds release preflight coverage for the publish workflow gate.
|
|
18
|
+
- Updates the 1.0 roadmap to reflect the `0.36.0` wildcard-bag baseline.
|
|
19
|
+
|
|
20
|
+
## Upgrade Notes
|
|
21
|
+
|
|
22
|
+
No special upgrade steps.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
|
|
26
|
+
- CI passed.
|
|
27
|
+
- NPM package contents were validated.
|
|
28
|
+
- Agent skill artifact was validated and packaged.
|
|
29
|
+
- Release preflight passed against the target tag.
|
|
30
|
+
|
|
31
|
+
## Notes
|
|
32
|
+
|
|
33
|
+
Release tag: `v0.37.0`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# TypeScript WSDL Client v0.38.0
|
|
2
|
+
|
|
3
|
+
## Dependency Floor Refresh
|
|
4
|
+
|
|
5
|
+
This release refreshes maintained dependency floors after the merged dependency updates and keeps generated app scaffolds aligned with the package baseline.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Developers get current dependency minimums in both the published package and newly scaffolded Fastify gateway apps. The runtime YAML dependency moves to the latest `js-yaml` patch in the current line, while the development and scaffold stack pick up the maintained Fastify, Node type, and `tsx` releases.
|
|
10
|
+
|
|
11
|
+
The 1.0 roadmap remains focused on release-candidate gates. This release does not change generated SOAP, OpenAPI, or gateway behavior.
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Updates `js-yaml` to `5.2.1`.
|
|
16
|
+
- Updates `fastify` to `5.9.0`.
|
|
17
|
+
- Updates `@types/node` to `26.1.0`.
|
|
18
|
+
- Updates `tsx` to `4.23.0`.
|
|
19
|
+
- Updates generated app scaffold pins for matching dependency floors.
|
|
20
|
+
- Aligns roadmap documentation with the `0.38.0` release state.
|
|
21
|
+
|
|
22
|
+
## Upgrade Notes
|
|
23
|
+
|
|
24
|
+
No special upgrade steps.
|
|
25
|
+
|
|
26
|
+
## Validation
|
|
27
|
+
|
|
28
|
+
- CI passed.
|
|
29
|
+
- NPM package contents were validated.
|
|
30
|
+
- Agent skill artifact was validated and packaged.
|
|
31
|
+
- Release preflight passed against the target tag.
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
|
|
35
|
+
Release tag: `v0.38.0`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# TypeScript WSDL Client v0.39.0
|
|
2
|
+
|
|
3
|
+
## IDE And Generated Output Hygiene
|
|
4
|
+
|
|
5
|
+
This release tightens the repository's TypeScript ownership model for tests, generated examples, and release scripts while keeping generated client and gateway behavior stable.
|
|
6
|
+
|
|
7
|
+
## What This Improves
|
|
8
|
+
|
|
9
|
+
Developers working in strict NodeNext IDEs get diagnostics that line up with the repository's actual test boundaries. Scoped TypeScript configs now own conformance tests, unit tests that import scripts, and generated example output without broadening the production `src` configuration.
|
|
10
|
+
|
|
11
|
+
Generated Fastify gateway runtime metadata is emitted with less duplicated source while preserving the same response envelope behavior. Release scripts also share file helpers so future packaging and validation changes have fewer duplicated paths to maintain.
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Adds scoped TypeScript ownership for tests and generated examples.
|
|
16
|
+
- Deduplicates generated gateway runtime metadata literals.
|
|
17
|
+
- Keeps gateway runtime response behavior stable.
|
|
18
|
+
- Refactors agent skill build and validation scripts around shared file helpers.
|
|
19
|
+
- Documents intentional IDE suppressions where local inspections disagree with verified runtime behavior.
|
|
20
|
+
- Polishes Markdown and consumer guidance wording.
|
|
21
|
+
|
|
22
|
+
## Upgrade Notes
|
|
23
|
+
|
|
24
|
+
No special upgrade steps.
|
|
25
|
+
|
|
26
|
+
## Validation
|
|
27
|
+
|
|
28
|
+
- CI passed.
|
|
29
|
+
- NPM package contents were validated.
|
|
30
|
+
- Agent skill artifact was validated and packaged.
|
|
31
|
+
- Release preflight passed against the target tag.
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
|
|
35
|
+
Release tag: `v0.39.0`.
|
package/docs/roadmap/README.md
CHANGED
|
@@ -8,7 +8,7 @@ See the root [README.md](../../README.md) for project overview and the root [ROA
|
|
|
8
8
|
|
|
9
9
|
This plan turns the 1.0 roadmap into implementation slices that can be picked up independently. Each slice has its own plan document with scope, testing strategy, acceptance gates, and release implications.
|
|
10
10
|
|
|
11
|
-
The plan is optimized for preserving quality. The contract and compatibility baselines now exist, choice union mode is shipped, JSON array streaming is shipped,
|
|
11
|
+
The plan is optimized for preserving quality. The contract and compatibility baselines now exist, choice union mode is shipped, JSON array streaming is shipped, `xs:anyAttribute` wildcard bags are shipped, the conformance framework is wired into validation gates, and IDE-owned TypeScript diagnostics were aligned with the scoped test layout in `0.39.0`. The remaining readiness work is to review the explicit partial, diagnostic, and unsupported capability decisions, then run the final release candidate gate pass.
|
|
12
12
|
|
|
13
13
|
## Route Summary
|
|
14
14
|
|
|
@@ -19,7 +19,8 @@ The plan is optimized for preserving quality. The contract and compatibility bas
|
|
|
19
19
|
| Choice union mode | [Choice Union Mode](v1.0-choice-union-mode.md) | complete | Implemented in `0.26.0` |
|
|
20
20
|
| JSON array streaming | [JSON Array Streaming](v1.0-json-array-streaming.md) | complete | Implemented in `0.28.0` |
|
|
21
21
|
| Conformance framework | [Capability Conformance Framework](v1.0-capability-conformance-framework.md) | gate wired | Pipeline claims are test-backed |
|
|
22
|
-
| WSDL coverage matrix | [WSDL Coverage Matrix](v1.0-wsdl-coverage-matrix.md) | baseline
|
|
22
|
+
| WSDL coverage matrix | [WSDL Coverage Matrix](v1.0-wsdl-coverage-matrix.md) | baseline complete | Public support is test-backed |
|
|
23
|
+
| `xs:anyAttribute` bag | [`xs:anyAttribute` Wildcard Bag](v1.0-xs-anyattribute-wildcard-bag.md) | complete | Implemented in `0.36.0` |
|
|
23
24
|
| Release candidate | [Release Candidate Gates](v1.0-release-candidate-gates.md) | next | 1.0 release is repeatable |
|
|
24
25
|
|
|
25
26
|
## Execution Order
|
|
@@ -46,16 +47,20 @@ The registry, fixture strategy, compile runner, client evidence, OpenAPI evidenc
|
|
|
46
47
|
|
|
47
48
|
### Slice 6: WSDL Coverage Matrix
|
|
48
49
|
|
|
49
|
-
The WSDL matrix rows now exist as conformance registry entries with compile, client, OpenAPI, gateway runtime, generated-test, app, documentation, and release-gate evidence. The next work is to keep those rows current
|
|
50
|
+
The WSDL matrix rows now exist as conformance registry entries with compile, client, OpenAPI, gateway runtime, generated-test, app, documentation, and release-gate evidence. The next work is to keep those rows current, confirm the remaining partial and terminal rows are accepted 1.0 decisions, and prepare release candidate gates.
|
|
50
51
|
|
|
51
|
-
### Slice 7:
|
|
52
|
+
### Slice 7: xs:anyAttribute Wildcard Bag
|
|
53
|
+
|
|
54
|
+
The [`xs:anyAttribute` wildcard bag plan](v1.0-xs-anyattribute-wildcard-bag.md) shipped in `0.36.0`. It promoted the previous metadata-only partial row to supported by emitting a configured wildcard attribute bag through TypeScript, OpenAPI, gateway, generated-test, app, and documentation evidence.
|
|
55
|
+
|
|
56
|
+
### Slice 8: Release Candidate Gates
|
|
52
57
|
|
|
53
58
|
Run the release candidate gates after feature work and documentation have converged. This slice validates docs, tests, generated examples, package contents, skill artifact, release notes, and provenance workflow readiness.
|
|
54
59
|
|
|
55
60
|
## Remaining Before 1.0
|
|
56
61
|
|
|
57
|
-
-
|
|
58
|
-
- Confirm `docs/supported-patterns.md` matches the matrix.
|
|
62
|
+
- Confirm each remaining partial, diagnostic, and unsupported matrix row is an accepted 1.0 decision.
|
|
63
|
+
- Confirm `docs/supported-patterns.md` still matches the generated matrix.
|
|
59
64
|
- Run the release-candidate gates.
|
|
60
65
|
|
|
61
66
|
## Quality Principles
|
|
@@ -318,7 +318,7 @@ Start with these capability IDs:
|
|
|
318
318
|
| `multi-binding-first-soap` | partial | success with documented behavior |
|
|
319
319
|
| `external-policy-reference` | partial | success with documented limitation |
|
|
320
320
|
| `deep-composition-sequence` | supported | success |
|
|
321
|
-
| `xs-anyattribute` |
|
|
321
|
+
| `xs-anyattribute` | supported | success with wildcard attribute bag evidence |
|
|
322
322
|
| `mtom-xop-attachment` | unsupported | error or research |
|
|
323
323
|
|
|
324
324
|
Acceptance criteria:
|
|
@@ -481,7 +481,7 @@ Every row with a `gateway` expectation should at least prove plugin import and r
|
|
|
481
481
|
|
|
482
482
|
For supported rows, prefer one accepted request with a SOAP-wrapper-shaped mock response and an assertion on the generated success envelope. Add one rejected request only when the generated OpenAPI schema can express a meaningful invalid payload for that capability.
|
|
483
483
|
|
|
484
|
-
For partial rows, prove the documented subset and avoid implying full support.
|
|
484
|
+
For partial rows, prove the documented subset and avoid implying full support. External `PolicyReference` should not imply fetched or enforced external policy. The `xs-anyattribute` row is supported once generated TypeScript, OpenAPI, gateway, generated-test, and app evidence prove the configured wildcard attribute bag.
|
|
485
485
|
|
|
486
486
|
For multi-binding rows, assert that the gateway route calls the operation selected by the deterministic first SOAP binding behavior. Do not implement explicit binding selection in this slice.
|
|
487
487
|
|