npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@equinor/fusion-framework-module-services

v8.0.0

Published

Typed API service clients for the Fusion Framework. Provides factory-based access to platform backend services (bookmarks, context, notification, people) with versioned endpoints, automatic HTTP client resolution, and response validation.

Downloads

7,938

Readme

@equinor/fusion-framework-module-services

Typed API service clients for the Fusion Framework. Provides factory-based access to platform backend services (bookmarks, context, notification, people) with versioned endpoints, automatic HTTP client resolution, and response validation.

Features

  • Domain-specific API clientsBookmarksApiClient, ContextApiClient, NotificationApiClient, PeopleApiClient
  • Versioned endpoints — each service exposes version-aware methods (e.g. v1, v2, v4) with type-safe request/response shapes
  • Dual consumption patterns — every endpoint supports both Promise (json) and observable (json$) return types
  • Automatic HTTP client resolution — resolves named clients through the HTTP module, falling back to service-discovery
  • Response validation — built-in response handler validates HTTP status codes and throws structured ApiProviderError on failure
  • Zod schema selectorsschemaSelector utility for runtime response parsing with Zod schemas
  • Bookmark Zod schemas — pre-built Zod schemas (ApiBookmarkSchema, ApiBookmarkPayload) for bookmark entities

Installation

pnpm add @equinor/fusion-framework-module-services

Usage

Enable the module

Register the services module during app configuration:

import { enableServices } from '@equinor/fusion-framework-module-services';

export const configure = (configurator) => {
  enableServices(configurator);
};

Custom client factory

Override HTTP client resolution with configureServices:

import { configureServices } from '@equinor/fusion-framework-module-services';

export const configure = (configurator) => {
  configurator.addConfig(
    configureServices((cfg) => {
      cfg.createClient = async (name) => myHttpClientFactory(name);
    }),
  );
};

Create and use API clients

Access the services provider at runtime to create domain clients:

// Bookmarks
const bookmarks = await provider.services.createBookmarksClient('json');
const allBookmarks = await bookmarks.query('v1');
const single = await bookmarks.get('v1', { bookmarkId: 'abc-123' });

// Context
const context = await provider.services.createContextClient('json');
const ctx = await context.get('v1', { id: 'context-id' });
const results = await context.query('v1', { query: 'my search' });

// Notifications
const notifications = await provider.services.createNotificationClient('json');
const all = await notifications.getAll('v1');
await notifications.setSeenByUser('v1', { notificationId: 'notif-id' });

// People
const people = await provider.services.createPeopleClient();
const person = await people.get('v4', 'json', { azureId: 'azure-unique-id' });
const photo = await people.photo('v2', 'blob', { azureId: 'azure-unique-id' });

API Reference

Module setup

| Export | Description | |---|---| | enableServices | Register the services module with the framework configurator | | configureServices | Create a module config object with a custom configuration callback | | module | The raw module definition |

Provider

| Export | Description | |---|---| | ApiProvider / IApiProvider | Services provider with factory methods for creating domain clients | | ApiConfigurator / IApiConfigurator | Configuration interface (set createClient to override HTTP client resolution) | | ApiProviderError | Structured error thrown on non-OK HTTP responses |

Domain clients

| Client | Import path | Services | |---|---|---| | BookmarksApiClient | @equinor/fusion-framework-module-services/bookmarks | CRUD bookmarks, favourites | | ContextApiClient | @equinor/fusion-framework-module-services/context | Get, query, related contexts | | NotificationApiClient | @equinor/fusion-framework-module-services/notification | CRUD notifications, settings | | PeopleApiClient | @equinor/fusion-framework-module-services/people | Get, query, photo, suggest, resolve |

Types and utilities

| Export | Description | |---|---| | ClientMethod | Maps json / json$ to Promise / StreamResponse | | ClientDataMethod | Maps blob / blob$ for binary responses | | ApiClientFactory | Factory function type for creating named HTTP clients | | FilterAllowedApiVersions | Utility type for constraining API version unions | | ExtractApiVersion | Utility type for resolving a version key to its string value | | UnsupportedApiVersion | Error class for invalid API version strings | | extractVersion | Resolves a version key or value from an API-version enum | | schemaSelector | Creates a response selector that validates with a Zod schema | | isApiPerson | Type-guard factory for validating person entities by API version |

Configuration

The services module depends on:

  • @equinor/fusion-framework-module-http — provides named HTTP clients
  • @equinor/fusion-framework-module-service-discovery (optional) — automatic client resolution via service discovery

When neither a registered HTTP client nor service-discovery is available for a service name, the module throws an error during client creation.