Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-hairs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@team-plain/typescript-sdk': minor
---

Rename `userByEmail` to `getUserByEmail` and deprecate old method.
15 changes: 15 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class PlainClient {

/**
* Get a paginated list of customers.
* @deprecated "use `getUserByEmail" instead
*/
async userByEmail(
variables: VariablesOf<typeof UserByEmailDocument>
Expand All @@ -124,6 +125,20 @@ export class PlainClient {
return unwrapData(res, (q) => q.userByEmail || null);
}

/**
* Get a paginated list of customers.
*/
async getUserByEmail(
variables: VariablesOf<typeof UserByEmailDocument>
): SDKResult<UserPartsFragment | null> {
const res = await request(this.#ctx, {
query: UserByEmailDocument,
variables,
});

return unwrapData(res, (q) => q.userByEmail || null);
}

/**
* Get a paginated list of customers.
*/
Expand Down