# Interphase Node

Interphase is Node abstraction of the Shopify Admin App (Interphase). This utility can be used in one of scripts or other Javascript/Typescript projects.

## Table of Contents

1. Built With
1. Installation
1. Directory Structure
1. Serverless and Plugins
1. Test Suite
1. Deployment

## Built With

Hail Frequency makes use of the following technology:

1. [Node.js](https://nodejs.org/en/)
2. [TypeScript](https://www.typescriptlang.org/)
7. [Mocha](https://mochajs.org/)

## Installation

### Pre-Requisites

1. TypeScript with TSC version Version 3.5.3 or greater
2. Node with Version 10.15.3 or greater

### Installation

1. `npm install @nacelle/interphase-node --save`

### Usage

#### Init
```js
import { Interphase } from '@nacelle/interphase-node'

const store = 'starship-furniture' // Shopify Store Name
const accessToken = 'xxxxxxxxxxxxxxxxxxxx'  // Shopify GraphQL Admin API

const interphase = new Interphase(store, accessToken)
```

#### Create
```js
const response = interphase.create({
  input: {
    namespace: 'test_namespace',
    key: 'test_key',
    ownerType: 'PRODUCT'
  }
})
```

#### Get
```js
const response = interphase.get()
```

#### Delete
```js
const response = interphase.delete({
  id: node.id
})
```

#### Recharge (creates all recharge metafieldVisibilities)
```js
const response = interphase.Recharge.createAll()
```

### Development

1. Clone repo
2. Run `npm install` via terminal inside the project directory
3. Run `npm run start` (will watch for changes in `./src`)


## Test Suite

This project uses [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/). To run tests run `npm run test` in your terminal.

This project expects a TDD workflow.

## Contributions

1. Original Author - Caleb Bodtorf