@open-tender/store 0.7.8 → 0.7.10
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/.DS_Store
CHANGED
|
Binary file
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -4,16 +4,18 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var errors_1 = require("./errors");
|
|
5
5
|
var parseResponse = function (response, contentType) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
6
6
|
return tslib_1.__generator(this, function (_a) {
|
|
7
|
+
if (!response)
|
|
8
|
+
return [2 /*return*/, null];
|
|
7
9
|
switch (contentType) {
|
|
8
10
|
case 'text/csv':
|
|
9
11
|
case 'text/plain':
|
|
10
12
|
case 'text/html':
|
|
11
13
|
case 'text/xml':
|
|
12
|
-
return [2 /*return*/, response
|
|
14
|
+
return [2 /*return*/, response.text()];
|
|
13
15
|
case 'application/pdf':
|
|
14
|
-
return [2 /*return*/, response
|
|
16
|
+
return [2 /*return*/, response.blob()];
|
|
15
17
|
default:
|
|
16
|
-
return [2 /*return*/, response
|
|
18
|
+
return [2 /*return*/, response.json()];
|
|
17
19
|
}
|
|
18
20
|
return [2 /*return*/];
|
|
19
21
|
});
|
|
@@ -70,11 +72,7 @@ var PosAPI = /** @class */ (function () {
|
|
|
70
72
|
method: method,
|
|
71
73
|
headers: makeHeaders(this.terminalId),
|
|
72
74
|
body: data ? JSON.stringify(data) : null
|
|
73
|
-
})
|
|
74
|
-
// if (res.status === 204) {
|
|
75
|
-
// return resolve()
|
|
76
|
-
// }
|
|
77
|
-
];
|
|
75
|
+
})];
|
|
78
76
|
case 1:
|
|
79
77
|
res = _b.sent();
|
|
80
78
|
contentType = (_a = res.headers.get('Content-Type')) === null || _a === void 0 ? void 0 : _a.split(';')[0];
|
|
@@ -35,7 +35,10 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
35
35
|
fulfilledMeta?: unknown;
|
|
36
36
|
rejectedMeta?: unknown;
|
|
37
37
|
}>;
|
|
38
|
-
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi"
|
|
38
|
+
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
39
|
+
apiUrl: string;
|
|
40
|
+
terminalId: number;
|
|
41
|
+
}, "config/setApiTerminal">;
|
|
39
42
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
40
43
|
export declare const selectApi: (state: AppState) => PosAPI;
|
|
41
44
|
export declare const selectVersion: (state: AppState) => string | null | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.configReducer = exports.selectCashDrawer = exports.selectPinpad = exports.selectLoyalty = exports.selectTimezone = exports.selectMenuColors = exports.selectSelectOptions = exports.selectStore = exports.selectDevices = exports.selectVersion = exports.selectApi = exports.selectConfig = exports.setApi = exports.setVersion = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
4
|
+
exports.configReducer = exports.selectCashDrawer = exports.selectPinpad = exports.selectLoyalty = exports.selectTimezone = exports.selectMenuColors = exports.selectSelectOptions = exports.selectStore = exports.selectDevices = exports.selectVersion = exports.selectApi = exports.selectConfig = exports.setApiTerminal = exports.setApi = exports.setVersion = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
var services_1 = require("../services");
|
|
@@ -151,7 +151,7 @@ var configSlice = (0, toolkit_1.createSlice)({
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
|
-
exports.resetConfig = (_a = configSlice.actions, _a.resetConfig), exports.resetRetries = _a.resetRetries, exports.incrementRetries = _a.incrementRetries, exports.setVersion = _a.setVersion, exports.setApi = _a.setApi;
|
|
154
|
+
exports.resetConfig = (_a = configSlice.actions, _a.resetConfig), exports.resetRetries = _a.resetRetries, exports.incrementRetries = _a.incrementRetries, exports.setVersion = _a.setVersion, exports.setApi = _a.setApi, exports.setApiTerminal = _a.setApiTerminal;
|
|
155
155
|
var selectConfig = function (state) { return state.config; };
|
|
156
156
|
exports.selectConfig = selectConfig;
|
|
157
157
|
var selectApi = function (state) { return state.config.api; };
|
package/dist/esm/services/api.js
CHANGED
|
@@ -2,16 +2,18 @@ import { __awaiter, __generator } from "tslib";
|
|
|
2
2
|
import { errorsApi } from './errors';
|
|
3
3
|
var parseResponse = function (response, contentType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4
4
|
return __generator(this, function (_a) {
|
|
5
|
+
if (!response)
|
|
6
|
+
return [2 /*return*/, null];
|
|
5
7
|
switch (contentType) {
|
|
6
8
|
case 'text/csv':
|
|
7
9
|
case 'text/plain':
|
|
8
10
|
case 'text/html':
|
|
9
11
|
case 'text/xml':
|
|
10
|
-
return [2 /*return*/, response
|
|
12
|
+
return [2 /*return*/, response.text()];
|
|
11
13
|
case 'application/pdf':
|
|
12
|
-
return [2 /*return*/, response
|
|
14
|
+
return [2 /*return*/, response.blob()];
|
|
13
15
|
default:
|
|
14
|
-
return [2 /*return*/, response
|
|
16
|
+
return [2 /*return*/, response.json()];
|
|
15
17
|
}
|
|
16
18
|
return [2 /*return*/];
|
|
17
19
|
});
|
|
@@ -68,11 +70,7 @@ var PosAPI = /** @class */ (function () {
|
|
|
68
70
|
method: method,
|
|
69
71
|
headers: makeHeaders(this.terminalId),
|
|
70
72
|
body: data ? JSON.stringify(data) : null
|
|
71
|
-
})
|
|
72
|
-
// if (res.status === 204) {
|
|
73
|
-
// return resolve()
|
|
74
|
-
// }
|
|
75
|
-
];
|
|
73
|
+
})];
|
|
76
74
|
case 1:
|
|
77
75
|
res = _b.sent();
|
|
78
76
|
contentType = (_a = res.headers.get('Content-Type')) === null || _a === void 0 ? void 0 : _a.split(';')[0];
|
|
@@ -35,7 +35,10 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
35
35
|
fulfilledMeta?: unknown;
|
|
36
36
|
rejectedMeta?: unknown;
|
|
37
37
|
}>;
|
|
38
|
-
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi"
|
|
38
|
+
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
39
|
+
apiUrl: string;
|
|
40
|
+
terminalId: number;
|
|
41
|
+
}, "config/setApiTerminal">;
|
|
39
42
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
40
43
|
export declare const selectApi: (state: AppState) => PosAPI;
|
|
41
44
|
export declare const selectVersion: (state: AppState) => string | null | undefined;
|
|
@@ -148,7 +148,7 @@ var configSlice = createSlice({
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
|
-
export var resetConfig = (_a = configSlice.actions, _a.resetConfig), resetRetries = _a.resetRetries, incrementRetries = _a.incrementRetries, setVersion = _a.setVersion, setApi = _a.setApi;
|
|
151
|
+
export var resetConfig = (_a = configSlice.actions, _a.resetConfig), resetRetries = _a.resetRetries, incrementRetries = _a.incrementRetries, setVersion = _a.setVersion, setApi = _a.setApi, setApiTerminal = _a.setApiTerminal;
|
|
152
152
|
export var selectConfig = function (state) { return state.config; };
|
|
153
153
|
export var selectApi = function (state) { return state.config.api; };
|
|
154
154
|
export var selectVersion = function (state) { return state.config.version; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|