2.1.3 • Published 1 year ago

@e2y/odata-client v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

2.1.3

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

1.0.13

1 year ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago