Socket
Book a DemoInstallSign in
Socket

@keg-hub/appetite

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keg-hub/appetite

appetize.io api wrapper

1.0.1
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

Overview

A node-js wrapper around the appetize api

Example

const { upsert } = require('@keg-hub/appetite')

// Updates an existing build if one is found, otherwise uploads a new one
const response = await upsert({
  // appetize api token
  token: '123456',

  // upload or update a build using these parameters
  url: 'some.url.to.simulator.build.com'
  platform: 'ios',
  meta: {
    branch: 'my-branch',
  },
  ...*: <any other update/upload field (see the Appetize docs)>,

  // searches for a build where platform=ios and note='{"branch":"my-branch"}'
  search: {
    platform: 'ios',
    meta: {
      branch: 'my-branch',
    }
  }
})

Usage

Install

yarn add @keg-hub/appetite

Upload

const { upload } = require('@keg-hub/appetite')

// set either url or filePath, not both
const response = await upload({
  url: <url to your simulator build>
  filePath: <system file path to your simulator build>,
  platform: <ios or android>,
  token: <your appetize api token>
  note: <note field>,
  meta: <object to be stringified for the note field, unless "note" param was defined>,
  ....rest: <any other fields to include in the post form>
})

Update

const { update } = require('@keg-hub/appetite')

// set either url or filePath, not both
const response = await update({
  publicKey: <public key of app build to update>,
  url: <url to your simulator build>
  filePath: <system file path to your simulator build>,
  platform: <ios or android>,
  token: <your appetize api token>
  note: <note field>,
  meta: <object to be stringified for the note field, unless "note" param was defined>,
  ....rest: <any other fields to include in the post form>
})

Upsert

const { upsert } = require('@keg-hub/appetite')

// set either url or filePath, not both
const response = await upsert({
  token: <your appetize api token>,
  search: <fields to search for existing builds. Same as `search`>
  ...*: <fields used for uploading/updating a build. Same params as `upload`>
})
const { search } = require('@keg-hub/appetite')

// searches for all builds matching the parameters
const builds = await search({
  note: <note field of an existing app build to search by>,
  meta: <note fields of an existing app build to search by>,
  platform: <ios or android>,
  token: <your appetize api token>
})

Get

const { get } = require('@keg-hub/appetite')

// set either url or filePath, not both
const response = await get({
  publicKey: <public key of app build to get>,
  token: <your appetize api token>
})

Remove

const { remove } = require('@keg-hub/appetite')

// set either url or filePath, not both
const response = await remove({
  publicKey: <public key of app build to delete>,
  token: <your appetize api token>
})

Notes

  • Methods like search accept an optional meta parameter
  • If this parameter is included, it will treat the "note" field as a json object string
  • For example, search will look for an existing build whose "note" value is a json object string containing the fields included in meta
  • upload and update will stringify the meta object and set that as the value of the "note" field in the uploaded/updated build

Testing

  • Unit: yarn test
  • Functional: yarn test:e2e
    • this test will require you to set some ENVS
      • it's easiest to create a .env file in the repo's root directory
      • see the example.env file for the expected variables to put there
    • this will test creating, searching, updating, and deleting a single app using your Appetize account, live

FAQs

Package last updated on 28 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.