Skip to content

fix: support tiered actor pricing types#970

Open
AkhilTrivediX wants to merge 1 commit into
apify:masterfrom
AkhilTrivediX:agent/support-tiered-pricing-types
Open

fix: support tiered actor pricing types#970
AkhilTrivediX wants to merge 1 commit into
apify:masterfrom
AkhilTrivediX:agent/support-tiered-pricing-types

Conversation

@AkhilTrivediX

Copy link
Copy Markdown

Summary

  • add typed tier entries for pay-per-event and per-dataset-item Actor pricing
  • make flat price fields optional when the API returns tiered pricing instead
  • align required event and unit fields with the current API shape
  • cover a tiered-only pricing response with a focused regression test

Why

Tiered pricing responses do not include a flat price. The previous types required those absent fields and did not expose the tier maps, which made valid API responses difficult to model safely.

Closes #927

Validation

  • corepack pnpm build:node
  • corepack pnpm vitest run test/pricing_types.test.ts
  • corepack pnpm lint
  • corepack pnpm exec oxfmt --check src/resource_clients/actor.ts test/pricing_types.test.ts
  • git diff --check

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @AkhilTrivediX , the changes look fine to me (looking at the API spec). Some of the optional -> required type changes could potentially be breaking, but these are required in the spec as well (so the changes are imo rather fixes).

The questions below are rather for other reviewers. Cheers!

cc @michael-apify could you please take a look from the billing POV?

Comment on lines +9 to +11
eventTieredPricingUsd: {
STARTER: { tieredEventPriceUsd: 0.01 },
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the tiered pricing, do we need all the tiers (STARTER, SILVER...) to be populated, or can we have a partial response like this?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pricing types are stale: missing tiered pay-per-event and tiered pay-per-result, plus a wrong required flag

4 participants