diff --git a/.changeset/brown-hairs-smell.md b/.changeset/brown-hairs-smell.md new file mode 100644 index 0000000..e3648fa --- /dev/null +++ b/.changeset/brown-hairs-smell.md @@ -0,0 +1,5 @@ +--- +'@team-plain/typescript-sdk': minor +--- + +Rename `userByEmail` to `getUserByEmail` and deprecate old method. diff --git a/src/client.ts b/src/client.ts index 7d32017..d4770ca 100644 --- a/src/client.ts +++ b/src/client.ts @@ -112,6 +112,7 @@ export class PlainClient { /** * Get a paginated list of customers. + * @deprecated "use `getUserByEmail" instead */ async userByEmail( variables: VariablesOf @@ -124,6 +125,20 @@ export class PlainClient { return unwrapData(res, (q) => q.userByEmail || null); } + /** + * Get a paginated list of customers. + */ + async getUserByEmail( + variables: VariablesOf + ): SDKResult { + const res = await request(this.#ctx, { + query: UserByEmailDocument, + variables, + }); + + return unwrapData(res, (q) => q.userByEmail || null); + } + /** * Get a paginated list of customers. */