@epilot/entity-client 3.0.8 → 3.0.11
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/.gitignore +3 -0
- package/dist/client.js.map +1 -0
- package/dist/definition.js +1 -1
- package/dist/definition.js.map +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -0
- package/dist/openapi.d.ts +38 -1
- package/dist/openapi.json +38 -1
- package/dist/schema-model.js.map +1 -0
- package/jest.config.ts +13 -0
- package/package.json +2 -2
- package/src/client.test.ts +19 -0
- package/src/client.ts +21 -0
- package/src/definition.ts +5 -0
- package/src/index.ts +4 -0
- package/src/openapi.d.ts +3944 -0
- package/src/openapi.json +3739 -0
- package/src/schema-model.ts +30 -0
- package/webpack.config.js +28 -0
package/dist/openapi.json
CHANGED
|
@@ -1330,6 +1330,16 @@
|
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
|
+
},
|
|
1334
|
+
"sharing": {
|
|
1335
|
+
"type": "object",
|
|
1336
|
+
"properties": {
|
|
1337
|
+
"show_sharing_button": {
|
|
1338
|
+
"type": "boolean",
|
|
1339
|
+
"description": "Show the sharing button in entity detail view",
|
|
1340
|
+
"example": true
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1333
1343
|
}
|
|
1334
1344
|
}
|
|
1335
1345
|
},
|
|
@@ -1354,6 +1364,10 @@
|
|
|
1354
1364
|
"expanded": {
|
|
1355
1365
|
"type": "boolean"
|
|
1356
1366
|
},
|
|
1367
|
+
"render_condition": {
|
|
1368
|
+
"type": "string",
|
|
1369
|
+
"example": "composite_price = \"false\""
|
|
1370
|
+
},
|
|
1357
1371
|
"order": {
|
|
1358
1372
|
"description": "Render order of the group",
|
|
1359
1373
|
"type": "integer",
|
|
@@ -1900,6 +1914,10 @@
|
|
|
1900
1914
|
"currency"
|
|
1901
1915
|
]
|
|
1902
1916
|
},
|
|
1917
|
+
"currency_selector_only": {
|
|
1918
|
+
"type": "boolean",
|
|
1919
|
+
"default": false
|
|
1920
|
+
},
|
|
1903
1921
|
"currency": {
|
|
1904
1922
|
"description": "An array of currency configurations with a country code (ISO-4217)",
|
|
1905
1923
|
"type": "array",
|
|
@@ -2123,7 +2141,8 @@
|
|
|
2123
2141
|
"email",
|
|
2124
2142
|
"address",
|
|
2125
2143
|
"relation",
|
|
2126
|
-
"payment"
|
|
2144
|
+
"payment",
|
|
2145
|
+
"price_component"
|
|
2127
2146
|
]
|
|
2128
2147
|
},
|
|
2129
2148
|
"enable_relation_picker": {
|
|
@@ -2348,6 +2367,10 @@
|
|
|
2348
2367
|
"description": "name of the hook to use",
|
|
2349
2368
|
"example": "EntityDetailsV2:Tab"
|
|
2350
2369
|
},
|
|
2370
|
+
"render_condition": {
|
|
2371
|
+
"type": "string",
|
|
2372
|
+
"example": "composite_price = \"false\""
|
|
2373
|
+
},
|
|
2351
2374
|
"order": {
|
|
2352
2375
|
"type": "integer",
|
|
2353
2376
|
"description": "render order (ascending)",
|
|
@@ -3031,6 +3054,20 @@
|
|
|
3031
3054
|
}
|
|
3032
3055
|
}
|
|
3033
3056
|
]
|
|
3057
|
+
},
|
|
3058
|
+
"diff": {
|
|
3059
|
+
"type": "object",
|
|
3060
|
+
"properties": {
|
|
3061
|
+
"added": {
|
|
3062
|
+
"$ref": "#/components/schemas/Entity"
|
|
3063
|
+
},
|
|
3064
|
+
"updated": {
|
|
3065
|
+
"$ref": "#/components/schemas/Entity"
|
|
3066
|
+
},
|
|
3067
|
+
"deleted": {
|
|
3068
|
+
"$ref": "#/components/schemas/Entity"
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3034
3071
|
}
|
|
3035
3072
|
},
|
|
3036
3073
|
"required": [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-model.js","sourceRoot":"","sources":["../src/schema-model.ts"],"names":[],"mappings":";;;AAEA,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B;;;OAGG;IACH,qCAAa,CAAA;IACb,yCAAiB,CAAA;AACnB,CAAC,EAPW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAO/B"}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Config } from '@jest/types';
|
|
2
|
+
|
|
3
|
+
const config: Config.InitialOptions = {
|
|
4
|
+
preset: 'ts-jest',
|
|
5
|
+
testEnvironment: 'node',
|
|
6
|
+
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
|
|
7
|
+
testPathIgnorePatterns: ['node_modules'],
|
|
8
|
+
coveragePathIgnorePatterns: ['__tests__', 'node_modules'],
|
|
9
|
+
verbose: true,
|
|
10
|
+
silent: true,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/entity-client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"description": "JavaScript client library for the epilot Core Entity API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"webpack": "^5.18.0",
|
|
59
59
|
"webpack-cli": "^4.4.0"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
});
|
package/src/client.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
export const getClient = () => {
|
|
8
|
+
const api = new OpenAPIClientAxios({ definition, quick: true });
|
|
9
|
+
const apiClient = api.initSync<Client>();
|
|
10
|
+
apiClient.interceptors.request.use((config) => {
|
|
11
|
+
const correlationHeaders = CorrelationIds.get() || {};
|
|
12
|
+
config.headers = {
|
|
13
|
+
...(config.headers || {}),
|
|
14
|
+
...correlationHeaders,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return config;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return apiClient;
|
|
21
|
+
};
|
package/src/index.ts
ADDED