@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
94 lines • 3.88 kB
text/typescript
import { Ed25519PublicJwk } from "./modules/kms/jwk/kty/okp/Ed25519PublicJwk.mjs";
import { Logger } from "./logger/Logger.mjs";
import { GetTrustedIssuersForVerification, VerificationSigner } from "./agent/TrustedIssuersForVerification.mjs";
import { PublicJwk } from "./modules/kms/jwk/PublicJwk.mjs";
import "./modules/kms/index.mjs";
//#region src/types.d.ts
export interface InitConfig {
logger?: Logger;
autoUpdateStorageOnStartup?: boolean;
/**
* Allow insecure http urls in places where this is usually required.
* Unsecure http urls may still be allowed in places where this is not checked (e.g. didcomm)
*
* For some flows this config option is set globally, which means that different agent configurations
* will fight for the configuration. It is meant as a local development option.
*
* Use with caution
*
* @default false
*/
allowInsecureHttpUrls?: boolean;
/**
* The allowed skew in seconds that should be allowed for validity time of a credentials and other signed
* objects (e.g. StatusList). Mobile devices especially can run a bit behind actual time, making validity
* checks fail based on a milliseconds / seconds.
*
* NOTE: this does currently only affects JWT based objects and credentials:
* - Token Status List
* - SD-JWT VC
* - W3C VCDM 1.1 and 2.0 with JWT/SD-JWT
*
* It does not cover
* - W3C VCDM 1.1 JSON-LD
* - mDOC
*
* @default 30
*/
validitySkewSeconds?: number;
/**
* Optional callback to dynamically resolve trusted issuers for a verification context.
*
* This is the primary trust anchor resolution hook. It is called before the X.509-module-level
* `getTrustedCertificatesForVerification` callback and before the global `trustedCertificates` list.
*
* Return `{ trustedIssuers: [] }` to hard-reject (trust nothing, skip remaining fallbacks).
* Return `undefined` to fall through to the next resolution layer.
*
* Extension packages (e.g. `@credo-ts/openid4vc`) export additional verification types that can
* be composed into the `AdditionalVerificationTypes` generic parameter to get full type coverage
* on `verification`, e.g.:
*
* ```ts
* getTrustedIssuersForVerification: async (
* agentContext,
* context: TrustedIssuersForVerificationContext<VerificationSigner, OpenId4VcVerificationTypes>
* ) => { ... }
* ```
*/
getTrustedIssuersForVerification?: GetTrustedIssuersForVerification<VerificationSigner, any>;
}
export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
export type JsonArray = Array<JsonValue>;
export interface JsonObject {
[property: string]: JsonValue;
}
/**
* Create an exclusive or, setting the other params to 'never' which helps with
* type narrowing
*
* @example
* ```
* type Options = XOR<{ name: string }, { dateOfBirth: Date }>
*
* type Options =
* | { name: string; dateOfBirth?: never }
* | { name?: never; dateOfBirth: Date }
* ```
*/
export type XOR<T, U> = (T & { [P in keyof Omit<U, keyof T>]?: never; }) | (U & { [P in keyof Omit<T, keyof U>]?: never; });
export interface ResolvedDidCommService {
id: string;
serviceEndpoint: string;
recipientKeys: PublicJwk<Ed25519PublicJwk>[];
routingKeys: PublicJwk<Ed25519PublicJwk>[];
}
export declare const isJsonObject: (value: unknown) => value is JsonObject;
export type SingleOrArray<T> = T | T[];
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export type CanBePromise<T> = T | Promise<T>;
export type NonEmptyArray<T> = [T, ...T[]];
export declare function mapNonEmptyArray<U, M extends (item: U, index: number) => unknown>(array: NonEmptyArray<U>, mapFunction: M): NonEmptyArray<ReturnType<M>>;
export declare function isNonEmptyArray<U>(array: U[]): array is NonEmptyArray<U>;
//#endregion
//# sourceMappingURL=types.d.mts.map