Skip to content

Commit 80feb82

Browse files
committed
Release 1.0.0
1 parent b2be996 commit 80feb82

File tree

162 files changed

+2452
-3317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+2452
-3317
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,30 @@ jobs:
2828

2929
- name: Compile
3030
run: yarn && yarn test
31+
32+
publish:
33+
needs: [ compile, test ]
34+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout repo
38+
uses: actions/checkout@v3
39+
- name: Set up node
40+
uses: actions/setup-node@v3
41+
- name: Install dependencies
42+
run: yarn install
43+
- name: Build
44+
run: yarn build
45+
46+
- name: Publish to npm
47+
run: |
48+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
49+
if [[ ${GITHUB_REF} == *alpha* ]]; then
50+
npm publish --access public --tag alpha
51+
elif [[ ${GITHUB_REF} == *beta* ]]; then
52+
npm publish --access public --tag beta
53+
else
54+
npm publish --access public
55+
fi
56+
env:
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Stripe TypeScript Library
22

33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fstripe-demo%2Fstripe-node)
4-
[![npm shield](https://img.shields.io/npm/v/stripe)](https://www.npmjs.com/package/stripe)
4+
[![npm shield](https://img.shields.io/npm/v/@fern-api/stripe)](https://www.npmjs.com/package/@fern-api/stripe)
55

66
The Stripe TypeScript library provides convenient access to the Stripe API from TypeScript.
77

88
## Installation
99

1010
```sh
11-
npm i -s stripe
11+
npm i -s @fern-api/stripe
1212
```
1313

1414
## Reference
@@ -20,10 +20,10 @@ A full reference for this library is available [here](./reference.md).
2020
Instantiate and use the client with the following:
2121

2222
```typescript
23-
import { StripeClient } from "stripe";
23+
import { StripeClient } from "@fern-api/stripe";
2424

25-
const client = new StripeClient({ username: "YOUR_USERNAME", password: "YOUR_PASSWORD" });
26-
await client.postCustomersCustomerSourcesId("customer", "id");
25+
const client = new StripeClient({ token: "YOUR_TOKEN" });
26+
await client.account.create();
2727
```
2828

2929
## Request And Response Types
@@ -32,7 +32,7 @@ The SDK exports all request and response types as TypeScript interfaces. Simply
3232
following namespace:
3333

3434
```typescript
35-
import { Stripe } from "stripe";
35+
import { Stripe } from "@fern-api/stripe";
3636

3737
const request: Stripe.AccountRetrieveRequest = {
3838
...
@@ -45,10 +45,10 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
4545
will be thrown.
4646

4747
```typescript
48-
import { StripeError } from "stripe";
48+
import { StripeError } from "@fern-api/stripe";
4949

5050
try {
51-
await client.postCustomersCustomerSourcesId(...);
51+
await client.account.create(...);
5252
} catch (err) {
5353
if (err instanceof StripeError) {
5454
console.log(err.statusCode);
@@ -65,7 +65,7 @@ try {
6565
If you would like to send additional headers as part of the request, use the `headers` request option.
6666

6767
```typescript
68-
const response = await client.postCustomersCustomerSourcesId(..., {
68+
const response = await client.account.create(..., {
6969
headers: {
7070
'X-Custom-Header': 'custom value'
7171
}
@@ -87,7 +87,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
8787
Use the `maxRetries` request option to configure this behavior.
8888

8989
```typescript
90-
const response = await client.postCustomersCustomerSourcesId(..., {
90+
const response = await client.account.create(..., {
9191
maxRetries: 0 // override maxRetries at the request level
9292
});
9393
```
@@ -97,7 +97,7 @@ const response = await client.postCustomersCustomerSourcesId(..., {
9797
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
9898

9999
```typescript
100-
const response = await client.postCustomersCustomerSourcesId(..., {
100+
const response = await client.account.create(..., {
101101
timeoutInSeconds: 30 // override timeout to 30s
102102
});
103103
```
@@ -108,7 +108,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
108108

109109
```typescript
110110
const controller = new AbortController();
111-
const response = await client.postCustomersCustomerSourcesId(..., {
111+
const response = await client.account.create(..., {
112112
abortSignal: controller.signal
113113
});
114114
controller.abort(); // aborts the request
@@ -132,7 +132,7 @@ The SDK provides a way for your to customize the underlying HTTP client / Fetch
132132
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
133133

134134
```typescript
135-
import { StripeClient } from "stripe";
135+
import { StripeClient } from "@fern-api/stripe";
136136

137137
const client = new StripeClient({
138138
...

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "stripe",
3-
"version": "0.0.1-alpha0",
2+
"name": "@fern-api/stripe",
3+
"version": "1.0.0",
44
"private": false,
55
"repository": "https://github.com/stripe-demo/stripe-node",
66
"license": "MIT",
@@ -19,7 +19,8 @@
1919
"node-fetch": "^2.7.0",
2020
"qs": "^6.13.1",
2121
"readable-stream": "^4.5.2",
22-
"js-base64": "3.7.7"
22+
"js-base64": "3.7.7",
23+
"form-data-encoder": "^4.0.2"
2324
},
2425
"devDependencies": {
2526
"@types/url-join": "4.0.1",

reference.md

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Reference
22

3-
<details><summary><code>client.<a href="/src/Client.ts">deleteTaxIdsId</a>(id, { ...params }) -> Stripe.DeletedTaxId</code></summary>
3+
<details><summary><code>client.<a href="/src/Client.ts">getChargesChargeRefundsRefund</a>(charge, refund, { ...params }) -> Stripe.Refund</code></summary>
44
<dl>
55
<dd>
66

@@ -12,7 +12,7 @@
1212
<dl>
1313
<dd>
1414

15-
<p>Deletes an existing account or customer <code>tax_id</code> object.</p>
15+
<p>Retrieves the details of an existing refund.</p>
1616
</dd>
1717
</dl>
1818
</dd>
@@ -27,7 +27,7 @@
2727
<dd>
2828

2929
```typescript
30-
await client.deleteTaxIdsId("id");
30+
await client.getChargesChargeRefundsRefund("charge", "refund");
3131
```
3232

3333
</dd>
@@ -43,15 +43,23 @@ await client.deleteTaxIdsId("id");
4343
<dl>
4444
<dd>
4545

46-
**id:** `string`
46+
**charge:** `string`
47+
48+
</dd>
49+
</dl>
50+
51+
<dl>
52+
<dd>
53+
54+
**refund:** `string`
4755

4856
</dd>
4957
</dl>
5058

5159
<dl>
5260
<dd>
5361

54-
**request:** `Stripe.DeleteTaxIdsIdRequest`
62+
**request:** `Stripe.GetChargesChargeRefundsRefundRequest`
5563

5664
</dd>
5765
</dl>
@@ -7651,6 +7659,73 @@ await client.file.list();
76517659
</dl>
76527660
</details>
76537661

7662+
<details><summary><code>client.file.<a href="/src/api/resources/file/client/Client.ts">create</a>({ ...params }) -> Stripe.File_</code></summary>
7663+
<dl>
7664+
<dd>
7665+
7666+
#### 📝 Description
7667+
7668+
<dl>
7669+
<dd>
7670+
7671+
<dl>
7672+
<dd>
7673+
7674+
<p>To upload a file to Stripe, you need to send a request of type <code>multipart/form-data</code>. Include the file you want to upload in the request, and the parameters for creating a file.</p>
7675+
7676+
<p>All of Stripe’s officially supported Client libraries support sending <code>multipart/form-data</code>.</p>
7677+
</dd>
7678+
</dl>
7679+
</dd>
7680+
</dl>
7681+
7682+
#### 🔌 Usage
7683+
7684+
<dl>
7685+
<dd>
7686+
7687+
<dl>
7688+
<dd>
7689+
7690+
```typescript
7691+
await client.file.create({
7692+
file: fs.createReadStream("/path/to/your/file"),
7693+
purpose: "account_requirement",
7694+
});
7695+
```
7696+
7697+
</dd>
7698+
</dl>
7699+
</dd>
7700+
</dl>
7701+
7702+
#### ⚙️ Parameters
7703+
7704+
<dl>
7705+
<dd>
7706+
7707+
<dl>
7708+
<dd>
7709+
7710+
**request:** `Stripe.FileCreateRequest`
7711+
7712+
</dd>
7713+
</dl>
7714+
7715+
<dl>
7716+
<dd>
7717+
7718+
**requestOptions:** `File_.RequestOptions`
7719+
7720+
</dd>
7721+
</dl>
7722+
</dd>
7723+
</dl>
7724+
7725+
</dd>
7726+
</dl>
7727+
</details>
7728+
76547729
<details><summary><code>client.file.<a href="/src/api/resources/file/client/Client.ts">retrieve</a>(file, { ...params }) -> Stripe.File_</code></summary>
76557730
<dl>
76567731
<dd>

0 commit comments

Comments
 (0)