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

yemot-api2

v0.7.0

Published

A modern JS/TS library for the Yemot HaMashiach API

Readme

Yemot API Client (yemot-api)

npm version License: ISC

ספריית JS/TS מודרנית ונוחה לעבודה מול ה-API של ימות המשיח.

⚠️ שימו לב: הספרייה נמצאת כרגע בפיתוח פעיל. ייתכנו שינויים ב-API ושינויים שאינם תומכים לאחור. מומלץ להשתמש בזהירות בפרויקטים בסביבת ייצור (Production).

✨ תכונות עיקריות

  • חווית פיתוח מעולה (DX) בזכות TypeScript: כל פונקציה מגיעה עם תיעוד, טיפוסים (types), ומבנה ברור לבקשות ולתשובות. תגידו שלום לניחושים ושלום להשלמה אוטומטית חכמה (IntelliSense).
  • ✅ תמיכה מובנית ב-ES Modules (import) ו-CommonJS (require).
  • ✅ טיפול אוטומטי בטוקן האימות.
  • ✅ ממשק נוח ופשוט מבוסס Promise-ים (מוכן לעבודה עם async/await).
  • ✅ כיסוי למגוון פעולות נפוצות כמו קבלת מידע, העלאה והורדת קבצים וניהול שלוחות.

🚀 התקנה

npm install yemot-api2

🛠️ שימוש בסיסי

מומלץ לשמור את מפתח הגישה במשתני סביבה (למשל, בקובץ .env) ולא ישירות בקוד. הדוגמאות הבאות כתובות ב-TypeScript כדי להדגים את העוצמה המלאה של הספרייה, כולל בדיקת טיפוסים בזמן כתיבת הקוד. גם אם אתם משתמשים ב-JavaScript טהור, עדיין תיהנו מהשלמה אוטומטית בזכות קבצי הטיפוסים הכלולים בחבילה.

// main.ts
import { YemotAPI, IGetSessionResponse } from 'yemot-api';
import 'dotenv/config'; // For loading .env file

// 1. יצירת מופע של הלקוח
const api = new YemotAPI(process.env.YEMOT_API_KEY);

// 2. קריאה למתודות ה-API
async function main() {
  try {
    // קבלת פרטי המערכת
    console.log('Fetching session info...');
    const sessionInfo: IGetSessionResponse = await api.getSession();
    console.log(`Hello ${sessionInfo.name}! You have ${sessionInfo.units} units.`);

    // קבלת מידע על שלוחה
    console.log('\nFetching IVR directory...');
    const ivrDir = await api.getIVR2Dir({ path: '/' });
    console.log(`Found ${ivrDir.dirs.length} directories in root.`);
  
  } catch (error) {
    console.error('API call failed:', error.message);
  }
}

main();

דוגמה: העלאת קובץ

import * as fs from 'fs';
import * as path from 'path';

async function uploadAudio() {
  try {
    const filePath = path.join(__dirname, 'audio.mp3');
    const fileBuffer = fs.readFileSync(filePath);

    console.log('Uploading file...');
    const response = await api.uploadFile({
      path: 'ivr2:/1/MyNewFile.wav', // נתיב יעד בשרת
      file: fileBuffer,
      fileName: 'audio.mp3', // שם הקובץ המקורי
      convertAudio: true // בקשה להמיר את קובץ האודיו
    });

    console.log('File uploaded successfully!', response);
  } catch (error) {
    console.error('Upload failed:', error.message);
  }
}

// uploadAudio();
  // main.js
  const { YemotAPI } = require('yemot-api'); // או import אם אתם משתמשים ב-ES Modules
  require('dotenv').config();

  const api = new YemotAPI(process.env.YEMOT_API_KEY);

  async function main() {
    try {
      console.log('Fetching session info...');
      const sessionInfo = await api.getSession();
      // גם בקובץ JS, תקבלו השלמה אוטומטית למאפיינים כמו sessionInfo.email
      console.log(`Hello ${sessionInfo.name}! You have ${sessionInfo.units} units.`);
    } catch (error) {
      console.error('API call failed:', error.message);
    }
  }

  main();

📚 מתודות עיקריות (API)

הרשימה הבאה מציגה את הפונקציות המרכזיות הנתמכות כרגע:

כללי

  • getSession(): קבלת פרטי המערכת הכלליים (שם, יחידות, מייל וכו').
  • getIncomingCalls(): קבלת רשימת השיחות הפעילות במערכת.

ניהול תוכן (קבצים ושלוחות)

  • getIVR2Dir(params): קבלת מידע מלא על שלוחה, כולל רשימת קבצים, תיקיות והגדרות.
  • updateExtension(params): יצירה או עדכון של הגדרות בשלוחה (קובץ ext.ini).
  • uploadFile(params): העלאת קובץ למערכת.
  • downloadFile(params): הורדת קובץ מהמערכת.

שליחת צינתוק

  • runTzintuk(params): שליחת צינתוק למספרים, רשימות תפוצה או רשימות צינתוקים חינמיים, עם אפשרות לזיהוי יוצא מותאם או רנדומלי (לאימות). הממשק גמיש ומאפשר שילוב בין סוגי שליחה שונים, כולל הגדרת זיהוי יוצא לכל מספר או קבוצה.

🤝 תרומה לפרויקט

הפרויקט פתוח לתרומות! אם מצאתם באג, יש לכם רעיון לפיצ'ר חדש או שתרצו לשפר את התיעוד, אתם מוזמנים לפתוח Issue או Pull Request במאגר ה-GitHub.

📄 רישיון

הפרויקט מופץ תחת רישיון ISC.