Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Add support to RequestSchema to createAppTester #632

Open
ferenckv opened this issue Mar 14, 2023 · 1 comment
Open

Comments

@ferenckv
Copy link

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: "[email protected]" } },
  },
  inputFields: [],
  outputFields: [
    {
      key: "email",
      label: "Client email",
      type: SupportedFieldTypes.string,
    },
  ] as const,
  sample: {
    email: "[email protected]",
  },
}

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: "[email protected]",
  },
}

Desired Behavior / Feature Request

createAppTester should support RequestSchema too.

@rnegron
Copy link
Member

rnegron commented Mar 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants