Linden Crandall 5075f5c5d8
Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
commit upstream files
2025-02-06 04:14:18 +09:00

73 lines
1.2 KiB
JavaScript

import { faker } from '@faker-js/faker';
export const createArgument = (params = {}) => {
const labelAndKey = faker.lorem.word();
const argument = {
label: labelAndKey,
key: labelAndKey,
required: false,
variables: true,
...params,
};
return argument;
};
export const createStringArgument = (params = {}) => {
const stringArgument = createArgument({
...params,
type: 'string',
});
return stringArgument;
};
export const createDropdownArgument = (params = {}) => {
const dropdownArgument = createArgument({
options: [
{
label: 'Yes',
value: true,
},
{
label: 'No',
value: false,
},
],
...params,
type: 'dropdown',
});
return dropdownArgument;
};
export const createDynamicArgument = (params = {}) => {
const dynamicArgument = createArgument({
value: [
{
key: '',
value: '',
},
],
fields: [
{
label: 'Key',
key: 'key',
required: true,
variables: true,
},
{
label: 'Value',
key: 'value',
required: true,
variables: true,
}
],
...params,
type: 'dynamic',
});
return dynamicArgument;
};