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
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.3"
".": "4.73.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 106
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e8dad7eee5621fe2ba948dfd00dabf170d9d92ce615a9f04b0f546f4d8bf39ba.yml
openapi_spec_hash: 3f6a98e3a1b3a47acebd67a960090ebf
config_hash: f6da12790e8f46d93592def474d41c69
configured_endpoints: 114
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6d2a5b5d2cfb485e1a548aa15e1e36844e1f14f42553033822e1c570c8aa0825.yml
openapi_spec_hash: 0266a5aaced5e768bcf6a70924d69799
config_hash: e63f2d098e5d12f63ae4cd8270aa5c3c
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 4.73.0 (2025-05-28)

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

### Features

* **api:** api update ([e7c0e9b](https://github.com/orbcorp/orb-node/commit/e7c0e9ba2894fe00871aff9d542402aefdb514fe))
* **api:** api update ([6314aab](https://github.com/orbcorp/orb-node/commit/6314aab469494941759c2c4ca9dd40951411c143))
* **api:** manual updates ([1148ae8](https://github.com/orbcorp/orb-node/commit/1148ae84a3dccdc9a0f7f16582457b01842bc303))


### Chores

* **docs:** grammar improvements ([7734e2c](https://github.com/orbcorp/orb-node/commit/7734e2c2d52411326b3ae2eb1fbed42d63ba4c08))
* improve publish-npm script --latest tag logic ([642fae3](https://github.com/orbcorp/orb-node/commit/642fae3d1d137b24687643c0f700a5637162584b))

## 4.72.3 (2025-05-18)

Full Changelog: [v4.72.2...v4.72.3](https://github.com/orbcorp/orb-node/compare/v4.72.2...v4.72.3)
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Orb please follow the respective company's security reporting guidelines.
or products provided by Orb, please follow the respective company's security reporting guidelines.

### Orb Terms and Policies

Please contact team@withorb.com for any questions or concerns regarding security of our services.
Please contact team@withorb.com for any questions or concerns regarding the security of our services.

---

Expand Down
24 changes: 24 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ Methods:

- <code title="get /ping">client.topLevel.<a href="./src/resources/top-level.ts">ping</a>() -> TopLevelPingResponse</code>

# Beta

Types:

- <code><a href="./src/resources/beta/beta.ts">PlanVersion</a></code>
- <code><a href="./src/resources/beta/beta.ts">PlanVersionPhase</a></code>

Methods:

- <code title="post /plans/{plan_id}/versions">client.beta.<a href="./src/resources/beta/beta.ts">createPlanVersion</a>(planId, { ...params }) -> PlanVersion</code>
- <code title="get /plans/{plan_id}/versions/{version}">client.beta.<a href="./src/resources/beta/beta.ts">fetchPlanVersion</a>(planId, version) -> PlanVersion</code>
- <code title="post /plans/{plan_id}/set_default_version">client.beta.<a href="./src/resources/beta/beta.ts">setDefaultPlanVersion</a>(planId, { ...params }) -> Plan</code>

## ExternalPlanID

Methods:

- <code title="post /plans/external_plan_id/{external_plan_id}/versions">client.beta.externalPlanId.<a href="./src/resources/beta/external-plan-id.ts">createPlanVersion</a>(externalPlanId, { ...params }) -> PlanVersion</code>
- <code title="get /plans/external_plan_id/{external_plan_id}/versions/{version}">client.beta.externalPlanId.<a href="./src/resources/beta/external-plan-id.ts">fetchPlanVersion</a>(externalPlanId, version) -> PlanVersion</code>
- <code title="post /plans/external_plan_id/{external_plan_id}/set_default_version">client.beta.externalPlanId.<a href="./src/resources/beta/external-plan-id.ts">setDefaultPlanVersion</a>(externalPlanId, { ...params }) -> Plan</code>

# Coupons

Types:
Expand Down Expand Up @@ -225,6 +246,7 @@ Methods:
- <code title="post /items">client.items.<a href="./src/resources/items.ts">create</a>({ ...params }) -> Item</code>
- <code title="put /items/{item_id}">client.items.<a href="./src/resources/items.ts">update</a>(itemId, { ...params }) -> Item</code>
- <code title="get /items">client.items.<a href="./src/resources/items.ts">list</a>({ ...params }) -> ItemsPage</code>
- <code title="post /items/{item_id}/archive">client.items.<a href="./src/resources/items.ts">archive</a>(itemId) -> Item</code>
- <code title="get /items/{item_id}">client.items.<a href="./src/resources/items.ts">fetch</a>(itemId) -> Item</code>

# Metrics
Expand Down Expand Up @@ -267,13 +289,15 @@ Types:
- <code><a href="./src/resources/prices/prices.ts">EvaluatePriceGroup</a></code>
- <code><a href="./src/resources/prices/prices.ts">Price</a></code>
- <code><a href="./src/resources/prices/prices.ts">PriceEvaluateResponse</a></code>
- <code><a href="./src/resources/prices/prices.ts">PriceEvaluateMultipleResponse</a></code>

Methods:

- <code title="post /prices">client.prices.<a href="./src/resources/prices/prices.ts">create</a>({ ...params }) -> Price</code>
- <code title="put /prices/{price_id}">client.prices.<a href="./src/resources/prices/prices.ts">update</a>(priceId, { ...params }) -> Price</code>
- <code title="get /prices">client.prices.<a href="./src/resources/prices/prices.ts">list</a>({ ...params }) -> PricesPage</code>
- <code title="post /prices/{price_id}/evaluate">client.prices.<a href="./src/resources/prices/prices.ts">evaluate</a>(priceId, { ...params }) -> PriceEvaluateResponse</code>
- <code title="post /prices/evaluate">client.prices.<a href="./src/resources/prices/prices.ts">evaluateMultiple</a>({ ...params }) -> PriceEvaluateMultipleResponse</code>
- <code title="get /prices/{price_id}">client.prices.<a href="./src/resources/prices/prices.ts">fetch</a>(priceId) -> Price</code>

## ExternalPriceID
Expand Down
30 changes: 23 additions & 7 deletions bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,35 @@ set -eux

npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"

# Build the project
yarn build

# Navigate to the dist directory
cd dist

# Get the version from package.json
# Get latest version from npm
#
# If the package doesn't exist, yarn will return
# {"type":"error","data":"Received invalid response from npm."}
# where .data.version doesn't exist so LAST_VERSION will be an empty string.
LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')"

# Get current version from package.json
VERSION="$(node -p "require('./package.json').version")"

# Extract the pre-release tag if it exists
# Check if current version is pre-release (e.g. alpha / beta / rc)
CURRENT_IS_PRERELEASE=false
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
# Extract the part before any dot in the pre-release identifier
TAG="${BASH_REMATCH[1]}"
CURRENT_IS_PRERELEASE=true
CURRENT_TAG="${BASH_REMATCH[1]}"
fi

# Check if last version is a stable release
LAST_IS_STABLE_RELEASE=true
if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then
LAST_IS_STABLE_RELEASE=false
fi

# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease.
if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then
TAG="$CURRENT_TAG"
else
TAG="latest"
fi
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.3",
"version": "4.73.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <team@withorb.com>",
"types": "dist/index.d.ts",
Expand Down
21 changes: 21 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ import {
SubscriptionsPage,
} from './resources/subscriptions';
import { TopLevel, TopLevelPingResponse } from './resources/top-level';
import {
Beta,
BetaCreatePlanVersionParams,
BetaSetDefaultPlanVersionParams,
PlanVersion,
PlanVersionPhase,
} from './resources/beta/beta';
import {
Coupon,
CouponCreateParams,
Expand Down Expand Up @@ -145,6 +152,8 @@ import {
EvaluatePriceGroup,
Price,
PriceCreateParams,
PriceEvaluateMultipleParams,
PriceEvaluateMultipleResponse,
PriceEvaluateParams,
PriceEvaluateResponse,
PriceListParams,
Expand Down Expand Up @@ -278,6 +287,7 @@ export class Orb extends Core.APIClient {
}

topLevel: API.TopLevel = new API.TopLevel(this);
beta: API.Beta = new API.Beta(this);
coupons: API.Coupons = new API.Coupons(this);
creditNotes: API.CreditNotes = new API.CreditNotes(this);
customers: API.Customers = new API.Customers(this);
Expand Down Expand Up @@ -347,6 +357,7 @@ export class Orb extends Core.APIClient {
}

Orb.TopLevel = TopLevel;
Orb.Beta = Beta;
Orb.Coupons = Coupons;
Orb.CouponsPage = CouponsPage;
Orb.CreditNotes = CreditNotes;
Expand Down Expand Up @@ -379,6 +390,14 @@ export declare namespace Orb {

export { TopLevel as TopLevel, type TopLevelPingResponse as TopLevelPingResponse };

export {
Beta as Beta,
type PlanVersion as PlanVersion,
type PlanVersionPhase as PlanVersionPhase,
type BetaCreatePlanVersionParams as BetaCreatePlanVersionParams,
type BetaSetDefaultPlanVersionParams as BetaSetDefaultPlanVersionParams,
};

export {
Coupons as Coupons,
type Coupon as Coupon,
Expand Down Expand Up @@ -467,11 +486,13 @@ export declare namespace Orb {
type EvaluatePriceGroup as EvaluatePriceGroup,
type Price as Price,
type PriceEvaluateResponse as PriceEvaluateResponse,
type PriceEvaluateMultipleResponse as PriceEvaluateMultipleResponse,
PricesPage as PricesPage,
type PriceCreateParams as PriceCreateParams,
type PriceUpdateParams as PriceUpdateParams,
type PriceListParams as PriceListParams,
type PriceEvaluateParams as PriceEvaluateParams,
type PriceEvaluateMultipleParams as PriceEvaluateMultipleParams,
};

export {
Expand Down
21 changes: 21 additions & 0 deletions src/resources/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ export interface Alert {
| 'credit_balance_recovered'
| 'usage_exceeded'
| 'cost_exceeded';

/**
* The current status of the alert. This field is only present for credit balance
* alerts.
*/
balance_alert_status?: Array<Alert.BalanceAlertStatus> | null;
}

export namespace Alert {
Expand Down Expand Up @@ -280,6 +286,21 @@ export namespace Alert {
*/
value: number;
}

/**
* Alert status is used to determine if an alert is currently in-alert or not.
*/
export interface BalanceAlertStatus {
/**
* Whether the alert is currently in-alert or not.
*/
in_alert: boolean;

/**
* The value of the threshold that defines the alert status.
*/
threshold_value: number;
}
}

export interface AlertUpdateParams {
Expand Down
3 changes: 3 additions & 0 deletions src/resources/beta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export * from './beta/index';
Loading
Loading