mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
* First version of Zapier Generator * fixed zapier codegen * added zapier templates * added zapier sample * added zapier doc * added zapier generator form data management * added samples generation * updated docs * fixed zapier api template * fixed zapier samples export * added zapier readme template * fixed zapier readme template * added petstore readme * cleaned zapier generator * updated samples * fixed zapier enum label * cleaned code * updated samples * improved zapier search actions * updated samples --------- Co-authored-by: Mauro Valota <maurovalota@fattureincloud.it> Co-authored-by: William Cheng <wing328hk@gmail.com>
63 lines
2.1 KiB
JavaScript
63 lines
2.1 KiB
JavaScript
const utils = require('../utils/utils');
|
|
|
|
module.exports = {
|
|
fields: (prefix = '', isInput = true, isArrayChild = false) => {
|
|
const {keyPrefix, labelPrefix} = utils.buildKeyAndLabel(prefix, isInput, isArrayChild)
|
|
return [
|
|
{
|
|
key: `${keyPrefix}id`,
|
|
label: `[${labelPrefix}id]`,
|
|
type: 'number',
|
|
},
|
|
{
|
|
key: `${keyPrefix}username`,
|
|
label: `[${labelPrefix}username]`,
|
|
type: 'string',
|
|
},
|
|
{
|
|
key: `${keyPrefix}firstName`,
|
|
label: `[${labelPrefix}firstName]`,
|
|
type: 'string',
|
|
},
|
|
{
|
|
key: `${keyPrefix}lastName`,
|
|
label: `[${labelPrefix}lastName]`,
|
|
type: 'string',
|
|
},
|
|
{
|
|
key: `${keyPrefix}email`,
|
|
label: `[${labelPrefix}email]`,
|
|
type: 'string',
|
|
},
|
|
{
|
|
key: `${keyPrefix}password`,
|
|
label: `[${labelPrefix}password]`,
|
|
type: 'string',
|
|
},
|
|
{
|
|
key: `${keyPrefix}phone`,
|
|
label: `[${labelPrefix}phone]`,
|
|
type: 'string',
|
|
},
|
|
{
|
|
key: `${keyPrefix}userStatus`,
|
|
label: `User Status - [${labelPrefix}userStatus]`,
|
|
type: 'integer',
|
|
},
|
|
]
|
|
},
|
|
mapping: (bundle, prefix = '') => {
|
|
const {keyPrefix} = utils.buildKeyAndLabel(prefix)
|
|
return {
|
|
'id': bundle.inputData?.[`${keyPrefix}id`],
|
|
'username': bundle.inputData?.[`${keyPrefix}username`],
|
|
'firstName': bundle.inputData?.[`${keyPrefix}firstName`],
|
|
'lastName': bundle.inputData?.[`${keyPrefix}lastName`],
|
|
'email': bundle.inputData?.[`${keyPrefix}email`],
|
|
'password': bundle.inputData?.[`${keyPrefix}password`],
|
|
'phone': bundle.inputData?.[`${keyPrefix}phone`],
|
|
'userStatus': bundle.inputData?.[`${keyPrefix}userStatus`],
|
|
}
|
|
},
|
|
}
|