New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@redhat-cloud-services/compliance-client

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redhat-cloud-services/compliance-client - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## [2.0.2](https://github.com/RedHatInsights/javascript-clients/compare/@redhat-cloud-services/compliance-client-2.0.1...@redhat-cloud-services/compliance-client-2.0.2) (2024-12-09)
### Dependency Updates
* `@redhat-cloud-services/javascript-clients-shared` updated to version `1.2.7`
## [2.0.1](https://github.com/RedHatInsights/javascript-clients/compare/@redhat-cloud-services/compliance-client-2.0.0...@redhat-cloud-services/compliance-client-2.0.1) (2024-11-22)

@@ -7,0 +12,0 @@

2

package.json
{
"name": "@redhat-cloud-services/compliance-client",
"version": "2.0.1",
"version": "2.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -18,10 +18,16 @@ # Javascript client for the compliance API

To correctly bootstrap this API you should use this config (no need to define it multiple times, just one config and reimport it anywhere you want to use it).
This package comes with a client in its `api.ts` already defined with every call available.
```JS
// api.js
import APIFactory from '@redhat-cloud-services/compliance-client/utils';
import createEndpoint from '@redhat-cloud-services/compliance-client/AssignRule';
`import ComplianceClient from '@redhat-cloud-services/javascript-clients-shared/utils';
ComplianceClient.someEndpoint();
```
To bootstrap this API manually, you should create your own client via the `APIFactory` defined in the `@redhat-cloud-services/javascript-clients-shared` package. See below for an example:
```JS
import APIFactory from '@redhat-cloud-services/javascript-clients-shared/utils';
import exampleEndpoint from '@redhat-cloud-services/compliance-client/ExampleEndpoint';
// BASE_PATH should be set in your constants file
const complianceApi = APIFactory(BASE_PATH, undefined, { AssignRule });
const complianceApi = APIFactory(BASE_PATH, undefined, { exampleEndpoint });
export complianceApi;

@@ -32,5 +38,6 @@ ```

```JS
// api.js
import axios from 'axios';
import { complianceApi } from '@redhat-cloud-services/compliance-client';
import APIFactory from '@redhat-cloud-services/javascript-clients-shared/utils';
import exampleEndpoint from '@redhat-cloud-services/compliance-client/ExampleEndpoint';
const instance = axios.create();

@@ -54,13 +61,16 @@

// BASE_PATH should be set in your constants file
const complianceApi = APIFactory(BASE_PATH, instance, { AssignRule });
const complianceApi = APIFactory(BASE_PATH, instance, { exampleEndpoint });
export complianceApi;
```
## Generating
Ensure you have the javascript-clients generator built first with `npm run build:generator`. Then, run `nx run @redhat-cloud-services/compliance-client:generate` to generate the package.
## Building
Run `nx build @redhat-cloud-services/compliance-client` to build the library.
Run `nx run @redhat-cloud-services/compliance-client:build` to build the package. This creates the `dist` for publishing.
## Running unit tests
Run `nx test @redhat-cloud-services/compliance-client` to execute the unit tests via [Jest](https://jestjs.io).
Run `nx run @redhat-cloud-services/compliance-client:test` to execute the unit tests via [Jest](https://jestjs.io).

@@ -67,0 +77,0 @@ ## API documentation

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