@pippip/pip-system-common
TypeScript icon, indicating that this package has built-in type declarations

1.0.39 • Public • Published

Pip System

Pip Common Library

  • Error Handeler
  • Error Response
  • Current User
  • Current Agency
  • Current App Agency
  • Require Auth
    • requireLogin
    • requireRole
    • requireAgencyLogin
    • requireAgencyRole
    • requireAppLogin
    • requireAppRole
  • Validate Request

Get Started

Request Session

  • User ADM: user_access_token
  • Agency VN: agency_access_token

Error Status:

  • "-600" : Bad Request
  • "-601" : NotAuthenticateError
  • "-602" : Data Not Found
  • "-603" : NotAuthorizedError
  • "-604" : Database connection error
  • "-605" : RequestValidationError
  • "-606" : Not Found Error
  • "-607" : PipTokenExpiredError
  • "-608" : PipJsonWebTokenError
  • "-609" : PipTokenNotBeforeError
  • "-610" : PermissionDeniedError
  • "-611" : Invalid Refresh Token

Error App Status:

  • "-600" : Bad Request
  • "-601" : NotAuthenticateError
  • "-602" : Data Not Found
  • "-603" : NotAuthorizedError
  • "-604" : Database connection error
  • "-605" : RequestValidationError
  • "-606" : Not Found Error
  • "-607" : PipTokenExpiredError
  • "-608" : PipJsonWebTokenError
  • "-609" : PipTokenNotBeforeError
  • "-610" : PermissionDeniedError
  • "-611" : Invalid Refresh Token
  • "-612" : Bad Service Error
  • "-613" : Duplicate Driver Error

Account Status

  • Active = 1
  • InActive = 0
  • Block = 2

Error Form Response

  • response_status: negative number
  • errors: Array Object
    • Object: { message: string, field?: string }

User Payload

  • id: string
  • phone: string
  • name: string
  • role: string
  • status: number

Agency Web Payload

  • id: string
  • phone: string
  • name: string
  • role: string
  • status: number
  • rank?: number
  • isTransportation?: boolean
  • isDriver?: boolean

Agency Mobile APP Payload

  • id: string
  • phone: string
  • name: string
  • role: string
  • status: number
  • rank?: number
  • isTransportation?: boolean
  • isDriver?: boolean

Readme

Keywords

none

Package Sidebar

Install

npm i @pippip/pip-system-common

Weekly Downloads

3

Version

1.0.39

License

ISC

Unpacked Size

81.5 kB

Total Files

72

Last publish

Collaborators

  • hugowuang701