diff --git a/lib/firefly.ts b/lib/firefly.ts index 130b009..eb94f2f 100644 --- a/lib/firefly.ts +++ b/lib/firefly.ts @@ -70,6 +70,8 @@ import { FireFlyVerifierResolveRequest, FireFlyVerifierResolveResponse, FireFlyTokenApprovalRequest, + FireFlyNamespaceResponse, + FireFlyNamespacesResponse, } from './interfaces'; import { FireFlyWebSocket, FireFlyWebSocketCallback } from './websocket'; import HttpBase, { mapConfig } from './http'; @@ -130,6 +132,17 @@ export default class FireFly extends HttpBase { ); } + getNamespace( + name: string, + options?: FireFlyGetOptions, + ): Promise { + return this.getOne(`/namespaces/${name}`, undefined, options, true); + } + + getNamespaces(options?: FireFlyGetOptions): Promise { + return this.getMany('/namespaces', undefined, options, true); + } + getDatatypes( filter?: FireFlyDatatypeFilter, options?: FireFlyGetOptions, diff --git a/lib/interfaces.ts b/lib/interfaces.ts index 207b6e8..83ebc30 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -63,6 +63,14 @@ export interface FireFlyWebSocketOptions { heartbeatInterval: number; } +// Namespace +export type FireFlyNamespaceResponse = Required< + operations['getNamespace']['responses']['200']['content']['application/json'] +>; + +export type FireFlyNamespacesResponse = Required< +operations['getNamespaces']['responses']['200']['content']['application/json'] +>; // Network export type FireFlyIdentityFilter = operations['getIdentities']['parameters']['query'];