Skip to content

Commit bbfe1e3

Browse files
authored
Merge pull request #250 from orbcorp/release-please--branches--main--changes--next--components--orb-billing
release: 4.0.0
2 parents 7e30f71 + 1fbef78 commit bbfe1e3

28 files changed

+477
-812
lines changed

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
if: github.repository == 'orbcorp/orb-node'
15+
1616

1717
steps:
1818
- uses: actions/checkout@v4
@@ -30,7 +30,6 @@ jobs:
3030
test:
3131
name: test
3232
runs-on: ubuntu-latest
33-
if: github.repository == 'orbcorp/orb-node'
3433

3534
steps:
3635
- uses: actions/checkout@v4

.github/workflows/release-doctor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ jobs:
1919
bash ./bin/check-release-environment
2020
env:
2121
NPM_TOKEN: ${{ secrets.ORB_NPM_TOKEN || secrets.NPM_TOKEN }}
22+

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.2.0"
2+
".": "4.0.0"
33
}

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 93
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-e620baef7c2e237e0f03f462c688ba7bb1215d6481139b56b0074b6022d0ce6e.yml
1+
configured_endpoints: 91
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-67c238400cda65d40994581c7d37ad182a7d737e8abf3accfbc5ac5b04f64f07.yml

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 4.0.0 (2024-08-14)
4+
5+
Full Changelog: [v3.2.0...v4.0.0](https://github.com/orbcorp/orb-node/compare/v3.2.0...v4.0.0)
6+
7+
### ⚠ BREAKING CHANGES
8+
9+
* **api:** remove methods 'customers.usage.create' and 'customers.usage.update_by_external_id' ([#249](https://github.com/orbcorp/orb-node/issues/249))
10+
11+
### Features
12+
13+
* **api:** OpenAPI spec update via Stainless API ([#251](https://github.com/orbcorp/orb-node/issues/251)) ([6dc3dfe](https://github.com/orbcorp/orb-node/commit/6dc3dfe0910a57311e92c5f6bcb40e0f8d0f2768))
14+
* **api:** remove methods 'customers.usage.create' and 'customers.usage.update_by_external_id' ([#249](https://github.com/orbcorp/orb-node/issues/249)) ([2c10956](https://github.com/orbcorp/orb-node/commit/2c1095665ad03abe2977b2fc848ea005de34d06d))
15+
316
## 3.2.0 (2024-08-02)
417

518
Full Changelog: [v3.1.0...v3.2.0](https://github.com/orbcorp/orb-node/compare/v3.1.0...v3.2.0)

api.md

-12
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,6 @@ Methods:
7474
- <code title="get /customers/{customer_id}/costs">client.customers.costs.<a href="./src/resources/customers/costs.ts">list</a>(customerId, { ...params }) -> CostListResponse</code>
7575
- <code title="get /customers/external_customer_id/{external_customer_id}/costs">client.customers.costs.<a href="./src/resources/customers/costs.ts">listByExternalId</a>(externalCustomerId, { ...params }) -> CostListByExternalIDResponse</code>
7676

77-
## Usage
78-
79-
Types:
80-
81-
- <code><a href="./src/resources/customers/usage.ts">UsageUpdateResponse</a></code>
82-
- <code><a href="./src/resources/customers/usage.ts">UsageUpdateByExternalIDResponse</a></code>
83-
84-
Methods:
85-
86-
- <code title="patch /customers/{customer_id}/usage">client.customers.usage.<a href="./src/resources/customers/usage.ts">update</a>(id, { ...params }) -> UsageUpdateResponse</code>
87-
- <code title="patch /customers/external_customer_id/{external_customer_id}/usage">client.customers.usage.<a href="./src/resources/customers/usage.ts">updateByExternalId</a>(id, { ...params }) -> UsageUpdateByExternalIDResponse</code>
88-
8977
## Credits
9078

9179
Types:

bin/check-release-environment

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ if [[ lenErrors -gt 0 ]]; then
1919
fi
2020

2121
echo "The environment is ready to push releases!"
22+

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "orb-billing",
3-
"version": "3.2.0",
3+
"version": "4.0.0",
44
"description": "The official TypeScript library for the Orb API",
55
"author": "Orb <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
2121
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi",
2222
"tsn": "ts-node -r tsconfig-paths/register",
2323
"lint": "./scripts/lint",
24-
"fix": "eslint --fix --ext ts,js ."
24+
"fix": "./scripts/format"
2525
},
2626
"dependencies": {
2727
"@types/node": "^18.11.18",

scripts/format

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
cd "$(dirname "$0")/.."
66

77
echo "==> Running eslint --fix"
8-
./node_modules/.bin/eslint --fix --ext ts,js .
8+
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js .

scripts/lint

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
cd "$(dirname "$0")/.."
66

77
echo "==> Running eslint"
8-
./node_modules/.bin/eslint --ext ts,js .
8+
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js .

scripts/mock

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"
2121

2222
# Run prism mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24-
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL" &> .prism.log &
24+
npm exec --package=@stainless-api/[email protected].5 -- prism mock "$URL" &> .prism.log &
2525

2626
# Wait for server to come online
2727
echo -n "Waiting for server"
@@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then
3737

3838
echo
3939
else
40-
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL"
40+
npm exec --package=@stainless-api/[email protected].5 -- prism mock "$URL"
4141
fi

src/resources/alerts.ts

+24-9
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,17 @@ export interface AlertCreateForCustomerParams {
233233
currency: string;
234234

235235
/**
236-
* The thresholds that define the values at which the alert will be triggered.
236+
* The type of alert to create. This must be a valid alert type.
237237
*/
238-
type: string;
238+
type:
239+
| 'usage_exceeded'
240+
| 'cost_exceeded'
241+
| 'credit_balance_depleted'
242+
| 'credit_balance_dropped'
243+
| 'credit_balance_recovered';
239244

240245
/**
241-
* The thresholds for the alert.
246+
* The thresholds that define the values at which the alert will be triggered.
242247
*/
243248
thresholds?: Array<AlertCreateForCustomerParams.Threshold> | null;
244249
}
@@ -265,12 +270,17 @@ export interface AlertCreateForExternalCustomerParams {
265270
currency: string;
266271

267272
/**
268-
* The thresholds that define the values at which the alert will be triggered.
273+
* The type of alert to create. This must be a valid alert type.
269274
*/
270-
type: string;
275+
type:
276+
| 'usage_exceeded'
277+
| 'cost_exceeded'
278+
| 'credit_balance_depleted'
279+
| 'credit_balance_dropped'
280+
| 'credit_balance_recovered';
271281

272282
/**
273-
* The thresholds for the alert.
283+
* The thresholds that define the values at which the alert will be triggered.
274284
*/
275285
thresholds?: Array<AlertCreateForExternalCustomerParams.Threshold> | null;
276286
}
@@ -292,14 +302,19 @@ export namespace AlertCreateForExternalCustomerParams {
292302

293303
export interface AlertCreateForSubscriptionParams {
294304
/**
295-
* The thresholds for the alert.
305+
* The thresholds that define the values at which the alert will be triggered.
296306
*/
297307
thresholds: Array<AlertCreateForSubscriptionParams.Threshold>;
298308

299309
/**
300-
* The thresholds that define the values at which the alert will be triggered.
310+
* The type of alert to create. This must be a valid alert type.
301311
*/
302-
type: string;
312+
type:
313+
| 'usage_exceeded'
314+
| 'cost_exceeded'
315+
| 'credit_balance_depleted'
316+
| 'credit_balance_dropped'
317+
| 'credit_balance_recovered';
303318

304319
/**
305320
* The metric to track usage for.

src/resources/customers/customers.ts

-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ import * as Core from '../../core';
66
import * as CustomersAPI from './customers';
77
import * as BalanceTransactionsAPI from './balance-transactions';
88
import * as CostsAPI from './costs';
9-
import * as UsageAPI from './usage';
109
import * as CreditsAPI from './credits/credits';
1110
import { Page, type PageParams } from '../../pagination';
1211

1312
export class Customers extends APIResource {
1413
costs: CostsAPI.Costs = new CostsAPI.Costs(this._client);
15-
usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
1614
credits: CreditsAPI.Credits = new CreditsAPI.Credits(this._client);
1715
balanceTransactions: BalanceTransactionsAPI.BalanceTransactions =
1816
new BalanceTransactionsAPI.BalanceTransactions(this._client);
@@ -2172,11 +2170,6 @@ export namespace Customers {
21722170
export import CostListByExternalIDResponse = CostsAPI.CostListByExternalIDResponse;
21732171
export import CostListParams = CostsAPI.CostListParams;
21742172
export import CostListByExternalIDParams = CostsAPI.CostListByExternalIDParams;
2175-
export import Usage = UsageAPI.Usage;
2176-
export import UsageUpdateResponse = UsageAPI.UsageUpdateResponse;
2177-
export import UsageUpdateByExternalIDResponse = UsageAPI.UsageUpdateByExternalIDResponse;
2178-
export import UsageUpdateParams = UsageAPI.UsageUpdateParams;
2179-
export import UsageUpdateByExternalIDParams = UsageAPI.UsageUpdateByExternalIDParams;
21802173
export import Credits = CreditsAPI.Credits;
21812174
export import CreditListResponse = CreditsAPI.CreditListResponse;
21822175
export import CreditListByExternalIDResponse = CreditsAPI.CreditListByExternalIDResponse;

src/resources/customers/index.ts

-7
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,3 @@ export {
3333
CustomersPage,
3434
Customers,
3535
} from './customers';
36-
export {
37-
UsageUpdateResponse,
38-
UsageUpdateByExternalIDResponse,
39-
UsageUpdateParams,
40-
UsageUpdateByExternalIDParams,
41-
Usage,
42-
} from './usage';

0 commit comments

Comments
 (0)