Skip to content

Commit 6e3ed9b

Browse files
authored
Merge pull request #105 from orbcorp/release-please--branches--main--changes--next--components--orb-billing
release: 2.0.0
2 parents cf1f67f + 39bee00 commit 6e3ed9b

21 files changed

+1038
-112
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
if: github.repository == 'orbcorp/orb-node'
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- name: Set up Node
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: '18'
2323

.github/workflows/create-releases.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/handle-release-pr-title-edit.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/publish-npm.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# workflow for re-running publishing to NPM in case it fails for some reason
2-
# you can run this workflow by navigating to https://www.github.com/orbcorp/orb-node/actions/workflows/publish-npm.yml
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/orbcorp/orb-node/actions/workflows/publish-npm.yml
34
name: Publish NPM
45
on:
56
workflow_dispatch:
67

8+
release:
9+
types: [published]
10+
711
jobs:
812
publish:
913
name: publish

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ jobs:
1616
run: |
1717
bash ./bin/check-release-environment
1818
env:
19-
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
2019
NPM_TOKEN: ${{ secrets.ORB_NPM_TOKEN || secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.41.0"
2+
".": "2.0.0"
33
}

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Changelog
22

3+
## 2.0.0 (2024-03-15)
4+
5+
Full Changelog: [v1.41.0...v2.0.0](https://github.com/orbcorp/orb-node/compare/v1.41.0...v2.0.0)
6+
7+
### ⚠ BREAKING CHANGES
8+
9+
* remove brackets from array param names ([#109](https://github.com/orbcorp/orb-node/issues/109))
10+
11+
### Features
12+
13+
* **api:** add matrix with allocation price ([#125](https://github.com/orbcorp/orb-node/issues/125)) ([6f5326c](https://github.com/orbcorp/orb-node/commit/6f5326cf9880d411ef0195a6b30cdb7b28efb1ba))
14+
* **api:** create invoice metadata param ([#126](https://github.com/orbcorp/orb-node/issues/126)) ([fbd1fe2](https://github.com/orbcorp/orb-node/commit/fbd1fe2359c84af7e96e75be593d3802f104273e))
15+
* **api:** updates ([#123](https://github.com/orbcorp/orb-node/issues/123)) ([da21006](https://github.com/orbcorp/orb-node/commit/da21006557813e5840ad5c976cbc5f7cdb490d80))
16+
* **api:** updates ([#124](https://github.com/orbcorp/orb-node/issues/124)) ([b38e885](https://github.com/orbcorp/orb-node/commit/b38e885c10405d866051b49bec3110c388ebaa38))
17+
18+
19+
### Bug Fixes
20+
21+
* remove brackets from array param names ([#109](https://github.com/orbcorp/orb-node/issues/109)) ([eb8d87a](https://github.com/orbcorp/orb-node/commit/eb8d87ab56e1c0f0aa1550488e1be9adfb82b46c))
22+
23+
24+
### Chores
25+
26+
* **ci:** update actions/setup-node action to v4 ([#114](https://github.com/orbcorp/orb-node/issues/114)) ([cb18285](https://github.com/orbcorp/orb-node/commit/cb182857aab933915d07299375cec7556e64b22a))
27+
* **ci:** uses Stainless GitHub App for releases ([#111](https://github.com/orbcorp/orb-node/issues/111)) ([b32a3db](https://github.com/orbcorp/orb-node/commit/b32a3db0956464737a7692d47dee726a58870aa2))
28+
* **docs:** mention install from git repo ([#118](https://github.com/orbcorp/orb-node/issues/118)) ([80ab072](https://github.com/orbcorp/orb-node/commit/80ab072ce57e6caf6490e57302b67900c7a00702))
29+
* fix error handler in readme ([#119](https://github.com/orbcorp/orb-node/issues/119)) ([91ab80e](https://github.com/orbcorp/orb-node/commit/91ab80e3e3e07e9af2f6065594f29cae558a48e0))
30+
* **interal:** make link to api.md relative ([#104](https://github.com/orbcorp/orb-node/issues/104)) ([10b9053](https://github.com/orbcorp/orb-node/commit/10b9053e1cf9afc7a6ce3750650f9cee91ff5890))
31+
* **internal:** enable building when git installed ([#107](https://github.com/orbcorp/orb-node/issues/107)) ([9d6c4aa](https://github.com/orbcorp/orb-node/commit/9d6c4aa517116a5c5f9e2a242429f52cd86f88b8))
32+
* **internal:** re-order pagination import ([#106](https://github.com/orbcorp/orb-node/issues/106)) ([3869080](https://github.com/orbcorp/orb-node/commit/38690803e060a343400da766e4b783d4cc8b0d2a))
33+
* **internal:** refactor release environment script ([#112](https://github.com/orbcorp/orb-node/issues/112)) ([73a6e40](https://github.com/orbcorp/orb-node/commit/73a6e409f780f9961d22a2515f861d32a639e0ba))
34+
* **internal:** update deps ([#115](https://github.com/orbcorp/orb-node/issues/115)) ([42f5dcd](https://github.com/orbcorp/orb-node/commit/42f5dcd408f813ee4371a50095bb454d1173f30e))
35+
* respect `application/vnd.api+json` content-type header ([#110](https://github.com/orbcorp/orb-node/issues/110)) ([af334b3](https://github.com/orbcorp/orb-node/commit/af334b32adc1f446cb65b25f0fa670bbc18da170))
36+
37+
38+
### Documentation
39+
40+
* add a CONTRIBUTING.md ([#108](https://github.com/orbcorp/orb-node/issues/108)) ([97829ba](https://github.com/orbcorp/orb-node/commit/97829ba3cef5cf3435bfa6bd467b24e83676168f))
41+
* **contributing:** improve wording ([#116](https://github.com/orbcorp/orb-node/issues/116)) ([154baf1](https://github.com/orbcorp/orb-node/commit/154baf11174879ba98ec0f8b6b298c69496ab537))
42+
* fix example of fetch overwrite ([d3cf8c0](https://github.com/orbcorp/orb-node/commit/d3cf8c0b94c49cc88ec0c5f70a36e85e121b13a8))
43+
* **readme:** fix https proxy example ([#120](https://github.com/orbcorp/orb-node/issues/120)) ([e284311](https://github.com/orbcorp/orb-node/commit/e2843116e45bbae8d532ebcc10bd9e0c84ff806c))
44+
* remove extraneous --save and yarn install instructions ([#121](https://github.com/orbcorp/orb-node/issues/121)) ([38785df](https://github.com/orbcorp/orb-node/commit/38785df64cf6ddaf07a103967856fbce3a56674c))
45+
346
## 1.41.0 (2024-02-01)
447

548
Full Changelog: [v1.40.0...v1.41.0](https://github.com/orbcorp/orb-node/compare/v1.40.0...v1.41.0)

CONTRIBUTING.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## Setting up the environment
2+
3+
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
4+
Other package managers may work but are not officially supported for development.
5+
6+
To set up the repository, run:
7+
8+
```bash
9+
yarn
10+
yarn build
11+
```
12+
13+
This will install all the required dependencies and build output files to `dist/`.
14+
15+
## Modifying/Adding code
16+
17+
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
18+
`src/lib/` and `examples/` directories are exceptions and will never be overridden.
19+
20+
## Adding and running examples
21+
22+
All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
23+
added to.
24+
25+
```bash
26+
// add an example to examples/<your-example>.ts
27+
28+
#!/usr/bin/env -S npm run tsn -T
29+
30+
```
31+
32+
```
33+
chmod +x examples/<your-example>.ts
34+
# run the example against your api
35+
yarn tsn -T examples/<your-example>.ts
36+
```
37+
38+
## Using the repository from source
39+
40+
If you’d like to use the repository from source, you can either install from git or link to a cloned repository:
41+
42+
To install via git:
43+
44+
```bash
45+
npm install git+ssh://git@github.com:orbcorp/orb-node.git
46+
```
47+
48+
Alternatively, to link a local copy of the repo:
49+
50+
```bash
51+
# Clone
52+
git clone https://www.github.com/orbcorp/orb-node
53+
cd orb-node
54+
55+
# With yarn
56+
yarn link
57+
cd ../my-package
58+
yarn link orb-billing
59+
60+
# With pnpm
61+
pnpm link --global
62+
cd ../my-package
63+
pnpm link -—global orb-billing
64+
```
65+
66+
## Running tests
67+
68+
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
69+
70+
```bash
71+
npx prism path/to/your/openapi.yml
72+
```
73+
74+
```bash
75+
yarn run test
76+
```
77+
78+
## Linting and formatting
79+
80+
This repository uses [prettier](https://www.npmjs.com/package/prettier) and
81+
[eslint](https://www.npmjs.com/package/eslint) to format the code in the repository.
82+
83+
To lint:
84+
85+
```bash
86+
yarn lint
87+
```
88+
89+
To format and fix all lint issues automatically:
90+
91+
```bash
92+
yarn fix
93+
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/orbcorp/orb-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@
44

55
This library provides convenient access to the Orb REST API from server-side TypeScript or JavaScript.
66

7-
The REST API documentation can be found [on docs.withorb.com](https://docs.withorb.com/reference/api-reference). The full API of this library can be found in [api.md](https://www.github.com/orbcorp/orb-node/blob/main/api.md).
7+
The REST API documentation can be found [on docs.withorb.com](https://docs.withorb.com/reference/api-reference). The full API of this library can be found in [api.md](api.md).
88

99
## Installation
1010

1111
```sh
12-
npm install --save orb-billing
13-
# or
14-
yarn add orb-billing
12+
npm install orb-billing
1513
```
1614

1715
## Usage
1816

19-
The full API of this library can be found in [api.md](https://www.github.com/orbcorp/orb-node/blob/main/api.md).
17+
The full API of this library can be found in [api.md](api.md).
2018

2119
<!-- prettier-ignore -->
2220
```js
@@ -68,7 +66,7 @@ a subclass of `APIError` will be thrown:
6866
async function main() {
6967
const customer = await orb.customers
7068
.create({ email: 'example-customer@withorb.com', name: 'My Customer' })
71-
.catch((err) => {
69+
.catch(async (err) => {
7270
if (err instanceof Orb.APIError) {
7371
console.log(err.status); // 400
7472
console.log(err.name); // BadRequestError
@@ -209,7 +207,7 @@ import Orb from 'orb-billing';
209207
```
210208

211209
To do the inverse, add `import "orb-billing/shims/node"` (which does import polyfills).
212-
This can also be useful if you are getting the wrong TypeScript types for `Response` more details [here](https://github.com/orbcorp/orb-node/tree/main/src/_shims#readme).
210+
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/orbcorp/orb-node/tree/main/src/_shims#readme)).
213211

214212
You may also provide a custom `fetch` function when instantiating the client,
215213
which can be used to inspect or alter the `Request` or `Response` before/after each request:
@@ -240,18 +238,20 @@ If you would like to disable or customize this behavior, for example to use the
240238
<!-- prettier-ignore -->
241239
```ts
242240
import http from 'http';
243-
import HttpsProxyAgent from 'https-proxy-agent';
241+
import { HttpsProxyAgent } from 'https-proxy-agent';
244242

245243
// Configure the default for all requests:
246244
const orb = new Orb({
247245
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
248246
});
249247

250248
// Override per-request:
251-
await orb.customers.create({ email: 'example-customer@withorb.com', name: 'My Customer' }, {
252-
baseURL: 'http://localhost:8080/test-api',
253-
httpAgent: new http.Agent({ keepAlive: false }),
254-
})
249+
await orb.customers.create(
250+
{ email: 'example-customer@withorb.com', name: 'My Customer' },
251+
{
252+
httpAgent: new http.Agent({ keepAlive: false }),
253+
},
254+
);
255255
```
256256

257257
## Semantic Versioning

bin/check-release-environment

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22

33
errors=()
44

5-
if [ -z "${STAINLESS_API_KEY}" ]; then
6-
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
7-
fi
8-
95
if [ -z "${NPM_TOKEN}" ]; then
106
errors+=("The ORB_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
117
fi
128

13-
len=${#errors[@]}
9+
lenErrors=${#errors[@]}
1410

15-
if [[ len -gt 0 ]]; then
11+
if [[ lenErrors -gt 0 ]]; then
1612
echo -e "Found the following errors in the release environment:\n"
1713

1814
for error in "${errors[@]}"; do

0 commit comments

Comments
 (0)