Skip to content

Commit e6b3a3c

Browse files
resolve review comments
1 parent 8e72adf commit e6b3a3c

29 files changed

+123
-54
lines changed

src/keri/app/aiding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Tier} from '../../types/keria-api-schema.ts';
1+
import { Tier } from '../core/salter.ts';
22
import { Algos } from '../core/manager.ts';
33
import { incept, interact, reply, rotate } from '../core/eventing.ts';
44
import { b, Ilks, Serials, Vrsn_1_0 } from '../core/core.ts';

src/keri/app/clienting.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { components, Tier } from '../../types/keria-api-schema.ts';
1+
import { components } from '../../types/keria-api-schema.ts';
22
import { Authenticater } from '../core/authing.ts';
33
import { HEADER_SIG_TIME } from '../core/httping.ts';
44
import { ExternalModule, IdentifierManagerFactory } from '../core/keeping.ts';
5+
import { Tier } from '../core/salter.ts';
56

67
import { Identifier } from './aiding.ts';
78
import { Contacts, Challenges } from './contacting.ts';

src/keri/app/controller.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { SaltyCreator } from '../core/manager.ts';
2-
import { Salter } from '../core/salter.ts';
3-
import { Tier} from '../../types/keria-api-schema.ts';
2+
import { Salter, Tier } from '../core/salter.ts';
43
import { MtrDex } from '../core/matter.ts';
54
import { Diger } from '../core/diger.ts';
65
import { incept, rotate, interact } from '../core/eventing.ts';

src/keri/core/keeping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Salter } from './salter.ts';
22
import { Algos, SaltyCreator, RandyCreator } from './manager.ts';
33
import { MtrDex } from './matter.ts';
4-
import { Tier} from '../../types/keria-api-schema.ts';
4+
import { Tier } from './salter.ts';
55
import { Encrypter } from '../core/encrypter.ts';
66
import { Decrypter } from './decrypter.ts';
77
import { b } from './core.ts';

src/keri/core/keyState.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,16 @@ export type ExternState = components['schemas']['ExternState'];
3333
/**
3434
* Defining properties of an identifier habitat, know as a Hab in KERIpy.
3535
*/
36-
export type HabState = components['schemas']['Identifier'];
36+
// export type HabState = components['schemas']['Identifier'];
37+
38+
export type HabStateBase = components['schemas']['HabState'];
39+
export type SaltyHabState = HabStateBase & SaltyKeyState;
40+
export type RandyHabState = HabStateBase & RandyKeyState;
41+
export type GroupHabState = HabStateBase & GroupKeyState;
42+
export type ExternHabState = HabStateBase & ExternState;
43+
export type HabState =
44+
| SaltyHabState
45+
| RandyHabState
46+
| GroupHabState
47+
| ExternHabState;
48+

src/keri/core/manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Encrypter } from './encrypter.ts';
22
import { Decrypter } from './decrypter.ts';
3-
import { Salter } from './salter.ts';
4-
import { Tier} from '../../types/keria-api-schema.ts';
3+
import { Salter, Tier } from './salter.ts';
54
import { Signer } from './signer.ts';
65
import { Verfer } from './verfer.ts';
76
import { MtrDex } from './matter.ts';

src/keri/core/salter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { Tier } from '../../types/keria-api-schema.ts';
77

88
export { Tier } from '../../types/keria-api-schema.ts';
99

