= string &
{
[P in keyof T]: { '_ value': T[P] };
diff --git a/ui/src/logic/useSystemUpdate.tsx b/ui/src/logic/useSystemUpdate.tsx
index 223f78b2..3ebad797 100644
--- a/ui/src/logic/useSystemUpdate.tsx
+++ b/ui/src/logic/useSystemUpdate.tsx
@@ -1,4 +1,4 @@
-import { kilnBump, Pike } from '@urbit/api';
+import { kilnBump, Pike } from '@/gear';
import { partition, pick } from 'lodash';
import { useCallback } from 'react';
import { useHistory } from 'react-router-dom';
diff --git a/ui/src/logic/utils.ts b/ui/src/logic/utils.ts
index 6138b104..7db872ff 100644
--- a/ui/src/logic/utils.ts
+++ b/ui/src/logic/utils.ts
@@ -1,6 +1,6 @@
import { Yarn, isYarnEmph, isYarnShip } from '@/types/hark';
import { findLast } from 'lodash';
-import { Docket, DocketHref, Treaty } from '@urbit/api';
+import { Docket, DocketHref, Treaty } from '@/gear';
import { hsla, parseToHsla, parseToRgba } from 'color2k';
import _ from 'lodash';
import { differenceInDays, endOfToday, format } from 'date-fns';
@@ -44,13 +44,6 @@ export function handleDropdownLink(
};
}
-export function deSig(ship: string): string {
- if (!ship) {
- return '';
- }
- return ship.replace('~', '');
-}
-
export function normalizeUrbitColor(color: string): string {
if (color.startsWith('#')) {
return color;
diff --git a/ui/src/main.tsx b/ui/src/main.tsx
index 736b6dad..8444e279 100644
--- a/ui/src/main.tsx
+++ b/ui/src/main.tsx
@@ -1,4 +1,4 @@
-import { preSig } from '@urbit/api';
+import { preSig } from '@urbit/aura';
import cookies from 'browser-cookies';
import React from 'react';
import ReactDOM from 'react-dom';
diff --git a/ui/src/mocks/mockContacts.ts b/ui/src/mocks/mockContacts.ts
index d4a93607..3270acfe 100644
--- a/ui/src/mocks/mockContacts.ts
+++ b/ui/src/mocks/mockContacts.ts
@@ -1,4 +1,4 @@
-import { Rolodex } from '@urbit/api';
+import { Rolodex } from '@/gear';
const mockContacts: Rolodex = {
'~finned-palmer': {
diff --git a/ui/src/nav/SystemMenu.tsx b/ui/src/nav/SystemMenu.tsx
index 5dd8259a..0884f762 100644
--- a/ui/src/nav/SystemMenu.tsx
+++ b/ui/src/nav/SystemMenu.tsx
@@ -3,7 +3,7 @@ import classNames from 'classnames';
import clipboardCopy from 'clipboard-copy';
import React, { HTMLAttributes, useCallback, useState } from 'react';
import { Link, Route, useHistory } from 'react-router-dom';
-import { Pike } from '@urbit/api';
+import { Pike } from '@/gear';
import { Adjust } from '../components/icons/Adjust';
import { usePike } from '../state/kiln';
import { disableDefault, handleDropdownLink } from '@/logic/utils';
diff --git a/ui/src/nav/notifications/Notification.tsx b/ui/src/nav/notifications/Notification.tsx
index 683d81ba..2808e691 100644
--- a/ui/src/nav/notifications/Notification.tsx
+++ b/ui/src/nav/notifications/Notification.tsx
@@ -12,7 +12,7 @@ import { ShipName } from '../../components/ShipName';
import { DeskLink } from '../../components/DeskLink';
import { DocketImage } from '../../components/DocketImage';
import GroupAvatar from '../../components/GroupAvatar';
-import { Charge } from '@urbit/api';
+import { Charge } from '@/gear';
import { useSawRopeMutation } from '@/state/hark';
interface NotificationProps {
diff --git a/ui/src/nav/search/Apps.tsx b/ui/src/nav/search/Apps.tsx
index 7bcb7d64..5b255bf7 100644
--- a/ui/src/nav/search/Apps.tsx
+++ b/ui/src/nav/search/Apps.tsx
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useMemo } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import fuzzy from 'fuzzy';
-import { Treaty } from '@urbit/api';
+import { Treaty } from '@/gear';
import { ShipName } from '../../components/ShipName';
import { useAllyTreaties } from '../../state/docket';
import { useAppSearchStore } from '../Nav';
diff --git a/ui/src/nav/search/Providers.tsx b/ui/src/nav/search/Providers.tsx
index f861844c..39748166 100644
--- a/ui/src/nav/search/Providers.tsx
+++ b/ui/src/nav/search/Providers.tsx
@@ -1,8 +1,8 @@
import React, { useEffect, useMemo } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import fuzzy from 'fuzzy';
-import { Provider, deSig } from '@urbit/api';
-import * as ob from 'urbit-ob';
+import { deSig, isValidPatp } from '@urbit/aura';
+import { Provider } from '@/gear';
import { MatchItem, useAppSearchStore } from '../Nav';
import { useAllies, useCharges } from '../../state/docket';
import { ProviderList } from '../../components/ProviderList';
@@ -59,14 +59,14 @@ export const Providers = ({ match }: ProvidersProps) => {
);
const patp = `~${deSig(search) || ''}`;
- const isValidPatp = ob.isValidPatp(patp);
+ const isValid = isValidPatp(patp);
const results = useMemo(() => {
if (!allies) {
return [];
}
const exact =
- isValidPatp && !Object.keys(allies).includes(patp)
+ isValid && !Object.keys(allies).includes(patp)
? [
{
shipName: patp,
@@ -109,7 +109,7 @@ export const Providers = ({ match }: ProvidersProps) => {
}))
: [];
- const newProviderMatches = isValidPatp
+ const newProviderMatches = isValid
? [
{
url: `/search/${patp}/apps`,
@@ -128,7 +128,7 @@ export const Providers = ({ match }: ProvidersProps) => {
),
});
}
- }, [results, patp, isValidPatp]);
+ }, [results, patp, isValid]);
return (
= {
+const coinFlip = () => Math.random() > 0.5;
+
+const makeSeal: () => Seal = () => {
+ return [
+ // write perm
+ {
+ vane: null,
+ name: 'write',
+ hoon: '[%write & %some-agent]',
+ tail: {
+ dude: null,
+ jump: coinFlip()
+ }
+ },
+ // reads perm
+ {
+ vane: null,
+ name: 'reads',
+ hoon: '[%reads %g `%u `%settings-store /]',
+ tail: {
+ vane: 'gall',
+ care: 'u',
+ desk: 'landscape',
+ spur: '/',
+ }
+ }
+ ]
+}
+
+export const appMetaData: Pick = {
cass: {
da: '~2021.9.13..05.41.04..ae65',
ud: 1
@@ -25,7 +55,9 @@ export const appMetaData: Pick ({ glob: { base } });
@@ -345,7 +377,9 @@ export const mockPikes: Pikes = {
sync: null,
zest: 'dead',
wefts: [],
- hash: '0v19.q7u27.omps3.fbhf4.53rai.co157.pben7.pu94n.63v4p.3kcb7.iafj0'
+ hash: '0v19.q7u27.omps3.fbhf4.53rai.co157.pben7.pu94n.63v4p.3kcb7.iafj0',
+ perms: [],
+ lacks: [],
},
garden: {
sync: {
@@ -354,7 +388,9 @@ export const mockPikes: Pikes = {
},
zest: 'live',
wefts: [],
- hash: '0v18.hbbs6.onu15.skjkv.qrfgl.vf4oo.0igo5.2q0d3.6r3r8.2dkmo.oa04m'
+ hash: '0v18.hbbs6.onu15.skjkv.qrfgl.vf4oo.0igo5.2q0d3.6r3r8.2dkmo.oa04m',
+ perms: [],
+ lacks: [],
},
landscape: {
sync: {
@@ -363,12 +399,16 @@ export const mockPikes: Pikes = {
},
zest: 'live',
wefts: [],
- hash: '0v1t.qln8k.cskmt.cn6lv.gu335.jfba6.kte90.iqqn3.aj67b.t389a.8imuo'
+ hash: '0v1t.qln8k.cskmt.cn6lv.gu335.jfba6.kte90.iqqn3.aj67b.t389a.8imuo',
+ perms: [],
+ lacks: [],
},
base: {
sync: null,
zest: 'live',
wefts: [],
- hash: '0v1e.b5auh.6u82i.hqk1r.22kli.4ubef.a1cbo.3g532.6l49k.g0i8e.t6eid'
+ hash: '0v1e.b5auh.6u82i.hqk1r.22kli.4ubef.a1cbo.3g532.6l49k.g0i8e.t6eid',
+ perms: [],
+ lacks: [],
}
};
diff --git a/ui/src/state/settings.ts b/ui/src/state/settings.ts
index eb6cca64..caac3eb3 100644
--- a/ui/src/state/settings.ts
+++ b/ui/src/state/settings.ts
@@ -1,5 +1,5 @@
/* eslint-disable no-param-reassign */
-import { DelBucket, DelEntry, PutBucket, Value } from '@urbit/api';
+import { DelBucket, DelEntry, PutBucket, Value } from '@/gear';
import _ from 'lodash';
import api from '../api';
import useReactQuerySubscription from '@/logic/useReactQuerySubscription';
@@ -8,7 +8,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import produce from 'immer';
interface PutEntry {
- // this is defined here because the PutEntry type in @urbit/api is missing the desk field
+ // this is defined here because the PutEntry type in @/gear is missing the desk field
'put-entry': {
'bucket-key': string;
'entry-key': string;
diff --git a/ui/src/state/storage/index.ts b/ui/src/state/storage/index.ts
index 430ee8ce..6f714fc6 100644
--- a/ui/src/state/storage/index.ts
+++ b/ui/src/state/storage/index.ts
@@ -7,7 +7,7 @@ import {
reduceStateN,
BaseState,
} from '../base';
-import { S3Credentials } from '@urbit/api';
+import { StorageCredentials } from '@/gear';
enableMapSet();
@@ -22,7 +22,7 @@ export interface BaseStorageState {
currentBucket: string;
region: string;
};
- credentials: S3Credentials | null;
+ credentials: StorageCredentials | null;
};
[ref: string]: unknown;
}
diff --git a/ui/src/state/storage/reducer.ts b/ui/src/state/storage/reducer.ts
index d75f7345..9f5ffadc 100644
--- a/ui/src/state/storage/reducer.ts
+++ b/ui/src/state/storage/reducer.ts
@@ -1,11 +1,11 @@
-import { S3Update } from '@urbit/api';
+import { StorageUpdate } from '@/gear';
import _ from 'lodash';
import { BaseState } from '../base';
import { StorageState as State } from '.';
type StorageState = State & BaseState;
-const credentials = (json: S3Update, state: StorageState): StorageState => {
+const credentials = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'credentials', false);
if (data) {
state.s3.credentials = data;
@@ -13,7 +13,7 @@ const credentials = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const configuration = (json: S3Update, state: StorageState): StorageState => {
+const configuration = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'configuration', false);
if (data) {
state.s3.configuration = {
@@ -25,7 +25,7 @@ const configuration = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const currentBucket = (json: S3Update, state: StorageState): StorageState => {
+const currentBucket = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'setCurrentBucket', false);
if (data && state.s3) {
state.s3.configuration.currentBucket = data;
@@ -33,7 +33,7 @@ const currentBucket = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const region = (json: S3Update, state: StorageState): StorageState => {
+const region = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'setRegion', false);
if (data && state.s3) {
state.s3.configuration.region = data;
@@ -41,7 +41,7 @@ const region = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const addBucket = (json: S3Update, state: StorageState): StorageState => {
+const addBucket = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'addBucket', false);
if (data) {
state.s3.configuration.buckets = state.s3.configuration.buckets.add(data);
@@ -49,7 +49,7 @@ const addBucket = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const removeBucket = (json: S3Update, state: StorageState): StorageState => {
+const removeBucket = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'removeBucket', false);
if (data) {
state.s3.configuration.buckets.delete(data);
@@ -57,7 +57,7 @@ const removeBucket = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const endpoint = (json: S3Update, state: StorageState): StorageState => {
+const endpoint = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'setEndpoint', false);
if (data && state.s3.credentials) {
state.s3.credentials.endpoint = data;
@@ -65,7 +65,7 @@ const endpoint = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const accessKeyId = (json: S3Update, state: StorageState): StorageState => {
+const accessKeyId = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'setAccessKeyId', false);
if (data && state.s3.credentials) {
state.s3.credentials.accessKeyId = data;
@@ -73,7 +73,7 @@ const accessKeyId = (json: S3Update, state: StorageState): StorageState => {
return state;
};
-const secretAccessKey = (json: S3Update, state: StorageState): StorageState => {
+const secretAccessKey = (json: StorageUpdate, state: StorageState): StorageState => {
const data = _.get(json, 'setSecretAccessKey', false);
if (data && state.s3.credentials) {
state.s3.credentials.secretAccessKey = data;
diff --git a/ui/src/tiles/Tile.tsx b/ui/src/tiles/Tile.tsx
index e9d5848f..2fcce08d 100644
--- a/ui/src/tiles/Tile.tsx
+++ b/ui/src/tiles/Tile.tsx
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import React, { FunctionComponent } from 'react';
import { useDrag } from 'react-dnd';
-import { chadIsRunning } from '@urbit/api';
+import { chadIsRunning } from '@/gear';
import { TileMenu } from './TileMenu';
import { Spinner } from '../components/Spinner';
import { getAppHref } from '@/logic/utils';
diff --git a/ui/src/tiles/TileMenu.tsx b/ui/src/tiles/TileMenu.tsx
index bd6d1f90..2df238aa 100644
--- a/ui/src/tiles/TileMenu.tsx
+++ b/ui/src/tiles/TileMenu.tsx
@@ -2,7 +2,7 @@ import React, { ReactElement, useCallback, useState } from 'react';
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
import classNames from 'classnames';
import { Link } from 'react-router-dom';
-import { Chad, chadIsRunning } from '@urbit/api';
+import { Chad, chadIsRunning } from '@/gear';
import useDocketState from '../state/docket';
import { disableDefault, handleDropdownLink } from '@/logic/utils';
import { useMedia } from '../logic/useMedia';