@zeniai/client-epic-state 4.19.37-betaVR6 → 4.19.37-betaVR7

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.
@@ -17,8 +17,30 @@ export const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.p
17
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: 'run2', hypothesisId: 'H-B' }) }).catch(() => { });
18
18
  // #endregion
19
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: 'run2', hypothesisId: 'H-E' }) }).catch(() => { });
20
+ // #region agent log – diagnostic: direct fetch bypassing postFormData, test field name "file" (singular)
21
+ const diagFormData = new FormData();
22
+ for (const f of files) {
23
+ diagFormData.append('file', f, f.name);
24
+ }
25
+ const diagHeaders = {};
26
+ const ah = zeniAPI.apiHeaders();
27
+ Object.keys(ah).forEach((k) => { if (k !== 'Content-Type') {
28
+ diagHeaders[k] = ah[k];
29
+ } });
30
+ fetch(uploadUrl, { method: 'POST', body: diagFormData, headers: diagHeaders })
31
+ .then((r) => r.text().then((t) => {
32
+ 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:diag-file', message: 'DIAG direct fetch field=file', data: { status: r.status, body: t, redirected: r.redirected, url: r.url }, timestamp: Date.now(), runId: 'run3', hypothesisId: 'H-K' }) }).catch(() => { });
33
+ })).catch(() => { });
34
+ // #endregion
35
+ // #region agent log – diagnostic: direct fetch bypassing postFormData, test field name "receipt_files"
36
+ const diagFormData2 = new FormData();
37
+ for (const f of files) {
38
+ diagFormData2.append('receipt_files', f, f.name);
39
+ }
40
+ fetch(uploadUrl, { method: 'POST', body: diagFormData2, headers: diagHeaders })
41
+ .then((r) => r.text().then((t) => {
42
+ 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:diag-receipt_files', message: 'DIAG direct fetch field=receipt_files', data: { status: r.status, body: t, redirected: r.redirected, url: r.url }, timestamp: Date.now(), runId: 'run3', hypothesisId: 'H-K' }) }).catch(() => { });
43
+ })).catch(() => { });
22
44
  // #endregion
23
45
  return zeniAPI
24
46
  .postFormData(uploadUrl, formData)
@@ -20,8 +20,30 @@ const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
20
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: 'run2', hypothesisId: 'H-B' }) }).catch(() => { });
21
21
  // #endregion
22
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: 'run2', hypothesisId: 'H-E' }) }).catch(() => { });
23
+ // #region agent log – diagnostic: direct fetch bypassing postFormData, test field name "file" (singular)
24
+ const diagFormData = new FormData();
25
+ for (const f of files) {
26
+ diagFormData.append('file', f, f.name);
27
+ }
28
+ const diagHeaders = {};
29
+ const ah = zeniAPI.apiHeaders();
30
+ Object.keys(ah).forEach((k) => { if (k !== 'Content-Type') {
31
+ diagHeaders[k] = ah[k];
32
+ } });
33
+ fetch(uploadUrl, { method: 'POST', body: diagFormData, headers: diagHeaders })
34
+ .then((r) => r.text().then((t) => {
35
+ 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:diag-file', message: 'DIAG direct fetch field=file', data: { status: r.status, body: t, redirected: r.redirected, url: r.url }, timestamp: Date.now(), runId: 'run3', hypothesisId: 'H-K' }) }).catch(() => { });
36
+ })).catch(() => { });
37
+ // #endregion
38
+ // #region agent log – diagnostic: direct fetch bypassing postFormData, test field name "receipt_files"
39
+ const diagFormData2 = new FormData();
40
+ for (const f of files) {
41
+ diagFormData2.append('receipt_files', f, f.name);
42
+ }
43
+ fetch(uploadUrl, { method: 'POST', body: diagFormData2, headers: diagHeaders })
44
+ .then((r) => r.text().then((t) => {
45
+ 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:diag-receipt_files', message: 'DIAG direct fetch field=receipt_files', data: { status: r.status, body: t, redirected: r.redirected, url: r.url }, timestamp: Date.now(), runId: 'run3', hypothesisId: 'H-K' }) }).catch(() => { });
46
+ })).catch(() => { });
25
47
  // #endregion
26
48
  return zeniAPI
27
49
  .postFormData(uploadUrl, formData)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.37-betaVR6",
3
+ "version": "4.19.37-betaVR7",
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",