prismatic-io / spectral

Prismatic's typescript library for custom components
https://prismatic.io/docs/spectral/custom-component-library
35 stars 2 forks source link

Allow createConnection to contain tokens, so you can test OAuth connections #112

Closed taylorreece closed 1 year ago

taylorreece commented 1 year ago

Most connections contain all of their data in .fields. OAuth connections have additional data in .token. This allows you to create a connection with .token populated. For example,

const sfConnection = createConnection(
  salesforceOAuth,
  {},
  {
    instance_url: "https://example.my.salesforce.com",
    access_token: "abc-123",
  }
);