diff --git a/.changeset/five-berries-clean.md b/.changeset/five-berries-clean.md deleted file mode 100644 index 6545e7a..0000000 --- a/.changeset/five-berries-clean.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -'@team-plain/typescript-sdk': major ---- - -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. - -For example in the below code this would be the change you now have to make: - -```diff - const client = new PlainClient({ apiKey: '' }); - - const res = await client.upsertCustomer({ - identifier: { - customerId: '', - }, - onCreate: { - fullName: '', - email: { - email: '', - isVerified: false, - }, - }, - onUpdate: {}, - }); - - if (res.error) { - console.error(res.error); - throw new Error(res.error.message); - } - -- console.log(`Created customer with id=${res.data.id}`); -+ console.log(`Created customer with id=${res.data.customer.id}`); -``` diff --git a/.changeset/gorgeous-ads-attend.md b/.changeset/gorgeous-ads-attend.md deleted file mode 100644 index f12ba8b..0000000 --- a/.changeset/gorgeous-ads-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@team-plain/typescript-sdk': minor ---- - -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. diff --git a/CHANGELOG.md b/CHANGELOG.md index 895e839..66db5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # @team-plain/typescript-sdk +## 2.0.0 + +### Major Changes + +- 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. + + For example in the below code this would be the change you now have to make: + + ```diff + const client = new PlainClient({ apiKey: '' }); + + const res = await client.upsertCustomer({ + identifier: { + email: 'foo@bar.com', + }, + onCreate: { + fullName: 'Foo Bar', + email: { + email: 'foo@bar.com', + isVerified: true, + }, + }, + onUpdate: {}, + }); + + if (res.error) { + console.error(res.error); + throw new Error(res.error.message); + } + + - console.log(`Created customer with id=${res.data.id}`); + + console.log(`Created customer with id=${res.data.customer.id}`); + ``` + +### Minor Changes + +- 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. + ## 1.2.1 ### Patch Changes diff --git a/package.json b/package.json index 1a09a65..ea627ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@team-plain/typescript-sdk", - "version": "1.2.1", + "version": "2.0.0", "description": "Typescript SDK for Plain's Core GraphQL API", "main": "dist/index.js", "module": "dist/index.mjs",