From 885505174b0f38407875212b9413e53e6b267b5d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Jun 2023 20:34:21 +0000 Subject: [PATCH 1/2] Version Packages --- .changeset/five-berries-clean.md | 33 --------------------------- .changeset/gorgeous-ads-attend.md | 5 ---- CHANGELOG.md | 38 +++++++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 .changeset/five-berries-clean.md delete mode 100644 .changeset/gorgeous-ads-attend.md 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..e992e51 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: { + 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}`); + ``` + +### 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", From 01afe712d253b603248a9378dc54c039a534a32b Mon Sep 17 00:00:00 2001 From: Mathias Vagni Date: Mon, 5 Jun 2023 22:35:55 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e992e51..66db5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,13 +13,13 @@ const res = await client.upsertCustomer({ identifier: { - customerId: '', + email: 'foo@bar.com', }, onCreate: { - fullName: '', + fullName: 'Foo Bar', email: { - email: '', - isVerified: false, + email: 'foo@bar.com', + isVerified: true, }, }, onUpdate: {},