Merged PR 2202: relay GET completion + notify logging fix
Related work items: #22229
This commit is contained in:
@@ -725,3 +725,385 @@ Validation:
|
|||||||
Follow-ups:
|
Follow-ups:
|
||||||
|
|
||||||
- Optional future auth hygiene (separate guarded slice): replace verbose auth `console.log` diagnostics with structured logger usage once production logging requirements are confirmed.
|
- Optional future auth hygiene (separate guarded slice): replace verbose auth `console.log` diagnostics with structured logger usage once production logging requirements are confirmed.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-019: TASK22229 P2-S1 relay forwarding pilot (proxy endpoint cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/middleware/relayForwarding.js`, `pages/api/endpoint/{getwatchedcasesproxy_api,getmyrepresentationsproxy_api,getrepresentationsproxy_api,getawaitingsubmissionproxy_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Start Priority-2 by piloting a shared relay forwarding helper on a bounded proxy endpoint cluster to reduce duplicated token/hash/header/axios boilerplate while preserving endpoint contracts.
|
||||||
|
impact: Maintainability and consistency improvement with no intended behavioral contract changes; error code/status/message and success payload contracts remain unchanged for migrated endpoints.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Added shared relay helper:
|
||||||
|
- `pages/api/middleware/relayForwarding.js`
|
||||||
|
- exports `relayGet({ queryUrl, res, errorResponse, transformData })`
|
||||||
|
- centralizes token fetch, relay URL + hash composition, `azureHeaders`, GET execution, success/error response handling, and logging
|
||||||
|
- Migrated pilot endpoint cluster to `relayGet`:
|
||||||
|
- `getwatchedcasesproxy_api.js` (with existing payload transform preserved)
|
||||||
|
- `getmyrepresentationsproxy_api.js`
|
||||||
|
- `getrepresentationsproxy_api.js`
|
||||||
|
- `getawaitingsubmissionproxy_api.js` (with existing payload transform preserved)
|
||||||
|
- Updated endpoint contract tests to mock `relayGet` for migrated routes while preserving existing assertions.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
|
||||||
|
- helper: 4/4
|
||||||
|
- file-handler: 53/53
|
||||||
|
- email-handler: 12/12
|
||||||
|
- endpoint-handler: 152/152
|
||||||
|
- documents-handler: 3/3
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- P2-S2 rollout: migrate the next relay-heavy endpoint batch onto `relayGet`/shared forwarding utility pattern.
|
||||||
|
- P2-S3 hardening: add shared timeout/retry config and redacted structured relay error logging policy.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-020: TASK22229 P2-S2 Batch 1 (account/login relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/middleware/relayForwarding.js`, `pages/api/endpoint/{getaccounts_api,getemailaccountcheck_api,getpreferredlanguage_api,getlogin_api,getpersonalaccount_api,getportalloginproxy_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Deliver first P2-S2 batch as a dedicated commit by migrating a bounded account/login endpoint cluster onto shared `relayGet` while preserving response contracts.
|
||||||
|
impact: Reduced relay boilerplate and improved consistency with no intended endpoint contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Extended `relayGet` to support optional `requestOptionsBuilder` for handlers requiring paged header variants.
|
||||||
|
- Migrated Batch 1 endpoints to `relayGet`:
|
||||||
|
- `getaccounts_api.js`
|
||||||
|
- `getemailaccountcheck_api.js`
|
||||||
|
- `getpreferredlanguage_api.js`
|
||||||
|
- `getlogin_api.js` (uses `azureHeadersPaged` via `requestOptionsBuilder`)
|
||||||
|
- `getpersonalaccount_api.js`
|
||||||
|
- `getportalloginproxy_api.js` (uses `azureHeadersPaged` via `requestOptionsBuilder`)
|
||||||
|
- Updated phase21 endpoint contract tests to mock `relayGet` for migrated handlers, preserving existing guard/catch/success assertions.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
|
||||||
|
- helper: 4/4
|
||||||
|
- file-handler: 53/53
|
||||||
|
- email-handler: 12/12
|
||||||
|
- endpoint-handler: 152/152
|
||||||
|
- documents-handler: 3/3
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with Batch 2 as next dedicated commit on this same branch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-021: TASK22229 P2-S2 Batch 2 (my-portal + representation relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getmycases_api,getmyrepresentations_api,getwatchedcases_api,getawaitingsubmission_api,getrepresentations_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Deliver second P2-S2 commit by migrating the next bounded portal/representation GET endpoint cluster onto shared `relayGet` while preserving route contracts.
|
||||||
|
impact: Reduced duplicated relay boilerplate and aligned forwarding behavior with no intended response contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 2 endpoints to `relayGet`:
|
||||||
|
- `getmycases_api.js` (preserved title mapping transform)
|
||||||
|
- `getmyrepresentations_api.js`
|
||||||
|
- `getwatchedcases_api.js` (preserved watched-case projection transform)
|
||||||
|
- `getawaitingsubmission_api.js` (preserved title mapping transform)
|
||||||
|
- `getrepresentations_api.js`
|
||||||
|
- Updated phase21 endpoint contract tests for migrated handlers by mocking `relayGet` in guard/catch test paths.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
|
||||||
|
- helper: 4/4
|
||||||
|
- file-handler: 53/53
|
||||||
|
- email-handler: 12/12
|
||||||
|
- endpoint-handler: 152/152
|
||||||
|
- documents-handler: 3/3
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with Batch 3 as the next dedicated commit on this branch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-022: TASK22229 P2-S2 Batch 3 (case/event relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getcase_api,getcasebyid_api,getincidentbyid_api,getsipsevents_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Deliver third P2-S2 commit by migrating an additional bounded case/event endpoint cluster onto shared `relayGet` while preserving route contracts.
|
||||||
|
impact: Further relay boilerplate reduction and consistent forwarding behavior with no intended contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 3 endpoints to `relayGet`:
|
||||||
|
- `getcase_api.js` (preserved `@odata.nextLink` normalization)
|
||||||
|
- `getcasebyid_api.js` (preserved `@odata.nextLink` normalization and array-wrapped success payload)
|
||||||
|
- `getincidentbyid_api.js`
|
||||||
|
- `getsipsevents_api.js`
|
||||||
|
- Updated phase21 endpoint contract tests to mock `relayGet` for migrated handlers in guard/catch paths.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
|
||||||
|
- helper: 4/4
|
||||||
|
- file-handler: 53/53
|
||||||
|
- email-handler: 12/12
|
||||||
|
- endpoint-handler: 152/152
|
||||||
|
- documents-handler: 3/3
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with next bounded batch (e.g. search/listing cluster) as a separate commit if required.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-023: TASK22229 P2-S2 Batch 6 (profile/form/document-history/portal-module relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getpersonalaccount_api,getformdata_api,getsearchdocumenthistory_api,getsearchdocumenthistorypaged_api,getportalmoduledetails_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Execute requested Batch 6 by migrating the next bounded set of read-only endpoint handlers to shared `relayGet` while preserving existing request validation and response/error contracts.
|
||||||
|
impact: Reduced endpoint relay boilerplate and improved consistency; no intended behavior contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 6 endpoints to shared `relayGet`:
|
||||||
|
- `getpersonalaccount_api.js`
|
||||||
|
- `getformdata_api.js`
|
||||||
|
- `getsearchdocumenthistory_api.js` (uses `requestOptionsBuilder` with `azureHeadersPaged`)
|
||||||
|
- `getsearchdocumenthistorypaged_api.js` (uses `requestOptionsBuilder` with `azureHeadersPaged`)
|
||||||
|
- `getportalmoduledetails_api.js`
|
||||||
|
- Preserved all existing required-query validation guards and existing error codes/messages.
|
||||||
|
- Updated Phase 21 endpoint contract tests to inject `relayGet` mocks for migrated handlers (validation path, catch path, and success path where applicable).
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Optional next bounded batch: migrate remaining legacy relay GET handlers in advanced/basic search-document/detail clusters that still use direct axios relay patterns.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-024: TASK22229 P2-S2 Batch 7 (search-document + portal-proxy relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getportalmoduledetailsproxy_api,getsearchdocumentTypes_api,getsearchdocumentdetails_api,getsearchdocumentdetailspaged_api,getappealpdfdocuments_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Continue P2-S2 in bounded commits by migrating a coherent search-document/portal-proxy GET cluster onto shared relay forwarding while preserving existing validation, transforms, and error contracts.
|
||||||
|
impact: Reduced duplicate relay plumbing and improved consistency in search-document handlers; no intended API contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 7 endpoints to shared `relayGet`:
|
||||||
|
- `getportalmoduledetailsproxy_api.js`
|
||||||
|
- `getsearchdocumentTypes_api.js`
|
||||||
|
- `getsearchdocumentdetails_api.js`
|
||||||
|
- `getsearchdocumentdetailspaged_api.js`
|
||||||
|
- `getappealpdfdocuments_api.js`
|
||||||
|
- Preserved existing guard behavior and error response contracts.
|
||||||
|
- Preserved endpoint-specific transform behavior via `transformData`, including:
|
||||||
|
- grouped search-document type payloads
|
||||||
|
- document hashlink enrichment and published-date normalization
|
||||||
|
- `@odata.nextLink` normalization where present
|
||||||
|
- appeal PDF document name projection
|
||||||
|
- Updated phase21 endpoint tests to mock `relayGet` for migrated handlers in validation/catch/success paths as applicable.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue with next bounded P2-S2 batch from remaining legacy GET endpoints (e.g., advanced/basic paged search-detail clusters and related non-migrated proxies).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-025: TASK22229 P2-S2 Batch 8 (basic search details + DNS details relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getbasicsearchpaged_api,getbasicsearchdetails_api,getbasicsearchdetailspaged_api,getbasicdnssearchdetails_api,getbasicdnssearchdetailspaged_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Continue the P2-S2 relay migration using bounded commits by moving the remaining basic-search-details and DNS-details GET handlers to shared `relayGet`, preserving existing guards and response contracts.
|
||||||
|
impact: Reduced duplicated relay plumbing and more consistent forwarding behavior across search-detail handlers; no intended API contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 8 endpoints to shared `relayGet`:
|
||||||
|
- `getbasicsearchpaged_api.js`
|
||||||
|
- `getbasicsearchdetails_api.js`
|
||||||
|
- `getbasicsearchdetailspaged_api.js`
|
||||||
|
- `getbasicdnssearchdetails_api.js`
|
||||||
|
- `getbasicdnssearchdetailspaged_api.js`
|
||||||
|
- Preserved existing validation guards and error contracts.
|
||||||
|
- Preserved existing endpoint-specific transforms:
|
||||||
|
- `@odata.nextLink` normalization in paged responses
|
||||||
|
- flattened ticketnumber enrichment for search detail handlers
|
||||||
|
- Updated phase21 endpoint contract tests to inject `relayGet` mocks for migrated handlers in validation and catch-path tests.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with next bounded batch from remaining legacy GET endpoints (currently: `createwatchedcases_api`, `deletewatchedcasesproxy_api`, `getadvancedsearch_api`, `getadvancedsearchpaged_api`, `getappealid_api`, `getbasicdnssearchpaged_api`, `getbasicpartsaveddetails_api`, `getbasicsearch_by_address_api`, `getbasicsearch_by_lparref_api`, `getdnscoords_api`, `getdnslist_api`, `getmylpacases_api`, `getportallogin_api`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-026: TASK22229 P2-S2 Batch 9 (appeal-id + DNS list/paged + part-saved relay GET cluster)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getappealid_api,getbasicdnssearchpaged_api,getbasicpartsaveddetails_api,getdnslist_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Continue bounded P2-S2 relay migration by moving another coherent set of read-only handlers to shared `relayGet`, preserving existing guards, transforms, and error contracts.
|
||||||
|
impact: Reduced duplicated relay plumbing and improved consistency for DNS list/paged and appeal detail lookup endpoints; no intended API contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 9 endpoints to shared `relayGet`:
|
||||||
|
- `getappealid_api.js`
|
||||||
|
- `getbasicdnssearchpaged_api.js`
|
||||||
|
- `getbasicpartsaveddetails_api.js`
|
||||||
|
- `getdnslist_api.js`
|
||||||
|
- Preserved existing input validation guards and endpoint-specific error contracts.
|
||||||
|
- Preserved endpoint-specific transform behavior (`@odata.nextLink` normalization in DNS list/paged handlers).
|
||||||
|
- Updated phase21 endpoint contract tests to inject `relayGet` mocks for these migrated handlers in guard and catch-path assertions.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with next bounded batch from remaining legacy relay GET endpoints (`createwatchedcases_api`, `deletewatchedcasesproxy_api`, `getadvancedsearch_api`, `getadvancedsearchpaged_api`, `getbasicsearch_by_address_api`, `getbasicsearch_by_lparref_api`, `getdnscoords_api`, `getmylpacases_api`, `getportallogin_api`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-027: TASK22229 P2-S2 Batch 10 (portal login + my LPA cases relay GET pair)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/{getportallogin_api,getmylpacases_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Continue bounded relay migration by moving two remaining high-use portal retrieval endpoints to shared `relayGet` while preserving existing hash/lookup guards and response contracts.
|
||||||
|
impact: Further relay boilerplate reduction and consistent forwarding behavior in portal login/LPA case retrieval flows; no intended API contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated Batch 10 endpoints to shared `relayGet`:
|
||||||
|
- `getportallogin_api.js` (preserved hash validation guard and error contract)
|
||||||
|
- `getmylpacases_api.js` (preserved LPA lookup/404 guard and title transform)
|
||||||
|
- Preserved endpoint-specific behavior:
|
||||||
|
- `getportallogin_api`: raw + encoded hash candidate validation before relay call
|
||||||
|
- `getmylpacases_api`: JSONPath LPA lookup with `LPA_NOT_FOUND` handling and `pinswg_title` enrichment transform
|
||||||
|
- Updated phase21 endpoint contract tests to inject `relayGet` mocks for migrated handlers in validation/catch/success paths.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with the remaining legacy relay GET candidates (`createwatchedcases_api`, `deletewatchedcasesproxy_api`, `getadvancedsearch_api`, `getadvancedsearchpaged_api`, `getbasicsearch_by_address_api`, `getbasicsearch_by_lparref_api`, `getdnscoords_api`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-028: TASK22229 P2-S2 Batch 11 (advanced-search-paged relay GET)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/endpoint/getadvancedsearchpaged_api.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Continue bounded relay migration by moving the remaining advanced-search paged GET handler to shared `relayGet` while preserving query validation and response contracts.
|
||||||
|
impact: Reduced duplicated relay plumbing and aligned advanced paged search route with shared forwarding; no intended API contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated `getadvancedsearchpaged_api.js` to shared `relayGet`.
|
||||||
|
- Preserved existing guard behavior and error contracts:
|
||||||
|
- `SEARCH_STRING_REQUIRED`
|
||||||
|
- `ORDER_BY_REQUIRED`
|
||||||
|
- `FIELD_SORT_REQUIRED`
|
||||||
|
- `SHOW_NUMBER_OF_RECORDS_REQUIRED`
|
||||||
|
- `INVALID_SEARCH_STRING`
|
||||||
|
- `ADVANCED_SEARCH_PAGED_FETCH_FAILED`
|
||||||
|
- Preserved endpoint-specific transform behavior (`@odata.nextLink` normalization via `transformData`).
|
||||||
|
- Updated phase21 endpoint contract tests to inject `relayGet` mocks for `getadvancedsearchpaged_api` guard/catch assertions.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Continue P2-S2 with remaining legacy relay GET candidates (`createwatchedcases_api`, `deletewatchedcasesproxy_api`, `getadvancedsearch_api`, `getbasicsearch_by_address_api`, `getbasicsearch_by_lparref_api`, `getdnscoords_api`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-029: TASK22229 P2-S2 Batch 12 (remaining relay GET candidates)
|
||||||
|
|
||||||
|
date: 2026-03-24
|
||||||
|
author: Cline
|
||||||
|
scope: `pages/api/middleware/relayForwarding.js`, `pages/api/endpoint/{createwatchedcases_api,deletewatchedcasesproxy_api,getadvancedsearch_api,getbasicsearch_by_address_api,getbasicsearch_by_lparref_api,getdnscoords_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
|
||||||
|
type: change
|
||||||
|
rationale: Complete Batch 12 by migrating the remaining listed legacy relay GET candidates to shared forwarding helpers while preserving endpoint-specific validation, transforms, and error contracts.
|
||||||
|
impact: Consolidated relay GET behavior and reduced endpoint-level relay boilerplate; no intended API contract changes.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Extended relay middleware with reusable helpers:
|
||||||
|
- `relayGetData` now supports token reuse via `transformData` path
|
||||||
|
- Added `forwardGetData` to support custom base URLs (used by proxy-to-local endpoint) while preserving hash behavior
|
||||||
|
- Migrated remaining Batch 12 candidates:
|
||||||
|
- `getadvancedsearch_api.js` -> `relayGet` + `relayGetData` for project-type enrichment loop
|
||||||
|
- `getdnscoords_api.js` -> `relayGetData` for both DNS + SIPS source pulls
|
||||||
|
- `getbasicsearch_by_lparref_api.js` -> `relayGetData`
|
||||||
|
- `getbasicsearch_by_address_api.js` -> `relayGetData` for appeal-type and incident fetches
|
||||||
|
- `deletewatchedcasesproxy_api.js` -> `forwardGetData` with `BASE_URL`
|
||||||
|
- `createwatchedcases_api.js` -> `relayGetData` for record-exists pre-check (POST/PATCH upsert flow preserved)
|
||||||
|
- Preserved endpoint-specific guard and error contracts (including status codes such as 500 for `BASIC_SEARCH_BY_ADDRESS_FETCH_FAILED`).
|
||||||
|
- Updated phase21 endpoint contract tests for migrated handlers to mock `relayGetData` / `forwardGetData` where appropriate.
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (152/152)
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Batch 12 completes the previously listed remaining P2-S2 relay GET candidates.
|
||||||
|
|||||||
@@ -63,10 +63,15 @@ export default async function ApiProxy(req, res) {
|
|||||||
const notifyClient = new NotifyClient(process.env.NOTIFY_API_KEY);
|
const notifyClient = new NotifyClient(process.env.NOTIFY_API_KEY);
|
||||||
//const emailReplyToId = process.env.EMAIL_REPLY_TO_ID;
|
//const emailReplyToId = process.env.EMAIL_REPLY_TO_ID;
|
||||||
|
|
||||||
consoleLogger({
|
console.info(
|
||||||
event: "notify_send_attempt",
|
"notify_send_attempt",
|
||||||
payload: redactSensitive(data)
|
redactSensitive({
|
||||||
});
|
templateId: data.templateId,
|
||||||
|
emailAddress: data.emailAddress,
|
||||||
|
reference: data.reference,
|
||||||
|
personalisation: data.personalisation
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await notifyClient.sendEmail(data.templateId, data.emailAddress, {
|
await notifyClient.sendEmail(data.templateId, data.emailAddress, {
|
||||||
|
|||||||
@@ -15,26 +15,30 @@ import { consoleLogger } from "../../../actions/core/logger";
|
|||||||
import { getToken } from "../../../actions/core/token";
|
import { getToken } from "../../../actions/core/token";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { hashAPIPath } from "../../../actions/core/hash";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
|
import { relayGetData } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
const WEBAPI_URL =
|
||||||
process.env.RELAY_ROOT ||
|
process.env.RELAY_ROOT ||
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
const recordExists = async (incidentId, contactId, token) => {
|
const recordExists = async (incidentId, contactId, accessToken) => {
|
||||||
const filter = `$filter=pinswg_WatchedCase/incidentid eq ${incidentId} and pinswg_Contact/contactid eq ${contactId}`;
|
const filter = `$filter=pinswg_WatchedCase/incidentid eq ${incidentId} and pinswg_Contact/contactid eq ${contactId}`;
|
||||||
const queryUrl = `pinswg_watchlists?${filter}`;
|
const queryUrl = `pinswg_watchlists?${filter}`;
|
||||||
const url = WEBAPI_URL + queryUrl + hashAPIPath(queryUrl);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await axios.get(url, {
|
const response = await relayGetData({
|
||||||
|
queryUrl,
|
||||||
|
accessToken,
|
||||||
|
requestOptionsBuilder: (token) => ({
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + token.access_token,
|
Authorization: "Bearer " + token,
|
||||||
Accept: "application/json"
|
Accept: "application/json"
|
||||||
}
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.data.value && res.data.value.length > 0) {
|
if (response.data.value && response.data.value.length > 0) {
|
||||||
return res.data.value[0]; // return the existing record
|
return response.data.value[0]; // return the existing record
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -79,7 +83,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
const incidentId = watchedCaseMatch[1];
|
const incidentId = watchedCaseMatch[1];
|
||||||
const contactId = contactMatch[1];
|
const contactId = contactMatch[1];
|
||||||
|
|
||||||
const existingRecord = await recordExists(incidentId, contactId, token);
|
const existingRecord = await recordExists(
|
||||||
|
incidentId,
|
||||||
|
contactId,
|
||||||
|
token.access_token
|
||||||
|
);
|
||||||
|
|
||||||
let method, queryUrl;
|
let method, queryUrl;
|
||||||
|
|
||||||
|
|||||||
@@ -17,16 +17,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
|
import { forwardGetData } from "../middleware/relayForwarding";
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const BASE_URL = process.env.API_ROOT || "http://localhost:3000";
|
const BASE_URL = process.env.API_ROOT || "http://localhost:3000";
|
||||||
|
|
||||||
@@ -45,15 +39,15 @@ export default async function ApiProxy(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" +
|
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" +
|
||||||
watchedCaseID;
|
watchedCaseID;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await forwardGetData({
|
||||||
BASE_URL + queryUrl + hashAPIPath(queryUrl),
|
baseUrl: BASE_URL,
|
||||||
azureHeaders(token.access_token)
|
queryUrl,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken)
|
||||||
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return respondSuccess(res, data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -15,16 +15,8 @@
|
|||||||
* 200:
|
* 200:
|
||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const emailAddress = req.query.emailAddress;
|
const emailAddress = req.query.emailAddress;
|
||||||
@@ -37,24 +29,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts?$filter=emailaddress1 eq '" +
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
emailAddress +
|
emailAddress +
|
||||||
"'&$count=true&$select=emailaddress1, contactid";
|
"'&$count=true&$select=emailaddress1, contactid";
|
||||||
const { data } = await axios.get(
|
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeaders(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return relayGet({
|
||||||
} catch (error) {
|
queryUrl,
|
||||||
consoleLogger(error);
|
res,
|
||||||
return respondError(res, {
|
errorResponse: {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "ACCOUNTS_FETCH_FAILED",
|
code: "ACCOUNTS_FETCH_FAILED",
|
||||||
message: "Failed to fetch accounts"
|
message: "Failed to fetch accounts"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,16 +21,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
|
import { relayGet, relayGetData } from "../middleware/relayForwarding";
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const encodedSearchString = req.query.searchstring;
|
const encodedSearchString = req.query.searchstring;
|
||||||
@@ -109,13 +103,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
queryString +
|
queryString +
|
||||||
" pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
" pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
try {
|
return relayGet({
|
||||||
const token = await getToken();
|
queryUrl,
|
||||||
const { data } = await axios.get(
|
res,
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
azureHeadersPaged(token.access_token)
|
transformData: async (data, accessToken) => {
|
||||||
);
|
|
||||||
|
|
||||||
if (Object.prototype.hasOwnProperty.call(data, "@odata.nextLink")) {
|
if (Object.prototype.hasOwnProperty.call(data, "@odata.nextLink")) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
@@ -133,18 +125,22 @@ export default async function ApiProxy(req, res) {
|
|||||||
searchString.projecttype +
|
searchString.projecttype +
|
||||||
"&$select=_pinswg_projecttype_value";
|
"&$select=_pinswg_projecttype_value";
|
||||||
|
|
||||||
const response = await axios.get(
|
const projectTypeResponse = await relayGetData({
|
||||||
WEBAPI_URL +
|
queryUrl: projectTypeQuery,
|
||||||
projectTypeQuery +
|
accessToken,
|
||||||
hashAPIPath(projectTypeQuery),
|
requestOptionsBuilder: (token) =>
|
||||||
azureHeadersPaged(token.access_token)
|
azureHeadersPaged(token)
|
||||||
);
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
response.data.value.length > 0 &&
|
projectTypeResponse.data.value.length > 0 &&
|
||||||
response.data.value[0]._pinswg_projecttype_value != null
|
projectTypeResponse.data.value[0]
|
||||||
|
._pinswg_projecttype_value != null
|
||||||
) {
|
) {
|
||||||
Object.assign(item, response.data.value[0]);
|
Object.assign(
|
||||||
|
item,
|
||||||
|
projectTypeResponse.data.value[0]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
@@ -158,13 +154,12 @@ export default async function ApiProxy(req, res) {
|
|||||||
data["@odata.count"] = data.value.length;
|
data["@odata.count"] = data.value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "ADVANCED_SEARCH_FETCH_FAILED",
|
code: "ADVANCED_SEARCH_FETCH_FAILED",
|
||||||
message: "Failed to fetch advanced search results"
|
message: "Failed to fetch advanced search results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -47,17 +47,10 @@
|
|||||||
// * description: Success
|
// * description: Success
|
||||||
// */
|
// */
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const rawSearchString = req.query.searchstring;
|
const rawSearchString = req.query.searchstring;
|
||||||
@@ -180,81 +173,23 @@ export default async function ApiProxy(req, res) {
|
|||||||
: "");
|
: "");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("adv qu: ", queryUrl);
|
return relayGet({
|
||||||
|
queryUrl,
|
||||||
try {
|
res,
|
||||||
const token = await getToken();
|
requestOptionsBuilder: (accessToken) =>
|
||||||
const { data } = await axios.get(
|
azureHeadersPagedCustom(accessToken, showNumberOfRecords),
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
transformData: (data) => {
|
||||||
azureHeadersPagedCustom(token.access_token, showNumberOfRecords)
|
|
||||||
);
|
|
||||||
|
|
||||||
let dataStr;
|
let dataStr;
|
||||||
_.has(data, "@odata.nextLink") === true &&
|
_.has(data, "@odata.nextLink") === true &&
|
||||||
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
|
||||||
if (_.has(searchString, "projecttype")) {
|
return data;
|
||||||
// await updateValueArray(data, token);
|
},
|
||||||
// async function updateValueArray(data, token) {
|
errorResponse: {
|
||||||
// for (let i = 0; i < data.value.length; i++) {
|
|
||||||
// const item = data.value[i];
|
|
||||||
// try {
|
|
||||||
// // Axios call using the `incidentid` to fetch additional data
|
|
||||||
// const response = await axios.get(
|
|
||||||
// WEBAPI_URL +
|
|
||||||
// "pinswg_sipses?$filter=_pinswg_sipscase_value eq " +
|
|
||||||
// item.incidentid +
|
|
||||||
// " and _pinswg_projecttype_value eq " +
|
|
||||||
// searchString.projecttype +
|
|
||||||
// "&$select=_pinswg_projecttype_value" +
|
|
||||||
// hashAPIPath(
|
|
||||||
// "pinswg_sipses?$filter=_pinswg_sipscase_value eq " +
|
|
||||||
// item.incidentid +
|
|
||||||
// " and _pinswg_projecttype_value eq " +
|
|
||||||
// searchString.projecttype +
|
|
||||||
// "&$select=_pinswg_projecttype_value"
|
|
||||||
// ),
|
|
||||||
// azureHeadersPaged(token.access_token)
|
|
||||||
// );
|
|
||||||
// // Assuming the response contains the additional data you want to add
|
|
||||||
// // console.log(response.data.value[0]);
|
|
||||||
// console.log(response.data.value);
|
|
||||||
// if (
|
|
||||||
// response.data.value.length > 0 &&
|
|
||||||
// response.data.value[0]
|
|
||||||
// ._pinswg_projecttype_value != null
|
|
||||||
// ) {
|
|
||||||
// Object.assign(
|
|
||||||
// item,
|
|
||||||
// response.data.value[0]
|
|
||||||
// ); // Update item with new data
|
|
||||||
// } else {
|
|
||||||
// console.log(
|
|
||||||
// `No project type found for incident ID ${item.incidentid}`
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error(
|
|
||||||
// `Error fetching data for incident ID ${item.incidentid}:`,
|
|
||||||
// error
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// data.value = data.value.filter(
|
|
||||||
// (item) => item._pinswg_projecttype_value != null
|
|
||||||
// );
|
|
||||||
// data["@odata.count"] = data.value.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "ADVANCED_SEARCH_PAGED_FETCH_FAILED",
|
code: "ADVANCED_SEARCH_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch advanced search paged results"
|
message: "Failed to fetch advanced search paged results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -28,16 +28,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const caseReference = req.query.caseReference;
|
const caseReference = req.query.caseReference;
|
||||||
@@ -77,8 +70,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const escapedCaseReference = caseReference.split("'").join("''");
|
const escapedCaseReference = caseReference.split("'").join("''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -89,18 +80,14 @@ export default async function ApiProxy(req, res) {
|
|||||||
escapedCaseReference +
|
escapedCaseReference +
|
||||||
"'";
|
"'";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
|
errorResponse: {
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "APPEAL_ID_FETCH_FAILED",
|
code: "APPEAL_ID_FETCH_FAILED",
|
||||||
message: "Failed to fetch appeal id"
|
message: "Failed to fetch appeal id"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,16 +16,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const groupArray = (arr) => {
|
const groupArray = (arr) => {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
@@ -67,41 +60,26 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_documents?$count=true&$filter=_pinswg_documentids_value eq " +
|
"pinswg_documents?$count=true&$filter=_pinswg_documentids_value eq " +
|
||||||
incidentID +
|
incidentID +
|
||||||
" and not(contains(pinswg_name,'_Appeal_Form.pdf'))&$select=pinswg_name,pinswg_isharedocumentlocations";
|
" and not(contains(pinswg_name,'_Appeal_Form.pdf'))&$select=pinswg_name,pinswg_isharedocumentlocations";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
// //delete data["pinswg_documentid"];
|
transformData: (data) => {
|
||||||
// data.value.forEach(function (element) {
|
|
||||||
// delete element["pinswg_documentid"];
|
|
||||||
// });
|
|
||||||
|
|
||||||
// var dataArr = groupArray(data.value);
|
|
||||||
|
|
||||||
// // var dataStr;
|
|
||||||
// // _.has(data, "@odata.nextLink") == true &&
|
|
||||||
// // ((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
|
||||||
// // (data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
|
||||||
|
|
||||||
data.value.forEach((item) => {
|
data.value.forEach((item) => {
|
||||||
item.name = item.pinswg_name;
|
item.name = item.pinswg_name;
|
||||||
});
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "APPEAL_PDF_DOCUMENTS_FETCH_FAILED",
|
code: "APPEAL_PDF_DOCUMENTS_FETCH_FAILED",
|
||||||
message: "Failed to fetch appeal PDF documents"
|
message: "Failed to fetch appeal PDF documents"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,21 +9,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' " +
|
"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' " +
|
||||||
(process.env.SHOWSIPS !== "true"
|
(process.env.SHOWSIPS !== "true"
|
||||||
@@ -37,18 +26,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
// "stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
// "stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
||||||
//"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Developments of National Significance' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
//"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Developments of National Significance' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "APPEAL_TYPES_FETCH_FAILED",
|
code: "APPEAL_TYPES_FETCH_FAILED",
|
||||||
message: "Failed to fetch appeal types"
|
message: "Failed to fetch appeal types"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -42,30 +34,25 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
" and servicestage eq 1 and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
" and servicestage eq 1 and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
element.pinswg_title = element.title;
|
element.pinswg_title = element.title;
|
||||||
});
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "AWAITING_SUBMISSION_FETCH_FAILED",
|
code: "AWAITING_SUBMISSION_FETCH_FAILED",
|
||||||
message: "Failed to fetch awaiting submissions"
|
message: "Failed to fetch awaiting submissions"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,16 +10,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -35,29 +27,25 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
element.pinswg_title = element.title;
|
element.pinswg_title = element.title;
|
||||||
});
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "AWAITING_SUBMISSION_PROXY_FETCH_FAILED",
|
code: "AWAITING_SUBMISSION_PROXY_FETCH_FAILED",
|
||||||
message: "Failed to fetch awaiting submission proxy details"
|
message: "Failed to fetch awaiting submission proxy details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,42 +16,31 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002)and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
"incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002)and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
if (_.has(data, "@odata.nextLink") === true) {
|
if (_.has(data, "@odata.nextLink") === true) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_DNS_SEARCH_FETCH_FAILED",
|
code: "BASIC_DNS_SEARCH_FETCH_FAILED",
|
||||||
message: "Failed to fetch basic DNS search results"
|
message: "Failed to fetch basic DNS search results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,18 +10,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const caseReference = req.query.caseReference;
|
const caseReference = req.query.caseReference;
|
||||||
@@ -37,9 +29,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
let queryUrl =
|
let queryUrl =
|
||||||
"pinswg_dnses?$filter=pinswg_name eq '" +
|
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
caseReference +
|
caseReference +
|
||||||
@@ -47,18 +36,14 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
|
queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
|
errorResponse: {
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_DNS_SEARCH_DETAILS_FETCH_FAILED",
|
code: "BASIC_DNS_SEARCH_DETAILS_FETCH_FAILED",
|
||||||
message: "Failed to fetch basic DNS search details"
|
message: "Failed to fetch basic DNS search details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,18 +9,11 @@
|
|||||||
* 200:
|
* 200:
|
||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const caseReference = req.query.caseReference;
|
const caseReference = req.query.caseReference;
|
||||||
@@ -36,9 +29,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
let queryUrl =
|
let queryUrl =
|
||||||
"pinswg_dnses?$filter=pinswg_name eq '" +
|
"pinswg_dnses?$filter=pinswg_name eq '" +
|
||||||
caseReference +
|
caseReference +
|
||||||
@@ -46,23 +36,22 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
|
queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
if (_.has(data, "@odata.nextLink") === true) {
|
if (_.has(data, "@odata.nextLink") === true) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_DNS_SEARCH_DETAILS_PAGED_FETCH_FAILED",
|
code: "BASIC_DNS_SEARCH_DETAILS_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch paged basic DNS search details"
|
message: "Failed to fetch paged basic DNS search details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -42,17 +42,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const pageNumber = req.query.pageNumber;
|
const pageNumber = req.query.pageNumber;
|
||||||
@@ -87,9 +80,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=" +
|
"incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=" +
|
||||||
orderby +
|
orderby +
|
||||||
@@ -100,23 +90,23 @@ export default async function ApiProxy(req, res) {
|
|||||||
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||||
: "");
|
: "");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPagedCustom(token.access_token, showNumberOfRecords)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) =>
|
||||||
|
azureHeadersPagedCustom(accessToken, showNumberOfRecords),
|
||||||
|
transformData: (data) => {
|
||||||
if (_.has(data, "@odata.nextLink") === true) {
|
if (_.has(data, "@odata.nextLink") === true) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_DNS_SEARCH_PAGED_FETCH_FAILED",
|
code: "BASIC_DNS_SEARCH_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch paged basic DNS search results"
|
message: "Failed to fetch paged basic DNS search results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,17 +16,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const searchString = req.query.searchString;
|
const searchString = req.query.searchString;
|
||||||
@@ -39,8 +32,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const escapedSearchString = searchString.replace(/\'/g, "''");
|
const escapedSearchString = searchString.replace(/\'/g, "''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -50,23 +41,22 @@ export default async function ApiProxy(req, res) {
|
|||||||
escapedSearchString +
|
escapedSearchString +
|
||||||
"')) and (pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002 ) and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
"')) and (pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002 ) and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
let dataStr;
|
let dataStr;
|
||||||
_.has(data, "@odata.nextLink") === true &&
|
_.has(data, "@odata.nextLink") === true &&
|
||||||
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_DNS_URL_SEARCH_FETCH_FAILED",
|
code: "BASIC_DNS_URL_SEARCH_FETCH_FAILED",
|
||||||
message: "Failed to fetch DNS URL search results"
|
message: "Failed to fetch DNS URL search results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
import axios from "axios";
|
|
||||||
import { azureHeadersNoOdata } from "../../../actions/core/headers";
|
import { azureHeadersNoOdata } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const appealTypeName = req.query.appealTypeName;
|
const appealTypeName = req.query.appealTypeName;
|
||||||
@@ -44,9 +37,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
appealTypeName +
|
appealTypeName +
|
||||||
"?$filter=_" +
|
"?$filter=_" +
|
||||||
@@ -55,18 +45,15 @@ export default async function ApiProxy(req, res) {
|
|||||||
incidentID +
|
incidentID +
|
||||||
"&$count=true";
|
"&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersNoOdata(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) =>
|
||||||
|
azureHeadersNoOdata(accessToken),
|
||||||
return respondSuccess(res, data);
|
errorResponse: {
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_PART_SAVED_DETAILS_FETCH_FAILED",
|
code: "BASIC_PART_SAVED_DETAILS_FETCH_FAILED",
|
||||||
message: "Failed to fetch basic part-saved details"
|
message: "Failed to fetch basic part-saved details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,16 +15,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const searchString = req.query.searchString;
|
const searchString = req.query.searchString;
|
||||||
@@ -37,8 +30,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const escapedSearchString = searchString.replace(/\'/g, "''");
|
const escapedSearchString = searchString.replace(/\'/g, "''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -54,23 +45,22 @@ export default async function ApiProxy(req, res) {
|
|||||||
: "") +
|
: "") +
|
||||||
"and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
"and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
if (Object.prototype.hasOwnProperty.call(data, "@odata.nextLink")) {
|
if (Object.prototype.hasOwnProperty.call(data, "@odata.nextLink")) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_SEARCH_FETCH_FAILED",
|
code: "BASIC_SEARCH_FETCH_FAILED",
|
||||||
message: "Failed to fetch basic search results"
|
message: "Failed to fetch basic search results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
import axios from "axios";
|
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { getToken } from "../../../actions/core/token";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
|
import { relayGetData } from "../middleware/relayForwarding";
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const escapeODataString = (value = "") =>
|
const escapeODataString = (value = "") =>
|
||||||
String(value).replace(/'/g, "''").trim();
|
String(value).replace(/'/g, "''").trim();
|
||||||
@@ -366,15 +360,15 @@ const fetchSearchResultsForAppealType = async (item, token, params) => {
|
|||||||
"\n\n",
|
"\n\n",
|
||||||
item.LogicalCollectionName,
|
item.LogicalCollectionName,
|
||||||
"\n\n",
|
"\n\n",
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
"\n==========================================\n"
|
"\n==========================================\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get(
|
const { data } = await relayGetData({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
accessToken: token.access_token
|
||||||
);
|
});
|
||||||
|
|
||||||
return (data.value || []).map((record) => ({
|
return (data.value || []).map((record) => ({
|
||||||
...record,
|
...record,
|
||||||
@@ -391,10 +385,10 @@ const fetchIncident = async (incidentId, token) => {
|
|||||||
const queryUrl = buildIncidentQueryUrl(incidentId);
|
const queryUrl = buildIncidentQueryUrl(incidentId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get(
|
const { data } = await relayGetData({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
accessToken: token.access_token
|
||||||
);
|
});
|
||||||
|
|
||||||
return data?.value?.[0] || null;
|
return data?.value?.[0] || null;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
|
import { relayGetData } from "../middleware/relayForwarding";
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
// ✅ IMPORTANT: Only include the 23 types that actually contain pinswg_lpaapplicationreference
|
// ✅ IMPORTANT: Only include the 23 types that actually contain pinswg_lpaapplicationreference
|
||||||
// You can copy from your existing appealTypeArray but only keep those entities.
|
// You can copy from your existing appealTypeArray but only keep those entities.
|
||||||
@@ -281,7 +274,6 @@ var appealTypeArrayWithLpaRef = [
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
try {
|
try {
|
||||||
const token = await getToken();
|
|
||||||
let lpaRef = (req.query.lpaRef || "").trim();
|
let lpaRef = (req.query.lpaRef || "").trim();
|
||||||
|
|
||||||
if (!lpaRef) {
|
if (!lpaRef) {
|
||||||
@@ -321,10 +313,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
`&$count=true` +
|
`&$count=true` +
|
||||||
`&$orderby=modifiedon desc`;
|
`&$orderby=modifiedon desc`;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
const { data } = await relayGetData({ queryUrl });
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeaders(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Normalize response rows
|
// Normalize response rows
|
||||||
const normalized = (data?.value || []).map((r) => ({
|
const normalized = (data?.value || []).map((r) => ({
|
||||||
|
|||||||
@@ -29,18 +29,11 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
|
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const appealTypeName = req.query.appealTypeName;
|
const appealTypeName = req.query.appealTypeName;
|
||||||
@@ -77,9 +70,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const navigationProperty =
|
const navigationProperty =
|
||||||
getNavigationPropertyByPrimaryAttribute(
|
getNavigationPropertyByPrimaryAttribute(
|
||||||
primaryIdAttribute
|
primaryIdAttribute
|
||||||
@@ -119,11 +109,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
// "\n==========================================\n"
|
// "\n==========================================\n"
|
||||||
// );
|
// );
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
let flattened = data.value.map((r) => ({
|
let flattened = data.value.map((r) => ({
|
||||||
...r,
|
...r,
|
||||||
ticketnumber: r[navigationProperty]?.ticketnumber || null
|
ticketnumber: r[navigationProperty]?.ticketnumber || null
|
||||||
@@ -131,13 +121,12 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
data.value = flattened;
|
data.value = flattened;
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_SEARCH_DETAILS_FETCH_FAILED",
|
code: "BASIC_SEARCH_DETAILS_FETCH_FAILED",
|
||||||
message: "Failed to fetch basic search details"
|
message: "Failed to fetch basic search details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -29,19 +29,12 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
|
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const appealTypeName = req.query.appealTypeName;
|
const appealTypeName = req.query.appealTypeName;
|
||||||
@@ -78,9 +71,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const navigationProperty =
|
const navigationProperty =
|
||||||
getNavigationPropertyByPrimaryAttribute(
|
getNavigationPropertyByPrimaryAttribute(
|
||||||
primaryIdAttribute
|
primaryIdAttribute
|
||||||
@@ -112,11 +102,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
? "pinswg_sipscase_value"
|
? "pinswg_sipscase_value"
|
||||||
: primaryIdAttribute + "s_value");
|
: primaryIdAttribute + "s_value");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
let flattened = data.value.map((r) => ({
|
let flattened = data.value.map((r) => ({
|
||||||
...r,
|
...r,
|
||||||
ticketnumber: r[navigationProperty]?.ticketnumber || null
|
ticketnumber: r[navigationProperty]?.ticketnumber || null
|
||||||
@@ -129,13 +119,12 @@ export default async function ApiProxy(req, res) {
|
|||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_SEARCH_DETAILS_PAGED_FETCH_FAILED",
|
code: "BASIC_SEARCH_DETAILS_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch paged basic search details"
|
message: "Failed to fetch paged basic search details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -42,17 +42,10 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
let searchString = req.query.searchString;
|
let searchString = req.query.searchString;
|
||||||
@@ -96,9 +89,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
searchString = searchString.replace(/\'/g, "''");
|
searchString = searchString.replace(/\'/g, "''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -121,23 +111,23 @@ export default async function ApiProxy(req, res) {
|
|||||||
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||||
: "");
|
: "");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPagedCustom(token.access_token, showNumberOfRecords)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) =>
|
||||||
|
azureHeadersPagedCustom(accessToken, showNumberOfRecords),
|
||||||
|
transformData: (data) => {
|
||||||
if (_.has(data, "@odata.nextLink") === true) {
|
if (_.has(data, "@odata.nextLink") === true) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "BASIC_SEARCH_PAGED_FETCH_FAILED",
|
code: "BASIC_SEARCH_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch paged basic search results"
|
message: "Failed to fetch paged basic search results"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,17 +10,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const incidentID = req.query.incidentID;
|
const incidentID = req.query.incidentID;
|
||||||
@@ -33,30 +25,26 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents(" +
|
"incidents(" +
|
||||||
incidentID +
|
incidentID +
|
||||||
")?$select=ticketnumber,title,pinswg_appealcasetype";
|
")?$select=ticketnumber,title,pinswg_appealcasetype";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
if (_.has(data, "@odata.nextLink") === true) {
|
if (_.has(data, "@odata.nextLink") === true) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "CASE_FETCH_FAILED",
|
code: "CASE_FETCH_FAILED",
|
||||||
message: "Failed to fetch case"
|
message: "Failed to fetch case"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,17 +10,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const incidentID = req.query.incidentID;
|
const incidentID = req.query.incidentID;
|
||||||
@@ -33,27 +25,23 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl = "incidents(" + incidentID + ")";
|
const queryUrl = "incidents(" + incidentID + ")";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
if (_.has(data, "@odata.nextLink") === true) {
|
if (_.has(data, "@odata.nextLink") === true) {
|
||||||
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
const dataStr = JSON.stringify(data["@odata.nextLink"]);
|
||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, [data]);
|
return [data];
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "CASE_BY_ID_FETCH_FAILED",
|
code: "CASE_BY_ID_FETCH_FAILED",
|
||||||
message: "Failed to fetch case by id"
|
message: "Failed to fetch case by id"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,16 +15,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const caseId = req.query.id;
|
const caseId = req.query.id;
|
||||||
@@ -37,26 +30,19 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"tasks?$select=_regardingobjectid_value,subject,description,createdon,statuscode,scheduledend,scheduledstart&$count=true&$filter=_regardingobjectid_value eq " +
|
"tasks?$select=_regardingobjectid_value,subject,description,createdon,statuscode,scheduledend,scheduledstart&$count=true&$filter=_regardingobjectid_value eq " +
|
||||||
caseId +
|
caseId +
|
||||||
" and contains(subject, 'Banner') and statuscode ne 5&$orderby=createdon desc";
|
" and contains(subject, 'Banner') and statuscode ne 5&$orderby=createdon desc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "CASE_MESSAGE_FETCH_FAILED",
|
code: "CASE_MESSAGE_FETCH_FAILED",
|
||||||
message: "Failed to fetch case messages"
|
message: "Failed to fetch case messages"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import OSPoint from "ospoint";
|
import OSPoint from "ospoint";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
|
import { relayGetData } from "../middleware/relayForwarding";
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const renameKeys = (obj) => {
|
const renameKeys = (obj) => {
|
||||||
const keyMappings = {
|
const keyMappings = {
|
||||||
@@ -75,8 +68,6 @@ const keysToRemove = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_dnses?$select=pinswg_projectlocation,pinswg_mapzoomlevel,pinswg_name,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,pinswg_projectname,pinswg_dnsid,_pinswg_associatedlpa_value,_pinswg_appellant_value&$filter=pinswg_anticipatedgridreferencenorthingtext ne null and pinswg_anticipatedgridreferenceeastingtext ne null&$count=true";
|
"pinswg_dnses?$select=pinswg_projectlocation,pinswg_mapzoomlevel,pinswg_name,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,pinswg_projectname,pinswg_dnsid,_pinswg_associatedlpa_value,_pinswg_appellant_value&$filter=pinswg_anticipatedgridreferencenorthingtext ne null and pinswg_anticipatedgridreferenceeastingtext ne null&$count=true";
|
||||||
|
|
||||||
@@ -87,11 +78,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
const coordsObj = { value: [] };
|
const coordsObj = { value: [] };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// First Axios request
|
// First relay request
|
||||||
const dnsCoordsObj = await axios.get(
|
const dnsCoordsObj = await relayGetData({ queryUrl });
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeaders(token.access_token)
|
|
||||||
);
|
|
||||||
// Merge the first response's 'value' array into the coordsObj's value array
|
// Merge the first response's 'value' array into the coordsObj's value array
|
||||||
if (Array.isArray(dnsCoordsObj.data.value)) {
|
if (Array.isArray(dnsCoordsObj.data.value)) {
|
||||||
coordsObj.value = coordsObj.value.concat(dnsCoordsObj.data.value); // Concatenate arrays
|
coordsObj.value = coordsObj.value.concat(dnsCoordsObj.data.value); // Concatenate arrays
|
||||||
@@ -99,11 +87,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
coordsObj.value.push(dnsCoordsObj.data.value); // Push single value if it's not an array
|
coordsObj.value.push(dnsCoordsObj.data.value); // Push single value if it's not an array
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second Axios request
|
// Second relay request
|
||||||
const sipsCoordsObj = await axios.get(
|
const sipsCoordsObj = await relayGetData({ queryUrl: queryUrlSips });
|
||||||
WEBAPI_URL + queryUrlSips + hashAPIPath(queryUrlSips),
|
|
||||||
azureHeaders(token.access_token)
|
|
||||||
);
|
|
||||||
// Merge the second response's 'value' array into the coordsObj's value array
|
// Merge the second response's 'value' array into the coordsObj's value array
|
||||||
if (Array.isArray(sipsCoordsObj.data.value)) {
|
if (Array.isArray(sipsCoordsObj.data.value)) {
|
||||||
coordsObj.value = coordsObj.value.concat(sipsCoordsObj.data.value); // Concatenate arrays
|
coordsObj.value = coordsObj.value.concat(sipsCoordsObj.data.value); // Concatenate arrays
|
||||||
|
|||||||
@@ -1,40 +1,29 @@
|
|||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,pinswg_appealcasetype,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,statuscode,ticketnumber,title &$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
"incidents?$select=pinswg_environmentalstatementlocation,pinswg_appealcasetype,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,statuscode,ticketnumber,title &$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
let dataStr;
|
let dataStr;
|
||||||
|
|
||||||
_.has(data, "@odata.nextLink") === true &&
|
_.has(data, "@odata.nextLink") === true &&
|
||||||
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "DNS_LIST_FETCH_FAILED",
|
code: "DNS_LIST_FETCH_FAILED",
|
||||||
message: "Failed to fetch DNS list"
|
message: "Failed to fetch DNS list"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,16 +15,8 @@
|
|||||||
* 200:
|
* 200:
|
||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const emailAddress = req.query.emailAddress;
|
const emailAddress = req.query.emailAddress;
|
||||||
@@ -37,24 +29,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts?$filter=emailaddress1 eq '" +
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
emailAddress +
|
emailAddress +
|
||||||
"'&$count=true&$select=emailaddress1, contactid";
|
"'&$count=true&$select=emailaddress1, contactid";
|
||||||
const { data } = await axios.get(
|
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeaders(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return relayGet({
|
||||||
} catch (error) {
|
queryUrl,
|
||||||
consoleLogger(error);
|
res,
|
||||||
return respondError(res, {
|
errorResponse: {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "EMAIL_ACCOUNT_CHECK_FAILED",
|
code: "EMAIL_ACCOUNT_CHECK_FAILED",
|
||||||
message: "Failed to check email account"
|
message: "Failed to check email account"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const whichForm = req.query.whichForm;
|
const whichForm = req.query.whichForm;
|
||||||
@@ -20,26 +12,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode eq 'pinswg_" +
|
"systemforms?$select=formid,name,formxml,type,objecttypecode&$filter=(objecttypecode eq 'pinswg_" +
|
||||||
whichForm +
|
whichForm +
|
||||||
"' and type eq 2)&$count=true&$top=201";
|
"' and type eq 2)&$count=true&$top=201";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "FORM_DATA_FETCH_FAILED",
|
code: "FORM_DATA_FETCH_FAILED",
|
||||||
message: "Failed to fetch form data"
|
message: "Failed to fetch form data"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,16 +15,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
let searchString = req.query.searchString;
|
let searchString = req.query.searchString;
|
||||||
@@ -37,9 +29,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
searchString = searchString.replace(/\'/g, "''");
|
searchString = searchString.replace(/\'/g, "''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -47,18 +36,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
searchString +
|
searchString +
|
||||||
" and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true";
|
" and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "INCIDENT_BY_ID_FETCH_FAILED",
|
code: "INCIDENT_BY_ID_FETCH_FAILED",
|
||||||
message: "Failed to fetch incident by id"
|
message: "Failed to fetch incident by id"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,16 +15,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const searchString = req.query.searchString;
|
const searchString = req.query.searchString;
|
||||||
@@ -37,9 +29,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const escapedSearchString = searchString.split("'").join("''");
|
const escapedSearchString = searchString.split("'").join("''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -47,18 +36,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
escapedSearchString +
|
escapedSearchString +
|
||||||
" and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true";
|
" and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "IS_PUBLISHED_FETCH_FAILED",
|
code: "IS_PUBLISHED_FETCH_FAILED",
|
||||||
message: "Failed to fetch published state"
|
message: "Failed to fetch published state"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,16 +16,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const parentIncidentid = req.query.parentincidentid;
|
const parentIncidentid = req.query.parentincidentid;
|
||||||
@@ -41,26 +34,19 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$count=true&$filter=_parentcaseid_value eq " +
|
"incidents?$count=true&$filter=_parentcaseid_value eq " +
|
||||||
parentIncidentid +
|
parentIncidentid +
|
||||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true &$select=title, incidentid";
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true &$select=title, incidentid";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "LINKED_CASES_FETCH_FAILED",
|
code: "LINKED_CASES_FETCH_FAILED",
|
||||||
message: "Failed to fetch linked cases"
|
message: "Failed to fetch linked cases"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,16 +21,9 @@
|
|||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const emailAddress = req.query.emailAddress;
|
const emailAddress = req.query.emailAddress;
|
||||||
@@ -52,26 +45,21 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts?$filter=emailaddress1 eq '" +
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
emailAddress +
|
emailAddress +
|
||||||
"' and pinswg_custom_password eq '" +
|
"' and pinswg_custom_password eq '" +
|
||||||
pwd +
|
pwd +
|
||||||
"'&$count=true&$select=emailaddress1,contactid,pinswg_custom_password,yomifullname,firstname,lastname";
|
"'&$count=true&$select=emailaddress1,contactid,pinswg_custom_password,yomifullname,firstname,lastname";
|
||||||
const { data } = await axios.get(
|
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeadersPaged(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return relayGet({
|
||||||
} catch (error) {
|
queryUrl,
|
||||||
consoleLogger(error);
|
res,
|
||||||
return respondError(res, {
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "LOGIN_FETCH_FAILED",
|
code: "LOGIN_FETCH_FAILED",
|
||||||
message: "Failed to fetch login details"
|
message: "Failed to fetch login details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,36 +12,20 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "LPA_FETCH_FAILED",
|
code: "LPA_FETCH_FAILED",
|
||||||
message: "Failed to fetch local planning authorities"
|
message: "Failed to fetch local planning authorities"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -42,30 +34,25 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,pinswg_publishtoweb,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,pinswg_publishtoweb,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
element.pinswg_title = element.title;
|
element.pinswg_title = element.title;
|
||||||
});
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "MY_CASES_FETCH_FAILED",
|
code: "MY_CASES_FETCH_FAILED",
|
||||||
message: "Failed to fetch my cases"
|
message: "Failed to fetch my cases"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,18 +17,11 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import { getLPA } from "../../../actions/services/referenceDataService";
|
import { getLPA } from "../../../actions/services/referenceDataService";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const lpaid = req.query.lpaid;
|
const lpaid = req.query.lpaid;
|
||||||
@@ -42,7 +35,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const token = await getToken();
|
|
||||||
const lpaList = await getLPA();
|
const lpaList = await getLPA();
|
||||||
|
|
||||||
const lpaGUID = jsonpath({
|
const lpaGUID = jsonpath({
|
||||||
@@ -74,18 +66,23 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
//console.log("///////////\nPortal query: ", queryUrl, "<<<<end query");
|
//console.log("///////////\nPortal query: ", queryUrl, "<<<<end query");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
element.pinswg_title = element.title;
|
element.pinswg_title = element.title;
|
||||||
});
|
});
|
||||||
|
return data;
|
||||||
return respondSuccess(res, data);
|
},
|
||||||
|
errorResponse: {
|
||||||
|
status: 400,
|
||||||
|
code: "MY_LPA_CASES_FETCH_FAILED",
|
||||||
|
message: "Failed to fetch my LPA cases"
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
return respondError(res, {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "MY_LPA_CASES_FETCH_FAILED",
|
code: "MY_LPA_CASES_FETCH_FAILED",
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -42,26 +34,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "MY_REPRESENTATIONS_FETCH_FAILED",
|
code: "MY_REPRESENTATIONS_FETCH_FAILED",
|
||||||
message: "Failed to fetch my representations"
|
message: "Failed to fetch my representations"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -42,26 +34,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
"pinswg_representationses?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "MY_REPRESENTATIONS_PROXY_FETCH_FAILED",
|
code: "MY_REPRESENTATIONS_PROXY_FETCH_FAILED",
|
||||||
message: "Failed to fetch my representations proxy details"
|
message: "Failed to fetch my representations proxy details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
import axios from "axios";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const searchString = req.query.searchString;
|
const searchString = req.query.searchString;
|
||||||
@@ -21,8 +14,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const escapedSearchString = searchString.replace(/\'/g, "''");
|
const escapedSearchString = searchString.replace(/\'/g, "''");
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
@@ -32,23 +23,22 @@ export default async function ApiProxy(req, res) {
|
|||||||
escapedSearchString +
|
escapedSearchString +
|
||||||
"')) and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
"')) and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
let dataStr;
|
let dataStr;
|
||||||
_.has(data, "@odata.nextLink") === true &&
|
_.has(data, "@odata.nextLink") === true &&
|
||||||
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||||
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PART_SAVED_APPEAL_FETCH_FAILED",
|
code: "PART_SAVED_APPEAL_FETCH_FAILED",
|
||||||
message: "Failed to fetch part-saved appeals"
|
message: "Failed to fetch part-saved appeals"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const contactid = req.query.contactid;
|
const contactid = req.query.contactid;
|
||||||
@@ -39,24 +31,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts(" +
|
"contacts(" +
|
||||||
contactid +
|
contactid +
|
||||||
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode,pinswg_typeofinvolvement,pinswg_contact_associatedlpa,pinswg_preferredlanguage&$count=true";
|
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode,pinswg_typeofinvolvement,pinswg_contact_associatedlpa,pinswg_preferredlanguage&$count=true";
|
||||||
const { data } = await axios.get(
|
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeaders(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return relayGet({
|
||||||
} catch (error) {
|
queryUrl,
|
||||||
consoleLogger(error);
|
res,
|
||||||
return respondError(res, {
|
errorResponse: {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PERSONAL_ACCOUNT_FETCH_FAILED",
|
code: "PERSONAL_ACCOUNT_FETCH_FAILED",
|
||||||
message: "Failed to fetch personal account"
|
message: "Failed to fetch personal account"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,16 +16,10 @@
|
|||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { hashAPIPath } from "../../../actions/core/hash";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const emailAddress = req.query.emailAddress;
|
const emailAddress = req.query.emailAddress;
|
||||||
@@ -66,24 +60,19 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts?$filter=emailaddress1 eq '" +
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
emailAddress +
|
emailAddress +
|
||||||
"' and statuscode eq 1&$count=true&$select=emailaddress1,contactid,yomifullname,firstname,lastname";
|
"' and statuscode eq 1&$count=true&$select=emailaddress1,contactid,yomifullname,firstname,lastname";
|
||||||
const { data } = await axios.get(
|
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeadersPaged(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return relayGet({
|
||||||
} catch (error) {
|
queryUrl,
|
||||||
consoleLogger(error);
|
res,
|
||||||
return respondError(res, {
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PORTAL_LOGIN_FETCH_FAILED",
|
code: "PORTAL_LOGIN_FETCH_FAILED",
|
||||||
message: "Failed to fetch portal login"
|
message: "Failed to fetch portal login"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,16 +16,9 @@
|
|||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const emailAddress = req.query.emailAddress;
|
const emailAddress = req.query.emailAddress;
|
||||||
@@ -38,24 +31,19 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts?$filter=emailaddress1 eq '" +
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
emailAddress +
|
emailAddress +
|
||||||
"'&$count=true&$select=emailaddress1,contactid,yomifullname,firstname,lastname";
|
"'&$count=true&$select=emailaddress1,contactid,yomifullname,firstname,lastname";
|
||||||
const { data } = await axios.get(
|
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
|
||||||
azureHeadersPaged(token.access_token)
|
|
||||||
);
|
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return relayGet({
|
||||||
} catch (error) {
|
queryUrl,
|
||||||
consoleLogger(error);
|
res,
|
||||||
return respondError(res, {
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PORTAL_LOGIN_PROXY_FETCH_FAILED",
|
code: "PORTAL_LOGIN_PROXY_FETCH_FAILED",
|
||||||
message: "Failed to fetch portal login proxy details"
|
message: "Failed to fetch portal login proxy details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,17 +23,9 @@
|
|||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const appealType = req.query.appealType;
|
const appealType = req.query.appealType;
|
||||||
@@ -58,8 +50,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const escapedCaseReference = caseReference.split("'").join("''");
|
const escapedCaseReference = caseReference.split("'").join("''");
|
||||||
|
|
||||||
let queryUrl =
|
let queryUrl =
|
||||||
@@ -70,18 +60,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery(appealType);
|
queryUrl = queryUrl + getSelectQuery(appealType);
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PORTAL_MODULE_DETAILS_FETCH_FAILED",
|
code: "PORTAL_MODULE_DETAILS_FETCH_FAILED",
|
||||||
message: "Failed to fetch portal module details"
|
message: "Failed to fetch portal module details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,17 +23,9 @@
|
|||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const appealType = req.query.appealType;
|
const appealType = req.query.appealType;
|
||||||
@@ -58,8 +50,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const escapedCaseReference = caseReference.split("'").join("''");
|
const escapedCaseReference = caseReference.split("'").join("''");
|
||||||
|
|
||||||
let queryUrl =
|
let queryUrl =
|
||||||
@@ -70,18 +60,13 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery(appealType);
|
queryUrl = queryUrl + getSelectQuery(appealType);
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PORTAL_MODULE_DETAILS_PROXY_FETCH_FAILED",
|
code: "PORTAL_MODULE_DETAILS_PROXY_FETCH_FAILED",
|
||||||
message: "Failed to fetch portal module details proxy"
|
message: "Failed to fetch portal module details proxy"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,21 +15,13 @@
|
|||||||
* 200:
|
* 200:
|
||||||
* description: hello world
|
* description: hello world
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
|
||||||
import {
|
import {
|
||||||
escapeODataString,
|
escapeODataString,
|
||||||
isNonEmptyString,
|
isNonEmptyString,
|
||||||
sanitizeString
|
sanitizeString
|
||||||
} from "../../../actions/core/guards";
|
} from "../../../actions/core/guards";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const emailAddress = sanitizeString(req.query.emailAddress);
|
const emailAddress = sanitizeString(req.query.emailAddress);
|
||||||
@@ -42,25 +34,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"contacts?$filter=emailaddress1 eq '" +
|
"contacts?$filter=emailaddress1 eq '" +
|
||||||
escapeODataString(emailAddress) +
|
escapeODataString(emailAddress) +
|
||||||
"'&$count=true&$select=pinswg_preferredlanguage,contactid";
|
"'&$count=true&$select=pinswg_preferredlanguage,contactid";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PREFERRED_LANGUAGE_FETCH_FAILED",
|
code: "PREFERRED_LANGUAGE_FETCH_FAILED",
|
||||||
message: "Failed to fetch preferred language"
|
message: "Failed to fetch preferred language"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,36 +9,20 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_sipsprojecttypes?$select=pinswg_name,pinswg_sipsprojecttypeid&$orderby=pinswg_name asc&$count=true";
|
"pinswg_sipsprojecttypes?$select=pinswg_name,pinswg_sipsprojecttypeid&$orderby=pinswg_name asc&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "PROJECT_TYPES_FETCH_FAILED",
|
code: "PROJECT_TYPES_FETCH_FAILED",
|
||||||
message: "Failed to fetch project types"
|
message: "Failed to fetch project types"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const incidentID = req.query.incidentID;
|
const incidentID = req.query.incidentID;
|
||||||
@@ -39,26 +31,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
||||||
incidentID +
|
incidentID +
|
||||||
" and pinswg_publishtoweb eq true&$count=true&$orderby=createdon desc";
|
" and pinswg_publishtoweb eq true&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "REPRESENTATIONS_FETCH_FAILED",
|
code: "REPRESENTATIONS_FETCH_FAILED",
|
||||||
message: "Failed to fetch representations"
|
message: "Failed to fetch representations"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const incidentID = req.query.incidentID;
|
const incidentID = req.query.incidentID;
|
||||||
@@ -39,26 +31,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
"pinswg_representationses?$filter= _pinswg_case_value eq " +
|
||||||
incidentID +
|
incidentID +
|
||||||
"&$count=true&$orderby=createdon desc";
|
"&$count=true&$orderby=createdon desc";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "REPRESENTATIONS_PROXY_FETCH_FAILED",
|
code: "REPRESENTATIONS_PROXY_FETCH_FAILED",
|
||||||
message: "Failed to fetch representations proxy details"
|
message: "Failed to fetch representations proxy details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,16 +16,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const groupArray = (arr) => {
|
const groupArray = (arr) => {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
@@ -67,31 +60,26 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||||
incidentID +
|
incidentID +
|
||||||
" and pinswg_latestpublishedversion ne null and pinswg_latestpublisheddate ne null&$select=pinswg_isharedocumentlocations";
|
" and pinswg_latestpublishedversion ne null and pinswg_latestpublisheddate ne null&$select=pinswg_isharedocumentlocations";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
delete element["pinswg_documentid"];
|
delete element["pinswg_documentid"];
|
||||||
});
|
});
|
||||||
|
|
||||||
const dataArr = groupArray(data.value);
|
return groupArray(data.value);
|
||||||
return respondSuccess(res, dataArr);
|
},
|
||||||
} catch (error) {
|
errorResponse: {
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "SEARCH_DOCUMENT_TYPES_FETCH_FAILED",
|
code: "SEARCH_DOCUMENT_TYPES_FETCH_FAILED",
|
||||||
message: "Failed to fetch search document types"
|
message: "Failed to fetch search document types"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,21 +16,14 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const encryptDocReference = (documentRef) => {
|
const encryptDocReference = (documentRef) => {
|
||||||
var hashlink = CryptoJS.HmacSHA256(
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
"documents/download/" + documentRef,
|
"documents/download/" + documentRef,
|
||||||
@@ -55,19 +48,16 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||||
incidentID +
|
incidentID +
|
||||||
" and pinswg_latestpublishedversion ne null and pinswg_latestpublisheddate ne null&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference,pinswg_name,pinswg_latestpublishedversion,pinswg_latestpublisheddate,pinswg_documentpublisheddate";
|
" and pinswg_latestpublishedversion ne null and pinswg_latestpublisheddate ne null&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference,pinswg_name,pinswg_latestpublishedversion,pinswg_latestpublisheddate,pinswg_documentpublisheddate";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
transformData: (data) => {
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
Object.assign(element, {
|
Object.assign(element, {
|
||||||
"pinswg_documentpublisheddate":
|
"pinswg_documentpublisheddate":
|
||||||
@@ -85,13 +75,12 @@ export default async function ApiProxy(req, res) {
|
|||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "SEARCH_DOCUMENT_DETAILS_FETCH_FAILED",
|
code: "SEARCH_DOCUMENT_DETAILS_FETCH_FAILED",
|
||||||
message: "Failed to fetch search document details"
|
message: "Failed to fetch search document details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -42,21 +42,14 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
const encryptDocReference = (documentRef) => {
|
const encryptDocReference = (documentRef) => {
|
||||||
var hashlink = CryptoJS.HmacSHA256(
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
"documents/download/" + documentRef,
|
"documents/download/" + documentRef,
|
||||||
@@ -150,9 +143,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
//console.log("has this passed docuemntType:", documentType);
|
//console.log("has this passed docuemntType:", documentType);
|
||||||
//(documentType !="all" && " pinswg_pinswg_isharedocumentlocations eq " + )
|
//(documentType !="all" && " pinswg_pinswg_isharedocumentlocations eq " + )
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_documents?$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
"pinswg_documents?$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||||
incidentID +
|
incidentID +
|
||||||
@@ -164,15 +154,15 @@ export default async function ApiProxy(req, res) {
|
|||||||
fieldSort +
|
fieldSort +
|
||||||
"&$count=true" +
|
"&$count=true" +
|
||||||
(typeof pageNumber != "undefined"
|
(typeof pageNumber != "undefined"
|
||||||
? "&$skiptoken=" +
|
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
('<cookie pagenumber="' + pageNumber + '" />')
|
|
||||||
: "");
|
: "");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPagedCustom(token.access_token, showNumberOfRecords)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) =>
|
||||||
|
azureHeadersPagedCustom(accessToken, showNumberOfRecords),
|
||||||
|
transformData: (data) => {
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
Object.assign(element, {
|
Object.assign(element, {
|
||||||
"pinswg_documentpublisheddate":
|
"pinswg_documentpublisheddate":
|
||||||
@@ -190,13 +180,12 @@ export default async function ApiProxy(req, res) {
|
|||||||
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "SEARCH_DOCUMENT_DETAILS_PAGED_FETCH_FAILED",
|
code: "SEARCH_DOCUMENT_DETAILS_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch paged search document details"
|
message: "Failed to fetch paged search document details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,16 +16,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const documentID = req.query.documentid;
|
const documentID = req.query.documentid;
|
||||||
@@ -38,24 +31,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||||
documentID;
|
documentID;
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "SEARCH_DOCUMENT_HISTORY_FETCH_FAILED",
|
code: "SEARCH_DOCUMENT_HISTORY_FETCH_FAILED",
|
||||||
message: "Failed to fetch search document history"
|
message: "Failed to fetch search document history"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -42,16 +42,9 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
|
||||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { getToken } from "../../../actions/core/token";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const documentID = req.query.documentid;
|
const documentID = req.query.documentid;
|
||||||
@@ -64,9 +57,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
"pinswg_documenthistories?$count=true&$select=_pinswg_documentid_value,pinswg_createddate,pinswg_state,pinswg_fileexists,statecode,pinswg_publisheddate&$filter=_pinswg_documentid_value eq " +
|
||||||
documentID;
|
documentID;
|
||||||
@@ -75,18 +65,14 @@ export default async function ApiProxy(req, res) {
|
|||||||
// ? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
// ? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||||
// : "");
|
// : "");
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeadersPaged(token.access_token)
|
res,
|
||||||
);
|
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken),
|
||||||
|
errorResponse: {
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "SEARCH_DOCUMENT_HISTORY_PAGED_FETCH_FAILED",
|
code: "SEARCH_DOCUMENT_HISTORY_PAGED_FETCH_FAILED",
|
||||||
message: "Failed to fetch paged search document history"
|
message: "Failed to fetch paged search document history"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const caseid = req.query.caseid;
|
const caseid = req.query.caseid;
|
||||||
@@ -20,26 +12,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_sipsevents?$filter=_pinswg_sipseventsid_value eq " +
|
"pinswg_sipsevents?$filter=_pinswg_sipseventsid_value eq " +
|
||||||
caseid +
|
caseid +
|
||||||
"&$count=true";
|
"&$count=true";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
errorResponse: {
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
|
||||||
} catch (error) {
|
|
||||||
consoleLogger(error);
|
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "SIPS_EVENTS_FETCH_FAILED",
|
code: "SIPS_EVENTS_FETCH_FAILED",
|
||||||
message: "Failed to fetch SIPS events"
|
message: "Failed to fetch SIPS events"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -42,19 +34,15 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$select=pinswg_emailnotifications,modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
"&$select=pinswg_emailnotifications,modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
element.ticketnumber = element.pinswg_WatchedCase?.ticketnumber;
|
element.ticketnumber = element.pinswg_WatchedCase?.ticketnumber;
|
||||||
element.pinswg_title =
|
element.pinswg_title =
|
||||||
@@ -76,18 +64,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
element.pinswg_WatchedCase?.[
|
element.pinswg_WatchedCase?.[
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
];
|
];
|
||||||
element._ownerid_value = element.pinswg_WatchedCase?._ownerid_value;
|
element._ownerid_value =
|
||||||
|
element.pinswg_WatchedCase?._ownerid_value;
|
||||||
|
|
||||||
delete element.pinswg_WatchedCase;
|
delete element.pinswg_WatchedCase;
|
||||||
});
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "WATCHED_CASES_FETCH_FAILED",
|
code: "WATCHED_CASES_FETCH_FAILED",
|
||||||
message: "Failed to fetch watched cases"
|
message: "Failed to fetch watched cases"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,16 +17,8 @@
|
|||||||
* description: Success
|
* description: Success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import axios from "axios";
|
import { respondError } from "../middleware/apiResponse";
|
||||||
import { azureHeaders } from "../../../actions/core/headers";
|
import { relayGet } from "../middleware/relayForwarding";
|
||||||
import { consoleLogger } from "../../../actions/core/logger";
|
|
||||||
import { getToken } from "../../../actions/core/token";
|
|
||||||
import { hashAPIPath } from "../../../actions/core/hash";
|
|
||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
|
||||||
process.env.RELAY_ROOT ||
|
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
const loggedInUserId = req.query.loggedInUserId;
|
const loggedInUserId = req.query.loggedInUserId;
|
||||||
@@ -42,18 +34,15 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const token = await getToken();
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
"&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
||||||
|
|
||||||
const { data } = await axios.get(
|
return relayGet({
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
queryUrl,
|
||||||
azureHeaders(token.access_token)
|
res,
|
||||||
);
|
transformData: (data) => {
|
||||||
|
|
||||||
data.value.forEach(function (element) {
|
data.value.forEach(function (element) {
|
||||||
element.ticketnumber = element.pinswg_WatchedCase.ticketnumber;
|
element.ticketnumber = element.pinswg_WatchedCase.ticketnumber;
|
||||||
element.pinswg_title =
|
element.pinswg_title =
|
||||||
@@ -75,18 +64,18 @@ export default async function ApiProxy(req, res) {
|
|||||||
element.pinswg_WatchedCase[
|
element.pinswg_WatchedCase[
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
];
|
];
|
||||||
element._ownerid_value = element.pinswg_WatchedCase._ownerid_value;
|
element._ownerid_value =
|
||||||
|
element.pinswg_WatchedCase._ownerid_value;
|
||||||
|
|
||||||
delete element.pinswg_WatchedCase;
|
delete element.pinswg_WatchedCase;
|
||||||
});
|
});
|
||||||
|
|
||||||
return respondSuccess(res, data);
|
return data;
|
||||||
} catch (error) {
|
},
|
||||||
consoleLogger(error);
|
errorResponse: {
|
||||||
return respondError(res, {
|
|
||||||
status: 400,
|
status: 400,
|
||||||
code: "WATCHED_CASES_PROXY_FETCH_FAILED",
|
code: "WATCHED_CASES_PROXY_FETCH_FAILED",
|
||||||
message: "Failed to fetch watched cases proxy details"
|
message: "Failed to fetch watched cases proxy details"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import { azureHeaders } from "../../../actions/core/headers";
|
||||||
|
import { consoleLogger } from "../../../actions/core/logger";
|
||||||
|
import { getToken } from "../../../actions/core/token";
|
||||||
|
import { hashAPIPath } from "../../../actions/core/hash";
|
||||||
|
import { respondError, respondSuccess } from "./apiResponse";
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
export const relayGet = async ({
|
||||||
|
queryUrl,
|
||||||
|
res,
|
||||||
|
errorResponse,
|
||||||
|
transformData,
|
||||||
|
requestOptionsBuilder
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const { data, accessToken } = await relayGetData({
|
||||||
|
queryUrl,
|
||||||
|
requestOptionsBuilder
|
||||||
|
});
|
||||||
|
|
||||||
|
return respondSuccess(
|
||||||
|
res,
|
||||||
|
typeof transformData === "function"
|
||||||
|
? await transformData(data, accessToken)
|
||||||
|
: data
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
consoleLogger(error);
|
||||||
|
return respondError(res, errorResponse);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const relayGetData = async ({
|
||||||
|
queryUrl,
|
||||||
|
requestOptionsBuilder,
|
||||||
|
accessToken
|
||||||
|
}) => {
|
||||||
|
return forwardGetData({
|
||||||
|
queryUrl,
|
||||||
|
requestOptionsBuilder,
|
||||||
|
accessToken
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const forwardGetData = async ({
|
||||||
|
baseUrl,
|
||||||
|
queryUrl,
|
||||||
|
requestOptionsBuilder,
|
||||||
|
accessToken,
|
||||||
|
appendHash = true
|
||||||
|
}) => {
|
||||||
|
const tokenAccessToken =
|
||||||
|
typeof accessToken === "string" && accessToken.length > 0
|
||||||
|
? accessToken
|
||||||
|
: (await getToken()).access_token;
|
||||||
|
|
||||||
|
const resolvedBaseUrl = baseUrl || WEBAPI_URL;
|
||||||
|
const finalUrl =
|
||||||
|
resolvedBaseUrl + queryUrl + (appendHash ? hashAPIPath(queryUrl) : "");
|
||||||
|
|
||||||
|
const { data } = await axios.get(
|
||||||
|
finalUrl,
|
||||||
|
typeof requestOptionsBuilder === "function"
|
||||||
|
? requestOptionsBuilder(tokenAccessToken)
|
||||||
|
: azureHeaders(tokenAccessToken)
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
data,
|
||||||
|
accessToken: tokenAccessToken
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -41,6 +41,8 @@ const loadModule = (relativePath, injected = {}) => {
|
|||||||
source +=
|
source +=
|
||||||
'\nif (typeof ApiProxy !== "undefined" && !module.exports.default) module.exports.default = ApiProxy;\n';
|
'\nif (typeof ApiProxy !== "undefined" && !module.exports.default) module.exports.default = ApiProxy;\n';
|
||||||
|
|
||||||
|
const defaultRelayGet = async () => ({});
|
||||||
|
|
||||||
const context = {
|
const context = {
|
||||||
module: { exports: {} },
|
module: { exports: {} },
|
||||||
exports: {},
|
exports: {},
|
||||||
@@ -52,6 +54,7 @@ const loadModule = (relativePath, injected = {}) => {
|
|||||||
warn: () => {},
|
warn: () => {},
|
||||||
error: () => {}
|
error: () => {}
|
||||||
},
|
},
|
||||||
|
relayGet: defaultRelayGet,
|
||||||
...injected
|
...injected
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user