feat: create auth provider identity (#8675)

This commit is contained in:
Christian authored and GitHub committed 2024-08-20 16:38:06 +02:00
1 parent 3706bf51af
commit 29830f0077
3 files changed
+142 -5

No files matched your search

+50 -3
View File
@@ -1,14 +1,16 @@
import { FindConfig } from "../common"
import { IModuleService } from "../modules-sdk"
import { Context } from "../shared-context"
import {
AuthIdentityDTO,
AuthenticationInput,
AuthenticationResponse,
CreateAuthIdentityDTO,
CreateProviderIdentityDTO,
FilterableAuthIdentityProps,
ProviderIdentityDTO,
UpdateAuthIdentityDTO,
} from "./common"
import { Context } from "../shared-context"
import { FindConfig } from "../common"
import { IModuleService } from "../modules-sdk"
/**
* The main service interface for the Auth Module.
@@ -274,4 +276,49 @@ export interface IAuthModuleService extends IModuleService {
* await authModuleService.deleteAuthIdentities(["authusr_123", "authusr_321"])
*/
deleteAuthIdentities(ids: string[], sharedContext?: Context): Promise<void>
/**
* This method creates provider identities.
*
* @param {CreateProviderIdentityDTO[]} data - The provider identities to be created.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<ProviderIdentityDTO[]>} The created provider identities.
*
* @example
* const providerIdentities = await authModuleService.createProviderIdentities([
* {
* provider: "emailpass",
* entity_id: "user@example.com",
* auth_identity_id: "uid_1"
* },
* {
* provider: "github",
* entity_id: "github_handle",
* auth_identity_id: "uid_1"
* },
* ])
*/
createProviderIdentities(
data: CreateProviderIdentityDTO[],
sharedContext?: Context
): Promise<ProviderIdentityDTO[]>
/**
* This method creates a provider identity.
*
* @param {CreateProviderIdentityDTO} data - The provider identity to be created.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<ProviderIdentityDTO>} The created provider identity.
*
* @example
* const providerIdentity = await authModuleService.createProviderIdentities({
* provider: "github",
* entity_id: "github_handle",
* auth_identity_id: "uid_1"
* })
*/
createProviderIdentities(
data: CreateProviderIdentityDTO,
sharedContext?: Context
): Promise<ProviderIdentityDTO>
}