10+
export { Tier } from '../../types/keria-api-schema.ts';
11+
1012
interface SalterArgs {
1113
raw?: Uint8Array | undefined;
1214
code?: string;

src/types/keria-api-schema.ts

Lines changed: 75 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,30 @@ export interface components {
573573
signing: components['schemas']['AidRecord'][];
574574
rotation: components['schemas']['AidRecord'][];
575575
};
576-
Icp: {
576+
IcpV1: {
577+
/** @default */
578+
v: string;
579+
/** @default */
580+
t: string;
581+
/** @default */
582+
d: string;
583+
/** @default */
584+
i: string;
585+
/** @default 0 */
586+
s: string;
587+
/** @default 0 */
588+
kt: string;
589+
k?: string[];
590+
/** @default 0 */
591+
nt: string;
592+
n?: string[];
593+
/** @default 0 */
594+
bt: string;
595+
b?: string[];
596+
c?: string[];
597+
a?: unknown;
598+
};
599+
IcpV2: {
577600
/** @default */
578601
v: string;
579602
/** @default */
@@ -647,7 +670,32 @@ export interface components {
647670
c?: string[];
648671
a?: unknown;
649672
};
650-
Dip: {
673+
DipV1: {
674+
/** @default */
675+
v: string;
676+
/** @default */
677+
t: string;
678+
/** @default */
679+
d: string;
680+
/** @default */
681+
i: string;
682+
/** @default 0 */
683+
s: string;
684+
/** @default 0 */
685+
kt: string;
686+
k?: string[];
687+
/** @default 0 */
688+
nt: string;
689+
n?: string[];
690+
/** @default 0 */
691+
bt: string;
692+
b?: string[];
693+
c?: string[];
694+
a?: unknown;
695+
/** @default */
696+
di: string;
697+
};
698+
DipV2: {
651699
/** @default */
652700
v: string;
653701
/** @default */
@@ -723,7 +771,7 @@ export interface components {
723771
c?: string[];
724772
a?: unknown;
725773
};
726-
Vcp: {
774+
VcpV1: {
727775
/** @default */
728776
v: string;
729777
/** @default */
@@ -743,7 +791,7 @@ export interface components {
743791
/** @default */
744792
n: string;
745793
};
746-
Vrt: {
794+
VrtV1: {
747795
/** @default */
748796
v: string;
749797
/** @default */
@@ -801,7 +849,7 @@ export interface components {
801849
};
802850
Controller: {
803851
state: components["schemas"]["KeyStateRecord"];
804-
ee: components["schemas"]["Icp"] | components["schemas"]["RotV1"] | components["schemas"]["RotV2"] | components["schemas"]["Dip"] | components["schemas"]["DrtV1"] | components["schemas"]["DrtV2"] | components["schemas"]["Vcp"] | components["schemas"]["Vrt"];
852+
ee: components["schemas"]["IcpV1"] | components["schemas"]["IcpV2"] | components["schemas"]["RotV1"] | components["schemas"]["RotV2"] | components["schemas"]["DipV1"] | components["schemas"]["DipV2"] | components["schemas"]["DrtV1"] | components["schemas"]["DrtV2"] | components["schemas"]["VcpV1"] | components["schemas"]["VrtV1"];
805853
};
806854
AgentResourceResult: {
807855
agent: components["schemas"]["KeyStateRecord"];
@@ -833,6 +881,16 @@ export interface components {
833881
prxs: string[];
834882
nxts: string[];
835883
};
884+
HabState: {
885+
name: string;
886+
prefix: string;
887+
icp_dt: string;
888+
state: components["schemas"]["KeyStateRecord"];
889+
/** @default null */
890+
transferable: boolean | null;
891+
/** @default null */
892+
windexes: string[] | null;
893+
};
836894
GroupKeyState: {
837895
mhab: components["schemas"]["Identifier"];
838896
keys: string[];
@@ -853,11 +911,15 @@ export interface components {
853911
transferable: boolean | null;
854912
/** @default null */
855913
windexes: string[] | null;
856-
salty?: components["schemas"]["SaltyState"];
857-
randy?: components["schemas"]["RandyKeyState"];
858-
group?: components["schemas"]["GroupKeyState"];
859-
extern?: components["schemas"]["ExternState"];
860-
};
914+
} & ({
915+
salty: components["schemas"]["SaltyState"];
916+
} | {
917+
randy: components["schemas"]["RandyKeyState"];
918+
} | {
919+
group: components["schemas"]["GroupKeyState"];
920+
} | {
921+
extern: components["schemas"]["ExternState"];
922+
});
861923
/**
862924
* @description Tier of key material
863925
* @enum {string}
@@ -904,13 +966,9 @@ export interface components {
904966
Rpy: components["schemas"]["RpyV1"] | components["schemas"]["RpyV2"];
905967
Challenge: {
906968
words: string[];
907-
};
908-
Contact: {
909-
id: string;
910-
alias: string;
911-
oobi: string;
912-
} & {
913-
[key: string]: unknown;
969+
dt?: string;
970+
said?: string;
971+
authenticated?: boolean;
914972
};
915973
};
916974
responses: never;

test-integration/delegation.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
} from './utils/test-util.ts';
99
import { retry } from './utils/retry.ts';
1010
import { step } from './utils/test-step.ts';
11-
import { Tier } from '../src/types/keria-api-schema.ts';
1211

1312
test('delegation', async () => {
1413
const [client1, client2] = await getOrCreateClients(2);

test-integration/utils/multisig-utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import signify, {
88
d,
99
messagize,
1010
HabState,
11+
SaltyHabState,
12+
GroupHabState,
13+
ExternHabState,
14+
RandyHabState,
1115
} from 'signify-ts';
1216
import { getStates, waitAndMarkNotification } from './test-util.ts';
1317
import assert from 'assert';
@@ -85,7 +89,7 @@ export async function acceptMultisigIncept(
8589
export async function addEndRoleMultisig(
8690
client: SignifyClient,
8791
groupName: string,
88-
aid: HabState,
92+
aid: SaltyHabState | GroupHabState | ExternHabState | RandyHabState,
8993
otherMembersAIDs: HabState[],
9094
multisigAID: HabState,
9195
timestamp: string,

0 commit comments

Comments
 (0)