lightrail-client
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -11,2 +11,3 @@ import * as transactions from "./cardTransactions"; | ||
import { Contact } from "./model/Contact"; | ||
import { Transaction } from "./model/Transaction"; | ||
export { transactions, valueStores }; | ||
@@ -23,2 +24,4 @@ export declare function createCard(params: CreateCardParams): Promise<Card>; | ||
export declare function updateCard(card: string | Card, params: UpdateCardParams): Promise<Card>; | ||
export declare function cancelCard(card: string | Card, userSuppliedId: string): Promise<Card>; | ||
export declare function activeCard(card: string | Card, userSuppliedId: string): Promise<Transaction>; | ||
/** | ||
@@ -25,0 +28,0 @@ * Get cardId from the string (as the ID itself) or Card object. |
@@ -104,2 +104,24 @@ "use strict"; | ||
exports.updateCard = updateCard; | ||
function cancelCard(card, userSuppliedId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const cardId = getCardId(card); | ||
const resp = yield lightrail.request("POST", `cards/${encodeURIComponent(cardId)}/cancel`).send({ userSuppliedId: userSuppliedId }); | ||
if (resp.status === 200) { | ||
return resp.body.card; | ||
} | ||
throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
}); | ||
} | ||
exports.cancelCard = cancelCard; | ||
function activeCard(card, userSuppliedId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const cardId = getCardId(card); | ||
const resp = yield lightrail.request("POST", `cards/${encodeURIComponent(cardId)}/activate`).send({ userSuppliedId: userSuppliedId }); | ||
if (resp.status === 200) { | ||
return resp.body.transaction; | ||
} | ||
throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
}); | ||
} | ||
exports.activeCard = activeCard; | ||
/** | ||
@@ -106,0 +128,0 @@ * Get cardId from the string (as the ID itself) or Card object. |
{ | ||
"name": "lightrail-client", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "A Javascript and Typescript client for Lightrail", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48295
1106