@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 +17 -29
- package/dist/client.js +19 -1
- package/dist/definition.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -5
- package/dist/openapi.d.ts +4 -0
- package/dist/openapi.json +2001 -0
- package/package.json +39 -18
- package/tsconfig.json +23 -0
- package/src/openapi.d.ts +0 -1761
package/README.md
CHANGED
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @epilot/automation-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/epilot-dev/sdk-js/actions?query=automation%3ACI)
|
|
4
|
+
[](https://www.npmjs.com/package/@epilot/automation-client)
|
|
5
|
+
[](https://bundlephobia.com/package/@epilot/automation-client)
|
|
6
|
+
[](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
Client library for epilot [Workflow API](https://docs.epilot.io/api/automation)
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
## Installation
|
|
10
13
|
|
|
11
14
|
```bash
|
|
12
|
-
npm install --save
|
|
15
|
+
npm install --save @epilot/automation-client
|
|
13
16
|
```
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
import { getClient } from '@epilot/automation-client';
|
|
19
|
-
```
|
|
18
|
+
## Usage
|
|
20
19
|
|
|
21
|
-
Use the client:
|
|
22
20
|
```typescript
|
|
23
|
-
|
|
24
|
-
const client = await getClient();
|
|
21
|
+
import { getClient } from "@epilot/automation-client";
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
const res = await
|
|
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
|
-
##
|
|
29
|
+
## Documentation
|
|
42
30
|
|
|
43
|
-
https://docs.
|
|
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
|
-
|
|
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
|