Skip to content

Commit 380ab9c

Browse files
gh-workflow-token-generator[bot]github-actions[bot]mattvagni
authored
Version Packages (#33)
* Version Packages * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Mathias Vagni <mattvagni@users.noreply.github.com>
1 parent 39bc31b commit 380ab9c

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed

.changeset/five-berries-clean.md

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

.changeset/gorgeous-ads-attend.md

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

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# @team-plain/typescript-sdk
22

3+
## 2.0.0
4+
5+
### Major Changes
6+
7+
- 39bc31b: Changed return type of upserting customer to include the upsert 'result' (e.g. if it the customer was created, updated or not modified). This means you will have to slight adjust your code to account for this.
8+
9+
For example in the below code this would be the change you now have to make:
10+
11+
```diff
12+
const client = new PlainClient({ apiKey: '' });
13+
14+
const res = await client.upsertCustomer({
15+
identifier: {
16+
email: 'foo@bar.com',
17+
},
18+
onCreate: {
19+
fullName: 'Foo Bar',
20+
email: {
21+
email: 'foo@bar.com',
22+
isVerified: true,
23+
},
24+
},
25+
onUpdate: {},
26+
});
27+
28+
if (res.error) {
29+
console.error(res.error);
30+
throw new Error(res.error.message);
31+
}
32+
33+
- console.log(`Created customer with id=${res.data.id}`);
34+
+ console.log(`Created customer with id=${res.data.customer.id}`);
35+
```
36+
37+
### Minor Changes
38+
39+
- 39bc31b: Added a query to get the customer by their email (`getCustomerByEmail`) and the ability to send and reply to emails via `sendNewEmail` and `replyToEmail` respectively.
40+
341
## 1.2.1
442

543
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@team-plain/typescript-sdk",
3-
"version": "1.2.1",
3+
"version": "2.0.0",
44
"description": "Typescript SDK for Plain's Core GraphQL API",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

0 commit comments

Comments
 (0)