@zeniai/client-epic-state 4.19.37-betaVR4 → 4.19.37-betaVR5
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.
|
@@ -4,12 +4,24 @@ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePay
|
|
|
4
4
|
import { bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
5
5
|
export const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(bulkUploadReceipts.match), mergeMap((action) => {
|
|
6
6
|
const { files } = action.payload;
|
|
7
|
+
// #region agent log
|
|
8
|
+
fetch('http://127.0.0.1:7645/ingest/3d281ada-4e8f-4f88-b6d6-ac0851976786', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '171bc9' }, body: JSON.stringify({ sessionId: '171bc9', location: 'bulkUploadReceiptsEpic.ts:31', message: 'files from action.payload', data: { fileCount: files?.length, filesType: typeof files, isArray: Array.isArray(files), fileDetails: files?.map((f) => ({ name: f?.name, size: f?.size, type: f?.type, isFile: f instanceof File, isBlobLike: f instanceof Blob, constructor: f?.constructor?.name })) }, timestamp: Date.now(), runId: 'run1', hypothesisId: 'H-A' }) }).catch(() => { });
|
|
9
|
+
// #endregion
|
|
7
10
|
const formData = new FormData();
|
|
8
11
|
for (const file of files) {
|
|
9
12
|
formData.append('files', file, file.name);
|
|
10
13
|
}
|
|
14
|
+
// #region agent log
|
|
15
|
+
const fdEntries = [];
|
|
16
|
+
formData.forEach((value, key) => { fdEntries.push({ key, type: typeof value, isFile: value instanceof File, isBlob: value instanceof Blob, name: value?.name, size: value?.size, constructor: value?.constructor?.name }); });
|
|
17
|
+
fetch('http://127.0.0.1:7645/ingest/3d281ada-4e8f-4f88-b6d6-ac0851976786', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '171bc9' }, body: JSON.stringify({ sessionId: '171bc9', location: 'bulkUploadReceiptsEpic.ts:38', message: 'FormData entries before send', data: { entryCount: fdEntries.length, entries: fdEntries }, timestamp: Date.now(), runId: 'run1', hypothesisId: 'H-B' }) }).catch(() => { });
|
|
18
|
+
// #endregion
|
|
19
|
+
const uploadUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`;
|
|
20
|
+
// #region agent log
|
|
21
|
+
fetch('http://127.0.0.1:7645/ingest/3d281ada-4e8f-4f88-b6d6-ac0851976786', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '171bc9' }, body: JSON.stringify({ sessionId: '171bc9', location: 'bulkUploadReceiptsEpic.ts:42', message: 'upload URL and method', data: { url: uploadUrl, method: 'postFormData' }, timestamp: Date.now(), runId: 'run1', hypothesisId: 'H-E' }) }).catch(() => { });
|
|
22
|
+
// #endregion
|
|
11
23
|
return zeniAPI
|
|
12
|
-
.postFormData(
|
|
24
|
+
.postFormData(uploadUrl, formData)
|
|
13
25
|
.pipe(mergeMap((response) => {
|
|
14
26
|
if (isSuccessResponse(response) && response.data != null) {
|
|
15
27
|
return of(bulkUploadReceiptsSuccess({
|
|
@@ -7,12 +7,24 @@ const responsePayload_1 = require("../../../../responsePayload");
|
|
|
7
7
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
8
8
|
const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.mergeMap)((action) => {
|
|
9
9
|
const { files } = action.payload;
|
|
10
|
+
// #region agent log
|
|
11
|
+
fetch('http://127.0.0.1:7645/ingest/3d281ada-4e8f-4f88-b6d6-ac0851976786', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '171bc9' }, body: JSON.stringify({ sessionId: '171bc9', location: 'bulkUploadReceiptsEpic.ts:31', message: 'files from action.payload', data: { fileCount: files?.length, filesType: typeof files, isArray: Array.isArray(files), fileDetails: files?.map((f) => ({ name: f?.name, size: f?.size, type: f?.type, isFile: f instanceof File, isBlobLike: f instanceof Blob, constructor: f?.constructor?.name })) }, timestamp: Date.now(), runId: 'run1', hypothesisId: 'H-A' }) }).catch(() => { });
|
|
12
|
+
// #endregion
|
|
10
13
|
const formData = new FormData();
|
|
11
14
|
for (const file of files) {
|
|
12
15
|
formData.append('files', file, file.name);
|
|
13
16
|
}
|
|
17
|
+
// #region agent log
|
|
18
|
+
const fdEntries = [];
|
|
19
|
+
formData.forEach((value, key) => { fdEntries.push({ key, type: typeof value, isFile: value instanceof File, isBlob: value instanceof Blob, name: value?.name, size: value?.size, constructor: value?.constructor?.name }); });
|
|
20
|
+
fetch('http://127.0.0.1:7645/ingest/3d281ada-4e8f-4f88-b6d6-ac0851976786', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '171bc9' }, body: JSON.stringify({ sessionId: '171bc9', location: 'bulkUploadReceiptsEpic.ts:38', message: 'FormData entries before send', data: { entryCount: fdEntries.length, entries: fdEntries }, timestamp: Date.now(), runId: 'run1', hypothesisId: 'H-B' }) }).catch(() => { });
|
|
21
|
+
// #endregion
|
|
22
|
+
const uploadUrl = `${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`;
|
|
23
|
+
// #region agent log
|
|
24
|
+
fetch('http://127.0.0.1:7645/ingest/3d281ada-4e8f-4f88-b6d6-ac0851976786', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '171bc9' }, body: JSON.stringify({ sessionId: '171bc9', location: 'bulkUploadReceiptsEpic.ts:42', message: 'upload URL and method', data: { url: uploadUrl, method: 'postFormData' }, timestamp: Date.now(), runId: 'run1', hypothesisId: 'H-E' }) }).catch(() => { });
|
|
25
|
+
// #endregion
|
|
14
26
|
return zeniAPI
|
|
15
|
-
.postFormData(
|
|
27
|
+
.postFormData(uploadUrl, formData)
|
|
16
28
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
29
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
30
|
return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.37-
|
|
3
|
+
"version": "4.19.37-betaVR5",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
112
112
|
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
113
113
|
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
114
|
-
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\"
|
|
114
|
+
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\"",
|
|
115
115
|
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
116
116
|
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
117
117
|
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|