Skip to content

Commit

Permalink
feat: add identities to sdk (#2022)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark authored Aug 19, 2024
1 parent 85904d4 commit a532369
Show file tree
Hide file tree
Showing 3 changed files with 623 additions and 537 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-carpets-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@unkey/api": minor
---

add identities
70 changes: 70 additions & 0 deletions packages/api/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,76 @@ export class Unkey {
},
};
}
public get identities() {
return {
create: async (
req: paths["/v1/identities.createIdentity"]["post"]["requestBody"]["content"]["application/json"],
): Promise<
Result<
paths["/v1/identities.createIdentity"]["post"]["responses"]["200"]["content"]["application/json"]
>
> => {
return await this.fetch({
path: ["v1", "identities.createIdentity"],
method: "POST",
body: req,
});
},
get: async (
req: paths["/v1/identities.getIdentity"]["get"]["parameters"]["query"],
): Promise<
Result<
paths["/v1/identities.getIdentity"]["get"]["responses"]["200"]["content"]["application/json"]
>
> => {
return await this.fetch({
path: ["v1", "identities.getIdentity"],
method: "GET",
query: req,
});
},
list: async (
req: paths["/v1/identities.listIdentities"]["get"]["parameters"]["query"],
): Promise<
Result<
paths["/v1/identities.listIdentities"]["get"]["responses"]["200"]["content"]["application/json"]
>
> => {
return await this.fetch({
path: ["v1", "identities.listIdentities"],
method: "GET",
query: req,
});
},
delete: async (
req: paths["/v1/identities.deleteIdentity"]["post"]["requestBody"]["content"]["application/json"],
): Promise<
Result<
paths["/v1/identities.deleteIdentity"]["post"]["responses"]["200"]["content"]["application/json"]
>
> => {
return await this.fetch({
path: ["v1", "identities.deleteIdentity"],
method: "POST",
body: req,
});
},
update: async (
req: paths["/v1/identities.updateIdentity"]["post"]["requestBody"]["content"]["application/json"],
): Promise<
Result<
paths["/v1/identities.updateIdentity"]["post"]["responses"]["200"]["content"]["application/json"]
>
> => {
return await this.fetch({
path: ["v1", "identities.updateIdentity"],
method: "POST",
body: req,
});
},
};
}

public get migrations() {
return {
createKeys: async (
Expand Down
Loading

1 comment on commit a532369

@vercel
Copy link

@vercel vercel bot commented on a532369 Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

planetfall – ./apps/planetfall

planetfall-git-main-unkey.vercel.app
planetfall-unkey.vercel.app
planetfall-two.vercel.app
planetfall.unkey.dev

Please sign in to comment.