Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-shopify

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-shopify - npm Package Compare versions

Comparing version 5.2.0 to 5.3.0

4

lib/index.d.ts

@@ -8,3 +8,3 @@ import { ResultOK, ResultFAIL } from 'node-result';

import { CreateCheckout, UpdateCheckout, CheckoutToken, Checkout, CheckoutShippingRates } from './types/checkout';
import { ProductId, Product, CreateProduct, UpdateProduct, ProductListing } from './types/product';
import { ProductId, Product, CreateProduct, UpdateProduct, ProductListing, ProductVariantId, CreateProductVariant, ProductVariant } from './types/product';
declare type ReturnAsync<T> = Promise<ResultOK<T> | ResultFAIL<Error>>;

@@ -55,3 +55,5 @@ export declare class Shopify {

deleteProductListing(productId: ProductId): ReturnAsync<null>;
createProductVariant(productId: ProductId, createProductVariant: CreateProductVariant): ReturnAsync<ProductVariant>;
deleteProductVariant(productId: ProductId, productVariantId: ProductVariantId): ReturnAsync<null>;
}
export {};

@@ -337,2 +337,18 @@ "use strict";

}
async createProductVariant(productId, createProductVariant) {
const payload = {
variant: createProductVariant
};
const url = `/admin/api/2021-01/products/632910392/variants.json`;
const { data } = (await this.instance.post(url, payload)).unwrap();
if (!data) {
return node_result_1.ResultFail(new Error('Response without data.'));
}
return node_result_1.ResultOk(data.variant);
}
async deleteProductVariant(productId, productVariantId) {
const url = `/admin/api/2021-01/products/${productId}/variants/${productVariantId}.json`;
(await this.instance.delete(url)).unwrap();
return node_result_1.ResultOk(null);
}
}

@@ -453,2 +469,8 @@ __decorate([

], Shopify.prototype, "deleteProductListing", null);
__decorate([
node_result_1.tryCatchWrapperAsync
], Shopify.prototype, "createProductVariant", null);
__decorate([
node_result_1.tryCatchWrapperAsync
], Shopify.prototype, "deleteProductVariant", null);
exports.Shopify = Shopify;

@@ -14,3 +14,5 @@ export declare type ProductId = number;

export declare type ProductPublishedScope = 'global';
export declare type ProductVariant = Record<string, never>;
export declare type ProductVariant = {
id: ProductVariantId;
};
export declare type Product = {

@@ -55,1 +57,5 @@ id: ProductId;

};
export declare type CreateProductVariant = {
title?: string;
price?: string;
};
{
"name": "node-shopify",
"version": "5.2.0",
"version": "5.3.0",
"description": "module for creating Shopify API calls",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc