From d8f60489a9de483c4c927c0c6caaa33251ea23cd Mon Sep 17 00:00:00 2001 From: Petteri Stenius Date: Fri, 8 Sep 2023 11:44:59 +0300 Subject: [PATCH 1/3] array of string should be assignable to isith and nsith --- test/app/apping.test.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/app/apping.test.ts b/test/app/apping.test.ts index 8784df30..7759f2d0 100644 --- a/test/app/apping.test.ts +++ b/test/app/apping.test.ts @@ -1,6 +1,7 @@ import {strict as assert} from "assert"; import {randomPasscode, randomNonce} from '../../src/keri/app/apping' import libsodium from "libsodium-wrappers-sumo" +import {CreateIdentiferArgs, RotateIdentifierArgs} from "../../src/keri/app/signify"; describe('Controller', () => { it('Random passcode', async () => { @@ -15,6 +16,34 @@ describe('Controller', () => { assert.equal(nonce.length, 44) }) + it('CreateIdentiferArgs', () => { + let args: CreateIdentiferArgs; + args = { + isith: 1, + nsith: 1 + }; + args = { + isith: "1", + nsith: "1" + }; + args = { + isith: ["1"], + nsith: ["1"] + }; + }) + + it('RotateIdentifierArgs', () => { + let args: RotateIdentifierArgs; + args = { + nsith: 1 + }; + args = { + nsith: "1" + }; + args = { + nsith: ["1"] + }; + }) }) \ No newline at end of file From cfcd615f1f1490b6fa984eb3d21c966f5310bd59 Mon Sep 17 00:00:00 2001 From: Petteri Stenius Date: Fri, 8 Sep 2023 12:11:13 +0300 Subject: [PATCH 2/3] avoid TS6133 --- test/app/apping.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/app/apping.test.ts b/test/app/apping.test.ts index 7759f2d0..0ea0a9f3 100644 --- a/test/app/apping.test.ts +++ b/test/app/apping.test.ts @@ -30,6 +30,7 @@ describe('Controller', () => { isith: ["1"], nsith: ["1"] }; + args !== null; // avoids TS6133 }) it('RotateIdentifierArgs', () => { @@ -43,6 +44,7 @@ describe('Controller', () => { args = { nsith: ["1"] }; + args !== null; // avoids TS6133 }) From 7c4143299125347333ff11ac8a63032223784e94 Mon Sep 17 00:00:00 2001 From: Petteri Stenius Date: Fri, 8 Sep 2023 12:12:04 +0300 Subject: [PATCH 3/3] add string[] to type union of isith and nsith --- src/keri/app/signify.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keri/app/signify.ts b/src/keri/app/signify.ts index b7243434..172f706a 100644 --- a/src/keri/app/signify.ts +++ b/src/keri/app/signify.ts @@ -441,8 +441,8 @@ export class SignifyClient { /** Arguments required to create an identfier */ export interface CreateIdentiferArgs { transferable?: boolean, - isith?: string | number, - nsith?: string | number, + isith?: string | number | string[], + nsith?: string | number | string[], wits?: string[], toad?: number, proxy?: string, @@ -467,7 +467,7 @@ export interface CreateIdentiferArgs { /** Arguments required to rotate an identfier */ export interface RotateIdentifierArgs { transferable?: boolean, - nsith?: string | number, + nsith?: string | number | string[], toad?: number, cuts?: string[], adds?: string[],