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

vscode-documentdb-api-experimental-beta

v0.3.1

Published

Extension API for VS Code DocumentDB extension (preview)

Downloads

6

Readme

DocumentDB Extension API

⚠️ Warning: This is an experimental API for a feature currently in development. It is intended for internal use only. The API is unstable and subject to rapid changes, which may break compatibility without notice.

This package provides the Extension API for integrating with the VS Code DocumentDB extension.

Installation

npm install --save-dev @<to be published>

Usage

import {
  getDocumentDBExtensionApi,
  MigrationProvider,
  MigrationProviderPickItem,
  ActionsOptions,
} from '@microsoft/vscode-documentdb-api';

export async function activate(context: vscode.ExtensionContext) {
  // Get the DocumentDB extension API
  const api = await getDocumentDBExtensionApi(context, '0.1.0');

  // Create your migration provider
  const myProvider: MigrationProvider = {
    id: 'my-provider',
    label: 'My Migration Provider',
    description: 'Migrates data from X to Y',

    async getAvailableActions(options?: ActionsOptions): Promise<MigrationProviderPickItem[]> {
      // Return available actions for the user to choose from
      return [
        {
          id: 'import-data',
          label: 'Import Data',
          description: 'Import data from source to destination',
        },
        {
          id: 'export-data',
          label: 'Export Data',
          description: 'Export data from source',
        },
      ];
    },

    async executeAction(options?: ActionsOptions, id?: string): Promise<void> {
      // Execute the selected action
      // Use options for context like connection details
      switch (id) {
        case 'import-data':
          // Perform import operation using options.connectionString, etc.
          break;
        case 'export-data':
          // Perform export operation using options.databaseName, etc.
          break;
        default:
          // Handle default action or no action selected
          break;
      }
    },

    getLearnMoreUrl() {
      return 'https://example.com/learn-more';
    },
  };

  // Register your provider
  api.migration.registerProvider(myProvider);
}

API Reference

MigrationProvider

A migration provider must implement the following interface:

Required Properties:

  • id: Unique identifier for the provider (internal use, not shown to users)
  • label: Display name shown to users
  • description: Brief description of what the provider does

Optional Properties:

  • iconPath: Icon for the provider (can be a URI, theme icon, or light/dark icon pair)

Required Methods:

  • getAvailableActions(options?: ActionsOptions): Returns a list of actions the user can choose from
  • executeAction(id?: string): Executes the selected action or a default action

Optional Properties:

  • requiresAuthentication: Indicates if authentication is required for the default operation (when no custom actions are provided)

Optional Methods:

  • getLearnMoreUrl(): Returns a URL for more information about the provider

Workflow

The migration provider workflow follows these steps:

  1. Get Available Actions: The system calls getAvailableActions() to retrieve a list of possible operations
  2. User Selection: If actions are returned, they are presented to the user for selection
  3. Execute Action: The system calls executeAction() with the selected action's ID
  4. Default Execution: If getAvailableActions() returns an empty array, executeAction() is called immediately without parameters

Supporting Interfaces

MigrationProviderPickItem

Extends VS Code's QuickPickItem with additional properties:

interface MigrationProviderPickItem extends vscode.QuickPickItem {
  id: string;
  requiresAuthentication?: boolean; // Indicates if authentication is required for this action
}

ActionsOptions

Optional parameters to customize available actions:

interface ActionsOptions {
  connectionString?: string;
  databaseName?: string;
  collectionName?: string;
  extendedProperties?: { [key: string]: string | undefined };
}

Authentication Support

The API supports flexible authentication requirements at both the provider and action levels:

Provider-Level Authentication

Use the requiresAuthentication property on the provider for default operations:

const provider: MigrationProvider = {
  id: 'my-provider',
  label: 'My Provider',
  description: 'Provider requiring authentication',
  requiresAuthentication: true, // Auth required for default action

  async getAvailableActions(): Promise<MigrationProviderPickItem[]> {
    return []; // No custom actions, uses default
  },

  async executeAction(): Promise<void> {
    // This will only be called after authentication is verified
  },
};

Action-Level Authentication

Individual actions can specify their own authentication requirements:

const provider: MigrationProvider = {
  id: 'flexible-provider',
  label: 'Flexible Provider',
  description: 'Provider with mixed authentication requirements',

  async getAvailableActions(): Promise<MigrationProviderPickItem[]> {
    return [
      {
        id: 'public-action',
        label: 'Public Action',
        description: 'No authentication required',
        requiresAuthentication: false,
      },
      {
        id: 'private-action',
        label: 'Private Action',
        description: 'Authentication required',
        requiresAuthentication: true,
      },
    ];
  },

  async executeAction(options?: ActionsOptions, id?: string): Promise<void> {
    // Handle actions based on their authentication requirements
    // Use options for context like connection details
  },
};

Combined Authentication

Both provider and action-level authentication can be used together:

const provider: MigrationProvider = {
  id: 'combined-provider',
  label: 'Combined Provider',
  description: 'Uses both authentication levels',
  requiresAuthentication: true, // Default action requires auth

  async getAvailableActions(): Promise<MigrationProviderPickItem[]> {
    return [
      {
        id: 'demo',
        label: 'Demo Mode',
        description: 'No authentication needed for demo',
        requiresAuthentication: false,
      },
      {
        id: 'full-migration',
        label: 'Full Migration',
        description: 'Full migration with authentication',
        requiresAuthentication: true,
      },
    ];
  },

  async executeAction(options?: ActionsOptions, id?: string): Promise<void> {
    // Both default and custom actions handled appropriately
    // Access context via options parameter
  },
};