fix: support tiered actor pricing types - #970
Open
AkhilTrivediX wants to merge 1 commit into
Open
Conversation
barjin
reviewed
Jul 20, 2026
barjin
left a comment
Member
There was a problem hiding this comment.
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 }, | ||
| }, |
Member
There was a problem hiding this comment.
With the tiered pricing, do we need all the tiers (STARTER, SILVER...) to be populated, or can we have a partial response like this?
vdusek
added a commit
that referenced
this pull request
Aug 3, 2026
The pricing union transfers wholesale. The spec models it as a `oneOf` with a `pricingModel` discriminator and an OpenAPI 3.1 `const` per variant, so `openapi-typescript` emits literal types and the published union keeps narrowing exactly as before -- no override needed. That also brings tiered pricing in: `PricePerDatasetItemActorPricingInfo.tieredPricing` and `ActorChargeEvent.eventTieredPricingUsd`, which overlaps what #970 adds by hand against master. `ActorDefinition.output` is the one field of the definition the spec still omits, so it is the whole of ActorDefinitionSpecGaps. Its `readme`, `input` and `changelog` keep the `| null` the spec drops -- they are paths into the Actor's source tree and the API reports `null` for a file that is absent, which is what the hand-written definition already recorded. `Actor.versions` is excluded from the width guard on purpose. It re-points at the discriminated `ActorVersion` union, which is deliberately narrower than the spec's flat `Version`, so the one-directional assignability rule does not apply to it. BREAKING CHANGE: Actor, ActorStats, ActorStandby, ActorDefaultRunOptions, ActorExampleRunInput, ActorTaggedBuild, ActorTaggedBuilds, ActorDefinition, ActorChargeEvent, ActorCollectionListItem and the four pricing-info shapes now follow the spec's nullability and optionality. Actor.actorStandby loses the `& { isEnabled: boolean }` intersection and gains `| null`; Actor.deploymentKey and actorPermissionLevel become optional; Actor.description, title, seoTitle, seoDescription, isDeprecated, exampleRunInput and taggedBuilds gain `| null`; every field of ActorStats becomes optional; every field of ActorDefaultRunOptions becomes optional; ActorExampleRunInput.body and contentType become optional; ActorTaggedBuilds values may be `null`; ActorDefinition.actorSpecification, name and version become optional; ActorChargeEvent.eventDescription becomes required while eventPriceUsd becomes optional; FlatPricePerMonthActorPricingInfo.trialMinutes and PricePerDatasetItemActorPricingInfo.unitName become required, while the latter's pricePerUnitUsd becomes optional. Newly exposed: Actor.pictureUrl, standbyUrl, notice, isCritical, isGeneric, isSourceCodeHidden and hasNoDataset; ActorStats.actorReviewCount, actorReviewRating, bookmarkCount and publicActorRunStats30Days; ActorDefaultRunOptions.maxItems and forcePermissionLevel; ActorDefinition.defaultMemoryMbytes; ActorTaggedBuild.buildNumberInt; ActorChargeEvent.isPrimaryEvent and isOneTimeEvent; ActorCollectionListItem.title and stats; and the TieredPricingPerDatasetItem and TieredPricingPerEvent types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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:nodecorepack pnpm vitest run test/pricing_types.test.tscorepack pnpm lintcorepack pnpm exec oxfmt --check src/resource_clients/actor.ts test/pricing_types.test.tsgit diff --check