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

lightrail-client

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightrail-client - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

dist/accounts.d.ts

2

dist/cardTransactions.d.ts

@@ -10,3 +10,3 @@ import { Card } from "./model/Card";

import { SimulateTransactionParams } from "./params/SimulateTransactionParams";
export declare function createTransaction(card: string | Card, params: CreateTransactionParams | SimulateTransactionParams): Promise<Transaction>;
export declare function createTransaction(card: string | Card, params: CreateTransactionParams): Promise<Transaction>;
export declare function simulateTransaction(card: string | Card, params: SimulateTransactionParams): Promise<Transaction>;

@@ -13,0 +13,0 @@ export declare function getTransaction(card: string | Card, transaction: string | Transaction): Promise<Transaction>;

@@ -7,3 +7,10 @@ import { Pagination } from "./model/Pagination";

import { CreateContactParams } from "./params/CreateContactParams";
import * as accounts from "./accounts";
export { accounts };
export declare function createContact(params: CreateContactParams): Promise<Contact>;
export declare function getContactByAnyIdentifier(contact: {
contactId?: string;
userSuppliedId?: string;
shopperId?: string;
}): Promise<Contact>;
export declare function getContacts(params?: GetContactsParams & PaginationParams): Promise<{

@@ -10,0 +17,0 @@ contacts: Contact[];

@@ -13,2 +13,4 @@ "use strict";

const LightrailRequestError_1 = require("./LightrailRequestError");
const accounts = require("./accounts");
exports.accounts = accounts;
function createContact(params) {

@@ -30,2 +32,19 @@ return __awaiter(this, void 0, void 0, function* () {

exports.createContact = createContact;
function getContactByAnyIdentifier(contact) {
return __awaiter(this, void 0, void 0, function* () {
if (contact.contactId) {
return getContactById(contact.contactId);
}
else if (contact.userSuppliedId) {
return getContactByUserSuppliedId(contact.userSuppliedId);
}
else if (contact.shopperId) {
return getContactByUserSuppliedId(contact.shopperId);
}
else {
throw new Error("one of contact.contactId, contact.userSuppliedId or contact.shopperId must be set");
}
});
}
exports.getContactByAnyIdentifier = getContactByAnyIdentifier;
function getContacts(params) {

@@ -56,3 +75,3 @@ return __awaiter(this, void 0, void 0, function* () {

return __awaiter(this, void 0, void 0, function* () {
const resp = yield this.getContacts({ userSuppliedId });
const resp = yield getContacts({ userSuppliedId });
if (resp.contacts.length > 0) {

@@ -59,0 +78,0 @@ return resp.contacts[0];

export * from "./CapturePendingTransactionParams";
export * from "./CreateAccountCardParams";
export * from "./CreateCardParams";

@@ -3,0 +4,0 @@ export * from "./CreateContactParams";

{
"name": "lightrail-client",
"version": "1.1.2",
"version": "1.2.0",
"description": "A Javascript and Typescript client for Lightrail",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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