[Feature Request]: Add support to RequestSchema to createAppTester
ferenckv opened this issue · comments
Current Behavior
Currently, createAppTester
returns a function with this signature:
<T, B extends Bundle>( func: (z: ZObject, bundle: B) => T | Promise<T>, bundle?: Partial<B> ) => Promise<T>
This works if I define a trigger or create as
{
key: "new_email",
noun: "Email",
display: {
label: "New email created",
description: "A new email was created.",
},
operation: {
type: "polling",
perform: (zObject, bundle) => { return { email: "john@doe.com" } },
},
inputFields: [],
outputFields: [
{
key: "email",
label: "Client email",
type: SupportedFieldTypes.string,
},
] as const,
sample: {
email: "john@doe.com",
},
}
But it does not work if I define the trigger as
{
key: "new_email",
noun: "Email",
display: {
label: "New email created",
description: "A new email was created.",
},
operation: {
type: "polling",
perform: : {
method: "GET",
url: `http://my-api.com/email/created`,
},
},
inputFields: [],
outputFields: [
{
key: "email",
label: "Client email",
type: SupportedFieldTypes.string,
},
] as const,
sample: {
email: "john@doe.com",
},
}
Desired Behavior / Feature Request
createAppTester
should support RequestSchema
too.
Hello, thank you for taking the time to submit an issue! I have logged this feature request on our internal issue board as: PDE-3926. We'll post back here when we have an update to share.