lightrail-client
Advanced tools
Comparing version 3.2.3 to 4.0.0
# Changelog | ||
## 4.0.0 | ||
- Added listValuesTransactions to values | ||
- Added listValuesAttachedContacts to values | ||
- Breaking change refactoring how setting contentType:text/csv was accessed | ||
## 3.2.3 | ||
@@ -4,0 +9,0 @@ [Fixed Dist Dir](https://github.com/Giftbit/lightrail-client-javascript/pull/32) |
@@ -14,3 +14,2 @@ "use strict"; | ||
const LightrailRequestError_1 = require("./LightrailRequestError"); | ||
// CREATE | ||
function createContact(params) { | ||
@@ -32,3 +31,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.createContact = createContact; | ||
// READ | ||
function getContact(contact) { | ||
@@ -66,3 +64,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.listContactsValues = listContactsValues; | ||
// UPDATE | ||
function updateContact(contact, params) { | ||
@@ -90,3 +87,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.attachContactToValue = attachContactToValue; | ||
// DELETE | ||
function deleteContact(contact) { | ||
@@ -93,0 +89,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -14,3 +14,2 @@ "use strict"; | ||
const lightrail = require("./index"); | ||
// CREATE | ||
function createCurrency(params) { | ||
@@ -32,3 +31,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.createCurrency = createCurrency; | ||
// READ | ||
function listCurrencies() { | ||
@@ -58,3 +56,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.getCurrency = getCurrency; | ||
// UPDATE | ||
function updateCurrency(currency, params) { | ||
@@ -77,3 +74,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.updateCurrency = updateCurrency; | ||
// DELETE | ||
function deleteCurrency(currency) { | ||
@@ -80,0 +76,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -97,3 +97,3 @@ "use strict"; | ||
// TODO@Dan Review Previous import of package.json to dynamically set this was breaking publish (dist included src/ & package.json file) | ||
r.set("User-Agent", "Lightrail-JavaScript/3.2.3"); | ||
r.set("User-Agent", "Lightrail-JavaScript/4.0.0"); | ||
} | ||
@@ -100,0 +100,0 @@ if (exports.configuration.isBrowser) { |
@@ -11,4 +11,5 @@ import { Contact } from "../../model"; | ||
email?: FilterableString; | ||
valueId?: FilterableString; | ||
} | ||
export interface ListContactsResponse extends PaginatedLightrailResponse<Array<Contact>> { | ||
} |
@@ -7,3 +7,2 @@ import { PaginatedLightrailResponse } from "../LightrailResponse"; | ||
formatCurrencies?: boolean; | ||
csv?: boolean; | ||
issuanceId?: string; | ||
@@ -10,0 +9,0 @@ showCode?: boolean; |
@@ -14,3 +14,2 @@ "use strict"; | ||
const requestUtils_1 = require("./requestUtils"); | ||
// CREATE | ||
function createProgram(params) { | ||
@@ -32,3 +31,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.createProgram = createProgram; | ||
// READ | ||
function listPrograms(params) { | ||
@@ -55,3 +53,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.getProgram = getProgram; | ||
// UPDATE | ||
function updateProgram(program, params) { | ||
@@ -71,3 +68,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.updateProgram = updateProgram; | ||
// DELETE | ||
function deleteProgram(program) { | ||
@@ -84,5 +80,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.deleteProgram = deleteProgram; | ||
/////////////////// | ||
// [ ISSUANCE ] | ||
// CREATE | ||
function createIssuance(program, params) { | ||
@@ -105,3 +98,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.createIssuance = createIssuance; | ||
// READ | ||
function listIssuances(program, params) { | ||
@@ -133,3 +125,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.getIssuance = getIssuance; | ||
/////////////////// | ||
/** | ||
@@ -136,0 +127,0 @@ * Get programId from the string (as the ID itself) or Program object. |
@@ -14,3 +14,2 @@ "use strict"; | ||
const requestUtils_1 = require("./requestUtils"); | ||
// CREATE | ||
function checkout(params) { | ||
@@ -128,3 +127,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.voidPending = voidPending; | ||
// READ | ||
function listTransactions(params) { | ||
@@ -151,3 +149,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.getTransaction = getTransaction; | ||
/////////////////// | ||
/** | ||
@@ -154,0 +151,0 @@ * Get transactionId from the string (as the ID itself) or Transaction object. |
@@ -1,5 +0,6 @@ | ||
import { ChangeValuesCodeParams, ChangeValuesCodeResponse, CreateValueParams, CreateValueResponse, DeleteValueResponse, GetValueParams, GetValueResponse, ListValuesParams, ListValuesResponse, UpdateValueParams, UpdateValueResponse } from "./params"; | ||
import { ChangeValuesCodeParams, ChangeValuesCodeResponse, CreateValueParams, CreateValueResponse, DeleteValueResponse, GetValueParams, GetValueResponse, ListContactsParams, ListContactsResponse, ListTransactionsParams, ListTransactionsResponse, ListValuesParams, ListValuesResponse, UpdateValueParams, UpdateValueResponse } from "./params"; | ||
import { Value } from "./model"; | ||
import { ContentType } from "./params/ContentType"; | ||
export declare function createValue(params: CreateValueParams): Promise<CreateValueResponse>; | ||
export declare function listValues(params?: ListValuesParams): Promise<ListValuesResponse>; | ||
export declare function listValues(params?: ListValuesParams, contentType?: ContentType): Promise<ListValuesResponse>; | ||
export declare function getValue(value: string | Value, params?: GetValueParams): Promise<GetValueResponse>; | ||
@@ -9,2 +10,4 @@ export declare function updateValue(value: string | Value, params: UpdateValueParams): Promise<UpdateValueResponse>; | ||
export declare function deleteValue(value: string | Value): Promise<DeleteValueResponse>; | ||
export declare function listValuesTransactions(value: string | Value, params?: ListTransactionsParams): Promise<ListTransactionsResponse>; | ||
export declare function listValuesAttachedContacts(value: string | Value, params?: ListContactsParams): Promise<ListContactsResponse>; | ||
/** | ||
@@ -11,0 +14,0 @@ * Get contactId from the string (as the ID itself) or Contact object. |
@@ -14,3 +14,2 @@ "use strict"; | ||
const lightrail = require("./index"); | ||
// CREATE | ||
function createValue(params) { | ||
@@ -26,3 +25,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
if (requestUtils_1.isSuccessStatus(resp.status)) { | ||
return (requestUtils_1.formatResponse(resp)); | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
@@ -33,8 +32,7 @@ throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
exports.createValue = createValue; | ||
// READ | ||
function listValues(params) { | ||
function listValues(params, contentType = "application/json") { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const resp = yield lightrail.request("GET", "values").set("accept", (!!params && !!params.csv) ? "text/csv" : "application/json").query(requestUtils_1.formatFilterParams(params)); | ||
const resp = yield lightrail.request("GET", "values").set("accept", contentType).query(requestUtils_1.formatFilterParams(params)); | ||
if (requestUtils_1.isSuccessStatus(resp.status)) { | ||
return (requestUtils_1.formatResponse(resp)); | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
@@ -50,3 +48,3 @@ throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
if (requestUtils_1.isSuccessStatus(resp.status) || resp.status === 404) { | ||
return (requestUtils_1.formatResponse(resp)); | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
@@ -57,3 +55,2 @@ throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
exports.getValue = getValue; | ||
// UPDATE | ||
function updateValue(value, params) { | ||
@@ -64,3 +61,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
if (requestUtils_1.isSuccessStatus(resp.status)) { | ||
return (requestUtils_1.formatResponse(resp)); | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
@@ -76,3 +73,3 @@ throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
if (requestUtils_1.isSuccessStatus(resp.status)) { | ||
return (requestUtils_1.formatResponse(resp)); | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
@@ -83,3 +80,2 @@ throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
exports.changeValuesCode = changeValuesCode; | ||
// DELETE | ||
function deleteValue(value) { | ||
@@ -90,3 +86,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
if (requestUtils_1.isSuccessStatus(resp.status) || resp.status === 404) { | ||
return (requestUtils_1.formatResponse(resp)); | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
@@ -97,2 +93,24 @@ throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
exports.deleteValue = deleteValue; | ||
function listValuesTransactions(value, params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const valueId = getValueId(value); | ||
const resp = yield lightrail.request("GET", `values/${encodeURIComponent(valueId)}/transactions`).query(requestUtils_1.formatFilterParams(params)); | ||
if (requestUtils_1.isSuccessStatus(resp.status)) { | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
}); | ||
} | ||
exports.listValuesTransactions = listValuesTransactions; | ||
function listValuesAttachedContacts(value, params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const valueId = getValueId(value); | ||
const resp = yield lightrail.request("GET", `values/${encodeURIComponent(valueId)}/contacts`).query(requestUtils_1.formatFilterParams(params)); | ||
if (requestUtils_1.isSuccessStatus(resp.status)) { | ||
return requestUtils_1.formatResponse(resp); | ||
} | ||
throw new LightrailRequestError_1.LightrailRequestError(resp); | ||
}); | ||
} | ||
exports.listValuesAttachedContacts = listValuesAttachedContacts; | ||
/** | ||
@@ -99,0 +117,0 @@ * Get contactId from the string (as the ID itself) or Contact object. |
{ | ||
"name": "lightrail-client", | ||
"version": "3.2.3", | ||
"version": "4.0.0", | ||
"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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
82597
128
1894
0