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
23 changes: 18 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4

Expand All @@ -31,8 +29,9 @@ jobs:
build:
name: build
runs-on: ubuntu-latest


permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -46,10 +45,24 @@ jobs:

- name: Check build
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/orb-node'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/orb-node'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh
test:
name: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.72.1"
".": "4.72.2"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 4.72.2 (2025-04-14)

Full Changelog: [v4.72.1...v4.72.2](https://github.com/orbcorp/orb-node/compare/v4.72.1...v4.72.2)

### Bug Fixes

* **client:** correctly reuse idempotency key ([a5b7cfe](https://github.com/orbcorp/orb-node/commit/a5b7cfe1d047eaedc243767e5b0b420e795fff88))


### Chores

* **internal:** reduce CI branch coverage ([f7db5ee](https://github.com/orbcorp/orb-node/commit/f7db5ee3dfea91cf4dd9aa1be7cea5e7f6ed7e6f))
* **internal:** upload builds and expand CI branch coverage ([#597](https://github.com/orbcorp/orb-node/issues/597)) ([5d4c819](https://github.com/orbcorp/orb-node/commit/5d4c819853e4cc0c67016f5e3d1b8e2076165d2b))

## 4.72.1 (2025-04-08)

Full Changelog: [v4.72.0...v4.72.1](https://github.com/orbcorp/orb-node/compare/v4.72.0...v4.72.1)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
"version": "4.72.1",
"version": "4.72.2",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <team@withorb.com>",
"types": "dist/index.d.ts",
Expand Down
25 changes: 25 additions & 0 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')

if [[ "$SIGNED_URL" == "null" ]]; then
echo -e "\033[31mFailed to get signed URL.\033[0m"
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/orb-node/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
fi
8 changes: 4 additions & 4 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ export abstract class APIClient {
}

buildRequest<Req>(
options: FinalRequestOptions<Req>,
inputOptions: FinalRequestOptions<Req>,
{ retryCount = 0 }: { retryCount?: number } = {},
): { req: RequestInit; url: string; timeout: number } {
options = { ...options };
const options = { ...inputOptions };
const { method, path, query, headers: headers = {} } = options;

const body =
Expand Down Expand Up @@ -327,8 +327,8 @@ export abstract class APIClient {
}

if (this.idempotencyHeader && method !== 'get') {
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
headers[this.idempotencyHeader] = options.idempotencyKey;
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
}

const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.72.1'; // x-release-please-version
export const VERSION = '4.72.2'; // x-release-please-version