sparse-intern-71089
08/12/2020, 6:57 PMhundreds-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`)
prehistoric-account-60014
08/12/2020, 7:54 PMprehistoric-account-60014
08/12/2020, 9:15 PMwhite-balloon-205
console.log
to see the value of the params?prehistoric-account-60014
08/13/2020, 4:02 PMinputs
shows when printed to the console:prehistoric-account-60014
08/13/2020, 4:05 PMStripe: 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`)
prehistoric-account-60014
08/13/2020, 4:07 PM{ 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.prehistoric-account-60014
08/13/2020, 4:11 PM@pulumi/pulumi
cause this? I just updated Pulumi itself to the latest version but @pulumi/pulumi
is still at 2.5.0
prehistoric-account-60014
08/13/2020, 4:13 PMinputs
logs now with this slimmed down provider.prehistoric-account-60014
08/13/2020, 4:16 PMReceived unknown parameter: __provider
(no stack)prehistoric-account-60014
08/13/2020, 4:25 PMReceived unknown parameter: __provider
.prehistoric-account-60014
08/13/2020, 4:26 PMprehistoric-account-60014
08/13/2020, 4:26 PMasync 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 }
},
prehistoric-account-60014
08/13/2020, 4:27 PM__provider
field.white-balloon-205
__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 PMprehistoric-account-60014
08/13/2020, 5:32 PMomitProvider
helper and it’s all working great now! 🙂prehistoric-account-60014
08/13/2020, 5:35 PMprehistoric-account-60014
08/13/2020, 5:35 PMprehistoric-account-60014
08/13/2020, 9:57 PMprehistoric-account-60014
08/13/2020, 9:58 PMundefined
in the constructor.prehistoric-account-60014
08/13/2020, 9:58 PMprehistoric-account-60014
08/13/2020, 11:08 PMundefined
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
The 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 isprehistoric-account-60014
08/14/2020, 1:50 AMprehistoric-account-60014
08/14/2020, 1:57 AMprehistoric-account-60014
08/14/2020, 2:08 AMpulumi 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
.prehistoric-account-60014
08/14/2020, 2:08 AM