From 1ae76754c8abeec24500c50fb7a800d709cef89a Mon Sep 17 00:00:00 2001 From: Ken'ichiro Oyama Date: Wed, 21 Jan 2026 18:15:07 +0900 Subject: [PATCH 1/2] feat(types): Add tailor.idp namespace type definitions --- packages/types/tailor.d.ts | 126 +++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/packages/types/tailor.d.ts b/packages/types/tailor.d.ts index df3ee5c..c3ac1c9 100644 --- a/packages/types/tailor.d.ts +++ b/packages/types/tailor.d.ts @@ -277,6 +277,132 @@ interface TailorDBFileAPI { ): Promise; } +declare namespace tailor.idp { + /** + * Configuration for creating an IDP Client + */ + interface ClientConfig { + namespace: string; + } + + /** + * User object returned from IDP operations + */ + interface User { + id: string; + name: string; + disabled: boolean; + createdAt?: string; + updatedAt?: string; + } + + /** + * Query options for filtering users + */ + interface UserQuery { + /** Filter by user IDs */ + ids?: string[]; + /** Filter by user names */ + names?: string[]; + } + + /** + * Options for listing users + */ + interface ListUsersOptions { + /** Maximum number of users to return */ + first?: number; + /** Page token for pagination */ + after?: string; + /** Query filter for users */ + query?: UserQuery; + } + + /** + * Response from listing users + */ + interface ListUsersResponse { + users: User[]; + nextPageToken: string | null; + totalCount: number; + } + + /** + * Input for creating a new user + */ + interface CreateUserInput { + /** The user's name (typically email) */ + name: string; + /** The user's password */ + password: string; + /** Whether the user is disabled */ + disabled?: boolean; + } + + /** + * Input for updating an existing user + */ + interface UpdateUserInput { + /** The user's ID */ + id: string; + /** New name for the user */ + name?: string; + /** New password for the user */ + password?: string; + /** New disabled status for the user */ + disabled?: boolean; + } + + /** + * Input for sending a password reset email + */ + interface SendPasswordResetEmailInput { + /** The ID of the user */ + userId: string; + /** The URI to redirect to after password reset */ + redirectUri: string; + } + + /** + * IDP Client for user management operations + */ + class Client { + constructor(config: ClientConfig); + + /** + * List users in the namespace with optional filtering and pagination. + */ + users(options?: ListUsersOptions): Promise; + + /** + * Get a user by ID. + */ + user(userId: string): Promise; + + /** + * Create a new user. + */ + createUser(input: CreateUserInput): Promise; + + /** + * Update an existing user. + */ + updateUser(input: UpdateUserInput): Promise; + + /** + * Delete a user by ID. + * @returns True if successful + */ + deleteUser(userId: string): Promise; + + /** + * Send a password reset email to a user. + * @returns True if successful + */ + sendPasswordResetEmail(input: SendPasswordResetEmailInput): Promise; + } +} + declare namespace tailor.workflow { /** * Specifies the machine user that should be used to execute the workflow. From 12074b7765f15ec757f983fe6a530d818f3a4ac9 Mon Sep 17 00:00:00 2001 From: Ken'ichiro Oyama Date: Wed, 21 Jan 2026 18:20:24 +0900 Subject: [PATCH 2/2] chore(types): add changeset file --- .changeset/add-idp-types.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/add-idp-types.md diff --git a/.changeset/add-idp-types.md b/.changeset/add-idp-types.md new file mode 100644 index 0000000..8022e5b --- /dev/null +++ b/.changeset/add-idp-types.md @@ -0,0 +1,5 @@ +--- +"@tailor-platform/function-types": patch +--- + +feat: Add tailor.idp namespace type definitions