@openremote/rest 1.0.3 → 1.2.0-snapshot.20240512155932

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/dist/index.js DELETED
@@ -1,30 +0,0 @@
1
- import axios from "axios";
2
- import { ApiClient } from "./restclient";
3
- import Qs from "qs";
4
- export class RestApi {
5
- constructor() {
6
- this._axiosInstance = axios.create();
7
- this._axiosInstance.defaults.headers["Content-Type"] = "application/json";
8
- this._axiosInstance.interceptors.request.use((config) => {
9
- config.paramsSerializer = (params) => Qs.stringify(params, { arrayFormat: "repeat" });
10
- return config;
11
- });
12
- }
13
- get api() {
14
- return this._client;
15
- }
16
- get axiosInstance() {
17
- return this._axiosInstance;
18
- }
19
- setTimeout(timeout) {
20
- this._axiosInstance.defaults.timeout = timeout;
21
- }
22
- addRequestInterceptor(interceptor) {
23
- this._axiosInstance.interceptors.request.use(interceptor);
24
- }
25
- initialise(baseUrl) {
26
- this._client = new ApiClient(baseUrl, this._axiosInstance);
27
- }
28
- }
29
- export default new RestApi();
30
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,OAAO,OAAO;IAShB;QACI,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;QAC1E,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACpD,MAAM,CAAC,gBAAgB,GAAG,CAAC,MAAM,EAAE,EAAE,CAA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