@epilot/automation-client 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,43 +1,31 @@
1
- # `@epilot/automation-client`
1
+ # @epilot/automation-client
2
2
 
3
- API Client for epilot automation API.
3
+ [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=automation%3ACI)
4
+ [![npm version](https://img.shields.io/npm/v/@epilot/automation-client.svg)](https://www.npmjs.com/package/@epilot/automation-client)
5
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/automation-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/automation-client)
6
+ [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE)
4
7
 
5
- Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
8
+ Client library for epilot [Workflow API](https://docs.epilot.io/api/automation)
6
9
 
7
- ## Getting Started
10
+ Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
8
11
 
9
- Install the package:
12
+ ## Installation
10
13
 
11
14
  ```bash
12
- npm install --save-dev @epilot/automation-client
15
+ npm install --save @epilot/automation-client
13
16
  ```
14
17
 
15
- Import the package:
16
-
17
- ```typescript
18
- import { getClient } from '@epilot/automation-client';
19
- ```
18
+ ## Usage
20
19
 
21
- Use the client:
22
20
  ```typescript
23
- // get typed client
24
- const client = await getClient();
21
+ import { getClient } from "@epilot/automation-client";
25
22
 
26
- // call an operation
27
- const res = await client.testS3();
28
- ```
29
-
30
- ## BaseURL & Authorization
31
-
32
- To pass an authorization header and set up the API url, you can use axios
33
- defaults:
34
-
35
- ```typescript
36
- const client = getClient();
37
- client.defaults.baseURL = config.API_URL;
38
- client.defaults.headers['authorization'] = `Bearer ${token}`;
23
+ const automationClient = getClient();
24
+ const res = await automationClient.searchFlows(null, {
25
+ schema: "mySchema",
26
+ });
39
27
  ```
40
28
 
41
- ## API Docs:
29
+ ## Documentation
42
30
 
43
- https://docs.api.epilot.io/
31
+ https://docs.epilot.io/docs/automation/intro
package/dist/client.js CHANGED
@@ -1,14 +1,32 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
17
  exports.getClient = void 0;
18
+ var lambda_powertools_correlation_ids_1 = __importDefault(require("@dazn/lambda-powertools-correlation-ids"));
7
19
  var openapi_client_axios_1 = __importDefault(require("openapi-client-axios"));
8
20
  var definition_1 = __importDefault(require("./definition"));
9
21
  var getClient = function () {
10
22
  var api = new openapi_client_axios_1.default({ definition: definition_1.default, quick: true });
11
- return api.initSync();
23
+ var apiClient = api.initSync();
24
+ apiClient.interceptors.request.use(function (config) {
25
+ var correlationHeaders = lambda_powertools_correlation_ids_1.default.get() || {};
26
+ config.headers = __assign(__assign({}, (config.headers || {})), correlationHeaders);
27
+ return config;
28
+ });
29
+ return apiClient;
12
30
  };
13
31
  exports.getClient = getClient;
14
32
  //# sourceMappingURL=client.js.map