@epilot/entity-client 4.34.3 → 4.34.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.
@@ -1,25 +0,0 @@
1
- import { getClient } from './client';
2
-
3
- describe('client', () => {
4
- describe('getClient', () => {
5
- it('should inititalise and return client', async () => {
6
- const client = getClient();
7
-
8
- expect(client.api.initialized).toBe(true);
9
- });
10
-
11
- it('should have operations', async () => {
12
- const client = getClient();
13
-
14
- const operations = client.api.getOperations();
15
-
16
- expect(operations.length).toBeGreaterThan(0);
17
- });
18
-
19
- it('should have a default server defined', async () => {
20
- const client = getClient();
21
-
22
- expect(client.defaults.baseURL).toBeDefined();
23
- });
24
- });
25
- });
package/src/client.ts DELETED
@@ -1,26 +0,0 @@
1
- import CorrelationIds from '@dazn/lambda-powertools-correlation-ids';
2
- import OpenAPIClientAxios from 'openapi-client-axios';
3
-
4
- import definition from './definition';
5
- import { Client } from './openapi';
6
-
7
- let client: Client;
8
- export const getClient = () => {
9
- if (!client) {
10
- client = createClient();
11
- }
12
-
13
- return client;
14
- };
15
-
16
- export const createClient = () => {
17
- const api = new OpenAPIClientAxios({ definition, quick: true });
18
- const apiClient = api.initSync<Client>();
19
-
20
- apiClient.defaults.headers.common = {
21
- ...(apiClient.defaults.headers.common ?? {}),
22
- ...(CorrelationIds.get() || {}),
23
- };
24
-
25
- return apiClient;
26
- };
package/src/definition.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { Document } from 'openapi-client-axios';
2
-
3
- import definition from './openapi-runtime.json';
4
-
5
- export default (definition as unknown) as Document;
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './client';
2
- export * from './openapi';
3
- export * from './schema-model';
4
-
5
- export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';