Skip to content

Commit

Permalink
Make only use of armory sdk inside entity manager
Browse files Browse the repository at this point in the history
  • Loading branch information
samteb committed Aug 29, 2024
1 parent 775f072 commit a323af8
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
Entities,
EntityUtil,
UserAccountEntity,
UserEntity
} from '@narval/policy-engine-shared'
import { hash } from '@narval/signature'
UserEntity,
hash
} from '@narval/armory-sdk'
import { useEffect, useState } from 'react'
import { z } from 'zod'
import CodeEditor from '../../_components/CodeEditor'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { faTrash, faUnlink } from '@fortawesome/free-solid-svg-icons'
import { AccountEntity } from '@narval/policy-engine-shared'
import { AccountEntity } from '@narval/armory-sdk'
import NarIconButtonWithTooltip from '../../../_design-system/NarIconButtonWithTooltip'

interface AccountCardProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { faTrash } from '@fortawesome/free-solid-svg-icons'
import { CredentialEntity } from '@narval/policy-engine-shared'
import { CredentialEntity } from '@narval/armory-sdk'
import NarIconButtonWithTooltip from '../../../_design-system/NarIconButtonWithTooltip'

interface CredentialCardProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
faTrash,
faWallet
} from '@fortawesome/free-solid-svg-icons'
import { UserEntity } from '@narval/policy-engine-shared'
import { UserEntity } from '@narval/armory-sdk'
import * as Collapsible from '@radix-ui/react-collapsible'
import { capitalize } from 'lodash/fp'
import { useState } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use client'

import { faXmarkCircle } from '@fortawesome/free-solid-svg-icons'
import { Permission } from '@narval/armory-sdk'
import { AccountType, Action, Entities, EntityUtil, hexSchema } from '@narval/policy-engine-shared'
import { AccountType, Action, Entities, EntityUtil, Permission, hexSchema } from '@narval/armory-sdk'
import { parseInt } from 'lodash'
import { Dispatch, FC, SetStateAction, useState } from 'react'
import { v4 as uuid } from 'uuid'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

import { faCheckCircle, faWallet, faXmarkCircle } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { GenerateKeyResponse, Permission } from '@narval/armory-sdk'
import { AccountType, Action, Entities, EntityUtil, hexSchema } from '@narval/policy-engine-shared'
import {
AccountType,
Action,
Entities,
EntityUtil,
GenerateKeyResponse,
Permission,
hexSchema
} from '@narval/armory-sdk'
import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react'
import { v4 as uuid } from 'uuid'
import ValueWithCopy from '../../../_components/ValueWithCopy'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use client'

import { faXmarkCircle } from '@fortawesome/free-solid-svg-icons'
import { Permission } from '@narval/armory-sdk'
import { AccountEntity, AccountType, Action, Entities, getAddress } from '@narval/policy-engine-shared'
import { Hex } from '@narval/signature'
import { AccountEntity, AccountType, Action, Entities, Hex, Permission, getAddress } from '@narval/armory-sdk'
import { Dispatch, SetStateAction, useState } from 'react'
import { v4 as uuid } from 'uuid'
import NarButton from '../../../_design-system/NarButton'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { AccountEntity, AccountType, getAddress, isAddress } from '@narval/policy-engine-shared'
import { AccountEntity, AccountType, getAddress, isAddress } from '@narval/armory-sdk'
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
import NarInput from '../../../_design-system/NarInput'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountEntity, UserAccountEntity, UserEntity } from '@narval/policy-engine-shared'
import { AccountEntity, UserAccountEntity, UserEntity } from '@narval/armory-sdk'
import { Dispatch, FC, SetStateAction, useCallback } from 'react'
import MultiSelectList from '../MultiselectList'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { CredentialEntity, UserEntity, isAddress } from '@narval/policy-engine-shared'
import { Curves, KeyTypes, SigningAlg, jwkEoaSchema, publicKeySchema } from '@narval/signature'
import {
CredentialEntity,
Curves,
KeyTypes,
SigningAlg,
UserEntity,
isAddress,
jwkEoaSchema,
publicKeySchema
} from '@narval/armory-sdk'
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
import NarButton from '../../../_design-system/NarButton'
import NarInput from '../../../_design-system/NarInput'
Expand Down
13 changes: 11 additions & 2 deletions apps/devtool/src/app/entity-manager/_components/forms/UserForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { faChevronDown } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { CredentialEntity, UserEntity, UserRole, isAddress } from '@narval/policy-engine-shared'
import { Curves, KeyTypes, SigningAlg, jwkEoaSchema, publicKeySchema } from '@narval/signature'
import {
CredentialEntity,
Curves,
KeyTypes,
SigningAlg,
UserEntity,
UserRole,
isAddress,
jwkEoaSchema,
publicKeySchema
} from '@narval/armory-sdk'
import { capitalize } from 'lodash'
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
import { v4 as uuid } from 'uuid'
Expand Down
42 changes: 26 additions & 16 deletions packages/armory-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,57 @@ export * from './lib/vault'

export { resourceId } from './lib/utils'

export type { Alg, PrivateKey, PublicKey, RsaPublicKey, SigningAlg } from '@narval/signature'
export type { Alg, PrivateKey, PublicKey, RsaPublicKey } from '@narval/signature'

export {
Curves,
KeyTypes,
SigningAlg,
base64UrlToHex,
buildSignerEip191,
buildSignerForAlg,
eip191Hash,
getPublicKey,
hash,
hexToBase64Url,
jwkEoaSchema,
jwkSchema,
privateKeyToJwk,
publicKeySchema,
publicKeyToJwk,
signJwt
} from '@narval/signature'

export {
export type {
AccessToken,
AccountType,
Action,
AccountEntity,
Address,
CreateAuthorizationRequest,
CredentialEntity,
Criterion,
Decision,
Eip712TypedData,
Entities,
EntityType,
Hex,
JwtString,
Policy,
PolicyCriterion,
Request,
Then,
TransactionRequest,
UserRole,
ValueOperators
UserAccountEntity,
UserEntity,
ValueOperators,
} from '@narval/policy-engine-shared'

export type {
AccountEntity,
Address,
Entities,
Hex,
Policy,
PolicyCriterion,
UserEntity
export {
AccountType,
Action,
EntityUtil,
UserRole,
getAddress,
hexSchema,
isAddress,
toHex
} from '@narval/policy-engine-shared'

export { EntityUtil, getAddress, toHex } from '@narval/policy-engine-shared'

0 comments on commit a323af8

Please sign in to comment.