persona-community-5/.pnpm-store/v3/files/1e/9b54e369eade2c75a1985c6afbb9add4c7bf6624a21c354353181f58b540cc9d824e8fb652e54eac391954ba2f569956409bebb734f7859b390262a3b1363e
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

38 lines
1.5 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResponseContainsProperty = void 0;
const utils_1 = require("../../utils");
const ResponseContainsProperty = (options) => {
const names = options.names || {};
let key;
return {
Operation: {
Response: {
skip: (_response, key) => {
return `${key}` === '204';
},
enter: (_response, ctx) => {
key = ctx.key;
},
Schema(schema, { report, location }) {
if (schema.type !== 'object')
return;
const expectedProperties = names[key] ||
names[(0, utils_1.getMatchingStatusCodeRange)(key)] ||
names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] ||
[];
for (const expectedProperty of expectedProperties) {
if (!schema.properties?.[expectedProperty]) {
report({
message: `Response object must contain a top-level "${expectedProperty}" property.`,
location: location.child('properties').key(),
});
}
}
},
},
},
};
};
exports.ResponseContainsProperty = ResponseContainsProperty;