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

zeppos-cross-api

v1.0.16

Published

Cross-API library for ZeppOS for using 3.0 API and creating 1.0, 2.0, 3.0+ projects

Downloads

24

Readme

Status GitHub Issues GitHub Pull Requests License


ZeppOS cross-api library

📝 Table of Contents

Advanced Topics

🧐 About

Write Once deploy on multiple API_LEVEL as minimum.

You write using API_LEVEL 3.0 then you can Change min API level of your project on the fly just with one command and same codebase.

***** Although the functionality is almost complete. Testing is not yet complete and expect to find bugs/issues. You can consider this library in beta.

***** Please report any issues found here or create a pull request. Thanks in advance

🏁 Usage

npm i zeppos-cross-api
npx zeppos-cross-api --api-level=X.0

where X is 1, 2 or 3 according to your project ( you still write your code using API_LEVEL 3) and can change the min API again as easily as running above command again with new API_LEVEL

then replace each instance of '@zepos' with 'zeppos-cross-api' and you good to go

use try and catch with new functionality with sensible fallbacks for new APIs see status for details. for example

try {
  const player = create(id.PLAYER)
} catch (error) {
  do something else
}

In addition to the modules in 3.0 There is four 5 new modules (sources here and here):

  1. data-conversion contains very usefull functions like str2bin to convert from string to ArrayBuffer and bin2str for viceversa.
  2. device-polyfill import in your app.js if you want to use promises and setTimeout/setInterval without worrying about api level
  3. zml-base-app modified version of ZML base app
  4. zml-base-page modified version of ZML base page
  5. zml-base-side modified version of ZML base side

zml is recommended for usage for fetch, httprequest and other side service APIs but take care that

  1. Image Convert
  2. Download
  3. FileTransfer

are only avaliable in 3.0+ and would throw unsupported exception in other api levels.

:dart: SUPPORT STATUS

For each of non-supported function we either have

  1. ERROR => function throws an error
  2. NOOP => function does nothing

For each module of each API_LEVEL there is 5 level of support:

  1. 🟩 FULL
  2. 🟧 PARTIAL
  3. 🟥 NONE (ALL are ERROR)
  4. 🟥 NONE* (ALL are NOOP)
  5. N/A (not yet implemented)

| Module | 3.0 | 2.0 | 1.0 | | -------------------------------------- |:--------|:-----------|:-----------| | @zos/alarm | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/app | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/app-service | 🟩 FULL | 🟥 NONE | 🟥 NONE | | @zos/ble | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/device | 🟩 FULL | 🟩 FULL | 🟩 FULL | | @zos/display | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/fs | 🟩 FULL | 🟩 FULL | 🟩 FULL | | @zos/i18n | 🟩 FULL | 🟩 FULL | 🟥 NONE | | @zos/interaction | 🟩 FULL | 🟩 FULL | 🟩 FULL | | @zos/media | 🟩 FULL | 🟥 NONE | 🟥 NONE | | @zos/notification | 🟩 FULL | 🟥 NONE* | 🟥 NONE* | | @zos/page | 🟩 FULL | 🟩 FULL | 🟧 PARTIAL | | @zos/router | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/sensor | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/settings | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/storage | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/ui | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/user | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | @zos/utils | 🟩 FULL | 🟩 FULL | 🟩 FULL |

Listing unsupported function only for 🟧 PARTIAL and 🟥 NONE*

@zos/alarm

API_LEVEL 2.0 and 1.0:

  • repeat_type in set => ERROR

@zos/app

API_LEVEL 2.0 and 1.0:

  • emitCustomSystemEvent => ERROR

@zos/ble

API_LEVEL 2.0 and 1.0:

  • mstBuildProfile => ERROR
  • mstConnect => ERROR
  • DestroyProfileInstance => ERROR
  • mstDisconnect => ERROR
  • mstGetConnIdByRemoteAddr => ERROR
  • mstGetProfileInstance => ERROR
  • mstOffAllCb => ERROR
  • mstOnCharaNotification => ERROR
  • mstOnCharaReadComplete => ERROR
  • mstOnCharaValueArrived => ERROR
  • mstOnCharaWriteComplete => ERROR
  • mstOnDescValueArrived => ERROR
  • mstOnDescWriteComplete => ERROR
  • mstOnPrepare => ERROR
  • mstOnServiceChangeBegin => ERROR
  • mstOnServiceChangeEnd => ERROR
  • mstPair => ERROR
  • mstPrepare => ERROR
  • mstReadCharacteristic => ERROR
  • mstReadDescriptor => ERROR
  • mstStartScan => ERROR
  • mstStopScan => ERROR
  • mstWriteCharacteristic => ERROR
  • mstWriteDescriptor => ERROR

@zos/display

API_LEVEL 2.0 and 1.0:

  • getSettings => ERROR

API_LEVEL 1.0 only:

  • pauseDropWristScreenOff => NOOP (but return non-zero indicating non-sucess code)
  • resetDropWristScreenOff => NOOP (but return non-zero indicating non-sucess code)
  • pausePalmScreenOff => NOOP (but return non-zero indicating non-sucess code)
  • resetPalmScreenOff => NOOP (but return non-zero indicating non-sucess code)

@zos/notification

API_LEVEL 2.0 and 1.0:

  • notify => NOOP (return 0 for non success)
  • cancel => NOOP
  • getAllNotifications => NOOP (return empty array)

@zos/page

API_LEVEL 1.0:

  • setScrollLock => ERROR

@zos/router

API_LEVEL 2.0 and 1.0:

  • ALL SYSTEM_APP constants are undefined
  • checkSystemApp => NOOP

@zos/sensor

| Sensor | 3.0 | 2.0 | 1.0 | |:---------------:|:-----------|:-----------|:--------| | Accelerometer | 🟩 FULL | 🟥 MISSING | 🟥 MISSING | | Barometer | 🟩 FULL | 🟩 FULL | 🟥 MISSING | | Battery | 🟩 FULL | 🟩 FULL | 🟩 FULL | | BloodOxygen | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | Calorie | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Compass | 🟩 FULL | 🟥 MISSING | 🟥 MISSING | | Distance | 🟩 FULL | 🟩 FULL | 🟩 FULL | | FatBurning | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Geolocation | 🟩 FULL | 🟧 PARTIAL | 🟥 MISSING | | Gyroscope | 🟩 FULL | 🟥 MISSING | 🟥 MISSING | | HeartRate | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | Pai | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Screen | 🟩 FULL | 🟥 MISSING | 🟥 MISSING | | Sleep | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | Stand | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Step | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Stress | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | Time | 🟩 FULL | 🟧 PARTIAL | 🟧 PARTIAL | | Vibrator | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Wear | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Weather | 🟩 FULL | 🟩 FULL | 🟩 FULL | | Workout | 🟩 FULL | 🟥 MISSING | 🟥 MISSING | | WorldClock | 🟩 FULL | 🟥 MISSING | 🟩 FULL |

@zos/settings

API_LEVEL 2.0 and 1.0:

  • getSystemMode => ERROR

@zos/ui

API_LEVEL 1.0:

  • getImageInfo => ERROR
  • redraw => NOOP
  • setAppWidgetSize => ERROR
  • getAppWidgetSize => ERROR

As for Wdigets: (Warning: They wont throw an error but they will return undefined for createWidget):

Not Found in 2.0 and 1.0:

Not found in 1.0:

@zos/user

API_LEVEL 2.0 and 1.0:

  • addHealthData => ERROR

⛏️ Built Using

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

  • Hat tip to anyone whose code was used

:memo: License

This project is under license from Apache License V2. For more details, see the LICENSE file.