Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Add didWallet to identity-provider type enum
Browse files Browse the repository at this point in the history
Fix type errors
  • Loading branch information
CITIZENDOT committed Aug 15, 2024
1 parent f81e9e8 commit 62ea541
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/client-core/src/user/services/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
AvatarID,
IdentityProviderType,
InstanceID,
ProviderType,
UserApiKeyType,
UserAvatarPatch,
UserID,
Expand Down Expand Up @@ -332,7 +333,7 @@ export const AuthService = {
identityProvider: {
id: '',
token: '',
type: 'didWallet',
type: 'didWallet' as ProviderType,
userId: walletUser.id,
createdAt: '',
updatedAt: ''
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/interfaces/AuthUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const IdentityProviderSeed: IdentityProviderType = {
accountIdentifier: '',
oauthToken: '',
oauthRefreshToken: '',
type: '',
type: 'guest',
userId: '' as UserID,
createdAt: '',
updatedAt: ''
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/schemas/social/invite.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const inviteSchema = Type.Object(
format: 'uuid'
}),
token: Type.Optional(Type.String()),

// @ts-ignore
identityProviderType: Type.Optional(StringEnum(identityProviderTypes)),
passcode: Type.Optional(Type.String()),
targetObjectId: Type.Optional(Type.String()),
Expand Down
7 changes: 5 additions & 2 deletions packages/common/src/schemas/user/generate-token.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ Ethereal Engine. All Rights Reserved.

// For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html
import type { Static } from '@feathersjs/typebox'
import { getValidator, querySyntax, Type } from '@feathersjs/typebox'
import { getValidator, querySyntax, StringEnum, Type } from '@feathersjs/typebox'

import { dataValidator, queryValidator } from '../validators'
import { identityProviderTypes } from './identity-provider.schema'

export const generateTokenPath = 'generate-token'

Expand All @@ -37,7 +38,9 @@ export const generateTokenMethods = ['create'] as const
export const generateTokenSchema = Type.Object(
{
token: Type.String(),
type: Type.String()

// @ts-ignore
type: Type.Optional(StringEnum(identityProviderTypes))
},
{ $id: 'GenerateToken', additionalProperties: false }
)
Expand Down
5 changes: 4 additions & 1 deletion packages/common/src/schemas/user/identity-provider.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ export const identityProviderTypes = [
'linkedin',
'auth0',
'guest',
'admin'
'admin',
'didWallet'
] as const

export type ProviderType = (typeof identityProviderTypes)[number]

// Main data model schema
export const identityProviderSchema = Type.Object(
{
Expand Down

0 comments on commit 62ea541

Please sign in to comment.