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

ofsc-utility

v1.0.19

Published

A wrapper for Oracle Field Service REST API

Readme

Enhanced ofsc utility

A lightweight utility library for interacting with Oracle Field Service Cloud (OFSC).

Features

  • 🚀 40+ utility methods
  • 📚 Written in TypeScript with full type definitions
  • 🧪 Completely tested with Jest
  • 📦 Zero dependencies
  • 🎯 Modular architecture for tree-shaking
  • 🔧 Multiple import styles for flexibility

Installation

npm install ofsc-utility

Functions implemented

Download

Please see the code snippet below.

csv

downloadWorkZoneCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId)
downloadAllResourcesCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId)
downloadAllUsersCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId)
downloadAllInventoryTypesCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId)
downloadAllEventsOfDayCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId, process.env.subscriptionId,"2025-12-05")
// Download Collaboration groups  assigned to users
generateUsersCollaborationCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId) 
// Download all resource's inventories
generateAllOnHandInventoryOfAllResourcesCSV(process.env.clientID, process.env.clientSecret, process.env.instanceId) 

records

getOAuthToken("clientId", "clientSecret", "instanceId")
getInventoryTypesDetail("clientId", "clientSecret", "instanceId"."inventory_label")
updateCreateInventoryType("clientId", "clientSecret", "instanceId"."inventory_label")
getAllActivities("clientId", "clientSecret", "instanceId"."resources","dateFrom","dateTo","q","fields")
getActivityCustomerInventories("clientId", "clientSecret", "instanceId"."activityId")
createActivityCustomerInventories( "clientId", "clientSecret", "instanceId"."activityId","payload")
downloadAllEventsOfDay(process.env.clientID, process.env.clientSecret, process.env.instanceId, process.env.subscriptionId,"2025-12-05")
getActivitybyId("clientId", "clientSecret", "instanceId"."activityId")

Technical Design Doc - Configurations

// It will create a techncial configuration file
createConfigurationFile(process.env.clientID, process.env.clientSecreat,process.env.instanceId,"OFSC_CONFIGURATION_SHEET.xlsx")

Usage

downloadWorkZoneCSV("bot", "XXXXXXXXX", "compXXX.test")

CommonJS

const ofs = require("ofsc-utility");

ofs.User.generateUsersCollaborationCSV(
    process.env.clientID,
    process.env.clientSecret,
    process.env.instanceId,
    process.env.subscriptionId
);
async function run() {
  let data = await ofs.InventoryType.getInventoryTypesDetail("clientId", "clientSecret", "instanceId", "inventory_label");
  console.error(data);
}
run();
const ofs = require("ofsc-utility");

ofs
  .getOAuthToken("clientId", "clientSecret", "instanceId")
  .then((token) => {
    console.log(token);
  })
  .catch((err) => {
    console.error("Error fetching token:", err);
  });
const ofs = require("ofsc-utility");

ofs.WorkZone.downloadWorkZoneCSV("clientId", "clientSecret", "instanceId")
  .then(() => {
    console.log("successful");
  })
  .catch((err) => {
    console.error("Error:", err);
  });
const ofs = require("ofsc-utility");

ofs
  .downloadAllResourcesCSV("clientId", "clientSecret", "instanceId")
  .then(() => {
    console.log("successful");
  })
  .catch((err) => {
    console.error("Error:", err);
  });
const ofs = require("ofsc-utility");

ofs
  .downloadAllUsersCSV("clientId", "clientSecret", "instanceId")
  .then(() => {
    console.log("successful");
  })
  .catch((err) => {
    console.error("Error:", err);
  });
const ofs = require("ofsc-utility");

async function run() {
  const payload = {
    label: "inventory_label",
    name: "Ordered Part",
    unitOfMeasurement: "ea",
    active: true,
    nonSerialized: true,
    modelProperty: "part_item_number_rev",
    quantityPrecision: 0,
    translations: [
      {
        language: "en",
        name: "Ordered Part",
        unitOfMeasurement: "ea",
        languageISO: "en-US",
      },
    ],
  };

  try {
    const result = await updateCreateInventoryType("CLIENT_ID", "CLIENT_SECRET", "INSTANCE_URL", "inventory_label", payload);

    console.log("Updated:", result);
  } catch (err) {
    console.error(err);
  }
}

run();
const ofs = require("ofsc-utility");
async function run() {
  try {
    const result = await ofs.getAllActivities(
      (clientId = "CLIENT_ID"),
      (clientSecret = "CLIENT_SECRET"),
      (instanceUrl = "INSTANCE_URL"),
      (resources = "US"),
      (dateFrom = "2025-11-05"),
      (dateTo = "2025-12-05"),
      (q = "status=='pending' and ACTIVITY_NOTES!=''"),
      (fields = "ACTIVITY_NOTES,status,activityId,activityType,date,resourceId")
    );

    console.log("Updated:", result);
  } catch (err) {
    console.error(err);
  }
}

run();
ofs.getActivityCustomerInventories("CLIENT_ID", "CLIENT_SECRET", "INSTANCE_URL", "activityId").then((data) => {
  console.log(data);
});
const ofs = require("ofsc-utility");
ofs.Events.downloadAllEventsOfDayCSV(
  process.env.clientID,
  process.env.clientSecret,
  process.env.instanceId,
  process.env.subscriptionId,
  "2025-12-05"
);

License

MIT