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

@e2y/odata-client

Package Overview
Dependencies
Maintainers
6
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@e2y/odata-client

odata client

  • 1.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-31.82%
Maintainers
6
Weekly downloads
 
Created
Source

odata-client

This package wraps the amazing npm package o.js adding the extra functionality to run cronjobs.

Usage

import { ODataClient } from '@e2y/odata-client';

const odata = ODataClient.configuredWith({
  baseURL: 'https://localhost:9002/odata2webservices/',
  password: '*****',
  username: 'admin'
});

const order = ((await odata.handler.get(ODATA_ENDPOINTS.orders).query({
  $expand: 'paymentTransactions/entries',
  $filter: `code eq '123'`,
  $format: 'json'
})) as unknown) as IODataGetResponse<IOrder>;

In order to create your own tasks, use the handler defined in the odata instance. Check the o.js documentation to improve your queries. Also, it is possible to cast the responses using your own types with IODataGetResponse<T>.

To run a cronjob, we need to complete the configuration adding the attributes defined in cronjob. The attribute prePersistenceHookBeanId is mandatory. While the attribute endpoint can be empty. In that case, it will point to InboundCronJobs/CronJobs by default.

After configuring it properly. We just need to run the following command:

await odata.runCronjob('fullMiraklImportShopsOffersCompositeCronJob');

Thanks

Special thanks to janhommes for his amazing work.

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

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.

Install

Related posts

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