prehistoric-account-60014
08/12/2020, 6:57 PMInvalid Stripe API version: [object Object]
. This is due a serialization issue. Here’s a snippet with the dynamic provider’s source. Any ideas how to avoid this?hundreds-musician-51496
08/12/2020, 7:13 PMnew Stripe
doesn't call JSON.stringify on the apiVersion argument you passed, or it expects a string. [object Object]
tells me something is converting { apiVersion: '...' }
to a string directly.prehistoric-account-60014
08/12/2020, 7:30 PMconst webhookEndpoint = await stripe.webhookEndpoints.create(inputs, {
apiVersion: '2020-03-02',
})
Then it just changes the error to this:
Stripe: Unknown arguments ([object Object]). Did you mean to pass an options object? See <https://github.com/stripe/stripe-node/wiki/Passing-Options>. (on API request to POST `/webhook_endpoints`)
white-balloon-205
08/13/2020, 4:40 AMconsole.log
to see the value of the params?prehistoric-account-60014
08/13/2020, 4:02 PMinputs
shows when printed to the console:Stripe: Unknown arguments ([object Object]). Did you mean to pass an options object? See <https://github.com/stripe/stripe-node/wiki/Passing-Options>. (on API request to POST `/webhook_endpoints`)
{ apiVersion: '2020-03-02', apiKey }
) is the options object. It’s as if Pulumi is calling toString
on this object and passing that to Stripe instead. Stripe does expect an object here.@pulumi/pulumi
cause this? I just updated Pulumi itself to the latest version but @pulumi/pulumi
is still at 2.5.0
inputs
logs now with this slimmed down provider.Received unknown parameter: __provider
(no stack)Received unknown parameter: __provider
.async create({
__provider,
...inputs
}: Stripe.WebhookEndpointCreateParams & { __provider: unknown }): Promise<CreateResult> {
const stripe = new Stripe(apiKey, { apiVersion: '2020-03-02' })
const webhookEndpoint = await stripe.webhookEndpoints.create(inputs)
return { id: webhookEndpoint.id, outs: webhookEndpoint }
},
__provider
field.white-balloon-205
08/13/2020, 5:32 PM__provider
part makes sense - we should document that that will always be included in the inputs bag.prehistoric-account-60014
08/13/2020, 5:32 PMomitProvider
helper and it’s all working great now! 🙂undefined
in the constructor.undefined
makes Pulumi show the preview as output<string>
is there a way to give a hint for the type of these outputs?white-balloon-205
08/14/2020, 12:11 AMThe only rough edge I’m seeing is having the declare all the output arguments asAgreed - this is an unintuitive part of the API design - and I expect is something we could improve. Would you mind opening an issue to track this suggestion?in the constructor.undefined
setting all toNot sure I follow this one - could you give an example of this?makes Pulumi show the preview asundefined
is there a way to give a hint for the type of these outputs?output<string>
prehistoric-account-60014
08/14/2020, 1:50 AMlivemode
field is a boolean, but because I set it to undefined
in the call to super
, when running pulumi up
, the preview shows an object with output<string>
for all the values. I was wondering if there was some way to make it say output<boolean>
or output<number>
depending on what the field type ispulumi up
, the preview shows all existing values as changing to output<string>
in the preview. I would’ve expected that having those fields in the stables
return of the diff
provider function to be enough for Pulumi to know that those fields won’t change on subsequent updates. Here’s a screenshot. In this update, all that should be changing is metadata
and enabled_events
, but because the other fields aren’t part of the resource arguments (they’re just outputs from the API), then Pulumi shows them as => output<string>
. All these fields are returned in the stables
array in diff
.