integrations: adjusts in payloads

This commit is contained in:
Davidson Gomes
2024-06-07 19:16:51 -03:00
parent 2cb6bdb38b
commit cbb5d1d048
14 changed files with 305 additions and 129 deletions

View File

@@ -1,7 +1,24 @@
import { JSONSchema7 } from 'json-schema';
import { v4 } from 'uuid';
import { isNotEmpty } from './validate.schema';
const isNotEmpty = (...propertyNames: string[]): JSONSchema7 => {
const properties = {};
propertyNames.forEach(
(property) =>
(properties[property] = {
minLength: 1,
description: `The "${property}" cannot be empty`,
}),
);
return {
if: {
propertyNames: {
enum: [...propertyNames],
},
},
then: { properties },
};
};
export const proxySchema: JSONSchema7 = {
$id: v4(),