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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bugyo-cloud-client

v1.3.0

Published

HTTP client for Bugyo Cloud

Downloads

7

Readme

TypeScript BUGYO Cloud Client

Usage

const bcc = require('bugyo-cloud-client');

// Implement LoggerFactory
const loggerFactory = {
  getLogger(name) {
    // (snip)
  }
};
// Settings
const tenantCode = "Bugyo cloud tenant code";
const loginId = "Your login id";
const password = "Your password";

// Create tasks
const loginTask = new bcc.LoginTask({ loginId, password }, loggerFactory);
const punchTask = new bcc.PunchTask({ clockType: "ClockIn" }, loggerFactory);
const logoutTask = new bcc.LogoutTask(loggerFactory);

// Create a client
const client = new bcc.BugyoCloudClient(tenantCode);

// Do tasks
await client.doA(loginTask); // At first, must do login
await client.doA(punchTask);
await client.doA(logoutTask);

See a sample.

Testing

npm test

Running a sample

npm run sample TenantCode LoginId Password

画面あるいは API

認証画面

  • URL: https://id.obc.jp/{{テナント?}}/
  • METHOD: GET
  • Response:
    • Headers:
      • Content-Type: text/html; charset=utf-8

認証方法チェック

  • URL: https://id.obc.jp/{{テナント?}}/login/CheckAuthenticationMethod
  • METHOD: POST
  • Headers:
    • __RequestVerificationToken: 認証画面のフォームにある hidden value
    • Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    • X-Requested-With: XMLHttpRequest
  • Content:
    • "OBCiD" : ログイン ID
    • "isBugyoCloud" : "false"
  • Response:
    • Headers:
      • Content-Type: application/json; charset=utf-8
    • Content:
      • AuthenticationMethod
      • SAMLButtonText
      • PasswordButtonText

認証

  • URL: https://id.obc.jp/{{テナント?}}/login/login/?Length=5
  • METHOD: POST
  • Headers:
    • Content-Type: application/x-www-form-urlencoded; charset=UTF-8
  • Content:
    • "btnLogin" : ""
    • "OBCID" : ログイン ID
    • "Password_d1" : ""
    • "Password_d2" : ""
    • "Password_d3" : ""
    • "Password" : パスワード
    • "__RequestVerificationToken" : 認証画面のフォームにある input hidden value
    • "X-Requested-With" : "XMLHttpRequest"
  • Response:
    • Headers:
      • Content-Type: application/json; charset=utf-8
    • Content:
      • RedirectURL
      • LoginOBCiD

レスポンスにある RedirectURL を GET すると 302 が返ります。 302 に従うと、ユーザ初期画面へ遷移します。URL は、https://hromssp.obc.jp/{{テナント?}}/{{ユニーク文字列?}}/ のようになります。

ユーザ初期画面

  • URL: https://hromssp.obc.jp/{{テナント?}}/{{ユニーク文字列?}}/
  • METHOD: GET

認証後の 302 応答に従うとたどり着きます。

ユニーク文字列の部分を、このあとの処理で使います。

打刻画面

  • URL: https://hromssp.obc.jp/{{テナント?}}/{{ユーザ初期画面URLより}}/timeclock/punchmark/
  • METHOD: GET
  • Response:
    • Headers:
      • Content-Type: text/html; charset=utf-8

打刻

  • URL: https://hromssp.obc.jp/{{テナント?}}/{{ユーザ初期画面URLより}}/TimeClock/InsertReadDateTime/
  • METHOD: POST
  • Headers:
    • "__RequestVerificationToken": 打刻画面にある input hidden value
    • "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
    • "X-Requested-With" : "XMLHttpRequest"
    • "Referer" : 打刻画面の URL
  • Content:
    • "ClockType" : 打刻種類
    • "LaborSystemID" : "0"
    • "LaborSystemCode" : ""
    • "LaborSystemName" : ""
    • "PositionLatitude" : 緯度
    • "PositionLongitude" : 経度
    • "PositionAccuracy" : "0"

打刻種類

  • 出勤 = "ClockIn"
  • 退出 = "ClockOut"

ログアウト

  • URL: https://hromssp.obc.jp/{{テナント?}}/{{ユーザ初期画面URLより}}/calllogout/logout/?manuallogin=True
  • METHOD: GET