Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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 scripts/generate-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const content = ast.filter((s) => {
return false;
});

const header = `// AUTO-GENERATED: Only components retained from OpenAPI schema\n\n`;
const header = `// AUTO-GENERATED: Only components and enums retained from OpenAPI schema\n\n`;
await writeFile(outputFile, `${header}${astToString(content)}`);

console.log(`🚀 ${specUrl}${outputFile}`);
6 changes: 3 additions & 3 deletions src/keri/app/aiding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { components } from '../../types/keria-api-schema.ts';
/** Arguments required to create an identfier */
export interface CreateIdentiferArgs {
transferable?: boolean;
isith?: string | number | string[];
nsith?: string | number | string[];
isith?: string | string[] | string[][];
nsith?: string | string[] | string[][];
wits?: string[];
toad?: number;
proxy?: string;
Expand Down Expand Up @@ -183,7 +183,7 @@ export class Identifier {

if (!transferable) {
ncount = 0;
nsith = 0;
nsith = '0';
dcode = MtrDex.Ed25519N;
}

Expand Down
10 changes: 5 additions & 5 deletions src/keri/app/credentialing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ export class Ipex {
exn: Serder,
sigs: string[],
recp: string[]
): Promise<any> {
): Promise<Operation<unknown>> {
const body = {
exn: exn.sad,
sigs,
Expand Down Expand Up @@ -825,7 +825,7 @@ export class Ipex {
sigs: string[],
atc: string,
recp: string[]
): Promise<any> {
): Promise<Operation<unknown>> {
const body = {
exn: exn.sad,
sigs,
Expand Down Expand Up @@ -869,7 +869,7 @@ export class Ipex {
exn: Serder,
sigs: string[],
recp: string[]
): Promise<any> {
): Promise<Operation<unknown>> {
const body = {
exn: exn.sad,
sigs,
Expand Down Expand Up @@ -937,7 +937,7 @@ export class Ipex {
sigs: string[],
atc: string,
recp: string[]
): Promise<any> {
): Promise<Operation<unknown>> {
const body = {
exn: exn.sad,
sigs: sigs,
Expand Down Expand Up @@ -982,7 +982,7 @@ export class Ipex {
sigs: string[],
atc: string,
recp: string[]
): Promise<any> {
): Promise<Operation<unknown>> {
const body = {
exn: exn.sad,
sigs: sigs,
Expand Down
8 changes: 6 additions & 2 deletions src/keri/app/exchanging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { Pather } from '../core/pather.ts';
import { Counter, CtrDex } from '../core/counter.ts';
import { Saider } from '../core/saider.ts';
import { HabState } from '../core/keyState.ts';
import { Exn } from './grouping.ts';
import { components } from '../../types/keria-api-schema.ts';

export type ExchangeResource = components['schemas']['ExchangeResource'];

/**
* Exchanges
Expand Down Expand Up @@ -101,7 +105,7 @@ export class Exchanges {
/**
* Send exn messaget to list of recipients
* @async
* @returns {Promise<any>} A promise to the list of replay messages
* @returns {Promise<Exn>} A promise to the list of replay messages
* @param name
* @param topic
* @param exn
Expand Down Expand Up @@ -137,7 +141,7 @@ export class Exchanges {
* @returns A promise to the exn message
* @param said The said of the exn message
*/
async get(said: string): Promise<any> {
async get(said: string): Promise<ExchangeResource> {
const path = `/exchanges/${said}`;
const method = 'GET';
const res = await this.client.fetch(path, method, null);
Expand Down
17 changes: 11 additions & 6 deletions src/keri/app/grouping.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { SignifyClient } from './clienting.ts';
import { Dict } from '../core/core.ts';
import { Operation } from './coring.ts';
import { components } from '../../types/keria-api-schema.ts';

export type Exn = components['schemas']['Exn'];
export type ExnMultisig = components['schemas']['ExnMultisig'];

/**
* Groups
Expand All @@ -19,9 +24,9 @@ export class Groups {
* Get group request messages
* @async
* @param {string} [said] SAID of exn message to load
* @returns {Promise<any>} A promise to the list of replay messages
* @returns {Promise<ExnMultisig[]>} A promise to the list of replay messages
*/
async getRequest(said: string): Promise<any> {
async getRequest(said: string): Promise<ExnMultisig[]> {
const path = `/multisig/request/` + said;
const method = 'GET';
const res = await this.client.fetch(path, method, null);
Expand All @@ -35,14 +40,14 @@ export class Groups {
* @param {Dict<any>} [exn] exn message to send to other members
* @param {string[]} [sigs] signature of the participant over the exn
* @param {string} [atc] additional attachments from embedded events in exn
* @returns {Promise<any>} A promise to the list of replay messages
* @returns {Promise<Exn>} A promise to the list of replay messages
*/
async sendRequest(
name: string,
exn: Dict<any>,
sigs: string[],
atc: string
): Promise<any> {
): Promise<Exn> {
const path = `/identifiers/${name}/multisig/request`;
const method = 'POST';
const data = {
Expand All @@ -64,7 +69,7 @@ export class Groups {
* @param {string} [gid] prefix
* @param {string[]} [smids] array of particpants
* @param {string[]} [rmids] array of particpants
* @returns {Promise<any>} A promise to the list of replay messages
* @returns {Promise<Operation<unknown>} A promise to the list of replay messages
*/
async join(
name: string,
Expand All @@ -73,7 +78,7 @@ export class Groups {
gid: string,
smids: string[],
rmids: string[]
): Promise<any> {
): Promise<Operation<unknown>> {
const path = `/identifiers/${name}/multisig/join`;
const method = 'POST';
const data = {
Expand Down
8 changes: 4 additions & 4 deletions src/keri/core/eventing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ export function ample(n: number, f?: number, weak = true) {

export interface InceptArgs {
keys: Array<string>;
isith?: number | string | Array<string>;
isith?: string | string[] | string[][];
ndigs?: Array<string>;
nsith?: number | string | Array<string>;
nsith?: string | string[] | string[][];
toad?: number | string;
wits?: Array<string>;
cnfg?: Array<string>;
Expand Down Expand Up @@ -304,7 +304,7 @@ export function incept({
const sner = new CesrNumber({}, 0);

if (isith == undefined) {
isith = Math.max(1, Math.ceil(keys.length / 2));
isith = Math.max(1, Math.ceil(keys.length / 2)).toString();
}

const tholder = new Tholder({ sith: isith });
Expand All @@ -320,7 +320,7 @@ export function incept({
}

if (nsith == undefined) {
nsith = Math.max(0, Math.ceil(ndigs.length / 2));
nsith = Math.max(0, Math.ceil(ndigs.length / 2)).toString();
}

const ntholder = new Tholder({ sith: nsith });
Expand Down
15 changes: 15 additions & 0 deletions src/keri/core/keyState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ export type ExternState = components['schemas']['ExternState'];
* Defining properties of an identifier habitat, know as a Hab in KERIpy.
*/
export type HabState = components['schemas']['Identifier'];

export type Icp =
| components['schemas']['ICP_V_1']
| components['schemas']['ICP_V_2'];
export type Ixn =
| components['schemas']['IXN_V_1']
| components['schemas']['IXN_V_2'];
export type ExnV1 =
| components['schemas']['EXN_V_1']
| components['schemas']['EXN_V_2'];
export type Dip =
| components['schemas']['DIP_V_1']
| components['schemas']['DIP_V_2'];
export type ExnEmbeds = components['schemas']['ExnEmbeds'];
export type MultisigRpyEmbeds = components['schemas']['MultisigRpyEmbeds'];
Loading