Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use armory sdk #524

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/devtool/src/app/_hooks/useAccountSignature.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Curves, KeyTypes, PublicKey, SigningAlg, hexToBase64Url } from '@narval/signature'
import { Curves, KeyTypes, PublicKey, SigningAlg, hexToBase64Url } from '@narval/armory-sdk'
import { signMessage } from '@wagmi/core'
import { useEffect, useState } from 'react'
import { useAccount } from 'wagmi'
Expand Down
4 changes: 2 additions & 2 deletions apps/devtool/src/app/_hooks/useAuthServerApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
AuthorizationRequestStatus,
EntityStoreClient,
Evaluate,
Request
Request,
SigningAlg
} from '@narval/armory-sdk'
import { SigningAlg } from '@narval/signature'
import { useMemo, useState } from 'react'
import { SetOptional } from 'type-fest'
import { extractErrorMessage, getUrlProtocol } from '../_lib/utils'
Expand Down
9 changes: 5 additions & 4 deletions apps/devtool/src/app/_hooks/useDataStoreApi.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { EntityStoreClient, PolicyStoreClient } from '@narval/armory-sdk'
import {
Entities,
EntityData,
EntityStore,
EntityStoreClient,
EntityUtil,
Policy,
PolicyData,
PolicyStore
} from '@narval/policy-engine-shared'
import { SigningAlg } from '@narval/signature'
PolicyStore,
PolicyStoreClient,
SigningAlg
} from '@narval/armory-sdk'
import { useEffect, useMemo, useState } from 'react'
import { backOff, extractErrorMessage, getHost, isValidUrl } from '../_lib/utils'
import useAccountSignature from './useAccountSignature'
Expand Down
4 changes: 2 additions & 2 deletions apps/devtool/src/app/_hooks/useEngineApi.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
EngineClientConfig,
EvaluationRequest,
SigningAlg,
onboardEngineClient,
pingEngine,
sendEvaluationRequest,
syncPolicyEngine
} from '@narval/armory-sdk'
import { EvaluationRequest } from '@narval/policy-engine-shared'
import { SigningAlg } from '@narval/signature'
import { useMemo, useState } from 'react'
import { extractErrorMessage, getUrlProtocol } from '../_lib/utils'
import useAccountSignature from './useAccountSignature'
Expand Down
11 changes: 8 additions & 3 deletions apps/devtool/src/app/_hooks/useVaultApi.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import {
Alg,
DeriveAccountRequest,
GenerateKeyRequest,
ImportPrivateKeyRequest,
ImportSeedRequest,
Jwk,
Request,
RsaPublicKey,
SigningAlg,
VaultAdminClient,
VaultClient
VaultClient,
rsaKeyToKid,
rsaPublicKeySchema
} from '@narval/armory-sdk'
import { Request } from '@narval/policy-engine-shared'
import { Alg, Jwk, RsaPublicKey, SigningAlg, rsaKeyToKid, rsaPublicKeySchema } from '@narval/signature'
import { exportJWK, importSPKI } from 'jose'
import { useMemo, useState } from 'react'
import { extractErrorMessage, getHost, isValidUrl } from '../_lib/utils'
Expand Down
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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/armory-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@narval-xyz/armory-sdk",
"version": "0.8.1",
"version": "0.8.2",
"license": "MPL-2.0",
"publishConfig": {
"access": "public"
Expand Down
48 changes: 33 additions & 15 deletions packages/armory-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,65 @@ export * from './lib/vault'

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

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

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

export type {
AccountEntity,
Address,
CredentialEntity,
Decision,
Entities,
EvaluationRequest,
Hex,
Policy,
PolicyCriterion,
UserAccountEntity,
UserEntity
} from '@narval/policy-engine-shared'

export {
AccessToken,
AccountType,
Action,
CreateAuthorizationRequest,
Criterion,
Decision,
Eip712TypedData,
EntityData,
EntityStore,
EntityType,
EntityUtil,
JwtString,
PolicyData,
PolicyStore,
Request,
Then,
TransactionRequest,
UserRole,
ValueOperators
ValueOperators,
getAddress,
hexSchema,
isAddress,
toHex
} from '@narval/policy-engine-shared'

export type {
AccountEntity,
Address,
Entities,
Hex,
Policy,
PolicyCriterion,
UserEntity
} from '@narval/policy-engine-shared'

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