Skip to content
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
12 changes: 6 additions & 6 deletions src/client/handlers/GestaltsActionsGetByIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import type {
} from '../types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { GestaltAction } from '../../gestalts/types';
import type { IdentityId, ProviderId } from '../../ids/index';
import type { IdentityId, ProviderId } from '../../ids';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsActionsGetByIdentity extends UnaryHandler<
{
Expand All @@ -36,8 +36,8 @@ class GestaltsActionsGetByIdentity extends UnaryHandler<
}: { providerId: ProviderId; identityId: IdentityId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['providerId'], () => validationUtils.parseProviderId(value)],
[['identityId'], () => validationUtils.parseIdentityId(value)],
[['providerId'], () => ids.parseProviderId(value)],
[['identityId'], () => ids.parseIdentityId(value)],
() => value,
);
},
Expand Down
10 changes: 5 additions & 5 deletions src/client/handlers/GestaltsActionsGetByNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import type {
} from '../types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { GestaltAction } from '../../gestalts/types';
import type { NodeId } from '../../ids/index';
import type { NodeId } from '../../ids';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsActionsGetByNode extends UnaryHandler<
{
Expand All @@ -28,7 +28,7 @@ class GestaltsActionsGetByNode extends UnaryHandler<
const { nodeId }: { nodeId: NodeId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['nodeId'], () => validationUtils.parseNodeId(value)],
[['nodeId'], () => ids.parseNodeId(value)],
() => value,
);
},
Expand Down
15 changes: 8 additions & 7 deletions src/client/handlers/GestaltsActionsSetByIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import type {
ClientRPCResponseResult,
SetIdentityActionMessage,
} from '../types';
import type { IdentityId, ProviderId } from '../../ids/index';
import type { IdentityId, ProviderId } from '../../ids';
import type { GestaltAction } from '../../gestalts/types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import * as gestaltsUtils from '../../gestalts/utils';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsActionsSetByIdentityHandler extends UnaryHandler<
{
Expand All @@ -35,9 +36,9 @@ class GestaltsActionsSetByIdentityHandler extends UnaryHandler<
} = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['action'], () => validationUtils.parseGestaltAction(value)],
[['providerId'], () => validationUtils.parseProviderId(value)],
[['identityId'], () => validationUtils.parseIdentityId(value)],
[['action'], () => gestaltsUtils.parseGestaltAction(value)],
[['providerId'], () => ids.parseProviderId(value)],
[['identityId'], () => ids.parseIdentityId(value)],
() => value,
);
},
Expand Down
13 changes: 7 additions & 6 deletions src/client/handlers/GestaltsActionsSetByNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import type {
} from '../types';
import type { GestaltAction } from '../../gestalts/types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { NodeId } from '../../ids/index';
import type { NodeId } from '../../ids';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import * as gestaltsUtils from '../../gestalts/utils';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsActionsSetByNode extends UnaryHandler<
{
Expand All @@ -28,8 +29,8 @@ class GestaltsActionsSetByNode extends UnaryHandler<
validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['nodeId'], () => validationUtils.parseNodeId(value)],
[['action'], () => validationUtils.parseGestaltAction(value)],
[['nodeId'], () => ids.parseNodeId(value)],
[['action'], () => gestaltsUtils.parseGestaltAction(value)],
() => value,
);
},
Expand Down
15 changes: 8 additions & 7 deletions src/client/handlers/GestaltsActionsUnsetByIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import type {
ClientRPCResponseResult,
SetIdentityActionMessage,
} from '../types';
import type { IdentityId, ProviderId } from '../../ids/index';
import type { IdentityId, ProviderId } from '../../ids';
import type { GestaltAction } from '../../gestalts/types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import * as gestaltsUtils from '../../gestalts/utils';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsActionsUnsetByIdentity extends UnaryHandler<
{
Expand All @@ -35,9 +36,9 @@ class GestaltsActionsUnsetByIdentity extends UnaryHandler<
} = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['action'], () => validationUtils.parseGestaltAction(value)],
[['providerId'], () => validationUtils.parseProviderId(value)],
[['identityId'], () => validationUtils.parseIdentityId(value)],
[['action'], () => gestaltsUtils.parseGestaltAction(value)],
[['providerId'], () => ids.parseProviderId(value)],
[['identityId'], () => ids.parseIdentityId(value)],
() => value,
);
},
Expand Down
13 changes: 7 additions & 6 deletions src/client/handlers/GestaltsActionsUnsetByNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import type {
} from '../types';
import type { GestaltAction } from '../../gestalts/types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { NodeId } from '../../ids/index';
import type { NodeId } from '../../ids';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import * as gestaltsUtils from '../../gestalts/utils';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsActionsUnsetByNode extends UnaryHandler<
{
Expand All @@ -28,8 +29,8 @@ class GestaltsActionsUnsetByNode extends UnaryHandler<
validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['nodeId'], () => validationUtils.parseNodeId(value)],
[['action'], () => validationUtils.parseGestaltAction(value)],
[['nodeId'], () => ids.parseNodeId(value)],
[['action'], () => gestaltsUtils.parseGestaltAction(value)],
() => value,
);
},
Expand Down
12 changes: 6 additions & 6 deletions src/client/handlers/GestaltsDiscoveryByIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type {
ClientRPCResponseResult,
IdentityMessage,
} from '../types';
import type { IdentityId, ProviderId } from '../../ids/index';
import type { IdentityId, ProviderId } from '../../ids';
import type Discovery from '../../discovery/Discovery';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsDiscoveryByIdentity extends UnaryHandler<
{
Expand All @@ -27,8 +27,8 @@ class GestaltsDiscoveryByIdentity extends UnaryHandler<
}: { providerId: ProviderId; identityId: IdentityId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['providerId'], () => validationUtils.parseProviderId(value)],
[['identityId'], () => validationUtils.parseIdentityId(value)],
[['providerId'], () => ids.parseProviderId(value)],
[['identityId'], () => ids.parseIdentityId(value)],
() => value,
);
},
Expand Down
10 changes: 5 additions & 5 deletions src/client/handlers/GestaltsDiscoveryByNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type {
ClientRPCResponseResult,
NodeIdMessage,
} from '../types';
import type { NodeId } from '../../ids/index';
import type { NodeId } from '../../ids';
import type Discovery from '../../discovery/Discovery';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsDiscoveryByNode extends UnaryHandler<
{
Expand All @@ -24,7 +24,7 @@ class GestaltsDiscoveryByNode extends UnaryHandler<
const { nodeId }: { nodeId: NodeId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['nodeId'], () => validationUtils.parseNodeId(value)],
[['nodeId'], () => ids.parseNodeId(value)],
() => value,
);
},
Expand Down
12 changes: 6 additions & 6 deletions src/client/handlers/GestaltsGestaltGetByIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import type {
GestaltMessage,
IdentityMessage,
} from '../types';
import type { IdentityId, ProviderId } from '../../ids/index';
import type { IdentityId, ProviderId } from '../../ids';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import { UnaryHandler } from '@matrixai/rpc';
import * as nodesUtils from '../../nodes/utils';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsGestaltGetByIdentity extends UnaryHandler<
{
Expand All @@ -31,8 +31,8 @@ class GestaltsGestaltGetByIdentity extends UnaryHandler<
}: { providerId: ProviderId; identityId: IdentityId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['providerId'], () => validationUtils.parseProviderId(value)],
[['identityId'], () => validationUtils.parseIdentityId(value)],
[['providerId'], () => ids.parseProviderId(value)],
[['identityId'], () => ids.parseIdentityId(value)],
() => value,
);
},
Expand Down
10 changes: 5 additions & 5 deletions src/client/handlers/GestaltsGestaltGetByNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import type {
NodeIdMessage,
} from '../types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { NodeId } from '../../ids/index';
import type { NodeId } from '../../ids';
import { UnaryHandler } from '@matrixai/rpc';
import * as nodesUtils from '../../nodes/utils';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsGestaltGetByNode extends UnaryHandler<
{
Expand All @@ -28,7 +28,7 @@ class GestaltsGestaltGetByNode extends UnaryHandler<
const { nodeId }: { nodeId: NodeId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['nodeId'], () => validationUtils.parseNodeId(value)],
[['nodeId'], () => ids.parseNodeId(value)],
() => value,
);
},
Expand Down
12 changes: 6 additions & 6 deletions src/client/handlers/GestaltsGestaltTrustByIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import type {
IdentityMessage,
} from '../types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { IdentityId, ProviderId } from '../../ids/index';
import type { IdentityId, ProviderId } from '../../ids';
import type Discovery from '../../discovery/Discovery';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsGestaltTrustByIdentity extends UnaryHandler<
{
Expand All @@ -31,8 +31,8 @@ class GestaltsGestaltTrustByIdentity extends UnaryHandler<
}: { providerId: ProviderId; identityId: IdentityId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['providerId'], () => validationUtils.parseProviderId(value)],
[['identityId'], () => validationUtils.parseIdentityId(value)],
[['providerId'], () => ids.parseProviderId(value)],
[['identityId'], () => ids.parseIdentityId(value)],
() => value,
);
},
Expand Down
10 changes: 5 additions & 5 deletions src/client/handlers/GestaltsGestaltTrustByNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import type {
NodeIdMessage,
} from '../types';
import type GestaltGraph from '../../gestalts/GestaltGraph';
import type { NodeId } from '../../ids/index';
import type { NodeId } from '../../ids';
import type Discovery from '../../discovery/Discovery';
import { UnaryHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class GestaltsGestaltTrustByNode extends UnaryHandler<
{
Expand All @@ -28,7 +28,7 @@ class GestaltsGestaltTrustByNode extends UnaryHandler<
const { nodeId }: { nodeId: NodeId } = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['nodeId'], () => validationUtils.parseNodeId(value)],
[['nodeId'], () => ids.parseNodeId(value)],
() => value,
);
},
Expand Down
10 changes: 5 additions & 5 deletions src/client/handlers/IdentitiesAuthenticate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import type {
ClientRPCRequestParams,
ClientRPCResponseResult,
} from '../types';
import type { ProviderId } from '../../ids/index';
import type { ProviderId } from '../../ids';
import type IdentitiesManager from '../../identities/IdentitiesManager';
import { ServerHandler } from '@matrixai/rpc';
import * as ids from '../../ids';
import * as identitiesErrors from '../../identities/errors';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync, never } from '../../utils/index';
import { validateSync } from '../../validation';
import { matchSync, never } from '../../utils';

