punchout-simulator 0.5.0 → 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/server/cli.js +4 -2
- package/package.json +1 -1
package/dist/server/cli.js
CHANGED
|
@@ -1650,7 +1650,7 @@ function credKnown(c, exp) {
|
|
|
1650
1650
|
if (!c) return false;
|
|
1651
1651
|
return [exp.from, exp.to, exp.sender].some((k) => credEq(c, k));
|
|
1652
1652
|
}
|
|
1653
|
-
function checkGeneral(doc, ctx, issues) {
|
|
1653
|
+
function checkGeneral(doc, ctx, issues, docType) {
|
|
1654
1654
|
const payloadId = getPayloadId(doc);
|
|
1655
1655
|
if (!payloadId) {
|
|
1656
1656
|
issues.error("missing-payloadID", "cXML/@payloadID is missing", "cXML/@payloadID");
|
|
@@ -1665,6 +1665,8 @@ function checkGeneral(doc, ctx, issues) {
|
|
|
1665
1665
|
issues.error("missing-timestamp", "cXML/@timestamp is missing", "cXML/@timestamp");
|
|
1666
1666
|
}
|
|
1667
1667
|
if (!ctx.expected) return;
|
|
1668
|
+
const carriesHeader = docType === "SetupRequest" || docType === "OrderRequest" || docType === "PunchOutOrderMessage";
|
|
1669
|
+
if (!carriesHeader) return;
|
|
1668
1670
|
const exp = ctx.expected;
|
|
1669
1671
|
const creds = getHeaderCredentials(doc);
|
|
1670
1672
|
for (const [name, c] of [
|
|
@@ -1967,7 +1969,7 @@ function validateDocument(raw, ctx = {}) {
|
|
|
1967
1969
|
return { docType: "Unknown", wellFormed: false, ok: false, issues: issues.list };
|
|
1968
1970
|
}
|
|
1969
1971
|
const docType = ctx.forceDocType ?? getDocType(doc);
|
|
1970
|
-
checkGeneral(doc, ctx, issues);
|
|
1972
|
+
checkGeneral(doc, ctx, issues, docType);
|
|
1971
1973
|
switch (docType) {
|
|
1972
1974
|
case "SetupRequest":
|
|
1973
1975
|
checkSharedSecret(doc, ctx, issues);
|
package/package.json
CHANGED