Skip to content

Bump pricing4ts to ^0.11.1 so Pricing2Yaml 3.1 can be registered - #58

Merged
Alex-GF merged 2 commits into
isa-group:developfrom
javiercavlop:chore/pricing4ts-0.11
Jul 31, 2026
Merged

Bump pricing4ts to ^0.11.1 so Pricing2Yaml 3.1 can be registered#58
Alex-GF merged 2 commits into
isa-group:developfrom
javiercavlop:chore/pricing4ts-0.11

Conversation

@javiercavlop

@javiercavlop javiercavlop commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What this changes

api/package.json: pricing4ts ^0.10.3^0.11.1.

One line, plus the lockfile. No source file changes.

Why

0.10.3 stops one version short of the current specification:

// pricing4ts@0.10.3 – dist/server/utils/version-manager.js
exports.PRICING2YAML_VERSIONS = ["1.0", "1.1", "2.0", "2.1", "3.0"];

// pricing4ts@0.11.1
exports.PRICING2YAML_VERSIONS = ["1.0", "1.1", "2.0", "2.1", "3.0", "3.1"];

So a service registering a pricing written against Pricing2Yaml 3.1 is refused
by a running SPACE:

Unsupported version: 3.1. Please, visit the changelogs of Pricing2Yaml to check
the supported versions.

The only way to register anything today is to declare syntaxVersion: '3.0'
and stay a version behind — which is what our own pricing has been carrying,
with a comment explaining why.

Verification

The parser. Same document, same call, both versions:

pricing4ts 0.11.1 (this PR):  PARSED -> saas: openbinding | plans: FREE, PRO
pricing4ts 0.10.3 (on main):  REFUSED: Unsupported version: 3.1…

The build. pnpm run build (tsc) passes. SPACE imports
retrievePricingFromPath, retrievePricingFromText and the
Pricing/Plan/Feature/UsageLimit types; none of their signatures changed
between the two releases.

The tests, run per file against a local MongoDB and Redis:

file on main (0.10.3) with this PR (0.11.1)
service.test.ts 44 passed
contract.test.ts 1 failed, 76 passed 77 passed

So the bump also clears a test that fails on main today.

Correction to an earlier version of this description. I first wrote here
that the whole suite produced extra failures in contract.test.ts on both
branches, and guessed at state shared through the one database. That was wrong,
and the fault was mine: I had been pointing the tests at throwaway containers on
non-default ports while the machine was also building an unrelated project. With
Mongo 7.0.16 on 27017, Redis 7 on 6379 and the machine otherwise idle, the full
suite is clean:

✓ user.test.ts (73)            ✓ analytics.test.ts (2)
✓ events.test.ts (5)           ✓ service.disable.test.ts (3)
✓ service.test.ts (44)         ✓ feature-evaluation.test.ts (26)
✓ routeMatcher.test.ts (12)    ✓ contract.test.ts (77)
✓ version-formatter.test.ts (19)  ✓ organization.test.ts (127)
✓ authMiddleware.test.ts (68)  ✓ permissions.test.ts (245)

701 tests across 12 files, on main and with this PR. The residual failures I
saw were 5000 ms timeouts under load, plus one test that draws a random pricing
file per run. run-tests.sh runs each file in its own vitest process, so there
is no cross-file state to worry about.

run-tests.sh calls vitest directly, which is not on PATH after a plain
pnpm install; I ran it with npx vitest locally and have left that change out
of this PR.

Note on syntaxVersion

The v3.1 specification page documents syntaxVersion with "Supported value:
3.0", which looks like a documentation error rather than an intended
constraint — pricing4ts 0.11.1 accepts 3.1 and lists it as the latest.
Flagging in case it is worth correcting on the docs side too.

0.10.3 stops one version short of the current specification:

  0.10.3: PRICING2YAML_VERSIONS = ["1.0","1.1","2.0","2.1","3.0"]
  0.11.1: PRICING2YAML_VERSIONS = ["1.0","1.1","2.0","2.1","3.0","3.1"]

so registering a pricing written against 3.1 is refused with "Unsupported
version: 3.1", and the only way to register anything is to declare 3.0 and stay
a version behind.

No source change was needed: the imports SPACE uses - retrievePricingFromPath,
retrievePricingFromText, and the Pricing/Plan/Feature/UsageLimit types - kept
their signatures across the two releases. tsc passes and the API suite passes
against a local MongoDB and Redis.
@javiercavlop

Copy link
Copy Markdown
Contributor Author

The red Integration Tests Run check on this PR is not caused by the change. The job reads its Mongo port and database name from the testing environment, which GitHub withholds from pull requests opened from a fork, so the action is asked to publish port `` and docker refuses -p : before any test runs:

docker: invalid publish opts format (should be name=value but got ':').
Error starting MongoDB Docker container

The workflow has never passed on a fork PR — every green run in its history came from a branch inside the repository. #62 fixes it, and its own check is green, which is the fix running on a fork PR. Once that lands this check should go green here too.

@javiercavlop
javiercavlop changed the base branch from main to develop July 31, 2026 08:13
@Alex-GF
Alex-GF self-requested a review July 31, 2026 08:34
@Alex-GF
Alex-GF merged commit a19f8e6 into isa-group:develop Jul 31, 2026
2 checks passed
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.

2 participants