Socket
Socket
Sign inDemoInstall

@shopx/types

SHOPX Typescript Types. All the types used by the SHOPX API.


Version published
Maintainers
1

Readme

Source

SHOPX API Types for Typescript

@shopx/types MIT LICENSE @shopx/types Version

SHOPX Types.

Installation:

$ yarn add @shopx/types

API

This module organized as Types and RecordTypes. Types is basic type which mostly used by add, update methods (mutations) of the API. RecordTypes are Types joined with _id, createdAt, updatedAt. Which is what will be received with get queries. All the types here are all the types used by SHOPX.

You can use this types with SHOPX Client to build your app.

This module exports following types,
  • appSettings
  • checkoutFields
  • customerGroups
  • customers
  • emailSettings
  • emailTemplates
  • files
  • orders
  • pages
  • paymentGateways
  • paymentMethods
  • productCategories
  • products
  • redirects
  • settings
  • shippingMethods
  • shopx/affiliates
  • shopx/analytics
  • shopx/features
  • shopx/vendors
  • themeSettings
  • users
  • webhooks
Example
import client from "@shopx/client"
import { productTypes, productRecordTypes } from "@shopx/types"

const vendorID = "60e5185286ab2ff04f8cc576"
const logProducts = async () => {
  const api = client(vendorID)
  const products: productRecordTypes[] = await api.get.products()
  console.log(products)
}

logProducts() // List Products

// Adds a new product
const addProduct = async () => {
  const api = client("vendorID", "token")
  const products = async (data: productTypes) => await api.new.addProduct(data)
}

License

@shopx/types MIT LICENSE MIT

Keywords

FAQs

Last updated on 18 May 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc