Skip to content

Commit

Permalink
Typescript support (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
danrowden authored Sep 22, 2023
1 parent 39886e5 commit b9339e8
Show file tree
Hide file tree
Showing 8 changed files with 3,350 additions and 851 deletions.
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ const subscription = await ls.cancelSubscription({ id: 123 });

You can use `include` in every "read" method to pull in [related resources](https://docs.lemonsqueezy.com/api#including-related-resources) (works for both individual and list methods).

Note: In v1.0.3 and lower, `include` was a string of object names. Now it should be an array of strings.

```javascript
const product = await ls.getProduct({ id: 123, include: "variants" });
const product = await ls.getProduct({ id: 123, include: ["store", "variants"] });
```

### Pagination
Expand Down Expand Up @@ -1279,26 +1281,4 @@ Delete a webhook.

```javascript
await ls.deleteWebhook({ id: 123 })
```

## Development

To get started developing this project locally, clone the repository & install the dependencies:

```
git clone https://github.com/lmsqueezy/lemonsqueezy.js.git
cd lemonsqueezy-js
npm install
```

To create a new build:

```bash
npm run build
```

To start the local development server:

```bash
npm run dev
```
```
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "@lemonsqueezy/lemonsqueezy.js",
"description": "The official Lemon Squeezy JavaScript SDK.",
"version": "1.0.3",
"version": "1.1.0",
"author": "Lemon Squeezy",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"homepage": "https://github.com/lmsqueezy/lemonsqueezy.js",
"repository": {
"type": "git",
Expand All @@ -18,7 +17,8 @@
"keywords": [
"api",
"lemonsqueezy",
"javascript"
"javascript",
"typescript"
],
"files": [
"./dist/*",
Expand All @@ -33,5 +33,6 @@
"@types/node": "^20.4.5",
"tsup": "^7.1.0",
"typescript": "^5.1.6"
}
},
"type": "module"
}
Loading

0 comments on commit b9339e8

Please sign in to comment.