Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.4] - 2026-08-11

### Fixed

- Remove the stale monthly quota assumption from customer recovery copy and
reject fixed daily, weekly, monthly, or yearly quota-window claims even when
they do not contain a numeric allowance. Quota recovery now follows the live
API response and reviewed product facts.

## [1.2.3] - 2026-08-11

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ try {
} else if (error instanceof TimeoutError) {
console.error("Retry once, then check https://status.oilpriceapi.com.");
} else if (isQuotaError(error)) {
console.error(`Monthly quota reached; ${error.remediationUrl ?? "review the account"}.`);
console.error(
`Request quota exhausted; ${error.remediationUrl ?? "follow the API-provided recovery details"}.`,
);
} else if (isEntitlementError(error)) {
console.error(`This dataset needs the ${error.requiredPlan ?? "required"} plan.`);
} else if (error instanceof OilPriceAPIError) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oilpriceapi",
"version": "1.2.3",
"version": "1.2.4",
"description": "Official Node.js SDK for source-timestamped OilPriceAPI energy data",
"type": "module",
"main": "./dist/cjs/index.js",
Expand Down
4 changes: 4 additions & 0 deletions scripts/validate-storefront-claims.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const blocked = [
/\b(?:1,000|100)\s+requests?(?:\/month|\s+per month|\s+\(lifetime\))/i,
],
["quota promise", /\bdoes\s+not\s+consume.{0,40}\bquota\b|\bunlimited\s+(?:history|webhooks?|requests?|commodit)/i],
[
"fixed quota window",
/\b(?:daily|weekly|monthly|yearly)\s+(?:(?:api|request)\s+)?quota\b|\b(?:(?:api|request)\s+)?quota\b.{0,40}\b(?:daily|weekly|monthly|yearly)\b/i,
],
["free-tier claim", /\bfree\s+tier\b|\bfree\s+api\s+key\b/i],
["free endpoint claim", /\b(?:endpoint|resource|api)\s+is\s+free\b|\bincluded\s+in\s+all\s+tiers\b/i],
["fixed query allowance", /\b\d[\d,]*\s+(?:station\s+)?queries?\s*(?:\/|per\s+)month\b/i],
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* - X-Client-Version header
* - Package.json (should match)
*/
export const SDK_VERSION = "1.2.3";
export const SDK_VERSION = "1.2.4";

/**
* SDK identifier used in User-Agent and X-Api-Client headers
Expand Down
2 changes: 1 addition & 1 deletion tests/release-readiness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("release readiness", () => {
const changelog = read("CHANGELOG.md");
const firstRelease = changelog.match(/^## \[([^\]]+)\]/m);

expect(packageJson.version).toBe("1.2.3");
expect(packageJson.version).toBe("1.2.4");
expect(versionSource).toContain(`SDK_VERSION = "${packageJson.version}"`);
expect(firstRelease?.[1]).toBe(packageJson.version);
});
Expand Down
16 changes: 16 additions & 0 deletions tests/storefront-claims.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,20 @@ describe("public storefront claims", () => {
expect.stringContaining("dist/resources/future.d.ts"),
);
});

it("rejects a fixed quota window without requiring a numeric allowance", () => {
const root = mkdtempSync(join(tmpdir(), "oilpriceapi-package-quota-"));
scratch.push(root);
mkdirSync(join(root, "dist"), { recursive: true });
writeFileSync(
join(root, "README.md"),
"Monthly quota reached.\nhttps://api.oilpriceapi.com/product-facts.json\n",
);
writeFileSync(join(root, "package.json"), JSON.stringify({ version: "9.9.9" }));
writeFileSync(join(root, "dist", "version.js"), 'export const SDK_VERSION = "9.9.9";\n');

expect(validatePackage(root)).toContainEqual(
expect.stringContaining("fixed quota window"),
);
});
});