
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
priority-tsdk
Advanced tools
This repository serves as a base for code and documentation relating to Priority ERP Development for third parties. It should be used along with the documentation.
npm i priority-tsdk
Filtering a collection with logic operators:
const Client = require("priority-tsdk");
const apiClient = new Client({ url, username, password });
// URL : {{baseUrl}}/LOGPART?$filter=TYPE eq 'P' and LASTPRICE gt 200
const data = await apiClient
.screen("LOGPART")
.where({ TYPE: "P": LASTPRICE: ["gt", 200] })
.get();
Fetch a collection along with its related subform:
const Client = require('priority-tsdk');
const apiClient = new Client({ url, username, password });
// URL : {{baseUrl}}/ORDERS?$expand=ORDERITEMS_SUBFORM
const data = await apiClient
.screen('ORDERS')
.where({ CUSTNAME: 'T000001' })
.withRelated(['ORDERITEMS_SUBFORM'])
.get();
Paginate a collection:
const Client = require('priority-tsdk');
const apiClient = new Client({ url, username, password });
// URL : {{baseUrl}}/LOGPART?$top={{size}}&$skip${{offset}}
const data = await apiClient.screen('LOGPART').paginate(page, size);
Combining the operators for a complex query:
const Client = require('priority-tsdk');
const apiClient = new Client({ url, username, password });
// URL: {{baseUrl}}/ORDERS?$filter=CUSTNAME+eq+'T000001'&$expand=ORDERITEMS_SUBFORM($filter=PRICE+gt+3;$select=KLINE,PARTNAME,PDES,TQUANT,PRICE;$expand=ORDISTATUSLOG_SUBFORM),SHIPTO2_SUBFORM,ORDERSTEXT_SUBFORM&$select=CUSTNAME,CDES,ORDNAME
const data = await apiClient
.screen('ORDERS')
.where({ CUSTNAME: 'T000001' })
.withRelated(['ORDERITEMS_SUBFORM', 'SHIPTO2_SUBFORM', 'ORDERSTEXT_SUBFORM'])
.modifyRelated('ORDERITEMS_SUBFORM', queryBuilder => {
queryBuilder
.where({ PRICE: ['gt', 3] })
.select(['KLINE', 'PARTNAME', 'PDES', 'TQUANT', 'PRICE'])
.withRelated(['ORDISTATUSLOG_SUBFORM']);
})
.select(['CUSTNAME', 'CDES', 'ORDNAME'])
.get();
(constructor)(< string >url, < string >username, < string >password) - Creates and returns a new Priority client instance.
screen(< string >screenName) - (< PriorityClient >) - Sets the screen(collection) where the resources are fetched.
subform(< string >subformName) - (< PriorityClient >) - Sets the related subform(sub-collection) where the resources are fetched.
findOne(< object >identifier) - (< PriorityClient >) - Fetches only ONE entity from the related collection.
where(< object >filters) - (< PriorityClient >) - Filters entities that match the filters in the collection
The filters are a key-value object where the value can be a
string || numberor an array with a logic operator as the first element and the value as the second:
const filters = { PRICE: 50 }; // PRICE+eq+50
const logicalFilters = { PRICE: ['gt', 50] }; // PRICE+gt+50
withRelated(< string[] >subforms) - (< PriorityClient >) - Includes subform data inside the related collection data
modifyRelated(< string >subformName, modifierFunction) - (< PriorityClient >) - Modifies a subform that was included in the URL
select(< string[] >fieldsToSelect) - (< PriorityClient >) - Selects the fields fetched
since(< string >time) - (< PriorityClient >) - Fetches items created after a certain date
orderBy(< string >field, < string >order) - (< PriorityClient >) - Sorts the entities fetched. The order can be: "desc" | "asc"
get() - (Promise< any >) - Makes a GET request
post() - (Promise< any >) - Makes a POST request
patch() - (Promise< any >) - Makes a PATCH request
request(< string >method, data) - (Promise< any >) - Makes a request with the provided method and data.
paginate(< number >page, < number >size) - (Promise< any[] >) - Paginates the response from the API
paginateAction(< number >page, < number >size, callback, limit) - (Promise< any[] >) - Paginates the response from the API and calls the callback passing the response as params. The limit is used to set the collective maximum number of entities that should fetched from the API: defaults to Infinity.
FAQs
Priority ERP Typescript SDK
We found that priority-tsdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.