class IdentitiesAuthenticate extends ServerHandler<
{
Expand Down Expand Up @@ -37,7 +37,7 @@ class IdentitiesAuthenticate extends ServerHandler<
} = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['providerId'], () => validationUtils.parseProviderId(value)],
[['providerId'], () => ids.parseProviderId(value)],
() => value,
);
},
Expand Down
10 changes: 5 additions & 5 deletions src/client/handlers/IdentitiesAuthenticatedGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type {
ClientRPCResponseResult,
IdentityMessage,
} from '../types';
import type { ProviderId } from '../../ids/index';
import type { ProviderId } from '../../ids';
import type IdentitiesManager from '../../identities/IdentitiesManager';
import { ServerHandler } from '@matrixai/rpc';
import { validateSync } from '../../validation/index';
import * as validationUtils from '../../validation/utils';
import { matchSync } from '../../utils/index';
import * as ids from '../../ids';
import { validateSync } from '../../validation';
import { matchSync } from '../../utils';

class IdentitiesAuthenticatedGet extends ServerHandler<
{
Expand All @@ -34,7 +34,7 @@ class IdentitiesAuthenticatedGet extends ServerHandler<
providerId = validateSync(
(keyPath, value) => {
return matchSync(keyPath)(
[['providerId'], () => validationUtils.parseProviderId(value)],
[['providerId'], () => ids.parseProviderId(value)],
() => value,
);
},
Expand Down
Loading