From 6f95649772d51869139bdfded88b110540523eee Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 04:43:51 +0000 Subject: [PATCH 1/6] Use package version for source header Co-authored-by: barnett --- lib/Client.ts | 2 +- test/unit/releasePrepSpec.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/Client.ts b/lib/Client.ts index 638e21b..5a77ae2 100644 --- a/lib/Client.ts +++ b/lib/Client.ts @@ -10,7 +10,7 @@ import ValidationError = Errors.ValidationError; * @hidden */ -const CURRENT_CLIENT_VERSION = "1.1.0"; +const CURRENT_CLIENT_VERSION = require("../package.json").version; const DEFAULT_HEADERS = { "Content-Type": "application/json", "Trolley-Source": `javascript-sdk_${CURRENT_CLIENT_VERSION}`, diff --git a/test/unit/releasePrepSpec.ts b/test/unit/releasePrepSpec.ts index c8dde71..475bf2d 100644 --- a/test/unit/releasePrepSpec.ts +++ b/test/unit/releasePrepSpec.ts @@ -1,11 +1,15 @@ import { Batch, Balance, Configuration, Gateway, OfflinePayment, Payment, Recipient, RecipientAccount } from "../../lib"; import { BalancesGateway } from "../../lib/BalancesGateway"; +import { Client } from "../../lib/Client"; import { PaymentGateway } from "../../lib/PaymentGateway"; import { VerificationGateway } from "../../lib/VerificationGateway"; import * as assert from "assert"; +import * as nock from "nock"; import * as sinon from "sinon"; +const packageInfo = require("../../package.json"); + describe("Release prep endpoint coverage", () => { let sandbox: sinon.SinonSandbox; let client: { @@ -30,6 +34,21 @@ describe("Release prep endpoint coverage", () => { afterEach(() => { sandbox.restore(); + nock.cleanAll(); + }); + + it("uses the package version in the source header", async () => { + const sourceHeader = `javascript-sdk_${packageInfo.version}`; + const request = nock("https://api.trolley.com") + .matchHeader("Trolley-Source", sourceHeader) + .get("/v1/balances") + .reply(200, { ok: true }); + + const apiClient = new Client(new Configuration({ key: "access", secret: "secret" })); + + await apiClient.get("/v1/balances"); + + assert.ok(request.isDone()); }); it("uses documented balance endpoints", async () => { From 469a60d7cada655540b4a2fcba481dc817f77988 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 04:47:19 +0000 Subject: [PATCH 2/6] Update Codecov CircleCI orb Co-authored-by: barnett --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6455cf4..223d636 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - codecov: codecov/codecov@5.0.3 + codecov: codecov/codecov@5.4.3 executors: default: From 57890814cfc5583d6868ebf6c213aa82c9e37a4e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 04:49:17 +0000 Subject: [PATCH 3/6] Skip Codecov CLI validation in CI Co-authored-by: barnett --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 223d636..8c3b94a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,7 @@ jobs: token: CODECOV_TOKEN slug: trolley/javascript-sdk files: coverage/lcov.info + skip_validation: true when: always build: From e6f6eb0c1e4e940c28a0d030791a6f7c974975d1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 04:51:00 +0000 Subject: [PATCH 4/6] Use PyPI Codecov CLI in CI Co-authored-by: barnett --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c3b94a..477bb0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ jobs: token: CODECOV_TOKEN slug: trolley/javascript-sdk files: coverage/lcov.info - skip_validation: true + use_pypi: true when: always build: From effdc55f3e97cc8fac9d801781e5937a0de973cd Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 04:52:43 +0000 Subject: [PATCH 5/6] Install Codecov CLI before upload Co-authored-by: barnett --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 477bb0d..7d5d91e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,11 +26,14 @@ jobs: - run: name: Run unit tests with coverage command: npm run test:CI + - run: + name: Install Codecov CLI + command: python3 -m pip install --user codecov-cli - codecov/upload: token: CODECOV_TOKEN slug: trolley/javascript-sdk files: coverage/lcov.info - use_pypi: true + binary: /home/circleci/.local/bin/codecov when: always build: From 2e9f9aa28ae8d5b00cbf374583d50fa51154fe10 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 7 Jun 2026 04:53:33 +0000 Subject: [PATCH 6/6] Install pip for Codecov CLI Co-authored-by: barnett --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d5d91e..bd4373a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,10 @@ jobs: command: npm run test:CI - run: name: Install Codecov CLI - command: python3 -m pip install --user codecov-cli + command: | + sudo apt-get update + sudo apt-get install -y python3-pip + python3 -m pip install --user codecov-cli - codecov/upload: token: CODECOV_TOKEN slug: trolley/javascript-sdk