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 2.4.0 to 2.5.0

5

lib/index.d.ts

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

import { Shop } from './types/shop';
import { OrderId, UpdateOrder } from './types/order';
import { OrderId, UpdateOrder, OrderMetafieldId } from './types/order';
export declare class Shopify {

@@ -28,2 +28,5 @@ private readonly instance;

deleteOrder(id: OrderId): Promise<ResultOK<any> | ResultFAIL<any>>;
getOrderMetafields(id: OrderId): Promise<ResultOK<any> | ResultFAIL<any>>;
getOrderMetafield(orderId: OrderId, metafieldId: OrderMetafieldId): Promise<ResultOK<any> | ResultFAIL<any>>;
updateOrderMetafield(orderId: OrderId, metafieldId: OrderMetafieldId, updateOrderMetafield: object): Promise<ResultOK<any> | ResultFAIL<any>>;
}

@@ -222,3 +222,39 @@ "use strict";

}
getOrderMetafields(id) {
return __awaiter(this, void 0, void 0, function* () {
try {
const { data: { metafields }, } = yield this.instance.get(`/admin/orders/${id}/metafields.json`);
return node_result_1.ResultOk(metafields);
}
catch (error) {
return node_result_1.ResultFail(error);
}
});
}
getOrderMetafield(orderId, metafieldId) {
return __awaiter(this, void 0, void 0, function* () {
try {
const { data: { metafield }, } = yield this.instance.get(`/admin/orders/${orderId}/metafields/${metafieldId}.json`);
return node_result_1.ResultOk(metafield);
}
catch (error) {
return node_result_1.ResultFail(error);
}
});
}
updateOrderMetafield(orderId, metafieldId, updateOrderMetafield) {
return __awaiter(this, void 0, void 0, function* () {
try {
const payload = {
metafield: Object.assign({ id: metafieldId }, updateOrderMetafield),
};
const { data: { metafield }, } = yield this.instance.put(`/admin/orders/${orderId}/metafields/${metafieldId}.json`, payload);
return node_result_1.ResultOk(metafield);
}
catch (error) {
return node_result_1.ResultFail(error);
}
});
}
}
exports.Shopify = Shopify;

@@ -7,17 +7,14 @@ export declare type OrderId = number;

export declare type UpdateOrderTags = {
id: OrderId;
tags: OrderTags;
};
export declare type UpdateOrderNote = {
id: OrderId;
note: OrderNote;
};
export declare type UpdateOrderEmail = {
id: OrderId;
email: OrderEmail;
};
export declare type UpdateOrderPhone = {
id: OrderId;
phone: OrderPhone;
};
export declare type UpdateOrder = UpdateOrderTags | UpdateOrderNote | UpdateOrderEmail | UpdateOrderPhone;
export declare type OrderMetafieldId = number;

2

package.json
{
"name": "node-shopify",
"version": "2.4.0",
"version": "2.5.0",
"description": "shopify",

@@ -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