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

@splpi/dms-estore-upload

v1.0.16

Published

St. Peter DMS — eStore V2 Upload Requirements Component

Readme

@splpi/dms-estore-upload

A React upload dialog component for integrating with the St. Peter Group Document Management System (DMS). Used in eStorev2 to collect and upload customer documents (Government ID, Specimen Signatures) to the DMS API.


Installation

npm install @splpi/dms-estore-upload

Peer Dependencies

Make sure these are already installed in your project:

npm install react react-dom @chakra-ui/react react-icons

Usage

import { DmsUploadRequirements } from '@splpi/dms-estore-upload';
import { useRef } from 'react';

export default function YourPage() {
  const uploadRef = useRef(null);

  return (
    <DmsUploadRequirements
      apiBase="http://192.168.23.126:5129"
      uploadedBy="[email protected]"
      PrimaryMdButton={PrimaryMdButton}
      onChange={(file) => {
        // Fires immediately when user selects a Government ID file.
        // Use this to call your OCR API and pre-fill form fields.
        console.log('ID file selected:', file);
      }}
      onBeforeNext={(uploadFn) => {
        // Registers the upload function with the parent.
        // Call uploadRef.current() on your Next button click.
        uploadRef.current = uploadFn;
      }}
      onIdUploadComplete={(result) => {
        // Fires after the Government ID is uploaded to DMS.
        console.log(result.driveFileId, result.fileName);
      }}
      onSignatureUploadComplete={(result) => {
        // Fires after each specimen signature is uploaded to DMS.
        console.log(result.driveFileId, result.fileName);
      }}
    />
  );
}

Wiring up the Next button

The component does not upload immediately on file select. Upload is triggered by calling the function registered via onBeforeNext — typically on your Next button click.

const uploadRef = useRef(null);

// Pass to DmsUploadRequirements:
onBeforeNext={(uploadFn) => { uploadRef.current = uploadFn; }}

// Then on your Next button:
<NextButton
  onClick={async () => {
    if (uploadRef.current) {
      const result = await uploadRef.current();
      if (!result.success) return; // stop if upload failed
    }
    // proceed to next step
    setUploadDialogOpen(false);
    setNextDialogOpen(true);
  }}
/>

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiBase | string | ✅ | Base URL of the DMS API (e.g. http://192.168.23.126:5129) | | uploadedBy | string | ✅ | Customer identifier — usually their email address | | PrimaryMdButton | React.ComponentType | ✅ | Themed button component from st-peter-ui used for the camera button | | onChange | (file: File) => void | ❌ | Fires immediately when user selects a Government ID file, before Next is clicked | | onBeforeNext | (uploadFn: () => Promise<{ success: boolean }>) => void | ❌ | Registers the upload trigger function with the parent component | | onIdUploadComplete | (result: UploadResult) => void | ❌ | Fires after the Government ID is successfully uploaded to DMS | | onSignatureUploadComplete | (result: UploadResult) => void | ❌ | Fires after each specimen signature is successfully uploaded to DMS |

UploadResult

{
  driveFileId: string;
  fileName: string;
}

How It Works

  1. User selects a Government ID file → onChange fires immediately (for OCR pre-fill)
  2. User selects specimen signature files
  3. User clicks Next → parent calls uploadRef.current()
  4. Component uploads all files to the DMS API
  5. Files are saved to Google Drive and recorded in the database with is_final = 0
  6. onIdUploadComplete and onSignatureUploadComplete fire with the upload results
  7. A later step in the purchase flow sets is_final = 1 to confirm the documents

Notes

  • Files are uploaded to the DMS API endpoint POST /api/files/direct-upload
  • The is_final = 0 flag means the upload is temporary until confirmed by the purchase flow
  • This component is intended for internal St. Peter Group use only